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#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). Date: Tue, 28 May 2019 01:31:55 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Tue_May_28_01:31:54_2019-1" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="79660"; mail-complaints-to="usenet@blaine.gmane.org" Cc: johnw@gnu.org, mbork@mbork.pl, rms@gnu.org, akioburns@icloud.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 Tue May 28 10:33:28 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 1hVXXy-000GfD-3v for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 May 2019 10:33:27 +0200 Original-Received: from localhost ([127.0.0.1]:59127 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVXXx-0003ig-1u for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 May 2019 04:33:25 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55950) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVXXd-0003iT-Q8 for bug-gnu-emacs@gnu.org; Tue, 28 May 2019 04:33:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVXXb-0005uj-O5 for bug-gnu-emacs@gnu.org; Tue, 28 May 2019 04:33:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41472) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVXXb-0005uI-Go for bug-gnu-emacs@gnu.org; Tue, 28 May 2019 04:33:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hVXXb-0003R0-C5 for bug-gnu-emacs@gnu.org; Tue, 28 May 2019 04:33:03 -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: Tue, 28 May 2019 08:33:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs Original-Received: via spool by 22873-submit@debbugs.gnu.org id=B22873.155903233213128 (code B ref 22873); Tue, 28 May 2019 08:33:03 +0000 Original-Received: (at 22873) by debbugs.gnu.org; 28 May 2019 08:32:12 +0000 Original-Received: from localhost ([127.0.0.1]:55016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVXWm-0003Pg-8Z for submit@debbugs.gnu.org; Tue, 28 May 2019 04:32:12 -0400 Original-Received: from gateway21.websitewelcome.com ([192.185.46.109]:41706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVXWa-0003On-LA for 22873@debbugs.gnu.org; Tue, 28 May 2019 04:32:01 -0400 Original-Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway21.websitewelcome.com (Postfix) with ESMTP id 47BF4400CCC83 for <22873@debbugs.gnu.org>; Tue, 28 May 2019 03:32:00 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id VXWZhiIB22qH7VXWZhwJGM; Tue, 28 May 2019 03:32:00 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=YZRqbwAdAzJhhL5gkjC6V91iQO8LSYavPEkyTLEojog=; b=SfXSaNXD6PEY7pAk9sR4Aqlb7U MjnmlNb/wUR/bJd32J7zBa8T7v37WOEI3DxvfPVpQGSs961Ln0amRpzdWqLimC0lQylwrvdw2Ayh/ 7hO1HIS9u0wFlsUF/uXRmz48c/4hh0BE+AdtpeccSJ6PSS31Bq/IhERp6nCN+UctgLZiMItjVwV/y L6ApZPPUjHoPa/tixOD+M4tIBo9qMiGF+6kfjQMGRbvpcGobPf9Y2QAU+QQ6i2LvjSnEdWiLK4YJp 0unMiTpVZF8CJt8c0mHEjOhPxbjUuIIQCBIQkZCiKABBCWmraEM4TA3+0bVZB6DuxTdlas9cUbLiq L7/vG2LQ==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:57484 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from ) id 1hVXWV-000zOR-N6; Tue, 28 May 2019 03:31:58 -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: 1hVXWV-000zOR-N6 X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:57484 X-Source-Auth: lawlist X-Email-Count: 7 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit@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:159844 Archived-At: --Multipart_Tue_May_28_01:31:54_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 020.000 [05/27/2019] CHANGELOG: - Consolidated all caches of fake cursors into one master window struct/matrix, which is uncoincidentally somewhat similar in design to the glyph_matrix. - Removing and drawing fake cursors is now mostly limited to the ones that have changed since the previous redisplay. A dry-run of what the prospective `w->current_matrix` will be at tail end of `update_window' is performed at the outset thereof -- without actually writing any glyphs to the glass. During the dry-run, a new cache of fake cursors is created and it is compared to the old cache of fake cursors. Anything that is different gets erased and just the new ones get drawn. As to scrolling the text on the glass directly _before_ `update_window' is called -- `try_window_reusing_current_matrix' and `try_window_id' -- fake cursors are erased from min (r.current_y, r.desired_y) to the top of the mode-line, and any fake cursors above the min (supra) remain. - The multiple fake cursors feature now includes a current column check for each visible cursor and odd/even column colors are assigned if the user has not specified a color preference in the `mc_conf' for the particular cursor being drawn. - Miscellaneous bug fixes. SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 04/08/2019: git reset --hard a038df77de7b1aa2d73a6478493b8838b59e4982 Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed")))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out the crosshairs feature, type: M-x +-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, install that package first. [If the multiple-cursors package is installed, an eval-after-load "multiple-cursors-core" statement within `crosshairs.el` will redefine a couple of functions and set up a few keyboard shortcuts.] If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors)) TODO: - Free memory of w->mc_matrix whenever its associated window ceases to exist. - Consider adding support for different colors when fake cursors are _at_ ZV versus _beyond_ ZV, including, but not limited to the right fringe bitmaps for a cursor at fringe and a cursor beyond the fringe. - `mc_ns_clip_to_rect' is not working as expected. `ns_draw_window_cursor' calls `ns_clip_to_rect', which does _not_ take `row->clip` into consideration when drawing cursors with `NSRectFill'. When it comes time to draw glyphs on top of the box/hollow family of cursors, `row->clip` is taken into consideration by `get_glyph_string_clip'. Fake cursors can be drawn even though the glyphs cannot, resulting in hollow/box family of cursors without text. The issue can be reproduced by calling M-x mc-test and then moving the cursor left/right -- a thick hbar-looking rectangle forms underneath the characters in the boxes. [Reproduction of the issue assumes `mc_ns_intersect_rectangles' is enabled.] https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00009.html - `mc_ns_draw_overwritten' is not working as expected. It appears that fake cursors are drawn outside of the area clipped, sometimes resulting in cursor fragments that are drawn in a different window; e.g., a top/bottom window split with the top window having crosshairs active. Initial attempts at calling `mc_ns_clip_to_rect' from within `mc_ns_draw_overwritten' produced flickering of lines (presumably in the relevant vicinity). - Add additional support for `ch_inactive_windows' and `fc_inactive_windows' when the variables have a `nil` value. In such a case, the inactive windows should not display the crosshairs and/or visible fill column indicator. - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - Is there any additional meaningful optimization that can be added to the three calls of `mc_pre_scroll_clean'? - NOTE: As to `mc_scrolling_window', it would appear that there is no tangible benefit to rotating the current/prospective cache of fake cursors to compare the data before removing the fake cursors. When scrolling the display, only _some_ lines are copied to new locations. Areas that are not overwritten may have fake cursors and those may not necessarily be removed if desired/current matrix glyphs are equal. The test for `GLYPH_EQUAL_P' does not take into consideration the existence of a fake cursor, and the glyph (with a fake cursor) may not be updated as a result thereof. As to lines that are not copied, portions may be updated and fake cursors would be removed thereby. - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create an minimal working example and file a bug report. - There is a bug affecting an older version of Emacs for the NS port that causes partial line flickering when the same characters are grouped together (;;;;;;) and MC_GLYPHLESS cursors are above or below -- having the same background color as the frame; e.g., black on black (used to erase a glyphless cursor). The partial flickering is only noticeable with rapid fire; e.g., holding down the right/left arrow key. When changing the color of the glyphless cursor, the issue is not present. [@lawlist has verified that the X and HPOS coordinates are accurate.] - There is a bug affecting the recorded `w->mc.lnum_pixel_width` that is observable when not running under gdb, but disappears when running under gdb. While viewing a folded org-mode buffer, the non-gdb instance had a visible line number pixel-width of 44, but Emacs treated it as fluctuating between 44 and 55 as the cursor was moved to the end of line. In the gdb instance, the visible line number pixel width was 55 with no fluctuation under the same conditions as the non-gdb instance. This appears to be a different bug than bug#32177 (current line number shifts one column to the left) because the line number of the current line does not shift left, and changing the bidi settings did not correct the issue. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. --Multipart_Tue_May_28_01:31:54_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_05_27__21_42_30_553.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zYmJkNjk3Ci0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI4MiBAQAorOzs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Cis7OzsgQkVHSU4gbW9kaWZpY2F0aW9uIG9mIHRoZSBNdWx0aXBsZSBDdXJzb3Jz IGxpYnJhcnkgd3JpdHRlbiBieSAgTWFnbmFyIFN2ZWVuLgorCisoZGVmdmFyIHBhY2thZ2UtYXJj aGl2ZXMpCisKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsKQorKGRlZnZhciBtYy9t YXgtY3Vyc29ycykKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsKQorKGRlZnZhciBt Yy9tYXgtY3Vyc29ycykKKyhkZWZ2YXIgbWMvYWx3YXlzLXJ1bi1mb3ItYWxsKQorKGRlZnZhciBt Yy0tdGhpcy1jb21tYW5kKQorKGRlZnZhciBtYy9jbWRzLXRvLXJ1bi1vbmNlKQorKGRlZnZhciBt Yy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1mb3ItYWxsKQorKGRlZnZhciBtYy9jbWRzLXRvLXJ1bi1m b3ItYWxsKQorKGRlZnZhciBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ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pKQorICAgICAgICAgIChtYy9yZW1vdmUtZmFrZS1jdXJzb3JzKQorICAgICAgICAgIChl cnJvciAiQWJvcnRlZDogdG9vIG1hbnkgY3Vyc29ycyIpKSkpCisgICAgKGxldCAoKG92ZXJsYXkK KyAgICAgICAgICAgIChpZiBtYy91c2UtYnVpbHQtaW4tY3Vyc29ycworICAgICAgICAgICAgICAo bWFrZS1vdmVybGF5IChwb2ludCkgKHBvaW50KSkKKyAgICAgICAgICAgICAgKG1jL21ha2UtY3Vy c29yLW92ZXJsYXktYXQtcG9pbnQpKSkpCisgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAnbWMt aWQgKG9yIGlkIChtYy9jcmVhdGUtY3Vyc29yLWlkKSkpCisgICAgICAob3ZlcmxheS1wdXQgb3Zl cmxheSAndHlwZSAnZmFrZS1jdXJzb3IpCisgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAncHJp b3JpdHkgMTAwKQorICAgICAgKG1jL3N0b3JlLWN1cnJlbnQtc3RhdGUtaW4tb3ZlcmxheSBvdmVy bGF5KQorICAgICAgKHdoZW4gKHVzZS1yZWdpb24tcCkKKyAgICAgICAgKG92ZXJsYXktcHV0IG92 ZXJsYXkgJ3JlZ2lvbi1vdmVybGF5CisgICAgICAgICAgICAgICAgICAgICAobWMvbWFrZS1yZWdp b24tb3ZlcmxheS1iZXR3ZWVuLXBvaW50LWFuZC1tYXJrKSkpCisgICAgICBvdmVybGF5KSkKKwor ICAoZGVmdW4gbWMvZXhlY3V0ZS1jb21tYW5kLWZvci1hbGwtZmFrZS1jdXJzb3JzIChjbWQpCisg ICAgIkNhbGxzIENNRCBpbnRlcmFjdGl2ZWx5IGZvciBlYWNoIGN1cnNvci4KKyAgSXQgd29ya3Mg YnkgbW92aW5nIHBvaW50IHRvIHRoZSBmYWtlIGN1cnNvciwgc2V0dGluZworICB1cCB0aGUgcHJv cGVyIGVudmlyb25tZW50LCBhbmQgdGhlbiByZW1vdmluZyB0aGUgY3Vyc29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SAgU29tZSBjb21tYW5kcyBhcmUgc28gdW5zdXBwb3J0ZWQgdGhhdCB0aGV5IGFy ZSBldmVuIHByZXZlbnRlZCBmb3IKKyAgdGhlIG9yaWdpbmFsIGN1cnNvciwgdG8gaW5mb3JtIGFi b3V0IHRoZSBsYWNrIG9mIHN1cHBvcnQuIgorICAgICh1bmxlc3MgbWMtLWV4ZWN1dGluZy1jb21t YW5kLWZvci1mYWtlLWN1cnNvcgorICAgICAgKGlmIChlcSAxIChtYy9udW0tY3Vyc29ycykpIDs7 IG5vIGZha2UgY3Vyc29ycz8gZGlzYWJsZSBtYy1tb2RlCisgICAgICAgICAgKG11bHRpcGxlLWN1 cnNvcnMtbW9kZSAwKQorICAgICAgICAod2hlbiB0aGlzLW9yaWdpbmFsLWNvbW1hbmQKKyAgICAg ICAgICAobGV0ICgob3JpZ2luYWwtY29tbWFuZCAob3IgbWMtLXRoaXMtY29tbWFuZAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29tbWFuZC1yZW1hcHBpbmcgdGhpcy1v cmlnaW5hbC1jb21tYW5kKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0 aGlzLW9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgIDs7IHNraXAga2V5Ym9hcmQgbWFj cm9zLCBzaW5jZSB0aGV5IHdpbGwgZ2VuZXJhdGUgYWN0dWFsIGNvbW1hbmRzIHRoYXQgYXJlCisg ICAgICAgICAgICA7OyBhbHNvIHJ1biBpbiB0aGUgY29tbWFuZCBsb29wIC0gd2UnbGwgaGFuZGxl IHRob3NlIGxhdGVyIGluc3RlYWQuCisgICAgICAgICAgICAod2hlbiAoZnVuY3Rpb25wIG9yaWdp bmFsLWNvbW1hbmQpCisgICAgICAgICAgICAgIDs7IGlmIGl0J3MgYSBsYW1iZGEsIHdlIGNhbid0 IGtub3cgaWYgaXQncyBzdXBwb3J0ZWQgb3Igbm90CisgICAgICAgICAgICAgID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jdXJzb3JzJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4g KGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3Qg KG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1j L2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMv YWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2Nt ZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMv cHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29y cyBvcmlnaW5hbC1jb21tYW5kKSkpKQorICAgICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQt aW4tY3Vyc29ycworICAgICAgICAgICAgICAgIChzZXRxIG1jLWNvbmYKKyAgICAgICAgICAgICAg ICAgICAgICAgIChtYXBjYXIKKyAgICAgICAgICAgICAgICAg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CisgIChsZXQgKChidWZmZXIg KGdldC1idWZmZXItY3JlYXRlICIqTUMtVEVTVCoiKSkpCisgICAgKHdpdGgtY3VycmVudC1idWZm ZXIgYnVmZmVyCisgICAgICAoZXJhc2UtYnVmZmVyKQorICAgICAgKGluc2VydCAiVGhpcyBpcyBh IHRlc3QhIikKKyAgICAgIChzZXRxIG1jLWNvbmYgJygoMSAiaGJhciIgIm1hZ2VudGEiKQorICAg ICAgICAgICAgICAgICAgICAgICgyICJiYXIiICJwdXJwbGUiKQorICAgICAgICAgICAgICAgICAg ICAgICgzICJib3giICIjMDBGRjAwIikKKyAgICAgICAgICAgICAgICAgICAgICAoNCAiaG9sbG93 IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAgICAgKDUgKCJoYmFyIiAzKSBbMS4wIDAu MCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAzKSBbMC4wIDEuMCAxLjBd KQorICAgICAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFuZ2VSZWQiKQorICAgICAg ICAgICAgICAgICAgICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAgICAgICAgICAgICAgICAg ICg5ICJib3giICJncmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93IChkaXNwbGF5LWJ1ZmZl ciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2luY2UgdGhpcyBmaXJlcyBn bG9iYWxseSwgd2UgbXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jvc3NoYWlycyBhcHBlYXIg aW4uIgorICAod2hlbiArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVtcSBsYXN0LWNvbW1hbmQg Ky1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVsbCArLXBhcmVucy1wKSkK KyAgICAgICgrLXBhcmVucy1mbikpCisgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgIChzZXRx IHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1pZGxlLWxpc3QpKQorICAg ICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkpKQorCisoZGVmdW4gKy1kcmF3LWZvcnRod2l0aCAo KQorIkltbWVkaWF0ZWx5IGRlbGV0ZS9kcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzLiIKKyAgKCst ZHJhdy1jcm9zc2hhaXJzICdmb3JjZSkpCisKKyhkZWZ1biArLWRyYXctY3Jvc3NoYWlycyAoJm9w dGlvbmFsIGZvcmNlKQorIkltbWVkaWF0ZWx5IGRlbGV0ZSBtYXRjaGluZyBwYXJlbnRoZXNlcy4g IElmIEZPUkNFIGlzIG5vbi1uaWwsIHRoZW4gaW1tZWRpYXRlbHkKK2RyYXcgbWF0Y2hpbmcgcGFy ZW50aGVzaXM7IG90aGVyd2lzZSwgZHJhdyB0aGVtIG9uIGFuIGlkbGUtdGllci4iCisgICh3aGVu ICstbW9kZQorICAgICh3aGVuICstdGltZXItdmFyCisgICAgICAoc2V0cSB0aW1lci1pZGxlLWxp c3QgKGRlbHEgKy10aW1lci12YXIgdGltZXItaWRsZS1saXN0KSkKKyAgICAgIChzZXRxICstdGlt ZXItdmFyIG5pbCkpCisgICAgKHVubGVzcyAob3IgKG1lbXEgdGhpcy1jb21tYW5kICstcGFyZW5z LWV4Y2x1c2lvbnMpCisgICAgICAgICAgICAgICAgKGFuZCAobnVsbCArLXBhcmVucy1wKQorICAg ICAgICAgICAgICAgICAgICAgKG51bGwgKy1wYXJlbnMtb3ZlcmxheXMtZXhpc3QtcCkpKQorICAg ICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZvcmNlCisgICAgICAocHJv Z24KKyAgICAgICAgKHdoZW4gKy1wYXJlbnMtcAorICAgICAgICAgICgrLXBhcmVucy1mbikpKQor ICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGltZXIgKy1pZGxlLXRpbWVy LXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKyhkZWZ2YXIgZmMtbW9kZSkKKworOzs7 IyMjYXV0b2xvYWQKKyhkZWZpbmUtbWlub3ItbW9kZSArLW1vZGUKKyJNaW5vciBtb2RlIGZvciBk aXNwbGF5aW5nIGEgaG9yaXpvbnRhbCBydWxlci4iCisgIDppbml0LXZhbHVlIG5pbAorICA6bGln aHRlciAiICsiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisgIDpncm91cCAnKy1tb2Rl CisgIChjb25kCisgICAgKCstbW9kZQorICAgICAgOzs7IGArLW1vZGUnIGhhcyB0aGUgYWJpbGl0 eSB0byBhbHNvIGRpc3BsYXkgYSBmaWxsIGNvbHVtbiBpbmRpY2F0b3IuCisgICAgICA7OzsgU2Vl IHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuCisgICAgICAod2hlbiBmYy1tb2RlCisgICAg ICAgIChmYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFsLWVsZG9jLW1vZGUKKyAg ICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgICAg ICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAgKGdsb2JhbC1l bGRvYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2stY29udGV4dC10aW1lcgor ICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAo dGltZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciBq aXQtbG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEgaml0LWxvY2stY29udGV4 dC10aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAnaml0LWxvY2stY29udGV4 dC1mb250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4dC10aW1lciBuaWwpKQor ICAgICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAo dGltZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQorICAgICAgICAgIChjYW5j ZWwtdGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpKQorICAgICAgICAoZnNl dCAndW5kby1hdXRvLS11bmRvYWJsZS1jaGFuZ2UKKyAgICAgICAgICAgICAgKGxhbWJkYSAoKSAo YWRkLXRvLWxpc3QgJ3VuZG8tYXV0by0tdW5kb2FibHktY2hhbmdlZC1idWZmZXJzIChjdXJyZW50 LWJ1ZmZlcikpKSkKKyAgICAgICAgKGZzZXQgJ3VuZG8tYXV0by1hbWFsZ2FtYXRlICdpZ25vcmUp KQorICAgICAgKHdoZW4gYmxpbmstY3Vyc29yLW1vZGUKKyAgICAgICAgKGJsaW5rLWN1cnNvci1t b2RlIC0xKQorICAgICAgICAod2hlbiAobWVtcSAnYmxpbmstY3Vyc29yLWNoZWNrIHBvc3QtY29t bWFuZC1ob29rKQorICAgICAgICAgIChyZW1vdmUtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJ2Js aW5rLWN1cnNvci1jaGVjaykpKQorICAgICAgKHNldHEgY3Jvc3NoYWlycyB0KQorICAgICAgKHdo ZW4gKy1maWxsLWNvbHVtbgorICAgICAgICAoc2V0cSBmYy12aXNpYmxlIHQpKQorICAgICAgOzs7 IGBhdXRvLWNvbXBvc2l0aW9uLW1vZGUnIGlzIG5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AgIHRhYi13 aWR0aAorICAgICAgICAgICAgICAgICAgICAgbGluZS1tb3ZlLXZpc3VhbAorICAgICAgICAgICAg ICAgICAgICAgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgICAgICAgICAgICAgIHRydW5jYXRlLXBh cnRpYWwtd2lkdGgtd2luZG93cworICAgICAgICAgICAgICAgICAgICAgd29yZC13cmFwKSkKKyAg ICAgICAgKHdoZW4gKGxvY2FsLXZhcmlhYmxlLXAgdmFyKQorICAgICAgICAgIChwdXNoIChjb25z IHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICstLXNhdmVkLXN0YXRlKSkpCisgICAgICAoc2V0cSBm aWxsLWNvbHVtbiA4MCkKKyAgICAgIChzZXRxIGRpc3BsYXktbGluZS1udW1iZXJzIHQpCisgICAg ICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1saW5lKQorICAgICAgKHNl dHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAoc2V0cSBidWZmZXItZGlzcGxheS10YWJs ZSArLWJ1ZmZlci1kaXNwbGF5LXRhYmxlKQorICAgICAgKHNldHEgdGFiLXdpZHRoIDQpCisgICAg ICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlzdWFsKSB0KQorICAgICAg KHNldHEgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKGxldCAoKGxz dCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisgICAgICAgICAgICAgICAgICBtb2Rl KQorICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAgICAod2hpbGUgKHNldHEg bW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAgICAgKHdoZW4gKGRlcml2ZWQtbW9kZS1wIG1v ZGUpCisgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkpKSkKKyAgICAgICAgICAg KChtZW1xIG1ham9yLW1vZGUgKy10cnVuY2F0ZS1saW5lcy1tYWpvci1tb2RlcykpCisgICAgICAg ICAgICh0CisgICAgICAgICAgICAgbmlsKSkpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlh YmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRvd3MpIG5pbCkKKyAgICAgIChzZXRxIHdv cmQtd3JhcCB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGluZXMgdCkKKyAgICAgIChz ZXRxIGluZGljYXRlLWJ1ZmZlci1ib3VuZGFyaWVzICdsZWZ0KQorICAgICAgKHNldHEgZnJpbmdl LWluZGljYXRvci1hbGlzdAorICAgICAgICAgIDs7OyBoc2NsX2FsbF90ZW1wX3AgfCBoc2NsX3Rl bXBfcAorICAgICAgICAnKCgrLWhzY2wtdGVtcCAuICgrLXNpbmdsZS1hbmdsZS1sZWZ0CisgICAg ICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLWxlZnQpKQorICAgICAgICAgIDs7 OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxsX3Blcm1fMV9wIHwgaHNjbF9hbGxfcGVybV8y X3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICgrLWhzY2wtcGVybSAuICgrLXNpbmdsZS1hbmds ZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1hbmdsZS11cAorICAgICAg ICAgICAgICAgICAgICAgICAgICArLXRyaXBsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAg ICAgICAgICArLXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAgKCstb3ZlcmxheS1hcnJv dyAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAr LWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAgKHRydW5jYXRpb24gLiAoKy1mcmluZ2Ut bGVmdC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJpZ2h0LWFycm93 KSkKKyAgICAgICAgICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxlZnQtY3VybHktYXJyb3cK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNoKSkKKyAgICAgICAgICAob3Zl cmxheS1hcnJvdyAuICstZnJpbmdlLXJpZ2h0LXRyaWFuZ2xlKQorICAgICAgICAgICh1cCAuICst ZnJpbmdlLXVwLWFycm93KQorICAgICAgICAgIChkb3duIC4gKy1mcmluZ2UtZG93bi1hcnJvdykK KyAgICAgICAgICAodG9wIC4gKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUpCisgICAgICAgICAgKGJv dHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAgICAgICAodG9wLWJvdHRv bSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICArLWZy aW5nZS1yaWdodC1icmFja2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtdG9w LXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtdG9wLWxlZnQt YW5nbGUpKQorICAgICAgICAgIChlbXB0eS1saW5lIC4gKy1mcmluZ2UtZW1wdHktbGluZSkKKyAg ICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmspKSkKKyAgICAgIChzZXRx IGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94IC4gKy1mcmluZ2UtbGVmdC10cmlhbmdsZSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaG9sbG93IC4gKy1ob2xsb3ctcmVjdGFu Z2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChiYXIgLiArLXZlcnRpY2Fs LWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaGJhciAuICstZnJpbmdl LWhvcml6b250YWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChob2xs b3ctc21hbGwgLiArLWZyaW5nZS1ob2xsb3ctc3F1YXJlKSkpCisgICAgICAoaWYgKG9yICstZm9y dGh3aXRoCisgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisg ICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJhdy1mb3J0aHdpdGggJ2Fw cGVuZCAnbG9jYWwpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJh dy1jcm9zc2hhaXJzICdhcHBlbmQgJ2xvY2FsKSkKKyAgICAgICh3aGVuICstZm9ydGh3aXRoCisg ICAgICAgIChhZGQtaG9vayAnd2luZG93LWNvbmZpZ3VyYXRpb24tY2hhbmdlLWhvb2sgJystZHJh dy1mb3J0aHdpdGggbmlsICdsb2NhbCkpCisgICAgICAoYWRkLWhvb2sgJ2NoYW5nZS1tYWpvci1t b2RlLWhvb2sgJ3R1cm4tb2ZmLSstbW9kZSBuaWwgJ2xvY2FsKQorICAgICAgKHdoZW4gKGNhbGxl ZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKy1mb3J0 aHdpdGgKKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScgLS0gRHJhdyBt YXRjaGluZyBwYXJlbnRoZXNlcyBpbW1lZGlhdGVseS4iKSkKKyAgICAgICAgICAoKGVxdWFsIGN1 cnJlbnQtcHJlZml4LWFyZyAnKDQpKQorICAgICAgICAgICAgOzs7IE1hdGNoaW5nIHBhcmVudGhl c2VzIHdpbGwgYmUgZHJhd24gaW1tZWRpYXRlbHkuCisgICAgICAgICAgICAobWVzc2FnZSAiVHVy bmVkIE9OIGArLW1vZGUnIC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AgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgICAg KHNldHEgdGltZXItaWRsZS1saXN0IChkZWxxICstdGltZXItdmFyIHRpbWVyLWlkbGUtbGlzdCkp CisgICAgICAgIChzZXRxICstdGltZXItdmFyIG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWlu dGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAobWVzc2FnZSAiVHVybmVkIE9GRiBgKy1tb2Rl Jy4iKSkpKSkKKworKGRlZnVuIHR1cm4tb2ZmLSstbW9kZSAoKQorICAoKy1tb2RlIC0xKSkKKwor Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7CisKKyhkZWZ1biArLXBhcmVucy1mbiAoKQorICAiRG9j LXN0cmluZy4iCisgIChsZXQqICgob3BvaW50IChwb2ludCkpCisgICAgICAgICAoZnJvbSAoaWYg Ky1wYXJlbnMtZnJvbS1mbgorICAgICAgICAgICAgICAgICAoZnVuY2FsbCArLXBhcmVucy1mcm9t LWZuKQorICAgICAgICAgICAgICAgICAocG9pbnQtbWluKSkpCisgICAgICAgICAod2luIChzZWxl Y3RlZC13aW5kb3cpKQorICAgICAgICAgKGkgMCkKKyAgICAgICAgIChwcmVjZWRpbmctY2hhciAo cHJlY2VkaW5nLWNoYXIpKQorICAgICAgICAgKG9jaGFyIChjaGFyLWFmdGVyIG9wb2ludCkpCisg ICAgICAgICAocG9zMQorICAgICAgICAgICAoY29uZAorICAgICAgICAgICAgICgoYW5kIG9jaGFy CisgICAgICAgICAgICAgICAgICAgKG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDApID0+IG9wZW5p bmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgNDApCisgICAg ICAgICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgOTEpID0+IG9wZW5pbmcgc3F1 YXJlIGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgOTEpCisgICAgICAg ICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgMTIzKSA9PiBvcGVuaW5nIHdhdnkg YnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAoPSBvY2hhciAxMjMpKSkKKyAgICAgICAg ICAgICAgICAobWluICgxKyBvcG9pbnQpIChwb2ludC1tYXgpKSkKKyAgICAgICAgICAgICAoKG9y IDs7OyAoY2hhci10by1zdHJpbmcgNDEpID0+IGNsb3NpbmcgcGFyZW50aGVzaXMKKyAgICAgICAg ICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDQxKQorICAgICAgICAgICAgICAgICAgOzs7IChj aGFyLXRvLXN0cmluZyA5MykgPT4gY2xvc2luZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAg ICAgICAgKD0gcHJlY2VkaW5nLWNoYXIgOTMpCisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXIt dG8tc3RyaW5nIDEyNSkgPT4gY2xvc2luZyB3YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAg ICg9IHByZWNlZGluZy1jaGFyIDEyNSkpCisgICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWlu KSAoMS0gb3BvaW50KSkpCisgICAgICAgICAgICAgKHQKKyAgICAgICAgICAgICAgICBvcG9pbnQp KSkKKyAgICAgICAgIHBvczIKKyAgICAgICAgIHNlbGVjdGVkLWZhY2UpCisgICAgKHNhdmUtZXhj dXJzaW9uCisgICAgICAoY29uZGl0aW9uLWNhc2UgbmlsCisgICAgICAgICh3aGlsZSAoc2V0cSBw b3MxIChudGggMSAocGFyc2UtcGFydGlhbC1zZXhwIGZyb20gcG9zMSkpKQorICAgICAgICAgIChz ZXRxIHBvczIgKHNjYW4tc2V4cHMgcG9zMSAxKSkKKyAgICAgICAgICAoaWYgKD0gaSAxMCkKKyAg ICAgICAgICAgIChzZXRxIGkgMSkKKyAgICAgICAgICAgIChzZXRxIGkgKDErIGkpKSkKKyAgICAg ICAgICAoc2V0cSBzZWxlY3RlZC1mYWNlIChjb25kCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICgoPSBpIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFy ZW5zLW9uZS1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAyKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10d28tZmFjZSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgMykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtdGhyZWUtZmFjZSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKCg9IGkgNCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAnKy1wYXJlbnMtZm91ci1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo KD0gaSA1KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1maXZl LWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDYpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXNpeC1mYWNlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA3KQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICcrLXBhcmVucy1zZXZlbi1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoKD0gaSA4KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBh cmVucy1laWdodC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA5 KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1uaW5lLWZhY2Up CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEwKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10ZW4tZmFjZSkpKQorICAgICAgICAgIChs ZXQgKChvdiAobWFrZS1vdmVybGF5IHBvczEgKDErIHBvczEpKSkpCisgICAgICAgICAgICAodW5s ZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRvd3MKKyAgICAgICAgICAgICAgKG92ZXJsYXktcHV0 IG92ICd3aW5kb3cgd2luKSkKKyAgICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBzZWxl Y3RlZC1mYWNlKSkKKyAgICAgICAgICAod2hlbiBwb3MyCisgICAgICAgICAgICAobGV0ICgob3Yg KG1ha2Utb3ZlcmxheSAoMS0gcG9zMikgcG9zMikpKQorICAgICAgICAgICAgICAodW5sZXNzICst cGFyZW5zLWluYWN0aXZlLXdpbmRvd3MKKyAgICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3Yg J3dpbmRvdyB3aW4pKQorICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0 ZWQtZmFjZSkpKSkKKyAgICAgICAgKGVycm9yIG5pbCkpKQorICAgIChzZXRxICstcGFyZW5zLW92 ZXJsYXlzLWV4aXN0LXAgdCkpKQorCisoZGVmdW4gKy1yZW1vdmUtb3ZlcmxheXMgKGJlZyBlbmQg bmFtZSB2YWwpCisiUmVtb3ZlIHRoZSBvdmVybGF5cyB0aGF0IGFyZSBgZXF1YWwtaW5jbHVkaW5n LXByb3BlcnRpZXNgLgorSW5jbHVkZXMgYSB1bmlxdWUgc2l0dWF0aW9uIHdoZW4gYW4gb3Zlcmxh eSB3aXRoIGFuIGAnYWZ0ZXItc3RyaW5nYCBwcm9wZXJ0eQoraXMgYXQgdGhlIHZlcnkgZW5kIG9m IGEgbmFycm93ZWQtYnVmZmVyLiIKKyAgKGxldCogKChwb2ludC1tYXggKHBvaW50LW1heCkpCisg ICAgICAgICAocG9pbnQtbWluIChwb2ludC1taW4pKQorICAgICAgICAgKG5hcnJvd2VkLXAgKGJ1 ZmZlci1uYXJyb3dlZC1wKSkKKyAgICAgICAgIChiZWcgKGlmIGJlZyBiZWcgcG9pbnQtbWluKSkK KyAgICAgICAgIChlbmQKKyAgICAgICAgICAgKGNvbmQKKyAgICAgICAgICAgICAoKGFuZAorICAg ICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAgICAgICAgICAgICAgIGVuZCkKKyAg ICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAo bm90IG5hcnJvd2VkLXApCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAg ICAgICBwb2ludC1tYXgpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFy cm93ZWQtcAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKDwgZW5kIHBv aW50LW1heCkpCisgICAgICAgICAgICAgICBlbmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAg ICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAg ICAgICAgKD0gZW5kIHBvaW50LW1heCkpCisgICAgICAgICAgICAgICAoMSsgZW5kKSkKKyAgICAg ICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAg ICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICAoMSsgcG9pbnQtbWF4KSkgKSkKKyAgICAg ICAgIChvdmVybGF5cworICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAgICAob3ZlcmxheS1y ZWNlbnRlciBlbmQpCisgICAgICAgICAgICAgKG92ZXJsYXlzLWluIGJlZyBlbmQpKSkpCisgICAg KHdoZW4gKGFuZCBiZWcgZW5kIG5hbWUgdmFsKQorICAgICAgKGRvbGlzdCAobyBvdmVybGF5cykK KyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKGFuZCAoZXEgbmFtZSAnZmFjZSkKKyAgICAgICAg ICAgICAgICAoZXEgKG92ZXJsYXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIDs7IEVp dGhlciBwdXNoIHRoaXMgb3ZlcmxheSBvdXRzaWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsg b3Igc3BsaXQgaXQgdG8gZXhjbHVkZSBiZWcuLi5lbmQKKyAgICAgICAgICAgIDs7IG9yIGRlbGV0 ZSBpdCBlbnRpcmVseSAoaWYgaXQgaXMgY29udGFpbmVkIGluIGJlZy4uLmVuZCkuCisgICAgICAg ICAgICAoaWYgKDwgKG92ZXJsYXktc3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAgIChpZiAo PiAob3ZlcmxheS1lbmQgbykgZW5kKQorICAgICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAg ICAgICAobW92ZS1vdmVybGF5IChjb3B5LW92ZXJsYXkgbykKKyAgICAgICAgICAgICAgICAgIChv dmVybGF5LXN0YXJ0IG8pIGJlZykKKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5k IChvdmVybGF5LWVuZCBvKSkpCisgICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gKG92 ZXJsYXktc3RhcnQgbykgYmVnKSkKKyAgICAgICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBv KSBlbmQpCisgICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVu ZCBvKSkKKyAgICAgICAgICAgICAgICAoZGVsZXRlLW92ZXJsYXkgbykpKSkKKyAgICAgICAgICAo KGFuZCAobm90IChlcSBuYW1lICdmYWNlKSkKKyAgICAgICAgICAgICAgICA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ZW4gKGFuZCBq aXQtbG9jay1jb250ZXh0LXRpbWVyCisgICAgICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3Rp dmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcg Jyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAg ICAgICAgICAoY2FuY2VsLXRpbWVyIGppdC1sb2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7 OyAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAn cmVwZWF0ICdqaXQtbG9jay1jb250ZXh0LWZvbnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9j ay1jb250ZXh0LXRpbWVyIG5pbCkpCisgICAgICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3Rp dmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcg Jyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnkt dGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFy eS10aW1lcikpCisgICAgICAgIChmc2V0ICd1bmRvLWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAg ICAgICAgICAgICAobGFtYmRhICgpIChhZGQtdG8tbGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1j aGFuZ2VkLWJ1ZmZlcnMgKGN1cnJlbnQtYnVmZmVyKSkpKQorICAgICAgICAoZnNldCAndW5kby1h dXRvLWFtYWxnYW1hdGUgJ2lnbm9yZSkpCisgICAgICAod2hlbiBibGluay1jdXJzb3ItbW9kZQor ICAgICAgICAoYmxpbmstY3Vyc29yLW1vZGUgLTEpCisgICAgICAgICh3aGVuICht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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiBzdGF0aWMg dm9pZAogYnNldF9hYmJyZXZfbW9kZSAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFs KQogewpAQCAtNTE0Miw2ICs1MjA1LDI0IEBAIGluaXRfYnVmZmVyX29uY2UgKHZvaWQpCiAgIGJz ZXRfbGFzdF9zZWxlY3RlZF93aW5kb3cgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG1ha2VfZml4bnVt ICgwKSk7CiAKICAgaWR4ID0gMTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9m bGFncywgbWNfcmVhbF9mYWtlX2N1cnNvciksIGlkeCk7ICsraWR4OworICBYU0VURkFTVElOVCAo QlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbWNfY29uZiksIGlkeCk7ICsraWR4OworICBYU0VU RkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbWNfaW5hY3RpdmVfd2luZG93cyks IGlkeCk7ICsraWR4OworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywg Y3Jvc3NoYWlycyksIGlkeCk7ICsraWR4OworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9s b2NhbF9mbGFncywgY2hfaG9yaXpvbnRhbF9ydWxlciksIGlkeCk7ICsraWR4OworICBYU0VURkFT VElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgY2hfdmVydGljYWxfcnVsZXIpLCBpZHgp OyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIGNoX2lu YWN0aXZlX3dpbmRvd3MpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZm ZXJfbG9jYWxfZmxhZ3MsIGZjX3Zpc2libGUpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQg KEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIGZjX2luYWN0aXZlX3dpbmRvd3MpLCBpZHgpOyAr K2lkeDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBYU0VURkFTVElOVCAoQlZB UiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbW9kZV9saW5lX2Zvcm1hdCksIGlkeCk7ICsraWR4Owog ICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgYWJicmV2X21vZGUpLCBp ZHgpOyArK2lkeDsKICAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG92 ZXJ3cml0ZV9tb2RlKSwgaWR4KTsgKytpZHg7CkBAIC01MjI4LDYgKzUzMDksMjQgQEAgaW5pdF9i dWZmZXJfb25jZSAodm9pZCkKICAgLyogTXVzdCBkbyB0aGVzZSBiZWZvcmUgbWFraW5nIHRoZSBm aXJzdCBidWZmZXIhICovCiAKICAgLyogcmVhbCBzZXR1cCBpcyBkb25lIGluIGJpbmRpbmdzLmVs ICovCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgYnNldF9tY19yZWFsX2Zha2VfY3Vyc29yICgmYnVmZmVyX2RlZmF1bHRzLCBRaG9sbG93 KTsKKyAgYnNldF9tY19jb25mICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKKyAgYnNldF9tY19p bmFjdGl2ZV93aW5kb3dzICgmYnVmZmVyX2RlZmF1bHRzLCBRdCk7CisgIGJzZXRfY3Jvc3NoYWly cyAoJmJ1ZmZlcl9kZWZhdWx0cywgUW5pbCk7CisgIGJzZXRfY2hfaG9yaXpvbnRhbF9ydWxlciAo JmJ1ZmZlcl9kZWZhdWx0cywgUXQpOworICBic2V0X2NoX3ZlcnRpY2FsX3J1bGVyICgmYnVmZmVy X2RlZmF1bHRzLCBRdCk7CisgIGJzZXRfY2hfaW5hY3RpdmVfd2luZG93cyAoJmJ1ZmZlcl9kZWZh dWx0cywgUXQpOworICBic2V0X2ZjX3Zpc2libGUgKCZidWZmZXJfZGVmYXVsdHMsIFFuaWwpOwor ICBic2V0X2ZjX2luYWN0aXZlX3dpbmRvd3MgKCZidWZmZXJfZGVmYXVsdHMsIFF0KTsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICBic2V0X21vZGVfbGluZV9mb3JtYXQgKCZidWZm ZXJfZGVmYXVsdHMsIGJ1aWxkX3B1cmVfY19zdHJpbmcgKCIlLSIpKTsKICAgYnNldF9oZWFkZXJf bGluZV9mb3JtYXQgKCZidWZmZXJfZGVmYXVsdHMsIFFuaWwpOwogICBic2V0X2FiYnJldl9tb2Rl ICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKQEAgLTU0NTgsNiArNTU1Nyw1MSBAQCBkZWZ2YXJf cGVyX2J1ZmZlciAoc3RydWN0IExpc3BfQnVmZmVyX09iamZ3ZCAqYm9fZndkLCBjb25zdCBjaGFy ICpuYW1lc3RyaW5nLAogdm9pZAogc3ltc19vZl9idWZmZXIgKHZvaWQpCiB7CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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AgQEAg c3RydWN0IGJ1ZmZlcgogICAgICBpbiB0aGUgZGlzcGxheSBvZiB0aGlzIGJ1ZmZlci4gICovCiAg IExpc3BfT2JqZWN0IGV4dHJhX2xpbmVfc3BhY2luZ187CiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogVGhlIGN1cnNvciB0eXBlIG9m IHRoZSByZWFsIGZha2UgY3Vyc29yLiAqLworICBMaXNwX09iamVjdCBtY19yZWFsX2Zha2VfY3Vy c29yXzsKKworICAvKiBUaGUgbmFtZSBvZiBsaXN0IHVzZWQgYnkgbXVsdGlwbGUgY3Vyc29ycyBm b3IgbmV4dCByZWRpc3BsYXkuICovCisgIExpc3BfT2JqZWN0IG1jX2NvbmZfOworCisgIC8qIFdo ZXRoZXIgdG8gZHJhdyBtdWx0aXBsZSBjdXJzb3JzIGluIGluYWN0aXZlIHdpbmRvd3MuICovCisg IExpc3BfT2JqZWN0IG1jX2luYWN0aXZlX3dpbmRvd3NfOworCisgIC8qIFRoZSBuYW1lIG9mIHRo ZSBidWZmZXItbG9jYWwgdmFyaWFibGUuICovCisgIExpc3BfT2JqZWN0IGNyb3NzaGFpcnNfOwor CisgIC8qIFRoZSBuYW1lIG9mIHRoZSBjcm9zc2hhaXJzIGhvcml6b250YWwgcnVsZXIuICovCisg IExpc3BfT2JqZWN0IGNoX2hvcml6b250YWxfcnVsZXJfOworCisgIC8qIFRoZSBuYW1lIG9mIHRo ZSBjcm9zc2hhaXJzIHZlcnRpY2FsIHJ1bGVyLiAqLworICBMaXNwX09iamVjdCBjaF92ZXJ0aWNh bF9ydWxlcl87CisKKyAgLyogV2hldGhlciB0byBkcmF3IGNyb3NzaGFpcnMgaW4gaW5hY3RpdmUg d2luZG93cy4gKi8KKyAgTGlzcF9PYmplY3QgY2hfaW5hY3RpdmVfd2luZG93c187CisKKyAgLyog VGhlIG5hbWUgb2YgdGhlIGJ1ZmZlci1sb2NhbCB2YXJpYWJsZS4gKi8KKyAgTGlzcF9PYmplY3Qg ZmNfdmlzaWJsZV87CisKKyAgLyogV2hldGhlciB0byBkcmF3IG11bHRpcGxlIGN1cnNvcnMgZmls bCBjb2x1bW4gaW4gaW5hY3RpdmUgd2luZG93cy4gKi8KKyAgTGlzcF9PYmplY3QgZmNfaW5hY3Rp dmVfd2luZG93c187CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogQ3Vyc29y IHR5cGUgdG8gZGlzcGxheSBpbiBub24tc2VsZWN0ZWQgd2luZG93cy4KICAgICAgdCBtZWFucyB0 byB1c2UgaG9sbG93IGJveCBjdXJzb3IuCiAgICAgIFNlZSBgY3Vyc29yLXR5cGUnIGZvciBvdGhl ciB2YWx1ZXMuICAqLwpAQCAtNzg3LDE0ICs4MjEsMjEgQEAgc3RydWN0IGJ1ZmZlcgogICAgICBh biBpbmRpcmVjdCBidWZmZXIgc2luY2UgaXQgY291bnRzIGFzIGl0cyBiYXNlIGJ1ZmZlci4gICov CiAgIGludCB3aW5kb3dfY291bnQ7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKICAgLyogQSBub24temVybyB2YWx1ZSBpbiBzbG90IElEWCBt ZWFucyB0aGF0IHBlci1idWZmZXIgdmFyaWFibGUKICAgICAgd2l0aCBpbmRleCBJRFggaGFzIGEg bG9jYWwgdmFsdWUgaW4gdGhpcyBidWZmZXIuICBUaGUgaW5kZXggSURYCiAgICAgIGZvciBhIGJ1 ZmZlci1sb2NhbCB2YXJpYWJsZSBpcyBzdG9yZWQgaW4gdGhhdCB2YXJpYWJsZSdz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A9IHZhbDsKK30KKwor SU5MSU5FIHZvaWQKK2JzZXRfYmx2X2ZjX3Zpc2libGUgKHN0cnVjdCBidWZmZXIgKmIsIExpc3Bf T2JqZWN0IHZhbCkKK3sKKyAgYi0+ZmNfdmlzaWJsZV8gPSB2YWw7Cit9CisKK0lOTElORSB2b2lk Citic2V0X2Jsdl9mY19pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09i amVjdCB2YWwpCit7CisgIGItPmZjX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCisvKiBl bmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogSU5M SU5FIHZvaWQKIGJzZXRfYmlkaV9wYXJhZ3JhcGhfZGlyZWN0aW9uIChzdHJ1Y3QgYnVmZmVyICpi LCBMaXNwX09iamVjdCB2YWwpCiB7CmRpZmYgLS1naXQgYS9zcmMvZGlzcGV4dGVybi5oIGIvc3Jj L2Rpc3BleHRlcm4uaAppbmRleCAxYTUzNjU2Li5lODc3N2MyIDEwMDY0NAotLS0gYS9zcmMvZGlz cGV4dGVybi5oCisrKyBiL3NyYy9kaXNwZXh0ZXJuLmgKQEAgLTEwMCw2ICsxMDAsMTA2IEBAIHR5 cGVkZWYgaW50IEN1cnNvcjsKICNkZWZpbmUgTmF0aXZlUmVjdGFuZ2xlIGludAogI2VuZGlmCiAK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICov CisKK3N0cnVjdCBnbHlwaDsKKworc3RydWN0IGdseXBoX3JvdzsKKworc3RydWN0IGdseXBoX21h dHJpeDsKKworZW51bSBkcmF3X2dseXBoc19mYWNlOworCitlbnVtIGdseXBoX3Jvd19hcmVhOwor CitlbnVtIG1jX2NhY2hlX3R5cGU7CisKK2VudW0gbWNfY3Vyc29yX3R5cGU7CisKK2VudW0gbWNf Zmxhdm9yOworCitzdHJ1Y3QgbWNfUkdCOworCitzdHJ1Y3QgbWNfZXNzZW50aWFsczsKKworZW51 bSBtY19mcm9tX3doZXJlOworCitlbnVtIG1jX2FjdGlvbl90eXBlOworCitleHRlcm4gTGlzcF9P YmplY3QgbWNfbGlzdG4gKHB0cmRpZmZfdCwgTGlzcF9PYmplY3QsIC4uLik7CisKK2V4dGVybiBM aXNwX09iamVjdCBtY19udGggKGludCwgTGlzcF9PYmplY3QpOworCitleHRlcm4gTGlzcF9PYmpl Y3QgbWNfYXNzcSAoTGlzcF9PYmplY3QsIExpc3BfT2JqZWN0KTsKKworZXh0ZXJuIHN0cnVjdCBn bHlwaCAqIG1jX2dldF9jdXJzb3JfZ2x5cGggKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBo X21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0 cnVjdCBnbHlwaF9yb3cgKiwgaW50LCBpbnQpOworCitleHRlcm4gdm9pZCBtY194d19jb2xvcl92 YWx1ZXMgKHN0cnVjdCB3aW5kb3cgKiwgTGlzcF9PYmplY3QsIHN0cnVjdCBtY19SR0IgKik7CisK K2V4dGVybiBib29sIG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAoc3RydWN0IHdpbmRvdyAqLCBi b29sKTsKKworZXh0ZXJuIGNoYXIgKiBtY193aW5kb3cgKHN0cnVjdCB3aW5kb3cgKik7CisKK2V4 dGVybiBjaGFyICogbWNfY2hhcl90b19zdHJpbmcgKGludCk7CisKK2V4dGVybiBjaGFyICogbWNf Y3Vyc29yX3R5cGVfdG9fc3RyaW5nIChlbnVtIG1jX2N1cnNvcl90eXBlKTsKKworZXh0ZXJuIGNo YXIgKiBtY19mbGF2b3JfdG9fc3RyaW5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CisgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICosIGludCwgaW50LCBpbnQs IGludCwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0 cnVjdCBtY19lc3NlbnRpYWxzLCBib29sLCBlbnVtIG1jX2Zyb21fd2hlcmUpOworCitleHRlcm4g dm9pZCBtY19yZWRyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXgg Kiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBp bnQsIGludCwgYm9vbCwgZW51bSBkcmF3X2dseXBoc19mYWNlKTsKKworZXh0ZXJuIHZvaWQgbWNf cmVzZXRfY2FjaGUgKHN0cnVjdCB3aW5kb3cgKik7CisKK2V4dGVybiB2b2lkIG1jX2RyYXdfY3Vy c29yX2dseXBoIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICosIGVudW0gZHJh d19nbHlwaHNfZmFjZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGlu dCwgaW50LCBzdHJ1Y3QgbWNfUkdCLCBlbnVtIG1jX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlLCBpbnQsIGJvb2wsIGJvb2wpOwor CitleHRlcm4gdm9pZCBtY19lcmFzZV9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGds eXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGludCwgaW50LCBpbnQsIGludCwgZW51bSBtY19mbGF2b3IsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCk7CisKK2V4dGVybiB2b2lk IG1jX2RyYXdfZXJhc2VfaHlicmlkIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRy aXggKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGludCwgaW50LCBpbnQsIGludCwgaW50LCBpbnQsIGludCwgaW50LAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCwgc3RydWN0IG1j X1JHQiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sLCBlbnVtIG1jX2Zs YXZvciwgYm9vbCk7CisKK2V4dGVybiB2b2lkIG1jX3hfd3JpdGVfZ2x5cGhzIChzdHJ1Y3Qgd2lu ZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqLCBlbnVtIGdseXBoX3Jvd19h cmVhLCBpbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIHN0cnVj dCBtY19SR0IsIGVudW0gbWNfZmxhdm9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCwgYm9vbCwgYm9vbCwgYm9vbCk7CisKK2V4dGVybiBz dHJ1Y3QgZ2x5cGhfbWF0cml4ICogbWNfc2F2ZV9nbHlwaF9tYXRyaXggKHN0cnVjdCBnbHlwaF9t YXRyaXggKik7CisKK2V4dGVybiB2b2lkIG1jX3Jlc3RvcmVfZ2x5cGhfbWF0cml4IChzdHJ1Y3Qg Z2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKik7CisKKy8qIGVuZCBNVUxUSVBM RS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBUZXh0IGN1cnNv ciB0eXBlcy4gICovCiAKIGVudW0gdGV4dF9jdXJzb3Jfa2luZHMKQEAgLTM4Miw2ICs0ODIsMjIg QEAgc3RydWN0IGdseXBoX3NsaWNlCiAKIHN0cnVjdCBnbHlwaAogeworCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGludCB4LCB5LCBocG9z LCB2cG9zOworCisgIGludCByZWxhdGl2ZV94OworCisgIGJvb2xfYmYgenZfcCA6IDE7CisKKyAg cHRyZGlmZl90IGJ5dGVwb3M7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyog UG9zaXRpb24gZnJvbSB3aGljaCB0aGlzIGdseXBoIHdhcyBkcmF3bi4gIElmIGBvYmplY3QnIGJl bG93IGlzIGEKICAgICAgTGlzcCBzdHJpbmcsIHRoaXMgaXMgYW4gaW5kZXggaW50byB0aGF0IHN0 cmluZy4gIElmIGl0IGlzIGEKICAgICAgYnVmZmVyLCB0aGlzIGlzIGEgcG9zaXRpb24gaW4gdGhh dCBidWZmZXIuICBJbiBhZGRpdGlvbiwgc29tZQpAQCAtMTI0OCw2ICsxMzY0LDI4IEBAIGVudW0g ZHJhd19nbHlwaHNfZmFjZQogCiBzdHJ1Y3QgZ2x5cGhfc3RyaW5nCiB7CisKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBib29sX2JmIGxl ZnRfb3ZlcndyaXR0ZW5fcCA6IDE7CisKKyAgICBib29sX2JmIHJpZ2h0X292ZXJ3cml0dGVuX3Ag OiAxOworCisgICAgYm9vbF9iZiByZWN0YW5nbGVfbnVrZWRfcCA6IDE7CisKKyAgICBib29sX2Jm IGJhY2tncm91bmRfbnVrZWRfcCA6IDE7CisKKyAgICBlbnVtIGRyYXdfZ2x5cGhfYWN0aW9uCisg ICAgeworICAgICAgTUNfRFJBV19HTFlQSCwKKyAgICAgIE1DX0VSQVNFX0dMWVBICisgICAgfSBh Y3Rpb25fdHlwZTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBYLW9yaWdp biBvZiB0aGUgc3RyaW5nLiAgKi8KICAgaW50IHg7CiAKQEAgLTIyMTYsNiArMjM1NCwxOCBAQCBz dHJ1Y3QgY29tcG9zaXRpb25faXQKIAogc3RydWN0IGl0CiB7CisKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgYm9vbF9iZiB6dl9wIDogMTsK KworICBwdHJkaWZmX3QgYnl0ZXBvczsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICAvKiBUaGUgd2luZG93IGluIHdoaWNoIHdlIGl0ZXJhdGUgb3ZlciBjdXJyZW50X2J1ZmZlciAo b3IgYSBzdHJpbmcpLiAgKi8KICAgTGlzcF9PYmplY3Qgd2luZG93OwogICBzdHJ1Y3Qgd2luZG93 ICp3OwpAQCAtMjgxMiw2ICsyOTYyLDMyIEBAIHR5cGVkZWYgdm9pZCAoKmZyYW1lX3Bhcm1faGFu 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i4gICovCiAjaW5jbHVkZSAidzMyLmgiCiAjZW5kaWYKIAwKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBzdHJ1Y3Qg Z2x5cGhzX3NraXBwZWQKKyAgeworICAgIHB0cmRpZmZfdCBhbGxvY2F0ZWQ7CisgICAgcHRyZGlm Zl90IHVzZWQ7CisgICAgc3RydWN0IHNraXBwZWRfaXRlbXMKKyAgICAgIHsKKyAgICAgICAgaW50 IHg7CisgICAgICAgIGludCBocG9zOworICAgICAgICBib29sIGVuYWJsZWRfcDsKKyAgICAgIH0g KnNraXBwZWQ7CisgIH0gYXJyYXlfZ2x5cGhzX3NraXBwZWQ7CisKK3N0YXRpYyBib29sIHVwZGF0 ZV93aW5kb3dfbGluZSAoc3RydWN0IHdpbmRvdyAqLCBpbnQsIGJvb2wgKik7CisKK3N0YXRpYyB2 b2lkIHVwZGF0ZV9tYXJnaW5hbF9hcmVhIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9y b3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIGdseXBoX3Jvd19h cmVhLCBpbnQpOworCitzdGF0aWMgdm9pZCBtYWtlX2N1cnJlbnQgKHN0cnVjdCBnbHlwaF9tYXRy aXggKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBpbnQpOworCitzdGF0aWMgYm9vbCByb3dfZXF1 YWxfcCAoc3RydWN0IGdseXBoX3JvdyAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosIGJvb2wpOworCitz dGF0aWMgdm9pZCBhc3NpZ25fcm93IChzdHJ1Y3QgZ2x5cGhfcm93ICosIHN0cnVjdCBnbHlwaF9y b3cgKik7CisKK3N0cnVjdCBtY19yb3dfZW50cnkKK3sKKyAgaW50IG9sZF91c2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fdGFibGVbaV07CisgIGVhc3NlcnQgKGVudHJ5IHx8IG1jX3ZlcmlmeV9yb3dfaGFzaCAo cm93KSk7CisgIHdoaWxlIChlbnRyeSAmJiAhcm93X2VxdWFsX3AgKGVudHJ5LT5yb3csIHJvdywg MSkpCisgICAgZW50cnkgPSBlbnRyeS0+bmV4dDsKKyAgaWYgKGVudHJ5ID09IE5VTEwpCisgICAg eworICAgICAgZW50cnkgPSBtY19yb3dfZW50cnlfcG9vbCArIG1jX3Jvd19lbnRyeV9pZHgrKzsK KyAgICAgIGVudHJ5LT5yb3cgPSByb3c7CisgICAgICBlbnRyeS0+b2xkX3VzZXMgPSBlbnRyeS0+ bmV3X3VzZXMgPSAwOworICAgICAgZW50cnktPm5ld19saW5lX251bWJlciA9IDA7CisgICAgICBl bnRyeS0+YnVja2V0ID0gaTsKKyAgICAgIGVudHJ5LT5uZXh0ID0gbWNfcm93X3RhYmxlW2ldOwor ICAgICAgbWNfcm93X3RhYmxlW2ldID0gZW50cnk7CisgICAgfQorICByZXR1cm4gZW50cnk7Cit9 CisKKy8qIFJldmVyc2UgdGhlIGNvbnRlbnRzIG9mIHJvd3MgaW4gTUFUUklYIGJldHdlZW4gU1RB UlQgYW5kIEVORC4gIFRoZQorICAgY29udGVudHMgb2YgdGhlIHJvdyBhdCBFTkQgLSAxIGVuZCB1 cCBhdCBTVEFSVCwgRU5EIC0gMiBhdCBTVEFSVCArCisgICAxIGV0Yy4gIFRoaXMgaXMgcGFydCBv ZiB0aGUgaW1wbGVtZW50YXRpb24gb2Ygcm90YXRlX21hdHJpeCAoc2VlCisgICBiZWxvdykuICov CitzdGF0aWMgdm9pZAorbWNfcmV2ZXJzZV92cG9zIChzdHJ1Y3QgbWNfbWF0cml4IG1hdHJpeCwg aW50IHN0YXJ0LCBpbnQgZW5kKQoreworICBpbnQgaSwgajsKKyAgZm9yIChpID0gc3RhcnQsIGog PSBlbmQgLSAxOyBpIDwgajsgKytpLCAtLWopCisgICAgeworICAgICAgLy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GFzdF9uZXc7CisgIGludCBucnVu cywgcnVuX2lkeDsKKyAgcHRyZGlmZl90IG47CisgIHN0cnVjdCBtY19yb3dfZW50cnkgKmVudHJ5 OworICAvLyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSAqcmlmID0gRlJBTUVfUklGIChYRlJB TUUgKFdJTkRPV19GUkFNRSAodykpKTsKKyAgLyogU2tpcCBvdmVyIHJvd3MgZXF1YWwgYXQgdGhl IHN0YXJ0LiAqLworICBmb3IgKGkgPSBoZWFkZXJfbGluZV9wOyBpIDwgY3VycmVudF9tYXRyaXgt Pm5yb3dzIC0gMTsgKytpKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKmQgPSBNQVRS SVhfUk9XIChkZXNpcmVkX21hdHJpeCwgaSk7CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpjID0g TUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIGkpOworICAgICAgaWYgKGMtPmVuYWJsZWRfcAor ICAgICAgICAgICYmIGQtPmVuYWJsZWRfcAorICAgICAgICAgICYmICFkLT5yZWRyYXdfZnJpbmdl X2JpdG1hcHNfcAorICAgICAgICAgICYmIGMtPnkgPT0gZC0+eQorICAgICAgICAgICYmIE1BVFJJ WF9ST1dfQk9UVE9NX1kgKGMpIDw9IHliCisgICAgICAgICAgJiYgTUFUUklYX1JPV19CT1RUT01f WSAoZCkgPD0geWIKKyAgICAgICAgICAmJiByb3dfZXF1YWxfcCAoYywgZCwgMSkpCisgICAgICAg IHsKKyAgICAgICAgICBhc3NpZ25fcm93IChjLCBkKTsKKyAgICAgICAgICBkLT5lbmFibGVkX3Ag PSBmYWxzZTsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAgICBicmVhazsKKyAgICB9Cisj aWZkZWYgSEFWRV9YV0lER0VUUworICAvKiBDdXJyZW50bHkgdGhpcyBzZWVtcyBuZWVkZWQgdG8g ZGV0ZWN0IHh3aWRnZXQgbW92ZW1lb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ycmVudCBt YXRyaXguICBXZSBkb24ndCBsb29rIGF0IHRoZSBlbmFibGVkCisgICAgIGZsYWcgaGVyZSBiZWNh dXNlIHdlIHBsYW4gdG8gcmV1c2UgcGFydCBvZiB0aGUgZGlzcGxheSBldmVuIGlmCisgICAgIG90 aGVyIHBhcnRzIGFyZSBkaXNhYmxlZC4gKi8KKyAgaSA9IGZpcnN0X29sZCArIDE7CisgIHdoaWxl IChpIDwgY3VycmVudF9tYXRyaXgtPm5yb3dzIC0gMSkKKyAgICB7CisgICAgICBpbnQgYm90dG9t ID0gTUFUUklYX1JPV19CT1RUT01fWSAoTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIGkpKTsK KyAgICAgIGlmIChib3R0b20gPD0geWIpCisgICAgICAgICsraTsKKyAgICAgIGlmIChib3R0b20g Pj0geWIpCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgbGFzdF9vbGQgPSBpOworICAvKiBTa2lw IG92ZXIgcm93cyBlcXVhbCBhdCB0aGUgYm90dG9tLiAqLworICBpID0gbGFzdF9uZXc7CisgIGog PSBsYXN0X29sZDsKKyAgd2hpbGUgKGkgLSAxID4gZmlyc3RfbmV3CisgICAgICAgICAmJiBqIC0g MSA+IGZpcnN0X29sZAorICAgICAgICAgJiYgTUFUUklYX1JPV19FTkFCTEVEX1AgKGN1cnJlbnRf bWF0cml4LCBqIC0gMSkKKyAgICAgICAgICYmIChNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwg aiAtIDEpLT55CisgICAgICAgICAgICAgPT0gTUFUUklYX1JPVyAoZGVzaXJlZF9tYXRyaXgsIGkg LSAxKS0+eSkKKyAgICAgICAgICYmICFNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJpeCwgaSAtIDEp LT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcAorICAgICAgICAgJiYgcm93X2VxdWFsX3AgKE1BVFJJ WF9ST1cgKGRlc2lyZWRfbWF0cml4LCBpIC0gMSksCisgICAgICAgICAgIC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k aWZmX3Qgcm93X3RhYmxlX21heCA9CisgICAgICAobWluIChQVFJESUZGX01BWCwgU0laRV9NQVgp IC8gKDMgKiBzaXplb2YgKm1jX3Jvd190YWJsZSkKKyAgICAgICAtIG5leHRfYWxtb3N0X3ByaW1l X2luY3JlbWVudF9tYXgpOworICAgIHB0cmRpZmZfdCBjdXJyZW50X25yb3dzX21heCA9IHJvd190 YWJsZV9tYXggLSBkZXNpcmVkX21hdHJpeC0+bnJvd3M7CisgICAgaWYgKGN1cnJlbnRfbnJvd3Nf bWF4IDwgY3VycmVudF9tYXRyaXgtPm5yb3dzKQorICAgICAgbWVtb3J5X2Z1bGwgKFNJWkVfTUFY KTsKKyAgfQorICAvKiBSZWFsbG9jYXRlIHZlY3RvcnMsIHRhYmxlcyBldGMuIGlmIG5lY2Vzc2Fy eS4gKi8KKyAgaWYgKGN1cnJlbnRfbWF0cml4LT5ucm93cyA+IG1jX29sZF9saW5lc19zaXplKQor ICAgIG1jX29sZF9saW5lcyA9IHhwYWxsb2MgKG1jX29sZF9saW5lcywgJm1jX29sZF9saW5lc19z aXplLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfbWF0cml4LT5ucm93cyAtIG1j X29sZF9saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgIElOVF9NQVgsIHNpemVv ZiAqbWNfb2xkX2xpbmVzKTsKKyAgaWYgKGRlc2lyZWRfbWF0cml4LT5ucm93cyA+IG1jX25ld19s aW5lc19zaXplKQorICAgIG1jX25ld19saW5lcyA9IHhwYWxsb2MgKG1jX25ld19saW5lcywgJm1j X25ld19saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2lyZWRfbWF0cml4 LT5ucm93cyAtIG1jX25ld19saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgIElO VF9NQVgsIHNpemVvZiAqbWNfbmV3X2xpbmVzKTsKKyAgbiA9IGRlc2lyZWRfbWF0cml4LT5ucm93 czsKKy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CisgIG1jX3Jvd19lbnRyeV9pZHgg PSAwOworICAvKiBBZGQgcm93cyBmcm9tIHRoZSBjdXJyZW50IGFuZCBkZXNpcmVkIG1hdHJpeCB0 byB0aGUgaGFzaCB0YWJsZQorICAgICByb3dfaGFzaF90YWJsZSB0byBiZSBhYmxlIHRvIGZpbmQg ZXF1YWwgb25lcyBxdWlja2x5LiAqLworICBmb3IgKGkgPSBmaXJzdF9vbGQ7IGkgPCBsYXN0X29s ZDsgKytpKQorICAgIHsKKyAgICAgIGlmIChNQVRSSVhfUk9XX0VOQUJMRURfUCAoY3VycmVudF9t YXRyaXgsIGkpKQorICAgICAgICB7CisgICAgICAgICAgZW50cnkgPSBtY19hZGRfcm93X2VudHJ5 IChNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSkpOworICAgICAgICAgIG1jX29sZF9saW5l c1tpXSA9IGVudHJ5OworICAgICAgICAgICsrZW50cnktPm9sZF91c2VzOworICAgICAgICB9Cisg ICAgICBlbHNlCisgICAgICAgIG1jX29sZF9saW5lc1tpXSA9IE5VTEw7CisgICAgfQorICBmb3Ig KGkgPSBmaXJzdF9uZXc7IGkgPCBsYXN0X25ldzsgKytpKQorICAgIHsKKyAgICAgIGVhc3NlcnQg KE1BVFJJWF9ST1dfRU5BQkxFRF9QIChkZXNpcmVkX21hdHJpeCwgaSkpOworICAgICAgZW50cnkg PSBtY19hZGRfcm93X2VudHJ5IChNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJpeCwgaSkpOworICAg ICAgKytlbnRyeS0+bmV3X3VzZXM7CisgICAgICBlbnRyeS0+bmV3X2xpbmVfbnVtYmVyID0gaTsK KyAgICAgIG1jX25ld19saW5lc1tpXSA9IGVudHJ5OworICAgIH0KKyAgLyogSWRlbnRpZnkgbW92 ZXMgYmFzZWQgb24gbGluZXMgdGhhdCBhcmUgdW5pcXVlIGFuZCBlcXVhbAorICAgICBpbiBib3Ro IG1hdHJpY2VzLiAqLworICBmb3IgKGkgPSBmaXJzdF9vbGQ7IGkgPCBsYXN0X29sZDspCisgICAg aWYgKG1jX29sZF9saW5lc1tpXQorICAgICAgICAmJiBtY19vbGRfbGluZXNbaV0tPm9sZF91c2Vz ID09IDEKKyAgICAgICAgJiYgbWNfb2xkX2xpbmVzW2ldLT5uZXdfdXNlcyA9PSAxKQorICAgICAg eworICAgICAgICBpbnQgcCwgcTsKKyAgICAgICAgaW50IG5ld19saW5lID0gbWNfb2xkX2xpbmVz W2ldLT5uZXdfbGluZV9udW1iZXI7CisgICAgICAgIHN0cnVjdCBydW4gKnJ1biA9IG1jX3J1bl9w b29sICsgcnVuX2lkeCsrOworICAgICAgICAvKiBSZWNvcmQgbW92ZS4gKi8KKyAgICAgICAgcnVu LT5jdXJyZW50X3Zwb3MgPSBpOworICAgICAgICBydW4tPmN1cnJlbnRfeSA9IE1BVFJJWF9ST1cg KGN1cnJlbnRfbWF0cml4LCBpKS0+eTsKKyAgICAgICAgcnVuLT5kZXNpcmVkX3Zwb3MgPSBuZXdf bGluZTsKKyAgICAgICAgcnVuLT5kZXNpcmVkX3kgPSBNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJp eCwgbmV3X2xpbmUpLT55OworICAgICAgICBydW4tPm5yb3dzID0gMTsKKyAgICAgICAgcnVuLT5o ZWlnaHQgPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSktPmhlaWdodDsKKyAgICAgICAg LyogRXh0ZW5kIGJhY2t3YXJkLiAqLworICAgICAgICBwID0gaSAtIDE7CisgICAgICAgIHEgPSBu ZXdfbGluZSAtIDE7CisgICAgICAgIHdoaWxlIChwID4gZmlyc3Rfb2xkCisgICAgICAgICAgICAg ICAmJiBxID4gZmlyc3RfbmV3CisgICAgICAgICAgICAgICAmJiBtY19vbGRfbGluZXNbcF0gPT0g bWNfbmV3X2xpbmVzW3FdKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCBoID0gTUFUUklY X1JPVyAoY3VycmVudF9tYXRyaXgsIHApLT5oZWlnaHQ7CisgICAgICAgICAgICAtLXJ1bi0+Y3Vy cmVudF92cG9zOworICAgICAgICAgICAgLS1ydW4tPmRlc2lyZWRfdnBvczsKKyAgICAgICAgICAg ICsrcnVuLT5ucm93czsKKyAgICAgICAgICAgIHJ1bi0+aGVpZ2h0ICs9IGg7CisgICAgICAgICAg ICBydW4tPmRlc2lyZWRfeSAtPSBoOworICAgICAgICAgICAgcnVuLT5jdXJyZW50X3kgLT0gaDsK KyAgICAgICAgICAgIC0tcCwgLS1xOworICAgICAgICAgIH0KKyAgICAgICAgLyogRXh0ZW5kIGZv cndhcmQuICovCisgICAgICAgIHAgPSBpICsgMTsKKyAgICAgICAgcSA9IG5ld19saW5lICsgMTsK KyAgICAgICAgd2hpbGUgKHAgPCBsYXN0X29sZAorICAgICAgICAgICAgICAgJiYgcSA8IGxhc3Rf bmV3CisgICAgICAgICAgICAgICAmJiBtY19vbGRfbGluZXNbcF0gPT0gbWNfbmV3X2xpbmVzW3Fd KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCBoID0gTUFUUklYX1JPVyAoY3VycmVudF9t YXRyaXgsIHApLT5oZWlnaHQ7CisgICAgICAgICAgICArK3J1bi0+bnJvd3M7CisgICAgICAgICAg ICBydW4tPmhlaWdodCArPSBoOworICAgICAgICAgICAgKytwLCArK3E7CisgICAgICAgICAgfQor ICAgICAgICAvKiBJbnNlcnQgcnVuIGludG8gbGlzdCBvZiBhbGwgcnVucy4gIE9yZGVyIHJ1bnMg YnkgY29waWVkCisgICAgICAgICAgIHBpeGVsIGxpbmVzLiAgTm90ZSB0aGF0IHdlIHJlY29yZCBy dW5zIHRoYXQgZG9uJ3QgaGF2ZSB0bworICAgICAgICAgICBiZSBjb3BpZWQgYmVjYXVzZSB0aGV5 IGFyZSBhbHJlYWR5IGluIHBsYWNlLiAgVGhpcyBpcyBkb25lCisgICAgICAgICAgIGJlY2F1c2Ug d2UgY2FuIGF2b2lkIGNhbGxpbmcgdXBkYXRlX3dpbmRvd19saW5lIGluIHRoaXMKKyAgICAgICAg ICAgY2FzZS4gKi8KKyAgICAgICAgZm9yIChwID0gMDsgcCA8IG5ydW5zICYmIG1jX3J1bnNbcF0t PmhlaWdodCA+IHJ1bi0+aGVpZ2h0OyArK3ApCisgICAgICAgICAgOworICAgICAgICBmb3IgKHEg PSBucnVuczsgcSA+IHA7IC0tcSkKKyAgICAgICAgICBtY19ydW5zW3FdID0gbWNfcnVuc1txIC0g MV07CisgICAgICAgIG1jX3J1bnNbcF0gPSBydW47CisgICAgICAgICsrbnJ1bnM7CisgICAgICAg IGkgKz0gcnVuLT5ucm93czsKKyAgICAgIH0KKyAgICBlbHNlCisgICAgICArK2k7CisgIC8qIERv IHRoZSBtb3Zlcy4gIERvIGl0IGluIGEgd2F5IHRoYXQgd2UgZG9uJ3Qgb3ZlcndyaXRlIHNvbWV0 aGluZworICAgICB3ZSB3YW50IHRvIGNvcHkgbGF0ZXIgb24uICBUaGlzIGlzIG5vdCBzb2x2YWJs ZSBpbiBnZW5lcmFsCisgICAgIGJlY2F1c2UgdGhlcmUgaXMgb25seSBvbmUgZGlzcGxheSBhbmQg d2UgZG9uJ3QgaGF2ZSBhIHdheSB0bworICAgICBleGNoYW5nZSBhcmVhcyBvbiB0aGlzIGRpc3Bs YXkuICBFeGFtcGxlOgorICAgICAgICAgICstLS0tLS0tLS0tLSsgICAgICAgKy0tLS0tLS0tLS0t KworICAgICAgICAgIHwgICAgIEEgICAgIHwgICAgICAgfCAgICAgQiAgICAgfAorICAgICAgICAg ICstLS0tLS0tLS0tLSsgIC0tPiAgKy0tLS0tLS0tLS0tKworICAgICAgICAgIHwgICAgIEIgICAg IHwgICAgICAgfCAgICAgQSAgICAgfAorICAgICAgICAgICstLS0tLS0tLS0tLSsgICAgICAgKy0t LS0tLS0tLS0tKworICAgICBJbnN0ZWFkLCBwcmVmZXIgYmlnZ2VyIG1vdmVzLCBhbmQgaW52YWxp ZGF0ZSBtb3ZlcyB0aGF0IHdvdWxkCisgICAgIGNvcHkgZnJvbSB3aGVyZSB3ZSBjb3BpZWQgdG8u ICovCisgIGZvciAoaSA9IDA7IGkgPCBucnVuczsgKytpKQorICAgIGlmIChtY19ydW5zW2ldLT5u cm93cyA+IDApCisgICAgICB7CisgICAgICAgIHN0cnVjdCBydW4gKnIgPSBtY19ydW5zW2ldOwor ICAgICAgICBpZiAoci0+Y3VycmVudF95ICE9IHItPmRlc2lyZWRfeSkKKyAgICAgICAgICB7Cisg ICAgICAgICAgICAvLyAgZnByaW50ZiAoc3RkZXJyLCAiJXM6ICByLT5jdXJyZW50L2Rlc2lyZWRf dnBvcyAoJWQvJWQpIHwgci0+Y3VycmVudC9kZXNpcmVkX3kgKCVkLyVkKVxuIiwKKyAgICAgICAg ICAgIC8vICAgICAgICAgICByLT5jdXJyZW50X3kgPCByLT5kZXNpcmVkX3kgPyAi4oaTIiA6ICLi hpEiLAorICAgICAgICAgICAgLy8gICAgICAgICAgIHItPmN1cnJlbnRfdnBvcywgci0+ZGVzaXJl ZF92cG9zLCByLT5jdXJyZW50X3ksIHItPmRlc2lyZWRfeSk7CisgICAgICAgICAgICAvLyAgcmlm LT5jbGVhcl93aW5kb3dfbW91c2VfZmFjZSAodyk7CisgICAgICAgICAgICAvLyAgcmlmLT5zY3Jv bGxfcnVuX2hvb2sgKHcsIHIpOworICAgICAgICAgIH0KKyAgICAgICAgLyogVHJ1bmNhdGUgcnVu cyB0aGF0IGNvcHkgdG8gd2hlcmUgd2UgY29waWVkIHRvLCBhbmQKKyAgICAgICAgICAgaW52YWxp ZGF0ZSBydW5zIHRoYXQgY29weSBmcm9tIHdoZXJlIHdlIGNvcGllZCB0by4gKi8KKyAgICAgICAg Zm9yIChqID0gbnJ1bnMgLSAxOyBqID4gaTsgLS1qKQorICAgICAgICAgIHsKKyAgICAgICAgICAg IHN0cnVjdCBydW4gKnAgPSBtY19ydW5zW2pdOworICAgICAgICAgICAgYm9vbCB0cnVuY2F0ZWRf cCA9IDA7CisgICAgICAgICAgICBpZiAocC0+bnJvd3MgPiAwCisgICAgICAgICAgICAgICAgJiYg cC0+ZGVzaXJlZF95IDwgci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0CisgICAgICAgICAgICAgICAg JiYgcC0+ZGVzaXJlZF95ICsgcC0+aGVpZ2h0ID4gci0+ZGVzaXJlZF95KQorICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgaWYgKHAtPmRlc2lyZWRfeSA8IHItPmRlc2lyZWRfeSkKKyAg ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcC0+bnJvd3MgPSByLT5kZXNp cmVkX3Zwb3MgLSBwLT5kZXNpcmVkX3Zwb3M7CisgICAgICAgICAgICAgICAgICAgIHAtPmhlaWdo dCA9IHItPmRlc2lyZWRfeSAtIHAtPmRlc2lyZWRfeTsKKyAgICAgICAgICAgICAgICAgICAgdHJ1 bmNhdGVkX3AgPSAxOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaW50IG5yb3dzX2NvcGll ZCA9IChyLT5kZXNpcmVkX3Zwb3MgKyByLT5ucm93cworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIC0gcC0+ZGVzaXJlZF92cG9zKTsKKyAgICAgICAgICAgICAgICAgICAg aWYgKHAtPm5yb3dzIDw9IG5yb3dzX2NvcGllZCkKKyAgICAgICAgICAgICAgICAgICAgICBwLT5u cm93cyA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaGVpZ2h0X2NvcGllZCA9IChy LT5kZXNpcmVkX3kgKyByLT5oZWlnaHQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgLSBwLT5kZXNpcmVkX3kpOworICAgICAgICAgICAgICAgICAgICAgICAg ICBwLT5jdXJyZW50X3Zwb3MgKz0gbnJvd3NfY29waWVkOworICAgICAgICAgICAgICAgICAgICAg ICAgICBwLT5kZXNpcmVkX3Zwb3MgKz0gbnJvd3NfY29waWVkOworICAgICAgICAgICAgICAgICAg ICAgICAgICBwLT5ucm93cyAtPSBucm93c19jb3BpZWQ7CisgICAgICAgICAgICAgICAgICAgICAg ICAgIHAtPmN1cnJlbnRfeSArPSBoZWlnaHRfY29waWVkOworICAgICAgICAgICAgICAgICAgICAg ICAgICBwLT5kZXNpcmVkX3kgKz0gaGVpZ2h0X2NvcGllZDsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgcC0+aGVpZ2h0IC09IGhlaWdodF9jb3BpZWQ7CisgICAgICAgICAgICAgICAgICAgICAg ICAgIHRydW5jYXRlZF9wID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHItPmN1cnJlbnRf eSAhPSByLT5kZXNpcmVkX3kKKyAgICAgICAgICAgICAgICAvKiBUaGUgY29uZGl0aW9uIGJlbG93 IGlzIGVxdWl2YWxlbnQgdG8KKyAgICAgICAgICAgICAgICAgICAoKHAtPmN1cnJlbnRfeSA+PSBy LT5kZXNpcmVkX3kKKyAgICAgICAgICAgICAgICAgICAgICYmIHAtPmN1cnJlbnRfeSA8IHItPmRl c2lyZWRfeSArIHItPmhlaWdodCkKKyAgICAgICAgICAgICAgICAgICAgfHwgKHAtPmN1cnJlbnRf eSArIHAtPmhlaWdodCA+IHItPmRlc2lyZWRfeQorICAgICAgICAgICAgICAgICAgICAgICAgJiYg KHAtPmN1cnJlbnRfeSArIHAtPmhlaWdodAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDw9 IHItPmRlc2lyZWRfeSArIHItPmhlaWdodCkpKQorICAgICAgICAgICAgICAgICAgIGJlY2F1c2Ug d2UgaGF2ZSAwIDwgcC0+aGVpZ2h0IDw9IHItPmhlaWdodC4gKi8KKyAgICAgICAgICAgICAgICAm JiBwLT5jdXJyZW50X3kgPCByLT5kZXNpcmVkX3kgKyByLT5oZWlnaHQKKyAgICAgICAgICAgICAg ICAmJiBwLT5jdXJyZW50X3kgKyBwLT5oZWlnaHQgPiByLT5kZXNpcmVkX3kpCisgICAgICAgICAg ICAgIHAtPm5yb3dzID0gMDsKKyAgICAgICAgICAgIC8qIFJlb3JkZXIgcnVucyBieSBjb3BpZWQg cGl4ZWwgbGluZXMgaWYgdHJ1bmNhdGVkLiAqLworICAgICAgICAgICAgaWYgKHRydW5jYXRlZF9w ICYmIHAtPm5yb3dzID4gMCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGludCBr ID0gbnJ1bnMgLSAxOworICAgICAgICAgICAgICAgIHdoaWxlIChtY19ydW5zW2tdLT5ucm93cyA9 PSAwIHx8IG1jX3J1bnNba10tPmhlaWdodCA8IHAtPmhlaWdodCkKKyAgICAgICAgICAgICAgICAg IGstLTsKKyAgICAgICAgICAgICAgICBtZW1tb3ZlIChtY19ydW5zICsgaiwgbWNfcnVucyArIGog KyAxLCAoayAtIGopICogc2l6ZW9mICgqbWNfcnVucykpOworICAgICAgICAgICAgICAgIG1jX3J1 bnNba10gPSBwOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgICAvKiBBc3Np Z24gbWF0cml4IHJvd3MuICovCisgICAgICAgIGZvciAoaiA9IDA7IGogPCByLT5ucm93czsgKytq KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKmZyb20sICp0bzsK KyAgICAgICAgICAgIGJvb2wgdG9fb3ZlcmxhcHBlZF9wOworICAgICAgICAgICAgdG8gPSBNQVRS SVhfUk9XIChjdXJyZW50X21hdHJpeCwgci0+ZGVzaXJlZF92cG9zICsgaik7CisgICAgICAgICAg ICBmcm9tID0gTUFUUklYX1JPVyAoZGVzaXJlZF9tYXRyaXgsIHItPmRlc2lyZWRfdnBvcyArIGop OworICAgICAgICAgICAgdG9fb3ZlcmxhcHBlZF9wID0gdG8tPm92ZXJsYXBwZWRfcDsKKyAgICAg ICAgICAgIGZyb20tPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gZnJvbS0+ZnJpbmdlX2JpdG1h cF9wZXJpb2RpY19wOworICAgICAgICAgICAgYXNzaWduX3JvdyAodG8sIGZyb20pOworICAgICAg ICAgICAgLyogVGhlIGFib3ZlIGBhc3NpZ25fcm93JyBhY3R1YWxseSBkb2VzIHN3YXAsIHNvIGlm IHdlIGhhZAorICAgICAgICAgICAgICAgYW4gb3ZlcmxhcCBpbiB0aGUgY29weSBkZXN0aW5hdGlv biBvZiB0d28gcnVucywgdGhlbgorICAgICAgICAgICAgICAgdGhlIHNlY29uZCBydW4gd291bGQg YXNzaWduIGEgcHJldmlvdXNseSBkaXNhYmxlZCBib2d1cworICAgICAgICAgICAgICAgcm93LiAg QnV0IHRoYW5rcyB0byB0aGUgdHJ1bmNhdGlvbiBjb2RlIGluIHRoZQorICAgICAgICAgICAgICAg cHJlY2VkaW5nIGZvci1sb29wLCB3ZSBubyBsb25nZXIgaGF2ZSBzdWNoIGFuIG92ZXJsYXAsCisg ICAgICAgICAgICAgICBhbmQgdGh1cyB0aGUgYXNzaWduZWQgcm93IHNob3VsZCBhbHdheXMgYmUg ZW5hYmxlZC4gKi8KKyAgICAgICAgICAgIGVhc3NlcnQgKHRvLT5lbmFibGVkX3ApOworICAgICAg ICAgICAgZnJvbS0+ZW5hYmxlZF9wID0gZmFsc2U7CisgICAgICAgICAgICB0by0+b3ZlcmxhcHBl ZF9wID0gdG9fb3ZlcmxhcHBlZF9wOworICAgICAgICAgIH0KKyAgICAgIH0KKyAgLyogQ2xlYXIg dGhlIGhhc2ggdGFibGUsIGZvciB0aGUgbmV4dCB0aW1lLiAqLworICBmb3IgKGkgPSAwOyBpIDwg bWNfcm93X2VudHJ5X2lkeDsgKytpKQorICAgIG1jX3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C8qIFRoaXMgZXJhc2VzIHRoZSBjdXJzb3IuICBXZSBkbyB0aGlzIGhlcmUgYmVj YXVzZQorICAgICAgICAgbm90aWNlb3ZlcndyaXR0ZW5fdGV4dF9jdXJzb3IgY2Fubm90IGVhc2ls eSBjaGVjayB0aGlzLCB3aGljaAorICAgICAgICAgbWlnaHQgaW5kaWNhdGUgdGhhdCB0aGUgd2hv bGUgZnVuY3Rpb25hbGl0eSBvZgorICAgICAgICAgbm90aWNlb3ZlcndyaXR0ZW5fdGV4dF9jdXJz b3Igd291bGQgYmV0dGVyIGJlIGltcGxlbWVudGVkIGhlcmUuCisgICAgICAgICBPbiB0aGUgb3Ro ZXIgaGFuZCwgd2UgbmVlZCBub3RpY2VvdmVyd3JpdHRlbl90ZXh0X2N1cnNvciBhcyBsb25nCisg ICAgICAgICBhcyBtb3VzZSBoaWdobGlnaHRpbmcgaXMgZG9uZSBhc3luY2hyb25vdXNseSBvdXRz aWRlIG9mCisgICAgICAgICByZWRpc3BsYXkuICovCisgICAgICBpZiAodnBvcyA9PSB3LT5waHlz X2N1cnNvci52cG9zKQorICAgICAgICB3LT5waHlzX2N1cnNvcl9vbl9wID0gMDsKKworICAvKiBU aGUgZW50aXJlIHJvdyB3YXMgcmVkcmF3biBhYm92ZSwgc28gYWxsIGZha2UgY3Vyc29ycyBtdXN0 IGJlIHJlZHJhd24uICovCisgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRl ZF9yb3csIGRlc2lyZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAgICAgIGRl c2lyZWRfcm93LT54LCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdLCB2cG9zLCBib3R0b21f dnBvcywKKyAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIGRyYXdfcCwg U0NSSUJFX09ORSk7CisgICAgfQorICBlbHNlCisgICAgeworICAgICAgaW50IHN0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gKG92ZXJsYXBwaW5nX2dseXBoc19wICYm IGkgPiAwKQorICAgICAgeworICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gJmN1cnJlbnRf cm93LT5nbHlwaHNbVEVYVF9BUkVBXVtpIC0gMV07CisgICAgICAgIGludCBsZWZ0LCByaWdodDsK KyAgICAgICAgcmlmLT5nZXRfZ2x5cGhfb3ZlcmhhbmdzIChnbHlwaCwgWEZSQU1FICh3LT5mcmFt ZSksICZsZWZ0LCAmcmlnaHQpOworICAgICAgICBjYW5fc2tpcF9wID0gKHJpZ2h0ID09IDAgJiYg IWFib3J0X3NraXBwaW5nKTsKKyAgICAgIH0KKworICAgIGlmIChjYW5fc2tpcF9wKQorICAgICAg eworICAgICAgICBpbnQgc3RhcnRfaHBvcyA9IGk7CisKKyAgICAgICAgd2hpbGUgKGkgPCBzdG9w CisgICAgICAgICAgICAgICAmJiBHTFlQSF9FUVVBTF9QIChkZXNpcmVkX2dseXBoLCBjdXJyZW50 X2dseXBoKSkKKyAgICAgICAgICB7CisgICAgICAgICAgICArK2FycmF5X2dseXBoc19za2lwcGVk LnVzZWQ7CisgICAgICAgICAgICBpZiAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkIDwg YXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgIGludCBvbGRfYWxsb2MgPSBhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQ7CisgICAg ICAgICAgICAgICAgaW50IG5ld19lbHRzID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCAtIGFy cmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZDsKKyAgICAgICAgICAgICAgICBhcnJheV9nbHlw aHNfc2tpcHBlZC5za2lwcGVkID0KKyAgICAgICAgICAgICAgICAgIHhwYWxsb2MgKGFycmF5X2ds eXBoc19za2lwcGVkLnNraXBwZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmYXJyYXlf Z2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3 X2VsdHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBJTlRfTUFYLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgc2l6ZW9mICphcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkKTsKKyAg ICAgICAgICAgICAgICBtZW1zZXQgKGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWQgKyBvbGRf YWxsb2MsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgKGFycmF5X2dseXBoc19za2lwcGVk LmFsbG9jYXRlZCAtIG9sZF9hbGxvYykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICogc2l6 ZW9mICphcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkKTsKKyAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgaW50IG50aCA9IGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQgLSAxOworICAgICAg ICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLnggPSB4OworICAgICAgICAg ICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLmhwb3MgPSBpOworICAgICAgICAg ICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLmVuYWJsZWRfcCA9IHRydWU7Cisg ICAgICAgICAgICB4ICs9IGRlc2lyZWRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAg KytkZXNpcmVkX2dseXBoLCArK2N1cnJlbnRfZ2x5cGgsICsraTsKKyAgICAgICAgICB9CisKKyAg ICAgICAgLyogQ29uc2lkZXIgdGhlIGNhc2UgdGhhdCB0aGUgY3VycmVudCByb3cgY29udGFpbnMg Inh4eAorICAgICBwcHAgZ2dnIiBpbiBpdGFsaWMgQ291cmllciBmb250LCBhbmQgdGhlIGRlc2ly ZWQgcm93CisgICAgIGlzICJ4eHggZ2dnIi4gIFRoZSBjaGFyYWN0ZXIgYHAnIGhhcyBsYmVhcmlu ZywgYGcnCisgICAgIGhhcyBub3QuICBUaGUgbG9vcCBhYm92ZSB3aWxsIHN0b3AgaW4gZnJvbnQg b2YgdGhlCisgICAgIGZpcnN0IGBwJyBpbiB0aGUgY3VycmVudCByb3cuICBJZiB3ZSB3b3VsZCBz dGFydAorICAgICB3cml0aW5nIGdseXBocyB0aGVyZSwgd2Ugd291bGRuJ3QgZXJhc2UgdGhlIGxi ZWFyaW5nCisgICAgIG9mIHRoZSBgcCcuICBUaGUgcmVzdCBvZiB0aGUgbGJlYXJpbmcgcHJvYmxl bSBpcyB0aGVuCisgICAgIHRha2VuIGNhcmUgb2YgYnkgZHJhd19nbHlwaHMuICovCisgICAgICAg IGlmIChvdmVybGFwcGluZ19nbHlwaHNfcAorICAgICAgICAgICAgJiYgaSA+IDAKKyAgICAgICAg ICAgICYmIGkgPCBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAmJiAo Y3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FS RUFdKSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgbGVmdCwgcmlnaHQ7CisgICAgICAg ICAgICByaWYtPmdldF9nbHlwaF9vdmVyaGFuZ3MgKGN1cnJlbnRfZ2x5cGgsCisgICAgICAgICAg ICAgICAgICAgIFhGUkFNRSAody0+ZnJhbWUpLAorICAgICAgICAgICAgICAgICAgICAmbGVmdCwg JnJpZ2h0KTsKKyAgICAgICAgICAgIHdoaWxlIChsZWZ0ID4gMCAmJiBpID4gMCkKKyAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgIC0taSwgLS1kZXNpcmVkX2dseXBoLCAtLWN1cnJlbnRf Z2x5cGg7CisgICAgICAgICAgICAgICAgeCAtPSBkZXNpcmVkX2dseXBoLT5waXhlbF93aWR0aDsK KyAgICAgICAgICAgICAgICBsZWZ0IC09IGRlc2lyZWRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAvKiBBYm9ydCB0aGUgc2tpcHBpbmcgYWxnb3JpdGht IGlmIHdlIGVuZCB1cCBiZWZvcmUKKyAgICAgICAgICAgICAgIG91ciBzdGFydGluZyBwb2ludCwg dG8gYXZvaWQgbG9vcGluZyAoYnVnIzEwNzApLgorICAgICAgICAgICAgICAgVGhpcyBjYW4gaGFw cGVuIHdoZW4gdGhlIGxiZWFyaW5nIGlzIGxhcmdlciB0aGFuCisgICAgICAgICAgICAgICB0aGUg cGl4ZWwgd2lkdGguICovCisgICAgICAgICAgICBhYm9ydF9za2lwcGluZyA9IChpIDwgc3RhcnRf aHBvcyk7CisgICAgICAgICAgfQorICAgICAgfQorCisgICAgLyogVHJ5IHRvIGF2b2lkIHdyaXRp bmcgdGhlIGVudGlyZSByZXN0IG9mIHRoZSBkZXNpcmVkIHJvdworICAgICAgIGJ5IGxvb2tpbmcg Zm9yIGEgcmVzeW5jIHBvaW50LiAgVGhpcyBtYWlubHkgcHJldmVudHMKKyAgICAgICBtb2RlIGxp bmUgZmxpY2tlcmluZyBpbiB0aGUgY2FzZSB0aGUgbW9kZSBsaW5lIGlzIGluCisgICAgICAgZml4 ZWQtcGl0Y2ggZm9udCwgd2hpY2ggaXQgdXN1YWxseSB3aWxsIGJlLiAqLworICAgIGlmIChpIDwg ZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgIHsKKyAgICAgICAgaW50IHN0YXJ0 X3ggPSB4LCBzdGFydF9ocG9zID0gaTsKKyAgICAgICAgc3RydWN0IGdseXBoICpzdGFydCA9IGRl c2lyZWRfZ2x5cGg7CisgICAgICAgIGludCBjdXJyZW50X3ggPSB4OworICAgICAgICBib29sIHNr aXBfZmlyc3RfcCA9ICFjYW5fc2tpcF9wOworICAgICAgICAvKiBGaW5kIHRoZSBuZXh0IGdseXBo IHRoYXQncyBlcXVhbCBhZ2Fpbi4gKi8KKyAgICAgICAgd2hpbGUgKGkgPCBzdG9wCisgICAgICAg ICAgICAgICAmJiAoc2tpcF9maXJzdF9wCisgICAgICAgICAgICAgICAgICAgfHwgIUdMWVBIX0VR VUFMX1AgKGRlc2lyZWRfZ2x5cGgsIGN1cnJlbnRfZ2x5cGgpKQorICAgICAgICAgICAgICAgJiYg eCA9PSBjdXJyZW50X3gpCisgICAgICAgICAgeworICAgICAgICAgICAgeCArPSBkZXNpcmVkX2ds eXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgIGN1cnJlbnRfeCArPSBjdXJyZW50X2dseXBo LT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICsrZGVzaXJlZF9nbHlwaCwgKytjdXJyZW50X2ds eXBoLCArK2k7CisgICAgICAgICAgICBza2lwX2ZpcnN0X3AgPSAwOworICAgICAgICAgIH0KKwor ICBmb3IgKGludCBlbHQgPSAwOworICAgICAgIGVsdCA8IGFycmF5X2dseXBoc19za2lwcGVkLnVz ZWQKKyAgICAgICAmJiB2cG9zICE9IGJvdHRvbV92cG9zOworICAgICAgICsrZWx0KQorICAgIHsK KyAgICAgIGludCB4ID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtlbHRdLng7CisgICAg ICBpbnQgaHBvcyA9IGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbZWx0XS5ocG9zOworICAg ICAgc3RydWN0IGdseXBoICp0YXJnZXRfZ2x5cGggPQorICAgICAgICBtY19nZXRfY3Vyc29yX2ds eXBoICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIGhwb3MsIHZwb3MpOworICAgICAg aWYgKGRlYnVnX3ApCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlNLSVBQRUQ6ICB2cG9zICgl ZCkgfCBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwgaHBvcyAoJWQvJWQpXG4iLAorICAgICAgICAg ICAgICAgICAgICAgICAgIHZwb3MsIHRhcmdldF9nbHlwaC0+dS5jaCwgbWNfY2hhcl90b19zdHJp bmcgKHRhcmdldF9nbHlwaC0+dS5jaCksCisgICAgICAgICAgICAgICAgICAgICAgICAgeCwgaHBv cywgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpOworICAgICAgbWNfZHJhd19yb3cg KHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCB4LCAxLCB2cG9z LAorICAgICAgICAgICAgICAgICAgIGJvdHRvbV92cG9zLCBjdXJzb3JfbWF0cml4LCBlc3NlbnRp YWxzLCBkcmF3X3AsIFNLSVBQRUQpOworICAgIH0KKworICAgICAgICBpZiAoaSA9PSBzdGFydF9o cG9zIHx8IHggIT0gY3VycmVudF94KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGkgPSBzdGFy dF9ocG9zOworICAgICAgICAgICAgeCA9IHN0YXJ0X3g7CisgICAgICAgICAgICBkZXNpcmVkX2ds eXBoID0gc3RhcnQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICB9CisKKyAgICAgICAg b3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgc3RhcnRfaHBvcywgZGVzaXJlZF9yb3ctPnksIHN0 YXJ0X3gpOworCisgIC8qIFJlLWRyYXcgYSBwb3J0aW9uIG9mIHRoZSByb3cuICovCisKKyAgaWYg KGRlYnVnX3AKKyAgICAgICYmIHZwb3MgIT0gYm90dG9tX3Zwb3MpCisgICAgeworICAgICAgZnBy aW50ZiAoc3RkZXJyLCAiUkVEUkFXIFNFR01FTlQ6XG5cCisgICAgICB2cG9zICglZCkgfCBjaGFy ICglZC8lcykgfCB4OiAoJWQpIHwgaHBvcyAoJWQvJWQpIHwgbGVuZ3RoICglZClcbiIsCisgICAg ICB2cG9zLCBzdGFydC0+dS5jaCwgbWNfY2hhcl90b19zdHJpbmcgKHN0YXJ0LT51LmNoKSwKKyAg ICAgIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAx LCBpIC0gc3RhcnRfaHBvcyk7CisgICAgfQorCisgIHJpZi0+bWNfc2NyaWJlX2dseXBocyAodywg ZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBzdGFydCwgVEVYVF9BUkVBLCBpIC0gc3RhcnRf aHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCBib3R0b21fdnBvcywgbHNsLCBn bHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBl c3NlbnRpYWxzLmFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCwgZHJhd19wKTsKKworICBtY19kcmF3X3Jv dyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBzdGFydCwgc3RhcnRfeCwgaSAtIHN0 YXJ0X2hwb3MsCisgICAgICAgICAgICAgICB2cG9zLCBib3R0b21fdnBvcywgY3Vyc29yX21hdHJp eCwgZXNzZW50aWFscywgZHJhd19wLCBTQ1JJQkVfVFdPKTsKKworICAgICAgICBjaGFuZ2VkX3Ag PSAxOworICAgICAgfQorICB9CisKKyAgICAgIC8qIFdyaXRlIHRoZSByZXN0LiAqLworICAgICAg aWYgKGkgPCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICB7CisgICAgb3V0cHV0X2N1 cnNvcl90byAodywgdnBvcywgaSwgZGVzaXJlZF9yb3ctPnksIHgpOworCisgIGlmIChkZWJ1Z19w CisgICAgICAmJiB2cG9zICE9IGJvdHRvbV92cG9zKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0 ZGVyciwgIkRSQVcgUkVNQUlOREVSIE9GIFRIRSBST1c6XG5cCisgICAgICB2cG9zICglZCkgfCBj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XRlZF9yb3ctPnVzZWRbVEVYVF9B UkVBXSAtIGhwb3MsIHZwb3MsIGJvdHRvbV92cG9zLAorICAgICAgICAgICAgICAgICAgICAgY3Vy c29yX21hdHJpeCwgZXNzZW50aWFscywgZHJhd19wLCBQT1NUX0NIQU5HRUQpOworICAgICAgfQor ICAgICAgLyogVGhlcmUgd2VyZSBubyBjaGFuZ2VzIGFuZCBpID09IGRlc2lyZWRfcm93LT51c2Vk W1RFWFRfQVJFQV0gKi8KKyAgICAgIGVsc2UgaWYgKCFjaGFuZ2VkX3ApCisgICAgICAgIHsKKyAg ICAgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlVOQ0hB TkdFRCAtLSBXUklURSBFTlRJUkUgTElORTogIHZwb3MgKCVkKSB8IHJvdy0+dXNlZCAoJWQpXG4i LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCB1cGRhdGVkX3Jvdy0+dXNlZFtU RVhUX0FSRUFdIC0gMSk7CisgICAgICAgICAgbWNfZHJhd19yb3cgKHcsIGRlc2lyZWRfbWF0cml4 LCB1cGRhdGVkX3JvdywgZGVzaXJlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAg ICAgICAgICAgICAgICBkZXNpcmVkX3Jvdy0+eCwgZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVB XSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgYm90dG9tX3Zwb3MsIGN1cnNvcl9tYXRy aXgsIGVzc2VudGlhbHMsIGRyYXdfcCwgVU5DSEFOR0VEKTsKKyAgICAgICAgfQorCisgICAgICAv KiBNYXliZSBjbGVhciB0byBlbmQgb2YgbGluZS4gKi8KKyAgICAgIGlmIChNQVRSSVhfUk9XX0VY VEVORFNfRkFDRV9QIChkZXNpcmVkX3JvdykpCisgICAgICAgIHsKKyAgICAgICAgICAvKiBJZiBu ZXcgcm93IGV4dGVuZHMgdG8gdGhlIGVuZCBvZiB0aGUgdGV4dCBhcmVhLCBub3RoaW5nCisgICAg ICAgICAgICAgaGFzIHRvIGJlIGNsZWFyZWQsIGlmIGFuZCBvbmx5IGlmIHdlIGRpZCBhIHdyaXRl X2dseXBocworICAgICAgICAgICAgIGFib3ZlLiAgVGhpcyBpcyBtYWRlIHN1cmUgYnkgc2V0dGlu ZyBkZXNpcmVkX3N0b3BfcG9zCisgICAgICAgICAgICAgYXBwcm9wcmlhdGVseSBhYm92ZS4gKi8K KyAgICAgICAgICBlYXNzZXJ0IChpIDwgZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAg ICAgICAgICAgICAgICAgIHx8ICgoZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSA9PSBjdXJy ZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAgICAgICAgICAgICAgICAgICAmJiBNQVRS SVhfUk9XX0VYVEVORFNfRkFDRV9QIChjdXJyZW50X3JvdykpKTsKKyAgICAgICAgfQorICAgICAg ZWxzZSBpZiAoTUFUUklYX1JPV19FWFRFTkRTX0ZBQ0VfUCAoY3VycmVudF9yb3cpKQorICAgICAg ICB7CisgICAgICAgICAgLyogSWYgb2xkIHJvdyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRl eHQgYXJlYSwgY2xlYXIuICovCisgICAgICAgICAgaWYgKGkgPj0gZGVzaXJlZF9yb3ctPnVzZWRb VEVYVF9BUkVBXSkKKyAgICAgICAgICAgIG91dHB1dF9jdXJzb3JfdG8gKHcsIHZwb3MsIGksIGRl c2lyZWRfcm93LT55LCBkZXNpcmVkX3Jvdy0+cGl4ZWxfd2lkdGgpOworICAgICAgICAgIGlmIChk cmF3X3ApCisgICAgICAgICAgICByaWYtPmNsZWFyX2VuZF9vZl9saW5lICh3LCB1cGRhdGVkX3Jv dywgVEVYVF9BUkVBLCAtMSk7CisgICAgICAgICAgY2xlYXJfdG9feCA9IC0xOworICAgICAgICAg IGNoYW5nZWRfcCA9IDE7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKGRlc2lyZWRfcm93LT5w aXhlbF93aWR0aCA8IGN1cnJlbnRfcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgeworICAgICAg ICAgIC8qIE90aGVyd2lzZSBjbGVhciB0byB0aGUgZW5kIG9mIHRoZSBvbGQgcm93LiAgRXZlcnl0 aGluZworICAgICAgICAgICAgIGFmdGVyIHRoYXQgcG9zaXRpb24gc2hvdWxkIGJlIGNsZWFyIGFs cmVhZHkuICovCisgICAgICAgICAgaW50IHhsaW07CisgICAgICAgICAgaWYgKGkgPj0gZGVzaXJl ZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICAgIG91dHB1dF9jdXJzb3JfdG8gKHcs IHZwb3MsIGksIGRlc2lyZWRfcm93LT55LCBkZXNpcmVkX3Jvdy0+cGl4ZWxfd2lkdGgpOworICAg ICAgICAgIC8qIElmIGN1cnNvciBpcyBkaXNwbGF5ZWQgYXQgdGhlIGVuZCBvZiB0aGUgbGluZSwg bWFrZSBzdXJlCisgICAgICAgICAgICAgaXQncyBjbGVhcmVkLiAgTm93YWRheXMgd2UgZG9uJ3Qg aGF2ZSBhIHBoeXNfY3Vyc29yX2dseXBoCisgICAgICAgICAgICAgd2l0aCB3aGljaCB0byBlcmFz ZSB0aGUgY3Vyc29yIChiZWNhdXNlIHRoaXMgbWV0aG9kCisgICAgICAgICAgICAgZG9lc24ndCB3 b3JrIHdpdGggbGJlYXJpbmcvcmJlYXJpbmcpLCBzbyB3ZSBtdXN0IGRvIGl0IHRoaXMgd2F5LiAq LworICAgICAgICAgIGlmICh2cG9zID09IHctPnBoeXNfY3Vyc29yLnZwb3MKKyAgICAgICAgICAg ICAgJiYgKGRlc2lyZWRfcm93LT5yZXZlcnNlZF9wCisgICAgICAgICAgICAgICAgICA/ICh3LT5w aHlzX2N1cnNvci5ocG9zIDwgMCkKKyAgICAgICAgICAgICAgICAgIDogKHctPnBoeXNfY3Vyc29y Lmhwb3MgPj0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkpKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICB3LT5waHlzX2N1cnNvcl9vbl9wID0gMDsKKyAgICAgICAgICAgICAgeGxp bSA9IC0xOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB4 bGltID0gY3VycmVudF9yb3ctPnBpeGVsX3dpZHRoOworICAgICAgICAgIGlmIChkcmF3X3ApCisg ICAgICAgICAgICByaWYtPmNsZWFyX2VuZF9vZl9saW5lICh3LCB1cGRhdGVkX3JvdywgVEVYVF9B UkVBLCB4bGltKTsKKyAgICAgICAgICBjbGVhcl90b194ID0geGxpbTsKKyAgICAgICAgICBjaGFu Z2VkX3AgPSAxOworICAgICAgICB9CisKKyAgaWYgKGNoYW5nZWRfcAorICAgICAgJiYgY2xlYXJf dG9feCAhPSAwKQorICAgIHsKKyAgICAgIGludCB0ZXh0X2FyZWFfd2lkdGggPSB3aW5kb3dfYm94 X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAgICAgc3RydWN0IG1jX1JHQiBkZWJ1Z19mZyA9IHsu cmVkID0gMC44NjcsIC5ncmVlbiA9IDAuODY3LCAuYmx1ZSA9IDAuODY3fTsKKyAgICAgIHN0cnVj dCBnbHlwaCAqdGFyZ2V0X2dseXBoID0gdXBkYXRlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdICsg dXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDE7CisgICAgICAvKiBgbWNfZW5naW5lJyBv bmx5IGRyYXdzIGFuIE1DX0dMWVBIIHdoZW4geCA8IHVwZGF0ZWRfcm93LT5waXhlbF93aWR0aC4K KyAgICAgIFRoZSBjdXJyZW50IGRlc2lnbiBpbmhpYml0cyBkcmF3aW5nIG92ZXIgYW4gZXhpc3Rp bmcgZ2x5cGggYXQgdGhlIGVuZCBvZiBhCisgICA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lkdGgKKyAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAg JiYgdGFyZ2V0X2dseXBoICE9IE5VTEwKKyAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAgIG1j X2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRF WFRfQVJFQSwgeCwgeF9saW1pdCwKKyAgICAgICAgICAgICAgICAgICB1cGRhdGVkX3Jvdy0+eSwg aHBvcywgdnBvcywgTUNfSEJBUiwgMSwgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscy5mY194LAor ICAgICAgICAgICAgICAgICAgIGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGVzc2VudGlhbHMuY2hfZmcs IGVzc2VudGlhbHMuYWN0aXZlX3AsIEhPUklaT05UQUxfUlVMRVIsCisgICAgICAgICAgICAgICAg ICAgZHJhd19wLCBOT1dIRVJFLCBOT19DQUNIRSk7CisKKyAgICAgIGlmIChCVUZGRVJQICh3LT5j b250ZW50cykKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgJiYgeCA8IHRleHRfYXJlYV93 aWR0aAorICAgICAgICAgICYmIHZwb3MgIT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAmJiB3 LT5jdXJzb3IueCA+PSB4CisgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9IE5VTEwKKyAgICAg ICAgICAmJiBkcmF3X3ApCisgICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVw ZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwKKyAgICAgICAg ICAgICAgICAgICB1cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfQkFSLCAxLCBjdXJzb3Jf bWF0cml4LCBlc3NlbnRpYWxzLmZjX3gsCisgICAgICAgICAgICAgICAgICAgZGVidWdfcCA/IGRl YnVnX2ZnIDogZXNzZW50aWFscy5jaF9mZywgZXNzZW50aWFscy5hY3RpdmVfcCwgVkVSVElDQUxf UlVMRVIsCisgICAgICAgICAgICAgICAgICAgZHJhd19wLCBOT1dIRVJFLCBOT19DQUNIRSk7CisK KyAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAmJiAhTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAmJiB4IDwg dGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHgKKyAgICAg ICAgICAmJiB0YXJnZXRfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICYmIGRyYXdfcCkKKyAgICAg ICAgbWNfZW5naW5lICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHRhcmdldF9nbHlw aCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgIHVwZGF0ZWRfcm93 LT55LCBocG9zLCB2cG9zLCBNQ19CQVIsIDEsIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMuZmNf eCwKKyAgICAgICAgICAgICAgICAgICBkZWJ1Z19wID8gZGVidWdfZmcgOiBlc3NlbnRpYWxzLmZj X2ZnLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBGSUxMX0NPTFVNTiwKKyAgICAgICAgICAgICAgICAg ICBkcmF3X3AsIE5PV0hFUkUsIE5PX0NBQ0hFKTsKKworICAgIH0KKyAgICB9CisgIHJldHVybiBj aGFuZ2VkX3A7Cit9CisKKy8qIFVwZGF0ZSByb3cgV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XguY3Vyc29yc191c2VkW0ZDX0NBQ0hFXSA+IDApOworICBib29sIGdvX3R3b19w ID0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICYmICghTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAg ICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJs ZSkpCisgICAgICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIG1jX2NvbmYpKSkpOworICBib29sIHVwZGF0aW5nX2ZyYW1lX3AgPSBmYWxzZTsK KyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIGlmIChYRlJBTUUgKHct PmZyYW1lKSAhPSBmLT5tY191cGRhdGluZ19mcmFtZQorICAgICAgJiYgKGdvX29uZV9wIHx8IGdv X3R3b19wKSkKKyAgICB7CisgICAgICB1cGRhdGluZ19mcmFtZV9wID0gdHJ1ZTsKKyAgICAgIHVw ZGF0ZV9iZWdpbiAoZik7CisgICAgfQorICBpZiAody0+cGh5c19jdXJzb3Jfb25fcAorICAgICAg JiYgZ29fdHdvX3ApCisgICAgZXJhc2VfcGh5c19jdXJzb3IgKHcpOworCisvKgorICBmb3IgKGlu dCB2bnRoID0gMDsKKyAgICAgICB2bnRoIDwgb2xkX21hdHJpeC52cG9zX3VzZWQ7CisgICAgICAg Kyt2bnRoKQorICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNI RTsKKyAgICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICAgICsrY2FjaGVfdHlw ZSkKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX3VwZGF0ZV93aW5kb3dfZXJhc2UgKCVkKTog ICV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vX3N0cmluZyAoY2FjaGVfdHlwZSksIG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdKTsKKyovCisKKyAgZm9yIChp bnQgdm50aCA9IDA7CisgICAgICAgZ29fb25lX3AKKyAgICAgICAmJiB2bnRoIDwgb2xkX21hdHJp eC52cG9zX3VzZWQ7CisgICAgICAgKyt2bnRoKQorICAgIHsKKyAgICAgIGZvciAoZW51bSBtY19j YWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICAgICAgY2FjaGVfdHlwZSA8 IE5PX0NBQ0hFOworICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgIGZvciAoaW50IHpf bnRoID0gMDsKKyAgICAgICAgICAgICBvbGRfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBl XSA+IDAKKyAgICAgICAgICAgICAmJiB6X250aCA8IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZV91c2VkW2NhY2hlX3R5cGVdOworICAgICAgICAgICAgICsrel9udGgpCisgICAgICAgICAgewor ICAgICAgICAgICAgYm9vbCBzYW1lX3AgPSBmYWxzZTsKKyAgICAgICAgICAgIGZvciAoaW50IHdf bnRoID0gMDsgd19udGggPCB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hl X3R5cGVdOyArK3dfbnRoKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2FtZV9w IHw9IChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmdseXBo LnR5cGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnR5cGUKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6 X250aF0uZ2x5cGguYnl0ZXBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguYnl0ZXBv cworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5nbHlwaC5jaGFycG9zCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS5nbHlwaC5jaGFycG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmdseXBoLnUudmFsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC51LnZhbAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5nbHlw aC5mYWNlX2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5mYWNlX2lkCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bel9udGhdLmdseXBoLnBhZGRpbmdfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5 cGgucGFkZGluZ19wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmdseXBoLmxlZnRfYm94X2xpbmVfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgubGVmdF9ib3hfbGluZV9wCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bel9udGhdLmdseXBoLnJpZ2h0X2JveF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LmdseXBoLnJpZ2h0X2JveF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0uZ2x5cGgudm9mZnNl dAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudm9mZnNldAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pf bnRoXS5nbHlwaC5waXhlbF93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgucGl4 ZWxfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0uZ2x5cGguc2xpY2UuaW1nLngKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bd19udGhdLmdseXBoLnNsaWNlLmltZy54CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmds eXBoLnNsaWNlLmltZy55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcu eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5nbHlwaC5zbGljZS5pbWcud2lkdGgKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bd19udGhdLmdseXBoLnNsaWNlLmltZy53aWR0aAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5n bHlwaC5zbGljZS5pbWcuaGVpZ2h0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGlj ZS5pbWcuaGVpZ2h0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmdseXBoLnNsaWNlLmNtcC5mcm9tCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5jbXAuZnJvbQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3pfbnRoXS54CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS54CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhd LmZ4CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5meAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS55Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmZ5CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5meQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5ocG9zCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW3dfbnRoXS5ocG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLnZwb3MKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bd19udGhdLnZwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0ud2QKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bd19udGhdLndkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmgKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19u dGhdLmgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0uY3Vyc29yX3R5cGUKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b d19udGhdLmN1cnNvcl90eXBlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmN1cnNvcl93aWR0aAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVt3X250aF0uY3Vyc29yX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmZv cmVncm91bmQucmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5mb3JlZ3JvdW5kLnJlZAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3pfbnRoXS5mb3JlZ3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRo XS5mb3JlZ3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmZvcmVncm91bmQuYmx1ZQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVt3X250aF0uZm9yZWdyb3VuZC5ibHVlCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9u dGhdLmJhY2tncm91bmQucmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5iYWNrZ3JvdW5kLnJl ZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5iYWNrZ3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3dfbnRoXS5iYWNrZ3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmJhY2tncm91bmQu Ymx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uYmFja2dyb3VuZC5ibHVlCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bel9udGhdLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5hY3RpdmVfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3pfbnRoXS5nbHlwaF9mbGF2b3IKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmds eXBoX2ZsYXZvcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5lbmFibGVkX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bd19udGhdLmVuYWJsZWRfcCk7CisgICAgICAgICAgICAgICAgLyogRm9yY2UgdGhlIGZyaW5n ZSBiaXRtYXBzIHRvIGFsd2F5cyBiZSByZXNldC9yZWRyYXduLiAqLworICAgICAgICAgICAgICAg IGlmIChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmN1cnNv cl90eXBlCisgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmN1cnNvcl90eXBlCisgICAgICAgICAgICAgICAgICAg ICYmIChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmN1cnNv cl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgICAgICAg fHwgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5jdXJzb3Jf dHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQKSkKKyAgICAgICAgICAgICAgICAgIHNhbWVf cCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGlmIChzYW1lX3ApCisgICAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgIC8vICBmcHJpbnRmIChzdGRlcnIsICJISVQgKCVzKTog IHZwb3MgKCVkKSB8IGhwb3MgKCVkKSB8IGNoYXIgKCVzKVxuIiwKKyAgICAgICAgICAgICAgICAg ICAgLy8gICAgICAgICAgICAgICAgICAgKGNhY2hlX3R5cGUgPT0gTUNfQ0FDSEUpCisgICAgICAg ICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgPyAiTUMiCisgICAgICAgICAgICAg ICAgICAgIC8vICAgICAgICAgICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0gQ0hfQ0FDSEUpCisg ICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgPyAiQ0giCisgICAgICAg ICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0gRkNfQ0FD SEUpCisgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgPyAiRkMiCisg ICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIDogIk5PIiwKKyAgICAgICAg ICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnZwb3MsCisgICAgICAgICAgICAgICAgICAgIC8vICAg ICAgICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3dfbnRoXS5ocG9zLAorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICBt Y19jaGFyX3RvX3N0cmluZyAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bd19udGhdLmdseXBoLnUuY2gpKTsKKyAgICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnNhbWVfcCA9IHRydWU7CisgICAg ICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAg Ly8gIGZwcmludGYgKHN0ZGVyciwgIk1JU1MgKCVzKTogIHZwb3MgKCVkKSB8IGhwb3MgKCVkIHYu ICVkKSB8IGNoYXIgKCVzIHYuICVzKSB8IGNhY2hlX3VzZWQgKCVkIHYuICVkKVxuIiwKKyAgICAg ICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAoY2FjaGVfdHlwZSA9PSBNQ19D QUNIRSkKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgID8gIk1D IgorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIDogKGNhY2hlX3R5 cGUgPT0gQ0hfQ0FDSEUpCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAg ICAgICA/ICJDSCIKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICA6 IChjYWNoZV90eXBlID09IEZDX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAg ICAgICAgICAgICAgICAgPyAiRkMiCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAg ICAgICAgICAgOiAiTk8iLAorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAg ICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS52cG9z LAorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0uaHBvcywKKyAgICAgICAgICAgICAg ICAgICAgICAvLyAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVt3X250aF0uaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAg ICAgICAgICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5nbHlwaC51LmNoKSwKKyAgICAgICAgICAgICAgICAgICAg ICAvLyAgICAgICAgICAgICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAody0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnUuY2gpLAorICAgICAgICAg ICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZV91c2VkW2NhY2hlX3R5cGVdLAorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAg ICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0p OworICAgICAgICAgICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5zYW1lX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoIXNhbWVfcCkKKyAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgIC8qIGBtYXRyaXhfcm93JyBpbiBgZGlzcG5ldy5jYCBjb250YWlu cyB0aGUgZm9sbG93aW5nIHRlc3RzLAorICAgICAgICAgICAgICAgIGVhc3NlcnQgKG1hdHJpeCAm JiBtYXRyaXgtPnJvd3MpOworICAgICAgICAgICAgICAgIGVhc3NlcnQgKHJvdyA+PSAwICYmIHJv dyA8IG1hdHJpeC0+bnJvd3MpOyAqLworICAgICAgICAgICAgICAgIGJvb2wgYmFyZl9jcmFzaF9v bmUgPSAody0+Y3VycmVudF9tYXRyaXggJiYgdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MpID8gZmFs c2UgOiB0cnVlOworICAgICAgICAgICAgICAgIGlmIChiYXJmX2NyYXNoX29uZSkKKyAgICAgICAg ICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIGJvb2wgYmFyZl9jcmFzaF90d28g PSAodm50aCA+PSAwICYmIHZudGggPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MpID8gZmFsc2Ug OiB0cnVlOworICAgICAgICAgICAgICAgIGlmIChiYXJmX2NyYXNoX3R3bykKKyAgICAgICAgICAg ICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnZudGhf cm93ID0gTUFUUklYX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIHZudGgpOworICAgICAgICAgICAg ICAgIGludCB4XzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9u dGhdLng7CisgICAgICAgICAgICAgICAgaW50IGZ4XzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmZ4OworICAgICAgICAgICAgICAgIGludCB5XzAgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLnk7CisgICAgICAg ICAgICAgICAgaW50IGZ5XzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bel9udGhdLmZ5OworICAgICAgICAgICAgICAgIGludCBocG9zXzAgPSBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmhwb3M7CisgICAgICAgICAgICAgICAg aW50IHZwb3NfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250 aF0udnBvczsKKyAgICAgICAgICAgICAgICBpbnQgd2RfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0ud2Q7CisgICAgICAgICAgICAgICAgaW50IGhfMCA9 IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0uaDsKKyAgICAg ICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlXzAgPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmN1cnNvcl90eXBlOworICAgICAg ICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGhfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVt6X250aF0uY3Vyc29yX3dpZHRoOworICAgICAgICAgICAgICAgIHN0cnVj dCBtY19SR0IgbHNsX2ZnXzAgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt6X250aF0uZm9yZWdyb3VuZC5yZWQsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bel9udGhdLmZvcmVncm91bmQuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVt6X250aF0uZm9yZWdyb3VuZC5ibHVlfTsKKyAgICAgICAgICAgICAgICBz dHJ1Y3QgbWNfUkdCIGxzbF9iZ18wID0gey5yZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bel9udGhdLmJhY2tncm91bmQucmVkLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5iYWNrZ3JvdW5kLmdyZWVuLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmJhY2tncm91bmQuYmx1ZX07CisgICAgICAgICAgICAg ICAgYm9vbCBhY3RpdmVfcF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3pfbnRoXS5hY3RpdmVfcDsKKyAgICAgICAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlw aF9mbGF2b3JfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250 aF0uZ2x5cGhfZmxhdm9yOworICAgICAgICAgICAgICAgIGJvb2wgZW5hYmxlZF9wXzAgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmVuYWJsZWRfcDsKKyAg ICAgICAgICAgICAgICBpZiAodnBvc18wID09IHZudGgKKyAgICAgICAgICAgICAgICAgICAgJiYg Z2x5cGhfZmxhdm9yXzAgPT0gTUNfR0xZUEgKKyAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxl ZF9wXzAKKyAgICAgICAgICAgICAgICAgICAgJiYgdm50aF9yb3ctPmVuYWJsZWRfcCkKKyAgICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbWNfZXJhc2VfY3Vyc29yICh3LCB3 LT5jdXJyZW50X21hdHJpeCwgdm50aF9yb3csIHhfMCwgeV8wLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGhwb3NfMCwgdnBvc18wLCBnbHlwaF9mbGF2b3JfMCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZV8wLCB3ZF8wKTsKKyAg ICAgICAgICAgICAgICAgICAgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3pfbnRoXS5lbmFibGVkX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgLS1vbGRfbWF0 cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICAgICAgICAgICAgLyogSWYg d2UgaW5hZHZlcnRlbnRseSBlcmFzZWQgYW5vdGhlciBmYWtlIGN1cnNvciBhdCB0aGUgc2FtZQor ICAgICAgICAgICAgICAgICAgICBIUE9TIHRoYXQgaXMgc3RpbGwgZW5hYmxlZF9wIGluIHRoZSBg b2xkX21hdHJpeGAsIHRoZW4gcmVkcmF3IGl0LiAqLworICAgICAgICAgICAgICAgICAgICBmb3Ig KGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgICAgICAg ICAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICAgICAgICAgICAgICAg ICAgICsrY2FjaGVfdHlwZSkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgICAgICAgICBmb3IgKGludCBudGhfMSA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIG9sZF9tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdID4gMAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBudGhfMSA8IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91 c2VkW2NhY2hlX3R5cGVdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICArK250aF8xKQor ICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg aW50IHhfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0u eDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnhfMSA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZng7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgaW50IHlfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMV0ueTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnlfMSA9IG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZnk7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgaW50IGhwb3NfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMV0uaHBvczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBp bnQgdnBvc18xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8x XS52cG9zOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB3ZF8xID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS53ZDsKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICBpbnQgaF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8xXS5oOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vy c29yX3R5cGUgY3Vyc29yX3R5cGVfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMV0uY3Vyc29yX3R5cGU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg aW50IGN1cnNvcl93aWR0aF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8xXS5jdXJzb3Jfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3Ry dWN0IG1jX1JHQiBsc2xfZmdfMSA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8xXS5mb3JlZ3JvdW5kLnJlZCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZm9yZWdyb3VuZC5ncmVlbiwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5mb3JlZ3JvdW5k LmJsdWV9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2Jn XzEgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf MV0uYmFja2dyb3VuZC5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzFdLmJhY2tncm91bmQuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uYmFja2dyb3VuZC5ibHVlfTsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmFjdGl2ZV9wOworICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvcl8xID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgYm9vbCBlbmFibGVkX3BfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZW5hYmxlZF9wOworICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGJvb2wgZ29fcF8xID0gKGhwb3NfMCA9PSBocG9zXzEKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3BfMSk7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgaWYgKCFnb19wXzEpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9w XzEgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5 YnJpZCAodywgdy0+Y3VycmVudF9tYXRyaXgsIHZudGhfcm93LCB4XzEsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ4XzEsIHlfMSwgZnlfMSwgaHBv c18xLCB2cG9zXzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHdkXzEsIGhfMSwgY3Vyc29yX3R5cGVfMSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoXzEsIGxzbF9mZ18xLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcF8x LCBnbHlwaF9mbGF2b3JfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgcmVtb3ZlX3BfMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg ICAgICBlbHNlIGlmICh2cG9zXzAgPT0gdm50aAorICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgZW5hYmxlZF9wXzAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHZudGhfcm93LT5l bmFibGVkX3ApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBi b29sIHJlbW92ZV9wXzAgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJh c2VfaHlicmlkICh3LCB3LT5jdXJyZW50X21hdHJpeCwgdm50aF9yb3csIHhfMCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnhfMCwgeV8wLCBmeV8wLCBocG9z XzAsIHZwb3NfMCwgd2RfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgaF8wLCBjdXJzb3JfdHlwZV8wLCBjdXJzb3Jfd2lkdGhfMCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsX2JnXzAsIGFjdGl2ZV9wXzAsIGdseXBo X2ZsYXZvcl8wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBy ZW1vdmVfcF8wKTsKKyAgICAgICAgICAgICAgICAgICAgICBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICAgICAg ICAgICAgICAgIC0tb2xkX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAg ICAgICAgICAgICAgICAgLyogSWYgd2UgaW5hZHZlcnRlbnRseSBlcmFzZWQgYW5vdGhlciBmYWtl IGN1cnNvciBhdCB0aGUgc2FtZQorICAgICAgICAgICAgICAgICAgICAgIEhQT1MgdGhhdCBpcyBz dGlsbCBlbmFibGVkX3AgaW4gdGhlIGBvbGRfbWF0cml4YCwgdGhlbiByZWRyYXcgaXQuICovCisg ICAgICAgICAgICAgICAgICAgICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9 IE1DX0NBQ0hFOworICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NB Q0hFOworICAgICAgICAgICAgICAgICAgICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBudGhf MiA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2xkX21hdHJpeC5jdXJzb3Jz X3VzZWRbY2FjaGVfdHlwZV0gPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg bnRoXzIgPCBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXTsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICArK250aF8yKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB4XzIgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLng7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBpbnQgZnhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMl0uZng7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBp bnQgeV8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS55 OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZ5XzIgPSBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmZ5OworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaW50IGhwb3NfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMl0uaHBvczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB2 cG9zXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLnZw b3M7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgd2RfMiA9IG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0ud2Q7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBpbnQgaF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8yXS5oOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19j dXJzb3JfdHlwZSBjdXJzb3JfdHlwZV8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8yXS5jdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGludCBjdXJzb3Jfd2lkdGhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMl0uY3Vyc29yX3dpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgc3RydWN0IG1jX1JHQiBsc2xfZmdfMiA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5mb3JlZ3JvdW5kLnJlZCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5mb3JlZ3JvdW5kLmdyZWVu LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0u Zm9yZWdyb3VuZC5ibHVlfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBt Y19SR0IgbHNsX2JnXzIgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMl0uYmFja2dyb3VuZC5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uYmFja2dyb3VuZC5ncmVlbiwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmJhY2tncm91bmQu Ymx1ZX07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wXzIgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmFjdGl2ZV9wOwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9y XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmdseXBo X2ZsYXZvcjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgZW5hYmxlZF9wXzIg PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmVuYWJsZWRf cDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgZ29fcF8yID0gKGhwb3NfMCA9 PSBocG9zXzIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IGZ4XzAgPD0gZnhfMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgZnhfMCArIHdkXzAgPiBmeF8yICsgd2RfMgorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wXzIpOworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaWYgKCFnb19wXzIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCByZW1vdmVfcF8y ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5 YnJpZCAodywgdy0+Y3VycmVudF9tYXRyaXgsIHZudGhfcm93LCB4XzIsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnhfMiwgeV8yLCBmeV8yLCBo cG9zXzIsIHZwb3NfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICB3ZF8yLCBoXzIsIGN1cnNvcl90eXBlXzIsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoXzIsIGxzbF9mZ18y LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFj dGl2ZV9wXzIsIGdseXBoX2ZsYXZvcl8yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZV9wXzIpOworICAgICAgICAgICAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgfQorCisgIGlmICh1cGRhdGlu Z19mcmFtZV9wKQorICAgIHVwZGF0ZV9lbmQgKGYpOworfQorCit2b2lkCittY191cGRhdGVfd2lu ZG93X2RyeXJ1biAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wLCBzdHJ1Y3QgbWNfZXNz ZW50aWFscyAqZXNzZW50aWFscykKK3sKKyAgaWYgKCFCVUZGRVJQICh3LT5jb250ZW50cykpCisg ICAgcmV0dXJuOworCisgIGlmICh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA9 PSAwCisgICAgICAmJiB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NBQ0hFXSA9PSAwCisg ICAgICAmJiB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NBQ0hFXSA9PSAwCisgICAgICAm JiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgJiYg TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICYm IE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKQorICAgIHJl dHVybjsKKworICAvLyBjbG9ja190IGNsb2NrX3N0YXJ0ID0gY2xvY2soKTsKKworICBib29sIGRy YXdfcCA9IGZhbHNlOworCisgIHN0cnVjdCBnbHlwaF9tYXRyaXggKnNhdmVkX2Rlc2lyZWQgPSBt Y19zYXZlX2dseXBoX21hdHJpeCAody0+ZGVzaXJlZF9tYXRyaXgpOworICBzdHJ1Y3QgZ2x5cGhf bWF0cml4ICpzYXZlZF9jdXJyZW50ID0gbW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XIChkZXNpcmVkX21hdHJpeCk7CisgICAgICBpZiAobW9kZV9saW5lX3Jv dy0+bW9kZV9saW5lX3AgJiYgbW9kZV9saW5lX3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICB7Cisg ICAgICAgICAgbW9kZV9saW5lX3Jvdy0+eSA9IHliICsgV0lORE9XX1NDUk9MTF9CQVJfQVJFQV9I RUlHSFQgKHcpOworICAgICAgICAgIHVwZGF0ZV93aW5kb3dfbGluZSAodywgTUFUUklYX1JPV19W UE9TIChtb2RlX2xpbmVfcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBkZXNpcmVkX21hdHJpeCksCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wKTsKKyAgICAgICAgfQorCisgICAgICAvKiBG aW5kIGZpcnN0IGVuYWJsZWQgcm93LiAgT3B0aW1pemF0aW9ucyBpbiByZWRpc3BsYXlfaW50ZXJu YWwKKyAgICAgICAgIG1heSBsZWFkIHRvIGFuIHVwZGF0ZSB3aXRoIG9ubHkgb25lIHJvdyBlbmFi bGVkLiAgVGhlcmUgbWF5CisgICAgICAgICBiZSBhbHNvIGNvbXBsZXRlbHkgZW1wdHkgbWF0cmlj ZXMuICovCisgICAgICB3aGlsZSAocm93IDwgZW5kICYmICFyb3ctPmVuYWJsZWRfcCkKKyAgICAg ICAgKytyb3c7CisKKyAgICAgIC8qIFRyeSByZXVzaW5nIHBhcnQgb2YgdGhlIGRpc3BsYXkgYnkg Y29weWluZy4gKi8KKyAgICAgIGlmIChyb3cgPCBlbmQgJiYgIXctPmRlc2lyZWRfbWF0cml4LT5u b19zY3JvbGxpbmdfcCkKKyAgICAgICAgeworICAgICAgICAgIGludCByYyA9IG1jX3Njcm9sbGlu Z193aW5kb3cgKHcsIGhlYWRlcl9saW5lX3JvdyAhPSBOVUxMKTsKKyAgICAgICAgICBpZiAocmMg PCAwKQorICAgICA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CisgICAgICBleGNs dXNpdmVseSB1cG9uIGB3LT5jdXJyZW50X21hdHJpeCcgZm9yIGN1cnNvciByb3cgYmFzZWQgZGVj aXNpb25zLiAqLworICAgICAgZm9yIChzdHJ1Y3QgZ2x5cGhfcm93ICptY19yb3cgPSByb3c7Cisg ICAgICAgICAgIG1jX3JvdyA8IGVuZCAmJiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVuZGluZyk7Cisg ICAgICAgICAgICsrbWNfcm93KQorICAgICAgICB7CisgICAgICAgICAgaW50IHZwb3MgPSBNQVRS SVhfUk9XX1ZQT1MgKG1jX3Jvdywgdy0+ZGVzaXJlZF9tYXRyaXgpOworICAgICAgICAgIGlmICht Y19yb3ctPmVuYWJsZWRfcAorICAgICAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9z KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4ID0gdy0+ZGVzaXJl ZF9tYXRyaXg7CisgICAgICAgICAgICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHBy ZWVtcHRfY291bnQgPT0gMCkKKyAgICAgICAgICAgICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZ19p Z25vcmVfc3F1ZWV6YWJsZXMgKCk7CisgICAgICAgICAgICAgIGNoYW5nZWRfcCB8PSBtY191cGRh dGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3AsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRy aXgsICplc3NlbnRpYWxzLCBkcmF3X3ApOworICAgICAgICAgICAgICBpZiAoTUFUUklYX1JPV19C T1RUT01fWSAocm93KSA+PSB5YikKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gdnBvcyAr IDE7IGkgPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAgICAg ICAgICBTRVRfTUFUUklYX1JPV19FTkFCTEVEX1AgKHctPmN1cnJlbnRfbWF0cml4LCBpLCBmYWxz ZSk7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAg ICBjdXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAvKiBVcGRhdGUgdGhl IHJlc3Qgb2YgdGhlIGxpbmVzLiAqLworICAgICAgZm9yICg7IHJvdyA8IGVuZCAmJiAoZm9yY2Vf cCB8fCAhaW5wdXRfcGVuZGluZyk7ICsrcm93KQorICAgICAgICAvKiBzY3JvbGxpbmdfd2luZG93 IHJlc2V0cyB0aGUgZW5hYmxlZF9wIGZsYWcgb2YgdGhlIHJvd3MgaXQgcmV1c2VzIGZyb20KKyAg ICAgICAgY3VycmVudF9tYXRyaXguICovCisgICAgICAgIGlmIChyb3ctPmVuYWJsZWRfcCkKKyAg ICAgICAgICB7CisgICAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCB3 LT5kZXNpcmVkX21hdHJpeCk7CisgICAgICAgICAgICAvKiBJZiB0aGUgYGN1cnNvcl9yb3dgIGlz IHdpdGhpbiB0aGUgYGRlc2lyZWRfbWF0cml4YCwgdGhlbiBpdCB3YXMKKyAgICAgICAgICAgIHBy b2Nlc3NlZCBoZXJlaW5hYm92ZSBhbmQgc2hvdWxkIGJlIHNraXBwZWQgYXQgdGhpcyB0aW1lLiAq LworICAgICAgICAgICAgaWYgKHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICBj b250aW51ZTsKKyAgICAgICAgICAgIGludCBpOworICAgICAgICAgICAgLyogV2UnbGwgaGF2ZSB0 byBwbGF5IGEgbGl0dGxlIGJpdCB3aXRoIHdoZW4gdG8KKyAgICAgICAgICAgICAgIGRldGVjdF9p bnB1dF9wZW5kaW5nLiAgSWYgaXQncyBkb25lIHRvbyBvZnRlbiwKKyAgICAgICAgICAgICAgIHNj cm9sbGluZyBsYXJnZSB3aW5kb3dzIHdpdGggcmVwZWF0ZWQgc2Nyb2xsLXVwCisgICAgICAgICAg ICAgICBjb21tYW5kcyB3aWxsIHRvbyBxdWlja2x5IHBhdXNlIHJlZGlzcGxheS4gKi8KKyAgICAg ICAgICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkK KyAgICAgICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgp OworICAgICAgICAgICAgY2hhbmdlZF9wIHw9IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAodywgdnBv cywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsICplc3NlbnRpYWxzLCBkcmF3X3Ap OworICAgICAgICAgICAgLyogTWFyayBhbGwgcm93cyBiZWxvdyB0aGUgbGFzdCB2aXNpYmxlIG9u ZSBpbiB0aGUgY3VycmVudAorICAgICAgICAgICAgICAgbWF0cml4IGFzIGludmFsaWQuICBUaGlz IGlzIG5lY2Vzc2FyeSBiZWNhdXNlIG9mCisgICAgICAgICAgICAgICB2YXJpYWJsZSBsaW5lIGhl aWdodHMuICBDb25zaWRlciB0aGUgY2FzZSBvZiB0aHJlZQorICAgICAgICAgICAgICAgc3VjY2Vz c2l2ZSByZWRpc3BsYXlzLCB3aGVyZSB0aGUgZmlyc3QgZGlzcGxheXMgNQorICAgICAgICAgICAg ICAgbGluZXMsIHRoZSBzZWNvbmQgMyBsaW5lcywgYW5kIHRoZSB0aGlyZCA1IGxpbmVzIGFnYWlu LgorICAgICAgICAgICAgICAgSWYgdGhlIHNlY29uZCByZWRpc3BsYXkgd291bGRuJ3QgbWFyayBy b3dzIGluIHRoZQorICAgICAgICAgICAgICAgY3VycmVudCBtYXR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ibGVkX3BgLiAqLworICAgICAgZm9yIChzdHJ1Y3QgZ2x5cGhfcm93ICpkZXNpcmVkX3Jv dyA9IE1BVFJJWF9ST1cgKHctPmRlc2lyZWRfbWF0cml4LCAwKTsKKyAgICAgICAgICAgZGVzaXJl ZF9yb3cgPCBlbmQKKyAgICAgICAgICAgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3BlbmRpbmcpCisg ICAgICAgICAgIC8qIFczMiBFbWFjcyBjcmFzaGVzIG9uIHN0YXJ0dXAgd2l0aG91dCBhIEJVRkZF UlAgY2hlY2suICovCisgICAgICAgICAgICYmIEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAg ICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisg ICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9z c2hhaXJzKSkKKyAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGZjX3Zpc2libGUpKSk7CisgICAgICAgICAgICsrZGVzaXJlZF9yb3cpCisgICAgICAg IHsKKyAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAoZGVzaXJlZF9yb3csIHct PmRlc2lyZWRfbWF0cml4KTsKKyAgICAgICAgICBpZiAoZGVzaXJlZF9yb3ctPmVuYWJsZWRfcCkK KyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKmJvdHRv bV9yb3cgPSBNQVRSSVhfQk9UVE9NX1RFWFRfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgdyk7Cisg ICAgICAgICAgaW50IGJvdHRvbV92cG9zID0gTUFUUklYX1JPV19WUE9TIChib3R0b21fcm93LCB3 LT5jdXJyZW50X21hdHJpeCk7CisgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAq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1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIC8qIFN0cnVjdHVyZSB0byBwYXNzIGRpbWVuc2lvbnMgYXJvdW5k LiAgVXNlZCBmb3IgY2hhcmFjdGVyIGJvdW5kaW5nCiAgICBib3hlcywgZ2x5cGggbWF0cml4IGRp bWVuc2lvbnMgYW5kIGFsaWtlLiAgKi8KIApAQCAtMzM4Nyw2ICs1MTgzLDI2IEBAIGNoZWNrX2N1 cnJlbnRfbWF0cml4X2ZsYWdzIChzdHJ1Y3Qgd2luZG93ICp3KQogc3RhdGljIGJvb2wKIHVwZGF0 ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIHsKKworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpZiAodHJhY2Vf cmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAidXBkYXRlX3dpbmRvdyAoJXMpXG4i LCBtY193aW5kb3cgKHcpKTsKKworICBib29sIGRyYXdfcCA9IHRydWU7CisKKyAgc3RydWN0IG1j X2Vzc2VudGlhbHMgZXNzZW50aWFsczsKKyAgbWNfdXBkYXRlX3dpbmRvd19kcnlydW4gKHcsIGZv cmNlX3AsICZlc3NlbnRpYWxzKTsKKworICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpjdXJzb3JfbWF0 cml4ID0gTlVMTDsKKworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAo dykpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKio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ZSwgd2UgbXVz dCBub3cgcmVseQorICBleGNsdXNpdmVseSB1cG9uIGB3LT5jdXJyZW50X21hdHJpeCcgZm9yIGN1 cnNvciByb3cgYmFzZWQgZGVjaXNpb25zLiAqLworICBmb3IgKHN0cnVjdCBnbHlwaF9yb3cgKm1j X3JvdyA9IHJvdzsKKyAgICAgICBtY19yb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3Bl bmRpbmcpOworICAgICAgICsrbWNfcm93KQorICAgIHsKKyAgICAgIGludCB2cG9zID0gTUFUUklY X1JPV19WUE9TIChtY19yb3csIGRlc2lyZWRfbWF0cml4KTsKKyAgICAgIGlmIChtY19yb3ctPmVu YWJsZWRfcAorICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgIHsK KyAgICAgICAgICBjdXJzb3JfbWF0cml4ID0gZGVzaXJlZF9tYXRyaXg7CisgICAgICAgICAgaWYg KCFmb3JjZV9wICYmICsrbl91cGRhdGVkICUgcHJlZW1wdF9jb3VudCA9PSAwKQorICAgICAgICAg ICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgpOworICAgICAgICAg IGNoYW5nZWRfcCB8PSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAg ICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgISBO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkpCisgICAgICAg ICAgICAgICAgICAgICAgID8gbWNfdXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLCAmbW91c2Vf ZmFjZV9vdmVyd3JpdHRlbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgZHJhd19wKQorICAgICAgICAg ICAgICAgICAgICAgICA6IHVwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vf b3ZlcndyaXR0ZW5fcCk7CisgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKHJvdykg Pj0geWIpCisgICAgICAgICAgICBmb3IgKGludCBpID0gdnBvcyArIDE7IGkgPCB3LT5jdXJyZW50 X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAgICAgIFNFVF9NQVRSSVhfUk9XX0VO QUJMRURfUCAody0+Y3VycmVudF9tYXRyaXgsIGksIGZhbHNlKTsKKyAgICAgICAgICBicmVhazsK KyAgICAgICAgfQorICAgIH0KKworICBjdXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIC8qIFVwZGF0ZSB0aGUgcmVz dCBvZiB0aGUgbGluZXMuICAqLwogICAgICAgZm9yICg7IHJvdyA8IGVuZCAmJiAoZm9yY2VfcCB8 fCAhaW5wdXRfcGVuZGluZyk7ICsrcm93KQogCS8qIHNjcm9sbGluZ193aW5kb3cgcmVzZXRzIHRo ZSBlbmFibGVkX3AgZmxhZyBvZiB0aGUgcm93cyBpdApAQCAtMzQ2Nyw2ICs1MzI0LDE5IEBAIHVw ZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIAlpZiAocm93LT5l bmFibGVkX3ApCiAJICB7CiAJICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIGRl c2lyZWRfbWF0cml4KTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKworICAgICAgICAgIC8qIElmIHRoZSBgY3Vyc29yX3Jvd2AgaXMgd2l0aGlu IHRoZSBgZGVzaXJlZF9tYXRyaXhgLCB0aGVuIGl0IHdhcworICAgICAgICAgIHByb2Nlc3NlZCBo ZXJlaW5hYm92ZSBhbmQgc2hvdWxkIGJlIHNraXBwZWQgYXQgdGhpcyB0aW1lLiAqLworICAgICAg ICAgIGlmICh2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICAgIGNvbnRpbnVlOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgIGludCBpOwogCiAJICAgIC8qIFdlJ2xs IGhhdmUgdG8gcGxheSBhIGxpdHRsZSBiaXQgd2l0aCB3aGVuIHRvCkBAIC0zNDc1LDggKzUzNDUs MjEgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogCSAg ICAgICBjb21tYW5kcyB3aWxsIHRvbyBxdWlja2x5IHBhdXNlIHJlZGlzcGxheS4gICovCiAJICAg IGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkKIAkgICAg ICBkZXRlY3RfaW5wdXRfcGVuZGluZ19pZ25vcmVfc3F1ZWV6YWJsZXMgKCk7Ci0JICAgIGNoYW5n ZWRfcCB8PSB1cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsCi0JCQkJCSAgICAgJm1vdXNlX2Zh Y2Vfb3ZlcndyaXR0ZW5fcCk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgICAgICAgICBjaGFuZ2VkX3AgfD0gKEJVRkZFUlAgKHctPmNv bnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8 ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHx8ICEgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBmY192aXNpYmxlKSkpKQorICAgICAgICAgICAgICAgICAgICAgICA/IG1jX3VwZGF0ZV93 aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVz c2VudGlhbHMsIGRyYXdfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgOiB1cGRhdGVfd2luZG93 X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3ApOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKwogCiAJICAgIC8qIE1hcmsgYWxsIHJvd3MgYmVsb3cgdGhlIGxhc3Qg dmlzaWJsZSBvbmUgaW4gdGhlIGN1cnJlbnQKIAkgICAgICAgbWF0cml4IGFzIGludmFsaWQuICBU aGlzIGlzIG5lY2Vzc2FyeSBiZWNhdXNlIG9mCkBAIC0zNDk3LDYgKzUzODAsNDIgQEAgdXBkYXRl X3dpbmRvdyAoc3RydWN0IHdpbmR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C VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICB8fCAh TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpOworICAgICAg ICsrZGVzaXJlZF9yb3cpCisgICAgeworICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1Mg KGRlc2lyZWRfcm93LCBkZXNpcmVkX21hdHJpeCk7CisgICAgICBpZiAoZGVzaXJlZF9yb3ctPmVu YWJsZWRfcCkKKyAgICAgICAgY29udGludWU7CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpib3R0 b21fcm93ID0gTUFUUklYX0JPVFRPTV9URVhUX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIHcpOwor ICAgICAgaW50IGJvdHRvbV92cG9zID0gTUFUUklYX1JPV19WUE9TIChib3R0b21fcm93LCB3LT5j dXJyZW50X21hdHJpeCk7CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJyZW50X3JvdyA9IE1B VFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAgICAgIGlmIChjdXJyZW50X3Jv dy0+ZW5hYmxlZF9wKQorICAgICAgICBtY19kcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgs IGN1cnJlbnRfcm93LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAg ICAgICAgICAgICBjdXJyZW50X3Jvdy0+eCwgY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXSwg dnBvcywKKyAgICAgICAgICAgICAgICAgICAgIGJvdHRvbV92cG9zLCBjdXJzb3JfbWF0cml4LCBl c3NlbnRpYWxzLCBkcmF3X3AsIFNFVF9DVVJTT1JfVFdPKTsKKyAgICB9CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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UgYmVjYXVzZSBvdmVybGFwcGVkX3AgaW4gZGVzaXJlZCByb3dzIGlzIDAsIHNv IGFmdGVyIHJvdyBhc3NpZ25tZW50CitvdmVybGFwcGVkX3AgaW4gY3VycmVudCByb3dzIGlzIDAu ICovCisgIGZvciAoaW50IGkgPSAwOyBpIDwgdy0+Y3VycmVudF9tYXRyaXgtPm5yb3dzOyArK2kp CisgICAgeworICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93ID0gdy0+Y3VycmVudF9tYXRyaXgt PnJvd3MgKyBpOworICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgYnJlYWs7Cisg ICAgICAgIGVsc2UgaWYgKHJvdy0+bW9kZV9saW5lX3ApCisgICAgICAgICAgY29udGludWU7Cisg ICAgICBpZiAocm93LT5vdmVybGFwcGVkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBmb3IgKGVu dW0gZ2x5cGhfcm93X2FyZWEgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FS RUE7ICsrYXJlYSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90 byAodywgaSwgMCwgcm93LT55LCBhcmVhID09IFRFWFRfQVJFQSA/IHJvdy0+eCA6IDApOworICAg ICAgICAgICAgICBpZiAoKHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVdID4gMCB8 fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NBQ0hFXSA+IDAgfHwgdy0+bWNfbWF0cml4 LmN1cnNvcnNfdXNlZFtGQ19DQUNIRV0gPiAwKQorICAgICAgICAgICAgICAgICAgJiYgYXJlYSA9 PSBURVhUX0FSRUEKKyAgICAgICAgICAgICAgICAgICYmIHJvdy0+dXNlZFthcmVhXSkKKyAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRy aXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgICAgICAgICAgICAgIGludCBzdGFydF94ID0g cm93LT54OworICAgICAgICAgICAgICAgICAgaW50IHN0YXJ0X2hwb3MgPSAwOworICAgICAgICAg ICAgICAgICAgaW50IGVuZF9ocG9zID0gcm93LT51c2VkW2FyZWFdOworICAgICAgICAgICAgICAg ICAgYm9vbCBjbGVhcl9lb2xfcCA9IHRydWU7CisgICAgICAgICAgICAgICAgICBlbnVtIGRyYXdf Z2x5cGhzX2ZhY2UgaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgICAgICAgICAgICAgbWNf cmVkcmF3X3JvdyAodywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9z LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJfZW9sX3AsIGhsKTsKKyAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZiAocm93LT51c2VkW2FyZWFd KQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRV9SSUYgKGYp LT53cml0ZV9nbHlwaHMgKHcsIHJvdywgcm93LT5nbHlwaHNbYXJlYV0sIGFyZWEsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT51c2VkW2FyZWFd KTsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVfUklGIChmKS0+Y2xlYXJfZW5kX29mX2xpbmUg KHcsIHJvdywgYXJlYSwgLTEpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQor ICAgICAgICAgIHJvdy0+b3ZlcmxhcHBlZF9wID0gMDsKKyAgICAgICAgfQorICAgICAgaWYgKE1B VFJJWF9ST1dfQk9UVE9NX1kgKHJvdykgPj0geWIpCisgICAgICAgIGJyZWFrOworICAgIH0KKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICAgIHJlZHJhd19vdmVybGFwcGluZ19y b3dzICh3LCB5Yik7CiAJICAgIH0KICNlbmRpZgpAQCAtMzUzMSwxMCArNTUwMSwyMSBAQCB1cGRh dGVfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAgICAgICBzdHJjcHkg KHctPmN1cnJlbnRfbWF0cml4LT5tZXRob2QsIHctPmRlc2lyZWRfbWF0cml4LT5tZXRob2QpOwog I2VuZGlmCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KKyAgaWYgKEJVRkZFUlAgKHctPmNvbnRl bnRzKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3No YWlycykpKQorICAgIG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgMCk7CisgICAgZWxzZQog ICAgICAgdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCAwKTsKICNlbmRpZgogCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAgICAgICAvKiBFbmQgdGhlIHVwZGF0ZSBvZiB3aW5kb3cgVy4g IERvbid0IHNldCB0aGUgY3Vyc29yIGlmIHdlCiAgICAgICAgICBwYXVzZWQgdXBkYXRpbmcgdGhl IGRpc3BsYXkgYmVjYXVzZSBpbiB0aGlzIGNhc2UsCiAgICAgICAgICBzZXRfd2luZG93X2N1cnNv cl9hZnRlcl91cGRhdGUgaGFzbid0IGJlZW4gY2FsbGVkLCBhbmQKZGlmZiAtLWdpdCBhL3NyYy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zKS9CWVRFU19QRVJfQklUTUFQX1JPVykKICNkZWZpbmUgRlJC SVRTKGJpdHMpICBiaXRzLCBTVEFOREFSRF9CSVRNQVBfSEVJR0hUIChiaXRzKQogCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBg Ky1mcmluZ2UtaGVscGVyLWRlY2ltYWwnIGRlZmluZWQgaW4gYGNyb3NzaGFpcnMuZWxgICovCisK Ky8qIFRPRE86ICBDb25zaWRlciBhZGRpbmcgdGhlIGZvbGxvd2luZyBmcmluZ2UgYml0bWFwczoK KyAgKGRlZmluZS1mcmluZ2UtYml0bWFwICdicmVha3BvaW50ICJceDNjXHg3ZVx4ZmZceGZmXHhm Zlx4ZmZceDdlXHgzYyIpCisgIChkZWZpbmUtZnJpbmdlLWJpdG1hcCAnaG9sbG93LXJpZ2h0LXRy aWFuZ2xlICJceGUwXHg5MFx4ODhceDg0XHg4NFx4ODhceDkwXHhlMCIpICovCisKKy8qIDI0Cisg ICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInguLi4uLi4uIgorICAgICAg InguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgIngu Li54eC4uIgorICAgICAgInguLi4ueHguIgorICAgICAgIngueHh4eHh4IgorICAgICAgIngueHh4 eHh4IgorICAgICAgInguLi4ueHguIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLnh4Li4u IgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIikK KyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93X2Jp dHNbXSA9eworICAweDgwLCAweDgwLCAweDgwLCAweDk4LCAweDhjLCAweDg2LCAweGJmLAorICAw eGJmLCAweDg2LCAweDhjLCAweDk4LCAweDgwLCAweDgwLCAweDgwfTsKKworLyogMjUKKyAgICAo Ky1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4u Li4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLnh4Li4ueHgiCisgICAgICAiLi54eC4u eHgiCisgICAgICAiLi4ueHgueHgiCisgICAgICAieHh4eHh4eHgiCisgICAgICAieHh4eHh4eHgi CisgICAgICAiLi4ueHgueHgiCisgICAgICAiLi54eC4ueHgiCisgICAgICAiLnh4Li4ueHgiCisg ICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiKQorKi8K K3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19yZXZlcnNlZF92ZXJ0aWNhbF9iYXJfcmlnaHRfYXJy b3dfYml0c1tdID17CisgIDB4MywgMHgzLCAweDMsIDB4NjMsIDB4MzMsIDB4MWIsIDB4ZmYsIDB4 ZmYsIDB4MWIsIDB4MzMsIDB4NjMsIDB4MywgMHgzLCAweDN9OworCisvKiAyNgorICAgICgrLWZy aW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4eHh4eHh4eCIKKyAgICAgICJ4Li4uLi4u eCIKKyAgICAgICJ4Li4uLi4ueCIKKyAgICAgICJ4Li54eC4ueCIKKyAgICAgICJ4Li4ueHgueCIK KyAgICAgICJ4Li4uLnh4eCIKKyAgICAgICJ4Lnh4eHh4eCIKKyAgICAgICJ4Lnh4eHh4eCIKKyAg ICAgICJ4Li4uLnh4eCIKKyAgICAgICJ4Li4ueHgueCIKKyAgICAgICJ4Li54eC4ueCIKKyAgICAg ICJ4Li4uLi4ueCIKKyAgICAgICJ4Li4uLi4ueCIKKyAgICAgICJ4eHh4eHh4eCIpCisqLworc3Rh dGljIHVuc2lnbmVkIHNob3J0IG1jX2hvbGxvd19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i4uLnh4Igor ICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAg ICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAg Ii4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQg bWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX2JpdHNbXSA9eworICAweDMsIDB4MywgMHgzLCAweDMs IDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4M307CisKKy8q IDMxCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgor ICAgICAgInh4Li4uLi4uIgorICAgICAgIiB4eC4uLi4uIgorICAgICAgIi54eC4uLi4uIgorICAg ICAgIi4ueHguLi4uIgorICAgICAgIi4ueHguLi4uIgorICAgICAgIi4uLnh4Li4uIgorICAgICAg Ii4uLnh4Li4uIgorICAgICAgIi4uLi54eC4uIgorICAgICAgIi4uLi54eC4uIgorICAgICAgIi4u Li4ueHguIgorICAgICAgIi4uLi4ueHguIgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4u Lnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfYmFja3NsYXNoX2JpdHNbXSA9ewor ICAweGMwLCAweGMwLCAweGUwLCAweDYwLCAweDMwLCAweDMwLCAweDE4LCAweDE4LCAweGMsIDB4 YywgMHg2LCAweDYsIDB4MywgMHgzfTsKKworLyogMzIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhl eGFkZWNpbWFsCisgICAgICAieHguLi4uLi4iCisgICAgICAieHguLi4uLi4iCisgICAgICAieHh4 Li4uLi4iCisgICAgICAieHh4Li4uLi4iCisgICAgICAieC54eC4uLi4iCisgICAgICAieC54eC4u Li4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4uLnh4Li4i CisgICAgICAieC4uLnh4Li4iCisgICAgICAieC4uLi54eC4iCisgICAgICAieC4uLi54eC4iCisg ICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY192ZXJ0aWNhbF9iYXJfYmFja3NsYXNoX2JpdHNbXSA9eworICAweGMwLCAweGMwLCAw eGUwLCAweGUwLCAweGIwLCAweGIwLCAweDk4LAorICAweDk4LCAweDhjLCAweDhjLCAweDg2LCAw eDg2LCAweDgzLCAweDgzfTsKKworLyogMzMKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNp bWFsCisgICAgICAiLnh4eHh4eC4iCisgICAgICAieHh4eC54Li4iCisgICAgICAieHh4eC54Li4i CisgICAgICAieHh4eC54Li4iCisgICAgICAiLnh4eC54Li4iCisgICAgICAiLi4ueC54Li4iCisg ICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAg ICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9y dCBtY19waWxjcm93X2JpdHNbXSA9eworICAweDdlLCAweGY0LCAweGY0LCAweGY0LCAweDc0LCAw eDE0LCAweDE0LCAweDE0LCAweDE0LCAweDE0LCAweDE0fTsKKworLyogMzQKKyAgICAoKy1mcmlu Z2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi54eHh4Li4iCisgICAgICAiLnh4eHh4eC4i CisgICAgICAieC4ueHguLngiCisgICAgICAieC4ueHguLngiCisgICAgICAieHh4eHh4eHgiCisg ICAgICAieHguLi4ueHgiCisgICAgICAieHh4Li54eHgiCisgICAgICAiLnh4eHh4eC4iCisgICAg ICAiLi54eHh4Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zbWlsZXlfZmFjZV9i aXRzW10gPXsKKyAgMHgzYywgMHg3ZSwgMHg5OSwgMHg5OSwgMHhmZiwgMHhjMywgMHhlNywgMHg3 ZSwgMHgzY307CisKKy8qIDM1CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAg ICAgIi4ueC4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAg Ii4uLi4ueC4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4u eC4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX3JpZ2h0 X2JpdHNbXSA9eworICAweDIwLCAweDEwLCAweDgsIDB4NCwgMHg4LCAweDEwLCAweDIwfTsKKwor LyogMzYKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi54Li4i CisgICAgICAiLi4uLnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54Li4uLi4iCisg ICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLnguLi4iCisgICAgICAiLi4uLi54Li4iKQorKi8K K3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAg MHg0LCAweDgsIDB4MTAsIDB4MjAsIDB4MTAsIDB4OCwgMHg0fTsKKworLyogMzcKKyAgICAoKy1m cmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHgueHguLi4iCisgICAgICAiLnh4Lnh4 Li4iCisgICAgICAiLi54eC54eC4iCisgICAgICAiLi4ueHgueHgiCisgICAgICAiLi54eC54eC4i CisgICAgICAiLnh4Lnh4Li4iCisgICAgICAieHgueHguLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25l ZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfcmlnaHRfYml0c1tdID17CisgIDB4ZDgsIDB4NmMsIDB4 MzYsIDB4MWIsIDB4MzYsIDB4NmMsIDB4ZDh9OworCisvKiAzOAorICAgICgrLWZyaW5nZS1oZWxw ZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi54eC54eCIKKyAgICAgICIuLnh4Lnh4LiIKKyAgICAg ICIueHgueHguLiIKKyAgICAgICJ4eC54eC4uLiIKKyAgICAgICIueHgueHguLiIKKyAgICAgICIu Lnh4Lnh4LiIKKyAgICAgICIuLi54eC54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1j X2RvdWJsZV9hbmdsZV9sZWZ0X2JpdHNbXSA9eworICAweDFiLCAweDM2LCAweDZjLCAweGQ4LCAw eDZjLCAweDM2LCAweDFifTsKKworLyogMzkKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNp bWFsCisgICAgICAieC54LnguLi4iCisgICAgICAiLngueC54Li4iCisgICAgICAiLi54LngueC4i CisgICAgICAiLi4ueC54LngiCisgICAgICAiLi54LngueC4iCisgICAgICAiLngueC54Li4iCisg ICAgICAieC54LnguLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5n bGVfcmlnaHRfYml0c1tdID17CisgIDB4YTgsIDB4NTQsIDB4MmEsIDB4MTUsIDB4MmEsIDB4NTQs IDB4YTh9OworCisvKiA0MAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAg ICIuLi54LngueCIKKyAgICAgICIuLngueC54LiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICJ4 LngueC4uLiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICIuLngueC54LiIKKyAgICAgICIuLi54 LngueCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBsZV9hbmdsZV9sZWZ0X2Jp dHNbXSA9eworICAweDE1LCAweDJhLCAweDU0LCAweGE4LCAweDU0LCAweDJhLCAweDE1fTsKKwor LyogNDEKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4i CisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisg ICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAg ICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAi Li4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBt Y19zaW5nbGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4 MTAsIDB4MjgsIDB4NDQsIDB4ODIsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9OworCisvKiA0Mgor ICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAg ICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4 Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54 Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4u LiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3Npbmds ZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDgyLCAw eDQ0LCAweDI4LCAweDEwLCAweDAwLCAweDAwLCAweDAwLCAweDAwfTsKKworLyogNDMKKyAgICAo Ky1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4u Li4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54Lngu Li4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4i CisgICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iCisg ICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY19kb3VibGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4 MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4ODIsIDB4MDAsIDB4MDAsIDB4MDB9 OworCisvKiA0NAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4u Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54 LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIK KyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAg ICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLwor c3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAw eDAwLCAweDAwLCAweDAwLCAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDEw LCAweDAwLCAweDAwLCAweDAwfTsKKworLyogNDUKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFk ZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54Lngu Li4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4i CisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisg ICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iKQorKi8K K3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4 MDAsIDB4MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQs IDB4ODIsIDB4MDB9OworCisvKiA0NgorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwK KyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAg ICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAg ICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIu LngueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGlj IHVuc2lnbmVkIHNob3J0IG1jX3F1YWRydXBsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDAw LCAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAw eDEwLCAweDAwfTsKKworLyogNDcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisg ICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAg ICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAi eC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4u eC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4u eC4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVwbGVfYW5nbGVfdXBfYml0 c1tdID17CisgIDB4MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4OTIsIDB4Mjgs IDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4ODJ9OworCisvKiA0OAorICAgICgrLWZyaW5nZS1o ZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAg ICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAg ICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIu LngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngu eC4uLiIKKyAgICAgICIuLi54Li4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3Ry aXBsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0 LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDEwfTsKKwogLyog Tk9URTogIFRoZSBvcmRlciBvZiB0aGVzZSBiaXRtYXBzIG11c3QgbWF0Y2ggdGhlIHNlcXVlbmNl CiAgICB1c2VkIGluIGZyaW5nZS5lbCB0byBkZWZpbmUgdGhlIGNvcnJlc3BvbmRpbmcgc3ltYm9s cy4gICovCiAKQEAgLTQ2Nyw4ICs5MjEsMTA0OSBAQCBzdGF0aWMgc3RydWN0IGZyaW5nZV9iaXRt YXAgc3RhbmRhcmRfYml0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J0aWFsX3ApCit7CisgIExpc3BfT2JqZWN0IGNtYXAsIGJtMSA9IFFuaWwsIGJtMiA9IFFu aWwsIGJtOworICBFTUFDU19JTlQgbG4xID0gMCwgbG4yID0gMDsKKyAgaW50IGl4MSA9IHJpZ2h0 X3A7CisgIGludCBpeDIgPSBpeDEgKyAocGFydGlhbF9wID8gMiA6IDApOworICBpZiAoKGNtYXAg PSBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKSwg IU5JTFAgKGNtYXApKQorICAgIHsKKyAgICAgIGJtMSA9IG1jX2Fzc3EgKGJpdG1hcCwgY21hcCk7 CisgICAgICBpZiAoQ09OU1AgKGJtMSkpCisgIHsKKyAgICBpZiAoKGJtMSA9IFhDRFIgKGJtMSkp LCBOSUxQIChibTEpKQorICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgaWYg KENPTlNQIChibTEpKQorICAgICAgeworICAgICAgICBsbjEgPSBYRklYTlVNIChGbGVuZ3RoIChi bTEpKTsKKyAgICAgICAgaWYgKHBhcnRpYWxfcCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBp ZiAobG4xID4gaXgyKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYm0gPSBtY19u dGggKGl4MiwgYm0xKTsKKyAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAg ICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAg ICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChsbjEgPiBpeDEpCisgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAg ICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICBnb3RvIGZv dW5kOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgfQorICAgIGVsc2UgaWYg KChibSA9IGJtMSwgIUVRIChibSwgUXQpKSkKKyAgICAgIGdvdG8gZm91bmQ7CisgIH0KKyAgICB9 CisgIGlmICghRVEgKGNtYXAsIEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0 b3JfYWxpc3QpKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5n ZV9pbmRpY2F0b3JfYWxpc3QpKSkKKyAgICB7CisgICAgICBibTIgPSBtY19hc3NxIChiaXRtYXAs IEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKTsKKyAgICAg IGlmIChDT05TUCAoYm0yKSkKKyAgICAgICAgeworICAgICAgICAgIGlmICgoYm0yID0gWENEUiAo Ym0yKSksICFOSUxQIChibTIpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoQ09O U1AgKGJtMikpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgbG4yID0gWEZJ WE5VTSAoRmxlbmd0aCAoYm0yKSk7CisgICAgICAgICAgICAgICAgICBpZiAocGFydGlhbF9wKQor ICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKGxuMiA+IGl4 MikKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAg Ym0gPSBtY19udGggKGl4MiwgYm0yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFF USAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAg ICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBpZiAobG4xID4gaXgx KQorICAgIHsKKyAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICBpZiAoIUVRIChi bSwgUXQpKQorICAgICAgICBnb3RvIGZvdW5kOworICAgIH0KKyAgaWYgKGxuMiA+IGl4MSkKKyAg ICB7CisgICAgICBibSA9IG1jX250aCAoaXgxLCBibTIpOworICAgICAgaWYgKCFFUSAoYm0sIFF0 KSkKKyAgICAgICAgZ290byBmb3VuZDsKKyAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQ OworICAgIH0KKyAgICBlbHNlIGlmICgoYm0gPSBibTIsIE5JTFAgKGJtKSkpCisgICAgICByZXR1 cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgZm91bmQ6CisgIHJldHVybiBsb29rdXBfZnJpbmdl X2JpdG1hcCAoYm0pOworfQorCitzdGF0aWMgaW50CittY19nZXRfbG9naWNhbF9jdXJzb3JfYml0 bWFwIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNwX09iamVjdCBjdXJzb3IpCit7CisgIExpc3BfT2Jq ZWN0IGNtYXAsIGJtID0gUW5pbDsKKyAgaWYgKChjbWFwID0gQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBmcmluZ2VfY3Vyc29yX2FsaXN0KSksICFOSUxQIChjbWFwKSkKKyAgICB7CisgICAg ICBibSA9IG1jX2Fzc3EgKGN1cnNvciwgY21hcCk7CisgICAgICBpZiAoQ09OU1AgKGJtKSkKKyAg ICAgICAgeworICAgICAgICAgIGlmICgoYm0gPSBYQ0RSIChibSkpLCBOSUxQIChibSkpCisgICAg ICAgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICByZXR1cm4gbG9v a3VwX2ZyaW5nZV9iaXRtYXAgKGJtKTsKKyAgICAgICAgfQorICAgIH0KKyAgaWYgKEVRIChjbWFw LCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfY3Vyc29yX2FsaXN0KSkpCisgICA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ICAgIElmIHBhcnRpYWwsIGxvb2t1cCBwYXJ0aWFsIGJpdG1hcCBpbiBkZWZhdWx0IHZhbHVlIGlm IG5vdCBmb3VuZCBoZXJlLgorICAgICBJZiBub3QgcGFydGlhbCwgb3Igbm8gcGFydGlhbCBzcGVj IGlzIHByZXNlbnQsIHVzZSBub24tcGFydGlhbCBiaXRtYXAuICAqLworICBpZiAoKGNtYXAgPSBC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKSwgIU5J TFAgKGNtYXApKQorICAgIHsKKyAgICAgIGJtMSA9IG1jX2Fzc3EgKGJpdG1hcCwgY21hcCk7Cisg ICAgICBpZiAoQ09OU1AgKGJtMSkpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoKGJtMSA9IFhD RFIgKGJtMSkpLCBOSUxQIChibTEpKQorICAgICAgICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9C SVRNQVA7CisgICAgICAgICAgaWYgKENPTlNQIChibTEpKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBsbjEgPSBYRklYTlVNIChGbGVuZ3RoIChibTEpKTsKKyAgICAgICAgICAgICAgaWYg KHBhcnRpYWxfcCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAobG4x ID4gaXgyKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgYm0g PSBtY19udGggKGl4MiwgYm0xKTsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwg UXQpKQorICAgICAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChsbjEgPiBpeDEpCisgICAgICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOwor ICAgICAgICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAg ICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAoKGJtID0gYm0xLCAhRVEg KGJtLCBRdCkpKQorICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICB9CisgICAgfQor ICBpZiAoIUVRIChjbWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9y X2FsaXN0KSkKKyAgICAgICYmICFOSUxQIChCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2Vf aW5kaWNhdG9yX2FsaXN0KSkpCisgICAgeworICAgICAgYm0yID0gbWNfYXNzcSAoYml0bWFwLCBC VkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSk7CisgICAgICBp ZiAoQ09OU1AgKGJtMikpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoKGJtMiA9IFhDRFIgKGJt MikpLCAhTklMUCAoYm0yKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKENPTlNQ IChibTIpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGxuMiA9IFhGSVhO VU0gKEZsZW5ndGggKGJtMikpOworICAgICAgICAgICAgICAgICAgaWYgKHBhcnRpYWxfcCkKKyAg ICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGlmIChsbjIgPiBpeDIp CisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJt ID0gbWNfbnRoIChpeDIsIGJtMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghRVEg KGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAg ICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4MSkK KyAgICB7CisgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAgICAgaWYgKCFFUSAoYm0s IFF0KSkKKyAgICAgICAgZ290byBmb3VuZDsKKyAgICB9CisgIGlmIChsbjIgPiBpeDEpCisgICAg eworICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0yKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkp CisgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsK KyAgICB9CisgICAgZWxzZSBpZiAoKGJtID0gYm0yLCBOSUxQIChibSkpKQorICAgICAgcmV0dXJu IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgIGZvdW5kOgorICByZXR1cm4gbG9va3VwX2ZyaW5nZV9i aXRtYXAgKGJtKTsKK30KKworLyogUmVjYWxjdWxhdGUgdGhlIGJpdG1hcHMgdG8gc2hvdyBpbiB0 aGUgZnJpbmdlcyBvZiB3aW5kb3cgVy4KKyAgIE9ubHkgbWFyayByb3dzIHdpdGggbW9kaWZpZWQg Yml0bWFwcyBmb3IgdXBkYXRlIGluIHJlZHJhd19mcmluZ2VfYml0bWFwc19wLgorICAgSWYgS0VF UF9DVVJSRU5UX1AgaXMgMCwgdXBkYXRlIGN1cnJlbnRfbWF0cml4IHRvby4gKi8KK2Jvb2wKK21j X3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBrZWVwX2N1cnJl bnRfcCkKK3sKKyAgc3RydWN0IGdseXBoX3JvdyAqcm93LCAqY3VyID0gMDsKKyAgaW50IHliID0g d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luZCA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgaW5kaWNhdGVfYnVm ZmVyX2JvdW5kYXJpZXMpLCAhTklMUCAoaW5kKSkpCisgICAgeworICAgICAgaWYgKEVRIChpbmQs IFFsZWZ0KSB8fCBFUSAoaW5kLCBRcmlnaHQpKQorICAgICAgICBib3VuZGFyeV90b3AgPSBib3Vu ZGFyeV9ib3QgPSBhcnJvd190b3AgPSBhcnJvd19ib3QgPSBpbmQ7CisgICAgICAgIGVsc2UgaWYg KENPTlNQIChpbmQpCisgICAgICAgICAgICAgICAgICYmIENPTlNQIChYQ0FSIChpbmQpKSkKKyAg ICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IHBvczsKKyAgICAgICAgICBpZiAocG9zID0g bWNfYXNzcSAoUXQsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAgYm91bmRhcnlfdG9w ID0gYm91bmRhcnlfYm90ID0gYXJyb3dfdG9wID0gYXJyb3dfYm90ID0gWENEUiAocG9zKTsKKyAg ICAgICAgICBpZiAocG9zID0gbWNfYXNzcSAoUXRvcCwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAg ICAgICAgICBib3VuZGFyeV90b3AgPSBYQ0RSIChwb3MpOworICAgICAgICAgIGlmIChwb3MgPSBt Y19hc3NxIChRYm90dG9tLCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAgIGJvdW5kYXJ5 X2JvdCA9IFhDRFIgKHBvcyk7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFF1cCwgaW5k KSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBhcnJvd190b3AgPSBYQ0RSIChwb3MpOworICAg ICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRZG93biwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAg ICAgICAgICBhcnJvd19ib3QgPSBYQ0RSIChwb3MpOworICAgICAgICB9CisgICAgICAgIGVsc2UK KyAgICAgICAgICAvKiBBbnl0aGluZyBlbHNlIG1lYW5zIGJvdW5kYXJ5IG9uIGxlZnQgYW5kIG5v IGFycm93cy4gICovCisgICAgICAgICAgYm91bmRhcnlfdG9wID0gYm91bmRhcnlfYm90ID0gUWxl ZnQ7CisgICAgfQorICB0b3BfaW5kX3JuID0gYm90X2luZF9ybiA9IC0xOworICBpZiAoIU5JTFAg KGluZCkpCisgICAgeworICAgICAgZm9yICh5ID0gdy0+dnNjcm9sbCwgcm4gPSAwOworICAgICAg ICAgICB5IDwgeWIgJiYgcm4gPCBucm93czsKKyAgICAgICAgICAgeSArPSByb3ctPmhlaWdodCwg KytybikKKyAgICAgICAgeworICAgICAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dz ICsgcm47CisgICAgICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgICAgIHJvdyA9 IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgcm93LT5pbmRpY2F0ZV9i b2JfcCA9IHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCA9IDA7CisgICAgICAgICAgcm93LT5pbmRp Y2F0ZV9lb2JfcCA9IHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCA9IDA7CisgICAgICAgICAg aWYgKCFyb3ctPm1vZGVfbGluZV9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAo dG9wX2luZF9ybiA8IDAgJiYgcm93LT52aXNpYmxlX2hlaWdodCA+IDApCisgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfU1RBUlRfQ0hBUlBPUyAocm93 KSA8PSBCVUZfQkVHViAoWEJVRkZFUiAody0+Y29udGVudHMpKQorICAgICAgICAgICAgICAgICAg ICAgICYmICFNQVRSSVhfUk9XX1BBUlRJQUxMWV9WSVNJQkxFX0FUX1RPUF9QICh3LCByb3cpKQor ICAgICAgICAgICAgICAgICAgICByb3ctPmluZGljYXRlX2JvYl9wID0gIU5JTFAgKGJvdW5kYXJ5 X3RvcCk7CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICBy b3ctPmluZGljYXRlX3RvcF9saW5lX3AgPSAhTklMUCAoYXJyb3dfdG9wKTsKKyAgICAgICAgICAg ICAgICAgIHRvcF9pbmRfcm4gPSBybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg IGlmIChib3RfaW5kX3JuIDwgMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICBpZiAoTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSA+PSBCVUZfWlYgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSkKKyAgICAgICAgICAgICAgICAgICAgICAmJiAhTUFUUklYX1JPV19QQVJUSUFM TFlfVklTSUJMRV9BVF9CT1RUT01fUCAodywgcm93KSkKKyAgICAgICAgICAgICAgICAgICAgcm93 LT5pbmRpY2F0ZV9lb2JfcCA9ICFOSUxQIChib3VuZGFyeV9ib3QpLCBib3RfaW5kX3JuID0gcm47 CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHkgKyByb3ctPmhlaWdodCA+PSB5YikKKyAg ICAgICAgICAgICAgICAgICAgICByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgPSAhTklMUCAo YXJyb3dfYm90KSwgYm90X2luZF9ybiA9IHJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgZW1wdHlfcG9zID0gQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBpbmRpY2F0ZV9lbXB0eV9saW5lcyk7CisgIGlmICghTklMUCAoZW1wdHlfcG9z KSAmJiAhRVEgKGVtcHR5X3BvcywgUXJpZ2h0KSkKKyAgICBlbXB0eV9wb3MgPSBXSU5ET1dfTEVG VF9GUklOR0VfV0lEVEggKHcpID09IDAgPyBRcml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GJuID0gTUNfTk9fRlJJTkdFX0JJVE1B UDsKKyAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgdG9wX2luZF9ybjsKKyAg ICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgIHJvdyA9IHctPmN1cnJlbnRfbWF0cml4 LT5yb3dzICsgdG9wX2luZF9ybjsKKyAgICAgIHRvcF9yb3dfZW5kc19hdF96dl9wID0gcm93LT5l bmRzX2F0X3p2X3A7CisgICAgICBpZiAocm93LT5pbmRpY2F0ZV9ib2JfcCkKKyAgICAgICAgewor ICAgICAgICAgIGlmIChFUSAoYm91bmRhcnlfdG9wLCBRbGVmdCkpCisgICAgICAgICAgICBibiA9 ICgocm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRbGVmdCkpCisgICAg ICAgICAgICAgICAgICA/IE1DX0xFRlRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwgcm93LT5lbmRz X2F0X3p2X3ApCisgICAgICAgICAgICAgICAgICA6IE1DX0xFRlRfRlJJTkdFICgyLCBRdG9wLCAw KSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGJuID0gKChyb3ctPmluZGljYXRl X2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFyaWdodCkpCisgICAgICAgICAgICAgICAgICAg ID8gTUNfUklHSFRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwgcm93LT5lbmRzX2F0X3p2X3ApCisg ICAgICAgICAgICAgICAgICAgIDogTUNfUklHSFRfRlJJTkdFICgyLCBRdG9wLCAwKSk7CisgICAg ICAgIH0KKyAgICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGluZV9wKQorICAgICAg ICAgIHsKKyAgICAgICAgICAgIGlmIChFUSAoYXJyb3dfdG9wLCBRbGVmdCkpCisgICAgICAgICAg ICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICBibiA9IE1DX1JJR0hUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAg ICAgICB9CisgICAgICBpZiAoYm4gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgewor ICAgICAgICAgIHN0cnVjdCBmcmluZ2VfYml0bWFwICpmYiA9IGdldF9mcmluZ2VfYml0bWFwX2Rh dGEgKGJuKTsKKyAgICAgICAgICBpZiAoZmItPmFsaWduID09IEFMSUdOX0JJVE1BUF9UT1AgJiYg ZmItPnBlcmlvZCA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5 cGhfcm93ICpyb3cxOworICAgICAgICAgICAgICBpbnQgdG9wX2luZF9tYXhfeTsKKyAgICAgICAg ICAgICAgdG9wX2luZF9taW5feSA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAg ICAgICAgICAgICB0b3BfaW5kX21heF95ID0gdG9wX2luZF9taW5feSArIGZiLT5oZWlnaHQ7Cisg ICAgICAgICAgICAgIGlmICh0b3BfaW5kX21heF95ID4geWIpCisgICAgICAgICAgICAgICAgdG9w X2luZF9tYXhfeSA9IHliOworICAgICAgICAgICAgICBmb3IgKHkgPSByb3ctPnkgKyByb3ctPmhl aWdodCwgcm4gPSB0b3BfaW5kX3JuICsgMTsKKyAgICAgICAgICAgICAgICAgICB5IDwgdG9wX2lu ZF9tYXhfeSAmJiBybiA8IG5yb3dzOworICAgICAgICAgICAgICAgICAgIHkgKz0gcm93MS0+aGVp Z2h0LCBybisrKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChib3Rf aW5kX3JuID49IDAgJiYgcm4gPj0gYm90X2luZF9ybikKKyAgICAgICAgICAgICAgICAgICAgYnJl YWs7CisgICAgICAgICAgICAgICAgICByb3cxID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBy bjsKKyAgICAgICAgICAgICAgICAgIGlmICghcm93MS0+ZW5hYmxlZF9wKQorICAgICAgICAgICAg ICAgICAgICByb3cxID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICAg ICAgICAgIHJvdzEtPmluZGljYXRlX2JvYl9wID0gcm93LT5pbmRpY2F0ZV9ib2JfcDsKKyAgICAg ICAgICAgICAgICAgIHJvdzEtPmluZGljYXRlX3RvcF9saW5lX3AgPSByb3ctPmluZGljYXRlX3Rv cF9saW5lX3A7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgfQorICBpZiAoYm90X2luZF9ybiA+PSAwKQorICAgIHsKKyAgICAgIGludCBibiA9IE1DX05P X0ZSSU5HRV9CSVRNQVA7CisgICAgICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIGJv dF9pbmRfcm47CisgICAgICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICByb3cgPSB3LT5j dXJyZW50X21hdHJpeC0+cm93cyArIGJvdF9pbmRfcm47CisgICAgICBib3Rfcm93X2VuZHNfYXRf enZfcCA9IHJvdy0+ZW5kc19hdF96dl9wOworICAgICAgaWYgKHJvdy0+aW5kaWNhdGVfZW9iX3Ap CisgICAgICAgIHsKKyAgICAgICAgICBpZiAoRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQpKQorICAg ICAgICAgICAgYm4gPSBNQ19MRUZUX0ZSSU5HRSAoMywgUWJvdHRvbSwgcm93LT5lbmRzX2F0X3p2 X3ApOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBibiA9IE1DX1JJR0hUX0ZSSU5H RSAoMywgUWJvdHRvbSwgcm93LT5lbmRzX2F0X3p2X3ApOworICAgICAgICB9CisgICAgICAgIGVs c2UgaWYgKHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCkKKyAgICAgICAgICB7CisgICAgICAg ICAgICBpZiAoRVEgKGFycm93X2JvdCwgUWxlZnQpKQorICAgICAgICAgICAgICBibiA9IE1DX0xF RlRfRlJJTkdFICg3LCBRZG93biwgMCk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICBibiA9IE1DX1JJR0hUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAgIH0KKyAg ICAgIGlmIChibiAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICB7CisgICAgICAgICAg c3RydWN0IGZyaW5nZV9iaXRtYXAgKmZiID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAoYm4pOwor ICAgICAgICAgIGlmIChmYi0+YWxpZ24gPT0gQUxJR05fQklUTUFQX0JPVFRPTSAmJiBmYi0+cGVy aW9kID09IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cg KnJvdzE7CisgICAgICAgICAgICAgIGludCBib3RfaW5kX21pbl95OworICAgICAgICAgICAgICBi b3RfaW5kX21heF95ID0gcm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdodDsKKyAgICAgICAgICAg ICAgYm90X2luZF9taW5feSA9IGJvdF9pbmRfbWF4X3kgLSBmYi0+aGVpZ2h0OworICAgICAgICAg ICAgICBpZiAoYm90X2luZF9taW5feSA8IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpKQor ICAgICAgICAgICAgICAgIGJvdF9pbmRfbWluX3kgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hU ICh3KTsKKyAgICAgICAgICAgICAgZm9yICh5ID0gcm93LT55LCBybiA9IGJvdF9pbmRfcm4gLSAx OworICAgICAgICAgICAgICAgICAgIHkgPj0gYm90X2luZF9taW5feSAmJiBybiA+PSAwOworICAg ICAgICAgICAgICAgICAgIHkgLT0gcm93MS0+aGVpZ2h0LCBybi0tKQorICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgIGlmICh0b3BfaW5kX3JuID49IDAgJiYgcm4gPD0gdG9wX2lu ZF9ybikKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICByb3cx ID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICAgICAgICAgIGlmICgh cm93MS0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgICAgICAgICByb3cxID0gdy0+Y3VycmVudF9t YXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICAgICAgICAgIHJvdzEtPmluZGljYXRlX2VvYl9w ID0gcm93LT5pbmRpY2F0ZV9lb2JfcDsKKyAgICAgICAgICAgICAgICAgIHJvdzEtPmluZGljYXRl X2JvdHRvbV9saW5lX3AgPSByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3A7CisgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBMaXNwX09iamVjdCBi dWYgPSB3LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYpOworICBib29sIGF1dG9faHNj cm9sbF9tb2RlX3AgPSBFUSAoRmJ1ZmZlcl9sb2NhbF92YWx1ZSAoUWF1dG9faHNjcm9sbF9tb2Rl LCBidWYpLCBRY3VycmVudF9saW5lKTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwtbGVmdCA1KSAq LworICBib29sIGhzY2xfYWxsX3RlbXBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPm1pbl9oc2Nyb2xsID09IDApOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFu ZCBkbyBub3RoaW5nLiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMF9wID0gKHctPnN1c3BlbmRf YXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xs X21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9sbCk7Cisg IC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyBlbHNlIGJlc2lkZXMgaG9y aXpvbnRhbGx5IHNjcm9sbGluZyB0aGUKKyAgICAgICAgICAgICAgIGN1cnJlbnQgbGluZSBkaWZm ZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFs bHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8xX3AgPSAo IXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg YXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhz Y3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwg PiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+ aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIC4uLgorICAgICAgICAgICAg ICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRs eS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzJfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3Jv bGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA9PSAwCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1Q TEU6ICAoc2Nyb2xsLWxlZnQgNSk7IGFuZCwgdGhlbiBwcmVzcyB0aGUgbGVmdCBhcnJvdyBrZXkg b25lIHRpbWUuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkg c2Nyb2xsZWQgZGlmZmVyZW50bHkuKi8KKyAgYm9vbCBoc2NsX3RlbXBfcCA9ICghdy0+c3VzcGVu ZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9k ZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBD LXggPCBhbmQgZG8gc29tZXRoaW5nIHRoYXQgY2F1c2VzIHRoZSBjdXJyZW50IGxpbmUgdG8gYmUK KyAgICAgICAgICAgICAgIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4KKyAgICAg ICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJl bnRseS4gKi8KKyAgYm9vbCBoc2NsX3Blcm1fcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwK KyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfb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ZV9wKQorICAg ICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXkt YXJyb3ctZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAg ICAgICAgbWNfbGVmdF9mcmluZ2VfZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZS SU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG92ZXJs YXlfYXJyb3dfZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBE RUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgaWYgKHctPmhzY3JvbGwgIT0gMCkKKyAgICAgICAg ICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1v dmVybGF5LWFycm93IiksIGZhbHNlLCB0cnVlKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIr LW92ZXJsYXktYXJyb3ciKSwgdHJ1ZSwgdHJ1ZSk7CisgICAgICAgICAgbWNfbGVmdF9mcmluZ2Vf Yml0bWFwID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBmcmluZ2VfYml0bWFwCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgfQor ICAgICAgICBlbHNlIGlmICgodnBvcyA9PSB2cG9zX2Rlc2lyZWQgfHwgdnBvcyA9PSB2cG9zX2N1 cnJlbnQpCisgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FS Uk9XX0JJVE1BUAorICAgICAgICAgICAgICAgICAmJiAoaHNjbF9hbGxfdGVtcF9wCisgICAgICAg ICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzBfcAorICAgICAgICAgICAgICAgICAgICAg fHwgaHNjbF9hbGxfcGVybV8xX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Bl cm1fMl9wCisgICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX3RlbXBfcAorICAgICAgICAgICAg ICAgICAgICAgfHwgaHNjbF9wZXJtX3ApCisgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcCkK KyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgZnJpbmdlX2JpdG1hcCA9IE1DX05PX0ZSSU5H RV9CSVRNQVA7CisgICAgICAgICAgICBlbnVtIGZhY2VfaWQgb3ZlcmxheV9hcnJvd19mYWNlX2lk ID0KKyAgICAgICAgICAgICAgKCFhY3RpdmVfcAorICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVfd2luZG93cykpKQorICAgICAg ICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJy b3ctaHNjbC1pbmFjdGl2ZS1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgIDogKGFjdGl2ZV9w KQorICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIist b3ZlcmxheS1hcnJvdy1oc2NsLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgOiBERUZBVUxU X0ZBQ0VfSUQ7CisgICAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gKGN1cnNvcl90 eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBvdmVybGF5X2Fycm93X2ZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgICBpZiAoaHNj bF9hbGxfcGVybV8wX3ApCisgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJp bmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIGZhbHNlKTsKKyAg ICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8xX3ApCisgICAgICAgICAgICAgICAg ZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wt cGVybSIpLCB0cnVlLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxf cGVybV8yX3ApCisgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5n ZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIGZhbHNlLCB0cnVlKTsKKyAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfcGVybV9wKQorICAgICAgICAgICAgICAgICAgICBm cmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1w ZXJtIiksIHRydWUsIHRydWUpOworICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX2Fs bF90ZW1wX3ApCisgICAgICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9m cmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtdGVtcCIpLCBmYWxzZSwgZmFsc2UpOwor ICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfdGVtcF9wKQorICAgICAgICAgICAg ICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRl cm4gKCIrLWhzY2wtdGVtcCIpLCB0cnVlLCBmYWxzZSk7CisgICAgICAgICAgICBtY19sZWZ0X2Zy aW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAg ICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAoKHZwb3MgPT0gdnBvc19kZXNpcmVkIHx8IHZw b3MgPT0gdnBvc19jdXJyZW50KQorICAgICAgICAgICAgICAgICAgICAmJiAoZ2x5cGhfZmxhdm9y ID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAg ICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hU X0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfSE9M TE9XX1JFQ1RBTkdMRQorICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09 IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgfHwg Z2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAg ICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUgor ICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZF UlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1D X1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gpCisgICAgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRf cCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgTGlzcF9PYmplY3QgYml0bWFwX2ZsYXZv ciA9IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVykKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19yZWN0 YW5nbGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hU X0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFt Y19yZXZlcnNlZF9ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JF Q1RBTkdMRSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBR bWNfaG9sbG93X3JlY3RhbmdsZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxf YmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9X KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19yZXZl cnNlZF92ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jh cgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxh dm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNf VkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBRbmlsOworICAgICAgICAgICAgICBtY19yaWdo dF9mcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBfZnJpbmdl X2JpdG1hcCAoYml0bWFwX2ZsYXZvcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgICAgIG1jX3JpZ2h0X2Zy aW5nZV9mYWNlX2lkID0KKyAgICAgICAgICAgICAgICAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRf RlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX1JF VkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAg IHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cK KyAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJU SUNBTF9CQVIpKQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwg aW50ZXJuICgiKy1yZXZlcnNlZC12ZXJ0aWNhbC1iYXItZmFjZSIpLCB0cnVlKQorICAgICAgICAg ICAgICAgIDogKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAg ICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdM RV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAmJiBn bHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAg ICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy12ZXJ0aWNhbC1iYXItZmFj ZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAg ICAgfQorICAgICA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Z0KSkKKyAgICAg ICAgICAgICAgICAgPyBNQ19MRUZUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHRvcF9yb3dfZW5k c19hdF96dl9wKQorICAgICAgICAgICAgICAgICA6IE1DX0xFRlRfRlJJTkdFICgyLCBRdG9wLCAw KSk7CisgICAgICAgICAgaWYgKHRvcF9pbmRfbWluX3kgPj0gMCkKKyAgICAgICAgICAgIGxlZnRf b2Zmc2V0ID0gdG9wX2luZF9taW5feSAtIHJvdy0+eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBp ZiAocm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRbGVmdCkpCisgICAg ICAgIHsKKyAgICAgICAgICBsZWZ0ID0gTUNfTEVGVF9GUklOR0UgKDMsIFFib3R0b20sIGJvdF9y b3dfZW5kc19hdF96dl9wKTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAg ICAgICAgICAgbGVmdF9vZmZzZXQgPSBib3RfaW5kX21heF95IC0gKHJvdy0+eSArIHJvdy0+dmlz aWJsZV9oZWlnaHQpOworICAgICAgICB9CisgICAgICBlbHNlIGlmICgoIXJvdy0+cmV2ZXJzZWRf cCAmJiBNQVRSSVhfUk9XX0NPTlRJTlVBVElPTl9MSU5FX1AgKHJvdykpCisgICAgICAgICAgICAg ICB8fCAocm93LT5yZXZlcnNlZF9wICYmIHJvdy0+Y29udGludWVkX3ApKQorICAgICAgICBsZWZ0 ID0gTUNfTEVGVF9GUklOR0UgKDQsIFFjb250aW51YXRpb24sIDApOworICAgICAgZWxzZSBpZiAo cm93LT5pbmRpY2F0ZV9lbXB0eV9saW5lX3AgJiYgRVEgKGVtcHR5X3BvcywgUWxlZnQpKQorICAg ICAgICBsZWZ0ID0gTUNfTEVGVF9GUklOR0UgKDUsIFFlbXB0eV9saW5lLCAwKTsKKyAgICAgIGVs c2UgaWYgKHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCAmJiBFUSAoYXJyb3dfdG9wLCBRbGVmdCkp CisgICAgICAgIHsKKyAgICAgICAgICBsZWZ0ID0gTUNfTEVGVF9GUklOR0UgKDYsIFF1cCwgMCk7 CisgICAgICAgICAgaWYgKHRvcF9pbmRfbWluX3kgPj0gMCkKKyAgICAgICAgICAgIGxlZnRfb2Zm c2V0ID0gdG9wX2luZF9taW5feSAtIHJvdy0+eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAo cm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wICYmIEVRIChhcnJvd19ib3QsIFFsZWZ0KSkKKyAg ICAgICAgeworICAgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNywgUWRvd24sIDApOwor ICAgICAgICAgIGlmIChib3RfaW5kX21heF95ID49IDApCisgICAgICAgICAgICBsZWZ0X29mZnNl dCA9IGJvdF9pbmRfbWF4X3kgLSAocm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdodCk7CisgICAg ICAgIH0KKyAgICAgIGVsc2UKKyAgICAgICAgbGVmdCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7Cisg ICAgICAvKiBEZWNpZGUgd2hpY2ggYml0bWFwIHRvIGRyYXcgaW4gdGhlIHJpZ2h0IGZyaW5nZS4g ICovCisgICAgICBpZiAoV0lORE9XX1JJR0hUX0ZSSU5HRV9XSURUSCAodykgPT0gMCkKKyAgICAg ICAgcmlnaHQgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgZWxzZSBpZiAocm93LT5yaWdo dF91c2VyX2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgewor ICAgICAgICAgIHJpZ2h0ID0gcm93LT5yaWdodF91c2VyX2ZyaW5nZV9iaXRtYXA7CisgICAgICAg ICAgcmlnaHRfZmFjZV9pZCA9IHJvdy0+cmlnaHRfdXNlcl9mcmluZ2VfZmFjZV9pZDsKKyAgICAg ICAgfQorICAgICAgZWxzZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgcm93LT50cnVuY2F0ZWRf b25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgcm93LT50 cnVuY2F0ZWRfb25fbGVmdF9wKSkKKyAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklOR0UgKDAs IFF0cnVuY2F0aW9uLCAwKTsKKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfYm9iX3AgJiYg RVEgKGJvdW5kYXJ5X3RvcCwgUXJpZ2h0KSkKKyAgICAgICAgeworICAgICAgICAgIHJpZ2h0ID0g KChyb3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFyaWdodCkpCisgICAg ICAgICAgICAgPyBNQ19SSUdIVF9GUklOR0UgKDEsIFF0b3BfYm90dG9tLCB0b3Bfcm93X2VuZHNf YXRfenZfcCkKKyAgICAgICAgICAgICA6IE1DX1JJR0hUX0ZSSU5HRSAoMiwgUXRvcCwgMCkpOwor ICAgICAgICAgIGlmICh0b3BfaW5kX21pbl95ID49IDApCisgICAgICAgICAgICByaWdodF9vZmZz ZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55OworICAgICAgICB9CisgICAgICBlbHNlIGlmIChy b3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFyaWdodCkpCisgICAgICAg IHsKKyAgICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoMywgUWJvdHRvbSwgYm90X3Jv d19lbmRzX2F0X3p2X3ApOworICAgICAgICAgIGlmIChib3RfaW5kX21heF95ID49IDApCisgICAg ICAgICAgICByaWdodF9vZmZzZXQgPSBib3RfaW5kX21heF95IC0gKHJvdy0+eSArIHJvdy0+dmlz aWJsZV9oZWlnaHQpOworICAgICAgICB9CisgICAgICBlbHNlIGlmICgoIXJvdy0+cmV2ZXJzZWRf cCAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgfHwgKHJvdy0+cmV2ZXJzZWRf cCAmJiBNQVRSSVhfUk9XX0NPTlRJTlVBVElPTl9MSU5FX1AgKHJvdykpKQorICAgICAgICByaWdo dCA9IE1DX1JJR0hUX0ZSSU5HRSAoNCwgUWNvbnRpbnVhdGlvbiwgMCk7CisgICAgICBlbHNlIGlm IChyb3ctPmluZGljYXRlX3RvcF9saW5lX3AgJiYgRVEgKGFycm93X3RvcCwgUXJpZ2h0KSkKKyAg ICAgICAgeworICAgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICg2LCBRdXAsIDApOwor ICAgICAgICAgIGlmICh0b3BfaW5kX21pbl95ID49IDApCisgICAgICAgICAgICByaWdodF9vZmZz ZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55OworICAgICAgICB9CisgICAgICBlbHNlIGlmIChy b3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgJiYgRVEgKGFycm93X2JvdCwgUXJpZ2h0KSkKKyAg ICAgICAgeworICAgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICg3LCBRZG93biwgMCk7 CisgICAgICAgICAgaWYgKGJvdF9pbmRfbWF4X3kgPj0gMCkKKyAgICAgICAgICAgIHJpZ2h0X29m ZnNldCA9IGJvdF9pbmRfbWF4X3kgLSAocm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdodCk7Cisg ICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfZW1wdHlfbGluZV9wICYmIEVR IChlbXB0eV9wb3MsIFFyaWdodCkpCisgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICg1 LCBRZW1wdHlfbGluZSwgMCk7CisgICAgICBlbHNlCisgICAgICAgIHJpZ2h0ID0gTUNfTk9fRlJJ TkdFX0JJVE1BUDsKKyAgICAgIHBlcmlvZGljX3AgPSAoZ2V0X2ZyaW5nZV9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PSAxOworICAgICAgICAgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFwICE9IE1D X05PX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgIHx8IG1jX3JpZ2h0X2ZyaW5nZV9i aXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPmZyaW5n ZV9iaXRtYXBfcGVyaW9kaWNfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICAgIGN1ci0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wID0gcGVyaW9kaWNfcDsK KyAgICAgICAgICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0Vf QklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2VfYml0bWFwID0gbWNfbGVm dF9mcmluZ2VfYml0bWFwOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg IGN1ci0+bGVmdF9mcmluZ2VfYml0bWFwID0gbGVmdDsKKyAgICAgICAgICAgICAgaWYgKG1jX2xl ZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAg IGN1ci0+bGVmdF9mcmluZ2VfZmFjZV9pZCA9IG1jX2xlZnRfZnJpbmdlX2ZhY2VfaWQ7CisgICAg ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9mYWNl X2lkID0gbGVmdF9mYWNlX2lkOworICAgICAgICAgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0 bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2Zy aW5nZV9vZmZzZXQgPSAwOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgIC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GlmIChyb3ctPm92ZXJsYXlfYXJyb3df Yml0bWFwICE9IGN1ci0+b3ZlcmxheV9hcnJvd19iaXRtYXApCisgICAgICAgIHsKKyAgICAgICAg ICByZWRyYXdfcCA9IDEsIHJvdy0+cmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AgPSAxOworICAgICAg ICAgIGlmICgha2VlcF9jdXJyZW50X3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGN1 ci0+cmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AgPSAxOworICAgICAgICAgICAgICBjdXItPm92ZXJs YXlfYXJyb3dfYml0bWFwID0gcm93LT5vdmVybGF5X2Fycm93X2JpdG1hcDsKKyAgICAgICAgICAg IH0KKyAgICAgICAgfQorICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19G UklOR0VfQklUTUFQCisgICAgICAgICAgfHwgbWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19O T19GUklOR0VfQklUTUFQKQorICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9 IGZhbHNlOworICAgICAgICBlbHNlCisgICAgICAgICAgcm93LT5mcmluZ2VfYml0bWFwX3Blcmlv ZGljX3AgPSBwZXJpb2RpY19wOworICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBN Q19OT19GUklOR0VfQklUTUFQKQorICAgICAgICByb3ctPmxlZnRfZnJpbmdlX2JpdG1hcCA9IG1j X2xlZnRfZnJpbmdlX2JpdG1hcDsKKyAgICAgICAgZWxzZQorICAgICAgICAgIHJvdy0+bGVmdF9m cmluZ2VfYml0bWFwID0gbGVmdDsKKyAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0g TUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkID0g bWNfbGVmdF9mcmluZ2VfZmFj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gIHAuYnkgPSBXSU5ET1dfVE9fRlJB TUVfUElYRUxfWSAodywgbWF4IChoZWFkZXJfbGluZV9oZWlnaHQsIHJvdy0+eSkpOworICBwLm55 ID0gcm93LT52aXNpYmxlX2hlaWdodDsKKyAgaWYgKGxlZnRfcCkKKyAgICB7CisgICAgICBpbnQg d2QgPSBXSU5ET1dfTEVGVF9GUklOR0VfV0lEVEggKHcpOworICAgICAgaW50IHggPSB3aW5kb3df Ym94X2xlZnQgKHcsIChXSU5ET1dfSEFTX0ZSSU5HRVNfT1VUU0lERV9NQVJHSU5TICh3KQorICAg ICAgICAgICA/IExFRlRfTUFSR0lOX0FSRUEKKyAgICAgICAgICAgOiBURVhUX0FSRUEpKTsKKyAg ICAgIGlmIChwLndkID4gd2QpCisgICAgICAgIHAud2QgPSB3ZDsKKyAgICAgIHAueCA9IHggLSBw LndkIC0gKHdkIC0gcC53ZCkgLyAyOworICAgICAgaWYgKHAud2QgPCB3ZCB8fCBwLnkgPiBwLmJ5 IHx8IHAueSArIHAuaCA8IHAuYnkgKyBwLm55KQorICAgICAgICB7CisgICAgICAgICAgLyogSWYg VyBoYXMgYSB2ZXJ0aWNhbCBib3JkZXIgdG8gaXRzIGxlZnQsIGRvbid0IGRyYXcgb3ZlciBpdC4g ICovCisgICAgICAgICAgd2QgLT0gKCghV0lORE9XX0xFRlRNT1NUX1AgKHcpCisgICAgICAgICAg ICAvKiBUaGlzIGNvdWxkIGJlIHdyb25nIHdoZW4gd2UgYWxsb3cgd2luZG93IGxvY2FsCisgICAg ICAgICAgICAgICByaWdodCBkaXZpZGVycyAtIGJ1dCB0aGUgd2luZG93IG9uIHRoZSBsZWZ0IGlz IGhhcmQKKyAgICAgICAgICAgICAgIHRvIGdldC4gICovCisgICAgICAgICAgICAmJiAhRlJBTUVf UklHSFRfRElWSURFUl9XSURUSCAoZikKKyAgICAgICAgICAgICYmICFXSU5ET1dfSEFTX1ZFUlRJ Q0FMX1NDUk9MTF9CQVIgKHcpCisgICAgICAgICAgICAvKiBCdXQgZG9uJ3QgcmVkdWNlIHRoZSBm cmluZ2Ugd2lkdGggaWYgdGhlIHdpbmRvdworICAgICAgICAgICAgICAgaGFzIGEgbGVmdCBtYXJn aW4sIGJlY2F1c2UgdGhhdCBtZWFucyB3ZSBhcmUgbm90CisgICAgICAgICAgICAgICBpbiBkYW5n ZXIgb2YgZHJhd2luZyBvdmVyIHRoZSB2ZXJ0aWNhbCBib3JkZXIsCisgICAgICAgICAgICAgICBh bmQgT1RPSCBsZWF2aW5nIG91dCB0aGF0IG9uZSBwaXhlbCBsZWF2ZXMgYmVoaW5kCisgICAgICAg ICAgICAgICB0cmFjZXMgb2YgdGhlIGN1cnNvciwgaWYgaXQgd2FzIGluIGNvbHVtbiB6ZXJvCisg ICAgICAgICAgICAgICBiZWZvcmUgZHJhd2luZyBub24tZW1wdHkgbWFyZ2luIGFyZWEuICAqLwor ICAgICAgICAgICAgJiYgdy0+bGVmdF9tYXJnaW5fY29scyA9PSAwKQorICAgICAgICAgICA/IDEg OiAwKTsKKyAgICAgICAgICBwLmJ4ID0geCAtIHdkOworICAgICAgICAgIHAubnggPSB3ZDsKKyAg ICAgICAgfQorICAgIH0KKyAgZWxzZQorICAgIHsKKyAgICAgIGludCB4ID0gd2luZG93X2JveF9y aWdodCAodywKKyAgICAgICAgKFdJTkRPV19IQVNfRlJJTkdFU19PVVRTSURFX01BUkdJTlMgKHcp CisgICAgICAgICA/IFJJR0hUX01BUkdJTl9BUkVBCisgICAgICAgICA6IFRFWFRfQVJFQSkpOwor ICAgICAgaW50IHdkID0gV0lORE9XX1JJR0hUX0ZSSU5HRV9XSURUSCAodyk7CisgICAgICBpZiAo cC53ZCA+IHdkKQorICAgICAgICBwLndkID0gd2Q7CisgICAgICBwLnggPSB4ICsgKHdkIC0gcC53 ZCkgLyAyOworICAgICAgLyogQ2xlYXIgcmlnaHQgZnJpbmdlIGlmIG5vIGJpdG1hcCB0byBkcmF3 IG9mIGlmIGJpdG1hcCBkb2Vzbid0IGZpbGwKKyAgIHRoZSBmcmluZ2UuICAqLworICAgICAgaWYg KHAud2QgPCB3ZCB8fCBwLnkgPiBwLmJ5IHx8IHAueSArIHAuaCA8IHAuYnkgKyBwLm55KQorICAg ICAgICB7CisgICAgICAgICAgcC5ieCA9IHg7CisgICAgICAgICAgcC5ueCA9IHdkOworICAgICAg ICB9CisgICAgfQorICBpZiAocC54ID49IFdJTkRPV19CT1hfTEVGVF9FREdFX1ggKHcpCisgICAg ICAmJiAocC54ICsgcC53ZCkgPD0gV0lORE9XX0JPWF9MRUZUX0VER0VfWCAodykgKyBXSU5ET1df UElYRUxfV0lEVEggKHcpKQorICAgIEZSQU1FX1JJRiAoZiktPmRyYXdfZnJpbmdlX2JpdG1hcCAo dywgcm93LCAmcCk7Cit9CisKK3ZvaWQKK21jX2RyYXdfZnJpbmdlX2JpdG1hcCAoc3RydWN0IHdp bmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgbGVmdF9wLCBlbnVtIG1jX2N1cnNv cl90eXBlIGN1cnNvcl90eXBlKQoreworICBpbnQgb3ZlcmxheSA9IDA7CisgIGlmIChsZWZ0X3Ag PT0gcm93LT5yZXZlcnNlZF9wICYmIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wKQorICAgIHsKKyAg ICAgIExpc3BfT2JqZWN0IGN1cnNvciA9IFFuaWw7CisgICAgICBzd2l0Y2ggKGN1cnNvcl90eXBl KQorICAgICAgICB7CisgICAgICAgIGNhc2UgTUNfRlJBTUVEX0JPWDoKKyAgICAgICAgICBpZiAo cm93LT52aXNpYmxlX2hlaWdodCA+PSBTVEFOREFSRF9CSVRNQVBfSEVJR0hUIChob2xsb3dfcmVj dGFuZ2xlX2JpdHMpKQorICAgICAgICAgICAgY3Vyc29yID0gUWhvbGxvdzsKKyAgICAgICAgICBl bHNlCisgICAgICAgICAgICBjdXJzb3IgPSBRaG9sbG93X3NtYWxsOworICAgICAgICAgIGJyZWFr OworICAgICAgICBjYXNlIE1DX0hPTExPV19CT1g6CisgICAgICAgICAgaWYgKHJvdy0+dmlzaWJs ZV9oZWlnaHQgPj0gU1RBTkRBUkRfQklUTUFQX0hFSUdIVCAoaG9sbG93X3JlY3RhbmdsZV9iaXRz KSkKKyAgICAgICAgICAgIGN1cnNvciA9IFFob2xsb3c7CisgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgY3Vyc29yID0gUWhvbGxvd19zbWFsbDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAg Y2FzZSBNQ19GSUxMRURfQk9YOgorICAgICAgICAgIGN1cnNvciA9IFFib3g7CisgICAgICAgICAg YnJlYWs7CisgICAgICAgIGNhc2UgTUNfQkFSOgorICAgICAgICAgIGN1cnNvciA9IFFiYXI7Cisg ICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfSEJBUjoKKyAgICAgICAgICBjdXJzb3Ig PSBRaGJhcjsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19OT19GUklOR0VfQklU TUFQOgorICAgICAgICBjYXNlIE1DX05PX0NVUlNPUjoKKyAgICAgICAgY2FzZSBNQ19SSUdIVF9G UklOR0VfQklUTUFQOgorICAgICAgICBjYXNlIE1DX0xFRlRfRlJJTkdFX0JJVE1BUDoKKyAgICAg ICAgZGVmYXVsdDoKKyAgICAgICAgICB3LT5waHlzX2N1cnNvcl9vbl9wID0gMDsKKyAgICAgICAg ICByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9IDA7CisgICAgICAgICAgYnJlYWs7CisgICAgICAg IH0KKyAgICAgIGlmICghTklMUCAoY3Vyc29yKSkKKyAgICAgICAgeworICAgICAgICAgIGludCBi bSA9IG1jX2dldF9sb2dpY2FsX2N1cnNvcl9iaXRtYXAgKHcsIGN1cnNvcik7CisgICAgICAgICAg aWYgKGJtICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcF8xICh3LCByb3csIGxlZnRfcCwgMiwgYm0pOworICAg ICAgICAgICAgICBvdmVybGF5ID0gRVEgKGN1cnNvciwgUWJveCkgPyAzIDogMTsKKyAgICAgICAg ICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgbWNfZHJhd19mcmluZ2VfYml0bWFwXzEgKHcsIHJv dywgbGVmdF9wLCBvdmVybGF5LCBNQ19OT19GUklOR0VfQklUTUFQKTsKKyAgaWYgKGxlZnRfcCAm JiByb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAg bWNfZHJhd19mcmluZ2VfYml0bWFwXzEgKHcsIHJvdywgMSwgMSwgcm93LT5vdmVybGF5X2Fycm93 X2JpdG1hcCk7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAjZGVmaW5lIE5PX0ZSSU5HRV9CSVRNQVAgMAogI2RlZmluZSBVTkRF Rl9GUklOR0VfQklUTUFQIDEKICNkZWZpbmUgTUFYX1NUQU5EQVJEX0ZSSU5HRV9CSVRNQVBTIEFS UkFZRUxUUyAoc3RhbmRhcmRfYml0bWFwcykKQEAgLTE3MDAsNiArMzE5NSwxNjggQEAgUmV0dXJu IG5pbCBpZiBQT1MgaXMgbm90IHZpc2libGUgaW4gV0lORE9XLiAgKi8pCiB2b2lkCiBzeW1zX29m X2ZyaW5nZSAodm9pZCkKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2lu IE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAvKiAoZ2V0ICdlbXB0eS1saW5lICdmcmluZ2UpID0+ IDIzID0+IHRoZSBsY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ICdmcmluZ2UpID0+IDQ4ICovCisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAgIERFRlNZTSAoUXRydW5jYXRpb24sICJ0cnVuY2F0aW9u Iik7CiAgIERFRlNZTSAoUWNvbnRpbnVhdGlvbiwgImNvbnRpbnVhdGlvbiIpOwogICBERUZTWU0g KFFvdmVybGF5X2Fycm93LCAib3ZlcmxheS1hcnJvdyIpOwpkaWZmIC0tZ2l0IGEvc3JjL25zdGVy bS5oIGIvc3JjL25zdGVybS5oCmluZGV4IDc4Y2U2MDguLjhlZjBkZmUgMTAwNjQ0Ci0tLSBhL3Ny Yy9uc3Rlcm0uaAorKysgYi9zcmMvbnN0ZXJtLmgKQEAgLTY2MCw2ICs2NjAsMTYgQEAgdHlwZWRl ZiBpZCBpbnN0YW5jZXR5cGU7CiAKIEBpbnRlcmZhY2UgRW1hY3NTY3JvbGxlciA6IE5TU2Nyb2xs ZXIKICAgeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisgICAgTlNSZWN0IG1jX3JlY3RhbmdsZTsKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICAgc3RydWN0IHdpbmRvdyAqd2luZG93OwogICAgc3RydWN0IGZyYW1lICpmcmFt ZTsKICAgIE5TUmVzcG9uZGVyICpwcmV2UmVzcG9uZGVyOwpAQCAtNjgwLDYgKzY5MCwxOCBAQCB0 eXBlZGVmIGlkIGluc3RhbmNldHlwZTsKICAgIGludCBlbV93aG9sZTsKICAgIH0KIAorCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLSAodm9pZClt Y19zZXRfcmVjdGFuZ2xlOiAoTlNSZWN0KXJlY3Q7CistIChOU1JlY3QpbWNfZ2V0X3JlY3Rhbmds ZTsKKy0gKHN0cnVjdCB3aW5kb3cgKiltY19nZXRfd2luZG93OworLSAoYm9vbCltY19qdWRnZTsK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLSAoaW5zdGFuY2V0eXBlKSBpbml0RnJh bWU6IChOU1JlY3QgKXIgd2luZG93OiAoTGlzcF9PYmplY3Qpd2luOwogLSAodm9pZClzZXRGcmFt ZTogKE5TUmVjdClyOwogCmRpZmYgLS1naXQgYS9zcmMvbnN0ZXJtLm0gYi9zcmMvbnN0ZXJtLm0K aW5kZXggODFkMzZiZS4uZDY4OTA5OCAxMDA2NDQKLS0tIGEvc3JjL25zdGVybS5tCisrKyBiL3Ny Yy9uc3Rlcm0ubQpAQCAtNzYsNiArNzYsMTA2MSBAQCBVcGRhdGVkIGJ5IENocmlzdGlhbiBMaW1w YWNoIChjaHJpc0BuaWNlLmNoKQogc3RhdGljIEVtYWNzTWVudSAqbWFpbk1lbnU7CiAjZW5kaWYK IAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMg Ki8KKworc3RhdGljIHZvaWQgbnNfcmVzZXRfY2xpcHBpbmcgKHN0cnVjdCBmcmFtZSAqKTsKKwor c3RhdGljIHZvaWQgbnNfZHVtcGdseXBoc19ib3hfb3JfcmVsaWVmIChzdHJ1Y3QgZ2x5cGhfc3Ry aW5nICopOworCit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gICAg ICB0aGUgcmlnaHQgZW5kcyBvZiBsZWZ0IGFuZCByaWdodC4gKi8KKyAgICAgIHJlc3VsdC0+c2l6 ZS53aWR0aCA9IChtaW4gKGxlZnQtPm9yaWdpbi54ICsgbGVmdC0+c2l6ZS53aWR0aCwgcmlnaHQt Pm9yaWdpbi54ICsgcmlnaHQtPnNpemUud2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAtIHJlc3VsdC0+b3JpZ2luLngpOworICAgICAgLyogU2FtZSBnYW1lIGZvciBZLiAqLworICAg ICAgaWYgKHIxLT5vcmlnaW4ueSA8IHIyLT5vcmlnaW4ueSkKKyAgICAgICAgdXBwZXIgPSByMSwg bG93ZXIgPSByMjsKKyAgICAgICAgZWxzZQorICAgICAgICAgIHVwcGVyID0gcjIsIGxvd2VyID0g cjE7CisgICAgICAvKiBUaGUgdXBwZXIgZW5kIG9mIHRoZSBpbnRlcnNlY3Rpb24gaXMgbG93ZXIu eTAsIGlmIHRoaXMgaXMgaW5zaWRlCisgICAgICBvZiB1cHBlci4gIE90aGVyd2lzZSwgdGhlcmUg aXMgbm8gaW50ZXJzZWN0aW9uLiAqLworICAgICAgaWYgKGxvd2VyLT5vcmlnaW4ueSA8PSB1cHBl ci0+b3JpZ2luLnkgKyB1cHBlci0+c2l6ZS5oZWlnaHQpCisgICAgICAgIHsKKyAgICAgICAgICBy ZXN1bHQtPm9yaWdpbi55ID0gbG93ZXItPm9yaWdpbi55OworICAgICAgICAgIC8qIFRoZSBsb3dl ciBlbmQgb2YgdGhlIGludGVyc2VjdGlvbiBpcyB0aGUgbWluaW11bSBvZiB0aGUgbG93ZXIKKyAg ICAgICAgICAgICBlbmRzIG9mIHVwcGVyIGFuZCBsb3dlci4gKi8KKyAgICAgICAgICByZXN1bHQt PnNpemUuaGVpZ2h0ID0gKG1pbiAobG93ZXItPm9yaWdpbi55ICsgbG93ZXItPnNpemUuaGVpZ2h0 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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gICAgICAgIHsKKyAgICAgICAgICBbW05TR3JhcGhpY3NDb250ZXh0IGN1cnJlbnRDb250ZXh0 XSBzYXZlR3JhcGhpY3NTdGF0ZV07CisgICAgICAgICAgaWYgKG4gPT0gMikKKyAgICAgICAgICAg IE5TUmVjdENsaXBMaXN0IChyLCAyKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgIC8qIEZJWE1FOiAgVGhpcyBpcyBub3Qgd29ya2luZyB3aXRoIHBh dGNoIHZlcnNpb24gMDIwLjAwMC4gKi8KKyAgICAgICAgICAgICAgICAvLyAgaWYgKHJvdy0+Y2xp cCAhPSBOVUxMKQorICAgICAgICAgICAgICAgIC8vICAgIHsKKyAgICAgICAgICAgICAgICAvLyAg ICAgIE5TUmVjdCByX2NsaXA7CisgICAgICAgICAgICAgICAgLy8gICAgICByX2NsaXAub3JpZ2lu LnggPSByb3ctPmNsaXAtPng7CisgICAgICAgICAgICAgICAgLy8gICAgICByX2NsaXAub3JpZ2lu LnkgPSByb3ctPmNsaXAtPnk7CisgICAgICAgICAgICAgICAgLy8gICAgICByX2NsaXAuc2l6ZS53 aWR0aCA9IHJvdy0+Y2xpcC0+d2lkdGg7CisgICAgICAgICAgICAgICAgLy8gICAgICByX2NsaXAu c2l6ZS5oZWlnaHQgPSByb3ctPmNsaXAtPmhlaWdodDsKKyAgICAgICAgICAgICAgICAvLyAgICAg IE5TUmVjdCByX3NhdmU7CisgICAgICAgICAgICAgICAgLy8gICAgICByX3NhdmUub3JpZ2luLngg PSByWzBdLm9yaWdpbi54OworICAgICAgICAgICAgICAgIC8vICAgICAgcl9zYXZlLm9yaWdpbi55 ID0gclswXS5vcmlnaW4ueTsKKyAgICAgICAgICAgICAgICAvLyAgICAgIHJfc2F2ZS5zaXplLndp ZHRoID0gclswXS5zaXplLndpZHRoOworICAgICAgICAgICAgICAgIC8vICAgICAgcl9zYXZlLnNp emUuaGVpZ2h0ID0gclswXS5zaXplLmhlaWdodDsKKyAgICAgICAgICAgICAgICAvLyAgICAgIG1j X25zX2ludGVyc2VjdF9yZWN0YW5nbGVzICgmcl9zYXZlLCAmcl9jbGlwLCAmclswXSk7CisgICAg ICAgICAgICAgICAgLy8gICAgfQorICAgICAgICAgICAgICAgIE5TUmVjdENsaXAgKCpyKTsKKyAg ICAgICAgICAgICAgfQorICAgICAgICAgIHJldHVybiBZRVM7CisgICAgICAgIH0KKyAgICAgIGVs c2UKKyAgICAgICAgeworICAgICAgICAgIE5TVmlldyAqdmlldyA9IEZSQU1FX05TX1ZJRVcgKGYp OworICAgICAgICAgIGludCBpOworICAgICAgICAgIGZvciAoaSA9IDAgOyBpIDwgbiA7IGkrKykK KyAgICAgICAgICAgIFt2aWV3IHNldE5lZWRzRGlzcGxheUluUmVjdDpyW2ldXTsKKyAgICAgICAg fQorICAgIH0KKyAgcmV0dXJuIE5POworfQorCitzdGF0aWMgdm9pZAorbWNfbnNfZHJhd193aW5k b3dfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgs IHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgICAgICAgIGludCB4LCBpbnQgZngs IGludCB5LCBpbnQgZnksIGludCBocG9zLCBpbnQgdnBvcywgaW50IHdkLCBpbnQgaCwKKyAgICAg ICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNv cl90eXBlLAorICAgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCwgZW51bSBtY19mbGF2 b3IgZ2x5cGhfZmxhdm9yLCBib29sIG9uX3AsIGJvb2wgYWN0aXZlX3ApCit7CisgIC8qIFRoZSBw cmlvciBidWcgb2YgYSBkb3VibGUgaW1wcmludCBvbiB0aGUgZ2x5cGggd2hlcmUgYW4gTUNfSEJB UiBhbmQKKyAgTUNfQkFSIGlzIHBsYWNlZCB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yAgICAgICAgICAgICAgICAgICAgICAoIU5JTFAgKGZvcmVncm91bmQpID8gU1NEQVRBIChm b3JlZ3JvdW5kKSA6ICJOSUxQIiksCisgICAgICAgICAgICAgICAgICAgICAgKCFOSUxQIChiYWNr Z3JvdW5kKSA/IFNTREFUQSAoYmFja2dyb3VuZCkgOiAiTklMUCIpKTsKKyAgLSAgRVhBTVBMRSBP RiBIT1cgVE8gQ1JFQVRFIEEgQ09MT1IgV0lUSCBSR0IvTFNMIGZsb2F0IHZhbHVlczoKKyAgICAg TlNDb2xvciAqbXlfY29sb3IgPSBbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiAxLjAK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVu OiAxLjAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBibHVlOiAxLjAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGFscGhhOiAxLjBdOworICAtICBBTFRFUk5BVElWRSBFWEFNUExFOgorICAgICBlbnVt IGZhY2VfaWQgZGVidWdnaW5nX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ ZiwgaW50ZXJuICgiKy1kZWJ1Z2dpbmctZmFjZSIpLCB0cnVlKTsKKyAgICAgc3RydWN0IGZhY2Ug KmRlYnVnZ2luZ19mYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBkZWJ1Z2dpbmdfZmFjZV9pZCk7 CisgICAgIE5TQ29sb3IgKmNvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0Vf Rk9SRUdST1VORCAoZGVidWdnaW5nX2ZhY2UpLCBzLT5mKTsKKyAgICAgW2NvbG9yIHNldF07ICov CisgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEgKKyAgICAgIHx8IGdseXBoX2ZsYXZvciA9 PSBNQ19HTFlQSExFU1MpCisgICAgW1tOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IGxz bC5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBncmVlbjogbHNsLmdyZWVuCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsdWU6IGxzbC5ibHVlCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF0gc2V0XTsKKyAgICBlbHNlCisgICAgICBb RlJBTUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworICBpZiAoY3Vyc29yX3R5cGUgPT0gTUNfRlJB TUVEX0JPWCkKKyAgICB7CisgICAgICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKyAg ICAgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgICAgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVS IChidWYpOworICAgICAgYm9vbCByZWdpb25fYWN0aXZlX3AgPSAoIU5JTFAgKFZ0cmFuc2llbnRf bWFya19tb2RlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIg KGIsIG1hcmtfYWN0aXZlKSkpOworICAgICAgcHRyZGlmZl90IHJlZ2lvbl9iZWdpbm5pbmcgPSAo cmVnaW9uX2FjdGl2ZV9wKSA/IFhGSVhOVU0gKEZyZWdpb25fYmVnaW5uaW5nICgpKSA6IC0xOwor ICAgICAgcHRyZGlmZl90IHJlZ2lvbl9lbmQgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IFhGSVhOVU0g KEZyZWdpb25fZW5kICgpKSA6IC0xOworICAgICAgcHRyZGlmZl90IG9wb2ludF9wdCA9ICh3ID09 IFhXSU5ET1cgKHNlbGVjdGVkX3dpbmRvdykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBQVAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogWEZJWE5VTSAoRm1hcmtlcl9wb3Np dGlvbiAody0+cG9pbnRtKSk7CisgICAgICBib29sIHJlZ2lvbl9pbl9ib3VuZHNfcCA9IChyZWdp b25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF9w dCA+PSByZWdpb25fYmVnaW5uaW5nCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvcG9pbnRfcHQgPCByZWdpb25fZW5kKTsKKyAgICAgIGlmIChyZWdpb25fYWN0aXZlX3AKKyAg ICAgICAgICAmJiByZWdpb25faW5fYm91bmRzX3AKKyAgICAgICAgICAmJiBhY3RpdmVfcCkKKyAg ICAgICAgeworICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9mYWNl X2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNv ci1yZWdpb24tZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2Fj dGl2ZV9yZWdpb25fZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25f ZmFjZV9pZCk7CisgICAgICAgICAgTlNDb2xvciAqaG9sbG93X2FjdGl2ZV9yZWdpb25fY29sb3Ig PSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChob2xsb3dfYWN0 aXZlX3JlZ2lvbl9mYWNlKSwgZik7CisgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2Fj dGl2ZV9yZWdpb25fY29sb3I7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocmVnaW9uX2Fj dGl2ZV9wCisgICAgICAgICAgICAgICAgICYmICFyZWdpb25faW5fYm91bmRzX3AKKyAgICAgICAg ICAgICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgICAgewor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E5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSksIGYp IHNldF07CisgICAgICAgIGhvbGxvd19jb2xvciA9IEZSQU1FX0NVUlNPUl9DT0xPUiAoZik7Cisg ICAgICB9CisjaWZkZWYgTlNfSU1QTF9DT0NPQQorICBOU0Rpc2FibGVTY3JlZW5VcGRhdGVzICgp OworI2VuZGlmCisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgeworICAgICAgY2FzZSBNQ19O T19GUklOR0VfQklUTUFQOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfTk9fQ1VSU09S OgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAg ICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0xFRlRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAg YnJlYWs7CisgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgIE5TUmVjdEZpbGwgKHIp OworICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfRlJBTUVEX0JPWDoKKyAgICAgICAgTlNS ZWN0RmlsbCAocik7CisgICAgICAgIFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAgTlNSZWN0 RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xP UiAoZikgc2V0XTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0hPTExPV19CT1g6Cisg ICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAg ICAgIE5TUmVjdEZpbGwgKE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgIFtGUkFNRV9D VVJTT1JfQ09MT1IgKGYpIHNldF07CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19IQkFS OgorICAgICAgICBOU1JlY3RGaWxsI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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLSAqLworeworICBpZiAocy0+Zm9yX292ZXJsYXBzKQorICAgIHJldHVy bjsKKyAgLyogRG8gdW5kZXJsaW5lLiAqLworICBpZiAoZmFjZS0+dW5kZXJsaW5lX3ApCisgICAg eworICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkK KyAgICAgICAgeworICAgICAgICAgIGlmIChmYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisg ICAgICAgICAgICBbZGVmYXVsdENvbCBzZXRdOworICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZhY2UtPnVuZGVybGluZV9jb2xvciwgcy0+ Zikgc2V0XTsKKyAgICAgICAgICBuc19kcmF3X3VuZGVyd2F2ZSAocywgd2lkdGgsIHgpOworICAg ICAgICB9CisgICAgICAgIGVsc2UgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0Vf VU5ERVJfTElORSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBOU1JlY3QgcjsKKyAgICAgICAg ICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAgICAgICAgICAgIC8qIElm IHRoZSBwcmV2IHdhcyB1bmRlcmxpbmVkLCBtYXRjaCBpdHMgYXBwZWFyYW5jZS4gKi8KKyAgICAg ICAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV9wCisgICAgICAg ICAgICAgICAgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9M SU5FCisgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDAp CisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB0aGlja25lc3MgPSBzLT5wcmV2LT51 bmRlcmxpbmVfdGhpY2tuZXNzOworICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+cHJldi0+ dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZm9udCAqZm9udDsK KyAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZGVzY2VudDsKKyAgICAgICAgICAgICAg ICAgIGZvbnQ9cy0+Zm9udDsKKyAgICAgICAgICAgICAgICAgIGRlc2NlbnQgPSBzLT55ICsgcy0+ aGVpZ2h0IC0gcy0+eWJhc2U7CisgICAgICAgICAgICAgICAgICAvKiBVc2UgdW5kZXJsaW5lIHRo aWNrbmVzcyBvZiBmb250LCBkZWZhdWx0aW5nIHRvIDEuICovCisgICAgICAgICAgICAgICAgICB0 aGlja25lc3MgPSAoZm9udCAmJiBmb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gZm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAxOworICAgICAgICAgICAgICAgICAgLyogRGV0 ZXJtaW5lIHRoZSBvZmZzZXQgb2YgdW5kZXJsaW5pbmcgZnJvbSB0aGUgYmFzZWxpbmUuICovCisg ICAgICAgICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2VudF9saW5lKQorICAgICAg ICAgICAgICAgICAgICBwb3NpdGlvbiA9IGRlc2NlbnQgLSB0aGlja25lc3M7CisgICAgICAgICAg ICAgICAgICAgIGVsc2UgaWYgKHhfdXNlX3VuZGVybGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVzCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGZvbnQgJiYgZm9udC0+dW5kZXJsaW5lX3Bv c2l0aW9uID49IDApCisgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBmb250LT51bmRl cmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZm9udCkKKyAg ICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbHJvdW5kIChmb250LT5kZXNjZW50IC8g Mik7CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAg ICAgIHBvc2l0aW9uID0gdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0OworICAgICAgICAgICAgICAg ICAgcG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQpOwor ICAgICAgICAgICAgICAgICAgLyogRW5zdXJlIHVuZGVybGluaW5nIGlzIG5vdCBjcm9wcGVkLiAq LworICAgICAgICAgICAgICAgICAgaWYgKGRlc2NlbnQgPD0gcG9zaXRpb24pCisgICAgICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGRlc2NlbnQgLSAx OworICAgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZGVzY2VudCA8IHBvc2l0aW9uICsg dGhpY2tuZXNzKQorICAgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVz czsKKyAgICAgICAgICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9IHBvc2l0aW9uOworICAgICAg ICAgICAgciA9IE5TTWFrZVJlY3QgKHgsIHMtPnliYXNlICsgcG9zaXRpb24sIHdpZHRoLCB0aGlj a25lc3MpOworICAgICAgICAgICAgaWYgKGZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAg ICAgICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoZmFjZS0+dW5kZXJsaW5lX2NvbG9y LCBzLT5mKSBzZXRdOworICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgfQor ICAgIH0KKyAgLyogRG8gb3ZlcmxpbmUuIFdlIGZvbGxvdyBvdGhlciB0ZXJtcyBpbiB1c2luZyBh IHRoaWNrbmVzcyBvZiAxCisgICAgIGFuZCBpZ25vcmluZyBvdmVybGluZV9tYXJnaW4uICovCisg IGlmIChmYWNlLT5vdmVybGluZV9wKQorICAgIHsKKyAgICAgIE5TUmVjdCByOworICAgICAgciA9 IE5TTWFrZVJlY3QgKHgsIHMtPnksIHdpZHRoLCAxKTsKKyAgICAgIGlmIChmYWNlLT5vdmVybGlu ZV9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAg ZWxzZQorICAgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoZmFjZS0+b3ZlcmxpbmVf Y29sb3IsIHMtPmYpIHNldF07CisgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICB9CisgIC8qIERv IHN0cmlrZS10aHJvdWdoLiAgV2UgZm9sbG93IG90aGVyIHRlcm1zIGZvciB0aGlja25lc3MgYW5k CisgICAgIHZlcnRpY2FsIHBvc2l0aW9uLiovCisgIGlmIChmYWNlLT5zdHJpa2VfdGhyb3VnaF9w KQorICAgIHsKKyAgICAgIE5TUmVjdCByOworICAgICAgdW5zaWduZWQgbG9uZyBkeTsKKyAgICAg IGR5ID0gbHJpbnQgKChzLT5oZWlnaHQgLSAxKSAvIDIpOworICAgICAgciA9IE5TTWFrZVJlY3Qg KHgsIHMtPnkgKyBkeSwgd2lkdGgsIDEpOworICAgICAgaWYgKGZhY2UtPnN0cmlrZV90aHJvdWdo X2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICBbZGVmYXVsdENvbCBzZXRdOworICAgICAgICBl bHNlCisgICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChmYWNlLT5zdHJpa2VfdGhy b3VnaF9jb2xvciwgcy0+Zikgc2V0XTsKKyAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgIH0KK30K Kworc3RhdGljIHZvaWQKK21jX25zX2R1bXBnbHlwaHNfc3RyZXRjaCAoc3RydWN0IGdseXBoX3N0 cmluZyAqcywgaW50IHdkLCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cpCit7CisgIE5TUmVjdCByWzJd OworICBpbnQgbiwgaTsKKyAgc3RydWN0IGZhY2UgKmZhY2U7CisgIE5TQ29sb3IgKmZnQ29sLCAq YmdDb2w7CisgIGlmICghcy0+YmFja2dyb3VuZF9maWxsZWRfcCkKKyAgICB7CisgICAgICBuID0g bnNfZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIpOworICAgICAgKnIgPSBOU01ha2VS ZWN0IChzLT54LCBzLT55LCBzLT5iYWNrZ3JvdW5kX3dpZHRoLCBzLT5oZWlnaHQpOworICAgICAg aWYgKCFtY19uc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4sIHJvdykpCisgICAgICAgIHJldHVy bjsKKyAgICAgIGlmIChzLT5obCA9PSBEUkFXX01PVVNFX0ZBQ0UpCisgICAgICAgIHsKKyAgICAg ICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBNT1VTRV9ITF9JTkZPIChzLT5mKS0+bW91 c2VfZmFjZV9mYWNlX2lkKTsKKyAgICAgICAgICBpZiAoIWZhY2UpCisgICAgICAgICAgICBmYWNl ID0gRkFDRV9GUk9NX0lEIChzLT5mLCBNT1VTRV9GQUNFX0lEKTsKKyAgICAgICAgfQorICAgICAg ICBlbHNlCisgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBzLT5maXJzdF9nbHlw aC0+ZmFjZV9pZCk7CisgICAgICBiZ0NvbCA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19G QUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICAgIGZnQ29sID0gbnNfbG9va3VwX2lu ZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSksIHMtPmYpOworICAgICAgZm9y IChpID0gMDsgaSA8IG47ICsraSkKKyAgICAgICAgeworICAgICAgICAgIGlmICghcy0+cm93LT5m dWxsX3dpZHRoX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGludCBvdmVycnVuLCBs ZWZ0b3ZlcnJ1bjsKKyAgICAgICAgICAgICAgLyogdHJ1bmNhdGUgdG8gYXZvaWQgb3ZlcndyaXRp bmcgZnJpbmdlIGFuZC9vciBzY3JvbGxiYXIgKi8KKyAgICAgICAgICAgICAgb3ZlcnJ1biA9IG1h eCAoMCwgKHMtPnggKyBzLT5iYWNrZ3JvdW5kX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgLSAoV0lORE9XX0JPWF9SSUdIVF9FREdFX1ggKHMtPncpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAtIFdJTkRPV19SSUdIVF9GUklOR0VfV0lEVEggKHMtPncpKSk7 CisgICAgICAgICAgICAgICAgICAgIHJbaV0uc2l6ZS53aWR0aCAtPSBvdmVycnVuOworICAgICAg ICAgICAgICAvKiB0cnVuY2F0ZSB0byBhdm9pZCBvdmVyd3JpdGluZyB0byBsZWZ0IG9mIHRoZSB3 aW5kb3cgYm94ICovCisgICAgICAgICAgICAgIGxlZnRvdmVycnVuID0gKFdJTkRPV19CT1hfTEVG VF9FREdFX1ggKHMtPncpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgV0lORE9XX0xF RlRfRlJJTkdFX1dJRFRIIChzLT53KSkgLSBzLT54OworICAgICAgICAgICAgICBpZiAobGVmdG92 ZXJydW4gPiAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHJbaV0ub3Jp Z2luLnggKz0gbGVmdG92ZXJydW47CisgICAgICAgICAgICAgICAgICByW2ldLnNpemUud2lkdGgg LT0gbGVmdG92ZXJydW47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAvKiBYWFg6 IFRyeSB0byB3b3JrIGJldHdlZW4gcHJvYmxlbSB3aGVyZSBhIHN0cmV0Y2ggZ2x5cGggb24KKyAg ICAgICAgICAgICAgICAgYSBwYXJ0aWFsbHktdmlzaWJsZSBib3R0b20gcm93IHdpbGwgY2xlYXIg cGFydCBvZiB0aGUKKyAgICAgICAgICAgICAgICAgbW9kZWxpbmUsIGFuZCBhbm90aGVyIHdoZXJl IGxpc3QtYnVmZmVycyBoZWFkZXJzIGFuZCBzaW1pbGFyCisgICAgICAgICAgICAgICAgIHJvd3Mg ZXJyb25lb3VzbHkgaGF2ZSB2aXNpYmxlX2hlaWdodCBzZXQgdG8gMC4gIE5vdCBzdXJlCisgICAg ICAgICAgICAgICAgIHdoZXJlIHRoaXMgaXMgY29taW5nIGZyb20gYXMgb3RoZXIgdGVybXMgc2Vl bSBub3QgdG8gc2hvdy4gKi8KKyAgICAgICAgICAgICAgcltpXS5zaXplLmhlaWdodCA9IG1pbiAo cy0+aGVpZ2h0LCBzLT5yb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgICBbYmdDb2wgc2V0XTsKKyAgICAgICAgICAvKiBOT1RFOiB1bmRlciBOUyB0aGlzIGlzIE5P VCB1c2VkIHRvIGRyYXcgY3Vyc29ycywgYnV0IHdlIG11c3QgYXZvaWQKKyAgICAgICAgICAgICBv dmVyd3JpdGluZyBjdXJzb3IgKHVzdWFsbHkgd2hlbiBjdXJzb3Igb24gYSB0YWIpICovCisgICAg ICAgICAgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICAvKiBGSVhNRTogIERvIHdlIHN0aWxsIG5lZWQgdG8gcHJldmVudCB0aGlzIHNlY3Rpb24g b2YgY29kZSBmcm9tCisgICAgICAgICAgICAgIGVyYXNpbmcgdGhlIGZha2UgTUNfSEJBUiB0aGF0 IGV4dGVuZHMgdGhlIGVudGlyZSBsZW5ndGggb2YgdGhlCisgICAgICAgICAgICAgIFNUUkVUQ0hf R0xZUEg/ICBUaGlzIG1heSBoYXZlIGJlZW4gZG9uZSBwcmlvciB0byB0aGUgZml4IHJlbGF0aW5n CisgICAgICAgICAgICAgIHRvIGxlZnQvcmlnaHQgb3ZlcndyaXR0ZW4gZ2x5cGhzLiAqLworICAg ICAgICAgICAgICByW2ldLnNpemUuaGVpZ2h0IC09IDE7CisgICAgICAgICAgICAgIC8vICBlbnVt IGZhY2VfaWQgZGVidWdnaW5nX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ ZiwgaW50ZXJuICgiKy1kZWJ1Z2dpbmctZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgLy8g IHN0cnVjdCBmYWNlICpkZWJ1Z2dpbmdfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgZGVidWdn aW5nX2ZhY2VfaWQpOworICAgICAgICAgICAgICAvLyAgTlNDb2xvciAqY29sb3IgPSBuc19sb29r dXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChkZWJ1Z2dpbmdfZmFjZSksIHMt PmYpOworICAgICAgICAgICAgICAvLyAgW2NvbG9yIHNldF07CisgICAgICAgICAgICAgIENHRmxv YXQgeCA9IHJbaV0ub3JpZ2luLng7CisgICAgICAgICAgICAgIENHRmxvYXQgd2lkdGggPSB3ZDsK KyAgICAgICAgICAgICAgcltpXS5zaXplLndpZHRoIC09IHdpZHRoOworICAgICAgICAgICAgICBy W2ldLm9yaWdpbi54ICs9IHdpZHRoOworICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyW2ldKTsK KyAgICAgICAgICAgICAgLyogRHJhdyBvdmVybGluaW5nLCBldGMuIG9uIHRoZSBjdXJzb3IuICov CisgICAgICAgICAgICAgIGlmIChzLT53LT5waHlzX2N1cnNvcl90eXBlID09IE1DX0ZJTExFRF9C T1gpCisgICAgICAgICAgICAgICAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHMsIGZhY2Us IGJnQ29sLCB3aWR0aCwgeCk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAg ICAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHMsIGZhY2UsIGZnQ29sLCB3aWR0aCwgeCk7 CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAvLyAgaW50 IHJ4ID0gcltpXS5vcmlnaW4ueDsKKyAgLy8gIGludCByeSA9IHJbaV0ub3JpZ2luLnk7CisgIC8v ICBpbnQgcncgPSByW2ldLnNpemUud2lkdGg7CisgIC8vICBpbnQgcmggPSByW2ldLnNpemUuaGVp Z2h0OworICAvLyAgZnByaW50ZiAoc3RkZXJyLCAibWNfbnNfZHVtcGdseXBoc19zdHJldGNoOiAg dnBvcyAoJWQpIHwgcnggKCVkKSB8IHJ5ICglZCkgfCBydyAoJWQpIHwgcmggKCVkKVxuIiwKKyAg Ly8gICAgICAgICAgICAgICAgICAgcy0+Zmlyc3RfZ2x5cGgtPnZwb3MsIHJ4LCByeSwgcncsIHJo KTsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocltpXSk7CisgICAgICAgICAgICB9CisgICAg ICAgICAgLyogRHJhdyBvdmVybGluaW5nLCBldGMuIG9uIHRoZSBzdHJldGNoIGdseXBoIChvciB0 aGUgcGFydAorICAgICAgICAgICAgIG9mIHRoZSBzdHJldGNoIGdseXBoIGFmdGVyIHRoZSBjdXJz b3IpLiAqLworICAgICAgICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCBm Z0NvbCwgcltpXS5zaXplLndpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICByW2ldLm9yaWdpbi54KTsKKyAgICAgICAgfQorICAgICAgbnNfcmVzZXRfY2xpcHBpbmcg KHMtPmYpOworICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAgfQorfQorCitz dGF0aWMgdm9pZAorbWNfbnNfZHVtcGdseXBoc19pbWFnZSAoc3RydWN0IGdseXBoX3N0cmluZyAq cywgTlNSZWN0IHIsIHN0cnVjdCBtY19SR0IgbHNsLAorICAgICAgICAgICAgICAgICAgICAgICAg ZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90 eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBhY3RpdmVfcCkKKy8qIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tCisgICAgICBSZW5kZXJzIGFuIGltYWdlIGFuZCBhc3NvY2lhdGVkIGJvcmRlcnMu CisgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworeworICBFbWFjc0ltYWdlICppbWcgPSBzLT5pbWct PnBpeG1hcDsKKyAgaW50IGJveF9saW5lX3Z3aWR0aCA9IG1heCAocy0+ZmFjZS0+Ym94X2xpbmVf d2lkdGgsIDApOworICBpbnQgeCA9IHMtPngsIHkgPSBzLT55YmFzZSAtIGltYWdlX2FzY2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CisjaWZkZWYgTlNfSU1QTF9DT0NPQQorICAg ICAgTlNSZWN0IGRyID0gTlNNYWtlUmVjdCAoeCwgeSwgcy0+c2xpY2Uud2lkdGgsIHMtPnNsaWNl LmhlaWdodCk7CisgICAgICBOU1JlY3QgaXIgPSBOU01ha2VSZWN0IChzLT5zbGljZS54LCBzLT5z bGljZS55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2Uud2lkdGgsIHMt PnNsaWNlLmhlaWdodCk7CisgICAgICBbaW1nIGRyYXdJblJlY3Q6IGRyCisgICAgICAgICAgICAg ZnJvbVJlY3Q6IGlyCisgICAgICAgICAgICAgb3BlcmF0aW9uOiBOU0NvbXBvc2l0ZVNvdXJjZU92 ZXIKKyAgICAgICAgICAgICAgZnJhY3Rpb246IDEuMAorICAgICAgICAgICByZXNwZWN0RmxpcHBl ZDogWUVTCisgICAgICAgICAgICAgICAgaGludHM6IG5pbF07CisjZWxzZQorICAgICAgW2ltZyBj b21wb3NpdGVUb1BvaW50OiBOU01ha2VQb2ludCAoeCwgeSArIHMtPnNsaWNlLmhlaWdodCkKKyAg ICAgICAgICAgICAgICAgIG9wZXJhdGlvbjogTlNDb21wb3NpdGVTb3VyY2VPdmVyXTsKKyNlbmRp ZgorICAgIH0KKyAgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgIHsKKyAgICAgIFtGUkFN RV9DVVJTT1JfQ09MT1IgKHMtPmYpIHNldF07CisgICAgICBpZiAocy0+dy0+cGh5c19jdXJzb3Jf dHlwZSA9PSBNQ19GSUxMRURfQk9YKQorICAgICAgICB0ZENvbCA9IG5zX2xvb2t1cF9pbmRleGVk X2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICAgICAgZWxzZQor ICAgICAgICAgIC8qIEN1cnJlbnRseSBvbiBOUyBpbWctPm1hc2sgaXMgYWx3YXlzIDAuIFNpbmNl CisgICAgICAgICAgICAgZ2V0X3dpbmRvd19jdXJzb3JfdHlwZSBzcGVjaWZpZXMgYSBob2xsb3cg Ym94IGN1cnNvciB3aGVuIG9uCisgICAgICAgICAgICAgYSBub24tbWFza2VkIGltYWdlIHdlIG5l dmVyIHJlYWNoIHRoaXMgY2xhdXNlLiBCdXQgd2UgcHV0IGl0CisgICAgICAgICAgICAgaW4gaW4g YW50aWNpcGF0aW9uIG9mIGJldHRlciBzdXBwb3J0IGZvciBpbWFnZSBtYXNrcyBvbiBOUy4gKi8K KyAgICAgICAgICB0ZENvbCA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVH Uk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICB9CisgICAgZWxzZQorICAgICAgdGRDb2wgPSBuc19s b29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNlKSwgcy0+Zik7Cisg IC8qIERyYXcgdW5kZXJsaW5lLCBvdmVybGluZSwgc3RyaWtlLXRocm91Z2guICovCisgIG1jX25z X2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCB0ZENvbCwgYnIuc2l6ZS53aWR0aCwgYnIu b3JpZ2luLngpOworICAvKiBEcmF3IHJlbGllZiwgaWYgcmVxdWVzdGVkICovCisgIGlmIChzLT5p bWctPnJlbGllZiB8fCBzLT5obCA9PURSQVdfSU1BR0VfUkFJU0VEIHx8IHMtPmhsID09RFJBV19J TUFHRV9TVU5LRU4pCisgICAgeworICAgICAgaWYgKHMtPmhsID09IERSQVdfSU1BR0VfU1VOS0VO IHx8IHMtPmhsID09IERSQVdfSU1BR0VfUkFJU0VEKQorICAgICAgICB7CisgICAgICAgICAgdGgg PSB0b29sX2Jhcl9idXR0b25fcmVsaWVmID49IDAgPworICAgICAgICAgICAgdG9vbF9iYXJfYnV0 dG9uX3JlbGllZiA6IERFRkFVTFRfVE9PTF9CQVJfQlVUVE9OX1JFTElFRjsKKyAgICAgICAgICBy YWlzZWRfcCA9IChzLT5obCA9PSBEUkFXX0lNQUdFX1JBSVNFRCk7CisgICAgICAgIH0KKyAgICAg ICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHRoID0gYWJzIChzLT5pbWctPnJlbGll Zik7CisgICAgICAgICAgICByYWlzZWRfcCA9IChzLT5pbWctPnJlbGllZiA+IDApOworICAgICAg ICAgIH0KKyAgICAgIHIub3JpZ2luLnggPSB4IC0gdGg7CisgICAgICByLm9yaWdpbi55ID0geSAt IHRoOworICAgICAgci5zaXplLndpZHRoID0gcy0+c2xpY2Uud2lkdGggKyAyKnRoLTE7CisgICAg ICByLnNpemUuaGVpZ2h0ID0gcy0+c2xpY2UuaGVpZ2h0ICsgMip0aC0xOworICAgICAgbnNfZHJh d19yZWxpZWYgKHIsIHRoLCByYWlzZWRfcCwKKyAgICAgICAgICAgICAgICAgICAgICBzLT5zbGlj ZS55ID09IDAsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueSArIHMtPnNsaWNlLmhl aWdodCA9PSBzLT5pbWctPmhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgICBzLT5zbGljZS54 ID09IDAsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueCArIHMtPnNsaWNlLndpZHRo ID09IHMtPmltZy0+d2lkdGgsIHMpOworICAgIH0KKyAgLyogSWYgdGhlcmUgaXMgbm8gbWFzaywg dGhlIGJhY2tncm91bmQgd29uJ3QgYmUgc2VlbiwKKyAgICAgc28gZHJhdyBhIHJlY3RhbmdsZSBv biB0aGUgaW1hZ2UgZm9yIHRoZSBjdXJzb3IuCisgICAgIERvIHRoaXMgZm9yIGFsbCBpbWFnZXMs IGdldHRpbmcgdHJhbnNwYXJlbmN5IHJpZ2h0IGlzIG5vdCByZWxpYWJsZS4gKi8KKyAgaWYgKHMt PmhsID09IERSQVdfQ1VSU09SKQorICAgIHsKKyAgICAgIGludCB0aGlja25lc3MgPSBhYnMgKHMt PmltZy0+cmVsaWVmKTsKKyAgICAgIGlmICh0aGlja25lc3MgPT0gMCkgdGhpY2tuZXNzID0gMTsK KyAgICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBICisgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19HTFlQSExFU1MpCisgICAgICB7CisgICAgICAgIE5TQ29sb3IgKmJvcmRlcl9jb2xv ciA9IFtOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IGxzbC5yZWQKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBncmVlbjogbHNs LmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGJsdWU6IGxzbC5ibHVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF07CisgICAgICAgIG5zX2RyYXdf Ym94IChiciwgdGhpY2tuZXNzLCBib3JkZXJfY29sb3IsIDEsIDEpOworICAgICAgfQorICAgICAg ZWxzZQorICAgICAgICBuc19kcmF3X2JveCAoYnIsIHRoaWNrbmVzcywgRlJBTUVfQ1VSU09SX0NP TE9SIChzLT5mKSwgMSwgMSk7CisgICAgfQorfQorCitzdGF0aWMgdm9pZAorbWNfbnNfZHJhd19v dmVyd3JpdHRlbiAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAq bWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93LCBz dHJ1Y3QgZ2x5cGggKmdseXBoKQoreworICAvLyAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1Mg KHJvdywgbWF0cml4KTsKKyAgLy8gIGNsb2NrX3QgY2xvY2tfc3RhcnQgPSBjbG9jaygpOworICAv LyBuc19kcmF3X3VuZGVyd2F2ZSAocywgcy0+d2lkdGgsIHMtPngpOworICBOU0NvbG9yICpob2xs b3dfY29sb3IgPSBGUkFNRV9CQUNLR1JPVU5EX0NPTE9SIChzLT5mKTsKKyAgc3RydWN0IGZhY2Ug KmZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIERFRkFVTFRfRkFDRV9JRCk7CisgIGludCB2bnRo ID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgIC8qIFNUUkVUQ0hfR0xZUEggbWF5 IGNvbnRhaW4gbW9yZSB0aGFuIG9uZSBmYWtlIGN1cnNvciBhdCB0aGUgc2FtZSBIUE9TLgorICBO T1RFOiAgQSBmYWtlIGN1cnNvciBmcm9tIG9uZSBjYWNoZSBtYXkgb3ZlcndyaXRlIGEgZmFrZSBj dXJzb3IgZnJvbSBhbm90aGVyCisgIGNhY2hlIC0tIHRodXMsIHdlIG11c3QgY2hlY2sgdGhlbSBh bGwgZm9yIG92ZXJ3cml0dGVuIGZha2UgY3Vyc29ycy4gKi8KKyAgZm9yIChlbnVtIG1jX2NhY2hl X3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNI RTsKKyAgICAgICArK2NhY2hlX3R5cGUpCisgICAgeworICAgICAgZm9yIChpbnQgbnRoID0gMDsK KyAgICAgICAgICAgcworICAgICAgICAgICAmJiBzLT53LT5tY19tYXRyaXguY3Vyc29yc191c2Vk W2NhY2hlX3R5cGVdID4gMAorICAgICAgICAgICAmJiBudGggPCBzLT53LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdOworICAgICAgICAgICArK250aCkKKyAgICAg ICAgeworICAgICAgICAgIGludCB4ID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXS54OworICAgICAgICAgIGludCBmeCA9IHMtPnctPm1jX21hdHJpeC52 cG9zW3ZudGhd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BzLT53LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZvcmVncm91bmQuZ3JlZW4sCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBzLT53LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZvcmVncm91bmQuYmx1ZX07CisgICAgICAg ICAgc3RydWN0IG1jX1JHQiBsc2xfYmcgPSB7LnJlZCA9IHMtPnctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmFja2dyb3VuZC5yZWQsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iYWNrZ3JvdW5kLmdyZWVuLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIC5ibHVlID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS5iYWNrZ3JvdW5kLmJsdWV9OworICAgICAgICAgIGJvb2wgYWN0 aXZlX3AgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmFjdGl2ZV9wOworICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IHMtPnct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGhfZmxhdm9y OworICAgICAgICAgIGJvb2wgZW5hYmxlZF9wID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3A7CisgICAgICAgICAgYm9vbCBnb19wID0g KHZwb3MgPT0gdm50aAorICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zID09IGdseXBoLT5o cG9zCisgICAgICAgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcCk7CisgICAgICAgICAgaWYg KCFnb19wKQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgTlNSZWN0IHI7CisgICAg ICAgICAgci5vcmlnaW4ueCA9IGZ4OworICAgICAgICAgIHIub3JpZ2luLnkgPSBmeTsKKyAgICAg ICAgICByLnNpemUuaGVpZ2h0ID0gaDsKKyAgICAgICAgICByLnNpemUud2lkdGggPSB3ZDsKKyAg ICAgICAgICBbW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogbHNsX2ZnLnJlZAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVuOiBsc2xfZmcuZ3JlZW4KKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogbHNsX2ZnLmJsdWUKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYTogMS4wXSBzZXRdOworICAg ICAgaWYgKGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gpCisgICAgICAgIHsKKyAgICAgICAg ICBMaXNwX09iamVjdCBidWYgPSBzLT53LT5jb250ZW50czsKKyAgICAgICAgICBDSEVDS19CVUZG RVIgKGJ1Zik7CisgICAgICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1Zik7Cisg ICAgICAgICAgYm9vbCByZWdpb25fYWN0aXZlX3AgPSAoIU5JTFAgKFZ0cmFuc2llbnRfbWFya19t b2RlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChi LCBtYXJrX2FjdGl2ZSkpKTsKKyAgICAgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZ2lubmluZyA9 IChyZWdpb25fYWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9iZWdpbm5pbmcgKCkpIDogLTE7 CisgICAgICAgICAgcHRyZGlmZl90IHJlZ2lvbl9lbmQgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IFhG SVhOVU0gKEZyZWdpb25fZW5kICgpKSA6IC0xOworICAgICAgICAgIHB0cmRpZmZfdCBvcG9pbnRf cHQgPSAocy0+dyA9PSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog WEZJWE5VTSAoRm1hcmtlcl9wb3NpdGlvbiAocy0+dy0+cG9pbnRtKSk7CisgICAgICAgICAgYm9v bCByZWdpb25faW5fYm91bmRzX3AgPSAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3B0ID49IHJlZ2lvbl9iZWdpbm5pbmcKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfcHQgPCByZWdpb25f ZW5kKTsKKyAgICAgICAgICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICYmIHJl Z2lvbl9pbl9ib3VuZHNfcAorICAgICAgICAgICAgICAmJiBhY3RpdmVfcCkKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2Vf aWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZha2Ut Y3Vyc29yLXJlZ2lvbi1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAq aG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2Fj dGl2ZV9yZWdpb25fZmFjZV9pZCk7CisgICAgICA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gICAgICAgIGVsc2UgaWYgKCFyZWdpb25fYWN0aXZlX3AgJiYgYWN0aXZlX3ApCisgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVf ZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBpbnRlcm4gKCIrLXJlYWwt ZmFrZS1jdXJzb3ItZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNl ICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGhvbGxvd19hY3RpdmVf ZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBOU0NvbG9yICpob2xsb3dfYWN0aXZlX2NvbG9y ID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2Fj dGl2ZV9mYWNlKSwgcy0+Zik7CisgICAgICAgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xs b3dfYWN0aXZlX2NvbG9yOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvKiBU aGUgcmVnaW9uIGlzIF9ub3RfIHZpc2libGUgaW4gdGhlIGluYWN0aXZlIHdpbmRvdyBiZWNhdXNl IHRoZSBvdmVybGF5IHdpbmRvdyBwcm9wZXJ0eSBpcyB1c2VkLiAqLworICAgICAgICAgICAgICAg IGVsc2UgaWYgKCFhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVk X2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1m YWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2lu YWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lk KTsKKyAgICAgICAgICAgICAgICAgICAgTlNDb2xvciAqaG9sbG93X2luYWN0aXZlX2NvbG9yID0g bnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2luYWN0 aXZlX2ZhY2UpLCBzLT5mKTsKKyAgICAgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9s bG93X2luYWN0aXZlX2NvbG9yOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAg ICAgIGVsc2UgaWYgKGZhY2UgJiYgTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSA9PSBuc19pbmRl eF9jb2xvciAoRlJBTUVfQ1VSU09SX0NPTE9SIChzLT5mKSwgcy0+ZikpCisgICAgICAgICAgewor ICAgICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQg KGZhY2UpLCBzLT5mKSBzZXRdOworICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VS U09SX0NPTE9SIChzLT5mKTsKKyAgICAgICAgICB9CisgICAgICAgICAgc3dpdGNoIChjdXJzb3Jf dHlwZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY2FzZSBNQ19OT19GUklOR0VfQklU TUFQOgorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX05PX0NV UlNPUjoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBNQ19SSUdI VF9GUklOR0VfQklUTUFQOgorICAgICAgICAgICAgICBjYXNlIE1DX0xFRlRfRlJJTkdFX0JJVE1B UDoKKyAgICAgICAgICAgICAgY2FzZSBNQ19GSUxMRURfQk9YOgorICAgICAgICAgICAgICAgIE5T UmVjdEZpbGwgKHIpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNl IE1DX0ZSQU1FRF9CT1g6CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAg ICAgICAgICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwg KE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgICAgICAgICAgW0ZSQU1FX0NVUlNPUl9D T0xPUiAocy0+Zikgc2V0XTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAg Y2FzZSBNQ19IT0xMT1dfQk9YOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAg ICAgICAgICAgICAgIFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAgICAgICAgICBOU1JlY3RG aWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICAgICAgICAgIFtGUkFNRV9DVVJT T1JfQ09MT1IgKHMtPmYpIHNldF07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAg ICAgIGNhc2UgTUNfSEJBUjoKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAg ICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgICAg ICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAg ICB9CisgICAgICAgICAgLyogSWYgYSBnbHlwaCBleGlzdHMgKHMtPmNoYXIyYiAhPSBOVUxMKSwg dGhlbiBkcmF3IHRoZSBnbHlwaCBvbiB0b3Agb2YgdGhlCisgICAgICAgICAgbmV3bHkgZHJhd24g cmVjdGFuZ2xlIHRoYXQgd2FzIGNyZWF0ZWQgaGVyZWluYWJvdmUuICBUbyB0aGUgZXh0ZW50IHRo YXQgd2UKKyAgICAgICAgICB3YW50IHRvIGRvdWJsZS1pbXByaW50IGdseXBocyB0byBtYWtlIHRo ZW0gYXBwZWFyIHRvIGJlIHNlbWktYm9sZCwgaXQgY2FuCisgICAgICAgICAgYmUgZG9uZSBoZXJl IGZvciBhbGwgY3Vyc29yIHR5cGVzLiAgVGhlIGJveC1zdHlsZSBjdXJzb3JzIGFyZSBpbXByaW50 ZWQKKyAgICAgICAgICB3aXRoIGdseXBocyBvbmx5IG9uZSAoMSkgdGltZS4gIFRoZSBzZW1pLWJv bGQgYXBwZWFyYW5jZSBpcyBoZWxwZnVsIHdoZW4KKyAgICAgICAgICBkZWJ1Z2dpbmcgdG8gc2Vl IHRoYXQgdGhlIGNvb3JkaW5hdGVzIGFyZSBjb3JyZWN0LiAqLworICAgICAgICAgIGlmIChzLT5j aGFyMmIgIT0gTlVMTAorICAgICAgICAgICAgICAmJiAoY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVE X0JPWAorICAgICAgICAgICAgICAgICAgfHwgY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWAor ICAgICAgICAgICAgICAgICAgfHwgY3Vyc29yX3R5cGUgPT0gTUNfSE9MTE9XX0JPWCkpCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIEJPT0wgaXNDb21wb3NpdGUgPSBzLT5maXJzdF9nbHlw aC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEg7CisgICAgICAgICAgICAgIGlmIChpc0NvbXBvc2l0 ZSkKKyAgICAgICAgICAgICAgICBuc19kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdy b3VuZCAocyk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICBzdHJ1Y3QgZm9udCAqZm9udCA9IHMtPmZhY2UtPmZvbnQ7CisgICAg ICAgICAgICAgICAgICAgIGlmICghZm9udCkKKyAgICAgICAgICAgICAgICAgICAgICBmb250ID0g RlJBTUVfRk9OVCAocy0+Zik7CisgICAgICAgICAgICAgICAgICAgIGJvb2wgd2l0aF9iZ19wID0g ZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIGZvbnQtPmRyaXZlci0+ZHJhdyAocywgcy0+Y21w X2Zyb20sIHMtPm5jaGFycywgcy0+eCwgcy0+eWJhc2UsIHdpdGhfYmdfcCk7CisgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIC8vICBjbG9ja190 IGNsb2NrX2VuZCA9IGNsb2NrKCk7CisgIC8vICBkb3VibGUgY3B1X3RpbWVfdXNlZCA9ICgoZG91 YmxlKSAoY2xvY2tfZW5kIC0gY2xvY2tfc3RhcnQpKSAvIENMT0NLU19QRVJfU0VDOworICAvLyAg ZnByaW50ZiAoc3RkZXJyLCAibnNfZHJhd19vdmVyd3JpdHRlbiAoJWQpOiAgVElNRSAoJWYpXG4i LCB2cG9zLCBjcHVfdGltZV91c2VkKTsKK30KKworc3RhdGljIHZvaWQKK21jX25zX21heWJlX2R1 bXBnbHlwaHNfYmFja2dyb3VuZCAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgY2hhciBmb3JjZV9w KQoreworICBOU1RSQUNFICgibWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIik7Cisg IGlmICghcy0+YmFja2dyb3VuZF9maWxsZWRfcC8qIHx8IHMtPmhsID09IERSQVdfTU9VU0VfRkFD RSovKQorICAgIHsKKyAgICAgIGludCBib3hfbGluZV93aWR0aCA9IG1heCAocy0+ZmFjZS0+Ym94 X2xpbmVfd2lkdGgsIDApOworICAgICAgaWYgKEZPTlRfSEVJR0hUIChzLT5mb250KSA8IHMtPmhl aWdodCAtIDIgKiBib3hfbGluZV93aWR0aAorICAgICAgICAgIC8qIFdoZW4geGRpc3AuYyBpZ25v cmVzIEZPTlRfSEVJR0hULCB3ZSBjYW5ub3QgdHJ1c3QgZm9udAorICAgICAgICAgICAgIGRpbWVu c2lvbnMsIHNpbmNlIHRoZSBhY3R1YWwgZ2x5cGhzIG1pZ2h0IGJlIG11Y2gKKyAgICAgICAgICAg ICBzbWFsbGVyLiAgU28gaW4gdGhhdCBjYXNlIHdlIGFsd2F5cyBjbGVhciB0aGUgcmVjdGFuZ2xl CisgICAgICAgICAgICAgd2l0aCBiYWNrZ3JvdW5kIGNvbG9yLiAqLworICAgICAgICAgIHx8IEZP TlRfVE9PX0hJR0ggKHMtPmZvbnQpCisgICAgICAgICAgfHwgcy0+Zm9udF9ub3RfZm91bmRfcCB8 fCBzLT5leHRlbmRzX3RvX2VuZF9vZl9saW5lX3AgfHwgZm9yY2VfcCkKKyAgICAgICAgeworICAg ICAgICAgIHN0cnVjdCBmYWNlICpmYWNlOworICAgICAgICAgIGlmIChzLT5obCA9PSBEUkFXX01P VVNFX0ZBQ0UpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01f SUQgKHMtPmYsIE1PVVNFX0hMX0lORk8gKHMtPmYpLT5tb3VzZV9mYWNlX2ZhY2VfaWQpOworICAg ICAgICAgICAgICBpZiAoIWZhY2UpCisgICAgICAgICAgICAgICAgZmFjZSA9IEZBQ0VfRlJPTV9J RCAocy0+ZiwgTU9VU0VfRkFDRV9JRCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNl CisgICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIHMtPmZpcnN0X2dseXBo LT5mYWNlX2lkKTsKKyAgICAgICAgICBpZiAoIWZhY2UtPnN0aXBwbGUpCisgICAgICAgICAgICBb KE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSkgIT0gMAorICAgICAgICAgICAgICA/IG5zX2xvb2t1 cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKQorICAgICAg ICAgICAgICA6IEZSQU1FX0JBQ0tHUk9VTkRfQ09MT1IgKHMtPmYpKSBzZXRdOworICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RydWN0IG5zX2Rpc3Bs YXlfaW5mbyAqZHB5aW5mbyA9IEZSQU1FX0RJU1BMQVlfSU5GTyAocy0+Zik7CisgICAgICAgICAg ICAgICAgW1tkcHlpbmZvLT5iaXRtYXBzW2ZhY2UtPnN0aXBwbGUtMV0uaW1nIHN0aXBwbGVNYXNr XSBzZXRdOworICAgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKHMtPmhsICE9IERSQVdfQ1VS U09SKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzLT5yZWN0YW5nbGVfbnVrZWRfcCA9 IHRydWU7CisgICAgICAgICAgICAgIE5TUmVjdCByID0gTlNNYWtlUmVjdCAocy0+eCwgcy0+eSAr IGJveF9saW5lX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+ YmFja2dyb3VuZF93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMt PmhlaWdodC0yKmJveF9saW5lX3dpZHRoKTsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7 CisgICAgICAgICAgICB9CisgICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7Cisg ICAgICAgIH0KKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkCittY19uc19kcmF3X2dseXBoX3N0cmlu ZyAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBz dHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1j X1JHQiBsc2wsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAg ICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLAorICAgICAg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eXBlICE9IElNQUdFX0dMWVBIKQorICAgICAgICAgIHsKKyAgICAgICAg ICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBTVFJFVENIX0dMWVBIKQorICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9y ZWN0IChzLT5uZXh0LCByKTsKKyAgICAgICAgICAgICAgICBpZiAoIW1jX25zX2NsaXBfdG9fcmVj dCAocy0+Ziwgciwgbiwgcm93KSkKKyAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAg ICAgICAgICBtY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQgKHMtPm5leHQsIDEpOwor ICAgICAgICAgICAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChzLT5mKTsKKyAgICAgICAgICAgICAg fQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbWNf bnNfZHVtcGdseXBoc19zdHJldGNoIChzLT5uZXh0LCB3ZCwgcm93KTsKKyAgICAgICAgICAgICAg ICBpZiAoKHMtPm5leHQtPmxlZnRfb3ZlcndyaXR0ZW5fcCB8fCBzLT5uZXh0LT5yaWdodF9vdmVy d3JpdHRlbl9wKQorICAgICAgICAgICAgICAgICAgICAmJiAocy0+bmV4dC0+YWN0aW9uX3R5cGUg PT0gTUNfRFJBV19HTFlQSCB8fCBzLT5uZXh0LT5hY3Rpb25fdHlwZSA9PSBNQ19FUkFTRV9HTFlQ SCkpCisgICAgICAgICAgICAgICAgICBtY19uc19kcmF3X292ZXJ3cml0dGVuIChzLT5uZXh0LCBt YXRyaXgsIHJvdywgcy0+bmV4dC0+Zmlyc3RfZ2x5cGgpOworICAgICAgICAgICAgICB9CisgICAg ICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgIH0KKyAgICB9CisgIGlmICgh cy0+Zm9yX292ZXJsYXBzICYmIHMtPmZhY2UtPmJveCAhPSBGQUNFX05PX0JPWAorICAgICAgJiYg KHMtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgICB8fCBzLT5maXJz dF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpKQorICAgIHsKKyAgICAgIG4gPSBuc19n ZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW1jX25zX2NsaXBf dG9fcmVjdCAocy0+Ziwgciwgbiwgcm93KSkKKyAgICAgICAgcmV0dXJuOworICAgICAgbWNfbnNf bWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLCAxKTsKKyAgICAgIG5zX2R1bXBnbHlwaHNf Ym94X29yX3JlbGllZiAocyk7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAg ICBib3hfZHJhd25fcCA9IDE7CisgICAgfQorICBzd2l0Y2ggKHMtPmZpcnN0X2dseXBoLT50eXBl KQorICAgIHsKKyAgICBjYXNlIElNQUdFX0dMWVBIOgorICAgICAgbiA9IG5zX2dldF9nbHlwaF9z dHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICghbWNfbnNfY2xpcF90b19yZWN0IChz LT5mLCByLCBuLCByb3cpKQorICAgICAgICByZXR1cm47CisgICAgICBtY19uc19kdW1wZ2x5cGhz X2ltYWdlIChzLCByWzBdLCBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIGFjdGl2ZV9w KTsKKyAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChzLT5mKTsKKyAgICAgIGJyZWFrOworICAgIGNh c2UgU1RSRVRDSF9HTFlQSDoKKyAgICAgIG1jX25zX2R1bXBnbHlwaHNfc3RyZXRjaCAocywgd2Qs IHJvdyk7CisgICAgICBpZiAoKHMtPmxlZnRfb3ZlcndyaXR0ZW5fcCB8fCBzLT5yaWdodF9vdmVy d3JpdH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0JPWAorICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2Vf aWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZha2Ut Y3Vyc29yLWluYWN0aXZlLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgIHN0cnVjdCBmYWNl ICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2luYWN0 aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2Up ID0gTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3dfaW5hY3RpdmVfZmFjZSk7CisgICAgICAgICAg ICB9CisgICAgICB7CisgICAgICAgIEJPT0wgaXNDb21wb3NpdGUgPSBzLT5maXJzdF9nbHlwaC0+ dHlwZSA9PSBDT01QT1NJVEVfR0xZUEg7CisgICAgICAgIGlmIChpc0NvbXBvc2l0ZSkKKyAgICAg ICAgICBuc19kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBib29sIHdpdGhfYmdfcCA9 ICgoZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX05PUk1BTCAmJiAhcy0+YmFja2dyb3VuZF9maWxsZWRf cCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZmxhZ3MgPT0gTlNfRFVNUEdM WVBIX01PVVNFRkFDRSk7CisgICAgICAgICAgICAgIGlmICh3aXRoX2JnX3ApCisgICAgICAgICAg ICAgICAgcy0+YmFja2dyb3VuZF9udWtlZF9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgZm9udC0+ ZHJpdmVyLT5kcmF3IChzLCBzLT5jbXBfZnJvbSwgcy0+bmNoYXJzLCBzLT54LCBzLT55YmFzZSwg d2l0aF9iZ19wKTsKKyAgICAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIHsKKyAgICAgICAgTlND b2xvciAqY29sID0gKE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgIT0gMAorICAgICAgICAg ICAgICAgICAgICAgICAgPyBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JP VU5EIChzLT5mYWNlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHMtPmYpCisgICAgICAgICAgICAgICAgICAgICAgICA6IEZSQU1FX0ZPUkVHUk9V TkRfQ09MT1IgKHMtPmYpKTsKKyAgICAgICAgW2NvbCBzZXRdOworICAgICAgICAvKiBEcmF3IHVu ZGVybGluZSwgb3ZlcmxpbmUsIHN0cmlrZS10aHJvdWdoLiAqLworICAgICAgICBtY19uc19kcmF3 X3RleHRfZGVjb3JhdGlvbiAocywgcy0+ZmFjZSwgY29sLCBzLT53aWR0aCwgcy0+eCk7CisgICAg ICB9CisgICAgICB7CisgICAgICAgIGlmIChzLT5maXJzdF9nbHlwaC0+dHlwZSAhPSBDT01QT1NJ VEVfR0xZUEgKKyAgICAgICAgICAgICYmIChzLT5sZWZ0X292ZXJ3cml0dGVuX3AgfHwgcy0+cmln aHRfb3ZlcndyaXR0ZW5fcCkKKyAgICAgICAgICAgICYmIChzLT5iYWNrZ3JvdW5kX251a2VkX3Ag fHwgcy0+cmVjdGFuZ2xlX251a2VkX3ApCisgICAgICAgICAgICAmJiAocy0+YWN0aW9uX3R5cGUg PT0gTUNfRFJBV19HTFlQSCB8fCBzLT5hY3Rpb25fdHlwZSA9PSBNQ19FUkFTRV9HTFlQSCkpCisg ICAgICAgICAgbWNfbnNfZHJhd19vdmVyd3JpdHRlbiAocywgbWF0cml4LCByb3csIHMtPmZpcnN0 X2dseXBoKTsKKyAgICAgIH0KKyAgICAgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUgorICAgICAg ICAgICYmIGN1cnNvcl90eXBlID09IE1DX0ZJTExFRF9CT1gpCisgICAgICAgIHsKKyAgICAgICAg ICB1bnNpZ25lZCBsb25nIHRtcCA9IE5TX0ZBQ0VfQkFDS0dST1VORCAocy0+ZmFjZSk7CisgICAg ICAgICAgTlNfRkFDRV9CQUNLR1JPVU5EIChzLT5mYWNlKSA9IE5TX0ZBQ0VfRk9SRUdST1VORCAo cy0+ZmFjZSk7CisgICAgICAgICAgTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKSA9IHRtcDsK KyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUgorICAgICAg ICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YKQorICAgICAgICAgIE5T X0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgPSBzYXZlZF9mZzsKKyAgICAgIG5zX3Jlc2V0X2Ns aXBwaW5nIChzLT5mKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgor ICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlm ICghbWNfbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuLCByb3cpKQorICAgICAgICByZXR1cm47 CisgICAgICBpZiAocy0+Zm9yX292ZXJsYXBzIHx8IChzLT5jbXBfZnJvbSA+IDAKKyAgICAgICAg ICAgICYmICEgcy0+Zmlyc3RfZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykpCisgICAgICAgIHMtPmJh Y2tncm91bmRfZmlsbGVkX3AgPSAxOworICAgICAgZWxzZQorICAgICAgICBtY19uc19tYXliZV9k dW1wZ2x5cGhzX2JhY2tncm91bmQgKHMsIHMtPmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lU RV9HTFlQSCk7CisgICAgICAvKiAuLi4gKi8KKyAgICAgIC8qIE5vdCB5ZXQgaW1wbGVtZW50ZWQu ICovCisgICAgICAvKiAuLi4gKi8KKyAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChzLT5mKTsKKyAg ICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgICB9Cisg IC8qIERyYXcgYm94IGlmIG5vdCBkb25lIGFscmVhZHkuICovCisgIGlmICghcy0+Zm9yX292ZXJs YXBzICYmICFib3hfZHJhd25fcCAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisgICAg eworICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAg IGlmICghbWNfbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuLCByb3cpKQorICAgICAgICByZXR1 cm47CisgICAgICBuc19kdW1wZ2x5cGhzX2JveF9vcl9yZWxpZWYgKHMpOworICAgICAgbnNfcmVz ZXRfY2xpcHBpbmcgKHMtPmYpOworICAgIH0KKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyog ZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8q ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09CiAKICAgIE5TVFJBQ0UsIFRyYWNlIHN1cHBvcnQuCkBAIC0xMTA5 LDYgKzIxNjQsMTYgQEAgc3RhdGljIE5TUmVjdCBjb25zdHJhaW5fZnJhbWVfcmVjdChOU1JlY3Qg ZnJhbWVSZWN0LCBib29sIGlzRnVsbHNjcmVlbikKICAgIGV4dGVybmFsIChSSUYpIGNhbGw7IHdo b2xlIGZyYW1lLCBjYWxsZWQgYmVmb3JlIHVwZGF0ZV93aW5kb3dfYmVnaW4KICAgIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBmOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAjaWZkZWYgTlNfSU1QTF9DT0NPQQogICBFbWFjc1ZpZXcgKnZp ZXcgPSBGUkFNRV9OU19WSUVXIChmKTsKIApAQCAtMTIwOSw2ICsyMjc0LDE2IEBAIHN0YXRpYyBO U1JlY3QgY29uc3RyYWluX2ZyYW1lX3JlY3QoTlNSZWN0IGZyYW1lUmVjdCwgYm9vbCBpc0Z1bGxz Y3JlZW4pCiAKIC8qICAgaWYgKGYgPT0gTU9VU0VfSExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfbW91 c2VfZnJhbWUpICovCiAgIE1PVVNFX0hMX0lORk8gKGYpLT5tb3VzZV9mYWNlX2RlZmVyID0gMDsK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICBmLT5tY191cGRhdGluZ19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKIH0KIAogCkBAIC00ODAzLDYgKzU4NzgsMTcgQEAgaW4gY2VydGFpbiBzaXR1YXRpb25z IChyYXBpZCBpbmNvbWluZyBldmVudHMpLgogICAgICAgYmFyID0gW1tFbWFjc1Njcm9sbGVyIGFs bG9jXSBpbml0RnJhbWU6IHIgd2luZG93OiB3aW5dOwogICAgICAgd3NldF92ZXJ0aWNhbF9zY3Jv bGxfYmFyICh3aW5kb3csIG1ha2VfbWludF9wdHIgKGJhcikpOwogICAgICAgdXBkYXRlX3AgPSBZ RVM7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgICAgIC8qIFRoaXMgaXMgb25seSBmb3IgZGVidWdnaW5nIHB1cnBvc2VzLiAqLworICAg ICAgW2JhciBtY19zZXRfcmVjdGFuZ2xlOiByXTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAgIH0KICAgZWxzZQogICAgIHsKQEAgLTQ4MTAsMTIgKzU4OTYsMzAgQEAgaW4gY2Vy dGFpbiBzaXR1YXRpb25zIChyYXBpZCBpbmNvbWluZyBldmVudHMpLgogICAgICAgYmFyID0gWE5T X1NDUk9MTF9CQVIgKHdpbmRvdy0+dmVydGljYWxfc2Nyb2xsX2Jhcik7CiAgICAgICBvbGRSZWN0 ID0gW2JhciBmcmFtZV07CiAgICAgICByLnNpemUud2lkdGggPSBvbGRSZWN0LnNpemUud2lkdGg7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK ICAgICAgIGlmIChGUkFNRV9MSVZFX1AgKGYpICYmICFOU0VxdWFsUmVjdHMgKG9sZFJlY3QsIHIp KQogICAgICAgICB7CisgICAgICAgICAgLyogVGhlIG1haW4gd2luZG93IGhhcyBwcm9iYWJseSBi ZWVuIHJlc2l6ZWQuICBHcmFjaW91c2x5IGRlbGV0ZSB0aGUKKyAgICAgICAgICBvbGQgc2Nyb2xs IGJhciB3aXRob3V0IHJlcGFpbnRpbmcgaXRzIHJlY3RhbmdsZTsgYW5kLCBjcmVhdGUgYSBuZXcK KyAgICAgICAgICBzY3JvbGwgYmFyIGVsc2V3aGVyZS4qLwogICAgICAgICAgIGlmIChvbGRSZWN0 Lm9yaWdpbi54ICE9IHIub3JpZ2luLngpCisgICAgICAgICAgICB7CiAgICAgICAgICAgICAgIG5z X2NsZWFyX2ZyYW1lX2FyZWEgKGYsIGxlZnQsIHRvcCwgd2lkdGgsIGhlaWdodCk7CisgICAgICAg ICAgICAgIFtiYXIgbWNfanVkZ2VdOworICAgICAgICAgICAgICBiYXIgPSBbW0VtYWNzU2Nyb2xs ZXIgYWxsb2NdIGluaXRGcmFtZTogciB3aW5kb3c6IHdpbl07CisgICAgICAgICAgICAgIHdzZXRf dmVydGljYWxfc2Nyb2xsX2JhciAod2luZG93LCBtYWtlX21pbnRfcHRyIChiYXIpKTsKKyAgICAg ICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKICAgICAgICAgICBbYmFyIHNldEZyYW1lOiByXTsK ICAgICAgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgfQogCiAgIGlm ICh1cGRhdGVfcCkKQEAgLTQ5NzUsOSArNjA3OSw1NyBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMg KHJhcGlkIGluY29taW5nIGV2ZW50cykuCiAgICAgewogICAgICAgdmlldyA9IFtzdWJ2aWV3cyBv YmplY3RBdEluZGV4OiBpXTsKICAgICAgIGlmICghW3ZpZXcgaXNLaW5kT2ZDbGFzczogW0VtYWNz U2Nyb2xsZXIgY2xhc3NdXSkgY29udGludWU7Ci0gICAgICBpZiAoW3ZpZXcganVkZ2VdKQorCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8q IGBYU0VUV0lORE9XJyB3aWxsIHNvbWV0aW1lcyBjYXVzZSBFbWFjcyB0byBjcmFzaCB3aGVuIHJ1 bm5pbmcgdW5kZXIgZ2RiIGV2ZW4KKyAgdGhvdWdoICh3ICE9IE5VTEwpLiAgVGhlcmVmb3JlLCB3 ZSBjYW5ub3QgcmVsaWFibHkgdXNlIGBXSU5ET1dfTElWRV9QJy4gKi8KKyAgc3RydWN0IHdpbmRv dyAqdyA9IFt2aWV3IG1jX2dldF93aW5kb3ddOworICBpZiAodyAhPSBOVUxMCisgICAgICAmJiBO SUxQICh3LT5jb250ZW50cykpCisgICAgeworICAgICAgQk9PTCBkZWJ1Z19wID0gZmFsc2U7Cisg ICAgICBpZiAoZGVidWdfcAorICAgICAgICAgIC8qIGB3aW5kb3dfYm94JyBjYWxscyBgd2luZG93 X2JveF9oZWlnaHQnLCB3aGljaCB3aWxsIGNhdXNlIEVtYWNzIHRvCisgICAgICAgICAgY3Jhc2gg aWYgRlJBTUVQICh3LT5mcmFtZSkgaXMgbm90IHNhdGlzZmllZC4gKi8KKyAgICAgICAgICAmJiBG UkFNRVAgKHctPmZyYW1lKSkKKyAgICAgICAgeworICAgICAgICAgIE5TUmVjdCByMCA9IFt2aWV3 IG1jX2dldF9yZWN0YW5nbGVdOworICAgICAgICAgIGludCB4MCA9IE5TTWluWCAocjApOworICAg ICAgICAgIGludCB5MCA9IE5TTWluWSAocjApOworICAgICAgICAgIGludCB3ZDAgPSBOU1dpZHRo IChyMCk7CisgICAgICAgICAgaW50IGgwID0gTlNIZWlnaHQgKHIwKTsKKyAgICAgICAgICBpbnQg d2luZG93X3ksIHdpbmRvd19oZWlnaHQ7CisgICAgICAgICAgd2luZG93X2JveCAodywgQU5ZX0FS RUEsIDAsICZ3aW5kb3dfeSwgMCwgJndpbmRvd19oZWlnaHQpOworICAgICAgICAgIGludCB0b3Ag PSB3aW5kb3dfeTsKKyAgICAgICAgICBpbnQgaGVpZ2h0ID0gd2luZG93X2hlaWdodDsKKyAgICAg ICAgICBpbnQgd2lkdGggPSBXSU5ET1dfQ09ORklHX1NDUk9MTF9CQVJfQ09MUyAodykgKiBGUkFN RV9DT0xVTU5fV0lEVEggKGYpOworICAgICAgICAgIGludCBsZWZ0ID0gV0lORE9XX1NDUk9MTF9C QVJfQVJFQV9YICh3KTsKKyAgICAgICAgICBOU1JlY3QgcjEgPSBOU01ha2VSZWN0IChsZWZ0LCB0 b3AsIHdpZHRoLCBoZWlnaHQpOworICAgICAgICAgIC8qIFRoZSBwYXJlbnQgdmlldyBpcyBmbGlw cGVkLCBzbyB3ZSBuZWVkIHRvIGZsaXAgeSB2YWx1ZS4gKi8KKyAgICAgICAgICBFbWFjc1ZpZXcg KmZyYW1lX3ZpZXcgPSBGUkFNRV9OU19WSUVXIChmKTsKKyAgICAgICAgICBOU1JlY3QgdiA9IFtm cmFtZV92aWV3IGZyYW1lXTsKKyAgICAgICAgICByMS5vcmlnaW4ueSA9ICh2LnNpemUuaGVpZ2h0 IC0gcjEuc2l6ZS5oZWlnaHQgLSByMS5vcmlnaW4ueSk7CisgICAgICAgICAgaW50IHgxID0gTlNN aW5YIChyMSk7CisgICAgICAgICAgaW50IHkxID0gTlNNaW5ZIChyMSk7CisgICAgICAgICAgaW50 IHdkMSA9IE5TV2lkdGggKHIxKTsKKyAgICAgICAgICBpbnQgaDEgPSBOU0hlaWdodCAocjEpOwor ICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiVzIC0tIERFQUQ6XG5cCisgICAgICAgICAgeDAv eDEgKCVkLyVkKSB8IHkwL3kxICglZC8lZCkgfCB3ZDAvd2QxICglZC8lZCkgfCBoMC9oMSAoJWQv JWQpXG4iLAorICAgICAgICAgIG1jX3dpbmRvdyAodyksIHgwLCB4MSwgeTAsIHkxLCB3ZDAsIHdk MSwgaDAsIGgxKTsKKyAgICAgICAgfQorICAgICAgaWYgKFt2aWV3IG1jX2p1ZGdlXSkKICAgICAg ICAgcmVtb3ZlZCA9IFlFUzsKICAgICB9CisgICAgZWxzZSBpZiAoW3ZpZXcganVkZ2VdKQorICAg ICAgcmVtb3ZlZCA9IFlFUzsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKworICAgIH0K IAogICBpZiAocmVtb3ZlZCkKICAgICBbZXZpZXcgdXBkYXRlRnJhbWVTaXplOiBOT107CkBAIC01 MTA2LDYgKzYyNTgsMjEgQEAgc3RhdGljIExpc3BfT2JqZWN0IG5zX3N0cmluZ190b19saXNwbW9k IChjb25zdCBjaGFyICpzKQogZXh0ZXJuIGZyYW1lX3Bhcm1faGFuZGxlciBuc19mcmFtZV9wYXJt X2hhbmRsZXJzW107CiBzdGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UgbnNfcmVkaXNw bGF5X2ludGVyZmFjZSA9CiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgbnN0ZXJtLm1g IG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVy ZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfeF93cml0ZV9nbHlwaHMsCisgIG1j X25zX2RyYXdfd2luZG93X2N1cnNvciwKKyAgbWNfbnNfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgbnNfZnJhbWVfcGFybV9oYW5kbGVycywKICAg eF9wcm9kdWNlX2dseXBocywKICAgeF93cml0ZV9nbHlwaHMsCkBAIC04NzIxLDYgKzk4ODgsNDkg QEAgLSAoQk9PTCljYW5CZWNvbWVNYWluV2luZG93CiAKIEBpbXBsZW1lbnRhdGlvbiBFbWFjc1Nj cm9sbGVyCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTogKE5TUmVjdClyZWN0Cit7CisgIG1jX3Jl Y3RhbmdsZSA9IHJlY3Q7Cit9CisKKy0gKE5TUmVjdCltY19nZXRfcmVjdGFuZ2xlCit7CisgIHJl dHVybiBtY19yZWN0YW5nbGU7Cit9CisKKy0gKHN0cnVjdCB3aW5kb3cgKiltY19nZXRfd2luZG93 Cit7CisgIHJldHVybiB3aW5kb3c7Cit9CisKKy0gKGJvb2wpbWNfanVkZ2UKK3sKKyAgTlNUUkFD RSAoIltFbWFjc1Njcm9sbGVyIG1jX2p1ZGdlXSIpOworICBib29sIHJldCA9IGNvbmRlbW5lZDsK KyAgYmxvY2tfaW5wdXQgKCk7CisgIGlmIChjb25kZW1uZWQpCisgICAgeworICAgICAgLyogZW5z dXJlIG90aGVyIHNjcm9sbGJhciB1cGRhdGVzIGFmdGVyIGRlbGV0aW9uICovCisgICAgICBFbWFj c1ZpZXcgKnZpZXcgPSAoRW1hY3NWaWV3ICopRlJBTUVfTlNfVklFVyAoZnJhbWUpOworICAgICAg aWYgKHZpZXcgIT0gbmlsKQor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cz Ml9kcmF3X3N0cmV0Y2hfZ2x5cGhfc3RyaW5nIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzKQorewor ICBlYXNzZXJ0IChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKTsKKyAgaWYg KHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAmJiAheF9zdHJldGNoX2N1cnNvcl9wKQorICAg IHsKKyAgICAgIC8qIElmIGB4LXN0cmV0Y2gtY3Vyc29yJyBpcyBuaWwsIGRvbid0IGRyYXcgYSBi bG9jayBjdXJzb3IgYXMKKyAgIHdpZGUgYXMgdGhlIHN0cmV0Y2ggZ2x5cGguICAqLworICAgICAg aW50IHdpZHRoLCBiYWNrZ3JvdW5kX3dpZHRoID0gcy0+YmFja2dyb3VuZF93aWR0aDsKKyAgICAg IGludCB4ID0gcy0+eDsKKyAgICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQorICAgICAgICB7 CisgICAgICAgICAgaW50IGxlZnRfeCA9IHdpbmRvd19ib3hfbGVmdF9vZmZzZXQgKHMtPncsIFRF WFRfQVJFQSk7CisgICAgICAgICAgaWYgKHggPCBsZWZ0X3gpCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0gbGVmdF94IC0geDsKKyAgICAgICAgICAgICAg eCA9IGxlZnRfeDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgIGVsc2UKKyAgICAg ICAgeworICAgICAgICAgIC8qIEluIFIyTCByb3dzLCBkcmF3IHRoZSBjdXJzb3Igb24gdGhlIHJp Z2h0IGVkZ2Ugb2YgdGhlCisgICAgICAgICAgICAgc3RyZXRjaCBnbHlwaC4gICovCisgICAgICAg ICAgaW50IHJpZ2h0X3ggPSB3aW5kb3dfYm94X3JpZ2h0IChzLT53LCBURVhUX0FSRUEpOworICAg ICAgICAgIGlmICh4ICsgYmFja2dyb3VuZF93aWR0aCA+IHJpZ2h0X3gpCisgICAgICAgICAgICBi YWNrZ3JvdW5kX3dpZHRoIC09IHggLSByaWdodF94OworICAgICAgICAgIHggKz0gYmFja2dyb3Vu ZF93aWR0aDsKKyAgICAgICAgfQorICAgICAgd2lkdGggPSBtaW4gKEZSQU1FX0NPTFVNTl9XSURU SCAocy0+ZiksIGJhY2tncm91bmRfd2lkdGgpOworICAgICAgaWYgKHMtPnJvdy0+cmV2ZXJzZWRf cCkKKyAgICAgICAgeCAtPSB3aWR0aDsKKyAgICAgIC8qIERyYXcgY3Vyc29yLiAgKi8KKyAgICAg IHhfZHJhd19nbHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwgcy0+eSwgd2lkdGgsIHMtPmhlaWdo dCk7CisgICAgICAvKiBDbGVhciByZXN0IHVzaW5nIHRoZSBHQyBvZiB0aGUgb3JpZ2luYWwgbm9u LWN1cnNvciBmYWNlLiAgKi8KKyAgICAgIGlmICh3aWR0aCA8IGJhY2tncm91bmRfd2lkdGgpCisg ICAgICAgIHsKKyAgICAgICAgICBYR0NWYWx1ZXMgKmdjID0gcy0+ZmFjZS0+Z2M7CisgICAgICAg ICAgaW50IHkgPSBzLT55OworICAgICAgICAgIGludCB3ID0gYmFja2dyb3VuZF93aWR0aCAtIHdp ZHRoLCBoID0gcy0+aGVpZ2h0OworICAgICAgICAgIFJFQ1QgcjsKKyAgICAgICAgICAgICAgICBI REMgaGRjID0gcy0+aGRjOworICAgICAgICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQorICAg ICAgICAgICAgeCArPSB3aWR0aDsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB4ID0gcy0+ eDsKKyAgICAgICAgICBpZiAocy0+cm93LT5tb3VzZV9mYWNlX3AKKyAgICAgICAgICAgICAgJiYg Y3Vyc29yX2luX21vdXNlX2ZhY2VfcCAocy0+dykpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIHhfc2V0X21vdXNlX2ZhY2VfZ2MgKHMpOworICAgICAgICAgICAgICBnYyA9IHMtPmdjOwor ICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGdjID0gcy0+ZmFjZS0+ Z2M7CisgICAgICAgICAgZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsICZyKTsKKyAgICAg ICAgICB3MzJfc2V0X2NsaXBfcmVjdGFuZ2xlIChoZGMsICZyKTsKKyNpZiAwIC8qIFRPRE86IHN0 aXBwbGUgKi8KKyAgICAgICAgICBpZiAocy0+ZmFjZS0+c3RpcHBsZSkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgLyogRmlsbCBiYWNrZ3JvdW5kIHdpdGggYSBzdGlwcGxlIHBhdHRlcm4u ICAqLworICAgICAgICAgICAgICBYU2V0RmlsbFN0eWxlIChzLT5kaXNwbGF5LCBnYywgRmlsbE9w YXF1ZVN0aXBwbGVkKTsKKyAgICAgICAgICAgICAgWEZpbGxSZWN0YW5nbGUgKHMtPmRpc3BsYXks IHMtPndpbmRvdywgZ2MsIHgsIHksIHcsIGgpOworICAgICAgICAgICAgICBYU2V0RmlsbFN0eWxl IChzLT5kaXNwbGF5LCBnYywgRmlsbFNvbGlkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBl bHNlCisjZW5kaWYKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAo cy0+Ziwgcy0+aGRjLCBnYy0+YmFja2dyb3VuZCwgeCwgeSwgdywgaCk7CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICB9CisgIGVsc2UgaWYgKCFzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wKQor ICAgIHsKKyAgICAgIGludCBiYWNrZ3JvdW5kX3dpZHRoID0gcy0+YmFja2dyb3VuZF93aWR0aDsK KyAgICAgIGludCB4ID0gcy0+eCwgbGVmdF94ID0gd2luZG93X2JveF9sZWZ0X29mZnNldCAocy0+ dywgVEVYVF9BUkVBKTsKKyAgICAg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Nob3NlbiBzbwor ICAgICAgdGhhdCB0aGUgZ2x5cGggaXMgbGVnaWJsZS4gICovCisgICAgICBpZiAoZmFjZS0+YmFj a2dyb3VuZCA9PSBjdXJzb3JfY29sb3IKKyAgICAgICAgICAmJiAhY3Vyc29yX2djX2ludmlzaWJs ZV9va2F5X3ApCisgICAgICAgIGN1cnNvcl9jb2xvciA9IGZhY2UtPmZvcmVncm91bmQ7CisgICAg ICBpbnQgZGVmYXVsdF9meCA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVMX1ggKHcsIHgpOwor ICAgICAgaGRjID0gZ2V0X2ZyYW1lX2RjIChmKTsKKyAgICAgIHczMl9jbGlwX3RvX3JvdyAodywg cm93LCBURVhUX0FSRUEsIGhkYyk7CisgICAgICBpbnQgcnggPSBmeDsKKyAgICAgIGludCByeSA9 IGZ5OworICAgICAgaW50IHJ3ID0gd2Q7CisgICAgICBpbnQgcmggPSBoOworLyoKKyAgICBmcHJp bnRmIChzdGRlcnIsICJNQ19IQkFSOiAgZnggKCVkKSB8IGZ5ICglZCkgfCB3ZCAoJWQpIHwgaCAo JWQpXG4iLCByeCwgcnksIHJ3LCByaCk7CisqLworICAgICAgdzMyX2ZpbGxfYXJlYSAoZiwgaGRj LCBjdXJzb3JfY29sb3IsIHJ4LCByeSwgcncsIHJoKTsKKyAgICAgIHczMl9zZXRfY2xpcF9yZWN0 YW5nbGUgKGhkYywgTlVMTCk7CisgICAgICByZWxlYXNlX2ZyYW1lX2RjIChmLCBoZGMpOworICAg IH0KK30KKworLyogUklGOiBEcmF3IG9yIGNsZWFyIGN1cnNvciBvbiB3aW5kb3cgVy4gICovCitz dGF0aWMgdm9pZAorbWNfdzMyX2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywg c3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAg ICAgICAgICAgICAgICBpbnQgeCwgaW50IGZ4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fYWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9i ZWdpbm5pbmcgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2VuZCA9IChyZWdpb25f YWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9lbmQgKCkpIDogLTE7CisgICAgICBwdHJkaWZm X3Qgb3BvaW50X3B0ID0gKHcgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBY RklYTlVNIChGbWFya2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pKTsKKyAgICAgIGJvb2wgcmVnaW9u X2luX2JvdW5kc19wID0gKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgb3BvaW50X3B0ID49IHJlZ2lvbl9iZWdpbm5pbmcKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF9wdCA8IHJlZ2lvbl9lbmQpOworICAgICAgaWYg KGN1cnNvcl9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCAmJiBsc2wucmVkID49IDAgJiYgbHNs LmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRl bXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MnIGJ5IGJvcnJv d2luZyB0aGUKKyAgICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHczMmZu cy5jLiAgKi8KKyAgICAgICAgICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICYm IHJlZ2lvbl9pbl9ib3VuZHNfcAorICAgICAgICAgICAgICAmJiBhY3RpdmVfcCkKKyAgICAgICAg ICAgIHsKKyAgICAg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VuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAg ICAgICAgICB7CisgICAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9k YXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53 MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgICAgbWNfdzMyX2RyYXdf aG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywg d2QsIGgpOworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBv cmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRf ZGF0YS53MzItPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAgICAgICAgICAgICBmdW5j dGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHczMmZucy5jLiAgKi8KKyAgICAgICAgICAgICAg aWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYgcmVnaW9uX2luX2JvdW5k c19wCisgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZV9p ZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3It cmVnaW9uLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9s bG93X2FjdGl2ZV9yZWdpb25f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G93X2FjdGl2 ZV9yZWdpb25fb3V0X2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQg aG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAo IistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICBz dHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3df YWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3Vu ZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAg Z2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfZmFjZS0+Zm9y ZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYg KCFyZWdpb25fYWN0aXZlX3AgJiYgYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0g bG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNl IiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0 aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAg ICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2Zh Y2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgICA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AoKTsKKyAgICAgICAgICAgICAgLyogRm9yY2UgYG1jX3czMl9zZXRf Y3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djJy4gICov CisgICAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSB0cnVlOworICAgICAgICAgICAgICBt Y19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9z LCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsLCBnbHlwaF9m bGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICAgICAg ICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MgPSBvcmlnaW5hbF9jdXJzb3JfZ2M7 CisgICAgICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgIG1jX3czMl9k cmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZw b3MsIHdkLCBoKTsKKyAgICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNl IE1DX0hPTExPV19CT1g6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3Jl ZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9y YXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICAqLworICAg ICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gY29sb3JfcGl4ZWw7Cisg ICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4 LCB5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iksIG1hc2ssICZnY192YWx1ZXMp OworICAgICAgICAgIC8qIEZvcmNlIGBtY193MzJfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5m LT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycuICAqLworICAgICAgICAgIGJvb2wgY3Vyc29y X2djX3AgPSB0cnVlOworICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgs IHJvdywgRFJBV19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsIGxzbCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLCBj dXJzb3JfZ2NfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MgPSBv cmlnaW5hbF9jdXJzb3JfZ2M7CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAg fQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2Nf cCA9IGZhbHNlOworICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwg cm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfZ2NfcCk7CisgICAgICAg ICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfQkFSOgorICAgIHsKKyAgICAg IGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAg ICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEu dzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1 cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlz aWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3czMl9kcmF3X2Jhcl9jdXJzb3IgKHcs IG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2Nf aW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3Jf cGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQor ICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3Ag PSBmYWxzZTsKKyAgICAgICAgICAgIG1jX3czMl9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwg cm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgaCwgY3Vyc29yX3dpZHRoLCBNQ19CQVIsIGN1cnNvcl9nY19pbnZpc2li bGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBN Q19IQkFSOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAg JiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhp amFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBm LT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAg IGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3cz Ml9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZw b3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0 aCwgTUNfSEJBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91 dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAg ICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNv cl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAgICBtY193MzJfZHJhd19i YXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNf SEJBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIH0KKyAgICAgIGJy ZWFrOworICAgIH0KKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KKyAg ICB9Cit9CisKKy8qIERyYXcgZ2x5cGggc3RyaW5nIFMuICAqLworc3RhdGljIHZvaWQKK21jX3cz Ml9kcmF3X2dseXBoX3N0cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBo X21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAg ICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3Is CisgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5 cGUsIGludCBjdXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0 aXZlX3AsIGJvb2wgY3Vyc29yX2djX3ApCit7CisgIGJvb2wgcmVsaWVmX2RyYXduX3AgPSAwOwor ICAvKiBJZiBTIGRyYXdzIGludG8gdGhlIGJhY2tncm91bmQgb2YgaXRzIHN1Y2Nlc3NvciwgZHJh dyB0aGUKKyAgICAgYmFja2dyb3VuZCBvZiB0aGUgc3VjY2Vzc29yIGZpcnN0IHNvIHRoYXQgUyBj YW4gZHJhdyBpbnRvIGl0LgorICAgICBUaGlzIG1ha2VzIFMtPm5leHQgdXNlIFhEcmF3U3RyaW5n IGluc3RlYWQgb2YgWERyYXdJbWFnZVN0cmluZy4gICovCisgIGlmIChzLT5uZXh0ICYmIHMtPnJp Z2h0X292ZXJoYW5nICYmICFzLT5mb3Jfb3ZlcmxhcHMpCisgICAgeworICAgICAgaW50IHdpZHRo OworICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqbmV4dDsKKyAgICAgIGZvciAod2lkdGggPSAw LCBuZXh0ID0gcy0+bmV4dDsKKyAgICAgICAgICAgbmV4dCAmJiB3aWR0aCA8IHMtPnJpZ2h0X292 ZXJoYW5nOworICAgICAgICAgICB3aWR0aCArPSBuZXh0LT53aWR0aCwgbmV4dCA9IG5leHQtPm5l eHQpCisgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCkK KyAgICAgICAgICB7CisgICAgICAgICAgICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4 dCwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5n IChuZXh0KTsKKyAgICAgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJF VENIX0dMWVBIKQorICAgICAgICAgICAgICBtY193MzJfZHJhd19zdHJldGNoX2dseXBoX3N0cmlu ZyAobmV4dCk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9z dHJpbmdfYmFja2dyb3VuZCAobmV4dCwgdHJ1ZSk7CisgICAgICAgICAgICBuZXh0LT5udW1fY2xp cHMgPSAwOworICAgICAgICAgIH0KKyAgICB9CisgIC8qIFNldCB1cCBTLT5nYywgc2V0IGNsaXBw aW5nIGFuZCBkcmF3IFMuICAqLworICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAocywgY3Vy c29yX2djX3ApOworICAvKiBEcmF3IHJlbGllZiAoaWYgYW55KSBpbiBhZHZhbmNlIGZvciBjaGFy L2NvbXBvc2l0aW9uIHNvIHRoYXQgdGhlCisgICAgIGdseXBoIHN0cmluZyBjYW4gYmUgZHJhd24g b3ZlciBpdC4gICovCisgIGlmICghcy0+Zm9yX292ZXJsYXBzCisgICAgICAmJiBzLT5mYWNlLT5i b3ggIT0gRkFDRV9OT19CT1gKKyAgICAgICYmIChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFS X0dMWVBICisgICAgICAgICAgfHwgcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dM WVBIKSkKKyAgICB7CisgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmcgKHMpOworICAg ICAgeF9kcmF3X2dseXBoX3N0cmluZ19iYWNrZ3JvdW5kIChzLCB0cnVlKTsKKyAgICAgIHhfZHJh d19nbHlwaF9zdHJpbmdfYm94IChzKTsKKyAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwc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gICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRy dWU7CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAo cywgZmFsc2UpOworICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAg ICAgIGJyZWFrOworICAgIGNhc2UgQ09NUE9TSVRFX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9v dmVybGFwcyB8fCAocy0+Y21wX2Zyb20gPiAwCisgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlw aC0+dS5jbXAuYXV0b21hdGljKSkKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRy dWU7CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAo cywgdHJ1ZSk7CisgICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5k IChzKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgorICAgICAgaWYg KHMtPmZvcl9vdmVybGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7 CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywg ZmFsc2UpOworICAgICAgeF9kcmF3X2dseXBobGVzc19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAo cyk7CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7Cisg ICAgfQorICBpZiAoIXMtPmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICAvKiBEcmF3IHVuZGVy bGluZS4gICovCisgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3ApCisgICAgICAgIHsKKyAg ICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9XQVZFKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBDT0xPUlJFRiBjb2xvcjsKKyAgICAgICAgICAg ICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICBj b2xvciA9IHMtPmdjLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAg ICAgICAgY29sb3IgPSBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3I7CisgICAgICAgICAgICAgIHcz Ml9kcmF3X3VuZGVyd2F2ZSAocywgY29sb3IpOworICAgICAgICAgICAgfQorICAgICAgICAgIGVs c2UgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgdW5zaWduZWQgbG9uZyB0aGlja25lc3MsIHBvc2l0aW9u OworICAgICAgICAgICAgICBpbnQgeTsKKyAgICAgICAgICAgICAgaWYgKHMtPnByZXYgJiYgcy0+ cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3AKKyAgICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPmZh Y2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAvKiBXZSB1c2UgdGhlIHNhbWUgdW5kZXJsaW5lIHN0eWxlIGFz IHRoZSBwcmV2aW91cyBvbmUuICAqLworICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+ cHJldi0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0g cy0+cHJldi0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qIEdldCB0 aGUgdW5kZXJsaW5lIHRoaWNrbmVzcy4gIERlZmF1bHQgaXMgMSBwaXhlbC4gICovCisgICAgICAg ICAgICAgICAgICBpZiAocy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4g MCkKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3Ro aWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgdGhp Y2tuZXNzID0gMTsKKyAgICAgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50 X2xpbmUpCisgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIHRoaWNr bmVzcykgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJs aW5lIHBvc2l0aW9uLiAgVGhpcyBpcyB0aGUgcmVjb21tZW5kZWQKKyAgICAgICAgICAgICAgICAg ICAgICAgICB2ZXJ0aWNhbCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRo ZSB0b3Agb2YKKyAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBp cyBhIHNpZ25lZCB2YWx1ZSBhY2NvcmRpbmcgdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAg ICAgc3BlY3MsIGFuZCBpdHMgZGVmYXVsdCBpcworICAgICAgICAgICAgICAgICAgICAgICAgIFJP VU5EICgobWF4aW11bV9kZXNjZW50KSAvIDIpLCB3aXRoCisgICAgICAgICAgICAgICAgICAgICAg ICAgUk9VTkQgKHgpID0gZmxvb3IgKHggKyAwLjUpICAqLworICAgICAgICAgICAgICAgICAgICAg IGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGllcworICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbiA+PSAw KQorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5mb250LT51bmRlcmxpbmVf cG9zaXRpb247CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocy0+Zm9udCkKKyAgICAg ICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmZvbnQtPmRlc2NlbnQgKyAxKSAvIDI7 CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbWF4 IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgIC8qIENoZWNrIHRoZSBzYW5pdHkgb2YgdGhpY2tuZXNzIGFuZCBwb3Np dGlvbi4gIFdlIHNob3VsZAorICAgICAgICAgICAgICAgICBhdm9pZCBkcmF3aW5nIHVuZGVybGlu ZSBvdXQgb2YgdGhlIGN1cnJlbnQgbGluZSBhcmVhLiAgKi8KKyAgICAgICAgICAgICAgaWYgKHMt PnkgKyBzLT5oZWlnaHQgPD0gcy0+eWJhc2UgKyBwb3NpdGlvbikKKyAgICAgICAgICAgICAgICBw b3NpdGlvbiA9IChzLT5oZWlnaHQgLSAxKSAtIChzLT55YmFzZSAtIHMtPnkpOworICAgICAgICAg ICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8IHMtPnliYXNlICsgcG9zaXRpb24gKyB0aGlja25l c3MpCisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gKHMtPnkgKyBzLT5oZWlnaHQpIC0gKHMt PnliYXNlICsgcG9zaXRpb24pOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfdGhpY2tuZXNz ID0gdGhpY2tuZXNzOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPXBvc2l0 aW9uOworICAgICAgICAgICAgICB5ID0gcy0+eWJhc2UgKyBwb3NpdGlvbjsKKyAgICAgICAgICAg ICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICB3 MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHksIHMtPndpZHRoLCAxKTsKKyAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ ZmFjZS0+dW5kZXJsaW5lX2NvbG9yLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHksIHMtPndpZHRoLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyog RHJhdyBvdmVybGluZS4gICovCisgICAgICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfcCkKKyAgICAg ICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAwLCBoID0gMTsKKyAgICAgICAgICBp ZiAocy0+ZmFjZS0+b3ZlcmxpbmVfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICB3MzJf ZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgcy0+eSArIGR5LCBzLT53aWR0aCwgaCk7CisgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFj ZS0+b3ZlcmxpbmVfY29sb3IsIHMtPngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMt PnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICB9CisgICAgICAvKiBEcmF3IHN0cmlrZS10 aHJvdWdoLiAgKi8KKyAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9wCisgICAgICAg ICAgJiYgIUZPTlRfVEVYVE1FVFJJQyAocy0+Zm9udCkudG1TdHJ1Y2tPdXQpCisgICAgICAgIHsK KyAgICAgICAgICB1bnNpZ25lZCBsb25nIGggPSAxOworICAgICAgICAgIHVuc2lnbmVkIGxvbmcg ZHkgPSAocy0+aGVpZ2h0IC0gaCkgLyAyOworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2Vf dGhyb3VnaF9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMt PmYsIHMtPmhkYywgcy0+Z2MtPmZvcmVncm91bmQsIHMtPngsIHMtPnkgKyBkeSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICBlbHNlCisgICAgICAg ICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmZhY2UtPnN0cmlrZV90aHJvdWdo X2NvbG9yLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+eSArIGR5LCBzLT53 aWR0aCwgaCk7CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgcmVsaWVmIGlmIG5vdCB5ZXQgZHJh d24uICAqLworICAgICAgaWYgKCFyZWxpZWZfZHJhd25fcCAmJiBzLT5mYWNlLT5ib3ggIT0gRkFD RV9OT19CT1gpCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYm94IChzKTsKKyAgICAgIGlm IChzLT5wcmV2KQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqcHJl djsKKyAgICAgICAgICBmb3IgKHByZXYgPSBzLT5wcmV2OyBwcmV2OyBwcmV2ID0gcHJldi0+cHJl dikKKyAgICAgICAgICAgIGlmIChwcmV2LT5obCAhPSBzLT5obAorICAgICAgICAgICAgICAgICYm IHByZXYtPnggKyBwcmV2LT53aWR0aCArIHByZXYtPnJpZ2h0X292ZXJoYW5nID4gcy0+eCkKKyAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEFzIHByZXYgd2FzIGRyYXduIHdoaWxl IGNsaXBwZWQgdG8gaXRzIG93biBhcmVhLCB3ZQorICAgICAgICAgICAgICAgICAgIG11c3QgZHJh dyB0aGUgcmlnaHRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICAqLworICAgICAgICAg ICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gcHJldi0+aGw7CisgICAgICAgICAg ICAgICAgcHJldi0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY193MzJfc2V0X2dseXBo X3N0cmluZ19nYyAocHJldiwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICAgIHhfc2V0X2ds eXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBwcmV2KTsKKyAgICAgICAgICAgICAgICBp ZiAocHJldi0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkKKyAgICAgICAgICAgICAg ICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocHJldik7CisgICAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdf Zm9yZWdyb3VuZCAocHJldik7CisgICAgICAgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3Rhbmds ZSAocHJldi0+aGRjLCBOVUxMKTsKKyAgICAgICAgICAgICAgICBwcmV2LT5obCA9IHNhdmU7Cisg ICAgICAgICAgICAgICAgcHJldi0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICAgICAgfQorICAg ICAgICB9CisgICAgICBpZiAocy0+bmV4dCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBn bHlwaF9zdHJpbmcgKm5leHQ7CisgICAgICAgICAgZm9yIChuZXh0ID0gcy0+bmV4dDsgbmV4dDsg bmV4dCA9IG5leHQtPm5leHQpCisgICAgICAgICAgICBpZiAobmV4dC0+aGwgIT0gcy0+aGwKKyAg ICAgICAgICAgICAgICAmJiBuZXh0LT54IC0gbmV4dC0+bGVmdF9vdmVyaGFuZyA8IHMtPnggKyBz LT53aWR0aCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEFzIG5leHQgd2ls bCBiZSBkcmF3biB3aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwKKyAgICAgICAgICAgICAg ICAgICB3ZSBtdXN0IGRyYXcgdGhlIGxlZnRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cu ICAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gbmV4dC0+ aGw7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBt Y193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4dCwgY3Vyc29yX2djX3ApOworICAgICAgICAg ICAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBuZXh0KTsKKyAg ICAgICAgICAgICAgICBpZiAobmV4dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkK KyAgICAgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7 CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2NvbXBvc2l0 ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAgICAgICAgdzMyX3Nl dF9jbGlwX3JlY3RhbmdsZSAobmV4dC0+aGRjLCBOVUxMKTsKKyAgICAgICAgICAgICAgICBuZXh0 LT5obCA9IHNhdmU7CisgICAgICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAgICAg ICAgICAgICAgICBuZXh0LT5jbGlwX2hlYWQgPSBzLT5uZXh0OworICAgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICB9CisgIC8qIFJlc2V0IGNsaXBwaW5nLiAgKi8KKyAgdzMyX3NldF9jbGlw X3JlY3RhbmdsZSAocy0+aGRjLCBOVUxMKTsKKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyog ZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8q IEZyaW5nZSBiaXRtYXBzLiAgKi8KIAogc3RhdGljIGludCBtYXhfZnJpbmdlX2JtcCA9IDA7CkBA IC01NDUsNiArMTQwMSwxNSBAQCB4X3VwZGF0ZV9iZWdpbiAoc3RydWN0IGZyYW1lICpmKQogICBp ZiAoISBGUkFNRV9XMzJfUCAoZikpCiAgICAgcmV0dXJuOwogCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1l ID0gZjsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBSZWdlbmVyYXRlIGRp c3BsYXkgcGFsZXR0ZSBiZWZvcmUgZHJhd2luZyBpZiBsaXN0IG9mIHJlcXVlc3RlZAogICAgICBj b2xvcnMgaGFzIGNoYW5nZWQuICovCiAgIGlmIChkaXNwbGF5X2luZm8tPnJlZ2VuX3BhbGV0dGUp CkBAIC03NTQsNiArMTYxOSwxNiBAQCB4X3VwZGF0ZV9lbmQgKHN0cnVjdCBmcmFtZSAqZikKIAog ICAvKiBNb3VzZSBoaWdobGlnaHQgbWF5IGJlIGRpc3BsYXllZCBhZ2Fpbi4gICovCiAgIE1PVVNF X0hMX0lORk8gKGYpLT5tb3VzZV9mYWNlX2RlZmVyID0gZmFsc2U7CisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdf ZnJhbWUgPSBOVUxMOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIApAQCAt NDA0MSwxMyArNDkxNiw3NCBAQCB3MzJfc2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHN0cnVjdCB3 aW5kb3cgKncsCiAJICAgICAgcmVsZWFzZV9mcmFtZV9kYyAoZiwgaGRjKTsKIAkgICAgICB4X2Ns ZWFyX3VuZGVyX2ludGVybmFsX2JvcmRlciAoZik7CiAJICAgIH0KKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogUkVQQUlOVElO RyBXSEVOIFJFTU9WSU5HIFNDUk9MTCBCQVI6CisKKy0gU2VxdWVuY2Ugb2YgRXZlbnRzOgorCisg IC4gYHJlZGlzcGxheV9pbnRlcm5hbCcgY2FsbHMgdGhlIGBjb25kZW1uX3Njcm9sbF9iYXJzX2hv b2snLCB3aGljaCBtYXJrcyBhbGwKKyAg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b2xsLiAgV2hl biBhIHVzZXIKK3Nocmlua3MgdGhlIHdpZHRoIG9mIGEgd2luZG93LCB3ZSB3YW50IHRvIHJlcGFp bnQgc28gdGhhdCB0aGUgbmV3IHNjcm9sbCBiYXIKK3dpbmRvdyBpcyB1cGRhdGVkLiAqLworCiAg ICAgICAgICAgLyogTWFrZSBzdXJlIHNjcm9sbCBiYXIgaXMgInZpc2libGUiIGJlZm9yZSBtb3Zp bmcsIHRvIGVuc3VyZSB0aGUKICAgICAgICAgICAgICBhcmVhIG9mIHRoZSBwYXJlbnQgd2luZG93 IG5vdyBleHBvc2VkIHdpbGwgYmUgcmVmcmVzaGVkLiAgKi8KLSAgICAgICAgICBteV9zaG93X3dp bmRvdyAoZiwgaHduZCwgU1dfSElERSk7Ci0vKiogICAgICAgICAgIE1vdmVXaW5kb3cgKGh3bmQs IGxlZnQsIHRvcCwgd2lkdGgsIG1heCAoaGVpZ2h0LCAxKSwgVFJVRSk7ICoqLwotCSAgLyogVHJ5 IHRvIG5vdCBkcmF3IG92ZXIgY2hpbGQgZnJhbWVzLiAgKi8KLQkgIFNldFdpbmRvd1BvcyAoaHdu ZCwgSFdORF9CT1RUT00sIGxlZnQsIHRvcCwgd2lkdGgsIG1heCAoaGVpZ2h0LCAxKSwKLSAgICAg ICAgICAgICAgICAgICAgICAgIFNXUF9GUkFNRUNIQU5HRUQpOworICAgICAgICAgIGlmIChsZWZ0 IDw9IGJhci0+bGVmdCkKKyAgICAgICAgICAgIG15X3Nob3dfd2luZG93IChmLCBod25kLCBTV19I SURFKTsKKyAgICAgICAgICBNb3ZlV2luZG93IChod25kLCBsZWZ0LCB0b3AsIHdpZHRoLCBtYXgg KGhlaWdodCwgMSksIGxlZnQgPD0gYmFyLT5sZWZ0KTsKKworLyogZW5kIE1VTFRJUExFLUNVUlNP UlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiAKIAkgIHNpLmNiU2l6ZSA9IHNpemVv ZiAoc2kpOwogCSAgc2kuZk1hc2sgPSBTSUZfUkFOR0U7CkBAIC00MzE2LDYgKzUyNTIsMjEgQEAg dzMyX2p1ZGdlX3Njcm9sbF9iYXJzIChzdHJ1Y3QgZnJhbWUgKmYpCiAgICAgewogICAgICAgc3Ry dWN0IHNjcm9sbF9iYXIgKmIgPSBYU0NST0xMX0JBUiAoYmFyKTsKIAorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgLyogYERlc3Ryb3lX aW5kb3cnIHdpdGhpbiBgeF9zY3JvbGxfYmFyX3JlbW92ZScgcmVwYWludHMgdGhlIHJlY3Rhbmds ZS4KKyAgICAgIFRoZXJlZm9yZSwgd2UgZmlyc3Qgc2VuZCBhIG1lc3NhZ2UgdG8gaW5oaWJpdCBy ZXBhaW50aW5nLiAqLworICAgICAgaWYgKCFXSU5ET1dfTElWRV9QIChiLT53aW5kb3cpKQorICAg ICAgICB7CisgICAgICAgICAgSFdORCBod25kID0gU0NST0xMX0JBUl9XMzJfV0lORE9XIChiKTsK KyAgICAgICAgICBTZW5kTWVzc2FnZSAoaHduZCwgV01fU0VUUkVEUkFXLCBmYWxzZSwgMCk7Cisg ICAgICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgeF9zY3JvbGxf YmFyX3JlbW92ZSAoYik7CiAKICAgICAgIG5leHQgPSBiLT5uZXh0OwpAQCAtNzA5MSw2ICs4MDQy LDIxIEBAIGV4dGVybiBmcmFtZV9wYXJtX2hhbmRsZXIgdzMyX2ZyYW1lX3Bhcm1faGFuZGxlcnNb XTsKIAogc3RhdGljIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlIHczMl9yZWRpc3BsYXlfaW50 ZXJmYWNlID0KIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGB3MzJ0ZXJtLmNgIG11c3Qg YmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVyZmFjZScg aW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfeF93cml0ZV9nbHlwaHMsCisgIG1jX3czMl9k cmF3X3dpbmRvd19jdXJzb3IsCisgIG1jX3czMl9kcmF3X2dseXBoX3N0cmluZywKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogICB3MzJfZnJhbWVfcGFybV9oYW5kbGVycywKICAgeF9w cm9kdWNlX2dseXBocywKICAgeF93cml0ZV9nbHlwaHMsCmRpZmYgLS1naXQgYS9zcmMvd2luZG93 LmggYi9zcmMvd2luZG93LmgKaW5kZXggZmRlZjQwNy4uN2FjNDBkYyAxMDA2NDQKLS0tIGEvc3Jj L3dpbmRvdy5oCisrKyBiL3NyYy93aW5kb3cuaApAQCAtMzI0LDYgKzMyNCwxMjIgQEAgc3RydWN0 IHdpbmRvdwogCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIFN1ZmZpeGVzIGZv ciB0aGUgYG1jYCB3aW5kb3cgcG9pbnRlciBwcmVmaXguICovCitzdHJ1Y3QgbXVsdGlwbGVfY3Vy c29ycworeworICAvKiBUaGUgcmVjb3JkZWQgcGl4ZWwgd2lkdGggb2YgdGhlIGxhc3QgbGluZSBu dW1iZXIgZHJhd24gZHVyaW5nIHJlZGlzcGxheSAqLworICBpbnQgbG51bV9waXhlbF93aWR0aDsK K30gbWM7CisKK3N0cnVjdCBtY19tYXRyaXgKK3sKKyAgcHRyZGlmZl90IHZwb3NfYWxsb2NhdGVk OworICBwdHJkaWZmX3QgdnBvc191c2VkOworICBwdHJkaWZmX3QgY3Vyc29yc191c2VkWzRdOwor ICBlbnVtIG1jX2NhY2hlX3R5cGUKKyAgeworICAgIE1DX0NBQ0hFLAorICAgIENIX0NBQ0hFLAor ICAgIEZDX0NBQ0hFLAorICAgIE5PX0NBQ0hFCisgIH0gY2FjaGVfdHlwZTsKKyAgc3RydWN0IG1j X3Zwb3MKKyAgeworICAgIHB0cmRpZmZfdCBjYWNoZV9hbGxvY2F0ZWRbNF07CisgICAgcHRyZGlm Zl90IGNhY2hlX3VzZWRbNF07CisgICAgc3RydWN0IG1jX2NvbnRlbnRzCisgICAgeworICAgICAg Ym9vbF9iZiBzYW1lX3AgOiAxOworICAgICAgZW51bSBtY19mcm9tX3doZXJlCisgICAgICB7Cisg ICAgICAgIE5PV0hFUkUsCisgICAgICAgIFNDUklCRV9PTkUsCisgICAgICAgIFNDUklCRV9UV08s CisgICAgICAgIFNDUklCRV9USFJFRSwKKyAgICAgICAgU0tJUFBFRCwKKyAgICAgICAgUE9TVF9D SEFOR0VELAorICAgICAgICBVTkNIQU5HRUQsCisgICAgICAgIFNFVF9DVVJTT1JfT05FLAorICAg ICAgICBTRVRfQ1VSU09SX1RXTworICAgICAgfSBmcm9tX3doZXJlOworICAgICAgc3RydWN0IGds eXBoIGdseXBoOworICAgICAgaW50IHg7CisgICAgICBpbnQgZng7CisgICAgICBpbnQgeTsKKyAg ICAgIGludCBmeTsKKyAgICAgIGludCBocG9zOworICAgICAgaW50IHZwb3M7CisgICAgICBpbnQg d2Q7CisgICAgICBpbnQgaDsKKyAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUKKyAgICAgIHsKKyAg ICAgICAgLyogTk9URTogIFRoZSBmcmluZ2UgYml0bWFwIGZyYW1ld29yayByZWxpZXMgdXBvbiBN Q19OT19GUklOR0VfQklUTUFQCisgICAgICAgIGhhdmluZyBhIHZhbHVlIG9mIHplcm8gKDApLiAq LworICAgICAgICBNQ19OT19GUklOR0VfQklUTUFQLAorICAgICAgICBNQ19OT19DVVJTT1IsCisg ICAgICAgIE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAsCisgICAgICAgIE1DX0xFRlRfRlJJTkdFX0JJ VE1BUCwKKyAgICAgICAgTUNfRlJBTUVEX0JPWCwKKyAgICAgICAgTUNfRklMTEVEX0JPWCwKKyAg ICAgICAgTUNfSE9MTE9XX0JPWCwKKyAgICAgICAgTUNfQkFSLAorICAgICAgICBNQ19IQkFSCisg ICAgICB9IGN1cnNvcl90eXBlOworICAgICAgaW50IGN1cnNvcl93aWR0aDsKKyAgICAgIHN0cnVj dCBtY19SR0IKKyAgICAgIHsKKyAgICAgICAgZG91YmxlIHJlZDsKKyAgICAgICAgZG91YmxlIGdy ZWVuOworICAgICAgICBkb3VibGUgYmx1ZTsKKyAgICAgIH0gZm9yZWdyb3VuZCwgYmFja2dyb3Vu ZDsKKyAgICAgIGJvb2xfYmYgYWN0aXZlX3AgOiAxOworICAgICAgZW51bSBtY19mbGF2b3IKKyAg ICAgIHsKKyAgICAgICAgTk9fRkxBVk9SLAorICAgICAgICBNQ19HTFlQSCwKKyAgICAgICAgTUNf R0xZUEhMRVNTLAorICAgICAgICBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUCwKKyAgICAgICAgTUNf UElMQ1JPVywKKyAgICAgICAgTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVywKKyAgICAg ICAgTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVywKKyAgICAgICAgTUNf SE9MTE9XX1JFQ1RBTkdMRSwKKyAgICAgICAgTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XLAor ICAgICAgICBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1csCisgICAgICAgIE1D X1ZFUlRJQ0FMX0JBUiwKKyAgICAgICAgTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSLAorICAgICAg ICBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICB9IGdseXBoX2ZsYXZvcjsKKyAgICAg IGJvb2xfYmYgZW5hYmxlZF9wIDogMTsKKyAgICB9ICpjYWNoZVs0XTsKKyAgfSAqdnBvczsKKyAg LyogVXNlZCBlbHNld2hlcmUuICovCisgIHN0cnVjdCBtY19lc3NlbnRpYWxzCisgIHsKKyAgICBi b29sX2JmIGFjdGl2ZV9wIDogMTsKKyAgICBzdHJ1Y3QgbWNfUkdCIGNoX2ZnLCBmY19mZzsKKyAg ICBpbnQgZmNfeDsKKyAgICBpbnQgenY7CisgICAgaW50IHp2X2J5dGU7CisgIH0gZXNzZW50aWFs czsKKyAgLyogVXNlZCBlbHNld2hlcmUuICovCisgIGVudW0gbWNfYWN0aW9uX3R5cGUKKyAgewor ICAgIE1VTFRJUExFX0NVUlNPUlMsCisgICAgSE9SSVpPTlRBTF9SVUxFUiwKKyAgICBWRVJUSUNB TF9SVUxFUiwKKyAgICBGSUxMX0NPTFVNTiwKKyAgICBDVVJTT1JfSU5ESUNBVE9SCisgIH0gYWN0 aW9uX3R5cGU7Cit9IG1jX21hdHJpeDsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAvKiBDdXJzb3IgdHlwZSBvZiBsYXN0IGN1 cnNvciBkcmF3biBvbiB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W50IHJpZ2h0X292ZXJ3cml0dGVuIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICopOworc3Rh dGljIGludCBsZWZ0X292ZXJ3cml0aW5nIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICopOworc3RhdGlj IGludCByaWdodF9vdmVyd3JpdGluZyAoc3RydWN0IGdseXBoX3N0cmluZyAqKTsKK3N0YXRpYyB2 b2lkIGFwcGVuZF9nbHlwaF9zdHJpbmcgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKiosIHN0cnVjdCBn bHlwaF9zdHJpbmcgKiosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qg Z2x5cGhfc3RyaW5nICopOworc3RhdGljIHZvaWQgcHJlcGVuZF9nbHlwaF9zdHJpbmdfbGlzdHMg KHN0cnVjdCBnbHlwaF9zdHJpbmcgKiosIHN0cnVjdCBnbHlwaF9zdHJpbmcgKiosCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqLCBz dHJ1Y3QgZ2x5cGhfc3RyaW5nICopOworc3RhdGljIHZvaWQgYXBwZW5kX2dseXBoX3N0cmluZ19s aXN0cyAoc3RydWN0IGdseXBoX3N0cmluZyAqKiwgc3RydWN0IGdseXBoX3N0cmluZyAqKiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcg Kiwgc3RydWN0IGdseXBoX3N0cmluZyAqKTsKK3N0YXRpYyB2b2lkIGluaXRfZ2x5cGhfc3RyaW5n IChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICosIE1DX09QVElPTkFMX0hEQyAoaGRjKSBYQ2hhcjJiICos CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3Qg Z2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51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g TEFTVF9YKTsJCQlcCisJICAgICAgYnJlYWs7CisKKyNkZWZpbmUgTUNfQlVJTERfR0xZUEhfU1RS SU5HU19YVyhTVEFSVCwgRU5ELCBIRUFELCBUQUlMLCBITCwgWCwgTEFTVF9YKQlcCisgICAgICAg ICAgICBjYXNlIFhXSURHRVRfR0xZUEg6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBcCisgICAgICAgICAgICAgIE1DX0JVSUxEX1hXSURHRVRfR0xZUEhfU1RSSU5HIChT VEFSVCwgRU5ELCBIRUFELCBUQUlMLCAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBITCwgWCwgTEFTVF9YKTsgICAgICAgICAgICAgICBcCisgICAgICAg ICAgICAgIGJyZWFrOworCisjZGVmaW5lIE1DX0JVSUxEX0dMWVBIX1NUUklOR1NfMihTVEFSVCwg RU5ELCBIRUFELCBUQUlMLCBITCwgWCwgTEFTVF9YKQlcCisJICAgIGNhc2UgR0xZUEhMRVNTX0dM WVBIOgkJCQkJXAorCSAgICAgIE1DX0JVSUxEX0dMWVBITEVTU19HTFlQSF9TVFJJTkcgKFNUQVJU LCBFTkQsIEhFQUQsIFRBSUwsCVwKKwkJCQkJICAgIEhMLCBYLCBMQVNUX1gpOwkJXAorCSAgICAg IGJyZWFrOwkJCQkJCQlcCisJCQkJCQkJCQlcCisJICAgIGRlZmF1bHQ6CQkJCQkJCVwKKwkgICAg ICBlbWFjc19hYm9ydCAoKTsJCQkJCQlcCisJICAgIH0JCQkJCQkJCVwKKwkJCQkJCQkJCVwKKwkg IGlmIChzKQkJCQkJCQlcCisJICAgIHsJCQkJCQkJCVwKKwkgICAgICBzZXRfZ2x5cGhfc3RyaW5n X2JhY2tncm91bmRfd2lkdGggKHMsIFNUQVJULCBMQVNUX1gpOwlcCisJICAgICAgKFgpICs9IHMt PndpZHRoOwkJCQkJCVwKKwkgICAgfQkJCQkJCQkJXAorCX0JCQkJCQk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WYgKCFDT05TUCAobGlzdCkgfHwgRVEgKFhDQVIgKGxpc3QpLCBl bHQpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlm ICghQ09OU1AgKGxpc3QpIHx8IEVRIChYQ0FSIChsaXN0KSwgZWx0KSkKKyAgICAgICAgYnJlYWs7 CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KSB8fCBF USAoWENBUiAobGlzdCksIGVsdCkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIg KGxpc3QpOworICAgIH0KKyAgcmV0dXJuIGxpc3Q7Cit9CisKK0xpc3BfT2JqZWN0CittY19udGgg KGludCBudW0sIExpc3BfT2JqZWN0IGxpc3QpCit7CisgIGZvciAoaW50IGkgPSAwOyBpIDwgbnVt ICYmICFOSUxQIChsaXN0KTsgaSsrKQorICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgaWYgKENP TlNQIChsaXN0KSkKKyAgICByZXR1cm4gWENBUiAobGlzdCk7CisgICAgZWxzZQorICAgICAgcmV0 dXJuIFFuaWw7Cit9CisKK0xpc3BfT2JqZWN0CittY19hc3NxIChMaXNwX09iamVjdCBrZXksIExp c3BfT2JqZWN0IGxpc3QpCit7CisgIHdoaWxlICgxKQorICAgIHsKKyAgICAgIGlmICghQ09OU1Ag KGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAg JiYgRVEgKFhDQVIgKFhDQVIgKGxpc3QpKSwga2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAg bGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8 fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAo bGlzdCkpLCBrZXkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7 CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlz dCkpCisgICAgICAgICAgICAgICYmIEVRIChYQ0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAg ICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICB9CisgIGlmIChDT05T UCAobGlzdCkpCisgICAgcmV0dXJuIFhDQVIgKGxpc3QpOworICAgIGVsc2UKKyAgICAgIHJldHVy biBRbmlsOworfQorCitMaXNwX09iamVjdAorbWNfYXNzb2MgKExpc3BfT2JqZWN0IGtleSwgTGlz cF9PYmplY3QgbGlzdCkKK3sKKyAgTGlzcF9PYmplY3QgY2FyOworICB3aGlsZSAoMSkKKyAgICB7 CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlz dCkpCisgICAgICAgICAgICAgICYmIChjYXIgPSBYQ0FSIChYQ0FSIChsaXN0KSksCisgICAgICAg ICAgICAgICAgICBFUSAoY2FyLCBrZXkpIHx8ICFOSUxQIChGZXF1YWwgKGNhciwga2V5KSkpKSkK KyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNP TlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAg ICAgICYmIChjYXIgPSBYQ0FSIChYQ0FSIChsaXN0KSksCisgICAgICAgICAgICAgICAgICBFUSAo Y2FyLCBrZXkpIHx8ICFOSUxQIChGZXF1YWwgKGNhciwga2V5KSkpKSkKKyAgICAgICAgYnJlYWs7 CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAg ICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYmIChjYXIgPSBY Q0FSIChYQ0FSIChsaXN0KSksCisgICAgICAgICAgICAgICAgICBFUSAoY2FyLCBrZXkpIHx8ICFO SUxQIChGZXF1YWwgKGNhciwga2V5KSkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0g WENEUiAobGlzdCk7CisgICAgfQorICBpZiAoQ09OU1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FS IChsaXN0KTsKKyAgICBlbHNlCisgICAgICByZXR1cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QK K21jX3BsaXN0X2dldCAoTGlzcF9PYmplY3QgcGxpc3QsIExpc3BfT2JqZWN0IHByb3ApCit7Cisg IExpc3BfT2JqZWN0IHRhaWwsIGhhbGZ0YWlsOworICAvKiBoYWxmdGFpbCBpcyB1c2VkIHRvIGRl dGVjdCBjaXJjdWxhciBsaXN0cy4gICovCisgIHRhaWwgPSBoYWxmdGFpbCA9IHBsaXN0OworICB3 aGlsZSAoQ09OU1AgKHRhaWwpICYmIENPTlNQIChYQ0RSICh0YWlsKSkpCisgICAgeworICAgICAg aWYgKEVRIChwcm9wLCBYQ0FSICh0YWlsKSkpCisgICAgICAgIHJldHVybiBYQ0FSIChYQ0RSICh0 YWlsKSk7CisgICAgICB0YWlsID0gWENEUiAoWENEUiAodGFpbCkpOworICAgICAgaGFsZnRhaWwg PSBYQ0RSIChoYWxmdGFpbCk7CisgICAgICBpZiAoRVEgKHRhaWwsIGhhbGZ0YWlsKSkKKyAgICAg ICAgYnJlYWs7CisgICAgfQorICByZXR1cm4gUW5pbDsKK30KKworLyogQ2hlY2sgdGhlIHByZXNl bmNlIG9mIGEgZGlzcGxheSBwcm9wZXJ0eSBhbmQgY29tcHV0ZSBpdHMgd2lkdGguCisgICBJZiBh IHByb3BlcnR5IHdhcyBmb3VuZCBhbmQgaXRzIHdpZHRoIHdhcyBmb3VuZCBhcyB3ZWxsLCByZXR1 cm4KKyAgIGl0cyB3aWR0aCAoPj0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GUgY2hhcmFjdGVycywgc28gdGhhdCB3ZSBwdXQgcG9pbnQgYmVmb3JlIHRoZQor ICAgY2hhcmFjdGVyIG9uIHdoaWNoIHRoZSBjdXJzb3Igd2lsbCBhcHBlYXIuICovCisgICAgICBp ZiAoY29sID49IGdvYWwpCisgIGJyZWFrOworICAgICAgcHJldl9jb2wgPSBjb2w7CisgICAgICB7 IC8qIENoZWNrIGRpc3BsYXkgcHJvcGVydHkuICovCisgIHB0cmRpZmZfdCBlbmRwOworICBpbnQg d2lkdGggPSBtY19jaGVja19kaXNwbGF5X3dpZHRoIChzY2FuLCBjb2wsICZlbmRwKTsKKyAgaWYg KHdpZHRoID49IDApCisgICAgeworICAgICAgY29sICs9IHdpZHRoOworICAgICAgaWYgKGVuZHAg PiBzY2FuKSAvKiBBdm9pZCBpbmZpbml0ZSBsb29wcyB3aXRoIDAtd2lkdGggb3ZlcmxheXMuICov CisgICAgICAgIHsKKyAgICBzY2FuID0gZW5kcDsKKyAgICBzY2FuX2J5dGUgPSBDSEFSX1RPX0JZ VEUgKHNjYW4pOworICAgIGNvbnRpbnVlOworICAgICAgICB9CisgICAgfQorICAgICAgfQorICAg ICAgLyogQ2hlY2sgY29tcG9zaXRpb24gc2VxdWVuY2UuICovCisgICAgICBpZiAoY21wX2l0Lmlk ID49IDAKKyAgICB8fCAoc2NhbiA9PSBjbXBfaXQuc3RvcF9wb3MKKyAgICAgICAgJiYgY29tcG9z aXRpb25fcmVzZWF0X2l0ICgmY21wX2l0LCBzY2FuLCBzY2FuX2J5dGUsIGVuZCwKKyAgICAgICAg ICB3LCBOVUxMLCBRbmlsKSkpCisgIGNvbXBvc2l0aW9uX3VwZGF0ZV9pdCAoJmNtcF9pdCwgc2Nh biwgc2Nhbl9ieXRlLCBRbmlsKTsKKyAgICAgIGlmIChjbXBfaXQuaWQgPj0gMCkKKyAgeworICAg IHNjYW4gKz0gY21wX2l0Lm5jaGFyczsKKyAgICBzY2FuX2J5dGUgKz0gY21wX2l0Lm5ieXRlczsK KyAgICBpZiAoc2NhbiA8PSBlbmQpCisgICAgICBjb2wgKz0gY21wX2l0LndpZHRoOworICAgIGlm IChjbXBfaXQudG8gPT0gY21wX2l0Lm5nbHlwaHMpCisgICAgICB7CisgICAgICAgIGNtcF9pdC5p ZCA9IC0xOworICAgICAgICBjb21wb3NpdGlvbl9jb21wdXRlX3N0b3BfcG9zICgmY21wX2l0LCBz Y2FuLCBzY2FuX2J5dGUsIGVuZCwKKyAgICAgICAgICAgICAgUW5pbCk7CisgICAgICB9CisgICAg ZWxzZQorICAgICAgY21wX2l0LmZyb20gPSBjbXBfaXQudG87CisgICAgY29udGludWU7CisgIH0K KyAgICAgIGMgPSBGRVRDSF9CWVRFIChzY2FuX2J5dGUpOworICAgICAgLyogU2VlIGlmIHRoZXJl IGlzIGEgZGlzcGxheSB0YWJsZSBhbmQgaXQgcmVsYXRlcworICAgdG8gdGhpcyBjaGFyYWN0ZXIu ICovCisgICAgICBpZiAoZHAgIT0gMAorICAgICYmICEgKG11bHRpYnl0ZSAmJiBMRUFESU5HX0NP REVfUCAoYykpCisgICAgJiYgVkVDVE9SUCAoRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpKSkKKyAg eworICAgIExpc3BfT2JqZWN0IGNoYXJ2ZWM7CisgICAgcHRyZGlmZl90IGksIG47CisgICAgLyog VGhpcyBjaGFyYWN0ZXIgaXMgZGlzcGxheWVkIHVzaW5nIGEgdmVjdG9yIG9mIGdseXBocy4KKyAg ICAgICBVcGRhdGUgdGhlIGNvbHVtbi9wb3NpdGlvbiBiYXNlZCBvbiB0aG9zZSBnbHlwaHMuICov CisgICAgY2hhcnZlYyA9IERJU1BfQ0hBUl9WRUNUT1IgKGRwLCBjKTsKKyAgICBuID0gQVNJWkUg KGNoYXJ2ZWMpOworICAgIGZvciAoaSA9IDA7IGkgPCBuOyBpKyspCisgICAgICB7CisgICAgICAg IC8qIFRoaXMgc2hvdWxkIGJlIGhhbmRsZWQgdGhlIHNhbWUgYXMKKyAgICAgbmV4dF9lbGVtZW50 X2Zyb21fZGlzcGxheV92ZWN0b3IgZG9lcyBpdC4gKi8KKyAgICAgICAgTGlzcF9PYmplY3QgZW50 cnkgPSBBUkVGIChjaGFydmVjLCBpKTsKKyAgICAgICAgaWYgKEdMWVBIX0NPREVfUCAoZW50cnkp KQorICAgIGMgPSBHTFlQSF9DT0RFX0NIQVIgKGVudHJ5KTsKKyAgICAgICAgZWxzZQorICAgIGMg PSAnICc7CisgICAgICAgIGlmIChjID09ICdcbicpCisgICAgZ290byBlbmRsb29wOworICAgICAg ICBpZiAoYyA9PSAnXHInICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rp c3BsYXkpLCBRdCkpCisgICAgZ290byBlbmRsb29wOworICAgICAgICBpZiAoYyA9PSAnXHQnKQor ICAgIHsKKyAgICAgIGNvbCArPSB0YWJfd2lkdGg7CisgICAgICBjb2wgPSBjb2wgLyB0YWJfd2lk dGggKiB0YWJfd2lkdGg7CisgICAgfQorICAgICAgICBlbHNlCisgICAgKytjb2w7CisgICAgICB9 CisgIH0KKyAgICAgIGVsc2UKKyAgeworICAgIC8qIFRoZSBkaXNwbGF5IHRhYmxlIGRvZXNuJ3Qg YWZmZWN0IHRoaXMgY2hhcmFjdGVyOworICAgICAgIGl0IGRpc3BsYXlzIGFzIGl0c2VsZi4gKi8K KyAgICBpZiAoYyA9PSAnXG4nKQorICAgICAgZ290byBlbmRsb29wOworICAgIGlmIChjID09ICdc cicgJiYgRVEgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVfZGlzcGxheSksIFF0KSkK KyAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICBpZiAoYyA9PSAnXHQnKQorICAgICAgeworICAgICAg ICBjb2wgKz0gdGFiX3dpZHRoOworICAgICAgICBjb2wgPSBjb2wgLyB0YWJfd2lkdGggKiB0YWJf d2lkdGg7CisgICAgICB9CisgICAgZWxzZSBpZiAobXVsdGlieXRlICYmIExFQURJTkdfQ09ERV9Q IChjKSkKKyAgICAgIHsKKyAgICAgICAgLyogU3RhcnQgb2YgbXVsdGktYnl0ZSBmb3JtLiAqLwor ICAgICAgICB1bnNpZ25lZCBjaGFyICpwdHI7CisgICAgICAgIGludCBieXRlcywgd2lkdGg7Cisg ICAgICAgIHB0ciA9IEJZVEVfUE9TX0FERFIgKHNjYW5fYnl0ZSk7CisgICAgICAgIE1DX01VTFRJ QllURV9CWVRFU19XSURUSCAocHRyLCBkcCwgYnl0ZXMsIHdpZHRoKTsKKyAgICAgICAgLyogU3Vi dHJhY3Qgb25lIHRvIGNvbXBlbnNhdGUgZm9yIHRoZSBpbmNyZW1lbnQKKyAgICAgdGhhdCBpcyBn b2luZyB0byBoYXBwZW4gYmVsb3cuICovCisgICAgICAgIHNjYW5fYnl0ZSArPSBieXRlcyAtIDE7 CisgICAgICAgIGNvbCArPSB3aWR0aDsKKyAgICAgIH0KKyAgICBlbHNlIGlmIChjdGxfYXJyb3cg JiYgKGMgPCAwNDAgfHwgYyA9PSAwMTc3KSkKKyAgICAgIGNvbCArPSAyOworICAgIGVsc2UgaWYg KGMgPCAwNDAgfHwgYyA+PSAwMTc3KQorICAgICAgY29sICs9IDQ7CisgICAgZWxzZQorICAgICAg Y29sKys7CisgIH0KKyAgICAgIHNjYW4rKzsKKyAgICAgIHNjYW5fYnl0ZSsrOworICAgIH0KKyBl bmRsb29wOgorICBsYXN0X2tub3duX2NvbHVtbiA9IGNvbDsKKyAgbGFzdF9rbm93bl9jb2x1bW5f cG9pbnQgPSBwdDsKKyAgbGFzdF9rbm93bl9jb2x1bW5fbW9kaWZpZWQgPSBNT0RJRkY7CisgIGlm IChnb2FsY29sKQorICAgICpnb2FsY29sID0gY29sOworICBpZiAoZW5kcG9zKQorICAgICplbmRw b3MgPSBzY2FuOworICBpZiAocHJldmNvbCkKKyAgICAqcHJldmNvbCA9IHByZXZfY29sOworfQor CitwdHJkaWZmX3QKK21jX2N1cn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ICAgYnJlYWs7 CisgIH0KKyAgICAgIGMgPSAqLS1wdHI7CisgICAgICBpZiAoZHAgJiYgVkVDVE9SUCAoRElTUF9D SEFSX1ZFQ1RPUiAoZHAsIGMpKSkKKyAgeworICAgIGNoYXJ2ZWMgPSBESVNQX0NIQVJfVkVDVE9S IChkcCwgYyk7CisgICAgbiA9IEFTSVpFIChjaGFydmVjKTsKKyAgfQorICAgICAgZWxzZQorICB7 CisgICAgY2hhcnZlYyA9IFFuaWw7CisgICAgbiA9IDE7CisgIH0KKyAgICAgIGZvciAoaSA9IG4g LSAxOyBpID49IDA7IC0taSkKKyAgeworICAgIGlmIChWRUNUT1JQIChjaGFydmVjKSkKKyAgICAg IHsKKyAgICAgICAgLyogVGhpcyBzaG91bGQgYmUgaGFuZGxlZCB0aGUgc2FtZSBhcworICAgICBu ZXh0X2VsZW1lbnRfZnJvbV9kaXNwbGF5X3ZlY3RvciBkb2VzIGl0LiAqLworICAgICAgICBMaXNw X09iamVjdCBlbnRyeSA9IEFSRUYgKGNoYXJ2ZWMsIGkpOworICAgICAgICBpZiAoR0xZUEhfQ09E RV9QIChlbnRyeSkpCisgICAgYyA9IEdMWVBIX0NPREVfQ0hBUiAoZW50cnkpOworICAgICAgICBl bHNlCisgICAgYyA9ICcgJzsKKyAgICAgIH0KKyAgICBpZiAoYyA+PSAwNDAgJiYgYyA8IDAxNzcp CisgICAgICBjb2wrKzsKKyAgICBlbHNlIGlmIChjID09ICdcbicKKyAgICAgICB8fCAoYyA9PSAn XHInCisgICAgICAgICAgICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rp c3BsYXkpLCBRdCkpKQorICAgICAgeworICAgICAgICBwdHIrKzsKKyAgICAgICAgZ290byBzdGFy dF9vZl9saW5lX2ZvdW5kOworICAgICAgfQorICAgIGVsc2UgaWYgKGMgPT0gJ1x0JykKKyAgICAg IHsKKyAgICAgICAgaWYgKHRhYl9zZWVuKQorICAgIGNvbCA9ICg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XMgcmVwbGFjZWQgYnkgYW4gZWxsaXBzaXMuICAqLykKKyAgKExpc3Bf T2JqZWN0IHdpbmRvdywgTGlzcF9PYmplY3QgcHQpCit7CisgIHN0cnVjdCB3aW5kb3cgKncgPSBk ZWNvZGVfbGl2ZV93aW5kb3cgKHdpbmRvdyk7CisgIExpc3BfT2JqZWN0IHRlbXA7CisgIFhTRVRG QVNUSU5UICh0ZW1wLCBtY19jdXJyZW50X2NvbHVtbiAodywgWEZJWE5VTSAocHQpKSk7CisgIHJl dHVybiB0ZW1wOworfQorCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIkZSQU1FICglcyki LCBtY19mcmFtZSAoZikpOyAqLworY2hhciAqCittY19mcmFtZSAoc3RydWN0IGZyYW1lICpmKQor eworICBMaXNwX09iamVjdCBmcmFtZTsKKyAgWFNFVEZSQU1FIChmcmFtZSwgZik7CisgIHJldHVy biBTU0RBVEEgKEZwcmluMV90b19zdHJpbmcgKGZyYW1lLCBRbmlsKSk7Cit9CisKKy8qIFVTQUdF OiAgZnByaW50ZiAoc3RkZXJyLCAiV0lORE9XICglcykiLCBtY193aW5kb3cgKHcpKTsgKi8KK2No YXIgKgorbWNfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3KQoreworICBMaXNwX09iamVjdCB3aW5k b3c7CisgIFhTRVRXSU5ET1cgKHdpbmRvdywgdyk7CisgIHJldHVybiBTU0RBVEEgKEZwcmluMV90 b19zdHJpbmcgKHdpbmRvdywgUW5pbCkpOworfQorCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVy ciwgIkNIQVJBQ1RFUiAoJXMpIiwgbWNfY2hhcl90b19zdHJpbmcgKGdseXBoLT51LmNoKSk7ICov CitjaGFyICoKK21jX2NoYXJfdG9fc3RyaW5nIChpbnQgYXJnKQoreworICBMaXNwX09iamVjdCBj aGFyYWN0ZXIgPSAoMCA8PSBhcmcgJiYgYXJnIDw9IE1BWF9DSEFSKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBGY2hhcl90b19zdHJpbmcgKG1ha2VfZml4bnVtIChhcmcpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiBRbmlsOworICBjaGFyICogcmVzdWx0ID0gKCFOSUxQIChj aGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDkpCisgICAgICAgICAgICAg ICAgICAgID8gIlxcdCIKKyAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisg ICAgICAgICAgICAgICAgICAgICAmJiBhcmcgPT0gMTApCisgICAgICAgICAgICAgICAgICAgID8g IlxcbiIKKyAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAg ICAgICAgICAgICAmJiBhcmcgPT0gMzIpCisgICAgICAgICAgICAgICAgICAgID8gIlxccyIKKyAg ICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAg ICAmJiBhcmcgIT0gOQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9IDEwCisgICAgICAg ICAgICAgICAgICAgICAmJiBhcmcgIT0gMzIpCisgICAgICAgICAgICAgICAgICAgID8gU1NEQVRB IChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICA6ICJcXD8iOworICByZXR1cm4gcmVzdWx0 OworfQorCitpbnQKK21jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKExpc3BfT2JqZWN0IGFyZykKK3sK KyAgY2hhciAqc3RyOworICBpZiAoWFRZUEUgKGFyZykgPT0gTGlzcF9TdHJpbmcpCisgICAgc3Ry ID0gU1NEQVRBIChhcmcpOworICAgIGVsc2UgaWYgKFhUWVBFIChhcmcpID09IExpc3BfU3ltYm9s KQorICAgICAgc3RyID0gU1NEQVRBIChTWU1CT0xfTkFNRSAoYXJnKSk7CisgICAgICBlbHNlIHJl dHVybiAtMTsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgIm5vIikpCisgICAgcmV0dXJuIE1DX05PX0NV UlNPUjsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgIm1jLWxlZnQtZnJpbmdlLWJpdG1hcCIpKQorICAg IHJldHVybiBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA7CisgIGlmICghc3RyY21wIChzdHIsICJtYy1y aWdodC1mcmluZ2UtYml0bWFwIikpCisgICAgcmV0dXJuIE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA7 CisgIGlmICghc3RyY21wIChzdHIsICJib3giKSkKKyAgICByZXR1cm4gTUNfRklMTEVEX0JPWDsK KyAgaWYgKCFzdHJjbXAgKHN0ciwgImZyYW1lZCIpKQorICAgIHJldHVybiBNQ19GUkFNRURfQk9Y OworICBpZiAoIXN0cmNtcCAoc3RyLCAiaG9sbG93IikpCisgICAgcmV0dXJuIE1DX0hPTExPV19C T1g7CisgIGlmICghc3RyY21wIChzdHIsICJiYXIiKSkKKyAgICByZXR1cm4gTUNfQkFSOworICBp ZiAoIXN0cmNtcCAoc3RyLCAiaGJhciIpKQorICAgIHJldHVybiBNQ19IQkFSOworICByZXR1cm4g LTE7Cit9CisKKy8qIFVTQUdFOiAgZnByaW50ZiAoc3RkZXJyLCAiQ1VSU09SIFRZUEUgKCVzKSIs IG1jX2N1cnNvcl90eXBlX3RvX3N0cmluZyAoYXJnKSk7ICovCitjaGFyICoKK21jX2N1cnNvcl90 eXBlX3RvX3N0cmluZyAoZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSkKK3sKKyAgc3dp dGNoIChjdXJzb3JfdHlwZSkKKyAgICB7CisgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6IHJldHVy biAiTUNfRklMTEVEX0JPWCI7CisgICAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6IHJldHVybiAiTUNf RlJBTUVEX0JPWCI7CisgICAgICBjYXNlIE1DX0hPTExPV19CT1g6IHJldHVybiAiTUNfSE9MTE9X X0JPWCI7CisgICAgICBjYXN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aWQgPT0gVkVSVElDQUxfQk9SREVSX0ZBQ0Vf SUQgLyogUXZlcnRpY2FsX2JvcmRlciAqLworICAgICAgICAgIHx8IGZhY2VfaWQgPT0gSU5URVJO QUxfQk9SREVSX0ZBQ0VfSUQpKSAvKiBRaW50ZXJuYWxfYm9yZGVyICovCisgICAgZmFjZSA9IEZB Q0VfRlJPTV9JRCAoZiwgbG9va3VwX2Jhc2ljX2ZhY2UgKHcsIGYsIGZhY2VfaWQpKTsKKyAgICBl bHNlCisgICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChmLCBmYWNlX2lkKTsKKyAgTGlzcF9PYmpl Y3QgY29sb3IgPSAoZmFjZSAhPSBOVUxMKQorICAgICAgICAgICAgICAgICAgICAgID8gZmFjZS0+ bGZhY2VbTEZBQ0VfQkFDS0dST1VORF9JTkRFWF0KKyAgICAgICAgICAgICAgICAgICAgICA6IGJ1 aWxkX3N0cmluZyAoIk9yYW5nZVJlZCIpOworICBtY194d19jb2xvcl92YWx1ZXMgKHcsIGNvbG9y LCBsc2wpOworfQorCit2b2lkCittY19zZXRfZXNzZW50aWFscyAoc3RydWN0IHdpbmRvdyAqdywg c3RydWN0IG1jX2Vzc2VudGlhbHMgKmVzc2VudGlhbHMpCit7CisgIGlmICghQlVGRkVSUCAody0+ Y29udGVudHMpKQorICAgIHJldHVybjsKKyAgaWYgKE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgbWNfY29uZikpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgcmV0dXJuOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBY RlJBTUUgKHctPmZyYW1lKTsKKyAgZXNzZW50aWFscy0+YWN0aXZlX3AgPSAodyA9PSBYV0lORE9X IChmLT5zZWxlY3RlZF93aW5kb3cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGYgPT0g RlJBTUVfRElTUExBWV9JTkZPIChmKS0+eF9oaWdobGlnaHRfZnJhbWUpOworICBMaXNwX09iamVj dCBidWYgPSB3LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYpOworICBzdHJ1Y3QgYnVm ZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgc3RydWN0IGJ1ZmZlciAqb2xkX2J1ZmZlciA9IE5V TEw7CisgIHB0cmRpZmZfdCBvcG9pbnQgPSAodyA9PSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cp KQorICAgICAgICAgICAgICAgICAgICAgPyBQVAorICAgICAgICAgICAgICAgICAgICAgOiBYRklY TlVNIChGbWFya2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pKTsKKyAgcHRyZGlmZl90IGZjX2N1cnJl bnRfY29sID0gbWNfY3VycmVudF9jb2x1bW4gKHcsIG9wb2ludCk7CisgIGludCBmcmFtZV9jaGFy X3dpZHRoID0gRlJBTUVfQ09MVU1OX1dJRFRIIChmKTsKKyAgYm9vbCBmaWxsX2NvbHVtbl9wID0g IU5JTFAgKEJWQVIgKGIsIGZpbGxfY29sdW1uKSk7CisgIGludCBmaWxsX2NvbCA9IFhGSVhOVU0g KEJWQVIgKGIsIGZpbGxfY29sdW1uKSk7CisgIGludCBoc2NsX3ggPSB3LT5oc2Nyb2xsICogZnJh bWVfY2hhcl93aWR0aDsKKyAgaWYgKGIgIT0gY3VycmVudF9idWZmZXIpCisgICAgeworICAgICAg b2xkX2J1ZmZlciA9IGN1cnJlbnRfYnVmZmVyOworICAgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAo Yik7CisgICAgfQorICBlc3NlbnRpYWxzLT56diA9IFpWOworICBlc3NlbnRpYWxzLT56dl9ieXRl ID0gWlZfQllURTsKKyAgZXNzZW50aWFscy0+ZmNfeCA9IChmaWxsX2NvbHVtbl9wCisgICAgICAg ICAgICAgICAgICAgICAgJiYgIU5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisgICAgICAg ICAgICAgICAgICAgICAgID8gKGZpbGxfY29sICogZnJhbWVfY2hhcl93aWR0aCkgKyB3LT5tYy5s bnVtX3BpeGVsX3dpZHRoIC0gaHNjbF94CisgICAgICAgICAgICAgICAgICAgICA6IChmaWxsX2Nv bHVtbl9wCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBOSUxQIChWZGlzcGxheV9saW5lX251 bWJlcnMpKQorICAgICAgICAgICAgICAgICAgICAgICA/IChmaWxsX2NvbCAqIGZyYW1lX2NoYXJf d2lkdGgpIC0gaHNjbF94CisgICAgICAgICAgICAgICAgICAgICA6IDA7CisgIGlmIChvbGRfYnVm ZmVyKQorICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworICBlbnVtIGZhY2Vf aWQgZmlsbF9jb2x1bW5fZmFjZV9pZCA9CisgICAgKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAg ICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY19pbmFjdGl2ZV93aW5k b3dzKSkKKyAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hh aXJzKSkpCisgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1pbmFj dGl2ZS1mYWNlIiksIHRydWUpCisgICAgOiAoIWVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICAg JiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfaW5hY3RpdmVfd2luZG93 cykpCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3No YWlycykpCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3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ZiAoYXJlYSA9PSBURVhUX0FSRUEgJiYgcm93LT5tb3VzZV9mYWNlX3AK KyAgICAgICAgICAmJiBobGluZm8tPm1vdXNlX2ZhY2VfYmVnX3JvdyA+PSAwCisgICAgICAgICAg JiYgaGxpbmZvLT5tb3VzZV9mYWNlX2VuZF9yb3cgPj0gMCkKKyAgICAgICAgeworICAgICAgICAg IHB0cmRpZmZfdCByb3dfdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCB3LT5jdXJyZW50X21h dHJpeCk7CisgICAgICAgICAgaWYgKHJvd192cG9zID49IGhsaW5mby0+bW91c2VfZmFjZV9iZWdf cm93CisgICAgICAgICAgICAgICYmIHJvd192cG9zIDw9IGhsaW5mby0+bW91c2VfZmFjZV9lbmRf cm93KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjaGVja19tb3VzZV9mYWNlID0gdHJ1 ZTsKKyAgICAgICAgICAgICAgbW91c2VfYmVnX2NvbCA9IChyb3dfdnBvcyA9PSBobGluZm8tPm1v dXNlX2ZhY2VfYmVnX3JvdykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gaGxpbmZv LT5tb3VzZV9mYWNlX2JlZ19jb2wKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMDsK KyAgICAgICAgICAgICAgbW91c2VfZW5kX2NvbCA9IChyb3dfdnBvcyA9PSBobGluZm8tPm1vdXNl X2ZhY2VfZW5kX3JvdykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gaGxpbmZvLT5t b3VzZV9mYWNlX2VuZF9jb2wKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogcm93LT51 c2VkW1RFWFRfQVJFQV07CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIC8qIENvbXB1 dGUgb3ZlcmhhbmdzIGZvciBhbGwgZ2x5cGggc3RyaW5ncy4gKi8KKyAgICAgIGlmIChGUkFNRV9S SUYgKGYpLT5jb21wdXRlX2dseXBoX3N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VkaW5nIGdseXBocyBmb3Igd2hpY2ggbm8gZ2x5cGgKKyAgICAg IHN0cmluZ3MgZXhpc3QuICovCisgICAgICBpID0gbGVmdF9vdmVyd3JpdGluZyAoaGVhZCk7Cisg ICAgICBpZiAoaSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19m YWNlIG92ZXJsYXBfaGw7CisgICAgICAgICAgaWYgKGNoZWNrX21vdXNlX2ZhY2UKKyAgICAgICAg ICAgICAgJiYgbW91c2VfYmVnX2NvbCA8IHN0YXJ0ICYmIG1vdXNlX2VuZF9jb2wgPiBpKQorICAg ICAgICAgICAgb3ZlcmxhcF9obCA9IERSQVdfTU9VU0VfRkFDRTsKKyAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgb3ZlcmxhcF9obCA9IERSQVdfTk9STUFMX1RFWFQ7CisgICAgICAgICAg aWYgKGhsID09IG92ZXJsYXBfaGwgfHwgY2xpcF9oZWFkID09IE5VTEwpCisgICAgICAgICAgICBj bGlwX2hlYWQgPSBoZWFkOworICAgICAgICAgIE1DX0JVSUxEX0dMWVBIX1NUUklOR1MgKGksIHN0 YXJ0LCBoLCB0LCBvdmVybGFwX2hsLCBkdW1teV94LCBsYXN0X3gpOworICAgICAgICAgIGZvciAo cyA9IGg7IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRf cCA9IHRydWU7CisgICAgICAgICAgY29tcHV0ZV9vdmVyaGFuZ3NfYW5kX3ggKHQsIGhlYWQtPngs IHRydWUpOworICAgICAgICAgIHByZXBlbmRfZ2x5cGhfc3RyaW5nX2xpc3RzICgmaGVhZCwgJnRh aWwsIGgsIHQpOworICAgICAgICB9CisgICAgICAvKiBBcHBlbmQgZ2x5cGhzIHN0cmluZ3MgZm9y IGdseXBocyBmb2xsb3dpbmcgdGhlIGxhc3QgZ2x5cGgKKyAgICAgIHN0cmluZyB0YWlsIHRoYXQg YXJlIG92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91bmQnIHdoaWNoCisgICAgICAgIGVyYXNl cyB0aGUgYXBwbGljYWJsZSByZWN0YW5nbGUuICovCisgICAgICAgIC8qIEVYQU1QTEU6ICAiRW1h Y3MgR3VpZGVkIFRvdXIJT3ZlcnZpZXciLgorICAgICAgICByaWdodF9vdmVyd3JpdHRlbiAoR05V IEVtYWNzIHdlbGNvbWUgc2NyZWVuIHdpdGhvdXQgYGJ1ZmZlci1kaXNwbGF5LXRhYmxlJykKKyAg ICAgICAgYW5kIHRoZSByZWFsIGZha2UgY3Vyc29yIGlzIHRvIHRoZSBpbW1lZGlhdGUgcmlnaHQg b2YgdGhlIHdvcmQgIlRvdXIiOiAqLworICAgICAgICByZWxhdGl2ZV94ID0gc3RhcnRfeDsKKyAg ICAgICAgZm9yIChzID0gaDsgczsgcyA9IHMtPm5leHQpCisgICAgICAgICAgeworICAgICAgICAg ICAgcy0+cmlnaHRfb3ZlcndyaXR0ZW5fcCA9IHRydWU7CisgICAgICAgICAgICBzLT5hY3Rpb25f dHlwZSA9IGFjdGlvbl90eXBlOworICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBzLT5maXJzdF9n bHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICBzLT5maXJzdF9nbHlwaC0+cmVsYXRpdmVf eCA9IHJlbGF0aXZlX3g7CisgICAgICAgICAgfQorICAgICAgICAgIC8qIEJlY2F1c2UgTUNfQlVJ TERfR0xZUEhfU1RSSU5HUyB1cGRhdGVzIHRoZSBmaXJzdCBhcmd1bWVudCwKKyAgICAgICAgICB3 ZSBkb24ndCBoYXZlIGBlbmQgPSBpOycgaGVyZS4gKi8KKyAgICAgICAgICBjb21wdXRlX292ZXJo YW5nc19hbmRfeCAoaCwgdGFpbC0+eCArIHRhaWwtPndpZHRoLCBmYWxzZSk7CisgICAgICAgICAg YXBwZW5kX2dseXBoX3N0cmluZ19saXN0cyAoJmhlYWQsICZ0YWlsLCBoLCB0KTsKKyAgICAgICAg ICBpZiAoY2xpcF90YWlsID09IE5VTEwpCisgICAgICAgICAgICBjbGlwX3RhaWwgPSB0YWlsOwor ICAgICAgICB9CisgICAgICAvKiBBcHBlbmQgZ2x5cGggc3RyaW5ncyBmb3IgZ2x5cGhzIGZvbGxv d2luZyB0aGUgbGFzdCBnbHlwaAorICAgICAgc3RyaW5nIHRhaWwgdGhhdCBvdmVyd3JpdGUgdGFp bC4gIFRoZSBmb3JlZ3JvdW5kIG9mIHN1Y2gKKyAgICAgIGdseXBocyBoYXMgdG8gYmUgZHJhd24g YmVjYXVzZSBpdCB3cml0ZXMgaW50byB0aGUgYmFja2dyb3VuZAorICAgICAgb2YgdGFpbC4gIFRo ZSBiYWNrZ3JvdW5kIG11c3Qgbm90IGJlIGRyYXduIGJlY2F1c2UgaXQgY291bGQKKyAgICAgIHBh aW50IG92ZXIgdGhlIGZvcmVncm91bmQgb2YgZm9sbG93aW5nIGdseXBocy4gKi8KKyAgICAgIGkg PSByaWdodF9vdmVyd3JpdGluZyAodGFpbCk7CisgICAgICBpZiAoaSA+PSAwKQorICAgICAgICB7 CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIG92ZXJsYXBfaGw7CisgICAgICAgICAg aWYgKGNoZWNrX21vdXNlX2ZhY2UKKyAgICAgICAgICAgICAgJiYgbW91c2VfYmVnX2NvbCA8IGkg JiYgbW91c2VfZW5kX2NvbCA+IGVuZCkKKyAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX01P VVNFX0ZBQ0U7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBE UkFXX05PUk1BTF9URVhUOworICAgICAgICAgIGlmIChobCA9PSBvdmVybGFwX2hsIHx8IGNsaXBf dGFpbCA9PSBOVUxMKQorICAgICAgICAgICAgY2xpcF90YWlsID0gdGFpbDsKKyAgICAgICAgICBp Kys7ICAgICAgLyogV2UgbXVzdCBpbmNsdWRlIHRoZSBJdGggZ2x5cGguICovCisgICAgICAgICAg TUNfQlVJTERfR0xZUEhfU1RSSU5HUyAoZW5kLCBpLCBoLCB0LCBvdmVybGFwX2hsLCB4LCBsYXN0 X3gpOworICAgICAgICAgIGZvciAocyA9IGg7IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgICAg cy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICAgICAgY29tcHV0ZV9vdmVyaGFu Z3NfYW5kX3ggKGgsIHRhaWwtPnggKyB0YWlsLT53aWR0aCwgZmFsc2UpOworICAgICAgICAgIGFw cGVuZF9nbHlwaF9zdHJpbmdfbGlzdHMgKCZoZWFkLCAmdGFpbCwgaCwgdCk7CisgICAgICAgIH0K KyAgICAgIHRhaWwgPSBnbHlwaF9zdHJpbmdfY29udGFpbmluZ19iYWNrZ3JvdW5kX3dpZHRoICh0 YWlsKTsKKyAgICAgIGlmIChjbGlwX3RhaWwpCisgICAgICAgIGNsaXBfdGFpbCA9IGdseXBoX3N0 cmluZ19jb250YWluaW5nX2JhY2tncm91bmRfd2lkdGggKGNsaXBfdGFpbCk7CisgICAgICBpZiAo Y2xpcF9oZWFkIHx8IGNsaXBfdGFpbCkKKyAgICAgICAgZm9yIChzID0gaGVhZDsgczsgcyA9IHMt Pm5leHQpCisgICAgICAgICAgeworICAgICAgICAgICAgcy0+Y2xpcF9oZWFkID0gY2xpcF9oZWFk OworICAgICAgICAgICAgcy0+Y2xpcF90YWlsID0gY2xpcF90YWlsOworICAgICAgICAgIH0KKyAg ICB9CisgIC8qIERyYXcgYWxsIHN0cmluZ3MuICovCisgIGZvciAocyA9IGhlYWQ7IHMgJiYgZHJh d19wOyBzID0gcy0+bmV4dCkKKyAgICBGUkFNRV9SSUYgKGYpLT5tY19zY3JpYmVfc3RyaW5nIChz LCBtYXRyaXgsIHJvdywgbHNsLCBnbHlwaF9mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3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obCwg aW50IHgsIGludCBocG9zLCBpbnQgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qg bWNfUkdCIGxzbCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLAorICAgICAgICAgICAgICAg ICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUsIGludCB3ZCwgYm9vbCBhY3Rp dmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICBib29sIGN1cnNvcl9nY19wKQoreworICBzdHJ1 Y3QgZ2x5cGhfcm93ICpib3R0b21fcm93ID0gTUFUUklYX0JPVFRPTV9URVhUX1JPVyAobWF0cml4 LCB3KTsKKyAgaW50IGJvdHRvbV92cG9zID0gTUFUUklYX1JPV19WUE9TIChib3R0b21fcm93LCBt YXRyaXgpOworLyoKKyAgICAgIHN0cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBoID0gbWNfZ2V0X2N1 cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIGhwb3MsIHZwb3MpOworICAgICAgZnByaW50ZiAo c3RkZXJyLCAibWNfZHJhd19jdXJzb3JfZ2x5cGg6ICBjaCAoJWQpIHwgeCAoJWQpLCBocG9zICgl ZCksIHZwb3MoJWQpLCBobCAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jf Z2x5cGgtPnUuY2gsIHgsIGhwb3MsIHZwb3MsIGhsKTsKKyovCisgIGJsb2NrX2lucHV0ICgpOwor ICBib29sIGRyYXdfcCA9IHRydWU7CisgIG1jX2RyYXdfZ2x5cGhzICh3LCBtYXRyaXgsIHJvdywg eCwgVEVYVF9BUkVBLCBocG9zLCBocG9zICsgMSwgaGwsIDAsCisgICAgICAgICAgICAgICAgICB2 cG9zLCBib3R0b21fdnBvcywgbHNsLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0 aXZlX3AsCisgICAgICAgICAgICAgICAgICBjdXJzb3JfZ2NfcC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FzZSB0aGUgY3Vyc29yLiAqLworICBpZiAodnBv cyA+PSBtYXRyaXgtPm5yb3dzKQorICAgIHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICBm cHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwgMik7Cisg ICAgICByZXR1cm47CisgICAgfQorICAvKiBJZiByb3cgY29udGFpbmluZyBjdXJzb3IgaXMgbWFy a2VkIGludmFsaWQsIHRoZXJlIGlzIG5vdGhpbmcgd2UKKyAgICAgY2FuIGRvLiAqLworICBpZiAo IXJvdy0+ZW5hYmxlZF9wKQorICAgIHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICBmcHJp bnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwgMyk7CisgICAg ICByZXR1cm47CisgICAgfQorICAvKiBJZiBsaW5lIHNwYWNpbmcgaXMgPiAwLCBvbGQgY3Vyc29y IG1heSBvbmx5IGJlIHBhcnRpYWxseSB2aXNpYmxlIGluCisgICAgIHdpbmRvdyBhZnRlciBzcGxp dC13aW5kb3cuICBTbyBhZGp1c3QgdmlzaWJsZSBoZWlnaHQuICovCisgIHJvdy0+dmlzaWJsZV9o ZWlnaHQgPSBtaW4gKHJvdy0+dmlzaWJsZV9oZWlnaHQsCisgICAgICAgICAgICB3aW5kb3dfdGV4 dF9ib3R0b21feSAodykgLSByb3ctPnkpOworICAvKiBJZiByb3cgaXMgY29tcGxldGVseSBpbnZp c2libGUsIGRvbid0IGF0dGVtcHQgdG8gZGVsZXRlIGEgY3Vyc29yIHdoaWNoCisgICAgIGlzbid0 IHRoZXJlLiAgVGhpcyBjYW4gaGFwcGVuIGlmIGN1cnNvciBpcyBhdCB0b3Agb2YgYSB3aW5kb3cs IGFuZAorICAgICB3ZSBzd2l0Y2ggdG8gYSBidWZmZXIgd2l0aCBhIGhlYWRlciBsaW5lIGluIHRo YXQgd2luZG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G1vdXNlIGhpZ2hsaWdodGluZyBkb2VzIG5vdC4gKi8KKyAgICAgICYmIHJvdy0+ dXNlZFtURVhUX0FSRUFdID4gaHBvcyAmJiBocG9zID49IDApCisgICAgbW91c2VfZmFjZV9oZXJl X3AgPSB0cnVlOworICAvKiBNYXliZSBjbGVhciB0aGUgZGlzcGxheSB1bmRlciB0aGUgY3Vyc29y LiAqLworICBpZiAoY3Vyc29yX3R5cGUgPT0gTUNfSE9MTE9XX0JPWAorICAgICAgfHwgY3Vyc29y X3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICB7CisgICAgICBpbnQgdGVtcF94ID0geDsKKyAg ICAgIGludCBoZWFkZXJfbGluZV9oZWlnaHQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3 KTsKKyAgICAgIGN1cnNvcl9nbHlwaCA9IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwg cm93LCBocG9zLCB2cG9zKTsKKyAgICAgIGlmIChjdXJzb3JfZ2x5cGggPT0gTlVMTCkKKyAgICAg ICAgeworICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJy LCAibWNfZXJhc2VfY3Vyc29yOiAgcmV0dXJuICglZClcbiIsIDcpOworICAgICAgICAgIHJldHVy bjsKKyAgICAgICAgfQorICAgICAgaW50IHRlbXBfd2QgPSBjdXJzb3JfZ2x5cGgtPnBpeGVsX3dp ZHRoOworICAgICAgaWYgKHRlbXBfeCA8IDApCisgICAgICAgIHsKKyAgICAgICAgICB0ZW1wX3dk ICs9IHRlbXBfeDsKKyAgICAgICAgICB0ZW1wX3ggPSAwOworICAgICAgICB9CisgICAgICB0ZW1w X3dkID0gbWluICh3ZCwgd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKSAtIHRlbXBfeCk7 CisgICAgICBpbnQgZnkgPSBXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgbWF4IChoZWFk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cgPCBtYXRyaXgtPm5yb3dzKTsgKi8KKyAgYm9vbCBiYXJmX2NyYXNoX29uZSA9 IChtYXRyaXggJiYgbWF0cml4LT5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jh c2hfb25lKQorICAgIHJldHVybjsKKyAgYm9vbCBiYXJmX2NyYXNoX3R3byA9ICh2cG9zID49IDAg JiYgdnBvcyA8IG1hdHJpeC0+bnJvd3MpID8gZmFsc2UgOiB0cnVlOworICBpZiAoYmFyZl9jcmFz aF90d28pCisgICAgcmV0dXJuOworICBpZiAoeCA8IDAKKyAgICAgIHx8IHkgPCAwCisgICAgICB8 fCBocG9zIDwgMAorICAgICAgfHwgdnBvcyA8IDApCisgICAgcmV0dXJuOworICBMaXNwX09iamVj dCBidWYgPSB3LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYpOworICBib29sIGF1dG9f aHNjcm9sbF9tb2RlX3AgPSBFUSAoRmJ1ZmZlcl9sb2NhbF92YWx1ZSAoUWF1dG9faHNjcm9sbF9t b2RlLCBidWYpLCBRY3VycmVudF9saW5lKTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwtbGVmdCA1 KSAqLworICBib29sIGhzY2xfYWxsX3RlbXBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAor ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IDApOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8 IGFuZCBkbyBub3RoaW5nLiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMF9wID0gKHctPnN1c3Bl bmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Ny b2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAw CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9sbCk7 CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyBlbHNlIGJlc2lkZXMg aG9yaXpvbnRhbGx5IHNjcm9sbGluZyB0aGUKKyAgICAgICAgICAgICAgIGN1cnJlbnQgbGluZSBk aWZmZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9u dGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8xX3Ag PSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct PmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3Jv bGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0g dy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIC4uLgorICAgICAgICAg ICAgICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJl bnRseS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzJfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hz Y3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9w CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA9PSAwCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIC8qIEVY QU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSk7IGFuZCwgdGhlbiBwcmVzcyB0aGUgbGVmdCBhcnJvdyBr ZXkgb25lIHRpbWUuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFs bHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuKi8KKyAgYm9vbCBoc2NsX3RlbXBfcCA9ICghdy0+c3Vz cGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxf bW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAg ICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMt dSBDLXggPCBhbmQgZG8gc29tZXRoaW5nIHRoYXQgY2F1c2VzIHRoZSBjdXJyZW50IGxpbmUgdG8g YmUKKyAgICAgICAgICAgICAgIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4KKyAg ICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZm ZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX3Blcm1fcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3Jv bGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAg ICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICA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AgICAgIHx8IGhzY2xfYWxsX3Blcm1fMF9wCisg ICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMV9wCisgICAgICAgICAgICAgICAgIHx8 IGhzY2xfYWxsX3Blcm1fMl9wCisgICAgICAgICAgICAgICAgIHx8IGhzY2xfdGVtcF9wCisgICAg ICAgICAgICAgICAgIHx8IGhzY2xfcGVybV9wKSkKKyAgICAgIHsKKyAgICAgICAgZW51bSBmYWNl X2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgKCFhY3RpdmVfcAorICAgICAg ICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2ZV93 aW5kb3dzKSkpCisgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgi Ky1vdmVybGF5LWFycm93LWhzY2wtaW5hY3RpdmUtZmFjZSIpLCB0cnVlKQorICAgICAgICAgIDog KGFjdGl2ZV9wKQorICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJu ICgiKy1vdmVybGF5LWFycm93LWhzY2wtZmFjZSIpLCB0cnVlKQorICAgICAgICAgIDogREVGQVVM VF9GQUNFX0lEOworICAgICAgICBmYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJ TkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisg ICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgaWYgKGhzY2xfYWxs X3Blcm1fMF9wKQorICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1h cCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICBl bHNlIGlmIChoc2NsX2FsbF9wZXJt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kID0gZmFjZV9pZDsKKyAgICAgICAgcm93LT5s ZWZ0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9k aWNfcCA9IGZhbHNlOworICAgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywgdHJ1 ZSwgY3Vyc29yX3R5cGUpOworICAgICAgfQorICAgICAgZWxzZSBpZiAoIXJlbW92ZV9wCisgICAg ICAgICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRf QVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURf SE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBo X2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5 cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAg ICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJS T1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFS CisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJ Q0FMX0JBUgorICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNB TF9CQVJfQkFDS1NMQVNIKSkKKyAgICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IGJpdG1h cF9mbGF2b3IgPSAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJS T1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19y ZWN0YW5nbGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRf QVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2 ZXJzZWRfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVj dGFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2Zs YXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9 PSBNQ19WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBRbWNfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxf YmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZv ciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBRbmlsOworICAgICAgICAgIGZyaW5nZV9iaXRt YXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBsb29rdXBfZnJpbmdlX2JpdG1hcCAoYml0bWFwX2ZsYXZvcikKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAg IGZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAg ICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVD VEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxh dm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAg ICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIp KQorICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVy biAoIistcmV2ZXJzZWQtdmVydGljYWwtYmFyLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAg ICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAg ICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RB TkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3Ig IT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAg ICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAg ICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy12 ZXJ0aWNhbC1iYXItZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRf RkFDRV9JRDsKKyAgICAgICAgICByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9IGZhbHNlOworICAg ICAgICAgIHJvdy0+cmlnaHRfZnJpbmdlX2JpdG1hcCA9IGZyaW5nZV9iaXRtYXA7CisgICAgICAg ICAgcm93LT5yaWdodF9mcmluZ2VfZmFjZV9pZCA9IGZhY2VfaWQ7CisgICAgICAgICAgcm93LT5y aWdodF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVy aW9kaWNfcCA9IGZhbHNlOworICAgICAgICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93 LCBmYWxzZSwgY3Vyc29yX3R5cGUpOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGdseXBo X2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0g TUNfR0xZUEhMRVNTKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgb25fcCA9IHRydWU7 CisgICAgICAgICAgICBGUkFNRV9SSUYgKGYpLT5tY19zY3JpYmVfY3Vyc29yICh3LCBtYXRyaXgs IHJvdywgeCwgZngsIHksIGZ5LCBocG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgdnBvcywgd2QsIGgsIGxzbCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGdseXBoX2Zs YXZvciwgb25fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGFjdGl2ZV9wKTsKKyAgICAgICAgICB9Cit9CisKKy8qIER1bXAgY29udGVudHMgb2YgZ2x5cGgg R0xZUEggdG8gc3RkZXJyLiAgUk9XIGFuZCBBUkVBIGFyZQorICAgdGhlIGdseXBoIHJvdyBhbmQg YXJlYSB3aGVyZSB0aGUgZ2x5cGggY29tZXMgZnJvbS4gKi8KK3ZvaWQKK21jX2R1bXBfZ2x5cGgg KHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgc3RydWN0IGdseXBoICpnbHlwaCwgaW50IGFyZWEsCisg ICAgICAgICAgICAgICBpbnQgcmVsYXRpdmVfeCwgaW50IHZwb3MpCit7CisgIGlmIChnbHlwaC0+ dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICB8fCBnbHlwaC0+dHlwZSA9PSBHTFlQSExFU1NfR0xZ UEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01 ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUz ZCAgJTNkICVzICVzXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0s CisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAt IDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9H TFlQSAorICAgICAgICAgPyAnQycKKyAgICAgICAgIDogJ0cnKSwKKyAgICAgICAgZ2x5cGgtPmNo YXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicK KyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJwor ICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAn CisgICAgICAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAor ICAgICAgICBnbHlwaC0+dS5jaCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGds eXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAor ICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9zLCB2cG9zLCBnbHlwaC0+enZf cCA/ICJaViIgOiAiLS0iLAorICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAoZ2x5cGgtPnUuY2gp KTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZUEgpCisgICAg eworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMg JTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVz ICVzXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAg ICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAg ICAgICByZWxhdGl2ZV94LAorICAgICAgICAnUycsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAor ICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ0InCisgICAg ICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAg ICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJzAnCisgICAgICAg ICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgMHUsCisg ICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAor ICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBo LT55LCBnbHlwaC0+aHBvcywgdnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAg ICAgIlxcUyIpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgp CisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAl NWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAg JTNkICVzICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisg ICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEp LAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5jaGFy cG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ0In CisgICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1Mn CisgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJzAnCisg ICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAg KHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuaW1nX2lkLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwK KyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2Jv eF9saW5lX3AsCisgICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIHZwb3Ms IGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisgICAgfQorICBlbHNl IGlmIChnbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpCisgICAgeworICAgICAgZnByaW50 ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2Qg MHglMDZ4IiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAg ICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAg ICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJysnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywK KyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdCJworICAg ICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAg ICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICcwJworICAgICAg ICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgICh1bnNp Z25lZCBpbnQpIGdseXBoLT51LmNtcC5pZCk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTRk ICUxLjFkJTEuMWQiLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxl ZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3ApOworICAgICAg aWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAl NWQgJTRkICAlM2QgICUzZCAlcyAuIFslZC0lZF1cbiIsCisgICAgICAgICAgICAgICAgICAgICAg ICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgdnBvcywgZ2x5cGgtPnp2X3AgPyAi WlYiIDogIi0tIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaC0+c2xpY2UuY21wLmZy b20sIGdseXBoLT5zbGljZS5jbXAudG8pOworICAgICAgICBlbHNlCisgICAgICAgIGZwcmludGYg KHN0ZGVyciwgIlxuIik7CisgICAgfQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBYV0lER0VU X0dMWVBIKQorICAgIHsKKyNpZm5kZWYgSEFWRV9YV0lER0VUUworICAgICAgZWFzc3VtZSAoZmFs c2UpOworI2Vsc2UKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAgJTVkLyUtNWQg JTVkICU0YyAlNmQgJWMgJTNkIDB4JTA1eCAlNGQgJTEuMWQlMS4xZCAlNWQgJTRkICAlM2QgICUz ZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAg ICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwK KyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1gnLAorICAgICAgICBnbHlwaC0+Y2hhcnBv cywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgID8gJ0InCisg ICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAg ICAgICAgIDogJy0nKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5 cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGds eXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+dS54d2lkZ2V0LAorICAgICAg ICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9zLCB2cG9zLCBnbHlwaC0+enZfcCA/ICJa ViIgOiAiLS0iLAorICAgICAgICAnLicpOworI2VuZGlmCisgICAgfQorfQorCisvKiBEdW1wIHRo ZSBjb250ZW50cyBvZiBnbHlwaCByb3cgYXQgVlBPUyBpbiBNQVRSSVggdG8gc3RkZXJyLgorICAg R0xZUEhTIDAgbWVhbnMgZG9uJ3Qgc2hvdyBnbHlwaCBjb250ZW50cy4KKyAgIEdMWVBIUyAxIG1l YW5zIHNob3cgZ2x5cGhzIGluIHNob3J0IGZvcm0KKyAgIEdMWVBIUyA+IDEgbWVhbnMgc2hvdyBn bHlwaHMgaW4gbG9uZyBmb3JtLiAqLwordm9pZAorbWNfZHVtcF9nbHlwaF9yb3cgKHN0cnVjdCBn bHlwaF9yb3cgKnJvdywgaW50IHZwb3MsIGludCBnbHlwaHMpCit7CisgIGludCByZWxhdGl2ZV94 ID0gMDsKKyAgaWYgKGdseXBocyAhPSAxKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwg IlxuRFVNUCBHTFlQSCBST1dcbiIpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiUm93ICAgICBT dGFydCAgICAgICBFbmQgVXNlZCBvRT48XFxDVFpGZXNtICAgICBYICAgIFkgICAgVyAgICBIICAg IFYgICAgQSAgICBQXG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIj09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PVxuIik7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIlM2QgJTkicEQiZCAlOSJwRCJk ICU0ZCAlMS4xZCUxLjFkJTEuMWQlMS4xZFwKKyUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4x ZCUxLjFkJTEuMWQgICU0ZCAlNGQgJTRkICU0ZCAlNGQgJTRkICU0ZFxuIiwKKyAgICAgICAgIHZw b3MsCisgICAgICAgICBNQVRSSVhfUk9XX1NUQVJUX0NIQVJQT1MgKHJvdyksCisgICAgICAgICBN QVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpLAorICAgICAgICAgcm93LT51c2VkW1RFWFRfQVJF QV0sCisgICAgICAgICByb3ctPmNvbnRhaW5zX292ZXJsYXBwaW5nX2dseXBoc19wLAorICAgICAg ICAgcm93LT5lbmFibGVkX3AsCisgICAgICAgICByb3ctPnRydW5jYXRlZF9vbl9sZWZ0X3AsCisg ICAgICAgICByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wLAorICAgICAgICAgcm93LT5jb250aW51 ZWRfcCwKKyAgICAgICAgIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAocm93KSwKKyAg ICAgICAgIE1BVFJJWF9ST1dfRElTUExBWVNfVEVYVF9QIChyb3cpLAorICAgICAgICAgcm93LT5l bmRzX2F0X3p2X3AsCisgICAgICAgICByb3ctPmZpbGxfbGluZV9wLAorICAgICAgICAgcm93LT5l bmRzX2luX21pZGRsZV9vZl9jaGFyX3AsCisgICAgICAgICByb3ctPnN0YXJ0c19pbl9taWRkbGVf b2ZfY2hhcl9wLAorICAgICAgICAgcm93LT5tb3VzZV9mYWNlX3AsCisgICAgICAgICByb3ctPngs CisgICAgICAgICByb3ctPnksCisgICAgICAgICByb3ctPnBpeGVsX3dpZHRoLAorICAgICAgICAg cm93LT5oZWlnaHQsCisgICAgICAgICByb3ctPnZpc2libGVfaGVpZ2h0LAorICAgICAgICAgcm93 LT5hc2NlbnQsCisgICAgICAgICByb3ctPnBoeXNfYXNjZW50KTsKKyAgICAgIC8qIFRoZSBuZXh0 IDMgbGluZXMgc2hvdWxkIGFsaWduIHRvICJTdGFydCIgaW4gdGhlIGhlYWRlci4gKi8KKyAgICAg IGZwcmludGYgKHN0ZGVyciwgIiAgICAlOSJwRCJkICU5InBEImRcdCU1ZFxuIiwgcm93LT5zdGFy dC5vdmVybGF5X3N0cmluZ19pbmRleCwKKyAgICAgICAgIHJvdy0+ZW5kLm92ZXJsYXlfc3RyaW5n X2luZGV4LAorICAgICAgICAgcm93LT5jb250aW51YXRpb25fbGluZXNfd2lkdGgpOworICAgICAg ZnByaW50ZiAoc3RkZXJyLCAiICAgICU5InBEImQgJTkicEQiZFxuIiwKKyAgICAgICAgIENIQVJQ T1MgKHJvdy0+c3RhcnQuc3RyaW5nX3BvcyksCisgICAgICAgICBDSEFSUE9TIChyb3ctPmVuZC5z dHJpbmdfcG9zKSk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTlkICU5ZFxuIiwgcm93 LT5zdGFydC5kcHZlY19pbmRleCwKKyAgICAgICAgIHJvdy0+ZW5kLmRwdmVjX2luZGV4KTsKKyAg ICB9CisgIGlmIChnbHlwaHMgPiAxKQorICAgIHsKKyAgICAgIGZvciAoaW50IGFyZWEgPSBMRUZU X01BUkdJTl9BUkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2FyZWEpCisgIHsKKyAgICBzdHJ1Y3Qg Z2x5cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV07CisgICAgc3RydWN0IGdseXBoICpnbHlw aF9lbmQgPSBnbHlwaCArIHJvdy0+dXNlZFthcmVhXTsKKyAgICAvKiBHbHlwaCBmb3IgYSBsaW5l IGVuZCBpbiB0ZXh0LiAqLworICAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiBnbHlwaCA9PSBn bHlwaF9lbmQgJiYgZ2x5cGgtPmNoYXJwb3MgPiAwKQorICAgICAgKytnbHlwaF9lbmQ7CisgICAg aWYgKGdseXBoIDwgZ2x5cGhfZW5kKQorICAgICAgZnByaW50ZiAoc3RkZXJyLCAiR2x5cGgjL1Rv dGFsIFJlbC5YIFQgICAgICAgUG9zIE8gICBXICAgICBDb2RlIEZhY2UgTFIgICAgIFggICAgWSBI UE9TIFZQT1MgWlYgQ1xuIik7CisgICAgZm9yICg7IGdseXBoIDwgZ2x5cGhfZW5kOyArK2dseXBo KQorICAgICAgeworICAgICAgICBtY19kdW1wX2dseXBoIChyb3csIGdseXBoLCBhcmVhLCByZWxh dGl2ZV94LCB2cG9zKTsKKyAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7 CisgICAgICB9CisgIH0KKyAgICB9CisgIGVsc2UgaWYgKGdseXBocyA9PSAxKQorICAgIHsKKyAg ICAgIGNoYXIgc1tTSFJUX01BWCArIDRdOworICAgICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFS R0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgeworICAgIGludCBpOworICAg IGZvciAoaSA9IDA7IGkgPCByb3ctPnVzZWRbYXJlYV07ICsraSkKKyAgICAgIHsKKyAgICAgICAg c3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdICsgaTsKKyAgICAgICAgaWYg KGkgPT0gcm93LT51c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GdseXBocyBp biBsb25nIGZvcm0uICAqLykKKyAgKExpc3BfT2JqZWN0IHJvdywgTGlzcF9PYmplY3QgZ2x5cGhz KQoreworICBzdHJ1Y3Qgd2luZG93ICp3ID0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KTsKKyAg c3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgIEVNQUNT X0lOVCB2cG9zOworICBpZiAoTklMUCAocm93KSkKKyAgICB7CisgICAgICBpbnQgZDEsIGQyLCBk MywgZDQsIGQ1LCB5cG9zOworICAgICAgYm9vbCB2aXNpYmxlX3AgPSBwb3NfdmlzaWJsZV9wICh3 LCBQVCwgJmQxLCAmZDIsICZkMywgJmQ0LCAmZDUsICZ5cG9zKTsKKyAgICAgIGludCBoZWFkZXJf bGluZV9oZWlnaHQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgIGludCB2 b2Zmc2V0ID0gKGhlYWRlcl9saW5lX2hlaWdodCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICYm IHlwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgICAgID8geXBvcyArIDEKKyAgICAgICAgICAg ICAgICAgICAgICA6IHlwb3M7CisgICAgICBpZiAodmlzaWJsZV9wKQorICAgICAgICB2cG9zID0g dm9mZnNldDsKKyAgICAgICAgZWxzZQorICAgICAgICAgIHZwb3MgPSAwOworICAgIH0KKyAgICBl bHNlCisgICAgICB7CisgICAgICAgIENIRUNLX05VTUJFUiAocm93KTsKKyAgICAgICAgdnBvcyA9 IFhGSVhOVU0gKHJvdyk7CisgICAgICB9CisgIGlmICh2cG9zID49IDAgJiYgdnBvcyA8IG1hdHJp eC0+bnJvd3MpCisgICAgbWNfZHVtcF9nbHlwaF9yb3cgKE1BVFJJWF9ST1cgKG1hdHJpeCwgdnBv cyksCisgICAgICAgIHZwb3MsCisgICAgICAgIFRZUEVfUkFOR0VEX0ZJWE5VT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qYnVmZmVyID0gWEJVRkZFUiAody0+Y29udGVudHMpOworICBmcHJpbnRmIChz dGRlcnIsICJQVCA9ICUicEQiZCwgQkVHViA9ICUicEQiZC4gWlYgPSAlInBEImRcbiIsCisgICAg IEJVRl9QVCAoYnVmZmVyKSwgQlVGX0JFR1YgKGJ1ZmZlciksIEJVRl9aViAoYnVmZmVyKSk7Cisg IGZwcmludGYgKHN0ZGVyciwgIkN1cnNvciB4ID0gJWQsIHkgPSAlZCwgaHBvcyA9ICVkLCB2cG9z ID0gJWRcbiIsCisgICAgIHctPmN1cnNvci54LCB3LT5jdXJzb3IueSwgdy0+Y3Vyc29yLmhwb3Ms IHctPmN1cnNvci52cG9zKTsKKyAgZnByaW50ZiAoc3RkZXJyLCAiPT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4iKTsKKyAgbWNfZHVtcF9nbHlwaF9tYXRyaXgg KHctPmN1cnJlbnRfbWF0cml4LAorICAgICAgICAgVFlQRV9SQU5HRURfRklYTlVNUCAoaW50LCBn bHlwaHMpID8gWEZJWE5VTSAoZ2x5cGhzKSA6IDApOworICByZXR1cm4gUW5pbDsKK30KKwordm9p ZAorbWNfcmVzZXRfY2FjaGUgKHN0cnVjdCB3aW5kb3cgKncpCit7CisgIGlmICghQlVGRkVSUCAo dy0+Y29udGVudHMpKQorICAgIHJldHVybjsKKyAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2Fj aGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAg ICArK2NhY2hlX3R5cGUpCisgICAgeworICAgICAgYm9vbCBidmFyX2FjdGl2ZV9wOworICAgICAg c3dpdGNoIChjYWNoZV90eXBlKQorICAgICAgICB7CisgICAgICAgICAgY2FzZSBOT19DQUNIRToK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAg ICAgICAgIGNhc2UgTUNfQ0FDSEU6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChC VUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICAgICAgICAgIGJ2YXJfYWN0 aXZlX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChCVUZGRVJQICh3LT5jb250 ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBtY19jb25mKSkpCisgICAgICAgICAgICAgICAgICBidmFyX2FjdGl2ZV9w ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAg Y2FzZSBDSF9DQUNIRToKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKEJVRkZFUlAg KHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICAgICAgICAgICAgYnZhcl9hY3RpdmVf cCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRz KQorICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICAgICAgICAgICAgICAgIGJ2YXJfYWN0aXZlX3Ag PSB0cnVlOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBj YXNlIEZDX0NBQ0hFOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoQlVGRkVSUCAo dy0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkKKyAgICAgICAgICAgICAgICBidmFyX2FjdGl2ZV9w ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoQlVGRkVSUCAody0+Y29udGVudHMp CisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgZmNfdmlzaWJsZSkpKQorICAgICAgICAgICAgICAgICAgYnZhcl9hY3RpdmVfcCA9 IHRydWU7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgICBpZiAoIWJ2YXJfYWN0aXZlX3ApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBEZWNyZWFz ZSB0aGUgc2l6ZSBvZiB0aGUgYXJyYXkgdG8gYSBiYXJlIG1pbmltdW0uICovCisgICAgICAgICAg Zm9yIChpbnQgdm50aCA9IDA7IHZudGggPCB3LT5tY19tYXRyaXgudnBvc191c2VkOyArK3ZudGgp CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmICh3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV0gPiAxKQorICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd ID0KKyAgICAgICAgICAgICAgICAgICAgeG5yZWFsbG9jICh3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXSwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBz aXplb2YgKnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdKTsKKyAgICAg ICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX2FsbG9j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3VycmVudCBkYXRhLgorICAgICAgICBlbHNlIGlmIChidmFy X2FjdGl2ZV9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGZvciAoaW50IHZudGggPSAwOyB2 bnRoIDwgdy0+bWNfbWF0cml4LnZwb3NfdXNlZDsgKyt2bnRoKQorICAgICAgICAgICAgICB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdID0gMDsKKyAgICAgICAg ICAgIHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV0gPSAwOworICAgICAgICAg IH0KKyAgICB9CisvKgorICBmb3IgKGludCB2bnRoID0gMDsKKyAgICAgICB2bnRoIDwgdy0+bWNf bWF0cml4LnZwb3NfdXNlZDsKKyAgICAgICArK3ZudGgpCisgICAgZm9yIChlbnVtIG1jX2NhY2hl X3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NB Q0hFOworICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNf cmVzZXRfY2FjaGUgKCVkKTogICVzXG5cCisgIHctPm1jX21hdHJpeC52cG9zX3VzZWQgKCVkKVxu XAorICB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkWyVzXSAoJWQpXG5cCisgIHctPm1jX21hdHJp eC5jdXJzb3JzX3VzZWRbJXNdICglZClcblwKKyAgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFsl c10gKCVkKVxuXAorICB3LT5tY19tYXRyaXgudnBvc1slZF0uY2FjaGVfdXNlZFslc10gKCVkKVxu XAorICB3LT5tY19tYXRyaXgudnBvc1slZF0uY2FjaGVfdXNlZFslc10gKCVkKVxuXAorICB3LT5t Y19tYXRyaXgudnBvc1slZF0uY2FjaGVfdXNlZFslc10gKCVkKVxuIiwKKyAgICB2bnRoLCBtY19j YWNoZV90eXBlX3RvX3N0cmluZ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91bmQuZ3JlZW4sIGJhY2tncm91bmQuYmx1ZSk7CisgICAgfQor ICBib29sIHJlbW92ZV9wID0gZmFsc2U7CisgIGlmIChkcmF3X3AKKyAgICAgICYmIChmcm9tX3do ZXJlID09IFNLSVBQRUQKKyAgICAgICAgICB8fCBmcm9tX3doZXJlID09IFBPU1RfQ0hBTkdFRAor ICAgICAgICAgIHx8IGZyb21fd2hlcmUgPT0gVU5DSEFOR0VECisgICAgICAgICAgfHwgZnJvbV93 aGVyZSA9PSBTRVRfQ1VSU09SX1RXTykpCisgICAgeworICAgICAgYm9vbCBzYW1lX3AgPSBmYWxz ZTsKKyAgICAgIGZvciAoaW50IG50aCA9IDA7IG50aCA8IHctPm1jX21hdHJpeC52cG9zW3JuXS5j YWNoZV91c2VkW2NhY2hlX3R5cGVdOyArK250aCkKKyAgICAgICAgeworICAgICAgICAgIHNhbWVf cCB8PQorICAgICAgICAgICAgKHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLnNhbWVfcCA9PSB0cnVlCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nb cm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGgudHlwZSA9PSBnbHlwaC0+dHlwZQorICAg ICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmdseXBoLmJ5dGVwb3MgPT0gZ2x5cGgtPmJ5dGVwb3MKKyAgICAgICAgICAgICAmJiB3LT5tY19t YXRyaXgudnBvc1tybl0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5nbHlwaC5jaGFycG9zID09IGds eXBoLT5jaGFycG9zCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hl W2NhY2hlX3R5cGVdW250aF0uZ2x5cGgudS52YWwgPT0gZ2x5cGgtPnUudmFsCisgICAgICAgICAg ICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGgu ZmFjZV9pZCA9PSBnbHlwaC0+ZmFjZV9pZAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52 cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnBhZGRpbmdfcCA9PSBnbHlwaC0+ cGFkZGluZ19wCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF0uZ2x5cGgubGVmdF9ib3hfbGluZV9wID09IGdseXBoLT5sZWZ0X2JveF9s aW5lX3AKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1tybl0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS5nbHlwaC5yaWdodF9ib3hfbGluZV9wID09IGdseXBoLT5yaWdodF9ib3hfbGlu ZV9wCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5 cGVdW250aF0uZ2x5cGgudm9mZnNldCA9PSBnbHlwaC0+dm9mZnNldAorICAgICAgICAgICAgICYm IHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnBpeGVs X3dpZHRoID09IGdseXBoLT5waXhlbF93aWR0aAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJp eC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnNsaWNlLmltZy54ID09IGds eXBoLT5zbGljZS5pbWcueAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnNsaWNlLmltZy55ID09IGdseXBoLT5zbGljZS5p bWcueQorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhdLmdseXBoLnNsaWNlLmltZy53aWR0aCA9PSBnbHlwaC0+c2xpY2UuaW1nLndpZHRo CisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVd W250aF0uZ2x5cGguc2xpY2UuaW1nLmhlaWdodCA9PSBnbHlwaC0+c2xpY2UuaW1nLmhlaWdodAor ICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmdseXBoLnNsaWNlLmNtcC5mcm9tID09IGdseXBoLT5zbGljZS5jbXAuZnJvbQorICAgICAg ICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLngg PT0geAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhdLmZ4ID09IGZ4CisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5d LmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueSA9PSB5CisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0 cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZnkgPT0gZnkKKyAgICAgICAgICAg ICAmJiB3LT5tY19tYXRyaXgudnBvc1tybl0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5ocG9zID09 IGhwb3MKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1tybl0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS52cG9zID09IHZwb3MKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBv c1tybl0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS53ZCA9PSB3ZAorICAgICAgICAgICAgICYmIHct Pm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmggPT0gaAorICAgICAg ICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1 cnNvcl90eXBlID09IGN1cnNvcl90eXBlCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZw b3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vyc29yX3dpZHRoID09IGN1cnNvcl93aWR0 aAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmZvcmVncm91bmQucmVkID09IGZvcmVncm91bmQucmVkCisgICAgICAgICAgICAgJiYg dy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZm9yZWdyb3VuZC5n cmVlbiA9PSBmb3JlZ3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZw b3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZm9yZWdyb3VuZC5ibHVlID09IGZvcmVncm91 bmQuYmx1ZQorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhdLmJhY2tncm91bmQucmVkID09IGJhY2tncm91bmQucmVkCisgICAgICAgICAg ICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmFja2dy b3VuZC5ncmVlbiA9PSBiYWNrZ3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0 cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmFja2dyb3VuZC5ibHVlID09IGJh Y2tncm91bmQuYmx1ZQorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLmFjdGl2ZV9wID09IGFjdGl2ZV9wCisgICAgICAgICAgICAgJiYg dy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGhfZmxhdm9y ID09IGdseXBoX2ZsYXZvcgorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmVuYWJsZWRfcCA9PSB0cnVlKTsKKyAgICAgICAgfQorICAg ICAgaWYgKCFzYW1lX3ApCisgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCBtYXRyaXgs IHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwgY3Vyc29yX3R5cGUsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGFjdGl2 ZV9wLCBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAgIHJldHVybjsKKyAgICB9CisgICAg ZWxzZSBpZiAoZHJhd19wCisgICAgICAgICAgICAgJiYgKGZyb21fd2hlcmUgPT0gU0NSSUJFX09O RQorICAgICAgICAgICAgICAgICB8fCBmcm9tX3doZXJlID09IFNDUklCRV9UV08KKyAgICAgICAg ICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBTQ1JJQkVfVEhSRUUKKyAgICAgICAgICAgICAgICAg fHwgZnJvbV93aGVyZSA9PSBOT1dIRVJFKSkKKyAgICB7CisgICAgICBtY19kcmF3X2VyYXNlX2h5 YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1 cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgZm9y ZWdyb3VuZCwgYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgcmVtb3ZlX3ApOworICAgICAgcmV0dXJu OworICAgIH0KKyAgaWYgKGNhY2hlX3R5cGUgPT0gTk9fQ0FDSEUpCisgICAgcmV0dXJuOworICAr K3ctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgIGlmICh3LT5tY19tYXRy aXgudnBvc191c2VkIDwgbWF0cml4LT5ucm93cykKKyAgICB3LT5tY19tYXRyaXgudnBvc191c2Vk ID0gbWF0cml4LT5ucm93czsKKyAgaWYgKHctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZCA8IHct Pm1jX21hdHJpeC52cG9zX3VzZWQpCisgICAgeworICAgICAgaW50IG9sZF9hbGxvYyA9IHctPm1j X21hdHJpeC52cG9zX2FsbG9jYXRlZDsKKyAgICAgIGludCBuZXdfZWx0cyA9IHctPm1jX21hdHJp eC52cG9zX3VzZWQgLSB3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQ7CisgICAgICB3LT5tY19t YXRyaXgudnBvcyA9IHhwYWxsb2MgKHctPm1jX21hdHJpeC52cG9zLCAmdy0+bWNfbWF0cml4LnZw b3NfYWxsb2NhdGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfZWx0 cywgSU5UX01BWCwgc2l6ZW9mICp3LT5tY19tYXRyaXgudnBvcyk7CisgICAgICBtZW1zZXQgKHct Pm1jX21hdHJpeC52cG9zICsgb2xkX2FsbG9jLCAwLAorICAgICAgICAgICAgICAgKHctPm1jX21h dHJpeC52cG9zX2FsbG9jYXRlZCAtIG9sZF9hbGxvYykgKiBzaXplb2YgKnctPm1jX21hdHJpeC52 cG9zKTsKKyAgICB9CisgICsrdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlX3VzZWRbY2FjaGVf dHlwZV07CisgIGlmICh3LT5tY19tYXRyaXgudnBvc1tybl0uY2FjaGVfYWxsb2NhdGVkW2NhY2hl X3R5cGVdIDwgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0pCisg IC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pY2tuZXNzIG9mIE1DX0JBUiBh bmQKKyAgICAgICAgICAgICAgIE1DX0hCQVIgYXMgdG8gYG1jLXJlYWwtZmFrZS1jdXJzb3InLgor ICAgTVVMVElQTEVfQ1VSU09SUzogIFdlIGRvIG5vdCB1c2UgdGhpcyBmdW5jdGlvbi4KKyAgIEhP UklaT05UQUxfUlVMRVI6ICBXZSB3YW50IGEgdW5pdmVyc2FsIEZZIGNvb3JkaW5hdGUgZm9yIGEg bGV2ZWwgcnVsZXIuCisgICBWRVJUSUNBTF9SVUxFUiBhbmQgRklMTF9DT0xVTU46ICBXZSB3YW50 IGFuIEggdGhhdCBlbnN1cmVzIG5vIGdhcCBiZXR3ZWVuIHRoZQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgcHJldmlvdXMvbmV4dCBsaW5lLiAgVGhlIEZYIGNvb3JkaW5hdGUg aXMgc2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNld2hlcmU6ICBg dy0+Y3Vyc29yLnhgIC8gYG1jLmZjX3hgLiAqLwordm9pZAorbWNfZ2V0X2N1cnNvcl9nZW9tZXRy eSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAgICAg ICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgeCwgaW50ICpmeCwg aW50IHksCisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgKmZ5LCBpbnQgaHBvcywgaW50IHZw b3MsIGludCAqaCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUg Y3Vyc29yX3R5cGUsIGludCBjdXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICBp bnQgKndkKQoreworICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gbWNfZ2V0X2N1cnNvcl9nbHlwaCAo dywgbWF0cml4LCByb3csIGhwb3MsIHZwb3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HsKKyAg ICAgIGNhc2UgTUNfQkFSOgorICAgICAgICB7CisgICAgICAgICAgaWYgKGN1cnNvcl93aWR0aCA8 IDEpCisgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSBtYXggKEZSQU1FX0NVUlNPUl9XSURUSCAo ZiksIDEpOworICAgICAgICAgIGlmIChjdXJzb3Jfd2lkdGggPCBnbHlwaC0+cGl4ZWxfd2lkdGgp CisgICAgICAgICAgKndkID0gY3Vyc29yX3dpZHRoOworICAgICAgICAgIGJyZWFrOworICAgICAg ICB9CisgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAgIHsKKyAgICAgICAgICBpbnQgY3Vyc29y X2hlaWdodCA9IChjdXJzb3Jfd2lkdGggPCAxKSA/IGxyaW50ICgwLjI1ICogKmgpIDogY3Vyc29y X3dpZHRoOworICAgICAgICAgIGlmIChjdXJzb3JfaGVpZ2h0ID4gcm93LT5oZWlnaHQpCisgICAg ICAgICAgICBjdXJzb3JfaGVpZ2h0ID0gcm93LT5oZWlnaHQ7CisgICAgICAgICAgLyogQ3Vyc29y IHNtYWxsZXIgdGhhbiBsaW5lIGhlaWdodCwgc28gbW92ZSBkb3duLiAqLworICAgICAgICAgIGlm ICgqaCA+IGN1cnNvcl9oZWlnaHQpCisgICAgICAgICAgICAqZnkgKz0gKmggLSBjdXJzb3JfaGVp Z2h0OworICAgICAgICAgICpoID0gY3Vyc29yX2hlaWdodDsKKyAgICAgICAgICAqd2QgPSBnbHlw aC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2Ug TUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQ OgorICAgICAgY2FzZSBNQ19OT19GUklOR0VfQklUTUFQOgorICAgICAgY2FzZSBNQ19OT19DVVJT T1I6CisgICAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6CisgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6 CisgICAgICBjYXNlIE1DX0hPTExPV19CT1g6CisgICAgICBkZWZhdWx0OgorICAgICAgLyogQ29t cHV0ZSB0aGUgd2lkdGggb2YgdGhlIHJlY3RhbmdsZSB0byBkcmF3LiAgSWYgb24gYSBzdHJldGNo IGdseXBoLCBhbmQKKyAgICAgIGB4LXN0cmV0Y2gtY3Vyc29yJyBpcyBuaWwsIGRvbid0IGRyYXcg YSByZWN0YW5nbGUgYXMgd2lkZSBhcyB0aGUgZ2x5cGgsIGJ1dAorICAgICAgdXNlIGEgY2Fub25p Y2FsIGNoYXJhY3RlciB3aWR0aCBpbnN0ZWFkLiAqLworICAgICAgKndkID0gKGdseXBoLT50eXBl ID09IFNUUkVUQ0hfR0xZUEgKKyAgICAgICAgICAgICAmJiAheF9zdHJldGNoX2N1cnNvcl9wKQor ICAgICAgICAgICAgPyBtaW4gKEZSQU1FX0NPTFVNTl9XSURUSCAoZiksIGdseXBoLT5waXhlbF93 aWR0aCkKKyAgICAgICAgICAgIDogZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgIH0KKy8qCisgICAg ICBmcHJpbnRmIChzdGRlcnIsICJjdXJzb3Jfd2lkdGg6ICglZCkgfCB4ICglZCkgfCAqZnggKCVk KSB8IHkgKCVkKSB8ICpmeSAoJWQpLCAqd2QgKCVkKSB8ICpoICglZClcbiIsCisgICAgICAgICAg ICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgeCwgKmZ4LCB5LCAqZnksICp3ZCwgKmgpOworKi8K K30KKwordm9pZAorbWNfZW5naW5lIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0 cml4ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgc3RydWN0IGds eXBoICpnbHlwaCwgaW50IGFyZWEsIGludCByZWxhdGl2ZV94LCBpbnQgeF9saW1pdCwgaW50IHks CisgICAgICAgICAgIGludCBocG9zLCBpbnQg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09IFpWKTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIExpc3Bf T2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRzOworICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgIHN0cnVj dCBidWZmZXIgKmIgPSBYQlVGRkVSIChidWYpOworICBpbnQgdGV4dF9hcmVhX3dpZHRoID0gd2lu ZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgc3RydWN0IGdseXBoX3JvdyAqY3Vyc29y X3JvdyA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUFUUklYX1JPVyAoY3Vyc29yX21hdHJpeCwgdy0+Y3Vyc29yLnZwb3MpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIHN0cnVjdCBnbHlwaCAqY3Vy c29yX2dseXBoID0gKHctPmN1cnNvci52cG9zICE9IC0xKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgY3Vyc29yX21hdHJpeCwgY3Vyc29y X3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IE5VTEw7CisgIGJvb2wgY3Vyc29yX2F0X2ZyaW5nZV9wID0gKGN1cnNvcl9n bHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3cg IT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9 PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gY3Vyc29yX3Jvdy0+cGl4 ZWxfd2lkdGgpOworICBib29sIGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AgPSAoY3Vyc29yX2dseXBo ID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3cg IT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhw b3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiAhY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gdGV4dF9hcmVh X3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+ PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7CisgIGludCBmcmFtZV9jaGFyX3dpZHRoID0gRlJB TUVfQ09MVU1OX1dJRFRIIChmKTsKKyAgaW50IHRlbXBfZmFjZV9pZCA9IGdseXBoLT5mYWNlX2lk OworICBzdHJ1Y3QgbWNfUkdCIGJhY2tncm91bmQ7CisgIG1jX3NldF9sc2xfYmcgKHcsIHRlbXBf ZmFjZV9pZCwgJmJhY2tncm91bmQpOworICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9IChvcG9p bnRfeCA9PSByZWxhdGl2ZV94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2lu dF9ocG9zID09IGhwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3kg PT0gZ2x5cGgtPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3Mg PT0gdnBvcyk7CisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAg ICAgICAgIEJFR0lOOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAg ICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgaWYgKGdseXBoLT50eXBlID09IENI QVJfR0xZUEgKKyAgICAgIHx8IGdseXBoLT50eXBlID09IEdMWVBITEVTU19HTFlQSCkKKyAgewor ICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIlxu ICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFk ICU1ZCAlNGQgICUzZCAgJTNkICVzICVzXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+ dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAoZ2x5cGgtPnR5 cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgPyAnQycKKyAgICAgICAgIDogJ0cnKSwKKyAgICAg ICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAg ICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAg ICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgICAgICAgZ2x5 cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+dS5jaCwKKyAgICAgICAgZ2x5cGgtPmZh Y2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5y aWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9z LCBnbHlwaC0+dnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgbWNfY2hh cl90b19zdHJpbmcgKGdseXBoLT51LmNoKSk7CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsK Ky8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJT T1JTOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICovCisvKiAt LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAgewor ICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5 LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBj dXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgIGFj dGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25f dHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8q ICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQSExFU1Nf R0xZUEggICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2Fz ZSBIT1JJWk9OVEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChyZWxhdGl2ZV94IDwgcm93LT5w aXhlbF93aWR0aAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1j X2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhw b3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jf d2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgYWN0aXZl X3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBl KTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2Vk W2FyZWFdIC0gMQorICAgICAgICAgICYmIHJlbGF0aXZlX3ggPD0geF9saW1pdCkKKyAgICAgICAg eworICAgICAgICAgIGlmIChyZWxhdGl2ZV94IDwgcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7Cisg ICAgICAgICAgICAgIGZ4ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngs IHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgeF9saW1pdCAtIHJlbGF0 aXZlX3gsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAg ICBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLCBhY3RpdmVfcCwgTUNfR0xZUEhMRVNTLCBkcmF3X3As CisgICAgICAgICAgICAgICAgICAgICBmcm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlw ZSk7CisgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LSAqLworLyogICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQ SExFU1NfR0xZUEggICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K KyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGds eXBoX2ZsYXZvciA9IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9y aWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJ Q0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0 X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ct PnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog KGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSAxCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJU SUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0g cm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dp ZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVT UworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoenZfcCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAoZ2x5cGhfZmxh dm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2Zs YXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8 fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2 b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IE1D X1JJR0hUX0ZSSU5HRV9CSVRNQVA7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcs IG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgb3BvaW50X2Z4LCB5LCBmeSwgaHBvcywg dnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgs IGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBnbHlw aF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOwor ICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAg ICAgICAgIEZJTExfQ09MVU1OOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAg ICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgRklMTF9DT0xV TU46CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGdseXBoIC0g cm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZmNfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoenZfcCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF92cG9zID09IHZwb3MpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgd2QgPSAxOworICAgICAgbWNf aGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwg aHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jf d2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgIGFjdGl2ZV9w LCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwgYWN0aW9uX3R5 cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAg Y2FzZSBDVVJTT1JfSU5ESUNBVE9SOgorICAgIHsKKyAgICAgIGJyZWFrOworICAgIH0K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KKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAw IDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdT JywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2Jq ZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3Qp CisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkK KyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAg Z2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAwdSwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQs CisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9i b3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9zLCBnbHlw aC0+dnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgIlxcUyIpOworICBz d2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAg ICAgICAgICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUzogIFNUUkVUQ0hfR0xZUEggICAg ICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBN VUxUSVBMRV9DVVJTT1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HJhd19wLCBmcm9tX3doZXJl LCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2 ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAocmVsYXRpdmVfeCA8IHJv dy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93 aWR0aDsKKyAgICAgICAgICB0ZW1wX2ZhY2VfaWQgPSAocm93LT5maWxsX2xpbmVfcCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICA/IGdseXBoLT5mYWNlX2lkCisgICAgICAgICAgICAgICAgICAg ICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBiYWNrZ3Jv dW5kOworICAgICAgICAgIG1jX3NldF9sc2xfYmcgKHcsIHRlbXBfZmFjZV9pZCwgJmJhY2tncm91 bmQpOworICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2 ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICB4X2xpbWl0 IC0gcmVsYXRpdmVfeCwgaCwgY3Vyc29yX3R5cGUsIHhfbGltaXQgLSByZWxhdGl2ZV94LAorICAg ICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwgYWN0aXZlX3AsIE1DX0dM WVBITEVTUywgZHJhd19wLAorICAgICAgICAgICAgICAgICAgICAgZnJvbV93aGVyZSwgY2FjaGVf dHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAt LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNB TF9SVUxFUjogIFNUUkVUQ0hfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBp ZiAocm93LT5maWxsX2xpbmVfcAorICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVY VF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgb3BvaW50X3ggPiBy ZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICB0ZW1wX2ZhY2VfaWQgPSBn bHlwaC0+ZmFjZV9pZDsKKyAgICAgICAgZWxzZSBpZiAoIXJvdy0+ZmlsbF9saW5lX3AKKyAgICAg ICAgICAgICAgICAgJiYgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNl ZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsg Z2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAgIHRlbXBfZmFjZV9pZCA9IERFRkFVTFRfRkFD RV9JRDsKKyAgICAgIHN0cnVjdCBtY19SR0IgYmFja2dyb3VuZDsKKyAgICAgIG1jX3NldF9sc2xf YmcgKHcsIHRlbXBfZmFjZV9pZCwgJmJhY2tncm91bmQpOworICAgICAgZW51bSBtY19mbGF2b3Ig Z2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29u X3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVS VElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3Jf YXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJv dy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJ Q0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAg ICAgICAgICAg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S0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICBGSUxMX0NPTFVNTjog IFNUUkVUQ0hfR0xZUEggICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0gKi8KKyAgICBjYXNlIEZJTExfQ09MVU1OOgorICAgIHsKKyAgICAgIGlmIChyb3ctPmZp bGxfbGluZV9wCisgICAgICAgICAgJiYgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09 IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiBmY194ID4gcmVsYXRpdmVfeCArIGds eXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgdGVtcF9mYWNlX2lkID0gZ2x5cGgtPmZhY2VfaWQ7 CisgICAgICAgIGVsc2UgaWYgKCFyb3ctPmZpbGxfbGluZV9wCisgICAgICAgICAgICAgICAgICYm IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisg ICAgICAgICAgICAgICAgICYmIGZjX3ggPiByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRo KQorICAgICAgICAgIHRlbXBfZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgIHN0cnVj dCBtY19SR0IgYmFja2dyb3VuZDsKKyAgICAgIG1jX3NldF9sc2xfYmcgKHcsIHRlbXBfZmFjZV9p ZCwgJmJhY2tncm91bmQpOworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gTUNf R0xZUEhMRVNTOworICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJv dywgZ2x5cGgsIGZjX3gsIGZjX2Z4LCB5LCB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gICAg ICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICBlbHNlIGlm IChnbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkK KyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMg JTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVz ICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAg ICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAg ICAgICByZWxhdGl2ZV94LAorICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAor ICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAg ICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAg ICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICA/ICcwJworICAgICAg ICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAg KHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuaW1nX2lkLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwK KyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2Jv eF9saW5lX3AsCisgICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPm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AlYyAlM2Qg MHglMDZ4IiwKKyAgICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAg ICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSks CisgICAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgICAnKycsCisgICAgICAgICAgZ2x5cGgt PmNoYXJwb3MsCisgICAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAg ID8gJ0InCisgICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAg ICAgID8gJ1MnCisgICAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICAgIGds eXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5jbXAu aWQpOworICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAg ICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisg ICAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3ApOworICAgICAgaWYgKGdseXBoLT51LmNt cC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAlNWQgJTRkICAlM2QgICUz ZCAlcyAuIFslZC0lZF1cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPngsIGds eXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICIt LSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPnNsaWNlLmNtcC5mcm9tLCBnbHlw aC0+c2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tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBIT1JJWk9O VEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChyZWxhdGl2ZV94IDw9IHhfbGltaXQKKyAgICAg ICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJp eCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAg ICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5k LCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJh d19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAoZ2x5 cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAg ICAgICAmJiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICByZWxh dGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICB3aGlsZSAocmVsYXRpdmVf eCA8PSB4X2xpbWl0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19oZWxwZXIgKHcs IG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAor ICAgICAgICAgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRo LCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2 ZV9wLCBNQ19HTFlQSExFU1MsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICBhY3Rpb25fdHlwZSk7CisgICAgICAgICAgICAgIHJlbGF0aXZl X3ggKz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAg YnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAg ICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAg ICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVM RVI6CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9h dF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+ Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNf VkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3Ap CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJz b3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2Vf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+ dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFd ID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6ICh6dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZF UlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19W RVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZF UlRJQ0FMX0JBUgorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJU SUNBTF9CQVIpCisgICAgICAgIGN1cnNvcl90eXBlID0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUDsK KyAgICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCBy ZWxhdGl2ZV94LCBvcG9pbnRfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAg ICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3Vu ZCwKKyAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9t X3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9Cisv KiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICBGSUxM X0NPTFVNTjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7CisgICAgICBl bnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBmY194ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKHp2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g TUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICghTklM UCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92ZXJ0aWNh bF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9p bnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9p bnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiB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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyog ICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgWFdJREdFVF9HTFlQSCAgICAgICAg ICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgZWxzZSBp ZiAoZ2x5cGgtPnR5cGUgPT0gWFdJREdFVF9HTFlQSCkKKyAgeworI2lmbmRlZiBIQVZFX1hXSURH RVRTCisgICAgZWFzc3VtZSAoZmFsc2UpOworI2Vsc2UKKyAgICBpZiAobWNfc3RkZXJyX3ApCisg ICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICJcbiAgJTVkLyUtNWQgJTVkICU0YyAlNmQg JWMgJTNkIDB4JTA1eCAlNGQgJTEuMWQlMS4xZCAlNWQgJTRkICAlM2QgICUzZCAlcyAlY1xuIiwK KyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+ dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVs YXRpdmVfeCwKKyAgICAgICAgJ1gnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAg KEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RS SU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6ICct JykpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBoLT5mYWNlX2lk LAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaH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1JJWk9OVEFMX1JVTEVSOiAgWFdJREdFVF9HTFlQ SCAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBj YXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAgaWYgKHJlbGF0aXZlX3ggPD0geF9s aW1pdAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBl ciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZw b3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgs IGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIE1D X0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAg ICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFd IC0gMQorICAgICAgICAgICYmIHJlbGF0aXZlX3ggPD0geF9saW1pdCkKKyAgICAgICAgeworICAg ICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgIHdoaWxl IChyZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG1j X2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhw b3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBj dXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAg ICAgICAgYWN0aXZlX3AsIE1DX0dMWVBITEVTUywgZHJhd19wLCBmcm9tX3doZXJlLCBjYWNoZV90 eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGlvbl90eXBlKTsKKyAgICAgICAgICAg ICAgcmVsYXRpdmVfeCArPSBmcmFtZV9jaGFyX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAg ICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAg ICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIFhXSURHRVRfR0xZUEggICAg ICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBW RVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3Ig PSAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRf b25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hU X0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5 b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBj dXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0gIT0gMQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHp2X3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNf UkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxh dm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2 b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JF VkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgY3Vyc29yX3R5cGUgPSBNQ19SSUdIVF9GUklO R0VfQklUTUFQOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0 aXZlX3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdk LCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAor ICAgICAgICAgICAgICAgICBhY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3AsIGZyb21fd2hl cmUsIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICBGSUxMX0NP TFVNTjogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEZJTExfQ09MVU1OOgorICAgIHsKKyAgICAgIGVudW0g bWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0g PT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIGZjX3ggPiByZWxhdGl2ZV94KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19H TFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChC VkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX3ZlcnRpY2FsX3J1 bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF95 ID09IHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF92 cG9zID09IHZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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ZHJhd19yb3cgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBn bHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAg IHN0cnVjdCBnbHlwaCAqc3RhcnQsIGludCB4LCBpbnQgaHBvc19sZW5ndGgsIGludCB2cG9zLAor ICAgICAgICAgICAgIGludCBib3R0b21fdnBvcywgc3RydWN0IGdseXBoX21hdHJpeCAqY3Vyc29y X21hdHJpeCwKKyAgICAgICAgICAgICAgc3RydWN0IG1jX2Vzc2VudGlhbHMgZXNzZW50aWFscywg Ym9vbCBkcmF3X3AsIGVudW0gbWNfZnJvbV93aGVyZSBmcm9tX3doZXJlKQoreworICAvLyAgY2xv Y2tfdCBjbG9ja19zdGFydCA9IGNsb2NrKCk7CisgIC8qIE5UIEVtYWNzIGNyYXNoZXMgb24gc3Rh cnR1cCB3aXRob3V0IGEgYEJVRkZFUlAnIGNoZWNrIGluIGB1cGRhdGVfd2luZG93Jy4gKi8KKyAg Ym9vbCBkZWJ1Z19wID0gZmFsc2U7CisgIGlmICghQlVGRkVSUCAody0+Y29udGVudHMpKQorICAg IHJldHVybjsKKyAgaWYgKE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29u ZikpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFp cnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNp YmxlKSkpCisgICAgcmV0dXJuOworICBpZiAodnBvcyA9PSBib3R0b21fdnBvcykKKyAgICByZXR1 cm47CisgIGlmICghcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgcmV0dXJuOworICBpbnQgaHBv c19zdGFydCA9IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgaWYgKHRyYWNlX3Jl ZGlzcGxheV9wKQorICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2RyYXdfcm93ICglZCk6ICBkcmF3 X3AgKCVzKSB8IGhwb3MgKCVkKSB8IGxlbiAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAg dnBvcywgZHJhd19wID8gInkiIDogIm4iLCBocG9zX3N0YXJ0LCBocG9zX2xlbmd0aCk7CisgIExp c3BfT2JqZWN0IHdpbmRvdzsKKyAgWFNFVFdJTkRPVyAod2luZG93LCB3KTsKKyAgc3RydWN0IGZy YW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIExpc3BfT2JqZWN0IGJ1ZiA9IHctPmNvbnRl bnRzOworICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVS IChidWYpOworICBpbnQgb3BvaW50X2Z4LCBvcG9pbnRfZnksIG9wb2ludF93ZCwgb3BvaW50X2g7 CisgIGludCB0ZXh0X2FyZWFfd2lkdGggPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEp OworICBpbnQgaGVhZGVyX2xpbmVfZm9ybWF0ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAo dyk7CisgIC8qIERlZmluaXRpb24gb2YgYHByZXZfcm93YCBpcyB1c2VmdWwgd2hlbiBnZGIgZGVi dWdnaW5nOiAgcHJpbnQgKnByZXZfcm93ICovCisgIHN0cnVjdCBnbHlwaF9yb3cgKnByZXZfcm93 ID0gcm93IC0gMTsKKyAgaW50IHByZXZfbWF0cml4X3Jvd19zdGFydF9ieXRlcG9zID0gKHZwb3Mg IT0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9X X1NUQVJUX0JZVEVQT1MgKHJvdyAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogLTE7CisgIGludCBwcmV2X21hdHJpeF9yb3dfZW5kX2J5dGVwb3MgPSAodnBvcyAh PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VO RF9CWVRFUE9TIChyb3cgLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAtMTsKKyAgaW50IHByZXZfbWF0cml4X3Jvd19zdGFydF9jaGFycG9zID0gKHZwb3MgIT0gMCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX1NUQVJU X0NIQVJQT1MgKHJvdyAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogLTE7CisgIGludCBwcmV2X21hdHJpeF9yb3dfZW5kX2NoYXJwb3MgPSAodnBvcyAhPSAwKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VORF9DSEFS UE9TIChyb3cgLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAtMTsK KyAgaW50IG1hdHJpeF9yb3dfc3RhcnRfYnl0ZXBvcyA9IE1BVFJJWF9ST1dfU1RBUlRfQllURVBP UyAocm93KTsKKyAgaW50IG1hdHJpeF9yb3dfZW5kX2J5dGVwb3MgPSBNQVRSSVhfUk9XX0VORF9C WVRFUE9TIChyb3cpOworICBpbnQgbWF0cml4X3Jvd19zdGFydF9jaGFycG9zID0gTUFUUklYX1JP V19TVEFSVF9DSEFSUE9TIChyb3cpOworICBpbnQgbWF0cml4X3Jvd19lbmRfY2hhcnBvcyA9IE1B VFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdyk7CisgIC8qIFdoZW4gdGhlcmUgYXJlIG5vIG5hdGl2 ZSBsaW5lIG51bWJlcnMsIGEgcm93IGNvbnRhaW5pbmcgX29ubHlfIFpWIG9yIHJvd3MKKyAgX2Jl eW9uZF8gWlYgd2lsbCBoYXZlIGV4YWN0bHkgb25lIHNwYWNlIHJvdyBlbmQgZ2x5cGggd2l0aCBh IGNoYXJwb3Mgb2YgLTEuCisgIEEgcHJldmlvdXMgcm93IGRvZXMgbm90IGV4aXN0IGlmIFZQT1Mg PT0gMC4gKi8KKyAgc3RydWN0IGdseXBoICpwcmV2X3Jvd19fcGVudWx0aW1hdGVfZ2x5cGgKKyAg ICA9ICh2cG9zID09IDApCisgICAgICAgID8gTlVMTAorICAgICAgOiAoIShyb3cgLSAxKS0+ZW5h YmxlZF9wKQorICAgICAgICA/IE5VTEwKKyAgICAgIDogKChyb3cgLSAxKS0+dXNlZFtURVhUX0FS RUFdID09IDApCisgICAgICAgID8gTlVMTAorICAgICAgOiAoKHJvdyAtIDEpLT51c2VkW1RFWFRf QVJFQV0gPiAxKQorICAgICAgICA/IChyb3cgLSAxKS0+Z2x5cGhzW1RFWFRfQVJFQV0gKyAocm93 IC0gMSktPnVzZWRbVEVYVF9BUkVBXSAtIDIKKyAgICAgIDogTlVMTDsKKyAgaW50IHByZXZfcm93 X19wZW51bHRpbWF0ZV9nbHlwaF9jaGFycG9zID0gKHByZXZfcm93X19wZW51bHRpbWF0ZV9nbHlw aCAhPSBOVUxMKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IHByZXZfcm93X19wZW51bHRpbWF0ZV9nbHlwaC0+Y2hhcnBvcworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IC0xOworICBzdHJ1Y3QgZ2x5cGggKnByZXZfcm93 X19sYXN0X2dseXBoCisgICAgPSAodnBvcyA9PSAwKQorICAgICAgICA/IE5VTEwKKyAgICAgIDog KCEocm93IC0gMSktPmVuYWJsZWRfcCkKKyAgICAgICAgPyBOVUxMCisgICAgICA6ICgocm93IC0g MSktPnVzZWRbVEVYVF9BUkVBXSA9PSAwKQorICAgICAgICA/IE5VTEwKKyAgICAgIDogKHJvdyAt IDEpLT5nbHlwaHNbVEVYVF9BUkVBXSArIChyb3cgLSAxKS0+dXNlZFtURVhUX0FSRUFdIC0gMTsK KyAgaW50IHByZXZfcm93X19sYXN0X2dseXBoX2NoYXJwb3MgPSAocHJldl9yb3dfX2xhc3RfZ2x5 cGggIT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHByZXZf cm93X19sYXN0X2dseXBoLT5jaGFycG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAtMTsKKyAgLyogV2hlbiB0aGVyZSBhcmUgbm8gbmF0aXZlIGxpbmUgbnVtYmVycywg YSByb3cgY29udGFpbmluZyBfb25seV8gWlYgb3Igcm93cworICBfYmV5b25kXyBaViB3aWxsIGhh dmUgZXhhY3RseSBvbmUgc3BhY2Ugcm93IGVuZCBnbHlwaCB3aXRoIGEgY2hhcnBvcyBvZiAtMS4K KyAgQSBwcmV2aW91cyByb3cgZG9lcyBub3QgZXhpc3QgaWYgVlBPUyA9PSAwLiAqLworICBzdHJ1 Y3QgZ2x5cGggKnBlbnVsdGltYXRlX2dseXBoCisgICAgPSAocm93LT51c2VkW1RFWFRfQVJFQV0g PCAxKQorICAgICAgPyByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJF QV0gLSAyCisgICAgICA6IE5VTEw7CisgIGludCBwZW51bHRpbWF0ZV9nbHlwaF9jaGFycG9zID0g KHBlbnVsdGltYXRlX2dseXBoICE9IE5VTEwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBwZW51bHRpbWF0ZV9nbHlwaC0+Y2hhcnBvcworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogLTE7CisgIHN0cnVjdCBnbHlwaCAqbGFzdF9nbHlwaAorICAgID0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgaW50IGxh c3RfZ2x5cGhfY2hhcnBvcyA9IChsYXN0X2dseXBoICE9IE5VTEwpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IGxhc3RfZ2x5cGgtPmNoYXJwb3MKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogLTE7CisgIC8qIFRoaXMgdGVzdHMgZm9yIGEgc29saXRhcnkgcm93IGNvbnRhaW5pbmcg WlYsIHByZWNlZGVkIGJ5IGEgcm93IGNvbnRhaW5pbmcgYQorICBwZW51bHRpbWF0ZSBnbHlwaCB3 aXRoIGEgY2hhcnBvcyBvZiBaViAtIDEgZm9sbG93ZWQgYnkgYW4gZW5kIG9mIHJvdyBzcGFjZQor ICBnbHlwaCB3aXRoIGEgY2hhcnBvcyBvZiAwLiAqLworICBib29sIHJvd19hdF96dl9wID0gKHZw b3MgIT0gMAorICAgICAgICAgICAgICAgICAgICAgICYmIChyb3cgLSAxKS0+dXNlZFtURVhUX0FS RUFdID4gMAorICAgICAgICAgICAgICAgICAgICAgICYmIHByZXZfbWF0cml4X3Jvd19zdGFydF9i eXRlcG9zICE9IHByZXZfbWF0cml4X3Jvd19lbmRfYnl0ZXBvcworICAgICAgICAgICAgICAgICAg ICAgICYmICEocm93IC0gMSktPmVuZHNfYXRfenZfcAorICAgICAgICAgICAgICAgICAgICAgICYm IG1hdHJpeF9yb3dfc3RhcnRfYnl0ZXBvcyA9PSBtYXRyaXhfcm93X2VuZF9ieXRlcG9zCisgICAg ICAgICAgICAgICAgICAgICAgJiYgcm93LT5lbmRzX2F0X3p2X3ApOworICAvKiBJZiBsaW5lLW51 bWJlcnMgYXJlIGFjdGl2ZSwgdGhlbiBzcGFjZSBnbHlwaCBwYWRkaW5nIGVxdWFsIHRvIGl0cyB3 aWR0aAorICBjb3VudGVkIGluIEhQT1MgYXJlIGZvbGxvd2VkIGJ5IGEgc2luZ2xlIHJvdyBlbmQg c3BhY2UgZ2x5cGguICBMaW5lIG51bWJlcgorICBwYWRkaW5nIHNwYWNlIGdseXBocyBoYXZlIGEg Y2hhcnBvcyBvZiAtMSwgd2hlcmVhcyB0aGUgZW5kIG9mIHJvdyBzcGFjZSBnbHlwaAorICBoYXMg YSBjaGFycG9zIG9mIDAuICBJZiBsaW5lIG51bWJlcnMgYXJlIGluYWN0aXZlLCB0aGVuIHRoZSBy b3cgd2lsbCBjb250YWluCisgIGEgc29saXRhcnkgc3BhY2UgZ2x5cGggd2l0aCBhIGNoYXJwb3Mg b2YgLTEuICovCisgIGJvb2wgcm93X2JleW9uZF96dl9wID0gKG1hdHJpeF9yb3dfc3RhcnRfYnl0 ZXBvcyA9PSBtYXRyaXhfcm93X2VuZF9ieXRlcG9zKTsKKyAgc3RydWN0IGdseXBoX3JvdyAqY3Vy c29yX3JvdyA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gTUFUUklYX1JPVyAoY3Vyc29yX21hdHJpeCwgdy0+Y3Vyc29yLnZwb3MpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIHN0cnVjdCBnbHlwaCAq Y3Vyc29yX2dseXBoID0gKHctPmN1cnNvci52cG9zICE9IC0xKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgY3Vyc29yX21hdHJpeCwgY3Vy c29yX3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IE5VTEw7CisgIGJvb2wgY3Vyc29yX2F0X2ZyaW5nZV9wID0gKGN1cnNv cl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9y b3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBv cyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSB0ZXh0X2FyZWFfd2lkdGgKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gY3Vyc29yX3Jvdy0+ cGl4ZWxfd2lkdGgpOworICBib29sIGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AgPSAoY3Vyc29yX2ds eXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9y b3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29y Lmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiAhY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gdGV4dF9h cmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3Iu eCA+PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7CisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioK KyAgICAgICAgICAgICAgICAgICAgICAgICAgUkVQTEFDRSBUSEUgUkVBTCBDVVJTT1IKKyoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworICBlbnVtIGZhY2VfaWQgYmdfZmFjZV9pZCA9IChjdXJzb3Jf Z2x5cGggIT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGN1cnNvcl9nbHlw aC0+ZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lE OworICBzdHJ1Y3QgbWNfUkdCIGN1cnNvcl9iZzsKKyAgbWNfc2V0X2xzbF9iZyAodywgYmdfZmFj ZV9pZCwgJmN1cnNvcl9iZyk7CisgIC8qIEZJWE1FOiAgUHV0IGluIHNvbWUgY29kZSB0byBkZWZh dWx0IHRvIE1DX0hPTExPV19CT1ggaWYgdGhlIHVzZXIgaGFzCisgIHVud2l0dGluZ2x5IGNvbWUg dXAgd2l0aCBzb21lIHVuYWNjZXB0YWJsZSBmb3JtIG9mIHVucmVjb2duaXplZCBjdXJzb3IgdHlw ZS4gKi8KKyAgTGlzcF9PYmplY3QgbGlzcF90eXBlID0gQlZBUiAoYiwgbWNfcmVhbF9mYWtlX2N1 cnNvcik7CisgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUgPSAoQ09OU1AgKGxpc3Bf dHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNw X3RvX2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogbWNfbGlzcF90b19jdXJzb3JfdHlwZSAobGlzcF90eXBlKTsK KyAgaW50IGN1cnNvcl93aWR0aCA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAg ICAgICAgID8gWEZJWE5VTSAoWENBUiAoWENEUiAobGlzcF90eXBlKSkpCisgICAgICAgICAgICAg ICAgICAgICA6IC0xOworICBlbnVtIGZhY2VfaWQgY3Vyc29yX2ZhY2VfaWQgPQorICAgICghZXNz ZW50aWFscy5hY3RpdmVfcAorICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29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JHQiBsc2xfZmcgPSB7LnJlZCA9IC0xLjAsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSAtMS4wLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgLmJsdWUgPSAtMS4wfTsKKyAgICAgIC8qIFdlIHVzZSB0aGUgZmly c3QgZ2x5cGggaW4gdGhlIHJvdywgd2l0aCBhbiBYIGFuZCBIUE9TIG9mIHplcm8uICovCisgICAg ICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCByb3ctPmdseXBoc1tURVhUX0FSRUFdLCAwLCAt MSwgdy0+Y3Vyc29yLnksIC0xLAorICAgICAgICAgICAgICAgICAwLCB3LT5jdXJzb3IudnBvcywg LTEsIC0xLCBNQ19MRUZUX0ZSSU5HRV9CSVRNQVAsIC0xLAorICAgICAgICAgICAgICAgICBsc2xf ZmcsIGN1cnNvcl9iZywgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfT1ZFUkxBWV9BUlJPV19CSVRN QVAsIGRyYXdfcCwKKyAgICAgICAgICAgICAgICAgZnJvbV93aGVyZSwgQ0hfQ0FDSEUsIENVUlNP Ul9JTkRJQ0FUT1IpOworICAgIH0KKyAgaWYgKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgJiYg dnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPj0gaHBvc19z dGFydAorICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gaHBvc19zdGFydCArIGhwb3NfbGVuZ3Ro CisgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJz KSkKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2hvcml6 b250YWxfcnVsZXIpKSkKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3Ig PSBNQ19IT0x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RydWN0IGdseXBoICpnbHlw aCA9IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2Vu ZCA9IGdseXBoICsgcm93LT51c2VkW1RFWFRfQVJFQV07CisgICAgICAvKiBHbHlwaCBmb3IgYSBs aW5lIGVuZCBpbiB0ZXh0LiAqLworICAgICAgaWYgKGdseXBoID09IGdseXBoX2VuZCAmJiBnbHlw aC0+Y2hhcnBvcyA+IDApCisgICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgbWNfaGVscGVyICh3 LCBtYXRyaXgsIHJvdywgZ2x5cGhfZW5kIC0gMSwgcm93LT5waXhlbF93aWR0aCwgLTEsIHctPmN1 cnNvci55LAorICAgICAgICAgICAgICAgICAtMSwgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxLCB3 LT5jdXJzb3IudnBvcywgLTEsIC0xLAorICAgICAgICAgICAgICAgICBNQ19SSUdIVF9GUklOR0Vf QklUTUFQLCAtMSwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsCisg ICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLCBDSF9DQUNI RSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQorICAvKiBFWEFNUExFIChidWZmZXItbG9jYWwp OiAgKHNldHEgbWMtcmVhbC1mYWtlLWN1cnNvciBuaWwvJ25vLyJubyIpICovCisgIGVsc2UgaWYg KCFjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoICE9IE5VTEwK KyAgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfTk9fQ1VSU09SCisgICAgICAgICAgICYm IHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPj0g aHBvc19zdGFydAorICAgICAgICAgICAmJ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NvbnRl bnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBD SF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUs IENVUlNPUl9JTkRJQ0FUT1IpOworICAgICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0 cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJz b3IudnBvcywgJm9wb2ludF9oLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUNfSEJB UiwgMSwgJm9wb2ludF93ZCk7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJz b3JfZ2x5cGgsIHctPmN1cnNvci54LCBvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAg ICAgICAgICBvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50 X3dkLCBvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAgTUNfSEJBUiwgMSwgY3Vyc29yX2ZnLCBj dXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsCisgICAgICAg ICAgICAgICAgIGZyb21fd2hlcmUsIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg bWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7Cisg ICAgfQorICBlbHNlIGlmICghY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICYmIGN1cnNv cl9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MKKyAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAmJiB3 LT5jdXJzb3IuaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAmJiBj dXJzb3JfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBtY19nZXRf Y3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngs IHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9meSwg dy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAmb3BvaW50X3dkKTsK KyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29y LngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwg dy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAg ICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBjdXJzb3JfZmcsIGN1cnNv cl9iZywgZXNzZW50aWFscy5hY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgTUNfR0xZUEgsIGRy YXdfcCwgZnJvbV93aGVyZSwgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19j b25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBD SF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgICB9CisgIGVsc2UgaWYgKCFjdXJzb3Jf YXRfZnJpbmdlX3AKKyAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoICE9IE5VTEwKKyAgICAgICAg ICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBv cyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zIDwgaHBvc19zdGFy dCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+dHlwZSA9PSBTVFJF VENIX0dMWVBIKQorICAgIHsKKyAgICAgIC8qIElmIGEgdXNlciBoYXMgc2V0IGB4LXN0cmV0Y2gt Y3Vyc29yJyB0byBhIG5vbi1uaWwgdmFsdWUsIGhlL3NoZSBjaG9zZSB0bworICAgICAgaGF2ZSBh IGN1cnNvciB0aGF0IHNwYW5zIHRoZSBlbnRpcmUgbGVuZ3RoIG9mIHRoZSBTVFJFVENIX0dMWVBI LiAqLworICAgICAgaWYgKCF4X3N0cmV0Y2hfY3Vyc29yX3ApCisgICAgICAgIHsKKyAgICAgICAg ICAvKiBUaGUgTUNfSEJBUiBzaGFsbCBoYXZlIGEgYGN1cnNvcl93aWR0aGAgb2YgMS4gKi8KKyAg ICAgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29y LngsICZvcG9pbnRfZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vy c29yLnksICZvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsIE1DX0hCQVIsIDEsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF93ZCk7CisgICAgICAgICAgbWNf aGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50 X2Z4LAorICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnksIG9wb2ludF9meSwgdy0+Y3Vy c29yLmhwb3MsIHctPmN1cnNvci52cG9zLAorICAgICAgICAgICAgICAgICAgICAgb3BvaW50X3dk LCBvcG9pbnRfaCwgTUNfSEJBUiwgMSwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsCisgICAgICAgICAg ICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3do ZXJlLAorICAgICAgICAgICAgICAgICAgICAgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAg ICAgICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOworICAgICAgICB9Cisg ICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngs ICZvcG9pbnRfZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IueSwg Jm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgJm9wb2ludF93ZCk7CisgICAgICBtY19oZWxw ZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54LCBvcG9pbnRfZngs IHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHctPmN1cnNvci5ocG9z LCB3LT5jdXJzb3IudnBvcywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAg Y3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlh bHMuYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hl cmUsIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VS U09SX0lORElDQVRPUik7CisgICAgfQorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAg ICAgICAgICAgICAgICAgICAgIERSQVcgQU5EIFJFQ09SRCBGQUtFIENVUlNPUlMKKyoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworICBpZiAoaHBvc19sZW5ndGggPT0gMSkKKyAgICB7CisgICAgICBp ZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgICAg ICB7CisgICAgICAgICAgLyogVGhlIHNwYWNlIGFwcGVuZGVkIHRvIGEgcm93IGVuZGluZyB3aXRo IGEgbmV3IGxpbmUKKyAgICAgICAgICBkb2VzIG5vdCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAo LTEsIDApIHRoYXQgd2UgY2FuCisgICAgICAgICAgdXNlIGZvciB0aGlzIHBhcnRpY3VsYXIgYXBw bGljYXRpb24uICBXaGVuIHRoZXJlIGlzIGEKKyAgICAgICAgICBgYnVmZmVyLWRpc3BsYXktdGFi bGUnIGVudHJ5IHRoYXQgYXNzaWducyBhIHZpc2libGUKKyAgICAgICAgICBnbHlwaCB0byBhIG5l dyBsaW5lLCB0aGVyZSBpcyBubyBwcm9ibGVtIGJlY2F1c2UgdGhhdAorICAgICAgICAgIGdseXBo IGhhcyBhIGBnbHlwaC0+Y2hhcnBvcycgdGhhdCB3ZSBjYW4gdXNlLiAgV2hlbgorICAgICAgICAg IG5vIHZpc2libGUgRU9MIGdseXBoIGV4aXN0cywgd2UgdXNlIHRoZSBmb2xsb3dpbmcKKyAgICAg ICAgICB0ZXN0OiAgdGhlIGFwcGVuZGVkIHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMgb25l CisgICAgICAgICAgbGVzcyB0aGFuIHRoZSBlbmQgb2YgdGhlIG1hdHJpeCByb3cuICovCisgICAg ICAgICAgaW50IGhwb3MgPSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAg ICAgc3RydWN0IGdseXBoICpwcmV2aW91c19nbHlwaCA9ICgwIDw9IGhwb3MgLSAxICYmIGhwb3Mg LSAxIDwgcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgICAgICAgICAvLyBz dHJ1Y3QgZ2x5cGggKmxhc3RfZ2x5cGggPSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51 c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgICAgIGJvb2wgc2tpcF9wID0gKHByZXZpb3VzX2ds eXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+ Y2hhcnBvcyA9PSBtYXRyaXhfcm93X2VuZF9jaGFycG9zIC0gMQorICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHN0YXJ0LT5ieXRlcG9zICE9IGVzc2VudGlhbHMuenZfYnl0ZSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAvKiBXaGVu IGEgYGJ1ZmZlci1kaXNwbGF5LXRhYmxlJyBlbnRyeSBjb250YWlucworICAgICAgICAgICAgICAg ICAgICAgICAgYSB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIgKCLCuyIpLCB0aGUgc3Vic2VxdWVudAor ICAgICAgICAgICAgICAgICAgICAgICAgU1RSRVRDSF9HTFlQSCB3aWxsIGhhdmUgdGhlIHNhbWUg c3RhcnQtPmNoYXJwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgIGFzIHRoZSBhZm9yZW1lbnRp b25lZCB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIuICovCisgICAgICAgICAgICAgICAgICAgICAgICA6 IChwcmV2aW91c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBw cmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9PSBzdGFydC0+Y2hhcnBvcykKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICA6IGZhbHNlOworICAg ICAgICAgIGludCBwb3NpbnQgPSAocm93X2JleW9uZF96dl9wCisgICAgICAgICAgICAgICAgICAg ICAgICAmJiAhcm93X2F0X3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgPyAtMQorICAg ICAgICAgICAgICAgICAgICAgICA6IChyb3dfYXRfenZfcCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAgICAgICAgICAgICAgIDogKHN0YXJ0LT5i eXRlcG9zICE9IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0g LSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgID8gbWF0cml4X3Jvd19lbmRfY2hhcnBvcyAt IDEKKyAgICAgICAgICAgICAgICAgICAgICAgOiAoc3RhcnQtPmJ5dGVwb3MgPT0gZXNzZW50aWFs cy56dl9ieXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHN0YXJ0IC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpCisgICAgICAgICAgICAg ICAgICAgICAgICAgPyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAgICAgICAgICAgICAgIDogc3Rh cnQtPmNoYXJwb3M7CisgICAgICAgICAgTGlzcF9PYmplY3Qgc3BlY3MgPSBtY19hc3NvYyAobWFr ZV9maXhudW0gKHBvc2ludCksIEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikp OworICBpbnQgc3RhcnRfY2hhcnBvcyA9IHN0YXJ0LT5jaGFycG9zOworICBpZiAoZGVidWdfcCkK KyAgICBmcHJpbnRmIChzdGRlcnIsICJcbkEuICB2cG9zICglZCkgfCBnbHlwaC0+Y2hhcnBvcyAo JWQpIHwgcG9zaW50ICglZCkgfCB6diAoJWQpIHwgenZfYnl0ZSAoJWQpXG5cCisgIHJvdyAtIDE6 ICBwZW51bHRpbWF0ZV9jaGFycG9zICglZCkgfCBsYXN0X2NoYXJwb3MgKCVkKSB8IGVuZHNfYXRf enZfcCAoJXMpXG5cCisgIHJvdyAtIDE6ICBzdGFydC9lbmRfYnl0ZXBvcyAoJWQvJWQpIHwgc3Rh cnQvZW5kX2NoYXJwb3MgKCVkLyVkK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AgICAgICAg ICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgJiYgIU5JTFAgKHNw ZWNzKQorICAgICAgICAgICAgICAmJiBzdGFydC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAo dykKKyAgICAgICAgICAgICAgJiYgIXNraXBfcAorICAgICAgICAgICAgICAmJiAocm93X2F0X3p2 X3AgfHwgIXJvd19iZXlvbmRfenZfcCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIExp c3BfT2JqZWN0IGxpc3BfdHlwZSA9IG1jX250aCAoMSwgc3BlY3MpOworICAgICAgICAgICAgICBl bnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNwX3Rv X2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNwX3R5 cGUpOworICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IChzdGFydC0+dHlwZSA9PSBJTUFHRV9H TFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0hPTExPV19CT1gKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IGN1cnNvcl90eXBlOworICAgICAgICAgICAgICBpbnQg Y3Vyc29yX3dpZHRoID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBYRklYTlVNIChYQ0FSIChYQ0RSIChsaXNwX3R5cGUpKSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogLTE7CisgICAgICAgICAgICAgIExpc3BfT2JqZWN0 IG1jX2ZvcmVncm91bmQgPSBtY19udGggKDIsIHNwZWNzKTsKKyAgICAgICAgICAgICAgc3RydWN0 IG1jX1JHQiBmb3JlZ3JvdW5kOworICAgICAgICAgICAgICBpZiAoU1RSSU5HUCAobWNfZm9yZWdy b3VuZCkpCisgICAgICAgICAgICAgICAgbWNfeHdfY29sb3JfdmFsdWVzICh3LCBtY19mb3JlZ3Jv dW5kLCAmZm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoVkVDVE9SUCAobWNf Zm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGZv cmVncm91bmQucmVkID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDApKTsKKyAg ICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZC5ncmVlbiA9IFhGTE9BVF9EQVRBIChBUkVGICht Y19mb3JlZ3JvdW5kLCAxKSk7CisgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQuYmx1ZSA9 IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAyKSk7CisgICAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChOSUxQIChtY19mb3JlZ3JvdW5kKSkKKyAg ICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0Ig bHNsX2ZnOworICAgICAgICAgICAgICAgICAgICAgIG1jX2N1cnJlbnRfY29sdW1uX2ZnICh3LCBl c3NlbnRpYWxzLCBwb3NpbnQsICZsc2xfZmcpOworICAgICAgICAgICAgICAgICAgICAgIGZvcmVn cm91bmQucmVkID0gbHNsX2ZnLnJlZDsKKyAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5k LmdyZWVuID0gbHNsX2ZnLmdyZWVuOworICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQu Ymx1ZSA9IGxzbF9mZy5ibHVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg IGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAgICAgICAgICAg IGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAg ICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9s aW1pdCwgcm93LT55LAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0IC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSwgdnBvcywgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAg ICAgY3Vyc29yX3dpZHRoLCBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLmZjX3gsIGZvcmVncm91 bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgTVVMVElQ TEVfQ1VSU09SUywgZHJhd19wLCBmcm9tX3doZXJlLCBNQ19DQUNIRSk7CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBmY192aXNpYmxlKSkKKyAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPD0gdGV4dF9hcmVh X3dpZHRoCisgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHctPm1jLmxudW1fcGl4ZWxf d2lkdGgpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgeF9saW1pdCA9IHggKyBzdGFydC0+cGl4 ZWxfd2lkdGg7CisgICAgICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29y LnggPT0gZXNzZW50aWFscy5mY194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+Y3Vyc29yLnkgPT0gc3RhcnQtPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRf QVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3Iu dnBvcyA9PSB2cG9zKTsKKyAgICAgICAgICBpZiAoeCArIHN0YXJ0LT5waXhlbF93aWR0aCA8PSB0 ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgJiYgKChoZWFkZXJfbGluZV9mb3JtYXQgPiAw ICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09 IDApCisgICAgICAgICAgICAgICYmICgoc3RhcnQgIT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSAr IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMQorICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlh bHMuZmNfeCA+PSB4CisgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194IDwgeCAr IHN0YXJ0LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgIHx8IChzdGFydCA9PSByb3ct PmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxCisgICAgICAgICAg ICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHgpKQorICAgICAgICAgICAgICAmJiBz dGFydC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgJiYgIXJl YWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3cs IHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAgICAgICAgICAgICAg ICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBNQ19CQVIsIDEsCisg ICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMuZmNfeCwgZXNz ZW50aWFscy5mY19mZywgZXNzZW50aWFscy5hY3RpdmVfcCwgRklMTF9DT0xVTU4sCisgICAgICAg ICAgICAgICAgICAgICAgIGRyYXdfcCwgZnJvbV93aGVyZSwgRkNfQ0FDSEUpOworICAgICAgICB9 CisgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWly cykpCisgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hvcml6b250YWxfcnVsZXIpKQor ICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgIHsKKyAgICAgICAg ICBpbnQgeF9saW1pdCA9IChzdGFydCA9PSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51 c2VkW1RFWFRfQVJFQV0gLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgPyB0ZXh0X2FyZWFf d2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgIDogeCArIHN0YXJ0LT5waXhlbF93aWR0aDsK KyAgICAgICAgICAvKiBQcmVzZXJ2ZSBzdXBwb3J0IGZvciBkZWZhdWx0IGJlaGF2aW9yIHN1Y2gg dGhhdCBhIHVzZXIgbWF5CisgICAgICAgICAgc3BlY2lmeSB0aGUgaGVpZ2h0IG9mIGFuIE1DX0hC QVIsIHdoaWNoIGJlZ2lucyBpdHMgam91cm5leQorICAgICAgICAgIGFzIHRoZSBgY3Vyc29yX3dp ZHRoJy4gIGBtY19nZXRfY3Vyc29yX2dlb21ldHJ5JyByZWFkanVzdHMuICovCisgICAgICAgICAg bWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwg cm93LT55LAorICAgICAgICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FS RUFdLCB2cG9zLCBNQ19IQkFSLCAxLAorICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJp eCwgZXNzZW50aWFscy5mY194LCBlc3NlbnRpYWxzLmNoX2ZnLCBlc3NlbnRpYWxzLmFjdGl2ZV9w LAorICAgICAgICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUiwgZHJhd19wLCBmcm9tX3do ZXJlLCBDSF9DQUNIRSk7CisgICAgICAgIH0KKyAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo YiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICYmICFmaWxsX2NvbHVtbl90cnVtcHNf cCkKKyAgICAgICAgeworICAgICAgICAgIGN1cnNvcl90eXBlID0gKHN0YXJ0LT50eXBlID09IElN QUdFX0dMWVBIKQorICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAg ICAgICAgICAgICAgICAgICAgICA6IE1DX0JBUjsKKyAgICAgICAgICBpbnQgeF9saW1pdCA9IHdp bmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgYm9vbCByZWFsX2Zha2Vf Y3Vyc29yX3AgPSAody0+Y3Vyc29yLnkgPT0gc3RhcnQtPnkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsKKyAgICAgICAgICBp ZiAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAg fHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICYmICgoc3RhcnQgIT0g cm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMQorICAgICAg ICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHgKKyAgICAgICAgICAgICAgICAgICAmJiB3 LT5jdXJzb3IueCA8IHggKyBzdGFydC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB8 fCAoc3RhcnQgPT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFd IC0gMQorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHgpKQorICAgICAg ICAgICAgICAmJiBzdGFydC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAg ICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgIG1jX2VuZ2luZSAodywg bWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAg ICAgICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBj dXJzb3JfdHlwZSwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNz ZW50aWFscy5mY194LCBlc3NlbnRpYWxzLmNoX2ZnLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLAorICAg ICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUiwgZHJhd19wLCBmcm9tX3doZXJlLCBD SF9DQUNIRSk7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgICAgeworICAgICAgICBp bnQgcmVsYXRpdmVfeCA9IDA7CisgICAgICAgIGZvciAoaW50IGFyZWEgPSBMRUZUX01BUkdJTl9B UkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2FyZWEpCisgICAgICAgICAgeworICAgICAgICAgICAg c3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdOworICAgICAgICAgICAgc3Ry dWN0IGdseXBoICpnbHlwaF9lbmQgPSBnbHlwaCArIHJvdy0+dXNlZFthcmVhXTsKKyAgICAgICAg ICAgIC8qIEdseXBoIGZvciBhIGxpbmUgZW5kIGluIHRleHQuICovCisgICAgICAgICAgICBpZiAo YXJlYSA9PSBURVhUX0FSRUEgJiYgZ2x5cGggPT0gZ2x5cGhfZW5kICYmIGdseXBoLT5jaGFycG9z ID4gMCkKKyAgICAgICAgICAgICAgKytnbHlwaF9lbmQ7CisgICAgICAgICAgICBmb3IgKDsgZ2x5 cGggPCBnbHlwaF9lbmQ7ICsrZ2x5cGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICBpZiAodnBvcyAhPSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAgICAgICAgICAmJiBnbHlw aCAhPSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNf eCA8IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPCByZWxh dGl2ZV94CisgICAgICAgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAg ICAgICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkK KyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyogVGhlIHNwYWNlIGFw cGVuZGVkIHRvIGEgcm93IGVuZGluZyB3aXRoIGEgbmV3IGxpbmUgZG9lcworICAgICAgICAgICAg ICAgICAgICBub3QgaGF2ZSBhIGBnbHlwaC0+Y2hhcnBvc2AgKC0xLCAwKSB0aGF0IHdlIGNhbiB1 c2UgZm9yIHRoaXMKKyAgICAgICAgICAgICAgICAgICAgcGFydGljdWxhciBhcHBsaWNhdGlvbi4g IFdoZW4gYSBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5CisgICAgICAgICAgICAgICAgICAg IGFzc2lnbnMgYSB2aXNpYmxlIGdseXBoIHRvIGEgbmV3IGxpbmUsIHRoZXJlIGlzIG5vIHByb2Js ZW0KKyAgICAgICAgICAgICAgICAgICAgYmVjYXVzZSB0aGF0IGdseXBoIGhhcyBhIGBnbHlwaC0+ Y2hhcnBvcycgdGhhdCB3ZSBjYW4gdXNlLgorICAgICAgICAgICAgICAgICAgICBXaGVuIG5vIHZp c2libGUgRU9MIGdseXBoIGV4aXN0cywgd2UgdXNlIHRoZSBmb2xsb3dpbmcgdGVzdDoKKyAgICAg ICAgICAgICAgICAgICAgdGhlIGFwcGVuZGVkIHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMg b25lIGxlc3MgdGhhbiB0aGUKKyAgICAgICAgICAgICAgICAgICAgZW5kIG9mIHRoZSBtYXRyaXgg cm93LiAqLworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICpwcmV2aW91 c19nbHlwaCA9ICgwIDw9IGhwb3MgLSAxICYmIGhwb3MgLSAxIDwgcm93LT51c2VkW1RFWFRfQVJF QV0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyBocG9zIC0gMQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICAgICAgICAgICAgICAgICAg ICAvLyBzdHJ1Y3QgZ2x5cGggKmxhc3RfZ2x5cGggPSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsg cm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgICAgICAgICAgICAgICBib29sIHNraXBf cCA9IChwcmV2aW91c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHByZXZpb3VzX2dseXBoLT5jaGFycG9zID09IG1hdHJpeF9yb3dfZW5kX2NoYXJw b3MgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT5ieXRl cG9zICE9IGVzc2VudGlhbHMuenZfYnl0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFdoZW4g YSBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5IGNvbnRhaW5zCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgYSB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIgKCLCuyIpLCB0aGUgc3Vi c2VxdWVudAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNUUkVUQ0hfR0xZUEgg d2lsbCBoYXZlIHRoZSBzYW1lIGdseXBoLT5jaGFycG9zCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYXMgdGhlIGFmb3JlbWVudGlvbmVkIHZpc2libGUgdGFiIGNoYXJhY3Rlci4g Ki8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChwcmV2aW91c19nbHlwaCAh PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcHJldmlvdXNf Z2x5cGgtPmNoYXJwb3MgPT0gZ2x5cGgtPmNoYXJwb3MpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBpbnQgcG9zaW50ID0gKHJvd19iZXlvbmRfenZf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3dfYXRfenZfcCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAtMQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAocm93X2F0X3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IGVzc2VudGlhbHMuenYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogKGdseXBoLT5ieXRlcG9zICE9IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFd ID09IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBtYXRyaXhfcm93X2VuZF9jaGFycG9zIC0gMQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoZ2x5cGgtPmJ5dGVwb3MgPT0gZXNzZW50aWFscy56dl9ieXRlCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaCAtIHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IGVzc2VudGlhbHMuenYKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogZ2x5cGgtPmNoYXJwb3M7CisgICAgICAgICAgICAgICAgICAgIExpc3Bf T2JqZWN0IHNwZWNzID0gbWNfYXNzb2MgKG1ha2VfZml4bnVtIChwb3NpbnQpLCBCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKTsKKyAgaW50IGdseXBoX2NoYXJwb3MgPSBnbHlw aC0+Y2hhcnBvczsKKyAgaWYgKGRlYnVnX3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAiXG5CLiAg dnBvcyAoJWQpIHwgZ2x5cG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fY2hhcnBvcywgcm93LT5lbmRzX2F0 X3p2X3AgPyAieSIgOiAibiIsCisgICAgbWF0cml4X3Jvd19zdGFydF9ieXRlcG9zLCBtYXRyaXhf cm93X2VuZF9ieXRlcG9zLAorICAgICAgbWF0cml4X3Jvd19zdGFydF9jaGFycG9zLCBtYXRyaXhf cm93X2VuZF9jaGFycG9zKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCgoaGVhZGVyX2xpbmVf Zm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCBoZWFk ZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChz cGVjcykKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT55IDw9IHdpbmRvd190ZXh0 X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXNraXBfcAorICAgICAg ICAgICAgICAgICAgICAgICAgJiYgKHJvd19hdF96dl9wIHx8ICFyb3dfYmV5b25kX3p2X3ApKQor ICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExpc3BfT2Jq ZWN0IGxpc3BfdHlwZSA9IG1jX250aCAoMSwgc3BlY3MpOworICAgICAgICAgICAgICAgICAgICAg ICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IChDT05TUCAobGlzcF90eXBlKSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxpc3BfdHlwZSkpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBtY19saXNw X3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOworICAgICAgICAgICAgICAgICAgICAgICAgY3Vy c29yX3R5cGUgPSAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX0JPWAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IGN1cnNvcl90eXBlOworICAgICAgICAgICAgICAgICAgICAg ICAgaW50IGN1cnNvcl93aWR0aCA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFhGSVhOVU0gKFhDQVIgKFhDRFIgKGxpc3Bf dHlwZSkpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogLTE7 CisgICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBtY19mb3JlZ3JvdW5kID0gbWNf bnRoICgyLCBzcGVjcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGZv cmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoU1RSSU5HUCAobWNfZm9yZWdy b3VuZCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX3h3X2NvbG9yX3ZhbHVlcyAodywg bWNfZm9yZWdyb3VuZCwgJmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgICAgICAgICBl bHNlIGlmIChWRUNUT1JQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLnJlZCA9IFhG TE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAwKSk7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBmb3JlZ3JvdW5kLmdyZWVuID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVn cm91bmQsIDEpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQuYmx1 ZSA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAyKSk7CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKE5J TFAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgbWNfY3VycmVudF9jb2x1bW5fZmcgKHcsIGVzc2VudGlhbHMs IHBvc2ludCwgJmxzbF9mZyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3Jv dW5kLnJlZCA9IGxzbF9mZy5yZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3Jl Z3JvdW5kLmdyZWVuID0gbHNsX2ZnLmdyZWVuOworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZm9yZWdyb3VuZC5ibHVlID0gbHNsX2ZnLmJsdWU7CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQ T1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0g d2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAgICAgICAg IG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4X2xpbWl0LCByb3ctPnksIGdseXBoIC0g cm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgdnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgY3Vyc29yX21hdHJpeCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5mY194LCBmb3JlZ3JvdW5k LCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNVUxUSVBMRV9DVVJTT1JTLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIE1DX0NBQ0hFKTsKKyAgICAg ICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAg aWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAg ICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPD0gdGV4dF9hcmVhX3dpZHRoCisg ICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB3LT5tYy5sbnVtX3BpeGVs X3dpZHRoKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpbnQgeF9s aW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICAgICAg ICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci54ID09IGVzc2VudGlhbHMu ZmNfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5jdXJzb3IueSA9PSBnbHlwaC0+eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RF WFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+Y3Vyc29yLnZwb3MgPT0gdnBvcyk7CisgICAgICAgICAgICAgICAgICAgIGludCBocG9z ID0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICBp ZiAoaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwg aHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICAgICAgICAgICAgICAmJiByZWxh dGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoIDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAg ICAgICAgICAgICAgICAgJiYgKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQor ICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChnbHlwaCAhPSBnbHlwaF9lbmQgLSAxCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSByZWxhdGl2ZV94 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA8IHJlbGF0 aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg fHwgKGdseXBoID09IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgZXNzZW50aWFscy5mY194ID49IHJlbGF0aXZlX3gpKQorICAgICAgICAgICAgICAgICAg ICAgICAgJiYgZ2x5cGgtPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAg ICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgICAgICAg ICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4 X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9zLCB2 cG9zLCBNQ19CQVIsIDEsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBlc3NlbnRpYWxzLmZjX3gsIGVzc2VudGlhbHMuZmNfZmcsIGVzc2VudGlhbHMuYWN0 aXZlX3AsIEZJTExfQ09MVU1OLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJh d19wLCBmcm9tX3doZXJlLCBGQ19DQUNIRSk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFp cnMpKQorICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaG9yaXpvbnRh bF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3Mp CisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0g d2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAgICAgaW50 IGhwb3MgPSBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgICAgICAg ICAgIC8qIFByZXNlcnZlIHN1cHBvcnQgZm9yIGRlZmF1bHQgYmVoYXZpb3Igc3VjaCB0aGF0IGEg dXNlciBtYXkKKyAgICAgICAgICAgICAgICAgICAgc3BlY2lmeSB0aGUgaGVpZ2h0IG9mIGFuIE1D X0hCQVIsIHdoaWNoIGJlZ2lucyBpdHMgam91cm5leQorICAgICAgICAgICAgICAgICAgICBhcyB0 aGUgYGN1cnNvcl93aWR0aCcuICBgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeScgcmVhZGp1c3RzLiAq LworICAgICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAg ICAgICAgICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoKQorICAgICAg ICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCBy ZWxhdGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93 LT55LCBocG9zLCB2cG9zLCBNQ19IQkFSLCAxLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5mY194LCBlc3NlbnRpYWxzLmNoX2ZnLCBl c3NlbnRpYWxzLmFjdGl2ZV9wLCBIT1JJWk9OVEFMX1JVTEVSLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgZHJhd19wLCBmcm9tX3doZXJlLCBDSF9DQUNIRSk7CisgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZB UiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAmJiAhZmlsbF9j b2x1bW5fdHJ1bXBzX3ApCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg IGN1cnNvcl90eXBlID0gKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX0JPWAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogTUNfQkFSOworICAgICAgICAgICAgICAgICAgICBpbnQgeF9saW1p dCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICAgICAgICAg IGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci55ID09IGdseXBoLT55CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52 cG9zID09IHZwb3MpOworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGhwb3MgPj0gaHBv c19zdGFydAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGhwb3Nfc3RhcnQgKyBo cG9zX2xlbmd0aAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChoZWFkZXJfbGluZV9mb3Jt YXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGhlYWRl cl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChnbHlwaCAh PSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNv ci54ID49IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnggPCByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHx8IChnbHlwaCA9PSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHJlbGF0aXZlX3gpKQorICAgICAgICAg ICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisg ICAgICAgICAgICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAg ICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxh dGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55 LCBocG9zLCB2cG9zLCBjdXJzb3JfdHlwZSwgMSwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuZmNfeCwgZXNzZW50aWFscy5jaF9mZywg ZXNzZW50aWFscy5hY3RpdmVfcCwgVkVSVElDQUxfUlVMRVIsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0 aDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgIH0KKyAgLy8gIGNsb2NrX3Qg Y2xvY2tfZW5kID0gY2xvY2soKTsKKyAgLy8gIGRvdWJsZSBjcHVfdGltZV91c2VkID0gKChkb3Vi bGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8vICBm cHJpbnRmIChzdGRlcnIsICJtY19kcmF3X3JvdyAoJXMpOiAgVElNRSAoJWYpXG4iLCBtY193aW5k b3cgKHcpLCBjcHVfdGltZV91c2VkKTsKK30KKwordm9pZAorbWNfcmVkcmF3X3JvdyAoc3RydWN0 IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93 ICpyb3csCisgICAgICAgICAgICAgICBpbnQgc3RhcnRfeCwgaW50IHN0YXJ0X2hwb3MsIGludCBl bmRfaHBvcywgYm9vbCBjbGVhcl9lb2xfcCwKKyAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlw aHNfZmFjZSBobCkKK3sKKyAgc3RydWN0IGZyYW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9SSUYgKGYpLT5jbGVhcl9lbmRfb2ZfbGluZSAodywgcm93LCBU RVhUX0FSRUEsIC0xKTsKKyAgICB9CisgIC8vICBjbG9ja19zdGFydCA9IGNsb2NrKCk7CisgIGlu dCB2bnRoID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgIC8qIFNUUkVUQ0hfR0xZ UEggbWF5IGNvbnRhaW4gbW9yZSB0aGFuIG9uZSBmYWtlIGN1cnNvciBhdCB0aGUgc2FtZSBIUE9T LiAqLworICBmb3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7Cisg ICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICB7 CisgICAgICBmb3IgKGludCBudGggPSAwOyB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hl X3R5cGVdID4gMCAmJiBudGggPCB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2Nh Y2hlX3R5cGVdOyArK250aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB4ID0gdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS54OworICAgICAgICAgIGludCBm eCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZng7Cisg ICAgICAgICAgaW50IHkgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLnk7CisgICAgICAgICAgaW50IGZ5ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS5meTsKKyAgICAgICAgICBpbnQgaHBvcyA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uaHBvczsKKyAgICAgICAgICBpbnQg dnBvcyA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0udnBv czsKKyAgICAgICAgICBpbnQgd2QgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhdLndkOworICAgICAgICAgIGludCBoID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5oOworICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5 cGUgY3Vyc29yX3R5cGUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmN1cnNvcl90eXBlOworICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGggPSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl93aWR0aDsKKyAg ICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZyA9IHsucmVkID0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mb3JlZ3JvdW5kLnJlZCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmZvcmVncm91bmQuZ3JlZW4sCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgLmJsdWUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhdLmZvcmVncm91bmQuYmx1ZX07CisgICAgICAgICAgc3RydWN0IG1jX1JH QiBsc2xfYmcgPSB7LnJlZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF0uYmFja2dyb3VuZC5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgLmdyZWVuID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XS5iYWNrZ3JvdW5kLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5i bHVlID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iYWNr Z3JvdW5kLmJsdWV9OworICAgICAgICAgIGJvb2wgYWN0aXZlX3AgPSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmFjdGl2ZV9wOworICAgICAgICAgIGVudW0g bWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF0uZ2x5cGhfZmxhdm9yOworICAgICAgICAgIGJvb2wgZW5hYmxlZF9wID0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3A7 CisgICAgICAgICAgaWYgKHZwb3MgPT0gdm50aAorICAgICAgICAgICAgICAmJiAoKGhwb3MgPj0g c3RhcnRfaHBvcworICAgICAgICAgICAgICAgICAgICYmIGhwb3MgPCBlbmRfaHBvcykKKyAgICAg ICAgICAgICAgICAgIC8qIEEgZmxvYXRpbmcgY3Vyc29yIGJleW9uZCB0aGUgZW5kIG9mIHRoZSBn bHlwaCByb3cuICovCisgICAgICAgICAgICAgICAgICB8fCAoaHBvcyArIDEgPT0gc3RhcnRfaHBv cworICAgICAgICAgICAgICAgICAgICAgICYmIGhwb3MgKyAxID09IGVuZF9ocG9zKSkKKyAgICAg ICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBib29s IHJlbW92ZV9wID0gZmFsc2U7CisgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3 LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGxz bF9mZywgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlw aF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAg Ly8gIGNsb2NrX2VuZCA9IGNsb2NrKCk7CisgIC8vICBkb3VibGUgdGltZV9jdXJzb3JzID0gKChk b3VibGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8v ICBmcHJpbnRmIChzdGRlcnIsICJtY19yZWRyYXdfcm93ICglZCk6ICBocG9zICglZC8lZCkgfCBn bHlwaHMgKCVmKSB8IGN1cnNvcnMgKCVmKVxuIiwKKyAgLy8gICAgICAgICAgICAgICAgICAgdnBv cywgc3RhcnRfaHBvcywgZW5kX2hwb3MsIHRpbWVfZ2x5cGhzLCB0aW1lX2N1cnNvcnMpOworfQor Cit2b2lkCittY19lcmFzZV9yb3cgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRy aXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93KQoreworICBpbnQgdnBvcyA9IE1BVFJJ WF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAg ZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2Vfcm93ICglcyk6ICB2cG9zICglZClcbiIsIG1jX3dp bmRvdyAodyksIHZwb3MpOworICBpbnQgdm50aCA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRy aXgpOworICAvLyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAvLyAgICBmcHJpbnRmIChzdGRl cnIsICJtY19lcmFzZV9oZWxwZXIgKCVzKTogIGNhY2hlICglcykgfCB2cG9zICglZClcbiIsCisg IC8vICAgICAgbWNfd2luZG93ICh3KSwgbWNfY2FjaGVfdHlwZV90b19zdHJpbmcgKGNhY2hlX3R5 cGUpLCB2bnRoKTsKKyAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NB Q0hFOworICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICArK2NhY2hlX3R5cGUp CisgICAgeworICAgICAgZm9yIChpbnQgbnRoID0gMDsgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNl ZFtjYWNoZV90eXBlXSA+IDAgJiYgbnRoIDwgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVf dXNlZFtjYWNoZV90eXBlXTsgKytudGgpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgeCA9IHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueDsKKyAgICAgICAg ICBpbnQgZnggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmZ4OworICAgICAgICAgIGludCB5ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXS55OworICAgICAgICAgIGludCBmeSA9IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZnk7CisgICAgICAgICAgaW50IGhwb3MgPSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmhwb3M7CisgICAgICAg ICAgaW50IHZwb3MgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLnZ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ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF0uYmFja2dyb3VuZC5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAuYmx1ZSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uYmFja2dyb3VuZC5ibHVlfTsKKyAgICAgICAgICBib29sIGFjdGl2ZV9wID0gdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5hY3RpdmVfcDsKKyAgICAgICAg ICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICBib29sIGVuYWJs ZWRfcCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5h YmxlZF9wOworICAgICAgICAgIC8qIGBtYXRyaXhfcm93JyBpbiBgZGlzcG5ldy5jYCBjb250YWlu cyB0aGUgZm9sbG93aW5nIHRlc3RzLAorICAgICAgICAgIGVhc3NlcnQgKG1hdHJpeCAmJiBtYXRy aXgtPnJvd3MpOworICAgICAgICAgIGVhc3NlcnQgKHJvdyA+PSAwICYmIHJvdyA8IG1hdHJpeC0+ bnJvd3MpOyAqLworICAgICAgICAgIGJvb2wgYmFyZl9jcmFzaF9vbmUgPSAobWF0cml4ICYmIG1h dHJpeC0+cm93cykgPyBmYWxzZSA6IHRydWU7CisgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hfb25l KQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgYm9vbCBiYXJmX2NyYXNoX3R3byA9 ICh2cG9zID49IDAgJiYgdnBvcyA8IG1hdHJpeC0+bnJvd3MpID8gZmFsc2UgOiB0cnVlOworICAg ICAgICAgIGlmIChiYXJmX2NyYXNoX3R3bykKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAg ICAgIGlmICh2cG9zID09IHZudGgKKyAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yID09IE1D X0dMWVBICisgICAgICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgbWNfZXJhc2VfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgeSwgaHBvcywgdnBv cywgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QpOworICAgICAgICAgICAgICB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmVuYWJsZWRfcCA9IGZhbHNl OworICAgICAgICAgICAgICAtLXctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07 CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmICh2cG9zID09IHZudGgKKyAgICAg ICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgIGJvb2wgcmVtb3ZlX3AgPSB0cnVlOworICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJh c2VfaHlicmlkICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwg aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIGN1 cnNvcl93aWR0aCwgbHNsX2JnLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCByZW1vdmVfcCk7CisgICAgICAgICAgICAgICAgdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3AgPSBm YWxzZTsKKyAgICAgICAgICAgICAgICAtLXctP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2Nyb2xsZWQsIGVudW0gbWNfcHJlX3Njcm9sbF9jbGVhbiBmcm9tX3do ZXJlKQoreworICBpZiAoTUlOSV9XSU5ET1dfUCAodykpCisgICAgcmV0dXJuOworICBib29sIGdv X29uZV9wID0gKHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVdID4gMAorICAgICAg ICAgICAgICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hfQ0FDSEVdID4gMAor ICAgICAgICAgICAgICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVd ID4gMCk7CisgIGJvb2wgZ29fdHdvX3AgPSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAg ICAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3Nz aGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKSk7CisgIGlmICh0cmFj ZV9yZWRpc3BsYXlfcCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJtY19wcmVfc2Nyb2xsX2NsZWFu ICglcyk6XG5cCisgICVzIHwgZ29fb25lX3AgKCVzKSB8IGdvX3R3b19wICglcylcblwKKyAgc3Rh cnRfdnBvcyAoJWQpIHwgbnJvd3Nfc2Nyb2xsZWQgKCVkKVxuXAorICAlczogIHJ1bi5jdXJyZW50 L2Rlc2lyZWRfeSAoJWQvJWQpIHwgcnVuLmhlaWdodCAoJWQpXG4iLAorICAgIG1jX3dpbmRvdyAo dyksIChmcm9tX3doZXJlID09IFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJWF9ET1dO KQorICAgICAgICAgICAgICAgICAgICAgPyAiVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFU UklYX0RPV04iCisgICAgICAgICAgICAgICAgICAgOiAoZnJvbV93aGVyZSA9PSBUUllfV0lORE9X X1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfVVApCisgICAgICAgICAgICAgICAgICAgICA/ICJUUllf V0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfVVAiCisgICAgICAgICAgICAgICAgICAgOiAo ZnJvbV93aGVyZSA9PSBUUllfV0lORE9XX0lEKQorICAgICAgICAgICAgICAgICAgICAgPyAiVFJZ X1dJTkRPV19JRCIKKyAgICAgICAgICAgICAgICAgICA6ICJVTktOT1dOIiwKKyAgICBnb19vbmVf cCA/ICJ5ZXMiIDogIm5vIiwgZ29fdHdvX3AgPyAieWVzIiA6ICJubyIsCisgICAgc3RhcnRfdnBv cywgbnJvd3Nfc2Nyb2xsZWQsCisgICAgcnVuLmN1cnJlbnRfeSA8IHJ1bi5kZXNpcmVkX3kgPyAi 4oaTIiA6ICLihpEiLAorICAgIHJ1bi5jdXJyZW50X3ksIHJ1bi5kZXNpcmVkX3ksIHJ1bi5oZWln aHQpOworICBpZiAoIWdvX29uZV9wICYmICFnb190d29fcCkKKyAgICByZXR1cm47CisgIGJvb2wg dXBkYXRpbmdfZnJhbWVfcCA9IGZhbHNlOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHct PmZyYW1lKTsKKyAgaWYgKFhGUkFNRSAody0+ZnJhbWUpICE9IGYtPm1jX3VwZGF0aW5nX2ZyYW1l CisgICAgICAmJiAoZ29fb25lX3AgfHwgZ29fdHdvX3ApKQorICAgIHsKKyAgICAgIHVwZGF0aW5n X2ZyYW1lX3AgPSB0cnVlOworICAgICAgdXBkYXRlX2JlZ2luIChmKTsKKyAgICB9CisgIGlmICh3 LT5waHlzX2N1cnNvcl9vbl9wCisgICAgICAmJiBnb190d29fcCkKKyAgICBlcmFzZV9waHlzX2N1 cnNvciAodyk7CisgIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0 cml4OworICBmb3IgKGludCB2bnRoID0gc3RhcnRfdnBvczsKKyAgICAgICBtYXRyaXggIT0gTlVM TAorICAgICAgICYmIHZudGggPCBtYXRyaXgtPm5yb3dzCisgICAgICAgJiYgTUFUUklYX1JPVyAo bWF0cml4LCB2bnRoKS0+ZW5hYmxlZF9wCisgICAgICAgJiYgZ29fb25lX3A7CisgICAgICAgKyt2 bnRoKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdyA9IE1BVFJJWF9ST1cgKG1h dHJpeCwgdm50aCk7CisgICAgICBtY19lcmFzZV9yb3cgKHcsIG1hdHJpeCwgcm93KTsKKyAgICB9 CisgIGlmICh1cGRhdGluZ19mcmFtZV9wKQorICAgIHVwZGF0ZV9lbmQgKGYpOworICAvLyBtY19y ZXNldF9jYWNoZSAodyk7Cit9CisKK0RFRlVOICgibWMtc3RkZXJyIiwgRm1jX3N0ZGVyciwgU21j X3N0ZGVyciwgMCwgMSwgIlAiLAorICAgICAgIGRvYzogLyogVG9nZ2xlIHRyYWNpbmcgb2YgbXVs dGlwbGUgZmFrZSBjdXJzb3JzLgorV2l0aCBBUkcsIHR1cm4gdHJhY2luZyBvbiBpZiBhbmQgb25s eSBpZiBBUkcgaXMgcG9zaXRpdmUuICovKQorICAoTGlzcF9PYmplY3QgYXJnKQoreworICBpZiAo TklMUCAoYXJnKSkKKyAgICBtY19zdGRlcnJfcCA9ICFtY19zdGRlcnJfcDsKKyAgZWxzZQorICAg IHsKKyAgICAgIGFyZyA9IEZwcmVmaXhfbnVtZXJpY192YWx1ZSAoYXJnKTsKKyAgICAgIG1jX3N0 ZGVycl9wID0gWEZJWE5VTSAoYXJnKSA+IDA7CisgICAgfQorICByZXR1cm4gUW5pbDsKK30KKwor LyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IAwKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKgogCQkgICAgICBXaW5kb3cgZGlzcGxheSBkaW1lbnNpb25zCkBA IC0xMzM5NSw2ICsxNzkxMiw2OSBAQCBoc2Nyb2xsX3dpbmRvd190cmVlIChMaXNwX09iamVjdCB3 aW5kb3cpCiAJICAgICAgZWxzZQogCQlwdCA9IGNsaXBfdG9fYm91bmRzIChCRUdWLCBtYXJrZXJf cG9zaXRpb24gKHctPnBvaW50bSksIFpWKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogKGdkYikgYnQKKyMwICB0ZXJtaW5h dGVfZHVlX3RvX3NpZ25hbCAoc2lnPTYsIGJhY2t0cmFjZV9saW1pdD0yMTQ3NDgzNjQ3KSBhdCBl bWFjcy5jOjM1OQorIzEgIDB4MDAwMDAwMDEwMDFlZTk5NiBpbiBkaWUgKAorICAgIG1zZz0weDEw MDMyZmM4OCAiY2hhcnBvcyA8IDAgfHwgKGNoYXJwb3MgPj0gQlVGX0JFRyAoY3VycmVudF9idWZm ZXIpICYmIGNoYXJwb3MgPD0gWlYpIiwgZmlsZT0weDEwMDMyZTMyZCAieGRpc3AuYyIsIGxpbmU9 Nzk1MSkgYXQgYWxsb2MuYzo3MjE0CisjMiAgMHgwMDAwMDAwMTAwMDRkMmFiIGluIGluaXRfaXRl cmF0b3IgKGl0PTB4N2ZmZjVmYmY5ZTgwLCB3PTB4MTFhZTYyMTUwLAorICAgIGNoYXJwb3M9NzQz LCBieXRlcG9zPTc0Myw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ENIQVJQT1MgKHBvcy0+cG9zKTsKKworICBib29sIGJhcmZfY3Jhc2hfb25lID0g KGNoYXJwb3MgPCAwCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGNoYXJwb3MgPj0gQlVG X0JFRyAoY3VycmVudF9idWZmZXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGNo YXJwb3MgPD0gWlYpKQorICAgICAgICAgICAgICAgICAgICAgICAgPyBmYWxzZQorICAgICAgICAg ICAgICAgICAgICAgICAgOiB0cnVlOworICBpZiAoYmFyZl9jcmFzaF9vbmUpCisgICAgcmV0dXJu IGhzY3JvbGxlZF9wOworCisgIC8qIGByZXNlYXRfMSc6ICBDSEFSUE9TIChwb3MpID49IEJFR1Yg JiYgQ0hBUlBPUyAocG9zKSA8PSBaViAqLworICBib29sIGJhcmZfY3Jhc2hfdHdvID0gKGNoYXJw b3MgPj0gQkVHViAmJiBjaGFycG9zIDw9IFpWKQorICAgICAgICAgICAgICAgICAgICAgICAgID8g ZmFsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICA6IHRydWU7CisgIGlmIChiYXJmX2NyYXNo X3R3bykKKyAgICByZXR1cm4gaHNjcm9sbGVkX3A7CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JT ICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgLyogTW92ZSBpdGVyYXRv ciB0byBwdCBzdGFydGluZyBhdCBjdXJzb3Jfcm93LT5zdGFydCBpbgogCQkgYSBsaW5lIHdpdGgg aW5maW5pdGUgd2lkdGguICAqLwogCSAgICAgIGluaXRfdG9fcm93X3N0YXJ0ICgmaXQsIHcsIGN1 cnNvcl9yb3cpOwpAQCAtMTQyODcsOSArMTg4NjcsMjIgQEAgcmVkaXNwbGF5X2ludGVybmFsICh2 b2lkKQogCSAgICAgICp3LT5kZXNpcmVkX21hdHJpeC0+bWV0aG9kID0gMDsKIAkgICAgICBkZWJ1 Z19tZXRob2RfYWRkICh3LCAib3B0aW1pemF0aW9uIDEiKTsKICNlbmRpZgorCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAjaWZkZWYgSEFWRV9X SU5ET1dfU1lTVEVNCisgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICFOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICBtY191cGRh dGVfd2luZG93X2ZyaW5nZXMgKHcsIGZhbHNlKTsKKyAgICBlbHNlCiAJICAgICAgdXBkYXRlX3dp bmRvd19mcmluZ2VzICh3LCBmYWxzZSk7CiAjZW5kaWYKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogCSAgICAgIGdvdG8gdXBkYXRlOwogCSAgICB9CiAJICBlbHNlCkBAIC0xNzY4Nywx MCArMjIyODAsMjIgQEAgcmVkaXNwbGF5X3dpbmRvdyAoTGlzcF9PYmplY3Qgd2luZG93LCBib29s IGp1c3RfdGhpc19vbmVfcCkKICAgICB9CiAKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBi b29sIGtlZXBfY3VycmVudF9wID0gKGp1c3RfdGhpc19vbmVfcAorICAgICAgICAgICAgICAgICAg ICAgICAgIHx8ICghdXNlZF9jdXJyZW50X21hdHJpeF9wICYmICFvdmVybGF5X2Fycm93X3NlZW4p CisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgdy0+cHNldWRvX3dpbmRvd19wKTsKKworICBi b29sIGZyaW5nZXNfdXBkYXRlZF9wID0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNyb3NzaGFpcnMpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfdXBkYXRlX3dp bmRvd19mcmluZ2VzICh3LCBrZWVwX2N1cnJlbnRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCBrZWVwX2N1cnJlbnRfcCk7CisKICAgaWYg KEZSQU1FX1dJTkRPV19QIChmKQotICAgICAgJiYgdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCAo anVzdF90aGlzX29uZV9wCi0JCQkJICAgIHx8ICghdXNlZF9jdXJyZW50X21hdHJpeF9wICYmICFv dmVybGF5X2Fycm93X3NlZW4pCi0JCQkJICAgIHx8IHctPnBzZXVkb193aW5kb3dfcCkpKQorICAg ICAgJiYgZnJpbmdlc191cGRhdGVkX3ApCiAgICAgewogICAgICAgdXBkYXRlX2JlZ2luIChmKTsK ICAgICAgIGJsb2NrX2lucHV0ICgpOwpAQCAtMTc3MDUsNiArMjIzMTAsOSBAQCByZWRpc3BsYXlf d2luZG93IChMaXNwX09iamVjdCB3aW5kb3csIGJvb2wganVzdF90aGlzX29uZV9wKQogICAgICAg dXBkYXRlX2VuZCAoZik7CiAgICAgfQogCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAg IGlmIChXSU5ET1dfQk9UVE9NX0RJVklERVJfV0lEVEggKHcpKQogICAgIHhfZHJhd19ib3R0b21f ZGl2aWRlciAodyk7CiAjZW5kaWYgLyogSEFWRV9XSU5ET1dfU1lTVEVNICovCkBAIC0xODAxMCw2 ICsyMjYxOCw3IEBAIHRyeV93aW5kb3dfcmV1c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0IHdp bmRvdyAqdykKIAkgICAgIHNjcm9sbF9ydW5faG9vayB3aWxsIGNsZWFyIHRoZSBjdXJzb3IsIGFu ZCB1c2UgdGhlCiAJICAgICBjdXJyZW50IG1hdHJpeCB0byBnZXQgdGhlIGhlaWdodCBvZiB0aGUg cm93IHRoZSBjdXJzb3IgaXMKIAkgICAgIGluLiAgKi8KKwogCSAgcnVuLmN1cnJlbnRfeSA9IHN0 YXJ0X3Jvdy0+eTsKIAkgIHJ1bi5kZXNpcmVkX3kgPSBpdC5jdXJyZW50X3k7CiAJICBydW4uaGVp Z2h0ID0gaXQubGFzdF92aXNpYmxlX3kgLSBpdC5jdXJyZW50X3k7CkBAIC0xODAxOSw2ICsyMjYy OCwxNiBAQCB0cnlfd2luZG93X3JldXNpbmdfY3VycmVudF9tYXRyaXggKHN0cnVjdCB3aW5kb3cg KncpCiAJICAgICAgdXBkYXRlX2JlZ2luIChmKTsKIAkgICAgICBGUkFNRV9SSUYgKGYpLT51cGRh dGVfd2luZG93X2JlZ2luX2hvb2sgKHcpOwogCSAgICAgIEZSQU1FX1JJRiAoZiktPmNsZWFyX3dp bmRvd19tb3VzZV9mYWNlICh3KTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworICAgIG1jX3ByZV9zY3JvbGxfY2xlYW4gKHcsIHJ1biwgc3Rh cnRfdnBvcywgbnJvd3Nfc2Nyb2xsZWQsIFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJ WF9ET1dOKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioq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OR19DVVJSRU5UX01B VFJJWF9VUCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIEZSQU1FX1JJRiAo ZiktPnNjcm9sbF9ydW5faG9vayAodywgJnJ1bik7CiAJICBGUkFNRV9SSUYgKGYpLT51cGRhdGVf d2luZG93X2VuZF9ob29rICh3LCBmYWxzZSwgZmFsc2UpOwogCSAgdXBkYXRlX2VuZCAoZik7CkBA IC0xOTEyNyw2ICsyMzc1Nyw3IEBAIHRyeV93aW5kb3dfaWQgKHN0cnVjdCB3aW5kb3cgKncpCiAg IC8qIFNjcm9sbCB0aGUgZGlzcGxheS4gIERvIGl0IGJlZm9yZSBjaGFuZ2luZyB0aGUgY3VycmVu dCBtYXRyaXggc28KICAgICAgdGhhdCB4dGVybS5jIGRvZXNuJ3QgZ2V0IGNvbmZ1c2VkIGFib3V0 IHdoZXJlIHRoZSBjdXJzb3IgZ2x5cGggaXMKICAgICAgZm91bmQuICAqLworCiAgIGlmIChkeSAm JiBydW4uaGVpZ2h0KQogICAgIHsKICAgICAgIHVwZGF0ZV9iZWdpbiAoZik7CkBAIC0xOTEzNSw2 ICsyMzc2NiwxNiBAQCB0cnlfd2luZG93X2lkIChzdHJ1Y3Qgd2luZG93ICp3KQogCXsKIAkgIEZS QU1FX1JJRiAoZiktPnVwZGF0ZV93aW5kb3dfYmVnaW5faG9vayAodyk7CiAJICBGUkFNRV9SSUYg KGYpLT5jbGVhcl93aW5kb3dfbW91c2VfZmFjZSAodyk7CisKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBtY19wcmVfc2Nyb2xsX2NsZWFu ICh3LCBydW4sIGZpcnN0X3VuY2hhbmdlZF9hdF9lbmRfdnBvcywgZHZwb3MsIFRSWV9XSU5ET1df SUQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICBGUkFNRV9SSUYgKGYpLT5z Y3JvbGxfcnVuX2hvb2sgKHcsICZydW4pOwogCSAgRlJBTUVfUklGIChmKS0+dXBkYXRlX3dpbmRv d19lbmRfaG9vayAodywgZmFsc2UsIGZhbHNlKTsKIAl9CkBAIC0yMDEzMyw2ICsyNDc3NCwxNyBA QCBhcHBlbmRfc3BhY2VfZm9yX25ld2xpbmUgKHN0cnVjdCBpdCAqaXQsIGJvb2wgZGVmYXVsdF9m YWNlX3ApCiAJICBtZW1zZXQgKCZpdC0+cG9zaXRpb24sIDAsIHNpemVvZiBpdC0+cG9zaXRpb24p OwogCSAgaXQtPm9iamVjdCA9IFFuaWw7CiAJICBpdC0+YyA9IGl0LT5jaGFyX3RvX2Rpc3BsYXkg PSAnICc7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKyAgICAgIGlmIChJVF9CWVRFUE9TICgqaXQpID49IFpWX0JZVEUpCisgICAgICAgIGl0 LT56dl9wID0gdHJ1ZTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgaXQtPmxl biA9IDE7CiAKIAkgIC8qIElmIHRoZSBkZWZhdWx0IGZhY2Ugd2FzIHJlbWFwcGVkLCBiZSBzdXJl IHRvIHVzZSB0aGUKQEAgLTIxMjY5LDkgKzI1OTIxLDIyIEBAIG1heWJlX3Byb2R1Y2VfbGluZV9u dW1iZXIgKHN0cnVjdCBpdCAqaXQpCiAgICAgICBlbHNlCiAJdGVtX2l0LmMgPSB0ZW1faXQuY2hh cl90b19kaXNwbGF5ID0gKnA7CiAgICAgICB0ZW1faXQubGVuID0gMTsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgaWYgKGJleW9u ZF96dikKKyAgICAgICAgdGVtX2l0Lnp2X3AgPSB0cnVlOworICAgICAgdGVtX2l0LmN1cnJlbnRf eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICB0ZW1faXQudnBvcyA9IGl0LT52cG9zOwogICAgICAg LyogTWFrZSBzdXJlIHRoZXNlIGdseXBocyB3aWxsIGhhdmUgYSAicG9zaXRpb24iIG9mIC0xLiAg Ki8KICAgICAgIFNFVF9URVhUX1BPUyAodGVtX2l0LnBvc2l0aW9uLCAtMSwgLTEpOwogICAgICAg UFJPRFVDRV9HTFlQSFMgKCZ0ZW1faXQpOworICAgICAgdGVtX2l0Lmhwb3MgKz0gMTsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKIAogICAgICAgLyogU3RvcCBwcm9kdWNpbmcgZ2x5cGhz LCBhbmQgcmVmcmFpbiBmcm9tIHByb2R1Y2luZyB0aGUgbGluZQogCSBudW1iZXIsIGlmIHdlIGRv bid0IGhhdmUgZW5vdWdoIHNwYWNlIG9uIHRoaXMgbGluZS4gICovCkBAIC0yMTI4NCw2ICsyNTk0 OSwzMCBAQCBtYXliZV9wcm9kdWNlX2xpbmVfbnVtYmVyIChzdHJ1Y3QgaXQgKml0KQogCX0KICAg ICB9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgTGlzcF9PYmplY3QgYnVmID0gaXQtPnctPmNvbnRlbnRzOworICBDSEVDS19CVUZGRVIg KGJ1Zik7CisgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChidWYpOworICBzdHJ1Y3QgYnVm ZmVyICpvbGRfYnVmZmVyID0gTlVMTDsKKyAgLyogTmVlZGVkIHNvIHRoYXQgYnVmZmVyLWxvY2Fs IHZhbHVlcyBjYW4gYmUgZGV0ZXJtaW5lZDsgZS5nLiwgd2hlbiBzd2l0Y2hpbmcKKyAgdG8gdGhl IG1pbmlidWZmZXIuICovCisgIGlmIChiICE9IGN1cnJlbnRfYnVmZmVyKQorICAgIHsKKyAgICAg IG9sZF9idWZmZXIgPSBjdXJyZW50X2J1ZmZlcjsKKyAgICAgIHNldF9idWZmZXJfaW50ZXJuYWwg KGIpOworICAgIH0KKyAgaXQtPnctPm1jLmxudW1fcGl4ZWxfd2lkdGggPSAoIU5JTFAgKFZkaXNw bGF5X2xpbmVfbnVtYmVycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0ZW1f aXQuY3VycmVudF94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAwOworICBpZiAo b2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBSZWNvcmQgdGhlIHdpZHRoIGluIHBpeGVs cyB3ZSBuZWVkIGZvciB0aGUgbGluZSBudW1iZXIgZGlzcGxheS4gICovCiAgIGl0LT5sbnVtX3Bp eGVsX3dpZHRoID0gdGVtX2l0LmN1cnJlbnRfeDsKICAgLyogQ29weSB0aGUgcHJvZHVjZWQgZ2x5 cGhzIGludG8gSVQncyBnbHlwaF9yb3cuICAqLwpAQCAtMjcwOTIsNiArMzE3ODEsMjEgQEAgYXBw ZW5kX2dseXBoIChzdHJ1Y3QgaXQgKml0KQogCSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0 LT5nbHlwaF9yb3ctPmdseXBoc1thcmVhXTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT54ID0gaXQtPmN1cnJl bnRfeDsKKyAgICAgIGdseXBoLT55ID0gaXQtPmN1cnJlbnRfeTsKKyAgICAgIGdseXBoLT5ocG9z ID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+dnBvcyA9IGl0LT52cG9zOworICAgICAgZ2x5cGgt Pnp2X3AgPSBpdC0+enZfcDsKKyAgICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0 KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3Mg PSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwogICAgICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmpl Y3Q7CiAgICAgICBpZiAoaXQtPnBpeGVsX3dpZHRoID4gMCkKQEAgLTI3MTc1LDYgKzMxODc5LDIx IEBAIGFwcGVuZF9jb21wb3NpdGVfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJICAgIGdbMV0gPSAq ZzsKIAkgIGdseXBoID0gaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2l0LT5hcmVhXTsKIAl9CisKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAg IGdseXBoLT54ID0gaXQtPmN1cnJlbnRfeDsKKyAgICAgIGdseXBoLT55ID0gaXQtPmN1cnJlbnRf eTsKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+dnBvcyA9IGl0 LT52cG9zOworICAgICAgZ2x5cGgtPnp2X3AgPSBpdC0+enZfcDsKKyAgICAgIGdseXBoLT5ieXRl cG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBpdC0+Y21wX2l0LmNoYXJwb3M7CiAgICAgICBnbHlwaC0+ b2JqZWN0ID0gaXQtPm9iamVjdDsKICAgICAgIGVhc3NlcnQgKGl0LT5waXhlbF93aWR0aCA8PSBT SFJUX01BWCk7CkBAIC0yNzM4Myw2ICszMjEwMiwyMSBAQCBwcm9kdWNlX2ltYWdlX2dseXBoIChz dHJ1Y3QgaXQgKml0KQogCX0KICAgICAgIGlmIChnbHlwaCA8IGl0LT5nbHlwaF9yb3ctPmdseXBo c1thcmVhICsgMV0pCiAJeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7CisgICAgICBn bHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOwor ICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKyAgICAgIGdseXBoLT56dl9wID0gaXQtPnp2 X3A7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKIAkgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBv c2l0aW9uKTsKIAkgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogCSAgZ2x5cGgtPnBpeGVs X3dpZHRoID0gY2xpcF90b19ib3VuZHMgKC0xLCBpdC0+cGl4ZWxfd2lkdGgsIFNIUlRfTUFYKTsK QEAgLTI3NDg2LDYgKzMyMjIwLDIxIEBAIHByb2R1Y2VfeHdpZGdldF9nbHlwaCAoc3RydWN0IGl0 ICppdCkKIAl9CiAgICAgICBpZiAoZ2x5cGggPCBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYSAr IDFdKQogCXsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNP UlMgKi8KKworICAgICAgZ2x5cGgtPnggPSBpdC0+Y3VycmVudF94OworICAgICAgZ2x5cGgtPnkg PSBpdC0+Y3VycmVudF95OworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGds eXBoLT52cG9zID0gaXQtPnZwb3M7CisgICAgICBnbHlwaC0+enZfcCA9IGl0LT56dl9wOworICAg ICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAJICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7 CiAJICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9 IGNsaXBfdG9fYm91bmRzICgtMSwgaXQtPnBpeGVsX3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzU3 Miw2ICszMjMyMSwyMSBAQCBhcHBlbmRfc3RyZXRjaF9nbHlwaCAoc3RydWN0IGl0ICppdCwgTGlz cF9PYmplY3Qgb2JqZWN0LAogCSAgICB3aWR0aCAtPSBpdC0+Zmlyc3RfdmlzaWJsZV94IC0gaXQt PmN1cnJlbnRfeDsKIAkgIGVhc3NlcnQgKHdpZHRoID4gMCk7CiAJfQorCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9 IGl0LT5jdXJyZW50X3g7CisgICAgICBnbHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICBn bHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKyAg ICAgIGdseXBoLT56dl9wID0gaXQtPnp2X3A7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZ VEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBo LT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3Qg PSBvYmplY3Q7CiAgICAgICAvKiBGSVhNRTogSXQgd291bGQgYmUgYmV0dGVyIHRvIHVzZSBUWVBF X01BWCBoZXJlLCBidXQKQEAgLTI4MDI2LDYgKzMyNzkwLDIxIEBAIGFwcGVuZF9nbHlwaGxlc3Nf Z2x5cGggKHN0cnVjdCBpdCAqaXQsIGludCBmYWNlX2lkLCBib29sIGZvcl9ub19mb250LCBpbnQg bGVuLAogCSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1th cmVhXTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJT T1JTICovCisKKyAgICAgIGdseXBoLT54ID0gaXQtPmN1cnJlbnRfeDsKKyAgICAgIGdseXBoLT55 ID0gaXQtPmN1cnJlbnRfeTsKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBn bHlwaC0+dnBvcyA9IGl0LT52cG9zOworICAgICAgZ2x5cGgtPnp2X3AgPSBpdC0+enZfcDsKKyAg ICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRp b24pOwogICAgICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBlYXNzZXJ0IChp dC0+cGl4ZWxfd2lkdGggPD0gU0hSVF9NQVgpOwpAQCAtMjkwNzYsMTAgKzMzODU1LDM1IEBAIHhf aW5zZXJ0X2dseXBocyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqdXBkYXRl ZF9yb3csCiAKICAgLyogV3JpdGUgdGhlIGdseXBocy4gICovCiAgIGhwb3MgPSBzdGFydCAtIHJv dy0+Z2x5cGhzW3VwZGF0ZWRfYXJlYV07CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKCh3LT5tY19tYXRyaXguY3Vyc29yc191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BTF9URVhULCAwKTsKIAorLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogICAvKiBBZHZhbmNlIHRoZSBvdXRwdXQgY3Vyc29yLiAgKi8KICAgdy0+ b3V0cHV0X2N1cnNvci5ocG9zICs9IGxlbjsKICAgdy0+b3V0cHV0X2N1cnNvci54ICs9IHNoaWZ0 X2J5X3dpZHRoOwpAQCAtMjk1MDUsOSArMzQzMDksMzMgQEAgeF9maXhfb3ZlcmxhcHBpbmdfYXJl YSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LAogCSAgd2hpbGUgKGkg PCByb3ctPnVzZWRbYXJlYV0KIAkJICYmIHJvdy0+Z2x5cGhzW2FyZWFdW2ldLm92ZXJsYXBzX3Zl cnRpY2FsbHlfcCk7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1D VVJTT1JTICovCisKKyAgICAgICAgaWYgKCh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NB Q0hFXSA+IDAKKyAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NB Q0hFXSA+IDAKKyAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NB Q0hFXSA+IDApCisgICAgICAgICAgICAmJiBhcmVhID09IFRFWFRfQVJFQSkKKyAgICAgICAgICB7 CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21h dHJpeDsKKyAgICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJp eCk7CisgICAgICAgICAgICBpbnQgc3RhcnRfaHBvcyA9IHN0YXJ0OworICAgICAgICAgICAgaW50 IGVuZF9ocG9zID0gaTsKKyAgICAgICAgICAgIGJvb2wgY2xlYXJfZW9sX3AgPSBmYWxzZTsKKyAg ICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCA9IERSQVdfTk9STUFMX1RFWFQ7Cisg ICAgICAgICAgICBUUkFDRSAoKHN0ZGVyciwgInhfZml4X292ZXJsYXBwaW5nX2FyZWEgKCVkKTog IHN0YXJ0X3ggKCVkKSB8IHN0YXJ0X2hwb3MgKCVkKSB8IGVuZF9ocG9zICglZClcbiIsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hw b3MpKTsKKyAgICAgICAgICAgIG1jX3JlZHJhd19yb3cgKHcsIG1hdHJpeCwgcm93LCBzdGFydF94 LCBzdGFydF9ocG9zLCBlbmRfaHBvcywgY2xlYXJfZW9sX3AsIGhsKTsKKyAgICAgICAgICB9Cisg ICAgICAgICAgZWxzZQogCSAgZHJhd19nbHlwaHMgKHcsIHN0YXJ0X3gsIHJvdywgYXJlYSwKIAkJ ICAgICAgIHN0YXJ0LCBpLAogCQkgICAgICAgRFJBV19OT1JNQUxfVEVYVCwgb3ZlcmxhcHMpOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJfQogICAgICAgZWxzZQogCXsKQEAgLTI5 NzU4LDEwICszNDU4NiwxNyBAQCBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2luZG93 ICp3LCBib29sIG9uLAogICBuZXdfY3Vyc29yX3R5cGUgPSBnZXRfd2luZG93X2N1cnNvcl90eXBl ICh3LCBnbHlwaCwKIAkJCQkJICAgICZuZXdfY3Vyc29yX3dpZHRoLCAmYWN0aXZlX2N1cnNvcik7 CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK ICAgLyogSWYgY3Vyc29yIGlzIGN1cnJlbnRseSBiZWluZyBzaG93biBhbmQgd2UgZG9uJ3Qgd2Fu dCBpdCB0byBiZSBvcgogICAgICBpdCBpcyBpbiB0aGUgd3JvbmcgcGxhY2UsIG9yIHRoZSBjdXJz b3IgdHlwZSBpcyBub3Qgd2hhdCB3ZSB3YW50LAogICAgICBlcmFzZSBpdC4gICovCiAgIGlmICh3 LT5waHlzX2N1cnNvcl9vbl9wCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgbWNfY29uZikpCiAgICAgICAmJiAoIW9uCiAJICB8fCB3LT5waHlzX2N1cnNvci54 ICE9IHgKIAkgIHx8IHctPnBoeXNfY3Vyc29yLnkgIT0geQpAQCAtMjk3NzQsNiArMzQ2MDksOSBA QCBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9uLAogCSAg ICAgICYmIG5ld19jdXJzb3Jfd2lkdGggIT0gdy0+cGh5c19jdXJzb3Jfd2lkdGgpKSkKICAgICBl cmFzZV9waHlzX2N1cnNvciAodyk7CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAg LyogRG9uJ3QgY2hlY2sgcGh5c19jdXJzb3Jfb25fcCBoZXJlIGJlY2F1c2UgdGhhdCBmbGFnIGlz IG9ubHkgc2V0CiAgICAgIHRvIGZhbHNlIGluIHNvbWUgY2FzZXMgd2hlcmUgd2Uga25vdyB0aGF0 IHRoZSBjdXJzb3IgaGFzIGJlZW4KICAgICAgY29tcGxldGVseSBlcmFzZWQsIHRvIGF2b2lkIHRo ZSBleHRyYSB3b3JrIG9mIGVyYXNpbmcgdGhlIGN1cnNvcgpAQCAtMjk3OTIsOSArMzQ2MzAsMTkg QEAgZGlzcGxheV9hbmRfc2V0X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBvbiwKICAg ICAgIHctPnBoeXNfY3Vyc29yLnZwb3MgPSB2cG9zOwogICAgIH0KIAotICBGUkFNRV9SSUYgKGYp LT5kcmF3X3dpbmRvd19jdXJzb3IgKHcsIGdseXBoX3JvdywgeCwgeSwKLSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBuZXdfY3Vyc29yX3R5cGUsIG5ld19jdXJzb3Jfd2lkdGgs Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb24sIGFjdGl2ZV9jdXJzb3Ip OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICBpZiAoTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAg ICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisg ICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkKKyAg ICBGUkFNRV9SSUYgKGYpLT5kcmF3X3dpbmRvd19jdXJzb3IgKHcsIGdseXBoX3JvdywgeCwgeSwg bmV3X2N1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg bmV3X2N1cnNvcl93aWR0aCwgb24sIGFjdGl2ZV9jdXJzb3IpOworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiB9CiAKIApAQCAtMjk4ODcsNyArMzQ3MzUsMjkgQEAgZHJhd19yb3dfd2l0 aF9tb3VzZV9mYWNlIChzdHJ1Y3Qgd2luZG93ICp3LCBpbnQgc3RhcnRfeCwgc3RydWN0IGdseXBo X3JvdyAqcm93LAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogICBpZiAoRlJBTUVfV0lORE9X X1AgKFhGUkFNRSAody0+ZnJhbWUpKSkKICAgICB7CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGlmICh3LT5tY19tYXRyaXguY3Vy c29yc191c2VkW01DX0NBQ0hFXSA+IDAKKyAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29y c191c2VkW0NIX0NBQ0hFXSA+IDAKKyAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191 c2VkW0ZDX0NBQ0hFXSA+IDApCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0 cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgICAgICBpbnQgdnBvcyA9IE1B VFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAgIGJvb2wgY2xlYXJfZW9sX3Ag PSBmYWxzZTsKKyAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UgaGwgPSBkcmF3OworICAg ICAgICAgIFRSQUNFICgoc3RkZXJyLCAiZHJhd19yb3dfd2l0aF9tb3VzZV9mYWNlICglZCk6ICBz dGFydF94ICglZCkgfCBzdGFydF9ocG9zICglZCkgfCBlbmRfaHBvcyAoJWQpXG4iLAorICAgICAg ICAgICAgICAgICAgICAgICAgICB2cG9zLCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcykp OworICAgICAgICAgIG1jX3JlZHJhd19yb3cgKHcsIG1hdHJpeCwgcm93LCBzdGFydF94LCBzdGFy dF9ocG9zLCBlbmRfaHBvcywgY2xlYXJfZW9sX3AsIGhsKTsKKyAgICAgICAgfQorICAgICAgICBl bHNlCiAgICAgICBkcmF3X2dseXBocyAodywgc3RhcnRfeCwgcm93LCBURVhUX0FSRUEsIHN0YXJ0 X2hwb3MsIGVuZF9ocG9zLCBkcmF3LCAwKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogICAgICAgcmV0dXJuOwogICAgIH0KICNlbmRpZgpAQCAtMzE5NDUsMTEgKzM2ODE1LDM2IEBA IGV4cG9zZV9hcmVhIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIFhS ZWN0YW5nbGUgKnIsCiAgIHN0cnVjdCBnbHlwaCAqbGFzdDsKICAgaW50IGZpcnN0X3gsIHN0YXJ0 X3gsIHg7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYmIHJvdy0+ZmlsbF9saW5lX3ApCisgICAg eworICAgICAgaWYgKHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVdID4gMAorICAg ICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hfQ0FDSEVdID4gMAorICAgICAg ICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVdID4gMCkKKyAgICAgICAg eworICAgICAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0 cml4OworICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7 CisgICAgICAgICAgaW50IHN0YXJ0X3ggPSAwOworICAgICAgICAgIGludCBzdGFydF9ocG9zID0g MDsKKyAgICAgICAgICBpbnQgZW5kX2hwb3MgPSByb3ctPnVzZWRbVEVYVF9BUkVBXTsKKyAgICAg ICAgICBib29sIGNsZWFyX2VvbF9wID0gZmFsc2U7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBo c19mYWNlIGhsID0gRFJBV19OT1JNQUxfVEVYVDsKKyAgICAgICAgICBUUkFDRSAoKHN0ZGVyciwg ImV4cG9zZV9hcmVhICglZCk6ICBXcml0ZSB0aGUgd2hvbGUgbGluZS5cbiIsIHZwb3MpKTsKKyAg ICAgICAgICBtY19yZWRyYXdfcm93ICh3LCBtYXRyaXgsIHJvdywgc3RhcnRfeCwgc3RhcnRfaHBv cywgZW5kX2hwb3MsIGNsZWFyX2VvbF9wLCBobCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQog ICAgIC8qIElmIHJvdyBleHRlbmRzIGZhY2UgdG8gZW5kIG9mIGxpbmUgd3JpdGUgdGhlIHdob2xl IGxpbmUuICAqLwogICAgIGRyYXdfZ2x5cGhzICh3LCAwLCByb3csIGFyZWEsCiAJCSAwLCByb3ct PnVzZWRbYXJlYV0sCiAJCSBEUkFXX05PUk1BTF9URVhULCAwKTsKKyAgICB9CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgZWxzZQogICAgIHsKICAgICAgIC8qIFNldCBTVEFSVF9Y IHRvIHRoZSB3aW5kb3ctcmVsYXRpdmUgc3RhcnQgcG9zaXRpb24gZm9yIGRyYXdpbmcgZ2x5cGhz IG9mCkBAIC0zMTk4MSwxMSArMzY4NzYsMzYgQEAgZXhwb3NlX2FyZWEgKHN0cnVjdCB3aW5kb3cg KncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgWFJlY3RhbmdsZSAqciwKIAkgICsrbGFzdDsKIAl9 CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK ICAgICAgIC8qIFJlcGFpbnQuICAqLwotICAgICAgaWYgKGxhc3QgPiBmaXJzdCkKKyAgICAgIC8q IEZsb2F0aW5nIGZha2UgY3Vyc29ycyB3aWxsIGV4aXN0IHdoZW4gKGxhc3QgPT0gZmlyc3QpLiAq LworICAgICAgaWYgKCh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA+IDAKKyAg ICAgICAgICAgfHwgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtDSF9DQUNIRV0gPiAwCisgICAg ICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVdID4gMCkKKyAgICAg ICAgICAmJiBhcmVhID09IFRFWFRfQVJFQSkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBn bHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgICAgIGludCB2 cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAgICAgICAgc3RhcnRfeCA9 IGZpcnN0X3ggLSBzdGFydF94OworICAgICAgICAgIGludCBzdGFydF9ocG9zID0gZmlyc3QgLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgIGludCBlbmRfaHBvcyA9IGxhc3QgLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgIGJvb2wgY2xlYXJfZW9sX3AgPSBmYWxz ZTsKKyAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UgaGwgPSBEUkFXX05PUk1BTF9URVhU OworICAgICAgICAgIFRSQUNFICgoc3RkZXJyLCAiZXhwb3NlX2FyZWEgKCVkKTogIHN0YXJ0X3gg KCVkKSB8IHN0YXJ0X2hwb3MgKCVkKSB8IGVuZF9ocG9zICglZClcbiIsCisgICAgICAgICAgICAg ICAgICAgICAgICAgIHZwb3MsIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zKSk7CisgICAg ICAgICAgbWNfcmVkcmF3X3JvdyAodywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3Ms IGVuZF9ocG9zLCBjbGVhcl9lb2xfcCwgaGwpOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYg KGxhc3QgPiBmaXJzdCkKIAlkcmF3X2dseXBocyAodywgZmlyc3RfeCAtIHN0YXJ0X3gsIHJvdywg YXJlYSwKIAkJICAgICBmaXJzdCAtIHJvdy0+Z2x5cGhzW2FyZWFdLCBsYXN0IC0gcm93LT5nbHlw aHNbYXJlYV0sCiAJCSAgICAgRFJBV19OT1JNQUxfVEVYVCwgMCk7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKICAgICB9CiB9CiAKQEAgLTMxOTk5LDEwICszNjkxOSwzNSBAQCBleHBv c2VfbGluZSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBYUmVjdGFu Z2xlICpyKQogewogICBlYXNzZXJ0IChyb3ctPmVuYWJsZWRfcCk7CiAKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgaWYgKHJvdy0+bW9kZV9s aW5lX3AgfHwgdy0+cHNldWRvX3dpbmRvd19wKQorICAgIHsKKyAgICAgIGlmICh3LT5tY19tYXRy aXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA+IDAKKyAgICAgICAgICB8fCB3LT5tY19tYXRyaXgu Y3Vyc29yc191c2VkW0NIX0NBQ0hFXSA+IDAKKyAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vy c29yc191c2VkW0ZDX0NBQ0hFXSA+IDApCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5 cGhfbWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgICAgICBpbnQgdnBv cyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAgIGludCBzdGFydF94 ID0gMDsKKyAgICAgICAgICBpbnQgc3RhcnRfaHBvcyA9IDA7CisgICAgICAgICAgaW50IGVuZF9o cG9zID0gcm93LT51c2VkW1RFWFRfQVJFQV07CisgICAgICAgICAgYm9vbCBjbGVhcl9lb2xfcCA9 IGZhbHNlOworICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCA9IERSQVdfTk9STUFM X1RFWFQ7CisgICAgICAgICAgVFJBQ0UgKChzdGRlcnIsICJleHBvc2VfbGluZSAoJWQpOiAgV3Jp dGUgdGhlIHdob2xlIGxpbmUuXG4iLCB2cG9zKSk7CisgICAgICAgICAgbWNfcmVkcmF3X3JvdyAo dywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBjbGVhcl9lb2xf cCwgaGwpOworICAgICAgICB9CisgICAgICAgIGVsc2UKICAgICBkcmF3X2dseXBocyAodywgMCwg cm93LCBURVhUX0FSRUEsCiAJCSAwLCByb3ctPnVzZWRbVEVYVF9BUkVBXSwKIAkJIERSQVdfTk9S TUFMX1RFWFQsIDApOworICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBl bHNlCiAgICAgewogICAgICAgaWYgKHJvdy0+dXNlZFtMRUZUX01BUkdJTl9BUkVBXSkKQEAgLTMy NTUwLDYgKzM3NDk1LDIyIEBAIHhfaW50ZXJzZWN0X3JlY3RhbmdsZXMgKFhSZWN0YW5nbGUgKnIx LCBYUmVjdGFuZ2xlICpyMiwgWFJlY3RhbmdsZSAqcmVzdWx0KQogdm9pZAogc3ltc19vZl94ZGlz cCAodm9pZCkKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworICBkZWZzdWJyICgmU21jX2R1bXBfZ2x5cGhfcm93KTsKKworICBkZWZzdWJy ICgmU21jX2R1bXBfZ2x5cGhfbWF0cml4KTsKKworICBkZWZzdWJyICgmU21jX2N1cnJlbnRfY29s dW1uKTsKKworICBkZWZzdWJyICgmU21jX3N0ZGVycik7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgVndpdGhfZWNob19hcmVhX3NhdmVfdmVjdG9yID0gUW5pbDsKICAgc3RhdGlj cHJvICgmVndpdGhfZWNob19hcmVhX3NhdmVfdmVjdG9yKTsKIApkaWZmIC0tZ2l0IGEvc3JjL3h0 ZXJtLmMgYi9zcmMveHRlcm0uYwppbmRleCA1YWEzZTNmLi45NWI2ZTA2IDEwMDY0NAotLS0gYS9z cmMveHRlcm0uYworKysgYi9zcmMveHRlcm0uYwpAQCAtMTMyLDYgKzEzMiw4NjkgQEAgYWxvbmcg d2l0aCBHTlUgRW1hY3MuICBJZiBub3QsIHNlZS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YQ2hhbmdl R0MgKGRweSwgZ2MsIG1hc2ssICZ4Z2N2KTsKKyAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAg ICAgIGdjID0gWENyZWF0ZUdDIChkcHksIHdpbmRvdywgbWFzaywgJnhnY3YpOworICAgICAgICAg IEZSQU1FX0RJU1BMQVlfSU5GTyAoZiktPnNjcmF0Y2hfY3Vyc29yX2djID0gZ2M7CisgICAgICAg IH0KKyAgICAgIHhfY2xpcF90b19yb3cgKHcsIHJvdywgVEVYVF9BUkVBLCBnYyk7CisgICAgICB4 X2ZpbGxfcmVjdGFuZ2xlIChmLCBnYywgZngsIGZ5LCB3ZCwgaCk7CisgICAgICB4X3Jlc2V0X2Ns aXBfcmVjdGFuZ2xlcyAoZiwgZ2MpOworICAgIH0KK30KKworLyogUklGOiBEcmF3IGN1cnNvciBv biB3aW5kb3cgVy4gKi8KK3N0YXRpYyB2b2lkCittY194X2RyYXdfd2luZG93X2N1cnNvciAoc3Ry dWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhf cm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHgsIGludCBmeCwgaW50IHks IGludCBmeSwgaW50IGhwb3MsIGludCB2cG9zLCBpbnQgd2QsCisgICAgICAgICAgICAgICAgICAg ICAgICAgaW50IGgsIHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNv cl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGgsIGVudW0g bWNfZmxhdm9yIGdseXBoX2ZsYXZvciwgYm9vbCBvbl9wLAorICAgICAgICAgICAgICAgICAgICAg ICAgIGJvb2wgYWN0aXZlX3ApCit7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9X X0ZSQU1FICh3KSk7CisgIC8qIFRoZSBmcmluZ2UgYml0bWFwcy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ICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChi LCBtYXJrX2FjdGl2ZSkpKTsKKyAgICAgIHB0cmRpZmZfdCByZWdpb25fYmVnaW5uaW5nID0gKHJl Z2lvbl9hY3RpdmVfcCkgPyBYRklYTlVNIChGcmVnaW9uX2JlZ2lubmluZyAoKSkgOiAtMTsKKyAg ICAgIHB0cmRpZmZfdCByZWdpb25fZW5kID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBYRklYTlVNIChG cmVnaW9uX2VuZCAoKSkgOiAtMTsKKyAgICAgIHB0cmRpZmZfdCBvcG9pbnRfcHQgPSAodyA9PSBY V0lORE9XIChzZWxlY3RlZF93aW5kb3cpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g UFQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFhGSVhOVU0gKEZtYXJrZXJfcG9zaXRp b24gKHctPnBvaW50bSkpOworICAgICAgYm9vbCByZWdpb25faW5fYm91bmRzX3AgPSAocmVnaW9u X2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfcHQg Pj0gcmVnaW9uX2JlZ2lubmluZworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b3BvaW50X3B0IDwgcmVnaW9uX2VuZCk7CisgICAgICBpZiAoY3Vyc29yX2dseXBoLT50eXBlICE9 IElNQUdFX0dMWVBIICYmIGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1 ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5v dXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAgICAgICAgICBmdW5j dGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHhmbnMuYy4gKi8KKyAgICAgICAgICBpZiAocmVn aW9uX2FjdGl2ZV9w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SQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9nYywgeGdjdi5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAg ICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3Bp eGVsJy4gKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xv ci5waXhlbDsKKyAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCBy b3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgIGYtPm91dHB1 dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAg fQorICAgICAgICBlbHNlIGlmIChjdXJzb3JfZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEggJiYg bHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAg ICAgeworICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54 LT5jdXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29y X3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNv ciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAg ICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29y X3BpeGVsOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29y X2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhf bWFrZV9nYycgaW4geGZucy5jLiAqLworICAgICAgICAgICAgICBpZiAocmVnaW9uX2FjdGl2ZV9w CisgICAgICAgICAgICAgICAgICAmJiByZWdpb25faW5fYm91bmRzX3AKKyAgICAgICAgICAgICAg ICAgICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGVu dW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9mYWNlX2lkID0gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1yZWdpb24tZmFjZSIpLCB0cnVl KTsKKyAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9m YWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9mYWNlX2lkKTsKKyAg ICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29r dXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWZhY2UiKSwg dHJ1ZSk7CisgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNl ID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAg ICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAg ICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRf ZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2UtPmJhY2tncm91bmQp OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0 aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcmVnaW9uX2luX2JvdW5kc19wCisg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9v dXRfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFr ZS1jdXJzb3ItcmVnaW9uLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIHN0cnVj dCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwg aG9sbG93X2FjdGl2ZV9yZWdpb25fb3V0X2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBl bnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lE IChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBYU2V0Rm9y ZWdyb3VuZCAoRlJBTUVfWF9ESVNQT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lz IF9ub3RfIHZpc2libGUgaW4gdGhlIGluYWN0aXZlIHdpbmRvdyBiZWNhdXNlIHRoZSBvdmVybGF5 IHdpbmRvdyBwcm9wZXJ0eSBpcyB1c2VkLiAqLworICAgICAgICAgICAgICAgICAgICBlbHNlIGlm ICghYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVk X2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1mYWNlIiks IHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19pbmFj dGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7Cisg ICAgICAgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChm KSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfaW5hY3RpdmVfZmFjZS0+Zm9y ZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVf WF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfaW5hY3Rp dmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyogRm9yY2UgYG1jX3hfc2V0X2N1 cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MnLiAqLworICAg ICAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgbWNfZHJh d19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBv cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbCwgZ2x5cGhfZmxhdm9y LCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJB TUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmZvcmVn cm91bmQpOworICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChm KSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmJhY2tncm91bmQpOworICAgICAg ICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAgICAvKiBEcmF3IHRoZSBmcmFt ZSBhcm91bmQgdGhlIGJveC4gKi8KKyAgICAgICAgICAgICAgbWNfeF9kcmF3X2hvbGxvd19jdXJz b3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAg ICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0hPTExPV19CT1g6 CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wu Ymx1ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBm LT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9k YXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgIG1jX3hfZHJhd19o b2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3 ZCwgaCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2lu YWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBtY194 X2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywg dnBvcywgd2QsIGgpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfRklMTEVEX0JP WDoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxz bC5ibHVlID49IDApCisgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2Rh dGEueC0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgIGZ1bmN0aW9uYWxpdHkg b2YgYHhfbWFrZV9nYycgaW4geGZucy5jLiAqLworICAgICAgICB7CisgICAgICAgICAgYmxvY2tf aW5wdXQgKCk7CisgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiks IGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgRlJBTUVfQkFDS0dST1VORF9QSVhFTCAoZikp OworICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRw dXRfZGF0YS54LT5jdXJzb3JfZ2MsIGNvbG9yLnBpeGVsKTsKKyAgICAgICAgICAvKiBGb3JjZSBg bWNfeF9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9n YycuICovCisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAgICAgICAgbWNf ZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywg dnBvcywgbHNsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3Is IGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICBYU2V0 Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29y X2djLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9Y X0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIHhnY3YuYmFja2dyb3Vu ZCk7CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgfQorICAgICAgICBlbHNl CisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IGZhbHNlOworICAg ICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNP UiwgeCwgaHBvcywgdnBvcywgbHNsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOwor ICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0JBUjoKKyAgICB7 CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49 IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1 dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+ Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52 aXNpYmxlX29rYXlfcCA9IHRydWU7CisgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcs IG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2lu dmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhl bCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAg ICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IGZh bHNlOworICAgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4 LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlf cCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfSEJBUjoK KyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5i bHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYt Pm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAgZi0+b3V0cHV0X2Rh dGEueC0+Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3Jf Z2NfaW52aXNpYmxlX29rYXlfcCA9IHRydWU7CisgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJz b3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNv cl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJz b3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxz ZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5 X3AgPSBmYWxzZTsKKyAgICAgICAgICAgIG1jX3hfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgs IHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2li bGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgZGVmYXVs dDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICB9CisgICAgICAgIH0KKyNpZmRlZiBIQVZFX1hf STE4TgorICBpZiAodyA9PSBYV0lORE9XIChmLT5zZWxlY3RlZF93aW5kb3cpKQorICAgIGlmIChG UkFNRV9YSUMgKGYpICYmIChGUkFNRV9YSUNfU1RZTEUgKGYpICYgWElNUHJlZWRpdFBvc2l0aW9u KSkKKyAgICAgIHhpY19zZXRfcHJlZWRpdGFyZWEgKHcsIHgsIHkpOworI2VuZGlmCisgICAgfQor ICBYRmx1c2ggKEZSQU1FX1hfRElTUExBWSAoZikpOworfQorCisvKiBEcmF3IHN0cmV0Y2ggZ2x5 cGggc3RyaW5nIFMuICovCitzdGF0aWMgdm9pZAorbWNfeF9kcmF3X3N0cmV0Y2hfZ2x5cGhfc3Ry aW5nIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzKQoreworICBlYXNzZXJ0IChzLT5maXJzdF9nbHlw aC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKTsKKyAgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisg ICAgICAmJiAheF9zdHJldGNoX2N1cnNvcl9wKQorICAgIHsKKyAgICAgIC8qIElmIGB4LXN0cmV0 Y2gtY3Vyc29yJyBpcyBuaWwsIGRvbid0IGRyYXcgYSBibG9jayBjdXJzb3IgYXMgd2lkZSBhcyB0 aGUKKyAgICAgIHN0cmV0Y2ggZ2x5cGguICovCisgICAgICBpbnQgd2lkdGgsIGJhY2tncm91bmRf d2lkdGggPSBzLT5iYWNrZ3JvdW5kX3dpZHRoOworICAgICAgaW50IHggPSBzLT54OworICAgICAg aWYgKCFzLT5yb3ctPnJldmVyc2VkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgbGVmdF94 ID0gd2luZG93X2JveF9sZWZ0X29mZnNldCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICBp ZiAoeCA8IGxlZnRfeCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgYmFja2dyb3VuZF93 aWR0aCAtPSBsZWZ0X3ggLSB4OworICAgICAgICAgICAgICB4ID0gbGVmdF94OworICAgICAgICAg ICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICAv KiBJbiBSMkwgcm93cywgZHJhdyB0aGUgY3Vyc29yIG9uIHRoZSByaWdodCBlZGdlIG9mIHRoZQor ICAgICAgICAgICAgICAgc3RyZXRjaCBnbHlwaC4gKi8KKyAgICAgICAgICAgIGludCByaWdodF94 ID0gd2luZG93X2JveF9yaWdodCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgIGlmICh4 ICsgYmFja2dyb3VuZF93aWR0aCA+IHJpZ2h0X3gpCisgICAgICAgICAgICAgIGJhY2tncm91bmRf d2lkdGggLT0geCAtIHJpZ2h0X3g7CisgICAgICAgICAgICB4ICs9IGJhY2tncm91bmRfd2lkdGg7 CisgICAgICAgICAgfQorICAgICAgd2lkdGggPSBtaW4gKEZSQU1FX0NPTFVNTl9XSURUSCAocy0+ ZiksIGJhY2tncm91bmRfd2lkdGgpOworICAgICAgaWYgKHMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAg ICAgICAgeCAtPSB3aWR0aDsKKyAgICAgIC8qIERyYXcgY3Vyc29yLiAqLworICAgICAgeF9kcmF3 X2dseXBoX3N0cmluZ19iZ19yZWN0IChzLCB4LCBzLT55LCB3aWR0aCwgcy0+aGVpZ2h0KTsKKyAg ICAgIC8qIENsZWFyIHJlc3QgdXNpbmcgdGhlIEdDIG9mIHRoZSBvcmlnaW5hbCBub24tY3Vyc29y IGZhY2UuICovCisgICAgICBpZiAod2lkdGggPCBiYWNrZ3JvdW5kX3dpZHRoKQorICAgICAgICB7 CisgICAgICAgICAgaW50IHkgPSBzLT55OworICAgICAgICAgIGludCB3ID0gYmFja2dyb3VuZF93 aWR0aCAtIHdpZHRoLCBoID0gcy0+aGVpZ2h0OworICAgICAgICAgIFhSZWN0YW5nbGUgcjsKKyAg ICAgICAgICBHQyBnYzsKKyAgICAgICAgICBpZiAoIXMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAg ICAgICAgIHggKz0gd2lkdGg7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeCA9IHMtPng7 CisgICAgICAgICAgaWYgKHMtPnJvdy0+bW91c2VfZmFjZV9wCisgICAgICAgICAgICAgICYmIGN1 cnNvcl9pbl9tb3VzZV9mYWNlX3AgKHMtPncpKQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICB4X3NldF9tb3VzZV9mYWNlX2djIChzKTsKKyAgICAgICAgICAgICAgZ2MgPSBzLT5nYzsKKyAg ICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBnYyA9IHMtPmZhY2UtPmdj OworICAgICAgICAgIGdldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCAmcik7CisgICAgICAg ICAgeF9zZXRfY2xpcF9yZWN0YW5nbGVzIChzLT5mLCBnYywgJnIsIDEpOworICAgICAgICAgIGlm IChzLT5mYWNlLT5zdGlwcGxlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBGaWxs IGJhY2tncm91bmQgd2l0aCBhIHN0aXBwbGUgcGF0dGVybi4gKi8KKyAgICAgICAgICAgICAgWFNl dEZpbGxTdHlsZSAocy0+ZGlzcGxheSwgZ2MsIEZpbGxPcGFxdWVTdGlwcGxlZCk7CisgICAgICAg ICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIGdjLCB4LCB5LCB3LCBoKTsKKyAgICAgICAg ICAgICAgWFNldEZpbGxTdHlsZSAocy0+ZGlzcGxheSwgZ2MsIEZpbGxTb2xpZCk7CisgICAgICAg ICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBYR0NW YWx1ZXMgeGdjdjsKKyAgICAgICAgICAgICAgWEdldEdDVmFsdWVzIChzLT5kaXNwbGF5LCBnYywg R0NGb3JlZ3JvdW5kIHwgR0NCYWNrZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgIFhTZXRG b3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBnYywgeGdjdi5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICAg ICAgeF9maWxsX3JlY3RhbmdsZSAocy0+ZiwgZ2MsIHgsIHksIHcsIGgpOworICAgICAgICAgICAg ICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgZ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AgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5n X2NsaXBwaW5nIChuZXh0KTsKKyAgICAgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlw ZSA9PSBTVFJFVENIX0dMWVBIKQorICAgICAgICAgICAgICBtY194X2RyYXdfc3RyZXRjaF9nbHlw aF9zdHJpbmcgKG5leHQpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB4X2RyYXdf Z2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKG5leHQsIHRydWUpOworICAgICAgICAgICAgbmV4dC0+ bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICB9CisgICAgfQorICAvKiBTZXQgdXAgUy0+Z2MsIHNl dCBjbGlwcGluZyBhbmQgZHJhdyBTLiAqLworICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHMs IGN1cnNvcl9nY19wKTsKKyAgLyogRHJhdyByZWxpZWYgKGlmIGFueSkgaW4gYWR2YW5jZSBmb3Ig Y2hhci9jb21wb3NpdGlvbiBzbyB0aGF0IHRoZQorICAgICBnbHlwaCBzdHJpbmcgY2FuIGJlIGRy YXduIG92ZXIgaXQuICovCisgIGlmICghcy0+Zm9yX292ZXJsYXBzCisgICAgICAmJiBzLT5mYWNl LT5ib3ggIT0gRkFDRV9OT19CT1gKKyAgICAgICYmIChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBD SEFSX0dMWVBICisgICAgICAgICAgfHwgcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRF X0dMWVBIKSkKKyAgICB7CisgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmcgKHMpOwor ICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19iYWNrZ3JvdW5kIChzLCB0cnVlKTsKKyAgICAgIHhf ZHJhd19nbHlwaF9zdHJpbmdfYm94IChzKTsKKyAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlw cGluZyAocyk7CisgICAgICByZWxpZWZfZHJhd25fcCA9IHRydWU7CisgICAgfQorICAgIGVsc2Ug aWYgKCFzLT5jbGlwX2hlYWQgLyogZHJhd19nbHlwaHMgZGlkbid0IHNwZWNpZnkgYSBjbGlwIG1h c2suICovCisgICAgICAgICAgICAgJiYgIXMtPmNsaXBfdGFpbAorICAgICAgICAgICAgICYmICgo cy0+cHJldiAmJiBzLT5wcmV2LT5obCAhPSBzLT5obCAmJiBzLT5sZWZ0X292ZXJoYW5nKQorICAg ICAgICAgICAgICAgICB8fCAocy0+bmV4dCAmJiBzLT5uZXh0LT5obCAhPSBzLT5obCAmJiBzLT5y aWdodF9vdmVyaGFuZykpKQorICAgICAgLyogV2UgbXVzdCBjbGlwIGp1c3QgdGhpcyBnbHlwaC4g IGxlZnRfb3ZlcmhhbmcgcGFydCBoYXMgYWxyZWFkeQorICAgICAgICAgZHJhd24gd2hlbiBzLT5w cmV2IHdhcyBkcmF3biwgYW5kIHJpZ2h0X292ZXJoYW5nIHBhcnQgd2lsbCBiZQorICAgICAgICAg ZHJhd24gbGF0ZXIgd2hlbiBzLT5uZXh0IGlzIGRyYXduLiAqLworICAgICAgeF9zZXRfZ2x5cGhf c3RyaW5nX2NsaXBwaW5nX2V4YWN0bHkgKHMsIHMpOworICAgICAgZWxzZQorICAgICAgICB4X3Nl dF9nbHlwaF9zdHJpbmdfY2xpcHBpbmcgKHMpOworICBzd2l0Y2ggKHMtPmZpcnN0X2dseXBoLT50 eXBlKQorICAgIHsKKyAgICBjYXNlIElNQUdFX0dMWVBIOgorICAgICAgeF9kcmF3X2ltYWdlX2ds eXBoX3N0cmluZyAocyk7CisgICAgICBicmVhazsKKyAgICBjYXNlIFhXSURHRVRfR0xZUEg6Cisg ICAgICB4X2RyYXdfeHdpZGdldF9nbHlwaF9zdHJpbmcgKHMpOworICAgICAgYnJlYWs7CisgICAg Y2FzZSBTVFJFVENIX0dMWVBIOgorICAgICAgbWNfeF9kcmF3X3N0cmV0Y2hfZ2x5cGhfc3RyaW5n IChzKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgQ0hBUl9HTFlQSDoKKyAgICAgIGlmIChzLT5m b3Jfb3ZlcmxhcHMpCisgICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAg ICAgZWxzZQorICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIGZhbHNl KTsKKyAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVh azsKKyAgICBjYXNlIENPTVBPU0lURV9HTFlQSDoKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMg fHwgKHMtPmNtcF9mcm9tID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgISBz LT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0b21hdGljKSkKKyAgICAgICAgcy0+YmFja2dyb3VuZF9m aWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdf YmFja2dyb3VuZCAocywgdHJ1ZSk7CisgICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmlu Z19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBI OgorICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxs ZWRfcCA9IHRydWU7CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFj a2dyb3VuZCAocywgdHJ1ZSk7CisgICAgICB4X2RyYXdfZ2x5cGhsZXNzX2dseXBoX3N0cmluZ19m b3JlZ3JvdW5kIChzKTsKKyAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19h Ym9ydCAoKTsKKyAgICB9CisgIGlmICghcy0+Zm9yX292ZXJsYXBzKQorICAgIHsKKyAgICAgIC8q IERyYXcgdW5kZXJsaW5lLiAqLworICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9wKQorICAg ICAgICB7CisgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5E RVJfV0FWRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVy bGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICB4X2RyYXdfdW5kZXJ3YXZlIChzKTsK KyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg IFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAgICAgICAgICAgWEdldEdDVmFsdWVzIChzLT5kaXNw bGF5LCBzLT5nYywgR0NGb3JlZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgICAgICBYU2V0 Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHMtPmZhY2UtPnVuZGVybGluZV9jb2xvcik7 CisgICAgICAgICAgICAgICAgICB4X2RyYXdfdW5kZXJ3YXZlIChzKTsKKyAgICAgICAgICAgICAg ICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBzLT5nYywgeGdjdi5mb3JlZ3JvdW5kKTsK KyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAocy0+ ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CisgICAgICAg ICAgICAgIGludCB5OworICAgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5wcmV2LT5mYWNl LT51bmRlcmxpbmVfcAorICAgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJs aW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgIC8qIFdlIHVzZSB0aGUgc2FtZSB1bmRlcmxpbmUgc3R5bGUgYXMgdGhlIHByZXZp b3VzIG9uZS4gKi8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPnByZXYtPnVuZGVy bGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVu ZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGlu ZSB0aGlja25lc3MuICBEZWZhdWx0IGlzIDEgcGl4ZWwuICovCisgICAgICAgICAgICAgICAgICBp ZiAocy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAg ICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAg ICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gMTsK KyAgICAgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50X2xpbmUpCisgICAg ICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIHRoaWNrbmVzcykgLSAocy0+ eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHBvc2l0aW9u LiAgVGhpcyBpcyB0aGUgcmVjb21tZW5kZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJ0 aWNhbCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRoZSB0b3Agb2YKKyAg ICAgICAgICAgICAgICAgICAgICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBpcyBhIHNpZ25lZCB2 YWx1ZSBhY2NvcmRpbmcgdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgc3BlY3MsIGFu ZCBpdHMgZGVmYXVsdCBpcworICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EICgobWF4aW11 bSBkZXNjZW50KSAvIDIpLCB3aXRoCisgICAgICAgICAgICAgICAgICAgICAgICAgUk9VTkQoeCkg PSBmbG9vciAoeCArIDAuNSkgICovCisgICAgICAgICAgICAgICAgICAgICAgaWYgKHhfdXNlX3Vu ZGVybGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49IDApCisgICAgICAgICAg ICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAg ICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChzLT5mb250KQorICAgICAgICAgICAgICAgICAg ICAgICAgcG9zaXRpb24gPSAocy0+Zm9udC0+ZGVzY2VudCArIDEpIC8gMjsKKyAgICAgICAgICAg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHVuZGVy bGluZV9taW5pbXVtX29mZnNldDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICAgICAgcG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQp OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyogQ2hlY2sgdGhlIHNhbml0eSBv ZiB0aGlja25lc3MgYW5kIHBvc2l0aW9uLiAgV2Ugc2hvdWxkCisgICAgICAgICAgICAgICAgIGF2 b2lkIGRyYXdpbmcgdW5kZXJsaW5lIG91dCBvZiB0aGUgY3VycmVudCBsaW5lIGFyZWEuICovCisg ICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDw9IHMtPnliYXNlICsgcG9zaXRpb24p CisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gMSkgLSAocy0+eWJhc2Ug LSBzLT55KTsKKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPCBzLT55YmFzZSAr IHBvc2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IChzLT55 ICsgcy0+aGVpZ2h0KSAtIChzLT55YmFzZSArIHBvc2l0aW9uKTsKKyAgICAgICAgICAgICAgcy0+ dW5kZXJsaW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAgICAgcy0+dW5kZXJs aW5lX3Bvc2l0aW9uID0gcG9zaXRpb247CisgICAgICAgICAgICAgIHkgPSBzLT55YmFzZSArIHBv c2l0aW9uOworICAgICAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9w KQorICAgICAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCB5 LCBzLT53aWR0aCwgdGhpY2tuZXNzKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAgICAgICAg ICAgWEdldEdDVmFsdWVzIChzLT5kaXNwbGF5LCBzLT5nYywgR0NGb3JlZ3JvdW5kLCAmeGdjdik7 CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z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5nX2JveCAocyk7CisgICAgICBpZiAocy0+cHJldikKKyAgICAgICAgeworICAgICAgICAgIHN0 cnVjdCBnbHlwaF9zdHJpbmcgKnByZXY7CisgICAgICAgICAgZm9yIChwcmV2ID0gcy0+cHJldjsg cHJldjsgcHJldiA9IHByZXYtPnByZXYpCisgICAgICAgICAgICBpZiAocHJldi0+aGwgIT0gcy0+ aGwKKyAgICAgICAgICAgICAgICAmJiBwcmV2LT54ICsgcHJldi0+d2lkdGggKyBwcmV2LT5yaWdo dF9vdmVyaGFuZyA+IHMtPngpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBB cyBwcmV2IHdhcyBkcmF3biB3aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwgd2UKKyAgICAg ICAgICAgICAgICAgICBtdXN0IGRyYXcgdGhlIHJpZ2h0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+ aGwgbm93LiAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0g cHJldi0+aGw7CisgICAgICAgICAgICAgICAgcHJldi0+aGwgPSBzLT5obDsKKyAgICAgICAgICAg ICAgICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHByZXYsIGN1cnNvcl9nY19wKTsKKyAgICAg ICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgcHJldik7 CisgICAgICAgICAgICAgICAgaWYgKHByZXYtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZ UEgpCisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHBy ZXYpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19jb21w b3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAgICAgIHhf cmVzZXRfY2xpcF9yZWN0YW5nbGVzIChwcmV2LT5mLCBwcmV2LT5nYyk7CisgICAgICAgICAgICAg ICAgcHJldi0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIHByZXYtPm51bV9jbGlwcyA9IDA7 CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHMtPm5leHQpCisgICAgICAg IHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpuZXh0OworICAgICAgICAgIGZvciAo bmV4dCA9IHMtPm5leHQ7IG5leHQ7IG5leHQgPSBuZXh0LT5uZXh0KQorICAgICAgICAgICAgaWYg KG5leHQtPmhsICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYgbmV4dC0+eCAtIG5leHQtPmxl ZnRfb3ZlcmhhbmcgPCBzLT54ICsgcy0+d2lkdGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAvKiBBcyBuZXh0IHdpbGwgYmUgZHJhd24gd2hpbGUgY2xpcHBlZCB0byBpdHMgb3du IGFyZWEsCisgICAgICAgICAgICAgICAgICAgd2UgbXVzdCBkcmF3IHRoZSBsZWZ0X292ZXJoYW5n IHBhcnQgdXNpbmcgcy0+aGwgbm93LiAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlw aHNfZmFjZSBzYXZlID0gbmV4dC0+aGw7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzLT5o bDsKKyAgICAgICAgICAgICAgICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKG5leHQsIGN1cnNv cl9nY19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhh Y3RseSAocywgbmV4dCk7CisgICAgICAgICAgICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50 eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5n X2ZvcmVncm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAg ICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOworICAg ICAgICAgICAgICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChuZXh0LT5mLCBuZXh0LT5nYyk7 CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIG5leHQt Pm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgICAgbmV4dC0+Y2xpcF9oZWFkID0gcy0+bmV4 dDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAvKiBSZXNldCBjbGlwcGlu Zy4gKi8KKyAgeF9yZXNldF9jbGlwX3JlY3RhbmdsZXMgKHMtPmYsIHMtPmdjKTsKKyAgcy0+bnVt X2NsaXBzID0gMDsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIC8qIERlZmF1bHQgdG8gdXNpbmcgWElNIGlmIGF2YWlsYWJsZS4g ICovCiAjaWZkZWYgVVNFX1hJTQogYm9vbCB1c2VfeGltID0gdHJ1ZTsKQEAgLTk5OSw2ICsxODYy LDE1IEBAIHhfdXBkYXRlX2JlZ2luIChzdHJ1Y3QgZnJhbWUgKmYpCiAgIGlmIChGUkFNRV9UT09M VElQX1AgKGYpICYmICFGUkFNRV9WSVNJQkxFX1AgKGYpKQogICAgIHJldHVybjsKIAorCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191 cGRhdGluZ19mcmFtZSA9IGY7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgaWYg KCEgRlJBTUVfQ1JfU1VSRkFDRSAoZikpCiAgICAgewogICAgICAgaW50IHdpZHRoLCBoZWlnaHQ7 CkBAIC0xMjY2LDYgKzIxMzgsMTYgQEAgeF91cGRhdGVfZW5kIChzdHJ1Y3QgZnJhbWUgKmYpCiAg IFhGbHVzaCAoRlJBTUVfWF9ESVNQTEFZIChmKSk7CiAgIHVuYmxvY2tfaW5wdXQgKCk7CiAjZW5k aWYKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKIH0KIAogLyogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgZnJvbSB2YXJpb3VzIHBs YWNlcyBpbiB4ZGlzcC5jCkBAIC0xMzEwMCw2ICsxMzk4MiwyMSBAQCB4X2FjdGl2YXRlX3RpbWVv dXRfYXRpbWVyICh2b2lkKQogCiBzdGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UgeF9y ZWRpc3BsYXlfaW50ZXJmYWNlID0KICAgeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYHh0 ZXJtLmNgIG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5 X2ludGVyZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfeF93cml0ZV9nbHlwaHMs CisgIG1jX3hfZHJhd193aW5kb3dfY3Vyc29yLAorICBtY194X2RyYXdfZ2x5cGhfc3RyaW5nLAor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgeF9mcmFtZV9wYXJtX2hhbmRsZXJz LAogICAgIHhfcHJvZHVjZV9nbHlwaHMsCiAgICAgeF93cml0ZV9nbHlwaHMsCg== --Multipart_Tue_May_28_01:31:54_2019-1--