From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.bugs Subject: bug#17684: #22873 (multiple fake cursors); and, #17684 (crosshairs). Date: Sat, 20 Apr 2019 22:15:47 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sat_Apr_20_22:15:46_2019-1" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="40251"; mail-complaints-to="usenet@blaine.gmane.org" Cc: athird@googlemail.com, mbork@mbork.pl, rms@gnu.org, johnw@gnu.org, akioburns@icloud.com, agrambot@gmail.com To: 22873@debbugs.gnu.org,17684@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 21 07:22:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hI4va-0006p3-NV for geb-bug-gnu-emacs@m.gmane.org; Sun, 21 Apr 2019 07:22:12 +0200 Original-Received: from localhost ([127.0.0.1]:49061 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hI4vZ-0005QF-JQ for geb-bug-gnu-emacs@m.gmane.org; Sun, 21 Apr 2019 01:22:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hI4vL-0005Pl-7G for bug-gnu-emacs@gnu.org; Sun, 21 Apr 2019 01:21:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hI4pf-0005mI-Kn for bug-gnu-emacs@gnu.org; Sun, 21 Apr 2019 01:16:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33733) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hI4pe-0005lt-FC for bug-gnu-emacs@gnu.org; Sun, 21 Apr 2019 01:16:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hI4pe-0000B0-1z for bug-gnu-emacs@gnu.org; Sun, 21 Apr 2019 01:16:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Keith David Bershatsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Apr 2019 05:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17684 X-GNU-PR-Package: emacs Original-Received: via spool by 17684-submit@debbugs.gnu.org id=B17684.1555823754661 (code B ref 17684); Sun, 21 Apr 2019 05:16:01 +0000 Original-Received: (at 17684) by debbugs.gnu.org; 21 Apr 2019 05:15:54 +0000 Original-Received: from localhost ([127.0.0.1]:47278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hI4pW-0000AZ-Nh for submit@debbugs.gnu.org; Sun, 21 Apr 2019 01:15:54 -0400 Original-Received: from gateway20.websitewelcome.com ([192.185.62.46]:12207) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hI4pU-0000AG-JD for 17684@debbugs.gnu.org; Sun, 21 Apr 2019 01:15:53 -0400 Original-Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 1C133400C74B8 for <17684@debbugs.gnu.org>; Sun, 21 Apr 2019 00:15:52 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id I4pThsVxcdnCeI4pTheaIv; 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==; Original-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 ) id 1hI4pQ-004D4p-7b; Sun, 21 Apr 2019 00:15:50 -0500 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-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:55242 X-Source-Auth: lawlist X-Email-Count: 8 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:157925 Archived-At: --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 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Cis7OzsgQkVHSU4gbW9kaWZpY2F0aW9uIG9mIHRoZSBNdWx0aXBsZSBDdXJzb3Jz IGxpYnJhcnkgd3JpdHRlbiBieSAgTWFnbmFyIFN2ZWVuLgorCisoZGVmdmFyIHBhY2thZ2UtYXJj aGl2ZXMpCisKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsKQorKGRlZnZhciBtYy9t YXgtY3Vyc29ycykKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsKQorKGRlZnZhciBt Yy9tYXgtY3Vyc29ycykKKyhkZWZ2YXIgbWMvYWx3YXlzLXJ1bi1mb3ItYWxsKQorKGRlZnZhciBt Yy0tdGhpcy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G9yZWQgbGF0ZXIuIgorICAgICh1bmxlc3MgbWMtLW1heC1jdXJzb3JzLW9yaWdp bmFsCisgICAgICAoc2V0cSBtYy0tbWF4LWN1cnNvcnMtb3JpZ2luYWwgbWMvbWF4LWN1cnNvcnMp KQorICAgICh3aGVuIG1jL21heC1jdXJzb3JzCisgICAgICAodW5sZXNzICg8IChtYy9udW0tY3Vy c29ycykgbWMvbWF4LWN1cnNvcnMpCisgICAgICAgIChpZiAoeWVzLW9yLW5vLXAgKGZvcm1hdCAi JWQgYWN0aXZlIGN1cnNvcnMuIENvbnRpbnVlPyAiIChtYy9udW0tY3Vyc29ycykpKQorICAgICAg ICAgICAgKHNldHEgbWMvbWF4LWN1cnNvcnMgKHJlYWQtbnVtYmVyICJFbnRlciBhIG5ldywgdGVt cG9yYXJ5IG1heGltdW06ICIpKQorICAgICAgICAgIChtYy9yZW1vdmUtZmFrZS1jdXJzb3JzKQor ICAgICAgICAgIChlcnJvciAiQWJvcnRlZDogdG9vIG1hbnkgY3Vyc29ycyIpKSkpCisgICAgKGxl dCAoKG92ZXJsYXkKKyAgICAgICAgICAgIChpZiBtYy91c2UtYnVpbHQtaW4tY3Vyc29ycworICAg ICAgICAgICAgICAobWFrZS1vdmVybGF5IChwb2ludCkgKHBvaW50KSkKKyAgICAgICAgICAgICAg KG1jL21ha2UtY3Vyc29yLW92ZXJsYXktYXQtcG9pbnQpKSkpCisgICAgICAob3ZlcmxheS1wdXQg b3ZlcmxheSAnbWMtaWQgKG9yIGlkIChtYy9jcmVhdGUtY3Vyc29yLWlkKSkpCisgICAgICAob3Zl cmxheS1wdXQgb3ZlcmxheSAndHlwZSAnZmFrZS1jdXJzb3IpCisgICAgICAob3ZlcmxheS1wdXQg b3ZlcmxheSAncHJpb3JpdHkgMTAwKQorICAgICAgKG1jL3N0b3JlLWN1cnJlbnQtc3RhdGUtaW4t b3ZlcmxheSBvdmVybGF5KQorICAgICAgKHdoZW4gKHVzZS1yZWdpb24tcCkKKyAgICAgIC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jb21tYW5kCisgICAgICAgICAgKGxldCAoKG9yaWdpbmFsLWNvbW1hbmQgKG9yIG1jLS10aGlz LWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNvbW1hbmQt cmVtYXBwaW5nIHRoaXMtb3JpZ2luYWwtY29tbWFuZCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgdGhpcy1vcmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAgICAgICA7OyBz 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 LXRoaXMgMSkpCisKKyAgKGRlZnVuIG1jL21hcmstcHJldmlvdXMtbGlrZS10aGl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stbW9kZQorICAgICh1bmxlc3MgKG9yIChtZW1xIGxhc3Qt 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 aG9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bG9jYWwtdmFyaWFibGUgJystLXNhdmVkLXN0YXRl 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 bC12YXJpYWJsZSAnY3Jvc3NoYWlycykKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdmYy12 aXNpYmxlKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ2Rpc3BsYXktbGluZS1udW1iZXJz KQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ2Rpc3BsYXktbGluZS1udW1iZXJzLXdpZHRo KQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ21jLWNvbmYpCisgICAgICAoa2lsbC1sb2Nh bC12YXJpYWJsZSAnYnVmZmVyLWRpc3BsYXktdGFibGUpCisgICAgICAoa2lsbC1sb2NhbC12YXJp YWJsZSAndGFiLXdpZHRoKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ2xpbmUtbW92ZS12 aXN1YWwpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAndHJ1bmNhdGUtbGluZXMpCisgICAg ICAoa2lsbC1sb2NhbC12Y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gICAgICAgIChwb3MxCisgICAgICAgICAgIChjb25kCisgICAgICAgICAgICAgKChh 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 ICAgICAgICAgICAgICAgICstcGFyZW5zLWZvdXItZmFjZQorICAgICAgICAgICAgICAgICAgICAr LXBhcmVucy1maXZlLWZhY2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtc2l4LWZhY2UK KyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtc2V2ZW4tZmFjZQorICAgICAgICAgICAgICAg ICAgICArLXBhcmVucy1laWdodC1mYWNlCisgICAgICAgICAgICAgICAgICAgICstcGFyZW5zLW5p bmUtZmFjZQorICAgICAgICAgICAgICAgICAgICArLXBhcmVucy10ZW4tZmFjZSkpCisgICAgICAo Ky1yZW1vdmUtb3ZlcmxheXMgbmlsIG5pbCAnZmFjZSBmYWNlKSkKKyAgICAoc2V0cSArLXBhcmVu cy1vdmVybGF5cy1leGlzdC1wIG5pbCkpKQorCis7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Oz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Li54eC4uLiIKKyJ4eHh4 eHh4eCIKKyIueHh4eHh4LiIKKyIuLnh4eHguLiIKKyIuLi54eC4uLiIpIG5pbCBuaWwgJ2JvdHRv bSkKKworKGRlZmluZS1mcmluZ2UtYml0bWFwICcrLWZyaW5nZS1sZWZ0LWN1cmx5LWFycm93ICgr LWZyaW5nZS1oZWxwZXItZGVjaW1hbAorIi4uLnh4eHguIgorIi4ueHh4eHguIgorIi54eC4uLi4u IgorIi54eHguLnguIgorIi54eHh4eHguIgorIi4ueHh4eHguIgorIi4uLnh4eHguIgorIi4ueHh4 eHguIikgbmlsIG5pbCAnY2VudGVyKQorCisoZGVmaW5lLWZyaW5nZS1iaXRtYXAgJystZnJpbmdl LXJpZ2h0LWN1cmx5LWFycm93ICgrLWZyaW5nZS1oZWxwZXItZGVjaW1hbAorIi54eHh4Li4uIgor Ii54eHh4eC4uIgorIi4uLi4ueHguIgorIi54Li54eHguIgorIi54eHh4eHguIgorIi54eHh4eC4u IgorIi54eHh4Li4uIgorIi54eHh4eC4uIikgbmlsIG5pbCAnY2VudGVyKQorCisoZGVmaW5lLWZy aW5nZS1iaXRtYXAgJystZnJpbmdlLWxlZnQtdHJpYW5nbGUgKCstZnJpbmdlLWhlbHBlci1kZWNp bWFsCisiLi4uLi4ueHgiCisiLi4uLnh4eHgiCisiLi4ueHh4eHgiCisiLi54eHh4eHgiCisiLi54 eHh4eHgiCisiLi4ueHh4eHgiCisiLi4uLnh4eHgiCisiLi4uLi4ueHgiKSBuaWwgbmlsICdjZW50 ZXIpCisKKyhkZWZpbmUtZnJpbmdlLWJpdG1hcCAnKy1mcmluZ2UtcmlnaHQtdHJpYW5nbGUgKCst ZnJpbmdlLWhlbHBlci1kZWNpbWFsCisieHguLi4uLi4iCisieHh4eC4uLi4iCisieHh4eHguLi4i CisieHh4eHh4Li4iCisieHh4eHh4Li4iCisieHh4eHguLi4iCisieHh4eC4uLi4iCisieHguLi4u Li4iKSBuaWwgbmlsICdjZW50ZXIpCisKK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CisieHh4eHh4Li4iCisi eHguLi4uLi4iCisieHguLi4uLi4iCisieHguLi4uLi4iCisieHguLi4uLi4iCisieHguLi4uLi4i CisieHguLi4uLi4iCisieHh4eHh4Li4iCisieHh4eHh4Li4iKSBuaWwgbmlsICdjZW50ZXIpCisK KyhkZWZpbmUtZnJpbmdlLWJpdG1hcCAnKy1mcmluZ2UtcmlnaHQtYnJhY2tldCAoKy1mcmluZ2Ut aGVscGVyLWRlY2ltYWwKKyIuLnh4eHh4eCIKKyIuLnh4eHh4eCIKKyIuLi4uLi54eCIKKyIuLi4u Li54eCIKKyIuLi4uLi54eCIKKyIuLi4uLi54eCIKKyIuLi4uLi54eCIKKyIuLi4uLi54eCIKKyIu Lnh4eHh4eCIKKyIuLnh4eHh4eCIpIG5pbCBuaWwgJ2NlbnRlcikKKworKGRlZmluZS1mcmluZ2Ut Yml0bWFwICcrLWZyaW5nZS1maWxsZWQtcmVjdGFuZ2xlICgrLWZyaW5nZS1oZWxwZXItZGVjaW1h bAorInh4eHh4eHguIgorInh4eHh4eHguIgorInh4eHh4eHguIgorInh4eHh4eHguIgorInh4eHh4 eHguIgorInh4eHh4eHguIgorInh4eHh4eHguIgorInh4eHh4eHguIgorInh4eHh4eHguIgorInh4 eHh4eHguIgorInh4eHh4eHguIgorInh4eHh4eHguIgorInh4eHh4eHguIikgbmlsIG5pbCAnY2Vu dGVyKQorCisoZGVmaW5lLWZyaW5nZS1iaXRtYXAgJystZnJpbmdlLWhvbGxvdy1zcXVhcmUgKCst ZnJpbmdlLWhlbHBlci1kZWNpbWFsCisiLnh4eHh4eC4iCisiLnguLi4ueC4iCisiLnguLi4ueC4i CisiLnguLi4ueC4iCisiLnguLi4ueC4iCisiLnh4eHh4eC4iKSBuaWwgbmlsICdjZW50ZXIpCisK KyhkZWZpbmUtZnJpbmdlLWJpdG1hcCAnKy1mcmluZ2UtZmlsbGVkLXNxdWFyZSAoKy1mcmluZ2Ut aGVscGVyLWRlY2ltYWwKKyIueHh4eHh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W50 ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZp eC1hcmcgJyg0KSkpCisgICAgICAgIChnbG9iYWwtZWxkb2MtbW9kZSAtMSkpCisgICAgICAod2hl biAoYW5kIGppdC1sb2NrLWNvbnRleHQtdGltZXIKKyAgICAgICAgICAgICAgICAgKGNhbGxlZC1p bnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJl Zml4LWFyZyAnKDQpKSkKKyAgICAgICAgKHdoZW4gKHRpbWVycCBqaXQtbG9jay1jb250ZXh0LXRp bWVyKQorICAgICAgICAgIChjYW5jZWwtdGltZXIgaml0LWxvY2stY29udGV4dC10aW1lcikpCisg ICAgICAgIDs7IChzZXRxIGppdC1sb2NrLWNvbnRleHQtdGltZXIgKHJ1bi13aXRoLWlkbGUtdGlt ZXIgNS4wICdyZXBlYXQgJ2ppdC1sb2NrLWNvbnRleHQtZm9udGlmeSkpCisgICAgICAgIChzZXRx IGppdC1sb2NrLWNvbnRleHQtdGltZXIgbmlsKSkKKyAgICAgICh3aGVuIChhbmQgKGNhbGxlZC1p bnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJl Zml4LWFyZyAnKDQpKSkKKyAgICAgICAgKHdoZW4gKHRpbWVycCB1bmRvLWF1dG8tY3VycmVudC1i b3VuZGFyeS10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVyIHVuZG8tYXV0by1jdXJyZW50 LWJvdW5kYXJ5LXRpbWVyKSkKKyAgICAgICAgKGZzZXQgJ3VuZG8tYXV0by0tdW5kb2FibGUtY2hh bmdlCisgICAgICAgICAgICAgIChsYW1iZGEgKCkgKGFkZC10by1saXN0ICd1bmRvLWF1dG8tLXVu ZG9hYmx5LWNoYW5nZWQtYnVmZmVycyAoY3VycmVudC1idWZmZXI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 IHVzZXJzIHdpbGwgcHJvYmFibHkgbm90IHdhbnQgdGhpcyBwYXJ0aWN1bGFyIHNldHRpbmcuCisg ICAgICAodW5sZXNzIChudWxsIGJpZGktZGlzcGxheS1yZW9yZGVyaW5nKQorICAgICAgICAoc2V0 cSBiaWRpLWRpc3BsYXktcmVvcmRlcmluZyBuaWwpKQorICAgICAgKHVubGVzcyAoYW5kIChjYWxs ZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgICAgKGVxdWFsIGN1cnJl bnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAgKHNldHEgZmlsbC1jb2x1bW4gODApCisgICAg ICAgIChhZGQtaG9vayAnY2hhbmdlLW1ham9yLW1vZGUtaG9vayAndHVybi1vZmYtZmMtbW9kZSBu aWwgJ2xvY2FsKSkKKyAgICAgICh3aGVuIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisg ICAgICAgIChpZiAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpCisgICAgICAgICAgKG1l c3NhZ2UgIlR1cm5lZCBPTiBgZmMtbW9kZScgLS0gZGVidWdnaW5nIG1vZGUuIikKKyAgICAgICAg ICAobWVzc2FnZSAiVHVybmVkIE9OIGBmYy1tb2RlJy4iKSkpKQorICAgICh0CisgICAgICAoa2ls bC1sb2NhbC12YXJpYWJsZSAnZmlsbC1jb2x1bW4pCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJs ZSAnZmMtdmlzaWJsZSkKKyAgICAgIChyZW1vdmUtaG9vayAnY2hhbmdlLW1ham9yLW1vZGUtaG9v ayAndHVybi1vZmYtZmMtbW9kZSAnbG9jYWwpCisgICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0 aXZlbHktcCAnYW55KQorICAgICAgICAobWVzc2FnZSAiVHVybmVkIE9GRiBgZmMtbW9kZScuIikp KSkpCisKKyhkZWZ1biB0dXJuLW9mZi1mYy1tb2RlICgpCisgIChmYy1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JzZXRfbWNfaW5h Y3RpdmVfd2luZG93cyAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBi LT5tY19pbmFjdGl2ZV93aW5kb3dzXyA9IHZhbDsKK30KKworc3RhdGljIHZvaWQKK2JzZXRfY3Jv c3NoYWlycyAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBiLT5jcm9z c2hhaXJzXyA9IHZhbDsKK30KKworc3RhdGljIHZvaWQKK2JzZXRfY2hfaG9yaXpvbnRhbF9ydWxl ciAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBiLT5jaF9ob3Jpem9u dGFsX3J1bGVyXyA9IHZhbDsKK30KKworc3RhdGljIHZvaWQKK2JzZXRfY2hfdmVydGljYWxfcnVs ZXIgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkKK3sKKyAgYi0+Y2hfdmVydGlj YWxfcnVsZXJfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAorYnNldF9jaF9pbmFjdGl2ZV93aW5k b3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPmNoX2luYWN0 aXZlX3dpbmRvd3NfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAorYnNldF9mY192aXNpYmxlIChz dHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPmZjX3Zpc2libGVfID0g dmFsOworfQorCitzdGF0aWMgdm9pZAorYnNldF9mY19pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3Qg YnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPmZjX2luYWN0aXZlX3dpbmRvd3Nf ID0gdmFsOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKio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qKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBERUZTWU0gKFFtY19y ZWFsX2Zha2VfY3Vyc29yLCAibWMtcmVhbC1mYWtlLWN1cnNvciIpOworICBERUZTWU0gKFFtY19j b25mLCAibWMtY29uZiIpOworICBERUZTWU0gKFFtY19pbmFjdGl2ZV93aW5kb3dzLCAibWMtaW5h Y3RpdmUtd2luZG93cyIpOworICBERUZTWU0gKFFjcm9zc2hhaXJzLCAiY3Jvc3NoYWlycyIpOwor ICBERUZTWU0gKFFjaF9ob3Jpem9udGFsX3J1bGVyLCAiY2gtaG9yaXpvbnRhbC1ydWxlciIpOwor ICBERUZTWU0gKFFjaF92ZXJ0aWNhbF9ydWxlciwgImNoLXZlcnRpY2FsLXJ1bGVyIik7CisgIERF RlNZTSAoUWNoX2luYWN0aXZlX3dpbmRvd3MsICJjaC1pbmFjdGl2ZS13aW5kb3dzIik7CisgIERF RlNZTSAoUWZjX3Zpc2libGUsICJmYy12aXNpYmxlIik7CisgIERFRlNZTSAoUWZjX3Zpc2libGVf aW5hY3RpdmVfd2luZG93LCAiZmMtaW5hY3RpdmUtd2luZG93Iik7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKICAgREVGU1lNIChRY2hvaWNlLCAiY2hvaWNlIik7CiAgIERFRlNZTSAo UWxlZnQsICJsZWZ0Iik7CiAgIERFRlNZTSAoUXJpZ2h0LCAicmlnaHQiKTsKQEAgLTU1MDEsNiAr NTYxNyw0MSBAQCBzeW1zX29mX2J1ZmZlciAodm9pZCkKICAgRnB1dCAoUXByb3RlY3RlZF9maWVs ZCwgUWVycm9yX21lc3NhZ2UsCiAJYnVpbGRfcHVyZV9jX3N0cmluZyAoIkF0dGVtcHQgdG8gbW9k aWZ5IGEgcHJvdGVjdGVkIGZpZWxkIikpOwogCisKKy8qICoqKioqKioqKioqKioqK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IFdoZW4gbm9uLW5pbCwgZHJhdyBtdWx0 aXBsZSBjdXJzb3JzIGZpbGwgY29sdW1uIGluIGluYWN0aXZlIHdpbmRvd3MuICovKTsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICBERUZWQVJfUEVSX0JVRkZFUiAoImhlYWRlci1s aW5lLWZvcm1hdCIsCiAJCSAgICAgJkJWQVIgKGN1cnJlbnRfYnVmZmVyLCBoZWFkZXJfbGluZV9m b3JtYXQpLAogCQkgICAgIFFuaWwsCmRpZmYgLS1naXQgYS9zcmMvYnVmZmVyLmggYi9zcmMvYnVm ZmVyLmgKaW5kZXggZjQyYzNlOS4uZmZmN2M2MiAxMDA2NDQKLS0tIGEvc3JjL2J1ZmZlci5oCisr KyBiL3NyYy9idWZmZXIuaApAQCAtNjM2LDYgKzYzNiw0MCBAQCBzdHJ1Y3QgYnVmZmVyCiAgICAg IGNhY2hlIGFyZSBlbmFibGVkLiAgU2VlIHNlYXJjaC5jLCBpbmRlbnQuYyBhbmQgYmlkaS5jIGZv ciBkZXRhaWxzLiAgKi8KICAgTGlzcF9PYmplY3QgY2FjaGVfbG9uZ19zY2Fuc187CiAKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogVGhl IGN1cnNvciB0eXBlIG9mIHRoZSByZWFsIGZha2UgY3Vyc29yLiAqLworICBMaXNwX09iamVjdCBt Y19yZWFsX2Zha2VfY3Vyc29yXzsKKworICAvKiBUaGUgbmFtZSBvZiBsaXN0IHVzZWQgYnkgbXVs dGlwbGUgY3Vyc29ycyBmb3IgbmV4dCByZWRpc3BsYXkuICovCisgIExpc3BfT2JqZWN0IG1jX2Nv bmZfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBtdWx0aXBsZSBjdXJzb3JzIGluIGluYWN0aXZl IHdpbmRvd3MuICovCisgIExpc3BfT2JqZWN0IG1jX2luYWN0aXZlX3dpbmRvd3NfOworCisgIC8q IFRoZSBuYW1lIG9mIHRoZSBidWZmZXItbG9jYWwgdmFyaWFibGUuICovCisgIExpc3BfT2JqZWN0 IGNyb3NzaGFpcnNfOworCisgIC8qIFRoZSBuYW1lIG9mIHRoZSBjcm9zc2hhaXJzIGhvcml6b250 YWwgcnVsZXIuICovCisgIExpc3BfT2JqZWN0IGNoX2hvcml6b250YWxfcnVsZXJfOworCisgIC8q IFRoZSBuYW1lIG9mIHRoZSBjcm9zc2hhaXJzIHZlcnRpY2FsIHJ1bGVyLiAqLworICBMaXNwX09i amVjdCBjaF92ZXJ0aWNhbF9ydWxlcl87CisKKyAgLyogV2hldGhlciB0byBkcmF3IGNyb3NzaGFp cnMgaW4gaW5hY3RpdmUgd2luZG93cy4gKi8KKyAgTGlzcF9PYmplY3QgY2hfaW5hY3RpdmVfd2lu ZG93c187CisKKyAgLyogVGhlIG5hbWUgb2YgdGhlIGJ1ZmZlci1sb2NhbCB2YXJpYWJsZS4gKi8K KyAgTGlzcF9PYmplY3QgZmNfdmlzaWJsZV87CisKKyAgLyogV2hldGhlciB0byBkcmF3IG11bHRp cGxlIGN1cnNvcnMgZmlsbCBjb2x1bW4gaW4gaW5hY3RpdmUgd2luZG93cy4gKi8KKyAgTGlzcF9P YmplY3QgZmNfaW5hY3RpdmVfd2luZG93c187CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICAgLyogSWYgdGhlIHdpZHRoIHJ1biBjYWNoZSBpcyBlbmFibGVkLCB0aGlzIHRhYmxlIGNv bnRhaW5zIHRoZQogICAgICBjaGFyYWN0ZXIgd2lkdGhzIHdpZHRoX3J1bl9jYWNoZSAoc2VlIGFi b3ZlKSBhc3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qKioqKioqKioqKioqKioqKioqKioqKioqKioq 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 KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogVGhlIHdpbmRvdyBpbiB3aGljaCB3ZSBp dGVyYXRlIG92ZXIgY3VycmVudF9idWZmZXIgKG9yIGEgc3RyaW5nKS4gICovCiAgIExpc3BfT2Jq ZWN0IHdpbmRvdzsKICAgc3RydWN0IHdpbmRvdyAqdzsKQEAgLTI4MTIsNiArMjg4MSwzNCBAQCB0 eXBlZGVmIHZvaWQgKCpmcmFtZV9wYXJtX2hhbmRsZXIpIChzdHJ1Y3QgZnJhbWUgKiwgTGlzcF9P YmplY3QsIExpc3BfT2JqZWN0KTsKIAogc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UKIHsKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyog YHJlZGlzcGxheV9pbnR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BoX2ZsYXZvciwgYm9vbCBvbl9w 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 b3IsIGludCwgaW50LCBzdHJ1Y3QgbWNfUkdC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XRy aXggKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93 ICosIGVudW0gZHJhd19nbHlwaHNfZmFjZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBpbnQsIGludCwgaW50LCBkb3VibGUsIGRvdWJsZSwgZG91YmxlLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfZmxhdm9yLCBlbnVtIHR5cGVfb2ZfY3Vyc29y LCBpbnQsIGJvb2wsIGJvb2wpOworCitleHRlcm4gdm9pZCBtY194X3dyaXRlX2dseXBocyAoc3Ry dWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKiwgZW51bSBnbHlw aF9yb3dfYXJlYSwgaW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCwgaW50 LCBkb3VibGUsIGRvdWJsZSwgZG91YmxlLCBlbnVtIG1jX2ZsYXZvciwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBlbnVtIHR5cGVfb2ZfY3Vyc29yLCBpbnQsIGJvb2wsIGJvb2wpOwor CisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogI2lmZGVmIEdMWVBIX0RFQlVHCiBleHRlcm4gdm9pZCBkdW1wX2dseXBoX3N0cmluZyAoc3Ry dWN0IGdseXBoX3N0cmluZyAqKSBFWFRFUk5BTExZX1ZJU0lCTEU7CiAjZW5kaWYKZGlmZiAtLWdp dCBhL3NyYy9kaXNwbmV3LmMgYi9zcmMvZGlzcG5ldy5jCmluZGV4IGNjYjA4ZWMuLmFkNWJkM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nVzZWRbVEVYVF9BUkVBXSkKKyAgICAg IHsKKyAgICAgICAgaW50IHN0YXJ0X3ggPSB4LCBzdGFydF9ocG9zID0gaTsKKyAgICAgICAgc3Ry dWN0IGdseXBoICpzdGFydCA9IGRlc2lyZWRfZ2x5cGg7CisgICAgICAgIGludCBjdXJyZW50X3gg PSB4OworICAgICAgICBib29sIHNraXBfZmlyc3RfcCA9ICFjYW5fc2tpcF9wOworCisgICAgICAg IC8qIEZpbmQgdGhlIG5leHQgZ2x5cGggdGhhdCdzIGVxdWFsIGFnYWluLiAgKi8KKyAgICAgICAg d2hpbGUgKGkgPCBzdG9wCisgICAgICAgICAmJiAoc2tpcF9maXJzdF9wCisgICAgICAgfHwgIUdM WVBIX0VRVUFMX1AgKGRlc2lyZWRfZ2x5cGgsIGN1cnJlbnRfZ2x5cGgpKQorICAgICAgICAgJiYg eCA9PSBjdXJyZW50X3gpCisgICAgeworICAgICAgeCArPSBkZXNpcmVkX2dseXBoLT5waXhlbF93 aWR0aDsKKyAgICAgIGN1cnJlbnRfeCArPSBjdXJyZW50X2dseXBoLT5waXhlbF93aWR0aDsKKyAg ICAgICsrZGVzaXJlZF9nbHlwaCwgKytjdXJyZW50X2dseXBoLCArK2k7CisgICAgICBza2lwX2Zp cnN0X3AgPSAwOworICAgIH0KKworICBpZiAoZGVidWdfcAorICAgICAgJiYgdnBvcyAhPSBib3R0 b21fdnBvcworICAgICAgJiYgIU5JTFAgKGlfc3RvcmUpKQorICAgIHsKKyAgICAgIExpc3BfT2Jq ZWN0IHN0cmluZyA9IEZwcmluMV90b19zdHJpbmcgKGlfc3RvcmUsIFFuaWwpOworICAgICAgY2hh ciAqY2hhcl9zdHJpbmcgPSBTU0RBVEEgKHN0cmluZyk7CisgICAgICBmcHJpbnRmIChzdGRlcnIs ICJpX3N0b3JlOiAgdnBvcyAoJWQpIHwgJXNcbiIsIHZwb3MsIGNoYXJfc3RyaW5nKTsKKyAgICB9 CisKKyAgZm9yICg7CisgICAgICAgQ09OU1AgKGlfc3RvcmUpCisgICAgICAgJiYgdnBvcyAhPSBi b3R0b21fdnBvczsKKyAgICAgICBpX3N0b3JlID0gWENEUiAoaV9zdG9yZSkpCisgICAgeworICAg ICAgaW50IHggPSBYRklYTlVNIChYQ0FSIChYQ0FSIChpX3N0b3JlKSkpOworICAgICAgaW50IGhw b3MgPSBYRklYTlVNIChYQ0RSIChYQ0FSIChpX3N0b3JlKSkpOworICAgICAgc3RydWN0IGdseXBo ICp0YXJnZXRfZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBkZXNpcmVkX21hdHJpeCwg dXBkYXRlZF9yb3csIGhwb3MsIHZwb3MpOworICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgIHsK KyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJpX3N0b3JlOiAgY2hhciAoJWQvJXMpIHwgeDog KCVkKSB8IGhwb3MgKCVkKSB8IHZwb3MgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgIHRhcmdldF9nbHlwaC0+dS5jaCwgbWNfY2hhcl90b19zdHJpbmcgKHRhcmdldF9nbHlwaC0+ dS5jaCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICB4LCBocG9zLCB2cG9zKTsKKyAgICAg ICAgfQorICAgICAgbWNfZHJhd19yb3cgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3Jvdywg dGFyZ2V0X2dseXBoLCB4LCAxLCB2cG9zLAorICAgICAgICAgICAgICAgICAgIGJvdHRvbV92cG9z LCBhY3RpdmVfcCwgZmNfeCwgY2hfZm9yZWdyb3VuZCwgZmNfZm9yZWdyb3VuZCwgdHJ1ZSk7Cisg ICAgfQorCisgICAgICAgIGlmIChpID09IHN0YXJ0X2hwb3MgfHwgeCAhPSBjdXJyZW50X3gpCisg ICAgeworICAgICAgaSA9IHN0YXJ0X2hwb3M7CisgICAgICB4ID0gc3RhcnRfeDsKKyAgICAgIGRl c2lyZWRfZ2x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QsIGZjX2ZvcmVncm91bmQs IHRydWUpOworCisgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICB9CisgIH0KKworICAgICAg LyogV3JpdGUgdGhlIHJlc3QuICAqLworICAgICAgaWYgKGkgPCBkZXNpcmVkX3Jvdy0+dXNlZFtU RVhUX0FSRUFdKQorICB7CisgICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgaSwgZGVzaXJl ZF9yb3ctPnksIHgpOworCisgIGlmIChkZWJ1Z19wCisgICAgICAmJiB2cG9zICE9IGJvdHRvbV92 cG9zKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIkRSQVcgUkVNQUlOREVSIE9GIFRI RSBST1c6XG5cCisgICAgICBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwgaSAoJWQpIHwgbGVuZ3Ro ICglZCkgfCB2cG9zICglZClcbiIsCisgICAgICBkZXNpcmVkX2dseXBoLT51LmNoLCBtY19jaGFy X3RvX3N0cmluZyAoZGVzaXJlZF9nbHlwaC0+dS5jaCksCisgICAgICB4LCBpLCBkZXNpcmVkX3Jv dy0+dXNlZFtURVhUX0FSRUFdIC0gaSwgdnBvcyk7CisgICAgfQorCisgIHJpZi0+bWNfc2NyaWJl X2dseXBocyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBkZXNpcmVkX2dseXBoLCBU RVhUX0FSRUEsIGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSBpLAorICAgICAgICAgICAg ICAgICAgICAgICAgIHZwb3MsIGJvdHRvbV92cG9zLCByZWQsIGdyZWVuLCBibHVlLAorICAgICAg ICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVf cCwgY3Vyc29yX2djX3ApOworCisgIC8qIEZJWE1FOiAgQWx0aG91Z2ggd2UgbmVlZCB0byB1cGRh dGUgdGhlIGNhY2hlIGJldHdlZW4gdGhlIGVuZ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b2ZfbGluZSAodywgdXBkYXRlZF9yb3csIFRFWFRfQVJFQSwgLTEpOworCisgIGNsZWFy X3RvX3ggPSAtMTsKKworICAgIGNoYW5nZWRfcCA9IDE7CisgIH0KKyAgICAgIGVsc2UgaWYgKGRl c2lyZWRfcm93LT5waXhlbF93aWR0aCA8IGN1cnJlbnRfcm93LT5waXhlbF93aWR0aCkKKyAgewor ICAgIC8qIE90aGVyd2lzZSBjbGVhciB0byB0aGUgZW5kIG9mIHRoZSBvbGQgcm93LiAgRXZlcnl0 aGluZworICAgICAgIGFmdGVyIHRoYXQgcG9zaXRpb24gc2hvdWxkIGJlIGNsZWFyIGFscmVhZHku ICAqLworICAgIGludCB4bGltOworCisgICAgaWYgKGkgPj0gZGVzaXJlZF9yb3ctPnVzZWRbVEVY VF9BUkVBXSkKKyAgICAgIG91dHB1dF9jdXJzb3JfdG8gKHcsIHZwb3MsIGksIGRlc2lyZWRfcm93 LT55LAorICAgICAgICAgICAgZGVzaXJlZF9yb3ctPnBpeGVsX3dpZHRoKTsKKworICAgIC8qIElm IGN1cnNvciBpcyBkaXNwbGF5ZWQgYXQgdGhlIGVuZCBvZiB0aGUgbGluZSwgbWFrZSBzdXJlCisg ICAgICAgaXQncyBjbGVhcmVkLiAgTm93YWRheXMgd2UgZG9uJ3QgaGF2ZSBhIHBoeXNfY3Vyc29y X2dseXBoCisgICAgICAgd2l0aCB3aGljaCB0byBlcmFzZSB0aGUgY3Vyc29yIChiZWNhdXNlIHRo aXMgbWV0aG9kCisgICAgICAgZG9lc24ndCB3b3JrIHdpdGggbGJlYXJpbmcvcmJlYXJpbmcpLCBz byB3ZSBtdXN0IGRvIGl0CisgICAgICAgdGhpcyB3YXkuICAqLworICAgIGlmICh2cG9zID09IHct PnBoeXNfY3Vyc29yLnZwb3MKKyAgICAgICAgJiYgKGRlc2lyZWRfcm93LT5yZXZlcnNlZF9wCisg ICAgICA/ICh3LT5waHlzX2N1cnNvci5ocG9zIDwgMCkKKyAgICAgIDogK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aXRoZXIgb25lIG9mIHRoZQorICAgICAgcHJldmlvdXMgc2VjdGlvbnMgYWJvdmUsIGFuZCBz aG91bGQgbm90IGJlIG92ZXJ3cml0dGVuIHdpdGggYW5vdGhlciBvbmUuCisgICAgICBUaGlzIGRl c2lnbiBpcyBuZWVkZWQgYmVjYXVzZSBhIHdvcmQtd3JhcHBlZCBsaW5lIGRvZXMgbm90IHJlY2Vp dmUgYW4gZXh0cmEKKyAgICAgIHNwYWNlIGxpa2Ugbm9uLXdvcmQtd3JhcHBlZCBsaW5lcyBkby4g Ki8KKyAgICAgIGludCB4ID0gdXBkYXRlZF9yb3ctPnBpeGVsX3dpZHRoOworICAgICAgaW50IGhw b3MgPSB1cGRhdGVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgICAgIGludCB4X2xpbWl0 ID0gKGNsZWFyX3RvX3ggPT0gLTEpCisgICAgICAgICAgICAgICAgICAgID8gdGV4dF9hcmVhX3dp ZHRoCisgICAgICAgICAgICAgICAgICAgIDogY2xlYXJfdG9feDsKKyAgICAgIGlmICh0cmFjZV9y ZWRpc3BsYXlfcCkKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfdXBkYXRlX3RleHRfYXJl YSAoZmxvYXRpbmcpOiAgdnBvcyAoJWQpIHwgeF9saW1pdCAoJWQpXG4iLCB2cG9zLCB4X2xpbWl0 KTsKKworICAgICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3Nz aGFpcnMpKQorICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNoX2hvcml6b250YWxfcnVsZXIpKQorICAgICAgICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgK KyAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgJiYgdGFyZ2V0 X2dseXBoICE9IE5VTEwpCisgICAgICAgIG1jX2VuZ2luZSAodywgZG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0+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 YW5nZWRfcAorICAgICAgIGRlc2lyZWRfcm93IDwgZW5kCisgICAgICAgJiYgKGZvcmNlX3AgfHwg IWlucHV0X3BlbmRpbmcpCisgICAgICAgLyogTlQgRW1hY3MgY3Jhc2hlcyBvbiBzdGFydHVwIHdp dGhvdXQgYSBCVUZGRVJQIGNoZWNrLiAqLworICAgICAgICYmIEJVRkZFUlAgKHctPmNvbnRlbnRz KQorICAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25m KSkKKyAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jv c3NoYWlycykpCisgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGZjX3Zpc2libGUpKSk7CisgICAgICAgKytkZXNpcmVkX3JvdykKKyAgIHsKKyAgICAgaW50 IHZwb3MgPS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B3aW5kb3cKIAkgdGhhdCBjYW4gYmUg c2Nyb2xsZWQuICAqLwpAQCAtMzUzMSwxMCArNDA4MCwyMSBAQCB1cGRhdGVfd2luZG93IChzdHJ1 Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAgICAgICBzdHJjcHkgKHctPmN1cnJlbnRfbWF0 cml4LT5tZXRob2QsIHctPmRlc2lyZWRfbWF0cml4LT5tZXRob2QpOwogI2VuZGlmCiAKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICNpZmRlZiBI QVZFX1dJTkRPV19TWVNURU0KKyAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgJiYg IU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgIG1j X3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgMCk7CisgICAgZWxzZQogICAgICAgdXBkYXRlX3dp bmRvd19mcmluZ2VzICh3LCAwKTsKICNlbmRpZgogCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAgICAgICAvKiBFbmQgdGhlIHVwZGF0ZSBvZiB3aW5kb3cgVy4gIERvbid0IHNldCB0aGUg Y3Vyc29yIGlmIHdlCiAgICAgICAgICBwYXVzZWQgdXBkYXRpbmcgdGhlIGRpc3BsYXkgYmVjYXVz ZSBpbiB0aGlzIGNhc2UsCiAgICAgICAgICBzZXRfd2luZG93X2N1cnNvcl9hZnRlcl91cGRhdGUg aGFzbid0IGJlZW4gY2FsbGVkLCBhbmQKQEAgLTM4NTIsMTQgKzQ0MTIsMzAgQEAgdXBkYXRlX3dp bmRvd19saW5lIChzdHJ1Y3Qgd2luZG93ICp3LCBpbnQgdnBvcywgYm9vbCAqbW91c2VfZmFjZV9v dmVyd3JpdHRlbl9wKQogCSAgY3VycmVudF9yb3ctPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0g MTsKIAl9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKyAgYm9vbCB1cGRhdGVkX3AgPSAoIUJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAg ICAgICAgICAgICAgID8gdXBkYXRlX3RleHRfYXJlYSAodywgZGVzaXJlZF9yb3csIHZwb3MpCisg ICAgICAgICAgICAgICAgICAgOiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAg ICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkK KyAgICAgICAgICAgICAgICAgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKQorICAgICAgICAgICAgICAgICAgICAg PyB1cGRhdGVfdGV4dF9hcmVhICh3LCBkZXNpcmVkX3JvdywgdnBvcykKKyAgICAgICAgICAgICAg ICAgICA6IG1jX3VwZGF0ZV90ZXh0X2FyZWEgKHcsIGRlc2lyZWRfcm93LCB2cG9zKSk7CisKICAg ICAgIC8qIFVwZGF0ZSB0aGUgZGlzcGxheSBvZiB0aGUgdGV4dCBhcmVhLiAgKi8KLSAgICAgIGlm ICh1cGRhdGVfdGV4dF9hcmVhICh3LCBkZXNpcmVkX3JvdywgdnBvcykpCisgICAgICBpZiAodXBk YXRlZF9wKQogCXsKIAkgIGNoYW5nZWRfcCA9IDE7CiAJICBpZiAoY3VycmVudF9yb3ctPm1vdXNl X2ZhY2VfcCkKIAkgICAgKm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCA9IDE7CiAJfQogCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICAvKiBVcGRhdGUgZGlzcGxheSBvZiB0aGUg cmlnaHQgbWFyZ2luIGFyZWEsIGlmIHRoZXJlIGlzIG9uZS4gICovCiAgICAgICBpZiAoIWRlc2ly ZWRfcm93LT5mdWxsX3dpZHRoX3AgJiYgdy0+cmlnaHRfbWFyZ2luX2NvbHMgPiAwKQogCXsKZGlm ZiAtLWdpdCBhL3NyYy9mcmluZ2UuYyBiL3NyYy9mcmluZ2UuYwppbmRleCAzMzVhNmViLi44Mzc5 MjI2IDEwMDY0NAotLS0gYS9zcmMvZnJpbmdlLmMKKysrIGIvc3JjL2ZyaW5nZS5jCkBAIC00Mzgs NiArNDM4LDM5OSBAQCBzdGF0aWMgdW5zaWduZWQgc2hvcnQgZW1wdHlfbGluZV9iaXRzW10gPSB7 CiAjZGVmaW5lIFNUQU5EQVJEX0JJVE1BUF9IRUlHSFQoYml0cykgKHNpemVvZiAoYml0cykvQllU RVNfUEVSX0JJVE1BUF9ST1cpCiAjZGVmaW5lIEZSQklUUyhiaXRzKSAgYml0cywgU1RBTkRBUkRf QklUTUFQX0hFSUdIVCAoYml0cykKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJl Z2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogYCstZnJpbmdlLWhlbHBlci1kZWNpbWFsJyBk ZWZpbmVkIGluIGBjcm9zc2hhaXJzLmVsYCAqLworCisvKiAyNAorICAgICgrLWZyaW5nZS1oZWxw ZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4Li4uLi4uLiIKKyAgICAgICJ4Li4uLi4uLiIKKyAgICAg ICJ4Li4uLi4uLiIKKyAgICAgICJ4Li54eC4uLiIKKyAgICAgICJ4Li4ueHguLiIKKyAgICAgICJ4 Li4uLnh4LiIKKyAgICAgICJ4Lnh4eHh4eCIKKyAgICAgICJ4Lnh4eHh4eCIKKyAgICAgICJ4Li4u Lnh4LiIKKyAgICAgICJ4Li4ueHguLiIKKyAgICAgICJ4Li54eC4uLiIKKyAgICAgICJ4Li4uLi4u LiIKKyAgICAgICJ4Li4uLi4uLiIKKyAgICAgICJ4Li4uLi4uLiIpCisqLworc3RhdGljIHVuc2ln bmVkIHNob3J0IG1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvd19iaXRzW10gPXsKKyAgMHg4MCwg MHg4MCwgMHg4MCwgMHg5OCwgMHg4YywgMHg4NiwgMHhiZiwKKyAgMHhiZiwgMHg4NiwgMHg4Yywg MHg5OCwgMHg4MCwgMHg4MCwgMHg4MH07CisKKy8qIDI1CisgICAgKCstZnJpbmdlLWhlbHBlci1o ZXhhZGVjaW1hbAorICAgICAgInh4eHh4eHh4IgorICAgICAgInguLi4uLi54IgorICAgICAgIngu Li4uLi54IgorICAgICAgInguLnh4Li54IgorICAgICAgInguLi54eC54IgorICAgICAgInguLi4u eHh4IgorICAgICAgIngueHh4eHh4IgorICAgICAgIngueHh4eHh4IgorICAgICAgInguLi4ueHh4 IgorICAgICAgInguLi54eC54IgorICAgICAgInguLnh4Li54IgorICAgICAgInguLi4uLi54Igor ICAgICAgInguLi4uLi54IgorICAgICAgInh4eHh4eHh4IikKKyovCitzdGF0aWMgdW5zaWduZWQg c2hvcnQgbWNfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvd19iaXRzW10gPXsKKyAgMHhmZiwg MHg4MSwgMHg4MSwgMHg5OSwgMHg4ZCwgMHg4NywgMHhiZiwKKyAgMHhiZiwgMHg4NywgMHg4ZCwg MHg5OSwgMHg4MSwgMHg4MSwgMHhmZn07CisKKy8qIDI2CisgICAgKCstZnJpbmdlLWhlbHBlci1o ZXhhZGVjaW1hbAorICAgICAgInh4eHh4eHh4IgorICAgICAgInguLi4uLi54IgorICAgICAgIngu Li4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4u Li54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54 IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54Igor ICAgICAgInguLi4uLi54IgorICAgICAgInh4eHh4eHh4IikKKyovCitzdGF0aWMgdW5zaWduZWQg c2hvcnQgbWNfaG9sbG93X3JlY3RhbmdsZV9iaXRzW10gPXsKKyAgMHhmZiwgMHg4MSwgMHg4MSwg MHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwKKyAgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwg MHg4MSwgMHhmZn07CisKKy8qIDI3CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAor ICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAg ICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAg InguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgIngu Li4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4u Li4uIgorICAgICAgInguLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVy dGljYWxfYmFyX2JpdHNbXSA9eworICAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgw LCAweDgwLAorICAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwfTsKKwor LyogMjgKKyAgICA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B4OGMsIDB4ODYs IDB4ODYsIDB4ODMsIDB4ODN9OworCisvKiAzMAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRl Y2ltYWwKKyAgICAgICIueHh4eHh4LiIKKyAgICAgICJ4eHh4LnguLiIKKyAgICAgICJ4eHh4Lngu LiIKKyAgICAgICJ4eHh4LnguLiIKKyAgICAgICIueHh4LnguLiIKKyAgICAgICIuLi54LnguLiIK KyAgICAgICIuLi54LnguLiIKKyAgICAgICIuLi54LnguLiIKKyAgICAgICIuLi54LnguLiIKKyAg ICAgICIuLi54LnguLiIKKyAgICAgICIuLi54LnguLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNo b3J0IG1jX3BpbGNyb3dfYml0c1tdID17CisgIDB4N2UsIDB4ZjQsIDB4ZjQsIDB4ZjQsIDB4NzQs IDB4MTQsIDB4MTQsIDB4MTQsIDB4MTQsIDB4MTQsIDB4MTR9OworCisvKiAzMQorICAgICgrLWZy aW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLnh4eHguLiIKKyAgICAgICIueHh4eHh4 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 NDQsIDB4MjgsIDB4OTIsIDB4NDQsIDB4MjgsIDB4OTIsIDB4NDQsIDB4MjgsIDB4MTB9OworCisv KiBUT0RPOiAgQWRkIHRoZSBmb2xsb3dpbmcgYml0bWFwczoKKyAgKGRlZmluZS1mcmluZ2UtYml0 bWFwICdicmVha3BvaW50ICJceDNjXHg3ZVx4ZmZceGZmXHhmZlx4ZmZceDdlXHgzYyIpCisgIChk ZWZpbmUtZnJpbmdlLWJpdG1hcCAnaG9sbG93LXJpZ2h0LXRyaWFuZ2xlICJceGUwXHg5MFx4ODhc eDg0XHg4NFx4ODhceDkwXHhlMCIpICovCisKIC8qIE5PVEU6ICBUaGUgb3JkZXIgb2YgdGhlc2Ug Yml0bWFwcyBtdXN0IG1hdGNoIHRoZSBzZXF1ZW5jZQogICAgdXNlZCBpbiBmcmluZ2UuZWwgdG8g ZGVmaW5lIHRoZSBjb3JyZXNwb25kaW5nIHN5bWJvbHMuICAqLwogCkBAIC00NjcsOCArODYwLDEw MjAgQEAgc3RhdGljIHN0cnVjdCBmcmluZ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Y3Qgd2luZG93ICp3LCBM aXNwX09iamVjdCBiaXRtYXAsIGludCByaWdodF9wLCBpbnQgcGFydGlhbF9wKQoreworICBMaXNw X09iamVjdCBjbWFwLCBibTEgPSBRbmlsLCBibTIgPSBRbmlsLCBibTsKKyAgRU1BQ1NfSU5UIGxu MSA9IDAsIGxuMiA9IDA7CisgIGludCBpeDEgPSByaWdodF9wOworICBpbnQgaXgyID0gaXgxICsg KHBhcnRpYWxfcCA/IDIgOiAwKTsKKyAgaWYgKChjbWFwID0gQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSksICFOSUxQIChjbWFwKSkKKyAgICB7Cisg ICAgICBibTEgPSBtY19hc3NxIChiaXRtYXAsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibTEp KQorICB7CisgICAgaWYgKChibTEgPSBYQ0RSIChibTEpKSwgTklMUCAoYm0xKSkKKyAgICAgIHJl dHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICAgIGlmIChDT05TUCAoYm0xKSkKKyAgICAgIHsK KyAgICAgICAgbG4xID0gWEZJWE5VTSAoRmxlbmd0aCAoYm0xKSk7CisgICAgICAgIGlmIChwYXJ0 aWFsX3ApCisgICAgeworICAgICAgaWYgKGxuMSA+IGl4MikKKyAgICAgICAgeworICAgICAgICAg IGJtID0gbWNfbnRoIChpeDIsIGJtMSk7CisgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAg ICAgIGdvdG8gZm91bmQ7CisgICAgICAgIH0KKyAgICB9CisgICAgICAgIGVsc2UKKyAgICB7Cisg ICAgICBpZiAobG4xID4gaXgxKQorICAgICAgICB7CisgICAgICAgICAgYm0gPSBtY19udGggKGl4 MSwgYm0xKTsKKyAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgZ290byBmb3VuZDsK KyAgICAgICAgfQorICAgIH0KKyAgICAgIH0KKyAgICBlbHNlIGlmICgoYm0gPSBibTEsICFFUSAo Ym0sIFF0KSkpCisgICAgICBnb3RvIGZvdW5kOworICB9CisgICAgfQorICBpZiAoIUVRIChjbWFw LCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkKKyAgICAg ICYmICFOSUxQIChCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0 KSkpCisgICAgeworICAgICAgYm0yID0gbWNfYXNzcSAoYml0bWFwLCBCVkFSICgmYnVmZmVyX2Rl ZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSk7CisgICAgICBpZiAoQ09OU1AgKGJtMikp CisgIHsKKyAgICBpZiAoKGJtMiA9IFhDRFIgKGJtMikpLCAhTklMUCAoYm0yKSkKKyAgICAgIHsK KyAgICAgICAgaWYgKENPTlNQIChibTIpKQorICAgIHsKKyAgICAgIGxuMiA9IFhGSVhOVU0gKEZs ZW5ndGggKGJtMikpOworICAgICAgaWYgKHBhcnRpYWxfcCkKKyAgICAgICAgeworICAgICAgICAg IGlmIChsbjIgPiBpeDIpCisgICAgICB7CisgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMik7 CisgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAg IH0KKyAgICAgICAgfQorICAgIH0KKyAgICAgIH0KKyAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4 MSkKKyAgICB7CisgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAgICAgaWYgKCFFUSAo Ym0sIFF0KSkKKyAgZ290byBmb3VuZDsKKyAgICB9CisgIGlmIChsbjIgPiBpeDEpCisgICAgewor ICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0yKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisg IGdvdG8gZm91bmQ7CisgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDs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hTklMUCAoY21hcCkpCisgICAg 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 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Qor 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 SVhfUk9XX1BBUlRJQUxMWV9WSVNJQkxFX0F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UX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ 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+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7Cisg IHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBmb3IgKHkgPSB3LT52c2Ny b2xsLCBybiA9IDA7CisgICAgICAgeSA8IHliICYmIHJuIDwgbnJvd3M7CisgICAgICAgeSArPSBy b3ctPmhlaWdodCwgcm4rKykKKyAgICB7CisgIGludCBsZWZ0LCByaWdodDsKKyAgdW5zaWduZWQg bGVmdF9mYWNlX2lkLCByaWdodF9mYWNlX2lkOworICBpbnQgbGVmdF9vZmZzZXQsIHJpZ2h0X29m ZnNldDsKKyAgYm9vbCBwZXJpb2RpY19wOworICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93 cyArIHJuOworICBjdXIgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICBpbnQgdnBv c19kZXNpcmVkID0gTUFUUklYX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iBn 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 ICAgOiBERUZB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KHJvdy0+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 aWdodF91c2VyX2ZyaW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isgICAgICAgIH0K KyAgICAgIGVsc2UgaWYgKCghcm93LT5yZXZlcnNlZF9wICYmIHJvdy0+Y29udGludWVkX3ApCisg ICAgICAgICAgICAgICB8fCAocm93LT5yZXZlcnNlZF9wICYmIE1BVFJJWF9ST1dfQ09OVElOVUFU SU9OX0xJTkVfUCAocm93KSkpCisgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICg0LCBR Y29udGludWF0aW9uLCAwKTsKKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVf cCAmJiBFUSAoYXJyb3dfdG9wLCBRcmlnaHQpKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQg PSBNQ19SSUdIVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAgICAgICAgaWYgKHRvcF9pbmRfbWlu X3kgPj0gMCkKKyAgICAgICAgICAgIHJpZ2h0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSByb3ct Pnk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVf cCAmJiBFUSAoYXJyb3dfYm90LCBRcmlnaHQpKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQg PSBNQ19SSUdIVF9GUklOR0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICBpZiAoYm90X2luZF9t YXhfeSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChy b3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAo cm93LT5pbmRpY2F0ZV9lbXB0eV9saW5lX3AgJiYgRVEgKGVtcHR5X3BvcywgUXJpZ2h0KSkKKyAg ICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklOR0UgKDUsIFFlbXB0eV9saW5lLCAwKTsKKyAgICAg IGVsc2UKKyAgICAgICAgcmlnaHQgPSBNQ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Ag ICAgICAgICAgY3VyLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAgICAg IGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUAorICAgICAg ICAgICAgICAgICAgfHwgbWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklU TUFQKQorICAgICAgICAgICAgICAgIGN1ci0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wID0gZmFs c2U7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5mcmluZ2Vf Yml0bWFwX3BlcmlvZGljX3AgPSBwZXJpb2RpY19wOworICAgICAgICAgICAgICBpZiAobWNfbGVm dF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAg Y3VyLT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSBtY19sZWZ0X2ZyaW5nZV9iaXRtYXA7CisgICAgICAg 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 fCBtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAg IHJvdy0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgIGVsc2UKKyAg ICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IHBlcmlvZGljX3A7CisgICAg ICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAg ICAgIHJvdy0+bGVmdF9mcmluZ2VfYml0bWFwID0gbWNfbGVmdF9mcmluZ2VfYml0bWFwOworICAg ICAgICBlbHNlCisgICAgICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSBsZWZ0OworICAg ICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAg ICA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ET1dfSEVBREVSX0xJTkVfSEVJR0hU ICh3KTsKKyAgcC5ieSA9IFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCBtYXggKGhlYWRlcl9s aW5lX2hlaWdodCwgcm93LT55KSk7CisgIHAubnkgPSByb3ctPnZpc2libGVfaGVpZ2h0OworICBp ZiAobGVmdF9wKQorICAgIHsKKyAgICAgIGludCB3ZCA9IFdJTkRPV19MRUZUX0ZSSU5HRV9XSURU SCAodyk7CisgICAgICBpbnQgeCA9IHdpbmRvd19ib3hfbGVmdCAodywgKFdJTkRPV19IQVNfRlJJ TkdFU19PVVRTSURFX01BUkdJTlMgKHcpCisgICAgICAgICAgID8gTEVGVF9NQVJHSU5fQVJFQQor ICAgICAgICAgICA6IFRFWFRfQVJFQSkpOworICAgICAgaWYgKHAud2QgPiB3ZCkKKyAgICAgICAg cC53ZCA9IHdkOworICAgICAgcC54ID0geCAtIHAud2QgLSAod2QgLSBwLndkKSAvIDI7CisgICAg ICBpZiAocC53ZCA8IHdkIHx8IHAueSA+IHAuYnkgfHwgcC55ICsgcC5oIDwgcC5ieSArIHAubnkp CisgICAgICAgIHsKKyAgICAgICAgICAvKiBJZiBXIGhhcyBhIHZlcnRpY2FsIGJvcmRlciB0byBp dHMgbGVmdCwgZG9uJ3QgZHJhdyBvdmVyIGl0LiAgKi8KKyAgICAgICAgICB3ZCAtPSAoKCFXSU5E T1dfTEVGVE1PU1RfUCAodykKKyAgICAgICAgICAgIC8qIFRoaXMgY291bGQgYmUgd3Jvbmcgd2hl biB3ZSBhbGxvdyB3aW5kb3cgbG9jYWwKKyAgICAgICAgICAgICAgIHJpZ2h0IGRpdmlkZXJzIC0g YnV0IHRoZSB3aW5kb3cgb24gdGhlIGxlZnQgaXMgaGFyZAorICAgICAgICAgICAgICAgdG8gZ2V0 LiAgKi8KKyAgICAgICAgICAgICYmICFGUkFNRV9SSUdIVF9ESVZJREVSX1dJRFRIIChmKQorICAg ICAgICAgICAgJiYgIVdJTkRPV19IQVNfVkVSVElDQUxfU0NST0xMX0JBUiAodykKKyAgICAgICAg ICAgIC8qIEJ1dCBkb24ndCByZWR1Y2UgdGhlIGZyaW5nZSB3aWR0aCBpZiB0aGUgd2luZG93Cisg ICAgICAgICAgICAgICBoYXMgYSBsZWZ0IG1hcmdpbiwgYmVjYXVzZSB0aGF0IG1lYW5zIHdlIGFy ZSBub3QKKyAgICAgICAgICAgICAgIGluIGRhbmdlciBvZiBkcmF3aW5nIG92ZXIgdGhlIHZlcnRp Y2FsIGJvcmRlciwKKyAgICAgICAgICAgICAgIGFuZCBPVE9IIGxlYXZpbmcgb3V0IHRoYXQgb25l IHBpeGVsIGxlYXZlcyBiZWhpbmQKKyAgICAgICAgICAgICAgIHRyYWNlcyBvZiB0aGUgY3Vyc29y LCBpZiBpdCB3YXMgaW4gY29sdW1uIHplcm8KKyAgICAgICAgICAgICAgIGJlZm9yZSBkcmF3aW5n IG5vbi1lbXB0eSBtYXJnaW4gYXJlYS4gICovCisgICAgICAgICAgICAmJiB3LT5sZWZ0X21hcmdp bl9jb2xzID09IDApCisgICAgICAgICAgID8gMSA6IDApOworICAgICAgICAgIHAuYnggPSB4IC0g 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 KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICNkZWZpbmUgTk9f RlJJTkdFX0JJVE1BUCAwCiAjZGVmaW5lIFVOREVGX0ZSSU5HRV9CSVRNQVAgMQogI2RlZmluZSBN QVhfU1RBTkRBUkRfRlJJTkdFX0JJVE1BUFMgQVJSQVlFTFRTIChzdGFuZGFyZF9iaXRtYXBzKQpA QCAtMTcyNCw2ICszMTI5LDE1MCBAQCBJZiBuaWwsIGFsc28gY29udGludWUgbGluZXMgd2hpY2gg YXJlIGV4YWN0bHkgYXMgd2lkZSBhcyB0aGUgd2luZG93LiAgKi8pOwogICBERUZWQVJfTElTUCAo ImZyaW5nZS1iaXRtYXBzIiwgVmZyaW5nZV9iaXRtYXBzLAogICAgIGRvYzogLyogTGlzdCBvZiBm cmluZ2UgYml0bWFwIHN5bWJvbHMuICAqLyk7CiAgIFZmcmluZ2VfYml0bWFwcyA9IFFuaWw7CisK KworLyog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JUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIH0KIAogLyogR2FyYmFnZSBjb2xsZWN0aW9uIGhvb2sgKi8KZGlm ZiAtLWdpdCBhL3NyYy9uc3Rlcm0uaCBiL3NyYy9uc3Rlcm0uaAppbmRleCA3OGNlNjA4Li44ZWYw ZGZlIDEwMDY0NAotLS0gYS9zcmMvbnN0ZXJtLmgKKysrIGIvc3JjL25zdGVybS5oCkBAIC02NjAs NiArNjYwLDE2IEBAIHR5cGVkZWYgaWQgaW5zdGFuY2V0eXBlOwogCiBAaW50ZXJmYWNlIEVtYWNz U2Nyb2xsZXIgOiBOU1Njcm9sbGVyCiAgIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIE5TUmVjdCBtY19yZWN0YW5nbGU7CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgIHN0cnVjdCB3aW5kb3cgKndpbmRvdzsKICAg IHN0cnVjdCBmcmFtZSAqZnJhbWU7CiAgICBOU1Jlc3BvbmRlciAqcHJldlJlc3BvbmRlcjsKQEAg LTY4MCw2ICs2OTAsMTggQEAgdHlwZWRlZiBpZCBpbnN0YW5jZXR5cGU7CiAgICBpbnQgZW1fd2hv bGU7CiAgICB9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJT T1JTICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTogKE5TUmVjdClyZWN0OworLSAoTlNS ZWN0KW1jX2dldF9yZWN0YW5nbGU7CistIChzdHJ1Y3Qgd2luZG93ICopbWNfZ2V0X3dpbmRvdzsK Ky0gKGJvb2wpbWNfanVkZ2U7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC0gKGlu c3RhbmNldHlwZSkgaW5pdEZyYW1lOiAoTlNSZWN0IClyIHdpbmRvdzogKExpc3BfT2JqZWN0KXdp bjsKIC0gKHZvaWQpc2V0RnJhbWU6IChOU1JlY3QpcjsKIApkaWZmIC0tZ2l0IGEvc3JjL25zdGVy bS5tIGIvc3JjL25zdGVybS5tCmluZGV4IDgxZDM2YmUuLjRkYjllYzQgMTAwNjQ0Ci0tLSBhL3Ny Yy9uc3Rlcm0ubQorKysgYi9zcmMvbnN0ZXJtLm0KQEAgLTc2LDYgKzc2LDEwOTggQEAgVXBkYXRl ZCBieSBDaHJpc3RpYW4gTGltcGFjaCAoY2hyaXNAbmljZS5jaCkKIHN0YXRpYyBFbWFjc01lbnUg Km1haW5NZW51OwogI2VuZGlmCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdp biBNVUxUSVBMRS1DVVJTT1JTICovCisKK3N0YXRpYyB2b2lkIG5zX3Jlc2V0X2NsaXBwaW5nIChz dHJ1Y3QgZnJhbWUgKik7CisKK3N0YXRpYyB2b2lkIG5zX2R1bXBnbHlwaHNfYm94X29yX3JlbGll ZiAoc3RydWN0IGdseXBoX3N0cmluZyAqKTsKKworc3RhdGljIHZvaWQgbnNfZHJhd19jb21wb3Np dGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKik7CisKK3N0 YXRpYyBpbnQgbnNfZ2V0X2dseXBoX3N0cmluZ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aWdodC0+c2l6ZS53aWR0aCkKKyAgICAgICAgICAgLSByZXN1bHQtPm9yaWdpbi54KTsK KyAgICAgIC8qIFNhbWUgZ2FtZSBmb3IgWS4gICovCisgICAgICBpZiAocjEtPm9yaWdpbi55IDwg cjItPm9yaWdpbi55KQorICB1cHBlciA9IHIxLCBsb3dlciA9IHIyOworICAgICAgZWxzZQorICB1 cHBlciA9IHIyLCBsb3dlciA9IHIxOworICAgICAgLyogVGhlIHVwcGVyIGVuZCBvZiB0aGUgaW50 ZXJzZWN0aW9uIGlzIGxvd2VyLnkwLCBpZiB0aGlzIGlzIGluc2lkZQorICAgb2YgdXBwZXIuICBP dGhlcndpc2UsIHRoZXJlIGlzIG5vIGludGVyc2VjdGlvbi4gICovCisgICAgICBpZiAobG93ZXIt Pm9yaWdpbi55IDw9IHVwcGVyLT5vcmlnaW4ueSArIHVwcGVyLT5zaXplLmhlaWdodCkKKyAgewor ICAgIHJlc3VsdC0+b3JpZ2luLnkgPSBsb3dlci0+b3JpZ2luLnk7CisgICAgLyogVGhlIGxvd2Vy IGVuZCBvZiB0aGUgaW50ZXJzZWN0aW9uIGlzIHRoZSBtaW5pbXVtIG9mIHRoZSBsb3dlcgorICAg ICAgIGVuZHMgb2YgdXBwZXIgYW5kIGxvd2VyLiAgKi8KKyAgICByZXN1bHQtPnNpemUuaGVpZ2h0 ID0gKG1pbiAobG93ZXItPm9yaWdpbi55ICsgbG93ZXItPnNpemUuaGVpZ2h0LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICB1cHBlci0+b3JpZ2luLnkgKyB1cHBlci0+c2l6ZS5oZWln aHQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHJlc3VsdC0+b3JpZ2luLnkpOworICAg IGludGVyc2VjdGlvbl9wID0gdHJ1ZTsKKyAgfQorICAgIH0KKyAgcmV0dXJuIGludGVyc2VjdGlv bl9wOworfQorCitzdGF0aWMgQk9PTAorbWNfbnNfY2xpcF90b19yZWN0IChzdHJ1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ICAgIHsKKyAgICAgICAgICAgICAgICAgICAgTlNSZWN0IHJf Y2xpcDsKKyAgICAgICAgICAgICAgICAgICAgcl9jbGlwLm9yaWdpbi54ID0gcm93LT5jbGlwLT54 OworICAgICAgICAgICAgICAgICAgICByX2NsaXAub3JpZ2luLnkgPSByb3ctPmNsaXAtPnk7Cisg ICAgICAgICAgICAgICAgICAgIHJfY2xpcC5zaXplLndpZHRoID0gcm93LT5jbGlwLT53aWR0aDsK KyAgICAgICAgICAgICAgICAgICAgcl9jbGlwLnNpemUuaGVpZ2h0ID0gcm93LT5jbGlwLT5oZWln aHQ7CisgICAgICAgICAgICAgICAgICAgIE5TUmVjdCByX3NhdmU7CisgICAgICAgICAgICAgICAg ICAgIHJfc2F2ZS5vcmlnaW4ueCA9IHJbMF0ub3JpZ2luLng7CisgICAgICAgICAgICAgICAgICAg IHJfc2F2ZS5vcmlnaW4ueSA9IHJbMF0ub3JpZ2luLnk7CisgICAgICAgICAgICAgICAgICAgIHJf c2F2ZS5zaXplLndpZHRoID0gclswXS5zaXplLndpZHRoOworICAgICAgICAgICAgICAgICAgICBy X3NhdmUuc2l6ZS5oZWlnaHQgPSByWzBdLnNpemUuaGVpZ2h0OworICAgICAgICAgICAgICAgICAg ICBtY19uc19pbnRlcnNlY3RfcmVjdGFuZ2xlcyAoJnJfc2F2ZSwgJnJfY2xpcCwgJnJbMF0pOwor ICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIE5TUmVjdENsaXAgKCpyKTsKKyAg ICAgICAgICAgICAgfQorICAgICAgICAgIHJldHVybiBZRVM7CisgICAgICAgIH0KKyAgICAgIGVs c2UKKyAgICAgICAgeworICAgICAgICAgIE5TVmlldyAqdmlldyA9IEZSQU1FX05TX1ZJRVcgKGYp OworICAgICAgICAgIGludCBpOworICAgICAgICAgIGZvciAoaSA9IDAgOyBpIDwgbiA7IGkrKykK KyAgICAgICAgICAgIFt2aWV3IHNldE5lZWRzRGlzcGxheUluUmVjdDpyW2ld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3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5E IChmYWNlKSwgZik7CisgIC0gIEVYQU1QTEUgT0YgSE9XIFRPIFBSSU5UIEEgQ09MT1IgVE8gU1RE RVJSOgorICAgICBMaXNwX09iamVjdCBmb3JlZ3JvdW5kID0gZmFjZS0+bGZhY2VbTEZBQ0VfRk9S RUdST1VORF9JTkRFWF07CisgICAgIExpc3BfT2JqZWN0IGJhY2tncm91bmQgPSBmYWNlLT5sZmFj ZVtMRkFDRV9CQUNLR1JPVU5EX0lOREVYXTsKKyAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG5mb3Jl Z3JvdW5kICglcykgfCBiYWNrZ3JvdW5kICglcylcbiIsCisgICAgICAgICAgICAgICAgICAgICAg KCFOSUxQIChmb3JlZ3JvdW5kKSA/IFNTREFUQSAoZm9yZWdyb3VuZCkgOiAiTklMUCIpLAorICAg ICAgICAgICAgICAgICAgICAgICghTklMUCAoYmFja2dyb3VuZCkgPyBTU0RBVEEgKGJhY2tncm91 bmQpIDogIk5JTFAiKSk7CisgIC0gIEVYQU1QTEUgT0YgSE9XIFRPIENSRUFURSBBIENPTE9SIFdJ VEggUkdCL0xTTCBmbG9hdCB2YWx1ZXM6CisgICAgIE5TQ29sb3IgKm15X2NvbG9yID0gW05TQ29s b3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogMS4wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBncmVlbjogMS4wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogMS4wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYTogMS4wXTsKKyAgLSAg QUxURVJOQVRJVkUgRVhBTVBMRToKKyAgICAgZW51bSBmYWNlX2lkIGRlYnVnZ2luZ19mYWNlX2lk ID0gbG9va3V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xOworICAgICAgcHRyZGlmZl90IHJlZ2lv bl9lbmQgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IFhGSVhOVU0gKEZyZWdpb25fZW5kICgpKSA6IC0x OworICAgICAgcHRyZGlmZl90IG9wb2ludF9wdCA9ICh3ID09IFhXSU5ET1cgKHNlbGVjdGVkX3dp bmRvdykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBQVAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogWEZJWE5VTSAoRm1hcmtlcl9wb3NpdGlvbiAody0+cG9pbnRtKSk7Cisg ICAgICBib29sIHJlZ2lvbl9pbl9ib3VuZHNfcCA9IChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF9wdCA+PSByZWdpb25fYmVnaW5uaW5n CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfcHQgPCByZWdpb25f ZW5kKTsKKyAgICAgIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAmJiByZWdpb25faW5f Ym91bmRzX3AKKyAgICAgICAgICAmJiBhY3RpdmVfcCkKKyAgICAgICAgeworICAgICAgICAgIGVu dW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9mYWNlX2lkID0gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1yZWdpb24tZmFjZSIpLCB0cnVl KTsKKyAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZSA9IEZB Q0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZV9pZCk7CisgICAgICAgICAg TlNDb2xvciAqaG9sbG93X2FjdGl2ZV9yZWdpb25fY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9j b2xvciAoTlNfRkFDRV9CQUNLR1JPVU5E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ICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19p 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 IGB3MzJ0ZXJtLmNgIGFuZCBgeHRlcm0uYycuICovCisgICAgICBib29sIGN1cnNvcl9nY19wID0g ZmFsc2U7CisgICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdf Q1VSU09SLCB4LCBocG9zLCB2cG9zLCByZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg Z3JlZW4sIGJsdWUsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfZ2NfcCk7CisgICAgfQorI2lmZGVmIE5T X0lNUExfQ09DT0EKKyAgTlNFbmFibGVTY3JlZW5VcGRhdGVzICgpOworI2VuZGlmCit9CisKK3N0 YXRpYyB2b2lkCittY19uc19kcmF3X3RleHRfZGVjb3JhdGlvbiAoc3RydWN0IGdseXBoX3N0cmlu ZyAqcywgc3RydWN0IGZhY2UgKmZhY2UsCisgICAgICAgICAgICAgICA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ByZXYgd2FzIHVuZGVybGluZWQsIG1hdGNoIGl0cyBhcHBlYXJhbmNlLiAq 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 bmVfcG9zaXRpb24gPSBwb3NpdGlvbjsKKyAgICAgICAgICByID0gTlNNYWtlUmV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Fj ZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgTU9VU0VfRkFDRV9JRCk7CisgICAgICAgfQorICAgICAg ZWxzZQorICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIHMtPmZpcnN0X2dseXBoLT5m YWNlX2lkKTsKKyAgICAgIGJnQ29sID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0Vf QkFDS0dST1VORCAoZmFjZSksIHMtPmYpOworICAgICAgZmdDb2wgPSBuc19sb29rdXBfaW5kZXhl ZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNlKSwgcy0+Zik7CisgICAgICBmb3IgKGkg PSAwOyBpIDwgbjsgKytpKQorICAgICAgICB7CisgICAgICAgICAgaWYgKCFzLT5yb3ctPmZ1bGxf d2lkdGhfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgaW50IG92ZXJydW4sIGxlZnRvdmVycnVu OworICAgICAgICAgICAgICAvKiB0cnVuY2F0ZSB0byBhdm9pZCBvdmVyd3JpdGluZyBmcmluZ2Ug 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 ICAgICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF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2lkdGgsIHMtPnNsaWNlLmhlaWdo dCk7CisgICAgICBOU1JlY3QgaXIgPSBOU01ha2VSZWN0IChzLT5zbGljZS54LCBzLT5zbGljZS55 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2Uud2lkdGgsIHMtPnNsaWNl LmhlaWdodCk7CisgICAgICBbaW1nIGRyYXdJblJlY3Q6IGRyCisgICAgICAgICAgICAgZnJvbVJl Y3Q6IGlyCisgICAgICAgICAgICAgb3BlcmF0aW9uOiBOU0NvbXBvc2l0ZVNvdXJjZU92ZXIKKyAg ICAgICAgICAgICAgZnJhY3Rpb246IDEuMAorICAgICAgICAgICByZXNwZWN0RmxpcHBlZDogWUVT CisgICAgICAgICAgICAgICAgaGludHM6IG5pbF07CisjZWxzZQorICAgICAgW2ltZyBjb21wb3Np dGVUb1BvaW50OiBOU01ha2VQb2ludCAoeCwgeSArIHMtPnNsaWNlLmhlaWdodCkKKyAgICAgICAg ICAgICAgICAgIG9wZXJhdGlvbjogTlNDb21wb3NpdGVTb3VyY2VPdmVyXTsKKyNlbmRpZgorICAg IH0KKyAgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgIHsKKyAgICBbRlJBTUVfQ1VSU09S X0NPTE9SIChzLT5mKSBzZXRdOworICAgIGlmIChzLT53LT5waHlzX2N1cnNvcl90eXBlID09IE1D X0ZJTExFRF9CT1gpCisgICAgICB0ZENvbCA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19G QUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICBlbHNlCisgICAgICAvKiBDdXJyZW50 bHkgb24gTlMgaW1nLT5tYXNrIGlzIGFsd2F5cyAwLiBTaW5jZQorICAgICAgICAgZ2V0X3dpbmRv d19jdXJzb3JfdHlwZSBzcGVjaWZpZXMgYSBob2xsb3cgYm94IGN1cnNvciB3aGVuIG9uCisgICAg ICAgICBhIG5vbi1tYXNrZWQgaW1hZ2Ugd2U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sKKyAgICAgICAgICB0aCA9IGFicyAocy0+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 Q0hfQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBmb29fZWx0cy5jYWNoZXMgPSBzLT53LT5j aF9lbHRzLmNhY2hlczsKKyAgICAgICAgICBmb29fZWx0cy5hbGxvY2F0ZWQgPSBzLT53LT5jaF9l bHRzLmFsbG9jYXRlZDsKKyAgICAgICAgICBmb29fZWx0cy51c2VkID0gcy0+dy0+Y2hfZWx0cy51 c2VkOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIEZDX0NBQ0hFOgor ICAgICAgICB7CisgICAgICAgICAgZm9vX2VsdHMuY2FjaGVzID0gcy0+dy0+ZmNfZWx0cy5jYWNo ZXM7CisgICAgICAgICAgZm9vX2VsdHMuYWxsb2NhdGVkID0gcy0+dy0+ZmNfZWx0cy5hbGxvY2F0 ZWQ7CisgICAgICAgICAgZm9vX2VsdHMudXNlZCA9IHMtPnctPmZjX2VsdHMudXNlZDsKKyAgICAg ICAgICBicmVh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0cy5jYWNoZXNbZWx0XS5mb3JlZ3JvdW5k LmJsdWV9OworICAgICAgc3RydWN0IG1jX1JHQiBiZ19sc2wgPSB7LnJlZCA9IGZvb19lbHRzLmNh Y2hlc1tlbHRdLmJhY2tncm91bmQucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg LmdyZWVuID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0uYmFja2dyb3VuZC5ncmVlbiwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0uYmFja2dy b3VuZC5ibHVlfTsKKyAgICAgIGJvb2wgYWN0aXZlX3AgPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5h Y3RpdmVfcDsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IGZvb19lbHRzLmNh Y2hlc1tlbHRdLmdseXBoX2ZsYXZvcjsKKyAgICAgIGJvb2wgZW5hYmxlZF9wID0gZm9vX2VsdHMu Y2FjaGVzW2VsdF0uZW5hYmxlZF9wOworICAgICAgYm9vbCBnb19wID0gKHZwb3MgPT0gcm93X3Zw 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 ICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF9wdCA8IHJlZ2lvbl9lbmQpOworICAg ICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICYmIHJlZ2lvbl9pbl9ib3VuZHNfcAor ICAgICAgICAgICYmIGFjdGl2ZV9wKQorICAgICAgICB7CisgICAgICAgICAgZW51bSBmYWNlX2lk IGhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywg cy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXJlZ2lvbi1mYWNlIiksIHRydWUpOwor ICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9mYWNlID0gRkFDRV9G Uk9NX0lEIChzLT5mLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9mYWNlX2lk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ZV9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBlbnVtIGZh Y2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMt PmYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICAgICAgICAg ICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChzLT5m LCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICBOU0NvbG9yICpob2xsb3df YWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VO RCAoaG9sbG93X2FjdGl2ZV9mYWNlKSwgcy0+Zik7CisgICAgICAgICAgICAgIGhvbGxvd19jb2xv ciA9IGhvbGxvd19hY3RpdmVfY29sb3I7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvKiBU aGUgcmVnaW9uIGlzIF9ub3RfIHZpc2libGUgaW4gdGhlIGluYWN0aXZlIHdpbmRvdyBiZWNhdXNl IHRoZSBvdmVybGF5IHdpbmRvdyBwcm9wZXJ0eSBpcyB1c2VkLiAqLworICAgICAgICAgICAgZWxz ZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZW51bSBm YWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncs IHMtPmYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1mYWNlIiksIHRydWUp OworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZB Q0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAg ICAgIE5TQ29sb3IgKmhvbGxvd19pbmFjdGl2ZV9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2Nv bG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19pbmFjdGl2ZV9mYWNlKSwgcy0+Zik7Cisg ICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2luYWN0aXZlX2NvbG9yOworICAg ICAgICAgICAgICB9CisgICAgfQorICAgIGVsc2UgaWYgKGZhY2UgJiYgTlNfRkFDRV9CQUNLR1JP VU5EIChmYWNlKSA9PSBuc19pbmRleF9jb2xvciAoRlJBTUVfQ1VSU09SX0NPTE9SIChzLT5mKSwg cy0+ZikpCisgICAgICB7CisgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFD RV9GT1JFR1JPVU5EIChmYWNlKSwgcy0+Zikgc2V0XTsKKyAgICAgICAgaG9sbG93X2NvbG9yID0g RlJBTUVfQ1VSU09SX0NPTE9SIChzLT5mKTsKKyAgICAgIH0KKyAgICAgIHN3aXRjaCAoY3Vyc29y X3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgICBjYXNlIE1DX05PX0ZSSU5HRV9CSVRNQVA6Cisg ICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlIE1DX05PX0NVUlNPUjoKKyAgICAgICAg ICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAg ICAgICBjYXNlIE1DX0xFRlRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgICBjYXNlIE1DX0ZJTExF RF9CT1g6CisgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgIGJyZWFrOwor ICAgICAgICAgIGNhc2UgTUNfRlJBTUVEX0JPWDoKKyAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIp OworICAgICAgICAgICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICAgICAgTlNSZWN0Rmls bCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09M T1IgKHMtPmYpIHNldF07CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlIE1DX0hP TExPV19CT1g6CisgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgIFtob2xs b3dfY29sb3Igc2V0XTsKKyAgICAgICAgICAgIE5TUmVjdEZpbGwgKE5TSW5zZXRSZWN0IChyLCAx LCAxKSk7CisgICAgICAgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChzLT5mKSBzZXRdOworICAg ICAgICAgICAgYnJlYWs7CisgICAgICAgICAgY2FzZSBNQ19IQkFSOgorICAgICAgICAgICAgTlNS ZWN0RmlsbCAocik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlIE1DX0JBUjoK KyAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAg IH0KKyAgICAgIC8qIElmIGEgZ2x5cGggZXhpc3RzIChzLT5jaGFyMmIgIT0gTlVMTCksIHRoZW4g ZHJhdyB0aGUgZ2x5cGggb24gdG9wIG9mIHRoZQorICAgICAgbmV3bHkgZHJhd24gcmVjdGFuZ2xl IHRoYXQgd2FzIGNyZWF0ZWQgaGVyZWluYWJvdmUuICBUbyB0aGUgZXh0ZW50IHRoYXQgd2UKKyAg ICAgIHdhbnQgdG8gZG91YmxlLWltcHJpbnQgZ2x5cGhzIHRvIG1ha2UgdGhlbSBhcHBlYXIgdG8g YmUgc2VtaS1ib2xkLCBpdCBjYW4KKyAgICAgIGJlIGRvbmUgaGVyZSBmb3IgYWxsIGN1cnNvciB0 eXBlcy4gIFRoZSBib3gtc3R5bGUgY3Vyc29ycyBhcmUgaW1wcmludGVkCisgICAgICB3aXRoIGds eXBocyBvbmx5IG9uZSAoMSkgdGltZS4gIFRoZSBzZW1pLWJvbGQgYXBwZWFyYW5jZSBpcyBoZWxw ZnVsIHdoZW4KKyAgICAgIGRlYnVnZ2luZyB0byBzZWUgdGhhdCB0aGUgY29vcmRpbmF0ZXMgYXJl IGNvcnJlY3QuICovCisgICAgICBpZiAocy0+Y2hhcjJiICE9IE5VTEwKKyAgICAgICAgICAmJiAo Y3Vyc29yX3R5cGUgPT0gTUNfRklMTEVEX0JPWAorICAgICAgICAgICAgICB8fCBjdXJzb3JfdHlw ZSA9PSBNQ19GUkFNRURfQk9YCisgICAgICAgICAgICAgIHx8IGN1cnNvcl90eXBlID09IE1DX0hP TExPV19CT1gpKQorICAgICAgICB7CisgICAgICAgICAgQk9PTCBpc0NvbXBvc2l0ZSA9IHMtPmZp cnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSDsKKyAgICAgICAgICBpZiAoaXNDb21w b3NpdGUpCisgICAgICAgICAgICBuc19kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdy b3VuZCAocyk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICBzdHJ1Y3QgZm9udCAqZm9udCA9IHMtPmZhY2UtPmZvbnQ7CisgICAgICAgICAgICAgICAg aWYgKCFmb250KQorICAgICAgICAgICAgICAgICAgZm9udCA9IEZSQU1FX0ZPTlQgKHMtPmYpOwor ICAgICAgICAgICAgICAgIGJvb2wgd2l0aF9iZ19wID0gZmFsc2U7CisgICAgICAgICAgICAgICAg Zm9udC0+ZHJpdmVyLT5kcmF3IChzLCBzLT5jbXBfZnJvbSwgcy0+bmNoYXJzLCBzLT54LCBzLT55 YmFzZSwgd2l0aF9iZ19wKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorfQor CitzdGF0aWMgdm9pZAorbWNfbnNfZHJhd19vdmVyd3JpdHRlbiAoc3RydWN0IGdseXBoX3N0cmlu ZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbW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mZhY2UtPmJveF9s aW5lX3dpZHRoLCAwKTsKKyAgICAgIGlmIChGT05UX0hFSUdIVCAocy0+Zm9udCkgPCBzLT5oZWln aHQgLSAyICogYm94X2xpbmVfd2lkdGgKKyAgICAgICAgICAvKiBXaGVuIHhkaXNwLmMgaWdub3Jl cyBGT05UX0hFSUdIVCwgd2UgY2Fubm90IHRydXN0IGZvbnQKKyAgICAgICAgICAgICBkaW1lbnNp b25zLCBzaW5jZSB0aGUgYWN0dWFsIGdseXBocyBtaWdodCBiZSBtdWNoCisgICAgICAgICAgICAg c21hbGxlci4gIFNvIGluIHRoYXQgY2FzZSB3ZSBhbHdheXMgY2xlYXIgdGhlIHJlY3RhbmdsZQor ICAgICAgICAgICAgIHdpdGggYmFja2dyb3VuZCBjb2xvci4gICovCisgICAgICAgICAgfHwgRk9O VF9UT09fSElHSCAocy0+Zm9udCkKKyAgICAgICAgICB8fCBzLT5mb250X25vdF9mb3VuZF9wIHx8 IHMtPmV4dGVuZHNfdG9fZW5kX29mX2xpbmVfcCB8fCBmb3JjZV9wKQorICAgICAgeworICAgICAg 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 cGhfc3RyaW5nICpzLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVj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dDsKKyAgICAgIGZvciAod2lkdGggPSAwLCBuZXh0ID0gcy0+bmV4 dDsKKyAgICAgICAgICAgbmV4dCAmJiB3aWR0aCA8IHMtPnJpZ2h0X292ZXJoYW5nOworICAgICAg ICAgICB3aWR0aCArPSBuZXh0LT53aWR0aCwgbmV4dCA9IG5leHQtPm5leHQpCisgICAgICAgIGlm IChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICB7Cisg ICAgICAgICAgICBpZiAobmV4dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkK KyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5n X2NsaXBfcmVjdCAocy0+bmV4dCwgcik7CisgICAgICAgICAgICAgICAgaWYgKCFtY19uc19jbGlw X3RvX3JlY3QgKHMtPmYsIHIsIG4sIHJvdykpCisgICAgICAgICAgICAgICAgICByZXR1cm47Cisg ICAgICAgICAgICAgICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLT5uZXh0 LCAxKTsKKyAgICAgICAgICAgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgIG1jX25zX2R1bXBnbHlwaHNfc3RyZXRjaCAocy0+bmV4dCwgd2QsIHJvdyk7CisgICAgICAg ICAgICAgICAgaWYgKChzLT5uZXh0LT5sZWZ0X292ZXJ3cml0dGVuX3AgfHwgcy0+bmV4dC0+cmln aHRfb3ZlcndyaXR0ZW5fcCkKKyAgICAgICAgICAgICAgICAgICAgJiYgcy0+bmV4dC0+YWN0aW9u X3R5cGUgPT0gTUNfRFJBV19HTFlQSCkKKyAgICAgICAgICAgICAgICAgIG1jX25zX2RyYXdfb3Zl cndyaXR0ZW4gKHM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AgICAgIG5zX3Jlc2V0X2NsaXBw aW5nIChzLT5mKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgU1RSRVRDSF9HTFlQSDoKKyAgICAg IG1jX25zX2R1bXBnbHlwaHNfc3RyZXRjaCAocywgd2QsIHJvdyk7CisgICAgICBpZiAoKHMtPmxl ZnRfb3ZlcndyaXR0ZW5fcCB8fCBzLT5yaWdodF9vdmVyd3JpdHRlbl9wKQorICAgICAgICAgICYm IHMtPmFjdGlvbl90eXBlID09IE1DX0RSQVdfR0xZUEgpCisgICAgICAgIG1jX25zX2RyYXdfb3Zl cndyaXR0ZW4gKHMsIG1hdHJpeCwgcm93LCBzLT5maXJzdF9nbHlwaCk7CisgICAgICBicmVhazsK KyAgICBjYXNlIENIQVJfR0xZUEg6CisgICAgY2FzZSBDT01QT1NJVEVfR0xZUEg6CisgICAgICBu ID0gbnNfZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIpOworICAgICAgaWYgKCFtY19u c19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4sIHJvdykpCisgICAgICAgIHJldHVybjsKKyAgICAg IGlmIChzLT5mb3Jfb3ZlcmxhcHMKKyAgICAgICAgICB8fCAocy0+Y21wX2Zyb20gPiAwCisgICAg ICAgICAgICAgICYmICEgcy0+Zmlyc3RfZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykpCisgICAgICAg IHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSAxOworICAgICAgZWxzZQorICAgICAgICBtY19uc19t YXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQgKHMsIHMtPmZpcnN0X2dseXBoLT50eXBlID09IENP TVBPU0lURV9HTFlQSCk7CisgICAgICBmbGFncyA9IHMtPmhsID09IERSQVdfQ1VSU09SID8gTlNf RFVNUEdMWVBIX0NVUlNPUiA6CisgICAgICAgIChzLT5obCA9PSBEUkFXX01PVVNFX0ZBQ0UgPyBO U19EVU1QR0xZUEhfTU9VU0VGQUNFID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EICho 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 c1ZpZXcgKnZpZXcgPSAoRW1hY3NWaWV3ICopRlJBTUVfTlNfVklFVyAoZnJhbWUpOworICAgICAg aWYgKHZpZXcgIT0gbmlsKQorICAgICAgICB2aWV3LT5zY3JvbGxiYXJzTmVlZGluZ1VwZGF0ZSsr OworICAgIH0KKyAgaWYgKHdpbmRvdykKKyAgICB3c2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHdp bmRvdywgUW5pbCk7CisgIHdpbmRvdyA9IDA7CisgIFtzZWxmIHJlbW92ZUZyb21TdXBlcnZpZXdX aXRob3V0TmVlZGluZ0Rpc3BsYXldOworICBbc2VsZiByZWxlYXNlXTsKKyAgdW5ibG9ja19pbnB1 dCAoKTsKKyAgcmV0dXJuIHJldDsKK30KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog LyogZm9yIHJlcGVhdCBidXR0b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0+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 YmFja2dyb3VuZCB3aXRoIGEgc3RpcHBsZSBwYXR0ZXJuLiAgKi8KKyAgICAgICAgWFNldEZpbGxT dHlsZSAocy0+ZGlzcGxheSwgZ2MsIEZpbGxPcGFxdWVTdGlwcGxlZCk7CisgICAgICAgIFhGaWxs UmVjdGFuZ2xlIChzLT5kaXNwbGF5LCBzLT53aW5kb3csIGdjLCB4LCB5LCB3LCBoKTsKKyAgICAg ICAgWFNldEZpbGxTdHlsZSAocy0+ZGlzcGxheSwgZ2MsIEZpbGxTb2xpZCk7CisgICAgICB9Cisg ICAgZWxzZQorI2VuZGlmCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHczMl9maWxsX2Fy ZWEgKHMtPmYsIHMtPmhkYywgZ2MtPmJhY2tncm91bmQsIHgsIHksIHcsIGgpOworICAgICAgICAg ICAgfQorICAgICAgICB9CisgICAgfQorICBlbHNlIGlmICghcy0+YmFja2dyb3VuZF9maWxsZW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U7CisgICAgfQorICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX01PVVNF X0ZBQ0UpCisgICAgeworICAgICAgeF9zZXRfbW91c2VfZmFjZV9nYyAocyk7CisgICAgICBzLT5z dGlwcGxlZF9wID0gcy0+ZmFjZS0+c3RpcHBsZSAhPSAwOworICAgIH0KKyAgZWxzZSBpZiAocy0+ aGwgPT0gRFJBV19JTUFHRV9SQUlTRUQKKyAgICAgfHwgcy0+aGwgPT0gRFJBV19JTUFHRV9TVU5L RU4pCisgICAgeworICAgICAgcy0+Z2MgPSBzLT5mYWNlLT5nYzsKKyAgICAgIHMtPnN0aXBwbGVk X3AgPSBzLT5mYWNlLT5zdGlwcGxlICE9IDA7CisgICAgfQorICBlbHNlCisgICAgZW1hY3NfYWJv cnQgKCk7CisgIC8qIEdDIG11c3QgaGF2ZSBiZWVuIHNldC4gICovCisgIGVhc3NlcnQgKHMtPmdj ICE9IDApOworfQorCisvKiBEcmF3IGEgaG9sbG93IGJveCBjdXJzb3Igb24gd2luZG93IFcgaW4g Z2x5cGggcm93IFJPVy4gICovCitzdGF0aWMgdm9pZAorbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNv ciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3Qg Z2x5cGhfcm93ICpyb3csIGludCB4LCBpbnQgZngsIGludCB5LCBpbnQgZnksIGludCBocG9zLCBp bnQgdnBvcywgaW50IHdkLCBpbnQgaCkKK3sKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChX SU5ET1dfRlJBTUUgKHcpKTsKKyAgSERDIGhkYzsKKyAgUkVDVCByZWN0OworICBIQlJVU0ggaGIg PSBDcmVhdGVTb2xpZEJydXNoIChmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCk7Cisg IC8qIEdldCB0aGUgZ2x5cGggdGhlIGN1cnNvciBpcyBvbi4gIElmIHdlIGNhbid0IHRlbGw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cHRp b24gdGhhdCB0aGUgZ2x5cGgncyBjb2xvcnMgYXJlIGNob3NlbiBzbworICAgICAgdGhhdCB0aGUg Z2x5cGggaXMgbGVnaWJsZS4gICovCisgICAgICBpZiAoZmFjZS0+YmFja2dyb3VuZCA9PSBjdXJz b3JfY29sb3IKKyAgICAgICAgICAmJiAhY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApCisgICAg ICAgIGN1cnNvcl9jb2xvciA9IGZhY2UtPmZvcmVncm91bmQ7CisgICAgICBpbnQgZGVmYXVsdF9m eCA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVMX1ggKHcsIHgpOworICAgICAgaGRjID0gZ2V0 X2ZyYW1lX2RjIChmKTsKKyAgICAgIHczMl9jbGlwX3RvX3JvdyAodywgcm93LCBURVhUX0FSRUEs IGhkYyk7CisgICAgICBpbnQgcnggPSBmeDsKKyAgICAgIGludCByeSA9IGZ5OworICAgICAgaW50 IHJ3ID0gd2Q7CisgICAgICBpbnQgcmggPSBoOworLyoKKyAgICBmcHJpbnRmIChzdGRlcnIsICJN Q19IQkFSOiAgZnggKCVkKSB8IGZ5ICglZCkgfCB3ZCAoJWQpIHwgaCAoJWQpXG4iLCByeCwgcnks IHJ3LCByaCk7CisqLworICAgICAgdzMyX2ZpbGxfYXJlYSAoZiwgaGRjLCBjdXJzb3JfY29sb3Is IHJ4LCByeSwgcncsIHJoKTsKKyAgICAgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKGhkYywgTlVM TCk7CisgICAgICByZWxlYXNlX2ZyYW1lX2RjIChmLCBoZGMpOworICAgIH0KK30KKworLyogUklG OiBEcmF3IG9yIGNsZWFyIGN1cnNvciBvbiB3aW5kb3cgVy4gICovCitzdGF0aWMgdm9pZAorbWNf dzMyX2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21h dHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICBp bnQgeCwgaW50IGZ4LCBpbnQgeSwgaW50IGZ5LCBpbnQgaHBvcywgaW50IHZwb3MsIGludCB3ZCwg aW50IGgsCisgICAgICAgICAgICAgICAgICBkb3VibGUgcmVkLCBkb3VibGUgZ3JlZW4sIGRvdWJs ZSBibHVlLCBlbnVtIHR5cGVfb2ZfY3Vyc29yIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAg ICAgaW50IGN1cnNvcl93aWR0aCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLCBib29sIG9u X3AsIGJvb2wgYWN0aXZlX3ApCit7CisgIGlmIChvbl9wKQorICAgIHsKKyAgICAgIC8qIElmIHRo aXMgaXMgdGhlIGFjdGl2ZSBjdXJzb3IsIHdlIG5lZWQgdG8gdHJhY2sgaXQgd2l0aCB0aGUKKyAg ICAgIHN5c3RlbSBjYXJldCwgc28gdGhpcmQgcGFydHkgc29mdHdhcmUgbGlrZSBzY3JlZW4gbWFn bmlmaWVycworICAgICAgYW5kIHNwZWVjaCBzeW50aGVzaXplcnMgY2FuIGZvbGxvdyB0aGUgY3Vy c29yLiAgKi8KKyAgICAgIGlmIChhY3RpdmVfcCkKKyAgICAgICAgeworICAgIHN0cnVjdCBmcmFt ZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICAgSFdORCBod25kID0gRlJBTUVf VzMyX1dJTkRPVyAoZik7CisgICAgdzMyX3N5c3RlbV9jYXJldF94CisgICAgICA9IFdJTkRPV19U RVhUX1RPX0ZSQU1FX1BJWEVMX1ggKHcsIHgpOworICAgIC8qIEZJWE1FOiAgV2hhdCBzaG91bGQg d2UgdXNlIGluc3RlYWQgb2YgYHctPnBoeXNfY3Vyc29yX2FzY2VudCc/ICovCisgICAgdzMyX3N5 c3RlbV9jYXJldF95CisgICAgICA9IChXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgeSkKKyAg ICAgICAgICsgcm93LT5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bl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5zaWVudF9tYXJrX21v ZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWFy a19hY3RpdmUpKSk7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZ2lubmluZyA9IChyZWdpb25f YWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9iZWdpbm5pbmcgKCkpIDogLTE7CisgICAgICBw dHJkaWZmX3QgcmVnaW9uX2VuZCA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lv bl9lbmQgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3Qgb3BvaW50X3B0ID0gKHcgPT0gWFdJTkRP VyAoc2VsZWN0ZWRfd2luZG93KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFBUCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBYRklYTlVNIChGbWFya2VyX3Bvc2l0aW9uICh3 LT5wb2ludG0pKTsKKyAgICAgIGJvb2wgcmVnaW9uX2luX2JvdW5kc19wID0gKHJlZ2lvbl9hY3Rp dmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3B0ID49IHJl Z2lvbl9iZWdpbm5pbmcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2lu dF9wdCA8IHJlZ2lvbl9lbmQpOworICAgICAgaWYgKGN1cnNvcl9nbHlwaC0+dHlwZSAhPSBJTUFH RV9HTFlQSCAmJiByZWQgPj0gMCAmJiBibHVlID49IDAgJiYgZ3JlZW4gPj0gMCkKKyAgICAgICAg eworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5j dXJzb3JfZ2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAgICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4 X21ha2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KyAgICAgICAgICAgICAgICAgICAgICYm IGFjdGl2ZV9wKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lk IGhvbGxvd19hY3RpdmVfcmVnaW9uX291dF9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1yZWdpb24tZmFjZSIpLCB0cnVlKTsKKyAg ICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fb3V0X2ZhY2Ug PSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX291dF9mYWNlX2lkKTsKKyAg ICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3Vw X25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRy dWUpOworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBG QUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAg Z2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7Cisg ICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3JlZ2lv bl9vdXRfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBl bHNlIGlmICghcmVnaW9uX2FjdGl2ZV9wICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBs b29rdXBfbmFtZWRfZmFjZS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TsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhl bCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChj dXJzb3JfZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEggJiYgcmVkID49IDAgJiYgYmx1ZSA+PSAw ICYmIGdyZWVuID49IDApCisgICAgICAgICAgeworICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkg aGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAg ICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAg ICAgICAgIG1jX3czMl9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwg eSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLncz Mi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICAgIH0KKyAg ICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIFRlbXBvcmFyaWx5 IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MnIGJ5IGJvcnJvd2luZyB0aGUK KyAgICAgICAgICAgICAgZnVuY3Rpb25hbGl0eSBvZiBgeF9tYWtlX2djJyBpbiB3MzJmbnMuYy4g ICovCisgICAgICAgICAgICAgIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAg ICYmIHJlZ2lvbl9pbl9ib3VuZHNfcAorICAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3ApCisg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19h Y3Rpdm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NrZ3JvdW5kOworICAgICAg ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJz b3JfZ2MgPSBYQ3JlYXRlR0MgKE5VTEwsIEZSQU1FX1czMl9XSU5ET1cgKGYpLCBtYXNrLCAmZ2Nf dmFsdWVzKTsKKyAgICAgICAgICAgICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgIC8q IEZvcmNlIGBtY193MzJfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS53 MzItPmN1cnNvcl9nYycuICAqLworICAgICAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gdHJ1 ZTsKKyAgICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBE UkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHJlZCwgZ3JlZW4sIGJsdWUsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBh Y3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzIt PmN1cnNvcl9nYyA9IG9yaWdpbmFsX2N1cnNvcl9nYzsKKyAgICAgICAgICAgICAgdW5ibG9ja19p bnB1dCAoKTsKKyAgICAgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0 cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgICAg fQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICB7Cisg ICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVuID49IDApCisgICAgICAgIHsK KyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY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9nY19wKTsKKyAgICAgICAg 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 c2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2th eV9wID0gZmFsc2U7CisgICAgICAgICAgICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRy aXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwgY3Vyc29yX3dpZHRoLCBN Q19IQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAg YnJlYWs7CisgICAgfQorICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgfQor ICAgIH0KK30KKworLyogRHJhdyBnbHlwaCBzdHJpbmcgUy4gICovCitzdGF0aWMgdm9pZAorbWNf dzMyX2RyYXdfZ2x5cGhfc3RyaW5nIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzLCBzdHJ1Y3QgZ2x5 cGhfbWF0cml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ICAgLyogRHJhdyB1bmRlcmxpbmUuICAqLworICAgICAgaWYgKHMtPmZhY2UtPnVuZGVy 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 KioqKioqKioqKiogKi8KKworCiAvKiBGcmluZ2UgYml0bWFwcy4gICovCiAKIHN0YXRpYyBpbnQg bWF4X2ZyaW5nZV9ibXAgPSAwOwpAQCAtNDA0MSwxMyArNDg5OSw3NCBAQCB3MzJfc2V0X3ZlcnRp Y2FsX3Njcm9sbF9iYXIgKHN0cnVjdCB3aW5kb3cgKncsCiAJICAgICAgcmVsZWFzZV9mcmFtZV9k YyAoZiwgaGRjKTsKIAkgICAgICB4X2NsZWFyX3VuZGVyX2ludGVybmFsX2JvcmRlciAoZik7CiAJ ICAgIH0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNV UlNPUlMgKi8KKworLyogUkVQQUlOVElORyBXSEVOIFJFTU9WSU5HIFNDUk9MTCBCQV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lZnQgPD0gYmFyLT5sZWZ0KTsK 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 RE9XUCAoV0lORE9XKSAmJiAhTklMUCAoWFdJTkRPVyAoV0lORE9XKS0+Y29udGVudHMpKQlcCmRp ZmYgLS1naXQgYS9zcmMveGRpc3AuYyBiL3NyYy94ZGlzcC5jCmluZGV4IGE4OGZjNjkuLjg4NGU3 YjQgMTAwNjQ0Ci0tLSBhL3NyYy94ZGlzcC5jCisrKyBiL3NyYy94ZGlzcC5jCkBAIC05MjEsNiAr OTIxLDM5ODEgQEAgc3RhdGljIHZvaWQgc2hvd19tb3VzZV9mYWNlIChNb3VzZV9ITEluZm8gKiwg ZW51bSBkcmF3X2dseXBoc19mYWNlKTsKIHN0YXRpYyBib29sIGNvb3Jkc19pbl9tb3VzZV9mYWNl X3AgKHN0cnVjdCB3aW5kb3cgKiwgaW50LCBpbnQpOwogCiAKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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nZXRzIGgtc2Nyb2xsZWQuCisKKy0gRGV0ZXJt aW5lIGlmIGJ1ZyAjMjg5MzYgbmVlZHMgdG8gYmUgZml4ZWQgYW5kIGhlbHAgdGhlIEVtYWNzIHRl YW0gcmUgc2FtZS4KKworCitERUJVR0dJTkc6CisKK25zX2ZvY3VzICsgbnNfY2xpcF90b19yb3cg PT4gbnNfY2xpcF90b19yZWN0IFtCT09MIC4uLiBzdHJ1Y3QgZnJhbWUgKiwgTlNSZWN0ICosIGlu dCkKKworbnNfdW5mb2N1cyA9PiBuc19yZXNldF9jbGlwcGluZworCittYWtlX3NhdmVfcHRyID0+ IG1ha2VfbWludF9wdHIKKworcm93LT5nbHlwaHNbVEVYVF9BUkVBXVtocG9zXS5waXhlbF93aWR0 aAorCitSQU5HRURfSU5URUdFUlAgPT4gUkFOR0VEX0ZJWE5VTVAKKworVFlQRV9SQU5HRURfSU5U RUdFUlAgPT4gVFlQRV9SQU5HRURfRklYTlVNUAorCittYWtlX251bWJlciA9PiBtYWtlX2ZpeG51 bQorCitYSU5UID0+IFhGSVhOVU0KKworWEZBU1RJTlQgPT4gWEZJWE5BVAorCitMaXNwX09iamVj dCBzdHJpbmcgPSBGcHJpbjFfdG9fc3RyaW5nIChpX3N0b3JlLCBRbmlsKTsKK2NoYXIgKmNoYXJf c3RyaW5nID0gU1NEQVRBIChzdHJpbmcpOworZnByaW50ZiAoc3RkZXJyLCAiaV9zdG9yZTogICVz XG4iLCBjaGFyX3N0cmluZyk7CisKK2NoYXIgKndfY29udGVudHMgPSAoQlVGRkVSUCAody0+Y29u dGVudHMpICYmIFNUUklOR1AgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbmFtZSkpKQor ICAgICAgICAgICAgICAgICAgID8gU1NEQVRBIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IG5hbWUpKQorICAgICAgICAgICAgICAgICAgIDogIm5pbCI7CitmcHJpbnRmIChzdGRlcnIsICJc bkJ1ZmZlciA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spCisgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICBpZiAo Q09OU1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FSIChsaXN0KTsKKyAgICBlbHNlCisgICAgICBy ZXR1cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QKK21jX2Fzc3EgKExpc3BfT2JqZWN0IGtleSwg TGlzcF9PYmplY3QgbGlzdCkKK3sKKyAgd2hpbGUgKDEpCisgICAgeworICAgICAgaWYgKCFDT05T UCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAg ICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBrZXkpKSkKKyAgICAgICAgYnJlYWs7CisgICAg ICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAg IHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYmIEVRIChYQ0FSIChYQ0FS IChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0 KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChs aXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhDQVIgKFhDQVIgKGxpc3QpKSwga2V5KSkpCisg ICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgIH0KKyAgaWYgKENP TlNQIChsaXN0KSkKKyAgICByZXR1cm4gWENBUiAobGlzdCk7CisgICAgZWxzZQorICAgICAgcmV0 dXJuIFFuaWw7Cit9CisKK0xpc3BfT2JqZWN0CittY19hc3NvYyAoTGlzcF9PYmplY3Qga2V5LCBM aXNwX09iamVjdCBsaXN0KQoreworICBMaXNwX09iamVjdCBjYXI7CisgIHdoaWxlICgxKQorICAg IHsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChs aXN0KSkKKyAgICAgICAgICAgICAgJiYgKGNhciA9IFhDQVIgKFhDQVIgKGxpc3QpKSwKKyAgICAg ICAgICAgICAgICAgIEVRIChjYXIsIGtleSkgfHwgIU5JTFAgKEZlcXVhbCAoY2FyLCBrZXkpKSkp KQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICgh Q09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAg ICAgICAgJiYgKGNhciA9IFhDQVIgKFhDQVIgKGxpc3QpKSwKKyAgICAgICAgICAgICAgICAgIEVR IChjYXIsIGtleSkgfHwgIU5JTFAgKEZlcXVhbCAoY2FyLCBrZXkpKSkpKQorICAgICAgICBicmVh azsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisg ICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgKGNhciA9 IFhDQVIgKFhDQVIgKGxpc3QpKSwKKyAgICAgICAgICAgICAgICAgIEVRIChjYXIsIGtleSkgfHwg IU5JTFAgKEZlcXVhbCAoY2FyLCBrZXkpKSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3Qg PSBYQ0RSIChsaXN0KTsKKyAgICB9CisgIGlmIChDT05TUCAobGlzdCkpCisgICAgcmV0dXJuIFhD QVIgKGxpc3QpOworICAgIGVsc2UKKyAgICAgIHJldHVybiBRbmlsOworfQorCitMaXNwX09iamVj dAorbWNfcGxpc3RfZ2V0IChMaXNwX09iamVjdCBwbGlzdCwgTGlzcF9PYmplY3QgcHJvcCkKK3sK KyAgTGlzcF9PYmplY3QgdGFpbCwgaGFsZnRhaWw7CisgIC8qIGhhbGZ0YWlsIGlzIHVzZWQgdG8g ZGV0ZWN0IGNpcmN1bGFy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YW4pIC8qIEF2b2lkIGluZmluaXRlIGxvb3BzIHdpdGggMC13aWR0aCBvdmVybGF5cy4g Ki8KKyAgICAgICAgeworICAgIHNjYW4gPSBlbmRwOworICAgIHNjYW5fYnl0ZSA9IENIQVJfVE9f QllURSAoc2Nhbik7CisgICAgY29udGludWU7CisgICAgICAgIH0KKyAgICB9CisgICAgICB9Cisg ICAgICAvKiBDaGVjayBjb21wb3NpdGlvbiBzZXF1ZW5jZS4gKi8KKyAgICAgIGlmIChjbXBfaXQu aWQgPj0gMAorICAgIHx8IChzY2FuID09IGNtcF9pdC5zdG9wX3BvcworICAgICAgICAmJiBjb21w b3NpdGlvbl9yZXNlYXRfaXQgKCZjbXBfaXQsIHNjYW4sIHNjYW5fYnl0ZSwgZW5kLAorICAgICAg ICAgIHcsIE5VTEwsIFFuaWwpKSkKKyAgY29tcG9zaXRpb25fdXBkYXRlX2l0ICgmY21wX2l0LCBz Y2FuLCBzY2FuX2J5dGUsIFFuaWwpOworICAgICAgaWYgKGNtcF9pdC5pZCA+PSAwKQorICB7Cisg ICAgc2NhbiArPSBjbXBfaXQubmNoYXJzOworICAgIHNjYW5fYnl0ZSArPSBjbXBfaXQubmJ5dGVz OworICAgIGlmIChzY2FuIDw9IGVuZCkKKyAgICAgIGNvbCArPSBjbXBfaXQud2lkdGg7CisgICAg aWYgKGNtcF9pdC50byA9PSBjbXBfaXQubmdseXBocykKKyAgICAgIHsKKyAgICAgICAgY21wX2l0 LmlkID0gLTE7CisgICAgICAgIGNvbXBvc2l0aW9uX2NvbXB1dGVfc3RvcF9wb3MgKCZjbXBfaXQs IHNjYW4sIHNjYW5fYnl0ZSwgZW5kLAorICAgICAgICAgICAgICBRbmlsKTsKKyAgICAgIH0KKyAg ICBlbHNlCisgICAgICBjbXBfaXQuZnJvbSA9IGNtcF9pdC50bzsKKyAgICBjb250aW51ZTsKKyAg fQorICAgICAgYyA9IEZFVENIX0JZVEUgKHNjYW5fYnl0ZSk7CisgICAgICAvKiBTZW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3RvIGVuZGxvb3A7CisgICAgICAgIGlmIChjID09ICdcdCcp 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 RV9UQUJfV0lEVEggKGN1cnJlbnRfYnVmZmVyKTsKKyAgYm9vbCBjdGxfYXJyb3cgPSAhTklMUCAo QlZBUiAoY3VycmVudF9idWZmZXIsIGN0bF9hcnJvdykpOworICBzdHJ1Y3QgTGlzcF9DaGFyX1Rh YmxlICpkcCA9IGJ1ZmZlcl9kaXNwbGF5X3RhYmxlICgpOworICBpZiAocHQgPT0gbGFzdF9rbm93 bl9jb2x1bW5fcG9pbnQKKyAgICAgICYmIE1PRElGRiA9PSBsYXN0X2tub3duX2NvbHVtbl9tb2Rp ZmllZCkKKyAgICB7CisgICAgICBpZiAob2xkX2J1ZmZlcikKKyAgICAgICAgc2V0X2J1ZmZlcl9p bnRlcm5hbCAob2xkX2J1ZmZlcik7CisgICAgICByZXR1cm4gbGFzdF9rbm93bl9jb2x1bW47Cisg ICAgfQorICAvKiBJZiB0aGUgYnVmZmVyIGhhcyBvdmVybGF5cywgd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0b3AgPSBCRUdWX0FERFI7CisgIGVsc2UKKyAgICBzdG9wID0gR0FQX0VORF9BRERS OworICBjb2wgPSAwLCB0YWJfc2VlbiA9IDAsIHBvc3RfdGFiID0gMDsKKyAgd2hpbGUgKDEpCisg ICAgeworICAgICAgcHRyZGlmZl90IGksIG47CisgICAgICBMaXNwX09iamVjdCBjaGFydmVjOwor ICAgICAgaWYgKHB0ciA9PSBzdG9wKQorICB7CisgICAgLyogV2Ugc3RvcHBlZCBlaXRoZXIgZm9y IHRoZSBiZWdpbm5pbmcgb2YgdGhlIGJ1ZmZlcgorICAgICAgIG9yIGZvciB0aGUgZ2FwLiAqLwor ICAgIGlmIChwdHIgPT0gQkVHVl9BRERSKQorICAgICAgYnJlYWs7CisgICAgLyogSXQgd2FzIHRo ZSBnYXAuICBKdW1wIGJhY2sgb3ZlciBpdC4gKi8KKyAgICBzdG9wID0gQkVHVl9BRERSOworICAg IHB0ciA9IEdQVF9BRERSOworICAgIC8qIENoZWNrIHdoZXRoZXIgdGhhdCBicmluZ3MgdXMgdG8g YmVnaW5uaW5nIG9mIGJ1ZmZlci4gKi8KKyAgICBpZiAoQkVHViA+PSBHUFQpCisgICAgICBicmVh azsKKyAgfQorICAgICAgYyA9ICotLXB0cjsKKyAgICAgIGlmIChkcCAmJiBWRUNUT1JQIChESVNQ X0NIQVJfVkVDVE9SIChkcCwgYykpKQorICB7CisgICAgY2hhcnZlYyA9IERJU1BfQ0hBUl9WRUNU T1IgKGRwLCBjKTsKKyAgICBuID0gQVNJWkUgKGNoYXJ2ZWMpOworICB9CisgICAgICBlbHNlCisg IHsKKyAgICBjaGFydmVjID0gUW5pbDsKKyAgICBuID0gMTsKKyAgfQorICAgICAgZm9yIChpID0g biAtIDE7IGkgPj0gMDsgLS1pKQorICB7CisgICAgaWYgKFZFQ1RPUlAgKGNoYXJ2ZWMpKQorICAg ICAgeworICAgICAgICAvKiBUaGlzIHNob3VsZCBiZSBoYW5kbGVkIHRoZSBzYW1lIGFzCisgICAg IG5leHRfZWxlbWVudF9mcm9tX2Rpc3BsYXlfdmVjdG9yIGRvZXMgaXQuICovCisgICAgICAgIExp c3BfT2JqZWN0IGVudHJ5ID0gQVJFRiAoY2hhcnZlYywgaSk7CisgICAgICAgIGlmIChHTFlQSF9D T0RFX1AgKGVudHJ5KSkKKyAgICBjID0gR0xZUEhfQ09ERV9DSEFSIChlbnRyeSk7CisgICAgICAg IGVsc2UKKyAgICBjID0gJyAnOworICAgICAgfQorICAgIGlmIChjID49IDA0MCAmJiBjIDwgMDE3 NykKKyAgICAgIGNvbCsrOworICAgIGVsc2UgaWYgKGMgPT0gJ1xuJworICAgICAgIHx8IChjID09 ICdccicKKyAgICAgICAgICAgJiYgRVEgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVf ZGlzcGxheSksIFF0KSkpCisgICAgICB7CisgICAgICAgIHB0cisrOworICAgICAgICBnb3RvIHN0 YXJ0X29mX2xpbmVfZm91bmQ7CisgICAgICB9CisgICAgZWxzZSBpZiAoYyA9PSAnXHQnKQorICAg ICAgeworICAgICAgICBpZiAodGFiX3NlZW4pCisgICAgY29sID0gKChjb2wgKyB0YWJfd2lkdGgp IC8gdGFiX3dpZHRoKSAqIHRhYl93aWR0aDsKKyAgICAgICAgcG9zdF90YWIgKz0gY29sOworICAg ICAgICBjb2wgPSAwOworICAgICAgICB0YWJfc2VlbiA9IDE7CisgICAgICB9CisgICAgZWxzZSBp ZiAoVkVDVE9SUCAoY2hhcnZlYykpCisgICAgICAvKiBXaXRoIGEgZGlzcGxheSB0YWJsZSBlbnRy eSwgQyBpcyBkaXNwbGF5ZWQgYXMgaXMsIGFuZAorICAgICAgICAgbm90IGRpc3BsYXllZCBhcyBc Tk5OIG9yIGFzIF5OLiAgSWYgQyBpcyBhIHNpbmdsZS1ieXRlCisgICAgICAgICBjaGFyYWN0ZXIs IGl0IHRha2VzIG9uZSBjb2x1bW4uICBJZiBDIGlzIG11bHRpLWJ5dGUgaW4K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IExpc3BfT2JqZWN0IGZyYW1lOworICBYU0VURlJBTUUgKGZyYW1lLCBmKTsKKyAgcmV0 dXJuIFNTREFUQSAoRnByaW4xX3RvX3N0cmluZyAoZnJhbWUsIFFuaWwpKTsKK30KKworLyogVVNB R0U6ICBmcHJpbnRmIChzdGRlcnIsICJXSU5ET1cgKCVzKSIsIG1jX3dpbmRvdyAodykpOyAqLwor Y2hhciAqCittY193aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncpCit7CisgIExpc3BfT2JqZWN0IHdp 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 OworICBpZiAoIXN0cmNtcCAoc3RyLCAiZnJhbWVkIikpCisgICAgcmV0dXJuIE1DX0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ICAgICAgICAgICBocG9zLCBocG9zICsgbGVuLCBEUkFXX05PUk1BTF9URVhULCAwLCB2 cG9zLCBib3R0b21fdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcmVkLCBncmVlbiwg Ymx1ZSwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsCisgICAgICAgICAgICAgICAgICAg ICAgICAgIGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCwgTUNfRFJBV19HTFlQSCk7CisgIHVuYmxvY2tf aW5wdXQgKCk7CisgIC8qIEFkdmFuY2UgdGhlIG91dHB1dCBjdXJzb3IuICovCisgIHctPm91dHB1 dF9jdXJzb3IuaHBvcyArPSBsZW47CisgIHctPm91dHB1dF9jdXJzb3IueCA9IHg7Cit9CisKKy8q IEVYUE9SVDoKKyAgIERyYXcgdGhlIGN1cnNvciBnbHlwaCBvZiB3aW5kb3cgVyBpbiBnbHlwaCBy b3cgUk9XLiAgU2VlIHRoZQorICAgY29tbWVudCBvZiBkcmF3X2dseXBocyBmb3IgdGhlIG1lYW5p bmcgb2YgSEwuICovCit2b2lkCittY19kcmF3X2N1cnNvcl9nbHlwaCAoc3RydWN0IHdpbmRvdyAq dywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisg ICAgICAgICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIGhsLCBpbnQgeCwgaW50 IGhwb3MsIGludCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgIGRvdWJsZSByZWQsIGRvdWJs ZSBncmVlbiwgZG91YmxlIGJsdWUsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwKKyAgICAg ICAgICAgICAgICAgICAgICBlbnVtIHR5cGVfb2ZfY3Vyc29yIGN1cnNvcl90eXBlLCBpbnQgd2Qs IGJvb2wgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgYm9vbCBjdXJ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aWYgKGN1cnNvcl90eXBlID09IE1DX0hPTExPV19CT1gKKyAgICAgIHx8IGN1cnNvcl90 eXBlID09IE1DX0ZSQU1FRF9CT1gpCisgICAgeworICAgICAgaW50IHRlbXBfeCA9IHg7CisgICAg ICBpbnQgaGVhZGVyX2xpbmVfaGVpZ2h0ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7 CisgICAgICBjdXJzb3JfZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJv dywgaHBvcywgdnBvcyk7CisgICAgICBpZiAoY3Vyc29yX2dseXBoID09IE5VTEwpCisgICAgICAg IHsKKyAgICAgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwg Im1jX2VyYXNlX2N1cnNvcjogIHJldHVybiAoJWQpXG4iLCA3KTsKKyAgICAgICAgICByZXR1cm47 CisgICAgICAgIH0KKyAgICAgIGludCB0ZW1wX3dkID0gY3Vyc29yX2dseXBoLT5waXhlbF93aWR0 aDsKKyAgICAgIGlmICh0ZW1wX3ggPCAwKQorICAgICAgICB7CisgICAgICAgICAgdGVtcF93ZCAr PSB0ZW1wX3g7CisgICAgICAgICAgdGVtcF94ID0gMDsKKyAgICAgICAgfQorICAgICAgdGVtcF93 ZCA9IG1pbiAod2QsIHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSkgLSB0ZW1wX3gpOwor ICAgICAgaW50IGZ5ID0gV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIG1heCAoaGVhZGVyX2xp bmVfaGVpZ2h0LCByb3ctPnkpKTsKKyAgICAgIGludCBmeCA9IFdJTkRPV19URVhUX1RPX0ZSQU1F X1BJWEVMX1ggKHcsIHRlbXBfeCk7CisgICAgICBpZiAodGVtcF93ZCA+IDApCisgICAgICAgIEZS QU1FX1JJRiAoZiktPmNsZWFyX2ZyYW1lX2FyZWEgKGYsIGZ4LCBmeSwgdGVtcF93ZCwgcm93LT52 aXNpYmxlX2hlaWdodCk7CisgICAgfQorICAvKiBFcmFzZSB0aGUgY3Vyc29yIGJ5IHJlZHJhd2lu ZyB0aGUgY2hhcmFjdGVyIHVuZGVybmVhdGggaXQuICovCisgIGlmIChtb3VzZV9mYWNlX2hlcmVf cCkKKyAgICBobCA9IERSQVdfTU9VU0VfRkFDRTsKKyAgICBlbHNlCisgICAgICBobCA9IERSQVdf Tk9STUFMX1RFWFQ7CisgIGRvdWJsZSByZWQgPSAtMS4wOworICBkb3VibGUgZ3JlZW4gPSAtMS4w OworICBkb3VibGUgYmx1ZSA9IC0xLjA7CisgIGJvb2wgYWN0aXZlX3AgPSBmYWxzZTsKKyAgYm9v bCBjdXJzb3JfZ2NfcCA9IGZhbHNlOworICBzdHJ1Y3QgZ2x5cGhfcm93ICpib3R0b21fcm93ID0g TUFUUklYX0JPVFRPTV9URVhUX1JPVyAobWF0cml4LCB3KTsKKyAgaW50IGJvdHRvbV92cG9zID0g TUFUUklYX1JPV19WUE9TIChib3R0b21fcm93LCBtYXRyaXgpOworLyoKKyAgICAgIHN0cnVjdCBn bHlwaCAqY3Vyc29yX2dseXBoID0gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3cs IGhwb3MsIHZwb3MpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZHJhd19jdXJzb3JfZ2x5 cGg6ICBjaCAoJWQpIHwgeCAoJWQpLCBocG9zICglZCksIHZwb3MoJWQpLCBobCAoJWQpXG4iLAor ICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfZ2x5cGgtPnUuY2gsIHgsIGhwb3MsIHZwb3Ms IGhsKTsKKyovCisgIGJsb2NrX2lucHV0ICgpOworICBtY19kcmF3X2dseXBocyAodywgbWF0cml4 LCByb3csIHgsIFRFWFRfQVJFQSwgaHBvcywgaHBvcyArIDEsIGhsLCAwLAorICAgICAgICAgICAg ICAgICAgdnBvcywgYm90dG9tX3Zwb3Ms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gaWYgKGJhcmZfY3Jhc2hfdHdvKQorICAgIHJldHVybjsKKyAgaWYgKHggPCAwCisgICAgICB8 fCB5IDwgMAorICAgICAgfHwgaHBvcyA8IDAKKyAgICAgIHx8IHZwb3MgPCAwKQorICAgIHJldHVy bjsKKyAgTGlzcF9PYmplY3QgYnVmID0gdy0+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+ZnJhbWUpOworICBpbnQgZnJpbmdlX2JpdG1hcCA9IE1DX05PX0ZSSU5HRV9C SVRNQVA7CisgIGludCBmYWNlX2lkID0gREVGQVVMVF9GQUNFX0lEOworICBpZiAoIXJlbW92ZV9w CisgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAg ICYmICFoc2NsX2FsbF90ZW1wX3AKKyAgICAgICYmICFoc2NsX3RlbXBfcAorICAgICAgJiYgIWhz Y2xfcGVybV9wCisgICAgICAmJiAhaHNjbF9hbGxfcGVybV8wX3AKKyAgICAgICYmICFoc2NsX2Fs bF9wZXJtXzFfcAorICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMl9wKQorICAgIHsKKyAgICAgIGVu dW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQgPQorICAgICAgICAoIWFjdGl2ZV9wCisg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2 ZV93aW5kb3dzKSkpCisgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAo Iistb3ZlcmxheS1hcnJvdy1pbmFjdGl2ZS1mYWNlIiksIHRydWUpCisgICAgICAgIDogKGFjdGl2 ZV9wKQorICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3Zl cmxheS1hcnJvdy1mYWNlIiksIHRydWUpCisgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAg ICAgZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAg ICAgICAgICAgICAgPyBvdmVybGF5X2Fycm93X2ZhY2VfaWQKKyAgICAgICAgICAgICAgICA6IERF RkFVTFRfRkFDRV9JRDsKKyAgICAgIC8qIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2Jp dG1hcCAodywgUW92ZXJsYXlfYXJyb3csIGZhbHNlLCBmYWxzZSk7ICovCisgICAgICBpZiAody0+ aHNjcm9sbCAhPSAwKQorICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X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9IE5PX0ZS SU5HRV9CSVRNQVApLiAgQXQgdGhpcyB0aW1lLCBAbGF3bGlzdCBwcmVmZXJzIG5vdCB0bworICAg ICAgcmVseSB1cG9uIGEgTGlzcCBzZXR0aW5nIHVzaW5nIGBzZXQtZnJpbmdlLWJpdG1hcC1mYWNl Jy4gKi8KKyAgICAgIHJvdy0+bGVmdF9mcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09IE1D X0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBm cmluZ2VfYml0bWFwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJ TkdFX0JJVE1BUDsKKyAgICAgIHJvdy0+bGVmdF9mcmluZ2VfZmFjZV9pZCA9IGZhY2VfaWQ7Cisg ICAgICByb3ctPmxlZnRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICByb3ctPmZyaW5nZV9iaXRt YXBfcGVyaW9kaWNfcCA9IGZhbHNlOworICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwICh3LCBy b3csIHRydWUsIGN1cnNvcl90eXBlKTsKKyAgICB9CisgICAgZWxzZSBpZiAoIXJlbW92ZV9wCisg ICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yID09IE1DX09WRVJMQVlfQVJST1dfQklUTUFQCisg ICAgICAgICAgICAgJiYgKGhzY2xfYWxsX3RlbXBfcAorICAgICAgICAgICAgICAgICB8fCBoc2Ns X2FsbF9wZXJtXzBfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzFfcAorICAg ICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAgICAgICAgICAgICAgICB8fCBo c2NsX3RlbXBfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX3Blcm1fcCkpCisgICAgICB7Cisg ICAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQgPQorICAgICAgICAgICgh YWN0aXZlX3AKKyAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgY2hfaW5hY3RpdmVfd2luZG93cykpKQorICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2Ug KHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2NsLWluYWN0aXZlLWZhY2UiKSwgdHJ1 ZSkKKyAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2NsLWZhY2UiKSwgdHJ1ZSkKKyAg ICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgZmFjZV9pZCA9IChjdXJzb3JfdHlw ZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICA/IG92ZXJsYXlf YXJyb3dfZmFjZV9pZAorICAgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAg ICAgIGlmIChoc2NsX2FsbF9wZXJtXzBfcCkKKyAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNf Z2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIGZhbHNlLCBmYWxz ZSk7CisgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8xX3ApCisgICAgICAgICAgICBm cmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1w ZXJtIiksIHRydWUsIGZhbHNlKTsKKyAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1f Ml9wKQorICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAg KHcsIGludGVybiAoIistaHNjbC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AgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1df 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 dHJpbmdfaW5kZXgsCisgICAgICAgICByb3ctPmNvbnRpbnVhdGlvbl9saW5lc193aWR0aCk7Cisg ICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTkicEQiZCAlOSJwRCJkXG4iLAorICAgICAgICAg Q0hBUlBPUyAocm93LT5zdGFydC5zdHJpbmdfcG9zKSwKKyAgICAgICAgIENIQVJQT1MgKHJvdy0+ ZW5kLnN0cmluZ19wb3MpKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgICAlOWQgJTlkXG4i LCByb3ctPnN0YXJ0LmRwdmVjX2luZGV4LAorICAgICAgICAgcm93LT5lbmQuZHB2ZWNfaW5kZXgp OworICAgIH0KKyAgaWYgKGdseXBocyA+IDEpCisgICAgeworICAgICAgZm9yIChpbnQgYXJlYSA9 IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgeworICAgIHN0 cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBoc1thcmVhXTsKKyAgICBzdHJ1Y3QgZ2x5cGgg KmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51c2VkW2FyZWFdOworICAgIC8qIEdseXBoIGZvciBh IGxpbmUgZW5kIGluIHRleHQuICovCisgICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYmIGdseXBo ID09IGdseXBoX2VuZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDApCisgICAgICArK2dseXBoX2VuZDsK KyAgICBpZiAoZ2x5cGggPCBnbHlwaF9lbmQpCisgICAgICBmcHJpbnRmIChzdGRlcnIsICJHbHlw aCMvVG90YWwgUmVsLlggVCAgICAgICBQb3MgTyAgIFcgICAgIENvZGUgRmFjZSBMUiAgICAgWCAg ICBZIEhQT1MgVlBPUyBaViBDXG4iKTsKKyAgICBmb3IgKDsgZ2x5cGggPCBnbHlwaF9lbmQ7ICsr Z2x5cGgpCisgICAgICB7CisgICAgICAgIG1jX2R1bXBfZ2x5cGggKHJvdywgZ2x5cGgsIGFyZWEs IHJlbGF0aXZlX3gpOworICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsK KyAgICAgIH0KKyAgfQorICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGhzID09IDEpCisgICAgeworICAg ICAgY2hhciBzW1NIUlRfTUFYICsgNF07CisgICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9NQVJH SU5fQVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICB7CisgICAgaW50IGk7CisgICAg Zm9yIChpID0gMDsgaSA8IHJvdy0+dXNlZFthcmVhXTsgKytpKQorICAgICAgeworICAgICAgICBz dHJ1Y3QgZ2x5cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV0gKyBpOworICAgICAgICBpZiAo aSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAmJiBhcmVhID09IFRFWFRfQVJFQQorICAg ICAgJiYgTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICYmIGdseXBoLT50eXBlID09IENIQVJf R0xZUEgKKyAgICAgICYmIGdseXBoLT51LmNoID09ICcgJykKKyAgICB7CisgICAgICBzdHJjcHkg KCZzW2ldLCAiW1xcbl0iKTsKKyAgICAgIGkgKz0gNDsKKyAgICB9CisgICAgICAgIGVsc2UgaWYg KGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPCAw eDgwCisgICAgICAgICAgICYmIGdseXBoLT51LmNoID49ICcgJykKKyAgICBzW2ldID0gZ2x5cGgt PnUuY2g7CisgICAgICAgIGVsc2UKKyAgICBzW2ldID0gJy4nOworICAgICAgfQorICAgIHNbaV0g PSAnXDAnOworICAgIGZwcmludGYgKHN0ZGVyciwgIiUzZDogKCVkKSAnJXMnXG4iLCB2cG9zLCBy b3ctPmVuYWJsZWRfcCwgcyk7CisgIH0KKyAgICB9Cit9CisKK0RFRlVOICgibWMtZHVtcC1nbHlw aC1yb3ciLCBGbWNfZHVtcF9nbHlwaF9yb3csIFNtY19kdW1wX2dseXBoX3JvdywgMSwgMiwgIlAi LAorICAgICAgIGRvYzogLyogRHVtcCBnbHlwaCByb3cgUk9XIHRvIHN0ZGVyci4KK0ludGVyYWN0 aXZlbHksIFJPVyBpcyB0aGUgcHJlZml4IG51bWVyaWMgYXJndW1lbnQgYW5kIGRlZmF1bHRzIHRv Cit0aGUgcm93IHdoaWNoIGRpc3BsYXlzIHBvaW50LgorT3B0aW9uYWwgYXJndW1lbnQgR0xZUEhT IDAgbWVhbnMgZG9uJ3QgZHVtcCBnbHlwaHMuCitHTFlQSFMgMSBtZWFucyBkdW1wIGdseXBocyBp biBzaG9ydCBmb3JtLgorR0xZUEhTID4gMSBvciBvbWl0dGVkIG1lYW5zIGR1bXAgZ2x5cGhzIGlu IGxvbmcgZm9ybS4gICovKQorICAoTGlzcF9PYmplY3Qgcm93LCBMaXNwX09iamVjdCBnbHlwaHMp Cit7CisgIHN0cnVjdCB3aW5kb3cgKncgPSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpOworICBz dHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXg7CisgIEVNQUNTX0lOVCB2cG9zOworICBpZiAoTklM UCAocm93KSkKKyAgICB7CisgICAgICBpbnQgZDEsIGQyLCBkMywgZDQsIGQ1LCB5cG9zOworICAg ICAgYm9vbCB2aXNpYmxlX3AgPSBwb3NfdmlzaWJsZV9wICh3LCBQVCwgJmQxLCAmZDIsICZkMywg JmQ0LCAmZDUsICZ5cG9zKTsKKyAgICAgIGludCBoZWFkZXJfbGluZV9oZWlnaHQgPSBXSU5ET1df SEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgIGludCB2b2Zmc2V0ID0gKGhlYWRlcl9saW5l X2hlaWdodCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICYmIHlwb3MgPiAwKQorICAgICAgICAg ICAgICAgICAgICAgID8geXBvcyArIDEKKyAgICAgICAgICAgICAgICAgICAgICA6IHlwb3M7Cisg ICAgICBpZiAodmlzaWJsZV9wKQorICAgICAgICB2cG9zID0gdm9mZnNldDsKKyAgICAgICAgZWxz ZQorICAgICAgICAgIHZwb3MgPSAwOworICAgIH0KKyAgICBlbHNlCisgICAgICB7CisgICAgICAg IENIRUNLX05VTUJFUiAocm93KTsKKyAgICAgICAgdnBvcyA9IFhGSVhOVU0gKHJvdyk7CisgICAg ICB9CisgIG1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICBpZiAodnBvcyA+PSAwICYmIHZw b3MgPCBtYXRyaXgtPm5yb3dzKQorICAgIG1jX2R1bXBfZ2x5cGhfcm93IChNQVRSSVhfUk9XICht YXRyaXgsIHZwb3MpLAorICAgICAgICB2cG9zLAorICAgICAgICBUWVBFX1JBTkdFRF9GSVhOVU1Q IChpbnQsIGdseXBocykgPyBYRklYTlVNIChnbHlwaHMpIDogMik7CisgIHJ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yAg ZnByaW50ZiAoc3RkZXJyLCAiUFQgPSAlInBEImQsIEJFR1YgPSAlInBEImQuIFpWID0gJSJwRCJk XG4iLAorICAgICBCVUZfUFQgKGJ1ZmZlciksIEJVRl9CRUdWIChidWZmZXIpLCBCVUZfWlYgKGJ1 ZmZlcikpOworICBmcHJpbnRmIChzdGRlcnIsICJDdXJzb3IgeCA9ICVkLCB5ID0gJWQsIGhwb3Mg PSAlZCwgdnBvcyA9ICVkXG4iLAorICAgICB3LT5jdXJzb3IueCwgdy0+Y3Vyc29yLnksIHctPmN1 cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcyk7CisgIGZwcmludGYgKHN0ZGVyciwgIj09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuIik7CisgIG1jX2R1bXBfZ2x5 cGhfbWF0cml4ICh3LT5jdXJyZW50X21hdHJpeCwKKyAgICAgICAgIFRZUEVfUkFOR0VEX0ZJWE5V TVAgKGludCwgZ2x5cGhzKSA/IFhGSVhOVU0gKGdseXBocykgOiAwKTsKKyAgcmV0dXJuIFFuaWw7 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 c3RydWN0IG1jX1JHQiBmb3JlZ3JvdW5kLCBzdHJ1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5fZmcsIGJsdWVfZmcsIHJlZF9iZywg Z3JlZW5fYmcsIGJsdWVfYmcpOworICAgIH0KKyAgYm9vbCByZW1vdmVfcCA9IGZhbHNlOworICBp ZiAoZHJhd19wKQorICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCBtYXRyaXgsIHJvdywgeCwg ZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAg ICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYWN0aXZlX3AsIGdseXBoX2Zs YXZvciwgcmVtb3ZlX3ApOworICBzdHJ1Y3QgbXVsdGlwbGVfY3Vyc29yc19jYWNoZSBmb29fZWx0 czsKKyAgc3dpdGNoIChjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGNhc2UgTk9fQ0FDSEU6Cisg ICAgICAgIHsKKyAgICAgICAgICAvKiBEbyBub3QgY29udGludWUgdG8gdGhlIGxhc3Qgc2VjdGlv biB0aGF0IHBvcHVsYXRlcyB0aGUgY2FjaGUgd2l0aAorICAgICAgICAgIGN1cnNvciBkYXRhLCBh 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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lRJQ0FMX1JVTEVSIGFuZCBGSUxMX0NPTFVNTjogIFdlIHdhbnQg YW4gSCB0aGF0IGVuc3VyZXMgbm8gZ2FwIGJldHdlZW4gdGhlCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBwcmV2aW91cy9uZXh0IGxpbmUuICBUaGUgRlggY29vcmRpbmF0ZSBp cyBzZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V3aGVyZTogIGB3 LT5jdXJzb3IueGAgLyBgbWMuZmNfeGAuICovCit2b2lkCittY19nZXRfY3Vyc29yX2dlb21ldHJ5 IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsCisgICAgICAg ICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB4LCBpbnQgKmZ4LCBp bnQgeSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCAqZnksIGludCBocG9zLCBpbnQgdnBv cywgaW50ICpoLAorICAgICAgICAgICAgICAgICAgICAgICAgZW51bSB0eXBlX29mX2N1cnNvciBj dXJzb3JfdHlwZSwgaW50IGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGlu dCAqd2QpCit7CisgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3 LCBtYXRyaXgsIHJvdywgaHBvcywgdnBvcyk7CisgIGlmIChnbHlwaCA9PSBOVUxMKQorICAgIHJl dHVybjsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAg KmZ4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICpoID0gcm93LT52 aXNpYmxlX2hlaWdodDsKKyAgLyogRG9uJ3QgbGV0IHRoZSBjdXJzb3IgZXhjZWVkIHRoZSBkaW1l bnNpb25zIG9mIHRoZSByb3csIHNvIHRoYXQKKyAgdGhlIHVwcGVyL2xvd2VyIHNpZGUgb2YgdGhl IGJveCBhcmVuJ3QgY2xpcHBlZC4gICovCisgIGludCB3X2hlYWRlcl9saW5lX2hlaWdodCA9IFdJ TkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICBpbnQgd190ZXh0X2JvdHRvbV95ID0gd2lu ZG93X3RleHRfYm90dG9tX3kgKHcpIC0gKmg7CisgIGlmICh5IDwgd19oZWFkZXJfbGluZV9oZWln aHQpCisgICAgeworICAgICAgKmggPSBtYXggKCpoIC0gKHdfaGVhZGVyX2xpbmVfaGVpZ2h0IC0g eSkgKyAxLCAqaCk7CisgICAgICB5ID0gd19oZWFkZXJfbGluZV9oZWlnaHQgLSAxOworICAgICAg Ly8gZnByaW50ZiAoc3RkZXJyLCAiQ09ORElUSU9OICMgMVxuIik7CisgICAgfQorICAgZWxzZSBp ZiAoeSA+IHdfdGV4dF9ib3R0b21feSkKKyAgICAgeworICAgICAgICpoICs9IHkgLSB3X3RleHRf Ym90dG9tX3k7CisgICAgICAgeSA9IHdfdGV4dF9ib3R0b21feTsKKyAgICAgICAvLyBmcHJpbnRm IChzdGRlcnIsICJDT05ESVRJT04gIyAyXG4iKTsKKyAgICAgfQorICAqZnkgPSBXSU5ET1dfVE9f RlJBTUVfUElYRUxfWSAodywgeSk7CisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgeworICAg ICAgY2FzZSBNQ19CQVI6CisgICAgICAgIHsKKyAgICAgICAgICBpZiAoY3Vyc29yX3dpZHRoIDwg MSkKKyAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IG1heCAoRlJBTUVfQ1VSU09SX1dJRFRIIChm KSwgMSk7CisgICAgICAgICAgaWYgKGN1cnNvcl93aWR0aCA8IGdseXBoLT5waXhlbF93aWR0aCkK KyAgICAgICAgICAqd2QgPSBjdXJzb3Jfd2lkdGg7CisgICAgICAgICAgYnJlYWs7CisgICAgICAg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BoICpjdXJzb3JfZ2x5cGggPSBtY19n ZXRfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIGN1cnNvcl9yb3csIHctPmN1cnNvci5ocG9zLCB3 LT5jdXJzb3IudnBvcyk7CisgIGJvb2wgY3Vyc29yX2luX2ZyaW5nZV9wID0gKGN1cnNvcl9nbHlw aCAhPSBOVUxMKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gb3BvaW50X3ggKyBjdXJz b3JfZ2x5cGgtPnBpeGVsX3dpZHRoID49IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogZmFsc2U7CisgIGludCBmcmFtZV9jaGFyX3dpZHRoID0gRlJBTUVfQ09M VU1OX1dJRFRIIChmKTsKKyAgaW50IHRlbXBfZmFjZV9pZCA9IGdseXBoLT5mYWNlX2lkOworICBz dHJ1Y3QgbWNfUkdCIGJhY2tncm91bmQ7CisgIG1jX3NldF9iZ19sc2wgKHcsIHRlbXBfZmFjZV9p ZCwgJmJhY2tncm91bmQpOworICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9IChvcG9pbnRfeCA9 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 b3hfbGluZV9wLAorICAgICAgICBnbHlw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lwZSwgY3Vyc29yX3dpZHRoLAorICAgICAgICAgICAgICAgICAg ICAgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwgYWN0aXZlX3AsIE1DX0dMWVBITEVTUywgZHJhd19w LAorICAgICAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSk7CisgICAgICAgIH0KKyAgICAgIGJy ZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICBW RVJUSUNBTF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAg ICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVS OgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJzb3JfaW5f ZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRf cCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisg ICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAg ICAgICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVS VElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9pbl9mcmlu Z2VfcAorICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9w CisgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAg ICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgIDogKGdseXBo IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAg ICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAg ICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiAoenZfcCkK KyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAg OiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJ R0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9C QUNLU0xBU0gKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSKQor ICAgICAgICBjdXJzb3JfdHlwZSA9IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA7CisgICAgICB3ZCA9 IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwg b3BvaW50X2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1 cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAg ICAgICAgICAgIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgY2FjaGVfdHlwZSk7Cisg ICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAg ICAgICAgRklMTF9DT0xVTU46ICBDSEFSX0dMWVBIIHwgR0xZUEhMRVNTX0dMWVBIICAgICAgICAg ICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBGSUxMX0NPTFVN TjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAg ICAgICAgICAgJiYgZmNfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAg ICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICh6dl9wKQorICAgICAgICAg ICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICghTklMUCAo QlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAg ICAgICAgICAgICAgICYmIG9wb2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAgICAmJiBv cG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MK KyAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgd2QgPSAxOworICAgICAgbWNf aGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwg aHBvc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dGRlcnJfcCkKKyAgICAgIGZwcmludGYgKHN0ZGVy ciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4 ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVzXG4iLAorICAgICAgICBnbHlw aCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09 IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAg ICAgICAnUycsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5 cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+ b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5v YmplY3QpCisgICAgICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAnLScpKSksCisg ICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgMHUsCisgICAgICAgIGdseXBoLT5m YWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+ cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBv cywgZ2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICJcXFMi KTsKKyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAgeworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICov CisvKiAgICAgICAgICAgICAgICAgICAgICAgIE1VT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ICAgICAgICAgICAgICAgICBjYWNo 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 ICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0g LSAxCisgICAgICAgICAgJiYgZmNfeCA+IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgp CisgICAgICAgIHRlbXBfZmFjZV9pZCA9IGdseXBoLT5mYWNlX2lkOworICAgICAgICBlbHNlIGlm ICghcm93LT5maWxsX2xpbmVfcAorICAgICAgICAgICAgICAgICAmJiBnbHlwaCAtIHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAm JiBmY194ID4gcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgICB0ZW1w X2ZhY2VfaWQgPSBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICBzdHJ1Y3QgbWNfUkdCIGJhY2tncm91 b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TUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAg 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 LS0tLS0tLS0tL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0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBFTkQ6ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgICAq LworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLwor LyogICAgICAgICAgICAgICAgICAgICAgICAgICAgQkVHSU46ICBDT01QT1NJVEVfR0xZUEggICAg ICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgZWxz ZSBpZiAoZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0 ZGVycl9wKQorICAgICAgeworICAgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICAgIlxu ICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4IiwKKyAgICAgICAgICBn bHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgKChyb3ctPnVzZWRbYXJl YV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgICAgcmVsYXRpdmVf eCwKKyAgICAgICAgICAnKycsCisgICAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgICAg KEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgID8gJ0InCisgICAgICAgICAgIDog KFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAg ICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICAgID8gJzAnCisgICAg ICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAg ICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5jbXAuaWQpOworICAgICAgICBmcHJpbnRm IChzdGRlcnIsICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAgICAgIGdseXBoLT5mYWNlX2lkLAor ICAgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgICAgZ2x5cGgtPnJpZ2h0 X2JveF9saW5lX3ApOworICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAg IGZwcmludGYgKHN0ZGVyciwgIiAlNWQgJTRkICAlM2QgICUzZCAlcyAuIFslZC0lZF1cbiIsCisg ICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywg Z2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICAgICAgICAg ICAgICAgICAgZ2x5cGgtPnNsaWNlLmNtcC5mcm9tLCBnbHlwaC0+c2xpY2UuY21wLnRvKTsKKyAg ICAgICAgZWxzZQorICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlxuIik7CisgICAgICB9Cisg IHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyog ICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlM6ICBDT01QT1NJVEVfR0xZUEgg ICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNl IE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJv dywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAg ICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tn cm91bmQsCisgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBjYWNo ZV90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLwor 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 ICAgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSF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94KQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExF U1MKKyAgICAgICAgICAgICAgICAgICA6ICh6dl9wKQorICAgICAgICAgICAgICAgICAgICAgPyBN Q19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3No YWlycykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICYm IG9wb2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB2 cG9zKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAg ICAgICA6IE1DX0dMWVBIOworICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVyICh3LCBtYXRy aXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAg ICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91 bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3Is IGRyYXdfcCwgY2FjaGVfdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0gKi8KKyAgfQorICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC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A/ICdC JworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1Mn CisgICAgICAgICAgICA6ICctJykpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAg ICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAg ICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnUueHdpZGdldCwK KyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3MsIGds eXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisjZW5kaWYKKyAgc3dpdGNo IChhY3Rpb25fdHlwZSkKKyAgeworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAg ICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlM6ICBYV0lER0VUX0dMWVBIICAgICAgICAg ICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgTVVMVElQ TEVfQ1VSU09SUzoKKyAgICB7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlw aCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3 ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwK KyAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGNhY2hlX3R5cGUp OworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAg ICAgICAgICAgICAgICAgICAgIEhPUklaT05UQUxfUlVMRVI6ICBYV0lER0VUX0dMWVBIICAgICAg ICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgSE9S SVpPTlRBTF9SVUxFUjoKKyAgICB7CisgICAgICBpZiAocmVsYXRpdmVfeCA8PSB4X2xpbWl0Cisg ICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgbWNfaGVscGVyICh3LCBt YXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAg 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/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBp ZiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAg IHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAg fHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgY3Vyc29yX3R5cGUg PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJv dywgZ2x5cGgsIHJlbGF0aXZlX3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAg ICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5k LCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBhY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBk cmF3X3AsIGNhY2hlX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgIEZJTExfQ09MVU1OOiAgWFdJ REdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LSAqLworICAgIGNhc2UgRklMTF9DT0xVTU46CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3Ig Z2x5cGhfZmxhdm9yID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVz 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 X2lkLCAmY3Vyc29yX2JnKTsKKyAgLyogRklYTUU6ICBQdXQgaW4gc29tZSBjb2RlIHRvIGRlZ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GlyZSByb3cuICovCisgIGlmICh2 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 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aWR0aCBvZiAxLiAqLworICAgICAgbWNfZ2V0X2N1 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 KioqKioqKioqICovCisgIGlmIChocG9zX2xlbmd0aCA9PSAxKQorICAgIHsKKyAgIC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URVhUX0FSRUFdICsgaHBvcyAtIDEKKyAgICAgICAgICAg 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 ICBjYXNlIEZDX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgZm9vX2VsdHMuY2FjaGVzID0g dy0+ZmNfZWx0cy5jYWNoZXM7CisgICAgICAgICAgZm9vX2VsdHMuYWxsb2NhdGVkID0gdy0+ZmNf ZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgZm9vX2VsdHMudXNlZCA9IHctPmZjX2VsdHMudXNl ZDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgLyogU1RSRVRDSF9HTFlQ SCBtYXkgY29udGFpbiBtb3JlIHRoYW4gb25lIGZha2UgY3Vyc29yIGF0IHRoZSBzYW1lIEhQT1Mu ICovCisgIGZvciAoaW50IGVsdCA9IDA7IGVsdCA8IGZvb19lbHRzLnVzZWQ7ICsrZWx0KQorICAg IHsKKyAgICAgIGludCB4ID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0ueDsKKyAgICAgIGludCBmeCA9 IGZvb19lbHRzLmNhY2hl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HMuY2FjaGVzW2Vs dF0uYmFja2dyb3VuZC5ibHVlfTsKKyAgICAgIGJvb2wgYWN0aXZlX3AgPSBmb29fZWx0cy5jYWNo ZXNbZWx0XS5hY3RpdmVfcDsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IGZv b19lbHRzLmNhY2hlc1tlbHRdLmdseXBoX2ZsYXZvcjsKKyAgICAgIGJvb2wgZW5hYmxlZF9wID0g Zm9vX2VsdHMuY2FjaGVzW2VsdF0uZW5hYmxlZF9wOworICAgICAgaWYgKHZwb3MgPT0gcm93X3Zw b3MKKyAgICAgICAgICAmJiAoKGhwb3MgPj0gc3RhcnRfaHBvcworICAgICAgICAgICAgICAgJiYg aHBvcyA8IGVuZF9ocG9zKQorICAgICAgICAgICAgICAvKiBBIGZsb2F0aW5nIGN1cnNvciBiZXlv bmQgdGhlIGVuZCBvZiB0aGUgZ2x5cGggcm93LiAqLworICAgICAgICAgICAgICB8fCAoaHBvcyAr IDEgPT0gc3RhcnRfaHBvcworICAgICAgICAgICAgICAgICAgJiYgaHBvcyArIDEgPT0gZW5kX2hw b3MpKQorICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGJvb2wg cmVtb3ZlX3AgPSBmYWxzZTsKKyAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgbWF0 cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZnX2xzbCwgYWN0 aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgcmVt b3ZlX3ApOworICAgICAgICB9CisgICAgfQorfQorCit2b2lkCittY19yZWRyYXdfcm93IChzdHJ1 Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF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cnVjdCBnbHlw 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 c1tlbHRdLmZ5OworICAgICAgaW50IGhwb3MgPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5ocG9zOwor ICAgICAgaW50IHZwb3MgPSBmb29fZWx0cy5jYWNoZXNbZWx0XS52cG9zOworICAgICAgaW50IHdk ID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0ud2Q7CisgICAgICBpbnQgaCA9IGZvb19lbHRzLmNhY2hl c1tlbHRdLmg7CisgICAgICBlbnVtIHR5cGVfb2ZfY3Vyc29yIGN1cnNvcl90eXBlID0gZm9vX2Vs dHMuY2FjaGVzW2VsdF0uY3Vyc29yX3R5cGU7CisgICAgICBpbnQgY3Vyc29yX3dpZHRoID0gZm9v X2VsdHMuY2FjaGVzW2VsdF0uY3Vyc29yX3dpZHRoOworICAgICAgc3RydWN0IG1jX1JHQiBmZ19s c2wgPSB7LnJlZCA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLmZvcmVncm91bmQucmVkLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgLmdyZ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CBi YXJmX2NyYXNoX3R3byA9ICh2cG9zID49IDAgJiYgdnBvcyA8IG1hdHJpeC0+bnJvd3MpID8gZmFs c2UgOiB0cnVlOworICAgICAgaWYgKGJhcmZfY3Jhc2hfdHdvKQorICAgICAgICBjb250aW51ZTsK KyAgICAgIGlmICh2cG9zID09IHJvd192cG9zCisgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yID09 IE1DX0dMWVBICisgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICB7CisgICAgICAgICAg bWNfZXJhc2VfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgeSwgaHBvcywgdnBvcywgZ2x5cGhf Zmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QpOworICAgICAgICAgIGZvb19lbHRzLmNhY2hlc1tlbHRd LmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKHZwb3MgPT0g cm93X3Zwb3MKKyAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgIHsKKyAg ICAgICAgICAgIGJvb2wgcmVtb3ZlX3AgPSB0cnVlOworICAgICAgICAgICAgbWNfZHJhd19lcmFz ZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBo LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jf d2lkdGgsIGJnX2xzbCwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZ2x5cGhfZmxhdm9yLCByZW1vdmVfcCk7CisgICAgICAgICAgICBmb29fZWx0cy5jYWNoZXNb ZWx0XS5lbmFibGVkX3AgPSBmYWxzZTsKKyAgICAgICAgICB9CisgICAgfQorfQorCit2b2lkCitt Y19lcmFzZV9yb3cgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJp eCwgc3RydWN0IGdseXBoX3JvdyAqcm93KQoreworICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBP UyAocm93LCBtYXRyaXgpOworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAo c3RkZXJyLCAibWNfZXJhc2Vfcm93ICglcyk6ICB2cG9zICglZClcbiIsIG1jX3dpbmRvdyAodyks IHZwb3MpOworICBtY19lcmFzZV9oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBNQ19DQUNIRSk7Cisg IG1jX2VyYXNlX2hlbHBlciAodywgbWF0cml4LCByb3csIENIX0NBQ0hFKTsKKyAgbWNfZXJhc2Vf aGVscGVyICh3LCBtYXRyaXgsIHJvdywgRkNfQ0FDSEUpOworfQorCit2b2lkCittY19zZXRfZXNz ZW50aWFscyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBhY3RpdmVfcCwgc3RydWN0IG1jX1JHQiAq Y2hfZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCICpmY19mb3Jl Z3JvdW5kLCBpbnQgKmZjX3gpCit7CisgIGlmICghQlVGRkVSUCAody0+Y29udGVudHMpKQorICAg IHJldHVybjsKKyAgaWYgKE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29u ZikpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFp cnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNp YmxlKSkpCisgICAgcmV0dXJuOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1l KTsKKyAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y29udGVudHM7CisgIENIRUNLX0JVRkZFUiAoYnVm KTsKKyAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1Zik7CisgIHN0cnVjdCBidWZmZXIg Km9sZF9idWZmZXIgPSBOVUxMOworICBwdHJkaWZmX3Qgb3BvaW50ID0gKHcgPT0gWFdJTkRPVyAo c2VsZWN0ZWRfd2luZG93KSkKKyAgICAgICAgICAgICAgICAgICAgID8gUFQKKyAgICAgICAgICAg ICAgICAgICAgIDogWEZJWE5VTSAoRm1hcmtlcl9wb3NpdGlvbiAody0+cG9pbnRtKSk7CisgIHB0 cmRpZmZfdCBmY19jdXJyZW50X2NvbCA9IG1jX2N1cnJlbnRfY29sdW1uICh3LCBvcG9pbnQpOwor ICBpbnQgZnJhbWVfY2hhcl93aWR0aCA9IEZSQU1FX0NPTFVNTl9XSURUSCAoZik7CisgIGJvb2wg ZmlsbF9jb2x1bW5fcCA9ICFOSUxQIChCVkFSIChiLCBmaWxsX2NvbHVtbikpOworICBpbnQgZmls bF9jb2wgPSBYRklYTlVNIChCVkFSIChiLCBmaWxsX2NvbHVtbikpOworICBpbnQgaHNjbF94ID0g dy0+aHNjcm9sbCAqIGZyYW1lX2NoYXJfd2lkdGg7CisgIGlmIChiICE9IGN1cnJlbnRfYnVmZmVy KQorICAgIHsKKyAgICAgIG9sZF9idWZmZXIgPSBjdXJyZW50X2J1ZmZlcjsKKyAgICAgIHNldF9i dWZmZXJfaW50ZXJuYWwgKGIpOworICAgIH0KKyAgKmZjX3ggPSAoZmlsbF9jb2x1bW5fcAorICAg ICAgICAgICAmJiAhTklMUCAoVmRpc3BsYXlfbGluZV9udW1iZXJzKSkKKyAgICAgICAgICAgID8g KGZpbGxfY29sICogZnJhbWVfY2hhcl93aWR0aCkgKyB3LT5tYy5sbnVtX3BpeGVsX3dpZHRoIC0g aHNjbF94CisgICAgICAgICAgOiAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICYmIE5JTFAg KFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisgICAgICAgICAgICA/IChmaWxsX2NvbCAqIGZyYW1l X2NoYXJfd2lkdGgpIC0gaHNjbF94CisgICAgICAgICAgOiAwOworICBpZiAob2xkX2J1ZmZlcikK KyAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKyAgZW51bSBmYWNlX2lkIGZp bGxfY29sdW1uX2ZhY2VfaWQgPQorICAgICghYWN0aXZlX3AKKyAgICAgJiYgIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfaW5hY3RpdmVfd2luZG93cykpCisgICAgICYmIE5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgPyBs b29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiZmMtaW5hY3RpdmUtZmFjZSIpLCB0cnVl KQorICAgIDogKCFhY3RpdmVfcAorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAgICYmICFOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQIChCVkFS IChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gKmZjX3gp CisgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1vcG9pbnQtaW5h Y3RpdmUtZmFjZSIpLCB0cnVlKQorICAgIDogKGFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgJiYgIU5JTFAg KEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAmJiB3LT5jdXJzb3IueCA9PSAq ZmNfeCkKKyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjL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fUk9XIChjdXJyZW50X21hdHJpeCwgdnBvcyktPmVuYWJs ZWRfcAorICAgICAgICYmICh3LT5tY19lbHRzLnVzZWQgPiAwIHx8IHctPmNoX2VsdHMudXNlZCA+ IDAgfHwgdy0+ZmNfZWx0cy51c2VkID4gMCk7CisgICAgICAgKyt2cG9zKQorICAgIHsKKyAgICAg IHN0cnVjdCBnbHlwaF9yb3cgKnJvdyA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCB2cG9z KTsKKyAgICAgIG1jX2VyYXNlX3JvdyAodywgY3VycmVudF9tYXRyaXgsIHJvdyk7CisgICAgfQor ICBtY19yZXNldF9jYWNoZSAodywgTUNfQ0FDSEUpOworICBtY19yZXNldF9jYWNoZSAodywgQ0hf Q0FDSEUpOworICBtY19yZXNldF9jYWNoZSAodywgRkNfQ0FDSEUpOworfQorCitERUZVTiAoIm1j LXN0ZGVyciIsIEZtY19zdGRlcnIsIFNtY19zdGRlcnIsIDAsIDEsICJQIiwKKyAgICAgICBkb2M6 IC8qIFRvZ2dsZSB0cmFjaW5nIG9mIG11bHRpcGxlIGZha2UgY3Vyc29ycy4KK1dpdGggQVJHLCB0 dXJuIHRyYWNpbmcgb24gaWYgYW5kIG9ubHkgaWYgQVJHIGlzIHBvc2l0aXZlLiAqLykKKyAgKExp c3BfT2JqZWN0IGFyZykKK3sKKyAgaWYgKE5JTFAgKGFyZykpCisgICAgbWNfc3RkZXJyX3AgPSAh bWNfc3RkZXJyX3A7CisgIGVsc2UKKyAgICB7CisgICAgICBhcmcgPSBGcHJlZml4X251bWVyaWNf dmFsdWUgKGFyZyk7CisgICAgICBtY19zdGRlcnJfcCA9IFhGSVhOVU0gKGFyZykgPiAwOworICAg IH0KKyAgcmV0dXJuIFFuaWw7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAMCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKIAkJICAgICAgV2lu ZG93IGRpc3BsYXkgZGltZW5zaW9ucwpAQCAtMTMzOTUsNiArMTczNzAsNjkgQEAgaHNjcm9sbF93 aW5kb3dfdHJlZSAoTGlzcF9PYmplY3Qgd2luZG93KQogCSAgICAgIGVsc2UKIAkJcHQgPSBjbGlw X3RvX2JvdW5kcyAoQkVHViwgbWFya2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pLCBaVik7CiAKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisK Ky8qIChnZGIpIGJ0CisjMCAgdGVybWluYXRlX2R1ZV90b19zaWduYWwgKHNpZz02LCBiYWNrdHJh Y2VfbGltaXQ9MjE0NzQ4MzY0NykgYXQgZW1hY3MuYzozNTkKKyMxICAweDAwMDAwMDAxMDAxZWU5 OTYgaW4gZGllICgKKyAgICBtc2c9MHgxMDAzMmZjODggImNoYXJwb3MgPCAwIHx8IChjaGFycG9z ID49IEJVRl9CRUcgKGN1cnJlbnRfYnVmZmVyKSAmJiBjaGFycG9zIDw9IFpWKSIsIGZpbGU9MHgx MDAzMmUzMmQgInhkaXNwLmMiLCBsaW5lPTc5NTEpIGF0IGFsbG9jLmM6NzIxNAorIzIgIDB4MDAw MDAwMDEwMDA0ZDJhYiBpbiBpbml0X2l0ZXJhdG9yIChpdD0weDdmZmY1ZmJmOWU4MCwgdz0weDEx YWU2MjE1MCwKKyAgICBjaGFycG9zPTc0MywgYnl0ZXBvcz03NDMsIHJvdz0weDAsIGJhc2VfZmFj ZV9pZD1ERUZBVUxUX0ZBQ0VfSUQpCisgICAgYXQgeGRpc3AuYzo3OTUwCisjMyAgMHgwMDAw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x8IChjaGFycG9zID49IEJVRl9CRUcgKGN1cnJlbnRfYnVmZmVyKQorICAgICAgICAg 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+ IGZpcnN0KQorICAgICAgLyogRmxvYXRpbmcgZmFrZSBjdXJzb3JzIHdpbGwgZXhpc3Qgd2hlbiAo bGFzdCA9PSBmaXJzdCkuICovCisgICAgICBpZiAoKHctPm1jX2VsdHMudXNlZCA+IDAgfHwgdy0+ Y2hfZWx0cy51c2VkID4gMCB8fCB3LT5mY19lbHRzLnVzZWQgPiAwKQorICAgICAgICAgICYmIGFy ZWEgPT0gVEVYVF9BUkVBKQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX21hdHJp eCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAgICAgaW50IHZwb3MgPSBNQVRS SVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAgICBzdGFydF94ID0gZmlyc3RfeCAt IHN0YXJ0X3g7CisgICAgICAgICAgaW50IHN0YXJ0X2hwb3MgPSBmaXJzdCAtIHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV07CisgICAgICAgICAgaW50IGVuZF9ocG9zID0gbGFzdCAtIHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV07CisgICAgICAgICAgYm9vbCBjbGVhcl9lb2xfcCA9IGZhbHNlOworICAgICAg ICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCA9IERSQVdfTk9STUFMX1RFWFQ7CisgICAgICAg ICAgVFJBQ0UgKChzdGRlcnIsICJleHBvc2VfYXJlYSAoJWQpOiAgc3RhcnRfeCAoJWQpIHwgc3Rh cnRfaHBvcyAoJWQpIHwgZW5kX2hwb3MgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgdnBvcywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MpKTsKKyAgICAgICAgICBtY19y ZWRyYXdfcm93ICh3LCBtYXRyaXgsIHJvdywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3Ms IGNsZWFyX2VvbF9wLCBobCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAobGFzdCA+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 Miw2ICsxMzIsODc4IEBAIGFsb25nIHdpdGggR05VI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bGlrZSBhIG5vcm1hbCBjdXJzb3IuICBUaGF0 J3MgdXN1YWxseSBiZXR0ZXIKKyAgICAgdmlzaWJsZSB0aGFuIGRyYXdpbmcgYSBiYXIsIGVzcC4g aWYgdGhlIGltYWdlIGlzIGxhcmdlIHNvIHRoYXQKKyAgICAgdGhlIGJhciBtaWdodCBub3QgYmUg aW4gdGhlIHdpbmRvdy4gICovCisgIGlmIChjdXJzb3JfZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZ UEgpCisgICAgeworICAgICAgZG91YmxlIHJlZCA9IC0xLjA7CisgICAgICBkb3VibGUgZ3JlZW4g PSAtMS4wOworICAgICAgZG91YmxlIGJsdWUgPSAtMS4wOworICAgICAgZW51bSBtY19mbGF2b3Ig Z2x5cGhfZmxhdm9yID0gTk9fRkxBVk9SOworICAgICAgZW51bSB0eXBlX29mX2N1cnNvciBjdXJz b3JfdHlwZSA9IE1DX0hPTExPV19CT1g7CisgICAgICBib29sIGFjdGl2ZV9wID0gZmFsc2U7Cisg ICAgICBib29sIGN1cnNvcl9nY19wID0gZmFsc2U7CisgICAgICBtY19kcmF3X2N1cnNvcl9nbHlw aCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHJlZCwgZ3JlZW4sIGJsdWUsIGdseXBoX2ZsYXZvciwgY3Vyc29y X3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgIH0KKyAgZWxzZQorICAgIHsK KyAgICAgIERpc3BsYXkgKmRweSA9IEZSQU1FX1hfRElTUExBWSAoZik7CisgICAgICBXaW5kb3cg d2luZG93ID0gRlJBTUVfWF9XSU5ET1cgKGYpOworICAgICAgR0MgZ2MgPSBGUkFNRV9ESVNQTEFZ X0lORk8gKGYpLT5zY3JhdGNoX2N1cnNvcl9nYzsKKyAgICAgIHVuc2lnbmVkIGxvbmcgbWFzayA9 IEdDRm9yZWdy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AgIHsKKyAgICAgICAgICBnYyA9IFhDcmVhdGVHQyAoZHB5LCB3aW5k b3csIG1hc2ssICZ4Z2N2KTsKKyAgICAgICAgICBGUkFNRV9ESVNQTEFZX0lORk8gKGYpLT5zY3Jh dGNoX2N1cnNvcl9nYyA9IGdjOworICAgICAgICB9CisgICAgICB4X2NsaXBfdG9fcm93ICh3LCBy b3csIFRFWFRfQVJFQSwgZ2MpOworICAgICAgeF9maWxsX3JlY3RhbmdsZSAoZiwgZ2MsIGZ4LCBm eSwgd2QsIGgpOworICAgICAgeF9yZXNldF9jbGlwX3JlY3RhbmdsZXMgKGYsIGdjKTsKKyAgICB9 Cit9CisKKy8qIFJJRjogRHJhdyBjdXJzb3Igb24gd2luZG93IFcuICovCitzdGF0aWMgdm9pZAor bWNfeF9kcmF3X3dpbmRvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9t YXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICAg aW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50IGhwb3MsIGludCB2cG9zLCBpbnQgd2Qs IGludCBoLAorICAgICAgICAgICAgICAgICAgZG91YmxlIHJlZCwgZG91YmxlIGdyZWVuLCBkb3Vi bGUgYmx1ZSwgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAg ICAgIGludCBjdXJzb3Jfd2lkdGgsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwgYm9vbCBv bl9wLCBib29sIGFjdGl2ZV9wKQoreworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRP V19GUkFNRSAodykpOworICBpZiAob25fcCkKKyAgICB7CisgICAgICBpZiAocm93LT5leGFjdF93 aW5kb3dfd2lkdGhfbGluZV9wCisgICAgICAgICAgJiYgKHJvdy0+cmV2ZXJzZWRfcAorICAgICAg ICAg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OworICAg ICAgaWYgKGN1cnNvcl9nbHlwaCA9PSBOVUxMKQorICAgICAgICByZXR1cm47CisgICAgICBMaXNw X09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKyAgICAgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAg ICAgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChidWYpOworICAgICAgYm9vbCByZWdpb25f YWN0aXZlX3AgPSAoIU5JTFAgKFZ0cmFuc2llbnRfbWFya19tb2RlKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIG1hcmtfYWN0aXZlKSkpOworICAgICAg cHRyZGlmZl90IHJlZ2lvbl9iZWdpbm5pbmcgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IFhGSVhOVU0g KEZyZWdpb25fYmVnaW5uaW5nICgpKSA6IC0xOworICAgICAgcHRyZGlmZl90IHJlZ2lvbl9lbmQg PSAocmVnaW9uX2FjdGl2ZV9wKSA/IFhGSVhOVU0gKEZyZWdpb25fZW5kICgpKSA6IC0xOworICAg ICAgcHRyZGlmZl90IG9wb2ludF9wdCA9ICh3ID09IFhXSU5ET1cgKHNlbGVjdGVkX3dpbmRvdykp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBQVAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogWEZJWE5VTSAoRm1hcmtlcl9wb3NpdGlvbiAody0+cG9pbnRtKSk7CisgICAgICBi b29sIHJlZ2lvbl9pbl9ib3VuZHNfcCA9IChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF9wdCA+PSByZWdpb25fYmVnaW5uaW5nCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfcHQgPCByZWdpb25fZW5kKTsK KyAgICAgIGlmIChjdXJzb3JfZ2x5cGgtPnR5cGUgIT0gSU1BR0VfR0xZUEggJiYgcmV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nBvcywKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgcmVkLCBncmVlbiwgYmx1ZSwgZ2x5cGhfZmxhdm9yLCBj dXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgWFNldEZv cmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9n YywgeGdjdi5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9E SVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmJhY2tncm91bmQp OworICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkg aGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBm LT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICBt 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 ICYmICFyZWdpb25faW5fYm91bmRzX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhY3Rp dmVfcCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNl X2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX291dF9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2Ug KHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1yZWdpb24tZmFjZSIpLCB0cnVlKTsK KyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX291 dF9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfZmFjZV9p ZCk7CisgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2Vf aWQgP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JfZ2MsIGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kKTsKKyAgICAgICAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGJsb2NrX2lucHV0ICgpOworICAgICAgICAg ICAgICAvKiBGb3JjZSBgbWNfeF9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9k YXRhLngtPmN1cnNvcl9nYycuICAqLworICAgICAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0g dHJ1ZTsKKyAgICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93 LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHJlZCwgZ3JlZW4sIGJsdWUsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdk LCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAo RlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmZv cmVncm91bmQpOworICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZ IChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmJhY2tncm91bmQpOworICAg ICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAgICAvKiBEcmF3IHRoZSBm cmFtZSBhcm91bmQgdGhlIGJveC4gKi8KKyAgICAgICAgICAgICAgbWNfeF9kcmF3X2hvbGxvd19j dXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsK KyAgICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0hPTExPV19C T1g6CisgICAgeworICAgICAgaWYgKHJlZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBncmVlbiA+PSAw KQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRf ZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5j dXJzb3JfcGl4ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1 cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOwor ICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNv cl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgbWNfeF9kcmF3X2hv bGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdk LCBoKTsKKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAg eworICAgICAgaWYgKHJlZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBncmVlbiA+PSAwKQorICAgICAg ICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycgYnkg Ym9ycm93aW5nIHRoZQorICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHhm bnMuYy4gICovCisgICAgICAgIHsKKyAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAg ICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+ Y3Vyc29yX2djLCBGUkFNRV9CQUNLR1JPVU5EX1BJWEVMICh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hfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLCBjdXJzb3Jf Z2NfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfQkFS OgorICAgIHsKKyAgICAgIGlmIChyZWQgPj0gMCAmJiBibHVlID49IDAgJiYgZ3JlZW4gPj0gMCkK KyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2Rh dGEueC0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vy c29yX3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNp YmxlX29rYXlfcCA9IHRydWU7CisgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1h dHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLCBjdXJzb3Jfd2lkdGgs IE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91dHB1 dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAg fQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2Nf aW52aXNpYmxlX29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJz b3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLCBjdXJz b3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAg IH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0hCQVI6CisgICAgeworICAgICAg aWYgKHJlZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBncmVlbiA+PSAwKQorICAgICAgICB7CisgICAg ICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4 ZWwnLiAgKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xv ci5waXhlbDsKKyAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1 ZTsKKyAgICAgICAgICBtY194X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4 LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29y X2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNl CisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlf cCA9IGZhbHNlOworICAgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwg cm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLCBjdXJzb3Jfd2lkdGgsIE1DX0hC QVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVh azsKKyAgICB9CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICB9CisgICAg ICAgIH0KKyNpZmRlZiBIQVZFX1hfSTE4TgorICBpZiAodyA9PSBYV0lORE9XIChmLT5zZWxlY3Rl ZF93aW5kb3cpKQorICAgIGlmIChGUkFNRV9YSUMgKGYpICYmIChGU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gICAgc3RyZXRjaCBnbHlwaC4gICovCisgICAgaW50IHJpZ2h0X3ggPSB3 aW5kb3dfYm94X3JpZ2h0IChzLT53LCBURVhUX0FSRUEpOworICAgIGlmICh4ICsgYmFja2dyb3Vu ZF93aWR0aCA+IHJpZ2h0X3gpCisgICAgICBiYWNrZ3JvdW5kX3dpZHRoIC09IHggLSByaWdodF94 OworICAgIHggKz0gYmFja2dyb3VuZF93aWR0aDsKKyAgfQorICAgICAgd2lkdGggPSBtaW4gKEZS QU1FX0NPTFVNTl9XSURUSCAocy0+ZiksIGJhY2tncm91bmRfd2lkdGgpOworICAgICAgaWYgKHMt PnJvdy0+cmV2ZXJzZWRfcCkKKyAgeCAtPSB3aWR0aDsKKyAgICAgIC8qIERyYXcgY3Vyc29yLiAg Ki8KKyAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwgcy0+eSwgd2lkdGgs IHMtPmhlaWdodCk7CisgICAgICAvKiBDbGVhciByZXN0IHVzaW5nIHRoZSBHQyBvZiB0aGUgb3Jp Z2luYWwgbm9uLWN1cnNvciBmYWNlLiAgKi8KKyAgICAgIGlmICh3aWR0aCA8IGJhY2tncm91bmRf d2lkdGgpCisgIHsKKyAgICBpbnQgeSA9IHMtPnk7CisgICAgaW50IHcgPSBiYWNrZ3JvdW5kX3dp ZHRoIC0gd2lkdGgsIGggPSBzLT5oZWlnaHQ7CisgICAgWFJlY3RhbmdsZSByOworICAgIEdDIGdj OworICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQorICAgICAgeCArPSB3aWR0aDsKKyAgICBl bHNlCisgICAgICB4ID0gcy0+eDsKKyAgICBpZiAocy0+cm93LT5tb3VzZV9mYWNlX3AKKyAgICAg ICAgJiYgY3Vyc29yX2luX21vdXNlX2ZhY2VfcCAocy0+dykpCisgICAgICB7CisgICAgICAgIHhf c2V0X21vdXNlX2ZhY2VfZ2MgKHMpOworICAgICAgICBnYyA9IHMtPmdjOworICAgICAgfQor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wKQorewor ICBib29sIHJlbGllZl9kcmF3bl9wID0gZmFsc2U7CisgIC8qIElmIFMgZHJhd3MgaW50byB0aGUg YmFja2dyb3VuZCBvZiBpdHMgc3VjY2Vzc29ycywgZHJhdyB0aGUKKyAgICAgYmFja2dyb3VuZCBv ZiB0aGUgc3VjY2Vzc29ycyBmaXJzdCBzbyB0aGF0IFMgY2FuIGRyYXcgaW50byBpdC4KKyAgICAg VGhpcyBtYWtlcyBTLT5uZXh0IHVzZSBYRHJhd1N0cmluZyBpbnN0ZWFkIG9mIFhEcmF3SW1hZ2VT dHJpbmcuICAqLworICBpZiAocy0+bmV4dCAmJiBzLT5yaWdodF9vdmVyaGFuZyAmJiAhcy0+Zm9y X292ZXJsYXBzKQorICAgIHsKKyAgICAgIGludCB3aWR0aDsKKyAgICAgIHN0cnVjdCBnbHlwaF9z dHJpbmcgKm5leHQ7CisgICAgICBmb3IgKHdpZHRoID0gMCwgbmV4dCA9IHMtPm5leHQ7CisgICAg ICAgICAgIG5leHQgJiYgd2lkdGggPCBzLT5yaWdodF9vdmVyaGFuZzsKKyAgICAgICAgICAgd2lk dGggKz0gbmV4dC0+d2lkdGgsIG5leHQgPSBuZXh0LT5uZXh0KQorICAgICAgICBpZiAobmV4dC0+ Zmlyc3RfZ2x5cGgtPnR5cGUgIT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAgeworICAgICAgICAg ICAgbWNfeF9zZXRfZ2x5cGhfc3RyaW5nX2djIChuZXh0LCBjdXJzb3JfZ2NfcCk7CisgICAgICAg ICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmcgKG5leHQpOworICAgICAgICAgICAgaWYg KG5leHQtPmZpcnN0X2dseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZUEgpCisgICAgICAgICAgICAg IG1jX3hfZHJhd19zdHJldGNoX2dseXBoX3N0cmluZyAobmV4dCk7CisgICAgICAgICAgICBlbHNl CisgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9zdH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nJlYWs7CisgICAgY2FzZSBDT01QT1NJVEVfR0xZUEg6CisgICAg ICBpZiAocy0+Zm9yX292ZXJsYXBzIHx8IChzLT5jbXBfZnJvbSA+IDAKKyAgICAgICAgICAgICYm ICEgcy0+Zmlyc3RfZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykpCisgIHMtPmJhY2tncm91bmRfZmls bGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91 bmQgKHMsIHRydWUpOworICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdy b3VuZCAocyk7CisgICAgICBicmVhazsKKyAgICBjYXNlIEdMWVBITEVTU19HTFlQSDoKKyAgICAg IGlmIChzLT5mb3Jfb3ZlcmxhcHMpCisgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOwor ICAgICAgZWxzZQorICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIHRydWUpOwor ICAgICAgeF9kcmF3X2dseXBobGVzc19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAg 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 ZS4gICovCisgICAgICBpZiAocy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AgICAgICBYR0NW YWx1ZXMgeGdjdjsKKyAgICAgICAgWEdldEdDVmFsdWVzIChzLT5kaXNwbGF5LCBzLT5nYywgR0NG b3JlZ3JvdW5kLCAmeGdjdik7CisgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBz LT5nYywgcy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3IpOworICAgICAgICB4X2ZpbGxfcmVj dGFuZ2xlIChzLT5mLCBzLT5nYywgcy0+eCwgcy0+eSArIGR5LAorICAgICAgICAgICAgcy0+d2lk dGgsIGgpOworICAgICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHhnY3Yu Zm9yZWdyb3VuZCk7CisgICAgICB9CisgIH0KKyAgICAgIC8qIERyYXcgcmVsaWVmIGlmIG5vdCB5 ZXQgZHJhd24uICAqLworICAgICAgaWYgKCFyZWxpZWZfZHJhd25fcCAmJiBzLT5mYWNlLT5ib3gg IT0gRkFDRV9OT19CT1gpCisgIHhfZHJhd19nbHlwaF9zdHJpbmdfYm94IChzKTsKKyAgICAgIGlm IChzLT5wcmV2KQorICB7CisgICAgc3RydWN0IGdseXBoX3N0cmluZyAqcHJldjsKKyAgICBmb3Ig KHByZXYgPSBzLT5wcmV2OyBwcmV2OyBwcmV2ID0gcHJldi0+cHJldikKKyAgICAgIGlmIChwcmV2 LT5obCAhPSBzLT5obAorICAgICYmIHByZXYtPnggKyBwcmV2LT53aWR0aCArIHByZXYtPnJpZ2h0 X292ZXJoYW5nID4gcy0+eCkKKyAgICAgICAgeworICAgIC8qIEFzIHByZXYgd2FzIGRyYXduIHdo aWxlIGNsaXBwZWQgdG8gaXRzIG93biBhcmVhLCB3ZQorICAgICAgIG11c3QgZHJhdyB0aGUgcmln aHRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICAqLworICAgIGVudW0gZHJhd19nbHlw aHNfZmFjZSBzYXZlID0gcHJldi0+aGw7Cis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ZXh0LCBjdXJzb3JfZ2NfcCk7CisgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nX2V4YWN0 bHkgKHMsIG5leHQpOworICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dM WVBIKQorICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChuZXh0KTsKKyAgICBl bHNlCisgICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChuZXh0 KTsKKyAgICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAobmV4dC0+ZiwgbmV4dC0+Z2MpOworICAg IG5leHQtPmhsID0gc2F2ZTsKKyAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgIG5leHQtPmNs aXBfaGVhZCA9IHMtPm5leHQ7CisgICAgICAgIH0KKyAgfQorICAgIH0KKyAgLyogUmVzZXQgY2xp cHBpbmcuICAqLworICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAocy0+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--