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, 16 Jun 2019 01:07:46 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sun_Jun_16_01:07:46_2019-1" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="253322"; 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 Sun Jun 16 10:08:26 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 1hcQD8-0010J7-AN for geb-bug-gnu-emacs@m.gmane.org; Sun, 16 Jun 2019 10:08:25 +0200 Original-Received: from localhost ([::1]:38030 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcQD6-0001Th-P4 for geb-bug-gnu-emacs@m.gmane.org; Sun, 16 Jun 2019 04:08:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55325) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcQCs-0001TW-8V for bug-gnu-emacs@gnu.org; Sun, 16 Jun 2019 04:08:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcQCq-0005wu-4y for bug-gnu-emacs@gnu.org; Sun, 16 Jun 2019 04:08:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54335) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hcQCo-0005uk-51 for bug-gnu-emacs@gnu.org; Sun, 16 Jun 2019 04:08:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hcQCn-0006sA-On for bug-gnu-emacs@gnu.org; Sun, 16 Jun 2019 04:08: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: Sun, 16 Jun 2019 08:08: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.156067247726409 (code B ref 17684); Sun, 16 Jun 2019 08:08:01 +0000 Original-Received: (at 17684) by debbugs.gnu.org; 16 Jun 2019 08:07:57 +0000 Original-Received: from localhost ([127.0.0.1]:39647 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hcQCj-0006rq-Ny for submit@debbugs.gnu.org; Sun, 16 Jun 2019 04:07:57 -0400 Original-Received: from gateway22.websitewelcome.com ([192.185.47.65]:36898) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hcQCh-0006rX-Q8 for 17684@debbugs.gnu.org; Sun, 16 Jun 2019 04:07:56 -0400 Original-Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway22.websitewelcome.com (Postfix) with ESMTP id 6784AA043FC for <17684@debbugs.gnu.org>; Sun, 16 Jun 2019 03:07:55 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id cQCghlFr890oncQCghl1XF; Sun, 16 Jun 2019 03:07:55 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Jd0TVFOgTlETVYjajjSh+0DBiZQ8r0br+KmaVlov44Q=; b=fNhiL8hmwn0Da66NYDutEFOWGj kYsdI2WnA1AIjssLeyt7lu6TnqtGZBHIMuIsPHRL0FDh58HN/OVLMQcxtE4dSoOB/QVlF7UVpPnj/ tgLqzRVVXLQfAWX/3hIv2khXGwsm+e4Ecvt+lwtFsaqWoWtRV+CY9uJOQqLqEfq4DcJRPckwe6mEW 6TBLmaHbqVX7Mc3E0q9M58/ZxUSEZyXBJkXoYruSBHt7qAtD88cgifgF7NJt1U5KonEVGckayBqhs 5Lx5W2eXNBGXiNpgAJx0K5c+jX0uv3/BMiLvrRtCZVvgUOvxtcCObUxdlr3VJ4E/GK4yYcA9TDajM qY6llDgw==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:58275 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.92) (envelope-from ) id 1hcQCc-00151f-F8; Sun, 16 Jun 2019 03:07:53 -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: 1hcQCc-00151f-F8 X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:58275 X-Source-Auth: lawlist X-Email-Count: 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:160651 Archived-At: --Multipart_Sun_Jun_16_01:07:46_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 021.002 [06/15/2019] CHANGELOG: - `mc_row_position': Added tests for an empty buffer (not narrowed) and an empty buffer (narrowed), both of which will be treated as an AT_ZV situation if VPOS is the first text row in the buffer excluding the header-line-format (if any). - Compacted all of the calls to `mc_redraw_row' so that they are one-liners. - Miscellaneous tidying up of code; changed a few names of some struct members. SCREENSHOTS (X11, W32, NS): https://www.lawlist.com/images/22873_17684_light_dark_backgrounds.png SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 04/08/2019: git reset --hard a038df77de7b1aa2d73a6478493b8838b59e4982 Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed")))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out both the crosshairs feature and the visible fill column indicator feature, type: M-x +-mode - To try out just the visible fill column indicator feature, type: M-x fc-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, install that package first. [If the multiple-cursors package is installed, an eval-after-load "multiple-cursors-core" statement within `crosshairs.el` will redefine a couple of functions and set up a few keyboard shortcuts.] If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors)) TODO: - `ns_draw_window_cursor' calls `ns_clip_to_rect', which does _not_ take `row->clip` into consideration when drawing cursors with `NSRectFill'. When it comes time to draw glyphs on top of the box/hollow family of cursors, `row->clip` is taken into consideration by `get_glyph_string_clip'. Fake cursors can be drawn even though the glyphs cannot, resulting in hollow/box family of cursors without text. The issue can be reproduced with M-x mc-test. [A temporary workaround is to disable `row->clip` while drawing the glyphs.] https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00009.html - Add additional support for `ch_inactive_windows' and `fc_inactive_windows' when the variables have a `nil` value. In such a case, the inactive windows should not display the crosshairs and/or visible fill column indicator. At the present time, fake cursors are drawn in active/inactive windows alike. - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - Is there any additional meaningful optimization that can be added to the three calls of `mc_pre_scroll_clean'? - NOTE: As to `mc_scrolling_window', it would appear that there is no tangible benefit to rotating the current/prospective cache of fake cursors to compare the data before removing the fake cursors. When scrolling the display, only _some_ lines are copied to new locations. Areas that are not overwritten may have fake cursors and those may not necessarily be removed if desired/current matrix glyphs are equal. The test for `GLYPH_EQUAL_P' does not take into consideration the existence of a fake cursor, and the glyph (with a fake cursor) may not be updated as a result thereof. As to lines that are not copied, portions may be updated and fake cursors would be removed thereby. - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create an minimal working example and file a bug report. - There is a bug affecting an older version of Emacs for the NS port that causes partial line flickering when the same characters are grouped together (;;;;;;) and MC_GLYPHLESS cursors are above or below -- having the same background color as the frame; e.g., black on black (used to erase a glyphless cursor). The partial flickering is only noticeable with rapid fire; e.g., holding down the right/left arrow key. When changing the color of the glyphless cursor, the issue is not present. [@lawlist has verified that the X and HPOS coordinates are accurate.] - There is a bug affecting the recorded `w->mc.lnum_pixel_width` that is observable when not running under gdb, but disappears when running under gdb. While viewing a folded org-mode buffer, the non-gdb instance had a visible line number pixel-width of 44, but Emacs treated it as fluctuating between 44 and 55 as the cursor was moved to the end of line. In the gdb instance, the visible line number pixel width was 55 with no fluctuation under the same conditions as the non-gdb instance. This appears to be a different bug than bug#32177 (current line number shifts one column to the left) because the line number of the current line does not shift left, and changing the bidi settings did not correct the issue. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. --Multipart_Sun_Jun_16_01:07:46_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_06_15__21_52_03_071.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5iZjZkNjVhCi0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI4NSBAQAorOzs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Oz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ob3JpZ2luYWwtY29tbWFuZCAob3IgbWMtLXRoaXMtY29tbWFuZAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29tbWFuZC1yZW1hcHBpbmcgdGhpcy1v cmlnaW5hbC1jb21tYW5kKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0 aGlzLW9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgIDs7IHNraXAga2V5Ym9hcmQgbWFj cm9zLCBzaW5jZSB0aGV5IHdpbGwgZ2VuZXJhdGUgYWN0dWFsIGNvbW1hbmRzIHRoYXQgYXJlCisg ICAgICAgICAgICA7OyBhbHNvIHJ1biBpbiB0aGUgY29tbWFuZCBsb29wIC0gd2UnbGwgaGFuZGxl IHRob3NlIGxhdGVyIGluc3RlYWQuCisgICAgICAgICAgICAod2hlbiAoZnVuY3Rpb25wIG9yaWdp bmFsLWNvbW1hbmQpCisgICAgICAgICAgICAgIDs7IGlmIGl0J3MgYSBsYW1iZGEsIHdlIGNhbid0 IGtub3cgaWYgaXQncyBzdXBwb3J0ZWQgb3Igbm90CisgICAgICAgICAgICAgIDs7IC0gc28gZ28g YWhlYWQgYW5kIGFzc3VtZSBpdCdzIG9rLCBiZWNhdXNlIHdlJ3JlIGp1c3Qgb3B0aW1pc3RpYyBs aWtlIHRoYXQKKyAgICAgICAgICAgICAgKGlmIChvciAobm90IChzeW1ib2xwIG9yaWdpbmFsLWNv bW1hbmQpKQorICAgICAgICAgICAgICAgICAgICAgIDs7IGxhbWJkYSByZWdpc3RlcmVkIGJ5IHNt YXJ0cmVwCisgICAgICAgICAgICAgICAgICAgICAgKHN0cmluZy1wcmVmaXgtcCAiKCIgKHN5bWJv bC1uYW1lIG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgICAgICAgIChtYy9leGVjdXRl LWNvbW1hbmQtZm9yLWFsbC1mYWtlLWN1cnNvcnMgb3JpZ2luYWwtY29tbWFuZCkKKyAgICAgICAg ICAgICAgICA7OyBzbWFydHJlcCBgaW50ZXJuJ3MgY29tbWFuZHMgaW50byBvd24gb2JhcnJheSB0 byBoZWxwCisgICAgICAgICAgICAgICAgOzsgYGRlc2NyaWJlLWJpbmRpbmdzJy4gIFNvLCBsZXQn cyByZS1gaW50ZXJuJyBoZXJlIHRvCisgICAgICAgICAgICAgICAgOzsgbWFrZSB0aGUgY29tbWFu ZCBjb21wYXJhYmxlIGJ5IGBlcScuCisgICAgICAgICAgICAgICAgKHNldHEgb3JpZ2luYWwtY29t bWFuZCAoaW50ZXJuIChzeW1ib2wtbmFtZSBvcmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAgICAg ICAgICAgOzsgb3RoZXJ3aXNlIGl0J3MgYSBzeW1ib2wsIGFuZCB3ZSBjYW4gYmUgbW9yZSB0aG9y b3VnaAorICAgICAgICAgICAgICAgIChpZiAoZ2V0IG9yaWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1 cHBvcnRlZCkKKyAgICAgICAgICAgICAgICAgICAgKG1lc3NhZ2UgIiVTIGlzIG5vdCBzdXBwb3J0 ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4g KGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3Qg KG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1j L2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMv YWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2Nt ZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMv cHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29y cyBvcmlnaW5hbC1jb21tYW5kKSkpKQorICAgICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQt aW4tY3Vyc29ycworICAgICAgICAgICAgICAgIChzZXRxIG1jLWNvbmYKKyAgICAgICAgICAgICAg ICAgICAgICAgIChtYXBjYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoeCkg KGxpc3QgKG92ZXJsYXktc3RhcnQgeCkgImJhciIgbmlsKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgKG1jL2FsbC1mYWtlLWN1cnNvcnMpKSkpKSkpKSkpCisKKyAgKGRlZnVuIG1jL21hcmst bmV4dC1saWtlLXRoaXMtY3ljbGUtZm9yd2FyZCAoKQorICAiTWFya3MgbmV4dCBvY2N1cmVuY2Ug b2Ygd29yZCBsaWtlIHRoaXMgYW5kIGFkdmFuY2VzIGN1cnNvciB0byB0aGlzIG9jY3VycmVuY2Ui CisgIChpbnRlcmFjdGl2ZSkKKyAgICAobWMvbWFyay1uZXh0LWxpa2UtdGhpcyAxKSkKKworICAo ZGVmdW4gbWMvbWFyay1wcmV2aW91cy1saWtlLXRoaXMtY3ljbGUt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gICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAzKSBbMC4wIDEuMCAxLjBd KQorICAgICAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFuZ2VSZWQiKQorICAgICAg ICAgICAgICAgICAgICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAgICAgICAgICAgICAgICAg ICg5ICJib3giICJncmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93IChkaXNwbGF5LWJ1ZmZl ciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2luY2UgdGhpcyBmaXJlcyBn bG9iYWxseSwgd2UgbXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jvc3NoYWlycyBhcHBlYXIg aW4uIgorICAod2hlbiArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVtcSBsYXN0LWNvbW1hbmQg Ky1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVsbCArLXBhcmVucy1wKSkK KyAgICAgICgrLXBhcmVucy1mbikpCisgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgIChzZXRx IHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1pZGxlLWxpc3QpKQorICAg ICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkpKQorCisoZGVmdW4gKy1kcmF3LWZvcnRod2l0aCAo KQorIkltbWVkaWF0ZWx5IGRlbGV0ZS9kcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzLiIKKyAgKCst ZHJhdy1jcm9zc2hhaXJzICdmb3JjZSkpCisKKyhkZWZ1biArLWRyYXctY3Jvc3NoYWlycyAoJm9w dGlvbmFsIGZvcmNlKQorIkltbWVkaWF0ZWx5IGRlbGV0ZSBtYXRjaGluZyBwYXJlbnRoZXNlcy4g IElmIEZPUkNFIGlzIG5vbi1uaWwsIHRoZW4gaW1tZWRpYXRlbHkKK2RyYXcgbWF0Y2hpbmcgcGFy ZW50aGVzaXM7IG90aGVyd2lzZSwgZHJhdyB0aGVtIG9uIGFuIGlkbGUtdGllci4iCisgICh3aGVu ICstbW9kZQorICAgICh3aGVuICstdGltZXItdmFyCisgICAgICAoc2V0cSB0aW1lci1pZGxlLWxp c3QgKGRlbHEgKy10aW1lci12YXIgdGltZXItaWRsZS1saXN0KSkKKyAgICAgIChzZXRxICstdGlt ZXItdmFyIG5pbCkpCisgICAgKHVubGVzcyAob3IgKG1lbXEgdGhpcy1jb21tYW5kICstcGFyZW5z LWV4Y2x1c2lvbnMpCisgICAgICAgICAgICAgICAgKGFuZCAobnVsbCArLXBhcmVucy1wKQorICAg ICAgICAgICAgICAgICAgICAgKG51bGwgKy1wYXJlbnMtb3ZlcmxheXMtZXhpc3QtcCkpKQorICAg ICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZvcmNlCisgICAgICAocHJv Z24KKyAgICAgICAgKHdoZW4gKy1wYXJlbnMtcAorICAgICAgICAgICgrLXBhcmVucy1mbikpKQor ICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGltZXIgKy1pZGxlLXRpbWVy LXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKyhkZWZ2YXIgZmMtbW9kZSkKKworOzs7 IyMjYXV0b2xvYWQKKyhkZWZpbmUtbWlub3ItbW9kZSArLW1vZGUKKyJNaW5vciBtb2RlIGZvciBk aXNwbGF5aW5nIGEgaG9yaXpvbnRhbCBydWxlci4iCisgIDppbml0LXZhbHVlIG5pbAorICA6bGln aHRlciAiICsiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisgIDpncm91cCAnKy1tb2Rl CisgIChjb25kCisgICAgKCstbW9kZQorICAgICAgOzs7IGArLW1vZGUnIGhhcyB0aGUgYWJpbGl0 eSB0byBhbHNvIGRpc3BsYXkgYSBmaWxsIGNvbHVtbiBpbmRpY2F0b3IuCisgICAgICA7OzsgU2Vl IHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuCisgICAgICAod2hlbiBmYy1tb2RlCisgICAg ICAgIChmYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFsLWVsZG9jLW1vZGUKKyAg ICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgICAg ICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAgKGdsb2JhbC1l bGRvYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2stY29udGV4dC10aW1lcgor ICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAo dGltZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciBq aXQtbG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEgaml0LWxvY2stY29udGV4 dC10aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAnaml0LWxvY2stY29udGV4 dC1mb250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4dC10aW1lciBuaWwpKQor ICAgICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAo dGltZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQorICAgICAgICAgIChjYW5j ZWwtdGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpKQorICAgICAgICAoZnNl dCA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vbiBMMlIgbGFuZ3VhZ2VzLiAgVGhlIGZl YXR1cmUgdGVzdCBmaWxlIHVzZWQgYnkgQGxhd2xpc3QKKyAgICAgIDs7OyBib2dzIEVtYWNzIGRv d24gdW5sZXNzIGBiaWRpLWRpc3BsYXktcmVvcmRlcmluZycgaXMgc2V0IHRvIGEgbmlsIHZhbHVl LgorICAgICAgOzs7IEhvd2V2ZXIsIG1vc3QgdXNlcnMgd2lsbCBwcm9iYWJseSBub3Qgd2FudCB0 aGlzIHBhcnRpY3VsYXIgc2V0dGluZy4KKyAgICAgICh1bmxlc3MgKG51bGwgYmlkaS1kaXNwbGF5 LXJlb3JkZXJpbmcpCisgICAgICAgIChzZXRxIGJpZGktZGlzcGxheS1yZW9yZGVyaW5nIG5pbCkp CisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICcrLS1zYXZlZC1zdGF0ZSkgbmlsKQor ICAgICAgKGRvbGlzdCAodmFyICcoYnVmZmVyLWRpc3BsYXktdGFibGUKKyAgICAgICAgICAgICAg ICAgICAgIGZyaW5nZS1pbmRpY2F0b3ItYWxpc3QKKyAgICAgICAgICAgICAgICAgICAgIHRhYi13 aWR0aAorICAgICAgICAgICAgICAgICAgICAgbGluZS1tb3ZlLXZpc3VhbAorICAgICAgICAgICAg ICAgICAgICAgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgICAgICAgICAgICAgIHRydW5jYXRlLXBh cnRpYWwtd2lkdGgtd2luZG93cworICAgICAgICAgICAgICAgICAgICAgd29yZC13cmFwKSkKKyAg ICAgICAgKHdoZW4gKGxvY2FsLXZhcmlhYmxlLXAgdmFyKQorICAgICAgICAgIChwdXNoIChjb25z IHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICstLXNhdmVkLXN0YXRlKSkpCisgICAgICAoc2V0cSBm aWxsLWNvbHVtbiA4MCkKKyAgICAgIChzZXRxIGRpc3BsYXktbGluZS1udW1iZXJzIHQpCisgICAg ICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1saW5lKQorICAgICAgKHNl dHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAoc2V0cSBidWZmZXItZGlzcGxheS10YWJs ZSArLWJ1ZmZlci1kaXNwbGF5LXRhYmxlKQorICAgICAgKHNldHEgdGFiLXdpZHRoIDQpCisgICAg ICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlzdWFsKSB0KQorICAgICAg KHNldHEgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKGxldCAoKGxz dCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisgICAgICAgICAgICAgICAgICBtb2Rl KQorICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAgICAod2hpbGUgKHNldHEg bW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAgICAgKHdoZW4gKGRlcml2ZWQtbW9kZS1wIG1v ZGUpCisgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkpKSkKKyAgICAgICAgICAg KChtZW1xIG1ham9yLW1vZGUgKy10cnVuY2F0ZS1saW5lcy1tYWpvci1tb2RlcykpCisgICAgICAg ICAgICh0CisgICAgICAgICAgICAgbmlsKSkpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlh YmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRvd3MpIG5pbCkKKyAgICAgIChzZXRxIHdv cmQtd3JhcCB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGluZXMgdCkKKyAgICAgIChz ZXRxIGluZGljYXRlLWJ1ZmZlci1ib3VuZGFyaWVzICdsZWZ0KQorICAgICAgKHNldHEgZnJpbmdl LWluZGljYXRvci1hbGlzdAorICAgICAgICAgIDs7OyBoc2NsX2FsbF90ZW1wX3AgfCBoc2NsX3Rl bXBfcAorICAgICAgICAnKCgrLWhzY2wtdGVtcCAuICgrLXNpbmdsZS1hbmdsZS1sZWZ0CisgICAg ICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLWxlZnQpKQorICAgICAgICAgIDs7 OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxsX3Blcm1fMV9wIHwgaHNjbF9hbGxfcGVybV8y X3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICgrLWhzY2wtcGVybSAuICgrLXNpbmdsZS1hbmds ZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1hbmdsZS11cAorICAgICAg ICAgICAgICAgICAgICAgICAgICArLXRyaXBsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAg ICAgICAgICArLXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAgKCstb3ZlcmxheS1hcnJv dyAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAr LWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAgKHRydW5jYXRpb24gLiAoKy1mcmluZ2Ut bGVmdC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJpZ2h0LWFycm93 KSkKKyAgICAgICAgICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxlZnQtY3VybHktYXJyb3cK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNoKSkKKyAgICAgICAgICAob3Zl cmxheS1hcnJvdyAuICstZnJpbmdlLXJpZ2h0LXRyaWFuZ2xlKQorICAgICAgICAgICh1cCAuICst ZnJpbmdlLXVwLWFycm93KQorICAgICAgICAgIChkb3duIC4gKy1mcmluZ2UtZG93bi1hcnJvdykK KyAgICAgICAgICAodG9wIC4gKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUpCisgICAgICAgICAgKGJv dHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAgICAgICAodG9wLWJvdHRv bSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICArLWZy aW5nZS1yaWdodC1icmFja2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtdG9w LXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtdG9wLWxlZnQt YW5nbGUpKQorICAgICAgICAgIChlbXB0eS1saW5lIC4gKy1mcmluZ2UtZW1wdHktbGluZSkKKyAg ICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmspKSkKKyAgICAgIChzZXRx IGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94IC4gKy1mcmluZ2UtbGVmdC10cmlhbmdsZSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaG9sbG93IC4gKy1ob2xsb3ctcmVjdGFu Z2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChiYXIgLiArLXZlcnRpY2Fs LWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaGJhciAuICstZnJpbmdl LWhvcml6b250YWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChob2xs b3ctc21hbGwgLiArLWZyaW5nZS1ob2xsb3ctc3F1YXJlKSkpCisgICAgICAoaWYgKG9yICstZm9y dGh3aXRoCisgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisg ICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJhdy1mb3J0aHdpdGggJ2Fw cGVuZCAnbG9jYWwpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJh dy1jcm9zc2hhaXJzICdhcHBlbmQgJ2xvY2FsKSkKKyAgICAgICh3aGVuICstZm9ydGh3aXRoCisg ICAgICAgIChhZGQtaG9vayAnd2luZG93LWNvbmZpZ3VyYXRpb24tY2hhbmdlLWhvb2sgJystZHJh dy1mb3J0aHdpdGggbmlsICdsb2NhbCkpCisgICAgICAoYWRkLWhvb2sgJ2NoYW5nZS1tYWpvci1t b2RlLWhvb2sgJ3R1cm4tb2ZmLSstbW9kZSBuaWwgJ2xvY2FsKQorICAgICAgOzs7IE1hdGNoaW5n IHBhcmVudGhlc2VzIGRyYXdpbmcgZm9ydGh3aXRoIGludGVyZmVyZXMgd2l0aCB5YXNuaXBwZXQu CisgICAgICAod2hlbiArLWZvcnRod2l0aAorICAgICAgICAoc2V0cSArLXBhcmVucy1wIG5pbCkp CisgICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAoY29u ZAorICAgICAgICAgICgrLWZvcnRod2l0aAorICAgICAgICAgICAgKG1lc3NhZ2UgIlR1cm5lZCBP TiBgKy1tb2RlJyAtLSBEcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzIGltbWVkaWF0ZWx5LiIpKQor ICAgICAgICAgICgoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpCisgICAgICAgICAgICA7 OzsgTWF0Y2hpbmcgcGFyZW50aGVzZXMgd2lsbCBiZSBkcmF3biBpbW1lZGlhdGVseS4KKyAgICAg ICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScgLS0gT3B0aW1pemVkIGZvciBkZWJ1 Z2dpbmcgcHVycG9zZXMuIikpCisgICAgICAgICAgKHQKKyAgICAgICAgICAgIChtZXNzYWdlICJU dXJuZWQgT04gYCstbW9kZScuIikpKSkpCisgICAgKHQKKyAgICAgIChraWxsLWxvY2FsLXZhcmlh YmxlICdmaWxsLWNvbHVtbikKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdhdXRvLWhzY3Jv bGwtbW9kZSkKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdoc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CAobWFrZS1sb2NhbC12YXJpYWJsZSAoY2FyIHNhdmVkKSkgKGNkciBzYXZl ZCkpKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJystLXNhdmVkLXN0YXRlKQorICAgICAg KCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykKKyAgICAgICh3aGVuIChtZW1xICcrLWRyYXctZm9y dGh3aXRoIHBvc3QtY29tbWFuZC1ob29rKQorICAgICAgICAocmVtb3ZlLWhvb2sgJ3Bvc3QtY29t bWFuZC1ob29rICcrLWRyYXctZm9ydGh3aXRoICdsb2NhbCkpCisgICAgICAod2hlbiAobWVtcSAn Ky1kcmF3LWNyb3NzaGFpcnMgcG9zdC1jb21tYW5kLWhvb2spCisgICAgICAgIChyZW1vdmUtaG9v ayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJhdy1jcm9zc2hhaXJzICdsb2NhbCkpCisgICAgICAo d2hlbiAobWVtcSAnKy1kcmF3LWZvcnRod2l0aCB3aW5kb3ctY29uZmlndXJhdGlvbi1jaGFuZ2Ut aG9vaykKKyAgICAgICAgKHJlbW92ZS1ob29rICd3aW5kb3ctY29uZmlndXJhdGlvbi1jaGFuZ2Ut aG9vayAnKy1kcmF3LWZvcnRod2l0aCAnbG9jYWwpKQorICAgICAgKHJlbW92ZS1ob29rICdjaGFu Z2UtbWFqb3ItbW9kZS1ob29rICd0dXJuLW9mZi0rLW1vZGUgJ2xvY2FsKQorICAgICAgKHdoZW4g Ky10aW1lci12YXIKKyAgICAgICAgKHNldHEgdGltZXItaWRsZS1saXN0IChkZWxxICstdGltZXIt dmFyIHRpbWVyLWlkbGUtbGlzdCkpCisgICAgICAgIChzZXRxICstdGltZXItdmFyIG5pbCkpCisg ICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAobWVzc2Fn ZSAiVHVybmVkIE9GRiBgKy1tb2RlJy4iKSkpKSkKKworKGRlZnVuIHR1cm4tb2ZmLSstbW9kZSAo KQorICAoKy1tb2RlIC0xKSkKKworOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7CisKKyhkZWZ1biAr LXBhcmVucy1mbiAoKQorICAiRG9jLXN0cmluZy4iCisgIChsZXQqICgob3BvaW50IChwb2ludCkp CisgICAgICAgICAoZnJvbSAoaWYgKy1wYXJlbnMtZnJvbS1mbgorICAgICAgICAgICAgICAgICAo ZnVuY2FsbCArLXBhcmVucy1mcm9tLWZuKQorICAgICAgICAgICAgICAgICAocG9pbnQtbWluKSkp CisgICAgICAgICAod2luIChzZWxlY3RlZC13aW5kb3cpKQorICAgICAgICAgKGkgMCkKKyAgICAg ICAgIChwcmVjZWRpbmctY2hhciAocHJlY2VkaW5nLWNoYXIpKQorICAgICAgICAgKG9jaGFyIChj aGFyLWFmdGVyIG9wb2ludCkpCisgICAgICAgICAocG9zMQorICAgICAgICAgICAoY29uZAorICAg ICAgICAgICAgICgoYW5kIG9jaGFyCisgICAgICAgICAgICAgICAgICAgKG9yIDs7OyAoY2hhci10 by1zdHJpbmcgNDApID0+IG9wZW5pbmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICAg ICAgKD0gb2NoYXIgNDApCisgICAgICAgICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJp bmcgOTEpID0+IG9wZW5pbmcgc3F1YXJlIGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAg KD0gb2NoYXIgOTEpCisgICAgICAgICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcg MTIzKSA9PiBvcGVuaW5nIHdhdnkgYnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAoPSBv Y2hhciAxMjMpKSkKKyAgICAgICAgICAgICAgICAobWluICgxKyBvcG9pbnQpIChwb2ludC1tYXgp KSkKKyAgICAgICAgICAgICAoKG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDEpID0+IGNsb3Npbmcg cGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDQxKQorICAg ICAgICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyA5MykgPT4gY2xvc2luZyBzcXVhcmUg YnJhY2tldAorICAgICAgICAgICAgICAgICAgKD0gcHJlY2VkaW5nLWNoYXIgOTMpCisgICAgICAg ICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDEyNSkgPT4gY2xvc2luZyB3YXZ5IGJyYWNr ZXQKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDEyNSkpCisgICAgICAgICAg ICAgICAgKG1heCAocG9pbnQtbWluKSAoMS0gb3BvaW50KSkpCisgICAgICAgICAgICAgKHQKKyAg ICAgICAgICAgICAgICBvcG9pbnQpKSkKKyAgICAgICAgIHBvczIKKyAgICAgICAgIHNlbGVjdGVk LWZhY2UpCisgICAgKHNhdmUtZXhjdXJzaW9uCisgICAgICAoY29uZGl0aW9uLWNhc2UgbmlsCisg ICAgICAgICh3aGlsZSAoc2V0cSBwb3MxIChudGggMSAocGFyc2UtcGFydGlhbC1zZXhwIGZyb20g cG9zMSkpKQorICAgICAgICAgIChzZXRxIHBvczIgKHNjYW4tc2V4cHMgcG9zMSAxKSkKKyAgICAg ICAgICAoaWYgKD0gaSAxMCkKKyAgICAgICAgICAgIChzZXRxIGkgMSkKKyAgICAgICAgICAgIChz ZXRxIGkgKDErIGkpKSkKKyAgICAgICAgICAoc2V0cSBzZWxlY3RlZC1mYWNlIChjb25kCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJystcGFyZW5zLW9uZS1mYWNlKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAoKD0gaSAyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcr LXBhcmVucy10d28tZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkg MykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtdGhyZWUtZmFj ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgNCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtZm91ci1mYWNlKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAoKD0gaSA1KQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICcrLXBhcmVucy1maXZlLWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICgoPSBpIDYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5z LXNpeC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA3KQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1zZXZlbi1mYWNlKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA4KQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICcrLXBhcmVucy1laWdodC1mYWNlKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAoKD0gaSA5KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICcrLXBhcmVucy1uaW5lLWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgo PSBpIDEwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10ZW4t ZmFjZSkpKQorICAgICAgICAgIChsZXQgKChvdiAobWFrZS1vdmVybGF5IHBvczEgKDErIHBvczEp KSkpCisgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmR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AgICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAg ICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAoKGFu ZAorICAgICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAgICAgICAgICAgICAgIChu dWxsIGVuZCkpCisgICAgICAgICAgICAgICBwb2ludC1tYXgpCisgICAgICAgICAgICAgKChhbmQK KyAgICAgICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAg ICAgICAgICAgICAgKDwgZW5kIHBvaW50LW1heCkpCisgICAgICAgICAgICAgICBlbmQpCisgICAg ICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAg ICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKD0gZW5kIHBvaW50LW1heCkpCisgICAgICAgICAg ICAgICAoMSsgZW5kKSkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICBuYXJy b3dlZC1wCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICAoMSsg cG9pbnQtbWF4KSkgKSkKKyAgICAgICAgIChvdmVybGF5cworICAgICAgICAgICAocHJvZ24KKyAg ICAgICAgICAgICAob3ZlcmxheS1yZWNlbnRlciBlbmQpCisgICAgICAgICAgICAgKG92ZXJsYXlz LWluIGJlZyBlbmQpKSkpCisgICAgKHdoZW4gKGFuZCBiZWcgZW5kIG5hbWUgdmFsKQorICAgICAg KGRvbGlzdCAobyBvdmVybGF5cykKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKGFuZCAoZXEg bmFtZSAnZmFjZSkKKyAgICAgICAgICAgICAgICAoZXEgKG92ZXJsYXktZ2V0IG8gbmFtZSkgdmFs KSkKKyAgICAgICAgICAgIDs7IEVpdGhlciBwdXNoIHRoaXMgb3ZlcmxheSBvdXRzaWRlIGJlZy4u LmVuZAorICAgICAgICAgICAgOzsgb3Igc3BsaXQgaXQgdG8gZXhjbHVkZSBiZWcuLi5lbmQKKyAg ICAgICAgICAgIDs7IG9yIGRlbGV0ZSBpdCBlbnRpcmVseSAoaWYgaXQgaXMgY29udGFpbmVkIGlu IGJlZy4uLmVuZCkuCisgICAgICAgICAgICAoaWYgKDwgKG92ZXJsYXktc3RhcnQgbykgYmVnKQor ICAgICAgICAgICAgICAgIChpZiAoPiAob3ZlcmxheS1lbmQgbykgZW5kKQorICAgICAgICAgICAg ICAocHJvZ24KKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IChjb3B5LW92ZXJsYXkgbykK KyAgICAgICAgICAgICAgICAgIChvdmVybGF5LXN0YXJ0IG8pIGJlZykKKyAgICAgICAgICAgICAg ICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkpCisgICAgICAgICAgICAgICAg ICAobW92ZS1vdmVybGF5IG8gKG92ZXJsYXktc3RhcnQgbykgYmVnKSkKKyAgICAgICAgICAgICAg KGlmICg+IChvdmVybGF5LWVuZCBvKSBlbmQpCisgICAgICAgICAgICAgICAgICAobW92ZS1vdmVy bGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkKKyAgICAgICAgICAgICAgICAoZGVsZXRlLW92ZXJs YXkgbykpKSkKKyAgICAgICAgICAoKGFuZCAobm90IChlcSBuYW1lICdmYWNlKSkKKyAgICAgICAg ICAgICAgICAoZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXMgKG92ZXJsYXktZ2V0IG8gbmFtZSkg dmFsKSkKKyAgICAgICAgICAgIChkZWxldGUtb3ZlcmxheSBvKSkpKSkpKQorCisoZGVmdW4gKy1k ZWxldGUtcGFyZW5zLW92ZXJsYXlzICgpCisgICh3aGVuICstcGFyZW5zLW92ZXJsYXlzLWV4aXN0 LXAKKyAgICAoZG9saXN0IChmYWNlICcoKy1wYXJlbnMtb25lLWZhY2UKKyAgICAgICAgICAgICAg ICAgICAgKy1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vciBtb2RlIGZvciBkaXNwbGF5aW5n IGEgdmlzdWFsIGZpbGwgY29sdW1uLiIKKyAgOmluaXQtdmFsdWUgbmlsCisgIDpsaWdodGVyICIg RkMiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisgIDpncm91cCAnZmMtbW9kZQorICAo Y29uZAorICAgIDs7OyBgKy1tb2RlJyBoYXMgdGhlIGFiaWxpdHkgdG8gYWxzbyBkaXNwbGF5IGEg ZmlsbCBjb2x1bW4gaW5kaWNhdG9yLgorICAgIDs7OyBTZWUgdGhlIHZhcmlhYmxlIGArLWZpbGwt Y29sdW1uJy4KKyAgICAoKGFuZCBmYy1tb2RlICstbW9kZSkKKyAgICAgIChzZXRxIGZjLW1vZGUg bmlsKQorICAgICAgKG1lc3NhZ2UgIlR1cm5lZCBPRkYgYGZjLW1vZGUnICglcykgLS0gc2VlIHRo ZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuIiAoY3VycmVudC1idWZmZXIpKSkKKyAgICAoZmMt bW9kZQorICAgICAgKHdoZW4gKGFuZCBnbG9iYWwtZWxkb2MtbW9kZQorICAgICAgICAgICAgICAg ICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwg Y3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAoZ2xvYmFsLWVsZG9jLW1vZGUgLTEp KQorICAgICAgKHdoZW4gKGFuZCBqaXQtbG9jay1jb250ZXh0LXRpbWVyCisgICAgICAgICAgICAg ICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVh bCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgaml0LWxv Y2stY29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVyIGppdC1sb2NrLWNvbnRl eHQtdGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIChydW4t d2l0aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250ZXh0LWZvbnRpZnkpKQor ICAgICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkpCisgICAgICAod2hlbiAo YW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVh bCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgdW5kby1h dXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciB1bmRv LWF1dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChmc2V0ICd1bmRvLWF1dG8t LXVuZG9hYmxlLWNoYW5nZQorICAgICAgICAgICAgICAobGFtYmRhICgpIChhZGQtdG8tbGlzdCAn dW5kby1hdXRvLS11bmRvYWJseS1jaGFuZ2VkLWJ1ZmZlcnMgKGN1cnJlbnQtYnVmZmVyKSkpKQor ICAgICAgICAoZnNldCAndW5kby1hdXRvLWFtYWxnYW1hdGUgJ2lnbm9yZSkpCisgICAgICAod2hl biBibGluay1jdXJzb3ItbW9kZQorICAgICAgICAoYmxpbmstY3Vyc29yLW1vZGUgLTEpCisgICAg ICAgICh3aGVuIChtZW1xICdibGluay1jdXJzb3ItY2hlY2sgcG9zdC1jb21tYW5kLWhvb2spCisg ICAgICAgICAgKHJlbW92ZS1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAnYmxpbmstY3Vyc29yLWNo ZWNrKSkpCisgICAgICAoc2V0cSBmYy12aXNpYmxlIHQpCisgICAgICA7OzsgYGF1dG8tY29tcG9z aXRpb24tbW9kZScgaXMgbmVlZGVkIGZvciBjcm9zc2hhaXJzIHRvIHByb3Blcmx5IGNhbGN1bGF0 ZQorICAgICAgOzs7IGNvb3J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ci1wcmUtenYtZmFj ZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1yZXZlcnNlZC1iYXItYXQtenYt ZmFjZQorICAnKCh0ICg6Zm9yZWdyb3VuZCAiY2hhcnRyZXVzZSIpKSkKKyAgIkZhY2UgZm9yIGAr LXJldmVyc2VkLWJhci1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFj ZSArLXJldmVyc2VkLWJhci1wb3N0LXp2LWZhY2UKKyAgJygodCAoOmZvcmVncm91bmQgImN5YW40 IikpKQorICAiRmFjZSBmb3IgYCstcmV2ZXJzZWQtYmFyLXBvc3QtenYtZmFjZScuIgorICA6Z3Jv dXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1ldmVuLXByZS16di1mYWNlCisgICcoKCgoY2xhc3Mg Y29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91 bmQgInllbGxvdyIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dy b3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJjeWFuMSIpCisgICAgKCgoY2xhc3MgY29s b3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQg InllbGxvdyIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3Vu ZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJjeWFuMSIpCisgICAgKCgoY2xhc3MgY29sb3Ip IChtaW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUg dHR5KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVn cm91bmQgInBpbmsiKSkKKyAgIkZhY2UgZm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W5kICJE ZWVwUGluazEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91 bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQorICAgICgoKGNsYXNzIGNv bG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3Vu ZCAiRGVlcFBpbmsxIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgOCkpCisgICAg IDpmb3JlZ3JvdW5kICJ3aGl0ZSIpCisgICAgKCgodHlwZSB0dHkpIChjbGFzcyBtb25vKSkKKyAg ICAgOmludmVyc2UtdmlkZW8gdCkKKyAgICAodCA6Zm9yZWdyb3VuZCAicGluayIpKQorICAiRmFj ZSBmb3IgYCstZXZlbi1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFj ZSArLWV2ZW4taW5hY3RpdmUtYXQtenYtZmFjZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNv bG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEZWVwUGluazQi KQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgbGlnaHQp KQorICAgICA6Zm9yZWdyb3VuZCAiRGVlcFBpbms0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1p bi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5kIGRhcmspKQorICAgICA6Zm9yZWdyb3VuZCAiRGVlcFBp bms0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5kIGxp Z2h0KSkKKyAgICAgOmZvcmVncm91bmQgIkRlZXBQaW5rNCIpCisgICAgKCgoY2xhc3MgY29sb3Ip IChtaW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUg dHR5KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVn cm91bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGArLWV2ZW4taW5hY3RpdmUtYXQtenYtZmFjZScu IgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1ldmVuLXBvc3QtenYtZmFjZQorICAn KCgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAg IDpmb3JlZ3JvdW5kICJEYXJrT2xpdmVHcmVlbjMiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWlu LWNvbG9ycyA4OCkgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAiY3lhbjQi KQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgZGFyaykp CisgICAgIDpmb3JlZ3JvdW5kICJEYXJrT2xpdmVHcmVlbjMiKQorICAgICgoKGNsYXNzIGNvbG9y KSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAi Y3lhbjQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVn cm91bmQgIndoaXRlIikKKyAgICAoKCh0eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52 ZXJzZS12aWRlbyB0KQorICAgICh0IDpmb3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBg Ky1ldmVuLXBvc3QtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1l dmVuLWluYWN0aXZlLXBvc3QtenYtZmFjZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9y cyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEYXJrT2xpdmVHcmVl bjQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgbGln aHQpKQorICAgICA6Zm9yZWdyb3VuZCAiUm95YWxCbHVlIikKKyAgICAoKChjbGFzcyBjb2xvcikg KG1pbi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5kIGRhcmspKQorICAgICA6Zm9yZWdyb3VuZCAiRGFy a09saXZlR3JlZW40IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYpIChiYWNr Z3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgIlJveWFsQmx1ZSIpCisgICAgKCgoY2xh c3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAg ICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAg KHQgOmZvcmVncm91bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGArLWV2ZW4taW5hY3RpdmUtcG9z dC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSArLW9kZC1wcmUtenYt ZmFjZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFy aykpCisgICAgIDpmb3JlZ3JvdW5kICJyZWQxIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1j b2xvcnMgODgpIChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgInJlZDEiKQor ICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgZGFyaykpCisg ICAgIDpmb3JlZ3JvdW5kICJyZWQxIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pb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gICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpm b3JlZ3JvdW5kICJTdGVlbEJsdWU0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMg MTYpIChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgIlN0ZWVsQmx1ZTQiKQor ICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndo aXRlIikKKyAgICAoKCh0eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12aWRl byB0KQorICAgICh0IDpmb3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBgKy1vZGQtaW5h Y3RpdmUtYXQtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1vZGQt cG9zdC16di1mYWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dy b3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTEiKQorICAgICgoKGNsYXNzIGNv bG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3Vu ZCAiRGFya1NhbG1vbiIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFj a2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTEiKQorICAgICgoKGNsYXNz IGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdy b3VuZCAiRGFya1NhbG1vbiIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQor ICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAgICgoKH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F9PYmplY3Qg dmFsKQoreworICBiLT5jcm9zc2hhaXJzXyA9IHZhbDsKK30KKworc3RhdGljIHZvaWQKK2JzZXRf Y2hfaG9yaXpvbnRhbF9ydWxlciAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQor eworICBiLT5jaF9ob3Jpem9udGFsX3J1bGVyXyA9IHZhbDsKK30KKworc3RhdGljIHZvaWQKK2Jz ZXRfY2hfdmVydGljYWxfcnVsZXIgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkK K3sKKyAgYi0+Y2hfdmVydGljYWxfcnVsZXJfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAorYnNl dF9jaF9pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwp Cit7CisgIGItPmNoX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAor YnNldF9mY192aXNpYmxlIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7Cisg IGItPmZjX3Zpc2libGVfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAorYnNldF9mY19pbmFjdGl2 ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPmZj X2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAq LworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogc3RhdGljIHZvaWQKIGJzZXRfYWJicmV2 X21vZGUgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkKIHsKQEAgLTUxNDIsNiAr NTIwNSwyNCBAQCBpbml0X2J1ZmZlcl9vbmNlICh2b2lkKQogICBic2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YnVmZmVyX2xv Y2FsX2ZsYWdzLCBmY19pbmFjdGl2ZV93aW5kb3dzKSwgaWR4KTsgKytpZHg7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxf ZmxhZ3MsIG1vZGVfbGluZV9mb3JtYXQpLCBpZHgpOyArK2lkeDsKICAgWFNFVEZBU1RJTlQgKEJW QVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIGFiYnJldl9tb2RlKSwgaWR4KTsgKytpZHg7CiAgIFhT RVRGQVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBvdmVyd3JpdGVfbW9kZSksIGlk eCk7ICsraWR4OwpAQCAtNTIyOCw2ICs1MzA5LDI0IEBAIGluaXRfYnVmZmVyX29uY2UgKHZvaWQp CiAgIC8qIE11c3QgZG8gdGhlc2UgYmVmb3JlIG1ha2luZyB0aGUgZmlyc3QgYnVmZmVyISAqLwog CiAgIC8qIHJlYWwgc2V0dXAgaXMgZG9uZSBpbiBiaW5kaW5ncy5lbCAqLworCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGJzZXRfbWNfcmVh bF9mYWtlX2N1cnNvciAoJmJ1ZmZlcl9kZWZhdWx0cywgUWhvbGxvdyk7CisgIGJzZXRfbWNfY29u ZiAoJmJ1ZmZlcl9kZWZhdWx0cywgUW5pbCk7CisgIGJzZXRfbWNfaW5hY3RpdmVfd2luZG93cyAo JmJ1ZmZlcl9kZWZhdWx0cywgUXQpOworICBic2V0X2Nyb3NzaGFpcnMgKCZidWZmZXJfZGVmYXVs dHMsIFFuaWwpOworICBic2V0X2NoX2hvcml6b250YWxfcnVsZXIgKCZidWZmZXJfZGVmYXVsdHMs IFF0KTsKKyAgYnNldF9jaF92ZXJ0aWNhbF9ydWxlciAoJmJ1ZmZlcl9kZWZhdWx0cywgUXQpOwor ICBic2V0X2NoX2luYWN0aXZlX3dpbmRvd3MgKCZidWZmZXJfZGVmYXVsdHMsIFF0KTsKKyAgYnNl dF9mY192aXNpYmxlICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKKyAgYnNldF9mY19pbmFjdGl2 ZV93aW5kb3dzICgmYnVmZmVyX2RlZmF1bHRzLCBRdCk7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgYnNldF9tb2RlX2xpbmVfZm9ybWF0ICgmYnVmZmVyX2RlZmF1bHRzLCBidWls ZF9wdXJlX2Nfc3RyaW5nICgiJS0iKSk7CiAgIGJzZXRfaGVhZGVyX2xpbmVfZm9ybWF0ICgmYnVm ZmVyX2RlZmF1bHRzLCBRbmlsKTsKICAgYnNldF9hYmJyZXZfbW9kZSAoJmJ1ZmZlcl9kZWZhdWx0 cywgUW5pbCk7CkBAIC01NDU4LDYgKzU1NTcsNTEgQEAgZGVmdmFyX3Blcl9idWZmZXIgKHN0cnVj dCBMaXNwX0J1ZmZlcl9PYmpmd2QgKmJvX2Z3ZCwgY29uc3QgY2hhciAqbmFtZXN0cmluZywKIHZv aWQKIHN5bXNfb2ZfYnVmZmVyICh2b2lkKQogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIERFRlNZTSAoUW1jX3JlYWxfZmFrZV9jdXJz b3IsICJtYy1yZWFsLWZha2UtY3Vyc29yIik7CisgIERFRlZBUl9QRVJfQlVGRkVSICgibWMtcmVh bC1mYWtlLWN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lKSwgUW5pbCwK KyAgICBkb2M6IC8qIEEgYnVmZXItbG9jYWwgdmFyaWFibGUgdG8gdHVybiBvbi9vZmYgdGhlIG11 bHRpcGxlIGN1cnNvcnMgZmlsbCBjb2x1bW4uICovKTsKKworICBERUZTWU0gKFFmY192aXNpYmxl X2luYWN0aXZlX3dpbmRvdywgImZjLWluYWN0aXZlLXdpbmRvdyIpOworICBERUZWQVJfUEVSX0JV RkZFUiAoImZjLWluYWN0aXZlLXdpbmRvd3MiLCAmQlZBUiAoY3VycmVudF9idWZmZXIsIGZjX2lu YWN0aXZlX3dpbmRvd3MpLCBRbmlsLAorICAgIGRvYzogLyogV2hlbiBub24tbmlsLCBkcmF3IG11 bHRpcGxlIGN1cnNvcnMgZmlsbCBjb2x1bW4gaW4gaW5hY3RpdmUgd2luZG93cy4gKi8pOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIHN0YXRpY3BybyAoJmxhc3Rfb3ZlcmxheV9t b2RpZmljYXRpb25faG9va3MpOwogICBsYXN0X292ZXJsYXlfbW9kaWZpY2F0aW9uX2hvb2tzID0g bWFrZV9uaWxfdmVjdG9yICgxMCk7CiAKZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIuaCBiL3NyYy9i dWZmZXIuaAppbmRleCBmNDJjM2U5Li4xODlmYWM1IDEwMDY0NAotLS0gYS9zcmMvYnVmZmVyLmgK KysrIGIvc3JjL2J1ZmZlci5oCkBAIC03MzYsNiArNzM2LDQwIEBAIHN0cnVjdCBidWZmZXIKICAg ICAgaW4gdGhlIGRpc3BsYXkgb2YgdGhpcyBidWZmZXIuICAqLwogICBMaXNwX09iamVjdCBleHRy YV9saW5lX3NwYWNpbmdfOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLy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gIExpc3BfT2JqZWN0IGZjX2luYWN0aXZlX3dpbmRvd3NfOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIEN1cnNvciB0eXBlIHRvIGRpc3BsYXkg aW4gbm9uLXNlbGVjdGVkIHdpbmRvd3MuCiAgICAgIHQgbWVhbnMgdG8gdXNlIGhvbGxvdyBib3gg Y3Vyc29yLgogICAgICBTZWUgYGN1cnNvci10eXBlJyBmb3Igb3RoZXIgdmFsdWVzLiAgKi8KQEAg LTc4NywxNCArODIxLDIxIEBAIHN0cnVjdCBidWZmZXIKICAgICAgYW4gaW5kaXJlY3QgYnVmZmVy IHNpbmNlIGl0IGNvdW50cyBhcyBpdHMgYmFzZSBidWZmZXIuICAqLwogICBpbnQgd2luZG93X2Nv dW50OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAq LworCiAgIC8qIEEgbm9uLXplcm8gdmFsdWUgaW4gc2xvdCBJRFggbWVhbnMgdGhhdCBwZXItYnVm ZmVyIHZhcmlhYmxlCiAgICAgIHdpdGggaW5kZXggSURYIGhhcyBhIGxvY2FsIHZhbHVlIGluIHRo aXMgYnVmZmVyLiAgVGhlIGluZGV4IElEWAogICAgICBmb3IgYSBidWZmZXItbG9jYWwgdmFyaWFi bGUgaXMgc3RvcmVkIGluIHRoYXQgdmFyaWFibGUncyBzbG90CiAgICAgIGluIGJ1ZmZlcl9sb2Nh bF9mbGFncyBhcyBhIExpc3AgaW50ZWdlci4gIElmIHRoZSBpbmRleCBpcyAtMSwKICAgICAgdGhp cyBtZWFucyB0aGUgdmFyaWFibGUgaXMgYWx3YXlzIGxvY2FsIGluIGFsbCBidWZmZXJzLiAgKi8K LSNkZWZpbmUgTUFYX1BFUl9CVUZGRVJfVkFSUyA1MAorI2RlZmluZSBNQVhfUEVSX0JVRkZFUl9W QVJTIDYwCiAgIGNoYXIgbG9jYWxfZmxhZ3NbTUFYX1BFUl9CVUZGRVJfVkFSU107CiAKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgLyogU2V0IHRvIHRoZSBtb2R0aW1lIG9mIHRoZSB2 aXNpdGVkIGZpbGUgd2hlbiByZWFkIG9yIHdyaXR0ZW4uCiAgICAgIG1vZHRpbWUudHZfbnNlYyA9 PSBOT05FWElTVEVOVF9NT0RUSU1FX05TRUNTIG1lYW5zCiAgICAgIHZpc2l0ZWQgZmlsZSB3YXMg bm9uZXhpc3RlbnQuICBtb2R0aW1lLnR2X25zZWMgPT0KQEAgLTkwMyw2ICs5NDQsNjkgQEAgWEJV RkZFUiAoTGlzcF9PYmplY3QgYSkKIC8qIE1vc3QgY29kZSBzaG91bGQgdXNlIHRoZXNlIGZ1bmN0 aW9ucyB0byBzZXQgTGlzcCBmaWVsZHMgaW4gc3RydWN0CiAgICBidWZmZXIuICAoU29tZSBzZXR0 ZXJzIHRoYXQgYXJlIHByaXZhdGUgdG8gYSBzaW5nbGUgLmMgZmlsZSBhcmUKICAgIGRlZmluZWQg YXMgc3RhdGljIGluIHRob3NlIGZpbGVzLikgICovCisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK0lOTElORSB2b2lkCitic2V0X2Js dl9tY19yZWFsX2Zha2VfY3Vyc29yIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwp Cit7CisgIGItPm1jX3JlYWxfZmFrZV9jdXJzb3JfID0gdmFsOworfQorCitJTkxJTkUgdm9pZAor YnNldF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lciAqYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBi LT5mY19pbmFjdGl2ZV93aW5kb3dzXyA9IHZhbDsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNP UlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIElOTElORSB2b2lkCiBic2V0X2Jp ZGlfcGFyYWdyYXBoX2RpcmVjdGlvbiAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFs KQogewpkaWZmIC0tZ2l0IGEvc3JjL2Rpc3BleHRlcm4uaCBiL3NyYy9kaXNwZXh0ZXJuLmgKaW5k ZXggMWE1MzY1Ni4uYjg2OWRmOSAxMDA2NDQKLS0tIGEvc3JjL2Rpc3BleHRlcm4uaAorKysgYi9z cmMvZGlzcGV4dGVybi5oCkBAIC0xMDAsNiArMTAwLDEyNiBAQCB0eXBlZGVmIGludCBDdXJzb3I7 CiAjZGVmaW5lIE5hdGl2ZVJlY3RhbmdsZSBpbnQKICNlbmRpZgogCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCitzdHJ1Y3QgZ2x5cGg7 CisKK3N0cnVjdCBnbHlwaF9yb3c7CisKK3N0cnVjdCBnbHlwaF9tYXRyaXg7CisKK2VudW0gZHJh d19nbHlwaHNfZmFjZTsKKworZW51bSBnbHlwaF9yb3dfYXJlYTsKKworc3RydWN0IG1jX21hdHJp eDsKKworZW51bSBtY19jYWNoZV90eXBlOworCitlbnVtIG1jX2N1cnNvcl90eXBlOworCitlbnVt IG1jX2ZsYXZvcjsKKworc3RydWN0IG1jX1JHQjsKKworc3RydWN0IG1jX2Vzc2VudGlhbHM7CisK K2VudW0gbWNfZHJhd19yb3dfdHlwZTsKKworZW51bSBtY19lbmdpbmVfdHlwZTsKKworZW51bSBt Y19yb3dfcG9zaXRpb247CisKK2VudW0gbWNfcmVkcmF3X3Jvd190eXBlOworCitleHRlcm4gTGlz cF9PYmplY3QgbWNfbGlzdG4gKHB0cmRpZmZfdCwgTGlzcF9PYmplY3QsIC4uLik7CisKK2V4dGVy biBMaXNwX09iamVjdCBtY19udGggKGludCwgTGlzcF9PYmplY3QpOworCitleHRlcm4gTGlzcF9P YmplY3QgbWNfYXNzcSAoTGlzcF9PYmplY3QsIExpc3BfT2JqZWN0KTsKKworZXh0ZXJuIGVudW0g bWNfcm93X3Bvc2l0aW9uIG1jX3Jvd19wb3NpdGlvbiAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3Qg Z2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBzdHJ1Y3QgZ2x5cGhfcm93ICosIGludCk7CisKK2V4dGVybiBwdHJkaWZmX3QgbWNfcmVnaW9u X2xpbWl0IChib29sKTsKKworZXh0ZXJuIHN0cnVjdCBnbHlwaCAqIG1jX2dldF9jdXJzb3JfZ2x5 cGggKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKiwgaW50LCBp bnQpOworCitleHRlcm4gdm9pZCBtY194d19jb2xvcl92YWx1ZXMgKHN0cnVjdCB3aW5kb3cgKiwg TGlzcF9PYmplY3QsIHN0cnVjdCBtY19SR0IgKik7CisKK2V4dGVybiBib29sIG1jX3VwZGF0ZV93 aW5kb3dfZnJpbmdlcyAoc3RydWN0IHdpbmRvdyAqLCBib29sKTsKKworZXh0ZXJuIGNoYXIgKiBt Y193aW5kb3cgKHN0cnVjdCB3aW5kb3cgKik7CisKK2V4dGVybiBjaGFyICogbWNfY2hhcl90b19z dHJpbmcgKGludCk7CisKK2V4dGVybiBjaGFyICogbWNfY3Vyc29yX3R5cGVfdG9fc3RyaW5nIChl bnVtIG1jX2N1cnNvcl90eXBlKTsKKworZXh0ZXJuIGNoYXIgKiBtY19mbGF2b3JfdG9fc3RyaW5n IChlbnVtIG1jX2ZsYXZvcik7CisKK2V4dGVybiBjaGFyICogbWNfY2FjaGVfdHlwZV90b19zdHJp bmcgKGVudW0gbWNfY2FjaGVfdHlwZSk7CisKK2V4dGVybiBjaGFyICogbWNfcmVkcmF3X3Jvd190 eXBlX3RvX3N0cmluZyAoZW51bSBtY19yZWRyYXdfcm93X3R5cGUpOworCitleHRlcm4gdm9pZCBt Y19jYWNoZV9pbnNwZWN0b3IgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IG1jX21hdHJpeCk7CisK K2V4dGVybiBib29sIG1jX3RyYXZlcnNlX2NhY2hlX3AgKHN0cnVjdCBtY19tYXRyaXgsIGVudW0g bWNfY2FjaGVfdHlwZSwgaW50LCBpbnQpOworCitleHRlcm4gdm9pZCBtY19kcmF3X2ZyaW5nZV9i aXRtYXAgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX3JvdyAqLCBpbnQsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUpOworCitleHRl cm4gaW50IG1jX2dldF9mcmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICosIExpc3BfT2JqZWN0 LCBpbnQsIGludCk7CisKK2V4dGVybiB2b2lkIG1jX2VuZ2luZSAoc3RydWN0IHdpbmRvdyAqLCBz dHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAg ICAgICAgICAgc3RydWN0IGdseXBoICosIGludCwgaW50LCBpbnQsIGludCwgaW50LCBpbnQsCisg ICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCwgc3RydWN0IGds eXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfZXNzZW50aWFs cywgZW51bSBtY19yb3dfcG9zaXRpb24sIHN0cnVjdCBtY19SR0IsCisgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gbWNfZW5naW5lX3R5cGUsIGJvb2wsIGVudW0gbWNfZHJhd19yb3dfdHlwZSwK KyAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jYWNoZV90eXBlKTsKKworZXh0ZXJuIHZv aWQgbWNfc2V0X2Vzc2VudGlhbHMgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IG1jX2Vzc2VudGlh bHMgKik7CisKK2V4dGVybiB2b2lkIG1jX2RyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVj dCBnbHlwaF9tYXRyaXggKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAg ICAgICAgIHN0cnVjdCBnbHlwaCAqLCBpbnQsIGludCwgaW50LCBpbnQsIHN0cnVjdCBnbHlwaF9t YXRyaXggKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfZXNzZW50aWFscywg ZW51bSBtY19yb3dfcG9zaXRpb24sIGJvb2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgZW51 bSBtY19kcmF3X3Jvd190eXBlKTsKKworZXh0ZXJuIGJvb2wgbWNfcmVkcmF3X3JvdyAoc3RydWN0 IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gZ2x5cGhfcm93X2FyZWEsIGludCwgaW50LCBp bnQsIGJvb2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2Zh Y2UsIGVudW0gbWNfcmVkcmF3X3Jvd190eXBlKTsKKworZXh0ZXJuIHZvaWQgbWNfcmVzZXRfY2Fj aGUgKHN0cnVjdCB3aW5kb3cgKik7CisKK2V4dGVybiB2b2lkIG1jX2RyYXdfY3Vyc29yX2dseXBo IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICosIGVudW0gZHJhd19nbHlwaHNf ZmFjZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGludCwgaW50LCBz dHJ1Y3QgbWNfUkdCLCBlbnVtIG1jX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlLCBpbnQsIGJvb2wsIGJvb2wpOworCitleHRlcm4g dm9pZCBtY19lcmFzZV9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJp eCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlu dCwgaW50LCBpbnQsIGludCwgZW51bSBtY19mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCk7CisKK2V4dGVybiB2b2lkIG1jX2RyYXdf ZXJhc2VfaHlicmlkIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwgc3Ry dWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCwg aW50LCBpbnQsIGludCwgaW50LCBpbnQsIGludCwgaW50LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCwgc3RydWN0IG1jX1JHQiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sLCBlbnVtIG1jX2ZsYXZvciwgYm9v bCk7CisKK2V4dGVybiB2b2lkIG1jX3hfd3JpdGVfZ2x5cGhzIChzdHJ1Y3Qgd2luZG93ICosIHN0 cnVjdCBnbHlwaF9tYXRyaXggKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqLCBlbnVtIGdseXBoX3Jvd19hcmVhLCBpbnQs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIHN0cnVjdCBtY19SR0Is IGVudW0gbWNfZmxhdm9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNf Y3Vyc29yX3R5cGUsIGludCwgYm9vbCwgYm9vbCwgYm9vbCk7CisKK2V4dGVybiBzdHJ1Y3QgZ2x5 cGhfbWF0cml4ICogbWNfc2F2ZV9nbHlwaF9tYXRyaXggKHN0cnVjdCBnbHlwaF9tYXRyaXggKik7 CisKK2V4dGVybiB2b2lkIG1jX3Jlc3RvcmVfZ2x5cGhfbWF0cml4IChzdHJ1Y3QgZ2x5cGhfbWF0 cml4ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKik7CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JT ICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBUZXh0IGN1cnNvciB0eXBlcy4g ICovCiAKIGVudW0gdGV4dF9jdXJzb3Jfa2luZHMKQEAgLTM4Miw2ICs1MDIsMTggQEAgc3RydWN0 IGdseXBoX3NsaWNlCiAKIHN0cnVjdCBnbHlwaAogeworCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGludCByZWxhdGl2ZV94LCBocG9zOwor CisgIHB0cmRpZmZfdCBieXRlcG9zOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAg IC8qIFBvc2l0aW9uIGZyb20gd2hpY2ggdGhpcyBnbHlwaCB3YXMgZHJhd24uICBJZiBgb2JqZWN0 JyBiZWxvdyBpcyBhCiAgICAgIExpc3Agc3RyaW5nLCB0aGlzIGlzIGFuIGluZGV4IGludG8gdGhh dCBzdHJpbmcuICBJZiBpdCBpcyBhCiAgICAgIGJ1ZmZlciwgdGhpcyBpcyBhIHBvc2l0aW9uIGlu IHRoYXQgYnVmZmVyLiAgSW4gYWRkaXRpb24sIHNvbWUKQEAgLTEyNDgsNiArMTM4MCwyOCBAQCBl bnVtIGRyYXdfZ2x5cGhzX2ZhY2UKIAogc3RydWN0IGdseXBoX3N0cmluZwogeworCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgYm9vbF9i ZiBsZWZ0X292ZXJ3cml0dGVuX3AgOiAxOworCisgICAgYm9vbF9iZiByaWdodF9vdmVyd3JpdHRl bl9wIDogMTsKKworICAgIGJvb2xfYmYgcmVjdGFuZ2xlX251a2VkX3AgOiAxOworCisgICAgYm9v bF9iZiBiYWNrZ3JvdW5kX251a2VkX3AgOiAxOworCisgICAgZW51bSBkcmF3X2dseXBoX2FjdGlv bgorICAgIHsKKyAgICAgIE1DX0RSQVdfR0xZUEhfU1RSSU5HLAorICAgICAgTUNfRVJBU0VfR0xZ UEhfU1RSSU5HCisgICAgfSBhY3Rpb25fdHlwZTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAvKiBYLW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PTV9ZIChNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJpeCwgaSkpOworICAgICAg aWYgKGJvdHRvbSA8PSB5YikKKyAgICAgICAgKytpOworICAgICAgaWYgKGJvdHRvbSA+PSB5YikK KyAgICAgICAgYnJlYWs7CisgICAgfQorICBsYXN0X25ldyA9IGk7CisgIC8qIFNldCBsYXN0X29s ZCB0byB0aGUgaW5kZXggKyAxIG9mIHRoZSByb3cgdGhhdCByZWFjaGVzIHRoZSBib3R0b20KKyAg ICAgYm91bmRhcnkgaW4gdGhlIGN1cnJlbnQgbWF0cml4LiAgV2UgZG9uJ3QgbG9vayBhdCB0aGUg ZW5hYmxlZAorICAgICBmbGFnIGhlcmUgYmVjYXVzZSB3ZSBwbGFuIHRvIHJldXNlIHBhcnQgb2Yg dGhlIGRpc3BsYXkgZXZlbiBpZgorICAgICBvdGhlciBwYXJ0cyBhcmUgZGlzYWJsZWQuICovCisg IGkgPSBmaXJzdF9vbGQgKyAxOworICB3aGlsZSAoaSA8IGN1cnJlbnRfbWF0cml4LT5ucm93cyAt IDEpCisgICAgeworICAgICAgaW50IGJvdHRvbSA9IE1BVFJJWF9ST1dfQk9UVE9NX1kgKE1BVFJJ WF9ST1cgKGN1cnJlbnRfbWF0cml4LCBpKSk7CisgICAgICBpZiAoYm90dG9tIDw9IHliKQorICAg ICAgICArK2k7CisgICAgICBpZiAoYm90dG9tID49IHliKQorICAgICAgICBicmVhazsKKyAgICB9 CisgIGxhc3Rfb2xkID0gaTsKKyAgLyogU2tpcCBvdmVyIHJvd3MgZXF1YWwgYXQgdGhlIGJvdHRv bS4gKi8KKyAgaSA9IGxhc3RfbmV3OworICBqID0gbGFzdF9vbGQ7CisgIHdoaWxlIChpIC0gMSA+ IGZpcnN0X25ldworICAgICAgICAgJiYgaiAtIDEgPiBmaXJzdF9vbGQKKyAgICAgICAgICYmIE1B VFJJWF9ST1dfRU5BQkxFRF9QIChjdXJyZW50X21hdHJpeCwgaiAtIDEpCisgICAgICAgIC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MTMsIHRoZW4gbmV4dF9hbG1vc3RfcHJpbWVf aW5jcmVtZW50X21heCB3b3VsZCBiZSAxNCwgZS5nLiwKKyAgICAgYmVjYXVzZSBuZXh0X2FsbW9z dF9wcmltZSAoMTEzKSB3b3VsZCBiZSAxMjcuICovCisgIHsKKyAgICB2ZXJpZnkgKE5FWFRfQUxN T1NUX1BSSU1FX0xJTUlUID09IDExKTsKKyAgICBlbnVtIHsgbmV4dF9hbG1vc3RfcHJpbWVfaW5j cmVtZW50X21heCA9IDEwIH07CisgICAgcHRyZGlmZl90IHJvd190YWJsZV9tYXggPQorICAgICAg KG1pbiAoUFRSRElGRl9NQVgsIFNJWkVfTUFYKSAvICgzICogc2l6ZW9mICptY19yb3dfdGFibGUp CisgICAgICAgLSBuZXh0X2FsbW9zdF9wcmltZV9pbmNyZW1lbnRfbWF4KTsKKyAgICBwdHJkaWZm X3QgY3VycmVudF9ucm93c19tYXggPSByb3dfdGFibGVfbWF4IC0gZGVzaXJlZF9tYXRyaXgtPm5y b3dzOworICAgIGlmIChjdXJyZW50X25yb3dzX21heCA8IGN1cnJlbnRfbWF0cml4LT5ucm93cykK KyAgICAgIG1lbW9yeV9mdWxsIChTSVpFX01BWCk7CisgIH0KKyAgLyogUmVhbGxvY2F0ZSB2ZWN0 b3JzLCB0YWJsZXMgZXRjLiBpZiBuZWNlc3NhcnkuICovCisgIGlmIChjdXJyZW50X21hdHJpeC0+ bnJvd3MgPiBtY19vbGRfbGluZXNfc2l6ZSkKKyAgICBtY19vbGRfbGluZXMgPSB4cGFsbG9jICht Y19vbGRfbGluZXMsICZtY19vbGRfbGluZXNfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICBjdXJyZW50X21hdHJpeC0+bnJvd3MgLSBtY19vbGRfbGluZXNfc2l6ZSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICBJTlRfTUFYLCBzaXplb2YgKm1jX29sZF9saW5lcyk7CisgIGlmIChkZXNp cmVkX21hdHJpeC0+bnJvd3MgPiBtY19uZXdfbGluZXNfc2l6ZSkKKyAgICBtY19uZXdfbGluZXMg PSB4cGFsbG9jIChtY19uZXdfbGluZXMsICZtY19uZXdfbGluZXNfc2l6ZSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICBkZXNpcmVkX21hdHJpeC0+bnJvd3MgLSBtY19uZXdfbGluZXNfc2l6ZSwK KyAgICAgICAgICAgICAgICAgICAgICAgICBJTlRfTUFYLCBzaXplb2YgKm1jX25ld19saW5lcyk7 CisgIG4gPSBkZXNpcmVkX21hdHJpeC0+bnJvd3M7CisgIG4gKz0gY3VycmVudF9tYXRyaXgtPm5y b3dzOworICBpZiAobWNfcm93X3RhYmxlX3NpemUgPCAzICogbikKKyAgICB7CisgICAgICBwdHJk aWZmX3Qgc2l6ZSA9IG5leHRfYWxtb3N0X3ByaW1lICgzICogbik7CisgICAgICBtY19yb3dfdGFi bGUgPSB4bnJlYWxsb2MgKG1jX3Jvd190YWJsZSwgc2l6ZSwgc2l6ZW9mICptY19yb3dfdGFibGUp OworICAgICAgbWNfcm93X3RhYmxlX3NpemUgPSBzaXplOworICAgICAgbWVtc2V0IChtY19yb3df dGFibGUsIDAsIHNpemUgKiBzaXplb2YgKm1jX3Jvd190YWJsZSk7CisgICAgfQorICBpZiAobiA+ IG1jX3Jvd19lbnRyeV9wb29sX3NpemUpCisgICAgbWNfcm93X2VudHJ5X3Bvb2wgPSB4cGFsbG9j IChtY19yb3dfZW50cnlfcG9vbCwgJm1jX3Jvd19lbnRyeV9wb29sX3NpemUsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBuIC0gbWNfcm93X2VudHJ5X3Bvb2xfc2l6ZSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC0xLCBzaXplb2YgKm1jX3Jvd19lbnRyeV9wb29sKTsKKyAg aWYgKGRlc2lyZWRfbWF0cml4LT5ucm93cyA+IG1jX3J1bnNfc2l6ZSkKKyAgICB7CisgICAgICBt Y19ydW5zID0geG5y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yeSAoTUFUUklYX1JP VyAoZGVzaXJlZF9tYXRyaXgsIGkpKTsKKyAgICAgICsrZW50cnktPm5ld191c2VzOworICAgICAg ZW50cnktPm5ld19saW5lX251bWJlciA9IGk7CisgICAgICBtY19uZXdfbGluZXNbaV0gPSBlbnRy eTsKKyAgICB9CisgIC8qIElkZW50aWZ5IG1vdmVzIGJhc2VkIG9uIGxpbmVzIHRoYXQgYXJlIHVu aXF1ZSBhbmQgZXF1YWwKKyAgICAgaW4gYm90aCBtYXRyaWNlcy4gKi8KKyAgZm9yIChpID0gZmly c3Rfb2xkOyBpIDwgbGFzdF9vbGQ7KQorICAgIGlmIChtY19vbGRfbGluZXNbaV0KKyAgICAgICAg JiYgbWNfb2xkX2xpbmVzW2ldLT5vbGRfdXNlcyA9PSAxCisgICAgICAgICYmIG1jX29sZF9saW5l c1tpXS0+bmV3X3VzZXMgPT0gMSkKKyAgICAgIHsKKyAgICAgICAgaW50IHAsIHE7CisgICAgICAg IGludCBuZXdfbGluZSA9IG1jX29sZF9saW5lc1tpXS0+bmV3X2xpbmVfbnVtYmVyOworICAgICAg ICBzdHJ1Y3QgcnVuICpydW4gPSBtY19ydW5fcG9vbCArIHJ1bl9pZHgrKzsKKyAgICAgICAgLyog UmVjb3JkIG1vdmUuICovCisgICAgICAgIHJ1bi0+Y3VycmVudF92cG9zID0gaTsKKyAgICAgICAg cnVuLT5jdXJyZW50X3kgPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSktPnk7CisgICAg ICAgIHJ1bi0+ZGVzaXJlZF92cG9zID0gbmV3X2xpbmU7CisgICAgICAgIHJ1bi0+ZGVzaXJlZF95 ID0gTUFUUklYX1JPVyAoZGVzaXJlZF9tYXRyaXgsIG5ld19saW5lKS0+eTsKKyAgICAgICAgcnVu LT5ucm93cyA9IDE7CisgICAgICAgIHJ1bi0+aGVpZ2h0ID0gTUFUUklYX1JPVyAoY3VycmVudF9t YXRyaXgsIGkpLT5oZWlnaHQ7CisgICAgICAgIC8qIEV4dGVuZCBiYWNrd2FyZC4gKi8KKyAgICAg ICAgcCA9IGkgLSAxOworICAgICAgICBxID0gbmV3X2xpbmUgLSAxOworICAgICAgICB3aGlsZSAo cCA+IGZpcnN0X29sZAorICAgICAgICAgICAgICAgJiYgcSA+IGZpcnN0X25ldworICAgICAgICAg ICAgICAgJiYgbWNfb2xkX2xpbmVzW3BdID09IG1jX25ld19saW5lc1txXSkKKyAgICAgICAgICB7 CisgICAgICAgICAgICBpbnQgaCA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBwKS0+aGVp Z2h0OworICAgICAgICAgICAgLS1ydW4tPmN1cnJlbnRfdnBvczsKKyAgICAgICAgICAgIC0tcnVu LT5kZXNpcmVkX3Zwb3M7CisgICAgICAgICAgICArK3J1bi0+bnJvd3M7CisgICAgICAgICAgICBy dW4tPmhlaWdodCArPSBoOworICAgICAgICAgICAgcnVuLT5kZXNpcmVkX3kgLT0gaDsKKyAgICAg ICAgICAgIHJ1bi0+Y3VycmVudF95IC09IGg7CisgICAgICAgICAgICAtLXAsIC0tcTsKKyAgICAg ICAgICB9CisgICAgICAgIC8qIEV4dGVuZCBmb3J3YXJkLiAqLworICAgICAgICBwID0gaSArIDE7 CisgICAgICAgIHEgPSBuZXdfbGluZSArIDE7CisgICAgICAgIHdoaWxlIChwIDwgbGFzdF9vbGQK KyAgICAgICAgICAgICAgICYmIHEgPCBsYXN0X25ldworICAgICAgICAgICAgICAgJiYgbWNfb2xk X2xpbmVzW3BdID09IG1jX25ld19saW5lc1txXSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBp bnQgaCA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBwKS0+aGVpZ2h0OworICAgICAgICAg ICAgKytydW4tPm5yb3dzOworICAgICAgICAgICAgcnVuLT5oZWlnaHQgKz0gaDsKKyAgICAgICAg ICAgICsrcCwgKytxOworICAgICAgICAgIH0KKyAgICAgICAgLyogSW5zZXJ0IHJ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S0tLS0tLS0rCisgICAgICAgICAgfCAgICAgQSAgICAg fCAgICAgICB8ICAgICBCICAgICB8CisgICAgICAgICAgKy0tLS0tLS0tLS0tKyAgLS0+ICArLS0t LS0tLS0tLS0rCisgICAgICAgICAgfCAgICAgQiAgICAgfCAgICAgICB8ICAgICBBICAgICB8Cisg ICAgICAgICAgKy0tLS0tLS0tLS0tKyAgICAgICArLS0tLS0tLS0tLS0rCisgICAgIEluc3RlYWQs IHByZWZlciBiaWdnZXIgbW92ZXMsIGFuZCBpbnZhbGlkYXRlIG1vdmVzIHRoYXQgd291bGQKKyAg ICAgY29weSBmcm9tIHdoZXJlIHdlIGNvcGllZCB0by4gKi8KKyAgZm9yIChpID0gMDsgaSA8IG5y dW5zOyArK2kpCisgICAgaWYgKG1jX3J1bnNbaV0tPm5yb3dzID4gMCkKKyAgICAgIHsKKyAgICAg ICAgc3RydWN0IHJ1biAqciA9IG1jX3J1bnNbaV07CisgICAgICAgIGlmIChyLT5jdXJyZW50X3kg IT0gci0+ZGVzaXJlZF95KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8vICBmcHJpbnRmIChz dGRlcnIsICIlczogIHItPmN1cnJlbnQvZGVzaXJlZF92cG9zICglZC8lZCkgfCByLT5jdXJyZW50 L2Rlc2lyZWRfeSAoJWQvJWQpXG4iLAorICAgICAgICAgICAgLy8gICAgICAgICAgIHItPmN1cnJl bnRfeSA8IHItPmRlc2lyZWRfeSA/ICLihpMiIDogIuKGkSIsCisgICAgICAgICAgICAvLyAgICAg ICAgICAgci0+Y3VycmVudF92cG9zLCByLT5kZXNpcmVkX3Zwb3MsIHItPmN1cnJlbnRfeSwgci0+ ZGVzaXJlZF95KTsKKyAgICAgICAgICAgIC8vICByaWYtPmNsZWFyX3dpbmRvd19tb3VzZV9mYWNl ICh3KTsKKyAgICAgICAgICAgIC8vICByaWYtPnNjcm9sbF9ydW5faG9vayAodywgcik7CisgICAg ICAgICAgfQorICAgICAgICAvKiBUcnVuY2F0ZSBydW5zIHRoYXQgY29weSB0byB3aGVyZSB3ZSBj b3BpZWQgdG8sIGFuZAorICAgICAgICAgICBpbnZhbGlkYXRlIHJ1bnMgdGhhdCBjb3B5IGZyb20g d2hlcmUgd2UgY29waWVkIHRvLiAqLworICAgICAgICBmb3IgKGogPSBucnVucyAtIDE7IGogPiBp OyAtLWopCisgICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0IHJ1biAqcCA9IG1jX3J1bnNb al07CisgICAgICAgICAgICBib29sIHRydW5jYXRlZF9wID0gMDsKKyAgICAgICAgICAgIGlmIChw LT5ucm93cyA+IDAKKyAgICAgICAgICAgICAgICAmJiBwLT5kZXNpcmVkX3kgPCByLT5kZXNpcmVk X3kgKyByLT5oZWlnaHQKKyAgICAgICAgICAgICAgICAmJiBwLT5kZXNpcmVkX3kgKyBwLT5oZWln aHQgPiByLT5kZXNpcmVkX3kpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAo cC0+ZGVzaXJlZF95IDwgci0+ZGVzaXJlZF95KQorICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICBwLT5ucm93cyA9IHItPmRlc2lyZWRfdnBvcyAtIHAtPmRlc2lyZWRfdnBv czsKKyAgICAgICAgICAgICAgICAgICAgcC0+aGVpZ2h0ID0gci0+ZGVzaXJlZF95IC0gcC0+ZGVz aXJlZF95OworICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZWRfcCA9IDE7CisgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICBpbnQgbnJvd3NfY29waWVkID0gKHItPmRlc2lyZWRfdnBvcyArIHIt Pm5yb3dzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBwLT5kZXNp cmVkX3Zwb3MpOworICAgICAgICAgICAgICAgICAgICBpZiAocC0+bnJvd3MgPD0gbnJvd3NfY29w aWVkKQorICAgICAgICAgICAgICAgICAgICAgIHAtPm5yb3dzID0gMDsKKyAgICAgICAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgICAgICAgIGludCBoZWlnaHRfY29waWVkID0gKHItPmRlc2lyZWRfeSArIHItPmhlaWdodAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHAtPmRlc2ly ZWRfeSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmN1cnJlbnRfdnBvcyArPSBucm93 c19jb3BpZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRlc2lyZWRfdnBvcyArPSBu cm93c19jb3BpZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPm5yb3dzIC09IG5yb3dz X2NvcGllZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+Y3VycmVudF95ICs9IGhlaWdo dF9jb3BpZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRlc2lyZWRfeSArPSBoZWln aHRfY29waWVkOworICAgICAgICAgICAgICAgICAgICAgICAgICBwLT5oZWlnaHQgLT0gaGVpZ2h0 X2NvcGllZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ1bmNhdGVkX3AgPSAxOworICAg ICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICB9CisgICAgICAgICAgICBpZiAoci0+Y3VycmVudF95ICE9IHItPmRlc2lyZWRfeQorICAgICAg ICAgICAgICAgIC8qIFRoZSBjb25kaXRpb24gYmVsb3cgaXMgZXF1aXZhbGVudCB0bworICAgICAg ICAgICAgICAgICAgICgocC0+Y3VycmVudF95ID49IHItPmRlc2lyZWRfeQorICAgICAgICAgICAg ICAgICAgICAgJiYgcC0+Y3VycmVudF95IDwgci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0KQorICAg ICAgICAgICAgICAgICAgICB8fCAocC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0ID4gci0+ZGVzaXJl ZF95CisgICAgICAgICAgICAgICAgICAgICAgICAmJiAocC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPD0gci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0 KSkpCisgICAgICAgICAgICAgICAgICAgYmVjYXVzZSB3ZSBoYXZlIDAgPCBwLT5oZWlnaHQgPD0g ci0+aGVpZ2h0LiAqLworICAgICAgICAgICAgICAgICYmIHAtPmN1cnJlbnRfeSA8IHItPmRlc2ly ZWRfeSArIHItPmhlaWdodAorICAgICAgICAgICAgICAgICYmIHAtPmN1cnJlbnRfeSArIHAtPmhl aWdodCA+IHItPmRlc2lyZWRfeSkKKyAgICAgICAgICAgICAgcC0+bnJvd3MgPSAwOworICAgICAg ICAgICAgLyogUmVvcmRlciBydW5zIGJ5IGNvcGllZCBwaXhlbCBsaW5lcyBpZiB0cnVuY2F0ZWQu ICovCisgICAgICAgICAgICBpZiAodHJ1bmNhdGVkX3AgJiYgcC0+bnJvd3MgPiAwKQorICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgaW50IGsgPSBucnVucyAtIDE7CisgICAgICAgICAg ICAgICAgd2hpbGUgKG1jX3J1bnNba10tPm5yb3dzID09IDAgfHwgbWNfcnVuc1trXS0+aGVpZ2h0 IDwgcC0+aGVpZ2h0KQorICAgICAgICAgICAgICAgICAgay0tOworICAgICAgICAgICAgICAgIG1l bW1vdmUgKG1jX3J1bnMgKyBqLCBtY19ydW5zICsgaiArIDEsIChrIC0gaikgKiBzaXplb2YgKCpt Y19ydW5zKSk7CisgICAgICAgICAgICAgICAgbWNfcnVuc1trXSA9IHA7CisgICAgICAgICAgICAg IH0KKyAgICAgICAgICB9CisgICAgICAgIC8qIEFzc2lnbiBtYXRyaXggcm93cy4gKi8KKyAgICAg ICAgZm9yIChqID0gMDsgaiA8IHItPm5yb3dzOyArK2opCisgICAgICAgICAgeworICAgICAgICAg ICAgc3RydWN0IGdseXBoX3JvdyAqZnJvbSwgKnRvOworICAgICAgICAgICAgYm9vbCB0b19vdmVy bGFwcGVkX3A7CisgICAgICAgICAgICB0byA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBy LT5kZXNpcmVkX3Zwb3MgKyBqKTsKKyAgICAgICAgICAgIGZyb20gPSBNQVRSSVhfUk9XIChkZXNp cmVkX21hdHJpeCwgci0+ZGVzaXJlZF92cG9zICsgaik7CisgICAgICAgICAgICB0b19vdmVybGFw cGVkX3AgPSB0by0+b3ZlcmxhcHBlZF9wOworICAgICAgICAgICAgZnJvbS0+cmVkcmF3X2ZyaW5n ZV9iaXRtYXBzX3AgPSBmcm9tLT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3A7CisgICAgICAgICAg ICBhc3NpZ25fcm93ICh0bywgZnJvbSk7CisgICAgICAgICAgICAvKiBUaGUgYWJvdmUgYGFzc2ln bl9yb3cnIGFjdHVhbGx5IGRvZXMgc3dhcCwgc28gaWYgd2UgaGFkCisgICAgICAgICAgICAgICBh biBvdmVybGFwIGluIHRoZSBjb3B5IGRlc3RpbmF0aW9uIG9mIHR3byBydW5zLCB0aGVuCisgICAg ICAgICAgICAgICB0aGUgc2Vjb25kIHJ1biB3b3VsZCBhc3NpZ24gYSBwcmV2aW91c2x5IGRpc2Fi bGVkIGJvZ3VzCisgICAgICAgICAgICAgICByb3cuICBCdXQgdGhhbmtzIHRvIHRoZSB0cnVuY2F0 aW9uIGNvZGUgaW4gdGhlCisgICAgICAgICAgICAgICBwcmVjZWRpbmcgZm9yLWxvb3AsIHdlIG5v IGxvbmdlciBoYXZlIHN1Y2ggYW4gb3ZlcmxhcCwKKyAgICAgICAgICAgICAgIGFuZCB0aHVzIHRo ZSBhc3NpZ25lZCByb3cgc2hvdWxkIGFsd2F5cyBiZSBlbmFibGVkLiAqLworICAgICAgICAgICAg ZWFzc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JldHdlZW4gZGVzaXJlZC9jdXJyZW50IHJvdyBtYXRyaWNl cyBoYXZlIG5vdCB5ZXQgYmVlbiBzd2FwcGVkIGJ5CisgIGBtYWtlX2N1cnJlbnQnIGluIGB1cGRh dGVfd2luZG93X2xpbmUnLCBvciBiZWNhdXNlIHRoZSBwcmV2aW91cyByb3cgd291bGQgYmUKKyAg dGhlIHNhbWUgaW4gYm90aCBtYXRyaWNlcyBpZiB3ZSBqdW1wZWQgdG8gYHNldF9jdXJzb3I6YCB3 aXRoaW4gYHVwZGF0ZV93aW5kb3cnCisgIGFuZCBgbWNfdXBkYXRlX3dpbmRvd19kcnlydW4nLiAq LworICBpbnQgcHJldl9tYXRyaXhfcm93X3N0YXJ0X2J5dGVwb3MgPSAodnBvcyAhPSAwKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1dfU1RBUlRfQllU RVBPUyAoY3VycmVudF9yb3cgLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IC0xOworICBpbnQgcHJldl9tYXRyaXhfcm93X2VuZF9ieXRlcG9zID0gKHZwb3MgIT0g MCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19FTkRf QllURVBPUyAoY3VycmVudF9yb3cgLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAtMTsKKyAgaW50IG1hdHJpeF9yb3dfc3RhcnRfYnl0ZXBvcyA9IE1BVFJJWF9ST1df U1RBUlRfQllURVBPUyAoZGVzaXJlZF9yb3cpOworICBpbnQgbWF0cml4X3Jvd19lbmRfYnl0ZXBv cyA9IE1BVFJJWF9ST1dfRU5EX0JZVEVQT1MgKGRlc2lyZWRfcm93KTsKKyAgLyogVGhlIGZpcnN0 IGNvbmRpdGlvbiB0ZXN0cyBmb3IgYSBzb2xpdGFyeSByb3cgY29udGFpbmluZyBaViwgcHJlY2Vk ZWQgYnkgYQorICByb3cgY29udGFpbmluZyBhIHBlbnVsdGltYXRlIGdseXBoIHdpdGggYSBjaGFy cG9zIG9mIFpWIC0gMSBmb2xsb3dlZCBieSBhbiBlbmQKKyAgb2Ygcm93IHNwYWNlIGdseXBoIHdp dGggYSBjaGFycG9zIG9mIDAuICBUaGUgb3RoZXIgY29uZGl0aW9ucyB0ZXN0IGZvciBhbiBlbXB0 eQorICBidWZmZXIgKG5vdCBuYXJyb3dlZCksIG9yIGFuIGVtcHR5IG5hcnJvd2VkIGJ1ZmZlci4g Ki8KKyAgYm9vbCByb3dfYXRfenZfcCA9ICgodnBvcyAhPSAwCisgICAgICAgICAgICAgICAgICAg ICAgICYmIChjdXJyZW50X3JvdyAtIDEpLT51c2VkW1RFWFRfQVJFQV0gPiAwCisgICAgICAgICAg ICAgICAgICAgICAgICYmIHByZXZfbWF0cml4X3Jvd19zdGFydF9ieXRlcG9zICE9IHByZXZfbWF0 cml4X3Jvd19lbmRfYnl0ZXBvcworICAgICAgICAgICAgICAgICAgICAgICAmJiAhKGN1cnJlbnRf cm93IC0gMSktPmVuZHNfYXRfenZfcAorICAgICAgICAgICAgICAgICAgICAgICAmJiBtYXRyaXhf cm93X3N0YXJ0X2J5dGVwb3MgPT0gbWF0cml4X3Jvd19lbmRfYnl0ZXBvcworICAgICAgICAgICAg ICAgICAgICAgICAmJiBkZXNpcmVkX3Jvdy0+ZW5kc19hdF96dl9wKQorICAgICAgICAgICAgICAg ICAgICAgIHx8ICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA9PSAxKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgfHwgKGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwICYmIHZwb3Mg PT0gMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGJ1ZmZlcl9uYXJyb3dlZF9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGJvYl9yZXNwZWN0X25hcnJvdyA9PSBlb2Jf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vb2wgY3Vyc29yX2djX3AgPSBmYWxzZTsKKyAgc3Ry dWN0IGdseXBoX21hdHJpeCAqZGVzaXJlZF9tYXRyaXggPSB3LT5kZXNpcmVkX21hdHJpeDsKKyAg c3RydWN0IGdseXBoX3JvdyAqYm90dG9tX3JvdyA9IE1BVFJJWF9CT1RUT01fVEVYVF9ST1cgKGRl c2lyZWRfbWF0cml4LCB3KTsKKyAgaW50IGJvdHRvbV92cG9zID0gTUFUUklYX1JPV19WUE9TIChi b3R0b21fcm93LCBkZXNpcmVkX21hdHJpeCk7CisgIGlmIChkZWJ1Z19wCisgICAgICAmJiB2cG9z ICE9IGJvdHRvbV92cG9zKQorICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX3VwZGF0ZV90ZXh0X2Fy ZWEgKCVzKTogIGN1cnJlbnQvYm90dG9tX3Zwb3MgKCVkLyVkKVxuIiwKKyAgICAgICAgICAgICAg ICAgICAgICBtY193aW5kb3cgKHcpLCB2cG9zLCBib3R0b21fdnBvcyk7CisgIC8qIEluYXNtdWNo IGFzIHdlIHByb2Nlc3MgdGhlIGN1cnNvciByb3cgYmVmb3JlIGFsbCBvdGhlciByb3dzLCB3ZSBj YW4gcmVseQorICB1cG9uIHRoZSBwcmV2aW91cyBgZGVzaXJlZF9yb3dgIHRvIGJlIGFjY3VyYXRl LiAqLworICBlbnVtIG1jX3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24gPSAgbWNfcm93X3Bvc2l0 aW9uICh3LCB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZGVzaXJlZF9yb3cKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBjdXJy ZW50X3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgZGVzaXJlZF9yb3csIH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aCBvdmVybGFwcyB0aGUgZ2x5cGggdG8gaXRz IHJpZ2h0LiAgRm9yCisgICAgICAgZXhhbXBsZSwgY29uc2lkZXIgYSBjdXJyZW50IHJvdyBvZiBg aWYgJyB3aXRoIHRoZSBgZicgaW4KKyAgICAgICBDb3VyaWVyIGJvbGQgc28gdGhhdCBpdCBvdmVy bGFwcyB0aGUgYCAnIHRvIGl0cyByaWdodC4KKyAgICAgICBJZiB0aGUgZGVzaXJlZCByb3cgaXMg YCAnLCB3ZSB3b3VsZCBza2lwIG92ZXIgdGhlIHNwYWNlCisgICAgICAgYWZ0ZXIgdGhlIGBpZicg YW5kIHRoZXJlIHdvdWxkIHJlbWFpbiBhIHBpeGVsIGZyb20gdGhlCisgICAgICAgYGYnIG9uIHRo ZSBzY3JlZW4uICovCisgICAgaWYgKG92ZXJsYXBwaW5nX2dseXBoc19wICYmIGkgPiAwKQorICAg ICAgeworICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gJmN1cnJlbnRfcm93LT5nbHlwaHNb VEVYVF9BUkVBXVtpIC0gMV07CisgICAgICAgIGludCBsZWZ0LCByaWdodDsKKyAgICAgICAgcmlm LT5nZXRfZ2x5cGhfb3ZlcmhhbmdzIChnbHlwaCwgWEZSQU1FICh3LT5mcmFtZSksICZsZWZ0LCAm cmlnaHQpOworICAgICAgICBjYW5fc2tpcF9wID0gKHJpZ2h0ID09IDAgJiYgIWFib3J0X3NraXBw aW5nKTsKKyAgICAgIH0KKworICAgIGlmIChjYW5fc2tpcF9wKQorICAgICAgeworICAgICAgICBp bnQgc3RhcnRfaHBvcyA9IGk7CisKKyAgICAgICAgd2hpbGUgKGkgPCBzdG9wCisgICAgICAgICAg ICAgICAmJiBHTFlQSF9FUVVBTF9QIChkZXNpcmVkX2dseXBoLCBjdXJyZW50X2dseXBoKSkKKyAg ICAgICAgICB7CisgICAgICAgICAgICArK2FycmF5X2dseXBoc19za2lwcGVkLnVzZWQ7CisgICAg ICAgICAgICBpZiAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkIDwgYXJyYXlfZ2x5cGhz X3NraXBwZWQudXNlZCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGludCBvbGRf YWxsb2MgPSBhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQ7CisgICAgICAgICAgICAgICAg aW50IG5ld19lbHRzID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCAtIGFycmF5X2dseXBoc19z a2lwcGVkLmFsbG9jYXRlZDsKKyAgICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5z a2lwcGVkID0KKyAgICAgICAgICAgICAgICAgIHhwYWxsb2MgKGFycmF5X2dseXBoc19za2lwcGVk LnNraXBwZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmYXJyYXlfZ2x5cGhzX3NraXBw ZWQuYWxsb2NhdGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICBJTlRfTUFYLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgc2l6ZW9mICphcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkKTsKKyAgICAgICAgICAgICAg ICBtZW1zZXQgKGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWQgKyBvbGRfYWxsb2MsIDAsCisg ICAgICAgICAgICAgICAgICAgICAgICAgKGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZCAt IG9sZF9hbGxvYykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICogc2l6ZW9mICphcnJheV9n bHlwaHNfc2tpcHBlZC5za2lwcGVkKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgaW50 IG50aCA9IGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQgLSAxOworICAgICAgICAgICAgYXJyYXlf Z2x5cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLnggPSB4OworICAgICAgICAgICAgYXJyYXlfZ2x5 cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLmhwb3MgPSBpOworICAgICAgICAgICAgYXJyYXlfZ2x5 cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLmVuYWJsZWRfcCA9IHRydWU7CisgICAgICAgICAgICB4 ICs9IGRlc2lyZWRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgKytkZXNpcmVkX2ds eXBoLCArK2N1cnJlbnRfZ2x5cGgsICsraTsKKyAgICAgICAgICB9CisKKyAgICAgICAgLyogQ29u c2lkZXIgdGhlIGNhc2UgdGhhdCB0aGUgY3VycmVudCByb3cgY29udGFpbnMgInh4eAorICAgICBw cHAgZ2dnIiBpbiBpdGFsaWMgQ291cmllciBmb250LCBhbmQgdGhlIGRlc2lyZWQgcm93CisgICAg IGlzICJ4eHggZ2dnIi4gIFRoZSBjaGFyYWN0ZXIgYHAnIGhhcyBsYmVhcmluZywgYGcnCisgICAg IGhhcyBub3QuICBUaGUgbG9vcCBhYm92ZSB3aWxsIHN0b3AgaW4gZnJvbnQgb2YgdGhlCisgICAg IGZpcnN0IGBwJyBpbiB0aGUgY3VycmVudCByb3cuICBJZiB3ZSB3b3VsZCBzdGFydAorICAgICB3 cml0aW5nIGdseXBocyB0aGVyZSwgd2Ugd291bGRuJ3QgZXJhc2UgdGhlIGxiZWFyaW5nCisgICAg IG9mIHRoZSBgcCcuICBUaGUgcmVzdCBvZiB0aGUgbGJlYXJpbmcgcHJvYmxlbSBpcyB0aGVuCisg ICAgIHRha2VuIGNhcmUgb2YgYnkgZHJhd19nbHlwaHMuICovCisgICAgICAgIGlmIChvdmVybGFw cGluZ19nbHlwaHNfcAorICAgICAgICAgICAgJiYgaSA+IDAKKyAgICAgICAgICAgICYmIGkgPCBj dXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAmJiAoY3VycmVudF9yb3ct PnVzZWRbVEVYVF9BUkVBXSAhPSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKSkKKyAgICAg ICAgICB7CisgICAgICAgICAgICBpbnQgbGVmdCwgcmlnaHQ7CisgICAgICAgICAgICByaWYtPmdl dF9nbHlwaF9vdmVyaGFuZ3MgKGN1cnJlbnRfZ2x5cGgsCisgICAgICAgICAgICAgICAgICAgIFhG UkFNRSAody0+ZnJhbWUpLAorICAgICAgICAgICAgICAgICAgICAmbGVmdCwgJnJpZ2h0KTsKKyAg ICAgICAgICAgIHdoaWxlIChsZWZ0ID4gMCAmJiBpID4gMCkKKyAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgIC0taSwgLS1kZXNpcmVkX2dseXBoLCAtLWN1cnJlbnRfZ2x5cGg7CisgICAg ICAgICAgICAgICAgeCAtPSBkZXNpcmVkX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAg ICAgICBsZWZ0IC09IGRlc2lyZWRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAvKiBBYm9ydCB0aGUgc2tpcHBpbmcgYWxnb3JpdGhtIGlmIHdlIGVuZCB1 cCBiZWZvcmUKKyAgICAgICAgICAgICAgIG91ciBzdGFydGluZyBwb2ludCwgdG8gYXZvaWQgbG9v cGluZyAoYnVnIzEwNzApLgorICAgICAgICAgICAgICAgVGhpcyBjYW4gaGFwcGVuIHdoZW4gdGhl IGxiZWFyaW5nIGlzIGxhcmdlciB0aGFuCisgICAgICAgICAgICAgICB0aGUgcGl4ZWwgd2lkdGgu ICovCisgICAgICAgICAgICBhYm9ydF9za2lwcGluZyA9IChpIDwgc3RhcnRfaHBvcyk7CisgICAg ICAgICAgfQorICAgICAgfQorCisgICAgLyogVHJ5IHRvIGF2b2lkIHdyaXRpbmcgdGhlIGVudGly ZSByZXN0IG9mIHRoZSBkZXNpcmVkIHJvdworICAgICAgIGJ5IGxvb2tpbmcgZm9yIGEgcmVzeW5j IHBvaW50LiAgVGhpcyBtYWlubHkgcHJldmVudHMKKyAgICAgICBtb2RlIGxpbmUgZmxpY2tlcmlu ZyBpbiB0aGUgY2FzZSB0aGUgbW9kZSBsaW5lIGlzIGluCisgICAgICAgZml4ZWQtcGl0Y2ggZm9u dCwgd2hpY2ggaXQgdXN1YWxseSB3aWxsIGJlLiAqLworICAgIGlmIChpIDwgZGVzaXJlZF9yb3ct PnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgIHsKKyAgICAgICAgaW50IHN0YXJ0X3ggPSB4LCBzdGFy dF9ocG9zID0gaTsKKyAgICAgICAgc3RydWN0IGdseXBoICpzdGFydCA9IGRlc2lyZWRfZ2x5cGg7 CisgICAgICAgIGludCBjdXJyZW50X3ggPSB4OworICAgICAgICBib29sIHNraXBfZmlyc3RfcCA9 ICFjYW5fc2tpcF9wOworICAgICAgICAvKiBGaW5kIHRoZSBuZXh0IGdseXBoIHRoYXQncyBlcXVh bCBhZ2Fpbi4gKi8KKyAgICAgICAgd2hpbGUgKGkgPCBzdG9wCisgICAgICAgICAgICAgICAmJiAo c2tpcF9maXJzdF9wCisgICAgICAgICAgICAgICAgICAgfHwgIUdMWVBIX0VRVUFMX1AgKGRlc2ly ZWRfZ2x5cGgsIGN1cnJlbnRfZ2x5cGgpKQorICAgICAgICAgICAgICAgJiYgeCA9PSBjdXJyZW50 X3gpCisgICAgICAgICAgeworICAgICAgICAgICAgeCArPSBkZXNpcmVkX2dseXBoLT5waXhlbF93 aWR0aDsKKyAgICAgICAgICAgIGN1cnJlbnRfeCArPSBjdXJyZW50X2dseXBoLT5waXhlbF93aWR0 aDsKKyAgICAgICAgICAgICsrZGVzaXJlZF9nbHlwaCwgKytjdXJyZW50X2dseXBoLCArK2k7Cisg ICAgICAgICAgICBza2lwX2ZpcnN0X3AgPSAwOworICAgICAgICAgIH0KKworICBmb3IgKGludCBl bHQgPSAwOworICAgICAgIGVsdCA8IGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQKKyAgICAgICAm JiB2cG9zICE9IGJvdHRvbV92cG9zOworICAgICAgICsrZWx0KQorICAgIHsKKyAgICAgIGludCB4 ID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtlbHRdLng7CisgICAgICBpbnQgaHBvcyA9 IGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbZWx0XS5ocG9zOworICAgICAgc3RydWN0IGds eXBoICp0YXJnZXRfZ2x5cGggPQorICAgICAgICBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBkZXNp cmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIGhwb3MsIHZwb3MpOworICAgICAgaWYgKGRlYnVnX3Ap CisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlNLSVBQRUQ6ICB2cG9zICglZCkgfCBjaGFyICgl ZC8lcykgfCB4OiAoJWQpIHwgaHBvcyAoJWQvJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAg ICAgIHZwb3MsIHRhcmdldF9nbHlwaC0+dS5jaCwgbWNfY2hhcl90b19zdHJpbmcgKHRhcmdldF9n bHlwaC0+dS5jaCksCisgICAgICAgICAgICAgICAgICAgICAgICAgeCwgaHBvcywgdXBkYXRlZF9y b3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpOworICAgICAgbWNfZHJhd19yb3cgKHcsIGRlc2lyZWRf bWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCB4LCAxLCB2cG9zLAorICAgICAgICAg ICAgICAgICAgIGJvdHRvbV92cG9zLCBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9z aXRpb24sIGRyYXdfcCwgU0tJUFBFRCk7CisgICAgfQorCisgICAgICAgIGlmIChpID09IHN0YXJ0 X2hwb3MgfHwgeCAhPSBjdXJyZW50X3gpCisgICAgICAgICAgeworICAgICAgICAgICAgaSA9IHN0 YXJ0X2hwb3M7CisgICAgICAgICAgICB4ID0gc3RhcnRfeDsKKyAgICAgICAgICAgIGRlc2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93LT51c2VkW1RFWFRfQVJFQV0gLSAx KTsKKyAgICAgICAgICBtY19kcmF3X3JvdyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93 LCBkZXNpcmVkX3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgICAgICAgICAgICAg IGRlc2lyZWRfcm93LT54LCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdLCB2cG9zLAorICAg ICAgICAgICAgICAgICAgICAgICBib3R0b21fdnBvcywgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFs cywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsIFVOQ0hBTkdFRCk7CisgICAgICAgIH0KKworICAgICAg LyogTWF5YmUgY2xlYXIgdG8gZW5kIG9mIGxpbmUuICovCisgICAgICBpZiAoTUFUUklYX1JPV19F WFRFTkRTX0ZBQ0VfUCAoZGVzaXJlZF9yb3cpKQorICAgICAgICB7CisgICAgICAgICAgLyogSWYg bmV3IHJvdyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRleHQgYXJlYSwgbm90aGluZworICAg ICAgICAgICAgIGhhcyB0byBiZSBjbGVhcmVkLCBpZiBhbmQgb25seSBpZiB3ZSBkaWQgYSB3cml0 ZV9nbHlwaHMKKyAgICAgICAgICAgICBhYm92ZS4gIFRoaXMgaXMgbWFkZSBzdXJlIGJ5IHNldHRp bmcgZGVzaXJlZF9zdG9wX3BvcworICAgICAgICAgICAgIGFwcHJvcHJpYXRlbHkgYWJvdmUuICov CisgICAgICAgICAgZWFzc2VydCAoaSA8IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAg ICAgICAgICAgICAgICAgICB8fCAoKGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gPT0gY3Vy cmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgTUFU UklYX1JPV19FWFRFTkRTX0ZB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HRoKTsKKyAg ICAgICAgICAvKiBJZiBjdXJzb3IgaXMgZGlzcGxheWVkIGF0IHRoZSBlbmQgb2YgdGhlIGxpbmUs IG1ha2Ugc3VyZQorICAgICAgICAgICAgIGl0J3MgY2xlYXJlZC4gIE5vd2FkYXlzIHdlIGRvbid0 IGhhdmUgYSBwaHlzX2N1cnNvcl9nbHlwaAorICAgICAgICAgICAgIHdpdGggd2hpY2ggdG8gZXJh c2UgdGhlIGN1cnNvciAoYmVjYXVzZSB0aGlzIG1ldGhvZAorICAgICAgICAgICAgIGRvZXNuJ3Qg d29yayB3aXRoIGxiZWFyaW5nL3JiZWFyaW5nKSwgc28gd2UgbXVzdCBkbyBpdCB0aGlzIHdheS4g Ki8KKyAgICAgICAgICBpZiAodnBvcyA9PSB3LT5waHlzX2N1cnNvci52cG9zCisgICAgICAgICAg ICAgICYmIChkZXNpcmVkX3Jvdy0+cmV2ZXJzZWRfcAorICAgICAgICAgICAgICAgICAgPyAody0+ cGh5c19jdXJzb3IuaHBvcyA8IDApCisgICAgICAgICAgICAgICAgICA6ICh3LT5waHlzX2N1cnNv ci5ocG9zID49IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pKSkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgdy0+cGh5c19jdXJzb3Jfb25fcCA9IDA7CisgICAgICAgICAgICAgIHhs aW0gPSAtMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAg eGxpbSA9IGN1cnJlbnRfcm93LT5waXhlbF93aWR0aDsKKyAgICAgICAgICBpZiAoZHJhd19wKQor ICAgICAgICAgICAgcmlmLT5jbGVhcl9lbmRfb2ZfbGluZSAodywgdXBkYXRlZF9yb3csIFRFWFRf QVJFQSwgeGxpbSk7CisgICAgICAgICAgY2xlYXJfdG9feCA9IHhsaW07CisgICAgICAgICAgY2hh bmdlZF9wID0gMTsKKyAgICAgICAgfQorCisgIGlmIChjaGFuZ2VkX3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VF9BUkVBXSAtIDE7CisgICAgICBpbnQgeF9saW1pdCA9IChjbGVhcl90b194ID09IC0xKQorICAg ICAgICAgICAgICAgICAgICA/IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICA6 IGNsZWFyX3RvX3g7CisgICAgICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKyAgICAg IENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgICAgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChi dWYpOworICAgICAgYm9vbCBmaWxsX2NvbHVtbl90cnVtcHNfcCA9ICghTklMUCAoQlZBUiAoYiwg Y2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gZXNzZW50aWFs cy5mY194KTsKKworICAgICAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAgICAgICBmcHJpbnRm IChzdGRlcnIsICJtY191cGRhdGVfdGV4dF9hcmVhIChmbG9hdGluZyk6ICB2cG9zICglZCkgfCB4 X2xpbWl0ICglZClcbiIsIHZwb3MsIHhfbGltaXQpOworCisgICAgICBpZiAoQlVGRkVSUCAody0+ Y29udGVudHMpCisgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgJiYgeCA8IHRleHRfYXJlYV93aWR0aAorICAgICAg ICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB4CisgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9 IE5VTEwKKyAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJl ZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwgeCwgeF9saW1p dCwKKyAgICAgICAgICAgICAgICAgICB1cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfQkFS LCAxLCBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLAorICAgICAgICAgICAgICAgICAgIHJvd19w b3NpdGlvbiwgZGVidWdfcCA/IGRlYnVnX2ZnIDogZXNzZW50aWFscy5mY19mZ1tyb3dfcG9zaXRp b25dLAorICAgICAgICAgICAgICAgICAgIEZJTExfQ09MVU1OLCBkcmF3X3AsIE5PV0hFUkUsIE5P X0NBQ0hFKTsKKworICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICYm ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAg ICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2hvcml6b250YWxf cnVsZXIpKQorICAgICAgICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAmJiB2 cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9IE5VTEwK KyAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRy aXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwKKyAg ICAgICAgICAgICAgICAgICB1cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfSEJBUiwgMSwg Y3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywKKyAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRp b24sIGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGVzc2VudGlhbHMuY2hfZmdbcm93X3Bvc2l0aW9uXSwK KyAgICAgICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSLCBkcmF3X3AsIE5PV0hFUkUsIE5P X0NBQ0hFKTsKKworICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICYm ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAg ICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX3ZlcnRpY2FsX3J1 bGVyKSkKKyAgICAgICAgICAmJiAhZmlsbF9jb2x1bW5fdHJ1bXBzX3AKKyAgICAgICAgICAmJiB4 IDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgJiYgdnBvcyAhPSB3LT5jdXJzb3IudnBvcwor ICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHgKKyAgICAgICAgICAmJiB0YXJnZXRfZ2x5cGgg IT0gTlVMTAorICAgICAgICAgICYmIGRyYXdfcCkKKyAgICAgICAgbWNfZW5naW5lICh3LCBkZXNp cmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHRhcmdldF9nbHlwaCwgVEVYVF9BUkVBLCB4LCB4X2xp bWl0LAorICAgICAgICAgICAgICAgICAgIHVwZGF0ZWRfcm93LT55LCBocG9zLCB2cG9zLCBNQ19C QVIsIDEsIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsCisgICAgICAgICAgICAgICAgICAgcm93 X3Bvc2l0aW9uLCBkZWJ1Z19wID8gZGVidWdfZmcgOiBlc3NlbnRpYWxzLmNoX2ZnW3Jvd19wb3Np dGlvbl0sCisgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVIsIGRyYXdfcCwgTk9XSEVS RSwgTk9fQ0FDSEUpOworCisgICAgfQorICAgIH0KKyAgcmV0dXJuIGNoYW5nZWRfcDsKK30KKwor LyogVXBkYXRlIHJvdyBWUE9TIGluIHdpbmRvdyBXLiAgVmFsdWUgaXM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VycmVudF9yb3ctPm92 ZXJsYXlfYXJyb3dfYml0bWFwCisgICAgICAgICAgfHwgY3VycmVudF9yb3ctPnJlZHJhd19mcmlu Z2VfYml0bWFwc19wCisgICAgICAgICAgfHwgZGVzaXJlZF9yb3ctPm1vZGVfbGluZV9wICE9IGN1 cnJlbnRfcm93LT5tb2RlX2xpbmVfcAorICAgICAgICAgIHx8IGRlc2lyZWRfcm93LT5leGFjdF93 aW5kb3dfd2lkdGhfbGluZV9wICE9IGN1cnJlbnRfcm93LT5leGFjdF93aW5kb3dfd2lkdGhfbGlu ZV9wCisgICAgICAgICAgfHwgKE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAoZGVzaXJl ZF9yb3cpCisgICAgICAgICAgICAgICE9IE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAo Y3VycmVudF9yb3cpKSkKKyAgICAgICAgcmlmLT5hZnRlcl91cGRhdGVfd2luZG93X2xpbmVfaG9v ayAodywgZGVzaXJlZF9yb3cpOworICAgIH0KKyAgLyogVXBkYXRlIGN1cnJlbnRfcm93IGZyb20g ZGVzaXJlZF9yb3cuICovCisgIG1ha2VfY3VycmVudCAody0+ZGVzaXJlZF9tYXRyaXgsIHctPmN1 cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAgcmV0dXJuIGNoYW5nZWRfcDsKK30KKwordm9pZAorbWNf dXBkYXRlX3dpbmRvd19lcmFzZSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IG1jX21hdHJpeCBv bGRfbWF0cml4KQoreworICBib29sIGdvX29uZV9wID0gKG9sZF9tYXRyaXguY3Vyc29yc191c2Vk W01DX0NBQ0hFXSA+IDAKKyAgICAgICAgICAgICAgICAgICB8fCBvbGRfbWF0cml4LmN1cnNvcnNf dXNlZFtDSF9DQUNIRV0gPiAwCisgICAgICAgICAgICAgICAgICAgfHwgb2xkX21hdHJpeC5jdXJz b3JzX3VzZWRbRkNfQ0FDSEVdID4gMCk7CisgIGJvb2wgZ29fdHdvX3AgPSAoQlVGRkVSUCAody0+ Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAg ICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29u ZikpKSk7CisgIGJvb2wgdXBkYXRpbmdfZnJhbWVfcCA9IGZhbHNlOworICBzdHJ1Y3QgZnJhbWUg KmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgaWYgKFhGUkFNRSAody0+ZnJhbWUpICE9IGYtPm1j X3VwZGF0aW5nX2ZyYW1lCisgICAgICAmJiAoZ29fb25lX3AgfHwgZ29fdHdvX3ApKQorICAgIHsK KyAgICAgIHVwZGF0aW5nX2ZyYW1lX3AgPSB0cnVlOworICAgICAgdXBkYXRlX2JlZ2luIChmKTsK KyAgICB9CisgIGlmICh3LT5waHlzX2N1cnNvcl9vbl9wCisgICAgICAmJiBnb190d29fcCkKKyAg ICBlcmFzZV9waHlzX2N1cnNvciAodyk7CisgIGZvciAoaW50IHZudGggPSAwOworICAgICAgIGdv X29uZV9wCisgICAgICAgJiYgdm50aCA8IHctPm1jX21hdHJpeC52cG9zX3VzZWQ7CisgICAgICAg Kyt2bnRoKQorICAgIHsKKyAgICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUg PSBNQ19DQUNIRTsKKyAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICAg ICArK2NhY2hlX3R5cGUpCisgICAgICAgIGZvciAoaW50IG50aF8wID0gMDsKKyAgICAgICAgICAg ICBtY190cmF2ZXJzZV9jYWNoZV9wIChvbGRfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGhf MCk7CisgICAgICAgICAgICAgKytudGhfMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29s IHNhbWVfcCA9IGZhbHNlOworICAgICAgICAgICAgZm9yIChpbnQgd19udGggPSAwOyB3X250aCA8 IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV07ICsrd19udGgp CisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzYW1lX3AgfD0gKG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgudHlwZQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVt3X250aF0uZ2x5cGgudHlwZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5ieXRl cG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5ieXRlcG9zCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXzBdLmdseXBoLmNoYXJwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLmNoYXJw b3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgudS52YWwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19u dGhdLmdseXBoLnUudmFsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLmZhY2VfaWQKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bd19udGhdLmdseXBoLmZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5 cGgucGFkZGluZ19wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5wYWRkaW5nX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uZ2x5cGgubGVmdF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3dfbnRoXS5nbHlwaC5sZWZ0X2JveF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgu cmlnaHRfYm94X2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgucmlnaHRfYm94 X2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC52b2Zmc2V0CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS5nbHlwaC52b2Zmc2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnBpeGVs X3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5waXhlbF93aWR0aAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8wXS5nbHlwaC5zbGljZS5pbWcueAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0u Z2x5cGguc2xpY2UuaW1nLngKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGguc2xpY2UuaW1nLnkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnNsaWNlLmltZy55CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXzBdLmdseXBoLnNsaWNlLmltZy53aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5 cGguc2xpY2UuaW1nLndpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnNsaWNlLmltZy5o ZWlnaHQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnNsaWNlLmltZy5oZWlnaHQKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uZ2x5cGguc2xpY2UuY21wLmZyb20KKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b d19udGhdLmdseXBoLnNsaWNlLmNtcC5mcm9tCisgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLngKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bd19udGhdLngKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZngKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bd19udGhdLmZ4CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b d19udGhdLnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZnkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LmZ5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmhwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmhw b3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0udnBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0udnBv cworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS53ZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9 PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ud2QKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uaAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uaAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5jdXJzb3JfdHlwZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uY3Vyc29yX3R5 cGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uY3Vyc29yX3dpZHRoCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS5jdXJzb3Jfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcucmVkCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW3dfbnRoXS5mZy5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcuZ3JlZW4KKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bd19udGhdLmZnLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZnLmJsdWUK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmZnLmJsdWUKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYmcu cmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5iZy5yZWQKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0u YmcuZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmJnLmdyZWVuCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXzBdLmJnLmJsdWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmJnLmJsdWUKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0uYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmFjdGl2ZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoX2ZsYXZvcgorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0u Z2x5cGhfZmxhdm9yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmVuYWJsZWRfcAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVt3X250aF0uZW5hYmxlZF9wKTsKKyAgICAgICAgICAgICAgICAvKiBGb3JjZSB0aGUgZnJp bmdlIGJpdG1hcHMgdG8gYWx3YXlzIGJlIHJlc2V0L3JlZHJhd24uICovCisgICAgICAgICAgICAg ICAgaWYgKG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uY3Vy c29yX3R5cGUKKyAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uY3Vyc29yX3R5cGUKKyAgICAgICAgICAgICAgICAg ICAgJiYgKG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uY3Vy c29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgICAg ICB8fCBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmN1cnNv cl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVApKQorICAgICAgICAgICAgICAgICAgc2Ft ZV9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgaWYgKHNhbWVfcCkKKyAgICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gIGZwcmludGYgKHN0ZGVyciwgIkhJVCAoJXMp OiAgdnBvcyAoJWQpIHwgaHBvcyAoJWQpIHwgY2hhciAoJXMpXG4iLAorICAgICAgICAgICAgICAg ICAgICAvLyAgICAgICAgICAgICAgICAgICAoY2FjaGVfdHlwZSA9PSBNQ19DQUNIRSkKKyAgICAg ICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICA/ICJNQyIKKyAgICAgICAgICAg ICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgOiAoY2FjaGVfdHlwZSA9PSBDSF9DQUNIRSkK KyAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICA/ICJDSCIKKyAgICAg ICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgOiAoY2FjaGVfdHlwZSA9PSBGQ19D QUNIRSkKKyAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICA/ICJGQyIK KyAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgOiAiTk8iLAorICAgICAg ICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0udnBvcywKKyAgICAgICAgICAgICAgICAgICAgLy8g ICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bd19udGhdLmhwb3MsCisgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAg IG1jX2NoYXJfdG9fc3RyaW5nICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVt3X250aF0uZ2x5cGgudS5jaCkpOworICAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uc2FtZV9wID0gdHJ1ZTsKKyAg ICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAg ICAvLyAgZnByaW50ZiAoc3RkZXJyLCAiTUlTUyAoJXMpOiAgdnBvcyAoJWQpIHwgaHBvcyAoJWQg di4gJWQpIHwgY2hhciAoJXMgdi4gJXMpIHwgY2FjaGVfdXNlZCAoJWQgdi4gJWQpXG4iLAorICAg ICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIChjYWNoZV90eXBlID09IE1D X0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgPyAi TUMiCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgOiAoY2FjaGVf dHlwZSA9PSBDSF9DQUNIRSkKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAg ICAgICAgID8gIkNIIgorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAg IDogKGNhY2hlX3R5cGUgPT0gRkNfQ0FDSEUpCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAg ICAgICAgICAgICAgICAgICA/ICJGQyIKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAg ICAgICAgICAgICA6ICJOTyIsCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAg ICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnZw b3MsCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5ocG9zLAorICAgICAgICAgICAg ICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5ocG9zLAorICAgICAgICAgICAgICAgICAgICAgIC8vICAg ICAgICAgICAgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnUuY2gpLAorICAgICAgICAgICAgICAgICAg ICAgIC8vICAgICAgICAgICAgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nICh3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudS5jaCksCisgICAgICAg ICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0sCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAg ICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBl XSk7CisgICAgICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bd19udGhdLnNhbWVfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICghc2FtZV9wKQorICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgLyogYG1hdHJpeF9yb3cnIGluIGBkaXNwbmV3LmNgIGNvbnRh aW5zIHRoZSBmb2xsb3dpbmcgdGVzdHMsCisgICAgICAgICAgICAgICAgZWFzc2VydCAobWF0cml4 ICYmIG1hdHJpeC0+cm93cyk7CisgICAgICAgICAgICAgICAgZWFzc2VydCAocm93ID49IDAgJiYg cm93IDwgbWF0cml4LT5ucm93cyk7ICovCisgICAgICAgICAgICAgICAgYm9vbCBiYXJmX2NyYXNo X29uZSA9ICh3LT5jdXJyZW50X21hdHJpeCAmJiB3LT5jdXJyZW50X21hdHJpeC0+cm93cykgPyBm YWxzZSA6IHRydWU7CisgICAgICAgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hfb25lKQorICAgICAg ICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgYm9vbCBiYXJmX2NyYXNoX3R3 byA9ICh2bnRoID49IDAgJiYgdm50aCA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93cykgPyBmYWxz ZSA6IHRydWU7CisgICAgICAgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hfdHdvKQorICAgICAgICAg ICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqdm50 aF9yb3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgdm50aCk7CisgICAgICAgICAg ICAgICAgaW50IHhfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMF0ueDsKKyAgICAgICAgICAgICAgICBpbnQgZnhfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZng7CisgICAgICAgICAgICAgICAgaW50IHlfMCA9 IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ueTsKKyAgICAg ICAgICAgICAgICBpbnQgZnlfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0uZnk7CisgICAgICAgICAgICAgICAgaW50IGhwb3NfMCA9IG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uaHBvczsKKyAgICAgICAgICAgICAg ICBpbnQgdnBvc18wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS52cG9zOworICAgICAgICAgICAgICAgIGludCB3ZF8wID0gb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS53ZDsKKyAgICAgICAgICAgICAgICBpbnQgaF8w ID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5oOworICAg ICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGVfMCA9IG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uY3Vyc29yX3R5cGU7CisgICAg ICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS5jdXJzb3Jfd2lkdGg7CisgICAgICAgICAgICAgICAgLy8g IHN0cnVjdCBtY19SR0IgbHNsX2ZnXzAgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcucmVkLAorICAgICAgICAgICAgICAgIC8vICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMF0uZmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgLy8gICAgICAg ICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzBdLmZnLmJsdWV9OworICAgICAgICAgICAgICAgIHN0cnVjdCBtY19S R0IgbHNsX2JnXzAgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0uYmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS5iZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IC5ibHVlID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5i Zy5ibHVlfTsKKyAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wXzAgPSBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmFjdGl2ZV9wOworICAgICAgICAgICAg ICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvcl8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAgICAgICAg Ym9vbCBlbmFibGVkX3BfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMF0uZW5hYmxlZF9wOworICAgICAgICAgICAgICAgIGlmICh2cG9zXzAgPT0gdm50aAor ICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3JfMCA9PSBNQ19HTFlQSAorICAgICAg ICAgICAgICAgICAgICAmJiBlbmFibGVkX3BfMAorICAgICAgICAgICAgICAgICAgICAmJiB2bnRo X3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ICBtY19lcmFzZV9jdXJzb3IgKHcsIHctPmN1cnJlbnRfbWF0cml4LCB2bnRoX3JvdywgeF8wLCB5 XzAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaHBvc18wLCB2cG9zXzAs IGdseXBoX2ZsYXZvcl8wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1 cnNvcl90eXBlXzAsIHdkXzApOworICAgICAgICAgICAgICAgICAgICBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAg ICAgICAgICAgICAgICAtLW9sZF9tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdOworICAg ICAgICAgICAgICAgICAgICAvKiBJZiB3ZSBpbmFkdmVydGVudGx5IGVyYXNlZCBhbm90aGVyIGZh a2UgY3Vyc29yIGF0IHRoZSBzYW1lCisgICAgICAgICAgICAgICAgICAgIEhQT1MgdGhhdCBpcyBz dGlsbCBlbmFibGVkX3AgaW4gdGhlIGBvbGRfbWF0cml4YCwgdGhlbiByZWRyYXcgaXQuICovCisg ICAgICAgICAgICAgICAgICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBN Q19DQUNIRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7 CisgICAgICAgICAgICAgICAgICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IG50aF8xID0gMDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVfcCAob2xkX21hdHJp eCwgY2FjaGVfdHlwZSwgdm50aCwgbnRoXzEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICArK250aF8xKQorICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaW50IHhfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMV0ueDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnhfMSA9IG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZng7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgaW50IHlfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMV0ueTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQg ZnlfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZnk7 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhwb3NfMSA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uaHBvczsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICBpbnQgdnBvc18xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8xXS52cG9zOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB3ZF8x ID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS53ZDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5oOworICAgICAgICAgICAgICAgICAgICAgICAgICAg IGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGVfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uY3Vyc29yX3R5cGU7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8xXS5jdXJzb3Jfd2lkdGg7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmdfMSA9IHsucmVkID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5mZy5yZWQsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZnLmdyZWVuLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZnLmJsdWV9OworICAg ICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBzdHJ1Y3QgbWNfUkdCIGxzbF9iZ18xID0gey5y ZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmJnLnJl ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzFdLmJnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAg ICAgICAgICAgICAgICAgIC5ibHVlID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8xXS5iZy5ibHVlfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29s IGFjdGl2ZV9wXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzFdLmFjdGl2ZV9wOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfZmxhdm9y IGdseXBoX2ZsYXZvcl8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8xXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBl bmFibGVkX3BfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf MV0uZW5hYmxlZF9wOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgZ29fcF8xID0g KGhwb3NfMCA9PSBocG9zXzEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBlbmFibGVkX3BfMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFn b19wXzEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wXzEgPSBmYWxzZTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgdy0+Y3VycmVudF9tYXRy aXgsIHZudGhfcm93LCB4XzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGZ4XzEsIHlfMSwgZnlfMSwgaHBvc18xLCB2cG9zXzEsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkXzEsIGhfMSwgY3Vyc29y X3R5cGVfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgY3Vyc29yX3dpZHRoXzEsIGxzbF9mZ18xLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcF8xLCBnbHlwaF9mbGF2b3JfMSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlX3BfMSk7 CisgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmICh2cG9zXzAgPT0g dm50aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wXzAKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHZudGhfcm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wXzAgPSB0cnVlOwor ICAgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCB3LT5jdXJyZW50 X21hdHJpeCwgdm50aF9yb3csIHhfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgZnhfMCwgeV8wLCBmeV8wLCBocG9zXzAsIHZwb3NfMCwgd2RfMCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaF8wLCBjdXJzb3JfdHlwZV8w LCBjdXJzb3Jfd2lkdGhfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgbHNsX2JnXzAsIGFjdGl2ZV9wXzAsIGdseXBoX2ZsYXZvcl8wLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVfcF8wKTsKKyAgICAgICAgICAg ICAgICAgICAgICBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBd LmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgIC0tb2xkX21hdHJpeC5j dXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgICAgICAgICAgICAgLyogSWYgd2Ug aW5hZHZlcnRlbnRseSBlcmFzZWQgYW5vdGhlciBmYWtlIGN1cnNvciBhdCB0aGUgc2FtZQorICAg ICAgICAgICAgICAgICAgICAgIEhQT1MgdGhhdCBpcyBzdGlsbCBlbmFibGVkX3AgaW4gdGhlIGBv bGRfbWF0cml4YCwgdGhlbiByZWRyYXcgaXQuICovCisgICAgICAgICAgICAgICAgICAgICAgZm9y IChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgICAgICAg ICAgICAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICAgICAgICAgICAg ICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBudGhfMiA9IDA7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVfcCAob2xkX21hdHJpeCwgY2FjaGVfdHlw ZSwgdm50aCwgbnRoXzIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsrbnRoXzIp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgaW50IHhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMl0ueDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmeF8yID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5meDsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGludCB5XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzJdLnk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQg ZnlfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZnk7 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaHBvc18yID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5ocG9zOworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgaW50IHZwb3NfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMl0udnBvczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlu dCB3ZF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS53 ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBoXzIgPSBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmg7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlXzIgPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmN1cnNvcl90eXBlOworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aF8yID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5jdXJzb3Jfd2lkdGg7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZ18yID0gey5yZWQgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmZnLnJlZCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdy ZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5mZy5n cmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzJdLmZnLmJsdWV9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIHN0cnVjdCBt Y19SR0IgbHNsX2JnXzIgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMl0uYmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8g ICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5iZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5iZy5ibHVlfTsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3BfMiA9IG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uYWN0aXZlX3A7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3JfMiA9IG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZ2x5cGhfZmxhdm9yOworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBlbmFibGVkX3BfMiA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZW5hYmxlZF9wOworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgYm9vbCBnb19wXzIgPSAoaHBvc18wID09IGhwb3NfMgorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZnhfMCA8PSBmeF8yCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBmeF8wICsgd2Rf MCA+IGZ4XzIgKyB3ZF8yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBlbmFibGVkX3BfMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAo IWdvX3BfMikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wXzIgPSBmYWxzZTsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCB3LT5jdXJy ZW50X21hdHJpeCwgdm50aF9yb3csIHhfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBmeF8yLCB5XzIsIGZ5XzIsIGhwb3NfMiwgdnBvc18yLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkXzIs IGhfMiwgY3Vyc29yX3R5cGVfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGhfMiwgbHNsX2ZnXzIsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlX3BfMiwgZ2x5cGhf Zmxhdm9yXzIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgcmVtb3ZlX3BfMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgIH0KKyAgICB9CisgIGlmICh1cGRhdGluZ19mcmFtZV9wKQorICAgIHVw ZGF0ZV9lbmQgKGYpOworfQorCit2b2lkCittY191cGRhdGVfd2luZG93X2RyeXJ1biAoc3RydWN0 IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wLCBzdHJ1Y3QgbWNfZXNzZW50aWFscyBlc3NlbnRpYWxz KQoreworICBpZiAoIUJVRkZFUlAgKHctPmNvbnRlbnRzKSkKKyAgICByZXR1cm47CisKKyAgaWYg KHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVdID09IDAKKyAgICAgICYmIHctPm1j X21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hfQ0FDSEVdID09IDAKKyAgICAgICYmIHctPm1jX21hdHJp eC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVdID09IDAKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgcmV0dXJuOworCisgIC8vIGNsb2Nr X3QgY2xvY2tfc3RhcnQgPSBjbG9jaygpOworCisgIGJvb2wgZHJhd19wID0gZmFsc2U7CisKKyAg c3RydWN0IGdseXBoX21hdHJpeCAqc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Ki8KKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKm1vZGVfbGluZV9yb3cgPSBNQVRSSVhf TU9ERV9MSU5FX1JPVyAoZGVzaXJlZF9tYXRyaXgpOworICAgICAgaWYgKG1vZGVfbGluZV9yb3ct Pm1vZGVfbGluZV9wICYmIG1vZGVfbGluZV9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgeworICAg ICAgICAgIG1vZGVfbGluZV9yb3ctPnkgPSB5YiArIFdJTkRPV19TQ1JPTExfQkFSX0FSRUFfSEVJ R0hUICh3KTsKKyAgICAgICAgICB1cGRhdGVfd2luZG93X2xpbmUgKHcsIE1BVFJJWF9ST1dfVlBP UyAobW9kZV9saW5lX3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgZGVzaXJlZF9tYXRyaXgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisgICAgICAgIH0KKworICAgICAgLyogRmlu ZCBmaXJzdCBlbmFibGVkIHJvdy4gIE9wdGltaXphdGlvbnMgaW4gcmVkaXNwbGF5X2ludGVybmFs CisgICAgICAgICBtYXkgbGVhZCB0byBhbiB1cGRhdGUgd2l0aCBvbmx5IG9uZSByb3cgZW5hYmxl ZC4gIFRoZXJlIG1heQorICAgICAgICAgYmUgYWxzbyBjb21wbGV0ZWx5IGVtcHR5IG1hdHJpY2Vz LiAqLworICAgICAgd2hpbGUgKHJvdyA8IGVuZCAmJiAhcm93LT5lbmFibGVkX3ApCisgICAgICAg ICsrcm93OworCisgICAgICAvKiBUcnkgcmV1c2luZyBwYXJ0IG9mIHRoZSBkaXNwbGF5IGJ5IGNv cHlpbmcuICovCisgICAgICBpZiAocm93IDwgZW5kICYmICF3LT5kZXNpcmVkX21hdHJpeC0+bm9f c2Nyb2xsaW5nX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgcmMgPSBtY19zY3JvbGxpbmdf d2luZG93ICh3LCBoZWFkZXJfbGluZV9yb3cgIT0gTlVMTCk7CisgICAgICAgICAgaWYgKHJjIDwg MCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogQWxsIHJvd3Mgd2VyZSBmb3VuZCB0 byBiZSBlcXVhbC4gKi8KKyAgICAgICAgICAgICAgcGF1c2VkX3AgPSAwOworICAgICAgICAgICAg ICBnb3RvIHNldF9jdXJzb3I7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChy YyA+IDApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBXZSd2ZSBzY3JvbGxl ZCB0aGUgZGlzcGxheS4gKi8KKyAgICAgICAgICAgICAgICBmb3JjZV9wID0gMTsKKyAgICAgICAg ICAgICAgICBjaGFuZ2VkX3AgPSAxOworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAg IC8qIFByb2Nlc3MgdGhlIGN1cnNvciByb3cgYXQgdGhlIG91dHNldCBpZiBpdCBpcyB3aXRoaW4g YGRlc2lyZWRfbWF0cml4YC4KKyAgICAgIFdoZW4gcHJvY2Vzc2luZyBhbGwgb3RoZXIgcm93cywg d2Ugd2lsbCBxdWVyeSB0aGUgYHctPmN1cnJlbnRfbWF0cml4YCBmb3IgZGF0YQorICAgICAgcmVs YXRpbmcgdG8gdGhlIGN1cnNvciByb3cuICBgbWFrZV9jdXJyZW50YCAod2l0aGluIGB1cGRhdGVf d2luZG93X2xpbmUnKQorICAgICAgdXBkYXRlcyB0aGUgYHctPmN1cnJlbnRfbWF0cml4YCBmb3Ig dGhlIGFwcGxpY2FibGUgcm93LiAgSW4gZG9pbmcgc28sIGhvd2V2ZXIsCisgICAgICB0aGUgYXBw bGljYWJsZSByb3cgaW4gdGhlIGRlc2lyZWQgbWF0cml4IGlzIGFsdGVyZWQgc3VjaCB0aGF0IHdl IGNhbiBubyBsb25nZXIKKyAgICAgIHJlbHkgdXBvbiB0aGUgYWNjdXJhY3kgb2YgYFJPVy0+dXNl ZFtURVhUX0FSRUFdYC4gIFRoZXJlZm9yZSwgd2UgbXVzdCBub3cgcmVseQorICAgICAgZXhjbHVz aXZlbHkgdXBvbiBgdy0+Y3VycmVudF9tYXRyaXgnIGZvciBjdXJzb3Igcm93IGJhc2VkIGRlY2lz aW9ucy4gKi8KKyAgICAgIGZvciAoc3RydWN0IGdseXBoX3JvdyAqbWNfcm93ID0gcm93OworICAg ICAgICAgICBtY19yb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3BlbmRpbmcpOworICAg ICAgICAgICArK21jX3JvdykKKyAgICAgICAgeworICAgICAgICAgIGludCB2cG9zID0gTUFUUklY X1JPV19WUE9TIChtY19yb3csIHctPmRlc2lyZWRfbWF0cml4KTsKKyAgICAgICAgICBpZiAobWNf cm93LT5lbmFibGVkX3AKKyAgICAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcykK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCA9IHctPmRlc2lyZWRf bWF0cml4OworICAgICAgICAgICAgICBpZiAoIWZvcmNlX3AgJiYgKytuX3VwZGF0ZWQgJSBwcmVl bXB0X2NvdW50ID09IDApCisgICAgICAgICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdu b3JlX3NxdWVlemFibGVzICgpOworICAgICAgICAgICAgICBjaGFuZ2VkX3AgfD0gbWNfdXBkYXRl X3dpbmRvd19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4 LCBlc3NlbnRpYWxzLCBkcmF3X3ApOworICAgICAgICAgICAgICBpZiAoTUFUUklYX1JPV19CT1RU T01fWSAocm93KSA+PSB5YikKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gdnBvcyArIDE7 IGkgPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAgICAgICAg ICBTRVRfTUFUUklYX1JPV19FTkFCTEVEX1AgKHctPmN1cnJlbnRfbWF0cml4LCBpLCBmYWxzZSk7 CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBj dXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAvKiBVcGRhdGUgdGhlIHJl c3Qgb2YgdGhlIGxpbmVzLiAqLworICAgICAgZm9yICg7IHJvdyA8IGVuZCAmJiAoZm9yY2VfcCB8 fCAhaW5wdXRfcGVuZGluZyk7ICsrcm93KQorICAgICAgICAvKiBzY3JvbGxpbmdfd2luZG93IHJl c2V0cyB0aGUgZW5hYmxlZF9wIGZsYWcgb2YgdGhlIHJvd3MgaXQgcmV1c2VzIGZyb20KKyAgICAg ICAgY3VycmVudF9tYXRyaXguICovCisgICAgICAgIGlmIChyb3ctPmVuYWJsZWRfcCkKKyAgICAg ICAgICB7CisgICAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCB3LT5k ZXNpcmVkX21hdHJpeCk7CisgICAgICAgICAgICAvKiBJZiB0aGUgYGN1cnNvcl9yb3dgIGlzIHdp dGhpbiB0aGUgYGRlc2lyZWRfbWF0cml4YCwgdGhlbiBpdCB3YXMKKyAgICAgICAgICAgIHByb2Nl c3NlZCBoZXJlaW5hYm92ZSBhbmQgc2hvdWxkIGJlIHNraXBwZWQgYXQgdGhpcyB0aW1lLiAqLwor ICAgICAgICAgICAgaWYgKHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICBjb250 aW51ZTsKKyAgICAgICAgICAgIGludCBpOworICAgICAgICAgICAgLyogV2UnbGwgaGF2ZSB0byBw bGF5IGEgbGl0dGxlIGJpdCB3aXRoIHdoZW4gdG8KKyAgICAgICAgICAgICAgIGRldGVjdF9pbnB1 dF9wZW5kaW5nLiAgSWYgaXQncyBkb25lIHRvbyBvZnRlbiwKKyAgICAgICAgICAgICAgIHNjcm9s bGluZyBsYXJnZSB3aW5kb3dzIHdpdGggcmVwZWF0ZWQgc2Nyb2xsLXVwCisgICAgICAgICAgICAg ICBjb21tYW5kcyB3aWxsIHRvbyBxdWlja2x5IHBhdXNlIHJlZGlzcGxheS4gKi8KKyAgICAgICAg ICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkKKyAg ICAgICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgpOwor ICAgICAgICAgICAgY2hhbmdlZF9wIHw9IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywg Jm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIGRyYXdfcCk7Cisg ICAgICAgICAgICAvKiBNYXJrIGFsbCByb3dzIGJlbG93IHRoZSBsYXN0IHZpc2libGUgb25lIGlu IHRoZSBjdXJyZW50CisgICAgICAgICAgICAgICBtYXRyaXggYXMgaW52YWxpZC4gIFRoaXMgaXMg bmVjZXNzYXJ5IGJlY2F1c2Ugb2YKKyAgICAgICAgICAgICAgIHZhcmlhYmxlIGxpbmUgaGVpZ2h0 cy4gIENvbnNpZGVyIHRoZSBjYXNlIG9mIHRocmVlCisgICAgICAgICAgICAgICBzdWNjZXNzaXZl IHJlZGlzcGxheXMsIHdoZXJlIHRoZSBmaXJzdCBkaXNwbGF5cyA1CisgICAgICAgICAgICAgICBs aW5lcywgdGhlIHNlY29uZCAzIGxpbmVzLCBhbmQgdGhlIHRoaXJkIDUgbGluZXMgYWdhaW4uCisg ICAgICAgICAgICAgICBJZiB0aGUgc2Vjb25kIHJlZGlzcGxheSB3b3VsZG4ndCBtYXJrIHJvd3Mg aW4gdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IG1hdHJpeCBpbnZhbGlkLCB0aGUgdGhpcmQg cmVkaXNwbGF5IG1pZ2h0IGJlCisgICAgICAgICAgICAgICB0ZW1wdGVkIHRvIG9wdGltaXplIHJl ZGlzcGxheSBiYXNlZCBvbiBsaW5lcyBkaXNwbGF5ZWQKKyAgICAgICAgICAgICAgIGluIHRoZSBm aXJzdCByZWRpc3BsYXkuICovCisgICAgICAgICAgICBpZiAoTUFUUklYX1JPV19CT1RUT01fWSAo cm93KSA+PSB5YikKKyAgICAgICAgICAgICAgZm9yIChpID0gdnBvcyArIDE7IGkgPCB3LT5jdXJy ZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAgICAgICAgU0VUX01BVFJJWF9S T1dfRU5BQkxFRF9QICh3LT5jdXJyZW50X21hdHJpeCwgaSwgZmFsc2UpOworICAgICAgICAgIH0K KyAgICAgIC8qIFdhcyBkaXNwbGF5IHByZWVtcHRlZD8gKi8KKyAgICAgIHBhdXNlZF9wID0gcm93 IDwgZW5kOworICAgICAgc2V0X2N1cnNvcjoKKyAgICAgIC8qIElmIHdlIGp1bXBlZCBoZXJlIGZy b20gYHNldF9jdXJzb3JgLCB0aGVuIHNldCB0aGUgYGN1cnNvcl9tYXRyaXhgLiAqLworICAgICAg aWYgKGN1cnNvcl9tYXRyaXggPT0gTlVMTCkKKyAgICAgICAgY3Vyc29yX21hdHJpeCA9IHctPmN1 cnJlbnRfbWF0cml4OworICAgICAgLyogUmVzZXQgYHJvd2AgdG8gMCBzbyB0aGF0IGZha2UgY3Vy c29ycyBjYW4gYmUgZHJhd24gb24gcm93cyBwcmVjZWRpbmcgdGhlCisgICAgICBmaXJzdCBgcm93 LT5lbmFibGVkX3BgLiAgSnVzdCBwcmlvciB0byB0aGUgY2FsbCB0byBgc2Nyb2xsaW5nX3dpbmRv dycgYWJvdmUsCisgICAgICBgcm93YCB3YXMgYWR2YW5jZWQgdG8gdGhlIGZpcnN0IGByb3ctPmVu YWJsZWRfcGAuICovCisgICAgICBmb3IgKHN0cnVjdCBnbHlwaF9yb3cgKmRlc2lyZWRfcm93ID0g TUFUUklYX1JPVyAody0+ZGVzaXJlZF9tYXRyaXgsIDApOworICAgICAgICAgICBkZXNpcmVkX3Jv dyA8IGVuZAorICAgICAgICAgICAmJiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVuZGluZykKKyAgICAg ICAgICAgLyogVzMyIEVtYWNzIGNyYXNoZXMgb24gc3RhcnR1cCB3aXRob3V0IGEgQlVGRkVSUCBj aGVjay4gKi8KKyAgICAgICAgICAgJiYgQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAg ICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAg ICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFp cnMpKQorICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgZmNfdmlzaWJsZSkpKTsKKyAgICAgICAgICAgKytkZXNpcmVkX3JvdykKKyAgICAgICAgewor ICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChkZXNpcmVkX3Jvdywgdy0+ZGVz aXJlZF9tYXRyaXgpOworICAgICAgICAgIGlmIChkZXNpcmVkX3Jvdy0+ZW5hYmxlZF9wKQorICAg ICAgICAgICAgY29udGludWU7CisgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqYm90dG9tX3Jv dyA9IE1BVFJJWF9CT1RUT01fVEVYVF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB3KTsKKyAgICAg ICAgICBpbnQgYm90dG9tX3Zwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKGJvdHRvbV9yb3csIHctPmN1 cnJlbnRfbWF0cml4KTsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJyZW50X3JvdyA9 IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAgICAgICAgICBlbnVtIG1j X3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24gPSBtY19yb3dfcG9zaXRpb24gKHcsIGN1cnJlbnRf cm93LCBjdXJyZW50X3JvdywgdnBvcyk7CisgICAgICAgICAgaWYgKGN1cnJlbnRfcm93LT5lbmFi bGVkX3ApCisgICAgICAgICAgICBtY19kcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIGN1 cnJlbnRfcm93LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgICAg ICAgICAgICAgICAgY3VycmVudF9yb3ctPngsIGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0s IHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgYm90dG9tX3Zwb3MsIGN1cnNvcl9tYXRy aXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBk cmF3X3AsIFNFVF9DVVJTT1JfT05FKTsKKyAgICAgICAgfQorCisgICAgICBtY19yZXN0b3JlX2ds eXBoX21hdHJpeCAoc2F2ZWRfZGVzaXJlZCwgdy0+ZGVzaXJlZF9tYXRyaXgpOworICAgICAgbWNf cmVzdG9yZV9nbHlwaF9tYXRyaXggKHNhdmVkX2N1cnJlbnQsIHctPmN1cnJlbnRfbWF0cml4KTsK KworICAgICAgbWNfdXBkYXRlX3dpbmRvd19lcmFzZSAodywgb2xkX21hdHJpeCk7CisKKyAgICAg IG1jX3hmcmVlX2NhY2hlX21hdHJpeCAodywgJm9sZF9tYXRyaXgpOworCisgICAgfQorICAvLyBj bG9ja190IGNsb2NrX2VuZCA9IGNsb2NrKCk7CisgIC8vIGRvdWJsZSBjcHVfdGltZV91c2VkID0g KChkb3VibGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7Cisg IC8vIGZwcmludGYgKHN0ZGVyciwgIm1jX3Njcm9sbGluZ193aW5kb3cgKCVzKTogIFRJTUUgKCVm KVxuIiwgbWNfd2luZG93ICh3KSwgY3B1X3RpbWVfdXNlZCk7Cit9CisKKy8qIGVuZCBNVUxUSVBM RS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBTdHJ1Y3R1cmUg dG8gcGFzcyBkaW1lbnNpb25zIGFyb3VuZC4gIFVzZWQgZm9yIGNoYXJhY3RlciBib3VuZGluZwog ICAgYm94ZXMsIGdseXBoIG1hdHJpeCBkaW1lbnNpb25zIGFuZCBhbGlrZS4gICovCiAKQEAgLTIy NDEsNiArNDA2NiwxNiBAQCBmcmVlX3dpbmRvd19tYXRyaWNlcyAoc3RydWN0IHdpbmRvdyAqdykK IAkgIGZyZWVfZ2x5cGhfbWF0cml4ICh3LT5jdXJyZW50X21hdHJpeCk7CiAJICBmcmVlX2dseXBo X21hdHJpeCAody0+ZGVzaXJlZF9tYXRyaXgpOwogCSAgdy0+Y3VycmVudF9tYXRyaXggPSB3LT5k ZXNpcmVkX21hdHJpeCA9IE5VTEw7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKKyAgbWNfeGZyZWVfY2FjaGVfbWF0cml4ICh3LCAmdy0+bWNf bWF0cml4KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCX0KIAogICAgICAgLyog TmV4dCB3aW5kb3cgb24gc2FtZSBsZXZlbC4gICovCkBAIC0zMzg3LDYgKzUyMjIsMjYgQEAgY2hl Y2tfY3VycmVudF9tYXRyaXhfZmxhZ3MgKHN0cnVjdCB3aW5kb3cgKncpCiBzdGF0aWMgYm9vbAog dXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogeworCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmICh0 cmFjZV9yZWRpc3BsYXlfcCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJ1cGRhdGVfd2luZG93ICgl cylcbiIsIG1jX3dpbmRvdyAodykpOworCisgIHN0cnVjdCBtY19lc3NlbnRpYWxzIGVzc2VudGlh bHM7CisgIG1jX3NldF9lc3NlbnRpYWxzICh3LCAmZXNzZW50aWFscyk7CisKKyAgbWNfdXBkYXRl X3dpbmRvd19kcnlydW4gKHcsIGZvcmNlX3AsIGVzc2VudGlhbHMpOworCisgIHN0cnVjdCBnbHlw aF9tYXRyaXggKmN1cnNvcl9tYXRyaXggPSBOVUxMOworCisgIGJvb2wgZHJhd19wID0gdHJ1ZTsK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpk ZXNpcmVkX21hdHJpeCA9IHctPmRlc2lyZWRfbWF0cml4OwogICBib29sIHBhdXNlZF9wOwogICBp bnQgcHJlZW1wdF9jb3VudCA9IGNsaXBfdG9fYm91bmRzICgxLCBiYXVkX3JhdGUgLyAyNDAwICsg MSwgSU5UX01BWCk7CkBAIC0zNDYwLDYgKzUzMTUsNDcgQEAgdXBkYXRlX3dpbmRvdyAoc3Ryd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KKyAgICB7CisgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1df VlBPUyAobWNfcm93LCBkZXNpcmVkX21hdHJpeCk7CisgICAgICBpZiAobWNfcm93LT5lbmFibGVk X3AKKyAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICB7CisgICAg ICAgICAgY3Vyc29yX21hdHJpeCA9IGRlc2lyZWRfbWF0cml4OworICAgICAgICAgIGlmICghZm9y Y2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkKKyAgICAgICAgICAgIGRl dGVjdF9pbnB1dF9wZW5kaW5nX2lnbm9yZV9zcXVlZXphYmxlcyAoKTsKKyAgICAgICAgICBjaGFu Z2VkX3AgfD0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAg JiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICEgTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpKQorICAgICAgICAgICAg ICAgICAgICAgICA/IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vf b3ZlcndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIGRyYXdfcCkKKyAgICAgICAgICAgICAg ICAgICAgICAgOiB1cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3 cml0dGVuX3ApOworICAgICAgICAgIGlmIChNQVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHli KQorICAgICAgICAgICAgZm9yIChpbnQgaSA9IHZwb3MgKyAxOyBpIDwgdy0+Y3VycmVudF9tYXRy aXgtPm5yb3dzIC0gMTsgKytpKQorICAgICAgICAgICAgICBTRVRfTUFUUklYX1JPV19FTkFCTEVE X1AgKHctPmN1cnJlbnRfbWF0cml4LCBpLCBmYWxzZSk7CisgICAgICAgICAgYnJlYWs7CisgICAg ICAgIH0KKyAgICB9CisKKyAgY3Vyc29yX21hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICAvKiBVcGRhdGUgdGhlIHJlc3Qgb2Yg dGhlIGxpbmVzLiAgKi8KICAgICAgIGZvciAoOyByb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlu cHV0X3BlbmRpbmcpOyArK3JvdykKIAkvKiBzY3JvbGxpbmdfd2luZG93IHJlc2V0cyB0aGUgZW5h YmxlZF9wIGZsYWcgb2YgdGhlIHJvd3MgaXQKQEAgLTM0NjcsNiArNTM2MywxOSBAQCB1cGRhdGVf d2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAJaWYgKHJvdy0+ZW5hYmxl ZF9wKQogCSAgewogCSAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBkZXNpcmVk X21hdHJpeCk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJT T1JTICovCisKKyAgICAgICAgICAvKiBJZiB0aGUgYGN1cnNvcl9yb3dgIGlzIHdpdGhpbiB0aGUg YGRlc2lyZWRfbWF0cml4YCwgdGhlbiBpdCB3YXMKKyAgICAgICAgICBwcm9jZXNzZWQgaGVyZWlu YWJvdmUgYW5kIHNob3VsZCBiZSBza2lwcGVkIGF0IHRoaXMgdGltZS4gKi8KKyAgICAgICAgICBp ZiAodnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICBjb250aW51ZTsKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogCSAgICBpbnQgaTsKIAogCSAgICAvKiBXZSdsbCBoYXZl IHRvIHBsYXkgYSBsaXR0bGUgYml0IHdpdGggd2hlbiB0bwpAQCAtMzQ3NSw4ICs1Mzg0LDIxIEBA IHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIAkgICAgICAg Y29tbWFuZHMgd2lsbCB0b28gcXVpY2tseSBwYXVzZSByZWRpc3BsYXkuICAqLwogCSAgICBpZiAo IWZvcmNlX3AgJiYgKytuX3VwZGF0ZWQgJSBwcmVlbXB0X2NvdW50ID09IDApCiAJICAgICAgZGV0 ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgpOwotCSAgICBjaGFuZ2VkX3Ag fD0gdXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLAotCQkJCQkgICAgICZtb3VzZV9mYWNlX292 ZXJ3cml0dGVuX3ApOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUt Q1VSU09SUyAqLworCisgICAgICAgICAgY2hhbmdlZF9wIHw9IChCVUZGRVJQICh3LT5jb250ZW50 cykKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICB8fCAhIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg ZmNfdmlzaWJsZSkpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgPyBtY191cGRhdGVfd2luZG93 X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3AsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRp YWxzLCBkcmF3X3ApCisgICAgICAgICAgICAgICAgICAgICAgIDogdXBkYXRlX3dpbmRvd19saW5l ICh3LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wKTsKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKIAogCSAgICAvKiBNYXJrIGFsbCByb3dzIGJlbG93IHRoZSBsYXN0IHZpc2li bGUgb25lIGluIHRoZSBjdXJyZW50CiAJICAgICAgIG1hdHJpeCBhcyBpbnZhbGlkLiAgVGhpcyBp cyBuZWNlc3NhcnkgYmVjYXVzZSBvZgpAQCAtMzQ5Nyw2ICs1NDE5LDQ0IEBAIHVwZGF0ZV93aW5k b3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIAogICAgIHNldF9jdXJzb3I6CiAK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAg LyogSWYgd2UganVtcGVkIGhlcmUgZnJvbSBgc2V0X2N1cnNvcmAsIHRoZW4gc2V0IHRoZSBgY3Vy c29yX21hdHJpeGAu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cm93LT5lbmFibGVk X3ApCisgICAgICAgIGNvbnRpbnVlOworICAgICAgc3RydWN0IGdseXBoX3JvdyAqYm90dG9tX3Jv dyA9IE1BVFJJWF9CT1RUT01fVEVYVF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB3KTsKKyAgICAg IGludCBib3R0b21fdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAoYm90dG9tX3Jvdywgdy0+Y3VycmVu dF9tYXRyaXgpOworICAgICAgc3RydWN0IGdseXBoX3JvdyAqY3VycmVudF9yb3cgPSBNQVRSSVhf Uk9XICh3LT5jdXJyZW50X21hdHJpeCwgdnBvcyk7CisgICAgICBlbnVtIG1jX3Jvd19wb3NpdGlv biByb3dfcG9zaXRpb24gPSBtY19yb3dfcG9zaXRpb24gKHcsIGN1cnJlbnRfcm93LCBjdXJyZW50 X3JvdywgdnBvcyk7CisgICAgICBpZiAoY3VycmVudF9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAg bWNfZHJhd19yb3cgKHcsIHctPmN1cnJlbnRfbWF0cml4LCBjdXJyZW50X3JvdywgY3VycmVudF9y b3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAgICAgICAgICAgICAgY3VycmVudF9yb3ct PngsIGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0sIHZwb3MsCisgICAgICAgICAgICAgICAg ICAgICBib3R0b21fdnBvcywgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9u LAorICAgICAgICAgICAgICAgICAgICAgZHJhd19wLCBTRVRfQ1VSU09SX1RXTyk7CisgICAgfQor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICAvKiBVcGRhdGUgdGhlIGhlYWRl ciBsaW5lIGFmdGVyIHNjcm9sbGluZyBiZWNhdXNlIGEgbmV3IGhlYWRlcgogCSBsaW5lIHd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BzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFN RSAodykpOworICBmb3IgKGludCBpID0gMDsgaSA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93czsg KytpKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdyA9IHctPmN1cnJlbnRfbWF0 cml4LT5yb3dzICsgaTsKKyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgIGJyZWFr OworICAgICAgICBlbHNlIGlmIChyb3ctPm1vZGVfbGluZV9wKQorICAgICAgICAgIGNvbnRpbnVl OworICAgICAgaWYgKHJvdy0+b3ZlcmxhcHBlZF9wKQorICAgICAgICB7CisgICAgICAgICAgZm9y IChlbnVtIGdseXBoX3Jvd19hcmVhIGFyZWEgPSBMRUZUX01BUkdJTl9BUkVBOyBhcmVhIDwgTEFT VF9BUkVBOyArK2FyZWEpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG91dHB1dF9jdXJz b3JfdG8gKHcsIGksIDAsIHJvdy0+eSwgYXJlYSA9PSBURVhUX0FSRUEgPyByb3ctPnggOiAwKTsK KyAgICAgICAgICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwg cm93LCBhcmVhLCByb3ctPngsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg cm93LT51c2VkW2FyZWFdLCB0cnVlLCBEUkFXX05PUk1BTF9URVhULAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIFVQREFURV9XSU5ET1dfX1JFRFJBV19PVkVSTEFQUEVEX1JPV1Mp CisgICAgICAgICAgICAgICAgICAmJiByb3ctPnVzZWRbYXJlYV0pCisgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgRlJBTUVfUklGIChmKS0+d3JpdGVfZ2x5cGhzICh3LCByb3cs IHJvdy0+Z2x5cGhzW2FyZWFdLCBhcmVhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICByb3ctPnVzZWRbYXJlYV0pOworICAgICAgICAgICAgICAgICAgRlJB TUVfUklGIChmKS0+Y2xlYXJfZW5kX29mX2xpbmUgKHcsIHJvdywgYXJlYSwgLTEpOworICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICByb3ctPm92ZXJsYXBwZWRfcCA9 IDA7CisgICAgICAgIH0KKyAgICAgIGlmIChNQVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHli KQorICAgICAgICBicmVhazsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IAkgICAgICByZWRyYXdfb3ZlcmxhcHBpbmdfcm93cyAodywgeWIpOwogCSAgICB9CiAjZW5kaWYK QEAgLTM1MzEsMTAgKzU1MzMsMjEgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywg Ym9vbCBmb3JjZV9wKQogICAgICAgc3RyY3B5ICh3LT5jdXJyZW50X21hdHJpeC0+bWV0aG9kLCB3 LT5kZXNpcmVkX21hdHJpeC0+bWV0aG9kKTsKICNlbmRpZgogCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lT VEVNCisgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICFOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICBtY191cGRhdGVfd2luZG93 X2ZyaW5nZXMgKHcsIDApOworICAgIGVsc2UKICAgICAgIHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAo dywgMCk7CiAjZW5kaWYKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgLyog RW5kIHRoZSB1cGRhdGUgb2Ygd2luZG93IFcuICBEb24ndCBzZXQgdGhlIGN1cnNvciBpZiB3ZQog ICAgICAgICAgcGF1c2VkIHVwZGF0aW5nIHRoZSBkaXNwbGF5IGJlY2F1c2UgaW4gdGhpcyBjYXNl LAogICAgICAgICAgc2V0X3dpbmRvd19jdXJzb3JfYWZ0ZXJfdXBkYXRlIGhhc24ndCBiZWVuIGNh bGxlZCwgYW5kCmRpZmYgLS1naXQgYS9zcmMvZnJhbWUuaCBiL3NyYy9mcmFtZS5oCmluZGV4IGVj OGY2MTQuLmVlYWY3MWUgMTAwNjQ0Ci0tLSBhL3NyYy9mcmFtZS5oCisrKyBiL3NyYy9mcmFtZS5o CkBAIC0yMDUsNiArMjA1LDE2IEBAIHN0cnVjdCBmcmFtZQogICBMaXNwX09iamVjdCB0b29sX2Jh cl9pdGVtczsKICAgLyogdG9vbF9iYXJfaXRlbXMgc2hvdWxkIGJlIHRoZSBsYXN0IExpc3BfT2Jq ZWN0IG1lbWJlci4gICovCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKyAgLyogTm9uLW5pbCB3aGVuIHRoZSBmcmFtZSBpcyBpbiB0aGUgcHJv Y2VzcyBvZiBiZWluZyB1cGRhdGVkLiAqLworICBzdHJ1Y3QgZnJhbWUgKm1jX3VwZGF0aW5nX2Zy YW1lOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIENhY2hlIG9mIHJlYWxp emVkIGZhY2V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KKworLyogMjYKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAg ICAieHh4eHh4eHgiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAi eC4ueHguLngiCisgICAgICAieC4uLnh4LngiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC54 eHh4eHgiCisgICAgICAieC54eHh4eHgiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC4uLnh4 LngiCisgICAgICAieC4ueHguLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngi CisgICAgICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3df cmVjdGFuZ2xlX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDk5 LCAweDhkLCAweDg3LCAweGJmLAorICAweGJmLCAweDg3LCAweDhkLCAweDk5LCAweDgxLCAweDgx LCAweGZmfTsKKworLyogMjcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAg ICAieHh4eHh4eHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAi eC54eC4ueHgiCisgICAgICAieC4ueHgueHgiCisgICAgICAieC4uLnh4eHgiCisgICAgICAieHh4 eHh4eHgiCisgICAgICAieHh4eHh4eHgiCisgICAgICAieC4uLnh4eHgiCisgICAgICAieC4ueHgu eHgiCisgICAgICAieC54eC4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgi CisgICAgICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19yZXZlcnNl ZF9ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAw eDgxLCAweGIxLCAweDk5LCAweDhkLCAweGZmLAorICAweGZmLCAweDhkLCAweDk5LCAweGIxLCAw eDgxLCAweDgxLCAweGZmfTsKKworLyogMjgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNp bWFsCisgICAgICAieHh4eHh4eHgiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngi CisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisg ICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAg ICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAi eC4uLi4uLngiCisgICAgICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBt Y19ob2xsb3dfcmVjdGFuZ2xlX2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDgxLCAw eDgxLCAweDgxLCAweDgxLAorICAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAw eGZmfTsKKworLyogMjkKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAi eC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4u Li4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4u Li4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4i CisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisg ICAgICAieC4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9i YXJfYml0c1tdID17CisgIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAs CisgIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODB9OworCisvKiAzMAor ICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi54eCIKKyAgICAg ICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIu Li4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4u Li54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54 eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIp CisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9iaXRz W10gPXsKKyAgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgz LCAweDMsIDB4MywgMHgzLCAweDN9OworCisvKiAzMQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4 YWRlY2ltYWwKKyAgICAgICJ4eC4uLi4uLiIKKyAgICAgICJ4eC4uLi4uLiIKKyAgICAgICIgeHgu Li4uLiIKKyAgICAgICIueHguLi4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIuLnh4Li4u LiIKKyAgICAgICIuLi54eC4uLiIKKyAgICAgICIuLi54eC4uLiIKKyAgICAgICIuLi4ueHguLiIK KyAgICAgICIuLi4ueHguLiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLnh4LiIKKyAg ICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNo b3J0IG1jX2JhY2tzbGFzaF9iaXRzW10gPXsKKyAgMHhjMCwgMHhjMCwgMHhlMCwgMHg2MCwgMHgz MCwgMHgzMCwgMHgxOCwgMHgxOCwgMHhjLCAweGMsIDB4NiwgMHg2LCAweDMsIDB4M307CisKKy8q IDMyCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgor ICAgICAgInh4Li4uLi4uIgorICAgICAgInh4eC4uLi4uIgorICAgICAgInh4eC4uLi4uIgorICAg ICAgIngueHguLi4uIgorICAgICAgIngueHguLi4uIgorICAgICAgInguLnh4Li4uIgorICAgICAg InguLnh4Li4uIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLi54eC4uIgorICAgICAgIngu Li4ueHguIgorICAgICAgInguLi4ueHguIgorICAgICAgInguLi4uLnh4IgorICAgICAgInguLi4u Lnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX2JhY2tzbGFz aF9iaXRzW10gPXsKKyAgMHhjMCwgMHhjMCwgMHhlMCwgMHhlMCwgMHhiMCwgMHhiMCwgMHg5OCwK KyAgMHg5OCwgMHg4YywgMHg4YywgMHg4NiwgMHg4NiwgMHg4MywgMHg4M307CisKKy8qIDMzCisg ICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi54eHh4eHguIgorICAgICAg Inh4eHgueC4uIgorICAgICAgInh4eHgueC4uIgorICAgICAgInh4eHgueC4uIgorICAgICAgIi54 eHgueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngu eC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4u IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcGlsY3Jvd19iaXRzW10gPXsKKyAgMHg3 ZSwgMHhmNCwgMHhmNCwgMHhmNCwgMHg3NCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwg MHgxNH07CisKKy8qIDM0CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAg Ii4ueHh4eC4uIgorICAgICAgIi54eHh4eHguIgorICAgICAgInguLnh4Li54IgorICAgICAgIngu Lnh4Li54IgorICAgICAgInh4eHh4eHh4IgorICAgICAgInh4Li4uLnh4IgorICAgICAgInh4eC4u eHh4IgorICAgICAgIi54eHh4eHguIgorICAgICAgIi4ueHh4eC4uIikKKyovCitzdGF0aWMgdW5z aWduZWQgc2hvcnQgbWNfc21pbGV5X2ZhY2VfYml0c1tdID17CisgIDB4M2MsIDB4N2UsIDB4OTks IDB4OTksIDB4ZmYsIDB4YzMsIDB4ZTcsIDB4N2UsIDB4M2N9OworCisvKiAzNQorICAgICgrLWZy aW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLnguLi4uLiIKKyAgICAgICIuLi54Li4u LiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIuLi4uLnguLiIKKyAgICAgICIuLi4ueC4uLiIK KyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLnguLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVk IHNob3J0IG1jX3NpbmdsZV9hbmdsZV9yaWdodF9iaXRzW10gPXsKKyAgMHgyMCwgMHgxMCwgMHg4 LCAweDQsIDB4OCwgMHgxMCwgMHgyMH07CisKKy8qIDM2CisgICAgKCstZnJpbmdlLWhlbHBlci1o ZXhhZGVjaW1hbAorICAgICAgIi4uLi4ueC4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4u LnguLi4uIgorICAgICAgIi4ueC4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi54 Li4uIgorICAgICAgIi4uLi4ueC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2lu Z2xlX2FuZ2xlX2xlZnRfYml0c1tdID17CisgIDB4NCwgMHg4LCAweDEwLCAweDIwLCAweDEwLCAw eDgsIDB4NH07CisKKy8qIDM3CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAg ICAgInh4Lnh4Li4uIgorICAgICAgIi54eC54eC4uIgorICAgICAgIi4ueHgueHguIgorICAgICAg Ii4uLnh4Lnh4IgorICAgICAgIi4ueHgueHguIgorICAgICAgIi54eC54eC4uIgorICAgICAgInh4 Lnh4Li4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3JpZ2h0 X2JpdHNbXSA9eworICAweGQ4LCAweDZjLCAweDM2LCAweDFiLCAweDM2LCAweDZjLCAweGQ4fTsK KworLyogMzgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4ueHgu eHgiCisgICAgICAiLi54eC54eC4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAieHgueHguLi4i CisgICAgICAiLnh4Lnh4Li4iCisgICAgICAiLi54eC54eC4iCisgICAgICAiLi4ueHgueHgiKQor Ki8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfbGVmdF9iaXRzW10gPXsK KyAgMHgxYiwgMHgzNiwgMHg2YywgMHhkOCwgMHg2YywgMHgzNiwgMHgxYn07CisKKy8qIDM5Cisg ICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIngueC54Li4uIgorICAgICAg Ii54LngueC4uIgorICAgICAgIi4ueC54LnguIgorICAgICAgIi4uLngueC54IgorICAgICAgIi4u eC54LnguIgorICAgICAgIi54LngueC4uIgorICAgICAgIngueC54Li4uIikKKyovCitzdGF0aWMg dW5zaWduZWQgc2hvcnQgbWNfdHJpcGxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAweGE4LCAw eDU0LCAweDJhLCAweDE1LCAweDJhLCAweDU0LCAweGE4fTsKKworLyogNDAKKyAgICAoKy1mcmlu Z2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4ueC54LngiCisgICAgICAiLi54LngueC4i CisgICAgICAiLngueC54Li4iCisgICAgICAieC54LnguLi4iCisgICAgICAiLngueC54Li4iCisg ICAgICAiLi54LngueC4iCisgICAgICAiLi4ueC54LngiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY190cmlwbGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxNSwgMHgyYSwgMHg1NCwg MHhhOCwgMHg1NCwgMHgyYSwgMHgxNX07CisKKy8qIDQxCisgICAgKCstZnJpbmdlLWhlbHBlci1o ZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4u Li4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54 Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi4uLi4uLi4u IgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikK KyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX3VwX2JpdHNbXSA9ewor ICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDgyLCAweDAwLCAw eDAwLCAweDAwLCAweDAwfTsKKworLyogNDIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNp bWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4i CisgICAgICAiLi4uLi4uLi4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisg ICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAg ICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0 YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHgw MCwgMHgwMCwgMHgwMCwgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwg MHgwMCwgMHgwMH07CisKKy8qIDQzCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAor ICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAg ICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAg InguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIngu Li4uLnguIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4u Li4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3VwX2JpdHNb XSA9eworICAweDAwLCAweDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAw eDQ0LCAweDgyLCAweDAwLCAweDAwLCAweDAwfTsKKworLyogNDQKKyAgICAoKy1mcmluZ2UtaGVs cGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAg ICAiLi4uLi4uLi4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAi Li54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54 LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4u Li4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3Vi bGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwgMHg4MiwgMHg0NCwg MHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwgMHgwMH07CisKKy8qIDQ1 CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAg ICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAg InguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIngu LnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4u LnguIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdHJp cGxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAw eDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyLCAweDAwfTsKKworLyogNDYKKyAgICAo Ky1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAieC4u Li4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4u eC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4i CisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisg ICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVwbGVf YW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0 NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMH07CisKKy8qIDQ3CisgICAgKCst ZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54 Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4u IgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgor ICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAg ICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hv cnQgbWNfcXVhZHJ1cGxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDEwLCAweDI4LCAweDQ0LCAw eDkyLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgy fTsKKworLyogNDgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4u Li4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4u eC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4i CisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisg ICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iKQorKi8K K3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAg MHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5 MiwgMHg0NCwgMHgyOCwgMHgxMH07CisKIC8qIE5PVEU6ICBUaGUgb3JkZXIgb2YgdGhlc2UgYml0 bWFwcyBtdXN0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ZiBub3QgcGFydGlh bCwgb3Igbm8gcGFydGlhbCBzcGVjIGlzIHByZXNlbnQsIHVzZSBub24tcGFydGlhbCBiaXRtYXAu ICovCitpbnQKK21jX2dldF9mcmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNwX09i amVjdCBiaXRtYXAsIGludCByaWdodF9wLCBpbnQgcGFydGlhbF9wKQoreworICBMaXNwX09iamVj dCBjbWFwLCBibTEgPSBRbmlsLCBibTIgPSBRbmlsLCBibTsKKyAgRU1BQ1NfSU5UIGxuMSA9IDAs IGxuMiA9IDA7CisgIGludCBpeDEgPSByaWdodF9wOworICBpbnQgaXgyID0gaXgxICsgKHBhcnRp YWxfcCA/IDIgOiAwKTsKKyAgaWYgKChjbWFwID0gQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSksICFOSUxQIChjbWFwKSkKKyAgICB7CisgICAgICBi bTEgPSBtY19hc3NxIChiaXRtYXAsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibTEpKQorICB7 CisgICAgaWYgKChibTEgPSBYQ0RSIChibTEpKSwgTklMUCAoYm0xKSkKKyAgICAgIHJldHVybiBN Q19OT19GUklOR0VfQklUTUFQOworICAgIGlmIChDT05TUCAoYm0xKSkKKyAgICAgIHsKKyAgICAg ICAgbG4xID0gWEZJWE5VTSAoRmxlbmd0aCAoYm0xKSk7CisgICAgICAgIGlmIChwYXJ0aWFsX3Ap CisgICAgICAgICAgeworICAgICAgICAgICAgaWYgKGxuMSA+IGl4MikKKyAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMSk7CisgICAgICAgICAgICAg ICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAg ICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBpZiAobG4xID4gaXgxKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICAgICAgICAgICAgICBpZiAo IUVRIChibSwgUXQpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgIH0KKyAgICBlbHNlIGlmICgoYm0gPSBibTEs ICFFUSAoYm0sIFF0KSkpCisgICAgICBnb3RvIGZvdW5kOworICB9CisgICAgfQorICBpZiAoIUVR IChjbWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkK KyAgICAgICYmICFOSUxQIChCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9y X2FsaXN0KSkpCisgICAgeworICAgICAgYm0yID0gbWNfYXNzcSAoYml0bWFwLCBCVkFSICgmYnVm ZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSk7CisgICAgICBpZiAoQ09OU1Ag KGJtMikpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoKGJtMiA9IFhDRFIgKGJtMikpLCAhTklM UCAoYm0yKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKENPTlNQIChibTIpKQor ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGxuMiA9IFhGSVhOVU0gKEZsZW5n dGggKGJtMikpOworICAgICAgICAgICAgICAgICAgaWYgKHBhcnRpYWxfcCkKKyAgICAgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGlmIChsbjIgPiBpeDIpCisgICAgICAg ICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRo IChpeDIsIGJtMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4MSkKKyAgICB7Cisg ICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAg ICAgICAgZ290byBmb3VuZDsKKyAgICB9CisgIGlmIChsbjIgPiBpeDEpCisgICAgeworICAgICAg Ym0gPSBtY19udGggKGl4MSwgYm0yKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAg IGdvdG8gZm91bmQ7CisgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICB9Cisg ICAgZWxzZSBpZiAoKGJtID0gYm0yLCBOSUxQIChibSkpKQorICAgICAgcmV0dXJuIE1DX05PX0ZS SU5HRV9CSVRNQVA7CisgIGZvdW5kOgorICByZXR1cm4gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJt KTsKK30KKworc3RhdGljIGludAorbWNfZ2V0X2xvZ2ljYWxfY3Vyc29yX2JpdG1hcCAoc3RydWN0 IHdpbmRvdyAqdywgTGlzcF9PYmplY3QgY3Vyc29yKQoreworICBMaXNwX09iamVjdCBjbWFwLCBi bSA9IFFuaWw7CisgIGlmICgoY21hcCA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZnJp bmdlX2N1cnNvcl9hbGlzdCkpLCAhTklMUCAoY21hcCkpCisgICAgeworICAgICAgYm0gPSBtY19h c3NxIChjdXJzb3IsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibSkpCisgICAgICAgIHsKKyAg ICAgICAgICBpZiAoKGJtID0gWENEUiAoYm0pKSwgTklMUCAoYm0pKQor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yIG5vdCkKKyAgKEwgUiBQTCBQUikgIC0tIHVzZSBmb3IgbGVmdCByaWdo dCBwYXJ0aWFsLWxlZnQgcGFydGlhbC1yaWdodAorICBJZiBhbnkgdmFsdWUgaW4gbG9jYWwgYmlu ZGluZyBpcyBub3QgcHJlc2VudCBvciB0LCB1c2UgZ2xvYmFsIHZhbHVlLgorICAgICBJZiBwYXJ0 aWFsLCBsb29rdXAgcGFydGlhbCBiaXRtYXAgaW4gZGVmYXVsdCB2YWx1ZSBpZiBub3QgZm91bmQg aGVyZS4KKyAgICAgSWYgbm90IHBhcnRpYWwsIG9yIG5vIHBhcnRpYWwgc3BlYyBpcyBwcmVzZW50 LCB1c2Ugbm9uLXBhcnRpYWwgYml0bWFwLiAgKi8KKyAgaWYgKChjbWFwID0gQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSksICFOSUxQIChjbWFwKSkK KyAgICB7CisgICAgICBibTEgPSBtY19hc3NxIChiaXRtYXAsIGNtYXApOworICAgICAgaWYgKENP TlNQIChibTEpKQorICAgICAgICB7CisgICAgICAgICAgaWYgKChibTEgPSBYQ0RSIChibTEpKSwg TklMUCAoYm0xKSkKKyAgICAgICAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICAg ICAgICAgIGlmIChDT05TUCAoYm0xKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbG4x ID0gWEZJWE5VTSAoRmxlbmd0aCAoYm0xKSk7CisgICAgICAgICAgICAgIGlmIChwYXJ0aWFsX3Ap CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKGxuMSA+IGl4MikKKyAg ICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChp eDIsIGJtMSk7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAg ICAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICBpZiAobG4xID4gaXgxKQorICAgICAgICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7Cisg ICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICAgICAgICAg ICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKChibSA9IGJt MSwgIUVRIChibSwgUXQpKSkKKyAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgfQor ICAgIH0KKyAgaWYgKCFFUSAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2lu ZGljYXRvcl9hbGlzdCkpCisgICAgICAmJiAhTklMUCAoQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywg ZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpKQorICAgIHsKKyAgICAgIGJtMiA9IG1jX2Fzc3EgKGJp dG1hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpOwor ICAgICAgaWYgKENPTlNQIChibTIpKQorICAgICAgICB7CisgICAgICAgICAgaWYgKChibTIgPSBY Q0RSIChibTIpKSwgIU5JTFAgKGJtMikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlm IChDT05TUCAoYm0yKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBsbjIg PSBYRklYTlVNIChGbGVuZ3RoIChibTIpKTsKKyAgICAgICAgICAgICAgICAgIGlmIChwYXJ0aWFs X3ApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAobG4y ID4gaXgyKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAg ICAgICBibSA9IG1jX250aCAoaXgyLCBibTIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBp ZiAoIUVRIChibSwgUXQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7 CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGlmIChsbjEg PiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsKKyAgICAgIGlmICgh RVEgKGJtLCBRdCkpCisgICAgICAgIGdvdG8gZm91bmQ7CisgICAgfQorICBpZiAobG4yID4gaXgx KQorICAgIHsKKyAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMik7CisgICAgICBpZiAoIUVRIChi bSwgUXQpKQorICAgICAgICBnb3RvIGZvdW5kOworICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9C SVRNQVA7CisgICAgfQorICAgIGVsc2UgaWYgKChibSA9IGJtMiwgTklMUCAoYm0pKSkKKyAgICAg IHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICBmb3VuZDoKKyAgcmV0dXJuIGxvb2t1cF9m cmluZ2VfYml0bWFwIChibSk7Cit9CisKKy8qIFJlY2FsY3VsYXRlIHRoZSBiaXRtYXBzIHRvIHNo b3cgaW4gdGhlIGZyaW5nZXMgb2Ygd2luZG93IFcuCisgICBPbmx5IG1hcmsgcm93cyB3aXRoIG1v ZGlmaWVkIGJpdG1hcHMgZm9yIHVwZGF0ZSBpbiByZWRyYXdfZnJpbmdlX2JpdG1hcHNfcC4KKyAg IElmIEtFRVBfQ1VSUkVOVF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96dl9wIE1DX0lG X0xJTlQgKD0gMCksIGJvdF9yb3dfZW5kc19hdF96dl9wIE1DX0lGX0xJTlQgKD0gMCk7CisgIGlm ICh3LT5wc2V1ZG9fd2luZG93X3ApCisgICAgcmV0dXJuIDA7CisgIGlmICghTUlOSV9XSU5ET1df UCAodykKKyAgICAgICYmIChpbmQgPSBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGluZGlj YXRlX2J1ZmZlcl9ib3VuZGFyaWVzKSwgIU5JTFAgKGluZCkpKQorICAgIHsKKyAgICAgIGlmIChF USAoaW5kLCBRbGVmdCkgfHwgRVEgKGluZCwgUXJpZ2h0KSkKKyAgICAgICAgYm91bmRhcnlfdG9w ID0gYm91bmRhcnlfYm90ID0gYXJyb3dfdG9wID0gYXJyb3dfYm90ID0gaW5kOworICAgICAgICBl bHNlIGlmIChDT05TUCAoaW5kKQorICAgICAgICAgICAgICAgICAmJiBDT05TUCAoWENBUiAoaW5k KSkpCisgICAgICAgIHsKKyAgICAgICAgICBMaXNwX09iamVjdCBwb3M7CisgICAgICAgICAgaWYg KHBvcyA9IG1jX2Fzc3EgKFF0LCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAgIGJvdW5k YXJ5X3RvcCA9IGJvdW5kYXJ5X2JvdCA9IGFycm93X3RvcCA9IGFycm93X2JvdCA9IFhDRFIgKHBv cyk7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFF0b3AsIGluZCksICFOSUxQIChwb3Mp KQorICAgICAgICAgICAgYm91bmRhcnlfdG9wID0gWENEUiAocG9zKTsKKyAgICAgICAgICBpZiAo cG9zID0gbWNfYXNzcSAoUWJvdHRvbSwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBi b3VuZGFyeV9ib3QgPSBYQ0RSIChwb3MpOworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChR dXAsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAgYXJyb3dfdG9wID0gWENEUiAocG9z KTsKKyAgICAgICAgICBpZiAocG9zID0gbWNfYXNzcSAoUWRvd24sIGluZCksICFOSUxQIChwb3Mp KQorICAgICAgICAgICAgYXJyb3dfYm90ID0gWENEUiAocG9zKTsKKyAgICAgICAgfQorICAgICAg ICBlbHNlCisgICAgICAgICAgLyogQW55dGhpbmcgZWxzZSBtZWFucyBib3VuZGFyeSBvbiBsZWZ0 IGFuZCBubyBhcnJvd3MuICAqLworICAgICAgICAgIGJvdW5kYXJ5X3RvcCA9IGJvdW5kYXJ5X2Jv dCA9IFFsZWZ0OworICAgIH0KKyAgdG9wX2luZF9ybiA9IGJvdF9pbmRfcm4gPSAtMTsKKyAgaWYg KCFOSUxQIChpbmQpKQorICAgIHsKKyAgICAgIGZvciAoeSA9IHctPnZzY3JvbGwsIHJuID0gMDsK KyAgICAgICAgICAgeSA8IHliICYmIHJuIDwgbnJvd3M7CisgICAgICAgICAgIHkgKz0gcm93LT5o ZWlnaHQsICsrcm4pCisgICAgICAgIHsKKyAgICAgICAgICByb3cgPSB3LT5kZXNpcmVkX21hdHJp eC0+cm93cyArIHJuOworICAgICAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgICAg ICByb3cgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgIHJvdy0+aW5k aWNhdGVfYm9iX3AgPSByb3ctPmluZGljYXRlX3RvcF9saW5lX3AgPSAwOworICAgICAgICAgIHJv dy0+aW5kaWNhdGVfZW9iX3AgPSByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgPSAwOworICAg ICAgICAgIGlmICghcm93LT5tb2RlX2xpbmVfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgaWYgKHRvcF9pbmRfcm4gPCAwICYmIHJvdy0+dmlzaWJsZV9oZWlnaHQgPiAwKQorICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChNQVRSSVhfUk9XX1NUQVJUX0NIQVJQ T1MgKHJvdykgPD0gQlVGX0JFR1YgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSkKKyAgICAgICAgICAg ICAgICAgICAgICAmJiAhTUFUUklYX1JPV19QQVJUSUFMTFlfVklTSUJMRV9BVF9UT1BfUCAodywg cm93KSkKKyAgICAgICAgICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib2JfcCA9ICFOSUxQIChi b3VuZGFyeV90b3ApOworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg ICAgICAgcm93LT5pbmRpY2F0ZV90b3BfbGluZV9wID0gIU5JTFAgKGFycm93X3RvcCk7CisgICAg ICAgICAgICAgICAgICB0b3BfaW5kX3JuID0gcm47CisgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICBpZiAoYm90X2luZF9ybiA8IDApCisgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgaWYgKE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgPj0gQlVGX1pWIChYQlVG RkVSICh3LT5jb250ZW50cykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU1BVFJJWF9ST1df UEFSVElBTExZX1ZJU0lCTEVfQVRfQk9UVE9NX1AgKHcsIHJvdykpCisgICAgICAgICAgICAgICAg ICAgIHJvdy0+aW5kaWNhdGVfZW9iX3AgPSAhTklMUCAoYm91bmRhcnlfYm90KSwgYm90X2luZF9y biA9IHJuOworICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh5ICsgcm93LT5oZWlnaHQgPj0g eWIpCisgICAgICAgICAgICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wID0g IU5JTFAgKGFycm93X2JvdCksIGJvdF9pbmRfcm4gPSBybjsKKyAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGVtcHR5X3BvcyA9IEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzK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byBhZGphY2VudCByb3dzIGlmIGl0IGRvZXNuJ3QgZml0 IGluIG9uZSByb3cuICAqLworICB0b3BfaW5kX21pbl95ID0gYm90X2luZF9tYXhfeSA9IC0xOwor ICBpZiAodG9wX2luZF9ybiA+PSAwKQorICAgIHsKKyAgICAgIGludCBibiA9IE1DX05PX0ZSSU5H RV9CSVRNQVA7CisgICAgICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHRvcF9pbmRf cm47CisgICAgICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICByb3cgPSB3LT5jdXJyZW50 X21hdHJpeC0+cm93cyArIHRvcF9pbmRfcm47CisgICAgICB0b3Bfcm93X2VuZHNfYXRfenZfcCA9 IHJvdy0+ZW5kc19hdF96dl9wOworICAgICAgaWYgKHJvdy0+aW5kaWNhdGVfYm9iX3ApCisgICAg ICAgIHsKKyAgICAgICAgICBpZiAoRVEgKGJvdW5kYXJ5X3RvcCwgUWxlZnQpKQorICAgICAgICAg ICAgYm4gPSAoKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQp KQorICAgICAgICAgICAgICAgICAgPyBNQ19MRUZUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJv dy0+ZW5kc19hdF96dl9wKQorICAgICAgICAgICAgICAgICAgOiBNQ19MRUZUX0ZSSU5HRSAoMiwg UXRvcCwgMCkpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBibiA9ICgocm93LT5p bmRpY2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICAgICAg ICAgICAgICA/IE1DX1JJR0hUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ZW5kc19hdF96 dl9wKQorICAgICAgICAgICAgICAgICAgICA6IE1DX1JJR0hUX0ZSSU5HRSAoMiwgUXRvcCwgMCkp OworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCkK KyAgICAgICAgICB7CisgICAgICAgICAgICBpZiAoRVEgKGFycm93X3RvcCwgUWxlZnQpKQorICAg ICAgICAgICAgICBibiA9IE1DX0xFRlRfRlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDYsIFF1cCwgMCk7 CisgICAgICAgICAgfQorICAgICAgaWYgKGJuICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAg ICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZnJpbmdlX2JpdG1hcCAqZmIgPSBnZXRfZnJpbmdlX2Jp dG1hcF9kYXRhIChibik7CisgICAgICAgICAgaWYgKGZiLT5hbGlnbiA9PSBBTElHTl9CSVRNQVBf VE9QICYmIGZiLT5wZXJpb2QgPT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgc3Ry dWN0IGdseXBoX3JvdyAqcm93MTsKKyAgICAgICAgICAgICAgaW50IHRvcF9pbmRfbWF4X3k7Cisg ICAgICAgICAgICAgIHRvcF9pbmRfbWluX3kgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3 KTsKKyAgICAgICAgICAgICAgdG9wX2luZF9tYXhfeSA9IHRvcF9pbmRfbWluX3kgKyBmYi0+aGVp Z2h0OworICAgICAgICAgICAgICBpZiAodG9wX2luZF9tYXhfeSA+IHliKQorICAgICAgICAgICAg ICAgIHRvcF9pbmRfbWF4X3kgPSB5YjsKKyAgICAgICAgICAgICAgZm9yICh5ID0gcm93LT55ICsg cm93LT5oZWlnaHQsIHJuID0gdG9wX2luZF9ybiArIDE7CisgICAgICAgICAgICAgICAgICAgeSA8 IHRvcF9pbmRfbWF4X3kgJiYgcm4gPCBucm93czsKKyAgICAgICAgICAgICAgICAgICB5ICs9IHJv dzEtPmhlaWdodCwgcm4rKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBp ZiAoYm90X2luZF9ybiA+PSAwICYmIHJuID49IGJvdF9pbmRfcm4pCisgICAgICAgICAgICAgICAg ICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgcm93MSA9IHctPmRlc2lyZWRfbWF0cml4LT5y b3dzICsgcm47CisgICAgICAgICAgICAgICAgICBpZiAoIXJvdzEtPmVuYWJsZWRfcCkKKyAgICAg ICAgICAgICAgICAgICAgcm93MSA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAg ICAgICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV9ib2JfcCA9IHJvdy0+aW5kaWNhdGVfYm9iX3A7 CisgICAgICAgICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV90b3BfbGluZV9wID0gcm93LT5pbmRp Y2F0ZV90b3BfbGluZV9wOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAg ICAgfQorICAgIH0KKyAgaWYgKGJvdF9pbmRfcm4gPj0gMCkKKyAgICB7CisgICAgICBpbnQgYm4g PSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgcm93ID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJv d3MgKyBib3RfaW5kX3JuOworICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgcm93 ID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBib3RfaW5kX3JuOworICAgICAgYm90X3Jvd19l bmRzX2F0X3p2X3AgPSByb3ctPmVuZHNfYXRfenZfcDsKKyAgICAgIGlmIChyb3ctPmluZGljYXRl X2VvYl9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKEVRIChib3VuZGFyeV9ib3QsIFFsZWZ0 KSkKKyAgICAgICAgICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDMsIFFib3R0b20sIHJvdy0+ZW5k c19hdF96dl9wKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgYm4gPSBNQ19SSUdI VF9GUklOR0UgKDMsIFFib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKTsKKyAgICAgICAgfQorICAg ICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3ApCisgICAgICAgICAgewor ICAgICAgICAgICAgaWYgKEVRIChhcnJvd19ib3QsIFFsZWZ0KSkKKyAgICAgICAgICAgICAgYm4g PSBNQ19MRUZUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAg ICB9CisgICAgICBpZiAoYm4gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgeworICAg ICAgICAgIHN0cnVjdCBmcmluZ2VfYml0bWFwICpmYiA9IGdldF9mcmluZ2VfYml0bWFwX2RhdGEg KGJuKTsKKyAgICAgICAgICBpZiAoZmItPmFsaWduID09IEFMSUdOX0JJVE1BUF9CT1RUT00gJiYg ZmItPnBlcmlvZCA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5 cGhfcm93ICpyb3cxOworICAgICAgICAgICAgICBpbnQgYm90X2luZF9taW5feTsKKyAgICAgICAg ICAgICAgYm90X2luZF9tYXhfeSA9IHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQ7CisgICAg ICAgICAgICAgIGJvdF9pbmRfbWluX3kgPSBib3RfaW5kX21heF95IC0gZmItPmhlaWdodDsKKyAg ICAgICAgICAgICAgaWYgKGJvdF9pbmRfbWluX3kgPCBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hU ICh3KSkKKyAgICAgICAgICAgICAgICBib3RfaW5kX21pbl95ID0gV0lORE9XX0hFQURFUl9MSU5F X0hFSUdIVCAodyk7CisgICAgICAgICAgICAgIGZvciAoeSA9IHJvdy0+eSwgcm4gPSBib3RfaW5k X3JuIC0gMTsKKyAgICAgICAgICAgICAgICAgICB5ID49IGJvdF9pbmRfbWluX3kgJiYgcm4gPj0g MDsKKyAgICAgICAgICAgICAgICAgICB5IC09IHJvdzEtPmhlaWdodCwgcm4tLSkKKyAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAodG9wX2luZF9ybiA+PSAwICYmIHJuIDw9 IHRvcF9pbmRfcm4pCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAg ICAgcm93MSA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICAgICAg ICBpZiAoIXJvdzEtPmVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgcm93MSA9IHctPmN1 cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICAgICAgICByb3cxLT5pbmRpY2F0 ZV9lb2JfcCA9IHJvdy0+aW5kaWNhdGVfZW9iX3A7CisgICAgICAgICAgICAgICAgICByb3cxLT5p bmRpY2F0ZV9ib3R0b21fbGluZV9wID0gcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wOworICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgTGlzcF9P YmplY3QgYnVmID0gdy0+Y29udGVudHM7CisgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgYm9vbCBh dXRvX2hzY3JvbGxfbW9kZV9wID0gRVEgKEZidWZmZXJfbG9jYWxfdmFsdWUgKFFhdXRvX2hzY3Jv bGxfbW9kZSwgYnVmKSwgUWN1cnJlbnRfbGluZSk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxl ZnQgNSkgKi8KKyAgYm9vbCBoc2NsX2FsbF90ZW1wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3Jv bGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBD LXggPCBhbmQgZG8gbm90aGluZy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBfcCA9ICh3LT5z dXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9f aHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xs ID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3Jv bGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgZWxzZSBiZXNp ZGVzIGhvcml6b250YWxseSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IGxp bmUgZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9y aXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1f MV9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9o c2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xs ID09IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAuLi4KKyAgICAg ICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlm ZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1c3BlbmRfYXV0 b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21v ZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPT0gMAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICAv KiBFWEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxlZnQgYXJy b3cga2V5IG9uZSB0aW1lLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpv bnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1wX3AgPSAoIXct PnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Ny b2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6 ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVudCBsaW5l IHRvIGJlCisgICAgICAgICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHku CisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQg ZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3BlbmRfYXV0b19o c2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWlu X2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ ZnJhbWUpOworICBmb3IgKHkgPSB3LT52c2Nyb2xsLCBybiA9IDA7CisgICAgICAgeSA8IHliICYm IHJuIDwgbnJvd3M7CisgICAgICAgeSArPSByb3ctPmhlaWdodCwgcm4rKykKKyAgICB7CisgIGlu dCBsZWZ0LCByaWdodDsKKyAgdW5zaWduZWQgbGVmdF9mYWNlX2lkLCByaWdodF9mYWNlX2lkOwor ICBpbnQgbGVmdF9vZmZzZXQsIHJpZ2h0X29mZnNldDsKKyAgYm9vbCBwZXJpb2RpY19wOworICBy b3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJuOworICBjdXIgPSB3LT5jdXJyZW50X21h dHJpeC0+cm93cyArIHJuOworICBpbnQgdm50aF9kbSA9IE1BVFJJWF9ST1dfVlBPUyAody0+ZGVz aXJlZF9tYXRyaXgtPnJvd3MgKyBybiwgdy0+ZGVzaXJlZF9tYXRyaXgpOworICBpbnQgdm50aF9j bSA9IE1BVFJJWF9ST1dfVlBPUyAody0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBybiwgdy0+Y3Vy cmVudF9tYXRyaXgpOworICBlbnVtIG1jX3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24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jaGVfdHlwZV1bbnRoXS52cG9zOworICAgICAgLy8gIGlu dCB3ZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhfY21dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0u d2Q7CisgICAgICAvLyAgaW50IGggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoX2NtXS5jYWNoZVtj YWNoZV90eXBlXVtudGhdLmg7CisgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBl ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF9jbV0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5jdXJz b3JfdHlwZTsKKyAgICAgIC8vICBpbnQgY3Vyc29yX3dpZHRoID0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF9jbV0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5jdXJzb3Jfd2lkdGg7CisgICAgICAvLyAg c3RydWN0IG1jX1JHQiBsc2xfZmcgPSB7LnJlZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhfY21d LmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcucmVkLAorICAgICAgLy8gICAgICAgICAgICAgICAg ICAgICAgICAgIC5ncmVlbiA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhfY21dLmNhY2hlW2NhY2hl X3R5cGVdW250aF0uZmcuZ3JlZW4sCisgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAg LmJsdWUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoX2NtXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmZnLmJsdWV9OworICAgICAgLy8gIHN0cnVjdCBtY19SR0IgbHNsX2JnID0gey5yZWQgPSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoX2NtXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLnJlZCwKKyAg ICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSB3LT5tY19tYXRyaXgudnBv c1t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ZV9pZCA9CisgICAgICAgICAgICAoIWFj dGl2ZV9wCisgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgY2hfaW5hY3RpdmVfd2luZG93cykpKQorICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWluYWN0aXZlLXByZS16di1mYWNlIiks IHRydWUpCisgICAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgPyBsb29rdXBf bmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LXByZS16di1mYWNlIiks IHRydWUpCisgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBtY19sZWZ0 X2ZyaW5nZV9mYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNl X2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9J RDsKKyAgICAgICAgICBpZiAody0+aHNjcm9sbCAhPSAwKQorICAgICAgICAgICAgZnJpbmdlX2Jp dG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ci KSwgZmFsc2UsIHRydWUpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBmcmluZ2Vf Yml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJv dyIpLCB0cnVlLCB0cnVlKTsKKyAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vy c29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICB9CisgICAgICAgIGVsc2Ug aWYgKCh2cG9zID09IHZudGhfZG0gfHwgdnBvcyA9PSB2bnRoX2NtKQorICAgICAgICAgICAgICAg ICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICAgICAg ICAgICAgJiYgKGhzY2xfYWxsX3RlbXBfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF9h bGxfcGVybV8wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMV9wCisg ICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAgICAgICAgICAgICAg ICAgICAgfHwgaHNjbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfcGVybV9w KQorICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgeworICAgICAgICAg ICAgaW50IGZyaW5nZV9iaXRtYXAgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgICAg ZW51bSBmYWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgICAgICghYWN0 aXZlX3AKKyAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRf ZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5hY3RpdmUtcHJlLXp2 LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgOiAoYWN0aXZlX3ApCisgICAgICAgICAgICAg ICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhz Y2wtcHJlLXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7 CisgICAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1D X0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBvdmVybGF5X2Fycm93X2ZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgICBpZiAoaHNjbF9hbGxfcGVy bV8wX3ApCisgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1h cCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAg ICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8xX3ApCisgICAgICAgICAgICAgICAgZnJpbmdlX2Jp dG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCB0 cnVlLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8yX3Ap CisgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAg KHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIGZhbHNlLCB0cnVlKTsKKyAgICAgICAgICAgICAg ICAgIGVsc2UgaWYgKGhzY2xfcGVybV9wKQorICAgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0 bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIHRy dWUsIHRydWUpOworICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF90ZW1wX3Ap CisgICAgICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0 bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtdGVtcCIpLCBmYWxzZSwgZmFsc2UpOworICAgICAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfdGVtcF9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhz Y2wtdGVtcCIpLCB0cnVlLCBmYWxzZSk7CisgICAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9iaXRt YXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICB9 CisgICAgICAgICAgZWxzZSBpZiAoKHZwb3MgPT0gdm50aF9kbSB8fCB2cG9zID09IHZudGhfY20p CisgICAgICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RB TkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9y ID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAg ICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAg ICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJ R0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNf UkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAg ICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAg ICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAg ICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tT TEFTSCkKKyAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBMaXNwX09iamVjdCBiaXRtYXBfZmxhdm9yID0gKGdseXBoX2ZsYXZvciA9 PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBRbWNfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9y ID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX2hvbGxvd19y ZWN0YW5nbGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xl CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2 b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3cKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9 PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9y aWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo Z2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURf VkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IFFtY19yZXZlcnNlZF92ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NM QVNIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192 ZXJ0aWNhbF9iYXJfYmFja3NsYXNoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IFFuaWw7CisgICAgICAgICAgICAgIG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXAgPSAo Y3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9mcmluZ2VfYml0bWFwIChiaXRtYXBfZmxh dm9yKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJ TkdFX0JJVE1BUDsKKyAgICAgICAgICAgICAgbWNfcmlnaHRfZnJpbmdlX2ZhY2VfaWQgPQorICAg ICAgICAgICAgICAgIChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAg ICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYKKyAgICAgICAgICAgICAgICAg JiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FS Uk9XCisgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURf VkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9m bGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKSkKKyAgICAgICAgICAgICAgICAgID8g bG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmV2ZXJzZWQtYmFyLXByZS16di1m YWNlIiksIHRydWUpCisgICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRf RlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBBVF9a VgorICAgICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9M TE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAg ICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9C QVIpKQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJu ICgiKy1yZXZlcnNlZC1iYXItYXQtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgIDog KGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAg ICAmJiByb3dfcG9zaXRpb24gPT0gUE9TVF9aVgorICAgICAgICAgICAgICAgICAgICYmIChnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAg ICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAgICAgICAgICAgPyBsb29r dXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1iYXItcG9zdC16di1mYWNl IiksIHRydWUpCisgICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJ TkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYK KyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9X X1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZv ciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAg ICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAg ICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1iYXItcHJl LXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19S SUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09 IEFUX1pWCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VE X0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlw aF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAg ICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikK KyAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIist YmFyLWF0LXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9 PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0 aW9uID09IFBPU1RfWlYKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNf UkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAg ICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cK KyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSKQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1iYXItcG9zdC16di1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgICAgOiBERUZB VUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlmICghcm93LT5l bmFibGVkX3ApCisgICAgICAgIHJvdyA9IGN1cjsKKyAgICAgIGxlZnRfZmFjZV9pZCA9IHJpZ2h0 X2ZhY2VfaWQgPSBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICBsZWZ0X29mZnNldCA9IHJpZ2h0X29m ZnNldCA9IDA7CisgICAgICBwZXJpb2RpY19wID0gMDsKKyAgICAgIC8qIERlY2lkZSB3aGljaCBi aXRtYXAgdG8gZHJhdyBpbiB0aGUgbGVmdCBmcmluZ2UuICAqLworICAgICAgaWYgKFdJTkRPV19M RUZUX0ZSSU5HRV9XSURUSCAodykgPT0gMCkKKyAgICAgICAgbGVmdCA9IE1DX05PX0ZSSU5HRV9C SVRNQVA7CisgICAgICBlbHNlIGlmIChyb3ctPmxlZnRfdXNlcl9mcmluZ2VfYml0bWFwICE9IE1D X05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHsKKyAgICAgICAgICBsZWZ0ID0gcm93LT5sZWZ0 X3VzZXJfZnJpbmdlX2JpdG1hcDsKKyAgICAgICAgICBsZWZ0X2ZhY2VfaWQgPSByb3ctPmxlZnRf dXNlcl9mcmluZ2VfZmFjZV9pZDsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAoKCFyb3ctPnJl dmVyc2VkX3AgJiYgcm93LT50cnVuY2F0ZWRfb25fbGVmdF9wKQorICAgICAgICAgICAgICAgfHwg KHJvdy0+cmV2ZXJzZWRfcCAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKSkKKyAgICAgICAg bGVmdCA9IE1DX0xFRlRfRlJJTkdFICgwLCBRdHJ1bmNhdGlvbiwgMCk7CisgICAgICBlbHNlIGlm IChyb3ctPmluZGljYXRlX2JvYl9wICYmIEVRIChib3VuZGFyeV90b3AsIFFsZWZ0KSkKKyAgICAg ICAgeworICAgICAgICAgIGxlZnQgPSAoKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5k YXJ5X2JvdCwgUWxlZnQpKQorICAgICAgICAgICAgICAgICA/IE1DX0xFRlRfRlJJTkdFICgxLCBR dG9wX2JvdHRvbSwgdG9wX3Jvd19lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgICAgIDogTUNf TEVGVF9GUklOR0UgKDIsIFF0b3AsIDApKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5feSA+ PSAwKQorICAgICAgICAgICAgbGVmdF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55Owor ICAgICAgICB9CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3Vu ZGFyeV9ib3QsIFFsZWZ0KSkKKyAgICAgICAgeworICAgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZS SU5HRSAoMywgUWJvdHRvbSwgYm90X3Jvd19lbmRzX2F0X3p2X3ApOworICAgICAgICAgIGlmIChi b3RfaW5kX21heF95ID49IDApCisgICAgICAgICAgICBsZWZ0X29mZnNldCA9IGJvdF9pbmRfbWF4 X3kgLSAocm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgIH0KKyAgICAgIGVs c2UgaWYgKCghcm93LT5yZXZlcnNlZF9wICYmIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVf UCAocm93KSkKKyAgICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jb250 aW51ZWRfcCkpCisgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNCwgUWNvbnRpbnVhdGlv biwgMCk7CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VtcHR5X2xpbmVfcCAmJiBFUSAo ZW1wdHlfcG9zLCBRbGVmdCkpCisgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNSwgUWVt cHR5X2xpbmUsIDApOworICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGluZV9wICYm IEVRIChhcnJvd190b3AsIFFsZWZ0KSkKKyAgICAgICAgeworICAgICAgICAgIGxlZnQgPSBNQ19M RUZUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5feSA+PSAw KQorICAgICAgICAgICAgbGVmdF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55OworICAg ICAgICB9CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgJiYgRVEg KGFycm93X2JvdCwgUWxlZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVmdCA9IE1DX0xFRlRf RlJJTkdFICg3LCBRZG93biwgMCk7CisgICAgICAgICAgaWYgKGJvdF9pbmRfbWF4X3kgPj0gMCkK KyAgICAgICAgICAgIGxlZnRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ct PnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAgICBsZWZ0ID0g TUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgIC8qIERlY2lkZSB3aGljaCBiaXRtYXAgdG8gZHJh dyBpbiB0aGUgcmlnaHQgZnJpbmdlLiAgKi8KKyAgICAgIGlmIChXSU5ET1dfUklHSFRfRlJJTkdF X1dJRFRIICh3KSA9PSAwKQorICAgICAgICByaWdodCA9IE1DX05PX0ZSSU5HRV9CSVR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ICAgeworICAgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJ TkdFICgzLCBRYm90dG9tLCBib3Rfcm93X2VuZHNfYXRfenZfcCk7CisgICAgICAgICAgaWYgKGJv dF9pbmRfbWF4X3kgPj0gMCkKKyAgICAgICAgICAgIHJpZ2h0X29mZnNldCA9IGJvdF9pbmRfbWF4 X3kgLSAocm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgIH0KKyAgICAgIGVs c2UgaWYgKCghcm93LT5yZXZlcnNlZF9wICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAg ICAgICB8fCAocm93LT5yZXZlcnNlZF9wICYmIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVf UCAocm93KSkpCisgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICg0LCBRY29udGludWF0 aW9uLCAwKTsKKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCAmJiBFUSAo YXJyb3dfdG9wLCBRcmlnaHQpKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQgPSBNQ19SSUdI VF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAgICAgICAgaWYgKHRvcF9pbmRfbWluX3kgPj0gMCkK KyAgICAgICAgICAgIHJpZ2h0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSByb3ctPnk7CisgICAg ICAgIH0KKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCAmJiBFUSAo YXJyb3dfYm90LCBRcmlnaHQpKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQgPSBNQ19SSUdI VF9GUklOR0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAw KQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChyb3ctPnkgKyBy b3ctPnZpc2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lX2JpdG1hcF9wZXJpb2RpY19wCisgICAg ICAgICAgfHwgY3VyLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCkKKyAgICAgICAgeworICAgICAg ICAgIHJlZHJhd19wID0gMSwgcm93LT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7CisgICAg ICAgICAgaWYgKCFrZWVwX2N1cnJlbnRfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg Y3VyLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAgICAgIGlmIChtY19s ZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAg ICAgfHwgbWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAg ICAgICAgICAgICAgIGN1ci0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAg ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5mcmluZ2VfYml0bWFwX3Bl cmlvZGljX3AgPSBwZXJpb2RpY19wOworICAgICAgICAgICAgICBpZiAobWNfbGVmdF9mcmluZ2Vf Yml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5sZWZ0 X2ZyaW5nZV9iaXRtYXAgPSBtY19sZWZ0X2ZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSBsZWZ0Owor ICAgICAgICAgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9C SVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gbWNfbGVm dF9mcmluZ2VfZmFj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AgICAgIGVsc2UK KyAgICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldCA9IHJpZ2h0X29mZnNl dDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHJvdy0+b3ZlcmxheV9hcnJv d19iaXRtYXAgPCAwKQorICAgICAgICByb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwID0gbWNfZ2V0 X2xvZ2ljYWxfZnJpbmdlX2JpdG1hcCAodywgUW92ZXJsYXlfYXJyb3csIDAsIDApOworICAgICAg aWYgKHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgIT0gY3VyLT5vdmVybGF5X2Fycm93X2JpdG1h cCkKKyAgICAgICAgeworICAgICAgICAgIHJlZHJhd19wID0gMSwgcm93LT5yZWRyYXdfZnJpbmdl X2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAgaWYgKCFrZWVwX2N1cnJlbnRfcCkKKyAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgY3VyLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7Cisg ICAgICAgICAgICAgIGN1ci0+b3ZlcmxheV9hcnJvd19iaXRtYXAgPSByb3ctPm92ZXJsYXlfYXJy b3dfYml0bWFwOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAobWNfbGVmdF9m cmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICB8fCBtY19yaWdo dF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHJvdy0+ZnJp bmdlX2JpdG1hcF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgIGVsc2UKKyAgICAgICAgICBy b3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IHBlcmlvZGljX3A7CisgICAgICBpZiAobWNf bGVmdF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5H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biB3ZSBh bGxvdyB3aW5kb3cgbG9jYWwKKyAgICAgICAgICAgICAgIHJpZ2h0IGRpdmlkZXJzIC0gYnV0IHRo ZSB3aW5kb3cgb24gdGhlIGxlZnQgaXMgaGFyZAorICAgICAgICAgICAgICAgdG8gZ2V0LiAgKi8K KyAgICAgICAgICAgICYmICFGUkFNRV9SSUdIVF9ESVZJREVSX1dJRFRIIChmKQorICAgICAgICAg ICAgJiYgIVdJTkRPV19IQVNfVkVSVElDQUxfU0NST0xMX0JBUiAodykKKyAgICAgICAgICAgIC8q IEJ1dCBkb24ndCByZWR1Y2UgdGhlIGZyaW5nZSB3aWR0aCBpZiB0aGUgd2luZG93CisgICAgICAg ICAgICAgICBoYXMgYSBsZWZ0IG1hcmdpbiwgYmVjYXVzZSB0aGF0IG1lYW5zIHdlIGFyZSBub3QK KyAgICAgICAgICAgICAgIGluIGRhbmdlciBvZiBkcmF3aW5nIG92ZXIgdGhlIHZlcnRpY2FsIGJv cmRlciwKKyAgICAgICAgICAgICAgIGFuZCBPVE9IIGxlYXZpbmcgb3V0IHRoYXQgb25lIHBpeGVs IGxlYXZlcyBiZWhpbmQKKyAgICAgICAgICAgICAgIHRyYWNlcyBvZiB0aGUgY3Vyc29yLCBpZiBp dCB3YXMgaW4gY29sdW1uIHplcm8KKyAgICAgICAgICAgICAgIGJlZm9yZSBkcmF3aW5nIG5vbi1l bXB0eSBtYXJnaW4gYXJlYS4gICovCisgICAgICAgICAgICAmJiB3LT5sZWZ0X21hcmdpbl9jb2xz ID09IDApCisgICAgICAgICAgID8gMSA6IDApOworICAgICAgICAgIHAuYnggPSB4IC0gd2Q7Cisg ICAgICAgICAgcC5ueCA9IHdkOworICAgICAgICB9CisgICAgfQorICBlbHNlCisgICAgeworICAg ICAgaW50IHggPSB3aW5kb3dfYm94X3JpZ2h0ICh3LAorICAgICAgICAoV0lORE9XX0hBU19GUklO R0VTX09VVFNJREVfTUFSR0lOUyAodykKKyAgICAgICAgID8gUklHSFRfTUFSR0lOX0FSRUEKKyAg ICAgICAgIDogVEVYVF9BUkVBKSk7CisgICAgICBpbnQgd2QgPSBXSU5ET1dfUklHSFRfRlJJTkdF X1dJRFRIICh3KTsKKyAgICAgIGlmIChwLndkID4gd2QpCisgICAgICAgIHAud2QgPSB3ZDsKKyAg ICAgIHAueCA9IHggKyAod2QgLSBwLndkKSAvIDI7CisgICAgICAvKiBDbGVhciByaWdodCBmcmlu Z2UgaWYgbm8gYml0bWFwIHRvIGRyYXcgb2YgaWYgYml0bWFwIGRvZXNuJ3QgZmlsbAorICAgdGhl IGZyaW5nZS4gICovCisgICAgICBpZiAocC53ZCA8IHdkIHx8IHAueSA+IHAuYnkgfHwgcC55ICsg cC5oIDwgcC5ieSArIHAubnkpCisgICAgICAgIHsKKyAgICAgICAgICBwLmJ4ID0geDsKKyAgICAg ICAgICBwLm54ID0gd2Q7CisgICAgICAgIH0KKyAgICB9CisgIGlmIChwLnggPj0gV0lORE9XX0JP WF9MRUZUX0VER0VfWCAodykKKyAgICAgICYmIChwLnggKyBwLndkKSA8PSBXSU5ET1dfQk9YX0xF RlRfRURHRV9YICh3KSArIFdJTkRPV19QSVhFTF9XSURUSCAodykpCisgICAgRlJBTUVfUklGIChm KS0+ZHJhd19mcmluZ2VfYml0bWFwICh3LCByb3csICZwKTsKK30KKwordm9pZAorbWNfZHJhd19m cmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGlu dCBsZWZ0X3AsIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUpCit7CisgIGludCBvdmVy bGF5ID0gMDsKKyAgaWYgKGxlZnRfcCA9PSByb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jdXJzb3Jf aW5fZnJpbmdlX3ApCisgICAgeworICAgICAgTGlzcF9PYmplY3QgY3Vyc29yID0gUW5pbDsKKyAg ICAgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgY2FzZSBNQ19GUkFN RURfQk9YOgorICAgICAgICAgIGlmIChyb3ctPnZpc2libGVfaGVpZ2h0ID49IFNUQU5EQVJEX0JJ VE1BUF9IRUlHSFQgKGhvbGxvd19yZWN0YW5nbGVfYml0cykpCisgICAgICAgICAgICBjdXJzb3Ig PSBRaG9sbG93OworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGN1cnNvciA9IFFob2xsb3df c21hbGw7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAg ICAgICAgICBpZiAocm93LT52aXNpYmxlX2hlaWdodCA+PSBTVEFOREFSRF9CSVRNQVBfSEVJR0hU IChob2xsb3dfcmVjdGFuZ2xlX2JpdHMpKQorICAgICAgICAgICAgY3Vyc29yID0gUWhvbGxvdzsK KyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBjdXJzb3IgPSBRaG9sbG93X3NtYWxsOworICAg ICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgICAgY3Vy c29yID0gUWJveDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19CQVI6CisgICAg ICAgICAgY3Vyc29yID0gUWJhcjsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19I QkFSOgorICAgICAgICAgIGN1cnNvciA9IFFoYmFyOworICAgICAgICAgIGJyZWFrOworICAgICAg ICBjYXNlIE1DX05PX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgor ICAgICAgICBjYXNlIE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGNhc2UgTUNfTEVG VF9GUklOR0VfQklUTUFQOgorICAgICAgICBkZWZhdWx0OgorICAgICAgICAgIHctPnBoeXNfY3Vy c29yX29uX3AgPSAwOworICAgICAgICAgIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gMDsKKyAg ICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgaWYgKCFOSUxQIChjdXJzb3IpKQorICAg ICAgICB7CisgICAgICAgICAgaW50IGJtID0gbWNfZ2V0X2xvZ2ljYWxfY3Vyc29yX2JpdG1hcCAo dywgY3Vyc29yKTsKKyAgICAgICAgICBpZiAoYm0gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwXzEgKHcsIHJv dywgbGVmdF9wLCAyLCBibSk7CisgICAgICAgICAgICAgIG92ZXJsYXkgPSBFUSAoY3Vyc29yLCBR Ym94KSA/IDMgOiAxOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBtY19kcmF3 X2ZyaW5nZV9iaXRtYXBfMSAodywgcm93LCBsZWZ0X3AsIG92ZXJsYXksIE1DX05PX0ZSSU5HRV9C SVRNQVApOworICBpZiAobGVmdF9wICYmIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgIT0gTUNf Tk9fRlJJTkdFX0JJVE1BUCkKKyAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXBfMSAodywgcm93LCAx LCAxLCByb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwKTsKK30KKworLyogZW5kIE1VTFRJUExFLUNV UlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICNkZWZpbmUgTk9fRlJJTkdF X0JJVE1BUCAwCiAjZGVmaW5lIFVOREVGX0ZSSU5HRV9CSVRNQVAgMQogI2RlZmluZSBNQVhfU1RB TkRBUkRfRlJJTkdFX0JJVE1BUFMgQVJSQVlFTFRTIChzdGFuZGFyZF9iaXRtYXBzKQpAQCAtMTcw MCw2ICszMjIwLDE2OCBAQCBSZXR1cm4gbmlsIGlmIFB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ydXBsZS1hbmdsZS1kb3duIik7CisgIFZmcmluZ2VfYml0bWFwcyA9IEZjb25zIChRbWNf cXVhZHJ1cGxlX2FuZ2xlX2Rvd24sIFZmcmluZ2VfYml0bWFwcyk7CisgIEZwdXQgKFFtY19xdWFk cnVwbGVfYW5nbGVfZG93biwgUWZyaW5nZSwgbWFrZV9maXhudW0gKDQ4KSk7CisgIC8qIChnZXQg JystcXVhZHJ1cGxlLWFuZ2xlLWRvd24gJ2ZyaW5nZSkgPT4gNDggKi8KKworLyogZW5kIE1VTFRJ UExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgREVGU1lNIChR dHJ1bmNhdGlvbiwgInRydW5jYXRpb24iKTsKICAgREVGU1lNIChRY29udGludWF0aW9uLCAiY29u dGludWF0aW9uIik7CiAgIERFRlNZTSAoUW92ZXJsYXlfYXJyb3csICJvdmVybGF5LWFycm93Iik7 CmRpZmYgLS1naXQgYS9zcmMvbnN0ZXJtLmggYi9zcmMvbnN0ZXJtLmgKaW5kZXggNzhjZTYwOC4u OGVmMGRmZSAxMDA2NDQKLS0tIGEvc3JjL25zdGVybS5oCisrKyBiL3NyYy9uc3Rlcm0uaApAQCAt NjYwLDYgKzY2MCwxNiBAQCB0eXBlZGVmIGlkIGluc3RhbmNldHlwZTsKIAogQGludGVyZmFjZSBF bWFjc1Njcm9sbGVyIDogTlNTY3JvbGxlcgogICB7CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBOU1JlY3QgbWNfcmVjdGFuZ2xlOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICBzdHJ1Y3Qgd2luZG93ICp3aW5kb3c7 CiAgICBzdHJ1Y3QgZnJhbWUgKmZyYW1lOwogICAgTlNSZXNwb25kZXIgKnByZXZSZXNwb25kZXI7 CkBAIC02ODAsNiArNjkwLDE4IEBAIHR5cGVkZWYgaWQgaW5zdGFuY2V0eXBlOwogICAgaW50IGVt X3dob2xlOwogICAgfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUt Q1VSU09SUyAqLworCistICh2b2lkKW1jX3NldF9yZWN0YW5nbGU6IChOU1JlY3QpcmVjdDsKKy0g KE5TUmVjdCltY19nZXRfcmVjdGFuZ2xlOworLSAoc3RydWN0IHdpbmRvdyAqKW1jX2dldF93aW5k b3c7CistIChib29sKW1jX2p1ZGdlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAt IChpbnN0YW5jZXR5cGUpIGluaXRGcmFtZTogKE5TUmVjdCApciB3aW5kb3c6IChMaXNwX09iamVj dCl3aW47CiAtICh2b2lkKXNldEZyYW1lOiAoTlNSZWN0KXI7CiAKZGlmZiAtLWdpdCBhL3NyYy9u c3Rlcm0ubSBiL3NyYy9uc3Rlcm0ubQppbmRleCA4MWQzNmJlLi4zYTI1MDRkIDEwMDY0NAotLS0g YS9zcmMvbnN0ZXJtLm0KKysrIGIvc3JjL25zdGVybS5tCkBAIC03Niw2ICs3Niw5NzkgQEAgVXBk YXRlZCBieSBDaHJpc3RpYW4gTGltcGFjaCAoY2hyaXNAbmljZS5jaCkKIHN0YXRpYyBFbWFjc01l bnUgKm1haW5NZW51OwogI2VuZGlmCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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5HIChjb2xvcik7CisgIE5T Q29sb3IgKiBjb2w7CisgIEVtYWNzQ0dGbG9hdCByZWQsIGdyZWVuLCBibHVlLCBhbHBoYTsKKyAg Y2hlY2tfd2luZG93X3N5c3RlbSAoTlVMTCk7CisgIGJsb2NrX2lucHV0ICgpOworICBpZiAobnNf bGlzcF90b19jb2xvciAoY29sb3IsICZjb2wpKQorICAgIHsKKyAgICAgIHVuYmxvY2tfaW5wdXQg KCk7CisgICAgICBsc2wtPnJlZCA9IC0xLjA7CisgICAgICBsc2wtPmdyZWVuID0gLTEuMDsKKyAg ICAgIGxzbC0+Ymx1ZSA9IC0xLjA7CisgICAgfQorICBbW2NvbCBjb2xvclVzaW5nRGVmYXVsdENv bG9yU3BhY2VdCisgICAgICAgIGdldFJlZDogJnJlZCBncmVlbjogJmdyZWVuIGJsdWU6ICZibHVl IGFscGhhOiAmYWxwaGFdOworICB1bmJsb2NrX2lucHV0ICgpOworICBsc2wtPnJlZCA9IHJlZDsK KyAgbHNsLT5ncmVlbiA9IGdyZWVuOworICBsc2wtPmJsdWUgPSBibHVlOworfQorCitzdGF0aWMg dm9pZAorbWNfbnNfZHJhd19vdmVyd3JpdHRlbiAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3Ry dWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0 IGdseXBoX3JvdyAqcm93LCBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCkKK3sKKyAgLy8gIGlu dCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgIC8vICBjbG9ja190IGNs b2NrX3N0YXJ0ID0gY2xvY2soKTsKKyAgLy8gbnNfZHJhd191bmRlcndhdmUgKHMsIHMtPndpZHRo LCBzLT54KTsKKyAgTlNDb2xvciAqaG9sbG93X2NvbG9yID0gRlJBTUVfQkFDS0dST1VORF9DT0xP UiAocy0+Zik7CisgIHN0cnVjdCBmYWNlICpmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBERUZB VUxUX0ZBQ0VfSUQpOworICBpbnQgdm50aCA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgp OworICAvKiBTVFJFVENIX0dMWVBIIG1heSBjb250YWluIG1vcmUgdGhhbiBvbmUgZmFrZSBjdXJz b3IgYXQgdGhlIHNhbWUgSFBPUy4KKyAgTk9URTogIEEgZmFrZSBjdXJzb3IgZnJvbSBvbmUgY2Fj aGUgbWF5IG92ZXJ3cml0ZSBhIGZha2UgY3Vyc29yIGZyb20gYW5vdGhlcgorICBjYWNoZSAtLSB0 aHVzLCB3ZSBtdXN0IGNoZWNrIHRoZW0gYWxsIGZvciBvdmVyd3JpdHRlbiBmYWtlIGN1cnNvcnMu ICovCisgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAg ICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsK KyAgICAgIGZvciAoaW50IG50aCA9IDA7CisgICAgICAgICAgIHMKKyAgICAgICAgICAgJiYgbWNf dHJhdmVyc2VfY2FjaGVfcCAocy0+dy0+bWNfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGgp OworICAgICAgICAgICArK250aCkKKyAgICAgICAgeworICAgICAgICAgIC8vICBpbnQgeCA9IHMt PnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueDsKKyAgICAg ICAgICBpbnQgZnggPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmZ4OworICAgICAgICAgIC8vICBpbnQgeSA9IHMtPnctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueTsKKyAgICAgICAgICBpbnQgZnkgPSBzLT53LT5t Y19tYX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hY2hlX3R5cGVdW250aF0uZmcu Ymx1ZX07CisgICAgICAgICAgLy8gIHN0cnVjdCBtY19SR0IgbHNsX2JnID0gey5yZWQgPSBzLT53 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLnJlZCwKKyAg ICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gcy0+dy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ncmVlbiwKKyAgICAgICAg ICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBzLT53LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLmJsdWV9OworICAgICAgICAgIGJvb2wg YWN0aXZlX3AgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmFjdGl2ZV9wOworICAgICAgICAgIC8vICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3Ig PSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBo X2ZsYXZvcjsKKyAgICAgICAgICBib29sIGVuYWJsZWRfcCA9IHMtPnctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxlZF9wOworICAgICAgICAgIGJvb2wg Z29fcCA9ICh2cG9zID09IHZudGgKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA9PSBj dXJzb3JfZ2x5cGgtPmhwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKTsK KyAgICAgICAgICBpZiAoIWdvX3ApCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBO U1JlY3QgcjsKKyAgICAgICAgICByLm9yaWdpbi54ID0gZng7CisgICAgICAgICAgci5vcmlnaW4u eSA9IGZ5OworICAgICAgICAgIHIuc2l6ZS5oZWlnaHQgPSBoOworICAgICAgICAgIHIuc2l6ZS53 aWR0aCA9IHdkOworICAgICAgICAgIFtbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBs c2xfZmcucmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IGxz bF9mZy5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiBs c2xfZmcuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAx LjBdIHNldF07CisgICAgICBpZiAoY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICAg ICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IGJ1ZiA9IHMtPnctPmNvbnRlbnRzOworICAgICAg ICAgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgICAgICAgICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJV RkZFUiAoYnVmKTsKKyAgICAgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRy YW5zaWVudF9tYXJrX21vZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg IU5JTFAgKEJWQVIgKGIsIG1hcmtfYWN0aXZlKSkpOworICAgICAgICAgIHB0cmRpZmZfdCByZWdp b25fYmVnID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBtY19yZWdpb25fbGltaXQgKDEpIDogLTE7Cisg ICAgICAgICAgcHRyZGlmZl90IHJlZ2lvbl9lbmQgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IG1jX3Jl Z2lvbl9saW1pdCAoMCkgOiAtMTsKKyAgICAgICAgICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAg ICAgICAgICAgICYmIGFjdGl2ZV9wCisgICAgICAgICAgICAgIC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ChzLT5mLCBob2xsb3dfYWN0aXZl X3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgTlNDb2xvciAqaG9s bG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9y IChOU19GQUNFX0ZPUkVHUk9VTkQgKGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZSks IHMtPmYpOworICAgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2FjdGl2ZV9y ZWdpb25fYmV0d2Vlbl9jb2xvcjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAg ZWxzZSBpZiAoYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFj ZSAocy0+dywgcy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiks IHRydWUpOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9m YWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAg ICAgICAgICAgICAgICBOU0NvbG9yICpob2xsb3dfYWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2lu ZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2FjdGl2ZV9mYWNlKSwgcy0+ Zik7CisgICAgICAgICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVfY29s b3I7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmICghYWN0 aXZlX3ApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBlbnVt IGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+ dywgcy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNl IiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5h Y3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQp OworICAgICAgICAgICAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19pbmFjdGl2ZV9jb2xvciA9 IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19pbmFj dGl2ZV9mYWNlKSwgcy0+Zik7CisgICAgICAgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0g aG9sbG93X2luYWN0aXZlX2NvbG9yOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgIH0K KyAgICAgICAgZWxzZSBpZiAoZmFjZSAmJiBOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpID09IG5z X2luZGV4X2NvbG9yIChGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpLCBzLT5mKSkKKyAgICAgICAg ICB7CisgICAgICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdS T1VORCAoZmFjZSksIHMtPmYpIHNldF07CisgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBGUkFN RV9DVVJTT1JfQ09MT1IgKHMtPmYpOworICAgICAgICAgIH0KKyAgICAgICAgICBzd2l0Y2ggKGN1 cnNvcl90eXBlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjYXNlIE1DX05PX0ZSSU5H RV9CSVRNQVA6CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNf Tk9fQ1VSU09SOgorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1D X1JJR0hUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgICAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0Vf QklUTUFQOgorICAgICAgICAgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgICAgICAg ICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAg IGNhc2UgTUNfRlJBTUVEX0JPWDoKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAg ICAgICAgICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAgICAgICAgICAgICAgTlNSZWN0 RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgICAgICAgICBbRlJBTUVfQ1VS U09SX0NPTE9SIChzLT5mKSBzZXRdOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAg ICAgICBjYXNlIE1DX0hPTExPV19CT1g6CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7 CisgICAgICAgICAgICAgICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICAgICAgICAgIE5T UmVjdEZpbGwgKE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgICAgICAgICAgW0ZSQU1F X0NVUlNPUl9DT0xPUiAocy0+Zikgc2V0XTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAg ICAgICAgICAgY2FzZSBNQ19IQkFSOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOwor ICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX0JBUjoKKyAgICAg ICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICA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fY29tcG9zaXRlX2dseXBoX3N0cmluZ19m b3JlZ3JvdW5kIChzKTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmb250ICpmb250ID0gcy0+ZmFjZS0+Zm9udDsK KyAgICAgICAgICAgICAgICAgICAgaWYgKCFmb250KQorICAgICAgICAgICAgICAgICAgICAgIGZv bnQgPSBGUkFNRV9GT05UIChzLT5mKTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCB3aXRoX2Jn X3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgZm9udC0+ZHJpdmVyLT5kcmF3IChzLCBz LT5jbXBfZnJvbSwgcy0+bmNoYXJzLCBzLT54LCBzLT55YmFzZSwgd2l0aF9iZ19wKTsKKyAgICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgLy8gIGNs b2NrX3QgY2xvY2tfZW5kID0gY2xvY2soKTsKKyAgLy8gIGRvdWJsZSBjcHVfdGltZV91c2VkID0g KChkb3VibGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7Cisg IC8vICBmcHJpbnRmIChzdGRlcnIsICJuc19kcmF3X292ZXJ3cml0dGVuICglZCk6ICBUSU1FICgl ZilcbiIsIHZwb3MsIGNwdV90aW1lX3VzZWQpOworfQorCitzdGF0aWMgdm9pZAorbWNfbnNfZHJh d193aW5kb3dfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpt YXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgICAgICAgIGludCB4LCBp bnQgZngsIGludCB5LCBpbnQgZnksIGludCBocG9zLCBpbnQgdnBvcywgaW50IHdkLCBpbnQgaCwK KyAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19S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iKSwKKyAgICAgICAgICAgICAgICAgICAgICAoIU5JTFAg KGJhY2tncm91bmQpID8gU1NEQVRBIChiYWNrZ3JvdW5kKSA6ICJOSUxQIikpOworICAtICBFWEFN UExFIE9GIEhPVyBUTyBDUkVBVEUgQSBDT0xPUiBXSVRIIFJHQi9MU0wgZmxvYXQgdmFsdWVzOgor ICAgICBOU0NvbG9yICpteV9jb2xvciA9IFtOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6 IDEuMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Z3JlZW46IDEuMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGJsdWU6IDEuMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYWxwaGE6IDEuMF07CisgIC0gIEFMVEVSTkFUSVZFIEVYQU1QTEU6CisgICAg IGVudW0gZmFjZV9pZCBkZWJ1Z2dpbmdfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53 LCBzLT5mLCBpbnRlcm4gKCIrLWRlYnVnZ2luZy1mYWNlIiksIHRydWUpOworICAgICBzdHJ1Y3Qg ZmFjZSAqZGVidWdnaW5nX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGRlYnVnZ2luZ19mYWNl X2lkKTsKKyAgICAgTlNDb2xvciAqY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNf RkFDRV9GT1JFR1JPVU5EIChkZWJ1Z2dpbmdfZmFjZSksIHMtPmYpOworICAgICBbY29sb3Igc2V0 XTsgKi8KKyAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgfHwgZ2x5cGhfZmxh dm9yID09IE1DX0dMWVBITEVTUykKKyAgICBbW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJl ZDogbHNsLnJlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVuOiBsc2wuZ3Jl ZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogbHNsLmJsdWUKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYTogMS4wXSBzZXRdOworICAgIGVsc2UKKyAg ICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKGYpIHNldF07CisgIGlmIChjdXJzb3JfdHlwZSA9PSBN Q19GUkFNRURfQk9YKQorICAgIHsKKyAgICAgIExpc3BfT2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRz OworICAgICAgQ0hFQ0tfQlVGRkVSIChidWYpOworICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhC VUZGRVIgKGJ1Zik7CisgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5z aWVudF9tYXJrX21vZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAo QlZBUiAoYiwgbWFya19hY3RpdmUpKSk7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZyA9IChy ZWdpb25fYWN0aXZlX3ApID8gbWNfcmVnaW9uX2xpbWl0ICgxKSA6IC0xOworICAgICAgcHRyZGlm Zl90IHJlZ2lvbl9lbmQgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IG1jX3JlZ2lvbl9saW1pdCAoMCkg OiAtMTsKKyAgICAgIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAmJiBhY3RpdmVfcAor ICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBvcyA9PSByZWdpb25fYmVnKQorICAgICAg ICB7CisgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JlZ19mYWNl X2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNv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0VfRlJPTV9JRCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2Vf aWQpOworICAgICAgICAgICAgICAgICAgTlNDb2xvciAqaG9sbG93X2luYWN0aXZlX2NvbG9yID0g bnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2luYWN0 aXZlX2ZhY2UpLCBmKTsKKyAgICAgICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19p bmFjdGl2ZV9jb2xvcjsKKyAgICAgICAgICAgICAgICB9CisgICAgfQorICAgIGVsc2UgaWYgKGZh Y2UgJiYgTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSA9PSBuc19pbmRleF9jb2xvciAoRlJBTUVf Q1VSU09SX0NPTE9SIChmKSwgZikpCisgICAgICB7CisgICAgICAgIFtuc19sb29rdXBfaW5kZXhl ZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNlKSwgZikgc2V0XTsKKyAgICAgICAgaG9s bG93X2NvbG9yID0gRlJBTUVfQ1VSU09SX0NPTE9SIChmKTsKKyAgICAgIH0KKyNpZmRlZiBOU19J TVBMX0NPQ09BCisgIE5TRGlzYWJsZVNjcmVlblVwZGF0ZXMgKCk7CisjZW5kaWYKKyAgc3dpdGNo IChjdXJzb3JfdHlwZSkKKyAgICB7CisgICAgICBjYXNlIE1DX05PX0ZSSU5HRV9CSVRNQVA6Cisg ICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19OT19DVVJTT1I6CisgICAgICAgIGJyZWFrOwor ICAgICAgY2FzZSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOgorICAgICAgICBicmVhazsKKyAgICAg IGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2Ug TUNfRklMTEVEX0JPWDoKKyAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIGJyZWFrOwor ICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOgorICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAg ICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAo ciwgMSwgMSkpOworICAgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworICAgICAg ICBicmVhazsKKyAgICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICAgICAgTlNSZWN0RmlsbCAo cik7CisgICAgICAgIFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAgTlNSZWN0RmlsbCAoTlNJ bnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAoZikgc2V0 XTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAgIE5TUmVjdEZp bGwgKHIpOworICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfQkFSOgorICAgICAgICBzID0g cjsKKyAgICAgICAgLyogQGxhd2xpc3QgaXMgZm9jdXNpbmcgdGhlIGluaXRpYWwgZGV2ZWxvcG1l bnQgb2YgZmVhdHVyZSByZXF1ZXN0cworICAgICAgICAjMTc2ODQgYW5kICMyMjg3MyBvbiBMMlIg bGFuZ3VhZ2VzLiAqLworICAgICAgICBpZiAoZ2x5cGhfZmxhdm9yICE9IE1DX0dMWVBICisgICAg ICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfR0xZUEhMRVNTKQorICAgICAgICAgIHsKKyAg ICAgICAgICAgIC8qIElmIHRoZSBjaGFyYWN0ZXIgdW5kZXIgY3Vyc29yIGlzIFIyTCwgZHJhdyB0 aGUgYmFyIGN1cnNvcgorICAgICAgICAgICAgICAgb24gdGhlIHJpZ2h0IG9mIGl0cyBnbHlwaCwg cmF0aGVyIHRoYW4gb24gdGhlIGxlZnQuICovCisgICAgICAgICAgICBpZiAoKGN1cnNvcl9nbHlw aC0+cmVzb2x2ZWRfbGV2ZWwgJiAxKSAhPSAwKQorICAgICAgICAgICAgICBzLm9yaWdpbi54ICs9 IGN1cnNvcl9nbHlwaC0+cGl4ZWxfd2lkdGggLSBzLnNpemUud2lkdGg7CisgICAgICAgICAgfQor ICAgICAgICBOU1JlY3RGaWxsIChzKTsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICBuc19yZXNl dF9jbGlwcGluZyAoZik7CisgIC8qIGRyYXcgdGhlIGNoYXJhY3RlciB1bmRlciB0aGUgY3Vyc29y ICovCisgIGlmIChnbHlwaF9mbGF2b3IgIT0gTUNfR0xZUEhMRVNTCisgICAgICAmJiAoY3Vyc29y X3R5cGUgPT0gTUNfRlJBTUVEX0JPWAorICAgICAgICAgIHx8IGN1cnNvcl90eXBlID09IE1DX0ZJ TExFRF9CT1gKKyAgICAgICAgICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19IT0xMT1dfQk9YCisgICAg ICAgICAgfHwgKGRlYnVnX3AKKyAgICAgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfSEJB UikKKyAgICAgICAgICB8fCAoZGVidWdfcAorICAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9 PSBNQ19CQVIpKSkKKyAgICB7CisgICAgICAvKiBgY3Vyc29yX2djX3BgIGlzIHVzZWQgb25seSBi eSBgdzMydGVybS5jYCBhbmQgYHh0ZXJtLmMnLiAqLworICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9 IGZhbHNlOworICAgICAgWFJlY3RhbmdsZSAqc2F2ZWRfY2xpcCA9IE5VTEw7CisgICAgICBpZiAo cm93LT5jbGlwICE9IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICBzYXZlZF9jbGlwID0gcm93 LT5jbGlwOworICAgICAgICAgIHJvdy0+Y2xpcCA9IE5VTEw7CisgICAgICAgIH0KKyAgICAgIG1j X2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJv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0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsK KyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9y IChmYWNlLT51bmRlcmxpbmVfY29sb3IsIHMtPmYpIHNldF07CisgICAgICAgICAgbnNfZHJhd191 bmRlcndhdmUgKHMsIHdpZHRoLCB4KTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChzLT5m YWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgeworICAg ICAgICAgICAgTlNSZWN0IHI7CisgICAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywg cG9zaXRpb247CisgICAgICAgICAgICAvKiBJZiB0aGUgcHJldiB3YXMgdW5kZXJsaW5lZCwgbWF0 Y2ggaXRzIGFwcGVhcmFuY2UuICovCisgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5wcmV2 LT5mYWNlLT51bmRlcmxpbmVfcAorICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPmZhY2UtPnVu ZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORQorICAgICAgICAgICAgICAgICYmIHMtPnBy ZXYtPnVuZGVybGluZV90aGlja25lc3MgPiAwKQorICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgdGhpY2tuZXNzID0gcy0+cHJldi0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAg ICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgc3RydWN0IGZvbnQgKmZvbnQ7CisgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBs b25nIGRlc2NlbnQ7CisgICAgICAgICAgICAgICAgICBmb250PXMtPmZvbnQ7CisgICAgICAgICAg ICAgICAgICBkZXNjZW50ID0gcy0+eSArIHMtPmhlaWdodCAtIHMtPnliYXNlOworICAgICAgICAg ICAgICAgICAgLyogVXNlIHVuZGVybGluZSB0aGlja25lc3Mgb2YgZm9udCwgZGVmYXVsdGluZyB0 byAxLiAqLworICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gKGZvbnQgJiYgZm9udC0+dW5k ZXJsaW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZv bnQtPnVuZGVybGluZV90aGlja25lc3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog MTsKKyAgICAgICAgICAgICAgICAgIC8qIERldGVybWluZSB0aGUgb2Zmc2V0IG9mIHVuZGVybGlu aW5nIGZyb20gdGhlIGJhc2VsaW5lLiAqLworICAgICAgICAgICAgICAgICAgaWYgKHhfdW5kZXJs aW5lX2F0X2Rlc2NlbnRfbGluZSkKKyAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNj ZW50IC0gdGhpY2tuZXNzOworICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh4X3VzZV91bmRl cmxpbmVfcG9zaXRpb25fcHJvcGVydGllcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBmb250ICYmIGZvbnQtPnVuZGVybGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAgICAg ICAgICAgIHBvc2l0aW9uID0gZm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAg ICAgICAgICAgIGVsc2UgaWYgKGZvbnQpCisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlv biA9IGxyb3VuZCAoZm9udC0+ZGVzY2VudCAvIDIpOworICAgICAgICAgICAgICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHVuZGVybGluZV9taW5p bXVtX29mZnNldDsKKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbWF4IChwb3NpdGlvbiwg dW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAgICAgICAgICAgICAgIC8qIEVuc3VyZSB1 bmRlcmxpbmluZyBpcyBub3QgY3JvcHBlZC4gKi8KKyAgICAgICAgICAgICAgICAgIGlmIChkZXNj ZW50IDw9IHBvc2l0aW9uKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgICAgcG9zaXRpb24gPSBkZXNjZW50IC0gMTsKKyAgICAgICAgICAgICAgICAgICAgICB0aGlj a25lc3MgPSAxOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVs c2UgaWYgKGRlc2NlbnQgPCBwb3NpdGlvbiArIHRoaWNrbmVzcykKKyAgICAgICAgICAgICAgICAg ICAgICB0aGlja25lc3MgPSAxOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHMtPnVu ZGVybGluZV90aGlja25lc3MgPSB0aGlja25lc3M7CisgICAgICAgICAgICBzLT51bmRlcmxpbmVf cG9zaXRpb24gPSBwb3NpdGlvbjsKKyAgICAgICAgICAgIHIgPSBOU01ha2VSZWN0ICh4LCBzLT55 YmFzZSArIHBvc2l0aW9uLCB3aWR0aCwgdGhpY2tuZXNzKTsKKyAgICAgICAgICAgIGlmIChmYWNl LT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgIFtkZWZhdWx0Q29sIHNldF07 CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRf Y29sb3IgKGZhY2UtPnVuZGVybGluZV9jb2xvciwgcy0+Zikgc2V0XTsKKyAgICAgICAgICAgIE5T UmVjdEZpbGwgKHIpOworICAgICAgICAgIH0KKyAgICB9CisgIC8qIERvIG92ZXJsaW5lLiBXZSBm b2xsb3cgb3RoZXIgdGVybXMgaW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xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGZhY2Up LCBzLT5mKTsKKyAgICAgIGZvciAoaSA9IDA7IGkgPCBuOyArK2kpCisgICAgICAgIHsKKyAgICAg ICAgICBpZiAoIXMtPnJvdy0+ZnVsbF93aWR0aF9wKQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICBpbnQgb3ZlcnJ1biwgbGVmdG92ZXJydW47CisgICAgICAgICAgICAgIC8qIHRydW5jYXRl IHRvIGF2b2lkIG92ZXJ3cml0aW5nIGZyaW5nZSBhbmQvb3Igc2Nyb2xsYmFyICovCisgICAgICAg ICAgICAgIG92ZXJydW4gPSBtYXggKDAsIChzLT54ICsgcy0+YmFja2dyb3VuZF93aWR0aCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gKFdJTkRPV19CT1hfUklHSFRfRURHRV9Y IChzLT53KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBXSU5ET1dfUklHSFRfRlJJ TkdFX1dJRFRIIChzLT53KSkpOworICAgICAgICAgICAgICAgICAgICByW2ldLnNpemUud2lkdGgg LT0gb3ZlcnJ1bjsKKyAgICAgICAgICAgICAgLyogdHJ1bmNhdGUgdG8gYXZvaWQgb3ZlcndyaXRp bmcgdG8gbGVmdCBvZiB0aGUgd2luZG93IGJveCAqLworICAgICAgICAgICAgICBsZWZ0b3ZlcnJ1 biA9IChXSU5ET1dfQk9YX0xFRlRfRURHRV9YIChzLT53KQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICArIFdJTkRPV19MRUZUX0ZSSU5HRV9XSURUSCAocy0+dykpIC0gcy0+eDsKKyAgICAg ICAgICAgICAgaWYgKGxlZnRvdmVycnVuID4gMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgICByW2ldLm9yaWdpbi54ICs9IGxlZnRvdmVycnVuOworICAgICAgICAgICAgICAg ICAgcltpXS5zaXplLndpZHRoIC09IGxlZnRvdmVycnVuOworICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgLyogWFhYOiBUcnkgdG8gd29yayBiZXR3ZWVuIHByb2JsZW0gd2hlcmUgYSBz dHJldGNoIGdseXBoIG9uCisgICAgICAgICAgICAgICAgIGEgcGFydGlhbGx5LXZpc2libGUgYm90 dG9tIHJvdyB3aWxsIGNsZWFyIHBhcnQgb2YgdGhlCisgICAgICAgICAgICAgICAgIG1vZGVsaW5l LCBhbmQgYW5vdGhlciB3aGVyZSBsaXN0LWJ1ZmZlcnMgaGVhZGVycyBhbmQgc2ltaWxhcgorICAg ICAgICAgICAgICAgICByb3dzIGVycm9uZW91c2x5IGhhdmUgdmlzaWJsZV9oZWlnaHQgc2V0IHRv IDAuICBOb3Qgc3VyZQorICAgICAgICAgICAgICAgICB3aGVyZSB0aGlzIGlzIGNvbWluZyBmcm9t IGFzIG90aGVyIHRlcm1zIHNlZW0gbm90IHRvIHNob3cuICovCisgICAgICAgICAgICAgIHJbaV0u c2l6ZS5oZWlnaHQgPSBtaW4gKHMtPmhlaWdodCwgcy0+cm93LT52aXNpYmxlX2hlaWdodCk7Cisg ICAgICAgICAgICB9CisgICAgICAgICAgW2JnQ29sIHNldF07CisgICAgICAgICAgLyogTk9URTog dW5kZXIgTlMgdGhpcyBpcyBOT1QgdXNlZCB0byBkcmF3IGN1cnNvcnMsIGJ1dCB3ZSBtdXN0IGF2 b2lkCisgICAgICAgICAgICAgb3ZlcndyaXRpbmcgY3Vyc29yICh1c3VhbGx5IHdoZW4gY3Vyc29y IG9uIGEgdGFiKSAqLworICAgICAgICAgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgLyogRklYTUU6ICBEbyB3ZSBzdGlsbCBuZWVkIHRvIHBy ZXZlbnQgdGhpcyBzZWN0aW9uIG9mIGNvZGUgZnJvbQorICAgICAgICAgICAgICBlcmFzaW5nIHRo ZSBmYWtlIE1DX0hCQVIgdGhhdCBleHRlbmRzIHRoZSBlbnRpcmUgbGVuZ3RoIG9mIHRoZQorICAg ICAgICAgICAgICBTVFJFVENIX0dMWVBIPyAgVGhpcyBtYXkgaGF2ZSBiZWVuIGRvbmUgcHJpb3Ig dG8gdGhlIGZpeCByZWxhdGluZworICAgICAgICAgICAgICB0byBsZWZ0L3JpZ2h0IG92ZXJ3cml0 dGVuIGdseXBocy4gKi8KKyAgICAgICAgICAgICAgcltpXS5zaXplLmhlaWdodCAtPSAxOworICAg ICAgICAgICAgICAvLyAgZW51bSBmYWNlX2lkIGRlYnVnZ2luZ19mYWNlX2lkID0gbG9va3VwX25h bWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistZGVidWdnaW5nLWZhY2UiKSwgdHJ1ZSk7 CisgICAgICAgICAgICAgIC8vICBzdHJ1Y3QgZmFjZSAqZGVidWdnaW5nX2ZhY2UgPSBGQUNFX0ZS T01fSUQgKHMtPmYsIGRlYnVnZ2luZ19mYWNlX2lkKTsKKyAgICAgICAgICAgICAgLy8gIE5TQ29s b3IgKmNvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAo ZGVidWdnaW5nX2ZhY2UpLCBzLT5mKTsKKyAgICAgICAgICAgICAgLy8gIFtjb2xvciBzZXRdOwor ICAgICAgICAgICAgICBDR0Zsb2F0IHggPSByW2ldLm9yaWdpbi54OworICAgICAgICAgICAgICBD R0Zsb2F0IHdpZHRoID0gd2Q7CisgICAgICAgICAgICAgIHJbaV0uc2l6ZS53aWR0aCAtPSB3aWR0 aDsKKyAgICAgICAgICAgICAgcltpXS5vcmlnaW4ueCArPSB3aWR0aDsKKyAgICAgICAgICAgICAg TlNSZWN0RmlsbCAocltpXSk7CisgICAgICAgICAgICAgIC8qIERyYXcgb3ZlcmxpbmluZywgZXRj LiBvbiB0aGUgY3Vyc29yLiAqLworICAgICAgICAgICAgICBpZiAocy0+dy0+cGh5c19jdXJzb3Jf dHlwZSA9PSBNQ19GSUxMRURfQk9YKQorICAgICAgICAgICAgICAgIG1jX25zX2RyYXdfdGV4dF9k ZWNvcmF0aW9uIChzLCBmYWNlLCBiZ0NvbCwgd2lkdGgsIHgpOworICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNl LCBmZ0NvbCwgd2lkdGgsIHgpOworICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgIHsKKyAgLy8gIGludCByeCA9IHJbaV0ub3JpZ2luLng7CisgIC8vICBpbnQgcnkgPSBy W2ldLm9yaWdpbi55OworICAvLyAgaW50IHJ3ID0gcltpXS5zaXplLndpZHRoOworICAvLyAgaW50 IHJoID0gcltpXS5zaXplLmhlaWdodDsKKyAgLy8gIGZwcmludGYgKHN0ZGVyciwgIm1jX25zX2R1 bXBnbHlwaHNfc3RyZXRjaDogIHZwb3MgKCVkKSB8IHJ4ICglZCkgfCByeSAoJWQpIHwgcncgKCVk KSB8IHJoICglZClcbiIsCisgIC8vICAgICAgICAgICAgICAgICAgIHMtPmZpcnN0X2dseXBoLT52 cG9zLCByeCwgcnksIHJ3LCByaCk7CisgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHJbaV0pOwor ICAgICAgICAgICAgfQorICAgICAgICAgIC8qIERyYXcgb3ZlcmxpbmluZywgZXRjLiBvbiB0aGUg c3RyZXRjaCBnbHlwaCAob3IgdGhlIHBhcnQKKyAgICAgICAgICAgICBvZiB0aGUgc3RyZXRjaCBn bHlwaCBhZnRlciB0aGUgY3Vyc29yKS4gKi8KKyAgICAgICAgICBtY19uc19kcmF3X3RleHRfZGVj b3JhdGlvbiAocywgZmFjZSwgZmdDb2wsIHJbaV0uc2l6ZS53aWR0aCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgcltpXS5vcmlnaW4ueCk7CisgICAgICAgIH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kcmF3IHBsYWNlaG9s ZGVyIGlmIGltZyA9PW5pbD8gKi8KKyAgaWYgKGltZyAhPSBuaWwpCisgICAgeworI2lmZGVmIE5T X0lNUExfQ09DT0EKKyAgICAgIE5TUmVjdCBkciA9IE5TTWFrZVJlY3QgKHgsIHksIHMtPnNsaWNl LndpZHRoLCBzLT5zbGljZS5oZWlnaHQpOworICAgICAgTlNSZWN0IGlyID0gTlNNYWtlUmVjdCAo cy0+c2xpY2UueCwgcy0+c2xpY2UueSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMt PnNsaWNlLndpZHRoLCBzLT5zbGljZS5oZWlnaHQpOworICAgICAgW2ltZyBkcmF3SW5SZWN0OiBk cgorICAgICAgICAgICAgIGZyb21SZWN0OiBpcgorICAgICAgICAgICAgIG9wZXJhdGlvbjogTlND b21wb3NpdGVTb3VyY2VPdmVyCisgICAgICAgICAgICAgIGZyYWN0aW9uOiAxLjAKKyAgICAgICAg ICAgcmVzcGVjdEZsaXBwZWQ6IFlFUworICAgICAgICAgICAgICAgIGhpbnRzOiBuaWxdOworI2Vs c2UKKyAgICAgIFtpbWcgY29tcG9zaXRlVG9Qb2ludDogTlNNYWtlUG9pbnQgKHgsIHkgKyBzLT5z bGljZS5oZWlnaHQpCisgICAgICAgICAgICAgICAgICBvcGVyYXRpb246IE5TQ29tcG9zaXRlU291 cmNlT3Zlcl07CisjZW5kaWYKKyAgICB9CisgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikKKyAg ICB7CisgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChzLT5mKSBzZXRdOworICAgICAgaWYgKHMt PnctPnBoeXNfY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVEX0JPWCkKKyAgICAgICAgdGRDb2wgPSBu c19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSwgcy0+Zik7 CisgICAgICAgIGVsc2UKKyAgICAgICAgICAvKiBDdXJyZ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Rvb2xfYmFyX2J1dHRvbl9yZWxpZWYgOiBERUZBVUxUX1RPT0xfQkFSX0JVVFRPTl9SRUxJ RUY7CisgICAgICAgICAgcmFpc2VkX3AgPSAocy0+aGwgPT0gRFJBV19JTUFHRV9SQUlTRUQpOwor ICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICB0aCA9IGFi cyAocy0+aW1nLT5yZWxpZWYpOworICAgICAgICAgICAgcmFpc2VkX3AgPSAocy0+aW1nLT5yZWxp ZWYgPiAwKTsKKyAgICAgICAgICB9CisgICAgICByLm9yaWdpbi54ID0geCAtIHRoOworICAgICAg ci5vcmlnaW4ueSA9IHkgLSB0aDsKKyAgICAgIHIuc2l6ZS53aWR0aCA9IHMtPnNsaWNlLndpZHRo ICsgMip0aC0xOworICAgICAgci5zaXplLmhlaWdodCA9IHMtPnNsaWNlLmhlaWdodCArIDIqdGgt MTsKKyAgICAgIG5zX2RyYXdfcmVsaWVmIChyLCB0aCwgcmFpc2VkX3AsCisgICAgICAgICAgICAg ICAgICAgICAgcy0+c2xpY2UueSA9PSAwLAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNl LnkgKyBzLT5zbGljZS5oZWlnaHQgPT0gcy0+aW1nLT5oZWlnaHQsCisgICAgICAgICAgICAgICAg ICAgICAgcy0+c2xpY2UueCA9PSAwLAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLngg KyBzLT5zbGljZS53aWR0aCA9PSBzLT5pbWctPndpZHRoLCBzKTsKKyAgICB9CisgIC8qIElmIHRo ZXJlIGlzIG5vIG1hc2ssIHRoZSBiYWNrZ3JvdW5kIHdvbid0IGJlIHNlZW4sCisgICAgIHNvIGRy YXcgYSByZWN0YW5nbGUgb24gdGhlIGltYWdlIGZvciB0aGUgY3Vyc29yLgorICAgICBEbyB0aGlz IGZvciBhbGwgaW1hZ2VzLCBnZXR0aW5nIHRyYW5zcGFyZW5jeSByaWdodCBpcyBub3QgcmVsaWFi bGUuICovCisgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikKKyAgICB7CisgICAgICBpbnQgdGhp Y2tuZXNzID0gYWJzIChzLT5pbWctPnJlbGllZik7CisgICAgICBpZiAodGhpY2tuZXNzID09IDAp IHRoaWNrbmVzcyA9IDE7CisgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAg ICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTKQorICAgICAgeworICAgICAgICBOU0Nv bG9yICpib3JkZXJfY29sb3IgPSBbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2wu cmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgZ3JlZW46IGxzbC5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiBsc2wuYmx1ZQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdOwor ICAgICAgICBuc19kcmF3X2JveCAoYnIsIHRoaWNrbmVzcywgYm9yZGVyX2NvbG9yLCAxLCAxKTsK KyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgICAgbnNfZHJhd19ib3ggKGJyLCB0aGlja25lc3Ms IEZSQU1FX0NVUlNPUl9DT0xPUiAocy0+ZiksIDEsIDEpOworICAgIH0KK30KKworc3RhdGljIHZv aWQKK21jX25zX21heWJlX2R1bXBnbHlwaHNfYmFja2dyb3VuZCAoc3RydWN0IGdseXBoX3N0cmlu ZyAqcywgY2hhciBmb3JjZV9wKQoreworICBOU1RSQUNFICgibWNfbnNfbWF5YmVfZHVtcGdseXBo c19iYWNrZ3JvdW5kIik7CisgIGlmICghcy0+YmFja2dyb3VuZF9maWxsZWRfcC8qIHx8IHMtPmhs ID09IERSQVdfTU9VU0VfRkFDRSovKQorICAgIHsKKyAgICAgIGludCBib3hfbGluZV93aWR0aCA9 IG1heCAocy0+ZmFjZS0+Ym94X2xpbmVfd2lkdGgsIDApOworICAgICAgaWYgKEZPTlRfSEVJR0hU IChzLT5mb250KSA8IHMtPmhlaWdodCAtIDIgKiBib3hfbGluZV93aWR0aAorICAgICAgICAgIC8q IFdoZW4geGRpc3AuYyBpZ25vcmVzIEZPTlRfSEVJR0hULCB3ZSBjYW5ub3QgdHJ1c3QgZm9udAor ICAgICAgICAgICAgIGRpbWVuc2lvbnMsIHNpbmNlIHRoZSBhY3R1YWwgZ2x5cGhzIG1pZ2h0IGJl IG11Y2gKKyAgICAgICAgICAgICBzbWFsbGVyLiAgU28gaW4gdGhhdCBjYXNlIHdlIGFsd2F5cyBj bGVhciB0aGUgcmVjdGFuZ2xlCisgICAgICAgICAgICAgd2l0aCBiYWNrZ3JvdW5kIGNvbG9yLiAq LworICAgICAgICAgIHx8IEZPTlRfVE9PX0hJR0ggKHMtPmZvbnQpCisgICAgICAgICAgfHwgcy0+ Zm9udF9ub3RfZm91bmRfcCB8fCBzLT5leHRlbmRzX3RvX2VuZF9vZl9saW5lX3AgfHwgZm9yY2Vf cCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBmYWNlICpmYWNlOworICAgICAgICAgIGlm IChzLT5obCA9PSBEUkFXX01PVVNFX0ZBQ0UpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIE1PVVNFX0hMX0lORk8gKHMtPmYpLT5tb3VzZV9m YWNlX2ZhY2VfaWQpOworICAgICAgICAgICAgICBpZiAoIWZhY2UpCisgICAgICAgICAgICAgICAg ZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgTU9VU0VfRkFDRV9JRCk7CisgICAgICAgICAgICB9 CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMt PmYsIHMtPmZpcnN0X2dseXBoLT5mYWNlX2lkKTsKKyAgICAgICAgICBpZiAoIWZhY2UtPnN0aXBw bGUpCisgICAgICAgICAgICBbKE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSkgIT0gMAorICAgICAg ICAgICAgICA/IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGZh Y2UpLCBzLT5mKQorICAgICAgICAgICAgICA6IEZSQU1FX0JBQ0tHUk9VTkRfQ09MT1IgKHMtPmYp KSBzZXRdOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgc3RydWN0IG5zX2Rpc3BsYXlfaW5mbyAqZHB5aW5mbyA9IEZSQU1FX0RJU1BMQVlfSU5GTyAo cy0+Zik7CisgICAgICAgICAgICAgICAgW1tkcHlpbmZvLT5iaXRtYXBzW2ZhY2UtPnN0aXBwbGUt MV0uaW1nIHN0aXBwbGVNYXNrXSBzZXRdOworICAgICAgICAgICAgICB9CisgICAgICAgICAgaWYg KHMtPmhsICE9IERSQVdfQ1VSU09SKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzLT5y ZWN0YW5nbGVfbnVrZWRfcCA9IHRydWU7CisgICAgICAgICAgICAgIE5TUmVjdCByID0gTlNNYWtl UmVjdCAocy0+eCwgcy0+eSArIGJveF9saW5lX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgcy0+YmFja2dyb3VuZF93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHMtPmhlaWdodC0yKmJveF9saW5lX3dpZHRoKTsKKyAgICAgICAgICAg ICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICB9CisgICAgICAgICAgcy0+YmFja2dyb3Vu ZF9maWxsZWRfcCA9IDE7CisgICAgICAgIH0KKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkCittY19u c19kcmF3X2dseXB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ICAgICBpbnQgd2lkdGg7Cisg ICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpuZXh0OworICAgICAgZm9yICh3aWR0aCA9IDAsIG5l eHQgPSBzLT5uZXh0OworICAgICAgICAgICBuZXh0ICYmIHdpZHRoIDwgcy0+cmlnaHRfb3Zlcmhh bmc7CisgICAgICAgICAgIHdpZHRoICs9IG5leHQtPndpZHRoLCBuZXh0ID0gbmV4dC0+bmV4dCkK KyAgICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlICE9IElNQUdFX0dMWVBIKQorICAg ICAgICAgIHsKKyAgICAgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBTVFJF VENIX0dMWVBIKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbiA9IG5zX2dldF9n bHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLT5uZXh0LCByKTsKKyAgICAgICAgICAgICAgICBpZiAo IW5zX2NsaXBfdG9fcmVjdCAocy0+ZiwgciwgbikpCisgICAgICAgICAgICAgICAgICByZXR1cm47 CisgICAgICAgICAgICAgICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLT5u ZXh0LCAxKTsKKyAgICAgICAgICAgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgbWNfbnNfZHVtcGds eXBoc19zdHJldGNoIChzLT5uZXh0LCBtYXRyaXgsIHJvdywgd2QpOworICAgICAgICAgICAgbmV4 dC0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICB9CisgICAgfQorICBpZiAoIXMtPmZvcl9vdmVy bGFwcyAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gKKyAgICAgICYmIChzLT5maXJzdF9n bHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICAgfHwgcy0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Aocy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIGlmIChz LT5mb3Jfb3ZlcmxhcHMKKyAgICAgICAgICB8fCAocy0+Y21wX2Zyb20gPiAwCisgICAgICAgICAg ICAgICYmICEgcy0+Zmlyc3RfZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykpCisgICAgICAgIHMtPmJh Y2tncm91bmRfZmlsbGVkX3AgPSAxOworICAgICAgZWxzZQorICAgICAgICBtY19uc19tYXliZV9k dW1wZ2x5cGhzX2JhY2tncm91bmQgKHMsIHMtPmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lU RV9HTFlQSCk7CisgICAgICBmbGFncyA9IHMtPmhsID09IERSQVdfQ1VSU09SID8gTlNfRFVNUEdM WVBIX0NVUlNPUiA6CisgICAgICAgIChzLT5obCA9PSBEUkFXX01PVVNFX0ZBQ0UgPyBOU19EVU1Q R0xZUEhfTU9VU0VGQUNFIDoKKyAgICAgICAgIChzLT5mb3Jfb3ZlcmxhcHMgPyBOU19EVU1QR0xZ UEhfRk9SRUdST1VORCA6CisgICAgICAgICAgTlNfRFVNUEdMWVBIX05PUk1BTCkpOworICAgICAg dW5zaWduZWQgbG9uZyBzYXZlZF9mZyA9IE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSk7Cisg ICAgICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IgJiYgY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVE X0JPWCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdG1wID0gTlNfRkFDRV9C QUNLR1JPVU5EIChzLT5mYWNlKTsKKyAgICAgICAgICBOU19GQUNFX0JBQ0tHUk9VTkQgKHMtPmZh Y2UpID0gTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKTsKKyAgICAgICAgICBOU19GQUNFX0ZP UkVHUk9VTkQgKHMtPmZhY2UpID0gdG1wOworICAgICAgICB9CisgICAgICAgIGVsc2UgaW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gICAgICBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZh Y2UpID0gTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3dfaW5hY3RpdmVfZmFjZSk7CisgICAgICAg ICAgICB9CisgICAgICB7CisgICAgICAgIEJPT0wgaXNDb21wb3NpdGUgPSBzLT5maXJzdF9nbHlw aC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEg7CisgICAgICAgIGlmIChpc0NvbXBvc2l0ZSkKKyAg ICAgICAgICBuc19kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7Cisg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBib29sIHdpdGhfYmdf cCA9ICgoZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX05PUk1BTCAmJiAhcy0+YmFja2dyb3VuZF9maWxs ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZmxhZ3MgPT0gTlNfRFVN UEdMWVBIX01PVVNFRkFDRSk7CisgICAgICAgICAgICAgIGlmICh3aXRoX2JnX3ApCisgICAgICAg ICAgICAgICAgcy0+YmFja2dyb3VuZF9udWtlZF9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgZm9u dC0+ZHJpdmVyLT5kcmF3IChzLCBzLT5jbXBfZnJvbSwgcy0+bmNoYXJzLCBzLT54LCBzLT55YmFz ZSwgd2l0aF9iZ19wKTsKKyAgICAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIHsKKyAgICAgICAg TlNDb2xvciAqY29sID0gKE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgIT0gMAorICAgICAg ICAgICAgICAgICAgICAgICAgPyBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JF R1JPVU5EIChzLT5mYWNlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHMtPmY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YmIHMtPmZhY2UtPmJveCAhPSBGQUNFX05PX0JP WCkKKyAgICB7CisgICAgICBuID0gbnNfZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIp OworICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQorICAgICAgICByZXR1 cm47CisgICAgICBuc19kdW1wZ2x5cGhzX2JveF9vcl9yZWxpZWYgKHMpOworICAgICAgbnNfcmVz ZXRfY2xpcHBpbmcgKHMtPmYpOworICAgIH0KKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyog ZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8q ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09CiAKICAgIE5TVFJBQ0UsIFRyYWNlIHN1cHBvcnQuCkBAIC0xMTA5 LDYgKzIwODIsMTYgQEAgc3RhdGljIE5TUmVjdCBjb25zdHJhaW5fZnJhbWVfcmVjdChOU1JlY3Qg ZnJhbWVSZWN0LCBib29sIGlzRnVsbHNjcmVlbikKICAgIGV4dGVybmFsIChSSUYpIGNhbGw7IHdo b2xlIGZyYW1lLCBjYWxsZWQgYmVmb3JlIHVwZGF0ZV93aW5kb3dfYmVnaW4KICAgIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBmOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAjaWZkZWYgTlNfSU1QTF9DT0NPQQogICBFbWFjc1ZpZXcgKnZp ZXcgPSBGUkFNRV9OU19WSUVXIChmKTsKIApAQCAtMTIwOSw2ICsyMTkyLDE2IEBAIHN0YXRpYyBO U1JlY3QgY29uc3RyYWluX2ZyYW1lX3JlY3QoTlNSZWN0IGZyYW1lUmVjdCwgYm9vbCBpc0Z1bGxz Y3JlZW4pCiAKIC8qICAgaWYgKGYgPT0gTU9VU0VfSExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfbW91 c2VfZnJhbWUpICovCiAgIE1PVVNFX0hMX0lORk8gKGYpLT5tb3VzZV9mYWNlX2RlZmVyID0gMDsK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICBmLT5tY191cGRhdGluZ19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKIH0KIAogCkBAIC00ODAzLDYgKzU3OTYsMTcgQEAgaW4gY2VydGFpbiBzaXR1YXRpb25z IChyYXBpZCBpbmNvbWluZyBldmVudHMpLgogICAgICAgYmFyID0gW1tFbWFjc1Njcm9sbGVyIGFs bG9jXSBpbml0RnJhbWU6IHIgd2luZG93OiB3aW5dOwogICAgICAgd3NldF92ZXJ0aWNhbF9zY3Jv bGxfYmFyICh3aW5kb3csIG1ha2VfbWludF9wdHIgKGJhcikpOwogICAgICAgdXBkYXRlX3AgPSBZ RVM7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgICAgIC8qIFRoaXMgaXMgb25seSBmb3IgZGVidWdnaW5nIHB1cnBvc2VzLiAqLworICAg ICAgW2JhciBtY19zZXRfcmVjdGFuZ2xlOiByXTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAgIH0KICAgZWxzZQogICAgIHsKQEAgLTQ4MTAsMTIgKzU4MTQsMzAgQEAgaW4gY2Vy dGFpbiBzaXR1YXRpb25zIChyYXBpZCBpbmNvbWluZyBldmVudHMpLgogICAgICAgYmFyID0gWE5T X1NDUk9MTF9CQVIgKHdpbmRvdy0+dmVydGljYWxfc2Nyb2xsX2Jhcik7CiAgICAgICBvbGRSZWN0 ID0gW2JhciBmcmFtZV07CiAgICAgICByLnNpemUud2lkdGggPSBvbGRSZWN0LnNpemUud2lkdGg7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK ICAgICAgIGlmIChGUkFNRV9MSVZFX1AgKGYpICYmICFOU0VxdWFsUmVjdHMgKG9sZFJlY3QsIHIp KQogICAgICAgICB7CisgICAgICAgICAgLyogVGhlIG1haW4gd2luZG93IGhhcyBwcm9iYWJseSBi ZWVuIHJlc2l6ZWQuICBHcmFjaW91c2x5IGRlbGV0ZSB0aGUKKyAgICAgICAgICBvbGQgc2Nyb2xs IGJhciB3aXRob3V0IHJlcGFpbnRpbmcgaXRzIHJlY3RhbmdsZTsgYW5kLCBjcmVhdGUgYSBuZXcK KyAgICAgICAgICBzY3JvbGwgYmFyIGVsc2V3aGVyZS4qLwogICAgICAgICAgIGlmIChvbGRSZWN0 Lm9yaWdpbi54ICE9IHIub3JpZ2luLngpCisgICAgICAgICAgICB7CiAgICAgICAgICAgICAgIG5z X2NsZWFyX2ZyYW1lX2FyZWEgKGYsIGxlZnQsIHRvcCwgd2lkdGgsIGhlaWdodCk7CisgICAgICAg ICAgICAgIFtiYXIgbWNfanVkZ2VdOworICAgICAgICAgICAgICBiYXIgPSBbW0VtYWNzU2Nyb2xs ZXIgYWxsb2NdIGluaXRGcmFtZTogciB3aW5kb3c6IHdpbl07CisgICAgICAgICAgICAgIHdzZXRf dmVydGljYWxfc2Nyb2xsX2JhciAod2luZG93LCBtYWtlX21pbnRfcHRyIChiYXIpKTsKKyAgICAg ICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKICAgICAgICAgICBbYmFyIHNldEZyYW1lOiByXTsK ICAgICAgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgfQogCiAgIGlm ICh1cGRhdGVfcCkKQEAgLTQ5NzUsOSArNTk5Nyw1NyBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMg KHJhcGlkIGluY29taW5nIGV2ZW50cykuCiAgICAgewogICAgICAgdmlldyA9IFtzdWJ2aWV3cyBv YmplY3RBdEluZGV4OiBpXTsKICAgICAgIGlmICghW3ZpZXcgaXNLaW5kT2ZDbGFzczogW0VtYWNz U2Nyb2xsZXIgY2xhc3NdXSkgY29udGludWU7Ci0gICAgICBpZiAoW3ZpZXcganVkZ2VdKQorCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8q IGBYU0VUV0lORE9XJyB3aWxsIHNvbWV0aW1lcyBjYXVzZSBFbWFjcyB0byBjcmFzaCB3aGVuIHJ1 bm5pbmcgdW5kZXIgZ2RiIGV2ZW4KKyAgdGhvdWdoICh3ICE9IE5VTEwpLiAgVGhlcmVmb3JlLCB3 ZSBjYW5ub3QgcmVsaWFibHkgdXNlIGBXSU5ET1dfTElWRV9QJy4gKi8KKyAgc3RydWN0IHdpbmRv dyAqdyA9IFt2aWV3IG1jX2dldF93aW5kb3ddOworICBpZiAodyAhPSBOVUxMCisgICAgICAmJiBO SUxQICh3LT5jb250ZW50cykpCisgICAgeworICAgICAgQk9PTCBkZWJ1Z19wID0gZmFsc2U7Cisg ICAgICBpZiAoZGVidWdfcAorICAgICAgICAgIC8qIGB3aW5kb3dfYm94JyBjYWxscyBgd2luZG93 X2JveF9oZWlnaHQnLCB3aGljaCB3aWxsIGNhdXNlIEVtYWNzIHRvCisgICAgICAgICAgY3Jhc2gg aWYgRlJBTUVQICh3LT5mcmFtZSkgaXMgbm90IHNhdGlzZmllZC4gKi8KKyAgICAgICAgICAmJiBG UkFNRVAgKHctPmZyYW1lKSkKKyAgICAgICAgeworICAgICAgICAgIE5TUmVjdCByMCA9IFt2aWV3 IG1jX2dldF9yZWN0YW5nbGVdOworICAgICAgICAgIGludCB4MCA9IE5TTWluWCAocjApOworICAg ICAgICAgIGludCB5MCA9IE5TTWluWSAocjApOworICAgICAgICAgIGludCB3ZDAgPSBOU1dpZHRo IChyMCk7CisgICAgICAgICAgaW50IGgwID0gTlNIZWlnaHQgKHIwKTsKKyAgICAgICAgICBpbnQg d2luZG93X3ksIHdpbmRvd19oZWlnaHQ7CisgICAgICAgICAgd2luZG93X2JveCAodywgQU5ZX0FS RUEsIDAsICZ3aW5kb3dfeSwgMCwgJndpbmRvd19oZWlnaHQpOworICAgICAgICAgIGludCB0b3Ag PSB3aW5kb3dfeTsKKyAgICAgICAgICBpbnQgaGVpZ2h0ID0gd2luZG93X2hlaWdodDsKKyAgICAg ICAgICBpbnQgd2lkdGggPSBXSU5ET1dfQ09ORklHX1NDUk9MTF9CQVJfQ09MUyAodykgKiBGUkFN RV9DT0xVTU5fV0lEVEggKGYpOworICAgICAgICAgIGludCB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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKworICAgIH0K IAogICBpZiAocmVtb3ZlZCkKICAgICBbZXZpZXcgdXBkYXRlRnJhbWVTaXplOiBOT107CkBAIC01 MTA2LDYgKzYxNzYsMjEgQEAgc3RhdGljIExpc3BfT2JqZWN0IG5zX3N0cmluZ190b19saXNwbW9k IChjb25zdCBjaGFyICpzKQogZXh0ZXJuIGZyYW1lX3Bhcm1faGFuZGxlciBuc19mcmFtZV9wYXJt X2hhbmRsZXJzW107CiBzdGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UgbnNfcmVkaXNw bGF5X2ludGVyZmFjZSA9CiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgbnN0ZXJtLm1g IG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVy ZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfeF93cml0ZV9nbHlwaHMsCisgIG1j X25zX2RyYXdfd2luZG93X2N1cnNvciwKKyAgbWNfbnNfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgbnNfZnJhbWVfcGFybV9oYW5kbGVycywKICAg eF9wcm9kdWNlX2dseXBocywKICAgeF93cml0ZV9nbHlwaHMsCkBAIC04NzIxLDYgKzk4MDYsNDkg QEAgLSAoQk9PTCljYW5CZWNvbWVNYWluV2luZG93CiAKIEBpbXBsZW1lbnRhdGlvbiBFbWFjc1Nj cm9sbGVyCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTogKE5TUmVjdClyZWN0Cit7CisgIG1jX3Jl Y3RhbmdsZSA9IHJlY3Q7Cit9CisKKy0gKE5TUmVjdCltY19nZXRfcmVjdGFuZ2xlCit7CisgIHJl dHVybiBtY19yZWN0YW5nbGU7Cit9CisKKy0gKHN0cnVjdCB3aW5kb3cgKiltY19nZXRfd2luZG93 Cit7CisgIHJldHVybiB3aW5kb3c7Cit9CisKKy0gKGJvb2wpbWNfanVkZ2UKK3sKKyAgTlNUUkFD RSAoIltFbWFjc1Njcm9sbGVyIG1jX2p1ZGdlXSIpOworICBib29sIHJldCA9IGNvbmRlbW5lZDsK KyAgYmxvY2tfaW5wdXQgKCk7CisgIGlmIChjb25kZW1uZWQpCisgICAgeworICAgICAgLyogZW5z dXJlIG90aGVyIHNjcm9sbGJhciB1cGRhdGVzIGFmdGVyIGRlbGV0aW9uICovCisgICAgICBFbWFj c1ZpZXcgKnZpZXcgPSAoRW1hY3NWaWV3ICopRlJBTUVfTlNfVklFVyAoZnJhbWUpOworICAgICAg aWYgKHZpZXcgIT0gbmlsKQorICAgICAgICB2aWV3LT5zY3JvbGxiYXJzTmVlZGluZ1VwZGF0ZSsr OworICAgIH0KKyAgaWYgKHdpbmRvdykKKyAgICB3c2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHdp bmRvdywgUW5pbCk7CisgIHdpbmRvdyA9IDA7CisgIFtzZWxmIHJlbW92ZUZyb21TdXBlcnZpZXdX aXRob3V0TmVlZGluZ0Rpc3BsYXldOworICBbc2VsZiByZWxlYXNlXTsKKyAgdW5ibG9ja19pbnB1 dCAoKTsKKyAgcmV0dXJuIHJldDsKK30KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKio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2x5cGguICAqLworICAgICAg aW50IHdpZHRoLCBiYWNrZ3JvdW5kX3dpZHRoID0gcy0+YmFja2dyb3VuZF93aWR0aDsKKyAgICAg IGludCB4ID0gcy0+eDsKKyAgICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQorICAgICAgICB7 CisgICAgICAgICAgaW50IGxlZnRfeCA9IHdpbmRvd19ib3hfbGVmdF9vZmZzZXQgKHMtPncsIFRF WFRfQVJFQSk7CisgICAgICAgICAgaWYgKHggPCBsZWZ0X3gpCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0gbGVmdF94IC0geDsKKyAgICAgICAgICAgICAg eCA9IGxlZnRfeDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgIGVsc2UKKyAgICAg ICAgeworICAgICAgICAgIC8qIEluIFIyTCByb3dzLCBkcmF3IHRoZSBjdXJzb3Igb24gdGhlIHJp Z2h0IGVkZ2Ugb2YgdGhlCisgICAgICAgICAgICAgc3RyZXRjaCBnbHlwaC4gICovCisgICAgICAg ICAgaW50IHJpZ2h0X3ggPSB3aW5kb3dfYm94X3JpZ2h0IChzLT53LCBURVhUX0FSRUEpOworICAg ICAgICAgIGlmICh4ICsgYmFja2dyb3VuZF93aWR0aCA+IHJpZ2h0X3gpCisgICAgICAgICAgICBi YWNrZ3JvdW5kX3dpZHRoIC09IHggLSByaWdodF94OworICAgICAgICAgIHggKz0gYmFja2dyb3Vu ZF93aWR0aDsKKyAgICAgICAgfQorICAgICAgd2lkdGggPSBtaW4gKEZSQU1FX0NPTFVNTl9XSURU SCAocy0+ZiksIGJhY2tncm91bmRfd2lkdGgpOworICAgICAgaWYgKHMtPnJvdy0+cmV2ZXJzZWRf cCkKKyAgICAgICAgeCAtPSB3aWR0aDsKKyAgICAgIC8qIERyYXcgY3Vyc29yLiAgKi8KKyAgICAg IHhfZHJhd19nbHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwgcy0+eSwgd2lkdGgsIHMtPmhlaWdo dCk7CisgICAgICAvKiBDbGVhciByZXN0IHVzaW5nIHRoZSBHQyBvZiB0aGUgb3JpZ2luYWwgbm9u LWN1cnNvciBmYWNlLiAgKi8KKyAgICAgIGlmICh3aWR0aCA8IGJhY2tncm91bmRfd2lkdGgpCisg ICAgICAgIHsKKyAgICAgICAgICBYR0NWYWx1ZXMgKmdjID0gcy0+ZmFjZS0+Z2M7CisgICAgICAg ICAgaW50IHkgPSBzLT55OworICAgICAgICAgIGludCB3ID0gYmFja2dyb3VuZF93aWR0aCAtIHdp ZHRoLCBoID0gcy0+aGVpZ2h0OworICAgICAgICAgIFJFQ1QgcjsKKyAgICAgICAgICAgICAgICBI REMgaGRjID0gcy0+aGRjOworICAgICAgICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQorICAg ICAgICAgICAgeCArPSB3aWR0aDsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB4ID0gcy0+ eDsKKyAgICAgICAgICBpZiAocy0+cm93LT5tb3VzZV9mYWNlX3AKKyAgICAgICAgICAgICAgJiYg Y3Vyc29yX2luX21vdXNlX2ZhY2VfcCAocy0+dykpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIHhfc2V0X21vdXNlX2ZhY2VfZ2MgKHMpOworICAgICAgICAgICAgICBnYyA9IHMtPmdjOwor ICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGdjID0gcy0+ZmFjZS0+ Z2M7CisgICAgICAgICAgZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsICZyKTsKKyAgICAg ICAgICB3MzJfc2V0X2NsaXBfcmVjdGFuZ2xlIChoZGMsICZyKTsKKyNpZiAwIC8qIFRPRE86IHN0 aXBwbGUgKi8KKyAgICAgICAgICBpZiAocy0+ZmFjZS0+c3RpcHBsZSkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgLyogRmlsbCBiYWNrZ3JvdW5kIHdpdGggYSBzdGlwcGxlIHBhdHRlcm4u ICAqLworICAgICAgICAgICAgICBYU2V0RmlsbFN0eWxlIChzLT5kaXNwbGF5LCBnYywgRmlsbE9w YXF1ZVN0aXBwbGVkKTsKKyAgICAgICAgICAgICAgWEZpbGxSZWN0YW5nbGUgKHMtPmRpc3BsYXks IHMtPndpbmRvdywgZ2MsIHgsIHksIHcsIGgpOworICAgICAgICAgICAgICBYU2V0RmlsbFN0eWxl IChzLT5kaXNwbGF5LCBnYywgRmlsbFNvbGlkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBl bHNlCisjZW5kaWYKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAo cy0+Ziwgcy0+aGRjLCBnYy0+YmFja2dyb3VuZCwgeCwgeSwgdywgaCk7CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICB9CisgIGVsc2UgaWYgKCFzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wKQor ICAgIHsKKyAgICAgIGludCBiYWNrZ3JvdW5kX3dpZHRoID0gcy0+YmFja2dyb3VuZF93aWR0aDsK KyAgICAgIGludCB4ID0gcy0+eCwgbGVmdF94ID0gd2luZG93X2JveF9sZWZ0X29mZnNldCAocy0+ dywgVEVYVF9BUkVBKTsKKyAgICAgIC8qIERvbid0IGRyYXcgaW50byBsZWZ0IG1hcmdpbiwgZnJp bmdlIG9yIHNjcm9sbGJhciBhcmVhCisgICAgICAgICBleGNlcHQgZm9yIGhlYWRlciBsaW5lIGFu ZCBtb2RlIGxpbmUuICAqLworICAgICAgaWYgKHggPCBsZWZ0X3ggJiYgIXMtPnJvdy0+bW9kZV9s aW5lX3ApCisgICAgICAgIHsKKyAgICAgICAgICBiYWNrZ3JvdW5kX3dpZHRoIC09IGxlZnRfeCAt IHg7CisgICAgICAgICAgeCA9IGxlZnRfeDsKKyAgICAgICAgfQorICAgICAgaWYgKGJhY2tncm91 bmRfd2lkdGggPiAwKQorICAgICAgIC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bGlwX3RvX3JvdyAodywg cm93LCBURVhUX0FSRUEsIGhkYyk7CisgICAgICBpbnQgcnggPSBmeDsKKyAgICAgIGludCByeSA9 IGZ5OworICAgICAgaW50IHJ3ID0gd2Q7CisgICAgICBpbnQgcmggPSBoOworLyoKKyAgICBmcHJp bnRmIChzdGRlcnIsICJNQ19IQkFSOiAgZnggKCVkKSB8IGZ5ICglZCkgfCB3ZCAoJWQpIHwgaCAo JWQpXG4iLCByeCwgcnksIHJ3LCByaCk7CisqLworICAgICAgdzMyX2ZpbGxfYXJlYSAoZiwgaGRj LCBjdXJzb3JfY29sb3IsIHJ4LCByeSwgcncsIHJoKTsKKyAgICAgIHczMl9zZXRfY2xpcF9yZWN0 YW5nbGUgKGhkYywgTlVMTCk7CisgICAgICByZWxlYXNlX2ZyYW1lX2RjIChmLCBoZGMpOworICAg IH0KK30KKworLyogUklGOiBEcmF3IG9yIGNsZWFyIGN1cnNvciBvbiB3aW5kb3cgVy4gICovCitz dGF0aWMgdm9pZAorbWNfdzMyX2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywg c3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAg ICAgICAgICAgICAgICBpbnQgeCwgaW50IGZ4LCBpbnQgeSwgaW50IGZ5LCBpbnQgaHBvcywgaW50 IHZwb3MsIGludCB3ZCwgaW50IGgsCisgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxz bCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgIGlu dCBjdXJzb3Jfd2lkdGgsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwgYm9vbCBvbl9wLCBi b29sIGFjdGl2ZV9wKQoreworICBpZiAob25fcCkKKyAgICB7CisgICAgICAvKiBJZiB0aGlzIGlz IHRoZSBhY3RpdmUgY3Vyc29yLCB3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worICAgICAg ICAgIC8qIElmIHRoZSBzaXplIG9mIHRoZSBhY3RpdmUgY3Vyc29yIGNoYW5nZWQsIGRlc3Ryb3kg dGhlIG9sZAorICAgICAgICAgICAgIHN5c3RlbSBjYXJldC4gICovCisgICAgICAgICAgaWYgKHcz Ml9zeXN0ZW1fY2FyZXRfaHduZAorICAgICAgICAgICAgICAmJiAodzMyX3N5c3RlbV9jYXJldF9o ZWlnaHQgIT0gaCkpCisgICAgICAgICAgICBQb3N0TWVzc2FnZSAoaHduZCwgV01fRU1BQ1NfREVT VFJPWV9DQVJFVCwgMCwgMCk7CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJldF9oZWlnaHQgPSBo OworICAgICAgICAgIC8qIE1vdmUgdGhlIHN5c3RlbSBjYXJldC4gICovCisgICAgICAgICAgUG9z dE1lc3NhZ2UgKGh3bmQsIFdNX0VNQUNTX1RSQUNLX0NBUkVULCAwLCAwKTsKKyAgICAgICAgfQor ICAgICAgLyogVGhlIGZyaW5nZSBiaXRtYXBzIGFyZSBwcmVzZW50bHkgaGFuZGxlZCBlbHNld2hl cmUsIGJ1dCBjb3VsZCBzb21lZGF5CisgICAgICBiZSBtYW5hZ2VkIChpbiBwYXJ0KSBhdCB0aGlz IHNlY3Rpb24gb2YgY29kZS4gKi8KKyAgICAgIGlmIChyb3ctPmV4YWN0X3dpbmRvd193aWR0aF9s aW5lX3AKKyAgICAgICAgICAmJiAocm93LT5yZXZlcnNlZF9wCisgICAgICAgICAgICAgPyAoaHBv cyA8IDApCisgICAgICAgICAgICAgOiAoaHBvcyA+PSByb3ctPnVzZWRbVEVYVF9BUkVBXSkpKQor ICAgICAgICB7CisgICAgICAgICAgcm93LT5jdXJzb3JfaW5fZnJpbmdlX3AgPSB0cnVlOworICAg ICAgICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93LCByb3ctPnJldmVyc2VkX3AsIGN1 cnNvcl90eXBlKTsKKyAgICAgICAgICByZXR1cm47CisgICAgICAg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c29y X3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNv ciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAg ICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29y X3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGN1cnNvcl9nbHlwaC0+dHlwZSA9 PSBJTUFHRV9HTFlQSCAmJiBsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJs dWUgPj0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sg YGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgICBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgICAg bWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwg aHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJz b3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgICAgfQorICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNr IGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAgICAg ICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHczMmZucy5jLiAgKi8KKyAg ICAgICAgICAgICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICA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Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID4gcmVnaW9uX2JlZworICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zIDwgcmVnaW9uX2VuZCkK KyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9p ZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluLXJlZ2lvbi1wcmUtenYtZmFj ZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2Fj dGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZl X3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFj ZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAg ICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01f SUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgZ2Nf dmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAg ICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3Jl Z2lvbl9iZXR3ZWVuX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVf ZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1j dXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1 Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0 aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91 bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAg ICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+YmFja2dyb3Vu ZDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBp ZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBf bmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXBy ZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFj ZSAqaG9sbG93X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19pbmFjdGl2 ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91 bmQgPSBob2xsb3dfaW5hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfaW5hY3RpdmVfZmFjZS0+YmFj a2dyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZi0+b3V0 cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MgPSBYQ3JlYXRlR0MgKE5VTEwsIEZSQU1FX1czMl9XSU5E T1cgKGYpLCBtYXNrLCAmZ2NfdmFsdWVzKTsKKyAgICAgICAgICAgICAgYmxvY2tfaW5wdXQgKCk7 CisgICAgICAgICAgICAgIC8qIEZvcmNlIGBtY193MzJfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBz LT5mLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycuICAqLworICAgICAgICAgICAgICBib29s IGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGgg KHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwg d2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAgIGYtPm91dHB1dF9kYXRh LnczMi0+Y3Vyc29yX2djID0gb3JpZ2luYWxfY3Vyc29yX2djOworICAgICAgICAgICAgICB1bmJs b2NrX2lucHV0ICgpOworICAgICAgICAgICAgICBtY193MzJfZHJhd19ob2xsb3dfY3Vyc29yICh3 LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAg ICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19IT0xMT1dfQk9YOgorICAg IHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUg Pj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0 cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0 YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgIG1jX3czMl9kcmF3 X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3Ms IHdkLCBoKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9y aWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAg bWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwg aHBvcywgdnBvcywgd2QsIGgpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfRklM TEVEX0JPWDoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAw ICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBo aWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisg ICAgICAgICAgZnVuY3Rpb25hbGl0eSBvZiBgeF9tYWtlX2djJyBpbiB3MzJmbnMuYy4gICovCisg ICAgICAgIC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yc29yX2djX3AgPSBmYWxzZTsKKyAgICAgICAg ICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgRFJBV19DVVJTT1IsIHgs IGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsLCBnbHlw aF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgY3Vyc29yX2djX3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOwor ICAgIH0KKyAgICBjYXNlIE1DX0JBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYm IGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAv KiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4g ICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBjb2xvcl9w aXhlbDsKKyAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsK KyAgICAgICAgICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngs IHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOwor ICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vy c29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAg ICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAg ICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBo cG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1 cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAg ICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfSEJBUjoKKyAgICB7CisgICAg ICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisg ICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRh LnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5j dXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZp c2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3 LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9n Y19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNv cl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNl CisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlf cCA9IGZhbHNlOworICAgICAgICAgICAgbWNfdzMyX2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4 LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZp c2libGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgZGVm YXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICB9CisgICAgfQorfQorCisvKiBEcmF3IGds eXBoIHN0cmluZyBTLiAgKi8KK3N0YXRpYyB2b2lkCittY193MzJfZHJhd19nbHlwaF9zdHJpbmcg KHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3Ry dWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNf UkdCIGxzbCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLAorICAgICAgICAgICAgICAgICAg ICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLCBpbnQgY3Vyc29yX3dpZHRo LAorICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wLCBib29sIGN1cnNvcl9n Y19wKQoreworICBib29sIHJlbGllZl9kcmF3bl9wID0gMDsKKyAgLyogSWYgUyBkcmF3cyBpbnRv IHRoZSBiYWNrZ3JvdW5kIG9mIGl0cyBzdWNjZXNzb3IsIGRyYXcgdGhlCisgICAgIGJhY2tncm91 bmQgb2YgdGhlIHN1Y2Nlc3NvciBmaXJzdCBzbyB0aGF0IFMgY2FuIGRyYXcgaW50byBpdC4KKyAg ICAgVGhpcyBtYWtlcyBTLT5uZXh0IHVzZSBYRHJhd1N0cmluZyBpbnN0ZWFkIG9mIFhEcmF3SW1h Z2VTdHJpbmcuICAqLworICBpZiA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AgICBicmVhazsK KyAgICBjYXNlIEdMWVBITEVTU19HTFlQSDoKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMpCisg ICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICAgICAg ICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIGZhbHNlKTsKKyAgICAgIHhfZHJh d19nbHlwaGxlc3NfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgYnJlYWs7Cisg ICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICAgIH0KKyAgaWYgKCFzLT5mb3Jf b3ZlcmxhcHMpCisgICAgeworICAgICAgLyogRHJhdyB1bmRlcmxpbmUuICAqLworICAgICAgaWYg KHMtPmZhY2UtPnVuZGVybGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKHMtPmZhY2Ut PnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgQ09MT1JSRUYgY29sb3I7CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRl cmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgICAgY29sb3IgPSBzLT5nYy0+Zm9yZWdy b3VuZDsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGNvbG9yID0gcy0+ZmFj ZS0+dW5kZXJsaW5lX2NvbG9yOworICAgICAgICAgICAgICB3MzJfZHJhd191bmRlcndhdmUgKHMs IGNvbG9yKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChzLT5mYWNlLT51bmRl cmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgaW50 IHk7CisgICAgICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGlu ZV9wCisgICAgICAgICAgICAgICAgICAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9 PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg LyogV2UgdXNlIHRoZSBzYW1lIHVuZGVybGluZSBzdHlsZSBhcyB0aGUgcHJldmlvdXMgb25lLiAg Ki8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPnByZXYtPnVuZGVybGluZV90aGlj a25lc3M7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGluZV9w b3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSB0aGlja25l c3MuICBEZWZhdWx0IGlzIDEgcGl4ZWwuICAqLworICAgICAgICAgICAgICAgICAgaWYgKHMtPmZv bnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAgICAgICAgICAg ICAgIHRoaWNrbmVzcyA9IHMtPmZvbnQtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAg ICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2VudF9saW5lKQorICAgICAgICAgICAg ICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSB0aGlja25lc3MpIC0gKHMtPnliYXNlIC0g cy0+eSk7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSBwb3NpdGlvbi4gIFRoaXMg aXMgdGhlIHJlY29tbWVuZGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgdmVydGljYWwgb2Zm c2V0IGluIHBpeGVscyBmcm9tIHRoZSBiYXNlbGluZSB0byB0aGUgdG9wIG9mCisgICAgICAgICAg ICAgICAgICAgICAgICAgdGhlIHVuZGVybGluZS4gIFRoaXMgaXMgYSBzaWduZWQgdmFsdWUgYWNj b3JkaW5nIHRvIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgIHNwZWNzLCBhbmQgaXRzIGRl ZmF1bHQgaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICBST1VORCAoKG1heGltdW1fZGVzY2Vu dCkgLyAyKSwgd2l0aAorICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EICh4KSA9IGZsb29y ICh4ICsgMC41KSAgKi8KKyAgICAgICAgICAgICAgICAgICAgICBpZiAoeF91c2VfdW5kZXJsaW5l X3Bvc2l0aW9uX3Byb3BlcnRpZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcy0+Zm9u dCAmJiBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb24gPj0gMCkKKyAgICAgICAgICAgICAgICAg ICAgICAgIHBvc2l0aW9uID0gcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKHMtPmZvbnQpCisgICAgICAgICAgICAgICAgICAgICAgICBw b3NpdGlvbiA9IChzLT5mb250LT5kZXNjZW50ICsgMSkgLyAyOworICAgICAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IG1heCAocG9zaXRpb24sIHVuZGVybGlu ZV9taW5pbXVtX29mZnNldCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAvKiBD aGVjayB0aGUgc2FuaXR5IG9mIHRoaWNrbmVzcyBhbmQgcG9zaXRpb24uICBXZSBzaG91bGQKKyAg ICAgICAgICAgICAgICAgYXZvaWQgZHJhd2luZyB1bmRlcmxpbmUgb3V0IG9mIHRoZSBjdXJyZW50 IGxpbmUgYXJlYS4gICovCisgICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDw9IHMt PnliYXNlICsgcG9zaXRpb24pCisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0 IC0gMSkgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5o ZWlnaHQgPCBzLT55YmFzZSArIHBvc2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAgICAg IHRoaWNrbmVzcyA9IChzLT55ICsgcy0+aGVpZ2h0KSAtIChzLT55YmFzZSArIHBvc2l0aW9uKTsK KyAgICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVzczsKKyAgICAg ICAgICAgICAgcy0+dW5kZXJsaW5lX3Bvc2l0aW9uID1wb3NpdGlvbjsKKyAgICAgICAgICAgICAg eSA9IHMtPnliYXNlICsgcG9zaXRpb247CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRl cmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwg cy0+aGRjLCBzLT5nYy0+Zm9yZWdyb3VuZCwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICB5LCBzLT53aWR0aCwgMSk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmZhY2UtPnVuZGVybGluZV9jb2xv ciwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5LCBzLT53aWR0aCwgMSk7 CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgb3ZlcmxpbmUuICAqLwor ICAgICAgaWYgKHMtPmZhY2UtPm92ZXJsaW5lX3ApCisgICAgICAgIHsKKyAgICAgICAgICB1bnNp Z25lZCBsb25nIGR5ID0gMCwgaCA9IDE7CisgICAgICAgICAgaWYgKHMtPmZhY2UtPm92ZXJsaW5l X2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+ aGRjLCBzLT5nYy0+Zm9yZWdyb3VuZCwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg IHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmZhY2UtPm92ZXJsaW5lX2NvbG9yLCBz LT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT55ICsgZHksIHMtPndpZHRoLCBo KTsKKyAgICAgICAgfQorICAgICAgLyogRHJhdyBzdHJpa2UtdGhyb3VnaC4gICovCisgICAgICBp ZiAocy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfcAorICAgICAgICAgICYmICFGT05UX1RFWFRNRVRS SUMgKHMtPmZvbnQpLnRtU3RydWNrT3V0KQorICAgICAgICB7CisgICAgICAgICAgdW5zaWduZWQg bG9uZyBoID0gMTsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIGR5ID0gKHMtPmhlaWdodCAtIGgp IC8gMjsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3JfZGVmYXVs dGVkX3ApCisgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmdjLT5m b3JlZ3JvdW5kLCBzLT54LCBzLT55ICsgZHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBz LT53aWR0aCwgaCk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAo cy0+Ziwgcy0+aGRjLCBzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvciwgcy0+eCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICB9 CisgICAgICAvKiBEcmF3IHJlbGllZiBpZiBub3QgeWV0IGRyYXduLiAgKi8KKyAgICAgIGlmICgh cmVsaWVmX2RyYXduX3AgJiYgcy0+ZmFjZS0+Ym94ICE9IEZBQ0VfTk9fQk9YKQorICAgICAgICB4 X2RyYXdfZ2x5cGhfc3RyaW5nX2JveCAocyk7CisgICAgICBpZiAocy0+cHJldikKKyAgICAgICAg eworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKnByZXY7CisgICAgICAgICAgZm9yIChw cmV2ID0gcy0+cHJldjsgcHJldjsgcHJldiA9IHByZXYtPnByZXYpCisgICAgICAgICAgICBpZiAo cHJldi0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAgICAmJiBwcmV2LT54ICsgcHJldi0+d2lk dGggKyBwcmV2LT5yaWdodF9vdmVyaGFuZyA+IHMtPngpCisgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAvKiBBcyBwcmV2IHdhcyBkcmF3biB3aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24g YXJlYSwgd2UKKyAgICAgICAgICAgICAgICAgICBtdXN0IGRyYXcgdGhlIHJpZ2h0X292ZXJoYW5n IHBhcnQgdXNpbmcgcy0+aGwgbm93LiAgKi8KKyAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5 cGhzX2ZhY2Ugc2F2ZSA9IHByZXYtPmhsOworICAgICAgICAgICAgICAgIHByZXYtPmhsID0gcy0+ aGw7CisgICAgICAgICAgICAgICAgbWNfdzMyX3NldF9nbHlwaF9zdHJpbmdfZ2MgKHByZXYsIGN1 cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdf ZXhhY3RseSAocywgcHJldik7CisgICAgICAgICAgICAgICAgaWYgKHByZXYtPmZpcnN0X2dseXBo LT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3Ry aW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOwor ICAgICAgICAgICAgICAgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKHByZXYtPmhkYywgTlVMTCk7 CisgICAgICAgICAgICAgICAgcHJldi0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIHByZXYt Pm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHMt Pm5leHQpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpuZXh0Owor ICAgICAgICAgIGZvciAobmV4dCA9IHMtPm5leHQ7IG5leHQ7IG5leHQgPSBuZXh0LT5uZXh0KQor ICAgICAgICAgICAgaWYgKG5leHQtPmhsICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYgbmV4 dC0+eCAtIG5leHQtPmxlZnRfb3ZlcmhhbmcgPCBzLT54ICsgcy0+d2lkdGgpCisgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBcyBuZXh0IHdpbGwgYmUgZHJhd24gd2hpbGUgY2xp cHBlZCB0byBpdHMgb3duIGFyZWEsCisgICAgICAgICAgICAgICAgICAgd2UgbXVzdCBkcmF3IHRo ZSBsZWZ0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwgbm93LiAgKi8KKyAgICAgICAgICAgICAg ICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9IG5leHQtPmhsOworICAgICAgICAgICAgICAg IG5leHQtPmhsID0gcy0+aGw7CisgICAgICAgICAgICAgICAgbWNfdzMyX3NldF9nbHlwaF9zdHJp bmdfZ2MgKG5leHQsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9nbHlwaF9z dHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgbmV4dCk7CisgICAgICAgICAgICAgICAgaWYgKG5l eHQtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB4 X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVn cm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKG5l eHQtPmhkYywgTlVMTCk7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzYXZlOworICAgICAg ICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgICAgbmV4dC0+Y2xp cF9oZWFkID0gcy0+bmV4dDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAv KiBSZXNldCBjbGlwcGluZy4gICovCisgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKHMtPmhkYywg TlVMTCk7CisgIHMtPm51bV9jbGlwcyA9IDA7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JT ICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBGcmluZ2UgYml0bWFwcy4gICov CiAKIHN0YXRpYyBpbnQgbWF4X2ZyaW5nZV9ibXAgPSAwOwpAQCAtNTQ1LDYgKzE0MTcsMTUgQEAg eF91cGRhdGVfYmVnaW4gKHN0cnVjdCBmcmFtZSAqZikKICAgaWYgKCEgRlJBTUVfVzMyX1AgKGYp KQogICAgIHJldHVybjsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IGY7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICAgLyogUmVnZW5lcmF0ZSBkaXNwbGF5IHBhbGV0dGUgYmVmb3Jl IGRyYXdpbmcgaWYgbGlzdCBvZiByZXF1ZXN0ZWQKICAgICAgY29sb3JzIGhhcyBjaGFuZ2VkLiAq LwogICBpZiAoZGlzcGxheV9pbmZvLT5yZWdlbl9wYWxldHRlKQpAQCAtNzU0LDYgKzE2MzUsMTYg QEAgeF91cGRhdGVfZW5kIChzdHJ1Y3QgZnJhbWUgKmYpCiAKICAgLyogTW91c2UgaGlnaGxpZ2h0 IG1heSBiZSBkaXNwbGF5ZWQgYWdhaW4uICAqLwogICBNT1VTRV9ITF9JTkZPIChmKS0+bW91c2Vf ZmFjZV9kZWZlciA9IGZhbHNlOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gTlVMTDsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAKQEAgLTQwNDEsMTMgKzQ5MzIsN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OyAqKi8KLQkgIC8qIFRyeSB0byBub3QgZHJhdyBvdmVyIGNo aWxkIGZyYW1lcy4gICovCi0JICBTZXRXaW5kb3dQb3MgKGh3bmQsIEhXTkRfQk9UVE9NLCBsZWZ0 LCB0b3AsIHdpZHRoLCBtYXggKGhlaWdodCwgMSksCi0gICAgICAgICAgICAgICAgICAgICAgICBT V1BfRlJBTUVDSEFOR0VEKTsKKyAgICAgICAgICBpZiAobGVmdCA8PSBiYXItPmxlZnQpCisgICAg ICAgICAgICBteV9zaG93X3dpbmRvdyAoZiwgaHduZCwgU1dfSElERSk7CisgICAgICAgICAgTW92 ZVdpbmRvdyAoaHduZCwgbGVmdCwgdG9wLCB3aWR0aCwgbWF4IChoZWlnaHQsIDEpLCBsZWZ0IDw9 IGJhci0+bGVmdCk7CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKwogCiAJICBzaS5jYlNpemUgPSBzaXplb2YgKHNpKTsKIAkgIHNpLmZNYXNr ID0gU0lGX1JBTkdFOwpAQCAtNDMxNiw2ICs1MjY4LDIxIEBAIHczMl9qdWRnZV9zY3JvbGxfYmFy cyAoc3RydWN0IGZyYW1lICpmKQogICAgIHsKICAgICAgIHN0cnVjdCBzY3JvbGxfYmFyICpiID0g WFNDUk9MTF9CQVIgKGJhcik7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgICAgIC8qIGBEZXN0cm95V2luZG93JyB3aXRoaW4gYHhfc2Ny b2xsX2Jhcl9yZW1vdmUnIHJlcGFpbnRzIHRoZSByZWN0YW5nbGUuCisgICAgICBUaGVyZWZvcmUs IHdlIGZpcnN0IHNlbmQgYSBtZXNzYWdlIHRvIGluaGliaXQgcmVwYWludGluZy4gKi8KKyAgICAg IGlmICghV0lORE9XX0xJVkVfUCAoYi0+d2luZG93KSkKKyAgICAgICAgeworICAgICAgICAgIEhX TkQgaHduZCA9IFNDUk9MTF9CQVJfVzMyX1dJTkRPVyAoYik7CisgICAgICAgICAgU2VuZE1lc3Nh Z2UgKGh3bmQsIFdNX1NFVFJFRFJBVywgZmFsc2UsIDApOworICAgICAgICB9CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICAgIHhfc2Nyb2xsX2Jhcl9yZW1vdmUgKGIpOwogCiAg ICAgICBuZXh0ID0gYi0+bmV4dDsKQEAgLTcwOTEsNiArODA1OCwyMSBAQCBleHRlcm4gZnJhbWVf cGFybV9oYW5kbGVyIHczMl9mcmFtZV9wYXJtX2hhbmRsZXJzW107CiAKIHN0YXRpYyBzdHJ1Y3Qg cmVkaXNwbGF5X2ludGVyZmFjZSB3MzJfcmVkaXNwbGF5X2ludGVyZmFjZSA9CiB7CisKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRp c3BsYXlfaW50ZXJmYWNlJyBpbiBgdzMydGVybS5jYCBtdXN0IGJlIGluIHRoZSBleGFjdCBzYW1l IG9yZGVyIGFzIHRoZQorYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBkaXNwZXh0ZXJuLmhgISAq LworCisgIG1jX3hfd3JpdGVfZ2x5cGhzLAorICBtY193MzJfZHJhd193aW5kb3dfY3Vyc29yLAor ICBtY193MzJfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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jaGVfYWxsb2NhdGVkWzRdOworICAgIHB0cmRpZmZfdCBjYWNoZV91c2VkWzRdOwor ICAgIHN0cnVjdCBtY19jb250ZW50cworICAgIHsKKyAgICAgIGJvb2xfYmYgc2FtZV9wIDogMTsK KyAgICAgIHN0cnVjdCBnbHlwaCBnbHlwaDsKKyAgICAgIGludCB4OworICAgICAgaW50IGZ4Owor ICAgICAgaW50IHk7CisgICAgICBpbnQgZnk7CisgICAgICBpbnQgaHBvczsKKyAgICAgIGludCB2 cG9zOworICAgICAgaW50IHdkOworICAgICAgaW50IGg7CisgICAgICBlbnVtIG1jX2N1cnNvcl90 eXBlCisgICAgICB7CisgICAgICAgIC8qIE5PVEU6ICBUaGUgZnJpbmdlIGJpdG1hcCBmcmFtZXdv cmsgcmVsaWVzIHVwb24gTUNfTk9fRlJJTkdFX0JJVE1BUAorICAgICAgICBoYXZpbmcgYSB2YWx1 ZSBvZiB6ZXJvICgwKS4gKi8KKyAgICAgICAgTUNfTk9fRlJJTkdFX0JJVE1BUCwKKyAgICAgICAg TUNfTk9fQ1VSU09SLAorICAgICAgICBNQ19SSUdIVF9GUklOR0VfQklUTUFQLAorICAgICAgICBN Q19MRUZUX0ZSSU5HRV9CSVRNQVAsCisgICAgICAgIE1DX0ZSQU1FRF9CT1gsCisgICAgICAgIE1D X0ZJTExFRF9CT1gsCisgICAgICAgIE1DX0hPTExPV19CT1gsCisgICAgICAgIE1DX0JBUiwKKyAg ICAgICAgTUNfSEJBUgorICAgICAgfSBjdXJzb3JfdHlwZTsKKyAgICAgIGludCBjdXJzb3Jfd2lk dGg7CisgICAgICBzdHJ1Y3QgbWNfUkdCCisgICAgICB7CisgICAgICAgIGRvdWJsZSByZWQ7Cisg ICAgICAgIGRvdWJsZSBncmVlbjsKKyAgICAgICAgZG91YmxlIGJsdWU7CisgICAgICB9IGZnLCBi ZzsKKyAgICAgIGJvb2xfYmYgYWN0aXZlX3AgOiAxOworICAgICAgZW51bSBtY19mbGF2b3IKKyAg ICA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UV08sCisgICAgRVhQT1NFX0xJTkUKKyAgfSBtY19yZWRyYXdfcm93X3R5cGVfX2Zyb21f d2hlcmU7Cit9IG1jX21hdHJpeDsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgICAvKiBDdXJzb3IgdHlwZSBvZiBsYXN0IGN1cnNv ciBkcmF3biBvbiB0aGUgd2luZG93LiAgKi8KICAgICBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIHBo eXNfY3Vyc29yX3R5cGU7CiAKZGlmZiAtLWdpdCBhL3NyYy94ZGlzcC5jIGIvc3JjL3hkaXNwLmMK aW5kZXggYTg4ZmM2OS4uM2UxYzY0YSAxMDA2NDQKLS0tIGEvc3JjL3hkaXNwLmMKKysrIGIvc3Jj L3hkaXNwLmMKQEAgLTkyMSw2ICs5MjEsNDY0OSBAQCBzdGF0aWMgdm9pZCBzaG93X21vdXNlX2Zh Y2UgKE1vdXNlX0hMSW5mbyAqLCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UpOwogc3RhdGljIGJvb2wg Y29vcmRzX2luX21vdXNlX2ZhY2VfcCAoc3RydWN0IHdpbmRvdyAqLCBpbnQsIGludCk7CiAKIAor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisK Ky8qIE1VTFRJUExFLUNVUlNPUlM6ICBFbWFjcyBCdWcgIzIyODczIChmZWF0dXJlIHJlcXVlc3Qp CisKKyAgQ1JPU1NIQUlSUzogIEVtYWNzIEJ1ZyAjMTc2ODQgKGZlYXR1cmUgcmVxdWVzdCkKKwor CitWRVJTSU9OOgorCistIDAyMS4wMDIgWzA2LzE1LzIwMTldCistIDAyMS4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icmVhazsJCQkJCQkJXAorCQkJCQkJCQkJXAorCSAg ICBjYXNlIFNUUkVUQ0hfR0xZUEg6CQkJCQkJXAorCSAgICAgIE1DX0JVSUxEX1NUUkVUQ0hfR0xZ UEhfU1RSSU5HIChTVEFSVCwgRU5ELCBIRUFELCBUQUlMLAlcCisJCQkJCSAgSEwsIFgsIExBU1Rf WCk7CQlcCisJICAgICAgYnJlYWs7CQkJCQkJCVwKKwkJCQkJCQkJCVwKKwkgICAgY2FzZSBJTUFH RV9HTFlQSDoJCQkJCQlcCisJICAgICAgTUNfQlVJTERfSU1BR0VfR0xZUEhfU1RSSU5HIChTVEFS VCwgRU5ELCBIRUFELCBUQUlMLAkJXAorCQkJCQlITCwgWCwgTEFTVF9YKTsJCQlcCisJICAgICAg YnJlYWs7CisKKyNkZWZpbmUgTUNfQlVJTERfR0xZUEhfU1RSSU5HU19YVyhTVEFSVCwgRU5ELCBI RUFELCBUQUlMLCBITCwgWCwgTEFTVF9YKQlcCisgICAgICAgICAgICBjYXNlIFhXSURHRVRfR0xZ UEg6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAg ICAgIE1DX0JVSUxEX1hXSURHRVRfR0xZUEhfU1RSSU5HIChTVEFSVCwgRU5ELCBIRUFELCBUQUlM LCAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBITCwg WCwgTEFTVF9YKTsgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgIGJyZWFrOworCisjZGVm aW5lIE1DX0JVSUxEX0dMWVBIX1NUUklOR1NfMihTVEFSVCwgRU5ELCBIRUFELCBUQUlMLCBITCwg WCwgTEFTVF9YKQlcCisJICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgkJCQkJXAorCSAgICAgIE1D X0JVSUxEX0dMWVBITEVTU19HTFlQSF9TVFJJTkcgKFNUQVJULCBFTkQsIEhFQUQsIFRBSUwsCVwK KwkJCQkJICAgI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XJnKTsKKyAgZm9yIChwdHJk aWZmX3QgaSA9IDE7IGkgPCBjb3VudDsgaSsrKQorICAgIHsKKyAgICAgIExpc3BfT2JqZWN0IGVs ZW0gPSBGY29ucyAodmFfYXJnIChhcCwgTGlzcF9PYmplY3QpLCBRbmlsKTsKKyAgICAgIFhTRVRD RFIgKHRhaWwsIGVsZW0pOworICAgICAgdGFpbCA9IGVsZW07CisgICAgfQorICB2YV9lbmQgKGFw KTsKKyAgcmV0dXJuIHZhbDsKK30KKworTGlzcF9PYmplY3QKK21jX21lbXEgKExpc3BfT2JqZWN0 IGVsdCwgTGlzcF9PYmplY3QgbGlzdCkKK3sKKyAgd2hpbGUgKDEpCisgICAgeworICAgICAgaWYg KCFDT05TUCAobGlzdCkgfHwgRVEgKFhDQVIgKGxpc3QpLCBlbHQpKQorICAgICAgICBicmVhazsK KyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpIHx8IEVR IChYQ0FSIChsaXN0KSwgZWx0KSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAo bGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KSB8fCBFUSAoWENBUiAobGlzdCksIGVsdCkp CisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgIH0KKyAgcmV0 dXJuIGxpc3Q7Cit9CisKK0xpc3BfT2JqZWN0CittY19udGggKGludCBudW0sIExpc3BfT2JqZWN0 IGxpc3QpCit7CisgIGZvciAoaW50IGkgPSAwOyBpIDwgbnVtICYmICFOSUxQIChsaXN0KTsgaSsr KQorICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgaWYgKENPTlNQIChsaXN0KSkKKyAgICByZXR1 cm4gWENBUiAobGlzdCk7CisgICAgZWxzZQorICAgICAgcmV0dXJuIFFuaWw7Cit9CisKK0xpc3Bf T2JqZWN0CittY19hc3NxIChMaXNwX09iamVjdCBrZXksIExpc3BfT2JqZWN0IGxpc3QpCit7Cisg IHdoaWxlICgxKQorICAgIHsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwg KENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhDQVIgKFhDQVIgKGxp c3QpKSwga2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOwor ICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3Qp KQorICAgICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBrZXkpKSkKKyAgICAg ICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChs aXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYm IEVRIChYQ0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxp c3QgPSBYQ0RSIChsaXN0KTsKKyAgICB9CisgIGlmIChDT05TUCAobGlzdCkpCisgICAgcmV0dXJu IFhDQVIgKGxpc3QpOworICAgIGVsc2UKKyAgICAgIHJldHVybiBRbmlsOworfQorCitMaXNwX09i amVjdAorbWNfYXNzb2MgKExpc3BfT2JqZWN0IGtleSwgTGlzcF9PYmplY3QgbGlzdCkKK3sKKyAg TGlzcF9PYmplY3QgY2FyOworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBpZiAoIUNPTlNQIChs aXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYm IChjYXIgPSBYQ0FSIChYQ0FSIChsaXN0KSksCisgICAgICAgICAgICAgICAgICBFUSAoY2FyLCBr ZXkpIHx8ICFOSUxQIChGZXF1YWwgKGNhciwga2V5KSkpKSkKKyAgICAgICAgYnJlYWs7CisgICAg ICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAg IHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYmIChjYXIgPSBYQ0FSIChY Q0FSIChsaXN0KSksCisgICAgICAgICAgICAgICAgICBFUSAoY2FyLCBrZXkpIHx8ICFOSUxQIChG ZXF1YWwgKGNhciwga2V5KSkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAo bGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENB UiAobGlzdCkpCisgICAgICAgICAgICAgICYmIChjYXIgPSBYQ0FSIChYQ0FSIChsaXN0KSksCisg ICAgICAgICAgICAgICAgICBFUSAoY2FyLCBrZXkpIHx8ICFOSUxQIChGZXF1YWwgKGNhciwga2V5 KSkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgfQor ICBpZiAoQ09OU1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FSIChsaXN0KTsKKyAgICBlbHNlCisg ICAgICByZXR1cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QKK21jX3BsaXN0X2dldCAoTGlzcF9P YmplY3QgcGxpc3QsIExpc3BfT2JqZWN0IHByb3ApCit7CisgIExpc3BfT2JqZWN0IHRhaWwsIGhh bGZ0YWlsOworICAvKiBoYWxmdGFpbCBpcyB1c2VkIHRvIGRldGVjdCBjaXJjdWxhciBsaXN0cy4g ICovCisgIHRhaWwgPSBoYWxmdGFpbCA9IHBsaXN0OworICB3aGlsZSAoQ09OU1AgKHRhaWwpICYm IENPTlNQIChYQ0RSICh0YWlsKSkpCisgICAgeworICAgICAgaWYgKEVRIChwcm9wLCBYQ0FSICh0 YWlsKSkpCisgICAgICAgIHJldHVybiBYQ0FSIChYQ0RSICh0YWlsKSk7CisgICAgICB0YWlsID0g WENEUiAoWENEUiAodGFpbCkpOworICAgICAgaGFsZnRhaWwgPSBYQ0RSIChoYWxmdGFpbCk7Cisg ICAgICBpZiAoRVEgKHRhaWwsIGhhbGZ0YWlsKSkKKyAgICAgICAgYnJlYWs7CisgICAgfQorICBy ZXR1cm4gUW5pbDsKK30KKworLyogUkVHSU9OIEJFR0lOOiAgbWNfcmVnaW9uX2xpbWl0ICgxKQor ICAgUkVHSU9OIEVORDogIG1jX3JlZ2lvbl9saW1pdCAoMCkgKi8KK3B0cmRpZmZfdAorbWNfcmVn aW9uX2xpbWl0IChib29sIGJlZ2luX3ApCit7CisgIGlmICghTklMUCAoVnRyYW5zaWVudF9tYXJr X21vZGUpCisgICAgICAmJiBOSUxQIChWbWFya19ldmVuX2lmX2luYWN0aXZlKQorICAgICAgJiYg TklMUCAoQlZBUiAoY3VycmVudF9idWZmZXIsIG1hcmtfYWN0aXZlKSkpCisgICAgeHNpZ25hbDAg KFFtYXJrX2luYWN0aXZlKTsKKyAgTGlzcF9PYmplY3QgbWFya2VyID0gQlZBUiAoY3VycmVudF9i dWZmZXIsIG1hcmspOworICBpbnQgbSA9IChYTUFSS0VSIChtYXJrZXIpLT5idWZmZXIpCisgICAg ICAgICAgPyBYTUFSS0VSIChtYXJrZXIpLT5jaGFycG9zCisgICAgICAgICAgOiAtMTsKKyAgcmV0 dXJuIChtID09IC0xKQorICAgICAgICAgICA/IC0xCisgICAgICAgICA6IChQVCA8IG0pID09IGJl Z2luX3AKKyAgICAgICAgICAgPyBQVAorICAgICAgICAgOiBjbGlwX3RvX2JvdW5kcyAoQkVHViwg bSwgWlYpOworfQorCisvKiBDaGVjayB0aGUgcHJlc2VuY2Ugb2YgYSBkaXNwbGF5IHByb3BlcnR5 IGFuZCBjb21wdXRlIGl0cyB3aWR0aC4KKyAgIElmIGEgcHJvcGVydHkgd2FzIGZvdW5kIGFuZCBp dHMgd2lkdGggd2FzIGZvdW5kIGFzIHdlbGwsIHJldHVybgorICAgaXRzIHdpZHRoICg+PSAwKSBh bmQgc2V0IHRoZSBwb3NpdGlvbiBvZiB0aGUgZW5kIG9mIHRoZSBwcm9wZXJ0eQorICAgaW4gRU5E UE9TLgorICAgT3RoZXJ3aXNlIGp1c3QgcmV0dXJuIC0xLiAqLworc3RhdGljIGludAorbWNfY2hl Y2tfZGlzcGxheV93aWR0aCAocHRyZGlmZl90IHBvcywgcHRyZGlmZl90IGNvbCwgcHRyZGlmZl90 ICplbmRwb3MpCit7CisgIExpc3BfT2JqZWN0IHZhbCwgb3ZlcmxheTsKKyAgaWYgKENPTlNQICh2 YWwgPSBnZXRfY2hhcl9wcm9wZXJ0eV9hbmRfb3ZlcmxheQorICAgICAgICAgICAgICAobWFrZV9m aXhudW0gKHBvcyksIFFkaXNwbGF5LCBRbmlsLCAmb3ZlcmxheSkpCisgICAgICAmJiBFUSAoUXNw YWNlLCBYQ0FSICh2YWwpKSkKKyAgICB7IC8qIEZJWE1FOiBVc2UgY2FsY19waXhlbF93aWR0aF9v cl9oZWlnaHQuICovCisgICAgICBMaXNwX09iamVjdCBwbGlzdCA9IFhDRFIgKHZhbCksIHByb3A7 CisgICAgICBpbnQgd2lkdGggPSAtMTsKKyAgICAgIEVNQUNTX0lOVCBhbGlnbl90b19tYXggPSAo Y29sIDwgTU9TVF9QT1NJVElWRV9GSVhOVU0gLSBJTlRfTUFYCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IChFTUFDU19JTlQpIElOVF9NQVggKyBjb2wKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogTU9TVF9QT1NJVElWRV9GSVhOVU0pOworICAgICAgaWYgKChw cm9wID0gbWNfcGxpc3RfZ2V0IChwbGlzdCwgUUN3aWR0aCksIFJBTkdFRF9GSVhOVU1QICgwLCBw cm9wLCBJTlRfTUFYKSkKKyAgICAgICAgICB8fCAocHJvcCA9IG1jX3BsaXN0X2dldCAocGxpc3Qs IFFDcmVsYXRpdmVfd2lkdGgpLAorICAgICAgICAgICAgICBSQU5HRURfRklYTlVNUCAoMCwgcHJv cCwgSU5UX01BWCkpKQorICAgICAgICB3aWR0aCA9IFhGSVhOVU0gKHByb3ApOworICAgICAgICBl bHNlIGlmIChGTE9BVFAgKHByb3ApICYmIDAgPD0gWEZMT0FUX0RBVEEgKHByb3ApCisgICAgICAg ICAgICAgICAgICYmIFhGTE9BVF9EQVRBIChwcm9wKSA8PSBJTlRfTUFYKQorICAgICAgICAgIHdp ZHRoID0gKGludCkoWEZMT0FUX0RBVEEgKHByb3ApICsgMC41KTsKKyAgICAgICAgICBlbHNlIGlm ICgocHJvcCA9IG1jX3BsaXN0X2dldCAocGxpc3QsIFFDYWxpZ25fdG8pLAorICAgICAgICAgICAg ICAgICAgICBSQU5HRURfRklYTlVNUCAoY29sLCBwcm9wLCBhbGlnbl90b19tYXgpKSkKKyAgICAg ICAgICAgIHdpZHRoID0gWEZJWE5VTSAocHJvcCkgLSBjb2w7CisgICAgICAgICAgICAgIGVsc2Ug aWYgKEZMT0FUUCAocHJvcCkgJiYgY29sIDw9IFhGTE9BVF9EQVRBIChwcm9wKQorICAgICAgICAg ICAgICAgICAgICAgICAmJiAoWEZMT0FUX0RBVEEgKHByb3ApIDw9IGFsaWduX3RvX21heCkpCisg ICAgICAgICAgICAgICAgd2lkdGggPSAoaW50KShYRkxPQVRfREFUQSAocHJvcCkgKyAwLjUpIC0g Y29sOworICAgICAgaWYgKHdpZHRoID49IDApCisgICAgICAgIHsKKyAgICAgICAgICBwdHJkaWZm X3Qgc3RhcnQ7CisgICAgICAgICAgaWYgKE9WRVJMQVlQIChvdmVybGF5KSkKKyAgICAgICAgICAg ICplbmRwb3MgPSBPVkVSTEFZX1BPU0lUSU9OIChPVkVSTEFZX0VORCAob3ZlcmxheSkpOworICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBnZXRfcHJvcGVydHlfYW5kX3JhbmdlIChwb3Ms IFFkaXNwbGF5LCAmdmFsLCAmc3RhcnQsIGVuZHBvcywgUW5pbCk7CisgICAgICAgICAgLyogRm9y IDpyZWxhdGl2ZS13aWR0aCwgd2UgbmVlZCB0byBtdWx0aXBseSBieSB0aGUgY29sdW1uCisgICAg ICAgICAgICAgd2lkdGggb2YgdGhlIGNoYXJhY3RlciBhdCBQT1MsIGlmIGl0IGlzIGdyZWF0ZXIg dGhhbiAxLiAqLworICAgICAgICAgIGlmICghTklMUCAobWNfcGxpc3RfZ2V0IChwbGlzdCwgUUNy ZWxhdGl2ZV93aWR0aCkpCisgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChjdXJyZW50X2J1 ZmZlciwgZW5hYmxlX211bHRpYnl0ZV9jaGFyYWN0ZXJzKSkpCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIGludCBiLCB3ZDsKKyAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqcCA9IEJZ VEVfUE9TX0FERFIgKENIQVJfVE9fQllURSAocG9zKSk7CisgICAgICAgICAgICAgIE1DX01VTFRJ QllURV9CWVRFU19XSURUSCAocCwgYnVmZmVyX2Rpc3BsYXlfdGFibGUgKCksIGIsIHdkKTsKKyAg ICAgICAgICAgICAgd2lkdGggKj0gd2Q7CisgICAgICAgICAgICB9CisgICAgICAgICAgcmV0dXJu IHdpZHRoOworICAgICAgICB9CisgICAgfQorICByZXR1cm4gLTE7Cit9CisKKy8qIFNjYW5uaW5n IGZyb20gdGhlIGJlZ2lubmluZyBvZiB0aGUgY3VycmVudCBsaW5lLCBzdG9wIGF0IHRoZSBidWZm ZXIKKyAgIHBvc2l0aW9uIEVORFBPUyBvciBhdCB0aGUgY29sdW1uIEdPQUxDT0wgb3IgYXQgdGhl IGVuZCBvZiBsaW5lLCB3aGljaGV2ZXIKKyAgIGNvbWVzIGZpcnN0LgorICAgUmV0dXJuIHRoZSBy ZXN1bHRpbmcgYnVmZmVyIHBvc2l0aW9uIGFuZCBjb2x1bW4gaW4gRU5EUE9TIGFuZCBHT0FMQ09M LgorICAgUFJFVk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Ug KHNjYW4sICZuZXh0X2JvdW5kYXJ5LCBlbmQsIFFuaWwpOworICAgICAgICAgIGlmIChzY2FuICE9 IG9sZF9zY2FuKQorICAgICAgICAgICAgc2Nhbl9ieXRlID0gQ0hBUl9UT19CWVRFIChzY2FuKTsK KyAgICAgICAgICBpZiAoc2NhbiA+PSBlbmQpCisgICAgICAgICAgICBnb3RvIGVuZGxvb3A7Cisg ICAgICAgIH0KKyAgICAgIC8qIFRlc3QgcmVhY2hpbmcgdGhlIGdvYWwgY29sdW1uLiAgV2UgZG8g dGhpcyBhZnRlciBza2lwcGluZworICAgaW52aXNpYmxlIGNoYXJhY3RlcnMsIHNvIHRoYXQgd2Ug cHV0IHBvaW50IGJlZm9yZSB0aGUKKyAgIGNoYXJhY3RlciBvbiB3aGljaCB0aGUgY3Vyc29yIHdp bGwgYXBwZWFyLiAqLworICAgICAgaWYgKGNvbCA+PSBnb2FsKQorICAgICAgICBicmVhazsKKyAg ICAgIHByZXZfY29sID0gY29sOworICAgICAgeyAvKiBDaGVjayBkaXNwbGF5IHByb3BlcnR5LiAq LworICAgICAgICBwdHJkaWZmX3QgZW5kcDsKKyAgICAgICAgaW50IHdpZHRoID0gbWNfY2hlY2tf ZGlzcGxheV93aWR0aCAoc2NhbiwgY29sLCAmZW5kcCk7CisgICAgICAgIGlmICh3aWR0aCA+PSAw KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGNvbCArPSB3aWR0aDsKKyAgICAgICAgICAgIGlm IChlbmRwID4gc2NhbikgLyogQXZvaWQgaW5maW5pdGUgbG9vcHMgd2l0aCAwLXdpZHRoIG92ZXJs YXlzLiAqLworICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2NhbiA9IGVuZHA7Cisg ICAgICAgICAgICAgICAgc2Nhbl9ieXRlID0gQ0hBUl9UT19CWVRFIChzY2FuKTsKKyAgICAgICAg ICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgIH0K KyAgICAgIC8qIENoZWNrIGNvbXBvc2l0aW9uIHNlcXVlbmNlLiAqLworICAgICAgaWYgKGNtcF9p dC5pZCA+PSAwCisgICAgICAgICAgfHwgKHNjYW4gPT0gY21wX2l0LnN0b3BfcG9zCisgICAgICAg ICAgICAgICYmIGNvbXBvc2l0aW9uX3Jlc2VhdF9pdCAoJmNtcF9pdCwgc2Nhbiwgc2Nhbl9ieXRl LCBlbmQsIHcsIE5VTEwsIFFuaWwpKSkKKyAgICAgICAgY29tcG9zaXRpb25fdXBkYXRlX2l0ICgm Y21wX2l0LCBzY2FuLCBzY2FuX2J5dGUsIFFuaWwpOworICAgICAgaWYgKGNtcF9pdC5pZCA+PSAw KQorICAgICAgICB7CisgICAgICAgICAgc2NhbiArPSBjbXBfaXQubmNoYXJzOworICAgICAgICAg IHNjYW5fYnl0ZSArPSBjbXBfaXQubmJ5dGVzOworICAgICAgICAgIGlmIChzY2FuIDw9IGVuZCkK KyAgICAgICAgICAgIGNvbCArPSBjbXBfaXQud2lkdGg7CisgICAgICAgICAgaWYgKGNtcF9pdC50 byA9PSBjbXBfaXQubmdseXBocykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY21wX2l0 LmlkID0gLTE7CisgICAgICAgICAgICAgIGNvbXBvc2l0aW9uX2NvbXB1dGVfc3RvcF9wb3MgKCZj bXBfaXQsIHNjYW4sIHNjYW5fYnl0ZSwgZW5kLCBRbmlsKTsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgY21wX2l0LmZyb20gPSBjbXBfaXQudG87CisgICAg ICAgICAgY29udGludWU7CisgICAgICAgIH0KKyAgICAgIGMgPSBGRVRDSF9CWVRFIChzY2FuX2J5 dGUpOworICAgICAgLyogU2VlIGlmIHRoZXJlIGlzIGEgZGlzcGxheSB0YWJsZSBhbmQgaXQgcmVs YXRlcyB0byB0aGlzIGNoYXJhY3Rlci4gKi8KKyAgICAgIGlmIChkcCAhPSAwCisgICAgICAgICAg JiYgISAobXVsdGlieXRlICYmIExFQURJTkdfQ09ERV9QIChjKSkKKyAgICAgICAgICAmJiBWRUNU T1JQIChESVNQX0NIQVJfVkVDVE9SIChkcCwgYykpKQorICAgICAgICB7CisgICAgICAgICAgTGlz cF9PYmplY3QgY2hhcnZlYzsKKyAgICAgICAgICBwdHJkaWZmX3QgaSwgbjsKKyAgICAgICAgICAv KiBUaGlzIGNoYXJhY3RlciBpcyBkaXNwbGF5ZWQgdXNpbmcgYSB2ZWN0b3Igb2YgZ2x5cGhzLgor ICAgICAgICAgICAgIFVwZGF0ZSB0aGUgY29sdW1uL3Bvc2l0aW9uIGJhc2VkIG9uIHRob3NlIGds eXBocy4gKi8KKyAgICAgICAgICBjaGFydmVjID0gRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpOwor ICAgICAgICAgIG4gPSBBU0laRSAoY2hhcnZlYyk7CisgICAgICAgICAgZm9yIChpID0gMDsgaSA8 IG47IGkrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogVGhpcyBzaG91bGQgYmUg aGFuZGxlZCB0aGUgc2FtZSBhcworICAgICAgICAgICAgICBuZXh0X2VsZW1lbnRfZnJvbV9kaXNw bGF5X3ZlY3RvciBkb2VzIGl0LiAqLworICAgICAgICAgICAgICBMaXNwX09iamVjdCBlbnRyeSA9 IEFSRUYgKGNoYXJ2ZWMsIGkpOworICAgICAgICAgICAgICBpZiAoR0xZUEhfQ09ERV9QIChlbnRy eSkpCisgICAgICAgICAgICAgICAgYyA9IEdMWVBIX0NPREVfQ0hBUiAoZW50cnkpOworICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgYyA9ICcgJzsKKyAgICAgICAgICAgICAgaWYg KGMgPT0gJ1xuJykKKyAgICAgICAgICAgICAgICBnb3RvIGVuZGxvb3A7CisgICAgICAgICAgICAg IGlmIChjID09ICdccicgJiYgRVEgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVfZGlz cGxheSksIFF0KSkKKyAgICAgICAgICAgICAgICBnb3RvIGVuZGxvb3A7CisgICAgICAgICAgICAg IGlmIChjID09ICdcdCcpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgY29s ICs9IHRhYl93aWR0aDsKKyAgICAgICAgICAgICAgICAgIGNvbCA9IGNvbCAvIHRhYl93aWR0aCAq IHRhYl93aWR0aDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgICAgKytjb2w7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAg ZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIFRoZSBkaXNwbGF5IHRhYmxlIGRvZXNu J3QgYWZmZWN0IHRoaXMgY2hhcmFjdGVyOworICAgICAgICAgICAgICAgaXQgZGlzcGxheXMgYXMg aXRzZWxmLiAqLworICAgICAgICAgICAgaWYgKGMgPT0gJ1xuJykKKyAgICAgICAgICAgICAgZ290 byBlbmRsb29wOworICAgICAgICAgICAgaWYgKGMgPT0gJ1xyJyAmJiBFUSAoQlZBUiAoY3VycmVu dF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKQorICAgICAgICAgICAgICBnb3RvIGVu ZGxvb3A7CisgICAgICAgICAgICBpZiAoYyA9PSAnXHQnKQorICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgY29sICs9IHRhYl93aWR0aDsKKyAgICAgICAgICAgICAgICBjb2wgPSBjb2wg LyB0YWJfd2lkdGggKiB0YWJfd2lkdGg7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ZWxzZSBpZiAobXVsdGlieXRlICYmIExFQURJTkdfQ09ERV9QIChjKSkKKyAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAvKiBTdGFydCBvZiBtdWx0aS1ieXRlIGZvcm0uICovCisg ICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyICpwdHI7CisgICAgICAgICAgICAgICAgICBp bnQgYnl0ZXMsIHdpZHRoOworICAgICAgICAgICAgICAgICAgcHRyID0gQllURV9QT1NfQUREUiAo c2Nhbl9ieXRlKTsKKyAgICAgICAgICAgICAgICAgIE1DX01VTFRJQllURV9CWVRFU19XSURUSCAo cHRyLCBkcCwgYnl0ZXMsIHdpZHRoKTsKKyAgICAgICAgICAgICAgICAgIC8qIFN1YnRyYWN0IG9u ZSB0byBjb21wZW5zYXRlIGZvciB0aGUgaW5jcmVtZW50CisgICAgICAgICAgICAgICAgICB0aGF0 IGlzIGdvaW5nIHRvIGhhcHBlbiBiZWxvdy4gKi8KKyAgICAgICAgICAgICAgICAgIHNjYW5fYnl0 ZSArPSBieXRlcyAtIDE7CisgICAgICAgICAgICAgICAgICBjb2wgKz0gd2lkdGg7CisgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKGN0bF9hcnJvdyAmJiAoYyA8IDA0 MCB8fCBjID09IDAxNzcpKQorICAgICAgICAgICAgICAgICAgY29sICs9IDI7CisgICAgICAgICAg ICAgICAgICBlbHNlIGlmIChjIDwgMDQwIHx8IGMgPj0gMDE3NykKKyAgICAgICAgICAgICAgICAg ICAgY29sICs9IDQ7CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg ICAgICBjb2wrKzsKKyAgICAgICAgICB9CisgICAgICBzY2FuKys7CisgICAgICBzY2FuX2J5dGUr KzsKKyAgICB9CisgZW5kbG9vcDoKKyAgbGFzdF9rbm93bl9jb2x1bW4gPSBjb2w7CisgIGxhc3Rf a25vd25fY29sdW1uX3BvaW50ID0gcHQ7CisgIGxhc3Rfa25vd25fY29sdW1uX21vZGlmaWVkID0g TU9ESUZGOworICBpZiAoZ29hbGNvbCkKKyAgICAqZ29hbGNvbCA9IGNvbDsKKyAgaWYgKGVuZHBv cykKKyAgICAqZW5kcG9zID0gc2NhbjsKKyAgaWYgKHByZXZ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ggPSBTQU5FX1RBQl9XSURUSCAoY3VycmVudF9idWZmZXIpOworICBib29sIGN0bF9hcnJv dyA9ICFOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZlciwgY3RsX2Fycm93KSk7CisgIHN0cnVjdCBM aXNwX0NoYXJfVGFibGUgKmRwID0gYnVmZmVyX2Rpc3BsYXlfdGFibGUgKCk7CisgIGlmIChwdCA9 PSBsYXN0X2tub3duX2NvbHVtbl9wb2ludAorICAgICAgJiYgTU9ESUZGID09IGxhc3Rfa25vd25f Y29sdW1uX21vZGlmaWVkKQorICAgIHsKKyAgICAgIGlmIChvbGRfYnVmZmVyKQorICAgICAgICBz ZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKyAgICAgIHJldHVybiBsYXN0X2tub3du X2NvbHVtbjsKKyAgICB9CisgIC8qIElmIHRoZSBidWZmZXIgaGFzIG92ZXJsYXlzLCB0ZXh0IHBy b3BlcnRpZXMsCisgICAgIG9yIG11bHRpYnl0ZSBjaGFyYWN0ZXJzLCB1c2UgYSBtb3JlIGdlbmVy YWwgYWxnb3JpdGhtLiAqLworICBpZiAoYnVmZmVyX2ludGVydmFscyAoY3VycmVudF9idWZmZXIp CisgICAgICB8fCBidWZmZXJfaGFzX292ZXJsYXlzICgpCisgICAgICB8fCBaICE9IFpfQllURSkK KyAgICB7CisgICAgICBFTUFDU19JTlQgY29sID0gTU9TVF9QT1NJVElWRV9GSVhOVU07CisgICAg ICBtY19zY2FuX2Zvcl9jb2x1bW4gKCZwdCwgJmNvbCwgTlVMTCwgcHQpOworICAgICAgeworICAg ICAgICBpZiAob2xkX2J1ZmZlcikKKyAgICAgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRf YnVmZmVyKTsKKyAgICAgICAgcmV0dXJuIGNvbDsKKyAgICAgIH0KKyAgICB9CisgIC8qIFNjYW4g YmFja3dhcmRzIGZyb20gcG9pbnQgdG8gdGhlIHByZXZpb3VzIG5ld2xpbmUsCisgICAgIG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CisgICAgICAgICAgLyogQ2hlY2sgd2hldGhl ciB0aGF0IGJyaW5ncyB1cyB0byBiZWdpbm5pbmcgb2YgYnVmZmVyLiAqLworICAgICAgICAgIGlm IChCRUdWID49IEdQVCkKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjID0g Ki0tcHRyOworICAgICAgaWYgKGRwICYmIFZFQ1RPUlAgKERJU1BfQ0hBUl9WRUNUT1IgKGRwLCBj KSkpCisgICAgICAgIHsKKyAgICAgICAgICBjaGFydmVjID0gRElTUF9DSEFSX1ZFQ1RPUiAoZHAs IGMpOworICAgICAgICAgIG4gPSBBU0laRSAoY2hhcnZlYyk7CisgICAgICAgIH0KKyAgICAgICAg ZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGNoYXJ2ZWMgPSBRbmlsOworICAgICAgICAg ICAgbiA9IDE7CisgICAgICAgICAgfQorICAgICAgZm9yIChpID0gbiAtIDE7IGkgPj0gMDsgLS1p KQorICAgICAgICB7CisgICAgICAgICAgaWYgKFZFQ1RPUlAgKGNoYXJ2ZWMpKQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICAvKiBUaGlzIHNob3VsZCBiZSBoYW5kbGVkIHRoZSBzYW1lIGFz CisgICAgICAgICAgIG5leHRfZWxlbWVudF9mcm9tX2Rpc3BsYXlfdmVjdG9yIGRvZXMgaXQuICov CisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGVudHJ5ID0gQVJFRiAoY2hhcnZlYywgaSk7Cisg ICAgICAgICAgICAgIGlmIChHTFlQSF9DT0RFX1AgKGVudHJ5KSkKKyAgICAgICAgICAgICAgICBj ID0gR0xZUEhfQ09ERV9DSEFSIChlbnRyeSk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgICAgYyA9ICcgJzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBpZiAoYyA+PSAw NDAgJiYgYyA8IDAxNzcpCisgICAgICAgICAgICBjb2wrKzsKKyAgICAgICAgICAgIGVsc2UgaWYg KGMgPT0gJ1xuJworICAgICAgICAgICAgICAgICAgICAgfHwgKGMgPT0gJ1xyJworICAgICAgICAg ICAgICAgICAgICAgICAgICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rp c3BsYXkpLCBRdCkpKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcHRyKys7Cisg ICAgICAgICAgICAgICAgZ290byBzdGFydF9vZl9saW5lX2ZvdW5kOworICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgIGVsc2UgaWYgKGMgPT0gJ1x0JykKKyAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICBpZiAodGFiX3NlZW4pCisgICAgICAgICAgICAgICAgICAgIGNvbCA9 ICgoY29sICsgdGFiX3dpZHRoKSAvIHRhYl93aWR0aCkgKiB0YWJfd2lkdGg7CisgICAgICAgICAg ICAgICAgICBwb3N0X3RhYiArPSBjb2w7CisgICAgICAgICAgICAgICAgICBjb2wgPSAwOworICAg ICAgICAgICAgICAgICAgdGFiX3NlZW4gPSAxOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgICBlbHNlIGlmIChWRUNUT1JQIChjaGFydmVjKSkKKyAgICAgICAgICAgICAgICAgIC8q IFdpdGggYSBkaXNwbGF5IHRhYmxlIGVudHJ5LCBDIGlzIGRpc3BsYXllZCBhcyBpcywgYW5kCisg ICAgICAgICAgICAgICAgICAgICBub3QgZGlzcGxheWVkIGFzIFxOTk4gb3IgYXMgXk4uICBJZiBD IGlzIGEgc2luZ2xlLWJ5dGUKKyAgICAgICAgICAgICAgICAgICAgIGNoYXJhY3RlciwgaXQgdGFr ZXMgb25lIGNvbHVtbi4gIElmIEMgaXMgbXVsdGktYnl0ZSBpbgorICAgICAgICAgICAgICAgICAg ICAgYSB1bmlieXRlIGJ1ZmZlciwgaXQncyB0cmFuc2xhdGVkIHRvIHVuaWJ5dGUsIHNvIGl0Cisg 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NRSAoZnJhbWUsIGYp OworICByZXR1cm4gU1NEQVRBIChGcHJpbjFfdG9fc3RyaW5nIChmcmFtZSwgUW5pbCkpOworfQor CisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIldJTkRPVyAoJXMpIiwgbWNfd2luZG93ICh3 KSk7ICovCitjaGFyICoKK21jX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdykKK3sKKyAgTGlzcF9P YmplY3Qgd2luZG93OworICBYU0VUV0lORE9XICh3aW5kb3csIHcpOworICByZXR1cm4gU1NEQVRB IChGcHJpbjFfdG9fc3RyaW5nICh3aW5kb3csIFFuaWwpKTsKK30KKworLyogVVNBR0U6ICBmcHJp bnRmIChzdGRlcnIsICJDSEFSQUNURVIgKCVzKSIsIG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+ dS5jaCkpOyAqLworY2hhciAqCittY19jaGFyX3RvX3N0cmluZyAoaW50IGFyZykKK3sKKyAgTGlz cF9PYmplY3QgY2hhcmFjdGVyID0gKDAgPD0gYXJnICYmIGFyZyA8PSBNQVhfQ0hBUikKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gRmNoYXJfdG9fc3RyaW5nIChtYWtlX2ZpeG51bSAoYXJn KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIDogUW5pbDsKKyAgY2hhciAqIHJlc3VsdCA9 ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICYmIGFyZyA9PSA5KQorICAg ICAgICAgICAgICAgICAgICA/ICJcXHQiCisgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hh cmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDEwKQorICAgICAgICAgICAg ICAgICAgICA/ICJcXG4iCisgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQor ICAgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDMyKQorICAgICAgICAgICAgICAgICAgICA/ ICJcXHMiCisgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAg ICAgICAgICAgICAgJiYgYXJnICE9IDkKKyAgICAgICAgICAgICAgICAgICAgICYmIGFyZyAhPSAx MAorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9IDMyKQorICAgICAgICAgICAgICAgICAg ICA/IFNTREFUQSAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgOiAiXFw/IjsKKyAgcmV0 dXJuIHJlc3VsdDsKK30KKworaW50CittY19saXNwX3RvX2N1cnNvcl90eXBlIChMaXNwX09iamVj dCBhcmcpCit7CisgIGNoYXIgKnN0cjsKKyAgaWYgKFhUWVBFIChhcmcpID09IExpc3BfU3RyaW5n KQorICAgIHN0ciA9IFNTREFUQSAoYXJnKTsKKyAgICBlbHNlIGlmIChYVFlQRSAoYXJnKSA9PSBM aXNwX1N5bWJvbCkKKyAgICAgIHN0ciA9IFNTREFUQSAoU1lNQk9MX05BTUUgKGFyZykpOworICAg ICAgZWxzZSByZXR1cm4gLTE7CisgIGlmICghc3RyY21wIChzdHIsICJubyIpKQorICAgIHJldHVy biBNQ19OT19DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIsICJtYy1sZWZ0LWZyaW5nZS1iaXRt YXAiKSkKKyAgICByZXR1cm4gTUNfTEVGVF9GUklOR0VfQklUTUFQOworICBpZiAoIXN0cmNtcCAo c3RyLCAibWMtcmlnaHQtZnJpbmdlLWJpdG1hcCIpKQorICAgIHJldHVybiBNQ19SSUdIVF9GUklO R0VfQklUTUFQOworICBpZiAoIXN0cmNtcCAoc3RyLCAiYm94IikpCisgICAgcmV0dXJuIE1DX0ZJ TExFRF9CT1g7CisgIGlmICghc3RyY21wIChzdHIsICJmcmFtZWQiKSkKKyAgICByZXR1cm4gTUNf RlJBTUVEX0JPWDsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgImhvbGxvdyIpKQorICAgIHJldHVybiBN Q19IT0xMT1dfQk9YOworICB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N3aXRjaCAo YWN0aW9uX3R5cGUpCisgICAgeworICAgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOiByZXR1cm4g Ik1VTFRJUExFX0NVUlNPUlMiOworICAgICAgY2FzZSBIT1JJWk9OVEFMX1JVTEVSOiByZXR1cm4g IkhPUklaT05UQUxfUlVMRVIiOworICAgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjogcmV0dXJuICJW RVJUSUNBTF9SVUxFUiI7CisgICAgICBjYXNlIEZJTExfQ09MVU1OOiByZXR1cm4gIkZJTExfQ09M VU1OIjsKKyAgICAgIGNhc2UgQ1VSU09SX0lORElDQVRPUjogcmV0dXJuICJDVVJTT1JfSU5ESUNB VE9SIjsKKyAgICAgIGRlZmF1bHQ6CisgICAgICByZXR1cm4gIlVOS05PV04iOworICAgIH0KK30K KworLyogVVNBR0U6ICBmcHJpbnRmIChzdGRlcnIsICJGUk9NX1dIRVJFICglcykiLCBtY19kcmF3 X3Jvd190eXBlX3RvX3N0cmluZyAoYXJnKSk7ICovCitjaGFyICoKK21jX2RyYXdfcm93X3R5cGVf dG9fc3RyaW5nIChlbnVtIG1jX2RyYXdfcm93X3R5cGUgZnJvbV93aGVyZSkKK3sKKyAgc3dpdGNo IChmcm9tX3doZXJlKQorICAgIHsKKyAgICAgIGNhc2UgTk9XSEVSRTogcmV0dXJuICJOT1dIRVJF IjsKKyAgICAgIGNhc2UgU0NSSUJFX09ORTogcmV0dXJuICJTQ1JJQkVfT05FIjsKKyAgICAgIGNh c2UgU0NSSUJFX1RXTzogcmV0dXJuICJTQ1JJQkVfVFdPIjsKKyAgICAgIGNhc2UgU0NSSUJFX1RI UkVFOiByZXR1cm4gIlNDUklCRV9USFJFRSI7CisgICAgICBjYXNlIFNLSVBQRUQ6IHJldHVybiAi U0tJUFBFRCI7CisgICAgICBjYXNlIFBPU1RfQ0hBTkdFRDogcmV0dXJuICJQT1NUX0NIQU5HRUQi OworICAgICAgY2FzZSBVTkNIQU5HRUQ6IHJldH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ICAgZGVmYXVsdDoKKyAgICAgIHJldHVybiAiVU5LTk9XTiI7CisgICAgfQorfQorCit2b2lkCitt Y19jYWNoZV9pbnNwZWN0b3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBtY19tYXRyaXggbWF0 cml4KQoreworICBpbnQgdnBvc19hbGxvY2F0ZWQgPSB3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0 ZWQ7CisgIGludCB2cG9zX3VzZWQgPSB3LT5tY19tYXRyaXgudnBvc191c2VkOworICBmcHJpbnRm IChzdGRlcnIsICIlczogIG1hdHJpeC52cG9zX2FsbG9jYXRlZCAoJWQpIHwgbWF0cml4LnZwb3Nf dXNlZCAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgIG1jX3dpbmRvdyAodyksIHZwb3NfYWxs b2NhdGVkLCB2cG9zX3VzZWQpOworICBmb3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBl ID0gTUNfQ0FDSEU7CisgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICsrY2Fj aGVfdHlwZSkKKyAgICB7CisgICAgICBpbnQgY3Vyc29yc191c2VkID0gdy0+bWNfbWF0cml4LmN1 cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgbWF0cml4 LmN1cnNvcnNfdXNlZFslc10gKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgbWNfY2Fj aGVfdHlwZV90b19zdHJpbmcgKGNhY2hlX3R5cGUpLCBjdXJzb3JzX3VzZWQpOworICAgIH0KKyAg Zm9yIChpbnQgdm50aCA9IDA7CisgICAgICAgdm50aCA8IHctPm1jX21hdHJpeC52cG9zX3VzZWQ7 CisgICAgICAgKyt2bnRoKQorICAgIHsKKyAgICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNh Y2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOwor ICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgY2FjaGVf YWxsb2NhdGVkID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hl X3R5cGVdOworICAgICAgICAgIGludCBjYWNoZV91c2VkID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIg ICAgdm50aCAoJWQpIHwgY2FjaGVfYWxsb2NhdGVkWyVzXSAoJWQpIHwgY2FjaGVfdXNlZFslc10g KCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHZudGgsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAoY2FjaGVfdHlwZSksCisgICAg ICAgICAgICAgICAgICAgICAgICAgICBjYWNoZV9hbGxvY2F0ZWQsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAoY2FjaGVfdHlwZSksCisgICAgICAg ICAgICAgICAgICAgICAgICAgICBjYWNoZV91c2VkKTsKKyAgICAgICAgfQorICAgIH0KK30KKwor dm9pZAorbWNfc2V0X2xzbF9iZyAoc3RydWN0IHdpbmRvdyAqdywgZW51bSBmYWNlX2lkIGZhY2Vf aWQsIHN0cnVjdCBtY19SR0IgKmxzbCkKK3sKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3 LT5mcmFtZSk7CisgIHN0cnVjdCBmYWNlICpmYWNlOworICBpZiAoIU5JTFAgKFZmYWNlX3JlbWFw cGluZ19hbGlzdCkKKyAgICAgICYmIChmYWNlX2lkID09IERFRkFVTFRfRkFDRV9JRCAvKiBRZGVm YXVsdCAqLworICAgICAgICAgIHx8IGZhY2VfaWQgPT0gTU9ERV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AgfHwgZmFjZV9pZCA9PSBWRVJUSUNBTF9CT1JERVJfRkFDRV9JRCAvKiBRdmVydGljYWxf Ym9yZGVyICovCisgICAgICAgICAgfHwgZmFjZV9pZCA9PSBJTlRFUk5BTF9CT1JERVJfRkFDRV9J RCkpIC8qIFFpbnRlcm5hbF9ib3JkZXIgKi8KKyAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChmLCBs b29rdXBfYmFzaWNfZmFjZSAodywgZiwgZmFjZV9pZCkpOworICAgIGVsc2UKKyAgICAgIGZhY2Ug PSBGQUNFX0ZST01fSUQgKGYsIGZhY2VfaWQpOworICBMaXNwX09iamVjdCBjb2xvciA9IChmYWNl ICE9IE5VTEwpCisgICAgICAgICAgICAgICAgICAgICAgPyBmYWNlLT5sZmFjZVtMRkFDRV9CQUNL R1JPVU5EX0lOREVYXQorICAgICAgICAgICAgICAgICAgICAgIDogYnVpbGRfc3RyaW5nICgiT3Jh bmdlUmVkIik7CisgIG1jX3h3X2NvbG9yX3ZhbHVlcyAodywgY29sb3IsIGxzbCk7Cit9CisKK3Zv aWQKK21jX3NldF9lc3NlbnRpYWxzIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgbWNfZXNzZW50 aWFscyAqZXNzZW50aWFscykKK3sKKyAgaWYgKCFCVUZGRVJQICh3LT5jb250ZW50cykpCisgICAg cmV0dXJuOworICBpZiAoTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25m KSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWly cykpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2li bGUpKSkKKyAgICByZXR1cm47CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUp OworICBlc3NlbnRpYWxzLT5hY3RpdmVfcCA9ICh3ID09IFhXSU5ET1cgKGYtPnNlbGVjdGVkX3dp bmRvdykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZiA9PSBGUkFNRV9ESVNQTEFZX0lO Rk8gKGYpLT54X2hpZ2hsaWdodF9mcmFtZSk7CisgIExpc3BfT2JqZWN0IGJ1ZiA9IHctPmNvbnRl bnRzOworICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVS IChidWYpOworICBzdHJ1Y3QgYnVmZmVyICpvbGRfYnVmZmVyID0gTlVMTDsKKyAgcHRyZGlmZl90 IG9wb2ludCA9ICh3ID09IFhXSU5ET1cgKHNlbGVjdGVkX3dpbmRvdykpCisgICAgICAgICAgICAg ICAgICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICA6IFhGSVhOVU0gKEZtYXJrZXJfcG9z aXRpb24gKHctPnBvaW50bSkpOworICBwdHJkaWZmX3QgY3VycmVudF9jb2wgPSBtY19jdXJyZW50 X2NvbHVtbiAodywgb3BvaW50KTsKKyAgaW50IGZyYW1lX2NoYXJfd2lkdGggPSBGUkFNRV9DT0xV TU5fV0lEVEggKGYpOworICBib29sIGZpbGxfY29sdW1uX3AgPSAhTklMUCAoQlZBUiAoYiwgZmls bF9jb2x1bW4pKTsKKyAgaW50IGZpbGxfY29sID0gWEZJWE5VTSAoQlZBUiAoYiwgZmlsbF9jb2x1 bW4pKTsKKyAgaW50IGhzY2xfeCA9IHctPmhzY3JvbGwgKiBmcmFtZV9jaGFyX3dpZHRoOworICBp ZiAoYiAhPSBjdXJyZW50X2J1ZmZlcikKKyAgICB7CisgICAgICBvbGRfYnVmZmVyID0gY3VycmVu dF9idWZmZXI7CisgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChiKTsKKyAgICB9CisgIGVzc2Vu dGlhbHMtPnp2ID0gWlY7CisgIGVzc2VudGlhbHMtPnp2X2J5dGUgPSBaVl9CWVRFOworICBlc3Nl bnRpYWxzLT5mY194ID0gKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiAh TklMUCAoVmRpc3BsYXlfbGluZV9udW1iZXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgPyAo ZmlsbF9jb2wgKiBmcmFtZV9jaGFyX3dpZHRoKSArIHctPm1jLmxudW1fcGl4ZWxfd2lkdGggLSBo c2NsX3gKKyAgICAgICAgICAgICAgICAgICAgIDogKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICYmIE5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisgICAgICAgICAg ICAgICAgICAgICAgID8gKGZpbGxfY29sICogZnJhbWVfY2hhcl93aWR0aCkgLSBoc2NsX3gKKyAg ICAgICAgICAgICAgICAgICAgIDogMDsKKyAgaWYgKG9sZF9idWZmZXIpCisgICAgc2V0X2J1ZmZl cl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisgIGVudW0gZmFjZV9pZCBmaWxsX2NvbHVtbl9wcmVf enZfZmFjZV9pZCA9CisgICAgKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAmJiAhTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY19pbmFjdGl2ZV93aW5kb3dzKSkKKyAgICAg JiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAg ICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1pbmFjdGl2ZS1wcmUtenYt ZmFjZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAgICYmICFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQor ICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMp KQorICAgICAgICYmICFOSU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m Y19mZ1tBVF9aVl0ucmVkID0gZmNfYXRfenZfZmcucmVkOworICBlc3NlbnRpYWxzLT5mY19mZ1tB VF9aVl0uZ3JlZW4gPSBmY19hdF96dl9mZy5ncmVlbjsKKyAgZXNzZW50aWFscy0+ZmNfZmdbQVRf WlZdLmJsdWUgPSBmY19hdF96dl9mZy5ibHVlOworICBlbnVtIGZhY2VfaWQgZmlsbF9jb2x1bW5f cG9zdF96dl9mYWNlX2lkID0KKyAgICAoIWVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICYmICFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQor ICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkK KyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLWluYWN0aXZlLXBv c3QtenYtZmFjZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAg ICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRv d3MpKQorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3Nz aGFpcnMpKQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisg ICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8gbG9va3Vw X25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLW9wb2ludC1pbmFjdGl2ZS1wb3N0LXp2LWZh Y2UiKSwgdHJ1ZSkKKyAgICA6IChlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAgICYmICFOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGF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lsbF9wb3N0X3p2X2Zn LmdyZWVuOworICAgICAgICAgIGVzc2VudGlhbHMtPmNoX2ZnW1BPU1RfWlZdLmJsdWUgPSBwb3N0 X2ZpbGxfcG9zdF96dl9mZy5ibHVlOworICAgICAgICB9Cit9CisKK3ZvaWQKK21jX2NvbG9yX3Bp Y2tlciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoICpnbHlwaCwgc3RydWN0IG1jX2Vz c2VudGlhbHMgZXNzZW50aWFscywKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiAq bHNsX2ZnLCBpbnQgcG9zaW50LCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLAorICAg ICAgICAgICAgICAgICAgICBlbnVtIG1jX3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24sIGVudW0g bWNfZW5naW5lX3R5cGUgYWN0aW9uX3R5cGUpCit7CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisg IHsKKyAgICBjYXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAgICAgc3RydWN0IGZyYW1l ICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgICAgICBwdHJkaWZmX3QgY3VycmVudF9jb2wgPSBt Y19jdXJyZW50X2NvbHVtbiAodywgcG9zaW50KTsKKyAgICAgIExpc3BfT2JqZWN0IGJ1ZiA9IHct PmNvbnRlbnRzOworICAgICAgQ0hFQ0tfQlVGRkVSIChidWYpOworICAgICAgc3RydWN0IGJ1ZmZl ciAqYiA9IFhCVUZGRVIgKGJ1Zik7CisgICAgICBib29sIGZpbGxfY29sdW1uX3AgPSAhTklMUCAo QlZBUiAoYiwgZmlsbF9jb2x1bW4pKTsKKyAgICAgIGludCBmaWxsX2NvbCA9IChmaWxsX2NvbHVt bl9wKQorICAgICAgICAgICAgICAgICAgICAgPyBYRklYTlVNIChCVkFSIChiLCBmaWxsX2NvbHVt bikpCisgICAgICAgICAgICAgICAgICAgICA6IDA7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fZmlsbF9mb3JlZ3JvdW5kKTsKKyAgICAgIC8qIHJlZCAqLworICAgICAgaWYgKCgh ZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAmJiBjdXJyZW50X2NvbCAlIDIgIT0gMAorICAgICAg ICAgICAmJiByb3dfcG9zaXRpb24gPT0gUFJFX1pWKQorICAgICAgICAgIHx8IChmaWxsX2NvbHVt bl9wCisgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sICUgMiAhPSAwCisgICAgICAgICAgICAg ICYmIGN1cnJlbnRfY29sIDw9IGZpbGxfY29sCisgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlv biA9PSBQUkVfWlYpKQorICAgICAgICB7CisgICAgICAgICAgbHNsX2ZnLT5yZWQgPSBvZGRfZm9y ZWdyb3VuZC5yZWQ7CisgICAgICAgICAgbHNsX2ZnLT5ncmVlbiA9IG9kZF9mb3JlZ3JvdW5kLmdy ZWVuOworICAgICAgICAgIGxzbF9mZy0+Ymx1ZSA9IG9kZF9mb3JlZ3JvdW5kLmJsdWU7CisgICAg ICAgIH0KKyAgICAgICAgLyogeWVsbG93ICovCisgICAgICAgIGVsc2UgaWYgKCghZmlsbF9jb2x1 bW5fcAorICAgICAgICAgICAgICAgICAgJiYgY3VycmVudF9jb2wgJSAyID09IDAKKyAgICAgICAg ICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpCisgICAgICAgICAgICAgICAgIHx8 IChmaWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgICAgICAgICAmJiBjdXJyZW50X2NvbCAlIDIg PT0gMAorICAgICAgICAgICAgICAgICAgICAgJiYgY3VycmVudF9jb2wgPD0gZmlsbF9jb2wKKyAg ICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpKQorICAgICAgICAg IHsKKyAgICAgICAgICAgIGxzbF9mZy0+cmVkID0gZXZlbl9mb3JlZ3JvdW5kLnJlZDsKKyAgICAg ICAgICAgIGxzbF9mZy0+Z3JlZW4gPSBldmVuX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAg ICBsc2xfZmctPmJsdWUgPSBldmVuX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgICB9CisgICAg ICAgICAgLyogZ3JlZW4gKi8KKyAgICAgICAgICBlbHNlIGlmIChmaWxsX2NvbHVtbl9wCisgICAg ICAgICAgICAgICAgICAgJiYgY3VycmVudF9jb2wgPiBmaWxsX2NvbAorICAgICAgICAgICAgICAg ICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIGxzbF9mZy0+cmVkID0gYmV5b25kX2ZpbGxfZm9yZWdyb3VuZC5yZWQ7CisgICAgICAgICAg ICAgIGxzbF9mZy0+Z3JlZW4gPSBiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kLmdyZWVuOworICAgICAg ICAgICAgICBsc2xfZmctPmJsdWUgPSBiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kLmJsdWU7CisgICAg ICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChyb3dfcG9zaXRpb24gPT0gQVRfWlYpCisg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsc2xfZmctPnJlZCA9IGVzc2VudGlhbHMu c3BfZmcucmVkOworICAgICAgICAgICAgICAgIGxzbF9mZy0+Z3JlZW4gPSBlc3NlbnRpYWxzLnNw X2ZnLmdyZWVuOworICAgICAgICAgICAgICAgIGxzbF9mZy0+Ymx1ZSA9IGVzc2VudGlhbHMuc3Bf ZmcuYmx1ZTsKKyAgICAgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2Ug SE9SSVpPTlRBTF9SVUxFUjoKKyAgICB7CisgICAgICBpZiAoZ2x5cGggIT0gTlVMTAorICAgICAg ICAgICYmIGdseXBoLT51LmNoID09IDk1CisgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNf SEJBU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GVzc2VudGlhbHMuZmNfZmdbcm93X3Bv c2l0aW9uXS5ibHVlOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgQ1VSU09SX0lORElD QVRPUjoKKyAgICB7CisgICAgICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsK KyAgICAgIGVudW0gZmFjZV9pZCBjdXJzb3JfZmFjZV9pZCA9CisgICAgICAgICghZXNzZW50aWFs cy5hY3RpdmVfcAorICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgY2hfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gUFJF X1pWKQorICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVh bC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICA6IChl c3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYp CisgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZh a2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogKCFlc3NlbnRpYWxzLmFj dGl2ZV9wCisgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNoX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gQVRf WlYpCisgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJl YWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtYXQtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICA6IChl c3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgIC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1teV94ID0gMDsKKyAgICAgIC8qIElmIG1vdXNlIGhpZ2hsaWdo dGluZyBpcyBvbiwgd2UgbWF5IG5lZWQgdG8gZHJhdyBhZGphY2VudAorICAgZ2x5cGhzIHVzaW5n IG1vdXNlLWZhY2UgaGlnaGxpZ2h0aW5nLiAqLworICAgICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVB ICYmIHJvdy0+bW91c2VfZmFjZV9wCisgICAgICAgICAgJiYgaGxpbmZvLT5tb3VzZV9mYWNlX2Jl Z19yb3cgPj0gMAorICAgICAgICAgICYmIGhsaW5mby0+bW91c2VfZmFjZV9lbmRfcm93ID49IDAp CisgICAgICAgIHsKKyAgICAgICAgICBwdHJkaWZmX3Qgcm93X3Zwb3MgPSBNQVRSSVhfUk9XX1ZQ T1MgKHJvdywgdy0+Y3VycmVudF9tYXRyaXgpOworICAgICAgICAgIGlmIChyb3dfdnBvcyA+PSBo bGluZm8tPm1vdXNlX2ZhY2VfYmVnX3JvdworICAgICAgICAgICAgICAmJiByb3dfdnBvcyA8PSBo bGluZm8tPm1vdXNlX2ZhY2VfZW5kX3JvdykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg Y2hlY2tfbW91c2VfZmFjZSA9IHRydWU7CisgICAgICAgICAgICAgIG1vdXNlX2JlZ19jb2wgPSAo cm93X3Zwb3MgPT0gaGxpbmZvLT5tb3VzZV9mYWNlX2JlZ19yb3cpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IGhsaW5mby0+bW91c2VfZmFjZV9iZWdfY29sCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IDA7CisgICAgICAgICAgICAgIG1vdXNlX2VuZF9jb2wgPSAocm93 X3Zwb3MgPT0gaGxpbmZvLT5tb3VzZV9mYWNlX2VuZF9yb3cpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IGhsaW5mby0+bW91c2VfZmFjZV9lbmRfY29sCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAg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gdGhlIG92ZXJsYXAgZW5j b21wYXNzZXMgbW9yZSB0aGFuIG9uZSBnbHlwaAorICAgICAgICAgICAgIGFuZCBtb3VzZS1oaWdo bGlnaHQgc3BhbnMgb25seSBzb21lIG9mIHRoZXNlIGdseXBocy4KKyAgICAgICAgICAgICBIb3dl dmVyLCBtYWtpbmcgaXQgd29yayBwZXJmZWN0bHkgaW52b2x2ZXMgYSBsb3QgbW9yZQorICAgICAg ICAgICAgIGNvZGUsIGFuZCBJIGRvbid0IGtub3cgaWYgdGhlIHBhdGhvbG9naWNhbCBjYXNlIG9j Y3VycyBpbgorICAgICAgICAgICAgIHByYWN0aWNlLCBzbyB3ZSdsbCBzdGljayB0byB0aGlzIGZv ciBub3cuICAtLS0gY3lkICAqLworICAgICAgICAgIGlmIChjaGVja19tb3VzZV9mYWNlCisgICAg ICAgICAgICAgICYmIG1vdXNlX2JlZ19jb2wgPCBzdGFydCAmJiBtb3VzZV9lbmRfY29sID4gaSkK KyAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX01PVVNFX0ZBQ0U7CisgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAg ICAgIGlmIChobCAhPSBvdmVybGFwX2hsKQorICAgICAgICAgICAgY2xpcF9oZWFkID0gaGVhZDsK KyAgICAgICAgICBqID0gaTsKKyAgICAgICAgICBNQ19CVUlMRF9HTFlQSF9TVFJJTkdTIChqLCBz dGFydCwgaCwgdCwgb3ZlcmxhcF9obCwgZHVtbXlfeCwgbGFzdF94KTsKKyAgICAgICAgICAvKiBU aGUgYGxlZnRfb3ZlcndyaXR0ZW5gIGJlaGF2aW9yIHRoYXQgZXJhc2VzIHRoZSBmYWtlIGN1cnNv cnMgdHJhY2VzIHRvCisgICAgICAgICAgYGZvbnQtPmRyaXZlci0+ZHJhd2AgaW4gYG5zX2RyYXdf Z2x5cGhfc3RyaW5nJzsgYW5kLCB0aGUg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AgICAgICAg ICBzLT5sZWZ0X292ZXJ3cml0dGVuX3AgPSB0cnVlOworICAgICAgICAgICAgICBzLT5hY3Rpb25f dHlwZSA9IGFjdGlvbl90eXBlOworICAgICAgICAgICAgICBsZW5ndGggKz0gcy0+Zmlyc3RfZ2x5 cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICAgIHJlbGF0aXZlX3ggPSBz dGFydF94IC0gbGVuZ3RoOworICAgICAgICAgIGZvciAocyA9IGg7IHM7IHMgPSBzLT5uZXh0KQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBzLT5maXJzdF9nbHlwaC0+cmVsYXRpdmVfeCA9 IHJlbGF0aXZlX3g7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gcy0+Zmlyc3RfZ2x5cGgt PnBpeGVsX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICAgIHN0YXJ0ID0gaTsKKyAgICAg ICAgICBjb21wdXRlX292ZXJoYW5nc19hbmRfeCAodCwgaGVhZC0+eCwgdHJ1ZSk7CisgICAgICAg ICAgcHJlcGVuZF9nbHlwaF9zdHJpbmdfbGlzdHMgKCZoZWFkLCAmdGFpbCwgaCwgdCk7CisgICAg ICAgICAgaWYgKGNsaXBfaGVhZCA9PSBOVUxMKQorICAgICAgICAgICAgY2xpcF9oZWFkID0gaGVh ZDsKKyAgICAgICAgfQorICAgICAgLyogUHJlcGVuZCBnbHlwaCBzdHJpbmdzIGZvciBnbHlwaHMg aW4gZnJvbnQgb2YgdGhlIGZpcnN0IGdseXBoCisgICAgICBzdHJpbmcgdGhhdCBvdmVyd3JpdGUg dGhhdCBnbHlwaCBzdHJpbmcgYmVjYXVzZSBvZiB0aGVpcgorICAgICAgcmlnaHQgb3Zlcmhhbmcu ICBGb3IgdGhlc2Ugc3RyaW5ncywgb25seSB0aGUgZm9yZWdyb3VuZCBtdXN0CisgICAgICBiZSBk cmF3biwgYmVjYXVzZSBpdCBkcmF3cyBvdmVyIHRoZSBnbHlwaCBzdHJpbmcgYXQgYGhlYWQnLgor ICAgICAgVGhlIGJhY2tncm91bmQgbXVzdCBub3QgYmUgZHJhd24gYmVjYXVzZSB0aGlzIHdvdWxk IG92ZXJ3cml0ZQorICAgICAgcmlnaHQgb3ZlcmhhbmdzIG9mIHByZWNlZGluZyBnbHlwaHMgZm9y IHdoaWNoIG5vIGdseXBoCisgICAgICBzdHJpbmdzIGV4aXN0LiAqLworICAgICAgaSA9IGxlZnRf b3ZlcndyaXRpbmcgKGhlYWQpOworICAgICAgaWYgKGkgPj0gMCkKKyAgICAgICAgeworICAgICAg ICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBvdmVybGFwX2hsOworICAgICAgICAgIGlmIChjaGVj a19tb3VzZV9mYWNlCisgICAgICAgICAgICAgICYmIG1vdXNlX2JlZ19jb2wgPCBzdGFydCAmJiBt b3VzZV9lbmRfY29sID4gaSkKKyAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX01PVVNFX0ZB Q0U7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX05P Uk1BTF9URVhUOworICAgICAgICAgIGlmIChobCA9PSBvdmVybGFwX2hsIHx8IGNsaXBfaGVhZCA9 PSBOVUxMKQorICAgICAgICAgICAgY2xpcF9oZWFkID0gaGVhZDsKKyAgICAgICAgICBNQ19CVUlM RF9HTFlQSF9TVFJJTkdTIChpLCBzdGFydCwgaCwgdCwgb3ZlcmxhcF9obCwgZHVtbXlfeCwgbGFz dF94KTsKKyAgICAgICAgICBmb3IgKHMgPSBoOyBzOyBzID0gcy0+bmV4dCkKKyAgICAgICAgICAg IHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgICAgIGNvbXB1dGVfb3Zlcmhh bmdzX2FuZF94ICh0LCBoZWFkLT54LCB0cnVlKTsKKyAgICAgICAgICBwcmVwZW5kX2dseXBoX3N0 cmluZ19saXN0cyAoJmhlYWQsICZ0YWlsLCBoLCB0KTsKKyAgICAgICAgfQorICAgICAgLyogQXBw ZW5kIGdseXBocyBzdHJpbmdzIGZvciBnbHlwaHMgZm9sbG93aW5nIHRoZSBsYXN0IGdseXBoCisg ICAgICBzdHJpbmcgdGFpbCB0aGF0IGFyZSBvdmVyd3JpdHRlbiBieSB0YWlsLiAgVGhlIGJhY2tn cm91bmQgb2YKKyAgICAgIHRoZXNlIHN0cmluZ3MgaGFzIHRvIGJlIGRyYXduIGJlY2F1c2UgdGFp bCdzIGZvcmVncm91bmQgZHJhd3MKKyAgICAgIG92ZXIgaXQuICovCisgICAgICBpID0gcmlnaHRf b3ZlcndyaXR0ZW4gKHRhaWwpOworICAgICAgaWYgKGkgPj0gMCkKKyAgICAgICAgeworICAgICAg ICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBvdmVybGFwX2hsOworICAgICAgICAgIGlmIChjaGVj a19tb3VzZV9mYWNlCisgICAgICAgICAgICAgICYmIG1vdXNlX2JlZ19jb2wgPCBpICYmIG1vdXNl X2VuZF9jb2wgPiBlbmQpCisgICAgICAgICAgICBvdmVybGFwX2hsID0gRFJBV19NT1VTRV9GQUNF OworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBvdmVybGFwX2hsID0gRFJBV19OT1JN QUxfVEVYVDsKKyAgICAgICAgICBpZiAoaGwgIT0gb3ZlcmxhcF9obCkKKyAgICAgICAgICAgIGNs aXBfdGFpbCA9IHRhaWw7CisgICAgICAgICAgTUNfQlVJTERfR0xZUEhfU1RSSU5HUyAoZW5kLCBp LCBoLCB0LCBvdmVybGFwX2hsLCB4LCBsYXN0X3gpOworICAgICAgICAvKiBUaGUgYHJpZ2h0X292 ZXJ3cml0dGVuYCBiZWhhdmlvciB0aGF0IGVyYXNlcyB0aGUgZmFrZSBjdXJzb3JzIHRyYWNlcyB0 bworICAgICAgICBgZm9udC0+ZHJpdmVyLT5kcmF3YCBpbiBgbnNfZHJhd19nbHlwaF9zdHJpbmcn Oy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yaGFuZ3NfYW5kX3ggKGgsIHRhaWwtPnggKyB0YWlsLT53aWR0 aCwgZmFsc2UpOworICAgICAgICAgIGFwcGVuZF9nbHlwaF9zdHJpbmdfbGlzdHMgKCZoZWFkLCAm dGFpbCwgaCwgdCk7CisgICAgICAgICAgaWYgKGNsaXBfdGFpbCA9PSBOVUxMKQorICAgICAgICAg ICAgY2xpcF90YWlsID0gdGFpbDsKKyAgICAgICAgfQorICAgICAgLyogQXBwZW5kIGdseXBoIHN0 cmluZ3MgZm9yIGdseXBocyBmb2xsb3dpbmcgdGhlIGxhc3QgZ2x5cGgKKyAgICAgIHN0cmluZyB0 YWlsIHRoYXQgb3ZlcndyaXRlIHRhaWwuICBUaGUgZm9yZWdyb3VuZCBvZiBzdWNoCisgICAgICBn bHlwaHMgaGFzIHRvIGJlIGRyYXduIGJlY2F1c2UgaXQgd3JpdGVzIGludG8gdGhlIGJhY2tncm91 bmQKKyAgICAgIG9mIHRhaWwuICBUaGUgYmFja2dyb3VuZCBtdXN0IG5vdCBiZSBkcmF3biBiZWNh dXNlIGl0IGNvdWxkCisgICAgICBwYWludCBvdmVyIHRoZSBmb3JlZ3JvdW5kIG9mIGZvbGxvd2lu ZyBnbHlwaHMuICovCisgICAgICBpID0gcmlnaHRfb3ZlcndyaXRpbmcgKHRhaWwpOworICAgICAg aWYgKGkgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBv dmVybGFwX2hsOworICAgICAgICAgIGlmIChjaGVja19tb3VzZV9mYWNlCisgICAgICAgICAgICAg ICYmIG1vdXNlX2JlZ19jb2wgPCBpICYmIG1vdXNlX2VuZF9jb2wgPiBlbmQpCisgICAgICAgICAg ICBvdmVybGFwX2hsID0gRFJBV19NT1VTRV9GQUNFOworICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICBvdmVybGFwX2hsID0gRFJBV19OT1JNQUxfVEVYVDsKKyAgICAgICAgICBpZiAoaGwg PT0gb3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CisgICAgRlJBTUVfUklGIChm KS0+bWNfc2NyaWJlX3N0cmluZyAocywgbWF0cml4LCByb3csIGxzbCwgZ2x5cGhfZmxhdm9yLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCB3ZCwgYWN0 aXZlX3AsIGN1cnNvcl9nY19wKTsKKyNpZm5kZWYgSEFWRV9OUworICAvKiBXaGVuIGZvY3VzIGEg c29sZSBmcmFtZSBhbmQgbW92ZSBob3Jpem9udGFsbHksIHRoaXMgY2xlYXJzIG9uX3AKKyAgICAg Y2F1c2luZyBhIGZhaWx1cmUgdG8gZXJhc2UgcHJldiBjdXJzb3IgcG9zaXRpb24uICovCisgIGlm IChhcmVhID09IFRFWFRfQVJFQQorICAgICAgJiYgIXJvdy0+ZnVsbF93aWR0aF9wCisgICAgICAv KiBXaGVuIGRyYXdpbmcgb3ZlcmxhcHBpbmcgcm93cywgb25seSB0aGUgZ2x5cGggc3RyaW5ncycK KyAgICAgIGZvcmVncm91bmQgaXMgZHJhd24sIHdoaWNoIGRvZXNuJ3QgZXJhc2UgYSBjdXJzb3Ig Y29tcGxldGVseS4gKi8KKyAgICAgICYmICFvdmVybGFwcykKKyAgICB7CisgICAgICBpbnQgeDAg PSBjbGlwX2hlYWQgPyBjbGlwX2hlYWQtPnggOiAoaGVhZCA/IGhlYWQtPnggOiB4KTsKKyAgICAg IGludCB4MSA9IChjbGlwX3RhaWwgPyBjbGlwX3RhaWwtPnggKyBjbGlwX3RhaWwtPmJhY2tncm91 bmRfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgOiAodGFpbCA/IHRhaWwtPnggKyB0 YWlsLT5iYWNrZ3JvdW5kX3dpZHRoIDogeCkpOworICAgICAgeDAgLT0gYXJlYV9sZWZ0OworICAg ICAgeDEgLT0gYXJlYV9sZWZ0OworICAgICAgbm90aWNlX292ZXJ3cml0dGVuX2N1cnNvciAodywg VEVYVF9BUkVBLCB4MCwgeDEsCisg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X2N1cnNvcl9nbHlwaCAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21h dHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAg ICAgZW51bSBkcmF3X2dseXBoc19mYWNlIGhsLCBpbnQgeCwgaW50IGhwb3MsIGludCB2cG9zLAor ICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2ZsYXZvciBn bHlwaF9mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBj dXJzb3JfdHlwZSwgaW50IHdkLCBib29sIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAg IGJvb2wgY3Vyc29yX2djX3ApCit7CisgIHN0cnVjdCBnbHlwaF9yb3cgKmJvdHRvbV9yb3cgPSBN QVRSSVhfQk9UVE9NX1RFWFRfUk9XIChtYXRyaXgsIHcpOworICBpbnQgYm90dG9tX3Zwb3MgPSBN QVRSSVhfUk9XX1ZQT1MgKGJvdHRvbV9yb3csIG1hdHJpeCk7CisvKgorICAgICAgc3RydWN0IGds eXBoICpjdXJzb3JfZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywg aHBvcywgdnBvcyk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19kcmF3X2N1cnNvcl9nbHlw aDogIGNoICglZCkgfCB4ICglZCksIGhwb3MgKCVkKSwgdnBvcyglZCksIGhsICglZClcbiIsCisg ICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9nbHlwaC0+dS5jaCwgeCwgaHBvcywgdnBvcywg aGwpOworKi8KKyAgYmxvY2tfaW5wdXQgKCk7CisgIGJvb2wgZHJhd19wID0gdHJ1ZTsKKyAgbWNf ZHJhd19nbHlwaHMgKHcsIG1hdHJpeCwgcm93LCB4LCBURVhUX0FSRUEsIGhwb3MsIGh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vyc29yOiAgcmV0dXJuICgl ZClcbiIsIDEpOworICAgICAgcmV0dXJuOworICAgIH0KKyAgLyogVlBPUyA+PSBtYXRyaXgtPm5y b3dzIG1lYW5zIHRoYXQgd2luZG93IGhhcyBiZWVuIHJlc2l6ZWQuCisgICAgIERvbid0IGJvdGhl ciB0byBlcmFzZSB0aGUgY3Vyc29yLiAqLworICBpZiAodnBvcyA+PSBtYXRyaXgtPm5yb3dzKQor ICAgIHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19l cmFzZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwgMik7CisgICAgICByZXR1cm47CisgICAgfQor ICAvKiBJZiByb3cgY29udGFpbmluZyBjdXJzb3IgaXMgbWFya2VkIGludmFsaWQsIHRoZXJlIGlz IG5vdGhpbmcgd2UKKyAgICAgY2FuIGRvLiAqLworICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAg IHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFz ZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwgMyk7CisgICAgICByZXR1cm47CisgICAgfQorICAv KiBJZiBsaW5lIHNwYWNpbmcgaXMgPiAwLCBvbGQgY3Vyc29yIG1heSBvbmx5IGJlIHBhcnRpYWxs eSB2aXNpYmxlIGluCisgICAgIHdpbmRvdyBhZnRlciBzcGxpdC13aW5kb3cuICBTbyBhZGp1c3Qg dmlzaWJsZSBoZWlnaHQuICovCisgIHJvdy0+dmlzaWJsZV9oZWlnaHQgPSBtaW4gKHJvdy0+dmlz aWJsZV9oZWlnaHQsCisgICAgICAgICAgICB3aW5kb3dfdGV4dF9ib3R0b21feSAodykgLSByb3ct PnkpOworICAvKiBJZiByb3cgaXMgY29tcGxldGVseSBpbnZpc2libGUsIGRvbid0IGF0dGVtcHQg dG8gZGVsZXRlIGEgY3Vyc29yIHdoaWNoCisg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F0cml4LCByb3csIGhwb3MsIHZwb3MpOworICAgICAg ZnByaW50ZiAoc3RkZXJyLCAibWNfZHJhd19jdXJzb3JfZ2x5cGg6ICBjaCAoJWQpIHwgeCAoJWQp LCBocG9zICglZCksIHZwb3MoJWQpLCBobCAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAg ICBjdXJzb3JfZ2x5cGgtPnUuY2gsIHgsIGhwb3MsIHZwb3MsIGhsKTsKKyovCisgIGJsb2NrX2lu cHV0ICgpOworICBib29sIGRyYXdfcCA9IHRydWU7CisgIG1jX2RyYXdfZ2x5cGhzICh3LCBtYXRy aXgsIHJvdywgeCwgVEVYVF9BUkVBLCBocG9zLCBocG9zICsgMSwgaGwsIDAsCisgICAgICAgICAg ICAgICAgICB2cG9zLCBib3R0b21fdnBvcywgbHNsLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBl LCB3ZCwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICBjdXJzb3JfZ2NfcCwgTUNfRVJBU0Vf R0xZUEhfU1RSSU5HLCBkcmF3X3ApOworICB1bmJsb2NrX2lucHV0ICgpOworICAvKiBXaGVuIHdl IGVyYXNlIHRoZSBjdXJzb3IsIGFuZCBST1cgaXMgb3ZlcmxhcHBlZCBieSBvdGhlciByb3dzLCBt YWtlCisgIHN1cmUgdGhhdCB0aGVzZSBvdmVybGFwcGluZyBwYXJ0cyBvZiBvdGhlciByb3dzIGFy ZSByZWRyYXduLiAqLworICBpZiAoaGwgPT0gRFJBV19OT1JNQUxfVEVYVCAmJiByb3ctPm92ZXJs YXBwZWRfcCkKKyAgICB7CisgICAgICBpZiAocm93ID4gbWF0cml4LT5yb3dzCisgICAgICAgICAg JiYgTUFUUklYX1JPV19PVkVSTEFQU19TVUNDX1AgKHJvdyAtIDEpKQorICAgICAgICB4X2ZpeF9v dmVybGFwcGluZ19hcmVhICh3LCByb3cgLSAxLCBURVhUX0FSRUEsIE9WRVJMQVBTX0VSQVNFRF9D VVJTT1I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T5t aW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gbm90aGlu Zy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9s bAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExF OiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgZWxzZSBiZXNpZGVzIGhvcml6b250YWxseSBz Y3JvbGxpbmcgdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IGxpbmUgZGlmZmVyZW50bHkuCisg ICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9sbGVk IGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMV9wID0gKCF3LT5zdXNwZW5k X2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9s bF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOwor ICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAuLi4KKyAgICAgICAgICAgICAgIEN1cnJlbnQg bGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJv b2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPT0gMAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgKHNjcm9s bC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxlZnQgYXJyb3cga2V5IG9uZSB0aW1lLgor ICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRp ZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1wX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Ny b2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRv IHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVudCBsaW5lIHRvIGJlCisgICAgICAgICAg ICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBD dXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisg IGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAg ICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAg ICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3Jv bGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNj cm9sbCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBpbnQgZnJp bmdlX2JpdG1hcCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgIGludCBmYWNlX2lkID0gREVGQVVM VF9GQUNFX0lEOworICBpZiAoIXJlbW92ZV9wCisgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNf T1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICYmICFoc2NsX2FsbF90ZW1wX3AKKyAgICAgICYm ICFoc2NsX3RlbXBfcAorICAgICAgJiYgIWhzY2xfcGVybV9wCisgICAgICAmJiAhaHNjbF9hbGxf cGVybV8wX3AKKyAgICAgICYmICFoc2NsX2FsbF9wZXJtXzFfcAorICAgICAgJiYgIWhzY2xfYWxs X3Blcm1fMl9wKQorICAgIHsKKyAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2Vf aWQgPQorICAgICAgICAoIWFjdGl2ZV9wCisgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAgICAgID8gbG9va3Vw X25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1pbmFjdGl2ZS1wcmUt enYtZmFjZSIpLCB0cnVlKQorICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICA/IGxvb2t1 cF9u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 LCB0cnVlLCBjdXJzb3JfdHlwZSk7CisgICAgfQorICAgIGVsc2UgaWYgKCFyZW1vdmVfcAorICAg ICAgICAgICAgICYmIGdseXBoX2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUAorICAg ICAgICAgICAgICYmIChoc2NsX2FsbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9h bGxfcGVybV8wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8xX3AKKyAgICAg ICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8yX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNj bF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9wZXJtX3ApKQorICAgICAgeworICAg ICAgICBlbnVtIGZhY2VfaWQgb3ZlcmxheV9hcnJvd19mYWNlX2lkID0KKyAgICAgICAgICAoIWFj dGl2ZV9wCisgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3 LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaHNjbC1pbmFjdGl2ZS1wcmUtenYtZmFjZSIp LCB0cnVlKQorICAgICAgICAgIDogKGFjdGl2ZV9wKQorICAgICAgICAgICAgPyBsb29rdXBfbmFt ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtcHJlLXp2LWZhY2Ui KSwgdHJ1ZSkKKyAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgZmFjZV9pZCA9 IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAg ICA/IG92ZXJsYXlfYXJyb3dfZmFjZV9pZAorICAgICAgICAgICAgICAgICAgO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JpdG1hcCA9IChjdXJzb3JfdHlw ZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgcm93LT5sZWZ0 X2ZyaW5nZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9vZmZz ZXQgPSAwOworICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IGZhbHNlOwor ICAgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywgdHJ1ZSwgY3Vyc29yX3R5cGUp OworICAgICAgfQorICAgICAgZWxzZSBpZiAoIXJlbW92ZV9wCisgICAgICAgICAgICAgICAmJiAo Z2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAg ICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdM RV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19I T0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1D X1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2Zs YXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAg ICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAg ICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAg ICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNI KSkKKyAgICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IGJpdG1hcF9mbGF2b3IgPSAoZ2x5 cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19yZWN0YW5nbGVfcmlnaHRf YXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxh dm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfaG9sbG93X3Jl Y3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJU SUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBRbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9C QVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGlj YWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2Zs YXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNB TF9CQVJfQkFDS1NMQVNIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBRbmlsOworICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5 cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg PyBsb29rdXBfZnJpbmdlX2JpdG1hcCAoYml0bWFwX2ZsYXZvcikKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgIGZhY2VfaWQgPSAoY3Vy c29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgICAg JiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FS Uk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVS U0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAgICAg ICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmV2ZXJzZWQt YmFyLXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl90 eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAgICAgJiYg Z2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cK KyAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZF UlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9m bGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgICAg ID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistYmFyLXByZS16di1mYWNlIiks IHRydWUpCisgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAg IHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gZmFsc2U7CisgICAgICAgICAgcm93LT5yaWdodF9m cmluZ2VfYml0bWFwID0gZnJpbmdlX2JpdG1hcDsKKyAgICAgICAgICByb3ctPnJpZ2h0X2ZyaW5n ZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgICAgICByb3ctPnJpZ2h0X2ZyaW5nZV9vZmZzZXQg PSAwOworICAgICAgICAgIHJvdy0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wID0gZmFsc2U7Cisg ICAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwICh3LCByb3csIGZhbHNlLCBjdXJzb3JfdHlw ZSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBI CisgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSExFU1MpCisgICAg ICAgICAgeworICAgICAgICAgICAgYm9vbCBvbl9wID0gdHJ1ZTsKKyAgICAgICAgICAgIEZSQU1F X1JJRiAoZiktPm1jX3NjcmliZV9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnks IGhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9z LCB3ZCwgaCwgbHNsLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgZ2x5cGhfZmxhdm9yLCBvbl9wLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlX3ApOworICAgICAg ICAgIH0KK30KKworLyogRHVtcCBjb250ZW50cyBvZiBnbHlwaCBHTFlQSCB0byBzdGRlcnIuICBS T1cgYW5kIEFSRUEgYXJlCisgICB0aGUgZ2x5cGggcm93IGFuZCBhcmVhIHdoZXJlIHRoZSBnbHlw aCBjb21lcyBmcm9tLiAqLwordm9pZAorbWNfZHVtcF9nbHlwaCAoc3RydWN0IGdseXBoX3JvdyAq cm93LCBzdHJ1Y3QgZ2x5cGggKmdseXBoLCBpbnQgYXJlYSwKKyAgICAgICAgICAgICAgIGludCBy ZWxhdGl2ZV94LCBpbnQgdnBvcykKK3sKKyAgYm9vbCBnbHlwaF96dl9wID0gKGdseXBoIC0gcm93 LT5nbHlwaHNbYXJlYV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAg ICAgJiYgTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSA9PSBaVik7CisgIGlmIChnbHlwaC0+ dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICB8fCBnbHlwaC0+dHlwZSA9PSBHTFlQSExFU1NfR0xZ UEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01 ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJXNc biIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChy b3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAg IHJlbGF0aXZlX3gsCisgICAgICAgIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAg ICA/ICdDJworICAgICAgICAgOiAnRycpLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAg ICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAo U1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6 IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAg ICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBo LT51LmNoLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94 X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBo LT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgIG1jX2NoYXJfdG9fc3Ry aW5nIChnbHlwaC0+dS5jaCkpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gU1RS RVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICIgJTUi cEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgICUz ZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAg ICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwK KyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1MnLAorICAgICAgICBnbHlwaC0+Y2hhcnBv cywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdCJwor ICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJwor ICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICcwJworICAg ICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIDB1 LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVf cCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9z LCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICJcXFMiKTsKKyAgICB9CisgIGVs c2UgaWYgKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYg KHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4 JTA2eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+ Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6 IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnSScs CisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVj dCkKKyAgICAgICAgICAgID8gJ0InCisgICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVj dCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkK KyAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5w aXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuaW1nX2lkLAorICAg ICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAg ICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlw aF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisgICAgfQorICBlbHNlIGlmIChn bHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3Rk ZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4 IiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJv dy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAg cmVsYXRpdmVfeCwKKyAgICAgICAgJysnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAg ICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdCJworICAgICAgICAg IDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAg IDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICcwJworICAgICAgICAgIDog Jy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgICh1bnNpZ25lZCBp bnQpIGdseXBoLT51LmNtcC5pZCk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTRkICUxLjFk JTEuMWQiLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94 X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3ApOworICAgICAgaWYgKGds eXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgJTNkICVz IC4gWyVkLSVkXVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaC0+aHBvcywgZ2x5 cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT5z bGljZS5jbXAuZnJvbSwgZ2x5cGgtPnNsaWNlLmNtcC50byk7CisgICAgICAgIGVsc2UKKyAgICAg ICAgZnByaW50ZiAoc3RkZXJyLCAiXG4iKTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBl ID09IFhXSURHRVRfR0xZUEgpCisgICAgeworI2lmbmRlZiBIQVZFX1hXSURHRVRTCisgICAgICBl YXNzdW1lIChmYWxzZSk7CisjZWxzZQorICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAi ICAlNWQvJS01ZCAlNWQgJTRjICU2ZCAlYyAlM2QgMHglMDV4ICU0ZCAlMS4xZCUxLjFkICAlM2Qg JXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAg ICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisg ICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdYJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3Ms CisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICA/ICdCJworICAg ICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAg ICAgICA6ICctJykpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBo LT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlw aC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnUueHdpZGdldCwKKyAgICAgICAg Z2x5cGgtPmhwb3MsIGdseXBoX3p2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgJy4nKTsKKyNl bmRpZgorICAgIH0KK30KKworLyogRHVtcCB0aGUgY29udGVudHMgb2YgZ2x5cGggcm93IGF0IFZQ T1MgaW4gTUFUUklYIHRvIHN0ZGVyci4KKyAgIEdMWVBIUyAwIG1lYW5zIGRvbid0IHNob3cgZ2x5 cGggY29udGVudHMuCisgICBHTFlQSFMgMSBtZWFucyBzaG93IGdseXBocyBpbiBzaG9ydCBmb3Jt CisgICBHTFlQSFMgPiAxIG1lYW5zIHNob3cgZ2x5cGhzIGluIGxvbmcgZm9ybS4gKi8KK3ZvaWQK K21jX2R1bXBfZ2x5cGhfcm93IChzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB2cG9zLCBpbnQg Z2x5cGhzKQoreworICBpbnQgcmVsYXRpdmVfeCA9IDA7CisgIGlmIChnbHlwaHMgIT0gMSkKKyAg ICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJcbkRVTVAgR0xZUEggUk9XXG4iKTsKKyAgICAg IGZwcmludGYgKHN0ZGVyciwgIlJvdyAgICAgU3RhcnQgICAgICAgRW5kIFVzZWQgb0U+PFxcQ1Ra RmVzbSAgICAgWCAgICBZICAgIFcgICAgSCAgICBWICAgIEEgICAgUFxuIik7CisgICAgICBmcHJp bnRmIChzdGRlcnIsICI9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiIpOworICAgICAgZnByaW50ZiAo c3RkZXJyLCAiJTNkICU5InBEImQgJTkicEQiZCAlNGQgJTEuMWQlMS4xZCUxLjFkJTEuMWRcCisl MS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkICAlNGQgJTRkICU0ZCAlNGQg JTRkICU0ZCAlNGRcbiIsCisgICAgICAgICB2cG9zLAorICAgICAgICAgTUFUUklYX1JPV19TVEFS VF9DSEFSUE9TIChyb3cpLAorICAgICAgICAgTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSwK KyAgICAgICAgIHJvdy0+dXNlZFtURVhUX0FSRUFdLAorICAgICAgICAgcm93LT5jb250YWluc19v dmVybGFwcGluZ19nbHlwaHNfcCwKKyAgICAgICAgIHJvdy0+ZW5hYmxlZF9wLAorICAgICAgICAg cm93LT50cnVuY2F0ZWRfb25fbGVmdF9wLAorICAgICAgICAgcm93LT50cnVuY2F0ZWRfb25fcmln aHRfcCwKKyAgICAgICAgIHJvdy0+Y29udGludWVkX3AsCisgICAgICAgICBNQVRSSVhfUk9XX0NP TlRJTlVBVElPTl9MSU5FX1AgKHJvdyksCisgICAgICAgICBNQVRSSVhfUk9XX0RJU1BMQVlTX1RF WFRfUCAocm93KSwKKyAgICAgICAgIHJvdy0+ZW5kc19hdF96dl9wLAorICAgICAgICAgcm93LT5m aWxsX2xpbmVfcCwKKyAgICAgICAgIHJvdy0+ZW5kc19pbl9taWRkbGVfb2ZfY2hhcl9wLAorICAg ICAgICAgcm93LT5zdGFydHNfaW5fbWlkZGxlX29mX2NoYXJfcCwKKyAgICAgICAgIHJvdy0+bW91 c2VfZmFjZV9wLAorICAgICAgICAgcm93LT54LAorICAgICAgICAgcm93LT55LAorICAgICAgICAg cm93LT5waXhlbF93aWR0aCwKKyAgICAgICAgIHJvdy0+aGVpZ2h0LAorICAgICAgICAgcm93LT52 aXNpYmxlX2hlaWdodCwKKyAgICAgICAgIHJvdy0+YXNjZW50LAorICAgICAgICAgcm93LT5waHlz X2FzY2VudCk7CisgICAgICAvKiBUaGUgbmV4dCAzIGxpbmVzIHNob3VsZCBhbGlnbiB0byAiU3Rh cnQiIGluIHRoZSBoZWFkZXIuICovCisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTkicEQi ZCAlOSJwRCJkXHQlNWRcbiIsIHJvdy0+c3RhcnQub3ZlcmxheV9zdHJpbmdfaW5kZXgsCisgICAg ICAgICByb3ctPmVuZC5vdmVybGF5X3N0cmluZ19pbmRleCwKKyAgICAgICAgIHJvdy0+Y29udGlu dWF0aW9uX2xpbmVzX3dpZHRoKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgICAlOSJwRCJk ICU5InBEImRcbiIsCisgICAgICAgICBDSEFSUE9TIChyb3ctPnN0YXJ0LnN0cmluZ19wb3MpLAor ICAgICAgICAgQ0hBUlBPUyAocm93LT5lbmQuc3RyaW5nX3BvcykpOworICAgICAgZnByaW50ZiAo c3RkZXJyLCAiICAgICU5ZCAlOWRcbiIsIHJvdy0+c3RhcnQuZHB2ZWNfaW5kZXgsCisgICAgICAg ICByb3ctPmVuZC5kcHZlY19pbmRleCk7CisgICAgfQorICBpZiAoZ2x5cGhzID4gMSkKKyAgICB7 CisgICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9NQVJHSU5fQVJFQTsgYXJlYSA8IExBU1RfQVJF QTsgKythcmVhKQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaCA9IHJv dy0+Z2x5cGhzW2FyZWFdOworICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGhfZW5kID0gZ2x5 cGggKyByb3ctPnVzZWRbYXJlYV07CisgICAgICAgICAgLyogR2x5cGggZm9yIGEgbGluZSBlbmQg aW4gdGV4dC4gKi8KKyAgICAgICAgICBpZiAoYXJlYSA9PSBURVhUX0FSRUEgJiYgZ2x5cGggPT0g Z2x5cGhfZW5kICYmIGdseXBoLT5jaGFycG9zID4gMCkKKyAgICAgICAgICAgICsrZ2x5cGhfZW5k OworICAgICAgICAgIGlmIChnbHlwaCA8IGdseXBoX2VuZCkKKyAgICAgICAgICAgIGZwcmludGYg KHN0ZGVyciwgIkdseXBoIy9Ub3RhbCBSZWwuWCBUICAgICAgIFBvcyBPICAgVyAgICAgQ29kZSBG YWNlIExSIEhQT1MgWlYgQ1xuIik7CisgICAgICAgICAgZm9yICg7IGdseXBoIDwgZ2x5cGhfZW5k OyArK2dseXBoKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19kdW1wX2dseXBoIChy b3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB2cG9zKTsKKyAgICAgICAgICAgICAgcmVsYXRp dmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAg ICB9CisgICAgZWxzZSBpZiAoZ2x5cGhzID09IDEpCisgICAgICB7CisgICAgICAgIGNoYXIgc1tT SFJUX01BWCArIDRdOworICAgICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9NQVJHSU5fQVJFQTsg YXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCBp OworICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHJvdy0+dXNlZFthcmVhXTsgKytpKQorICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+ Z2x5cGhzW2FyZWFdICsgaTsKKyAgICAgICAgICAgICAgICBpZiAoaSA9PSByb3ctPnVzZWRbYXJl YV0gLSAxCisgICAgICAgICAgICAgICAgICAgICYmIGFyZWEgPT0gVEVYVF9BUkVBCisgICAgICAg ICAgICAgICAgICAgICYmIE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICAgICAg ICYmIGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgICAgICAgICAgICAgJiYgZ2x5 cGgtPnUuY2ggPT0gJyAnKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ICBzdHJjcHkgKCZzW2ldLCAiW1xcbl0iKTsKKyAgICAgICAgICAgICAgICAgICAgaSArPSA0Owor ICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZ2x5cGgtPnR5 cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnUu Y2ggPCAweDgwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+dS5jaCA+PSAn ICcpCisgICAgICAgICAgICAgICAgICAgIHNbaV0gPSBnbHlwaC0+dS5jaDsKKyAgICAgICAgICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgIHNbaV0gPSAnLic7CisgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgIHNbaV0gPSAnXDAnOworICAgICAgICAgICAgZnByaW50ZiAo c3RkZXJyLCAiJTNkOiAoJWQpICclcydcbiIsIHZ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X2xpbmVfaGVpZ2h0ID4gMAorICAgICAgICAgICAgICAgICAgICAgJiYgeXBvcyA+IDApCisg ICAgICAgICAgICAgICAgICAgICAgPyB5cG9zICsgMQorICAgICAgICAgICAgICAgICAgICAgIDog eXBvczsKKyAgICAgIGlmICh2aXNpYmxlX3ApCisgICAgICAgIHZwb3MgPSB2b2Zmc2V0OworICAg ICAgICBlbHNlCisgICAgICAgICAgdnBvcyA9IDA7CisgICAgfQorICAgIGVsc2UKKyAgICAgIHsK KyAgICAgICAgQ0hFQ0tfTlVNQkVSIChyb3cpOworICAgICAgICB2cG9zID0gWEZJWE5VTSAocm93 KTsKKyAgICAgIH0KKyAgaWYgKHZwb3MgPj0gMCAmJiB2cG9zIDwgbWF0cml4LT5ucm93cykKKyAg ICBtY19kdW1wX2dseXBoX3JvdyAoTUFUUklYX1JPVyAobWF0cml4LCB2cG9zKSwKKyAgICAgICAg dnBvcywKKyAgICAgICAgVFlQRV9SQU5HRURfRklYTlVNUCAoaW50LCBnbHlwaHMpID8gWEZJWE5V TSAoZ2x5cGhzKSA6IDIpOworICByZXR1cm4gUW5pbDsKK30KKwordm9pZAorbWNfZHVtcF9nbHlw aF9tYXRyaXggKHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgaW50IGdseXBocykKK3sKKyAg aW50IGk7CisgIGZvciAoaSA9IDA7IGkgPCBtYXRyaXgtPm5yb3dzOyArK2kpCisgICAgbWNfZHVt cF9nbHlwaF9yb3cgKE1BVFJJWF9ST1cgKG1hdHJpeCwgaSksIGksIGdseXBocyk7Cit9CisKK0RF RlVOICgibWMtZHVtcC1nbHlwaC1tYXRyaXgiLCBGbWNfZHVtcF9nbHlwaF9tYXRyaXgsCisgICAg ICAgU21jX2R1bXBfZ2x5cGhfbWF0cml4LCAwLCAxLCAicCIsCisgICAgICAgZG9jOiAvKiBEdW1w IHRoZSBjdXJyZW50IG1hdHJpeCBvZiB0aGUgc2VsZWN0ZWQgd2luZG93IHRvIHN0ZGV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BTkdFRF9GSVhOVU1QIChpbnQsIGdseXBocykgPyBYRklY TlVNIChnbHlwaHMpIDogMCk7CisgIHJldHVybiBRbmlsOworfQorCitib29sCittY190cmF2ZXJz ZV9jYWNoZV9wIChzdHJ1Y3QgbWNfbWF0cml4IG1hdHJpeCwgZW51bSBtY19jYWNoZV90eXBlIGNh Y2hlX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICBpbnQgdm50aCwgaW50IG50aCkKK3sKKyAg aWYgKHZudGggPCBtYXRyaXgudnBvc191c2VkCisgICAgICAmJiBtYXRyaXguY3Vyc29yc191c2Vk W2NhY2hlX3R5cGVdID4gMAorICAgICAgJiYgbnRoIDwgbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVf dXNlZFtjYWNoZV90eXBlXSkKKyAgICByZXR1cm4gdHJ1ZTsKKyAgICBlbHNlCisgICAgICByZXR1 cm4gZmFsc2U7Cit9CisKK3ZvaWQKK21jX3Jlc2V0X2NhY2hlIChzdHJ1Y3Qgd2luZG93ICp3KQor eworICBpZiAoIUJVRkZFUlAgKHctPmNvbnRlbnRzKSkKKyAgICByZXR1cm47CisgIGZvciAoZW51 bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICBjYWNoZV90eXBl IDwgTk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGJvb2wgYnZh cl9hY3RpdmVfcDsKKyAgICAgIHN3aXRjaCAoY2FjaGVfdHlwZSkKKyAgICAgICAgeworICAgICAg ICAgIGNhc2UgTk9fQ0FDSEU6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHJldHVybjsK KyAgICAgICAgICAgIH0KKyAgICAgICAgICBjYXNlIE1DX0NBQ0hFOgorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAg ICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkKKyAgICAg ICAgICAgICAgICBidmFyX2FjdGl2ZV9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgZWxzZSBp ZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICAgICAg ICAgICAgYnZhcl9hY3RpdmVfcCA9IHRydWU7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAg ICAgICAgfQorICAgICAgICAgIGNhc2UgQ0hfQ0FDSEU6CisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICYmIE5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgICAg ICAgICAgIGJ2YXJfYWN0aXZlX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChC VUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICAgICAgICAg ICAgICBidmFyX2FjdGl2ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAg ICAgICB9CisgICAgICAgICAgY2FzZSBGQ19DQUNIRToKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgJiYgTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgICAgICAg ICAgICAgYnZhcl9hY3RpdmVfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKEJV RkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkKKyAgICAgICAgICAgICAg ICAgIGJ2YXJfYWN0aXZlX3AgPSB0cnVlOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAg ICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKCFidmFyX2FjdGl2ZV9wKQorICAgICAgICB7Cisg ICAgICAgICAgLyogRGVjcmVhc2UgdGhlIHNpemUgb2YgdGhlIGFycmF5IHRvIGEgYmFyZSBtaW5p bXVtLiAqLworICAgICAgICAgIGZvciAoaW50IHZudGggPSAwOyB2bnRoIDwgdy0+bWNfbWF0cml4 LnZwb3NfdXNlZDsgKyt2bnRoKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAody0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdID4gMSkKKyAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXSA9CisgICAgICAgICAgICAgICAgICAgIHhucmVhbGxvYyAody0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV0sIDEsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgc2l6ZW9mICp3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXSk7CisgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV0gPSAxOworICAgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSA9 ID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m1jX21hdHJpeC52cG9zX3VzZWQ7ICsrdm50aCkK KyAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90 eXBlXSA9IDA7CisgICAgICAgICAgICB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5 cGVdID0gMDsKKyAgICAgICAgICB9CisgICAgfQorfQorCitzdGF0aWMgdm9pZAorbWNfaGVscGVy IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBn bHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaCwgaW50IHgsIGlu dCBmeCwgaW50IHksIGludCBmeSwgaW50IGhwb3MsIGludCB2cG9zLAorICAgICAgICAgICBpbnQg d2QsIGludCBoLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLCBpbnQgY3Vyc29yX3dp ZHRoLAorICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGZvcmVncm91bmQsIHN0cnVjdCBtY19SR0Ig YmFja2dyb3VuZCwgYm9vbCBhY3RpdmVfcCwKKyAgICAgICAgICAgZW51bSBtY19mbGF2b3IgZ2x5 cGhfZmxhdm9yLCBib29sIGRyYXdfcCwgZW51bSBtY19kcmF3X3Jvd190eXBlIGZyb21fd2hlcmUs CisgICAgICAgICAgIGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlLCBlbnVtIG1jX2VuZ2lu ZV90eXBlIGFjdGlvbl90eXBlKQoreworICBpbnQgdm50aCA9IE1BVFJJWF9ST1dfVlBPUyAocm93 LCBtYXRyaXgpOworICBpZiAobWNfc3RkZXJyX3AKKyAgICAgICYmIGRyYXdfcCkKKyAgICB7Cisg ICAgICBpbnQgY2hhcnBvcyA9IGdseXBoLT5jaGFycG9zOworICAgICAgZnByaW50ZiAoc3RkZXJy LCAiXG5tY19o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AgICAgICAgfHwgZnJvbV93aGVyZSA9PSBQ T1NUX0NIQU5HRUQKKyAgICAgICAgICB8fCBmcm9tX3doZXJlID09IFVOQ0hBTkdFRAorICAgICAg ICAgIHx8IGZyb21fd2hlcmUgPT0gU0VUX0NVUlNPUl9UV08pKQorICAgIHsKKyAgICAgIGJvb2wg c2FtZV9wID0gZmFsc2U7CisgICAgICBmb3IgKGludCBudGggPSAwOyBudGggPCB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdOyArK250aCkKKyAgICAgICAgewor ICAgICAgICAgIHNhbWVfcCB8PQorICAgICAgICAgICAgKHctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0uc2FtZV9wID09IHRydWUKKyAgICAgICAgICAgICAmJiB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnR5cGUg PT0gZ2x5cGgtPnR5cGUKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLmJ5dGVwb3MgPT0gZ2x5cGgtPmJ5dGVwb3MKKyAg ICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmdseXBoLmNoYXJwb3MgPT0gZ2x5cGgtPmNoYXJwb3MKKyAgICAgICAgICAgICAmJiB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnUudmFsID09 IGdseXBoLT51LnZhbAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGguZmFjZV9pZCA9PSBnbHlwaC0+ZmFjZV9pZAorICAg ICAgICAgICAgICYmIHctPm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LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5nbHlwaF9mbGF2b3IgPT0gZ2x5cGhfZmxhdm9yCisgICAg ICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XS5lbmFibGVkX3AgPT0gdHJ1ZSk7CisgICAgICAgIH0KKyAgICAgIGlmICghc2FtZV9wKQorICAg ICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwg aHBvcywgdnBvcywgd2QsIGgsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBhY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBy ZW1vdmVfcCk7CisgICAgICByZXR1cm47CisgICAgfQorICAgIGVsc2UgaWYgKGRyYXdfcAorICAg ICAgICAgICAgICYmIChmcm9tX3doZXJlID09IFNDUklCRV9PTkUKKyAgICAgICAgICAgICAgICAg fHwgZnJvbV93aGVyZSA9PSBTQ1JJQkVfVFdPCisgICAgICAgICAgICAgICAgIHx8IGZyb21fd2hl cmUgPT0gU0NSSUJFX1RIUkVFCisgICAgICAgICAgICAgICAgIHx8IGZyb21fd2hlcmUgPT0gTk9X SEVSRSkpCisgICAgICB7CisgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCBtYXRyaXgs IHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwgY3Vyc29yX3R5cGUsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGFjdGl2 ZV9wLCBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAgICAgcmV0dXJuOworICAgICAgfQor ICBpZiAoY2FjaGVfdHlwZSA9PSBOT19DQUNIRSkKKyAgICByZXR1cm47CisgICsrdy0+bWNfbWF0 cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgaWYgKHZudGggPj0gdy0+bWNfbWF0cml4 LnZwb3NfdXNlZCkKKyAgICB3LT5tY19tYXRyaXgudnBvc191c2VkID0gdm50aCArIDE7CisgIGlm ICh3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQgPCB3LT5tY19tYXRyaXgudnBvc191c2VkKQor ICAgIHsKKyAgICAgIGludCBvbGRfYWxsb2MgPSB3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQ7 CisgICAgICBpbnQgbmV3X2VsdHMgPSB3LT5tY19tYXRyaXgudnBvc191c2VkIC0gdy0+bWNfbWF0 cml4LnZwb3NfYWxsb2NhdGVkOworICAgICAgdy0+bWNfbWF0cml4LnZwb3MgPSB4cGFsbG9jICh3 LT5tY19tYXRyaXgudnBvcywgJnctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMsIElOVF9NQVgsIHNpemVvZiAqdy0+ bWNfbWF0cml4LnZwb3MpOworICAgICAgbWVtc2V0ICh3LT5tY19tYXRyaXgudnBvcyArIG9sZF9h bGxvYywgMCwKKyAgICAgICAgICAgICAgICh3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQgLSBv bGRfYWxsb2MpICogc2l6ZW9mICp3LT5tY19tYXRyaXgudnBvcyk7CisgICAgfQorICArK3ctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV07CisgIGlmICh3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV0gPCB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdKQorICAgIHsKKyAgICAgIGludCBv bGRfYWxsb2MgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVf dHlwZV07CisgICAgICBpbnQgbmV3X2VsdHMgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZV91c2VkW2NhY2hlX3R5cGVdIC0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2Nh dGVkW2NhY2hlX3R5cGVdOworICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV0gPSB4cGFsbG9jICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX2FsbG9jYXRlZFtjYWNoZV90 eXBlXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgbmV3X2VsdHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIElOVF9NQVgsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAqdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV0pOworICAgICAgbWVtc2V0ICh3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSArIG9sZF9hbGxvYywgMCwKKyAgICAgICAgICAg ICAgICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV0g LSBvbGRfYWxsb2MpCisgICAgICAgICAgICAgICAgICogc2l6ZW9mICp3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWN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ZXJzYWwgRlkgY29vcmRpbmF0ZSBmb3IgYSBsZXZlbCBydWxlci4K KyAgIFZFUlRJQ0FMX1JVTEVSIGFuZCBGSUxMX0NPTFVNTjogIFdlIHdhbnQgYW4gSCB0aGF0IGVu c3VyZXMgbm8gZ2FwIGJldHdlZW4gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBwcmV2aW91cy9uZXh0IGxpbmUuICBUaGUgRlggY29vcmRpbmF0ZSBpcyBzZXQKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V3aGVyZTogIGB3LT5jdXJzb3IueGAg LyBgbWMuZmNfeGAuICovCit2b2lkCittY19nZXRfY3Vyc29yX2dlb21ldHJ5IChzdHJ1Y3Qgd2lu ZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsCisgICAgICAgICAgICAgICAgICAg ICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB4LCBpbnQgKmZ4LCBpbnQgeSwKKyAgICAg ICAgICAgICAgICAgICAgICAgIGludCAqZnksIGludCBocG9zLCBpbnQgdnBvcywgaW50ICpoLAor ICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwg aW50IGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCAqd2QpCit7Cisg IHN0cnVjdCBnbHlwaCAqZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJv dywgaHBvcywgdnBvcyk7CisgIGlmIChnbHlwaCA9PSBOVUxMKQorICAgIHJldHVybjsKKyAgc3Ry dWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgKmZ4ID0gV0lORE9X X1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICpoID0gcm93LT52aXNpYmxlX2hlaWdo dDsKKyAgLyogRG9uJ3QgbGV0IHRoZSBjdXJzb3IgZXhjZWVkIHRoZSBkaW1lbnNpb25zIG9mIHRo ZSByb3csIHNvIHRoYXQKKyAgdGhlIHVwcGVyL2xvd2VyIHNpZGUgb2YgdGhlIGJveCBhcmVuJ3Qg Y2xpcHBlZC4gICovCisgIGludCB3X2hlYWRlcl9saW5lX2hlaWdodCA9IFdJTkRPV19IRUFERVJf TElORV9IRUlHSFQgKHcpOworICBpbnQgd190ZXh0X2JvdHRvbV95ID0gd2luZG93X3RleHRfYm90 dG9tX3kgKHcpIC0gKmg7CisgIGlmICh5IDwgd19oZWFkZXJfbGluZV9oZWlnaHQpCisgICAgewor ICAgICAgKmggPSBtYXggKCpoIC0gKHdfaGVhZGVyX2xpbmVfaGVpZ2h0IC0geSkgKyAxLCAqaCk7 CisgICAgICB5ID0gd19oZWFkZXJfbGluZV9oZWlnaHQgLSAxOworICAgICAgLy8gZnByaW50ZiAo c3RkZXJyLCAiQ09ORElUSU9OICMgMVxuIik7CisgICAgfQorICAgZWxzZSBpZiAoeSA+IHdfdGV4 dF9ib3R0b21feSkKKyAgICAgeworICAgICAgICpoICs9IHkgLSB3X3RleHRfYm90dG9tX3k7Cisg ICAgICAgeSA9IHdfdGV4dF9ib3R0b21feTsKKyAgICAgICAvLyBmcHJpbnRmIChzdGRlcnIsICJD T05ESVRJT04gIyAyXG4iKTsKKyAgICAgfQorICAqZnkgPSBXSU5ET1dfVE9fRlJBTUVfUElYRUxf WSAodywgeSk7CisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgeworICAgICAgY2FzZSBNQ19C QVI6CisgICAgICAgIHsKKyAgICAgICAgICBpZiAoY3Vyc29yX3dpZHRoIDwgMSkKKyAgICAgICAg ICAgIGN1cnNvcl93aWR0aCA9IG1heCAoRlJBTUVfQ1VSU09SX1dJRFRIIChmKSwgMSk7CisgICAg ICAgICAgaWYgKGN1cnNvcl93aWR0aCA8IGdseXBoLT5waXhlbF93aWR0aCkK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nVmID0gdy0+Y29udGVudHM7CisgIENIRUNLX0JVRkZFUiAoYnVm KTsKKyAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1Zik7CisgIGludCB0ZXh0X2FyZWFf d2lkdGggPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICBzdHJ1Y3QgZ2x5cGhf cm93ICpjdXJzb3Jfcm93ID0gKHctPmN1cnNvci52cG9zICE9IC0xKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XIChjdXJzb3JfbWF0cml4LCB3LT5jdXJzb3Iu dnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgc3RydWN0 IGdseXBoICpjdXJzb3JfZ2x5cGggPSAody0+Y3Vyc29yLnZwb3MgIT0gLTEpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBjdXJzb3JfbWF0 cml4LCBjdXJzb3Jfcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgYm9vbCBjdXJzb3JfYXRfZnJpbmdlX3Ag PSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg Y3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1 cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT5leGFjdF93aW5kb3dfd2lkdGhfbGluZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IHRleHRfYXJlYV93 aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSBjdXJz b3Jfcm93LT5waXhlbF93aWR0aCk7CisgIGJvb2wgY3Vyc29yX2JleW9uZF9mcmluZ2VfcCA9IChj dXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg Y3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmICFjdXJzb3Jfcm93LT5leGFjdF93aW5kb3dfd2lkdGhf bGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+ PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct PmN1cnNvci54ID49IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRoKTsKKyAgaW50IGZyYW1lX2NoYXJf d2lkdGggPSBGUkFNRV9DT0xVTU5fV0lEVEggKGYpOworICBpbnQgdGVtcF9mYWNlX2lkID0gZ2x5 cGgtPmZhY2VfaWQ7CisgIHN0cnVjdCBtY19SR0IgYmFja2dyb3VuZDsKKyAgbWNfc2V0X2xzbF9i ZyAodywgdGVtcF9mYWNlX2lkLCAmYmFja2dyb3VuZCk7CisgIGJvb2wgcmVhbF9mYWtlX2N1cnNv cl9wID0gKG9wb2ludF94ID09IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb3BvaW50X2hwb3MgPT0gaHBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvcG9pbnRfeSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3Bv aW50X3Zwb3MgPT0gdnBvcyk7CisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAg ICAgICAgICAgICAgICAgIEJFR0lOOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAg ICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgaWYgKGdseXBoLT50 eXBlID09IENIQVJfR0xZUEgKKyAgICAgIHx8IGdseXBoLT50eXBlID09IEdMWVBITEVTU19HTFlQ SCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAg ICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAl MS4xZCUxLjFkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVY VF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2Vk W2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgIChnbHlwaC0+dHlwZSA9 PSBDSEFSX0dMWVBICisgICAgICAgICA/ICdDJworICAgICAgICAgOiAnRycpLAorICAgICAgICBn bHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAg ID8gJ1MnCisgICAgICAgICAgICA6IChO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cm9tX3doZXJlLCBjYWNoZV90eXBlLAorICAgICAgICAgICAgICAgICBhY3Rpb25fdHlwZSk7Cisg ICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAg ICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAg ICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBIT1JJWk9O VEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChyZWxhdGl2ZV94IDwgcm93LT5waXhlbF93aWR0 aAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAo dywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3Ms CisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZv cmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3Rp dmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwKKyAgICAgICAg ICAgICAgICAgICBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2ZV94 IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAocmVsYXRpdmVfeCA8IHJvdy0+ cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0g Z2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICBmeCArPSBnbHlwaC0+cGl4ZWxfd2lk dGg7CisgICAgICAgICAgICB9CisgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywg Z2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAg ICAgICAgIHhfbGltaXQgLSByZWxhdGl2ZV94LCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRo LAorICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwgZXNzZW50aWFs cy5hY3RpdmVfcCwgTUNfR0xZUEhMRVNTLAorICAgICAgICAgICAgICAgICAgICAgZHJhd19wLCBm cm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAgIH0KKyAgICAgIGJy ZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICBW RVJUSUNBTF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAg ICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVS OgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJzb3JfYXRf ZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNv bnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZF UlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9S SUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29y X2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPnVz ZWRbVEVYVF9BUkVBXSAhPSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9 PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FM X0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0g TUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBN Q19WRVJUSUNBTF9CQVIKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURf VkVSVElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IE1DX1JJR0hUX0ZSSU5HRV9CSVRN QVA7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlw aCwgcmVsYXRpdmVfeCwgb3BvaW50X2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAg ICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tn cm91bmQsCisgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIGdseXBoX2ZsYXZv ciwgZHJhd19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLAorICAgICAgICAgICAgICAgICBhY3Rp b25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K Ky8qICAgICAgICAgICAgICAgRklMTF9DT0xVTU46ICBDSEFSX0dMWVBIIHwgR0xZUEhMRVNTX0dM WVBIICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2Fz ZSBGSUxMX0NPTFVNTjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3Ig PSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3gg Pj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog KGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNf R0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICghTklMUCAo QlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92ZXJ0aWNhbF9y dWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRf eSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRf dnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1D X0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQ SDsKKyAgICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBo LCByZWxhdGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAg IHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5k LAorICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRy YXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwKKyAgICAgICAgICAgICAgICAgYWN0aW9uX3R5 cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAg Y2FzZSBDVVJTT1JfSU5ESUNBVE9SOgorICAgIHsKKyAgICAgIGJyZW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ICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRb YXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1MnLAorICAgICAgICBn bHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAg ID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAg ICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxf d2lkdGgsCisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5 cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisg ICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICJc XFMiKTsKKyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAgeworLyogLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t ICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlM6ICBTVFJFVENI X0dMWVBIICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLwor ICAgIGNhc2UgTVVMVElQTEVfQ1VSU09SUzoKKyAgICB7CisgICAgICBtY19oZWxwZXIgKHcs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1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsIGNhY2hl X3R5cGUsCisgICAgICAgICAgICAgICAgICAgYWN0aW9uX3R5cGUpOworICAgICAgaWYgKGdseXBo IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAg ICAgJiYgcmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAgICB7CisgICAgICAgICAgaWYgKHJl bGF0aXZlX3ggPCByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBn bHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgdGVtcF9mYWNlX2lkID0gKHJvdy0+ZmlsbF9s aW5lX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBnbHlwaC0+ZmFjZV9pZAorICAgICAg ICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgIHN0cnVjdCBt Y19SR0IgYmFja2dyb3VuZDsKKyAgICAgICAgICBtY19zZXRfbHNsX2JnICh3LCB0ZW1wX2ZhY2Vf aWQsICZiYWNrZ3JvdW5kKTsKKyAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBn bHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAg ICAgICAgeF9saW1pdCAtIHJlbGF0aXZlX3gsIGgsIGN1cnNvcl90eXBlLCB4X2xpbWl0IC0gcmVs YXRpdmVfeCwKKyAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQsIGJhY2tncm91bmQsIGVz c2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBITEVTUywKKyAgICAgICAgICAgICAgICAgICAgIGRy YXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgICB9Cisg ICAgICBicmVhazsKKyAgIC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l9hdF9mcmluZ2Vf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGludWVk X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxf QkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vy c29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FS Uk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25k X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ct PnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNlZFtURVhU X0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFy b3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiBNQ19HTFlQSExFU1M7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9yID09 IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9 PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlw aF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGdseXBo X2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0g TUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IE1DX1JJR0hU X0ZSSU5HRV9CSVRNQVA7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJp eCwgcm93LCBnbHlwaCwgb3BvaW50X3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3MsIHZwb3MsCisg ICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3Jv dW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBn bHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgY2FjaGVf dHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgYn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IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyog ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCRUdJTjogIElNQUdFX0dMWVBIICAgICAgICAg ICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgZWxzZSBp ZiAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgIHsKKyAgICBpZiAobWNfc3RkZXJyX3Ap CisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICJcbiAlNSJwRCJkLyUtNWQgJTVkICVj ICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVjXG4iLAorICAg ICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2Vk W2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2 ZV94LAorICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVG RkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQ IChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAg KGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAn LScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2lnbmVkIGlu dCkgZ2x5cGgtPnUuaW1nX2lkLAorICAgICAgICB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t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAg ICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIElNQUdFX0dMWVBIICAgICAgICAgICAgICAgICAg ICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVM RVI6CisgICAgeworICAgICAgY3Vyc29yX3R5cGUgPSBNQ19IT0xMT1dfQk9YOworICAgICAgaWYg KCFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3cs IGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAg ICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tn cm91bmQsCisgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgs IGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwKKyAgICAgICAgICAgICAgICAgICBhY3Rp b25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K Ky8qICAgICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVI6ICBJTUFHRV9HTFlQ SCAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0g Q09NUE9TSVRFX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgeworICAg ICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMg JTkicEQiZCAlYyAlM2QgMHglMDZ4IiwKKyAgICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RF WFRfQVJFQV0sCisgICAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51 c2VkW2FyZWFdIC0gMSksCisgICAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgICAnKycsCisg ICAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmpl Y3QpCisgICAgICAgICAgID8gJ0InCisgICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmpl Y3QpCisgICAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5v YmplY3QpCisgICAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICAgIDogJy0nKSkp LAorICAgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgICAodW5zaWduZWQgaW50 KSBnbHlwaC0+dS5jbXAuaWQpOworICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTRkICUxLjFk JTEuMWQiLAorICAgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICAgIGdseXBoLT5sZWZ0 X2JveF9saW5lX3AsCisgICAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3ApOworICAgICAg aWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAg JTNkICVzIC4gWyVkLSVkXVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaC0+aHBv cywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGds eXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgtPnNsaWNlLmNtcC50byk7CisgICAgICAgIGVsc2UK KyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJcbiIpOworICAgICAgfQorICBzd2l0Y2ggKGFj dGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAg ICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAgICAg ICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9D VVJTT1JTOgorICAgIHsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCBy ZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBo LCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAg ICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9t X3doZXJlLCBjYWNoZV90eXBlLAorICAgICAgICAgICAgICAgICBhY3Rpb25fdHlwZSk7CisgICAg ICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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GVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZl X3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICB3ZCwg aCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSExFU1Ms IGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBl LCBhY3Rpb25fdHlwZSk7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZnJhbWVfY2hhcl93 aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorLyog LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNB TF9SVUxFUjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6CisgICAgeworICAgICAg ZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGludWVkX3ApCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tT TEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2Zy aW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5j b250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJv dy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9w CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRl ZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1D X1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9 IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5j YXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVh XSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF94 ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1D X0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQ SDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9X CisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9S SUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJf QkFDS1NMQVNICisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUgor ICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisg ICAgICAgIGN1cnNvcl90eXBlID0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUDsKKyAgICAgIHdkID0g MTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBv cG9pbnRfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vy c29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwKKyAgICAgICAg ICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3AsIGZyb21f d2hlcmUsCisgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAg IGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAg ICAgICAgICAgICAgIEZJTExfQ09MVU1OOiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAgICAgICAg ICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEZJTExfQ09MVU1O OgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChnbHlwaCAtIHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+IHJlbGF0aXZlX3gp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF96dl9wKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMp KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3kgPT0geQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBvcykKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICB3ZCA9IDE7Cisg ICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZmNfZngs IHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUs IGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAg ZXNzZW50aWFscy5hY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3AsIGZyb21fd2hlcmUsIGNh Y2hlX3R5cGUsCisgICAgICAgICAgICAgICAgIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOwor ICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgQ1VSU09SX0lORElDQVRP UjoKKyAgICB7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K KyAgfQorICB9CisvKiAtLS0tLS0t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dGl2ZV94 LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVS UCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChn bHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogJy0nKSksCisg ICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAg ICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGlu ZV9wLAorICAgICAgICBnbHlwaC0+dS54d2lkZ2V0LAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5 cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicpOworI2VuZGlmCisgIHN3aXRjaCAo YWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAg ICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAg ICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIE1VTFRJUExF X0NVUlNPUlM6CisgICAgeworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgs IHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2Qs IGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisg ICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZy b21fd2hlcmUsIGNhY2hlX3R5cGUsCisgICAgICAgICAgICAgICAgIGFjdGlvbl90eXBlKTsKKyAg ICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAg ICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSOiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAg ICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05U QUxfUlVMRVI6CisgICAgeworICAgICAgaWYgKHJlbGF0aXZlX3ggPD0geF9saW1pdAorICAgICAg ICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4 LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAg ICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQs IGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNf R0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwKKyAgICAgICAgICAgICAgICAg ICBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFd ID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2ZV94IDw9IHhfbGlt aXQpCisgICAgICAgIHsKKyAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0 aDsKKyAgICAgICAgICB3aGlsZSAocmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAgICAgICAg eworICAgICAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRp dmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgIHdk LCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAor ICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBITEVT UywgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICAgICAgICAgIGNhY2hlX3R5 cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBmcmFtZV9jaGFy X3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9Cisv KiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICBWRVJU SUNBTF9SVUxFUjogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLworLyogLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAg ICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFD S1NMQVNICisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRf ZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ct PmNvbnRpbnVlZF9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAh cm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNh dGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g TUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0g IT0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1 bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2Fy ZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50 X3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g TUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0dM WVBIOworICAgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJS T1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JB Ul9CQUNLU0xBU0gKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFS CisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikK KyAgICAgICAgY3Vyc29yX3R5cGUgPSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOworICAgICAgbWNf aGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIG9wb2ludF9meCwgeSwg ZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vy c29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBlc3Nl bnRpYWxzLmFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAg ICAgICAgICAgICAgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgYnJlYWs7CisgICAg fQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAg IEZJTExfQ09MVU1OOiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgRklMTF9DT0xVTU46CisgICAgeworICAg ICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVY VF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCBy b3csIGdseXBoLCByZWxhdGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAg ICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBi YWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBnbHlwaF9m bGF2b3IsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSwg YWN0aW9uX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t ICovCisgICAgY2FzZSBDVVJTT1JfSU5ESUNBVE9SOgorICAgIHs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yBjaGVjayBpbiBgdXBkYXRlX3dpbmRvdycuICovCisgIGlmICghQlVG RkVSUCAody0+Y29udGVudHMpKQorICAgIHJldHVybjsKKyAgaWYgKE5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgcmV0dXJuOworICBpZiAodnBvcyA9 PSBib3R0b21fdnBvcykKKyAgICByZXR1cm47CisgIGlmICghcm93LT51c2VkW1RFWFRfQVJFQV0p CisgICAgcmV0dXJuOworICBpbnQgaHBvc19zdGFydCA9IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVY VF9BUkVBXTsKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAgIGZwcmludGYgKHN0ZGVyciwg Im1jX2RyYXdfcm93ICglZCk6ICBkcmF3X3AgKCVzKSB8IGhwb3MgKCVkKSB8IGxlbiAoJWQpXG4i LAorICAgICAgICAgICAgICAgICAgICAgdnBvcywgZHJhd19wID8gInkiIDogIm4iLCBocG9zX3N0 YXJ0LCBocG9zX2xlbmd0aCk7CisgIExpc3BfT2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRzOworICBD SEVDS19CVUZGRVIgKGJ1Zik7CisgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChidWYpOwor ICBpbnQgb3BvaW50X2Z4LCBvcG9pbnRfZnksIG9wb2ludF93ZCwgb3BvaW50X2g7CisgIGludCB0 ZXh0X2FyZWFfd2lkdGggPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICBpbnQg aGVhZGVyX2xpbmVfZm9ybWF0ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgIHN0 cnVjdCBnbHlwaF9yb3cgKmN1cnNvcl9yb3cgPSAody0+Y3Vyc29yLnZwb3MgIT0gLTEpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1cgKGN1cnNvcl9tYXRyaXgs IHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxM OworICBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcs IGN1cnNvcl9tYXRyaXgsIGN1cnNvcl9yb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3Mp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICBib29sIGN1cnNvcl9h dF9mcmluZ2VfcCA9IChjdXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0 aF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0g dGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNv ci54ID09IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRoKTsKKyAgYm9vbCBjdXJzb3JfYmV5b25kX2Zy aW5nZV9wID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWN1cnNvcl9yb3ctPmV4YWN0X3dp bmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct PmN1cnNvci54ID49IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgIFJFUExBQ0UgVEhF IFJFQUwgQ1VSU09SCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgZW51bSBmYWNlX2lkIGJn X2ZhY2VfaWQgPSAoY3Vyc29yX2dseXBoICE9IE5VTEwpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBjdXJzb3JfZ2x5cGgtPmZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgc3RydWN0IG1jX1JHQiBjdXJzb3JfYmc7CisgIG1jX3Nl dF9sc2xfYmcgKHcsIGJnX2ZhY2VfaWQsICZjdXJzb3JfYmcpOworICAvKiBGSVhNRTogIFB1dCBp biBzb21lIGNvZGUgdG8gZGVmYXVsdCB0byBNQ19IT0xMT1dfQk9YIGlmIHRoZSB1c2VyIGhhcwor ICB1bndpdHRpbmdseSBjb21lIHVwIHdpdGggc29tZSB1bmFjY2VwdGFibGUgZm9ybSBvZiB1bnJl Y29nbml6ZWQgY3Vyc29yIHR5cGUuICovCisgIExpc3BfT2JqZWN0IGxpc3BfdHlwZSA9IEJWQVIg KGIsIG1jX3JlYWxfZmFrZV9jdXJzb3IpOworICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90 eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAobGlzcF90eXBlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1jX2xpc3BfdG9fY3Vyc29y X3R5cGUgKGxpc3BfdHlwZSk7CisgIGludCBjdXJzb3Jfd2lkdGggPSAoQ09OU1AgKGxpc3BfdHlw ZSkpCisgICAgICAgICAgICAgICAgICAgICA/IFhGSVhOVU0gKFhDQVIgKFhDRFIgKGxpc3BfdHlw ZSkpKQorICAgICAgICAgICAgICAgICAgICAgOiAtMTsKKyAgc3RydWN0IG1jX1JHQiBjdXJzb3Jf Zmc7CisgIG1jX2NvbG9yX3BpY2tlciAodywgY3Vyc29yX2dseXBoLCBlc3NlbnRpYWxzLCAmY3Vy c29yX2ZnLCAtMSwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0 aW9uLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgYm9vbCBmaWxsX2NvbHVtbl90cnVtcHNfcCA9ICgh TklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2li bGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IGVz c2VudGlhbHMuZmNfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFjdXJzb3Jf YXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhY3Vyc29yX2Jl eW9uZF9mcmluZ2VfcCk7CisgIC8qIFdlIHVzZSBhIHRlc3Qgc2ltaWxhciB0byB0aGUgcmVhbCBm YWtlIGN1cnNvciBzbyB0aGF0IHRoZSBmcmluZ2UgYml0bWFwIGlzCisgIG9ubHkgZHJhd24gb25j ZSBwZXIgd2luZG93LiAqLworICBpZiAodnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgJiYg aHBvc19zdGFydCArIGhwb3NfbGVuZ3RoID09IHJvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAm JiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAg ICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2hvcml6b250YWxfcnVs ZXIpKSkKKyAgICB7CisgICAgICAvKiBmcmluZ2UgYml0bWFwcyB1c2UgZmFjZV9pZCB0byBzZXQg dGhlIGZvcmVncm91bmQgY29sb3IuICBUaGUgb3ZlcmxheS1hcnJvdworICAgICAgaXMgcHJlc2Vu dGx5IHRoZSBvbmx5IHNpdHVhdGlvbiB3aGVyZSB0aGUgYGVzc2VudGlhbHMuYWN0aXZlX3BgIGFu ZCBgbWluaW1hbF9wYCBhcmUKKyAgICAgIHVzZWQgdG8gZGV0ZXJtaW5lIHRoZSBhcHBsaWNhYmxl IGZhY2VfaWQuICovCisgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZyA9IHsucmVkID0gLTEuMCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IC0xLjAsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IC0xL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50cyksIGNoX2hvcml6b250 YWxfcnVsZXIpKSkKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBN Q19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XOworICAgICAgc3RydWN0IGds eXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICBzdHJ1Y3QgZ2x5cGgg KmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51c2VkW1RFWFRfQVJFQV07CisgICAgICAvKiBHbHlw aCBmb3IgYSBsaW5lIGVuZCBpbiB0ZXh0LiAqLworICAgICAgaWYgKGdseXBoID09IGdseXBoX2Vu ZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDApCisgICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgbWNf aGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGhfZW5kIC0gMSwgcm93LT5waXhlbF93aWR0aCwg LTEsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICAtMSwgcm93LT51c2VkW1RFWFRfQVJF QV0gLSAxLCB3LT5jdXJzb3IudnBvcywgLTEsIC0xLAorICAgICAgICAgICAgICAgICBNQ19SSUdI VF9GUklOR0VfQklUTUFQLCAtMSwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0 aXZlX3AsCisgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJl LCBDSF9DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQorICAvKiBFWEFNUExFIChidWZm ZXItbG9jYWwpOiAgKHNldHEgbWMtcmVhbC1mYWtlLWN1cnNvciBuaWwvJ25vLyJubyIpICovCisg IGVsc2UgaWYgKCFjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgJiYgY3Vyc29yX2dseXBo ICE9IE5VTEwKKyAgICAgICAgICAgJiYgY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LCAxLCBj dXJzb3JfZmcsIGN1cnNvcl9iZywgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEhMRVNTLAor ICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIE5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog TUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOworICAgICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRy eSAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRfZnksIHctPmN1cnNvci5ocG9z LCB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgTUNfSEJBUiwgMSwgJm9wb2ludF93ZCk7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwg cm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54LCBvcG9pbnRfZngsIHctPmN1cnNvci55LAor ICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBv cywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAgTUNfSEJBUiwgMSwgY3Vy c29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3As CisgICAgICAgICAgICAgICAgIGZyb21fd2hlcmUsIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FD SEUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElD QVRPUik7CisgICAgfQorICBlbHNlIGlmICghY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAg ICYmIGN1cnNvcl9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29y LnZwb3MKKyAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPj0gaHBvc19zdGFydAorICAgICAg ICAgICAmJiB3LT5jdXJzb3IuaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAg ICAgICAmJiBjdXJzb3JfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAg ICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZv cG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9w b2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAmb3Bv aW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwg dy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIG9w b2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2lu dF9oLAorICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBjdXJzb3Jf ZmcsIGN1cnNvcl9iZywgZXNzZW50aWFscy5hY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgTUNf R0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgICB9CisgIGVsc2UgaWYg KCFjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoICE9IE5VTEwK KyAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAmJiB3LT5j dXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zIDwg aHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+dHlw ZSA9PSBTVFJFVENIX0dMWVBIKQorICAgIHsKKyAgICAgIC8qIElmIGEgdXNlciBoYXMgc2V0IGB4 LXN0cmV0Y2gtY3Vyc29yJyB0byBhIG5vbi1uaWwgdmFsdWUsIGhlL3NoZSBjaG9zZSB0bworICAg ICAgaGF2ZSBhIGN1cnNvciB0aGF0IHNwYW5zIHRoZSBlbnRpcmUgbGVuZ3RoIG9mIHRoZSBTVFJF VENIX0dMWVBILiAqLworICAgICAgaWYgKCF4X3N0cmV0Y2hfY3Vyc29yX3ApCisgICAgICAgIHsK KyAgICAgICAgICAvKiBUaGUgTUNfSEJBUiBzaGFsbCBoYXZlIGEgYGN1cnNvcl93aWR0aGAgb2Yg MS4gKi8KKyAgICAgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywg dy0+Y3Vyc29yLngsICZvcG9pbnRfZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgdy0+Y3Vyc29yLnksICZvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsIE1DX0hCQVIs IDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF93ZCk7CisgICAg ICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3Iu eCwgb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnksIG9wb2ludF9m eSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLAorICAgICAgICAgICAgICAgICAgICAg b3BvaW50X3dkLCBvcG9pbnRfaCwgTUNfSEJBUiwgMSwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsCisg ICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19w LCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICAgICAgTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUK KyAgICAgICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOworICAg ICAgICB9CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+ Y3Vyc29yLngsICZvcG9pbnRfZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5j dXJzb3IueSwgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLCBjdXJzb3JfdHlwZSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgJm9wb2ludF93ZCk7CisgICAg ICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54LCBv cG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHctPmN1 cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAgICAg ICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcs IGVzc2VudGlhbHMuYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgIE1DX0dMWVBILCBkcmF3X3As IGZyb21fd2hlcmUsIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FD SEUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19D QUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQorLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq CisgICAgICAgICAgICAgICAgICAgICAgICAgIERSQVcgQU5EIFJFQ09SRCBGQUtFIENVUlNPUlMK KyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworICBpZiAoaHBvc19sZW5ndGggPT0gMSkKKyAgICB7 CisgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikp KQorICAgICAgICB7CisgICAgICAgICAgLyogVGhlIHNwYWNlIGFwcGVuZGVkIHRvIGEgcm93IGVu ZGluZyB3aXRoIGEgbmV3IGxpbmUKKyAgICAgICAgICBkb2VzIG5vdCBoYXZlIGEgYGdseXBoLT5j aGFycG9zYCAoLTEsIDApIHRoYXQgd2UgY2FuCisgICAgICAgICAgdXNlIGZvciB0aGlzIHBhcnRp Y3VsYXIgYXBwbGljYXRpb24uICBXaGVuIHRoZXJlIGlzIGEKKyAgICAgICAgICBgYnVmZmVyLWRp c3BsYXktdGFibGUnIGVudHJ5IHRoYXQgYXNzaWducyBhIHZpc2libGUKKyAgICAgICAgICBnbHlw aCB0byBhIG5ldyBsaW5lLCB0aGVyZSBpcyBubyBwcm9ibGVtIGJlY2F1c2UgdGhhdAorICAgICAg ICAgIGdseXBoIGhhcyBhIGBnbHlwaC0+Y2hhcnBvcycgdGhhdCB3ZSBjYW4gdXNlLiAgV2hlbgor ICAgICAgICAgIG5vIHZpc2libGUgRU9MIGdseXBoIGV4aXN0cywgd2UgdXNlIHRoZSBmb2xsb3dp bmcKKyAgICAgICAgICB0ZXN0OiAgdGhlIGFwcGVuZGVkIHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRo YXQgaXMgb25lCisgICAgICAgICAgbGVzcyB0aGFuIHRoZSBlbmQgb2YgdGhlIG1hdHJpeCByb3cu ICovCisgICAgICAgICAgaW50IGhwb3MgPSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07 CisgICAgICAgICAgc3RydWN0IGdseXBoICpwcmV2aW91c19nbHlwaCA9ICgwIDw9IGhwb3MgLSAx ICYmIGhwb3MgLSAxIDwgcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3MgLSAx CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgICAg ICAgICAvLyBzdHJ1Y3QgZ2x5cGggKmxhc3RfZ2x5cGggPSByb3ctPmdseXBoc1tURVhUX0FSRUFd ICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgICAgIGJvb2wgc2tpcF9wID0gKHBy ZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91 c19nbHlwaC0+Y2hhcnBvcyA9PSBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpIC0gMQorICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHN0YXJ0LT5ieXRlcG9zICE9IGVzc2VudGlhbHMuenZf Ynl0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAg ICAgICAgICAvKiBXaGVuIGEgYGJ1ZmZlci1kaXNwbGF5LXRhYmxlJyBlbnRyeSBjb250YWlucwor ICAgICAgICAgICAgICAgICAgICAgICAgYSB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIgKCLCuyIpLCB0 aGUgc3Vic2VxdWVudAorICAgICAgICAgICAgICAgICAgICAgICAgU1RSRVRDSF9HTFlQSCB3aWxs IGhhdmUgdGhlIHNhbWUgc3RhcnQtPmNoYXJwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgIGFz IHRoZSBhZm9yZW1lbnRpb25lZCB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIuICovCisgICAgICAgICAg ICAgICAgICAgICAgICA6IChwcmV2aW91c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9PSBzdGFydC0+Y2hhcnBvcykK KyAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAg ICA6IGZhbHNlOworICAgICAgICAgIGludCBwb3NpbnQgPSAocm93X3Bvc2l0aW9uID09IFBPU1Rf WlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgPyAtMQorICAgICAgICAgICAgICAgICAgICAg ICA6IChyb3dfcG9zaXRpb24gPT0gQVRfWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgID8g ZXNzZW50aWFscy56dgorICAgICAgICAgICAgICAgICAgICAgICA6IChzdGFydC0+Ynl0ZXBvcyAh PSBlc3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgc3RhcnQg LSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgLSAx CisgICAgICAgICAgICAgICAgICAgICAgIDogKHN0YXJ0LT5ieXRlcG9zID09IGVzc2VudGlhbHMu enZfYnl0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzdGFydCAtIHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQorICAgICAgICAgICAgICAg ICAgICAgICAgID8gZXNzZW50aWFscy56dgorICAgICAgICAgICAgICAgICAgICAgICA6IHN0YXJ0 LT5jaGFycG9zOworICAgICAgICAgIExpc3BfT2JqZWN0IHNwZWNzID0gbWNfYXNzb2MgKG1ha2Vf Zml4bnVtIChwb3NpbnQpLCBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKTsK KyAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAg ICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICYm ICFOSUxQIChzcGVjcykKKyAgICAgICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2Jv dHRvbV95ICh3KQorICAgICAgICAgICAgICAmJiAhc2tpcF9wCisgICAgICAgICAgICAgICYmIHJv d19wb3NpdGlvbiAhPSBQT1NUX1pWKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBMaXNw X09iamVjdCBsaXNwX3R5cGUgPSBtY19udGggKDEsIHNwZWNzKTsKKyAgICAgICAgICAgICAgZW51 bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfbGlzcF90b19j dXJzb3JfdHlwZSAoWENBUiAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogbWNfbGlzcF90b19jdXJzb3JfdHlwZSAobGlzcF90eXBl KTsKKyAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSAoc3RhcnQtPnR5cGUgPT0gSU1BR0VfR0xZ UEgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiBjdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgaW50IGN1 cnNvcl93aWR0aCA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gWEZJWE5VTSAoWENBUiAoWENEUiAobGlzcF90eXBlKSkpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IC0xOworICAgICAgICAgICAgICBMaXNwX09iamVjdCBt Y19mb3JlZ3JvdW5kID0gbWNfbnRoICgyLCBzcGVjcyk7CisgICAgICAgICAgICAgIHN0cnVjdCBt Y19SR0IgbHNsX2ZnOworICAgICAgICAgICAgICBpZiAoU1RSSU5HUCAobWNfZm9yZWdyb3VuZCkp CisgICAgICAgICAgICAgICAgbWNfeHdfY29sb3JfdmFsdWVzICh3LCBtY19mb3JlZ3JvdW5kLCAm bHNsX2ZnKTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChWRUNUT1JQIChtY19mb3JlZ3JvdW5k KSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLnJlZCA9 IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAwKSk7CisgICAgICAgICAgICAgICAg ICAgIGxzbF9mZy5ncmVlbiA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAxKSk7 CisgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5ibHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1j X2ZvcmVncm91bmQsIDIpKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAg IGVsc2UgaWYgKE5JTFAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICBtY19j b2xvcl9waWNrZXIgKHcsIHN0YXJ0LCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCBwb3NpbnQsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIHJvd19wb3Np dGlvbiwgTVVMVElQTEVfQ1VSU09SUyk7CisgICAgICAgICAgICAgIGludCB2cG9zID0gTUFUUklY X1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2lu ZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgbWNfZW5naW5lICh3 LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwgcm93LT55LAorICAg ICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwgdnBv cywgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCBj dXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAg ICAgICAgICAgbHNsX2ZnLCBNVUxUSVBMRV9DVVJTT1JTLCBkcmF3X3AsIGZyb21fd2hlcmUsIE1D X0NBQ0hFKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKCFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgICAgICYmIGVzc2Vu dGlhbHMuZmNfeCA8PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZj X3ggPj0gdy0+bWMubG51bV9waXhlbF93aWR0aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB4 X2xpbWl0ID0geCArIHN0YXJ0LT5waXhlbF93aWR0aDsKKyAgICAgICAgICBib29sIHJlYWxfZmFr ZV9jdXJzb3JfcCA9ICh3LT5jdXJzb3IueCA9PSBlc3NlbnRpYWxzLmZjX3gKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueSA9PSByb3ctPnkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBzdGFy dCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsKKyAgICAgICAgICBzdHJ1Y3QgbWNf UkdCIGxzbF9mZzsKKyAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIHN0YXJ0LCBlc3NlbnRp YWxzLCAmbHNsX2ZnLCAtMSwgTUNfQkFSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg cm93X3Bvc2l0aW9uLCBGSUxMX0NPTFVNTik7CisgICAgICAgICAgaWYgKHggKyBzdGFydC0+cGl4 ZWxfd2lkdGggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICYmICgoaGVhZGVyX2xp bmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9s aW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAmJiAoKHN0YXJ0ICE9IHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEKKyAgICAgICAgICAgICAgICAg ICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0geAorICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlh bHMuZmNfeCA8IHggKyBzdGFydC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB8fCAo c3RhcnQgPT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0g MQorICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB4KSkKKyAgICAg ICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAg ICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgbWNfZW5naW5lICh3LCBt YXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwgcm93LT55LAorICAgICAg ICAgICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3MsIE1D X0JBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFs cywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsCisgICAgICAgICAgICAgICAgICAgICAgIEZJTExfQ09M VU1OLCBkcmF3X3AsIGZyb21fd2hlcmUsIEZDX0NBQ0hFKTsKKyAgICAgICAgfQorICAgICAgaWYg KCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAg ICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9ob3Jpem9udGFsX3J1bGVyKSkKKyAgICAgICAgICAm JiB2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICB7CisgICAgICAgICAgaW50IHhfbGlt aXQgPSAoc3RhcnQgPT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FS RUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgID8gdGV4dF9hcmVhX3dpZHRoCisgICAg ICAgICAgICAgICAgICAgICAgICA6IHggKyBzdGFydC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAg c3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBzdGFy dCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIE1DX0hCQVIsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICByb3dfcG9zaXRpb24sIEhPUklaT05UQUxfUlVMRVIpOworICAgICAgICAgIC8q IFByZXNlcnZlIHN1cHBvcnQgZm9yIGRlZmF1bHQgYmVoYXZpb3Igc3VjaCB0aGF0IGEgdXNlciBt YXkKKyAgICAgICAgICBzcGVjaWZ5IHRoZSBoZWlnaHQgb2YgYW4gTUNfSEJBUiwgd2hpY2ggYmVn aW5zIGl0cyBqb3VybmV5CisgICAgICAgICAgYXMgdGhlIGBjdXJzb3Jfd2lkdGgnLiAgYG1jX2dl dF9jdXJzb3JfZ2VvbWV0cnknIHJlYWRqdXN0cy4gKi8KKyAgICAgICAgICBtY19lbmdpbmUgKHcs IG1hdHJpeCwgcm93LCBzdGFydCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ctPnksCisgICAg ICAgICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3MsIE1D X0hCQVIsIDEsCisgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxz LCByb3dfcG9zaXRpb24sIGxzbF9mZywKKyAgICAgICAgICAgICAgICAgICAgIEhPUklaT05UQUxf UlVMRVIsIGRyYXdfcCwgZnJvbV93aGVyZSwgQ0hfQ0FDSEUpOworICAgICAgICB9CisgICAgICBp ZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAm JiAhZmlsbF9jb2x1bW5fdHJ1bXBzX3ApCisgICAgICAgIHsKKyAgICAgICAgICBjdXJzb3JfdHlw ZSA9IChzdGFydC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAg ID8gTUNfSE9MTE9XX0JPWAorICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19CQVI7CisgICAg ICAgICAgaW50IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAg ICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci55ID09IHJvdy0+eQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09 IHZwb3MpOworICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgIG1jX2Nv bG9yX3BpY2tlciAodywgc3RhcnQsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBjdXJzb3JfdHlw ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgVkVSVElDQUxf UlVMRVIpOworICAgICAgICAgIGlmICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+ IDApCisgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAg ICAgICAgJiYgKChzdGFydCAhPSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RF WFRfQVJFQV0gLSAxCisgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0geAorICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54IDwgeCArIHN0YXJ0LT5waXhlbF93aWR0aCkK KyAgICAgICAgICAgICAgICAgIHx8IChzdGFydCA9PSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsg cm93LT51c2VkW1RFWFRfQVJFQV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnggPj0geCkpCisgICAgICAgICAgICAgICYmIHJvdy0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0 b21feSAodykKKyAgICAgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAg ICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGlt aXQsIHJvdy0+eSwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdLCB2cG9zLCBjdXJzb3JfdHlwZSwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAg Y3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsCisgICAgICAg ICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSLCBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NB Q0hFKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgICB7CisgICAgICAgIGludCBy ZWxhdGl2ZV94ID0gMDsKKyAgICAgICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7 IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1 Y3QgZ2x5cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV07CisgICAgICAgICAgICBzdHJ1Y3Qg Z2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51c2VkW2FyZWFdOworICAgICAgICAgICAg LyogR2x5cGggZm9yIGEgbGluZSBlbmQgaW4gdGV4dC4gKi8KKyAgICAgICAgICAgIGlmIChhcmVh ID09IFRFWFRfQVJFQSAmJiBnbHlwaCA9PSBnbHlwaF9lbmQgJiYgZ2x5cGgtPmNoYXJwb3MgPiAw KQorICAgICAgICAgICAgICArK2dseXBoX2VuZDsKKyAgICAgICAgICAgIGZvciAoOyBnbHlwaCA8 IGdseXBoX2VuZDsgKytnbHlwaCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlm ICh2cG9zICE9IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAgICAgICYmIGdseXBoICE9 IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194IDwg cmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHJlbGF0aXZl X3gKKyAgICAgICAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBtY19jb25mKSkpCisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAg ICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBUaGUgc3BhY2UgYXBwZW5k ZWQgdG8gYSByb3cgZW5kaW5nIHdpdGggYSBuZXcgbGluZSBkb2VzCisgICAgICAgICAgICAgICAg ICAgIG5vdCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDApIHRoYXQgd2UgY2FuIHVzZSBm b3IgdGhpcworICAgICAgICAgICAgICAgICAgICBwYXJ0aWN1bGFyIGFwcGxpY2F0aW9uLiAgV2hl biBhIGBidWZmZXItZGlzcGxheS10YWJsZScgZW50cnkKKyAgICAgICAgICAgICAgICAgICAgYXNz aWducyBhIHZpc2libGUgZ2x5cGggdG8gYSBuZXcgbGluZSwgdGhlcmUgaXMgbm8gcHJvYmxlbQor ICAgICAgICAgICAgICAgICAgICBiZWNhdXNlIHRoYXQgZ2x5cGggaGFzIGEgYGdseXBoLT5jaGFy cG9zJyB0aGF0IHdlIGNhbiB1c2UuCisgICAgICAgICAgICAgICAgICAgIFdoZW4gbm8gdmlzaWJs ZSBFT0wgZ2x5cGggZXhpc3RzLCB3ZSB1c2UgdGhlIGZvbGxvd2luZyB0ZXN0OgorICAgICAgICAg ICAgICAgICAgICB0aGUgYXBwZW5kZWQgc3BhY2UgaGFzIGEgcG9zaXRpb24gdGhhdCBpcyBvbmUg bGVzcyB0aGFuIHRoZQorICAgICAgICAgICAgICAgICAgICBlbmQgb2YgdGhlIG1hdHJpeCByb3cu ICovCisgICAgICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnByZXZpb3VzX2ds eXBoID0gKDAgPD0gaHBvcyAtIDEgJiYgaHBvcyAtIDEgPCByb3ctPnVzZWRbVEVYVF9BUkVBXSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgICAgICAgICAgICAgICAgICAgIC8v IHN0cnVjdCBnbHlwaCAqbGFzdF9nbHlwaCA9IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ct PnVzZWRbVEVYVF9BUkVBXSAtIDE7CisgICAgICAgICAgICAgICAgICAgIGJvb2wgc2tpcF9wID0g KHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgcHJldmlvdXNfZ2x5cGgtPmNoYXJwb3MgPT0gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAo cm93KSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPmJ5 dGVwb3MgIT0gZXNzZW50aWFscy56dl9ieXRlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogV2hl biBhIGBidWZmZXItZGlzcGxheS10YWJsZScgZW50cnkgY29udGFpbnMKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBhIHZpc2libGUgdGFiIGNoYXJhY3RlciAoIsK7IiksIHRoZSBz dWJzZXF1ZW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU1RSRVRDSF9HTFlQ SCB3aWxsIGhhdmUgdGhlIHNhbWUgZ2x5cGgtPmNoYXJwb3MKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBhcyB0aGUgYWZvcmVtZW50aW9uZWQgdmlzaWJsZSB0YWIgY2hhcmFjdGVy LiAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHByZXZpb3VzX2dseXBo ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91 c19nbHlwaC0+Y2hhcnBvcyA9PSBnbHlwaC0+Y2hhcnBvcykKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIGludCBwb3NpbnQgPSAocm93X3Bvc2l0aW9u ID09IFBPU1RfWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gLTEKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHJvd19wb3NpdGlvbiA9PSBBVF9aVikK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNzZW50aWFscy56dgorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGgtPmJ5dGVwb3MgIT0gZXNzZW50 aWFscy56dl9ieXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlw aCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1dfRU5EX0NIQVJQ T1MgKHJvdykgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaC0+ Ynl0ZXBvcyA9PSBlc3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRb VEVYVF9BUkVBXSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNz ZW50aWFscy56dgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBnbHlwaC0+Y2hh cnBvczsKKyAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3Qgc3BlY3MgPSBtY19hc3NvYyAo bWFrZV9maXhudW0gKHBvc2ludCksIEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29u ZikpOworICAgICAgICAgICAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYm IHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1h dCA9PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKHNwZWNzKQorICAgICAg ICAgICAgICAgICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQor ICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXNraXBfcAorICAgICAgICAgICAgICAgICAgICAg ICAgJiYgcm93X3Bvc2l0aW9uICE9IFBPU1RfWlYpCisgICAgICAgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QgbGlzcF90eXBlID0gbWNfbnRoICgx LCBzcGVjcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1 cnNvcl90eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfbGlzcF90b19jdXJzb3JfdHlw ZSAoWENBUiAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGxpc3BfdHlw ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IChnbHlwaC0+dHlwZSA9 PSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBN Q19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogY3Vy c29yX3R5cGU7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoID0gKENP TlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gWEZJWE5VTSAoWENBUiAoWENEUiAobGlzcF90eXBlKSkpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAtMTsKKyAgICAgICAgICAgICAgICAgICAgICAg IExpc3BfT2JqZWN0IG1jX2ZvcmVncm91bmQgPSBtY19udGggKDIsIHNwZWNzKTsKKyAgICAgICAg ICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgICAgICAgICAg ICAgICAgaWYgKFNUUklOR1AgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICBtY194d19jb2xvcl92YWx1ZXMgKHcsIG1jX2ZvcmVncm91bmQsICZsc2xfZmcpOworICAg ICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChWRUNUT1JQIChtY19mb3JlZ3JvdW5kKSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBsc2xfZmcucmVkID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDApKTsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5ncmVlbiA9IFhGTE9BVF9EQVRB IChBUkVGIChtY19mb3JlZ3JvdW5kLCAxKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBsc2xfZmcuYmx1ZSA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAyKSk7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAg IGVsc2UgaWYgKE5JTFAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBnbHlwaCwgZXNzZW50aWFscywgJmxzbF9mZywKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaW50LCBj dXJzb3JfdHlwZSwgcm93X3Bvc2l0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTKTsKKyAgICAgICAgICAgICAgICAg ICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAgICAg ICAgICAgICAgICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRf QVJFQSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93 LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgeF9saW1pdCwgcm93LT55LCBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIGN1cnNvcl90eXBlLCBjdXJz b3Jfd2lkdGgsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgbHNsX2ZnLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTLCBkcmF3X3AsIGZyb21fd2hlcmUsIE1D X0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZj X3Zpc2libGUpKQorICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPD0gdGV4 dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB3 LT5tYy5sbnVtX3BpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7Cisg ICAgICAgICAgICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci54 ID09IGVzc2VudGlhbHMuZmNfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5jdXJzb3IueSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgICAgICAg ICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAg ICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAgIG1j X2NvbG9yX3BpY2tlciAodywgZ2x5cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19CQVIs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBG SUxMX0NPTFVNTik7CisgICAgICAgICAgICAgICAgICAgIGlmIChocG9zID49IGhwb3Nfc3RhcnQK KyAgICAgICAgICAgICAgICAgICAgICAgICYmIGhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5n dGgKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxf d2lkdGggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGhl YWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICAgICAgICAg ICAmJiAoKGdseXBoICE9IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgZXNzZW50aWFscy5mY194ID49IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgZXNzZW50aWFscy5mY194IDwgcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93 aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoZ2x5cGggPT0gZ2x5cGhfZW5k IC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3gg Pj0gcmVsYXRpdmVfeCkpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnkgPD0gd2lu ZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcmVhbF9m YWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4 LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBNQ19CQVIsIDEsIGN1cnNvcl9t YXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLCByb3df cG9zaXRpb24sIGxzbF9mZywgRklMTF9DT0xVTU4sCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIEZDX0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBj aF9ob3Jpem9udGFsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5j dXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaW50 IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAgICAgICAgICAg ICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAg ICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAg IG1jX2NvbG9yX3BpY2tlciAodywgZ2x5cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19I QkFSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlv biwgSE9SSVpPTlRBTF9SVUxFUik7CisgICAgICAgICAgICAgICAgICAgIC8qIFByZXNlcnZlIHN1 cHBvcnQgZm9yIGRlZmF1bHQgYmVoYXZpb3Igc3VjaCB0aGF0IGEgdXNlciBtYXkKKyAgICAgICAg ICAgICAgICAgICAgc3BlY2lmeSB0aGUgaGVpZ2h0IG9mIGFuIE1DX0hCQVIsIHdoaWNoIGJlZ2lu cyBpdHMgam91cm5leQorICAgICAgICAgICAgICAgICAgICBhcyB0aGUgYGN1cnNvcl93aWR0aCcu ICBgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeScgcmVhZGp1c3RzLiAqLworICAgICAgICAgICAgICAg ICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBo cG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoKQorICAgICAgICAgICAgICAgICAgICAgIG1j X2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBN Q19IQkFSLCAxLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsIEhPUklaT05UQUxfUlVMRVIsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NB Q0hFKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAg ICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAg ICAgICAgICYmICFmaWxsX2NvbHVtbl90cnVtcHNfcCkKKyAgICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZ UEgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19CQVI7CisgICAgICAgICAgICAg ICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAg ICAgICAgICAgICAgICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnkg PT0gcm93LT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgICAgICAgICAgICBpbnQgaHBv cyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAg c3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAgIG1jX2NvbG9yX3BpY2tl ciAodywgZ2x5cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBjdXJzb3JfdHlwZSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRpb24sIFZFUlRJQ0FM X1JVTEVSKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGhwb3MgPj0gaHBvc19zdGFydAorICAg ICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAor ICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZw b3MgPiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1h dCA9PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChnbHlwaCAhPSBnbHlwaF9lbmQg LSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHJlbGF0 aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPCByZWxh dGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg IHx8IChnbHlwaCA9PSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPmN1cnNvci54ID49IHJlbGF0aXZlX3gpKQorICAgICAgICAgICAgICAgICAgICAg ICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAg ICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgICAgICAgICAgICBt Y19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwgeF9saW1p dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdy0+eSwgaHBvcywgdnBvcywg Y3Vyc29yX3R5cGUsIDEsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywgVkVSVElDQUxfUlVMRVIs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIENI X0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZWxhdGl2ZV94 ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAg ICAgIH0KKyAgLy8gIGNsb2NrX3QgY2xvY2tfZW5kID0gY2xvY2soKTsKKyAgLy8gIGRvdWJsZSBj cHVfdGltZV91c2VkID0gKChkb3VibGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xP Q0tTX1BFUl9TRUM7CisgIC8vICBmcHJpbnRmIChzdGRlcnIsICJtY19kcmF3X3JvdyAoJXMpOiAg VElNRSAoJWYpXG4iLCBtY193aW5kb3cgKHcpLCBjcHVfdGltZV91c2VkKTsKK30KKworYm9vbAor bWNfcmVkcmF3X3JvdyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0 cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICBlbnVtIGdseXBoX3Jv d19hcmVhIGFyZWEsIGludCBzdGFydF94LCBpbnQgc3RhcnRfaHBvcywgaW50IGVuZF9ocG9zLAor ICAgICAgICAgICAgICAgYm9vbCBjbGVhcl9lb2xfcCwgZW51bSBkcmF3X2dseXBoc19mYWNlIGhs LAorICAgICAgICAgICAgICAgZW51bSBtY19yZWRyYXdfcm93X3R5cGUgZnJvbV93aGVyZSkKK3sK KyAgYm9vbCBnb19wID0gKCh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA+IDAK KyAgICAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NBQ0hFXSA+ IDAKKyAgICAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NBQ0hF XSA+IDApCisgICAgICAgICAgICAgICAmJiBhcmVhID09IFRFWFRfQVJFQQorICAgICAgICAgICAg ICAgJiYgcm93LT51c2VkW2FyZWFdKTsKKyAgaWYgKCFnb19wKQorICAgIHJldHVybiBmYWxzZTsK KyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgaW50IHZw b3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgVFJBQ0UgKChzdGRlcnIsICJt Y19yZWRyYXdfcm93ICglZCk6ICAlc1xuXAorICBzdGFydF94ICglZCkgfCBzdGFydF9ocG9zICgl ZCkgfCBlbmRfaHBvcyAoJWQpXG4iLAorICB2cG9zLCBtY19yZWRyYXdfcm93X3R5cGVfdG9fc3Ry aW5nIChmcm9tX3doZXJlKSwgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MpKTsKKyAgc3Ry dWN0IGdseXBoX3JvdyAqYm90dG9tX3JvdyA9IE1BVFJJWF9CT1RUT01fVEVYVF9ST1cgKG1hdHJp eCwgdyk7CisgIGludCBib3R0b21fdnB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3R5cGUpCisgICAgeworICAgICAgZm9yIChpbnQgbnRoID0gMDsKKyAg ICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVfcCAody0+bWNfbWF0cml4LCBjYWNoZV90eXBlLCB2 bnRoLCBudGgpOworICAgICAgICAgICArK250aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB4 ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS54OworICAg ICAgICAgIGludCBmeCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0uZng7CisgICAgICAgICAgaW50IHkgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLnk7CisgICAgICAgICAgaW50IGZ5ID0gdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5meTsKKyAgICAgICAgICBpbnQgaHBvcyA9 IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uaHBvczsKKyAg ICAgICAgICBpbnQgdnBvcyA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF0udnBvczsKKyAgICAgICAgICBpbnQgd2QgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLndkOworICAgICAgICAgIGludCBoID0gdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5oOworICAgICAgICAgIGVudW0g bWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl90eXBlOworICAgICAgICAgIGludCBjdXJzb3Jfd2lk dGggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNv cl93aWR0aDsKKyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZyA9IHsucmVkID0gdy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mZy5yZWQsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAuYmx1ZSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF0uZmcuYmx1ZX07CisgICAgICAgICAgLy8gIHN0cnVjdCBtY19SR0IgbHNsX2Jn ID0gey5yZWQgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmJnLnJlZCwKKyAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ncmVlbiwK KyAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLmJsdWV9OworICAgICAgICAg IGJvb2wgYWN0aXZlX3AgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmFjdGl2ZV9wOworICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9 IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGhfZmxh dm9yOworICAgICAgICAgIGJvb2wgZW5hYmxlZF9wID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3A7CisgICAgICAgICAgaWYgKHZwb3MgPT0g dm50aAorICAgICAgICAgICAgICAmJiAoKGhwb3MgPj0gc3RhcnRfaHBvcworICAgICAgICAgICAg ICAgICAgICYmIGhwb3MgPCBlbmRfaHBvcykKKyAgICAgICAgICAgICAgICAgIC8qIEEgZmxvYXRp bmcgY3Vyc29yIGJleW9uZCB0aGUgZW5kIG9mIHRoZSBnbHlwaCByb3cuICovCisgICAgICAgICAg ICAgICAgICB8fCAoaHBvcyArIDEgPT0gc3RhcnRfaHBvcworICAgICAgICAgICAgICAgICAgICAg ICYmIGhwb3MgKyAxID09IGVuZF9ocG9zKSkKKyAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBib29sIHJlbW92ZV9wID0gZmFsc2U7CisgICAg ICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHks IGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGxzbF9mZywgYWN0aXZlX3AsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAg ICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgcmV0dXJuIHRydWU7CisgIC8vICBjbG9j a19lbmQgPSBjbG9jaygpOworICAvLyAgZG91YmxlIHRpbWVfY3Vyc29ycyA9ICgoZG91YmxlKSAo Y2xvY2tfZW5kIC0gY2xvY2tfc3RhcnQpKSAvIENMT0NLU19QRVJfU0VDOworICAvLyAgZn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YXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZnLnJlZCwKKyAgICAgICAgICAvLyAgICAgICAg ICAgICAgICAgICAgICAgICAgLmdyZWVuID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXS5mZy5ncmVlbiwKKyAgICAgICAgICAvLyAgICAgICAgICAgICAgICAg ICAgICAgICAgLmJsdWUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmZnLmJsdWV9OworICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2JnID0gey5yZWQg PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLnJlZCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLmdyZWVuLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ibHVlfTsKKyAgICAgICAgICBib29sIGFjdGl2ZV9wID0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5hY3RpdmVfcDsK KyAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICBi b29sIGVuYWJsZWRfcCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0uZW5hYmxlZF9wOworICAgICAgICAgIC8qIGBtYXRyaXhfcm93JyBpbiBgZGlzcG5ldy5j YCBjb250YWlucyB0aGUgZm9sbG93aW5nIHRlc3RzLAorICAgICAgICAgIGVhc3NlcnQgKG1hdHJp eCAmJiBtYXRyaXgtPnJvd3MpOworICAgICAgICAgIGVhc3NlcnQgKHJvdyA+PSAwICYmIHJvdyA8 IG1hdHJpeC0+bnJvd3MpOyAqLworICAgICAgICAgIGJvb2wgYmFyZl9jcmFzaF9vbmUgPSAobWF0 cml4ICYmIG1hdHJpeC0+cm93cykgPyBmYWxzZSA6IHRydWU7CisgICAgICAgICAgaWYgKGJhcmZf Y3Jhc2hfb25lKQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgYm9vbCBiYXJmX2Ny YXNoX3R3byA9ICh2cG9zID49IDAgJiYgdnBvcyA8IG1hdHJpeC0+bnJvd3MpID8gZmFsc2UgOiB0 cnVlOworICAgICAgICAgIGlmIChiYXJmX2NyYXNoX3R3bykKKyAgICAgICAgICAgIGNvbnRpbnVl OworICAgICAgICAgIGlmICh2cG9zID09IHZudGgKKyAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxh dm9yID09IE1DX0dMWVBICisgICAgICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgbWNfZXJhc2VfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgeSwg aHBvcywgdnBvcywgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QpOworICAgICAgICAgICAg ICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmVuYWJsZWRf cCA9IGZhbHNlOworICAgICAgICAgICAgICAtLXctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2Fj aGVfdHlwZV07CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmICh2cG9zID09IHZu dGgKKyAgICAgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3AgPSB0cnVlOworICAgICAgICAgICAgICAgIG1j X2RyYXdfZXJhc2VfaHlicmlkICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2 cG9zLCB3ZCwgaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29y X3R5cGUsIGN1cnNvcl93aWR0aCwgbHNsX2JnLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCByZW1vdmVfcCk7CisgICAgICAgICAg ICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFi bGVkX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAtLXctPm1jX21hdHJpeC5jdXJzb3JzX3Vz ZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgdy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSA9IDA7CisgICAgfQorfQor CisvKiBFcmFzZSBmYWtlIGN1cnNvcnMgZnJvbSAobWluLCBydW4uY3VycmVudF95LCBydW4uZGVz aXJlZF95KSB0byBlbmQgb2Ygd2luZG93LgorICBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9N QVRSSVhfRE9XTjoKKyAgICBydW4uaGVpZ2h0ID0gaXQubGFzdF92aXNpYmxlX3kgLSBydW4uZGVz aXJlZF95CisgICAgW2VtYWNzIC1xOiAgSG9sZCB1cC1hcnJvdyBrZXkgdHJpZ2dlcmluZyBhdXRv LXJlY2VudGVyIGF0IHNjcm9sbC1tYXJnaW4uXQorICBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVO VF9NQVRSSVhfVVA6CisgIC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wgICAgICAgICAgICAgfCAgICBydW4uaGVp Z2h0ID0gaXQubGFzdF92aXNpYmxlX3kgLSBydW4uZGVzaXJlZF95CisgIHwgICAgICAgICAgICAg fCAgICBydW4uaGVpZ2h0ID09IDEwODAgLSA4MTAgPT0gMjcwCisgIHwgICAgICAgICAgICAgfCAg ICBbVG9wIHBhcnQgb2YgdGhlIGxvd2VyIHJlY3RhbmdsZSBnZXRzIGNvcGllZCB0byBsb3dlciBy dW4uZGVzaXJlZF95Ll0KKyAgfCAgICAgICAgICAgICB8CisgICstLS0tLS0tLS0tLS0tKyA8PSBp dC5sYXN0X3Zpc2libGVfeSA9PSAxMDgwICovCit2b2lkCittY19wcmVfc2Nyb2xsX2NsZWFuIChz dHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgcnVuIHJ1biwgaW50IHN0YXJ0X3Zwb3MsCisgICAgICAg ICAgICAgICAgICAgICBpbnQgbnJvd3Nfc2Nyb2xsZWQsIGVudW0gbWNfcHJlX3Njcm9sbF9jbGVh bl90eXBlIGZyb21fd2hlcmUpCit7CisgIGlmIChNSU5JX1dJTkRPV19QICh3KSkKKyAgICByZXR1 cm47CisgIGJvb2wgZ29fb25lX3AgPSAody0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtNQ19DQUNI RV0gPiAwCisgICAgICAgICAgICAgICAgICAgfHwgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtD SF9DQUNIRV0gPiAwCisgICAgICAgICAgICAgICAgICAgfHwgdy0+bWNfbWF0cml4LmN1cnNvcnNf dXNlZFtGQ19DQUNIRV0gPiAwKTsKKyAgYm9vbCBnb190d29fcCA9IChCVUZGRVJQICh3LT5jb250 ZW50cykKKyAgICAgICAgICAgICAgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgICAgICAgICAg ICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkp KTsKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX3By ZV9zY3JvbGxfY2xlYW4gKCVzKTpcblwKKyAgJXMgfCBnb19vbmVfcCAoJXMpIHwgZ29fdHdvX3Ag KCVzKVxuXAorICBzdGFydF92cG9zICglZCkgfCBucm93c19zY3JvbGxlZCAoJWQpXG5cCisgICVz OiAgcnVuLmN1cnJlbnQvZGVzaXJlZF95ICglZC8lZCkgfCBydW4uaGVpZ2h0ICglZClcbiIsCisg ICAgbWNfd2luZG93ICh3KSwgKGZyb21fd2hlcmUgPT0gVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJF TlRfTUFUUklYX0RPV04pCisgICAgICAgICAgICAgICAgICAgICA/ICJUUllfV0lORE9XX1JFVVNJ TkdfQ1VSUkVOVF9NQVRSSVhfRE9XTiIKKyAgICAgICAgICAgICAgICAgICA6IChmcm9tX3doZXJl ID09IFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJWF9VUCkKKyAgICAgICAgICAgICAg ICAgICAgID8gIlRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJWF9VUCIKKyAgICAgICAg ICAgICAgICAgICA6IChmcm9tX3doZXJlID09IFRSWV9XSU5ET1dfSUQpCisgICAgICAgICAgICAg ICAgICAgICA/ICJUUllfV0lORE9XX0lEIgorICAgICAgICAgICAgICAgICAgIDogIlVOS05PV04i LAorICAgIGdvX29uZV9wID8gInllcyIgOiAibm8iLCBnb190d29fcCA/ICJ5ZXMiIDogIm5vIiwK KyAgICBzdGFydF92cG9zLCBucm93c19zY3JvbGxlZCwKKyAgICBydW4uY3VycmVudF95IDwgcnVu LmRlc2lyZWRfeSA/ICLihpMiIDogIuKGkSIsCisgICAgcnVuLmN1cnJlbnRfeSwgcnVuLmRlc2ly ZWRfeSwgcnVuLmhlaWdodCk7CisgIGlmICghZ29fb25lX3AgJiYgIWdvX3R3b19wKQorICAgIHJl dHVybjsKKyAgYm9vbCB1cGRhdGluZ19mcmFtZV9wID0gZmFsc2U7CisgIHN0cnVjdCBmcmFtZSAq ZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBpZiAoWEZSQU1FICh3LT5mcmFtZSkgIT0gZi0+bWNf dXBkYXRpbmdfZnJhbWUKKyAgICAgICYmIChnb19vbmVfcCB8fCBnb190d29fcCkpCisgICAgewor ICAgICAgdXBkYXRpbmdfZnJhbWVfcCA9IHRydWU7CisgICAgICB1cGRhdGVfYmVnaW4gKGYpOwor ICAgIH0KKyAgaWYgKHctPnBoeXNfY3Vyc29yX29uX3AKKyAgICAgICYmIGdvX3R3b19wKQorICAg IGVyYXNlX3BoeXNfY3Vyc29yICh3KTsKKyAgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4ID0g dy0+Y3VycmVudF9tYXRyaXg7CisgIGZvciAoaW50IHZudGggPSBzdGFydF92cG9zOworICAgICAg IG1hdHJpeCAhPSBOVUxMCisgICAgICAgJiYgdm50aCA8IG1hdHJpeC0+bnJvd3MKKyAgICAgICAm JiBNQVRSSVhfUk9XIChtYXRyaXgsIHZudGgpLT5lbmFibGVkX3AKKyAgICAgICAmJiBnb19vbmVf cDsKKyAgICAgICArK3ZudGgpCisgICAgeworICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93ID0g TUFUUklYX1JPVyAobWF0cml4LCB2bnRoKTsKKyAgICAgIG1jX2VyYXNlX3JvdyAodywgbWF0cml4 LCByb3cpOworICAgIH0KKyAgaWYgKHVwZGF0aW5nX2ZyYW1lX3ApCisgICAgdXBkYXRlX2VuZCAo Zik7CisgIC8vIG1jX3Jlc2V0X2NhY2hlICh3KTsKK30KKworREVGVU4gKCJtYy1zdGRlcnIiLCBG bWNfc3RkZXJyLCBTbWNfc3RkZXJyLCAwLCAxLCAiUCIsCisgICAgICAgZG9jOiAvKiBUb2dnbGUg dHJhY2luZyBvZiBtdWx0aXBsZSBmYWtlIGN1cnNvcnMuCitXaXRoIEFSRywgdHVybiB0cmFjaW5n IG9uIGlmIGFuZCBvbmx5IGlmIEFSRyBpcyBwb3NpdGl2ZS4gKi8pCisgIChMaXNwX09iamVjdCBh cmcpCit7CisgIGlmIChOSUxQIChhcmcpKQorICAgIG1jX3N0ZGVycl9wID0gIW1jX3N0ZGVycl9w OworICBlbHNlCisgICAgeworICAgICAgYXJnID0gRnByZWZpeF9udW1lcmljX3ZhbHVlIChhcmcp OworICAgICAgbWNfc3RkZXJyX3AgPSBYRklYTlVNIChhcmcpID4gMDsKKyAgICB9CisgIHJldHVy biBRbmlsOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogDAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAJCSAgICAgIFdpbmRvdyBkaXNwbGF5 IGRpbWVuc2lvbnMKQEAgLTEzMzk1LDYgKzE4MDM4LDY5IEBAIGhzY3JvbGxfd2luZG93X3RyZWUg KExpc3BfT2JqZWN0IHdpbmRvdykKIAkgICAgICBlbHNlCiAJCXB0ID0gY2xpcF90b19ib3VuZHMg KEJFR1YsIG1hcmtlcl9wb3NpdGlvbiAody0+cG9pbnRtKSwgWlYpOwogCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiAoZ2RiKSBi dAorIzAgIHRlcm1pbmF0ZV9kdWVfdG9fc2lnbmFsICh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eGRpc3AuYzo4NDIzCisjNyAgMHgwMDAwMDAwMTAwMDZjM2Y3IGlu IGhzY3JvbGxfd2luZG93X3RyZWUgKHdpbmRvdz0uLi4pIGF0IHhkaXNwLmM6MTg1NDYKKyovCisK KyAgLyogYGluaXRfaXRlcmF0b3InOiAgZWFzc2VydCAoY2hhcnBvcyA8IDAKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgfHwgKGNoYXJwb3MgPj0gQlVGX0JFRyAoY3VycmVudF9idWZm ZXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjaGFycG9zIDw9IFpW KSk7ICovCisKKyAgc3RydWN0IGRpc3BsYXlfcG9zICpwb3MgPSAmY3Vyc29yX3Jvdy0+c3RhcnQ7 CisgIHB0cmRpZmZfdCBjaGFycG9zID0gQ0hBUlBPUyAocG9zLT5wb3MpOworCisgIGJvb2wgYmFy Zl9jcmFzaF9vbmUgPSAoY2hhcnBvcyA8IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCAo Y2hhcnBvcyA+PSBCVUZfQkVHIChjdXJyZW50X2J1ZmZlcikKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgY2hhcnBvcyA8PSBaVikpCisgICAgICAgICAgICAgICAgICAgICAgICA/IGZh bHNlCisgICAgICAgICAgICAgICAgICAgICAgICA6IHRydWU7CisgIGlmIChiYXJmX2NyYXNoX29u ZSkKKyAgICByZXR1cm4gaHNjcm9sbGVkX3A7CisKKyAgLyogYHJlc2VhdF8xJzogIENIQVJQT1Mg KHBvcykgPj0gQkVHViAmJiBDSEFSUE9TIChwb3MpIDw9IFpWICovCisgIGJvb2wgYmFyZl9jcmFz aF90d28gPSAoY2hhcnBvcyA+PSBCRUdWICYmIGNoYXJwb3MgPD0gWlYpCisgICAgICAgICAgICAg ICAgICAgICAgICAgPyBmYWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgIDogdHJ1ZTsKKyAg aWYgKGJhcmZfY3Jhc2hfdHdvKQorICAgIHJldHVybiBoc2Nyb2xsZWRfcDsKKworLyogZW5kIE1V TFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgICAv KiBNb3ZlIGl0ZXJhdG9yIHRvIHB0IHN0YXJ0aW5nIGF0IGN1cnNvcl9yb3ctPnN0YXJ0IGluCiAJ CSBhIGxpbmUgd2l0aCBpbmZpbml0ZSB3aWR0aC4gICovCiAJICAgICAgaW5pdF90b19yb3dfc3Rh cnQgKCZpdCwgdywgY3Vyc29yX3Jvdyk7CkBAIC0xNDI4Nyw5ICsxODk5MywyMiBAQCByZWRpc3Bs YXlfaW50ZXJuYWwgKHZvaWQpCiAJICAgICAgKnctPmRlc2lyZWRfbWF0cml4LT5tZXRob2QgPSAw OwogCSAgICAgIGRlYnVnX21ldGhvZF9hZGQgKHcsICJvcHRpbWl6YXRpb24gMSIpOwogI2VuZGlm CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK ICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KKyAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQor ICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykp KQorICAgIG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgZmFsc2UpOworICAgIGVsc2UKIAkg ICAgICB1cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIGZhbHNlKTsKICNlbmRpZgorCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgZ290byB1cGRhdGU7CiAJICAgIH0KIAkgIGVs c2UKQEAgLTE3Njg3LDEwICsyMjQwNiwyMiBAQCByZWRpc3BsYXlfd2luZG93IChMaXNwX09iamVj dCB3aW5kb3csIGJvb2wganVzdF90aGlzX29uZV9wKQogICAgIH0KIAogI2lmZGVmIEhBVkVfV0lO RE9XX1NZU1RFTQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgIGJvb2wga2VlcF9jdXJyZW50X3AgPSAoanVzdF90aGlzX29uZV9wCisgICAg ICAgICAgICAgICAgICAgICAgICAgfHwgKCF1c2VkX2N1cnJlbnRfbWF0cml4X3AgJiYgIW92ZXJs YXlfYXJyb3dfc2VlbikKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCB3LT5wc2V1ZG9fd2lu ZG93X3ApOworCisgIGJvb2wgZnJpbmdlc191cGRhdGVkX3AgPSAoQlVGRkVSUCAody0+Y29udGVu dHMpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIGtlZXBfY3VycmVudF9wKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiB1cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIGtlZXBfY3VycmVu dF9wKTsKKwogICBpZiAoRlJBTUVfV0lORE9XX1AgKGYpCi0gICAgICAmJiB1cGRhdGVfd2luZG93 X2ZyaW5nZXMgKHcsIChqdXN0X3RoaXNfb25lX3AKLQkJCQkgICAgfHwgKCF1c2VkX2N1cnJlbnRf bWF0cml4X3AgJiYgIW92ZXJsYXlfYXJyb3dfc2VlbikKLQ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RvdyAqdykKIAkgICAgICB1cGRhdGVfYmVnaW4gKGYpOwogCSAgICAgIEZSQU1F X1JJRiAoZiktPnVwZGF0ZV93aW5kb3dfYmVnaW5faG9vayAodyk7CiAJICAgICAgRlJBTUVfUklG IChmKS0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOworCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgbWNfcHJlX3Njcm9sbF9jbGVh biAodywgcnVuLCBzdGFydF92cG9zLCBucm93c19zY3JvbGxlZCwgVFJZX1dJTkRPV19SRVVTSU5H X0NVUlJFTlRfTUFUUklYX0RPV04pOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJ ICAgICAgRlJBTUVfUklGIChmKS0+c2Nyb2xsX3J1bl9ob29rICh3LCAmcnVuKTsKIAkgICAgICBG UkFNRV9SSUYgKGYpLT51cGRhdGVfd2luZG93X2VuZF9ob29rICh3LCBmYWxzZSwgZmFsc2UpOwog CSAgICAgIHVwZGF0ZV9lbmQgKGYpOwpAQCAtMTgxNzMsNiArMjI5MTgsNyBAQCB0cnlfd2luZG93 X3JldXNpbmdfY3VycmVudF9tYXRyaXggKHN0cnVjdCB3aW5kb3cgKncpCiAJfQogCiAgICAgICAv KiBTY3JvbGwgdGhlIGRpc3BsYXkuICAqLworCiAgICAgICBydW4uY3VycmVudF95ID0gZmlyc3Rf cmV1c2FibGVfcm93LT55OwogICAgICAgcnVuLmRlc2lyZWRfeSA9IFdJTkRPV19IRUFERVJfTElO RV9IRUlHSFQgKHcpOwogICAgICAgcnVuLmhlaWdodCA9IGl0Lmxhc3RfdmlzaWJsZV95IC0gcnVu LmN1cnJlbnRfeTsKQEAgLTE4MTgzLDYgKzIyOTI5LDE2IEBAIHRyeV93aW5kb3dfcmV1c2luZ19j dXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRvdyAqdykKIAkgIHVwZGF0ZV9iZWdpbiAoZik7CiAJ ICBGUkFNRV9SSUYgKGYpLT51cGRhdGVfd2luZG93X2JlZ2luX2hvb2sgKHcpOwogCSAgRlJBTUVf UklGIChmKS0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOworCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgbWNfcHJlX3Njcm9sbF9j bGVhbiAodywgcnVuLCBzdGFydF92cG9zLCBucm93c19zY3JvbGxlZCwgVFJZX1dJTkRPV19SRVVT SU5HX0NVUlJFTlRfTUFUUklYX1VQKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog CSAgRlJBTUVfUklGIChmKS0+c2Nyb2xsX3J1bl9ob29rICh3LCAmcnVuKTsKIAkgIEZSQU1FX1JJ RiAoZiktPnVwZGF0ZV93aW5kb3dfZW5kX2hvb2sgKHcsIGZhbHNlLCBmYWxzZSk7CiAJICB1cGRh dGVfZW5kIChmKTsKQEAgLTE5MTI3LDYgKzIzODgzLDcgQEAgdHJ5X3dpbmRvd19pZCAoc3RydWN0 IHdpbmRvdyAqdykKICAgLyogU2Nyb2xsIHRoZSBkaXNwbGF5LiAgRG8gaXQgYmVmb3JlIGNoYW5n aW5nIHRoZSBjdXJyZW50IG1hdHJpeCBzbwogICAgICB0aGF0IHh0ZXJtLmMgZG9lc24ndCBnZXQg Y29uZnVzZWQgYWJvdXQgd2hlcmUgdGhlIGN1cnNvciBnbHlwaCBpcwogICAgICBmb3VuZC4gICov CisKICAgaWYgKGR5ICYmIHJ1bi5oZWlnaHQpCiAgICAgewogICAgICAgdXBkYXRlX2JlZ2luIChm KTsKQEAgLTE5MTM1LDYgKzIzODkyLDE2IEBAIHRyeV93aW5kb3dfaWQgKHN0cnVjdCB3aW5kb3cg KncpCiAJewogCSAgRlJBTUVfUklGIChmKS0+dXBkYXRlX3dpbmRvd19iZWdpbl9ob29rICh3KTsK IAkgIEZSQU1FX1JJRiAoZiktPmNsZWFyX3dpbmRvd19tb3VzZV9mYWNlICh3KTsKKworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIG1jX3By ZV9zY3JvbGxfY2xlYW4gKHcsIHJ1biwgZmlyc3RfdW5jaGFuZ2VkX2F0X2VuZF92cG9zLCBkdnBv cywgVFJZX1dJTkRPV19JRCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIEZS QU1FX1JJRiAoZiktPnNjcm9sbF9ydW5faG9vayAodywgJnJ1bik7CiAJICBGUkFNRV9SSUYgKGYp LT51cGRhdGVfd2luZG93X2VuZF9ob29rICh3LCBmYWxzZSwgZmFsc2UpOwogCX0KQEAgLTIxMjcz LDYgKzI2MDQwLDE3IEBAIG1heWJlX3Byb2R1Y2VfbGluZV9udW1iZXIgKHN0cnVjdCBpdCAqaXQp CiAgICAgICBTRVRfVEVYVF9QT1MgKHRlbV9pdC5wb3NpdGlvbiwgLTEsIC0xKTsKICAgICAgIFBS T0RVQ0VfR0xZUEhTICgmdGVtX2l0KTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgLyogVGhpcyBwZXJtaXRzIHVzIHRvIGluc3Bl Y3QgdGhlIEhQT1Mgb2YgbGluZSBudW1iZXIgZ2x5cGhzIGFuZCB0aGUgc3BhY2UKKyAgICAgIHBh ZGRpbmcgYmVmb3JlL2FmdGVyIHRoZSBsaW5lIG51bWJlcnMuICBXZSBzZXQgYGdseXBoLT5ocG9z YCBlbHNld2hlcmUuICovCisgICAgICB0ZW1faXQuaHBvcyArPSAxOworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAgICAgICAvKiBTdG9wIHByb2R1Y2luZyBnbHlwaHMsIGFuZCByZWZy YWluIGZyb20gcHJvZHVjaW5nIHRoZSBsaW5lCiAJIG51bWJlciwgaWYgd2UgZG9uJ3QgaGF2ZSBl bm91Z2ggc3BhY2Ugb24gdGhpcyBsaW5lLiAgKi8KICAgICAgIGlmICh0ZW1faXQuY3VycmVudF94 ID49IHdpZHRoX2xpbWl0KQpAQCAtMjEyODQsNiArMjYwNjIsMzAgQEAgbWF5YmVfcHJvZHVjZV9s aW5lX251bWJlciAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgfQogCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIExpc3BfT2JqZWN0IGJ1ZiA9 IGl0LT53LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYpOworICBzdHJ1Y3QgYnVmZmVy ICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgc3RydWN0IGJ1ZmZlciAqb2xkX2J1ZmZlciA9IE5VTEw7 CisgIC8qIE5lZWRlZCBzbyB0aGF0IGJ1ZmZlci1sb2NhbCB2YWx1ZXMgY2FuIGJlIGRldGVybWlu ZWQ7IGUuZy4sIHdoZW4gc3dpdGNoaW5nCisgIHRvIHRoZSBtaW5pYnVmZmVyLiAqLworICBpZiAo YiAhPSBjdXJyZW50X2J1ZmZlcikKKyAgICB7CisgICAgICBvbGRfYnVmZmVyID0gY3VycmVudF9i dWZmZXI7CisgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChiKTsKKyAgICB9CisgIGl0LT53LT5t Yy5sbnVtX3BpeGVsX3dpZHRoID0gKCFOSUxQIChWZGlzcGxheV9saW5lX251bWJlcnMpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gdGVtX2l0LmN1cnJlbnRfeAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogMDsKKyAgaWYgKG9sZF9idWZmZXIpCisgICAgc2V0X2J1 ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICAgLyogUmVjb3JkIHRoZSB3aWR0aCBpbiBwaXhlbHMgd2UgbmVlZCBmb3IgdGhlIGxpbmUg bnVtYmVyIGRpc3BsYXkuICAqLwogICBpdC0+bG51bV9waXhlbF93aWR0aCA9IHRlbV9pdC5jdXJy ZW50X3g7CiAgIC8qIENvcHkgdGhlIHByb2R1Y2VkIGdseXBocyBpbnRvIElUJ3MgZ2x5cGhfcm93 LiAgKi8KQEAgLTI3MDkyLDYgKzMxODk0LDE3IEBAIGFwcGVuZF9nbHlwaCAoc3RydWN0IGl0ICpp dCkKIAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJl YV07CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5dGVw b3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAg ICAgICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAgICAgICBnbHlw aC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKICAgICAgIGlmIChpdC0+cGl4ZWxfd2lkdGggPiAwKQpA QCAtMjcxNzUsNiArMzE5ODgsMTcgQEAgYXBwZW5kX2NvbXBvc2l0ZV9nbHlwaCAoc3RydWN0IGl0 ICppdCkKIAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNb aXQtPmFyZWFdOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBo LT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBpdC0+Y21wX2l0LmNoYXJwb3M7CiAgICAgICBn bHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKICAgICAgIGVhc3NlcnQgKGl0LT5waXhlbF93aWR0 aCA8PSBTSFJUX01BWCk7CkBAIC0yNzM4Myw2ICszMjIwNywxNyBAQCBwcm9kdWNlX2ltYWdlX2ds eXBoIChzdHJ1Y3QgaXQgKml0KQogCX0KICAgICAgIGlmIChnbHlwaCA8IGl0LT5nbHlwaF9yb3ct PmdseXBoc1thcmVhICsgMV0pCiAJeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAg ICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAJICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7 CiAJICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9 IGNsaXBfdG9fYm91bmRzICgtMSwgaXQtPnBpeGVsX3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzQ4 Niw2ICszMjMyMSwxNyBAQCBwcm9kdWNlX3h3aWRnZXRfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJ fQogICAgICAgaWYgKGdseXBoIDwgaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2FyZWEgKyAxXSkKIAl7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElU X0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIGdseXBo LT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKIAkgIGdseXBoLT5vYmplY3QgPSBp dC0+b2JqZWN0OwogCSAgZ2x5cGgtPnBpeGVsX3dpZHRoID0gY2xpcF90b19ib3VuZHMgKC0xLCBp dC0+cGl4ZWxfd2lkdGgsIFNIUlRfTUFYKTsKQEAgLTI3NTcyLDYgKzMyNDE4LDE3IEBAIGFwcGVu ZF9zdHJldGNoX2dseXBoIChzdHJ1Y3QgaXQgKml0LCBMaXNwX09iamVjdCBvYmplY3QsCiAJICAg IHdpZHRoIC09IGl0LT5maXJzdF92aXNpYmxlX3ggLSBpdC0+Y3VycmVudF94OwogCSAgZWFzc2Vy dCAod2lkdGggPiAwKTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBn bHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsK ICAgICAgIGdseXBoLT5vYmplY3QgPSBvYmplY3Q7CiAgICAgICAvKiBGSVhNRTogSXQgd291bGQg YmUgYmV0dGVyIHRvIHVzZSBUWVBFX01BWCBoZXJlLCBidXQKQEAgLTI4MDI2LDYgKzMyODgzLDE3 IEBAIGFwcGVuZF9nbHlwaGxlc3NfZ2x5cGggKHN0cnVjdCBpdCAqaXQsIGludCBmYWNlX2lkLCBi b29sIGZvcl9ub19mb250LCBpbnQgbGVuLAogCSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0 LT5nbHlwaF9yb3ctPmdseXBoc1thcmVhXTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhw b3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQt PnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgZWFz c2VydCAoaXQtPnBpeGVsX3dpZHRoIDw9IFNIUlRfTUFYKTsKQEAgLTI5MDc2LDEwICszMzk0NCwy MCBAQCB4X2luc2VydF9nbHlwaHMgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cg KnVwZGF0ZWRfcm93LAogCiAgIC8qIFdyaXRlIHRoZSBnbHlwaHMuICAqLwogICBocG9zID0gc3Rh cnQgLSByb3ctPmdseXBoc1t1cGRhdGVkX2FyZWFdOworCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmICghbWNfcmVkcmF3X3JvdyAodywg dy0+Y3VycmVudF9tYXRyaXgsIHJvdywgdXBkYXRlZF9hcmVhLCB3LT5vdXRwdXRfY3Vyc29yLngs CisgICAgICAgICAgICAgICAgICAgICAgaHBvcywgaHBvcyArIGxlbiwgZmFsc2UsIERSQVdfTk9S TUFMX1RFWFQsIFhfSU5TRVJUX0dMWVBIUykpCiAgIGRyYXdfZ2x5cGhzICh3LCB3LT5vdXRwdXRf Y3Vyc29yLngsIHJvdywgdXBkYXRlZF9hcmVhLAogCSAgICAgICBocG9zLCBocG9zICsgbGVuLAog CSAgICAgICBEUkFXX05PUk1BTF9URVhULCAwKTsKIAorLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAvKiBBZHZhbmNlIHRoZSBvdXRwdXQgY3Vyc29yLiAgKi8KICAgdy0+b3V0cHV0X2N1 cnNvci5ocG9zICs9IGxlbjsKICAgdy0+b3V0cHV0X2N1cnNvci54ICs9IHNoaWZ0X2J5X3dpZHRo OwpAQCAtMjk1MDUsOSArMzQzODMsMTkgQEAgeF9maXhfb3ZlcmxhcHBpbmdfYXJlYSAoc3RydWN0 IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LAogCSAgd2hpbGUgKGkgPCByb3ctPnVz ZWRbYXJlYV0KIAkJICYmIHJvdy0+Z2x5cGhzW2FyZWFdW2ldLm92ZXJsYXBzX3ZlcnRpY2FsbHlf cCk7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgICAgIGlmICghbWNfcmVkcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywg YXJlYSwgc3RhcnRfeCwgc3RhcnQsIGksCisgICAgICAgICAgZmFsc2UsIERSQVdfTk9STUFMX1RF WFQsIFhfRklYX09WRVJMQVBQSU5HX0FSRUEpKQogCSAgZHJhd19nbHlwaHMgKHcsIHN0YXJ0X3gs IHJvdywgYXJlYSwKIAkJICAgICAgIHN0YXJ0LCBpLAogCQkgICAgICAgRFJBV19OT1JNQUxfVEVY VCwgb3ZlcmxhcHMpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJfQogICAgICAg ZWxzZQogCXsKQEAgLTI5NzU4LDEwICszNDY0NiwxNyBAQCBkaXNwbGF5X2FuZF9zZXRfY3Vyc29y IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9uLAogICBuZXdfY3Vyc29yX3R5cGUgPSBnZXRfd2lu ZG93X2N1cnNvcl90eXBlICh3LCBnbHlwaCwKIAkJCQkJICAgICZuZXdfY3Vyc29yX3dpZHRoLCAm YWN0aXZlX2N1cnNvcik7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKICAgLyogSWYgY3Vyc29yIGlzIGN1cnJlbnRseSBiZWluZyBzaG93biBh bmQgd2UgZG9uJ3Qgd2FudCBpdCB0byBiZSBvcgogICAgICBpdCBpcyBpbiB0aGUgd3JvbmcgcGxh Y2UsIG9yIHRoZSBjdXJzb3IgdHlwZSBpcyBub3Qgd2hhdCB3ZSB3YW50LAogICAgICBlcmFzZSBp dC4gICovCiAgIGlmICh3LT5waHlzX2N1cnNvcl9vbl9wCisgICAgICAmJiBOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICYmIE5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCiAgICAgICAmJiAoIW9uCiAJICB8fCB3 LT5waHlzX2N1cnNvci54ICE9IHgKIAkgIHx8IHctPnBoeXNfY3Vyc29yLnkgIT0geQpAQCAtMjk3 NzQsNiArMzQ2NjksOSBAQCBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3 LCBib29sIG9uLAogCSAgICAgICYmIG5ld19jdXJzb3Jfd2lkdGggIT0gdy0+cGh5c19jdXJzb3Jf d2lkdGgpKSkKICAgICBlcmFzZV9waHlzX2N1cnNvciAodyk7CiAKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICAgLyogRG9uJ3QgY2hlY2sgcGh5c19jdXJzb3Jfb25fcCBoZXJlIGJlY2F1 c2UgdGhhdCBmbGFnIGlzIG9ubHkgc2V0CiAgICAgIHRvIGZhbHNlIGluIHNvbWUgY2FzZXMgd2hl cmUgd2Uga25vdyB0aGF0IHRoZSBjdXJzb3IgaGFzIGJlZW4KICAgICAgY29tcGxldGVseSBlcmFz ZWQsIHRvIGF2b2lkIHRoZSBleHRyYSB3b3JrIG9mIGVyYXNpbmcgdGhlIGN1cnNvcgpAQCAtMjk3 OTIsOSArMzQ2OTAsMTkgQEAgZGlzcGxheV9hbmRfc2V0X2N1cnNvciAoc3RydWN0IHdpbmRvdyAq dywgYm9vbCBvbiwKICAgICAgIHctPnBoeXNfY3Vyc29yLnZwb3MgPSB2cG9zOwogICAgIH0KIAot ICBGUkFNRV9SSUYgKGYpLT5kcmF3X3dpbmRvd19jdXJzb3IgKHcsIGdseXBoX3JvdywgeCwgeSwK LSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY3Vyc29yX3R5cGUsIG5l d19jdXJzb3Jfd2lkdGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb24s IGFjdGl2ZV9jdXJzb3IpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKworICBpZiAoTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj cm9zc2hhaXJzKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg ZmNfdmlzaWJsZSkpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IG1jX2NvbmYpKSkKKyAgICBGUkFNRV9SSUYgKGYpLT5kcmF3X3dpbmRvd19jdXJzb3IgKHcsIGds eXBoX3JvdywgeCwgeSwgbmV3X2N1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgbmV3X2N1cnNvcl93aWR0aCwgb24sIGFjdGl2ZV9jdXJzb3IpOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIApAQCAtMjk4ODcsNyArMzQ3OTUsMTgg QEAgZHJhd19yb3dfd2l0aF9tb3VzZV9mYWNlIChzdHJ1Y3Qgd2luZG93ICp3LCBpbnQgc3RhcnRf eCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogICBp ZiAoRlJBTUVfV0lORE9XX1AgKFhGUkFNRSAody0+ZnJhbWUpKSkKICAgICB7CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGlmICgh bWNfcmVkcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywgVEVYVF9BUkVBLCBzdGFy dF94LAorICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydF9ocG9zLCBlbmRfaHBvcywgZmFs c2UsIGRyYXcsIERSQVdfUk9XX1dJVEhfTU9VU0VfRkFDRSkpCiAgICAgICBkcmF3X2dseXBocyAo dywgc3RhcnRfeCwgcm93LCBURVhUX0FSRUEsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBkcmF3LCAw KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgcmV0dXJuOwogICAgIH0K ICNlbmRpZgpAQCAtMzE5NDUsMTEgKzM2ODY0LDIzIEBAIGV4cG9zZV9hcmVhIChzdHJ1Y3Qgd2lu ZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIFhSZWN0YW5nbGUgKnIsCiAgIHN0cnVjdCBn bHlwaCAqbGFzdDsKICAgaW50IGZpcnN0X3gsIHN0YXJ0X3gsIHg7CiAKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgaWYgKGFyZWEgPT0gVEVY VF9BUkVBICYmIHJvdy0+ZmlsbF9saW5lX3ApCisgICAgeworICAgICAgaWYgKCFtY19yZWRyYXdf cm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBhcmVhLCAwLCAwLCByb3ctPnVzZWRbYXJl YV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlLCBEUkFXX05PUk1BTF9URVhULCBF WFBPU0VfQVJFQV9PTkUpKQogICAgIC8qIElmIHJvdyBleHRlbmRzIGZhY2UgdG8gZW5kIG9mIGxp bmUgd3JpdGUgdGhlIHdob2xlIGxpbmUuICAqLwogICAgIGRyYXdfZ2x5cGhzICh3LCAwLCByb3cs IGFyZWEsCiAJCSAwLCByb3ctPnVzZWRbYXJlYV0sCiAJCSBEUkFXX05PUk1BTF9URVhULCAwKTsK KyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgZWxzZQogICAgIHsKICAg ICAgIC8qIFNldCBTVEFSVF9YIHRvIHRoZSB3aW5kb3ctcmVsYXRpdmUgc3RhcnQgcG9zaXRpb24g Zm9yIGRyYXdpbmcgZ2x5cGhzIG9mCkBAIC0zMTk4MSwxMSArMzY5MTIsMjMgQEAgZXhwb3NlX2Fy ZWEgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgWFJlY3RhbmdsZSAq ciwKIAkgICsrbGFzdDsKIAl9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKICAgICAgIC8qIFJlcGFpbnQuICAqLwotICAgICAgaWYgKGxhc3Qg PiBmaXJzdCkKKyAgICAgIC8qIEZsb2F0aW5nIGZha2UgY3Vyc29ycyB3aWxsIGV4aXN0IHdoZW4g KGxhc3QgPT0gZmlyc3QpLiAqLworICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJy ZW50X21hdHJpeCwgcm93LCBhcmVhLCBmaXJzdF94IC0gc3RhcnRfeCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgZmlyc3QgLSByb3ctPmdseXBoc1thcmVhXSwgbGFzdCAtIHJvdy0+Z2x5cGhz W2FyZWFdLAorICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSwgRFJBV19OT1JNQUxfVEVY VCwgRVhQT1NFX0FSRUFfVFdPKQorICAgICAgICAgICYmIGxhc3QgPiBmaXJzdCkKIAlkcmF3X2ds eXBocyAodywgZmlyc3RfeCAtIHN0YXJ0X3gsIHJvdywgYXJlYSwKIAkJICAgICBmaXJzdCAtIHJv dy0+Z2x5cGhzW2FyZWFdLCBsYXN0IC0gcm93LT5nbHlwaHNbYXJlYV0sCiAJCSAgICAgRFJBV19O T1JNQUxfVEVYVCwgMCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB9CiB9 CiAKQEAgLTMxOTk5LDEwICszNjk0MiwyMiBAQCBleHBvc2VfbGluZSAoc3RydWN0IHdpbmRvdyAq dywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBYUmVjdGFuZ2xlICpyKQogewogICBlYXNzZXJ0IChy b3ctPmVuYWJsZWRfcCk7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKICAgaWYgKHJvdy0+bW9kZV9saW5lX3AgfHwgdy0+cHNldWRvX3dpbmRv d19wKQorICAgIHsKKyAgICAgIGlmICghbWNfcmVkcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRy aXgsIHJvdywgVEVYVF9BUkVBLCAwLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICByb3ct PnVzZWRbVEVYVF9BUkVBXSwgZmFsc2UsIERSQVdfTk9STUFMX1RFWFQsIEVYUE9TRV9MSU5FKSkK ICAgICBkcmF3X2dseXBocyAodywgMCwgcm93LCBURVhUX0FSRUEsCiAJCSAwLCByb3ctPnVzZWRb VEVYVF9BUkVBXSwKIAkJIERSQVdfTk9STUFMX1RFWFQsIDApOworICAgIH0KKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogICBlbHNlCiAgICAgewogICAgICAgaWYgKHJvdy0+dXNlZFtM RUZUX01BUkdJTl9BUkVBXSkKQEAgLTMyNTUwLDYgKzM3NTA1LDIyIEBAIHhfaW50ZXJzZWN0X3Jl Y3RhbmdsZXMgKFhSZWN0YW5nbGUgKnIxLCBYUmVjdGFuZ2xlICpyMiwgWFJlY3RhbmdsZSAqcmVz dWx0KQogdm9pZAogc3ltc19vZl94ZGlzcCAodm9pZCkKIHsKKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBkZWZzdWJyICgmU21jX2R1bXBf Z2x5cGhfcm93KTsKKworICBkZWZzdWJyICgmU21jX2R1bXBfZ2x5cGhfbWF0cml4KTsKKworICBk ZWZzdWJyICgmU21jX2N1cnJlbnRfY29sdW1uKTsKKworICBkZWZzdWJyICgmU21jX3N0ZGVycik7 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgVndpdGhfZWNob19hcmVhX3NhdmVf dmVjdG9yID0gUW5pbDsKICAgc3RhdGljcHJvICgmVndpdGhfZWNob19hcmVhX3NhdmVfdmVjdG9y KTsKIApkaWZmIC0tZ2l0IGEvc3JjL3h0ZXJtLmMgYi9zcmMveHRlcm0uYwppbmRleCA1YWEzZTNm Li42MjdmNDFiIDEwMDY0NAotLS0gYS9zcmMveHRlcm0uYworKysgYi9zcmMveHRlcm0uYwpAQCAt MTMyLDYgKzEzMiw4ODUgQEAgYWxvbmcgd2l0aCBHTlUgRW1hY3MuICBJZiBub3QsIHNlZSA8aHR0 cHM6Ly93d3cuZ251Lm9yZy9saWNlbnNlcy8+LiAgKi8KICNpbmNsdWRlIDxYMTEvWEtCbGliLmg+ CiAjZW5kaWYKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExF LUNVUlNPUlMgKi8KKworI2lmZGVm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gIHhfY2xpcF90b19yb3cgKHcsIHJvdywg VEVYVF9BUkVBLCBnYyk7CisgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChmLCBnYywgZngsIGZ5LCB3 ZCwgaCk7CisgICAgICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAoZiwgZ2MpOworICAgIH0KK30K KworLyogUklGOiBEcmF3IGN1cnNvciBvbiB3aW5kb3cgVy4gKi8KK3N0YXRpYyB2b2lkCittY194 X2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJp eCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAg ICAgaW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50IGhwb3MsIGludCB2cG9zLCBpbnQg d2QsCisgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGgsIHN0cnVjdCBtY19SR0IgbHNsLCBl bnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAg IGludCBjdXJzb3Jfd2lkdGgsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwgYm9vbCBvbl9w LAorICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3ApCit7CisgIHN0cnVjdCBm cmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgIC8qIFRoZSBmcmluZ2UgYml0 bWFwcyBhcmUgcHJlc2VudGx5IGhhbmRsZWQgZWxzZXdoZXJlLCBidXQgY291bGQgc29tZWRheQor ICBiZSBtYW5hZ2VkIChpbiBwYXJ0KSBhdCB0aGlzIHNlY3Rpb24gb2YgY29kZS4gKi8KKyAgaWYg KG9uX3ApCisgICAgeworICAgICAgaWYgKHJvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAor ICAgICAgICAgICYmIChyb3ctP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isgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoY3Vyc29yX2dseXBoLT50eXBlID09IElNQUdF X0dMWVBIICYmIGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAw KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0 cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4gKi8KKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgICAgbWNfeF9kcmF3X2hv bGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdk LCBoKTsKKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdp bmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAgICAgICAgICAgICBmdW5jdGlvbmFs aXR5IG9mIGB4X21ha2VfZ2MnIGluIHhmbnMuYy4gKi8KKyAgICAgICAgICAgICAgaWYgKHJlZ2lv bl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3AKKyAgICAgICAgICAgICAg ICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBvcyA9PSByZWdpb25fYmVnKQorICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lv bl9iZWdfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwt ZmFrZS1jdXJzb3ItYXQtcmVnaW9uLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAg ICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2JlZ19mYWNlID0gRkFDRV9G Uk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdfZmFjZV9pZCk7CisgICAgICAgICAg ICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVk X2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0 cnVlKTsKKyAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2Ug PSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAg ICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEu eC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAg ICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9k YXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9yZWdpb25fYmVnX2ZhY2UtPmZvcmVncm91 bmQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25f YWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBvcyA9PSByZWdpb25fZW5kKQor ICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg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FhTZXRCYWNrZ3Jv dW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhv bGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZS0+Zm9yZWdyb3VuZCk7CisgICAgICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoYWN0aXZlX3ApCisgICAg ICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lk IGhvbGxvd19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4g KCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lE IChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgICAgWFNl dEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAg ICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0 YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19hY3RpdmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKCFhY3RpdmVf cCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2Ug KHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1wcmUtenYtZmFjZSIp LCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19p bmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7 CisgICAgICAgICAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BM QVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19pbmFjdGl2ZV9mYWNl LT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQg KEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93 X2luYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAgICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyogRm9yY2UgYG1j X3hfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2Mn LiAqLworICAgICAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICAg ICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwg aHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbCwgZ2x5 cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICBYU2V0Rm9yZWdy b3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4 Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9E SVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmJhY2tncm91bmQp OworICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAgICAvKiBEcmF3 IHRoZSBmcmFtZSBhcm91bmQgdGhlIGJveC4gKi8KKyAgICAgICAgICAgICAgbWNfeF9kcmF3X2hv bGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdk LCBoKTsKKyAgICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0hP TExPV19CT1g6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0g MCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkg aGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYt Pm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgIG1j X3hfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9z LCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVs ID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAg ICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBm eSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNf RklMTEVEX0JPWDoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+ PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+ b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgIGZ1bmN0 aW9uYWxpdHkgb2YgYHhfbWFrZV9nYycgaW4geGZucy5jLiAqLworICAgICAgICB7CisgICAgICAg ICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElT UExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgRlJBTUVfQkFDS0dST1VORF9Q SVhFTCAoZikpOworICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYp LCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGNvbG9yLnBpeGVsKTsKKyAgICAgICAgICAv KiBGb3JjZSBgbWNfeF9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9nYycuICovCisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAg ICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwg eCwgaHBvcywgdnBvcywgbHNsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlw aF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICAg ICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEu eC0+Y3Vyc29yX2djLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgIFhTZXRCYWNrZ3JvdW5k IChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIHhnY3Yu YmFja2dyb3VuZCk7CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgfQorICAg ICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IGZh bHNlOworICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBE UkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywgbHNsLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29y X2djX3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0JB UjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxz bC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sg YGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAgZi0+b3V0cHV0 X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJz b3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IHRydWU7CisgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9j dXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vy c29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1 cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBl bHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29r YXlfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJp eCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNp YmxlX29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2Ug TUNfSEJBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAw ICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBo aWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAgZi0+ b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgYm9v bCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IHRydWU7CisgICAgICAgICAgbWNfeF9kcmF3 X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdk LCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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+dHlwZSA9PSBTVFJFVENIX0dMWVBIKTsKKyAgaWYgKHMtPmhsID09IERSQVdf Q1VSU09SCisgICAgICAmJiAheF9zdHJldGNoX2N1cnNvcl9wKQorICAgIHsKKyAgICAgIC8qIElm IGB4LXN0cmV0Y2gtY3Vyc29yJyBpcyBuaWwsIGRvbid0IGRyYXcgYSBibG9jayBjdXJzb3IgYXMg d2lkZSBhcyB0aGUKKyAgICAgIHN0cmV0Y2ggZ2x5cGguICovCisgICAgICBpbnQgd2lkdGgsIGJh Y2tncm91bmRfd2lkdGggPSBzLT5iYWNrZ3JvdW5kX3dpZHRoOworICAgICAgaW50IHggPSBzLT54 OworICAgICAgaWYgKCFzLT5yb3ctPnJldmVyc2VkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBp bnQgbGVmdF94ID0gd2luZG93X2JveF9sZWZ0X29mZnNldCAocy0+dywgVEVYVF9BUkVBKTsKKyAg ICAgICAgICBpZiAoeCA8IGxlZnRfeCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgYmFj a2dyb3VuZF93aWR0aCAtPSBsZWZ0X3ggLSB4OworICAgICAgICAgICAgICB4ID0gbGVmdF94Owor ICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAg ICAgICAgICAvKiBJbiBSMkwgcm93cywgZHJhdyB0aGUgY3Vyc29yIG9uIHRoZSByaWdodCBlZGdl IG9mIHRoZQorICAgICAgICAgICAgICAgc3RyZXRjaCBnbHlwaC4gKi8KKyAgICAgICAgICAgIGlu dCByaWdodF94ID0gd2luZG93X2JveF9yaWdodCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAgICAg ICAgIGlmICh4ICsgYmFja2dyb3VuZF93aWR0aCA+IHJpZ2h0X3gpCisgICAgICAgICAgICAgIGJh Y2tncm91bmRfd2lkdGggLT0geCAtIHJpZ2h0X3g7CisgICAgICAgICAgICB4ICs9IGJhY2tncm91 bmRfd2lkdGg7CisgICAgICAgICAgfQorICAgICAgd2lkdGggPSBtaW4gKEZSQU1FX0NPTFVNTl9X SURUSCAocy0+ZiksIGJhY2tncm91bmRfd2lkdGgpOworICAgICAgaWYgKHMtPnJvdy0+cmV2ZXJz ZWRfcCkKKyAgICAgICAgeCAtPSB3aWR0aDsKKyAgICAgIC8qIERyYXcgY3Vyc29yLiAqLworICAg ICAgeF9kcmF3X2dseXBoX3N0cmluZ19iZ19yZWN0IChzLCB4LCBzLT55LCB3aWR0aCwgcy0+aGVp Z2h0KTsKKyAgICAgIC8qIENsZWFyIHJlc3QgdXNpbmcgdGhlIEdDIG9mIHRoZSBvcmlnaW5hbCBu b24tY3Vyc29yIGZhY2UuICovCisgICAgICBpZiAod2lkdGggPCBiYWNrZ3JvdW5kX3dpZHRoKQor ICAgICAgICB7CisgICAgICAgICAgaW50IHkgPSBzLT55OworICAgICAgICAgIGludCB3ID0gYmFj a2dyb3VuZF93aWR0aCAtIHdpZHRoLCBoID0gcy0+aGVpZ2h0OworICAgICAgICAgIFhSZWN0YW5n bGUgcjsKKyAgICAgICAgICBHQyBnYzsKKyAgICAgICAgICBpZiAoIXMtPnJvdy0+cmV2ZXJzZWRf cCkKKyAgICAgICAgICAgIHggKz0gd2lkdGg7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAg eCA9IHMtPng7CisgICAgICAgICAgaWYgKHMtPnJvdy0+bW91c2VfZmFjZV9wCisgICAgICAgICAg ICAgICYmIGN1cnNvcl9pbl9tb3VzZV9mYWNlX3AgKHMtPncpKQorICAgICAgICAgICAgeworICAg ICAgICAgICAgICB4X3NldF9tb3VzZV9mYWNlX2djIChzKTsKKyAgICAgICAgICAgICAgZ2MgPSBz LT5nYzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBnYyA9IHMt PmZhY2UtPmdjOworICAgICAgICAgIGdldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCAmcik7 CisgICAgICAgICAgeF9zZXRfY2xpcF9yZWN0YW5nbGVzIChzLT5mLCBnYywgJnIsIDEpOworICAg ICAgICAgIGlmIChzLT5mYWNlLT5zdGlwcGxlKQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICAvKiBGaWxsIGJhY2tncm91bmQgd2l0aCBhIHN0aXBwbGUgcGF0dGVybi4gKi8KKyAgICAgICAg ICAgICAgWFNldEZpbGxTdHlsZSAocy0+ZGlzcGxheSwgZ2MsIEZpbGxPcGFxdWVTdGlwcGxlZCk7 CisgICAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIGdjLCB4LCB5LCB3LCBoKTsK KyAgICAgICAgICAgICAgWFNldEZpbGxTdHlsZSAocy0+ZGlzcGxheSwgZ2MsIEZpbGxTb2xpZCk7 CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICBYR0NWYWx1ZXMgeGdjdjsKKyAgICAgICAgICAgICAgWEdldEdDVmFsdWVzIChzLT5kaXNw bGF5LCBnYywgR0NGb3JlZ3JvdW5kIHwgR0NCYWNrZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAg ICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBnYywgeGdjdi5iYWNrZ3JvdW5kKTsKKyAg ICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAocy0+ZiwgZ2MsIHgsIHksIHcsIGgpOworICAg ICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgZ2MsIHhnY3YuZm9yZWdyb3Vu ZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgeF9yZXNldF9jbGlwX3JlY3RhbmdsZXMgKHMt PmYsIGdjKTsKKyAgICAgICAgfQorICAgIH0KKyAgZWxzZSBpZiAoIXMtPmJhY2tncm91bmRfZmls bGVkX3ApCisgICAgeworICAgICAgaW50IGJhY2tncm91bmRfd2lkdGggPSBzLT5iYWNrZ3JvdW5k X3dpZ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fZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKG5leHQsIHRydWUpOworICAgICAgICAg ICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICB9CisgICAgfQorICAvKiBTZXQgdXAg Uy0+Z2MsIHNldCBjbGlwcGluZyBhbmQgZHJhdyBTLiAqLworICBtY194X3NldF9nbHlwaF9zdHJp bmdfZ2MgKHMsIGN1cnNvcl9nY19wKTsKKyAgLyogRHJhdyByZWxpZWYgKGlmIGFueSkgaW4gYWR2 YW5jZSBmb3IgY2hhci9jb21wb3NpdGlvbiBzbyB0aGF0IHRoZQorICAgICBnbHlwaCBzdHJpbmcg Y2FuIGJlIGRyYXduIG92ZXIgaXQuICovCisgIGlmICghcy0+Zm9yX292ZXJsYXBzCisgICAgICAm JiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gKKyAgICAgICYmIChzLT5maXJzdF9nbHlwaC0+ dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICAgfHwgcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0g Q09NUE9TSVRFX0dMWVBIKSkKKyAgICB7CisgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBp bmcgKHMpOworICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19iYWNrZ3JvdW5kIChzLCB0cnVlKTsK KyAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYm94IChzKTsKKyAgICAgIHhfc2V0X2dseXBoX3N0 cmluZ19jbGlwcGluZyAocyk7CisgICAgICByZWxpZWZfZHJhd25fcCA9IHRydWU7CisgICAgfQor ICAgIGVsc2UgaWYgKCFzLT5jbGlwX2hlYWQgLyogZHJhd19nbHlwaHMgZGlkbid0IHNwZWNpZnkg YSBjbGlwIG1hc2suICovCisgICAgICAgICAgICAgJiYgIXMtPmNsaXBfdGFpbAorICAgICAgICAg ICAgICYmICgocy0+cHJldiAmJiBzLT5wcmV2LT5obCAhPSBzLT5obCAmJiBzLT5s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hd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7Cisg ICAgICBicmVhazsKKyAgICBjYXNlIENPTVBPU0lURV9HTFlQSDoKKyAgICAgIGlmIChzLT5mb3Jf b3ZlcmxhcHMgfHwgKHMtPmNtcF9mcm9tID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0b21hdGljKSkKKyAgICAgICAgcy0+YmFj a2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlw aF9zdHJpbmdfYmFja2dyb3VuZCAocywgdHJ1ZSk7CisgICAgICB4X2RyYXdfY29tcG9zaXRlX2ds eXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgR0xZUEhM RVNTX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcykKKyAgICAgICAgcy0+YmFja2dy b3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9z dHJpbmdfYmFja2dyb3VuZCAocywgdHJ1ZSk7CisgICAgICB4X2RyYXdfZ2x5cGhsZXNzX2dseXBo X3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAg ICBlbWFjc19hYm9ydCAoKTsKKyAgICB9CisgIGlmICghcy0+Zm9yX292ZXJsYXBzKQorICAgIHsK KyAgICAgIC8qIERyYXcgdW5kZXJsaW5lLiAqLworICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGlu ZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09 IEZBQ0VfVU5ERVJfV0FWRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKHMtPmZh Y2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICB4X2RyYXdfdW5kZXJ3 YXZlIChzKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAgICAgICAgICAgWEdldEdDVmFsdWVz IChzLT5kaXNwbGF5LCBzLT5nYywgR0NGb3JlZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAg ICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHMtPmZhY2UtPnVuZGVybGlu ZV9jb2xvcik7CisgICAgICAgICAgICAgICAgICB4X2RyYXdfdW5kZXJ3YXZlIChzKTsKKyAgICAg ICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBzLT5nYywgeGdjdi5mb3Jl Z3JvdW5kKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxz ZSBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247 CisgICAgICAgICAgICAgIGludCB5OworICAgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5w cmV2LT5mYWNlLT51bmRlcmxpbmVfcAorICAgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+ZmFj ZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgIC8qIFdlIHVzZSB0aGUgc2FtZSB1bmRlcmxpbmUgc3R5bGUgYXMg dGhlIHByZXZpb3VzIG9uZS4gKi8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPnBy ZXYtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMt PnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhl IHVuZGVybGluZSB0aGlja25lc3MuICBEZWZhdWx0IGlzIDEgcGl4ZWwuICovCisgICAgICAgICAg ICAgICAgICBpZiAocy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkK KyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNr bmVzczsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tu ZXNzID0gMTsKKyAgICAgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50X2xp bmUpCisgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIHRoaWNrbmVz cykgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5l IHBvc2l0aW9uLiAgVGhpcyBpcyB0aGUgcmVjb21tZW5kZWQKKyAgICAgICAgICAgICAgICAgICAg ICAgICB2ZXJ0aWNhbCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRoZSB0 b3Agb2YKKyAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBpcyBh IHNpZ25lZCB2YWx1ZSBhY2NvcmRpbmcgdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAg c3BlY3MsIGFuZCBpdHMgZGVmYXVsdCBpcworICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5E ICgobWF4aW11bSBkZXNjZW50KSAvIDIpLCB3aXRoCisgICAgICAgICAgICAgICAgICAgICAgICAg Uk9VTkQoeCkgPSBmbG9vciAoeCArIDAuNSkgICovCisgICAgICAgICAgICAgICAgICAgICAgaWYg KHhfdXNlX3VuZGVybGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVzCisgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49IDApCisg ICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPmZvbnQtPnVuZGVybGluZV9wb3Np dGlvbjsKKyAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChzLT5mb250KQorICAgICAgICAg ICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+Zm9udC0+ZGVzY2VudCArIDEpIC8gMjsKKyAg ICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlv biA9IHVuZGVybGluZV9taW5pbXVtX29mZnNldDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICAgICAgcG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWluaW11 bV9vZmZzZXQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyogQ2hlY2sgdGhl IHNhbml0eSBvZiB0aGlja25lc3MgYW5kIHBvc2l0aW9uLiAgV2Ugc2hvdWxkCisgICAgICAgICAg ICAgICAgIGF2b2lkIGRyYXdpbmcgdW5kZXJsaW5lIG91dCBvZiB0aGUgY3VycmVudCBsaW5lIGFy ZWEuICovCisgICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDw9IHMtPnliYXNlICsg cG9zaXRpb24pCisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gMSkgLSAo cy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPCBz LT55YmFzZSArIHBvc2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAgICAgIHRoaWNrbmVz cyA9IChzLT55ICsgcy0+aGVpZ2h0KSAtIChzLT55YmFzZSArIHBvc2l0aW9uKTsKKyAgICAgICAg ICAgICAgcy0+dW5kZXJsaW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAgICAg cy0+dW5kZXJsaW5lX3Bvc2l0aW9uID0gcG9zaXRpb247CisgICAgICAgICAgICAgIHkgPSBzLT55 YmFzZSArIHBvc2l0aW9uOworICAgICAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX2Rl ZmF1bHRlZF9wKQorICAgICAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdj LCBzLT54LCB5LCBzLT53aWR0aCwgdGhpY2tuZXNzKTsKKyAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAg ICAgICAgICAgICAgWEdldEdDVmFsdWVzIChzLT5kaXNwbGF5LCBzLT5nYywgR0NGb3JlZ3JvdW5k LCAmeGdjdik7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwg cy0+Z2MsIHMtPmZhY2UtPnVuZGVybGluZV9jb2xvcik7CisgICAgICAgICAgICAgICAgICB4X2Zp bGxfcmVjdGFuZ2xlIChzLT5mLCBzLT5nYywgcy0+eCwgeSwgcy0+d2lkdGgsIHRoaWNrbmVzcyk7 CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHhn Y3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAg ICB9CisgICAgICAvKiBEcmF3IG92ZXJsaW5lLiAqLworICAgICAgaWYgKHMtPmZhY2UtPm92ZXJs aW5lX3ApCisgICAgICAgIHsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIGR5ID0gMCwgaCA9IDE7 CisgICAgICAgICAgaWYgKHMtPmZhY2UtPm92ZXJsaW5lX2NvbG9yX2RlZmF1bHRlZF9wKQorICAg ICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAocy0+Ziwgcy0+Z2MsIHMtPngsIHMtPnkgKyBkeSwg cy0+d2lkdGgsIGgpOworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgWEdDVmFsdWVzIHhnY3Y7CisgICAgICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAocy0+ZGlzcGxh eSwgcy0+Z2MsIEdDRm9yZWdyb3VuZCwgJnhnY3YpOworICAgICAgICAgICAgICBYU2V0Rm9yZWdy b3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHMtPmZhY2UtPm92ZXJsaW5lX2NvbG9yKTsKKyAgICAg ICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAocy0+Ziwgcy0+Z2MsIHMtPngsIHMtPnkgKyBkeSwg cy0+d2lkdGgsIGgpOworICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwg cy0+Z2MsIHhnY3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAg IC8qIERyYXcgc3RyaWtlLXRocm91Z2guICovCisgICAgICBpZiAocy0+ZmFjZS0+c3RyaWtlX3Ro cm91Z2hfcCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgaCA9IDE7CisgICAg ICAgICAgdW5zaWduZWQgbG9uZyBkeSA9IChzLT5oZWlnaHQgLSBoKSAvIDI7CisgICAgICAgICAg aWYgKHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICAg ICAgeF9maWxsX3JlY3RhbmdsZSAocy0+Ziwgcy0+Z2MsIHMtPngsIHMtPnkgKyBkeSwgcy0+d2lk dGgsIGgpOworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgWEdD VmFsdWVzIHhnY3Y7CisgICAgICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAocy0+ZGlzcGxheSwgcy0+ Z2MsIEdDRm9yZWdyb3VuZCwgJnhnY3YpOworICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAo cy0+ZGlzcGxheSwgcy0+Z2MsIHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX2NvbG9yKTsKKyAgICAg ICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAocy0+Ziwgcy0+Z2MsIHMtPngsIHMtPnkgKyBkeSwg cy0+d2lkdGgsIGgpOworICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwg cy0+Z2MsIHhnY3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAg IC8qIERyYXcgcmVsaWVmIGlmIG5vdCB5ZXQgZHJhd24uICovCisgICAgICBpZiAoIXJlbGllZl9k cmF3bl9wICYmIHMtPmZhY2UtPmJveCAhPSBGQUNFX05PX0JPWCkKKyAgICAgICAgICB4X2RyYXdf Z2x5cGhfc3RyaW5nX2JveCAocyk7CisgICAgICBpZiAocy0+cHJldikKKyAgICAgICAgeworICAg ICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKnByZXY7CisgICAgICAgICAgZm9yIChwcmV2ID0g cy0+cHJldjsgcHJldjsgcHJldiA9IHByZXYtPnByZXYpCisgICAgICAgICAgICBpZiAocHJldi0+ aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAgICAmJiBwcmV2LT54ICsgcHJldi0+d2lkdGggKyBw cmV2LT5yaWdodF9vdmVyaGFuZyA+IHMtPngpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAvKiBBcyBwcmV2IHdhcyBkcmF3biB3aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwg d2UKKyAgICAgICAgICAgICAgICAgICBtdXN0IGRyYXcgdGhlIHJpZ2h0X292ZXJoYW5nIHBhcnQg dXNpbmcgcy0+aGwgbm93LiAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFj ZSBzYXZlID0gcHJldi0+aGw7CisgICAgICAgICAgICAgICAgcHJldi0+aGwgPSBzLT5obDsKKyAg ICAgICAgICAgICAgICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHByZXYsIGN1cnNvcl9nY19w KTsKKyAgICAgICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAo cywgcHJldik7CisgICAgICAgICAgICAgICAgaWYgKHByZXYtPmZpcnN0X2dseXBoLT50eXBlID09 IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVn cm91bmQgKHByZXYpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHhf ZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAg ICAgICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChwcmV2LT5mLCBwcmV2LT5nYyk7CisgICAg ICAgICAgICAgICAgcHJldi0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIHByZXYtPm51bV9j bGlwcyA9IDA7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHMtPm5leHQp CisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpuZXh0OworICAgICAg ICAgIGZvciAobmV4dCA9IHMtPm5leHQ7IG5leHQ7IG5leHQgPSBuZXh0LT5uZXh0KQorICAgICAg ICAgICAgaWYgKG5leHQtPmhsICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYgbmV4dC0+eCAt IG5leHQtPmxlZnRfb3ZlcmhhbmcgPCBzLT54ICsgcy0+d2lkdGgpCisgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAvKiBBcyBuZXh0IHdpbGwgYmUgZHJhd24gd2hpbGUgY2xpcHBlZCB0 byBpdHMgb3duIGFyZWEsCisgICAgICAgICAgICAgICAgICAgd2UgbXVzdCBkcmF3IHRoZSBsZWZ0 X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwgbm93LiAqLworICAgICAgICAgICAgICAgIGVudW0g ZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gbmV4dC0+aGw7CisgICAgICAgICAgICAgICAgbmV4dC0+ aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKG5l eHQsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xp cHBpbmdfZXhhY3RseSAocywgbmV4dCk7CisgICAgICAgICAgICAgICAgaWYgKG5leHQtPmZpcnN0 X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5 cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5l eHQpOworICAgICAgICAgICAgICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChuZXh0LT5mLCBu ZXh0LT5nYyk7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzYXZlOworICAgICAgICAgICAg ICAgIG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgICAgbmV4dC0+Y2xpcF9oZWFk ID0gcy0+bmV4dDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAvKiBSZXNl dCBjbGlwcGluZy4gKi8KKyAgeF9yZXNldF9jbGlwX3JlY3RhbmdsZXMgKHMtPmYsIHMtPmdjKTsK KyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qIERlZmF1bHQgdG8gdXNpbmcgWElNIGlmIGF2 YWlsYWJsZS4gICovCiAjaWZkZWYgVVNFX1hJTQogYm9vbCB1c2VfeGltID0gdHJ1ZTsKQEAgLTk5 OSw2ICsxODc4LDE1IEBAIHhfdXBkYXRlX2JlZ2luIChzdHJ1Y3QgZnJhbWUgKmYpCiAgIGlmIChG UkFNRV9UT09MVElQX1AgKGYpICYmICFGUkFNRV9WSVNJQkxFX1AgKGYpKQogICAgIHJldHVybjsK IAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICBmLT5tY191cGRhdGluZ19mcmFtZSA9IGY7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICAgaWYgKCEgRlJBTUVfQ1JfU1VSRkFDRSAoZikpCiAgICAgewogICAgICAgaW50IHdpZHRo LCBoZWlnaHQ7CkBAIC0xMjY2LDYgKzIxNTQsMTYgQEAgeF91cGRhdGVfZW5kIChzdHJ1Y3QgZnJh bWUgKmYpCiAgIFhGbHVzaCAoRlJBTUVfWF9ESVNQTEFZIChmKSk7CiAgIHVuYmxvY2tfaW5wdXQg KCk7CiAjZW5kaWYKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIH0KIAogLyogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgZnJvbSB2 YXJpb3VzIHBsYWNlcyBpbiB4ZGlzcC5jCkBAIC0xMzEwMCw2ICsxMzk5OCwyMSBAQCB4X2FjdGl2 YXRlX3RpbWVvdXRfYXRpbWVyICh2b2lkKQogCiBzdGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRl cmZhY2UgeF9yZWRpc3BsYXlfaW50ZXJmYWNlID0KICAgeworCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBgcmVkaXNwbGF5X2ludGVyZmFj ZScgaW4gYHh0ZXJtLmNgIG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitg cmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfeF93cml0 ZV9nbHlwaHMsCisgIG1jX3hfZHJhd193aW5kb3dfY3Vyc29yLAorICBtY194X2RyYXdfZ2x5cGhf c3RyaW5nLAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgeF9mcmFtZV9wYXJt X2hhbmRsZXJzLAogICAgIHhfcHJvZHVjZV9nbHlwaHMsCiAgICAgeF93cml0ZV9nbHlwaHMsCg== --Multipart_Sun_Jun_16_01:07:46_2019-1--