From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.bugs Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). Date: Sun, 02 Jun 2019 00:29:09 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sun_Jun__2_00:29:09_2019-1" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="25380"; 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 02 09:30:34 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hXKwq-0002pY-Dt for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Jun 2019 09:30:34 +0200 Original-Received: from localhost ([127.0.0.1]:46013 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hXKwp-0006JW-Ad for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Jun 2019 03:30:31 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39734) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hXKwY-0006IA-8O for bug-gnu-emacs@gnu.org; Sun, 02 Jun 2019 03:30:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hXKwU-0002GT-9o for bug-gnu-emacs@gnu.org; Sun, 02 Jun 2019 03:30:14 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54019) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hXKwO-0002Bv-Ps for bug-gnu-emacs@gnu.org; Sun, 02 Jun 2019 03:30:07 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hXKwO-00052i-CR for bug-gnu-emacs@gnu.org; Sun, 02 Jun 2019 03:30:04 -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, 02 Jun 2019 07:30:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs Original-Received: via spool by 22873-submit@debbugs.gnu.org id=B22873.155946056019293 (code B ref 22873); Sun, 02 Jun 2019 07:30:04 +0000 Original-Received: (at 22873) by debbugs.gnu.org; 2 Jun 2019 07:29:20 +0000 Original-Received: from localhost ([127.0.0.1]:39329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hXKve-000515-UB for submit@debbugs.gnu.org; Sun, 02 Jun 2019 03:29:20 -0400 Original-Received: from gateway23.websitewelcome.com ([192.185.50.107]:11680) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hXKvc-00050r-NA for 22873@debbugs.gnu.org; Sun, 02 Jun 2019 03:29:17 -0400 Original-Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 44095380F for <22873@debbugs.gnu.org>; Sun, 2 Jun 2019 02:29:16 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id XKvbhp6JU4FKpXKvbh9d7C; Sun, 02 Jun 2019 02:29:16 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=xdKPWoIP9DPA4m9JVbM7j+E0XdpZThNJ3aMdELUnFzk=; b=gW6MKiXIYC+iuFGG+oTZ0R+qjR zJHU2IPdxiBFL7alJBqMumY5aOeHKJywxuEcvO6o4tCj1XuzR9gITm/MOlfSeF43P7rLiePw9G2qC j5xBfQw6yQRayGo4Y+lfxbjhkezkfFFCqH18QfXwjloh8tTIawb+5ouBIW/X6KcWbGBDApStmCfEg k925/fbp5UwpgclajEqvJRTt/bkTduwm3xh3Fe1v7tKy0mlp6EM8YKe8RL4ewcemhJvT17z6B973R 4yu5U0fOfQfnk0RSXkZJUjVmJu7RFrmhy6LVamT928u8nmuvSHRePkuaoABBLQaXTxsuzn2VFA9Bi PeDJw9nA==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:51715 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from ) id 1hXKvW-002wzU-QN; Sun, 02 Jun 2019 02:29:14 -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: 1hXKvW-002wzU-QN X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:51715 X-Source-Auth: lawlist X-Email-Count: 7 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit@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:160021 Archived-At: --Multipart_Sun_Jun__2_00:29:09_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 021.000 [06/01/2019] CHANGELOG: - Added a new feature to visually distinguish with user-defined colors when a fake cursor is on a screen line containing _only_ ZV, or subsequent to a screen line containing _only_ ZV, or all screen lines prior to a line containing _only_ ZV (if such a line exists), which includes a screen line that has characters and ends at ZV (i.e., no final new line). SCREENSHOT -- DARK BACKGROUND: https://lawlist.com/images/22873_17684__2019_06_01_dark_bg.png SCREENSHOT -- LIGHT BACKGROUND: https://lawlist.com/images/22873_17684__2019_06_01_light_bg.png - `free_window_matrices': Added a call to free the fake cursor cache matrices. - Tweaked how colors are assigned for the MC_FRAMED_BOX when at region begin, region end, and in between region begin/end. - Fixed a crash caused by NULL glyph when attempting to cache coordinates for a right fringe bitmap when cursor is exactly at the right fringe. When coordinates for the real cursor do not correlate to an actual glyph, we use the last glyph of the current row instead. - Fixed a crash caused by using the built-in region begin/end function, which failed when Fmarker_position returned a NULL Lisp_Object -- leading to one of those hard to debug bugs; i.e., when garbage collection chokes due to a NULL Lisp_Object. `mc_region_limit' is now used instead. - Fixed a bug caused by a failure to have a `fill_column_trump_p` test at the tail end of `mc_update_text_area' which is used to suppress the vertical crosshairs ruler when the fill column indicator trumps at that exact X. - NS port: Fixed a bug relating to `mc_ns_draw_overwritten' drawing fake cursors outside of the clipped area when dealing with STRETCH_GLYPH. - NS port: Created a workaround to deal with the `row->clip' inhibiting the drawing of glyphs on the box family of fake cursors in certain circumstances. [More work needs to be done, but will likely require help from Emacs Devel.] SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 04/08/2019: git reset --hard a038df77de7b1aa2d73a6478493b8838b59e4982 Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed")))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out the crosshairs feature, type: M-x +-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, install that package first. [If the multiple-cursors package is installed, an eval-after-load "multiple-cursors-core" statement within `crosshairs.el` will redefine a couple of functions and set up a few keyboard shortcuts.] If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors)) TODO: - `ns_draw_window_cursor' calls `ns_clip_to_rect', which does _not_ take `row->clip` into consideration when drawing cursors with `NSRectFill'. When it comes time to draw glyphs on top of the box/hollow family of cursors, `row->clip` is taken into consideration by `get_glyph_string_clip'. Fake cursors can be drawn even though the glyphs cannot, resulting in hollow/box family of cursors without text. The issue can be reproduced with M-x mc-test. [A temporary workaround is to disable `row->clip` while drawing the glyphs.] https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00009.html - Add additional support for `ch_inactive_windows' and `fc_inactive_windows' when the variables have a `nil` value. In such a case, the inactive windows should not display the crosshairs and/or visible fill column indicator. At the present time, fake cursors are drawn in active/inactive windows alike. - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - Is there any additional meaningful optimization that can be added to the three calls of `mc_pre_scroll_clean'? - NOTE: As to `mc_scrolling_window', it would appear that there is no tangible benefit to rotating the current/prospective cache of fake cursors to compare the data before removing the fake cursors. When scrolling the display, only _some_ lines are copied to new locations. Areas that are not overwritten may have fake cursors and those may not necessarily be removed if desired/current matrix glyphs are equal. The test for `GLYPH_EQUAL_P' does not take into consideration the existence of a fake cursor, and the glyph (with a fake cursor) may not be updated as a result thereof. As to lines that are not copied, portions may be updated and fake cursors would be removed thereby. - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create an minimal working example and file a bug report. - There is a bug affecting an older version of Emacs for the NS port that causes partial line flickering when the same characters are grouped together (;;;;;;) and MC_GLYPHLESS cursors are above or below -- having the same background color as the frame; e.g., black on black (used to erase a glyphless cursor). The partial flickering is only noticeable with rapid fire; e.g., holding down the right/left arrow key. When changing the color of the glyphless cursor, the issue is not present. [@lawlist has verified that the X and HPOS coordinates are accurate.] - There is a bug affecting the recorded `w->mc.lnum_pixel_width` that is observable when not running under gdb, but disappears when running under gdb. While viewing a folded org-mode buffer, the non-gdb instance had a visible line number pixel-width of 44, but Emacs treated it as fluctuating between 44 and 55 as the cursor was moved to the end of line. In the gdb instance, the visible line number pixel width was 55 with no fluctuation under the same conditions as the non-gdb instance. This appears to be a different bug than bug#32177 (current line number shifts one column to the left) because the line number of the current line does not shift left, and changing the bidi settings did not correct the issue. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. --Multipart_Sun_Jun__2_00:29:09_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_06_01__22_47_04_513.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zYmJkNjk3Ci0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI4MiBAQAorOzs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Cis7OzsgQkVHSU4gbW9kaWZpY2F0aW9uIG9mIHRoZSBNdWx0aXBsZSBDdXJzb3Jz IGxpYnJhcnkgd3JpdHRlbiBieSAgTWFnbmFyIFN2ZWVuLgorCisoZGVmdmFyIHBhY2thZ2UtYXJj aGl2ZXMpCisKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsKQorKGRlZnZhciBtYy9t YXgtY3Vyc29ycykKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsKQorKGRlZnZhciBt Yy9tYXgtY3Vyc29ycykKKyhkZWZ2YXIgbWMvYWx3YXlzLXJ1bi1mb3ItYWxsKQorKGRlZnZhciBt Yy0tdGhpcy1jb21tYW5kKQorKGRlZnZhciBtYy9jbWRzLXRvLXJ1bi1vbmNlKQorKGRlZnZhciBt Yy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1mb3ItYWxsKQorKGRlZnZhciBtYy9jbWRzLXRvLXJ1bi1m b3ItYWxsKQorKG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ciBhIG5ldywgdGVtcG9yYXJ5IG1heGlt dW06ICIpKQorICAgICAgICAgIChtYy9yZW1vdmUtZmFrZS1jdXJzb3JzKQorICAgICAgICAgIChl cnJvciAiQWJvcnRlZDogdG9vIG1hbnkgY3Vyc29ycyIpKSkpCisgICAgKGxldCAoKG92ZXJsYXkK KyAgICAgICAgICAgIChpZiBtYy91c2UtYnVpbHQtaW4tY3Vyc29ycworICAgICAgICAgICAgICAo bWFrZS1vdmVybGF5IChwb2ludCkgKHBvaW50KSkKKyAgICAgICAgICAgICAgKG1jL21ha2UtY3Vy c29yLW92ZXJsYXktYXQtcG9pbnQpKSkpCisgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAnbWMt aWQgKG9yIGlkIChtYy9jcmVhdGUtY3Vyc29yLWlkKSkpCisgICAgICAob3ZlcmxheS1wdXQgb3Zl cmxheSAndHlwZSAnZmFrZS1jdXJzb3IpCisgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAncHJp b3JpdHkgMTAwKQorICAgICAgKG1jL3N0b3JlLWN1cnJlbnQtc3RhdGUtaW4tb3ZlcmxheSBvdmVy bGF5KQorICAgICAgKHdoZW4gKHVzZS1yZWdpb24tcCkKKyAgICAgICAgKG92ZXJsYXktcHV0IG92 ZXJsYXkgJ3JlZ2lvbi1vdmVybGF5CisgICAgICAgICAgICAgICAgICAgICAobWMvbWFrZS1yZWdp b24tb3ZlcmxheS1iZXR3ZWVuLXBvaW50LWFuZC1tYXJrKSkpCisgICAgICBvdmVybGF5KSkKKwor ICAoZGVmdW4gbWMvZXhlY3V0ZS1jb21tYW5kLWZvci1hbGwtZmFrZS1jdXJzb3JzIChjbWQpCisg ICAgIkNhbGxzIENNRCBpbnRlcmFjdGl2ZWx5IGZvciBlYWNoIGN1cnNvci4KKyAgSXQgd29ya3Mg YnkgbW92aW5nIHBvaW50IHRvIHRoZSBmYWtlIGN1cnNvciwgc2V0dGluZworICB1cCB0aGUgcHJv cGVyIGVudmlyb25tZW50L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CBzdXBwb3J0 ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4g KGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3Qg KG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1j L2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMv YWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2Nt ZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMv cHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29y cyBvcmlnaW5hbC1jb21tYW5kKSkpKQorICAgICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQt aW4tY3Vyc29ycworICAgICAgICAgICAgICAgIChzZXRxIG1jLWNvbmYKKyAgICAgICAgICAgICAg ICAg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3RvciBieSA2NTUzNS4iCisoaW50ZXJhY3RpdmUpCisgIChsZXQgKChidWZmZXIg KGdldC1idWZmZXItY3JlYXRlICIqTUMtVEVTVCoiKSkpCisgICAgKHdpdGgtY3VycmVudC1idWZm ZXIgYnVmZmVyCisgICAgICAoZXJhc2UtYnVmZmVyKQorICAgICAgKGluc2VydCAiVGhpcyBpcyBh IHRlc3QhIikKKyAgICAgIChzZXRxIG1jLWNvbmYgJygoMSAiaGJhciIgIm1hZ2VudGEiKQorICAg ICAgICAgICAgICAgICAgICAgICgyICJiYXIiICJwdXJwbGUiKQorICAgICAgICAgICAgICAgICAg ICAgICgzICJib3giICIjMDBGRjAwIikKKyAgICAgICAgICAgICAgICAgICAgICAoNCAiaG9sbG93 IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAgICAgKDUgKCJoYmFyIiAzKSBbMS4wIDAu MCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAzKSBbMC4wIDEuMCAxLjBd KQorICAgICAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFuZ2VSZWQiKQorICAgICAg ICAgICAgICAgICAgICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAgICAgICAgICAgICAgICAg ICg5ICJib3giICJncmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93IChkaXNwbGF5LWJ1ZmZl ciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2luY2UgdGhpcyBmaXJlcyBn bG9iYWxseSwgd2UgbXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jvc3NoYWlycyBhcHBlYXIg aW4uIgorICAod2hlbiArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVtcSBsYXN0LWNvbW1hbmQg Ky1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVsbCArLXBhcmVucy1wKSkK KyAgICAgICgrLXBhcmVucy1mbikpCisgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgIChzZXRx IHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1pZGxlLWxpc3QpKQorICAg ICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkpKQorCisoZGVmdW4gKy1kcmF3LWZvcnRod2l0aCAo KQorIkltbWVkaWF0ZWx5IGRlbGV0ZS9kcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzLiIKKyAgKCst ZHJhdy1jcm9zc2hhaXJzICdmb3JjZSkpCisKKyhkZWZ1biArLWRyYXctY3Jvc3NoYWlycyAoJm9w dGlvbmFsIGZvcmNlKQorIkltbWVkaWF0ZWx5IGRlbGV0ZSBtYXRjaGluZyBwYXJlbnRoZXNlcy4g IElmIEZPUkNFIGlzIG5vbi1uaWwsIHRoZW4gaW1tZWRpYXRlbHkKK2RyYXcgbWF0Y2hpbmcgcGFy ZW50aGVzaXM7IG90aGVyd2lzZSwgZHJhdyB0aGVtIG9uIGFuIGlkbGUtdGllci4iCisgICh3aGVu ICstbW9kZQorICAgICh3aGVuICstdGltZXItdmFyCisgICAgICAoc2V0cSB0aW1lci1pZGxlLWxp c3QgKGRlbHEgKy10aW1lci12YXIgdGltZXItaWRsZS1saXN0KSkKKyAgICAgIChzZXRxICstdGlt ZXItdmFyIG5pbCkpCisgICAgKHVubGVzcyAob3IgKG1lbXEgdGhpcy1jb21tYW5kICstcGFyZW5z LWV4Y2x1c2lvbnMpCisgICAgICAgICAgICAgICAgKGFuZCAobnVsbCArLXBhcmVucy1wKQorICAg ICAgICAgICAgICAgICAgICAgKG51bGwgKy1wYXJlbnMtb3ZlcmxheXMtZXhpc3QtcCkpKQorICAg ICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZvcmNlCisgICAgICAocHJv Z24KKyAgICAgICAgKHdoZW4gKy1wYXJlbnMtcAorICAgICAgICAgICgrLXBhcmVucy1mbikpKQor ICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGltZXIgKy1pZGxlLXRpbWVy LXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKyhkZWZ2YXIgZmMtbW9kZSkKKworOzs7 IyMjYXV0b2xvYWQKKyhkZWZpbmUtbWlub3ItbW9kZSArLW1vZGUKKyJNaW5vciBtb2RlIGZvciBk aXNwbGF5aW5nIGEgaG9yaXpvbnRhbCBydWxlci4iCisgIDppbml0LXZhbHVlIG5pbAorICA6bGln aHRlciAiICsiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisgIDpncm91cCAnKy1tb2Rl CisgIChjb25kCisgICAgKCstbW9kZQorICAgICAgOzs7IGArLW1vZGUnIGhhcyB0aGUgYWJpbGl0 eSB0byBhbHNvIGRpc3BsYXkgYSBmaWxsIGNvbHVtbiBpbmRpY2F0b3IuCisgICAgICA7OzsgU2Vl IHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuCisgICAgICAod2hlbiBmYy1tb2RlCisgICAg ICAgIChmYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFsLWVsZG9jLW1vZGUKKyAg ICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgICAg ICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAgKGdsb2JhbC1l bGRvYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2stY29udGV4dC10aW1lcgor ICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAo dGltZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciBq aXQtbG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEgaml0LWxvY2stY29udGV4 dC10aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAnaml0LWxvY2stY29udGV4 dC1mb250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4dC10aW1lciBuaWwpKQor ICAgICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAo dGltZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQorICAgICAgICAgIChjYW5j ZWwtdGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpKQorICAgICAgICAoZnNl dCAndW5kby1hdXRvLS11bmRvYWJsZS1jaGFuZ2UKKyAgICAgICAgICAgICAgKGxhbWJkYSAoKSAo YWRkLXRvLWxpc3QgJ3VuZG8tYXV0by0tdW5kb2FibHktY2hhbmdlZC1idWZmZXJzIChjdXJyZW50 LWJ1ZmZlcikpKSkKKyAgICAgICAgKGZzZXQgJ3VuZG8tYXV0by1hbWFsZ2FtYXRlICdpZ25vcmUp KQorICAgICAgKHdoZW4gYmxpbmstY3Vyc29yLW1vZGUKKyAgICAgICAgKGJsaW5rLWN1cnNvci1t b2RlIC0xKQorICAgICAgICAod2hlbiAobWVtcSAnYmxpbmstY3Vyc29yLWNoZWNrIHBvc3QtY29t bWFuZC1ob29rKQorICAgICAgICAgIChyZW1vdmUtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJ2Js aW5rLWN1cnNvci1jaGVjaykpKQorICAgICAgKHNldHEgY3Jvc3NoYWlycyB0KQorICAgICAgKHdo ZW4gKy1maWxsLWNvbHVtbgorICAgICAgICAoc2V0cSBmYy12aXNpYmxlIHQpKQorICAgICAgOzs7 IGB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Y2F0b3ItYWxpc3QKKyAgICAgICAgICAgICAgICAgICAgIHRhYi13 aWR0aAorICAgICAgICAgICAgICAgICAgICAgbGluZS1tb3ZlLXZpc3VhbAorICAgICAgICAgICAg ICAgICAgICAgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgICAgICAgICAgICAgIHRydW5jYXRlLXBh cnRpYWwtd2lkdGgtd2luZG93cworICAgICAgICAgICAgICAgICAgICAgd29yZC13cmFwKSkKKyAg ICAgICAgKHdoZW4gKGxvY2FsLXZhcmlhYmxlLXAgdmFyKQorICAgICAgICAgIChwdXNoIChjb25z IHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICstLXNhdmVkLXN0YXRlKSkpCisgICAgICAoc2V0cSBm aWxsLWNvbHVtbiA4MCkKKyAgICAgIChzZXRxIGRpc3BsYXktbGluZS1udW1iZXJzIHQpCisgICAg ICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1saW5lKQorICAgICAgKHNl dHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAoc2V0cSBidWZmZXItZGlzcGxheS10YWJs ZSArLWJ1ZmZlci1kaXNwbGF5LXRhYmxlKQorICAgICAgKHNldHEgdGFiLXdpZHRoIDQpCisgICAg ICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlzdWFsKSB0KQorICAgICAg KHNldHEgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKGxldCAoKGxz dCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisgICAgICAgICAgICAgICAgICBtb2Rl KQorICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAgICAod2hpbGUgKHNldHEg bW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAgICAgKHdoZW4gKGRlcml2ZWQtbW9kZS1wIG1v ZGUpCisgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkpKSkKKyAgICAgICAgICAg KChtZW1xIG1ham9yLW1vZGUgKy10cnVuY2F0ZS1saW5lcy1tYWpvci1tb2RlcykpCisgICAgICAg ICAgICh0CisgICAgICAgICAgICAgbmlsKSkpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlh YmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRvd3MpIG5pbCkKKyAgICAgIChzZXRxIHdv cmQtd3JhcCB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGluZXMgdCkKKyAgICAgIChz ZXRxIGluZGljYXRlLWJ1ZmZlci1ib3VuZGFyaWVzICdsZWZ0KQorICAgICAgKHNldHEgZnJpbmdl LWluZGljYXRvci1hbGlzdAorICAgICAgICAgIDs7OyBoc2NsX2FsbF90ZW1wX3AgfCBoc2NsX3Rl bXBfcAorICAgICAgICAnKCgrLWhzY2wtdGVtcCAuICgrLXNpbmdsZS1hbmdsZS1sZWZ0CisgICAg ICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLWxlZnQpKQorICAgICAgICAgIDs7 OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxsX3Blcm1fMV9wIHwgaHNjbF9hbGxfcGVybV8y X3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICgrLWhzY2wtcGVybSAuICgrLXNpbmdsZS1hbmds ZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1hbmdsZS11cAorICAgICAg ICAgICAgICAgICAgICAgICAgICArLXRyaXBsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAg ICAgICAgICArLXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAgKCstb3ZlcmxheS1hcnJv dyAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAr LWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAgKHRydW5jYXRpb24gLiAoKy1mcmluZ2Ut bGVmdC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJpZ2h0LWFycm93 KSkKKyAgICAgICAgICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxlZnQtY3VybHktYXJyb3cK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNoKSkKKyAgICAgICAgICAob3Zl cmxheS1hcnJvdyAuICstZnJpbmdlLXJpZ2h0LXRyaWFuZ2xlKQorICAgICAgICAgICh1cCAuICst ZnJpbmdlLXVwLWFycm93KQorICAgICAgICAgIChkb3duIC4gKy1mcmluZ2UtZG93bi1hcnJvdykK KyAgICAgICAgICAodG9wIC4gKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUpCisgICAgICAgICAgKGJv dHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAgICAgICAodG9wLWJvdHRv bSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICArLWZy aW5nZS1yaWdodC1icmFja2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtdG9w LXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtdG9wLWxlZnQt YW5nbGUpKQorICAgICAgICAgIChlbXB0eS1saW5lIC4gKy1mcmluZ2UtZW1wdHktbGluZSkKKyAg ICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmspKSkKKyAgICAgIChzZXRx IGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94IC4gKy1mcmluZ2UtbGVmdC10cmlhbmdsZSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaG9sbG93IC4gKy1ob2xsb3ctcmVjdGFu Z2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChiYXIgLiArLXZlcnRpY2Fs LWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaGJhciAuICstZnJpbmdl LWhvcml6b250YWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChob2xs b3ctc21hbGwgLiArLWZyaW5nZS1ob2xsb3ctc3F1YXJlKSkpCisgICAgICAoaWYgKG9yICstZm9y dGh3aXRoCisgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisg ICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJhdy1mb3J0aHdpdGggJ2Fw cGVuZCAnbG9jYWwpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJh dy1jcm9zc2hhaXJzICdhcHBlbmQgJ2xvY2FsKSkKKyAgICAgICh3aGVuICstZm9ydGh3aXRoCisg ICAgICAgIChhZGQtaG9vayAnd2luZG93LWNvbmZpZ3VyYXRpb24tY2hhbmdlLWhvb2sgJystZHJh dy1mb3J0aHdpdGggbmlsICdsb2NhbCkpCisgICAgICAoYWRkLWhvb2sgJ2NoYW5nZS1tYWpvci1t b2RlLWhvb2sgJ3R1cm4tb2ZmLSstbW9kZSBuaWwgJ2xvY2FsKQorICAgICAgKHdoZW4gKGNhbGxl ZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKy1mb3J0 aHdpdGgKKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScgLS0gRHJhdyBt YXRjaGluZyBwYXJlbnRoZXNlcyBpbW1lZGlhdGVseS4iKSkKKyAgICAgICAgICAoKGVxdWFsIGN1 cnJlbnQtcHJlZml4LWFyZyAnKDQpKQorICAgICAgICAgICAgOzs7IE1hdGNoaW5nIHBhcmVudGhl c2VzIHdpbGwgYmUgZHJhd24gaW1tZWRpYXRlbHkuCisgICAgICAgICAgICAob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ktbGluZXMpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnaW5k aWNhdGUtYnVmZmVyLWJvdW5kYXJpZXMpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnZnJp bmdlLWluZGljYXRvci1hbGlzdCkKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdmcmluZ2Ut Y3Vyc29yLWFsaXN0KQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJytmb3J0aHdpdGgpCisg ICAgICAoZG9saXN0IChzYXZlZCArLS1zYXZlZC1zdGF0ZSkKKyAgICAgICAgKHNldCAobWFrZS1s b2NhbC12YXJpYWJsZSAoY2FyIHNhdmVkKSkgKGNkciBzYXZlZCkpKQorICAgICAgKGtpbGwtbG9j YWwtdmFyaWFibGUgJystLXNhdmVkLXN0YXRlKQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVy bGF5cykKKyAgICAgICh3aGVuIChtZW1xICcrLWRyYXctZm9ydGh3aXRoIHBvc3QtY29tbWFuZC1o b29rKQorICAgICAgICAocmVtb3ZlLWhvb2sgJ3Bvc3QtY29tbWFuZC1ob29rICcrLWRyYXctZm9y dGh3aXRoICdsb2NhbCkpCisgICAgICAod2hlbiAobWVtcSAnKy1kcmF3LWNyb3NzaGFpcnMgcG9z dC1jb21tYW5kLWhvb2spCisgICAgICAgIChyZW1vdmUtaG9vayAncG9zdC1jb21tYW5kLWhvb2sg JystZHJhdy1jcm9zc2hhaXJzICdsb2NhbCkpCisgICAgICAod2hlbiAobWVtcSAnKy1kcmF3LWZv cnRod2l0aCB3aW5kb3ctY29uZmlndXJhdGlvbi1jaGFuZ2UtaG9vaykKKyAgICAgICAgKHJlbW92 ZS1ob29rICd3aW5kb3ctY29uZmlndXJhdGlvbi1jaGFuZ2UtaG9vayAnKy1kcmF3LWZvcnRod2l0 aCAnbG9jYWwpKQorICAgICAgKHJlbW92ZS1ob29rICdjaGFuZ2UtbWFqb3ItbW9kZS1ob29rICd0 dXJuLW9mZi0rLW1vZGUgJ2xvY2FsKQorICAgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgICAg KHNldHEgdGltZXItaWRsZS1saXN0IChkZWxxICstdGltZXItdmFyIHRpbWVyLWlkbGUtbGlzdCkp CisgICAgICAgIChzZXRxICstdGltZXItdmFyIG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWlu dGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAobWVzc2FnZSAiVHVybmVkIE9GRiBgKy1tb2Rl Jy4iKSkpKSkKKworKGRlZnVuIHR1cm4tb2ZmLSstbW9kZSAoKQorICAoKy1tb2RlIC0xKSkKKwor Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7CisKKyhkZWZ1biArLXBhcmVucy1mbiAoKQorICAiRG9j LXN0cmluZy4iCisgIChsZXQqICgob3BvaW50IChwb2ludCkpCisgICAgICAgICAoZnJvbSAoaWYg Ky1wYXJlbnMtZnJvbS1mbgorICAgICAgICAgICAgICAgICAoZnVuY2FsbCArLXBhcmVucy1mcm9t LWZuKQorICAgICAgICAgICAgICAgICAocG9pbnQtbWluKSkpCisgICAgICAgICAod2luIChzZWxl Y3RlZC13aW5kb3cpKQorICAgICAgICAgKGkgMCkKKyAgICAgICAgIChwcmVjZWRpbmctY2hhciAo cHJlY2VkaW5nLWNoYXIpKQorICAgICAgICAgKG9jaGFyIChjaGFyLWFmdGVyIG9wb2ludCkpCisg ICAgICAgICAocG9zMQorICAgICAgICAgICAoY29uZAorICAgICAgICAgICAgICgoYW5kIG9jaGFy CisgICAgICAgICAgICAgICAgICAgKG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDApID0+IG9wZW5p bmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgNDApCisgICAg ICAgICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgOTEpID0+IG9wZW5pbmcgc3F1 YXJlIGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgOTEpCisgICAgICAg ICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgMTIzKSA9PiBvcGVuaW5nIHdhdnkg YnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAoPSBvY2hhciAxMjMpKSkKKyAgICAgICAg ICAgICAgICAobWluICgxKyBvcG9pbnQpIChwb2ludC1tYXgpKSkKKyAgICAgICAgICAgICAoKG9y IDs7OyAoY2hhci10by1zdHJpbmcgNDEpID0+IGNsb3NpbmcgcGFyZW50aGVzaXMKKyAgICAgICAg ICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDQxKQorICAgICAgICAgICAgICAgICAgOzs7IChj aGFyLXRvLXN0cmluZyA5MykgPT4gY2xvc2luZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAg ICAgICAgKD0gcHJlY2VkaW5nLWNoYXIgOTMpCisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXIt dG8tc3RyaW5nIDEyNSkgPT4gY2xvc2luZyB3YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAg ICg9IHByZWNlZGluZy1jaGFyIDEyNSkpCisgICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWlu KSAoMS0gb3BvaW50KSkpCisgICAgICAgICAgICAgKHQKKyAgICAgICAgICAgICAgICBvcG9pbnQp KSkKKyAgICAgICAgIHBvczIKKyAgICAgICAgIHNlbGVjdGVkLWZhY2UpCisgICAgKHNhdmUtZXhj dXJzaW9uCisgICAgICAoY29uZGl0aW9uLWNhc2UgbmlsCisgICAgICAgICh3aGlsZSAoc2V0cSBw b3MxIChudGggMSAocGFyc2UtcGFydGlhbC1zZXhwIGZyb20gcG9zMSkpKQorICAgICAgICAgIChz ZXRxIHBvczIgKHNjYW4tc2V4cHMgcG9zMSAxKSkKKyAgICAgICAgICAoaWYgKD0gaSAxMCkKKyAg ICAgICAgICAgIChzZXRxIGkgMSkKKyAgICAgICAgICAgIChzZXRxIGkgKDErIGkpKSkKKyAgICAg ICAgICAoc2V0cSBzZWxlY3RlZC1mYWNlIChjb25kCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICgoPSBpIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFy ZW5zLW9uZS1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAyKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10d28tZmFjZSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgMykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtdGhyZWUtZmFjZSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKCg9IGkgNCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAnKy1wYXJlbnMtZm91ci1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo KD0gaSA1KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1maXZl LWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDYpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXNpeC1mYWNlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA3KQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICcrLXBhcmVucy1zZXZlbi1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoKD0gaSA4KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBh cmVucy1laWdodC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA5 KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1uaW5lLWZhY2Up CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEwKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10ZW4tZmFjZSkpKQorICAgICAgICAgIChs ZXQgKChvdiAobWFrZS1vdmVybGF5IHBvczEgKDErIHBvczEpKSkpCisgICAgICAgICAgICAodW5s ZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRvd3MKKyAgICAgICAgICAgICAgKG92ZXJsYXktcHV0 IG92ICd3aW5kb3cgd2luKSkKKyAgICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBzZWxl Y3RlZC1mYWNlKSkKKyAgICAgICAgICAod2hlbiBwb3MyCisgICAgICAgICAgICAobGV0ICgob3Yg KG1ha2Utb3ZlcmxheSAoMS0gcG9zMikgcG9zMikpKQorICAgICAgICAgICAgICAodW5sZXNzICst cGFyZW5zLWluYWN0aXZlLXdpbmRvd3MKKyAgICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3Yg J3dpbmRvdyB3aW4pKQorICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0 ZWQtZmFjZSkpKSkKKyAgICAgICAgKGVycm9yIG5pbCkpKQorICAgIChzZXRxICstcGFyZW5zLW92 ZXJsYXlzLWV4aXN0LXAgdCkpKQorCisoZGVmdW4gKy1yZW1vdmUtb3ZlcmxheXMgKGJlZyBlbmQg bmFtZSB2YWwpCisiUmVtb3ZlIHRoZSBvdmVybGF5cyB0aGF0IGFyZSBgZXF1YWwtaW5jbHVkaW5n LXByb3BlcnRpZXNgLgorSW5jbHVkZXMgYSB1bmlxdWUgc2l0dWF0aW9uIHdoZW4gYW4gb3Zlcmxh eSB3aXRoIGFuIGAnYWZ0ZXItc3RyaW5nYCBwcm9wZXJ0eQoraXMgYXQgdGhlIHZlcnkgZW5kIG9m IGEgbmFycm93ZWQtYnVmZmVyLiIKKyAgKGxldCogKChwb2ludC1tYXggKHBvaW50LW1heCkpCisg ICAgICAgICAocG9pbnQtbWluIChwb2ludC1taW4pKQorICAgICAgICAgKG5hcnJvd2VkLXAgKGJ1 ZmZlci1uYXJyb3dlZC1wKSkKKyAgICAgICAgIChiZWcgKGlmIGJlZyBiZWcgcG9pbnQtbWluKSkK KyAgICAgICAgIChlbmQKKyAgICAgICAgICAgKGNvbmQKKyAgICAgICAgICAgICAoKGFuZAorICAg ICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAgICAgICAgICAgICAgIGVuZCkKKyAg ICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAo bm90IG5hcnJvd2VkLXApCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAg ICAgICBwb2ludC1tYXgpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFy cm93ZWQtcAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKDwgZW5kIHBv aW50LW1heCkpCisgICAgICAgICAgICAgICBlbmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAg ICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAg ICAgICAgKD0gZW5kIHBvaW50LW1heCkpCisgICAgICAgICAgICAgICAoMSsgZW5kKSkKKyAgICAg ICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAg ICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICAoMSsgcG9pbnQtbWF4KSkgKSkKKyAgICAg ICAgIChvdmVybGF5cworICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAgICAob3ZlcmxheS1y ZWNlbnRlciBlbmQpCisgICAgICAgICAgICAgKG92ZXJsYXlzLWluIGJlZyBlbmQpKSkpCisgICAg KHdoZW4gKGFuZCBiZWcgZW5kIG5hbWUgdmFsKQorICAgICAgKGRvbGlzdCAobyBvdmVybGF5cykK KyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKGFuZCAoZXEgbmFtZSAnZmFjZSkKKyAgICAgICAg ICAgICAgICAoZXEgKG92ZXJsYXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIDs7IEVp dGhlciBwdXNoIHRoaXMgb3ZlcmxheSBvdXRzaWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsg b3Igc3BsaXQgaXQgdG8gZXhjbHVkZSBiZWcuLi5lbmQKKyAgICAgICAgICAgIDs7IG9yIGRlbGV0 ZSBpdCBlbnRpcmVseSAoaWYgaXQgaXMgY29udGFpbmVkIGluIGJlZy4uLmVuZCkuCisgICAgICAg ICAgICAoaWYgKDwgKG92ZXJsYXktc3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAgIChpZiAo PiAob3ZlcmxheS1lbmQgbykgZW5kKQorICAgICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAg ICAgICAobW92ZS1vdmVybGF5IChjb3B5LW92ZXJsYXkgbykKKyAgICAgICAgICAgICAgICAgIChv dmVybGF5LXN0YXJ0IG8pIGJlZykKKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5k IChvdmVybGF5LWVuZCBvKSkpCisgICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gKG92 ZXJsYXktc3RhcnQgbykgYmVnKSkKKyAgICAgICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBv KSBlbmQpCisgICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVu ZCBvKSkKKyAgICAgICAgICAgICAgICAoZGVsZXRlLW92ZXJsYXkgbykpKSkKKyAgICAgICAgICAo KGFuZCAobm90IChlc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mFsLWVsZG9jLW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBq aXQtbG9jay1jb250ZXh0LXRpbWVyCisgICAgICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3Rp dmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcg Jyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAg ICAgICAgICAoY2FuY2VsLXRpbWVyIGppdC1sb2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7 OyAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAn cmVwZWF0ICdqaXQtbG9jay1jb250ZXh0LWZvbnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9j ay1jb250ZXh0LXRpbWVyIG5pbCkpCisgICAgICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3Rp dmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcg Jyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnkt dGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFy eS10aW1lcikpCisgICAgICAgIChmc2V0ICd1bmRvLWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAg ICAgICAgICAgICAobGFtYmRhICgpIChhZGQtdG8tbGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1j aGFuZ2VkLWJ1ZmZlcnMgKGN1cnJlbnQtYnVmZmVyKSkpKQorICAgICAgICAoZnNldCAndW5kby1h dXRvLWFtYWxnYW1hdGUgJ2lnbm9yZSkpCisgICAgICAod2hlbiBibGluay1jdXJzb3ItbW9kZQor ICAgICAgICAoYmxpbmstY3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ZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1iYXItcG9zdC16 di1mYWNlCisgICcoKHQgKDpmb3JlZ3JvdW5kICJtYWdlbnRhNCIpKSkKKyAgIkZhY2UgZm9yIGAr LWJhci1wb3N0LXp2LWZhY2UnLiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICstcmV2 ZXJzZWQtYmFyLXByZS16di1mYWNlCisgICcoKHQgKDpmb3JlZ3JvdW5kICJjeWFuMSIpKSkKKyAg IkZhY2UgZm9yIGArLXJldmVyc2VkLWJhci1wcmUtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9k ZSkKKworKGRlZmZhY2UgKy1yZXZlcnNlZC1iYXItYXQtenYtZmFjZQorICAnKCh0ICg6Zm9yZWdy b3VuZCAiY2hhcnRyZXVzZSIpKSkKKyAgIkZhY2UgZm9yIGArLXJldmVyc2VkLWJhci1hdC16di1m YWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSArLXJldmVyc2VkLWJhci1wb3N0 LXp2LWZhY2UKKyAgJygodCAoOmZvcmVncm91bmQgImN5YW40IikpKQorICAiRmFjZSBmb3IgYCst cmV2ZXJzZWQtYmFyLXBvc3QtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZh Y2UgKy1ldmVuLXByZS16di1mYWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4 KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInllbGxvdyIpCisgICAgKCgo Y2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpm b3JlZ3JvdW5kICJjeWFuMSIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAo YmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInllbGxvdyIpC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3MgY29sb3IpIChtaW4tY29sb3JzIDE2 KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICIjZmY2MzQ3IikKKyAgICAo KChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgOCkpCisgICAgIDpmb3JlZ3JvdW5kICJ3aGl0ZSIp CisgICAgKCgodHlwZSB0dHkpIChjbGFzcyBtb25vKSkKKyAgICAgOmludmVyc2UtdmlkZW8gdCkK KyAgICAodCA6Zm9yZWdyb3VuZCAicGluayIpKQorICAiRmFjZSBmb3IgYCstb2RkLWluYWN0aXZl LXByZS16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSArLW9kZC1hdC16 di1mYWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBk YXJrKSkKKyAgICAgOmZvcmVncm91bmQgIlN0ZWVsQmx1ZTMiKQorICAgICgoKGNsYXNzIGNvbG9y KSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAi U3RlZWxCbHVlMyIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dy b3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgIlN0ZWVsQmx1ZTMiKQorICAgICgoKGNsYXNz IGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdy b3VuZCAiU3RlZWxCbHVlMyIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQor ICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9ubykp CisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91bmQgInBpbmsiKSkKKyAg IkZhY2UgZm9yIGArL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dW5kICJEYXJrU2FsbW9u IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5kIGRhcmsp KQorICAgICA6Zm9yZWdyb3VuZCAic2llbm5hMSIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4t Y29sb3JzIDE2KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJEYXJrU2Fs bW9uIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgOCkpCisgICAgIDpmb3JlZ3Jv dW5kICJ3aGl0ZSIpCisgICAgKCgodHlwZSB0dHkpIChjbGFzcyBtb25vKSkKKyAgICAgOmludmVy c2UtdmlkZW8gdCkKKyAgICAodCA6Zm9yZWdyb3VuZCAicGluayIpKQorICAiRmFjZSBmb3IgYCst b2RkLXBvc3QtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1vZGQt aW5hY3RpdmUtcG9zdC16di1mYWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4 KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6 Zm9yZWdyb3VuZCAic2llbm5hNCIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2 KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6 Zm9yZWdyb3VuZCAic2llbm5hNCIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDgp KQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9u bykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91bmQgInBpbmsiKSkK KyAgIkZhY2UgZm9yIGArLW9kZC1pbmFjdGl2ZS1wb3N0LXp2LWZhY2UnLiIKKyAgOmdyb3VwICcr LW1vZGUpCisKKyhkZWZmYWNlICstcG9zdC1maWxsLXByZS16di1mYWNlCisgICcoKCgoY2xhc3Mg Y29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91 bmQgImdyZWVuMSIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dy b3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJncmVlbjEiKQorICAgICgoKGNsYXNzIGNv bG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5k ICJncmVlbjEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91 bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAiZ3JlZW4xIikKKyAgICAoKChjbGFzcyBjb2xv cikgKG1pbi1jb2xvcnMgOCkpCisgICAgIDpmb3JlZ3JvdW5kICJ3aGl0ZSIpCisgICAgKCgodHlw ZSB0dHkpIChjbGFzcyBtb25vKSkKKyAgICAgOmludmVyc2UtdmlkZW8gdCkKKyAgICAodCA6Zm9y ZWdyb3VuZCAicGluayIpKQorICAiRmFjZSBmb3IgYCstcG9zdC1maWxsLXByZS16di1mYWNlJy4i CisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSArLXBvc3QtZmlsbC1pbmFjdGl2ZS1wcmUt enYtZmFjZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQg ZG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B2YWw7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiBzdGF0aWMgdm9pZAogYnNldF9hYmJyZXZfbW9kZSAoc3RydWN0 IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQogewpAQCAtNTE0Miw2ICs1MjA1LDI0IEBAIGlu aXRfYnVmZmVyX29uY2UgKHZvaWQpCiAgIGJzZXRfbGFzdF9zZWxlY3RlZF93aW5kb3cgKCZidWZm ZXJfbG9jYWxfZmxhZ3MsIG1ha2VfZml4bnVtICgwKSk7CiAKICAgaWR4ID0gMTsKKworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBYU0VURkFT VElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbWNfcmVhbF9mYWtlX2N1cnNvciksIGlk eCk7ICsraWR4OworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbWNf Y29uZiksIGlkeCk7ICsraWR4OworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9m bGFncywgbWNfaW5hY3RpdmVfd2luZG93cyksIGlkeCk7ICsraWR4OworICBYU0VURkFTVElOVCAo QlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgY3Jvc3NoYWlycyksIGlkeCk7ICsraWR4OworICBY U0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgY2hfaG9yaXpvbnRhbF9ydWxl ciksIGlkeCk7ICsraWR4OworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFn cywgY2hfdmVydGljYWxfcnVsZXIpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIg KCZidWZmZXJfbG9jYWxfZmxhZ3MsIGNoX2luYWN0aXZlX3dpbmRvd3MpLCBpZHgpOyArK2lkeDsK KyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIGZjX3Zpc2libGUpLCBp ZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIGZj X2luYWN0aXZlX3dpbmRvd3MpLCBpZHgpOyArK2lkeDsKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbW9kZV9s aW5lX2Zvcm1hdCksIGlkeCk7ICsraWR4OwogICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9s b2NhbF9mbGFncywgYWJicmV2X21vZGUpLCBpZHgpOyArK2lkeDsKICAgWFNFVEZBU1RJTlQgKEJW QVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG92ZXJ3cml0ZV9tb2RlKSwgaWR4KTsgKytpZHg7CkBA IC01MjI4LDYgKzUzMDksMjQgQEAgaW5pdF9idWZmZXJfb25jZSAodm9pZCkKICAgLyogTXVzdCBk byB0aGVzZSBiZWZvcmUgbWFraW5nIHRoZSBmaXJzdCBidWZmZXIhICovCiAKICAgLyogcmVhbCBz ZXR1cCBpcyBkb25lIGluIGJpbmRpbmdzLmVsICovCisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgYnNldF9tY19yZWFsX2Zha2Vf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NyYy9idWZmZXIuaAorKysgYi9zcmMvYnVm ZmVyLmgKQEAgLTczNiw2ICs3MzYsNDAgQEAgc3RydWN0IGJ1ZmZlcgogICAgICBpbiB0aGUgZGlz cGxheSBvZiB0aGlzIGJ1ZmZlci4gICovCiAgIExpc3BfT2JqZWN0IGV4dHJhX2xpbmVfc3BhY2lu Z187CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgLyogVGhlIGN1cnNvciB0eXBlIG9mIHRoZSByZWFsIGZha2UgY3Vyc29yLiAqLworICBM aXNwX09iamVjdCBtY19yZWFsX2Zha2VfY3Vyc29yXzsKKworICAvKiBUaGUgbmFtZSBvZiBsaXN0 IHVzZWQgYnkgbXVsdGlwbGUgY3Vyc29ycyBmb3IgbmV4dCByZWRpc3BsYXkuICovCisgIExpc3Bf T2JqZWN0IG1jX2NvbmZfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBtdWx0aXBsZSBjdXJzb3Jz IGluIGluYWN0aXZlIHdpbmRvd3MuICovCisgIExpc3BfT2JqZWN0IG1jX2luYWN0aXZlX3dpbmRv d3NfOworCisgIC8qIFRoZSBuYW1lIG9mIHRoZSBidWZmZXItbG9jYWwgdmFyaWFibGUuICovCisg IExpc3BfT2JqZWN0IGNyb3NzaGFpcnNfOworCisgIC8qIFRoZSBuYW1lIG9mIHRoZSBjcm9zc2hh aXJzIGhvcml6b250YWwgcnVsZXIuICovCisgIExpc3BfT2JqZWN0IGNoX2hvcml6b250YWxfcnVs ZXJfOworCisgIC8qIFRoZSBuYW1lIG9mIHRoZSBjcm9zc2hhaXJzIHZlcnRpY2FsIHJ1bGVyLiAq LworICBMaXNwX09iamVjdCBjaF92ZXJ0aWNhbF9ydWxlcl87CisKKyAgLyogV2hldGhlciB0byBk cmF3IGNyb3NzaGFpcnMgaW4gaW5hY3RpdmUgd2luZG93cy4gKi8KKyAgTGlzcF9PYmplY3QgY2hf aW5hY3RpdmVfd2luZG93c187CisKKyAgLyogVGhlIG5hbWUgb2YgdGhlIGJ1ZmZlci1sb2NhbCB2 YXJpYWJsZS4gKi8KKyAgTGlzcF9PYmplY3QgZmNfdmlzaWJsZV87CisKKyAgLyogV2hldGhlciB0 byBkcmF3IG11bHRpcGxlIGN1cnNvcnMgZmlsbCBjb2x1bW4gaW4gaW5hY3RpdmUgd2luZG93cy4g Ki8KKyAgTGlzcF9PYmplY3QgZmNfaW5hY3RpdmVfd2luZG93c187CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKICAgLyogQ3Vyc29yIHR5cGUgdG8gZGlzcGxheSBpbiBub24tc2VsZWN0 ZWQgd2luZG93cy4KICAgICAgdCBtZWFucyB0byB1c2UgaG9sbG93IGJveCBjdXJzb3IuCiAgICAg IFNlZSBgY3Vyc29yLXR5cGUnIGZvciBvdGhlciB2YWx1ZXMuICAqLwpAQCAtNzg3LDE0ICs4MjEs MjEgQEAgc3RydWN0IGJ1ZmZlcgogICAgICBhbiBpbmRpcmVjdCBidWZmZXIgc2luY2UgaXQgY291 bnRzIGFzIGl0cyBiYXNlIGJ1ZmZlci4gICovCiAgIGludCB3aW5kb3dfY291bnQ7CiAKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgLyogQSBu b24temVybyB2YWx1ZSBpbiBzbG90IElEWCBtZWFucyB0aGF0IHBlci1idWZmZXIgdmFyaWFibGUK ICAgICAgd2l0aCBpbmRleCBJRFggaGFzIGEgbG9jYWwgdmFsdWUgaW4gdGhpcyBidWZmZXIuICBU aGUgaW5kZXggSURYCiAgICAgIGZvciBhIGJ1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qYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBiLT5jaF9pbmFj dGl2ZV93aW5kb3dzXyA9IHZhbDsKK30KKworSU5MSU5FIHZvaWQKK2JzZXRfYmx2X2ZjX3Zpc2li bGUgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkKK3sKKyAgYi0+ZmNfdmlzaWJs ZV8gPSB2YWw7Cit9CisKK0lOTElORSB2b2lkCitic2V0X2Jsdl9mY19pbmFjdGl2ZV93aW5kb3dz IChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPmZjX2luYWN0aXZl X3dpbmRvd3NfID0gdmFsOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogSU5MSU5FIHZvaWQKIGJzZXRfYmlkaV9wYXJhZ3JhcGhf ZGlyZWN0aW9uIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCiB7CmRpZmYgLS1n aXQgYS9zcmMvZGlzcGV4dGVybi5oIGIvc3JjL2Rpc3BleHRlcm4uaAppbmRleCAxYTUzNjU2Li5m MWJiZjFkIDEwMDY0NAotLS0gYS9zcmMvZGlzcGV4dGVybi5oCisrKyBiL3NyYy9kaXNwZXh0ZXJu LmgKQEAgLTEwMCw2ICsxMDAsMTE0IEBAIHR5cGVkZWYgaW50IEN1cnNvcjsKICNkZWZpbmUgTmF0 aXZlUmVjdGFuZ2xlIGludAogI2VuZGlmCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK3N0cnVjdCBnbHlwaDsKKworc3RydWN0IGds eXBoX3JvdzsKKworc3RydWN0IGdseXBoX21hdHJpeDsKKworZW51bSBkcmF3X2dseXBoc19mYWNl OworCitlbnVtIGdseXBoX3Jvd19hcmVhOworCitlbnVtIG1jX2NhY2hlX3R5cGU7CisKK2VudW0g bWNfY3Vyc29yX3R5cGU7CisKK2VudW0gbWNfZmxhdm9yOworCitzdHJ1Y3QgbWNfUkdCOworCitz dHJ1Y3QgbWNfZXNzZW50aWFsczsKKworZW51bSBtY19mcm9tX3doZXJlOworCitlbnVtIG1jX2Fj dGlvbl90eXBlOworCitlbnVtIG1jX3Jvd19wb3NpdGlvbjsKKworZXh0ZXJuIExpc3BfT2JqZWN0 IG1jX2xpc3RuIChwdHJkaWZmX3QsIExpc3BfT2JqZWN0LCAuLi4pOworCitleHRlcm4gTGlzcF9P YmplY3QgbWNfbnRoIChpbnQsIExpc3BfT2JqZWN0KTsKKworZXh0ZXJuIExpc3BfT2JqZWN0IG1j X2Fzc3EgKExpc3BfT2JqZWN0LCBMaXNwX09iamVjdCk7CisKK2V4dGVybiBlbnVtIG1jX3Jvd19w b3NpdGlvbiBtY19yb3dfcG9zaXRpb24gKHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKiwgaW50 KTsKKworZXh0ZXJuIHB0cmRpZmZfdCBtY19yZWdpb25fbGltaXQgKGJvb2wpOworCitleHRlcm4g c3RydWN0IGdseXBoICogbWNfZ2V0X2N1cnNvcl9nbHlwaCAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1 Y3QgZ2x5cGhfbWF0cml4ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgc3RydWN0IGdseXBoX3JvdyAqLCBpbnQsIGludCk7CisKK2V4dGVybiB2b2lkIG1jX3h3 X2NvbG9yX3ZhbHVlcyAoc3RydWN0IHdpbmRvdyAqLCBMaXNwX09iamVjdCwgc3RydWN0IG1jX1JH QiAqKTsKKworZXh0ZXJuIGJvb2wgbWNfdXBkYXRlX3dpbmRvd19mcmluZ2VzIChzdHJ1Y3Qgd2lu ZG93ICosIGJvb2wpOworCitleHRlcm4gY2hhciAqIG1jX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAq KTsKKworZXh0ZXJuIGNoYXIgKiBtY19jaGFyX3RvX3N0cmluZyAoaW50KTsKKworZXh0ZXJuIGNo YXIgKiBtY19jdXJzb3JfdHlwZV90b19zdHJpbmcgKGVudW0gbWNfY3Vyc29yX3R5cGUpOworCitl eHRlcm4gY2hhciAqIG1jX2ZsYXZvcl90b19zdHJpbmcgKGVudW0gbWNfZmxhdm9yKTsKKworZXh0 ZXJuIGNoYXIgKiBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAoZW51bSBtY19jYWNoZV90eXBlKTsK KworZXh0ZXJuIHZvaWQgbWNfZHJhd19mcmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICosIHN0 cnVjdCBnbHlwaF9yb3cgKiwgaW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBlbnVtIG1jX2N1cnNvcl90eXBlKTsKKworZXh0ZXJuIGludCBtY19nZXRfZnJpbmdlX2JpdG1h cCAoc3RydWN0IHdpbmRvdyAqLCBMaXNwX09iamVjdCwgaW50LCBpbnQpOworCitleHRlcm4gdm9p ZCBtY19lbmdpbmUgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1 Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqLCBp bnQsIGludCwgaW50LCBpbnQsIGludCwgaW50LAorICAgICAgICAgICAgICAgICAgICAgICBlbnVt IG1jX2N1cnNvcl90eXBlLCBpbnQsIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwgaW50LAorICAgICAg ICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCLCBib29sLCBlbnVtIG1jX2FjdGlvbl90eXBl LCBib29sLAorICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2Zyb21fd2hlcmUsIGVudW0g bWNfY2FjaGVfdHlwZSk7CisKK2V4dGVybiB2b2lkIG1jX3NldF9lc3NlbnRpYWxzIChzdHJ1Y3Qg d2luZG93ICosIHN0cnVjdCBtY19lc3NlbnRpYWxzICopOworCitleHRlcm4gdm9pZCBtY19kcmF3 X3JvdyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlw aF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKiwgaW50LCBp bnQsIGludCwgaW50LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosCisgICAgICAgICAgICAgICAgICAg ICAgICAgc3RydWN0IG1jX2Vzc2VudGlhbHMsIGVudW0gbWNfcm93X3Bvc2l0aW9uLCBib29sLAor ICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfZnJvbV93aGVyZSk7CisKK2V4dGVybiB2 b2lkIG1jX3JlZHJhd19yb3cgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAq LCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGlu dCwgaW50LCBib29sLCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UpOworCitleHRlcm4gdm9pZCBtY19y ZXNldF9jYWNoZSAoc3RydWN0IHdpbmRvdyAqKTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19jdXJz b3JfZ2x5cGggKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKiwgZW51bSBkcmF3 X2dseXBoc19mYWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCwgaW50 LCBpbnQsIHN0cnVjdCBtY19SR0IsIGVudW0gbWNfZmxhdm9yLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCwgYm9vbCwgYm9vbCk7CisK K2V4dGVybiB2b2lkIG1jX2VyYXNlX2N1cnNvciAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5 cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgaW50LCBpbnQsIGludCwgaW50LCBlbnVtIG1jX2ZsYXZvciwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSwgaW50KTsKKworZXh0ZXJuIHZvaWQg bWNfZHJhd19lcmFzZV9oeWJyaWQgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJp eCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgaW50LCBpbnQsIGludCwgaW50LCBpbnQsIGludCwgaW50LCBpbnQsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSwgaW50LCBzdHJ1Y3QgbWNf UkdCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wsIGVudW0gbWNfZmxh dm9yLCBib29sKTsKKworZXh0ZXJuIHZvaWQgbWNfeF93cml0ZV9nbHlwaHMgKHN0cnVjdCB3aW5k b3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICosIGVudW0gZ2x5cGhfcm93X2Fy ZWEsIGludCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGludCwgc3RydWN0 IG1jX1JHQiwgZW51bSBtY19mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ZW51bSBtY19jdXJzb3JfdHlwZSwgaW50LCBib29sLCBib29sLCBib29sKTsKKworZXh0ZXJuIHN0 cnVjdCBnbHlwaF9tYXRyaXggKiBtY19zYXZlX2dseXBoX21hdHJpeCAoc3RydWN0IGdseXBoX21h dHJpeCAqKTsKKworZXh0ZXJuIHZvaWQgbWNfcmVzdG9yZV9nbHlwaF9tYXRyaXggKHN0cnVjdCBn bHlwaF9tYXRyaXggKiwgc3RydWN0IGdseXBoX21hdHJpeCAqKTsKKworLyogZW5kIE1VTFRJUExF LUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qIFRleHQgY3Vyc29y IHR5cGVzLiAgKi8KIAogZW51bSB0ZXh0X2N1cnNvcl9raW5kcwpAQCAtMzgyLDYgKzQ5MCwyMiBA QCBzdHJ1Y3QgZ2x5cGhfc2xpY2UKIAogc3RydWN0IGdseXBoCiB7CisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaW50IHgsIHksIGhwb3Ms IHZwb3M7CisKKyAgaW50IHJlbGF0aXZlX3g7CisKKyAgYm9vbF9iZiB6dl9wIDogMTsKKworICBw dHJkaWZmX3QgYnl0ZXBvczsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBQ b3NpdGlvbiBmcm9tIHdoaWNoIHRoaXMgZ2x5cGggd2FzIGRyYXduLiAgSWYgYG9iamVjdCcgYmVs b3cgaXMgYQogICAgICBMaXNwIHN0cmluZywgdGhpcyBpcyBhbiBpbmRleCBpbnRvIHRoYXQgc3Ry aW5nLiAgSWYgaXQgaXMgYQogICAgICBidWZmZXIsIHRoaXMgaXMgYSBwb3NpdGlvbiBpbiB0aGF0 IGJ1ZmZlci4gIEluIGFkZGl0aW9uLCBzb21lCkBAIC0xMjQ4LDYgKzEzNzIsMjggQEAgZW51bSBk cmF3X2dseXBoc19mYWNlCiAKIHN0cnVjdCBnbHlwaF9zdHJpbmcKIHsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIGJvb2xfYmYgbGVm dF9vdmVyd3JpdHRlbl9wIDogMTsKKworICAgIGJvb2xfYmYgcmlnaHRfb3ZlcndyaXR0ZW5fcCA6 IDE7CisKKyAgICBib29sX2JmIHJlY3RhbmdsZV9udWtlZF9wIDogMTsKKworICAgIGJvb2xfYmYg YmFja2dyb3VuZF9udWtlZF9wIDogMTsKKworICAgIGVudW0gZHJhd19nbHlwaF9hY3Rpb24KKyAg ICB7CisgICAgICBNQ19EUkFXX0dMWVBILAorICAgICAgTUNfRVJBU0VfR0xZUEgKKyAgICB9IGFj dGlvbl90eXBlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFgtb3JpZ2lu IG9mIHRoZSBzdHJpbmcuICAqLwogICBpbnQgeDsKIApAQCAtMjIxNiw2ICsyMzYyLDE2IEBAIHN0 cnVjdCBjb21wb3NpdGlvbl9pdAogCiBzdHJ1Y3QgaXQKIHsKKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBib29sX2JmIHp2X3AgOiAxOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFRoZSB3aW5kb3cgaW4gd2hpY2gg d2UgaXRlcmF0ZSBvdmVyIGN1cnJlbnRfYnVmZmVyIChvciBhIHN0cmluZykuICAqLwogICBMaXNw X09iamVjdCB3aW5kb3c7CiAgIHN0cnVjdCB3aW5kb3cgKnc7CkBAIC0yODEyLDYgKzI5NjgsMzIg QEAgdHlwZWRlZiB2b2lkICgqZnJhbWVfcGFybV9oYW5kbGVyKSAoc3RydWN0IGZyYW1lICosIExp c3BfT2JqZWN0LCBMaXNwX09iamVjdCk7CiAKIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlCiB7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK Ky8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgbnN0ZXJtLm1gIFwgYHczMnRlcm0uY2AgXCBg eHRlcm0uY2AgbXVzdCBiZSBpbiB0aGUKK2V4YWN0IHNhbWUgb3JkZXIgYXMgdGhlIGByZWRpc3Bs YXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4dGVybi5oYCEgKi8KKworICB2b2lkICgqbWNfc2NyaWJl X2dseXBocykgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwg c3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICBzdHJ1Y3QgZ2x5cGggKnN0cmluZywgZW51 bSBnbHlwaF9yb3dfYXJlYSBhcmVhLCBpbnQgbGVuLCBpbnQgdnBvcywKKyAgICAgICAgaW50IGJv dHRvbV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iBIYW5kbGVycyBmb3Igc2V0dGluZyBm cmFtZSBwYXJhbWV0ZXJzLiAgKi8KICAgZnJhbWVfcGFybV9oYW5kbGVyICpmcmFtZV9wYXJtX2hh bmRsZXJzOwogCmRpZmYgLS1naXQgYS9zcmMvZGlzcG5ldy5jIGIvc3JjL2Rpc3BuZXcuYwppbmRl eCBjY2IwOGVjLi4yNTM0ZWE5IDEwMDY0NAotLS0gYS9zcmMvZGlzcG5ldy5jCisrKyBiL3NyYy9k aXNwbmV3LmMKQEAgLTU2LDYgKzU2LDE4NTQgQEAgYWxvbmcgd2l0aCBHTlUgRW1hY3MuICBJZiBu b3QsIHNlZSA8aHR0cHM6Ly93d3cuZ251Lm9yZy9saWNlbnNlcy8+LiAgKi8KICNpbmNsdWRlICJ3 MzIuaCIKICNlbmRpZgogDAorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4g TVVMVElQTEUtQ1VSU09SUyAqLworCisgIHN0cnVjdCBnbHlwaHNfc2tpcHBlZAorICB7CisgICAg cHRyZGlmZl90IGFsbG9jYXRlZDsKKyAgICBwdHJkaWZmX3QgdXNlZDsKKyAgICBzdHJ1Y3Qgc2tp cHBlZF9pdGVtcworICAgICAgeworICAgICAgICBpbnQgeDsKKyAgICAgICAgaW50IGhwb3M7Cisg ICAgICAgIGJvb2wgZW5hYmxlZF9wOworICAgICAgfSAqc2tpcHBlZDsKKyAgfSBhcnJheV9nbHlw aHNfc2tpcHBlZDsKKworc3RhdGljIGJvb2wgdXBkYXRlX3dpbmRvd19saW5lIChzdHJ1Y3Qgd2lu ZG93ICosIGludCwgYm9vbCAqKTsKKworc3RhdGljIHZvaWQgdXBkYXRlX21hcmdpbmFsX2FyZWEg KHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA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cnVuczsKKworc3RhdGljIGJv b2wKK21jX3ZlcmlmeV9yb3dfaGFzaCAoc3RydWN0IGdseXBoX3JvdyAqcm93KQoreworICByZXR1 cm4gcm93LT5oYXNoID09IHJvd19oYXNoIChyb3cpOworfQorCitzdGF0aWMgc3RydWN0IG1jX3Jv d19lbnRyeSAqCittY19hZGRfcm93X2VudHJ5IChzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cpCit7Cisg IHN0cnVjdCBtY19yb3dfZW50cnkgKmVudHJ5OworICBwdHJkaWZmX3QgaSA9IHJvdy0+aGFzaCAl IG1jX3Jvd190YWJsZV9zaXplOworICBlbnRyeSA9IG1jX3Jvd190YWJsZVtpXTsKKyAgZWFzc2Vy dCAoZW50cnkgfHwgbWNfdmVyaWZ5X3Jvd19oYXNoIChyb3cpKTsKKyAgd2hpbGUgKGVudHJ5ICYm ICFyb3dfZXF1YWxfcCAoZW50cnktPnJvdywgcm93LCAxKSkKKyAgICBlbnRyeSA9IGVudHJ5LT5u ZXh0OworICBpZiAoZW50cnkgPT0gTlVMTCkKKyAgICB7CisgICAgICBlbnRyeSA9IG1jX3Jvd19l bnRyeV9wb29sICsgbWNfcm93X2VudHJ5X2lkeCsrOworICAgICAgZW50cnktPnJvdyA9IHJvdzsK KyAgICAgIGVudHJ5LT5vbGRfdXNlcyA9IGVudHJ5LT5uZXdfdXNlcyA9IDA7CisgICAgICBlbnRy eS0+bmV3X2xpbmVfbnVtYmVyID0gMDsKKyAgICAgIGVudHJ5LT5idWNrZXQgPSBpOworICAgICAg ZW50cnktPm5leHQgPSBtY19yb3dfdGFibGVbaV07CisgICAgICBtY19yb3dfdGFibGVbaV0gPSBl bnRyeTsKKyAgICB9CisgIHJldHVybiBlbnRyeTsKK30KKworLyogUmV2ZXJzZSB0aGUgY29udGVu dHMgb2Ygcm93cyBpbiBNQVRSSVggYmV0d2VlbiBTVEFSVCBhbmQgRU5ELiAgVGhlCisgICBjb250 ZW50cyBvZiB0aGUgcm93IGF0IEVOR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gJiYgTUFUUklYX1JPV19CT1RUT01fWSAoYykgPD0geWIK KyAgICAgICAgICAmJiBNQVRSSVhfUk9XX0JPVFRPTV9ZIChkKSA8PSB5YgorICAgICAgICAgICYm IHJvd19lcXVhbF9wIChjLCBkLCAxKSkKKyAgICAgICAgeworICAgICAgICAgIGFzc2lnbl9yb3cg KGMsIGQpOworICAgICAgICAgIGQtPmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICB9CisgICAg ICBlbHNlCisgICAgICAgIGJyZWFrOworICAgIH0KKyNpZmRlZiBIQVZFX1hXSURHRVRTCisgIC8q IEN1cnJlbnRseSB0aGlzIHNlZW1zIG5lZWRlZCB0byBkZXRlY3QgeHdpZGdldCBtb3ZlbWVudCBy ZWxpYWJseS4gKi8KKyAgICByZXR1cm4gMDsKKyNlbmRpZgorICAvKiBHaXZlIHVwIGlmIHNvbWUg cm93cyBpbiB0aGUgZGVzaXJlZCBtYXRyaXggYXJlIG5vdCBlbmFibGVkLiAqLworICBpZiAoISBN QVRSSVhfUk9XX0VOQUJMRURfUCAoZGVzaXJlZF9tYXRyaXgsIGkpKQorICAgIHJldHVybiAtMTsK KyAgZmlyc3Rfb2xkID0gZmlyc3RfbmV3ID0gaTsKKyAgLyogU2V0IGxhc3RfbmV3IHRvIHRoZSBp bmRleCArIDEgb2YgdGhlIHJvdyB0aGF0IHJlYWNoZXMgdGhlCisgICAgIGJvdHRvbSBib3VuZGFy eSBpbiB0aGUgZGVzaXJlZCBtYXRyaXguICBHaXZlIHVwIGlmIHdlIGZpbmQgYQorICAgICBkaXNh YmxlZCByb3cgYmVmb3JlIHdlIHJlYWNoIHRoZSBib3R0b20gYm91bmRhcnkuICovCisgIGkgPSBm aXJzdF9uZXcgKyAxOworICB3aGlsZSAoaSA8IGRlc2lyZWRfbWF0cml4LT5ucm93cyAtIDEpCisg ICAgeworICAgICAgaW50IGJvdHRvbTsKKyAgICAgIGlmICghIE1BVFJJWF9ST1dfRU5BQkxFRF9Q IChkZXNpcmVkX21hdHJpeCwgaSkpCisgICAgICAgIHJldHVybiAwOworICAgICAgYm90dG9tID0g TUFUUklYX1JPV19CT1RUT01fWSAoTUFUUklYX1JPVyAoZGVzaXJlZF9tYXRyaXgsIGkpKTsKKyAg ICAgIGlmIChib3R0b20gPD0geWIpCisgICAgICAgICsraTsKKyAgICAgIGlmIChib3R0b20gPj0g eWIpCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgbGFzdF9uZXcgPSBpOworICAvKiBTZXQgbGFz dF9vbGQgdG8gdGhlIGluZGV4ICsgMSBvZiB0aGUgcm93IHRoYXQgcmVhY2hlcyB0aGUgYm90dG9t CisgICAgIGJvdW5kYXJ5IGluIHRoZSBjdXJyZW50IG1hdHJpeC4gIFdlIGRvbid0IGxvb2sgYXQg dGhlIGVuYWJsZWQKKyAgICAgZmxhZyBoZXJlIGJlY2F1c2Ugd2UgcGxhbiB0byByZXVzZSBwYXJ0 IG9mIHRoZSBkaXNwbGF5IGV2ZW4gaWYKKyAgICAgb3RoZXIgcGFydHMgYXJlIGRpc2FibGVkLiAq LworICBpID0gZmlyc3Rfb2xkICsgMTsKKyAgd2hpbGUgKGkgPCBjdXJyZW50X21hdHJpeC0+bnJv d3MgLSAxKQorICAgIHsKKyAgICAgIGludCBib3R0b20gPSBNQVRSSVhfUk9XX0JPVFRPTV9ZIChN QVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSkpOworICAgICAgaWYgKGJvdHRvbSA8PSB5YikK KyAgICAgICAgKytpOworICAgICAgaWYgKGJvdHRvbSA+PSB5YikKKyAgICAgICAgYnJlYWs7Cisg ICAgfQorICBsYXN0X29sZCA9IGk7CisgIC8qIFNraXAgb3ZlciByb3dzIGVxdWFsIGF0IHRoZSBi b3R0b20uICovCisgIGkgPSBsYXN0X25ldzsKKyAgaiA9IGxhc3Rfb2xkOworICB3aGlsZSAoaSAt IDEgPiBmaXJzdF9uZXcKKyAgICAgICAgICYmIGogLSAxID4gZmlyc3Rfb2xkCisgICAgICAgICAm JiBNQVRSSVhfUk9XX0VOQUJMRURfUCAoY3VycmVudF9tYXRyaXgsIGogLSAxKQorICAgICAgICAg JiYgKE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBqIC0gMSktPnkKKyAgICAgICAgICAgICA9 PSBNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJpeCwgaSAtIDEpLT55KQorICAgICAgICAgJiYgIU1B VFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCBpIC0gMSktPnJlZHJhd19mcmluZ2VfYml0bWFwc19w CisgICAgICAgICAmJiByb3dfZXF1YWxfcCAoTUFUUklYX1JPVyAoZGVzaXJlZF9tYXRyaXgsIGkg LSAxKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJp eCwgaiAtIDEpLCAxKSkKKyAgICAtLWksIC0tajsKKyAgbGFzdF9uZXcgPSBpOworICBsYXN0X29s ZCA9IGo7CisgIC8qIE5vdGhpbmcgdG8gZG8gaWYgYWxsIHJvd3MgYXJlIGVxdWFsLiAqLworICBp ZiAobGFzdF9uZXcgPT0gZmlyc3RfbmV3KQorICAgIHJldHVybiAwOworICAvKiBDaGVjayBmb3Ig aW50ZWdlciBvdmVyZmxvdyBpbiBzaXplIGNhbGN1bGF0aW9uLgorICAgICBJZiBuZXh0X2FsbW9z dF9wcmltZSBjaGVja3MgKE4pIGZvciBkaXZpc2liaWxpdHkgYnkgMi4uMTAsIHRoZW4KKyAgICAg aXQgY2FuIHJldHVybiBhdCBtb3N0IE4gKyAxMCwgZS5nLiwgbmV4dF9hbG1vc3RfcHJpbWUgKDEp ID09IDExLgorICAgICBTbywgc2V0IG5leHRfYWxtb3N0X3ByaW1lX2luY3JlbWVudF9tYXggdG8g MTAuCisgICAgIEl0J3MganVzdCBhIGNvaW5jaWRlbmNlIHRoYXQgbmV4dF9hbG1vc3RfcHJpbWVf aW5jcmVtZW50X21heCA9PQorICAgICBORVhUX0FMTU9TVF9QUklNRV9MSU1JVCAtIDEuICBJZiBO RVhUX0FMTU9TVF9QUklNRV9MSU1JVCB3ZXJlCisgICAgIDEzLCB0aGVuIG5leHRfYWxtb3N0X3By aW1lX2luY3JlbWVudF9tYXggd291bGQgYmUgMTQsIGUuZy4sCisgICAgIGJlY2F1c2UgbmV4dF9h bG1vc3RfcHJpbWUgKDExMykgd291bGQgYmUgMTI3LiAqLworICB7CisgICAgdmVyaWZ5IChORVhU X0FMTU9TVF9QUklNRV9MSU1JVCA9PSAxMSk7CisgICAgZW51bSB7IG5leHRfYWxtb3N0X3ByaW1l X2luY3JlbWVudF9tYXggPSAxMCB9OworICAgIHB0cmRpZmZfdCByb3dfdGFibGVfbWF4ID0KKyAg ICAgIChtaW4gKFBUUkRJRkZfTUFYLCBTSVpFX01BWCkgLyAoMyAqIHNpemVvZiAqbWNfcm93X3Rh YmxlKQorICAgICAgIC0gbmV4dF9hbG1vc3RfcHJpbWVfaW5jcmVtZW50X21heCk7CisgICAgcHRy ZGlmZl90IGN1cnJlbnRfbnJvd3NfbWF4ID0gcm93X3RhYmxlX21heCAtIGRlc2lyZWRfbWF0cml4 LT5ucm93czsKKyAgICBpZiAoY3VycmVudF9ucm93c19tYXggPCBjdXJyZW50X21hdHJpeC0+bnJv d3MpCisgICAgICBtZW1vcnlfZnVsbCAoU0laRV9NQVgpOworICB9CisgIC8qIFJlYWxsb2NhdGUg dmVjdG9ycywgdGFibGVzIGV0Yy4gaWYgbmVjZXNzYXJ5LiAqLworICBpZiAoY3VycmVudF9tYXRy aXgtPm5yb3dzID4gbWNfb2xkX2xpbmVzX3NpemUpCisgICAgbWNfb2xkX2xpbmVzID0geHBhbGxv YyAobWNfb2xkX2xpbmVzLCAmbWNfb2xkX2xpbmVzX3NpemUsCisgICAgICAgICAgICAgICAgICAg ICAgICAgY3VycmVudF9tYXRyaXgtPm5yb3dzIC0gbWNfb2xkX2xpbmVzX3NpemUsCisgICAgICAg ICAgICAgICAgICAgICAgICAgSU5UX01BWCwgc2l6ZW9mICptY19vbGRfbGluZXMpOworICBpZiAo ZGVzaXJlZF9tYXRyaXgtPm5yb3dzID4gbWNfbmV3X2xpbmVzX3NpemUpCisgICAgbWNfbmV3X2xp bmVzID0geHBhbGxvYyAobWNfbmV3X2xpbmVzLCAmbWNfbmV3X2xpbmVzX3NpemUsCisgICAgICAg ICAgICAgICAgICAgICAgICAgZGVzaXJlZF9tYXRyaXgtPm5yb3dzIC0gbWNfbmV3X2xpbmVzX3Np emUsCisgICAgICAgICAgICAgICAgICAgICAgICAgSU5UX01BWCwgc2l6ZW9mICptY19uZXdfbGlu ZXMpOworICBuID0gZGVzaXJlZF9tYXRyaXgtPm5yb3dzOworICBuICs9IGN1cnJlbnRfbWF0cml4 LT5ucm93czsKKyAgaWYgKG1jX3Jvd190YWJsZV9zaXplIDwgMyAqIG4pCisgICAgeworICAgICAg cHRyZGlmZl90IHNpemUgPSBuZXh0X2FsbW9zdF9wcmltZSAoMyAqIG4pOworICAgICAgbWNfcm93 X3RhYmxlID0geG5yZWFsbG9jIChtY19yb3dfdGFibGUsIHNpemUsIHNpemVvZiAqbWNfcm93X3Rh YmxlKTsKKyAgICAgIG1jX3Jvd190YWJsZV9zaXplID0gc2l6ZTsKKyAgICAgIG1lbXNldCAobWNf cm93X3RhYmxlLCAwLCBzaXplICogc2l6ZW9mICptY19yb3dfdGFibGUpOworICAgIH0KKyAgaWYg KG4gPiBtY19yb3dfZW50cnlfcG9vbF9zaXplKQorICAgIG1jX3Jvd19lbnRyeV9wb29sID0geHBh bGxvYyAobWNfcm93X2VudHJ5X3Bvb2wsICZtY19yb3dfZW50cnlfcG9vbF9zaXplLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgbiAtIG1jX3Jvd19lbnRyeV9wb29sX3NpemUsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAtMSwgc2l6ZW9mICptY19yb3dfZW50cnlfcG9vbCk7 CisgIGlmIChkZXNpcmVkX21hdHJpeC0+bnJvd3MgPiBtY19ydW5zX3NpemUpCisgICAgeworICAg ICAgbWNfcnVucyA9IHhucmVhbGxvYyAobWNfcnVucywgZGVzaXJlZF9tYXRyaXgtPm5yb3dzLCBz aXplb2YgKm1jX3J1bnMpOworICAgICAgbWNfcnVuX3Bvb2wgPSB4bnJlYWxsb2MgKG1jX3J1bl9w b29sLCBkZXNpcmVkX21hdHJpeC0+bnJvd3MsIHNpemVvZiAqbWNfcnVuX3Bvb2wpOworICAgICAg bWNfcnVuc19zaXplID0gZGVzaXJlZF9tYXRyaXgtPm5yb3dzOworICAgIH0KKyAgbnJ1bnMgPSBy dW5faWR4ID0gMDsKKyAgbWNfcm93X2VudHJ5X2lkeCA9IDA7CisgIC8qIEFkZCByb3dzIGZyb20g dGhlIGN1cnJlbnQgYW5kIGRlc2lyZWQgbWF0cml4IHRvIHRoZSBoYXNoIHRhYmxlCisgICAgIHJv d19oYXNoX3RhYmxlIHRvIGJlIGFibGUgdG8gZmluZCBlcXVhbCBvbmVzIHF1aWNrbHkuICovCisg IGZvciAoaSA9IGZpcnN0X29sZDsgaSA8IGxhc3Rfb2xkOyArK2kpCisgICAgeworICAgICAgaWYg KE1BVFJJWF9ST1dfRU5BQkxFRF9QIChjdXJyZW50X21hdHJpeCwgaSkpCisgICAgICAgIHsKKyAg ICAgICAgICBlbnRyeSA9IG1jX2FkZF9yb3dfZW50cnkgKE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0 cml4LCBpKSk7CisgICAgICAgICAgbWNfb2xkX2xpbmVzW2ldID0gZW50cnk7CisgICAgICAgICAg KytlbnRyeS0+b2xkX3VzZXM7CisgICAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgICAgbWNfb2xk X2xpbmVzW2ldID0gTlVMTDsKKyAgICB9CisgIGZvciAoaSA9IGZpcnN0X25ldzsgaSA8IGxhc3Rf bmV3OyArK2kpCisgICAgeworICAgICAgZWFzc2VydCAoTUFUUklYX1JPV19FTkFCTEVEX1AgKGRl c2lyZWRfbWF0cml4LCBpKSk7CisgICAgICBlbnRyeSA9IG1jX2FkZF9yb3dfZW50cnkgKE1BVFJJ WF9ST1cgKGRlc2lyZWRfbWF0cml4LCBpKSk7CisgICAgICArK2VudHJ5LT5uZXdfdXNlczsKKyAg ICAgIGVudHJ5LT5uZXdfbGluZV9udW1iZXIgPSBpOworICAgICAgbWNfbmV3X2xpbmVzW2ldID0g ZW50cnk7CisgICAgfQorICAvKiBJZGVudGlmeSBtb3ZlcyBiYXNlZCBvbiBsaW5lcyB0aGF0IGFy ZSB1bmlxdWUgYW5kIGVxdWFsCisgICAgIGluIGJvdGggbWF0cmljZXMuICovCisgIGZvciAoaSA9 IGZpcnN0X29sZDsgaSA8IGxhc3Rfb2xkOykKKyAgICBpZiAobWNfb2xkX2xpbmVzW2ldCisgICAg ICAgICYmIG1jX29sZF9saW5lc1tpXS0+b2xkX3VzZXMgPT0gMQorICAgICAgICAmJiBtY19vbGRf bGluZXNbaV0tPm5ld191c2VzID09IDEpCisgICAgICB7CisgICAgICAgIGludCBwLCBxOworICAg ICAgICBpbnQgbmV3X2xpbmUgPSBtY19vbGRfbGluZXNbaV0tPm5ld19saW5lX251bWJlcjsKKyAg ICAgICAgc3RydWN0IHJ1biAqcnVuID0gbWNfcnVuX3Bvb2wgKyBydW5faWR4Kys7CisgICAgICAg IC8qIFJlY29yZCBtb3ZlLiAqLworICAgICAgICBydW4tPmN1cnJlbnRfdnBvcyA9IGk7CisgICAg ICAgIHJ1bi0+Y3VycmVudF95ID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIGkpLT55Owor ICAgICAgICBydW4tPmRlc2lyZWRfdnBvcyA9IG5ld19saW5lOworICAgICAgICBydW4tPmRlc2ly ZWRfeSA9IE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCBuZXdfbGluZSktPnk7CisgICAgICAg IHJ1bi0+bnJvd3MgPSAxOworICAgICAgICBydW4tPmhlaWdodCA9IE1BVFJJWF9ST1cgKGN1cnJl bnRfbWF0cml4LCBpKS0+aGVpZ2h0OworICAgICAgICAvKiBFeHRlbmQgYmFja3dhcmQuICovCisg ICAgICAgIHAgPSBpIC0gMTsKKyAgICAgICAgcSA9IG5ld19saW5lIC0gMTsKKyAgICAgICAgd2hp bGUgKHAgPiBmaXJzdF9vbGQKKyAgICAgICAgICAgICAgICYmIHEgPiBmaXJzdF9uZXcKKyAgICAg ICAgICAgICAgICYmIG1jX29sZF9saW5lc1twXSA9PSBtY19uZXdfbGluZXNbcV0pCisgICAgICAg ICAgeworICAgICAgICAgICAgaW50IGggPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgcCkt PmhlaWdodDsKKyAgICAgICAgICAgIC0tcnVuLT5jdXJyZW50X3Zwb3M7CisgICAgICAgICAgICAt LXJ1bi0+ZGVzaXJlZF92cG9zOworICAgICAgICAgICAgKytydW4tPm5yb3dzOworICAgICAgICAg ICAgcnVuLT5oZWlnaHQgKz0gaDsKKyAgICAgICAgICAgIHJ1bi0+ZGVzaXJlZF95IC09IGg7Cisg ICAgICAgICAgICBydW4tPmN1cnJlbnRfeSAtPSBoOworICAgICAgICAgICAgLS1wLCAtLXE7Cisg ICAgICAgICAgfQorICAgICAgICAvKiBFeHRlbmQgZm9yd2FyZC4gKi8KKyAgICAgICAgcCA9IGkg KyAxOworICAgICAgICBxID0gbmV3X2xpbmUgKyAxOworICAgICAgICB3aGlsZSAocCA8IGxhc3Rf b2xkCisgICAgICAgICAgICAgICAmJiBxIDwgbGFzdF9uZXcKKyAgICAgICAgICAgICAgICYmIG1j X29sZF9saW5lc1twXSA9PSBtY19uZXdfbGluZXNbcV0pCisgICAgICAgICAgeworICAgICAgICAg ICAgaW50IGggPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgcCktPmhlaWdodDsKKyAgICAg ICAgICAgICsrcnVuLT5ucm93czsKKyAgICAgICAgICAgIHJ1bi0+aGVpZ2h0ICs9IGg7CisgICAg ICAgICAgICArK3AsICsrcT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GU6CisgICAgICAgICAg Ky0tLS0tLS0tLS0tKyAgICAgICArLS0tLS0tLS0tLS0rCisgICAgICAgICAgfCAgICAgQSAgICAg fCAgICAgICB8ICAgICBCICAgICB8CisgICAgICAgICAgKy0tLS0tLS0tLS0tKyAgLS0+ICArLS0t LS0tLS0tLS0rCisgICAgICAgICAgfCAgICAgQiAgICAgfCAgICAgICB8ICAgICBBICAgICB8Cisg ICAgICAgICAgKy0tLS0tLS0tLS0tKyAgICAgICArLS0tLS0tLS0tLS0rCisgICAgIEluc3RlYWQs IHByZWZlciBiaWdnZXIgbW92ZXMsIGFuZCBpbnZhbGlkYXRlIG1vdmVzIHRoYXQgd291bGQKKyAg ICAgY29weSBmcm9tIHdoZXJlIHdlIGNvcGllZCB0by4gKi8KKyAgZm9yIChpID0gMDsgaSA8IG5y dW5zOyArK2kpCisgICAgaWYgKG1jX3J1bnNbaV0tPm5yb3dzID4gMCkKKyAgICAgIHsKKyAgICAg ICAgc3RydWN0IHJ1biAqciA9IG1jX3J1bnNbaV07CisgICAgICAgIGlmIChyLT5jdXJyZW50X3kg IT0gci0+ZGVzaXJlZF95KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8vICBmcHJpbnRmIChz dGRlcnIsICIlczogIHItPmN1cnJlbnQvZGVzaXJlZF92cG9zICglZC8lZCkgfCByLT5jdXJyZW50 L2Rlc2lyZWRfeSAoJWQvJWQpXG4iLAorICAgICAgICAgICAgLy8gICAgICAgICAgIHItPmN1cnJl bnRfeSA8IHItPmRlc2lyZWRfeSA/ICLihpMiIDogIuKGkSIsCisgICAgICAgICAgICAvLyAgICAg ICAgICAgci0+Y3VycmVudF92cG9zLCByLT5kZXNpcmVkX3Zwb3MsIHItPmN1cnJlbnRfeSwgci0+ ZGVzaXJlZF95KTsKKyAgICAgICAgICAgIC8vICByaWYtPmNsZWFyX3dpbmRvd19tb3VzZV9mYWNl ICh3KTsKKyAgICAgICAgICAgIC8vICByaWYtPnNjcm9sbF9ydW5faG9vayAodywgcik7CisgICAg ICAgICAgfQorICAgICAgICAvKiBUcnVuY2F0ZSBydW5zIHRoYXQgY29weSB0byB3aGVyZSB3ZSBj b3BpZWQgdG8sIGFuZAorICAgICAgICAgICBpbnZhbGlkYXRlIHJ1bnMgdGhhdCBjb3B5IGZyb20g d2hlcmUgd2UgY29waWVkIHRvLiAqLworICAgICAgICBmb3IgKGogPSBucnVucyAtIDE7IGogPiBp OyAtLWopCisgICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0IHJ1biAqcCA9IG1jX3J1bnNb al07CisgICAgICAgICAgICBib29sIHRydW5jYXRlZF9wID0gMDsKKyAgICAgICAgICAgIGlmIChw LT5ucm93cyA+IDAKKyAgICAgICAgICAgICAgICAmJiBwLT5kZXNpcmVkX3kgPCByLT5kZXNpcmVk X3kgKyByLT5oZWlnaHQKKyAgICAgICAgICAgICAgICAmJiBwLT5kZXNpcmVkX3kgKyBwLT5oZWln aHQgPiByLT5kZXNpcmVkX3kpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAo cC0+ZGVzaXJlZF95IDwgci0+ZGVzaXJlZF95KQorICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICBwLT5ucm93cyA9IHItPmRlc2lyZWRfdnBvcyAtIHAtPmRlc2lyZWRfdnBv czsKKyAgICAgICAgICAgICAgICAgICAgcC0+aGVpZ2h0ID0gci0+ZGVzaXJlZF95IC0gcC0+ZGVz aXJlZF95OworICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZWRfcCA9IDE7CisgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICBpbnQgbnJvd3NfY29waWVkID0gKHItPmRlc2lyZWRfdnBvcyArIHIt Pm5yb3dzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBwLT5kZXNp cmVkX3Zwb3MpOworICAgICAgICAgICAgICAgICAgICBpZiAocC0+bnJvd3MgPD0gbnJvd3NfY29w aWVkKQorICAgICAgICAgICAgICAgICAgICAgIHAtPm5yb3dzID0gMDsKKyAgICAgICAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgICAgICAgIGludCBoZWlnaHRfY29waWVkID0gKHItPmRlc2lyZWRfeSArIHItPmhlaWdodAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHAtPmRlc2ly ZWRfeSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmN1cnJlbnRfdnBvcyArPSBucm93 c19jb3BpZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRlc2lyZWRfdnBvcyArPSBu cm93c19jb3BpZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPm5yb3dzIC09IG5yb3dz X2NvcGllZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+Y3VycmVudF95ICs9IGhlaWdo dF9jb3BpZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRlc2lyZWRfeSArPSBoZWln aHRfY29waWVkOworICAgICAgICAgICAgICAgICAgICAgICAgICBwLT5oZWlnaHQgLT0gaGVpZ2h0 X2NvcGllZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ1bmNhdGVkX3AgPSAxOworICAg ICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICB9CisgICAgICAgICAgICBpZiAoci0+Y3VycmVudF95ICE9IHItPmRlc2lyZWRfeQorICAgICAg ICAgICAgICAgIC8qIFRoZSBjb25kaXRpb24gYmVsb3cgaXMgZXF1aXZhbGVudCB0bworICAgICAg ICAgICAgICAgICAgICgocC0+Y3VycmVudF95ID49IHItPmRlc2lyZWRfeQorICAgICAgICAgICAg ICAgICAgICAgJiYgcC0+Y3VycmVudF95IDwgci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0KQorICAg ICAgICAgICAgICAgICAgICB8fCAocC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0ID4gci0+ZGVzaXJl ZF95CisgICAgICAgICAgICAgICAgICAgICAgICAmJiAocC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPD0gci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0 KSkpCisgICAgICAgICAgICAgICAgICAgYmVjYXVzZSB3ZSBoYXZlIDAgPCBwLT5oZWlnaHQgPD0g ci0+aGVpZ2h0LiAqLworICAgICAgICAgICAgICAgICYmIHAtPmN1cnJlbnRfeSA8IHItPmRlc2ly ZWRfeSArIHItPmhlaWdodAorICAgICAgICAgICAgICAgICYmIHAtPmN1cnJlbnRfeSArIHAtPmhl aWdodCA+IHItPmRlc2lyZWRfeSkKKyAgICAgICAgICAgICAgcC0+bnJvd3MgPSAwOworICAgICAg ICAgICAgLyogUmVvcmRlciBydW5zIGJ5IGNvcGllZCBwaXhlbCBsaW5lcyBpZiB0cnVuY2F0ZWQu ICovCisgICAgICAgICAgICBpZiAodHJ1bmNhdGVkX3AgJiYgcC0+bnJvd3MgPiAwKQorICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgaW50IGsgPSBucnVucyAtIDE7CisgICAgICAgICAg ICAgICAgd2hpbGUgKG1jX3J1bnNba10tPm5yb3dzID09IDAgfHwgbWNfcnVuc1trXS0+aGVpZ2h0 IDwgcC0+aGVpZ2h0KQorICAgICAgICAgICAgICAgICAgay0tOworICAgICAgICAgICAgICAgIG1l bW1vdmUgKG1jX3J1bnMgKyBqLCBtY19ydW5zICsgaiArIDEsIChrIC0gaikgKiBzaXplb2YgKCpt Y19ydW5zKSk7CisgICAgICAgICAgICAgICAgbWNfcnVuc1trXSA9IHA7CisgICAgICAgICAgICAg IH0KKyAgICAgICAgICB9CisgICAgICAgIC8qIEFzc2lnbiBtYXRyaXggcm93cy4gKi8KKyAgICAg ICAgZm9yIChqID0gMDsgaiA8IHItPm5yb3dzOyArK2opCisgICAgICAgICAgeworICAgICAgICAg ICAgc3RydWN0IGdseXBoX3JvdyAqZnJvbSwgKnRvOworICAgICAgICAgICAgYm9vbCB0b19vdmVy bGFwcGVkX3A7CisgICAgICAgICAgICB0byA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBy LT5kZXNpcmVkX3Zwb3MgKyBqKTsKKyAgICAgICAgICAgIGZyb20gPSBNQVRSSVhfUk9XIChkZXNp cmVkX21hdHJpeCwgci0+ZGVzaXJlZF92cG9zICsgaik7CisgICAgICAgICAgICB0b19vdmVybGFw cGVkX3AgPSB0by0+b3ZlcmxhcHBlZF9wOworICAgICAgICAgICAgZnJvbS0+cmVkcmF3X2ZyaW5n ZV9iaXRtYXBzX3AgPSBmcm9tLT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3A7CisgICAgICAgICAg ICBhc3NpZ25fcm93ICh0bywgZnJvbSk7CisgICAgICAgICAgICAvKiBUaGUgYWJvdmUgYGFzc2ln bl9yb3cnIGFjdHVhbGx5IGRvZXMgc3dhcCwgc28gaWYgd2UgaGFkCisgICAgICAgICAgICAgICBh biBvdmVybGFwIGluIHRoZSBjb3B5IGRlc3RpbmF0aW9uIG9mIHR3byBydW5zLCB0aGVuCisgICAg ICAgICAgICAgICB0aGUgc2Vjb25kIHJ1biB3b3VsZCBhc3NpZ24gYSBwcmV2aW91c2x5IGRpc2Fi bGVkIGJvZ3VzCisgICAgICAgICAgICAgICByb3cuICBCdXQgdGhhbmtzIHRvIHRoZSB0cnVuY2F0 aW9uIGNvZGUgaW4gdGhlCisgICAgICAgICAgICAgICBwcmVjZWRpbmcgZm9yLWxvb3AsIHdlIG5v IGxvbmdlciBoYXZlIHN1Y2ggYW4gb3ZlcmxhcCwKKyAgICAgICAgICAgICAgIGFuZCB0aHVzIHRo ZSBhc3NpZ25lZCByb3cgc2hvdWxkI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9mIHRoZSBwcmVtaXNl IHRoYXQgdGhlIHByZXZpb3VzIHJvdyBpbnQgdGhlIGN1cnJlbnQKKyAgbWF0cml4IGhhcyBhbHJl YWR5IGJlZW4gdXBkYXRlZCAocGVyaGFwcykgb3IgZGlkIG5vdCBuZWVkIHRvIGJlIHVwZGF0ZWQu ICovCisgIGludCBwcmV2X21hdHJpeF9yb3dfc3RhcnRfYnl0ZXBvcyA9ICh2cG9zICE9IDApCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19TVEFSVF9C WVRFUE9TIChjdXJyZW50X3JvdyAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogLTE7CisgIGludCBwcmV2X21hdHJpeF9yb3dfZW5kX2J5dGVwb3MgPSAodnBvcyAh PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VO RF9CWVRFUE9TIChjdXJyZW50X3JvdyAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IC0xOworICBpbnQgbWF0cml4X3Jvd19zdGFydF9ieXRlcG9zID0gTUFUUklYX1JP V19TVEFSVF9CWVRFUE9TIChkZXNpcmVkX3Jvdyk7CisgIGludCBtYXRyaXhfcm93X2VuZF9ieXRl cG9zID0gTUFUUklYX1JPV19FTkRfQllURVBPUyAoZGVzaXJlZF9yb3cpOworICAvKiBUaGlzIHRl c3RzIGZvciBhIHNvbGl0YXJ5IHJvdyBjb250YWluaW5nIFpWLCBwcmVjZWRlZCBieSBhIHJvdyBj b250YWluaW5nIGEKKyAgcGVudWx0aW1hdGUgZ2x5cGggd2l0aCBhIGNoYXJwb3Mgb2YgWlYgLSAx IGZvbGxvd2VkIGJ5IGFuIGVuZCBvZiByb3cgc3BhY2UKKyAgZ2x5cGggd2l0aCBhIGNoYXJwb3Mg b2YgMC4gKi8KKyAgYm9vbCByb3dfYXRfenZfcCA9ICh2cG9zICE9IDAKKyAgICAgICAgICAgICAg ICAgICAgICAmJiAoY3VycmVudF9yb3cgLSAxKS0+dXNlZFtURVhUX0FSRUFdID4gMAorICAgICAg ICAgICAgICAgICAgICAgICYmIHByZXZfbWF0cml4X3Jvd19zdGFydF9ieXRlcG9zICE9IHByZXZf bWF0cml4X3Jvd19lbmRfYnl0ZXBvcworICAgICAgICAgICAgICAgICAgICAgICYmICEoY3VycmVu dF9yb3cgLSAxKS0+ZW5kc19hdF96dl9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgbWF0cml4 X3Jvd19zdGFydF9ieXRlcG9zID09IG1hdHJpeF9yb3dfZW5kX2J5dGVwb3MKKyAgICAgICAgICAg ICAgICAgICAgICAmJiBkZXNpcmVkX3Jvdy0+ZW5kc19hdF96dl9wKTsKKyAgLyogSWYgbGluZS1u dW1iZXJzIGFyZSBhY3RpdmUsIHRoZW4gc3BhY2UgZ2x5cGggcGFkZGluZyBlcXVhbCB0byBpdHMg d2lkdGgKKyAgY291bnRlZCBpbiBIUE9TIGFyZSBmb2xsb3dlZCBieSBhIHNpbmdsZSByb3cgZW5k IHNwYWNlIGdseXBoLiAgTGluZSBudW1iZXIKKyAgcGFkZGluZyBzcGFjZSBnbHlwaHMgaGF2ZSBh IGNoYXJwb3Mgb2YgLTEsIHdoZXJlYXMgdGhlIGVuZCBvZiByb3cgc3BhY2UgZ2x5cGgKKyAgaGFz IGEgY2hhcnBvcyBvZiAwLiAgSWYgbGluZSBudW1iZXJzIGFyZSBpbmFjdGl2ZSwgdGhlbiB0aGUg cm93IHdpbGwgY29udGFpbgorICBhIHNvbGl0YXJ5IHNwYWNlIGdseXBoIHdpdGggYSBjaGFycG9z IG9mIC0xLiAqLworICBib29sIHJvd19iZXlvbmRfenZfcCA9IChtYXRyaXhfcm93X3N0YXJ0X2J5 dGVwb3MgPT0gbWF0cml4X3Jvd19lbmRfYnl0ZXBvcworICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiAhcm93X2F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29y X3RvICh3LCB2cG9zLCAwLCBkZXNpcmVkX3Jvdy0+eSwgZGVzaXJlZF9yb3ctPngpOworCisgIGlm IChkZWJ1Z19wCisgICAgICAmJiB2cG9zICE9IGJvdHRvbV92cG9zKQorICAgIHsKKyAgICAgIGZw cmludGYgKHN0ZGVyciwgIldSSVRFIEVOVElSRSBST1c6XG5cCisgICAgICB2cG9zICglZCkgfCBj aGFyICglZC8lcykgfCBzdGFydF94OiAoJWQpIHwgc3RhcnRfaHBvcyAoJWQvJWQpXG4iLAorICAg ICAgdnBvcywgZGVzaXJlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdLT51LmNoLCBtY19jaGFyX3Rv X3N0cmluZyAoZGVzaXJlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdLT51LmNoKSwKKyAgICAgIGRl c2lyZWRfcm93LT54LCAwLCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSk7CisgICAg fQorICAgICAgaWYgKGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgIHJpZi0+ bWNfc2NyaWJlX2dseXBocyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBkZXNpcmVk X3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg VEVYVF9BUkVBLCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdLCB2cG9zLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGJvdHRvbV92cG9zLCBsc2wsIGdseXBoX2ZsYXZvciwgY3Vy c29yX3R5cGUsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMu YWN0aXZlX3AsIGN1cnNvcl9nY19wLCBkcmF3X3ApOworCisgICAgICAvKiBDbGVhciB0byBlbmQg b2Ygd2luZG93LiAqLworICAgICAgaWYgKGRyYXdfcCkKKyAgICAgICAgcml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AgICAgIGFmdGVyIHRoZSBgaWYnIGFuZCB0aGVyZSB3b3VsZCByZW1haW4gYSBw aXhlbCBmcm9tIHRoZQorICAgICAgIGBmJyBvbiB0aGUgc2NyZWVuLiAqLworICAgIGlmIChvdmVy bGFwcGluZ19nbHlwaHNfcCAmJiBpID4gMCkKKyAgICAgIHsKKyAgICAgICAgc3RydWN0IGdseXBo ICpnbHlwaCA9ICZjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV1baSAtIDFdOworICAgICAg ICBpbnQgbGVmdCwgcmlnaHQ7CisgICAgICAgIHJpZi0+Z2V0X2dseXBoX292ZXJoYW5ncyAoZ2x5 cGgsIFhGUkFNRSAody0+ZnJhbWUpLCAmbGVmdCwgJnJpZ2h0KTsKKyAgICAgICAgY2FuX3NraXBf cCA9IChyaWdodCA9PSAwICYmICFhYm9ydF9za2lwcGluZyk7CisgICAgICB9CisKKyAgICBpZiAo Y2FuX3NraXBfcCkKKyAgICAgIHsKKyAgICAgICAgaW50IHN0YXJ0X2hwb3MgPSBpOworCisgICAg ICAgIHdoaWxlIChpIDwgc3RvcAorICAgICAgICAgICAgICAgJiYgR0xZUEhfRVFVQUxfUCAoZGVz aXJlZF9nbHlwaCwgY3VycmVudF9nbHlwaCkpCisgICAgICAgICAgeworICAgICAgICAgICAgKyth cnJheV9nbHlwaHNfc2tpcHBlZC51c2VkOworICAgICAgICAgICAgaWYgKGFycmF5X2dseXBoc19z a2lwcGVkLmFsbG9jYXRlZCA8IGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQpCisgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICBpbnQgb2xkX2FsbG9jID0gYXJyYXlfZ2x5cGhzX3NraXBw ZWQuYWxsb2NhdGVkOworICAgICAgICAgICAgICAgIGludCBuZXdfZWx0cyA9IGFycmF5X2dseXBo c19za2lwcGVkLnVzZWQgLSBhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQ7CisgICAgICAg ICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCA9CisgICAgICAgICAgICAgICAg ICB4cGFsbG9jIChhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgJmFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgIG5ld19lbHRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgSU5U X01BWCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAqYXJyYXlfZ2x5cGhzX3Nr aXBwZWQuc2tpcHBlZCk7CisgICAgICAgICAgICAgICAgbWVtc2V0IChhcnJheV9nbHlwaHNfc2tp cHBlZC5za2lwcGVkICsgb2xkX2FsbG9jLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgIChh cnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQgLSBvbGRfYWxsb2MpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAqIHNpemVvZiAqYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCk7Cisg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGludCBudGggPSBhcnJheV9nbHlwaHNfc2tpcHBl ZC51c2VkIC0gMTsKKyAgICAgICAgICAgIGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbbnRo XS54ID0geDsKKyAgICAgICAgICAgIGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbbnRoXS5o cG9zID0gaTsKKyAgICAgICAgICAgIGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbbnRoXS5l bmFibGVkX3AgPSB0cnVlOworICAgICAgICAgICAgeCArPSBkZXNpcmVkX2dseXBoLT5waXhlbF93 aWR0aDsKKyAgICAgICAgICAgICsrZGVzaXJlZF9nbHlwaCwgKytjdXJyZW50X2dseXBoLCArK2k7 CisgICAgICAgICAgfQorCisgICAgICAgIC8qIENvbnNpZGVyIHRoZSBjYXNlIHRoYXQgdGhlIGN1 cnJlbnQgcm93IGNvbnRhaW5zICJ4eHgKKyAgICAgcHBwIGdnZyIgaW4gaXRhbGljIENvdXJpZXIg Zm9udCwgYW5kIHRoZSBkZXNpcmVkIHJvdworICAgICBpcyAieHh4IGdnZyIuICBUaGUgY2hhcmFj dGVyIGBwJyBoYXMgbGJlYXJpbmcsIGBnJworICAgICBoYXMgbm90LiAgVGhlIGxvb3AgYWJvdmUg d2lsbCBzdG9wIGluIGZyb250IG9mIHRoZQorICAgICBmaXJzdCBgcCcgaW4gdGhlIGN1cnJlbnQg cm93LiAgSWYgd2Ugd291bGQgc3RhcnQKKyAgICAgd3JpdGluZyBnbHlwaHMgdGhlcmUsIHdlIHdv dWxkbid0IGVyYXNlIHRoZSBsYmVhcmluZworICAgICBvZiB0aGUgYHAnLiAgVGhlIHJlc3Qgb2Yg dGhlIGxiZWFyaW5nIHByb2JsZW0gaXMgdGhlbgorICAgICB0YWtlbiBjYXJlIG9mIGJ5IGRyYXdf Z2x5cGhzLiAqLworICAgICAgICBpZiAob3ZlcmxhcHBpbmdfZ2x5cGhzX3AKKyAgICAgICAgICAg ICYmIGkgPiAwCisgICAgICAgICAgICAmJiBpIDwgY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVB XQorICAgICAgICAgICAgJiYgKGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0gIT0gZGVzaXJl ZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkpCisgICAgICAgICAgeworICAgICAgICAgICAgaW50IGxl ZnQsIHJpZ2h0OworICAgICAgICAgICAgcmlmLT5nZXRfZ2x5cGhfb3ZlcmhhbmdzIChjdXJyZW50 X2dseXBoLAorICAgICAgICAgICAgICAgICAgICBYRlJBTUUgKHctPmZyYW1lKSwKKyAgICAgICAg ICAgICAgICAgICAgJmxlZnQsICZyaWdodCk7CisgICAgICAgICAgICB3aGlsZSAobGVmdCA+IDAg JiYgaSA+IDApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAtLWksIC0tZGVzaXJl ZF9nbHlwaCwgLS1jdXJyZW50X2dseXBoOworICAgICAgICAgICAgICAgIHggLT0gZGVzaXJlZF9n bHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAgbGVmdCAtPSBkZXNpcmVkX2dseXBo LT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgLyogQWJvcnQgdGhl IHNraXBwaW5nIGFsZ29yaXRobSBpZiB3ZSBlbmQgdXAgYmVmb3JlCisgICAgICAgICAgICAgICBv dXIgc3RhcnRpbmcgcG9pbnQsIHRvIGF2b2lkIGxvb3BpbmcgKGJ1ZyMxMDcwKS4KKyAgICAgICAg ICAgICAgIFRoaXMgY2FuIGhhcHBlbiB3aGVuIHRoZSBsYmVhcmluZyBpcyBsYXJnZXIgdGhhbgor ICAgICAgICAgICAgICAgdGhlIHBpeGVsIHdpZHRoLiAqLworICAgICAgICAgICAgYWJvcnRfc2tp cHBpbmcgPSAoaSA8IHN0YXJ0X2hwb3MpOworICAgICAgICAgIH0KKyAgICAgIH0KKworICAgIC8q IFRyeSB0byBhdm9pZCB3cml0aW5nIHRoZSBlbnRpcmUgcmVzdCBvZiB0aGUgZGVzaXJlZCByb3cK KyAgICAgICBieSBsb29raW5nIGZvciBhIHJlc3luYyBwb2ludC4gIFRoaXMgbWFpbmx5IHByZXZl bnRzCisgICAgICAgbW9kZSBsaW5lIGZsaWNrZXJpbmcgaW4gdGhlIGNhc2UgdGhlIG1vZGUgbGlu ZSBpcyBpbgorICAgICAgIGZpeGVkLXBpdGNoIGZvbnQsIHdoaWNoIGl0IHVzdWFsbHkgd2lsbCBi ZS4gKi8KKyAgICBpZiAoaSA8IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICB7 CisgICAgICAgIGludCBzdGFydF94ID0geCwgc3RhcnRfaHBvcyA9IGk7CisgICAgICAgIHN0cnVj dCBnbHlwaCAqc3RhcnQgPSBkZXNpcmVkX2dseXBoOworICAgICAgICBpbnQgY3VycmVudF94ID0g eDsKKyAgICAgICAgYm9vbCBza2lwX2ZpcnN0X3AgPSAhY2FuX3NraXBfcDsKKyAgICAgICAgLyog RmluZCB0aGUgbmV4dCBnbHlwaCB0aGF0J3MgZXF1YWwgYWdhaW4uICovCisgICAgICAgIHdoaWxl IChpIDwgc3RvcAorICAgICAgICAgICAgICAgJiYgKHNraXBfZmlyc3RfcAorICAgICAgICAgICAg ICAgICAgIHx8ICFHTFlQSF9FUVVBTF9QIChkZXNpcmVkX2dseXBoLCBjdXJyZW50X2dseXBoKSkK KyAgICAgICAgICAgICAgICYmIHggPT0gY3VycmVudF94KQorICAgICAgICAgIHsKKyAgICAgICAg ICAgIHggKz0gZGVzaXJlZF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICBjdXJyZW50 X3ggKz0gY3VycmVudF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICArK2Rlc2lyZWRf Z2x5cGgsICsrY3VycmVudF9nbHlwaCwgKytpOworICAgICAgICAgICAgc2tpcF9maXJzdF9wID0g MDsKKyAgICAgICAgICB9CisKKyAgZm9yIChpbnQgZWx0ID0gMDsKKyAgICAgICBlbHQgPCBhcnJh eV9nbHlwaHNfc2tpcHBlZC51c2VkCisgICAgICAgJiYgdnBvcyAhPSBib3R0b21fdnBvczsKKyAg ICAgICArK2VsdCkKKyAgICB7CisgICAgICBpbnQgeCA9IGFycmF5X2dseXBoc19za2lwcGVkLnNr aXBwZWRbZWx0XS54OworICAgICAgaW50IGhwb3MgPSBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lw cGVkW2VsdF0uaHBvczsKKyAgICAgIHN0cnVjdCBnbHlwaCAqdGFyZ2V0X2dseXBoID0KKyAgICAg ICAgbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBo cG9zLCB2cG9zKTsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIs ICJTS0lQUEVEOiAgdnBvcyAoJWQpIHwgY2hhciAoJWQvJXMpIHwgeDogKCVkKSB8IGhwb3MgKCVk LyVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCB0YXJnZXRfZ2x5cGgtPnUu Y2gsIG1jX2NoYXJfdG9fc3RyaW5nICh0YXJnZXRfZ2x5cGgtPnUuY2gpLAorICAgICAgICAgICAg ICAgICAgICAgICAgIHgsIGhwb3MsIHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKTsK KyAgICAgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHRhcmdl dF9nbHlwaCwgeCwgMSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICBib3R0b21fdnBvcywgY3Vy c29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsIFNLSVBQRUQpOwor ICAgIH0KKworICAgICAgICBpZiAoaSA9PSBzdGFydF9ocG9zIHx8IHggIT0gY3VycmVudF94KQor ICAgICAgICAgIHsKKyAgICAgICAgICAgIGkgPSBzdGFydF9ocG9zOworICAgICAgICAgICAgeCA9 IHN0YXJ0X3g7CisgICAgICAgICAgICBkZXNpcmVkX2dseXBoID0gc3RhcnQ7CisgICAgICAgICAg ICBicmVhazsKKyAgICAgICAgICB9CisKKyAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBv cywgc3RhcnRfaHBvcywgZGVzaXJlZF9yb3ctPnksIHN0YXJ0X3gpOworCisgIC8qIFJlLWRyYXcg YSBwb3J0aW9uIG9mIHRoZSByb3cuICovCisKKyAgaWYgKGRlYnVnX3AKKyAgICAgICYmIHZwb3Mg IT0gYm90dG9tX3Zwb3MpCisgICAgeworICAgICAg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CB0aGUgZW5kIG9mIHRoZSBwcmV2aW91cyBjaGFuZ2Uu CisgICAgV2hlbiB0aGlzIHNpdHVhdGlvbiBleGlzdHMsIHRoZSBkaXN0YW5jZSBiZXR3ZWVuIHRo ZSBlbmQgb2YgdGhlIGdseXBoIHJvdyBhbmQKKyAgICB0aGUgcmlnaHQgZWRnZSBvZiB0aGUgd2lu ZG93IHdpbGwgX25vdF8gYmUgY2xlYXJlZC4gIFRoZXJlZm9yZSwgaXQgaXMgb2theSB0bworICAg IGRyYXcgdGhlIGZsb2F0aW5nIGdseXBocyBmb3IgdGhlIGhvcml6b250YWwvdmVydGljYWwgcnVs ZXJzIGhlcmUuICovCisgICAgZWxzZSBpZiAoY2hhbmdlZF9wCisgICAgICAgICAgICAgJiYgdy0+ b3V0cHV0X2N1cnNvci5ocG9zICE9IHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAg ICB7CisgICAgICAgIGludCB4ID0gdy0+b3V0cHV0X2N1cnNvci54OworICAgICAgICBpbnQgaHBv cyA9IHctPm91dHB1dF9jdXJzb3IuaHBvczsKKyAgICAgICAgc3RydWN0IGdseXBoICpzdGFydCA9 IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgaHBv cywgdnBvcyk7CisgICAgICAgIGlmICh3LT5vdXRwdXRfY3Vyc29yLnggPT0gdXBkYXRlZF9yb3ct PnBpeGVsX3dpZHRoKQorICAgICAgICAgIHggLT0gc3RhcnQtPnBpeGVsX3dpZHRoOworICAgICAg ICBpZiAoZGVidWdfcCkKKyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJQT1NULUNIQU5HRUQ6 ICB2cG9zICglZCkgfCB4ICglZCkgfCBocG9zICglZC8lZCkgfCBjaGFyICglZC8lcylcbiIsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCB4LCBocG9zLCB1cGRhdGVkX3Jvdy0+dXNl ZFtURVhUX0FSRUFdIC0gMSwgc3RhcnQtPnUuY2gsIG1jX2NoYXJfdG9fc3RyaW5nIChzdGFydC0+ dS5jaCkpOworICAgICAgICBtY19kcmF3X3JvdyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRf cm93LCBzdGFydCwgeCwKKyAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZWRfcm93LT51c2VkW1RF WFRfQVJFQV0gLSBocG9zLCB2cG9zLCBib3R0b21fdnBvcywKKyAgICAgICAgICAgICAgICAgICAg IGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgZHJhd19wLCBQT1NUX0NI QU5HRUQpOworICAgICAgfQorICAgICAgLyogVGhlcmUgd2VyZSBubyBjaGFuZ2VzIGFuZCBpID09 IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gKi8KKyAgICAgIGVsc2UgaWYgKCFjaGFuZ2Vk X3ApCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAgICAgIGZwcmlu dGYgKHN0ZGVyciwgIlVOQ0hBTkdFRCAtLSBXUklURSBFTlRJUkUgTElORTogIHZwb3MgKCVkKSB8 IHJvdy0+dXNlZCAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCB1 cGRhdGVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSk7CisgICAgICAgICAgbWNfZHJhd19yb3cg KHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgZGVzaXJlZF9yb3ctPmdseXBoc1tURVhU X0FSRUFdLAorICAgICAgICAgICAgICAgICAgICAgICBkZXNpcmVkX3Jvdy0+eCwgZGVzaXJlZF9y b3ctPnVzZWRbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgYm90dG9t X3Zwb3MsIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgZHJhd19wLCBV TkNIQU5HRUQpOworICAgICAgICB9CisKKyAgICAgIC8qIE1heWJlIGNsZWFyIHRvIGVuZCBvZiBs aW5lLiAqLworICAgICAgaWYgKE1BVFJJWF9ST1dfRVhURU5EU19GQUNFX1AgKGRlc2lyZWRfcm93 KSkKKyAgICAgICAgeworICAgICAgICAgIC8qIElmIG5ldyByb3cgZXh0ZW5kcyB0byB0aGUgZW5k IG9mIHRoZSB0ZXh0IGFyZWEsIG5vdGhpbmcKKyAgICAgICAgICAgICBoYXMgdG8gYmUgY2xlYXJl ZCwgaWYgYW5kIG9ubHkgaWYgd2UgZGlkIGEgd3JpdGVfZ2x5cGhzCisgICAgICAgICAgICAgYWJv dmUuICBUaGlzIGlzIG1hZGUgc3VyZSBieSBzZXR0aW5nIGRlc2lyZWRfc3RvcF9wb3MKKyAgICAg ICAgICAgICBhcHByb3ByaWF0ZWx5IGFib3ZlLiAqLworICAgICAgICAgIGVhc3NlcnQgKGkgPCBk ZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgfHwgKChkZXNp cmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdID09IGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0p CisgICAgICAgICAgICAgICAgICAgICAgICYmIE1BVFJJWF9ST1dfRVhURU5EU19GQUNFX1AgKGN1 cnJlbnRfcm93KSkpOworICAgICAgICB9CisgICAgICBlbHNlIGlmIChNQVRSSVhfUk9XX0VYVEVO RFNfRkFDRV9QIChjdXJyZW50X3JvdykpCisgICAgICAgIHsKKyAgICAgICAgICAvKiBJZiBvbGQg cm93IGV4dGVuZHMgdG8gdGhlIGVuZCBvZiB0aGUgdGV4dCBhcmVhLCBjbGVhci4gKi8KKyAgICAg ICAgICBpZiAoaSA+PSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAgICAgICAg b3V0cHV0X2N1cnNvcl90byAodywgdnBv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lu ZyksIHNvIHdlIG11c3QgZG8gaXQgdGhpcyB3YXkuICovCisgICAgICAgICAgaWYgKHZwb3MgPT0g dy0+cGh5c19jdXJzb3IudnBvcworICAgICAgICAgICAgICAmJiAoZGVzaXJlZF9yb3ctPnJldmVy c2VkX3AKKyAgICAgICAgICAgICAgICAgID8gKHctPnBoeXNfY3Vyc29yLmhwb3MgPCAwKQorICAg ICAgICAgICAgICAgICAgOiAody0+cGh5c19jdXJzb3IuaHBvcyA+PSBkZXNpcmVkX3Jvdy0+dXNl ZFtURVhUX0FSRUFdKSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHctPnBoeXNfY3Vy c29yX29uX3AgPSAwOworICAgICAgICAgICAgICB4bGltID0gLTE7CisgICAgICAgICAgICB9Cisg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHhsaW0gPSBjdXJyZW50X3Jvdy0+cGl4ZWxf d2lkdGg7CisgICAgICAgICAgaWYgKGRyYXdfcCkKKyAgICAgICAgICAgIHJpZi0+Y2xlYXJfZW5k X29mX2xpbmUgKHcsIHVwZGF0ZWRfcm93LCBURVhUX0FSRUEsIHhsaW0pOworICAgICAgICAgIGNs ZWFyX3RvX3ggPSB4bGltOworICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgIH0KKwor ICBpZiAoY2hhbmdlZF9wCisgICAgICAmJiBjbGVhcl90b194ICE9IDApCisgICAgeworICAgICAg aW50IHRleHRfYXJlYV93aWR0aCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7Cisg ICAgICBzdHJ1Y3QgbWNfUkdCIGRlYnVnX2ZnID0gey5yZWQgPSAwLjg2NywgLmdyZWVuID0gMC44 NjcsIC5ibHVlID0gMC44Njd9OworICAgICAgc3RydWN0IGdseXBoICp0YXJnZXRfZ2x5cGggPSB1 cGRhdGVkX3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyB1cGRhdGVkX3Jvdy0+dXNlZFtURVh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KEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPmN1cnNvci54ID09IGVzc2VudGlhbHMuZmNfeCk7CisKKyAgICAgIGlmICh0cmFj ZV9yZWRpc3BsYXlfcCkKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfdXBkYXRlX3RleHRf YXJlYSAoZmxvYXRpbmcpOiAgdnBvcyAoJWQpIHwgeF9saW1pdCAoJWQpXG4iLCB2cG9zLCB4X2xp bWl0KTsKKworICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICYmICFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgICAg ICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0g eAorICAgICAgICAgICYmIHRhcmdldF9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgJiYgZHJhd19w KQorICAgICAgICBtY19lbmdpbmUgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFy Z2V0X2dseXBoLCBURVhUX0FSRUEsIHgsIHhfbGltaXQsCisgICAgICAgICAgICAgICAgICAgdXBk YXRlZF9yb3ctPnksIGhwb3MsIHZwb3MsIE1DX0JBUiwgMSwgY3Vyc29yX21hdHJpeCwgZXNzZW50 aWFscy5mY194LAorICAgICAgICAgICAgICAgICAgIGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGVzc2Vu dGlhbHMuZmNfZmdbcm93X3Bvc2l0aW9uXSwgZXNzZW50aWFscy5hY3RpdmVfcCwgRklMTF9DT0xV TU4sCisgICAgICAgICAgICAgICAgICAgZHJhd19wLCBOT1dIRVJFLCBOT19DQUNIRSk7CisKKyAg ICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAmJiAhTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9ob3Jpem9udGFsX3J1bGVyKSkKKyAgICAg ICAgICAmJiB4IDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJz b3IudnBvcworICAgICAgICAgICYmIHRhcmdldF9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgJiYg ZHJhd19wKQorICAgICAgICBtY19lbmdpbmUgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3Jv dywgdGFyZ2V0X2dseXBoLCBURVhUX0FSRUEsIHgsIHhfbGltaXQsCisgICAgICAgICAgICAgICAg ICAgdXBkYXRlZF9yb3ctPnksIGhwb3MsIHZwb3MsIE1DX0hCQVIsIDEsIGN1cnNvcl9tYXRyaXgs IGVzc2VudGlhbHMuZmNfeCwKKyAgICAgICAgICAgICAgICAgICBkZWJ1Z19wID8gZGVidWdfZmcg OiBlc3NlbnRpYWxzLmNoX2ZnW3Jvd19wb3NpdGlvbl0sIGVzc2VudGlhbHMuYWN0aXZlX3AsIEhP UklaT05UQUxfUlVMRVIsCisgICAgICAgICAgICAgICAgICAgZHJhd19wLCBOT1dIRVJFLCBOT19D QUNIRSk7CisKKyAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAmJiAh TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAg ICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxl c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vdy0+ZnVsbF93aWR0aF9w ICYmIHctPmxlZnRfbWFyZ2luX2NvbHMgPiAwKQorICAgICAgICB7CisgICAgICAgICAgY2hhbmdl ZF9wID0gMTsKKyAgICAgICAgICB1cGRhdGVfbWFyZ2luYWxfYXJlYSAodywgZGVzaXJlZF9yb3cs IExFRlRfTUFSR0lOX0FSRUEsIHZwb3MpOworICAgICAgICAgIC8qIFNldHRpbmcgdGhpcyBmbGFn IHdpbGwgZW5zdXJlIHRoZSB2ZXJ0aWNhbCBib3JkZXIsIGlmCisgICAgICAgICAgICAgYW55LCBi ZXR3ZWVuIHRoaXMgd2luZG93IGFuZCB0aGUgb25lIG9uIGl0cyBsZWZ0IHdpbGwgYmUKKyAgICAg ICAgICAgICByZWRyYXduLiAgVGhpcyBpcyBuZWNlc3NhcnkgYmVjYXVzZSB1cGRhdGluZyB0aGUg bGVmdAorICAgICAgICAgICAgIG1hcmdpbiBhcmVhIGNhbiBwb3RlbnRpYWxseSBkcmF3IG92ZXIg dGhlIGJvcmRlci4gKi8KKyAgICAgICAgICBjdXJyZW50X3Jvdy0+cmVkcmF3X2ZyaW5nZV9iaXRt YXBzX3AgPSAxOworICAgICAgICB9CisgICAgICBib29sIHVwZGF0ZWRfcCA9IG1jX3VwZGF0ZV90 ZXh0X2FyZWEgKHcsIGRlc2lyZWRfcm93LCB2cG9zLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLCBkcmF3X3ApOwor ICAgICAgLyogVXBkYXRlIHRoZSBkaXNwbGF5IG9mIHRoZSB0ZXh0IGFyZWEuICovCisgICAgICBp ZiAodXBkYXRlZF9wKQorICAgICAgICB7CisgICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAgICAg ICAgICBpZiAoY3VycmVudF9yb3ctPm1vdXNlX2ZhY2VfcCkKKyAgICAgICAgICAgICptb3VzZV9m YWNlX292ZXJ3cml0dGVuX3AgPSAxO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8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIG1jX2NvbmYpKSkpOworICBib29sIHVwZGF0aW5nX2ZyYW1lX3AgPSBmYWxzZTsKKyAgc3Ry dWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIGlmIChYRlJBTUUgKHctPmZyYW1l KSAhPSBmLT5tY191cGRhdGluZ19mcmFtZQorICAgICAgJiYgKGdvX29uZV9wIHx8IGdvX3R3b19w KSkKKyAgICB7CisgICAgICB1cGRhdGluZ19mcmFtZV9wID0gdHJ1ZTsKKyAgICAgIHVwZGF0ZV9i ZWdpbiAoZik7CisgICAgfQorICBpZiAody0+cGh5c19jdXJzb3Jfb25fcAorICAgICAgJiYgZ29f dHdvX3ApCisgICAgZXJhc2VfcGh5c19jdXJzb3IgKHcpOworCisvKgorICBmb3IgKGludCB2bnRo ID0gMDsKKyAgICAgICB2bnRoIDwgb2xkX21hdHJpeC52cG9zX3VzZWQ7CisgICAgICAgKyt2bnRo KQorICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAg ICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICAgICsrY2FjaGVfdHlwZSkKKyAg ICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX3VwZGF0ZV93aW5kb3dfZXJhc2UgKCVkKTogICVzXG5c CisgIG9sZF9tYXRyaXgudnBvc191c2VkICglZClcblwKKyAgb2xkX21hdHJpeC5jdXJzb3JzX3Vz ZWRbJXNdICglZClcblwKKyAgb2xkX21hdHJpeC5jdXJzb3JzX3VzZWRbJXNdICglZClcblwKKyAg b2xkX21hdHJpeC5jdXJzb3JzX3VzZWRbJXNdICglZClcblwKKyAgb2xkX21hdHJpeC52cG9zWyVk XS5jYWNoZV91c2VkWyVzXSAoJWQpXG5cCisgIG9sZF9tYXRyaXgudnBvc1slZF0uY2FjaGVfdXNl ZFslc10gKC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AgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NB Q0hFOworICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgIGZvciAoaW50IHpfbnRoID0g MDsKKyAgICAgICAgICAgICBvbGRfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXSA+IDAK KyAgICAgICAgICAgICAmJiB6X250aCA8IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2Vk W2NhY2hlX3R5cGVdOworICAgICAgICAgICAgICsrel9udGgpCisgICAgICAgICAgeworICAgICAg ICAgICAgYm9vbCBzYW1lX3AgPSBmYWxzZTsKKyAgICAgICAgICAgIGZvciAoaW50IHdfbnRoID0g MDsgd19udGggPCB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVd OyArK3dfbnRoKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2FtZV9wIHw9IChv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmdseXBoLnR5cGUK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnR5cGUKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0u Z2x5cGguYnl0ZXBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguYnl0ZXBvcworICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3pfbnRoXS5nbHlwaC5jaGFycG9zCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5n bHlwaC5jaGFycG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmdseXBoLnUudmFsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW3dfbnRoXS5nbHlwaC51LnZhbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5nbHlwaC5mYWNl X2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5mYWNlX2lkCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b el9udGhdLmdseXBoLnBhZGRpbmdfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgucGFk ZGluZ19wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmdseXBoLmxlZnRfYm94X2xpbmVfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0uZ2x5cGgubGVmdF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9u dGhdLmdseXBoLnJpZ2h0X2JveF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBo LnJpZ2h0X2JveF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0uZ2x5cGgudm9mZnNldAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudm9mZnNldAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5n bHlwaC5waXhlbF93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgucGl4ZWxfd2lk dGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVt6X250aF0uZ2x5cGguc2xpY2UuaW1nLngKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bd19udGhdLmdseXBoLnNsaWNlLmltZy54CisgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmdseXBoLnNs aWNlLmltZy55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcueQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3pfbnRoXS5nbHlwaC5zbGljZS5pbWcud2lkdGgKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b d19udGhdLmdseXBoLnNsaWNlLmltZy53aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5nbHlwaC5z bGljZS5pbWcuaGVpZ2h0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcu aGVpZ2h0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmdseXBoLnNsaWNlLmNtcC5mcm9tCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5jbXAuZnJvbQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRo XS54CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS54CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmZ4Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5meAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS55CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmZ5CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS5meQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5ocG9zCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3dfbnRoXS5ocG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLnZwb3MKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b d19udGhdLnZwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0ud2QKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19u dGhdLndkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmgKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmgK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVt6X250aF0uY3Vyc29yX3R5cGUKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LmN1cnNvcl90eXBlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmN1cnNvcl93aWR0aAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVt3X250aF0uY3Vyc29yX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmZvcmVncm91 bmQucmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5mb3JlZ3JvdW5kLnJlZAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3pfbnRoXS5mb3JlZ3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5mb3Jl Z3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmZvcmVncm91bmQuYmx1ZQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0uZm9yZWdyb3VuZC5ibHVlCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmJh Y2tncm91bmQucmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5iYWNrZ3JvdW5kLnJlZAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3pfbnRoXS5iYWNrZ3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRo XS5iYWNrZ3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmJhY2tncm91bmQuYmx1ZQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVt3X250aF0uYmFja2dyb3VuZC5ibHVlCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9u dGhdLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5hY3RpdmVfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3pfbnRoXS5nbHlwaF9mbGF2b3IKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoX2Zs YXZvcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5lbmFibGVkX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19u dGhdLmVuYWJsZWRfcCk7CisgICAgICAgICAgICAgICAgLyogRm9yY2UgdGhlIGZyaW5nZSBiaXRt YXBzIHRvIGFsd2F5cyBiZSByZXNldC9yZWRyYXduLiAqLworICAgICAgICAgICAgICAgIGlmIChv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmN1cnNvcl90eXBl CisgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bd19udGhdLmN1cnNvcl90eXBlCisgICAgICAgICAgICAgICAgICAgICYmIChv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmN1cnNvcl90eXBl ID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgICAgICAgfHwgb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5jdXJzb3JfdHlwZSA9 PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQKSkKKyAgICAgICAgICAgICAgICAgIHNhbWVfcCA9IGZh bHNlOworICAgICAgICAgICAgICAgIGlmIChzYW1lX3ApCisgICAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICAgIC8vICBmcHJpbnRmIChzdGRlcnIsICJISVQgKCVzKTogIHZwb3Mg KCVkKSB8IGhwb3MgKCVkKSB8IGNoYXIgKCVzKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgLy8g ICAgICAgICAgICAgICAgICAgKGNhY2hlX3R5cGUgPT0gTUNfQ0FDSEUpCisgICAgICAgICAgICAg ICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgPyAiTUMiCisgICAgICAgICAgICAgICAgICAg IC8vICAgICAgICAgICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0gQ0hfQ0FDSEUpCisgICAgICAg ICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgPyAiQ0giCisgICAgICAgICAgICAg ICAgICAgIC8vICAgICAgICAgICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0gRkNfQ0FDSEUpCisg ICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgPyAiRkMiCisgICAgICAg ICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIDogIk5PIiwKKyAgICAgICAgICAgICAg ICAgICAgLy8gICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bd19udGhdLnZwb3MsCisgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAg ICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRo XS5ocG9zLAorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICBtY19jaGFy X3RvX3N0cmluZyAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19u dGhdLmdseXBoLnUuY2gpKTsKKyAgICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnNhbWVfcCA9IHRydWU7CisgICAgICAgICAg ICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgLy8gIGZw cmludGYgKHN0ZGVyciwgIk1JU1MgKCVzKTogIHZwb3MgKCVkKSB8IGhwb3MgKCVkIHYuICVkKSB8 IGNoYXIgKCVzIHYuICVzKSB8IGNhY2hlX3VzZWQgKCVkIHYuICVkKVxuIiwKKyAgICAgICAgICAg ICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAoY2FjaGVfdHlwZSA9PSBNQ19DQUNIRSkK KyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgID8gIk1DIgorICAg ICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0g Q0hfQ0FDSEUpCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICA/ ICJDSCIKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICA6IChjYWNo ZV90eXBlID09IEZDX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAg ICAgICAgICAgPyAiRkMiCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAg ICAgOiAiTk8iLAorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS52cG9zLAorICAg ICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0uaHBvcywKKyAgICAgICAgICAgICAgICAgICAg ICAvLyAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVt3X250aF0uaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAg ICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3pfbnRoXS5nbHlwaC51LmNoKSwKKyAgICAgICAgICAgICAgICAgICAgICAvLyAg ICAgICAgICAgICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAody0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnUuY2gpLAorICAgICAgICAgICAgICAg ICAgICAgIC8vICAgICAgICAgICAgICAgICAgIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91 c2VkW2NhY2hlX3R5cGVdLAorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAg ICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0pOworICAg ICAgICAgICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS5zYW1lX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICB9CisgICAgICAgICAgICBpZiAoIXNhbWVfcCkKKyAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgIC8qIGBtYXRyaXhfcm93JyBpbiBgZGlzcG5ldy5jYCBjb250YWlucyB0aGUg Zm9sbG93aW5nIHRlc3RzLAorICAgICAgICAgICAgICAgIGVhc3NlcnQgKG1hdHJpeCAmJiBtYXRy aXgtPnJvd3MpOworICAgICAgICAgICAgICAgIGVhc3NlcnQgKHJvdyA+PSAwICYmIHJvdyA8IG1h dHJpeC0+bnJvd3MpOyAqLworICAgICAgICAgICAgICAgIGJvb2wgYmFyZl9jcmFzaF9vbmUgPSAo dy0+Y3VycmVudF9tYXRyaXggJiYgdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MpID8gZmFsc2UgOiB0 cnVlOworICAgICAgICAgICAgICAgIGlmIChiYXJmX2NyYXNoX29uZSkKKyAgICAgICAgICAgICAg ICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIGJvb2wgYmFyZl9jcmFzaF90d28gPSAodm50 aCA+PSAwICYmIHZudGggPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MpID8gZmFsc2UgOiB0cnVl OworICAgICAgICAgICAgICAgIGlmIChiYXJmX2NyYXNoX3R3bykKKyAgICAgICAgICAgICAgICAg IGNvbnRpbnVlOworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnZudGhfcm93ID0g TUFUUklYX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIHZudGgpOworICAgICAgICAgICAgICAgIGlu dCB4XzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLng7 CisgICAgICAgICAgICAgICAgaW50IGZ4XzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bel9udGhdLmZ4OworICAgICAgICAgICAgICAgIGludCB5XzAgPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLnk7CisgICAgICAgICAgICAg ICAgaW50IGZ5XzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9u dGhdLmZ5OworICAgICAgICAgICAgICAgIGludCBocG9zXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmhwb3M7CisgICAgICAgICAgICAgICAgaW50IHZw b3NfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0udnBv czsKKyAgICAgICAgICAgICAgICBpbnQgd2RfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVt6X250aF0ud2Q7CisgICAgICAgICAgICAgICAgaW50IGhfMCA9IG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0uaDsKKyAgICAgICAgICAg ICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlXzAgPSBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmN1cnNvcl90eXBlOworICAgICAgICAgICAg ICAgIGludCBjdXJzb3Jfd2lkdGhfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVt6X250aF0uY3Vyc29yX3dpZHRoOworICAgICAgICAgICAgICAgIHN0cnVjdCBtY19S R0IgbHNsX2ZnXzAgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVt6X250aF0uZm9yZWdyb3VuZC5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bel9udGhdLmZvcmVncm91bmQuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVt6X250aF0uZm9yZWdyb3VuZC5ibHVlfTsKKyAgICAgICAgICAgICAgICBzdHJ1Y3Qg bWNfUkdCIGxzbF9iZ18wID0gey5yZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bel9udGhdLmJhY2tncm91bmQucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3pfbnRoXS5iYWNrZ3JvdW5kLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bel9udGhdLmJhY2tncm91bmQuYmx1ZX07CisgICAgICAgICAgICAgICAgYm9v bCBhY3RpdmVfcF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pf bnRoXS5hY3RpdmVfcDsKKyAgICAgICAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2 b3JfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0uZ2x5 cGhfZmxhdm9yOworICAgICAgICAgICAgICAgIGJvb2wgZW5hYmxlZF9wXzAgPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmVuYWJsZWRfcDsKKyAgICAgICAg ICAgICAgICBpZiAodnBvc18wID09IHZudGgKKyAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhf Zmxhdm9yXzAgPT0gTUNfR0xZUEgKKyAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wXzAK KyAgICAgICAgICAgICAgICAgICAgJiYgdm50aF9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbWNfZXJhc2VfY3Vyc29yICh3LCB3LT5jdXJy ZW50X21hdHJpeCwgdm50aF9yb3csIHhfMCwgeV8wLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGhwb3NfMCwgdnBvc18wLCBnbHlwaF9mbGF2b3JfMCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZV8wLCB3ZF8wKTsKKyAgICAgICAg ICAgICAgICAgICAgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRo XS5lbmFibGVkX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgLS1vbGRfbWF0cml4LmN1 cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICAgICAgICAgICAgLyogSWYgd2UgaW5h ZHZlcnRlbnRseSBlcmFzZWQgYW5vdGhlciBmYWtlIGN1cnNvciBhdCB0aGUgc2FtZQorICAgICAg ICAgICAgICAgICAgICBIUE9TIHRoYXQgaXMgc3RpbGwgZW5hYmxlZF9wIGluIHRoZSBgb2xkX21h dHJpeGAsIHRoZW4gcmVkcmF3IGl0LiAqLworICAgICAgICAgICAgICAgICAgICBmb3IgKGVudW0g bWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgICAgICAgICAgICAg ICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICAgICAgICAgICAgICAgICAgICsr Y2FjaGVfdHlwZSkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg ICAgICBmb3IgKGludCBudGhfMSA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9s ZF9tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdID4gMAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBudGhfMSA8IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2Nh Y2hlX3R5cGVdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICArK250aF8xKQorICAgICAg ICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHhf MSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0ueDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnhfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZng7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgaW50IHlfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf MV0ueTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnlfMSA9IG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZnk7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaW50IGhwb3NfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMV0uaHBvczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgdnBv c18xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS52cG9z OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB3ZF8xID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS53ZDsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICBpbnQgaF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8xXS5oOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5 cGUgY3Vyc29yX3R5cGVfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMV0uY3Vyc29yX3R5cGU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGN1 cnNvcl93aWR0aF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8xXS5jdXJzb3Jfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1j X1JHQiBsc2xfZmdfMSA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8xXS5mb3JlZ3JvdW5kLnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZm9yZWdyb3VuZC5ncmVlbiwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5mb3JlZ3JvdW5kLmJsdWV9 OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2JnXzEgPSB7 LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uYmFj a2dyb3VuZC5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzFdLmJhY2tncm91bmQuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMV0uYmFja2dyb3VuZC5ibHVlfTsKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzFdLmFjdGl2ZV9wOworICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvcl8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYm9vbCBlbmFibGVkX3BfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMV0uZW5hYmxlZF9wOworICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGJvb2wgZ29fcF8xID0gKGhwb3NfMCA9PSBocG9zXzEKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3BfMSk7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaWYgKCFnb19wXzEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBj b250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wXzEgPSBm YWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAo dywgdy0+Y3VycmVudF9tYXRyaXgsIHZudGhfcm93LCB4XzEsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ4XzEsIHlfMSwgZnlfMSwgaHBvc18xLCB2 cG9zXzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHdkXzEsIGhfMSwgY3Vyc29yX3R5cGVfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoXzEsIGxzbF9mZ18xLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcF8xLCBnbHlw aF9mbGF2b3JfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgcmVtb3ZlX3BfMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBl bHNlIGlmICh2cG9zXzAgPT0gdm50aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5h YmxlZF9wXzAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHZudGhfcm93LT5lbmFibGVk X3ApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBib29sIHJl bW92ZV9wXzAgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHli cmlkICh3LCB3LT5jdXJyZW50X21hdHJpeCwgdm50aF9yb3csIHhfMCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnhfMCwgeV8wLCBmeV8wLCBocG9zXzAsIHZw b3NfMCwgd2RfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg aF8wLCBjdXJzb3JfdHlwZV8wLCBjdXJzb3Jfd2lkdGhfMCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgbHNsX2JnXzAsIGFjdGl2ZV9wXzAsIGdseXBoX2ZsYXZv cl8wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVf cF8wKTsKKyAgICAgICAgICAgICAgICAgICAgICBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bel9udGhdLmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAg ICAgIC0tb2xkX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgICAg ICAgICAgICAgLyogSWYgd2UgaW5hZHZlcnRlbnRseSBlcmFzZWQgYW5vdGhlciBmYWtlIGN1cnNv ciBhdCB0aGUgc2FtZQorICAgICAgICAgICAgICAgICAgICAgIEhQT1MgdGhhdCBpcyBzdGlsbCBl bmFibGVkX3AgaW4gdGhlIGBvbGRfbWF0cml4YCwgdGhlbiByZWRyYXcgaXQuICovCisgICAgICAg ICAgICAgICAgICAgICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NB Q0hFOworICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgICAgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBudGhfMiA9IDA7 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2xkX21hdHJpeC5jdXJzb3JzX3VzZWRb Y2FjaGVfdHlwZV0gPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgbnRoXzIg PCBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICArK250aF8yKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB4XzIgPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLng7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBpbnQgZnhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMl0uZng7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeV8y ID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS55OworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZ5XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmZ5OworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgaW50IGhwb3NfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMl0uaHBvczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB2cG9zXzIg PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLnZwb3M7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgd2RfMiA9IG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0ud2Q7CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBpbnQgaF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8yXS5oOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3Jf dHlwZSBjdXJzb3JfdHlwZV8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8yXS5jdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlu dCBjdXJzb3Jfd2lkdGhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMl0uY3Vyc29yX3dpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3Ry dWN0IG1jX1JHQiBsc2xfZmdfMiA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8yXS5mb3JlZ3JvdW5kLnJlZCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5mb3JlZ3JvdW5kLmdyZWVuLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1 ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZm9yZWdy b3VuZC5ibHVlfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0Ig bHNsX2JnXzIgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMl0uYmFja2dyb3VuZC5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMl0uYmFja2dyb3VuZC5ncmVlbiwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmJhY2tncm91bmQuYmx1ZX07 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wXzIgPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmFjdGl2ZV9wOworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yXzIgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmdseXBoX2ZsYXZv cjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgZW5hYmxlZF9wXzIgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmVuYWJsZWRfcDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgZ29fcF8yID0gKGhwb3NfMCA9PSBocG9z XzIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGZ4XzAg PD0gZnhfMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg ZnhfMCArIHdkXzAgPiBmeF8yICsgd2RfMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wXzIpOworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgaWYgKCFnb19wXzIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRp bnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCByZW1vdmVfcF8yID0gZmFs c2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAo dywgdy0+Y3VycmVudF9tYXRyaXgsIHZudGhfcm93LCB4XzIsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnhfMiwgeV8yLCBmeV8yLCBocG9zXzIs IHZwb3NfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICB3ZF8yLCBoXzIsIGN1cnNvcl90eXBlXzIsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoXzIsIGxzbF9mZ18yLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9w XzIsIGdseXBoX2ZsYXZvcl8yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHJlbW92ZV9wXzIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgfQorCisgIGlmICh1cGRhdGluZ19mcmFt ZV9wKQorICAgIHVwZGF0ZV9lbmQgKGYpOworfQorCit2b2lkCittY191cGRhdGVfd2luZG93X2Ry eXJ1biAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wLCBzdHJ1Y3QgbWNfZXNzZW50aWFs cyAqZXNzZW50aWFscykKK3sKKyAgaWYgKCFCVUZGRVJQICh3LT5jb250ZW50cykpCisgICAgcmV0 dXJuOworCisgIGlmICh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA9PSAwCisg ICAgICAmJiB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NBQ0hFXSA9PSAwCisgICAgICAm JiB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NBQ0hFXSA9PSAwCisgICAgICAmJiBOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgJiYgTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmIE5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKQorICAgIHJldHVybjsK KworICAvLyBjbG9ja190IGNsb2NrX3N0YXJ0ID0gY2xvY2soKTsKKworICBib29sIGRyYXdfcCA9 IGZhbHNlOworCisgIHN0cnVjdCBnbHlwaF9tYXRyaXggKnNhdmVkX2Rlc2lyZWQgPSBtY19zYXZl X2dseXBoX21hdHJpeCAody0+ZGVzaXJlZF9tYXRyaXgpOworICBzdHJ1Y3QgZ2x5cGhfbWF0cml4 ICpzYXZlZF9jdXJyZW50ID0gbWNfc2F2ZV9nbHlwaF9tYXRyaXggKHctPmN1cnJlbnRfbWF0cml4 KTsKKworICBzdHJ1Y3QgbWNfbWF0cml4IG9sZF9tYXRyaXggPSBtY19zYXZlX2NhY2hlX21hdHJp eCAody0+bWNfbWF0cml4KTsKKworICBtY19yZXNldF9jYWNoZSAodyk7CisKKyAgbWNfc2V0X2Vz c2VudGlhbHMgKHcsIGVzc2VudGlhbHMpOworCisgIHN0cnVjdCBnbHlwaF9tYXRyaXggKmN1cnNv cl9tYXRyaXggPSBOVUxMOworCisg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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBkZXNpcmVkX21hdHJpeCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm bW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wKTsKKyAgICAgICAgfQorCisgICAgICAvKiBGaW5kIGZp cnN0IGVuYWJsZWQgcm93LiAgT3B0aW1pemF0aW9ucyBpbiByZWRpc3BsYXlfaW50ZXJuYWwKKyAg ICAgICAgIG1heSBsZWFkIHRvIGFuIHVwZGF0ZSB3aXRoIG9ubHkgb25lIHJvdyBlbmFibGVkLiAg VGhlcmUgbWF5CisgICAgICAgICBiZSBhbHNvIGNvbXBsZXRlbHkgZW1wdHkgbWF0cmljZXMuICov CisgICAgICB3aGlsZSAocm93IDwgZW5kICYmICFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgKyty b3c7CisKKyAgICAgIC8qIFRyeSByZXVzaW5nIHBhcnQgb2YgdGhlIGRpc3BsYXkgYnkgY29weWlu Zy4gKi8KKyAgICAgIGlmIChyb3cgPCBlbmQgJiYgIXctPmRlc2lyZWRfbWF0cml4LT5ub19zY3Jv bGxpbmdfcCkKKyAgICAgICAgeworICAgICAgICAgIGludCByYyA9IG1jX3Njcm9sbGluZ193aW5k b3cgKHcsIGhlYWRlcl9saW5lX3JvdyAhPSBOVUxMKTsKKyAgICAgICAgICBpZiAocmMgPCAwKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBBbGwgcm93cyB3ZXJlIGZvdW5kIHRvIGJl IGVxdWFsLiAqLworICAgICAgICAgICAgICBwYXVzZWRfcCA9IDA7CisgICAgICAgICAgICAgIGdv dG8gc2V0X2N1cnNvcjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKHJjID4g MCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIFdlJ3ZlIHNjcm9sbGVkIHRo ZSBkaXNwbGF5LiAqLworICAgICAgICAgIC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fUk9X X1ZQT1MgKG1jX3Jvdywgdy0+ZGVzaXJlZF9tYXRyaXgpOworICAgICAgICAgIGlmIChtY19yb3ct PmVuYWJsZWRfcAorICAgICAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4ID0gdy0+ZGVzaXJlZF9tYXRy aXg7CisgICAgICAgICAgICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRf Y291bnQgPT0gMCkKKyAgICAgICAgICAgICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZ19pZ25vcmVf c3F1ZWV6YWJsZXMgKCk7CisgICAgICAgICAgICAgIGNoYW5nZWRfcCB8PSBtY191cGRhdGVfd2lu ZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3AsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsICpl c3NlbnRpYWxzLCBkcmF3X3ApOworICAgICAgICAgICAgICBpZiAoTUFUUklYX1JPV19CT1RUT01f WSAocm93KSA+PSB5YikKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gdnBvcyArIDE7IGkg PCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAgICAgICAgICBT RVRfTUFUUklYX1JPV19FTkFCTEVEX1AgKHctPmN1cnJlbnRfbWF0cml4LCBpLCBmYWxzZSk7Cisg ICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBjdXJz b3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAvKiBVcGRhdGUgdGhlIHJlc3Qg b2YgdGhlIGxpbmVzLiAqLworICAgICAgZm9yICg7IHJvdyA8IGVuZCAmJiAoZm9yY2VfcCB8fCAh aW5wdXRfcGVuZGluZyk7ICsrcm93KQorICAgICAgICAvKiBzY3JvbGxpbmdfd2luZG93IHJlc2V0 cyB0aGUgZW5hYmxlZF9wIGZsYWcgb2YgdGhlIHJvd3MgaXQgcmV1c2VzIGZyb20KKyAgICAgICAg Y3VycmVudF9tYXRyaXguICovCisgICAgICAgIGlmIChyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAg ICB7CisgICAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCB3LT5kZXNp cmVkX21hdHJpeCk7CisgICAgICAgICAgICAvKiBJZiB0aGUgYGN1cnNvcl9yb3dgIGlzIHdpdGhp biB0aGUgYGRlc2lyZWRfbWF0cml4YCwgdGhlbiBpdCB3YXMKKyAgICAgICAgICAgIHByb2Nlc3Nl ZCBoZXJlaW5hYm92ZSBhbmQgc2hvdWxkIGJlIHNraXBwZWQgYXQgdGhpcyB0aW1lLiAqLworICAg ICAgICAgICAgaWYgKHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICBjb250aW51 ZTsKKyAgICAgICAgICAgIGludCBpOworICAgICAgICAgICAgLyogV2UnbGwgaGF2ZSB0byBwbGF5 IGEgbGl0dGxlIGJpdCB3aXRoIHdoZW4gdG8KKyAgICAgICAgICAgICAgIGRldGVjdF9pbnB1dF9w ZW5kaW5nLiAgSWYgaXQncyBkb25lIHRvbyBvZnRlbiwKKyAgICAgICAgICAgICAgIHNjcm9sbGlu ZyBsYXJnZSB3aW5kb3dzIHdpdGggcmVwZWF0ZWQgc2Nyb2xsLXVwCisgICAgICAgICAgICAgICBj b21tYW5kcyB3aWxsIHRvbyBxdWlja2x5IHBhdXNlIHJlZGlzcGxheS4gKi8KKyAgICAgICAgICAg IGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkKKyAgICAg ICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgpOworICAg ICAgICAgICAgY2hhbmdlZF9wIHw9IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1v dXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsICplc3NlbnRpYWxzLCBkcmF3X3ApOworICAg ICAgICAgICAgLyogTWFyayBhbGwgcm93cyBiZWxvdyB0aGUgbGFzdCB2aXNpYmxlIG9uZSBpbiB0 aGUgY3VycmVudAorICAgICAgICAgICAgICAgbWF0cml4IGFzIGludmFsaWQuICBUaGlzIGlzIG5l Y2Vzc2FyeSBiZWNhdXNlIG9mCisgICAgICAgICAgICAgICB2YXJpYWJsZSBsaW5lIGhlaWdodHMu ICBDb25zaWRlciB0aGUgY2FzZSBvZiB0aHJlZQorICAgICAgICAgICAgICAgc3VjY2Vzc2l2ZSBy ZWRpc3BsYXlzLCB3aGVyZSB0aGUgZmlyc3QgZGlzcGxheXMgNQorICAgICAgICAgICAgICAgbGlu ZXMsIHRoZSBzZWNvbmQgMyBsaW5lcywgYW5kIHRoZSB0aGlyZCA1IGxpbmVzIGFnYWluLgorICAg ICAgICAgICAgICAgSWYgdGhlIHNlY29uZCByZWRpc3BsYXkgd291bGRuJ3QgbWFyayByb3dzIGlu IHRoZQorICAgICAgICAgICAgICAgY3VycmVudCBtYXRyaXggaW52YWxpZCwgdGhlIHRoaXJkIHJl ZGlzcGxheSBtaWdodCBiZQorICAgICAgICAgICAgICAgdGVtcHRlZCB0byBvcHRpbWl6ZSByZWRp c3BsYXkgYmFzZWQgb24gbGluZXMgZGlzcGxheWVkCisgICAgICAgICAgICAgICBpbiB0aGUgZmly c3QgcmVkaXNwbGF5LiAqLworICAgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKHJv dykgPj0geWIpCisgICAgICAgICAgICAgIGZvciAoaSA9IHZwb3MgKyAx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l Y2suICovCisgICAgICAgICAgICYmIEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAm JiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAg ICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJz KSkKKyAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGZjX3Zpc2libGUpKSk7CisgICAgICAgICAgICsrZGVzaXJlZF9yb3cpCisgICAgICAgIHsKKyAg ICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAoZGVzaXJlZF9yb3csIHctPmRlc2ly ZWRfbWF0cml4KTsKKyAgICAgICAgICBpZiAoZGVzaXJlZF9yb3ctPmVuYWJsZWRfcCkKKyAgICAg ICAgICAgIGNvbnRpbnVlOworICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKmJvdHRvbV9yb3cg PSBNQVRSSVhfQk9UVE9NX1RFWFRfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgdyk7CisgICAgICAg ICAgaW50IGJvdHRvbV92cG9zID0gTUFUUklYX1JPV19WUE9TIChib3R0b21fcm93LCB3LT5jdXJy ZW50X21hdHJpeCk7CisgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqY3VycmVudF9yb3cgPSBN QVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgdnBvcyk7CisgICAgICAgICAgZW51bSBtY19y b3dfcG9zaXRpb24gcm93X3Bvc2l0aW9uID0gbWNfcm93X3Bvc2l0aW9uIChjdXJyZW50X3Jvdywg Y3VycmVudF9yb3csIHZwb3MpOworICAgICAgICAgIGlmIChjdXJyZW50X3Jvdy0+ZW5hYmxlZF9w KQorICAgICAgICAgICAgbWNfZHJhd19yb3cgKHcsIHctPmN1cnJlbnRfbWF0cml4LCBjdXJyZW50 X3JvdywgY3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAgICAgICAgICAg ICAgICAgIGN1cnJlbnRfcm93LT54LCBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdLCB2cG9z LAorICAgICAgICAgICAgICAgICAgICAgICAgIGJvdHRvbV92cG9zLCBjdXJzb3JfbWF0cml4LCAq ZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdf cCwgU0VUX0NVUlNPUl9PTkUpOworICAgICAgICB9CisKKyAgICAgIG1jX3Jlc3RvcmVfZ2x5cGhf bWF0cml4IChzYXZlZF9kZXNpcmVkLCB3LT5kZXNpcmVkX21hdHJpeCk7CisgICAgICBtY19yZXN0 b3JlX2dseXBoX21hdHJpeCAoc2F2ZWRfY3VycmVudCwgdy0+Y3VycmVudF9tYXRyaXgpOworCisg ICAgICBtY191cGRhdGVfd2luZG93X2VyYXNlICh3LCBvbGRfbWF0cml4KTsKKworICAgICAgbWNf eGZyZWVfY2FjaGVfbWF0cml4ICh3LCBvbGRfbWF0cml4KTsKKworICAgIH0KKyAgLy8gY2xvY2tf dCBjbG9ja19lbmQgPSBjbG9jaygpOworICAvLyBkb3VibGUgY3B1X3RpbWVfdXNlZCA9ICgoZG91 YmxlKSAoY2xvY2tfZW5kIC0gY2xvY2tfc3RhcnQpKSAvIENMT0NLU19QRVJfU0VDOworICAvLyBm cHJpbnRmIChzdGRlcnIsICJtY19zY3JvbGxpbmdfd2luZG93ICglcyk6ICBUSU1FICglZilcbiIs IG1jX3dpbmRvdyAodyksIGNwdV90aW1lX3VzZWQpOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VS U09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogU3RydWN0dXJlIHRvIHBh c3MgZGltZW5zaW9ucyBhcm91bmQuICBVc2VkIGZvciBjaGFyYWN0ZXIgYm91bmRpbmcKICAgIGJv eGVzLCBnbHlwaCBtYXRyaXggZGltZW5zaW9ucyBhbmQgYWxpa2UuICAqLwogCkBAIC0yMjQxLDYg KzQwODksMTcgQEAgZnJlZV93aW5kb3dfbWF0cmljZXMgKHN0cnVjdCB3aW5kb3cgKncpCiAJICBm cmVlX2dseXBoX21hdHJpeCAody0+Y3VycmVudF9tYXRyaXgpOwogCSAgZnJlZV9nbHlwaF9tYXRy aXggKHctPmRlc2lyZWRfbWF0cml4KTsKIAkgIHctPmN1cnJlbnRfbWF0cml4ID0gdy0+ZGVzaXJl ZF9tYXRyaXggPSBOVUxMOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCisgIGlmICh3LT5tY19tYXRyaXgudnBvc191c2VkID4gMCkKKyAgICBt Y194ZnJlZV9jYWNoZV9tYXRyaXggKHcsIHctPm1jX21hdHJpeCk7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKIAl9CiAKICAgICAgIC8qIE5leHQgd2luZG93IG9uIHNhbWUgbGV2ZWwu ICAqLwpAQCAtMzM4Nyw2ICs1MjQ2LDI2IEBAIGNoZWNrX2N1cnJlbnRfbWF0cml4X2ZsYWdzIChz dHJ1Y3Qgd2luZG93ICp3KQogc3RhdGljIGJvb2wKIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5k b3cgKncsIGJvb2wgZm9yY2VfcCkKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnBy aW50ZiAoc3RkZXJyLCAidXBkYXRlX3dpbmRvdyAoJXMpXG4iLCBtY193aW5kb3cgKHcpKTsKKwor ICBib29sIGRyYXdfcCA9IHRydWU7CisKKyAgc3RydWN0IG1jX2Vzc2VudGlhbHMgZXNzZW50aWFs czsKKyAgbWNfdXBkYXRlX3dpbmRvd19kcnlydW4gKHcsIGZvcmNlX3AsICZlc3NlbnRpYWxzKTsK KworICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpjdXJzb3JfbWF0cml4ID0gTlVMTDsKKworICBzdHJ1 Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKmRlc2lyZWRfbWF0cml4ID0g dy0+ZGVzaXJlZF9tYXRyaXg7CiAgIGJvb2wgcGF1c2VkX3A7CiAgIGludCBwcmVlbXB0X2NvdW50 ID0gY2xpcF90b19ib3VuZHMgKDEsIGJhdWRfcmF0ZSAvIDI0MDAgKyAxLCBJTlRfTUFYKTsKQEAg LTM0NjAsNiArNTMzOSw0NyBAQCB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29s IGZvcmNlX3ApCiAJICAgIH0KIAl9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogUHJvY2VzcyB0aGUgY3Vyc29yIHJvdyBhdCB0aGUg b3V0c2V0IGlmIGl0IGlzIHdpdGhpbiBgZGVzaXJlZF9tYXRyaXhgLgorICBXaGVuIHByb2Nlc3Np bmcgYWxsIG90aGV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ZWN0X2lucHV0X3BlbmRp bmdfaWdub3JlX3NxdWVlemFibGVzICgpOworICAgICAgICAgIGNoYW5nZWRfcCB8PSAoQlVGRkVS UCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgISBOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkpCisgICAgICAgICAgICAgICAgICAgICAgID8gbWNf dXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21h dHJpeCwgZXNzZW50aWFscywgZHJhd19wKQorICAgICAgICAgICAgICAgICAgICAgICA6IHVwZGF0 ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisgICAg ICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKHJvdykgPj0geWIpCisgICAgICAgICAgICBm b3IgKGludCBpID0gdnBvcyArIDE7IGkgPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyAr K2kpCisgICAgICAgICAgICAgIFNFVF9NQVRSSVhfUk9XX0VOQUJMRURfUCAody0+Y3VycmVudF9t YXRyaXgsIGksIGZhbHNlKTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKwor ICBjdXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICAgICAgIC8qIFVwZGF0ZSB0aGUgcmVzdCBvZiB0aGUgbGluZXMuICAqLwog ICAgICAgZm9yICg7IHJvdyA8IGVuZCAmJiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVuZGluZyk7ICsr cm93KQogCS8qIHNjcm9sbGluZ193aW5kb3cgcmVzZXRzIHRoZSBlbmFibGVkX3AgZmxhZyBvZiB0 aGUgcm93cyBpdApAQCAtMzQ2Nyw2ICs1Mzg3LDE5IEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3 aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIAlpZiAocm93LT5lbmFibGVkX3ApCiAJICB7CiAJICAg IGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIGRlc2lyZWRfbWF0cml4KTsKKworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAg ICAgIC8qIElmIHRoZSBgY3Vyc29yX3Jvd2AgaXMgd2l0aGluIHRoZSBgZGVzaXJlZF9tYXRyaXhg LCB0aGVuIGl0IHdhcworICAgICAgICAgIHByb2Nlc3NlZCBoZXJlaW5hYm92ZSBhbmQgc2hvdWxk IGJlIHNraXBwZWQgYXQgdGhpcyB0aW1lLiAqLworICAgICAgICAgIGlmICh2cG9zID09IHctPmN1 cnNvci52cG9zKQorICAgICAgICAgIGNvbnRpbnVlOworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKworCiAJICAgIGludCBpOwogCiAJICAgIC8qIFdlJ2xsIGhhdmUgdG8gcGxheSBhIGxpdHRs ZSBiaXQgd2l0aCB3aGVuIHRvCkBAIC0zNDc1LDggKzU0MDgsMjEgQEAgdXBkYXRlX3dpbmRvdyAo c3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogCSAgICAgICBjb21tYW5kcyB3aWxsIHRv byBxdWlja2x5IHBhdXNlIHJlZGlzcGxheS4gICovCiAJICAgIGlmICghZm9yY2VfcCAmJiArK25f dXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkKIAkgICAgICBkZXRlY3RfaW5wdXRfcGVuZGlu Z19pZ25vcmVfc3F1ZWV6YWJsZXMgKCk7Ci0JICAgIGNoYW5nZWRfcCB8PSB1cGRhdGVfd2luZG93 X2xpbmUgKHcsIHZwb3MsCi0JCQkJCSAgICAgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAg ICAgICAgICBjaGFuZ2VkX3AgfD0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAg ICAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2Nv bmYpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg IHx8ICEgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpKQor ICAgICAgICAgICAgICAgICAgICAgICA/IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywg Jm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIGRyYXdfcCkKKyAg ICAgICAgICAgICAgICAgICAgICAgOiB1cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3Vz ZV9mYWNlX292ZXJ3cml0dGVuX3ApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwogCiAJ ICAgIC8qIE1hcmsgYWxsIHJvd3MgYmVsb3cgdGhlIGxhc3QgdmlzaWJsZSBvbmUgaW4gdGhlIGN1 cnJlbnQKIAkgICAgICAgbWF0cml4IGFzIGludmFsaWQuICBUaGlzIGlzIG5lY2Vzc2FyeSBiZWNh dXNlIG9mCkBAIC0zNDk3LDYgKzU0NDMsNDQgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRv dyAqdywgYm9vbCBmb3JjZV9wKQogCiAgICAgc2V0X2N1cnNvcjoKIAorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAvKiBJZiB3ZSBqdW1wZWQg aGVyZSBmcm9tIGBzZXRfY3Vyc29yYCwgdGhlbiBzZXQgdGhlIGBjdXJzb3JfbWF0cml4YC4gKi8K KyAgaWYgKGN1cnNvcl9tYXRyaXggPT0gTlVMTCkKKyAgICBjdXJzb3JfbWF0cml4ID0gdy0+Y3Vy cmVudF9tYXRyaXg7CisKKyAgLyogUmVzZXQgYHJvd2AgdG8gMCBzbyB0aGF0IGZha2UgY3Vyc29y cyBjYW4gYmUgZHJhd24gb24gcm93cyBwcmVjZWRpbmcgdGhlCisgIGZpcnN0IGByb3ctPmVuYWJs ZWRfcGAuICBKdXN0IHByaW9yIHRvIHRoZSBjYWxsIHRvIGBzY3JvbGxpbmdfd2luZG93JyBhYm92 ZSwKKyAgYHJvd2Agd2FzIGFkdmFuY2VkIHRvIHRoZSBmaXJzdCBgcm93LT5lbmFibGVkX3BgLiAq LworICBmb3IgKHN0cnVjdCBnbHlwaF9yb3cgKmRlc2lyZWRfcm93ID0gTUFUUklYX1JPVyAoZGVz aXJlZF9tYXRyaXgsIDApOworICAgICAgIGRlc2lyZWRfcm93IDwgZW5kCisgICAgICAgJiYgKGZv cmNlX3AgfHwgIWlucHV0X3BlbmRpbmcpCisgICAgICAgLyogVzMyIEVtYWNzIGNyYXNoZXMgb24g c3RhcnR1cCB3aXRob3V0IGEgQlVGRkVSUCBjaGVjay4gKi8KKyAgICAgICAmJiBCVUZGRVJQICh3 LT5jb250ZW50cykKKyAgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgbWNfY29uZikpCisgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpOworICAgICAgICsrZGVzaXJlZF9yb3cpCisgICAg eworICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKGRlc2lyZWRfcm93LCBkZXNpcmVk X21hdHJpeCk7CisgICAgICBpZiAoZGVzaXJlZF9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgY29u dGludWU7CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpib3R0b21fcm93ID0gTUFUUklYX0JPVFRP TV9URVhUX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIHcpOworICAgICAgaW50IGJvdHRvbV92cG9z ID0gTUFUUklYX1JPV19WUE9TIChib3R0b21fcm93LCB3LT5jdXJyZW50X21hdHJpeCk7CisgICAg ICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJyZW50X3JvdyA9IE1BVFJJWF9ST1c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LT5maXhfb3ZlcmxhcHBpbmdfYXJlYSkKIAkgICAgewotCSAgICAgIHJlZHJh d19vdmVybGFwcGVkX3Jvd3MgKHcsIHliKTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogYHJlZHJhd19vdmVybGFwcGVkX3Jvd3MnOiAg UmVkcmF3IGxpbmVzIGZyb20gdGhlIGN1cnJlbnQgbWF0cml4IG9mIHdpbmRvdyBXCit0aGF0IGFy ZSBvdmVybGFwcGVkIGJ5IG90aGVyIHJvd3MuICBZQiBpcyBib3R0b20tbW9zdCB5LXBvc2l0aW9u IGluIFcuICBJZiByb3dzCitvdmVybGFwcGluZyBvdGhlcnMgaGF2ZSBiZWVuIGNoYW5nZWQsIHRo ZSByb3dzIGJlaW5nIG92ZXJsYXBwZWQgaGF2ZSB0byBiZQorcmVkcmF3bi4gIFRoaXMgd29uJ3Qg ZHJhdyBsaW5lcyB0aGF0IGhhdmUgYWxyZWFkeSBiZWVuIGRyYXduIGluIHVwZGF0ZV93aW5kb3cK K2xpbmUgYmVjYXVzZSBvdmVybGFwcGVkX3AgaW4gZGVzaXJlZCByb3dzIGlzIDAsIHNvIGFmdGVy IHJvdyBhc3NpZ25tZW50CitvdmVybGFwcGVkX3AgaW4gY3VycmVudCByb3dzIGlzIDAuICovCisg IGZvciAoaW50IGkgPSAwOyBpIDwgdy0+Y3VycmVudF9tYXRyaXgtPm5yb3dzOyArK2kpCisgICAg eworICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93ID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3Mg KyBpOworICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgYnJlYWs7CisgICAgICAg IGVsc2UgaWYgKHJvdy0+bW9kZV9saW5lX3ApCisgICAgICAgICAgY29udGludWU7CisgICAgICBp ZiAocm93LT5vdmVybGFwcGVkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBmb3IgKGVudW0gZ2x5 cGhfcm93X2FyZWEgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsr YXJlYSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywg aSwgMCwgcm93LT55LCBhcmVhID09IFRFWFRfQVJFQSA/IHJvdy0+eCA6IDApOworICAgICAgICAg ICAgICBpZiAoKHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVdID4gMCB8fCB3LT5t Y19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NBQ0hFXSA+IDAgfHwgdy0+bWNfbWF0cml4LmN1cnNv cnNfdXNlZFtGQ19DQUNIRV0gPiAwKQorICAgICAgICAgICAgICAgICAgJiYgYXJlYSA9PSBURVhU X0FSRUEKKyAgICAgICAgICAgICAgICAgICYmIHJvdy0+dXNlZFthcmVhXSkKKyAgICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3 LT5jdXJyZW50X21hdHJpeDsKKyAgICAgICAgICAgICAgICAgIGludCBzdGFydF94ID0gcm93LT54 OworICAgICAgICAgICAgICAgICAgaW50IHN0YXJ0X2hwb3MgPSAwOworICAgICAgICAgICAgICAg ICAgaW50IGVuZF9ocG9zID0gcm93LT51c2VkW2FyZWFdOworICAgICAgICAgICAgICAgICAgYm9v bCBjbGVhcl9lb2xfcCA9IHRydWU7CisgICAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhz X2ZhY2UgaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgICAgICAgICAgICAgbWNfcmVkcmF3 X3JvdyAodywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJfZW9sX3AsIGhsKTsKKyAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZiAocm93LT51c2VkW2FyZWFdKQorICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRV9SSUYgKGYpLT53cml0 ZV9nbHlwaHMgKHcsIHJvdywgcm93LT5nbHlwaHNbYXJlYV0sIGFyZWEsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT51c2VkW2FyZWFdKTsKKyAg ICAgICAgICAgICAgICAgICAgRlJBTUVfUklGIChmKS0+Y2xlYXJfZW5kX29mX2xpbmUgKHcsIHJv dywgYXJlYSwgLTEpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAg ICAgIHJvdy0+b3ZlcmxhcHBlZF9wID0gMDsKKyAgICAgICAgfQorICAgICAgaWYgKE1BVFJJWF9S T1dfQk9UVE9NX1kgKHJvdykgPj0geWIpCisgICAgICAgIGJyZWFrOworICAgIH0KKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogCSAgICAgIHJlZHJhd19vdmVybGFwcGluZ19yb3dzICh3 LCB5Yik7CiAJICAgIH0KICNlbmRpZgpAQCAtMzUzMSwxMCArNTU2NiwyMSBAQCB1cGRhdGVfd2lu ZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAgICAgICBzdHJjcHkgKHctPmN1 cnJlbnRfbWF0cml4LT5tZXRob2QsIHctPmRlc2lyZWRfbWF0cml4LT5tZXRob2QpOwogI2VuZGlm CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK ICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KKyAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQor ICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykp KQorICAgIG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgMCk7CisgICAgZWxzZQogICAgICAg dXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCAwKTsKICNlbmRpZgogCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAgICAgICAvKiBFbmQgdGhlIHVwZGF0ZSBvZiB3aW5kb3cgVy4gIERvbid0 IHNldCB0aGUgY3Vyc29yIGlmIHdlCiAgICAgICAgICBwYXVzZWQgdXBkYXRpbmcgdGhlIGRpc3Bs YXkgYmVjYXVzZSBpbiB0aGlzIGNhc2UsCiAgICAgICAgICBzZXRfd2luZG93X2N1cnNvcl9hZnRl cl91cGRhdGUgaGFzbid0IGJlZW4gY2FsbGVkLCBhbmQKZGlmZiAtLWdpdCBhL3NyYy9mcmFtZS5o IGIvc3JjL2ZyYW1lLmgKaW5kZXggZWM4ZjYxNC4uZWVhZjcxZSAxMDA2NDQKLS0tIGEvc3JjL2Zy YW1lLmgKKysrIGIvc3JjL2ZyYW1lLmgKQEAgLTIwNSw2ICsyMDUsMTYgQEAgc3RydWN0IGZyYW1l CiAgIExpc3BfT2JqZWN0IHRvb2xfYmFyX2l0ZW1zOwogICAvKiB0b29sX2Jhcl9pdGVtcyBzaG91 bGQgYmUgdGhlIGxhc3QgTGlzcF9PYmplY3QgbWVtYmVyLiAgKi8KIAorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAvKiBOb24tbmlsIHdoZW4g dGhlIGZyYW1lIGlzIGluIHRoZSBwcm9jZXNzIG9mIGJlaW5nIHVwZGF0ZWQuICovCisgIHN0cnVj dCBmcmFtZSAqbWNfdXBkYXRpbmdfZnJhbWU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICAgLyogQ2FjaGUgb2YgcmVhbGl6ZWQgZmFjZXMuICAqLwogICBzdHJ1Y3QgZmFjZV9jYWNo ZSAqZmFjZV9jYWNoZTsKIApkaWZmIC0tZ2l0IGEvc3JjL2ZyaW5nZS5jIGIvc3JjL2ZyaW5nZS5j CmluZGV4IDMzNWE2ZWIuLjJhNjA3NWYgMTAwNjQ0Ci0tLSBhL3NyYy9mcmluZ2UuYworKysgYi9z cmMvZnJpbmdlLmMKQEAgLTQzOCw2ICs0MzgsNDYwIEBAIHN0YXRpYyB1bnNpZ25lZCBzaG9ydCBl bXB0eV9saW5lX2JpdHNbXSA9IHsKICNkZWZpbmUgU1RBTkRBUkRfQklUTUFQX0hFSUdIVChiaXRz KSAoc2l6ZW9mIChiaXRzKS9CWVRFU19QRVJfQklUTUFQX1JPVykKICNkZWZpbmUgRlJCSVRTKGJp dHMpICBiaXRzLCBTVEFOREFSRF9CSVRNQVBfSEVJR0hUIChiaXRzKQogCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBgKy1mcmlu Z2UtaGVscGVyLWRlY2ltYWwnIGRlZmluZWQgaW4gYGNyb3NzaGFpcnMuZWxgICovCisKKy8qIFRP RE86ICBDb25zaWRlciBhZGRpbmcgdGhlIGZvbGxvd2luZyBmcmluZ2UgYml0bWFwczoKKyAgKGRl ZmluZS1mcmluZ2UtYml0bWFwICdicmVha3BvaW50ICJceDNjXHg3ZVx4ZmZceGZmXHhmZlx4ZmZc eDdlXHgzYyIpCisgIChkZWZpbmUtZnJpbmdlLWJpdG1hcCAnaG9sbG93LXJpZ2h0LXRyaWFuZ2xl ICJceGUwXHg5MFx4ODhceDg0XHg4NFx4ODhceDkwXHhlMCIpICovCisKKy8qIDI0CisgICAgKCst ZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4u Li4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLi54eC4u IgorICAgICAgInguLi4ueHguIgorICAgICAgIngueHh4eHh4IgorICAgICAgIngueHh4eHh4Igor ICAgICAgInguLi4ueHguIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLnh4Li4uIgorICAg ICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93X2JpdHNbXSA9 eworICAweDgwLCAweDgwLCAweDgwLCAweDk4LCAweDhjLCAweDg2LCAweGJmLAorICAweGJmLCAw eDg2LCAweDhjLCAweDk4LCAweDgwLCAweDgwLCAweDgwfTsKKworLyogMjUKKyAgICAoKy1mcmlu Z2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgi CisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLnh4Li4ueHgiCisgICAgICAiLi54eC4ueHgiCisg ICAgICAiLi4ueHgueHgiCisgICAgICAieHh4eHh4eHgiCisgICAgICAieHh4eHh4eHgiCisgICAg ICAiLi4ueHgueHgiCisgICAgICAiLi54eC4ueHgiCisgICAgICAiLnh4Li4ueHgiCisgICAgICAi Li4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4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GVjaW1hbAorICAgICAgInh4Li4uLi4uIgorICAgICAg Inh4Li4uLi4uIgorICAgICAgIiB4eC4uLi4uIgorICAgICAgIi54eC4uLi4uIgorICAgICAgIi4u eHguLi4uIgorICAgICAgIi4ueHguLi4uIgorICAgICAgIi4uLnh4Li4uIgorICAgICAgIi4uLnh4 Li4uIgorICAgICAgIi4uLi54eC4uIgorICAgICAgIi4uLi54eC4uIgorICAgICAgIi4uLi4ueHgu IgorICAgICAgIi4uLi4ueHguIgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IikK KyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfYmFja3NsYXNoX2JpdHNbXSA9eworICAweGMw LCAweGMwLCAweGUwLCAweDYwLCAweDMwLCAweDMwLCAweDE4LCAweDE4LCAweGMsIDB4YywgMHg2 LCAweDYsIDB4MywgMHgzfTsKKworLyogMzIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNp bWFsCisgICAgICAieHguLi4uLi4iCisgICAgICAieHguLi4uLi4iCisgICAgICAieHh4Li4uLi4i CisgICAgICAieHh4Li4uLi4iCisgICAgICAieC54eC4uLi4iCisgICAgICAieC54eC4uLi4iCisg ICAgICAieC4ueHguLi4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4uLnh4Li4iCisgICAg ICAieC4uLnh4Li4iCisgICAgICAieC4uLi54eC4iCisgICAgICAieC4uLi54eC4iCisgICAgICAi eC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBt Y192ZXJ0aWNhbF9iYXJfYmFja3NsYXNoX2JpdHNbXSA9eworICAweGMwLCAweGMwLCAweGUwLCAw eGUwLCAweGIwLCAweGIwLCAweDk4LAorICAweDk4LCAweDhjLCAweDhjLCAweDg2LCAweDg2LCAw eDgzLCAweDgzfTsKKworLyogMzMKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisg ICAgICAiLnh4eHh4eC4iCisgICAgICAieHh4eC54Li4iCisgICAgICAieHh4eC54Li4iCisgICAg ICAieHh4eC54Li4iCisgICAgICAiLnh4eC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAi Li4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4u eC54Li4iCisgICAgICAiLi4ueC54Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19w aWxjcm93X2JpdHNbXSA9eworICAweDdlLCAweGY0LCAweGY0LCAweGY0LCAweDc0LCAweDE0LCAw eDE0LCAweDE0LCAweDE0LCAweDE0LCAweDE0fTsKKworLyogMzQKKyAgICAoKy1mcmluZ2UtaGVs cGVyLWhleGFkZWNpbWFsCisgICAgICAiLi54eHh4Li4iCisgICAgICAiLnh4eHh4eC4iCisgICAg ICAieC4ueHguLngiCisgICAgICAieC4ueHguLngiCisgICAgICAieHh4eHh4eHgiCisgICAgICAi eHguLi4ueHgiCisgICAgICAieHh4Li54eHgiCisgICAgICAiLnh4eHh4eC4iCisgICAgICAiLi54 eHh4Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zbWlsZXlfZmFjZV9iaXRzW10g PXsKKyAgMHgzYywgMHg3ZSwgMHg5OSwgMHg5OSwgMHhmZiwgMHhjMywgMHhlNywgMHg3ZSwgMHgz Y307CisKKy8qIDM1CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4u eC4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLi4u eC4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC4uLi4u IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX3JpZ2h0X2JpdHNb XSA9eworICAweDIwLCAweDEwLCAweDgsIDB4NCwgMHg4LCAweDEwLCAweDIwfTsKKworLyogMzYK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi54Li4iCisgICAg ICAiLi4uLnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54Li4uLi4iCisgICAgICAi Li4ueC4uLi4iCisgICAgICAiLi4uLnguLi4iCisgICAgICAiLi4uLi54Li4iKQorKi8KK3N0YXRp YyB1bnNpZ25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHg0LCAw eDgsIDB4MTAsIDB4MjAsIDB4MTAsIDB4OCwgMHg0fTsKKworLyogMzcKKyAgICAoKy1mcmluZ2Ut aGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHgueHguLi4iCisgICAgICAiLnh4Lnh4Li4iCisg ICAgICAiLi54eC54eC4iCisgICAgICAiLi4ueHgueHgiCisgICAgICAiLi54eC54eC4iCisgICAg ICAiLnh4Lnh4Li4iCisgICAgICAieHgueHguLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9y dCBtY19kb3VibGVfYW5nbGVfcmlnaHRfYml0c1tdID17CisgIDB4ZDgsIDB4NmMsIDB4MzYsIDB4 MWIsIDB4MzYsIDB4NmMsIDB4ZDh9OworCisvKiAzOAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4 YWRlY2ltYWwKKyAgICAgICIuLi54eC54eCIKKyAgICAgICIuLnh4Lnh4LiIKKyAgICAgICIueHgu eHguLiIKKyAgICAgICJ4eC54eC4uLiIKKyAgICAgICIueHgueHguLiIKKyAgICAgICIuLnh4Lnh4 LiIKKyAgICAgICIuLi54eC54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2RvdWJs ZV9hbmdsZV9sZWZ0X2JpdHNbXSA9eworICAweDFiLCAweDM2LCAweDZjLCAweGQ4LCAweDZjLCAw eDM2LCAweDFifTsKKworLyogMzkKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisg ICAgICAieC54LnguLi4iCisgICAgICAiLngueC54Li4iCisgICAgICAiLi54LngueC4iCisgICAg ICAiLi4ueC54LngiCisgICAgICAiLi54LngueC4iCisgICAgICAiLngueC54Li4iCisgICAgICAi eC54LnguLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfcmln aHRfYml0c1tdID17CisgIDB4YTgsIDB4NTQsIDB4MmEsIDB4MTUsIDB4MmEsIDB4NTQsIDB4YTh9 OworCisvKiA0MAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi54 LngueCIKKyAgICAgICIuLngueC54LiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICJ4LngueC4u LiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICIuLngueC54LiIKKyAgICAgICIuLi54LngueCIp CisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBsZV9hbmdsZV9sZWZ0X2JpdHNbXSA9 eworICAweDE1LCAweDJhLCAweDU0LCAweGE4LCAweDU0LCAweDJhLCAweDE1fTsKKworLyogNDEK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAg ICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAi Li4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4u Li4ueC4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4u Li4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5n bGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MTAsIDB4 MjgsIDB4NDQsIDB4ODIsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9OworCisvKiA0MgorICAgICgr LWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4u Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54 LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4uLiIK KyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAg ICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3NpbmdsZV9hbmds ZV9kb3duX2JpdHNbXSA9eworICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDgyLCAweDQ0LCAw eDI4LCAweDEwLCAweDAwLCAweDAwLCAweDAwLCAweDAwfTsKKworLyogNDMKKyAgICAoKy1mcmlu Z2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4i CisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisg ICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAg ICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAi Li4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBt Y19kb3VibGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MTAsIDB4 MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4ODIsIDB4MDAsIDB4MDAsIDB4MDB9OworCisv KiA0NAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIK KyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54LiIKKyAg ICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAg ICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIu Li4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGlj IHVuc2lnbmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDAwLCAw eDAwLCAweDAwLCAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDEwLCAweDAw LCAweDAwLCAweDAwfTsKKworLyogNDUKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFs CisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisg ICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAg ICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAi LnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRp YyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4 MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4ODIs IDB4MDB9OworCisvKiA0NgorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAg ICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIu LngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngu eC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4u LiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2ln bmVkIHNob3J0IG1jX3F1YWRydXBsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDAwLCAweDgy LCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDEwLCAw eDAwfTsKKworLyogNDcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAi Li4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4u eC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4u eC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4i CisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iKQor Ki8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVwbGVfYW5nbGVfdXBfYml0c1tdID17 CisgIDB4MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQs IDB4OTIsIDB4MjgsIDB4NDQsIDB4ODJ9OworCisvKiA0OAorICAgICgrLWZyaW5nZS1oZWxwZXIt aGV4YWRlY2ltYWwKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIu LngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngu eC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4u LiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIK KyAgICAgICIuLi54Li4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBsZV9h bmdsZV9kb3duX2JpdHNbXSA9eworICAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4 LCAweDkyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDEwfTsKKwogLyogTk9URTog IFRoZSBvcmRlciBvZiB0aGVzZSBiaXRtYXBzIG11c3QgbWF0Y2ggdGhlIHNlcXVlbmNlCiAgICB1 c2VkIGluIGZyaW5nZS5lbCB0byBkZWZpbmUgdGhlIGNvcnJlc3BvbmRpbmcgc3ltYm9scy4gICov CiAKQEAgLTQ2Nyw4ICs5MjEsMTA3NiBAQCBzdGF0aWMgc3RydWN0IGZyaW5nZV9iaXRtYXAgc3Rh bmRhcmRfYml0bWFwc1tdID0KICAgeyBGUkJJVFMgKHZlcnRpY2FsX2Jhcl9iaXRzKSwgICAgICAg OCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAogICB7IEZSQklUUyAoaG9yaXpvbnRhbF9i YXJfYml0cyksICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQk9UVE9NLCAwIH0sCiAgIHsgRlJCSVRT IChlbXB0eV9saW5lX2JpdHMpLCAgICAgICAgIDgsIDMsIEFMSUdOX0JJVE1BUF9UT1AsICAgIDAg fSwKKworICAvKiAyNCAqLworICB7RlJCSVRTIChtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3df Yml0cyksIDgsIDAsIEFMSUdOX0JJVE1BUF9DRU5URVIsIDB9LAorICAvKiAyNSAq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KGJtMSkpLCBOSUxQ IChibTEpKQorICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgaWYgKENPTlNQ IChibTEpKQorICAgICAgeworICAgICAgICBsbjEgPSBYRklYTlVNIChGbGVuZ3RoIChibTEpKTsK KyAgICAgICAgaWYgKHBhcnRpYWxfcCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpZiAobG4x ID4gaXgyKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYm0gPSBtY19udGggKGl4 MiwgYm0xKTsKKyAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICAgICAg ICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgICAg ZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChsbjEgPiBpeDEpCisgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAgICAgICAg ICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOwor ICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgfQorICAgIGVsc2UgaWYgKChibSA9 IGJtMSwgIUVRIChibSwgUXQpKSkKKyAgICAgIGdvdG8gZm91bmQ7CisgIH0KKyAgICB9CisgIGlm ICghRVEgKGNtYXAsIEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxp c3QpKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRp Y2F0b3JfYWxpc3QpKSkKKyAgICB7CisgICAgICBibTIgPSBtY19hc3NxIChiaXRtYXAsIEJWQVIg KCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKTsKKyAgICAgIGlmIChD T05TUCAoYm0yKSkKKyAgICAgICAgeworICAgICAgICAgIGlmICgoYm0yID0gWENEUiAoYm0yKSks ICFOSUxQIChibTIpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoQ09OU1AgKGJt MikpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgbG4yID0gWEZJWE5VTSAo Rmxlbmd0aCAoYm0yKSk7CisgICAgICAgICAgICAgICAgICBpZiAocGFydGlhbF9wKQorICAgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKGxuMiA+IGl4MikKKyAg ICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYm0gPSBt Y19udGggKGl4MiwgYm0yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0s IFF0KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBpZiAobG4xID4gaXgxKQorICAg IHsKKyAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICBpZiAoIUVRIChibSwgUXQp KQorICAgICAgICBnb3RvIGZvdW5kOworICAgIH0KKyAgaWYgKGxuMiA+IGl4MSkKKyAgICB7Cisg ICAgICBibSA9IG1jX250aCAoaXgxLCBibTIpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAg ICAgICAgZ290byBmb3VuZDsKKyAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICAg IH0KKyAgICBlbHNlIGlmICgoYm0gPSBibTIsIE5JTFAgKGJtKSkpCisgICAgICByZXR1cm4gTUNf Tk9fRlJJTkdFX0JJVE1BUDsKKyAgZm91bmQ6CisgIHJldHVybiBsb29rdXBfZnJpbmdlX2JpdG1h cC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iAoKGJtMSA9IFhDRFIgKGJt MSkpLCBOSUxQIChibTEpKQorICAgICAgICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7 CisgICAgICAgICAgaWYgKENPTlNQIChibTEpKQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBsbjEgPSBYRklYTlVNIChGbGVuZ3RoIChibTEpKTsKKyAgICAgICAgICAgICAgaWYgKHBhcnRp YWxfcCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAobG4xID4gaXgy KQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgYm0gPSBtY19u dGggKGl4MiwgYm0xKTsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQor ICAgICAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgIGlmIChsbjEgPiBpeDEpCisgICAgICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAgICAg ICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICAgICAg ICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAoKGJtID0gYm0xLCAhRVEgKGJtLCBR dCkpKQorICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICB9CisgICAgfQorICBpZiAo IUVRIChjbWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0 KSkKKyAgICAgICYmICFOSUxQIChCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNh dG9yX2FsaXN0KSkpCisgICAgeworICAgICAgYm0yID0gbWNfYXNzcSAoYml0bWFwLCBCVkFSICgm YnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSk7CisgICAgICBpZiAoQ09O U1AgKGJtMikpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoKGJtMiA9IFhDRFIgKGJtMikpLCAh TklMUCAoYm0yKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKENPTlNQIChibTIp KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGxuMiA9IFhGSVhOVU0gKEZs ZW5ndGggKGJtMikpOworICAgICAgICAgICAgICAgICAgaWYgKHBhcnRpYWxfcCkKKyAgICAgICAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGlmIChsbjIgPiBpeDIpCisgICAg ICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNf bnRoIChpeDIsIGJtMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBR dCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4MSkKKyAgICB7 CisgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkK KyAgICAgICAgZ290byBmb3VuZDsKKyAgICB9CisgIGlmIChsbjIgPiBpeDEpCisgICAgeworICAg ICAgYm0gPSBtY19udGggKGl4MSwgYm0yKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAg ICAgIGdvdG8gZm91bmQ7CisgICAg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cSAoUXQsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAgYm91bmRhcnlfdG9wID0gYm91 bmRhcnlfYm90ID0gYXJyb3dfdG9wID0gYXJyb3dfYm90ID0gWENEUiAocG9zKTsKKyAgICAgICAg ICBpZiAocG9zID0gbWNfYXNzcSAoUXRvcCwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAg ICBib3VuZGFyeV90b3AgPSBYQ0RSIChwb3MpOworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3Nx IChRYm90dG9tLCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAgIGJvdW5kYXJ5X2JvdCA9 IFhDRFIgKHBvcyk7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFF1cCwgaW5kKSwgIU5J TFAgKHBvcykpCisgICAgICAgICAgICBhcnJvd190b3AgPSBYQ0RSIChwb3MpOworICAgICAgICAg IGlmIChwb3MgPSBtY19hc3NxIChRZG93biwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAg ICBhcnJvd19ib3QgPSBYQ0RSIChwb3MpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAg ICAgICAvKiBBbnl0aGluZyBlbHNlIG1lYW5zIGJvdW5kYXJ5IG9uIGxlZnQgYW5kIG5vIGFycm93 cy4gICovCisgICAgICAgICAgYm91bmRhcnlfdG9wID0gYm91bmRhcnlfYm90ID0gUWxlZnQ7Cisg ICAgfQorICB0b3BfaW5kX3JuID0gYm90X2luZF9ybiA9IC0xOworICBpZiAoIU5JTFAgKGluZCkp CisgICAgeworICAgICAgZm9yICh5ID0gdy0+dnNjcm9sbCwgcm4gPSAwOworICAgICAgICAgICB5 IDwgeWIgJiYgcm4gPCBucm93czsKKyAgICAgICAgICAgeSArPSByb3ctPmhlaWdodCwgKytybikK KyAgICAgICAgeworICAgICAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm47 CisgICAgICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgICAgIHJvdyA9IHctPmN1 cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib2JfcCA9 IHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCA9IDA7CisgICAgICAgICAgcm93LT5pbmRpY2F0ZV9l b2JfcCA9IHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCA9IDA7CisgICAgICAgICAgaWYgKCFy b3ctPm1vZGVfbGluZV9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAodG9wX2lu ZF9ybiA8IDAgJiYgcm93LT52aXNpYmxlX2hlaWdodCA+IDApCisgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfU1RBUlRfQ0hBUlBPUyAocm93KSA8PSBC VUZfQkVHViAoWEJVRkZFUiAody0+Y29udGVudHMpKQorICAgICAgICAgICAgICAgICAgICAgICYm ICFNQVRSSVhfUk9XX1BBUlRJQUxMWV9WSVNJQkxFX0FUX1RPUF9QICh3LCByb3cpKQorICAgICAg ICAgICAgICAgICAgICByb3ctPmluZGljYXRlX2JvYl9wID0gIU5JTFAgKGJvdW5kYXJ5X3RvcCk7 CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICByb3ctPmlu ZGljYXRlX3RvcF9saW5lX3AgPSAhTklMUCAoYXJyb3dfdG9wKTsKKyAgICAgICAgICAgICAgICAg IHRvcF9pbmRfcm4gPSBybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGlmIChi b3RfaW5kX3JuIDwgMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAo TUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSA+PSBCVUZfWlYgKFhCVUZGRVIgKHctPmNvbnRl bnRzKSkKKyAgICAgICAgICAgICAg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FUSAoYm91bmRhcnlfYm90LCBRbGVmdCkpCisgICAgICAgICAg ICAgICAgICA/IE1DX0xFRlRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwgcm93LT5lbmRzX2F0X3p2 X3ApCisgICAgICAgICAgICAgICAgICA6IE1DX0xFRlRfRlJJTkdFICgyLCBRdG9wLCAwKSk7Cisg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGJuID0gKChyb3ctPmluZGljYXRlX2VvYl9w ICYmIEVRIChib3VuZGFyeV9ib3QsIFFyaWdodCkpCisgICAgICAgICAgICAgICAgICAgID8gTUNf UklHSFRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwgcm93LT5lbmRzX2F0X3p2X3ApCisgICAgICAg ICAgICAgICAgICAgIDogTUNfUklHSFRfRlJJTkdFICgyLCBRdG9wLCAwKSk7CisgICAgICAgIH0K KyAgICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGluZV9wKQorICAgICAgICAgIHsK KyAgICAgICAgICAgIGlmIChFUSAoYXJyb3dfdG9wLCBRbGVmdCkpCisgICAgICAgICAgICAgIGJu ID0gTUNfTEVGVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICBibiA9IE1DX1JJR0hUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICB9 CisgICAgICBpZiAoYm4gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgeworICAgICAg ICAgIHN0cnVjdCBmcmluZ2VfYml0bWFwICpmYiA9IGdldF9mcmluZ2VfYml0bWFwX2RhdGEgKGJu KTsKKyAgICAgICAgICBpZiAoZmItPmFsaWduID09IEFMSUdOX0JJVE1BUF9UT1AgJiYgZmItPnBl cmlvZCA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93 ICpyb3cxOworICAgICAgICAgICAgICBpbnQgdG9wX2luZF9tYXhfeTsKKyAgICAgICAgICAgICAg dG9wX2luZF9taW5feSA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAgICAgICAg ICAgICB0b3BfaW5kX21heF95ID0gdG9wX2luZF9taW5feSArIGZiLT5oZWlnaHQ7CisgICAgICAg ICAgICAgIGlmICh0b3BfaW5kX21heF95ID4geWIpCisgICAgICAgICAgICAgICAgdG9wX2luZF9t YXhfeSA9IHliOworICAgICAgICAgICAgICBmb3IgKHkgPSByb3ctPnkgKyByb3ctPmhlaWdodCwg cm4gPSB0b3BfaW5kX3JuICsgMTsKKyAgICAgICAgICAgICAgICAgICB5IDwgdG9wX2luZF9tYXhf eSAmJiBybiA8IG5yb3dzOworICAgICAgICAgICAgICAgICAgIHkgKz0gcm93MS0+aGVpZ2h0LCBy bisrKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChib3RfaW5kX3Ju ID49IDAgJiYgcm4gPj0gYm90X2luZF9ybikKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7Cisg ICAgICAgICAgICAgICAgICByb3cxID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBybjsKKyAg ICAgICAgICAgICAgICAgIGlmICghcm93MS0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgICAgICAg ICByb3cxID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICAgICAgICAg IHJvdzEtPmluZGljYXRlX2JvYl9wID0gcm93LT5pbmRpY2F0ZV9ib2JfcDsKKyAgICAgICAgICAg ICAgICAgIHJvdzEtPmluZGljYXRlX3RvcF9saW5lX3AgPSByb3ctPmluZGljYXRlX3RvcF9saW5l X3A7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQor ICBpZiAoYm90X2luZF9ybiA+PSAwKQorICAgIHsKKyAgICAgIGludCBibiA9IE1DX05PX0ZSSU5H RV9CSVRNQVA7CisgICAgICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIGJvdF9pbmRf cm47CisgICAgICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICByb3cgPSB3LT5jdXJyZW50 X21hdHJpeC0+cm93cyArIGJvdF9pbmRfcm47CisgICAgICBib3Rfcm93X2VuZHNfYXRfenZfcCA9 IHJvdy0+ZW5kc19hdF96dl9wOworICAgICAgaWYgKHJvdy0+aW5kaWNhdGVfZW9iX3ApCisgICAg ICAgIHsKKyAgICAgICAgICBpZiAoRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQpKQorICAgICAgICAg ICAgYm4gPSBNQ19MRUZUX0ZSSU5HRSAoMywgUWJvdHRvbSwgcm93LT5lbmRzX2F0X3p2X3ApOwor ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBibiA9IE1DX1JJR0hUX0ZSSU5HRSAoMywg UWJvdHRvbSwgcm93LT5lbmRzX2F0X3p2X3ApOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYg KHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBp ZiAoRVEgKGFycm93X2JvdCwgUWxlZnQpKQorICAgICAgICAgICAgICBibiA9IE1DX0xFRlRfRlJJ TkdFICg3LCBRZG93biwgMCk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBi biA9IE1DX1JJR0hUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAgIH0KKyAgICAgIGlm IChibiAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0 IGZyaW5nZV9iaXRtYXAgKmZiID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAoYm4pOworICAgICAg ICAgIGlmIChmYi0+YWxpZ24gPT0gQUxJR05fQklUTUFQX0JPVFRPTSAmJiBmYi0+cGVyaW9kID09 IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdzE7 CisgICAgICAgICAgICAgIGludCBib3RfaW5kX21pbl95OworICAgICAgICAgICAgICBib3RfaW5k X21heF95ID0gcm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdodDsKKyAgICAgICAgICAgICAgYm90 X2luZF9taW5feSA9IGJvdF9pbmRfbWF4X3kgLSBmYi0+aGVpZ2h0OworICAgICAgICAgICAgICBp ZiAoYm90X2luZF9taW5feSA8IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpKQorICAgICAg ICAgICAgICAgIGJvdF9pbmRfbWluX3kgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsK KyAgICAgICAgICAgICAgZm9yICh5ID0gcm93LT55LCBybiA9IGJvdF9pbmRfcm4gLSAxOworICAg ICAgICAgICAgICAgICAgIHkgPj0gYm90X2luZF9taW5feSAmJiBybiA+PSAwOworICAgICAgICAg ICAgICAgICAgIHkgLT0gcm93MS0+aGVpZ2h0LCBybi0tKQorICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgIGlmICh0b3BfaW5kX3JuID49IDAgJiYgcm4gPD0gdG9wX2luZF9ybikK KyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICByb3cxID0gdy0+ ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICAgICAgICAgIGlmICghcm93MS0+ ZW5hYmxlZF9wKQorICAgICAgICAgICAgICAgICAgICByb3cxID0gdy0+Y3VycmVudF9tYXRyaXgt PnJvd3MgKyBybjsKKyAgICAgICAgICAgICAgICAgIHJvdzEtPmluZGljYXRlX2VvYl9wID0gcm93 LT5pbmRpY2F0ZV9lb2JfcDsKKyAgICAgICAgICAgICAgICAgIHJvdzEtPmluZGljYXRlX2JvdHRv bV9saW5lX3AgPSByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3A7CisgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBMaXNwX09iamVjdCBidWYgPSB3 LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYpOworICBib29sIGF1dG9faHNjcm9sbF9t b2RlX3AgPSBFUSAoRmJ1ZmZlcl9sb2NhbF92YWx1ZSAoUWF1dG9faHNjcm9sbF9tb2RlLCBidWYp LCBRY3VycmVudF9saW5lKTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwtbGVmdCA1KSAqLworICBi b29sIGhzY2xfYWxsX3RlbXBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHctPm1pbl9oc2Nyb2xsID09IDApOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBu b3RoaW5nLiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMF9wID0gKHctPnN1c3BlbmRfYXV0b19o c2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9sbCk7CisgIC8qIEVY QU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyBlbHNlIGJlc2lkZXMgaG9yaXpvbnRh bGx5IHNjcm9sbGluZyB0aGUKKyAgICAgICAgICAgICAgIGN1cnJlbnQgbGluZSBkaWZmZXJlbnRs eS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Ny b2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8xX3AgPSAoIXctPnN1 c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19o c2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwg PiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9s bCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIC4uLgorICAgICAgICAgICAgICAgQ3Vy cmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4gKi8K KyAgYm9vbCBoc2NsX2FsbF9wZXJtXzJfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA9PSAwCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICAo c2Nyb2xsLWxlZnQgNSk7IGFuZCwgdGhlbiBwcmVzcyB0aGUgbGVmdCBhcnJvdyBrZXkgb25lIHRp bWUuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xs ZWQgZGlmZmVyZW50bHkuKi8KKyAgYm9vbCBoc2NsX3RlbXBfcCA9ICghdy0+c3VzcGVuZF9hdXRv X2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBh bmQgZG8gc29tZXRoaW5nIHRoYXQgY2F1c2VzIHRoZSBjdXJyZW50IGxpbmUgdG8gYmUKKyAgICAg ICAgICAgICAgIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4KKyAgICAgICAgICAg ICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4g Ki8KKyAgYm9vbCBoc2NsX3Blcm1fcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAg ICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5f aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCAhPSB3 LT5oc2Nyb2xsKTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIGZv ciAoeSA9IHctPnZzY3JvbGwsIHJuID0gMDsKKyAgICAgICB5IDwgeWIgJiYgcm4gPCBucm93czsK KyAgICAgICB5ICs9IHJvdy0+aGVpZ2h0LCBybisrKQorICAgIHsKKyAgaW50IGxlZnQsIHJpZ2h0 OworICB1bnNpZ25lZCBsZWZ0X2ZhY2VfaWQsI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vc19jdXJyZW50KQorICAg ICAgICAgICYmIGdseXBoX2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUAorICAgICAg ICAgICYmICFoc2NsX2FsbF90ZW1wX3AKKyAgICAgICAgICAmJiAhaHNjbF90ZW1wX3AKKyAgICAg ICAgICAmJiAhaHNjbF9wZXJtX3AKKyAgICAgICAgICAmJiAhaHNjbF9hbGxfcGVybV8wX3AKKyAg ICAgICAgICAmJiAhaHNjbF9hbGxfcGVybV8xX3AKKyAgICAgICAgICAmJiAhaHNjbF9hbGxfcGVy bV8yX3AKKyAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpbnQg ZnJpbmdlX2JpdG1hcCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgZW51bSBmYWNl X2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgICAoIWFjdGl2ZV9wCisgICAg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3Rp dmVfd2luZG93cykpKQorICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1vdmVybGF5LWFycm93LWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAg ICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAo dywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LXByZS16di1mYWNlIiksIHRydWUpCisgICAg ICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9mYWNl X2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAg ICBpZiAody0+aHNjcm9sbCAhPSAwKQorICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dl dF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ciKSwgZmFsc2UsIHRy dWUpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNf Z2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJvdyIpLCB0cnVlLCB0 cnVlKTsKKyAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0g TUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBN Q19OT19GUklOR0VfQklUTUFQOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKCh2cG9zID09 IHZwb3NfZGVzaXJlZCB8fCB2cG9zID09IHZwb3NfY3VycmVudCkKKyAgICAgICAgICAgICAgICAg JiYgZ2x5cGhfZmxhdm9yID09IE1DX09WRVJMQVlfQVJST1dfQklUTUFQCisgICAgICAgICAgICAg ICAgICYmIChoc2NsX2FsbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxs X3Blcm1fMF9wCisgICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzFfcAorICAg ICAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8yX3AKKyAgICAgICAgICAgICAgICAg ICAgIHx8IGhzY2xfdGVtcF9wCisgICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX3Blcm1fcCkK KyAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAg IGludCBmcmluZ2VfYml0bWFwID0gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICAgIGVu dW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQgPQorICAgICAgICAgICAgICAoIWFjdGl2 ZV9wCisgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2NsLWluYWN0aXZlLXByZS16di1m YWNlIiksIHRydWUpCisgICAgICAgICAgICAgIDogKGFjdGl2ZV9wKQorICAgICAgICAgICAgICAg ID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2Ns LXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOwor ICAgICAgICAgICAgbWNfbGVmdF9mcmluZ2VfZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19M RUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgICAgaWYgKGhzY2xfYWxsX3Blcm1f MF9wKQorICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAg KHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIGZhbHNlLCBmYWxzZSk7CisgICAgICAgICAgICAg IGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMV9wKQorICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRt YXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1 ZSwgZmFsc2UpOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMl9wKQor ICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3 LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCBmYWxzZSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAg ICBlbHNlIGlmIChoc2NsX3Blcm1fcCkKKyAgICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1h cCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCB0cnVl LCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfdGVtcF9wKQor ICAgICAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1h cCAodywgaW50ZXJuICgiKy1oc2NsLXRlbXAiKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAg ICAgICAgICAgICBlbHNlIGlmIChoc2NsX3RlbXBfcCkKKyAgICAgICAgICAgICAgICAgICAgICAg IGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2Ns LXRlbXAiKSwgdHJ1ZSwgZmFsc2UpOworICAgICAgICAgICAgbWNfbGVmdF9mcmluZ2VfYml0bWFw ID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgfQor ICAgICAgICAgIGVsc2UgaWYgKCh2cG9zID09IHZwb3NfZGVzaXJlZCB8fCB2cG9zID09IHZwb3Nf Y3VycmVudCkKKyAgICAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xM T1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAg ICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5H TEUKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAg ICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAg ICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIK KyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9C QVJfQkFDS1NMQVNIKQorICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGJpdG1hcF9mbGF2b3IgPSAoZ2x5cGhf Zmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0 X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVykKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRf aG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19y ZWN0YW5nbGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGds eXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9h cnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhf Zmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGlj YWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXIKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2JhcgorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JB Ul9CQUNLU0xBU0gpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogUW5pbDsKKyAgICAgICAgICAgICAgbWNfcmlnaHRfZnJpbmdlX2Jp dG1hcCA9IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJp dG1hcF9mbGF2b3IpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBN Q19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgICAgICBtY19yaWdodF9mcmluZ2VfZmFjZV9p ZCA9CisgICAgICAgICAgICAgICAgKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRN QVAKKyAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVgorICAgICAgICAg ICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVf UklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAgICAg ICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1iYXIt cHJlLXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBN Q19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9u ID09IEFUX1pWCisgICAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZF UlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAg IHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cK KyAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZF UlRJQ0FMX0JBUikpCisgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBm LCBpbnRlcm4gKCIrLXJldmVyc2VkLWJhci1hdC16di1mYWNlIiksIHRydWUpCisgICAgICAgICAg ICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAg ICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQT1NUX1pWCisgICAgICAgICAgICAgICAgICAg JiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FS Uk9XCisgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5 cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikpCisgICAgICAgICAgICAgICAg ICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJldmVyc2VkLWJhci1wb3N0 LXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19S SUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09 IFBSRV9aVgorICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNF RF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5 cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAg ICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIp CisgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIr LWJhci1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgIDogKGN1cnNvcl90eXBl ID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9z aXRpb24gPT0gQVRfWlYKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNf UkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAg ICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cK KyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSKQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1iYXItYXQtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgIDogKGN1cnNv cl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAmJiBy b3dfcG9zaXRpb24gPT0gUE9TVF9aVgorICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZv ciAhPSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAg ICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdI VF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3 LCBmLCBpbnRlcm4gKCIrLWJhci1wb3N0LXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAg ICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYg KCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgcm93ID0gY3VyOworICAgICAgbGVmdF9mYWNlX2lk ID0gcmlnaHRfZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgIGxlZnRfb2Zmc2V0ID0g cmlnaHRfb2Zmc2V0ID0gMDsKKyAgICAgIHBlcmlvZGljX3AgPSAwOworICAgICAgLyogRGVjaWRl IHdoaWN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IHRvcF9pbmRfbWluX3kgLSBy b3ctPnk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYg RVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVmdCA9IE1D X0xFRlRfRlJJTkdFICgzLCBRYm90dG9tLCBib3Rfcm93X2VuZHNfYXRfenZfcCk7CisgICAgICAg ICAgaWYgKGJvdF9pbmRfbWF4X3kgPj0gMCkKKyAgICAgICAgICAgIGxlZnRfb2Zmc2V0ID0gYm90 X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgfQor ICAgICAgZWxzZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgTUFUUklYX1JPV19DT05USU5VQVRJ T05fTElORV9QIChyb3cpKQorICAgICAgICAgICAgICAgfHwgKHJvdy0+cmV2ZXJzZWRfcCAmJiBy b3ctPmNvbnRpbnVlZF9wKSkKKyAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg0LCBRY29u dGludWF0aW9uLCAwKTsKKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfZW1wdHlfbGluZV9w ICYmIEVRIChlbXB0eV9wb3MsIFFsZWZ0KSkKKyAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdF ICg1LCBRZW1wdHlfbGluZSwgMCk7CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX3RvcF9s aW5lX3AgJiYgRVEgKGFycm93X3RvcCwgUWxlZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVm dCA9IE1DX0xFRlRfRlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAgIGlmICh0b3BfaW5kX21p bl95ID49IDApCisgICAgICAgICAgICBsZWZ0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSByb3ct Pnk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVf cCAmJiBFUSAoYXJyb3dfYm90LCBRbGVmdCkpCisgICAgICAgIHsKKyAgICAgICAgICBsZWZ0ID0g TUNfTEVGVF9GUklOR0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhf eSA+PSAwKQorICAgICAgICAgICAgbGVmdF9vZmZzZXQgPSBib3RfaW5kX21heF95IC0gKHJvdy0+ eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAg IGxlZnQgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgLyogRGVjaWRlIHdoaWNoIGJpdG1h cCB0byBkcmF3IGluIHRoZSByaWdodCBmcmluZ2UuICAqLworICAgICAgaWYgKFdJTkRPV19SSUdI VF9GUklOR0VfV0lEVEggKHcpID09IDApCisgICAgICAgIHJpZ2h0ID0gTUNfTk9fRlJJTkdFX0JJ VE1BUDsKKyAgICAgIGVsc2UgaWYgKHJvdy0+cmlnaHRfdXNlcl9mcmluZ2VfYml0bWFwICE9IE1D X05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9IHJvdy0+cmln aHRfdXNlcl9mcmluZ2VfYml0bWFwOworICAgICAgICAgIHJpZ2h0X2ZhY2VfaWQgPSByb3ctPnJp Z2h0X3VzZXJfZnJpbmdlX2ZhY2VfaWQ7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKCghcm93 LT5yZXZlcnNlZF9wICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAg ICB8fCAocm93LT5yZXZlcnNlZF9wICYmIHJvdy0+dHJ1bmNhdGVkX29uX2xlZnRfcCkpCisgICAg ICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICgwLCBRdHJ1bmNhdGlvbiwgMCk7CisgICAgICBl bHNlIGlmIChyb3ctPmluZGljYXRlX2JvYl9wICYmIEVRIChib3VuZGFyeV90b3AsIFFyaWdodCkp CisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9ICgocm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBF USAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICAgICAgID8gTUNfUklHSFRfRlJJTkdF ICgxLCBRdG9wX2JvdHRvbSwgdG9wX3Jvd19lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgOiBN Q19SSUdIVF9GUklOR0UgKDIsIFF0b3AsIDApKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5f eSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2luZF9taW5feSAtIHJvdy0+ eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAo Ym91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQgPSBNQ19S SUdIVF9GUklOR0UgKDMsIFFib3R0b20sIGJvdF9yb3dfZW5kc19hdF96dl9wKTsKKyAgICAgICAg ICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gYm90 X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgfQor ICAgICAgZWxzZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jb250aW51ZWRfcCkKKyAg ICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgTUFUUklYX1JPV19DT05USU5VQVRJ T05fTElORV9QIChyb3cpKSkKKyAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklOR0UgKDQsIFFj b250aW51YXRpb24sIDApOworICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGluZV9w ICYmIEVRIChhcnJvd190b3AsIFFyaWdodCkpCisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9 IE1DX1JJR0hUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5f eSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2luZF9taW5feSAtIHJvdy0+ eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9w ICYmIEVRIChhcnJvd19ib3QsIFFyaWdodCkpCisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9 IE1DX1JJR0hUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAgIGlmIChib3RfaW5kX21h eF95ID49IDApCisgICAgICAgICAgICByaWdodF9vZmZzZXQgPSBib3RfaW5kX21heF95IC0gKHJv dy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgICAgICB9CisgICAgICBlbHNlIGlmIChy b3ctPmluZGljYXRlX2VtcHR5X2xpbmVfcCAmJiBFUSAoZW1wdHlfcG9zLCBRcmlnaHQpKQorICAg ICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoNSwgUWVtcHR5X2xpbmUsIDApOworICAgICAg ZWxzZQorICAgICAgICByaWdodCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICBwZXJpb2Rp Y19wID0gKGdldF9mcmluZ2VfYml0bWFwX2RhdGEgKGxlZnQpLT5wZXJpb2QgIT0gMAorICAgICAg ICAgICAgICAgICAgICB8fCBnZXRfZnJpbmdlX2JpdG1hcF9kYXRhIChyaWdodCktPnBlcmlvZCAh PSAwKTsKKyAgICAgIGlmIChyb3ctPnkgIT0gY3VyLT55CisgICAgICAgICAgfHwgcm93LT52aXNp YmxlX2hlaWdodCAhPSBjdXItPnZpc2libGVfaGVpZ2h0CisgICAgICAgICAgfHwgcm93LT5lbmRz X2F0X3p2X3AgIT0gY3VyLT5lbmRzX2F0X3p2X3AKKyAgICAgICAgICB8fCBsZWZ0ICE9IGN1ci0+ bGVmdF9mcmluZ2VfYml0bWFwCisgICAgICAgICAgfHwgcmlnaHQgIT0gY3VyLT5yaWdodF9mcmlu Z2VfYml0bWFwCisgICAgICAgICAgfHwgbGVmdF9mYWNlX2lkICE9IGN1ci0+bGVmdF9mcmluZ2Vf ZmFjZV9pZAorICAgICAgICAgIHx8IHJpZ2h0X2ZhY2VfaWQgIT0gY3VyLT5yaWdodF9mcmluZ2Vf ZmFjZV9pZAorICAgICAgICAgIHx8IGxlZnRfb2Zmc2V0ICE9IGN1ci0+bGVmdF9mcmluZ2Vfb2Zm c2V0CisgICAgICAgICAgfHwgcmlnaHRfb2Zmc2V0ICE9IGN1ci0+cmlnaHRfZnJpbmdlX29mZnNl dAorICAgICAgICAgIHx8IHBlcmlvZGljX3AgIT0gY3VyLT5mcmluZ2VfYml0bWFwX3BlcmlvZGlj X3AKKyAgICAgICAgICB8fCBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19wKQorICAgICAgICB7 CisgICAgICAgICAgcmVkcmF3X3AgPSAxLCByb3ctPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0g MTsKKyAgICAgICAgICBpZiAoIWtlZXBfY3VycmVudF9wKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgICAgICAg aWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQCisgICAgICAg ICAgICAgICAgICB8fCBtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRN QVApCisgICAgICAgICAgICAgICAgY3VyLT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxz ZTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmZyaW5nZV9i aXRtYXBfcGVyaW9kaWNfcCA9IHBlcmlvZGljX3A7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0 X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBj dXItPmxlZnRfZnJpbmdlX2JpdG1hcCA9IG1jX2xlZnRfZnJpbmdlX2JpdG1hcDsKKyAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX2JpdG1hcCA9 IGxlZnQ7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9f RlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX2ZhY2VfaWQg PSBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2VfZmFjZV9pZCA9IGxlZnRfZmFjZV9pZDsKKyAgICAg ICAgICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQ KQorICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX29mZnNldCA9 IGxlZnRfb2Zmc2V0OworICAgICAgICAgICAgICBpZiAobWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAh PSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdl X2JpdG1hcCA9IG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfYml0bWFwID0gcmlnaHQ7CisgICAg ICAgICAgICAgIGlmIChtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRN QVApCisgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfZmFjZV9pZCA9IG1jX3JpZ2h0 X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg IGN1ci0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQgPSByaWdodF9mYWNlX2lkOworICAgICAgICAgICAg ICBpZiAobWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAg ICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2Vfb2Zmc2V0ID0gcmln aHRfb2Zmc2V0OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAocm93LT5vdmVy bGF5X2Fycm93X2JpdG1hcCA8IDApCisgICAgICAgIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAg PSBtY19nZXRfbG9naWNhbF9mcmluZ2VfYml0bWFwICh3LCBRb3ZlcmxheV9hcnJvdywgMCwgMCk7 CisgICAgICBpZiAocm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCAhPSBjdXItPm92ZXJsYXlfYXJy b3dfYml0bWFwKQorICAgICAgICB7CisgICAgICAgICAgcmVkcmF3X3AgPSAxLCByb3ctPnJlZHJh d19mcmluZ2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgICBpZiAoIWtlZXBfY3VycmVudF9wKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19w ID0gMTsKKyAgICAgICAgICAgICAgY3VyLT5vdmVybGF5X2Fycm93X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gIG9mZnNldCA9IHJv dy0+cmlnaHRfZnJpbmdlX29mZnNldDsKKyAgICAgICAgfQorICBpZiAoZmFjZV9pZCA9PSBERUZB VUxUX0ZBQ0VfSUQpCisgICAgeworICAgICAgTGlzcF9PYmplY3QgZmFjZSA9IGZyaW5nZV9mYWNl c1t3aGljaF07CisgICAgICBmYWNlX2lkID0gTklMUCAoZmFjZSkgPyBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgUWZyaW5nZSwgZmFsc2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBs b29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBmYWNlLCBGUklOR0VfRkFDRV9JRCwgMCk7CisgICAg ICBpZiAoZmFjZV9pZCA8IDApCisgICAgICAgIGZhY2VfaWQgPSBGUklOR0VfRkFDRV9JRDsKKyAg ICB9CisgIGZiID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAod2hpY2gpOworICBwZXJpb2QgPSBm Yi0+cGVyaW9kOworICAvKiBDb252ZXJ0IHJvdyB0byBmcmFtZSBjb29yZGluYXRlcy4gICovCisg IHAueSA9IFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCByb3ctPnkpICsgb2Zmc2V0OworICBw LndoaWNoID0gd2hpY2g7CisgIHAuYml0cyA9IGZiLT5iaXRzOworICBwLndkID0gZmItPndpZHRo OworICBwLmggPSBmYi0+aGVpZ2h0OworICBwLmRoID0gKHBlcmlvZCA+IDAgPyAocC55ICUgcGVy aW9kKSA6IDApOworICBwLmggLT0gcC5kaDsKKyAgLyogQWRqdXN0IHkgdG8gdGhlIG9mZnNldCBp biB0aGUgcm93IHRvIHN0YXJ0IGRyYXdpbmcgdGhlIGJpdG1hcC4gICovCisgIHN3aXRjaCAoZmIt PmFsaWduKQorICAgIHsKKyAgICBjYXNlIEFMSUdOX0JJVE1BUF9DRU5URVI6CisgICAgICBwLnkg Kz0gKHJvdy0+aGVpZ2h0IC0gcC5oKSAvIDI7CisgICAgICBicmVhazsKKyAgICBjYXNlIEFMSUdO X0JJVE1BUF9CT1RUT006CisgICAgICBwLnkgKz0gKHJvdy0+dmlzaWJsZV9oZWlnaHQgLSBwLmgp OworICAgICAgYnJlYWs7CisgICAgY2FzZSBBTElHTl9CSVRNQVBfVE9QOgorICAgICAgYnJlYWs7 CisgICAgfQorICBwLmZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGZhY2VfaWQpOworICBpZiAocC5m YWNlID09IE5VTEwpCisgICAgeworICAgICAgLyogVGhpcyBjb3VsZCBoYXBwZW4gYWZ0ZXIgY2xl YXJpbmcgZmFjZSBjYWNoZS4KKyAgICAgIEJ1dCBpdCBzaG91bGRuJ3QgaGFwcGVuIGFueW1vcmUu ICArK2tmcyAqLworICAgICAgcmV0dXJuOworICAgIH0KKyAgcHJlcGFyZV9mYWNlX2Zvcl9kaXNw bGF5IChmLCBwLmZhY2UpOworICAvKiBDbGVhciBsZWZ0IGZyaW5nZSBpZiBubyBiaXRtYXAgdG8g ZHJhdyBvciBpZiBiaXRtYXAgZG9lc24ndCBmaWxsCisgICAgIHRoZSBmcmluZ2UuICAqLworICBw LmJ4ID0gLTE7CisgIGhlYWRlcl9saW5lX2hlaWdodCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlH SFQgKHcpOworICBwLmJ5ID0gV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIG1heCAoaGVhZGVy X2xpbmVfaGVpZ2h0LCByb3ctPnkpKTsKKyAgcC5ueSA9IHJvdy0+dmlzaWJsZV9oZWlnaHQ7Cisg IGlmIChsZWZ0X3ApCisgICAgeworICAgICAgaW50IHdkID0gV0lORE9XX0xFRlRfRlJJTkdFX1dJ RFRIICh3KTsKKyAgICAgIGludCB4ID0gd2luZG93X2JveF9sZWZ0ICh3LCAoV0lORE9XX0hBU19G UklOR0VTX09VVFNJREVfTUFSR0lOUyAodykKKyAgICAgICAgICAgPyBMRUZUX01BUkdJTl9BUkVB CisgICAgICAgICAgIDogVEVYVF9BUkVBKSk7CisgICAgICBpZiAocC53ZCA+IHdkKQorICAgICAg ICBwLndkID0gd2Q7CisgICAgICBwLnggPSB4IC0gcC53ZCAtICh3ZCAtIHAud2QpIC8gMjsKKyAg ICAgIGlmIChwLndkIDwgd2QgfHwgcC55ID4gcC5ieSB8fCBwLnkgKyBwLmggPCBwLmJ5ICsgcC5u eSkKKyAgICAgICAgeworICAgICAgICAgIC8qIElmIFcgaGFzIGEgdmVydGljYWwgYm9yZGVyIHRv IGl0cyBsZWZ0LCBkb24ndCBkcmF3IG92ZXIgaXQuICAqLworICAgICAgICAgIHdkIC09ICgoIVdJ TkRPV19MRUZUTU9TVF9QICh3KQorICAgICAgICAgICAgLyogVGhpcyBjb3VsZCBiZSB3cm9uZyB3 aGVuIHdlIGFsbG93IHdpbmRvdyBsb2NhbAorICAgICAgICAgICAgICAgcmlnaHQgZGl2aWRlcnMg LSBidXQgdGhlIHdpbmRvdyBvbiB0aGUgbGVmdCBpcyBoYXJkCisgICAgICAgICAgICAgICB0byBn ZXQuICAqLworICAgICAgICAgICAgJiYgIUZSQU1FX1JJR0hUX0RJVklERVJfV0lEVEggKGYpCisg ICAgICAgICAgICAmJiAhV0lORE9XX0hBU19WRVJUSUNBTF9TQ1JPTExfQkFSICh3KQorICAgICAg ICAgICAgLyogQnV0IGRvbid0IHJlZHVjZSB0aGUgZnJpbmdlIHdpZHRoIGlmIHRoZSB3aW5kb3cK KyAgICAgICAgICAgICAgIGhhcyBhIGxlZnQgbWFyZ2luLCBiZWNhdXNlIHRoYXQgbWVhbnMgd2Ug YXJlIG5vdAorICAgICAgICAgICAgICAgaW4gZGFuZ2VyIG9mIGRyYXdpbmcgb3ZlciB0aGUgdmVy dGljYWwgYm9yZGVyLAorICAgICAgICAgICAgICAgYW5kIE9UT0ggbGVhdmluZyBvdXQgdGhhdCBv bmUgcGl4ZWwgbGVhdmVzIGJlaGluZAorICAgICAgICAgICAgICAgdHJhY2VzIG9mIHRoZSBjdXJz b3IsIGlmIGl0IHdhcyBpbiBjb2x1bW4gemVybworICAgICAgICAgICAgICAgYmVmb3JlIGRyYXdp bmcgbm9uLWVtcHR5IG1hcmdpbiBhcmVhLiAgKi8KKyAgICAgICAgICAgICYmIHctPmxlZnRfbWFy Z2luX2NvbHMgPT0gMCkKKyAgICAgICAgICAgPyAxIDogMCk7CisgICAgICAgICAgcC5ieCA9IHgg LSB3ZDsKKyAgICAgICAgICBwLm54ID0gd2Q7CisgICAgICAgIH0KKyAgICB9CisgIGVsc2UKKyAg ICB7CisgICAgICBpbnQgeCA9IHdpbmRvd19ib3hfcmlnaHQgKHcsCisgICAgICAgIChXSU5ET1df SEFTX0ZSSU5HRVNfT1VUU0lERV9NQVJHSU5TICh3KQorICAgICAgICAgPyBSSUdIVF9NQVJHSU5f QVJFQQorICAgICAgICAgOiBURVhUX0FSRUEpKTsKKyAgICAgIGludCB3ZCA9IFdJTkRPV19SSUdI VF9GUklOR0VfV0lEVEggKHcpOworICAgICAgaWYgKHAud2QgPiB3ZCkKKyAgICAgICAgcC53ZCA9 IHdkOworICAgICAgcC54ID0geCArICh3ZCAtIHAud2QpIC8gMjsKKyAgICAgIC8qIENsZWFyIHJp Z2h0IGZyaW5nZSBpZiBubyBiaXRtYXAgdG8gZHJhdyBvZiBpZiBiaXRtYXAgZG9lc24ndCBmaWxs CisgICB0aGUgZnJpbmdlLiAgKi8KKyAgICAgIGlmIChwLndkIDwgd2QgfHwgcC55ID4gcC5ieSB8 fCBwLnkgKyBwLmggPCBwLmJ5ICsgcC5ueSkKKyAgICAgICAgeworICAgICAgICAgIHAuYnggPSB4 OworICAgICAgICAgIHAubnggPSB3ZDsKKyAgICAgICAgfQorICAgIH0KKyAgaWYgKHAueCA+PSBX SU5ET1dfQk9YX0xFRlRfRURHRV9YICh3KQorICAgICAgJiYgKHAueCArIHAud2QpIDw9IFdJTkRP V19CT1hfTEVGVF9FREdFX1ggKHcpICsgV0lORE9XX1BJWEVMX1dJRFRIICh3KSkKKyAgICBGUkFN RV9SSUYgKGYpLT5kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywgJnApOworfQorCit2b2lkCitt Y19kcmF3X2ZyaW5nZV9iaXRtYXAgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cg KnJvdywgaW50IGxlZnRfcCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSkKK3sKKyAg aW50IG92ZXJsYXkgPSAwOworICBpZiAobGVmdF9wID09IHJvdy0+cmV2ZXJzZWRfcCAmJiByb3ct PmN1cnNvcl9pbl9mcmluZ2VfcCkKKyAgICB7CisgICAgICBMaXNwX09iamVjdCBjdXJzb3IgPSBR bmlsOworICAgICAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICAgICAgeworICAgICAgICBjYXNl IE1DX0ZSQU1FRF9CT1g6CisgICAgICAgICAgaWYgKHJvdy0+dmlzaWJsZV9oZWlnaHQgPj0gU1RB TkRBUkRfQklUTUFQX0hFSUdIVCAoaG9sbG93X3JlY3RhbmdsZV9iaXRzKSkKKyAgICAgICAgICAg IGN1cnNvciA9IFFob2xsb3c7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgY3Vyc29yID0g UWhvbGxvd19zbWFsbDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19IT0xMT1df Qk9YOgorICAgICAgICAgIGlmIChyb3ctPnZpc2libGVfaGVpZ2h0ID49IFNUQU5EQVJEX0JJVE1B UF9IRUlHSFQgKGhvbGxvd19yZWN0YW5nbGVfYml0cykpCisgICAgICAgICAgICBjdXJzb3IgPSBR aG9sbG93OworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGN1cnNvciA9IFFob2xsb3dfc21h bGw7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICAg ICAgICBjdXJzb3IgPSBRYm94OworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1DX0JB UjoKKyAgICAgICAgICBjdXJzb3IgPSBRYmFyOworICAgICAgICAgIGJyZWFrOworICAgICAgICBj YXNlIE1DX0hCQVI6CisgICAgICAgICAgY3Vyc29yID0gUWhiYXI7CisgICAgICAgICAgYnJlYWs7 CisgICAgICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgY2FzZSBNQ19OT19D VVJTT1I6CisgICAgICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgY2Fz ZSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgdy0+ cGh5c19jdXJzb3Jfb25fcCA9IDA7CisgICAgICAgICAgcm93LT5jdXJzb3JfaW5fZnJpbmdlX3Ag PSAwOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBpZiAoIU5JTFAgKGN1cnNv cikpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgYm0gPSBtY19nZXRfbG9naWNhbF9jdXJzb3Jf Yml0bWFwICh3LCBjdXJzb3IpOworICAgICAgICAgIGlmIChibSAhPSBNQ19OT19GUklOR0VfQklU TUFQKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXBf MSAodywgcm93LCBsZWZ0X3AsIDIsIGJtKTsKKyAgICAgICAgICAgICAgb3ZlcmxheSA9IEVRIChj dXJzb3IsIFFib3gpID8gMyA6IDE7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cisg IG1jX2RyYXdfZnJpbmdlX2JpdG1hcF8xICh3LCByb3csIGxlZnRfcCwgb3ZlcmxheSwgTUNfTk9f RlJJTkdFX0JJVE1BUCk7CisgIGlmIChsZWZ0X3AgJiYgcm93LT5vdmVybGF5X2Fycm93X2JpdG1h cCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcF8xICh3 LCByb3csIDEsIDEsIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXApOworfQorCisvKiBlbmQgTVVM VElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogI2RlZmluZSBO T19GUklOR0VfQklUTUFQIDAKICNkZWZpbmUgVU5ERUZfRlJJTkdFX0JJVE1BUCAxCiAjZGVmaW5l IE1BWF9TVEFOREFSRF9GUklOR0VfQklUTUFQUyBBUlJBWUVMVFMgKHN0YW5kYXJkX2JpdG1hcHMp CkBAIC0xNzAwLDYgKzMyMjIsMTY4IEBAIFJldHVybiBuaWwgaWYgUE9TIGlzIG5vdCB2aXNpYmxl IGluIFdJTkRPVy4gICovKQogdm9pZAogc3ltc19vZl9mcmluZ2UgKHZvaWQpCiB7CisKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAg LyogKGdldCAnZW1wdHktbGluZSAnZnJpbmdlKSA9PiAyMyA9PiB0aGUgbGFzdCBzdGFuZGFyZC1i aXRtYXAgYmVmb3JlIHRoaXMgb25lLgorICBTZWUgYGZyaW5nZS5lbGAuICovCisKKyAgLyogMjQg Ki8KKyAgREVGU1lNIChRbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93LCAiKy12ZXJ0aWNhbC1i YXItcmlnaHQtYXJyb3ciKTsKKyAgVmZyaW5nZV9iaXRtYXBzID0gRmNvbnMgKFFtY192ZXJ0aWNh bF9iYXJfcmlnaHRfYXJyb3csIFZmcmluZ2VfYml0bWFwcyk7CisgIEZwdXQgKFFtY192ZXJ0aWNh bF9iYXJfcmlnaHRfYXJyb3csIFFmcmluZ2UsIG1ha2VfZml4bnVtICgyN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mZiAtLWdpdCBhL3NyYy9uc3Rlcm0uaCBiL3NyYy9uc3Rlcm0uaAppbmRleCA3 OGNlNjA4Li44ZWYwZGZlIDEwMDY0NAotLS0gYS9zcmMvbnN0ZXJtLmgKKysrIGIvc3JjL25zdGVy bS5oCkBAIC02NjAsNiArNjYwLDE2IEBAIHR5cGVkZWYgaWQgaW5zdGFuY2V0eXBlOwogCiBAaW50 ZXJmYWNlIEVtYWNzU2Nyb2xsZXIgOiBOU1Njcm9sbGVyCiAgIHsKKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIE5TUmVjdCBtY19yZWN0 YW5nbGU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgIHN0cnVjdCB3aW5kb3cg KndpbmRvdzsKICAgIHN0cnVjdCBmcmFtZSAqZnJhbWU7CiAgICBOU1Jlc3BvbmRlciAqcHJldlJl c3BvbmRlcjsKQEAgLTY4MCw2ICs2OTAsMTggQEAgdHlwZWRlZiBpZCBpbnN0YW5jZXR5cGU7CiAg ICBpbnQgZW1fd2hvbGU7CiAgICB9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTogKE5TUmVjdCly ZWN0OworLSAoTlNSZWN0KW1jX2dldF9yZWN0YW5nbGU7CistIChzdHJ1Y3Qgd2luZG93ICopbWNf Z2V0X3dpbmRvdzsKKy0gKGJvb2wpbWNfanVkZ2U7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKio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ICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICArK2NhY2hlX3R5cGUp CisgICAgeworICAgICAgZm9yIChpbnQgbnRoID0gMDsKKyAgICAgICAgICAgcworICAgICAgICAg ICAmJiBzLT53LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdID4gMAorICAgICAg ICAgICAmJiBudGggPCBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hl X3R5cGVdOworICAgICAgICAgICArK250aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB4ID0g cy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS54OworICAg ICAgICAgIGludCBmeCA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF0uZng7CisgICAgICAgICAgaW50IHkgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLnk7CisgICAgICAgICAgaW50IGZ5ID0gcy0+dy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5meTsKKyAgICAgICAgICBp bnQgaHBvcyA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uaHBvczsKKyAgICAgICAgICBpbnQgdnBvcyA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0udnBvczsKKyAgICAgICAgICBpbnQgd2QgPSBzLT53LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLndkOworICAgICAgICAg IGludCBoID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XS5oOworICAgICAg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bbnRoXS5iYWNr Z3JvdW5kLmJsdWV9OworICAgICAgICAgIGJvb2wgYWN0aXZlX3AgPSBzLT53LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmFjdGl2ZV9wOworICAgICAgICAgIGVu dW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGhfZmxhdm9yOworICAgICAgICAgIGJvb2wgZW5hYmxl ZF9wID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5l bmFibGVkX3A7CisgICAgICAgICAgYm9vbCBnb19wID0gKHZwb3MgPT0gdm50aAorICAgICAgICAg ICAgICAgICAgICAgICAmJiBocG9zID09IGN1cnNvcl9nbHlwaC0+aHBvcworICAgICAgICAgICAg ICAgICAgICAgICAmJiBlbmFibGVkX3ApOworICAgICAgICAgIGlmICghZ29fcCkKKyAgICAgICAg ICAgIGNvbnRpbnVlOworICAgICAgICAgIE5TUmVjdCByOworICAgICAgICAgIHIub3JpZ2luLngg PSBmeDsKKyAgICAgICAgICByLm9yaWdpbi55ID0gZnk7CisgICAgICAgICAgci5zaXplLmhlaWdo dCA9IGg7CisgICAgICAgICAgci5zaXplLndpZHRoID0gd2Q7CisgICAgICAgICAgW1tOU0NvbG9y IGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IGxzbF9mZy5yZWQKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBncmVlbjogbHNsX2ZnLmdyZWVuCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGJsdWU6IGxzbF9mZy5ibHVlCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF0gc2V0XTsKKyAgICAgIGlmIChjdXJzb3JfdHlw ZSA9PSBNQ19GUkFNRURfQk9YKQorICAgICAgICB7CisgICAgICAgICAgTGlzcF9PYmplY3QgYnVm ID0gcy0+dy0+Y29udGVudHM7CisgICAgICAgICAgQ0hFQ0tfQlVGRkVSIChidWYpOworICAgICAg ICAgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChidWYpOworICAgICAgICAgIGJvb2wgcmVn aW9uX2FjdGl2ZV9wID0gKCFOSUxQIChWdHJhbnNpZW50X21hcmtfbW9kZSkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWFya19hY3RpdmUpKSk7 CisgICAgICAgICAgcHRyZGlmZl90IHJlZ2lvbl9iZWcgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IG1j X3JlZ2lvbl9saW1pdCAoMSkgOiAtMTsKKyAgICAgICAgICBwdHJkaWZmX3QgcmVnaW9uX2VuZCA9 IChyZWdpb25fYWN0aXZlX3ApID8gbWNfcmVnaW9uX2xpbWl0ICgwKSA6IC0xOworICAgICAgICAg IGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgJiYgYWN0aXZlX3AKKyAgICAgICAg ICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID09IHJlZ2lvbl9iZWcpCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdf ZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBpbnRlcm4gKCIrLXJlYWwt ZmFrZS1jdXJzb3ItYXQtcmVnaW9uLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAg ICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fYmVnX2ZhY2UgPSBGQUNFX0ZST01f SUQgKHMtPmYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JlZ19mYWNlX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lX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZB Q0VfQkFDS0dST1VORCAoaG9sbG93X2luYWN0aXZlX2ZhY2UpLCBzLT5mKTsKKyAgICAgICAgICAg ICAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xsb3dfaW5hY3RpdmVfY29sb3I7CisgICAgICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChmYWNlICYmIE5TX0ZB Q0VfQkFDS0dST1VORCAoZmFjZSkgPT0gbnNfaW5kZXhfY29sb3IgKEZSQU1FX0NVUlNPUl9DT0xP UiAocy0+ZiksIHMtPmYpKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIFtuc19sb29rdXBfaW5k ZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNlKSwgcy0+Zikgc2V0XTsKKyAgICAg ICAgICAgIGhvbGxvd19jb2xvciA9IEZSQU1FX0NVUlNPUl9DT0xPUiAocy0+Zik7CisgICAgICAg ICAgfQorICAgICAgICAgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgICAgICAgICBicmVh azsKKyAgICAgICAgICAgICAgY2FzZSBNQ19OT19DVVJTT1I6CisgICAgICAgICAgICAgICAgYnJl YWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAg ICAgICAgY2FzZSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgICAgICAgIGNhc2UgTUNf RklMTEVEX0JPWDoKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAg ICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOgorICAgICAgICAg ICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgICAgIFtob2xsb3dfY29sb3Igc2V0 XTsKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOwor ICAgICAgICAgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpIHNldF07CisgICAgICAg ICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICAg ICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgICAgICBbaG9sbG93X2NvbG9y IHNldF07CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEp KTsKKyAgICAgICAgICAgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChzLT5mKSBzZXRdOworICAg ICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAg ICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAg ICAgICAgIGNhc2UgTUNfQkFSOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAg ICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgIC8qIElmIGEgZ2x5 cGggZXhpc3RzIChzLT5jaGFyMmIgIT0gTlVMTCksIHRoZW4gZHJhdyB0aGUgZ2x5cGggb24gdG9w IG9mIHRoZQorICAgICAgICAgIG5ld2x5IGRyYXduIHJlY3RhbmdsZSB0aGF0IHdhcyBjcmVhdGVk IGhlcmVpbmFib3ZlLiAgVG8gdGhlIGV4dGVudCB0aGF0IHdlCisgICAgICAgICAgd2FudCB0byBk b3VibGUtaW1wcmludCBnbHlwaHMgdG8gbWFrZSB0aGVtIGFwcGVhciB0byBiZSBzZW1pLWJvbGQs IGl0IGNhbgorICAgICAgICAgIGJlIGRvbmUgaGVyZSBmb3IgYWxsIGN1cnNvciB0eXBlcy4gIFRo ZSBib3gtc3R5bGUgY3Vyc29ycyBhcmUgaW1wcmludGVkCisgICAgICAgICAgd2l0aCBnbHlwaHMg b25seSBvbmUgKDEpIHRpbWUuICBUaGUgc2VtaS1ib2xkIGFwcGVhcmFuY2UgaXMgaGVscGZ1bCB3 aGVuCisgICAgICAgICAgZGVidWdnaW5nIHRvIHNlZSB0aGF0IHRoZSBjb29yZGluYXRlcyBhcmUg Y29ycmVjdC4gKi8KKyAgICAgICAgICBpZiAocy0+Y2hhcjJiICE9IE5VTEwKKyAgICAgICAgICAg ICAgJiYgKGN1cnNvcl90eXBlID09IE1DX0ZJTExFRF9CT1gKKyAgICAgICAgICAgICAgICAgIHx8 IGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gKKyAgICAgICAgICAgICAgICAgIHx8IGN1cnNv cl90eXBlID09IE1DX0hPTExPV19CT1gpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBC T09MIGlzQ29tcG9zaXRlID0gcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBI OworICAgICAgICAgICAgICBpZiAoaXNDb21wb3NpdGUpCisgICAgICAgICAgICAgICAgbnNfZHJh d19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZv bnQgKmZvbnQgPSBzLT5mYWNlLT5mb250OworICAgICAgICAgICAgICAgICAgICBpZiAoIWZvbnQp CisgICAgICAgICAgICAgICAgICAgICAgZm9udCA9IEZSQU1FX0ZPTlQgKHMtPmYpOworICAgICAg ICAgICAgICAgICAgICBib29sIHdpdGhfYmdfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAg ICBmb250LT5kcml2ZXItPmRyYXcgKHMsIHMtPmNtcF9mcm9tLCBzLT5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FjZSAodywgZiwgaW50ZXJuICgiKy1iYXItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAg IHN0cnVjdCBmYWNlICpmYWNlID0gRkFDRV9GUk9NX0lEIChmLCBmYWNlX2lkKTsKKyAgICAgTlND b2xvciAqY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5E IChmYWNlKSwgZik7CisgIC0gIEVYQU1QTEUgT0YgSE9XIFRPIFBSSU5UIEEgQ09MT1IgVE8gU1RE RVJSOgorICAgICBMaXNwX09iamVjdCBmb3JlZ3JvdW5kID0gZmFjZS0+bGZhY2VbTEZBQ0VfRk9S RUdST1VORF9JTkRFWF07CisgICAgIExpc3BfT2JqZWN0IGJhY2tncm91bmQgPSBmYWNlLT5sZmFj ZVtMRkFDRV9CQUNLR1JPVU5EX0lOREVYXTsKKyAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG5mb3Jl Z3JvdW5kICglcykgfCBiYWNrZ3JvdW5kICglcylcbiIsCisgICAgICAgICAgICAgICAgICAgICAg KCFOSUxQIChmb3JlZ3JvdW5kKSA/IFNTREFUQSAoZm9yZWdyb3VuZCkgOiAiTklMUCIpLAorICAg ICAgICAgICAgICAgICAgICAgICghTklMUCAoYmFja2dyb3VuZCkgPyBTU0RBVEEgKGJhY2tncm91 bmQpIDogIk5JTFAiKSk7CisgIC0gIEVYQU1QTEUgT0YgSE9XIFRPIENSRUFURSBBIENPTE9SIFdJ VEggUkdCL0xTTCBmbG9hdCB2YWx1ZXM6CisgICAgIE5TQ29sb3IgKm15X2NvbG9yID0gW05TQ29s b3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogMS4wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBncmVlbjogMS4wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogMS4wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYTogMS4wXTsKKyAgLSAg QUxURVJOQVRJVkUgRVhBTVBMRToKKyAgICAgZW51bSBmYWNlX2lkIGRlYnVnZ2luZ19mYWNlX2lk ID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistZGVidWdnaW5nLWZh Y2UiKSwgdHJ1ZSk7CisgICAgIHN0cnVjdCBmYWNlICpkZWJ1Z2dpbmdfZmFjZSA9IEZBQ0VfRlJP TV9JRCAocy0+ZiwgZGVidWdnaW5nX2ZhY2VfaWQpOworICAgICBOU0NvbG9yICpjb2xvciA9IG5z X2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGRlYnVnZ2luZ19mYWNl KSwgcy0+Zik7CisgICAgIFtjb2xvciBzZXRdOyAqLworICBpZiAoZ2x5cGhfZmxhdm9yID09IE1D X0dMWVBICisgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTKQorICAgIFtbTlND b2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2wucmVkCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgZ3JlZW46IGxzbC5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBibHVlOiBsc2wuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhh OiAxLjBdIHNldF07CisgICAgZWxzZQorICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAoZikgc2V0 XTsKKyAgaWYgKGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gpCisgICAgeworICAgICAgTGlz cF9PYmplY3QgYnVmID0gdy0+Y29udGVudHM7CisgICAgICBDSEVDS19CVUZGRVIgKGJ1Zik7Cisg ICAgICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgICAg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19jb2xvcjsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0 aXZlX3AKKyAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgJiYg Y3Vyc29yX2dseXBoLT5jaGFycG9zID09IHJlZ2lvbl9lbmQpCisgICAgICAgICAgeworICAgICAg ICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlX2lkID0gbG9v a3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1hdC1yZWdp b24tcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93 X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVf cmVnaW9uX2VuZF9mYWNlX2lkKTsKKyAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19hY3RpdmVf cmVnaW9uX2VuZF9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tH Uk9VTkQgKGhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlKSwgZik7CisgICAgICAgICAgICBo b2xsb3dfY29sb3IgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfY29sb3I7CisgICAgICAgICAg fQorICAgICAgICAgIGVsc2UgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAg ICYmIGFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9z ID4gcmVnaW9uX2JlZworICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBv cyA8IHJlZ2lvbl9lbmQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGVudW0g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ciAoTlNfRkFDRV9CQUNLR1JPVU5EIChob2xsb3dfYWN0aXZlX2ZhY2Up LCBmKTsKKyAgICAgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xsb3dfYWN0aXZlX2NvbG9y OworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIC8qIFRoZSByZWdpb24gaXMgX25vdF8g dmlzaWJsZSBpbiB0aGUgaW5hY3RpdmUgd2luZG93IGJlY2F1c2UgdGhlIG92ZXJsYXkgd2luZG93 IHByb3BlcnR5IGlzIHVzZWQuICovCisgICAgICAgICAgICAgIGVsc2UgaWYgKCFhY3RpdmVfcCkK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93 X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1y ZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAg ICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lE IChmLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBOU0NvbG9y ICpob2xsb3dfaW5hY3RpdmVfY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFD RV9CQUNLR1JPVU5EIChob2xsb3dfaW5hY3RpdmVfZmFjZSksIGYpOworICAgICAgICAgICAgICAg ICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2luYWN0aXZlX2NvbG9yOworICAgICAgICAgICAgICAg IH0KKyAgICB9CisgICAgZWxzZSBpZiAoZmFjZSAmJiBOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2Up ID09IG5zX2luZGV4X2NvbG9yIChGUkFNRV9DVVJTT1JfQ09MT1IgKGYpLCBmKSkKKyAgICAgIHsK KyAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGZh Y2UpLCBmKSBzZXRdOworICAgICAgICBob2xsb3dfY29sb3IgPSBGUkFNRV9DVVJTT1JfQ09MT1Ig KGYpOworICAgICAgfQorI2lmZGVmIE5TX0lNUExfQ09DT0EKKyAgTlNEaXNhYmxlU2NyZWVuVXBk YXRlcyAoKTsKKyNlbmRpZgorICBzd2l0Y2ggKGN1cnNvcl90eXBlKQorICAgIHsKKyAgICAgIGNh c2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX05P X0NVUlNPUjoKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX1JJR0hUX0ZSSU5HRV9CSVRN QVA6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA6Cisg ICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19GSUxMRURfQk9YOgorICAgICAgICBOU1JlY3RG aWxsIChyKTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6CisgICAg ICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAgICAg IE5TUmVjdEZpbGwgKE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgIFtGUkFNRV9DVVJT T1JfQ09MT1IgKGYpIHNldF07CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19IT0xMT1df Qk9YOgorICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgW2hvbGxvd19jb2xvciBzZXRd OworICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICBb RlJBTUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworICAgICAgICBicmVhazsKKyAgICAgIGNhc2Ug TUNfSEJBUjoKKyAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIGJyZWFrOworICAgICAg Y2FzZSBNQ19CQVI6CisgICAgICAgIHMgPSByOworICAgICAgICAvKiBAbGF3bGlzdCBpcyBmb2N1 c2luZyB0aGUgaW5pdGlhbCBkZXZlbG9wbWVudCBvZiBmZWF0dXJlIHJlcXVlc3RzCisgICAgICAg ICMxNzY4NCBhbmQgIzIyODczIG9uIEwyUiBsYW5ndWFnZXMuICovCisgICAgICAgIGlmIChnbHlw aF9mbGF2b3IgIT0gTUNfR0xZUEgKKyAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19H TFlQSExFU1MpCisgICAgICAgICAgeworICAgICAgICAgICAgLyogSWYgdGhlIGNoYXJhY3RlciB1 bmRlciBjdXJzb3IgaXMgUjJMLCBkcmF3IHRoZSBiYXIgY3Vyc29yCisgICAgICAgICAgICAgICBv biB0aGUgcmlnaHQgb2YgaXRzIGdseXBoLCByYXRoZXIgdGhhbiBvbiB0aGUgbGVmdC4gKi8KKyAg ICAgICAgICAgIGlmICgoY3Vyc29yX2dseXBoLT5yZXNvbHZlZF9sZXZlbCAmIDEpICE9IDApCisg ICAgICAgICAgICAgIHMub3JpZ2luLnggKz0gY3Vyc29yX2dseXBoLT5waXhlbF93aWR0aCAtIHMu c2l6ZS53aWR0aDsKKyAgICAgICAgICB9CisgICAgICAgIE5TUmVjdEZpbGwgKHMpOworICAgICAg ICBicmVhazsKKyAgICB9CisgIG5zX3Jlc2V0X2NsaXBwaW5nIChmKTsKKyAgLyogZHJhdyB0aGUg Y2hhcmFjdGVyIHVuZGVyIHRoZSBjdXJzb3IgKi8KKyAgaWYgKGdseXBoX2ZsYXZvciAhPSBNQ19H TFlQSExFU1MKKyAgICAgICYmIChjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YCisgICAgICAg ICAgfHwgY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVEX0JPWAorICAgICAgICAgIHx8IGN1cnNvcl90 eXBlID09IE1DX0hPTExPV19CT1gKKyAgICAgICAgICB8fCAoZGVidWdfcAorICAgICAgICAgICAg ICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19IQkFSKQorICAgICAgICAgIHx8IChkZWJ1Z19wCisgICAg ICAgICAgICAgICYmIGN1cnNvcl90eXBlID09IE1DX0JBUikpKQorICAgIHsKKyAgICAgIC8qIGBj dXJzb3JfZ2NfcGAgaXMgdXNlZCBvbmx5IGJ5IGB3MzJ0ZXJtLmNgIGFuZCBgeHRlcm0uYycuICov CisgICAgICBib29sIGN1cnNvcl9nY19wID0gZmFsc2U7CisgICAgICBYUmVjdGFuZ2xlICpzYXZl ZF9jbGlwID0gTlVMTDsKKyAgICAgIGlmIChyb3ctPmNsaXAgIT0gTlVMTCkKKyAgICAgICAgewor ICAgICAgICAgIHNhdmVkX2NsaXAgPSByb3ctPmNsaXA7CisgICAgICAgICAgcm93LT5jbGlwID0g TlVMTDsKKyAgICAgICAgfQorICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwg cm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywgbHNsLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29y X2djX3ApOworICAgICAgaWYgKHNhdmVkX2NsaXAgIT0gTlVMTCkKKyAgICAgICAgcm93LT5jbGlw ID0gc2F2ZWRfY2xpcDsKKyAgICB9CisjaWZkZWYgTlNfSU1QTF9DT0NPQQorICBOU0VuYWJsZVNj cmVlblVwZGF0ZXMgKCk7CisjZW5kaWYKK30KKworc3RhdGljIHZvaWQKK21jX25zX2RyYXdfdGV4 dF9kZWNvcmF0aW9uIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzLCBzdHJ1Y3QgZmFjZSAqZmFjZSwK KyAgICAgICAgICAgICAgICAgICAgICAgICBOU0NvbG9yICpkZWZhdWx0Q29sLCBDR0Zsb2F0IHdp ZHRoLCBDR0Zsb2F0IHgpCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgRHJhdyB1bmRlcmxpbmUs IG92ZXJsaW5lLCBhbmQgc3RyaWtlLXRocm91Z2ggb24gZ2x5cGggc3RyaW5nIHMuCisgICAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLSAqLworeworICBpZiAocy0+Zm9yX292ZXJsYXBzKQorICAgIHJldHVybjsK KyAgLyogRG8gdW5kZXJsaW5lLiAqLworICBpZiAoZmFjZS0+dW5kZXJsaW5lX3ApCisgICAgewor ICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkKKyAg ICAgICAgeworICAgICAgICAgIGlmIChmYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAg ICAgICAgICBbZGVmYXVsdENvbCBzZXRdOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZhY2UtPnVuZGVybGluZV9jb2xvciwgcy0+Zikg c2V0XTsKKyAgICAgICAgICBuc19kcmF3X3VuZGVyd2F2ZSAocywgd2lkdGgsIHgpOworICAgICAg ICB9CisgICAgICAgIGVsc2UgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5E RVJfTElORSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBOU1JlY3QgcjsKKyAgICAgICAgICAg IHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAgICAgICAgICAgIC8qIElmIHRo ZSBwcmV2IHdhcyB1bmRlcmxpbmVkLCBtYXRjaCBpdHMgYXBwZWFyYW5jZS4gKi8KKyAgICAgICAg ICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV9wCisgICAgICAgICAg ICAgICAgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5F CisgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDApCisg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB0aGlja25lc3MgPSBzLT5wcmV2LT51bmRl cmxpbmVfdGhpY2tuZXNzOworICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+cHJldi0+dW5k ZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZm9udCAqZm9udDsKKyAg ICAgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZGVzY2VudDsKKyAgICAgICAgICAgICAgICAg IGZvbnQ9cy0+Zm9udDsKKyAgICAgICAgICAgICAgICAgIGRlc2NlbnQgPSBzLT55ICsgcy0+aGVp Z2h0IC0gcy0+eWJhc2U7CisgICAgICAgICAgICAgICAgICAvKiBVc2UgdW5kZXJsaW5lIHRoaWNr bmVzcyBvZiBmb250LCBkZWZhdWx0aW5nIHRvIDEuICovCisgICAgICAgICAgICAgICAgICB0aGlj a25lc3MgPSAoZm9udCAmJiBmb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gZm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAxOworICAgICAgICAgICAgICAgICAgLyogRGV0ZXJt aW5lIHRoZSBvZmZzZXQgb2YgdW5kZXJsaW5pbmcgZnJvbSB0aGUgYmFzZWxpbmUuICovCisgICAg ICAgICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2VudF9saW5lKQorICAgICAgICAg ICAgICAgICAgICBwb3NpdGlvbiA9IGRlc2NlbnQgLSB0aGlja25lc3M7CisgICAgICAgICAgICAg ICAgICAgIGVsc2UgaWYgKHhfdXNlX3VuZGVybGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVzCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGZvbnQgJiYgZm9udC0+dW5kZXJsaW5lX3Bvc2l0 aW9uID49IDApCisgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBmb250LT51bmRlcmxp bmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZm9udCkKKyAgICAg ICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbHJvdW5kIChmb250LT5kZXNjZW50IC8gMik7 CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAg IHBvc2l0aW9uID0gdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0OworICAgICAgICAgICAgICAgICAg cG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQpOworICAg ICAgICAgICAgICAgICAgLyogRW5zdXJlIHVuZGVybGluaW5nIGlzIG5vdCBjcm9wcGVkLiAqLwor ICAgICAgICAgICAgICAgICAgaWYgKGRlc2NlbnQgPD0gcG9zaXRpb24pCisgICAgICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGRlc2NlbnQgLSAxOwor ICAgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZGVzY2VudCA8IHBvc2l0aW9uICsgdGhp Y2tuZXNzKQorICAgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVzczsK KyAgICAgICAgICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9IHBvc2l0aW9uOworICAgICAgICAg ICAgciA9IE5TTWFrZVJlY3QgKHgsIHMtPnliYXNlICsgcG9zaXRpb24sIHdpZHRoLCB0aGlja25l c3MpOworICAgICAgICAgICAgaWYgKGZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAg ICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoZmFjZS0+dW5kZXJsaW5lX2NvbG9yLCBz LT5mKSBzZXRdOworICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgfQorICAg IH0KKyAgLyogRG8gb3ZlcmxpbmUuIFdlIGZvbGxvdyBvdGhlciB0ZXJtcyBpbiB1c2luZyBhIHRo aWNrbmVzcyBvZiAxCisgICAgIGFuZCBpZ25vcmluZyBvdmVybGluZV9tYXJnaW4uICovCisgIGlm IChmYWNlLT5vdmVybGluZV9wKQorICAgIHsKKyAgICAgIE5TUmVjdCByOworICAgICAgciA9IE5T TWFrZVJlY3QgKHgsIHMtPnksIHdpZHRoLCAxKTsKKyAgICAgIGlmIChmYWNlLT5vdmVybGluZV9j b2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAgZWxz ZQorICAgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoZmFjZS0+b3ZlcmxpbmVfY29s b3IsIHMtPmYpIHNldF07CisgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICB9CisgIC8q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fd2lkdGgsIHMtPmhlaWdodCk7CisgICAgICBpZiAo IW5zX2NsaXBfdG9fcmVjdCAocy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIGlm IChzLT5obCA9PSBEUkFXX01PVVNFX0ZBQ0UpCisgICAgICAgIHsKKyAgICAgICAgICBmYWNlID0g RkFDRV9GUk9NX0lEIChzLT5mLCBNT1VTRV9ITF9JTkZPIChzLT5mKS0+bW91c2VfZmFjZV9mYWNl X2lkKTsKKyAgICAgICAgICBpZiAoIWZhY2UpCisgICAgICAgICAgICBmYWNlID0gRkFDRV9GUk9N X0lEIChzLT5mLCBNT1VTRV9GQUNFX0lEKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAg ICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBzLT5maXJzdF9nbHlwaC0+ZmFjZV9pZCk7 CisgICAgICBiZ0NvbCA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9V TkQgKGZhY2UpLCBzLT5mKTsKKyAgICAgIGZnQ29sID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3Ig KE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSksIHMtPmYpOworICAgICAgZm9yIChpID0gMDsgaSA8 IG47ICsraSkKKyAgICAgICAgeworICAgICAgICAgIGlmICghcy0+cm93LT5mdWxsX3dpZHRoX3Ap CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGludCBvdmVycnVuLCBsZWZ0b3ZlcnJ1bjsK KyAgICAgICAgICAgICAgLyogdHJ1bmNhdGUgdG8gYXZvaWQgb3ZlcndyaXRpbmcgZnJpbmdlIGFu ZC9vciBzY3JvbGxiYXIgKi8KKyAgICAgICAgICAgICAgb3ZlcnJ1biA9IG1heCAoMCwgKHMtPngg KyBzLT5iYWNrZ3JvdW5kX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg LSAoV0lORE9XX0JPWF9SSUdIVF9FREdFX1ggKHMtPncpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAtIFdJTkRPV19SSUdIVF9GUklOR0VfV0lEVEggKHMtPncpKSk7CisgICAgICAgICAg ICAgICAgICAgIHJbaV0uc2l6ZS53aWR0aCAtPSBvdmVycnVuOworICAgICAgICAgICAgICAvKiB0 cnVuY2F0ZSB0byBhdm9pZCBvdmVyd3JpdGluZyB0byBsZWZ0IG9mIHRoZSB3aW5kb3cgYm94ICov CisgICAgICAgICAgICAgIGxlZnRvdmVycnVuID0gKFdJTkRPV19CT1hfTEVGVF9FREdFX1ggKHMt PncpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgV0lORE9XX0xFRlRfRlJJTkdFX1dJ RFRIIChzLT53KSkgLSBzLT54OworICAgICAgICAgICAgICBpZiAobGVmdG92ZXJydW4gPiAwKQor ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHJbaV0ub3JpZ2luLnggKz0gbGVm dG92ZXJydW47CisgICAgICAgICAgICAgICAgICByW2ldLnNpemUud2lkdGggLT0gbGVmdG92ZXJy dW47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAvKiBYWFg6IFRyeSB0byB3b3Jr IGJldHdlZW4gcHJvYmxlbSB3aGVyZSBhIHN0cmV0Y2ggZ2x5cGggb24KKyAgICAgICAgICAgICAg ICAgYSBwYXJ0aWFsbHktdmlzaWJsZSBib3R0b20gcm93IHdpbGwgY2xlYXIgcGFydCBvZiB0aGUK KyAgICAgICAgICAgICAgICAgbW9kZWxpbmUsIGFuZCBhbm90aGVyIHdoZXJlIGxpc3QtYnVmZmVy cyBoZWFkZXJzIGFuZCBzaW1pbGFyCisgICAgICAgICAgICAgICAgIHJvd3MgZXJyb25lb3VzbHkg aGF2ZSB2aXNpYmxlX2hlaWdodCBzZXQgdG8gMC4gIE5vdCBzdXJlCisgICAgICAgICAgICAgICAg IHdoZXJlIHRoaXMgaXMgY29taW5nIGZyb20gYXMgb3RoZXIgdGVybXMgc2VlbSBub3QgdG8gc2hv dy4gKi8KKyAgICAgICAgICAgICAgcltpXS5zaXplLmhlaWdodCA9IG1pbiAocy0+aGVpZ2h0LCBz LT5yb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBbYmdDb2wg c2V0XTsKKyAgICAgICAgICAvKiBOT1RFOiB1bmRlciBOUyB0aGlzIGlzIE5PVCB1c2VkIHRvIGRy YXcgY3Vyc29ycywgYnV0IHdlIG11c3QgYXZvaWQKKyAgICAgICAgICAgICBvdmVyd3JpdGluZyBj dXJzb3IgKHVzdWFsbHkgd2hlbiBjdXJzb3Igb24gYSB0YWIpICovCisgICAgICAgICAgaWYgKHMt PmhsID09IERSQVdfQ1VSU09SKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBGSVhN RTogIERvIHdlIHN0aWxsIG5lZWQgdG8gcHJldmVudCB0aGlzIHNlY3Rpb24gb2YgY29kZSBmcm9t CisgICAgICAgICAgICAgIGVyYXNpbmcgdGhlIGZha2UgTUNfSEJBUiB0aGF0IGV4dGVuZHMgdGhl IGVudGlyZSBsZW5ndGggb2YgdGhlCisgICAgICAgICAgICAgIFNUUkVUQ0hfR0xZUEg/ICBUaGlz IG1heSBoYXZlIGJlZW4gZG9uZSBwcmlvciB0byB0aGUgZml4IHJlbGF0aW5nCisgICAgICAgICAg ICAgIHRvIGxlZnQvcmlnaHQgb3ZlcndyaXR0ZW4gZ2x5cGhzLiAqLworICAgICAgICAgICAgICBy W2ldLnNpemUuaGVpZ2h0IC09IDE7CisgICAgICAgICAgICAgIC8vICBlbnVtIGZhY2VfaWQgZGVi dWdnaW5nX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgi Ky1kZWJ1Z2dpbmctZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgLy8gIHN0cnVjdCBmYWNl ICpkZWJ1Z2dpbmdfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgZGVidWdnaW5nX2ZhY2VfaWQp OworICAgICAgICAgICAgICAvLyAgTlNDb2xvciAqY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9j b2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChkZWJ1Z2dpbmdfZmFjZSksIHMtPmYpOworICAgICAg ICAgICAgICAvLyAgW2NvbG9yIHNldF07CisgICAgICAgICAgICAgIENHRmxvYXQgeCA9IHJbaV0u b3JpZ2luLng7CisgICAgICAgICAgICAgIENHRmxvYXQgd2lkdGggPSB3ZDsKKyAgICAgICAgICAg ICAgcltpXS5zaXplLndpZHRoIC09IHdpZHRoOworICAgICAgICAgICAgICByW2ldLm9yaWdpbi54 ICs9IHdpZHRoOworICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyW2ldKTsKKyAgICAgICAgICAg ICAgLyogRHJhdyBvdmVybGluaW5nLCBldGMuIG9uIHRoZSBjdXJzb3IuICovCisgICAgICAgICAg ICAgIGlmIChzLT53LT5waHlzX2N1cnNvcl90eXBlID09IE1DX0ZJTExFRF9CT1gpCisgICAgICAg ICAgICAgICAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHMsIGZhY2UsIGJnQ29sLCB3aWR0 aCwgeCk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgbWNfbnNfZHJh d190ZXh0X2RlY29yYXRpb24gKHMsIGZhY2UsIGZnQ29sLCB3aWR0aCwgeCk7CisgICAgICAgICAg ICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAvLyAgaW50IHJ4ID0gcltpXS5v cmlnaW4ueDsKKyAgLy8gIGludCByeSA9IHJbaV0ub3JpZ2luLnk7CisgIC8vICBpbnQgcncgPSBy W2ldLnNpemUud2lkdGg7CisgIC8vICBpbnQgcmggPSByW2ldLnNpemUuaGVpZ2h0OworICAvLyAg ZnByaW50ZiAoc3RkZXJyLCAibWNfbnNfZHVtcGdseXBoc19zdHJldGNoOiAgdnBvcyAoJWQpIHwg cnggKCVkKSB8IHJ5ICglZCkgfCBydyAoJWQpIHwgcmggKCVkKVxuIiwKKyAgLy8gICAgICAgICAg ICAgICAgICAgcy0+Zmlyc3RfZ2x5cGgtPnZwb3MsIHJ4LCByeSwgcncsIHJoKTsKKyAgICAgICAg ICAgICAgTlNSZWN0RmlsbCAocltpXSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgLyogRHJh dyBvdmVybGluaW5nLCBldGMuIG9uIHRoZSBzdHJldGNoIGdseXBoIChvciB0aGUgcGFydAorICAg ICAgICAgICAgIG9mIHRoZSBzdHJldGNoIGdseXBoIGFmdGVyIHRoZSBjdXJzb3IpLiAqLworICAg ICAgICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCBmZ0NvbCwgcltpXS5z aXplLndpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByW2ldLm9y aWdpbi54KTsKKyAgICAgICAgfQorICAgICAgaWYgKChzLT5sZWZ0X292ZXJ3cml0dGVuX3AgfHwg cy0+cmlnaHRfb3ZlcndyaXR0ZW5fcCkKKyAgICAgICAgICAmJiAocy0+YWN0aW9uX3R5cGUgPT0g TUNfRFJBV19HTFlQSCB8fCBzLT5hY3Rpb25fdHlwZSA9PSBNQ19FUkFTRV9HTFlQSCkpCisgICAg ICAgIG1jX25zX2RyYXdfb3ZlcndyaXR0ZW4gKHMsIG1hdHJpeCwgcm93LCBzLT5maXJzdF9nbHlw aCk7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBzLT5iYWNrZ3JvdW5k X2ZpbGxlZF9wID0gMTsKKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkCittY19uc19kdW1wZ2x5cGhz X2ltYWdlIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzLCBOU1JlY3Qgciwgc3RydWN0IG1jX1J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vb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNF X0ZPUkVHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgLyogRHJhdyB1bmRlcmxpbmUsIG92ZXJsaW5l LCBzdHJpa2UtdGhyb3VnaC4gKi8KKyAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHMsIGZh Y2UsIHRkQ29sLCBici5zaXplLndpZHRoLCBici5vcmlnaW4ueCk7CisgIC8qIERyYXcgcmVsaWVm LCBpZiByZXF1ZXN0ZWQgKi8KKyAgaWYgKHMtPmltZy0+cmVsaWVmIHx8IHMtPmhsID09RFJBV19J TUFHRV9SQUlTRUQgfHwgcy0+aGwgPT1EUkFXX0lNQUdFX1NVTktFTikKKyAgICB7CisgICAgICBp ZiAocy0+aGwgPT0gRFJBV19JTUFHRV9TVU5LRU4gfHwgcy0+aGwgPT0gRFJBV19JTUFHRV9SQUlT RUQpCisgICAgICAgIHsKKyAgICAgICAgICB0aCA9IHRvb2xfYmFyX2J1dHRvbl9yZWxpZWYgPj0g MCA/CisgICAgICAgICAgICB0b29sX2Jhcl9idXR0b25fcmVsaWVmIDogREVGQVVMVF9UT09MX0JB Ul9CVVRUT05fUkVMSUVGOworICAgICAgICAgIHJhaXNlZF9wID0gKHMtPmhsID09IERSQVdfSU1B R0VfUkFJU0VEKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAg ICAgICAgdGggPSBhYnMgKHMtPmltZy0+cmVsaWVmKTsKKyAgICAgICAgICAgIHJhaXNlZF9wID0g KHMtPmltZy0+cmVsaWVmID4gMCk7CisgICAgICAgICAgfQorICAgICAgci5vcmlnaW4ueCA9IHgg LSB0aDsKKyAgICAgIHIub3JpZ2luLnkgPSB5IC0gdGg7CisgICAgICByLnNpemUud2lkdGggPSBz LT5zbGljZS53aWR0aCArIDIqdGgtMTsKKyAgICAgIHIuc2l6ZS5oZWlnaHQgPSBzLT5zbGljZS5o ZWlnaHQgKyAyKnRoLTE7CisgICAgICBuc19kcmF3X3JlbGllZiAociwgdGgsIHJhaXNlZF9wLAor ICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnkgPT0gMCwKKyAgICAgICAgICAgICAgICAg ICAgICBzLT5zbGljZS55ICsgcy0+c2xpY2UuaGVpZ2h0ID09IHMtPmltZy0+aGVpZ2h0LAorICAg ICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnggPT0gMCwKKyAgICAgICAgICAgICAgICAgICAg ICBzLT5zbGljZS54ICsgcy0+c2xpY2Uud2lkdGggPT0gcy0+aW1nLT53aWR0aCwgcyk7CisgICAg fQorICAvKiBJZiB0aGVyZSBpcyBubyBtYXNrLCB0aGUgYmFja2dyb3VuZCB3b24ndCBiZSBzZWVu LAorICAgICBzbyBkcmF3IGEgcmVjdGFuZ2xlIG9uIHRoZSBpbWFnZSBmb3IgdGhlIGN1cnNvci4K KyAgICAgRG8gdGhpcyBmb3IgYWxsIGltYWdlcywgZ2V0dGluZyB0cmFuc3BhcmVuY3kgcmlnaHQg aXMgbm90IHJlbGlhYmxlLiAqLworICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IpCisgICAgewor ICAgICAgaW50IHRoaWNrbmVzcyA9IGFicyAocy0+aW1nLT5yZWxpZWYpOworICAgICAgaWYgKHRo aWNrbmVzcyA9PSAwKSB0aGlja25lc3MgPSAxOworICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNf R0xZUEgKKyAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBITEVTUykKKyAgICAgIHsK KyAgICAgICAgTlNDb2xvciAqYm9yZGVyX2NvbG9yID0gW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJy YXRlZFJlZDogbHNsLnJlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGdyZWVuOiBsc2wuZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogbHNsLmJsdWUKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBh bHBoYTogMS4wXTsKKyAgICAgICAgbnNfZHJhd19ib3ggKGJyLCB0aGlja25lc3MsIGJvcmRlcl9j b2xvciwgMSwgMSk7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIG5zX2RyYXdfYm94IChi ciwgdGhpY2tuZXNzLCBGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpLCAxLCAxKTsKKyAgICB9Cit9 CisKK3N0YXRpYyB2b2lkCittY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQgKHN0cnVj dCBnbHlwaF9zdHJpbmcgKnMsIGNoYXIgZm9yY2VfcCkKK3sKKyAgTlNUUkFDRSAoIm1jX25zX21h eWJlX2R1bXBnbHlwaHNfYmFja2dyb3VuZCIpOworICBpZiAoIXMtPmJhY2tncm91bmRfZmlsbGVk X3AvKiB8fCBzLT5obCA9PSBEUkFXX01PVVNFX0ZBQ0UqLykKKyAgICB7CisgICAgICBpbnQgYm94 X2xpbmVfd2lkdGggPSBtYXggKHMtPmZhY2UtPmJveF9saW5lX3dpZHRoLCAwKTsKKyAgICAgIGlm IChGT05UX0hFSUdIVCAocy0+Zm9udCkgPCBzLT5oZWlnaHQgLSAyICogYm94X2xpbmVfd2lkdGgK KyAgICAgICAgICAvKiBXaGVuIHhkaXNwLmMgaWdub3JlcyBGT05UX0hFSUdIVCwgd2UgY2Fubm90 IHRydXN0IGZvbnQKKyAgICAgICAgICAgICBkaW1lbnNpb25zLCBzaW5jZSB0aGUgYWN0dWFsIGds eXBocyBtaWdodCBiZSBtdWNoCisgICAgICAgICAgICAgc21hbGxlci4gIFNvIGluIHRoYXQgY2Fz ZSB3ZSBhbHdheXMgY2xlYXIgdGhlIHJlY3RhbmdsZQorICAgICAgICAgICAgIHdpdGggYmFja2dy b3VuZCBjb2xvci4gKi8KKyAgICAgICAgICB8fCBGT05UX1RPT19ISUdIIChzLT5mb250KQorICAg ICAgICAgIHx8IHMtPmZvbnRfbm90X2ZvdW5kX3AgfHwgcy0+ZXh0ZW5kc190b19lbmRfb2ZfbGlu ZV9wIHx8IGZvcmNlX3ApCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZmFjZSAqZmFjZTsK KyAgICAgICAgICBpZiAocy0+aGwgPT0gRFJBV19NT1VTRV9GQUNFKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBNT1VTRV9ITF9JTkZPIChz LT5mKS0+bW91c2VfZmFjZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgaWYgKCFmYWNlKQorICAg ICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIE1PVVNFX0ZBQ0VfSUQpOwor ICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBmYWNlID0gRkFD RV9GUk9NX0lEIChzLT5mLCBzLT5maXJzdF9nbHlwaC0+ZmFjZV9pZCk7CisgICAgICAgICAgaWYg KCFmYWNlLT5zdGlwcGxlKQorICAgICAgICAgICAgWyhOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2Up ICE9IDAKKyAgICAgICAgICAgICAgPyBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9C QUNLR1JPVU5EIChmYWNlKSwgcy0+ZikKKyAgICAgICAgICAgICAgOiBGUkFNRV9CQUNLR1JPVU5E X0NPTE9SIChzLT5mKSkgc2V0XTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgIHN0cnVjdCBuc19kaXNwbGF5X2luZm8gKmRweWluZm8gPSBGUkFNRV9E SVNQTEFZX0lORk8gKHMtPmYpOworICAgICAgICAgICAgICAgIFtbZHB5aW5mby0+Yml0bWFwc1tm YWNlLT5zdGlwcGxlLTFdLmltZyBzdGlwcGxlTWFza10gc2V0XTsKKyAgICAgICAgICAgICAgfQor ICAgICAgICAgIGlmIChzLT5obCAhPSBEUkFXX0NVUlNPUikKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgcy0+cmVjdGFuZ2xlX251a2VkX3AgPSB0cnVlOworICAgICAgICAgICAgICBOU1Jl Y3QgciA9IE5TTWFrZVJlY3QgKHMtPngsIHMtPnkgKyBib3hfbGluZV93aWR0aCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPmJhY2tncm91bmRfd2lkdGgsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT5oZWlnaHQtMipib3hfbGluZV93aWR0aCk7 CisgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgfQorICAgICAgICAg IHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSAxOworICAgICAgICB9CisgICAgfQorfQorCitzdGF0 aWMgdm9pZAorbWNfbnNfZHJhd19nbHlwaF9zdHJpbmcgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMs IHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAg ICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2ZsYXZvciBn bHlwaF9mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlw ZSBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgd2QsIGJvb2wgYWN0 aXZlX3AsIGJvb2wgY3Vyc29yX2djX3ApCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgRX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mVjdCAocy0+bmV4dCwgcik7CisgICAgICAg ICAgICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQorICAgICAgICAgICAg ICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIG1jX25zX21heWJlX2R1bXBnbHlwaHNfYmFj a2dyb3VuZCAocy0+bmV4dCwgMSk7CisgICAgICAgICAgICAgICAgbnNfcmVzZXRfY2xpcHBpbmcg KHMtPmYpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAg IG1jX25zX2R1bXBnbHlwaHNfc3RyZXRjaCAocy0+bmV4dCwgbWF0cml4LCByb3csIHdkKTsKKyAg ICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgfQorICAgIH0KKyAgaWYg KCFzLT5mb3Jfb3ZlcmxhcHMgJiYgcy0+ZmFjZS0+Ym94ICE9IEZBQ0VfTk9fQk9YCisgICAgICAm JiAocy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgIHx8IHMtPmZp cnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCkpCisgICAgeworICAgICAgbiA9IG5z X2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICghbnNfY2xpcF90 b19yZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAgcmV0dXJuOworICAgICAgbWNfbnNfbWF5YmVf ZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLCAxKTsKKyAgICAgIG5zX2R1bXBnbHlwaHNfYm94X29y X3JlbGllZiAocyk7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBib3hf ZHJhd25fcCA9IDE7CisgICAgfQorICBzd2l0Y2ggKHMtPmZpcnN0X2dseXBoLT50eXBlKQorICAg IHsKKyAgICBjYXNlIElNQUdFX0dMWVBIOgorICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdf Y2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICghbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBu KSkKKyAgICAgICAgcmV0dXJuOworICAgICAgbWNfbnNfZHVtcGdseXBoc19pbWFnZSAocywgclsw XSwgbHNsLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCBhY3RpdmVfcCk7CisgICAgICBuc19y ZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBicmVhazsKKyAgICBjYXNlIFNUUkVUQ0hfR0xZ UEg6CisgICAgICBtY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2ggKHMsIG1hdHJpeCwgcm93LCB3ZCk7 CisgICAgICBicmVhazsKKyAgICBjYXNlIENIQVJfR0xZUEg6CisgICAgY2FzZSBDT01QT1NJVEVf R0xZUEg6CisgICAgICBuID0gbnNfZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIpOwor ICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQorICAgICAgICByZXR1cm47 CisgICAgICBpZiAocy0+Zm9yX292ZXJsYXBzCisgICAgICAgICAgfHwgKHMtPmNtcF9mcm9tID4g MAorICAgICAgICAgICAgICAmJiAhIHMtPmZpcnN0X2dseXBoLT51LmNtcC5hdXRvbWF0aWMpKQor ICAgICAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gMTsKKyAgICAgIGVsc2UKKyAgICAgICAg bWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLCBzLT5maXJzdF9nbHlwaC0+dHlw ZSA9PSBDT01QT1NJVEVfR0xZUEgpOworICAgICAgZmxhZ3MgPSBzLT5obCA9PSBEUkFXX0NVUlNP UiA/IE5TX0RVTVBHTFlQSF9DVVJTT1IgOgorICAgICAgICAocy0+aGwgPT0gRFJBV19NT1VTRV9G QUNFID8gTlNfRFVNUEdMW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ZSkgPSBOU19GQUNF X0ZPUkVHUk9VTkQgKGhvbGxvd19hY3RpdmVfZmFjZSk7CisgICAgICAgICAgfQorICAgICAgICAg IGVsc2UgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAgICAgICAgICAgICAgJiYgY3Vy c29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWAorICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9w KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0 aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgiKy1y ZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAg ICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMt PmYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgTlNfRkFDRV9GT1JF R1JPVU5EIChzLT5mYWNlKSA9IE5TX0ZBQ0VfRk9SRUdST1VORCAoaG9sbG93X2luYWN0aXZlX2Zh Y2UpOworICAgICAgICAgICAgfQorICAgICAgeworICAgICAgICBCT09MIGlzQ29tcG9zaXRlID0g cy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIOworICAgICAgICBpZiAoaXND b21wb3NpdGUpCisgICAgICAgICAgbnNfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVn cm91bmQgKHMpOworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg Ym9vbCB3aXRoX2JnX3AgPSAoKGZsYWdzID09IE5TX0RVTVBHTFlQSF9OT1JNQUwgJiYgIXMtPmJh Y2tncm91bmRfZmlsbGVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGZs YWdzID09IE5TX0RVTVBHTFlQSF9NT1VTRUZBQ0UpOworICAgICAgICAgICAgICBpZiAod2l0aF9i Z19wKQorICAgICAgICAgICAgICAgIHMtPmJhY2tncm91bmRfbnVrZWRfcCA9IHRydWU7CisgICAg ICAgICAgICAgIGZvbnQtPmRyaXZlci0+ZHJhdyAocywgcy0+Y21wX2Zyb20sIHMtPm5jaGFycywg cy0+eCwgcy0+eWJhc2UsIHdpdGhfYmdfcCk7CisgICAgICAgICAgICB9CisgICAgICB9CisgICAg ICB7CisgICAgICAgIE5TQ29sb3IgKmNvbCA9IChOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2Up ICE9IDAKKyAgICAgICAgICAgICAgICAgICAgICAgID8gbnNfbG9va3VwX2luZGV4ZWRfY29sb3Ig KE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSksCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBzLT5mKQorICAgICAgICAgICAgICAgICAgICAgICAg OiBGUkFNRV9GT1JFR1JPVU5EX0NPTE9SIChzLT5mKSk7CisgICAgICAgIFtjb2wgc2V0XTsKKyAg ICAgICAgLyogRHJhdyB1bmRlcmxpbmUsIG92ZXJsaW5lLCBzdHJpa2UtdGhyb3VnaC4gKi8KKyAg ICAgICAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHMsIHMtPmZhY2UsIGNvbCwgcy0+d2lk dGgsIHMtPngpOworICAgICAgfQorICAgICAgeworICAgICAgICBpZiAocy0+Zmlyc3RfZ2x5cGgt PnR5cGUgIT0gQ09NUE9TSVRFX0dMWVBICisgICAgICAgICAgICAmJiAocy0+bGVmdF9vdmVyd3Jp dHRlbl9wIHx8IHMtPnJpZ2h0X292ZXJ3cml0dGVuX3ApCisgICAgICAgICAgICAmJiAocy0+YmFj a2dyb3VuZF9udWtlZF9wIHx8IHMtPnJlY3RhbmdsZV9udWtlZF9wKQorICAgICAgICAgICAgJiYg KHMtPmFjdGlvbl90eXBlID09IE1DX0RSQVdfR0xZUEggfHwgcy0+YWN0aW9uX3R5cGUgPT0gTUNf RVJBU0VfR0xZUEgpKQorICAgICAgICAgIG1jX25zX2RyYXdfb3ZlcndyaXR0ZW4gKHMsIG1hdHJp eCwgcm93LCBzLT5maXJzdF9nbHlwaCk7CisgICAgICB9CisgICAgICBpZiAocy0+aGwgPT0gRFJB V19DVVJTT1IKKyAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YKQorICAg ICAgICB7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyB0bXAgPSBOU19GQUNFX0JBQ0tHUk9VTkQg KHMtPmZhY2UpOworICAgICAgICAgIE5TX0ZBQ0VfQkFDS0dST1VORCAocy0+ZmFjZSkgPSBOU19G QUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpOworICAgICAgICAgIE5TX0ZBQ0VfRk9SRUdST1VORCAo cy0+ZmFjZSkgPSB0bXA7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJB V19DVVJTT1IKKyAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JP WCkKKyAgICAgICAgICBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpID0gc2F2ZWRfZmc7Cisg ICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBicmVhazsKKyAgICBjYXNlIEdM WVBITEVTU19HTFlQSDoKKyAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAo cywgcik7CisgICAgICBpZiAoIW5zX2NsaXBfdG9fcmVjdCAocy0+ZiwgciwgbikpCisgICAgICAg IHJldHVybjsKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMgfHwgKHMtPmNtcF9mcm9tID4gMAor ICAgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0b21hdGljKSkKKyAgICAg ICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAgICBlbHNlCisgICAgICAgIG1jX25z X21heWJlX2R1bXBnbHlwaHNfYmFja2dyb3VuZCAocywgcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0g Q09NUE9TSVRFX0dMWVBIKTsKKyAgICAgIC8qIC4uLiAqLworICAgICAgLyogTm90IHlldCBpbXBs ZW1lbnRlZC4gKi8KKyAgICAgIC8qIC4uLiAqLworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMt PmYpOworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOwor ICAgIH0KKyAgLyogRHJhdyBib3ggaWYgbm90IGRvbmUgYWxyZWFkeS4gKi8KKyAgaWYgKCFzLT5m b3Jfb3ZlcmxhcHMgJiYgIWJveF9kcmF3bl9wICYmIHMtPmZhY2UtPmJveCAhPSBGQUNFX05PX0JP WCkKKyAgICB7CisgICAgICBuID0gbnNfZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIp OworICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQorICAgICAgICByZXR1 cm47CisgICAgICBuc19kdW1wZ2x5cGhzX2JveF9vcl9yZWxpZWYgKHMpOworICAgICAgbnNfcmVz ZXRfY2xpcHBpbmcgKHMtPmYpOworICAgIH0KKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyog ZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8q ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09CiAKICAgIE5TVFJBQ0UsIFRyYWNlIHN1cHBvcnQuCkBAIC0xMTA5 LDYgKzIwODMsMTYgQEAgc3RhdGljIE5TUmVjdCBjb25zdHJhaW5fZnJhbWVfcmVjdChOU1JlY3Qg ZnJhbWVSZWN0LCBib29sIGlzRnVsbHNjcmVlbikKICAgIGV4dGVybmFsIChSSUYpIGNhbGw7IHdo b2xlIGZyYW1lLCBjYWxsZWQgYmVmb3JlIHVwZGF0ZV93aW5kb3dfYmVnaW4KICAgIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBmOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAjaWZkZWYgTlNfSU1QTF9DT0NPQQogICBFbWFjc1ZpZXcgKnZp ZXcgPSBGUkFNRV9OU19WSUVXIChmKTsKIApAQCAtMTIwOSw2ICsyMTkzLDE2IEBAIHN0YXRpYyBO U1JlY3QgY29uc3RyYWluX2ZyYW1lX3JlY3QoTlNSZWN0IGZyYW1lUmVjdCwgYm9vbCBpc0Z1bGxz Y3JlZW4pCiAKIC8qICAgaWYgKGYgPT0gTU9VU0VfSExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfbW91 c2VfZnJhbWUpICovCiAgIE1PVVNFX0hMX0lORk8gKGYpLT5tb3VzZV9mYWNlX2RlZmVyID0gMDsK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICBmLT5tY191cGRhdGluZ19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKIH0KIAogCkBAIC00ODAzLDYgKzU3OTcsMTcgQEAgaW4gY2VydGFpbiBzaXR1YXRpb25z IChyYXBpZCBpbmNvbWluZyBldmVudHMpLgogICAgICAgYmFyID0gW1tFbWFjc1Njcm9sbGVyIGFs bG9jXSBpbml0RnJhbWU6IHIgd2luZG93OiB3aW5dOwogICAgICAgd3NldF92ZXJ0aWNhbF9zY3Jv bGxfYmFyICh3aW5kb3csIG1ha2VfbWludF9wdHIgKGJhcikpOwogICAgICAgdXBkYXRlX3AgPSBZ RVM7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgICAgIC8qIFRoaXMgaXMgb25seSBmb3IgZGVidWdnaW5nIHB1cnBvc2VzLiAqLworICAg ICAgW2JhciBtY19zZXRfcmVjdGFuZ2xlOiByXTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAgIH0KICAgZWxzZQogICAgIHsKQEAgLTQ4MTAsMTIgKzU4MTUsMzAgQEAgaW4gY2Vy dGFpbiBzaXR1YXRpb25zIChyYXBpZCBpbmNvbWluZyBldmVudHMpLgogICAgICAgYmFyID0gWE5T X1NDUk9MTF9CQVIgKHdpbmRvdy0+dmVydGljYWxfc2Nyb2xsX2Jhcik7CiAgICAgICBvbGRSZWN0 ID0gW2JhciBmcmFtZV07CiAgICAgICByLnNpemUud2lkdGggPSBvbGRSZWN0LnNpemUud2lkdGg7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK ICAgICAgIGlmIChGUkFNRV9MSVZFX1AgKGYpICYmICFOU0VxdWFsUmVjdHMgKG9sZFJlY3QsIHIp KQogICAgICAgICB7CisgICAgICAgICAgLyogVGhlIG1haW4gd2luZG93IGhhcyBwcm9iYWJseSBi ZWVuIHJlc2l6ZWQuICBHcmFjaW91c2x5IGRlbGV0ZSB0aGUKKyAgICAgICAgICBvbGQgc2Nyb2xs IGJhciB3aXRob3V0IHJlcGFpbnRpbmcgaXRzIHJlY3RhbmdsZTsgYW5kLCBjcmVhdGUgYSBuZXcK KyAgICAgICAgICBzY3JvbGwgYmFyIGVsc2V3aGVyZS4qLwogICAgICAgICAgIGlmIChvbGRSZWN0 Lm9yaWdpbi54ICE9IHIub3JpZ2luLngpCisgICAgICAgICAgICB7CiAgICAgICAgICAgICAgIG5z X2NsZWFyX2ZyYW1lX2FyZWEgKGYsIGxlZnQsIHRvcCwgd2lkdGgsIGhlaWdodCk7CisgICAgICAg ICAgICAgIFtiYXIgbWNfanVkZ2VdOworICAgICAgICAgICAgICBiYXIgPSBbW0VtYWNzU2Nyb2xs ZXIgYWxsb2NdIGluaXRGcmFtZTogciB3aW5kb3c6IHdpbl07CisgICAgICAgICAgICAgIHdzZXRf dmVydGljYWxfc2Nyb2xsX2JhciAod2luZG93LCBtYWtlX21pbnRfcHRyIChiYXIpKTsKKyAgICAg ICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKICAgICAgICAgICBbYmFyIHNldEZyYW1lOiByXTsK ICAgICAgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgfQogCiAgIGlm ICh1cGRhdGVfcCkKQEAgLTQ5NzUsOSArNTk5OCw1NyBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMg KHJhcGlkIGluY29taW5nIGV2ZW50cykuCiAgICAgewogICAgICAgdmlldyA9IFtzdWJ2aWV3cyBv YmplY3RBdEluZGV4OiBpXTsKICAgICAgIGlmICghW3ZpZXcgaXNLaW5kT2ZDbGFzczogW0VtYWNz U2Nyb2xsZXIgY2xhc3NdXSkgY29udGludWU7Ci0gICAgICBpZiAoW3ZpZXcganVkZ2VdKQorCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8q IGBYU0VUV0lORE9XJyB3aWxsIHNvbWV0aW1lcyBjYXVzZSBFbWFjcyB0byBjcmFzaCB3aGVuIHJ1 bm5pbmcgdW5kZXIgZ2RiIGV2ZW4KKyAgdGhvdWdoICh3ICE9IE5VTEwpLiAgVGhlcmVmb3JlLCB3 ZSBjYW5ub3QgcmVsaWFibHkgdXNlIGBXSU5ET1dfTElWRV9QJy4gKi8KKyAgc3RydWN0IHdpbmRv dyAqdyA9IFt2aWV3IG1jX2dldF93aW5kb3ddOworICBpZiAodyAhPSBOVUxMCisgICAgICAmJiBO SUxQICh3LT5jb250ZW50cykpCisgICAgeworICAgICAgQk9PTCBkZWJ1Z19wID0gZmFsc2U7Cisg ICAgICBpZiAoZGVidWdfcAorICAgICAgICAgIC8qIGB3aW5kb3dfYm94JyBjYWxscyBgd2luZG93 X2JveF9oZWlnaHQnLCB3aGljaCB3aWxsIGNhdXNlIEVtYWNzIHRvCisgICAgICAgICAgY3Jhc2gg aWYgRlJBTUVQICh3LT5mcmFtZSkgaXMgbm90IHNhdGlzZmllZC4gKi8KKyAgICAgICAgICAmJiBG UkFNRVAgKHctPmZyYW1lKSkKKyAgICAgICAgeworICAgICAgICAgIE5TUmVjdCByMCA9IFt2aWV3 IG1jX2dldF9yZWN0YW5nbGVdOworICAgICAgICAgIGludCB4MCA9IE5TTWluWCAocjApOworICAg ICAgICAgIGludCB5MCA9IE5TTWluWSAocjApOworICAgICAgICAgIGludCB3ZDAgPSBOU1dpZHRo IChyMCk7CisgICAgICAgICAgaW50IGgwID0gTlNIZWlnaHQgKHIwKTsKKyAgICAgICAgICBpbnQg d2luZG93X3ksIHdpbmRvd19oZWlnaHQ7CisgICAgICAgICAgd2luZG93X2JveCAodywgQU5ZX0FS RUEsIDAsICZ3aW5kb3dfeSwgMCwgJndpbmRvd19oZWlnaHQpOworICAgICAgICAgIGludCB0b3Ag PSB3aW5kb3dfeTsKKyAgICAgICAgICBpbnQgaGVpZ2h0ID0gd2luZG93X2hlaWdodDsKKyAgICAg ICAgICBpbnQgd2lkdGggPSBXSU5ET1dfQ09ORklHX1NDUk9MTF9CQVJfQ09MUyAodykgKiBGUkFN RV9DT0xVTU5fV0lEVEggKGYpOworICAgICAgICAgIGludCBsZWZ0ID0gV0lORE9XX1NDUk9MTF9C QVJfQVJFQV9YICh3KTsKKyAgICAgICAgICBOU1JlY3QgcjEgPSBOU01ha2VSZWN0IChsZWZ0LCB0 b3AsIHdpZHRoLCBoZWlnaHQpOworICAgICAgICAgIC8qIFRoZSBwYXJlbnQgdmlldyBpcyBmbGlw cGVkLCBzbyB3ZSBuZWVkIHRvIGZsaXAgeSB2YWx1ZS4gKi8KKyAgICAgICAgICBFbWFjc1ZpZXcg KmZyYW1lX3ZpZXcgPSBGUkFNRV9OU19WSUVXIChmKTsKKyAgICAgICAgICBOU1JlY3QgdiA9IFtm cmFtZV92aWV3IGZyYW1lXTsKKyAgICAgICAgICByMS5vcmlnaW4ueSA9ICh2LnNpemUuaGVpZ2h0 IC0gcjEuc2l6ZS5oZWlnaHQgLSByMS5vcmlnaW4ueSk7CisgICAgICAgICAgaW50IHgxID0gTlNN aW5YIChyMSk7CisgICAgICAgICAgaW50IHkxID0gTlNNaW5ZIChyMSk7CisgICAgICAgICAgaW50 IHdkMSA9IE5TV2lkdGggKHIxKTsKKyAgICAgICAgICBpbnQgaDEgPSBOU0hlaWdodCAocjEpOwor ICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiVzIC0tIERFQUQ6XG5cCisgICAgICAgICAgeDAv eDEgKCVkLyVkKSB8IHkwL3kxICglZC8lZCkgfCB3ZDAvd2QxICglZC8lZCkgfCBoMC9oMSAoJWQv JWQpXG4iLAorICAgICAgICAgIG1jX3dpbmRvdyAodyksIHgwLCB4MSwgeTAsIHkxLCB3ZDAsIHdk MSwgaDAsIGgxKTsKKyAgICAgICAgfQorICAgICAgaWYgKFt2aWV3IG1jX2p1ZGdlXSkKICAgICAg ICAgcmVtb3ZlZCA9IFlFUzsKICAgICB9CisgICAgZWxzZSBpZiAoW3ZpZXcganVkZ2VdKQorICAg ICAgcmVtb3ZlZCA9IFlFUzsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKworICAgIH0K IAogICBpZiAocmVtb3ZlZCkKICAgICBbZXZpZXcgdXBkYXRlRnJhbWVTaXplOiBOT107CkBAIC01 MTA2LDYgKzYxNzcsMjEgQEAgc3RhdGljIExpc3BfT2JqZWN0IG5zX3N0cmluZ190b19saXNwbW9k IChjb25zdCBjaGFyICpzKQogZXh0ZXJuIGZyYW1lX3Bhcm1faGFuZGxlciBuc19mcmFtZV9wYXJt X2hhbmRsZXJzW107CiBzdGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UgbnNfcmVkaXNw bGF5X2ludGVyZmFjZSA9CiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgbnN0ZXJtLm1g IG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVy ZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfeF93cml0ZV9nbHlwaHMsCisgIG1j X25zX2RyYXdfd2luZG93X2N1cnNvciwKKyAgbWNfbnNfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgbnNfZnJhbWVfcGFybV9oYW5kbGVycywKICAg eF9wcm9kdWNlX2dseXBocywKICAgeF93cml0ZV9nbHlwaHMsCkBAIC04NzIxLDYgKzk4MDcsNDkg QEAgLSAoQk9PTCljYW5CZWNvbWVNYWluV2luZG93CiAKIEBpbXBsZW1lbnRhdGlvbiBFbWFjc1Nj cm9sbGVyCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTogKE5TUmVjdClyZWN0Cit7CisgIG1jX3Jl Y3RhbmdsZSA9IHJlY3Q7Cit9CisKKy0gKE5TUmVjdCltY19nZXRfcmVjdGFuZ2xlCit7CisgIHJl dHVybiBtY19yZWN0YW5nbGU7Cit9CisKKy0gKHN0cnVjdCB3aW5kb3cgKiltY19nZXRfd2luZG93 Cit7CisgIHJldHVybiB3aW5kb3c7Cit9CisKKy0gKGJvb2wpbWNfanVkZ2UKK3sKKyAgTlNUUkFD RSAoIltFbWFjc1Njcm9sbGVyIG1jX2p1ZGdlXSIpOworICBib29sIHJldCA9IGNvbmRlbW5lZDsK KyAgYmxvY2tfaW5wdXQgKCk7CisgIGlmIChjb25kZW1uZWQpCisgICAgeworICAgICAgLyogZW5z dXJl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gICAgICAgICAgc3RyZXRjaCBnbHlwaC4gICovCisgICAgICAg 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 ICAgIH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Ml9zZXRfY3Vyc29y X2djIChzLCBjdXJzb3JfZ2NfcCk7CisgICAgICBzLT5zdGlwcGxlZF9wID0gZmFsc2U7CisgICAg fQorICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX01PVVNFX0ZBQ0UpCisgICAgeworICAgICAgeF9z ZXRfbW91c2VfZmFjZV9nYyAocyk7CisgICAgICBzLT5zdGlwcGxlZF9wID0gcy0+ZmFjZS0+c3Rp cHBsZSAhPSAwOworICAgIH0KKyAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19JTUFHRV9SQUlTRUQK KyAgICAgICAgICAgfHwgcy0+aGwgPT0gRFJBV19JTUFHRV9TVU5LRU4pCisgICAgeworICAgICAg cy0+Z2MgPSBzLT5mYWNlLT5nYzsKKyAgICAgIHMtPnN0aXBwbGVkX3AgPSBzLT5mYWNlLT5zdGlw cGxlICE9IDA7CisgICAgfQorICBlbHNlCisgICAgZW1hY3NfYWJvcnQgKCk7CisgIC8qIEdDIG11 c3QgaGF2ZSBiZWVuIHNldC4gICovCisgIGVhc3NlcnQgKHMtPmdjICE9IDApOworfQorCisvKiBE cmF3IGEgaG9sbG93IGJveCBjdXJzb3Igb24gd2luZG93IFcgaW4gZ2x5cGggcm93IFJPVy4gICov CitzdGF0aWMgdm9pZAorbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAq dywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgeCwgaW50IGZ4LCBpbnQgeSwgaW50IGZ5LAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhwb3MsIGludCB2cG9zLCBpbnQgd2QsIGlu dCBoKQoreworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOwor ICBIREMgaGRjOworICBSRUNUIHJlY3Q7CisgIEhCUlVTSCB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WFkIG9mIGB3LT5waHlzX2N1cnNv cl9hc2NlbnQnPyAqLworICAgICAgICAgIHczMl9zeXN0ZW1fY2FyZXRfeQorICAgICAgICAgICAg PSAoV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIHkpCisgICAgICAgICAgICAgICArIHJvdy0+ YXNjZW50IC0gdy0+cGh5c19jdXJzb3JfYXNjZW50KTsKKyAgICAgICAgICB3MzJfc3lzdGVtX2Nh cmV0X3dpbmRvdyA9IHc7CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJldF9oZHJfaGVpZ2h0ID0g V0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJl dF9tb2RlX2hlaWdodCA9IFdJTkRPV19NT0RFX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgICAgICBQ b3N0TWVzc2FnZSAoaHduZCwgV01fSU1FX1NUQVJUQ09NUE9TSVRJT04sIDAsIDApOworICAgICAg ICAgIC8qIElmIHRoZSBzaXplIG9mIHRoZSBhY3RpdmUgY3Vyc29yIGNoYW5nZWQsIGRlc3Ryb3kg dGhlIG9sZAorICAgICAgICAgICAgIHN5c3RlbSBjYXJldC4gICovCisgICAgICAgICAgaWYgKHcz Ml9zeXN0ZW1fY2FyZXRfaHduZAorICAgICAgICAgICAgICAmJiAodzMyX3N5c3RlbV9jYXJldF9o ZWlnaHQgIT0gaCkpCisgICAgICAgICAgICBQb3N0TWVzc2FnZSAoaHduZCwgV01fRU1BQ1NfREVT VFJPWV9DQVJFVCwgMCwgMCk7CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJldF9oZWlnaHQgPSBo OworICAgICAgICAgIC8qIE1vdmUgdGhlIHN5c3RlbSBjYXJldC4gICovCisgICAgICAgICAgUG9z dE1lc3NhZ2UgKGh3bmQsIFdNX0VNQUNTX1RSQUNLX0NBUkVULCAwLCAwKTsKKyAgICAgICAgfQor ICAgICAgLyogVGhlIGZyaW5nZSB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dGl2ZV9yZWdpb25fZW5kX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgIGVudW0gZmFjZV9p ZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJu ICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAg ICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhv bGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91 bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgZ2Nf dmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZS0+YmFja2dy b3VuZDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0 aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID4gcmVnaW9uX2JlZworICAgICAgICAg ICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPCByZWdpb25fZW5kKQorICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0 aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluLXJlZ2lvbi1wcmUtenYtZmFjZSIpLCB0cnVlKTsK KyAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZ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Jzb3JfZ2MnLiAgKi8KKyAgICAgICAg ICBib29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICBtY19kcmF3X2N1cnNvcl9nbHlw aCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLCBsc2wsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdk LCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+ Y3Vyc29yX2djID0gb3JpZ2luYWxfY3Vyc29yX2djOworICAgICAgICAgIHVuYmxvY2tfaW5wdXQg KCk7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzIt PmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29y X3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNv ciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAg ICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29y X3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGN1cnNvcl9nbHlwaC0+dHlwZSA9 PSBJTUFHRV9HTFlQSCAmJiBsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJs dWUgPj0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sg YGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgICBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgICAg bWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwg aHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJz b3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgICAgfQorICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNr IGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAgICAg ICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHczMmZucy5jLiAgKi8KKyAg ICAgICAgICAgICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYgYWN0 aXZlX3AKKyAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBvcyA9PSByZWdp b25fYmVnKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9p ZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3 LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItYXQtcmVnaW9uLXByZS16di1mYWNlIiks IHRydWUpOworICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVn aW9uX2JlZ19mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdf ZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9m YWNlX2lkID0gbG9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jZV9pZCA9IGxv b2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2 LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3df YWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7Cisg ICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3JvdW5kID0gaG9sbG93X2FjdGl2ZV9m YWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3Vu ZCA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlLT5iYWNrZ3JvdW5kOworICAgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocmVnaW9uX2FjdGl2ZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID4gcmVnaW9uX2JlZworICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zIDwgcmVnaW9uX2VuZCkK KyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9p ZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluLXJlZ2lvbi1wcmUtenYtZmFj ZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2Fj dGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZl X3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFj ZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAg ICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01f SUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgZ2Nf dmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAg ICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3Jl Z2lvbl9iZXR3ZWVuX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVf ZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1j dXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1 Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0 aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91 bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAg ICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+YmFja2dyb3Vu ZDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBp ZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg 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 IHdkLCBoKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPm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jdXJzb3JfZ2MnIHRvIHVzZSBgcy0+Zi0+b3V0cHV0X2RhdGEudzMyLT5j dXJzb3JfZ2MnLiAgKi8KKyAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAg ICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4 LCBocG9zLCB2cG9zLCBsc2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBo X2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAg ICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djID0gb3JpZ2luYWxfY3Vyc29yX2djOwor ICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAg ICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSBmYWxzZTsKKyAgICAgICAg ICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgRFJBV19DVVJTT1IsIHgs IGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsLCBnbHlw aF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgY3Vyc29yX2djX3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOwor ICAgIH0KKyAgICBjYXNlIE1DX0JBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYm IGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAv KiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4g ICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBjb2xvcl9w aXhlbDsKKyAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsK KyAgICAgICAgICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngs IHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOwor ICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vy c29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAg ICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAg ICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBo cG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1 cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAg ICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfSEJBUjoKKyAgICB7CisgICAg ICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisg ICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRh LnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5j dXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZp c2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3 LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9n Y19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNv cl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNl CisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlf cCA9IGZhbHNlOworICAgICAgICAgICAgbWNfdzMyX2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4 LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZp c2libGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgZGVm YXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICB9CisgICAgfQorfQorCisvKiBEcmF3IGds eXBoIHN0cmluZyBTLiAgKi8KK3N0YXRpYyB2b2lkCittY193MzJfZHJhd19nbHlwaF9zdHJpbmcg KHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3Ry dWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNf UkdCIGxzbCwgZ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gPSB0cnVlOworICAgICAgZWxzZQorICAg ICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIGZhbHNlKTsKKyAgICAgIHhf ZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVhazsKKyAgICBjYXNl IENPTVBPU0lURV9HTFlQSDoKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMgfHwgKHMtPmNtcF9m cm9tID4gMAorICAgICAgICAgICYmICEgcy0+Zmlyc3RfZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykp CisgICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICAg ICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIHRydWUpOworICAgICAgeF9k cmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVhazsK KyAgICBjYXNlIEdMWVBITEVTU19HTFlQSDoKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMpCisg ICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICAgICAg ICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIGZhbHNlKTsKKyAgICAgIHhfZHJh d19nbHlwaGxlc3NfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgYnJlYWs7Cisg ICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICAgIH0KKyAgaWYgKCFzLT5mb3Jf b3ZlcmxhcHMpCisgICAgeworICAgICAgLyogRHJhdyB1bmRlcmxpbmUuICAqLworICAgICAgaWYg KHMtPmZhY2UtPnVuZGVybGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKHMtPmZhY2Ut PnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgQ09MT1JSRUYgY29sb3I7CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRl cmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgICAgY29sb3IgPSBzLT5nYy0+Zm9yZWdy b3VuZDsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGNvbG9yID0gcy0+ZmFj ZS0+dW5kZXJsaW5lX2NvbG9yOworICAgICAgICAgICAgICB3MzJfZHJhd191bmRlcndhdmUgKHMs IGNvbG9yKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChzLT5mYWNlLT51bmRl cmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgaW50 IHk7CisgICAgICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGlu ZV9wCisgICAgICAgICAgICAgICAgICAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9 PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg LyogV2UgdXNlIHRoZSBzYW1lIHVuZGVybGluZSBzdHlsZSBhcyB0aGUgcHJldmlvdXMgb25lLiAg Ki8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPnByZXYtPnVuZGVybGluZV90aGlj a25lc3M7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGluZV9w b3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSB0aGlja25l c3MuICBEZWZhdWx0IGlzIDEgcGl4ZWwuICAqLworICAgICAgICAgICAgICAgICAgaWYgKHMtPmZv bnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAgICAgICAgICAg ICAgIHRoaWNrbmVzcyA9IHMtPmZvbnQtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAg ICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2VudF9saW5lKQorICAgICAgICAgICAg ICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSB0aGlja25lc3MpIC0gKHMtPnliYXNlIC0g cy0+eSk7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSBwb3NpdGlvbi4gIFRoaXMg aXMgdGhlIHJlY29tbWVuZGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgdmVydGljYWwgb2Zm c2V0IGluIHBpeGVscyBmcm9tIHRoZSBiYXNlbGluZSB0byB0aGUgdG9wIG9mCisgICAgICAgICAg ICAgICAgICAgICAgICAgdGhlIHVuZGVybGluZS4gIFRoaXMgaXMgYSBzaWduZWQgdmFsdWUgYWNj b3JkaW5nIHRvIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgIHNwZWNzLCBhbmQgaXRzIGRl ZmF1bHQgaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICBST1VORCAoKG1heGltdW1fZGVzY2Vu dCkgLyAyKSwgd2l0aAorICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EICh4KSA9IGZsb29y ICh4ICsgMC41KSAgKi8KKyAgICAgICAgICAgICAgICAgICAgICBpZiAoeF91c2VfdW5kZXJsaW5l X3Bvc2l0aW9uX3Byb3BlcnRpZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcy0+Zm9u dCAmJiBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb24gPj0gMCkKKyAgICAgICAgICAgICAgICAg ICAgICAgIHBvc2l0aW9uID0gcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKHMtPmZvbnQpCisgICAgICAgICAgICAgICAgICAgICAgICBw b3NpdGlvbiA9IChzLT5mb250LT5kZXNjZW50ICsgMSkgLyAyOworICAgICAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IG1heCAocG9zaXRpb24sIHVuZGVybGlu ZV9taW5pbXVtX29mZnNldCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAvKiBD aGVjayB0aGUgc2FuaXR5IG9mIHRoaWNrbmVzcyBhbmQgcG9zaXRpb24uICBXZSBzaG91bGQKKyAg ICAgICAgICAgICAgICAgYXZvaWQgZHJhd2luZyB1bmRlcmxpbmUgb3V0IG9mIHRoZSBjdXJyZW50 IGxpbmUgYXJlYS4gICovCisgICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDw9IHMt PnliYXNlICsgcG9zaXRpb24pCisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0 IC0gMSkgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5o ZWlnaHQgPCBzLT55YmFzZSArIHBvc2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAgICAg IHRoaWNrbmVzcyA9IChzLT55ICsgcy0+aGVpZ2h0KSAtIChzLT55YmFzZSArIHBvc2l0aW9uKTsK KyAgICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVzczsKKyAgICAg ICAgICAgICAgcy0+dW5kZXJsaW5lX3Bvc2l0aW9uID1wb3NpdGlvbjsKKyAgICAgICAgICAgICAg eSA9IHMtPnliYXNlICsgcG9zaXRpb247CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRl cmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwg cy0+aGRjLCBzLT5nYy0+Zm9yZWdyb3VuZCwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICB5LCBzLT53aWR0aCwgMSk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmZhY2UtPnVuZGVybGluZV9jb2xv ciwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5LCBzLT53aWR0aCwgMSk7 CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgb3ZlcmxpbmUuICAqLwor ICAgICAgaWYgKHMtPmZhY2UtPm92ZXJsaW5lX3ApCisgICAgICAgIHsKKyAgICAgICAgICB1bnNp Z25lZCBsb25nIGR5ID0gMCwgaCA9IDE7CisgICAgICAgICAgaWYgKHMtPmZhY2UtPm92ZXJsaW5l X2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+ aGRjLCBzLT5nYy0+Zm9yZWdyb3VuZCwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg IHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmZhY2UtPm92ZXJsaW5lX2NvbG9yLCBz LT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT55ICsgZHksIHMtPndpZHRoLCBo KTsKKyAgICAgICAgfQorICAgICAgLyogRHJhdyBzdHJpa2UtdGhyb3VnaC4gICovCisgICAgICBp ZiAocy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfcAorICAgICAgICAgICYmICFGT05UX1RFWFRNRVRS SUMgKHMtPmZvbnQpLnRtU3RydWNrT3V0KQorICAgICAgICB7CisgICAgICAgICAgdW5zaWduZWQg bG9uZyBoID0gMTsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIGR5ID0gKHMtPmhlaWdodCAtIGgp IC8gMjsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3JfZGVmYXVs dGVkX3ApCisgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmdjLT5m b3JlZ3JvdW5kLCBzLT54LCBzLT55ICsgZHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBz LT53aWR0aCwgaCk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAo cy0+Ziwgcy0+aGRjLCBzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvciwgcy0+eCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICB9 CisgICAgICAvKiBEcmF3IHJlbGllZiBpZiBub3QgeWV0IGRyYXduLiAgKi8KKyAgICAgIGlmICgh cmVsaWVmX2RyYXduX3AgJiYgcy0+ZmFjZS0+Ym94ICE9IEZBQ0VfTk9fQk9YKQorICAgICAgICB4 X2RyYXdfZ2x5cGhfc3RyaW5nX2JveCAocyk7CisgICAgICBpZiAocy0+cHJldikKKyAgICAgICAg eworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKnByZXY7CisgICAgICAgICAgZm9yIChw cmV2ID0gcy0+cHJldjsgcHJldjsgcHJldiA9IHByZXYtPnByZXYpCisgICAgICAgICAgICBpZiAo cHJldi0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAgICAmJiBwcmV2LT54ICsgcHJldi0+d2lk dGggKyBwcmV2LT5yaWdodF9vdmVyaGFuZyA+IHMtPngpCisgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAvKiBBcyBwcmV2IHdhcyBkcmF3biB3aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24g YXJlYSwgd2UKKyAgICAgICAgICAgICAgICAgICBtdXN0IGRyYXcgdGhlIHJpZ2h0X292ZXJoYW5n IHBhcnQgdXNpbmcgcy0+aGwgbm93LiAgKi8KKyAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5 cGhzX2ZhY2Ugc2F2ZSA9IHByZXYtPmhsOworICAgICAgICAgICAgICAgIHByZXYtPmhsID0gcy0+ aGw7CisgICAgICAgICAgICAgICAgbWNfdzMyX3NldF9nbHlwaF9zdHJpbmdfZ2MgKHByZXYsIGN1 cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdf ZXhhY3RseSAocywgcHJldik7CisgICAgICAgICAgICAgICAgaWYgKHByZXYtPmZpcnN0X2dseXBo LT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3Ry aW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOwor ICAgICAgICAgICAgICAgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKHByZXYtPmhkYywgTlVMTCk7 CisgICAgICAgICAgICAgICAgcHJldi0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIHByZXYt Pm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHMt Pm5leHQpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpuZXh0Owor ICAgICAgICAgIGZvciAobmV4dCA9IHMtPm5leHQ7IG5leHQ7IG5leHQgPSBuZXh0LT5uZXh0KQor ICAgICAgICAgICAgaWYgKG5leHQtPmhsICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYgbmV4 dC0+eCAtIG5leHQtPmxlZnRfb3ZlcmhhbmcgPCBzLT54ICsgcy0+d2lkdGgpCisgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBcyBuZXh0IHdpbGwgYmUgZHJhd24gd2hpbGUgY2xp cHBlZCB0byBpdHMgb3duIGFyZWEsCisgICAgICAgICAgICAgICAgICAgd2UgbXVzdCBkcmF3IHRo ZSBsZWZ0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwgbm93LiAgKi8KKyAgICAgICAgICAgICAg ICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9IG5leHQtPmhsOworICAgICAgICAgICAgICAg IG5leHQtPmhsID0gcy0+aGw7CisgICAgICAgICAgICAgICAgbWNfdzMyX3NldF9nbHlwaF9zdHJp bmdfZ2MgKG5leHQsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9nbHlwaF9z dHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgbmV4dCk7CisgICAgICAgICAgICAgICAgaWYgKG5l eHQtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB4 X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVn cm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKG5l eHQtPmhkYywgTlVMTCk7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzYXZlOworICAgICAg ICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgICAgbmV4dC0+Y2xp cF9oZWFkID0gcy0+bmV4dDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAv KiBSZXNldCBjbGlwcGluZy4gICovCisgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKHMtPmhkYywg TlVMTCk7CisgIHMtPm51bV9jbGlwcyA9IDA7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JT ICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBGcmluZ2UgYml0bWFwcy4gICov CiAKIHN0YXRpYyBpbnQgbWF4X2ZyaW5nZV9ibXAgPSAwOwpAQCAtNTQ1LDYgKzE0MTcsMTUgQEAg eF91cGRhdGVfYmVnaW4gKHN0cnVjdCBmcmFtZSAqZikKICAgaWYgKCEgRlJBTUVfVzMyX1AgKGYp KQogICAgIHJldHVybjsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IGY7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICAgLyogUmVnZW5lcmF0ZSBkaXNwbGF5IHBhbGV0dGUgYmVmb3Jl IGRyYXdpbmcgaWYgbGlzdCBvZiByZXF1ZXN0ZWQKICAgICAgY29sb3JzIGhhcyBjaGFuZ2VkLiAq LwogICBpZiAoZGlzcGxheV9pbmZvLT5yZWdlbl9wYWxldHRlKQpAQCAtNzU0LDYgKzE2MzUsMTYg QEAgeF91cGRhdGVfZW5kIChzdHJ1Y3QgZnJhbWUgKmYpCiAKICAgLyogTW91c2UgaGlnaGxpZ2h0 IG1heSBiZSBkaXNwbGF5ZWQgYWdhaW4uICAqLwogICBNT1VTRV9ITF9JTkZPIChmKS0+bW91c2Vf ZmFjZV9kZWZlciA9IGZhbHNlOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gTlVMTDsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAKQEAgLTQwNDEsMTMgKzQ5MzIsNzQgQEAg dzMyX3NldF92ZXJ0aWNhbF9zY3JvbGxfYmFyIChzdHJ1Y3Qgd2luZG93ICp3LAogCSAgICAgIHJl bGVhc2VfZnJhbWVfZGMgKGYsIGhkYyk7CiAJICAgICAgeF9jbGVhcl91bmRlcl9pbnRlcm5hbF9i b3JkZXIgKGYpOwogCSAgICB9CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdp biBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIFJFUEFJTlRJTkcgV0hFTiBSRU1PVklORyBTQ1JP TEwgQkFSOgorCistIFNlcXVlbmNlIG9mIEV2ZW50czoKKworICAuIGByZWRpc3BsYXlfaW50ZXJu YWwnIGNhbGxzIHRoZSBgY29uZGVtbl9zY3JvbGxfYmFyc19ob29rJywgd2hpY2ggbWFya3MgYWxs CisgICAgc2Nyb2xsIGJhcnMgYXMgY2FuZGlkY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qKioq KioqKioqKiogKi8KKwogCiAJICBzaS5jYlNpemUgPSBzaXplb2YgKHNpKTsKIAkgIHNpLmZNYXNr ID0gU0lGX1JBTkdFOwpAQCAtNDMxNiw2ICs1MjY4LDIxIEBAIHczMl9qdWRnZV9zY3JvbGxfYmFy cyAoc3RydWN0IGZyYW1lICpmKQogICAgIHsKICAgICAgIHN0cnVjdCBzY3JvbGxfYmFyICpiID0g WFNDUk9MTF9CQVIgKGJhcik7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgICAgIC8qIGBEZXN0cm95V2luZG93JyB3aXRoaW4gYHhfc2Ny b2xsX2Jhcl9yZW1vdmUnIHJlcGFpbnRzIHRoZSByZWN0YW5nbGUuCisgICAgICBUaGVyZWZvcmUs IHdlIGZpcnN0IHNlbmQgYSBtZXNzYWdlIHRvIGluaGliaXQgcmVwYWludGluZy4gKi8KKyAgICAg IGlmICghV0lORE9XX0xJVkVfUCAoYi0+d2luZG93KSkKKyAgICAgICAgeworICAgICAgICAgIEhX TkQgaHduZCA9IFNDUk9MTF9CQVJfVzMyX1dJTkRPVyAoYik7CisgICAgICAgICAgU2VuZE1lc3Nh Z2UgKGh3bmQsIFdNX1NFVFJFRFJBVywgZmFsc2UsIDApOworICAgICAgICB9CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICAgIHhfc2Nyb2xsX2Jhcl9yZW1vdmUgKGIpOwogCiAg ICAgICBuZXh0ID0gYi0+bmV4dDsKQEAgLTcwOTEsNiArODA1OCwyMSBAQCBleHRlcm4gZnJhbWVf cGFybV9oYW5kbGVyIHczMl9mcmFtZV9wYXJtX2hhbmRsZXJzW107CiAKIHN0YXRpYyBzdHJ1Y3Qg cmVkaXNwbGF5X2ludGVyZmFjZSB3MzJfcmVkaXNwbGF5X2ludGVyZmFjZSA9CiB7CisKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRp c3BsYXlfaW50ZXJmYWNlJyBpbiBgdzMydGVybS5jYCBtdXN0IGJlIGluIHRoZSBleGFjdCBzYW1l IG9yZGVyIGFzIHRoZQorYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBkaXNwZXh0ZXJuLmhgISAq LworCisgIG1jX3hfd3JpdGVfZ2x5cGhzLAorICBtY193MzJfZHJhd193aW5kb3dfY3Vyc29yLAor ICBtY193MzJfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICAgdzMyX2ZyYW1lX3Bhcm1faGFuZGxlcnMsCiAgIHhfcHJvZHVjZV9nbHlwaHMsCiAgIHhf d3JpdGVfZ2x5cGhzLApkaWZmIC0tZ2l0IGEvc3JjL3dpbmRvdy5oIGIvc3JjL3dpbmRvdy5oCmlu ZGV4IGZkZWY0MDcuLjA1MWZmZjAgMTAwNjQ0Ci0tLSBhL3NyYy93aW5kb3cuaAorKysgYi9zcmMv d2luZG93LmgKQEAgLTMyNCw2ICszMjQsMTI4IEBAIHN0cnVjdCB3aW5kb3cKIAogI2lmZGVmIEhB VkVfV0lORE9XX1NZU1RFTQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4g TVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBTdWZmaXhlcyBmb3IgdGhlIGBtY2Agd2luZG93IHBv aW50ZXIgcHJlZml4LiAqLworc3RydWN0IG11bHRpcGxlX2N1cnNvcnMKK3sKKyAgLyogVGhlIHJl Y29yZGVkIHBpeGVsIHdpZHRoIG9mIHRoZSBsYXN0IGxpbmUgbnVtYmVyIGRyYXduIGR1cmluZyBy ZWRpc3BsYXkgKi8KKyAgaW50IGxudW1fcGl4ZWxfd2lkdGg7Cit9IG1jOworCitzdHJ1Y3QgbWNf bWF0cml4Cit7CisgIHB0cmRpZmZfdCB2cG9zX2FsbG9jYXRlZDsKKyAgcHRyZGlmZl90IHZwb3Nf dXNlZDsKKyAgcHRyZGlmZl90IGN1cnNvcnNfdXNlZFs0XTsKKyAgZW51bSBtY19jYWNoZV90eXBl CisgIHsKKyAgICBNQ19DQUNIRSwKKyAgICBDSF9DQUNIRSwKKyAgICBGQ19DQUNIRSwKKyAgICBO T19DQUNIRQorICB9IGNhY2hlX3R5cGU7CisgIHN0cnVjdCBtY192cG9zCisgIHsKKyAgICBwdHJk aWZmX3QgY2FjaGVfYWxsb2NhdGVkWzRdOworICAgIHB0cmRpZmZfdCBjYWNoZV91c2VkWzRdOwor ICAgIHN0cnVjdCBtY19jb250ZW50cworICAgIHsKKyAgICAgIGJvb2xfYmYgc2FtZV9wIDogMTsK KyAgICAgIGVudW0gbWNfZnJvbV93aGVyZQorICAgICAgeworICAgICAgICBOT1dIRVJFLAorICAg ICAgICBTQ1JJQkVfT05FLAorICAgICAgICBTQ1JJQkVfVFdPLAorICAgICAgICBTQ1JJQkVfVEhS RUUsCisgICAgICAgIFNLSVBQRUQsCisgICAgICAgIFBPU1RfQ0hBTkdFRCwKKyAgICAgICAgVU5D SEFOR0VELAorICAgICAgICBTRVRfQ1VSU09SX09ORSwKKyAgICAgICAgU0VUX0NVUlNPUl9UV08K KyAgICAgIH0gZnJvbV93aGVyZTsKKyAgICAgIHN0cnVjdCBnbHlwaCBnbHlwaDsKKyAgICAgIGlu dCB4OworICAgICAgaW50IGZ4OworICAgICAgaW50IHk7CisgICAgICBpbnQgZnk7CisgICAgICBp bnQgaHBvczsKKyAgICAgIGludCB2cG9zOworICAgICAgaW50IHdkOworICAgICAgaW50IGg7Cisg ICAgICBlbnVtIG1jX2N1cnNvcl90eXBlCisgICAgICB7CisgICAgICAgIC8qIE5PVEU6ICBUaGUg ZnJpbmdlIGJpdG1hcCBmcmFtZXdvcmsgcmVsaWVzIHVwb24gTUNfTk9fRlJJTkdFX0JJVE1BUAor ICAgICAgICBoYXZpbmcgYSB2YWx1ZSBvZiB6ZXJvICgwKS4gKi8KKyAgICAgICAgTUNfTk9fRlJJ TkdFX0JJVE1BUCwKKyAgICAgICAgTUNfTk9fQ1VSU09SLAorICAgICAgICBNQ19SSUdIVF9GUklO R0VfQklUTUFQLAorICAgICAgICBNQ19MRUZUX0ZSSU5HRV9CSVRNQVAsCisgICAgICAgIE1DX0ZS QU1FRF9CT1gsCisgICAgICAgIE1DX0ZJTExFRF9CT1gsCisgICAgICAgIE1DX0hPTExPV19CT1gs CisgICAgICAgIE1DX0JBUiwKKyAgICAgICAgTUNfSEJBUgorICAgICAgfSBjdXJzb3JfdHlwZTsK KyAgICAgIGludCBjdXJzb3Jfd2lkdGg7CisgICAgICBzdHJ1Y3QgbWNfUkdCCisgICAgICB7Cisg ICAgICAgIGRvdWJsZSByZWQ7CisgICAgICAgIGRvdWJsZSBncmVlbjsKKyAgICAgICAgZG91Ymxl IGJsdWU7CisgICAgICB9IGZvcmVncm91bmQsIGJhY2tncm91bmQ7CisgICAgICBib29sX2JmIGFj dGl2ZV9wIDogMTsKKyAgICAgIGVudW0gbWNfZmxhdm9yCisgICAgICB7CisgICAgICAgIE5PX0ZM QVZPUiwKKyAgICAgICAgTUNfR0xZUEgsCisgICAgICAgIE1DX0dMWVBITEVTUywKKyAgICAgICAg TUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAsCisgICAgICAgIE1DX1BJTENST1csCisgICAgICAgIE1D X0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1csCisgICAgICAgIE1DX1JFVkVSU0VEX0hPTExP V19SRUNUQU5HTEVfUklHSFRfQVJST1csCisgICAgICAgIE1DX0hPTExPV19SRUNUQU5HTEUsCisg ICAgICAgIE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVywKKyAgICAgICAgTUNfUkVWRVJTRURf VkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XLAorICAgICAgICBNQ19WRVJUSUNBTF9CQVIsCisgICAg ICAgIE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUiwKKyAgICAgICAgTUNfVkVSVElDQUxfQkFSX0JB Q0tTTEFTSAorICAgICAgfSBnbHlwaF9mbGF2b3I7CisgICAgICBib29sX2JmIGVuYWJsZWRfcCA6 IDE7CisgICAgfSAqY2FjaGVbNF07CisgIH0gKnZwb3M7CisgIC8qIFVzZWQgZWxzZXdoZXJlLiAq LworICBzdHJ1Y3QgbWNfZXNzZW50aWFscworICB7CisgICAgZW51bSBtY19yb3dfcG9zaXRpb24K KyAgICB7CisgICAgICBQUkVfWlYsCisgICAgICBBVF9aViwKKyAgICAgIFBPU1RfWlYKKyAgICB9 IHJvd19wb3NpdGlvbjsKKyAgICBib29sX2JmIGFjdGl2ZV9wIDogMTsKKyAgICBzdHJ1Y3QgbWNf UkdCIGNoX2ZnWzNdLCBmY19mZ1szXSwgc3BfZmc7CisgICAgaW50IGZjX3g7CisgICAgaW50IHp2 OworICAgIGludCB6dl9ieXRlOworICB9IGVzc2VudGlhbHM7CisgIC8qIFVzZWQgZWxzZXdoZXJl LiAqLworICBlbnVtIG1jX2FjdGlvbl90eXBlCisgIHsKKyAgICBNVUxUSVBMRV9DVVJTT1JTLAor ICAgIEhPUklaT05UQUxfUlVMRVIsCisgICAgVkVSVElDQUxfUlVMRVIsCisgICAgRklMTF9DT0xV TU4sCisgICAgQ1VSU09SX0lORElDQVRPUgorICB9IGFjdGlvbl90eXBlOworfSBtY19tYXRyaXg7 CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAgICAgLyogQ3Vyc29yIHR5cGUgb2YgbGFzdCBjdXJzb3IgZHJhd24gb24gdGhlIHdpbmRv dy4gICovCiAgICAgZW51bSB0ZXh0X2N1cnNvcl9raW5kcyBwaHlzX2N1cnNvcl90eXBlOwogCmRp ZmYgLS1naXQgYS9zcmMveGRpc3AuYyBiL3NyYy94ZGlzcC5jCmluZGV4IGE4OGZjNjkuLjU2MjU5 ZGEgMTAwNjQ0Ci0tLSBhL3NyYy94ZGlzcC5jCisrKyBiL3NyYy94ZGlzcC5jCkBAIC05MjEsNiAr OTIxLDQ2MzQgQEAgc3RhdGljIHZvaWQgc2hvd19tb3VzZV9mYWNlIChNb3VzZV9ITEluZm8gKiwg ZW51bSBkcmF3X2dseXBoc19mYWNlKTsKIHN0YXRpYyBib29sIGNvb3Jkc19pbl9tb3VzZV9mYWNl X3AgKHN0cnVjdCB3aW5kb3cgKiwgaW50LCBpbnQpOwogCiAKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBNVUxUSVBMRS1DVVJTT1JT OiAgRW1hY3MgQnVnICMyMjg3MyAoZmVhdHVyZSByZXF1ZXN0KQorCisgIENST1NTSEFJUlM6ICBF bWFjcyBCdWcgIzE3Njg0IChmZWF0dXJlIHJlcXVlc3QpCisKKworVkVSU0lPTjoKKworLSAwMjEu MDAwIFswNi8wMS8yMDE5XQorLSAwMjAuMDAwIFswNS8yNy8yMDE5XQorLSAwMTkuMDAwIFswNC8y MC8yMDE5XQorLSAwMTguMDAwIFswNC8wOC8yMDE5XQorLSAwMTcuMDAwIFsxMi8xMy8yMDE4XQor LSAwMTYuMDAwIFsxMS8yMC8yMD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jYXRlX3ZlY3RvciAobGVuZ3RoKTsKKyAgZm9yIChwdHJkaWZmX3QgaSA9IDA7IGkg PCBsZW5ndGg7IGkrKykKKyAgICBwLT5jb250ZW50c1tpXSA9IFFuaWw7CisgIHJldHVybiBtYWtl X2xpc3BfcHRyIChwLCBMaXNwX1ZlY3Rvcmxpa2UpOworfQorCitMaXNwX09iamVjdAorbWNfbGlz dG4gKHB0cmRpZmZfdCBjb3VudCwgTGlzcF9PYmplY3QgYXJnLCAuLi4pCit7CisgIGVhc3N1bWUg KDAgPCBjb3VudCk7CisgIExpc3BfT2JqZWN0IHZhbCA9IEZjb25zIChhcmcsIFFuaWwpOworICBM aXNwX09iamVjdCB0YWlsID0gdmFsOworICB2YV9saXN0IGFwOworICB2YV9zdGFydCAoYXAsIGFy Zyk7CisgIGZvciAocHRyZGlmZl90IGkgPSAxOyBpIDwgY291bnQ7IGkrKykKKyAgICB7CisgICAg ICBMaXNwX09iamVjdCBlbGVtID0gRmNvbnMgKHZhX2FyZyAoYXAsIExpc3BfT2JqZWN0KSwgUW5p bCk7CisgICAgICBYU0VUQ0RSICh0YWlsLCBlbGVtKTsKKyAgICAgIHRhaWwgPSBlbGVtOworICAg IH0KKyAgdmFfZW5kIChhcCk7CisgIHJldHVybiB2YWw7Cit9CisKK0xpc3BfT2JqZWN0CittY19t ZW1xIChMaXNwX09iamVjdCBlbHQsIExpc3BfT2JqZWN0IGxpc3QpCit7CisgIHdoaWxlICgxKQor ICAgIHsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpIHx8IEVRIChYQ0FSIChsaXN0KSwgZWx0KSkK KyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNP TlNQIChsaXN0KSB8fCBFUSAoWENBUiAobGlzdCksIGVsdCkpCisgICAgICAgIGJyZWFrOworICAg ICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkgfHwgRVEgKFhD QVIgKGxpc3QpLCBlbHQpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0 KTsKKyAgICB9CisgIHJldHVybiBsaXN0OworfQorCitMaXNwX09iamVjdAorbWNfbnRoIChpbnQg bnVtLCBMaXNwX09iamVjdCBsaXN0KQoreworICBmb3IgKGludCBpID0gMDsgaSA8IG51bSAmJiAh TklMUCAobGlzdCk7IGkrKykKKyAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgIGlmIChDT05TUCAo bGlzdCkpCisgICAgcmV0dXJuIFhDQVIgKGxpc3QpOworICAgIGVsc2UKKyAgICAgIHJldHVybiBR bmlsOworfQorCitMaXNwX09iamVjdAorbWNfYXNzcSAoTGlzcF9PYmplY3Qga2V5LCBMaXNwX09i amVjdCBsaXN0KQoreworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBpZiAoIUNPTlNQIChsaXN0 KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYmIEVR IChYQ0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3Qg PSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENP TlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhDQVIgKFhDQVIgKGxpc3Qp KSwga2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAg ICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQor ICAgICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBrZXkpKSkKKyAgICAgICAg YnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgfQorICBpZiAoQ09OU1AgKGxp c3QpKQorICAgIHJldHVybiBYQ0FSIChsaXN0KTsKKyAgICBlbHNlCisgICAgICByZXR1cm4gUW5p bDsKK30KKworTGlzcF9PYmplY3QKK21jX2Fzc29jIChMaXNwX09iamVjdCBrZXksIExpc3BfT2Jq ZWN0IGxpc3QpCit7CisgIExpc3BfT2JqZWN0IGNhcjsKKyAgd2hpbGUgKDEpCisgICAgeworICAg ICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQor ICAgICAgICAgICAgICAmJiAoY2FyID0gWENBUiAoWENBUiAobGlzdCkpLAorICAgICAgICAgICAg ICAgICAgRVEgKGNhciwga2V5KSB8fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAg ICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAo bGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAm JiAoY2FyID0gWENBUiAoWENBUiAobGlzdCkpLAorICAgICAgICAgICAgICAgICAgRVEgKGNhciwg a2V5KSB8fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAgICAgIGJyZWFrOworICAg ICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAg ICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiAoY2FyID0gWENBUiAo WENBUiAobGlzdCkpLAorICAgICAgICAgICAgICAgICAgRVEgKGNhciwga2V5KSB8fCAhTklMUCAo RmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIg KGxpc3QpOworICAgIH0KKyAgaWYgKENPTlNQIChsaXN0KSkKKyAgICByZXR1cm4gWENBUiAobGlz dCk7CisgICAgZWxzZQorICAgICAgcmV0dXJuIFF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gICAgIEVNQUNTX0lOVCBhbGlnbl90 b19tYXggPQorICAoY29sIDwgTU9TVF9QT1NJVElWRV9GSVhOVU0gLSBJTlRfTUFYCisgICA/IChF TUFDU19JTlQpIElOVF9NQVggKyBjb2wKKyAgIDogTU9TVF9QT1NJVElWRV9GSVhOVU0pOworICAg ICAgaWYgKChwcm9wID0gbWNfcGxpc3RfZ2V0IChwbGlzdCwgUUN3aWR0aCksCisgICAgIFJBTkdF RF9GSVhOVU1QICgwLCBwcm9wLCBJTlRfTUFYKSkKKyAgICB8fCAocHJvcCA9IG1jX3BsaXN0X2dl dCAocGxpc3QsIFFDcmVsYXRpdmVfd2lkdGgpLAorICAgICAgICBSQU5HRURfRklYTlVNUCAoMCwg cHJvcCwgSU5UX01BWCkpKQorICB3aWR0aCA9IFhGSVhOVU0gKHByb3ApOworICAgICAgZWxzZSBp ZiAoRkxPQVRQIChwcm9wKSAmJiAwIDw9IFhGTE9BVF9EQVRBIChwcm9wKQorICAgICAgICAgJiYg WEZMT0FUX0RBVEEgKHByb3ApIDw9IElOVF9NQVgpCisgIHdpZHRoID0gKGludCkoWEZMT0FUX0RB VEEgKHByb3ApICsgMC41KTsKKyAgICAgIGVsc2UgaWYgKChwcm9wID0gbWNfcGxpc3RfZ2V0IChw bGlzdCwgUUNhbGlnbl90byksCisgICAgUkFOR0VEX0ZJWE5VTVAgKGNvbCwgcHJvcCwgYWxpZ25f dG9fbWF4KSkpCisgIHdpZHRoID0gWEZJWE5VTSAocHJvcCkgLSBjb2w7CisgICAgICBlbHNlIGlm IChGTE9BVFAgKHByb3ApICYmIGNvbCA8PSBYRkxPQVRfREFUQSAocHJvcCkKKyAgICAgICAgICYm IChYRkxPQVRfREFUQSAocHJvcCkgPD0gYWxpZ25fdG9fbWF4KSkKKyAgd2lkdGggPSAoaW50KShY RkxPQVRfREFUQSAocHJvcCkgKyAwLjUpIC0gY29sOworICAgICAgaWYgKHdpZHRoID49IDApCisg IHsKKyAgICBwdHJkaWZmX3Qg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T1VOREFSWSB0byB0aGUgbmV4dCBwbGFjZQorICAgICAgIHdoZXJlIHdlIG1pZ2h0IG5lZWQgdG8g c2tpcCBtb3JlIGludmlzaWJsZSB0ZXh0LiAqLworICAgIHNjYW4gPSBza2lwX2ludmlzaWJsZSAo c2NhbiwgJm5leHRfYm91bmRhcnksIGVuZCwgUW5pbCk7CisgICAgaWYgKHNjYW4gIT0gb2xkX3Nj YW4pCisgICAgICBzY2FuX2J5dGUgPSBDSEFSX1RPX0JZVEUgKHNjYW4pOworICAgIGlmIChzY2Fu ID49IGVuZCkKKyAgICAgIGdvdG8gZW5kbG9vcDsKKyAgfQorICAgICAgLyogVGVzdCByZWFjaGlu ZyB0aGUgZ29hbCBjb2x1bW4uICBXZSBkbyB0aGlzIGFmdGVyIHNraXBwaW5nCisgICBpbnZpc2li bGUgY2hhcmFjdGVycywgc28gdGhhdCB3ZSBwdXQgcG9pbnQgYmVmb3JlIHRoZQorICAgY2hhcmFj dGVyIG9uIHdoaWNoIHRoZSBjdXJzb3Igd2lsbCBhcHBlYXIuICovCisgICAgICBpZiAoY29sID49 IGdvYWwpCisgIGJyZWFrOworICAgICAgcHJldl9jb2wgPSBjb2w7CisgICAgICB7IC8qIENoZWNr IGRpc3BsYXkgcHJvcGVydHkuICovCisgIHB0cmRpZmZfdCBlbmRwOworICBpbnQgd2lkdGggPSBt Y19jaGVja19kaXNwbGF5X3dpZHRoIChzY2FuLCBjb2wsICZlbmRwKTsKKyAgaWYgKHdpZHRoID49 IDApCisgICAgeworICAgICAgY29sICs9IHdpZHRoOworICAgICAgaWYgKGVuZHAgPiBzY2FuKSAv KiBBdm9pZCBpbmZpbml0ZSBsb29wcyB3aXRoIDAtd2lkdGggb3ZlcmxheXMuICovCisgICAgICAg IHsKKyAgICBzY2FuID0gZW5kcDsKKyAgICBzY2FuX2J5dGUgPSBDSEFSX1RPX0JZVEUgKHNjYW4p OworICAgIGNvbnRpbnVlOworICAgICAgICB9CisgICAgfQorICAgICAgfQorICAgICAgLyogQ2hl Y2sgY29tcG9zaXRpb24gc2VxdWVuY2UuICovCisgICAgICBpZiAoY21wX2l0LmlkID49IDAKKyAg ICB8fCAoc2NhbiA9PSBjbXBfaXQuc3RvcF9wb3MKKyAgICAgICAgJiYgY29tcG9zaXRpb25fcmVz ZWF0X2l0ICgmY21wX2l0LCBzY2FuLCBzY2FuX2J5dGUsIGVuZCwKKyAgICAgICAgICB3LCBOVUxM LCBRbmlsKSkpCisgIGNvbXBvc2l0aW9uX3VwZGF0ZV9pdCAoJmNtcF9pdCwgc2Nhbiwgc2Nhbl9i eXRlLCBRbmlsKTsKKyAgICAgIGlmIChjbXBfaXQuaWQgPj0gMCkKKyAgeworICAgIHNjYW4gKz0g Y21wX2l0Lm5jaGFyczsKKyAgICBzY2FuX2J5dGUgKz0gY21wX2l0Lm5ieXRlczsKKyAgICBpZiAo c2NhbiA8PSBlbmQpCisgICAgICBjb2wgKz0gY21wX2l0LndpZHRoOworICAgIGlmIChjbXBfaXQu dG8gPT0gY21wX2l0Lm5nbHlwaHMpCisgICAgICB7CisgICAgICAgIGNtcF9pdC5pZCA9IC0xOwor ICAgICAgICBjb21wb3NpdGlvbl9jb21wdXRlX3N0b3BfcG9zICgmY21wX2l0LCBzY2FuLCBzY2Fu X2J5dGUsIGVuZCwKKyAgICAgICAgICAgICAgUW5pbCk7CisgICAgICB9CisgICAgZWxzZQorICAg ICAgY21wX2l0LmZyb20gPSBjbXBfaXQudG87CisgICAgY29udGludWU7CisgIH0KKyAgICAgIGMg PSBGRVRDSF9CWVRFIChzY2FuX2J5dGUpOworICAgICAgLyogU2VlIGlmIHRoZXJlIGlzIGEgZGlz cGxheSB0YWJsZSBhbmQgaXQgcmVsYXRlcworICAgdG8gdGhpcyBjaGFyYWN0ZXIuICovCisgICAg ICBpZiAoZHAgIT0gMAorICAgICYmICEgKG11bHRpYnl0ZSAmJiBMRUFESU5HX0NPREVfUCAoYykp CisgICAgJiYgVkVDVE9SUCAoRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpKSkKKyAgeworICAgIExp c3BfT2JqZWN0IGNoYXJ2ZWM7CisgICAgcHRyZGlmZl90IGksIG47CisgICAgLyogVGhpcyBjaGFy YWN0ZXIgaXMgZGlzcGxheWVkIHVzaW5nIGEgdmVjdG9yIG9mIGdseXBocy4KKyAgICAgICBVcGRh dGUgdGhlIGNvbHVtbi9wb3NpdGlvbiBiYXNlZCBvbiB0aG9zZSBnbHlwaHMuICovCisgICAgY2hh cnZlYyA9IERJU1BfQ0hBUl9WRUNUT1IgKGRwLCBjKTsKKyAgICBuID0gQVNJWkUgKGNoYXJ2ZWMp OworICAgIGZvciAoaSA9IDA7IGkgPCBuOyBpKyspCisgICAgICB7CisgICAgICAgIC8qIFRoaXMg c2hvdWxkIGJlIGhhbmRsZWQgdGhlIHNhbWUgYXMKKyAgICAgbmV4dF9lbGVtZW50X2Zyb21fZGlz cGxheV92ZWN0b3IgZG9lcyBpdC4gKi8KKyAgICAgICAgTGlzcF9PYmplY3QgZW50cnkgPSBBUkVG IChjaGFydmVjLCBpKTsKKyAgICAgICAgaWYgKEdMWVBIX0NPREVfUCAoZW50cnkpKQorICAgIGMg PSBHTFlQSF9DT0RFX0NIQVIgKGVudHJ5KTsKKyAgICAgICAgZWxzZQorICAgIGMgPSAnICc7Cisg ICAgICAgIGlmIChjID09ICdcbicpCisgICAgZ290byBlbmRsb29wOworICAgICAgICBpZiAoYyA9 PSAnXHInICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rpc3BsYXkpLCBR dCkpCisgICAgZ290byBlbmRsb29wOworICAgICAgICBpZiAoYyA9PSAnXHQnKQorICAgIHsKKyAg ICAgIGNvbCArPSB0YWJfd2lkdGg7CisgICAgICBjb2wgPSBjb2wgLyB0YWJfd2lkdGggKiB0YWJf d2lkdGg7CisgICAgfQorICAgICAgICBlbHNlCisgICAgKytjb2w7CisgICAgICB9CisgIH0KKyAg ICAgIGVsc2UKKyAgeworICAgIC8qIFRoZSBkaXNwbGF5IHRhYmxlIGRvZXNuJ3QgYWZmZWN0IHRo aXMgY2hhcmFjdGVyOworICAgICAgIGl0IGRpc3BsYXlzIGFzIGl0c2VsZi4gKi8KKyAgICBpZiAo YyA9PSAnXG4nKQorICAgICAgZ290byBlbmRsb29wOworICAgIGlmIChjID09ICdccicgJiYgRVEg KEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVfZGlzcGxheSksIFF0KSkKKyAgICAgIGdv dG8gZW5kbG9vcDsKKyAgICBpZiAoYyA9PSAnXHQnKQorICAgICAgeworICAgICAgICBjb2wgKz0g dGFiX3dpZHRoOworICAgICAgICBjb2wgPSBjb2wgLyB0YWJfd2lkdGggKiB0YWJfd2lkdGg7Cisg ICAgICB9CisgICAgZWxzZSBpZiAobXVsdGlieXRlICYmIExFQURJTkdfQ09ERV9QIChjKSkKKyAg ICAgIHsKKyAgICAgICAgLyogU3RhcnQgb2YgbXVsdGktYnl0ZSBmb3JtLiAqLworICAgICAgICB1 bnNpZ25lZCBjaGFyICpwdHI7CisgICAgICAgIGludCBieXRlcywgd2lkdGg7CisgICAgICAgIHB0 ciA9IEJZVEVfUE9TX0FERFIgKHNjYW5fYnl0ZSk7CisgICAgICAgIE1DX01VTFRJQllURV9CWVRF U19XSURUSCAocHRyLCBkcCwgYnl0ZXMsIHdpZHRoKTsKKyAgICAgICAgLyogU3VidHJhY3Qgb25l IHRvIGNvbXBlbnNhdGUgZm9yIHRoZSBpbmNyZW1lbnQKKyAgICAgdGhhdCBpcyBnb2luZyB0byBo YXBwZW4gYmVsb3cuICovCisgICAgICAgIHNjYW5fYnl0ZSArPSBieXRlcyAtIDE7CisgICAgICAg IGNvbCArPSB3aWR0aDsKKyAgICAgIH0KKyAgICBlbHNlIGlmIChjdGxfYXJyb3cgJiYgKGMgPCAw NDAgfHwgYyA9PSAwMTc3KSkKKyAgICAgIGNvbCArPSAyOworICAgIGVsc2UgaWYgKGMgPCAwND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ZlcmxheXMgKCkKKyAgICAgIHx8IFogIT0gWl9CWVRFKQorICAgIHsKKyAgICAgIEVNQUNTX0lO VCBjb2wgPSBNT1NUX1BPU0lUSVZFX0ZJWE5VTTsKKyAgICAgIG1jX3NjYW5fZm9yX2NvbHVtbiAo JnB0LCAmY29sLCBOVUxMLCBwdCk7CisgICAgICB7CisgICAgICAgIGlmIChvbGRfYnVmZmVyKQor ICAgICAgICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworICAgICAgICByZXR1 cm4gY29sOworICAgICAgfQorICAgIH0KKyAgLyogU2NhbiBiYWNrd2FyZHMgZnJvbSBwb2ludCB0 byB0aGUgcHJldmlvdXMgbmV3bGluZSwKKyAgICAgY291bnRpbmcgd2lkdGguICBUYWIgY2hhcmFj dGVycyBhcmUgdGhlIG9ubHkgY29tcGxpY2F0ZWQgY2FzZS4gKi8KKyAgLyogTWFrZSBhIHBvaW50 ZXIgZm9yIGRlY3JlbWVudGluZyB0aHJvdWdoIHRoZSBjaGFycyBiZWZvcmUgcG9pbnQuICovCisg IHB0ciA9IEJZVEVfUE9TX0FERFIgKENIQVJfVE9fQllURSAocHQpIC0gMSkgKyAxOworICAvKiBN YWtlIGEgcG9pbnRlciB0byB3aGVyZSBjb25zZWN1dGl2ZSBjaGFycyBsZWF2ZSBvZmYsCisgICAg IGdvaW5nIGJhY2t3YXJkcyBmcm9tIHBvaW50LiAqLworICBpZiAocHQgPT0gQkVHVikKKyAgICBz dG9wID0gcHRyOworICBlbHNlIGlmIChwdCA8PSBHUFQgfHwgQkVHViA+IEdQVCkKKyAgICBzdG9w ID0gQkVHVl9BRERSOworICBlbHNlCisgICAgc3RvcCA9IEdBUF9FTkRfQUREUjsKKyAgY29sID0g MCwgdGFiX3NlZW4gPSAwLCBwb3N0X3RhYiA9IDA7CisgIHdoaWxlICgxKQorICAgIHsKKyAgICAg IHB0cmRpZmZfdCBpLCBuOworICAgICAgTGlzcF9PYmplY3QgY2hhcn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VBIX0NPREVfQ0hBUiAoZW50cnkpOworICAgICAgICBlbHNlCisgICAg YyA9ICcgJzsKKyAgICAgIH0KKyAgICBpZiAoYyA+PSAwNDAgJiYgYyA8IDAxNzcpCisgICAgICBj b2wrKzsKKyAgICBlbHNlIGlmIChjID09ICdcbicKKyAgICAgICB8fCAoYyA9PSAnXHInCisgICAg ICAgICAgICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rpc3BsYXkpLCBR dCkpKQorICAgICAgeworICAgICAgICBwdHIrKzsKKyAgICAgICAgZ290byBzdGFydF9vZl9saW5l X2ZvdW5kOworICAgICAgfQorICAgIGVsc2UgaWYgKGMgPT0gJ1x0JykKKyAgICAgIHsKKyAgICAg ICAgaWYgKHRhYl9zZWVuKQorICAgIGNvbCA9ICgoY29sICsgdGFiX3dpZHRoKSAvIHRhYl93aWR0 aCkgKiB0YWJfd2lkdGg7CisgICAgICAgIHBvc3RfdGFiICs9IGNvbDsKKyAgICAgICAgY29sID0g MDsKKyAgICAgICAgdGFiX3NlZW4gPSAxOworICAgICAgfQorICAgIGVsc2UgaWYgKFZFQ1RPUlAg KGNoYXJ2ZWMpKQorICAgICAgLyogV2l0aCBhIGRpc3BsYXkgdGFibGUgZW50cnksIEMgaXMgZGlz cGxheWVkIGFzIGlzLCBhbmQKKyAgICAgICAgIG5vdCBkaXNwbGF5ZWQgYXMgXE5OTiBvciBhcyBe Ti4gIElmIEMgaXMgYSBzaW5nbGUtYnl0ZQorICAgICAgICAgY2hhcmFjdGVyLCBpdCB0YWtlcyBv bmUgY29sdW1uLiAgSWYgQyBpcyBtdWx0aS1ieXRlIGluCisgICAgICAgICBhIHVuaWJ5dGUgYnVm ZmVyLCBpdCdzIHRyYW5zbGF0ZWQgdG8gdW5pYnl0ZSwgc28gaXQKKyAgICAgICAgIGFsc28gdGFr ZXMgb25lIGNvbHVtbi4gKi8KKyAgICAgICsrY29sOworICAgIGVsc2UKKyAgICAgIGNvbCArP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gKi8KK2NoYXIgKgorbWNf d2luZG93IChzdHJ1Y3Qgd2luZG93ICp3KQoreworICBMaXNwX09iamVjdCB3aW5kb3c7CisgIFhT RVRXSU5ET1cgKHdpbmRvdywgdyk7CisgIHJldHVybiBTU0RBVEEgKEZwcmluMV90b19zdHJpbmcg KHdpbmRvdywgUW5pbCkpOworfQorCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIkNIQVJB Q1RFUiAoJXMpIiwgbWNfY2hhcl90b19zdHJpbmcgKGdseXBoLT51LmNoKSk7ICovCitjaGFyICoK K21jX2NoYXJfdG9fc3RyaW5nIChpbnQgYXJnKQoreworICBMaXNwX09iamVjdCBjaGFyYWN0ZXIg PSAoMCA8PSBhcmcgJiYgYXJnIDw9IE1BWF9DSEFSKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBGY2hhcl90b19zdHJpbmcgKG1ha2VfZml4bnVtIChhcmcpKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBRbmlsOworICBjaGFyICogcmVzdWx0ID0gKCFOSUxQIChjaGFyYWN0ZXIp CisgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDkpCisgICAgICAgICAgICAgICAgICAgID8g IlxcdCIKKyAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAg ICAgICAgICAgICAmJiBhcmcgPT0gMTApCisgICAgICAgICAgICAgICAgICAgID8gIlxcbiIKKyAg ICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAg ICAmJiBhcmcgPT0gMzIpCisgICAgICAgICAgICAgICAgICAgID8gIlxccyIKKyAgICAgICAgICAg ICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAgICAmJiBhcmcg IT0gOQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9IDEwCisgICAgICAgICAgICAgICAg ICAgICAmJiBhcmcgIT0gMzIpCisgICAgICAgICAgICAgICAgICAgID8gU1NEQVRBIChjaGFyYWN0 ZXIpCisgICAgICAgICAgICAgICAgICA6ICJcXD8iOworICByZXR1cm4gcmVzdWx0OworfQorCitp bnQKK21jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKExpc3BfT2JqZWN0IGFyZykKK3sKKyAgY2hhciAq c3RyOworICBpZiAoWFRZUEUgKGFyZykgPT0gTGlzcF9TdHJpbmcpCisgICAgc3RyID0gU1NEQVRB IChhcmcpOworICAgIGVsc2UgaWYgKFhUWVBFIChhcmcpID09IExpc3BfU3ltYm9sKQorICAgICAg c3RyID0gU1NEQVRBIChTWU1CT0xfTkFNRSAoYXJnKSk7CisgICAgICBlbHNlIHJldHVybiAtMTsK KyAgaWYgKCFzdHJjbXAgKHN0ciwgIm5vIikpCisgICAgcmV0dXJuIE1DX05PX0NVUlNPUjsKKyAg aWYgKCFzdHJjbXAgKHN0ciwgIm1jLWxlZnQtZnJpbmdlLWJpdG1hcCIpKQorICAgIHJldHVybiBN Q19MRUZUX0ZSSU5HRV9CSVRNQVA7CisgIGlmICghc3RyY21wIChzdHIsICJtYy1yaWdodC1mcmlu Z2UtYml0bWFwIikpCisgICAgcmV0dXJuIE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA7CisgIGlmICgh c3RyY21wIChzdHIsICJib3giKSkKKyAgICByZXR1cm4gTUNfRklMTEVEX0JPWDsKKyAgaWYgKCFz dHJjbXAgKHN0ciwgImZyYW1lZCIpKQorICAgIHJldHVybiBNQ19GUkFNRURfQk9YOworICBpZiAo IXN0cmNtcCAoc3RyLCAiaG9sbG93IikpCisgICAgcmV0dXJuIE1DX0hPTExPV19CT1g7CisgIGlm ICghc3RyY21wIChzdHIsICJiYXIiKSkKKyAgICByZXR1cm4gTUNfQkFSOworICBpZiAoIXN0cmNt cCAoc3RyLCAiaGJhciIpKQorICAgIHJldHVybiBNQ19IQkFSOworICByZXR1cm4gLTE7Cit9CisK Ky8qIFVTQUdF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WN0IG1j X2Vzc2VudGlhbHMgKmVzc2VudGlhbHMpCit7CisgIGlmICghQlVGRkVSUCAody0+Y29udGVudHMp KQorICAgIHJldHVybjsKKyAgaWYgKE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg bWNfY29uZikpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNy b3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBm Y192aXNpYmxlKSkpCisgICAgcmV0dXJuOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHct PmZyYW1lKTsKKyAgZXNzZW50aWFscy0+YWN0aXZlX3AgPSAodyA9PSBYV0lORE9XIChmLT5zZWxl Y3RlZF93aW5kb3cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGYgPT0gRlJBTUVfRElT UExBWV9JTkZPIChmKS0+eF9oaWdobGlnaHRfZnJhbWUpOworICBMaXNwX09iamVjdCBidWYgPSB3 LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYpOworICBzdHJ1Y3QgYnVmZmVyICpiID0g WEJVRkZFUiAoYnVmKTsKKyAgc3RydWN0IGJ1ZmZlciAqb2xkX2J1ZmZlciA9IE5VTEw7CisgIHB0 cmRpZmZfdCBvcG9pbnQgPSAodyA9PSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpKQorICAgICAg ICAgICAgICAgICAgICAgPyBQVAorICAgICAgICAgICAgICAgICAgICAgOiBYRklYTlVNIChGbWFy a2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pKTsKKyAgcHRyZGlmZl90IGN1cnJlbnRfY29sID0gbWNf Y3VycmVudF9jb2x1bW4gKHcsIG9wb2ludCk7CisgIGludCBmcmFtZV9jaGFyX3dpZHRoID0gRlJB TUVfQ09MVU1OX1dJRFRIIChmKTsKKyAgYm9vbCBmaWxsX2NvbHVtbl9wID0gIU5JTFAgKEJWQVIg KGIsIGZpbGxfY29sdW1uKSk7CisgIGludCBmaWxsX2NvbCA9IFhGSVhOVU0gKEJWQVIgKGIsIGZp bGxfY29sdW1uKSk7CisgIGludCBoc2NsX3ggPSB3LT5oc2Nyb2xsICogZnJhbWVfY2hhcl93aWR0 aDsKKyAgaWYgKGIgIT0gY3VycmVudF9idWZmZXIpCisgICAgeworICAgICAgb2xkX2J1ZmZlciA9 IGN1cnJlbnRfYnVmZmVyOworICAgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAoYik7CisgICAgfQor ICBlc3NlbnRpYWxzLT56diA9IFpWOworICBlc3NlbnRpYWxzLT56dl9ieXRlID0gWlZfQllURTsK KyAgZXNzZW50aWFscy0+ZmNfeCA9IChmaWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgICAgICAg ICAgJiYgIU5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisgICAgICAgICAgICAgICAgICAg ICAgID8gKGZpbGxfY29sICogZnJhbWVfY2hhcl93aWR0aCkgKyB3LT5tYy5sbnVtX3BpeGVsX3dp ZHRoIC0gaHNjbF94CisgICAgICAgICAgICAgICAgICAgICA6IChmaWxsX2NvbHVtbl9wCisgICAg ICAgICAgICAgICAgICAgICAgICAmJiBOSUxQIChWZGlzcGxheV9saW5lX251bWJlcnMpKQorICAg ICAgICAgICAgICAgICAgICAgICA/IChmaWxsX2NvbCAqIGZyYW1lX2NoYXJfd2lkdGgpIC0gaHNj bF94CisgICAgICAgICAgICAgICAgICAgICA6IDA7CisgIGlmIChvbGRfYnVmZmVyKQorICAgIHNl dF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworCisgIGVudW0gZmFjZV9pZCBmaWxsX2Nv bHVtbl9wcmVfenZfZmFjZV9pZCA9CisgICAgKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAm JiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY19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AoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkK KyAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICYm IHctPmN1cnNvci54ID09IGVzc2VudGlhbHMtPmZjX3gpCisgICAgICA/IGxvb2t1cF9uYW1lZF9m YWNlICh3LCBmLCBpbnRlcm4gKCJmYy1vcG9pbnQtYXQtenYtZmFjZSIpLCB0cnVlKQorICAgIDog KCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAgICYmICFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQIChC VkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgJiYgdy0+Y3Vyc29yLnggIT0gZXNz ZW50aWFscy0+ZmNfeCkKKyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAo ImZjLWluYWN0aXZlLWF0LXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICA6IChlc3NlbnRpYWxzLT5hY3Rp dmVfcAorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3Nz aGFpcnMpKQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisg ICAgICAgJiYgdy0+Y3Vyc29yLnggIT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8gbG9va3Vw X25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLWF0LXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICA6 IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1hdC16di1mYWNlIiksIH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Gl2ZV93aW5kb3dzKSkKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGlj YWxfcnVsZXIpKQorICAgICAgICYmIHctPmN1cnNvci54ID09IGVzc2VudGlhbHMtPmZjX3gpCisg ICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1vcG9pbnQtaW5hY3Rp dmUtcG9zdC16di1mYWNlIiksIHRydWUpCisgICAgOiAoZXNzZW50aWFscy0+YWN0aXZlX3AKKyAg ICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkK KyAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICYm IHctPmN1cnNvci54ID09IGVzc2VudGlhbHMtPmZjX3gpCisgICAgICA/IGxvb2t1cF9uYW1lZF9m YWNlICh3LCBmLCBpbnRlcm4gKCJmYy1vcG9pbnQtcG9zdC16di1mYWNlIiksIHRydWUpCisgICAg OiAoIWVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgZmNfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAgJiYgIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgJiYgIU5JTFAg KEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAmJiB3LT5jdXJzb3IueCAhPSBl c3NlbnRpYWxzLT5mY194KQorICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJu ICgiZmMtaW5hY3RpdmUtcG9zdC16di1mYWNlIiksIHRydWUpCisgICA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KmYg PSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgICAgIHB0cmRpZmZfdCBjdXJyZW50X2NvbCA9IG1jX2N1 cnJlbnRfY29sdW1uICh3LCBwb3NpbnQpOworICAgICAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y29u dGVudHM7CisgICAgICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgICAgICBzdHJ1Y3QgYnVmZmVyICpi ID0gWEJVRkZFUiAoYnVmKTsKKyAgICAgIGJvb2wgZmlsbF9jb2x1bW5fcCA9ICFOSUxQIChCVkFS IChiLCBmaWxsX2NvbHVtbikpOworICAgICAgaW50IGZpbGxfY29sID0gKGZpbGxfY29sdW1uX3Ap CisgICAgICAgICAgICAgICAgICAgICA/IFhGSVhOVU0gKEJWQVIgKGIsIGZpbGxfY29sdW1uKSkK KyAgICAgICAgICAgICAgICAgICAgIDogMDsKKyAgICAgIGVudW0gZmFjZV9pZCBldmVuX2ZhY2Vf aWQgPQorICAgICAgICAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICYmICFOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAg ICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1ldmVuLWluYWN0aXZlLXBy ZS16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGlu dGVybiAoIistZXZlbi1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgIHN0cnVjdCBmYWNlICpl dmVuX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGV2ZW5fZmFjZV9pZCk7CisgICAgICBMaXNwX09i amVjdCBldmVuX2NvbG9yID0gZXZlbl9mYWNlLT5sZmFjZVtMRkFDRV9GT1JFR1JPVU5EX0lOREVY XTsKKyAgICAgIHN0cnVjdCBtY19SR0IgZXZlbl9mb3JlZ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gICAgICAgZWxzZSBpZiAoKCFmaWxsX2NvbHVtbl9w CisgICAgICAgICAgICAgICAgICAmJiBjdXJyZW50X2NvbCAlIDIgPT0gMAorICAgICAgICAgICAg ICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikKKyAgICAgICAgICAgICAgICAgfHwgKGZp bGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sICUgMiA9PSAw CisgICAgICAgICAgICAgICAgICAgICAmJiBjdXJyZW50X2NvbCA8PSBmaWxsX2NvbAorICAgICAg ICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikpCisgICAgICAgICAgewor ICAgICAgICAgICAgbHNsX2ZnLT5yZWQgPSBldmVuX2ZvcmVncm91bmQucmVkOworICAgICAgICAg ICAgbHNsX2ZnLT5ncmVlbiA9IGV2ZW5fZm9yZWdyb3VuZC5ncmVlbjsKKyAgICAgICAgICAgIGxz bF9mZy0+Ymx1ZSA9IGV2ZW5fZm9yZWdyb3VuZC5ibHVlOworICAgICAgICAgIH0KKyAgICAgICAg ICAvKiBncmVlbiAqLworICAgICAgICAgIGVsc2UgaWYgKGZpbGxfY29sdW1uX3AKKyAgICAgICAg ICAgICAgICAgICAmJiBjdXJyZW50X2NvbCA+IGZpbGxfY29sCisgICAgICAgICAgICAgICAgICAg JiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg bHNsX2ZnLT5yZWQgPSBiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kLnJlZDsKKyAgICAgICAgICAgICAg bHNsX2ZnLT5ncmVlbiA9IGJleW9uZF9maWxsX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAg ICAgIGxzbF9mZy0+Ymx1ZSA9IGJleW9uZF9maWxsX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAg ICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgIGxzbF9mZy0+cmVkID0gZXNzZW50aWFscy5zcF9m Zy5yZWQ7CisgICAgICAgICAgICAgICAgbHNsX2ZnLT5ncmVlbiA9IGVzc2VudGlhbHMuc3BfZmcu Z3JlZW47CisgICAgICAgICAgICAgICAgbHNsX2ZnLT5ibHVlID0gZXNzZW50aWFscy5zcF9mZy5i bHVlOworICAgICAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBIT1JJ Wk9OVEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChnbHlwaCAhPSBOVUxMCisgICAgICAgICAg JiYgZ2x5cGgtPnUuY2ggPT0gOTUKKyAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19IQkFS KQorICAgICAgICB7CisgICAgICAgICAgbHNsX2ZnLT5yZWQgPSBlc3NlbnRpYWxzLnNwX2ZnLnJl ZDsKKyAgICAgICAgICBsc2xfZmctPmdyZWVuID0gZXNzZW50aWFscy5zcF9mZy5ncmVlbjsKKyAg ICAgICAgICBsc2xfZmctPmJsdWUgPSBlc3NlbnRpYWxzLnNwX2ZnLmJsdWU7CisgICAgICAgIH0K KyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGxzbF9mZy0+cmVkID0gZXNz ZW50aWFscy5jaF9mZ1tyb3dfcG9zaXRpb25dLnJlZDsKKyAgICAgICAgICAgIGxzbF9mZy0+Z3Jl ZW4gPSBlc3NlbnRpYWxzLmNoX2ZnW3Jvd19wb3NpdGlvbl0uZ3JlZW47CisgICAgICAgICAgICBs c2xfZmctPmJsdWUgPSBlc3NlbnRpYWxzLmNoX2ZnW3Jvd19wb3NpdGlvbl0uYmx1ZTsKKyAgICAg ICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAg ICB7CisgICAgICBsc2xfZmctPnJlZCA9IGVzc2VudGlhbHMuY2hfZmdbcm93X3Bvc2l0aW9uXS5y ZWQ7CisgICAgICBsc2xfZmctPmdyZWVuID0gZXNzZW50aWFscy5jaF9mZ1tyb3dfcG9zaXRpb25d LmdyZWVuOworICAgICAgbHNsX2ZnLT5ibHVlID0gZXNzZW50aWFscy5jaF9mZ1tyb3dfcG9zaXRp b25dLmJsdWU7CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAg ICB7CisgICAgICBsc2xfZmctPnJlZCA9IGVzc2VudGlhbHMuZmNfZmdbcm93X3Bvc2l0aW9uXS5y ZWQ7CisgICAgICBsc2xfZmctPmdyZWVuID0gZXNzZW50aWFscy5mY19mZ1tyb3dfcG9zaXRpb25d LmdyZWVuOworICAgICAgbHNsX2ZnLT5ibHVlID0gZXNzZW50aWFscy5mY19mZ1tyb3dfcG9zaXRp b25dLmJsdWU7CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBDVVJTT1JfSU5ESUNBVE9S OgorICAgIHsKKyAgICAgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICAg ICAgZW51bSBmYWNlX2lkIGN1cnNvcl9mYWNlX2lkID0KKyAgICAgICAgKCFlc3NlbnRpYWxzLmFj dGl2ZV9wCisgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj aF9pbmFjdGl2ZV93aW5kb3dzKSkKKyAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYp CisgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZh a2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogKGVzc2Vu dGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikKKyAg ICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1j dXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgOiAoIWVzc2VudGlhbHMuYWN0aXZl X3AKKyAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hf aW5hY3RpdmVfd2luZG93cykpCisgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBBVF9aVikK KyAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1m YWtlLWN1cnNvci1pbmFjdGl2ZS1hdC16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogKGVzc2Vu dGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IEFUX1pWKQorICAg ICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1 cnNvci1hdC16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1hdC16di1mYWNlIiksIHRydWUpOworICAg ICAgc3RydWN0IGZhY2UgKmN1cnNvcl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBjdXJzb3JfZmFj ZV9pZCk7CisgICAgICBMaXNwX09iamVjdCBjdXJzb3JfY29sb3IgPSBjdXJzb3JfZmFjZS0+bGZh Y2VbTEZBQ0VfRk9SRUdST1VORF9JTkRFWF07CisgICAgICBtY194d19jb2xvcl92YWx1ZXMgKHcs IGN1cnNvcl9jb2xvciwgbHNsX2ZnKTsKKyAgICAgIGJyZWFrOworICAgIH0KKyAgfQorfQorCisv KiBEcmF3IGdseXBocyBiZXR3ZWVuIFNUQVJUIGFuZCBFTkQ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zCisgICAtICBP VkVSTEFQU19FUkFTRURfQ1VSU09SICBvdmVybGFwIHdpdGggZXJhc2VkIGN1cnNvciBhcmVhCisg ICBWYWx1ZSBpcyB0aGUgeC1wb3NpdGlvbiByZWFjaGVkLCByZWxhdGl2ZSB0byBBUkVBIG9mIFcu ICovCitzdGF0aWMgaW50CittY19kcmF3X2dseXBocyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0 IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAg ICAgICAgaW50IHgsIGVudW0gZ2x5cGhfcm93X2FyZWEgYXJlYSwgcHRyZGlmZl90IHN0YXJ0LCBw dHJkaWZmX3QgZW5kLAorICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCwg aW50IG92ZXJsYXBzLCBpbnQgdnBvcywgaW50IGJvdHRvbV92cG9zLAorICAgICAgICAgICAgICAg IHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsCisgICAgICAg ICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwgaW50IHdkLCBib29sIGFj dGl2ZV9wLAorICAgICAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AsIGVudW0gZHJhd19nbHlw aF9hY3Rpb24gYWN0aW9uX3R5cGUsIGJvb2wgZHJhd19wKQoreworICBpbnQgc3RhcnRfeCA9IHg7 CisgIGludCByZWxhdGl2ZV94ID0gMDsKKyAgaW50IGxlbmd0aCA9IDA7CisgIC8vICBpbnQgc3Rh cnRfaHBvcyA9IHN0YXJ0OworICAvLyAgaW50IGVuZF9ocG9zID0gZW5kOworICAvLyAgVFJBQ0Ug KChzdGRlcnIsICJtY19kcmF3X2dseXBocyAoJWQpOiAgc3RhcnRfeCAoJWQpIHwgc3RhcnRfaHBv cyAoJWQpIHwgZW5kX2hwb3MgKCVkKVxuIiw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NvbWUgZ2x5cGhzIGluIGZyb250IG9yIGZvbGxvd2luZyB0 aGUgZ2x5cGgKKyAgICAgc3RyaW5ncyBidWlsdCBhYm92ZS4gKi8KKyAgaWYgKGhlYWQgJiYgIW92 ZXJsYXBzICYmIHJvdy0+Y29udGFpbnNfb3ZlcmxhcHBpbmdfZ2x5cGhzX3ApCisgICAgeworICAg ICAgc3RydWN0IGdseXBoX3N0cmluZyAqaCwgKnQ7CisgICAgICBNb3VzZV9ITEluZm8gKmhsaW5m byA9IE1PVVNFX0hMX0lORk8gKGYpOworICAgICAgaW50IG1vdXNlX2JlZ19jb2wgVU5JTklULCBt b3VzZV9lbmRfY29sIFVOSU5JVDsKKyAgICAgIGJvb2wgY2hlY2tfbW91c2VfZmFjZSA9IGZhbHNl OworICAgICAgaW50IGR1bW15X3ggPSAwOworICAgICAgLyogSWYgbW91c2UgaGlnaGxpZ2h0aW5n IGlzIG9uLCB3ZSBtYXkgbmVlZCB0byBkcmF3IGFkamFjZW50CisgICBnbHlwaHMgdXNpbmcgbW91 c2UtZmFjZSBoaWdobGlnaHRpbmcuICovCisgICAgICBpZiAoYXJlYSA9PSBURVhUX0FSRUEgJiYg cm93LT5tb3VzZV9mYWNlX3AKKyAgICAgICAgICAmJiBobGluZm8tPm1vdXNlX2ZhY2VfYmVnX3Jv dyA+PSAwCisgICAgICAgICAgJiYgaGxpbmZvLT5tb3VzZV9mYWNlX2VuZF9yb3cgPj0gMCkKKyAg ICAgICAgeworICAgICAgICAgIHB0cmRpZmZfdCByb3dfdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAo cm93LCB3LT5jdXJyZW50X21hdHJpeCk7CisgICAgICAgICAgaWYgKHJvd192cG9zID49IGhsaW5m by0+bW91c2VfZmFjZV9iZWdfcm93CisgICAgICAgICAgICAgICYmIHJvd192cG9zIDw9IGhsaW5m by0+bW91c2VfZmFjZV9lbmRfcm93KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjaGVj a19tb3VzZV9mYWNlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgbW91c2VfYmVnX2NvbCA9IChyb3df dnBvcyA9PSBobGluZm8tPm1vdXNlX2ZhY2VfYmVnX3JvdykKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gaGxpbmZvLT5tb3VzZV9mYWNlX2JlZ19jb2wKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogMDsKKyAgICAgICAgICAgICAgbW91c2VfZW5kX2NvbCA9IChyb3dfdnBv cyA9PSBobGluZm8tPm1vdXNlX2ZhY2VfZW5kX3JvdykKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gaGxpbmZvLT5tb3VzZV9mYWNlX2VuZF9jb2wKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogcm93LT51c2VkW1RFWFRfQVJFQV07CisgICAgICAgICAgICB9CisgICAgICAg IH0KKyAgICAgIC8qIENvbXB1dGUgb3ZlcmhhbmdzIGZvciBhbGwgZ2x5cGggc3RyaW5ncy4gKi8K KyAgICAgIGlmIChGUkFNRV9SSUYgKGYpLT5jb21wdXRlX2dseXBoX3N0cmluZ19vdmVyaGFuZ3Mp CisgICAgICAgIGZvciAocyA9IGhlYWQ7IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgIEZSQU1F X1JJRiAoZiktPmNvbXB1dGVfZ2x5cGhfc3RyaW5nX292ZXJoYW5ncyAocyk7CisgICAgICAvKiBQ cmVwZW5kIGdseXBoIHN0cmluZ3MgZm9yIGdseXBocyBpbiBmcm9udCBvZiB0aGUgZmlyc3QgZ2x5 cGgKKyAgICAgIHN0cmluZyB0aGF0IGFyZSBvdmVyd3JpdHRlbiBiZWNhdXNlIG9mIHRoZSBmaXJz dCBnbHlwaAorICAgICAgc3RyaW5nJ3MgbGVmdCBvdmVyaGFuZy4gIFRoZSBiYWNrZ3JvdW5kIG9m IGFsbCBzdHJpbmdzCisgICAgICBwcmVwZW5kZWQgbXVzdCBiZSBkcmF3biBiZWN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pdGlvbikuICBXaGVuIHBsYWNp bmcgYSBmYWtlIGN1cnNvciBvbiB0aGUgIk0iLAorICAgICAgICAgIGhsID09IERSQVdfQ1VSU09S IGFuZCB0aGUgU1RSRVRDSF9HTFlQSCBpcyBgbGVmdF9vdmVyd3JpdHRlbmAuICBEcmF3aW5nCisg ICAgICAgICAgbm9ybWFsIHRleHQgZHVyaW5nIGB1cGRhdGVfd2luZG93JyAoRFJBV19OT1JNQUxf VEVYVCkgY2FuIGFsc28gZXJhc2UgZmFrZQorICAgICAgICAgIGN1cnNvcnMgdGhhdCBhcmUgYGxl ZnRfb3ZlcndyaXR0ZW4nLiAqLworICAgICAgICAgIGxlbmd0aCA9IDA7CisgICAgICAgICAgZm9y IChzID0gaDsgczsgcyA9IHMtPm5leHQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHMt PmxlZnRfb3ZlcndyaXR0ZW5fcCA9IHRydWU7CisgICAgICAgICAgICAgIHMtPmFjdGlvbl90eXBl ID0gYWN0aW9uX3R5cGU7CisgICAgICAgICAgICAgIGxlbmd0aCArPSBzLT5maXJzdF9nbHlwaC0+ cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgICAgcmVsYXRpdmVfeCA9IHN0YXJ0 X3ggLSBsZW5ndGg7CisgICAgICAgICAgZm9yIChzID0gaDsgczsgcyA9IHMtPm5leHQpCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIHMtPmZpcnN0X2dseXBoLT5yZWxhdGl2ZV94ID0gcmVs YXRpdmVfeDsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBzLT5maXJzdF9nbHlwaC0+cGl4 ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgICAgc3RhcnQgPSBpOworICAgICAgICAg IGNvbXB1dGVfb3ZlcmhhbmdzX2FuZF94ICh0LCBoZWFkLT54LCB0cnVlKTsKKyAgICAgICAgICBw cmVwZW5kX2dseXBoX3N0cmluZ19saXN0cyAoJmhl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YgZm9sbG93aW5nIGds eXBocy4gKi8KKyAgICAgIGkgPSByaWdodF9vdmVyd3JpdGluZyAodGFpbCk7CisgICAgICBpZiAo aSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIG92ZXJs YXBfaGw7CisgICAgICAgICAgaWYgKGNoZWNrX21vdXNlX2ZhY2UKKyAgICAgICAgICAgICAgJiYg bW91c2VfYmVnX2NvbCA8IGkgJiYgbW91c2VfZW5kX2NvbCA+IGVuZCkKKyAgICAgICAgICAgIG92 ZXJsYXBfaGwgPSBEUkFXX01PVVNFX0ZBQ0U7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAg ICAgIG92ZXJsYXBfaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgICAgIGlmIChobCA9PSBv dmVybGFwX2hsIHx8IGNsaXBfdGFpbCA9PSBOVUxMKQorICAgICAgICAgICAgY2xpcF90YWlsID0g dGFpbDsKKyAgICAgICAgICBpKys7ICAgICAgLyogV2UgbXVzdCBpbmNsdWRlIHRoZSBJdGggZ2x5 cGguICovCisgICAgICAgICAgTUNfQlVJTERfR0xZUEhfU1RSSU5HUyAoZW5kLCBpLCBoLCB0LCBv dmVybGFwX2hsLCB4LCBsYXN0X3gpOworICAgICAgICAgIGZvciAocyA9IGg7IHM7IHMgPSBzLT5u ZXh0KQorICAgICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICAg ICAgY29tcHV0ZV9vdmVyaGFuZ3NfYW5kX3ggKGgsIHRhaWwtPnggKyB0YWlsLT53aWR0aCwgZmFs c2UpOworICAgICAgICAgIGFwcGVuZF9nbHlwaF9zdHJpbmdfbGlzdHMgKCZoZWFkLCAmdGFpbCwg aCwgdCk7CisgICAgICAgIH0KKyAgICAgIHRhaWwgPSBnbHlwaF9zdHJpbmdfY29udGFpbmluZ19i YWNrZ3JvdW5kX3dpZHRoICh0YWlsKTsKKyAgICAgIGlmIChjbGlwX3RhaWwpCisgICAgICAgIGNs aXBfdGFpbCA9IGdseXBoX3N0cmluZ19jb250YWluaW5nX2JhY2tncm91bmRfd2lkdGggKGNsaXBf dGFpbCk7CisgICAgICBpZiAoY2xpcF9oZWFkIHx8IGNsaXBfdGFpbCkKKyAgICAgICAgZm9yIChz ID0gaGVhZDsgczsgcyA9IHMtPm5leHQpCisgICAgICAgICAgeworICAgICAgICAgICAgcy0+Y2xp cF9oZWFkID0gY2xpcF9oZWFkOworICAgICAgICAgICAgcy0+Y2xpcF90YWlsID0gY2xpcF90YWls OworICAgICAgICAgIH0KKyAgICB9CisgIC8qIERyYXcgYWxsIHN0cmluZ3MuICovCisgIGZvciAo cyA9IGhlYWQ7IHMgJiYgZHJhd19wOyBzID0gcy0+bmV4dCkKKyAgICBGUkFNRV9SSUYgKGYpLT5t Y19zY3JpYmVfc3RyaW5nIChzLCBtYXRyaXgsIHJvdywgbHNsLCBnbHlwaF9mbGF2b3IsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVf cCwgY3Vyc29yX2djX3ApOworI2lmbmRlZiBIQVZFX05TCisgIC8qIFdoZW4gZm9jdXMgYSBzb2xl IGZyYW1lIGFuZCBtb3ZlIGhvcml6b250YWxseSwgdGhpcyBjbGVhcnMgb25fcAorICAgICBjYXVz aW5nIGEgZmFpbHVyZSB0byBlcmFzZSBwcmV2IGN1cnNvciBwb3NpdGlvbi4gKi8KKyAgaWYgKGFy ZWEgPT0gVEVYVF9BUkVBCisgICAgICAmJiAhcm93LT5mdWxsX3dpZHRoX3AKKyAgICAgIC8qIFdo ZW4gZHJhd2luZyBvdmVybGFwcGluZyByb3dzLCBvbmx5IHRoZSBnbHlwaCBzdHJpbmdzJworICAg ICAgZm9yZWdyb3VuZCBpcyBkcmF3biwgd2hpY2ggZG9lc24ndCBlcmFzZSBhIGN1cnNvciBjb21w bGV0ZWx5LiAqLworICAgICAgJiYg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XZlX3AsIGN1cnNvcl9nY19wLAorICAgICAgICAgICAgICAgICAgICAgICAgICBNQ19EUkFX X0dMWVBILCBkcmF3X3ApOworICB1bmJsb2NrX2lucHV0ICgpOworICAvKiBBZHZhbmNlIHRoZSBv dXRwdXQgY3Vyc29yLiAqLworICB3LT5vdXRwdXRfY3Vyc29yLmhwb3MgKz0gbGVuOworICB3LT5v dXRwdXRfY3Vyc29yLnggPSB4OworfQorCisvKiBFWFBPUlQ6CisgICBEcmF3IHRoZSBjdXJzb3Ig Z2x5cGggb2Ygd2luZG93IFcgaW4gZ2x5cGggcm93IFJPVy4gIFNlZSB0aGUKKyAgIGNvbW1lbnQg b2YgZHJhd19nbHlwaHMgZm9yIHRoZSBtZWFuaW5nIG9mIEhMLiAqLwordm9pZAorbWNfZHJhd19j dXJzb3JfZ2x5cGggKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJp eCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICAgICAgIGVudW0gZHJh d19nbHlwaHNfZmFjZSBobCwgaW50IHgsIGludCBocG9zLCBpbnQgdnBvcywKKyAgICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9y LAorICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUs IGludCB3ZCwgYm9vbCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICBib29sIGN1cnNv cl9nY19wKQoreworICBzdHJ1Y3QgZ2x5cGhfcm93ICpib3R0b21fcm93ID0gTUFUUklYX0JPVFRP TV9URVhUX1JPVyAobWF0cml4LCB3KTsKKyAgaW50IGJvdHRvbV92cG9zID0gTUFUUklYX1JPV19W UE9TIChib3R0b21fcm93LCBtYXRyaXgpOworLyoKKyAgICAgIHN0cnVjdCBnbHlwaCAqY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ICByZXR1cm47CisgICAgfQorICAvKiBJZiBsaW5lIHNwYWNpbmcg aXMgPiAwLCBvbGQgY3Vyc29yIG1heSBvbmx5IGJlIHBhcnRpYWxseSB2aXNpYmxlIGluCisgICAg IHdpbmRvdyBhZnRlciBzcGxpdC13aW5kb3cuICBTbyBhZGp1c3QgdmlzaWJsZSBoZWlnaHQuICov CisgIHJvdy0+dmlzaWJsZV9oZWlnaHQgPSBtaW4gKHJvdy0+dmlzaWJsZV9oZWlnaHQsCisgICAg ICAgICAgICB3aW5kb3dfdGV4dF9ib3R0b21feSAodykgLSByb3ctPnkpOworICAvKiBJZiByb3cg aXMgY29tcGxldGVseSBpbnZpc2libGUsIGRvbid0IGF0dGVtcHQgdG8gZGVsZXRlIGEgY3Vyc29y IHdoaWNoCisgICAgIGlzbid0IHRoZXJlLiAgVGhpcyBjYW4gaGFwcGVuIGlmIGN1cnNvciBpcyBh dCB0b3Agb2YgYSB3aW5kb3csIGFuZAorICAgICB3ZSBzd2l0Y2ggdG8gYSBidWZmZXIgd2l0aCBh IGhlYWRlciBsaW5lIGluIHRoYXQgd2luZG93LiAqLworICBpZiAocm93LT52aXNpYmxlX2hlaWdo dCA8PSAwKQorICAgIHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICBmcHJpbnRmIChzdGRl cnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwgNCk7CisgICAgICByZXR1cm47 CisgICAgfQorICAvKiBJZiBjdXJzb3IgaXMgaW4gdGhlIGZyaW5nZSwgZXJhc2UgYnkgZHJhd2lu ZyBhY3R1YWwgYml0bWFwIHRoZXJlLiAqLworICBpZiAocm93LT5jdXJzb3JfaW5fZnJpbmdlX3AK KyAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19HTFlQSCkKKyAgICB7CisgICAgICByb3ctPmN1 cnNvcl9pbl9mcmluZ2VfcCA9IGZhbHNlOworICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwICh3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dXJzb3Jf Z2x5cGggKHcsIG1hdHJpeCwgcm93LCBocG9zLCB2cG9zKTsKKyAgICAgIGlmIChjdXJzb3JfZ2x5 cGggPT0gTlVMTCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICAg ICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2VfY3Vyc29yOiAgcmV0dXJuICglZClcbiIsIDcp OworICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgaW50IHRlbXBfd2QgPSBjdXJz b3JfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgaWYgKHRlbXBfeCA8IDApCisgICAgICAgIHsK KyAgICAgICAgICB0ZW1wX3dkICs9IHRlbXBfeDsKKyAgICAgICAgICB0ZW1wX3ggPSAwOworICAg ICAgICB9CisgICAgICB0ZW1wX3dkID0gbWluICh3ZCwgd2luZG93X2JveF93aWR0aCAodywgVEVY VF9BUkVBKSAtIHRlbXBfeCk7CisgICAgICBpbnQgZnkgPSBXSU5ET1dfVE9fRlJBTUVfUElYRUxf WSAodywgbWF4IChoZWFkZXJfbGluZV9oZWlnaHQsIHJvdy0+eSkpOworICAgICAgaW50IGZ4ID0g V0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgdGVtcF94KTsKKyAgICAgIGlmICh0ZW1w X3dkID4gMCkKKyAgICAgICAgRlJBTUVfUklGIChmKS0+Y2xlYXJfZnJhbWVfYXJlYSAoZiwgZngs IGZ5LCB0ZW1wX3dkLCByb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICB9CisgIC8qIEVyYXNlIHRo ZSBjdXJzb3IgYnkgcmVkcmF3aW5nIHRoZSBjaGFyYWN0ZXIgdW5kZXJuZWF0aCBpdC4gKi8KKyAg aWYgKG1vdXNlX2ZhY2VfaGVyZV9wKQorICAgIGhsID0gRFJBV19NT1VTRV9GQUNFOworICAgIGVs c2UKKyAgICAgIGhsID0gRFJBV19OT1JNQUxfVEVYV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gKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBo X3JvdyAqcm93LAorICAgICAgICAgICAgICAgICAgICAgIGludCB4LCBpbnQgZngsIGludCB5LCBp bnQgZnksIGludCBocG9zLCBpbnQgdnBvcywgaW50IHdkLCBpbnQgaCwKKyAgICAgICAgICAgICAg ICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLCBpbnQgY3Vyc29yX3dpZHRo LAorICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsLCBib29sIGFjdGl2ZV9w LCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgYm9v bCByZW1vdmVfcCkKK3sKKyAgLyogYG1hdHJpeF9yb3cnIGluIGBkaXNwbmV3LmNgIGNvbnRhaW5z IHRoZSBmb2xsb3dpbmcgdGVzdHMsCisgIGVhc3NlcnQgKG1hdHJpeCAmJiBtYXRyaXgtPnJvd3Mp OworICBlYXNzZXJ0IChyb3cgPj0gMCAmJiByb3cgPCBtYXRyaXgtPm5yb3dzKTsgKi8KKyAgYm9v bCBiYXJmX2NyYXNoX29uZSA9IChtYXRyaXggJiYgbWF0cml4LT5yb3dzKSA/IGZhbHNlIDogdHJ1 ZTsKKyAgaWYgKGJhcmZfY3Jhc2hfb25lKQorICAgIHJldHVybjsKKyAgYm9vbCBiYXJmX2NyYXNo X3R3byA9ICh2cG9zID49IDAgJiYgdnBvcyA8IG1hdHJpeC0+bnJvd3MpID8gZmFsc2UgOiB0cnVl OworICBpZiAoYmFyZl9jcmFzaF90d28pCisgICAgcmV0dXJuOworICBpZiAoeCA8IDAKKyAgICAg IHx8IHkgPCAwCisgICAgICB8fCBocG9zIDwgMAorICAgICAgfHwgdnBvcyA8IDApCisgICAgcmV0 dXJuOworICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChi dWYpOworICBib29sIGF1dG9faHNjcm9sbF9tb2RlX3AgPSBFUSAoRmJ1ZmZlcl9sb2NhbF92YWx1 ZSAoUWF1dG9faHNjcm9sbF9tb2RlLCBidWYpLCBRY3VycmVudF9saW5lKTsKKyAgLyogRVhBTVBM RTogIChzY3JvbGwtbGVmdCA1KSAqLworICBib29sIGhzY2xfYWxsX3RlbXBfcCA9ICh3LT5zdXNw ZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3Jv bGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IDApOworICAvKiBF WEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBub3RoaW5nLiAqLworICBib29sIGhzY2xfYWxsX3Bl cm1fMF9wID0gKHctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWlu X2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3Jv bGwgPT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0 aGluZyBlbHNlIGJlc2lkZXMgaG9yaXpvbnRhbGx5IHNjcm9sbGluZyB0aGUKKyAgICAgICAgICAg ICAgIGN1cnJlbnQgbGluZSBkaWZmZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGlu ZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wg aHNjbF9hbGxfcGVybV8xX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwg YW5kIC4uLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxs eSBzY3JvbGxlZCBkaWZmZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzJfcCA9ICgh dy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBh dXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNj cm9sbCA9PSAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwg PiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+ aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSk7IGFuZCwgdGhlbiBwcmVz cyB0aGUgbGVmdCBhcnJvdyBrZXkgb25lIHRpbWUuCisgICAgICAgICAgICAgICBDdXJyZW50IGxp bmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuKi8KKyAgYm9vbCBoc2Ns X3RlbXBfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAg ICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNj cm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsK KyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gc29tZXRoaW5nIHRoYXQgY2F1c2VzIHRo ZSBjdXJyZW50IGxpbmUgdG8gYmUKKyAgICAgICAgICAgICAgIGhvcml6b250YWxseSBzY3JvbGxl ZCBkaWZmZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6b250 YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX3Blcm1fcCA9ICghdy0+ c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3Jv bGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5taW5faHNjcm9sbCAhPSB3LT5oc2Nyb2xsKTsKKyAgc3RydWN0IGZyYW1lICpm ID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIGludCBmcmluZ2VfYml0bWFwID0gTUNfTk9fRlJJTkdF X0JJVE1BUDsKKyAgaW50IGZhY2VfaWQgPSBERUZBVUxUX0ZBQ0VfSUQ7CisgIGlmICghcmVtb3Zl X3AKKyAgICAgICYmIGdseXBoX2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUAorICAg ICAgJiYgIWhzY2xfYWxsX3RlbXBfcAorICAgICAgJiYgIWhzY2xfdGVtcF9wCisgICAgICAmJiAh aHNjbF9wZXJtX3AKKyAgICAgICYmICFoc2NsX2FsbF9wZXJtXzBfcAorICAgICAgJiYgIWhzY2xf YWxsX3Blcm1fMV9wCisgICAgICAmJiAhaHNjbF9hbGxfcGVybV8yX3ApCisgICAgeworICAgICAg ZW51bSBmYWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICghYWN0aXZlX3AK KyAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0 aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJu ICgiKy1vdmVybGF5LWFycm93LWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAg IDogKGFjdGl2ZV9wKQorICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVy biAoIistb3ZlcmxheS1hcnJvdy1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICA6IERFRkFV TFRfRkFDRV9JRDsKKyAgICAgIGZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklO R0VfQklUTUFQKQorICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisgICAg ICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAvKiBmcmluZ2VfYml0bWFwID0g bWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIFFvdmVybGF5X2Fycm93LCBmYWxzZSwgZmFsc2UpOyAq LworICAgICAgaWYgKHctPmhzY3JvbGwgIT0gMCkKKyAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1j X2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ciKSwgZmFsc2Us IHRydWUpOworICAgICAgICBlbHNlCisgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9m cmluZ2VfYml0bWFwICh3LCBpbnRlcm4gK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hcC1mYWNlJy4gKi8KKyAgICAgIHJvdy0+bGVmdF9mcmlu Z2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBmcmluZ2VfYml0bWFwCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgIHJvdy0+bGVm dF9mcmluZ2VfZmFjZV9pZCA9IGZhY2VfaWQ7CisgICAgICByb3ctPmxlZnRfZnJpbmdlX29mZnNl dCA9IDA7CisgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IGZhbHNlOworICAg ICAgbWNfZHJhd19mcmluZ2VfYml0bWFwICh3LCByb3csIHRydWUsIGN1cnNvcl90eXBlKTsKKyAg ICB9CisgICAgZWxzZSBpZiAoIXJlbW92ZV9wCisgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9y ID09IE1DX09WRVJMQVlfQVJST1dfQklUTUFQCisgICAgICAgICAgICAgJiYgKGhzY2xfYWxsX3Rl bXBfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzBfcAorICAgICAgICAgICAg ICAgICB8fCBoc2NsX2FsbF9wZXJtXzFfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9w ZXJtXzJfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX3RlbXBfcAorICAgICAgICAgICAgICAg ICB8fCBoc2NsX3Blcm1fcCkpCisgICAgICB7CisgICAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5 X2Fycm93X2ZhY2VfaWQgPQorICAgICAgICAgICghYWN0aXZlX3AKKyAgICAgICAgICAgJiYgIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVfd2luZG93cykpKQor ICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1h cnJvdy1oc2NsLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAgICAgOiAoYWN0 aXZlX3ApCisgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIr LW92ZXJsYXktYXJyb3ctaHNjbC1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgIDogREVG QVVMVF9GQUNFX0lEOworICAgICAgICBmYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRf RlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lk CisgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgaWYgKGhzY2xf YWxsX3Blcm1fMF9wKQorICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2Jp dG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAg ICBlbHNlIGlmIChoc2NsX2FsbF9wZXJtXzFfcCkKKyAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAg PSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1ZSwg ZmFsc2UpOworICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8yX3ApCisgICAgICAg ICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgi Ky1oc2NsLXBlcm0iKSwgZmFsc2UsIHRydWUpOworICAgICAgICAgICAgICBlbHNlIGlmIChoc2Ns X3Blcm1fcCkKKyAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9i aXRtYXAgKH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Yml0bWFwXzEnIGlzIHNvbWV3 aGF0IGNvbmZ1c2luZyBhbmQgcmVxdWlyZWQgc3RkZXJyIG1lc3NhZ2VzCisgICAgICAgIHRvIHNl ZSB0aGF0IGByb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwYCBzYXRpc2ZpZXMgdGhlIGZpcnN0IGNv bmRpdGlvbgorICAgICAgICBvZiAod2hpY2ggIT0gTk9fRlJJTkdFX0JJVE1BUCkuICBBdCB0aGlz IHRpbWUsIEBsYXdsaXN0IHByZWZlcnMgbm90IHRvCisgICAgICAgIHJlbHkgdXBvbiBhIExpc3Ag c2V0dGluZyB1c2luZyBgc2V0LWZyaW5nZS1iaXRtYXAtZmFjZScuICovCisgICAgICAgIHJvdy0+ bGVmdF9mcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1B UCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZnJpbmdlX2Jp dG1hcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19G UklOR0VfQklUTUFQOworICAgICAgICByb3ctPmxlZnRfZnJpbmdlX2ZhY2VfaWQgPSBmYWNlX2lk OworICAgICAgICByb3ctPmxlZnRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICAgIHJvdy0+ZnJp bmdlX2JpdG1hcF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgIG1jX2RyYXdfZnJpbmdlX2Jp dG1hcCAodywgcm93LCB0cnVlLCBjdXJzb3JfdHlwZSk7CisgICAgICB9CisgICAgICBlbHNlIGlm ICghcmVtb3ZlX3AKKyAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9X X1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAg ICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUKKyAgICAgICAg ICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9X CisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJ Q0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9 PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0g TUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxh dm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gpKQorICAgICAgICB7CisgICAgICAgICAg TGlzcF9PYmplY3QgYml0bWFwX2ZsYXZvciA9IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JF Q1RBTkdMRV9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBRbWNfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9X X1JFQ1RBTkdMRV9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IFFtY19yZXZlcnNlZF9ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19I T0xMT1dfUkVDVEFOR0xFKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gUW1jX2hvbGxvd19yZWN0YW5nbGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJf cmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5 cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19yZXZlcnNlZF92ZXJ0aWNh bF9iYXJfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJ Q0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19y ZXZlcnNlZF92ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX2JhY2tz bGFzaAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFFuaWw7CisgICAg ICAgICAgZnJpbmdlX2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklU TUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9mcmluZ2VfYml0bWFwIChi aXRtYXBfZmxhdm9yKQorICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9C SVRNQVA7CisgICAgICAgICAgZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklO R0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX1JF VkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAg ICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FS Uk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVS U0VEX1ZFUlRJQ0FMX0JBUikpCisgICAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRf ZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1iYXItcHJlLXp2LWZhY2UiKSwgdHJ1ZSkK KyAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJ VE1BUAorICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJT RURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAm JiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisg ICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJU SUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywg ZiwgaW50ZXJuICgiKy1iYXItcHJlLXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICAg ICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgcm93LT5jdXJzb3JfaW5fZnJpbmdlX3Ag PSBmYWxzZTsKKyAgICAgICAgICByb3ctPnJpZ2h0X2ZyaW5nZV9iaXRtYXAgPSBmcmluZ2VfYml0 bWFwOworICAgICAgICAgIHJvdy0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQgPSBmYWNlX2lkOworICAg ICAgICAgIHJvdy0+cmlnaHRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICAgICAgcm93LT5mcmlu Z2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxzZTsKKyAgICAgICAgICBtY19kcmF3X2ZyaW5nZV9i aXRtYXAgKHcsIHJvdywgZmFsc2UsIGN1cnNvcl90eXBlKTsKKyAgICAgICAgfQorICAgICAgICBl bHNlIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEgKKyAgICAgICAgICAgICAgICAgfHwgZ2x5 cGhfZmxhdm9yID09IE1DX0dMWVBITEVTUykKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29s IG9uX3AgPSB0cnVlOworICAgICAgICAgICAgRlJBTUVfUklGIChmKS0+bWNfc2NyaWJlX2N1cnNv ciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIHdkLCBoLCBsc2wsIGN1cnNvcl90eXBl LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dp ZHRoLCBnbHlwaF9mbGF2b3IsIG9uX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBhY3RpdmVfcCk7CisgICAgICAgICAgfQorfQorCisvKiBEdW1wIGNvbnRl bnRzIG9mIGdseXBoIEdMWVBIIHRvIHN0ZGVyci4gIFJPVyBhbmQgQVJFQSBhcmUKKyAgIHRoZSBn bHlwaCByb3cgYW5kIGFyZWEgd2hlcmUgdGhlIGdseXBoIGNvbWVzIGZyb20uICovCit2b2lkCitt Y19kdW1wX2dseXBoIChzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIHN0cnVjdCBnbHlwaCAqZ2x5cGgs IGludCBhcmVhLAorICAgICAgICAgICAgICAgaW50IHJlbGF0aXZlX3gsIGludCB2cG9zKQorewor ICBpZiAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgfHwgZ2x5cGgtPnR5cGUgPT0g R0xZUEhMRVNTX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAg IiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4x ZCAlNWQgJTRkICAlM2QgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ct PnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgKGdseXBoLT50 eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgID8gJ0MnCisgICAgICAgICA6ICdHJyksCisgICAg ICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAg ICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAg ICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5w aXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPnUuY2gsCisgICAgICAgIGdseXBoLT5mYWNlX2lk LAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRf Ym94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgdnBv cywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgbWNfY2hhcl90b19zdHJpbmcg KGdseXBoLT51LmNoKSk7CisgICAgfQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBTVFJFVENI X0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJk LyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAlNWQgJTRk ICAlM2QgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJl YV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1MnLAorICAgICAgICBnbHlw aC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAg ICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAg ICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisg ICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRf Ym94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGds eXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIHZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6 ICItLSIsCisgICAgICAgICJcXFMiKTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09 IElNQUdFX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAl NSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAl NWQgJTRkICAlM2QgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVz ZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ0knLAorICAgICAg ICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lk dGgsCisgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmltZ19pZCwKKyAgICAgICAgZ2x5 cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGds eXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBo LT5ocG9zLCB2cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicpOwor ICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICAgIHsK KyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5 InBEImQgJWMgJTNkIDB4JTA2eCIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9B UkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2Fy ZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICcrJywKKyAgICAgICAgZ2x5 cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAg ICAgPyAnQicKKyAgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAg ICAgPyAnUycKKyAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAg PyAnMCcKKyAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAor ICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5jbXAuaWQpOworICAgICAgZnByaW50ZiAo c3RkZXJyLCAiICU0ZCAlMS4xZCUxLjFkIiwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAg ICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGlu ZV9wKTsKKyAgICAgIGlmIChnbHlwaC0+dS5jbXAuYXV0b21hdGljKQorICAgICAgICBmcHJpbnRm IChzdGRlcnIsICIgJTVkICU0ZCAgJTNkICAlM2QgJXMgLiBbJWQtJWRdXG4iLAorICAgICAgICAg ICAgICAgICAgICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIHZwb3MsIGds eXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgt PnNsaWNlLmNtcC5mcm9tLCBnbHlwaC0+c2xpY2UuY21wLnRvKTsKKyAgICAgICAgZWxzZQorICAg ICAgICBmcHJpbnRmIChzdGRlcnIsICJcbiIpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5 cGUgPT0gWFdJREdFVF9HTFlQSCkKKyAgICB7CisjaWZuZGVmIEhBVkVfWFdJREdFVFMKKyAgICAg IGVhc3N1bWUgKGZhbHNlKTsKKyNlbHNlCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAg ICIgICU1ZC8lLTVkICU1ZCAlNGMgJTZkICVjICUzZCAweCUwNXggJTRkICUxLjFkJTEuMWQgJTVk ICU0ZCAgJTNkICAlM2QgJXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVY VF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2Vk W2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdYJywKKyAgICAgICAg Z2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAg ICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAg ICAgID8gJ1MnCisgICAgICAgICA6ICctJykpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgs CisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9w LAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnUueHdp ZGdldCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgdnBvcywgZ2x5 cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgJy4nKTsKKyNlbmRpZgorICAgIH0KK30K KworLyogRHVtcCB0aGUgY29udGVudHMgb2YgZ2x5cGggcm93IGF0IFZQT1MgaW4gTUFUUklYIHRv IHN0ZGVyci4KKyAgIEdMWVBIUyAwIG1lYW5zIGRvbid0IHNob3cgZ2x5cGggY29udGVudHMuCisg ICBHTFlQSFMgMSBtZWFucyBzaG93IGdseXBocyBpbiBzaG9ydCBmb3JtCisgICBHTFlQSFMgPiAx IG1lYW5zIHNob3cgZ2x5cGhzIGluIGxvbmcgZm9ybS4gKi8KK3ZvaWQKK21jX2R1bXBfZ2x5cGhf cm93IChzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB2cG9zLCBpbnQgZ2x5cGhzKQoreworICBp bnQgcmVsYXRpdmVfeCA9IDA7CisgIGlmIChnbHlwaHMgIT0gMSkKKyAgICB7CisgICAgICBmcHJp bnRmIChzdGRlcnIsICJcbkRVTVAgR0xZUEggUk9XXG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVy ciwgIlJvdyAgICAgU3RhcnQgICAgICAgRW5kIFVzZWQgb0U+PFxcQ1RaRmVzbSAgICAgWCAgICBZ ICAgIFcgICAgSCAgICBWICAgIEEgICAgUFxuIik7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICI9 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT1cbiIpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiJTNkICU5 InBEImQgJTkicEQiZCAlNGQgJTEuMWQlMS4xZCUxLjFkJTEuMWRcCislMS4xZCUxLjFkJTEuMWQl MS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkICAlNGQgJTRkICU0ZCAlNGQgJTRkICU0ZCAlNGRcbiIs CisgICAgICAgICB2cG9zLAorICAgICAgICAgTUFUUklYX1JPV19TVEFSVF9DSEFSUE9TIChyb3cp LAorICAgICAgICAgTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSwKKyAgICAgICAgIHJvdy0+ dXNlZFtURVhUX0FSRUFdLAorICAgICAgICAgcm93LT5jb250YWluc19vdmVybGFwcGluZ19nbHlw aHNfcCwKKyAgICAgICAgIHJvdy0+ZW5hYmxlZF9wLAorICAgICAgICAgcm93LT50cnVuY2F0ZWRf b25fbGVmdF9wLAorICAgICAgICAgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCwKKyAgICAgICAg IHJvdy0+Y29udGludWVkX3AsCisgICAgICAgICBNQVRSSVhfUk9XX0NPTlRJTlVBVElPTl9MSU5F X1AgKHJvdyksCisgICAgICAgICBNQVRSSVhfUk9XX0RJU1BMQVlTX1RFWFRfUCAocm93KSwKKyAg ICAgICAgIHJvdy0+ZW5kc19hdF96dl9wLAorICAgICAgICAgcm93LT5maWxsX2xpbmVfcCwKKyAg ICAgICAgIHJvdy0+ZW5kc19pbl9taWRkbGVfb2ZfY2hhcl9wLAorICAgICAgICAgcm93LT5zdGFy dHNfaW5fbWlkZGxlX29mX2NoYXJfcCwKKyAgICAgICAgIHJvdy0+bW91c2VfZmFjZV9wLAorICAg ICAgICAgcm93LT54LAorICAgICAgICAgcm93LT55LAorICAgICAgICAgcm93LT5waXhlbF93aWR0 aCwKKyAgICAgICAgIHJvdy0+aGVpZ2h0LAorICAgICAgICAgcm93LT52aXNpYmxlX2hlaWdodCwK KyAgICAgICAgIHJvdy0+YXNjZW50LAorICAgICAgICAgcm93LT5waHlzX2FzY2VudCk7CisgICAg ICAvKiBUaGUgbmV4dCAzIGxpbmVzIHNob3VsZCBhbGlnbiB0byAiU3RhcnQiIGluIHRoZSBoZWFk ZXIuICovCisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTkicEQiZCAlOSJwRCJkXHQlNWRc biIsIHJvdy0+c3RhcnQub3ZlcmxheV9zdHJpbmdfaW5kZXgsCisgICAgICAgICByb3ctPmVuZC5v dmVybGF5X3N0cmluZ19pbmRleCwKKyAgICAgICAgIHJvdy0+Y29udGludWF0aW9uX2xpbmVzX3dp ZHRoKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgICAlOSJwRCJkICU5InBEImRcbiIsCisg ICAgICAgICBDSEFSUE9TIChyb3ctPnN0YXJ0LnN0cmluZ19wb3MpLAorICAgICAgICAgQ0hBUlBP UyAocm93LT5lbmQuc3RyaW5nX3BvcykpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAgICU5 ZCAlOWRcbiIsIHJvdy0+c3RhcnQuZHB2ZWNfaW5kZXgsCisgICAgICAgICByb3ctPmVuZC5kcHZl Y19pbmRleCk7CisgICAgfQorICBpZiAoZ2x5cGhzID4gMSkKKyAgICB7CisgICAgICBmb3IgKGlu dCBhcmVhID0gTEVGVF9NQVJHSU5fQVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICB7 CisgICAgc3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdOworICAgIHN0cnVj dCBnbHlwaCAqZ2x5cGhfZW5kID0gZ2x5cGggKyByb3ctPnVzZWRbYXJlYV07CisgICAgLyogR2x5 cGggZm9yIGEgbGluZSBlbmQgaW4gdGV4dC4gKi8KKyAgICBpZiAoYXJlYSA9PSBURVhUX0FSRUEg JiYgZ2x5cGggPT0gZ2x5cGhfZW5kICYmIGdseXBoLT5jaGFycG9zID4gMCkKKyAgICAgICsrZ2x5 cGhfZW5kOworICAgIGlmIChnbHlwaCA8IGdseXBoX2VuZCkKKyAgICAgIGZwcmludGYgKHN0ZGVy ciwgIkdseXBoIy9Ub3RhbCBSZWwuWCBUICAgICAgIFBvcyBPICAgVyAgICAgQ29kZSBGYWNlIExS ICAgICBYICAgIFkgSFBPUyBWUE9TIFpWIENcbiIpOworICAgIGZvciAoOyBnbHlwaCA8IGdseXBo X2VuZDsgKytnbHlwaCkKKyAgICAgIHsKKyAgICAgICAgbWNfZHVtcF9nbHlwaCAocm93LCBnbHlw aCwgYXJlYSwgcmVsYXRpdmVfeCwgdnBvcyk7CisgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgt PnBpeGVsX3dpZHRoOworICAgICAgfQorICB9CisgICAgfQorICBlbHNlIGlmIChnbHlwaHMgPT0g MSkKKyAgICB7CisgICAgICBjaGFyIHNbU0hSVF9NQVggKyA0XTsKKyAgICAgIGZvciAoaW50IGFy ZWEgPSBMRUZUX01BUkdJTl9BUkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2FyZWEpCisgIHsKKyAg ICBpbnQgaTsKKyAgICBmb3IgKGkgPSAwOyBpIDwgcm93LT51c2VkW2FyZWFdOyArK2kpCisgICAg ICB7CisgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBoc1thcmVhXSArIGk7 CisgICAgICAgIGlmIChpID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICYmIGFyZWEgPT0g VEVYVF9BUkVBCisgICAgICAmJiBOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgJiYgZ2x5cGgt PnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgJiYgZ2x5cGgtPnUuY2ggPT0gJyAnKQorICAgIHsK KyAgICAgIHN0cmNweSAoJnNbaV0sICJbXFxuXSIpOworICAgICAgaSArPSA0OworICAgIH0KKyAg ICAgICAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgICAmJiBn bHlwaC0+dS5jaCA8IDB4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b2wgdmlzaWJsZV9wID0gcG9z X3Zpc2libGVfcCAodywgUFQsICZkMSwgJmQyLCAmZDMsICZkNCwgJmQ1LCAmeXBvcyk7CisgICAg ICBpbnQgaGVhZGVyX2xpbmVfaGVpZ2h0ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7 CisgICAgICBpbnQgdm9mZnNldCA9IChoZWFkZXJfbGluZV9oZWlnaHQgPiAwCisgICAgICAgICAg ICAgICAgICAgICAmJiB5cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgICAgICA/IHlwb3MgKyAx CisgICAgICAgICAgICAgICAgICAgICAgOiB5cG9zOworICAgICAgaWYgKHZpc2libGVfcCkKKyAg ICAgICAgdnBvcyA9IHZvZmZzZXQ7CisgICAgICAgIGVsc2UKKyAgICAgICAgICB2cG9zID0gMDsK KyAgICB9CisgICAgZWxzZQorICAgICAgeworICAgICAgICBDSEVDS19OVU1CRVIgKHJvdyk7Cisg ICAgICAgIHZwb3MgPSBYRklYTlVNIChyb3cpOworICAgICAgfQorICBpZiAodnBvcyA+PSAwICYm IHZwb3MgPCBtYXRyaXgtPm5yb3dzKQorICAgIG1jX2R1bXBfZ2x5cGhfcm93IChNQVRSSVhfUk9X IChtYXRyaXgsIHZwb3MpLAorICAgICAgICB2cG9zLAorICAgICAgICBUWVBFX1JBTkdFRF9GSVhO VU1QIChpbnQsIGdseXBocykgPyBYRklYTlVNIChnbHlwaHMpIDogMik7CisgIHJldHVybiBRbmls OworfQorCit2b2lkCittY19kdW1wX2dseXBoX21hdHJpeCAoc3RydWN0IGdseXBoX21hdHJpeCAq bWF0cml4LCBpbnQgZ2x5cGhzKQoreworICBpbnQgaTsKKyAgZm9yIChpID0gMDsgaSA8IG1hdHJp eC0+bnJvd3M7ICsraSkKKyAgICBtY19kdW1wX2dseXBoX3JvdyAoTUFUUklYX1JPVyAobWF0cml4 LCBpKSwgaSwgZ2x5cGhzKTsKK30KKworREVGVU4gKCJtYy1kdW1wLWdseXBoL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29yLnksIHct PmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcyk7CisgIGZwcmludGYgKHN0ZGVyciwgIj09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuIik7CisgIG1jX2R1bXBf Z2x5cGhfbWF0cml4ICh3LT5jdXJyZW50X21hdHJpeCwKKyAgICAgICAgIFRZUEVfUkFOR0VEX0ZJ WE5VTVAgKGludCwgZ2x5cGhzKSA/IFhGSVhOVU0gKGdseXBocykgOiAwKTsKKyAgcmV0dXJuIFFu aWw7Cit9CisKK3ZvaWQKK21jX3Jlc2V0X2NhY2hlIChzdHJ1Y3Qgd2luZG93ICp3KQoreworICBp ZiAoIUJVRkZFUlAgKHctPmNvbnRlbnRzKSkKKyAgICByZXR1cm47CisgIGZvciAoZW51bSBtY19j YWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICBjYWNoZV90eXBlIDwgTk9f Q0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGJvb2wgYnZhcl9hY3Rp dmVfcDsKKyAgICAgIHN3aXRjaCAoY2FjaGVfdHlwZSkKKyAgICAgICAgeworICAgICAgICAgIGNh c2UgTk9fQ0FDSEU6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHJldHVybjsKKyAgICAg ICAgICAgIH0KKyAgICAgICAgICBjYXNlIE1DX0NBQ0hFOgorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAmJiBO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkKKyAgICAgICAgICAg ICAgICBidmFyX2FjdGl2ZV9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoQlVG RkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICAgICAgICAgICAg YnZhcl9hY3RpdmVfcCA9IHRydWU7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAg fQorICAgICAgICAgIGNhc2UgQ0hfQ0FDSEU6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICYmIE5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgICAgICAgICAg IGJ2YXJfYWN0aXZlX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChCVUZGRVJQ ICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICAgICAgICAgICAgICBi dmFyX2FjdGl2ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9 CisgICAgICAgICAgY2FzZSBGQ19DQUNIRToKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg aWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgJiYgTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgICAgICAgICAgICAg YnZhcl9hY3RpdmVfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKEJVRkZFUlAg KHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkKKyAgICAgICAgICAgICAgICAgIGJ2 YXJfYWN0aXZlX3AgPSB0cnVlOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0K KyAgICAgICAgfQorICAgICAgaWYgKCFidmFyX2FjdGl2ZV9wKQorICAgICAgICB7CisgICAgICAg ICAgLyogRGVjcmVhc2UgdGhlIHNpemUgb2YgdGhlIGFycmF5IHRvIGEgYmFyZSBtaW5pbXVtLiAq LworICAgICAgICAgIGZvciAoaW50IHZudGggPSAwOyB2bnRoIDwgdy0+bWNfbWF0cml4LnZwb3Nf dXNlZDsgKyt2bnRoKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAody0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdID4gMSkKKyAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXSA9CisgICAgICAgICAgICAgICAgICAgIHhucmVhbGxvYyAody0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV0sIDEsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgc2l6ZW9mICp3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXSk7CisgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9h bGxvY2F0ZWRbY2FjaGVfdHlwZV0gPSAxOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg ICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSA9IDA7Cisg ICAgICAgICAgICB9CisgICAgICAgICAgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90 eXBlXSA9IDA7CisgICAgICAgIH0KKyAgICAgICAgLy8gIEFsdGhvdWdoIGl0IHdvdWxkIG5vdCBi ZSB2ZXJ5IGVmZmljaWVudCwgaXQgaXMgc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5cGVdID0g MDsKKyAgICAgICAgICB9CisgICAgfQorLyoKKyAgZm9yIChpbnQgdm50aCA9IDA7CisgICAgICAg dm50aCA8IHctPm1jX21hdHJpeC52cG9zX3VzZWQ7CisgICAgICAgKyt2bnRoKQorICAgIGZvciAo ZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICAgIGNhY2hl X3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICAgIGZwcmludGYg KHN0ZGVyciwgIm1jX3Jlc2V0X2NhY2hlICglZCk6ICAlc1xuXAorICB3LT5tY19tYXRyaXgudnBv c191c2VkICglZClcblwKKyAgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFslc10gKCVkKVxuXAor ICB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkWyVzXSAoJWQpXG5cCisgIHctPm1jX21hdHJpeC5j dXJzb3JzX3VzZWRbJXNdICglZClcblwKKyAgdy0+bWNfbWF0cml4LnZwb3NbJWRdLmNhY2hlX3Vz ZWRbJXNdICglZClcblwKKyAgdy0+bWNfbWF0cml4LnZwb3NbJWRdLmNhY2hlX3VzZWRbJXNdICgl ZClcblwKKyAgdy0+bWNfbWF0cml4LnZwb3NbJWRdLmNhY2hlX3VzZWRbJXNdICglZClcbiIsCisg ICAgdm50aCwgbWNfY2FjaGVfdHlwZV90b19zdHJpbmcgKGNhY2hlX3R5cGUpLAorICAgIHctPm1j X21hdHJpeC52cG9zX3VzZWQsCisgICAgbWNfY2FjaGVfdHlwZV90b19zdHJpbmcgKGNhY2hlX3R5 cGUpLCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdLAorICAgIG1jX2NhY2hl X3R5cGVfdG9fc3RyaW5nIChjYWNoZV90eXBlKSwgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtj YWNoZV90eXBlXSwKKyAgICBtY19jYWNoZV90eXBlX3Rv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lZ3JvdW5kLnJlZCwgZm9yZWdyb3VuZC5ncmVlbiwKKyAg ICAgIGZvcmVncm91bmQuYmx1ZSwgYmFja2dyb3VuZC5yZWQsIGJhY2tncm91bmQuZ3JlZW4sIGJh Y2tncm91bmQuYmx1ZSk7CisgICAgfQorICBib29sIHJlbW92ZV9wID0gZmFsc2U7CisgIGlmIChk cmF3X3AKKyAgICAgICYmIChmcm9tX3doZXJlID09IFNLSVBQRUQKKyAgICAgICAgICB8fCBmcm9t X3doZXJlID09IFBPU1RfQ0hBTkdFRAorICAgICAgICAgIHx8IGZyb21fd2hlcmUgPT0gVU5DSEFO R0VECisgICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBTRVRfQ1VSU09SX1RXTykpCisgICAgewor ICAgICAgYm9vbCBzYW1lX3AgPSBmYWxzZTsKKyAgICAgIGZvciAoaW50IG50aCA9IDA7IG50aCA8 IHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdOyArK250aCkKKyAg ICAgICAgeworICAgICAgICAgIHNhbWVfcCB8PQorICAgICAgICAgICAgKHctPm1jX21hdHJpeC52 cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLnNhbWVfcCA9PSB0cnVlCisgICAgICAgICAg ICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGgu dHlwZSA9PSBnbHlwaC0+dHlwZQorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3Ju XS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLmJ5dGVwb3MgPT0gZ2x5cGgtPmJ5dGVwb3MK KyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1tybl0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXS5nbHlwaC5jaGFycG9zID09IGdseXBoLT5jaGFycG9zCisgICAgICAgICAgICAgJiYgdy0+ bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGgudS52YWwgPT0g Z2x5cGgtPnUudmFsCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hl W2NhY2hlX3R5cGVdW250aF0uZ2x5cGguZmFjZV9pZCA9PSBnbHlwaC0+ZmFjZV9pZAorICAgICAg ICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmds eXBoLnBhZGRpbmdfcCA9PSBnbHlwaC0+cGFkZGluZ19wCisgICAgICAgICAgICAgJiYgdy0+bWNf bWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGgubGVmdF9ib3hfbGlu ZV9wID09IGdseXBoLT5sZWZ0X2JveF9saW5lX3AKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRy aXgudnBvc1tybl0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5nbHlwaC5yaWdodF9ib3hfbGluZV9w ID09IGdseXBoLT5yaWdodF9ib3hfbGluZV9wCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4 LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGgudm9mZnNldCA9PSBnbHlwaC0+ dm9mZnNldAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhdLmdseXBoLnBpeGVsX3dpZHRoID09IGdseXBoLT5waXhlbF93aWR0aAorICAg ICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmdseXBoLnNsaWNlLmltZy54ID09IGdseXBoLT5zbGljZS5pbWcueAorICAgICAgICAgICAgICYm IHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnNsaWNl LmltZy55ID09IGdseXBoLT5zbGljZS5pbWcueQorICAgICAgICAgICAgICYmIHctPm1jX21hdHJp eC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnNsaWNlLmltZy53aWR0aCA9 PSBnbHlwaC0+c2xpY2UuaW1nLndpZHRoCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZw b3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGguc2xpY2UuaW1nLmhlaWdodCA9PSBn bHlwaC0+c2xpY2UuaW1nLmhlaWdodAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9z W3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnNsaWNlLmNtcC5mcm9tID09IGdseXBo LT5zbGljZS5jbXAuZnJvbQorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLnggPT0geAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJp eC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZ4ID09IGZ4CisgICAgICAgICAgICAg JiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueSA9PSB5Cisg ICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uZnkgPT0gZnkKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1tybl0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXS5ocG9zID09IGhwb3MKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRy aXgudnBvc1tybl0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS52cG9zID09IHZwb3MKKyAgICAgICAg ICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1tybl0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS53ZCA9 PSB3ZAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhdLmggPT0gaAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl90eXBlID09IGN1cnNvcl90eXBlCisgICAgICAg ICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vy c29yX3dpZHRoID09IGN1cnNvcl93aWR0aAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52 cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZvcmVncm91bmQucmVkID09IGZvcmVncm91 bmQucmVkCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hl X3R5cGVdW250aF0uZm9yZWdyb3VuZC5ncmVlbiA9PSBmb3JlZ3JvdW5kLmdyZWVuCisgICAgICAg ICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZm9y ZWdyb3VuZC5ibHVlID09IGZvcmVncm91bmQuYmx1ZQorICAgICAgICAgICAgICYmIHctPm1jX21h dHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJhY2tncm91bmQucmVkID09IGJh Y2tncm91bmQucmVkCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hl W2NhY2hlX3R5cGVdW250aF0uYmFja2dyb3VuZC5ncmVlbiA9PSBiYWNrZ3JvdW5kLmdyZWVuCisg ICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uYmFja2dyb3VuZC5ibHVlID09IGJhY2tncm91bmQuYmx1ZQorICAgICAgICAgICAgICYmIHct Pm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmFjdGl2ZV9wID09IGFj dGl2ZV9wCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hl X3R5cGVdW250aF0uZ2x5cGhfZmxhdm9yID09IGdseXBoX2ZsYXZvcgorICAgICAgICAgICAgICYm IHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmVuYWJsZWRfcCA9 PSB0cnVlKTsKKyAgICAgICAgfQorICAgICAgaWYgKCFzYW1lX3ApCisgICAgICAgIG1jX2RyYXdf ZXJhc2VfaHlicmlkICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3 ZCwgaCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jf d2lkdGgsIGZvcmVncm91bmQsIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAg ICAgIHJldHVybjsKKyAgICB9CisgICAgZWxzZSBpZiAoZHJhd19wCisgICAgICAgICAgICAgJiYg KGZyb21fd2hlcmUgPT0gU0NSSUJFX09ORQorICAgICAgICAgICAgICAgICB8fCBmcm9tX3doZXJl ID09IFNDUklCRV9UV08KKyAgICAgICAgICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBTQ1JJQkVf VEhSRUUKKyAgICAgICAgICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBOT1dIRVJFKSkKKyAgICB7 CisgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBm eSwgaHBvcywgdnBvcywgd2QsIGgsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwg cmVtb3ZlX3ApOworICAgICAgcmV0dXJuOworICAgIH0KKyAgaWYgKGNhY2hlX3R5cGUgPT0gTk9f Q0FDSEUpCisgICAgcmV0dXJuOworICArK3ctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVf dHlwZV07CisgIGlmICh3LT5tY19tYXRyaXgudnBvc191c2VkIDwgbWF0cml4LT5ucm93cykKKyAg ICB3LT5tY19tYXRyaXgudnBvc191c2VkID0gbWF0cml4LT5ucm93czsKKyAgaWYgKHctPm1jX21h dHJpeC52cG9zX2FsbG9jYXRlZCA8IHctPm1jX21hdHJpeC52cG9zX3VzZWQpCisgICAgeworICAg ICAgaW50IG9sZF9hbGxvYyA9IHctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZDsKKyAgICAgIGlu dCBuZXdfZWx0cyA9IHctPm1jX21hdHJpeC52cG9zX3VzZWQgLSB3LT5tY19tYXRyaXgudnBvc19h bGxvY2F0ZWQ7CisgICAgICB3LT5tY19tYXRyaXgudnBvcyA9IHhwYWxsb2MgKHctPm1jX21hdHJp eC52cG9zLCAmdy0+bWNfbWF0cml4LnZwb3NfYWxsb2NhdGVkLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBuZXdfZWx0cywgSU5UX01BWCwgc2l6ZW9mICp3LT5tY19tYXRyaXgu dnBvcyk7CisgICAgICBtZW1zZXQgKHctPm1jX21hdHJpeC52cG9zICsgb2xkX2FsbG9jLCAwLAor ICAgICAgICAgICAgICAgKHctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZCAtIG9sZF9hbGxvYykg KiBzaXplb2YgKnctPm1jX21hdHJpeC52cG9zKTsKKyAgICB9CisgICsrdy0+bWNfbWF0cml4LnZw b3Nbcm5dLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV07CisgIGlmICh3LT5tY19tYXRyaXgudnBvc1ty bl0uY2FjaG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XJlIFJPVy0+VklTSUJM RV9IRUlHSFQuCisgICAgICAgRklYTUU6ICBBZGQgY29uZGl0aW9ucyBmb3IgdXNlci1zcGVjaWZp ZWQgdGhpY2tuZXNzIG9mIE1DX0JBUiBhbmQKKyAgICAgICAgICAgICAgIE1DX0hCQVIgYXMgdG8g YG1jLXJlYWwtZmFrZS1jdXJzb3InLgorICAgTVVMVElQTEVfQ1VSU09SUzogIFdlIGRvIG5vdCB1 c2UgdGhpcyBmdW5jdGlvbi4KKyAgIEhPUklaT05UQUxfUlVMRVI6ICBXZSB3YW50IGEgdW5pdmVy c2FsIEZZIGNvb3JkaW5hdGUgZm9yIGEgbGV2ZWwgcnVsZXIuCisgICBWRVJUSUNBTF9SVUxFUiBh bmQgRklMTF9DT0xVTU46ICBXZSB3YW50IGFuIEggdGhhdCBlbnN1cmVzIG5vIGdhcCBiZXR3ZWVu IHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJldmlvdXMvbmV4dCBs aW5lLiAgVGhlIEZYIGNvb3JkaW5hdGUgaXMgc2V0CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBlbHNld2hlcmU6ICBgdy0+Y3Vyc29yLnhgIC8gYG1jLmZjX3hgLiAqLwordm9p ZAorbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBo X21hdHJpeCAqbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3Jv dyAqcm93LCBpbnQgeCwgaW50ICpmeCwgaW50IHksCisgICAgICAgICAgICAgICAgICAgICAgICBp bnQgKmZ5LCBpbnQgaHBvcywgaW50IHZwb3MsIGludCAqaCwKKyAgICAgICAgICAgICAgICAgICAg ICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUsIGludCBjdXJzb3Jfd2lkdGgsCisg ICAgICAgICAgICAgICAgICAgICAgICBpbnQgK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gIH0KKyAgKmZ5ID0gV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIHkpOworICBzd2l0Y2gg KGN1cnNvcl90eXBlKQorICAgIHsKKyAgICAgIGNhc2UgTUNfQkFSOgorICAgICAgICB7CisgICAg ICAgICAgaWYgKGN1cnNvcl93aWR0aCA8IDEpCisgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSBt YXggKEZSQU1FX0NVUlNPUl9XSURUSCAoZiksIDEpOworICAgICAgICAgIGlmIChjdXJzb3Jfd2lk dGggPCBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgKndkID0gY3Vyc29yX3dpZHRoOwor ICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAg IHsKKyAgICAgICAgICBpbnQgY3Vyc29yX2hlaWdodCA9IChjdXJzb3Jfd2lkdGggPCAxKSA/IGxy aW50ICgwLjI1ICogKmgpIDogY3Vyc29yX3dpZHRoOworICAgICAgICAgIGlmIChjdXJzb3JfaGVp Z2h0ID4gcm93LT5oZWlnaHQpCisgICAgICAgICAgICBjdXJzb3JfaGVpZ2h0ID0gcm93LT5oZWln aHQ7CisgICAgICAgICAgLyogQ3Vyc29yIHNtYWxsZXIgdGhhbiBsaW5lIGhlaWdodCwgc28gbW92 ZSBkb3duLiAqLworICAgICAgICAgIGlmICgqaCA+IGN1cnNvcl9oZWlnaHQpCisgICAgICAgICAg ICAqZnkgKz0gKmggLSBjdXJzb3JfaGVpZ2h0OworICAgICAgICAgICpoID0gY3Vyc29yX2hlaWdo dDsKKyAgICAgICAgICAqd2QgPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgYnJlYWs7 CisgICAgICAgIH0KKyAgICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgIGNh c2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAgICAgY2FzZSBNQ19OT19GUklOR0VfQ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XBoICpnbHlwaCwgaW50IGFyZWEsIGludCByZWxhdGl2 ZV94LCBpbnQgeF9saW1pdCwgaW50IHksCisgICAgICAgICAgIGludCBocG9zLCBpbnQgdnBvcywg ZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwgaW50IGN1cnNvcl93aWR0aCwKKyAgICAg ICAgICAgc3RydWN0IGdseXBoX21hdHJpeCAqY3Vyc29yX21hdHJpeCwgaW50IGZjX3gsIHN0cnVj dCBtY19SR0IgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgYm9vbCBhY3RpdmVfcCwgZW51bSBtY19h Y3Rpb25fdHlwZSBhY3Rpb25fdHlwZSwgYm9vbCBkcmF3X3AsCisgICAgICAgICAgIGVudW0gbWNf ZnJvbV93aGVyZSBmcm9tX3doZXJlLCBlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSkKK3sK KyAgaW50IG9wb2ludF94ID0gdy0+Y3Vyc29yLng7CisgIGludCBvcG9pbnRfeSA9IHctPmN1cnNv ci55OworICBpbnQgb3BvaW50X2hwb3MgPSB3LT5jdXJzb3IuaHBvczsKKyAgaW50IG9wb2ludF92 cG9zID0gdy0+Y3Vyc29yLnZwb3M7CisgIGludCBmeCwgZnksIGgsIHdkOworICBtY19nZXRfY3Vy c29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgcmVsYXRpdmVfeCwgJmZ4LCB5LCAmZnksIGhw b3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICZoLCBjdXJzb3JfdHlwZSwgY3Vy c29yX3dpZHRoLCAmd2QpOworICBpbnQgb3BvaW50X2Z4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVf UElYRUxfWCAodywgb3BvaW50X3gpOworICBpbnQgZmNfZnggPSBXSU5ET1dfVEVYVF9UT19GUkFN RV9QSVhFTF9YICh3LCBmY194KTsKKyAgYm9vbCB6dl9wID0gKGdseXBoIC0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAmJiBNQVRS SVhfUk9XX0VORF9DSEFSUE9TIChyb3cpID09IFpWKTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZS QU1FICh3LT5mcmFtZSk7CisgIExpc3BfT2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRzOworICBDSEVD S19CVUZGRVIgKGJ1Zik7CisgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChidWYpOworICBp bnQgdGV4dF9hcmVhX3dpZHRoID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAg c3RydWN0IGdseXBoX3JvdyAqY3Vyc29yX3JvdyA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPVyAoY3Vyc29yX21hdHJp eCwgdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5V TEw7CisgIHN0cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBoID0gKHctPmN1cnNvci52cG9zICE9IC0x KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfZ2V0X2N1cnNvcl9nbHlwaCAo dywgY3Vyc29yX21hdHJpeCwgY3Vyc29yX3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBv cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIGJvb2wgY3Vyc29y X2F0X2ZyaW5nZV9wID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dp ZHRoX2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9 PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnggPT0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOworICBib29sIGN1cnNvcl9iZXlvbmRf ZnJpbmdlX3AgPSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFd CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhY3Vyc29yX3Jvdy0+ZXhhY3Rf d2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+Y3Vyc29yLnggPj0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7CisgIGlu dCBmcmFtZV9jaGFyX3dpZHRoID0gRlJBTUVfQ09MVU1OX1dJRFRIIChmKTsKKyAgaW50IHRlbXBf ZmFjZV9pZCA9IGdseXBoLT5mYWNlX2lkOworICBzdHJ1Y3QgbWNfUkdCIGJhY2tncm91bmQ7Cisg IG1jX3NldF9sc2xfYmcgKHcsIHRlbXBfZmFjZV9pZCwgJmJhY2tncm91bmQpOworICBib29sIHJl YWxfZmFrZV9jdXJzb3JfcCA9IChvcG9pbnRfeCA9PSByZWxhdGl2ZV94CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIG9wb2ludF9ocG9zID09IGhwb3MKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb3BvaW50X3kgPT0gZ2x5cGgtPnkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBvcyk7CisKKy8qIC0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LSAqLworLyogICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgQ0hBUl9HTFlQSCB8IEdMWVBI TEVTU19HTFlQSCAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K KyAgaWYgKGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgIHx8IGdseXBoLT50eXBlID09 IEdMWVBITEVTU19HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgIGZwcmlu dGYgKHN0ZGVyciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAl M2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVzXG4iLAorICAg ICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2Vk W2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2 ZV94LAorICAgICAgICAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgPyAnQycK KyAgICAgICAgIDogJ0cnKSwKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZG RVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1Ag KGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklMUCAo Z2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6ICct JykpKSwKKyAgICAgICAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+ dS5jaCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9s aW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+ eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9zLCBnbHlwaC0+dnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYi IDogIi0tIiwKKyAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKGdseXBoLT51LmNoKSk7CisgIHN3 aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAg ICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQ SCAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIE1V TFRJUExFX0NVUlNPUlM6CisgICAgeworICAgICAgbWNf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UsIGFjdGlvbl90eXBlKTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJlbGF0aXZl X3ggPD0geF9saW1pdCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChyZWxhdGl2ZV94IDwgcm93 LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCAr PSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgIGZ4ICs9IGdseXBoLT5waXhlbF93 aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93 LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAg ICAgICAgICAgeF9saW1pdCAtIHJlbGF0aXZlX3gsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lk dGgsCisgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLCBhY3RpdmVf cCwgTUNfR0xZUEhMRVNTLCBkcmF3X3AsCisgICAgICAgICAgICAgICAgICAgICBmcm9tX3doZXJl LCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAg IH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICBWRVJUSUNBTF9S VUxFUjogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAgICAgICovCisv KiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAgIHsK KyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJzb3JfYXRfZnJpbmdlX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVlZF9w KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JB Ul9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNv cl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg IXJvdy0+Y29udGludWVkX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJP VworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9m cmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50 cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9B UkVBXSAhPSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93 LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVz ZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBv cG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBN Q19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfR0xZ UEg7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJP VworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJf UklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFS X0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQ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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQ SExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChCVkFS IChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX3ZlcnRpY2FsX3J1bGVy KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF95ID09 IHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF92cG9z ID09IHZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZ UEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOwor ICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJl bGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2Qs IGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisg ICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93aGVy ZSwgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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EuMWQgJTVkICU0ZCAgJTNkICAlM2QgJXMgJXNc biIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChy b3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAg IHJlbGF0aXZlX3gsCisgICAgICAgICdTJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAg ICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDog KFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAg OiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAg ICAgICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAwdSwK KyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3As CisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+eCwgZ2x5 cGgtPnksIGdseXBoLT5ocG9zLCBnbHlwaC0+dnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0t IiwKKyAgICAgICAgIlxcUyIpOworICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VS U09SUzogIFNUUkVUQ0hfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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oLCBm b3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBNQ19H TFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAg ICBpZiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAt IDEKKyAgICAgICAgICAmJiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAg ICAgICBpZiAocmVsYXRpdmVfeCA8IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICByZWxh dGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICB0ZW1wX2ZhY2VfaWQgPSAo cm93LT5maWxsX2xpbmVfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICA/IGdseXBoLT5mYWNl X2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAg ICAgc3RydWN0IG1jX1JHQiBiYWNrZ3JvdW5kOworICAgICAgICAgIG1jX3NldF9sc2xfYmcgKHcs IHRlbXBfZmFjZV9pZCwgJmJhY2tncm91bmQpOworICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0 cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAg ICAgICAgICAgICAgICAgICB4X2xpbWl0IC0gcmVsYXRpdmVfeCwgaCwgY3Vyc29yX3R5cGUsIHhf bGltaXQgLSByZWxhdGl2ZV94LAorICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwgYmFj a2dyb3VuZCwgYWN0aXZlX3AsIE1DX0dMWVBITEVTUywgZHJhd19wLAorICAgICAgICAgICAgICAg ICAgICAgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICA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Z2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9mcmluZ2Vf 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 dW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBhY3RpdmVfcCwgZ2x5cGhfZmxhdm9y LCBkcmF3X3AsIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJy Z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0t LS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJFR0lO OiAgSU1BR0VfR0xZUEggICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLSAqLworICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAg eworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAg IlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUx LjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJv dy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnSScsCisg ICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkK KyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAg ICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBo LT5waXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuaW1nX2lkLAor ICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwK KyA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worICAgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICAgIlxuICU1InBEImQvJS01 ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4IiwKKyAgICAgICAgICBnbHlwaCAtIHJvdy0+ Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAw IDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAg ICAnKycsCisgICAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgICAgKEJVRkZFUlAgKGds eXBoLT5vYmplY3QpCisgICAgICAgICAgID8gJ0InCisgICAgICAgICAgIDogKFNUUklOR1AgKGds eXBoLT5vYmplY3QpCisgICAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICAgIDogKE5JTFAg KGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICAg IDogJy0nKSkpLAorICAgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgICAodW5z aWduZWQgaW50KSBnbHlwaC0+dS5jbXAuaWQpOworICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIg JTRkICUxLjFkJTEuMWQiLAorICAgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICAgIGds eXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3Ap OworICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmludGYgKHN0 ZGVyciwgIiAlNWQgJTRkICAlM2QgICUzZCAlcyAuIFslZC0lZF1cbiIsCisgICAgICAgICAgICAg ICAgICAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3Ms IGdseXBoLT56dl9wID8gIlpWIiA6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VSOiAg Q09NUE9TSVRFX0dMWVBIICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tICovCisgICAgY2FzZSBIT1JJWk9OVEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChyZWxh dGl2ZV94IDw9IHhfbGltaXQKKyAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAg ICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHks IGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwg Y3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICAg IGFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rp b25fdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJv dy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisg ICAgICAgIHsKKyAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAg ICAgICAgICB3aGlsZSAocmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAgICAgICAgeworICAg ICAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwg ZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgIHdkLCBoLCBj dXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAg ICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBNQ19HTFlQSExFU1MsIGRyYXdfcCwgZnJvbV93 aGVyZSwgY2FjaGVfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBhY3Rpb25fdHlwZSk7 CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAg ICAgIH0KKyAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENPTVBP U0lURV9HTFlQSCAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3Ig Z2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29u X3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVS VElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3Jf YXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJv dy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJ Q0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9w KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZF UlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGgg LSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxf d2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhM RVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICh6dl9wKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9m bGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhf Zmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAg IHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAg fHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgIHx8IGdseXBoX2Zs YXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgIGN1cnNvcl90eXBlID0g TUNfUklHSFRfRlJJTkdFX0JJVE1BUDsKKyAgICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAo dywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBvcG9pbnRfZngsIHksIGZ5LCBocG9z LCB2cG9zLAorICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0 aCwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIGds eXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7 CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAg ICAgICAgICAgICAgICAgICAgICBGSUxMX0NPTFVNTjogIENPTVBPU0lURV9HTFlQSCAgICAgICAg ICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBGSUxM X0NPTFVNTjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoZ2x5 cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBmY194ID4gcmVsYXRpdmVfeCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHp2X3ApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgIC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LS0tLS0tLS0tLS0tICovCisKKy8qIC0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJFR0lO OiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0gKi8KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gWFdJREdFVF9HTFlQSCkK KyAgeworI2lmbmRlZiBIQVZFX1hXSURHRVRTCisgICAgZWFzc3VtZSAoZmFsc2UpOworI2Vsc2UK KyAgICBpZiAobWNfc3RkZXJyX3ApCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICJc biAgJTVkLyUtNWQgJTVkICU0YyAlNmQgJWMgJTNkIDB4JTA1eCAlNGQgJTEuMWQlMS4xZCAlNWQg JTRkICAlM2QgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhU X0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRb YXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1gnLAorICAgICAgICBn bHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAg ID8gJ1MnCisgICAgICAgICAgICA6ICctJykpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgs CisgICAgICAgIGdseXBoL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LS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICBIT1JJWk9O VEFMX1JVTEVSOiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAg ICAgaWYgKHJlbGF0aXZlX3ggPD0geF9saW1pdAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vy c29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2 ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1 cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAg ICAgICAgICAgICAgYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsIGNhY2hl X3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRf QVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJlbGF0aXZlX3ggPD0g eF9saW1pdCkKKyAgICAgICAgeworICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVs X3dpZHRoOworICAgICAgICAgIHdoaWxlIChyZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCBy ZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAg ICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91 bmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIE1DX0dMWVBITEVTUywgZHJh d19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgIGFj dGlvbl90eXBlKTsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBmcmFtZV9jaGFyX3dpZHRo OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9S VUxFUjogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBlbnVt IG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNI CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRp bnVlZF9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50 cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29u X3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVW RVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0gIT0gMQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVk X29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNf UkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0g MQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPj0g cm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHp2 X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNT CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAg aWYgKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAg ICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9X CisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gK KyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAg fHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgY3Vy c29yX3R5cGUgPSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOworICAgICAgbWNfaGVscGVyICh3LCBt YXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3MsIHZw b3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBm b3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBhY3RpdmVfcCwgZ2x5cGhf Zmxhdm9yLCBkcmF3X3AsIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAg ICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAg ICAgICAgICAgICAgICAgICBGSUxMX0NPTFVNTjogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAg ICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEZJTExfQ09M VU1OOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChnbHlwaCAt IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGZjX3ggPiByZWxhdGl2ZV94KQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIG9wb2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIG9wb2ludF92cG9zID09IHZwb3MpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJv dywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAg ICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJh Y2tncm91bmQsCisgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdf cCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgYnJlYWs7Cisg ICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBDVVJTT1JfSU5ESUNBVE9S OgorICAgIHsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLwor ICB9CisgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgRU5EOiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAg ICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KK30KKwordm9pZAorbWNfZHJhd19yb3cgKHN0 cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBo X3JvdyAqcm93LAorICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqc3RhcnQsIGludCB4LCBpbnQg aHBvc19sZW5ndGgsIGludCB2cG9zLAorICAgICAgICAgICAgIGludCBib3R0b21fdnBvcywgc3Ry dWN0IGdseXBoX21hdHJpeCAqY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAgICBzdHJ1Y3QgbWNf ZXNzZW50aWFscyBlc3NlbnRpYWxzLCBlbnVtIG1jX3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24s CisgICAgICAgICAgICAgYm9vbCBkcmF3X3AsIGVudW0gbWNfZnJvbV93aGVyZSBmcm9tX3doZXJl KQoreworICAvLyAgY2xvY2tfdCBjbG9ja19zdGFydCA9IGNsb2NrKCk7CisgIC8qIFczMiBFbWFj cyBjcmFzaGVzIG9uIHN0YXJ0dXAgd2l0aG91dCBhIGBCVUZGRVJQJyBjaGVjayBpbiBgdXBkYXRl X3dpbmRvdycuICovCisgIGlmICghQlVGRkVSUCAody0+Y29udGVudHMpKQorICAgIHJldHVybjsK KyAgaWYgKE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAg ICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAg ICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisg ICAgcmV0dXJuOworICBpZiAodnBvcyA9PSBib3R0b21fdnBvcykKKyAgICByZXR1cm47CisgIGlm ICghcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgcmV0dXJuOworICBpbnQgaHBvc19zdGFydCA9 IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9w KQorICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2RyYXdfcm93ICglZCk6ICBkcmF3X3AgKCVzKSB8 IGhwb3MgKCVkKSB8IGxlbiAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgdnBvcywgZHJh d19wID8gInkiIDogIm4iLCBocG9zX3N0YXJ0LCBocG9zX2xlbmd0aCk7CisgIExpc3BfT2JqZWN0 IGJ1ZiA9IHctPmNvbnRlbnRzOworICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgIHN0cnVjdCBidWZm ZXIgKmIgPSBYQlVGRkVSIChidWYpOworICBpbnQgb3BvaW50X2Z4LCBvcG9pbnRfZnksIG9wb2lu dF93ZCwgb3BvaW50X2g7CisgIGludCB0ZXh0X2FyZWFfd2lkdGggPSB3aW5kb3dfYm94X3dpZHRo ICh3LCBURVhUX0FSRUEpOworICBpbnQgaGVhZGVyX2xpbmVfZm9ybWF0ID0gV0lORE9XX0hFQURF Ul9MSU5FX0hFSUdIVCAodyk7CisgIHN0cnVjdCBnbHlwaF9yb3cgKmN1cnNvcl9yb3cgPSAody0+ Y3Vyc29yLnZwb3MgIT0gLTEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1B VFJJWF9ST1cgKGN1cnNvcl9tYXRyaXgsIHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBOVUxMOworICBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCA9 ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGN1cnNvcl9tYXRyaXgsIGN1cnNvcl9yb3csCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJz b3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBOVUxMOworICBib29sIGN1cnNvcl9hdF9mcmluZ2VfcCA9IChjdXJzb3JfZ2x5cGggPT0gTlVM TAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jv dy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNv cl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRoKTsK KyAgYm9vbCBjdXJzb3JfYmV5b25kX2ZyaW5nZV9wID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxMCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IGN1cnNv cl9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgIWN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHRleHRfYXJlYV93aWR0aAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gY3Vyc29yX3Jv dy0+cGl4ZWxfd2lkdGgpOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAg ICAgICAgICAgICAgIFJFUExBQ0UgVEhFIFJFQUwgQ1VSU09SCisqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKyAgZW51bSBmYWNlX2lkIGJnX2ZhY2VfaWQgPSAoY3Vyc29yX2dseXBoICE9IE5VTEwp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBjdXJzb3JfZ2x5cGgtPmZhY2VfaWQKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgc3RydWN0IG1j X1JHQiBjdXJzb3JfYmc7CisgIG1jX3NldF9sc2xfYmcgKHcsIGJnX2ZhY2VfaWQsICZjdXJzb3Jf YmcpOworICAvKiBGSVhNRTogIFB1dCBpbiBzb21lIGNvZGUgdG8gZGVmYXVsdCB0byBNQ19IT0xM T1dfQk9YIGlmIHRoZSB1c2VyIGhhcworICB1bndpdHRpbmdseSBjb21lIHVwIHdpdGggc29tZSB1 bmFjY2VwdGFibGUgZm9ybSBvZiB1bnJlY29nbml6ZWQgY3Vyc29yIHR5cGUuICovCisgIExpc3Bf T2JqZWN0IGxpc3BfdHlwZSA9IEJWQVIgKGIsIG1jX3JlYWxfZmFrZV9jdXJzb3IpOworICBlbnVt IG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfbGlzcF90b19jdXJzb3JfdHlw ZSAoWENBUiAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGxpc3BfdHlwZSk7CisgIGludCBjdXJzb3Jf d2lkdGggPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICA/IFhGSVhO VU0gKFhDQVIgKFhDRFIgKGxpc3BfdHlwZSkpKQorICAgICAgICAgICAgICAgICAgICAgOiAtMTsK KyAgc3RydWN0IG1jX1JHQiBjdXJzb3JfZmc7CisgIG1jX2NvbG9yX3BpY2tlciAodywgY3Vyc29y X2dseXBoLCBlc3NlbnRpYWxzLCAmY3Vyc29yX2ZnLCAtMSwgY3Vyc29yX3R5cGUsCisgICAgICAg ICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgYm9vbCBm aWxsX2NvbHVtbl90cnVtcHNfcCA9ICghTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIp KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPmN1cnNvci54ID09IGVzc2VudGlhbHMuZmNfeAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmICFjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiAhY3Vyc29yX2JleW9uZF9mcmluZ2VfcCk7CisgIC8qIFdlIHVzZSBhIHRl c3Qgc2ltaWxhciB0byB0aGUgcmVhbCBmYWtlIGN1cnNvciBzbyB0aGF0IHRoZSBmcmluZ2UgYml0 bWFwIGlzCisgIG9ubHkgZHJhd24gb25jZSBwZXIgd2luZG93LiAqLworICBpZiAodnBvcyA9PSB3 LT5jdXJzb3IudnBvcworICAgICAgJiYgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoID09IHJv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pbmcsIHRoZW4gdGhlIGRlZmF1bHQgd2UgdXNlCisgICAgICBhbiBNQ19C QVIgYW5kIGFuIE1DX0hCQVIgLS0gYm90aCBoYXZpbmcgYSBjdXJzb3Jfd2lkdGggb2YgMS4gKi8K KyAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93LCB3LT5jdXJzb3Iu eCwgJm9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsICZvcG9pbnRfaCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1DX0JBUiwgMSwgJm9wb2ludF93ZCk7Cisg ICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54 LCBvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHct PmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAg ICAgICAgICAgICAgTUNfQkFSLCAxLCBjdXJzb3JfZmcsIGN1cnNvcl9iZywgZXNzZW50aWFscy5h Y3RpdmVfcCwgTUNfR0xZUEhMRVNTLAorICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hl cmUsIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOworICAg ICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54LCAm b3BvaW50X2Z4LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZv cG9pbnRfZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgTUNfSEJBUiwgMSwgJm9wb2ludF93ZCk7CisgICAg ICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54LCBv cG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHctPmN1 cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAgICAg ICAgICAgICAgTUNfSEJBUiwgMSwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0 aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsCisgICAgICAgICAgICAgICAgIGZyb21fd2hlcmUsIE5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQorICBlbHNlIGlmICghY3Vyc29y X2F0X2ZyaW5nZV9wCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaCAhPSBOVUxMCisgICAgICAg ICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhw b3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA8IGhwb3Nfc3Rh cnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPnR5cGUgIT0gU1RS RVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRy aXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNv ci52cG9zLCAmb3BvaW50X2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jf dHlwZSwgY3Vyc29yX3dpZHRoLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0 cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29y LnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNv ci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBjdXJzb3JfdHlw ZSwgY3Vyc29yX3dpZHRoLCBjdXJzb3JfZmcsIGN1cnNvcl9iZywgZXNzZW50aWFscy5hY3RpdmVf cCwKKyAgICAgICAgICAgICAgICAgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwgTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNB VE9SKTsKKyAgICB9CisgIGVsc2UgaWYgKCFjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAg JiYgY3Vyc29yX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3Iu dnBvcworICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAg ICAgICYmIHctPmN1cnNvci5ocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisgICAgICAg ICAgICYmIGN1cnNvcl9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICAgIHsKKyAgICAg IC8qIElmIGEgdXNlciBoYXMgc2V0IGB4LXN0cmV0Y2gtY3Vyc29yJyB0byBhIG5vbi1uaWwgdmFs dWUsIGhlL3NoZSBjaG9zZSB0bworICAgICAgaGF2ZSBhIGN1cnNvciB0aGF0IHNwYW5zIHRoZSBl bnRpcmUgbGVuZ3RoIG9mIHRoZSBTVFJFVENIX0dMWVBILiAqLworICAgICAgaWYgKCF4X3N0cmV0 Y2hfY3Vyc29yX3ApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUaGUgTUNfSEJBUiBzaGFsbCBo YXZlIGEgYGN1cnNvcl93aWR0aGAgb2YgMS4gKi8KKyAgICAgICAgICBtY19nZXRfY3Vyc29yX2dl b21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnksICZvcG9pbnRfZnksIHctPmN1 cnNvci5ocG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci52 cG9zLCAmb3BvaW50X2gsIE1DX0hCQVIsIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJm9wb2ludF93ZCk7CisgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywg Y3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAg ICAgdy0+Y3Vyc29yLnksIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9z LAorICAgICAgICAgICAgICAgICAgICAgb3BvaW50X3dkLCBvcG9pbnRfaCwgTUNfSEJBUiwgMSwg Y3Vyc29yX2ZnLCBjdXJzb3JfYmcsCisgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFj dGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICAg ICAgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAg ICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUs IENVUlNPUl9JTkRJQ0FUT1IpOworICAgICAgICB9CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21l dHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IueSwgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhw b3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IudnBvcywgJm9wb2lu dF9oLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93 aWR0aCwgJm9wb2ludF93ZCk7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJz b3JfZ2x5cGgsIHctPmN1cnNvci54LCBvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAg ICAgICAgICBvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50 X3dkLCBvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0 aCwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsCisgICAgICAgICAg ICAgICAgIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsIE5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgIERSQVcg QU5EIFJFQ09SRCBGQUtFIENVUlNPUlMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBpZiAo aHBvc19sZW5ndGggPT0gMSkKKyAgICB7CisgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICB7CisgICAgICAgICAgLyogVGhlIHNw YWNlIGFwcGVuZGVkIHRvIGEgcm93IGVuZGluZyB3aXRoIGEgbmV3IGxpbmUKKyAgICAgICAgICBk b2VzIG5vdCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDApIHRoYXQgd2UgY2FuCisgICAg ICAgICAgdXNlIGZvciB0aGlzIHBhcnRpY3VsYXIgYXBwbGljYXRpb24uICBXaGVuIHRoZXJlIGlz IGEKKyAgICAgICAgICBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5IHRoYXQgYXNzaWducyBh IHZpc2libGUKKyAgICAgICAgICBnbHlwaCB0byBhIG5ldyBsaW5lLCB0aGVyZSBpcyBubyBwcm9i bGVtIGJlY2F1c2UgdGhhdAorICAgICAgICAgIGdseXBoIGhhcyBhIGBnbHlwaC0+Y2hhcnBvcycg dGhhdCB3ZSBjYW4gdXNlLiAgV2hlbgorICAgICAgICAgIG5vIHZpc2libGUgRU9MIGdseXBoIGV4 aXN0cywgd2UgdXNlIHRoZSBmb2xsb3dpbmcKKyAgICAgICAgICB0ZXN0OiAgdGhlIGFwcGVuZGVk IHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMgb25lCisgICAgICAgICAgbGVzcyB0aGFuIHRo ZSBlbmQgb2YgdGhlIG1hdHJpeCByb3cuICovCisgICAgICAgICAgaW50IGhwb3MgPSBzdGFydCAt IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgc3RydWN0IGdseXBoICpwcmV2aW91 c19nbHlwaCA9ICgwIDw9IGhwb3MgLSAxICYmIGhwb3MgLSAxIDwgcm93LT51c2VkW1RFWFRfQVJF QV0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogTlVMTDsKKyAgICAgICAgICAvLyBzdHJ1Y3QgZ2x5cGggKmxhc3RfZ2x5cGgg PSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAg ICAgICAgIGJvb2wgc2tpcF9wID0gKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9PSBNQVRSSVhfUk9XX0VO RF9DSEFSUE9TIChyb3cpIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICYmIHN0YXJ0LT5i eXRlcG9zICE9IGVzc2VudGlhbHMuenZfYnl0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg PyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAvKiBXaGVuIGEgYGJ1ZmZlci1kaXNwbGF5 LXRhYmxlJyBlbnRyeSBjb250YWlucworICAgICAgICAgICAgICAgICAgICAgICAgYSB2aXNpYmxl IHRhYiBjaGFyYWN0ZXIgKCLCuyIpLCB0aGUgc3Vic2VxdWVudAorICAgICAgICAgICAgICAgICAg ICAgICAgU1RSRVRDSF9HTFlQSCB3aWxsIGhhdmUgdGhlIHNhbWUgc3RhcnQtPmNoYXJwb3MKKyAg ICAgICAgICAgICAgICAgICAgICAgIGFzIHRoZSBhZm9yZW1lbnRpb25lZCB2aXNpYmxlIHRhYiBj aGFyYWN0ZXIuICovCisgICAgICAgICAgICAgICAgICAgICAgICA6IChwcmV2aW91c19nbHlwaCAh PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hh cnBvcyA9PSBzdGFydC0+Y2hhcnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0cnVl CisgICAgICAgICAgICAgICAgICAgICAgICA6IGZhbHNlOworICAgICAgICAgIGludCBwb3NpbnQg PSAocm93X3Bvc2l0aW9uID09IFBPU1RfWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgPyAt MQorICAgICAgICAgICAgICAgICAgICAgICA6IChyb3dfcG9zaXRpb24gPT0gQVRfWlYpCisgICAg ICAgICAgICAgICAgICAgICAgICAgID8gZXNzZW50aWFscy56dgorICAgICAgICAgICAgICAgICAg ICAgICA6IChzdGFydC0+Ynl0ZXBvcyAhPSBlc3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+ dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9S T1dfRU5EX0NIQVJQT1MgKHJvdykgLSAxCisgICAgICAgICAgICAgICAgICAgICAgIDogKHN0YXJ0 LT5ieXRlcG9zID09IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJF QV0gLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNzZW50aWFscy56dgorICAgICAg ICAgICAgICAgICAgICAgICA6IHN0YXJ0LT5jaGFycG9zOworICAgICAgICAgIExpc3BfT2JqZWN0 IHNwZWNzID0gbWNfYXNzb2MgKG1ha2VfZml4bnVtIChwb3NpbnQpLCBCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIG1jX2NvbmYpKTsKKyAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9mb3Jt YXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0 ID09IDApCisgICAgICAgICAgICAgICYmICFOSUxQIChzcGVjcykKKyAgICAgICAgICAgICAgJiYg c3RhcnQtPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICYmICFz a2lwX3AKKyAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uICE9IFBPU1RfWlYpCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGxpc3BfdHlwZSA9IG1jX250aCAoMSwg c3BlY3MpOworICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID0g KENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBtY19saXNw X3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOworICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9 IChzdGFydC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IE1DX0hPTExPV19CT1gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGN1cnNvcl90 eXBlOworICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoID0gKENPTlNQIChsaXNwX3R5cGUp KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBYRklYTlVNIChYQ0FSIChYQ0RS IChsaXNwX3R5cGUpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogLTE7Cisg ICAgICAgICAgICAgIExpc3BfT2JqZWN0IG1jX2ZvcmVncm91bmQgPSBtY19udGggKDIsIHNwZWNz KTsKKyAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgIGlm IChTVFJJTkdQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAgICBtY194d19jb2xvcl92 YWx1ZXMgKHcsIG1jX2ZvcmVncm91bmQsICZsc2xfZmcpOworICAgICAgICAgICAgICAgIGVsc2Ug aWYgKFZFQ1RPUlAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICBsc2xfZmcucmVkID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91 bmQsIDApKTsKKyAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLmdyZWVuID0gWEZMT0FUX0RBVEEg KEFSRUYgKG1jX2ZvcmVncm91bmQsIDEpKTsKKyAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLmJs dWUgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMikpOworICAgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoTklMUCAobWNfZm9yZWdyb3VuZCkp CisgICAgICAgICAgICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgc3RhcnQsIGVzc2VudGlh bHMsICZsc2xfZmcsIHBvc2ludCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBjdXJzb3JfdHlwZSwgcm93X3Bvc2l0aW9uLCBNVUxUSVBMRV9DVVJTT1JTKTsKKyAgICAg ICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAg ICAgICAgICAgaW50IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOwor ICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBzdGFydCwgVEVYVF9BUkVB LCB4LCB4X2xpbWl0LCByb3ctPnksCisgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMuZmNfeCwg bHNsX2ZnLAorICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1V TFRJUExFX0NVUlNPUlMsIGRyYXdfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tX3do ZXJlLCBNQ19DQUNIRSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlmICghTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAm JiBlc3NlbnRpYWxzLmZjX3ggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgJiYgZXNzZW50 aWFscy5mY194ID49IHctPm1jLmxudW1fcGl4ZWxfd2lkdGgpCisgICAgICAgIHsKKyAgICAgICAg ICBpbnQgeF9saW1pdCA9IHggKyBzdGFydC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgYm9vbCBy ZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnggPT0gZXNzZW50aWFscy5mY194CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnkgPT0gc3RhcnQt PnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBv cyA9PSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsKKyAgICAgICAgICBz dHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIHN0YXJ0 LCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCAtMSwgTUNfQkFSLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgcm93X3Bvc2l0aW9uLCBGSUxMX0NPTFVNTik7CisgICAgICAgICAgaWYgKHggKyBz dGFydC0+cGl4ZWxfd2lkdGggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICYmICgo aGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgIHx8 IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAmJiAoKHN0YXJ0ICE9IHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEKKyAgICAgICAg ICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0geAorICAgICAgICAgICAgICAgICAgICYm IGVzc2VudGlhbHMuZmNfeCA8IHggKyBzdGFydC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAg ICAgICB8fCAoc3RhcnQgPT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhU X0FSRUFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB4 KSkKKyAgICAgICAgICAgICAgJiYgc3RhcnQtPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcp CisgICAgICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgICAgICBtY19l bmdpbmUgKHcsIG1hdHJpeCwgcm93LCBzdGFydCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ct PnksCisgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XSwgdnBvcywgTUNfQkFSLCAxLAorICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4 LCBlc3NlbnRpYWxzLmZjX3gsIGxzbF9mZywgZXNzZW50aWFscy5hY3RpdmVfcCwKKyAgICAgICAg ICAgICAgICAgICAgICAgRklMTF9DT0xVTU4sIGRyYXdfcCwgZnJvbV93aGVyZSwgRkNfQ0FDSEUp OworICAgICAgICB9CisgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hvcml6b250 YWxfcnVsZXIpKQorICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAg IHsKKyAgICAgICAgICBpbnQgeF9saW1pdCA9IChzdGFydCA9PSByb3ctPmdseXBoc1tURVhUX0FS RUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAg PyB0ZXh0X2FyZWFfd2lkdGgKKyAgIC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Ao YiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICYmICFmaWxsX2NvbHVtbl90cnVtcHNf cCkKKyAgICAgICAgeworICAgICAgICAgIGN1cnNvcl90eXBlID0gKHN0YXJ0LT50eXBlID09IElN QUdFX0dMWVBIKQorICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAg ICAgICAgICAgICAgICAgICAgICA6IE1DX0JBUjsKKyAgICAgICAgICBpbnQgeF9saW1pdCA9IHdp bmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgYm9vbCByZWFsX2Zha2Vf Y3Vyc29yX3AgPSAody0+Y3Vyc29yLnkgPT0gc3RhcnQtPnkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsKKyAgICAgICAgICBz dHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIHN0YXJ0 LCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCAtMSwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICByb3dfcG9zaXRpb24sIFZFUlRJQ0FMX1JVTEVSKTsKKyAgICAgICAgICBp ZiAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAg fHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICYmICgoc3RhcnQgIT0g cm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMQorICAgICAg ICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHgKKyAgICAgICAgICAgICAgICAgICAmJiB3 LT5jdXJzb3IueCA8IHggKyBzdGFydC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB8 fCAoc3RhcnQgPT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFd IC0gMQorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHgpKQorICAgICAg ICAgICAgICAmJiBzdGFydC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAg ICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgIG1jX2VuZ2luZSAodywg bWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAg ICAgICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBj dXJzb3JfdHlwZSwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNz ZW50aWFscy5mY194LCBsc2xfZmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsCisgICAgICAgICAgICAg ICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSLCBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsK KyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgICB7CisgICAgICAgIGludCByZWxhdGl2 ZV94ID0gMDsKKyAgICAgICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEg PCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5 cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV07CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGgg KmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51c2VkW2FyZWFdOworICAgICAgICAgICAgLyogR2x5 cGggZm9yIGEgbGluZSBlbmQgaW4gdGV4dC4gKi8KKyAgICAgICAgICAgIGlmIChhcmVhID09IFRF WFRfQVJFQSAmJiBnbHlwaCA9PSBnbHlwaF9lbmQgJiYgZ2x5cGgtPmNoYXJwb3MgPiAwKQorICAg ICAgICAgICAgICArK2dseXBoX2VuZDsKKyAgICAgICAgICAgIGZvciAoOyBnbHlwaCA8IGdseXBo X2VuZDsgKytnbHlwaCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICh2cG9z ICE9IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAgICAgICYmIGdseXBoICE9IGdseXBo X2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194IDwgcmVsYXRp dmVfeAorICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHJlbGF0aXZlX3gKKyAg ICAgICAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBt Y19jb25mKSkpCisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBpZiAo IU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBUaGUgc3BhY2UgYXBwZW5kZWQgdG8g YSByb3cgZW5kaW5nIHdpdGggYSBuZXcgbGluZSBkb2VzCisgICAgICAgICAgICAgICAgICAgIG5v dCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDApIHRoYXQgd2UgY2FuIHVzZSBmb3IgdGhp cworICAgICAgICAgICAgICAgICAgICBwYXJ0aWN1bGFyIGFwcGxpY2F0aW9uLiAgV2hlbiBhIGBi dWZmZXItZGlzcGxheS10YWJsZScgZW50cnkKKyAgICAgICAgICAgICAgICAgICAgYXNzaWducyBh IHZpc2libGUgZ2x5cGggdG8gYSBuZXcgbGluZSwgdGhlcmUgaXMgbm8gcHJvYmxlbQorICAgICAg ICAgICAgICAgICAgICBiZWNhdXNlIHRoYXQgZ2x5cGggaGFzIGEgYGdseXBoLT5jaGFycG9zJyB0 aGF0IHdlIGNhbiB1c2UuCisgICAgICAgICAgICAgICAgICAgIFdoZW4gbm8gdmlzaWJsZSBFT0wg Z2x5cGggZXhpc3RzLCB3ZSB1c2UgdGhlIGZvbGxvd2luZyB0ZXN0OgorICAgICAgICAgICAgICAg ICAgICB0aGUgYXBwZW5kZWQgc3BhY2UgaGFzIGEgcG9zaXRpb24gdGhhdCBpcyBvbmUgbGVzcyB0 aGFuIHRoZQorICAgICAgICAgICAgICAgICAgICBlbmQgb2YgdGhlIG1hdHJpeCByb3cuICovCisg ICAgICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnByZXZpb3VzX2dseXBoID0g KDAgPD0gaHBvcyAtIDEgJiYgaHBvcyAtIDEgPCByb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgICAgICAgICAgICAgICAgICAgIC8vIHN0cnVj dCBnbHlwaCAqbGFzdF9nbHlwaCA9IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRb VEVYVF9BUkVBXSAtIDE7CisgICAgICAgICAgICAgICAgICAgIGJvb2wgc2tpcF9wID0gKHByZXZp b3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg cHJldmlvdXNfZ2x5cGgtPmNoYXJwb3MgPT0gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSAt IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPmJ5dGVwb3Mg IT0gZXNzZW50aWFscy56dl9ieXRlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogV2hlbiBhIGBi dWZmZXItZGlzcGxheS10YWJsZScgZW50cnkgY29udGFpbnMKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBhIHZpc2libGUgdGFiIGNoYXJhY3RlciAoIsK7IiksIHRoZSBzdWJzZXF1 ZW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU1RSRVRDSF9HTFlQSCB3aWxs IGhhdmUgdGhlIHNhbWUgZ2x5cGgtPmNoYXJwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBhcyB0aGUgYWZvcmVtZW50aW9uZWQgdmlzaWJsZSB0YWIgY2hhcmFjdGVyLiAqLwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHByZXZpb3VzX2dseXBoICE9IE5V TEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19nbHlw aC0+Y2hhcnBvcyA9PSBnbHlwaC0+Y2hhcnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogZmFs c2U7CisgICAgICAgICAgICAgICAgICAgIGludCBwb3NpbnQgPSAocm93X3Bvc2l0aW9uID09IFBP U1RfWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gLTEKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogKHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNzZW50aWFscy56dgorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGgtPmJ5dGVwb3MgIT0gZXNzZW50aWFscy56 dl9ieXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaCAtIHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJv dykgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaC0+Ynl0ZXBv cyA9PSBlc3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbVEVYVF9B UkVBXSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNzZW50aWFs cy56dgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBnbHlwaC0+Y2hhcnBvczsK KyAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3Qgc3BlY3MgPSBtY19hc3NvYyAobWFrZV9m aXhudW0gKHBvc2ludCksIEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpOwor ICAgICAgICAgICAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3Mg PiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAw KQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKHNwZWNzKQorICAgICAgICAgICAg ICAgICAgICAgICAgJiYgZ2x5cGgtPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAg ICAgICAgICAgICAgICAgICAgICAmJiAhc2tpcF9wCisgICAgICAgICAgICAgICAgICAgICAgICAm JiByb3dfcG9zaXRpb24gIT0gUE9TVF9aVikKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBsaXNwX3R5cGUgPSBtY19udGggKDEsIHNw ZWNzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29y X3R5cGUgPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNwX3RvX2N1cnNvcl90eXBlIChY Q0FSIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogbWNfbGlzcF90b19jdXJzb3JfdHlwZSAobGlzcF90eXBlKTsK KyAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gKGdseXBoLT50eXBlID09IElN QUdFX0dMWVBIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0hP TExPV19CT1gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBjdXJzb3Jf dHlwZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGggPSAoQ09OU1Ag KGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBYRklYTlVNIChYQ0FSIChYQ0RSIChsaXNwX3R5cGUpKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IC0xOworICAgICAgICAgICAgICAgICAgICAgICAgTGlz cF9PYmplY3QgbWNfZm9yZWdyb3VuZCA9IG1jX250aCAoMiwgc3BlY3MpOworICAgICAgICAgICAg ICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAgICAg ICBpZiAoU1RSSU5HUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICAgICAgICAg IG1jX3h3X2NvbG9yX3ZhbHVlcyAodywgbWNfZm9yZWdyb3VuZCwgJmxzbF9mZyk7CisgICAgICAg ICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKFZFQ1RPUlAgKG1jX2ZvcmVncm91bmQpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGxzbF9mZy5yZWQgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMCkpOworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLmdyZWVuID0gWEZMT0FUX0RBVEEgKEFS RUYgKG1jX2ZvcmVncm91bmQsIDEpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxz bF9mZy5ibHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDIpKTsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxz ZSBpZiAoTklMUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBtY19jb2xvcl9waWNrZXIgKHcsIGdseXBoLCBlc3NlbnRpYWxzLCAmbHNsX2ZnLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpbnQsIGN1cnNv cl90eXBlLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlMpOworICAgICAgICAgICAgICAgICAgICAg ICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAgICAg ICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVB KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGds eXBoLCBhcmVhLCByZWxhdGl2ZV94LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICB4X2xpbWl0LCByb3ctPnksIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93 aWR0aCwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ZXNzZW50aWFscy5mY194LCBsc2xfZmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlMsIGRyYXdfcCwgZnJvbV93 aGVyZSwgTUNfQ0FDSEUpOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRl bnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNf eCA8PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5m Y194ID49IHctPm1jLmxudW1fcGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9B UkVBKTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+ Y3Vyc29yLnggPT0gZXNzZW50aWFscy5mY194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci55ID09IGdseXBoLT55CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09 IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsKKyAgICAg ICAgICAgICAgICAgICAgaW50IGhwb3MgPSBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07 CisgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgICAg ICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIGdseXBoLCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCAt MSwgTUNfQkFSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvd19w b3NpdGlvbiwgRklMTF9DT0xVTU4pOworICAgICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBo cG9zX3N0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFydCAr IGhwb3NfbGVuZ3RoCisgICAgICAgICAgICAgICAgICAgICAgICAmJiByZWxhdGl2ZV94ICsgZ2x5 cGgtPnBpeGVsX3dpZHRoIDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAg ICAgJiYgKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAg ICAgICAgICAgICAgJiYgKChnbHlwaCAhPSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSByZWxhdGl2ZV94CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA8IHJlbGF0aXZlX3ggKyBnbHlw aC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGdseXBoID09 IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50 aWFscy5mY194ID49IHJlbGF0aXZlX3gpKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5 cGgtPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICAgICAgICAg ICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2lu ZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBNQ19CQVIs IDEsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3Nl bnRpYWxzLmZjX3gsIGxzbF9mZywgZXNzZW50aWFscy5hY3RpdmVfcCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIEZJTExfQ09MVU1OLCBkcmF3X3AsIGZyb21fd2hlcmUsIEZDX0NB Q0hFKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAg ICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9ob3Jpem9udGFsX3J1bGVyKSkKKyAgICAgICAgICAg ICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgICAgaW50IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBU RVhUX0FSRUEpOworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5n bHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xf Zmc7CisgICAgICAgICAgICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgZ2x5cGgsIGVzc2Vu dGlhbHMsICZsc2xfZmcsIC0xLCBNQ19IQkFSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgSE9SSVpPTlRBTF9SVUxFUik7CisgICAgICAgICAg ICAgICAgICAgIC8qIFByZXNlcnZlIHN1cHBvcnQgZm9yIGRlZmF1bHQgYmVoYXZpb3Igc3VjaCB0 aGF0IGEgdXNlciBtYXkKKyAgICAgICAgICAgICAgICAgICAgc3BlY2lmeSB0aGUgaGVpZ2h0IG9m IGFuIE1DX0hCQVIsIHdoaWNoIGJlZ2lucyBpdHMgam91cm5leQorICAgICAgICAgICAgICAgICAg ICBhcyB0aGUgYGN1cnNvcl93aWR0aCcuICBgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeScgcmVhZGp1 c3RzLiAqLworICAgICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0CisgICAg ICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoKQor ICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBh cmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgcm93LT55LCBocG9zLCB2cG9zLCBNQ19IQkFSLCAxLCBjdXJzb3JfbWF0cml4LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5mY194LCBsc2xfZmcsIGVzc2Vu dGlhbHMuYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIT1JJWk9O VEFMX1JVTEVSLCBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRl bnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChi LCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICYmICFmaWxsX2NvbHVt bl90cnVtcHNfcCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY3Vy c29yX3R5cGUgPSAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBNQ19CQVI7CisgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0g d2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAgICAgYm9v bCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnkgPT0gZ2x5cGgtPnkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnZwb3Mg PT0gdnBvcyk7CisgICAgICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmds eXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9m ZzsKKyAgICAgICAgICAgICAgICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBnbHlwaCwgZXNzZW50 aWFscywgJmxzbF9mZywgLTEsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgVkVSVElDQUxfUlVMRVIpOworICAgICAgICAg ICAgICAgICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICAgICAgICAgICAg ICAmJiBocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICAgICAgICAg ICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAg ICAgICAgICAgICAgICAmJiAoKGdseXBoICE9IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gcmVsYXRpdmVfeAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4 ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGdseXBoID09IGdseXBo X2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLngg Pj0gcmVsYXRpdmVfeCkpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+eSA8PSB3 aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFyZWFs X2Zha2VfY3Vyc29yX3ApCisgICAgICAgICAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRy aXgsIHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZlX3gsIHhfbGltaXQsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICByb3ctPnksIGhwb3MsIHZwb3MsIGN1cnNvcl90eXBlLCAxLCBj dXJzb3JfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFs cy5mY194LCBsc2xfZmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUiwgZHJhd19wLCBmcm9tX3doZXJlLCBDSF9DQUNI RSk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBn bHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICB9 CisgIC8vICBjbG9ja190IGNsb2NrX2VuZCA9IGNsb2NrKCk7CisgIC8vICBkb3VibGUgY3B1X3Rp bWVfdXNlZCA9ICgoZG91YmxlKSAoY2xvY2tfZW5kIC0gY2xvY2tfc3RhcnQpKSAvIENMT0NLU19Q RVJfU0VDOworICAvLyAgZnByaW50ZiAoc3RkZXJyLCAibWNfZHJhd19yb3cgKCVzKTogIFRJTUUg KCVmKVxuIiwgbWNfd2luZG93ICh3KSwgY3B1X3RpbWVfdXNlZCk7Cit9CisKK3ZvaWQKK21jX3Jl ZHJhd19yb3cgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwg c3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgaW50IHN0YXJ0X3gsIGludCBz dGFydF9ocG9zLCBpbnQgZW5kX2hwb3MsIGJvb2wgY2xlYXJfZW9sX3AsCisgICAgICAgICAgICAg ICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UgaGwpCit7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFN RSAoV0lORE9XX0ZSQU1FICh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ICAgIC5ncmVlbiA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF0uYmFja2dyb3VuZC5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAuYmx1ZSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF0uYmFja2dyb3VuZC5ibHVlfTsKKyAgICAgICAgICBib29sIGFjdGl2ZV9wID0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5hY3RpdmVfcDsK KyAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICBi b29sIGVuYWJsZWRfcCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0uZW5hYmxlZF9wOworICAgICAgICAgIGlmICh2cG9zID09IHZudGgKKyAgICAgICAgICAg ICAgJiYgKChocG9zID49IHN0YXJ0X2hwb3MKKyAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwg ZW5kX2hwb3MpCisgICAgICAgICAgICAgICAgICAvKiBBIGZsb2F0aW5nIGN1cnNvciBiZXlvbmQg dGhlIGVuZCBvZiB0aGUgZ2x5cGggcm93LiAqLworICAgICAgICAgICAgICAgICAgfHwgKGhwb3Mg KyAxID09IHN0YXJ0X2hwb3MKKyAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zICsgMSA9PSBl bmRfaHBvcykpCisgICAgICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgYm9vbCByZW1vdmVfcCA9IGZhbHNlOworICAgICAgICAgICAgICBtY19kcmF3 X2VyYXNlX2h5YnJp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52cG9zOworICAgICAgICAgIGludCB3ZCA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ud2Q7CisgICAgICAgICAgaW50IGgg PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmg7CisgICAg ICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vyc29yX3R5cGU7CisgICAgICAgICAgaW50 IGN1cnNvcl93aWR0aCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0uY3Vyc29yX3dpZHRoOworICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnID0gey5y ZWQgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZvcmVn cm91bmQucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZm9yZWdyb3VuZC5n cmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZm9yZWdyb3VuZC5ibHVlfTsK KyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9iZyA9IHsucmVkID0gdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iYWNrZ3JvdW5kLnJlZCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWN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F90d28pCisgICAgICAgICAgICBj b250aW51ZTsKKyAgICAgICAgICBpZiAodnBvcyA9PSB2bnRoCisgICAgICAgICAgICAgICYmIGds eXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIG1jX2VyYXNlX2N1cnNvciAodywgbWF0cml4LCByb3cs IHgsIHksIGhwb3MsIHZwb3MsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkKTsKKyAgICAg ICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5l bmFibGVkX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgLS13LT5tY19tYXRyaXguY3Vyc29yc191 c2VkW2NhY2hlX3R5cGVdOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAodnBv cyA9PSB2bnRoCisgICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAg ICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwg aHBvcywgdnBvcywgd2QsIGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGxzbF9iZywgYWN0aXZlX3AsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgcmVtb3ZlX3ApOworICAg ICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uZW5hYmxlZF9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgLS13LT5tY19tYXRyaXguY3Vy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5jdXJyZW50X3kgPCBydW4uZGVzaXJlZF95CisgIHwg ICAgICAgICAgICAgfCAgICBydW4uaGVpZ2h0ID0gaXQubGFzdF92aXNpYmxlX3kgLSBydW4uY3Vy cmVudF95OworICB8ICAgICAgICAgICAgIHwgICAgcnVuLmhlaWdodCA9PSAxMDgwIC0gNTQwID09 IDU0MAorICB8ICAgICAgICAgICAgIHwgICAgW1RoZSBlbnRpcmUgYm90dG9tIHJlY3RhbmdsZSBn ZXRzIGNvcGllZCB0byB1cHBlciBydW4uZGVzaXJlZF95Ll0KKyAgfCAgICAgICAgICAgICB8Cisg ICstLS0tLS0tLS0tLS0tKyA8PSBydW4uY3VycmVudF95ID09IDU0MAorICB8ICAgICAgICAgICAg IHwKKyAgfCAgICAgICAgICAgICB8IDw9IHJ1bi5kZXNpcmVkX3kgPT0gODEwIFtkb3duICjihpMp XSA9PSBydW4uY3VycmVudF95ID4gcnVuLmRlc2lyZWRfeQorICB8ICAgICAgICAgICAgIHwgICAg cnVuLmhlaWdodCA9IGl0Lmxhc3RfdmlzaWJsZV95IC0gcnVuLmRlc2lyZWRfeQorICB8ICAgICAg ICAgICAgIHwgICAgcnVuLmhlaWdodCA9PSAxMDgwIC0gODEwID09IDI3MAorICB8ICAgICAgICAg ICAgIHwgICAgW1RvcCBwYXJ0IG9mIHRoZSBsb3dlciByZWN0YW5nbGUgZ2V0cyBjb3BpZWQgdG8g bG93ZXIgcnVuLmRlc2lyZWRfeS5dCisgIHwgICAgICAgICAgICAgfAorICArLS0tLS0tLS0tLS0t LSsgPD0gaXQubGFzdF92aXNpYmxlX3kgPT0gMTA4MCAqLwordm9pZAorbWNfcHJlX3Njcm9sbF9j bGVhbiAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IHJ1biBydW4sIGludCBzdGFydF92cG9zLAor ICAgICAgICAgICAgICAgICAgICAgaW50IG5yb3dzX3Njcm9sbGVkLCBlbnVtIG1jX3ByZV9zY3Jv bGxfY2xlYW4gZnJvbV93aGVyZSkKK3sKKyAgaWYgKE1JTklfV0lORE9XX1AgKHcpKQorICAgIHJl dHVybjsKKyAgYm9vbCBnb19vbmVfcCA9ICh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NB Q0hFXSA+IDAKKyAgICAgICAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2Vk W0NIX0NBQ0hFXSA+IDAKKyAgICAgICAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29y c191c2VkW0ZDX0NBQ0hFXSA+IDApOworICBib29sIGdvX3R3b19wID0gKEJVRkZFUlAgKHctPmNv bnRlbnRzKQorICAgICAgICAgICAgICAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAg ICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYp KSkpOworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAibWNf cHJlX3Njcm9sbF9jbGVhbiAoJXMpOlxuXAorICAlcyB8IGdvX29uZV9wICglcykgfCBnb190d29f cCAoJXMpXG5cCisgIHN0YXJ0X3Zwb3MgKCVkKSB8IG5yb3dzX3Njcm9sbGVkICglZClcblwKKyAg JXM6ICBydW4uY3VycmVudC9kZXNpcmVkX3kgKCVkLyVkKSB8IHJ1bi5oZWlnaHQgKCVkKVxuIiwK KyAgICBtY193aW5kb3cgKHcpLCAoZnJvbV93aGVyZSA9PSBUUllfV0lORE9XX1JFVVNJTkdfQ1VS UkVOVF9NQVRSSVhfRE9XTikKKyAgICAgICAgICAgICAgICAgICAgID8gIlRSWV9XSU5ET1dfUkVV U0lOR19DVVJSRU5UX01BVFJJWF9ET1dOIgorICAgICAgICAgICAgICAgICAgIDogKGZyb21fd2hl cmUgPT0gVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQKQorICAgICAgICAgICAg ICAgICAgICAgPyAiVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQIgorICAgICAg ICAgICAgICAgICAgIDogKGZyb21fd2hlcmUgPT0gVFJZX1dJTkRPV19JRCkKKyAgICAgICAgICAg ICAgICAgICAgID8gIlRSWV9XSU5ET1dfSUQiCisgICAgICAgICAgICAgICAgICAgOiAiVU5LTk9X TiIsCisgICAgZ29fb25lX3AgPyAieWVzIiA6ICJubyIsIGdvX3R3b19wID8gInllcyIgOiAibm8i LAorICAgIHN0YXJ0X3Zwb3MsIG5yb3dzX3Njcm9sbGVkLAorICAgIHJ1bi5jdXJyZW50X3kgPCBy dW4uZGVzaXJlZF95ID8gIuKGkyIgOiAi4oaRIiwKKyAgICBydW4uY3VycmVudF95LCBydW4uZGVz aXJlZF95LCBydW4uaGVpZ2h0KTsKKyAgaWYgKCFnb19vbmVfcCAmJiAhZ29fdHdvX3ApCisgICAg cmV0dXJuOworICBib29sIHVwZGF0aW5nX2ZyYW1lX3AgPSBmYWxzZTsKKyAgc3RydWN0IGZyYW1l ICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIGlmIChYRlJBTUUgKHctPmZyYW1lKSAhPSBmLT5t Y191cGRhdGluZ19mcmFtZQorICAgICAgJiYgKGdvX29uZV9wIHx8IGdvX3R3b19wKSkKKyAgICB7 CisgICAgICB1cGRhdGluZ19mcmFtZV9wID0gdHJ1ZTsKKyAgICAgIHVwZGF0ZV9iZWdpbiAoZik7 CisgICAgfQorICBpZiAody0+cGh5c19jdXJzb3Jfb25fcAorICAgICAgJiYgZ29fdHdvX3ApCisg ICAgZXJhc2VfcGh5c19jdXJzb3IgKHcpOworICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgg PSB3LT5jdXJyZW50X21hdHJpeDsKKyAgZm9yIChpbnQgdm50aCA9IHN0YXJ0X3Zwb3M7CisgICAg ICAgbWF0cml4ICE9IE5VTEwKKyAgICAgICAmJiB2bnRoIDwgbWF0cml4LT5ucm93cworICAgICAg ICYmIE1BVFJJWF9ST1cgKG1hdHJpeCwgdm50aCktPmVuYWJsZWRfcAorICAgICAgICYmIGdvX29u ZV9wOworICAgICAgICsrdm50aCkKKyAgICB7CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cg PSBNQVRSSVhfUk9XIChtYXRyaXgsIHZudGgpOworICAgICAgbWNfZXJhc2Vfcm93ICh3LCBtYXRy aXgsIHJvdyk7CisgICAgfQorICBpZiAodXBkYXRpbmdfZnJhbWVfcCkKKyAgICB1cGRhdGVfZW5k IChmKTsKKyAgLy8gbWNfcmVzZXRfY2FjaGUgKHcpOworfQorCitERUZVTiAoIm1jLXN0ZGVyciIs IEZtY19zdGRlcnIsIFNtY19zdGRlcnIsIDAsIDEsICJQIiwKKyAgICAgICBkb2M6IC8qIFRvZ2ds ZSB0cmFjaW5nIG9mIG11bHRpcGxlIGZha2UgY3Vyc29ycy4KK1dpdGggQVJHLCB0dXJuIHRyYWNp bmcgb24gaWYgYW5kIG9ubHkgaWYgQVJHIGlzIHBvc2l0aXZlLiAqLykKKyAgKExpc3BfT2JqZWN0 IGFyZykKK3sKKyAgaWYgKE5JTFAgKGFyZykpCisgICAgbWNfc3RkZXJyX3AgPSAhbWNfc3RkZXJy X3A7CisgIGVsc2UKKyAgICB7CisgICAgICBhcmcgPSBGcHJlZml4X251bWVyaWNfdmFsdWUgKGFy Zyk7CisgICAgICBtY19zdGRlcnJfcCA9IFhGSVhOVU0gKGFyZykgPiAwOworICAgIH0KKyAgcmV0 dXJuIFFuaWw7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAMCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKIAkJICAgICAgV2luZG93IGRpc3Bs YXkgZGltZW5zaW9ucwpAQCAtMTMzOTUsNiArMTgwMjMsNjkgQEAgaHNjcm9sbF93aW5kb3dfdHJl ZSAoTGlzcF9PYmplY3Qgd2luZG93KQogCSAgICAgIGVsc2UKIAkJcHQgPSBjbGlwX3RvX2JvdW5k cyAoQkVHViwgbWFya2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pLCBaVik7CiAKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIChnZGIp IGJ0CisjMCAgdGVybWluYXRlX2R1ZV90b19zaWduYWwgKHNpZz02LCBiYWNrdHJhY2VfbGltaXQ9 MjE0NzQ4MzY0NykgYXQgZW1hY3MuYzozNTkKKyMxICAweDAwMDAwMDAxMDAxZWU5OTYgaW4gZGll ICgKKyAgICBtc2c9MHgxMDAzMmZjODggImNoYXJwb3MgPCAwIHx8IChjaGFycG9zID49IEJVRl9C RUcgKGN1cnJlbnRfYnVmZmVyKSAmJiBjaGFycG9zIDw9IFpWKSIsIGZpbGU9MHgxMDAzMmUzMmQg InhkaXNwLmMiLCBsaW5lPTc5NTEpIGF0IGFsbG9jLmM6NzIxNAorIzIgIDB4MDAwMDAwMDEwMDA0 ZDJhYiBpbiBpbml0X2l0ZXJhdG9yIChpdD0weDdmZmY1ZmJmOWU4MCwgdz0weDExYWU2MjE1MCwK KyAgICBjaGFycG9zPTc0MywgYnl0ZXBvcz03NDMsIHJvdz0weDAsIGJhc2VfZmFjZV9pZD1ERUZB VUxUX0ZBQ0VfSUQpCisgICAgYXQgeGRpc3AuYzo3O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ICAgICAgICAgICAgICAgICAgIHx8 IChjaGFycG9zID49IEJVRl9CRUcgKGN1cnJlbnRfYnVmZmVyKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBjaGFycG9zIDw9IFpWKSkKKyAgICAgICAgICAgICAgICAgICAgICAgID8g ZmFsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2hf b25lKQorICAgIHJldHVybiBoc2Nyb2xsZWRfcDsKKworICAvKiBgcmVzZWF0XzEnOiAgQ0hBUlBP UyAocG9zKSA+PSBCRUdWICYmIENIQVJQT1MgKHBvcykgPD0gWlYgKi8KKyAgYm9vbCBiYXJmX2Ny YXNoX3R3byA9IChjaGFycG9zID49IEJFR1YgJiYgY2hhcnBvcyA8PSBaVikKKyAgICAgICAgICAg ICAgICAgICAgICAgICA/IGZhbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgOiB0cnVlOwor ICBpZiAoYmFyZl9jcmFzaF90d28pCisgICAgcmV0dXJuIGhzY3JvbGxlZF9wOworCisvKiBlbmQg TVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICAg IC8qIE1vdmUgaXRlcmF0b3IgdG8gcHQgc3RhcnRpbmcgYXQgY3Vyc29yX3Jvdy0+c3RhcnQgaW4K IAkJIGEgbGluZSB3aXRoIGluZmluaXRlIHdpZHRoLiAgKi8KIAkgICAgICBpbml0X3RvX3Jvd19z dGFydCAoJml0LCB3LCBjdXJzb3Jfcm93KTsKQEAgLTE0Mjg3LDkgKzE4OTc4LDIyIEBAIHJlZGlz cGxheV9pbnRlcm5hbCAodm9pZCkKIAkgICAgICAqdy0+ZGVzaXJlZF9tYXRyaXgtPm1ldGhvZCA9 IDA7CiAJICAgICAgZGVidWdfbWV0aG9kX2FkZCAodywgIm9wdGltaXphdGlvbiAxIik7CiAjZW5k aWYKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KwogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQorICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMp CisgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJz KSkpCisgICAgbWNfdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCBmYWxzZSk7CisgICAgZWxzZQog CSAgICAgIHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgZmFsc2UpOwogI2VuZGlmCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgICBnb3RvIHVwZGF0ZTsKIAkgICAgfQogCSAg ZWxzZQpAQCAtMTc2ODcsMTAgKzIyMzkxLDIyIEBAIHJlZGlzcGxheV93aW5kb3cgKExpc3BfT2Jq ZWN0IHdpbmRvdywgYm9vbCBqdXN0X3RoaXNfb25lX3ApCiAgICAgfQogCiAjaWZkZWYgSEFWRV9X SU5ET1dfU1lTVEVNCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1D VVJTT1JTICovCisKKyAgYm9vbCBrZWVwX2N1cnJlbnRfcCA9IChqdXN0X3RoaXNfb25lX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICB8fCAoIXVzZWRfY3VycmVudF9tYXRyaXhfcCAmJiAhb3Zl cmxheV9hcnJvd19zZWVuKQorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IHctPnBzZXVkb193 aW5kb3dfcCk7CisKKyAgYm9vbCBmcmluZ2VzX3VwZGF0ZWRfcCA9IChCVUZGRVJQICh3LT5jb250 ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywga2VlcF9jdXJyZW50X3ApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywga2VlcF9jdXJy ZW50X3ApOworCiAgIGlmIChGUkFNRV9XSU5ET1dfUCAoZikKLSAgICAgICYmIHVwZGF0ZV93aW5k b3dfZnJpbmdlcyAodywgKGp1c3RfdGhpc19vbmVfcAotCQkJCSAgICB8fCAoIXVzZWRfY3VycmVu dF9tYXRyaXhfcCAmJiAhb3ZlcmxheV9hcnJvd19zZWVuKQotCQkJCSAgICB8fCB3LT5wc2V1ZG9f d2luZG93X3ApKSkKKyAgICAgICYmIGZyaW5nZXNfdXBkYXRlZF9wKQogICAgIHsKICAgICAgIHVw ZGF0ZV9iZWdpbiAoZik7CiAgICAgICBibG9ja19pbnB1dCAoKTsKQEAgLTE3NzA1LDYgKzIyNDIx LDkgQEAgcmVkaXNwbGF5X3dpbmRvdyAoTGlzcF9PYmplY3Qgd2luZG93LCBib29sIGp1c3RfdGhp c19vbmVfcCkKICAgICAgIHVwZGF0ZV9lbmQgKGYpOwogICAgIH0KIAorLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogICBpZiAoV0lORE9XX0JPVFRPTV9ESVZJREVSX1dJRFRIICh3KSkKICAg ICB4X2RyYXdfYm90dG9tX2RpdmlkZXIgKHcpOwogI2VuZGlmIC8qIEhBVkVfV0lORE9XX1NZU1RF TSAqLwpAQCAtMTgwMTAsNiArMjI3MjksNyBAQCB0cnlfd2luZG93X3JldXNpbmdfY3VycmVudF9t YXRyaXggKHN0cnVjdCB3aW5kb3cgKncpCiAJICAgICBzY3JvbGxfcnVuX2hvb2sgd2lsbCBjbGVh ciB0aGUgY3Vyc29yLCBhbmQgdXNlIHRoZQogCSAgICAgY3VycmVudCBtYXRyaXggdG8gZ2V0IHRo ZSBoZWlnaHQgb2YgdGhlIHJvdyB0aGUgY3Vyc29yIGlzCiAJICAgICBpbi4gICovCisKIAkgIHJ1 bi5jdXJyZW50X3kgPSBzdGFydF9yb3ctPnk7CiAJICBydW4uZGVzaXJlZF95ID0gaXQuY3VycmVu dF95OwogCSAgcnVuLmhlaWdodCA9IGl0Lmxhc3RfdmlzaWJsZV95IC0gaXQuY3VycmVudF95OwpA QCAtMTgwMTksNiArMjI3MzksMTYgQEAgdHJ5X3dpbmRvd19yZXVzaW5nX2N1cnJlbnRfbWF0cml4 IChzdHJ1Y3Qgd2luZG93ICp3KQogCSAgICAgIHVwZGF0ZV9iZWdpbiAoZik7CiAJICAgICAgRlJB TUVfUklGIChmKS0+dXBkYXRlX3dpbmRvd19iZWdpbl9ob29rICh3KTsKIAkgICAgICBGUkFNRV9S SUYgKGYpLT5jbGVhcl93aW5kb3dfbW91c2VfZmFjZSAodyk7CisKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBtY19wcmVfc2Nyb2xsX2Ns ZWFuICh3LCBydW4sIHN0YXJ0X3Zwb3MsIG5yb3dzX3Njcm9sbGVkLCBUUllfV0lORE9XX1JFVVNJ TkdfQ1VSUkVOVF9NQVRSSVhfRE9XTik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IAkgICAgICBGUkFNRV9SSUYgKGYpLT5zY3JvbGxfcnVuX2hvb2sgKHcsICZydW4pOwogCSAgICAg IEZSQU1FX1JJRiAoZiktPnVwZGF0ZV93aW5kb3dfZW5kX2hvb2sgKHcsIGZhbHNlLCBmYWxzZSk7 CiAJICAgICAgdXBkYXRlX2VuZCAoZik7CkBAIC0xODE3Myw2ICsyMjkwMyw3IEBAIHRyeV93aW5k b3dfcmV1c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRvdyAqdykKIAl9CiAKICAgICAg IC8qIFNjcm9sbCB0aGUgZGlzcGxheS4gICovCisKICAgICAgIHJ1bi5jdXJyZW50X3kgPSBmaXJz dF9yZXVzYWJsZV9yb3ctPnk7CiAgICAgICBydW4uZGVzaXJlZF95ID0gV0lORE9XX0hFQURFUl9M SU5FX0hFSUdIVCAodyk7CiAgICAgICBydW4uaGVpZ2h0ID0gaXQubGFzdF92aXNpYmxlX3kgLSBy dW4uY3VycmVudF95OwpAQCAtMTgxODMsNiArMjI5MTQsMTYgQEAgdHJ5X3dpbmRvd19yZXVzaW5n X2N1cnJlbnRfbWF0cml4IChzdHJ1Y3Qgd2luZG93ICp3KQogCSAgdXBkYXRlX2JlZ2luIChmKTsK IAkgIEZSQU1FX1JJRiAoZiktPnVwZGF0ZV93aW5kb3dfYmVnaW5faG9vayAodyk7CiAJICBGUkFN RV9SSUYgKGYpLT5jbGVhcl93aW5kb3dfbW91c2VfZmFjZSAodyk7CisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBtY19wcmVfc2Nyb2xs X2NsZWFuICh3LCBydW4sIHN0YXJ0X3Zwb3MsIG5yb3dzX3Njcm9sbGVkLCBUUllfV0lORE9XX1JF VVNJTkdfQ1VSUkVOVF9NQVRSSVhfVVApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAJICBGUkFNRV9SSUYgKGYpLT5zY3JvbGxfcnVuX2hvb2sgKHcsICZydW4pOwogCSAgRlJBTUVf UklGIChmKS0+dXBkYXRlX3dpbmRvd19lbmRfaG9vayAodywgZmFsc2UsIGZhbHNlKTsKIAkgIHVw ZGF0ZV9lbmQgKGYpOwpAQCAtMTkxMjcsNiArMjM4NjgsNyBAQCB0cnlfd2luZG93X2lkIChzdHJ1 Y3Qgd2luZG93ICp3KQogICAvKiBTY3JvbGwgdGhlIGRpc3BsYXkuICBEbyBpdCBiZWZvcmUgY2hh bmdpbmcgdGhlIGN1cnJlbnQgbWF0cml4IHNvCiAgICAgIHRoYXQgeHRlcm0uYyBkb2Vzbid0IGdl dCBjb25mdXNlZCBhYm91dCB3aGVyZSB0aGUgY3Vyc29yIGdseXBoIGlzCiAgICAgIGZvdW5kLiAg Ki8KKwogICBpZiAoZHkgJiYgcnVuLmhlaWdodCkKICAgICB7CiAgICAgICB1cGRhdGVfYmVnaW4g KGYpOwpAQCAtMTkxMzUsNiArMjM4NzcsMTYgQEAgdHJ5X3dpbmRvd19pZCAoc3RydWN0IHdpbmRv dyAqdykKIAl7CiAJICBGUkFNRV9SSUYgKGYpLT51cGRhdGVfd2luZG93X2JlZ2luX2hvb2sgKHcp OwogCSAgRlJBTUVfUklGIChmKS0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOworCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgbWNf cHJlX3Njcm9sbF9jbGVhbiAodywgcnVuLCBmaXJzdF91bmNoYW5nZWRfYXRfZW5kX3Zwb3MsIGR2 cG9zLCBUUllfV0lORE9XX0lEKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAg RlJBTUVfUklGIChmKS0+c2Nyb2xsX3J1bl9ob29rICh3LCAmcnVuKTsKIAkgIEZSQU1FX1JJRiAo ZiktPnVwZGF0ZV93aW5kb3dfZW5kX2hvb2sgKHcsIGZhbHNlLCBmYWxzZSk7CiAJfQpAQCAtMjAx MzMsNiArMjQ4ODUsMTcgQEAgYXBwZW5kX3NwYWNlX2Zvcl9uZXdsaW5lIChzdHJ1Y3QgaXQgKml0 LCBib29sIGRlZmF1bHRfZmFjZV9wKQogCSAgbWVtc2V0ICgmaXQtPnBvc2l0aW9uLCAwLCBzaXpl b2YgaXQtPnBvc2l0aW9uKTsKIAkgIGl0LT5vYmplY3QgPSBRbmlsOwogCSAgaXQtPmMgPSBpdC0+ Y2hhcl90b19kaXNwbGF5ID0gJyAnOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBpZiAoSVRfQllURVBPUyAoKml0KSA+PSBaVl9C WVRFKQorICAgICAgICBpdC0+enZfcCA9IHRydWU7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKIAkgIGl0LT5sZW4gPSAxOwogCiAJICAvKiBJZiB0aGUgZGVmYXVsdCBmYWNlIHdhcyBy ZW1hcHBlZCwgYmUgc3VyZSB0byB1c2UgdGhlCkBAIC0yMTI2OSw5ICsyNjAzMiwyMiBAQCBtYXli ZV9wcm9kdWNlX2xpbmVfbnVtYmVyIChzdHJ1Y3QgaXQgKml0KQogICAgICAgZWxzZQogCXRlbV9p dC5jID0gdGVtX2l0LmNoYXJfdG9fZGlzcGxheSA9ICpwOwogICAgICAgdGVtX2l0LmxlbiA9IDE7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgICAgIGlmIChiZXlvbmRfenYpCisgICAgICAgIHRlbV9pdC56dl9wID0gdHJ1ZTsKKyAgICAg IHRlbV9pdC5jdXJyZW50X3kgPSBpdC0+Y3VycmVudF95OworICAgICAgdGVtX2l0LnZwb3MgPSBp dC0+dnBvczsKICAgICAgIC8qIE1ha2Ugc3VyZSB0aGVzZSBnbHlwaHMgd2lsbCBoYXZlIGEgInBv c2l0aW9uIiBvZiAtMS4gICovCiAgICAgICBTRVRfVEVYVF9QT1MgKHRlbV9pdC5wb3NpdGlvbiwg LTEsIC0xKTsKICAgICAgIFBST0RVQ0VfR0xZUEhTICgmdGVtX2l0KTsKKyAgICAgIHRlbV9pdC5o cG9zICs9IDE7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiAKICAgICAgIC8qIFN0b3Ag cHJvZHVjaW5nIGdseXBocywgYW5kIHJlZnJhaW4gZnJvbSBwcm9kdWNpbmcgdGhlIGxpbmUKIAkg bnVtYmVyLCBpZiB3ZSBkb24ndCBoYXZlIGVub3VnaCBzcGFjZSBvbiB0aGlzIGxpbmUuICAqLwpA QCAtMjEyODQsNiArMjYwNjAsMzAgQEAgbWF5YmVfcHJvZHVjZV9saW5lX251bWJlciAoc3RydWN0 IGl0ICppdCkKIAl9CiAgICAgfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgIExpc3BfT2JqZWN0IGJ1ZiA9IGl0LT53LT5jb250ZW50czsK KyAgQ0hFQ0tfQlVGRkVSIChidWYpOworICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVm KTsKKyAgc3RydWN0IGJ1ZmZlciAqb2xkX2J1ZmZlciA9IE5VTEw7CisgIC8qIE5lZWRlZCBzbyB0 aGF0IGJ1ZmZlci1sb2NhbCB2YWx1ZXMgY2FuIGJlIGRldGVybWluZWQ7IGUuZy4sIHdoZW4gc3dp dGNoaW5nCisgIHRvIHRoZSBtaW5pYnVmZmVyLiAqLworICBpZiAoYiAhPSBjdXJyZW50X2J1ZmZl cikKKyAgICB7CisgICAgICBvbGRfYnVmZmVyID0gY3VycmVudF9idWZmZXI7CisgICAgICBzZXRf YnVmZmVyX2ludGVybmFsIChiKTsKKyAgICB9CisgIGl0LT53LT5tYy5sbnVtX3BpeGVsX3dpZHRo ID0gKCFOSUxQIChWZGlzcGxheV9saW5lX251bWJlcnMpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gdGVtX2l0LmN1cnJlbnRfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogMDsKKyAgaWYgKG9sZF9idWZmZXIpCisgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xk X2J1ZmZlcik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogUmVjb3JkIHRo ZSB3aWR0aCBpbiBwaXhlbHMgd2UgbmVlZCBmb3IgdGhlIGxpbmUgbnVtYmVyIGRpc3BsYXkuICAq LwogICBpdC0+bG51bV9waXhlbF93aWR0aCA9IHRlbV9pdC5jdXJyZW50X3g7CiAgIC8qIENvcHkg dGhlIHByb2R1Y2VkIGdseXBocyBpbnRvIElUJ3MgZ2x5cGhfcm93LiAgKi8KQEAgLTI3MDkyLDYg KzMxODkyLDIxIEBAIGFwcGVuZF9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAkgICAgZ1sxXSA9ICpn OwogCSAgZ2x5cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYV07CiAJfQorCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlw aC0+eCA9IGl0LT5jdXJyZW50X3g7CisgICAgICBnbHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7Cisg ICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBv czsKKyAgICAgIGdseXBoLT56dl9wID0gaXQtPnp2X3A7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9 IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAg IGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5v YmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgaWYgKGl0LT5waXhlbF93aWR0aCA+IDApCkBAIC0y NzE3NSw2ICszMTk5MCwyMSBAQCBhcHBlbmRfY29tcG9zaXRlX2dseXBoIChzdHJ1Y3QgaXQgKml0 KQogCSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1tpdC0+ YXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7CisgICAgICBnbHlwaC0+ eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAg Z2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKyAgICAgIGdseXBoLT56dl9wID0gaXQtPnp2X3A7Cisg ICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gaXQtPmNtcF9pdC5jaGFycG9z OwogICAgICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBlYXNzZXJ0IChpdC0+ cGl4ZWxfd2lkdGggPD0gU0hSVF9NQVgpOwpAQCAtMjczODMsNiArMzIyMTMsMjEgQEAgcHJvZHVj ZV9pbWFnZV9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgICBpZiAoZ2x5cGggPCBpdC0+ Z2x5cGhfcm93LT5nbHlwaHNbYXJlYSArIDFdKQogCXsKKworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPnggPSBpdC0+Y3Vy cmVudF94OworICAgICAgZ2x5cGgtPnkgPSBpdC0+Y3VycmVudF95OworICAgICAgZ2x5cGgtPmhw b3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT52cG9zID0gaXQtPnZwb3M7CisgICAgICBnbHlw aC0+enZfcCA9IGl0LT56dl9wOworICAgICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgq aXQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICBnbHlwaC0+Y2hhcnBvcyA9 IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAJICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsK IAkgIGdseXBoLT5waXhlbF93aWR0aCA9IGNsaXBfdG9fYm91bmRzICgtMSwgaXQtPnBpeGVsX3dp ZHRoLCBTSFJUX01BWCk7CkBAIC0yNzQ4Niw2ICszMjMzMSwyMSBAQCBwcm9kdWNlX3h3aWRnZXRf Z2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJfQogICAgICAgaWYgKGdseXBoIDwgaXQtPmdseXBoX3Jv dy0+Z2x5cGhzW2FyZWEgKyAxXSkKIAl7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT54ID0gaXQtPmN1cnJlbnRfeDsK KyAgICAgIGdseXBoLT55ID0gaXQtPmN1cnJlbnRfeTsKKyAgICAgIGdseXBoLT5ocG9zID0gaXQt Pmhwb3M7CisgICAgICBnbHlwaC0+dnBvcyA9IGl0LT52cG9zOworICAgICAgZ2x5cGgtPnp2X3Ag PSBpdC0+enZfcDsKKyAgICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9T IChpdC0+cG9zaXRpb24pOwogCSAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAJICBnbHlw aC0+cGl4ZWxfd2lkdGggPSBjbGlwX3RvX2JvdW5kcyAoLTEsIGl0LT5waXhlbF93aWR0aCwgU0hS VF9NQVgpOwpAQCAtMjc1NzIsNiArMzI0MzIsMjEgQEAgYXBwZW5kX3N0cmV0Y2hfZ2x5cGggKHN0 cnVjdCBpdCAqaXQsIExpc3BfT2JqZWN0IG9iamVjdCwKIAkgICAgd2lkdGggLT0gaXQtPmZpcnN0 X3Zpc2libGVfeCAtIGl0LT5jdXJyZW50X3g7CiAJICBlYXNzZXJ0ICh3aWR0aCA+IDApOwogCX0K KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICAgICAgZ2x5cGgtPnggPSBpdC0+Y3VycmVudF94OworICAgICAgZ2x5cGgtPnkgPSBpdC0+Y3Vy cmVudF95OworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT52cG9z ID0gaXQtPnZwb3M7CisgICAgICBnbHlwaC0+enZfcCA9IGl0LT56dl9wOworICAgICAgZ2x5cGgt PmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAgICAg ICBnbHlwaC0+b2JqZWN0ID0gb2JqZWN0OwogICAgICAgLyogRklYTUU6IEl0IHdvdWxkIGJlIGJl dHRlciB0byB1c2UgVFlQRV9NQVggaGVyZSwgYnV0CkBAIC0yODAyNiw2ICszMjkwMSwyMSBAQCBh cHBlbmRfZ2x5cGhsZXNzX2dseXBoIChzdHJ1Y3QgaXQgKml0LCBpbnQgZmFjZV9pZCwgYm9vbCBm b3Jfbm9fZm9udCwgaW50IGxlbiwKIAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGggPSBpdC0+Z2x5 cGhfcm93LT5nbHlwaHNbYXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7 CisgICAgICBnbHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICBnbHlwaC0+aHBvcyA9IGl0 LT5ocG9zOworICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKyAgICAgIGdseXBoLT56dl9w ID0gaXQtPnp2X3A7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gQ0hB UlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0Owog ICAgICAgZWFzc2VydCAoaXQtPnBpeGVsX3dpZHRoIDw9IFNIUlRfTUFYKTsKQEAgLTI5MDc2LDEw ICszMzk2NiwzNSBAQCB4X2luc2VydF9nbHlwaHMgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBn bHlwaF9yb3cgKnVwZGF0ZWRfcm93LAogCiAgIC8qIFdyaXRlIHRoZSBnbHlwaHMuICAqLwogICBo cG9zID0gc3RhcnQgLSByb3ctPmdseXBoc1t1cGRhdGVkX2FyZWFdOworCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmICgody0+bWNfbWF0 cml4LmN1cnNvcnNfdXNlZFtNQ19DQUNIRV0gPiAwCisgICAgICAgfHwgdy0+bWNfbWF0cml4LmN1 cnNvcnNfdXNlZFtDSF9DQUNIRV0gPiAwCisgICAgICAgfHwgdy0+bWNfbWF0cml4LmN1cnNvcnNf dXNlZFtGQ19DQUNIRV0gPiAwKQorICAgICAgJiYgdXBkYXRlZF9hcmVhID09IFRFWFRfQVJFQSkK KyAgICB7CisgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21h dHJpeDsKKyAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7Cisg ICAgICBpbnQgc3RhcnRfeCA9IHctPm91dHB1dF9jdXJzb3IueDsKKyAgICAgIGludCBzdGFydF9o cG9zID0gaHBvczsKKyAgICAgIGludCBlbmRfaHBvcyA9IGhwb3MgKyBsZW47CisgICAgICBib29s IGNsZWFyX2VvbF9wID0gZmFsc2U7CisgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UgaGwgPSBE UkFXX05PUk1BTF9URVhUOworICAgICAgVFJBQ0UgKChzdGRlcnIsICJ4X2luc2VydF9nbHlwaHMg KCVkKTogIHN0YXJ0X3ggKCVkKSB8IHN0YXJ0X2hwb3MgKCVkKSB8IGVuZF9ocG9zICglZClcbiIs CisgICAgICAgICAgICAgICAgICAgICAgdnBvcywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hw b3MpKTsKKyAgICAgIG1jX3JlZHJhd19yb3cgKHcsIG1hdHJpeCwgcm93LCBzdGFydF94LCBzdGFy dF9ocG9zLCBlbmRfaHBvcywgY2xlYXJfZW9sX3AsIGhsKTsKKyAgICB9CisgICAgZWxzZQogICBk cmF3X2dseXBocyAodywgdy0+b3V0cHV0X2N1cnNvci54LCByb3csIHVwZGF0ZWRfYXJlYSwKIAkg ICAgICAgaHBvcywgaHBvcyArIGxlbiwKIAkgICAgICAgRFJBV19OT1JNQUxfVEVYVCwgMCk7CiAK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogQWR2YW5jZSB0aGUgb3V0cHV0IGN1 cnNvci4gICovCiAgIHctPm91dHB1dF9jdXJzb3IuaHBvcyArPSBsZW47CiAgIHctPm91dHB1dF9j dXJzb3IueCArPSBzaGlmdF9ieV93aWR0aDsKQEAgLTI5NTA1LDkgKzM0NDIwLDMzIEBAIHhfZml4 X292ZXJsYXBwaW5nX2FyZWEgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJv dywKIAkgIHdoaWxlIChpIDwgcm93LT51c2VkW2FyZWFdCiAJCSAmJiByb3ctPmdseXBoc1thcmVh XVtpXS5vdmVybGFwc192ZXJ0aWNhbGx5X3ApOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICAgIGlmICgody0+bWNfbWF0cml4LmN1 cnNvcnNfdXNlZFtNQ19DQUNIRV0gPiAwCisgICAgICAgICAgICAgfHwgdy0+bWNfbWF0cml4LmN1 cnNvcnNfdXNlZFtDSF9DQUNIRV0gPiAwCisgICAgICAgICAgICAgfHwgdy0+bWNfbWF0cml4LmN1 cnNvcnNfdXNlZFtGQ19DQUNIRV0gPiAwKQorICAgICAgICAgICAgJiYgYXJlYSA9PSBURVhUX0FS RUEpCisgICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4 ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1df VlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAgICAgaW50IHN0YXJ0X2hwb3MgPSBzdGFydDsK KyAgICAgICAgICAgIGludCBlbmRfaHBvcyA9IGk7CisgICAgICAgICAgICBib29sIGNsZWFyX2Vv bF9wID0gZmFsc2U7CisgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UgaGwgPSBEUkFX X05PUk1BTF9URVhUOworICAgICAgICAgICAgVFJBQ0UgKChzdGRlcnIsICJ4X2ZpeF9vdmVybGFw cGluZ19hcmVhICglZCk6ICBzdGFydF94ICglZCkgfCBzdGFydF9ocG9zICglZCkgfCBlbmRfaHBv cyAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIHN0YXJ0X3gsIHN0 YXJ0X2hwb3MsIGVuZF9ocG9zKSk7CisgICAgICAgICAgICBtY19yZWRyYXdfcm93ICh3LCBtYXRy aXgsIHJvdywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGNsZWFyX2VvbF9wLCBobCk7 CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKIAkgIGRyYXdfZ2x5cGhzICh3LCBzdGFydF94 LCByb3csIGFyZWEsCiAJCSAgICAgICBzdGFydCwgaSwKIAkJICAgICAgIERSQVdfTk9STUFMX1RF WFQsIG92ZXJsYXBzKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCX0KICAgICAg IGVsc2UKIAl7CkBAIC0yOTc1OCwxMCArMzQ2OTcsMTcgQEAgZGlzcGxheV9hbmRfc2V0X2N1cnNv ciAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBvbiwKICAgbmV3X2N1cnNvcl90eXBlID0gZ2V0X3dp bmRvd19jdXJzb3JfdHlwZSAodywgZ2x5cGgsCiAJCQkJCSAgICAmbmV3X2N1cnNvcl93aWR0aCwg JmFjdGl2ZV9jdXJzb3IpOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCiAgIC8qIElmIGN1cnNvciBpcyBjdXJyZW50bHkgYmVpbmcgc2hvd24g YW5kIHdlIGRvbid0IHdhbnQgaXQgdG8gYmUgb3IKICAgICAgaXQgaXMgaW4gdGhlIHdyb25nIHBs YWNlLCBvciB0aGUgY3Vyc29yIHR5cGUgaXMgbm90IHdoYXQgd2Ugd2FudCwKICAgICAgZXJhc2Ug aXQuICAqLwogICBpZiAody0+cGh5c19jdXJzb3Jfb25fcAorICAgICAgJiYgTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmIE5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAmJiBOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQogICAgICAgJiYgKCFvbgogCSAgfHwg dy0+cGh5c19jdXJzb3IueCAhPSB4CiAJICB8fCB3LT5waHlzX2N1cnNvci55ICE9IHkKQEAgLTI5 Nzc0LDYgKzM0NzIwLDkgQEAgZGlzcGxheV9hbmRfc2V0X2N1cnNvciAoc3RydWN0IHdpbmRvdyAq dywgYm9vbCBvbiwKIAkgICAgICAmJiBuZXdfY3Vyc29yX3dpZHRoICE9IHctPnBoeXNfY3Vyc29y X3dpZHRoKSkpCiAgICAgZXJhc2VfcGh5c19jdXJzb3IgKHcpOwogCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAgIC8qIERvbid0IGNoZWNrIHBoeXNfY3Vyc29yX29uX3AgaGVyZSBiZWNh dXNlIHRoYXQgZmxhZyBpcyBvbmx5IHNldAogICAgICB0byBmYWxzZSBpbiBzb21lIGNhc2VzIHdo ZXJlIHdlIGtub3cgdGhhdCB0aGUgY3Vyc29yIGhhcyBiZWVuCiAgICAgIGNvbXBsZXRlbHkgZXJh c2VkLCB0byBhdm9pZCB0aGUgZXh0cmEgd29yayBvZiBlcmFzaW5nIHRoZSBjdXJzb3IKQEAgLTI5 NzkyLDkgKzM0NzQxLDE5IEBAIGRpc3BsYXlfYW5kX3NldF9jdXJzb3IgKHN0cnVjdCB3aW5kb3cg KncsIGJvb2wgb24sCiAgICAgICB3LT5waHlzX2N1cnNvci52cG9zID0gdnBvczsKICAgICB9CiAK LSAgRlJBTUVfUklGIChmKS0+ZHJhd193aW5kb3dfY3Vyc29yICh3LCBnbHlwaF9yb3csIHgsIHks Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2N1cnNvcl90eXBlLCBu ZXdfY3Vyc29yX3dpZHRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9u LCBhY3RpdmVfY3Vyc29yKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKyAgaWYgKE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg Y3Jvc3NoYWlycykpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGZjX3Zpc2libGUpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBtY19jb25mKSkpCisgICAgRlJBTUVfUklGIChmKS0+ZHJhd193aW5kb3dfY3Vyc29yICh3LCBn bHlwaF9yb3csIHgsIHksIG5ld19jdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIG5ld19jdXJzb3Jfd2lkdGgsIG9uLCBhY3RpdmVfY3Vyc29yKTsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAKQEAgLTI5ODg3LDcgKzM0ODQ2LDI5 IEBAIGRyYXdfcm93X3dpdGhfbW91c2VfZmFjZSAoc3RydWN0IHdpbmRvdyAqdywgaW50IHN0YXJ0 X3gsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KICAg aWYgKEZSQU1FX1dJTkRPV19QIChYRlJBTUUgKHctPmZyYW1lKSkpCiAgICAgeworCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBpZiAo dy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtNQ19DQUNIRV0gPiAwCisgICAgICAgICAgfHwgdy0+ bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtDSF9DQUNIRV0gPiAwCisgICAgICAgICAgfHwgdy0+bWNf bWF0cml4LmN1cnNvcnNfdXNlZFtGQ19DQUNIRV0gPiAwKQorICAgICAgICB7CisgICAgICAgICAg c3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAg ICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAgICBi b29sIGNsZWFyX2VvbF9wID0gZmFsc2U7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNl IGhsID0gZHJhdzsKKyAgICAgICAgICBUUkFDRSAoKHN0ZGVyciwgImRyYXdfcm93X3dpdGhfbW91 c2VfZmFjZSAoJWQpOiAgc3RhcnRfeCAoJWQpIHwgc3RhcnRfaHBvcyAoJWQpIHwgZW5kX2hwb3Mg KCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgc3RhcnRfeCwgc3RhcnRf aHBvcywgZW5kX2hwb3MpKTsKKyAgICAgICAgICBtY19yZWRyYXdfcm93ICh3LCBtYXRyaXgsIHJv dywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGNsZWFyX2VvbF9wLCBobCk7CisgICAg ICAgIH0KKyAgICAgICAgZWxzZQogICAgICAgZHJhd19nbHlwaHMgKHcsIHN0YXJ0X3gsIHJvdywg VEVYVF9BUkVBLCBzdGFydF9ocG9zLCBlbmRfaHBvcywgZHJhdywgMCk7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICAgICAgIHJldHVybjsKICAgICB9CiAjZW5kaWYKQEAgLTMxOTQ1 LDExICszNjkyNiwzNiBAQCBleHBvc2VfYXJlYSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGds eXBoX3JvdyAqcm93LCBYUmVjdGFuZ2xlICpyLAogICBzdHJ1Y3QgZ2x5cGggKmxhc3Q7CiAgIGlu dCBmaXJzdF94LCBzdGFydF94LCB4OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCiAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiByb3ctPmZp bGxfbGluZV9wKQorICAgIHsKKyAgICAgIGlmICh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01D X0NBQ0hFXSA+IDAKKyAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NB Q0hFXSA+IDAKKyAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NBQ0hF XSA+IDApCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgg PSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBP UyAocm93LCBtYXRyaXgpOworICAgICAgICAgIGludCBzdGFydF94ID0gMDsKKyAgICAgICAgICBp bnQgc3RhcnRfaHBvcyA9IDA7CisgICAgICAgICAgaW50IGVuZF9ocG9zID0gcm93LT51c2VkW1RF WFRfQVJFQV07CisgICAgICAgICAgYm9vbCBjbGVhcl9lb2xfcCA9IGZhbHNlOworICAgICAgICAg IGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCA9IERSQVdfTk9STUFMX1RFWFQ7CisgICAgICAgICAg VFJBQ0UgKChzdGRlcnIsICJleHBvc2VfYXJlYSAoJWQpOiAgV3JpdGUgdGhlIHdob2xlIGxpbmUu XG4iLCB2cG9zKSk7CisgICAgICAgICAgbWNfcmVkcmF3X3JvdyAodywgbWF0cml4LCByb3csIHN0 YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBjbGVhcl9lb2xfcCwgaGwpOworICAgICAgICB9 CisgICAgICAgIGVsc2UKICAgICAvKiBJZiByb3cgZXh0ZW5kcyBmYWNlIHRvIGVuZCBvZiBsaW5l IHdyaXRlIHRoZSB3aG9sZSBsaW5lLiAgKi8KICAgICBkcmF3X2dseXBocyAodywgMCwgcm93LCBh cmVhLAogCQkgMCwgcm93LT51c2VkW2FyZWFdLAogCQkgRFJBV19OT1JNQUxfVEVYVCwgMCk7Cisg ICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIGVsc2UKICAgICB7CiAgICAg ICAvKiBTZXQgU1RBUlRfWCB0byB0aGUgd2luZG93LXJlbGF0aXZlIHN0YXJ0IHBvc2l0aW9uIGZv ciBkcmF3aW5nIGdseXBocyBvZgpAQCAtMzE5ODEsMTEgKzM2OTg3LDM2IEBAIGV4cG9zZV9hcmVh IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIFhSZWN0YW5nbGUgKnIs CiAJICArK2xhc3Q7CiAJfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCiAgICAgICAvKiBSZXBhaW50LiAgKi8KLSAgICAgIGlmIChsYXN0ID4g Zmlyc3QpCisgICAgICAvKiBGbG9hdGluZyBmYWtlIGN1cnNvcnMgd2lsbCBleGlzdCB3aGVuIChs YXN0ID09IGZpcnN0KS4gKi8KKyAgICAgIGlmICgody0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtN Q19DQUNIRV0gPiAwCisgICAgICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hf Q0FDSEVdID4gMAorICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NB Q0hFXSA+IDApCisgICAgICAgICAgJiYgYXJlYSA9PSBURVhUX0FSRUEpCisgICAgICAgIHsKKyAg ICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsK KyAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAg ICAgICAgIHN0YXJ0X3ggPSBmaXJzdF94IC0gc3RhcnRfeDsKKyAgICAgICAgICBpbnQgc3RhcnRf aHBvcyA9IGZpcnN0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICBpbnQgZW5k X2hwb3MgPSBsYXN0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICBib29sIGNs ZWFyX2VvbF9wID0gZmFsc2U7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIGhsID0g RFJBV19OT1JNQUxfVEVYVDsKKyAgICAgICAgICBUUkFDRSAoKHN0ZGVyciwgImV4cG9zZV9hcmVh ICglZCk6ICBzdGFydF94ICglZCkgfCBzdGFydF9ocG9zICglZCkgfCBlbmRfaHBvcyAoJWQpXG4i LAorICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCBzdGFydF94LCBzdGFydF9ocG9zLCBl bmRfaHBvcykpOworICAgICAgICAgIG1jX3JlZHJhd19yb3cgKHcsIG1hdHJpeCwgcm93LCBzdGFy dF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcywgY2xlYXJfZW9sX3AsIGhsKTsKKyAgICAgICAgfQor ICAgICAgICBlbHNlIGlmIChsYXN0ID4gZmlyc3QpCiAJZHJhd19nbHlwaHMgKHcsIGZpcnN0X3gg LSBzdGFydF94LCByb3csIGFyZWEsCiAJCSAgICAgZmlyc3QgLSByb3ctPmdseXBoc1thcmVhXSwg bGFzdCAtIHJvdy0+Z2x5cGhzW2FyZWFdLAogCQkgICAgIERSQVdfTk9STUFMX1RFWFQsIDApOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgfQogfQogCkBAIC0zMTk5OSwxMCAr MzcwMzAsMzUgQEAgZXhwb3NlX2xpbmUgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9y b3cgKnJvdywgWFJlY3RhbmdsZSAqcikKIHsKICAgZWFzc2VydCAocm93LT5lbmFibGVkX3ApOwog CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAg IGlmIChyb3ctPm1vZGVfbGluZV9wIHx8IHctPnBzZXVkb193aW5kb3dfcCkKKyAgICB7CisgICAg ICBpZiAody0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtNQ19DQUNIRV0gPiAwCisgICAgICAgICAg fHwgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtDSF9DQUNIRV0gPiAwCisgICAgICAgICAgfHwg dy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtGQ19DQUNIRV0gPiAwKQorICAgICAgICB7CisgICAg ICAgICAgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7Cisg ICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAg ICAgICBpbnQgc3RhcnRfeCA9IDA7CisgICAgICAgICAgaW50IHN0YXJ0X2hwb3MgPSAwOworICAg ICAgICAgIGludCBlbmRfaHBvcyA9IHJvdy0+dXNlZFtURVhUX0FSRUFdOworICAgICAgICAgIGJv b2wgY2xlYXJfZW9sX3AgPSBmYWxzZTsKKyAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ug aGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgICAgIFRSQUNFICgoc3RkZXJyLCAiZXhwb3Nl X2xpbmUgKCVkKTogIFdyaXRlIHRoZSB3aG9sZSBsaW5lLlxuIiwgdnBvcykpOworICAgICAgICAg IG1jX3JlZHJhd19yb3cgKHcsIG1hdHJpeCwgcm93LCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRf aHBvcywgY2xlYXJfZW9sX3AsIGhsKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCiAgICAgZHJh d19nbHlwaHMgKHcsIDAsIHJvdywgVEVYVF9BUkVBLAogCQkgMCwgcm93LT51c2VkW1RFWFRfQVJF QV0sCiAJCSBEUkFXX05PUk1BTF9URVhULCAwKTsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICAgZWxzZQogICAgIHsKICAgICAgIGlmIChyb3ctPnVzZWRbTEVGVF9NQVJH SU5fQVJFQV0pCkBAIC0zMjU1MCw2ICszNzYwNiwyMiBAQCB4X2ludGVyc2VjdF9yZWN0YW5nbGVz IChYUmVjdGFuZ2xlICpyMSwgWFJlY3RhbmdsZSAqcjIsIFhSZWN0YW5nbGUgKnJlc3VsdCkKIHZv aWQKIHN5bXNfb2ZfeGRpc3AgKHZvaWQpCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZGVmc3ViciAoJlNtY19kdW1wX2dseXBoX3Jv dyk7CisKKyAgZGVmc3ViciAoJlNtY19kdW1wX2dseXBoX21hdHJpeCk7CisKKyAgZGVmc3ViciAo JlNtY19jdXJyZW50X2NvbHVtbik7CisKKyAgZGVmc3ViciAoJlNtY19zdGRlcnIpOworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgIFZ3aXRoX2VjaG9fYXJlYV9zYXZlX3ZlY3RvciA9 IFFuaWw7CiAgIHN0YXRpY3BybyAoJlZ3aXRoX2VjaG9fYXJlYV9zYXZlX3ZlY3Rvcik7CiAKZGlm ZiAtLWdpdCBhL3NyYy94dGVybS5jIGIvc3JjL3h0ZXJtLmMKaW5kZXggNWFhM2UzZi4uNjI3ZjQx YiAxMDA2NDQKLS0tIGEvc3JjL3h0ZXJtLmMKKysrIGIvc3JjL3h0ZXJtLmMKQEAgLTEzMiw2ICsx MzIsODg1IEBAIGFsb25nIHdpdGggR05VIEVtYWNzLiAgSWYgbm90LCBzZWUgPGh0dHBzOi8vd3d3 LmdudS5vcmcvbGljZW5zZXMvPi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BlbHNlCisg ICAgICAgIHsKKyAgICAgICAgICBnYyA9IFhDcmVhdGVHQyAoZHB5LCB3aW5kb3csIG1hc2ssICZ4 Z2N2KTsKKyAgICAgICAgICBGUkFNRV9ESVNQTEFZX0lORk8gKGYpLT5zY3JhdGNoX2N1cnNvcl9n YyA9IGdjOworICAgICAgICB9CisgICAgICB4X2NsaXBfdG9fcm93ICh3LCByb3csIFRFWFRfQVJF QSwgZ2MpOworICAgICAgeF9maWxsX3JlY3RhbmdsZSAoZiwgZ2MsIGZ4LCBmeSwgd2QsIGgpOwor ICAgICAgeF9yZXNldF9jbGlwX3JlY3RhbmdsZXMgKGYsIGdjKTsKKyAgICB9Cit9CisKKy8qIFJJ RjogRHJhdyBjdXJzb3Igb24gd2luZG93IFcuICovCitzdGF0aWMgdm9pZAorbWNfeF9kcmF3X3dp bmRvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJp eCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgIGludCB4 LCBpbnQgZngsIGludCB5LCBpbnQgZnksIGludCBocG9zLCBpbnQgdnBvcywgaW50IHdkLAorICAg ICAgICAgICAgICAgICAgICAgICAgIGludCBoLCBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19j dXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY3Vy c29yX3dpZHRoLCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsIGJvb2wgb25fcCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wKQoreworICBzdHJ1Y3QgZnJhbWUgKmYg PSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICAvKiBUaGUgZnJpbmdlIGJpdG1hcHMgYXJl IHByZXNlbnRseSBoYW5kbGVkIGVsc2V3aGVyZSwgYnV0I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U1MzUsIDY1NTM1ICogbHNsLnJlZCk7CisgIGNvbG9yLmdyZWVuID0gbWluICg2NTUzNSwg NjU1MzUgKiBsc2wuZ3JlZW4pOworICBjb2xvci5ibHVlID0gbWluICg2NTUzNSwgNjU1MzUgKiBs c2wuYmx1ZSk7CisgIC8qIGB4X2FsbG9jX25lYXJlc3RfY29sb3InIHNldHMgdGhlIGBjb2xvci5w aXhlbGAuICovCisgIHhfYWxsb2NfbmVhcmVzdF9jb2xvciAoZiwgY21hcCwgJmNvbG9yKTsKKyAg c3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgeworICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoK KyAgICAgIGJyZWFrOworICAgIGNhc2UgTUNfTk9fQ1VSU09SOgorICAgICAgYnJlYWs7CisgICAg Y2FzZSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOgorICAgICAgYnJlYWs7CisgICAgY2FzZSBNQ19M RUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICBicmVhazsKKyAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6 CisgICAgeworICAgICAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGggPSBtY19nZXRfY3Vyc29y X2dseXBoICh3LCBtYXRyaXgsIHJvdywgaHBvcywgdnBvcyk7CisgICAgICBpZiAoY3Vyc29yX2ds eXBoID09IE5VTEwpCisgICAgICAgIHJldHVybjsKKyAgICAgIExpc3BfT2JqZWN0IGJ1ZiA9IHct PmNvbnRlbnRzOworICAgICAgQ0hFQ0tfQlVGRkVSIChidWYpOworICAgICAgc3RydWN0IGJ1ZmZl ciAqYiA9IFhCVUZGRVIgKGJ1Zik7CisgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklM UCAoVnRyYW5zaWVudF9tYXJrX21vZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiAhTklMUCAoQlZBUiAoYiwgbWFya19hY3RpdmUpKSk7CisgICAgICBwdHJkaWZmX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ICAgICAgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiks IGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2luYWN0aXZlX2ZhY2UtPmJhY2tn cm91bmQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgYmxvY2tfaW5wdXQgKCk7 CisgICAgICAgICAgLyogRm9yY2UgYG1jX3hfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5v dXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MnLiAqLworICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3Ag PSB0cnVlOworICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywg RFJBV19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsIGxzbCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLCBjdXJzb3Jf Z2NfcCk7CisgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYt Pm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdjdi5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICBY U2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vy c29yX2djLCB4Z2N2LmJhY2tncm91bmQpOworICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7Cisg ICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3Jf cGl4ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNv bG9yLnBpeGVsOworICAgICAgICAgIG1jX3hfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgs IHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAgZi0+b3V0 cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAg ICB9CisgICAgICAgIGVsc2UgaWYgKGN1cnNvcl9nbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCAm JiBsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAg ICAgICB7CisgICAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJz b3JfcGl4ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICAgIG1jX3hfZHJhd19ob2xsb3dfY3Vy c29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7Cisg ICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJz b3JfcGl4ZWw7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJz b3JfZ2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAgICAgICAgICAgICAgZnVuY3Rpb25hbGl0eSBvZiBg eF9tYWtlX2djJyBpbiB4Zm5zLmMuICovCisgICAgICAgICAgICAgIGlmIChyZWdpb25fYWN0aXZl X3AKKyAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAmJiBj dXJzb3JfZ2x5cGgtPmNoYXJwb3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dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9yZWdpb25f ZW5kX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICAgICAgZWxzZSBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBo LT5jaGFycG9zID4gcmVnaW9uX2JlZworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vy c29yX2dseXBoLT5jaGFycG9zIDwgcmVnaW9uX2VuZCkKKyAgICAgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9i ZXR3ZWVuX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFs LWZha2UtY3Vyc29yLWluLXJlZ2lvbi1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNl ID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQp OworICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2Vf aWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29y LXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNl ICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFj ZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElT UExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNl LT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJB TUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0 aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGFjdGl2ZV9wKQorICAgICAgICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3df YWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFs LWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAg ICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9s bG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3Jv dW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhv bGxvd19hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBY U2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vy c29yX2djLCBob2xsb3dfYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQpOworICAg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BtYXRyaXgsIHJvdywgRFJBV19DVVJTT1IsIHgsIGhwb3MsIHZw b3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsc2wsIGdseXBoX2ZsYXZv ciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZS QU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdjdi5mb3Jl Z3JvdW5kKTsKKyAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAo ZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdjdi5iYWNrZ3JvdW5kKTsKKyAgICAg ICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyogRHJhdyB0aGUgZnJh bWUgYXJvdW5kIHRoZSBib3guICovCisgICAgICAgICAgICAgIG1jX3hfZHJhd19ob2xsb3dfY3Vy c29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7Cisg ICAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19IT0xMT1dfQk9Y OgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNs LmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBg Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4gKi8KKyAgICAgICAgICBmLT5vdXRwdXRf ZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICBtY194X2RyYXdf aG9sbG93X2N1cnNvci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worICAgICAgICAgIG1j X2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgRFJBV19DVVJTT1IsIHgsIGhwb3Ms IHZwb3MsIGxzbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGhfZmxhdm9y LCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgWFNl dEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9nYywgeGdjdi5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVf WF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmJhY2tncm91 bmQpOworICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgIH0KKyAgICAgICAgZWxz ZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSBmYWxzZTsKKyAg ICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgRFJBV19DVVJT T1IsIHgsIGhwb3MsIHZwb3MsIGxzbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19wKTsK KyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19CQVI6CisgICAg eworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+ PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRw dXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2lu dmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3hfZHJhd19iYXJfY3Vyc29yICh3 LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCBNQ19CQVIsIGN1cnNvcl9nY19p bnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4 ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAg ICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSBm YWxzZTsKKyAgICAgICAgICAgIG1jX3hfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywg eCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5 X3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0hCQVI6 CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wu Ymx1ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBm LT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9k YXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgIGJvb2wgY3Vyc29y X2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3hfZHJhd19iYXJfY3Vy c29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCBNQ19IQkFSLCBjdXJz b3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vy c29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVs c2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2th eV9wID0gZmFsc2U7CisgICAgICAgICAgICBtY194X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4 LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgaCwgY3Vyc29yX3dpZHRoLCBNQ19IQkFSLCBjdXJzb3JfZ2NfaW52aXNp YmxlX29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGRlZmF1 bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgfQorICAgICAgICB9CisjaWZkZWYgSEFWRV9Y X0kxOE4KKyAgaWYgKHcgPT0gWFdJTkRPVyAoZi0+c2VsZWN0ZWRfd2luZG93KSkKKyAgICBpZiAo RlJBTUVfWElDIChmKSAmJiAoRlJBTUVfWElDX1NUWUxFIChmKSAmIFhJTVByZWVkaXRQb3NpdGlv bikpCisgICAgICB4aWNfc2V0X3ByZWVkaXRhcmVhICh3LCB4LCB5KTsKKyNlbmRpZgorICAgIH0K KyAgWEZsdXNoIChGUkFNRV9YX0RJU1BMQVkgKGYpKTsKK30KKworLyogRHJhdyBzdHJldGNoIGds eXBoIHN0cmluZyBTLiAqLworc3RhdGljIHZvaWQKK21jX3hfZHJhd19zdHJldGNoX2dseXBoX3N0 cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAqcykKK3sKKyAgZWFzc2VydCAocy0+Zmlyc3RfZ2x5 cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQSCk7CisgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUgor ICAgICAgJiYgIXhfc3RyZXRjaF9jdXJzb3JfcCkKKyAgICB7CisgICAgICAvKiBJZiBgeC1zdHJl dGNoLWN1cnNvcicgaXMgbmlsLCBkb24ndCBkcmF3IGEgYmxvY2sgY3Vyc29yIGFzIHdpZGUgYXMg dGhlCisgICAgICBzdHJldGNoIGdseXBoLiAqLworICAgICAgaW50IHdpZHRoLCBiYWNrZ3JvdW5k X3dpZHRoID0gcy0+YmFja2dyb3VuZF93aWR0aDsKKyAgICAgIGludCB4ID0gcy0+eDsKKyAgICAg IGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQorICAgICAgICB7CisgICAgICAgICAgaW50IGxlZnRf eCA9IHdpbmRvd19ib3hfbGVmdF9vZmZzZXQgKHMtPncsIFRFWFRfQVJFQSk7CisgICAgICAgICAg aWYgKHggPCBsZWZ0X3gpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGJhY2tncm91bmRf d2lkdGggLT0gbGVmdF94IC0geDsKKyAgICAgICAgICAgICAgeCA9IGxlZnRfeDsKKyAgICAgICAg ICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAg LyogSW4gUjJMIHJvd3MsIGRyYXcgdGhlIGN1cnNvciBvbiB0aGUgcmlnaHQgZWRnZSBvZiB0aGUK KyAgICAgICAgICAgICAgIHN0cmV0Y2ggZ2x5cGguICovCisgICAgICAgICAgICBpbnQgcmlnaHRf eCA9IHdpbmRvd19ib3hfcmlnaHQgKHMtPncsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICBpZiAo eCArIGJhY2tncm91bmRfd2lkdGggPiByaWdodF94KQorICAgICAgICAgICAgICBiYWNrZ3JvdW5k X3dpZHRoIC09IHggLSByaWdodF94OworICAgICAgICAgICAgeCArPSBiYWNrZ3JvdW5kX3dpZHRo OworICAgICAgICAgIH0KKyAgICAgIHdpZHRoID0gbWluIChGUkFNRV9DT0xVTU5fV0lEVEggKHMt PmYpLCBiYWNrZ3JvdW5kX3dpZHRoKTsKKyAgICAgIGlmIChzLT5yb3ctPnJldmVyc2VkX3ApCisg ICAgICAgIHggLT0gd2lkdGg7CisgICAgICAvKiBEcmF3IGN1cnNvci4gKi8KKyAgICAgIHhfZHJh d19nbHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwgcy0+eSwgd2lkdGgsIHMtPmhlaWdodCk7Cisg ICAgICAvKiBDbGVhciByZXN0IHVzaW5nIHRoZSBHQyBvZiB0aGUgb3JpZ2luYWwgbm9uLWN1cnNv ciBmYWNlLiAqLworICAgICAgaWYgKHdpZHRoIDwgYmFja2dyb3VuZF93aWR0aCkKKyAgICAgICAg eworICAgICAgICAgIGludCB5ID0gcy0+eTsKKyAgICAgICAgICBpbnQgdyA9IGJhY2tncm91bmRf d2lkdGggLSB3aWR0aCwgaCA9IHMtPmhlaWdodDsKKyAgICAgICAgICBYUmVjdGFuZ2xlIHI7Cisg ICAgICAgICAgR0MgZ2M7CisgICAgICAgICAgaWYgKCFzLT5yb3ctPnJldmVyc2VkX3ApCisgICAg ICAgICAgICB4ICs9IHdpZHRoOworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHggPSBzLT54 OworICAgICAgICAgIGlmIChzLT5yb3ctPm1vdXNlX2ZhY2VfcAorICAgICAgICAgICAgICAmJiBj dXJzb3JfaW5fbW91c2VfZmFjZV9wIChzLT53KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgeF9zZXRfbW91c2VfZmFjZV9nYyAocyk7CisgICAgICAgICAgICAgIGdjID0gcy0+Z2M7Cisg ICAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgZ2MgPSBzLT5mYWNlLT5n YzsKKyAgICAgICAgICBnZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgJnIpOworICAgICAg ICAgIHhfc2V0X2NsaXBfcmVjdGFuZ2xlcyAocy0+ZiwgZ2MsICZyLCAxKTsKKyAgICAgICAgICBp ZiAocy0+ZmFjZS0+c3RpcHBsZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogRmls bCBiYWNrZ3JvdW5kIHdpdGggYSBzdGlwcGxlIHBhdHRlcm4uICovCisgICAgICAgICAgICAgIFhT ZXRGaWxsU3R5bGUgKHMtPmRpc3BsYXksIGdjLCBGaWxsT3BhcXVlU3RpcHBsZWQpOworICAgICAg ICAgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBnYywgeCwgeSwgdywgaCk7CisgICAgICAg ICAgICAgIFhTZXRGaWxsU3R5bGUgKHMtPmRpc3BsYXksIGdjLCBGaWxsU29saWQpOworICAgICAg ICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgWEdD VmFsdWVzIHhnY3Y7CisgICAgICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAocy0+ZGlzcGxheSwgZ2Ms IEdDRm9yZWdyb3VuZCB8IEdDQmFja2dyb3VuZCwgJnhnY3YpOworICAgICAgICAgICAgICBYU2V0 Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgZ2MsIHhnY3YuYmFja2dyb3VuZCk7CisgICAgICAgICAg ICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIGdjLCB4LCB5LCB3LCBoKTsKKyAgICAgICAgICAg ICAgWFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXksIGdjLCB4Z2N2LmZvcmVncm91bmQpOworICAg ICAgICAgICAgfQorICAgICAgICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChzLT5mLCBnYyk7 CisgICAgICAgIH0KKyAgICB9CisgIGVsc2UgaWYgKCFzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wKQor ICAgIHsKKyAgICAgIGludCBiYWNrZ3JvdW5kX3dpZHRoID0gcy0+YmFja2dyb3VuZF93aWR0aDsK KyAgICAgIGludCB4ID0gcy0+eCwgbGVmdF94ID0gd2luZG93X2JveF9sZWZ0X29mZnNldCAocy0+ dywgVEVYVF9BUkVBKTsKKyAgICAgIC8qIERvbid0IGRyYXcgaW50byBsZWZ0IG1hcmdpbiwgZnJp bmdlIG9yIHNjcm9sbGJhciBhcmVhCisgICAgICAgICBleGNlcHQgZm9yIGhlYWRlciBsaW5lIGFu ZCBtb2RlIGxpbmUuICovCisgICAgICBpZiAoeCA8IGxlZnRfeCAmJiAhcy0+cm93LT5tb2RlX2xp bmVfcCkKKyAgICAgICAgeworICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0gbGVmdF94IC0g eDsKKyAgICAgICAgICB4ID0gbGVmdF94OworICAgICAgICB9CisgICAgICBpZiAoYmFja2dyb3Vu ZF93aWR0aCA+IDApCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwg cy0+eSwgYmFja2dyb3VuZF93aWR0aCwgcy0+aGVpZ2h0KTsKKyAgICB9CisgIHMtPmJhY2tncm91 bmRfZmlsbGVkX3AgPSB0cnVlOworfQorCisvKiBEcmF3IGdseXBoIHN0cmluZyBTLiAqLworc3Rh dGljIHZvaWQKK21jX3hfZHJhd19nbHlwaF9zdHJpbmcgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMs IHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAg ICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2wsIGVudW0gbWNfZmxhdm9yIGds eXBoX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUg Y3Vyc29yX3R5cGUsIGludCBjdXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICBi b29sIGFjdGl2ZV9wLCBib29sIGN1cnNvcl9nY19wKQoreworICBib29sIHJlbGllZl9kcmF3bl9w ID0gZmFsc2U7CisgIC8qIElmIFMgZHJhd3MgaW50byB0aGUgYmFja2dyb3VuZCBvZiBpdHMgc3Vj Y2Vzc29ycywgZHJhdyB0aGUKKyAgICAgYmFja2dyb3VuZCBvZiB0aGUgc3VjY2Vzc29ycyBmaXJz dCBzbyB0aGF0IFMgY2FuIGRyYXcgaW50byBpdC4KKyAgICAgVGhpcyBtYWtlcyBTLT5uZXh0IHVz ZSBYRHJhd1N0cmluZyBpbnN0ZWFkIG9mIFhEcmF3SW1hZ2VTdHJpbmcuICovCisgIGlmIChzLT5u ZXh0ICYmIHMtPnJpZ2h0X292ZXJoYW5nICYmICFzLT5mb3Jfb3ZlcmxhcHMpCisgICAgeworICAg ICAgaW50IHdpZHRoOworICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqbmV4dDsKKyAgICAgIGZv ciAod2lkdGggPSAwLCBuZXh0ID0gcy0+bmV4dDsKKyAgICAgICAgICAgbmV4dCAmJiB3aWR0aCA8 IHMtPnJpZ2h0X292ZXJoYW5nOworICAgICAgICAgICB3aWR0aCArPSBuZXh0LT53aWR0aCwgbmV4 dCA9IG5leHQtPm5leHQpCisgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBJ TUFHRV9HTFlQSCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBtY194X3NldF9nbHlwaF9zdHJp bmdfZ2MgKG5leHQsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgIHhfc2V0X2dseXBoX3N0cmlu Z19jbGlwcGluZyAob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oX3N0cmlu ZyAocyk7CisgICAgICBicmVhazsKKyAgICBjYXNlIENIQVJfR0xZUEg6CisgICAgICBpZiAocy0+ Zm9yX292ZXJsYXBzKQorICAgICAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gdHJ1ZTsKKyAg ICAgIGVsc2UKKyAgICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19iYWNrZ3JvdW5kIChzLCBmYWxz ZSk7CisgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgYnJl YWs7CisgICAgY2FzZSBDT01QT1NJVEVfR0xZUEg6CisgICAgICBpZiAocy0+Zm9yX292ZXJsYXBz IHx8IChzLT5jbXBfZnJvbSA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICEg cy0+Zmlyc3RfZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykpCisgICAgICAgIHMtPmJhY2tncm91bmRf ZmlsbGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5n X2JhY2tncm91bmQgKHMsIHRydWUpOworICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJp bmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVhazsKKyAgICBjYXNlIEdMWVBITEVTU19HTFlQ SDoKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMpCisgICAgICAgIHMtPmJhY2tncm91bmRfZmls bGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2Jh Y2tncm91bmQgKHMsIHRydWUpOworICAgICAgeF9kcmF3X2dseXBobGVzc19nbHlwaF9zdHJpbmdf Zm9yZWdyb3VuZCAocyk7CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3Nf YWJvcnQgKCk7CisgICAgfQorICBpZiAoIXMtPmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICAv KiBEcmF3IHVuZGVybGluZS4gKi8KKyAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfcCkKKyAg ICAgICAgeworICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VO REVSX1dBVkUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRl cmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgICAgeF9kcmF3X3VuZGVyd2F2ZSAocyk7 CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICBYR0NWYWx1ZXMgeGdjdjsKKyAgICAgICAgICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAocy0+ZGlz cGxheSwgcy0+Z2MsIEdDRm9yZWdyb3VuZCwgJnhnY3YpOworICAgICAgICAgICAgICAgICAgWFNl dEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3Ip OworICAgICAgICAgICAgICAgICAgeF9kcmF3X3VuZGVyd2F2ZSAocyk7CisgICAgICAgICAgICAg ICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHhnY3YuZm9yZWdyb3VuZCk7 CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKHMt PmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgdW5zaWduZWQgbG9uZyB0aGlja25lc3MsIHBvc2l0aW9uOworICAgICAg ICAgICAgICBpbnQgeTsKKyAgICAgICAgICAgICAgaWYgKHMtPnByZXYgJiYgcy0+cHJldi0+ZmFj ZS0+dW5kZXJsaW5lX3AKKyAgICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPmZhY2UtPnVuZGVy bGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgICAvKiBXZSB1c2UgdGhlIHNhbWUgdW5kZXJsaW5lIHN0eWxlIGFzIHRoZSBwcmV2 aW91cyBvbmUuICovCisgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSBzLT5wcmV2LT51bmRl cmxpbmVfdGhpY2tuZXNzOworICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5wcmV2LT51 bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNl CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgLyogR2V0IHRoZSB1bmRlcmxp bmUgdGhpY2tuZXNzLiAgRGVmYXVsdCBpcyAxIHBpeGVsLiAqLworICAgICAgICAgICAgICAgICAg aWYgKHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAg ICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPmZvbnQtPnVuZGVybGluZV90aGlja25lc3M7Cisg ICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7 CisgICAgICAgICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2VudF9saW5lKQorICAg ICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSB0aGlja25lc3MpIC0gKHMt PnliYXNlIC0gcy0+eSk7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSBwb3NpdGlv bi4gIFRoaXMgaXMgdGhlIHJlY29tbWVuZGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgdmVy dGljYWwgb2Zmc2V0IGluIHBpeGVscyBmcm9tIHRoZSBiYXNlbGluZSB0byB0aGUgdG9wIG9mCisg ICAgICAgICAgICAgICAgICAgICAgICAgdGhlIHVuZGVybGluZS4gIFRoaXMgaXMgYSBzaWduZWQg dmFsdWUgYWNjb3JkaW5nIHRvIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgIHNwZWNzLCBh bmQgaXRzIGRlZmF1bHQgaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICBST1VORCAoKG1heGlt dW0gZGVzY2VudCkgLyAyKSwgd2l0aAorICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EKHgp ID0gZmxvb3IgKHggKyAwLjUpICAqLworICAgICAgICAgICAgICAgICAgICAgIGlmICh4X3VzZV91 bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGllcworICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAg ICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb247Cisg ICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocy0+Zm9udCkKKyAgICAgICAgICAgICAgICAg ICAgICAgIHBvc2l0aW9uID0gKHMtPmZvbnQtPmRlc2NlbnQgKyAxKSAvIDI7CisgICAgICAgICAg ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSB1bmRl cmxpbmVfbWluaW11bV9vZmZzZXQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg ICAgICAgIHBvc2l0aW9uID0gbWF4IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0 KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIC8qIENoZWNrIHRoZSBzYW5pdHkg b2YgdGhpY2tuZXNzIGFuZCBwb3NpdGlvbi4gIFdlIHNob3VsZAorICAgICAgICAgICAgICAgICBh dm9pZCBkcmF3aW5nIHVuZGVybGluZSBvdXQgb2YgdGhlIGN1cnJlbnQgbGluZSBhcmVhLiAqLwor ICAgICAgICAgICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8PSBzLT55YmFzZSArIHBvc2l0aW9u KQorICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIDEpIC0gKHMtPnliYXNl IC0gcy0+eSk7CisgICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDwgcy0+eWJhc2Ug KyBwb3NpdGlvbiArIHRoaWNrbmVzcykKKyAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAocy0+ eSArIHMtPmhlaWdodCkgLSAocy0+eWJhc2UgKyBwb3NpdGlvbik7CisgICAgICAgICAgICAgIHMt PnVuZGVybGluZV90aGlja25lc3MgPSB0aGlja25lc3M7CisgICAgICAgICAgICAgIHMtPnVuZGVy bGluZV9wb3NpdGlvbiA9IHBvc2l0aW9uOworICAgICAgICAgICAgICB5ID0gcy0+eWJhc2UgKyBw b3NpdGlvbjsKKyAgICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRf cCkKKyAgICAgICAgICAgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBzLT5nYywgcy0+eCwg eSwgcy0+d2lkdGgsIHRoaWNrbmVzcyk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgICBYR0NWYWx1ZXMgeGdjdjsKKyAgICAgICAgICAgICAg ICAgIFhHZXRHQ1ZhbHVlcyAocy0+ZGlzcGxheSwgcy0+Z2MsIEdDRm9yZWdyb3VuZCwgJnhnY3Yp OworICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCBz LT5mYWNlLT51bmRlcmxpbmVfY29sb3IpOworICAgICAgICAgICAgICAgICAgeF9maWxsX3JlY3Rh bmdsZSAocy0+Ziwgcy0+Z2MsIHMtPngsIHksIHMtPndpZHRoLCB0aGlja25lc3MpOworICAgICAg ICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCB4Z2N2LmZvcmVn cm91bmQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAg ICAgLyogRHJhdyBvdmVybGluZS4gKi8KKyAgICAgIGlmIChzLT5mYWNlLT5vdmVybGluZV9wKQor ICAgICAgICB7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBkeSA9IDAsIGggPSAxOworICAgICAg ICAgIGlmIChzLT5mYWNlLT5vdmVybGluZV9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAg IHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBzLT55ICsgZHksIHMtPndpZHRo LCBoKTsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIFhHQ1Zh bHVlcyB4Z2N2OworICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKHMtPmRpc3BsYXksIHMtPmdj LCBHQ0ZvcmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKHMt PmRpc3BsYXksIHMtPmdjLCBzLT5mYWNlLT5vdmVybGluZV9jb2xvcik7CisgICAgICAgICAgICAg IHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBzLT55ICsgZHksIHMtPndpZHRo LCBoKTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCB4 Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAvKiBEcmF3 IHN0cmlrZS10aHJvdWdoLiAqLworICAgICAgaWYgKHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX3Ap CisgICAgICAgIHsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIGggPSAxOworICAgICAgICAgIHVu c2lnbmVkIGxvbmcgZHkgPSAocy0+aGVpZ2h0IC0gaCkgLyAyOworICAgICAgICAgIGlmIChzLT5m YWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIHhfZmls bF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsK KyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4 Z2N2OworICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKHMtPmRpc3BsYXksIHMtPmdjLCBHQ0Zv cmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRpc3Bs YXksIHMtPmdjLCBzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvcik7CisgICAgICAgICAgICAg IHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBzLT55ICsgZHksIHMtPndpZHRo LCBoKTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCB4 Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAvKiBEcmF3 IHJlbGllZiBpZiBub3QgeWV0IGRyYXduLiAqLworICAgICAgaWYgKCFyZWxpZWZfZHJhd25fcCAm JiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisgICAgICAgICAgeF9kcmF3X2dseXBoX3N0 cmluZ19ib3ggKHMpOworICAgICAgaWYgKHMtPnByZXYpCisgICAgICAgIHsKKyAgICAgICAgICBz dHJ1Y3QgZ2x5cGhfc3RyaW5nICpwcmV2OworICAgICAgICAgIGZvciAocHJldiA9IHMtPnByZXY7 IHByZXY7IHByZXYgPSBwcmV2LT5wcmV2KQorICAgICAgICAgICAgaWYgKHByZXYtPmhsICE9IHMt PmhsCisgICAgICAgICAgICAgICAgJiYgcHJldi0+eCArIHByZXYtPndpZHRoICsgcHJldi0+cmln aHRfb3ZlcmhhbmcgPiBzLT54KQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyog QXMgcHJldiB3YXMgZHJhd24gd2hpbGUgY2xpcHBlZCB0byBpdHMgb3duIGFyZWEsIHdlCisgICAg ICAgICAgICAgICAgICAgbXVzdCBkcmF3IHRoZSByaWdodF9vdmVyaGFuZyBwYXJ0IHVzaW5nIHMt PmhsIG5vdy4gKi8KKyAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9 IHByZXYtPmhsOworICAgICAgICAgICAgICAgIHByZXYtPmhsID0gcy0+aGw7CisgICAgICAgICAg ICAgICAgbWNfeF9zZXRfZ2x5cGhfc3RyaW5nX2djIChwcmV2LCBjdXJzb3JfZ2NfcCk7CisgICAg ICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nX2V4YWN0bHkgKHMsIHByZXYp OworICAgICAgICAgICAgICAgIGlmIChwcmV2LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dM WVBIKQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChw cmV2KTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB4X2RyYXdfY29t cG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChwcmV2KTsKKyAgICAgICAgICAgICAgICB4 X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAocHJldi0+ZiwgcHJldi0+Z2MpOworICAgICAgICAgICAg ICAgIHByZXYtPmhsID0gc2F2ZTsKKyAgICAgICAgICAgICAgICBwcmV2LT5udW1fY2xpcHMgPSAw OworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlmIChzLT5uZXh0KQorICAgICAg ICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqbmV4dDsKKyAgICAgICAgICBmb3Ig KG5leHQgPSBzLT5uZXh0OyBuZXh0OyBuZXh0ID0gbmV4dC0+bmV4dCkKKyAgICAgICAgICAgIGlm IChuZXh0LT5obCAhPSBzLT5obAorICAgICAgICAgICAgICAgICYmIG5leHQtPnggLSBuZXh0LT5s ZWZ0X292ZXJoYW5nIDwgcy0+eCArIHMtPndpZHRoKQorICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgLyogQXMgbmV4dCB3aWxsIGJlIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8gaXRzIG93 biBhcmVhLAorICAgICAgICAgICAgICAgICAgIHdlIG11c3QgZHJhdyB0aGUgbGVmdF9vdmVyaGFu ZyBwYXJ0IHVzaW5nIHMtPmhsIG5vdy4gKi8KKyAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5 cGhzX2ZhY2Ugc2F2ZSA9IG5leHQtPmhsOworICAgICAgICAgICAgICAgIG5leHQtPmhsID0gcy0+ aGw7CisgICAgICAgICAgICAgICAgbWNfeF9zZXRfZ2x5cGhfc3RyaW5nX2djIChuZXh0LCBjdXJz b3JfZ2NfcCk7CisgICAgICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nX2V4 YWN0bHkgKHMsIG5leHQpOworICAgICAgICAgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+ dHlwZSA9PSBDSEFSX0dMWVBIKQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2dseXBoX3N0cmlu Z19mb3JlZ3JvdW5kIChuZXh0KTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAg ICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChuZXh0KTsKKyAg ICAgICAgICAgICAgICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAobmV4dC0+ZiwgbmV4dC0+Z2Mp OworICAgICAgICAgICAgICAgIG5leHQtPmhsID0gc2F2ZTsKKyAgICAgICAgICAgICAgICBuZXh0 LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgICAgICAgIG5leHQtPmNsaXBfaGVhZCA9IHMtPm5l eHQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgLyogUmVzZXQgY2xpcHBp bmcuICovCisgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChzLT5mLCBzLT5nYyk7CisgIHMtPm51 bV9jbGlwcyA9IDA7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAvKiBEZWZhdWx0IHRvIHVzaW5nIFhJTSBpZiBhdmFpbGFibGUu ICAqLwogI2lmZGVmIFVTRV9YSU0KIGJvb2wgdXNlX3hpbSA9IHRydWU7CkBAIC05OTksNiArMTg3 OCwxNSBAQCB4X3VwZGF0ZV9iZWdpbiAoc3RydWN0IGZyYW1lICpmKQogICBpZiAoRlJBTUVfVE9P TFRJUF9QIChmKSAmJiAhRlJBTUVfVklTSUJMRV9QIChmKSkKICAgICByZXR1cm47CiAKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNf dXBkYXRpbmdfZnJhbWUgPSBmOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIGlm ICghIEZSQU1FX0NSX1NVUkZBQ0UgKGYpKQogICAgIHsKICAgICAgIGludCB3aWR0aCwgaGVpZ2h0 OwpAQCAtMTI2Niw2ICsyMTU0LDE2IEBAIHhfdXBkYXRlX2VuZCAoc3RydWN0IGZyYW1lICpmKQog ICBYRmx1c2ggKEZSQU1FX1hfRElTUExBWSAoZikpOwogICB1bmJsb2NrX2lucHV0ICgpOwogI2Vu ZGlmCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBOVUxMOworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiB9CiAKIC8qIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIGZyb20gdmFyaW91cyBw bGFjZXMgaW4geGRpc3AuYwpAQCAtMTMxMDAsNiArMTM5OTgsMjEgQEAgeF9hY3RpdmF0ZV90aW1l b3V0X2F0aW1lciAodm9pZCkKIAogc3RhdGljIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlIHhf cmVkaXNwbGF5X2ludGVyZmFjZSA9CiAgIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGB4 dGVybS5jYCBtdXN0IGJlIGluIHRoZSBleGFjdCBzYW1lIG9yZGVyIGFzIHRoZQorYHJlZGlzcGxh eV9pbnRlcmZhY2UnIGluIGBkaXNwZXh0ZXJuLmhgISAqLworCisgIG1jX3hfd3JpdGVfZ2x5cGhz LAorICBtY194X2RyYXdfd2luZG93X2N1cnNvciwKKyAgbWNfeF9kcmF3X2dseXBoX3N0cmluZywK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgIHhfZnJhbWVfcGFybV9oYW5kbGVy cywKICAgICB4X3Byb2R1Y2VfZ2x5cGhzLAogICAgIHhfd3JpdGVfZ2x5cGhzLAo= --Multipart_Sun_Jun__2_00:29:09_2019-1--