From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.bugs Subject: bug#17684: #22873 (multiple fake cursors); and, #17684 (crosshairs). Date: Sun, 23 Jun 2019 19:25:16 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sun_Jun_23_19:25:16_2019-1" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="18584"; 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 Mon Jun 24 04:26:39 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.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hfEgk-0001bL-S0 for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Jun 2019 04:26:38 +0200 Original-Received: from localhost ([::1]:47648 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfEgj-0006Lj-5J for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Jun 2019 22:26:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55498) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfEgJ-0006LS-LA for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2019 22:26:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfEgF-0003cT-Q1 for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2019 22:26:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41790) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfEgE-0003U9-3Y for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2019 22:26:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hfEgD-0007BQ-TS for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2019 22:26:01 -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: Mon, 24 Jun 2019 02:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17684 X-GNU-PR-Package: emacs Original-Received: via spool by 17684-submit@debbugs.gnu.org id=B17684.156134312527568 (code B ref 17684); Mon, 24 Jun 2019 02:26:01 +0000 Original-Received: (at 17684) by debbugs.gnu.org; 24 Jun 2019 02:25:25 +0000 Original-Received: from localhost ([127.0.0.1]:55335 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfEfd-0007AZ-FD for submit@debbugs.gnu.org; Sun, 23 Jun 2019 22:25:25 -0400 Original-Received: from gateway20.websitewelcome.com ([192.185.55.25]:36495) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfEfb-0007AQ-4D for 17684@debbugs.gnu.org; Sun, 23 Jun 2019 22:25:23 -0400 Original-Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway20.websitewelcome.com (Postfix) with ESMTP id D1E69400D24FF for <17684@debbugs.gnu.org>; Sun, 23 Jun 2019 20:23:43 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id fEfZhJvGD2PzOfEfahZU50; Sun, 23 Jun 2019 21:25:22 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=z6FOA5wOhzxUd3Bu2nENRCnhTcl3ZbMeU/3yEPzD4Lw=; b=ZttKA2I4ILOXd6+p3YWFznS9hx eG77gRNd8ugcVQMiUjqXb4m4NSghqSLQUWINoMgGaDXJ1ff7P9bZUNRpSpg9gc7jOAOda4ywx070E 9uxo/e3jSGkt7EruhKOjo3H2XzP2Zd4LVEcEHTeX+KQCujVPZSU5T7rRcKwwPSwjFpnlBITxagCRO 31ysS8Jyag1BN955f92TAL99FaRDUImSn+trCCrUbA5F4ouvycPXGMlOLAMQgtnrMkcr+WgFVb/a/ PcCl9J+4H7OyaxUz8GOxROQg8rNBAzHH9VIz6oCExatwMvlNoj71c6dEyBuSLwKkSlkfmJ4xIQG97 V1QONLfw==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:51403 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.92) (envelope-from ) id 1hfEfV-004CBA-QN; Sun, 23 Jun 2019 21:25:21 -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: 1hfEfV-004CBA-QN X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:51403 X-Source-Auth: lawlist X-Email-Count: 6 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:161191 Archived-At: --Multipart_Sun_Jun_23_19:25:16_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 021.003 [06/23/2019] CHANGELOG: - `bottom_vpos' has been removed as a function parameter of `mc_draw_row' and `mc_draw_glyphs'. - Removed the `redisplay_interface' component named `mc_scribe_glyphs'. Removed the function `mc_x_write_glyphs'. `mc_draw_glyphs' is now called directly from `mc_update_text_area'. - Revised instructions regarding how to use the built-in fake cursors with Magnar's library (multiple-cursors). [Adjusted calls to `mc/built-in-cursors' within `crosshairs.el'.] - Miscellaneous tidying-up of code. SCREENSHOTS (X11, W32, NS): https://www.lawlist.com/images/22873_17684_light_dark_backgrounds.png SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 04/08/2019: git reset --hard a038df77de7b1aa2d73a6478493b8838b59e4982 Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed")))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out both the crosshairs feature and the visible fill column indicator feature, type: M-x +-mode - To try out just the visible fill column indicator feature, type: M-x fc-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, that package must be installed. If the multiple-cursors package is already installed, then just (require 'crosshairs) and `crosshairs.el` will redefine a few of the multiple-cursors functions and set up a few keyboard shortcuts. If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors) (mc/built-in-cursors)) TODO: - `ns_draw_window_cursor' calls `ns_clip_to_rect', which does _not_ take `row->clip` into consideration when drawing cursors with `NSRectFill'. When it comes time to draw glyphs on top of the box/hollow family of cursors, `row->clip` is taken into consideration by `get_glyph_string_clip'. Fake cursors can be drawn even though the glyphs cannot, resulting in hollow/box family of cursors without text. The issue can be reproduced with M-x mc-test. [A temporary workaround is to disable `row->clip` while drawing the glyphs.] https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00009.html - Add additional support for `ch_inactive_windows' and `fc_inactive_windows' when the variables have a `nil` value. In such a case, the inactive windows should not display the crosshairs and/or visible fill column indicator. At the present time, fake cursors are drawn in active/inactive windows alike. - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - Is there any additional meaningful optimization that can be added to the three calls of `mc_pre_scroll_clean'? - NOTE: As to `mc_scrolling_window', it would appear that there is no tangible benefit to rotating the current/prospective cache of fake cursors to compare the data before removing the fake cursors. When scrolling the display, only _some_ lines are copied to new locations. Areas that are not overwritten may have fake cursors and those may not necessarily be removed if desired/current matrix glyphs are equal. The test for `GLYPH_EQUAL_P' does not take into consideration the existence of a fake cursor, and the glyph (with a fake cursor) may not be updated as a result thereof. As to lines that are not copied, portions may be updated and fake cursors would be removed thereby. - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create an minimal working example and file a bug report. - There is a bug affecting an older version of Emacs for the NS port that causes partial line flickering when the same characters are grouped together (;;;;;;) and MC_GLYPHLESS cursors are above or below -- having the same background color as the frame; e.g., black on black (used to erase a glyphless cursor). The partial flickering is only noticeable with rapid fire; e.g., holding down the right/left arrow key. When changing the color of the glyphless cursor, the issue is not present. [@lawlist has verified that the X and HPOS coordinates are accurate.] - There is a bug affecting the recorded `w->mc.lnum_pixel_width` that is observable when not running under gdb, but disappears when running under gdb. While viewing a folded org-mode buffer, the non-gdb instance had a visible line number pixel-width of 44, but Emacs treated it as fluctuating between 44 and 55 as the cursor was moved to the end of line. In the gdb instance, the visible line number pixel width was 55 with no fluctuation under the same conditions as the non-gdb instance. This appears to be a different bug than bug#32177 (current line number shifts one column to the left) because the line number of the current line does not shift left, and changing the bidi settings did not correct the issue. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. --Multipart_Sun_Jun_23_19:25:16_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_06_23__17_05_04_651.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi43ODI3NTJmCi0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI4OCBAQAorOzs7Ozs7Ozs7Ozs7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 cnNvcnMtbW9kZSAwKQorICAgICAgICAod2hlbiB0aGlzLW9yaWdpbmFsLWNvbW1hbmQKKyAgICAg ICAgICAobGV0ICgob3JpZ2luYWwtY29tbWFuZCAob3IgbWMtLXRoaXMtY29tbWFuZAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29tbWFuZC1yZW1hcHBpbmcgdGhpcy1v cmlnaW5hbC1jb21tYW5kKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0 aGlzLW9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgIDs7IHNraXAga2V5Ym9hcmQgbWFj cm9zLCBzaW5jZSB0aGV5IHdpbGwgZ2VuZXJhdGUgYWN0dWFsIGNvbW1hbmRzIHRoYXQgYXJlCisg ICAgICAgICAgICA7OyBhbHNvIHJ1biBpbiB0aGUgY29tbWFuZCBsb29wIC0gd2UnbGwgaGFuZGxl IHRob3NlIGxhdGVyIGluc3RlYWQuCisgICAgICAgICAgICAod2hlbiAoZnVuY3Rpb25wIG9yaWdp bmFsLWNvbW1hbmQpCisgICAgICAgICAgICAgIDs7IGlmIGl0J3MgYSBsYW1iZGEsIHdlIGNhbid0 IGtub3cgaWYgaXQncyBzdXBwb3J0ZWQgb3Igbm90CisgICAgICAgICAgICAgIDs7IC0gc28gZ28g YWhlYWQgYW5kIGFzc3VtZSBpdCdzIG9rLCBiZWNhdXNlIHdlJ3JlIGp1c3Qgb3B0aW1pc3RpYyBs aWtlIHRoYXQKKyAgICAgICAgICAgICAgKGlmIChvciAobm90IChzeW1ib2xwIG9yaWdpbmFsLWNv bW1hbmQpKQorICAgICAgICAgICAgICAgICAgICAgIDs7IGxhbWJkYSByZWdpc3RlcmVkIGJ5IHNt YXJ0cmVwCisgICAgICAgICAgICAgICAgICAgICAgKHN0cmluZy1wcmVmaXgtcCAiKCIgKHN5bWJv bC1uYW1lIG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgICAgICAgIChtYy9leGVjdXRl LWNvbW1hbmQtZm9yLWFsbC1mYWtlLWN1cnNvcnMgb3JpZ2luYWwtY29tbWFuZCkKKyAgICAgICAg ICAgICAgICA7OyBzbWFydHJlcCBgaW50ZXJuJ3MgY29tbWFuZHMgaW50byBvd24gb2JhcnJheSB0 byBoZWxwCisgICAgICAgICAgICAgICAgOzsgYGRlc2NyaWJlLWJpbmRpbmdzJy4gIFNvLCBsZXQn cyByZS1gaW50ZXJuJyBoZXJlIHRvCisgICAgICAgICAgICAgICAgOzsgbWFrZSB0aGUgY29tbWFu ZCBjb21wYXJhYmxlIGJ5IGBlcScuCisgICAgICAgICAgICAgICAgKHNldHEgb3JpZ2luYWwtY29t bWFuZCAoaW50ZXJuIChzeW1ib2wtbmFtZSBvcmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAgICAg ICAgICAgOzsgb3RoZXJ3aXNlIGl0J3MgYSBzeW1ib2wsIGFuZCB3ZSBjYW4gYmUgbW9yZSB0aG9y b3VnaAorICAgICAgICAgICAgICAgIChpZiAoZ2V0IG9yaWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1 cHBvcnRlZCkKKyAgICAgICAgICAgICAgICAgICAgKG1lc3NhZ2UgIiVTIGlzIG5vdCBzdXBwb3J0 ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4g KGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3Qg KG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1j L2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMv YWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2Nt ZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMv cHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29y cyBvcmlnaW5hbC1jb21tYW5kKSkpKQorICAgICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQt aW4tY3Vyc29ycworICAgICAgICAgICAgICAgIChzZXRxIG1jLWNvbmYKKyAgICAgICAgICAgICAg ICAgICAgICAgIChtYXBjYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoeCkg KGxpc3QgKG92ZXJsYXktc3RhcnQgeCkgImJhciIgbmlsKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgKG1jL2FsbC1mYWtlLWN1cnNvcnMpKSkpKSkpKSkpCisKKyAgKGRlZnVuIG1jL21hcmst bmV4dC1saWtlLXRoaXMtY3ljbGUtZm9yd2FyZCAoKQorICAiTWFya3MgbmV4dCBvY2N1cmVuY2Ug b2Ygd29yZCBsaWtlIHRoaXMgYW5kIGFkdmFuY2VzIGN1cnNvciB0byB0aGlzIG9jY3VycmVuY2Ui CisgIChpbnRlcmFjdGl2ZSkKKyAgICAobWMvbW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dXJwbGUiKQorICAg ICAgICAgICAgICAgICAgICAgICgzICJib3giICIjMDBGRjAwIikKKyAgICAgICAgICAgICAgICAg ICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAgICAgKDUgKCJo YmFyIiAzKSBbMS4wIDAuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAz KSBbMC4wIDEuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFu Z2VSZWQiKQorICAgICAgICAgICAgICAgICAgICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAg ICAgICAgICAgICAgICAgICg5ICJib3giICJncmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93 IChkaXNwbGF5LWJ1ZmZlciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2lu Y2UgdGhpcyBmaXJlcyBnbG9iYWxseSwgd2UgbXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jv c3NoYWlycyBhcHBlYXIgaW4uIgorICAod2hlbiArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVt cSBsYXN0LWNvbW1hbmQgKy1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVs bCArLXBhcmVucy1wKSkKKyAgICAgICgrLXBhcmVucy1mbikpCisgICAgKHdoZW4gKy10aW1lci12 YXIKKyAgICAgIChzZXRxIHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1p ZGxlLWxpc3QpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkpKQorCisoZGVmdW4gKy1k cmF3LWZvcnRod2l0aCAoKQorIkltbWVkaWF0ZWx5IGRlbGV0ZS9kcmF3IG1hdGNoaW5nIHBhcmVu dGhlc2VzLiIKKyAgKCstZHJhdy1jcm9zc2hhaXJzICdmb3JjZSkpCisKKyhkZWZ1biArLWRyYXct Y3Jvc3NoYWlycyAoJm9wdGlvbmFsIGZvcmNlKQorIkltbWVkaWF0ZWx5IGRlbGV0ZSBtYXRjaGlu ZyBwYXJlbnRoZXNlcy4gIElmIEZPUkNFIGlzIG5vbi1uaWwsIHRoZW4gaW1tZWRpYXRlbHkKK2Ry YXcgbWF0Y2hpbmcgcGFyZW50aGVzaXM7IG90aGVyd2lzZSwgZHJhdyB0aGVtIG9uIGFuIGlkbGUt dGllci4iCisgICh3aGVuICstbW9kZQorICAgICh3aGVuICstdGltZXItdmFyCisgICAgICAoc2V0 cSB0aW1lci1pZGxlLWxpc3QgKGRlbHEgKy10aW1lci12YXIgdGltZXItaWRsZS1saXN0KSkKKyAg ICAgIChzZXRxICstdGltZXItdmFyIG5pbCkpCisgICAgKHVubGVzcyAob3IgKG1lbXEgdGhpcy1j b21tYW5kICstcGFyZW5zLWV4Y2x1c2lvbnMpCisgICAgICAgICAgICAgICAgKGFuZCAobnVsbCAr LXBhcmVucy1wKQorICAgICAgICAgICAgICAgICAgICAgKG51bGwgKy1wYXJlbnMtb3ZlcmxheXMt ZXhpc3QtcCkpKQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZv cmNlCisgICAgICAocHJvZ24KKyAgICAgICAgKHdoZW4gKy1wYXJlbnMtcAorICAgICAgICAgICgr LXBhcmVucy1mbikpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGlt ZXIgKy1pZGxlLXRpbWVyLXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKyhkZWZ2YXIg ZmMtbW9kZSkKKworOzs7IyMjYXV0b2xvYWQKKyhkZWZpbmUtbWlub3ItbW9kZSArLW1vZGUKKyJN aW5vciBtb2RlIGZvciBkaXNwbGF5aW5nIGEgaG9yaXpvbnRhbCBydWxlci4iCisgIDppbml0LXZh bHVlIG5pbAorICA6bGlnaHRlciAiICsiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisg IDpncm91cCAnKy1tb2RlCisgIChjb25kCisgICAgKCstbW9kZQorICAgICAgOzs7IGArLW1vZGUn IGhhcyB0aGUgYWJpbGl0eSB0byBhbHNvIGRpc3BsYXkgYSBmaWxsIGNvbHVtbiBpbmRpY2F0b3Iu CisgICAgICA7OzsgU2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuCisgICAgICAod2hl biBmYy1tb2RlCisgICAgICAgIChmYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFs LWVsZG9jLW1vZGUKKyAgICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2Fu eSkKKyAgICAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAg ICAgICAgKGdsb2JhbC1lbGRvYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2st Y29udGV4dC10aW1lcgorICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAn YW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQor ICAgICAgICAod2hlbiAodGltZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAg KGNhbmNlbC10aW1lciBqaXQtbG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEg aml0LWxvY2stY29udGV4dC10aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAn aml0LWxvY2stY29udGV4dC1mb250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4 dC10aW1lciBuaWwpKQorICAgICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAn YW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQor ICAgICAgICAod2hlbiAodGltZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQor ICAgICAgICAgIChjYW5jZWwtdGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIp KQorICAgICAgICAoZnNldCAndW5kby1hdXRvLS11bmRvYWJsZS1jaGFuZ2UKKyAgICAgICAgICAg ICAgKGxhbWJkYSAoKSAoYWRkLXRvLWxpc3QgJ3VuZG8tYXV0by0tdW5kb2FibHktY2hhbmdlZC1i dWZmZXJzIChjdXJyZW50LWJ1ZmZlcikpKSkKKyAgICAgICAgKGZzZXQgJ3VuZG8tYXV0by1hbWFs Z2FtYXRlICdpZ25vcmUpKQorICAgICAgKHdoZW4gYmxpbmstY3Vyc29yLW1vZGUKKyAgICAgICAg KGJsaW5rLWN1cnNvci1tb2RlIC0xKQorICAgICAgICAod2hlbiAobWVtcSAnYmxpbmstY3Vyc29y LWNoZWNrIHBvc3QtY29tbWFuZC1ob29rKQorICAgICAgICAgIChyZW1vdmUtaG9vayAncG9zdC1j b21tYW5kLWhvb2sgJ2JsaW5rLWN1cnNvci1jaGVjaykpKQorICAgICAgKHNldHEgY3Jvc3NoYWly cyB0KQorICAgICAgKHdoZW4gKy1maWxsLWNvbHVtbgorICAgICAgICAoc2V0cSBmYy12aXNpYmxl IHQpKQorICAgICAgOzs7IGBhdXRvLWNvbXBvc2l0aW9uLW1vZGUnIGlzIG5lZWRlZCBmb3IgY3Jv c3NoYWlycyB0byBwcm9wZXJseSBjYWxjdWxhdGUKKyAgICAgIDs7OyBjb29yZGluYXRlcyBvZiBj b21wb3NpdGlvbiBjaGFyYWN0ZXJzLiAgQXV0b21hdGljYWxseSBiZWNvbWVzIHBlcm1hbmVudGx5 CisgICAgICA7OzsgYnVmZmVyLWxvY2FsIHdoZW4gc2V0LgorICAgICAgKHVubGVzcyBhdXRvLWNv bXBvc2l0aW9uLW1vZGUKKyAgICAgICAgK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IChwdXNoIChjb25zIHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICstLXNhdmVkLXN0YXRlKSkp CisgICAgICAoc2V0cSBmaWxsLWNvbHVtbiA4MCkKKyAgICAgIChzZXRxIGRpc3BsYXktbGluZS1u dW1iZXJzIHQpCisgICAgICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1s aW5lKQorICAgICAgKHNldHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAoc2V0cSBidWZm ZXItZGlzcGxheS10YWJsZSArLWJ1ZmZlci1kaXNwbGF5LXRhYmxlKQorICAgICAgKHNldHEgdGFi LXdpZHRoIDQpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlz dWFsKSB0KQorICAgICAgKHNldHEgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgKGNvbmQKKyAgICAg ICAgICAoKGxldCAoKGxzdCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisgICAgICAg ICAgICAgICAgICBtb2RlKQorICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAg ICAod2hpbGUgKHNldHEgbW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAgICAgKHdoZW4gKGRl cml2ZWQtbW9kZS1wIG1vZGUpCisgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkp KSkKKyAgICAgICAgICAgKChtZW1xIG1ham9yLW1vZGUgKy10cnVuY2F0ZS1saW5lcy1tYWpvci1t b2RlcykpCisgICAgICAgICAgICh0CisgICAgICAgICAgICAgbmlsKSkpCisgICAgICAoc2V0ICht YWtlLWxvY2FsLXZhcmlhYmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRvd3MpIG5pbCkK KyAgICAgIChzZXRxIHdvcmQtd3JhcCB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGlu ZXMgdCkKKyAgICAgIChzZXRxIGluZGljYXRlLWJ1ZmZlci1ib3VuZGFyaWVzICdsZWZ0KQorICAg ICAgKHNldHEgZnJpbmdlLWluZGljYXRvci1hbGlzdAorICAgICAgICAgIDs7OyBoc2NsX2FsbF90 ZW1wX3AgfCBoc2NsX3RlbXBfcAorICAgICAgICAnKCgrLWhzY2wtdGVtcCAuICgrLXNpbmdsZS1h bmdsZS1sZWZ0CisgICAgICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLWxlZnQp KQorICAgICAgICAgIDs7OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxsX3Blcm1fMV9wIHwg aHNjbF9hbGxfcGVybV8yX3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICgrLWhzY2wtcGVybSAu ICgrLXNpbmdsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1h bmdsZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLXRyaXBsZS1hbmdsZS11cAorICAg ICAgICAgICAgICAgICAgICAgICAgICArLXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAg KCstb3ZlcmxheS1hcnJvdyAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICArLWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAgKHRydW5jYXRp b24gLiAoKy1mcmluZ2UtbGVmdC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICstZnJp bmdlLXJpZ2h0LWFycm93KSkKKyAgICAgICAgICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxl ZnQtY3VybHktYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNoKSkK KyAgICAgICAgICAob3ZlcmxheS1hcnJvdyAuICstZnJpbmdlLXJpZ2h0LXRyaWFuZ2xlKQorICAg ICAgICAgICh1cCAuICstZnJpbmdlLXVwLWFycm93KQorICAgICAgICAgIChkb3duIC4gKy1mcmlu Z2UtZG93bi1hcnJvdykKKyAgICAgICAgICAodG9wIC4gKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUp CisgICAgICAgICAgKGJvdHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAg ICAgICAodG9wLWJvdHRvbSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQKKyAgICAgICAgICAgICAg ICAgICAgICAgICArLWZyaW5nZS1yaWdodC1icmFja2V0CisgICAgICAgICAgICAgICAgICAgICAg ICAgKy1mcmluZ2UtdG9wLXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgKy1m cmluZ2UtdG9wLWxlZnQtYW5nbGUpKQorICAgICAgICAgIChlbXB0eS1saW5lIC4gKy1mcmluZ2Ut ZW1wdHktbGluZSkKKyAgICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmsp KSkKKyAgICAgIChzZXRxIGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94IC4gKy1mcmluZ2UtbGVm dC10cmlhbmdsZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaG9sbG93IC4g Ky1ob2xsb3ctcmVjdGFuZ2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChi YXIgLiArLXZlcnRpY2FsLWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo aGJhciAuICstZnJpbmdlLWhvcml6b250YWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIChob2xsb3ctc21hbGwgLiArLWZyaW5nZS1ob2xsb3ctc3F1YXJlKSkpCisgICAg ICAoaWYgKG9yICstZm9ydGh3aXRoCisgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZp eC1hcmcgJyg0KSkpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJh dy1mb3J0aHdpdGggJ2FwcGVuZCAnbG9jYWwpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21t YW5kLWhvb2sgJystZHJhdy1jcm9zc2hhaXJzICdhcHBlbmQgJ2xvY2FsKSkKKyAgICAgICh3aGVu ICstZm9ydGh3aXRoCisgICAgICAgIChhZGQtaG9vayAnd2luZG93LWNvbmZpZ3VyYXRpb24tY2hh bmdlLWhvb2sgJystZHJhdy1mb3J0aHdpdGggbmlsICdsb2NhbCkpCisgICAgICAoYWRkLWhvb2sg J2NoYW5nZS1tYWpvci1tb2RlLWhvb2sgJ3R1cm4tb2ZmLSstbW9kZSBuaWwgJ2xvY2FsKQorICAg ICAgOzs7IE1hdGNoaW5nIHBhcmVudGhlc2VzIGRyYXdpbmcgZm9ydGh3aXRoIGludGVyZmVyZXMg d2l0aCB5YXNuaXBwZXQuCisgICAgICAod2hlbiArLWZvcnRod2l0aAorICAgICAgICAoc2V0cSAr LXBhcmVucy1wIG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55 KQorICAgICAgICAoY29uZAorICAgICAgICAgICgrLWZvcnRod2l0aAorICAgICAgICAgICAgKG1l c3NhZ2UgIlR1cm5lZCBPTiBgKy1tb2RlJyAtLSBEcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzIGlt bWVkaWF0ZWx5LiIpKQorICAgICAgICAgICgoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkp CisgICAgICAgICAgICA7OzsgTWF0Y2hpbmcgcGFyZW50aGVzZXMgd2lsbCBiZSBkcmF3biBpbW1l ZGlhdGVseS4KKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScgLS0gT3B0 aW1pemVkIGZvciBkZWJ1Z2dpbmcgcHVycG9zZXMuIikpCisgICAgICAgICAgKHQKKyAgICAgICAg ICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScuIikpKSkpCisgICAgKHQKKyAgICAgIChr aWxsLWxvY2FsLXZhcmlhYmxlICdmaWxsLWNvbHVtbikKKyAgICAgIChraWxsLWxvY2FsLXZhcmlh YmxlICdhdXRvLWhzY3JvbGwtbW9kZSkKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdoc2Ny b2xsLXN0ZXApCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnY3Jvc3NoYWlycykKKyAgICAg IChraWxsLWxvY2FsLXZhcmlhYmxlICdmYy12aXNpYmxlKQorICAgICAgKGtpbGwtbG9jYWwtdmFy aWFibGUgJ2Rpc3BsYXktbGluZS1udW1iZXJzKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUg J2Rpc3BsYXktbGluZS1udW1iZXJzLXdpZHRoKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUg J21jLWNvbmYpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnYnVmZmVyLWRpc3BsYXktdGFi bGUpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAndGFiLXdpZHRoKQorICAgICAgKGtpbGwt bG9jYWwtdmFyaWFibGUgJ2xpbmUtbW92ZS12aXN1YWwpCisgICAgICAoa2lsbC1sb2NhbC12YXJp YWJsZSAndHJ1bmNhdGUtbGluZXMpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAndHJ1bmNh dGUtcGFydGlhbC13aWR0aC13aW5kb3dzKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ3dv cmQtd3JhcCkKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdpbmRpY2F0ZS1lbXB0eS1saW5l cykKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdpbmRpY2F0ZS1idWZmZXItYm91bmRhcmll cykKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdmcmluZ2UtaW5kaWNhdG9yLWFsaXN0KQor ICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ2ZyaW5nZS1jdXJzb3ItYWxpc3QpCisgICAgICAo a2lsbC1sb2NhbC12YXJpYWJsZSAnKy1mb3J0aHdpdGgpCisgICAgICAoZG9saXN0IChzYXZlZCAr LS1zYXZlZC1zdGF0ZSkKKyAgICAgICAgKHNldCAobWFrZS1sb2NhbC12YXJpYWJsZSAoY2FyIHNh dmVkKSkgKGNkciBzYXZlZCkpKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJystLXNhdmVk LXN0YXRlKQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykKKyAgICAgICh3aGVuICht ZW1xICcrLWRyYXctZm9ydGh3aXRoIHBvc3QtY29tbWFuZC1ob29rKQorICAgICAgICAocmVtb3Zl LWhvb2sgJ3Bvc3QtY29tbWFuZC1ob29rICcrLWRyYXctZm9ydGh3aXRoICdsb2NhbCkpCisgICAg ICAod2hlbiAobWVtcSAnKy1kcmF3LWNyb3NzaGFpcnMgcG9zdC1jb21tYW5kLWhvb2spCisgICAg ICAgIChyZW1vdmUtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJhdy1jcm9zc2hhaXJzICds b2NhbCkpCisgICAgICAod2hlbiAobWVtcSAnKy1kcmF3LWZvcnRod2l0aCB3aW5kb3ctY29uZmln dXJhdGlvbi1jaGFuZ2UtaG9vaykKKyAgICAgICAgKHJlbW92ZS1ob29rICd3aW5kb3ctY29uZmln dXJhdGlvbi1jaGFuZ2UtaG9vayAnKy1kcmF3LWZvcnRod2l0aCAnbG9jYWwpKQorICAgICAgKHJl bW92ZS1ob29rICdjaGFuZ2UtbWFqb3ItbW9kZS1ob29rICd0dXJuLW9mZi0rLW1vZGUgJ2xvY2Fs KQorICAgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgICAgKHNldHEgdGltZXItaWRsZS1saXN0 IChkZWxxICstdGltZXItdmFyIHRpbWVyLWlkbGUtbGlzdCkpCisgICAgICAgIChzZXRxICstdGlt ZXItdmFyIG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQor ICAgICAgICAobWVzc2FnZSAiVHVybmVkIE9GRiBgKy1tb2RlJy4iKSkpKSkKKworKGRlZnVuIHR1 cm4tb2ZmLSstbW9kZSAoKQorICAoKy1tb2RlIC0xKSkKKworOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7CisKKyhkZWZ1biArLXBhcmVucy1mbiAoKQorICAiRG9jLXN0cmluZy4iCisgIChsZXQqICgo b3BvaW50IChwb2ludCkpCisgICAgICAgICAoZnJvbSAoaWYgKy1wYXJlbnMtZnJvbS1mbgorICAg ICAgICAgICAgICAgICAoZnVuY2FsbCArLXBhcmVucy1mcm9tLWZuKQorICAgICAgICAgICAgICAg ICAocG9pbnQtbWluKSkpCisgICAgICAgICAod2luIChzZWxlY3RlZC13aW5kb3cpKQorICAgICAg ICAgKGkgMCkKKyAgICAgICAgIChwcmVjZWRpbmctY2hhciAocHJlY2VkaW5nLWNoYXIpKQorICAg ICAgICAgKG9jaGFyIChjaGFyLWFmdGVyIG9wb2ludCkpCisgICAgICAgICAocG9zMQorICAgICAg ICAgICAoY29uZAorICAgICAgICAgICAgICgoYW5kIG9jaGFyCisgICAgICAgICAgICAgICAgICAg KG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDApID0+IG9wZW5pbmcgcGFyZW50aGVzaXMKKyAgICAg ICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgNDApCisgICAgICAgICAgICAgICAgICAgICAgIDs7 OyAoY2hhci10by1zdHJpbmcgOTEpID0+IG9wZW5pbmcgc3F1YXJlIGJyYWNrZXQKKyAgICAgICAg ICAgICAgICAgICAgICAgKD0gb2NoYXIgOTEpCisgICAgICAgICAgICAgICAgICAgICAgIDs7OyAo Y2hhci10by1zdHJpbmcgMTIzKSA9PiBvcGVuaW5nIHdhdnkgYnJhY2tldAorICAgICAgICAgICAg ICAgICAgICAgICAoPSBvY2hhciAxMjMpKSkKKyAgICAgICAgICAgICAgICAobWluICgxKyBvcG9p bnQpIChwb2ludC1tYXgpKSkKKyAgICAgICAgICAgICAoKG9yIDs7OyAoY2hhci10by1zdHJpbmcg NDEpID0+IGNsb3NpbmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGlu Zy1jaGFyIDQxKQorICAgICAgICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyA5MykgPT4g Y2xvc2luZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAgICAgICAgKD0gcHJlY2VkaW5nLWNo YXIgOTMpCisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDEyNSkgPT4gY2xv c2luZyB3YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDEy NSkpCisgICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWluKSAoMS0gb3BvaW50KSkpCisgICAg ICAgICAgICAgKHQKKyAgICAgICAgICAgICAgICBvcG9pbnQpKSkKKyAgICAgICAgIHBvczIKKyAg ICAgICAgIHNlbGVjdGVkLWZhY2UpCisgICAgKHNhdmUtZXhjdXJzaW9uCisgICAgICAoY29uZGl0 aW9uLWNhc2UgbmlsCisgICAgICAgICh3aGlsZSAoc2V0cSBwb3MxIChudGggMSAocGFyc2UtcGFy dGlhbC1zZXhwIGZyb20gcG9zMSkpKQorICAgICAgICAgIChzZXRxIHBvczIgKHNjYW4tc2V4cHMg cG9zMSAxKSkKKyAgICAgICAgICAoaWYgKD0gaSAxMCkKKyAgICAgICAgICAgIChzZXRxIGkgMSkK KyAgICAgICAgICAgIChzZXRxIGkgKDErIGkpKSkKKyAgICAgICAgICAoc2V0cSBzZWxlY3RlZC1m YWNlIChjb25kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLW9uZS1mYWNlKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAyKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICcrLXBhcmVucy10d28tZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKCg9IGkgMykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1w YXJlbnMtdGhyZWUtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkg NCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtZm91ci1mYWNl KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA1KQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1maXZlLWZhY2UpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICgoPSBpIDYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJystcGFyZW5zLXNpeC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAoKD0gaSA3KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1z ZXZlbi1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA4KQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1laWdodC1mYWNlKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA5KQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICcrLXBhcmVucy1uaW5lLWZhY2UpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICgoPSBpIDEwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICcrLXBhcmVucy10ZW4tZmFjZSkpKQorICAgICAgICAgIChsZXQgKChvdiAobWFrZS1vdmVybGF5 IHBvczEgKDErIHBvczEpKSkpCisgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZl LXdpbmRvd3MKKyAgICAgICAgICAgICAgKG92ZXJsYXktcHV0IG92ICd3aW5kb3cgd2luKSkKKyAg ICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBzZWxlY3RlZC1mYWNlKSkKKyAgICAgICAg ICAod2hlbiBwb3MyCisgICAgICAgICAgICAobGV0ICgob3YgKG1ha2Utb3ZlcmxheSAoMS0gcG9z MikgcG9zMikpKQorICAgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRv d3MKKyAgICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ3dpbmRvdyB3aW4pKQorICAgICAg ICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0ZWQtZmFjZSkpKSkKKyAgICAgICAg KGVycm9yIG5pbCkpKQorICAgIChzZXRxICstcGFyZW5zLW92ZXJsYXlzLWV4aXN0LXAgdCkpKQor CisoZGVmdW4gKy1yZW1vdmUtb3ZlcmxheXMgKGJlZyBlbmQgbmFtZSB2YWwpCisiUmVtb3ZlIHRo ZSBvdmVybGF5cyB0aGF0IGFyZSBgZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXNgLgorSW5jbHVk ZXMgYSB1bmlxdWUgc2l0dWF0aW9uIHdoZW4gYW4gb3ZlcmxheSB3aXRoIGFuIGAnYWZ0ZXItc3Ry aW5nYCBwcm9wZXJ0eQoraXMgYXQgdGhlIHZlcnkgZW5kIG9mIGEgbmFycm93ZWQtYnVmZmVyLiIK KyAgKGxldCogKChwb2ludC1tYXggKHBvaW50LW1heCkpCisgICAgICAgICAocG9pbnQtbWluIChw b2ludC1taW4pKQorICAgICAgICAgKG5hcnJvd2VkLXAgKGJ1ZmZlci1uYXJyb3dlZC1wKSkKKyAg ICAgICAgIChiZWcgKGlmIGJlZyBiZWcgcG9pbnQtbWluKSkKKyAgICAgICAgIChlbmQKKyAgICAg ICAgICAgKGNvbmQKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5h cnJvd2VkLXApCisgICAgICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAgIGVuZCkKKyAg ICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAg ICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICBwb2ludC1tYXgpCisgICAg ICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAg ICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKDwgZW5kIHBvaW50LW1heCkpCisgICAgICAgICAg ICAgICBlbmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQt cAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKD0gZW5kIHBvaW50LW1h eCkpCisgICAgICAgICAgICAgICAoMSsgZW5kKSkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAg ICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAg ICAgICAgICAgICAoMSsgcG9pbnQtbWF4KSkgKSkKKyAgICAgICAgIChvdmVybGF5cworICAgICAg ICAgICAocHJvZ24KKyAgICAgICAgICAgICAob3ZlcmxheS1yZWNlbnRlciBlbmQpCisgICAgICAg ICAgICAgKG92ZXJsYXlzLWluIGJlZyBlbmQpKSkpCisgICAgKHdoZW4gKGFuZCBiZWcgZW5kIG5h bWUgdmFsKQorICAgICAgKGRvbGlzdCAobyBvdmVybGF5cykKKyAgICAgICAgKGNvbmQKKyAgICAg ICAgICAoKGFuZCAoZXEgbmFtZSAnZmFjZSkKKyAgICAgICAgICAgICAgICAoZXEgKG92ZXJsYXkt Z2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIDs7IEVpdGhlciBwdXNoIHRoaXMgb3Zlcmxh eSBvdXRzaWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsgb3Igc3BsaXQgaXQgdG8gZXhjbHVk ZSBiZWcuLi5lbmQKKyAgICAgICAgICAgIDs7IG9yIGRlbGV0ZSBpdCBlbnRpcmVseSAoaWYgaXQg aXMgY29udGFpbmVkIGluIGJlZy4uLmVuZCkuCisgICAgICAgICAgICAoaWYgKDwgKG92ZXJsYXkt c3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAgIChpZiAoPiAob3ZlcmxheS1lbmQgbykgZW5k KQorICAgICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IChj b3B5LW92ZXJsYXkgbykKKyAgICAgICAgICAgICAgICAgIChvdmVybGF5LXN0YXJ0IG8pIGJlZykK KyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkpCisg ICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gKG92ZXJsYXktc3RhcnQgbykgYmVnKSkK KyAgICAgICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBvKSBlbmQpCisgICAgICAgICAgICAg ICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkKKyAgICAgICAgICAgICAg ICAoZGVsZXRlLW92ZXJsYXkgbykpKSkKKyAgICAgICAgICAoKGFuZCAobm90IChlcSBuYW1lICdm YWNlKSkKKyAgICAgICAgICAgICAgICAoZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXMgKG92ZXJs YXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIChkZWxldGUtb3ZlcmxheSBvKSk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worKGRlZnZhciBmYy10aW1lci12YXIgbmlsCisiVGltZXIgdXNl ZCB0byBoaWdobGlnaHQgY3VycmVudCBjb2x1bW4gd2hlbmV2ZXIgRW1hY3MgaXMgaWRsZS4iKQor Cis7OzsjIyNhdXRvbG9hZAorKGRlZmluZS1taW5vci1tb2RlIGZjLW1vZGUKKyJNaW5vciBtb2Rl IGZvciBkaXNwbGF5aW5nIGEgdmlzdWFsIGZpbGwgY29sdW1uLiIKKyAgOmluaXQtdmFsdWUgbmls CisgIDpsaWdodGVyICIgRkMiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisgIDpncm91 cCAnZmMtbW9kZQorICAoY29uZAorICAgIDs7OyBgKy1tb2RlJyBoYXMgdGhlIGFiaWxpdHkgdG8g YWxzbyBkaXNwbGF5IGEgZmlsbCBjb2x1bW4gaW5kaWNhdG9yLgorICAgIDs7OyBTZWUgdGhlIHZh cmlhYmxlIGArLWZpbGwtY29sdW1uJy4KKyAgICAoKGFuZCBmYy1tb2RlICstbW9kZSkKKyAgICAg IChzZXRxIGZjLW1vZGUgbmlsKQorICAgICAgKG1lc3NhZ2UgIlR1cm5lZCBPRkYgYGZjLW1vZGUn ICglcykgLS0gc2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuIiAoY3VycmVudC1idWZm ZXIpKSkKKyAgICAoZmMtbW9kZQorICAgICAgKHdoZW4gKGFuZCBnbG9iYWwtZWxkb2MtbW9kZQor ICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAoZ2xvYmFs LWVsZG9jLW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBqaXQtbG9jay1jb250ZXh0LXRpbWVy CisgICAgICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAg ICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVu ICh0aW1lcnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVy IGppdC1sb2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250 ZXh0LXRpbWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250 ZXh0LWZvbnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkp CisgICAgICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAg ICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVu ICh0aW1lcnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNh bmNlbC10aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChm c2V0ICd1bmRvLWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAgICAgICAgICAgICAobGFtYmRhICgp IChhZGQtdG8tbGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1jaGFuZ2VkLWJ1ZmZlcnMgKGN1cnJl bnQtYnVmZmVyKSkpKQorICAgICAgICAoZnNldCAndW5kby1hdXRvLWFtYWxnYW1hdGUgJ2lnbm9y ZSkpCisgICAgICAod2hlbiBibGluay1jdXJzb3ItbW9kZQorICAgICAgICAoYmxpbmstY3Vyc29y LW1vZGUgLTEpCisgICAgICAgICh3aGVuIChtZW1xICdibGluay1jdXJzb3ItY2hlY2sgcG9zdC1j b21tYW5kLWhvb2spCisgICAgICAgICAgKHJlbW92ZS1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAn Ymxpb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N0LXp2LWZhY2UnLiIK KyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICstcmV2ZXJzZWQtYmFyLXByZS16di1mYWNl CisgICcoKHQgKDpmb3JlZ3JvdW5kICJjeWFuMSIpKSkKKyAgIkZhY2UgZm9yIGArLXJldmVyc2Vk LWJhci1wcmUtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1yZXZl cnNlZC1iYXItYXQtenYtZmFjZQorICAnKCh0ICg6Zm9yZWdyb3VuZCAiY2hhcnRyZXVzZSIpKSkK KyAgIkZhY2UgZm9yIGArLXJldmVyc2VkLWJhci1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1t b2RlKQorCisoZGVmZmFjZSArLXJldmVyc2VkLWJhci1wb3N0LXp2LWZhY2UKKyAgJygodCAoOmZv cmVncm91bmQgImN5YW40IikpKQorICAiRmFjZSBmb3IgYCstcmV2ZXJzZWQtYmFyLXBvc3QtenYt ZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1ldmVuLXByZS16di1mYWNl CisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkK KyAgICAgOmZvcmVncm91bmQgInllbGxvdyIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29s b3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJjeWFuMSIpCisg ICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAg ICAgOmZvcmVncm91bmQgInllbGxvdyIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3Jz IDE2KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJjeWFuMSIpCisgICAg KCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3J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4 KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgIkRlZXBQaW5rMSIpCisgICAg KCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAg IDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9y cyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQor ICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQor ICAgICA6Zm9yZWdyb3VuZCAiRGVlcFBpbmsxIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1j b2xvcnMgOCkpCisgICAgIDpmb3JlZ3JvdW5kICJ3aGl0ZSIpCisgICAgKCgodHlwZSB0dHkpIChj bGFzcyBtb25vKSkKKyAgICAgOmludmVyc2UtdmlkZW8gdCkKKyAgICAodCA6Zm9yZWdyb3VuZCAi cGluayIpKQorICAiRmFjZSBmb3IgYCstZXZlbi1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1t b2RlKQorCisoZGVmZmFjZSArLWV2ZW4taW5hY3RpdmUtYXQtenYtZmFjZQorICAnKCgoKGNsYXNz IGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3Jv dW5kICJEZWVwUGluazQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJh Y2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAiRGVlcFBpbms0IikKKyAgICAoKChj bGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5kIGRhcmspKQorICAgICA6Zm9y ZWdyb3VuZCAiRGVlcFBpbms0IikKKyAgICAoKChjbGFzcyBjb2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WNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQp KQorICAgICA6Zm9yZWdyb3VuZCAiRGFya1NhbG1vbiIpCisgICAgKCgoY2xhc3MgY29sb3IpICht aW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5 KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91 bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGArLW9kZC1wb3N0LXp2LWZhY2UnLiIKKyAgOmdyb3Vw ICcrLW1vZGUpCisKKyhkZWZmYWNlICstb2RkLWluYWN0aXZlLXBvc3QtenYtZmFjZQorICAnKCgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpm b3JlZ3JvdW5kICJzaWVubmE0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgODgp IChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpm b3JlZ3JvdW5kICJzaWVubmE0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYp IChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikK KyAgICAoKCh0eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQor ICAgICh0IDpmb3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBgKy1vZGQtaW5hY3RpdmUt cG9zdC16di1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goKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGln aHQpKQorICAgICA6Zm9yZWdyb3VuZCAiRGFya09saXZlR3JlZW4iKQorICAgICgoKGNsYXNzIGNv bG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikKKyAgICAoKCh0 eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQorICAgICh0IDpm b3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBgKy1wb3N0LWZpbGwtaW5hY3RpdmUtcG9z dC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSBmYy1wcmUtenYtZmFj ZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykp CisgICAgIDpmb3JlZ3JvdW5kICJncmV5MTUiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNv bG9ycyA4OCkgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAiZ3JleTE1IikK KyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5kIGRhcmspKQor ICAgICA6Zm9yZWdyb3VuZCAiZ3JleTE1IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xv cnMgMTYpIChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgImdyZXkxNSIpCisg ICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hp dGUiKQorICAgICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVv IHQpCisgICAgKHQgOmZvcmVncm91bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGBm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YiwgTGlzcF9PYmplY3QgdmFsKQoreworICBiLT5tY19pbmFjdGl2ZV93aW5kb3dzXyA9 IHZhbDsKK30KKworc3RhdGljIHZvaWQKK2JzZXRfY3Jvc3NoYWlycyAoc3RydWN0IGJ1ZmZlciAq YiwgTGlzcF9PYmplY3QgdmFsKQoreworICBiLT5jcm9zc2hhaXJzXyA9IHZhbDsKK30KKworc3Rh dGljIHZvaWQKK2JzZXRfY2hfaG9yaXpvbnRhbF9ydWxlciAoc3RydWN0IGJ1ZmZlciAqYiwgTGlz cF9PYmplY3QgdmFsKQoreworICBiLT5jaF9ob3Jpem9udGFsX3J1bGVyXyA9IHZhbDsKK30KKwor c3RhdGljIHZvaWQKK2JzZXRfY2hfdmVydGljYWxfcnVsZXIgKHN0cnVjdCBidWZmZXIgKmIsIExp c3BfT2JqZWN0IHZhbCkKK3sKKyAgYi0+Y2hfdmVydGljYWxfcnVsZXJfID0gdmFsOworfQorCitz dGF0aWMgdm9pZAorYnNldF9jaF9pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBM aXNwX09iamVjdCB2YWwpCit7CisgIGItPmNoX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQor CitzdGF0aWMgdm9pZAorYnNldF9mY192aXNpYmxlIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09i amVjdCB2YWwpCit7CisgIGItPmZjX3Zpc2libGVfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAor YnNldF9mY19pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2 YWwpCit7CisgIGItPmZjX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCisvKiBlbmQgTVVM VElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogc3RhdGljIHZv aWQK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zZXRfbWNfaW5h Y3RpdmVfd2luZG93cyAoJmJ1ZmZlcl9kZWZhdWx0cywgUXQpOworICBic2V0X2Nyb3NzaGFpcnMg KCZidWZmZXJfZGVmYXVsdHMsIFFuaWwpOworICBic2V0X2NoX2hvcml6b250YWxfcnVsZXIgKCZi dWZmZXJfZGVmYXVsdHMsIFF0KTsKKyAgYnNldF9jaF92ZXJ0aWNhbF9ydWxlciAoJmJ1ZmZlcl9k ZWZhdWx0cywgUXQpOworICBic2V0X2NoX2luYWN0aXZlX3dpbmRvd3MgKCZidWZmZXJfZGVmYXVs dHMsIFF0KTsKKyAgYnNldF9mY192aXNpYmxlICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKKyAg YnNldF9mY19pbmFjdGl2ZV93aW5kb3dzICgmYnVmZmVyX2RlZmF1bHRzLCBRdCk7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgYnNldF9tb2RlX2xpbmVfZm9ybWF0ICgmYnVmZmVy X2RlZmF1bHRzLCBidWlsZF9wdXJlX2Nfc3RyaW5nICgiJS0iKSk7CiAgIGJzZXRfaGVhZGVyX2xp bmVfZm9ybWF0ICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKICAgYnNldF9hYmJyZXZfbW9kZSAo JmJ1ZmZlcl9kZWZhdWx0cywgUW5pbCk7CkBAIC01NDU4LDYgKzU1NTcsNTEgQEAgZGVmdmFyX3Bl cl9idWZmZXIgKHN0cnVjdCBMaXNwX0J1ZmZlcl9PYmpmd2QgKmJvX2Z3ZCwgY29uc3QgY2hhciAq bmFtZXN0cmluZywKIHZvaWQKIHN5bXNfb2ZfYnVmZmVyICh2b2lkKQogeworCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTE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ZXIuICAqLwogICBM aXNwX09iamVjdCBleHRyYV9saW5lX3NwYWNpbmdfOwogCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIFRoZSBjdXJzb3IgdHlwZSBvZiB0 aGUgcmVhbCBmYWtlIGN1cnNvci4gKi8KKyAgTGlzcF9PYmplY3QgbWNfcmVhbF9mYWtlX2N1cnNv cl87CisKKyAgLyogVGhlIG5hbWUgb2YgbGlzdCB1c2VkIGJ5IG11bHRpcGxlIGN1cnNvcnMgZm9y IG5leHQgcmVkaXNwbGF5LiAqLworICBMaXNwX09iamVjdCBtY19jb25mXzsKKworICAvKiBXaGV0 aGVyIHRvIGRyYXcgbXVsdGlwbGUgY3Vyc29ycyBpbiBpbmFjdGl2ZSB3aW5kb3dzLiAqLworICBM aXNwX09iamVjdCBtY19pbmFjdGl2ZV93aW5kb3dzXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUg YnVmZmVyLWxvY2FsIHZhcmlhYmxlLiAqLworICBMaXNwX09iamVjdCBjcm9zc2hhaXJzXzsKKwor ICAvKiBUaGUgbmFtZSBvZiB0aGUgY3Jvc3NoYWlycyBob3Jpem9udGFsIHJ1bGVyLiAqLworICBM aXNwX09iamVjdCBjaF9ob3Jpem9udGFsX3J1bGVyXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUg Y3Jvc3NoYWlycyB2ZXJ0aWNhbCBydWxlci4gKi8KKyAgTGlzcF9PYmplY3QgY2hfdmVydGljYWxf cnVsZXJfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBjcm9zc2hhaXJzIGluIGluYWN0aXZlIHdp bmRvd3MuICovCisgIExpc3BfT2JqZWN0IGNoX2luYWN0aXZlX3dpbmRvd3NfOworCisgIC8qIFRo ZSBuYW1lIG9mIHRoZSBidWZmZXItbG9jYWwgdmFyaWFibGUuICovCisgIExpc3BfT2JqZWN0IGZj X3Zpc2libGVfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBtdWx0aXBsZSBjdXJzb3JzIGZpbGwg Y29sdW1uIGluIGluYWN0aXZlIHdpbmRvd3MuICovCisgIExpc3BfT2JqZWN0IGZjX2luYWN0aXZl X3dpbmRvd3NfOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIEN1cnNvciB0 eXBlIHRvIGRpc3BsYXkgaW4gbm9uLXNlbGVjdGVkIHdpbmRvd3MuCiAgICAgIHQgbWVhbnMgdG8g dXNlIGhvbGxvdyBib3ggY3Vyc29yLgogICAgICBTZWUgYGN1cnNvci10eXBlJyBmb3Igb3RoZXIg dmFsdWVzLiAgKi8KQEAgLTc4NywxNCArODIxLDIxIEBAIHN0cnVjdCBidWZmZXIKICAgICAgYW4g aW5kaXJlY3QgYnVmZmVyIHNpbmNlIGl0IGNvdW50cyBhcyBpdHMgYmFzZSBidWZmZXIuICAqLwog ICBpbnQgd2luZG93X2NvdW50OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCiAgIC8qIEEgbm9uLXplcm8gdmFsdWUgaW4gc2xvdCBJRFggbWVh bnMgdGhhdCBwZXItYnVmZmVyIHZhcmlhYmxlCiAgICAgIHdpdGggaW5kZXggSURYIGhhcyBhIGxv Y2FsIHZhbHVlIGluIHRoaXMgYnVmZmVyLiAgVGhlIGluZGV4IElEWAogICAgICBmb3IgYSBidWZm ZXItbG9jYWwgdmFyaWFibGUgaXMgc3RvcmVkIGluIHRoYXQgdmFyaWFibGUncyBzbG90CiAgICAg IGluIGJ1ZmZlcl9sb2NhbF9mbGFncyBhcyBhIExpc3AgaW50ZWdlci4gIElmIHRoZSBpbmRleCBp cyAtMSwKICAgICAgdGhpcyBtZWFucyB0aGUgdmFyaWFibGUgaXMgYWx3YXlzIGxvY2FsIGluIGFs bCBidWZmZXJzLiAgKi8KLSNkZWZpbmUgTUFYX1BFUl9CVUZGRVJfVkFSUyA1MAorI2RlZmluZSBN QVhfUEVSX0JVRkZFUl9WQVJTIDYwCiAgIGNoYXIgbG9jYWxfZmxhZ3NbTUFYX1BFUl9CVUZGRVJf VkFSU107CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogU2V0IHRvIHRoZSBt b2R0aW1lIG9mIHRoZSB2aXNpdGVkIGZpbGUgd2hlbiByZWFkIG9yIHdyaXR0ZW4uCiAgICAgIG1v ZHRpbWUudHZfbnNlYyA9PSBOT05FWElTVEVOVF9NT0RUSU1FX05TRUNTIG1lYW5zCiAgICAgIHZp c2l0ZWQgZmlsZSB3YXMgbm9uZXhpc3RlbnQuICBtb2R0aW1lLnR2X25zZWMgPT0KQEAgLTkwMyw2 ICs5NDQsNjkgQEAgWEJVRkZFUiAoTGlzcF9PYmplY3QgYSkKIC8qIE1vc3QgY29kZSBzaG91bGQg dXNlIHRoZXNlIGZ1bmN0aW9ucyB0byBzZXQgTGlzcCBmaWVsZHMgaW4gc3RydWN0CiAgICBidWZm ZXIuICAoU29tZSBzZXR0ZXJzIHRoYXQgYXJlIHByaXZhdGUgdG8gYSBzaW5nbGUgLmMgZmlsZSBh cmUKICAgIGRlZmluZWQgYXMgc3RhdGljIGluIHRob3NlIGZpbGVzLikgICovCisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK0lOTElO RSB2b2lkCitic2V0X2Jsdl9tY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YnVmZmVyICpiLCBMaXNwX09i amVjdCB2YWwpCit7CisgIGItPmZjX3Zpc2libGVfID0gdmFsOworfQorCitJTkxJTkUgdm9pZAor YnNldF9ibHZfZmNfaW5hY3RpdmVfd2luZG93cyAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmpl Y3QgdmFsKQoreworICBiLT5mY19pbmFjdGl2ZV93aW5kb3dzXyA9IHZhbDsKK30KKworLyogZW5k IE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIElOTElO RSB2b2lkCiBic2V0X2JpZGlfcGFyYWdyYXBoX2RpcmVjdGlvbiAoc3RydWN0IGJ1ZmZlciAqYiwg TGlzcF9PYmplY3QgdmFsKQogewpkaWZmIC0tZ2l0IGEvc3JjL2Rpc3BleHRlcm4uaCBiL3NyYy9k aXNwZXh0ZXJuLmgKaW5kZXggMWE1MzY1Ni4uNGQ3NjdlYSAxMDA2NDQKLS0tIGEvc3JjL2Rpc3Bl eHRlcm4uaAorKysgYi9zcmMvZGlzcGV4dGVybi5oCkBAIC0xMDAsNiArMTAwLDEyOSBAQCB0eXBl ZGVmIGludCBDdXJzb3I7CiAjZGVmaW5lIE5hdGl2ZVJlY3RhbmdsZSBpbnQKICNlbmRpZgogCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLwor CitzdHJ1Y3QgZ2x5cGg7CisKK3N0cnVjdCBnbHlwaF9yb3c7CisKK3N0cnVjdCBnbHlwaF9tYXRy aXg7CisKK2VudW0gZHJhd19nbHlwaHNfZmFjZTsKKworZW51bSBnbHlwaF9yb3dfYXJlYTsKKwor c3RydWN0IG1jX21hdHJpeDsKKworZW51bSBtY19jYWNoZV90eXBlOworCitlbnVtIG1jX2N1cnNv cl90eXBlOworCitlbnVtIG1jX2ZsYXZvcjsKKworc3RydWN0IG1jX1JHQjsKKworc3RydWN0IG1j X2Vzc2VudGlhbHM7CisKK2VudW0gbWNfZHJhd19yb3dfdHlwZTsKKworZW51bSBtY19lbmdpbmVf dHlwZTsKKworZW51bSBtY19yb3dfcG9zaXRpb247CisKK2VudW0gbWNfcmVkcmF3X3Jvd190eXBl OworCitlbnVtIGRyYXdfZ2x5cGhfYWN0aW9uOworCitleHRlcm4gTGlzcF9PYmplY3QgbWNfbGlz dG4gKHB0cmRpZmZfdCwgTGlzcF9PYmplY3QsIC4uLik7CisKK2V4dGVybiBMaXNwX09iamVjdCBt Y19udGggKGludCwgTGlzcF9PYmplY3QpOworCitleHRlcm4gTGlzcF9PYmplY3QgbWNfYXNzcSAo TGlzcF9PYmplY3QsIExpc3BfT2JqZWN0KTsKKworZXh0ZXJuIGVudW0gbWNfcm93X3Bvc2l0aW9u IG1jX3Jvd19wb3NpdGlvbiAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhf cm93ICosIGludCk7CisKK2V4dGVybiBwdHJkaWZmX3QgbWNfcmVnaW9uX2xpbWl0IChib29sKTsK KworZXh0ZXJuIHN0cnVjdCBnbHlwaCAqIG1jX2dldF9jdXJzb3JfZ2x5cGggKHN0cnVjdCB3aW5k b3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKiwgaW50LCBpbnQpOworCitleHRlcm4g dm9pZCBtY194d19jb2xvcl92YWx1ZXMgKHN0cnVjdCB3aW5kb3cgKiwgTGlzcF9PYmplY3QsIHN0 cnVjdCBtY19SR0IgKik7CisKK2V4dG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fbWF0 cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0 IGdseXBoICosIGludCwgaW50LCBpbnQsIGludCwgaW50LCBpbnQsCisgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCwgc3RydWN0IGdseXBoX21hdHJpeCAqLAor ICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfZXNzZW50aWFscywgZW51bSBtY19yb3df cG9zaXRpb24sIHN0cnVjdCBtY19SR0IsCisgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNf ZW5naW5lX3R5cGUsIGJvb2wsIGVudW0gbWNfZHJhd19yb3dfdHlwZSwKKyAgICAgICAgICAgICAg ICAgICAgICAgZW51bSBtY19jYWNoZV90eXBlKTsKKworZXh0ZXJuIHZvaWQgbWNfc2V0X2Vzc2Vu dGlhbHMgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IG1jX2Vzc2VudGlhbHMgKik7CisKK2V4dGVy biB2b2lkIG1jX2RyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXgg Kiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBn bHlwaCAqLCBpbnQsIGludCwgaW50LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosCisgICAgICAgICAg ICAgICAgICAgICAgICAgc3RydWN0IG1jX2Vzc2VudGlhbHMsIGVudW0gbWNfcm93X3Bvc2l0aW9u LCBib29sLAorICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfZHJhd19yb3dfdHlwZSk7 CisKK2V4dGVybiBib29sIG1jX3JlZHJhd19yb3cgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGds eXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAg ICAgICBlbnVtIGdseXBoX3Jvd19hcmVhLCBpbnQsIGludCwgaW50LCBib29sLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlLCBlbnVtIG1jX3JlZHJhd19y b3dfdHlwZSk7CisKK2V4dGVybiB2b2lkIG1jX3Jlc2V0X2NhY2hlIChzdHJ1Y3Qgd2luZG93ICop OworCitleHRlcm4gdm9pZCBtY19kcmF3X2N1cnNvcl9nbHlwaCAoc3RydWN0IHdpbmRvdyAqLCBz dHJ1Y3QgZ2x5cGhfbWF0cml4ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg c3RydWN0IGdseXBoX3JvdyAqLCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIGludCwgc3RydWN0IG1jX1JHQiwgZW51bSBt Y19mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJz b3JfdHlwZSwgaW50LCBib29sLCBib29sKTsKKworZXh0ZXJuIHZvaWQgbWNfZXJhc2VfY3Vyc29y IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwgc3RydWN0IGdseXBoX3Jv dyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGludCwgaW50LCBpbnQsIGVu dW0gbWNfZmxhdm9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNv cl90eXBlLCBpbnQpOworCitleHRlcm4gdm9pZCBtY19kcmF3X2VyYXNlX2h5YnJpZCAoc3RydWN0 IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGludCwgaW50LCBpbnQsIGludCwg aW50LCBpbnQsIGludCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1j X2N1cnNvcl90eXBlLCBpbnQsIHN0cnVjdCBtY19SR0IsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYm9vbCwgZW51bSBtY19mbGF2b3IsIGJvb2wpOworCitleHRlcm4gaW50IG1j X2RyYXdfZ2x5cGhzIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwgc3Ry dWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBlbnVtIGds eXBoX3Jvd19hcmVhLCBwdHJkaWZmX3QsIHB0cmRpZmZfdCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSwgaW50LCBpbnQsIHN0cnVjdCBtY19SR0IsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2ZsYXZvciwgZW51bSBtY19jdXJzb3Jf dHlwZSwgaW50LCBib29sLCBib29sLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBk cmF3X2dseXBoX2FjdGlvbiwgYm9vbCk7CisKK2V4dGVybiBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICog bWNfc2F2ZV9nbHlwaF9tYXRyaXggKHN0cnVjdCBnbHlwaF9tYXRyaXggKik7CisKK2V4dGVybiB2 b2lkIG1jX3Jlc3RvcmVfZ2x5cGhfbWF0cml4IChzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVj dCBnbHlwaF9tYXRyaXggKik7CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAvKiBUZXh0IGN1cnNvciB0eXBlcy4gICovCiAKIGVudW0g dGV4dF9jdXJzb3Jfa2luZHMKQEAgLTM4Miw2ICs1MDUsMTggQEAgc3RydWN0IGdseXBoX3NsaWNl CiAKIHN0cnVjdCBnbHlwaAogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgIGludCByZWxhdGl2ZV94LCBocG9zOworCisgIHB0cmRpZmZf dCBieXRlcG9zOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFBvc2l0aW9u IGZyb20gd2hpY2ggdGhpcyBnbHlwaCB3YXMgZHJhd24uICBJZiBgb2JqZWN0JyBiZWxvdyBpcyBh CiAgICAgIExpc3Agc3RyaW5nLCB0aGlzIGlzIGFuIGluZGV4IGludG8gdGhhdCBzdHJpbmcuICBJ ZiBpdCBpcyBhCiAgICAgIGJ1ZmZlciwgdGhpcyBpcyBhIHBvc2l0aW9uIGluIHRoYXQgYnVmZmVy LiAgSW4gYWRkaXRpb24sIHNvbWUKQEAgLTEyNDgsNiArMTM4MywyOCBAQCBlbnVtIGRyYXdfZ2x5 cGhzX2ZhY2UKIAogc3RydWN0IGdseXBoX3N0cmluZwogeworCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgYm9vbF9iZiBsZWZ0X292ZXJ3 cml0dGVuX3AgOiAxOworCisgICAgYm9vbF9iZiByaWdodF9vdmVyd3JpdHRlbl9wIDogMTsKKwor ICAgIGJvb2xfYmYgcmVjdGFuZ2xlX251a2VkX3AgOiAxOworCisgICAgYm9vbF9iZiBiYWNrZ3Jv dW5kX251a2VkX3AgOiAxOworCisgICAgZW51bSBkcmF3X2dseXBoX2FjdGlvbgorICAgIHsKKyAg ICAgIE1DX0RSQVdfR0xZUEhfU1RSSU5HLAorICAgICAgTUNfRVJBU0VfR0xZUEhfU1RSSU5HCisg ICAgfSBhY3Rpb25fdHlwZTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBY LW9yaWdpbiBvZiB0aGUgc3RyaW5nLiAgKi8KICAgaW50IHg7CiAKQEAgLTI4MTIsNiArMjk2OSwy OCBAQCB0eXBlZGVmIHZvaWQgKCpmcmFtZV9wYXJtX2hhbmRsZXIpIChzdHJ1Y3QgZnJhbWUgKiwg TGlzcF9PYmplY3QsIExpc3BfT2JqZWN0KTsKIAogc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UK IHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBuc3Rlcm0ubWAgfCBgdzMydGVybS5jYCB8 IGB4dGVybS5jYCBtdXN0IGJlIGluIHRoZQorZXhhY3Qgc2FtZSBvcmRlciBhcyB0aGUgYHJlZGlz cGxheV9pbnRlcmZhY2UnIGluIGBkaXNwZXh0ZXJuLmhgISAqLworCisgIC8qIGBtY19uc19kcmF3 X3dpbmRvd19jdXJzb3InIHwgYG1jX3czMl9kcmF3X3dpbmRvd19jdXJzb3InIHwgYG1jX3hfZHJh d193aW5kb3dfY3Vyc29yJyAqLworICB2b2lkICgqbWNfc2NyaWJlX2N1cnNvcikgKHN0cnVjdCB3 aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwKKyAgICAgICAgc3RydWN0IGds eXBoX3JvdyAqZ2x5cGhfcm93LCBpbnQ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KysgYi9zcmMv ZGlzcG5ldy5jCkBAIC01Niw2ICs1NiwxODE1IEBAIGFsb25nIHdpdGggR05VIEVtYWNzLiAgSWYg bm90LCBzZWUgPGh0dHBzOi8vd3d3LmdudS5vcmcvbGljZW5zZXMvPi4gICovCiAjaW5jbHVkZSAi dzMyLmgiCiAjZW5kaWYKIAwKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2lu IE1VTFRJUExFLUNVUlNPUlMgKi8KKworc3RydWN0IGdseXBoc19za2lwcGVkCit7CisgIHB0cmRp ZmZfdCBhbGxvY2F0ZWQ7CisgIHB0cmRpZmZfdCB1c2VkOworICBzdHJ1Y3Qgc2tpcHBlZF9pdGVt cworICAgIHsKKyAgICAgIGludCB4OworICAgICAgaW50IGhwb3M7CisgICAgICBib29sIGVuYWJs ZWRfcDsKKyAgICB9ICpza2lwcGVkOworfSBhcnJheV9nbHlwaHNfc2tpcHBlZDsKKworc3RydWN0 IG1jX3Jvd19lbnRyeQoreworICBpbnQgb2xkX3VzZXMsIG5ld191c2VzOworICBpbnQgbmV3X2xp bmVfbnVtYmVyOworICBwdHJkaWZmX3QgYnVja2V0OworICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3c7 CisgIHN0cnVjdCBtY19yb3dfZW50cnkgKm5leHQ7Cit9Oworc3RhdGljIHN0cnVjdCBtY19yb3df ZW50cnkgKm1jX3Jvd19lbnRyeV9wb29sOworc3RhdGljIHB0cmRpZmZfdCBtY19yb3dfZW50cnlf cG9vbF9zaXplOworc3RhdGljIHB0cmRpZmZfdCBtY19yb3dfZW50cnlfaWR4Oworc3RhdGljIHN0 cnVjdCBtY19yb3dfZW50cnkgKiptY19yb3dfdGFibGU7CitzdGF0aWMgcHRyZGlmZl90IG1jX3Jv d190YWJsZV9zaXplOworc3RhdGljIHN0cnVjdCBtY19yb3dfZW50cnkgKiptY19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isgICAgeworICAgICAgc3RydWN0IGdseXBoX3JvdyAqZnJvbSA9IHNhdmVk LT5yb3dzICsgaTsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnRvID0gbWF0cml4LT5yb3dzICsg aTsKKyAgICAgIHB0cmRpZmZfdCBuYnl0ZXMgPSBmcm9tLT51c2VkW1RFWFRfQVJFQV0gKiBzaXpl b2YgKHN0cnVjdCBnbHlwaCk7CisgICAgICBtZW1jcHkgKHRvLT5nbHlwaHNbVEVYVF9BUkVBXSwg ZnJvbS0+Z2x5cGhzW1RFWFRfQVJFQV0sIG5ieXRlcyk7CisgICAgICB0by0+dXNlZFtURVhUX0FS RUFdID0gZnJvbS0+dXNlZFtURVhUX0FSRUFdOworICAgICAgdG8tPmhhc2ggPSBmcm9tLT5oYXNo OworICAgICAgdG8tPnggPSBmcm9tLT54OworICAgICAgdG8tPnkgPSBmcm9tLT55OworICAgICAg dG8tPnBpeGVsX3dpZHRoID0gZnJvbS0+cGl4ZWxfd2lkdGg7CisgICAgICB0by0+YXNjZW50ID0g ZnJvbS0+YXNjZW50OworICAgICAgdG8tPmhlaWdodCA9IGZyb20tPmhlaWdodDsKKyAgICAgIHRv LT5waHlzX2FzY2VudCA9IGZyb20tPnBoeXNfYXNjZW50OworICAgICAgdG8tPnBoeXNfaGVpZ2h0 ID0gZnJvbS0+cGh5c19oZWlnaHQ7CisgICAgICB0by0+dmlzaWJsZV9oZWlnaHQgPSBmcm9tLT52 aXNpYmxlX2hlaWdodDsKKyAgICAgIHRvLT5leHRyYV9saW5lX3NwYWNpbmcgPSBmcm9tLT5leHRy YV9saW5lX3NwYWNpbmc7CisgICAgICB0by0+c3RhcnQgPSBmcm9tLT5zdGFydDsKKyAgICAgIHRv LT5lbmQgPSBmcm9tLT5lbmQ7CisgICAgICB0by0+bWlucG9zID0gZnJvbS0+bWlucG9zOworICAg ICAgdG8tPm1heHBvcyA9IGZyb20tPm1heHBvczsKKyAgICAgIHRvLT5vdmVybGF5X2F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X21hdHJpeCA9IHctPmN1cnJlbnRf bWF0cml4OworICBpbnQgeWIgPSB3aW5kb3dfdGV4dF9ib3R0b21feSAodyk7CisgIHB0cmRpZmZf dCBpOworICBpbnQgaiwgZmlyc3Rfb2xkLCBmaXJzdF9uZXcsIGxhc3Rfb2xkLCBsYXN0X25ldzsK KyAgaW50IG5ydW5zLCBydW5faWR4OworICBwdHJkaWZmX3QgbjsKKyAgc3RydWN0IG1jX3Jvd19l bnRyeSAqZW50cnk7CisgIC8vIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlICpyaWYgPSBGUkFN RV9SSUYgKFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSkpOworICAvKiBTa2lwIG92ZXIgcm93cyBl cXVhbCBhdCB0aGUgc3RhcnQuICovCisgIGZvciAoaSA9IGhlYWRlcl9saW5lX3A7IGkgPCBjdXJy ZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgeworICAgICAgc3RydWN0IGdseXBoX3Jv dyAqZCA9IE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCBpKTsKKyAgICAgIHN0cnVjdCBnbHlw aF9yb3cgKmMgPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSk7CisgICAgICBpZiAoYy0+ ZW5hYmxlZF9wCisgICAgICAgICAgJiYgZC0+ZW5hYmxlZF9wCisgICAgICAgICAgJiYgIWQtPnJl ZHJhd19mcmluZ2VfYml0bWFwc19wCisgICAgICAgICAgJiYgYy0+eSA9PSBkLT55CisgICAgICAg ICAgJiYgTUFUUklYX1JPV19CT1RUT01fWSAoYykgPD0geWIKKyAgICAgICAgICAmJiBNQVRSSVhf Uk9XX0JPVFRPTV9ZIChkKSA8PSB5YgorICAgICAgICAgICYmIHJvd19lcXVhbF9wIChjLCBkLCAx KSkKKyAgICAgICAgeworICAgICAgICAgIGFzc2lnbl9yb3cgKGMsIGQpOworICAgICAgICAgIGQt PmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBi cmVhazsKKyAgICB9CisjaWZkZWYgSEFWRV9YV0lER0VUUworICAvKiBDdXJyZW50bHkgdGhpcyBz ZWVtcyBuZWVkZWQgdG8gZGV0ZWN0IHh3aWRnZXQgbW92ZW1lbnQgcmVsaWFibHkuICovCisgICAg cmV0dXJuIDA7CisjZW5kaWYKKyAgLyogR2l2ZSB1cCBpZiBzb21lIHJvd3MgaW4gdGhlIGRlc2ly ZWQgbWF0cml4IGFyZSBub3QgZW5hYmxlZC4gKi8KKyAgaWYgKCEgTUFUUklYX1JPV19FTkFCTEVE X1AgKGRlc2lyZWRfbWF0cml4LCBpKSkKKyAgICByZXR1cm4gLTE7CisgIGZpcnN0X29sZCA9IGZp cnN0X25ldyA9IGk7CisgIC8qIFNldCBsYXN0X25ldyB0byB0aGUgaW5kZXggKyAxIG9mIHRoZSBy b3cgdGhhdCByZWFjaGVzIHRoZQorICAgICBib3R0b20gYm91bmRhcnkgaW4gdGhlIGRlc2lyZWQg bWF0cml4LiAgR2l2ZSB1cCBpZiB3ZSBmaW5kIGEKKyAgICAgZGlzYWJsZWQgcm93IGJlZm9yZSB3 ZSByZWFjaCB0aGUgYm90dG9tIGJvdW5kYXJ5LiAqLworICBpID0gZmlyc3RfbmV3ICsgMTsKKyAg d2hpbGUgKGkgPCBkZXNpcmVkX21hdHJpeC0+bnJvd3MgLSAxKQorICAgIHsKKyAgICAgIGludCBi b3R0b207CisgICAgICBpZiAoISBNQVRSSVhfUk9XX0VOQUJMRURfUCAoZGVzaXJlZF9tYXRyaXgs IGkpKQorICAgICAgICByZXR1cm4gMDsKKyAgICAgIGJvdHRvbSA9IE1BVFJJWF9ST1dfQk9UVE9N X1kgKE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCBpKSk7CisgICAgICBpZiAoYm90dG9tIDw9 IHliKQorICAgICAgICArK2k7CisgICAgICBpZiAoYm90dG9tID49IHliKQorICAgICAgICBicmVh azsKKyAgICB9CisgIGxhc3RfbmV3ID0gaTsKKyAgLyogU2V0IGxhc3Rfb2xkIHRvIHRoZSBpbmRl eCArIDEgb2YgdGhlIHJvdyB0aGF0IHJlYWNoZXMgdGhlIGJvdHRvbQorICAgICBib3VuZGFyeSBp biB0aGUgY3VycmVudCBtYXRyaXguICBXZSBkb24ndCBsb29rIGF0IHRoZSBlbmFibGVkCisgICAg IGZsYWcgaGVyZSBiZWNhdXNlIHdlIHBsYW4gdG8gcmV1c2UgcGFydCBvZiB0aGUgZGlzcGxheSBl dmVuIGlmCisgICAgIG90aGVyIHBhcnRzIGFyZSBkaXNhYmxlZC4gKi8KKyAgaSA9IGZpcnN0X29s ZCArIDE7CisgIHdoaWxlIChpIDwgY3VycmVudF9tYXRyaXgtPm5yb3dzIC0gMSkKKyAgICB7Cisg ICAgICBpbnQgYm90dG9tID0gTUFUUklYX1JPV19CT1RUT01fWSAoTUFUUklYX1JPVyAoY3VycmVu dF9tYXRyaXgsIGkpKTsKKyAgICAgIGlmIChib3R0b20gPD0geWIpCisgICAgICAgICsraTsKKyAg ICAgIGlmIChib3R0b20gPj0geWIpCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgbGFzdF9vbGQg PSBpOworICAvKiBTa2lwIG92ZXIgcm93cyBlcXVhbCBhdCB0aGUgYm90dG9tLiAqLworICBpID0g bGFzdF9uZXc7CisgIGogPSBsYXN0X29sZDsKKyAgd2hpbGUgKGkgLSAxID4gZmlyc3RfbmV3Cisg ICAgICAgICAmJiBqIC0gMSA+IGZpcnN0X29sZAorICAgICAgICAgJiYgTUFUUklYX1JPV19FTkFC TEVEX1AgKGN1cnJlbnRfbWF0cml4LCBqIC0gMSkKKyAgICAgICAgICYmIChNQVRSSVhfUk9XIChj dXJyZW50X21hdHJpeCwgaiAtIDEpLT55CisgICAgICAgICAgICAgPT0gTUFUUklYX1JPVyAoZGVz aXJlZF9tYXRyaXgsIGkgLSAxKS0+eSkKKyAgICAgICAgICYmICFNQVR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p IHdvdWxkIGJlIDEyNy4gKi8KKyAgeworICAgIHZlcmlmeSAoTkVYVF9BTE1PU1RfUFJJTUVfTElN SVQgPT0gMTEpOworICAgIGVudW0geyBuZXh0X2FsbW9zdF9wcmltZV9pbmNyZW1lbnRfbWF4ID0g MTAgfTsKKyAgICBwdHJkaWZmX3Qgcm93X3RhYmxlX21heCA9CisgICAgICAobWluIChQVFJESUZG X01BWCwgU0laRV9NQVgpIC8gKDMgKiBzaXplb2YgKm1jX3Jvd190YWJsZSkKKyAgICAgICAtIG5l eHRfYWxtb3N0X3ByaW1lX2luY3JlbWVudF9tYXgpOworICAgIHB0cmRpZmZfdCBjdXJyZW50X25y b3dzX21heCA9IHJvd190YWJsZV9tYXggLSBkZXNpcmVkX21hdHJpeC0+bnJvd3M7CisgICAgaWYg KGN1cnJlbnRfbnJvd3NfbWF4IDwgY3VycmVudF9tYXRyaXgtPm5yb3dzKQorICAgICAgbWVtb3J5 X2Z1bGwgKFNJWkVfTUFYKTsKKyAgfQorICAvKiBSZWFsbG9jYXRlIHZlY3RvcnMsIHRhYmxlcyBl dGMuIGlmIG5lY2Vzc2FyeS4gKi8KKyAgaWYgKGN1cnJlbnRfbWF0cml4LT5ucm93cyA+IG1jX29s ZF9saW5lc19zaXplKQorICAgIG1jX29sZF9saW5lcyA9IHhwYWxsb2MgKG1jX29sZF9saW5lcywg Jm1jX29sZF9saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfbWF0 cml4LT5ucm93cyAtIG1jX29sZF9saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAg IElOVF9NQVgsIHNpemVvZiAqbWNfb2xkX2xpbmVzKTsKKyAgaWYgKGRlc2lyZWRfbWF0cml4LT5u cm93cyA+IG1jX25ld19saW5lc19zaXplKQorICAgIG1jX25ld19saW5lcyA9IHhwYWxsb2MgKG1j X25ld19saW5lcywgJm1jX25ld19saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAg IGRlc2lyZWRfbWF0cml4LT5ucm93cyAtIG1jX25ld19saW5lc19zaXplLAorICAgICAgICAgICAg ICAgICAgICAgICAgIElOVF9NQVgsIHNpemVvZiAqbWNfbmV3X2xpbmVzKTsKKyAgbiA9IGRlc2ly ZWRfbWF0cml4LT5ucm93czsKKyAgbiArPSBjdXJyZW50X21hdHJpeC0+bnJvd3M7CisgIGlmICht Y19yb3dfdGFibGVfc2l6ZSA8IDMgKiBuKQorICAgIHsKKyAgICAgIHB0cmRpZmZfdCBzaXplID0g bmV4dF9hbG1vc3RfcHJpbWUgKDMgKiBuKTsKKyAgICAgIG1jX3Jvd190YWJsZSA9IHhucmVhbGxv YyAobWNfcm93X3RhYmxlLCBzaXplLCBzaXplb2YgKm1jX3Jvd190YWJsZSk7CisgICAgICBtY19y b3dfdGFibGVfc2l6ZSA9IHNpemU7CisgICAgICBtZW1zZXQgKG1jX3Jvd190YWJsZSwgMCwgc2l6 ZSAqIHNpemVvZiAqbWNfcm93X3RhYmxlKTsKKyAgICB9CisgIGlmIChuID4gbWNfcm93X2VudHJ5 X3Bvb2xfc2l6ZSkKKyAgICBtY19yb3dfZW50cnlfcG9vbCA9IHhwYWxsb2MgKG1jX3Jvd19lbnRy eV9wb29sLCAmbWNfcm93X2VudHJ5X3Bvb2xfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIG4gLSBtY19yb3dfZW50cnlfcG9vbF9zaXplLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgLTEsIHNpemVvZiAqbWNfcm93X2VudHJ5X3Bvb2wpOworICBpZiAoZGVzaXJlZF9t YXRyaXgtPm5yb3dzID4gbWNfcnVuc19zaXplKQorICAgIHsKKyAgICAgIG1jX3J1bnMgPSB4bnJl YWxsb2MgKG1jX3J1bnMsIGRlc2lyZWRfbWF0cml4LT5ucm93cywgc2l6ZW9mICptY19ydW5zKTsK KyAgICAgIG1jX3J1bl9wb29sID0geG5yZWFsbG9jIChtY19ydW5fcG9vbCwgZGVzaXJlZF9tYXRy aXgtPm5yb3dzLCBzaXplb2YgKm1jX3J1bl9wb29sKTsKKyAgICAgIG1jX3J1bnNfc2l6ZSA9IGRl c2lyZWRfbWF0cml4LT5ucm93czsKKyAgICB9CisgIG5ydW5zID0gcnVuX2lkeCA9IDA7CisgIG1j X3Jvd19lbnRyeV9pZHggPSAwOworICAvKiBBZGQgcm93cyBmcm9tIHRoZSBjdXJyZW50IGFuZCBk ZXNpcmVkIG1hdHJpeCB0byB0aGUgaGFzaCB0YWJsZQorICAgICByb3dfaGFzaF90YWJsZSB0byBi ZSBhYmxlIHRvIGZpbmQgZXF1YWwgb25lcyBxdWlja2x5LiAqLworICBmb3IgKGkgPSBmaXJzdF9v bGQ7IGkgPCBsYXN0X29sZDsgKytpKQorICAgIHsKKyAgICAgIGlmIChNQVRSSVhfUk9XX0VOQUJM RURfUCAoY3VycmVudF9tYXRyaXgsIGkpKQorICAgICAgICB7CisgICAgICAgICAgZW50cnkgPSBt Y19hZGRfcm93X2VudHJ5IChNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSkpOworICAgICAg ICAgIG1jX29sZF9saW5lc1tpXSA9IGVudHJ5OworICAgICAgICAgICsrZW50cnktPm9sZF91c2Vz OworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIG1jX29sZF9saW5lc1tpXSA9IE5VTEw7 CisgICAgfQorICBmb3IgKGkgPSBmaXJzdF9uZXc7IGkgPCBsYXN0X25ldzsgKytpKQorICAgIHsK KyAgICAgIGVhc3NlcnQgKE1BVFJJWF9ST1dfRU5BQkxFRF9QIChkZXNpcmVkX21hdHJpeCwgaSkp OworICAgICAgZW50cnkgPSBtY19hZGRfcm93X2VudHJ5IChNQVRSSVhfUk9XIChkZXNpcmVkX21h dHJpeCwgaSkpOworICAgICAgKytlbnRyeS0+bmV3X3VzZXM7CisgICAgICBlbnRyeS0+bmV3X2xp bmVfbnVtYmVyID0gaTsKKyAgICAgIG1jX25ld19saW5lc1tpXSA9IGVudHJ5OworICAgIH0KKyAg LyogSWRlbnRpZnkgbW92ZXMgYmFzZWQgb24gbGluZXMgdGhhdCBhcmUgdW5pcXVlIGFuZCBlcXVh bAorICAgICBpbiBib3RoIG1hdHJpY2VzLiAqLworICBmb3IgKGkgPSBmaXJzdF9vbGQ7IGkgPCBs YXN0X29sZDspCisgICAgaWYgKG1jX29sZF9saW5lc1tpXQorICAgICAgICAmJiBtY19vbGRfbGlu ZXNbaV0tPm9sZF91c2VzID09IDEKKyAgICAgICAgJiYgbWNfb2xkX2xpbmVzW2ldLT5uZXdfdXNl cyA9PSAxKQorICAgICAgeworICAgICAgICBpbnQgcCwgcTsKKyAgICAgICAgaW50IG5ld19saW5l ID0gbWNfb2xkX2xpbmVzW2ldLT5uZXdfbGluZV9udW1iZXI7CisgICAgICAgIHN0cnVjdCBydW4g KnJ1biA9IG1jX3J1bl9wb29sICsgcnVuX2lkeCsrOworICAgICAgICAvKiBSZWNvcmQgbW92ZS4g Ki8KKyAgICAgICAgcnVuLT5jdXJyZW50X3Zwb3MgPSBpOworICAgICAgICBydW4tPmN1cnJlbnRf eSA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBpKS0+eTsKKyAgICAgICAgcnVuLT5kZXNp cmVkX3Zwb3MgPSBuZXdfbGluZTsKKyAgICAgICAgcnVuLT5kZXNpcmVkX3kgPSBNQVRSSVhfUk9X IChkZXNpcmVkX21hdHJpeCwgbmV3X2xpbmUpLT55OworICAgICAgICBydW4tPm5yb3dzID0gMTsK KyAgICAgICAgcnVuLT5oZWlnaHQgPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSktPmhl aWdodDsKKyAgICAgICAgLyogRXh0ZW5kIGJhY2t3YXJkLiAqLworICAgICAgICBwID0gaSAtIDE7 CisgICAgICAgIHEgPSBuZXdfbGluZSAtIDE7CisgICAgICAgIHdoaWxlIChwID4gZmlyc3Rfb2xk CisgICAgICAgICAgICAgICAmJiBxID4gZmlyc3RfbmV3CisgICAgICAgICAgICAgICAmJiBtY19v bGRfbGluZXNbcF0gPT0gbWNfbmV3X2xpbmVzW3FdKQorICAgICAgICAgIHsKKyAgICAgICAgICAg IGludCBoID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIHApLT5oZWlnaHQ7CisgICAgICAg ICAgICAtLXJ1bi0+Y3VycmVudF92cG9zOworICAgICAgICAgICAgLS1ydW4tPmRlc2lyZWRfdnBv czsKKyAgICAgICAgICAgICsrcnVuLT5ucm93czsKKyAgICAgICAgICAgIHJ1bi0+aGVpZ2h0ICs9 IGg7CisgICAgICAgICAgICBydW4tPmRlc2lyZWRfeSAtPSBoOworICAgICAgICAgICAgcnVuLT5j dXJyZW50X3kgLT0gaDsKKyAgICAgICAgICAgIC0tcCwgLS1xOworICAgICAgICAgIH0KKyAgICAg ICAgLyogRXh0ZW5kIGZvcndhcmQuICovCisgICAgICAgIHAgPSBpICsgMTsKKyAgICAgICAgcSA9 IG5ld19saW5lICsgMTsKKyAgICAgICAgd2hpbGUgKHAgPCBsYXN0X29sZAorICAgICAgICAgICAg ICAgJiYgcSA8IGxhc3RfbmV3CisgICAgICAgICAgICAgICAmJiBtY19vbGRfbGluZXNbcF0gPT0g bWNfbmV3X2xpbmVzW3FdKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCBoID0gTUFUUklY X1JPVyAoY3VycmVudF9tYXRyaXgsIHApLT5oZWlnaHQ7CisgICAgICAgICAgICArK3J1bi0+bnJv d3M7CisgICAgICAgICAgICBydW4tPmhlaWdodCArPSBoOworICAgICAgICAgICAgKytwLCArK3E7 CisgICAgICAgICAgfQorICAgICAgICAvKiBJbnNlcnQgcnVuIGludG8gbGlzdCBvZiBhbGwgcnVu cy4gIE9yZGVyIHJ1bnMgYnkgY29waWVkCisgICAgICAgICAgIHBpeGVsIGxpbmVzLiAgTm90ZSB0 aGF0IHdlIHJlY29yZCBydW5zIHRoYXQgZG9uJ3QgaGF2ZSB0bworICAgICAgICAgICBiZSBjb3Bp ZWQgYmVjYXVzZSB0aGV5IGFyZSBhbHJlYWR5IGluIHBsYWNlLiAgVGhpcyBpcyBkb25lCisgICAg ICAgICAgIGJlY2F1c2Ugd2UgY2FuIGF2b2lkIGNhbGxpbmcgdXBkYXRlX3dpbmRvd19saW5lIGlu IHRoaXMKKyAgICAgICAgICAgY2FzZS4gKi8KKyAgICAgICAgZm9yIChwID0gMDsgcCA8IG5ydW5z ICYmIG1jX3J1bnNbcF0tPmhlaWdodCA+IHJ1bi0+aGVpZ2h0OyArK3ApCisgICAgICAgICAgOwor ICAgICAgICBmb3IgKHEgPSBucnVuczsgcSA+IHA7IC0tcSkKKyAgICAgICAgICBtY19ydW5zW3Fd ID0gbWNfcnVuc1txIC0gMV07CisgICAgICAgIG1jX3J1bnNbcF0gPSBydW47CisgICAgICAgICsr bnJ1bnM7CisgICAgICAgIGkgKz0gcnVuLT5ucm93czsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAg ICAgICAgKytpOworICAvKiBEbyB0aGUgbW92ZXMuICBEbyBpdCBpbiBhIHdheSB0aGF0IHdlIGRv bid0IG92ZXJ3cml0ZSBzb21ldGhpbmcKKyAgICAgd2Ugd2FudCB0byBjb3B5IGxhdGVyIG9uLiAg VGhpcyBpcyBub3Qgc29sdmFibGUgaW4gZ2VuZXJhbAorICAgICBiZWNhdXNlIHRoZXJlIGlzIG9u bHkgb25lIGRpc3BsYXkgYW5kIHdlIGRvbid0IGhhdmUgYSB3YXkgdG8KKyAgICAgZXhjaGFuZ2Ug YXJlYXMgb24gdGhpcyBkaXNwbGF5LiAgRXhhbXBsZToKKyAgICAgICAgICArLS0tLS0tLS0tLS0r ICAgICAgICstLS0tLS0tLS0tLSsKKyAgICAgICAgICB8ICAgICBBICAgICB8ICAgICAgIHwgICAg IEIgICAgIHwKKyAgICAgICAgICArLS0tLS0tLS0tLS0rICAtLT4gICstLS0tLS0tLS0tLSsKKyAg ICAgICAgICB8ICAgICBCICAgICB8ICAgICAgIHwgICAgIEEgICAgIHwKKyAgICAgICAgICArLS0t LS0tLS0tLS0rICAgICAgICstLS0tLS0tLS0tLSsKKyAgICAgSW5zdGVhZCwgcHJlZmVyIGJpZ2dl ciBtb3ZlcywgYW5kIGludmFsaWRhdGUgbW92ZXMgdGhhdCB3b3VsZAorICAgICBjb3B5IGZyb20g d2hlcmUgd2UgY29waWVkIHRvLiAqLworICBmb3IgKGkgPSAwOyBpIDwgbnJ1bnM7ICsraSkKKyAg ICBpZiAobWNfcnVuc1tpXS0+bnJvd3MgPiAwKQorICAgICAgeworICAgICAgICBzdHJ1Y3QgcnVu ICpyID0gbWNfcnVuc1tpXTsKKyAgICAgICAgaWYgKHItPmN1cnJlbnRfeSAhPSByLT5kZXNpcmVk X3kpCisgICAgICAgICAgeworICAgICAgICAgICAgLy8gIGZwcmludGYgKHN0ZGVyciwgIiVzOiAg ci0+Y3VycmVudC9kZXNpcmVkX3Zwb3MgKCVkLyVkKSB8IHItPmN1cnJlbnQvZGVzaXJlZF95ICgl ZC8lZClcbiIsCisgICAgICAgICAgICAvLyAgICAgICAgICAgci0+Y3VycmVudF95IDwgci0+ZGVz aXJlZF95ID8gIuKGkyIgOiAi4oaRIiwKKyAgICAgICAgICAgIC8vICAgICAgICAgICByLT5jdXJy ZW50X3Zwb3MsIHItPmRlc2lyZWRfdnBvcywgci0+Y3VycmVudF95LCByLT5kZXNpcmVkX3kpOwor ICAgICAgICAgICAgLy8gIHJpZi0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOworICAgICAg ICAgICAgLy8gIHJpZi0+c2Nyb2xsX3J1bl9ob29rICh3LCByKTsKKyAgICAgICAgICB9CisgICAg ICAgIC8qIFRydW5jYXRlIHJ1bnMgdGhhdCBjb3B5IHRvIHdoZXJlIHdlIGNvcGllZCB0bywgYW5k CisgICAgICAgICAgIGludmFsaWRhdGUgcnVucyB0aGF0IGNvcHkgZnJvbSB3aGVyZSB3ZSBjb3Bp ZWQgdG8uICovCisgICAgICAgIGZvciAoaiA9IG5ydW5zIC0gMTsgaiA+IGk7IC0taikKKyAgICAg ICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgcnVuICpwID0gbWNfcnVuc1tqXTsKKyAgICAgICAg ICAgIGJvb2wgdHJ1bmNhdGVkX3AgPSAwOworICAgICAgICAgICAgaWYgKHAtPm5yb3dzID4gMAor ICAgICAgICAgICAgICAgICYmIHAtPmRlc2lyZWRfeSA8IHItPmRlc2lyZWRfeSArIHItPmhlaWdo dAorICAgICAgICAgICAgICAgICYmIHAtPmRlc2lyZWRfeSArIHAtPmhlaWdodCA+IHItPmRlc2ly ZWRfeSkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChwLT5kZXNpcmVkX3kg PCByLT5kZXNpcmVkX3kpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg IHAtPm5yb3dzID0gci0+ZGVzaXJlZF92cG9zIC0gcC0+ZGVzaXJlZF92cG9zOworICAgICAgICAg ICAgICAgICAgICBwLT5oZWlnaHQgPSByLT5kZXNpcmVkX3kgLSBwLT5kZXNpcmVkX3k7CisgICAg ICAgICAgICAgICAgICAgIHRydW5jYXRlZF9wID0gMTsKKyAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgIGludCBucm93c19jb3BpZWQgPSAoci0+ZGVzaXJlZF92cG9zICsgci0+bnJvd3MKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHAtPmRlc2lyZWRfdnBvcyk7Cisg ICAgICAgICAgICAgICAgICAgIGlmIChwLT5ucm93cyA8PSBucm93c19jb3BpZWQpCisgICAgICAg ICAgICAgICAgICAgICAgcC0+bnJvd3MgPSAwOworICAgICAgICAgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgaW50 IGhlaWdodF9jb3BpZWQgPSAoci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gcC0+ZGVzaXJlZF95KTsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgcC0+Y3VycmVudF92cG9zICs9IG5yb3dzX2NvcGllZDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgcC0+ZGVzaXJlZF92cG9zICs9IG5yb3dzX2NvcGllZDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+bnJvd3MgLT0gbnJvd3NfY29waWVkOworICAg ICAgICAgICAgICAgICAgICAgICAgICBwLT5jdXJyZW50X3kgKz0gaGVpZ2h0X2NvcGllZDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgcC0+ZGVzaXJlZF95ICs9IGhlaWdodF9jb3BpZWQ7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmhlaWdodCAtPSBoZWlnaHRfY29waWVkOworICAg ICAgICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZWRfcCA9IDE7CisgICAgICAgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgIGlmIChyLT5jdXJyZW50X3kgIT0gci0+ZGVzaXJlZF95CisgICAgICAgICAgICAgICAgLyog VGhlIGNvbmRpdGlvbiBiZWxvdyBpcyBlcXVpdmFsZW50IHRvCisgICAgICAgICAgICAgICAgICAg KChwLT5jdXJyZW50X3kgPj0gci0+ZGVzaXJlZF95CisgICAgICAgICAgICAgICAgICAgICAmJiBw LT5jdXJyZW50X3kgPCByLT5kZXNpcmVkX3kgKyByLT5oZWlnaHQpCisgICAgICAgICAgICAgICAg ICAgIHx8IChwLT5jdXJyZW50X3kgKyBwLT5oZWlnaHQgPiByLT5kZXNpcmVkX3kKKyAgICAgICAg ICAgICAgICAgICAgICAgICYmIChwLT5jdXJyZW50X3kgKyBwLT5oZWlnaHQKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICA8PSByLT5kZXNpcmVkX3kgKyByLT5oZWlnaHQpKSkKKyAgICAgICAg ICAgICAgICAgICBiZWNhdXNlIHdlIGhhdmUgMCA8IHAtPmhlaWdodCA8PSByLT5oZWlnaHQuICov CisgICAgICAgICAgICAgICAgJiYgcC0+Y3VycmVudF95IDwgci0+ZGVzaXJlZF95ICsgci0+aGVp Z2h0CisgICAgICAgICAgICAgICAgJiYgcC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0ID4gci0+ZGVz aXJlZF95KQorICAgICAgICAgICAgICBwLT5ucm93cyA9IDA7CisgICAgICAgICAgICAvKiBSZW9y ZGVyIHJ1bnMgYnkgY29waWVkIHBpeGVsIGxpbmVzIGlmIHRydW5jYXRlZC4gKi8KKyAgICAgICAg ICAgIGlmICh0cnVuY2F0ZWRfcCAmJiBwLT5ucm93cyA+IDApCisgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICBpbnQgayA9IG5ydW5zIC0gMTsKKyAgICAgICAgICAgICAgICB3aGlsZSAo bWNfcnVuc1trXS0+bnJvd3MgPT0gMCB8fCBtY19ydW5zW2tdLT5oZWlnaHQgPCBwLT5oZWlnaHQp CisgICAgICAgICAgICAgICAgICBrLS07CisgICAgICAgICAgICAgICAgbWVtbW92ZSAobWNfcnVu cyArIGosIG1jX3J1bnMgKyBqICsgMSwgKGsgLSBqKSAqIHNpemVvZiAoKm1jX3J1bnMpKTsKKyAg ICAgICAgICAgICAgICBtY19ydW5zW2tdID0gcDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAg IH0KKyAgICAgICAgLyogQXNzaWduIG1hdHJpeCByb3dzLiAqLworICAgICAgICBmb3IgKGogPSAw OyBqIDwgci0+bnJvd3M7ICsraikKKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5 cGhfcm93ICpmcm9tLCAqdG87CisgICAgIC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YnkKKyAgYG1ha2VfY3VycmVudCcgaW4gYHVwZGF0ZV93aW5kb3dfbGlu ZScsIG9yIGJlY2F1c2UgdGhlIHByZXZpb3VzIHJvdyB3b3VsZCBiZQorICB0aGUgc2FtZSBpbiBi b3RoIG1hdHJpY2VzIGlmIHdlIGp1bXBlZCB0byBgc2V0X2N1cnNvcjpgIHdpdGhpbiBgdXBkYXRl X3dpbmRvdycKKyAgYW5kIGBtY191cGRhdGVfd2luZG93X2RyeXJ1bicuICovCisgIGludCBwcmV2 X21hdHJpeF9yb3dfc3RhcnRfYnl0ZXBvcyA9ICh2cG9zICE9IDApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19TVEFSVF9CWVRFUE9TIChjdXJyZW50 X3JvdyAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogLTE7Cisg IGludCBwcmV2X21hdHJpeF9yb3dfZW5kX2J5dGVwb3MgPSAodnBvcyAhPSAwKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VORF9CWVRFUE9TIChjdXJy ZW50X3JvdyAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IC0xOwor ICBpbnQgbWF0cml4X3Jvd19zdGFydF9ieXRlcG9zID0gTUFUUklYX1JPV19TVEFSVF9CWVRFUE9T IChkZXNpcmVkX3Jvdyk7CisgIGludCBtYXRyaXhfcm93X2VuZF9ieXRlcG9zID0gTUFUUklYX1JP V19FTkRfQllURVBPUyAoZGVzaXJlZF9yb3cpOworICAvKiBUaGUgZmlyc3QgY29uZGl0aW9uIHRl c3RzIGZvciBhIHNvbGl0YXJ5IHJvdyBjb250YWluaW5nIFpWLCBwcmVjZWRlZCBieSBhCisgIHJv dyBjb250YWluaW5nIGEgcGVudWx0aW1hdGUgZ2x5cGggd2l0aCBhIGNoYXJwb3Mgb2YgWlYgLSAx IGZvbGxvd2VkIGJ5IGFuIGVuZAorICBvZiByb3cgc3BhY2UgZ2x5cGggd2l0aCBhIGNoYXJwb3Mg b2YgMC4gIFRoZSBvdGhlciBjb25kaXRpb25zIHRlc3QgZm9yIGFuIGVtcHR5CisgIGJ1ZmZlciAo bm90IG5hcnJvd2VkKSwgb3IgYW4gZW1wdHkgbmFycm93ZWQgYnVmZmVyLiAqLworICBib29sIHJv d19hdF96dl9wID0gKCh2cG9zICE9IDAKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgKGN1cnJl bnRfcm93IC0gMSktPnVzZWRbVEVYVF9BUkVBXSA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAg JiYgcHJldl9tYXRyaXhfcm93X3N0YXJ0X2J5dGVwb3MgIT0gcHJldl9tYXRyaXhfcm93X2VuZF9i eXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAgICYmICEoY3VycmVudF9yb3cgLSAxKS0+ZW5k c19hdF96dl9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIG1hdHJpeF9yb3dfc3RhcnRfYnl0 ZXBvcyA9PSBtYXRyaXhfcm93X2VuZF9ieXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAgICYm IGRlc2lyZWRfcm93LT5lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgfHwgKCgo aGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID09IDEpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICB8fCAoaGVhZGVyX2xpbmVfZm9ybWF0ID09IDAgJiYgdnBvcyA9PSAwKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgYnVmZmVyX25hcnJvd2VkX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgYm9iX3Jlc3BlY3RfbmFycm93ID09IGVvYl9yZXNwZWN0X25hcnJvdykK KyAgICAgICAgICAgICAgICAgICAgICB8fCAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZw b3MgPT0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChoZWFkZXJfbGluZV9mb3Jt YXQgPT0gMCAmJiB2cG9zID09IDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBib2Jf ZGlzcmVnYXJkX25hcnJvdyA9PSBlb2JfZGlzcmVnYXJkX25hcnJvdykpOworICAvKiBJZiBsaW5l LW51bWJlcnMgYXJlIGFjdGl2ZSwgdGhlbiBzcGFjZSBnbHlwaCBwYWRkaW5nIGVxdWFsIHRvIGl0 cyB3aWR0aAorICBjb3VudGVkIGluIEhQT1MgYXJlIGZvbGxvd2VkIGJ5IGEgc2luZ2xlIHJvdyBl bmQgc3BhY2UgZ2x5cGguICBMaW5lIG51bWJlcgorICBwYWRkaW5nIHNwYWNlIGdseXBocyBoYXZl IGEgY2hhcnBvcyBvZiAtMSwgd2hlcmVhcyB0aGUgZW5kIG9mIHJvdyBzcGFjZSBnbHlwaAorICBo YXMgYSBjaGFycG9zIG9mIDAuICBJZiBsaW5lIG51bWJlcnMgYXJlIGluYWN0aXZlLCB0aGVuIHRo ZSByb3cgd2lsbCBjb250YWluCisgIGEgc29saXRhcnkgc3BhY2UgZ2x5cGggd2l0aCBhIGNoYXJw b3Mgb2YgLTEuICovCisgIGJvb2wgcm93X2JleW9uZF96dl9wID0gKG1hdHJpeF9yb3dfc3RhcnRf Ynl0ZXBvcyA9PSBtYXRyaXhfcm93X2VuZF9ieXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAg ICAgICYmICFyb3dfYXRfenZfcCk7CisgIHJldHVybiAocm93X2F0X3p2X3ApCisgICAgICAgICAg ID8gQVRfWlYKKyAgICAgICAgIDogKHJvd19iZXlvbmRfenZfcCkKKyAgICAgICAgICAgPyBQT1NU X1pWCisgICAgICAgICA6IFBSRV9aVjsKK30KKworLyogVXBkYXRlIHRoZSBkaXNwbGF5IG9mIHRo ZSB0ZXh0IGFyZWEgb2Ygcm93IFZQT1MgaW4gd2luZG93IFcuCisgICBWY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ChzdGRlcnIsICJtY191cGRhdGVfdGV4dF9hcmVhICglcyk6ICB2cG9zICgl ZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgbWNfd2luZG93ICh3KSwgdnBvcyk7CisgIC8q IEluYXNtdWNoIGFzIHdlIHByb2Nlc3MgdGhlIGN1cnNvciByb3cgYmVmb3JlIGFsbCBvdGhlciBy b3dzLCB3ZSBjYW4gcmVseQorICB1cG9uIHRoZSBwcmV2aW91cyBgZGVzaXJlZF9yb3dgIHRvIGJl IGFjY3VyYXRlLiAqLworICBlbnVtIG1jX3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24gPSAgbWNf cm93X3Bvc2l0aW9uICh3LCB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZGVzaXJlZF9yb3cK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBjdXJyZW50X3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZGVzaXJlZF9yb3csIHZwb3MpOworICAvKiBJZiByb3dzIGFyZSBh dCBkaWZmZXJlbnQgWCBvciBZLCBvciByb3dzIGhhdmUgZGlmZmVyZW50IGhlaWdodCwKKyAgICAg b3IgdGhlIGN1cnJlbnQgcm93IGlzIG1hcmtlZCBpbnZhbGlkLCB3cml0ZSB0aGUgZW50aXJlIGxp bmUuICovCisgIGlmICghY3VycmVudF9yb3ctPmVuYWJsZWRfcAorICAgICAgfHwgZGVzaXJlZF9y b3ctPnkgIT0gY3VycmVudF9yb3ctPnkKKyAgICAgIHx8IGRlc2lyZWRfcm93LT5hc2NlbnQgIT0g Y3VycmVudF9yb3ctPmFzY2VudAorICAgICAgfHwgZGVzaXJlZF9yb3ctPnBoeXNfYXNjZW50ICE9 IGN1cnJlbnRfcm93LT5waHlzX2Fz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VEUgRU5USVJFIFJP VzpcblwKKyAgICAgICAgICB2cG9zICglZCkgfCBjaGFyICglZC8lcykgfCBzdGFydF94OiAoJWQp IHwgc3RhcnRfaHBvcyAoJWQvJWQpXG4iLAorICAgICAgICAgIHZwb3MsIGRlc2lyZWRfcm93LT5n bHlwaHNbVEVYVF9BUkVBXS0+dS5jaCwKKyAgICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAoZGVz aXJlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdLT51LmNoKSwKKyAgICAgICAgICBkZXNpcmVkX3Jv dy0+eCwgMCwgZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpOworICAgICAgaWYgKGRl c2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgIHsKKyAgICAgICAgICBibG9ja19p bnB1dCAoKTsKKyAgICAgICAgICBpbnQgbGVuID0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVB XTsKKyAgICAgICAgICBpbnQgaHBvcyA9IGRlc2lyZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSAt IHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICB3LT5vdXRwdXRfY3Vy c29yLnggPQorICAgICAgICAgICAgbWNfZHJhd19nbHlwaHMgKHcsIGRlc2lyZWRfbWF0cml4LCB1 cGRhdGVkX3Jvdywgdy0+b3V0cHV0X2N1cnNvci54LAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgIFRFWFRfQVJFQSwgaHBvcywgaHBvcyArIGxlbiwgRFJBV19OT1JNQUxfVEVYVCwgMCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29y X3R5cGUsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZl X3AsIGN1cnNvcl9nY19wLCBNQ19EUkFXX0dMWV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dGhhdCB0aGUgZmFjZSBleHRlbnNpb24g YWN0dWFsbHkgdGFrZXMgcGxhY2UuICovCisgICAgICAgIGlmIChNQVRSSVhfUk9XX0VYVEVORFNf RkFDRV9QIChkZXNpcmVkX3JvdykKKyAgICAgICAgICAgICYmIChkZXNpcmVkX3N0b3BfcG9zIDwg Y3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgIHx8IChkZXNpcmVk X3N0b3BfcG9zID09IGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAg ICAgICAgJiYgIU1BVFJJWF9ST1dfRVhURU5EU19GQUNFX1AgKGN1cnJlbnRfcm93KSkpKQorICAg ICAgICAgIC0tZGVzaXJlZF9zdG9wX3BvczsKKyAgICAgICAgc3RvcCA9IG1pbiAoY3VycmVudF9y b3ctPnVzZWRbVEVYVF9BUkVBXSwgZGVzaXJlZF9zdG9wX3Bvcyk7CisgICAgICAgIGkgPSAwOwor ICAgICAgICB4ID0gZGVzaXJlZF9yb3ctPng7CisgICAgICAgIGludCBjbGVhcl90b194ID0gMDsK KworICAgICAgICAvKiBMb29wIG92ZXIgZ2x5cGhzIHRoYXQgY3VycmVudCBhbmQgZGVzaXJlZCBy b3cgbWF5IGhhdmUgaW4gY29tbW9uLiAqLworICAgICAgICB3aGlsZSAoaSA8IHN0b3ApCisgICAg ICAgICAgeworICAgICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCA9IDA7CisgICAg ICAgICAgICBib29sIGNhbl9za2lwX3AgPSAhYWJvcnRfc2tpcHBpbmc7CisgICAgICAgICAgICAv KiBTa2lwIG92ZXIgZ2x5cGhzIHRoYXQgYm90aCByb3dzIGhhdmUgaW4gY29tbW9uLiAgVGhlc2Ug ZG9uJ3QgaGF2ZQorICAgICAgICAgICAgdG8gYmUgd3JpdHRlbi4gIFdlIGNhbid0IHNraXAgaWYg dGhlIGxhc3QgY3VycmVudCBnbHlwaCBvdmVybGFwcyB0aGUKKyAgICAgICAgICAgIGdseXBoIHRv IGl0cyByaWdodC4gIEZvciBleGFtcGxlLCBjb25zaWRlciBhIGN1cnJlbnQgcm93IG9mIGBpZicg d2l0aAorICAgICAgICAgICAgdGhlIGBmJyBpbiBDb3VyaWVyIGJvbGQgc28gdGhhdCBpdCBvdmVy bGFwcyB0aGUgYCAnIHRvIGl0cyByaWdodC4KKyAgICAgICAgICAgIElmIHRoZSBkZXNpcmVkIHJv dyBpcyBgICcsIHdlIHdvdWxkIHNraXAgb3ZlciB0aGUgc3BhY2UgYWZ0ZXIgdGhlCisgICAgICAg ICAgICBgaWYnIGFuZCB0aGVyZSB3b3VsZCByZW1haW4gYSBwaXhlbCBmcm9tIHRoZSBgZicgb24g dGhlIHNjcmVlbi4gKi8KKyAgICAgICAgICAgIGlmIChvdmVybGFwcGluZ19nbHlwaHNfcCAmJiBp ID4gMCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5 cGggPSAmY3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FSRUFdW2kgLSAxXTsKKyAgICAgICAgICAg ICAgICBpbnQgbGVmdCwgcmlnaHQ7CisgICAgICAgICAgICAgICAgcmlmLT5nZXRfZ2x5cGhfb3Zl cmhhbmdzIChnbHlwaCwgWEZSQU1FICh3LT5mcmFtZSksICZsZWZ0LCAmcmlnaHQpOworICAgICAg ICAgICAgICAgIGNhbl9za2lwX3AgPSAocmlnaHQgPT0gMCAmJiAhYWJvcnRfc2tpcHBpbmcpOwor ICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoY2FuX3NraXBfcCkKKyAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgIGludCBzdGFydF9ocG9zID0gaTsKKyAgICAgICAgICAgICAg ICB3aGlsZSAoaSA8IHN0b3AKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgR0xZUEhfRVFVQUxf UCAoZGVzaXJlZF9nbHlwaCwgY3VycmVudF9nbHlwaCkpCisgICAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICAgICsrYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZDsKKyAgICAgICAg ICAgICAgICAgICAgaWYgKGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZCA8IGFycmF5X2ds eXBoc19za2lwcGVkLnVzZWQpCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICAgICAgaW50IG9sZF9hbGxvYyA9IGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRl ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBuZXdfZWx0cyA9IGFycmF5X2dseXBoc19z a2lwcGVkLnVzZWQgLSBhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQ7CisgICAgICAgICAg ICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkID0KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgeHBhbGxvYyAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmFycmF5X2dseXBoc19za2lwcGVkLmFs bG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElOVF9NQVgsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAqYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBl ZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtZW1zZXQgKGFycmF5X2dseXBoc19za2lwcGVk LnNraXBwZWQgKyBvbGRfYWxsb2MsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkIC0gb2xkX2FsbG9jKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAqIHNpemVvZiAqYXJyYXlfZ2x5cGhzX3NraXBwZWQu c2tpcHBlZCk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBp bnQgbnRoID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCAtIDE7CisgICAgICAgICAgICAgICAg ICAgIGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbbnRoXS54ID0geDsKKyAgICAgICAgICAg ICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLmhwb3MgPSBpOworICAg ICAgICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkW250aF0uZW5hYmxl ZF9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgeCArPSBkZXNpcmVkX2dseXBoLT5waXhl bF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgKytkZXNpcmVkX2dseXBoLCArK2N1cnJlbnRf Z2x5cGgsICsraTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvKiBDb25z aWRlciB0aGUgY2FzZSB0aGF0IHRoZSBjdXJyZW50IHJvdyBjb250YWlucyAieHh4IHBwcCBnZ2ci IGluCisgICAgICAgICAgICAgICAgaXRhbGljIENvdXJpZXIgZm9udCwgYW5kIHRoZSBkZXNpcmVk IHJvdyBpcyAieHh4IGdnZyIuICBUaGUgY2hhcmFjdGVyIGBwJworICAgICAgICAgICAgICAgIGhh cyBsYmVhcmluZywgYGcnIGhhcyBub3QuICBUaGUgbG9vcCBhYm92ZSB3aWxsIHN0b3AgaW4gZnJv bnQgb2YgdGhlCisgICAgICAgICAgICAgICAgZmlyc3QgYHAnIGluIHRoZSBjdXJyZW50IHJvdy4g IElmIHdlIHdvdWxkIHN0YXJ0IHdyaXRpbmcgZ2x5cGhzIHRoZXJlLCB3ZQorICAgICAgICAgICAg ICAgIHdvdWxkbid0IGVyYXNlIHRoZSBsYmVhcmluZyBvZiB0aGUgYHAnLiAgVGhlIHJlc3Qgb2Yg dGhlIGxiZWFyaW5nIHByb2JsZW0KKyAgICAgICAgICAgICAgICBpcyB0aGVuIHRha2VuIGNhcmUg b2YgYnkgZHJhd19nbHlwaHMuICovCisgICAgICAgICAgICAgICAgaWYgKG92ZXJsYXBwaW5nX2ds eXBoc19wCisgICAgICAgICAgICAgICAgICAgICYmIGkgPiAwCisgICAgICAgICAgICAgICAgICAg ICYmIGkgPCBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAg ICYmIChjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IGRlc2lyZWRfcm93LT51c2VkW1RF WFRfQVJFQV0pKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpbnQg bGVmdCwgcmlnaHQ7CisgICAgICAgICAgICAgICAgICAgIHJpZi0+Z2V0X2dseXBoX292ZXJoYW5n cyAoY3VycmVudF9nbHlwaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBYRlJBTUUgKHct PmZyYW1lKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbGVmdCwgJnJpZ2h0KTsKKyAg ICAgICAgICAgICAgICAgICAgd2hpbGUgKGxlZnQgPiAwICYmIGkgPiAwKQorICAgICAgICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC0taSwgLS1kZXNpcmVkX2dseXBo LCAtLWN1cnJlbnRfZ2x5cGg7CisgICAgICAgICAgICAgICAgICAgICAgICB4IC09IGRlc2lyZWRf Z2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgbGVmdCAtPSBkZXNp cmVkX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgICAgICAgIC8qIEFib3J0IHRoZSBza2lwcGluZyBhbGdvcml0aG0gaWYgd2UgZW5kIHVw IGJlZm9yZQorICAgICAgICAgICAgICAgICAgICAgICBvdXIgc3RhcnRpbmcgcG9pbnQsIHRvIGF2 b2lkIGxvb3BpbmcgKGJ1ZyMxMDcwKS4KKyAgICAgICAgICAgICAgICAgICAgICAgVGhpcyBjYW4g aGFwcGVuIHdoZW4gdGhlIGxiZWFyaW5nIGlzIGxhcmdlciB0aGFuCisgICAgICAgICAgICAgICAg ICAgICAgIHRoZSBwaXhlbCB3aWR0aC4gKi8KKyAgICAgICAgICAgICAgICAgICAgYWJvcnRfc2tp cHBpbmcgPSAoaSA8IHN0YXJ0X2hwb3MpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAvKiBUcnkgdG8gYXZvaWQgd3JpdGluZyB0aGUgZW50aXJlIHJl c3Qgb2YgdGhlIGRlc2lyZWQgcm93CisgICAgICAgICAgICAgICBieSBsb29raW5nIGZvciBhIHJl c3luYyBwb2ludC4gIFRoaXMgbWFpbmx5IHByZXZlbnRzCisgICAgICAgICAgICAgICBtb2RlIGxp bmUgZmxpY2tlcmluZyBpbiB0aGUgY2FzZSB0aGUgbW9kZSBsaW5lIGlzIGluCisgICAgICAgICAg ICAgICBmaXhlZC1waXRjaCBmb250LCB3aGljaCBpdCB1c3VhbGx5IHdpbGwgYmUuICovCisgICAg ICAgICAgICBpZiAoaSA8IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICBpbnQgc3RhcnRfeCA9IHgsIHN0YXJ0X2hwb3MgPSBpOwor ICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqc3RhcnQgPSBkZXNpcmVkX2dseXBoOworICAg ICAgICAgICAgICAgIGludCBjdXJyZW50X3ggPSB4OworICAgICAgICAgICAgICAgIGJvb2wgc2tp cF9maXJzdF9wID0gIWNhbl9za2lwX3A7CisgICAgICAgICAgICAgICAgLyogRmluZCB0aGUgbmV4 dCBnbHlwaCB0aGF0J3MgZXF1YWwgYWdhaW4uICovCisgICAgICAgICAgICAgICAgd2hpbGUgKGkg PCBzdG9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIChza2lwX2ZpcnN0X3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgIHx8ICFHTFlQSF9FUVVBTF9QIChkZXNpcmVkX2dseXBoLCBjdXJy ZW50X2dseXBoKSkKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgeCA9PSBjdXJyZW50X3gpCisg ICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHggKz0gZGVzaXJlZF9nbHlw aC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfeCArPSBjdXJyZW50 X2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgKytkZXNpcmVkX2dseXBo LCArK2N1cnJlbnRfZ2x5cGgsICsraTsKKyAgICAgICAgICAgICAgICAgICAgc2tpcF9maXJzdF9w ID0gMDsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmb3IgKGludCBlbHQg PSAwOworICAgICAgICAgICAgICAgICAgICAgZWx0IDwgYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNl ZDsKKyAgICAgICAgICAgICAgICAgICAgICsrZWx0KQorICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICBpbnQgeCA9IGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbZWx0 XS54OworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGFycmF5X2dseXBoc19za2lwcGVk LnNraXBwZWRbZWx0XS5ocG9zOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnRh cmdldF9nbHlwaCA9CisgICAgICAgICAgICAgICAgICAgICAgbWNfZ2V0X2N1cnNvcl9nbHlwaCAo dywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBocG9zLCB2cG9zKTsKKyAgICAgICAgICAg ICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZiAoc3Rk ZXJyLCAiU0tJUFBFRDogIHZwb3MgKCVkKSB8IGNoYXIgKCVkLyVzKSB8IHg6ICglZCkgfCBocG9z ICglZC8lZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9z LCB0YXJnZXRfZ2x5cGgtPnUuY2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBtY19jaGFyX3RvX3N0cmluZyAodGFyZ2V0X2dseXBoLT51LmNoKSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHgsIGhwb3MsIHVwZGF0ZWRfcm93LT51c2VkW1RF WFRfQVJFQV0gLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgbWNfZHJhd19yb3cgKHcsIGRlc2ly ZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCB4LCAxLCB2cG9zLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93 X3Bvc2l0aW9uLCBkcmF3X3AsIFNLSVBQRUQpOworICAgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICAgIGlmIChpID09IHN0YXJ0X2hwb3MgfHwgeCAhPSBjdXJyZW50X3gpCisgICAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGkgPSBzdGFydF9ocG9zOworICAgICAg ICAgICAgICAgICAgICB4ID0gc3RhcnRfeDsKKyAgICAgICAgICAgICAgICAgICAgZGVzaXJlZF9n bHlwaCA9IHN0YXJ0OworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9zLCBzdGFydF9o cG9zLCBkZXNpcmVkX3Jvdy0+eSwgc3RhcnRfeCk7CisgICAgICAgICAgICAgICAgLyogUmUtZHJh dyBhIHBvcnRpb24gb2YgdGhlIHJvdy4gKi8KKyAgICAgICAgICAgICAgICBpZiAoZGVidWdfcCkK KyAgICAgICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlJFRFJBVyBTRUdNRU5UOlxuXAor ICAgICAgICAgICAgICAgICAgICB2cG9zICglZCkgfCBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwg aHBvcyAoJWQvJWQpIHwgbGVuZ3RoICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgIHZwb3Ms IHN0YXJ0LT51LmNoLCBtY19jaGFyX3RvX3N0cmluZyAoc3RhcnQtPnUuY2gpLAorICAgICAgICAg ICAgICAgICAgICBzdGFydF94LCBzdGFydF9ocG9zLCB1cGRhdGVkX3Jvdy0+dXNlZFtURVhUX0FS RUFdIC0gMSwgaSAtIHN0YXJ0X2hwb3MpOworICAgICAgICAgICAgICAgIGJsb2NrX2lucHV0ICgp OworICAgICAgICAgICAgICAgIGludCBsZW4gPSBpIC0gc3RhcnRfaHBvczsKKyAgICAgICAgICAg ICAgICBpbnQgaHBvcyA9IHN0YXJ0IC0gdXBkYXRlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdOwor ICAgICAgICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9CisgICAgICAgICAgICAgICAgICBt Y19kcmF3X2dseXBocyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB3LT5vdXRwdXRf Y3Vyc29yLngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVEVYVF9BUkVBLCBo cG9zLCBocG9zICsgbGVuLCBEUkFXX05PUk1BTF9URVhULAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDAsIHZwb3MsIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2Qs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwg Y3Vyc29yX2djX3AsIE1DX0RSQVdfR0xZUEhfU1RSSU5HLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGRyYXdfcCk7CisgICAgICAgICAgICAgICAgdy0+b3V0cHV0X2N1cnNvci5o cG9zICs9IGxlbjsKKyAgICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAg ICAgICAgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHN0YXJ0 LCBzdGFydF94LCBpIC0gc3RhcnRfaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg dnBvcywgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsIFND UklCRV9UV08pOworICAgICAgICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgICAg IH0KKyAgICAgICAgICB9CisKKyAgICAgICAgLyogV3JpdGUgdGhlIHJlc3QuICovCisgICAgICAg IGlmIChpIDwgZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICB7CisgICAg ICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9zLCBpLCBkZXNpcmVkX3Jvdy0+eSwgeCk7 CisgICAgICAgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJy LCAiRFJBVyBSRU1BSU5ERVIgT0YgVEhFIFJPVzpcblwKKyAgICAgICAgICAgICAgICB2cG9zICgl ZCkgfCBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwgaHBvcyAoJWQvJWQpIHwgbGVuZ3RoICglZClc biIsCisgICAgICAgICAgICAgICAgdnBvcywgZGVzaXJlZF9nbHlwaC0+dS5jaCwgbWNfY2hhcl90 b19zdHJpbmcgKGRlc2lyZWRfZ2x5cGgtPnUuY2gpLAorICAgICAgICAgICAgICAgIHgsIGksIGRl c2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxLCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FS RUFdIC0gaSk7CisgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgIGludCBs ZW4gPSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gaTsKKyAgICAgICAgICAgIGludCBo cG9zID0gZGVzaXJlZF9nbHlwaCAtIHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAg ICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9CisgICAgICAgICAgICAgIG1jX2RyYXdfZ2x5 cGhzICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHctPm91dHB1dF9jdXJzb3IueCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRFWFRfQVJFQSwgaHBvcywgaHBvcyArIGxl biwgRFJBV19OT1JNQUxfVEVYVCwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZw b3MsIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCwgTUNfRFJBV19H TFlQSF9TVFJJTkcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3ApOworICAg ICAgICAgICAgdy0+b3V0cHV0X2N1cnNvci5ocG9zICs9IGxlbjsKKyAgICAgICAgICAgIHVuYmxv Y2tfaW5wdXQgKCk7CisgICAgICAgICAgICAvKiBGSVhNRTogIEFsdGhvdWdoIHdlIG5lZWQgdG8g dXBkYXRlIHRoZSBjYWNoZSBiZXR3ZWVuIHRoZSBlbmQgb2YKKyAgICAgICAgICAgIHVwZGF0ZWRf cm93IGFuZCB0aGUgcmlnaHQgd2luZG93IGVkZ2UsIGl0IGlzIG5vdCBuZWNlc3NhcnkgdG8gZHJh dworICAgICAgICAgICAgdGhvc2UgZmFrZSBjdXJzb3JzLiBBbHRob3VnaCB3ZSBtYXkgbm90IGJl IGFibGUgdG8gc2VlIGl0IHdpdGggdGhlCisgICAgICAgICAgICBuYWtlZCBleWUsIHRob3NlIGZh a2UgY3Vyc29ycyBhcmUgYmVpbmcgc3VwZXJpbXBvc2VkIG9uIHRoZSBleGlzdGluZworICAgICAg ICAgICAgZmFrZSBjdXJzb3JzIHRoYXQgZG8gbm90IGdldCBlcmFzZWQgYnkgdGhlIGNvZGUgaW4g dGhlIHNlY3Rpb24gYmVsb3cuCisgICAgICAgICAgICBJdCB3b3VsZCBiZSBiZXR0ZXIgdG8gb25s eSB1cGRhdGUgdGhlIGNhY2hlIGFuZCBzdXBwcmVzcyBkb3VibGUtZHJhd2luZworICAgICAgICAg ICAgdGhlIGZha2UgY3Vyc29ycyBmb3IgdGhlIGFmb3JlbWVudGlvbmVkIGFyZWEgYXQgaXNzdWUu ICovCisgICAgICAgICAgICBtY19kcmF3X3JvdyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRf cm93LCBkZXNpcmVkX2dseXBoLCB4LAorICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2lyZWRf cm93LT51c2VkW1RFWFRfQVJFQV0gLSBpLCB2cG9zLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAg ICAgICAgICAgICAgICAgIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgZHJhd19wLCBTQ1JJQkVf VEhSRUUpOworICAgICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAgICAgICAgICB9CisgICAgICAg ICAgLyogRXZlcnl0aGluZyBhZnRlciB0aGUgcHJldmlvdXMgY2hhbmdlIHJlbWFpbmVkIHRoZSBz YW1lLiAgYGlgIGFuZCBgeGAgd2VyZQorICAgICAgICAgIGluY3JlbWVudGVkIHRvIHRoZSBlbmQg b2YgdGhlIGdseXBoIHJvdy4gIGkgPT0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAg ICAgICAgIFRoZSBgdy0+b3V0cHV0X2N1cnNvci54L3kvaHBvcy92cG9zYCBpcyBhdCB0aGUgZW5k IG9mIHRoZSBwcmV2aW91cyBjaGFuZ2UuCisgICAgICAgICAgV2hlbiB0aGlzIHNpdHVhdGlvbiBl eGlzdHMsIHRoZSBkaXN0YW5jZSBiZXR3ZWVuIHRoZSBlbmQgb2YgdGhlIGdseXBoIHJvdyBhbmQK KyAgICAgICAgICB0aGUgcmlnaHQgZWRnZSBvZiB0aGUgd2luZG93IHdpbGwgX25vdF8gYmUgY2xl YXJlZC4gIFRoZXJlZm9yZSwgaXQgaXMgb2theSB0bworICAgICAgICAgIGRyYXcgdGhlIGZsb2F0 aW5nIGdseXBocyBmb3IgdGhlIGhvcml6b250YWwvdmVydGljYWwgcnVsZXJzIGhlcmUuICovCisg ICAgICAgICAgZWxzZSBpZiAoY2hhbmdlZF9wCisgICAgICAgICAgICAgICAgICAgJiYgdy0+b3V0 cHV0X2N1cnNvci5ocG9zICE9IHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIGludCB4ID0gdy0+b3V0cHV0X2N1cnNvci54OworICAgICAg ICAgICAgICBpbnQgaHBvcyA9IHctPm91dHB1dF9jdXJzb3IuaHBvczsKKyAgICAgICAgICAgICAg c3RydWN0IGdseXBoICpzdGFydCA9IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGRlc2lyZWRfbWF0 cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgdXBkYXRlZF9yb3csIGhwb3MsIHZwb3MpOworICAgICAgICAgICAgICBpZiAody0+b3V0 cHV0X2N1cnNvci54ID09IHVwZGF0ZWRfcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAg ICB4IC09IHN0YXJ0LT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisg ICAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiUE9TVC1DSEFOR0VEOiAgdnBvcyAoJWQp IHwgeCAoJWQpIHwgaHBvcyAoJWQvJWQpIHwgY2hhciAoJWQvJXMpXG4iLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgdnBvcywgeCwgaHBvcywgdXBkYXRlZF9yb3ctPnVzZWRbVEVY VF9BUkVBXSAtIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydC0+dS5j aCwgbWNfY2hhcl90b19zdHJpbmcgKHN0YXJ0LT51LmNoKSk7CisgICAgICAgICAgICAgIG1jX2Ry YXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHN0YXJ0LCB4LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIGhwb3Ms IHZwb3MsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRp YWxzLCByb3dfcG9zaXRpb24sIGRyYXdfcCwgUE9TVF9DSEFOR0VEKTsKKyAgICAgICAgICAgIH0K KyAgICAgICAgICAgIC8qIFRoZXJlIHdlcmUgbm8gY2hhbmdlcyBhbmQgaSA9PSBkZXNpcmVkX3Jv dy0+dXNlZFtURVhUX0FSRUFdICovCisgICAgICAgICAgICBlbHNlIGlmICghY2hhbmdlZF9wKQor ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgICAg ICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJVTkNIQU5HRUQgLS0gV1JJVEUgRU5USVJFIExJTkU6 ICB2cG9zICglZCkgfCByb3ctPnVzZWQgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgdnBvcywgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpOworICAg ICAgICAgICAgICAgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3cs IGRlc2lyZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgZGVzaXJlZF9yb3ctPngsIGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0sIHZwb3Ms CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMs IHJvd19wb3NpdGlvbiwgZHJhd19wLCBVTkNIQU5HRUQpOworICAgICAgICAgICAgICB9CisKKyAg ICAgICAgLyogTWF5YmUgY2xlYXIgdG8gZW5kIG9mIGxpbmUuICovCisgICAgICAgIGlmIChNQVRS SVhfUk9XX0VYVEVORFNfRkFDRV9QIChkZXNpcmVkX3JvdykpCisgICAgICAgICAgeworICAgICAg ICAgICAgLyogSWYgbmV3IHJvdyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRleHQgYXJlYSwg bm90aGluZworICAgICAgICAgICAgICAgaGFzIHRvIGJlIGNsZWFyZWQsIGlmIGFuZCBvbmx5IGlm IHdlIGRpZCBhIHdyaXRlX2dseXBocworICAgICAgICAgICAgICAgYWJvdmUuICBUaGlzIGlzIG1h ZGUgc3VyZSBieSBzZXR0aW5nIGRlc2lyZWRfc3RvcF9wb3MKKyAgICAgICAgICAgICAgIGFwcHJv cHJpYXRlbHkgYWJvdmUuICovCisgICAgICAgICAgICBlYXNzZXJ0IChpIDwgZGVzaXJlZF9yb3ct PnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgfHwgKChkZXNpcmVkX3Jvdy0+ dXNlZFtURVhUX0FSRUFdID09IGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgTUFUUklYX1JPV19FWFRFTkRTX0ZBQ0VfUCAoY3VycmVudF9y b3cpKSk7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKE1BVFJJWF9ST1dfRVhURU5E U19GQUNFX1AgKGN1cnJlbnRfcm93KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyog SWYgb2xkIHJvdyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRleHQgYXJlYSwgY2xlYXIuICov CisgICAgICAgICAgICAgIGlmIChpID49IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisg ICAgICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgaSwgZGVzaXJlZF9yb3ct PnksIGRlc2lyZWRfcm93LT5waXhlbF93aWR0aCk7CisgICAgICAgICAgICAgIGlmIChkcmF3X3Ap CisgICAgICAgICAgICAgICAgcmlmLT5jbGVhcl9lbmRfb2ZfbGluZSAodywgdXBkYXRlZF9yb3cs IFRFWFRfQVJFQSwgLTEpOworICAgICAgICAgICAgICBjbGVhcl90b194ID0gLTE7CisgICAgICAg ICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlm IChkZXNpcmVkX3Jvdy0+cGl4ZWxfd2lkdGggPCBjdXJyZW50X3Jvdy0+cGl4ZWxfd2lkdGgpCisg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBPdGhlcndpc2UgY2xlYXIgdG8gdGhl IGVuZCBvZiB0aGUgb2xkIHJvdy4gIEV2ZXJ5dGhpbmcKKyAgICAgICAgICAgICAgICAgICBhZnRl ciB0aGF0IHBvc2l0aW9uIHNob3VsZCBiZSBjbGVhciBhbHJlYWR5LiAqLworICAgICAgICAgICAg ICAgIGludCB4bGltOworICAgICAgICAgICAgICAgIGlmIChpID49IGRlc2lyZWRfcm93LT51c2Vk W1RFWFRfQVJFQV0pCisgICAgICAgICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9z LCBpLCBkZXNpcmVkX3Jvdy0+eSwgZGVzaXJlZF9yb3ctPnBpeGVsX3dpZHRoKTsKKyAgICAgICAg ICAgICAgICAvKiBJZiBjdXJzb3IgaXMgZGlzcGxheWVkIGF0IHRoZSBlbmQgb2YgdGhlIGxpbmUs IG1ha2Ugc3VyZQorICAgICAgICAgICAgICAgICAgIGl0J3MgY2xlYXJlZC4gIE5vd2FkYXlzIHdl IGRvbid0IGhhdmUgYSBwaHlzX2N1cnNvcl9nbHlwaAorICAgICAgICAgICAgICAgICAgIHdpdGgg d2hpY2ggdG8gZXJhc2UgdGhlIGN1cnNvciAoYmVjYXVzZSB0aGlzIG1ldGhvZAorICAgICAgICAg ICAgICAgICAgIGRvZXNuJ3Qgd29yayB3aXRoIGxiZWFyaW5nL3JiZWFyaW5nKSwgc28gd2UgbXVz dCBkbyBpdCB0aGlzIHdheS4gKi8KKyAgICAgICAgICAgICAgICBpZiAodnBvcyA9PSB3LT5waHlz X2N1cnNvci52cG9zCisgICAgICAgICAgICAgICAgICAgICYmIChkZXNpcmVkX3Jvdy0+cmV2ZXJz ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgPyAody0+cGh5c19jdXJzb3IuaHBvcyA8IDAp CisgICAgICAgICAgICAgICAgICAgICAgICA6ICh3LT5waHlzX2N1cnNvci5ocG9zID49IGRlc2ly ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pKSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgICAgdy0+cGh5c19jdXJzb3Jfb25fcCA9IDA7CisgICAgICAgICAgICAgICAgICAg IHhsaW0gPSAtMTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICAgICAgeGxpbSA9IGN1cnJlbnRfcm93LT5waXhlbF93aWR0aDsKKyAg ICAgICAgICAgICAgICBpZiAoZHJhd19wKQorICAgICAgICAgICAgICAgICAgcmlmLT5jbGVhcl9l bmRfb2ZfbGluZSAodywgdXBkYXRlZF9yb3csIFRFWFRfQVJFQSwgeGxpbSk7CisgICAgICAgICAg ICAgICAgY2xlYXJfdG9feCA9IHhsaW07CisgICAgICAgICAgICAgICAgY2hhbmdlZF9wID0gMTsK KyAgICAgICAgICAgICAgfQorCisgICAgICAgIGlmIChjaGFuZ2VkX3AKKyAgICAgICAgICAgICYm IGNsZWFyX3RvX3ggIT0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgdGV4dF9hcmVh X3dpZHRoID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgIHN0 cnVjdCBtY19SR0IgZGVidWdfZmcgPSB7LnJlZCA9IDAuODY3LCAuZ3JlZW4gPSAwLjg2NywgLmJs dWUgPSAwLjg2N307CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnRhcmdldF9nbHlwaCA9Cisg ICAgICAgICAgICAgIHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHVwZGF0ZWRfcm93 LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgICAgICAgLyogYG1jX2VuZ2luZScgb25seSBk cmF3cyBhbiBNQ19HTFlQSCB3aGVuIHggPCB1cGRhdGVkX3Jvdy0+cGl4ZWxfd2lkdGguCisgICAg ICAgICAgICBUaGUgY3VycmVudCBkZXNpZ24gaW5oaWJpdHMgZHJhd2luZyBvdmVyIGFuIGV4aXN0 aW5nIGdseXBoIGF0IHRoZSBlbmQgb2YgYQorICAgICAgICAgICAgd29yZC13cmFwcGVkIGxpbmUu ICBTYWlkIGdseXBoIHJlY2VpdmVzIGEgZmFrZSBjdXJzb3IgaW4gZWl0aGVyIG9uZSBvZiB0aGUK KyAgICAgICAgICAgIHByZXZpb3VzIHNlY3Rpb25zIGFib3ZlLCBhbmQgc2hvdWxkIG5vdCBiZSBv dmVyd3JpdHRlbiB3aXRoIGFub3RoZXIgb25lLgorICAgICAgICAgICAgVGhpcyBkZXNpZ24gaXMg bmVlZGVkIGJlY2F1c2UgYSB3b3JkLXdyYXBwZWQgbGluZSBkb2VzIG5vdCByZWNlaXZlIGFuIGV4 dHJhCisgICAgICAgICAgICBzcGFjZSBsaWtlIG5vbi13b3JkLXdyYXBwZWQgbGluZXMgZG8uICov CisgICAgICAgICAgICBpbnQgeCA9IHVwZGF0ZWRfcm93LT5waXhlbF93aWR0aDsKKyAgICAgICAg ICAgIGludCBocG9zID0gdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDE7CisgICAgICAg ICAgICBpbnQgeF9saW1pdCA9IChjbGVhcl90b194ID09IC0xKQorICAgICAgICAgICAgICAgICAg ICAgICAgICA/IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICA6IGNs ZWFyX3RvX3g7CisgICAgICAgICAgICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKyAg ICAgICAgICAgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgICAgICAgICAgIHN0cnVjdCBidWZmZXIg KmIgPSBYQlVGRkVSIChidWYpOworICAgICAgICAgICAgYm9vbCBmaWxsX2NvbHVtbl90cnVtcHNf cCA9ICghTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gZXNzZW50aWFscy5mY194KTsKKyAgICAgICAgICAgIGlm ICh0cmFjZV9yZWRpc3BsYXlfcCkKKyAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNf dXBkYXRlX3RleHRfYXJlYSAoZmxvYXRpbmcpOiAgdnBvcyAoJWQpIHwgeF9saW1pdCAoJWQpXG4i LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIHhfbGltaXQpOworICAgICAg ICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICYmICFOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgICAgICAg ICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxz LmZjX3ggPj0geAorICAgICAgICAgICAgICAgICYmIHRhcmdldF9nbHlwaCAhPSBOVUxMCisgICAg ICAgICAgICAgICAgJiYgZHJhd19wKQorICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIGRlc2ly ZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCBURVhUX0FSRUEsCisgICAgICAg ICAgICAgICAgICAgICAgICAgeCwgeF9saW1pdCwgdXBkYXRlZF9yb3ctPnksIGhwb3MsIHZwb3Ms IE1DX0JBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3Nl bnRpYWxzLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgZGVidWdfcCA/ IGRlYnVnX2ZnIDogZXNzZW50aWFscy5mY19mZ1tyb3dfcG9zaXRpb25dLAorICAgICAgICAgICAg ICAgICAgICAgICAgIEZJTExfQ09MVU1OLCBkcmF3X3AsIE5PV0hFUkUsIE5PX0NBQ0hFKTsKKyAg ICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAmJiAh TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9ob3Jpem9u dGFsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAmJiB4IDwgdGV4dF9hcmVhX3dpZHRoCisgICAg ICAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAgICAgICYm IHRhcmdldF9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgJiYgZHJhd19wKQorICAgICAg ICAgICAgICBtY19lbmdpbmUgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0 X2dseXBoLCBURVhUX0FSRUEsCisgICAgICAgICAgICAgICAgICAgICAgICAgeCwgeF9saW1pdCwg dXBkYXRlZF9yb3ctPnksIGhwb3MsIHZwb3MsIE1DX0hCQVIsIDEsCisgICAgICAgICAgICAgICAg ICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLAorICAgICAg ICAgICAgICAgICAgICAgICAgIGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGVzc2VudGlhbHMuY2hfZmdb cm93X3Bvc2l0aW9uXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVS LCBkcmF3X3AsIE5PV0hFUkUsIE5PX0NBQ0hFKTsKKyAgICAgICAgICAgIGlmIChCVUZGRVJQICh3 LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAg ICAgJiYgIWZpbGxfY29sdW1uX3RydW1wc19wCisgICAgICAgICAgICAgICAgJiYgeCA8IHRleHRf YXJlYV93aWR0aAorICAgICAgICAgICAgICAgICYmIHZwb3MgIT0gdy0+Y3Vyc29yLnZwb3MKKyAg ICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSB4CisgICAgICAgICAgICAgICAgJiYgdGFy Z2V0X2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAgICAg ICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5 cGgsIFRFWFRfQVJFQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB4LCB4X2xpbWl0LCB1cGRh dGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfQkFSLCAxLAorICAgICAgICAgICAgICAgICAgICAg ICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwKKyAgICAgICAgICAg ICAgICAgICAgICAgICBkZWJ1Z19wID8gZGVidWdfZmcgOiBlc3NlbnRpYWxzLmNoX2ZnW3Jvd19w b3NpdGlvbl0sCisgICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVIsIGRyYXdf cCwgTk9XSEVSRSwgTk9fQ0FDSEUpOworICAgICAgICAgIH0KKworICAgICAgfQorICByZXR1cm4g Y2hhbmdlZF9wOworfQorCisvKiBVcGRhdGUgcm93IFZQT1MgaW4gd2luZG93IFcuICBWYWx1ZSBp cyB0cnVlIGlmIGRpc3BsYXkgaGFzIGJlZW4gY2hhbmdlZC4gKi8KK3N0YXRpYyBib29sCittY191 cGRhdGVfd2luZG93X2xpbmUgKHN0cnVjdCB3aW5kb3cgKncsIGludCB2cG9zLCBib29sICptb3Vz ZV9mYWNlX292ZXJ3cml0dGVuX3AsCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlw aF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HRoZXJlIGlzIG9uZS4gKi8KKyAgICAgIGlmICghZGVzaXJlZF9yb3ctPmZ1bGxf d2lkdGhfcCAmJiB3LT5sZWZ0X21hcmdpbl9jb2xzID4gMCkKKyAgICAgICAgeworICAgICAgICAg IGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgdXBkYXRlX21hcmdpbmFsX2FyZWEgKHcsIGRlc2ly ZWRfcm93LCBMRUZUX01BUkdJTl9BUkVBLCB2cG9zKTsKKyAgICAgICAgICAvKiBTZXR0aW5nIHRo aXMgZmxhZyB3aWxsIGVuc3VyZSB0aGUgdmVydGljYWwgYm9yZGVyLCBpZgorICAgICAgICAgICAg IGFueSwgYmV0d2VlbiB0aGlzIHdpbmRvdyBhbmQgdGhlIG9uZSBvbiBpdHMgbGVmdCB3aWxsIGJl CisgICAgICAgICAgICAgcmVkcmF3bi4gIFRoaXMgaXMgbmVjZXNzYXJ5IGJlY2F1c2UgdXBkYXRp bmcgdGhlIGxlZnQKKyAgICAgICAgICAgICBtYXJnaW4gYXJlYSBjYW4gcG90ZW50aWFsbHkgZHJh dyBvdmVyIHRoZSBib3JkZXIuICovCisgICAgICAgICAgY3VycmVudF9yb3ctPnJlZHJhd19mcmlu Z2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgfQorICAgICAgYm9vbCB1cGRhdGVkX3AgPSBtY191 cGRhdGVfdGV4dF9hcmVhICh3LCBkZXNpcmVkX3JvdywgdnBvcywgY3Vyc29yX21hdHJpeCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywgZHJh d19wKTsKKyAgICAgIC8qIFVwZGF0ZSB0aGUgZGlzcGxheSBvZiB0aGUgdGV4dCBhcmVhLiAqLwor ICAgICAgaWYgKHVwZGF0ZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGNoYW5nZWRfcCA9IDE7 CisgICAgICAgICAgaWYgKGN1cnJlbnRfcm93LT5tb3VzZV9mYWNlX3ApCisgICA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mRvd193aWR0aF9saW5lX3AgIT0gY3VycmVudF9yb3ctPmV4YWN0 X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICB8fCAoTUFUUklYX1JPV19DT05USU5VQVRJ T05fTElORV9QIChkZXNpcmVkX3JvdykKKyAgICAgICAgICAgICAgIT0gTUFUUklYX1JPV19DT05U SU5VQVRJT05fTElORV9QIChjdXJyZW50X3JvdykpKQorICAgICAgICByaWYtPmFmdGVyX3VwZGF0 ZV93aW5kb3dfbGluZV9ob29rICh3LCBkZXNpcmVkX3Jvdyk7CisgICAgfQorICAvKiBVcGRhdGUg Y3VycmVudF9yb3cgZnJvbSBkZXNpcmVkX3Jvdy4gKi8KKyAgbWFrZV9jdXJyZW50ICh3LT5kZXNp cmVkX21hdHJpeCwgdy0+Y3VycmVudF9tYXRyaXgsIHZwb3MpOworICByZXR1cm4gY2hhbmdlZF9w OworfQorCit2b2lkCittY191cGRhdGVfd2luZG93X2VyYXNlIChzdHJ1Y3Qgd2luZG93ICp3LCBz dHJ1Y3QgbWNfbWF0cml4IG9sZF9tYXRyaXgpCit7CisgIGJvb2wgZ29fb25lX3AgPSAob2xkX21h dHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVdID4gMAorICAgICAgICAgICAgICAgICAgIHx8IG9s ZF9tYXRyaXguY3Vyc29yc191c2VkW0NIX0NBQ0hFXSA+IDAKKyAgICAgICAgICAgICAgICAgICB8 fCBvbGRfbWF0cml4LmN1cnNvcnNfdXNlZFtGQ19DQUNIRV0gPiAwKTsKKyAgYm9vbCBnb190d29f cCA9IChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAmJiAoIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAg ICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2li bGUpKQorICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBtY19jb25mKSkpKTsKKyAgYm9vbCB1cGRhdGluZ19mcmFtZV9wID0gZmFsc2U7 CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBpZiAoWEZSQU1FICh3 LT5mcmFtZSkgIT0gZi0+bWNfdXBkYXRpbmdfZnJhbWUKKyAgICAgICYmIChnb19vbmVfcCB8fCBn b190d29fcCkpCisgICAgeworICAgICAgdXBkYXRpbmdfZnJhbWVfcCA9IHRydWU7CisgICAgICB1 cGRhdGVfYmVnaW4gKGYpOworICAgIH0KKyAgaWYgKHctPnBoeXNfY3Vyc29yX29uX3AKKyAgICAg ICYmIGdvX3R3b19wKQorICAgIGVyYXNlX3BoeXNfY3Vyc29yICh3KTsKKyAgZm9yIChpbnQgdm50 aCA9IDA7CisgICAgICAgZ29fb25lX3AKKyAgICAgICAmJiB2bnRoIDwgdy0+bWNfbWF0cml4LnZw b3NfdXNlZDsKKyAgICAgICArK3ZudGgpCisgICAgeworICAgICAgZm9yIChlbnVtIG1jX2NhY2hl X3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgICAgICBjYWNoZV90eXBlIDwgTk9f Q0FDSEU7CisgICAgICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICAgICAgZm9yIChpbnQgbnRoXzAg PSAwOworICAgICAgICAgICAgIG1jX3RyYXZlcnNlX2NhY2hlX3AgKG9sZF9tYXRyaXgsIGNhY2hl X3R5cGUsIHZudGgsIG50aF8wKTsKKyAgICAgICAgICAgICArK250aF8wKQorICAgICAgICAgIHsK KyAgICAgICAgICAgIGJvb2wgc2FtZV9wID0gZmFsc2U7CisgICAgICAgICAgICBmb3IgKGludCB3 X250aCA9IDA7IHdfbnRoIDwgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNo ZV90eXBlXTsgKyt3X250aCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNhbWVf cCB8PSAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlw aC50eXBlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC50eXBlCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXzBdLmdseXBoLmJ5dGVwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLmJ5dGVw b3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGguY2hhcnBvcworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3 X250aF0uZ2x5cGguY2hhcnBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC51LnZhbAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudS52YWwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5 cGguZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguZmFjZV9pZAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8wXS5nbHlwaC5wYWRkaW5nX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmds eXBoLnBhZGRpbmdfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5sZWZ0X2JveF9saW5lX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLmxlZnRfYm94X2xpbmVfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5nbHlwaC5yaWdodF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRo XS5nbHlwaC5yaWdodF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnZvZmZz ZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnZvZmZzZXQKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMF0uZ2x5cGgucGl4ZWxfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnBp eGVsX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnNsaWNlLmltZy54CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcueAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5n bHlwaC5zbGljZS5pbWcueQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguc2xpY2UuaW1n LnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGguc2xpY2UuaW1nLndpZHRoCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcud2lkdGgKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0u Z2x5cGguc2xpY2UuaW1nLmhlaWdodAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguc2xp Y2UuaW1nLmhlaWdodAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5zbGljZS5jbXAuZnJvbQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguc2xpY2UuY21wLmZyb20KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMF0ueAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ueAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8w XS5meAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZngKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ueQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVt3X250aF0ueQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5meQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0uZnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uaHBvcworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVt3X250aF0uaHBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS52cG9zCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW3dfbnRoXS52cG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLndkCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS53ZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5oCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS5oCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmN1cnNvcl90eXBlCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3dfbnRoXS5jdXJzb3JfdHlwZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5jdXJzb3Jfd2lkdGgKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bd19udGhdLmN1cnNvcl93aWR0aAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5m Zy5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmZnLnJlZAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8w XS5mZy5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZmcuZ3JlZW4KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMF0uZmcuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZmcuYmx1ZQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8wXS5iZy5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmJnLnJlZAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS5iZy5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9 PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uYmcuZ3Jl ZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYmcuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0u YmcuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3 X250aF0uYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGhfZmxhdm9yCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5nbHlwaF9mbGF2b3IKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZW5hYmxl ZF9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5lbmFibGVkX3ApOworICAgICAgICAgICAgICAg IC8qIEZvcmNlIHRoZSBmcmluZ2UgYml0bWFwcyB0byBhbHdheXMgYmUgcmVzZXQvcmVkcmF3bi4g Ki8KKyAgICAgICAgICAgICAgICBpZiAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8wXS5jdXJzb3JfdHlwZQorICAgICAgICAgICAgICAgICAgICAgID09IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5jdXJzb3JfdHlwZQor ICAgICAgICAgICAgICAgICAgICAmJiAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8wXS5jdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVAKKyAgICAg ICAgICAgICAgICAgICAgICAgIHx8IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0uY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkpCisgICAg ICAgICAgICAgICAgICBzYW1lX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBpZiAoc2FtZV9w KQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvLyAgZnByaW50ZiAo c3RkZXJyLCAiSElUICglcyk6ICB2cG9zICglZCkgfCBocG9zICglZCkgfCBjaGFyICglcylcbiIs CisgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIChjYWNoZV90eXBlID09 IE1DX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgID8g Ik1DIgorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICA6IChjYWNoZV90 eXBlID09IENIX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAg ICAgID8gIkNIIgorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICA6IChj YWNoZV90eXBlID09IEZDX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAg ICAgICAgICAgID8gIkZDIgorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAg ICA6ICJOTyIsCisgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS52cG9zLAorICAgICAg ICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uaHBvcywKKyAgICAgICAgICAgICAgICAgICAgLy8g ICAgICAgICAgICAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC51LmNoKSk7CisgICAgICAgICAgICAg ICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5z YW1lX3AgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICAgIC8vICBmcHJpbnRmIChzdGRlcnIsICJNSVNTICglcyk6ICB2cG9z ICglZCkgfCBocG9zICglZCB2LiAlZCkgfCBjaGFyICglcyB2LiAlcykgfCBjYWNoZV91c2VkICgl ZCB2LiAlZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAg KGNhY2hlX3R5cGUgPT0gTUNfQ0FDSEUpCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAg ICAgICAgICAgICAgICA/ICJNQyIKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAg ICAgICAgICA6IChjYWNoZV90eXBlID09IENIX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAg IC8vICAgICAgICAgICAgICAgICAgICAgPyAiQ0giCisgICAgICAgICAgICAgICAgICAgICAgLy8g ICAgICAgICAgICAgICAgICAgOiAoY2FjaGVfdHlwZSA9PSBGQ19DQUNIRSkKKyAgICAgICAgICAg ICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgID8gIkZDIgorICAgICAgICAgICAgICAg ICAgICAgIC8vICAgICAgICAgICAgICAgICAgIDogIk5PIiwKKyAgICAgICAgICAgICAgICAgICAg ICAvLyAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVt3X250aF0udnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAg ICAgICAgICBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmhw b3MsCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmhwb3MsCisgICAgICAgICAg ICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgudS5jaCksCisg ICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgbWNfY2hhcl90b19zdHJp bmcgKHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlw aC51LmNoKSwKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSwKKyAgICAgICAgICAgICAg ICAgICAgICAvLyAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZV91c2VkW2NhY2hlX3R5cGVdKTsKKyAgICAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uc2FtZV9wID0gZmFsc2U7CisgICAg ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKCFzYW1l X3ApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBgbWF0cml4X3JvdycgaW4g YGRpc3BuZXcuY2AgY29udGFpbnMgdGhlIGZvbGxvd2luZyB0ZXN0cywKKyAgICAgICAgICAgICAg ICBlYXNzZXJ0IChtYXRyaXggJiYgbWF0cml4LT5yb3dzKTsKKyAgICAgICAgICAgICAgICBlYXNz ZXJ0IChyb3cgPj0gMCAmJiByb3cgPCBtYXRyaXgtPm5yb3dzKTsgKi8KKyAgICAgICAgICAgICAg ICBib29sIGJhcmZfY3Jhc2hfb25lID0gKHctPmN1cnJlbnRfbWF0cml4ICYmIHctPmN1cnJlbnRf bWF0cml4LT5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgICAgICAgICAgICAgICBpZiAoYmFyZl9j cmFzaF9vbmUpCisgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICBi b29sIGJhcmZfY3Jhc2hfdHdvID0gKHZudGggPj0gMCAmJiB2bnRoIDwgdy0+Y3VycmVudF9tYXRy aXgtPm5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgICAgICAgICAgICAgICBpZiAoYmFyZl9jcmFz aF90d28pCisgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICBzdHJ1 Y3QgZ2x5cGhfcm93ICp2bnRoX3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2 bnRoKTsKKyAgICAgICAgICAgICAgICBpbnQgeF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS54OworICAgICAgICAgICAgICAgIGludCBmeF8wID0gb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5meDsKKyAgICAgICAg ICAgICAgICBpbnQgeV8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8wXS55OworICAgICAgICAgICAgICAgIGludCBmeV8wID0gb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5meTsKKyAgICAgICAgICAgICAgICBpbnQgaHBv c18wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5ocG9z OworICAgICAgICAgICAgICAgIGludCB2cG9zXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLnZwb3M7CisgICAgICAgICAgICAgICAgaW50IHdkXzAgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLndkOworICAgICAg ICAgICAgICAgIGludCBoXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzBdLmg7CisgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3Jf dHlwZV8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5j dXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoXzAgPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmN1cnNvcl93aWR0aDsKKyAg ICAgICAgICAgICAgICAvLyAgc3RydWN0IG1jX1JHQiBsc2xfZmdfMCA9IHsucmVkID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5mZy5yZWQsCisgICAgICAg ICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5mZy5ncmVlbiwKKyAgICAgICAg ICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcuYmx1ZX07CisgICAgICAgICAg ICAgICAgc3RydWN0IG1jX1JHQiBsc2xfYmdfMCA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5iZy5yZWQsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmJnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzBdLmJnLmJsdWV9OworICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3Bf MCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYWN0aXZl X3A7CisgICAgICAgICAgICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yXzAgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoX2ZsYXZvcjsK KyAgICAgICAgICAgICAgICBib29sIGVuYWJsZWRfcF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5lbmFibGVkX3A7CisgICAgICAgICAgICAgICAgaWYg KHZwb3NfMCA9PSB2bnRoCisgICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvcl8wID09 IE1DX0dMWVBICisgICAgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcF8wCisgICAgICAgICAg ICAgICAgICAgICYmIHZudGhfcm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICAgIG1jX2VyYXNlX2N1cnNvciAodywgdy0+Y3VycmVudF9tYXRyaXgs IHZudGhfcm93LCB4XzAsIHlfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBocG9zXzAsIHZwb3NfMCwgZ2x5cGhfZmxhdm9yXzAsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgY3Vyc29yX3R5cGVfMCwgd2RfMCk7CisgICAgICAgICAgICAgICAgICAg IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZW5hYmxlZF9w ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIC0tb2xkX21hdHJpeC5jdXJzb3JzX3VzZWRb Y2FjaGVfdHlwZV07CisgICAgICAgICAgICAgICAgICAgIC8qIElmIHdlIGluYWR2ZXJ0ZW50bHkg ZXJhc2VkIGFub3RoZXIgZmFrZSBjdXJzb3IgYXQgdGhlIHNhbWUKKyAgICAgICAgICAgICAgICAg ICAgSFBPUyB0aGF0IGlzIHN0aWxsIGVuYWJsZWRfcCBpbiB0aGUgYG9sZF9tYXRyaXhgLCB0aGVu IHJlZHJhdyBpdC4gKi8KKyAgICAgICAgICAgICAgICAgICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5 cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgICAgICAgICAgICAgICAgICAgIGNhY2hl X3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICArK2NhY2hlX3R5cGUp CisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChp bnQgbnRoXzEgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY190cmF2ZXJzZV9j YWNoZV9wIChvbGRfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGhfMSk7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICsrbnRoXzEpCisgICAgICAgICAgICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeF8xID0gb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS54OworICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGludCBmeF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8xXS5meDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeV8xID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS55OworICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGludCBmeV8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8xXS5meTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaHBvc18x ID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5ocG9zOwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB2cG9zXzEgPSBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLnZwb3M7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgaW50IHdkXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzFdLndkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBoXzEgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmg7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZV8xID0gb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5jdXJzb3JfdHlwZTsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoXzEgPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmN1cnNvcl93aWR0aDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZ18xID0gey5yZWQg PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZnLnJlZCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5n cmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZmcu Z3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf MV0uZmcuYmx1ZX07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIHN0cnVjdCBtY19S R0IgbHNsX2JnXzEgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMV0uYmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMV0uYmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmJnLmJsdWV9OworICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3BfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMV0uYWN0aXZlX3A7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICBib29sIGVuYWJsZWRfcF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8xXS5lbmFibGVkX3A7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgYm9vbCBnb19wXzEgPSAoaHBvc18wID09IGhwb3NfMQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcF8xKTsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICBpZiAoIWdvX3BfMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNv bnRpbnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3BfMSA9IGZh bHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3 LCB3LT5jdXJyZW50X21hdHJpeCwgdm50aF9yb3csIHhfMSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnhfMSwgeV8xLCBmeV8xLCBocG9zXzEsIHZw b3NfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg d2RfMSwgaF8xLCBjdXJzb3JfdHlwZV8xLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGhfMSwgbHNsX2ZnXzEsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wXzEsIGdseXBo X2ZsYXZvcl8xLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICByZW1vdmVfcF8xKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVs c2UgaWYgKHZwb3NfMCA9PSB2bnRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBlbmFi bGVkX3BfMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdm50aF9yb3ctPmVuYWJsZWRf cCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVt b3ZlX3BfMCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgbWNfZHJhd19lcmFzZV9oeWJy aWQgKHcsIHctPmN1cnJlbnRfbWF0cml4LCB2bnRoX3JvdywgeF8wLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmeF8wLCB5XzAsIGZ5XzAsIGhwb3NfMCwgdnBv c18wLCB3ZF8wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBo XzAsIGN1cnNvcl90eXBlXzAsIGN1cnNvcl93aWR0aF8wLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBsc2xfYmdfMCwgYWN0aXZlX3BfMCwgZ2x5cGhfZmxhdm9y XzAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZV9w XzApOworICAgICAgICAgICAgICAgICAgICAgIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uZW5hYmxlZF9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAg ICAgLS1vbGRfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICAgICAg ICAgICAgICAvKiBJZiB3ZSBpbmFkdmVydGVudGx5IGVyYXNlZCBhbm90aGVyIGZha2UgY3Vyc29y IGF0IHRoZSBzYW1lCisgICAgICAgICAgICAgICAgICAgICAgSFBPUyB0aGF0IGlzIHN0aWxsIGVu YWJsZWRfcCBpbiB0aGUgYG9sZF9tYXRyaXhgLCB0aGVuIHJlZHJhdyBpdC4gKi8KKyAgICAgICAg ICAgICAgICAgICAgICBmb3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FD SEU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgICAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IG50aF8yID0gMDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY190cmF2ZXJzZV9jYWNoZV9wIChvbGRf bWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGhfMik7CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKytudGhfMikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBpbnQgeF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8yXS54OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg aW50IGZ4XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJd LmZ4OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHlfMiA9IG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0ueTsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGludCBmeV8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8yXS5meTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBocG9z XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmhwb3M7 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgdnBvc18yID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS52cG9zOworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgaW50IHdkXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzJdLndkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhf MiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uaDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5 cGVfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uY3Vy c29yX3R5cGU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRo XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmN1cnNv cl93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNs X2ZnXzIgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMl0uZmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXzJdLmZnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMl0uZmcuYmx1ZX07CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAvLyAgc3RydWN0IG1jX1JHQiBsc2xfYmdfMiA9IHsucmVkID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5iZy5yZWQsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmJnLmdyZWVuLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAg LmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmJn LmJsdWV9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBhY3RpdmVfcF8yID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5hY3RpdmVfcDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZv cl8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5nbHlw aF9mbGF2b3I7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGVuYWJsZWRfcF8y ID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5lbmFibGVk X3A7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGdvX3BfMiA9IChocG9zXzAg PT0gaHBvc18yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBmeF8wIDw9IGZ4XzIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIGZ4XzAgKyB3ZF8wID4gZnhfMiArIHdkXzIKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcF8yKTsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGlmICghZ29fcF8yKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3Bf MiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfZHJhd19lcmFzZV9o eWJyaWQgKHcsIHctPmN1cnJlbnRfbWF0cml4LCB2bnRoX3JvdywgeF8yLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ4XzIsIHlfMiwgZnlfMiwg aHBvc18yLCB2cG9zXzIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgd2RfMiwgaF8yLCBjdXJzb3JfdHlwZV8yLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aF8yLCBsc2xfZmdf MiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBh Y3RpdmVfcF8yLCBnbHlwaF9mbGF2b3JfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVfcF8yKTsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgIH0KKyAgaWYgKHVwZGF0aW5n X2ZyYW1lX3ApCisgICAgdXB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IHVwZGF0ZV93aW5kb3dfbGluZSAo dywgTUFUUklYX1JPV19WUE9TIChtb2RlX2xpbmVfcm93LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNpcmVkX21hdHJpeCksCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wKTsKKyAgICAgICAg fQorCisgICAgICAvKiBGaW5kIGZpcnN0IGVuYWJsZWQgcm93LiAgT3B0aW1pemF0aW9ucyBpbiBy ZWRpc3BsYXlfaW50ZXJuYWwKKyAgICAgICAgIG1heSBsZWFkIHRvIGFuIHVwZGF0ZSB3aXRoIG9u bHkgb25lIHJvdyBlbmFibGVkLiAgVGhlcmUgbWF5CisgICAgICAgICBiZSBhbHNvIGNvbXBsZXRl bHkgZW1wdHkgbWF0cmljZXMuICovCisgICAgICB3aGlsZSAocm93IDwgZW5kICYmICFyb3ctPmVu YWJsZWRfcCkKKyAgICAgICAgKytyb3c7CisKKyAgICAgIC8qIFRyeSByZXVzaW5nIHBhcnQgb2Yg dGhlIGRpc3BsYXkgYnkgY29weWluZy4gKi8KKyAgICAgIGlmIChyb3cgPCBlbmQgJiYgIXctPmRl c2lyZWRfbWF0cml4LT5ub19zY3JvbGxpbmdfcCkKKyAgICAgICAgeworICAgICAgICAgIGludCBy YyA9IG1jX3Njcm9sbGluZ193aW5kb3cgKHcsIGhlYWRlcl9saW5lX3JvdyAhPSBOVUxMKTsKKyAg ICAgICAgICBpZiAocmMgPCAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBBbGwg cm93cyB3ZXJlIGZvdW5kIHRvIGJlIGVxdWFsLiAqLworICAgICAgICAgICAgICBwYXVzZWRfcCA9 IDA7CisgICAgICAgICAgICAgIGdvdG8gc2V0X2N1cnNvcjsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgICAgIGVsc2UgaWYgKHJjID4gMCkKKyAgICAgICAgICAgICAgewor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GVuZGluZyk7CisgICAgICAgICAgICsrbWNfcm93KQorICAgICAgICB7CisgICAgICAgICAg aW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKG1jX3Jvdywgdy0+ZGVzaXJlZF9tYXRyaXgpOwor ICAgICAgICAgIGlmIChtY19yb3ctPmVuYWJsZWRfcAorICAgICAgICAgICAgICAmJiB2cG9zID09 IHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjdXJzb3JfbWF0 cml4ID0gdy0+ZGVzaXJlZF9tYXRyaXg7CisgICAgICAgICAgICAgIGlmICghZm9yY2VfcCAmJiAr K25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkKKyAgICAgICAgICAgICAgICBkZXRlY3Rf aW5wdXRfcGVuZGluZ19pZ25vcmVfc3F1ZWV6YWJsZXMgKCk7CisgICAgICAgICAgICAgIGNoYW5n ZWRfcCB8PSBtY191cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3 cml0dGVuX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIGRyYXdfcCk7CisgICAgICAgICAgICAgIGlm IChNQVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHliKQorICAgICAgICAgICAgICAgIGZvciAo aW50IGkgPSB2cG9zICsgMTsgaSA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93cyAtIDE7ICsraSkK KyAgICAgICAgICAgICAgICAgIFNFVF9NQVRSSVhfUk9XX0VOQUJMRURfUCAody0+Y3VycmVudF9t YXRyaXgsIGksIGZhbHNlKTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICAgIGN1cnNvcl9tYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAg IC8qIFVwZGF0ZSB0aGUgcmVzdCBvZiB0aGUgbGluZXMuICovCisgICAgICBmb3IgKDsgcm93IDwg ZW5kICYmIChmb3JjZV9wIHx8ICFpbnB1dF9wZW5kaW5nKTsgKytyb3cpCisgICAgICAgIC8qIHNj cm9sbGluZ193aW5kb3cgcmVzZXRzIHRoZSBlbmFibGVkX3AgZmxhZyBvZiB0aGUgcm93cyBpdCBy ZXVzZXMgZnJvbQorICAgICAgICBjdXJyZW50X21hdHJpeC4gKi8KKyAgICAgICAgaWYgKHJvdy0+ ZW5hYmxlZF9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JP V19WUE9TIChyb3csIHctPmRlc2lyZWRfbWF0cml4KTsKKyAgICAgICAgICAgIC8qIElmIHRoZSBg Y3Vyc29yX3Jvd2AgaXMgd2l0aGluIHRoZSBgZGVzaXJlZF9tYXRyaXhgLCB0aGVuIGl0IHdhcwor ICAgICAgICAgICAgcHJvY2Vzc2VkIGhlcmVpbmFib3ZlIGFuZCBzaG91bGQgYmUgc2tpcHBlZCBh dCB0aGlzIHRpbWUuICovCisgICAgICAgICAgICBpZiAodnBvcyA9PSB3LT5jdXJzb3IudnBvcykK KyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgaW50IGk7CisgICAgICAgICAgICAv KiBXZSdsbCBoYXZlIHRvIHBsYXkgYSBsaXR0bGUgYml0IHdpdGggd2hlbiB0bworICAgICAgICAg ICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmcuICBJZiBpdCdzIGRvbmUgdG9vIG9mdGVuLAorICAg ICAgICAgICAgICAgc2Nyb2xsaW5nIGxhcmdlIHdpbmRvd3Mgd2l0aCByZXBlYXRlZCBzY3JvbGwt dXAKKyAgICAgICAgICAgICAgIGNvbW1hbmRzIHdpbGwgdG9vIHF1aWNrbHkgcGF1c2UgcmVkaXNw bGF5LiAqLworICAgICAgICAgICAgaWYgKCFmb3JjZV9wICYmICsrbl91cGRhdGVkICUgcHJl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ZGlzcGxheS4gKi8KKyAgICAgICAgICAgIGlmIChNQVRS SVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHliKQorICAgICAgICAgICAgICBmb3IgKGkgPSB2cG9z ICsgMTsgaSA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93cyAtIDE7ICsraSkKKyAgICAgICAgICAg ICAgICBTRVRfTUFUUklYX1JPV19FTkFCTEVEX1AgKHctPmN1cnJlbnRfbWF0cml4LCBpLCBmYWxz ZSk7CisgICAgICAgICAgfQorICAgICAgLyogV2FzIGRpc3BsYXkgcHJlZW1wdGVkPyAqLworICAg ICAgcGF1c2VkX3AgPSByb3cgPCBlbmQ7CisgICAgICBzZXRfY3Vyc29yOgorICAgICAgLyogSWYg d2UganVtcGVkIGhlcmUgZnJvbSBgc2V0X2N1cnNvcmAsIHRoZW4gc2V0IHRoZSBgY3Vyc29yX21h dHJpeGAuICovCisgICAgICBpZiAoY3Vyc29yX21hdHJpeCA9PSBOVUxMKQorICAgICAgICBjdXJz b3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAvKiBSZXNldCBgcm93YCB0byAw IHNvIHRoYXQgZmFrZSBjdXJzb3JzIGNhbiBiZSBkcmF3biBvbiByb3dzIHByZWNlZGluZyB0aGUK KyAgICAgIGZpcnN0IGByb3ctPmVuYWJsZWRfcGAuICBKdXN0IHByaW9yIHRvIHRoZSBjYWxsIHRv IGBzY3JvbGxpbmdfd2luZG93JyBhYm92ZSwKKyAgICAgIGByb3dgIHdhcyBhZHZhbmNlZCB0byB0 aGUgZmlyc3QgYHJvdy0+ZW5hYmxlZF9wYC4gKi8KKyAgICAgIGZvciAoc3RydWN0IGdseXBoX3Jv dyAqZGVzaXJlZF9yb3cgPSBNQVRSSVhfUk9XICh3LT5kZXNpcmVkX21hdHJpeCwgMCk7CisgICAg ICAgICAgIGRlc2lyZWRfcm93IDwgZW5kCisgICAgICAgICAgICYmIChmb3JjZV9wIHx8ICFpbnB1 dF9wZW5kaW5nKQorICAgICAgICAgICAvKiBXMzIgRW1hY3MgY3Jhc2hlcyBvbiBzdGFydHVwIHdp dGhvdXQgYSBCVUZGRVJQIGNoZWNrLiAqLworICAgICAgICAgICAmJiBCVUZGRVJQICh3LT5jb250 ZW50cykKKyAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IG1jX2NvbmYpKQorICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpOworICAgICAgICAgICArK2Rlc2lyZWRf cm93KQorICAgICAgICB7CisgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKGRl c2lyZWRfcm93LCB3LT5kZXNpcmVkX21hdHJpeCk7CisgICAgICAgICAgaWYgKGRlc2lyZWRfcm93 LT5lbmFibGVkX3ApCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5 cGhfcm93ICpjdXJyZW50X3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9z KTsKKyAgICAgICAgICBlbnVtIG1jX3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24gPSBtY19yb3df cG9zaXRpb24gKHcsIGN1cnJlbnRfcm93LCBjdXJyZW50X3JvdywgdnBvcyk7CisgICAgICAgICAg aWYgKGN1cnJlbnRfcm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICBtY19kcmF3X3JvdyAodywg dy0+Y3VycmVudF9tYXRyaXgsIGN1cnJlbnRfcm93LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRf QVJFQV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudF9yb3ctPngsIGN1cnJlbnRf cm93LT51c2VkW1RFWFRfQVJFQV0sIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgY3Vy c29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsCisgICAgICAgICAg ICAgICAgICAgICAgICAgU0VUX0NVUlNPUl9PTkUpOworICAgICAgICB9CisKKyAgICAgIG1jX3Jl c3RvcmVfZ2x5cGhfbWF0cml4IChzYXZlZF9kZXNpcmVkLCB3LT5kZXNpcmVkX21hdHJpeCk7Cisg ICAgICBtY19yZXN0b3JlX2dseXBoX21hdHJpeCAoc2F2ZWRfY3VycmVudCwgdy0+Y3VycmVudF9t YXRyaXgpOworCisgICAgICBtY191cGRhdGVfd2luZG93X2VyYXNlICh3LCBvbGRfbWF0cml4KTsK KworICAgICAgbWNfeGZyZWVfY2FjaGVfbWF0cml4ICh3LCAmb2xkX21hdHJpeCk7CisKKyAgICB9 CisgIC8vIGNsb2NrX3QgY2xvY2tfZW5kID0gY2xvY2soKTsKKyAgLy8gZG91YmxlIGNwdV90aW1l X3VzZWQgPSAoKGRvdWJsZSkgKGNsb2NrX2VuZCAtIGNsb2NrX3N0YXJ0KSkgLyBDTE9DS1NfUEVS X1NFQzsKKyAgLy8gZnByaW50ZiAoc3RkZXJyLCAibWNfc2Nyb2xsaW5nX3dpbmRvdyAoJXMpOiAg VElNRSAoJWYpXG4iLCBtY193aW5kb3cgKHcpLCBjcHVfdGltZV91c2VkKTsKK30KKworLyogZW5k IE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qIFN0 cnVjdHVyZSB0byBwYXNzIGRpbWVuc2lvbnMgYXJvdW5kLiAgVXNlZCBmb3IgY2hhcmFjdGVyIGJv dW5kaW5nCiAgICBib3hlcywgZ2x5cGggbWF0cml4IGRpbWVuc2lvbnMgYW5kIGFsaWtlLiAgKi8K IApAQCAtMjI0MSw2ICs0MDUwLDE2IEBAIGZyZWVfd2luZG93X21hdHJpY2VzIChzdHJ1Y3Qgd2lu ZG93ICp3KQogCSAgZnJlZV9nbHlwaF9tYXRyaXggKHctPmN1cnJlbnRfbWF0cml4KTsKIAkgIGZy ZWVfZ2x5cGhfbWF0cml4ICh3LT5kZXNpcmVkX21hdHJpeCk7CiAJICB3LT5jdXJyZW50X21hdHJp eCA9IHctPmRlc2lyZWRfbWF0cml4ID0gTlVMTDsKKworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBtY194ZnJlZV9jYWNoZV9tYXRyaXggKHcs ICZ3LT5tY19tYXRyaXgpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJfQogCiAg ICAgICAvKiBOZXh0IHdpbmRvdyBvbiBzYW1lIGxldmVsLiAgKi8KQEAgLTMzODcsNiArNTIwNiwy NiBAQCBjaGVja19jdXJyZW50X21hdHJpeF9mbGFncyAoc3RydWN0IHdpbmRvdyAqdykKIHN0YXRp YyBib29sCiB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiB7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAgIGZwcmludGYgKHN0ZGVyciwgInVwZGF0ZV93 aW5kb3cgKCVzKVxuIiwgbWNfd2luZG93ICh3KSk7CisKKyAgc3RydWN0IG1jX2Vzc2VudGlhbHMg ZXNzZW50aWFsczsKKyAgbWNfc2V0X2Vzc2VudGlhbHMgKHcsICZlc3NlbnRpYWxzKTsKKworICBt Y191cGRhdGVfd2luZG93X2RyeXJ1biAodywgZm9yY2VfcCwgZXNzZW50aWFscyk7CisKKyAgc3Ry dWN0IGdseXBoX21hdHJpeCAqY3Vyc29yX21hdHJpeCA9IE5VTEw7CisKKyAgYm9vbCBkcmF3X3Ag PSB0cnVlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIHN0cnVjdCBnbHlwaF9t YXRyaXggKmRlc2lyZWRfbWF0cml4ID0gdy0+ZGVzaXJlZF9tYXRyaXg7CiAgIGJvb2wgcGF1c2Vk X3A7CiAgIGludCBwcmVlbXB0X2NvdW50ID0gY2xpcF90b19ib3VuZHMgKDEsIGJhdWRfcmF0ZSAv IDI0MDAgKyAxLCBJTlRfTUFYKTsKQEAgLTM0NjAsNiArNTI5OSw0NyBAQCB1cGRhdGVfd2luZG93 IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAJICAgIH0KIAl9CiAKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogUHJvY2Vz cyB0aGUgY3Vyc29yIHJvdyBhdCB0aGUgb3V0c2V0IGlmIGl0IGlzIHdpdGhpbiBgZGVzaXJlZF9t YXRyaXhgLgorICBXaGVuIHByb2Nlc3NpbmcgYWxsIG90aGVyIHJvd3MsIHdlIHdpbGwgcXVlcnkg dGhlIGB3LT5jdXJyZW50X21hdHJpeGAgZm9yIGRhdGEKKyAgcmVsYXRpbmcgdG8gdGhlIGN1cnNv ciByb3cuICBgbWFrZV9jdXJyZW50YCAod2l0aGluIGB1cGRhdGVfd2luZG93X2xpbmUnKQorICB1 cGRhdGVzIHRoZSBgdy0+Y3VycmVudF9tYXRyaXhgIGZvciB0aGUgYXBwbGljYWJsZSByb3cuICBJ biBkb2luZyBzbywgaG93ZXZlciwKKyAgdGhlIGFwcGxpY2FibGUgcm93IGluIHRoZSBkZXNpcmVk IG1hdHJpeCBpcyBhbHRlcmVkIHN1Y2ggdGhhdCB3ZSBjYW4gbm8gbG9uZ2VyCisgIHJlbHkgdXBv biB0aGUgYWNjdXJhY3kgb2YgYFJPVy0+dXNlZFtURVhUX0FSRUFdYC4gIFRoZXJlZm9yZSwgd2Ug bXVzdCBub3cgcmVseQorICBleGNsdXNpdmVseSB1cG9uIGB3LT5jdXJyZW50X21hdHJpeCcgZm9y IGN1cnNvciByb3cgYmFzZWQgZGVjaXNpb25zLiAqLworICBmb3IgKHN0cnVjdCBnbHlwaF9yb3cg Km1jX3JvdyA9IHJvdzsKKyAgICAgICBtY19yb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlucHV0 X3BlbmRpbmcpOworICAgICAgICsrbWNfcm93KQorICAgIHsKKyAgICAgIGludCB2cG9zID0gTUFU UklYX1JPV19WUE9TIChtY19yb3csIGRlc2lyZWRfbWF0cml4KTsKKyAgICAgIGlmIChtY19yb3ct PmVuYWJsZWRfcAorICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAg IHsKKyAgICAgICAgICBjdXJzb3JfbWF0cml4ID0gZGVzaXJlZF9tYXRyaXg7CisgICAgICAgICAg aWYgKCFmb3JjZV9wICYmICsrbl91cGRhdGVkICUgcHJlZW1wdF9jb3VudCA9PSAwKQorICAgICAg ICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgpOworICAgICAg ICAgIGNoYW5nZWRfcCB8PSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAg ICAgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwg ISBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkpCisgICAg ICAgICAgICAgICAgICAgICAgID8gbWNfdXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLCAmbW91 c2VfZmFjZV9vdmVyd3JpdHRlbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgZHJhd19wKQorICAgICAg ICAgICAgICAgICAgICAgICA6IHVwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2Zh Y2Vfb3ZlcndyaXR0ZW5fcCk7CisgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKHJv dykgPj0geWIpCisgICAgICAgICAgICBmb3IgKGludCBpID0gdnBvcyArIDE7IGkgPCB3LT5jdXJy ZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAgICAgIFNFVF9NQVRSSVhfUk9X X0VOQUJMRURfUCAody0+Y3VycmVudF9tYXRyaXgsIGksIGZhbHNlKTsKKyAgICAgICAgICBicmVh azsKKyAgICAgICAgfQorICAgIH0KKworICBjdXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRy aXg7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIC8qIFVwZGF0ZSB0aGUg cmVzdCBvZiB0aGUgbGluZXMuICAqLwogICAgICAgZm9yICg7IHJvdyA8IGVuZCAmJiAoZm9yY2Vf cCB8fCAhaW5wdXRfcGVuZGluZyk7ICsrcm93KQogCS8qIHNjcm9sbGluZ193aW5kb3cgcmVzZXRz IHRoZSBlbmFibGVkX3AgZmxhZyBvZiB0aGUgcm93cyBpdApAQCAtMzQ2Nyw2ICs1MzQ3LDE5IEBA IHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIAlpZiAocm93 LT5lbmFibGVkX3ApCiAJICB7CiAJICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3cs IGRlc2lyZWRfbWF0cml4KTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJ UExFLUNVUlNPUlMgKi8KKworICAgICAgICAgIC8qIElmIHRoZSBgY3Vyc29yX3Jvd2AgaXMgd2l0 aGluIHRoZSBgZGVzaXJlZF9tYXRyaXhgLCB0aGVuIGl0IHdhcworICAgICAgICAgIHByb2Nlc3Nl ZCBoZXJlaW5hYm92ZSBhbmQgc2hvdWxkIGJlIHNraXBwZWQgYXQgdGhpcyB0aW1lLiAqLworICAg ICAgICAgIGlmICh2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICAgIGNvbnRpbnVlOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgIGludCBpOwogCiAJICAgIC8qIFdl J2xsIGhhdmUgdG8gcGxheSBhIGxpdHRsZSBiaXQgd2l0aCB3aGVuIHRvCkBAIC0zNDc1LDggKzUz NjgsMjEgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQog CSAgICAgICBjb21tYW5kcyB3aWxsIHRvbyBxdWlja2x5IHBhdXNlIHJlZGlzcGxheS4gICovCiAJ ICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkKIAkg ICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZ19pZ25vcmVfc3F1ZWV6YWJsZXMgKCk7Ci0JICAgIGNo YW5nZWRfcCB8PSB1cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsCi0JCQkJCSAgICAgJm1vdXNl X2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgICAgICBjaGFuZ2VkX3AgfD0gKEJVRkZFUlAgKHct PmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg IHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICEgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBmY192aXNpYmxlKSkpKQorICAgICAgICAgICAgICAgICAgICAgICA/IG1jX3VwZGF0 ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgs IGVzc2VudGlhbHMsIGRyYXdfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgOiB1cGRhdGVfd2lu ZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3ApOworCisvKiAqKioq KioqKioqKioqKio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AgICAgIGRlc2lyZWRf cm93IDwgZW5kCisgICAgICAgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3BlbmRpbmcpCisgICAgICAg LyogVzMyIEVtYWNzIGNyYXNoZXMgb24gc3RhcnR1cCB3aXRob3V0IGEgQlVGRkVSUCBjaGVjay4g Ki8KKyAgICAgICAmJiBCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAmJiAoIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgIHx8ICFOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICB8 fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpOworICAg ICAgICsrZGVzaXJlZF9yb3cpCisgICAgeworICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQ T1MgKGRlc2lyZWRfcm93LCBkZXNpcmVkX21hdHJpeCk7CisgICAgICBpZiAoZGVzaXJlZF9yb3ct PmVuYWJsZWRfcCkKKyAgICAgICAgY29udGludWU7CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpj dXJyZW50X3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAgICAg IGVudW0gbWNfcm93X3Bvc2l0aW9uIHJvd19wb3NpdGlvbiA9IG1jX3Jvd19wb3NpdGlvbiAodywg Y3VycmVudF9yb3csIGN1cnJlbnRfcm93LCB2cG9zKTsKKyAgICAgIGlmIChjdXJyZW50X3Jvdy0+ ZW5hYmxlZF9wKQorICAgICAgICBtY19kcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIGN1 cnJlbnRfcm93LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgICAg ICAgICAgICBjdXJyZW50X3Jvdy0+eCwgY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXSwgdnBv cywKKyAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19w b3NpdGlvbiwgZHJhd19wLCBTRVRfQ1VSU09SX1RXTyk7CisgICAgfQorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAgICAgICAvKiBVcGRhdGUgdGhlIGhlYWRlciBsaW5lIGFmdGVyIHNj cm9sbGluZyBiZWNhdXNlIGEgbmV3IGhlYWRlcgogCSBsaW5lIHdvdWxkIG90aGVyd2lzZSBvdmVy d3JpdGUgbGluZXMgYXQgdGhlIHRvcCBvZiB0aGUgd2luZG93CiAJIHRoYXQgY2FuIGJlIHNjcm9s bGVkLiAgKi8KQEAgLTM1MTIsNyArNTQ1Myw0OSBAQCB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2lu ZG93ICp3LCBib29sIGZvcmNlX3ApCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAJICBpZiAo Y2hhbmdlZF9wICYmIHJpZi0+Zml4X292ZXJsYXBwaW5nX2FyZWEpCiAJICAgIHsKLQkgICAgICBy ZWRyYXdfb3ZlcmxhcHBlZF9yb3dzICh3LCB5Yik7CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRyYXdfb3ZlcmxhcHBlZF9yb3dz JzogIFJlZHJhdyBsaW5lcyBmcm9tIHRoZSBjdXJyZW50IG1hdHJpeCBvZiB3aW5kb3cgVwordGhh dCBhcmUgb3ZlcmxhcHBlZCBieSBvdGhlciByb3dzLiAgWUIgaXMgYm90dG9tLW1vc3QgeS1wb3Np dGlvbiBpbiBXLiAgSWYgcm93cworb3ZlcmxhcHBpbmcgb3RoZXJzIGhhdmUgYmVlbiBjaGFuZ2Vk LCB0aGUgcm93cyBiZWluZyBvdmVybGFwcGVkIGhhdmUgdG8gYmUKK3JlZHJhd24uICBUaGlzIHdv bid0IGRyYXcgbGluZXMgdGhhdCBoYXZlIGFscmVhZHkgYmVlbiBkcmF3biBpbiB1cGRhdGVfd2lu ZG93CitsaW5lIGJlY2F1c2Ugb3ZlcmxhcHBlZF9wIGluIGRlc2lyZWQgcm93cyBpcyAwLCBzbyBh ZnRlciByb3cgYXNzaWdubWVudAorb3ZlcmxhcHBlZF9wIGluIGN1cnJlbnQgcm93cyBpcyAwLiAq LworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICBmb3Ig KGludCBpID0gMDsgaSA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93czsgKytpKQorICAgIHsKKyAg ICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdyA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgaTsK KyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgIGJyZWFrOworICAgICAgICBlbHNl IGlmIChyb3ctPm1vZGVfbGluZV9wKQorICAgICAgICAgIGNvbnRpbnVlOworICAgICAgaWYgKHJv dy0+b3ZlcmxhcHBlZF9wKQorICAgICAgICB7CisgICAgICAgICAgZm9yIChlbnVtIGdseXBoX3Jv d19hcmVhIGFyZWEgPSBMRUZUX01BUkdJTl9BUkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2FyZWEp CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG91dHB1dF9jdXJzb3JfdG8gKHcsIGksIDAs IHJvdy0+eSwgYXJlYSA9PSBURVhUX0FSRUEgPyByb3ctPnggOiAwKTsKKyAgICAgICAgICAgICAg aWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBhcmVhLCByb3ct PngsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT51c2VkW2FyZWFd LCB0cnVlLCBEUkFXX05PUk1BTF9URVhULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIFVQREFURV9XSU5ET1dfX1JFRFJBV19PVkVSTEFQUEVEX1JPV1MpCisgICAgICAgICAgICAg ICAgICAmJiByb3ctPnVzZWRbYXJlYV0pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgRlJBTUVfUklGIChmKS0+d3JpdGVfZ2x5cGhzICh3LCByb3csIHJvdy0+Z2x5cGhzW2Fy ZWFdLCBhcmVhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICByb3ctPnVzZWRbYXJlYV0pOworICAgICAgICAgICAgICAgICAgRlJBTUVfUklGIChmKS0+Y2xl YXJfZW5kX29mX2xpbmUgKHcsIHJvdywgYXJlYSwgLTEpOworICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgIH0KKyAgICAgICAgICByb3ctPm92ZXJsYXBwZWRfcCA9IDA7CisgICAgICAgIH0K KyAgICAgIGlmIChNQVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHliKQorICAgICAgICBicmVh azsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgICByZWRyYXdf b3ZlcmxhcHBpbmdfcm93cyAodywgeWIpOwogCSAgICB9CiAjZW5kaWYKQEAgLTM1MzEsMTAgKzU1 MTQsMjEgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQog ICAgICAgc3RyY3B5ICh3LT5jdXJyZW50X21hdHJpeC0+bWV0aG9kLCB3LT5kZXNpcmVkX21hdHJp eC0+bWV0aG9kKTsKICNlbmRpZgogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCisgIGlmIChCVUZG RVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIDAp OworICAgIGVsc2UKICAgICAgIHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgMCk7CiAjZW5kaWYK IAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgLyogRW5kIHRoZSB1cGRhdGUg b2Ygd2luZG93IFcuICBEb24ndCBzZXQgdGhlIGN1cnNvciBpZiB3ZQogICAgICAgICAgcGF1c2Vk IHVwZGF0aW5nIHRoZSBkaXNwbGF5IGJlY2F1c2UgaW4gdGhpcyBjYXNlLAogICAgICAgICAgc2V0 X3dpbmRvd19jdXJzb3JfYWZ0ZXJfdXBkYXRlIGhhc24ndCBiZWVuIGNhbGxlZCwgYW5kCmRpZmYg LS1naXQgYS9zcmMvZnJhbWUuaCBiL3NyYy9mcmFtZS5oCmluZGV4IGVjOGY2MTQuLmVlYWY3MWUg MTAwNjQ0Ci0tLSBhL3NyYy9mcmFtZS5oCisrKyBiL3NyYy9mcmFtZS5oCkBAIC0yMDUsNiArMjA1 LDE2IEBAIHN0cnVjdCBmcmFtZQogICBMaXNwX09iamVjdCB0b29sX2Jhcl9pdGVtczsKICAgLyog dG9vbF9iYXJfaXRlbXMgc2hvdWxkIGJlIHRoZSBsYXN0IExpc3BfT2JqZWN0IG1lbWJlci4gICov CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgLyogTm9uLW5pbCB3aGVuIHRoZSBmcmFtZSBpcyBpbiB0aGUgcHJvY2VzcyBvZiBiZWluZyB1 cGRhdGVkLiAqLworICBzdHJ1Y3QgZnJhbWUgKm1jX3VwZGF0aW5nX2ZyYW1lOworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAgIC8qIENhY2hlIG9mIHJlYWxpemVkIGZhY2VzLiAgKi8K ICAgc3RydWN0IGZhY2VfY2FjaGUgKmZhY2VfY2FjaGU7CiAKZGlmZiAtLWdpdCBhL3NyYy9mcmlu Z2UuYyBiL3NyYy9mcmluZ2UuYwppbmRleCAzMzVhNmViLi5kNzBjNTVmIDEwMDY0NAotLS0gYS9z cmMvZnJpbmdlLmMKKysrIGIvc3JjL2ZyaW5nZS5jCkBAIC00MzgsNiArNDM4LDQ2MCBAQCBzdGF0 aWMgdW5zaWduZWQgc2hvcnQgZW1wdHlfbGluZV9iaXRzW10gPSB7CiAjZGVmaW5lIFNUQU5EQVJE X0JJVE1BUF9IRUlHSFQoYml0cykgKHNpemVvZiAoYml0cykvQllURVNfUEVSX0JJVE1BUF9ST1cp CiAjZGVmaW5lIEZSQklUUyhiaXRzKSAgYml0cywgU1RBTkRBUkRfQklUTUFQX0hFSUdIVCAoYml0 cykKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNVUlNP UlMgKi8KKworLyogYCstZnJpbmdlLWhlbHBlci1kZWNpbWFsJyBkZWZpbmVkIGluIGBjcm9zc2hh aXJzLmVsYCAqLworCisvKiBUT0RPOiA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ICAgICAgInh4eHh4eHh4IgorICAg ICAgInh4eHh4eHh4IgorICAgICAgIi4uLnh4Lnh4IgorICAgICAgIi4ueHguLnh4IgorICAgICAg Ii54eC4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4u Li4uLnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcmV2ZXJzZWRfdmVydGljYWxf YmFyX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweDMsIDB4MywgMHgzLCAweDYzLCAweDMzLCAw eDFiLCAweGZmLCAweGZmLCAweDFiLCAweDMzLCAweDYzLCAweDMsIDB4MywgMHgzfTsKKworLyog MjYKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgiCisg ICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4ueHguLngiCisgICAg ICAieC4uLnh4LngiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC54eHh4eHgiCisgICAgICAi eC54eHh4eHgiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC4uLnh4LngiCisgICAgICAieC4u eHguLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieHh4eHh4 eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0 X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDk5LCAweDhkLCAweDg3LCAw eGJmLAorICAweGJmLCAweDg3LCAweDhkLCAweDk5LCAweDgxLCAweDgxLCAweGZmfTsKKworLyog MjcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgiCisg ICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC54eC4ueHgiCisgICAg ICAieC4ueHgueHgiCisgICAgICAieC4uLnh4eHgiCisgICAgICAieHh4eHh4eHgiCisgICAgICAi eHh4eHh4eHgiCisgICAgICAieC4uLnh4eHgiCisgICAgICAieC4ueHgueHgiCisgICAgICAieC54 eC4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieHh4eHh4 eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19yZXZlcnNlZF9ob2xsb3dfcmVjdGFu Z2xlX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweGIxLCAweDk5 LCAweDhkLCAweGZmLAorICAweGZmLCAweDhkLCAweDk5LCAweGIxLCAweDgxLCAweDgxLCAweGZm fTsKKworLyogMjgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4 eHh4eHgiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4u LngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngi CisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisg ICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAg ICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3dfcmVjdGFu Z2xlX2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgx LAorICAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweGZmfTsKKworLyogMjkK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4uLi4iCisgICAg ICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAi eC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4u Li4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4u Li4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4i KQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9iYXJfYml0c1tdID17Cisg IDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsCisgIDB4ODAsIDB4ODAs IDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODB9OworCisvKiAzMAorICAgICgrLWZyaW5nZS1o ZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAg ICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAg ICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIu Li4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4u Li54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGljIHVu c2lnbmVkIHNob3J0IG1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9iaXRzW10gPXsKKyAgMHgzLCAw eDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgz LCAweDN9OworCisvKiAzMQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAg ICJ4eC4uLi4uLiIKKyAgICAgICJ4eC4uLi4uLiIKKyAgICAgICIgeHguLi4uLiIKKyAgICAgICIu eHguLi4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIuLi54 eC4uLiIKKyAgICAgICIuLi54eC4uLiIKKyAgICAgICIuLi4ueHguLiIKKyAgICAgICIuLi4ueHgu LiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLi54eCIK KyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2JhY2tzbGFz aF9iaXRzW10gPXsKKyAgMHhjMCwgMHhjMCwgMHhlMCwgMHg2MCwgMHgzMCwgMHgzMCwgMHgxOCwg MHgxOCwgMHhjLCAweGMsIDB4NiwgMHg2LCAweDMsIDB4M307CisKKy8qIDMyCisgICAgKCstZnJp bmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgorICAgICAgInh4Li4uLi4u IgorICAgICAgInh4eC4uLi4uIgorICAgICAgInh4eC4uLi4uIgorICAgICAgIngueHguLi4uIgor ICAgICAgIngueHguLi4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLnh4Li4uIgorICAg ICAgInguLi54eC4uIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLi4ueHguIgorICAgICAg InguLi4ueHguIgorICAgICAgInguLi4uLnh4IgorICAgICAgInguLi4uLnh4IikKKyovCitzdGF0 aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaF9iaXRzW10gPXsKKyAg MHhjMCwgMHhjMCwgMHhlMCwgMHhlMCwgMHhiMCwgMHhiMCwgMHg5OCwKKyAgMHg5OCwgMHg4Yywg MHg4YywgMHg4NiwgMHg4NiwgMHg4MywgMHg4M307CisKKy8qIDMzCisgICAgKCstZnJpbmdlLWhl bHBlci1oZXhhZGVjaW1hbAorICAgICAgIi54eHh4eHguIgorICAgICAgInh4eHgueC4uIgorICAg ICAgInh4eHgueC4uIgorICAgICAgInh4eHgueC4uIgorICAgICAgIi54eHgueC4uIgorICAgICAg Ii4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4u LngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIikKKyovCitzdGF0aWMg dW5zaWduZWQgc2hvcnQgbWNfcGlsY3Jvd19iaXRzW10gPXsKKyAgMHg3ZSwgMHhmNCwgMHhmNCwg MHhmNCwgMHg3NCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNH07CisKKy8qIDM0 CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4ueHh4eC4uIgorICAg ICAgIi54eHh4eHguIgorICAgICAgInguLnh4Li54IgorICAgICAgInguLnh4Li54IgorICAgICAg Inh4eHh4eHh4IgorICAgICAgInh4Li4uLnh4IgorICAgICAgInh4eC4ueHh4IgorICAgICAgIi54 eHh4eHguIgorICAgICAgIi4ueHh4eC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNf c21pbGV5X2ZhY2VfYml0c1tdID17CisgIDB4M2MsIDB4N2UsIDB4OTksIDB4OTksIDB4ZmYsIDB4 YzMsIDB4ZTcsIDB4N2UsIDB4M2N9OworCisvKiAzNQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4 YWRlY2ltYWwKKyAgICAgICIuLnguLi4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4u eC4uLiIKKyAgICAgICIuLi4uLnguLiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIuLi54Li4u LiIKKyAgICAgICIuLnguLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3Npbmds ZV9hbmdsZV9yaWdodF9iaXRzW10gPXsKKyAgMHgyMCwgMHgxMCwgMHg4LCAweDQsIDB4OCwgMHgx MCwgMHgyMH07CisKKy8qIDM2CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAg ICAgIi4uLi4ueC4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAg Ii4ueC4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4u Li4ueC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX2xlZnRf Yml0c1tdID17CisgIDB4NCwgMHg4LCAweDEwLCAweDIwLCAweDEwLCAweDgsIDB4NH07CisKKy8q IDM3CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Lnh4Li4uIgor ICAgICAgIi54eC54eC4uIgorICAgICAgIi4ueHgueHguIgorICAgICAgIi4uLnh4Lnh4IgorICAg ICAgIi4ueHgueHguIgorICAgICAgIi54eC54eC4uIgorICAgICAgInh4Lnh4Li4uIikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAw eGQ4LCAweDZjLCAweDM2LCAweDFiLCAweDM2LCAweDZjLCAweGQ4fTsKKworLyogMzgKKyAgICAo Ky1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4ueHgueHgiCisgICAgICAiLi54 eC54eC4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAieHgueHguLi4iCisgICAgICAiLnh4Lnh4 Li4iCisgICAgICAiLi54eC54eC4iCisgICAgICAiLi4ueHgueHgiKQorKi8KK3N0YXRpYyB1bnNp Z25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxYiwgMHgzNiwg MHg2YywgMHhkOCwgMHg2YywgMHgzNiwgMHgxYn07CisKKy8qIDM5CisgICAgKCstZnJpbmdlLWhl bHBlci1oZXhhZGVjaW1hbAorICAgICAgIngueC54Li4uIgorICAgICAgIi54LngueC4uIgorICAg ICAgIi4ueC54LnguIgorICAgICAgIi4uLngueC54IgorICAgICAgIi4ueC54LnguIgorICAgICAg Ii54LngueC4uIgorICAgICAgIngueC54Li4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQg bWNfdHJpcGxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAweGE4LCAweDU0LCAweDJhLCAweDE1 LCAweDJhLCAweDU0LCAweGE4fTsKKworLyogNDAKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFk ZWNpbWFsCisgICAgICAiLi4ueC54LngiCisgICAgICAiLi54LngueC4iCisgICAgICAiLngueC54 Li4iCisgICAgICAieC54LnguLi4iCisgICAgICAiLngueC54Li4iCisgICAgICAiLi54LngueC4i CisgICAgICAiLi4ueC54LngiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVf YW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxNSwgMHgyYSwgMHg1NCwgMHhhOCwgMHg1NCwgMHgy YSwgMHgxNX07CisKKy8qIDQxCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAg ICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAg Ii4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54 Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4u Li4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5z aWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAwLCAweDAwLCAw eDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDgyLCAweDAwLCAweDAwLCAweDAwLCAweDAw fTsKKworLyogNDIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4u Li4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4u Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4i CisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisg ICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY19zaW5nbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwg MHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMH07CisK Ky8qIDQzCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4u IgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAg ICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAg Ii4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0 aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAwLCAw eDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyLCAweDAw LCAweDAwLCAweDAwfTsKKworLyogNDQKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFs CisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisg ICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAg ICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAi Li4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4u Li4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfZG93bl9i aXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0 NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwgMHgwMH07CisKKy8qIDQ1CisgICAgKCstZnJpbmdl LWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAg ICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAg Ii4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi4u Li4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdHJpcGxlX2FuZ2xlX3VwX2Jp dHNbXSA9eworICAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDky LCAweDI4LCAweDQ0LCAweDgyLCAweDAwfTsKKworLyogNDYKKyAgICAoKy1mcmluZ2UtaGVscGVy LWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAi LnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLngu Li54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54 Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4i KQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVwbGVfYW5nbGVfZG93bl9iaXRz W10gPXsKKyAgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5Miwg MHg0NCwgMHgyOCwgMHgxMCwgMHgwMH07CisKKy8qIDQ3CisgICAgKCstZnJpbmdlLWhlbHBlci1o ZXhhZGVjaW1hbAorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54 Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4u eC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4u IgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgor ICAgICAgInguLi4uLnguIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcXVhZHJ1cGxl X2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0 LCAweDkyLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyfTsKKworLyogNDgKKyAg ICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4ueC4iCisgICAgICAi LnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLngu Li54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguL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oYm0xKSkKKyAgICAgIHsKKyAgICAgICAgbG4xID0gWEZJWE5V TSAoRmxlbmd0aCAoYm0xKSk7CisgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAgICAgewor ICAgICAgICAgICAgaWYgKGxuMSA+IGl4MikKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMSk7CisgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0s IFF0KSkKKyAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgIH0KKyAg ICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBp ZiAobG4xID4gaXgxKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGJtID0g bWNfbnRoIChpeDEsIGJtMSk7CisgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQor ICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgIH0KKyAgICAgIH0KKyAgICBlbHNlIGlmICgoYm0gPSBibTEsICFFUSAoYm0sIFF0KSkp CisgICAgICBnb3RvIGZvdW5kOworICB9CisgICAgfQorICBpZiAoIUVRIChjbWFwLCBCVkFSICgm YnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkKKyAgICAgICYmICFOSUxQ IChCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkpCisgICAg eworICAgICAgYm0yID0gbWNfYXNzcSAoYml0bWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBm cmluZ2VfaW5kaWNhdG9yX2FsaXN0KSk7CisgICAgICBpZiAoQ09OU1AgKGJtMikpCisgICAgICAg IHsKKyAgICAgICAgICBpZiAoKGJtMiA9IFhDRFIgKGJtMikpLCAhTklMUCAoYm0yKSkKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKENPTlNQIChibTIpKQorICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgIGxuMiA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMikpOworICAg ICAgICAgICAgICAgICAgaWYgKHBhcnRpYWxfcCkKKyAgICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICAgIGlmIChsbjIgPiBpeDIpCisgICAgICAgICAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMik7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAg ICAgICAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4MSkKKyAgICB7CisgICAgICBibSA9IG1jX250 aCAoaXgxLCBibTEpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgZ290byBmb3Vu ZDsKKyAgICB9CisgIGlmIChsbjIgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19udGggKGl4 MSwgYm0yKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgIGdvdG8gZm91bmQ7Cisg ICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICB9CisgICAgZWxzZSBpZiAoKGJt ID0gYm0yLCBOSUxQIChibSkpKQorICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7Cisg IGZvdW5kOgorICByZXR1cm4gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJtKTsKK30KKworc3RhdGlj IGludAorbWNfZ2V0X2xvZ2ljYWxfY3Vyc29yX2JpdG1hcCAoc3RydWN0IHdpbmRvdyAqdywgTGlz cF9PYmplY3QgY3Vyc29yKQoreworICBMaXNwX09iamVjdCBjbWFwLCBibSA9IFFuaWw7CisgIGlm ICgoY21hcCA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZnJpbmdlX2N1cnNvcl9hbGlz dCkpLCAhTklMUCAoY21hcCkpCisgICAgeworICAgICAgYm0gPSBtY19hc3NxIChjdXJzb3IsIGNt YXApOworICAgICAgaWYgKENPTlNQIChibSkpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoKGJt ID0gWENEUiAoYm0pKSwgTklMUCAoYm0pKQorICAgICAgICAgICAgcmV0dXJuIE1DX05PX0ZSSU5H RV9CSVRNQVA7CisgICAgICAgICAgcmV0dXJuIGxvb2t1cF9mcmluZ2VfYml0bWFwIChibSk7Cisg ICAgICAgIH0KKyAgICB9CisgIGlmIChFUSAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywg ZnJpbmdlX2N1cnNvcl9hbGlzdCkpKQorICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOwor ICBibSA9IG1jX2Fzc3EgKGN1cnNvciwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2N1 cnNvcl9hbGlzdCkpOworICBpZiAoIUNPTlNQIChibSkgfHwgKChibSA9IFhDRFIgKGJtKSksIE5J TFAgKGJtKSkpCisgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgIHJldHVybiBsb29r dXBfZnJpbmdlX2JpdG1hcCAoYm0pOworfQorCitzdGF0aWMgaW50CittY19nZXRfbG9naWNhbF9m cmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNwX09iamVjdCBiaXRtYXAsIGludCBy aWdodF9wLCBpbnQgcGFydGlhbF9wKQoreworICBMaXNwX09iamVjdCBjbWFwLCBibTEgPSBRbmls L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UTUFQOworICAgICAgICAgIGlmIChDT05T UCAoYm0xKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbG4xID0gWEZJWE5VTSAoRmxl bmd0aCAoYm0xKSk7CisgICAgICAgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgaWYgKGxuMSA+IGl4MikKKyAgICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMSk7CisgICAg ICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAgICAg ICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICBpZiAobG4xID4gaXgxKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICAgICAgICAgICAg ICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICBnb3Rv IGZvdW5kOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKChibSA9IGJtMSwgIUVRIChibSwgUXQp KSkKKyAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgfQorICAgIH0KKyAgaWYgKCFF USAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkp CisgICAgICAmJiAhTklMUCAoQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRv cl9hbGlzdCkpKQorICAgIHsKKyAgICAgIGJtMiA9IG1jX2Fzc3EgKGJpdG1hcCwgQlZBUiAoJmJ1 ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpOworICAgICAgaWYgKENPTlNQ IChibTIpKQorICAgICAgICB7CisgICAgICAgICAgaWYgKChibTIgPSBYQ0RSIChibTIpKSwgIU5J TFAgKGJtMikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChDT05TUCAoYm0yKSkK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBsbjIgPSBYRklYTlVNIChGbGVu Z3RoIChibTIpKTsKKyAgICAgICAgICAgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAobG4yID4gaXgyKQorICAgICAg ICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBibSA9IG1jX250 aCAoaXgyLCBibTIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQp KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGlmIChsbjEgPiBpeDEpCisgICAgewor ICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisg ICAgICAgIGdvdG8gZm91bmQ7CisgICAgfQorICBpZiAobG4yID4gaXgxKQorICAgIHsKKyAgICAg IGJtID0gbWNfbnRoIChpeDEsIGJtMik7CisgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAg ICBnb3RvIGZvdW5kOworICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgfQor ICAgIGVsc2Uga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ycm93X3RvcCA9IGFycm93X2JvdCA9IFhDRFIgKHBvcyk7CisgICAgICAgICAg aWYgKHBvcyA9IG1jX2Fzc3EgKFF0b3AsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAg Ym91bmRhcnlfdG9wID0gWENEUiAocG9zKTsKKyAgICAgICAgICBpZiAocG9zID0gbWNfYXNzcSAo UWJvdHRvbSwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBib3VuZGFyeV9ib3QgPSBY Q0RSIChwb3MpOworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRdXAsIGluZCksICFOSUxQ IChwb3MpKQorICAgICAgICAgICAgYXJyb3dfdG9wID0gWENEUiAocG9zKTsKKyAgICAgICAgICBp ZiAocG9zID0gbWNfYXNzcSAoUWRvd24sIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAg YXJyb3dfYm90ID0gWENEUiAocG9zKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAg ICAgLyogQW55dGhpbmcgZWxzZSBtZWFucyBib3VuZGFyeSBvbiBsZWZ0IGFuZCBubyBhcnJvd3Mu ICAqLworICAgICAgICAgIGJvdW5kYXJ5X3RvcCA9IGJvdW5kYXJ5X2JvdCA9IFFsZWZ0OworICAg IH0KKyAgdG9wX2luZF9ybiA9IGJvdF9pbmRfcm4gPSAtMTsKKyAgaWYgKCFOSUxQIChpbmQpKQor ICAgIHsKKyAgICAgIGZvciAoeSA9IHctPnZzY3JvbGwsIHJuID0gMDsKKyAgICAgICAgICAgeSA8 IHliICYmIHJuIDwgbnJvd3M7CisgICAgICAgICAgIHkgKz0gcm93LT5oZWlnaHQsICsrcm4pCisg ICAgICAgIHsKKyAgICAgICAgICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJuOwor ICAgICAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICByb3cgPSB3LT5jdXJy ZW50X21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgIHJvdy0+aW5kaWNhdGVfYm9iX3AgPSBy b3ctPmluZGljYXRlX3RvcF9saW5lX3AgPSAwOworICAgICAgICAgIHJvdy0+aW5kaWNhdGVfZW9i X3AgPSByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgPSAwOworICAgICAgICAgIGlmICghcm93 LT5tb2RlX2xpbmVfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKHRvcF9pbmRf cm4gPCAwICYmIHJvdy0+dmlzaWJsZV9oZWlnaHQgPiAwKQorICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgIGlmIChNQVRSSVhfUk9XX1NUQVJUX0NIQVJQT1MgKHJvdykgPD0gQlVG X0JFR1YgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSkKKyAgICAgICAgICAgICAgICAgICAgICAmJiAh TUFUUklYX1JPV19QQVJUSUFMTFlfVklTSUJMRV9BVF9UT1BfUCAodywgcm93KSkKKyAgICAgICAg ICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib2JfcCA9ICFOSUxQIChib3VuZGFyeV90b3ApOwor ICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgcm93LT5pbmRp Y2F0ZV90b3BfbGluZV9wID0gIU5JTFAgKGFycm93X3RvcCk7CisgICAgICAgICAgICAgICAgICB0 b3BfaW5kX3JuID0gcm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBpZiAoYm90 X2luZF9ybiA8IDApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKE1B VFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgPj0gQlVGX1pWIChYQlVGRkVSICh3LT5jb250ZW50 cykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU1BVFJJWF9ST1dfUEFSVElBTExZX1ZJU0lC TEVfQVRfQk9UVE9NX1AgKHcsIHJvdykpCisgICAgICAgICAgIC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JCVwKKyAgKGJpdG1hcF9jYWNoZVtjYWNoZSo0KzIrcGFydGlhbF9wXSA+PSAwCQkJXAor ICAgPyBiaXRtYXBfY2FjaGVbY2FjaGUqNCsyK3BhcnRpYWxfcF0JCQkJXAorICAgOiAoYml0bWFw X2NhY2hlW2NhY2hlKjQrMitwYXJ0aWFsX3BdID0JCQlcCisgICAgICBtY19nZXRfbG9naWNhbF9m cmluZ2VfYml0bWFwICh3LCB3aGljaCwgMSwgcGFydGlhbF9wKSkpCisgIC8qIEV4dGVuZCB0b3At YWxpZ25lZCB0b3AgaW5kaWNhdG9yIChvciBib3R0b20tYWxpZ25lZCBib3R0b20KKyAgICAgaW5k aWNhdG9yKSB0byBhZGphY2VudCByb3dzIGlmIGl0IGRvZXNuJ3QgZml0IGluIG9uZSByb3cuICAq LworICB0b3BfaW5kX21pbl95ID0gYm90X2luZF9tYXhfeSA9IC0xOworICBpZiAodG9wX2luZF9y biA+PSAwKQorICAgIHsKKyAgICAgIGludCBibiA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAg ICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHRvcF9pbmRfcm47CisgICAgICBpZiAo IXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICByb3cgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyAr IHRvcF9pbmRfcm47CisgICAgICB0b3Bfcm93X2VuZHNfYXRfenZfcCA9IHJvdy0+ZW5kc19hdF96 dl9wOworICAgICAgaWYgKHJvdy0+aW5kaWNhdGVfYm9iX3ApCisgICAgICAgIHsKKyAgICAgICAg ICBpZiAoRVEgKGJvdW5kYXJ5X3RvcCwgUWxlZnQpKQorICAgICAgICAgICAgYm4gPSAoKHJvdy0+ aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQpKQorICAgICAgICAgICAg ICAgICAgPyBNQ19MRUZUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ZW5kc19hdF96dl9w KQorICAgICAgICAgICAgICAgICAgOiBNQ19MRUZUX0ZSSU5HRSAoMiwgUXRvcCwgMCkpOworICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBibiA9ICgocm93LT5pbmRpY2F0ZV9lb2JfcCAm JiBFUSAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICAgICAgICAgICAgICA/IE1DX1JJ R0hUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKQorICAgICAgICAg ICAgICAgICAgICA6IE1DX1JJR0hUX0ZSSU5HRSAoMiwgUXRvcCwgMCkpOworICAgICAgICB9Cisg ICAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCkKKyAgICAgICAgICB7Cisg ICAgICAgICAgICBpZiAoRVEgKGFycm93X3RvcCwgUWxlZnQpKQorICAgICAgICAgICAgICBibiA9 IE1DX0xFRlRfRlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAgICAgICAgfQor ICAgICAgaWYgKGJuICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHsKKyAgICAgICAg ICBzdHJ1Y3QgZnJpbmdlX2JpdG1hcCAqZmIgPSBnZXRfZnJpbmdlX2JpdG1hcF9kYXRhIChibik7 CisgICAgICAgICAgaWYgKGZiLT5hbGlnbiA9PSBBTElHTl9CSVRNQVBfVE9QICYmIGZiLT5wZXJp b2QgPT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAq cm93MTsKKyAgICAgICAgICAgICAgaW50IHRvcF9pbmRfbWF4X3k7CisgICAgICAgICAgICAgIHRv cF9pbmRfbWluX3kgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgICAgICAg ICAgdG9wX2luZF9tYXhfeSA9IHRvcF9pbmRfbWluX3kgKyBmYi0+aGVpZ2h0OworICAgICAgICAg ICAgICBpZiAodG9wX2luZF9tYXhfeSA+IHliKQorICAgICAgICAgICAgICAgIHRvcF9pbmRfbWF4 X3kgPSB5YjsKKyAgICAgICAgICAgICAgZm9yICh5ID0gcm93LT55ICsgcm93LT5oZWlnaHQsIHJu ID0gdG9wX2luZF9ybiArIDE7CisgICAgICAgICAgICAgICAgICAgeSA8IHRvcF9pbmRfbWF4X3kg JiYgcm4gPCBucm93czsKKyAgICAgICAgICAgICAgICAgICB5ICs9IHJvdzEtPmhlaWdodCwgcm4r KykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAoYm90X2luZF9ybiA+ PSAwICYmIHJuID49IGJvdF9pbmRfcm4pCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAg ICAgICAgICAgICAgICAgcm93MSA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm47CisgICAg ICAgICAgICAgICAgICBpZiAoIXJvdzEtPmVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgICAgICAg cm93MSA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICAgICAgICBy b3cxLT5pbmRpY2F0ZV9ib2JfcCA9IHJvdy0+aW5kaWNhdGVfYm9iX3A7CisgICAgICAgICAgICAg ICAgICByb3cxLT5pbmRpY2F0ZV90b3BfbGluZV9wID0gcm93LT5pbmRpY2F0ZV90b3BfbGluZV9w OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAg aWYgKGJvdF9pbmRfcm4gPj0gMCkKKyAgICB7CisgICAgICBpbnQgYm4gPSBNQ19OT19GUklOR0Vf QklUTUFQOworICAgICAgcm93ID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBib3RfaW5kX3Ju OworICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgcm93ID0gdy0+Y3VycmVudF9t YXRyaXgtPnJvd3MgKyBib3RfaW5kX3JuOworICAgICAgYm90X3Jvd19lbmRzX2F0X3p2X3AgPSBy b3ctPmVuZHNfYXRfenZfcDsKKyAgICAgIGlmIChyb3ctPmluZGljYXRlX2VvYl9wKQorICAgICAg ICB7CisgICAgICAgICAgaWYgKEVRIChib3VuZGFyeV9ib3QsIFFsZWZ0KSkKKyAgICAgICAgICAg IGJuID0gTUNfTEVGVF9GUklOR0UgKDMsIFFib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKTsKKyAg ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDMsIFFi b3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChy b3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3ApCisgICAgICAgICAgeworICAgICAgICAgICAgaWYg KEVRIChhcnJvd19ib3QsIFFsZWZ0KSkKKyAgICAgICAgICAgICAgYm4gPSBNQ19MRUZUX0ZSSU5H RSAoNywgUWRvd24sIDApOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgYm4g PSBNQ19SSUdIVF9GUklOR0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICB9CisgICAgICBpZiAo Ym4gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBm cmluZ2VfYml0bWFwICpmYiA9IGdldF9mcmluZ2VfYml0bWFwX2RhdGEgKGJuKTsKKyAgICAgICAg ICBpZiAoZmItPmFsaWduID09IEFMSUdOX0JJVE1BUF9CT1RUT00gJiYgZmItPnBlcmlvZCA9PSAw KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cxOwor ICAgICAgICAgICAgICBpbnQgYm90X2luZF9taW5feTsKKyAgICAgICAgICAgICAgYm90X2luZF9t YXhfeSA9IHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQ7CisgICAgICAgICAgICAgIGJvdF9p bmRfbWluX3kgPSBib3RfaW5kX21heF95IC0gZmItPmhlaWdodDsKKyAgICAgICAgICAgICAgaWYg KGJvdF9pbmRfbWluX3kgPCBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KSkKKyAgICAgICAg ICAgICAgICBib3RfaW5kX21pbl95ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7Cisg ICAgICAgICAgICAgIGZvciAoeSA9IHJvdy0+eSwgcm4gPSBib3RfaW5kX3JuIC0gMTsKKyAgICAg ICAgICAgICAgICAgICB5ID49IGJvdF9pbmRfbWluX3kgJiYgcm4gPj0gMDsKKyAgICAgICAgICAg ICAgICAgICB5IC09IHJvdzEtPmhlaWdodCwgcm4tLSkKKyAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICBpZiAodG9wX2luZF9ybiA+PSAwICYmIHJuIDw9IHRvcF9pbmRfcm4pCisg ICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgcm93MSA9IHctPmRl c2lyZWRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICAgICAgICBpZiAoIXJvdzEtPmVu YWJsZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgcm93MSA9IHctPmN1cnJlbnRfbWF0cml4LT5y b3dzICsgcm47CisgICAgICAgICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV9lb2JfcCA9IHJvdy0+ aW5kaWNhdGVfZW9iX3A7CisgICAgICAgICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV9ib3R0b21f bGluZV9wID0gcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wOworICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgTGlzcF9PYmplY3QgYnVmID0gdy0+ Y29udGVudHM7CisgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgYm9vbCBhdXRvX2hzY3JvbGxfbW9k ZV9wID0gRVEgKEZidWZmZXJfbG9jYWxfdmFsdWUgKFFhdXRvX2hzY3JvbGxfbW9kZSwgYnVmKSwg UWN1cnJlbnRfbGluZSk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSkgKi8KKyAgYm9v bCBoc2NsX2FsbF90ZW1wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gbm90 aGluZy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNj cm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOworICAvKiBFWEFN UExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgZWxzZSBiZXNpZGVzIGhvcml6b250YWxs eSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IGxpbmUgZGlmZmVyZW50bHku CisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9s bGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMV9wID0gKCF3LT5zdXNw ZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNj cm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4g MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwp OworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAuLi4KKyAgICAgICAgICAgICAgIEN1cnJl bnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisg IGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPT0gMAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgKHNj cm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxlZnQgYXJyb3cga2V5IG9uZSB0aW1l LgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5IHNjcm9sbGVk IGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1wX3AgPSAoIXctPnN1c3BlbmRfYXV0b19o c2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5k IGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVudCBsaW5lIHRvIGJlCisgICAgICAg ICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuCisgICAgICAgICAgICAg ICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICov CisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAg ICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAg ICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hz Y3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+ aHNjcm9sbCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBmb3Ig KHkgPSB3LT52c2Nyb2xsLCBybiA9IDA7CisgICAgICAgeSA8IHliICYmIHJuIDwgbnJvd3M7Cisg ICAgICAgeSArPSByb3ctPmhlaWdodCwgcm4rKykKKyAgICB7CisgIGludCBsZWZ0LCByaWdodDsK KyAgdW5zaWduZWQgbGVmdF9mYWNlX2lkLCByaWdodF9mYWNlX2lkOworICBpbnQgbGVmdF9vZmZz ZXQsIHJpZ2h0X29mZnNldDsKKyAgYm9vbCBwZXJpb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FsbF90ZW1wX3AKKyAgICAgICAgICAmJiAhaHNjbF90ZW1wX3AKKyAgICAgICAg ICAmJiAhaHNjbF9wZXJtX3AKKyAgICAgICAgICAmJiAhaHNjbF9hbGxfcGVybV8wX3AKKyAgICAg ICAgICAmJiAhaHNjbF9hbGxfcGVybV8xX3AKKyAgICAgICAgICAmJiAhaHNjbF9hbGxfcGVybV8y X3AKKyAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgZnJp bmdlX2JpdG1hcCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgZW51bSBmYWNlX2lk IG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgICAoIWFjdGl2ZV9wCisgICAgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVf d2luZG93cykpKQorICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJu ICgiKy1vdmVybGF5LWFycm93LWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAg ICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywg ZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAg ICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lk ID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBp ZiAody0+aHNjcm9sbCAhPSAwKQorICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9m cmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ciKSwgZmFsc2UsIHRydWUp OworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0 X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJvdyIpLCB0cnVlLCB0cnVl KTsKKyAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNf TEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19O T19GUklOR0VfQklUTUFQOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKCh2cG9zID09IHZu dGhfZG0gfHwgdnBvcyA9PSB2bnRoX2NtKQorICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2 b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICAgICAgICAgICAgJiYgKGhzY2xf YWxsX3RlbXBfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8wX3AKKyAg ICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMV9wCisgICAgICAgICAgICAgICAg ICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF90 ZW1wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfcGVybV9wKQorICAgICAgICAgICAg ICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgeworICAgICAgICAgICAgaW50IGZyaW5nZV9i aXRtYXAgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgICAgZW51bSBmYWNlX2lkIG92 ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgICAgICghYWN0aXZlX3AKKyAgICAgICAg ICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZl X3dpbmRvd3MpKSkKKyAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1ZSkK KyAgICAgICAgICAgICAgOiAoYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFt ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtcHJlLXp2LWZhY2Ui KSwgdHJ1ZSkKKyAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgICBt Y19sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJ VE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBvdmVybGF5X2Fy cm93X2ZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBERUZB VUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgICBpZiAoaHNjbF9hbGxfcGVybV8wX3ApCisgICAgICAg ICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgi Ky1oc2NsLXBlcm0iKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAgICAgZWxzZSBpZiAoaHNj bF9hbGxfcGVybV8xX3ApCisgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9m cmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCB0cnVlLCBmYWxzZSk7Cisg ICAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8yX3ApCisgICAgICAgICAgICAg ICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIist aHNjbC1wZXJtIiksIGZhbHNlLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhz Y2xfcGVybV9wKQorICAgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2Zy aW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIHRydWUsIHRydWUpOworICAg ICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF90ZW1wX3ApCisgICAgICAgICAgICAg ICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4g KCIrLWhzY2wtdGVtcCIpLCBmYWxzZSwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgIGVs c2UgaWYgKGhzY2xfdGVtcF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1h cCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtdGVtcCIpLCB0cnVl LCBmYWxzZSk7CisgICAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5 cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICB9CisgICAgICAgICAgZWxz ZSBpZiAoKHZwb3MgPT0gdm50aF9kbSB8fCB2cG9zID09IHZudGhfY20pCisgICAgICAgICAgICAg ICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJP VworICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VE X0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAgICAgICAgICAg ICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAg ICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2 b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9m bGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAg ICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkKKyAgICAgICAg ICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBM aXNwX09iamVjdCBiaXRtYXBfZmxhdm9yID0gKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVD VEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBRbWNfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VE X0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX2hvbGxvd19yZWN0YW5nbGVfcmlnaHRf YXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBo X2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvdworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09 IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBRbWNfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19yZXZlcnNl ZF92ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfYmFj a3NsYXNoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFFuaWw7 CisgICAgICAgICAgICAgIG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0g TUNfUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IGxvb2t1cF9mcmluZ2VfYml0bWFwIChiaXRtYXBfZmxhdm9yKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAg ICAgICAgICAgICAgbWNfcmlnaHRfZnJpbmdlX2ZhY2VfaWQgPQorICAgICAgICAgICAgICAgIChj dXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICYm IHJvd19wb3NpdGlvbiA9PSBQUkVfWlYKKyAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZv ciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAg ICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJ R0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVW RVJTRURfVkVSVElDQUxfQkFSKSkKKyAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistcmV2ZXJzZWQtYmFyLXByZS16di1mYWNlIiksIHRydWUpCisg ICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAor ICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBBVF9aVgorICAgICAgICAgICAg ICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9S SUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNf UkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAg IHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAg ICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1i YXItYXQtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgIDogKGN1cnNvcl90eXBlID09 IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRp b24gPT0gUE9TVF9aVgorICAgICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNf UkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAg ICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FS Uk9XCisgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAo dywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1iYXItcG9zdC16di1mYWNlIiksIHRydWUpCisgICAg ICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAg ICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYKKyAgICAgICAgICAgICAg ICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdI VF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9m bGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgPyBs b29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1iYXItcHJlLXp2LWZhY2UiKSwgdHJ1 ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklU TUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IEFUX1pWCisgICAgICAg ICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5H TEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNf UkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgJiYg Z2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAg ICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistYmFyLWF0LXp2LWZhY2Ui KSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklO R0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBPU1RfWlYK KyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9X X1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZv ciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAg ICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAg ICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1iYXItcG9z dC16di1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7Cisg ICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAg ICAgIHJvdyA9IGN1cjsKKyAgICAgIGxlZnRfZmFjZV9pZCA9IHJpZ2h0X2ZhY2VfaWQgPSBERUZB VUxUX0ZBQ0VfSUQ7CisgICAgICBsZWZ0X29mZnNldCA9IHJpZ2h0X29mZnNldCA9IDA7CisgICAg ICBwZXJpb2RpY19wID0gMDsKKyAgICAgIC8qIERlY2lkZSB3aGljaCBiaXRtYXAgdG8gZHJhdyBp biB0aGUgbGVmdCBmcmluZ2UuICAqLworICAgICAgaWYgKFdJTkRPV19MRUZUX0ZSSU5HRV9XSURU SCAodykgPT0gMCkKKyAgICAgICAgbGVmdCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICBl bHNlIGlmIChyb3ctPmxlZnRfdXNlcl9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRN QVApCisgICAgICAgIHsKKyAgICAgICAgICBsZWZ0ID0gcm93LT5sZWZ0X3VzZXJfZnJpbmdlX2Jp dG1hcDsKKyAgICAgICAgICBsZWZ0X2ZhY2VfaWQgPSByb3ctPmxlZnRfdXNlcl9mcmluZ2VfZmFj ZV9pZDsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgcm93 LT50cnVuY2F0ZWRfb25fbGVmdF9wKQorICAgICAgICAgICAgICAgfHwgKHJvdy0+cmV2ZXJzZWRf cCAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKSkKKyAgICAgICAgbGVmdCA9IE1DX0xFRlRf RlJJTkdFICgwLCBRdHJ1bmNhdGlvbiwgMCk7CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRl X2JvYl9wICYmIEVRIChib3VuZGFyeV90b3AsIFFsZWZ0KSkKKyAgICAgICAgeworICAgICAgICAg IGxlZnQgPSAoKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQp KQorICAgICAgICAgICAgICAgICA/IE1DX0xFRlRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwgdG9w X3Jvd19lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgICAgIDogTUNfTEVGVF9GUklOR0UgKDIs IFF0b3AsIDApKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAgICAg ICAgbGVmdF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55OworICAgICAgICB9CisgICAg ICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFsZWZ0 KSkKKyAgICAgICAgeworICAgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoMywgUWJvdHRv bSwgYm90X3Jvd19lbmRzX2F0X3p2X3ApOworICAgICAgICAgIGlmIChib3RfaW5kX21heF95ID49 IDApCisgICAgICAgICAgICBsZWZ0X29mZnNldCA9IGJvdF9pbmRfbWF4X3kgLSAocm93LT55ICsg cm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKCghcm93LT5y ZXZlcnNlZF9wICYmIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAocm93KSkKKyAgICAg ICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jb250aW51ZWRfcCkpCisgICAg ICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNCwgUWNvbnRpbnVhdGlvbiwgMCk7CisgICAgICBl bHNlIGlmIChyb3ctPmluZGljYXRlX2VtcHR5X2xpbmVfcCAmJiBFUSAoZW1wdHlfcG9zLCBRbGVm dCkpCisgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNSwgUWVtcHR5X2xpbmUsIDApOwor ICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGluZV9wICYmIEVRIChhcnJvd190b3As IFFsZWZ0KSkKKyAgICAgICAgeworICAgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNiwg UXVwLCAwKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAgICAgICAg bGVmdF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55OworICAgICAgICB9CisgICAgICBl bHNlIGlmIChyb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgJiYgRVEgKGFycm93X2JvdCwgUWxl ZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg3LCBRZG93 biwgMCk7CisgICAgICAgICAgaWYgKGJvdF9pbmRf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KyAgICAgICAgICAgICA/IE1DX1JJR0hUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHRvcF9y b3dfZW5kc19hdF96dl9wKQorICAgICAgICAgICAgIDogTUNfUklHSFRfRlJJTkdFICgyLCBRdG9w LCAwKSk7CisgICAgICAgICAgaWYgKHRvcF9pbmRfbWluX3kgPj0gMCkKKyAgICAgICAgICAgIHJp Z2h0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSByb3ctPnk7CisgICAgICAgIH0KKyAgICAgIGVs c2UgaWYgKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUXJpZ2h0KSkK KyAgICAgICAgeworICAgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICgzLCBRYm90dG9t LCBib3Rfcm93X2VuZHNfYXRfenZfcCk7CisgICAgICAgICAgaWYgKGJvdF9pbmRfbWF4X3kgPj0g MCkKKyAgICAgICAgICAgIHJpZ2h0X29mZnNldCA9IGJvdF9pbmRfbWF4X3kgLSAocm93LT55ICsg cm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKCghcm93LT5y ZXZlcnNlZF9wICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICB8fCAocm93LT5y ZXZlcnNlZF9wICYmIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAocm93KSkpCisgICAg ICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICg0LCBRY29udGludWF0aW9uLCAwKTsKKyAgICAg IGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCAmJiBFUSAoYXJyb3dfdG9wLCBRcmln aHQpKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklOR0UgKDYsIFF1 cCwgMCk7CisgICAgICAgICAgaWYgKHRvcF9pbmRfbWluX3kgPj0gMCkKKyAgICAgICAgICAgIHJp Z2h0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSByb3ctPnk7CisgICAgICAgIH0KKyAgICAgIGVs c2UgaWYgKHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCAmJiBFUSAoYXJyb3dfYm90LCBRcmln aHQpKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklOR0UgKDcsIFFk b3duLCAwKTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAgICAgICAgICAg cmlnaHRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVp Z2h0KTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9lbXB0eV9saW5l X3AgJiYgRVEgKGVtcHR5X3BvcywgUXJpZ2h0KSkKKyAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9G UklOR0UgKDUsIFFlbXB0eV9saW5lLCAwKTsKKyAgICAgIGVsc2UKKyAgICAgICAgcmlnaHQgPSBN Q19OT19GUklOR0VfQklUTUFQOworICAgICAgcGVyaW9kaWNfcCA9IChnZXRfZnJpbmdlX2JpdG1h cF9kYXRhIChsZWZ0KS0+cGVyaW9kICE9IDAKKyAgICAgICAgICAgICAgICAgICAgfHwgZ2V0X2Zy aW5nZV9iaXRtYXBfZGF0YSAocmlnaHQpLT5wZXJpb2QgIT0gMCk7CisgICAgICBpZiAocm93LT55 ICE9IGN1ci0+eQorICAgICAgICAgIHx8IHJvdy0+dmlzaWJsZV9oZWlnaHQgIT0gY3VyLT52aXNp YmxlX2hlaWdodAorICAgICAgICAgIHx8IHJvdy0+ZW5kc19hdF96dl9wICE9IGN1ci0+ZW5kc19h dF96dl9wCisgICAgICAgICAgfHwgbGVmdCAhPSBjdXItPmxlZnRfZnJpbmdlX2JpdG1hcAorICAg ICAgICAgIHx8IHJpZ2h0ICE9IGN1ci0+cmlnaHRfZnJpbmdlX2JpdG1hcAorICAgICAgICAgIHx8 IGxlZnRfZmFjZV9pZCAhPSBjdXItPmxlZnRfZnJpbmdlX2ZhY2VfaWQKKyAgICAgICAgICB8fCBy aWdodF9mYWNlX2lkICE9IGN1ci0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQKKyAgICAgICAgICB8fCBs ZWZ0X29mZnNldCAhPSBjdXItPmxlZnRfZnJpbmdlX29mZnNldAorICAgICAgICAgIHx8IHJpZ2h0 X29mZnNldCAhPSBjdXItPnJpZ2h0X2ZyaW5nZV9vZmZzZXQKKyAgICAgICAgICB8fCBwZXJpb2Rp Y19wICE9IGN1ci0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wCisgICAgICAgICAgfHwgY3VyLT5y ZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCkKKyAgICAgICAgeworICAgICAgICAgIHJlZHJhd19wID0g MSwgcm93LT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAgaWYgKCFrZWVw X2N1cnJlbnRfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY3VyLT5yZWRyYXdfZnJp bmdlX2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRt YXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgfHwgbWNfcmlnaHRf ZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1 ci0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgZWxz ZQorICAgICAgICAgICAgICAgICAgY3VyLT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBwZXJp b2RpY19wOworICAgICAgICAgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFwICE9IE1DX05P X0ZS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QorICAgICAgICAgICAgICAgIGN1 ci0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQgPSBtY19yaWdodF9mcmluZ2VfZmFjZV9pZDsKKyAgICAg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPnJpZ2h0X2ZyaW5nZV9mYWNl X2lkID0gcmlnaHRfZmFjZV9pZDsKKyAgICAgICAgICAgICAgaWYgKG1jX3JpZ2h0X2ZyaW5nZV9i aXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPnJpZ2h0 X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAg ICAgIGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldCA9IHJpZ2h0X29mZnNldDsKKyAgICAgICAgICAg IH0KKyAgICAgICAgfQorICAgICAgaWYgKHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgPCAwKQor ICAgICAgICByb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwID0gbWNfZ2V0X2xvZ2ljYWxfZnJpbmdl X2JpdG1hcCAodywgUW92ZXJsYXlfYXJyb3csIDAsIDApOworICAgICAgaWYgKHJvdy0+b3Zlcmxh eV9hcnJvd19iaXRtYXAgIT0gY3VyLT5vdmVybGF5X2Fycm93X2JpdG1hcCkKKyAgICAgICAgewor ICAgICAgICAgIHJlZHJhd19wID0gMSwgcm93LT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7 CisgICAgICAgICAgaWYgKCFrZWVwX2N1cnJlbnRfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgY3VyLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAgICAgIGN1 ci0+b3ZlcmxheV9hcnJvd19iaXRtYXAgPSByb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwOworICAg ICAgICAgICAgfQorICAgICAgIC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IHplcm8KKyAgICAgICAgICAgICAgIGJlZm9yZSBkcmF3aW5nIG5vbi1lbXB0eSBtYXJnaW4gYXJl YS4gICovCisgICAgICAgICAgICAmJiB3LT5sZWZ0X21hcmdpbl9jb2xzID09IDApCisgICAgICAg ICAgID8gMSA6IDApOworICAgICAgICAgIHAuYnggPSB4IC0gd2Q7CisgICAgICAgICAgcC5ueCA9 IHdkOworICAgICAgICB9CisgICAgfQorICBlbHNlCisgICAgeworICAgICAgaW50IHggPSB3aW5k b3dfYm94X3JpZ2h0ICh3LAorICAgICAgICAoV0lORE9XX0hBU19GUklOR0VTX09VVFNJREVfTUFS R0lOUyAodykKKyAgICAgICAgID8gUklHSFRfTUFSR0lOX0FSRUEKKyAgICAgICAgIDogVEVYVF9B UkVBKSk7CisgICAgICBpbnQgd2QgPSBXSU5ET1dfUklHSFRfRlJJTkdFX1dJRFRIICh3KTsKKyAg ICAgIGlmIChwLndkID4gd2QpCisgICAgICAgIHAud2QgPSB3ZDsKKyAgICAgIHAueCA9IHggKyAo d2QgLSBwLndkKSAvIDI7CisgICAgICAvKiBDbGVhciByaWdodCBmcmluZ2UgaWYgbm8gYml0bWFw IHRvIGRyYXcgb2YgaWYgYml0bWFwIGRvZXNuJ3QgZmlsbAorICAgdGhlIGZyaW5nZS4gICovCisg ICAgICBpZiAocC53ZCA8IHdkIHx8IHAueSA+IHAuYnkgfHwgcC55ICsgcC5oIDwgcC5ieSArIHAu bnkpCisgICAgICAgIHsKKyAgICAgICAgICBwLmJ4ID0geDsKKyAgICAgICAgICBwLm54ID0gd2Q7 CisgICAgICAgIH0KKyAgICB9CisgIGlmIChwLnggPj0gV0lORE9XX0JPWF9MRUZUX0VER0VfWCAo dykKKyAgICAgICYmIChwLnggKyBwLndkKSA8PSBXSU5ET1dfQk9YX0xFRlRfRURHRV9YICh3KSAr IFdJTkRPV19QSVhFTF9XSURUSCAodykpCisgICAgRlJBTUVfUklGIChmKS0+ZHJhd19mcmluZ2Vf Yml0bWFwICh3LCByb3csICZwKTsKK30KKwordm9pZAorbWNfZHJhd19mcmluZ2VfYml0bWFwIChz dHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCBsZWZ0X3AsIGVudW0g bWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUpCit7CisgIGludCBvdmVybGF5ID0gMDsKKyAgaWYg KGxlZnRfcCA9PSByb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jdXJzb3JfaW5fZnJpbmdlX3ApCisg ICAgeworICAgICAgTGlzcF9PYmplY3QgY3Vyc29yID0gUW5pbDsKKyAgICAgIHN3aXRjaCAoY3Vy c29yX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOgorICAgICAg ICAgIGlmIChyb3ctPnZpc2libGVfaGVpZ2h0ID49IFNUQU5EQVJEX0JJVE1BUF9IRUlHSFQgKGhv bGxvd19yZWN0YW5nbGVfYml0cykpCisgICAgICAgICAgICBjdXJzb3IgPSBRaG9sbG93OworICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgIGN1cnNvciA9IFFob2xsb3dfc21hbGw7CisgICAgICAg ICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICAgICAgICBpZiAocm93 LT52aXNpYmxlX2hlaWdodCA+PSBTVEFOREFSRF9CSVRNQVBfSEVJR0hUIChob2xsb3dfcmVjdGFu Z2xlX2JpdHMpKQorICAgICAgICAgICAgY3Vyc29yID0gUWhvbGxvdzsKKyAgICAgICAgICBlbHNl CisgICAgICAgICAgICBjdXJzb3IgPSBRaG9sbG93X3NtYWxsOworICAgICAgICAgIGJyZWFrOwor ICAgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgICAgY3Vyc29yID0gUWJveDsKKyAg ICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgICAgY3Vyc29yID0g UWJhcjsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19IQkFSOgorICAgICAgICAg IGN1cnNvciA9IFFoYmFyOworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1DX05PX0ZS SU5HRV9CSVRNQVA6CisgICAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgorICAgICAgICBjYXNlIE1D X1JJR0hUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQ OgorICAgICAgICBkZWZhdWx0OgorICAgICAgICAgIHctPnBoeXNfY3Vyc29yX29uX3AgPSAwOwor ICAgICAgICAgIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gMDsKKyAgICAgICAgICBicmVhazsK KyAgICAgICAgfQorICAgICAgaWYgKCFOSUxQIChjdXJzb3IpKQorICAgICAgICB7CisgICAgICAg ICAgaW50IGJtID0gbWNfZ2V0X2xvZ2ljYWxfY3Vyc29yX2JpdG1hcCAodywgY3Vyc29yKTsKKyAg ICAgICAgICBpZiAoYm0gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwXzEgKHcsIHJvdywgbGVmdF9wLCAyLCBi bSk7CisgICAgICAgICAgICAgIG92ZXJsYXkgPSBFUSAoY3Vyc29yLCBRYm94KSA/IDMgOiAxOwor ICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBtY19kcmF3X2ZyaW5nZV9iaXRtYXBf MSAodywgcm93LCBsZWZ0X3AsIG92ZXJsYXksIE1DX05PX0ZSSU5HRV9CSVRNQVApOworICBpZiAo bGVmdF9wICYmIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1B UCkKKyAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXBfMSAodywgcm93LCAxLCAxLCByb3ctPm92ZXJs YXlfYXJyb3dfYml0bWFwKTsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICNkZWZpbmUgTk9fRlJJTkdFX0JJVE1BUCAwCiAjZGVm aW5lIFVOREVGX0ZSSU5HRV9CSVRNQVAgMQogI2RlZmluZSBNQVhfU1RBTkRBUkRfRlJJTkdFX0JJ VE1BUFMgQVJSQVlFTFRTIChzdGFuZGFyZF9iaXRtYXBzKQpAQCAtMTcwMCw2ICszMjIwLDE2OCBA QCBSZXR1cm4gbmlsIGlmIFBPUyBpcyBub3QgdmlzaWJsZSBpbiBXSU5ET1cuICAqLykKIHZvaWQK IHN5bXNfb2ZfZnJpbmdlICh2b2lkKQogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIChnZXQgJ2VtcHR5LWxpbmUgJ2Zy aW5nZSkgPT4gMjMgPT4gdGhlIGxhc3Qgc3RhbmRhcmQtYml0bWFwIGJlZm9yZSB0aGlzIG9uZS4K KyAgU2VlIGBmcmluZ2UuZWxgLiAqLworCisgIC8qIDI0ICovCisgIERFRlNZTSAoUW1jX3ZlcnRp Y2FsX2Jhcl9yaWdodF9hcnJvdywgIistdmVydGljYWwtYmFyLXJpZ2h0LWFycm93Iik7CisgIFZm cmluZ2VfYml0bWFwcyA9IEZjb25zIChRbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93LCBWZnJp bmdlX2JpdG1hcHMpOworICBGcHV0IChRbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93LCBRZnJp bmdlLCBtYWtlX2ZpeG51bSAoMjQpKTsKKyAgLyogKGdldCAnKy12ZXJ0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oCisrKyBiL3NyYy9uc3Rlcm0uaApAQCAtNjYwLDYgKzY2MCwxNiBA QCB0eXBlZGVmIGlkIGluc3RhbmNldHlwZTsKIAogQGludGVyZmFjZSBFbWFjc1Njcm9sbGVyIDog TlNTY3JvbGxlcgogICB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKyAgICBOU1JlY3QgbWNfcmVjdGFuZ2xlOworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAgICBzdHJ1Y3Qgd2luZG93ICp3aW5kb3c7CiAgICBzdHJ1Y3QgZnJh bWUgKmZyYW1lOwogICAgTlNSZXNwb25kZXIgKnByZXZSZXNwb25kZXI7CkBAIC02ODAsNiArNjkw LDE4IEBAIHR5cGVkZWYgaWQgaW5zdGFuY2V0eXBlOwogICAgaW50IGVtX3dob2xlOwogICAgfQog CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCist ICh2b2lkKW1jX3NldF9yZWN0YW5nbGU6IChOU1JlY3QpcmVjdDsKKy0gKE5TUmVjdCltY19nZXRf cmVjdGFuZ2xlOworLSAoc3RydWN0IHdpbmRvdyAqKW1jX2dldF93aW5kb3c7CistIChib29sKW1j X2p1ZGdlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAtIChpbnN0YW5jZXR5cGUp IGluaXRGcmFtZTogKE5TUmVjdCApciB3aW5kb3c6IChMaXNwX09iamVjdCl3aW47CiAtICh2b2lk KXNld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jYWNoZV90eXBlLCB2bnRoLCBudGgpOworICAgICAgICAgICAr K250aCkKKyAgICAgICAgeworICAgICAgICAgIC8vICBpbnQgeCA9IHMtPnctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueDsKKyAgICAgICAgICBpbnQgZnggPSBz LT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZ4OworICAg ICAgICAgIC8vICBpbnQgeSA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF0ueTsKKyAgICAgICAgICBpbnQgZnkgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZ5OworICAgICAgICAgIGludCBocG9zID0gcy0+ dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5ocG9zOworICAg ICAgICAgIGludCB2cG9zID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS52cG9zOworICAgICAgICAgIGludCB3ZCA9IHMtPnctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ud2Q7CisgICAgICAgICAgaW50IGggPSBzLT53 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmg7CisgICAgICAg ICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IHMtPnctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vyc29yX3R5cGU7CisgICAgICAgICAgLy8g IGludCBjdXJzb3Jfd2lkdGggPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGh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vcjsKKyAgICAg ICAgICBib29sIGVuYWJsZWRfcCA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF0uZW5hYmxlZF9wOworICAgICAgICAgIGJvb2wgZ29fcCA9ICh2cG9zID09 IHZudGgKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA9PSBjdXJzb3JfZ2x5cGgtPmhw b3MKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKTsKKyAgICAgICAgICBpZiAo IWdvX3ApCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBOU1JlY3QgcjsKKyAgICAg ICAgICByLm9yaWdpbi54ID0gZng7CisgICAgICAgICAgci5vcmlnaW4ueSA9IGZ5OworICAgICAg ICAgIHIuc2l6ZS5oZWlnaHQgPSBoOworICAgICAgICAgIHIuc2l6ZS53aWR0aCA9IHdkOworICAg ICAgICAgIFtbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2xfZmcucmVkCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IGxzbF9mZy5ncmVlbgorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiBsc2xfZmcuYmx1ZQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdIHNldF07CisgICAg ICBpZiAoY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICAgICAgeworICAgICAgICAg IExpc3BfT2JqZWN0IGJ1ZiA9IHMtPnctPmNvbnRlbnRzOworICAgICAgICAgIENIRUNLX0JVRkZF UiAoYnVmKTsKKyAgICAgICAgICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAg ICAgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5zaWVudF9tYXJrX21v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19jb2xvcjsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgICAgIGVsc2UgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgJiYg YWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBvcyA9 PSByZWdpb25fZW5kKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZW51bSBmYWNl X2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2Ug KHMtPncsIHMtPmYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1hdC1yZWdpb24tcHJlLXp2 LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3Rp dmVfcmVnaW9uX2VuZF9mYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBob2xsb3dfYWN0aXZlX3Jl Z2lvbl9lbmRfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgTlNDb2xvciAqaG9sbG93X2FjdGl2 ZV9yZWdpb25fZW5kX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFD S0dST1VORCAoaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2UpLCBzLT5mKTsKKyAgICAgICAg ICAgICAgICBob2xsb3dfY29sb3IgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfY29sb3I7Cisg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZSBpZiAocmVnaW9uX2FjdGl2ZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBvcyA+IHJlZ2lvbl9iZWcKKyAgICAgICAgICAgICAgICAg ICAgICAgJiY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NlID0gRkFDRV9GUk9N X0lEIChzLT5mLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBO U0NvbG9yICpob2xsb3dfYWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5T X0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2FjdGl2ZV9mYWNlKSwgcy0+Zik7CisgICAgICAgICAg ICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVfY29sb3I7CisgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAgICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93 X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJu ICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAg ICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZB Q0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAg ICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19pbmFjdGl2ZV9jb2xvciA9IG5zX2xvb2t1cF9pbmRl eGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19pbmFjdGl2ZV9mYWNlKSwgcy0+ Zik7CisgICAgICAgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2luYWN0aXZl X2NvbG9yOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBp ZiAoZmFjZSAmJiBOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpID09IG5zX2luZGV4X2NvbG9yIChG UkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpLCBzLT5mKSkKKyAgICAgICAgICB7CisgICAgICAgICAg ICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSksIHMt PmYpIHNldF07CisgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBGUkFNRV9DVVJTT1JfQ09MT1Ig KHMtPmYpOworICAgICAgICAgIH0KKyAgICAgICAgICBzd2l0Y2ggKGN1cnNvcl90eXBlKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBjYXNlIE1DX05PX0ZSSU5HRV9CSVRNQVA6CisgICAg ICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgorICAg ICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX1JJR0hUX0ZSSU5HRV9C SVRNQVA6CisgICAgICAgICAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAgICAg ICAgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAo cik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfRlJBTUVE X0JPWDoKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgICAgICBb aG9sbG93X2NvbG9yIHNldF07CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJl Y3QgKHIsIDEsIDEpKTsKKyAgICAgICAgICAgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChzLT5m KSBzZXRdOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX0hP TExPV19CT1g6CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICAg ICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKE5TSW5z ZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgICAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAo cy0+Zikgc2V0XTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBN Q19IQkFSOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgICAg IGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX0JBUjoKKyAgICAgICAgICAgICAgICBOU1Jl Y3RGaWxsIChyKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgICAvKiBJZiBhIGdseXBoIGV4aXN0cyAocy0+Y2hhcjJiICE9IE5VTEwpLCB0aGVuIGRyYXcg dGhlIGdseXBoIG9uIHRvcCBvZiB0aGUKKyAgICAgICAgICBuZXdseSBkcmF3biByZWN0YW5nbGUg dGhhdCB3YXMgY3JlYXRlZCBoZXJlaW5hYm92ZS4gIFRvIHRoZSBleHRlbnQgdGhhdCB3ZQorICAg ICAgICAgIHdhbnQgdG8gZG91YmxlLWltcHJpbnQgZ2x5cGhzIHRvIG1ha2UgdGhlbSBhcHBlYXIg dG8gYmUgc2VtaS1ib2xkLCBpdCBjYW4KKyAgICAgICAgICBiZSBkb25lIGhlcmUgZm9yIGFsbCBj dXJzb3IgdHlwZXMuICBUaGUgYm94LXN0eWxlIGN1cnNvcnMgYXJlIGltcHJpbnRlZAorICAgICAg ICAgIHdpdGggZ2x5cGhzIG9ubHkgb25lICgxKSB0aW1lLiAgVGhlIHNlbWktYm9sZCBhcHBlYXJh bmNlIGlzIGhlbHBmdWwgd2hlbgorICAgICAgICAgIGRlYnVnZ2luZyB0byBzZWUgdGhhdCB0aGUg Y29vcmRpbmF0ZXMgYXJlIGNvcnJlY3QuICovCisgICAgICAgICAgaWYgKHMtPmNoYXIyYiAhPSBO VUxMCisgICAgICAgICAgICAgICYmIChjdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YCisgICAg ICAgICAgICAgICAgICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YCisgICAgICAgICAg ICAgICAgICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19IT0xMT1dfQk9YKSkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgQk9PTCBpc0NvbXBvc2l0ZSA9IHMtPmZpcnN0X2dseXBoLT50eXBlID09 IENPTVBPU0lURV9HTFlQSDsKKyAgICAgICAgICAgICAgaWYgKGlzQ29tcG9zaXRlKQorICAgICAg ICAgICAgICAgIG5zX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsK KyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgICAgIHN0cnVjdCBmb250ICpmb250ID0gcy0+ZmFjZS0+Zm9udDsKKyAgICAgICAgICAgICAg ICAgICAgaWYgKCFmb250KQorICAgICAgICAgICAgICAgICAgICAgIGZvbnQgPSBGUkFNRV9GT05U IChzLT5mKTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCB3aXRoX2JnX3AgPSBmYWxzZTsKKyAg ICAgICAgICAgICAgICAgICAgZm9udC0+ZHJpdmVyLT5kcmF3IChzLCBzLT5jbXBfZnJvbSwgcy0+ bmNoYXJzLCBzLT54LCBzLT55YmFzZSwgd2l0aF9iZ19wKTsKKyAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgLy8gIGNsb2NrX3QgY2xvY2tfZW5k ID0gY2xvY2soKTsKKyAgLy8gIGRvdWJsZSBjcHVfdGltZV91c2VkID0gKChkb3VibGUpIChjbG9j a19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8vIC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hPVyBUTyBQUklO VCBBIENPTE9SIFRPIFNUREVSUjoKKyAgICAgTGlzcF9PYmplY3QgZm9yZWdyb3VuZCA9IGZhY2Ut PmxmYWNlW0xGQUNFX0ZPUkVHUk9VTkRfSU5ERVhdOworICAgICBMaXNwX09iamVjdCBiYWNrZ3Jv dW5kID0gZmFjZS0+bGZhY2VbTEZBQ0VfQkFDS0dST1VORF9JTkRFWF07CisgICAgIGZwcmludGYg KHN0ZGVyciwgIlxuZm9yZWdyb3VuZCAoJXMpIHwgYmFja2dyb3VuZCAoJXMpXG4iLAorICAgICAg ICAgICAgICAgICAgICAgICghTklMUCAoZm9yZWdyb3VuZCkgPyBTU0RBVEEgKGZvcmVncm91bmQp IDogIk5JTFAiKSwKKyAgICAgICAgICAgICAgICAgICAgICAoIU5JTFAgKGJhY2tncm91bmQpID8g U1NEQVRBIChiYWNrZ3JvdW5kKSA6ICJOSUxQIikpOworICAtICBFWEFNUExFIE9GIEhPVyBUTyBD UkVBVEUgQSBDT0xPUiBXSVRIIFJHQi9MU0wgZmxvYXQgdmFsdWVzOgorICAgICBOU0NvbG9yICpt eV9jb2xvciA9IFtOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IDEuMAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IDEuMAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsdWU6IDEu MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxw aGE6IDEuMF07CisgIC0gIEFMVEVSTkFUSVZFIEVYQU1QTEU6CisgICAgIGVudW0gZmFjZV9pZCBk ZWJ1Z2dpbmdfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBpbnRlcm4g KCIrLWRlYnVnZ2luZy1mYWNlIiksIHRydWUpOworICAgICBzdHJ1Y3QgZmFjZSAqZGVidWdnaW5n X2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGRlYnVnZ2luZ19mYWNlX2lkKTsKKyAgICAgTlND b2xvciAqY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5E IChkZWJ1Z2dpbmdfZmFjZSksIHMtPmYpOworICAgICBbY29sb3Igc2V0XTsgKi8KKyAgaWYgKGds eXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBI TEVTUykKKyAgICBbW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogbHNsLnJlZAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVuOiBsc2wuZ3JlZW4KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgYmx1ZTogbHNsLmJsdWUKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBhbHBoYTogMS4wXSBzZXRdOworICAgIGVsc2UKKyAgICAgIFtGUkFNRV9DVVJT T1JfQ09MT1IgKGYpIHNldF07CisgIGlmIChjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YKQor ICAgIHsKKyAgICAgIExpc3BfT2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRzOworICAgICAgQ0hFQ0tf QlVGRkVSIChidWYpOworICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1Zik7Cisg ICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5zaWVudF9tYXJrX21vZGUp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWFya19h Y3RpdmUpKSk7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZyA9IChyZWdpb25fYWN0aXZlX3Ap ID8gbWNfcmVnaW9uX2xpbWl0ICgxKS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BiZWNhdXNlIHRo ZSBvdmVybGF5IHdpbmRvdyBwcm9wZXJ0eSBpcyB1c2VkLiAqLworICAgICAgICAgICAgICBlbHNl IGlmICghYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgZW51 bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0 cnVlKTsKKyAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFj ZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAg ICAgICAgICAgTlNDb2xvciAqaG9sbG93X2luYWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2luZGV4 ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2luYWN0aXZlX2ZhY2UpLCBmKTsK KyAgICAgICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19pbmFjdGl2ZV9jb2xvcjsK KyAgICAgICAgICAgICAgICB9CisgICAgfQorICAgIGVsc2UgaWYgKGZhY2UgJiYgTlNfRkFDRV9C QUNLR1JPVU5EIChmYWNlKSA9PSBuc19pbmRleF9jb2xvciAoRlJBTUVfQ1VSU09SX0NPTE9SIChm KSwgZikpCisgICAgICB7CisgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFD RV9GT1JFR1JPVU5EIChmYWNlKSwgZikgc2V0XTsKKyAgICAgICAgaG9sbG93X2NvbG9yID0gRlJB TUVfQ1VSU09SX0NPTE9SIChmKTsKKyAgICAgIH0KKyNpZmRlZiBOU19JTVBMX0NPQ09BCisgIE5T RGlzYWJsZVNjcmVlblVwZGF0ZXMgKCk7CisjZW5kaWYKKyAgc3dpdGNoIChjdXJzb3JfdHlwZSkK KyAgICB7CisgICAgICBjYXNlIE1DX05PX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGJyZWFrOwor ICAgICAgY2FzZSBNQ19OT19DVVJTT1I6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19S SUdIVF9GUklOR0VfQklUTUFQOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfTEVGVF9G UklOR0VfQklUTUFQOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoK KyAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19G UkFNRURfQk9YOgorICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgW2hvbGxvd19jb2xv ciBzZXRdOworICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAg ICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworICAgICAgICBicmVhazsKKyAgICAg IGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIFto b2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEs IDEpKTsKKyAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAoZikgc2V0XTsKKyAgICAgICAgYnJl YWs7CisgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAg ICBicmVhazsKKyAgICAgIGNhc2UgTUNfQkFSOgorICAgICAgICBzID0gcjsKKyAgICAgICAgLyog QGxhd2xpc3QgaXMgZm9jdXNpbmcgdGhlIGluaXRpYWwgZGV2ZWxvcG1lbnQgb2YgZmVhdHVyZSBy ZXF1ZXN0cworICAgICAgICAjMTc2ODQgYW5kICMyMjg3MyBvbiBMMlIgbGFuZ3VhZ2VzLiAqLwor ICAgICAgICBpZiAoZ2x5cGhfZmxhdm9yICE9IE1DX0dMWVBICisgICAgICAgICAgICAmJiBnbHlw aF9mbGF2b3IgIT0gTUNfR0xZUEhMRVNTKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIElm IHRoZSBjaGFyYWN0ZXIgdW5kZXIgY3Vyc29yIGlzIFIyTCwgZHJhdyB0aGUgYmFyIGN1cnNvcgor ICAgICAgICAgICAgICAgb24gdGhlIHJpZ2h0IG9mIGl0cyBnbHlwaCwgcmF0aGVyIHRoYW4gb24g dGhlIGxlZnQuICovCisgICAgICAgICAgICBpZiAoKGN1cnNvcl9nbHlwaC0+cmVzb2x2ZWRfbGV2 ZWwgJiAxKSAhPSAwKQorICAgICAgICAgICAgICBzLm9yaWdpbi54ICs9IGN1cnNvcl9nbHlwaC0+ cGl4ZWxfd2lkdGggLSBzLnNpemUud2lkdGg7CisgICAgICAgICAgfQorICAgICAgICBOU1JlY3RG aWxsIChzKTsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICBuc19yZXNldF9jbGlwcGluZyAoZik7 CisgIC8qIGRyYXcgdGhlIGNoYXJhY3RlciB1bmRlciB0aGUgY3Vyc29yICovCisgIGlmIChnbHlw aF9mbGF2b3IgIT0gTUNfR0xZUEhMRVNTCisgICAgICAmJiAoY3Vyc29yX3R5cGUgPT0gTUNfRlJB TUVEX0JPWAorICAgICAgICAgIHx8IGN1cnNvcl90eXBlID09IE1DX0ZJTExFRF9CT1gKKyAgICAg ICAgICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgfHwgKGRlYnVn X3AKKyAgICAgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfSEJBUikKKyAgICAgICAgICB8 fCAoZGVidWdfcAorICAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19CQVIpKSkKKyAg ICB7CisgICAgIC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vdWdoIG9uIGdseXBoIHN0 cmluZyBzLgorICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KK3sKKyAgaWYgKHMtPmZvcl9vdmVybGFw cykKKyAgICByZXR1cm47CisgIC8qIERvIHVuZGVybGluZS4gKi8KKyAgaWYgKGZhY2UtPnVuZGVy bGluZV9wKQorICAgIHsKKyAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNF X1VOREVSX1dBVkUpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoZmFjZS0+dW5kZXJsaW5lX2Rl ZmF1bHRlZF9wKQorICAgICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChmYWNlLT51bmRlcmxp bmVfY29sb3IsIHMtPmYpIHNldF07CisgICAgICAgICAgbnNfZHJhd191bmRlcndhdmUgKHMsIHdp ZHRoLCB4KTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChzLT5mYWNlLT51bmRlcmxpbmVf dHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgeworICAgICAgICAgICAgTlNSZWN0 IHI7CisgICAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CisgICAg ICAgICAgICAvKiBJZiB0aGUgcHJldiB3YXMgdW5kZXJsaW5lZCwgbWF0Y2ggaXRzIGFwcGVhcmFu Y2UuICovCisgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxp bmVfcAorICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV90eXBlID09 IEZBQ0VfVU5ERVJfTElORQorICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPnVuZGVybGluZV90 aGlja25lc3MgPiAwKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdGhpY2tuZXNz ID0gcy0+cHJldi0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICBwb3NpdGlv biA9IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgc3RydWN0 IGZvbnQgKmZvbnQ7CisgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIGRlc2NlbnQ7Cisg ICAgICAgICAgICAgICAgICBmb250PXMtPmZvbnQ7CisgICAgICAgICAgICAgICAgICBkZXNjZW50 ID0gcy0+eSArIHMtPmhlaWdodCAtIHMtPnliYXNlOworICAgICAgICAgICAgICAgICAgLyogVXNl IHVuZGVybGluZSB0aGlja25lc3Mgb2YgZm9udCwgZGVmYXVsdGluZyB0byAxLiAqLworICAgICAg ICAgICAgICAgICAgdGhpY2tuZXNzID0gKGZvbnQgJiYgZm9udC0+dW5kZXJsaW5lX3RoaWNrbmVz cyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZvbnQtPnVuZGVybGluZV90 aGlja25lc3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMTsKKyAgICAgICAgICAg ICAgICAgIC8qIERldGVybWluZSB0aGUgb2Zmc2V0IG9mIHVuZGVybGluaW5nIGZyb20gdGhlIGJh c2VsaW5lLiAqLworICAgICAgICAgICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRf bGluZSkKKyAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNjZW50IC0gdGhpY2tuZXNz OworICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25f cHJvcGVydGllcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBmb250ICYmIGZvbnQt PnVuZGVybGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9u ID0gZm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgICAgICAgIGVsc2Ug aWYgKGZvbnQpCisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGxyb3VuZCAoZm9u dC0+ZGVzY2VudCAvIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHVuZGVybGluZV9taW5pbXVtX29mZnNldDsKKyAg ICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbWF4IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmlt dW1fb2Zmc2V0KTsKKyAgICAgICAgICAgICAgICAgIC8qIEVuc3VyZSB1bmRlcmxpbmluZyBpcyBu b3QgY3JvcHBlZC4gKi8KKyAgICAgICAgICAgICAgICAgIGlmIChkZXNjZW50IDw9IHBvc2l0aW9u KQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24g PSBkZXNjZW50IC0gMTsKKyAgICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAg ICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGRlc2NlbnQg PCBwb3NpdGlvbiArIHRoaWNrbmVzcykKKyAgICAgICAgICAgICAgICAgICAgICB0aGlja25lc3Mg PSAxOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHMtPnVuZGVybGluZV90aGlja25l c3MgPSB0aGlja25lc3M7CisgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPSBwb3Np dGlvbjsKKyAgICAgICAgICAgIHIgPSBOU01ha2VSZWN0ICh4LCBzLT55YmFzZSArIHBv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+Zikt Pm1vdXNlX2ZhY2VfZmFjZV9pZCk7CisgICAgICAgICAgaWYgKCFmYWNlKQorICAgICAgICAgICAg ZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgTU9VU0VfRkFDRV9JRCk7CisgICAgICAgIH0KKyAg ICAgICAgZWxzZQorICAgICAgICAgZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+Ziwgcy0+Zmlyc3Rf Z2x5cGgtPmZhY2VfaWQpOworICAgICAgYmdDb2wgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAo TlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSwgcy0+Zik7CisgICAgICBmZ0NvbCA9IG5zX2xvb2t1 cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICAg IGZvciAoaSA9IDA7IGkgPCBuOyArK2kpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoIXMtPnJv dy0+ZnVsbF93aWR0aF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpbnQgb3ZlcnJ1 biwgbGVmdG92ZXJydW47CisgICAgICAgICAgICAgIC8qIHRydW5jYXRlIHRvIGF2b2lkIG92ZXJ3 cml0aW5nIGZyaW5nZSBhbmQvb3Igc2Nyb2xsYmFyICovCisgICAgICAgICAgICAgIG92ZXJydW4g PSBtYXggKDAsIChzLT54ICsgcy0+YmFja2dyb3VuZF93aWR0aCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIC0gKFdJTkRPV19CT1hfUklHSFRfRURHRV9YIChzLT53KQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgLSBXSU5ET1dfUklHSFRfRlJJTkdFX1dJRFRIIChzLT53 KSkpOworICAgICAgICAgICAgICAgICAgICByW2ldLnNpemUud2lkdGggLT0gb3ZlcnJ1bjsKKyAg ICAgICAgICAgICAgLyogdHJ1bmNhdGUgdG8gYXZvaWQgb3ZlcndyaXRpbmcgdG8gbGVmdCBvZiB0 aGUgd2luZG93IGJveCAqLworICAgICAgICAgICAgICBsZWZ0b3ZlcnJ1biA9IChXSU5ET1dfQk9Y X0xFRlRfRURHRV9YIChzLT53KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIFdJTkRP V19MRUZUX0ZSSU5HRV9XSURUSCAocy0+dykpIC0gcy0+eDsKKyAgICAgICAgICAgICAgaWYgKGxl ZnRvdmVycnVuID4gMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICByW2ld Lm9yaWdpbi54ICs9IGxlZnRvdmVycnVuOworICAgICAgICAgICAgICAgICAgcltpXS5zaXplLndp ZHRoIC09IGxlZnRvdmVycnVuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyog WFhYOiBUcnkgdG8gd29yayBiZXR3ZWVuIHByb2JsZW0gd2hlcmUgYSBzdHJldGNoIGdseXBoIG9u CisgICAgICAgICAgICAgICAgIGEgcGFydGlhbGx5LXZpc2libGUgYm90dG9tIHJvdyB3aWxsIGNs ZWFyIHBhcnQgb2YgdGhlCisgICAgICAgICAgICAgICAgIG1vZGVsaW5lLCBhbmQgYW5vdGhlciB3 aGVyZSBsaXN0LWJ1ZmZlcnMgaGVhZGVycyBhbmQgc2ltaWxhcgorICAgICAgICAgICAgICAgICBy b3dzIGVycm9uZW91c2x5IGhhdmUgdmlzaWJsZV9oZWlnaHQgc2V0IHRvIDAuICBOb3Qgc3VyZQor ICAgICAgICAgICAgICAgICB3aGVyZSB0aGlzIGlzIGNvbWluZyBmcm9tIGFzIG90aGVyIHRlcm1z IHNlZW0gbm90IHRvIHNob3cuICovCisgICAgICAgICAgICAgIHJbaV0uc2l6ZS5oZWlnaHQgPSBt aW4gKHMtPmhlaWdodCwgcy0+cm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgICAgICB9Cisg ICAgICAgICAgW2JnQ29sIHNldF07CisgICAgICAgICAgLyogTk9URTogdW5kZXIgTlMg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gICAgLy8gIFtjb2xvciBzZXRdOworICAgICAgICAgICAgICBD R0Zsb2F0IHggPSByW2ldLm9yaWdpbi54OworICAgICAgICAgICAgICBDR0Zsb2F0IHdpZHRoID0g d2Q7CisgICAgICAgICAgICAgIHJbaV0uc2l6ZS53aWR0aCAtPSB3aWR0aDsKKyAgICAgICAgICAg ICAgcltpXS5vcmlnaW4ueCArPSB3aWR0aDsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocltp XSk7CisgICAgICAgICAgICAgIC8qIERyYXcgb3ZlcmxpbmluZywgZXRjLiBvbiB0aGUgY3Vyc29y LiAqLworICAgICAgICAgICAgICBpZiAocy0+dy0+cGh5c19jdXJzb3JfdHlwZSA9PSBNQ19GSUxM RURfQk9YKQorICAgICAgICAgICAgICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBm YWNlLCBiZ0NvbCwgd2lkdGgsIHgpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCBmZ0NvbCwgd2lkdGgs IHgpOworICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgLy8g IGludCByeCA9IHJbaV0ub3JpZ2luLng7CisgIC8vICBpbnQgcnkgPSByW2ldLm9yaWdpbi55Owor ICAvLyAgaW50IHJ3ID0gcltpXS5zaXplLndpZHRoOworICAvLyAgaW50IHJoID0gcltpXS5zaXpl LmhlaWdodDsKKyAgLy8gIGZwcmludGYgKHN0ZGVyciwgIm1jX25zX2R1bXBnbHlwaHNfc3RyZXRj aDogIHZwb3MgKCVkKSB8IHJ4ICglZCkgfCByeSAoJWQpIHwgcncgKCVkKSB8IHJoICglZClcbiIs CisgIC8vICAgICAgICAgICAgICAgICAgIHMtPmZpcnN0X2dseXBoLT52cG9zLCByeCwgcnksIHJ3 LCByaCk7CisgICAgICAgICAgICAgIE5TUmVj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WR0aCAhPSBzLT5iYWNrZ3JvdW5k X3dpZHRoKQorICAgIHsKKyAgICAgIGJyID0gTlNNYWtlUmVjdCAoYmdfeCwgYmdfeSwgcy0+YmFj a2dyb3VuZF93aWR0aCwgYmdfaGVpZ2h0KTsKKyAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3Ag PSAxOworICAgIH0KKyAgICBlbHNlCisgICAgICBiciA9IE5TTWFrZVJlY3QgKHgsIHksIHMtPnNs aWNlLndpZHRoLCBzLT5zbGljZS5oZWlnaHQpOworICBOU1JlY3RGaWxsIChicik7CisgIC8qIERy YXcgdGhlIGltYWdlLi4gZG8gd2UgbmVlZCB0byBkcmF3IHBsYWNlaG9sZGVyIGlmIGltZyA9PW5p bD8gKi8KKyAgaWYgKGltZyAhPSBuaWwpCisgICAgeworI2lmZGVmIE5TX0lNUExfQ09DT0EKKyAg ICAgIE5TUmVjdCBkciA9IE5TTWFrZVJlY3QgKHgsIHksIHMtPnNsaWNlLndpZHRoLCBzLT5zbGlj ZS5oZWlnaHQpOworICAgICAgTlNSZWN0IGlyID0gTlNNYWtlUmVjdCAocy0+c2xpY2UueCwgcy0+ c2xpY2UueSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLndpZHRoLCBz LT5zbGljZS5oZWlnaHQpOworICAgICAgW2ltZyBkcmF3SW5SZWN0OiBkcgorICAgICAgICAgICAg IGZyb21SZWN0OiBpcgorICAgICAgICAgICAgIG9wZXJhdGlvbjogTlNDb21wb3NpdGVTb3VyY2VP dmVyCisgICAgICAgICAgICAgIGZyYWN0aW9uOiAxLjAKKyAgICAgICAgICAgcmVzcGVjdEZsaXBw ZWQ6IFlFUworICAgICAgICAgICAgICAgIGhpbnRzOiBuaWxdOworI2Vsc2UKKyAgICAgIFtpbWcg Y29tcG9zaXRlVG9Qb2ludDogTlNNYWtlUG9pbnQgKHgsIHkgKyBzLT5zbGljZS5oZWlnaHQpCisg ICAgICAgICAgICAgICAgICBvcG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sIGJy Lm9yaWdpbi54KTsKKyAgLyogRHJhdyByZWxpZWYsIGlmIHJlcXVlc3RlZCAqLworICBpZiAocy0+ aW1nLT5yZWxpZWYgfHwgcy0+aGwgPT1EUkFXX0lNQUdFX1JBSVNFRCB8fCBzLT5obCA9PURSQVdf SU1BR0VfU1VOS0VOKQorICAgIHsKKyAgICAgIGlmIChzLT5obCA9PSBEUkFXX0lNQUdFX1NVTktF TiB8fCBzLT5obCA9PSBEUkFXX0lNQUdFX1JBSVNFRCkKKyAgICAgICAgeworICAgICAgICAgIHRo ID0gdG9vbF9iYXJfYnV0dG9uX3JlbGllZiA+PSAwID8KKyAgICAgICAgICAgIHRvb2xfYmFyX2J1 dHRvbl9yZWxpZWYgOiBERUZBVUxUX1RPT0xfQkFSX0JVVFRPTl9SRUxJRUY7CisgICAgICAgICAg cmFpc2VkX3AgPSAocy0+aGwgPT0gRFJBV19JTUFHRV9SQUlTRUQpOworICAgICAgICB9CisgICAg ICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICB0aCA9IGFicyAocy0+aW1nLT5yZWxp ZWYpOworICAgICAgICAgICAgcmFpc2VkX3AgPSAocy0+aW1nLT5yZWxpZWYgPiAwKTsKKyAgICAg ICAgICB9CisgICAgICByLm9yaWdpbi54ID0geCAtIHRoOworICAgICAgci5vcmlnaW4ueSA9IHkg LSB0aDsKKyAgICAgIHIuc2l6ZS53aWR0aCA9IHMtPnNsaWNlLndpZHRoICsgMip0aC0xOworICAg ICAgci5zaXplLmhlaWdodCA9IHMtPnNsaWNlLmhlaWdodCArIDIqdGgtMTsKKyAgICAgIG5zX2Ry YXdfcmVsaWVmIChyLCB0aCwgcmFpc2VkX3AsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xp Y2UueSA9PSAwLAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnkgKyBzLT5zbGljZS5o ZWlnaHQgPT0gcy0+aW1nLT5oZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2Uu eCA9PSAwLAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnggKyBzLT5zbGljZS53aWR0 aCA9PSBzLT5pbWctPndpZHRoLCBzKTsKKyAgICB9CisgIC8qIElmIHRoZXJlIGlzIG5vIG1hc2ss IHRoZSBiYWNrZ3JvdW5kIHdvbid0IGJlIHNlZW4sCisgICAgIHNvIGRyYXcgYSByZWN0YW5nbGUg b24gdGhlIGltYWdlIGZvciB0aGUgY3Vyc29yLgorICAgICBEbyB0aGlzIGZvciBhbGwgaW1hZ2Vz LCBnZXR0aW5nIHRyYW5zcGFyZW5jeSByaWdodCBpcyBub3QgcmVsaWFibGUuICovCisgIGlmIChz LT5obCA9PSBEUkFXX0NVUlNPUikKKyAgICB7CisgICAgICBpbnQgdGhpY2tuZXNzID0gYWJzIChz LT5pbWctPnJlbGllZik7CisgICAgICBpZiAodGhpY2tuZXNzID09IDApIHRoaWNrbmVzcyA9IDE7 CisgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgICB8fCBnbHlwaF9mbGF2 b3IgPT0gTUNfR0xZUEhMRVNTKQorICAgICAgeworICAgICAgICBOU0NvbG9yICpib3JkZXJfY29s b3IgPSBbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2wucmVkCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IGxz bC5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBibHVlOiBsc2wuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdOworICAgICAgICBuc19kcmF3 X2JveCAoYnIsIHRoaWNrbmVzcywgYm9yZGVyX2NvbG9yLCAxLCAxKTsKKyAgICAgIH0KKyAgICAg IGVsc2UKKyAgICAgICAgbnNfZHJhd19ib3ggKGJyLCB0aGlja25lc3MsIEZSQU1FX0NVUlNPUl9D T0xPUiAocy0+ZiksIDEsIDEpOworICAgIH0KK30KKworc3RhdGljIHZvaWQKK21jX25zX21heWJl X2R1bXBnbHlwaHNfYmFja2dyb3VuZCAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgY2hhciBmb3Jj ZV9wKQoreworICBOU1RSQUNFICgibWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIik7 CisgIGlmICghcy0+YmFja2dyb3VuZF9maWxsZWRfcC8qIHx8IHMtPmhsID09IERSQVdfTU9VU0Vf RkFDRSovKQorICAgIHsKKyAgICAgIGludCBib3hfbGluZV93aWR0aCA9IG1heCAocy0+ZmFjZS0+ Ym94X2xpbmVfd2lkdGgsIDApOworICAgICAgaWYgKEZPTlRfSEVJR0hUIChzLT5mb250KSA8IHMt PmhlaWdodCAtIDIgKiBib3hfbGluZV93aWR0aAorICAgICAgICAgIC8qIFdoZW4geGRpc3AuYyBp Z25vcmVzIEZPTlRfSEVJR0hULCB3ZSBjYW5ub3QgdHJ1c3QgZm9udAorICAgICAgICAgICAgIGRp bWVuc2lvbnMsIHNpbmNlIHRoZSBhY3R1YWwgZ2x5cGhzIG1pZ2h0IGJlIG11Y2gKKyAgICAgICAg ICAgICBzbWFsbGVyLiAgU28gaW4gdGhhdCBjYXNlIHdlIGFsd2F5cyBjbGVhciB0aGUgcmVjdGFu Z2xlCisgICAgICAgICAgICAgd2l0aCBiYWNrZ3JvdW5kIGNvbG9yLiAqLworICAgICAgICAgIHx8 IEZPTlRfVE9PX0hJR0ggKHMtPmZvbnQpCisgICAgICAgICAgfHwgcy0+Zm9udF9ub3RfZm91bmRf cCB8fCBzLT5leHRlbmRzX3RvX2VuZF9vZl9saW5lX3AgfHwgZm9yY2VfcCkKKyAgICAgICAgewor ICAgICAgICAgIHN0cnVjdCBmYWNlICpmYWNlOworICAgICAgICAgIGlmIChzLT5obCA9PSBEUkFX X01PVVNFX0ZBQ0UpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZS T01fSUQgKHMtPmYsIE1PVVNFX0hMX0lORk8gKHMtPmYpLT5tb3VzZV9mYWNlX2ZhY2VfaWQpOwor ICAgICAgICAgICAgICBpZiAoIWZhY2UpCisgICAgICAgICAgICAgICAgZmFjZSA9IEZBQ0VfRlJP TV9JRCAocy0+ZiwgTU9VU0VfRkFDRV9JRCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIHMtPmZpcnN0X2ds eXBoLT5mYWNlX2lkKTsKKyAgICAgICAgICBpZiAoIWZhY2UtPnN0aXBwbGUpCisgICAgICAgICAg ICBbKE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSkgIT0gMAorICAgICAgICAgICAgICA/IG5zX2xv b2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKQorICAg ICAgICAgICAgICA6IEZSQU1FX0JBQ0tHUk9VTkRfQ09MT1IgKHMtPmYpKSBzZXRdOworICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RydWN0IG5zX2Rp c3BsYXlfaW5mbyAqZHB5aW5mbyA9IEZSQU1FX0RJU1BMQVlfSU5GTyAocy0+Zik7CisgICAgICAg ICAgICAgICAgW1tkcHlpbmZvLT5iaXRtYXBzW2ZhY2UtPnN0aXBwbGUtMV0uaW1nIHN0aXBwbGVN YXNrXSBzZXRdOworICAgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKHMtPmhsICE9IERSQVdf Q1VSU09SKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzLT5yZWN0YW5nbGVfbnVrZWRf cCA9IHRydWU7CisgICAgICAgICAgICAgIE5TUmVjdCByID0gTlNNYWtlUmVjdCAocy0+eCwgcy0+ eSArIGJveF9saW5lX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg cy0+YmFja2dyb3VuZF93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHMtPmhlaWdodC0yKmJveF9saW5lX3dpZHRoKTsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAo cik7CisgICAgICAgICAgICB9CisgICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7 CisgICAgICAgIH0KKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkCittY19uc19kcmF3X2dseXBoX3N0 cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4 LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0 IG1jX1JHQiBsc2wsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwKKyAgICAgICAgICAgICAg ICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLAorICAgICAgICAgICAg ICAgICAgICAgICAgIGludCB3ZCwgYm9vbCBhY3RpdmVfcCwgYm9vbCBjdXJzb3JfZ2NfcCkKKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICBFeHRlcm5hbCAoUklGKTogTWFpbiBkcmF3LXRleHQg Y2FsbC4KKyAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCit7CisgIC8qIFRPRE8gKG9wdGltaXplKTog Zm9jdXMgZm9yIGJveCBhbmQgY29udGVudHMgZHJhdyAqLworICBOU1JlY3QgclsyXTsKKyAgaW50 IG4sIGZsYWdzOworICBjaGFyIGJveF9kcmF3bl9wID0gMDsKKyAgc3RydWN0IGZvbnQgKmZvbnQg PSBzLT5mYWNlLT5mb250OworICBpZiAoIWZvbnQpCisgICAgZm9udCA9IEZSQU1FX0ZPTlQgKHMt PmYpOworICBOU1RSQUNFX1dIRU4gKE5TVFJBQ0VfR1JPVVBfR0xZUEhTLCAibWNfbnNfZHJhd19n bHlwaF9zdHJpbmciKTsKKyAgaWYgKHMtPm5leHQgJiYgcy0+cmlnaHRfb3ZlcmhhbmcgJiYgIXMt PmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICBpbnQgd2lkdGg7CisgICAgICBzdHJ1Y3QgZ2x5 cGhfc3RyaW5nICpuZXh0OworICAgICAgZm9yICh3aWR0aCA9IDAsIG5leHQgPSBzLT5uZXh0Owor ICAgICAgICAgICBuZXh0ICYmIHdpZHRoIDwgcy0+cmlnaHRfb3Zlcmhhbmc7CisgICAgICAgICAg IHdpZHRoICs9IG5leHQtPndpZHRoLCBuZXh0ID0gbmV4dC0+bmV4dCkKKyAgICAgICAgaWYgKG5l eHQtPmZpcnN0X2dseXBoLT50eXBlICE9IElNQUdFX0dMWVBIKQorICAgICAgICAgIHsKKyAgICAg ICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBTVFJFVENIX0dMWVBIKQorICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xp cF9yZWN0IChzLT5uZXh0LCByKTsKKyAgICAgICAgICAgICAgICBpZiAoIW5zX2NsaXBfdG9fcmVj dCAocy0+ZiwgciwgbikpCisgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAg ICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLT5uZXh0LCAxKTsKKyAgICAg ICAgICAgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgbWNfbnNfZHVtcGdseXBoc19zdHJldGNoIChz LT5uZXh0LCBtYXRyaXgsIHJvdywgd2QpOworICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0g MDsKKyAgICAgICAgICB9CisgICAgfQorICBpZiAoIXMtPmZvcl9vdmVybGFwcyAmJiBzLT5mYWNl LT5ib3ggIT0gRkFDRV9OT19CT1gKKyAgICAgICYmIChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBD SEFSX0dMWVBICisgICAgICAgICAgfHwgcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRF X0dMWVBIKSkKKyAgICB7CisgICAgICBuID0gbnNfZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3Qg KHMsIHIpOworICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQorICAgICAg ICByZXR1cm47CisgICAgICBtY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQgKHMsIDEp OworICAgICAgbnNfZHVtcGdseXBoc19ib3hfb3JfcmVsaWVmIChzKTsKKyAgICAgIG5zX3Jlc2V0 X2NsaXBwaW5nIChzLT5mKTsKKyAgICAgIGJveF9kcmF3bl9wID0gMTsKKyAgICB9CisgIHN3aXRj aCAocy0+Zmlyc3RfZ2x5cGgtPnR5cGUpCisgICAgeworICAgIGNhc2UgSU1BR0VfR0xZUEg6Cisg ICAgICBuID0gbnNfZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIpOworICAgICAgaWYg KCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQorICAgICAgICByZXR1cm47CisgICAgICBt Y19uc19kdW1wZ2x5cGhzX2ltYWdlIChzLCByWzBdLCBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29y X3R5cGUsIGFj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gICBpZiAocy0+aGwg PT0gRFJBV19DVVJTT1IgJiYgY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVEX0JPWCkKKyAgICAgICAg eworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdG1wID0gTlNfRkFDRV9CQUNLR1JPVU5EIChzLT5m YWNlKTsKKyAgICAgICAgICBOU19GQUNFX0JBQ0tHUk9VTkQgKHMtPmZhY2UpID0gTlNfRkFDRV9G T1JFR1JPVU5EIChzLT5mYWNlKTsKKyAgICAgICAgICBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZh Y2UpID0gdG1wOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfQ1VS U09SCisgICAgICAgICAgICAgICAgICYmIGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gKKyAg ICAgICAgICAgICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgICAgeworICAgICAgICAgICAgZW51 bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53 LCBzLT5mLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7 CisgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9N X0lEIChzLT5mLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgTlNfRkFDRV9G T1JFR1JPVU5EIChzLT5mYWNlKSA9IE5TX0ZBQ0VfRk9SRUdST1VORCAoaG9sbG93X2FjdGl2ZV9m YWNlKTsKKyAgICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19DVVJT T1IKKyAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YCisg ICAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIGVudW0gZmFjZV9pZCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9m YWNlIChzLT53LCBzLT5mLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtcHJl LXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5h Y3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQp OworICAgICAgICAgICAgICBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpID0gTlNfRkFDRV9G T1JFR1JPVU5EIChob2xsb3dfaW5hY3RpdmVfZmFjZSk7CisgICAgICAgICAgICB9CisgICAgICB7 CisgICAgICAgIEJPT0wgaXNDb21wb3NpdGUgPSBzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01Q T1NJVEVfR0xZUEg7CisgICAgICAgIGlmIChpc0NvbXBvc2l0ZSkKKyAgICAgICAgICBuc19kcmF3 X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBib29sIHdpdGhfYmdfcCA9ICgoZmxhZ3MgPT0g TlNfRFVNUEdMWVBIX05PUk1BTCAmJiAhcy0+YmFja2dyb3VuZF9maWxsZWRfcCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgfHwgZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX01PVVNFRkFD RSk7CisgICAgICAgICAgICAgIGlmICh3aXRoX2JnX3ApCisgICAgICAgICAgICAgICAgcy0+YmFj a2dyb3VuZF9udWtlZF9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgZm9udC0+ZHJpdmVyLT5kcmF3 IChzLCBzLT5jbXBfZnJvbSwgcy0+bmNoYXJzLCBzLT54LCBzLT55YmFzZSwgd2l0aF9iZ19wKTsK KyAgICAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIHsKKyAgICAgICAgTlNDb2xvciAqY29sID0g KE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgIT0gMAorICAgICAgICAgICAgICAgICAgICAg ICAgPyBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNl KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMt PmYpCisgICAgICAgICAgICAgICAgICAgICAgICA6IEZSQU1FX0ZPUkVHUk9VTkRfQ09MT1IgKHMt PmYpKTsKKyAgICAgICAgW2NvbCBzZXRdOworICAgICAgICAvKiBEcmF3IHVuZGVybGluZSwgb3Zl cmxpbmUsIHN0cmlrZS10aHJvdWdoLiAqLworICAgICAgICBtY19uc19kcmF3X3RleHRfZGVjb3Jh dGlvbiAocywgcy0+ZmFjZSwgY29sLCBzLT53aWR0aCwgcy0+eCk7CisgICAgICB9CisgICAgICB7 CisgICAgICAgIGlmIChzLT5maXJzdF9nbHlwaC0+dHlwZSAhPSBDT01QT1NJVEVfR0xZUEgKKyAg ICAgICAgICAgICYmIChzLT5sZWZ0X292ZXJ3cml0dGVuX3AgfHwgcy0+cmlnaHRfb3ZlcndyaXR0 ZW5fcCkKKyAgICAgICAgICAgICYmIChzLT5iYWNrZ3JvdW5kX251a2VkX3AgfHwgcy0+cmVjdGFu Z2xlX251a2VkX3ApCisgICAgICAgICAgICAmJiAocy0+YWN0aW9uX3R5cGUgPT0gTUNfRFJBV19H TFlQSF9TVFJJTkd8fCBzLT5hY3Rpb25fdHlwZSA9PSBNQ19FUkFTRV9HTFlQSF9TVFJJTkcpKQor ICAgICAgICAgIG1jX25zX2RyYXdfb3ZlcndyaXR0ZW4gKHMsIG1hdHJpeCwgcm93LCBzLT5maXJz dF9nbHlwaCk7CisgICAgICB9CisgICAgICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IKKyAgICAg ICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YKQorICAgICAgICB7CisgICAgICAg ICAgdW5zaWduZWQgbG9uZyB0bXAgPSBOU19GQUNFX0JBQ0tHUk9VTkQgKHMtPmZhY2UpOworICAg ICAgICAgIE5TX0ZBQ0VfQkFDS0dST1VORCAocy0+ZmFjZSkgPSBOU19GQUNFX0ZPUkVHUk9VTkQg KHMtPmZhY2UpOworICAgICAgICAgIE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgPSB0bXA7 CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IKKyAgICAg ICAgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICAgICAgICBO U19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpID0gc2F2ZWRfZmc7CisgICAgICBuc19yZXNldF9j bGlwcGluZyAocy0+Zik7CisgICAgICBicmVhazsKKyAgICBjYXNlIEdMWVBITEVTU19HTFlQSDoK KyAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBp ZiAoIW5zX2NsaXBfdG9fcmVjdCAocy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAg IGlmIChzLT5mb3Jfb3ZlcmxhcHMgfHwgKHMtPmNtcF9mcm9tID4gMAorICAgICAgICAgICAgJiYg ISBzLT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0b21hdGljKSkKKyAgICAgICAgcy0+YmFja2dyb3Vu ZF9maWxsZWRfcCA9IDE7CisgICAgICBlbHNlCisgICAgICAgIG1jX25zX21heWJlX2R1bXBnbHlw aHNfYmFja2dyb3VuZCAocywgcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBI KTsKKyAgICAgIC8qIC4uLiAqLworICAgICAgLyogTm90IHlldCBpbXBsZW1lbnRlZC4gKi8KKyAg ICAgIC8qIC4uLiAqLworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgYnJl YWs7CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICAgIH0KKyAgLyogRHJh dyBib3ggaWYgbm90IGRvbmUgYWxyZWFkeS4gKi8KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMgJiYg IWJveF9kcmF3bl9wICYmIHMtPmZhY2UtPmJveCAhPSBGQUNFX05PX0JPWCkKKyAgICB7CisgICAg ICBuID0gbnNfZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIpOworICAgICAgaWYgKCFu c19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQorICAgICAgICByZXR1cm47CisgICAgICBuc19k dW1wZ2x5cGhzX2JveF9vcl9yZWxpZWYgKHMpOworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMt PmYpOworICAgIH0KKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyogZW5kIE1VTFRJUExFLUNV UlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qID09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09CiAKICAgIE5TVFJBQ0UsIFRyYWNlIHN1cHBvcnQuCkBAIC0xMTA5LDYgKzIwODIsMTYgQEAg c3RhdGljIE5TUmVjdCBjb25zdHJhaW5fZnJhbWVfcmVjdChOU1JlY3QgZnJhbWVSZWN0LCBib29s IGlzRnVsbHNjcmVlbikKICAgIGV4dGVybmFsIChSSUYpIGNhbGw7IHdob2xlIGZyYW1lLCBjYWxs ZWQgYmVmb3JlIHVwZGF0ZV93aW5kb3dfYmVnaW4KICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCiB7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBmOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAjaWZkZWYgTlNfSU1QTF9DT0NPQQogICBFbWFjc1ZpZXcgKnZpZXcgPSBGUkFNRV9OU19W SUVXIChmKTsKIApAQCAtMTIwOSw2ICsyMTkyLDE2IEBAIHN0YXRpYyBOU1JlY3QgY29uc3RyYWlu X2ZyYW1lX3JlY3QoTlNSZWN0IGZyYW1lUmVjdCwgYm9vbCBpc0Z1bGxzY3JlZW4pCiAKIC8qICAg aWYgKGYgPT0gTU9VU0VfSExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfbW91c2VfZnJhbWUpICovCiAg IE1PVVNFX0hMX0lORk8gKGYpLT5tb3VzZV9mYWNlX2RlZmVyID0gMDsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGlu Z19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIH0KIAogCkBA IC00ODAzLDYgKzU3OTYsMTcgQEAgaW4gY2VydGFpbiBzaXR1YXRpb25zIChyYXBpZCBpbmNvbWlu ZyBldmVudHMpLgogICAgICAgYmFyID0gW1tFbWFjc1Njcm9sbGVyIGFsbG9jXSBpbml0RnJhbWU6 IHIgd2luZG93OiB3aW5dOwogICAgICAgd3NldF92ZXJ0aWNhbF9zY3JvbGxfYmFyICh3aW5kb3cs IG1ha2VfbWludF9wdHIgKGJhcikpOwogICAgICAgdXBkYXRlX3AgPSBZRVM7CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIC8qIFRo aXMgaXMgb25seSBmb3IgZGVidWdnaW5nIHB1cnBvc2VzLiAqLworICAgICAgW2JhciBtY19zZXRf cmVjdGFuZ2xlOiByXTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgIH0KICAg ZWxzZQogICAgIHsKQEAgLTQ4MTAsMTIgKzU4MTQsMzAgQEAgaW4gY2VydGFpbiBzaXR1YXRpb25z IChyYXBpZCBpbmNvbWluZyBldmVudHMpLgogICAgICAgYmFyID0gWE5TX1NDUk9MTF9CQVIgKHdp bmRvdy0+dmVydGljYWxfc2Nyb2xsX2Jhcik7CiAgICAgICBvbGRSZWN0ID0gW2JhciBmcmFtZV07 CiAgICAgICByLnNpemUud2lkdGggPSBvbGRSZWN0LnNpemUud2lkdGg7CisKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgICAgIGlmIChGUkFN RV9MSVZFX1AgKGYpICYmICFOU0VxdWFsUmVjdHMgKG9sZFJlY3QsIHIpKQogICAgICAgICB7Cisg ICAgICAgICAgLyogVGhlIG1haW4gd2luZG93IGhhcyBwcm9iYWJseSBiZWVuIHJlc2l6ZWQuICBH cmFjaW91c2x5IGRlbGV0ZSB0aGUKKyAgICAgICAgICBvbGQgc2Nyb2xsIGJhciB3aXRob3V0IHJl cGFpbnRpbmcgaXRzIHJlY3RhbmdsZTsgYW5kLCBjcmVhdGUgYSBuZXcKKyAgICAgICAgICBzY3Jv bGwgYmFyIGVsc2V3aGVyZS4qLwogICAgICAgICAgIGlmIChvbGRSZWN0Lm9yaWdpbi54ICE9IHIu b3JpZ2luLngpCisgICAgICAgICAgICB7CiAgICAgICAgICAgICAgIG5zX2NsZWFyX2ZyYW1lX2Fy ZWEgKGYsIGxlZnQsIHRvcCwgd2lkdGgsIGhlaWdodCk7CisgICAgICAgICAgICAgIFtiYXIgbWNf anVkZ2VdOworICAgICAgICAgICAgICBiYXIgPSBbW0VtYWNzU2Nyb2xsZXIgYWxsb2NdIGluaXRG cmFtZTogciB3aW5kb3c6IHdpbl07CisgICAgICAgICAgICAgIHdzZXRfdmVydGljYWxfc2Nyb2xs X2JhciAod2luZG93LCBtYWtlX21pbnRfcHRyIChiYXIpKTsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgICAgIGVsc2UKICAgICAgICAgICBbYmFyIHNldEZyYW1lOiByXTsKICAgICAgICAgfQorCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgfQogCiAgIGlmICh1cGRhdGVfcCkKQEAg LTQ5NzUsOSArNTk5Nyw1NyBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMgKHJhcGlkIGluY29taW5n IGV2ZW50cykuCiAgICAgewogICAgICAgdmlldyA9IFtzdWJ2aWV3cyBvYmplY3RBdEluZGV4OiBp XTsKICAgICAgIGlmICghW3ZpZXcgaXNLaW5kT2ZDbGFzczogW0VtYWNzU2Nyb2xsZXIgY2xhc3Nd XSkgY29udGludWU7Ci0gICAgICBpZiAoW3ZpZXcganVkZ2VdKQorCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIGBYU0VUV0lORE9XJyB3 aWxsIHNvbWV0aW1lcyBjYXVzZSBFbWFjcyB0byBjcmFzaCB3aGVuIHJ1bm5pbmcgdW5kZXIgZ2Ri IGV2ZW4KKyAgdGhvdWdoICh3ICE9IE5VTEwpLiAgVGhlcmVmb3JlLCB3ZSBjYW5ub3QgcmVsaWFi bHkgdXNlIGBXSU5ET1dfTElWRV9QJy4gKi8KKyAgc3RydWN0IHdpbmRvdyAqdyA9IFt2aWV3IG1j X2dldF93aW5kb3ddOworICBpZiAodyAhPSBOVUxMCisgICAgICAmJiBOSUxQICh3LT5jb250ZW50 cykpCisgICAgeworICAgICAgQk9PTCBkZWJ1Z19wID0gZmFsc2U7CisgICAgICBpZiAoZGVidWdf cAorICAgICAgICAgIC8qIGB3aW5kb3dfYm94JyBjYWxscyBgd2luZG93X2JveF9oZWlnaHQnLCB3 aGljaCB3aWxsIGNhdXNlIEVtYWNzIHRvCisgICAgICAgICAgY3Jhc2ggaWYgRlJBTUVQICh3LT5m cmFtZSkgaXMgbm90IHNhdGlzZmllZC4gKi8KKyAgICAgICAgICAmJiBGUkFNRVAgKHctPmZyYW1l KSkKKyAgICAgICAgeworICAgICAgICAgIE5TUmVjdCByMCA9IFt2aWV3IG1jX2dldF9yZWN0YW5n bGVdOworICAgICAgICAgIGludCB4MCA9IE5TTWluWCAocjApOworICAgICAgICAgIGludCB5MCA9 IE5TTWluWSAocjApOworICAgICAgICAgIGludCB3ZDAgPSBOU1dpZHRoIChyMCk7CisgICAgICAg ICAgaW50IGgwID0gTlNIZWlnaHQgKHIwKTsKKyAgICAgICAgICBpbnQgd2luZG93X3ksIHdpbmRv d19oZWlnaHQ7CisgICAgICAgICAgd2luZG93X2JveCAodywgQU5ZX0FSRUEsIDAsICZ3aW5kb3df eSwgMCwgJndpbmRvd19oZWlnaHQpOworICAgICAgICAgIGludCB0b3AgPSB3aW5kb3dfeTsKKyAg ICAgICAgICBpbnQgaGVpZ2h0ID0gd2luZG93X2hlaWdodDsKKyAgICAgICAgICBpbnQgd2lkdGgg PSBXSU5ET1dfQ09ORklHX1NDUk9MTF9CQVJfQ09MUyAodykgKiBGUkFNRV9DT0xVTU5fV0lEVEgg KGYpOworICAgICAgICAgIGludCBsZWZ0ID0gV0lORE9XX1NDUk9MTF9CQVJfQVJFQV9YICh3KTsK KyAgICAgICAgICBOU1JlY3QgcjEgPSBOU01ha2VSZWN0IChsZWZ0LCB0b3AsIHdpZHRoLCBoZWln aHQpOworICAgICAgICAgIC8qIFRoZSBwYXJlbnQgdmlldyBpcyBmbGlwcGVkLCBzbyB3ZSBuZWVk IHRvIGZsaXAgeSB2YWx1ZS4gKi8KKyAgICAgICAgICBFbWFjc1ZpZXcgKmZyYW1lX3ZpZXcgPSBG UkFNRV9OU19WSUVXIChmKTsKKyAgICAgICAgICBOU1JlY3QgdiA9IFtmcmFtZV92aWV3IGZyYW1l XTsKKyAgICAgICAgICByMS5vcmlnaW4ueSA9ICh2LnNpemUuaGVpZ2h0IC0gcjEuc2l6ZS5oZWln aHQgLSByMS5vcmlnaW4ueSk7CisgICAgICAgICAgaW50IHgxID0gTlNNaW5YIChyMSk7CisgICAg ICAgICAgaW50IHkxID0gTlNNaW5ZIChyMSk7CisgICAgICAgICAgaW50IHdkMSA9IE5TV2lkdGgg KHIxKTsKKyAgICAgICAgICBpbnQgaDEgPSBOU0hlaWdodCAocjEpOworICAgICAgICAgIGZwcmlu dGYgKHN0ZGVyciwgIiVzIC0tIERFQUQ6XG5cCisgICAgICAgICAgeDAveDEgKCVkLyVkKSB8IHkw L3kxICglZC8lZCkgfCB3ZDAvd2QxICglZC8lZCkgfCBoMC9oMSAoJWQvJWQpXG4iLAorICAgICAg ICAgIG1jX3dpbmRvdyAodyksIHgwLCB4MSwgeTAsIHkxLCB3ZDAsIHdkMSwgaDAsIGgxKTsKKyAg ICAgICAgfQorICAgICAgaWYgKFt2aWV3IG1jX2p1ZGdlXSkKICAgICAgICAgcmVtb3ZlZCA9IFlF UzsKICAgICB9CisgICAgZWxzZSBpZiAoW3ZpZXcganVkZ2VdKQorICAgICAgcmVtb3ZlZCA9IFlF UzsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKworICAgIH0KIAogICBpZiAocmVtb3Zl ZCkKICAgICBbZXZpZXcgdXBkYXRlRnJhbWVTaXplOiBOT107CkBAIC01MTA2LDYgKzYxNzYsMjAg QEAgc3RhdGljIExpc3BfT2JqZWN0IG5zX3N0cmluZ190b19saXNwbW9kIChjb25zdCBjaGFyICpz KQogZXh0ZXJuIGZyYW1lX3Bhcm1faGFuZGxlciBuc19mcmFtZV9wYXJtX2hhbmRsZXJzW107CiBz dGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UgbnNfcmVkaXNwbGF5X2ludGVyZmFjZSA9 CiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgbnN0ZXJtLm1gIG11c3QgYmUgaW4gdGhl IGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3Bl eHRlcm4uaGAhICovCisKKyAgbWNfbnNfZHJhd193aW5kb3dfY3Vyc29yLAorICBtY19uc19kcmF3 X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBuc19mcmFt ZV9wYXJtX2hhbmRsZXJzLAogICB4X3Byb2R1Y2VfZ2x5cGhzLAogICB4X3dyaXRlX2dseXBocywK QEAgLTg3MjEsNiArOTgwNSw0OSBAQCAtIChCT09MKWNhbkJlY29tZU1haW5XaW5kb3cKIAogQGlt cGxlbWVudGF0aW9uIEVtYWNzU2Nyb2xsZXIKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLSAodm9pZCltY19zZXRfcmVjdGFuZ2xlOiAoTlNS ZWN0KXJlY3QKK3sKKyAgbWNfcmVjdGFuZ2xlID0gcmVjdDsKK30KKworLSAoTlNSZWN0KW1jX2dl dF9yZWN0YW5nbGUKK3sKKyAgcmV0dXJuIG1jX3JlY3RhbmdsZTsKK30KKworLSAoc3RydWN0IHdp bmRvdyAqKW1jX2dldF93aW5kb3cKK3sKKyAgcmV0dXJuIHdpbmRvdzsKK30KKworLSAoYm9vbClt Y19qdWRnZQoreworICBOU1RSQUNFICgiW0VtYWNzU2Nyb2xsZXIgbWNfanVkZ2VdIik7CisgIGJv b2wgcmV0ID0gY29uZGVtbmVkOworICBibG9ja19pbnB1dCAoKTsKKyAgaWYgKGNvbmRlbW5lZCkK KyAgICB7CisgICAgICAvKiBlbnN1cmUgb3RoZXIgc2Nyb2xsYmFyIHVwZGF0ZXMgYWZ0ZXIgZGVs ZXRpb24gKi8KKyAgICAgIEVtYWNzVmlldyAqdmlldyA9IChFbWFjc1ZpZXcgKilGUkFNRV9OU19W SUVXIChmcmFtZSk7CisgICAgICBpZiAodmlldyAhPSBuaWwpCisgICAgICAgIHZpZXctPnNjcm9s bGJhcnNOZWVkaW5nVXBkYXR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UkVUQ0hfR0xZUEgpOworICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IKKyAgICAgICYmICF4X3N0 cmV0Y2hfY3Vyc29yX3ApCisgICAgeworICAgICAgLyogSWYgYHgtc3RyZXRjaC1jdXJzb3InIGlz IG5pbCwgZG9uJ3QgZHJhdyBhIGJsb2NrIGN1cnNvciBhcworICAgd2lkZSBhcyB0aGUgc3RyZXRj aCBnbHlwaC4gICovCisgICAgICBpbnQgd2lkdGgsIGJhY2tncm91bmRfd2lkdGggPSBzLT5iYWNr Z3JvdW5kX3dpZHRoOworICAgICAgaW50IHggPSBzLT54OworICAgICAgaWYgKCFzLT5yb3ctPnJl dmVyc2VkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgbGVmdF94ID0gd2luZG93X2JveF9s ZWZ0X29mZnNldCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICBpZiAoeCA8IGxlZnRfeCkK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgYmFja2dyb3VuZF93aWR0aCAtPSBsZWZ0X3gg LSB4OworICAgICAgICAgICAgICB4ID0gbGVmdF94OworICAgICAgICAgICAgfQorICAgICAgICB9 CisgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgLyogSW4gUjJMIHJvd3MsIGRyYXcg dGhlIGN1cnNvciBvbiB0aGUgcmlnaHQgZWRnZSBvZiB0aGUKKyAgICAgICAgICAgICBzdHJldGNo IGdseXBoLiAgKi8KKyAgICAgICAgICBpbnQgcmlnaHRfeCA9IHdpbmRvd19ib3hfcmlnaHQgKHMt PncsIFRFWFRfQVJFQSk7CisgICAgICAgICAgaWYgKHggKyBiYWNrZ3JvdW5kX3dpZHRoID4gcmln aHRfeCkKKyAgICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0geCAtIHJpZ2h0X3g7CisgICAg ICAgICAgeCArPSBiYWNrZ3JvdW5kX3dpZHRoOworICAgICAgICB9CisgICAgICB3aWR0aCA9IG1p biAoRlJBTUVfQ09MVU1OX1dJRFRIIChzLT5mKSwgYmFja2dyb3VuZF93aWR0aCk7CisgICAgICBp ZiAocy0+cm93LT5yZXZlcnNlZF9wKQorICAgICAgICB4IC09IHdpZHRoOworICAgICAgLyogRHJh dyBjdXJzb3IuICAqLworICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19iZ19yZWN0IChzLCB4LCBz LT55LCB3aWR0aCwgcy0+aGVpZ2h0KTsKKyAgICAgIC8qIENsZWFyIHJlc3QgdXNpbmcgdGhlIEdD IG9mIHRoZSBvcmlnaW5hbCBub24tY3Vyc29yIGZhY2UuICAqLworICAgICAgaWYgKHdpZHRoIDwg YmFja2dyb3VuZF93aWR0aCkKKyAgICAgICAgeworICAgICAgICAgIFhHQ1ZhbHVlcyAqZ2MgPSBz LT5mYWNlLT5nYzsKKyAgICAgICAgICBpbnQgeSA9IHMtPnk7CisgICAgICAgICAgaW50IHcgPSBi YWNrZ3JvdW5kX3dpZHRoIC0gd2lkdGgsIGggPSBzLT5oZWlnaHQ7CisgICAgICAgICAgUkVDVCBy OworICAgICAgICAgICAgICAgIEhEQyBoZGMgPSBzLT5oZGM7CisgICAgICAgICAgaWYgKCFzLT5y b3ctPnJldmVyc2VkX3ApCisgICAgICAgICAgICB4ICs9IHdpZHRoOworICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgIHggPSBzLT54OworICAgICAgICAgIGlmIChzLT5yb3ctPm1vdXNlX2ZhY2Vf cAorICAgICAgICAgICAgICAmJiBjdXJzb3JfaW5fbW91c2VfZmFjZV9wIChzLT53KSkKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgeF9zZXRfbW91c2VfZmFjZV9nYyAocyk7CisgICAgICAg ICAgICAgIGdjID0gcy0+Z2M7CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgZ2MgPSBzLT5mYWNlLT5nYzsKKyAgICAgICAgICBnZXRfZ2x5cGhfc3RyaW5nX2NsaXBf cmVjdCAocywgJnIpOworICAgICAgICAgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKGhkYywgJnIp OworI2lmIDAgLyogVE9ETzogc3RpcHBsZSAqLworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdGlw cGxlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBGaWxsIGJhY2tncm91bmQgd2l0 aCBhIHN0aXBwbGUgcGF0dGVybi4gICovCisgICAgICAgICAgICAgIFhTZXRGaWxsU3R5bGUgKHMt PmRpc3BsYXksIGdjLCBGaWxsT3BhcXVlU3RpcHBsZWQpOworICAgICAgICAgICAgICBYRmlsbFJl Y3RhbmdsZSAocy0+ZGlzcGxheSwgcy0+d2luZG93LCBnYywgeCwgeSwgdywgaCk7CisgICAgICAg ICAgICAgIFhTZXRGaWxsU3R5bGUgKHMtPmRpc3BsYXksIGdjLCBGaWxsU29saWQpOworICAgICAg ICAgICAgfQorICAgICAgICAgIGVsc2UKKyNlbmRpZgorICAgICAgICAgICAgeworICAgICAgICAg ICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIGdjLT5iYWNrZ3JvdW5kLCB4LCB5LCB3 LCBoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgZWxzZSBpZiAoIXMtPmJh Y2tncm91bmRfZmlsbGVkX3ApCisgICAgeworICAgICAgaW50IGJhY2tncm91bmRfd2lkdGggPSBz LT5iYWNrZ3JvdW5kX3dpZHRoOworICAgICAgaW50IHggPSBzLT54LCBsZWZ0X3ggPSB3aW5kb3df Ym94X2xlZnRfb2Zmc2V0IChzLT53LCBURVhUX0FSRUEpOworICAgICAgLyogRG9uJ3QgZHJhdyBp bnRvIGxlZnQgbWFyZ2luLCBmcmluZ2Ugb3Igc2Nyb2xsYmFyIGFyZWEKKyAgICAgICAgIGV4Y2Vw dCBmb3IgaGVhZGVyIGxpbmUgYW5kIG1vZGUgbGluZS4gICovCisgICAgICBpZiAoeCA8IGxlZnRf eCA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nNvcl9nbHlw aCAodywgbWF0cml4LCByb3csIGhwb3MsIHZwb3MpOworICBpZiAoY3Vyc29yX2dseXBoID09IE5V TEwpCisgICAgeworICAgICAgRGVsZXRlT2JqZWN0IChoYik7CisgICAgICByZXR1cm47CisgICAg fQorICBpbnQgcmwgPSBmeDsKKyAgaW50IHJ0ID0gZnk7CisgIGludCByciA9IHJsICsgd2Q7Cisg IGludCByYiA9IHJ0ICsgaDsKKy8qCisgIGZwcmludGYgKHN0ZGVyciwgIk1DX0hPTExPV19CT1g6 ICBybCAoJWQpIHwgcnQgKCVkKSB8IHJyICglZCkgfCByYiAoJWQpXG4iLCBybCwgcnQsIHJyLCBy Yik7CisqLworICByZWN0LmxlZnQgPSBybDsKKyAgcmVjdC50b3AgPSBydDsKKyAgcmVjdC5yaWdo dCA9IHJyOworICByZWN0LmJvdHRvbSA9IHJiOworICBoZGMgPSBnZXRfZnJhbWVfZGMgKGYpOwor ICAvKiBTZXQgY2xpcHBpbmcsIGRyYXcgdGhlIHJlY3RhbmdsZSwgYW5kIHJlc2V0IGNsaXBwaW5n IGFnYWluLiAgKi8KKyAgdzMyX2NsaXBfdG9fcm93ICh3LCByb3csIFRFWFRfQVJFQSwgaGRjKTsK KyAgRnJhbWVSZWN0IChoZGMsICZyZWN0LCBoYik7CisgIERlbGV0ZU9iamVjdCAoaGIpOworICB3 MzJfc2V0X2NsaXBfcmVjdGFuZ2xlIChoZGMsIE5VTEwpOworICByZWxlYXNlX2ZyYW1lX2RjIChm LCBoZGMpOworfQorCisvKiBEcmF3IGEgYmFyIGN1cnNvciBvbiB3aW5kb3cgVyBpbiBnbHlwaCBy b3cgUk9XLiAqLworc3RhdGljIHZvaWQKK21jX3czMl9kcmF3X2Jhcl9jdXJzb3IgKHN0cnVjdCB3 aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAq cm93LAorICBpbnQgeCwgaW50IGZ4LCBpbnQgeSw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cnNvcl90eXBlLAor ICAgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCwgZW51bSBtY19mbGF2b3IgZ2x5cGhf Zmxhdm9yLCBib29sIG9uX3AsIGJvb2wgYWN0aXZlX3ApCit7CisgIGlmIChvbl9wKQorICAgIHsK KyAgICAgIC8qIElmIHRoaXMgaXMgdGhlIGFjdGl2ZSBjdXJzb3IsIHdlIG5lZWQgdG8gdHJhY2sg aXQgd2l0aCB0aGUKKyAgICAgIHN5c3RlbSBjYXJldCwgc28gdGhpcmQgcGFydHkgc29mdHdhcmUg bGlrZSBzY3JlZW4gbWFnbmlmaWVycworICAgICAgYW5kIHNwZWVjaCBzeW50aGVzaXplcnMgY2Fu IGZvbGxvdyB0aGUgY3Vyc29yLiAgKi8KKyAgICAgIGlmIChhY3RpdmVfcCkKKyAgICAgICAgewor ICAgICAgICAgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7Cisg ICAgICAgICAgSFdORCBod25kID0gRlJBTUVfVzMyX1dJTkRPVyAoZik7CisgICAgICAgICAgdzMy X3N5c3RlbV9jYXJldF94CisgICAgICAgICAgICA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVM X1ggKHcsIHgpOworICAgICAgICAgIC8qIEZJWE1FOiAgV2hhdCBzaG91bGQgd2UgdXNlIGluc3Rl YWQgb2YgYHctPnBoeXNfY3Vyc29yX2FzY2VudCc/ICovCisgICAgICAgICAgdzMyX3N5c3RlbV9j YXJldF95CisgICAgICAgICAgICA9IChXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgeSkKKyAg ICAgICAgICAgICAgICsgcm93LT5hc2NlbnQgLSB3LT5waHlzX2N1cnNvcl9hc2NlbnQpOworICAg ICAgICAgIHczMl9zeXN0ZW1fY2FyZXRfd2luZG93ID0gdzsKKyAgICAgICAgICB3MzJfc3lzdGVt X2NhcmV0X2hkcl9oZWlnaHQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAg ICAgICB3MzJfc3lzdGVtX2NhcmV0X21vZGVfaGVpZ2h0ID0gV0lORE9XX01PREVfTElORV9IRUlH SFQgKHcpOworICAgICAgICAgIFBvc3RNZXNzYWdlIChod25kLCBXTV9JTUVfU1RBUlRDT01QT1NJ VElPTiwgMCwgMCk7CisgICAgICAgICAgLyogSWYgdGhlIHNpemUgb2YgdGhlIGFjdGl2ZSBjdXJz b3IgY2hhbmdlZCwgZGVzdHJveSB0aGUgb2xkCisgICAgICAgICAgICAgc3lzdGVtIGNhcmV0LiAg Ki8KKyAgICAgICAgICBpZiAodzMyX3N5c3RlbV9jYXJldF9od25kCisgICAgICAgICAgICAgICYm ICh3MzJfc3lzdGVtX2NhcmV0X2hlaWdodCAhPSBoKSkKKyAgICAgICAgICAgIFBvc3RNZXNzYWdl IChod25kLCBXTV9FTUFDU19ERVNUUk9ZX0NBUkVULCAwLCAwKTsKKyAgICAgICAgICB3MzJfc3lz dGVtX2NhcmV0X2hlaWdodCA9IGg7CisgICAgICAgICAgLyogTW92ZSB0aGUgc3lzdGVtIGNhcmV0 LiAgKi8KKyAgICAgICAgICBQb3N0TWVzc2FnZSAoaHduZCwgV01fRU1BQ1NfVFJBQ0tfQ0FSRVQs IDAsIDApOworICAgICAgICB9CisgICAgICAvKiBUaGUgZnJpbmdlIGJpdG1hcHMgYXJlIHByZXNl bnRseSBoYW5kbGVkIGVsc2V3aGVyZSwgYnV0IGNvdWxkIHNvbWVkYXkKKyAgICAgIGJlIG1hbmFn ZWQgKGluIHBhcnQpIGF0IHRoaXMgc2VjdGlvbiBvZiBjb2RlLiAqLworICAgICAgaWYgKHJvdy0+ ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICYmIChyb3ctPnJldmVyc2VkX3AK KyAgICAgICAgICAgICA/IChocG9zIDwgMCkKKyAgICAgICAgICAgICA6IChocG9zID49IHJvdy0+ dXNlZFtURVhUX0FSRU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ICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZDsK KyAgICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19hY3RpdmVfcmVn aW9uX2VuZF9mYWNlLT5iYWNrZ3JvdW5kOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg IGVsc2UgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAmJiBhY3Rp dmVfcAorICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPiBy ZWdpb25fYmVnCisgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBv cyA8IHJlZ2lvbl9lbmQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgZW51 bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZV9pZCA9IGxvb2t1cF9u YW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW4tcmVnaW9uLXBy ZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxv d19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2Fj dGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgIGVudW0gZmFj ZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAg ICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAo ZiwgaG9sbG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5m b3JlZ3JvdW5kID0gaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAg ICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVu X2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVs c2UgaWYgKGFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2Ug KHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsK KyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZB Q0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAg ICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7 CisgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gaG9sbG93X2FjdGl2 ZV9mYWNlLT5iYWNrZ3JvdW5kOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAg ICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3Vw X25hbWVkX2ZhY2UgKHcsIGYsIGludG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AgICAgICAgICAgICAgICAg IGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2UtPmJh Y2tncm91bmQ7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlm IChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9w CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPiBy ZWdpb25fYmVnCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNo YXJwb3MgPCByZWdpb25fZW5kKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZV9p ZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3It aW4tcmVnaW9uLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0 cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2UgPSBGQUNFX0ZST01f SUQgKGYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZV9pZCk7CisgICAgICAgICAg ICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9u YW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2Ui KSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3Rp dmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAg ICAgICAgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxvd19hY3RpdmVfZmFj ZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3Vu ZCA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChhY3RpdmVfcCkK KyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZh Y2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGlu dGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAg ICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZS T01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAg ICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZDsK KyAgICAgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gaG9sbG93X2Fj dGl2ZV9mYWNlLT5iYWNrZ3JvdW5kOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfaW5hY3Rp dmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFr ZS1jdXJzb3ItaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAg ICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9J RCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgICAg ICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5k OworICAgICAgICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxv d19pbmFjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kOworICAgICAgICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYyA9IFhDcmVhdGVHQyAo TlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiksIG1hc2ssICZnY192YWx1ZXMpOworICAgICAgICAg ICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyogRm9yY2UgYG1jX3czMl9zZXRf Y3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djJy4gICov CisgICAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSB0cnVlOworICAgICAgICAgICAgICBt Y19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9z LCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsLCBnbHlwaF9m bGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICAgICAg ICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MgPSBvcmlnaW5hbF9jdXJzb3JfZ2M7 CisgICAgICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgIG1jX3czMl9k cmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZw b3MsIHdkLCBoKTsKKyAgICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNl IE1DX0hPTExPV19CT1g6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3Jl ZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9y YXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICAqLworICAg ICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gY29sb3JfcGl4ZWw7Cisg ICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4 LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLncz Mi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAg ICAgIGVsc2UKKyAgICAgICAgICBtY193MzJfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgs IHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICBicmVhazsKKyAg ICB9CisgICAgY2FzZSBNQ19GSUxMRURfQk9YOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49 IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworIC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0+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 aW5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NlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAo cywgdHJ1ZSk7CisgICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5k IChzKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgorICAgICAgaWYg KHMtPmZvcl9vdmVybGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7 CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywg ZmFsc2UpOworICAgICAgeF9kcmF3X2dseXBobGVzc19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAo cyk7CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7Cisg ICAgfQorICBpZiAoIXMtPmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICAvKiBEcmF3IHVuZGVy bGluZS4gICovCisgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3ApCisgICAgICAgIHsKKyAg ICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9XQVZFKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBDT0xPUlJFRiBjb2xvcjsKKyAgICAgICAgICAg ICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICBj b2xvciA9IHMtPmdjLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAg ICAgICAgY29sb3IgPSBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3I7CisgICAgICAgICAgICAgIHcz Ml9kcmF3X3VuZGVyd2F2ZSAocywgY29sb3IpOworICAgICAgICAgICAgfQorICAgICAgICAgIGVs c2UgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgdW5zaWduZWQgbG9uZyB0aGlja25lc3MsIHBvc2l0aW9u OworICAgICAgICAgICAgICBpbnQgeTsKKyAgICAgICAgICAgICAgaWYgKHMtPnByZXYgJiYgcy0+ cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3AKKyAgICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPmZh Y2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAvKiBXZSB1c2UgdGhlIHNhbWUgdW5kZXJsaW5lIHN0eWxlIGFz IHRoZSBwcmV2aW91cyBvbmUuICAqLworICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+ cHJldi0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0g cy0+cHJldi0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qIEdldCB0 aGUgdW5kZXJsaW5lIHRoaWNrbmVzcy4gIERlZmF1bHQgaXMgMSBwaXhlbC4gICovCisgICAgICAg ICAgICAgICAgICBpZiAocy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4g MCkKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3Ro aWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgdGhp Y2tuZXNzID0gMTsKKyAgICAgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50 X2xpbmUpCisgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIHRoaWNr bmVzcykgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJs aW5lIHBvc2l0aW9uLiAgVGhpcyBpcyB0aGUgcmVjb21tZW5kZWQKKyAgICAgICAgICAgICAgICAg ICAgICAgICB2ZXJ0aWNhbCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRo ZSB0b3Agb2YKKyAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBp cyBhIHNpZ25lZCB2YWx1ZSBhY2NvcmRpbmcgdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAg ICAgc3BlY3MsIGFuZCBpdHMgZGVmYXVsdCBpcworICAgICAgICAgICAgICAgICAgICAgICAgIFJP VU5EICgobWF4aW11bV9kZXNjZW50KSAvIDIpLCB3aXRoCisgICAgICAgICAgICAgICAgICAgICAg ICAgUk9VTkQgKHgpID0gZmxvb3IgKHggKyAwLjUpICAqLworICAgICAgICAgICAgICAgICAgICAg IGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGllcworICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbiA+PSAw KQorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5mb250LT51bmRlcmxpbmVf cG9zaXRpb247CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocy0+Zm9udCkKKyAgICAg ICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmZvbnQtPmRlc2NlbnQgKyAxKSAvIDI7 CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbWF4 IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgIC8qIENoZWNrIHRoZSBzYW5pdHkgb2YgdGhpY2tuZXNzIGFuZCBwb3Np dGlvbi4gIFdlIHNob3VsZAorICAgICAgICAgICAgICAgICBhdm9pZCBkcmF3aW5nIHVuZGVybGlu ZSBvdXQgb2YgdGhlIGN1cnJlbnQgbGluZSBhcmVhLiAgKi8KKyAgICAgICAgICAgICAgaWYgKHMt PnkgKyBzLT5oZWlnaHQgPD0gcy0+eWJhc2UgKyBwb3NpdGlvbikKKyAgICAgICAgICAgICAgICBw b3NpdGlvbiA9IChzLT5oZWlnaHQgLSAxKSAtIChzLT55YmFzZSAtIHMtPnkpOworICAgICAgICAg ICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8IHMtPnliYXNlICsgcG9zaXRpb24gKyB0aGlja25l c3MpCisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gKHMtPnkgKyBzLT5oZWlnaHQpIC0gKHMt PnliYXNlICsgcG9zaXRpb24pOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfdGhpY2tuZXNz ID0gdGhpY2tuZXNzOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPXBvc2l0 aW9uOworICAgICAgICAgICAgICB5ID0gcy0+eWJhc2UgKyBwb3NpdGlvbjsKKyAgICAgICAgICAg ICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICB3 MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHksIHMtPndpZHRoLCAxKTsKKyAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ ZmFjZS0+dW5kZXJsaW5lX2NvbG9yLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHksIHMtPndpZHRoLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyog RHJhdyBvdmVybGluZS4gICovCisgICAgICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfcCkKKyAgICAg ICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAwLCBoID0gMTsKKyAgICAgICAgICBp ZiAocy0+ZmFjZS0+b3ZlcmxpbmVfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICB3MzJf ZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgcy0+eSArIGR5LCBzLT53aWR0aCwgaCk7CisgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFj ZS0+b3ZlcmxpbmVfY29sb3IsIHMtPngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMt PnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICB9CisgICAgICAvKiBEcmF3IHN0cmlrZS10 aHJvdWdoLiAgKi8KKyAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9wCisgICAgICAg ICAgJiYgIUZPTlRfVEVYVE1FVFJJQyAocy0+Zm9udCkudG1TdHJ1Y2tPdXQpCisgICAgICAgIHsK KyAgICAgICAgICB1bnNpZ25lZCBsb25nIGggPSAxOworICAgICAgICAgIHVuc2lnbmVkIGxvbmcg ZHkgPSAocy0+aGVpZ2h0IC0gaCkgLyAyOworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2Vf dGhyb3VnaF9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMt PmYsIHMtPmhkYywgcy0+Z2MtPmZvcmVncm91bmQsIHMtPngsIHMtPnkgKyBkeSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICBlbHNlCisgICAgICAg ICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmZhY2UtPnN0cmlrZV90aHJvdWdo X2NvbG9yLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+eSArIGR5LCBzLT53 aWR0aCwgaCk7CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgcmVsaWVmIGlmIG5vdCB5ZXQgZHJh d24uICAqLworICAgICAgaWYgKCFyZWxpZWZfZHJhd25fcCAmJiBzLT5mYWNlLT5ib3ggIT0gRkFD RV9OT19CT1gpCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYm94IChzKTsKKyAgICAgIGlm IChzLT5wcmV2KQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqcHJl djsKKyAgICAgICAgICBmb3IgKHByZXYgPSBzLT5wcmV2OyBwcmV2OyBwcmV2ID0gcHJldi0+cHJl dikKKyAgICAgICAgICAgIGlmIChwcmV2LT5obCAhPSBzLT5obAorICAgICAgICAgICAgICAgICYm IHByZXYtPnggKyBwcmV2LT53aWR0aCArIHByZXYtPnJpZ2h0X292ZXJoYW5nID4gcy0+eCkKKyAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEFzIHByZXYgd2FzIGRyYXduIHdoaWxl IGNsaXBwZWQgdG8gaXRzIG93biBhcmVhLCB3ZQorICAgICAgICAgICAgICAgICAgIG11c3QgZHJh dyB0aGUgcmlnaHRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICAqLworICAgICAgICAg ICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gcHJldi0+aGw7CisgICAgICAgICAg ICAgICAgcHJldi0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY193MzJfc2V0X2dseXBo X3N0cmluZ19nYyAocHJldiwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICAgIHhfc2V0X2ds eXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBwcmV2KTsKKyAgICAgICAgICAgICAgICBp ZiAocHJldi0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkKKyAgICAgICAgICAgICAg ICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocHJldik7CisgICAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdf Zm9yZWdyb3VuZCAocHJldik7CisgICAgICAgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3Rhbmds ZSAocHJldi0+aGRjLCBOVUxMKTsKKyAgICAgICAgICAgICAgICBwcmV2LT5obCA9IHNhdmU7Cisg ICAgICAgICAgICAgICAgcHJldi0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICAgICAgfQorICAg ICAgICB9CisgICAgICBpZiAocy0+bmV4dCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBn bHlwaF9zdHJpbmcgKm5leHQ7CisgICAgICAgICAgZm9yIChuZXh0ID0gcy0+bmV4dDsgbmV4dDsg bmV4dCA9IG5leHQtPm5leHQpCisgICAgICAgICAgICBpZiAobmV4dC0+aGwgIT0gcy0+aGwKKyAg ICAgICAgICAgICAgICAmJiBuZXh0LT54IC0gbmV4dC0+bGVmdF9vdmVyaGFuZyA8IHMtPnggKyBz LT53aWR0aCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEFzIG5leHQgd2ls bCBiZSBkcmF3biB3aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwKKyAgICAgICAgICAgICAg ICAgICB3ZSBtdXN0IGRyYXcgdGhlIGxlZnRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cu ICAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gbmV4dC0+ aGw7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBt Y193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4dCwgY3Vyc29yX2djX3ApOworICAgICAgICAg ICAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBuZXh0KTsKKyAg ICAgICAgICAgICAgICBpZiAobmV4dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkK KyAgICAgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7 CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2NvbXBvc2l0 ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAgICAgICAgdzMyX3Nl dF9jbGlwX3JlY3RhbmdsZSAobmV4dC0+aGRjLCBOVUxMKTsKKyAgICAgICAgICAgICAgICBuZXh0 LT5obCA9IHNhdmU7CisgICAgICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAgICAg ICAgICAgICAgICBuZXh0LT5jbGlwX2hlYWQgPSBzLT5uZXh0OworICAgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICB9CisgIC8qIFJlc2V0IGNsaXBwaW5nLiAgKi8KKyAgdzMyX3NldF9jbGlw X3JlY3RhbmdsZSAocy0+aGRjLCBOVUxMKTsKKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyog ZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8q IEZyaW5nZSBiaXRtYXBzLiAgKi8KIAogc3RhdGljIGludCBtYXhfZnJpbmdlX2JtcCA9IDA7CkBA IC01NDUsNiArMTQxNywxNSBAQCB4X3VwZGF0ZV9iZWdpbiAoc3RydWN0IGZyYW1lICpmKQogICBp ZiAoISBGUkFNRV9XMzJfUCAoZikpCiAgICAgcmV0dXJuOwogCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1l ID0gZjsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBSZWdlbmVyYXRlIGRp c3BsYXkgcGFsZXR0ZSBiZWZvcmUgZHJhd2luZyBpZiBsaXN0IG9mIHJlcXVlc3RlZAogICAgICBj b2xvcnMgaGFzIGNoYW5nZWQuICovCiAgIGlmIChkaXNwbGF5X2luZm8tPnJlZ2VuX3BhbGV0dGUp CkBAIC03NTQsNiArMTYzNSwxNiBAQCB4X3VwZGF0ZV9lbmQgKHN0cnVjdCBmcmFtZSAqZikKIAog ICAvKiBNb3VzZSBoaWdobGlnaHQgbWF5IGJlIGRpc3BsYXllZCBhZ2Fpbi4gICovCiAgIE1PVVNF X0hMX0lORk8gKGYpLT5tb3VzZV9mYWNlX2RlZmVyID0gZmFsc2U7CisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdf ZnJhbWUgPSBOVUxMOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIApAQCAt NDA0MSwxMyArNDkzMiw3NCBAQCB3MzJfc2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHN0cnVjdCB3 aW5kb3cgKncsCiAJICAgICAgcmVsZWFzZV9mcmFtZV9kYyAoZiwgaGRjKTsKIAkgICAgICB4X2Ns ZWFyX3VuZGVyX2ludGVybmFsX2JvcmRlciAoZik7CiAJICAgIH0KKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogUkVQQUlOVElO RyBXSEVOIFJFTU9WSU5HIFNDUk9MTCBCQVI6CisKKy0gU2VxdWVuY2Ugb2YgRXZlbnRzOgorCisg IC4gYHJlZGlzcGxheV9pbnRlcm5hbCcgY2FsbHMgdGhlIGBjb25kZW1uX3Njcm9sbF9iYXJzX2hv b2snLCB3aGljaCBtYXJrcyBhbGwKKyAgICBzY3JvbGwgYmFycyBhcyBjYW5kaWRhdGVzIGZvciBk ZWxldGlvbi4KKworICAuIFRoZW4gYHJlZGlzcGxheV9pbnRlcm5hbCcgY2FsbHMgYHJlZGlzcGxh eV93aW5kb3dzJywgd2hpY2ggd2Fsa3MgdGhlCisgICAgd2luZG93LXRyZWUgYW5kIGV4YW1pbmVz IGVhY2ggd2luZG93LCB3aGVyZWJ5IGVhY2ggd2luZG93IHRoYXQgaXMgc3RpbGwgYWxpdmUKKyAg ICBpbiB0aGUgd2luZG93LXRyZWUgInJlZGVlbXMiIGl0cyBzY3JvbGwgYmFycyBieSBtYXJraW5n IHRoZW0gbm90IHRvIGJlCisgICAgZGVsZXRlZC4KKworICAuIFRoZW4gYHJlZGlzcGxheV9pbnRl cm5hbC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KiogICAgICAgICAgIE1vdmVXaW5kb3cgKGh3bmQs IGxlZnQsIHRvcCwgd2lkdGgsIG1heCAoaGVpZ2h0LCAxKSwgVFJVRSk7ICoqLwotCSAgLyogVHJ5 IHRvIG5vdCBkcmF3IG92ZXIgY2hpbGQgZnJhbWVzLiAgKi8KLQkgIFNldFdpbmRvd1BvcyAoaHdu ZCwgSFdORF9CT1RUT00sIGxlZnQsIHRvcCwgd2lkdGgsIG1heCAoaGVpZ2h0LCAxKSwKLSAgICAg ICAgICAgICAgICAgICAgICAgIFNXUF9GUkFNRUNIQU5HRUQpOworICAgICAgICAgIGlmIChsZWZ0 IDw9IGJhci0+bGVmdCkKKyAgICAgICAgICAgIG15X3Nob3dfd2luZG93IChmLCBod25kLCBTV19I SURFKTsKKyAgICAgICAgICBNb3ZlV2luZG93IChod25kLCBsZWZ0LCB0b3AsIHdpZHRoLCBtYXgg KGhlaWdodCwgMSksIGxlZnQgPD0gYmFyLT5sZWZ0KTsKKworLyogZW5kIE1VTFRJUExFLUNVUlNP UlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiAKIAkgIHNpLmNiU2l6ZSA9IHNpemVv ZiAoc2kpOwogCSAgc2kuZk1hc2sgPSBTSUZfUkFOR0U7CkBAIC00MzE2LDYgKzUyNjgsMjEgQEAg dzMyX2p1ZGdlX3Njcm9sbF9iYXJzIChzdHJ1Y3QgZnJhbWUgKmYpCiAgICAgewogICAgICAgc3Ry dWN0IHNjcm9sbF9iYXIgKmIgPSBYU0NST0xMX0JBUiAoYmFyKTsKIAorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgLyogYERlc3Ryb3lX aW5kb3cnIHdpdGhpbiBgeF9zY3JvbGxfYmFyX3JlbW92ZScgcmVwYWludHMgdGhlIHJlY3Rhbmds ZS4KKyAgICAgIFRoZXJlZm9yZSwgd2UgZmlyc3Qgc2VuZCBhIG1lc3NhZ2UgdG8gaW5oaWJpdCBy ZXBhaW50aW5nLiAqLworICAgICAgaWYgKCFXSU5ET1dfTElWRV9QIChiLT53aW5kb3cpKQorICAg ICAgICB7CisgICAgICAgICAgSFdORCBod25kID0gU0NST0xMX0JBUl9XMzJfV0lORE9XIChiKTsK KyAgICAgICAgICBTZW5kTWVzc2FnZSAoaHduZCwgV01fU0VUUkVEUkFXLCBmYWxzZSwgMCk7Cisg ICAgICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgeF9zY3JvbGxf YmFyX3JlbW92ZSAoYik7CiAKICAgICAgIG5leHQgPSBiLT5uZXh0OwpAQCAtNzA5MSw2ICs4MDU4 LDIwIEBAIGV4dGVybiBmcmFtZV9wYXJtX2hhbmRsZXIgdzMyX2ZyYW1lX3Bhcm1faGFuZGxlcnNb XTsKIAogc3RhdGljIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlIHczMl9yZWRpc3BsYXlfaW50 ZXJmYWNlID0KIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGB3MzJ0ZXJtLmNgIG11c3Qg YmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVyZmFjZScg aW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfdzMyX2RyYXdfd2luZG93X2N1cnNvciwKKyAg bWNfdzMyX2RyYXdfZ2x5cGhfc3RyaW5nLAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgIHczMl9mcmFtZV9wYXJtX2hhbmRsZXJzLAogICB4X3Byb2R1Y2VfZ2x5cGhzLAogICB4X3dy aXRlX2dseXBocywKZGlmZiAtLWdpdCBhL3NyYy93aW5kb3cuaCBiL3NyYy93aW5kb3cuaAppbmRl eCBmZGVmNDA3Li4yYjBiOWI0IDEwMDY0NAotLS0gYS9zcmMvd2luZG93LmgKKysrIGIvc3JjL3dp bmRvdy5oCkBAIC0zMjQsNiArMzI0LDE0NyBAQCBzdHJ1Y3Qgd2luZG93CiAKICNpZmRlZiBIQVZF X1dJTkRPV19TWVNURU0KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1V TFRJUExFLUNVUlNPUlMgKi8KKworLyogU3VmZml4ZXMgZm9yIHRoZSBgbWNgIHdpbmRvdyBwb2lu dGVyIHByZWZpeC4gKi8KK3N0cnVjdCBtdWx0aXBsZV9jdXJzb3JzCit7CisgIC8qIFRoZSByZWNv cmRlZCBwaXhlbCB3aWR0aCBvZiB0aGUgbGFzdCBsaW5lIG51bWJlciBkcmF3biBkdXJpbmcgcmVk aXNwbGF5ICovCisgIGludCBsbnVtX3BpeGVsX3dpZHRoOworfSBtYzsKKworc3RydWN0IG1jX21h dHJpeAoreworICBwdHJkaWZmX3QgdnBvc19hbGxvY2F0ZWQ7CisgIHB0cmRpZmZfdCB2cG9zX3Vz ZWQ7CisgIHB0cmRpZmZfdCBjdXJzb3JzX3VzZWRbNF07CisgIGVudW0gbWNfY2FjaGVfdHlwZQor ICB7CisgICAgTUNfQ0FDSEUsCisgICAgQ0hfQ0FDSEUsCisgICAgRkNfQ0FDSEUsCisgICAgTk9f Q0FDSEUKKyAgfSBjYWNoZV90eXBlOworICBzdHJ1Y3QgbWNfdnBvcworICB7CisgICAgcHRyZGlm Zl90IGNhY2hlX2FsbG9jYXRlZFs0XTsKKyAgICBwdHJkaWZmX3QgY2FjaGVfdXNlZFs0XTsKKyAg ICBzdHJ1Y3QgbWNfY29udGVudHMKKyAgICB7CisgICAgICBib29sX2JmIHNhbWVfcCA6IDE7Cisg ICAgICBzdHJ1Y3QgZ2x5cGggZ2x5cGg7CisgICAgICBpbnQgeDsKKyAgICAgIGludCBmeDsKKyAg ICAgIGludCB5OworICAgICAgaW50IGZ5OworICAgICAgaW50IGhwb3M7CisgICAgICBpbnQgdnBv czsKKyAgICAgIGludCB3ZDsKKyAgICAgIGludCBoOworICAgICAgZW51bSBtY19jdXJzb3JfdHlw ZQorICAgICAgeworICAgICAgICAvKiBOT1RFOiAgVGhlIGZyaW5nZSBiaXRtYXAgZnJhbWV3b3Jr IHJlbGllcyB1cG9uIE1DX05PX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgaGF2aW5nIGEgdmFsdWUg b2YgemVybyAoMCkuICovCisgICAgICAgIE1DX05PX0ZSSU5HRV9CSVRNQVAsCisgICAgICAgIE1D X05PX0NVUlNPUiwKKyAgICAgICAgTUNfUklHSFRfRlJJTkdFX0JJVE1BUCwKKyAgICAgICAgTUNf TEVGVF9GUklOR0VfQklUTUFQLAorICAgICAgICBNQ19GUkFNRURfQk9YLAorICAgICAgICBNQ19G SUxMRURfQk9YLAorICAgICAgICBNQ19IT0xMT1dfQk9YLAorICAgICAgICBNQ19CQVIsCisgICAg ICAgIE1DX0hCQVIKKyAgICAgIH0gY3Vyc29yX3R5cGU7CisgICAgICBpbnQgY3Vyc29yX3dpZHRo OworICAgICAgc3RydWN0IG1jX1JHQgorICAgICAgeworICAgICAgICBkb3VibGUgcmVkOworICAg ICAgICBkb3VibGUgZ3JlZW47CisgICAgICAgIGRvdWJsZSBibHVlOworICAgICAgfSBmZywgYmc7 CisgICAgICBib29sX2JmIGFjdGl2ZV9wIDogMTsKKyAgICAgIGVudW0gbWNfZmxhdm9yCisgICAg ICB7CisgICAgICAgIE5PX0ZMQVZPUiwKKyAgICAgICAgTUNfR0xZUEgsCisgICAgICAgIE1DX0dM WVBITEVTUywKKyAgICAgICAgTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAsCisgICAgICAgIE1DX1BJ TENST1csCisgICAgICAgIE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1csCisgICAgICAg IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1csCisgICAgICAgIE1DX0hP TExPV19SRUNUQU5HTEUsCisgICAgICAgIE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVywKKyAg ICAgICAgTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XLAorICAgICAgICBNQ19W RVJUSUNBTF9CQVIsCisgICAgICAgIE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUiwKKyAgICAgICAg TUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgfSBnbHlwaF9mbGF2b3I7CisgICAgICBi b29sX2JmIGVuYWJsZWRfcCA6IDE7CisgICAgfSAqY2FjaGVbNF07CisgIH0gKnZwb3M7CisgIC8q IFVzZWQgZWxzZXdoZXJlLiAqLworICBzdHJ1Y3QgbWNfZXNzZW50aWFscworICB7CisgICAgZW51 bSBtY19yb3dfcG9zaXRpb24KKyAgICB7CisgICAgICBQUkVfWlYsCisgICAgICBBVF9aViwKKyAg ICAgIFBPU1RfWlYKKyAgICB9IHJvd19wb3NpdGlvbjsKKyAgICBib29sX2JmIGFjdGl2ZV9wIDog MTsKKyAgICBzdHJ1Y3QgbWNfUkdCIGNoX2ZnWzNdLCBmY19mZ1szXSwgc3BfZmc7CisgICAgaW50 IGZjX3g7CisgICAgaW50IHp2OworICAgIGludCB6dl9ieXRlOworICB9IGVzc2VudGlhbHM7Cis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JFQV9PTkUsCisgICAgRVhQT1NFX0FS RUFfVFdPLAorICAgIEVYUE9TRV9MSU5FCisgIH0gbWNfcmVkcmF3X3Jvd190eXBlX19mcm9tX3do ZXJlOworfSBtY19tYXRyaXg7CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAgICAgLyogQ3Vyc29yIHR5cGUgb2YgbGFzdCBjdXJzb3Ig ZHJhd24gb24gdGhlIHdpbmRvdy4gICovCiAgICAgZW51bSB0ZXh0X2N1cnNvcl9raW5kcyBwaHlz X2N1cnNvcl90eXBlOwogCmRpZmYgLS1naXQgYS9zcmMveGRpc3AuYyBiL3NyYy94ZGlzcC5jCmlu ZGV4IGE4OGZjNjkuLmNmNDRjZmMgMTAwNjQ0Ci0tLSBhL3NyYy94ZGlzcC5jCisrKyBiL3NyYy94 ZGlzcC5jCkBAIC05MjEsNiArOTIxLDQ2MjAgQEAgc3RhdGljIHZvaWQgc2hvd19tb3VzZV9mYWNl IChNb3VzZV9ITEluZm8gKiwgZW51bSBkcmF3X2dseXBoc19mYWNlKTsKIHN0YXRpYyBib29sIGNv b3Jkc19pbl9tb3VzZV9mYWNlX3AgKHN0cnVjdCB3aW5kb3cgKiwgaW50LCBpbnQpOwogCiAKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisv KiBNVUxUSVBMRS1DVVJTT1JTOiAgRW1hY3MgQnVnICMyMjg3MyAoZmVhdHVyZSByZXF1ZXN0KQor CisgIENST1NTSEFJUlM6ICBFbWFjcyBCdWcgIzE3Njg0IChmZWF0dXJlIHJlcXVlc3QpCisKKwor VkVSU0lPTjoKKworLSAwMjEuMDAzIF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3JsaWtlKTsK K30KKworTGlzcF9PYmplY3QKK21jX2xpc3RuIChwdHJkaWZmX3QgY291bnQsIExpc3BfT2JqZWN0 IGFyZywgLi4uKQoreworICBlYXNzdW1lICgwIDwgY291bnQpOworICBMaXNwX09iamVjdCB2YWwg PSBGY29ucyAoYXJnLCBRbmlsKTsKKyAgTGlzcF9PYmplY3QgdGFpbCA9IHZhbDsKKyAgdmFfbGlz dCBhcDsKKyAgdmFfc3RhcnQgKGFwLCBhcmcpOworICBmb3IgKHB0cmRpZmZfdCBpID0gMTsgaSA8 IGNvdW50OyBpKyspCisgICAgeworICAgICAgTGlzcF9PYmplY3QgZWxlbSA9IEZjb25zICh2YV9h cmcgKGFwLCBMaXNwX09iamVjdCksIFFuaWwpOworICAgICAgWFNFVENEUiAodGFpbCwgZWxlbSk7 CisgICAgICB0YWlsID0gZWxlbTsKKyAgICB9CisgIHZhX2VuZCAoYXApOworICByZXR1cm4gdmFs OworfQorCitMaXNwX09iamVjdAorbWNfbWVtcSAoTGlzcF9PYmplY3QgZWx0LCBMaXNwX09iamVj dCBsaXN0KQoreworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KSB8 fCBFUSAoWENBUiAobGlzdCksIGVsdCkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhD RFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkgfHwgRVEgKFhDQVIgKGxpc3QpLCBl bHQpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlm ICghQ09OU1AgKGxpc3QpIHx8IEVRIChYQ0FSIChsaXN0KSwgZWx0KSkKKyAgICAgICAgYnJlYWs7 CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgfQorICByZXR1cm4gbGlzdDsKK30KKwor TGlzcF9PYmplY3QKK21jX250aCAoaW50IG51bSwgTGlzcF9PYmplY3QgbGlzdCkKK3sKKyAgZm9y IChpbnQgaSA9IDA7IGkgPCBudW0gJiYgIU5JTFAgKGxpc3QpOyBpKyspCisgICAgbGlzdCA9IFhD RFIgKGxpc3QpOworICBpZiAoQ09OU1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FSIChsaXN0KTsK KyAgICBlbHNlCisgICAgICByZXR1cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QKK21jX2Fzc3Eg KExpc3BfT2JqZWN0IGtleSwgTGlzcF9PYmplY3QgbGlzdCkKK3sKKyAgd2hpbGUgKDEpCisgICAg eworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxp c3QpKQorICAgICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBrZXkpKSkKKyAg ICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQ IChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAg ICYmIEVRIChYQ0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVhazsKKyAgICAg IGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAg fHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhDQVIgKFhDQVIg KGxpc3QpKSwga2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3Qp OworICAgIH0KKyAgaWYgKENPTlNQIChsaXN0KSkKKyAgICByZXR1cm4gWENBUiAobGlzdCk7Cisg ICAgZWxzZQorICAgICAgcmV0dXJuIFFuaWw7Cit9CisKK0xpc3BfT2JqZWN0CittY19hc3NvYyAo TGlzcF9PYmplY3Qga2V5LCBMaXNwX09iamVjdCBsaXN0KQoreworICBMaXNwX09iamVjdCBjYXI7 CisgIHdoaWxlICgxKQorICAgIHsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAg fHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgKGNhciA9IFhDQVIgKFhD QVIgKGxpc3QpKSwKKyAgICAgICAgICAgICAgICAgIEVRIChjYXIsIGtleSkgfHwgIU5JTFAgKEZl cXVhbCAoY2FyLCBrZXkpKSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChs aXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FS IChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgKGNhciA9IFhDQVIgKFhDQVIgKGxpc3QpKSwKKyAg ICAgICAgICAgICAgICAgIEVRIChjYXIsIGtleSkgfHwgIU5JTFAgKEZlcXVhbCAoY2FyLCBrZXkp KSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlm ICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAg ICAgICAgICAgJiYgKGNhciA9IFhDQVIgKFhDQVIgKGxpc3QpKSwKKyAgICAgICAgICAgICAgICAg IEVRIChjYXIsIGtleSkgfHwgIU5JTFAgKEZlcXVhbCAoY2FyLCBrZXkpKSkpKQorICAgICAgICBi cmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICB9CisgIGlmIChDT05TUCAobGlz dCkpCisgICAgcmV0dXJuIFhDQVIgKGxpc3QpOworICAgIGVsc2UKKyAgICAgIHJldHVybiBRbmls OworfQorCitMaXNwX09iamVjdAorbWNfcGxpc3RfZ2V0IChMaXNwX09iamVjdCBwbGlzdCwgTGlz cF9PYmplY3QgcHJvcCkKK3sKKyAgTGlzcF9PYmplY3QgdGFpbCwgaGFsZnRhaWw7CisgIC8qIGhh bGZ0YWlsIGlzIHVzZWQgdG8gZGV0ZWN0IGNpcmN1bGFyIGxpc3RzLiAgKi8KKyAgdGFpbCA9IGhh bGZ0YWlsID0gcGxpc3Q7CisgIHdoaWxlIChDT05TUCAodGFpbCkgJiYgQ09OU1AgKFhDRFIgKHRh aWwpKSkKKyAgICB7CisgICAgICBpZiAoRVEgKHByb3AsIFhDQVIgKHRhaWwpKSkKKyAgICAgICAg cmV0dXJuIFhDQVIgKFhDRFIgKHRhaWwpKTsKKyAgICAgIHRhaWwgPSBYQ0RSIChYQ0RSICh0YWls KSk7CisgICAgICBoYWxmdGFpbCA9IFhDRFIgKGhhbGZ0YWlsKTsKKyAgICAgIGlmIChFUSAodGFp bCwgaGFsZnRhaWwpKQorICAgICAgICBicmVhazsKKyAgICB9CisgIHJldHVybiBRbmlsOworfQor CisvKiBSRUdJT04gQkVHSU46ICBtY19yZWdpb25fbGltaXQgKDEpCisgICBSRUdJT04gRU5EOiAg bWNfcmVnaW9uX2xpbWl0ICgwKSAqLworcHRyZGlmZl90CittY19yZWdpb25fbGltaXQgKGJvb2wg YmVnaW5fcCkKK3sKKyAgaWYgKCFOSUxQIChWdHJhbnNpZW50X21hcmtfbW9kZSkKKyAgICAgICYm IE5JTFAgKFZtYXJrX2V2ZW5faWZfaW5hY3RpdmUpCisgICAgICAmJiBOSUxQIChCVkFSIChjdXJy ZW50X2J1ZmZlciwgbWFya19hY3RpdmUpKSkKKyAgICB4c2lnbmFsMCAoUW1hcmtfaW5hY3RpdmUp OworICBMaXNwX09iamVjdCBtYXJrZXIgPSBCVkFSIChjdXJyZW50X2J1ZmZlciwgbWFyayk7Cisg IGludCBtID0gKFhNQVJLRVIgKG1hcmtlciktPmJ1ZmZlcikKKyAgICAgICAgICA/IFhNQVJLRVIg KG1hcmtlciktPmNoYXJwb3MKKyAgICAgICAgICA6IC0xOworICByZXR1cm4gKG0gPT0gLTEpCisg ICAgICAgICAgID8gLTEKKyAgICAgICAgIDogKFBUIDwgbSkgPT0gYmVnaW5fcAorICAgICAgICAg ICA/IFBUCisgICAgICAgICA6IGNsaXBfdG9fYm91bmRzIChCRUdWLCBtLCBaVik7Cit9CisKKy8q IENoZWNrIHRoZSBwcmVzZW5jZSBvZiBhIGRpc3BsYXkgcHJvcGVydHkgYW5kIGNvbXB1dGUgaXRz IHdpZHRoLgorICAgSWYgYSBwcm9wZXJ0eSB3YXMgZm91bmQgYW5kIGl0cyB3aWR0aCB3YXMgZm91 bmQgYXMgd2VsbCwgcmV0dXJuCisgICBpdHMgd2lkdGggKD49IDApIGFuZCBzZXQgdGhlIHBvc2l0 aW9uIG9mIHRoZSBlbmQgb2YgdGhlIHByb3BlcnR5CisgICBpbiBFTkRQT1MuCisgICBPdGhlcndp c2UganVzdCByZXR1cm4gLTEuICovCitzdGF0aWMgaW50CittY19jaGVja19kaXNwbGF5X3dpZHRo IChwdHJkaWZmX3QgcG9zLCBwdHJkaWZmX3QgY29sLCBwdHJkaWZmX3QgKmVuZHBvcykKK3sKKyAg TGlzcF9PYmplY3QgdmFsLCBvdmVybGF5OworICBpZiAoQ09OU1AgKHZhbCA9IGdldF9jaGFyX3By b3BlcnR5X2FuZF9vdmVybGF5CisgICAgICAgICAgICAgIChtYWtlX2ZpeG51bSAocG9zKSwgUWRp c3BsYXksIFFuaWwsICZvdmVybGF5KSkKKyAgICAgICYmIEVRIChRc3BhY2UsIFhDQVIgKHZhbCkp KQorICAgIHsgLyogRklYTUU6IFVzZSBjYWxjX3BpeGVsX3dpZHRoX29yX2hlaWdodC4gKi8KKyAg ICAgIExpc3BfT2JqZWN0IHBsaXN0ID0gWENEUiAodmFsKSwgcHJvcDsKKyAgICAgIGludCB3aWR0 aCA9IC0xOworICAgICAgRU1BQ1NfSU5UIGFsaWduX3RvX21heCA9IChjb2wgPCBNT1NUX1BPU0lU SVZFX0ZJWE5VTSAtIElOVF9NQVgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g KEVNQUNTX0lOVCkgSU5UX01BWCArIGNvbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBNT1NUX1BPU0lUSVZFX0ZJWE5VTSk7CisgICAgICBpZiAoKHByb3AgPSBtY19wbGlzdF9n ZXQgKHBsaXN0LCBRQ3dpZHRoKSwgUkFOR0VEX0ZJWE5VTVAgKDAsIHByb3AsIElOVF9NQVgpKQor ICAgICAgICAgIHx8IChwcm9wID0gbWNfcGxpc3RfZ2V0IChwbGlzdCwgUUNyZWxhdGl2ZV93aWR0 aCksCisgICAgICAgICAgICAgIFJBTkdFRF9GSVhOVU1QICgwLCBwcm9wLCBJTlRfTUFYKSkpCisg ICAgICAgIHdpZHRoID0gWEZJWE5VTSAocHJvcCk7CisgICAgICAgIGVsc2UgaWYgKEZMT0FUUCAo cHJvcCkgJiYgMCA8PSBYRkxPQVRfREFUQSAocHJvcCkKKyAgICAgICAgICAgICAgICAgJiYgWEZM T0FUX0RBVEEgKHByb3ApIDw9IElOVF9NQVgpCisgICAgICAgICAgd2lkdGggPSAoaW50KShYRkxP QVRfREFUQSAocHJvcCkgKyAwLjUpOworICAgICAgICAgIGVsc2UgaWYgKChwcm9wID0gbWNfcGxp c3RfZ2V0IChwbGlzdCwgUUNhbGlnbl90byksCisgICAgICAgICAgICAgICAgICAgIFJBTkdFRF9G SVhOVU1QIChjb2wsIHByb3AsIGFsaWduX3RvX21heCkpKQorICAgICAgICAgICAgd2lkdGggPSBY RklYTlVNIChwcm9wKSAtIGNvbDsKKyAgICAgICAgICAgICAgZWxzZSBpZiAoRkxPQVRQIChwcm9w KSAmJiBjb2wgPD0gWEZMT0FUX0RBVEEgKHByb3ApCisgICAgICAgICAgICAgICAgICAgICAgICYm IChYRkxPQVRfREFUQSAocHJvcCkgPD0gYWxpZ25fdG9fbWF4KSkKKyAgICAgICAgICAgICAgICB3 aWR0aCA9IChpbnQpKFhGTE9BVF9EQVRBIChwcm9wKSArIDAuNSkgLSBjb2w7CisgICAgICBpZiAo d2lkdGggPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIHB0cmRpZmZfdCBzdGFydDsKKyAgICAg ICAgICBpZiAoT1ZFUkxBWVAgKG92ZXJsYXkpKQorICAgICAgICAgICAgKmVuZHBvcyA9IE9WRVJM QVlfUE9TSVRJT04gKE9WRVJMQVlfRU5EIChvdmVybGF5KSk7CisgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgIGdldF9wcm9wZXJ0eV9hbmRfcmFuZ2UgKHBvcywgUWRpc3BsYXksICZ2YWws ICZzdGFydCwgZW5kcG9zLCBRbmlsKTsKKyAgICAgICAgICAvKiBGb3IgOnJlbGF0aXZlLXdpZHRo LCB3ZSBuZWVkIHRvIG11bHRpcGx5IGJ5IHRoZSBjb2x1bW4KKyAgICAgICAgICAgICB3aWR0aCBv ZiB0aGUgY2hhcmFjdGVyIGF0IFBPUywgaWYgaXQgaXMgZ3JlYXRlciB0aGFuIDEuICovCisgICAg ICAgICAgaWYgKCFOSUxQIChtY19wbGlzdF9nZXQgKHBsaXN0LCBRQ3JlbGF0aXZlX3dpZHRoKSkK KyAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBlbmFibGVfbXVs dGlieXRlX2NoYXJhY3RlcnMpKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaW50IGIs IHdkOworICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyICpwID0gQllURV9QT1NfQUREUiAoQ0hB Ul9UT19CWVRFIChwb3MpKTsKKyAgICAgICAgICAgICAgTUNfTVVMVElCWVRFX0JZVEVTX1dJRFRI IChwLCBidWZmZXJfZGlzcGxheV90YWJsZSAoKSwgYiwgd2QpOworICAgICAgICAgICAgICB3aWR0 aCAqPSB3ZDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICByZXR1cm4gd2lkdGg7CisgICAgICAg IH0KKyAgICB9CisgIHJldHVybiAtMTsKK30KKworLyogU2Nhbm5pbmcgZnJvbSB0aGU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xlIHRleHQuICovCisgICAgICB3aGlsZSAoc2NhbiA9PSBuZXh0X2JvdW5k YXJ5KQorICAgICAgICB7CisgICAgICAgICAgcHRyZGlmZl90IG9sZF9zY2FuID0gc2NhbjsKKyAg ICAgICAgICAvKiBUaGlzIHVwZGF0ZXMgTkVYVF9CT1VOREFSWSB0byB0aGUgbmV4dCBwbGFjZQor ICAgICAgICAgICAgIHdoZXJlIHdlIG1pZ2h0IG5lZWQgdG8gc2tpcCBtb3JlIGludmlzaWJsZSB0 ZXh0LiAqLworICAgICAgICAgIHNjYW4gPSBza2lwX2ludmlzaWJsZSAoc2NhbiwgJm5leHRfYm91 bmRhcnksIGVuZCwgUW5pbCk7CisgICAgICAgICAgaWYgKHNjYW4gIT0gb2xkX3NjYW4pCisgICAg ICAgICAgICBzY2FuX2J5dGUgPSBDSEFSX1RPX0JZVEUgKHNjYW4pOworICAgICAgICAgIGlmIChz Y2FuID49IGVuZCkKKyAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgfQorICAgICAg LyogVGVzdCByZWFjaGluZyB0aGUgZ29hbCBjb2x1bW4uICBXZSBkbyB0aGlzIGFmdGVyIHNraXBw aW5nCisgICBpbnZpc2libGUgY2hhcmFjdGVycywgc28gdGhhdCB3ZSBwdXQgcG9pbnQgYmVmb3Jl IHRoZQorICAgY2hhcmFjdGVyIG9uIHdoaWNoIHRoZSBjdXJzb3Igd2lsbCBhcHBlYXIuICovCisg ICAgICBpZiAoY29sID49IGdvYWwpCisgICAgICAgIGJyZWFrOworICAgICAgcHJldl9jb2wgPSBj b2w7CisgICAgICB7IC8qIENoZWNrIGRpc3BsYXkgcHJvcGVydHkuICovCisgICAgICAgIHB0cmRp ZmZfdCBlbmRwOworICAgICAgICBpbnQgd2lkdGggPSBtY19jaGVja19kaXNwbGF5X3dpZHRoIChz Y2FuLCBjb2wsICZlbmRwKTsKKyAgICAgICAgaWYgKHdpZHRoID49IDApCisgICAgICAgICAgewor ICAgICAgICAgICAgY29sICs9IHdpZHRoOworICAgICAgICAgICAgaWYgKGVuZHAgPiBzY2FuKSAv KiBBdm9pZCBpbmZpbml0ZSBsb29wcyB3aXRoIDAtd2lkdGggb3ZlcmxheXMuICovCisgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICBzY2FuID0gZW5kcDsKKyAgICAgICAgICAgICAgICBz Y2FuX2J5dGUgPSBDSEFSX1RPX0JZVEUgKHNjYW4pOworICAgICAgICAgICAgICAgIGNvbnRpbnVl OworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgfQorICAgICAgLyogQ2hlY2sg Y29tcG9zaXRpb24gc2VxdWVuY2UuICovCisgICAgICBpZiAoY21wX2l0LmlkID49IDAKKyAgICAg ICAgICB8fCAoc2NhbiA9PSBjbXBfaXQuc3RvcF9wb3MKKyAgICAgICAgICAgICAgJiYgY29tcG9z aXRpb25fcmVzZWF0X2l0ICgmY21wX2l0LCBzY2FuLCBzY2FuX2J5dGUsIGVuZCwgdywgTlVMTCwg UW5pbCkpKQorICAgICAgICBjb21wb3NpdGlvbl91cGRhdGVfaXQgKCZjbXBfaXQsIHNjYW4sIHNj YW5fYnl0ZSwgUW5pbCk7CisgICAgICBpZiAoY21wX2l0LmlkID49IDApCisgICAgICAgIHsKKyAg ICAgICAgICBzY2FuICs9IGNtcF9pdC5uY2hhcnM7CisgICAgICAgICAgc2Nhbl9ieXRlICs9IGNt cF9pdC5uYnl0ZXM7CisgICAgICAgICAgaWYgKHNjYW4gPD0gZW5kKQorICAgICAgICAgICAgY29s ICs9IGNtcF9pdC53aWR0aDsKKyAgICAgICAgICBpZiAoY21wX2l0LnRvID09IGNtcF9pdC5uZ2x5 cGhzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjbXBfaXQuaWQgPSAtMTsKKyAgICAg ICAgICAgICAgY29tcG9zaXRpb25fY29tcHV0ZV9zdG9wX3BvcyAoJmNtcF9pdCwgc2Nhbiwgc2Nh bl9ieXRlLCBlbmQsIFFuaWwpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICBjbXBfaXQuZnJvbSA9IGNtcF9pdC50bzsKKyAgICAgICAgICBjb250aW51ZTsK KyAgICAgICAgfQorICAgICAgYyA9IEZFVENIX0JZVEUgKHNjYW5fYnl0ZSk7CisgICAgICAvKiBT ZWUgaWYgdGhlcmUgaXMgYSBkaXNwbGF5IHRhYmxlIGFuZCBpdCByZWxhdGVzIHRvIHRoaXMgY2hh cmFjdGVyLiAqLworICAgICAgaWYgKGRwICE9IDAKKyAgICAgICAgICAmJiAhIChtdWx0aWJ5dGUg JiYgTEVBRElOR19DT0RFX1AgKGMpKQorICAgICAgICAgICYmIFZFQ1RPUlAgKERJU1BfQ0hBUl9W RUNUT1IgKGRwLCBjKSkpCisgICAgICAgIHsKKyAgICAgICAgICBMaXNwX09iamVjdCBjaGFydmVj OworICAgICAgICAgIHB0cmRpZmZfdCBpLCBuOworICAgICAgICAgIC8qIFRoaXMgY2hhcmFjdGVy IGlzIGRpc3BsYXllZCB1c2luZyBhIHZlY3RvciBvZiBnbHlwaHMuCisgICAgICAgICAgICAgVXBk YXRlIHRoZSBjb2x1bW4vcG9zaXRpb24gYmFzZWQgb24gdGhvc2UgZ2x5cGhzLiAqLworICAgICAg ICAgIGNoYXJ2ZWMgPSBESVNQX0NIQVJfVkVDVE9SIChkcCwgYyk7CisgICAgICAgICAgbiA9IEFT SVpFIChjaGFydmVjKTsKKyAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbjsgaSsrKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICAvKiBUaGlzIHNob3VsZCBiZSBoYW5kbGVkIHRoZSBzYW1l IGFzCisgICAgICAgICAgICAgIG5leHRfZWxlbWVudF9mcm9tX2Rpc3BsYXlfdmVjdG9yIGRvZXMg aXQuICovCisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGVudHJ5ID0gQVJFRiAoY2hhcnZlYywg aSk7CisgICAgICAgICAgICAgIGlmIChHTFlQSF9DT0RFX1AgKGVudHJ5KSkKKyAgICAgICAgICAg ICAgICBjID0gR0xZUEhfQ09ERV9DSEFSIChlbnRyeSk7CisgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICBjID0gJyAnOworICAgICAgICAgICAgICBpZiAoYyA9PSAnXG4nKQorICAg ICAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgICAgaWYgKGMgPT0gJ1xyJyAm JiBFUSAoQlZBUiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKQorICAg ICAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgICAgaWYgKGMgPT0gJ1x0JykK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBjb2wgKz0gdGFiX3dpZHRoOwor ICAgICAgICAgICAgICAgICAgY29sID0gY29sIC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOworICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAr K2NvbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAg eworICAgICAgICAgICAgLyogVGhlIGRpc3BsYXkgdGFibGUgZG9lc24ndCBhZmZlY3QgdGhpcyBj aGFyYWN0ZXI7CisgICAgICAgICAgICAgICBpdCBkaXNwbGF5cyBhcyBpdHNlbGYuICovCisgICAg ICAgICAgICBpZiAoYyA9PSAnXG4nKQorICAgICAgICAgICAgICBnb3RvIGVuZGxvb3A7CisgICAg ICAgICAgICBpZiAoYyA9PSAnXHInICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0 aXZlX2Rpc3BsYXkpLCBRdCkpCisgICAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAg ICAgIGlmIChjID09ICdcdCcpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjb2wg Kz0gdGFiX3dpZHRoOworICAgICAgICAgICAgICAgIGNvbCA9IGNvbCAvIHRhYl93aWR0aCAqIHRh Yl93aWR0aDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChtdWx0aWJ5 dGUgJiYgTEVBRElOR19DT0RFX1AgKGMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgIC8qIFN0YXJ0IG9mIG11bHRpLWJ5dGUgZm9ybS4gKi8KKyAgICAgICAgICAgICAgICAg IHVuc2lnbmVkIGNoYXIgKnB0cjsKKyAgICAgICAgICAgICAgICAgIGludCBieXRlcywgd2lkdGg7 CisgICAgICAgICAgICAgICAgICBwdHIgPSBCWVRFX1BPU19BRERSIChzY2FuX2J5dGUpOworICAg ICAgICAgICAgICAgICAgTUNfTVVMVElCWVRFX0JZVEVTX1dJRFRIIChwdHIsIGRwLCBieXRlcywg d2lkdGgpOworICAgICAgICAgICAgICAgICAgLyogU3VidHJhY3Qgb25lIHRvIGNvbXBlbnNhdGUg Zm9yIHRoZSBpbmNyZW1lbnQKKyAgICAgICAgICAgICAgICAgIHRoYXQgaXMgZ29pbmcgdG8gaGFw cGVuIGJlbG93LiAqLworICAgICAgICAgICAgICAgICAgc2Nhbl9ieXRlICs9IGJ5dGVzIC0gMTsK KyAgICAgICAgICAgICAgICAgIGNvbCArPSB3aWR0aDsKKyAgICAgICAgICAgICAgICB9CisgICAg ICAgICAgICAgICAgZWxzZSBpZiAoY3RsX2Fycm93ICYmIChjIDwgMDQwIHx8IGMgPT0gMDE3Nykp CisgICAgICAgICAgICAgICAgICBjb2wgKz0gMjsKKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYg KGMgPCAwNDAgfHwgYyA+PSAwMTc3KQorICAgICAgICAgICAgICAgICAgICBjb2wgKz0gNDsKKyAg ICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgIGNvbCsrOworICA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ICAgeworICAgICAgICAgIC8qIFdl IHN0b3BwZWQgZWl0aGVyIGZvciB0aGUgYmVnaW5uaW5nIG9mIHRoZSBidWZmZXIKKyAgICAgICAg ICAgICBvciBmb3IgdGhlIGdhcC4gKi8KKyAgICAgICAgICBpZiAocHRyID09IEJFR1ZfQUREUikK KyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIC8qIEl0IHdhcyB0aGUgZ2FwLiAgSnVtcCBi YWNrIG92ZXIgaXQuICovCisgICAgICAgICAgc3RvcCA9IEJFR1ZfQUREUjsKKyAgICAgICAgICBw dHIgPSBHUFRfQUREUjsKKyAgICAgICAgICAvKiBDaGVjayB3aGV0aGVyIHRoYXQgYnJpbmdzIHVz IHRvIGJlZ2lubmluZyBvZiBidWZmZXIuICovCisgICAgICAgICAgaWYgKEJFR1YgPj0gR1BUKQor ICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGMgPSAqLS1wdHI7CisgICAgICBp ZiAoZHAgJiYgVkVDVE9SUCAoRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpKSkKKyAgICAgICAgewor ICAgICAgICAgIGNoYXJ2ZWMgPSBESVNQX0NIQVJfVkVDVE9SIChkcCwgYyk7CisgICAgICAgICAg biA9IEFTSVpFIChjaGFydmVjKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAg eworICAgICAgICAgICAgY2hhcnZlYyA9IFFuaWw7CisgICAgICAgICAgICBuID0gMTsKKyAgICAg ICAgICB9CisgICAgICBmb3IgKGkgPSBuIC0gMTsgaSA+PSAwOyAtLWkpCisgICAgICAgIHsKKyAg ICAgICAgICBpZiAoVkVDVE9SUCAoY2hhcnZlYykpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIC8qIFRoaXMgc2hvdWxkIGJlIGhhbmRsZWQgdGhlIHNhbWUgYXMKKyAgICAgICAgICAgbmV4 dF9lbGVtZW50X2Zyb21fZGlzcGxheV92ZWN0b3IgZG9lcyBpdC4gKi8KKyAgICAgICAgICAgICAg TGlzcF9PYmplY3QgZW50cnkgPSBBUkVGIChjaGFydmVjLCBpKTsKKyAgICAgICAgICAgICAgaWYg KEdMWVBIX0NPREVfUCAoZW50cnkpKQorICAgICAgICAgICAgICAgIGMgPSBHTFlQSF9DT0RFX0NI QVIgKGVudHJ5KTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjID0g JyAnOworICAgICAgICAgICAgfQorICAgICAgICAgIGlmIChjID49IDA0MCAmJiBjIDwgMDE3NykK KyAgICAgICAgICAgIGNvbCsrOworICAgICAgICAgICAgZWxzZSBpZiAoYyA9PSAnXG4nCisgICAg ICAgICAgICAgICAgICAgICB8fCAoYyA9PSAnXHInCisgICAgICAgICAgICAgICAgICAgICAgICAg JiYgRVEgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVfZGlzcGxheSksIFF0KSkpCisg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwdHIrKzsKKyAgICAgICAgICAgICAgICBn b3RvIHN0YXJ0X29mX2xpbmVfZm91bmQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ZWxzZSBpZiAoYyA9PSAnXHQnKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg IGlmICh0YWJfc2VlbikKKyAgICAgICAgICAgICAgICAgICAgY29sID0gKChjb2wgKyB0YWJfd2lk dGgpIC8gdGFiX3dpZHRoKSAqIHRhYl93aWR0aDsKKyAgICAgICAgICAgICAgICAgIHBvc3RfdGFi ICs9IGNvbDsKKyAgICAgICAgICAgICAgICAgIGNvbCA9IDA7CisgICAgICAgICAgICAgICAgICB0 YWJfc2VlbiA9IDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYg KFZFQ1RPUlAgKGNoYXJ2ZWMpKQorICAgICAgICAgICAgICAgICAgLyogV2l0aCBhIGRpc3BsYXkg dGFibGUgZW50cnksIEMgaXMgZGlzcGxheWVkIGFzIGlzLCBhbmQKKyAgICAgICAgICAgICAgICAg ICAgIG5vdCBkaXNwbGF5ZWQgYXMgXE5OTiBvciBhcyBeTi4gIElmIEMgaXMgYSBzaW5nbGUtYnl0 ZQorICAgICAgICAgICAgICAgICAgICAgY2hhcmFjdGVyLCBpdCB0YWtlcyBvbmUgY29sdW1uLiAg SWYgQyBpcyBtdWx0aS1ieXRlIGluCisgICAgICAgICAgICAgICAgICAgICBhIHVuaWJ5dGUgYnVm ZmVyLCBpdCdzIHRyYW5zbGF0ZWQgdG8gdW5pYnl0ZSwgc28gaXQKKyAgICAgICAgICAgICAgICAg ICAgIGFsc28gdGFrZXMgb25lIGNvbHVtbi4gKi8KKyAgICAgICAgICAgICAgICAgICsrY29sOwor ICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICBjb2wgKz0gKGN0bF9h cnJvdyAmJiBjIDwgMDIwMCkgPyAyIDogNDsKKyAgICAgICAgfQorICAgIH0KKyBzdGFydF9vZl9s aW5lX2ZvdW5kOgorICBpZiAodGFiX3NlZW4pCisgICAgeworICAgICAgY29sID0gKChjb2wgKyB0 YWJfd2lkdGgpIC8gdGFiX3dpZHRoKSAqIHRhYl93aWR0aDsKKyAgICAgIGNvbCArPSBwb3N0X3Rh YjsKKyAgICB9CisgIGxhc3Rfa25vd25fY29sdW1uID0gY29sOworICBsYXN0X2tub3duX2NvbHVt bl9wb2ludCA9IHB0OworICBsYXN0X2tub3duX2NvbHVtbl9tb2RpZmllZCA9IE1PRElGRjsKKyAg aWYgKG9sZF9idWZmZXIpCisgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7Cisg IHJldHVybiBjb2w7Cit9CisKK0RFRlVOICgibWMtY3VycmVudC1jb2x1bW4iLCBGbWNfY3VycmVu dF9jb2x1bW4sIFNtY19jdXJyZW50X2NvbHVtbiwgMiwgMiwgMCwKKyAgICAgICBkb2M6IC8q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ZGVf bGl2ZV93aW5kb3cgKHdpbmRvdyk7CisgIExpc3BfT2JqZWN0IHRlbXA7CisgIFhTRVRGQVNUSU5U ICh0ZW1wLCBtY19jdXJyZW50X2NvbHVtbiAodywgWEZJWE5VTSAocHQpKSk7CisgIHJldHVybiB0 ZW1wOworfQorCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIkZSQU1FICglcykiLCBtY19m cmFtZSAoZikpOyAqLworY2hhciAqCittY19mcmFtZSAoc3RydWN0IGZyYW1lICpmKQoreworICBM aXNwX09iamVjdCBmcmFtZTsKKyAgWFNFVEZSQU1FIChmcmFtZSwgZik7CisgIHJldHVybiBTU0RB VEEgKEZwcmluMV90b19zdHJpbmcgKGZyYW1lLCBRbmlsKSk7Cit9CisKKy8qIFVTQUdFOiAgZnBy aW50ZiAoc3RkZXJyLCAiV0lORE9XICglcykiLCBtY193aW5kb3cgKHcpKTsgKi8KK2NoYXIgKgor bWNfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3KQoreworICBMaXNwX09iamVjdCB3aW5kb3c7Cisg IFhTRVRXSU5ET1cgKHdpbmRvdywgdyk7CisgIHJldHVybiBTU0RBVEEgKEZwcmluMV90b19zdHJp bmcgKHdpbmRvdywgUW5pbCkpOworfQorCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIkNI QVJBQ1RFUiAoJXMpIiwgbWNfY2hhcl90b19zdHJpbmcgKGdseXBoLT51LmNoKSk7ICovCitjaGFy ICoKK21jX2NoYXJfdG9fc3RyaW5nIChpbnQgYXJnKQoreworICBMaXNwX09iamVjdCBjaGFyYWN0 ZXIgPSAoMCA8PSBhcmcgJiYgYXJnIDw9IE1BWF9DSEFSKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBGY2hhcl90b19zdHJpbmcgKG1ha2VfZml4bnVtIChhcmcpKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiBRbmlsOworICBjaGFyICogcmVzdWx0ID0gKCFOSUxQIChjaGFyYWN0 ZXIpCisgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDkpCisgICAgICAgICAgICAgICAgICAg ID8gIlxcdCIKKyAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAg ICAgICAgICAgICAgICAmJiBhcmcgPT0gMTApCisgICAgICAgICAgICAgICAgICAgID8gIlxcbiIK KyAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAg ICAgICAmJiBhcmcgPT0gMzIpCisgICAgICAgICAgICAgICAgICAgID8gIlxccyIKKyAgICAgICAg ICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAgICAmJiBh cmcgIT0gOQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9IDEwCisgICAgICAgICAgICAg ICAgICAgICAmJiBhcmcgIT0gMzIpCisgICAgICAgICAgICAgICAgICAgID8gU1NEQVRBIChjaGFy YWN0ZXIpCisgICAgICAgICAgICAgICAgICA6ICJcXD8iOworICByZXR1cm4gcmVzdWx0OworfQor CitpbnQKK21jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKExpc3BfT2JqZWN0IGFyZykKK3sKKyAgY2hh ciAqc3RyOworICBpZiAoWFRZUEUgKGFyZykgPT0gTGlzcF9TdHJpbmcpCisgICAgc3RyID0gU1NE QVRBIChhcmcpOworICAgIGVsc2UgaWYgKFhUWVBFIChhcmcpID09IExpc3BfU3ltYm9sKQorICAg ICAgc3RyID0gU1NEQVRBIChTWU1CT0xfTkFNRSAoYXJnKSk7CisgICAgICBlbHNlIHJldHVybiAt MTsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgIm5vIikpCisgICAgcmV0dXJuIE1DX05PX0NVUlNPUjsK KyAgaWYgKCFzdHJjbXAgKHN0ciwgIm1jLWxlZnQtZnJpbmdlLWJpdG1hcCIpKQorICAgIHJldHVy biBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA7CisgIGlmICghc3RyY21wIChzdHIsICJtYy1yaWdodC1m cmluZ2UtYml0bWFwIikpCisgICAgcmV0dXJuIE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA7CisgIGlm ICghc3RyY21wIChzdHIsICJib3giKSkKKyAgICByZXR1cm4gTUNfRklMTEVEX0JPWDsKKyAgaWYg KCFzdHJjbXAgKHN0ciwgImZyYW1lZCIpKQorICAgIHJldHVybiBNQ19GUkFNRURfQk9YOworICBp ZiAoIXN0cmNtcCAoc3RyLCAiaG9sbG93IikpCisgICAgcmV0dXJuIE1DX0hPTExPV19CT1g7Cisg IGlmICghc3RyY21wIChzdHIsICJiYXIiKSkKKyAgICByZXR1cm4gTUNfQkFSOworICBpZiAoIXN0 cmNtcCAoc3RyLCAiaGJhciIpKQorICAgIHJldHVybiBNQ19IQkFSOworICByZXR1cm4gLTE7Cit9 CisKKy8qIFVTQUdFOiAgZnByaW50ZiAoc3RkZXJyLCAiQ1VSU09SIFRZUEUgKCVzKSIsIG1jX2N1 cnNvcl90eXBlX3RvX3N0cmluZyAoYXJnKSk7ICovCitjaGFyICoKK21jX2N1cnNvcl90eXBlX3Rv X3N0cmluZyAoZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSkKK3sKKyAgc3dpdGNoIChj dXJzb3JfdHlwZSkKKyAgICB7CisgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6IHJldHVybiAiTUNf RklMTEVEX0JPWCI7CisgICAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6IHJldHVybiAiTUNfRlJBTUVE X0JPWCI7CisgICAgICBjYXNlIE1DX0hPTExPV19CT1g6IHJldHVybiAiTUNfSE9MTE9XX0JPWCI7 CisgICAgICBjYXNlIE1DX0JBUjogcmV0dXJuICJNQ19CQVIiOworICAgICAgY2FzZSBNQ19IQkFS OiByZXR1cm4gIk1DX0hCQVIiOworICAgICAgY2FzZSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA6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19BUkVB OiByZXR1cm4gIlhfRklYX09WRVJMQVBQSU5HX0FSRUEiOworICAgICAgY2FzZSBEUkFXX1JPV19X SVRIX01PVVNFX0ZBQ0U6IHJldHVybiAiRFJBV19ST1dfV0lUSF9NT1VTRV9GQUNFIjsKKyAgICAg IGNhc2UgRVhQT1NFX0FSRUFfT05FOiByZXR1cm4gIkVYUE9TRV9BUkVBX09ORSI7CisgICAgICBj YXNlIEVYUE9TRV9BUkVBX1RXTzogcmV0dXJuICJFWFBPU0VfQVJFQV9UV08iOworICAgICAgY2Fz ZSBFWFBPU0VfTElORTogcmV0dXJuICJFWFBPU0VfTElORSI7CisgICAgICBkZWZhdWx0OgorICAg ICAgcmV0dXJuICJVTktOT1dOIjsKKyAgICB9Cit9CisKK3ZvaWQKK21jX2NhY2hlX2luc3BlY3Rv ciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IG1jX21hdHJpeCBtYXRyaXgpCit7CisgIGludCB2 cG9zX2FsbG9jYXRlZCA9IHctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZDsKKyAgaW50IHZwb3Nf dXNlZCA9IHctPm1jX21hdHJpeC52cG9zX3VzZWQ7CisgIGZwcmludGYgKHN0ZGVyciwgIiVzOiAg bWF0cml4LnZwb3NfYWxsb2NhdGVkICglZCkgfCBtYXRyaXgudnBvc191c2VkICglZClcbiIsCisg ICAgICAgICAgICAgICAgICAgbWNfd2luZG93ICh3KSwgdnBvc19hbGxvY2F0ZWQsIHZwb3NfdXNl ZCk7CisgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAg ICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsK KyAgICAgIGludCBjdXJzb3JzX3VzZWQgPSB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hl X3R5cGVdOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICBtYXRyaXguY3Vyc29yc191c2VkWyVz XSAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICBtY19jYWNoZV90eXBlX3RvX3N0cmlu ZyAoY2FjaGVfdHlwZSksIGN1cnNvcnNfdXNlZCk7CisgICAgfQorICBmb3IgKGludCB2bnRoID0g MDsKKyAgICAgICB2bnRoIDwgdy0+bWNfbWF0cml4LnZwb3NfdXNlZDsKKyAgICAgICArK3ZudGgp CisgICAgeworICAgICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NB Q0hFOworICAgICAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgICAgICsrY2Fj aGVfdHlwZSkKKyAgICAgICAgeworICAgICAgICAgIGludCBjYWNoZV9hbGxvY2F0ZWQgPSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV07CisgICAgICAg ICAgaW50IGNhY2hlX3VzZWQgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2Nh Y2hlX3R5cGVdOworICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgICB2bnRoICglZCkgfCBj YWNoZV9hbGxvY2F0ZWRbJXNdICglZCkgfCBjYWNoZV91c2VkWyVzXSAoJWQpXG4iLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgdm50aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1j X2NhY2hlX3R5cGVfdG9fc3RyaW5nIChjYWNoZV90eXBlKSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgIGNhY2hlX2FsbG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2Nh Y2hlX3R5cGVfdG9fc3RyaW5nIChjYWNoZV90eXBlKSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgIGNhY2hlX3VzZWQpOworICAgICAgICB9CisgICAgfQorfQor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mlsbF9jb2wgPSBYRklYTlVNIChCVkFSIChiLCBmaWxsX2NvbHVtbikpOworICBpbnQgaHNj bF94ID0gdy0+aHNjcm9sbCAqIGZyYW1lX2NoYXJfd2lkdGg7CisgIGlmIChiICE9IGN1cnJlbnRf YnVmZmVyKQorICAgIHsKKyAgICAgIG9sZF9idWZmZXIgPSBjdXJyZW50X2J1ZmZlcjsKKyAgICAg IHNldF9idWZmZXJfaW50ZXJuYWwgKGIpOworICAgIH0KKyAgZXNzZW50aWFscy0+enYgPSBaVjsK KyAgZXNzZW50aWFscy0+enZfYnl0ZSA9IFpWX0JZVEU7CisgIGVzc2VudGlhbHMtPmZjX3ggPSAo ZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChWZGlzcGxheV9s aW5lX251bWJlcnMpKQorICAgICAgICAgICAgICAgICAgICAgICA/IChmaWxsX2NvbCAqIGZyYW1l X2NoYXJfd2lkdGgpICsgdy0+bWMubG51bV9waXhlbF93aWR0aCAtIGhzY2xfeAorICAgICAgICAg ICAgICAgICAgICAgOiAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAgICAgICAgJiYg TklMUCAoVmRpc3BsYXlfbGluZV9udW1iZXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgPyAo ZmlsbF9jb2wgKiBmcmFtZV9jaGFyX3dpZHRoKSAtIGhzY2xfeAorICAgICAgICAgICAgICAgICAg ICAgOiAwOworICBpZiAob2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRf YnVmZmVyKTsKKyAgZW51bSBmYWNlX2lkIGZpbGxfY29sdW1uX3ByZV96dl9mYWNlX2lkID0KKyAg ICAoIWVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAmJiBOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICAgID8gbG9va3VwX25hbWVk X2ZhY2UgKHcsIGYsIGludGVybiAoImZjLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisg ICAgOiAoIWVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgZmNfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAgJiYgIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgJiYgIU5J TFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAmJiB3LT5jdXJzb3IueCA9 PSBlc3NlbnRpYWxzLT5mY194KQorICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiZmMtb3BvaW50LWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAgOiAoZXNz ZW50aWFscy0+YWN0aXZlX3AKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGlj YWxfcnVsZXIpKQorICAgICAgICYmIHctPmN1cnNvci54ID09IGVzc2VudGlhbHMtPmZjX3gpCisg ICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1vcG9pbnQtcHJlLXp2 LWZhY2UiKSwgdHJ1ZSkKKyAgICA6ICghZXNzZW50aWFscy0+YWN0aXZlX3AKKyAgICAgICAmJiAh TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY19pbmFjdGl2ZV93aW5kb3dzKSkK KyAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29ud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KKyAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwg Y2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICYmIHctPmN1cnNvci54ID09IGVzc2VudGlhbHMt PmZjX3gpCisgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1vcG9p bnQtYXQtenYtZmFjZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAg ICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dp bmRvd3MpKQorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNy b3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikp CisgICAgICAgJiYgdy0+Y3Vyc29yLnggIT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8gbG9v a3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLWluYWN0aXZlLWF0LXp2LWZhY2UiKSwg dHJ1ZSkKKyAgICA6IChlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAgICYmICFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQIChC VkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgJiYgdy0+Y3Vyc29yLnggIT0gZXNz ZW50aWFscy0+ZmNfeCkKKyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAo ImZjLWF0LXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICA6IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBp bnRlcm4gKCJmYy1hdC16di1mYWNlIiksIHRydWUpOworICBzdHJ1Y3QgZmFjZSAqZmlsbF9jb2x1 bW5fYXRfenZfZmFj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NvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAg JiYgIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAmJiB3LT5jdXJz b3IueCA9PSBlc3NlbnRpYWxzLT5mY194KQorICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywg ZiwgaW50ZXJuICgiZmMtb3BvaW50LWluYWN0aXZlLXBvc3QtenYtZmFjZSIpLCB0cnVlKQorICAg IDogKGVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNo X3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAmJiB3LT5jdXJzb3IueCA9PSBlc3NlbnRpYWxzLT5m Y194KQorICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiZmMtb3BvaW50 LXBvc3QtenYtZmFjZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAg ICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dp bmRvd3MpKQorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNy b3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikp CisgICAgICAgJiYgdy0+Y3Vyc29yLnggIT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8gbG9v a3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLWluYWN0aXZlLXBvc3QtenYtZmFjZSIp LCB0cnVlKQorICAgIDogKGVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAgKEJW QVIgKFh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X2N1cnJlbnRfY29sdW1u ICh3LCBwb3NpbnQpOworICAgICAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y29udGVudHM7CisgICAg ICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgICAgICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAo YnVmKTsKKyAgICAgIGJvb2wgZmlsbF9jb2x1bW5fcCA9ICFOSUxQIChCVkFSIChiLCBmaWxsX2Nv bHVtbikpOworICAgICAgaW50IGZpbGxfY29sID0gKGZpbGxfY29sdW1uX3ApCisgICAgICAgICAg ICAgICAgICAgICA/IFhGSVhOVU0gKEJWQVIgKGIsIGZpbGxfY29sdW1uKSkKKyAgICAgICAgICAg ICAgICAgICAgIDogMDsKKyAgICAgIGVudW0gZmFjZV9pZCBldmVuX2ZhY2VfaWQgPQorICAgICAg ICAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgPyBsb29rdXBf bmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1ldmVuLWluYWN0aXZlLXByZS16di1mYWNlIiks IHRydWUpCisgICAgICAgIDogbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistZXZl bi1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgIHN0cnVjdCBmYWNlICpldmVuX2ZhY2UgPSBG QUNFX0ZST01fSUQgKGYsIGV2ZW5fZmFjZV9pZCk7CisgICAgICBMaXNwX09iamVjdCBldmVuX2Nv bG9yID0gZXZlbl9mYWNlLT5sZmFjZVtMRkFDRV9GT1JFR1JPVU5EX0lOREVYXTsKKyAgICAgIHN0 cnVjdCBtY19SR0IgZXZlbl9mb3JlZ3JvdW5kOworICAgICAgbWNfeHdfY29sb3JfdmFsdWVzICh3 LCBldmVuX2NvbG9yLCAmZXZlbl9mb3JlZ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GwtcHJlLXp2LWZhY2Ui KSwgdHJ1ZSk7CisgICAgICBzdHJ1Y3QgZmFjZSAqYmV5b25kX2ZpbGxfZmFjZSA9IEZBQ0VfRlJP TV9JRCAoZiwgYmV5b25kX2ZpbGxfZmFjZV9pZCk7CisgICAgICBMaXNwX09iamVjdCBiZXlvbmRf ZmlsbF9jb2xvciA9IGJleW9uZF9maWxsX2ZhY2UtPmxmYWNlW0xGQUNFX0ZPUkVHUk9VTkRfSU5E RVhdOworICAgICAgc3RydWN0IG1jX1JHQiBiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kOworICAgICAg bWNfeHdfY29sb3JfdmFsdWVzICh3LCBiZXlvbmRfZmlsbF9jb2xvciwgJmJleW9uZF9maWxsX2Zv cmVncm91bmQpOworICAgICAgLyogcmVkICovCisgICAgICBpZiAoKCFmaWxsX2NvbHVtbl9wCisg ICAgICAgICAgICYmIGN1cnJlbnRfY29sICUgMiAhPSAwCisgICAgICAgICAgICYmIHJvd19wb3Np dGlvbiA9PSBQUkVfWlYpCisgICAgICAgICAgfHwgKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAg ICAgJiYgY3VycmVudF9jb2wgJSAyICE9IDAKKyAgICAgICAgICAgICAgJiYgY3VycmVudF9jb2wg PD0gZmlsbF9jb2wKKyAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikpCisg ICAgICAgIHsKKyAgICAgICAgICBsc2xfZmctPnJlZCA9IG9kZF9mb3JlZ3JvdW5kLnJlZDsKKyAg ICAgICAgICBsc2xfZmctPmdyZWVuID0gb2RkX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAg bHNsX2ZnLT5ibHVlID0gb2RkX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgfQorICAgICAgICAv KiB5ZWxsb3cgKi8KKyAgICAgICAgZWxzZSBpZiAoKCFmaWxsX2NvbHVtbl9wCisgICAgICAgICAg ICAgICAgICAmJiBjdXJyZW50X2NvbCAlIDIgPT0gMAorICAgICAgICAgICAgICAgICAgJiYgcm93 X3Bvc2l0aW9uID09IFBSRV9aVikKKyAgICAgICAgICAgICAgICAgfHwgKGZpbGxfY29sdW1uX3AK KyAgICAgICAgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sICUgMiA9PSAwCisgICAgICAgICAg ICAgICAgICAgICAmJiBjdXJyZW50X2NvbCA8PSBmaWxsX2NvbAorICAgICAgICAgICAgICAgICAg ICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikpCisgICAgICAgICAgeworICAgICAgICAgICAg bHNsX2ZnLT5yZWQgPSBldmVuX2ZvcmVncm91bmQucmVkOworICAgICAgICAgICAgbHNsX2ZnLT5n cmVlbiA9IGV2ZW5fZm9yZWdyb3VuZC5ncmVlbjsKKyAgICAgICAgICAgIGxzbF9mZy0+Ymx1ZSA9 IGV2ZW5fZm9yZWdyb3VuZC5ibHVlOworICAgICAgICAgIH0KKyAgICAgICAgICAvKiBncmVlbiAq LworICAgICAgICAgIGVsc2UgaWYgKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICAm JiBjdXJyZW50X2NvbCA+IGZpbGxfY29sCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0 aW9uID09IFBSRV9aVikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbHNsX2ZnLT5yZWQg PSBiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kLnJlZDsKKyAgICAgICAgICAgICAgbHNsX2ZnLT5ncmVl biA9IGJleW9uZF9maWxsX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAgICAgIGxzbF9mZy0+ Ymx1ZSA9IGJleW9uZF9maWxsX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgICAgIGVsc2UgaWYgKHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgIGxzbF9mZy0+cmVkID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mdyZWVuID0gZXNzZW50aWFscy5jaF9mZ1tyb3dfcG9zaXRpb25dLmdyZWVuOworICAg ICAgbHNsX2ZnLT5ibHVlID0gZXNzZW50aWFscy5jaF9mZ1tyb3dfcG9zaXRpb25dLmJsdWU7Cisg ICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7CisgICAgICBs c2xfZmctPnJlZCA9IGVzc2VudGlhbHMuZmNfZmdbcm93X3Bvc2l0aW9uXS5yZWQ7CisgICAgICBs c2xfZmctPmdyZWVuID0gZXNzZW50aWFscy5mY19mZ1tyb3dfcG9zaXRpb25dLmdyZWVuOworICAg ICAgbHNsX2ZnLT5ibHVlID0gZXNzZW50aWFscy5mY19mZ1tyb3dfcG9zaXRpb25dLmJsdWU7Cisg ICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBDVVJTT1JfSU5ESUNBVE9SOgorICAgIHsKKyAg ICAgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICAgICAgZW51bSBmYWNl X2lkIGN1cnNvcl9mYWNlX2lkID0KKyAgICAgICAgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAg ICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2ZV93 aW5kb3dzKSkKKyAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpCisgICAgICAgICAg PyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWlu YWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogKGVzc2VudGlhbHMuYWN0aXZl X3AKKyAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikKKyAgICAgICAgICA/IGxv b2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2 LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgOiAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAg ICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVfd2lu ZG93cykpCisgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAgICAg ID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1p bmFjdGl2ZS1hdC16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogKGVzc2VudGlhbHMuYWN0aXZl X3AKKyAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IEFUX1pWKQorICAgICAgICAgID8gbG9v a3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1hdC16di1m YWNlIiksIHRydWUpCisgICAgICAgIDogbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAo IistcmVhbC1mYWtlLWN1cnNvci1hdC16di1mYWNlIiksIHRydWUpOworICAgICAgc3RydWN0IGZh Y2UgKmN1cnNvcl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBjdXJzb3JfZmFjZV9pZCk7CisgICAg ICBMaXNwX09iamVjdCBjdXJzb3JfY29sb3IgPSBjdXJzb3JfZmFjZS0+bGZhY2VbTEZBQ0VfRk9S RUdST1VORF9JTkRFWF07CisgICAgICBtY194d19jb2xvcl92YWx1ZXMgKHcsIGN1cnNvcl9jb2xv ciwgbHNsX2ZnKTsKKyAgICAgIGJyZWFrOworICAgIH0KKyAgfQorfQorCisvKiBEcmF3IGdseXBo cyBiZXR3ZWVuIFNUQVJUIGFuZCBFTkQgaW4gQVJFQSBvZiBST1cgb24gd2luZG93IFcsCisgICBz dGFydGluZyBhdCB4LXBvc2l0aW9uIFguICBYIGlzI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idWlsdCBhYm92ZS4g Ki8KKyAgaWYgKGhlYWQgJiYgIW92ZXJsYXBzICYmIHJvdy0+Y29udGFpbnNfb3ZlcmxhcHBpbmdf Z2x5cGhzX3ApCisgICAgeworICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqaCwgKnQ7CisgICAg ICBNb3VzZV9ITEluZm8gKmhsaW5mbyA9IE1PVVNFX0hMX0lORk8gKGYpOworICAgICAgaW50IG1v dXNlX2JlZ19jb2wgVU5JTklULCBtb3VzZV9lbmRfY29sIFVOSU5JVDsKKyAgICAgIGJvb2wgY2hl Y2tfbW91c2VfZmFjZSA9IGZhbHNlOworICAgICAgaW50IGR1bW15X3ggPSAwOworICAgICAgLyog SWYgbW91c2UgaGlnaGxpZ2h0aW5nIGlzIG9uLCB3ZSBtYXkgbmVlZCB0byBkcmF3IGFkamFjZW50 CisgICBnbHlwaHMgdXNpbmcgbW91c2UtZmFjZSBoaWdobGlnaHRpbmcuICovCisgICAgICBpZiAo YXJlYSA9PSBURVhUX0FSRUEgJiYgcm93LT5tb3VzZV9mYWNlX3AKKyAgICAgICAgICAmJiBobGlu Zm8tPm1vdXNlX2ZhY2VfYmVnX3JvdyA+PSAwCisgICAgICAgICAgJiYgaGxpbmZvLT5tb3VzZV9m YWNlX2VuZF9yb3cgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIHB0cmRpZmZfdCByb3dfdnBv cyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCB3LT5jdXJyZW50X21hdHJpeCk7CisgICAgICAgICAg aWYgKHJvd192cG9zID49IGhsaW5mby0+bW91c2VfZmFjZV9iZWdfcm93CisgICAgICAgICAgICAg ICYmIHJvd192cG9zIDw9IGhsaW5mby0+bW91c2VfZmFjZV9lbmRfcm93KQorICAgICAgICAgICAg eworICAgICAgICAgICAgICBjaGVja19tb3VzZV9mYWNlID0gdHJ1ZTsKKyAgICAgICAgICAgICAg bW91c2VfYmVnX2NvbCA9IChyb3dfdnBvcyA9PSBobGluZm8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09IERSQVdfQ1VSU09SIGFuZCB0aGUgU1RSRVRDSF9HTFlQSCBpcyBgbGVmdF9vdmVy d3JpdHRlbmAuICBEcmF3aW5nCisgICAgICAgICAgbm9ybWFsIHRleHQgZHVyaW5nIGB1cGRhdGVf d2luZG93JyAoRFJBV19OT1JNQUxfVEVYVCkgY2FuIGFsc28gZXJhc2UgZmFrZQorICAgICAgICAg IGN1cnNvcnMgdGhhdCBhcmUgYGxlZnRfb3ZlcndyaXR0ZW4nLiAqLworICAgICAgICAgIGxlbmd0 aCA9IDA7CisgICAgICAgICAgZm9yIChzID0gaDsgczsgcyA9IHMtPm5leHQpCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIHMtPmxlZnRfb3ZlcndyaXR0ZW5fcCA9IHRydWU7CisgICAgICAg ICAgICAgIHMtPmFjdGlvbl90eXBlID0gYWN0aW9uX3R5cGU7CisgICAgICAgICAgICAgIGxlbmd0 aCArPSBzLT5maXJzdF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAg ICAgcmVsYXRpdmVfeCA9IHN0YXJ0X3ggLSBsZW5ndGg7CisgICAgICAgICAgZm9yIChzID0gaDsg czsgcyA9IHMtPm5leHQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHMtPmZpcnN0X2ds eXBoLT5yZWxhdGl2ZV94ID0gcmVsYXRpdmVfeDsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCAr PSBzLT5maXJzdF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgICAg c3RhcnQgPSBpOworICAgICAgICAgIGNvbXB1dGVfb3ZlcmhhbmdzX2FuZF94ICh0LCBoZWFkLT54 LCB0cnVlKTsKKyAgICAgICAgICBwcmVwZW5kX2dseXBoX3N0cmluZ19saXN0cyAoJmhlYWQsICZ0 YWlsLCBoLCB0KTsKKyAgICAgICAgICBpZiAoY2xpcF9oZWFkID09IE5VTEwpCisgICAgICAgIC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Ck7CisgICAgICBpZiAoaSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgZW51bSBk cmF3X2dseXBoc19mYWNlIG92ZXJsYXBfaGw7CisgICAgICAgICAgaWYgKGNoZWNrX21vdXNlX2Zh Y2UKKyAgICAgICAgICAgICAgJiYgbW91c2VfYmVnX2NvbCA8IGkgJiYgbW91c2VfZW5kX2NvbCA+ IGVuZCkKKyAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX01PVVNFX0ZBQ0U7CisgICAgICAg ICAgICBlbHNlCisgICAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX05PUk1BTF9URVhUOwor ICAgICAgICAgIGlmIChobCA9PSBvdmVybGFwX2hsIHx8IGNsaXBfdGFpbCA9PSBOVUxMKQorICAg ICAgICAgICAgY2xpcF90YWlsID0gdGFpbDsKKyAgICAgICAgICBpKys7ICAgICAgLyogV2UgbXVz dCBpbmNsdWRlIHRoZSBJdGggZ2x5cGguICovCisgICAgICAgICAgTUNfQlVJTERfR0xZUEhfU1RS SU5HUyAoZW5kLCBpLCBoLCB0LCBvdmVybGFwX2hsLCB4LCBsYXN0X3gpOworICAgICAgICAgIGZv ciAocyA9IGg7IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxs ZWRfcCA9IHRydWU7CisgICAgICAgICAgY29tcHV0ZV9vdmVyaGFuZ3NfYW5kX3ggKGgsIHRhaWwt PnggKyB0YWlsLT53aWR0aCwgZmFsc2UpOworICAgICAgICAgIGFwcGVuZF9nbHlwaF9zdHJpbmdf bGlzdHMgKCZoZWFkLCAmdGFpbCwgaCwgdCk7CisgICAgICAgIH0KKyAgICAgIHRhaWwgPSBnbHlw aF9zdHJpbmdfY29udGFpbmluZ19iYWNrZ3JvdW5kX3dpZHRoICh0YWlsKTsKKyAgICAgIGlmIChj bGlwX3RhaWwpCisgICAgICAgIGNsaXBfdGFpbCA9IGdseXBoX3N0cmluZ19jb250YWluaW5nX2Jh Y2tncm91bmRfd2lkdGggKGNsaXBfdGFpbCk7CisgICAgICBpZiAoY2xpcF9oZWFkIHx8IGNsaXBf dGFpbCkKKyAgICAgICAgZm9yIChzID0gaGVhZDsgczsgcyA9IHMtPm5leHQpCisgICAgICAgICAg eworICAgICAgICAgICAgcy0+Y2xpcF9oZWFkID0gY2xpcF9oZWFkOworICAgICAgICAgICAgcy0+ Y2xpcF90YWlsID0gY2xpcF90YWlsOworICAgICAgICAgIH0KKyAgICB9CisgIC8qIERyYXcgYWxs IHN0cmluZ3MuICovCisgIGZvciAocyA9IGhlYWQ7IHMgJiYgZHJhd19wOyBzID0gcy0+bmV4dCkK KyAgICBGUkFNRV9SSUYgKGYpLT5tY19zY3JpYmVfc3RyaW5nIChzLCBtYXRyaXgsIHJvdywgbHNs LCBnbHlwaF9mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vy c29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworI2lmbmRlZiBIQVZFX05TCisg IC8qIFdoZW4gZm9jdXMgYSBzb2xlIGZyYW1lIGFuZCBtb3ZlIGhvcml6b250YWxseSwgdGhpcyBj bGVhcnMgb25fcAorICAgICBjYXVzaW5nIGEgZmFpbHVyZSB0byBlcmFzZSBwcmV2IGN1cnNvciBw b3NpdGlvbi4gKi8KKyAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBCisgICAgICAmJiAhcm93LT5mdWxs X3dpZHRoX3AKKyAgICAgIC8qIFdoZW4gZHJhd2luZyBvdmVybGFwcGluZyByb3dzLCBvbmx5IHRo ZSBnbHlwaCBzdHJpbmdzJworICAgICAgZm9yZWdyb3VuZCBpcyBkcmF3biwgd2hpY2ggZG9lc24n dCBlcmFzZSBhIGN1cnNvciBjb21wbGV0ZWx5LiAqLworICAgICAgJiYgIW92ZXJsYXBzKQorICAg IHsKKyAgICAgIGludCB4MCA9IGNsaXBfaGVhZCA/IGNsaXBfaGV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cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGds eXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFj ZSBobCwgaW50IHgsIGludCBocG9zLCBpbnQgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICBz dHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLAorICAgICAgICAg ICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUsIGludCB3ZCwgYm9v bCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICBib29sIGN1cnNvcl9nY19wKQorewor ICAvLyAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3 LCBtYXRyaXgsIHJvdywgaHBvcywgdnBvcyk7CisgIC8vICBmcHJpbnRmIChzdGRlcnIsICJtY19k cmF3X2N1cnNvcl9nbHlwaDogIGNoICglZCkgfCB4ICglZCksIGhwb3MgKCVkKSwgdnBvcyglZCks IGhsICglZClcbiIsCisgIC8vICAgICAgICAgICAgICAgICAgICBjdXJzb3JfZ2x5cGgtPnUuY2gs IHgsIGhwb3MsIHZwb3MsIGhsKTsKKyAgYmxvY2tfaW5wdXQgKCk7CisgIGJvb2wgZHJhd19wID0g dHJ1ZTsKKyAgbWNfZHJhd19nbHlwaHMgKHcsIG1hdHJpeCwgcm93LCB4LCBURVhUX0FSRUEsIGhw b3MsIGhwb3MgKyAxLCBobCwgMCwgdnBvcywgbHNsLAorICAgICAgICAgICAgICAgICAgZ2x5cGhf Zmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCwKKyAgICAgICAg ICAgICAgICAgIE1DX0RSQVdfR0xZUEhfU1RSSU5HLCBkcmF3X3ApOworICB1bmJsb2NrX2lucHV0 ICgpOworICAvKiBXaGVuIHdlIGVyYXNlIHRoZSBjdXJzb3IsIGFuZCBST1cgaXMgb3ZlcmxhcHBl ZCBieSBvdGhlciByb3dzLCBtYWtlCisgIHN1cmUgdGhhdCB0aGVzZSBvdmVybGFwcGluZyBwYXJ0 cyBvZiBvdGhlciByb3dzIGFyZSByZWRyYXduLiAqLworICBpZiAoaGwgPT0gRFJBV19OT1JNQUxf VEVYVCAmJiByb3ctPm92ZXJsYXBwZWRfcCkKKyAgICB7CisgICAgICBpZiAocm93ID4gbWF0cml4 LT5yb3dzCisgICAgICAgICAgJiYgTUFUUklYX1JPV19PVkVSTEFQU19TVUNDX1AgKHJvdyAtIDEp KQorICAgICAgICB4X2ZpeF9vdmVybGFwcGluZ19hcmVhICh3LCByb3cgLSAxLCBURVhUX0FSRUEs IE9WRVJMQVBTX0VSQVNFRF9DVVJTT1IpOworICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kg KHJvdykgPCB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAmJiBNQVRSSVhfUk9X X09WRVJMQVBTX1BSRURfUCAocm93ICsgMSkpCisgICAgICAgIHhfZml4X292ZXJsYXBwaW5nX2Fy ZWEgKHcsIHJvdyArIDEsIFRFWFRfQVJFQSwgT1ZFUkxBUFNfRVJBU0VEX0NVUlNPUik7CisgICAg fQorfQorCit2b2lkCittY19lcmFzZV9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBn bHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAg ICAgICBpbnQgeCwgaW50IHksIGludCBocG9zLCBpbnQgdnBvcywgZW51bSBtY19mbGF2b3IgZ2x5 cGhfZmxhdm9yLAorICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90 eXBlLCBpbnQgd2QpCit7CisgIGJvb2wg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qLworICAgICAgJiYgcm93LT51c2VkW1RFWFRfQVJFQV0gPiBocG9z ICYmIGhwb3MgPj0gMCkKKyAgICBtb3VzZV9mYWNlX2hlcmVfcCA9IHRydWU7CisgIC8qIE1heWJl IGNsZWFyIHRoZSBkaXNwbGF5IHVuZGVyIHRoZSBjdXJzb3IuICovCisgIGlmIChjdXJzb3JfdHlw ZSA9PSBNQ19IT0xMT1dfQk9YCisgICAgICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9Y KQorICAgIHsKKyAgICAgIGludCB0ZW1wX3ggPSB4OworICAgICAgaW50IGhlYWRlcl9saW5lX2hl aWdodCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAgICAgY3Vyc29yX2dseXBo ID0gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIGhwb3MsIHZwb3MpOworICAg ICAgaWYgKGN1cnNvcl9nbHlwaCA9PSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgaWYgKGRl YnVnX3ApCisgICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICBy ZXR1cm4gKCVkKVxuIiwgNyk7CisgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICBp bnQgdGVtcF93ZCA9IGN1cnNvcl9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICBpZiAodGVtcF94 IDwgMCkKKyAgICAgICAgeworICAgICAgICAgIHRlbXBfd2QgKz0gdGVtcF94OworICAgICAgICAg IHRlbXBfeCA9IDA7CisgICAgICAgIH0KKyAgICAgIHRlbXBfd2QgPSBtaW4gKHdkLCB3aW5kb3df Ym94X3dpZHRoICh3LCBURVhUX0FSRUEpIC0gdGVtcF94KTsKKyAgICAgIGludCBmeSA9IFdJTkRP V19UT19GUkFNRV9QSVhFTF9ZICh3LCBtYXggKGhlYWRlcl9saW5lX2hlaWdodCwgcm93LT55KSk7 CisgICAgICBpbn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A/IGZhbHNlIDogdHJ1ZTsKKyAgaWYgKGJh cmZfY3Jhc2hfdHdvKQorICAgIHJldHVybjsKKyAgaWYgKHggPCAwCisgICAgICB8fCB5IDwgMAor ICAgICAgfHwgaHBvcyA8IDAKKyAgICAgIHx8IHZwb3MgPCAwKQorICAgIHJldHVybjsKKyAgTGlz cF9PYmplY3QgYnVmID0gdy0+Y29udGVudHM7CisgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgYm9v bCBhdXRvX2hzY3JvbGxfbW9kZV9wID0gRVEgKEZidWZmZXJfbG9jYWxfdmFsdWUgKFFhdXRvX2hz Y3JvbGxfbW9kZSwgYnVmKSwgUWN1cnJlbnRfbGluZSk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xs LWxlZnQgNSkgKi8KKyAgYm9vbCBoc2NsX2FsbF90ZW1wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hz Y3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMt dSBDLXggPCBhbmQgZG8gbm90aGluZy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBfcCA9ICh3 LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1 dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Ny b2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4g MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhz Y3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgZWxzZSBi ZXNpZGVzIGhvcml6b250YWxseSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAgICBjdXJyZW50 IGxpbmUgZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8g aG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Bl cm1fMV9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1p bl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Ny b2xsID09IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAuLi4KKyAg ICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQg ZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1c3BlbmRf YXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xs X21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPT0gMAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOwor ICAvKiBFWEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxlZnQg YXJyb3cga2V5IG9uZSB0aW1lLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9y aXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1wX3AgPSAo IXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19o c2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1Q TEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVudCBs aW5lIHRvIGJlCisgICAgICAgICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50 bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xs ZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3BlbmRfYXV0 b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAor ICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+ bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAo dy0+ZnJhbWUpOworICBpbnQgZnJpbmdlX2JpdG1hcCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7Cisg IGludCBmYWNlX2lkID0gREVGQVVMVF9GQUNFX0l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NmaWVzIHRoZSBmaXJzdCBjb25kaXRpb24KKyAgICAg IG9mICh3aGljaCAhPSBOT19GUklOR0VfQklUTUFQKS4gIEF0IHRoaXMgdGltZSwgQGxhd2xpc3Qg cHJlZmVycyBub3QgdG8KKyAgICAgIHJlbHkgdXBvbiBhIExpc3Agc2V0dGluZyB1c2luZyBgc2V0 LWZyaW5nZS1iaXRtYXAtZmFjZScuICovCisgICAgICByb3ctPmxlZnRfZnJpbmdlX2JpdG1hcCA9 IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICByb3ctPmxlZnRfZnJpbmdlX2Zh Y2VfaWQgPSBmYWNlX2lkOworICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAg ICAgcm93LT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxzZTsKKyAgICAgIG1jX2RyYXdf ZnJpbmdlX2JpdG1hcCAodywgcm93LCB0cnVlLCBjdXJzb3JfdHlwZSk7CisgICAgfQorICAgIGVs c2UgaWYgKCFyZW1vdmVfcAorICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciA9PSBNQ19PVkVS TEFZX0FSUk9XX0JJVE1BUAorICAgICAgICAgICAgICYmIChoc2NsX2FsbF90ZW1wX3AKKyAgICAg ICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNj bF9hbGxfcGVybV8xX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8yX3AKKyAg ICAgICAgICAgICAgICAgfHwgaHNjbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9w ZXJtX3ApKQorICAgICAgeworICAgICAgICBlbnVtIGZhY2VfaWQgb3ZlcmxheV9hcnJvd19mYWNl X2lkID0KKyAgICAgICAgICAoIWFjdGl2ZV9wCisgICAgICAgICAgICYmICFOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICA/ IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaHNjbC1p bmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgIDogKGFjdGl2ZV9wKQorICAg ICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFy cm93LWhzY2wtcHJlLXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICA6IERFRkFVTFRfRkFDRV9J RDsKKyAgICAgICAgZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRN QVApCisgICAgICAgICAgICAgICAgICA/IG92ZXJsYXlfYXJyb3dfZmFjZV9pZAorICAgICAgICAg ICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgIGlmIChoc2NsX2FsbF9wZXJtXzBf cCkKKyAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGlu dGVybiAoIistaHNjbC1wZXJtIiksIGZhbHNlLCBmYWxzZSk7CisgICAgICAgICAgZWxzZSBpZiAo aHNjbF9hbGxfcGVybV8xX3ApCisgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2Zy aW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIHRydWUsIGZhbHNlKTsKKyAg ICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMl9wKQorICAgICAgICAgICAgICBm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csIHJv dywgdHJ1ZSwgY3Vyc29yX3R5cGUpOworICAgICAgfQorICAgICAgZWxzZSBpZiAoIXJlbW92ZV9w CisgICAgICAgICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVf UklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVW RVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAgICAgICAgICAg fHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAg ICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklH SFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElD QUxfQkFSCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VE X1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19W RVJUSUNBTF9CQVJfQkFDS1NMQVNIKSkKKyAgICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0 IGJpdG1hcF9mbGF2b3IgPSAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklH SFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hv bGxvd19yZWN0YW5nbGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVf UklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBR bWNfcmV2ZXJzZWRfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RB TkdMRSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xs b3dfcmVjdGFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGds eXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9 PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX3JpZ2h0 X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2Zs YXZvciA9PSBNQ19WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVy dGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBo X2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBRbmlsOworICAgICAgICAgIGZyaW5n ZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBfZnJpbmdlX2JpdG1hcCAoYml0bWFwX2ZsYXZv cikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAg ICAgICAgIGZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAor ICAgICAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xM T1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5 cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAg ICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNB TF9CQVIpKQorICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYs IGludGVybiAoIistcmV2ZXJzZWQtYmFyLXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAgICAg ICAgICAgICAgIDogKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAg ICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX0hPTExPV19S RUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxh dm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAg ICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQor ICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAo IistYmFyLXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgICAgICAgIDogREVGQVVM VF9GQUNFX0lEOworICAgICAgICAgIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gZmFsc2U7Cisg ICAgICAgICAgcm93LT5yaWdodF9mcmluZ2VfYml0bWFwID0gZnJpbmdlX2JpdG1hcDsKKyAgICAg ICAgICByb3ctPnJpZ2h0X2ZyaW5nZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgICAgICByb3ct PnJpZ2h0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgICAgIHJvdy0+ZnJpbmdlX2JpdG1hcF9w ZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwICh3LCBy b3csIGZhbHNlLCBjdXJzb3JfdHlwZSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoZ2x5 cGhfZmxhdm9yID09IE1DX0dMWVBICisgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9 PSBNQ19HTFlQSExFU1MpCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBvbl9wID0gdHJ1 ZTsKKyAgICAgICAgICAgIEZSQU1FX1JJRiAoZiktPm1jX3NjcmliZV9jdXJzb3IgKHcsIG1hdHJp eCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICB2cG9zLCB3ZCwgaCwgbHNsLCBjdXJzb3JfdHlwZSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgZ2x5cGhf Zmxhdm9yLCBvbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgYWN0aXZlX3ApOworICAgICAgICAgIH0KK30KKworLyogRHVtcCBjb250ZW50cyBvZiBnbHlw aCBHTFlQSCB0byBzdGRlcnIuICBST1cgYW5kIEFSRUEgYXJlCisgICB0aGUgZ2x5cGggcm93IGFu ZCBhcmVhIHdoZXJlIHRoZSBnbHlwaCBjb21lcyBmcm9tLiAqLwordm9pZAorbWNfZHVtcF9nbHlw aCAoc3RydWN0IGdseXBoX3JvdyAqcm93LCBzdHJ1Y3QgZ2x5cGggKmdseXBoLCBpbnQgYXJlYSwK KyAgICAgICAgICAgICAgIGludCByZWxhdGl2ZV94LCBpbnQgdnBvcykKK3sKKyAgYm9vbCBnbHlw aF96dl9wID0gKGdseXBoIC0gcm93LT5nbHlwaHNbYXJlYV0gPT0gcm93LT51c2VkW2FyZWFdIC0g MQorICAgICAgICAgICAgICAgICAgICAgJiYgTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSA9 PSBaVik7CisgIGlmIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICB8fCBnbHlwaC0+ dHlwZSA9PSBHTFlQSExFU1NfR0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAor ICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAl MS4xZCUxLjFkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVY VF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2Vk W2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgIChnbHlwaC0+dHlwZSA9 PSBDSEFSX0dMWVBICisgICAgICAgICA/ICdDJworICAgICAgICAgOiAnRycpLAorICAgICAgICBn bHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAg ID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAg ICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxf d2lkdGgsCisgICAgICAgIGdseXBoLT51LmNoLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAg ICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9s aW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisg ICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkpOworICAgIH0KKyAgZWxzZSBp ZiAoZ2x5cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRmIChz dGRlcnIsCisgICAgICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUw NnggJTRkICUxLjFkJTEuMWQgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmds eXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiBy b3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1MnLAor ICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3Qp CisgICAgICAgICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3Qp CisgICAgICAgICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisg ICAgICAgICAgICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4 ZWxfd2lkdGgsCisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAg Z2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3As CisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAg ICJcXFMiKTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQor ICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVk ICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVjXG4iLAor ICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51 c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxh dGl2ZV94LAorICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAo QlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ0InCisgICAgICAgICAgOiAo U1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgOiAo TklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgOiAnLScp KSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2lnbmVkIGludCkg Z2x5cGgtPnUuaW1nX2lkLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgt PmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAg ICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7 CisgICAgfQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpCisgICAg eworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMg JTkicEQiZCAlYyAlM2QgMHglMDZ4IiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhU X0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRb YXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJysnLAorICAgICAgICBn bHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAg ICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgs CisgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmNtcC5pZCk7CisgICAgICBmcHJpbnRm IChzdGRlcnIsICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAg ICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9s aW5lX3ApOworICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmlu dGYgKHN0ZGVyciwgIiAgJTNkICVzIC4gWyVkLSVkXVxuIiwKKyAgICAgICAgICAgICAgICAgICAg ICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAgICAg ICAgICAgICAgICAgIGdseXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgtPnNsaWNlLmNtcC50byk7 CisgICAgICAgIGVsc2UKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG4iKTsKKyAgICB9Cisg IGVsc2UgaWYgKGdseXBoLT50eXBlID09IFhXSURHRVRfR0xZUEgpCisgICAgeworI2lmbmRlZiBI QVZFX1hXSURHRVRTCisgICAgICBlYXNzdW1lIChmYWxzZSk7CisjZWxzZQorICAgICAgZnByaW50 ZiAoc3RkZXJyLAorICAgICAgICAiICAlNWQvJS01ZCAlNWQgJTRjICU2ZCAlYyAlM2QgMHglMDV4 ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93 LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdYJywKKyAg ICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQor ICAgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAg ICAgICAgICAgID8gJ1MnCisgICAgICAgICA6ICctJykpLAorICAgICAgICBnbHlwaC0+cGl4ZWxf d2lkdGgsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hf bGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgt PnUueHdpZGdldCwKKyAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2X3AgPyAiWlYiIDogIi0t IiwKKyAgICAgICAgJy4nKTsKKyNlbmRpZgorICAgIH0KK30KKworLyogRHVtcCB0aGUgY29udGVu dHMgb2YgZ2x5cGggcm93IGF0IFZQT1MgaW4gTUFUUklYIHRvIHN0ZGVyci4KKyAgIEdMWVBIUyAw IG1lYW5zIGRvbid0IHNob3cgZ2x5cGggY29udGVudHMuCisgICBHTFlQSFMgMSBtZWFucyBzaG93 IGdseXBocyBpbiBzaG9ydCBmb3JtCisgICBHTFlQSFMgPiAxIG1lYW5zIHNob3cgZ2x5cGhzIGlu IGxvbmcgZm9ybS4gKi8KK3ZvaWQKK21jX2R1bXBfZ2x5cGhfcm93IChzdHJ1Y3QgZ2x5cGhfcm93 ICpyb3csIGludCB2cG9zLCBpbnQgZ2x5cGhzKQoreworICBpbnQgcmVsYXRpdmVfeCA9IDA7Cisg IGlmIChnbHlwaHMgIT0gMSkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJcbkRVTVAg R0xZUEggUk9XXG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIlJvdyAgICAgU3RhcnQgICAg ICAgRW5kIFVzZWQgb0U+PFxcQ1RaRmVzbSAgICAgWCAgICBZICAgIFcgICAgSCAgICBWICAgIEEg ICAgUFxuIik7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICI9PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1c biIpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiJTNkICU5InBEImQgJTkicEQiZCAlNGQgJTEu MWQlMS4xZCUxLjFkJTEuMWRcCislMS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCUx LjFkICAlNGQgJTRkICU0ZCAlNGQgJTRkICU0ZCAlNGRcbiIsCisgICAgICAgICB2cG9zLAorICAg ICAgICAgTUFUUklYX1JPV19TVEFSVF9DSEFSUE9TIChyb3cpLAorICAgICAgICAgTUFUUklYX1JP V19FTkRfQ0hBUlBPUyAocm93KSwKKyAgICAgICAgIHJvdy0+dXNlZFtURVhUX0FSRUFdLAorICAg ICAgICAgcm93LT5jb250YWluc19vdmVybGFwcGluZ19nbHlwaHNfcCwKKyAgICAgICAgIHJvdy0+ ZW5hYmxlZF9wLAorICAgICAgICAgcm93LT50cnVuY2F0ZWRfb25fbGVmdF9wLAorICAgICAgICAg cm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCwKKyAgICAgICAgIHJvdy0+Y29udGludWVkX3AsCisg ICAgICAgICBNQVRSSVhfUk9XX0NPTlRJTlVBVElPTl9MSU5FX1AgKHJvdyksCisgICAgICAgICBN QVRSSVhfUk9XX0RJU1BMQVlTX1RFWFRfUCAocm93KSwKKyAgICAgICAgIHJvdy0+ZW5kc19hdF96 dl9wLAorICAgICAgICAgcm93LT5maWxsX2xpbmVfcCwKKyAgICAgICAgIHJvdy0+ZW5kc19pbl9t aWRkbGVfb2ZfY2hhcl9wLAorICAgICAgICAgcm93LT5zdGFydHNfaW5fbWlkZGxlX29mX2NoYXJf cCwKKyAgICAgICAgIHJvdy0+bW91c2VfZmFjZV9wLAorICAgICAgICAgcm93LT54LAorICAgICAg ICAgcm93LT55LAorICAgICAgICAgcm93LT5waXhlbF93aWR0aCwKKyAgICAgICAgIHJvdy0+aGVp Z2h0LAorICAgICAgICAgcm93LT52aXNpYmxlX2hlaWdodCwKKyAgICAgICAgIHJvdy0+YXNjZW50 LAorICAgICAgICAgcm93LT5waHlzX2FzY2VudCk7CisgICAgICAvKiBUaGUgbmV4dCAzIGxpbmVz IHNob3VsZCBhbGlnbiB0byAiU3RhcnQiIGluIHRoZSBoZWFkZXIuICovCisgICAgICBmcHJpbnRm IChzdGRlcnIsICIgICAgJTkicEQiZCAlOSJwRCJkXHQlNWRcbiIsIHJvdy0+c3RhcnQub3Zlcmxh eV9zdHJpbmdfaW5kZXgsCisgICAgICAgICByb3ctPmVuZC5vdmVybGF5X3N0cmluZ19pbmRleCwK KyAgICAgICAgIHJvdy0+Y29udGludWF0aW9uX2xpbmVzX3dpZHRoKTsKKyAgICAgIGZwcmludGYg KHN0ZGVyciwgIiAgICAlOSJwRCJkICU5InBEImRcbiIsCisgICAgICAgICBDSEFSUE9TIChyb3ct PnN0YXJ0LnN0cmluZ19wb3MpLAorICAgICAgICAgQ0hBUlBPUyAocm93LT5lbmQuc3RyaW5nX3Bv cykpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAgICU5ZCAlOWRcbiIsIHJvdy0+c3RhcnQu ZHB2ZWNfaW5kZXgsCisgICAgICAgICByb3ctPmVuZC5kcHZlY19pbmRleCk7CisgICAgfQorICBp ZiAoZ2x5cGhzID4gMSkKKyAgICB7CisgICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9NQVJHSU5f QVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAgICB7CisgICAgICAgICAgc3Ry dWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdOworICAgICAgICAgIHN0cnVjdCBn bHlwaCAqZ2x5cGhfZW5kID0gZ2x5cGggKyByb3ctPnVzZWRbYXJlYV07CisgICAgICAgICAgLyog R2x5cGggZm9yIGEgbGluZSBlbmQgaW4gdGV4dC4gKi8KKyAgICAgICAgICBpZiAoYXJlYSA9PSBU RVhUX0FSRUEgJiYgZ2x5cGggPT0gZ2x5cGhfZW5kICYmIGdseXBoLT5jaGFycG9zID4gMCkKKyAg ICAgICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgICAgIGlmIChnbHlwaCA8IGdseXBoX2VuZCkK KyAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIkdseXBoIy9Ub3RhbCBSZWwuWCBUICAgICAg IFBvcyBPICAgVyAgICAgQ29kZSBGYWNlIExSIEhQT1MgWlYgQ1xuIik7CisgICAgICAgICAgZm9y ICg7IGdseXBoIDwgZ2x5cGhfZW5kOyArK2dseXBoKQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICBtY19kdW1wX2dseXBoIChyb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB2cG9zKTsK KyAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAg ICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAoZ2x5cGhzID09IDEpCisgICAg ICB7CisgICAgICAgIGNoYXIgc1tTSFJUX01BWCArIDRdOworICAgICAgICBmb3IgKGludCBhcmVh ID0gTEVGVF9NQVJHSU5fQVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAgICAg IHsKKyAgICAgICAgICAgIGludCBpOworICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHJvdy0+ dXNlZFthcmVhXTsgKytpKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RydWN0 IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdICsgaTsKKyAgICAgICAgICAgICAgICBp ZiAoaSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICYmIGFyZWEg PT0gVEVYVF9BUkVBCisgICAgICAgICAgICAgICAgICAgICYmIE5JTFAgKGdseXBoLT5vYmplY3Qp CisgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAg ICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPT0gJyAnKQorICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICBzdHJjcHkgKCZzW2ldLCAiW1xcbl0iKTsKKyAgICAgICAg ICAgICAgICAgICAgaSArPSA0OworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAg ICAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPCAweDgwCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBnbHlwaC0+dS5jaCA+PSAnICcpCisgICAgICAgICAgICAgICAgICAgIHNbaV0gPSBnbHlw aC0+dS5jaDsKKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAg IHNbaV0gPSAnLic7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHNbaV0gPSAnXDAnOwor ICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiJTNkOiAoJWQpICclcydcbiIsIHZwb3MsIHJv dy0+ZW5hYmxlZF9wLCBzKTsKKyAgICAgICAgICB9CisgICAgICB9Cit9CisKK0RFRlVOICgibWMt ZHVtcC1nbHlwaC1yb3ciLCBGbWNfZHVtcF9nbHlwaF9yb3csIFNtY19kdW1wX2dseXBoX3Jvdywg MSwgMiwgIlAiLAorICAgICAgIGRvYzogLyogRHVtcCBnbHlwaCByb3cgUk9XIHRvIHN0ZGVyci4K K0ludGVyYWN0aXZlbHksIFJPVyBpcyB0aGUgcHJlZml4IG51bWVyaWMgYXJndW1lbnQgYW5kIGRl ZmF1bHRzIHRvCit0aGUgcm93IHdoaWNoIGRpc3BsYXlzIHBvaW50LgorT3B0aW9uYWwgYXJndW1l bnQgR0xZUEhTIDAgbWVhbnMgZG9uJ3QgZHVtcCBnbHlwaHMuCitHTFlQSFMgMSBtZWFucyBkdW1w IGdseXBocyBpbiBzaG9ydCBmb3JtLgorR0xZUEhTID4gMSBvciBvbWl0dGVkIG1lYW5zIGR1bXAg Z2x5cGhzIGluIGxvbmcgZm9ybS4gICovKQorICAoTGlzcF9PYmplY3Qgcm93LCBMaXNwX09iamVj dCBnbHlwaHMpCit7CisgIHN0cnVjdCB3aW5kb3cgKncgPSBYV0lORE9XIChzZWxlY3RlZF93aW5k b3cpOworICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsK KyAgRU1BQ1NfSU5UIHZwb3M7CisgIGlmIChOSUxQIChyb3cpKQorICAgIHsKKyAgICAgIGludCBk MSwgZDIsIGQzLCBkNCwgZDUsIHlwb3M7CisgICAgICBib29sIHZpc2libGVfcCA9IHBvc192aXNp YmxlX3AgKHcsIFBULCAmZDEsICZkMiwgJmQzLCAmZDQsICZkNSwgJnlwb3MpOworICAgICAgaW50 IGhlYWRlcl9saW5lX2hlaWdodCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAg ICAgaW50IHZvZmZzZXQgPSAoaGVhZGVyX2xpbmVfaGVpZ2h0ID4gMAorICAgICAgICAgICAgICAg ICAgICAgJiYgeXBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgPyB5cG9zICsgMQorICAg ICAgICAgICAgICAgICAgICAgIDogeXBvczsKKyAgICAgIGlmICh2aXNpYmxlX3ApCisgICAgICAg IHZwb3MgPSB2b2Zmc2V0OworICAgICAgICBlbHNlCisgICAgICAgICAgdnBvcyA9IDA7CisgICAg fQorICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgQ0hFQ0tfTlVNQkVSIChyb3cpOworICAgICAg ICB2cG9zID0gWEZJWE5VTSAocm93KTsKKyAgICAgIH0KKyAgaWYgKHZwb3MgPj0gMCAmJiB2cG9z IDwgbWF0cml4LT5ucm93cykKKyAgICBtY19kdW1wX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amVjdCBn bHlwaHMpCit7CisgIHN0cnVjdCB3aW5kb3cgKncgPSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cp OworICBzdHJ1Y3QgYnVmZmVyICpidWZmZXIgPSBYQlVGRkVSICh3LT5jb250ZW50cyk7CisgIGZw cmludGYgKHN0ZGVyciwgIlBUID0gJSJwRCJkLCBCRUdWID0gJSJwRCJkLiBaViA9ICUicEQiZFxu IiwKKyAgICAgQlVGX1BUIChidWZmZXIpLCBCVUZfQkVHViAoYnVmZmVyKSwgQlVGX1pWIChidWZm ZXIpKTsKKyAgZnByaW50ZiAoc3RkZXJyLCAiQ3Vyc29yIHggPSAlZCwgeSA9ICVkLCBocG9zID0g JWQsIHZwb3MgPSAlZFxuIiwKKyAgICAgdy0+Y3Vyc29yLngsIHctPmN1cnNvci55LCB3LT5jdXJz b3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MpOworICBmcHJpbnRmIChzdGRlcnIsICI9PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiIpOworICBtY19kdW1wX2dseXBo X21hdHJpeCAody0+Y3VycmVudF9tYXRyaXgsCisgICAgICAgICBUWVBFX1JBTkdFRF9GSVhOVU1Q IChpbnQsIGdseXBocykgPyBYRklYTlVNIChnbHlwaHMpIDogMCk7CisgIHJldHVybiBRbmlsOwor fQorCitib29sCittY190cmF2ZXJzZV9jYWNoZV9wIChzdHJ1Y3QgbWNfbWF0cml4IG1hdHJpeCwg ZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICBpbnQg dm50aCwgaW50IG50aCkKK3sKKyAgaWYgKHZudGggPCBtYXRyaXgudnBvc191c2VkCisgICAgICAm JiBtYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdID4gMAorICAgICAgJiYgbnRoIDwgbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSkKKyAgICByZXR1cm4gdHJ1ZTsK KyAgICBlbHNlCisgICAgICByZXR1cm4gZmFsc2U7Cit9CisKK3ZvaWQKK21jX3Jlc2V0X2NhY2hl IChzdHJ1Y3Qgd2luZG93ICp3KQoreworICBpZiAoIUJVRkZFUlAgKHctPmNvbnRlbnRzKSkKKyAg ICByZXR1cm47CisgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNI RTsKKyAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQor ICAgIHsKKyAgICAgIGJvb2wgYnZhcl9hY3RpdmVfcDsKKyAgICAgIHN3aXRjaCAoY2FjaGVfdHlw ZSkKKyAgICAgICAgeworICAgICAgICAgIGNhc2UgTk9fQ0FDSEU6CisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBjYXNlIE1DX0NB Q0hFOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVu dHMpCisgICAgICAgICAgICAgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIG1jX2NvbmYpKSkKKyAgICAgICAgICAgICAgICBidmFyX2FjdGl2ZV9wID0gZmFsc2U7Cisg ICAgICAgICAgICAgICAgZWxzZSBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNf Y29uZikpKQorICAgICAgICAgICAgICAgICAgYnZhcl9hY3RpdmVfcCA9IHRydWU7CisgICAgICAg ICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgIGNhc2UgQ0hfQ0FDSEU6Cisg ICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAg ICAgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jv c3NoYWlycykpKQorICAgICAgICAgICAgICAgIGJ2YXJfYWN0aXZlX3AgPSBmYWxzZTsKKyAgICAg ICAgICAgICAgICBlbHNlIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAg ICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hh aXJzKSkpCisgICAgICAgICAgICAgICAgICBidmFyX2FjdGl2ZV9wID0gdHJ1ZTsKKyAgICAgICAg ICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgY2FzZSBGQ19DQUNIRToKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAg ICAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192 aXNpYmxlKSkpCisgICAgICAgICAgICAgICAgYnZhcl9hY3RpdmVfcCA9IGZhbHNlOworICAgICAg ICAgICAgICAgIGVsc2UgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2li bGUpKSkKKyAgICAgICAgICAgICAgICAgIGJ2YXJfYWN0aXZlX3AgPSB0cnVlOworICAgICAgICAg ICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKCFidmFyX2Fj dGl2ZV9wKQorICAgICAgICB7CisgICAgICAgICAgLyogRGVjcmVhc2UgdGhlIHNpemUgb2YgdGhl IGFycmF5IHRvIGEgYmFyZSBtaW5pbXVtLiAqLworICAgICAgICAgIGZvciAoaW50IHZudGggPSAw OyB2bnRoIDwgdy0+bWNfbWF0cml4LnZwb3NfdXNlZDsgKyt2bnRoKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBpZiAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVk W2NhY2hlX3R5cGVdID4gMSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSA9CisgICAgICAgICAgICAg ICAgICAgIHhucmVhbGxvYyAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV0sIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mICp3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSk7CisgICAgICAgICAgICAgICAgICB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV0gPSAxOworICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVfdXNlZFtjYWNoZV90eXBlXSA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgdy0+bWNf bWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXSA9IDA7CisgICAgICAgIH0KKyAgICAgICAg Ly8gIEFsdGhvdWdoIGl0IHdvdWxkIG5vdCBiZSB2ZXJ5IGVmZmljaWVudCwgaXQgaXMgcG9zc2li bGUgdG8gc2V0CisgICAgICAgIC8vICB0aGUgX3VzZWRfIGVsZW1lbnRzIG9mIHRoZSBhcnJheSB0 byB6ZXJvLiAgSW4gc3VjaCBhIGNhc2UsIHRoZQorICAgICAgICAvLyAgLi4uX2VsdHMuYWxsb2Nh dGVkW2NhY2hlX3R5cGVdIHdvdWxkIHJlbWFpbiB0aGUgc2FtZS4KKyAgICAgICAgLy8gIG1lbXNl dCA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lZ3JvdW5kLCBhY3Rp dmVfcCwgZ2x5cGhfZmxhdm9yLCByZW1vdmVfcCk7CisgICAgICByZXR1cm47CisgICAgfQorICAg IGVsc2UgaWYgKGRyYXdfcAorICAgICAgICAgICAgICYmIChmcm9tX3doZXJlID09IFNDUklCRV9P TkUKKyAgICAgICAgICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBTQ1JJQkVfVFdPCisgICAgICAg ICAgICAgICAgIHx8IGZyb21fd2hlcmUgPT0gU0NSSUJFX1RIUkVFCisgICAgICAgICAgICAgICAg IHx8IGZyb21fd2hlcmUgPT0gTk9XSEVSRSkpCisgICAgICB7CisgICAgICAgIG1jX2RyYXdfZXJh c2VfaHlicmlkICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwg aCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lk dGgsIGZvcmVncm91bmQsIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAg ICAgcmV0dXJuOworICAgICAgfQorICBpZiAoY2FjaGVfdHlwZSA9PSBOT19DQUNIRSkKKyAgICBy ZXR1cm47CisgICsrdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgaWYg KHZudGggPj0gdy0+bWNfbWF0cml4LnZwb3NfdXNlZCkKKyAgICB3LT5tY19tYXRyaXgudnBvc191 c2VkID0gdm50aCArIDE7CisgIGlmICh3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQgPCB3LT5t Y19tYXRyaXgudnBvc191c2VkKQorICAgIHsKKyAgICAgIGludCBvbGRfYWxsb2MgPSB3LT5tY19t YXRyaXgudnBvc19hbGxvY2F0ZWQ7CisgICAgICBpbnQgbmV3X2VsdHMgPSB3LT5tY19tYXRyaXgu dnBvc191c2VkIC0gdy0+bWNfbWF0cml4LnZwb3NfYWxsb2NhdGVkOworICAgICAgdy0+bWNfbWF0 cml4LnZwb3MgPSB4cGFsbG9jICh3LT5tY19tYXRyaXgudnBvcywgJnctPm1jX21hdHJpeC52cG9z X2FsbG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMs IElOVF9NQVgsIHNpemVvZiAqdy0+bWNfbWF0cml4LnZwb3MpOworICAgICAgbWVtc2V0ICh3LT5t Y19tYXRyaXgudnBvcyArIG9sZF9hbGxvYywgMCwKKyAgICAgICAgICAgICAgICh3LT5tY19tYXRy aXgudnBvc19hbGxvY2F0ZWQgLSBvbGRfYWxsb2MpICogc2l6ZW9mICp3LT5tY19tYXRyaXgudnBv cyk7CisgICAgfQorICArK3ctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVf dHlwZV07CisgIGlmICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2Fj aGVfdHlwZV0gPCB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVd KQorICAgIHsKKyAgICAgIGludCBvbGRfYWxsb2MgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV07CisgICAgICBpbnQgbmV3X2VsdHMgPSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdIC0gdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdOworICAgICAgdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV0gPSB4cGFsbG9jICh3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlX2FsbG9jYXRlZFtjYWNoZV90eXBlXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElOVF9NQVgsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNp emVvZiAqdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV0pOworICAgICAg bWVtc2V0ICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSArIG9sZF9h bGxvYywgMCwKKyAgICAgICAgICAgICAgICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9h bGxvY2F0ZWRbY2FjaGVfdHlwZV0gLSBvbGRfYWxsb2MpCisgICAgICAgICAgICAgICAgICogc2l6 ZW9mICp3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSk7CisgICAgfQor ICBpbnQgbnRoID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBl XSAtIDE7CisgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0u c2FtZV9wID0gZmFsc2U7CisgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF0uZ2x5cGgudHlwZSA9IGdseXBoLT50eXBlOworICB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLmJ5dGVwb3MgPSBnbHlwaC0+Ynl0ZXBv czsKKyAgdy0+bWNfbWF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ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgs CisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB4LCBp bnQgKmZ4LCBpbnQgeSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCAqZnksIGludCBocG9z LCBpbnQgdnBvcywgaW50ICpoLAorICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJz b3JfdHlwZSBjdXJzb3JfdHlwZSwgaW50IGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAgICAg ICAgICAgIGludCAqd2QpCit7CisgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSBtY19nZXRfY3Vyc29y X2dseXBoICh3LCBtYXRyaXgsIHJvdywgaHBvcywgdnBvcyk7CisgIGlmIChnbHlwaCA9PSBOVUxM KQorICAgIHJldHVybjsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUg KHcpKTsKKyAgKmZ4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICpo ID0gcm93LT52aXNpYmxlX2hlaWdodDsKKyAgLyogRG9uJ3QgbGV0IHRoZSBjdXJzb3IgZXhjZWVk IHRoZSBkaW1lbnNpb25zIG9mIHRoZSByb3csIHNvIHRoYXQKKyAgdGhlIHVwcGVyL2xvd2VyIHNp ZGUgb2YgdGhlIGJveCBhcmVuJ3QgY2xpcHBlZC4gICovCisgIGludCB3X2hlYWRlcl9saW5lX2hl aWdodCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICBpbnQgd190ZXh0X2JvdHRv bV95ID0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpIC0gKmg7CisgIGlmICh5IDwgd19oZWFkZXJf bGluZV9oZWlnaHQpCisgICAgeworICAgICAgKmggPSBtYXggKCpoIC0gKHdfaGVhZGVyX2xpbmVf aGVpZ2h0IC0geSkgKyAxLCAqaCk7CisgICAgICB5ID0gd19oZWFkZXJfbGluZV9oZWlnaHQgLSAx OworICAgICAgLy8gZnByaW50ZiAoc3RkZXJyLCAiQ09ORElUSU9OICMgMVxuIik7CisgICAgfQor ICAgZWxzZSBpZiAoeSA+IHdfdGV4dF9ib3R0b21feSkKKyAgICAgeworICAgICAgICpoICs9IHkg LSB3X3RleHRfYm90dG9tX3k7CisgICAgICAgeSA9IHdfdGV4dF9ib3R0b21feTsKKyAgICAgICAv LyBmcHJpbnRmIChzdGRlcnIsICJDT05ESVRJT04gIyAyXG4iKTsKKyAgICAgfQorICAqZnkgPSBX SU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgeSk7CisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisg ICAgeworICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgIHsKKyAgICAgICAgICBpZiAoY3Vyc29y X3dpZHRoIDwgMSkKKyAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IG1heCAoRlJBTUVfQ1VSU09S X1dJRFRIIChmKSwgMSk7CisgICAgICAgICAgaWYgKGN1cnNvcl93aWR0aCA8IGdseXBoLT5waXhl bF93aWR0aCkKKyAgICAgICAgICAqd2QgPSBjdXJzb3Jfd2lkdGg7CisgICAgICAgICAgYnJlYWs7 CisgICAgICAgIH0KKyAgICAgIGNhc2UgTUNfSEJBUjoKKyAgICAgICAgeworICAgICAgICAgIGlu dCBjdXJzb3JfaGVpZ2h0ID0gKGN1cnNvcl93aWR0aCA8IDEpID8gbHJpbnQgKDAuMjUgKiAqaCkg OiBjdXJzb3Jfd2lkdGg7CisgICAgICAgICAgaWYgKGN1cnNvcl9oZWlnaHQgPiByb3ctPmhlaWdo dCkKKyAgICAgICAgICAgIGN1cnNvcl9oZWlnaHQgPSByb3ctPmhlaWdodDsKKyAgICAgICAgICAv KiBDdXJzb3Igc21hbGxlciB0aGFuIGxpbmUgaGVpZ2h0LCBzbyBtb3ZlIGRvd24uICovCisgICAg ICAgICAg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wb3M7CisgIGludCBmeCwgZnksIGgsIHdkOworICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3 LCBtYXRyaXgsIHJvdywgcmVsYXRpdmVfeCwgJmZ4LCB5LCAmZnksIGhwb3MsIHZwb3MsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICZoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAmd2Qp OworICBpbnQgb3BvaW50X2Z4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgb3Bv aW50X3gpOworICBpbnQgZmNfZnggPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCBl c3NlbnRpYWxzLmZjX3gpOworICBib29sIGdseXBoX3p2X3AgPSAoZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAg ICYmIE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgPT0gWlYpOworICBzdHJ1Y3QgZnJhbWUg KmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y29udGVudHM7 CisgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1 Zik7CisgIGludCB0ZXh0X2FyZWFfd2lkdGggPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FS RUEpOworICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJzb3Jfcm93ID0gKHctPmN1cnNvci52cG9zICE9 IC0xKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XIChjdXJz b3JfbWF0cml4LCB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogTlVMTDsKKyAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGggPSAody0+Y3Vyc29yLnZw b3MgIT0gLTEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19nZXRfY3Vyc29y X2dseXBoICh3LCBjdXJzb3JfbWF0cml4LCBjdXJzb3Jfcm93LAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLmhwb3MsIHctPmN1 cnNvci52cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgYm9v bCBjdXJzb3JfYXRfZnJpbmdlX3AgPSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9B UkVBXQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT5leGFjdF93 aW5kb3dfd2lkdGhfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1 cnNvci54ID09IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5jdXJzb3IueCA9PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7CisgIGJvb2wgY3Vyc29y X2JleW9uZF9mcmluZ2VfcCA9IChjdXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RF WFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFjdXJzb3Jfcm93 LT5leGFjdF93aW5kb3dfd2lkdGhfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5jdXJzb3IueCA+PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRo KTsKKyAgaW50IGZyYW1lX2NoYXJfd2lkdGggPSBGUkFNRV9DT0xVTU5fV0lEVEggKGYpOworICBp bnQgdGVtcF9mYWNlX2lkID0gZ2x5cGgtPmZhY2VfaWQ7CisgIHN0cnVjdCBtY19SR0IgYmFja2dy b3VuZDsKKyAgbWNfc2V0X2xzbF9iZyAodywgdGVtcF9mYWNlX2lkLCAmYmFja2dyb3VuZCk7Cisg IGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKG9wb2ludF94ID09IHJlbGF0aXZlX3gKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X2hwb3MgPT0gaHBvcworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSByb3ctPnkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBvcyk7CisKKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgQ0hBUl9HTFlQSCB8 IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKyAgaWYgKGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgIHx8IGdseXBoLT50 eXBlID09IEdMWVBITEVTU19HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAg IGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQi ZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGds eXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0g PT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisg ICAgICAgIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICA/ICdDJworICAgICAg ICAgOiAnRycpLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGds eXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgt Pm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+ b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAor ICAgICAgICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBoLT51LmNoLAor ICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwK KyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBn bHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChnbHlw aC0+dS5jaCkpOworICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS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FMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChyZWxhdGl2 ZV94IDwgcm93LT5waXhlbF93aWR0aAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3Ap CisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBm eCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90 eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAg ICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwg Y2FjaGVfdHlwZSwKKyAgICAgICAgICAgICAgICAgICBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAo Z2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAg ICAgICAgICAmJiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICBp ZiAocmVsYXRpdmVfeCA8IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICBm eCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgICAgbWNfaGVs cGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywg dnBvcywKKyAgICAgICAgICAgICAgICAgICAgIHhfbGltaXQgLSByZWxhdGl2ZV94LCBoLCBjdXJz b3JfdHlwZSwgY3Vyc29yX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwg YmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEhMRVNTLAorICAgICAgICAg ICAgICAgICAgICAgZHJhd19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7 CisgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworLyogICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQSExF U1NfR0xZUEggICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAg ICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBo X2ZsYXZvciA9IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdo dF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FM X0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2Zy aW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRy dW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9C QVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1 cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSAxCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNB TF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRo KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAoZ2x5cGhf Zmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBo X2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAg ICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAg IHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICB8fCBnbHlwaF9m bGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9 IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIg KHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgb3BvaW50X2Z4LCB5LCBmeSwgaHBv cywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lk dGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMu YWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLAor ICAgICAgICAgICAgICAgICBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAt LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgRklMTF9DT0xVTU46ICBDSEFS X0dMWVBIIHwgR0xZUEhMRVNTX0dMWVBIICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7CisgICAgICBlbnVtIG1j X2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09 IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE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LS0tLS0t LS0tLS0tLS0tLS0gKi8KKworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgQkVHSU46ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAgICAgICAg ICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICBlbHNlIGlmIChnbHlwaC0+ dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAg ZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJk ICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5 cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9 PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAg ICAgICAgJ1MnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGds eXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgt Pm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+ b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAor ICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgI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ICAgICAgICAgICAgPyBn bHlwaC0+ZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lE OworICAgICAgICAgIHN0cnVjdCBtY19SR0IgYmFja2dyb3VuZDsKKyAgICAgICAgICBtY19zZXRf bHNsX2JnICh3LCB0ZW1wX2ZhY2VfaWQsICZiYWNrZ3JvdW5kKTsKKyAgICAgICAgICBtY19oZWxw ZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2 cG9zLAorICAgICAgICAgICAgICAgICAgICAgeF9saW1pdCAtIHJlbGF0aXZlX3gsIGgsIGN1cnNv cl90eXBlLCB4X2xpbWl0IC0gcmVsYXRpdmVfeCwKKyAgICAgICAgICAgICAgICAgICAgIGZvcmVn cm91bmQsIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBITEVTUywKKyAg ICAgICAgICAgICAgICAgICAgIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwgYWN0aW9u X3R5cGUpOworICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIFNU UkVUQ0hfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t ICovCisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBpZiAocm93LT5maWxs X2xpbmVfcAorICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSBy b3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsg Z2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICB0ZW1wX2ZhY2VfaWQgPSBnbHlwaC0+ZmFjZV9p ZDsKKyAgICAgICAgZWxzZSBpZiAoIXJvdy0+ZmlsbF9saW5lX3AKKyAgICAgICAgICAgICAgICAg JiYgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEK KyAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVs X3dpZHRoKQorICAgICAgICAgIHRlbXBfZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgICAg IHN0cnVjdCBtY19SR0IgYmFja2dyb3VuZDsKKyAgICAgIG1jX3NldF9sc2xfYmcgKHcsIHRlbXBf ZmFjZV9pZCwgJmJhY2tncm91bmQpOworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9y ID0gKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVk X29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNf VkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdI VF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2Jl eW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg Y3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSExFU1M7CisgICAg ICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAg ICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJS T1cKKyAgICAgICA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mIChzdGRlcnIsCisgICAgICAgICJc biAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4x ZCAgJTNkICVzICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0s CisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAt IDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5j aGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0In CisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycK KyAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICA/ICcw JworICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwK KyAgICAgICAgKHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuaW1nX2lkLAorICAgICAgICBnbHlwaC0+ ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgt PnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpW IiA6ICItLSIsCisgICAgICAgICcuJyk7CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgTVVMVElQ TEVfQ1VSU09SUzogIElNQUdFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAg ICAgY3Vyc29yX3R5cGUgPSBNQ19IT0xMT1dfQk9YOworICAgICAgbWNfaGVscGVyICh3LCBtYXRy aXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAg ICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQs IGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dM WVBILCBkcmF3X3AsIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsCisgICAgICAgICAgICAgICAgIGFj dGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworLyogICAgICAgICAgICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIElNQUdFX0dM WVBIICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAg ICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAgY3Vyc29yX3R5cGUgPSBNQ19I T0xMT1dfQk9YOworICAgICAgaWYgKCFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hl bHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lk dGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgZXNzZW50aWFs cy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwKKyAg ICAgICAgICAgICAgICAgICBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAt LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElD QUxfUlVMRVI6ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBj dXJzb3JfdHlwZSA9IE1DX0hPTExPV19CT1g7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwg cm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAg ICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFj a2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgs IGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwKKyAgICAgICAgICAgICAgICAgYWN0aW9u X3R5cGU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isgICAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgICAg KEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgID8gJ0InCisgICAgICAgICAgIDog KFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAg ICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICAgID8gJzAnCisgICAg ICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAg ICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5jbXAuaWQpOworICAgICAgICBmcHJpbnRm IChzdGRlcnIsICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAgICAgIGdseXBoLT5mYWNlX2lkLAor ICAgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgICAgZ2x5cGgtPnJpZ2h0 X2JveF9saW5lX3ApOworICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAg IGZwcmludGYgKHN0ZGVyciwgIiAgJTNkICVzIC4gWyVkLSVkXVxuIiwKKyAgICAgICAgICAgICAg ICAgICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAg ICAgICAgICAgICAgICAgICAgIGdseXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgtPnNsaWNlLmNt cC50byk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJcbiIpOwor ICAgICAgfQorICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICBN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AgICAgICAgfQorICAg ICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAg ICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAg ICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxf UlVMRVI6CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNv cl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJv dy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g TUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0 X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxf QkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChj dXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmlu Z2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jv dy0+dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIC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S0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K KyAgICBjYXNlIEZJTExfQ09MVU1OOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBo X2ZsYXZvciA9IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2Fy ZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlh bHMuZmNfeCA+IHJlbGF0aXZlX3gpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1D X0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoIU5JTFAg KEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGljYWxf cnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50 X3kgPT0geQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50 X3Zwb3MgPT0gdnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBN Q19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfR0xZ UEg7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlw aCwgcmVsYXRpdmVfeCw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ICAgICAgICAgICAgICAgICAgIEJF R0lOOiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gWFdJREdFVF9HTFlQ SCkKKyAgeworI2lmbmRlZiBIQVZFX1hXSURHRVRTCisgICAgZWFzc3VtZSAoZmFsc2UpOworI2Vs c2UKKyAgICBpZiAobWNfc3RkZXJyX3ApCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAg ICJcbiAgJTVkLyUtNWQgJTVkICU0YyAlNmQgJWMgJTNkIDB4JTA1eCAlNGQgJTEuMWQlMS4xZCAg JTNkICVzICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisg ICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEp LAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5jaGFy cG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisg ICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAg ICAgICAgICAgIDogJy0nKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAg Z2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAg IGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+dS54d2lkZ2V0LAorICAg ICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/IC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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0g Ki8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAgaWYgKHJlbGF0aXZl X3ggPD0geF9saW1pdAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAg IG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnks IGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJz b3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgZXNz ZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlw ZSwKKyAgICAgICAgICAgICAgICAgICBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAm JiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICByZWxhdGl2ZV94 ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICB3aGlsZSAocmVsYXRpdmVfeCA8PSB4 X2xpbWl0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJp eCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAg ICAgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3Jl Z3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMu YWN0aXZlX3AsIE1DX0dMWVBITEVTUywgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAg ICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgICAgICAgICAgcmVs YXRpdmVfeCArPSBmcmFtZV9jaGFyX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAg ICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIFhXSURHRVRfR0xZUEggICAgICAgICAg ICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNB TF9SVUxFUjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoY3Vy c29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg cm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmln aHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog KGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9X CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2Zy aW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jf cm93LT51c2VkW1RFWFRfQVJFQV0gIT0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRf QVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb3BvaW50X3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNf UkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxh dm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2 b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JF VkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgY3Vyc29yX3R5cGUgPSBNQ19SSUdIVF9GUklO R0VfQklUTUFQOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0 aXZlX3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdk LCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAor ICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdf cCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUp OworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAg ICAgICAgICAgICAgICAgICAgICAgIEZJTExfQ09MVU1OOiAgWFdJREdFVF9HTFlQSCAgICAgICAg ICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgRklM TF9DT0xVTU46CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGds eXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID4gcmVs YXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQ SExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX3p2X3Ap CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICghTklMUCAoQlZBUiAoYiwgY3Jv c3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSB5CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9z KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIG1j X2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmY19meCwgeSwgZnks IGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29y X3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBlc3NlbnRp YWxzLmFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAg ICAgICAgICAgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBDVVJTT1JfSU5ESUNBVE9SOgorICAg IHsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICB9Cisg IH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgRU5EOiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisv KiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS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G1hdHJpeCk7CisgIGlmICh2 cG9zID09IGJvdHRvbV92cG9zKQorICAgIHJldHVybjsKKyAgaWYgKCFyb3ctPnVzZWRbVEVYVF9B UkVBXSkKKyAgICByZXR1cm47CisgIGludCBocG9zX3N0YXJ0ID0gc3RhcnQgLSByb3ctPmdseXBo c1tURVhUX0FSRUFdOworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAoc3Rk ZXJyLCAibWNfZHJhd19yb3cgKCVkKTogIGRyYXdfcCAoJXMpIHwgaHBvcyAoJWQpIHwgbGVuICgl ZClcbiIsCisgICAgICAgICAgICAgICAgICAgICB2cG9zLCBkcmF3X3AgPyAieSIgOiAibiIsIGhw b3Nfc3RhcnQsIGhwb3NfbGVuZ3RoKTsKKyAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y29udGVudHM7 CisgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1 Zik7CisgIGludCBvcG9pbnRfZngsIG9wb2ludF9meSwgb3BvaW50X3dkLCBvcG9pbnRfaDsKKyAg aW50IHRleHRfYXJlYV93aWR0aCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7Cisg IGludCBoZWFkZXJfbGluZV9mb3JtYXQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsK KyAgc3RydWN0IGdseXBoX3JvdyAqY3Vyc29yX3JvdyA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPVyAoY3Vyc29yX21h dHJpeCwgdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IE5VTEw7CisgIHN0cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBoID0gKHctPmN1cnNvci52cG9zICE9 IC0xKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfZ2V0X2N1cnNvcl9nbHlw aCAodywgY3Vyc29yX21hdHJpeCwgY3Vyc29yX3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3Iu dnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIGJvb2wgY3Vy c29yX2F0X2ZyaW5nZV9wID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0K KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93 X3dpZHRoX2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3Iu eCA9PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+ Y3Vyc29yLnggPT0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOworICBib29sIGN1cnNvcl9iZXlv bmRfZnJpbmdlX3AgPSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FS RUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhY3Vyc29yX3Jvdy0+ZXhh Y3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+Y3Vyc29yLnggPj0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7Cisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgUkVQTEFD RSBUSEUgUkVBTCBDVVJTT1IKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBlbnVtIGZhY2Vf aWQgYmdfZmFjZV9pZCA9IChjdXJzb3JfZ2x5cGggIT0gTlVMTCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IGN1cnNvcl9nbHlwaC0+ZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICBzdHJ1Y3QgbWNfUkdCIGN1cnNvcl9iZzsKKyAg bWNfc2V0X2xzbF9iZyAodywgYmdfZmFjZV9pZCwgJmN1cnNvcl9iZyk7CisgIC8qIEZJWE1FOiAg UHV0IGluIHNvbWUgY29kZSB0byBkZWZhdWx0IHRvIE1DX0hPTExPV19CT1ggaWYgdGhlIHVzZXIg aGFzCisgIHVud2l0dGluZ2x5IGNvbWUgdXAgd2l0aCBzb21lIHVuYWNjZXB0YWJsZSBmb3JtIG9m IHVucmVjb2duaXplZCBjdXJzb3IgdHlwZS4gKi8KKyAgTGlzcF9PYmplY3QgbGlzcF90eXBlID0g QlZBUiAoYiwgbWNfcmVhbF9mYWtlX2N1cnNvcik7CisgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vy c29yX3R5cGUgPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUp KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbWNfbGlzcF90b19j dXJzb3JfdHlwZSAobGlzcF90eXBlKTsKKyAgaW50IGN1cnNvcl93aWR0aCA9IChDT05TUCAobGlz cF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgID8gWEZJWE5VTSAoWENBUiAoWENEUiAobGlz cF90eXBlKSkpCisgICAgICAgICAgICAgICAgICAgICA6IC0xOworICBzdHJ1Y3QgbWNfUkdCIGN1 cnNvcl9mZzsKKyAgbWNfY29sb3JfcGlja2VyICh3LCBjdXJzb3JfZ2x5cGgsIGVzc2VudGlhbHMs ICZjdXJzb3JfZmcsIC0xLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICByb3df cG9zaXRpb24sIENVUlNPUl9JTkRJQ0FUT1IpOworICBib29sIGZpbGxfY29sdW1uX3RydW1wc19w ID0gKCFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNf dmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLngg PT0gZXNzZW50aWFscy5mY194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWN1 cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFjdXJz b3JfYmV5b25kX2ZyaW5nZV9wKTsKKyAgLyogV2UgdXNlIGEgdGVzdCBzaW1pbGFyIHRvIHRoZSBy ZWFsIGZha2UgY3Vyc29yIHNvIHRoYXQgdGhlIGZyaW5nZSBiaXRtYXAgaXMKKyAgb25seSBkcmF3 biBvbmNlIHBlciB3aW5kb3cuICovCisgIGlmICh2cG9zID09IHctPmN1cnNvci52cG9zCisgICAg ICAmJiBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGggPT0gcm93LT51c2VkW1RFWFRfQVJFQV0KKyAg ICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQor ICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaG9yaXpvbnRh bF9ydWxlcikpKQorICAgIHsKKyAgICAgIC8qIGZyaW5nZSBiaXRtYXBzIHVzZSBmYWNlX2lkIHRv IHNldCB0aGUgZm9yZWdyb3VuZCBjb2xvci4gIFRoZSBvdmVybGF5LWFycm93CisgICAgICBpcyBw cmVzZW50bHkgdGhlIG9ubHkgc2l0dWF0aW9uIHdoZXJlIHRoZSBgZXNzZW50aWFscy5hY3RpdmVf cGAgYW5kIGBtaW5pbWFsX3BgIGFyZQorICAgICAgdXNlZCB0byBkZXRlcm1pbmUgdGhlIGFwcGxp Y2FibGUgZmFjZV9pZC4gKi8KKyAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnID0gey5yZWQgPSAt MS4wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gLTEuMCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gLTEuMH07CisgICAgICAvKiBXZSB1c2Ug dGhlIGZpcnN0IGdseXBoIGluIHRoZSByb3csIHdpdGggYW4gWCBhbmQgSFBPUyBvZiB6ZXJvLiAq LworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgcm93LT5nbHlwaHNbVEVYVF9BUkVB XSwgMCwgLTEsIHctPmN1cnNvci55LCAtMSwKKyAgICAgICAgICAgICAgICAgMCwgdy0+Y3Vyc29y LnZwb3MsIC0xLCAtMSwgTUNfTEVGVF9GUklOR0Vf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1c2VyIGhh cyBub3Qgc3BlY2lmaWVkIGEgdmFsdWUgZm9yIGBtYy1yZWFsLWZha2UtY3Vyc29yJywgb3IgdGhl CisgICAgICB2YWx1ZSBpcyBgbm9gIGluIHRoZSBmb3JtIG9mIGEgc3ltYm9sIG9yIHN0cmluZywg dGhlbiB0aGUgZGVmYXVsdCB3ZSB1c2UKKyAgICAgIGFuIE1DX0JBUiBhbmQgYW4gTUNfSEJBUiAt LSBib3RoIGhhdmluZyBhIGN1cnNvcl93aWR0aCBvZiAxLiAqLworICAgICAgbWNfZ2V0X2N1cnNv cl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50X2Z4LCB3LT5j dXJzb3IueSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRfZnksIHctPmN1 cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgTUNfQkFSLCAxLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywg bWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vy c29yLnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1 cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBNQ19CQVIs IDEsIGN1cnNvcl9mZywgY3Vyc29yX2JnLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSExF U1MsCisgICAgICAgICAgICAgICAgIGRyYXdfcCwgZnJvbV93aGVyZSwgTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IENIX0NBQ0hFCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgICBtY19nZXRfY3Vyc29yX2dl b21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsIHctPmN1cnNv ci55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+Y3Vyc29y Lmhwb3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBNQ19IQkFSLCAxLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0 cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29y LnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNv ci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBNQ19IQkFSLCAx LCBjdXJzb3JfZmcsIGN1cnNvcl9iZywgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRy YXdfcCwKKyAgICAgICAgICAgICAgICAgZnJvbV93aGVyZSwgTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBD SF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0NBQ0hFLCBDVVJTT1Jf SU5ESUNBVE9SKTsKKyAgICB9CisgIGVsc2UgaWYgKCFjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAg ICAgICAgJiYgY3Vyc29yX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5j dXJzb3IudnBvcworICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0Cisg ICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisg ICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+dHlwZSAhPSBTVFJFVENIX0dMWVBIKQorICAgIHsK KyAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93LCB3LT5jdXJzb3Iu eCwgJm9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsICZvcG9pbnRfaCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgs ICZvcG9pbnRfd2QpOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2ds eXBoLCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAg ICAgb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwg b3BvaW50X2gsCisgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGN1 cnNvcl9mZywgY3Vyc29yX2JnLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLAorICAgICAgICAgICAgICAg ICBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLCBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IENIX0NBQ0hFCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOworICAgIH0KKyAgZWxz ZSBpZiAoIWN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGggIT0g TlVMTAorICAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICYm IHctPmN1cnNvci5ocG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhw b3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgKKyAgICAgICAgICAgJiYgY3Vyc29yX2dseXBo LT50eXBlID09IFNUUkVUQ0hfR0xZUEgpCisgICAgeworICAgICAgLyogSWYgYSB1c2VyIGhhcyBz ZXQgYHgtc3RyZXRjaC1jdXJzb3InIHRvIGEgbm9uLW5pbCB2YWx1ZSwgaGUvc2hlIGNob3NlIHRv CisgICAgICBoYXZlIGEgY3Vyc29yIHRoYXQgc3BhbnMgdGhlIGVudGlyZSBsZW5ndGggb2YgdGhl IFNUUkVUQ0hfR0xZUEguICovCisgICAgICBpZiAoIXhfc3RyZXRjaF9jdXJzb3JfcCkKKyAgICAg ICAgeworICAgICAgICAgIC8qIFRoZSBNQ19IQkFSIHNoYWxsIGhhdmUgYSBgY3Vyc29yX3dpZHRo YCBvZiAxLiAqLworICAgICAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwg cm93LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICB3LT5jdXJzb3IueSwgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnZwb3MsICZvcG9pbnRfaCwgTUNf SEJBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmb3BvaW50X3dkKTsK KyAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1 cnNvci54LCBvcG9pbnRfZngsCisgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IueSwgb3Bv aW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsCisgICAgICAgICAgICAgICAg ICAgICBvcG9pbnRfd2QsIG9wb2ludF9oLCBNQ19IQkFSLCAxLCBjdXJzb3JfZmcsIGN1cnNvcl9i ZywKKyAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBk cmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgICAgICBOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgPyBDSF9D QUNIRQorICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7 CisgICAgICAgIH0KKyAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93 LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHctPmN1cnNvci55LCAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsIGN1cnNvcl90eXBlLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCAmb3BvaW50X3dkKTsK KyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29y LngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwg dy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAg ICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBjdXJzb3JfZmcsIGN1cnNv cl9iZywgZXNzZW50aWFscy5hY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgTUNfR0xZUEgsIGRy YXdfcCwgZnJvbV93aGVyZSwgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19j b25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBD SF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgICB9CisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgRFJBVyBBTkQgUkVDT1JEIEZBS0UgQ1VS U09SUworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIGlmIChocG9zX2xlbmd0aCA9PSAxKQor ICAgIHsKKyAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19j b25mKSkpCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUaGUgc3BhY2UgYXBwZW5kZWQgdG8gYSBy b3cgZW5kaW5nIHdpdGggYSBuZXcgbGluZQorICAgICAgICAgIGRvZXMgbm90IGhhdmUgYSBgZ2x5 cGgtPmNoYXJwb3NgICgtMSwgMCkgdGhhdCB3ZSBjYW4KKyAgICAgICAgICB1c2UgZm9yIHRoaXMg cGFydGljdWxhciBhcHBsaWNhdGlvbi4gIFdoZW4gdGhlcmUgaXMgYQorICAgICAgICAgIGBidWZm ZX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U5EX0NIQVJQT1MgKHJvdykgLSAx CisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgc3RhcnQtPmJ5dGVwb3MgIT0gZXNzZW50aWFs cy56dl9ieXRlKQorICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAgICAg ICAgICAgICAgICAgIC8qIFdoZW4gYSBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5IGNvbnRh aW5zCisgICAgICAgICAgICAgICAgICAgICAgICBhIHZpc2libGUgdGFiIGNoYXJhY3RlciAoIsK7 IiksIHRoZSBzdWJzZXF1ZW50CisgICAgICAgICAgICAgICAgICAgICAgICBTVFJFVENIX0dMWVBI IHdpbGwgaGF2ZSB0aGUgc2FtZSBzdGFydC0+Y2hhcnBvcworICAgICAgICAgICAgICAgICAgICAg ICAgYXMgdGhlIGFmb3JlbWVudGlvbmVkIHZpc2libGUgdGFiIGNoYXJhY3Rlci4gKi8KKyAgICAg ICAgICAgICAgICAgICAgICAgIDogKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHByZXZpb3VzX2dseXBoLT5jaGFycG9zID09IHN0YXJ0LT5jaGFy cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAg ICAgICAgIDogZmFsc2U7CisgICAgICAgICAgaW50IHBvc2ludCA9IChyb3dfcG9zaXRpb24gPT0g UE9TVF9aVikKKyAgICAgICAgICAgICAgICAgICAgICAgICA/IC0xCisgICAgICAgICAgICAgICAg ICAgICAgIDogKHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAgICAgICAgICAgICAgIDogKHN0YXJ0LT5ieXRl cG9zICE9IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBz dGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0gLSAx KQorICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93 KSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgOiAoc3RhcnQtPmJ5dGVwb3MgPT0gZXNzZW50 aWFscy56dl9ieXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHN0YXJ0IC0gcm93LT5n bHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpCisgICAgICAgICAg ICAgICAgICAgICAgICAgPyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAgICAgICAgICAgICAgIDog c3RhcnQtPmNoYXJwb3M7CisgICAgICAgICAgTGlzcF9PYmplY3Qgc3BlY3MgPSBtY19hc3NvYyAo bWFrZV9maXhudW0gKHBvc2ludCksIEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29u ZikpOworICAgICAgICAgIGlmICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDAp CisgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAg ICAgJiYgIU5JTFAgKHNwZWNzKQorICAgICAgICAgICAgICAmJiByb3ctPnkgPD0gd2luZG93X3Rl eHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICYmICFza2lwX3AKKyAgICAgICAgICAgICAg JiYgcm93X3Bvc2l0aW9uICE9IFBPU1RfWlYpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IExpc3BfT2JqZWN0IGxpc3BfdHlwZSA9IG1jX250aCAoMSwgc3BlY3MpOworICAgICAgICAgICAg ICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNw X3RvX2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNw X3R5cGUpOworICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IChzdGFydC0+dHlwZSA9PSBJTUFH RV9HTFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0hPTExPV19CT1gKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IGN1cnNvcl90eXBlOworICAgICAgICAgICAgICBp bnQgY3Vyc29yX3dpZHRoID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBYRklYTlVNIChYQ0FSIChYQ0RSIChsaXNwX3R5cGUpKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogLTE7CisgICAgICAgICAgICAgIExpc3BfT2Jq ZWN0IG1jX2ZvcmVncm91bmQgPSBtY19udGggKDIsIHNwZWNzKTsKKyAgICAgICAgICAgICAgc3Ry dWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgIGlmIChTVFJJTkdQIChtY19mb3JlZ3Jv dW5kKSkKKyAgICAgICAgICAgICAgICBtY194d19jb2xvcl92YWx1ZXMgKHcsIG1jX2ZvcmVncm91 bmQsICZsc2xfZmcpOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKFZFQ1RPUlAgKG1jX2ZvcmVn cm91bmQpKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBsc2xfZmcu cmVkID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDApKTsKKyAgICAgICAgICAg ICAgICAgICAgbHNsX2ZnLmdyZWVuID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQs IDEpKTsKKyAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLmJsdWUgPSBYRkxPQVRfREFUQSAoQVJF RiAobWNfZm9yZWdyb3VuZCwgMikpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICAgICAgZWxzZSBpZiAoTklMUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICAg IG1jX2NvbG9yX3BpY2tlciAodywgc3RhcnQsIGVzc2VudGlhbHMsICZsc2xfZmcsIHBvc2ludCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgcm93 X3Bvc2l0aW9uLCBNVUxUSVBMRV9DVVJTT1JTKTsKKyAgICAgICAgICAgICAgaW50IHZwb3MgPSBN QVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAgICAgICAgaW50IHhfbGltaXQg PSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAgICAgICAgICAgICBtY19lbmdp bmUgKHcsIG1hdHJpeCwgcm93LCBzdGFydCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ctPnks CisgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFd LCB2cG9zLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lk dGgsIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwKKyAgICAgICAgICAg ICAgICAgICAgICAgICBsc2xfZmcsIE1VTFRJUExFX0NVUlNPUlMsIGRyYXdfcCwgZnJvbV93aGVy ZSwgTUNfQ0FDSEUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAoIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgJiYg ZXNzZW50aWFscy5mY194IDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICYmIGVzc2VudGlh bHMuZmNfeCA+PSB3LT5tYy5sbnVtX3BpeGVsX3dpZHRoKQorICAgICAgICB7CisgICAgICAgICAg aW50IHhfbGltaXQgPSB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoOworICAgICAgICAgIGJvb2wgcmVh bF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci54ID09IGVzc2VudGlhbHMuZmNfeAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci55ID09IHJvdy0+eQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09 IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgIHN0cnVj dCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgc3RhcnQsIGVz c2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19CQVIsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICByb3dfcG9zaXRpb24sIEZJTExfQ09MVU1OKTsKKyAgICAgICAgICBpZiAoeCArIHN0YXJ0 LT5waXhlbF93aWR0aCA8PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgJiYgKChoZWFk ZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgfHwgaGVh ZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICYmICgoc3RhcnQgIT0gcm93LT5n bHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMQorICAgICAgICAgICAg ICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB4CisgICAgICAgICAgICAgICAgICAgJiYgZXNz ZW50aWFscy5mY194IDwgeCArIHN0YXJ0LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAg IHx8IChzdGFydCA9PSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJF QV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHgpKQor ICAgICAgICAgICAgICAmJiByb3ctPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAg ICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgICAgICBtY19lbmdpbmUg KHcsIG1hdHJpeCwgcm93LCBzdGFydCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ctPnksCisg ICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwgdnBv cywgTUNfQkFSLCAxLAorICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3Nl bnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywKKyAgICAgICAgICAgICAgICAgICAgICAgRklM TF9DT0xVTU4sIGRyYXdfcCwgZnJvbV93aGVyZSwgRkNfQ0FDSEUpOworICAgICAgICB9CisgICAg ICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hvcml6b250YWxfcnVsZXIpKQorICAgICAg ICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQg eF9saW1pdCA9IChzdGFydCA9PSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RF WFRfQVJFQV0gLSAxKQorICAgICAgICAgICAgICA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AgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAg ICAgICYmICFmaWxsX2NvbHVtbl90cnVtcHNfcCkKKyAgICAgICAgeworICAgICAgICAgIGN1cnNv cl90eXBlID0gKHN0YXJ0LT50eXBlID09IElNQUdFX0dMWVBIKQorICAgICAgICAgICAgICAgICAg ICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0JBUjsK KyAgICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7 CisgICAgICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnkgPT0gcm93 LT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnZw b3MgPT0gdnBvcyk7CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAg bWNfY29sb3JfcGlja2VyICh3LCBzdGFydCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIGN1cnNv cl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBWRVJU SUNBTF9SVUxFUik7CisgICAgICAgICAgaWYgKCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2 cG9zID4gMCkKKyAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAg ICAgICAgICAgICAmJiAoKHN0YXJ0ICE9IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVz ZWRbVEVYVF9BUkVBXSAtIDEKKyAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSB4 CisgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPCB4ICsgc3RhcnQtPnBpeGVsX3dp ZHRoKQorICAgICAgICAgICAgICAgICAgfHwgKHN0YXJ0ID09IHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5jdXJzb3IueCA+PSB4KSkKKyAgICAgICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0 X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAg ICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwg eF9saW1pdCwgcm93LT55LAorICAgICAgICAgICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0sIHZwb3MsIGN1cnNvcl90eXBlLCAxLAorICAgICAgICAgICAgICAgICAg ICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywKKyAg ICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVIsIGRyYXdfcCwgZnJvbV93aGVyZSwg Q0hfQ0FDSEUpOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAg aW50IHJlbGF0aXZlX3ggPSAwOworICAgICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9NQVJHSU5f QVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAgICAgIHsKKyAgICAgICAgICAg IHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBoc1thcmVhXTsKKyAgICAgICAgICAgIHN0 cnVjdCBnbHlwaCAqZ2x5cGhfZW5kID0gZ2x5cGggKyByb3ctPnVzZWRbYXJlYV07CisgICAgICAg ICAgICAvKiBHbHlwaCBmb3IgYSBsaW5lIGVuZCBpbiB0ZXh0LiAqLworICAgICAgICAgICAgaWYg KGFyZWEgPT0gVEVYVF9BUkVBICYmIGdseXBoID09IGdseXBoX2VuZCAmJiBnbHlwaC0+Y2hhcnBv cyA+IDApCisgICAgICAgICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgICAgICAgZm9yICg7IGds eXBoIDwgZ2x5cGhfZW5kOyArK2dseXBoKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgaWYgKHZwb3MgIT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgICAgICAgICAgJiYgZ2x5 cGggIT0gZ2x5cGhfZW5kIC0gMQorICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZj X3ggPCByZWxhdGl2ZV94CisgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54IDwgcmVs YXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIG1jX2NvbmYpKSkKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAg ICAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkp CisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qIFRoZSBzcGFjZSBh cHBlbmRlZCB0byBhIHJvdyBlbmRpbmcgd2l0aCBhIG5ldyBsaW5lIGRvZXMKKyAgICAgICAgICAg ICAgICAgICAgbm90IGhhdmUgYSBgZ2x5cGgtPmNoYXJwb3NgICgtMSwgMCkgdGhhdCB3ZSBjYW4g dXNlIGZvciB0aGlzCisgICAgICAgICAgICAgICAgICAgIHBhcnRpY3VsYXIgYXBwbGljYXRpb24u ICBXaGVuIGEgYGJ1ZmZlci1kaXNwbGF5LXRhYmxlJyBlbnRyeQorICAgICAgICAgICAgICAgICAg ICBhc3NpZ25zIGEgdmlzaWJsZSBnbHlwaCB0byBhIG5ldyBsaW5lLCB0aGVyZSBpcyBubyBwcm9i bGVtCisgICAgICAgICAgICAgICAgICAgIGJlY2F1c2UgdGhhdCBnbHlwaCBoYXMgYSBgZ2x5cGgt PmNoYXJwb3MnIHRoYXQgd2UgY2FuIHVzZS4KKyAgICAgICAgICAgICAgICAgICAgV2hlbiBubyB2 aXNpYmxlIEVPTCBnbHlwaCBleGlzdHMsIHdlIHVzZSB0aGUgZm9sbG93aW5nIHRlc3Q6CisgICAg ICAgICAgICAgICAgICAgIHRoZSBhcHBlbmRlZCBzcGFjZSBoYXMgYSBwb3NpdGlvbiB0aGF0IGlz IG9uZSBsZXNzIHRoYW4gdGhlCisgICAgICAgICAgICAgICAgICAgIGVuZCBvZiB0aGUgbWF0cml4 IHJvdy4gKi8KKyAgICAgICAgICAgICAgICAgICAgaW50IGhwb3MgPSBnbHlwaCAtIHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqcHJldmlv dXNfZ2x5cGggPSAoMCA8PSBocG9zIC0gMSAmJiBocG9zIC0gMSA8IHJvdy0+dXNlZFtURVhUX0FS RUFdKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgaHBvcyAtIDEKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgICAgICAgICAgICAgICAg ICAgLy8gc3RydWN0IGdseXBoICpsYXN0X2dseXBoID0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSAr IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCBza2lw X3AgPSAocHJldmlvdXNfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9PSBNQVRSSVhfUk9XX0VORF9DSEFS UE9TIChyb3cpIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlw aC0+Ynl0ZXBvcyAhPSBlc3NlbnRpYWxzLnp2X2J5dGUpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAv KiBXaGVuIGEgYGJ1ZmZlci1kaXNwbGF5LXRhYmxlJyBlbnRyeSBjb250YWlucworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGEgdmlzaWJsZSB0YWIgY2hhcmFjdGVyICgiwrsiKSwg dGhlIHN1YnNlcXVlbnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTVFJFVENI X0dMWVBIIHdpbGwgaGF2ZSB0aGUgc2FtZSBnbHlwaC0+Y2hhcnBvcworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGFzIHRoZSBhZm9yZW1lbnRpb25lZCB2aXNpYmxlIHRhYiBjaGFy YWN0ZXIuICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAocHJldmlvdXNf Z2x5cGggIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHBy ZXZpb3VzX2dseXBoLT5jaGFycG9zID09IGdseXBoLT5jaGFycG9zKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgaW50IHBvc2ludCA9IChyb3dfcG9z aXRpb24gPT0gUE9TVF9aVikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAt MQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAocm93X3Bvc2l0aW9uID09IEFU X1pWKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBlc3NlbnRpYWxzLnp2 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaC0+Ynl0ZXBvcyAhPSBl c3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbVEVYVF9BUkVBXSAt IDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19FTkRf Q0hBUlBPUyAocm93KSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGds eXBoLT5ieXRlcG9zID09IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+ dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGdseXBo LT5jaGFycG9zOworICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBzcGVjcyA9IG1jX2Fz c29jIChtYWtlX2ZpeG51bSAocG9zaW50KSwgQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBt Y19jb25mKSk7CisgICAgICAgICAgICAgICAgICAgIGlmICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+ IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVf Zm9ybWF0ID09IDApCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoc3BlY3MpCisg ICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kg KHcpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhc2tpcF9wCisgICAgICAgICAgICAgICAg ICAgICAgICAmJiByb3dfcG9zaXRpb24gIT0gUE9TVF9aVikKKyAgICAgICAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBsaXNwX3R5cGUgPSBtY19u dGggKDEsIHNwZWNzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5 cGUgY3Vyc29yX3R5cGUgPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNwX3RvX2N1cnNv cl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbWNfbGlzcF90b19jdXJzb3JfdHlwZSAobGlz cF90eXBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gKGdseXBoLT50 eXBlID09IElNQUdFX0dMWVBIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IE1DX0hPTExPV19CT1gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBjdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGgg PSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBYRklYTlVNIChYQ0FSIChYQ0RSIChsaXNwX3R5cGUpKSkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IC0xOworICAgICAgICAgICAgICAgICAg ICAgICAgTGlzcF9PYmplY3QgbWNfZm9yZWdyb3VuZCA9IG1jX250aCAoMiwgc3BlY3MpOworICAg ICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAg ICAgICAgICAgICBpZiAoU1RSSU5HUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAg ICAgICAgICAgIG1jX3h3X2NvbG9yX3ZhbHVlcyAodywgbWNfZm9yZWdyb3VuZCwgJmxzbF9mZyk7 CisgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKFZFQ1RPUlAgKG1jX2ZvcmVncm91 bmQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGxzbF9mZy5yZWQgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwg MCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLmdyZWVuID0gWEZMT0FU X0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDEpKTsKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGxzbF9mZy5ibHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDIp KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgZWxzZSBpZiAoTklMUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIGdseXBoLCBlc3NlbnRpYWxzLCAmbHNsX2Zn LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3Np bnQsIGN1cnNvcl90eXBlLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlMpOworICAgICAgICAgICAg ICAgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAg ICAgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywg VEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4 LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICB4X2xpbWl0LCByb3ctPnksIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgY3Vyc29yX3R5cGUs IGN1cnNvcl93aWR0aCwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlMsIGRyYXdfcCwgZnJvbV93aGVy ZSwgTUNfQ0FDSEUpOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA8 PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194 ID49IHctPm1jLmxudW1fcGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVB KTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vy c29yLnggPT0gZXNzZW50aWFscy5mY194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci55ID09IHJvdy0+eQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBnbHlw aCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnZwb3MgPT0gdnBvcyk7CisgICAgICAgICAg ICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAg ICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICAgICAgICAg ICAgbWNfY29sb3JfcGlja2VyICh3LCBnbHlwaCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIE1D X0JBUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRp b24sIEZJTExfQ09MVU1OKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGhwb3MgPj0gaHBvc19z dGFydAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9z X2xlbmd0aAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgcmVsYXRpdmVfeCArIGdseXBoLT5w aXhlbF93aWR0aCA8PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICYm ICgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICYmICgoZ2x5cGggIT0gZ2x5cGhfZW5kIC0gMQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0gcmVsYXRpdmVfeAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPCByZWxhdGl2ZV94ICsgZ2x5cGgtPnBp eGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChnbHlwaCA9PSBnbHlw aF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMu ZmNfeCA+PSByZWxhdGl2ZV94KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+eSA8 PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFy ZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgICAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBt YXRyaXgsIHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZlX3gsIHhfbGltaXQsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICByb3ctPnksIGhwb3MsIHZwb3MsIE1DX0JBUiwgMSwgY3Vy c29yX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMs IHJvd19wb3NpdGlvbiwgbHNsX2ZnLCBGSUxMX0NPTFVNTiwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGRyYXdfcCwgZnJvbV93aGVyZSwgRkNfQ0FDSEUpOworICAgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIg KGIsIGNoX2hvcml6b250YWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAmJiB2cG9zID09 IHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAg ICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOwor ICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICAgICAg ICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBnbHlwaCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEs IE1DX0hCQVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93X3Bv c2l0aW9uLCBIT1JJWk9OVEFMX1JVTEVSKTsKKyAgICAgICAgICAgICAgICAgICAgLyogUHJlc2Vy dmUgc3VwcG9ydCBmb3IgZGVmYXVsdCBiZWhhdmlvciBzdWNoIHRoYXQgYSB1c2VyIG1heQorICAg ICAgICAgICAgICAgICAgICBzcGVjaWZ5IHRoZSBoZWlnaHQgb2YgYW4gTUNfSEJBUiwgd2hpY2gg YmVnaW5zIGl0cyBqb3VybmV5CisgICAgICAgICAgICAgICAgICAgIGFzIHRoZSBgY3Vyc29yX3dp ZHRoJy4gIGBtY19nZXRfY3Vyc29yX2dlb21ldHJ5JyByZWFkanVzdHMuICovCisgICAgICAgICAg ICAgICAgICAgIGlmIChocG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgICAg ICYmIGhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgpCisgICAgICAgICAgICAgICAgICAg ICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZlX3gsIHhf bGltaXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3ctPnksIGhwb3MsIHZw b3MsIE1DX0hCQVIsIDEsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywgSE9SSVpPTlRBTF9SVUxF UiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdfcCwgZnJvbV93aGVyZSwg Q0hfQ0FDSEUpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAg ICAgICAgICAgICAgJiYgIWZpbGxfY29sdW1uX3RydW1wc19wKQorICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IChnbHlwaC0+dHlwZSA9PSBJTUFH RV9HTFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0hPTExPV19C T1gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0JBUjsKKyAgICAgICAg ICAgICAgICAgICAgaW50IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEp OworICAgICAgICAgICAgICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9ICh3LT5jdXJz b3IueSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+Y3Vyc29yLnZwb3MgPT0gdnBvcyk7CisgICAgICAgICAgICAgICAgICAgIGlu dCBocG9zID0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAg ICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICAgICAgICAgICAgbWNfY29sb3Jf cGlja2VyICh3LCBnbHlwaCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIGN1cnNvcl90eXBlLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgVkVS VElDQUxfUlVMRVIpOworICAgICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0 CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVu Z3RoCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAg JiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVf Zm9ybWF0ID09IDApCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGdseXBoICE9IGdseXBo X2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0g cmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8 IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgfHwgKGdseXBoID09IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gcmVsYXRpdmVfeCkpCisgICAgICAgICAgICAgICAg ICAgICAgICAmJiByb3ctPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAg ICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgICAgICAg ICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4 X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9zLCB2 cG9zLCBjdXJzb3JfdHlwZSwgMSwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgbHNsX2ZnLCBWRVJUSUNBTF9S VUxFUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdfcCwgZnJvbV93aGVy ZSwgQ0hfQ0FDSEUpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJlbGF0 aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICB9CisgICAgICAgICAg fQorICAgICAgfQorICAvLyAgY2xvY2tfdCBjbG9ja19lbmQgPSBjbG9jaygpOworICAvLyAgZG91 YmxlIGNwdV90aW1lX3VzZWQgPSAoKGRvdWJsZSkgKGNsb2NrX2VuZCAtIGNsb2NrX3N0YXJ0KSkg LyBDTE9DS1NfUEVSX1NFQzsKKyAgLy8gIGZwcmludGYgKHN0ZGVyciwgIm1jX2RyYXdfcm93ICgl cyk6ICBUSU1FICglZilcbiIsIG1jX3dpbmRvdyAodyksIGNwdV90aW1lX3VzZWQpOworfQorCiti b29sCittY19yZWRyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4 ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgICAgIGVudW0gZ2x5 cGhfcm93X2FyZWEgYXJlYSwgaW50IHN0YXJ0X3gsIGludCBzdGFydF9ocG9zLCBpbnQgZW5kX2hw b3MsCisgICAgICAgICAgICAgICBib29sIGNsZWFyX2VvbF9wLCBlbnVtIGRyYXdfZ2x5cGhzX2Zh Y2UgaGwsCisgICAgICAgICAgICAgICBlbnVtIG1jX3JlZHJhd19yb3dfdHlwZSBmcm9tX3doZXJl KQoreworICBib29sIGdvX3AgPSAoK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CBURVhUX0FSRUEsIC0xKTsKKyAgICB9CisgIC8vICBjbG9j a19zdGFydCA9IGNsb2NrKCk7CisgIGludCB2bnRoID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1h dHJpeCk7CisgIC8qIFNUUkVUQ0hfR0xZUEggbWF5IGNvbnRhaW4gbW9yZSB0aGFuIG9uZSBmYWtl IGN1cnNvciBhdCB0aGUgc2FtZSBIUE9TLiAqLworICBmb3IgKGVudW0gbWNfY2FjaGVfdHlwZSBj YWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAg ICAgICsrY2FjaGVfdHlwZSkKKyAgICB7CisgICAgICBmb3IgKGludCBudGggPSAwOworICAgICAg ICAgICBtY190cmF2ZXJzZV9jYWNoZV9wICh3LT5tY19tYXRyaXgsIGNhY2hlX3R5cGUsIHZudGgs IG50aCk7CisgICAgICAgICAgICsrbnRoKQorICAgICAgICB7CisgICAgICAgICAgaW50IHggPSB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLng7CisgICAgICAg ICAgaW50IGZ4ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XS5meDsKKyAgICAgICAgICBpbnQgeSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF0ueTsKKyAgICAgICAgICBpbnQgZnkgPSB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZ5OworICAgICAgICAgIGludCBocG9zID0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5ocG9zOworICAgICAg ICAgIGludCB2cG9zID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXS52cG9zOworICAgICAgICAgIGludCB3ZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF0ud2Q7CisgICAgICAgICAgaW50IGggPSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmg7CisgICAgICAgICAgZW51bSBtY19j dXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF0uY3Vyc29yX3R5cGU7CisgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCA9 IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vyc29yX3dp ZHRoOworICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnID0gey5yZWQgPSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZnLnJlZCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmZnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIC5ibHVlID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXS5mZy5ibHVlfTsKKyAgICAgICAgICAvLyAgc3RydWN0IG1jX1JHQiBsc2xfYmcgPSB7 LnJlZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcu cmVkLAorICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLmdyZWVuLAorICAg ICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcuYmx1ZX07CisgICAgICAgICAgYm9v bCBhY3RpdmVfcCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uYWN0aXZlX3A7CisgICAgICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5nbHlwaF9mbGF2b3I7 CisgICAgICAgICAgYm9vbCBlbmFibGVkX3AgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLmVuYWJsZWRfcDsKKyAgICAgICAgICBpZiAodnBvcyA9PSB2bnRo CisgICAgICAgICAgICAgICYmICgoaHBvcyA+PSBzdGFydF9ocG9zCisgICAgICAgICAgICAgICAg ICAgJiYgaHBvcyA8IGVuZF9ocG9zKQorICAgICAgICAgICAgICAgICAgLyogQSBmbG9hdGluZyBj dXJzb3IgYmV5b25kIHRoZSBlbmQgb2YgdGhlIGdseXBoIHJvdy4gKi8KKyAgICAgICAgICAgICAg ICAgIHx8IChocG9zICsgMSA9PSBzdGFydF9ocG9zCisgICAgICAgICAgICAgICAgICAgICAgJiYg aHBvcyArIDEgPT0gZW5kX2hwb3MpKQorICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3AgPSBmYWxzZTsKKyAgICAgICAg ICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnks IGhwb3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Y3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgbHNsX2ZnLCBhY3RpdmVfcCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgcmVtb3ZlX3ApOworICAgICAg ICAgICAgfQorICAgICAgICB9CisgICAgfQorICByZXR1cm4gdHJ1ZTsKKyAgLy8gIGNsb2NrX2Vu ZCA9IGNsb2NrKCk7CisgIC8vICBkb3VibGUgdGltZV9jdXJzb3JzID0gKChkb3VibGUpIChjbG9j a19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8vICBmcHJpbnRmIChz dGRlcnIsICJtY19yZWRyYXdfcm93ICglZCk6ICBocG9zICglZC8lZCkgfCBnbHlwaHMgKCVmKSB8 IGN1cnNvcnMgKCVmKVxuIiwKKyAgLy8gICAgICAgICAgICAgICAgICAgdnBvcywgc3RhcnRfaHBv cywgZW5kX2hwb3MsIHRpbWVfZ2x5cGhzLCB0aW1lX2N1cnNvcnMpOworfQorCit2b2lkCittY19l cmFzZV9yb3cgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwg c3RydWN0IGdseXBoX3JvdyAqcm93KQoreworICBpbnQgdm50aCA9IE1BVFJJWF9ST1dfVlBPUyAo cm93LCBtYXRyaXgpOworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAoc3Rk ZXJyLCAibWNfZXJhc2Vfcm93ICglcyk6ICB2cG9zICglZClcbiIsIG1jX3dpbmRvdyAodyksIHZu dGgpOworICAvLyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAvLyAgICBmcHJpbnRmIChzdGRl cnIsICJtY19lcmFzZV9oZWxwZXIgKCVzKTogIGNhY2hlICglcykgfCB2cG9zICglZClcbiIsCisg IC8vICAgICAgbWNfd2luZG93ICh3KSwgbWNfY2FjaGVfdHlwZV90b19zdHJpbmcgKGNhY2hlX3R5 cGUpLCB2bnRoKTsKKyAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NB Q0hFOworICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICArK2NhY2hlX3R5cGUp CisgICAgeworICAgICAgZm9yIChpbnQgbnRoID0gMDsKKyAgICAgICAgICAgbWNfdHJhdmVyc2Vf Y2FjaGVfcCAody0+bWNfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGgpOworICAgICAgICAg ICArK250aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB4ID0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS54OworICAgICAgICAgIGludCBmeCA9IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZng7CisgICAgICAgICAg aW50IHkgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLnk7 CisgICAgICAgICAgaW50IGZ5ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS5meTsKKyAgICAgICAgICBpbnQgaHBvcyA9IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uaHBvczsKKyAgICAgICAgICBpbnQgdnBvcyA9IHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0udnBvczsKKyAgICAg ICAgICBpbnQgd2QgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLndkOworICAgICAgICAgIGludCBoID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXS5oOworICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29y X3R5cGUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1 cnNvcl90eXBlOworICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGggPSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl93aWR0aDsKKyAgICAgICAgICAv LyAgc3RydWN0IG1jX1JHQiBsc2xfZmcgPSB7LnJlZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcucmVkLAorICAgICAgICAgIC8vICAgICAgICAgICAg ICAgICAgICAgICAgICAuZ3JlZW4gPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhdLmZnLmdyZWVuLAorICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAg ICAgICAuYmx1ZSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uZmcuYmx1ZX07CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfYmcgPSB7LnJlZCA9IHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcucmVkLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcuZ3JlZW4sCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgLmJsdWUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhdLmJnLmJsdWV9OworICAgICAgICAgIGJvb2wgYWN0aXZlX3AgPSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmFjdGl2ZV9wOworICAg ICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGhfZmxhdm9yOworICAgICAgICAgIGJvb2wg ZW5hYmxlZF9wID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XS5lbmFibGVkX3A7CisgICAgICAgICAgLyogYG1hdHJpeF9yb3cnIGluIGBkaXNwbmV3LmNgIGNv bnRhaW5zIHRoZSBmb2xsb3dpbmcgdGVzdHMsCisgICAgICAgICAgZWFzc2VydCAobWF0cml4ICYm IG1hdHJpeC0+cm93cyk7CisgICAgICAgICAgZWFzc2VydCAocm93ID49IDAgJiYgcm93IDwgbWF0 cml4LT5ucm93cyk7ICovCisgICAgICAgICAgYm9vbCBiYXJmX2NyYXNoX29uZSA9IChtYXRyaXgg JiYgbWF0cml4LT5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgICAgICAgICBpZiAoYmFyZl9jcmFz aF9vbmUpCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBib29sIGJhcmZfY3Jhc2hf dHdvID0gKHZwb3MgPj0gMCAmJiB2cG9zIDwgbWF0cml4LT5ucm93cykgPyBmYWxzZSA6IHRydWU7 CisgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hfdHdvKQorICAgICAgICAgICAgY29udGludWU7Cisg ICAgICAgICAgaWYgKHZwb3MgPT0gdm50aAorICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3Ig PT0gTUNfR0xZUEgKKyAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBtY19lcmFzZV9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCB5LCBocG9z LCB2cG9zLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCk7CisgICAgICAgICAgICAgIHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxlZF9wID0g ZmFsc2U7CisgICAgICAgICAgICAgIC0tdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90 eXBlXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKHZwb3MgPT0gdm50aAor ICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgYm9vbCByZW1vdmVfcCA9IHRydWU7CisgICAgICAgICAgICAgICAgbWNfZHJh d19lcmFzZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3Ms IHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlw ZSwgY3Vyc29yX3dpZHRoLCBsc2xfYmcsIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAgICAgICAgICAg ICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmVuYWJsZWRf cCA9IGZhbHNlOworICAgICAgICAgICAgICAgIC0tdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtj YWNoZV90eXBlXTsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdID0gMDsKKyAgICB9Cit9CisKKy8q IEVyYXNlIGZha2UgY3Vyc29ycyBmcm9tIChtaW4sIHJ1bi5jdXJyZW50X3ksIHJ1bi5kZXNpcmVk X3k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yaXguY3Vyc29yc191c2VkW0NIX0NB Q0hFXSA+IDAKKyAgICAgICAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2Vk W0ZDX0NBQ0hFXSA+IDApOworICBib29sIGdvX3R3b19wID0gKEJVRkZFUlAgKHctPmNvbnRlbnRz KQorICAgICAgICAgICAgICAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAg ICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkpOwor ICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfcHJlX3Nj cm9sbF9jbGVhbiAoJXMpOlxuXAorICAlcyB8IGdvX29uZV9wICglcykgfCBnb190d29fcCAoJXMp XG5cCisgIHN0YXJ0X3Zwb3MgKCVkKSB8IG5yb3dzX3Njcm9sbGVkICglZClcblwKKyAgJXM6ICBy dW4uY3VycmVudC9kZXNpcmVkX3kgKCVkLyVkKSB8IHJ1bi5oZWlnaHQgKCVkKVxuIiwKKyAgICBt Y193aW5kb3cgKHcpLCAoZnJvbV93aGVyZSA9PSBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9N QVRSSVhfRE9XTikKKyAgICAgICAgICAgICAgICAgICAgID8gIlRSWV9XSU5ET1dfUkVVU0lOR19D VVJSRU5UX01BVFJJWF9ET1dOIgorICAgICAgICAgICAgICAgICAgIDogKGZyb21fd2hlcmUgPT0g VFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQKQorICAgICAgICAgICAgICAgICAg ICAgPyAiVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQIgorICAgICAgICAgICAg ICAgICAgIDogKGZyb21fd2hlcmUgPT0gVFJZX1dJTkRPV19JRCkKKyAgICAgICAgICAgICAgICAg ICAgID8gIlRSWV9XSU5ET1dfSUQiCisgICAgICAgICAgICAgICAgICAgOiAiVU5LTk9XTiIsCisg ICAgZ29fb25lX3AgPyAieWVzIiA6ICJubyIsIGdvX3R3b19wID8gInllcyIgOiAibm8iLAorICAg IHN0YXJ0X3Zwb3MsIG5yb3dzX3Njcm9sbGVkLAorICAgIHJ1bi5jdXJyZW50X3kgPCBydW4uZGVz aXJlZF95ID8gIuKGkyIgOiAi4oaRIiwKKyAgICBydW4uY3VycmVudF95LCBydW4uZGVzaXJlZF95 LCBydW4uaGVpZ2h0KTsKKyAgaWYgKCFnb19vbmVfcCAmJiAhZ29fdHdvX3ApCisgICAgcmV0dXJu OworICBib29sIHVwZGF0aW5nX2ZyYW1lX3AgPSBmYWxzZTsKKyAgc3RydWN0IGZyYW1lICpmID0g WEZSQU1FICh3LT5mcmFtZSk7CisgIGlmIChYRlJBTUUgKHctPmZyYW1lKSAhPSBmLT5tY191cGRh dGluZ19mcmFtZQorICAgICAgJiYgKGdvX29uZV9wIHx8IGdvX3R3b19wKSkKKyAgICB7CisgICAg ICB1cGRhdGluZ19mcmFtZV9wID0gdHJ1ZTsKKyAgICAgIHVwZGF0ZV9iZWdpbiAoZik7CisgICAg fQorICBpZiAody0+cGh5c19jdXJzb3Jfb25fcAorICAgICAgJiYgZ29fdHdvX3ApCisgICAgZXJh c2VfcGh5c19jdXJzb3IgKHcpOworICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3LT5j dXJyZW50X21hdHJpeDsKKyAgZm9yIChpbnQgdm50aCA9IHN0YXJ0X3Zwb3M7CisgICAgICAgbWF0 cml4ICE9IE5VTEwKKyAgICAgICAmJiB2bnRoIDwgbWF0cml4LT5ucm93cworICAgICAgICYmIE1B VFJJWF9ST1cgKG1hdHJpeCwgdm50aCktPmVuYWJsZWRfcAorICAgICAgICYmIGdvX29uZV9wOwor ICAgICAgICsrdm50aCkKKyAgICB7CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cgPSBNQVRS SVhfUk9XIChtYXRyaXgsIHZudGgpOworICAgICAgbWNfZXJhc2Vfcm93ICh3LCBtYXRyaXgsIHJv dyk7CisgICAgfQorICBpZiAodXBkYXRpbmdfZnJhbWVfcCkKKyAgICB1cGRhdGVfZW5kIChmKTsK KyAgLy8gbWNfcmVzZXRfY2FjaGUgKHcpOworfQorCitERUZVTiAoIm1jLXN0ZGVyciIsIEZtY19z dGRlcnIsIFNtY19zdGRlcnIsIDAsIDEsICJQIiwKKyAgICAgICBkb2M6IC8qIFRvZ2dsZSB0cmFj aW5nIG9mIG11bHRpcGxlIGZha2UgY3Vyc29ycy4KK1dpdGggQVJHLCB0dXJuIHRyYWNpbmcgb24g aWYgYW5kIG9ubHkgaWYgQVJHIGlzIHBvc2l0aXZlLiAqLykKKyAgKExpc3BfT2JqZWN0IGFyZykK K3sKKyAgaWYgKE5JTFAgKGFyZykpCisgICAgbWNfc3RkZXJyX3AgPSAhbWNfc3RkZXJyX3A7Cisg IGVsc2UKKyAgICB7CisgICAgICBhcmcgPSBGcHJlZml4X251bWVyaWNfdmFsdWUgKGFyZyk7Cisg ICAgICBtY19zdGRlcnJfcCA9IFhGSVhOVU0gKGFyZykgPiAwOworICAgIH0KKyAgcmV0dXJuIFFu aWw7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiAMCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioKIAkJICAgICAgV2luZG93IGRpc3BsYXkgZGlt ZW5zaW9ucwpAQCAtM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AgICAgICAgICAgICAgICAgICAgICAgIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2hfb25lKQor ICAgIHJldHVybiBoc2Nyb2xsZWRfcDsKKworICAvKiBgcmVzZWF0XzEnOiAgQ0hBUlBPUyAocG9z KSA+PSBCRUdWICYmIENIQVJQT1MgKHBvcykgPD0gWlYgKi8KKyAgYm9vbCBiYXJmX2NyYXNoX3R3 byA9IChjaGFycG9zID49IEJFR1YgJiYgY2hhcnBvcyA8PSBaVikKKyAgICAgICAgICAgICAgICAg ICAgICAgICA/IGZhbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgOiB0cnVlOworICBpZiAo YmFyZl9jcmFzaF90d28pCisgICAgcmV0dXJuIGhzY3JvbGxlZF9wOworCisvKiBlbmQgTVVMVElQ TEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICAgIC8qIE1v dmUgaXRlcmF0b3IgdG8gcHQgc3RhcnRpbmcgYXQgY3Vyc29yX3Jvdy0+c3RhcnQgaW4KIAkJIGEg bGluZSB3aXRoIGluZmluaXRlIHdpZHRoLiAgKi8KIAkgICAgICBpbml0X3RvX3Jvd19zdGFydCAo Jml0LCB3LCBjdXJzb3Jfcm93KTsKQEAgLTE0Mjg3LDkgKzE4OTY0LDIyIEBAIHJlZGlzcGxheV9p bnRlcm5hbCAodm9pZCkKIAkgICAgICAqdy0+ZGVzaXJlZF9tYXRyaXgtPm1ldGhvZCA9IDA7CiAJ ICAgICAgZGVidWdfbWV0aG9kX2FkZCAodywgIm9wdGltaXphdGlvbiAxIik7CiAjZW5kaWYKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogI2lm ZGVmIEhBVkVfV0lORE9XX1NZU1RFTQorICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAg ICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisg ICAgbWNfdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCBmYWxzZSk7CisgICAgZWxzZQogCSAgICAg IHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgZmFsc2UpOwogI2VuZGlmCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIAkgICAgICBnb3RvIHVwZGF0ZTsKIAkgICAgfQogCSAgZWxzZQpA QCAtMTc2ODcsMTAgKzIyMzc3LDIyIEBAIHJlZGlzcGxheV93aW5kb3cgKExpc3BfT2JqZWN0IHdp bmRvdywgYm9vbCBqdXN0X3RoaXNfb25lX3ApCiAgICAgfQogCiAjaWZkZWYgSEFWRV9XSU5ET1df U1lTVEVNCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKyAgYm9vbCBrZWVwX2N1cnJlbnRfcCA9IChqdXN0X3RoaXNfb25lX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICB8fCAoIXVzZWRfY3VycmVudF9tYXRyaXhfcCAmJiAhb3ZlcmxheV9h cnJvd19zZWVuKQorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IHctPnBzZXVkb193aW5kb3df cCk7CisKKyAgYm9vbCBmcmluZ2VzX3VwZGF0ZWRfcCA9IChCVUZGRVJQICh3LT5jb250ZW50cykK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG1j X3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywga2VlcF9jdXJyZW50X3ApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywga2VlcF9jdXJyZW50X3Ap OworCiAgIGlmIChGUkFNRV9XSU5ET1dfUCAoZikKLSAgICAgICYmIHVwZGF0ZV93aW5kb3dfZnJp bmdlcyAodywgKGp1c3RfdGhpc19vbmVfcAotCQkJCSAgICB8fCAoIXVzZWRfY3VycmVudF9tYXRy aXhfcCAmJiAhb3ZlcmxheV9hcnJvd19zZWVuKQotCQkJCSAgICB8fCB3LT5wc2V1ZG9fd2luZG93 X3ApKSkKKyAgICAgICYmIGZyaW5nZXNfdXBkYXRlZF9wKQogICAgIHsKICAgICAgIHVwZGF0ZV9i ZWdpbiAoZik7CiAgICAgICBibG9ja19pbnB1dCAoKTsKQEAgLTE3NzA1LDYgKzIyNDA3LDkgQEAg cmVkaXNwbGF5X3dpbmRvdyAoTGlzcF9PYmplY3Qgd2luZG93LCBib29sIGp1c3RfdGhpc19vbmVf cCkKICAgICAgIHVwZGF0ZV9lbmQgKGYpOwogICAgIH0KIAorLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICBpZiAoV0lORE9XX0JPVFRPTV9ESVZJREVSX1dJRFRIICh3KSkKICAgICB4X2Ry YXdfYm90dG9tX2RpdmlkZXIgKHcpOwogI2VuZGlmIC8qIEhBVkVfV0lORE9XX1NZU1RFTSAqLwpA QCAtMTgwMTAsNiArMjI3MTUsNyBAQCB0cnlfd2luZG93X3JldXNpbmdfY3VycmVudF9tYXRyaXgg KHN0cnVjdCB3aW5kb3cgKncpCiAJICAgICBzY3JvbGxfcnVuX2hvb2sgd2lsbCBjbGVhciB0aGUg Y3Vyc29yLCBhbmQgdXNlIHRoZQogCSAgICAgY3VycmVudCBtYXRyaXggdG8gZ2V0IHRoZSBoZWln aHQgb2YgdGhlIHJvdyB0aGUgY3Vyc29yIGlzCiAJICAgICBpbi4gICovCisKIAkgIHJ1bi5jdXJy ZW50X3kgPSBzdGFydF9yb3ctPnk7CiAJICBydW4uZGVzaXJlZF95ID0gaXQuY3VycmVudF95Owog CSAgcnVuLmhlaWdodCA9IGl0Lmxhc3RfdmlzaWJsZV95IC0gaXQuY3VycmVudF95OwpAQCAtMTgw MTksNiArMjI3MjUsMTYgQEAgdHJ5X3dpbmRvd19yZXVzaW5nX2N1cnJlbnRfbWF0cml4IChzdHJ1 Y3Qgd2luZG93ICp3KQogCSAgICAgIHVwZGF0ZV9iZWdpbiAoZik7CiAJICAgICAgRlJBTUVfUklG IChmKS0+dXBkYXRlX3dpbmRvd19iZWdpbl9ob29rICh3KTsKIAkgICAgICBGUkFNRV9SSUYgKGYp LT5jbGVhcl93aW5kb3dfbW91c2VfZmFjZSAodyk7CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBtY19wcmVfc2Nyb2xsX2NsZWFuICh3 LCBydW4sIHN0YXJ0X3Zwb3MsIG5yb3dzX3Njcm9sbGVkLCBUUllfV0lORE9XX1JFVVNJTkdfQ1VS UkVOVF9NQVRSSVhfRE9XTik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAg ICBGUkFNRV9SSUYgKGYpLT5zY3JvbGxfcnVuX2hvb2sgKHcsICZydW4pOwogCSAgICAgIEZSQU1F X1JJRiAoZiktPnVwZGF0ZV93aW5kb3dfZW5kX2hvb2sgKHcsIGZhbHNlLCBmYWxzZSk7CiAJICAg ICAgdXBkYXRlX2VuZCAoZik7CkBAIC0xODE3Myw2ICsyMjg4OSw3IEBAIHRyeV93aW5kb3dfcmV1 c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRvdyAqdykKIAl9CiAKICAgICAgIC8qIFNj cm9sbCB0aGUgZGlzcGxheS4gICovCisKICAgICAgIHJ1bi5jdXJyZW50X3kgPSBmaXJzdF9yZXVz YWJsZV9yb3ctPnk7CiAgICAgICBydW4uZGVzaXJlZF95ID0gV0lORE9XX0hFQURFUl9MSU5FX0hF SUdIVCAodyk7CiAgICAgICBydW4uaGVpZ2h0ID0gaXQubGFzdF92aXNpYmxlX3kgLSBydW4uY3Vy cmVudF95OwpAQCAtMTgxODMsNiArMjI5MDAsMTYgQEAgdHJ5X3dpbmRvd19yZXVzaW5nX2N1cnJl bnRfbWF0cml4IChzdHJ1Y3Qgd2luZG93ICp3KQogCSAgdXBkYXRlX2JlZ2luIChmKTsKIAkgIEZS QU1FX1JJRiAoZiktPnVwZGF0ZV93aW5kb3dfYmVnaW5faG9vayAodyk7CiAJICBGUkFNRV9SSUYg KGYpLT5jbGVhcl93aW5kb3dfbW91c2VfZmFjZSAodyk7CisKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBtY19wcmVfc2Nyb2xsX2NsZWFu ICh3LCBydW4sIHN0YXJ0X3Zwb3MsIG5yb3dzX3Njcm9sbGVkLCBUUllfV0lORE9XX1JFVVNJTkdf Q1VSUkVOVF9NQVRSSVhfVVApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICBG UkFNRV9SSUYgKGYpLT5zY3JvbGxfcnVuX2hvb2sgKHcsICZydW4pOwogCSAgRlJBTUVfUklGIChm KS0+dXBkYXRlX3dpbmRvd19lbmRfaG9vayAodywgZmFsc2UsIGZhbHNlKTsKIAkgIHVwZGF0ZV9l bmQgKGYpOwpAQCAtMTkxMjcsNiArMjM4NTQsNyBAQCB0cnlfd2luZG93X2lkIChzdHJ1Y3Qgd2lu ZG93ICp3KQogICAvKiBTY3JvbGwgdGhlIGRpc3BsYXkuICBEbyBpdCBiZWZvcmUgY2hhbmdpbmcg dGhlIGN1cnJlbnQgbWF0cml4IHNvCiAgICAgIHRoYXQgeHRlcm0uYyBkb2Vzbid0IGdldCBjb25m dXNlZCBhYm91dCB3aGVyZSB0aGUgY3Vyc29yIGdseXBoIGlzCiAgICAgIGZvdW5kLiAgKi8KKwog ICBpZiAoZHkgJiYgcnVuLmhlaWdodCkKICAgICB7CiAgICAgICB1cGRhdGVfYmVnaW4gKGYpOwpA QCAtMTkxMzUsNiArMjM4NjMsMTYgQEAgdHJ5X3dpbmRvd19pZCAoc3RydWN0IHdpbmRvdyAqdykK IAl7CiAJICBGUkFNRV9SSUYgKGYpLT51cGRhdGVfd2luZG93X2JlZ2luX2hvb2sgKHcpOwogCSAg RlJBTUVfUklGIChmKS0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOworCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgbWNfcHJlX3Nj cm9sbF9jbGVhbiAodywgcnVuLCBmaXJzdF91bmNoYW5nZWRfYXRfZW5kX3Zwb3MsIGR2cG9zLCBU UllfV0lORE9XX0lEKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgRlJBTUVf UklGIChmKS0+c2Nyb2xsX3J1bl9ob29rICh3LCAmcnVuKTsKIAkgIEZSQU1FX1JJRiAoZiktPnVw ZGF0ZV93aW5kb3dfZW5kX2hvb2sgKHcsIGZhbHNlLCBmYWxzZSk7CiAJfQpAQCAtMjEyNzMsNiAr MjYwMTEsMTcgQEAgbWF5YmVfcHJvZHVjZV9saW5lX251bWJlciAoc3RydWN0IGl0ICppdCkKICAg ICAgIFNFVF9URVhUX1BPUyAodGVtX2l0LnBvc2l0aW9uLCAtMSwgLTEpOwogICAgICAgUFJPRFVD RV9HTFlQSFMgKCZ0ZW1faXQpOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgICAgICAvKiBUaGlzIHBlcm1pdHMgdXMgdG8gaW5zcGVjdCB0 aGUgSFBPUyBvZiBsaW5lIG51bWJlciBnbHlwaHMgYW5kIHRoZSBzcGFjZQorICAgICAgcGFkZGlu ZyBiZWZvcmUvYWZ0ZXIgdGhlIGxpbmUgbnVtYmVycy4gIFdlIHNldCBgZ2x5cGgtPmhwb3NgIGVs c2V3aGVyZS4gKi8KKyAgICAgIHRlbV9pdC5ocG9zICs9IDE7CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICAgICAgIC8qIFN0b3AgcHJvZHVjaW5nIGdseXBocywgYW5kIHJlZnJhaW4g ZnJvbSBwcm9kdWNpbmcgdGhlIGxpbmUKIAkgbnVtYmVyLCBpZiB3ZSBkb24ndCBoYXZlIGVub3Vn aCBzcGFjZSBvbiB0aGlzIGxpbmUuICAqLwogICAgICAgaWYgKHRlbV9pdC5jdXJyZW50X3ggPj0g d2lkdGhfbGltaXQpCkBAIC0yMTI4NCw2ICsyNjAzMywzMCBAQCBtYXliZV9wcm9kdWNlX2xpbmVf bnVtYmVyIChzdHJ1Y3QgaXQgKml0KQogCX0KICAgICB9CiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgTGlzcF9PYmplY3QgYnVmID0gaXQt PnctPmNvbnRlbnRzOworICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgIHN0cnVjdCBidWZmZXIgKmIg PSBYQlVGRkVSIChidWYpOworICBzdHJ1Y3QgYnVmZmVyICpvbGRfYnVmZmVyID0gTlVMTDsKKyAg LyogTmVlZGVkIHNvIHRoYXQgYnVmZmVyLWxvY2FsIHZhbHVlcyBjYW4gYmUgZGV0ZXJtaW5lZDsg ZS5nLiwgd2hlbiBzd2l0Y2hpbmcKKyAgdG8gdGhlIG1pbmlidWZmZXIuICovCisgIGlmIChiICE9 IGN1cnJlbnRfYnVmZmVyKQorICAgIHsKKyAgICAgIG9sZF9idWZmZXIgPSBjdXJyZW50X2J1ZmZl cjsKKyAgICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKGIpOworICAgIH0KKyAgaXQtPnctPm1jLmxu dW1fcGl4ZWxfd2lkdGggPSAoIU5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyB0ZW1faXQuY3VycmVudF94CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiAwOworICBpZiAob2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVy X2ludGVybmFsIChvbGRfYnVmZmVyKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICAvKiBSZWNvcmQgdGhlIHdpZHRoIGluIHBpeGVscyB3ZSBuZWVkIGZvciB0aGUgbGluZSBudW1i ZXIgZGlzcGxheS4gICovCiAgIGl0LT5sbnVtX3BpeGVsX3dpZHRoID0gdGVtX2l0LmN1cnJlbnRf eDsKICAgLyogQ29weSB0aGUgcHJvZHVjZWQgZ2x5cGhzIGludG8gSVQncyBnbHlwaF9yb3cuICAq LwpAQCAtMjcwOTIsNiArMzE4NjUsMTcgQEAgYXBwZW5kX2dseXBoIChzdHJ1Y3QgaXQgKml0KQog CSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1thcmVhXTsK IAl9CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9 IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAg IGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5v YmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgaWYgKGl0LT5waXhlbF93aWR0aCA+IDApCkBAIC0y NzE3NSw2ICszMTk1OSwxNyBAQCBhcHBlbmRfY29tcG9zaXRlX2dseXBoIChzdHJ1Y3QgaXQgKml0 KQogCSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1tpdC0+ YXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5 dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IGl0LT5jbXBfaXQuY2hhcnBvczsKICAgICAgIGdseXBo LT5vYmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgZWFzc2VydCAoaXQtPnBpeGVsX3dpZHRoIDw9 IFNIUlRfTUFYKTsKQEAgLTI3MzgzLDYgKzMyMTc4LDE3IEBAIHByb2R1Y2VfaW1hZ2VfZ2x5cGgg KHN0cnVjdCBpdCAqaXQpCiAJfQogICAgICAgaWYgKGdseXBoIDwgaXQtPmdseXBoX3Jvdy0+Z2x5 cGhzW2FyZWEgKyAxXSkKIAl7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBn bHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKIAkgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKIAkg IGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogCSAgZ2x5cGgtPnBpeGVsX3dpZHRoID0gY2xp cF90b19ib3VuZHMgKC0xLCBpdC0+cGl4ZWxfd2lkdGgsIFNIUlRfTUFYKTsKQEAgLTI3NDg2LDYg KzMyMjkyLDE3IEBAIHByb2R1Y2VfeHdpZGdldF9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAl9CiAg ICAgICBpZiAoZ2x5cGggPCBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYSArIDFdKQogCXsKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAg ICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllU RVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgZ2x5cGgtPmNo YXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwogCSAgZ2x5cGgtPm9iamVjdCA9IGl0LT5v YmplY3Q7CiAJICBnbHlwaC0+cGl4ZWxfd2lkdGggPSBjbGlwX3RvX2JvdW5kcyAoLTEsIGl0LT5w aXhlbF93aWR0aCwgU0hSVF9NQVgpOwpAQCAtMjc1NzIsNiArMzIzODksMTcgQEAgYXBwZW5kX3N0 cmV0Y2hfZ2x5cGggKHN0cnVjdCBpdCAqaXQsIExpc3BfT2JqZWN0IG9iamVjdCwKIAkgICAgd2lk dGggLT0gaXQtPmZpcnN0X3Zpc2libGVfeCAtIGl0LT5jdXJyZW50X3g7CiAJICBlYXNzZXJ0ICh3 aWR0aCA+IDApOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBo LT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwogICAg ICAgZ2x5cGgtPm9iamVjdCA9IG9iamVjdDsKICAgICAgIC8qIEZJWE1FOiBJdCB3b3VsZCBiZSBi ZXR0ZXIgdG8gdXNlIFRZUEVfTUFYIGhlcmUsIGJ1dApAQCAtMjgwMjYsNiArMzI4NTQsMTcgQEAg YXBwZW5kX2dseXBobGVzc19nbHlwaCAoc3RydWN0IGl0ICppdCwgaW50IGZhY2VfaWQsIGJvb2wg Zm9yX25vX2ZvbnQsIGludCBsZW4sCiAJICAgIGdbMV0gPSAqZzsKIAkgIGdseXBoID0gaXQtPmds eXBoX3Jvdy0+Z2x5cGhzW2FyZWFdOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsK KyAgICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9z aXRpb24pOwogICAgICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBlYXNzZXJ0 IChpdC0+cGl4ZWxfd2lkdGggPD0gU0hSVF9NQVgpOwpAQCAtMjkwNzYsMTAgKzMzOTE1LDIwIEBA IHhfaW5zZXJ0X2dseXBocyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqdXBk YXRlZF9yb3csCiAKICAgLyogV3JpdGUgdGhlIGdseXBocy4gICovCiAgIGhwb3MgPSBzdGFydCAt IHJvdy0+Z2x5cGhzW3VwZGF0ZWRfYXJlYV07CisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5j dXJyZW50X21hdHJpeCwgcm93LCB1cGRhdGVkX2FyZWEsIHctPm91dHB1dF9jdXJzb3IueCwKKyAg ICAgICAgICAgICAgICAgICAgICBocG9zLCBocG9zICsgbGVuLCBmYWxzZSwgRFJBV19OT1JNQUxf VEVYVCwgWF9JTlNFUlRfR0xZUEhTKSkKICAgZHJhd19nbHlwaHMgKHcsIHctPm91dHB1dF9jdXJz b3IueCwgcm93LCB1cGRhdGVkX2FyZWEsCiAJICAgICAgIGhwb3MsIGhwb3MgKyBsZW4sCiAJICAg ICAgIERSQVdfTk9STUFMX1RFWFQsIDApOwogCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgIC8qIEFkdmFuY2UgdGhlIG91dHB1dCBjdXJzb3IuICAqLwogICB3LT5vdXRwdXRfY3Vyc29y Lmhwb3MgKz0gbGVuOwogICB3LT5vdXRwdXRfY3Vyc29yLnggKz0gc2hpZnRfYnlfd2lkdGg7CkBA IC0yOTUwNSw5ICszNDM1NCwxOSBAQCB4X2ZpeF9vdmVybGFwcGluZ19hcmVhIChzdHJ1Y3Qgd2lu ZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCiAJICB3aGlsZSAoaSA8IHJvdy0+dXNlZFth cmVhXQogCQkgJiYgcm93LT5nbHlwaHNbYXJlYV1baV0ub3ZlcmxhcHNfdmVydGljYWxseV9wKTsK IAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBhcmVh LCBzdGFydF94LCBzdGFydCwgaSwKKyAgICAgICAgICBmYWxzZSwgRFJBV19OT1JNQUxfVEVYVCwg WF9GSVhfT1ZFUkxBUFBJTkdfQVJFQSkpCiAJICBkcmF3X2dseXBocyAodywgc3RhcnRfeCwgcm93 LCBhcmVhLAogCQkgICAgICAgc3RhcnQsIGksCiAJCSAgICAgICBEUkFXX05PUk1BTF9URVhULCBv dmVybGFwcyk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAl9CiAgICAgICBlbHNl CiAJewpAQCAtMjk3NTgsMTAgKzM0NjE3LDE3IEBAIGRpc3BsYXlfYW5kX3NldF9jdXJzb3IgKHN0 cnVjdCB3aW5kb3cgKncsIGJvb2wgb24sCiAgIG5ld19jdXJzb3JfdHlwZSA9IGdldF93aW5kb3df Y3Vyc29yX3R5cGUgKHcsIGdseXBoLAogCQkJCQkgICAgJm5ld19jdXJzb3Jfd2lkdGgsICZhY3Rp dmVfY3Vyc29yKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKwogICAvKiBJZiBjdXJzb3IgaXMgY3VycmVudGx5IGJlaW5nIHNob3duIGFuZCB3 ZSBkb24ndCB3YW50IGl0IHRvIGJlIG9yCiAgICAgIGl0IGlzIGluIHRoZSB3cm9uZyBwbGFjZSwg b3IgdGhlIGN1cnNvciB0eXBlIGlzIG5vdCB3aGF0IHdlIHdhbnQsCiAgICAgIGVyYXNlIGl0LiAg Ki8KICAgaWYgKHctPnBoeXNfY3Vyc29yX29uX3AKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKICAgICAgICYmICghb24KIAkgIHx8IHctPnBo eXNfY3Vyc29yLnggIT0geAogCSAgfHwgdy0+cGh5c19jdXJzb3IueSAhPSB5CkBAIC0yOTc3NCw2 ICszNDY0MCw5IEBAIGRpc3BsYXlfYW5kX3NldF9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIGJv b2wgb24sCiAJICAgICAgJiYgbmV3X2N1cnNvcl93aWR0aCAhPSB3LT5waHlzX2N1cnNvcl93aWR0 aCkpKQogICAgIGVyYXNlX3BoeXNfY3Vyc29yICh3KTsKIAorLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICAvKiBEb24ndCBjaGVjayBwaHlzX2N1cnNvcl9vbl9wIGhlcmUgYmVjYXVzZSB0 aGF0IGZsYWcgaXMgb25seSBzZXQKICAgICAgdG8gZmFsc2UgaW4gc29tZSBjYXNlcyB3aGVyZSB3 ZSBrbm93IHRoYXQgdGhlIGN1cnNvciBoYXMgYmVlbgogICAgICBjb21wbGV0ZWx5IGVyYXNlZCwg dG8gYXZvaWQgdGhlIGV4dHJhIHdvcmsgb2YgZXJhc2luZyB0aGUgY3Vyc29yCkBAIC0yOTc5Miw5 ICszNDY2MSwxOSBAQCBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBi b29sIG9uLAogICAgICAgdy0+cGh5c19jdXJzb3IudnBvcyA9IHZwb3M7CiAgICAgfQogCi0gIEZS QU1FX1JJRiAoZiktPmRyYXdfd2luZG93X2N1cnNvciAodywgZ2x5cGhfcm93LCB4LCB5LAotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19jdXJzb3JfdHlwZSwgbmV3X2N1 cnNvcl93aWR0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbiwgYWN0 aXZlX2N1cnNvcik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgIGlmIChOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3Nz aGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192 aXNpYmxlKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNf Y29uZikpKQorICAgIEZSQU1FX1JJRiAoZiktPmRyYXdfd2luZG93X2N1cnNvciAodywgZ2x5cGhf cm93LCB4LCB5LCBuZXdfY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBuZXdfY3Vyc29yX3dpZHRoLCBvbiwgYWN0aXZlX2N1cnNvcik7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKIH0KIAogCkBAIC0yOTg4Nyw3ICszNDc2NiwxOCBAQCBk cmF3X3Jvd193aXRoX21vdXNlX2ZhY2UgKHN0cnVjdCB3aW5kb3cgKncsIGludCBzdGFydF94LCBz dHJ1Y3QgZ2x5cGhfcm93ICpyb3csCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAgIGlmIChG UkFNRV9XSU5ET1dfUCAoWEZSQU1FICh3LT5mcmFtZSkpKQogICAgIHsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgaWYgKCFtY19y ZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBURVhUX0FSRUEsIHN0YXJ0X3gs CisgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBmYWxzZSwg ZHJhdywgRFJBV19ST1dfV0lUSF9NT1VTRV9GQUNFKSkKICAgICAgIGRyYXdfZ2x5cGhzICh3LCBz dGFydF94LCByb3csIFRFWFRfQVJFQSwgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGRyYXcsIDApOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICByZXR1cm47CiAgICAgfQogI2Vu ZGlmCkBAIC0zMTk0NSwxMSArMzY4MzUsMjMgQEAgZXhwb3NlX2FyZWEgKHN0cnVjdCB3aW5kb3cg KncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgWFJlY3RhbmdsZSAqciwKICAgc3RydWN0IGdseXBo ICpsYXN0OwogICBpbnQgZmlyc3RfeCwgc3RhcnRfeCwgeDsKIAorCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICBpZiAoYXJlYSA9PSBURVhUX0FS RUEgJiYgcm93LT5maWxsX2xpbmVfcCkKKyAgICB7CisgICAgICBpZiAoIW1jX3JlZHJhd19yb3cg KHcsIHctPmN1cnJlbnRfbWF0cml4LCByb3csIGFyZWEsIDAsIDAsIHJvdy0+dXNlZFthcmVhXSwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UsIERSQVdfTk9STUFMX1RFWFQsIEVYUE9T RV9BUkVBX09ORSkpCiAgICAgLyogSWYgcm93IGV4dGVuZHMgZmFjZSB0byBlbmQgb2YgbGluZSB3 cml0ZSB0aGUgd2hvbGUgbGluZS4gICovCiAgICAgZHJhd19nbHlwaHMgKHcsIDAsIHJvdywgYXJl YSwKIAkJIDAsIHJvdy0+dXNlZFthcmVhXSwKIAkJIERSQVdfTk9STUFMX1RFWFQsIDApOworICAg IH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBlbHNlCiAgICAgewogICAgICAg LyogU2V0IFNUQVJUX1ggdG8gdGhlIHdpbmRvdy1yZWxhdGl2ZSBzdGFydCBwb3NpdGlvbiBmb3Ig ZHJhd2luZyBnbHlwaHMgb2YKQEAgLTMxOTgxLDExICszNjg4MywyMyBAQCBleHBvc2VfYXJlYSAo c3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBYUmVjdGFuZ2xlICpyLAog CSAgKytsYXN0OwogCX0KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKwogICAgICAgLyogUmVwYWludC4gICovCi0gICAgICBpZiAobGFzdCA+IGZp cnN0KQorICAgICAgLyogRmxvYXRpbmcgZmFrZSBjdXJzb3JzIHdpbGwgZXhpc3Qgd2hlbiAobGFz dCA9PSBmaXJzdCkuICovCisgICAgICBpZiAoIW1jX3JlZHJhd19yb3cgKHcsIHctPmN1cnJlbnRf bWF0cml4LCByb3csIGFyZWEsIGZpcnN0X3ggLSBzdGFydF94LAorICAgICAgICAgICAgICAgICAg ICAgICAgICBmaXJzdCAtIHJvdy0+Z2x5cGhzW2FyZWFdLCBsYXN0IC0gcm93LT5nbHlwaHNbYXJl YV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlLCBEUkFXX05PUk1BTF9URVhULCBF WFBPU0VfQVJFQV9UV08pCisgICAgICAgICAgJiYgbGFzdCA+IGZpcnN0KQogCWRyYXdfZ2x5cGhz ICh3LCBmaXJzdF94IC0gc3RhcnRfeCwgcm93LCBhcmVhLAogCQkgICAgIGZpcnN0IC0gcm93LT5n bHlwaHNbYXJlYV0sIGxhc3QgLSByb3ctPmdseXBoc1thcmVhXSwKIAkJICAgICBEUkFXX05PUk1B TF9URVhULCAwKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgIH0KIH0KIApA QCAtMzE5OTksMTAgKzM2OTEzLDIyIEBAIGV4cG9zZV9saW5lIChzdHJ1Y3Qgd2luZG93ICp3LCBz dHJ1Y3QgZ2x5cGhfcm93ICpyb3csIFhSZWN0YW5nbGUgKnIpCiB7CiAgIGVhc3NlcnQgKHJvdy0+ ZW5hYmxlZF9wKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKwogICBpZiAocm93LT5tb2RlX2xpbmVfcCB8fCB3LT5wc2V1ZG9fd2luZG93X3Ap CisgICAgeworICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwg cm93LCBURVhUX0FSRUEsIDAsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdy0+dXNl ZFtURVhUX0FSRUFdLCBmYWxzZSwgRFJBV19OT1JNQUxfVEVYVCwgRVhQT1NFX0xJTkUpKQogICAg IGRyYXdfZ2x5cGhzICh3LCAwLCByb3csIFRFWFRfQVJFQSwKIAkJIDAsIHJvdy0+dXNlZFtURVhU X0FSRUFdLAogCQkgRFJBV19OT1JNQUxfVEVYVCwgMCk7CisgICAgfQorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAgIGVsc2UKICAgICB7CiAgICAgICBpZiAocm93LT51c2VkW0xFRlRf TUFSR0lOX0FSRUFdKQpAQCAtMzI1NTAsNiArMzc0NzYsMjIgQEAgeF9pbnRlcnNlY3RfcmVjdGFu Z2xlcyAoWFJlY3RhbmdsZSAqcjEsIFhSZWN0YW5nbGUgKnIyLCBYUmVjdGFuZ2xlICpyZXN1bHQp CiB2b2lkCiBzeW1zX29mX3hkaXNwICh2b2lkKQogeworCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGRlZnN1YnIgKCZTbWNfZHVtcF9nbHlw aF9yb3cpOworCisgIGRlZnN1YnIgKCZTbWNfZHVtcF9nbHlwaF9tYXRyaXgpOworCisgIGRlZnN1 YnIgKCZTbWNfY3VycmVudF9jb2x1bW4pOworCisgIGRlZnN1YnIgKCZTbWNfc3RkZXJyKTsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBWd2l0aF9lY2hvX2FyZWFfc2F2ZV92ZWN0 b3IgPSBRbmlsOwogICBzdGF0aWNwcm8gKCZWd2l0aF9lY2hvX2FyZWFfc2F2ZV92ZWN0b3IpOwog CmRpZmYgLS1naXQgYS9zcmMveHRlcm0uYyBiL3NyYy94dGVybS5jCmluZ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gKHN0ZGVyciwgIm1jX3hf ZHJhd19ob2xsb3dfY3Vyc29yOiAgcnggKCVkKSB8IHJ5ICglZCkgfCBydyAoJWQpIHwgcmggKCVk KVxuIiwKKyAgICAgICAgICAgICAgICAgICAgcngsIHJ5LCBydywgcmgpOworKi8KKyAgeF9yZXNl dF9jbGlwX3JlY3RhbmdsZXMgKGYsIGdjKTsKK30KKworLyogRHJhdyBhIGJhciBjdXJzb3Igb24g d2luZG93IFcgaW4gZ2x5cGggcm93IFJPVy4gKi8KK3N0YXRpYyB2b2lkCittY194X2RyYXdfYmFy X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBz dHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgaW50IHgsIGludCBm eCwgaW50IHksIGludCBmeSwgaW50IGhwb3MsIGludCB2cG9zLCBpbnQgd2QsIGludCBoLAorICAg ICAgICAgICAgICAgICAgICAgIGludCB3aWR0aCwgZW51bSBtY19jdXJzb3JfdHlwZSBraW5kLCBi b29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKQoreworICBzdHJ1Y3QgZnJhbWUgKmYgPSBY RlJBTUUgKHctPmZyYW1lKTsKKyAgLyogSWYgY3Vyc29yIGlzIG91dCBvZiBib3VuZHMsIGRvbid0 IGRyYXcgZ2FyYmFnZS4gIFRoaXMgY2FuIGhhcHBlbgorICAgICBpbiBtaW5pLWJ1ZmZlciB3aW5k b3dzIHdoZW4gc3dpdGNoaW5nIGJldHdlZW4gZWNobyBhcmVhIGdseXBocworICAgICBhbmQgbWlu aS1idWZmZXIuICovCisgIHN0cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBoID0gbWNfZ2V0X2N1cnNv cl9nbHlwaCAodywgbWF0cml4LCByb3csIGhwb3MsIHZwb3MpOworICBpZiAoY3Vyc29yX2dseXBo ID09IE5VTEwpCisgICAgcmV0dXJuOworICAvKiBFeHBlcmltZW50YWwgYXZvaWRhbmNlIG9mIGN1 cnNvciBvbiB4d2lkZ2V0LiAqLworICBpZiAoY3Vyc29yX2dseXBoLT50eXBlID09IFhXSURHRVRf R0xZUEgpCisgICAgcmV0dXJuOworICAvKiBJZiBvbiBhbiBpbWFnZSwgZHJhdyBsaWtlIGEgbm9y bWFsIGN1cnNvci4gIFRoYXQncyB1c3VhbGx5IGJldHRlcgorICAgICB2aXNpYmxlIHRoYW4gZHJh d2luZyBhIGJhciwgZXNwLiBpZiB0aGUgaW1hZ2UgaXMgbGFyZ2Ugc28gdGhhdAorICAgICB0aGUg YmFyIG1pZ2h0IG5vdCBiZSBpbiB0aGUgd2luZG93LiAqLworICBpZiAoY3Vyc29yX2dseXBoLT50 eXBlID09IElNQUdFX0dMWVBIKQorICAgIHsKKyAgICAgIHN0cnVjdCBtY19SR0IgbHNsID0gey5y ZWQgPSAtMS4wLCAuZ3JlZW4gPSAtMS4wLCAuYmx1ZSA9IC0xLjB9OworICAgICAgZW51bSBtY19m bGF2b3IgZ2x5cGhfZmxhdm9yID0gTk9fRkxBVk9SOworICAgICAgZW51bSBtY19jdXJzb3JfdHlw ZSBjdXJzb3JfdHlwZSA9IE1DX0hPTExPV19CT1g7CisgICAgICBib29sIGFjdGl2ZV9wID0gZmFs c2U7CisgICAgICBib29sIGN1cnNvcl9nY19wID0gZmFsc2U7CisgICAgICBtY19kcmF3X2N1cnNv cl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLCBsc2ws CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwg d2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCk7CisgICAgfQorICBlbHNlCisgICAgeworICAgICAg RGlzcGxheSAqZHB5ID0gRlJBTUVfWF9ESVNQTEFZIChmKTsKKyAgICAgIFdpbmRvdyB3aW5kb3cg PSBGUkFNRV9YX1dJTk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pY3NfZXhwb3N1cmVzID0gRmFsc2U7CisgICAgICBpZiAo Z2MpCisgICAgICAgIFhDaGFuZ2VHQyAoZHB5LCBnYywgbWFzaywgJnhnY3YpOworICAgICAgZWxz ZQorICAgICAgICB7CisgICAgICAgICAgZ2MgPSBYQ3JlYXRlR0MgKGRweSwgd2luZG93LCBtYXNr LCAmeGdjdik7CisgICAgICAgICAgRlJBTUVfRElTUExBWV9JTkZPIChmKS0+c2NyYXRjaF9jdXJz b3JfZ2MgPSBnYzsKKyAgICAgICAgfQorICAgICAgeF9jbGlwX3RvX3JvdyAodywgcm93LCBURVhU X0FSRUEsIGdjKTsKKyAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKGYsIGdjLCBmeCwgZnksIHdkLCBo KTsKKyAgICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChmLCBnYyk7CisgICAgfQorfQorCisv KiBSSUY6IERyYXcgY3Vyc29yIG9uIHdpbmRvdyBXLiAqLworc3RhdGljIHZvaWQKK21jX3hfZHJh d193aW5kb3dfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpt YXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICBp bnQgeCwgaW50IGZ4LCBpbnQgeSwgaW50IGZ5LCBpbnQgaHBvcywgaW50IHZwb3MsIGludCB3ZCwK KyAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaCwgc3RydWN0IG1jX1JHQiBsc2wsIGVudW0g bWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgaW50 IGN1cnNvcl93aWR0aCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLCBib29sIG9uX3AsCisg ICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBhY3RpdmVfcCkKK3sKKyAgc3RydWN0IGZyYW1l ICpmID0gW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ICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwg PSBjb2xvci5waXhlbDsKKyAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0 cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgIGYt Pm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAg ICAgICAgfQorICAgICAgICBlbHNlIGlmIChjdXJzb3JfZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZ UEggJiYgbHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisg ICAgICAgICAgeworICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRf ZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+ Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgICBtY194X2RyYXdfaG9sbG93 X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgp OworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxf Y3Vyc29yX3BpeGVsOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7 CisgICAgICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+ Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgICAgICAgIGZ1bmN0aW9uYWxpdHkg b2YgYHhfbWFrZV9nYycgaW4geGZucy5jLiAqLworICAgICAgICAgICAgICBpZiAocmVnaW9uX2Fj dGl2ZV9wCisgIC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ICAgICBzdHJ1Y3Qg ZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZl X2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9Y X0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19hY3RpdmVf ZmFjZS0+Zm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQg KEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93 X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChhY3RpdmVfcCkKKyAgICAgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9s bG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIist cmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAg ICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYs IGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBYU2V0Rm9y ZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2dj LCBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgICAg ICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQor ICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVt IGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywg ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRy dWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2luYWN0 aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAo ZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2luYWN0aXZlX2ZhY2UtPmZv cmVncm91bmQpOworICAgICAgICAgICAgICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJB TUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfaW5h Y3RpdmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAg ICAgICAgICAgIGJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAgICAvKiBGb3JjZSBgbWNfeF9z ZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycuICov CisgICAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSB0cnVlOworICAgICAgICAgICAgICBt Y19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9z LCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsLCBnbHlwaF9m bGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5k IChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIHhnY3Yu Zm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BM QVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIHhnY3YuYmFja2dyb3VuZCk7Cisg ICAgICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgIC8qIERyYXcgdGhl IGZyYW1lIGFyb3VuZCB0aGUgYm94LiAqLworICAgICAgICAgICAgICBtY194X2RyYXdfaG9sbG93 X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgp OworICAgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfSE9MTE9X X0JPWDoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYm IGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWph Y2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAgZi0+b3V0 cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gY29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vy c29yX2djJy4gKi8KKyAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAg ICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBo cG9zLCB2cG9zLCBsc2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2Zs YXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAg IFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5j dXJzb3JfZ2MsIHhnY3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZS QU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdjdi5iYWNr Z3JvdW5kKTsKKyAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICB9CisgICAgICAg IGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gZmFsc2U7 CisgICAgICAgICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdf Q1VSU09SLCB4LCBocG9zLCB2cG9zLCBsc2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2Nf cCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfQkFSOgor ICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJs dWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+ b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4gKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0 YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICBib29sIGN1cnNvcl9n Y19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY194X2RyYXdfYmFyX2N1cnNv ciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3Jf Z2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29y X3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UK KyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9w ID0gZmFsc2U7CisgICAgICAgICAgICBtY194X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCBy b3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaCwgY3Vyc29yX3dpZHRoLCBNQ19CQVIsIGN1cnNvcl9nY19pbnZpc2libGVf b2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19I QkFSOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYg bHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFj ayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4gKi8KKyAgICAgICAgICBmLT5vdXRw dXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICBib29sIGN1 cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY194X2RyYXdfYmFy X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgTUNfSEJBUiwg Y3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAg ICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxl X29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1h dHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29yX2djX2lu dmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBk ZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KKyAgICAgICAgfQorI2lmZGVmIEhB VkVfWF9JMThOCisgIGlmICh3ID09IFhXSU5ET1cgKGYtPnNlbGVjdGVkX3dpbmRvdykpCisgICAg aWYgKEZSQU1FX1hJQyAoZikgJiYgKEZSQU1FX1hJQ19TVFlMRSAoZikgJiBYSU1QcmVlZGl0UG9z aXRpb24pKQorICAgICAgeGljX3NldF9wcmVlZGl0YXJlYSAodywgeCwgeSk7CisjZW5kaWYKKyAg ICB9CisgIFhGbHVzaCAoRlJBTUVfWF9ESVNQTEFZIChmKSk7Cit9CisKKy8qIERyYXcgc3RyZXRj aCBnbHlwaCBzdHJpbmcgUy4gKi8KK3N0YXRpYyB2b2lkCittY194X2RyYXdfc3RyZXRjaF9nbHlw aF9zdHJpbmcgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMpCit7CisgIGVhc3NlcnQgKHMtPmZpcnN0 X2dseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZUEgpOworICBpZiAocy0+aGwgPT0gRFJBV19DVVJT T1IKKyAgICAgICYmICF4X3N0cmV0Y2hfY3Vyc29yX3ApCisgICAgeworICAgICAgLyogSWYgYHgt c3RyZXRjaC1jdXJzb3InIGlzIG5pbCwgZG9uJ3QgZHJhdyBhIGJsb2NrIGN1cnNvciBhcyB3aWRl IGFzIHRoZQorICAgICAgc3RyZXRjaCBnbHlwaC4gKi8KKyAgICAgIGludCB3aWR0aCwgYmFja2dy b3VuZF93aWR0aCA9IHMtPmJhY2tncm91bmRfd2lkdGg7CisgICAgICBpbnQgeCA9IHMtPng7Cisg ICAgICBpZiAoIXMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGludCBs ZWZ0X3ggPSB3aW5kb3dfYm94X2xlZnRfb2Zmc2V0IChzLT53LCBURVhUX0FSRUEpOworICAgICAg ICAgIGlmICh4IDwgbGVmdF94KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBiYWNrZ3Jv dW5kX3dpZHRoIC09IGxlZnRfeCAtIHg7CisgICAgICAgICAgICAgIHggPSBsZWZ0X3g7CisgICAg ICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAg ICAgIC8qIEluIFIyTCByb3dzLCBkcmF3IHRoZSBjdXJzb3Igb24gdGhlIHJpZ2h0IGVkZ2Ugb2Yg dGhlCisgICAgICAgICAgICAgICBzdHJldGNoIGdseXBoLiAqLworICAgICAgICAgICAgaW50IHJp Z2h0X3ggPSB3aW5kb3dfYm94X3JpZ2h0IChzLT53LCBURVhUX0FSRUEpOworICAgICAgICAgICAg aWYgKHggKyBiYWNrZ3JvdW5kX3dpZHRoID4gcmlnaHRfeCkKKyAgICAgICAgICAgICAgYmFja2dy b3VuZF93aWR0aCAtPSB4IC0gcmlnaHRfeDsKKyAgICAgICAgICAgIHggKz0gYmFja2dyb3VuZF93 aWR0aDsKKyAgICAgICAgICB9CisgICAgICB3aWR0aCA9IG1pbiAoRlJBTUVfQ09MVU1OX1dJRFRI IChzLT5mKSwgYmFja2dyb3VuZF93aWR0aCk7CisgICAgICBpZiAocy0+cm93LT5yZXZlcnNlZF9w KQorICAgICAgICB4IC09IHdpZHRoOworICAgICAgLyogRHJhdyBjdXJzb3IuICovCisgICAgICB4 X2RyYXdfZ2x5cGhfc3RyaW5nX2JnX3JlY3QgKHMsIHgsIHMtPnksIHdpZHRoLCBzLT5oZWlnaHQp OworICAgICAgLyogQ2xlYXIgcmVzdCB1c2luZyB0aGUgR0Mgb2YgdGhlIG9yaWdpbmFsIG5vbi1j dXJzb3IgZmFjZS4gKi8KKyAgICAgIGlmICh3aWR0aCA8IGJhY2tncm91bmRfd2lkdGgpCisgICAg ICAgIHsKKyAgICAgICAgICBpbnQgeSA9IHMtPnk7CisgICAgICAgICAgaW50IHcgPSBiYWNrZ3Jv dW5kX3dpZHRoIC0gd2lkdGgsIGggPSBzLT5oZWlnaHQ7CisgICAgICAgICAgWFJlY3RhbmdsZSBy OworICAgICAgICAgIEdDIGdjOworICAgICAgICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQor ICAgICAgICAgICAgeCArPSB3aWR0aDsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB4ID0g cy0+eDsKKyAgICAgICAgICBpZiAocy0+cm93LT5tb3VzZV9mYWNlX3AKKyAgICAgICAgICAgICAg JiYgY3Vyc29yX2luX21vdXNlX2ZhY2VfcCAocy0+dykpCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIHhfc2V0X21vdXNlX2ZhY2VfZ2MgKHMpOworICAgICAgICAgICAgICBnYyA9IHMtPmdj OworICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGdjID0gcy0+ZmFj ZS0+Z2M7CisgICAgICAgICAgZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsICZyKTsKKyAg ICAgICAgICB4X3NldF9jbGlwX3JlY3RhbmdsZXMgKHMtPmYsIGdjLCAmciwgMSk7CisgICAgICAg ICAgaWYgKHMtPmZhY2UtPnN0aXBwbGUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8q IEZpbGwgYmFja2dyb3VuZCB3aXRoIGEgc3RpcHBsZSBwYXR0ZXJuLiAqLworICAgICAgICAgICAg ICBYU2V0RmlsbFN0eWxlIChzLT5kaXNwbGF5LCBnYywgRmlsbE9wYXF1ZVN0aXBwbGVkKTsKKyAg ICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAocy0+ZiwgZ2MsIHgsIHksIHcsIGgpOworICAg ICAgICAgICAgICBYU2V0RmlsbFN0eWxlIChzLT5kaXNwbGF5LCBnYywgRmlsbFNvbGlkKTsKKyAg ICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKHMtPmRpc3BsYXks IGdjLCBHQ0ZvcmVncm91bmQgfCBHQ0JhY2tncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAg WFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXksIGdjLCB4Z2N2LmJhY2tncm91bmQpOworICAgICAg ICAgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBnYywgeCwgeSwgdywgaCk7CisgICAgICAg ICAgICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNwbGF5LCB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CisgICAgICAgICAgICB4X3NldF9nbHlwaF9z dHJpbmdfY2xpcHBpbmcgKG5leHQpOworICAgICAgICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBo LT50eXBlID09IFNUUkVUQ0hfR0xZUEgpCisgICAgICAgICAgICAgIG1jX3hfZHJhd19zdHJldGNo X2dseXBoX3N0cmluZyAobmV4dCk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHhf ZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAobmV4dCwgdHJ1ZSk7CisgICAgICAgICAgICBu ZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgIH0KKyAgICB9CisgIC8qIFNldCB1cCBTLT5n Yywgc2V0IGNsaXBwaW5nIGFuZCBkcmF3IFMuICovCisgIG1jX3hfc2V0X2dseXBoX3N0cmluZ19n YyAocywgY3Vyc29yX2djX3ApOworICAvKiBEcmF3IHJlbGllZiAoaWYgYW55KSBpbiBhZHZhbmNl IGZvciBjaGFyL2NvbXBvc2l0aW9uIHNvIHRoYXQgdGhlCisgICAgIGdseXBoIHN0cmluZyBjYW4g YmUgZHJhd24gb3ZlciBpdC4gKi8KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMKKyAgICAgICYmIHMt PmZhY2UtPmJveCAhPSBGQUNFX05PX0JPWAorICAgICAgJiYgKHMtPmZpcnN0X2dseXBoLT50eXBl ID09IENIQVJfR0xZUEgKKyAgICAgICAgICB8fCBzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01Q T1NJVEVfR0xZUEgpKQorICAgIHsKKyAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZyAo cyk7CisgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIHRydWUpOworICAg ICAgeF9kcmF3X2dseXBoX3N0cmluZ19ib3ggKHMpOworICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5n X2NsaXBwaW5nIChzKTsKKyAgICA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mb3Jfb3ZlcmxhcHMpCisgICAgeworICAg ICAgLyogRHJhdyB1bmRlcmxpbmUuICovCisgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3Ap CisgICAgICAgIHsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFD RV9VTkRFUl9XQVZFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAocy0+ZmFjZS0+ dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgICAgIHhfZHJhd191bmRlcndhdmUg KHMpOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgWEdDVmFsdWVzIHhnY3Y7CisgICAgICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKHMt PmRpc3BsYXksIHMtPmdjLCBHQ0ZvcmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAgICAg IFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBzLT5nYywgcy0+ZmFjZS0+dW5kZXJsaW5lX2Nv bG9yKTsKKyAgICAgICAgICAgICAgICAgIHhfZHJhd191bmRlcndhdmUgKHMpOworICAgICAgICAg ICAgICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCB4Z2N2LmZvcmVncm91 bmQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlm IChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAg ICAgICAgICAgICAgaW50IHk7CisgICAgICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYt PmZhY2UtPnVuZGVybGluZV9wCisgICAgICAgICAgICAgICAgICAmJiBzLT5wcmV2LT5mYWNlLT51 bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgLyogV2UgdXNlIHRoZSBzYW1lIHVuZGVybGluZSBzdHlsZSBhcyB0aGUg cHJldmlvdXMgb25lLiAqLworICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+cHJldi0+ dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+cHJl di0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5k ZXJsaW5lIHRoaWNrbmVzcy4gIERlZmF1bHQgaXMgMSBwaXhlbC4gKi8KKyAgICAgICAgICAgICAg ICAgIGlmIChzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV90aGlja25lc3MgPiAwKQorICAg ICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNz OworICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB0aGlja25lc3Mg PSAxOworICAgICAgICAgICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRfbGluZSkK KyAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gdGhpY2tuZXNzKSAt IChzLT55YmFzZSAtIHMtPnkpOworICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgLyogR2V0IHRoZSB1bmRlcmxpbmUgcG9z aXRpb24uICBUaGlzIGlzIHRoZSByZWNvbW1lbmRlZAorICAgICAgICAgICAgICAgICAgICAgICAg IHZlcnRpY2FsIG9mZnNldCBpbiBwaXhlbHMgZnJvbSB0aGUgYmFzZWxpbmUgdG8gdGhlIHRvcCBv ZgorICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSB1bmRlcmxpbmUuICBUaGlzIGlzIGEgc2ln bmVkIHZhbHVlIGFjY29yZGluZyB0byB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgICBzcGVj cywgYW5kIGl0cyBkZWZhdWx0IGlzCisgICAgICAgICAgICAgICAgICAgICAgICAgUk9VTkQgKCht YXhpbXVtIGRlc2NlbnQpIC8gMiksIHdpdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICBST1VO RCh4KSA9IGZsb29yICh4ICsgMC41KSAgKi8KKyAgICAgICAgICAgICAgICAgICAgICBpZiAoeF91 c2VfdW5kZXJsaW5lX3Bvc2l0aW9uX3Byb3BlcnRpZXMKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgcy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb24gPj0gMCkKKyAgICAg ICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9u OworICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHMtPmZvbnQpCisgICAgICAgICAgICAg ICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5mb250LT5kZXNjZW50ICsgMSkgLyAyOworICAgICAg ICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0g dW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgICAgICBwb3NpdGlvbiA9IG1heCAocG9zaXRpb24sIHVuZGVybGluZV9taW5pbXVtX29m ZnNldCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAvKiBDaGVjayB0aGUgc2Fu aXR5IG9mIHRoaWNrbmVzcyBhbmQgcG9zaXRpb24uICBXZSBzaG91bGQKKyAgICAgICAgICAgICAg ICAgYXZvaWQgZHJhd2luZyB1bmRlcmxpbmUgb3V0IG9mIHRoZSBjdXJyZW50IGxpbmUgYXJlYS4g Ki8KKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPD0gcy0+eWJhc2UgKyBwb3Np dGlvbikKKyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSAxKSAtIChzLT55 YmFzZSAtIHMtPnkpOworICAgICAgICAgICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8IHMtPnli YXNlICsgcG9zaXRpb24gKyB0aGlja25lc3MpCisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0g KHMtPnkgKyBzLT5oZWlnaHQpIC0gKHMtPnliYXNlICsgcG9zaXRpb24pOworICAgICAgICAgICAg ICBzLT51bmRlcmxpbmVfdGhpY2tuZXNzID0gdGhpY2tuZXNzOworICAgICAgICAgICAgICBzLT51 bmRlcmxpbmVfcG9zaXRpb24gPSBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgeSA9IHMtPnliYXNl ICsgcG9zaXRpb247CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVs dGVkX3ApCisgICAgICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAocy0+Ziwgcy0+Z2MsIHMt PngsIHksIHMtPndpZHRoLCB0aGlja25lc3MpOworICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgWEdDVmFsdWVzIHhnY3Y7CisgICAgICAgICAg ICAgICAgICBYR2V0R0NWYWx1ZXMgKHMtPmRpc3BsYXksIHMtPmdjLCBHQ0ZvcmVncm91bmQsICZ4 Z2N2KTsKKyAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBzLT5n Yywgcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yKTsKKyAgICAgICAgICAgICAgICAgIHhfZmlsbF9y ZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCB5LCBzLT53aWR0aCwgdGhpY2tuZXNzKTsKKyAg ICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBzLT5nYywgeGdjdi5m b3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0K KyAgICAgIC8qIERyYXcgb3ZlcmxpbmUuICovCisgICAgICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVf cCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAwLCBoID0gMTsKKyAg ICAgICAgICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICAg ICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBzLT5nYywgcy0+eCwgcy0+eSArIGR5LCBzLT53 aWR0aCwgaCk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBY R0NWYWx1ZXMgeGdjdjsKKyAgICAgICAgICAgICAgWEdldEdDVmFsdWVzIChzLT5kaXNwbGF5LCBz LT5nYywgR0NGb3JlZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5k IChzLT5kaXNwbGF5LCBzLT5nYywgcy0+ZmFjZS0+b3ZlcmxpbmVfY29sb3IpOworICAgICAgICAg ICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBzLT5nYywgcy0+eCwgcy0+eSArIGR5LCBzLT53 aWR0aCwgaCk7CisgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBzLT5n YywgeGdjdi5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyog RHJhdyBzd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ICAgICB7CisgICAgICAg ICAgc3RydWN0IGdseXBoX3N0cmluZyAqcHJldjsKKyAgICAgICAgICBmb3IgKHByZXYgPSBzLT5w cmV2OyBwcmV2OyBwcmV2ID0gcHJldi0+cHJldikKKyAgICAgICAgICAgIGlmIChwcmV2LT5obCAh PSBzLT5obAorICAgICAgICAgICAgICAgICYmIHByZXYtPnggKyBwcmV2LT53aWR0aCArIHByZXYt PnJpZ2h0X292ZXJoYW5nID4gcy0+eCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg IC8qIEFzIHByZXYgd2FzIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8gaXRzIG93biBhcmVhLCB3ZQor ICAgICAgICAgICAgICAgICAgIG11c3QgZHJhdyB0aGUgcmlnaHRfb3ZlcmhhbmcgcGFydCB1c2lu ZyBzLT5obCBub3cuICovCisgICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIHNh dmUgPSBwcmV2LT5obDsKKyAgICAgICAgICAgICAgICBwcmV2LT5obCA9IHMtPmhsOworICAgICAg ICAgICAgICAgIG1jX3hfc2V0X2dseXBoX3N0cmluZ19nYyAocHJldiwgY3Vyc29yX2djX3ApOwor ICAgICAgICAgICAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBw cmV2KTsKKyAgICAgICAgICAgICAgICBpZiAocHJldi0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hB Ul9HTFlQSCkKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3Vu ZCAocHJldik7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeF9kcmF3 X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocHJldik7CisgICAgICAgICAgICAg ICAgeF9yZXNldF9jbGlwX3JlY3RhbmdsZXMgKHByZXYtPmYsIHByZXYtPmdjKTsKKyAgICAgICAg ICAgICAgICBwcmV2LT5obCA9IHNhdmU7CisgICAgICAgICAgICAgICAgcHJldi0+bnVtX2NsaXBz ID0gMDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAocy0+bmV4dCkKKyAg ICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKm5leHQ7CisgICAgICAgICAg Zm9yIChuZXh0ID0gcy0+bmV4dDsgbmV4dDsgbmV4dCA9IG5leHQtPm5leHQpCisgICAgICAgICAg ICBpZiAobmV4dC0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAgICAmJiBuZXh0LT54IC0gbmV4 dC0+bGVmdF9vdmVyaGFuZyA8IHMtPnggKyBzLT53aWR0aCkKKyAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgIC8qIEFzIG5leHQgd2lsbCBiZSBkcmF3biB3aGlsZSBjbGlwcGVkIHRvIGl0 cyBvd24gYXJlYSwKKyAgICAgICAgICAgICAgICAgICB3ZSBtdXN0IGRyYXcgdGhlIGxlZnRfb3Zl cmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICovCisgICAgICAgICAgICAgICAgZW51bSBkcmF3 X2dseXBoc19mYWNlIHNhdmUgPSBuZXh0LT5obDsKKyAgICAgICAgICAgICAgICBuZXh0LT5obCA9 IHMtPmhsOworICAgICAgICAgICAgICAgIG1jX3hfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4dCwg Y3Vyc29yX2djX3ApOworICAgICAgICAgICAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGlu Z19leGFjdGx5IChzLCBuZXh0KTsKKyAgICAgICAgICAgICAgICBpZiAobmV4dC0+Zmlyc3RfZ2x5 cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9z dHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7 CisgICAgICAgICAgICAgICAgeF9yZXNldF9jbGlwX3JlY3RhbmdsZXMgKG5leHQtPmYsIG5leHQt PmdjKTsKKyAgICAgICAgICAgICAgICBuZXh0LT5obCA9IHNhdmU7CisgICAgICAgICAgICAgICAg bmV4dC0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICAgICAgICBuZXh0LT5jbGlwX2hlYWQgPSBz LT5uZXh0OworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIC8qIFJlc2V0IGNs aXBwaW5nLiAqLworICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAocy0+Ziwgcy0+Z2MpOworICBz LT5udW1fY2xpcHMgPSAwOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogLyogRGVmYXVsdCB0byB1c2luZyBYSU0gaWYgYXZhaWxh YmxlLiAgKi8KICNpZmRlZiBVU0VfWElNCiBib29sIHVzZV94aW0gPSB0cnVlOwpAQCAtOTk5LDYg KzE4NzgsMTUgQEAgeF91cGRhdGVfYmVnaW4gKHN0cnVjdCBmcmFtZSAqZikKICAgaWYgKEZSQU1F X1RPT0xUSVBfUCAoZikgJiYgIUZSQU1FX1ZJU0lCTEVfUCAoZikpCiAgICAgcmV0dXJuOwogCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYt Pm1jX3VwZGF0aW5nX2ZyYW1lID0gZjsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICBpZiAoISBGUkFNRV9DUl9TVVJGQUNFIChmKSkKICAgICB7CiAgICAgICBpbnQgd2lkdGgsIGhl aWdodDsKQEAgLTEyNjYsNiArMjE1NCwxNiBAQCB4X3VwZGF0ZV9lbmQgKHN0cnVjdCBmcmFtZSAq ZikKICAgWEZsdXNoIChGUkFNRV9YX0RJU1BMQVkgKGYpKTsKICAgdW5ibG9ja19pbnB1dCAoKTsK ICNlbmRpZgorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gTlVMTDsKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogfQogCiAvKiBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCBmcm9tIHZhcmlv dXMgcGxhY2VzIGluIHhkaXNwLmMKQEAgLTEzMTAwLDYgKzEzOTk4LDIwIEBAIHhfYWN0aXZhdGVf dGltZW91dF9hdGltZXIgKHZvaWQpCiAKIHN0YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFj ZSB4X3JlZGlzcGxheV9pbnRlcmZhY2UgPQogICB7CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBp biBgeHRlcm0uY2AgbXVzdCBiZSBpbiB0aGUgZXhhY3Qgc2FtZSBvcmRlciBhcyB0aGUKK2ByZWRp c3BsYXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4dGVybi5oYCEgKi8KKworICBtY194X2RyYXdfd2lu ZG93X2N1cnNvciwKKyAgbWNfeF9kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogICAgIHhfZnJhbWVfcGFybV9oYW5kbGVycywKICAgICB4X3Byb2R1Y2Vf Z2x5cGhzLAogICAgIHhfd3JpdGVfZ2x5cGhzLAo= --Multipart_Sun_Jun_23_19:25:16_2019-1--