From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.bugs Subject: bug#17684: #22873 (multiple fake cursors); and, #17684 (crosshairs). Date: Wed, 31 Jul 2019 12:39:46 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Wed_Jul_31_12:39:45_2019-1" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="205806"; 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 Wed Jul 31 21:40:35 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hsuSf-000oQ1-0I for geb-bug-gnu-emacs@m.gmane.org; Wed, 31 Jul 2019 21:40:34 +0200 Original-Received: from localhost ([::1]:43976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsuSd-0002k1-RY for geb-bug-gnu-emacs@m.gmane.org; Wed, 31 Jul 2019 15:40:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45563) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsuSF-0002i1-1B for bug-gnu-emacs@gnu.org; Wed, 31 Jul 2019 15:40:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsuSC-0006DH-EI for bug-gnu-emacs@gnu.org; Wed, 31 Jul 2019 15:40:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44302) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hsuSA-0006Cc-Fu for bug-gnu-emacs@gnu.org; Wed, 31 Jul 2019 15:40:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hsuSA-0001Tj-36 for bug-gnu-emacs@gnu.org; Wed, 31 Jul 2019 15:40:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Keith David Bershatsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 31 Jul 2019 19:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17684 X-GNU-PR-Package: emacs Original-Received: via spool by 17684-submit@debbugs.gnu.org id=B17684.15646019995669 (code B ref 17684); Wed, 31 Jul 2019 19:40:01 +0000 Original-Received: (at 17684) by debbugs.gnu.org; 31 Jul 2019 19:39:59 +0000 Original-Received: from localhost ([127.0.0.1]:53124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hsuS6-0001TN-T2 for submit@debbugs.gnu.org; Wed, 31 Jul 2019 15:39:58 -0400 Original-Received: from gateway30.websitewelcome.com ([192.185.146.7]:25677) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hsuS0-0001Sz-AD for 17684@debbugs.gnu.org; Wed, 31 Jul 2019 15:39:52 -0400 Original-Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway30.websitewelcome.com (Postfix) with ESMTP id DEF835481 for <17684@debbugs.gnu.org>; Wed, 31 Jul 2019 14:39:51 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id suRzhKdKO4FKpsuRzhU5X4; Wed, 31 Jul 2019 14:39:51 -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=kxbL7es3MJ84u8iD7aQbh+W0q5lAgZl4kOtJpvB6ccY=; b=LZSK4QxHKhl9Ah3Lkel1s9qyqA dWrO4wiKQ3hw7S7W7vX/xMG44eHbESotWhqqgZKKr6Wk77TD1f+3NV/9RPcfTH8bUIYUO9ORdhXQD B1N8qfV/UV1rfiREGtvBnUyLSPM6eAFWY0cCWyhKgdi+h2W3cpTUkrzHKe8gY5BWfw23r163CBqh8 sPOWolR7N/tQ263baqDAnCeP+z3VaG2P8mzlO/RK84bDpNiZuqNsvtULvPFmYk1gWbVn9soOMXaCl 6FFpsLSjOMowvK23m6eLpUjgLTRcU+kQLq1By9sOetotnjn5qNUNr3mzmniJSc8MaCuQwJFIaI8UY 4NLLEZBg==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:52173 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hsuRv-001oKw-33; Wed, 31 Jul 2019 14:39:50 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1hsuRv-001oKw-33 X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:52173 X-Source-Auth: lawlist X-Email-Count: 6 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:164186 Archived-At: --Multipart_Wed_Jul_31_12:39:45_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 022.002 [07/31/2019] CHANGELOG: - Replaced optional debugging messages to STDERR with the variable `mc_stderr_p' instead of using `trace_redisplay_p'. - `mc_update_window_erase' no longer excludes left/right fringe bitmaps from the `same_p` determination. `mc_helper' now contains exceptions for the left/right fringe bitmap indicators, ensuring they are reset even if they are `same_p`. - Added a NOTES section to this introductory commentary, including, a summary explaining generally the purpose of the dryrun in `update_window'. - Removed `mc_rotate_matrix' and `mc_reverse_vpos'. - Miscellaneous tidying-up of code. VIDEOS: w32: https://youtu.be/r3BdJVlsAnQ ns: https://youtu.be/bc1h8jtbXmw x11: https://youtu.be/aCIFhD2Xz5s SCREENSHOTS: https://www.lawlist.com/images/22873_17684_light_dark_backgrounds.png SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 07/14/2019: git reset --hard ac57c5093829ee09084c562bbbc1c412179be13d Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed")))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out both the crosshairs feature and the visible fill column indicator feature, type: M-x +-mode - To try out just the visible fill column indicator feature, type: M-x fc-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, that package must be installed. If the multiple-cursors package is already installed, then just (require 'crosshairs) and `crosshairs.el` will redefine a few of the multiple-cursors functions and set up a few keyboard shortcuts. If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors) (mc/built-in-cursors)) TODO: - 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 a minimal working example and file a bug report. (progn (defun test () (interactive) (let ((ov (make-overlay (point) (1+ (point)) nil t t))) (overlay-put ov 'face '(:foreground "red")))) (global-set-key [f5] 'test) (split-window-horizontally) (switch-to-buffer (get-buffer-create "foo")) (setq bidi-display-reordering nil) (setq-local auto-hscroll-mode 'current-line) (dotimes (i 80) (insert (char-to-string (+ 65 i))))) - `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 - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - 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. - Is there any additional meaningful optimization that can be added to the three calls of `mc_pre_scroll_clean'? - 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.] NOTES: - Our journey begins at the outset of `update_window' when `mc_update_window_dryrun' performs a `!draw_p` simulation to create a new cache of fake cursors that are stored in the `w->mc_matrix`. The cache from the previous redisplay is copied to a temporary `mc_matrix` under the name of `old_matrix`. At the tail end of `mc_update_window_dryrun', `mc_update_window_erase' compares the new `w->mc_matrix` with the `old_matrix` to determine which fake cursors are the same -- setting the `same_p` boolean struct member accordingly for each applicable fake cursor within the `w->mc_matrix`. All fake cursors in the `old_matrix` that are `!same_p` get erased at this juncture. [Fn 1.] After the dryrun is complete, `update_window' does the real thing -- `draw_p`. As to the `from_where` situations of SKIPPED, POST_CHANGED, UNCHANGED, and SET_CURSOR_TWO, `mc_helper' compares the incoming tentative fake cursor with the `w->mc_matrix` to see if it has previously been marked as `same_p` -- if it is `!same_p`, then the fake cursor is drawn and we `return`. Fake cursors that have a `cursor_type` of MC_LEFT_FRINGE_BITMAP or MC_RIGHT_FRINGE_BITMAP are always reset even if they are `same_p`. As to the `from_where` situations of SCRIBE_ONE, SCRIBE_TWO, SCRIBE_THREE, and NOWHERE, `mc_helper' always causes fake cursors to be drawn (because new glyphs were written to the glass, or the area to the right of the display line was cleared) and we `return`. . Fn. 1: Even though writing new glyphs to the glass (SCRIBE_ONE, SCRIBE_TWO, and SCRIBE_THREE) would erase fake cursors within those boundaries, it is still necessary to erase `!same_p` fake cursors prior thereto. This is because `scrolling_window' occurs before new glyphs are written and `rif->scroll_run_hook' may copy one or more rows to other areas of the glass. It is not worth the effort to programmatically track both the _copied_ fake cursors and the _original_ fake cursors from the previous redisplay cycle, whose glyphs may remain where they are in the current redisplay cycle because they satisfy the `GLYPH_EQUAL_P' test. - 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. `mc_rotate_matrix' and `mc_reverse_vpos' were removed with patch v. 022.002. --Multipart_Wed_Jul_31_12:39:45_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_07_31__12_36_32_978.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi43ODI3NTJmCi0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI4OCBAQAorOzs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gKG11bHRpcGxlLWN1 cnNvcnMtbW9kZSAwKQorICAgICAgICAod2hlbiB0aGlzLW9yaWdpbmFsLWNvbW1hbmQKKyAgICAg ICAgICAobGV0ICgob3JpZ2luYWwtY29tbWFuZCAob3IgbWMtLXRoaXMtY29tbWFuZAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29tbWFuZC1yZW1hcHBpbmcgdGhpcy1v cmlnaW5hbC1jb21tYW5kKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0 aGlzLW9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgIDs7IHNraXAga2V5Ym9hcmQgbWFj cm9zLCBzaW5jZSB0aGV5IHdpbGwgZ2VuZXJhdGUgYWN0dWFsIGNvbW1hbmRzIHRoYXQgYXJlCisg ICAgICAgICAgICA7OyBhbHNvIHJ1biBpbiB0aGUgY29tbWFuZCBsb29wIC0gd2UnbGwgaGFuZGxl IHRob3NlIGxhdGVyIGluc3RlYWQuCisgICAgICAgICAgICAod2hlbiAoZnVuY3Rpb25wIG9yaWdp bmFsLWNvbW1hbmQpCisgICAgICAgICAgICAgIDs7IGlmIGl0J3MgYSBsYW1iZGEsIHdlIGNhbid0 IGtub3cgaWYgaXQncyBzdXBwb3J0ZWQgb3Igbm90CisgICAgICAgICAgICAgIDs7IC0gc28gZ28g YWhlYWQgYW5kIGFzc3VtZSBpdCdzIG9rLCBiZWNhdXNlIHdlJ3JlIGp1c3Qgb3B0aW1pc3RpYyBs aWtlIHRoYXQKKyAgICAgICAgICAgICAgKGlmIChvciAobm90IChzeW1ib2xwIG9yaWdpbmFsLWNv bW1hbmQpKQorICAgICAgICAgICAgICAgICAgICAgIDs7IGxhbWJkYSByZWdpc3RlcmVkIGJ5IHNt YXJ0cmVwCisgICAgICAgICAgICAgICAgICAgICAgKHN0cmluZy1wcmVmaXgtcCAiKCIgKHN5bWJv bC1uYW1lIG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgICAgICAgIChtYy9leGVjdXRl LWNvbW1hbmQtZm9yLWFsbC1mYWtlLWN1cnNvcnMgb3JpZ2luYWwtY29tbWFuZCkKKyAgICAgICAg ICAgICAgICA7OyBzbWFydHJlcCBgaW50ZXJuJ3MgY29tbWFuZHMgaW50byBvd24gb2JhcnJheSB0 byBoZWxwCisgICAgICAgICAgICAgICAgOzsgYGRlc2NyaWJlLWJpbmRpbmdzJy4gIFNvLCBsZXQn cyByZS1gaW50ZXJuJyBoZXJlIHRvCisgICAgICAgICAgICAgICAgOzsgbWFrZSB0aGUgY29tbWFu ZCBjb21wYXJhYmxlIGJ5IGBlcScuCisgICAgICAgICAgICAgICAgKHNldHEgb3JpZ2luYWwtY29t bWFuZCAoaW50ZXJuIChzeW1ib2wtbmFtZSBvcmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAgICAg ICAgICAgOzsgb3RoZXJ3aXNlIGl0J3MgYSBzeW1ib2wsIGFuZCB3ZSBjYW4gYmUgbW9yZSB0aG9y b3VnaAorICAgICAgICAgICAgICAgIChpZiAoZ2V0IG9yaWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1 cHBvcnRlZCkKKyAgICAgICAgICAgICAgICAgICAgKG1lc3NhZ2UgIiVTIGlzIG5vdCBzdXBwb3J0 ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4g KGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3Qg KG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1j L2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMv YWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2Nt ZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMv cHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29y cyBvcmlnaW5hbC1jb21tYW5kKSkpKQorICAgICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQt aW4tY3Vyc29ycworICAgICAgICAgICAgICAgIChzZXRxIG1jLWNvbmYKKyAgICAgICAgICAgICAg ICAgICAgICAgIChtYXBjYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoeCkg KGxpc3QgKG92ZXJsYXktc3RhcnQgeCkgImJhciIgbmlsKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgKG1jL2FsbC1mYWtlLWN1cnNvcnMpKSkpKSkpKSkpCisKKyAgKGRlZnVuIG1jL21hcmst bmV4dC1saWtlLXRoaXMtY3ljbGUtZm9yd2FyZCAoKQorICAiTWFya3MgbmV4dCBvY2N1cmVuY2Ug b2Ygd29yZCBsaWtlIHRoaXMgYW5kIGFkdmFuY2VzIGN1cnNvciB0byB0aGlzIG9jY3VycmVuY2Ui CisgIChpbnRlcmFjdGl2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ICAgICgyICJiYXIiICJwdXJwbGUiKQorICAg ICAgICAgICAgICAgICAgICAgICgzICJib3giICIjMDBGRjAwIikKKyAgICAgICAgICAgICAgICAg ICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAgICAgKDUgKCJo YmFyIiAzKSBbMS4wIDAuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAz KSBbMC4wIDEuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFu Z2VSZWQiKQorICAgICAgICAgICAgICAgICAgICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAg ICAgICAgICAgICAgICAgICg5ICJib3giICJncmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93 IChkaXNwbGF5LWJ1ZmZlciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2lu Y2UgdGhpcyBmaXJlcyBnbG9iYWxseSwgd2UgbXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jv c3NoYWlycyBhcHBlYXIgaW4uIgorICAod2hlbiArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVt cSBsYXN0LWNvbW1hbmQgKy1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVs bCArLXBhcmVucy1wKSkKKyAgICAgICgrLXBhcmVucy1mbikpCisgICAgKHdoZW4gKy10aW1lci12 YXIKKyAgICAgIChzZXRxIHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1p ZGxlLWxpc3QpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkpKQorCisoZGVmdW4gKy1k cmF3LWZvcnRod2l0aCAoKQorIkltbWVkaWF0ZWx5IGRlbGV0ZS9kcmF3IG1hdGNoaW5nIHBhcmVu dGhlc2VzLiIKKyAgKCstZHJhdy1jcm9zc2hhaXJzICdmb3JjZSkpCisKKyhkZWZ1biArLWRyYXct Y3Jvc3NoYWlycyAoJm9wdGlvbmFsIGZvcmNlKQorIkltbWVkaWF0ZWx5IGRlbGV0ZSBtYXRjaGlu ZyBwYXJlbnRoZXNlcy4gIElmIEZPUkNFIGlzIG5vbi1uaWwsIHRoZW4gaW1tZWRpYXRlbHkKK2Ry YXcgbWF0Y2hpbmcgcGFyZW50aGVzaXM7IG90aGVyd2lzZSwgZHJhdyB0aGVtIG9uIGFuIGlkbGUt dGllci4iCisgICh3aGVuICstbW9kZQorICAgICh3aGVuICstdGltZXItdmFyCisgICAgICAoc2V0 cSB0aW1lci1pZGxlLWxpc3QgKGRlbHEgKy10aW1lci12YXIgdGltZXItaWRsZS1saXN0KSkKKyAg ICAgIChzZXRxICstdGltZXItdmFyIG5pbCkpCisgICAgKHVubGVzcyAob3IgKG1lbXEgdGhpcy1j b21tYW5kICstcGFyZW5zLWV4Y2x1c2lvbnMpCisgICAgICAgICAgICAgICAgKGFuZCAobnVsbCAr LXBhcmVucy1wKQorICAgICAgICAgICAgICAgICAgICAgKG51bGwgKy1wYXJlbnMtb3ZlcmxheXMt ZXhpc3QtcCkpKQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZv cmNlCisgICAgICAocHJvZ24KKyAgICAgICAgKHdoZW4gKy1wYXJlbnMtcAorICAgICAgICAgICgr LXBhcmVucy1mbikpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGlt ZXIgKy1pZGxlLXRpbWVyLXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKyhkZWZ2YXIg ZmMtbW9kZSkKKworOzs7IyMjYXV0b2xvYWQKKyhkZWZpbmUtbWlub3ItbW9kZSArLW1vZGUKKyJN aW5vciBtb2RlIGZvciBkaXNwbGF5aW5nIGEgaG9yaXpvbnRhbCBydWxlci4iCisgIDppbml0LXZh bHVlIG5pbAorICA6bGlnaHRlciAiICsiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisg IDpncm91cCAnKy1tb2RlCisgIChjb25kCisgICAgKCstbW9kZQorICAgICAgOzs7IGArLW1vZGUn IGhhcyB0aGUgYWJpbGl0eSB0byBhbHNvIGRpc3BsYXkgYSBmaWxsIGNvbHVtbiBpbmRpY2F0b3Iu CisgICAgICA7OzsgU2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuCisgICAgICAod2hl biBmYy1tb2RlCisgICAgICAgIChmYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFs LWVsZG9jLW1vZGUKKyAgICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2Fu eSkKKyAgICAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAg ICAgICAgKGdsb2JhbC1lbGRvYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2st Y29udGV4dC10aW1lcgorICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAn YW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQor ICAgICAgICAod2hlbiAodGltZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAg KGNhbmNlbC10aW1lciBqaXQtbG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEg aml0LWxvY2stY29udGV4dC10aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAn aml0LWxvY2stY29udGV4dC1mb250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4 dC10aW1lciBuaWwpKQorICAgICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAn YW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQor ICAgICAgICAod2hlbiAodGltZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQor ICAgICAgICAgIChjYW5jZWwtdGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIp KQorICAgICAgICAoZnNldCAndW5kby1hdXRvLS11bmRvYWJsZS1jaGFuZ2UKKyAgICAgICAgICAg ICAgKGxhbWJkYSAoKSAoYWRkLXRvLWxpc3QgJ3VuZG8tYXV0by0tdW5kb2FibHktY2hhbmdlZC1i dWZmZXJzIChjdXJyZW50LWJ1ZmZlcikpKSkKKyAgICAgICAgKGZzZXQgJ3VuZG8tYXV0by1hbWFs Z2FtYXRlICdpZ25vcmUpKQorICAgICAgKHdoZW4gYmxpbmstY3Vyc29yLW1vZGUKKyAgICAgICAg KGJsaW5rLWN1cnNvci1tb2RlIC0xKQorICAgICAgICAod2hlbiAobWVtcSAnYmxpbmstY3Vyc29y LWNoZWNrIHBvc3QtY29tbWFuZC1ob29rKQorICAgICAgICAgIChyZW1vdmUtaG9vayAncG9zdC1j b21tYW5kLWhvb2sgJ2JsaW5rLWN1cnNvci1jaGVjaykpKQorICAgICAgKHNldHEgY3Jvc3NoYWly cyB0KQorICAgICAgKHdoZW4gKy1maWxsLWNvbHVtbgorICAgICAgICAoc2V0cSBmYy12aXNpYmxl IHQpKQorICAgICAgOzs7IGBhdXRvLWNvbXBvc2l0aW9uLW1vZGUnIGlzIG5lZWRlZCBmb3IgY3Jv c3NoYWlycyB0byBwcm9wZXJseSBjYWxjdWxhdGUKKyAgICAgIDs7OyBjb29yZGluYXRlcyBvZiBj b21wb3NpdGlvbiBjaGFyYWN0ZXJzLiAgQXV0b21hdGljYWxseSBiZWNvbWVzIHBlcm1hbmVudGx5 CisgICAgICA7OzsgYnVmZmVyLWxvY2FsIHdoZW4gc2V0LgorICAgICAgKHVubGVzcyBhdXRvLWNv bXBvc2l0aW9uLW1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mFyKQorICAgICAg ICAgIChwdXNoIChjb25zIHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICstLXNhdmVkLXN0YXRlKSkp CisgICAgICAoc2V0cSBmaWxsLWNvbHVtbiA4MCkKKyAgICAgIChzZXRxIGRpc3BsYXktbGluZS1u dW1iZXJzIHQpCisgICAgICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1s aW5lKQorICAgICAgKHNldHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAoc2V0cSBidWZm ZXItZGlzcGxheS10YWJsZSArLWJ1ZmZlci1kaXNwbGF5LXRhYmxlKQorICAgICAgKHNldHEgdGFi LXdpZHRoIDQpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlz dWFsKSB0KQorICAgICAgKHNldHEgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgKGNvbmQKKyAgICAg ICAgICAoKGxldCAoKGxzdCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisgICAgICAg ICAgICAgICAgICBtb2RlKQorICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAg ICAod2hpbGUgKHNldHEgbW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAgICAgKHdoZW4gKGRl cml2ZWQtbW9kZS1wIG1vZGUpCisgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkp KSkKKyAgICAgICAgICAgKChtZW1xIG1ham9yLW1vZGUgKy10cnVuY2F0ZS1saW5lcy1tYWpvci1t b2RlcykpCisgICAgICAgICAgICh0CisgICAgICAgICAgICAgbmlsKSkpCisgICAgICAoc2V0ICht YWtlLWxvY2FsLXZhcmlhYmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRvd3MpIG5pbCkK KyAgICAgIChzZXRxIHdvcmQtd3JhcCB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGlu ZXMgdCkKKyAgICAgIChzZXRxIGluZGljYXRlLWJ1ZmZlci1ib3VuZGFyaWVzICdsZWZ0KQorICAg ICAgKHNldHEgZnJpbmdlLWluZGljYXRvci1hbGlzdAorICAgICAgICAgIDs7OyBoc2NsX2FsbF90 ZW1wX3AgfCBoc2NsX3RlbXBfcAorICAgICAgICAnKCgrLWhzY2wtdGVtcCAuICgrLXNpbmdsZS1h bmdsZS1sZWZ0CisgICAgICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLWxlZnQp KQorICAgICAgICAgIDs7OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxsX3Blcm1fMV9wIHwg aHNjbF9hbGxfcGVybV8yX3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICgrLWhzY2wtcGVybSAu ICgrLXNpbmdsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1h bmdsZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLXRyaXBsZS1hbmdsZS11cAorICAg ICAgICAgICAgICAgICAgICAgICAgICArLXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAg KCstb3ZlcmxheS1hcnJvdyAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICArLWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAgKHRydW5jYXRp b24gLiAoKy1mcmluZ2UtbGVmdC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICstZnJp bmdlLXJpZ2h0LWFycm93KSkKKyAgICAgICAgICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxl ZnQtY3VybHktYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNoKSkK KyAgICAgICAgICAob3ZlcmxheS1hcnJvdyAuICstZnJpbmdlLXJpZ2h0LXRyaWFuZ2xlKQorICAg ICAgICAgICh1cCAuICstZnJpbmdlLXVwLWFycm93KQorICAgICAgICAgIChkb3duIC4gKy1mcmlu Z2UtZG93bi1hcnJvdykKKyAgICAgICAgICAodG9wIC4gKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUp CisgICAgICAgICAgKGJvdHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAg ICAgICAodG9wLWJvdHRvbSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQKKyAgICAgICAgICAgICAg ICAgICAgICAgICArLWZyaW5nZS1yaWdodC1icmFja2V0CisgICAgICAgICAgICAgICAgICAgICAg ICAgKy1mcmluZ2UtdG9wLXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgKy1m cmluZ2UtdG9wLWxlZnQtYW5nbGUpKQorICAgICAgICAgIChlbXB0eS1saW5lIC4gKy1mcmluZ2Ut ZW1wdHktbGluZSkKKyAgICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmsp KSkKKyAgICAgIChzZXRxIGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94IC4gKy1mcmluZ2UtbGVm dC10cmlhbmdsZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaG9sbG93IC4g Ky1ob2xsb3ctcmVjdGFuZ2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChi YXIgLiArLXZlcnRpY2FsLWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo aGJhciAuICstZnJpbmdlLWhvcml6b250YWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIChob2xsb3ctc21hbGwgLiArLWZyaW5nZS1ob2xsb3ctc3F1YXJlKSkpCisgICAg ICAoaWYgKG9yICstZm9ydGh3aXRoCisgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZp eC1hcmcgJyg0KSkpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJh dy1mb3J0aHdpdGggJ2FwcGVuZCAnbG9jYWwpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21t YW5kLWhvb2sgJystZHJhdy1jcm9zc2hhaXJzICdhcHBlbmQgJ2xvY2FsKSkKKyAgICAgICh3aGVu ICstZm9ydGh3aXRoCisgICAgICAgIChhZGQtaG9vayAnd2luZG93LWNvbmZpZ3VyYXRpb24tY2hh bmdlLWhvb2sgJystZHJhdy1mb3J0aHdpdGggbmlsICdsb2NhbCkpCisgICAgICAoYWRkLWhvb2sg J2NoYW5nZS1tYWpvci1tb2RlLWhvb2sgJ3R1cm4tb2ZmLSstbW9kZSBuaWwgJ2xvY2FsKQorICAg ICAgOzs7IE1hdGNoaW5nIHBhcmVudGhlc2VzIGRyYXdpbmcgZm9ydGh3aXRoIGludGVyZmVyZXMg d2l0aCB5YXNuaXBwZXQuCisgICAgICAod2hlbiArLWZvcnRod2l0aAorICAgICAgICAoc2V0cSAr LXBhcmVucy1wIG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55 KQorICAgICAgICAoY29uZAorICAgICAgICAgICgrLWZvcnRod2l0aAorICAgICAgICAgICAgKG1l c3NhZ2UgIlR1cm5lZCBPTiBgKy1tb2RlJyAtLSBEcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzIGlt bWVkaWF0ZWx5LiIpKQorICAgICAgICAgICgoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkp CisgICAgICAgICAgICA7OzsgTWF0Y2hpbmcgcGFyZW50aGVzZXMgd2lsbCBiZSBkcmF3biBpbW1l ZGlhdGVseS4KKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScgLS0gT3B0 aW1pemVkIGZvciBkZWJ1Z2dpbmcgcHVycG9zZXMuIikpCisgICAgICAgICAgKHQKKyAgICAgICAg ICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScuIikpKSkpCisgICAgKHQKKyAgICAgIChr aWxsLWxvY2FsLXZhcmlhYmxlICdmaWxsLWNvbHVtbikKKyAgICAgIChraWxsLWxvY2FsLXZhcmlh YmxlICdhdXRvLWhzY3JvbGwtbW9kZSkKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdoc2Ny b2xsLXN0ZXApCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnY3Jvc3NoYWlycykKKyAgICAg IChraWxsLWxvY2FsLXZhcmlhYmxlICdmYy12aXNpYmxlKQorICAgICAgKGtpbGwtbG9jYWwtdmFy aWFibGUgJ2Rpc3BsYXktbGluZS1udW1iZXJzKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUg J2Rpc3BsYXktbGluZS1udW1iZXJzLXdpZHRoKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUg J21jLWNvbmYpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnYnVmZmVyLWRpc3BsYXktdGFi bGUpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAndGFiLXdpZHRoKQorICAgICAgKGtpbGwt bG9jYWwtdmFyaWFibGUgJ2xpbmUtbW92ZS12aXN1YWwpCisgICAgICAoa2lsbC1sb2NhbC12YXJp YWJsZSAndHJ1bmNhdGUtbGluZXMpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAndHJ1bmNh dGUtcGFydGlhbC13aWR0aC13aW5kb3dzKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ3dv cmQtd3JhcCkKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdpbmRpY2F0ZS1lbXB0eS1saW5l cykKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdpbmRpY2F0ZS1idWZmZXItYm91bmRhcmll cykKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdmcmluZ2UtaW5kaWNhdG9yLWFsaXN0KQor ICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ2ZyaW5nZS1jdXJzb3ItYWxpc3QpCisgICAgICAo a2lsbC1sb2NhbC12YXJpYWJsZSAnKy1mb3J0aHdpdGgpCisgICAgICAoZG9saXN0IChzYXZlZCAr LS1zYXZlZC1zdGF0ZSkKKyAgICAgICAgKHNldCAobWFrZS1sb2NhbC12YXJpYWJsZSAoY2FyIHNh dmVkKSkgKGNkciBzYXZlZCkpKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJystLXNhdmVk LXN0YXRlKQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykKKyAgICAgICh3aGVuICht ZW1xICcrLWRyYXctZm9ydGh3aXRoIHBvc3QtY29tbWFuZC1ob29rKQorICAgICAgICAocmVtb3Zl LWhvb2sgJ3Bvc3QtY29tbWFuZC1ob29rICcrLWRyYXctZm9ydGh3aXRoICdsb2NhbCkpCisgICAg ICAod2hlbiAobWVtcSAnKy1kcmF3LWNyb3NzaGFpcnMgcG9zdC1jb21tYW5kLWhvb2spCisgICAg ICAgIChyZW1vdmUtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJhdy1jcm9zc2hhaXJzICds b2NhbCkpCisgICAgICAod2hlbiAobWVtcSAnKy1kcmF3LWZvcnRod2l0aCB3aW5kb3ctY29uZmln dXJhdGlvbi1jaGFuZ2UtaG9vaykKKyAgICAgICAgKHJlbW92ZS1ob29rICd3aW5kb3ctY29uZmln dXJhdGlvbi1jaGFuZ2UtaG9vayAnKy1kcmF3LWZvcnRod2l0aCAnbG9jYWwpKQorICAgICAgKHJl bW92ZS1ob29rICdjaGFuZ2UtbWFqb3ItbW9kZS1ob29rICd0dXJuLW9mZi0rLW1vZGUgJ2xvY2Fs KQorICAgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgICAgKHNldHEgdGltZXItaWRsZS1saXN0 IChkZWxxICstdGltZXItdmFyIHRpbWVyLWlkbGUtbGlzdCkpCisgICAgICAgIChzZXRxICstdGlt ZXItdmFyIG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQor ICAgICAgICAobWVzc2FnZSAiVHVybmVkIE9GRiBgKy1tb2RlJy4iKSkpKSkKKworKGRlZnVuIHR1 cm4tb2ZmLSstbW9kZSAoKQorICAoKy1tb2RlIC0xKSkKKworOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7CisKKyhkZWZ1biArLXBhcmVucy1mbiAoKQorICAiRG9jLXN0cmluZy4iCisgIChsZXQqICgo b3BvaW50IChwb2ludCkpCisgICAgICAgICAoZnJvbSAoaWYgKy1wYXJlbnMtZnJvbS1mbgorICAg ICAgICAgICAgICAgICAoZnVuY2FsbCArLXBhcmVucy1mcm9tLWZuKQorICAgICAgICAgICAgICAg ICAocG9pbnQtbWluKSkpCisgICAgICAgICAod2luIChzZWxlY3RlZC13aW5kb3cpKQorICAgICAg ICAgKGkgMCkKKyAgICAgICAgIChwcmVjZWRpbmctY2hhciAocHJlY2VkaW5nLWNoYXIpKQorICAg ICAgICAgKG9jaGFyIChjaGFyLWFmdGVyIG9wb2ludCkpCisgICAgICAgICAocG9zMQorICAgICAg ICAgICAoY29uZAorICAgICAgICAgICAgICgoYW5kIG9jaGFyCisgICAgICAgICAgICAgICAgICAg KG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDApID0+IG9wZW5pbmcgcGFyZW50aGVzaXMKKyAgICAg ICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgNDApCisgICAgICAgICAgICAgICAgICAgICAgIDs7 OyAoY2hhci10by1zdHJpbmcgOTEpID0+IG9wZW5pbmcgc3F1YXJlIGJyYWNrZXQKKyAgICAgICAg ICAgICAgICAgICAgICAgKD0gb2NoYXIgOTEpCisgICAgICAgICAgICAgICAgICAgICAgIDs7OyAo Y2hhci10by1zdHJpbmcgMTIzKSA9PiBvcGVuaW5nIHdhdnkgYnJhY2tldAorICAgICAgICAgICAg ICAgICAgICAgICAoPSBvY2hhciAxMjMpKSkKKyAgICAgICAgICAgICAgICAobWluICgxKyBvcG9p bnQpIChwb2ludC1tYXgpKSkKKyAgICAgICAgICAgICAoKG9yIDs7OyAoY2hhci10by1zdHJpbmcg NDEpID0+IGNsb3NpbmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGlu Zy1jaGFyIDQxKQorICAgICAgICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyA5MykgPT4g Y2xvc2luZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAgICAgICAgKD0gcHJlY2VkaW5nLWNo YXIgOTMpCisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDEyNSkgPT4gY2xv c2luZyB3YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDEy NSkpCisgICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWluKSAoMS0gb3BvaW50KSkpCisgICAg ICAgICAgICAgKHQKKyAgICAgICAgICAgICAgICBvcG9pbnQpKSkKKyAgICAgICAgIHBvczIKKyAg ICAgICAgIHNlbGVjdGVkLWZhY2UpCisgICAgKHNhdmUtZXhjdXJzaW9uCisgICAgICAoY29uZGl0 aW9uLWNhc2UgbmlsCisgICAgICAgICh3aGlsZSAoc2V0cSBwb3MxIChudGggMSAocGFyc2UtcGFy dGlhbC1zZXhwIGZyb20gcG9zMSkpKQorICAgICAgICAgIChzZXRxIHBvczIgKHNjYW4tc2V4cHMg cG9zMSAxKSkKKyAgICAgICAgICAoaWYgKD0gaSAxMCkKKyAgICAgICAgICAgIChzZXRxIGkgMSkK KyAgICAgICAgICAgIChzZXRxIGkgKDErIGkpKSkKKyAgICAgICAgICAoc2V0cSBzZWxlY3RlZC1m YWNlIChjb25kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLW9uZS1mYWNlKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAyKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICcrLXBhcmVucy10d28tZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKCg9IGkgMykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1w YXJlbnMtdGhyZWUtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkg NCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtZm91ci1mYWNl KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA1KQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1maXZlLWZhY2UpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICgoPSBpIDYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJystcGFyZW5zLXNpeC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAoKD0gaSA3KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1z ZXZlbi1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA4KQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1laWdodC1mYWNlKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA5KQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICcrLXBhcmVucy1uaW5lLWZhY2UpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICgoPSBpIDEwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICcrLXBhcmVucy10ZW4tZmFjZSkpKQorICAgICAgICAgIChsZXQgKChvdiAobWFrZS1vdmVybGF5 IHBvczEgKDErIHBvczEpKSkpCisgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZl LXdpbmRvd3MKKyAgICAgICAgICAgICAgKG92ZXJsYXktcHV0IG92ICd3aW5kb3cgd2luKSkKKyAg ICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBzZWxlY3RlZC1mYWNlKSkKKyAgICAgICAg ICAod2hlbiBwb3MyCisgICAgICAgICAgICAobGV0ICgob3YgKG1ha2Utb3ZlcmxheSAoMS0gcG9z MikgcG9zMikpKQorICAgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRv d3MKKyAgICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ3dpbmRvdyB3aW4pKQorICAgICAg ICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0ZWQtZmFjZSkpKSkKKyAgICAgICAg KGVycm9yIG5pbCkpKQorICAgIChzZXRxICstcGFyZW5zLW92ZXJsYXlzLWV4aXN0LXAgdCkpKQor CisoZGVmdW4gKy1yZW1vdmUtb3ZlcmxheXMgKGJlZyBlbmQgbmFtZSB2YWwpCisiUmVtb3ZlIHRo ZSBvdmVybGF5cyB0aGF0IGFyZSBgZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXNgLgorSW5jbHVk ZXMgYSB1bmlxdWUgc2l0dWF0aW9uIHdoZW4gYW4gb3ZlcmxheSB3aXRoIGFuIGAnYWZ0ZXItc3Ry aW5nYCBwcm9wZXJ0eQoraXMgYXQgdGhlIHZlcnkgZW5kIG9mIGEgbmFycm93ZWQtYnVmZmVyLiIK KyAgKGxldCogKChwb2ludC1tYXggKHBvaW50LW1heCkpCisgICAgICAgICAocG9pbnQtbWluIChw b2ludC1taW4pKQorICAgICAgICAgKG5hcnJvd2VkLXAgKGJ1ZmZlci1uYXJyb3dlZC1wKSkKKyAg ICAgICAgIChiZWcgKGlmIGJlZyBiZWcgcG9pbnQtbWluKSkKKyAgICAgICAgIChlbmQKKyAgICAg ICAgICAgKGNvbmQKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5h cnJvd2VkLXApCisgICAgICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAgIGVuZCkKKyAg ICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAg ICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICBwb2ludC1tYXgpCisgICAg ICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAg ICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKDwgZW5kIHBvaW50LW1heCkpCisgICAgICAgICAg ICAgICBlbmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQt cAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKD0gZW5kIHBvaW50LW1h eCkpCisgICAgICAgICAgICAgICAoMSsgZW5kKSkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAg ICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAg ICAgICAgICAgICAoMSsgcG9pbnQtbWF4KSkgKSkKKyAgICAgICAgIChvdmVybGF5cworICAgICAg ICAgICAocHJvZ24KKyAgICAgICAgICAgICAob3ZlcmxheS1yZWNlbnRlciBlbmQpCisgICAgICAg ICAgICAgKG92ZXJsYXlzLWluIGJlZyBlbmQpKSkpCisgICAgKHdoZW4gKGFuZCBiZWcgZW5kIG5h bWUgdmFsKQorICAgICAgKGRvbGlzdCAobyBvdmVybGF5cykKKyAgICAgICAgKGNvbmQKKyAgICAg ICAgICAoKGFuZCAoZXEgbmFtZSAnZmFjZSkKKyAgICAgICAgICAgICAgICAoZXEgKG92ZXJsYXkt Z2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIDs7IEVpdGhlciBwdXNoIHRoaXMgb3Zlcmxh eSBvdXRzaWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsgb3Igc3BsaXQgaXQgdG8gZXhjbHVk ZSBiZWcuLi5lbmQKKyAgICAgICAgICAgIDs7IG9yIGRlbGV0ZSBpdCBlbnRpcmVseSAoaWYgaXQg aXMgY29udGFpbmVkIGluIGJlZy4uLmVuZCkuCisgICAgICAgICAgICAoaWYgKDwgKG92ZXJsYXkt c3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAgIChpZiAoPiAob3ZlcmxheS1lbmQgbykgZW5k KQorICAgICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IChj b3B5LW92ZXJsYXkgbykKKyAgICAgICAgICAgICAgICAgIChvdmVybGF5LXN0YXJ0IG8pIGJlZykK KyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkpCisg ICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gKG92ZXJsYXktc3RhcnQgbykgYmVnKSkK KyAgICAgICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBvKSBlbmQpCisgICAgICAgICAgICAg ICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkKKyAgICAgICAgICAgICAg ICAoZGVsZXRlLW92ZXJsYXkgbykpKSkKKyAgICAgICAgICAoKGFuZCAobm90IChlcSBuYW1lICdm YWNlKSkKKyAgICAgICAgICAgICAgICAoZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXMgKG92ZXJs YXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIChkZWxldGU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XIgZmMtbW9kZSkKKworKGRlZnZhciBmYy10aW1lci12YXIgbmlsCisiVGltZXIgdXNl ZCB0byBoaWdobGlnaHQgY3VycmVudCBjb2x1bW4gd2hlbmV2ZXIgRW1hY3MgaXMgaWRsZS4iKQor Cis7OzsjIyNhdXRvbG9hZAorKGRlZmluZS1taW5vci1tb2RlIGZjLW1vZGUKKyJNaW5vciBtb2Rl IGZvciBkaXNwbGF5aW5nIGEgdmlzdWFsIGZpbGwgY29sdW1uLiIKKyAgOmluaXQtdmFsdWUgbmls CisgIDpsaWdodGVyICIgRkMiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisgIDpncm91 cCAnZmMtbW9kZQorICAoY29uZAorICAgIDs7OyBgKy1tb2RlJyBoYXMgdGhlIGFiaWxpdHkgdG8g YWxzbyBkaXNwbGF5IGEgZmlsbCBjb2x1bW4gaW5kaWNhdG9yLgorICAgIDs7OyBTZWUgdGhlIHZh cmlhYmxlIGArLWZpbGwtY29sdW1uJy4KKyAgICAoKGFuZCBmYy1tb2RlICstbW9kZSkKKyAgICAg IChzZXRxIGZjLW1vZGUgbmlsKQorICAgICAgKG1lc3NhZ2UgIlR1cm5lZCBPRkYgYGZjLW1vZGUn ICglcykgLS0gc2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuIiAoY3VycmVudC1idWZm ZXIpKSkKKyAgICAoZmMtbW9kZQorICAgICAgKHdoZW4gKGFuZCBnbG9iYWwtZWxkb2MtbW9kZQor ICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAoZ2xvYmFs LWVsZG9jLW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBqaXQtbG9jay1jb250ZXh0LXRpbWVy CisgICAgICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAg ICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVu ICh0aW1lcnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVy IGppdC1sb2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250 ZXh0LXRpbWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250 ZXh0LWZvbnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkp CisgICAgICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAg ICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVu ICh0aW1lcnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNh bmNlbC10aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChm c2V0ICd1bmRvLWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAgICAgICAgICAgICAobGFtYmRhICgp IChhZGQtdG8tbGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1jaGFuZ2VkLWJ1ZmZlcnMgKGN1cnJl bnQtYnVmZmVyKSkpKQorICAgICAgICAoZnNldCAndW5kby1hdXRvLWFtYWxnYW1hdGUgJ2lnbm9y ZSkpCisgICAgICAod2hlbiBibGluay1jdXJzb3ItbW9kZQorICAgICAgICAoYmxpbmstY3Vyc29y LW1vZGUgLTEpCisgICAgICAgICh3aGVuIChtZW1xICdibGluay1jdXJzb3ItY2hlY2sgcG9zdC1j b21tYW5kLWhvb2spCisgICAgICAgICAgKHJlbW92ZS1ob29rICdwb3N0LWNvbW1h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Zm9yIGArLWJhci1wb3N0LXp2LWZhY2UnLiIK KyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICstcmV2ZXJzZWQtYmFyLXByZS16di1mYWNl CisgICcoKHQgKDpmb3JlZ3JvdW5kICJjeWFuMSIpKSkKKyAgIkZhY2UgZm9yIGArLXJldmVyc2Vk LWJhci1wcmUtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1yZXZl cnNlZC1iYXItYXQtenYtZmFjZQorICAnKCh0ICg6Zm9yZWdyb3VuZCAiY2hhcnRyZXVzZSIpKSkK KyAgIkZhY2UgZm9yIGArLXJldmVyc2VkLWJhci1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1t b2RlKQorCisoZGVmZmFjZSArLXJldmVyc2VkLWJhci1wb3N0LXp2LWZhY2UKKyAgJygodCAoOmZv cmVncm91bmQgImN5YW40IikpKQorICAiRmFjZSBmb3IgYCstcmV2ZXJzZWQtYmFyLXBvc3QtenYt ZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1ldmVuLXByZS16di1mYWNl CisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkK KyAgICAgOmZvcmVncm91bmQgInllbGxvdyIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29s b3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJjeWFuMSIpCisg ICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAg ICAgOmZvcmVncm91bmQgInllbGxvdyIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3Jz IDE2KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJjeWFuMSIpCisgICAg KCgoY2xhc3MgY29sb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ChtaW4tY29sb3JzIDg4 KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgIkRlZXBQaW5rMSIpCisgICAg KCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAg IDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9y cyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQor ICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQor ICAgICA6Zm9yZWdyb3VuZCAiRGVlcFBpbmsxIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1j b2xvcnMgOCkpCisgICAgIDpmb3JlZ3JvdW5kICJ3aGl0ZSIpCisgICAgKCgodHlwZSB0dHkpIChj bGFzcyBtb25vKSkKKyAgICAgOmludmVyc2UtdmlkZW8gdCkKKyAgICAodCA6Zm9yZWdyb3VuZCAi cGluayIpKQorICAiRmFjZSBmb3IgYCstZXZlbi1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1t b2RlKQorCisoZGVmZmFjZSArLWV2ZW4taW5hY3RpdmUtYXQtenYtZmFjZQorICAnKCgoKGNsYXNz IGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3Jv dW5kICJEZWVwUGluazQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJh Y2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAiRGVlcFBpbms0IikKKyAgICAoKChj bGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5kIGRhcmspKQorICAgICA6Zm9y ZWdyb3VuZCAiRGVlcFBpbms0IikKKyAg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zIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQp KQorICAgICA6Zm9yZWdyb3VuZCAiRGFya1NhbG1vbiIpCisgICAgKCgoY2xhc3MgY29sb3IpICht aW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5 KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91 bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGArLW9kZC1wb3N0LXp2LWZhY2UnLiIKKyAgOmdyb3Vw ICcrLW1vZGUpCisKKyhkZWZmYWNlICstb2RkLWluYWN0aXZlLXBvc3QtenYtZmFjZQorICAnKCgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpm b3JlZ3JvdW5kICJzaWVubmE0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgODgp IChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpm b3JlZ3JvdW5kICJzaWVubmE0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYp IChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikK KyAgICAoKCh0eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQor ICAgICh0IDpmb3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBgKy1vZGQtaW5hY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HcmVl bjQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGln aHQpKQorICAgICA6Zm9yZWdyb3VuZCAiRGFya09saXZlR3JlZW4iKQorICAgICgoKGNsYXNzIGNv bG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikKKyAgICAoKCh0 eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQorICAgICh0IDpm b3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBgKy1wb3N0LWZpbGwtaW5hY3RpdmUtcG9z dC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSBmYy1wcmUtenYtZmFj ZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykp CisgICAgIDpmb3JlZ3JvdW5kICJncmV5MTUiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNv bG9ycyA4OCkgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAiZ3JleTE1IikK KyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5kIGRhcmspKQor ICAgICA6Zm9yZWdyb3VuZCAiZ3JleTE1IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xv cnMgMTYpIChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgImdyZXkxNSIpCisg ICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hp dGUiKQorICAgICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVv IHQpCisgICAgKHQgOmZvcmVncm91bmQgInBpbmsiKSkKKyAg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N0IGJ1 ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBiLT5tY19pbmFjdGl2ZV93aW5kb3dzXyA9 IHZhbDsKK30KKworc3RhdGljIHZvaWQKK2JzZXRfY3Jvc3NoYWlycyAoc3RydWN0IGJ1ZmZlciAq YiwgTGlzcF9PYmplY3QgdmFsKQoreworICBiLT5jcm9zc2hhaXJzXyA9IHZhbDsKK30KKworc3Rh dGljIHZvaWQKK2JzZXRfY2hfaG9yaXpvbnRhbF9ydWxlciAoc3RydWN0IGJ1ZmZlciAqYiwgTGlz cF9PYmplY3QgdmFsKQoreworICBiLT5jaF9ob3Jpem9udGFsX3J1bGVyXyA9IHZhbDsKK30KKwor c3RhdGljIHZvaWQKK2JzZXRfY2hfdmVydGljYWxfcnVsZXIgKHN0cnVjdCBidWZmZXIgKmIsIExp c3BfT2JqZWN0IHZhbCkKK3sKKyAgYi0+Y2hfdmVydGljYWxfcnVsZXJfID0gdmFsOworfQorCitz dGF0aWMgdm9pZAorYnNldF9jaF9pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBM aXNwX09iamVjdCB2YWwpCit7CisgIGItPmNoX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQor CitzdGF0aWMgdm9pZAorYnNldF9mY192aXNpYmxlIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09i amVjdCB2YWwpCit7CisgIGItPmZjX3Zpc2libGVfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAor YnNldF9mY19pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2 YWwpCit7CisgIGItPmZjX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCisvKiBlbmQgTVVM VElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKw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ywgUW5pbCk7CisgIGJzZXRfbWNfaW5h Y3RpdmVfd2luZG93cyAoJmJ1ZmZlcl9kZWZhdWx0cywgUXQpOworICBic2V0X2Nyb3NzaGFpcnMg KCZidWZmZXJfZGVmYXVsdHMsIFFuaWwpOworICBic2V0X2NoX2hvcml6b250YWxfcnVsZXIgKCZi dWZmZXJfZGVmYXVsdHMsIFF0KTsKKyAgYnNldF9jaF92ZXJ0aWNhbF9ydWxlciAoJmJ1ZmZlcl9k ZWZhdWx0cywgUXQpOworICBic2V0X2NoX2luYWN0aXZlX3dpbmRvd3MgKCZidWZmZXJfZGVmYXVs dHMsIFF0KTsKKyAgYnNldF9mY192aXNpYmxlICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKKyAg YnNldF9mY19pbmFjdGl2ZV93aW5kb3dzICgmYnVmZmVyX2RlZmF1bHRzLCBRdCk7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgYnNldF9tb2RlX2xpbmVfZm9ybWF0ICgmYnVmZmVy X2RlZmF1bHRzLCBidWlsZF9wdXJlX2Nfc3RyaW5nICgiJS0iKSk7CiAgIGJzZXRfaGVhZGVyX2xp bmVfZm9ybWF0ICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKICAgYnNldF9hYmJyZXZfbW9kZSAo JmJ1ZmZlcl9kZWZhdWx0cywgUW5pbCk7CkBAIC01NDYxLDYgKzU1NjAsNTEgQEAgZGVmdmFyX3Bl cl9idWZmZXIgKHN0cnVjdCBMaXNwX0J1ZmZlcl9PYmpmd2QgKmJvX2Z3ZCwgY29uc3QgY2hhciAq bmFtZXN0cmluZywKIHZvaWQKIHN5bXNfb2ZfYnVmZmVyICh2b2lkKQogeworCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKi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kgb2YgdGhpcyBidWZmZXIuICAqLwogICBM aXNwX09iamVjdCBleHRyYV9saW5lX3NwYWNpbmdfOwogCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIFRoZSBjdXJzb3IgdHlwZSBvZiB0 aGUgcmVhbCBmYWtlIGN1cnNvci4gKi8KKyAgTGlzcF9PYmplY3QgbWNfcmVhbF9mYWtlX2N1cnNv cl87CisKKyAgLyogVGhlIG5hbWUgb2YgbGlzdCB1c2VkIGJ5IG11bHRpcGxlIGN1cnNvcnMgZm9y IG5leHQgcmVkaXNwbGF5LiAqLworICBMaXNwX09iamVjdCBtY19jb25mXzsKKworICAvKiBXaGV0 aGVyIHRvIGRyYXcgbXVsdGlwbGUgY3Vyc29ycyBpbiBpbmFjdGl2ZSB3aW5kb3dzLiAqLworICBM aXNwX09iamVjdCBtY19pbmFjdGl2ZV93aW5kb3dzXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUg YnVmZmVyLWxvY2FsIHZhcmlhYmxlLiAqLworICBMaXNwX09iamVjdCBjcm9zc2hhaXJzXzsKKwor ICAvKiBUaGUgbmFtZSBvZiB0aGUgY3Jvc3NoYWlycyBob3Jpem9udGFsIHJ1bGVyLiAqLworICBM aXNwX09iamVjdCBjaF9ob3Jpem9udGFsX3J1bGVyXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUg Y3Jvc3NoYWlycyB2ZXJ0aWNhbCBydWxlci4gKi8KKyAgTGlzcF9PYmplY3QgY2hfdmVydGljYWxf cnVsZXJfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBjcm9zc2hhaXJzIGluIGluYWN0aXZlIHdp bmRvd3MuICovCisgIExpc3BfT2JqZWN0IGNoX2luYWN0aXZlX3dpbmRvd3NfOworCisgIC8qIFRo ZSBuYW1lIG9mIHRoZSBidWZmZXItbG9jYWwgdmFyaWFibGUuICovCisgIExpc3BfT2JqZWN0IGZj X3Zpc2libGVfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBtdWx0aXBsZSBjdXJzb3JzIGZpbGwg Y29sdW1uIGluIGluYWN0aXZlIHdpbmRvd3MuICovCisgIExpc3BfT2JqZWN0IGZjX2luYWN0aXZl X3dpbmRvd3NfOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIEN1cnNvciB0 eXBlIHRvIGRpc3BsYXkgaW4gbm9uLXNlbGVjdGVkIHdpbmRvd3MuCiAgICAgIHQgbWVhbnMgdG8g dXNlIGhvbGxvdyBib3ggY3Vyc29yLgogICAgICBTZWUgYGN1cnNvci10eXBlJyBmb3Igb3RoZXIg dmFsdWVzLiAgKi8KQEAgLTc5MSwxNCArODI1LDIxIEBAIHN0cnVjdCBidWZmZXIKICAgICAgYW4g aW5kaXJlY3QgYnVmZmVyIHNpbmNlIGl0IGNvdW50cyBhcyBpdHMgYmFzZSBidWZmZXIuICAqLwog ICBpbnQgd2luZG93X2NvdW50OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCiAgIC8qIEEgbm9uLXplcm8gdmFsdWUgaW4gc2xvdCBJRFggbWVh bnMgdGhhdCBwZXItYnVmZmVyIHZhcmlhYmxlCiAgICAgIHdpdGggaW5kZXggSURYIGhhcyBhIGxv Y2FsIHZhbHVlIGluIHRoaXMgYnVmZmVyLiAgVGhlIGluZGV4IElEWAogICAgICBmb3IgYSBidWZm ZXItbG9jYWwgdmFyaWFibGUgaXMgc3RvcmVkIGluIHRoYXQgdmFyaWFibGUncyBzbG90CiAgICAg IGluIGJ1ZmZlcl9sb2NhbF9mbGFncyBhcyBhIExpc3AgaW50ZWdlci4gIElmIHRoZSBpbmRleCBp cyAtMSwKICAgICAgdGhpcyBtZWFucyB0aGUgdmFyaWFibGUgaXMgYWx3YXlzIGxvY2FsIGluIGFs bCBidWZmZXJzLiAgKi8KLSNkZWZpbmUgTUFYX1BFUl9CVUZGRVJfVkFSUyA1MAorI2RlZmluZSBN QVhfUEVSX0JVRkZFUl9WQVJTIDYwCiAgIGNoYXIgbG9jYWxfZmxhZ3NbTUFYX1BFUl9CVUZGRVJf VkFSU107CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogU2V0IHRvIHRoZSBt b2R0aW1lIG9mIHRoZSB2aXNpdGVkIGZpbGUgd2hlbiByZWFkIG9yIHdyaXR0ZW4uCiAgICAgIG1v ZHRpbWUudHZfbnNlYyA9PSBOT05FWElTVEVOVF9NT0RUSU1FX05TRUNTIG1lYW5zCiAgICAgIHZp c2l0ZWQgZmlsZSB3YXMgbm9uZXhpc3RlbnQuICBtb2R0aW1lLnR2X25zZWMgPT0KQEAgLTkwNyw2 ICs5NDgsNjkgQEAgWEJVRkZFUiAoTGlzcF9PYmplY3QgYSkKIC8qIE1vc3QgY29kZSBzaG91bGQg dXNlIHRoZXNlIGZ1bmN0aW9ucyB0byBzZXQgTGlzcCBmaWVsZHMgaW4gc3RydWN0CiAgICBidWZm ZXIuICAoU29tZSBzZXR0ZXJzIHRoYXQgYXJlIHByaXZhdGUgdG8gYSBzaW5nbGUgLmMgZmlsZSBh cmUKICAgIGRlZmluZWQgYXMgc3RhdGljIGluIHRob3NlIGZpbGVzLikgICovCisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK0lOTElO RSB2b2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pYmxlIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09i amVjdCB2YWwpCit7CisgIGItPmZjX3Zpc2libGVfID0gdmFsOworfQorCitJTkxJTkUgdm9pZAor YnNldF9ibHZfZmNfaW5hY3RpdmVfd2luZG93cyAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmpl Y3QgdmFsKQoreworICBiLT5mY19pbmFjdGl2ZV93aW5kb3dzXyA9IHZhbDsKK30KKworLyogZW5k IE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIElOTElO RSB2b2lkCiBic2V0X2JpZGlfcGFyYWdyYXBoX2RpcmVjdGlvbiAoc3RydWN0IGJ1ZmZlciAqYiwg TGlzcF9PYmplY3QgdmFsKQogewpkaWZmIC0tZ2l0IGEvc3JjL2Rpc3BleHRlcm4uaCBiL3NyYy9k aXNwZXh0ZXJuLmgKaW5kZXggNGU5NDdkYS4uODZhZGVhMyAxMDA2NDQKLS0tIGEvc3JjL2Rpc3Bl eHRlcm4uaAorKysgYi9zcmMvZGlzcGV4dGVybi5oCkBAIC0xNDUsNiArMTQ1LDEzMSBAQCB0eXBl ZGVmIHZvaWQgKkVtYWNzX0N1cnNvcjsKICNkZWZpbmUgTmF0aXZlUmVjdGFuZ2xlIGludAogI2Vu ZGlmCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJT T1JTICovCisKK2V4dGVybiBib29sIG1jX3N0ZGVycl9wIEVYVEVSTkFMTFlfVklTSUJMRTsKKwor c3RydWN0IGdseXBoOworCitzdHJ1Y3QgZ2x5cGhfcm93OworCitzdHJ1Y3QgZ2x5cGhfbWF0cml4 OworCitlbnVtIGRyYXdfZ2x5cGhzX2ZhY2U7CisKK2VudW0gZ2x5cGhfcm93X2FyZWE7CisKK3N0 cnVjdCBtY19tYXRyaXg7CisKK2VudW0gbWNfY2FjaGVfdHlwZTsKKworZW51bSBtY19jdXJzb3Jf dHlwZTsKKworZW51bSBtY19mbGF2b3I7CisKK3N0cnVjdCBtY19SR0I7CisKK3N0cnVjdCBtY19l c3NlbnRpYWxzOworCitlbnVtIG1jX2RyYXdfcm93X3R5cGU7CisKK2VudW0gbWNfZW5naW5lX3R5 cGU7CisKK2VudW0gbWNfcm93X3Bvc2l0aW9uOworCitlbnVtIG1jX3JlZHJhd19yb3dfdHlwZTsK KworZW51bSBkcmF3X2dseXBoX2FjdGlvbjsKKworZXh0ZXJuIExpc3BfT2JqZWN0IG1jX2xpc3Ru IChwdHJkaWZmX3QsIExpc3BfT2JqZWN0LCAuLi4pOworCitleHRlcm4gTGlzcF9PYmplY3QgbWNf bnRoIChpbnQsIExpc3BfT2JqZWN0KTsKKworZXh0ZXJuIExpc3BfT2JqZWN0IG1jX2Fzc3EgKExp c3BfT2JqZWN0LCBMaXNwX09iamVjdCk7CisKK2V4dGVybiBlbnVtIG1jX3Jvd19wb3NpdGlvbiBt Y19yb3dfcG9zaXRpb24gKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3Jv dyAqLCBpbnQpOworCitleHRlcm4gcHRyZGlmZl90IG1jX3JlZ2lvbl9saW1pdCAoYm9vbCk7CisK K2V4dGVybiBzdHJ1Y3QgZ2x5cGggKiBtY19nZXRfY3Vyc29yX2dseXBoIChzdHJ1Y3Qgd2luZG93 ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICosIGludCwgaW50KTsKKworZXh0ZXJu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AqLCBMaXNwX09iamVjdCwgaW50LCBpbnQpOworCitl eHRlcm4gdm9pZCBtY19lbmdpbmUgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJp eCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBn bHlwaCAqLCBpbnQsIGludCwgaW50LCBpbnQsIGludCwgaW50LAorICAgICAgICAgICAgICAgICAg ICAgICBlbnVtIG1jX2N1cnNvcl90eXBlLCBpbnQsIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwKKyAg ICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX2Vzc2VudGlhbHMsIGVudW0gbWNfcm93X3Bv c2l0aW9uLCBzdHJ1Y3QgbWNfUkdCLAorICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2Vu Z2luZV90eXBlLCBib29sLCBlbnVtIG1jX2RyYXdfcm93X3R5cGUsCisgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gbWNfY2FjaGVfdHlwZSk7CisKK2V4dGVybiB2b2lkIG1jX3NldF9lc3NlbnRp YWxzIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBtY19lc3NlbnRpYWxzICopOworCitleHRlcm4g dm9pZCBtY19kcmF3X3JvdyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICos IHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5 cGggKiwgaW50LCBpbnQsIGludCwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAg ICAgICAgICAgICAgIHN0cnVjdCBtY19lc3NlbnRpYWxzLCBlbnVtIG1jX3Jvd19wb3NpdGlvbiwg Ym9vbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2RyYXdfcm93X3R5cGUpOwor CitleHRlcm4gYm9vbCBtY19yZWRyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlw aF9tYXRyaXggKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgZW51bSBnbHlwaF9yb3dfYXJlYSwgaW50LCBpbnQsIGludCwgYm9vbCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSwgZW51bSBtY19yZWRyYXdfcm93 X3R5cGUpOworCitleHRlcm4gdm9pZCBtY19yZXNldF9jYWNoZSAoc3RydWN0IHdpbmRvdyAqKTsK KworZXh0ZXJuIHZvaWQgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHN0cnVjdCB3aW5kb3cgKiwgc3Ry dWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0 cnVjdCBnbHlwaF9yb3cgKiwgZW51bSBkcmF3X2dseXBoc19mYWNlLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGludCwgaW50LCBpbnQsIHN0cnVjdCBtY19SR0IsIGVudW0gbWNf Zmxhdm9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29y X3R5cGUsIGludCwgYm9vbCwgYm9vbCk7CisKK2V4dGVybiB2b2lkIG1jX2VyYXNlX2N1cnNvciAo c3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cg KiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIGludCwgaW50LCBlbnVt IG1jX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3Jf dHlwZSwgaW50KTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHN0cnVjdCB3 aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIGludCwgaW50LCBpbnQsIGlu dCwgaW50LCBpbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19j dXJzb3JfdHlwZSwgaW50LCBzdHJ1Y3QgbWNfUkdCLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGJvb2wsIGVudW0gbWNfZmxhdm9yLCBib29sKTsKKworZXh0ZXJuIGludCBtY19k cmF3X2dseXBocyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVj dCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCwgZW51bSBnbHlw aF9yb3dfYXJlYSwgcHRyZGlmZl90LCBwdHJkaWZmX3QsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UsIGludCwgaW50LCBzdHJ1Y3QgbWNfUkdCLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19mbGF2b3IsIGVudW0gbWNfY3Vyc29yX3R5 cGUsIGludCwgYm9vbCwgYm9vbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gZHJh d19nbHlwaF9hY3Rpb24sIGJvb2wpOworCitleHRlcm4gc3RydWN0IGdseXBoX21hdHJpeCAqIG1j X3NhdmVfZ2x5cGhfbWF0cml4IChzdHJ1Y3QgZ2x5cGhfbWF0cml4ICopOworCitleHRlcm4gdm9p ZCBtY19yZXN0b3JlX2dseXBoX21hdHJpeCAoc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3Qg Z2x5cGhfbWF0cml4ICopOworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogLyogVGV4dCBjdXJzb3IgdHlwZXMuICAqLwogCiBlbnVtIHRl eHRfY3Vyc29yX2tpbmRzCkBAIC00MDQsNiArNTI5LDE4IEBAIHN0cnVjdCBnbHlwaF9zbGljZQog CiBzdHJ1Y3QgZ2x5cGgKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJ UExFLUNVUlNPUlMgKi8KKworICBpbnQgcmVsYXRpdmVfeCwgaHBvczsKKworICBwdHJkaWZmX3Qg Ynl0ZXBvczsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBQb3NpdGlvbiBm cm9tIHdoaWNoIHRoaXMgZ2x5cGggd2FzIGRyYXduLiAgSWYgYG9iamVjdCcgYmVsb3cgaXMgYQog ICAgICBMaXNwIHN0cmluZywgdGhpcyBpcyBhbiBpbmRleCBpbnRvIHRoYXQgc3RyaW5nLiAgSWYg aXQgaXMgYQogICAgICBidWZmZXIsIHRoaXMgaXMgYSBwb3NpdGlvbiBpbiB0aGF0IGJ1ZmZlci4g IEluIGFkZGl0aW9uLCBzb21lCkBAIC0xMjcwLDYgKzE0MDcsMjggQEAgZW51bSBkcmF3X2dseXBo c19mYWNlCiAKIHN0cnVjdCBnbHlwaF9zdHJpbmcKIHsKKworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIGJvb2xfYmYgbGVmdF9vdmVyd3Jp dHRlbl9wIDogMTsKKworICAgIGJvb2xfYmYgcmlnaHRfb3ZlcndyaXR0ZW5fcCA6IDE7CisKKyAg ICBib29sX2JmIHJlY3RhbmdsZV9udWtlZF9wIDogMTsKKworICAgIGJvb2xfYmYgYmFja2dyb3Vu ZF9udWtlZF9wIDogMTsKKworICAgIGVudW0gZHJhd19nbHlwaF9hY3Rpb24KKyAgICB7CisgICAg ICBNQ19EUkFXX0dMWVBIX1NUUklORywKKyAgICAgIE1DX0VSQVNFX0dMWVBIX1NUUklORworICAg IH0gYWN0aW9uX3R5cGU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogWC1v cmlnaW4gb2YgdGhlIHN0cmluZy4gICovCiAgIGludCB4OwogCkBAIC0yODM0LDYgKzI5OTMsMjgg QEAgdHlwZWRlZiB2b2lkICgqZnJhbWVfcGFybV9oYW5kbGVyKSAoc3RydWN0IGZyYW1lICosIExp c3BfT2JqZWN0LCBMaXNwX09iamVjdCk7CiAKIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlCiB7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK Ky8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgbnN0ZXJtLm1gIHwgYHczMnRlcm0uY2AgfCBg eHRlcm0uY2AgbXVzdCBiZSBpbiB0aGUKK2V4YWN0IHNhbWUgb3JkZXIgYXMgdGhlIGByZWRpc3Bs YXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4dGVybi5oYCEgKi8KKworICAvKiBgbWNfbnNfZHJhd193 aW5kb3dfY3Vyc29yJyB8IGBtY193MzJfZHJhd193aW5kb3dfY3Vyc29yJyB8IGBtY194X2RyYXdf d2luZG93X2N1cnNvcicgKi8KKyAgdm9pZCAoKm1jX3NjcmliZV9jdX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tPm5yb3dzOyArK2kpCisgICAgeworICAgICAgc3RydWN0IGdseXBoX3JvdyAqZnJvbSA9IHNh dmVkLT5yb3dzICsgaTsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnRvID0gbWF0cml4LT5yb3dz ICsgaTsKKyAgICAgIHB0cmRpZmZfdCBuYnl0ZXMgPSBmcm9tLT51c2VkW1RFWFRfQVJFQV0gKiBz aXplb2YgKHN0cnVjdCBnbHlwaCk7CisgICAgICBtZW1jcHkgKHRvLT5nbHlwaHNbVEVYVF9BUkVB XSwgZnJvbS0+Z2x5cGhzW1RFWFRfQVJFQV0sIG5ieXRlcyk7CisgICAgICB0by0+dXNlZFtURVhU X0FSRUFdID0gZnJvbS0+dXNlZFtURVhUX0FSRUFdOworICAgICAgdG8tPmhhc2ggPSBmcm9tLT5o YXNoOworICAgICAgdG8tPnggPSBmcm9tLT54OworICAgICAgdG8tPnkgPSBmcm9tLT55OworICAg ICAgdG8tPnBpeGVsX3dpZHRoID0gZnJvbS0+cGl4ZWxfd2lkdGg7CisgICAgICB0by0+YXNjZW50 ID0gZnJvbS0+YXNjZW50OworICAgICAgdG8tPmhlaWdodCA9IGZyb20tPmhlaWdodDsKKyAgICAg IHRvLT5waHlzX2FzY2VudCA9IGZyb20tPnBoeXNfYXNjZW50OworICAgICAgdG8tPnBoeXNfaGVp Z2h0ID0gZnJvbS0+cGh5c19oZWlnaHQ7CisgICAgICB0by0+dmlzaWJsZV9oZWlnaHQgPSBmcm9t LT52aXNpYmxlX2hlaWdodDsKKyAgICAgIHRvLT5leHRyYV9saW5lX3NwYWNpbmcgPSBmcm9tLT5l eHRyYV9saW5lX3NwYWNpbmc7CisgICAgICB0by0+c3RhcnQgPSBmcm9tLT5zdGFydDsKKyAgICAg IHRvLT5lbmQgPSBmcm9tLT5lbmQ7CisgICAgICB0by0+bWlucG9zID0gZnJvbS0+bWlucG9zOwor ICAgICAgdG8tPm1heHBvcyA9IGZyb20tPm1heHBvczsKKyAgICAgIH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x5cGhfbWF0cml4ICpjdXJyZW50X21hdHJpeCA9IHctPmN1cnJl bnRfbWF0cml4OworICBpbnQgeWIgPSB3aW5kb3dfdGV4dF9ib3R0b21feSAodyk7CisgIHB0cmRp ZmZfdCBpOworICBpbnQgaiwgZmlyc3Rfb2xkLCBmaXJzdF9uZXcsIGxhc3Rfb2xkLCBsYXN0X25l dzsKKyAgaW50IG5ydW5zLCBydW5faWR4OworICBwdHJkaWZmX3QgbjsKKyAgc3RydWN0IG1jX3Jv d19lbnRyeSAqZW50cnk7CisgIC8vIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlICpyaWYgPSBG UkFNRV9SSUYgKFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSkpOworICAvKiBTa2lwIG92ZXIgcm93 cyBlcXVhbCBhdCB0aGUgc3RhcnQuICovCisgIGZvciAoaSA9IGhlYWRlcl9saW5lX3A7IGkgPCBj dXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgeworICAgICAgc3RydWN0IGdseXBo X3JvdyAqZCA9IE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCBpKTsKKyAgICAgIHN0cnVjdCBn bHlwaF9yb3cgKmMgPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSk7CisgICAgICBpZiAo Yy0+ZW5hYmxlZF9wCisgICAgICAgICAgJiYgZC0+ZW5hYmxlZF9wCisgICAgICAgICAgJiYgIWQt PnJlZHJhd19mcmluZ2VfYml0bWFwc19wCisgICAgICAgICAgJiYgYy0+eSA9PSBkLT55CisgICAg ICAgICAgJiYgTUFUUklYX1JPV19CT1RUT01fWSAoYykgPD0geWIKKyAgICAgICAgICAmJiBNQVRS SVhfUk9XX0JPVFRPTV9ZIChkKSA8PSB5YgorICAgICAgICAgICYmIHJvd19lcXVhbF9wIChjLCBk LCAxKSkKKyAgICAgICAgeworICAgICAgICAgIGFzc2lnbl9yb3cgKGMsIGQpOworICAgICAgICAg IGQtP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m90dG9tID49IHliKQorICAgICAgICBi cmVhazsKKyAgICB9CisgIGxhc3RfbmV3ID0gaTsKKyAgLyogU2V0IGxhc3Rfb2xkIHRvIHRoZSBp bmRleCArIDEgb2YgdGhlIHJvdyB0aGF0IHJlYWNoZXMgdGhlIGJvdHRvbQorICAgICBib3VuZGFy eSBpbiB0aGUgY3VycmVudCBtYXRyaXguICBXZSBkb24ndCBsb29rIGF0IHRoZSBlbmFibGVkCisg ICAgIGZsYWcgaGVyZSBiZWNhdXNlIHdlIHBsYW4gdG8gcmV1c2UgcGFydCBvZiB0aGUgZGlzcGxh eSBldmVuIGlmCisgICAgIG90aGVyIHBhcnRzIGFyZSBkaXNhYmxlZC4gKi8KKyAgaSA9IGZpcnN0 X29sZCArIDE7CisgIHdoaWxlIChpIDwgY3VycmVudF9tYXRyaXgtPm5yb3dzIC0gMSkKKyAgICB7 CisgICAgICBpbnQgYm90dG9tID0gTUFUUklYX1JPV19CT1RUT01fWSAoTUFUUklYX1JPVyAoY3Vy cmVudF9tYXRyaXgsIGkpKTsKKyAgICAgIGlmIChib3R0b20gPD0geWIpCisgICAgICAgICsraTsK KyAgICAgIGlmIChib3R0b20gPj0geWIpCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgbGFzdF9v bGQgPSBpOworICAvKiBTa2lwIG92ZXIgcm93cyBlcXVhbCBhdCB0aGUgYm90dG9tLiAqLworICBp ID0gbGFzdF9uZXc7CisgIGogPSBsYXN0X29sZDsKKyAgd2hpbGUgKGkgLSAxID4gZmlyc3RfbmV3 CisgICAgICAgICAmJiBqIC0gMSA+IGZpcnN0X29sZAorICAgICAgICAgJiYgTUFUUklYX1JPV19F TkFCTEVEX1AgKGN1cnJlbnRfbWF0cml4LCBqIC0gMSkKKyAgICAgICAgICYmIChNQVRSSVhfUk9X IChjdXJyZW50X21hdHJpeCwgaiAtIDEpLT55CisgICAgICAgICAgICAgPT0gTUFUUklYX1JPVyAo ZGVzaXJlZF9tYXRyaXgsIGkgLSAxKS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fYWxtb3N0X3ByaW1lICgx MTMpIHdvdWxkIGJlIDEyNy4gKi8KKyAgeworICAgIHZlcmlmeSAoTkVYVF9BTE1PU1RfUFJJTUVf TElNSVQgPT0gMTEpOworICAgIGVudW0geyBuZXh0X2FsbW9zdF9wcmltZV9pbmNyZW1lbnRfbWF4 ID0gMTAgfTsKKyAgICBwdHJkaWZmX3Qgcm93X3RhYmxlX21heCA9CisgICAgICAobWluIChQVFJE SUZGX01BWCwgU0laRV9NQVgpIC8gKDMgKiBzaXplb2YgKm1jX3Jvd190YWJsZSkKKyAgICAgICAt IG5leHRfYWxtb3N0X3ByaW1lX2luY3JlbWVudF9tYXgpOworICAgIHB0cmRpZmZfdCBjdXJyZW50 X25yb3dzX21heCA9IHJvd190YWJsZV9tYXggLSBkZXNpcmVkX21hdHJpeC0+bnJvd3M7CisgICAg aWYgKGN1cnJlbnRfbnJvd3NfbWF4IDwgY3VycmVudF9tYXRyaXgtPm5yb3dzKQorICAgICAgbWVt b3J5X2Z1bGwgKFNJWkVfTUFYKTsKKyAgfQorICAvKiBSZWFsbG9jYXRlIHZlY3RvcnMsIHRhYmxl cyBldGMuIGlmIG5lY2Vzc2FyeS4gKi8KKyAgaWYgKGN1cnJlbnRfbWF0cml4LT5ucm93cyA+IG1j X29sZF9saW5lc19zaXplKQorICAgIG1jX29sZF9saW5lcyA9IHhwYWxsb2MgKG1jX29sZF9saW5l cywgJm1jX29sZF9saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRf bWF0cml4LT5ucm93cyAtIG1jX29sZF9saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAg ICAgIElOVF9NQVgsIHNpemVvZiAqbWNfb2xkX2xpbmVzKTsKKyAgaWYgKGRlc2lyZWRfbWF0cml4 LT5ucm93cyA+IG1jX25ld19saW5lc19zaXplKQorICAgIG1jX25ld19saW5lcyA9IHhwYWxsb2Mg KG1jX25ld19saW5lcywgJm1jX25ld19saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAg ICAgIGRlc2lyZWRfbWF0cml4LT5ucm93cyAtIG1jX25ld19saW5lc19zaXplLAorICAgICAgICAg ICAgICAgICAgICAgICAgIElOVF9NQVgsIHNpemVvZiAqbWNfbmV3X2xpbmVzKTsKKyAgbiA9IGRl c2lyZWRfbWF0cml4LT5ucm93czsKKyAgbiArPSBjdXJyZW50X21hdHJpeC0+bnJvd3M7CisgIGlm IChtY19yb3dfdGFibGVfc2l6ZSA8IDMgKiBuKQorICAgIHsKKyAgICAgIHB0cmRpZmZfdCBzaXpl ID0gbmV4dF9hbG1vc3RfcHJpbWUgKDMgKiBuKTsKKyAgICAgIG1jX3Jvd190YWJsZSA9IHhucmVh bGxvYyAobWNfcm93X3RhYmxlLCBzaXplLCBzaXplb2YgKm1jX3Jvd190YWJsZSk7CisgICAgICBt Y19yb3dfdGFibGVfc2l6ZSA9IHNpemU7CisgICAgICBtZW1zZXQgKG1jX3Jvd190YWJsZSwgMCwg c2l6ZSAqIHNpemVvZiAqbWNfcm93X3RhYmxlKTsKKyAgICB9CisgIGlmIChuID4gbWNfcm93X2Vu dHJ5X3Bvb2xfc2l6ZSkKKyAgICBtY19yb3dfZW50cnlfcG9vbCA9IHhwYWxsb2MgKG1jX3Jvd19l bnRyeV9wb29sLCAmbWNfcm93X2VudHJ5X3Bvb2xfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIG4gLSBtY19yb3dfZW50cnlfcG9vbF9zaXplLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgLTEsIHNpemVvZiAqbWNfcm93X2VudHJ5X3Bvb2wpOworICBpZiAoZGVzaXJl ZF9tYXRyaXgtPm5yb3dzID4gbWNfcnVuc19zaXplKQorICAgIHsKKyAgICAgIG1jX3J1bnMgPSB4 bnJlYWxsb2MgKG1jX3J1bnMsIGRlc2lyZWRfbWF0cml4LT5ucm93cywgc2l6ZW9mICptY19ydW5z KTsKKyAgICAgIG1jX3J1bl9wb29sID0geG5yZWFsbG9jIChtY19ydW5fcG9vbCwgZGVzaXJlZF9t YXRyaXgtPm5yb3dzLCBzaXplb2YgKm1jX3J1bl9wb29sKTsKKyAgICAgIG1jX3J1bnNfc2l6ZSA9 IGRlc2lyZWRfbWF0cml4LT5ucm93czsKKyAgICB9CisgIG5ydW5zID0gcnVuX2lkeCA9IDA7Cisg IG1jX3Jvd19lbnRyeV9pZHggPSAwOworICAvKiBBZGQgcm93cyBmcm9tIHRoZSBjdXJyZW50IGFu ZCBkZXNpcmVkIG1hdHJpeCB0byB0aGUgaGFzaCB0YWJsZQorICAgICByb3dfaGFzaF90YWJsZSB0 byBiZSBhYmxlIHRvIGZpbmQgZXF1YWwgb25lcyBxdWlja2x5LiAqLworICBmb3IgKGkgPSBmaXJz dF9vbGQ7IGkgPCBsYXN0X29sZDsgKytpKQorICAgIHsKKyAgICAgIGlmIChNQVRSSVhfUk9XX0VO QUJMRURfUCAoY3VycmVudF9tYXRyaXgsIGkpKQorICAgICAgICB7CisgICAgICAgICAgZW50cnkg PSBtY19hZGRfcm93X2VudHJ5IChNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSkpOworICAg ICAgICAgIG1jX29sZF9saW5lc1tpXSA9IGVudHJ5OworICAgICAgICAgICsrZW50cnktPm9sZF91 c2VzOworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIG1jX29sZF9saW5lc1tpXSA9IE5V TEw7CisgICAgfQorICBmb3IgKGkgPSBmaXJzdF9uZXc7IGkgPCBsYXN0X25ldzsgKytpKQorICAg IHsKKyAgICAgIGVhc3NlcnQgKE1BVFJJWF9ST1dfRU5BQkxFRF9QIChkZXNpcmVkX21hdHJpeCwg aSkpOworICAgICAgZW50cnkgPSBtY19hZGRfcm93X2VudHJ5IChNQVRSSVhfUk9XIChkZXNpcmVk X21hdHJpeCwgaSkpOworICAgICAgKytlbnRyeS0+bmV3X3VzZXM7CisgICAgICBlbnRyeS0+bmV3 X2xpbmVfbnVtYmVyID0gaTsKKyAgICAgIG1jX25ld19saW5lc1tpXSA9IGVudHJ5OworICAgIH0K KyAgLyogSWRlbnRpZnkgbW92ZXMgYmFzZWQgb24gbGluZXMgdGhhdCBhcmUgdW5pcXVlIGFuZCBl cXVhbAorICAgICBpbiBib3RoIG1hdHJpY2VzLiAqLworICBmb3IgKGkgPSBmaXJzdF9vbGQ7IGkg PCBsYXN0X29sZDspCisgICAgaWYgKG1jX29sZF9saW5lc1tpXQorICAgICAgICAmJiBtY19vbGRf bGluZXNbaV0tPm9sZF91c2VzID09IDEKKyAgICAgICAgJiYgbWNfb2xkX2xpbmVzW2ldLT5uZXdf dXNlcyA9PSAxKQorICAgICAgeworICAgICAgICBpbnQgcCwgcTsKKyAgICAgICAgaW50IG5ld19s aW5lID0gbWNfb2xkX2xpbmVzW2ldLT5uZXdfbGluZV9udW1iZXI7CisgICAgICAgIHN0cnVjdCBy dW4gKnJ1biA9IG1jX3J1bl9wb29sICsgcnVuX2lkeCsrOworICAgICAgICAvKiBSZWNvcmQgbW92 ZS4gKi8KKyAgICAgICAgcnVuLT5jdXJyZW50X3Zwb3MgPSBpOworICAgICAgICBydW4tPmN1cnJl bnRfeSA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBpKS0+eTsKKyAgICAgICAgcnVuLT5k ZXNpcmVkX3Zwb3MgPSBuZXdfbGluZTsKKyAgICAgICAgcnVuLT5kZXNpcmVkX3kgPSBNQVRSSVhf Uk9XIChkZXNpcmVkX21hdHJpeCwgbmV3X2xpbmUpLT55OworICAgICAgICBydW4tPm5yb3dzID0g MTsKKyAgICAgICAgcnVuLT5oZWlnaHQgPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSkt PmhlaWdodDsKKyAgICAgICAgLyogRXh0ZW5kIGJhY2t3YXJkLiAqLworICAgICAgICBwID0gaSAt IDE7CisgICAgICAgIHEgPSBuZXdfbGluZSAtIDE7CisgICAgICAgIHdoaWxlIChwID4gZmlyc3Rf b2xkCisgICAgICAgICAgICAgICAmJiBxID4gZmlyc3RfbmV3CisgICAgICAgICAgICAgICAmJiBt Y19vbGRfbGluZXNbcF0gPT0gbWNfbmV3X2xpbmVzW3FdKQorICAgICAgICAgIHsKKyAgICAgICAg ICAgIGludCBoID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIHApLT5oZWlnaHQ7CisgICAg ICAgICAgICAtLXJ1bi0+Y3VycmVudF92cG9zOworICAgICAgICAgICAgLS1ydW4tPmRlc2lyZWRf dnBvczsKKyAgICAgICAgICAgICsrcnVuLT5ucm93czsKKyAgICAgICAgICAgIHJ1bi0+aGVpZ2h0 ICs9IGg7CisgICAgICAgICAgICBydW4tPmRlc2lyZWRfeSAtPSBoOworICAgICAgICAgICAgcnVu LT5jdXJyZW50X3kgLT0gaDsKKyAgICAgICAgICAgIC0tcCwgLS1xOworICAgICAgICAgIH0KKyAg ICAgICAgLyogRXh0ZW5kIGZvcndhcmQuICovCisgICAgICAgIHAgPSBpICsgMTsKKyAgICAgICAg cSA9IG5ld19saW5lICsgMTsKKyAgICAgICAgd2hpbGUgKHAgPCBsYXN0X29sZAorICAgICAgICAg ICAgICAgJiYgcSA8IGxhc3RfbmV3CisgICAgICAgICAgICAgICAmJiBtY19vbGRfbGluZXNbcF0g PT0gbWNfbmV3X2xpbmVzW3FdKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCBoID0gTUFU UklYX1JPVyAoY3VycmVudF9tYXRyaXgsIHApLT5oZWlnaHQ7CisgICAgICAgICAgICArK3J1bi0+ bnJvd3M7CisgICAgICAgICAgICBydW4tPmhlaWdodCArPSBoOworICAgICAgICAgICAgKytwLCAr K3E7CisgICAgICAgICAgfQorICAgICAgICAvKiBJbnNlcnQgcnVuIGludG8gbGlzdCBvZiBhbGwg cnVucy4gIE9yZGVyIHJ1bnMgYnkgY29waWVkCisgICAgICAgICAgIHBpeGVsIGxpbmVzLiAgTm90 ZSB0aGF0IHdlIHJlY29yZCBydW5zIHRoYXQgZG9uJ3QgaGF2ZSB0bworICAgICAgICAgICBiZSBj b3BpZWQgYmVjYXVzZSB0aGV5IGFyZSBhbHJlYWR5IGluIHBsYWNlLiAgVGhpcyBpcyBkb25lCisg ICAgICAgICAgIGJlY2F1c2Ugd2UgY2FuIGF2b2lkIGNhbGxpbmcgdXBkYXRlX3dpbmRvd19saW5l IGluIHRoaXMKKyAgICAgICAgICAgY2FzZS4gKi8KKyAgICAgICAgZm9yIChwID0gMDsgcCA8IG5y dW5zICYmIG1jX3J1bnNbcF0tPmhlaWdodCA+IHJ1bi0+aGVpZ2h0OyArK3ApCisgICAgICAgICAg OworICAgICAgICBmb3IgKHEgPSBucnVuczsgcSA+IHA7IC0tcSkKKyAgICAgICAgICBtY19ydW5z W3FdID0gbWNfcnVuc1txIC0gMV07CisgICAgICAgIG1jX3J1bnNbcF0gPSBydW47CisgICAgICAg ICsrbnJ1bnM7CisgICAgICAgIGkgKz0gcnVuLT5ucm93czsKKyAgICAgIH0KKyAgICAgIGVsc2UK KyAgICAgICAgKytpOworICAvKiBEbyB0aGUgbW92ZXMuICBEbyBpdCBpbiBhIHdheSB0aGF0IHdl IGRvbid0IG92ZXJ3cml0ZSBzb21ldGhpbmcKKyAgICAgd2Ugd2FudCB0byBjb3B5IGxhdGVyIG9u LiAgVGhpcyBpcyBub3Qgc29sdmFibGUgaW4gZ2VuZXJhbAorICAgICBiZWNhdXNlIHRoZXJlIGlz IG9ubHkgb25lIGRpc3BsYXkgYW5kIHdlIGRvbid0IGhhdmUgYSB3YXkgdG8KKyAgICAgZXhjaGFu Z2UgYXJlYXMgb24gdGhpcyBkaXNwbGF5LiAgRXhhbXBsZToKKyAgICAgICAgICArLS0tLS0tLS0t LS0rICAgICAgICstLS0tLS0tLS0tLSsKKyAgICAgICAgICB8ICAgICBBICAgICB8ICAgICAgIHwg ICAgIEIgICAgIHwKKyAgICAgICAgICArLS0tLS0tLS0tLS0rICAtLT4gICstLS0tLS0tLS0tLSsK KyAgICAgICAgICB8ICAgICBCICAgICB8ICAgICAgIHwgICAgIEEgICAgIHwKKyAgICAgICAgICAr LS0tLS0tLS0tLS0rICAgICAgICstLS0tLS0tLS0tLSsKKyAgICAgSW5zdGVhZCwgcHJlZmVyIGJp Z2dlciBtb3ZlcywgYW5kIGludmFsaWRhdGUgbW92ZXMgdGhhdCB3b3VsZAorICAgICBjb3B5IGZy b20gd2hlcmUgd2UgY29waWVkIHRvLiAqLworICBmb3IgKGkgPSAwOyBpIDwgbnJ1bnM7ICsraSkK KyAgICBpZiAobWNfcnVuc1tpXS0+bnJvd3MgPiAwKQorICAgICAgeworICAgICAgICBzdHJ1Y3Qg cnVuICpyID0gbWNfcnVuc1tpXTsKKyAgICAgICAgaWYgKHItPmN1cnJlbnRfeSAhPSByLT5kZXNp cmVkX3kpCisgICAgICAgICAgeworICAgICAgICAgICAgLy8gIGZwcmludGYgKHN0ZGVyciwgIiVz OiAgci0+Y3VycmVudC9kZXNpcmVkX3Zwb3MgKCVkLyVkKSB8IHItPmN1cnJlbnQvZGVzaXJlZF95 ICglZC8lZClcbiIsCisgICAgICAgICAgICAvLyAgICAgICAgICAgci0+Y3VycmVudF95IDwgci0+ ZGVzaXJlZF95ID8gIuKGkyIgOiAi4oaRIiwKKyAgICAgICAgICAgIC8vICAgICAgICAgICByLT5j dXJyZW50X3Zwb3MsIHItPmRlc2lyZWRfdnBvcywgci0+Y3VycmVudF95LCByLT5kZXNpcmVkX3kp OworICAgICAgICAgICAgLy8gIHJpZi0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOworICAg ICAgICAgICAgLy8gIHJpZi0+c2Nyb2xsX3J1bl9ob29rICh3LCByKTsKKyAgICAgICAgICB9Cisg ICAgICAgIC8qIFRydW5jYXRlIHJ1bnMgdGhhdCBjb3B5IHRvIHdoZXJlIHdlIGNvcGllZCB0bywg YW5kCisgICAgICAgICAgIGludmFsaWRhdGUgcnVucyB0aGF0IGNvcHkgZnJvbSB3aGVyZSB3ZSBj b3BpZWQgdG8uICovCisgICAgICAgIGZvciAoaiA9IG5ydW5zIC0gMTsgaiA+IGk7IC0taikKKyAg ICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgcnVuICpwID0gbWNfcnVuc1tqXTsKKyAgICAg ICAgICAgIGJvb2wgdHJ1bmNhdGVkX3AgPSAwOworICAgICAgICAgICAgaWYgKHAtPm5yb3dzID4g MAorICAgICAgICAgICAgICAgICYmIHAtPmRlc2lyZWRfeSA8IHItPmRlc2lyZWRfeSArIHItPmhl aWdodAorICAgICAgICAgICAgICAgICYmIHAtPmRlc2lyZWRfeSArIHAtPmhlaWdodCA+IHItPmRl c2lyZWRfeSkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChwLT5kZXNpcmVk X3kgPCByLT5kZXNpcmVkX3kpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgIHAtPm5yb3dzID0gci0+ZGVzaXJlZF92cG9zIC0gcC0+ZGVzaXJlZF92cG9zOworICAgICAg ICAgICAgICAgICAgICBwLT5oZWlnaHQgPSByLT5kZXNpcmVkX3kgLSBwLT5kZXNpcmVkX3k7Cisg ICAgICAgICAgICAgICAgICAgIHRydW5jYXRlZF9wID0gMTsKKyAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgICAgIGludCBucm93c19jb3BpZWQgPSAoci0+ZGVzaXJlZF92cG9zICsgci0+bnJvd3MKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHAtPmRlc2lyZWRfdnBvcyk7 CisgICAgICAgICAgICAgICAgICAgIGlmIChwLT5ucm93cyA8PSBucm93c19jb3BpZWQpCisgICAg ICAgICAgICAgICAgICAgICAgcC0+bnJvd3MgPSAwOworICAgICAgICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAg aW50IGhlaWdodF9jb3BpZWQgPSAoci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gcC0+ZGVzaXJlZF95KTsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgcC0+Y3VycmVudF92cG9zICs9IG5yb3dzX2NvcGllZDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+ZGVzaXJlZF92cG9zICs9IG5yb3dzX2NvcGll ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+bnJvd3MgLT0gbnJvd3NfY29waWVkOwor ICAgICAgICAgICAgICAgICAgICAgICAgICBwLT5jdXJyZW50X3kgKz0gaGVpZ2h0X2NvcGllZDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+ZGVzaXJlZF95ICs9IGhlaWdodF9jb3BpZWQ7 CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmhlaWdodCAtPSBoZWlnaHRfY29waWVkOwor ICAgICAgICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZWRfcCA9IDE7CisgICAgICAgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgIGlmIChyLT5jdXJyZW50X3kgIT0gci0+ZGVzaXJlZF95CisgICAgICAgICAgICAgICAg LyogVGhlIGNvbmRpdGlvbiBiZWxvdyBpcyBlcXVpdmFsZW50IHRvCisgICAgICAgICAgICAgICAg ICAgKChwLT5jdXJyZW50X3kgPj0gci0+ZGVzaXJlZF95CisgICAgICAgICAgICAgICAgICAgICAm JiBwLT5jdXJyZW50X3kgPCByLT5kZXNpcmVkX3kgKyByLT5oZWlnaHQpCisgICAgICAgICAgICAg ICAgICAgIHx8IChwLT5jdXJyZW50X3kgKyBwLT5oZWlnaHQgPiByLT5kZXNpcmVkX3kKKyAgICAg ICAgICAgICAgICAgICAgICAgICYmIChwLT5jdXJyZW50X3kgKyBwLT5oZWlnaHQKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICA8PSByLT5kZXNpcmVkX3kgKyByLT5oZWlnaHQpKSkKKyAgICAg ICAgICAgICAgICAgICBiZWNhdXNlIHdlIGhhdmUgMCA8IHAtPmhlaWdodCA8PSByLT5oZWlnaHQu ICovCisgICAgICAgICAgICAgICAgJiYgcC0+Y3VycmVudF95IDwgci0+ZGVzaXJlZF95ICsgci0+ aGVpZ2h0CisgICAgICAgICAgICAgICAgJiYgcC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0ID4gci0+ ZGVzaXJlZF95KQorICAgICAgICAgICAgICBwLT5ucm93cyA9IDA7CisgICAgICAgICAgICAvKiBS ZW9yZGVyIHJ1bnMgYnkgY29waWVkIHBpeGVsIGxpbmVzIGlmIHRydW5jYXRlZC4gKi8KKyAgICAg ICAgICAgIGlmICh0cnVuY2F0ZWRfcCAmJiBwLT5ucm93cyA+IDApCisgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICBpbnQgayA9IG5ydW5zIC0gMTsKKyAgICAgICAgICAgICAgICB3aGls ZSAobWNfcnVuc1trXS0+bnJvd3MgPT0gMCB8fCBtY19ydW5zW2tdLT5oZWlnaHQgPCBwLT5oZWln aHQpCisgICAgICAgICAgICAgICAgICBrLS07CisgICAgICAgICAgICAgICAgbWVtbW92ZSAobWNf cnVucyArIGosIG1jX3J1bnMgKyBqICsgMSwgKGsgLSBqKSAqIHNpemVvZiAoKm1jX3J1bnMpKTsK KyAgICAgICAgICAgICAgICBtY19ydW5zW2tdID0gcDsKKyAgICAgICAgICAgICAgfQorICAgICAg ICAgIH0KKyAgICAgICAgLyogQXNzaWduIG1hdHJpeCByb3dzLiAqLworICAgICAgICBmb3IgKGog PSAwOyBqIDwgci0+bnJvd3M7ICsraikKKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3Qg Z2x5cGhfcm93ICpmcm9tLCA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XBwZWQgYnkKKyAgYG1ha2VfY3VycmVudCcgaW4gYHVwZGF0ZV93aW5kb3df bGluZScsIG9yIGJlY2F1c2UgdGhlIHByZXZpb3VzIHJvdyB3b3VsZCBiZQorICB0aGUgc2FtZSBp biBib3RoIG1hdHJpY2VzIGlmIHdlIGp1bXBlZCB0byBgc2V0X2N1cnNvcjpgIHdpdGhpbiBgdXBk YXRlX3dpbmRvdycKKyAgYW5kIGBtY191cGRhdGVfd2luZG93X2RyeXJ1bicuICovCisgIGludCBw cmV2X21hdHJpeF9yb3dfc3RhcnRfYnl0ZXBvcyA9ICh2cG9zICE9IDApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19TVEFSVF9CWVRFUE9TIChjdXJy ZW50X3JvdyAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogLTE7 CisgIGludCBwcmV2X21hdHJpeF9yb3dfZW5kX2J5dGVwb3MgPSAodnBvcyAhPSAwKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VORF9CWVRFUE9TIChj dXJyZW50X3JvdyAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IC0x OworICBpbnQgbWF0cml4X3Jvd19zdGFydF9ieXRlcG9zID0gTUFUUklYX1JPV19TVEFSVF9CWVRF UE9TIChkZXNpcmVkX3Jvdyk7CisgIGludCBtYXRyaXhfcm93X2VuZF9ieXRlcG9zID0gTUFUUklY X1JPV19FTkRfQllURVBPUyAoZGVzaXJlZF9yb3cpOworICAvKiBUaGUgZmlyc3QgY29uZGl0aW9u IHRlc3RzIGZvciBhIHNvbGl0YXJ5IHJvdyBjb250YWluaW5nIFpWLCBwcmVjZWRlZCBieSBhCisg IHJvdyBjb250YWluaW5nIGEgcGVudWx0aW1hdGUgZ2x5cGggd2l0aCBhIGNoYXJwb3Mgb2YgWlYg LSAxIGZvbGxvd2VkIGJ5IGFuIGVuZAorICBvZiByb3cgc3BhY2UgZ2x5cGggd2l0aCBhIGNoYXJw b3Mgb2YgMC4gIFRoZSBvdGhlciBjb25kaXRpb25zIHRlc3QgZm9yIGFuIGVtcHR5CisgIGJ1ZmZl ciAobm90IG5hcnJvd2VkKSwgb3IgYW4gZW1wdHkgbmFycm93ZWQgYnVmZmVyLiAqLworICBib29s IHJvd19hdF96dl9wID0gKCh2cG9zICE9IDAKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgKGN1 cnJlbnRfcm93IC0gMSktPnVzZWRbVEVYVF9BUkVBXSA+IDAKKyAgICAgICAgICAgICAgICAgICAg ICAgJiYgcHJldl9tYXRyaXhfcm93X3N0YXJ0X2J5dGVwb3MgIT0gcHJldl9tYXRyaXhfcm93X2Vu ZF9ieXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAgICYmICEoY3VycmVudF9yb3cgLSAxKS0+ ZW5kc19hdF96dl9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIG1hdHJpeF9yb3dfc3RhcnRf Ynl0ZXBvcyA9PSBtYXRyaXhfcm93X2VuZF9ieXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAg ICYmIGRlc2lyZWRfcm93LT5lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgfHwg KCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID09IDEpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICB8fCAoaGVhZGVyX2xpbmVfZm9ybWF0ID09IDAgJiYgdnBvcyA9PSAwKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgYnVmZmVyX25hcnJvd2VkX3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgYm9iX3Jlc3BlY3RfbmFycm93ID09IGVvYl9yZXNwZWN0X25hcnJv dykKKyAgICAgICAgICAgICAgICAgICAgICB8fCAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYm IHZwb3MgPT0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChoZWFkZXJfbGluZV9m b3JtYXQgPT0gMCAmJiB2cG9zID09IDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBi b2JfZGlzcmVnYXJkX25hcnJvdyA9PSBlb2JfZGlzcmVnYXJkX25hcnJvdykpOworICAvKiBJZiBs aW5lLW51bWJlcnMgYXJlIGFjdGl2ZSwgdGhlbiBzcGFjZSBnbHlwaCBwYWRkaW5nIGVxdWFsIHRv IGl0cyB3aWR0aAorICBjb3VudGVkIGluIEhQT1MgYXJlIGZvbGxvd2VkIGJ5IGEgc2luZ2xlIHJv dyBlbmQgc3BhY2UgZ2x5cGguICBMaW5lIG51bWJlcgorICBwYWRkaW5nIHNwYWNlIGdseXBocyBo YXZlIGEgY2hhcnBvcyBvZiAtMSwgd2hlcmVhcyB0aGUgZW5kIG9mIHJvdyBzcGFjZSBnbHlwaAor ICBoYXMgYSBjaGFycG9zIG9mIDAuICBJZiBsaW5lIG51bWJlcnMgYXJlIGluYWN0aXZlLCB0aGVu IHRoZSByb3cgd2lsbCBjb250YWluCisgIGEgc29saXRhcnkgc3BhY2UgZ2x5cGggd2l0aCBhIGNo YXJwb3Mgb2YgLTEuICovCisgIGJvb2wgcm93X2JleW9uZF96dl9wID0gKG1hdHJpeF9yb3dfc3Rh cnRfYnl0ZXBvcyA9PSBtYXRyaXhfcm93X2VuZF9ieXRlcG9zCisgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFyb3dfYXRfenZfcCk7CisgIHJldHVybiAocm93X2F0X3p2X3ApCisgICAgICAg ICAgID8gQVRfWlYKKyAgICAgICAgIDogKHJvd19iZXlvbmRfenZfcCkKKyAgICAgICAgICAgPyBQ T1NUX1pWCisgICAgICAgICA6IFBSRV9aVjsKK30KKworLyogVXBkYXRlIHRoZSBkaXNwbGF5IG9m IHRoZSB0ZXh0IGFyZWEgb2Ygcm93IFZQT1MgaW4gd2luZG93IFcuCisgICBW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JpbnRmIChzdGRlcnIsICJtY191cGRhdGVfdGV4dF9hcmVhICglcyk6ICB2cG9z ICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgbWNfd2luZG93ICh3KSwgdnBvcyk7Cisg IC8qIEluYXNtdWNoIGFzIHdlIHByb2Nlc3MgdGhlIGN1cnNvciByb3cgYmVmb3JlIGFsbCBvdGhl ciByb3dzLCB3ZSBjYW4gcmVseQorICB1cG9uIHRoZSBwcmV2aW91cyBgZGVzaXJlZF9yb3dgIHRv IGJlIGFjY3VyYXRlLiAqLworICBlbnVtIG1jX3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24gPSAg bWNfcm93X3Bvc2l0aW9uICh3LCB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZGVzaXJlZF9y b3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBjdXJyZW50X3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgZGVzaXJlZF9yb3csIHZwb3MpOworICAvKiBJZiByb3dzIGFy ZSBhdCBkaWZmZXJlbnQgWCBvciBZLCBvciByb3dzIGhhdmUgZGlmZmVyZW50IGhlaWdodCwKKyAg ICAgb3IgdGhlIGN1cnJlbnQgcm93IGlzIG1hcmtlZCBpbnZhbGlkLCB3cml0ZSB0aGUgZW50aXJl IGxpbmUuICovCisgIGlmICghY3VycmVudF9yb3ctPmVuYWJsZWRfcAorICAgICAgfHwgZGVzaXJl ZF9yb3ctPnkgIT0gY3VycmVudF9yb3ctPnkKKyAgICAgIHx8IGRlc2lyZWRfcm93LT5hc2NlbnQg IT0gY3VycmVudF9yb3ctPmFzY2VudAorICAgICAgfHwgZGVzaXJlZF9yb3ctPnBoeXNfYXNjZW50 ICE9IGN1cnJlbnRfcm93LT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XJyLCAiV1JJVEUgRU5USVJF IFJPVzpcblwKKyAgICAgICAgICB2cG9zICglZCkgfCBjaGFyICglZC8lcykgfCBzdGFydF94OiAo JWQpIHwgc3RhcnRfaHBvcyAoJWQvJWQpXG4iLAorICAgICAgICAgIHZwb3MsIGRlc2lyZWRfcm93 LT5nbHlwaHNbVEVYVF9BUkVBXS0+dS5jaCwKKyAgICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAo ZGVzaXJlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdLT51LmNoKSwKKyAgICAgICAgICBkZXNpcmVk X3Jvdy0+eCwgMCwgZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpOworICAgICAgaWYg KGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgIHsKKyAgICAgICAgICBibG9j a19pbnB1dCAoKTsKKyAgICAgICAgICBpbnQgbGVuID0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9B UkVBXTsKKyAgICAgICAgICBpbnQgaHBvcyA9IGRlc2lyZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVB XSAtIHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICB3LT5vdXRwdXRf Y3Vyc29yLnggPQorICAgICAgICAgICAgbWNfZHJhd19nbHlwaHMgKHcsIGRlc2lyZWRfbWF0cml4 LCB1cGRhdGVkX3Jvdywgdy0+b3V0cHV0X2N1cnNvci54LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgIFRFWFRfQVJFQSwgaHBvcywgaHBvcyArIGxlbiwgRFJBV19OT1JNQUxfVEVYVCwgMCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCBsc2wsIGdseXBoX2ZsYXZvciwgY3Vy c29yX3R5cGUsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0 aXZlX3AsIGN1cnNvcl9nY19wLCBN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AgICAgICBnbHlwaCwgc28gdGhhdCB0aGUgZmFjZSBleHRlbnNp b24gYWN0dWFsbHkgdGFrZXMgcGxhY2UuICovCisgICAgICAgIGlmIChNQVRSSVhfUk9XX0VYVEVO RFNfRkFDRV9QIChkZXNpcmVkX3JvdykKKyAgICAgICAgICAgICYmIChkZXNpcmVkX3N0b3BfcG9z IDwgY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgIHx8IChkZXNp cmVkX3N0b3BfcG9zID09IGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAg ICAgICAgICAgJiYgIU1BVFJJWF9ST1dfRVhURU5EU19GQUNFX1AgKGN1cnJlbnRfcm93KSkpKQor ICAgICAgICAgIC0tZGVzaXJlZF9zdG9wX3BvczsKKyAgICAgICAgc3RvcCA9IG1pbiAoY3VycmVu dF9yb3ctPnVzZWRbVEVYVF9BUkVBXSwgZGVzaXJlZF9zdG9wX3Bvcyk7CisgICAgICAgIGkgPSAw OworICAgICAgICB4ID0gZGVzaXJlZF9yb3ctPng7CisgICAgICAgIGludCBjbGVhcl90b194ID0g MDsKKworICAgICAgICAvKiBMb29wIG92ZXIgZ2x5cGhzIHRoYXQgY3VycmVudCBhbmQgZGVzaXJl ZCByb3cgbWF5IGhhdmUgaW4gY29tbW9uLiAqLworICAgICAgICB3aGlsZSAoaSA8IHN0b3ApCisg ICAgICAgICAgeworICAgICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCA9IDA7Cisg ICAgICAgICAgICBib29sIGNhbl9za2lwX3AgPSAhYWJvcnRfc2tpcHBpbmc7CisgICAgICAgICAg ICAvKiBTa2lwIG92ZXIgZ2x5cGhzIHRoYXQgYm90aCByb3dzIGhhdmUgaW4gY29tbW9uLiAgVGhl c2UgZG9uJ3QgaGF2ZQorICAgICAgICAgICAgdG8gYmUgd3JpdHRlbi4gIFdlIGNhbid0IHNraXAg aWYgdGhlIGxhc3QgY3VycmVudCBnbHlwaCBvdmVybGFwcyB0aGUKKyAgICAgICAgICAgIGdseXBo IHRvIGl0cyByaWdodC4gIEZvciBleGFtcGxlLCBjb25zaWRlciBhIGN1cnJlbnQgcm93IG9mIGBp Zicgd2l0aAorICAgICAgICAgICAgdGhlIGBmJyBpbiBDb3VyaWVyIGJvbGQgc28gdGhhdCBpdCBv dmVybGFwcyB0aGUgYCAnIHRvIGl0cyByaWdodC4KKyAgICAgICAgICAgIElmIHRoZSBkZXNpcmVk IHJvdyBpcyBgICcsIHdlIHdvdWxkIHNraXAgb3ZlciB0aGUgc3BhY2UgYWZ0ZXIgdGhlCisgICAg ICAgICAgICBgaWYnIGFuZCB0aGVyZSB3b3VsZCByZW1haW4gYSBwaXhlbCBmcm9tIHRoZSBgZicg b24gdGhlIHNjcmVlbi4gKi8KKyAgICAgICAgICAgIGlmIChvdmVybGFwcGluZ19nbHlwaHNfcCAm JiBpID4gMCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAq Z2x5cGggPSAmY3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FSRUFdW2kgLSAxXTsKKyAgICAgICAg ICAgICAgICBpbnQgbGVmdCwgcmlnaHQ7CisgICAgICAgICAgICAgICAgcmlmLT5nZXRfZ2x5cGhf b3ZlcmhhbmdzIChnbHlwaCwgWEZSQU1FICh3LT5mcmFtZSksICZsZWZ0LCAmcmlnaHQpOworICAg ICAgICAgICAgICAgIGNhbl9za2lwX3AgPSAocmlnaHQgPT0gMCAmJiAhYWJvcnRfc2tpcHBpbmcp OworICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoY2FuX3NraXBfcCkKKyAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgIGludCBzdGFydF9ocG9zID0gaTsKKyAgICAgICAgICAg ICAgICB3aGlsZSAoaSA8IHN0b3AKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgR0xZUEhfRVFV QUxfUCAoZGVzaXJlZF9nbHlwaCwgY3VycmVudF9nbHlwaCkpCisgICAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAgICsrYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZDsKKyAgICAg ICAgICAgICAgICAgICAgaWYgKGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZCA8IGFycmF5 X2dseXBoc19za2lwcGVkLnVzZWQpCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgICAgICAgaW50IG9sZF9hbGxvYyA9IGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9j YXRlZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBuZXdfZWx0cyA9IGFycmF5X2dseXBo c19za2lwcGVkLnVzZWQgLSBhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQ7CisgICAgICAg ICAgICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkID0KKyAgICAgICAg ICAgICAgICAgICAgICAgICAgeHBhbGxvYyAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmFycmF5X2dseXBoc19za2lwcGVk LmFsbG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElOVF9NQVgsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAqYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tp cHBlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtZW1zZXQgKGFycmF5X2dseXBoc19za2lw cGVkLnNraXBwZWQgKyBvbGRfYWxsb2MsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkIC0gb2xkX2FsbG9jKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHNpemVvZiAqYXJyYXlfZ2x5cGhzX3NraXBw ZWQuc2tpcHBlZCk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAg ICBpbnQgbnRoID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCAtIDE7CisgICAgICAgICAgICAg ICAgICAgIGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbbnRoXS54ID0geDsKKyAgICAgICAg ICAgICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLmhwb3MgPSBpOwor ICAgICAgICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkW250aF0uZW5h YmxlZF9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgeCArPSBkZXNpcmVkX2dseXBoLT5w aXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgKytkZXNpcmVkX2dseXBoLCArK2N1cnJl bnRfZ2x5cGgsICsraTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvKiBD b25zaWRlciB0aGUgY2FzZSB0aGF0IHRoZSBjdXJyZW50IHJvdyBjb250YWlucyAieHh4IHBwcCBn Z2ciIGluCisgICAgICAgICAgICAgICAgaXRhbGljIENvdXJpZXIgZm9udCwgYW5kIHRoZSBkZXNp cmVkIHJvdyBpcyAieHh4IGdnZyIuICBUaGUgY2hhcmFjdGVyIGBwJworICAgICAgICAgICAgICAg IGhhcyBsYmVhcmluZywgYGcnIGhhcyBub3QuICBUaGUgbG9vcCBhYm92ZSB3aWxsIHN0b3AgaW4g ZnJvbnQgb2YgdGhlCisgICAgICAgICAgICAgICAgZmlyc3QgYHAnIGluIHRoZSBjdXJyZW50IHJv dy4gIElmIHdlIHdvdWxkIHN0YXJ0IHdyaXRpbmcgZ2x5cGhzIHRoZXJlLCB3ZQorICAgICAgICAg ICAgICAgIHdvdWxkbid0IGVyYXNlIHRoZSBsYmVhcmluZyBvZiB0aGUgYHAnLiAgVGhlIHJlc3Qg b2YgdGhlIGxiZWFyaW5nIHByb2JsZW0KKyAgICAgICAgICAgICAgICBpcyB0aGVuIHRha2VuIGNh cmUgb2YgYnkgZHJhd19nbHlwaHMuICovCisgICAgICAgICAgICAgICAgaWYgKG92ZXJsYXBwaW5n X2dseXBoc19wCisgICAgICAgICAgICAgICAgICAgICYmIGkgPiAwCisgICAgICAgICAgICAgICAg ICAgICYmIGkgPCBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAg ICAgICYmIChjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IGRlc2lyZWRfcm93LT51c2Vk W1RFWFRfQVJFQV0pKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBp bnQgbGVmdCwgcmlnaHQ7CisgICAgICAgICAgICAgICAgICAgIHJpZi0+Z2V0X2dseXBoX292ZXJo YW5ncyAoY3VycmVudF9nbHlwaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBYRlJBTUUg KHctPmZyYW1lKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbGVmdCwgJnJpZ2h0KTsK KyAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGxlZnQgPiAwICYmIGkgPiAwKQorICAgICAgICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC0taSwgLS1kZXNpcmVkX2ds eXBoLCAtLWN1cnJlbnRfZ2x5cGg7CisgICAgICAgICAgICAgICAgICAgICAgICB4IC09IGRlc2ly ZWRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgbGVmdCAtPSBk ZXNpcmVkX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAg ICAgICAgICAgICAgICAgIC8qIEFib3J0IHRoZSBza2lwcGluZyBhbGdvcml0aG0gaWYgd2UgZW5k IHVwIGJlZm9yZQorICAgICAgICAgICAgICAgICAgICAgICBvdXIgc3RhcnRpbmcgcG9pbnQsIHRv IGF2b2lkIGxvb3BpbmcgKGJ1ZyMxMDcwKS4KKyAgICAgICAgICAgICAgICAgICAgICAgVGhpcyBj YW4gaGFwcGVuIHdoZW4gdGhlIGxiZWFyaW5nIGlzIGxhcmdlciB0aGFuCisgICAgICAgICAgICAg ICAgICAgICAgIHRoZSBwaXhlbCB3aWR0aC4gKi8KKyAgICAgICAgICAgICAgICAgICAgYWJvcnRf c2tpcHBpbmcgPSAoaSA8IHN0YXJ0X2hwb3MpOworICAgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAvKiBUcnkgdG8gYXZvaWQgd3JpdGluZyB0aGUgZW50aXJl IHJlc3Qgb2YgdGhlIGRlc2lyZWQgcm93CisgICAgICAgICAgICAgICBieSBsb29raW5nIGZvciBh IHJlc3luYyBwb2ludC4gIFRoaXMgbWFpbmx5IHByZXZlbnRzCisgICAgICAgICAgICAgICBtb2Rl IGxpbmUgZmxpY2tlcmluZyBpbiB0aGUgY2FzZSB0aGUgbW9kZSBsaW5lIGlzIGluCisgICAgICAg ICAgICAgICBmaXhlZC1waXRjaCBmb250LCB3aGljaCBpdCB1c3VhbGx5IHdpbGwgYmUuICovCisg ICAgICAgICAgICBpZiAoaSA8IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICBpbnQgc3RhcnRfeCA9IHgsIHN0YXJ0X2hwb3MgPSBp OworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqc3RhcnQgPSBkZXNpcmVkX2dseXBoOwor ICAgICAgICAgICAgICAgIGludCBjdXJyZW50X3ggPSB4OworICAgICAgICAgICAgICAgIGJvb2wg c2tpcF9maXJzdF9wID0gIWNhbl9za2lwX3A7CisgICAgICAgICAgICAgICAgLyogRmluZCB0aGUg bmV4dCBnbHlwaCB0aGF0J3MgZXF1YWwgYWdhaW4uICovCisgICAgICAgICAgICAgICAgd2hpbGUg KGkgPCBzdG9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIChza2lwX2ZpcnN0X3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgIHx8ICFHTFlQSF9FUVVBTF9QIChkZXNpcmVkX2dseXBoLCBj dXJyZW50X2dseXBoKSkKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgeCA9PSBjdXJyZW50X3gp CisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHggKz0gZGVzaXJlZF9n bHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfeCArPSBjdXJy ZW50X2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgKytkZXNpcmVkX2ds eXBoLCArK2N1cnJlbnRfZ2x5cGgsICsraTsKKyAgICAgICAgICAgICAgICAgICAgc2tpcF9maXJz dF9wID0gMDsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmb3IgKGludCBl bHQgPSAwOworICAgICAgICAgICAgICAgICAgICAgZWx0IDwgYXJyYXlfZ2x5cGhzX3NraXBwZWQu dXNlZDsKKyAgICAgICAgICAgICAgICAgICAgICsrZWx0KQorICAgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgICBpbnQgeCA9IGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRb ZWx0XS54OworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGFycmF5X2dseXBoc19za2lw cGVkLnNraXBwZWRbZWx0XS5ocG9zOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGgg KnRhcmdldF9nbHlwaCA9CisgICAgICAgICAgICAgICAgICAgICAgbWNfZ2V0X2N1cnNvcl9nbHlw aCAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBocG9zLCB2cG9zKTsKKyAgICAgICAg ICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZiAo c3RkZXJyLCAiU0tJUFBFRDogIHZwb3MgKCVkKSB8IGNoYXIgKCVkLyVzKSB8IHg6ICglZCkgfCBo cG9zICglZC8lZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2 cG9zLCB0YXJnZXRfZ2x5cGgtPnUuY2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAodGFyZ2V0X2dseXBoLT51LmNoKSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHgsIGhwb3MsIHVwZGF0ZWRfcm93LT51c2Vk W1RFWFRfQVJFQV0gLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgbWNfZHJhd19yb3cgKHcsIGRl c2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCB4LCAxLCB2cG9zLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywg cm93X3Bvc2l0aW9uLCBkcmF3X3AsIFNLSVBQRUQpOworICAgICAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICAgIGlmIChpID09IHN0YXJ0X2hwb3MgfHwgeCAhPSBjdXJyZW50X3gpCisgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGkgPSBzdGFydF9ocG9zOworICAg ICAgICAgICAgICAgICAgICB4ID0gc3RhcnRfeDsKKyAgICAgICAgICAgICAgICAgICAgZGVzaXJl ZF9nbHlwaCA9IHN0YXJ0OworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9zLCBzdGFy dF9ocG9zLCBkZXNpcmVkX3Jvdy0+eSwgc3RhcnRfeCk7CisgICAgICAgICAgICAgICAgLyogUmUt ZHJhdyBhIHBvcnRpb24gb2YgdGhlIHJvdy4gKi8KKyAgICAgICAgICAgICAgICBpZiAoZGVidWdf cCkKKyAgICAgICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlJFRFJBVyBTRUdNRU5UOlxu XAorICAgICAgICAgICAgICAgICAgICB2cG9zICglZCkgfCBjaGFyICglZC8lcykgfCB4OiAoJWQp IHwgaHBvcyAoJWQvJWQpIHwgbGVuZ3RoICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgIHZw b3MsIHN0YXJ0LT51LmNoLCBtY19jaGFyX3RvX3N0cmluZyAoc3RhcnQtPnUuY2gpLAorICAgICAg ICAgICAgICAgICAgICBzdGFydF94LCBzdGFydF9ocG9zLCB1cGRhdGVkX3Jvdy0+dXNlZFtURVhU X0FSRUFdIC0gMSwgaSAtIHN0YXJ0X2hwb3MpOworICAgICAgICAgICAgICAgIGJsb2NrX2lucHV0 ICgpOworICAgICAgICAgICAgICAgIGludCBsZW4gPSBpIC0gc3RhcnRfaHBvczsKKyAgICAgICAg ICAgICAgICBpbnQgaHBvcyA9IHN0YXJ0IC0gdXBkYXRlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFd OworICAgICAgICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9CisgICAgICAgICAgICAgICAg ICBtY19kcmF3X2dseXBocyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB3LT5vdXRw dXRfY3Vyc29yLngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVEVYVF9BUkVB LCBocG9zLCBocG9zICsgbGVuLCBEUkFXX05PUk1BTF9URVhULAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDAsIHZwb3MsIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwg d2QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVf cCwgY3Vyc29yX2djX3AsIE1DX0RSQVdfR0xZUEhfU1RSSU5HLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGRyYXdfcCk7CisgICAgICAgICAgICAgICAgdy0+b3V0cHV0X2N1cnNv ci5ocG9zICs9IGxlbjsKKyAgICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAg ICAgICAgICAgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHN0 YXJ0LCBzdGFydF94LCBpIC0gc3RhcnRfaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgdnBvcywgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3X3As IFNDUklCRV9UV08pOworICAgICAgICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAg ICAgIH0KKyAgICAgICAgICB9CisKKyAgICAgICAgLyogV3JpdGUgdGhlIHJlc3QuICovCisgICAg ICAgIGlmIChpIDwgZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICB7Cisg ICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9zLCBpLCBkZXNpcmVkX3Jvdy0+eSwg eCk7CisgICAgICAgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAgICAgICAgZnByaW50ZiAoc3Rk ZXJyLCAiRFJBVyBSRU1BSU5ERVIgT0YgVEhFIFJPVzpcblwKKyAgICAgICAgICAgICAgICB2cG9z ICglZCkgfCBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwgaHBvcyAoJWQvJWQpIHwgbGVuZ3RoICgl ZClcbiIsCisgICAgICAgICAgICAgICAgdnBvcywgZGVzaXJlZF9nbHlwaC0+dS5jaCwgbWNfY2hh cl90b19zdHJpbmcgKGRlc2lyZWRfZ2x5cGgtPnUuY2gpLAorICAgICAgICAgICAgICAgIHgsIGks IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxLCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhU X0FSRUFdIC0gaSk7CisgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgIGlu dCBsZW4gPSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gaTsKKyAgICAgICAgICAgIGlu dCBocG9zID0gZGVzaXJlZF9nbHlwaCAtIHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsK KyAgICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9CisgICAgICAgICAgICAgIG1jX2RyYXdf Z2x5cGhzICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHctPm91dHB1dF9jdXJzb3Iu eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRFWFRfQVJFQSwgaHBvcywgaHBvcyAr IGxlbiwgRFJBV19OT1JNQUxfVEVYVCwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHZwb3MsIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCwgTUNfRFJB V19HTFlQSF9TVFJJTkcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3ApOwor ICAgICAgICAgICAgdy0+b3V0cHV0X2N1cnNvci5ocG9zICs9IGxlbjsKKyAgICAgICAgICAgIHVu YmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAvKiBGSVhNRTogIEFsdGhvdWdoIHdlIG5lZWQg dG8gdXBkYX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mdlIHJlbWFpbmVkIHRo ZSBzYW1lLiAgYGlgIGFuZCBgeGAgd2VyZQorICAgICAgICAgIGluY3JlbWVudGVkIHRvIHRoZSBl bmQgb2YgdGhlIGdseXBoIHJvdy4gIGkgPT0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXQor ICAgICAgICAgIFRoZSBgdy0+b3V0cHV0X2N1cnNvci54L3kvaHBvcy92cG9zYCBpcyBhdCB0aGUg ZW5kIG9mIHRoZSBwcmV2aW91cyBjaGFuZ2UuCisgICAgICAgICAgV2hlbiB0aGlzIHNpdHVhdGlv biBleGlzdHMsIHRoZSBkaXN0YW5jZSBiZXR3ZWVuIHRoZSBlbmQgb2YgdGhlIGdseXBoIHJvdyBh bmQKKyAgICAgICAgICB0aGUgcmlnaHQgZWRnZSBvZiB0aGUgd2luZG93IHdpbGwgX25vdF8gYmUg Y2xlYXJlZC4gIFRoZXJlZm9yZSwgaXQgaXMgb2theSB0bworICAgICAgICAgIGRyYXcgdGhlIGZs b2F0aW5nIGdseXBocyBmb3IgdGhlIGhvcml6b250YWwvdmVydGljYWwgcnVsZXJzIGhlcmUuICov CisgICAgICAgICAgZWxzZSBpZiAoY2hhbmdlZF9wCisgICAgICAgICAgICAgICAgICAgJiYgdy0+ b3V0cHV0X2N1cnNvci5ocG9zICE9IHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIGludCB4ID0gdy0+b3V0cHV0X2N1cnNvci54OworICAg ICAgICAgICAgICBpbnQgaHBvcyA9IHctPm91dHB1dF9jdXJzb3IuaHBvczsKKyAgICAgICAgICAg ICAgc3RydWN0IGdseXBoICpzdGFydCA9IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGRlc2lyZWRf bWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgdXBkYXRlZF9yb3csIGhwb3MsIHZwb3MpOworICAgICAgICAgICAgICBpZiAody0+ b3V0cHV0X2N1cnNvci54ID09IHVwZGF0ZWRfcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAg ICAgICB4IC09IHN0YXJ0LT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgaWYgKGRlYnVnX3Ap CisgICAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiUE9TVC1DSEFOR0VEOiAgdnBvcyAo JWQpIHwgeCAoJWQpIHwgaHBvcyAoJWQvJWQpIHwgY2hhciAoJWQvJXMpXG4iLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgeCwgaHBvcywgdXBkYXRlZF9yb3ctPnVzZWRb VEVYVF9BUkVBXSAtIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydC0+ dS5jaCwgbWNfY2hhcl90b19zdHJpbmcgKHN0YXJ0LT51LmNoKSk7CisgICAgICAgICAgICAgIG1j X2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHN0YXJ0LCB4LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIGhw b3MsIHZwb3MsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3Nl bnRpYWxzLCByb3dfcG9zaXRpb24sIGRyYXdfcCwgUE9TVF9DSEFOR0VEKTsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICAgIC8qIFRoZXJlIHdlcmUgbm8gY2hhbmdlcyBhbmQgaSA9PSBkZXNpcmVk X3Jvdy0+dXNlZFtURVhUX0FSRUFdICovCisgICAgICAgICAgICBlbHNlIGlmICghY2hhbmdlZF9w KQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAg ICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJVTkNIQU5HRUQgLS0gV1JJVEUgRU5USVJFIExJ TkU6ICB2cG9zICglZCkgfCByb3ctPnVzZWQgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgdnBvcywgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpOwor ICAgICAgICAgICAgICAgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9y b3csIGRlc2lyZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgZGVzaXJlZF9yb3ctPngsIGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0sIHZw b3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlh bHMsIHJvd19wb3NpdGlvbiwgZHJhd19wLCBVTkNIQU5HRUQpOworICAgICAgICAgICAgICB9CisK KyAgICAgICAgLyogTWF5YmUgY2xlYXIgdG8gZW5kIG9mIGxpbmUuICovCisgICAgICAgIGlmIChN QVRSSVhfUk9XX0VYVEVORFNfRkFDRV9QIChkZXNpcmVkX3JvdykpCisgICAgICAgICAgeworICAg ICAgICAgICAgLyogSWYgbmV3IHJvdyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRleHQgYXJl YSwgbm90aGluZworICAgICAgICAgICAgICAgaGFzIHRvIGJlIGNsZWFyZWQsIGlmIGFuZCBvbmx5 IGlmIHdlIGRpZCBhIHdyaXRlX2dseXBocworICAgICAgICAgICAgICAgYWJvdmUuICBUaGlzIGlz IG1hZGUgc3VyZSBieSBzZXR0aW5nIGRlc2lyZWRfc3RvcF9wb3MKKyAgICAgICAgICAgICAgIGFw cHJvcHJpYXRlbHkgYWJvdmUuICovCisgICAgICAgICAgICBlYXNzZXJ0IChpIDwgZGVzaXJlZF9y b3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgfHwgKChkZXNpcmVkX3Jv dy0+dXNlZFtURVhUX0FSRUFdID09IGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgTUFUUklYX1JPV19FWFRFTkRTX0ZBQ0VfUCAoY3VycmVu dF9yb3cpKSk7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKE1BVFJJWF9ST1dfRVhU RU5EU19GQUNFX1AgKGN1cnJlbnRfcm93KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg LyogSWYgb2xkIHJvdyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRleHQgYXJlYSwgY2xlYXIu ICovCisgICAgICAgICAgICAgIGlmIChpID49IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0p CisgICAgICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgaSwgZGVzaXJlZF9y b3ctPnksIGRlc2lyZWRfcm93LT5waXhlbF93aWR0aCk7CisgICAgICAgICAgICAgIGlmIChkcmF3 X3ApCisgICAgICAgICAgICAgICAgcmlmLT5jbGVhcl9lbmRfb2ZfbGluZSAodywgdXBkYXRlZF9y b3csIFRFWFRfQVJFQSwgLTEpOworICAgICAgICAgICAgICBjbGVhcl90b194ID0gLTE7CisgICAg ICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNl IGlmIChkZXNpcmVkX3Jvdy0+cGl4ZWxfd2lkdGggPCBjdXJyZW50X3Jvdy0+cGl4ZWxfd2lkdGgp CisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBPdGhlcndpc2UgY2xlYXIgdG8g dGhlIGVuZCBvZiB0aGUgb2xkIHJvdy4gIEV2ZXJ5dGhpbmcKKyAgICAgICAgICAgICAgICAgICBh ZnRlciB0aGF0IHBvc2l0aW9uIHNob3VsZCBiZSBjbGVhciBhbHJlYWR5LiAqLworICAgICAgICAg ICAgICAgIGludCB4bGltOworICAgICAgICAgICAgICAgIGlmIChpID49IGRlc2lyZWRfcm93LT51 c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2 cG9zLCBpLCBkZXNpcmVkX3Jvdy0+eSwgZGVzaXJlZF9yb3ctPnBpeGVsX3dpZHRoKTsKKyAgICAg ICAgICAgICAgICAvKiBJZiBjdXJzb3IgaXMgZGlzcGxheWVkIGF0IHRoZSBlbmQgb2YgdGhlIGxp bmUsIG1ha2Ugc3VyZQorICAgICAgICAgICAgICAgICAgIGl0J3MgY2xlYXJlZC4gIE5vd2FkYXlz IHdlIGRvbid0IGhhdmUgYSBwaHlzX2N1cnNvcl9nbHlwaAorICAgICAgICAgICAgICAgICAgIHdp dGggd2hpY2ggdG8gZXJhc2UgdGhlIGN1cnNvciAoYmVjYXVzZSB0aGlzIG1ldGhvZAorICAgICAg ICAgICAgICAgICAgIGRvZXNuJ3Qgd29yayB3aXRoIGxiZWFyaW5nL3JiZWFyaW5nKSwgc28gd2Ug bXVzdCBkbyBpdCB0aGlzIHdheS4gKi8KKyAgICAgICAgICAgICAgICBpZiAodnBvcyA9PSB3LT5w aHlzX2N1cnNvci52cG9zCisgICAgICAgICAgICAgICAgICAgICYmIChkZXNpcmVkX3Jvdy0+cmV2 ZXJzZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgPyAody0+cGh5c19jdXJzb3IuaHBvcyA8 IDApCisgICAgICAgICAgICAgICAgICAgICAgICA6ICh3LT5waHlzX2N1cnNvci5ocG9zID49IGRl c2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pKSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgdy0+cGh5c19jdXJzb3Jfb25fcCA9IDA7CisgICAgICAgICAgICAgICAg ICAgIHhsaW0gPSAtMTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgICAgeGxpbSA9IGN1cnJlbnRfcm93LT5waXhlbF93aWR0aDsK KyAgICAgICAgICAgICAgICBpZiAoZHJhd19wKQorICAgICAgICAgICAgICAgICAgcmlmLT5jbGVh cl9lbmRfb2ZfbGluZSAodywgdXBkYXRlZF9yb3csIFRFWFRfQVJFQSwgeGxpbSk7CisgICAgICAg ICAgICAgICAgY2xlYXJfdG9feCA9IHhsaW07CisgICAgICAgICAgICAgICAgY2hhbmdlZF9wID0g MTsKKyAgICAgICAgICAgICAgfQorCisgICAgICAgIGlmIChjaGFuZ2VkX3AKKyAgICAgICAgICAg ICYmIGNsZWFyX3RvX3ggIT0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgdGV4dF9h cmVhX3dpZHRoID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAg IHN0cnVjdCBtY19SR0IgZGVidWdfZmcgPSB7LnJlZCA9IDAuODY3LCAuZ3JlZW4gPSAwLjg2Nywg LmJsdWUgPSAwLjg2N307CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnRhcmdldF9nbHlwaCA9 CisgICAgICAgICAgICAgIHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHVwZGF0ZWRf cm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgICAgICAgLyogYG1jX2VuZ2luZScgb25s eSBkcmF3cyBhbiBNQ19HTFlQSCB3aGVuIHggPCB1cGRhdGVkX3Jvdy0+cGl4ZWxfd2lkdGguCisg ICAgICAgICAgICBUaGUgY3VycmVudCBkZXNpZ24gaW5oaWJpdHMgZHJhd2luZyBvdmVyIGFuIGV4 aXN0aW5nIGdseXBoIGF0IHRoZSBlbmQgb2YgYQorICAgICAgICAgICAgd29yZC13cmFwcGVkIGxp bmUuICBTYWlkIGdseXBoIHJlY2VpdmVzIGEgZmFrZSBjdXJzb3IgaW4gZWl0aGVyIG9uZSBvZiB0 aGUKKyAgICAgICAgICAgIHByZXZpb3VzIHNlY3Rpb25zIGFib3ZlLCBhbmQgc2hvdWxkIG5vdCBi ZSBvdmVyd3JpdHRlbiB3aXRoIGFub3RoZXIgb25lLgorICAgICAgICAgICAgVGhpcyBkZXNpZ24g aXMgbmVlZGVkIGJlY2F1c2UgYSB3b3JkLXdyYXBwZWQgbGluZSBkb2VzIG5vdCByZWNlaXZlIGFu IGV4dHJhCisgICAgICAgICAgICBzcGFjZSBsaWtlIG5vbi13b3JkLXdyYXBwZWQgbGluZXMgZG8u ICovCisgICAgICAgICAgICBpbnQgeCA9IHVwZGF0ZWRfcm93LT5waXhlbF93aWR0aDsKKyAgICAg ICAgICAgIGludCBocG9zID0gdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDE7CisgICAg ICAgICAgICBpbnQgeF9saW1pdCA9IChjbGVhcl90b194ID09IC0xKQorICAgICAgICAgICAgICAg ICAgICAgICAgICA/IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICA6 IGNsZWFyX3RvX3g7CisgICAgICAgICAgICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAody0+ Y29udGVudHMpOworICAgICAgICAgICAgYm9vbCBmaWxsX2NvbHVtbl90cnVtcHNfcCA9ICghTklM UCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgZmNfdmlzaWJsZSkpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IGVzc2Vu dGlhbHMuZmNfeCk7CisgICAgICAgICAgICBpZiAobWNfc3RkZXJyX3ApCisgICAgICAgICAgICAg IGZwcmludGYgKHN0ZGVyciwgIm1jX3VwZGF0ZV90ZXh0X2FyZWEgKGZsb2F0aW5nKTogIHZwb3Mg KCVkKSB8IHhfbGltaXQgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2 cG9zLCB4X2xpbWl0KTsKKyAgICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAg ICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgZmNfdmlzaWJsZSkpCisgICAgICAgICAg ICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgfHwgKCFl c3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZB UiAoYiwgZmNfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAgICAgICAmJiB4IDwgdGV4 dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHgKKyAg ICAgICAgICAgICAgICAmJiB0YXJnZXRfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAgICAgICYm IGRyYXdfcCkKKyAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBkZXNpcmVkX21hdHJpeCwgdXBk YXRlZF9yb3csIHRhcmdldF9nbHlwaCwgVEVYVF9BUkVBLAorICAgICAgICAgICAgICAgICAgICAg ICAgIHgsIHhfbGltaXQsIHVwZGF0ZWRfcm93LT55LCBocG9zLCB2cG9zLCBNQ19CQVIsIDEsCisg ICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bv c2l0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgIGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGVz c2VudGlhbHMuZmNfZmdbcm93X3Bvc2l0aW9uXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBG SUxMX0NPTFVNTiwgZHJhd19wLCBOT1dIRVJFLCBOT19DQUNIRSk7CisgICAgICAgICAgICBpZiAo QlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIs IGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9ob3Jp em9udGFsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAor ICAgICAgICAgICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpKQor ICAgICAgICAgICAgICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAm JiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAgJiYgdGFyZ2V0X2dseXBo ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAgICAgICAgIG1jX2Vu Z2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRf QVJFQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB4LCB4X2xpbWl0LCB1cGRhdGVkX3Jvdy0+ eSwgaHBvcywgdnBvcywgTUNfSEJBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjdXJz b3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAgICAg ICAgICAgZGVidWdfcCA/IGRlYnVnX2ZnIDogZXNzZW50aWFscy5jaF9mZ1tyb3dfcG9zaXRpb25d LAorICAgICAgICAgICAgICAgICAgICAgICAgIEhPUklaT05UQUxfUlVMRVIsIGRyYXdfcCwgTk9X SEVSRSwgTk9fQ0FDSEUpOworICAgICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQor ICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAg ICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgIHx8ICgh ZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJW QVIgKGIsIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAgICAgICAgJiYgIWZpbGxf Y29sdW1uX3RydW1wc19wCisgICAgICAgICAgICAgICAgJiYgeCA8IHRleHRfYXJlYV93aWR0aAor ICAgICAgICAgICAgICAgICYmIHZwb3MgIT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgICAg ICAmJiB3LT5jdXJzb3IueCA+PSB4CisgICAgICAgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9 IE5VTEwKKyAgICAgICAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAgICAgICAgIG1jX2VuZ2lu ZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJF QSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB4LCB4X2xpbWl0LCB1cGRhdGVkX3Jvdy0+eSwg aHBvcywgdnBvcywgTUNfQkFSLCAxLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9t YXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICBkZWJ1Z19wID8gZGVidWdfZmcgOiBlc3NlbnRpYWxzLmNoX2ZnW3Jvd19wb3NpdGlvbl0sCisg ICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVIsIGRyYXdfcCwgTk9XSEVSRSw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191cGRhdGVfdGV4dF9h cmVhICh3LCBkZXNpcmVkX3JvdywgdnBvcywgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywgZHJhd19wKTsKKyAgICAg IC8qIFVwZGF0ZSB0aGUgZGlzcGxheSBvZiB0aGUgdGV4dCBhcmVhLiAqLworICAgICAgaWYgKHVw ZGF0ZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAg aWYgKGN1cnJlbnRfcm93LT5tb3VzZV9mYWNlX3ApCisgICAgICAgICAgICAqbW91c2VfZmFjZV9v dmVyd3JpdHRlbl9wID0gMTsKKyAgICAgICAgfQorICAgICAgLyogVXBkYXRlIGRpc3BsYXkgb2Yg dGhlIHJpZ2h0IG1hcmdpbiBhcmVhLCBpZiB0aGVyZSBpcyBvbmUuICovCisgICAgICBpZiAoIWRl c2lyZWRfcm93LT5mdWxsX3dpZHRoX3AgJiYgdy0+cmlnaHRfbWFyZ2luX2NvbHMgPiAwKQorICAg ICAgICB7CisgICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAgICAgICAgICB1cGRhdGVfbWFyZ2lu YWxfYXJlYSAodywgZGVzaXJlZF9yb3csIFJJR0hUX01BUkdJTl9BUkVBLCB2cG9zKTsKKyAgICAg ICAgfQorICAgICAgLyogRHJhdyB0cnVuY2F0aW9uIG1hcmtzIGV0Yy4gKi8KKyAgICAgIGlmICgh Y3VycmVudF9yb3ctPmVuYWJsZWRfcAorICAgICAgICAgIHx8IGRlc2lyZWRfcm93LT55ICE9IGN1 cnJlbnRfcm93LT55CisgICAgICAgICAgfHwgZGVzaXJlZF9yb3ctPnZpc2libGVfaGVpZ2h0ICE9 IGN1cnJlbnRfcm93LT52aXNpYmxlX2hlaWdodAorICAgICAgICAgIHx8IGRlc2lyZWRfcm93LT5j dXJzb3JfaW5fZnJpbmdlX3AgIT0gY3VycmVudF9yb3ctPmN1cnNvcl9pbl9mcmluZ2VfcAorICAg ICAgICAgIHx8IGRlc2lyZWRfcm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCAhPSBjdXJyZW50X3Jv dy0+b3ZlcmxheV9hcnJvd19iaXRtYXAKKyAgICAgICAgICB8fCBjdXJyZW50X3Jvdy0+cmVkcmF3 X2ZyaW5nZV9iaXRtYXBzX3AKKyAgICAgICAgICB8fCBkZXNpcmVkX3Jvdy0+bW9kZV9saW5lX3Ag IT0gY3VycmVudF9yb3ctPm1vZGVfbGluZV9wCisgICAgICAgICAgfHwgZGVzaXJlZF9yb3ctPmV4 YWN0X3dpbmRvd193aWR0aF9saW5lX3AgIT0gY3VycmVudF9yb3ctPmV4YWN0X3dpbmRvd193aWR0 aF9saW5lX3AKKyAgICAgICAgICB8fCAoTUFUUklYX1JPV19DT05USU5VQVRJT05fTElORV9QIChk ZXNpcmVkX3JvdykKKyAgICAgICAgICAgICAgIT0gTUFUUklYX1JPV19DT05USU5VQVRJT05fTElO RV9QIChjdXJyZW50X3JvdykpKQorICAgICAgICByaWYtPmFmdGVyX3VwZGF0ZV93aW5kb3dfbGlu ZV9ob29rICh3LCBkZXNpcmVkX3Jvdyk7CisgICAgfQorICAvKiBVcGRhdGUgY3VycmVudF9yb3cg ZnJvbSBkZXNpcmVkX3Jvdy4gKi8KKyAgbWFrZV9jdXJyZW50ICh3LT5kZXNpcmVkX21hdHJpeCwg dy0+Y3VycmVudF9tYXRyaXgsIHZwb3MpOworICByZXR1cm4gY2hhbmdlZF9wOworfQorCit2b2lk CittY191cGRhdGVfd2luZG93X2VyYXNlIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgbWNfbWF0 cml4IG9sZF9tYXRyaXgpCit7CisgIGJvb2wgZGVidWdfcCA9IGZhbHNlOworICBib29sIGdvX29u ZV9wID0gKG9sZF9tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA+IDAKKyAgICAgICAgICAg ICAgICAgICB8fCBvbGRfbWF0cml4LmN1cnNvcnNfdXNlZFtDSF9DQUNIRV0gPiAwCisgICAgICAg ICAgICAgICAgICAgfHwgb2xkX21hdHJpeC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVdID4gMCk7Cisg IGJvb2wgZ29fdHdvX3AgPSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAg ICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQor ICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKSk7CisgIGJvb2wgdXBkYXRpbmdfZnJh bWVfcCA9IGZhbHNlOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAg aWYgKFhGUkFNRSAody0+ZnJhbWUpICE9IGYtPm1jX3VwZGF0aW5nX2ZyYW1lCisgICAgICAmJiAo Z29fb25lX3AgfHwgZ29fdHdvX3ApKQorICAgIHsKKyAgICAgIHVwZGF0aW5nX2ZyYW1lX3AgPSB0 cnVlOworICAgICAgdXBkYXRlX2JlZ2luIChmKTsKKyAgICB9CisgIGlmICh3LT5waHlzX2N1cnNv cl9vbl9wCisgICAgICAmJiBnb190d29fcCkKKyAgICBlcmFzZV9waHlzX2N1cnNvciAodyk7Cisg IGZvciAoaW50IHZudGggPSAwOworICAgICAgIGdvX29uZV9wCisgICAgICAgJiYgdm50aCA8IHct Pm1jX21hdHJpeC52cG9zX3VzZWQ7CisgICAgICAgKyt2bnRoKQorICAgIHsKKyAgICAgIGZvciAo ZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICAgICAgY2Fj aGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgIGZv ciAoaW50IG50aF8wID0gMDsKKyAgICAgICAgICAgICBtY190cmF2ZXJzZV9jYWNoZV9wIChvbGRf bWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGhfMCk7CisgICAgICAgICAgICAgKytudGhfMCkK KyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIHNhbWVfcCA9IGZhbHNlOworICAgICAgICAg ICAgZm9yIChpbnQgd19udGggPSAwOyB3X250aCA8IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlX3VzZWRbY2FjaGVfdHlwZV07ICsrd19udGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICBzYW1lX3AgfD0gKG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMF0uZ2x5cGgudHlwZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudHlwZQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLmJ5dGVwb3MKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b d19udGhdLmdseXBoLmJ5dGVwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwg KG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ucm93X3Bvc2l0 aW9uID09IEFUX1pWCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5yb3dfcG9zaXRpb24g PT0gQVRfWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ucm93X3Bvc2l0aW9uID09IFBPU1Rf WlYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnJvd19wb3NpdGlvbiA9PSBQT1NUX1pW KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICgob2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5jaGFycG9zCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS5nbHlwaC5jaGFycG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHx8IChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnJvd19w b3NpdGlvbiA9PSBBVF9aVgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ucm93X3Bvc2l0 aW9uID09IEFUX1pWKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnJvd19wb3NpdGlvbiA9PSBQ T1NUX1pWCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5yb3dfcG9zaXRpb24gPT0gUE9T VF9aVikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnUudmFsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3dfbnRoXS5nbHlwaC51LnZhbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5mYWNlX2lkCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5mYWNlX2lkCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBd LmdseXBoLnBhZGRpbmdfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgucGFkZGluZ19w CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLmxlZnRfYm94X2xpbmVfcAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVt3X250aF0uZ2x5cGgubGVmdF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmds eXBoLnJpZ2h0X2JveF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnJpZ2h0 X2JveF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgudm9mZnNldAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVt3X250aF0uZ2x5cGgudm9mZnNldAorICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5w aXhlbF93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgucGl4ZWxfd2lkdGgKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uZ2x5cGguc2xpY2UuaW1nLngKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19u dGhdLmdseXBoLnNsaWNlLmltZy54CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnNsaWNlLmlt Zy55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcueQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5nbHlwaC5zbGljZS5pbWcud2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LmdseXBoLnNsaWNlLmltZy53aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5zbGljZS5p bWcuaGVpZ2h0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcuaGVpZ2h0 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnNsaWNlLmNtcC5mcm9tCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5jbXAuZnJvbQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS54Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS54CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZ4CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5meAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS55CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZ5CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS5meQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5ocG9zCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRo XS5ocG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnZwb3MKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LnZwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ud2QKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLndk CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmgKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMF0uY3Vyc29yX3R5cGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmN1cnNv cl90eXBlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmN1cnNvcl93aWR0aAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVt3X250aF0uY3Vyc29yX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZnLnJlZAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0uZmcucmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZnLmdyZWVuCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5mZy5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5mZy5i bHVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5mZy5ibHVlCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBd LmJnLnJlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uYmcucmVkCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzBdLmJnLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5iZy5ncmVlbgorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5iZy5ibHVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5iZy5ibHVlCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzBdLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09 IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5hY3RpdmVf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaF9mbGF2b3IKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19u dGhdLmdseXBoX2ZsYXZvcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5lbmFibGVkX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bd19udGhdLmVuYWJsZWRfcCk7CisgICAgICAgICAgICAgICAgaWYgKHNhbWVfcCkK KyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisg ICAgICAgICAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiSElUICglcyk6ICB2cG9zICgl ZCkgfCBocG9zICglZCkgfCBjaGFyICglcylcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAoY2FjaGVfdHlwZSA9PSBNQ19DQUNIRSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyAiTUMiCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChjYWNoZV90eXBlID09IENIX0NBQ0hFKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/ICJDSCIKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0gRkNfQ0FDSEUpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gIkZDIgorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiAiTk8iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LnZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uaHBvcywKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nICh3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudS5jaCkpOworICAg ICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVt3X250aF0uc2FtZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChkZWJ1Z19wKQorICAg ICAgICAgICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJNSVNTICglcyk6ICB2cG9zICglZCkg fCBocG9zICglZCB2LiAlZCkgfCBjaGFyICglcyB2LiAlcykgfCBjYWNoZV91c2VkICglZCB2LiAl ZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNhY2hlX3R5cGUg PT0gTUNfQ0FDSEUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICJN QyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjYWNoZV90eXBlID09 IENIX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAiQ0gi CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY2FjaGVfdHlwZSA9PSBG Q19DQUNIRSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gIkZDIgor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogIk5PIiwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0udnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmhwb3Ms CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmhwb3MsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgudS5jaCksCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC51LmNoKSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNl ZFtjYWNoZV90eXBlXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdKTsKKyAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgaWYgKCFzYW1lX3ApCisgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAvKiBgbWF0cml4X3JvdycgaW4gYGRpc3BuZXcuY2AgY29udGFpbnMgdGhlIGZvbGxv d2luZyB0ZXN0cywKKyAgICAgICAgICAgICAgICBlYXNzZXJ0IChtYXRyaXggJiYgbWF0cml4LT5y b3dzKTsKKyAgICAgICAgICAgICAgICBlYXNzZXJ0IChyb3cgPj0gMCAmJiByb3cgPCBtYXRyaXgt Pm5yb3dzKTsgKi8KKyAgICAgICAgICAgICAgICBib29sIGJhcmZfY3Jhc2hfb25lID0gKHctPmN1 cnJlbnRfbWF0cml4ICYmIHctPmN1cnJlbnRfbWF0cml4LT5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsK KyAgICAgICAgICAgICAgICBpZiAoYmFyZl9jcmFzaF9vbmUpCisgICAgICAgICAgICAgICAgICBj b250aW51ZTsKKyAgICAgICAgICAgICAgICBib29sIGJhcmZfY3Jhc2hfdHdvID0gKHZudGggPj0g MCAmJiB2bnRoIDwgdy0+Y3VycmVudF9tYXRyaXgtPm5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAg ICAgICAgICAgICAgICBpZiAoYmFyZl9jcmFzaF90d28pCisgICAgICAgICAgICAgICAgICBjb250 aW51ZTsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICp2bnRoX3JvdyA9IE1BVFJJ WF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2bnRoKTsKKyAgICAgICAgICAgICAgICBpbnQgeF8w ID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS54OworICAg ICAgICAgICAgICAgIGludCBmeF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8wXS5meDsKKyAgICAgICAgICAgICAgICBpbnQgeV8wID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS55OworICAgICAgICAgICAgICAgIGlu dCBmeV8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5m eTsKKyAgICAgICAgICAgICAgICBpbnQgaHBvc18wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS5ocG9zOworICAgICAgICAgICAgICAgIGludCB2cG9zXzAg PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnZwb3M7Cisg ICAgICAgICAgICAgICAgaW50IHdkXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzBdLndkOworICAgICAgICAgICAgICAgIGludCBoXzAgPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmg7CisgICAgICAgICAgICAgICAg ZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZV8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5jdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgICBp bnQgY3Vyc29yX3dpZHRoXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzBdLmN1cnNvcl93aWR0aDsKKyAgICAgICAgICAgICAgICAvLyAgc3RydWN0IG1jX1JH QiBsc2xfZmdfMCA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5mZy5yZWQsCisgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAg ICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8wXS5mZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMF0uZmcuYmx1ZX07CisgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfYmdfMCA9 IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5i Zy5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4g PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmJnLmdyZWVu LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmJnLmJsdWV9OworICAg ICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3BfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMF0uYWN0aXZlX3A7CisgICAgICAgICAgICAgICAgZW51bSBtY19m bGF2b3IgZ2x5cGhfZmxhdm9yXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXzBdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICAgICAgICBib29sIGVuYWJsZWRf cF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5lbmFi bGVkX3A7CisgICAgICAgICAgICAgICAgaWYgKHZwb3NfMCA9PSB2bnRoCisgICAgICAgICAgICAg ICAgICAgICYmIGdseXBoX2ZsYXZvcl8wID09IE1DX0dMWVBICisgICAgICAgICAgICAgICAgICAg ICYmIGVuYWJsZWRfcF8wCisgICAgICAgICAgICAgICAgICAgICYmIHZudGhfcm93LT5lbmFibGVk X3ApCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIG1jX2VyYXNlX2N1 cnNvciAodywgdy0+Y3VycmVudF9tYXRyaXgsIHZudGhfcm93LCB4XzAsIHlfMCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBocG9zXzAsIHZwb3NfMCwgZ2x5cGhfZmxhdm9y XzAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGVfMCwg d2RfMCk7CisgICAgICAgICAgICAgICAgICAgIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uZW5hYmxlZF9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAg IC0tb2xkX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgICAgICAg ICAgIC8qIElmIHdlIGluYWR2ZXJ0ZW50bHkgZXJhc2VkIGFub3RoZXIgZmFrZSBjdXJzb3IgYXQg dGhlIHNhbWUKKyAgICAgICAgICAgICAgICAgICAgSFBPUyB0aGF0IGlzIHN0aWxsIGVuYWJsZWRf cCBpbiB0aGUgYG9sZF9tYXRyaXhgLCB0aGVuIHJlZHJhdyBpdC4gKi8KKyAgICAgICAgICAgICAg ICAgICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAg ICAgICAgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgbnRoXzEgPSAwOworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBtY190cmF2ZXJzZV9jYWNoZV9wIChvbGRfbWF0cml4LCBjYWNoZV90eXBl LCB2bnRoLCBudGhfMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsrbnRoXzEpCisg ICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBp bnQgeF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS54 OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmeF8xID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5meDsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICBpbnQgeV8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8xXS55OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmeV8xID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5meTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICBpbnQgaHBvc18xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8xXS5ocG9zOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlu dCB2cG9zXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFd LnZwb3M7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHdkXzEgPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLndkOworICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGludCBoXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXzFdLmg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJz b3JfdHlwZSBjdXJzb3JfdHlwZV8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8xXS5jdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBp bnQgY3Vyc29yX3dpZHRoXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzFdLmN1cnNvcl93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1 Y3QgbWNfUkdCIGxzbF9mZ18xID0gey5yZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzFdLmZnLnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZmcuYmx1ZX07CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgLy8gIHN0cnVjdCBtY19SR0IgbHNsX2JnXzEgPSB7LnJlZCA9IG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uYmcucmVkLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9 IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uYmcuZ3JlZW4s CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAg ICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFd LmJnLmJsdWV9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3BfMSA9 IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uYWN0aXZlX3A7 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9y XzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmdseXBo X2ZsYXZvcjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGVuYWJsZWRfcF8xID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5lbmFibGVkX3A7 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBnb19wXzEgPSAoaHBvc18wID09IGhw b3NfMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVuYWJs ZWRfcF8xKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWdvX3BfMSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGJvb2wgcmVtb3ZlX3BfMSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAg ICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCB3LT5jdXJyZW50X21hdHJpeCwgdm50aF9yb3cs IHhfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ZnhfMSwgeV8xLCBmeV8xLCBocG9zXzEsIHZwb3NfMSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgd2RfMSwgaF8xLCBjdXJzb3JfdHlwZV8xLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lk dGhfMSwgbHNsX2ZnXzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGFjdGl2ZV9wXzEsIGdseXBoX2ZsYXZvcl8xLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVfcF8xKTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHZwb3NfMCA9PSB2bnRoCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3BfMAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdm50aF9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3BfMCA9IHRydWU7CisgICAgICAgICAgICAg ICAgICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIHctPmN1cnJlbnRfbWF0cml4LCB2bnRo X3JvdywgeF8wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBm eF8wLCB5XzAsIGZ5XzAsIGhwb3NfMCwgdnBvc18wLCB3ZF8wLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBoXzAsIGN1cnNvcl90eXBlXzAsIGN1cnNvcl93aWR0 aF8wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsc2xfYmdf MCwgYWN0aXZlX3BfMCwgZ2x5cGhfZmxhdm9yXzAsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHJlbW92ZV9wXzApOworICAgICAgICAgICAgICAgICAgICAgIG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZW5hYmxlZF9wID0g ZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgLS1vbGRfbWF0cml4LmN1cnNvcnNfdXNlZFtj YWNoZV90eXBlXTsKKyAgICAgICAgICAgICAgICAgICAgICAvKiBJZiB3ZSBpbmFkdmVydGVudGx5 IGVyYXNlZCBhbm90aGVyIGZha2UgY3Vyc29yIGF0IHRoZSBzYW1lCisgICAgICAgICAgICAgICAg ICAgICAgSFBPUyB0aGF0IGlzIHN0aWxsIGVuYWJsZWRfcCBpbiB0aGUgYG9sZF9tYXRyaXhgLCB0 aGVuIHJlZHJhdyBpdC4gKi8KKyAgICAgICAgICAgICAgICAgICAgICBmb3IgKGVudW0gbWNfY2Fj aGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICArK2Nh Y2hlX3R5cGUpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg ICAgICAgIGZvciAoaW50IG50aF8yID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBtY190cmF2ZXJzZV9jYWNoZV9wIChvbGRfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGhf Mik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKytudGhfMikKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeF8y ID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS54OworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZ4XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmZ4OworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgaW50IHlfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMl0ueTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmeV8yID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5meTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGludCBocG9zXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzJdLmhwb3M7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBpbnQgdnBvc18yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8yXS52cG9zOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHdkXzIgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLndkOworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgaW50IGhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMl0uaDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVu dW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGVfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMl0uY3Vyc29yX3R5cGU7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzJdLmN1cnNvcl93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnXzIgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZmcucmVkLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmZnLmdyZWVuLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9 IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZmcuYmx1ZX07 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgc3RydWN0IG1jX1JHQiBsc2xfYmdf MiA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8y XS5iZy5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXzJdLmJnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8g ICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmJnLmJsdWV9OworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgYm9vbCBhY3RpdmVfcF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8yXS5hY3RpdmVfcDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvcl8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8yXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBib29sIGVuYWJsZWRfcF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8yXS5lbmFibGVkX3A7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBib29sIGdvX3BfMiA9IChocG9zXzAgPT0gaHBvc18yCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBmeF8wIDw9IGZ4XzIKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGZ4XzAgKyB3ZF8wID4gZnhfMiArIHdk XzIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVuYWJs ZWRfcF8yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZ29fcF8yKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3BfMiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIHctPmN1cnJlbnRfbWF0cml4LCB2 bnRoX3JvdywgeF8yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGZ4XzIsIHlfMiwgZnlfMiwgaHBvc18yLCB2cG9zXzIsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2RfMiwgaF8yLCBjdXJzb3Jf dHlwZV8yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGN1cnNvcl93aWR0aF8yLCBsc2xfZmdfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcF8yLCBnbHlwaF9mbGF2b3JfMiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVf cF8yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgfQorICAgIH0KKyAgaWYgKHVwZGF0aW5nX2ZyYW1lX3ApCisgICAgdXBkYXRlX2VuZCAoZik7 Cit9CisKK3ZvaWQKK21jX3VwZGF0ZV93aW5kb3dfZHJ5cnVuIChzdHJ1Y3Qgd2luZG93ICp3LCBi b29sIGZvcmNlX3AsIHN0cnVjdCBtY19lc3NlbnRpYWxzIGVzc2VudGlhbHMpCit7CisgIGlmICgh QlVGRkVSUCAody0+Y29udGVudHMpKQorICAgIHJldHVybjsKKworICBpZiAody0+bWNfbWF0cml4 LmN1cnNvcnNfdXNlZFtNQ19DQUNIRV0gPT0gMAorICAgICAgJiYgdy0+bWNfbWF0cml4LmN1cnNv cnNfdXNlZFtDSF9DQUNIRV0gPT0gMAorICAgICAgJiYgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNl ZFtGQ19DQUNIRV0gP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uZS4gIFdl IHdpbGwKKyAgICAgICAgIHVwZGF0ZSBpdCBiZWxvdywgYWZ0ZXIgdXBkYXRpbmcgYWxsIG9mIHRo ZSB3aW5kb3cncyBsaW5lcy4gKi8KKyAgICAgIGlmIChyb3ctPm1vZGVfbGluZV9wKQorICAgICAg ICB7CisgICAgICAgICAgaGVhZGVyX2xpbmVfcm93ID0gcm93OworICAgICAgICAgICsrcm93Owor ICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBoZWFkZXJfbGluZV9yb3cgPSBOVUxM OworCisgICAgICAvKiBVcGRhdGUgdGhlIG1vZGUgbGluZSwgaWYgbmVjZXNzYXJ5LiAqLworICAg ICAgc3RydWN0IGdseXBoX3JvdyAqbW9kZV9saW5lX3JvdyA9IE1BVFJJWF9NT0RFX0xJTkVfUk9X IChkZXNpcmVkX21hdHJpeCk7CisgICAgICBpZiAobW9kZV9saW5lX3Jvdy0+bW9kZV9saW5lX3Ag JiYgbW9kZV9saW5lX3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICB7CisgICAgICAgICAgbW9kZV9s aW5lX3Jvdy0+eSA9IHliICsgV0lORE9XX1NDUk9MTF9CQVJfQVJFQV9IRUlHSFQgKHcpOworICAg ICAgICAgIHVwZGF0ZV93aW5kb3dfbGluZSAodywgTUFUUklYX1JPV19WUE9TIChtb2RlX2xpbmVf cm93LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBk ZXNpcmVkX21hdHJpeCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbW91c2VfZmFj ZV9vdmVyd3JpdHRlbl9wKTsKKyAgICAgICAgfQorCisgICAgICAvKiBGaW5kIGZpcnN0IGVuYWJs ZWQgcm93LiAgT3B0aW1pemF0aW9ucyBpbiByZWRpc3BsYXlfaW50ZXJuYWwKKyAgICAgICAgIG1h eSBsZWFkIHRvIGFuIHVwZGF0ZSB3aXRoIG9ubHkgb25lIHJvdyBlbmFibGVkLiAgVGhlcmUgbWF5 CisgICAgICAgICBiZSBhbHNvIGNvbXBsZXRlbHkgZW1wdHkgbWF0cmljZXMuICovCisgICAgICB3 aGlsZSAocm93IDwgZW5kICYmICFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgKytyb3c7CisKKyAg ICAgIC8qIFRyeSByZXVzaW5nIHBhcnQgb2YgdGhlIGRpc3BsYXkgYnkgY29weWluZy4gKi8KKyAg ICAgIGlmIChyb3cgPCBlbmQgJiYgIXctPmRlc2lyZWRfbWF0cml4LT5ub19zY3JvbGxpbmdfcCkK KyAgICAgICAgeworICAgICAgICAgIGludCByYyA9IG1jX3Njcm9sbGluZ193aW5kb3cgKHcsIGhl YWRlcl9saW5lX3JvdyAhPSBOVUxMKTsKKyAgICAgICAgICBpZiAocmMgPCAwKQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICAvKiBBbGwgcm93cyB3ZXJlIGZvdW5kIHRvIGJlIGVxdWFsLiAq LworICAgICAgICAgICAgICBwYXVzZWRfcCA9IDA7CisgICAgICAgICAgICAgIGdvdG8gc2V0X2N1 cnNvcjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKHJjID4gMCkKKyAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIFdlJ3ZlIHNjcm9sbGVkIHRoZSBkaXNwbGF5 LiAqLworICAgICAgICAgICAgICAgIGZvcmNlX3AgPSAxOworICAgICAgICAgICAgICAgIGNoYW5n ZWRfcCA9IDE7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyogUHJvY2VzcyB0 aGUgY3Vyc29yIHJvdyBhdCB0aGUgb3V0c2V0IGlmIGl0IGlzIHdpdGhpbiBgZGVzaXJlZF9tYXRy aXhgLgorICAgICAgV2hlbiBwcm9jZXNzaW5nIGFsbCBvdGhlciByb3dzLCB3ZSB3aWxsIHF1ZXJ5 IHRoZSBgdy0+Y3VycmVudF9tYXRyaXhgIGZvciBkYXRhCisgICAgICByZWxhdGluZyB0byB0aGUg Y3Vyc29yIHJvdy4gIGBtYWtlX2N1cnJlbnRgICh3aXRoaW4gYHVwZGF0ZV93aW5kb3dfbGluZScp CisgICAgICB1cGRhdGVzIHRoZSBgdy0+Y3VycmVudF9tYXRyaXhgIGZvciB0aGUgYXBwbGljYWJs ZSByb3cuICBJbiBkb2luZyBzbywgaG93ZXZlciwKKyAgICAgIHRoZSBhcHBsaWNhYmxlIHJvdyBp biB0aGUgZGVzaXJlZCBtYXRyaXggaXMgYWx0ZXJlZCBzdWNoIHRoYXQgd2UgY2FuIG5vIGxvbmdl cgorICAgICAgcmVseSB1cG9uIHRoZSBhY2N1cmFjeSBvZiBgUk9XLT51c2VkW1RFWFRfQVJFQV1g LiAgVGhlcmVmb3JlLCB3ZSBtdXN0IG5vdyByZWx5CisgICAgICBleGNsdXNpdmVseSB1cG9uIGB3 LT5jdXJyZW50X21hdHJpeCcgZm9yIGN1cnNvciByb3cgYmFzZWQgZGVjaXNpb25zLiAqLworICAg ICAgZm9yIChzdHJ1Y3QgZ2x5cGhfcm93ICptY19yb3cgPSByb3c7CisgICAgICAgICAgIG1jX3Jv dyA8IGVuZCAmJiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVuZGluZyk7CisgICAgICAgICAgICsrbWNf cm93KQorICAgICAgICB7CisgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKG1j X3Jvdywgdy0+ZGVzaXJlZF9tYXRyaXgpOworICAgICAgICAgIGlmIChtY19yb3ctPmVuYWJsZWRf cAorICAgICAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAg eworICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4ID0gdy0+ZGVzaXJlZF9tYXRyaXg7CisgICAg ICAgICAgICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0g MCkKKyAgICAgICAgICAgICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZ19pZ25vcmVfc3F1ZWV6YWJs ZXMgKCk7CisgICAgICAgICAgICAgIGNoYW5nZWRfcCB8PSBtY191cGRhdGVfd2luZG93X2xpbmUg KHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3AsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMs IGRyYXdfcCk7CisgICAgICAgICAgICAgIGlmIChNQVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpID49 IHliKQorICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSB2cG9zICsgMTsgaSA8IHctPmN1cnJl bnRfbWF0cml4LT5ucm93cyAtIDE7ICsraSkKKyAgICAgICAgICAgICAgICAgIFNFVF9NQVRSSVhf Uk9XX0VOQUJMRURfUCAody0+Y3VycmVudF9tYXRyaXgsIGksIGZhbHNlKTsKKyAgICAgICAgICAg ICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGN1cnNvcl9tYXRyaXgg PSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgIC8qIFVwZGF0ZSB0aGUgcmVzdCBvZiB0aGUgbGlu ZXMuICovCisgICAgICBmb3IgKDsgcm93IDwgZW5kICYmIChmb3JjZV9wIHx8ICFpbnB1dF9wZW5k aW5nKTsgKytyb3cpCisgICAgICAgIC8qIHNjcm9sbGluZ193aW5kb3cgcmVzZXRzIHRoZSBlbmFi bGVkX3AgZmxhZyBvZiB0aGUgcm93cyBpdCByZXVzZXMgZnJvbQorICAgICAgICBjdXJyZW50X21h dHJpeC4gKi8KKyAgICAgICAgaWYgKHJvdy0+ZW5hYmxlZF9wKQorICAgICAgICAgIHsKKyAgICAg ICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIHctPmRlc2lyZWRfbWF0cml4 KTsKKyAgICAgICAgICAgIC8qIElmIHRoZSBgY3Vyc29yX3Jvd2AgaXMgd2l0aGluIHRoZSBgZGVz aXJlZF9tYXRyaXhgLCB0aGVuIGl0IHdhcworICAgICAgICAgICAgcHJvY2Vzc2VkIGhlcmVpbmFi b3ZlIGFuZCBzaG91bGQgYmUgc2tpcHBlZCBhdCB0aGlzIHRpbWUuICovCisgICAgICAgICAgICBp ZiAodnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAg ICAgICAgaW50IGk7CisgICAgICAgICAgICAvKiBXZSdsbCBoYXZlIHRvIHBsYXkgYSBsaXR0bGUg Yml0IHdpdGggd2hlbiB0bworICAgICAgICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmcuICBJ ZiBpdCdzIGRvbmUgdG9vIG9mdGVuLAorICAgICAgICAgICAgICAgc2Nyb2xsaW5nIGxhcmdlIHdp bmRvd3Mgd2l0aCByZXBlYXRlZCBzY3JvbGwtdXAKKyAgICAgICAgICAgICAgIGNvbW1hbmRzIHdp bGwgdG9vIHF1aWNrbHkgcGF1c2UgcmVkaXNwbGF5LiAqLworICAgICAgICAgICAgaWYgKCFmb3Jj ZV9wICYmICsrbl91cGRhdGVkICUgcHJlZW1wdF9jb3VudCA9PSAwKQorICAgICAgICAgICAgICBk ZXRlY3RfaW5wdXRfcGVuZGluZ19pZ25vcmVfc3F1ZWV6YWJsZXMgKCk7CisgICAgICAgICAgICBj aGFuZ2VkX3AgfD0gbWNfdXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9v dmVyd3JpdHRlbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgZHJhd19wKTsKKyAgICAgICAgICAgIC8q IE1hcmsgYWxsIHJvd3MgYmVsb3cgdGhlIGxhc3QgdmlzaWJsZSBvbmUgaW4gdGhlIGN1cnJlbnQK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VkIGhlcmUgZnJvbSBgc2V0X2N1cnNv cmAsIHRoZW4gc2V0IHRoZSBgY3Vyc29yX21hdHJpeGAuICovCisgICAgICBpZiAoY3Vyc29yX21h dHJpeCA9PSBOVUxMKQorICAgICAgICBjdXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7 CisgICAgICAvKiBSZXNldCBgcm93YCB0byAwIHNvIHRoYXQgZmFrZSBjdXJzb3JzIGNhbiBiZSBk cmF3biBvbiByb3dzIHByZWNlZGluZyB0aGUKKyAgICAgIGZpcnN0IGByb3ctPmVuYWJsZWRfcGAu ICBKdXN0IHByaW9yIHRvIHRoZSBjYWxsIHRvIGBzY3JvbGxpbmdfd2luZG93JyBhYm92ZSwKKyAg ICAgIGByb3dgIHdhcyBhZHZhbmNlZCB0byB0aGUgZmlyc3QgYHJvdy0+ZW5hYmxlZF9wYC4gKi8K KyAgICAgIGZvciAoc3RydWN0IGdseXBoX3JvdyAqZGVzaXJlZF9yb3cgPSBNQVRSSVhfUk9XICh3 LT5kZXNpcmVkX21hdHJpeCwgMCk7CisgICAgICAgICAgIGRlc2lyZWRfcm93IDwgZW5kCisgICAg ICAgICAgICYmIChmb3JjZV9wIHx8ICFpbnB1dF9wZW5kaW5nKQorICAgICAgICAgICAvKiBXMzIg RW1hY3MgY3Jhc2hlcyBvbiBzdGFydHVwIHdpdGhvdXQgYSBCVUZGRVJQIGNoZWNrLiAqLworICAg ICAgICAgICAmJiBCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgJiYgKCFOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgfHwg IU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAg ICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxl KSkpOworICAgICAgICAgICArK2Rlc2lyZWRfcm93KQorICAgICAgICB7CisgICAgICAgICAgaW50 IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKGRlc2lyZWRfcm93LCB3LT5kZXNpcmVkX21hdHJpeCk7 CisgICAgICAgICAgaWYgKGRlc2lyZWRfcm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICBjb250 aW51ZTsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJyZW50X3JvdyA9IE1BVFJJWF9S T1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAgICAgICAgICBlbnVtIG1jX3Jvd19wb3Np dGlvbiByb3dfcG9zaXRpb24gPSBtY19yb3dfcG9zaXRpb24gKHcsIGN1cnJlbnRfcm93LCBjdXJy ZW50X3JvdywgdnBvcyk7CisgICAgICAgICAgaWYgKGN1cnJlbnRfcm93LT5lbmFibGVkX3ApCisg ICAgICAgICAgICBtY19kcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIGN1cnJlbnRfcm93 LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgICAgICAgICAgICAg ICAgY3VycmVudF9yb3ctPngsIGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0sIHZwb3MsCisg ICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bv c2l0aW9uLCBkcmF3X3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgU0VUX0NVUlNPUl9PTkUp OworICAgICAgICB9CisKKyAgICAgIG1jX3Jlc3RvcmVfZ2x5cGhfbWF0cml4IChzYXZlZF9kZXNp cmVkLCB3LT5kZXNpcmVkX21hdHJpeCk7CisgICAgICBtY19yZXN0b3JlX2dseXBoX21hdHJpeCAo c2F2ZWRfY3VycmVudCwgdy0+Y3VycmVudF9tYXRyaXgpOworCisgICAgICBtY191cGRhdGVfd2lu ZG93X2VyYXNlICh3LCBvbGRfbWF0cml4KTsKKworICAgICAgbWNfeGZyZWVfY2FjaGVfbWF0cml4 ICh3LCAmb2xkX21hdHJpeCk7CisKKyAgICB9CisgIC8vIGNsb2NrX3QgY2xvY2tfZW5kID0gY2xv Y2soKTsKKyAgLy8gZG91YmxlIGNwdV90aW1lX3VzZWQgPSAoKGRvdWJsZSkgKGNsb2NrX2VuZCAt IGNsb2NrX3N0YXJ0KSkgLyBDTE9DS1NfUEVSX1NFQzsKKyAgLy8gZnByaW50ZiAoc3RkZXJyLCAi bWNfc2Nyb2xsaW5nX3dpbmRvdyAoJXMpOiAgVElNRSAoJWYpXG4iLCBtY193aW5kb3cgKHcpLCBj cHVfdGltZV91c2VkKTsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKIC8qIFN0cnVjdHVyZSB0byBwYXNzIGRpbWVuc2lvbnMgYXJv dW5kLiAgVXNlZCBmb3IgY2hhcmFjdGVyIGJvdW5kaW5nCiAgICBib3hlcywgZ2x5cGggbWF0cml4 IGRpbWVuc2lvbnMgYW5kIGFsaWtlLiAgKi8KIApAQCAtMjI0MSw2ICs0MDEzLDE2IEBAIGZyZWVf d2luZG93X21hdHJpY2VzIChzdHJ1Y3Qgd2luZG93ICp3KQogCSAgZnJlZV9nbHlwaF9tYXRyaXgg KHctPmN1cnJlbnRfbWF0cml4KTsKIAkgIGZyZWVfZ2x5cGhfbWF0cml4ICh3LT5kZXNpcmVkX21h dHJpeCk7CiAJICB3LT5jdXJyZW50X21hdHJpeCA9IHctPmRlc2lyZWRfbWF0cml4ID0gTlVMTDsK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICBtY194ZnJlZV9jYWNoZV9tYXRyaXggKHcsICZ3LT5tY19tYXRyaXgpOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAJfQogCiAgICAgICAvKiBOZXh0IHdpbmRvdyBvbiBzYW1lIGxl dmVsLiAgKi8KQEAgLTMzODcsNiArNTE2OSwyNiBAQCBjaGVja19jdXJyZW50X21hdHJpeF9mbGFn cyAoc3RydWN0IHdpbmRvdyAqdykKIHN0YXRpYyBib29sCiB1cGRhdGVfd2luZG93IChzdHJ1Y3Qg d2luZG93ICp3LCBib29sIGZvcmNlX3ApCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKG1jX3N0ZGVycl9wKQorICAgIGZwcmlu dGYgKHN0ZGVyciwgInVwZGF0ZV93aW5kb3cgKCVzKVxuIiwgbWNfd2luZG93ICh3KSk7CisKKyAg c3RydWN0IG1jX2Vzc2VudGlhbHMgZXNzZW50aWFsczsKKyAgbWNfc2V0X2Vzc2VudGlhbHMgKHcs ICZlc3NlbnRpYWxzKTsKKworICBtY191cGRhdGVfd2luZG93X2RyeXJ1biAodywgZm9yY2VfcCwg ZXNzZW50aWFscyk7CisKKyAgc3RydWN0IGdseXBoX21hdHJpeCAqY3Vyc29yX21hdHJpeCA9IE5V TEw7CisKKyAgYm9vbCBkcmF3X3AgPSB0cnVlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKmRlc2lyZWRfbWF0cml4ID0gdy0+ZGVzaXJlZF9t YXRyaXg7CiAgIGJv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ZWQgZGVjaXNpb25zLiAqLworICBm b3IgKHN0cnVjdCBnbHlwaF9yb3cgKm1jX3JvdyA9IHJvdzsKKyAgICAgICBtY19yb3cgPCBlbmQg JiYgKGZvcmNlX3AgfHwgIWlucHV0X3BlbmRpbmcpOworICAgICAgICsrbWNfcm93KQorICAgIHsK KyAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChtY19yb3csIGRlc2lyZWRfbWF0cml4 KTsKKyAgICAgIGlmIChtY19yb3ctPmVuYWJsZWRfcAorICAgICAgICAgICYmIHZwb3MgPT0gdy0+ Y3Vyc29yLnZwb3MpCisgICAgICAgIHsKKyAgICAgICAgICBjdXJzb3JfbWF0cml4ID0gZGVzaXJl ZF9tYXRyaXg7CisgICAgICAgICAgaWYgKCFmb3JjZV9wICYmICsrbl91cGRhdGVkICUgcHJlZW1w dF9jb3VudCA9PSAwKQorICAgICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3Nx dWVlemFibGVzICgpOworICAgICAgICAgIGNoYW5nZWRfcCB8PSAoQlVGRkVSUCAody0+Y29udGVu dHMpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgfHwgISBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGZjX3Zpc2libGUpKSkpCisgICAgICAgICAgICAgICAgICAgICAgID8gbWNfdXBkYXRlX3dpbmRv d19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50 aWFscywgZHJhd19wKQorICAgICAgICAgICAgICAgICAgICAgICA6IHVwZGF0ZV93aW5kb3dfbGlu ZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisgICAgICAgICAgaWYgKE1B VFJJWF9ST1dfQk9UVE9NX1kgKHJvdykgPj0geWIpCisgICAgICAgICAgICBmb3IgKGludCBpID0g dnBvcyArIDE7IGkgPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAg ICAgICAgIFNFVF9NQVRSSVhfUk9XX0VOQUJMRURfUCAody0+Y3VycmVudF9tYXRyaXgsIGksIGZh bHNlKTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICBjdXJzb3JfbWF0 cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK ICAgICAgIC8qIFVwZGF0ZSB0aGUgcmVzdCBvZiB0aGUgbGluZXMuICAqLwogICAgICAgZm9yICg7 IHJvdyA8IGVuZCAmJiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVuZGluZyk7ICsrcm93KQogCS8qIHNj cm9sbGluZ193aW5kb3cgcmVzZXRzIHRoZSBlbmFibGVkX3AgZmxhZyBvZiB0aGUgcm93cyBpdApA QCAtMzQ3MSw2ICs1MzE0LDE5IEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJv b2wgZm9yY2VfcCkKIAlpZiAocm93LT5lbmFibGVkX3ApCiAJICB7CiAJICAgIGludCB2cG9zID0g TUFUUklYX1JPV19WUE9TIChyb3csIGRlc2lyZWRfbWF0cml4KTsKKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgICAgIC8qIElmIHRo ZSBgY3Vyc29yX3Jvd2AgaXMgd2l0aGluIHRoZSBgZGVzaXJlZF9tYXRyaXhgLCB0aGVuIGl0IHdh cworICAgICAgICAgIHByb2Nlc3NlZCBoZXJlaW5hYm92ZSBhbmQgc2hvdWxkIGJlIHNraXBwZWQg YXQgdGhpcyB0aW1lLiAqLworICAgICAgICAgIGlmICh2cG9zID09IHctPmN1cnNvci52cG9zKQor ICAgICAgICAgIGNvbnRpbnVlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAg IGludCBpOwogCiAJICAgIC8qIFdlJ2xsIGhhdmUgdG8gcGxheSBhIGxpdHRsZSBiaXQgd2l0aCB3 aGVuIHRvCkBAIC0zNDc5LDggKzUzMzUsMjEgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRv dyAqdywgYm9vbCBmb3JjZV9wKQogCSAgICAgICBjb21tYW5kcyB3aWxsIHRvbyBxdWlja2x5IHBh dXNlIHJlZGlzcGxheS4gICovCiAJICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHBy ZWVtcHRfY291bnQgPT0gMCkKIAkgICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZ19pZ25vcmVfc3F1 ZWV6YWJsZXMgKCk7Ci0JICAgIGNoYW5nZWRfcCB8PSB1cGRhdGVfd2luZG93X2xpbmUgKHcsIHZw b3MsCi0JCQkJCSAgICAgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgICAgICBjaGFu Z2VkX3AgfD0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAg JiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICEgTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpKQorICAgICAgICAgICAg ICAgICAgICAgICA/IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vf b3ZlcndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIGRyYXdfcCkKKyAgICAgICAgICAgICAg ICAgICAgICAgOiB1cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3 cml0dGVuX3ApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwogCiAJICAgIC8qIE1hcmsg YWxsIHJvd3MgYmVsb3cgdGhlIGxhc3QgdmlzaWJsZSBvbmUgaW4gdGhlIGN1cnJlbnQKIAkgICAg ICAgbWF0cml4IGFzIGludmFsaWQuICBUaGlzIGlzIG5lY2Vzc2FyeSBiZWNhdXNlIG9mCkBAIC0z NTAxLDYgKzUzNzAsNDEgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBm b3JjZV9wKQogCiAgICAgc2V0X2N1cnNvcjoKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKio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iAody0+Y29udGVudHMp LCBmY192aXNpYmxlKSkpOworICAgICAgICsrZGVzaXJlZF9yb3cpCisgICAgeworICAgICAgaW50 IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKGRlc2lyZWRfcm93LCBkZXNpcmVkX21hdHJpeCk7Cisg ICAgICBpZiAoZGVzaXJlZF9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgY29udGludWU7CisgICAg ICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJyZW50X3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRf bWF0cml4LCB2cG9zKTsKKyAgICAgIGVudW0gbWNfcm93X3Bvc2l0aW9uIHJvd19wb3NpdGlvbiA9 IG1jX3Jvd19wb3NpdGlvbiAodywgY3VycmVudF9yb3csIGN1cnJlbnRfcm93LCB2cG9zKTsKKyAg ICAgIGlmIChjdXJyZW50X3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICBtY19kcmF3X3JvdyAodywg dy0+Y3VycmVudF9tYXRyaXgsIGN1cnJlbnRfcm93LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRf QVJFQV0sCisgICAgICAgICAgICAgICAgICAgICBjdXJyZW50X3Jvdy0+eCwgY3VycmVudF9yb3ct PnVzZWRbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRy aXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgZHJhd19wLCBTRVRfQ1VSU09SX1RXTyk7Cisg ICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICAvKiBVcGRhdGUgdGhl IGhlYWRlciBsaW5lIGFmdGVyIHNjcm9sbGluZyBiZWNhdXNlIGEgbmV3IGhlYWRlcgogCSBsaW5l IHdvdWxkIG90aGVyd2lzZSBvdmVyd3JpdGUgbGluZ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FdJTkRP V19GUkFNRSAodykpOworICBmb3IgKGludCBpID0gMDsgaSA8IHctPmN1cnJlbnRfbWF0cml4LT5u cm93czsgKytpKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdyA9IHctPmN1cnJl bnRfbWF0cml4LT5yb3dzICsgaTsKKyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAg IGJyZWFrOworICAgICAgICBlbHNlIGlmIChyb3ctPm1vZGVfbGluZV9wKQorICAgICAgICAgIGNv bnRpbnVlOworICAgICAgaWYgKHJvdy0+b3ZlcmxhcHBlZF9wKQorICAgICAgICB7CisgICAgICAg ICAgZm9yIChlbnVtIGdseXBoX3Jvd19hcmVhIGFyZWEgPSBMRUZUX01BUkdJTl9BUkVBOyBhcmVh IDwgTEFTVF9BUkVBOyArK2FyZWEpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG91dHB1 dF9jdXJzb3JfdG8gKHcsIGksIDAsIHJvdy0+eSwgYXJlYSA9PSBURVhUX0FSRUEgPyByb3ctPngg OiAwKTsKKyAgICAgICAgICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21h dHJpeCwgcm93LCBhcmVhLCByb3ctPngsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgcm93LT51c2VkW2FyZWFdLCB0cnVlLCBEUkFXX05PUk1BTF9URVhULAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIFVQREFURV9XSU5ET1dfX1JFRFJBV19PVkVSTEFQUEVE X1JPV1MpCisgICAgICAgICAgICAgICAgICAmJiByb3ctPnVzZWRbYXJlYV0pCisgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgRlJBTUVfUklGIChmKS0+d3JpdGVfZ2x5cGhzICh3 LCByb3csIHJvdy0+Z2x5cGhzW2FyZWFdLCBhcmVhLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICByb3ctPnVzZWRbYXJlYV0pOworICAgICAgICAgICAgICAg ICAgRlJBTUVfUklGIChmKS0+Y2xlYXJfZW5kX29mX2xpbmUgKHcsIHJvdywgYXJlYSwgLTEpOwor ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICByb3ctPm92ZXJsYXBw ZWRfcCA9IDA7CisgICAgICAgIH0KKyAgICAgIGlmIChNQVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cp ID49IHliKQorICAgICAgICBicmVhazsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKIAkgICAgICByZWRyYXdfb3ZlcmxhcHBpbmdfcm93cyAodywgeWIpOwogCSAgICB9CiAj ZW5kaWYKQEAgLTM1MzYsOCArNTQ4MiwyMCBAQCB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2luZG93 ICp3LCBib29sIGZvcmNlX3ApCiAjZW5kaWYKIAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQor CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisg IGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICBtY191cGRhdGVfd2luZG93X2ZyaW5n ZXMgKHcsIDApOworICAgIGVsc2UKICAgICAgIHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgMCk7 CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIC8qIEVuZCB0aGUgdXBkYXRl IG9mIHdpbmRvdyBXLiAgRG9uJ3Qgc2V0IHRoZSBjdXJzb3IgaWYgd2UKICAgICAgICAgIHBhdXNl ZCB1cGRhdGluZyB0aGUgZGlzcGxheSBiZWNhdXNlIGluIHRoaXMgY2FzZSwKICAgICAgICAgIHNl dF93aW5kb3dfY3Vyc29yX2FmdGVyX3VwZGF0ZSBoYXNuJ3QgYmVlbiBjYWxsZWQsIGFuZApkaWZm IC0tZ2l0IGEvc3JjL2ZyYW1lLmggYi9zcmMvZnJhbWUuaAppbmRleCBmYTQ1YTMyLi41M2FkMTMx IDEwMDY0NAotLS0gYS9zcmMvZnJhbWUuaAorKysgYi9zcmMvZnJhbWUuaApAQCAtMjA1LDYgKzIw NSwxNiBAQCBzdHJ1Y3QgZnJhbWUKICAgTGlzcF9PYmplY3QgdG9vbF9iYXJfaXRlbXM7CiAgIC8q IHRvb2xfYmFyX2l0ZW1zIHNob3VsZCBiZSB0aGUgbGFzdCBMaXNwX09iamVjdCBtZW1iZXIuICAq LwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CisgIC8qIE5vbi1uaWwgd2hlbiB0aGUgZnJhbWUgaXMgaW4gdGhlIHByb2Nlc3Mgb2YgYmVpbmcg dXBkYXRlZC4gKi8KKyAgc3RydWN0IGZyYW1lICptY191cGRhdGluZ19mcmFtZTsKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogICAvKiBDYWNoZSBvZiByZWFsaXplZCBmYWNlcy4gICov CiAgIHN0cnVjdCBmYWNlX2NhY2hlICpmYWNlX2NhY2hlOwogCmRpZmYgLS1naXQgYS9zcmMvZnJp bmdlLmMgYi9zcmMvZnJpbmdlLmMKaW5kZXggZDBkNTk5Mi4uMTBhYTEwMCAxMDA2NDQKLS0tIGEv c3JjL2ZyaW5nZS5jCisrKyBiL3NyYy9mcmluZ2UuYwpAQCAtNDM3LDYgKzQzNyw0NjAgQEAgc3Rh dGljIHVuc2lnbmVkIHNob3J0IGVtcHR5X2xpbmVfYml0c1tdID0gewogI2RlZmluZSBTVEFOREFS RF9CSVRNQVBfSEVJR0hUKGJpdHMpIChzaXplb2YgKGJpdHMpL0JZVEVTX1BFUl9CSVRNQVBfUk9X KQogI2RlZmluZSBGUkJJVFMoYml0cykgIGJpdHMsIFNUQU5EQVJEX0JJVE1BUF9IRUlHSFQgKGJp dHMpCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJT T1JTICovCisKKy8qIGArLWZyaW5nZS1oZWxwZXItZGVjaW1hbCcgZGVmaW5lZCBpbiBgY3Jvc3No YWlycy5lbGAgKi8KKworLyogVE9ETzogIENvbnNpZGVyIGFkZGluZyB0aGUgZm9sbG93aW5nIGZy aW5nZSBiaXRtYXBzOgorICAoZGVmaW5lLWZyaW5nZS1iaXRtYXAgJ2JyZWFrcG9pbnQgIlx4M2Nc eDdlXHhmZlx4ZmZceGZmXHhmZlx4N2VceDNjIikKKyAgKGRlZmluZS1mcmluZ2UtYml0bWFwICdo b2xsb3ctcmlnaHQtdHJpYW5nbGUgIlx4ZTBceDkwXHg4OFx4ODRceDg0XHg4OFx4OTBceGUwIikg Ki8KKworLyogMjQKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4u Li4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4ueHgu Li4iCisgICAgICAieC4uLnh4Li4iCisgICAgICAieC4uLi54eC4iCisgICAgICAieC54eHh4eHgi CisgICAgICAieC54eHh4eHgiCisgICAgICAieC4uLi54eC4iCisgICAgICAieC4uLnh4Li4iCisg ICAgICAieC4ueHguLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAg ICAieC4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9iYXJf cmlnaHRfYXJyb3dfYml0c1tdID17CisgIDB4ODAsIDB4ODAsIDB4ODAsIDB4OTgsIDB4OGMsIDB4 ODYsIDB4YmYsCisgIDB4YmYsIDB4ODYsIDB4OGMsIDB4OTgsIDB4ODAsIDB4ODAsIDB4ODB9Owor CisvKiAyNQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi54 eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIueHguLi54eCIK KyAgICAgICIuLnh4Li54eCIKKyAgICAgICIuLi54eC54eCIKKyAgICAgICJ4eHh4eHh4eCIKKyAg ICAgICJ4eHh4eHh4eCIKKyAgICAgICIuLi54eC54eCIKKyAgICAgICIuLnh4Li54eCIKKyAgICAg ICIueHguLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIu Li4uLi54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3JldmVyc2VkX3ZlcnRpY2Fs X2Jhcl9yaWdodF9hcnJvd19iaXRzW10gPXsKKyAgMHgzLCAweDMsIDB4MywgMHg2MywgMHgzMywg MHgxYiwgMHhmZiwgMHhmZiwgMHgxYiwgMHgzMywgMHg2MywgMHgzLCAweDMsIDB4M307CisKKy8q IDI2CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4eHh4eHh4Igor ICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLnh4Li54IgorICAg ICAgInguLi54eC54IgorICAgICAgInguLi4ueHh4IgorICAgICAgIngueHh4eHh4IgorICAgICAg IngueHh4eHh4IgorICAgICAgInguLi4ueHh4IgorICAgICAgInguLi54eC54IgorICAgICAgIngu Lnh4Li54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInh4eHh4 eHh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfaG9sbG93X3JlY3RhbmdsZV9yaWdo dF9hcnJvd19iaXRzW10gPXsKKyAgMHhmZiwgMHg4MSwgMHg4MSwgMHg5OSwgMHg4ZCwgMHg4Nywg MHhiZiwKKyAgMHhiZiwgMHg4NywgMHg4ZCwgMHg5OSwgMHg4MSwgMHg4MSwgMHhmZn07CisKKy8q IDI3CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4eHh4eHh4Igor ICAgICAgInguLi4uLnh4IgorICAgICAgInguLi4uLnh4IgorICAgICAgIngueHguLnh4IgorICAg ICAgInguLnh4Lnh4IgorICAgICAgInguLi54eHh4IgorICAgICAgInh4eHh4eHh4IgorICAgICAg Inh4eHh4eHh4IgorICAgICAgInguLi54eHh4IgorICAgICAgInguLnh4Lnh4IgorICAgICAgIngu eHguLnh4IgorICAgICAgInguLi4uLnh4IgorICAgICAgInguLi4uLnh4IgorICAgICAgInh4eHh4 eHh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcmV2ZXJzZWRfaG9sbG93X3JlY3Rh bmdsZV9yaWdodF9hcnJvd19iaXRzW10gPXsKKyAgMHhmZiwgMHg4MSwgMHg4MSwgMHhiMSwgMHg5 OSwgMHg4ZCwgMHhmZiwKKyAgMHhmZiwgMHg4ZCwgMHg5OSwgMHhiMSwgMHg4MSwgMHg4MSwgMHhm Zn07CisKKy8qIDI4CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4 eHh4eHh4IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4u Li54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54 IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54Igor ICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAg ICAgInh4eHh4eHh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfaG9sbG93X3JlY3Rh bmdsZV9iaXRzW10gPXsKKyAgMHhmZiwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4 MSwKKyAgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHhmZn07CisKKy8qIDI5 CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInguLi4uLi4uIgorICAg ICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAg InguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgIngu Li4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4u Li4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4u IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX2JpdHNbXSA9ewor ICAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLAorICAweDgwLCAweDgw LCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwfTsKKworLyogMzAKKyAgICAoKy1mcmluZ2Ut aGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisg ICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAg ICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAi Li4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4u Li4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiKQorKi8KK3N0YXRpYyB1 bnNpZ25lZCBzaG9ydCBtY19yZXZlcnNlZF92ZXJ0aWNhbF9iYXJfYml0c1tdID17CisgIDB4Mywg MHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4 MywgMHgzfTsKKworLyogMzEKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAg ICAieHguLi4uLi4iCisgICAgICAieHguLi4uLi4iCisgICAgICAiIHh4Li4uLi4iCisgICAgICAi Lnh4Li4uLi4iCisgICAgICAiLi54eC4uLi4iCisgICAgICAiLi54eC4uLi4iCisgICAgICAiLi4u eHguLi4iCisgICAgICAiLi4ueHguLi4iCisgICAgICAiLi4uLnh4Li4iCisgICAgICAiLi4uLnh4 Li4iCisgICAgICAiLi4uLi54eC4iCisgICAgICAiLi4uLi54eC4iCisgICAgICAiLi4uLi4ueHgi CisgICAgICAiLi4uLi4ueHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19iYWNrc2xh c2hfYml0c1tdID17CisgIDB4YzAsIDB4YzAsIDB4ZTAsIDB4NjAsIDB4MzAsIDB4MzAsIDB4MTgs IDB4MTgsIDB4YywgMHhjLCAweDYsIDB4NiwgMHgzLCAweDN9OworCisvKiAzMgorICAgICgrLWZy aW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4eC4uLi4uLiIKKyAgICAgICJ4eC4uLi4u LiIKKyAgICAgICJ4eHguLi4uLiIKKyAgICAgICJ4eHguLi4uLiIKKyAg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gICAgICJ4eC4uLi54eCIKKyAgICAgICJ4eHguLnh4eCIKKyAgICAgICIu eHh4eHh4LiIKKyAgICAgICIuLnh4eHguLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1j X3NtaWxleV9mYWNlX2JpdHNbXSA9eworICAweDNjLCAweDdlLCAweDk5LCAweDk5LCAweGZmLCAw eGMzLCAweGU3LCAweDdlLCAweDNjfTsKKworLyogMzUKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhl eGFkZWNpbWFsCisgICAgICAiLi54Li4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4u LnguLi4iCisgICAgICAiLi4uLi54Li4iCisgICAgICAiLi4uLnguLi4iCisgICAgICAiLi4ueC4u Li4iCisgICAgICAiLi54Li4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5n bGVfYW5nbGVfcmlnaHRfYml0c1tdID17CisgIDB4MjAsIDB4MTAsIDB4OCwgMHg0LCAweDgsIDB4 MTAsIDB4MjB9OworCisvKiAzNgorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAg ICAgICIuLi4uLnguLiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAg ICIuLnguLi4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIu Li4uLnguLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3NpbmdsZV9hbmdsZV9sZWZ0 X2JpdHNbXSA9eworICAweDQsIDB4OCwgMHgxMCwgMHgyMCwgMHgxMCwgMHg4LCAweDR9OworCisv KiAzNworICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4eC54eC4uLiIK KyAgICAgICIueHgueHguLiIKKyAgICAgICIuLnh4Lnh4LiIKKyAgICAgICIuLi54eC54eCIKKyAg ICAgICIuLnh4Lnh4LiIKKyAgICAgICIueHgueHguLiIKKyAgICAgICJ4eC54eC4uLiIpCisqLwor c3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV9yaWdodF9iaXRzW10gPXsKKyAg MHhkOCwgMHg2YywgMHgzNiwgMHgxYiwgMHgzNiwgMHg2YywgMHhkOH07CisKKy8qIDM4CisgICAg KCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLnh4Lnh4IgorICAgICAgIi4u eHgueHguIgorICAgICAgIi54eC54eC4uIgorICAgICAgInh4Lnh4Li4uIgorICAgICAgIi54eC54 eC4uIgorICAgICAgIi4ueHgueHguIgorICAgICAgIi4uLnh4Lnh4IikKKyovCitzdGF0aWMgdW5z aWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX2xlZnRfYml0c1tdID17CisgIDB4MWIsIDB4MzYs IDB4NmMsIDB4ZDgsIDB4NmMsIDB4MzYsIDB4MWJ9OworCisvKiAzOQorICAgICgrLWZyaW5nZS1o ZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4LngueC4uLiIKKyAgICAgICIueC54LnguLiIKKyAg ICAgICIuLngueC54LiIKKyAgICAgICIuLi54LngueCIKKyAgICAgICIuLngueC54LiIKKyAgICAg ICIueC54LnguLiIKKyAgICAgICJ4LngueC4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0 IG1jX3RyaXBsZV9hbmdsZV9yaWdodF9iaXRzW10gPXsKKyAgMHhhOCwgMHg1NCwgMHgyYSwgMHgx NSwgMHgyYSwgMHg1NCwgMHhhOH07CisKKy8qIDQwCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhh ZGVjaW1hbAorICAgICAgIi4uLngueC54IgorICAgICAgIi4ueC54LnguIgorICAgICAgIi54Lngu eC4uIgorICAgICAgIngueC54Li4uIgorICAgICAgIi54LngueC4uIgorICAgICAgIi4ueC54Lngu IgorICAgICAgIi4uLngueC54IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdHJpcGxl X2FuZ2xlX2xlZnRfYml0c1tdID17CisgIDB4MTUsIDB4MmEsIDB4NTQsIDB4YTgsIDB4NTQsIDB4 MmEsIDB4MTV9OworCisvKiA0MQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAg ICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAg ICIuLi4uLi4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIu eC4uLnguLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4u Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVu c2lnbmVkIHNob3J0IG1jX3NpbmdsZV9hbmdsZV91cF9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwg MHgwMCwgMHgwMCwgMHgxMCwgMHgyOCwgMHg0NCwgMHg4MiwgMHgwMCwgMHgwMCwgMHgwMCwgMHgw MH07CisKKy8qIDQyCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4u Li4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4u Li4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIi4ueC54Li4u IgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgor ICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQg c2hvcnQgbWNfc2luZ2xlX2FuZ2xlX2Rvd25fYml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAs IDB4MDAsIDB4ODIsIDB4NDQsIDB4MjgsIDB4MTAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9Owor CisvKiA0MworICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4u LiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi54Li4uLiIK KyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li54Li54LiIKKyAg ICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAg ICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3Rh dGljIHVuc2lnbmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV91cF9iaXRzW10gPXsKKyAgMHgwMCwg MHgwMCwgMHgwMCwgMHgxMCwgMHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0NCwgMHg4MiwgMHgw MCwgMHgwMCwgMHgwMH07CisKKy8qIDQ0CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1h bAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgor ICAgICAgInguLi4uLnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAg ICAgInguLnguLnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAg Ii4uLnguLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4u Li4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX2Rvd25f Yml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4ODIsIDB4NDQsIDB4MjgsIDB4OTIsIDB4 NDQsIDB4MjgsIDB4MTAsIDB4MDAsIDB4MDAsIDB4MDB9OworCisvKiA0NQorICAgICgrLWZyaW5n ZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi54Li4uLiIK KyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li54Li54LiIKKyAg ICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAg ICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIu Li4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBsZV9hbmdsZV91cF9i aXRzW10gPXsKKyAgMHgwMCwgMHgxMCwgMHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0NCwgMHg5 MiwgMHgyOCwgMHg0NCwgMHg4MiwgMHgwMH07CisKKy8qIDQ2CisgICAgKCstZnJpbmdlLWhlbHBl ci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgInguLi4uLnguIgorICAgICAg Ii54Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54 Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54Li4u eC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi4uLi4u IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcXVhZHJ1cGxlX2FuZ2xlX2Rvd25fYml0 c1tdID17CisgIDB4MDAsIDB4ODIsIDB4NDQsIDB4MjgsIDB4OTIsIDB4NDQsIDB4MjgsIDB4OTIs IDB4NDQsIDB4MjgsIDB4MTAsIDB4MDB9OworCisvKiA0NworICAgICgrLWZyaW5nZS1oZWxwZXIt aGV4YWRlY2ltYWwKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIu eC4uLnguLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4u LnguLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLngu LiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIK KyAgICAgICJ4Li4uLi54LiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3F1YWRydXBs ZV9hbmdsZV91cF9iaXRzW10gPXsKKyAgMHgxMCwgMHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0 NCwgMHg5MiwgMHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0NCwgMHg4Mn07CisKKy8qIDQ4Cisg ICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInguLi4uLnguIgorICAgICAg Ii54Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54 Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54Li4u eC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54Li4ueC4u IgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi4uLnguLi4uIikKKyovCitzdGF0aWMgdW5zaWdu ZWQgc2hvcnQgbWNfdHJpcGxlX2FuZ2xlX2Rvd25fYml0c1tdID17CisgIDB4ODIsIDB4NDQsIDB4 MjgsIDB4OTIsIDB4NDQsIDB4MjgsIDB4OTIsIDB4NDQsIDB4MjgsIDB4OTIsIDB4NDQsIDB4Mjgs IDB4MTB9OworCiAvKiBOT1RFOiAgVGhlIG9yZGVyIG9mIHRoZXNlIGJpdG1hcHMgbXVzdCBtYXRj aCB0aGUgc2VxdWVu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YyBpcyBwcmVzZW50LCB1c2Ugbm9uLXBhcnRpYWwgYml0bWFwLiAqLworaW50CittY19n ZXRfZnJpbmdlX2JpdG1hcCAoc3RydWN0IHdpbmRvdyAqdywgTGlzcF9PYmplY3QgYml0bWFwLCBp bnQgcmlnaHRfcCwgaW50IHBhcnRpYWxfcCkKK3sKKyAgTGlzcF9PYmplY3QgY21hcCwgYm0xID0g UW5pbCwgYm0yID0gUW5pbCwgYm07CisgIEVNQUNTX0lOVCBsbjEgPSAwLCBsbjIgPSAwOworICBp bnQgaXgxID0gcmlnaHRfcDsKKyAgaW50IGl4MiA9IGl4MSArIChwYXJ0aWFsX3AgPyAyIDogMCk7 CisgIGlmICgoY21hcCA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZnJpbmdlX2luZGlj YXRvcl9hbGlzdCkpLCAhTklMUCAoY21hcCkpCisgICAgeworICAgICAgYm0xID0gbWNfYXNzcSAo Yml0bWFwLCBjbWFwKTsKKyAgICAgIGlmIChDT05TUCAoYm0xKSkKKyAgeworICAgIGlmICgoYm0x ID0gWENEUiAoYm0xKSksIE5JTFAgKGJtMSkpCisgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJ VE1BUDsKKyAgICBpZiAoQ09OU1AgKGJtMSkpCisgICAgICB7CisgICAgICAgIGxuMSA9IFhGSVhO VU0gKEZsZW5ndGggKGJtMSkpOworICAgICAgICBpZiAocGFydGlhbF9wKQorICAgICAgICAgIHsK KyAgICAgICAgICAgIGlmIChsbjEgPiBpeDIpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICBibSA9IG1jX250aCAoaXgyLCBibTEpOworICAgICAgICAgICAgICAgIGlmICghRVEgKGJt LCBRdCkpCisgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICB9Cisg ICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg aWYgKGxuMSA+IGl4MSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBibSA9 IG1jX250aCAoaXgxLCBibTEpOworICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkK KyAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAgICB9CisgICAg ICAgICAgICB9CisgICAgICB9CisgICAgZWxzZSBpZiAoKGJtID0gYm0xLCAhRVEgKGJtLCBRdCkp KQorICAgICAgZ290byBmb3VuZDsKKyAgfQorICAgIH0KKyAgaWYgKCFFUSAoY21hcCwgQlZBUiAo JmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpCisgICAgICAmJiAhTklM UCAoQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpKQorICAg IHsKKyAgICAgIGJtMiA9IG1jX2Fzc3EgKGJpdG1hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywg ZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpOworICAgICAgaWYgKENPTlNQIChibTIpKQorICAgICAg ICB7CisgICAgICAgICAgaWYgKChibTIgPSBYQ0RSIChibTIpKSwgIU5JTFAgKGJtMikpCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChDT05TUCAoYm0yKSkKKyAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICBsbjIgPSBYRklYTlVNIChGbGVuZ3RoIChibTIpKTsKKyAg ICAgICAgICAgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgICAgICBpZiAobG4yID4gaXgyKQorICAgICAgICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgyLCBibTIpOwor ICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICB9CisgIGlmIChsbjEgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19u dGggKGl4MSwgYm0xKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgIGdvdG8gZm91 bmQ7CisgICAgfQorICBpZiAobG4yID4gaXgxKQorICAgIHsKKyAgICAgIGJtID0gbWNfbnRoIChp eDEsIGJtMik7CisgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICBnb3RvIGZvdW5kOwor ICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgfQorICAgIGVsc2UgaWYgKChi bSA9IGJtMiwgTklMUCAoYm0pKSkKKyAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOwor ICBmb3VuZDoKKyAgcmV0dXJuIGxvb2t1cF9mcmluZ2VfYml0bWFwIChibSk7Cit9CisKK3N0YXRp YyBpbnQKK21jX2dldF9sb2dpY2FsX2N1cnNvcl9iaXRtYXAgKHN0cnVjdCB3aW5kb3cgKncsIExp c3BfT2JqZWN0IGN1cnNvcikKK3sKKyAgTGlzcF9PYmplY3QgY21hcCwgYm0gPSBRbmlsOworICBp ZiAoKGNtYXAgPSBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZyaW5nZV9jdXJzb3JfYWxp c3QpKSwgIU5JTFAgKGNtYXApKQorICAgIHsKKyAgICAgIGJtID0gbWNfYXNzcSAoY3Vyc29yLCBj bWFwKTsKKyAgICAgIGlmIChDT05TUCAoYm0pKQorICAgICAgICB7CisgICAgICAgICAgaWYgKChi bSA9IFhDRFIgKGJtKSksIE5JTFAgKGJtKSkKKyAgICAgICAgICAgIHJldHVybiBNQ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ICAtLSB1c2UgZm9yIGxlZnQgcmlnaHQgcGFydGlhbC1sZWZ0 IHBhcnRpYWwtcmlnaHQKKyAgSWYgYW55IHZhbHVlIGluIGxvY2FsIGJpbmRpbmcgaXMgbm90IHBy ZXNlbnQgb3IgdCwgdXNlIGdsb2JhbCB2YWx1ZS4KKyAgICAgSWYgcGFydGlhbCwgbG9va3VwIHBh cnRpYWwgYml0bWFwIGluIGRlZmF1bHQgdmFsdWUgaWYgbm90IGZvdW5kIGhlcmUuCisgICAgIElm IG5vdCBwYXJ0aWFsLCBvciBubyBwYXJ0aWFsIHNwZWMgaXMgcHJlc2VudCwgdXNlIG5vbi1wYXJ0 aWFsIGJpdG1hcC4gICovCisgIGlmICgoY21hcCA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpLCAhTklMUCAoY21hcCkpCisgICAgeworICAgICAg Ym0xID0gbWNfYXNzcSAoYml0bWFwLCBjbWFwKTsKKyAgICAgIGlmIChDT05TUCAoYm0xKSkKKyAg ICAgICAgeworICAgICAgICAgIGlmICgoYm0xID0gWENEUiAoYm0xKSksIE5JTFAgKGJtMSkpCisg ICAgICAgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICBpZiAoQ09O U1AgKGJtMSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGxuMSA9IFhGSVhOVU0gKEZs ZW5ndGggKGJtMSkpOworICAgICAgICAgICAgICBpZiAocGFydGlhbF9wKQorICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChsbjEgPiBpeDIpCisgICAgICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgyLCBibTEpOworICAg ICAgICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICAg ICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgICAgaWYgKGxuMSA+IGl4MSkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAgICAgICAgICAgICAg ICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZ290 byBmb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmICgoYm0gPSBibTEsICFFUSAoYm0sIFF0 KSkpCisgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgIH0KKyAgICB9CisgIGlmICgh RVEgKGNtYXAsIEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3Qp KQorICAgICAgJiYgIU5JTFAgKEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0 b3JfYWxpc3QpKSkKKyAgICB7CisgICAgICBibTIgPSBtY19hc3NxIChiaXRtYXAsIEJWQVIgKCZi dWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKTsKKyAgICAgIGlmIChDT05T UCAoYm0yKSkKKyAgICAgICAgeworICAgICAgICAgIGlmICgoYm0yID0gWENEUiAoYm0yKSksICFO SUxQIChibTIpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoQ09OU1AgKGJtMikp CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgbG4yID0gWEZJWE5VTSAoRmxl bmd0aCAoYm0yKSk7CisgICAgICAgICAgICAgICAgICBpZiAocGFydGlhbF9wKQorICAgICAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKGxuMiA+IGl4MikKKyAgICAg ICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYm0gPSBtY19u dGggKGl4MiwgYm0yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0 KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBpZiAobG4xID4gaXgxKQorICAgIHsK KyAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICBpZiAoIUVRIChibSwgUXQpKQor ICAgICAgICBnb3RvIGZvdW5kOworICAgIH0KKyAgaWYgKGxuMiA+IGl4MSkKKyAgICB7CisgICAg ICBibSA9IG1jX250aCAoaXgxLCBibTIpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAg ICAgZ290byBmb3VuZDsKKyAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICAgIH0K KyAgICBlbHNlIGlmICgoYm0gPSBibTIsIE5JTFAgKGJtKSkpCisgICAgICByZXR1cm4gTUNfTk9f RlJJTkdFX0JJVE1BUDsKKyAgZm91bmQ6CisgIHJldHVybiBsb29rdXBfZnJpbmdlX2JpdG1hcCAo Ym0pOworfQorCisvKiBSZWNhbGN1bGF0ZSB0aGUgYml0bWFwcyB0byBzaG93IGluIHRoZSBmcmlu Z2VzIG9mIHdpbmRvdyBXLgorICAgT25seSBtYXJrIHJvd3Mgd2l0aCBtb2RpZmllZCBiaXRtYXBz IGZvciB1cGRhdGUgaW4gcmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AuCisgICBJZiBLRUVQX0NVUlJF TlRfUCBpcyAwLCB1cGRhdGUgY3VycmVudF9tYXRyaXggdG9vLiAqLworYm9vbAorbWNfdXBkYXRl X3dpbmRvd19mcmluZ2VzIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGtlZXBfY3VycmVudF9wKQor eworICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csICpjdXIgPSAwOworICBpbnQgeWIgPSB3aW5kb3df dGV4dF9ib3R0b21feSAodyk7CisgIGludCBybiwgbnJvd3MgPSB3LT5jdXJyZW50X21hdHJpeC0+ bnJvd3M7CisgIGludCB5OworICBib29sIHJlZHJhd19wID0gMDsKKyAgTGlzcF9PYmplY3QgYm91 bmRhcnlfdG9wID0gUW5pbCwgYm91bmRhcnlfYm90ID0gUW5pbDsKKyAgTGlzcF9PYmplY3QgYXJy b3dfdG9wID0gUW5pbCwgYXJyb3dfYm90ID0gUW5pbDsKKyAgTGlzcF9PYmplY3QgZW1wdHlfcG9z OworICBMaXNwX09iamVjdCBpbmQgPSBRbmlsOworI2RlZmluZSBNQVhfQklUTUFQX0NBQ0hFICg4 KjQpCisgIGludCBiaXRtYXBfY2FjaGVbTUFYX0JJVE1BUF9DQUNIRV07CisgIGludCB0b3BfaW5k X3JuLCBib3RfaW5kX3JuOworICBpbnQgdG9wX2luZF9taW5feSwgYm90X2luZF9tYXhfeTsKKyAg LyogdG9wX2luZF9ybiBpcyBzZXQgdG8gYSBub25uZWdhdGl2ZSB2YWx1ZSB3aGVuZXZlcgorICAg ICByb3ctPmluZGljYXRlX2JvYl9wIGlzIHNldCwgc28gaXQncyBPSyB0aGF0IHRvcF9yb3dfZW5k c19hdF96dl9wCisgICAgIGlzIG5vdCBpbml0aWFsaXplZCBoZXJlLiAgU2ltaWxhcmx5IGZvciBi b3RfaW5kX3JuLAorICAgICByb3ctPmluZGljYXRlX2VvYl9wIGFuZCBib3Rfcm93X2VuZHNfYXRf enZfcC4gICovCisgIGludCB0b3Bfcm93X2VuZHNfYXRfenZfcCBNQ19JRl9MSU5UICg9IDApLCBi b3Rfcm93X2VuZHNfYXRfenZfcCBNQ19JRl9MSU5UICg9IDApOworICBpZiAody0+cHNldWRvX3dp bmRvd19wKQorICAgIHJldHVybiAwOworICBpZiAoIU1JTklfV0lORE9XX1AgKHcpCisgICAgICAm JiAoaW5kID0gQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBpbmRpY2F0ZV9idWZmZXJfYm91 bmRhcmllcyksICFOSUxQIChpbmQpKSkKKyAgICB7CisgICAgICBpZiAoRVEgKGluZCwgUWxlZnQp IHx8IEVRIChpbmQsIFFyaWdodCkpCisgICAgICAgIGJvdW5kYXJ5X3RvcCA9IGJvdW5kYXJ5X2Jv dCA9IGFycm93X3RvcCA9IGFycm93X2JvdCA9IGluZDsKKyAgICAgICAgZWxzZSBpZiAoQ09OU1Ag KGluZCkKKyAgICAgICAgICAgICAgICAgJiYgQ09OU1AgKFhDQVIgKGluZCkpKQorICAgICAgICB7 CisgICAgICAgICAgTGlzcF9PYmplY3QgcG9zOworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3Nx IChRdCwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBib3VuZGFyeV90b3AgPSBib3Vu ZGFyeV9ib3QgPSBhcnJvd190b3AgPSBhcnJvd19ib3QgPSBYQ0RSIChwb3MpOworICAgICAgICAg IGlmIChwb3MgPSBtY19hc3NxIChRdG9wLCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAg IGJvdW5kYXJ5X3RvcCA9IFhDRFIgKHBvcyk7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fzc3Eg KFFib3R0b20sIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAgYm91bmRhcnlfYm90ID0g WENEUiAocG9zKTsKKyAgICAgICAgICBpZiAocG9zID0gbWNfYXNzcSAoUXVwLCBpbmQpLCAhTklM UCAocG9zKSkKKyAgICAgICAgICAgIGFycm93X3RvcCA9IFhDRFIgKHBvcyk7CisgICAgICAgICAg aWYgKHBvcyA9IG1jX2Fzc3EgKFFkb3duLCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAg IGFycm93X2JvdCA9IFhDRFIgKHBvcyk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAg ICAgIC8qIEFueXRoaW5nIGVsc2UgbWVhbnMgYm91bmRhcnkgb24gbGVmdCBhbmQgbm8gYXJyb3dz LiAgKi8KKyAgICAgICAgICBib3VuZGFyeV90b3AgPSBib3VuZGFyeV9ib3QgPSBRbGVmdDsKKyAg ICB9CisgIHRvcF9pbmRfcm4gPSBib3RfaW5kX3JuID0gLTE7CisgIGlmICghTklMUCAoaW5kKSkK KyAgICB7CisgICAgICBmb3IgKHkgPSB3LT52c2Nyb2xsLCBybiA9IDA7CisgICAgICAgICAgIHkg PCB5YiAmJiBybiA8IG5yb3dzOworICAgICAgICAgICB5ICs9IHJvdy0+aGVpZ2h0LCArK3JuKQor ICAgICAgICB7CisgICAgICAgICAgcm93ID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBybjsK KyAgICAgICAgICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgcm93ID0gdy0+Y3Vy cmVudF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICByb3ctPmluZGljYXRlX2JvYl9wID0g cm93LT5pbmRpY2F0ZV90b3BfbGluZV9wID0gMDsKKyAgICAgICAgICByb3ctPmluZGljYXRlX2Vv Yl9wID0gcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wID0gMDsKKyAgICAgICAgICBpZiAoIXJv dy0+bW9kZV9saW5lX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmICh0b3BfaW5k X3JuIDwgMCAmJiByb3ctPnZpc2libGVfaGVpZ2h0ID4gMCkKKyAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICBpZiAoTUFUUklYX1JPV19TVEFSVF9DSEFSUE9TIChyb3cpIDw9IEJV Rl9CRUdWIChYQlVGRkVSICh3LT5jb250ZW50cykpCisgICAgICAgICAgICAgICAgICAgICAgJiYg IU1BVFJJWF9ST1dfUEFSVElBTExZX1ZJU0lCTEVfQVRfVE9QX1AgKHcsIHJvdykpCisgICAgICAg ICAgICAgICAgICAgIHJvdy0+aW5kaWNhdGVfYm9iX3AgPSAhTklMUCAoYm91bmRhcnlfdG9wKTsK KyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgIHJvdy0+aW5k aWNhdGVfdG9wX2xpbmVfcCA9ICFOSUxQIChhcnJvd190b3ApOworICAgICAgICAgICAgICAgICAg dG9wX2luZF9ybiA9IHJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgaWYgKGJv dF9pbmRfcm4gPCAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChN QVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpID49IEJVRl9aViAoWEJVRkZFUiAody0+Y29udGVu dHMpKQorICAgICAgICAgICAgICAgICAgICAgICYmICFNQVRSSVhfUk9XX1BBUlRJQUxMWV9WSVNJ QkxFX0FUX0JPVFRPTV9QICh3LCByb3cpKQorICAgICAgICAgICAgICAgICAgICByb3ctPmluZGlj YXRlX2VvYl9wID0gIU5JTFAgKGJvdW5kYXJ5X2JvdCksIGJvdF9pbmRfcm4gPSBybjsKKyAgICAg ICAgICAgICAgICAgICAgZWxzZSBpZiAoeSArIHJvdy0+aGVpZ2h0ID49IHliKQorICAgICAgICAg ICAgICAgICAgICAgIHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCA9ICFOSUxQIChhcnJvd19i b3QpLCBib3RfaW5kX3JuID0gcm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQor ICAgICAgICB9CisgICAgfQorICBlbXB0eV9wb3MgPSBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGluZGljYXRlX2VtcHR5X2xpbmVzKTsKKyAgaWYgK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BpbiBvbmUgcm93LiAg Ki8KKyAgdG9wX2luZF9taW5feSA9IGJvdF9pbmRfbWF4X3kgPSAtMTsKKyAgaWYgKHRvcF9pbmRf cm4gPj0gMCkKKyAgICB7CisgICAgICBpbnQgYm4gPSBNQ19OT19GUklOR0VfQklUTUFQOworICAg ICAgcm93ID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyB0b3BfaW5kX3JuOworICAgICAgaWYg KCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgcm93ID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3Mg KyB0b3BfaW5kX3JuOworICAgICAgdG9wX3Jvd19lbmRzX2F0X3p2X3AgPSByb3ctPmVuZHNfYXRf enZfcDsKKyAgICAgIGlmIChyb3ctPmluZGljYXRlX2JvYl9wKQorICAgICAgICB7CisgICAgICAg ICAgaWYgKEVRIChib3VuZGFyeV90b3AsIFFsZWZ0KSkKKyAgICAgICAgICAgIGJuID0gKChyb3ct PmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFsZWZ0KSkKKyAgICAgICAgICAg ICAgICAgID8gTUNfTEVGVF9GUklOR0UgKDEsIFF0b3BfYm90dG9tLCByb3ctPmVuZHNfYXRfenZf cCkKKyAgICAgICAgICAgICAgICAgIDogTUNfTEVGVF9GUklOR0UgKDIsIFF0b3AsIDApKTsKKyAg ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgYm4gPSAoKHJvdy0+aW5kaWNhdGVfZW9iX3Ag JiYgRVEgKGJvdW5kYXJ5X2JvdCwgUXJpZ2h0KSkKKyAgICAgICAgICAgICAgICAgICAgPyBNQ19S SUdIVF9GUklOR0UgKDEsIFF0b3BfYm90dG9tLCByb3ctPmVuZHNfYXRfenZfcCkKKyAgICAgICAg ICAgICAgICAgICAgOiBNQ19SSUdIVF9GUklOR0UgKDIsIFF0b3AsIDApKTsKKyAgICAgICAgfQor ICAgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX3RvcF9saW5lX3ApCisgICAgICAgICAgewor ICAgICAgICAgICAgaWYgKEVRIChhcnJvd190b3AsIFFsZWZ0KSkKKyAgICAgICAgICAgICAgYm4g PSBNQ19MRUZUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgIGJuID0gTUNfUklHSFRfRlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAgIH0K KyAgICAgIGlmIChibiAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICB7CisgICAgICAg ICAgc3RydWN0IGZyaW5nZV9iaXRtYXAgKmZiID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAoYm4p OworICAgICAgICAgIGlmIChmYi0+YWxpZ24gPT0gQUxJR05fQklUTUFQX1RPUCAmJiBmYi0+cGVy aW9kID09IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cg KnJvdzE7CisgICAgICAgICAgICAgIGludCB0b3BfaW5kX21heF95OworICAgICAgICAgICAgICB0 b3BfaW5kX21pbl95ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICAgICAg ICAgIHRvcF9pbmRfbWF4X3kgPSB0b3BfaW5kX21pbl95ICsgZmItPmhlaWdodDsKKyAgICAgICAg ICAgICAgaWYgKHRvcF9pbmRfbWF4X3kgPiB5YikKKyAgICAgICAgICAgICAgICB0b3BfaW5kX21h eF95ID0geWI7CisgICAgICAgICAgICAgIGZvciAoeSA9IHJvdy0+eSArIHJvdy0+aGVpZ2h0LCBy biA9IHRvcF9pbmRfcm4gKyAxOworICAgICAgICAgICAgICAgICAgIHkgPCB0b3BfaW5kX21heF95 ICYmIHJuIDwgbnJvd3M7CisgICAgICAgICAgICAgICAgICAgeSArPSByb3cxLT5oZWlnaHQsIHJu KyspCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKGJvdF9pbmRfcm4g Pj0gMCAmJiBybiA+PSBib3RfaW5kX3JuKQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAg ICAgICAgICAgICAgICAgIHJvdzEgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJuOworICAg ICAgICAgICAgICAgICAgaWYgKCFyb3cxLT5lbmFibGVkX3ApCisgICAgICAgICAgICAgICAgICAg IHJvdzEgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgICAgICAgICAg cm93MS0+aW5kaWNhdGVfYm9iX3AgPSByb3ctPmluZGljYXRlX2JvYl9wOworICAgICAgICAgICAg ICAgICAgcm93MS0+aW5kaWNhdGVfdG9wX2xpbmVfcCA9IHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVf cDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cisg IGlmIChib3RfaW5kX3JuID49IDApCisgICAgeworICAgICAgaW50IGJuID0gTUNfTk9fRlJJTkdF X0JJVE1BUDsKKyAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgYm90X2luZF9y bjsKKyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgIHJvdyA9IHctPmN1cnJlbnRf bWF0cml4LT5yb3dzICsgYm90X2luZF9ybjsKKyAgICAgIGJvdF9yb3dfZW5kc19hdF96dl9wID0g cm93LT5lbmRzX2F0X3p2X3A7CisgICAgICBpZiAocm93LT5pbmRpY2F0ZV9lb2JfcCkKKyAgICAg ICAgeworICAgICAgICAgIGlmIChFUSAoYm91bmRhcnlfYm90LCBRbGVmdCkpCisgICAgICAgICAg ICBibiA9IE1DX0xFRlRfRlJJTkdFICgzLCBRYm90dG9tLCByb3ctPmVuZHNfYXRfenZfcCk7Cisg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGJuID0gTUNfUklHSFRfRlJJTkdFICgzLCBR Ym90dG9tLCByb3ctPmVuZHNfYXRfenZfcCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAo cm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGlm IChFUSAoYXJyb3dfYm90LCBRbGVmdCkpCisgICAgICAgICAgICAgIGJuID0gTUNfTEVGVF9GUklO R0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGJu ID0gTUNfUklHSFRfRlJJTkdFICg3LCBRZG93biwgMCk7CisgICAgICAgICAgfQorICAgICAgaWYg KGJuICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3Qg ZnJpbmdlX2JpdG1hcCAqZmIgPSBnZXRfZnJpbmdlX2JpdG1hcF9kYXRhIChibik7CisgICAgICAg ICAgaWYgKGZiLT5hbGlnbiA9PSBBTElHTl9CSVRNQVBfQk9UVE9NICYmIGZiLT5wZXJpb2QgPT0g MCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93MTsK KyAgICAgICAgICAgICAgaW50IGJvdF9pbmRfbWluX3k7CisgICAgICAgICAgICAgIGJvdF9pbmRf bWF4X3kgPSByb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0OworICAgICAgICAgICAgICBib3Rf aW5kX21pbl95ID0gYm90X2luZF9tYXhfeSAtIGZiLT5oZWlnaHQ7CisgICAgICAgICAgICAgIGlm IChib3RfaW5kX21pbl95IDwgV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodykpCisgICAgICAg ICAgICAgICAgYm90X2luZF9taW5feSA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOwor ICAgICAgICAgICAgICBmb3IgKHkgPSByb3ctPnksIHJuID0gYm90X2luZF9ybiAtIDE7CisgICAg ICAgICAgICAgICAgICAgeSA+PSBib3RfaW5kX21pbl95ICYmIHJuID49IDA7CisgICAgICAgICAg ICAgICAgICAgeSAtPSByb3cxLT5oZWlnaHQsIHJuLS0pCisgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgaWYgKHRvcF9pbmRfcm4gPj0gMCAmJiBybiA8PSB0b3BfaW5kX3JuKQor ICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgIHJvdzEgPSB3LT5k ZXNpcmVkX21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgICAgICAgICAgaWYgKCFyb3cxLT5l bmFibGVkX3ApCisgICAgICAgICAgICAgICAgICAgIHJvdzEgPSB3LT5jdXJyZW50X21hdHJpeC0+ cm93cyArIHJuOworICAgICAgICAgICAgICAgICAgcm93MS0+aW5kaWNhdGVfZW9iX3AgPSByb3ct PmluZGljYXRlX2VvYl9wOworICAgICAgICAgICAgICAgICAgcm93MS0+aW5kaWNhdGVfYm90dG9t X2xpbmVfcCA9IHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcDsKKyAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGJvb2wgYXV0b19oc2Nyb2xsX21v ZGVfcCA9IEVRIChGYnVmZmVyX2xvY2FsX3ZhbHVlIChRYXV0b19oc2Nyb2xsX21vZGUsIHctPmNv bnRlbnRzKSwgUWN1cnJlbnRfbGluZSk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSkg Ki8KKyAgYm9vbCBoc2NsX2FsbF90ZW1wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBh bmQgZG8gbm90aGluZy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBfcCA9ICh3LT5zdXNwZW5k X2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9s bF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOwor ICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgZWxzZSBiZXNpZGVzIGhv cml6b250YWxseSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IGxpbmUgZGlm ZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRh bGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMV9wID0g KCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5o c2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xs ID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHct PmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAuLi4KKyAgICAgICAgICAg ICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50 bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Ny b2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPT0gMAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICAvKiBFWEFN UExFOiAgKHNjcm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxlZnQgYXJyb3cga2V5 IG9uZSB0aW1lLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5 IHNjcm9sbGVkIGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1wX3AgPSAoIXctPnN1c3Bl bmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21v ZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUg Qy14IDwgYW5kIGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVudCBsaW5lIHRvIGJl CisgICAgICAgICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuCisgICAg ICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVy ZW50bHkuICovCisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xs CisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3Jv bGwgIT0gdy0+aHNjcm9sbCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUp OworICBmb3IgKHkgPSB3LT52c2Nyb2xsLCBybiA9IDA7CisgICAgICAgeSA8IHliICYmIHJuIDwg bnJvd3M7CisgICAgICAgeSArPSByb3ctPmhlaWdodCwgcm4rKykKKyAgICB7CisgIGludCBsZWZ0 LCByaWdodDsKKyAgdW5zaWduZWQgbGVmdF9mYWNlX2lkLCByaWdodF9mYWNlX2lkOworICBpbnQg bGVmdF9vZmZzZXQsIHJpZ2h0X29mZnNldDsKKyAgYm9vbCBwZXJpb2RpY19wOworICByb3cgPSB3 LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJuOworICBjdXIgPSB3LT5jdXJyZW50X21hdHJpeC0+ cm93cyArIHJuOworICBpbnQgdm50aF9kbSA9IE1BVFJJWF9ST1dfVlBPUyAody0+ZGVzaXJlZF9t YXRyaXgtPnJvd3MgKyBybiwgdy0+ZGVzaXJlZF9tYXRyaXgpOworICBpbnQgdm50aF9jbSA9IE1B VFJJWF9ST1dfVlBPUyAody0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBybiwgdy0+Y3VycmVudF9t YXRyaXgpOworICBlbnVtIG1jX3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24gPSBtY19yb3dfcG9z aXRpb24gKHcsIGN1ciwgY3VyLCB2bnRoX2NtKTsKKyAgaW50IG1jX2xlZnRfZnJpbmdlX2JpdG1h cCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgIGludCBtY19sZWZ0X2Zya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ICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywg ZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUp CisgICAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRf ZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LXByZS16di1mYWNlIiksIHRydWUp CisgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBtY19sZWZ0X2ZyaW5n ZV9mYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAg ICAgICAgICBpZiAody0+aHNjcm9sbCAhPSAwKQorICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9 IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ciKSwgZmFs c2UsIHRydWUpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBmcmluZ2VfYml0bWFw ID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJvdyIpLCB0 cnVlLCB0cnVlKTsKKyAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5 cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKCh2 cG9zID09IHZudGhfZG0gfHwgdnBvcyA9PSB2bnRoX2NtKQorICAgICAgICAgICAgICAgICAmJiBn bHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICAgICAgICAgICAg JiYgKGhzY2xfYWxsX3RlbXBfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVy bV8wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMV9wCisgICAgICAg ICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAgICAgICAgICAgICAgICAgICAg fHwgaHNjbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfcGVybV9wKQorICAg ICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgeworICAgICAgICAgICAgaW50 IGZyaW5nZV9iaXRtYXAgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgICAgZW51bSBm YWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgICAgICghYWN0aXZlX3AK KyAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNo X2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAo dywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5hY3RpdmUtcHJlLXp2LWZhY2Ui KSwgdHJ1ZSkKKyAgICAgICAgICAgICAgOiAoYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgPyBs b29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtcHJl LXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAg ICAgICAgICBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRf RlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBv dmVybGF5X2Fycm93X2ZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgICBpZiAoaHNjbF9hbGxfcGVybV8wX3Ap CisgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywg aW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAgICAgZWxz ZSBpZiAoaHNjbF9hbGxfcGVybV8xX3ApCisgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9 IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCB0cnVlLCBm YWxzZSk7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8yX3ApCisgICAg ICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGlu dGVybiAoIistaHNjbC1wZXJtIiksIGZhbHNlLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIGVs c2UgaWYgKGhzY2xfcGVybV9wKQorICAgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0g bWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIHRydWUsIHRy dWUpOworICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF90ZW1wX3ApCisgICAg ICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3 LCBpbnRlcm4gKCIrLWhzY2wtdGVtcCIpLCBmYWxzZSwgZmFsc2UpOworICAgICAgICAgICAgICAg ICAgICAgIGVsc2UgaWYgKGhzY2xfdGVtcF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgZnJp bmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtdGVt cCIpLCB0cnVlLCBmYWxzZSk7CisgICAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAo Y3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICB9CisgICAg ICAgICAgZWxzZSBpZiAoKHZwb3MgPT0gdm50aF9kbSB8fCB2cG9zID09IHZudGhfY20pCisgICAg ICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9S SUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1D X1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAg ICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAg ICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FS Uk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJT RURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBn bHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICB8 fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAg ICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkK KyAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBMaXNwX09iamVjdCBiaXRtYXBfZmxhdm9yID0gKGdseXBoX2ZsYXZvciA9PSBNQ19I T0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBRbWNfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1D X1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX2hvbGxvd19yZWN0YW5n bGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0g TUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3cKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9yaWdodF9h cnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhf Zmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFt Y19yZXZlcnNlZF92ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNh bF9iYXJfYmFja3NsYXNoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IFFuaWw7CisgICAgICAgICAgICAgIG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29y X3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IGxvb2t1cF9mcmluZ2VfYml0bWFwIChiaXRtYXBfZmxhdm9yKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJ VE1BUDsKKyAgICAgICAgICAgICAgbWNfcmlnaHRfZnJpbmdlX2ZhY2VfaWQgPQorICAgICAgICAg ICAgICAgIChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAg ICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYKKyAgICAgICAgICAgICAgICAgJiYgKGds eXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisg ICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3Ig PT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKSkKKyAgICAgICAgICAgICAgICAgID8gbG9va3Vw X25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmV2ZXJzZWQtYmFyLXByZS16di1mYWNlIiks IHRydWUpCisgICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdF X0JJVE1BUAorICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBBVF9aVgorICAg ICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JF Q1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2 b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAg ICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQor ICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1y ZXZlcnNlZC1iYXItYXQtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgIDogKGN1cnNv cl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAmJiBy b3dfcG9zaXRpb24gPT0gUE9TVF9aVgorICAgICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2 b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAg ICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBN Q19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFt ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1iYXItcG9zdC16di1mYWNlIiksIHRy dWUpCisgICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJ VE1BUAorICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYKKyAgICAg ICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RB TkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBN Q19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAm JiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAg ICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1iYXItcHJlLXp2LWZh Y2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9G UklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IEFUX1pW CisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX0hPTExP V19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2 b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAg ICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAg ICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistYmFyLWF0 LXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19S SUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09 IFBPU1RfWlYKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJT RURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGds eXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAg ICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS KQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmF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ZGljYXRlX2JvYl9wICYmIEVRIChib3VuZGFyeV90b3AsIFFsZWZ0KSkKKyAgICAgICAgewor ICAgICAgICAgIGxlZnQgPSAoKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2Jv dCwgUWxlZnQpKQorICAgICAgICAgICAgICAgICA/IE1DX0xFRlRfRlJJTkdFICgxLCBRdG9wX2Jv dHRvbSwgdG9wX3Jvd19lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgICAgIDogTUNfTEVGVF9G UklOR0UgKDIsIFF0b3AsIDApKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5feSA+PSAwKQor ICAgICAgICAgICAgbGVmdF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55OworICAgICAg ICB9CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9i b3QsIFFsZWZ0KSkKKyAgICAgICAgeworICAgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAo MywgUWJvdHRvbSwgYm90X3Jvd19lbmRzX2F0X3p2X3ApOworICAgICAgICAgIGlmIChib3RfaW5k X21heF95ID49IDApCisgICAgICAgICAgICBsZWZ0X29mZnNldCA9IGJvdF9pbmRfbWF4X3kgLSAo cm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYg KCghcm93LT5yZXZlcnNlZF9wICYmIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAocm93 KSkKKyAgICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jb250aW51ZWRf cCkpCisgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNCwgUWNvbnRpbnVhdGlvbiwgMCk7 CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VtcHR5X2xpbmVfcCAmJiBFUSAoZW1wdHlf cG9zLCBRbGVmdCkpCisgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNSwgUWVtcHR5X2xp bmUsIDApOworICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGluZV9wICYmIEVRIChh cnJvd190b3AsIFFsZWZ0KSkKKyAgICAgICAgeworICAgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZS SU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5feSA+PSAwKQorICAg ICAgICAgICAgbGVmdF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55OworICAgICAgICB9 CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgJiYgRVEgKGFycm93 X2JvdCwgUWxlZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdF ICg3LCBRZG93biwgMCk7CisgICAgICAgICAgaWYgKGJvdF9pbmRfbWF4X3kgPj0gMCkKKyAgICAg ICAgICAgIGxlZnRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZpc2li bGVfaGVpZ2h0KTsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAgICBsZWZ0ID0gTUNfTk9f RlJJTkdFX0JJVE1BUDsKKyAgICAgIC8qIERlY2lkZSB3aGljaCBiaXRtYXAgdG8gZHJhdyBpbiB0 aGUgcmlnaHQgZnJpbmdlLiAgKi8KKyAgICAgIGlmIChXSU5ET1dfUklHSFRfRlJJTkdFX1dJRFRI ICh3KSA9PSAwKQorICAgICAgICByaWdodCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICBl bHNlIGlmIChyb3ctPnJpZ2h0X3VzZXJfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklU TUFQKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQgPSByb3ctPn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KyAgICAgICAgICAgIHJpZ2h0X29mZnNldCA9IGJvdF9pbmRfbWF4X3kgLSAo cm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYg KCghcm93LT5yZXZlcnNlZF9wICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICB8 fCAocm93LT5yZXZlcnNlZF9wICYmIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAocm93 KSkpCisgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICg0LCBRY29udGludWF0aW9uLCAw KTsKKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCAmJiBFUSAoYXJyb3df dG9wLCBRcmlnaHQpKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklO R0UgKDYsIFF1cCwgMCk7CisgICAgICAgICAgaWYgKHRvcF9pbmRfbWluX3kgPj0gMCkKKyAgICAg ICAgICAgIHJpZ2h0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSByb3ctPnk7CisgICAgICAgIH0K KyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCAmJiBFUSAoYXJyb3df Ym90LCBRcmlnaHQpKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklO R0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAg ICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZp c2libGVfaGVpZ2h0KTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9l bXB0eV9saW5lX3AgJiYgRVEgKGVtcHR5X3BvcywgUXJpZ2h0KSkKKyAgICAgICAgcmlnaHQg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ZnJpbmdlX2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAg aWYgKCFrZWVwX2N1cnJlbnRfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY3VyLT5y ZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0X2Zy aW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgfHwg bWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAg ICAgICAgIGN1ci0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5mcmluZ2VfYml0bWFwX3BlcmlvZGlj X3AgPSBwZXJpb2RpY19wOworICAgICAgICAgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFw ICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5n ZV9iaXRtYXAgPSBtY19sZWZ0X2ZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSBsZWZ0OworICAgICAg ICAgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVAp CisgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gbWNfbGVmdF9mcmlu Z2VfZmFjZV9pZDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXIt PmxlZnRfZnJpbmdlX2ZhY2VfaWQgPSBsZWZ0X2ZhY2VfaWQ7CisgICAgICAgICAgICAgIGlmICht Y19sZWZ0X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mxheV9hcnJvd19iaXRt YXAgPCAwKQorICAgICAgICByb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwID0gbWNfZ2V0X2xvZ2lj YWxfZnJpbmdlX2JpdG1hcCAodywgUW92ZXJsYXlfYXJyb3csIDAsIDApOworICAgICAgaWYgKHJv dy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgIT0gY3VyLT5vdmVybGF5X2Fycm93X2JpdG1hcCkKKyAg ICAgICAgeworICAgICAgICAgIHJlZHJhd19wID0gMSwgcm93LT5yZWRyYXdfZnJpbmdlX2JpdG1h cHNfcCA9IDE7CisgICAgICAgICAgaWYgKCFrZWVwX2N1cnJlbnRfcCkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgY3VyLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7CisgICAgICAg ICAgICAgIGN1ci0+b3ZlcmxheV9hcnJvd19iaXRtYXAgPSByb3ctPm92ZXJsYXlfYXJyb3dfYml0 bWFwOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAobWNfbGVmdF9mcmluZ2Vf Yml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICB8fCBtY19yaWdodF9mcmlu Z2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHJvdy0+ZnJpbmdlX2Jp dG1hcF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgIGVsc2UKKyAgICAgICAgICByb3ctPmZy aW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IHBlcmlvZGljX3A7CisgICAgICBpZiAobWNfbGVmdF9m cmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHJvdy0+bGVmdF9m cmluZ2VfYml0bWFwID0gbWNfbGVmdF9mcmluZ2VfYml0bWFwOworICAgICAgICBlbHNlCisgICAg ICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9iaXRtY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8gZ2V0LiAgKi8KKyAgICAg ICAgICAgICYmICFGUkFNRV9SSUdIVF9ESVZJREVSX1dJRFRIIChmKQorICAgICAgICAgICAgJiYg IVdJTkRPV19IQVNfVkVSVElDQUxfU0NST0xMX0JBUiAodykKKyAgICAgICAgICAgIC8qIEJ1dCBk b24ndCByZWR1Y2UgdGhlIGZyaW5nZSB3aWR0aCBpZiB0aGUgd2luZG93CisgICAgICAgICAgICAg ICBoYXMgYSBsZWZ0IG1hcmdpbiwgYmVjYXVzZSB0aGF0IG1lYW5zIHdlIGFyZSBub3QKKyAgICAg ICAgICAgICAgIGluIGRhbmdlciBvZiBkcmF3aW5nIG92ZXIgdGhlIHZlcnRpY2FsIGJvcmRlciwK KyAgICAgICAgICAgICAgIGFuZCBPVE9IIGxlYXZpbmcgb3V0IHRoYXQgb25lIHBpeGVsIGxlYXZl cyBiZWhpbmQKKyAgICAgICAgICAgICAgIHRyYWNlcyBvZiB0aGUgY3Vyc29yLCBpZiBpdCB3YXMg aW4gY29sdW1uIHplcm8KKyAgICAgICAgICAgICAgIGJlZm9yZSBkcmF3aW5nIG5vbi1lbXB0eSBt YXJnaW4gYXJlYS4gICovCisgICAgICAgICAgICAmJiB3LT5sZWZ0X21hcmdpbl9jb2xzID09IDAp CisgICAgICAgICAgID8gMSA6IDApOworICAgICAgICAgIHAuYnggPSB4IC0gd2Q7CisgICAgICAg ICAgcC5ueCA9IHdkOworICAgICAgICB9CisgICAgfQorICBlbHNlCisgICAgeworICAgICAgaW50 IHggPSB3aW5kb3dfYm94X3JpZ2h0ICh3LAorICAgICAgICAoV0lORE9XX0hBU19GUklOR0VTX09V VFNJREVfTUFSR0lOUyAodykKKyAgICAgICAgID8gUklHSFRfTUFSR0lOX0FSRUEKKyAgICAgICAg IDogVEVYVF9BUkVBKSk7CisgICAgICBpbnQgd2QgPSBXSU5ET1dfUklHSFRfRlJJTkdFX1dJRFRI ICh3KTsKKyAgICAgIGlmIChwLndkID4gd2QpCisgICAgICAgIHAud2QgPSB3ZDsKKyAgICAgIHAu eCA9IHggKyAod2QgLSBwLndkKSAvIDI7CisgICAgICAvKiBDbGVhciByaWdodCBmcmluZ2UgaWYg bm8gYml0bWFwIHRvIGRyYXcgb2YgaWYgYml0bWFwIGRvZXNuJ3QgZmlsbAorICAgdGhlIGZyaW5n ZS4gICovCisgICAgICBpZiAocC53ZCA8IHdkIHx8IHAueSA+IHAuYnkgfHwgcC55ICsgcC5oIDwg cC5ieSArIHAubnkpCisgICAgICAgIHsKKyAgICAgICAgICBwLmJ4ID0geDsKKyAgICAgICAgICBw Lm54ID0gd2Q7CisgICAgICAgIH0KKyAgICB9CisgIGlmIChwLnggPj0gV0lORE9XX0JPWF9MRUZU X0VER0VfWCAodykKKyAgICAgICYmIChwLnggKyBwLndkKSA8PSBXSU5ET1dfQk9YX0xFRlRfRURH RV9YICh3KSArIFdJTkRPV19QSVhFTF9XSURUSCAodykpCisgICAgRlJBTUVfUklGIChmKS0+ZHJh d19mcmluZ2VfYml0bWFwICh3LCByb3csICZwKTsKK30KKwordm9pZAorbWNfZHJhd19mcmluZ2Vf Yml0bWFwIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCBsZWZ0 X3AsIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUpCit7CisgIGludCBvdmVybGF5ID0g MDsKKyAgaWYgKGxlZnRfcCA9PSByb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jdXJzb3JfaW5fZnJp bmdlX3ApCisgICAgeworICAgICAgTGlzcF9PYmplY3QgY3Vyc29yID0gUW5pbDsKKyAgICAgIHN3 aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgY2FzZSBNQ19GUkFNRURfQk9Y OgorICAgICAgICAgIGlmIChyb3ctPnZpc2libGVfaGVpZ2h0ID49IFNUQU5EQVJEX0JJVE1BUF9I RUlHSFQgKGhvbGxvd19yZWN0YW5nbGVfYml0cykpCisgICAgICAgICAgICBjdXJzb3IgPSBRaG9s bG93OworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGN1cnNvciA9IFFob2xsb3dfc21hbGw7 CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICAgICAg ICBpZiAocm93LT52aXNpYmxlX2hlaWdodCA+PSBTVEFOREFSRF9CSVRNQVBfSEVJR0hUIChob2xs b3dfcmVjdGFuZ2xlX2JpdHMpKQorICAgICAgICAgICAgY3Vyc29yID0gUWhvbGxvdzsKKyAgICAg ICAgICBlbHNlCisgICAgICAgICAgICBjdXJzb3IgPSBRaG9sbG93X3NtYWxsOworICAgICAgICAg IGJyZWFrOworICAgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgICAgY3Vyc29yID0g UWJveDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgICAg Y3Vyc29yID0gUWJhcjsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19IQkFSOgor ICAgICAgICAgIGN1cnNvciA9IFFoYmFyOworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNl IE1DX05PX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgorICAgICAg ICBjYXNlIE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGNhc2UgTUNfTEVGVF9GUklO R0VfQklUTUFQOgorICAgICAgICBkZWZhdWx0OgorICAgICAgICAgIHctPnBoeXNfY3Vyc29yX29u X3AgPSAwOworICAgICAgICAgIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gMDsKKyAgICAgICAg ICBicmVhazsKKyAgICAgICAgfQorICAgICAgaWYgKCFOSUxQIChjdXJzb3IpKQorICAgICAgICB7 CisgICAgICAgICAgaW50IGJtID0gbWNfZ2V0X2xvZ2ljYWxfY3Vyc29yX2JpdG1hcCAodywgY3Vy c29yKTsKKyAgICAgICAgICBpZiAoYm0gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwXzEgKHcsIHJvdywgbGVm dF9wLCAyLCBibSk7CisgICAgICAgICAgICAgIG92ZXJsYXkgPSBFUSAoY3Vyc29yLCBRYm94KSA/ IDMgOiAxOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBtY19kcmF3X2ZyaW5n ZV9iaXRtYXBfMSAodywgcm93LCBsZWZ0X3AsIG92ZXJsYXksIE1DX05PX0ZSSU5HRV9CSVRNQVAp OworICBpZiAobGVmdF9wICYmIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgIT0gTUNfTk9fRlJJ TkdFX0JJVE1BUCkKKyAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXBfMSAodywgcm93LCAxLCAxLCBy b3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwKTsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMg Ki8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICNkZWZpbmUgTk9fRlJJTkdFX0JJVE1B UCAwCiAjZGVmaW5lIFVOREVGX0ZSSU5HRV9CSVRNQVAgMQogI2RlZmluZSBNQVhfU1RBTkRBUkRf RlJJTkdFX0JJVE1BUFMgQVJSQVlFTFRTIChzdGFuZGFyZF9iaXRtYXBzKQpAQCAtMTY5OSw2ICsz MjE3LDE2OCBAQCBSZXR1cm4gbmlsIGlmIFBPUyBpcyBub3QgdmlzaWJsZSBpbiBXSU5ET1cuICAq LykKIHZvaWQKIHN5bXNfb2ZfZnJpbmdlICh2b2lkKQogeworCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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XQgKFFtY19xdWFkcnVwbGVf YW5nbGVfZG93biwgUWZyaW5nZSwgbWFrZV9maXhudW0gKDQ4KSk7CisgIC8qIChnZXQgJystcXVh ZHJ1cGxlLWFuZ2xlLWRvd24gJ2ZyaW5nZSkgPT4gNDggKi8KKworLyogZW5kIE1VTFRJUExFLUNV UlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgREVGU1lNIChRdHJ1bmNh dGlvbiwgInRydW5jYXRpb24iKTsKICAgREVGU1lNIChRY29udGludWF0aW9uLCAiY29udGludWF0 aW9uIik7CiAgIERFRlNZTSAoUW92ZXJsYXlfYXJyb3csICJvdmVybGF5LWFycm93Iik7CmRpZmYg LS1naXQgYS9zcmMvbnN0ZXJtLmggYi9zcmMvbnN0ZXJtLmgKaW5kZXggOTc3M2ViMy4uZTM0YTEx NiAxMDA2NDQKLS0tIGEvc3JjL25zdGVybS5oCisrKyBiL3NyYy9uc3Rlcm0uaApAQCAtNjYzLDYg KzY2MywxNiBAQCB0eXBlZGVmIGlkIGluc3RhbmNldHlwZTsKIAogQGludGVyZmFjZSBFbWFjc1Nj cm9sbGVyIDogTlNTY3JvbGxlcgogICB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBOU1JlY3QgbWNfcmVjdGFuZ2xlOworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgICBzdHJ1Y3Qgd2luZG93ICp3aW5kb3c7CiAgICBz dHJ1Y3QgZnJhbWUgKmZyYW1lOwogICAgTlNSZXNwb25kZXIgKnByZXZSZXNwb25kZXI7CkBAIC02 ODMsNiArNjkzLDE4IEBAIHR5cGVkZWYgaWQgaW5zdGFuY2V0eXBlOwogICAgaW50IGVtX3dob2xl OwogICAgfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCistICh2b2lkKW1jX3NldF9yZWN0YW5nbGU6IChOU1JlY3QpcmVjdDsKKy0gKE5TUmVj dCltY19nZXRfcmVjdGFuZ2xlOworLSAoc3RydWN0IHdpbmRvdyAqKW1jX2dldF93aW5kb3c7Cist IChib29sKW1jX2p1ZGdlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAtIChpbnN0 YW5jZXR5cGUpIGluaXRGcmFtZTogKE5TUmVjdCApciB3aW5kb3c6IChMaXNwX09iamVjdCl3aW47 CiAtICh2b2lkKXNldEZyYW1lOiAoTlNSZWN0KXI7CiAKZGlmZiAtLWdpdCBhL3NyYy9uc3Rlcm0u bSBiL3NyYy9uc3Rlcm0ubQppbmRleCAwMjMzMTgyLi5iNzA4ZTk0IDEwMDY0NAotLS0gYS9zcmMv bnN0ZXJtLm0KKysrIGIvc3JjL25zdGVybS5tCkBAIC03Niw2ICs3Niw5NzUgQEAgVXBkYXRlZCBi eSBDaHJpc3RpYW4gTGltcGFjaCAoY2hyaXNAbmljZS5jaCkKIHN0YXRpYyBFbWFjc01lbnUgKm1h aW5NZW51OwogI2VuZGlmCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBN VUxUSVBMRS1DVVJTT1JTICovCisKK3N0YXRpYyBCT09MIG5zX2NsaXBfdG9fcmVjdCAoc3RydWN0 IGZyYW1lICosIE5TUmVjdCA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oTlVMTCk7CisgIGJsb2NrX2lucHV0ICgpOworICBpZiAobnNfbGlzcF90 b19jb2xvciAoY29sb3IsICZjb2wpKQorICAgIHsKKyAgICAgIHVuYmxvY2tfaW5wdXQgKCk7Cisg ICAgICBsc2wtPnJlZCA9IC0xLjA7CisgICAgICBsc2wtPmdyZWVuID0gLTEuMDsKKyAgICAgIGxz bC0+Ymx1ZSA9IC0xLjA7CisgICAgfQorICBbW2NvbCBjb2xvclVzaW5nRGVmYXVsdENvbG9yU3Bh Y2VdCisgICAgICAgIGdldFJlZDogJnJlZCBncmVlbjogJmdyZWVuIGJsdWU6ICZibHVlIGFscGhh OiAmYWxwaGFdOworICB1bmJsb2NrX2lucHV0ICgpOworICBsc2wtPnJlZCA9IHJlZDsKKyAgbHNs LT5ncmVlbiA9IGdyZWVuOworICBsc2wtPmJsdWUgPSBibHVlOworfQorCitzdGF0aWMgdm9pZAor bWNfbnNfZHJhd19vdmVyd3JpdHRlbiAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGds eXBoX21hdHJpeCAqbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBo X3JvdyAqcm93LCBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCkKK3sKKyAgLy8gIGludCB2cG9z ID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgIC8vICBjbG9ja190IGNsb2NrX3N0 YXJ0ID0gY2xvY2soKTsKKyAgLy8gbnNfZHJhd191bmRlcndhdmUgKHMsIHMtPndpZHRoLCBzLT54 KTsKKyAgTlNDb2xvciAqaG9sbG93X2NvbG9yID0gRlJBTUVfQkFDS0dST1VORF9DT0xPUiAocy0+ Zik7CisgIHN0cnVjdCBmYWNlICpmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBERUZBVUxUX0ZB Q0VfSUQpOworICBpbnQgdm50aCA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAv KiBTVFJFVENIX0dMWVBIIG1heSBjb250YWluIG1vcmUgdGhhbiBvbmUgZmFrZSBjdXJzb3IgYXQg dGhlIHNhbWUgSFBPUy4KKyAgTk9URTogIEEgZmFrZSBjdXJzb3IgZnJvbSBvbmUgY2FjaGUgbWF5 IG92ZXJ3cml0ZSBhIGZha2UgY3Vyc29yIGZyb20gYW5vdGhlcgorICBjYWNoZSAtLSB0aHVzLCB3 ZSBtdXN0IGNoZWNrIHRoZW0gYWxsIGZvciBvdmVyd3JpdHRlbiBmYWtlIGN1cnNvcnMuICovCisg IGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICBj YWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsKKyAgICAg IGZvciAoaW50IG50aCA9IDA7CisgICAgICAgICAgIHMKKyAgICAgICAgICAgJiYgbWNfdHJhdmVy c2VfY2FjaGVfcCAocy0+dy0+bWNfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGgpOworICAg ICAgICAgICArK250aCkKKyAgICAgICAgeworICAgICAgICAgIC8vICBpbnQgeCA9IHMtPnctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueDsKKyAgICAgICAgICBp bnQgZnggPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmZ4OworICAgICAgICAgIC8vICBpbnQgeSA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF0ueTsKKyAgICAgICAgICBpbnQgZnkgPSBzLT53LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZ5OworICAgICAgICAgIGludCBo cG9zID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5o cG9zOworICAgICAgICAgIGludCB2cG9zID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS52cG9zOworICAgICAgICAgIGludCB3ZCA9IHMtPnctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ud2Q7CisgICAgICAgICAgaW50 IGggPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmg7 CisgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IHMtPnctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vyc29yX3R5cGU7CisgICAg ICAgICAgLy8gIGludCBjdXJzb3Jfd2lkdGggPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl93aWR0aDsKKyAgICAgICAgICBzdHJ1Y3QgbWNf UkdCIGxzbF9mZyA9IHsucmVkID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXS5mZy5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg LmdyZWVuID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XS5mZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IHMt PnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcuYmx1ZX07 CisgICAgICAgICAgLy8gIHN0cnVjdCBtY19SR0IgbHNsX2JnID0gey5yZWQgPSBzLT53LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLnJlZCwKKyAgICAgICAg ICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gcy0+dy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ncmVlbiwKKyAgICAgICAgICAvLyAg ICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLmJsdWV9OworICAgICAgICAgIGJvb2wgYWN0aXZl X3AgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmFj dGl2ZV9wOworICAgICAgICAgIC8vICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBzLT53 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoX2ZsYXZv cjsKKyAgICAgICAgICBib29sIGVuYWJsZWRfcCA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxlZF9wOworICAgICAgICAgIGJvb2wgZ29fcCA9 ICh2cG9zID09IHZudGgKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA9PSBjdXJzb3Jf Z2x5cGgtPmhwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKTsKKyAgICAg ICAgICBpZiAoIWdvX3ApCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBOU1JlY3Qg cjsKKyAgICAgICAgICByLm9yaWdpbi54ID0gZng7CisgICAgICAgICAgci5vcmlnaW4ueSA9IGZ5 OworICAgICAgICAgIHIuc2l6ZS5oZWlnaHQgPSBoOworICAgICAgICAgIHIuc2l6ZS53aWR0aCA9 IHdkOworICAgICAgICAgIFtbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2xfZmcu cmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IGxzbF9mZy5n cmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiBsc2xfZmcu Ymx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdIHNl dF07CisgICAgICBpZiAoY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICAgICAgewor ICAgICAgICAgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChzLT53LT5jb250ZW50cyk7Cisg ICAgICAgICAgYm9vbCByZWdpb25fYWN0aXZlX3AgPSAoIU5JTFAgKFZ0cmFuc2llbnRfbWFya19t b2RlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChi LCBtYXJrX2FjdGl2ZSkpKTsKKyAgICAgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZyA9IChyZWdp b25fYWN0aXZlX3ApID8gbWNfcmVnaW9uX2xpbWl0ICgxKSA6IC0xOworICAgICAgICAgIHB0cmRp ZmZfdCByZWdpb25fZW5kID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBtY19yZWdpb25fbGltaXQgKDAp IDogLTE7CisgICAgICAgICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAmJiBh Y3RpdmVfcAorICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPT0gcmVnaW9u X2JlZykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19h Y3RpdmVfcmVnaW9uX2JlZ19mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYs IGludGVybiAoIistcmVhbC1mYWtlL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9iZXR3ZWVuX2ZhY2UpLCBzLT5mKTsKKyAgICAg ICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5f Y29sb3I7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKGFjdGl2 ZV9wKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2Vf aWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYs IGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAg ICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJP TV9JRCAocy0+ZiwgaG9sbG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAg TlNDb2xvciAqaG9sbG93X2FjdGl2ZV9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChO U19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19hY3RpdmVfZmFjZSksIHMtPmYpOworICAgICAgICAg ICAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xsb3dfYWN0aXZlX2NvbG9yOworICAgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxv d19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVy biAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAg ICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2luYWN0aXZlX2ZhY2UgPSBG QUNFX0ZST01fSUQgKHMtPmYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAg ICAgICAgICAgICBOU0NvbG9yICpob2xsb3dfaW5hY3RpdmVfY29sb3IgPSBuc19sb29rdXBfaW5k ZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChob2xsb3dfaW5hY3RpdmVfZmFjZSksIHMt PmYpOworICAgICAgICAgICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19pbmFjdGl2 ZV9jb2xvcjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2Ug aWYgKGZhY2UgJiYgTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSA9PSBuc19pbmRleF9jb2xvciAo RlJBTUVfQ1VSU09SX0NPTE9SIChzLT5mKSwgcy0+ZikpCisgICAgICAgICAgeworICAgICAgICAg ICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBz LT5mKSBzZXRdOworICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VSU09SX0NPTE9S IChzLT5mKTsKKyAgICAgICAgICB9CisgICAgICAgICAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY2FzZSBNQ19OT19GUklOR0VfQklUTUFQOgorICAg ICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX05PX0NVUlNPUjoKKyAg ICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBNQ19SSUdIVF9GUklOR0Vf QklUTUFQOgorICAgICAgICAgICAgICBjYXNlIE1DX0xFRlRfRlJJTkdFX0JJVE1BUDoKKyAgICAg ICAgICAgICAgY2FzZSBNQ19GSUxMRURfQk9YOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwg KHIpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX0ZSQU1F RF9CT1g6CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICAgICAg W2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKE5TSW5zZXRS ZWN0IChyLCAxLCAxKSk7CisgICAgICAgICAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAocy0+ Zikgc2V0XTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBNQ19I T0xMT1dfQk9YOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAg ICAgIFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChOU0lu c2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICAgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1Ig KHMtPmYpIHNldF07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2Ug TUNfSEJBUjoKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgICAg ICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgICAgICAgICAgTlNS ZWN0RmlsbCAocik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAg ICAgICAgLyogSWYgYSBnbHlwaCBleGlzdHMgKHMtPmNoYXIyYiAhPSBOVUxMKSwgdGhlbiBkcmF3 IHRoZSBnbHlwaCBvbiB0b3Agb2YgdGhlCisgICAgICAgICAgbmV3bHkgZHJhd24gcmVjdGFuZ2xl IHRoYXQgd2FzIGNyZWF0ZWQgaGVyZWluYWJvdmUuICBUbyB0aGUgZXh0ZW50IHRoYXQgd2UKKyAg ICAgICAgICB3YW50IHRvIGRvdWJsZS1pbXByaW50IGdseXBocyB0byBtYWtlIHRoZW0gYXBwZWFy IHRvIGJlIHNlbWktYm9sZCwgaXQgY2FuCisgICAgICAgICAgYmUgZG9uZSBoZXJlIGZvciBhbGwg Y3Vyc29yIHR5cGVzLiAgVGhlIGJveC1zdHlsZSBjdXJzb3JzIGFyZSBpbXByaW50ZWQKKyAgICAg ICAgICB3aXRoIGdseXBocyBvbmx5IG9uZSAoMSkgdGltZS4gIFRoZSBzZW1pLWJvbGQgYXBwZWFy YW5jZSBpcyBoZWxwZnVsIHdoZW4KKyAgICAgICAgICBkZWJ1Z2dpbmcgdG8gc2VlIHRoYXQgdGhl IGNvb3JkaW5hdGVzIGFyZSBjb3JyZWN0LiAqLworICAgICAgICAgIGlmIChzLT5jaGFyMmIgIT0g TlVMTAorICAgICAgICAgICAgICAmJiAoY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVEX0JPWAorICAg ICAgICAgICAgICAgICAgfHwgY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWAorICAgICAgICAg ICAgICAgICAgfHwgY3Vyc29yX3R5cGUgPT0gTUNfSE9MTE9XX0JPWCkpCisgICAgICAgICAgICB7 CisgICAgICAgICAgICAgIEJPT0wgaXNDb21wb3NpdGUgPSBzLT5maXJzdF9nbHlwaC0+dHlwZSA9 PSBDT01QT1NJVEVfR0xZUEg7CisgICAgICAgICAgICAgIGlmIChpc0NvbXBvc2l0ZSkKKyAgICAg ICAgICAgICAgICBuc19kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7 CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICBzdHJ1Y3QgZm9udCAqZm9udCA9IHMtPmZhY2UtPmZvbnQ7CisgICAgICAgICAgICAg ICAgICAgIGlmICghZm9udCkKKyAgICAgICAgICAgICAgICAgICAgICBmb250ID0gRlJBTUVfRk9O VCAocy0+Zik7CisgICAgICAgICAgICAgICAgICAgIGJvb2wgd2l0aF9iZ19wID0gZmFsc2U7Cisg ICAgICAgICAgICAgICAgICAgIGZvbnQtPmRyaXZlci0+ZHJhdyAocywgcy0+Y21wX2Zyb20sIHMt Pm5jaGFycywgcy0+eCwgcy0+eWJhc2UsIHdpdGhfYmdfcCk7CisgICAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIC8vICBjbG9ja190IGNsb2NrX2Vu ZCA9IGNsb2NrKCk7CisgIC8vICBkb3VibGUgY3B1X3RpbWVfdXNlZCA9ICgoZG91YmxlKSAoY2xv Y2tfZW5kIC0gY2xvY2tfc3RhcnQpKSAvIENMT0NLU19QRVJfU0VDOworICAvLyAgZnByaW50ZiAo c3RkZXJyLCAibnNfZHJhd19vdmVyd3JpdHRlbiAoJWQpOiAgVElNRSAoJWYpXG4iLCB2cG9zLCBj cHVfdGltZV91c2VkKTsKK30KKworc3RhdGljIHZvaWQKK21jX25zX2RyYXdfd2luZG93X2N1cnNv ciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3Qg Z2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICBpbnQgeCwgaW50IGZ4LCBpbnQgeSwg aW50IGZ5LCBpbnQgaHBvcywgaW50IHZwb3MsIGludCB3ZCwgaW50IGgsCisgICAgICAgICAgICAg ICAgICBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwK KyAgICAgICAgICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGgsIGVudW0gbWNfZmxhdm9yIGdseXBo X2ZsYXZvciwgYm9vbCBvbl9wLCBib29sIGFjdGl2ZV9wKQoreworICAvKiBUaGUgcHJpb3IgYnVn IG9mIGEgZG91YmxlIGltcH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KCVzKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAo IU5JTFAgKGZvcmVncm91bmQpID8gU1NEQVRBIChmb3JlZ3JvdW5kKSA6ICJOSUxQIiksCisgICAg ICAgICAgICAgICAgICAgICAgKCFOSUxQIChiYWNrZ3JvdW5kKSA/IFNTREFUQSAoYmFja2dyb3Vu ZCkgOiAiTklMUCIpKTsKKyAgLSAgRVhBTVBMRSBPRiBIT1cgVE8gQ1JFQVRFIEEgQ09MT1IgV0lU SCBSR0IvTFNMIGZsb2F0IHZhbHVlczoKKyAgICAgTlNDb2xvciAqbXlfY29sb3IgPSBbTlNDb2xv ciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiAxLjAKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVuOiAxLjAKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiAxLjAKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdOworICAtICBB TFRFUk5BVElWRSBFWEFNUExFOgorICAgICBlbnVtIGZhY2VfaWQgZGVidWdnaW5nX2ZhY2VfaWQg PSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgiKy1kZWJ1Z2dpbmctZmFj ZSIpLCB0cnVlKTsKKyAgICAgc3RydWN0IGZhY2UgKmRlYnVnZ2luZ19mYWNlID0gRkFDRV9GUk9N X0lEIChzLT5mLCBkZWJ1Z2dpbmdfZmFjZV9pZCk7CisgICAgIE5TQ29sb3IgKmNvbG9yID0gbnNf bG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZGVidWdnaW5nX2ZhY2Up LCBzLT5mKTsKKyAgICAgW2NvbG9yIHNldF07ICovCisgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNf R0xZUEgKKyAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSExFU1MpCisgICAgW1tOU0Nv bG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IGxzbC5yZWQKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBncmVlbjogbHNsLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGJsdWU6IGxzbC5ibHVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6 IDEuMF0gc2V0XTsKKyAgICBlbHNlCisgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChmKSBzZXRd OworICBpZiAoY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICB7CisgICAgICBzdHJ1 Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAody0+Y29udGVudHMpOworICAgICAgYm9vbCByZWdpb25f YWN0aXZlX3AgPSAoIU5JTFAgKFZ0cmFuc2llbnRfbWFya19tb2RlKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIG1hcmtfYWN0aXZlKSkpOworICAgICAg cHRyZGlmZl90IHJlZ2lvbl9iZWcgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IG1jX3JlZ2lvbl9saW1p dCAoMSkgOiAtMTsKKyAgICAgIHB0cmRpZmZfdCByZWdpb25fZW5kID0gKHJlZ2lvbl9hY3RpdmVf cCkgPyBtY19yZWdpb25fbGltaXQgKDApIDogLTE7CisgICAgICBpZiAocmVnaW9uX2FjdGl2ZV9w CisgICAgICAgICAgJiYgYWN0aXZlX3AKKyAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJw b3MgPT0gcmVnaW9uX2JlZykKKyAgICAgICAgeworICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xs b3dfYWN0aXZlX3JlZ2lvbl9iZWdfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3L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VnaW9uX2JldHdlZW5fY29sb3I7 CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChhY3RpdmVfcCkKKyAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2Vf aWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29y LXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xs b3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7 CisgICAgICAgICAgICAgICAgTlNDb2xvciAqaG9sbG93X2FjdGl2ZV9jb2xvciA9IG5zX2xvb2t1 cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19hY3RpdmVfZmFjZSks IGYpOworICAgICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVfY29sb3I7 CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyogVGhlIHJlZ2lvbiBpcyBfbm90XyB2 aXNpYmxlIGluIHRoZSBpbmFjdGl2ZSB3aW5kb3cgYmVjYXVzZSB0aGUgb3ZlcmxheSB3aW5kb3cg cHJvcGVydHkgaXMgdXNlZC4gKi8KKyAgICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQor ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3df aW5hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJl YWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAg ICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQg KGYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgIE5TQ29sb3Ig KmhvbGxvd19pbmFjdGl2ZV9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNF X0JBQ0tHUk9VTkQgKGhvbGxvd19pbmFjdGl2ZV9mYWNlKSwgZik7CisgICAgICAgICAgICAgICAg ICBob2xsb3dfY29sb3IgPSBob2xsb3dfaW5hY3RpdmVfY29sb3I7CisgICAgICAgICAgICAgICAg fQorICAgIH0KKyAgICBlbHNlIGlmIChmYWNlICYmIE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSkg PT0gbnNfaW5kZXhfY29sb3IgKEZSQU1FX0NVUlNPUl9DT0xPUiAoZiksIGYpKQorICAgICAgewor ICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFj ZSksIGYpIHNldF07CisgICAgICAgIGhvbGxvd19jb2xvciA9IEZSQU1FX0NVUlNPUl9DT0xPUiAo Zik7CisgICAgICB9CisjaWZkZWYgTlNfSU1QTF9DT0NPQQorICBOU0Rpc2FibGVTY3JlZW5VcGRh dGVzICgpOworI2VuZGlmCisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgeworICAgICAgY2Fz ZSBNQ19OT19GUklOR0VfQklUTUFQOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfTk9f Q1VSU09SOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1B UDoKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0xFRlRfRlJJTkdFX0JJVE1BUDoKKyAg ICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgIE5TUmVjdEZp bGwgKHIpOworICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfRlJBTUVEX0JPWDoKKyAgICAg ICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAg TlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgW0ZSQU1FX0NVUlNP Ul9DT0xPUiAoZikgc2V0XTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0hPTExPV19C T1g6CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07 CisgICAgICAgIE5TUmVjdEZpbGwgKE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgIFtG UkFNRV9DVVJTT1JfQ09MT1IgKGYpIHNldF07CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBN Q19IQkFSOgorICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgYnJlYWs7CisgICAgICBj YXNlIE1DX0JBUjoKKyAgICAgICAgcyA9IHI7CisgICAgICAgIC8qIEBsYXdsaXN0IGlzIGZvY3Vz aW5nIHRoZSBpbml0aWFsIGRldmVsb3BtZW50IG9mIGZlYXR1cmUgcmVxdWVzdHMKKyAgICAgICAg IzE3Njg0IGFuZCAjMjI4NzMgb24gTDJSIGxhbmd1YWdlcy4gKi8KKyAgICAgICAgaWYgKGdseXBo X2ZsYXZvciAhPSBNQ19HTFlQSAorICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX0dM WVBITEVTUykKKyAgICAgICAgICB7CisgICAgICAgICAgICAvKiBJZiB0aGUgY2hhcmFjdGVyIHVu ZGVyIGN1cnNvciBpcyBSMkwsIGRyYXcgdGhlIGJhciBjdXJzb3IKKyAgICAgICAgICAgICAgIG9u IHRoZSByaWdodCBvZiBpdHMgZ2x5cGgsIHJhdGhlciB0aGFuIG9uIHRoZSBsZWZ0LiAqLworICAg ICAgICAgICAgaWYgKChjdXJzb3JfZ2x5cGgtPnJlc29sdmVkX2xldmVsICYgMSkgIT0gMCkKKyAg ICAgICAgICAgICAgcy5vcmlnaW4ueCArPSBjdXJzb3JfZ2x5cGgtPnBpeGVsX3dpZHRoIC0gcy5z aXplLndpZHRoOworICAgICAgICAgIH0KKyAgICAgICAgTlNSZWN0RmlsbCAocyk7CisgICAgICAg IGJyZWFrOworICAgIH0KKyAgbnNfcmVzZXRfY2xpcHBpbmcgKGYpOworICAvKiBkcmF3IHRoZSBj aGFyYWN0ZXIgdW5kZXIgdGhlIGN1cnNvciAqLworICBpZiAoZ2x5cGhfZmxhdm9yICE9IE1DX0dM WVBITEVTUworICAgICAgJiYgKGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gKKyAgICAgICAg ICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YCisgICAgICAgICAgfHwgY3Vyc29yX3R5 cGUgPT0gTUNfSE9MTE9XX0JPWAorICAgICAgICAgIHx8IChkZWJ1Z19wCisgICAgICAgICAgICAg ICYmIGN1cnNvcl90eXBlID09IE1DX0hCQVIpCisgICAgICAgICAgfHwgKGRlYnVnX3AKKyAgICAg ICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfQkFSKSkpCisgICAgeworICAgICAgLyogYGN1 cnNvcl9nY19wYCBpcyB1c2VkIG9ubHkgYnkgYHczMnRlcm0uY2AgYW5kIGB4dGVybS5jJy4gKi8K KyAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSBmYWxzZTsKKyAgICAgIGNvbnN0IEVtYWNzX1JlY3Rh bmdsZSAqc2F2ZWRfY2xpcCA9IE5VTEw7CisgICAgICBpZiAocm93LT5jbGlwICE9IE5VTEwpCisg ICAgICAgIHsKKyAgICAgICAgICBzYXZlZF9jbGlwID0gcm93LT5jbGlwOworICAgICAgICAgIHJv dy0+Y2xpcCA9IE5VTEw7CisgICAgICAgIH0KKy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1VOREVS X1dBVkUpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRl ZF9wKQorICAgICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChmYWNlLT51bmRlcmxpbmVfY29s b3IsIHMtPmYpIHNldF07CisgICAgICAgICAgbnNfZHJhd191bmRlcndhdmUgKHMsIHdpZHRoLCB4 KTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9 PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgeworICAgICAgICAgICAgTlNSZWN0IHI7Cisg ICAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CisgICAgICAgICAg ICAvKiBJZiB0aGUgcHJldiB3YXMgdW5kZXJsaW5lZCwgbWF0Y2ggaXRzIGFwcGVhcmFuY2UuICov CisgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfcAor ICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0Vf VU5ERVJfTElORQorICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPnVuZGVybGluZV90aGlja25l c3MgPiAwKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+ cHJldi0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMt PnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgc3RydWN0IGZvbnQg KmZvbnQ7CisgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIGRlc2NlbnQ7CisgICAgICAg ICAgICAgICAgICBmb250PXMtPmZvbnQ7CisgICAgICAgICAgICAgICAgICBkZXNjZW50ID0gcy0+ eSArIHMtPmhlaWdodCAtIHMtPnliYXNlOworICAgICAgICAgICAgICAgICAgLyogVXNlIHVuZGVy bGluZSB0aGlja25lc3Mgb2YgZm9udCwgZGVmYXVsdGluZyB0byAxLiAqLworICAgICAgICAgICAg ICAgICAgdGhpY2tuZXNzID0gKGZvbnQgJiYgZm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDAp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZvbnQtPnVuZGVybGluZV90aGlja25l c3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMTsKKyAgICAgICAgICAgICAgICAg IC8qIERldGVybWluZSB0aGUgb2Zmc2V0IG9mIHVuZGVybGluaW5nIGZyb20gdGhlIGJhc2VsaW5l LiAqLworICAgICAgICAgICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRfbGluZSkK KyAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNjZW50IC0gdGhpY2tuZXNzOworICAg ICAgICAgICAgICAgICAgICBlbHNlIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVy dGllcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBmb250ICYmIGZvbnQtPnVuZGVy bGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gZm9u dC0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGZv bnQpCisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGxyb3VuZCAoZm9udC0+ZGVz Y2VudCAvIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAg ICAgICAgICAgICBwb3NpdGlvbiA9IHVuZGVybGluZV9taW5pbXVtX29mZnNldDsKKyAgICAgICAg ICAgICAgICAgIHBvc2l0aW9uID0gbWF4IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zm c2V0KTsKKyAgICAgICAgICAgICAgICAgIC8qIEVuc3VyZSB1bmRlcmxpbmluZyBpcyBub3QgY3Jv cHBlZC4gKi8KKyAgICAgICAgICAgICAgICAgIGlmIChkZXNjZW50IDw9IHBvc2l0aW9uKQorICAg ICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNj ZW50IC0gMTsKKyAgICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGRlc2NlbnQgPCBwb3Np dGlvbiArIHRoaWNrbmVzcykKKyAgICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOwor ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHMtPnVuZGVybGluZV90aGlja25lc3MgPSB0 aGlja25lc3M7CisgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPSBwb3NpdGlvbjsK KyAgICAgICAgICAgIHIgPSBOU01ha2VSZWN0ICh4LCBzLT55YmFzZSArIHBvc2l0aW9uLCB3aWR0 aCwgdGhpY2tuZXNzKTsKKyAgICAgICAgICAgIGlmIChmYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVk X3ApCisgICAgICAgICAgICAgIFtkZWZhdWx0Q29sIHNldF07CisgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZhY2UtPnVuZGVybGlu ZV9jb2xvciwgcy0+Zikgc2V0XTsKKyAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAg ICAgIH0KKyAgICB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V9CQUNLR1JPVU5EIChmYWNlKSwgcy0+Zik7CisgICAgICBmZ0NvbCA9IG5zX2xvb2t1cF9pbmRl eGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICAgIGZvciAo aSA9IDA7IGkgPCBuOyArK2kpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoIXMtPnJvdy0+ZnVs bF93aWR0aF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpbnQgb3ZlcnJ1biwgbGVm dG92ZXJydW47CisgICAgICAgICAgICAgIC8qIHRydW5jYXRlIHRvIGF2b2lkIG92ZXJ3cml0aW5n IGZyaW5nZSBhbmQvb3Igc2Nyb2xsYmFyICovCisgICAgICAgICAgICAgIG92ZXJydW4gPSBtYXgg KDAsIChzLT54ICsgcy0+YmFja2dyb3VuZF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIC0gKFdJTkRPV19CT1hfUklHSFRfRURHRV9YIChzLT53KQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgLSBXSU5ET1dfUklHSFRfRlJJTkdFX1dJRFRIIChzLT53KSkpOwor ICAgICAgICAgICAgICAgICAgICByW2ldLnNpemUud2lkdGggLT0gb3ZlcnJ1bjsKKyAgICAgICAg ICAgICAgLyogdHJ1bmNhdGUgdG8gYXZvaWQgb3ZlcndyaXRpbmcgdG8gbGVmdCBvZiB0aGUgd2lu ZG93IGJveCAqLworICAgICAgICAgICAgICBsZWZ0b3ZlcnJ1biA9IChXSU5ET1dfQk9YX0xFRlRf RURHRV9YIChzLT53KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIFdJTkRPV19MRUZU X0ZSSU5HRV9XSURUSCAocy0+dykpIC0gcy0+eDsKKyAgICAgICAgICAgICAgaWYgKGxlZnRvdmVy cnVuID4gMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICByW2ldLm9yaWdp bi54ICs9IGxlZnRvdmVycnVuOworICAgICAgICAgICAgICAgICAgcltpXS5zaXplLndpZHRoIC09 IGxlZnRvdmVycnVuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyogWFhYOiBU cnkgdG8gd29yayBiZXR3ZWVuIHByb2JsZW0gd2hlcmUgYSBzdHJldGNoIGdseXBoIG9uCisgICAg ICAgICAgICAgICAgIGEgcGFydGlhbGx5LXZpc2libGUgYm90dG9tIHJvdyB3aWxsIGNsZWFyIHBh cnQgb2YgdGhlCisgICAgICAgICAgICAgICAgIG1vZGVsaW5lLCBhbmQgYW5vdGhlciB3aGVyZSBs aXN0LWJ1ZmZlcnMgaGVhZGVycyBhbmQgc2ltaWxhcgorICAgICAgICAgICAgICAgICByb3dzIGVy cm9uZW91c2x5IGhhdmUgdmlzaWJsZV9oZWlnaHQgc2V0IHRvIDAuICBOb3Qgc3VyZQorICAgICAg ICAgICAgICAgICB3aGVyZSB0aGlzIGlzIGNvbWluZyBmcm9tIGFzIG90aGVyIHRlcm1zIHNlZW0g bm90IHRvIHNob3cuICovCisgICAgICAgICAgICAgIHJbaV0uc2l6ZS5oZWlnaHQgPSBtaW4gKHMt PmhlaWdodCwgcy0+cm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgICAgICB9CisgICAgICAg ICAgW2JnQ29sIHNldF07CisgICAgICAgICAgLyogTk9URTogdW5kZXIgTlMgdGhpcyBpcyBOT1Qg dXNlZCB0byBkcmF3IGN1cnNvcnMsIGJ1dCB3ZSBtdXN0IGF2b2lkCisgICAgICAgICAgICAgb3Zl cndyaXRpbmcgY3Vyc29yICh1c3VhbGx5IHdoZW4gY3Vyc29yIG9uIGEgdGFiKSAqLworICAgICAg ICAgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgLyogRklYTUU6ICBEbyB3ZSBzdGlsbCBuZWVkIHRvIHByZXZlbnQgdGhpcyBzZWN0aW9uIG9m IGNvZGUgZnJvbQorICAgICAgICAgICAgICBlcmFzaW5nIHRoZSBmYWtlIE1DX0hCQVIgdGhhdCBl eHRlbmRzIHRoZSBlbnRpcmUgbGVuZ3RoIG9mIHRoZQorICAgICAgICAgICAgICBTVFJFVENIX0dM WVBIPyAgVGhpcyBtYXkgaGF2ZSBiZWVuIGRvbmUgcHJpb3IgdG8gdGhlIGZpeCByZWxhdGluZwor ICAgICAgICAgICAgICB0byBsZWZ0L3JpZ2h0IG92ZXJ3cml0dGVuIGdseXBocy4gKi8KKyAgICAg ICAgICAgICAgcltpXS5zaXplLmhlaWdodCAtPSAxOworICAgICAgICAgICAgICAvLyAgZW51bSBm YWNlX2lkIGRlYnVnZ2luZ19mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYs IGludGVybiAoIistZGVidWdnaW5nLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgIC8vICBz dHJ1Y3QgZmFjZSAqZGVidWdnaW5nX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGRlYnVnZ2lu Z19mYWNlX2lkKTsKKyAgICAgICAgICAgICAgLy8gIE5TQ29sb3IgKmNvbG9yID0gbnNfbG9va3Vw X2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZGVidWdnaW5nX2ZhY2UpLCBzLT5m KTsKKyAgICAgICAgICAgICAgLy8gIFtjb2xvciBzZXRdOworICAgICAgICAgICAgICBDR0Zsb2F0 IHggPSByW2ldLm9yaWdpbi54OworICAgICAgICAgICAgICBDR0Zsb2F0IHdpZHRoID0gd2Q7Cisg ICAgICAgICAgICAgIHJbaV0uc2l6ZS53aWR0aCAtPSB3aWR0aDsKKyAgICAgICAgICAgICAgcltp XS5vcmlnaW4ueCArPSB3aWR0aDsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocltpXSk7Cisg ICAgICAgICAgICAgIC8qIERyYXcgb3ZlcmxpbmluZywgZXRjLiBvbiB0aGUgY3Vyc29yLiAqLwor ICAgICAgICAgICAgICBpZiAocy0+dy0+cGh5c19jdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9Y KQorICAgICAgICAgICAgICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCBi Z0NvbCwgd2lkdGgsIHgpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg IG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCBmZ0NvbCwgd2lkdGgsIHgpOwor ICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgLy8gIGludCBy eCA9IHJbaV0ub3JpZ2luLng7CisgIC8vICBpbnQgcnkgPSByW2ldLm9yaWdpbi55OworICAvLyAg aW50IHJ3ID0gcltpXS5zaXplLndpZHRoOworICAvLyAgaW50IHJoID0gcltpXS5zaXplLmhlaWdo dDsKKyAgLy8gIGZwcmludGYgKHN0ZGVyciwgIm1jX25zX2R1bXBnbHlwaHNfc3RyZXRjaDogIHZw b3MgKCVkKSB8IHJ4ICglZCkgfCByeSAoJWQpIHwgcncgKCVkKSB8IHJoICglZClcbiIsCisgIC8v ICAgICAgICAgICAgICAgICAgIHMtPmZpcnN0X2dseXBoLT52cG9zLCByeCwgcnksIHJ3LCByaCk7 CisgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHJbaV0pOworICAgICAgICAgICAgfQorICAgICAg ICAgIC8qIERyYXcgb3ZlcmxpbmluZywgZXRjLiBvbiB0aGUgc3RyZXRjaCBnbHlwaCAob3IgdGhl IHBhcnQKKyAgICAgICAgICAgICBvZiB0aGUgc3RyZXRjaCBnbHlwaCBhZnRlciB0aGUgY3Vyc29y KS4gKi8KKyAgICAgICAgICBtY19uc19kcmF3X3RleHRfZGVjb3JhdGlvbiAocywgZmFjZSwgZmdD b2wsIHJbaV0uc2l6ZS53aWR0aCwKKyAgICAgICAgICAgICA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icik7CisgIC8qIERyYXcgdGhl IGltYWdlLi4gZG8gd2UgbmVlZCB0byBkcmF3IHBsYWNlaG9sZGVyIGlmIGltZyA9PW5pbD8gKi8K KyAgaWYgKGltZyAhPSBuaWwpCisgICAgeworI2lmZGVmIE5TX0lNUExfQ09DT0EKKyAgICAgIE5T UmVjdCBkciA9IE5TTWFrZVJlY3QgKHgsIHksIHMtPnNsaWNlLndpZHRoLCBzLT5zbGljZS5oZWln aHQpOworICAgICAgTlNSZWN0IGlyID0gTlNNYWtlUmVjdCAocy0+c2xpY2UueCwgcy0+c2xpY2Uu eSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLndpZHRoLCBzLT5zbGlj ZS5oZWlnaHQpOworICAgICAgW2ltZyBkcmF3SW5SZWN0OiBkcgorICAgICAgICAgICAgIGZyb21S ZWN0OiBpcgorICAgICAgICAgICAgIG9wZXJhdGlvbjogTlNDb21wb3NpdGVTb3VyY2VPdmVyCisg ICAgICAgICAgICAgIGZyYWN0aW9uOiAxLjAKKyAgICAgICAgICAgcmVzcGVjdEZsaXBwZWQ6IFlF UworICAgICAgICAgICAgICAgIGhpbnRzOiBuaWxdOworI2Vsc2UKKyAgICAgIFtpbWcgY29tcG9z aXRlVG9Qb2ludDogTlNNYWtlUG9pbnQgKHgsIHkgKyBzLT5zbGljZS5oZWlnaHQpCisgICAgICAg ICAgICAgICAgICBvcGVyYXRpb246IE5TQ29tcG9zaXRlU291cmNlT3Zlcl07CisjZW5kaWYKKyAg ICB9CisgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikKKyAgICB7CisgICAgICBbRlJBTUVfQ1VS U09SX0NPTE9SIChzLT5mKSBzZXRdOworICAgICAgaWYgKHMtPnctPnBoeXNfY3Vyc29yX3R5cGUg PT0gTUNfRklMTEVEX0JPWCkKKyAgICAgICAgdGRDb2wgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xv ciAoTlNfRkFDRV9CQUNLR1JPVU5EIChmYW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G9v bF9iYXJfYnV0dG9uX3JlbGllZiA+PSAwID8KKyAgICAgICAgICAgIHRvb2xfYmFyX2J1dHRvbl9y ZWxpZWYgOiBERUZBVUxUX1RPT0xfQkFSX0JVVFRPTl9SRUxJRUY7CisgICAgICAgICAgcmFpc2Vk X3AgPSAocy0+aGwgPT0gRFJBV19JTUFHRV9SQUlTRUQpOworICAgICAgICB9CisgICAgICAgIGVs c2UKKyAgICAgICAgICB7CisgICAgICAgICAgICB0aCA9IGFicyAocy0+aW1nLT5yZWxpZWYpOwor ICAgICAgICAgICAgcmFpc2VkX3AgPSAocy0+aW1nLT5yZWxpZWYgPiAwKTsKKyAgICAgICAgICB9 CisgICAgICByLm9yaWdpbi54ID0geCAtIHRoOworICAgICAgci5vcmlnaW4ueSA9IHkgLSB0aDsK KyAgICAgIHIuc2l6ZS53aWR0aCA9IHMtPnNsaWNlLndpZHRoICsgMip0aC0xOworICAgICAgci5z aXplLmhlaWdodCA9IHMtPnNsaWNlLmhlaWdodCArIDIqdGgtMTsKKyAgICAgIG5zX2RyYXdfcmVs aWVmIChyLCB0aCwgcmFpc2VkX3AsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueSA9 PSAwLAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnkgKyBzLT5zbGljZS5oZWlnaHQg PT0gcy0+aW1nLT5oZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueCA9PSAw LAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnggKyBzLT5zbGljZS53aWR0aCA9PSBz LT5pbWctPndpZHRoLCBzKTsKKyAgICB9CisgIC8qIElmIHRoZXJlIGlzIG5vIG1hc2ssIHRoZSBi YWNrZ3JvdW5kIHdvbid0IGJlIHNlZW4sCisgICAgIHNvIGRyYXcgYSByZWN0YW5nbGUgb24gdGhl IGltYWdlIGZvciB0aGUgY3Vyc29yLgorICAgICBEbyB0aGlzIGZvciBhbGwgaW1hZ2VzLCBnZXR0 aW5nIHRyYW5zcGFyZW5jeSByaWdodCBpcyBub3QgcmVsaWFibGUuICovCisgIGlmIChzLT5obCA9 PSBEUkFXX0NVUlNPUikKKyAgICB7CisgICAgICBpbnQgdGhpY2tuZXNzID0gYWJzIChzLT5pbWct PnJlbGllZik7CisgICAgICBpZiAodGhpY2tuZXNzID09IDApIHRoaWNrbmVzcyA9IDE7CisgICAg aWYgKGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0g TUNfR0xZUEhMRVNTKQorICAgICAgeworICAgICAgICBOU0NvbG9yICpib3JkZXJfY29sb3IgPSBb TlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2wucmVkCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IGxzbC5ncmVl bgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBibHVlOiBsc2wuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdOworICAgICAgICBuc19kcmF3X2JveCAo YnIsIHRoaWNrbmVzcywgYm9yZGVyX2NvbG9yLCAxLCAxKTsKKyAgICAgIH0KKyAgICAgIGVsc2UK KyAgICAgICAgbnNfZHJhd19ib3ggKGJyLCB0aGlja25lc3MsIEZSQU1FX0NVUlNPUl9DT0xPUiAo cy0+ZiksIDEsIDEpOworICAgIH0KK30KKworc3RhdGljIHZvaWQKK21jX25zX21heWJlX2R1bXBn bHlwaHNfYmFja2dyb3VuZCAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgY2hhciBmb3JjZV9wKQor eworICBOU1RSQUNFICgibWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIik7CisgIGlm ICghcy0+YmFja2dyb3VuZF9maWxsZWRfcC8qIHx8IHMtPmhsID09IERSQVdfTU9VU0VfRkFDRSov KQorICAgIHsKKyAgICAgIGludCBib3hfbGluZV93aWR0aCA9IG1heCAocy0+ZmFjZS0+Ym94X2xp bmVfd2lkdGgsIDApOworICAgICAgaWYgKEZPTlRfSEVJR0hUIChzLT5mb250KSA8IHMtPmhlaWdo dCAtIDIgKiBib3hfbGluZV93aWR0aAorICAgICAgICAgIC8qIFdoZW4geGRpc3AuYyBpZ25vcmVz IEZPTlRfSEVJR0hULCB3ZSBjYW5ub3QgdHJ1c3QgZm9udAorICAgICAgICAgICAgIGRpbWVuc2lv bnMsIHNpbmNlIHRoZSBhY3R1YWwgZ2x5cGhzIG1pZ2h0IGJlIG11Y2gKKyAgICAgICAgICAgICBz bWFsbGVyLiAgU28gaW4gdGhhdCBjYXNlIHdlIGFsd2F5cyBjbGVhciB0aGUgcmVjdGFuZ2xlCisg ICAgICAgICAgICAgd2l0aCBiYWNrZ3JvdW5kIGNvbG9yLiAqLworICAgICAgICAgIHx8IEZPTlRf VE9PX0hJR0ggKHMtPmZvbnQpCisgICAgICAgICAgfHwgcy0+Zm9udF9ub3RfZm91bmRfcCB8fCBz LT5leHRlbmRzX3RvX2VuZF9vZl9saW5lX3AgfHwgZm9yY2VfcCkKKyAgICAgICAgeworICAgICAg ICAgIHN0cnVjdCBmYWNlICpmYWNlOworICAgICAgICAgIGlmIChzLT5obCA9PSBEUkFXX01PVVNF X0ZBQ0UpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQg KHMtPmYsIE1PVVNFX0hMX0lORk8gKHMtPmYpLT5tb3VzZV9mYWNlX2ZhY2VfaWQpOworICAgICAg ICAgICAgICBpZiAoIWZhY2UpCisgICAgICAgICAgICAgICAgZmFjZSA9IEZBQ0VfRlJPTV9JRCAo cy0+ZiwgTU9VU0VfRkFDRV9JRCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIHMtPmZpcnN0X2dseXBoLT5m YWNlX2lkKTsKKyAgICAgICAgICBpZiAoIWZhY2UtPnN0aXBwbGUpCisgICAgICAgICAgICBbKE5T X0ZBQ0VfQkFDS0dST1VORCAoZmFjZSkgIT0gMAorICAgICAgICAgICAgICA/IG5zX2xvb2t1cF9p bmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKQorICAgICAgICAg ICAgICA6IEZSQU1FX0JBQ0tHUk9VTkRfQ09MT1IgKHMtPmYpKSBzZXRdOworICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RydWN0IG5zX2Rpc3BsYXlf aW5mbyAqZHB5aW5mbyA9IEZSQU1FX0RJU1BMQVlfSU5GTyAocy0+Zik7CisgICAgICAgICAgICAg ICAgW1tkcHlpbmZvLT5iaXRtYXBzW2ZhY2UtPnN0aXBwbGUtMV0uaW1nIHN0aXBwbGVNYXNrXSBz ZXRdOworICAgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKHMtPmhsICE9IERSQVdfQ1VSU09S KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzLT5yZWN0YW5nbGVfbnVrZWRfcCA9IHRy dWU7CisgICAgICAgICAgICAgIE5TUmVjdCByID0gTlNNYWtlUmVjdCAocy0+eCwgcy0+eSArIGJv eF9saW5lX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+YmFj a2dyb3VuZF93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPmhl aWdodC0yKmJveF9saW5lX3dpZHRoKTsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7Cisg ICAgICAgICAgICB9CisgICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAg ICAgIH0KKyAgICB9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N0cmluZyAqbmV4 dDsKKyAgICAgIGZvciAod2lkdGggPSAwLCBuZXh0ID0gcy0+bmV4dDsKKyAgICAgICAgICAgbmV4 dCAmJiB3aWR0aCA8IHMtPnJpZ2h0X292ZXJoYW5nOworICAgICAgICAgICB3aWR0aCArPSBuZXh0 LT53aWR0aCwgbmV4dCA9IG5leHQtPm5leHQpCisgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlw aC0+dHlwZSAhPSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpZiAobmV4 dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkKKyAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocy0+bmV4 dCwgcik7CisgICAgICAgICAgICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4p KQorICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIG1jX25zX21heWJl X2R1bXBnbHlwaHNfYmFja2dyb3VuZCAocy0+bmV4dCwgMSk7CisgICAgICAgICAgICAgICAgbnNf cmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICBtY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2ggKHMtPm5leHQsIG1h dHJpeCwgcm93LCB3ZCk7CisgICAgICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAg ICAgIH0KKyAgICB9CisgIGlmICghcy0+Zm9yX292ZXJsYXBzICYmIHMtPmZhY2UtPmJveCAhPSBG QUNFX05PX0JPWAorICAgICAgJiYgKHMtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgK KyAgICAgICAgICB8fCBzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpKQor ICAgIHsKKyAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7Cisg ICAgICBpZiAoIW5zX2NsaXBfdG9fcmVjdCAocy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsK KyAgICAgIG1jX25zX21heWJlX2R1bXBnbHlwaHNfYmFja2dyb3VuZCAocywgMSk7CisgICAgICBu c19kdW1wZ2x5cGhzX2JveF9vcl9yZWxpZWYgKHMpOworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcg KHMtPmYpOworICAgICAgYm94X2RyYXduX3AgPSAxOworICAgIH0KKyAgc3dpdGNoIChzLT5maXJz dF9nbHlwaC0+dHlwZSkKKyAgICB7CisgICAgY2FzZSBJTUFHRV9HTFlQSDoKKyAgICAgIG4gPSBu c19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW5zX2NsaXBf dG9fcmVjdCAocy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIG1jX25zX2R1bXBn bHlwaHNfaW1hZ2UgKHMsIHJbMF0sIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgYWN0 aXZlX3ApOworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgYnJlYWs7Cisg ICAgY2FzZSBTVFJFVENIX0dMWVBIOgorICAgICAgbWNfbnNfZHVtcGdseXBoc19zdHJldGNoIChz LCBtYXRyaXgsIHJvdywgd2QpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBDSEFSX0dMWVBIOgor ICAgIGNhc2UgQ09NUE9TSVRFX0dMWVBIOgorICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdf Y2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICghbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBu KSkKKyAgICAgICAgcmV0dXJuOworICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcworICAgICAgICAg IHx8IChzLT5jbXBfZnJvbSA+IDAKKyAgICAgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+ dS5jbXAuYXV0b21hdGljKSkKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7Cisg ICAgICAgIGVsc2UKKyAgICAgICAgICBtY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQg KHMsIHMtPmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCk7CisgICAgICBpbnQg ZmxhZ3MgPSAocy0+aGwgPT0gRFJBV19DVVJTT1IpCisgICAgICAgICAgICAgICAgICAgID8gTlNf RFVNUEdMWVBIX0NVUlNPUgorICAgICAgICAgICAgICAgICAgOiAocy0+aGwgPT0gRFJBV19NT1VT RV9GQUNFKQorICAgICAgICAgICAgICAgICAgICA/IE5TX0RVTVBHTFlQSF9NT1VTRUZBQ0UKKyAg ICAgICAgICAgICAgICAgIDogKHMtPmZvcl9vdmVybGFwcykKKyAgICAgICAgICAgICAgICAgICAg PyBOU19EVU1QR0xZUEhfRk9SRUdST1VORAorICAgICAgICAgICAgICAgICAgOiBOU19EVU1QR0xZ UEhfTk9STUFMOworICAgICAgdW5zaWduZWQgbG9uZyBzYXZlZF9mZyA9IE5TX0ZBQ0VfRk9SRUdS T1VORCAocy0+ZmFjZSk7CisgICAgICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IgJiYgY3Vyc29y X3R5cGUgPT0gTUNfRklMTEVEX0JPWCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVkIGxv bmcgdG1wID0gTlNfRkFDRV9CQUNLR1JPVU5EIChzLT5mYWNlKTsKKyAgICAgICAgICBOU19GQUNF X0JBQ0tHUk9VTkQgKHMtPmZhY2UpID0gTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKTsKKyAg ICAgICAgICBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpID0gdG1wOworICAgICAgICB9Cisg ICAgICAgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAgICAgICAgICAgICYm IGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gKKyAgICAgICAgICAgICAgICAgJiYgYWN0aXZl X3ApCisgICAgICAgICAgeworICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVf ZmFjZV9pZCA9CisgICAgICAgICAgICAgIGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBp bnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAg ICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChzLT5m LCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgTlNfRkFDRV9GT1JFR1JPVU5E IChzLT5mYWNlKSA9IE5TX0ZBQ0VfRk9SRUdST1VORCAoaG9sbG93X2FjdGl2ZV9mYWNlKTsKKyAg ICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IKKyAgICAg ICAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YCisgICAgICAgICAg ICAgICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGVudW0g ZmFjZV9pZCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCA9CisgICAgICAgICAgICAgICAgbG9va3Vw X25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFj dGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhv bGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBob2xsb3dfaW5hY3RpdmVf ZmFjZV9pZCk7CisgICAgICAgICAgICAgIE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgPSBO U19GQUNFX0ZPUkVHUk9VTkQgKGhvbGxvd19pbmFjdGl2ZV9mYWNlKTsKKyAgICAgICAgICAgIH0K KyAgICAgIGlmIChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpCisgICAg ICAgIG5zX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAg ICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgd2l0aF9iZ19wID0gKChmbGFn cyA9PSBOU19EVU1QR0xZUEhfTk9STUFMICYmICFzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX01PVVNF RkFDRSk7CisgICAgICAgICAgICBpZiAod2l0aF9iZ19wKQorICAgICAgICAgICAgICBzLT5iYWNr Z3JvdW5kX251a2VkX3AgPSB0cnVlOworICAgICAgICAgICAgZm9udC0+ZHJpdmVyLT5kcmF3IChz LCBzLT5jbXBfZnJvbSwgcy0+bmNoYXJzLCBzLT54LCBzLT55YmFzZSwgd2l0aF9iZ19wKTsKKyAg ICAgICAgICB9CisgICAgICBOU0NvbG9yICpjb2wgPSAoTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5m YWNlKSAhPSAwCisgICAgICAgICAgICAgICAgICAgICA/IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9y IChOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpLCBzLT5mKQorICAgICAgICAgICAgICAgICAg ICAgOiBGUkFNRV9GT1JFR1JPVU5EX0NPTE9SIChzLT5mKSk7CisgICAgICBbY29sIHNldF07Cis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KKyAgICAgICAgICBOU19GQUNFX0ZPUkVH Uk9VTkQgKHMtPmZhY2UpID0gc2F2ZWRfZmc7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+ Zik7CisgICAgICBicmVhazsKKyAgICBjYXNlIEdMWVBITEVTU19HTFlQSDoKKyAgICAgIG4gPSBu c19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW5zX2NsaXBf dG9fcmVjdCAocy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIGlmIChzLT5mb3Jf b3ZlcmxhcHMKKyAgICAgICAgICB8fCAocy0+Y21wX2Zyb20gPiAwCisgICAgICAgICAgICAgICYm ICEgcy0+Zmlyc3RfZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykpCisgICAgICAgIHMtPmJhY2tncm91 bmRfZmlsbGVkX3AgPSAxOworICAgICAgZWxzZQorICAgICAgICBtY19uc19tYXliZV9kdW1wZ2x5 cGhzX2JhY2tncm91bmQgKHMsIHMtPmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQ SCk7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBicmVhazsKKyAgICBk ZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgICAgfQorICAvKiBEcmF3IGJveCBpZiBu b3QgZG9uZSBhbHJlYWR5LiAqLworICBpZiAoIXMtPmZvcl9vdmVybGFwcworICAgICAgJiYgIWJv eF9kcmF3bl9wCisgICAgICAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisgICAgewor ICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlm ICghbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAgcmV0dXJuOworICAgICAg bnNfZHVtcGdseXBoc19ib3hfb3JfcmVsaWVmIChzKTsKKyAgICAgIG5zX3Jlc2V0X2NsaXBwaW5n IChzLT5mKTsKKyAgICB9CisgIHMtPm51bV9jbGlwcyA9IDA7Cit9CisKKy8qIGVuZCBNVUxUSVBM RS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiA9PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PQogCiAgICBOU1RSQUNFLCBUcmFjZSBzdXBwb3J0LgpAQCAtMTA3OSw2ICsyMDQ4LDE2 IEBAIHN0YXRpYyBOU1JlY3QgY29uc3RyYWluX2ZyYW1lX3JlY3QoTlNSZWN0IGZyYW1lUmVjdCwg Ym9vbCBpc0Z1bGxzY3JlZW4pCiAgICBleHRlcm5hbCAoUklGKSBjYWxsOyB3aG9sZSBmcmFtZSwg Y2FsbGVkIGJlZm9yZSBndWlfdXBkYXRlX3dpbmRvd19iZWdpbgogICAgLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNP UlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IGY7CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICNpZmRlZiBOU19JTVBMX0NPQ09BCiAgIEVtYWNzVmlldyAqdmlldyA9IEZS QU1FX05TX1ZJRVcgKGYpOwogCkBAIC0xMTA5LDYgKzIwODgsMTYgQEAgc3RhdGljIE5TUmVjdCBj b25zdHJhaW5fZnJhbWVfcmVjdChOU1JlY3QgZnJhbWVSZWN0LCBib29sIGlzRnVsbHNjcmVlbikK IAogLyogICBpZiAoZiA9PSBNT1VTRV9ITF9JTkZPIChmKS0+bW91c2VfZmFjZV9tb3VzZV9mcmFt ZSkgKi8KICAgTU9VU0VfSExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfZGVmZXIgPSAwOworCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1j X3VwZGF0aW5nX2ZyYW1lID0gTlVMTDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog fQogCiAKQEAgLTQ3NTksNiArNTc0OCwxNyBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMgKHJhcGlk IGluY29taW5nIGV2ZW50cykuCiAgICAgICBiYXIgPSBbW0VtYWNzU2Nyb2xsZXIgYWxsb2NdIGlu aXRGcmFtZTogciB3aW5kb3c6IHdpbl07CiAgICAgICB3c2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIg KHdpbmRvdywgbWFrZV9taW50X3B0ciAoYmFyKSk7CiAgICAgICB1cGRhdGVfcCA9IFlFUzsKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAg ICAgLyogVGhpcyBpcyBvbmx5IGZvciBkZWJ1Z2dpbmcgcHVycG9zZXMuICovCisgICAgICBbYmFy IG1jX3NldF9yZWN0YW5nbGU6IHJdOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAg ICAgfQogICBlbHNlCiAgICAgewpAQCAtNDc2NiwxMiArNTc2NiwzMCBAQCBpbiBjZXJ0YWluIHNp dHVhdGlvbnMgKHJhcGlkIGluY29taW5nIGV2ZW50cykuCiAgICAgICBiYXIgPSBYTlNfU0NST0xM X0JBUiAod2luZG93LT52ZXJ0aWNhbF9zY3JvbGxfYmFyKTsKICAgICAgIG9sZFJlY3QgPSBbYmFy IGZyYW1lXTsKICAgICAgIHIuc2l6ZS53aWR0aCA9IG9sZFJlY3Quc2l6ZS53aWR0aDsKKworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAgICAg aWYgKEZSQU1FX0xJVkVfUCAoZikgJiYgIU5TRXF1YWxSZWN0cyAob2xkUmVjdCwgcikpCiAgICAg ICAgIHsKKyAgICAgICAgICAvKiBUaGUgbWFpbiB3aW5kb3cgaGFzIHByb2JhYmx5IGJlZW4gcmVz aXplZC4gIEdyYWNpb3VzbHkgZGVsZXRlIHRoZQorICAgICAgICAgIG9sZCBzY3JvbGwgYmFyIHdp dGhvdXQgcmVwYWludGluZyBpdHMgcmVjdGFuZ2xlOyBhbmQsIGNyZWF0ZSBhIG5ldworICAgICAg ICAgIHNjcm9sbCBiYXIgZWxzZXdoZXJlLiovCiAgICAgICAgICAgaWYgKG9sZFJlY3Qub3JpZ2lu LnggIT0gci5vcmlnaW4ueCkKKyAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgbnNfY2xlYXJf ZnJhbWVfYXJlYSAoZiwgbGVmdCwgdG9wLCB3aWR0aCwgaGVpZ2h0KTsKKyAgICAgICAgICAgICAg W2JhciBtY19qdWRnZV07CisgICAgICAgICAgICAgIGJhciA9IFtbRW1hY3NTY3JvbGxlciBhbGxv Y10gaW5pdEZyYW1lOiByIHdpbmRvdzogd2luXTsKKyAgICAgICAgICAgICAgd3NldF92ZXJ0aWNh bF9zY3JvbGxfYmFyICh3aW5kb3csIG1ha2VfbWludF9wdHIgKGJhcikpOworICAgICAgICAgICAg fQorICAgICAgICAgICAgZWxzZQogICAgICAgICAgIFtiYXIgc2V0RnJhbWU6IHJdOwogICAgICAg ICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB9CiAKICAgaWYgKHVwZGF0 ZV9wKQpAQCAtNDkzMSw5ICs1OTQ5LDU3IEBAIGluIGNlcnRhaW4gc2l0dWF0aW9ucyAocmFwaWQg aW5jb21pbmcgZXZlbnRzKS4KICAgICB7CiAgICAgICB2aWV3ID0gW3N1YnZpZXdzIG9iamVjdEF0 SW5kZXg6IGldOwogICAgICAgaWYgKCFbdmlldyBpc0tpbmRPZkNsYXNzOiBbRW1hY3NTY3JvbGxl ciBjbGFzc11dKSBjb250aW51ZTsKLSAgICAgIGlmIChbdmlldyBqdWRnZV0pCisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogYFhTRVRX SU5ET1cnIHdpbGwgc29tZXRpbWVzIGNhdXNlIEVtYWNzIHRvIGNyYXNoIHdoZW4gcnVubmluZyB1 bmRlciBnZGIgZXZlbgorICB0aG91Z2ggKHcgIT0gTlVMTCkuICBUaGVyZWZvcmUsIHdlIGNhbm5v dCByZWxpYWJseSB1c2UgYFdJTkRPV19MSVZFX1AnLiAqLworICBzdHJ1Y3Qgd2luZG93ICp3ID0g W3ZpZXcgbWNfZ2V0X3dpbmRvd107CisgIGlmICh3ICE9IE5VTEwKKyAgICAgICYmIE5JTFAgKHct PmNvbnRlbnRzKSkKKyAgICB7CisgICAgICBCT09MIGRlYnVnX3AgPSBmYWxzZTsKKyAgICAgIGlm IChkZWJ1Z19wCisgICAgICAgICAgLyogYHdpbmRvd19ib3gnIGNhbGxzIGB3aW5kb3dfYm94X2hl aWdodCcsIHdoaWNoIHdpbGwgY2F1c2UgRW1hY3MgdG8KKyAgICAgICAgICBjcmFzaCBpZiBGUkFN RVAgKHctPmZyYW1lKSBpcyBub3Qgc2F0aXNmaWVkLiAqLworICAgICAgICAgICYmIEZSQU1FUCAo dy0+ZnJhbWUpKQorICAgICAgICB7CisgICAgICAgICAgTlNSZWN0IHIwID0gW3ZpZXcgbWNfZ2V0 X3JlY3RhbmdsZV07CisgICAgICAgICAgaW50IHgwID0gTlNNaW5YIChyMCk7CisgICAgICAgICAg aW50IHkwID0gTlNNaW5ZIChyMCk7CisgICAgICAgICAgaW50IHdkMCA9IE5TV2lkdGggKHIwKTsK KyAgICAgICAgICBpbnQgaDAgPSBOU0hlaWdodCAocjApOworICAgICAgICAgIGludCB3aW5kb3df eSwgd2luZG93X2hlaWdodDsKKyAgICAgICAgICB3aW5kb3dfYm94ICh3LCBBTllfQVJFQSwgMCwg JndpbmRvd195LCAwLCAmd2luZG93X2hlaWdodCk7CisgICAgICAgICAgaW50IHRvcCA9IHdpbmRv d195OworICAgICAgICAgIGludCBoZWlnaHQgPSB3aW5kb3dfaGVpZ2h0OworICAgICAgICAgIGlu dCB3aWR0aCA9IFdJTkRPV19DT05GSUdfU0NST0xMX0JBUl9DT0xTICh3KSAqIEZSQU1FX0NPTFVN Tl9XSURUSCAoZik7CisgICAgICAgICAgaW50IGxlZnQgPSBXSU5ET1dfU0NST0xMX0JBUl9BUkVB X1ggKHcpOworICAgICAgICAgIE5TUmVjdCByMSA9IE5TTWFrZVJlY3QgKGxlZnQsIHRvcCwgd2lk dGgsIGhlaWdodCk7CisgICAgICAgICAgLyogVGhlIHBhcmVudCB2aWV3IGlzIGZsaXBwZWQsIHNv IHdlIG5lZWQgdG8gZmxpcCB5IHZhbHVlLiAqLworICAgICAgICAgIEVtYWNzVmlldyAqZnJhbWVf dmlldyA9IEZSQU1FX05TX1ZJRVcgKGYpOworICAgICAgICAgIE5TUmVjdCB2ID0gW2ZyYW1lX3Zp ZXcgZnJhbWVdOworICAgICAgICAgIHIxLm9yaWdpbi55ID0gKHYuc2l6ZS5oZWlnaHQgLSByMS5z aXplLmhlaWdodCAtIHIxLm9yaWdpbi55KTsKKyAgICAgICAgICBpbnQgeDEgPSBOU01pblggKHIx KTsKKyAgICAgICAgICBpbnQgeTEgPSBOU01pblkgKHIxKTsKKyAgICAgICAgICBpbnQgd2QxID0g TlNXaWR0aCAocjEpOworICAgICAgICAgIGludCBoMSA9IE5TSGVpZ2h0IChyMSk7CisgICAgICAg ICAgZnByaW50ZiAoc3RkZXJyLCAiJXMgLS0gREVBRDpcblwKKyAgICAgICAgICB4MC94MSAoJWQv JWQpIHwgeTAveTEgKCVkLyVkKSB8IHdkMC93ZDEgKCVkLyVkKSB8IGgwL2gxICglZC8lZClcbiIs CisgICAgICAgICAgbWNfd2luZG93ICh3KSwgeDAsIHgxLCB5MCwgeTEsIHdkMCwgd2QxLCBoMCwg aDEpOworICAgICAgICB9CisgICAgICBpZiAoW3ZpZXcgbWNfanVkZ2VdKQogICAgICAgICByZW1v dmVkID0gWUVTOwogICAgIH0KKyAgICBlbHNlIGlmIChbdmlldyBqdWRnZV0pCisgICAgICByZW1v dmVkID0gWUVTOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCisgICAgfQogCiAgIGlm IChyZW1vdmVkKQogICAgIFtldmlldyB1cGRhdGVGcmFtZVNpemU6IE5PXTsKQEAgLTUwNzQsNiAr NjE0MCwyMCBAQCBzdGF0aWMgTGlzcF9PYmplY3QgbnNfc3RyaW5nX3RvX2xpc3Btb2QgKGNvbnN0 IGNoYXIgKnMpCiBleHRlcm4gZnJhbWVfcGFybV9oYW5kbGVyIG5zX2ZyYW1lX3Bhcm1faGFuZGxl cnNbXTsKIHN0YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSBuc19yZWRpc3BsYXlfaW50 ZXJmYWNlID0KIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBuc3Rlcm0ubWAgbXVzdCBi ZSBpbiB0aGUgZXhhY3Qgc2FtZSBvcmRlciBhcyB0aGUKK2ByZWRpc3BsYXlfaW50ZXJmYWNlJyBp biBgZGlzcGV4dGVybi5oYCEgKi8KKworICBtY19uc19kcmF3X3dpbmRvd19jdXJzb3IsCisgIG1j X25zX2RyYXdfZ2x5cGhfc3RyaW5nLAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAg IG5zX2ZyYW1lX3Bhcm1faGFuZGxlcnMsCiAgIGd1aV9wcm9kdWNlX2dseXBocywKICAgZ3VpX3dy aXRlX2dseXBocywKQEAgLTg3MTEsNiArOTc5MSw0OSBAQCAtIChCT09MKWNhbkJlY29tZU1haW5X aW5kb3cKIAogQGltcGxlbWVudGF0aW9uIEVtYWNzU2Nyb2xsZXIKIAorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLSAodm9pZCltY19zZXRfcmVj dGFuZ2xlOiAoTlNSZWN0KXJlY3QKK3sKKyAgbWNfcmVjdGFuZ2xlID0gcmVjdDsKK30KKworLSAo TlNSZWN0KW1jX2dldF9yZWN0YW5nbGUKK3sKKyAgcmV0dXJuIG1jX3JlY3RhbmdsZTsKK30KKwor LSAoc3RydWN0IHdpbmRvdyAqKW1jX2dldF93aW5kb3cKK3sKKyAgcmV0dXJuIHdpbmRvdzsKK30K KworLSAoYm9vbCltY19qdWRnZQoreworICBOU1RSQUNFICgiW0VtYWNzU2Nyb2xsZXIgbWNfanVk Z2VdIik7CisgIGJvb2wgcmV0ID0gY29uZGVtbmVkOworICBibG9ja19pbnB1dCAoKTsKKyAgaWYg KGNvbmRlbW5lZCkKKyAgICB7CisgICAgICAvKiBlbnN1cmUgb3RoZXIgc2Nyb2xsYmFyIHVwZGF0 ZXMgYWZ0ZXIgZGVsZXRpb24gKi8KKyAgICAgIEVtYWNzVmlldyAqdmlldyA9IChFbWFjc1ZpZXcg KilGUkFNRV9OU19WSUVXIChmcmFtZSk7CisgICAgICBpZiAodmlldyAhPSBuaWwpCisgICAgICAg IHZpZXctPnNjcm9sbGJhcnNOZWVkaW5nVXBkYXRlKys7CisgICAgfQorICBpZiAod2luZG93KQor ICAgIHdzZXRfdmVydGljYWxfc2Nyb2xsX2JhciAod2luZG93LCBRbmlsKTsKKyAgd2luZG93ID0g MDsKKyAgW3NlbGYgcmVtb3ZlRnJvbVN1cGVydmlld1dpdGhvdXROZWVkaW5nRGlzcGxheV07Cisg IFtzZWxmIHJlbGVhc2VdOworICB1bmJsb2NrX2lucHV0ICgpOworICByZXR1cm4gcmV0OworfQor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBmb3IgcmVwZWF0IGJ1dHRvbiBwdXNo ICovCiAjZGVmaW5lIFNDUk9MTF9CQVJfRklSU1RfREVMQVkgMC41CiAjZGVmaW5lIFNDUk9MTF9C QVJfQ09OVElOVU9VU19ERUxBWSAoMS4wIC8gMTUpCmRpZmYgLS1naXQgYS9zcmMvdzMydGVybS5j IGIvc3JjL3czMnRlcm0u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AorbWNfdzMyX2NvbG9yX21hcF9sb29rdXAgKGNvbnN0IGNoYXIg KmNvbG9ybmFtZSkKK3sKKyAgTGlzcF9PYmplY3QgdGFpbCwgcmV0ID0gUW5pbDsKKyAgYmxvY2tf aW5wdXQgKCk7CisgIGZvciAodGFpbCA9IFZ3MzJfY29sb3JfbWFwOyBDT05TUCAodGFpbCk7IHRh aWwgPSBYQ0RSICh0YWlsKSkKKyAgICB7CisgICAgICByZWdpc3RlciBMaXNwX09iamVjdCBlbHQs IHRlbTsKKyAgICAgIGVsdCA9IFhDQVIgKHRhaWwpOworICAgICAgaWYgKCFDT05TUCAoZWx0KSkg Y29udGludWU7CisgICAgICB0ZW0gPSBYQ0FSIChlbHQpOworICAgICAgaWYgKGxzdHJjbXBpIChT U0RBVEEgKHRlbSksIGNvbG9ybmFtZSkgPT0gMCkKKyAgICAgICAgeworICAgICAgICAgIHJldCA9 IEZjZHIgKGVsdCk7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIE1DX1FVSVQ7 CisgICAgfQorICB1bmJsb2NrX2lucHV0ICgpOworICByZXR1cm4gcmV0OworfQorCitzdGF0aWMg TGlzcF9PYmplY3QKK21jX3hfdG9fdzMyX2NvbG9yIChjb25zdCBjaGFyICogY29sb3JuYW1lKQor eworICByZWdpc3RlciBMaXNwX09iamVjdCByZXQgPSBRbmlsOworICBibG9ja19pbnB1dCAoKTsK KyAgaWYgKGNvbG9ybmFtZVswXSA9PSAnIycpCisgICAgeworICAgICAgLyogQ291bGQgYmUgYW4g b2xkLXN0eWxlIFJHQiBEZXZpY2Ugc3BlY2lmaWNhdGlvbi4gKi8KKyAgICAgIGludCBzaXplID0g c3RybGVuIChjb2xvcm5hbWUgKyAxKTsKKyAgICAgIGNoYXIgKmNvbG9yID0gYWxsb2NhIChzaXpl ICsgMSk7CisgICAgICBzdHJjcHkgKGNvbG9yLCBjb2xvcm5hbWUgKyAxKTsKKyAgICAgIGlmIChz aXplID09IDMgfHwgc2l6ZSA9PSA2IHx8IHNpemUgPT0gOSB8fCBzaXplID09IDEyKQorICAgICAg ICB7CisgICAgICAgICAgVUlOVCBjb2xvcnZhbDsKKyAgICAgICAgICBpbnQgaSwgcG9zOworICAg ICAgICAgIHBvcyA9IDA7CisgICAgICAgICAgc2l6ZSAvPSAzOworICAgICAgICAgIGNvbG9ydmFs ID0gMDsKKyAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMzsgaSsrKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBjaGFyICplbmQ7CisgICAgICAgICAgICAgIGNoYXIgdDsKKyAgICAgICAg ICAgICAgdW5zaWduZWQgbG9uZyB2YWx1ZTsKKyAgICAgICAgICAgICAgLyogVGhlIGNoZWNrIGZv ciAneCcgaW4gdGhlIGZvbGxvd2luZyBjb25kaXRpb25hbCB0YWtlcyBpbnRvCisgICAgICAgICAg ICAgIGFjY291bnQgdGhlIGZhY3QgdGhhdCBzdHJ0b2wgYWxsb3dzIGEgIjB4IiBpbiBmcm9udCBv ZgorICAgICAgICAgICAgICBvdXIgbnVtYmVycywgYW5kIHdlIGRvbid0LiAqLworICAgICAgICAg ICAgICBpZiAoIWlzeGRpZ2l0IChjb2xvclswXSkgfHwgY29sb3JbMV0gPT0gJ3gnKQorICAgICAg ICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICB0ID0gY29sb3Jbc2l6ZV07CisgICAgICAg ICAgICAgIGNvbG9yW3NpemVdID0gJ1wwJzsKKyAgICAgICAgICAgICAgdmFsdWUgPSBzdHJ0b3Vs IChjb2xvciwgJmVuZCwgMTYpOworICAgICAgICAgICAgICBjb2xvcltzaXplXSA9IHQ7CisgICAg ICAgICAgICAgIGlmIChlcnJubyA9PSBFUkFOR0UgfHwgZW5kIC0gY29sb3IgIT0gc2l6ZSkKKyAg ICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgc3dpdGNoIChzaXplKQorICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjYXNlIDE6CisgICAgICAgICAgICAgICAgICB2 YWx1ZSA9IHZhbHVlICogMHgxMDsKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAg ICAgICAgIGNhc2UgMjoKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAg IGNhc2UgMzoKKyAgICAgICAgICAgICAgICAgIHZhbHVlIC89IDB4MTA7CisgICAgICAgICAgICAg ICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIDQ6CisgICAgICAgICAgICAgICAgICB2 YWx1ZSAvPSAweDEwMDsKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgY29sb3J2YWwgfD0gKHZhbHVlIDw8IHBvcyk7CisgICAgICAgICAg ICAgIHBvcyArPSAweDg7CisgICAgICAgICAgICAgIGlmIChpID09IDIpCisgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAg ICAgIFhTRVRJTlQgKHJldCwgY29sb3J2YWwpOworICAgICAgICAgICAgICAgICAgcmV0dXJuIHJl dDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGNvbG9yID0gZW5kOworICAgICAg ICAgICAgfQorICAgICAgICB9CisgICAgfQorICBlbHNlIGlmIChzdHJuaWNtcCAoY29sb3JuYW1l LCAicmdiOiIsIDQpID09IDApCisgICAgeworICAgICAgY29uc3QgY2hhciAqY29sb3I7CisgICAg ICBVSU5UIGNvbG9ydmFsOworICAgICAgaW50IGksIHBvczsKKyAgICAgIHBvcyA9IDA7CisgICAg ICBjb2xvcnZhbCA9IDA7CisgICAgICBjb2xvciA9IGNvbG9ybmFtZSArIDQ7CisgICAgICBmb3Ig KGkgPSAwOyBpIDwgMzsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgY2hhciAqZW5kOworICAg ICAgICAgIHVuc2lnbmVkIGxvbmcgdmFsdWU7CisgICAgICAgICAgLyogVGhlIGNoZWNrIGZvciAn eCcgaW4gdGhlIGZvbGxvd2luZyBjb25kaXRpb25hbCB0YWtlcyBpbnRvCisgICAgICAgICAgICAg YWNjb3VudCB0aGUgZmFjdCB0aGF0IHN0cnRvbCBhbGxvd3MgYSAiMHgiIGluIGZyb250IG9mCisg ICAgICAgICAgICAgb3VyIG51bWJlcnMsIGFuZCB3ZSBkb24ndC4gKi8KKyAgICAgICAgICBpZiAo IWlzeGRpZ2l0IChjb2xvclswXSkgfHwgY29sb3JbMV0gPT0gJ3gnKQorICAgICAgICAgICAgYnJl YWs7CisgICAgICAgICAgdmFsdWUgPSBzdHJ0b3VsIChjb2xvciwgJmVuZCwgMTYpOworICAgICAg ICAgIGlmIChlcnJubyA9PSBFUkFOR0UpCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBz d2l0Y2ggKGVuZCAtIGNvbG9yKQorICAgICAgICAgICAgeworICAgICAgICAgICAgY2FzZSAxOgor ICAgICAgICAgICAgICB2YWx1ZSA9IHZhbHVlICogMHgxMCArIHZhbHVlOworICAgICAgICAgICAg ICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMjoKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAg ICAgICAgICBjYXNlIDM6CisgICAgICAgICAgICAgIHZhbHVlIC89IDB4MTA7CisgICAgICAgICAg ICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSA0OgorICAgICAgICAgICAgICB2YWx1ZSAvPSAw eDEwMDsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAg ICAgICAgICB2YWx1ZSA9IFVMT05HX01BWDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBpZiAo dmFsdWUgPT0gVUxPTkdfTUFYKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgY29sb3J2 YWwgfD0gKHZhbHVlIDw8IHBvcyk7CisgICAgICAgICAgcG9zICs9IDB4ODsKKyAgICAgICAgICBp ZiAoaSA9PSAyKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoKmVuZCAhPSAnXDAn KQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgp OworICAgICAgICAgICAgICBYU0VUSU5UIChyZXQsIGNvbG9ydmFsKTsKKyAgICAgICAgICAgICAg cmV0dXJuIHJldDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBpZiAoKmVuZCAhPSAnLycpCisg ICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjb2xvciA9IGVuZCArIDE7CisgICAgICAgIH0K KyAgICB9CisgICAgZWxzZSBpZiAoc3RybmljbXAgKGNvbG9ybmFtZSwgInJnYmk6IiwgNSkgPT0g MCkKKyAgICAgIHsKKyAgICAgICAgLyogVGhpcyBpcyBhbiBSR0IgSW50ZW5zaXR5IHNwZWNpZmlj YXRpb24uICovCisgICAgICAgIGNvbnN0IGNoYXIgKmNvbG9yOworICAgICAgICBVSU5UIGNvbG9y dmFsOworICAgICAgICBpbnQgaSwgcG9zOworICAgICAgICBwb3MgPSAwOworICAgICAgICBjb2xv cnZhbCA9IDA7CisgICAgICAgIGNvbG9yID0gY29sb3JuYW1lICsgNTsKKyAgICAgICAgZm9yIChp ID0gMDsgaSA8IDM7IGkrKykKKyAgICAgICAgICB7CisgICAgICAgICAgICBjaGFyICplbmQ7Cisg ICAgICAgICAgICBkb3VibGUgdmFsdWU7CisgICAgICAgICAgICBVSU5UIHZhbDsKKyAgICAgICAg ICAgIHZhbHVlID0gc3RydG9kIChjb2xvciwgJmVuZCk7CisgICAgICAgICAgICBpZiAoZXJybm8g PT0gRVJBTkdFKQorICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGlmICh2YWx1ZSA8 IDAuMCB8fCB2YWx1ZSA+IDEuMCkKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB2 YWwgPSAoVUlOVCkoMHgxMDAgKiB2YWx1ZSk7CisgICAgICAgICAgICAvKiBXZSB1c2VkIDB4MTAw IGluc3RlYWQgb2YgMHhGRiB0byBnaXZlIGEgY29udGludW91cworICAgICAgICAgICAgICAgcmFu Z2UgYmV0d2VlbiAwLjAgYW5kIDEuMCBpbmNsdXNpdmUuICBUaGUgbmV4dCBzdGF0ZW1lbnQKKyAg ICAgICAgICAgICAgIGZpeGVzIHRoZSAxLjAgY2FzZS4gKi8KKyAgICAgICAgICAgIGlmICh2YWwg PT0gMHgxMDApCisgICAgICAgICAgICAgIHZhbCA9IDB4RkY7CisgICAgICAgICAgICBjb2xvcnZh bCB8PSAodmFsIDw8IHBvcyk7CisgICAgICAgICAgICBwb3MgKz0gMHg4OworICAgICAgICAgICAg aWYgKGkgPT0gMikKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICgqZW5kICE9 ICdcMCcpCisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB1bmJsb2Nr X2lucHV0ICgpOworICAgICAgICAgICAgICAgIFhTRVRJTlQgKHJldCwgY29sb3J2YWwpOworICAg ICAgICAgICAgICAgIHJldHVybiByZXQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlm ICgqZW5kICE9ICcvJykKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjb2xvciA9 IGVuZCArIDE7CisgICAgICAgICAgfQorICAgICAgfQorICAvKiBJIGFtIG5vdCBnb2luZyB0byBh dHRlbXB0IHRvIGhhbmRsZSBhbnkgb2YgdGhlIENJRSBjb2xvciBzY2hlbWVzCisgICAgIG9yIFRl a0hWQywgc2luY2UgSSBkb24ndCBrbm93IHRoZSBhbGdvcml0aG1zIGZvciBjb252ZXJzaW9uIHRv IFJHQi4KKyAgICAgSWYgd2UgZmFpbCB0byBsb29rdXAgdGhlIGNvbG9yIG5hbWUgaW4gdzMyX2Nv bG9yX21hcCwgdGhlbiBjaGVjayB0aGUKKyAgICAgY29s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XJvLCBhbGxvY2F0ZSBhIG5ldyBjb2xvcm1hcCBjZWxsLiAqLworaW50CittY193MzJf ZGVmaW5lZF9jb2xvciAoc3RydWN0IGZyYW1lICpmLCBjb25zdCBjaGFyICpjb2xvciwgbWNfWENv bG9yICpjb2xvcl9kZWYsIGJvb2wgYWxsb2NfcCkKK3sKKyAgcmVnaXN0ZXIgTGlzcF9PYmplY3Qg dGVtOworICBDT0xPUlJFRiB3MzJfY29sb3JfcmVmOworICB0ZW0gPSBtY194X3RvX3czMl9jb2xv ciAoY29sb3IpOworICBpZiAoIU5JTFAgKHRlbSkpCisgICAgeworICAgICAgaWYgKGYpCisgICAg ICAgIHsKKyAgICAgICAgICAvKiBBcHBseSBnYW1tYSBjb3JyZWN0aW9uLiAqLworICAgICAgICAg IHczMl9jb2xvcl9yZWYgPSBYVUZJWE5VTV9SQVcgKHRlbSk7CisgICAgICAgICAgZ2FtbWFfY29y cmVjdCAoZiwgJnczMl9jb2xvcl9yZWYpOworICAgICAgICAgIFhTRVRJTlQgKHRlbSwgdzMyX2Nv bG9yX3JlZik7CisgICAgICAgIH0KKyAgICAgIC8qIE1hcCB0aGlzIGNvbG9yIHRvIHRoZSBwYWxl dHRlIGlmIGl0IGlzIGVuYWJsZWQuICovCisgICAgICBpZiAoIU5JTFAgKFZ3MzJfZW5hYmxlX3Bh bGV0dGUpKQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IHczMl9wYWxldHRlX2VudHJ5ICog ZW50cnkgPSBvbmVfdzMyX2Rpc3BsYXlfaW5mby5jb2xvcl9saXN0OworICAgICAgICAgIHN0cnVj dCB3MzJfcGFsZXR0ZV9lbnRyeSAqKiBwcmV2ID0gJm9uZV93MzJfZGlzcGxheV9pbmZvLmNvbG9y X2xpc3Q7CisgICAgICAgICAgLyogY2hlY2sgaWYgY29sb3IgaXMgYWxyZWFkeSBtYXBwZWQgKi8K KyAgICAgICAgICB3aGlsZSAoZW50cnkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlm IChNQ19XMzJfQ09MT1IgKGVudHJ5LT5lbnRyeSkgPT0gWFVGSVhOVU1fUkFXICh0ZW0pKQorICAg ICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBwcmV2ID0gJmVudHJ5LT5uZXh0Owor ICAgICAgICAgICAgICBlbnRyeSA9IGVudHJ5LT5uZXh0OworICAgICAgICAgICAgfQorICAgICAg ICAgIGlmIChlbnRyeSA9PSBOVUxMICYmIGFsbG9jX3ApCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIC8qIG5vdCBhbHJlYWR5IG1hcHBlZCwgc28gYWRkIHRvIGxpc3QgKi8KKyAgICAgICAg ICAgICAgZW50cnkgPSB4bWFsbG9jIChzaXplb2YgKHN0cnVjdCB3MzJfcGFsZXR0ZV9lbnRyeSkp OworICAgICAgICAgICAgICBNQ19XMzJfU0VUX0NPTE9SIChlbnRyeS0+ZW50cnksIFhVRklYTlVN X1JBVyAodGVtKSk7CisgICAgICAgICAgICAgIGVudHJ5LT5uZXh0ID0gTlVMTDsKKyAgICAgICAg ICAgICAgKnByZXYgPSBlbnRyeTsKKyAgICAgICAgICAgICAgb25lX3czMl9kaXNwbGF5X2luZm8u bnVtX2NvbG9ycysrOworICAgICAgICAgICAgICAvKiBzZXQgZmxhZyB0aGF0IHBhbGV0dGUgbXVz dCBiZSByZWdlbmVyYXRlZCAqLworICAgICAgICAgICAgICBvbmVfdzMyX2Rpc3BsYXlfaW5mby5y ZWdlbl9wYWxldHRlID0gVFJVRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyog RW5zdXJlIENPTE9SUkVGIHZhbHVlIGlzIHNuYXBwZWQgdG8gbmVhcmVzdCBjb2xvciBpbiAoZGVm YXVsdCkKKyAgICAgICAgIHBhbGV0dGUgYnkgc2ltdWxhdGluZyB0aGUgUEFMRVRURVJHQiBtYWNy by4gIFRoaXMgd29ya3Mgd2hldGhlcgorICAgICAgICAgb3Igbm90IHRoZSBka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xzbC0+Ymx1ZSA9ICgoR2V0QlZhbHVlICh0ZW1wLnBpeGVsKSA8PCA4KSB8IEdl dEJWYWx1ZSAodGVtcC5waXhlbCkpIC8gNjU1MzUuMDsKKyAgICB9CisgICAgZWxzZQorICAgICAg eworICAgICAgICBsc2wtPnJlZCA9IC0xLjA7CisgICAgICAgIGxzbC0+Z3JlZW4gPSAtMS4wOwor ICAgICAgICBsc2wtPmJsdWUgPSAtMS4wOworICAgICAgfQorfQorCisvKiBEcmF3IHN0cmV0Y2gg Z2x5cGggc3RyaW5nIFMuICovCitzdGF0aWMgdm9pZAorbWNfdzMyX2RyYXdfc3RyZXRjaF9nbHlw aF9zdHJpbmcgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMpCit7CisgIGVhc3NlcnQgKHMtPmZpcnN0 X2dseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZUEgpOworICBpZiAocy0+aGwgPT0gRFJBV19DVVJT T1IKKyAgICAgICYmICF4X3N0cmV0Y2hfY3Vyc29yX3ApCisgICAgeworICAgICAgLyogSWYgYHgt c3RyZXRjaC1jdXJzb3InIGlzIG5pbCwgZG9uJ3QgZHJhdyBhIGJsb2NrIGN1cnNvciBhcyB3aWRl IGFzIHRoZQorICAgICAgc3RyZXRjaCBnbHlwaC4gKi8KKyAgICAgIGludCB3aWR0aCwgYmFja2dy b3VuZF93aWR0aCA9IHMtPmJhY2tncm91bmRfd2lkdGg7CisgICAgICBpbnQgeCA9IHMtPng7Cisg ICAgICBpZiAoIXMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGludCBs ZWZ0X3ggPSB3aW5kb3dfYm94X2xlZnRfb2Zmc2V0IChzLT53LCBURVhUX0FSRUEpOworICAgICAg ICAgIGlmICh4IDwgbGVmdF94KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBiYWNrZ3Jv dW5kX3dpZHRoIC09IGxlZnRfeCAtIHg7CisgICAgICAgICAgICAgIHggPSBsZWZ0X3g7CisgICAg ICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAg ICAvKiBJbiBSMkwgcm93cywgZHJhdyB0aGUgY3Vyc29yIG9uIHRoZSByaWdodCBlZGdlIG9mIHRo ZQorICAgICAgICAgICAgICBzdHJldGNoIGdseXBoLiAqLworICAgICAgICAgICBpbnQgcmlnaHRf eCA9IHdpbmRvd19ib3hfcmlnaHQgKHMtPncsIFRFWFRfQVJFQSk7CisgICAgICAgICAgIGlmICh4 ICsgYmFja2dyb3VuZF93aWR0aCA+IHJpZ2h0X3gpCisgICAgICAgICAgICAgYmFja2dyb3VuZF93 aWR0aCAtPSB4IC0gcmlnaHRfeDsKKyAgICAgICAgICAgeCArPSBiYWNrZ3JvdW5kX3dpZHRoOwor ICAgICAgICAgfQorICAgICAgd2lkdGggPSBtaW4gKEZSQU1FX0NPTFVNTl9XSURUSCAocy0+Ziks IGJhY2tncm91bmRfd2lkdGgpOworICAgICAgaWYgKHMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAg ICAgeCAtPSB3aWR0aDsKKyAgICAgIC8qIERyYXcgY3Vyc29yLiAqLworICAgICAgdzMyX2RyYXdf Z2x5cGhfc3RyaW5nX2JnX3JlY3QgKHMsIHgsIHMtPnksIHdpZHRoLCBzLT5oZWlnaHQpOworICAg ICAgLyogQ2xlYXIgcmVzdCB1c2luZyB0aGUgR0Mgb2YgdGhlIG9yaWdpbmFsIG5vbi1jdXJzb3Ig ZmFjZS4gKi8KKyAgICAgIGlmICh3aWR0aCA8IGJhY2tncm91bmRfd2lkdGgpCisgICAgICAgIHsK KyAgICAgICAgICBFbWFjc19HQyAqZ2MgPSBzLT5mYWNlLT5nYzsKKyAgICAgICAgICBpbnQgeSA9 IHMtPnk7CisgICAgICAgICAgaW50IHcgPSBiYWNrZ3JvdW5kX3dpZHRoIC0gd2lkdGgsIGggPSBz LT5oZWlnaHQ7CisgICAgICAgICAgUkVDVCByOworICAgICAgICAgIEhEQyBoZGMgPSBzLT5oZGM7 CisgICAgICAgICAgaWYgKCFzLT5yb3ctPnJldmVyc2VkX3ApCisgICAgICAgICAgICB4ICs9IHdp ZHRoOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB4ID0gcy0+eDsKKyAgICAgICAg ICBpZiAocy0+cm93LT5tb3VzZV9mYWNlX3AKKyAgICAgICAgICAgICAgJiYgY3Vyc29yX2luX21v dXNlX2ZhY2VfcCAocy0+dykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHczMl9zZXRf bW91c2VfZmFjZV9nYyAocyk7CisgICAgICAgICAgICAgIGdjID0gcy0+Z2M7CisgICAgICAgICAg ICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGdjID0gcy0+ZmFjZS0+Z2M7Cisg ICAgICAgICAgZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsICZyKTsKKyAgICAgICAgICB3 MzJfc2V0X2NsaXBfcmVjdGFuZ2xlIChoZGMsICZyKTsKKyNpZiAwIC8qIFRPRE86IHN0aXBwbGUg Ki8KKyAgICAgICAgICBpZiAocy0+ZmFjZS0+c3RpcHBsZSkKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgLyogRmlsbCBiYWNrZ3JvdW5kIHdpdGggYSBzdGlwcGxlIHBhdHRlcm4uICovCisg ICAgICAgICAgICAgIFhTZXRGaWxsU3R5bGUgKHMtPmRpc3BsYXksIGdjLCBGaWxsT3BhcXVlU3Rp cHBsZWQpOworICAgICAgICAgICAgICBYRmlsbFJlY3RhbmdsZSAocy0+ZGlzcGxheSwgcy0+d2lu ZG93LCBnYywgeCwgeSwgdywgaCk7CisgICAgICAgICAgICAgIFhTZXRGaWxsU3R5bGUgKHMtPmRp c3BsYXksIGdjLCBGaWxsU29saWQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQor I2VuZGlmCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB3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isgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19JTlZF UlNFX1ZJREVPKQorICAgICAgeworICAgICAgICB3MzJfc2V0X21vZGVfbGluZV9mYWNlX2djIChz KTsKKyAgICAgICAgcy0+c3RpcHBsZWRfcCA9IHMtPmZhY2UtPnN0aXBwbGUgIT0gMDsKKyAgICAg IH0KKyAgICAgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgICAgICB7CisgICAg ICAgICAgbWNfdzMyX3NldF9jdXJzb3JfZ2MgKHMsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICBz LT5zdGlwcGxlZF9wID0gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocy0+aGwg PT0gRFJBV19NT1VTRV9GQUNFKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHczMl9zZXRfbW91 c2VfZmFjZV9nYyAocyk7CisgICAgICAgICAgICBzLT5zdGlwcGxlZF9wID0gcy0+ZmFjZS0+c3Rp cHBsZSAhPSAwOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChzLT5obCA9PSBEUkFX X0lNQUdFX1JBSVNFRAorICAgICAgICAgICAgICAgICAgIHx8IHMtPmhsID09IERSQVdfSU1BR0Vf U1VOS0VOKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzLT5nYyA9IHMtPmZhY2UtPmdj OworICAgICAgICAgICAgICBzLT5zdGlwcGxlZF9wID0gcy0+ZmFjZS0+c3RpcHBsZSAhPSAwOwor ICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBlbWFjc19hYm9y dCAoKTsKKyAgLyogR0MgbXVzdCBoYXZlIGJlZW4gc2V0LiAqLworICBlYXNzZXJ0IChzLT5nYyAh PSAwKTsKK30KKworLyogRHJhdyBhIGhvbGxvdyBib3ggY3Vyc29yIG9uIHdpbmRvdyBXIGluIGds eXBoIHJvdyBST1cuICovCitzdGF0aWMgdm9pZAorbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAo c3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgeCwgaW50IGZ4LCBp bnQgeSwgaW50IGZ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhwb3MsIGludCB2 cG9zLCBpbnQgd2QsIGludCBoKQoreworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRP V19GUkFNRSAodykpOworICBIREMgaGRjOworICBSRUNUIHJlY3Q7CisgIEhCUlVTSCBoYiA9IENy ZWF0ZVNvbGlkQnJ1c2ggKGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsKTsKKyAgLyog R2V0IHRoZSBnbHlwaCB0aGUgY3Vyc29yIGlzIG9uLiAgSWYgd2UgY2FuJ3QgdGVsbCBiZWNhdXNl CisgICAgIHRoZSBjdXJyZW50IG1hdHJpeCBpcyBpbnZhbGlkIG9yIHN1Y2gsIGdpdmUgdXAuICov CisgIHN0cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBoID0gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywg bWF0cml4LCByb3csIGhwb3MsIHZwb3MpOworICBpZiAoY3Vyc29yX2dseXBoID09IE5VTEwpCisg ICAgeworICAgICAgRGVsZXRlT2JqZWN0IChoYik7CisgICAgICByZXR1cm47CisgICAgfQorICBp bnQgcmwgPSBmeDsKKyAgaW50IHJ0ID0gZnk7CisgIGludCByciA9IHJsICsgd2Q7CisgIGludCBy YiA9IHJ0ICsgaDsKKyAgLy8gIGZwcmludGYgKHN0ZGVyciwgIk1DX0hPTExPV19CT1g6ICBybCAo JWQpIHwgcnQgKCVkKSB8IHJyICglZCkgfCByYiAoJWQpXG4iLAorICAvLyAgICAgICAgICAgICAg ICAgICBybCwgcnQsIHJyLCByYik7C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3RlbSBj YXJldCwgc28gdGhpcmQgcGFydHkgc29mdHdhcmUgbGlrZSBzY3JlZW4gbWFnbmlmaWVycworICAg ICAgYW5kIHNwZWVjaCBzeW50aGVzaXplcnMgY2FuIGZvbGxvdyB0aGUgY3Vyc29yLiAqLworICAg ICAgaWYgKGFjdGl2ZV9wKQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGZyYW1lICpmID0g WEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgICAgICAgICBIV05EIGh3bmQgPSBGUkFNRV9X MzJfV0lORE9XIChmKTsKKyAgICAgICAgICB3MzJfc3lzdGVtX2NhcmV0X3gKKyAgICAgICAgICAg ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICAgICAgICAgLyogRklY TUU6ICBXaGF0IHNob3VsZCB3ZSB1c2UgaW5zdGVhZCBvZiBgdy0+cGh5c19jdXJzb3JfYXNjZW50 Jz8gKi8KKyAgICAgICAgICB3MzJfc3lzdGVtX2NhcmV0X3kKKyAgICAgICAgICAgID0gKFdJTkRP V19UT19GUkFNRV9QSVhFTF9ZICh3LCB5KQorICAgICAgICAgICAgICAgKyByb3ctPmFzY2VudCAt IHctPnBoeXNfY3Vyc29yX2FzY2VudCk7CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJldF93aW5k b3cgPSB3OworICAgICAgICAgIHczMl9zeXN0ZW1fY2FyZXRfaGRyX2hlaWdodCA9IFdJTkRPV19I RUFERVJfTElORV9IRUlHSFQgKHcpOworICAgICAgICAgIHczMl9zeXN0ZW1fY2FyZXRfbW9kZV9o ZWlnaHQgPSBXSU5ET1dfTU9ERV9MSU5FX0hFSUdIVCAodyk7CisgICAgICAgICAgUG9zdE1lc3Nh Z2UgKGh3bmQsIFdNX0lNRV9TVEFSVENPTVBPU0lUSU9OLCAwLCAwKTsKKyAgICAgICAgICAvKiBJ ZiB0aGUgc2l6ZSBvZiB0aGUgYWN0aXZlIGN1cnNvciBjaGFuZ2VkLCBkZXN0cm95IHRoZSBvbGQK KyAgICAgICAgICAgICBzeXN0ZW0gY2FyZXQuICovCisgICAgICAgICAgaWYgKHczMl9zeXN0ZW1f Y2FyZXRfaHduZAorICAgICAgICAgICAgICAmJiAodzMyX3N5c3RlbV9jYXJldF9oZWlnaHQgIT0g aCkpCisgICAgICAgICAgICBQb3N0TWVzc2FnZSAoaHduZCwgV01fRU1BQ1NfREVTVFJPWV9DQVJF VCwgMCwgMCk7CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJldF9oZWlnaHQgPSBoOworICAgICAg ICAgIC8qIE1vdmUgdGhlIHN5c3RlbSBjYXJldC4gKi8KKyAgICAgICAgICBQb3N0TWVzc2FnZSAo aHduZCwgV01fRU1BQ1NfVFJBQ0tfQ0FSRVQsIDAsIDApOworICAgICAgICB9CisgICAgICAvKiBU aGUgZnJpbmdlIGJpdG1hcHMgYXJlIHByZXNlbnRseSBoYW5kbGVkIGVsc2V3aGVyZSwgYnV0IGNv dWxkIHNvbWVkYXkKKyAgICAgIGJlIG1hbmFnZWQgKGluIHBhcnQpIGF0IHRoaXMgc2VjdGlvbiBv ZiBjb2RlLiAqLworICAgICAgaWYgKHJvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAg ICAgICAgICYmIChyb3ctPnJldmVyc2VkX3AKKyAgICAgICAgICAgICA/IChocG9zIDwgMCkKKyAg ICAgICAgICAgICA6IChocG9zID49IHJvdy0+dXNlZFtURVhUX0FSRUFdKSkpCisgICAgICAgIHsK KyAgICAgICAgICByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9IHRydWU7CisgICAgICAgICAgbWNf ZHJhd19mcmluZ2VfYml0bWFwICh3LCByb3csIHJvdy0+cmV2ZXJzZWRfcCwgY3Vyc29yX3R5cGUp OworICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJB TUUgKFdJTkRPV19GUkFNRSAod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ICAgICAgICAgICAg ICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZV9pZCA9IGxvb2t1 cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItYXQtcmVnaW9u LXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xs b3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2 ZV9yZWdpb25fZW5kX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xs b3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1y ZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgIHN0 cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19h Y3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBo b2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgZ2NfdmFsdWVz LmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZS0+YmFja2dyb3VuZDsK KyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AK KyAgICAgICAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID4gcmVnaW9uX2JlZworICAgICAgICAgICAgICAg ICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNo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sX2N1cnNvcl9waXhlbDsK KyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChjdXJzb3JfZ2x5cGgtPnR5cGUgPT0gSU1BR0Vf R0xZUEggJiYgbHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDAp CisgICAgICAgICAgeworICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRw dXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0 YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgICAgbWNfdzMyX2Ry YXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBv cywgd2QsIGgpOworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwg PSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRw dXRfZGF0YS53MzItPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAgICAgICAgICAgICBm dW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHczMmZucy5jLiAqLworICAgICAgICAgICAg ICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAg ICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID09IHJlZ2lvbl9iZWcpCisg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19h Y3RpdmVfcmVnaW9uX2JlZ19mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY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va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtl LWN1cnNvci1hdC1yZWdpb24tcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAg ICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZSA9IEZBQ0VfRlJP TV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2VfaWQpOworICAgICAgICAgICAg ICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVk X2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0 cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFj ZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAg ICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVn cm91bmQ7CisgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gaG9sbG93 X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPiByZWdpb25fYmVnCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPCByZWdpb25fZW5kKQorICAgICAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19h Y3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBp bnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW4tcmVnaW9uLXByZS16di1mYWNlIiksIHRydWUp OworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lv bl9iZXR3ZWVuX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX2Jl dHdlZW5fZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxv d19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJl YWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAg ICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9s bG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuZm9y ZWdyb3VuZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAg ICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdl ZW5fZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICAgICAgICBlbHNlIGlmIChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0g bG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUt enYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpo b2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9p ZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxv d19hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGdjX3Zh bHVlcy5iYWNrZ3JvdW5kID0gaG9sbG93X2FjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kOworICAgICAg ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZl X3ApCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAg IGVudW0gZmFjZV9pZCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNl ICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtcHJlLXp2LWZhY2Ui KSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3df aW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQp OworICAgICAgICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxv d19pbmFjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICAgICAgICAgICAgICBn Y192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kOwor ICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53 MzItPmN1cnNvcl9nYyA9IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiksIG1h c2ssICZnY192YWx1ZXMpOworICAgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAg ICAgICAgLyogRm9yY2UgYG1jX3czMl9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1 dF9kYXRhLnczMi0+Y3Vyc29yX2djJy4gKi8KKyAgICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2Nf cCA9IHRydWU7CisgICAgICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgs IHJvdywgRFJBV19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVf cCwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNv cl9nYyA9IG9yaWdpbmFsX2N1cnNvcl9nYzsKKyAgICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAo KTsKKyAgICAgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCBy b3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgICAgfQorICAg ICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICB7CisgICAgICBp ZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAg ICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLncz Mi0+Y3Vyc29yX3BpeGVsJy4gKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNv cl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgIG1jX3czMl9kcmF3X2hvbGxvd19jdXJz b3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAg ICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNv cl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgbWNfdzMyX2RyYXdf aG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywg d2QsIGgpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAg ICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVl ID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91 dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgICAgZnVu Y3Rpb25hbGl0eSBvZiBgeF9tYWtlX2djJyBpbiB3MzJmbnMuYy4gKi8KKyAgICAgICAgICBibG9j a19pbnB1dCAoKTsKKyAgICAgICAgICBFbWFjc19HQyBnY192YWx1ZXM7CisgICAgICAgICAgdW5z aWduZWQgbG9uZyBtYXNrID0gR0NGb3JlZ3JvdW5kIHwgR0NCYWNrZ3JvdW5kOworICAgICAgICAg IGdjX3ZhbHVlcy5mb3JlZ3JvdW5kID0gRlJBTUVfQkFDS0dST1VORF9QSVhFTCAoZik7CisgICAg ICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYyA9IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJ TkRPVyAoZiksIG1hc2ssICZnY192YWx1ZXMpOworICAgICAgICAgIC8qIEZvcmNlIGBtY193MzJf c2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycu ICovCisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAgICAgICAgbWNfZHJh d19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBv cywgbHNsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIGN1 cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICBmLT5vdXRw dXRfZGF0YS53MzItPmN1cnNvcl9nYyA9IG9yaWdpbmFsX2N1cnNvcl9nYzsKKyAgICAgICAgICB1 bmJsb2NrX2lucHV0ICgpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7Cisg ICAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gZmFsc2U7CisgICAgICAgICAgICBtY19kcmF3 X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9zLCB2cG9z LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbCwgZ2x5cGhfZmxhdm9yLCBj dXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAg Y2FzZSBNQ19CQVI6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4g Pj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJp bHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICovCisgICAgICAg ICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAg ICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBt Y193MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9z LCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jf d2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYt Pm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOwor ICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1 cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAgICBtY193MzJfZHJh d19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3 ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwg TUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAg YnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfSEJBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJl ZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAg ICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29y X3BpeGVsJy4gKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9 IGNvbG9yX3BpeGVsOworICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3Ag PSB0cnVlOworICAgICAgICAgIG1jX3czMl9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93 LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9v a2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3Jp Z2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7 CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7Cisg ICAgICAgICAgICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngs IHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGgsIGN1cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3Ap OworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBkZWZhdWx0OgorICAgICAg ZW1hY3NfYWJvcnQgKCk7CisgIH0KKyAgICB9Cit9CisKKy8qIERyYXcgZ2x5cGggc3RyaW5nIFM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X3N0cmluZyAocyk7CisgICAgICBicmVhazsKKyAgICBjYXNlIFNUUkVU Q0hfR0xZUEg6CisgICAgICBtY193MzJfZHJhd19zdHJldGNoX2dseXBoX3N0cmluZyAocyk7Cisg ICAgICBicmVhazsKKyAgICBjYXNlIENIQVJfR0xZUEg6CisgICAgICBpZiAocy0+Zm9yX292ZXJs YXBzKQorICAgICAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gdHJ1ZTsKKyAgICAgIGVsc2UK KyAgICAgICAgdzMyX2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIGZhbHNlKTsKKyAg ICAgIHczMl9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJyZWFrOwor ICAgIGNhc2UgQ09NUE9TSVRFX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcyB8fCAo cy0+Y21wX2Zyb20gPiAwCisgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0 b21hdGljKSkKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBl bHNlCisgICAgICAgIHczMl9kcmF3X2dseXBoX3N0cmluZ19iYWNrZ3JvdW5kIChzLCB0cnVlKTsK KyAgICAgIHczMl9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7Cisg ICAgICBicmVhazsKKyAgICBjYXNlIEdMWVBITEVTU19HTFlQSDoKKyAgICAgIGlmIChzLT5mb3Jf b3ZlcmxhcHMpCisgICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAg ZWxzZQorICAgICAgICB3MzJfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgZmFsc2Up OworICAgICAgdzMyX2RyYXdfZ2x5cGhsZXNzX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsK KyAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgICB9 CisgIGlmICghcy0+Zm9yX292ZXJsYXBzKQorICAgIHsKKyAgICAgIC8qIERyYXcgdW5kZXJsaW5l LiAqLworICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9wKQorICAgICAgICB7CisgICAgICAg ICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgQ09MT1JSRUYgY29sb3I7CisgICAgICAgICAgICAgIGlm IChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgICAgY29sb3Ig PSBzLT5nYy0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAg ICAgICBjb2xvciA9IHMtPmZhY2UtPnVuZGVybGluZV9jb2xvcjsKKyAgICAgICAgICAgICAgdzMy X2RyYXdfdW5kZXJ3YXZlIChzLCBjb2xvcik7CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxz ZSBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247 CisgICAgICAgICAgICAgIGludCB5OworICAgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5w cmV2LT5mYWNlLT51bmRlcmxpbmVfcAorICAgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+ZmFj ZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgIC8qIFdlIHVzZSB0aGUgc2FtZSB1bmRlcmxpbmUgc3R5bGUgYXMg dGhlIHByZXZpb3VzIG9uZS4gKi8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPnBy ZXYtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMt PnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhl IHVuZGVybGluZSB0aGlja25lc3MuICBEZWZhdWx0IGlzIDEgcGl4ZWwuICovCisgICAgICAgICAg ICAgICAgICBpZiAocy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkK KyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNr bmVzczsKKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgIHRo aWNrbmVzcyA9IDE7CisgICAgICAgICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2Vu dF9saW5lKQorICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSB0aGlj a25lc3MpIC0gKHMtPnliYXNlIC0gcy0+eSk7CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhl IHVuZGVybGluZSBwb3NpdGlvbi4gIFRoaXMgaXMgdGhlIHJlY29tbWVuZGVkCisgICAgICAgICAg ICAgICAgICAgICAgICAgICB2ZXJ0aWNhbCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20gdGhlIGJhc2Vs aW5lIHRvIHRoZSB0b3Agb2YKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSB1bmRlcmxp bmUuICBUaGlzIGlzIGEgc2lnbmVkIHZhbHVlIGFjY29yZGluZyB0byB0aGUKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgIHNwZWNzLCBhbmQgaXRzIGRlZmF1bHQgaXMKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgIFJPVU5EICgobWF4aW11bV9kZXNjZW50KSAvIDIpLCB3aXRoCisgICAgICAg ICAgICAgICAgICAgICAgICAgICBST1VORCAoeCkgPSBmbG9vciAoeCArIDAuNSkgICovCisgICAg ICAgICAgICAgICAgICAgICAgICBpZiAoeF91c2VfdW5kZXJsaW5lX3Bvc2l0aW9uX3Byb3BlcnRp ZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzLT5mb250ICYmIHMtPmZvbnQtPnVu ZGVybGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlv biA9IHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgICAg IGVsc2UgaWYgKHMtPmZvbnQpCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0g KHMtPmZvbnQtPmRlc2NlbnQgKyAxKSAvIDI7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICAgICAgcG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWluaW11 bV9vZmZzZXQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyogQ2hlY2sgdGhl IHNhbml0eSBvZiB0aGlja25lc3MgYW5kIHBvc2l0aW9uLiAgV2Ugc2hvdWxkCisgICAgICAgICAg ICAgICAgIGF2b2lkIGRyYXdpbmcgdW5kZXJsaW5lIG91dCBvZiB0aGUgY3VycmVudCBsaW5lIGFy ZWEuICovCisgICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDw9IHMtPnliYXNlICsg cG9zaXRpb24pCisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gMSkgLSAo cy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPCBz LT55YmFzZSArIHBvc2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAgICAgIHRoaWNrbmVz cyA9IChzLT55ICsgcy0+aGVpZ2h0KSAtIChzLT55YmFzZSArIHBvc2l0aW9uKTsKKyAgICAgICAg ICAgICAgcy0+dW5kZXJsaW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAgICAg cy0+dW5kZXJsaW5lX3Bvc2l0aW9uID1wb3NpdGlvbjsKKyAgICAgICAgICAgICAgeSA9IHMtPnli YXNlICsgcG9zaXRpb247CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVm YXVsdGVkX3ApCisgICAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBz LT5nYy0+Zm9yZWdyb3VuZCwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5 LCBzLT53aWR0aCwgMSk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAg dzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3IsIHMt PngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5LCBzLT53aWR0aCwgMSk7Cisg ICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgb3ZlcmxpbmUuICovCisgICAg ICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfcCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVk IGxvbmcgZHkgPSAwLCBoID0gMTsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfY29s b3JfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMs IHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+ eSArIGR5LCBzLT53aWR0aCwgaCk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHcz Ml9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFjZS0+b3ZlcmxpbmVfY29sb3IsIHMtPngs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOwor ICAgICAgICB9CisgICAgICAvKiBEcmF3IHN0cmlrZS10aHJvdWdoLiAqLworICAgICAgaWYgKHMt PmZhY2UtPnN0cmlrZV90aHJvdWdoX3AKKyAgICAgICAgICAmJiAhRk9OVF9URVhUTUVUUklDIChz LT5mb250KS50bVN0cnVja091dCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcg aCA9IDE7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBkeSA9IChzLT5oZWlnaHQgLSBoKSAvIDI7 CisgICAgICAgICAgaWYgKHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX2NvbG9yX2RlZmF1bHRlZF9w KQorICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5nYy0+Zm9yZWdy b3VuZCwgcy0+eCwgcy0+eSArIGR5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+d2lk dGgsIGgpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChz LT5mLCBzLT5oZGMsIHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX2NvbG9yLCBzLT54LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAg fQorICAgICAgLyogRHJhdyByZWxpZWYgaWYgbm90IHlldCBkcmF3bi4gKi8KKyAgICAgIGlmICgh cmVsaWVmX2RyYXduX3AgJiYgcy0+ZmFjZS0+Ym94ICE9IEZBQ0VfTk9fQk9YKQorICAgICAgICB3 MzJfZHJhd19nbHlwaF9zdHJpbmdfYm94IChzKTsKKyAgICAgIGlmIChzLT5wcmV2KQorICAgICAg ICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqcHJldjsKKyAgICAgICAgICBmb3Ig KHByZXYgPSBzLT5wcmV2OyBwcmV2OyBwcmV2ID0gcHJldi0+cHJldikKKyAgICAgICAgICAgIGlm IChwcmV2LT5obCAhPSBzLT5obAorICAgICAgICAgICAgICAgICYmIHByZXYtPnggKyBwcmV2LT53 aWR0aCArIHByZXYtPnJpZ2h0X292ZXJoYW5nID4gcy0+eCkKKyAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgIC8qIEFzIHByZXYgd2FzIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8gaXRzIG93 biBhcmVhLCB3ZQorICAgICAgICAgICAgICAgICAgIG11c3QgZHJhdyB0aGUgcmlnaHRfb3Zlcmhh bmcgcGFydCB1c2luZyBzLT5obCBub3cuICovCisgICAgICAgICAgICAgICAgZW51bSBkcmF3X2ds eXBoc19mYWNlIHNhdmUgPSBwcmV2LT5obDsKKyAgICAgICAgICAgICAgICBwcmV2LT5obCA9IHMt PmhsOworICAgICAgICAgICAgICAgIG1jX3czMl9zZXRfZ2x5cGhfc3RyaW5nX2djIChwcmV2LCBj dXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAgICAgdzMyX3NldF9nbHlwaF9zdHJpbmdfY2xpcHBp bmdfZXhhY3RseSAocywgcHJldik7CisgICAgICAgICAgICAgICAgaWYgKHByZXYtPmZpcnN0X2ds eXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB3MzJfZHJhd19nbHlw aF9zdHJpbmdfZm9yZWdyb3VuZCAocHJldik7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgICAgICAgIHczMl9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3Vu ZCAocHJldik7CisgICAgICAgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAocHJldi0+ aGRjLCBOVUxMKTsKKyAgICAgICAgICAgICAgICBwcmV2LT5obCA9IHNhdmU7CisgICAgICAgICAg ICAgICAgcHJldi0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgICBpZiAocy0+bmV4dCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJp bmcgKm5leHQ7CisgICAgICAgICAgZm9yIChuZXh0ID0gcy0+bmV4dDsgbmV4dDsgbmV4dCA9IG5l eHQtPm5leHQpCisgICAgICAgICAgICBpZiAobmV4dC0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAg ICAgICAmJiBuZXh0LT54IC0gbmV4dC0+bGVmdF9vdmVyaGFuZyA8IHMtPnggKyBzLT53aWR0aCkK KyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEFzIG5leHQgd2lsbCBiZSBkcmF3 biB3aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwKKyAgICAgICAgICAgICAgICAgICB3ZSBt dXN0IGRyYXcgdGhlIGxlZnRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICovCisgICAg ICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIHNhdmUgPSBuZXh0LT5obDsKKyAgICAg ICAgICAgICAgICBuZXh0LT5obCA9IHMtPmhsOworICAgICAgICAgICAgICAgIG1jX3czMl9zZXRf Z2x5cGhfc3RyaW5nX2djIChuZXh0LCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAgICAgdzMy X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgbmV4dCk7CisgICAgICAgICAg ICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAg ICAgICAgICAgICB3MzJfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7CisgICAg ICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHczMl9kcmF3X2NvbXBvc2l0 ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAgICAgICAgdzMyX3Nl dF9jbGlwX3JlY3RhbmdsZSAobmV4dC0+aGRjLCBOVUxMKTsKKyAgICAgICAgICAgICAgICBuZXh0 LT5obCA9IHNhdmU7CisgICAgICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAgICAg ICAgICAgICAgICBuZXh0LT5jbGlwX2hlYWQgPSBzLT5uZXh0OworICAgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICB9CisgIC8qIFJlc2V0IGNsaXBwaW5nLiAqLworICB3MzJfc2V0X2NsaXBf cmVjdGFuZ2xlIChzLT5oZGMsIE5VTEwpOworICBzLT5udW1fY2xpcHMgPSAwOworfQorCisvKiBl bmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyog RnJpbmdlIGJpdG1hcHMuICAqLwogCiBzdGF0aWMgaW50IG1heF9mcmluZ2VfYm1wID0gMDsKQEAg LTU0Miw2ICsxNzAxLDE1IEBAIHczMl91cGRhdGVfYmVnaW4gKHN0cnVjdCBmcmFtZSAqZikKICAg aWYgKCEgRlJBTUVfVzMyX1AgKGYpKQogICAgIHJldHVybjsKIAorCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFt ZSA9IGY7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogUmVnZW5lcmF0ZSBk aXNwbGF5IHBhbGV0dGUgYmVmb3JlIGRyYXdpbmcgaWYgbGlzdCBvZiByZXF1ZXN0ZWQKICAgICAg Y29sb3JzIGhhcyBjaGFuZ2VkLiAqLwogICBpZiAoZGlzcGxheV9pbmZvLT5yZWdlbl9wYWxldHRl KQpAQCAtNjc0LDYgKzE4NDIsMTYgQEAgdzMyX3VwZGF0ZV9lbmQgKHN0cnVjdCBmcmFtZSAqZikK IAogICAvKiBNb3VzZSBoaWdobGlnaHQgbWF5IGJlIGRpc3BsYXllZCBhZ2Fpbi4gICovCiAgIE1P VVNFX0hMX0lORk8gKGYpLT5tb3VzZV9mYWNlX2RlZmVyID0gZmFsc2U7CisKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRp bmdfZnJhbWUgPSBOVUxMOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIApA QCAtNDAwMiwxMyArNTE4MCw3NCBAQCB3MzJfc2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHN0cnVj dCB3aW5kb3cgKncsCiAJICAgICAgcmVsZWFzZV9mcmFtZV9kYyAoZiwgaGRjKTsKIAkgICAgICB3 MzJfY2xlYXJfdW5kZXJfaW50ZXJuYWxfYm9yZGVyIChmKTsKIAkgICAgfQorCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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QgPD0gYmFyLT5sZWZ0KQorICAgICAgICAgICAgbXlfc2hvd193aW5kb3cgKGYsIGh3bmQs IFNXX0hJREUpOworICAgICAgICAgIE1vdmVXaW5kb3cgKGh3bmQsIGxlZnQsIHRvcCwgd2lkdGgs IG1heCAoaGVpZ2h0LCAxKSwgbGVmdCA8PSBiYXItPmxlZnQpOworCisvKiBlbmQgTVVMVElQTEUt Q1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKIAogCSAgc2kuY2JTaXplID0g c2l6ZW9mIChzaSk7CiAJICBzaS5mTWFzayA9IFNJRl9SQU5HRTsKQEAgLTQyNzcsNiArNTUxNiwy MSBAQCB3MzJfanVkZ2Vfc2Nyb2xsX2JhcnMgKHN0cnVjdCBmcmFtZSAqZikKICAgICB7CiAgICAg ICBzdHJ1Y3Qgc2Nyb2xsX2JhciAqYiA9IFhTQ1JPTExfQkFSIChiYXIpOwogCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICAvKiBgRGVz dHJveVdpbmRvdycgd2l0aGluIGB4X3Njcm9sbF9iYXJfcmVtb3ZlJyByZXBhaW50cyB0aGUgcmVj dGFuZ2xlLgorICAgICAgVGhlcmVmb3JlLCB3ZSBmaXJzdCBzZW5kIGEgbWVzc2FnZSB0byBpbmhp Yml0IHJlcGFpbnRpbmcuICovCisgICAgICBpZiAoIVdJTkRPV19MSVZFX1AgKGItPndpbmRvdykp CisgICAgICAgIHsKKyAgICAgICAgICBIV05EIGh3bmQgPSBTQ1JPTExfQkFSX1czMl9XSU5ET1cg KGIpOworICAgICAgICAgIFNlbmRNZXNzYWdlIChod25kLCBXTV9TRVRSRURSQVcsIGZhbHNlLCAw KTsKKyAgICAgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICB3MzJf c2Nyb2xsX2Jhcl9yZW1vdmUgKGIpOwogCiAgICAgICBuZXh0ID0gYi0+bmV4dDsKQEAgLTcwODgs NiArODM0MiwyMCBAQCBleHRlcm4gZnJhbWVfcGFybV9oYW5kbGVyIHczMl9mcmFtZV9wYXJtX2hh bmRsZXJzW107CiAKIHN0YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSB3MzJfcmVkaXNw bGF5X2ludGVyZmFjZSA9CiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgdzMydGVybS5j YCBtdXN0IGJlIGluIHRoZSBleGFjdCBzYW1lIG9yZGVyIGFzIHRoZQorYHJlZGlzcGxheV9pbnRl cmZhY2UnIGluIGBkaXNwZXh0ZXJuLmhgISAqLworCisgIG1jX3czMl9kcmF3X3dpbmRvd19jdXJz b3IsCisgIG1jX3czMl9kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICB3MzJfZnJhbWVfcGFybV9oYW5kbGVycywKICAgZ3VpX3Byb2R1Y2VfZ2x5cGhz LAogICBndWlfd3JpdGVfZ2x5cGhzLApkaWZmIC0tZ2l0IGEvc3JjL3dpbmRvdy5oIGIvc3JjL3dp bmRvdy5oCmluZGV4IDZiMGYwZTUuLjE0ZGQzOGEgMTAwNjQ0Ci0tLSBhL3NyYy93aW5kb3cuaAor KysgYi9zcmMvd2luZG93LmgKQEAgLTMyNCw2ICszMjQsMTQ3IEBAIHN0cnVjdCB3aW5kb3cKIAog I2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBTdWZmaXhlcyBmb3IgdGhlIGBtY2Ag d2luZG93IHBvaW50ZXIgcHJlZml4LiAqLworc3RydWN0IG11bHRpcGxlX2N1cnNvcnMKK3sKKyAg LyogVGhlIHJlY29yZGVkIHBpeGVsIHdpZHRoIG9mIHRoZSBsYXN0IGxpbmUgbnVtYmVyIGRyYXdu IGR1cmluZyByZWRpc3BsYXkgKi8KKyAgaW50IGxudW1fcGl4ZWxfd2lkdGg7Cit9IG1jOworCitz dHJ1Y3QgbWNfbWF0cml4Cit7CisgIHB0cmRpZmZfdCB2cG9zX2FsbG9jYXRlZDsKKyAgcHRyZGlm Zl90IHZwb3NfdXNlZDsKKyAgcHRyZGlmZl90IGN1cnNvcnNfdXNlZFs0XTsKKyAgZW51bSBtY19j YWNoZV90eXBlCisgIHsKKyAgICBNQ19DQUNIRSwKKyAgICBDSF9DQUNIRSwKKyAgICBGQ19DQUNI RSwKKyAgICBOT19DQUNIRQorICB9IGNhY2hlX3R5cGU7CisgIHN0cnVjdCBtY192cG9zCisgIHsK KyAgICBwdHJkaWZmX3QgY2FjaGVfYWxsb2NhdGVkWzRdOworICAgIHB0cmRpZmZfdCBjYWNoZV91 c2VkWzRdOworICAgIHN0cnVjdCBtY19jb250ZW50cworICAgIHsKKyAgICAgIGJvb2xfYmYgc2Ft ZV9wIDogMTsKKyAgICAgIHN0cnVjdCBnbHlwaCBnbHlwaDsKKyAgICAgIGludCB4OworICAgICAg aW50IGZ4OworICAgICAgaW50IHk7CisgICAgICBpbnQgZnk7CisgICAgICBpbnQgaHBvczsKKyAg ICAgIGludCB2cG9zOworICAgICAgaW50IHdkOworICAgICAgaW50IGg7CisgICAgICBlbnVtIG1j X2N1cnNvcl90eXBlCisgICAgICB7CisgICAgICAgIC8qIE5PVEU6ICBUaGUgZnJpbmdlIGJpdG1h cCBmcmFtZXdvcmsgcmVsaWVzIHVwb24gTUNfTk9fRlJJTkdFX0JJVE1BUAorICAgICAgICBoYXZp bmcgYSB2YWx1ZSBvZiB6ZXJvICgwKS4gKi8KKyAgICAgICAgTUNfTk9fRlJJTkdFX0JJVE1BUCwK KyAgICAgICAgTUNfTk9fQ1VSU09SLAorICAgICAgICBNQ19SSUdIVF9GUklOR0VfQklUTUFQLAor ICAgICAgICBNQ19MRUZUX0ZSSU5HRV9CSVRNQVAsCisgICAgICAgIE1DX0ZSQU1FRF9CT1gsCisg ICAgICAgIE1DX0ZJTExFRF9CT1gsCisgICAgICAgIE1DX0hPTExPV19CT1gsCisgICAgICAgIE1D X0JBUiwKKyAgICAgICAgTUNfSEJBUgorICAgICAgfSBjdXJzb3JfdHlwZTsKKyAgICAgIGludCBj dXJzb3Jfd2lkdGg7CisgICAgICBzdHJ1Y3QgbWNfUkdCCisgICAgICB7CisgICAgICAgIGRvdWJs ZSByZWQ7CisgICAgICAgIGRvdWJsZSBncmVlbjsKKyAgICAgICAgZG91YmxlIGJsdWU7CisgICAg ICB9IGZnLCBiZzsKKyAgICAgIGJvb2xfYmYgYWN0aXZlX3AgOiAxOworICAgICAgZW51bSBtY19m bGF2b3IKKyAgICAgIHsKKyAgICAgICAgTk9fRkxBVk9SLAorICAgICAgICBNQ19HTFlQSCwKKyAg ICAgICAgTUNfR0xZUEhMRVNTLAorICAgICAgICBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUCwKKyAg ICAgICAgTUNfUElMQ1JPVywKKyAgICAgICAgTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJP VywKKyAgICAgICAgTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJP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ZQorICB7CisgICAgVFJZX1dJTkRPV19SRVVTSU5H X0NVUlJFTlRfTUFUUklYX0RPV04sCisgICAgVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFU UklYX1VQLAorICAgIFRSWV9XSU5ET1dfSUQKKyAgfSBtY19wcmVfc2Nyb2xsX2NsZWFuX3R5cGVf X2Zyb21fd2hlcmU7CisgIC8qIFVzZWQgZWxzZXdoZXJlLiAqLworICBlbnVtIG1jX2RyYXdfcm93 X3R5cGUKKyAgeworICAgIE5PV0hFUkUsCisgICAgU0NSSUJFX09ORSwKKyAgICBTQ1JJQkVfVFdP LAorICAgIFNDUklCRV9USFJFRSwKKyAgICBTS0lQUEVELAorICAgIFBPU1RfQ0hBTkdFRCwKKyAg ICBVTkNIQU5HRUQsCisgICAgU0VUX0NVUlNPUl9PTkUsCisgICAgU0VUX0NVUlNPUl9UV08KKyAg fSBtY19kcmF3X3Jvd190eXBlX19mcm9tX3doZXJlOworICAvKiBVc2VkIGVsc2V3aGVyZS4gKi8K KyAgZW51bSBtY19yZWRyYXdfcm93X3R5cGUKKyAgeworICAgIFVQREFURV9XSU5ET1dfX1JFRFJB V19PVkVSTEFQUEVEX1JPV1MsCisgICAgR1VJX0lOU0VSVF9HTFlQSFMsCisgICAgR1VJX0ZJWF9P VkVSTEFQUElOR19BUkVBLAorICAgIERSQVdfUk9XX1dJVEhfTU9VU0VfRkFDRSwKKyAgICBFWFBP U0VfQVJFQV9PTkUsCisgICAgRVhQT1NFX0FSRUFfVFdPLAorICAgIEVYUE9TRV9MSU5FCisgIH0g bWNfcmVkcmF3X3Jvd190eXBlX19mcm9tX3doZXJlOworfSBtY19tYXRyaXg7CisKKy8qIGVuZCBN VUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgLyog Q3Vyc29yIHR5cGUgb2YgbGF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WN0IGFyZywgLi4uKQoreworICBlYXNzdW1lICgwIDwgY291bnQpOworICBM aXNwX09iamVjdCB2YWwgPSBGY29ucyAoYXJnLCBRbmlsKTsKKyAgTGlzcF9PYmplY3QgdGFpbCA9 IHZhbDsKKyAgdmFfbGlzdCBhcDsKKyAgdmFfc3RhcnQgKGFwLCBhcmcpOworICBmb3IgKHB0cmRp ZmZfdCBpID0gMTsgaSA8IGNvdW50OyBpKyspCisgICAgeworICAgICAgTGlzcF9PYmplY3QgZWxl bSA9IEZjb25zICh2YV9hcmcgKGFwLCBMaXNwX09iamVjdCksIFFuaWwpOworICAgICAgWFNFVENE UiAodGFpbCwgZWxlbSk7CisgICAgICB0YWlsID0gZWxlbTsKKyAgICB9CisgIHZhX2VuZCAoYXAp OworICByZXR1cm4gdmFsOworfQorCitMaXNwX09iamVjdAorbWNfbWVtcSAoTGlzcF9PYmplY3Qg ZWx0LCBMaXNwX09iamVjdCBsaXN0KQoreworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBpZiAo IUNPTlNQIChsaXN0KSB8fCBFUSAoWENBUiAobGlzdCksIGVsdCkpCisgICAgICAgIGJyZWFrOwor ICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkgfHwgRVEg KFhDQVIgKGxpc3QpLCBlbHQpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChs aXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpIHx8IEVRIChYQ0FSIChsaXN0KSwgZWx0KSkK KyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgfQorICByZXR1 cm4gbGlzdDsKK30KKworTGlzcF9PYmplY3QKK21jX250aCAoaW50IG51bSwgTGlzcF9PYmplY3Qg bGlzdCkKK3sKKyAgZm9yIChpbnQgaSA9IDA7IGkgPCBudW0gJiYgIU5JTFAgKGxpc3QpOyBpKysp CisgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICBpZiAoQ09OU1AgKGxpc3QpKQorICAgIHJldHVy biBYQ0FSIChsaXN0KTsKKyAgICBlbHNlCisgICAgICByZXR1cm4gUW5pbDsKK30KKworTGlzcF9P YmplY3QKK21jX2Fzc3EgKExpc3BfT2JqZWN0IGtleSwgTGlzcF9PYmplY3QgbGlzdCkKK3sKKyAg d2hpbGUgKDEpCisgICAgeworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAo Q09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlz dCkpLCBrZXkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7Cisg ICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkp CisgICAgICAgICAgICAgICYmIEVRIChYQ0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAgICAg ICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxp c3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYg RVEgKFhDQVIgKFhDQVIgKGxpc3QpKSwga2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlz dCA9IFhDRFIgKGxpc3QpOworICAgIH0KKyAgaWYgKENPTlNQIChsaXN0KSkKKyAgICByZXR1cm4g WENBUiAobGlzdCk7CisgICAgZWxzZQorICAgICAgcmV0dXJuIFFuaWw7Cit9CisKK0xpc3BfT2Jq ZWN0CittY19hc3NvYyAoTGlzcF9PYmplY3Qga2V5LCBMaXNwX09iamVjdCBsaXN0KQoreworICBM aXNwX09iamVjdCBjYXI7CisgIHdoaWxlICgxKQorICAgIHsKKyAgICAgIGlmICghQ09OU1AgKGxp c3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYg KGNhciA9IFhDQVIgKFhDQVIgKGxpc3QpKSwKKyAgICAgICAgICAgICAgICAgIEVRIChjYXIsIGtl eSkgfHwgIU5JTFAgKEZlcXVhbCAoY2FyLCBrZXkpKSkpKQorICAgICAgICBicmVhazsKKyAgICAg IGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAg fHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgKGNhciA9IFhDQVIgKFhD QVIgKGxpc3QpKSwKKyAgICAgICAgICAgICAgICAgIEVRIChjYXIsIGtleSkgfHwgIU5JTFAgKEZl cXVhbCAoY2FyLCBrZXkpKSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChs aXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FS IChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgKGNhciA9IFhDQVIgKFhDQVIgKGxpc3QpKSwKKyAg ICAgICAgICAgICAgICAgIEVRIChjYXIsIGtleSkgfHwgIU5JTFAgKEZlcXVhbCAoY2FyLCBrZXkp KSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICB9Cisg IGlmIChDT05TUCAobGlzdCkpCisgICAgcmV0dXJuIFhDQVIgKGxpc3QpOworICAgIGVsc2UKKyAg ICAgIHJldHVybiBRbmlsOworfQorCitMaXNwX09iamVjdAorbWNfcGxpc3RfZ2V0IChMaXNwX09i amVjdCBwbGlzdCwgTGlzcF9PYmplY3QgcHJvcCkKK3sKKyAgTGlzcF9PYmplY3QgdGFpbCwgaGFs ZnRhaWw7CisgIC8qIGhhbGZ0YWlsIGlzIHVzZWQgdG8gZGV0ZWN0IGNpcmN1bGFyIGxpc3RzLiAg Ki8KKyAgdGFpbCA9IGhhbGZ0YWlsID0gcGxpc3Q7CisgIHdoaWxlIChDT05TUCAodGFpbCkgJiYg Q09OU1AgKFhDRFIgKHRhaWwpKSkKKyAgICB7CisgICAgICBpZiAoRVEgKHByb3AsIFhDQVIgKHRh aWwpKSkKKyAgICAgICAgcmV0dXJuIFhDQVIgKFhDRFIgKHRhaWwpKTsKKyAgICAgIHRhaWwgPSBY Q0RSIChYQ0RSICh0YWlsKSk7CisgICAgICBoYWxmdGFpbCA9IFhDRFIgKGhhbGZ0YWlsKTsKKyAg ICAgIGlmIChFUSAodGFpbCwgaGFsZnRhaWwpKQorICAgICAgICBicmVhazsKKyAgICB9CisgIHJl dHVybiBRbmlsOworfQorCisvKiBSRUdJT04gQkVHSU46ICBtY19yZWdpb25fbGltaXQgKDEpCisg ICBSRUdJT04gRU5EOiAgbWNfcmVnaW9uX2xpbWl0ICgwKSAqLworcHRyZGlmZl90CittY19yZWdp b25fbGltaXQgKGJvb2wgYmVnaW5fcCkKK3sKKyAgaWYgKCFOSUxQIChWdHJhbnNpZW50X21hcmtf bW9kZSkKKyAgICAgICYmIE5JTFAgKFZtYXJrX2V2ZW5faWZfaW5hY3RpdmUpCisgICAgICAmJiBO SUxQIChCVkFSIChjdXJyZW50X2J1ZmZlciwgbWFya19hY3RpdmUpKSkKKyAgICB4c2lnbmFsMCAo UW1hcmtfaW5hY3RpdmUpOworICBMaXNwX09iamVjdCBtYXJrZXIgPSBCVkFSIChjdXJyZW50X2J1 ZmZlciwgbWFyayk7CisgIGludCBtID0gKFhNQVJLRVIgKG1hcmtlciktPmJ1ZmZlcikKKyAgICAg ICAgICA/IFhNQVJLRVIgKG1hcmtlciktPmNoYXJwb3MKKyAgICAgICAgICA6IC0xOworICByZXR1 cm4gKG0gPT0gLTEpCisgICAgICAgICAgID8gLTEKKyAgICAgICAgIDogKFBUIDwgbSkgPT0gYmVn aW5fcAorICAgICAgICAgICA/IFBUCisgICAgICAgICA6IGNsaXBfdG9fYm91bmRzIChCRUdWLCBt LCBaVik7Cit9CisKKy8qIENoZWNrIHRoZSBwcmVzZW5jZSBvZiBhIGRpc3BsYXkgcHJvcGVydHkg YW5kIGNvbXB1dGUgaXRzIHdpZHRoLgorICAgSWYgYSBwcm9wZXJ0eSB3YXMgZm91bmQgYW5kIGl0 cyB3aWR0aCB3YXMgZm91bmQgYXMgd2VsbCwgcmV0dXJuCisgICBpdHMgd2lkdGggKD49IDApIGFu ZCBzZXQgdGhlIHBvc2l0aW9uIG9mIHRoZSBlbmQgb2YgdGhlIHByb3BlcnR5CisgICBpbiBFTkRQ T1MuCisgICBPdGhlcndpc2UganVzdCByZXR1cm4gLTEuICovCitzdGF0aWMgaW50CittY19jaGVj a19kaXNwbGF5X3dpZHRoIChwdHJkaWZmX3QgcG9zLCBwdHJkaWZmX3QgY29sLCBwdHJkaWZmX3Qg KmVuZHBvcykKK3sKKyAgTGlzcF9PYmplY3QgdmFsLCBvdmVybGF5OworICBpZiAoQ09OU1AgKHZh bCA9IGdldF9jaGFyX3Byb3BlcnR5X2FuZF9vdmVybGF5CisgICAgICAgICAgICAgIChtYWtlX2Zp eG51bSAocG9zKSwgUWRpc3BsYXksIFFuaWwsICZvdmVybGF5KSkKKyAgICAgICYmIEVRIChRc3Bh Y2UsIFhDQVIgKHZhbCkpKQorICAgIHsgLyogRklYTUU6IFVzZSBjYWxjX3BpeGVsX3dpZHRoX29y X2hlaWdodC4gKi8KKyAgICAgIExpc3BfT2JqZWN0IHBsaXN0ID0gWENEUiAodmFsKSwgcHJvcDsK KyAgICAgIGludCB3aWR0aCA9IC0xOworICAgICAgRU1BQ1NfSU5UIGFsaWduX3RvX21heCA9IChj b2wgPCBNT1NUX1BPU0lUSVZFX0ZJWE5VTSAtIElOVF9NQVgKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gKEVNQUNTX0lOVCkgSU5UX01BWCArIGNvbAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBNT1NUX1BPU0lUSVZFX0ZJWE5VTSk7CisgICAgICBpZiAoKHBy b3AgPSBtY19wbGlzdF9nZXQgKHBsaXN0LCBRQ3dpZHRoKSwgUkFOR0VEX0ZJWE5VTVAgKDAsIHBy b3AsIElOVF9NQVgpKQorICAgICAgICAgIHx8IChwcm9wID0gbWNfcGxpc3RfZ2V0IChwbGlzdCwg UUNyZWxhdGl2ZV93aWR0aCksCisgICAgICAgICAgICAgIFJBTkdFRF9GSVhOVU1QICgwLCBwcm9w LCBJTlRfTUFYKSkpCisgICAgICAgIHdpZHRoID0gWEZJWE5VTSAocHJvcCk7CisgICAgICAgIGVs c2UgaWYgKEZMT0FUUCAocHJvcCkgJiYgMCA8PSBYRkxPQVRfREFUQSAocHJvcCkKKyAgICAgICAg ICAgICAgICAgJiYgWEZMT0FUX0RBVEEgKHByb3ApIDw9IElOVF9NQVgpCisgICAgICAgICAgd2lk dGggPSAoaW50KShYRkxPQVRfREFUQSAocHJvcCkgKyAwLjUpOworICAgICAgICAgIGVsc2UgaWYg KChwcm9wID0gbWNfcGxpc3RfZ2V0IChwbGlzdCwgUUNhbGlnbl90byksCisgICAgICAgICAgICAg ICAgICAgIFJBTkdFRF9GSVhOVU1QIChjb2wsIHByb3AsIGFsaWduX3RvX21heCkpKQorICAgICAg ICAgICAgd2lkdGggPSBYRklYTlVNIChwcm9wKSAtIGNvbDsKKyAgICAgICAgICAgICAgZWxzZSBp ZiAoRkxPQVRQIChwcm9wKSAmJiBjb2wgPD0gWEZMT0FUX0RBVEEgKHByb3ApCisgICAgICAgICAg ICAgICAgICAgICAgICYmIChYRkxPQVRfREFUQSAocHJvcCkgPD0gYWxpZ25fdG9fbWF4KSkKKyAg ICAgICAgICAgICAgICB3aWR0aCA9IChpbnQpKFhGTE9BVF9EQVRBIChwcm9wKSArIDAuNSkgLSBj b2w7CisgICAgICBpZiAod2lkdGggPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIHB0cmRpZmZf dCBzdGFydDsKKyAgICAgICAgICBp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yAgcmUgPSBBUkVGIChydWxlLCAwKTsKKyAgaWYgKE5JTFAgKHJlKSkKKyAg ICBsZW4gPSAxOworICBlbHNlIGlmICghIFNUUklOR1AgKHJlKSkKKyAgICByZXR1cm4gdW5iaW5k X3RvIChjb3VudCwgUW5pbCk7CisgIGVsc2UgaWYgKChsZW4gPSBmYXN0X2xvb2tpbmdfYXQgKHJl LCBjaGFycG9zLCBieXRlcG9zLCBsaW1pdCwgLTEsIHN0cmluZykpCisgICAgICAgICAgID4gMCkK KyAgICB7CisgICAgICBpZiAoTklMUCAoc3RyaW5nKSkKKyAgICAgICAgbGVuID0gQllURV9UT19D SEFSIChieXRlcG9zICsgbGVuKSAtIGNoYXJwb3M7CisgICAgICBlbHNlCisgICAgICAgIGxlbiA9 IHN0cmluZ19ieXRlX3RvX2NoYXIgKHN0cmluZywgYnl0ZXBvcyArIGxlbikgLSBjaGFycG9zOwor ICAgIH0KKyAgaWYgKGxlbiA8PSAwKQorICAgIHJldHVybiB1bmJpbmRfdG8gKGNvdW50LCBRbmls KTsKKyAgdG8gPSBsaW1pdCA9IGNoYXJwb3MgKyBsZW47CisjaWZkZWYgSEFWRV9XSU5ET1dfU1lT VEVNCisgIGlmIChGUkFNRV9XSU5ET1dfUCAoZikpCisgICAgeworICAgICAgZm9udF9vYmplY3Qg PSBmb250X3JhbmdlIChjaGFycG9zLCBieXRlcG9zLCAmdG8sIHdpbiwgZmFjZSwgc3RyaW5nKTsK KyAgICAgIGlmICghIEZPTlRfT0JKRUNUX1AgKGZvbnRfb2JqZWN0KQorICAgICAgICAgIHx8ICgh IE5JTFAgKHJlKQorICAgICAgICAgICAgICAmJiB0byA8IGxpbWl0CisgICAgICAgICAgICAgICYm IChmYXN0X2xvb2tpbmdfYXQgKHJlLCBjaGFycG9zLCBieXRlcG9zLCB0bywgLTEsIHN0cmluZykg PD0gMCkpKQorICAgICAgICByZXR1cm4gdW5iaW5kX3RvIChjb3VudCwgUW5pbCk7CisgICAgfQor ICBlbHNlCisjZW5kaWYgICAgICAgIC8qIG5vdCBIQVZFX1dJTkRPV19TWVNURU0gKi8KKyAgICBm b250X29iamVjdCA9IHdpbi0+ZnJhbWU7CisgIGxnc3RyaW5nID0gRmNvbXBvc2l0aW9uX2dldF9n c3RyaW5nIChwb3MsIG1ha2VfZml4bnVtICh0byksIGZvbnRfb2JqZWN0LAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyaW5nKTsKKyAgaWYgKE5JTFAgKExHU1RSSU5H X0lEIChsZ3N0cmluZykpKQorICAgIHsKKyAgICAgIC8qIFNhdmUgcG9pbnQgYXMgbWFya2VyIGJl Zm9yZSBjYWxsaW5nIG91dCB0byBsaXNwLiAgKi8KKyAgICAgIGlmIChOSUxQIChzdHJpbmcpKQor ICAgICAgICByZWNvcmRfdW53aW5kX3Byb3RlY3QgKHJlc3RvcmVfcG9pbnRfdW53aW5kLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkX21hcmtlciAoY3VycmVudF9idWZmZXIs IHB0LCBwdF9ieXRlKSk7CisgICAgICBsZ3N0cmluZyA9IHNhZmVfY2FsbCAoNiwgVmF1dG9fY29t cG9zaXRpb25fZnVuY3Rpb24sIEFSRUYgKHJ1bGUsIDIpLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHBvcywgbWFrZV9maXhudW0gKHRvKSwgZm9udF9vYmplY3QsIHN0cmluZyk7CisgICAg fQorICByZXR1cm4gdW5iaW5kX3RvIChjb3VudCwgbGdzdHJpbmcpOworfQorCisvKiBDaGVjayBp ZiB0aGUgY2hhcmFjdGVyIGF0IENIQVJQT1MgKGFuZCBCWVRFUE9TKSBpcyBjb21wb3NlZAorICAg KHBvc3NpYmx5IHdpdGggdGhlIGZvbGxvd2luZyBjaGFyYWN0ZXJzKSBvbiB3aW5kb3cgVy4gIEVO RFBPUyBsaW1pdHMKKyAgIGNoYXJhY3RlcnMgdG8gYmUgY29tcG9zZWQuICBGQUNFLC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wX2l0LT5ydWxlX2lk eDsgaSsrLCB2YWwgPSBYQ0RSICh2YWwpKTsKKyAgICAgIGlmIChjaGFycG9zIDwgZW5kcG9zKQor ICAgICAgICB7CisgICAgICAgICAgZm9yICg7IENPTlNQICh2YWwpOyB2YWwgPSBYQ0RSICh2YWwp KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBlbHQgPSBYQ0FSICh2YWwpOworICAgICAg ICAgICAgICBpZiAoISBWRUNUT1JQIChlbHQpIHx8IEFTSVpFIChlbHQpICE9IDMKKyAgICAgICAg ICAgICAgICAgIHx8ICEgSU5URUdFUlAgKEFSRUYgKGVsdCwgMSkpKQorICAgICAgICAgICAgICAg IGNvbnRpbnVlOworICAgICAgICAgICAgICBpZiAoWEZJWE5BVCAoQVJFRiAoZWx0LCAxKSkgIT0g Y21wX2l0LT5sb29rYmFjaykKKyAgICAgICAgICAgICAgICBnb3RvIG5vX2NvbXBvc2l0aW9uOwor ICAgICAgICAgICAgICBsZ3N0cmluZyA9IG1jX2F1dG9jbXBfY2hhcnMgKGVsdCwgY2hhcnBvcywg Ynl0ZXBvcywgZW5kcG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHcsIGZhY2UsIHN0cmluZyk7CisgICAgICAgICAgICAgIGlmIChjb21wb3NpdGlvbl9nc3RyaW5n X3AgKGxnc3RyaW5nKSkKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgbGdz dHJpbmcgPSBRbmlsOworICAgICAgICAgICAgICAvKiBDb21wb3NpdGlvbiBmYWlsZWQgcGVyaGFw cyBiZWNhdXNlIHRoZSBmb250IGRvZXNuJ3QKKyAgICAgICAgICAgICAgICAgc3VwcG9ydCBzdWZm aWNpZW50IHJhbmdlIG9mIGNoYXJhY3RlcnMuICBUcnkgdGhlCisgICAgICAgICAgICAgICAgIG90 aGVyIGNvbXBvc2l0aW9uIHJ1bGVzIGlmIGFueS4gICovCisgICAgICAgICAgICB9CisgICAgICAg ICAgY21wX2l0LT5yZXZlcnNlZF9wID0gMDsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAg ICB7CisgICAgICAgICAgcHRyZGlmZl90IGNwb3MgPSBjaGFycG9zLCBicG9zID0gYnl0ZXBvczsK KyAgICAgICAgICBjbXBfaXQtPnJldmVyc2VkX3AgPSAxOworICAgICAgICAgIGVsdCA9IFhDQVIg KHZhbCk7CisgICAgICAgICAgaWYgKGNtcF9pdC0+bG9va2JhY2sgPiAwKQorICAgICAgICAgICAg eworICAgICAgICAgICAgICBjcG9zID0gY2hhcnBvcyAtIGNtcF9pdC0+bG9va2JhY2s7CisgICAg ICAgICAgICAgIGlmIChTVFJJTkdQIChzdHJpbmcpKQorICAgICAgICAgICAgICAgIGJwb3MgPSBz dHJpbmdfY2hhcl90b19ieXRlIChzdHJpbmcsIGNwb3MpOworICAgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgICAgYnBvcyA9IENIQVJfVE9fQllURSAoY3Bvcyk7CisgICAgICAgICAgICB9 CisgICAgICAgICAgbGdzdHJpbmcgPSBtY19hdXRvY21wX2NoYXJzIChlbHQsIGNwb3MsIGJwb3Ms IGNoYXJwb3MgKyAxLCB3LCBmYWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgc3RyaW5nKTsKKyAgICAgICAgICBpZiAoISBjb21wb3NpdGlvbl9nc3RyaW5nX3AgKGxnc3Ry aW5nKQorICAgICAgICAgICAgICB8fCBjcG9zICsgTEdTVFJJTkdfQ0hBUl9MRU4gKGxnc3RyaW5n KSAtIDEgIT0gY2hhcnBvcykKKyAgICAgICAgICAgIC8qIENvbXBvc2l0aW9uIGZhaWxlZCBvciBk aWRuJ3QgY292ZXIgdGhlIGN1cnJlbnQKKyAgICAgICAgICAgICAgIGNoYXJhY3Rlci4gICovCisg ICAgICAgICAgICBnb3RvIG5vX2NvbXBvc2l0aW9uOworICAgICAgICB9CisgICAgICBpZiAoTklM UCAobGdzdHJpbmcpKQorICAgICAgICBnb3RvIG5vX2NvbXBvc2l0aW9uOworICAgICAgaWYgKE5J TFAgKExHU1RSSU5HX0lEIChsZ3N0cmluZykpKQorICAgICAgICBsZ3N0cmluZyA9IGNvbXBvc2l0 aW9uX2dzdHJpbmdfcHV0X2NhY2hlIChsZ3N0cmluZywgLTEpOworICAgICAgY21wX2l0LT5pZCA9 IFhGSVhOVU0gKExHU1RSSU5HX0lEIChsZ3N0cmluZykpOworICAgICAgZm9yIChpID0gMDsgaSA8 IExHU1RSSU5HX0dMWVBIX0xFTiAobGdzdHJpbmcpOyBpKyspCisgICAgICAgIGlmIChOSUxQIChM R1NUUklOR19HTFlQSCAobGdzdHJpbmcsIGkpKSkKKyAgICAgICAgICBicmVhazsKKyAgICAgIGNt cF9pdC0+bmdseXBocyA9IGk7CisgICAgICBjbXBfaXQtPmZyb20gPSAwOworICAgICAgY21wX2l0 LT50byA9IGk7CisgICAgfQorICBlbHNlCisgICAgZ290byBub19jb21wb3NpdGlvbjsKKyAgcmV0 dXJuIDE7Cisgbm9fY29tcG9zaXRpb246CisgIGlmIChjaGFycG9zID09IGVuZHBvcykKKyAgICBy ZXR1cm4gMDsKKyAgaWYgKGNoYXJwb3MgPCBlbmRwb3MpCisgICAgeworICAgICAgY2hhcnBvcysr OworICAgICAgaWYgKE5JTFAgKHN0cmluZykpCisgICAgICAgIElOQ19QT1MgKGJ5dGVwb3MpOwor ICAgICAgZWxzZQorICAgICAgICBieXRlcG9zICs9IEJZVEVTX0JZX0NIQVJfSEVBRCAoKihTREFU QSAoc3RyaW5nKSArIGJ5dGVwb3MpKTsKKyAgICB9CisgIGVsc2UKKyAgICB7CisgICAgICBjaGFy cG9zLS07CisgICAgICAvKiBCWVRFUE9TIGlzIGNhbGN1bGF0ZWQgaW4gY29tcG9zaXRpb25fY29t cHV0ZV9zdG9wX3BvcyAqLworICAgICAgYnl0ZXBvcyA9IC0xOworICAgIH0KKyAgaWYgKGNtcF9p dC0+cmV2ZXJzZWRf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2sgZGlzcGxheSBwcm9wZXJ0eS4gKi8KKyAgICAgICAgcHRyZGlmZl90IGVuZHA7CisgICAg ICAgIGludCB3aWR0aCA9IG1jX2NoZWNrX2Rpc3BsYXlfd2lkdGggKHNjYW4sIGNvbCwgJmVuZHAp OworICAgICAgICBpZiAod2lkdGggPj0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBjb2wg Kz0gd2lkdGg7CisgICAgICAgICAgICBpZiAoZW5kcCA+IHNjYW4pIC8qIEF2b2lkIGluZmluaXRl IGxvb3BzIHdpdGggMC13aWR0aCBvdmVybGF5cy4gKi8KKyAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgIHNjYW4gPSBlbmRwOworICAgICAgICAgICAgICAgIHNjYW5fYnl0ZSA9IENIQVJf VE9fQllURSAoc2Nhbik7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAg IH0KKyAgICAgICAgICB9CisgICAgICB9CisgICAgICAvKiBDaGVjayBjb21wb3NpdGlvbiBzZXF1 ZW5jZS4gKi8KKyAgICAgIGlmIChjbXBfaXQuaWQgPj0gMAorICAgICAgICAgIHx8IChzY2FuID09 IGNtcF9pdC5zdG9wX3BvcworICAgICAgICAgICAgICAmJiBtY19jb21wb3NpdGlvbl9yZXNlYXRf aXQgKCZjbXBfaXQsIHNjYW4sIHNjYW5fYnl0ZSwgZW5kLCB3LCBOVUxMLCBRbmlsKSkpCisgICAg ICAgIGNvbXBvc2l0aW9uX3VwZGF0ZV9pdCAoJmNtcF9pdCwgc2Nhbiwgc2Nhbl9ieXRlLCBRbmls KTsKKyAgICAgIGlmIChjbXBfaXQuaWQgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIHNjYW4g Kz0gY21wX2l0Lm5jaGFyczsKKyAgICAgICAgICBzY2FuX2J5dGUgKz0gY21wX2l0Lm5ieXRlczsK KyAgICAgICAgICBpZiAoc2NhbiA8PSBlbmQpCisgICAgICAgICAgICBjb2wgKz0gY21wX2l0Lndp ZHRoOworICAgICAgICAgIGlmIChjbXBfaXQudG8gPT0gY21wX2l0Lm5nbHlwaHMpCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIGNtcF9pdC5pZCA9IC0xOworICAgICAgICAgICAgICBjb21w b3NpdGlvbl9jb21wdXRlX3N0b3BfcG9zICgmY21wX2l0LCBzY2FuLCBzY2FuX2J5dGUsIGVuZCwg UW5pbCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGNt cF9pdC5mcm9tID0gY21wX2l0LnRvOworICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9Cisg ICAgICBjID0gRkVUQ0hfQllURSAoc2Nhbl9ieXRlKTsKKyAgICAgIC8qIFNlZSBpZiB0aGVyZSBp cyBhIGRpc3BsYXkgdGFibGUgYW5kIGl0IHJlbGF0ZXMgdG8gdGhpcyBjaGFyYWN0ZXIuICovCisg ICAgICBpZiAoZHAgIT0gMAorICAgICAgICAgICYmICEgKG11bHRpYnl0ZSAmJiBMRUFESU5HX0NP REVfUCAoYykpCisgICAgICAgICAgJiYgVkVDVE9SUCAoRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMp KSkKKyAgICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IGNoYXJ2ZWM7CisgICAgICAgICAg cHRyZGlmZl90IGksIG47CisgICAgICAgICAgLyogVGhpcyBjaGFyYWN0ZXIgaXMgZGlzcGxheWVk IHVzaW5nIGEgdmVjdG9yIG9mIGdseXBocy4KKyAgICAgICAgICAgICBVcGRhdGUgdGhlIGNvbHVt bi9wb3NpdGlvbiBiYXNlZCBvbiB0aG9zZSBnbHlwaHMuICovCisgICAgICAgICAgY2hhcnZlYyA9 IERJU1BfQ0hBUl9WRUNUT1IgKGRwLCBjKTsKKyAgICAgICAgICBuID0gQVNJWkUgKGNoYXJ2ZWMp OworICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBuOyBpKyspCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIC8qIFRoaXMgc2hvdWxkIGJlIGhhbmRsZWQgdGhlIHNhbWUgYXMKKyAgICAgICAg ICAgICAgbmV4dF9lbGVtZW50X2Zyb21fZGlzcGxheV92ZWN0b3IgZG9lcyBpdC4gKi8KKyAgICAg ICAgICAgICAgTGlzcF9PYmplY3QgZW50cnkgPSBBUkVGIChjaGFydmVjLCBpKTsKKyAgICAgICAg ICAgICAgaWYgKEdMWVBIX0NPREVfUCAoZW50cnkpKQorICAgICAgICAgICAgICAgIGMgPSBHTFlQ SF9DT0RFX0NIQVIgKGVudHJ5KTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAg IGMgPSAnICc7CisgICAgICAgICAgICAgIGlmIChjID09ICdcbicpCisgICAgICAgICAgICAgICAg Z290byBlbmRsb29wOworICAgICAgICAgICAgICBpZiAoYyA9PSAnXHInICYmIEVRIChCVkFSIChj dXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rpc3BsYXkpLCBRdCkpCisgICAgICAgICAgICAgICAg Z290byBlbmRsb29wOworICAgICAgICAgICAgICBpZiAoYyA9PSAnXHQnKQorICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgIGNvbCArPSB0YWJfd2lkdGg7CisgICAgICAgICAgICAg ICAgICBjb2wgPSBjb2wgLyB0YWJfd2lkdGggKiB0YWJfd2lkdGg7CisgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICsrY29sOworICAgICAg ICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAg ICAvKiBUaGUgZGlzcGxheSB0YWJsZSBkb2Vzbid0IGFmZmVjdCB0aGlzIGNoYXJhY3RlcjsKKyAg ICAgICAgICAgICAgIGl0IGRpc3BsYXlzIGFzIGl0c2VsZi4gKi8KKyAgICAgICAgICAgIGlmIChj ID09ICdcbicpCisgICAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgIGlmIChj ID09ICdccicgJiYgRVEgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVfZGlzcGxheSks IFF0KSkKKyAgICAgICAgICAgICAgZ290byBlbmRsb29wOworICAgICAgICAgICAgaWYgKGMgPT0g J1x0JykKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNvbCArPSB0YWJfd2lkdGg7 CisgICAgICAgICAgICAgICAgY29sID0gY29sIC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOworICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UgaWYgKG11bHRpYnl0ZSAmJiBMRUFESU5H X0NPREVfUCAoYykpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgLyogU3Rh cnQgb2YgbXVsdGktYnl0ZSBmb3JtLiAqLworICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hh ciAqcHRyOworICAgICAgICAgICAgICAgICAgaW50IGJ5dGVzLCB3aWR0aDsKKyAgICAgICAgICAg ICAgICAgIHB0ciA9IEJZVEVfUE9TX0FERFIgKHNjYW5fYnl0ZSk7CisgICAgICAgICAgICAgICAg ICBNQ19NVUxUSUJZVEVfQllURVNfV0lEVEggKHB0ciwgZHAsIGJ5dGVzLCB3aWR0aCk7CisgICAg ICAgICAgICAgICAgICAvKiBTdWJ0cmFjdCBvbmUgdG8gY29tcGVuc2F0ZSBmb3IgdGhlIGluY3Jl bWVudAorICAgICAgICAgICAgICAgICAgdGhhdCBpcyBnb2luZyB0byBoYXBwZW4gYmVsb3cuICov CisgICAgICAgICAgICAgICAgICBzY2FuX2J5dGUgKz0gYnl0ZXMgLSAxOworICAgICAgICAgICAg ICAgICAgY29sICs9IHdpZHRoOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBl bHNlIGlmIChjdGxfYXJyb3cgJiYgKGMgPCAwNDAgfHwgYyA9PSAwMTc3KSkKKyAgICAgICAgICAg ICAgICAgIGNvbCArPSAyOworICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoYyA8IDA0MCB8fCBj ID49IDAxNzcpCisgICAgICAgICAgICAgICAgICAgIGNvbCArPSA0OworICAgICAgICAgICAgICAg ICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgY29sKys7CisgICAgICAgICAgfQorICAg ICAgc2NhbisrOworICAgICAgc2Nhbl9ieXRlKys7CisgICAgfQorIGVuZGxvb3A6CisgIGxhc3Rf a25vd25fY29sdW1uID0gY29sOworICBsYXN0X2tub3duX2NvbHVtbl9wb2ludCA9IHB0OworICBs YXN0X2tub3duX2NvbHVtbl9tb2RpZmllZCA9IE1PRElGRjsKKyAgaWYgKGdvYWxjb2wpCisgICAg KmdvYWxjb2wgPSBjb2w7CisgIGlmIChlbmRwb3MpCisgICAgKmVuZHBvcyA9IHNjYW47CisgIGlm IChwcmV2Y29sKQorICAgICpwcmV2Y29sID0gcHJldl9jb2w7Cit9CisKK3B0cmRpZmZfdAorbWNf Y3VycmVudF9jb2x1bW4gKHN0cnVjdCB3aW5kb3cgKncsIHB0cmRpZmZfdCBwdCkKK3sKKyAgLyog YGJ1Zl9jaGFycG9zX3RvX2J5dGVwb3MnOiAgZWFzc2VydCAoQlVGX0JFRyAoYikgPD0gY2hhcnBv cyAmJiBjaGFycG9zIDw9IEJVRl9aIChiKSk7ICovCisgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVG RkVSICh3LT5jb250ZW50cyk7CisgIHN0cnVjdCBidWZmZXIgKm9sZF9idWZmZXIgPSBOVUxMOwor ICBpZiAoYiAhPSBjdXJyZW50X2J1ZmZlcikKKyAgICB7CisgICAgICBvbGRfYnVmZmVyID0gY3Vy cmVudF9idWZmZXI7CisgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChiKTsKKyAgICB9CisgIGJv b2wgYmFyZl9jcmFzaCA9IChCVUZfQkVHIChiKSA8PSBwdCAmJiBwdCA8PSBCVUZfWiAoYikpID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CisgICAgICBwdHJkaWZmX3QgaSwgbjsKKyAgICAgIExpc3BfT2JqZWN0IGNoYXJ2ZWM7 CisgICAgICBpZiAocHRyID09IHN0b3ApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBXZSBzdG9w cGVkIGVpdGhlciBmb3IgdGhlIGJlZ2lubmluZyBvZiB0aGUgYnVmZmVyCisgICAgICAgICAgICAg b3IgZm9yIHRoZSBnYXAuICovCisgICAgICAgICAgaWYgKHB0ciA9PSBCRUdWX0FERFIpCisgICAg ICAgICAgICBicmVhazsKKyAgICAgICAgICAvKiBJdCB3YXMgdGhlIGdhcC4gIEp1bXAgYmFjayBv dmVyIGl0LiAqLworICAgICAgICAgIHN0b3AgPSBCRUdWX0FERFI7CisgICAgICAgICAgcHRyID0g R1BUX0FERFI7CisgICAgICAgICAgLyogQ2hlY2sgd2hldGhlciB0aGF0IGJyaW5ncyB1cyB0byBi ZWdpbm5pbmcgb2YgYnVmZmVyLiAqLworICAgICAgICAgIGlmIChCRUdWID49IEdQVCkKKyAgICAg ICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjID0gKi0tcHRyOworICAgICAgaWYgKGRw ICYmIFZFQ1RPUlAgKERJU1BfQ0hBUl9WRUNUT1IgKGRwLCBjKSkpCisgICAgICAgIHsKKyAgICAg ICAgICBjaGFydmVjID0gRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpOworICAgICAgICAgIG4gPSBB U0laRSAoY2hhcnZlYyk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAg ICAgICAgICAgIGNoYXJ2ZWMgPSBRbmlsOworICAgICAgICAgICAgbiA9IDE7CisgICAgICAgICAg fQorICAgICAgZm9yIChpID0gbiAtIDE7IGkgPj0gMDsgLS1pKQorICAgICAgICB7CisgICAgICAg ICAgaWYgKFZFQ1RPUlAgKGNoYXJ2ZWMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAv KiBUaGlzIHNob3VsZCBiZSBoYW5kbGVkIHRoZSBzYW1lIGFzCisgICAgICAgICAgIG5leHRfZWxl bWVudF9mcm9tX2Rpc3BsYXlfdmVjdG9yIGRvZXMgaXQuICovCisgICAgICAgICAgICAgIExpc3Bf T2JqZWN0IGVudHJ5ID0gQVJFRiAoY2hhcnZlYywgaSk7CisgICAgICAgICAgICAgIGlmIChHTFlQ SF9DT0RFX1AgKGVudHJ5KSkKKyAgICAgICAgICAgICAgICBjID0gR0xZUEhfQ09ERV9DSEFSIChl bnRyeSk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgYyA9ICcgJzsK KyAgICAgICAgICAgIH0KKyAgICAgICAgICBpZiAoYyA+PSAwNDAgJiYgYyA8IDAxNzcpCisgICAg ICAgICAgICBjb2wrKzsKKyAgICAgICAgICAgIGVsc2UgaWYgKGMgPT0gJ1xuJworICAgICAgICAg ICAgICAgICAgICAgfHwgKGMgPT0gJ1xyJworICAgICAgICAgICAgICAgICAgICAgICAgICYmIEVR IChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rpc3BsYXkpLCBRdCkpKQorICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgcHRyKys7CisgICAgICAgICAgICAgICAgZ290byBz dGFydF9vZl9saW5lX2ZvdW5kOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2Ug aWYgKGMgPT0gJ1x0JykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAo dGFiX3NlZW4pCisgICAgICAgICAgICAgICAgICAgIGNvbCA9ICgoY29sICsgdGFiX3dpZHRoKSAv IHRhYl93aWR0aCkgKiB0YWJfd2lkdGg7CisgICAgICAgICAgICAgICAgICBwb3N0X3RhYiArPSBj b2w7CisgICAgICAgICAgICAgICAgICBjb2wgPSAwOworICAgICAgICAgICAgICAgICAgdGFiX3Nl ZW4gPSAxOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmIChWRUNU T1JQIChjaGFydmVjKSkKKyAgICAgICAgICAgICAgICAgIC8qIFdpdGggYSBkaXNwbGF5IHRhYmxl IGVudHJ5LCBDIGlzIGRpc3BsYXllZCBhcyBpcywgYW5kCisgICAgICAgICAgICAgICAgICAgICBu b3QgZGlzcGxheWVkIGFzIFxOTk4gb3IgYXMgXk4uICBJZiBDIGlzIGEgc2luZ2xlLWJ5dGUKKyAg ICAgICAgICAgICAgICAgICAgIGNoYXJhY3RlciwgaXQgdGFrZXMgb25lIGNvbHVtbi4gIElmIEMg aXMgbXVsdGktYnl0ZSBpbgorICAgICAgICAgICAgICAgICAgICAgYSB1bmlieXRlIGJ1ZmZlciwg aXQncyB0cmFuc2xhdGVkIHRvIHVuaWJ5dGUsIHNvIGl0CisgICAgICAgICAgICAgICAgICAgICBh bHNvIHRha2VzIG9uZSBjb2x1bW4uICovCisgICAgICAgICAgICAgICAgICArK2NvbDsKKyAgICAg ICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgY29sICs9IChjdGxfYXJyb3cg JiYgYyA8IDAyMDApID8gMiA6IDQ7CisgICAgICAgIH0KKyAgICB9Cisgc3RhcnRfb2ZfbGluZV9m b3VuZDoKKyAgaWYgKHRhYl9zZWVuKQorICAgIHsKKyAgICAgIGNvbCA9ICgoY29sICsgdGFiX3dp ZHRoKSAvIHRhYl93aWR0aCkgKiB0YWJfd2lkdGg7CisgICAgICBjb2wgKz0gcG9zdF90YWI7Cisg ICAgfQorICBsYXN0X2tub3duX2NvbHVtbiA9IGNvbDsKKyAgbGFzdF9rbm93bl9jb2x1bW5fcG9p bnQgPSBwdDsKKyAgbGFzdF9rbm93bl9jb2x1bW5fbW9kaWZpZWQgPSBNT0RJRkY7CisgIGlmIChv bGRfYnVmZmVyKQorICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworICByZXR1 cm4gY29sOworfQorCitERUZVTiAoIm1jLWN1cnJlbnQtY29sdW1uI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i8pCisgIChMaXNwX09iamVjdCB3aW5k b3csIExpc3BfT2JqZWN0IHB0KQoreworICBzdHJ1Y3Qgd2luZG93ICp3ID0gZGVjb2RlX2xpdmVf d2luZG93ICh3aW5kb3cpOworICBMaXNwX09iamVjdCB0ZW1wOworICBYU0VURkFTVElOVCAodGVt cCwgbWNfY3VycmVudF9jb2x1bW4gKHcsIFhGSVhOVU0gKHB0KSkpOworICByZXR1cm4gdGVtcDsK K30KKworLyogVVNBR0U6ICBmcHJpbnRmIChzdGRlcnIsICJGUkFNRSAoJXMpIiwgbWNfZnJhbWUg KGYpKTsgKi8KK2NoYXIgKgorbWNfZnJhbWUgKHN0cnVjdCBmcmFtZSAqZikKK3sKKyAgTGlzcF9P YmplY3QgZnJhbWU7CisgIFhTRVRGUkFNRSAoZnJhbWUsIGYpOworICByZXR1cm4gU1NEQVRBIChG cHJpbjFfdG9fc3RyaW5nIChmcmFtZSwgUW5pbCkpOworfQorCisvKiBVU0FHRTogIGZwcmludGYg KHN0ZGVyciwgIldJTkRPVyAoJXMpIiwgbWNfd2luZG93ICh3KSk7ICovCitjaGFyICoKK21jX3dp bmRvdyAoc3RydWN0IHdpbmRvdyAqdykKK3sKKyAgTGlzcF9PYmplY3Qgd2luZG93OworICBYU0VU V0lORE9XICh3aW5kb3csIHcpOworICByZXR1cm4gU1NEQVRBIChGcHJpbjFfdG9fc3RyaW5nICh3 aW5kb3csIFFuaWwpKTsKK30KKworLyogVVNBR0U6ICBmcHJpbnRmIChzdGRlcnIsICJDSEFSQUNU RVIgKCVzKSIsIG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkpOyAqLworY2hhciAqCitt Y19jaGFyX3RvX3N0cmluZyAoaW50IGFyZykKK3sKKyAgTGlzcF9PYmplY3QgY2hhcmFjdGVyID0g KDAgPD0gYXJnICYmIGFyZyA8PSBNQVhfQ0hBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gRmNoYXJfdG9fc3RyaW5nIChtYWtlX2ZpeG51bSAoYXJnKSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogUW5pbDsKKyAgY2hhciAqIHJlc3VsdCA9ICghTklMUCAoY2hhcmFjdGVyKQor ICAgICAgICAgICAgICAgICAgICYmIGFyZyA9PSA5KQorICAgICAgICAgICAgICAgICAgICA/ICJc XHQiCisgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAg ICAgICAgICAgJiYgYXJnID09IDEwKQorICAgICAgICAgICAgICAgICAgICA/ICJcXG4iCisgICAg ICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAg JiYgYXJnID09IDMyKQorICAgICAgICAgICAgICAgICAgICA/ICJcXHMiCisgICAgICAgICAgICAg ICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9 IDkKKyAgICAgICAgICAgICAgICAgICAgICYmIGFyZyAhPSAxMAorICAgICAgICAgICAgICAgICAg ICAgJiYgYXJnICE9IDMyKQorICAgICAgICAgICAgICAgICAgICA/IFNTREFUQSAoY2hhcmFjdGVy KQorICAgICAgICAgICAgICAgICAgOiAiXFw/IjsKKyAgcmV0dXJuIHJlc3VsdDsKK30KKworaW50 CittY19saXNwX3RvX2N1cnNvcl90eXBlIChMaXNwX09iamVjdCBhcmcpCit7CisgIGNoYXIgKnN0 cjsKKyAgaWYgKFhUWVBFIChhcmcpID09IExpc3BfU3RyaW5nKQorICAgIHN0ciA9IFNTREFUQSAo YXJnKTsKKyAgICBlbHNlIGlmIChYVFlQRSAoYXJnKSA9PSBMaXNwX1N5bWJvbCkKKyAgICAgIHN0 ciA9IFNTREFUQSAoU1lNQk9MX05BTUUgKGFyZykpOworICAgICAgZWxzZSByZXR1cm4gLTE7Cisg IGlmICghc3RyY21wIChzdHIsICJubyIpKQorICAgIHJldHVybiBNQ19OT19DVVJTT1I7CisgIGlm ICghc3RyY21wIChzdHIsICJtYy1sZWZ0LWZyaW5nZS1iaXRtYXAiKSkKKyAgICByZXR1cm4gTUNf TEVGVF9GUklOR0VfQklUTUFQOworICBpZiAoIXN0cmNtcCAoc3RyLCAibWMtcmlnaHQtZnJpbmdl LWJpdG1hcCIpKQorICAgIHJldHVybiBNQ19SSUdIVF9GUklOR0VfQklUTUFQOworICBpZiAoIXN0 cmNtcCAoc3RyLCAiYm94IikpCisgICAgcmV0dXJuIE1DX0ZJTExFRF9CT1g7CisgIGlmICghc3Ry Y21wIChzdHIsICJmcmFtZWQiKSkKKyAgICByZXR1cm4gTUNfRlJBTUVEX0JPWDsKKyAgaWYgKCFz dHJjbXAgKHN0ciwgImhvbGxvdyIpKQorICAgIHJldHVybiBNQ19IT0xMT1dfQk9YOworICBpZiAo IXN0cmNtcCAoc3RyLCAiYmFyIikpCisgICAgcmV0dXJuIE1DX0JBUjsKKyAgaWYgKCFzdHJjbXAg KHN0ciwgImhiYXIiKSkKKyAgICByZXR1cm4gTUNfSEJBUjsKKyAgcmV0dXJuIC0xOworfQorCisv KiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIkNVUlNPUiBUWVBFICglcykiLCBtY19jdXJzb3Jf dHlwZV90b19zdHJpbmcgKGFyZykpOyAqLworY2hhciAqCittY19jdXJzb3JfdHlwZV90b19zdHJp bmcgKGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUpCit7CisgIHN3aXRjaCAoY3Vyc29y X3R5cGUpCisgICAgeworICAgICAgY2FzZSBNQ19GSUxMRURfQk9YOiByZXR1cm4gIk1DX0ZJTExF RF9CT1giOworICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOiByZXR1cm4gIk1DX0ZSQU1FRF9CT1gi OworICAgICAgY2FzZSBNQ19IT0xMT1dfQk9YOiByZXR1cm4gIk1DX0hPTExPV19CT1giOworICAg ICAgY2FzZSBNQ19CQVI6IHJldHVybiAiTUNfQkFSIjsKKyAgICAgIGNhc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AgICAgY2FzZSBNQ19DQUNIRTog cmV0dXJuICJNQ19DQUNIRSI7CisgICAgICBjYXNlIENIX0NBQ0hFOiByZXR1cm4gIkNIX0NBQ0hF IjsKKyAgICAgIGNhc2UgRkNfQ0FDSEU6IHJldHVybiAiRkNfQ0FDSEUiOworICAgICAgZGVmYXVs dDoKKyAgICAgIHJldHVybiAiVU5LTk9XTiI7CisgICAgfQorfQorCisvKiBVU0FHRTogIGZwcmlu dGYgKHN0ZGVyciwgIkFDVElPTi1UWVBFICglcykiLCBtY19lbmdpbmVfdHlwZV90b19zdHJpbmcg KGFyZykpOyAqLworY2hhciAqCittY19lbmdpbmVfdHlwZV90b19zdHJpbmcgKGVudW0gbWNfZW5n aW5lX3R5cGUgYWN0aW9uX3R5cGUpCit7CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgICAgewor ICAgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOiByZXR1cm4gIk1VTFRJUExFX0NVUlNPUlMiOwor ICAgICAgY2FzZSBIT1JJWk9OVEFMX1JVTEVSOiByZXR1cm4gIkhPUklaT05UQUxfUlVMRVIiOwor ICAgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjogcmV0dXJuICJWRVJUSUNBTF9SVUxFUiI7CisgICAg ICBjYXNlIEZJTExfQ09MVU1OOiByZXR1cm4gIkZJTExfQ09MVU1OIjsKKyAgICAgIGNhc2UgQ1VS U09SX0lORElDQVRPUjogcmV0dXJuICJDVVJTT1JfSU5ESUNBVE9SIjsKKyAgICAgIGRlZmF1bHQ6 CisgICAgICByZXR1cm4gIlVOS05PV04iOworICAgIH0KK30KKworLyogVVNBR0U6ICBmcHJpbnRm IChzdGRlcnIsICJGUk9NX1dIRVJFICglcykiLCBtY19kcmF3X3Jvd190eXBlX3RvX3N0cmluZyAo YXJnKSk7ICovCitjaGFyICoKK21jX2RyYXdfcm93X3R5cGVfdG9fc3RyaW5nIChlbnVtIG1jX2Ry YXdfcm93X3R5cGUgZnJvbV93aG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LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2Nh Y2hlX3R5cGVdOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICBtYXRyaXguY3Vyc29yc191c2Vk WyVzXSAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICBtY19jYWNoZV90eXBlX3RvX3N0 cmluZyAoY2FjaGVfdHlwZSksIGN1cnNvcnNfdXNlZCk7CisgICAgfQorICBmb3IgKGludCB2bnRo ID0gMDsKKyAgICAgICB2bnRoIDwgdy0+bWNfbWF0cml4LnZwb3NfdXNlZDsKKyAgICAgICArK3Zu dGgpCisgICAgeworICAgICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1D X0NBQ0hFOworICAgICAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgICAgICsr Y2FjaGVfdHlwZSkKKyAgICAgICAgeworICAgICAgICAgIGludCBjYWNoZV9hbGxvY2F0ZWQgPSB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV07CisgICAg ICAgICAgaW50IGNhY2hlX3VzZWQgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2Vk W2NhY2hlX3R5cGVdOworICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgICB2bnRoICglZCkg fCBjYWNoZV9hbGxvY2F0ZWRbJXNdICglZCkgfCBjYWNoZV91c2VkWyVzXSAoJWQpXG4iLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgdm50aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg IG1jX2NhY2hlX3R5cGVfdG9fc3RyaW5nIChjYWNoZV90eXBlKSwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgIGNhY2hlX2FsbG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1j X2NhY2hlX3R5cGVfdG9fc3RyaW5nIChjYWNo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HN0cnVjdCBtY19lc3NlbnRpYWxzICplc3NlbnRp YWxzKQoreworICBpZiAoIUJVRkZFUlAgKHctPmNvbnRlbnRzKSkKKyAgICByZXR1cm47CisgIGlm IChOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgJiYg TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICYm IE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKQorICAgIHJl dHVybjsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIGVzc2VudGlh bHMtPmFjdGl2ZV9wID0gKHcgPT0gWFdJTkRPVyAoZi0+c2VsZWN0ZWRfd2luZG93KQorICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBmID09IEZSQU1FX0RJU1BMQVlfSU5GTyAoZiktPmhpZ2hs aWdodF9mcmFtZSk7CisgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSICh3LT5jb250ZW50cyk7 CisgIHN0cnVjdCBidWZmZXIgKm9sZF9idWZmZXIgPSBOVUxMOworICBwdHJkaWZmX3Qgb3BvaW50 ID0gKHcgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KSkKKyAgICAgICAgICAgICAgICAgICAg ID8gUFQKKyAgICAgICAgICAgICAgICAgICAgIDogWEZJWE5VTSAoRm1hcmtlcl9wb3NpdGlvbiAo dy0+cG9pbnRtKSk7CisgIHB0cmRpZmZfdCBjdXJyZW50X2NvbCA9IG1jX2N1cnJlbnRfY29sdW1u ICh3LCBvcG9pbnQpOworICBpbnQgZnJhbWVfY2hhcl93aWR0aCA9IEZSQU1FX0NPTFVNTl9XSURU SCAoZik7CisgIGJvb2wgZmlsbF9jb2x1bW5fcCA9ICFOSUxQIChCVkFSIChiLCBmaWxsX2NvbHVt bikpOworICBpbnQgZmlsbF9jb2wgPSBYRklYTlVNIChCVkFSIChiLCBmaWxsX2NvbHVtbikpOwor ICBpbnQgaHNjbF94ID0gdy0+aHNjcm9sbCAqIGZyYW1lX2NoYXJfd2lkdGg7CisgIGlmIChiICE9 IGN1cnJlbnRfYnVmZmVyKQorICAgIHsKKyAgICAgIG9sZF9idWZmZXIgPSBjdXJyZW50X2J1ZmZl cjsKKyAgICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKGIpOworICAgIH0KKyAgZXNzZW50aWFscy0+ enYgPSBaVjsKKyAgZXNzZW50aWFscy0+enZfYnl0ZSA9IFpWX0JZVEU7CisgIGVzc2VudGlhbHMt PmZjX3ggPSAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChW ZGlzcGxheV9saW5lX251bWJlcnMpKQorICAgICAgICAgICAgICAgICAgICAgICA/IChmaWxsX2Nv bCAqIGZyYW1lX2NoYXJfd2lkdGgpICsgdy0+bWMubG51bV9waXhlbF93aWR0aCAtIGhzY2xfeAor ICAgICAgICAgICAgICAgICAgICAgOiAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAg ICAgICAgJiYgTklMUCAoVmRpc3BsYXlfbGluZV9udW1iZXJzKSkKKyAgICAgICAgICAgICAgICAg ICAgICAgPyAoZmlsbF9jb2wgKiBmcmFtZV9jaGFyX3dpZHRoKSAtIGhzY2xfeAorICAgICAgICAg ICAgICAgICAgICAgOiAwOworICBpZiAob2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVyX2ludGVy bmFsIChvbGRfYnVmZmVyKTsKKyAgZW51bSBmYWNlX2lkIGZpbGxfY29sdW1uX3ByZV96dl9mYWNl X2lkID0KKyAgICAoIWVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICYmICFOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAmJiBOSUxQ IChCV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NfZmdb UFJFX1pWXS5yZWQgPSBmY19wcmVfenZfZmcucmVkOworICBlc3NlbnRpYWxzLT5mY19mZ1tQUkVf WlZdLmdyZWVuID0gZmNfcHJlX3p2X2ZnLmdyZWVuOworICBlc3NlbnRpYWxzLT5mY19mZ1tQUkVf WlZdLmJsdWUgPSBmY19wcmVfenZfZmcuYmx1ZTsKKyAgZW51bSBmYWNlX2lkIGZpbGxfY29sdW1u X2F0X3p2X2ZhY2VfaWQgPQorICAgICghZXNzZW50aWFscy0+YWN0aXZlX3AKKyAgICAgJiYgIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfaW5hY3RpdmVfd2luZG93cykpCisg ICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQor ICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiZmMtaW5hY3RpdmUtYXQt enYtZmFjZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAgICYm ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3Mp KQorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFp cnMpKQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAg ICAgJiYgdy0+Y3Vyc29yLnggPT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8gbG9va3VwX25h bWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLW9wb2ludC1pbmFjdGl2ZS1hdC16di1mYWNlIiks IHRydWUpCisgICAgOiAoZXNzZW50aWFscy0+YWN0aXZlX3AKKyAgICAgICAmJiAhTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAmJiAhTklMUCAo QlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICYmIHctPmN1cnNvci54ID09IGVz c2VudGlhbHMtPmZjX3gpCisgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4g KCJmYy1vcG9pbnQtYXQtenYtZmFjZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3Rp dmVfcAorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2lu YWN0aXZlX3dpbmRvd3MpKQorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNh bF9ydWxlcikpCisgICAgICAgJiYgdy0+Y3Vyc29yLnggIT0gZXNzZW50aWFscy0+ZmNfeCkKKyAg ICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLWluYWN0aXZlLWF0LXp2 LWZhY2UiKSwgdHJ1ZSkKKyAgICA6IChlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAgICYmICFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICYm ICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgJiYgdy0+Y3Vyc29y LnggIT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYs IGludGVybiAoImZjLWF0LXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICA6IGxvb2t1cF9uYW1lZF9mYWNl ICh3LCBmLCBpbnRlcm4gKCJmYy1hdC16di1mYWNlIiksIHRydWUpOworICBzdHJ1Y3QgZmFjZSAq ZmlsbF9jb2x1bW5fY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CBjdXJyZW50X2NvbCA9IG1jX2N1cnJl bnRfY29sdW1uICh3LCBwb3NpbnQpOworICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIg KHctPmNvbnRlbnRzKTsKKyAgICAgIGJvb2wgZmlsbF9jb2x1bW5fcCA9ICFOSUxQIChCVkFSIChi LCBmaWxsX2NvbHVtbikpOworICAgICAgaW50IGZpbGxfY29sID0gKGZpbGxfY29sdW1uX3ApCisg ICAgICAgICAgICAgICAgICAgICA/IFhGSVhOVU0gKEJWQVIgKGIsIGZpbGxfY29sdW1uKSkKKyAg ICAgICAgICAgICAgICAgICAgIDogMDsKKyAgICAgIGVudW0gZmFjZV9pZCBldmVuX2ZhY2VfaWQg PQorICAgICAgICAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICYmICFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAg PyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1ldmVuLWluYWN0aXZlLXByZS16 di1mYWNlIiksIHRydWUpCisgICAgICAgIDogbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVy biAoIistZXZlbi1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgIHN0cnVjdCBmYWNlICpldmVu X2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGV2ZW5fZmFjZV9pZCk7CisgICAgICBMaXNwX09iamVj dCBldmVuX2NvbG9yID0gZXZlbl9mYWNlLT5sZmFjZVtMRkFDRV9GT1JFR1JPVU5EX0lOREVYXTsK KyAgICAgIHN0cnVjdCBtY19SR0IgZXZlbl9mb3JlZ3JvdW5kOworICAgICAgbWNfeHdfY29sb3Jf dmFsdWVzICh3LCBldmVuX2NvbG9yLCAmZXZlbl9mb3JlZ3JvdW5kKTsKKyAgICAgIGVudW0gZmFj ZV9pZCBvZGRfZmFjZV9p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Y3QgZmFjZSAqYmV5b25kX2ZpbGxfZmFjZSA9 IEZBQ0VfRlJPTV9JRCAoZiwgYmV5b25kX2ZpbGxfZmFjZV9pZCk7CisgICAgICBMaXNwX09iamVj dCBiZXlvbmRfZmlsbF9jb2xvciA9IGJleW9uZF9maWxsX2ZhY2UtPmxmYWNlW0xGQUNFX0ZPUkVH Uk9VTkRfSU5ERVhdOworICAgICAgc3RydWN0IG1jX1JHQiBiZXlvbmRfZmlsbF9mb3JlZ3JvdW5k OworICAgICAgbWNfeHdfY29sb3JfdmFsdWVzICh3LCBiZXlvbmRfZmlsbF9jb2xvciwgJmJleW9u ZF9maWxsX2ZvcmVncm91bmQpOworICAgICAgLyogcmVkICovCisgICAgICBpZiAoKCFmaWxsX2Nv bHVtbl9wCisgICAgICAgICAgICYmIGN1cnJlbnRfY29sICUgMiAhPSAwCisgICAgICAgICAgICYm IHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpCisgICAgICAgICAgfHwgKGZpbGxfY29sdW1uX3AKKyAg ICAgICAgICAgICAgJiYgY3VycmVudF9jb2wgJSAyICE9IDAKKyAgICAgICAgICAgICAgJiYgY3Vy cmVudF9jb2wgPD0gZmlsbF9jb2wKKyAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBS RV9aVikpCisgICAgICAgIHsKKyAgICAgICAgICBsc2xfZmctPnJlZCA9IG9kZF9mb3JlZ3JvdW5k LnJlZDsKKyAgICAgICAgICBsc2xfZmctPmdyZWVuID0gb2RkX2ZvcmVncm91bmQuZ3JlZW47Cisg ICAgICAgICAgbHNsX2ZnLT5ibHVlID0gb2RkX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgfQor ICAgICAgICAvKiB5ZWxsb3cgKi8KKyAgICAgICAgZWxzZSBpZiAoKCFmaWxsX2NvbHVtbl9wCisg ICAgICAgICAgICAgICAgICAmJiBjdXJyZW50X2NvbCAlIDIgPT0gMAorICAgICAgICAgICAgICAg ICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikKKyAgICAgICAgICAgICAgICAgfHwgKGZpbGxf Y29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sICUgMiA9PSAwCisg ICAgICAgICAgICAgICAgICAgICAmJiBjdXJyZW50X2NvbCA8PSBmaWxsX2NvbAorICAgICAgICAg ICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikpCisgICAgICAgICAgeworICAg ICAgICAgICAgbHNsX2ZnLT5yZWQgPSBldmVuX2ZvcmVncm91bmQucmVkOworICAgICAgICAgICAg bHNsX2ZnLT5ncmVlbiA9IGV2ZW5fZm9yZWdyb3VuZC5ncmVlbjsKKyAgICAgICAgICAgIGxzbF9m Zy0+Ymx1ZSA9IGV2ZW5fZm9yZWdyb3VuZC5ibHVlOworICAgICAgICAgIH0KKyAgICAgICAgICAv KiBncmVlbiAqLworICAgICAgICAgIGVsc2UgaWYgKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAg ICAgICAgICAmJiBjdXJyZW50X2NvbCA+IGZpbGxfY29sCisgICAgICAgICAgICAgICAgICAgJiYg cm93X3Bvc2l0aW9uID09IFBSRV9aVikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbHNs X2ZnLT5yZWQgPSBiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kLnJlZDsKKyAgICAgICAgICAgICAgbHNs X2ZnLT5ncmVlbiA9IGJleW9uZF9maWxsX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAgICAg IGxzbF9mZy0+Ymx1ZSA9IGJleW9uZF9maWxsX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICAgIGVsc2UgaWYgKHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgIGxzbF9mZy0+cmVkID0gZXNzZW50aWFscy5zcF9mZy5y ZWQ7CisgICAgICAgICAg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KKyAgICAgICAgOiAoIWVzc2VudGlhbHMuYWN0aXZlX3AK KyAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5h Y3RpdmVfd2luZG93cykpCisgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAg ICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtl LWN1cnNvci1pbmFjdGl2ZS1hdC16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogKGVzc2VudGlh bHMuYWN0aXZlX3AKKyAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IEFUX1pWKQorICAgICAg ICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNv ci1hdC16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYs IGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1hdC16di1mYWNlIiksIHRydWUpOworICAgICAg c3RydWN0IGZhY2UgKmN1cnNvcl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBjdXJzb3JfZmFjZV9p ZCk7CisgICAgICBMaXNwX09iamVjdCBjdXJzb3JfY29sb3IgPSBjdXJzb3JfZmFjZS0+bGZhY2Vb TEZBQ0VfRk9SRUdST1VORF9JTkRFWF07CisgICAgICBtY194d19jb2xvcl92YWx1ZXMgKHcsIGN1 cnNvcl9jb2xvciwgbHNsX2ZnKTsKKyAgICAgIGJyZWFrOworICAgIH0KKyAgfQorfQorCisvKiBE cmF3IGdseXBocyBiZXR3ZWVuIFNUQVJUIGFuZCBFTkQgaW4gQVJFQSBvZiBST1cgb24gd2luZG93 IFcsCisgICBzdGFydGluZyBhdCB4LXBvc2l0aW9uIFguICBYIGlzIHJlbGF0aXZlIHRvIEFSRUEg aW4gVy4gIEhMIGlzIG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luZyB0aGUgZ2x5cGgKKyAgICAgc3RyaW5n cyBidWlsdCBhYm92ZS4gKi8KKyAgaWYgKGhlYWQgJiYgIW92ZXJsYXBzICYmIHJvdy0+Y29udGFp bnNfb3ZlcmxhcHBpbmdfZ2x5cGhzX3ApCisgICAgeworICAgICAgc3RydWN0IGdseXBoX3N0cmlu ZyAqaCwgKnQ7CisgICAgICBNb3VzZV9ITEluZm8gKmhsaW5mbyA9IE1PVVNFX0hMX0lORk8gKGYp OworICAgICAgaW50IG1vdXNlX2JlZ19jb2wgVU5JTklULCBtb3VzZV9lbmRfY29sIFVOSU5JVDsK KyAgICAgIGJvb2wgY2hlY2tfbW91c2VfZmFjZSA9IGZhbHNlOworICAgICAgaW50IGR1bW15X3gg PSAwOworICAgICAgLyogSWYgbW91c2UgaGlnaGxpZ2h0aW5nIGlzIG9uLCB3ZSBtYXkgbmVlZCB0 byBkcmF3IGFkamFjZW50CisgICBnbHlwaHMgdXNpbmcgbW91c2UtZmFjZSBoaWdobGlnaHRpbmcu ICovCisgICAgICBpZiAoYXJlYSA9PSBURVhUX0FSRUEgJiYgcm93LT5tb3VzZV9mYWNlX3AKKyAg ICAgICAgICAmJiBobGluZm8tPm1vdXNlX2ZhY2VfYmVnX3JvdyA+PSAwCisgICAgICAgICAgJiYg aGxpbmZvLT5tb3VzZV9mYWNlX2VuZF9yb3cgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIHB0 cmRpZmZfdCByb3dfdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCB3LT5jdXJyZW50X21hdHJp eCk7CisgICAgICAgICAgaWYgKHJvd192cG9zID49IGhsaW5mby0+bW91c2VfZmFjZV9iZWdfcm93 CisgICAgICAgICAgICAgICYmIHJvd192cG9zIDw9IGhsaW5mby0+bW91c2VfZmFjZV9lbmRfcm93 KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjaGVja19tb3VzZV9mYWNlID0gdHJ1ZTsK KyAgICAgICAgICAgICAgbW91c2V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tlIGN1cnNvciBvbiB0 aGUgIk0iLAorICAgICAgICAgIGhsID09IERSQVdfQ1VSU09SIGFuZCB0aGUgU1RSRVRDSF9HTFlQ SCBpcyBgbGVmdF9vdmVyd3JpdHRlbmAuICBEcmF3aW5nCisgICAgICAgICAgbm9ybWFsIHRleHQg ZHVyaW5nIGB1cGRhdGVfd2luZG93JyAoRFJBV19OT1JNQUxfVEVYVCkgY2FuIGFsc28gZXJhc2Ug ZmFrZQorICAgICAgICAgIGN1cnNvcnMgdGhhdCBhcmUgYGxlZnRfb3ZlcndyaXR0ZW4nLiAqLwor ICAgICAgICAgIGxlbmd0aCA9IDA7CisgICAgICAgICAgZm9yIChzID0gaDsgczsgcyA9IHMtPm5l eHQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHMtPmxlZnRfb3ZlcndyaXR0ZW5fcCA9 IHRydWU7CisgICAgICAgICAgICAgIHMtPmFjdGlvbl90eXBlID0gYWN0aW9uX3R5cGU7CisgICAg ICAgICAgICAgIGxlbmd0aCArPSBzLT5maXJzdF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAg ICAgICB9CisgICAgICAgICAgcmVsYXRpdmVfeCA9IHN0YXJ0X3ggLSBsZW5ndGg7CisgICAgICAg ICAgZm9yIChzID0gaDsgczsgcyA9IHMtPm5leHQpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIHMtPmZpcnN0X2dseXBoLT5yZWxhdGl2ZV94ID0gcmVsYXRpdmVfeDsKKyAgICAgICAgICAg ICAgcmVsYXRpdmVfeCArPSBzLT5maXJzdF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAg ICB9CisgICAgICAgICAgc3RhcnQgPSBpOworICAgICAgICAgIGNvbXB1dGVfb3ZlcmhhbmdzX2Fu ZF94ICh0LCBoZWFkLT54LCB0cnVlKTsKKyAgICAgICAgICBwcmVwZW5kX2dseXBoX3N0cmluZ19s aXN0cyAoJmhlYWQsICZ0YWlsLCBoLCB0KT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Bocy4gKi8KKyAgICAgIGkgPSBy aWdodF9vdmVyd3JpdGluZyAodGFpbCk7CisgICAgICBpZiAoaSA+PSAwKQorICAgICAgICB7Cisg ICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIG92ZXJsYXBfaGw7CisgICAgICAgICAgaWYg KGNoZWNrX21vdXNlX2ZhY2UKKyAgICAgICAgICAgICAgJiYgbW91c2VfYmVnX2NvbCA8IGkgJiYg bW91c2VfZW5kX2NvbCA+IGVuZCkKKyAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX01PVVNF X0ZBQ0U7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFX X05PUk1BTF9URVhUOworICAgICAgICAgIGlmIChobCA9PSBvdmVybGFwX2hsIHx8IGNsaXBfdGFp bCA9PSBOVUxMKQorICAgICAgICAgICAgY2xpcF90YWlsID0gdGFpbDsKKyAgICAgICAgICBpKys7 ICAgICAgLyogV2UgbXVzdCBpbmNsdWRlIHRoZSBJdGggZ2x5cGguICovCisgICAgICAgICAgTUNf QlVJTERfR0xZUEhfU1RSSU5HUyAoZW5kLCBpLCBoLCB0LCBvdmVybGFwX2hsLCB4LCBsYXN0X3gp OworICAgICAgICAgIGZvciAocyA9IGg7IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgICAgcy0+ YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICAgICAgY29tcHV0ZV9vdmVyaGFuZ3Nf YW5kX3ggKGgsIHRhaWwtPnggKyB0YWlsLT53aWR0aCwgZmFsc2UpOworICAgICAgICAgIGFwcGVu ZF9nbHlwaF9zdHJpbmdfbGlzdHMgKCZoZWFkLCAmdGFpbCwgaCwgdCk7CisgICAgICAgIH0KKyAg ICAgIHRhaWwgPSBnbHlwaF9zdHJpbmdfY29udGFpbmluZ19iYWNrZ3JvdW5kX3dpZHRoICh0YWls KTsKKyAgICAgIGlmIChjbGlwX3RhaWwpCisgICAgICAgIGNsaXBfdGFpbCA9IGdseXBoX3N0cmlu Z19jb250YWluaW5nX2JhY2tncm91bmRfd2lkdGggKGNsaXBfdGFpbCk7CisgICAgICBpZiAoY2xp cF9oZWFkIHx8IGNsaXBfdGFpbCkKKyAgICAgICAgZm9yIChzID0gaGVhZDsgczsgcyA9IHMtPm5l eHQpCisgICAgICAgICAgeworICAgICAgICAgICAgcy0+Y2xpcF9oZWFkID0gY2xpcF9oZWFkOwor ICAgICAgICAgICAgcy0+Y2xpcF90YWlsID0gY2xpcF90YWlsOworICAgICAgICAgIH0KKyAgICB9 CisgIC8qIERyYXcgYWxsIHN0cmluZ3MuICovCisgIGZvciAocyA9IGhlYWQ7IHMgJiYgZHJhd19w OyBzID0gcy0+bmV4dCkKKyAgICBGUkFNRV9SSUYgKGYpLT5tY19zY3JpYmVfc3RyaW5nIChzLCBt YXRyaXgsIHJvdywgbHNsLCBnbHlwaF9mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworI2lm bmRlZiBIQVZFX05TCisgIC8qIFdoZW4gZm9jdXMgYSBzb2xlIGZyYW1lIGFuZCBtb3ZlIGhvcml6 b250YWxseSwgdGhpcyBjbGVhcnMgb25fcAorICAgICBjYXVzaW5nIGEgZmFpbHVyZSB0byBlcmFz ZSBwcmV2IGN1cnNvciBwb3NpdGlvbi4gKi8KKyAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBCisgICAg ICAmJiAhcm93LT5mdWxsX3dpZHRoX3AKKyAgICAgIC8qIFdoZW4gZHJhd2luZyBvdmVybGFwcGlu ZyByb3dzLCBvbmx5IHRoZSBnbHlwaCBzdHJpbmdzJworICAgICAgZm9yZWdyb3VuZCBpcyBkcmF3 biwgd2hpY2ggZG9lc24ndCBlcmFzZSBhIGN1cnNvciBjb21wbGV0ZWx5LiAqLworICAgICAgJiYg IW92ZXJsYX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isgICAgIERvbid0IGJvdGhlciB0byBlcmFzZSB0aGUgY3Vyc29yLiAqLworICBpZiAodnBvcyA+ PSBtYXRyaXgtPm5yb3dzKQorICAgIHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICBmcHJp bnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwgMik7CisgICAg ICByZXR1cm47CisgICAgfQorICAvKiBJZiByb3cgY29udGFpbmluZyBjdXJzb3IgaXMgbWFya2Vk IGludmFsaWQsIHRoZXJlIGlzIG5vdGhpbmcgd2UKKyAgICAgY2FuIGRvLiAqLworICBpZiAoIXJv dy0+ZW5hYmxlZF9wKQorICAgIHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICBmcHJpbnRm IChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwgMyk7CisgICAgICBy ZXR1cm47CisgICAgfQorICAvKiBJZiBsaW5lIHNwYWNpbmcgaXMgPiAwLCBvbGQgY3Vyc29yIG1h eSBvbmx5IGJlIHBhcnRpYWxseSB2aXNpYmxlIGluCisgICAgIHdpbmRvdyBhZnRlciBzcGxpdC13 aW5kb3cuICBTbyBhZGp1c3QgdmlzaWJsZSBoZWlnaHQuICovCisgIHJvdy0+dmlzaWJsZV9oZWln aHQgPSBtaW4gKHJvdy0+dmlzaWJsZV9oZWlnaHQsCisgICAgICAgICAgICB3aW5kb3dfdGV4dF9i b3R0b21feSAodykgLSByb3ctPnkpOworICAvKiBJZiByb3cgaXMgY29tcGxldGVseSBpbnZpc2li bGUsIGRvbid0IGF0dGVtcHQgdG8gZGVsZXRlIGEgY3Vyc29yIHdoaWNoCisgICAgIGlzbid0IHRo ZXJlLiAgVGhpcyBjYW4gaGFwcGVuIGlmIGN1cnNvciBpcyBhdCB0b3Agb2YgYSB3aW5kb3csIGFu ZAorICAgICB3ZSBzd2l0Y2ggdG8gYSBidWZmZXIgd2l0aCBhIGh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YXJzIHRoZXJlLCBidXQK KyAgICAgIG1vdXNlIGhpZ2hsaWdodGluZyBkb2VzIG5vdC4gKi8KKyAgICAgICYmIHJvdy0+dXNl ZFtURVhUX0FSRUFdID4gaHBvcyAmJiBocG9zID49IDApCisgICAgbW91c2VfZmFjZV9oZXJlX3Ag PSB0cnVlOworICAvKiBNYXliZSBjbGVhciB0aGUgZGlzcGxheSB1bmRlciB0aGUgY3Vyc29yLiAq LworICBpZiAoY3Vyc29yX3R5cGUgPT0gTUNfSE9MTE9XX0JPWAorICAgICAgfHwgY3Vyc29yX3R5 cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICB7CisgICAgICBpbnQgdGVtcF94ID0geDsKKyAgICAg IGludCBoZWFkZXJfbGluZV9oZWlnaHQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsK KyAgICAgIGN1cnNvcl9nbHlwaCA9IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93 LCBocG9zLCB2cG9zKTsKKyAgICAgIGlmIChjdXJzb3JfZ2x5cGggPT0gTlVMTCkKKyAgICAgICAg eworICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAi bWNfZXJhc2VfY3Vyc29yOiAgcmV0dXJuICglZClcbiIsIDcpOworICAgICAgICAgIHJldHVybjsK KyAgICAgICAgfQorICAgICAgaW50IHRlbXBfd2QgPSBjdXJzb3JfZ2x5cGgtPnBpeGVsX3dpZHRo OworICAgICAgaWYgKHRlbXBfeCA8IDApCisgICAgICAgIHsKKyAgICAgICAgICB0ZW1wX3dkICs9 IHRlbXBfeDsKKyAgICAgICAgICB0ZW1wX3ggPSAwOworICAgICAgICB9CisgICAgICB0ZW1wX3dk ID0gbWluICh3ZCwgd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKSAtIHRlbXBfeCk7Cisg ICAgICBpbnQgZnkgPSBXSU5ET1dfVE9fRlJB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hc2hfb25lKQorICAgIHJldHVybjsKKyAgYm9v bCBiYXJmX2NyYXNoX3R3byA9ICh2cG9zID49IDAgJiYgdnBvcyA8IG1hdHJpeC0+bnJvd3MpID8g ZmFsc2UgOiB0cnVlOworICBpZiAoYmFyZl9jcmFzaF90d28pCisgICAgcmV0dXJuOworICBpZiAo eCA8IDAKKyAgICAgIHx8IHkgPCAwCisgICAgICB8fCBocG9zIDwgMAorICAgICAgfHwgdnBvcyA8 IDApCisgICAgcmV0dXJuOworICBib29sIGF1dG9faHNjcm9sbF9tb2RlX3AgPSBFUSAoRmJ1ZmZl cl9sb2NhbF92YWx1ZSAoUWF1dG9faHNjcm9sbF9tb2RlLCB3LT5jb250ZW50cyksIFFjdXJyZW50 X2xpbmUpOworICAvKiBFWEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUpICovCisgIGJvb2wgaHNjbF9h bGxfdGVtcF9wID0gKHctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hz Y3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIG5vdGhpbmcuICov CisgIGJvb2wgaHNjbF9hbGxfcGVybV8wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIEMt dSBDLXggPCBhbmQgZG8gc29tZXRoaW5nIGVsc2UgYmVzaWRlcyBob3Jpem9udGFsbHkgc2Nyb2xs aW5nIHRoZQorICAgICAgICAgICAgICAgY3VycmVudCBsaW5lIGRpZmZlcmVudGx5LgorICAgICAg ICAgICAgICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZm ZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzFfcCA9ICghdy0+c3VzcGVuZF9hdXRv X2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9k ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSB3LT5oc2Nyb2xsKTsKKyAgLyog RVhBTVBMRTogIEMtdSBDLXggPCBhbmQgLi4uCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUg aXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhz Y2xfYWxsX3Blcm1fMl9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID09IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5taW5faHNjcm9sbCAhPSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwtbGVm dCA1KTsgYW5kLCB0aGVuIHByZXNzIHRoZSBsZWZ0IGFycm93IGtleSBvbmUgdGltZS4KKyAgICAg ICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJl bnRseS4qLworICBib29sIGhzY2xfdGVtcF9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAor ICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICYmIHct Pm1pbl9oc2Nyb2xsID09IDApOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21l dGhpbmcgdGhhdCBjYXVzZXMgdGhlIGN1cnJlbnQgbGluZSB0byBiZQorICAgICAgICAgICAgICAg aG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LgorICAgICAgICAgICAgICAgQ3VycmVu dCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29s IGhzY2xfcGVybV9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAg ICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4g MAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwp OworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgaW50IGZyaW5nZV9i aXRtYXAgPSBNQ19OT19GUklOR0VfQklUTUFQOworICBpbnQgZm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ICAgICAgICAgICAgIHx8IGhzY2xfcGVybV9wKSkKKyAgICAgIHsKKyAgICAgICAg ZW51bSBmYWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgKCFhY3RpdmVf cAorICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9p bmFjdGl2ZV93aW5kb3dzKSkpCisgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwg aW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1 ZSkKKyAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2NsLXByZS16di1mYWNlIiksIHRy dWUpCisgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgIGZhY2VfaWQgPSAoY3Vy c29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgPyBv dmVybGF5X2Fycm93X2ZhY2VfaWQKKyAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lE OworICAgICAgICBpZiAoaHNjbF9hbGxfcGVybV8wX3ApCisgICAgICAgICAgZnJpbmdlX2JpdG1h cCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCBmYWxz ZSwgZmFsc2UpOworICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMV9wKQorICAgICAg ICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIr LWhzY2wtcGVybSIpLCB0cnVlLCBmYWxzZSk7CisgICAgICAgICAgICBlbHNlIGlmIChoc2NsX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AgPSBmYWxzZTsKKyAgICAg ICAgbWNfZHJhd19mcmluZ2VfYml0bWFwICh3LCByb3csIHRydWUsIGN1cnNvcl90eXBlKTsKKyAg ICAgIH0KKyAgICAgIGVsc2UgaWYgKCFyZW1vdmVfcAorICAgICAgICAgICAgICAgJiYgKGdseXBo X2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAg ICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklH SFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9X X1JFQ1RBTkdMRQorICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJU SUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3Ig PT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAg ICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAg IHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAg ICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkpCisg ICAgICAgIHsKKyAgICAgICAgICBMaXNwX09iamVjdCBiaXRtYXBfZmxhdm9yID0gKGdseXBoX2Zs YXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9 PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX2hvbGxvd19yZWN0YW5n bGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo Z2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBRbWNfaG9sbG93X3JlY3RhbmdsZQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxf QkFSX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g UW1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jh cgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3Ig PT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2JhcgorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFS X0JBQ0tTTEFTSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFt Y192ZXJ0aWNhbF9iYXJfYmFja3NsYXNoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogUW5pbDsKKyAgICAgICAgICBmcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09 IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgID8gbG9v a3VwX2ZyaW5nZV9iaXRtYXAgKGJpdG1hcF9mbGF2b3IpCisgICAgICAgICAgICAgICAgICAgICAg ICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICBmYWNlX2lkID0gKGN1cnNvcl90 eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAgICYmIChn bHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVwor ICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKSkKKyAgICAgICAgICAgICAgICAg ICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJldmVyc2VkLWJhci1w cmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9 PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBo X2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAg ICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9y ICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICA/IGxv b2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLWJhci1wcmUtenYtZmFjZSIpLCB0cnVl KQorICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICByb3ct PmN1cnNvcl9pbl9mcmluZ2VfcCA9IGZhbHNlOworICAgICAgICAgIHJvdy0+cmlnaHRfZnJpbmdl X2JpdG1hcCA9IGZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgcm93LT5yaWdodF9mcmluZ2VfZmFj ZV9pZCA9IGZhY2VfaWQ7CisgICAgICAgICAgcm93LT5yaWdodF9mcmluZ2Vfb2Zmc2V0ID0gMDsK KyAgICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IGZhbHNlOworICAgICAg ICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93LCBmYWxzZSwgY3Vyc29yX3R5cGUpOwor ICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAg ICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTKQorICAgICAgICAg IHsKKyAgICAgICAgICAgIGJvb2wgb25fcCA9IHRydWU7CisgICAgICAgICAgICBGUkFNRV9SSUYg KGYpLT5tY19zY3JpYmVfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9z LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgd2Qs IGgsIGxzbCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGdseXBoX2ZsYXZvciwgb25fcCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wKTsKKyAgICAgICAgICB9 Cit9CisKKy8qIER1bXAgY29udGVudHMgb2YgZ2x5cGggR0xZUEggdG8gc3RkZXJyLiAgUk9XIGFu ZCBBUkVBIGFyZQorICAgdGhlIGdseXBoIHJvdyBhbmQgYXJlYSB3aGVyZSB0aGUgZ2x5cGggY29t ZXMgZnJvbS4gKi8KK3ZvaWQKK21jX2R1bXBfZ2x5cGggKHN0cnVjdCBnbHlwaF9yb3cgKnJvdywg c3RydWN0IGdseXBoICpnbHlwaCwgaW50IGFyZWEsCisgICAgICAgICAgICAgICBpbnQgcmVsYXRp dmVfeCwgaW50IHZwb3MpCit7CisgIGJvb2wgZ2x5cGhfenZfcCA9IChnbHlwaCAtIHJvdy0+Z2x5 cGhzW2FyZWFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICYm IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgPT0gWlYpOworICBpZiAoZ2x5cGgtPnR5cGUg PT0gQ0hBUl9HTFlQSAorICAgICAgfHwgZ2x5cGgtPnR5cGUgPT0gR0xZUEhMRVNTX0dMWVBIKQor ICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVk ICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVzXG4iLAor ICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51 c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxh dGl2ZV94LAorICAgICAgICAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgPyAn QycKKyAgICAgICAgIDogJ0cnKSwKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChC VUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklO R1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklM UCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6 ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+dS5j aCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5l X3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBv cywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAo Z2x5cGgtPnUuY2gpKTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IFNUUkVUQ0hf R0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQv JS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMg JXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAg KChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAg ICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdTJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisg ICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAg ICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAg ICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAg ICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAwdSwKKyAg ICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisg ICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5 cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAiXFxTIik7CisgICAgfQorICBlbHNlIGlm IChnbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRl cnIsCisgICAgICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNngg JTRkICUxLjFkJTEuMWQgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ct PnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ0knLAorICAg ICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisg ICAgICAgICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisg ICAgICAgICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICAgICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxf d2lkdGgsCisgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmltZ19pZCwKKyAgICAgICAg Z2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAg IGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZf cCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgt PnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwK KyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCIsCisg ICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVz ZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0 aXZlX3gsCisgICAgICAgICcrJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChC VUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAgICAgICA6IChT VFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICA6IChO SUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICA6ICctJykp KSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5zaWduZWQgaW50KSBn bHlwaC0+dS5jbXAuaWQpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICU0ZCAlMS4xZCUxLjFk IiwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5l X3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wKTsKKyAgICAgIGlmIChnbHlwaC0+ dS5jbXAuYXV0b21hdGljKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICUzZCAlcyAuIFsl ZC0lZF1cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2 X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaC0+c2xpY2Uu Y21wLmZyb20sIGdseXBoLT5zbGljZS5jbXAudG8pOworICAgICAgICBlbHNlCisgICAgICAgIGZw cmludGYgKHN0ZGVyciwgIlxuIik7CisgICAgfQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBY V0lER0VUX0dMWVBIKQorICAgIHsKKyNpZm5kZWYgSEFWRV9YV0lER0VUUworICAgICAgZWFzc3Vt ZSAoZmFsc2UpOworI2Vsc2UKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAgJTVk LyUtNWQgJTVkICU0YyAlNmQgJWMgJTNkIDB4JTA1eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVj XG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgo cm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAg ICByZWxhdGl2ZV94LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAg ICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgPyAnQicKKyAgICAgICAg IDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAg OiAnLScpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+ZmFj ZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJp Z2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT51Lnh3aWRnZXQsCisgICAgICAgIGdseXBo LT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisjZW5kaWYK KyAgICB9Cit9CisKKy8qIER1bXAgdGhlIGNvbnRlbnRzIG9mIGdseXBoIHJvdyBhdCBWUE9TIGlu IE1BVFJJWCB0byBzdGRlcnIuCisgICBHTFlQSFMgMCBtZWFucyBkb24ndCBzaG93IGdseXBoIGNv bnRlbnRzLgorICAgR0xZUEhTIDEgbWVhbnMgc2hvdyBnbHlwaHMgaW4gc2hvcnQgZm9ybQorICAg R0xZUEhTID4gMSBtZWFucyBzaG93IGdseXBocyBpbiBsb25nIGZvcm0uICovCit2b2lkCittY19k dW1wX2dseXBoX3JvdyAoc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgdnBvcywgaW50IGdseXBo cykKK3sKKyAgaW50IHJlbGF0aXZlX3ggPSAwOworICBpZiAoZ2x5cGhzICE9IDEpCisgICAgewor ICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG5EVU1QIEdMWVBIIFJPV1xuIik7CisgICAgICBmcHJp bnRmIChzdGRlcnIsICJSb3cgICAgIFN0YXJ0ICAgICAgIEVuZCBVc2VkIG9FPjxcXENUWkZlc20g ICAgIFggICAgWSAgICBXICAgIEggICAgViAgICBBICAgIFBcbiIpOworICAgICAgZnByaW50ZiAo c3RkZXJyLCAiPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVy ciwgIiUzZCAlOSJwRCJkICU5InBEImQgJTRkICUxLjFkJTEuMWQlMS4xZCUxLjFkXAorJTEuMWQl MS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCAgJTRkICU0ZCAlNGQgJTRkICU0ZCAl NGQgJTRkXG4iLAorICAgICAgICAgdnBvcywKKyAgICAgICAgIE1BVFJJWF9ST1dfU1RBUlRfQ0hB UlBPUyAocm93KSwKKyAgICAgICAgIE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdyksCisgICAg ICAgICByb3ctPnVzZWRbVEVYVF9BUkVBXSwKKyAgICAgICAgIHJvdy0+Y29udGFpbnNfb3Zlcmxh cHBpbmdfZ2x5cGhzX3AsCisgICAgICAgICByb3ctPmVuYWJsZWRfcCwKKyAgICAgICAgIHJvdy0+ dHJ1bmNhdGVkX29uX2xlZnRfcCwKKyAgICAgICAgIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3As CisgICAgICAgICByb3ctPmNvbnRpbnVlZF9wLAorICAgICAgICAgTUFUUklYX1JPV19DT05USU5V QVRJT05fTElORV9QIChyb3cpLAorICAgICAgICAgTUFUUklYX1JPV19ESVNQTEFZU19URVhUX1Ag KHJvdyksCisgICAgICAgICByb3ctPmVuZHNfYXRfenZfcCwKKyAgICAgICAgIHJvdy0+ZmlsbF9s aW5lX3AsCisgICAgICAgICByb3ctPmVuZHNfaW5fbWlkZGxlX29mX2NoYXJfcCwKKyAgICAgICAg IHJvdy0+c3RhcnRzX2luX21pZGRsZV9vZl9jaGFyX3AsCisgICAgICAgICByb3ctPm1vdXNlX2Zh Y2VfcCwKKyAgICAgICAgIHJvdy0+eCwKKyAgICAgICAgIHJvdy0+eSwKKyAgICAgICAgIHJvdy0+ cGl4ZWxfd2lkdGgsCisgICAgICAgICByb3ctPmhlaWdodCwKKyAgICAgICAgIHJvdy0+dmlzaWJs ZV9oZWlnaHQsCisgICAgICAgICByb3ctPmFzY2VudCwKKyAgICAgICAgIHJvdy0+cGh5c19hc2Nl bnQpOworICAgICAgLyogVGhlIG5leHQgMyBsaW5lcyBzaG91bGQgYWxpZ24gdG8gIlN0YXJ0IiBp biB0aGUgaGVhZGVyLiAqLworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAgICU5InBEImQgJTki cEQiZFx0JTVkXG4iLCByb3ctPnN0YXJ0Lm92ZXJsYXlfc3RyaW5nX2luZGV4LAorICAgICAgICAg cm93LT5lbmQub3ZlcmxheV9zdHJpbmdfaW5kZXgsCisgICAgICAgICByb3ctPmNvbnRpbnVhdGlv bl9saW5lc193aWR0aCk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTkicEQiZCAlOSJw RCJkXG4iLAorICAgICAgICAgQ0hBUlBPUyAocm93LT5zdGFydC5zdHJpbmdfcG9zKSwKKyAgICAg ICAgIENIQVJQT1MgKHJvdy0+ZW5kLnN0cmluZ19wb3MpKTsKKyAgICAgIGZwcmludGYgKHN0ZGVy ciwgIiAgICAlOWQgJTlkXG4iLCByb3ctPnN0YXJ0LmRwdmVjX2luZGV4LAorICAgICAgICAgcm93 LT5lbmQuZHB2ZWNfaW5kZXgpOworICAgIH0KKyAgaWYgKGdseXBocyA+IDEpCisgICAgeworICAg ICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsr YXJlYSkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmds eXBoc1thcmVhXTsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsg cm93LT51c2VkW2FyZWFdOworICAgICAgICAgIC8qIEdseXBoIGZvciBhIGxpbmUgZW5kIGluIHRl eHQuICovCisgICAgICAgICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYmIGdseXBoID09IGdseXBo X2VuZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDApCisgICAgICAgICAgICArK2dseXBoX2VuZDsKKyAg ICAgICAgICBpZiAoZ2x5cGggPCBnbHlwaF9lbmQpCisgICAgICAgICAgICBmcHJpbnRmIChzdGRl cnIsICJHbHlwaCMvVG90YWwgUmVsLlggVCAgICAgICBQb3MgTyAgIFcgICAgIENvZGUgRmFjZSBM UiBIUE9TIFpWIENcbiIpOworICAgICAgICAgIGZvciAoOyBnbHlwaCA8IGdseXBoX2VuZDsgKytn bHlwaCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfZHVtcF9nbHlwaCAocm93LCBn bHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwgdnBvcyk7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3gg Kz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQor ICAgIGVsc2UgaWYgKGdseXBocyA9PSAxKQorICAgICAgeworICAgICAgICBjaGFyIHNbU0hSVF9N QVggKyA0XTsKKyAgICAgICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEg PCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgaTsKKyAg ICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCByb3ctPnVzZWRbYXJlYV07ICsraSkKKyAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBo c1thcmVhXSArIGk7CisgICAgICAgICAgICAgICAgaWYgKGkgPT0gcm93LT51c2VkW2FyZWFdIC0g MQorICAgICAgICAgICAgICAgICAgICAmJiBhcmVhID09IFRFWFRfQVJFQQorICAgICAgICAgICAg ICAgICAgICAmJiBOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAgICAgICAmJiBn bHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT51 LmNoID09ICcgJykKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc3Ry Y3B5ICgmc1tpXSwgIltcXG5dIik7CisgICAgICAgICAgICAgICAgICAgIGkgKz0gNDsKKyAgICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGdseXBoLT50eXBlID09 IENIQVJfR0xZUEgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT51LmNoIDwg MHg4MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPj0gJyAnKQor ICAgICAgICAgICAgICAgICAgICBzW2ldID0gZ2x5cGgtPnUuY2g7CisgICAgICAgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICBzW2ldID0gJy4nOworICAgICAgICAgICAg ICB9CisgICAgICAgICAgICBzW2ldID0gJ1wwJzsKKyAgICAgICAgICAgIGZwcmludGYgKHN0ZGVy ciwgIiUzZDogKCVkKSAnJXMnXG4iLCB2cG9zLCByb3ctPmVuYWJsZWRfcCwgcyk7CisgICAgICAg ICAgfQorICAgICAgfQorfQorCitERUZVTiAoIm1jLWR1bXAtZ2x5cGgtcm93IiwgRm1jX2R1bXBf Z2x5cGhfcm93LCBTbWNfZHVtcF9nbHlwaF9yb3csIDEsIDIsICJQIiwKKyAgICAgICBkb2M6IC8q IER1bXAgZ2x5cGggcm93IFJPVyB0byBzdGRlcnIuCitJbnRlcmFjdGl2ZWx5LCBST1cgaXMgdGhl IHByZWZpeCBudW1lcmljIGFyZ3VtZW50IGFuZCBkZWZhdWx0cyB0bwordGhlIHJvdyB3aGljaCBk aXNwbGF5cyBwb2ludC4KK09wdGlvbmFsIGFyZ3VtZW50IEdMWVBIUyAwIG1lYW5zIGRvbid0IGR1 bXAgZ2x5cGhzLgorR0xZUEhTIDEgbWVhbnMgZHVtcCBnbHlwaHMgaW4gc2hvcnQgZm9ybS4KK0dM WVBIUyA+IDEgb3Igb21pdHRlZCBtZWFucyBkdW1wIGdseXBocyBpbiBsb25nIGZvcm0uICAqLykK KyAgKExpc3BfT2JqZWN0IHJvdywgTGlzcF9PYmplY3QgZ2x5cGhzKQoreworICBzdHJ1Y3Qgd2lu ZG93ICp3ID0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KTsKKyAgc3RydWN0IGdseXBoX21hdHJp eCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgIEVNQUNTX0lOVCB2cG9zOworICBpZiAo TklMUCAocm93KSkKKyAgICB7CisgICAgICBpbnQgZDEsIGQyLCBkMywgZDQsIGQ1LCB5cG9zOwor ICAgICAgYm9vbCB2aXNpYmxlX3AgPSBwb3NfdmlzaWJsZV9wICh3LCBQVCwgJmQxLCAmZDIsICZk MywgJmQ0LCAmZDUsICZ5cG9zKTsKKyAgICAgIGludCBoZWFkZXJfbGluZV9oZWlnaHQgPSBXSU5E T1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgIGludCB2b2Zmc2V0ID0gKGhlYWRlcl9s aW5lX2hlaWdodCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICYmIHlwb3MgPiAwKQorICAgICAg ICAgICAgICAgICAgICAgID8geXBvcyArIDEKKyAgICAgICAgICAgICAgICAgICAgICA6IHlwb3M7 CisgICAgICBpZiAodmlzaWJsZV9wKQorICAgICAgICB2cG9zID0gdm9mZnNldDsKKyAgICAgICAg ZWxzZQorICAgICAgICAgIHZwb3MgPSAwOworICAgIH0KKyAgICBlbHNlCisgICAgICB7CisgICAg ICAgIENIRUNLX05VTUJFUiAocm93KTsKKyAgICAgICAgdnBvcyA9IFhGSVhOVU0gKHJvd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yZ3VtZW50LCBpdHMgdmFsdWUgaXMgcGFzc2VkIGFzIHRoZSBHTFlQ SFMgZmxhZy4gICovKQorICAoTGlzcF9PYmplY3QgZ2x5cGhzKQoreworICBzdHJ1Y3Qgd2luZG93 ICp3ID0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KTsKKyAgc3RydWN0IGJ1ZmZlciAqYnVmZmVy ID0gWEJVRkZFUiAody0+Y29udGVudHMpOworICBmcHJpbnRmIChzdGRlcnIsICJQVCA9ICUicEQi ZCwgQkVHViA9ICUicEQiZC4gWlYgPSAlInBEImRcbiIsCisgICAgIEJVRl9QVCAoYnVmZmVyKSwg QlVGX0JFR1YgKGJ1ZmZlciksIEJVRl9aViAoYnVmZmVyKSk7CisgIGZwcmludGYgKHN0ZGVyciwg IkN1cnNvciB4ID0gJWQsIHkgPSAlZCwgaHBvcyA9ICVkLCB2cG9zID0gJWRcbiIsCisgICAgIHct PmN1cnNvci54LCB3LT5jdXJzb3IueSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zKTsK KyAgZnByaW50ZiAoc3RkZXJyLCAiPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09XG4iKTsKKyAgbWNfZHVtcF9nbHlwaF9tYXRyaXggKHctPmN1cnJlbnRfbWF0cml4 LAorICAgICAgICAgVFlQRV9SQU5HRURfRklYTlVNUCAoaW50LCBnbHlwaHMpID8gWEZJWE5VTSAo Z2x5cGhzKSA6IDApOworICByZXR1cm4gUW5pbDsKK30KKworYm9vbAorbWNfdHJhdmVyc2VfY2Fj aGVfcCAoc3RydWN0IG1jX21hdHJpeCBtYXRyaXgsIGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90 eXBlLAorICAgICAgICAgICAgICAgICAgICAgaW50IHZudGgsIGludCBudGgpCit7CisgIGlmICh2 bnRoIDwgbWF0cml4LnZwb3NfdXNlZAorICAgICAgJiYgbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNo ZV90eXBlXSA+IDAKKyAgICAgICYmIG50aCA8IG1hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRb Y2FjaGVfdHlwZV0pCisgICAgcmV0dXJuIHRydWU7CisgICAgZWxzZQorICAgICAgcmV0dXJuIGZh bHNlOworfQorCit2b2lkCittY19yZXNldF9jYWNoZSAoc3RydWN0IHdpbmRvdyAqdykKK3sKKyAg aWYgKCFCVUZGRVJQICh3LT5jb250ZW50cykpCisgICAgcmV0dXJuOworICBmb3IgKGVudW0gbWNf Y2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgY2FjaGVfdHlwZSA8IE5P X0NBQ0hFOworICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICB7CisgICAgICBib29sIGJ2YXJfYWN0 aXZlX3A7CisgICAgICBzd2l0Y2ggKGNhY2hlX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgICBj YXNlIE5PX0NBQ0hFOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICByZXR1cm47CisgICAg ICAgICAgICB9CisgICAgICAgICAgY2FzZSBNQ19DQUNIRToKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgJiYg TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkpCisgICAgICAgICAg ICAgICAgYnZhcl9hY3RpdmVfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKEJV RkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkKKyAgICAgICAgICAgICAgICAg IGJ2YXJfYWN0aXZlX3AgPSB0cnVlOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICBjYXNlIENIX0NBQ0hFOgorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAmJiBOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICAgICAgICAgICAg ICBidmFyX2FjdGl2ZV9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoQlVGRkVS UCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgICAgICAgICAgICAg YnZhcl9hY3RpdmVfcCA9IHRydWU7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAg fQorICAgICAgICAgIGNhc2UgRkNfQ0FDSEU6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICYmIE5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKQorICAgICAgICAgICAgICAg IGJ2YXJfYWN0aXZlX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChCVUZGRVJQ ICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgICAgICAgICAgICAgICBi dmFyX2FjdGl2ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICAgIGlmICghYnZhcl9hY3RpdmVfcCkKKyAgICAgICAgeworICAgICAg ICAgIC8qIERlY3JlYXNlIHRoZSBzaXplIG9mIHRoZSBhcnJheSB0byBhIGJhcmUgbWluaW11bS4g Ki8KKyAgICAgICAgICBmb3IgKGludCB2bnRoID0gMDsgdm50aCA8IHctPm1jX21hdHJpeC52cG9z X3VzZWQ7ICsrdm50aCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlX2FsbG9jYXRlZFtjYWNoZV90eXBlXSA+IDEpCisgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV0gPQorICAgICAgICAgICAgICAgICAgICB4bnJlYWxsb2MgKHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdLCAxLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHNpemVvZiAqdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV0pOworICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVf YWxsb2NhdGVkW2NhY2hlX3R5cGVdID0gMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0gPSAwOwor ICAgICAgICAgICAgfQorICAgICAgICAgIHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVf dHlwZV0gPSAwOworICAgICAgICB9CisgICAgICAgIC8vICBBbHRob3VnaCBpdCB3b3VsZCBub3Qg YmUgdmVyeSBlZmZpY2llbnQsIGl0IGlzIHBvc3NpYmxlIHRvIHNldAorICAgICAgICAvLyAgdGhl IF91c2VkXyBlbGVtZW50cyBvZiB0aGUgYXJyYXkgdG8gemVyby4gIEluIHN1Y2ggYSBjYXNlLCB0 aGUKKyAgICAgICAgLy8gIC4uLl9lbHRzLmFsbG9jYXRlZFtjYWNoZV90eX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AgIHN0cnVjdCBnbHlwaCAqZ2x5cGgsIGludCB4LCBpbnQgZngs IGludCB5LCBpbnQgZnksIGludCBocG9zLCBpbnQgdnBvcywKKyAgICAgICAgICAgaW50IHdkLCBp bnQgaCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwgaW50IGN1cnNvcl93aWR0aCwK KyAgICAgICAgICAgZW51bSBtY19yb3dfcG9zaXRpb24gcm93X3Bvc2l0aW9uLCBzdHJ1Y3QgbWNf UkdCIGZvcmVncm91bmQsCisgICAgICAgICAgIHN0cnVjdCBtY19SR0IgYmFja2dyb3VuZCwgYm9v bCBhY3RpdmVfcCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLAorICAgICAgICAgICBib29s IGRyYXdfcCwgZW51bSBtY19kcmF3X3Jvd190eXBlIGZyb21fd2hlcmUsCisgICAgICAgICAgIGVu dW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlLCBlbnVtIG1jX2VuZ2luZV90eXBlIGFjdGlvbl90 eXBlKQoreworICBpbnQgdm50aCA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICBp ZiAobWNfc3RkZXJyX3AKKyAgICAgICYmIGRyYXdfcCkKKyAgICB7CisgICAgICBpbnQgY2hhcnBv cyA9IGdseXBoLT5jaGFycG9zOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG5tY19oZWxwZXIg KCVzKTogIGZyb21fd2hlcmUgKCVzKVxuXAorICBhY3Rpb25fdHlwZSAoJXMpIHwgZmxhdm9yICgl cykgfCBjaGFycG9zICglZClcblwKKyAgY2hhciAoJXMpIHwgeCAoJWQpIHwgZnggKCVkKSB8IHkg KCVkKSB8IGZ5ICglZCkgfCBocG9zICglZC8lZCkgfCB2cG9zICglZClcblwKKyAgaCAoJWQpIHwg Y3Vyc29yX3R5cGUgKCVzKSB8IGN1cnNvcl93aWR0aCAoJWQpIHwgYWN0aXZlX3AgKCVzKVxuXAor IC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CkKKyAgICAgICAgeworICAgICAgICAgIHNhbWVf cCB8PQorICAgICAgICAgICAgKHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF0uc2FtZV9wID09IHRydWUKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnR5cGUgPT0gZ2x5cGgtPnR5cGUK KyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmdseXBoLmJ5dGVwb3MgPT0gZ2x5cGgtPmJ5dGVwb3MKKyAgICAgICAgICAgICAmJiB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLmNoYXJw b3MgPT0gZ2x5cGgtPmNoYXJwb3MKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnUudmFsID09IGdseXBoLT51LnZhbAor ICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0uZ2x5cGguZmFjZV9pZCA9PSBnbHlwaC0+ZmFjZV9pZAorICAgICAgICAgICAgICYmIHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGgucGFkZGlu Z19wID09IGdseXBoLT5wYWRkaW5nX3AKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLmxlZnRfYm94X2xpbmVfcCA9PSBn bHlwaC0+bGVmdF9ib3hfbGluZV9wCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2Fja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gPT0gdHJ1ZSk7CisgICAgICAgIH0KKyAg ICAgIC8qIEluIGEgc2l0dWF0aW9uIHdoZXJlIHRoZXJlIGFyZSBubyBjaGFuZ2VzIChlLmcuLCBD LWcpLCB3ZSBzdGlsbCBuZWVkIHRvCisgICAgICByZXNldCB0aGUgbGVmdC9yaWdodCBmcmluZ2Ug Yml0bWFwIGluZGljYXRvcnMuICovCisgICAgICBpZiAoIXNhbWVfcAorICAgICAgICAgIHx8IGN1 cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgIHx8IGN1cnNvcl90 eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIG1jX2RyYXdfZXJhc2VfaHli cmlkICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwgY3Vy c29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGZv cmVncm91bmQsIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAgIHJldHVy bjsKKyAgICB9CisgICAgZWxzZSBpZiAoZHJhd19wCisgICAgICAgICAgICAgJiYgKGZyb21fd2hl cmUgPT0gU0NSSUJFX09ORQorICAgICAgICAgICAgICAgICB8fCBmcm9tX3doZXJlID09IFNDUklC RV9UV08KKyAgICAgICAgICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBTQ1JJQkVfVEhSRUUKKyAg ICAgICAgICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBOT1dIRVJFKSkKKyAgICAgIHsKKyAgICAg ICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhw b3MsIHZwb3MsIHdkLCBoLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgcmVt b3ZlX3ApOworICAgICAgICByZXR1cm47CisgICAgICB9CisgIGlmIChjYWNoZV90eXBlID09IE5P X0NBQ0hFKQorICAgIHJldHVybjsKKyAgKyt3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hl X3R5cGVdOworICBpZiAodm50aCA+PSB3LT5tY19tYXRyaXgudnBvc191c2VkKQorICAgIHctPm1j X21hdHJpeC52cG9zX3VzZWQgPSB2bnRoICsgMTsKKyAgaWYgKHctPm1jX21hdHJpeC52cG9zX2Fs bG9jYXRlZCA8IHctPm1jX21hdHJpeC52cG9zX3VzZWQpCisgICAgeworICAgICAgaW50IG9sZF9h bGxvYyA9IHctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZDsKKyAgICAgIGludCBuZXdfZWx0cyA9 IHctPm1jX21hdHJpeC52cG9zX3VzZWQgLSB3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQ7Cisg ICAgICB3LT5tY19tYXRyaXgudnBvcyA9IHhwYWxsb2MgKHctPm1jX21hdHJpeC52cG9zLCAmdy0+ bWNfbWF0cml4LnZwb3NfYWxsb2NhdGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBuZXdfZWx0cywgSU5UX01BWCwgc2l6ZW9mICp3LT5tY19tYXRyaXgudnBvcyk7CisgICAg ICBtZW1zZXQgKHctPm1jX21hdHJpeC52cG9zICsgb2xkX2FsbG9jLCAwLAorICAgICAgICAgICAg ICAgKHctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZCAtIG9sZF9hbGxvYykgKiBzaXplb2YgKnct Pm1jX21hdHJpeC52cG9zKTsKKyAgICB9CisgICsrdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVfdXNlZFtjYWNoZV90eXBlXTsKKyAgaWYgKHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl X2FsbG9jYXRlZFtjYWNoZV90eXBlXSA8IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3Vz ZWRbY2FjaGVfdHlwZV0pCisgICAgeworICAgICAgaW50IG9sZF9hbGxvYyA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlX2FsbG9jYXRlZFtjYWNoZV90eXBlXTsKKyAgICAgIGludCBuZXdf ZWx0cyA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0gLSB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV07CisgICAg ICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSA9IHhwYWxsb2MgKHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfZWx0cywKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg SU5UX01BWCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgc2l6ZW9mICp3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXSk7CisgICAgICBtZW1zZXQgKHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdICsgb2xkX2FsbG9jLCAwLAorICAgICAgICAgICAgICAgKHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2h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5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwKKyAgICAgICAg ICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IGhwb3MsIGludCB2cG9zKQor eworICBzdHJ1Y3QgZ2x5cGggKmdseXBoOworICBpZiAoISh2cG9zID49IDAKKyAgICAgICAgJiYg dnBvcyA8IG1hdHJpeC0+bnJvd3MpKQorICAgIHJldHVybiBOVUxMOworICBpZiAoIXJvdy0+ZW5h YmxlZF9wKQorICAgIHJldHVybiBOVUxMOworICBpZiAody0+aHNjcm9sbCkKKyAgICB7CisgICAg ICAvKiBXaGVuIHRoZSB3aW5kb3cgaXMgaHNjcm9sbGVkLCBjdXJzb3IgaHBvcyBjYW4gbGVnaXRp bWF0ZWx5IGJlCisgICAgICBvdXQgb2YgYm91bmRzLCBidXQgd2UgZHJhdyB0aGUgY3Vyc29yIGF0 IHRoZSBjb3JyZXNwb25kaW5nCisgICAgICB3aW5kb3cgbWFyZ2luIGluIHRoYXQgY2FzZS4gKi8K KyAgICAgIGlmICghcm93LT5yZXZlcnNlZF9wICYmIGhwb3MgPCAwKQorICAgICAgICBocG9zID0g MDsKKyAgICAgIGlmIChyb3ctPnJldmVyc2VkX3AgJiYgaHBvcyA+PSByb3ctPnVzZWRbVEVYVF9B UkVBXSkKKyAgICAgICAgaHBvcyA9IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgICB9Cisg IGlmICgwIDw9IGhwb3MgJiYgaHBvcyA8IHJvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgIGdseXBo ID0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3M7CisgICAgZWxzZQorICAgICAgZ2x5cGgg PSBOVUxMOworICByZXR1cm4gZ2x5cGg7Cit9CisKKy8qIFRoaXMgZnVuY3Rpb24gZGlmZmVycyBz dWJzdGFudGlhbGx5IGZyb20gYGdldF9waHlzX2N1cnNvcl9nZW9tZXRyeScuCis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ICAgICAgICAg ICAgICAgTUNfSEJBUiBhcyB0byBgbWMtcmVhbC1mYWtlLWN1cnNvcicuCisgICBNVUxUSVBMRV9D VVJTT1JTOiAgV2UgZG8gbm90IHVzZSB0aGlzIGZ1bmN0aW9uLgorICAgSE9SSVpPTlRBTF9SVUxF UjogIFdlIHdhbnQgYSB1bml2ZXJzYWwgRlkgY29vcmRpbmF0ZSBmb3IgYSBsZXZlbCBydWxlci4K KyAgIFZFUlRJQ0FMX1JVTEVSIGFuZCBGSUxMX0NPTFVNTjogIFdlIHdhbnQgYW4gSCB0aGF0IGVu c3VyZXMgbm8gZ2FwIGJldHdlZW4gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBwcmV2aW91cy9uZXh0IGxpbmUuICBUaGUgRlggY29vcmRpbmF0ZSBpcyBzZXQKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V3aGVyZTogIGB3LT5jdXJzb3IueGAg LyBgbWMuZmNfeGAuICovCit2b2lkCittY19nZXRfY3Vyc29yX2dlb21ldHJ5IChzdHJ1Y3Qgd2lu ZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsCisgICAgICAgICAgICAgICAgICAg ICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB4LCBpbnQgKmZ4LCBpbnQgeSwKKyAgICAg ICAgICAgICAgICAgICAgICAgIGludCAqZnksIGludCBocG9zLCBpbnQgdnBvcywgaW50ICpoLAor ICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwg aW50IGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCAqd2QpCit7Cisg IHN0cnVjdCBnbHlwaCAqZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJv dywgaHBvcywgdnBvcyk7CisgIGlmIChnbHlwaCA9PSBOVUxMKQorICAgIHJldHVybjsKKyAgc3Ry dWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgKmZ4ID0gV0lORE9X X1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICpoID0gcm93LT52aXNpYmxlX2hlaWdo dDsKKyAgLyogRG9uJ3QgbGV0IHRoZSBjdXJzb3IgZXhjZWVkIHRoZSBkaW1lbnNpb25zIG9mIHRo ZSByb3csIHNvIHRoYXQKKyAgdGhlIHVwcGVyL2xvd2VyIHNpZGUgb2YgdGhlIGJveCBhcmVuJ3Qg Y2xpcHBlZC4gICovCisgIGludCB3X2hlYWRlcl9saW5lX2hlaWdodCA9IFdJTkRPV19IRUFERVJf TElORV9IRUlHSFQgKHcpOworICBpbnQgd190ZXh0X2JvdHRvbV95ID0gd2luZG93X3RleHRfYm90 dG9tX3kgKHcpIC0gKmg7CisgIGlmICh5IDwgd19oZWFkZXJfbGluZV9oZWlnaHQpCisgICAgewor ICAgICAgKmggPSBtYXggKCpoIC0gKHdfaGVhZGVyX2xpbmVfaGVpZ2h0IC0geSkgKyAxLCAqaCk7 CisgICAgICB5ID0gd19oZWFkZXJfbGluZV9oZWlnaHQgLSAxOworICAgICAgLy8gZnByaW50ZiAo c3RkZXJyLCAiQ09ORElUSU9OICMgMVxuIik7CisgICAgfQorICAgZWxzZSBpZiAoeSA+IHdfdGV4 dF9ib3R0b21feSkKKyAgICAgeworICAgICAgICpoICs9IHkgLSB3X3RleHRfYm90dG9tX3k7Cisg ICAgICAgeSA9IHdfdGV4dF9ib3R0b21feTsKKyAgICAgICAvLyBmcHJpbnRmIChzdGRlcnIsICJD T05ESVRJT04gIyAyXG4iKTsKKyAgICAgfQorICAqZnkgPSBXSU5ET1dfVE9fRlJBTUVfUElYRUxf WSAodywgeSk7CisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgeworICAgICAgY2FzZSBNQ19C QVI6CisgICAgICAgIHsKKyAgICAgICAgICBpZiAoY3Vyc29yX3dpZHRoIDwgMSkKKyAgICAgICAg ICAgIGN1cnNvcl93aWR0aCA9IG1heCAoRlJBTUVfQ1VSU09SX1dJRFRIIChmKSwgMSk7CisgICAg ICAgICAgaWYgKGN1cnNvcl93aWR0aCA8IGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgICAq d2QgPSBjdXJzb3Jfd2lkdGg7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNh c2UgTUNfSEJBUjoKKyAgICAgICAgeworICAgICAgICAgIGludCBjdXJzb3JfaGVpZ2h0ID0gKGN1 cnNvcl93aWR0aCA8IDEpID8gbHJpbnQgKDAuMjUgKiAqaCkgOiBjdXJzb3Jfd2lkdGg7CisgICAg ICAgICAgaWYgKGN1cnNvcl9oZWlnaHQgPiByb3ctPmhlaWdodCkKKyAgICAgICAgICAgIGN1cnNv cl9oZWlnaHQgPSByb3ctPmhlaWdodDsKKyAgICAgICAgICAvKiBDdXJzb3Igc21hbGxlciB0aGFu IGxpbmUgaGVpZ2h0LCBzbyBtb3ZlIGRvd24uICovCisgICAgICAgICAgaWYgKCpoID4gY3Vyc29y X2hlaWdodCkKKyAgICAgICAgICAgICpmeSArPSAqaCAtIGN1cnNvcl9oZWlnaHQ7CisgICAgICAg ICAgKmggPSBjdXJzb3JfaGVpZ2h0OworICAgICAgICAgICp3ZCA9IGdseXBoLT5waXhlbF93aWR0 aDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBNQ19SSUdIVF9GUklO R0VfQklUTUFQOgorICAgICAgY2FzZSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICBjYXNl IE1DX05PX0ZSSU5HRV9CSVRNQVA6CisgICAgICBjYXNlIE1DX05PX0NVUlNPUjoKKyAgICAgIGNh c2UgTUNfRlJBTUVEX0JPWDoKKyAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICAgIGNhc2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ID09IHJvdy0+ dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICYmIE1BVFJJWF9ST1dfRU5EX0NI QVJQT1MgKHJvdykgPT0gWlYpOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1l KTsKKyAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKHctPmNvbnRlbnRzKTsKKyAgaW50IHRl eHRfYXJlYV93aWR0aCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgIHN0cnVj dCBnbHlwaF9yb3cgKmN1cnNvcl9yb3cgPSAody0+Y3Vyc29yLnZwb3MgIT0gLTEpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1cgKGN1cnNvcl9tYXRyaXgsIHct PmN1cnNvci52cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOwor ICBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGN1 cnNvcl9tYXRyaXgsIGN1cnNvcl9yb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICBib29sIGN1cnNvcl9hdF9m cmluZ2VfcCA9IChjdXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9s aW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gdGV4 dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54 ID09IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRoKTsKKyAgYm9vbCBjdXJzb3JfYmV5b25kX2ZyaW5n ZV9wID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPmN1cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWN1cnNvcl9yb3ctPmV4YWN0X3dpbmRv d193aWR0aF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1 cnNvci54ID49IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+Y3Vyc29yLnggPj0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOworICBpbnQgZnJh bWVfY2hhcl93aWR0aCA9IEZSQU1FX0NPTFVNTl9XSURUSCAoZik7CisgIGludCB0ZW1wX2ZhY2Vf aWQgPSBnbHlwaC0+ZmFjZV9pZDsKKyAgc3RydWN0IG1jX1JHQiBiYWNrZ3JvdW5kOworICBtY19z ZXRfbHNsX2JnICh3LCB0ZW1wX2ZhY2VfaWQsICZiYWNrZ3JvdW5kKTsKKyAgYm9vbCByZWFsX2Zh a2VfY3Vyc29yX3AgPSAob3BvaW50X3ggPT0gcmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvcG9pbnRfaHBvcyA9PSBocG9zCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9wb2ludF95ID09IHJvdy0+eQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKTsKKworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisv KiAgICAgICAgICAgICAgICAgICAgICAgQkVHSU46ICBDSEFSX0dMWVBIIHwgR0xZUEhMRVNTX0dM WVBIICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICBpZiAo Z2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgfHwgZ2x5cGgtPnR5cGUgPT0gR0xZUEhM RVNTX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgZnByaW50ZiAoc3Rk ZXJyLAorICAgICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUw NnggJTRkICUxLjFkJTEuMWQgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmds eXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiBy b3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgKGdseXBo LT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgID8gJ0MnCisgICAgICAgICA6ICdHJyksCisg ICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkK KyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAg ICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgICAgICAg IGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPnUuY2gsCisgICAgICAgIGdseXBo LT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlw aC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2X3AgPyAi WlYiIDogIi0tIiwKKyAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKGdseXBoLT51LmNoKSk7Cisg IHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyog ICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19H TFlQSCAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNl IE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJv dywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAg ICAgICAgd2QsIGgsIGN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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6CisgICAg eworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9mcmluZ2Vf 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 ICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+ dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IG9wb2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJ R0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJ Q0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJU SUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgfHwgZ2x5c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LSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFs cy5mY194ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo IU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVy dGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b3BvaW50X3kgPT0geQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b3BvaW50X3Zwb3MgPT0gdnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog TUNfR0xZUEg7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93 LCBnbHlwaCwgcmVsYXRpdmVfeCwgZmNfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAg ICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBm b3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2 ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93aGV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wZSA9PSBTVFJFVENIX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAg ZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJk ICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5 cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9 PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAg ICAgICAgJ1MnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGds eXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgt Pm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+ b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAor ICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgt PnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpW IiA6ICItLSIsCisgICAgICAgICJcXFMiKTsKKyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAgewor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICA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ha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0 cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAg ICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3Np dGlvbiwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRp YWxzLmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAg ICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+ Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJl bGF0aXZlX3ggPD0geF9saW1pdCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChyZWxhdGl2ZV94 IDwgcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBp eGVsX3dpZHRoOworICAgICAgICAgIHRlbXBfZmFjZV9pZCA9IChyb3ctPmZpbGxfbGluZV9wKQor ICAgICAgICAgICAgICAgICAgICAgICAgID8gZ2x5cGgtPmZhY2VfaWQKKyAgICAgICAgICAgICAg ICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGJh Y2tncm91bmQ7CisgICAgICAgICAgbWNfc2V0X2xzbF9iZyAodywgdGVtcF9mYWNlX2lkLCAmYmFj a2dyb3VuZCk7CisgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJl bGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgIHhf bGltaXQgLSByZWxhdGl2ZV94LCBoLCBjdXJzb3JfdHlwZSwgeF9saW1pdCAtIHJlbGF0aXZlX3gs CisgICAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsIGJhY2tncm91 bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICBNQ19HTFlQSExF U1MsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAg ICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAg ICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIFNUUkVUQ0hfR0xZUEggICAg ICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBW RVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBpZiAocm93LT5maWxsX2xpbmVfcAorICAgICAg ICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0g LSAxCisgICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dp ZHRoKQorICAgICAgICB0ZW1wX2ZhY2VfaWQgPSBnbHlwaC0+ZmFjZV9pZDsKKyAgICAgICAgZWxz ZSBpZiAoIXJvdy0+ZmlsbF9saW5lX3AKKyAgICAgICAgICAgICAgICAgJiYgZ2x5cGggLSByb3ct PmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAg ICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAg ICAgIHRlbXBfZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgIHN0cnVjdCBtY19SR0Ig YmFja2dyb3VuZDsKKyAgICAgIG1jX3NldF9sc2xfYmcgKHcsIHRlbXBfZmFjZV9pZCwgJmJhY2tn cm91bmQpOworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9m cmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29u dGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVS VElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJ R0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3Jf YmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNl ZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSExFU1M7CisgICAgICBpZiAoZ2x5cGhfZmxh dm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2Zs YXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8 fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2 b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IE1D X1JJR0hUX0ZSSU5HRV9CSVRNQVA7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcs IG1hdHJpeCwgcm93LCBnbHlwaCwgb3BvaW50X3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3MsIHZw b3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBy b3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVz c2VudGlhbHMuYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLAorICAg ICAgICAgICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAg ICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAg ICAgRklMTF9DT0xVTU46ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAqLwor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7Cisg ICAgICBpZiAocm93LT5maWxsX2xpbmVfcAorICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgZXNzZW50 aWFscy5mY194ID4gcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgdGVt cF9mYWNlX2lkID0gZ2x5cGgtPmZhY2VfaWQ7CisgICAgICAgIGVsc2UgaWYgKCFyb3ctPmZpbGxf bGluZV9wCisgICAgICAgICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XSA9PSByb3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S0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQ6ICBTVFJFVENIX0dM WVBIICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgQkVHSU46ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IElNQUdF X0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgZnByaW50ZiAoc3RkZXJy LAorICAgICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNngg JTRkICUxLjFkJTEuMWQgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ct PnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ0knLAorICAg ICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisg ICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAg ICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAg ICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+ cGl4ZWxfd2lkdGgsCisgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmltZ19pZCwKKyAg ICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisg ICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5 cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicpOworICBzd2l0Y2ggKGFjdGlvbl90 eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAg ICAgICAgIE1VTFRJUExFX0NVUlNPUlM6ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAg ICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JT OgorICAgIHsKKyAgICAgIGN1cnNvcl90eXBlID0gTUNfSE9MTE9XX0JPWDsKKyAgICAgIG1jX2hl bHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRo LCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQs IGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAg ICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAg IH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAg SE9SSVpPTlRBTF9SVUxFUjogIElNQUdFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICovCisv KiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAg eworICAgICAgY3Vyc29yX3R5cGUgPSBNQ19IT0xMT1dfQk9YOworICAgICAgaWYgKCFyZWFsX2Zh a2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCBy ZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2Qs IGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3VuZCwK KyAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19H TFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUs IGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIElNQUdF X0dMWVBIICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K KyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAgIHsKKyAgICAgIGN1cnNvcl90eXBlID0gTUNf SE9MTE9XX0JPWDsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxh dGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBj dXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAg ICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBk cmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90 eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyog ICAgICAgICAgICAgICAgICAgICAgICAgICAgRklMTF9DT0xVTU46ICBJTUFHRV9HTFlQSCAgICAg ICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0t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worLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisKKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgQkVHSU46ICBDT01QT1NJ VEVfR0xZUEggICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICB7Cisg ICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgeworICAgICAgICBmcHJpbnRmIChzdGRlcnIsCisg ICAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4IiwK KyAgICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgKChy b3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAg ICAgcmVsYXRpdmVfeCwKKyAgICAgICAgICAnKycsCisgICAgICAgICAgZ2x5cGgtPmNoYXJwb3Ms CisgICAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgID8gJ0InCisg ICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgID8gJ1Mn CisgICAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICAg ID8gJzAnCisgICAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICAgIGdseXBoLT5waXhl bF93aWR0aCwKKyAgICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5jbXAuaWQpOworICAg ICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAgICAgIGdseXBo LT5mYWNlX2lkLAorICAgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgICAg Z2x5cGgtPnJpZ2h0X2JveF9saW5lX3ApOworICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0 aWMpCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgJTNkICVzIC4gWyVkLSVkXVxuIiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAi LS0iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5 cGgtPnNsaWNlLmNtcC50byk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICBmcHJpbnRmIChzdGRl cnIsICJcbiIpOworICAgICAgfQorICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJT T1JTOiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgorICAgIHsKKyAgICAgIG1j X2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhw b3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dp ZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91 bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsCisg ICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOwor ICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAg IEhPUklaT05UQUxfUlVMRVI6ICBDT01QT1NJVEVfR0xZUEggICAgICAgICAgICAgICAgICAgICov CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6Cisg ICAgeworICAgICAgaWYgKHJlbGF0aXZlX3ggPD0geF9saW1pdAorICAgICAgICAgICYmICFyZWFs X2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBo LCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAg d2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3Vu ZCwKKyAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBN Q19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICAgIGNhY2hlX3R5 cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJlbGF0aXZlX3ggPD0geF9s aW1pdCkKKyAgICAgICAgeworICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dp ZHRoOworICAgICAgICAgIHdoaWxlIChyZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxh dGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAg d2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3Vu ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2 ZV9wLCBNQ19HTFlQSExFU1MsIGRyYXdfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBmcm9t X3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAgICAgICAgIHJlbGF0aXZl X3ggKz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAg YnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAg ICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAg ICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVM RVI6CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9h dF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+ Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNf VkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3Ap CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJz b3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2Vf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+ dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFd ID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVS U0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2Z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BoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSBy b3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgZXNzZW50aWFscy5mY194ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj aF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBNQ19HTFlQSDsKKyAgICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4 LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAg ICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRp b24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMu YWN0aXZlX3AsIG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gIGVsc2UgaWYgKGds eXBoLT50eXBlID09IFhXSURHRVRfR0xZUEgpCisgIHsKKyNpZm5kZWYgSEFWRV9YV0lER0VUUwor ICAgIGVhc3N1bWUgKGZhbHNlKTsKKyNlbHNlCisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAg ZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiXG4gICU1ZC8lLTVkICU1ZCAlNGMgJTZkICVjICUz ZCAweCUwNXggJTRkICUxLjFkJTEuMWQgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/ IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAg J1gnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5v YmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVj dCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6ICctJykpLAorICAgICAgICBnbHlw aC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+ bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAg ICAgZ2x5cGgtPnUueHdpZGdldCwKKyAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2X3AgPyAi WlYiIDogIi0tIiwKKyAgICAgICAgJy4nKTsKKyNlbmRpZgorICBzd2l0Y2ggKGFjdGlvbl90eXBl KQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAg ICAgTVVMVElQTEVfQ1VSU09SUzogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAgICAgICAgICAq LworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgor ICAgIHsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94 LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3Jf dHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAg ICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3As IGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsK KyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAg ICAgICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSOiAgWFdJREdFVF9HTFlQSCAgICAgICAg ICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUkla T05UQUxfUlVMRVI6CisgICAgeworICAgICAgaWYgKHJlbGF0aXZlX3ggPD0geF9saW1pdAorICAg ICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0 cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAg ICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3Np dGlvbiwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRp YWxzLmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAg ICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+ Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJl bGF0aXZlX3ggPD0geF9saW1pdCkKKyAgICAgICAgeworICAgICAgICAgIHJlbGF0aXZlX3ggKz0g Z2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgIHdoaWxlIChyZWxhdGl2ZV94IDw9IHhfbGlt aXQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCBy b3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAg ICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3Np dGlvbiwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBl c3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSExFU1MsIGRyYXdfcCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICBmcm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAg ICAgICAgIHJlbGF0aXZlX3ggKz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisv KiAgICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVI6ICBYV0lER0VUX0dMWVBI ICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNh c2UgVkVSVElDQUxfUlVMRVI6CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxh dm9yID0gKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3Ap CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFS CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNh dGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g TUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9S SUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29y X2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JB UgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmds eXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAg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MVU1O OiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworICAgIGNhc2UgRklMTF9DT0xVTU46CisgICAgeworICAgICAgZW51bSBtY19m bGF2b3IgZ2x5cGhfZmxhdm9yID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSBy b3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgZXNzZW50aWFscy5mY194ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj aF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBNQ19HTFlQSDsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCBy ZWxhdGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdk LCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQs CisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIGdseXBo X2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICBjYWNoZV90eXBl LCBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKyAgICBjYXNlIENVUlNPUl9JTkRJQ0FUT1I6CisgICAgeworICAgICAgYnJlYWs7Cisg ICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIH0KKyAgfQorLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQ6ICBYV0lER0VU X0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LSAqLworfQorCit2b2lkCittY19kcmF3X3JvdyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGds eXBoX21hdHJpeCAqbWF0c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wb3Nfc3Rh cnQgPSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgIGlmIChtY19zdGRlcnJfcCkK KyAgICBmcHJpbnRmIChzdGRlcnIsICJtY19kcmF3X3JvdyAoJWQpOiAgZHJhd19wICglcykgfCBo cG9zICglZCkgfCBsZW4gKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgIHZwb3MsIGRyYXdf cCA/ICJ5IiA6ICJuIiwgaHBvc19zdGFydCwgaHBvc19sZW5ndGgpOworICBpbnQgb3BvaW50X2Z4 LCBvcG9pbnRfZnksIG9wb2ludF93ZCwgb3BvaW50X2g7CisgIGludCB0ZXh0X2FyZWFfd2lkdGgg PSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICBpbnQgaGVhZGVyX2xpbmVfZm9y bWF0ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgIHN0cnVjdCBnbHlwaF9yb3cg KmN1cnNvcl9yb3cgPSAody0+Y3Vyc29yLnZwb3MgIT0gLTEpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1BVFJJWF9ST1cgKGN1cnNvcl9tYXRyaXgsIHctPmN1cnNvci52cG9z KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICBzdHJ1Y3QgZ2x5 cGggKmN1cnNvcl9nbHlwaCA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGN1cnNvcl9tYXRyaXgs IGN1cnNvcl9yb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBOVUxMOworICBib29sIGN1cnNvcl9hdF9mcmluZ2VfcCA9IChj dXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJz b3Jfcm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29y Lmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIGN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gdGV4dF9hcmVhX3dpZHRo CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IGN1cnNvcl9y b3ctPnBpeGVsX3dpZHRoKTsKKyAgYm9vbCBjdXJzb3JfYmV5b25kX2ZyaW5nZV9wID0gKGN1cnNv cl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJz b3Jfcm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1 cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgIWN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5l X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHRl eHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnggPj0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqCisgICAgICAgICAgICAgICAgICAgICAgICAgIFJFUExBQ0UgVEhFIFJFQUwgQ1VSU09SCisq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKyAgZW51bSBmYWNlX2lkIGJnX2ZhY2VfaWQgPSAoY3Vy c29yX2dseXBoICE9IE5VTEwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBjdXJzb3Jf Z2x5cGgtPmZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFD RV9JRDsKKyAgc3RydWN0IG1jX1JHQiBjdXJzb3JfYmc7CisgIG1jX3NldF9sc2xfYmcgKHcsIGJn X2ZhY2VfaWQsICZjdXJzb3JfYmcpOworICAvKiBGSVhNRTogIFB1dCBpbiBzb21lIGNvZGUgdG8g ZGVmYXVsdCB0byBNQ19IT0xMT1dfQk9YIGlmIHRoZSB1c2VyIGhhcworICB1bndpdHRpbmdseSBj b21lIHVwIHdpdGggc29tZSB1bmFjY2VwdGFibGUgZm9ybSBvZiB1bnJlY29nbml6ZWQgY3Vyc29y IHR5cGUuICovCisgIExpc3BfT2JqZWN0IGxpc3BfdHlwZSA9IEJWQVIgKGIsIG1jX3JlYWxfZmFr ZV9jdXJzb3IpOworICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID0gKENPTlNQIChs aXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNw X3RvX2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOworICBp bnQgY3Vyc29yX3dpZHRoID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAg ICAgPyBYRklYTlVNIChYQ0FSIChYQ0RSIChsaXNwX3R5cGUpKSkKKyAgICAgICAgICAgICAgICAg ICAgIDogLTE7CisgIHN0cnVjdCBtY19SR0IgY3Vyc29yX2ZnOworICBtY19jb2xvcl9waWNrZXIg KHcsIGN1cnNvcl9nbHlwaCwgZXNzZW50aWFscywgJmN1cnNvcl9mZywgLTEsIGN1cnNvcl90eXBl LAorICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgQ1VSU09SX0lORElDQVRPUik7Cisg IGJvb2wgZmlsbF9jb2x1bW5fdHJ1bXBzX3AgPSAoIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2Fs X3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo YiwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnggPT0gZXNzZW50aWFscy5mY194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgIWN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm ICFjdXJzb3JfYmV5b25kX2ZyaW5nZV9wKTsKKyAgLyogV2UgdXNlIGEgdGVzdCBzaW1pbGFyIHRv IHRoZSByZWFsIGZha2UgY3Vyc29yIHNvIHRoYXQgdGhlIGZyaW5nZSBiaXRtYXAgaXMKKyAgb25s eSBkcmF3biBvbmNlIHBlciB3aW5kb3cuICovCisgIGlmICh2cG9zID09IHctPmN1cnNvci52cG9z CisgICAgICAmJiBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGggPT0gcm93LT51c2VkW1RFWFRfQVJF QV0KKyAgICAgICYmICFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmICFOSUxQ IChCVkFSIChiLCBjaF9ob3Jpem9udGFsX3J1bGVyKSkpCisgICAgeworICAgICAgLyogZnJpbmdl IGJpdG1hcHMgdXNlIGZhY2VfaWQgdG8gc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vbGxpbmcuICovCisgIGVsc2Ug aWYgKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJz b3IudnBvcworICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAg ICAgICAgICYmIChocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgpID09IHJvdy0+dXNlZFtURVhUX0FS RUFdCisgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAg ICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hvcml6b250YWxfcnVsZXIpKSkKKyAgICB7CisgICAg ICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFO R0xFX1JJR0hUX0FSUk9XOworICAgICAgc3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV07CisgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsgcm93 LT51c2VkW1RFWFRfQVJFQV07CisgICAgICAvKiBHbHlwaCBmb3IgYSBsaW5lIGVuZCBpbiB0ZXh0 LiAqLworICAgICAgaWYgKGdseXBoID09IGdseXBoX2VuZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDAp CisgICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywg Z2x5cGhfZW5kIC0gMSwgcm93LT5waXhlbF93aWR0aCwgLTEsIHctPmN1cnNvci55LAorICAgICAg ICAgICAgICAgICAtMSwgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxLCB3LT5jdXJzb3IudnBvcywg LTEsIC0xLAorICAgICAgICAgICAgICAgICBNQ19SSUdIVF9GUklOR0VfQklUTUFQLCAtMSwgcm93 X3Bvc2l0aW9uLCBjdXJzb3JfZm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cG9pbnRfZnksIHct PmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgTUNfQkFSLCAxLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAo dywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+ Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHct PmN1cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBNQ19C QVIsIDEsIHJvd19wb3NpdGlvbiwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0 aXZlX3AsCisgICAgICAgICAgICAgICAgIE1DX0dMWVBITEVTUywgZHJhd19wLCBmcm9tX3doZXJl LCBOSUxQIChCVkFSIChiLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IENIX0NBQ0hFCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21l dHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsIHctPmN1cnNvci55 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhw b3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBNQ19IQkFSLCAxLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4 LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnks CisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52 cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBNQ19IQkFSLCAxLCBy b3dfcG9zaXRpb24sIGN1cnNvcl9mZywgY3Vyc29yX2JnLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLAor ICAgICAgICAgICAgICAgICBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLCBOSUxQIChCVkFS IChiLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgICB9CisgIGVsc2UgaWYg KCFjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoICE9IE5VTEwK KyAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAmJiB3LT5j dXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zIDwg aHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+dHlw ZSAhPSBTVFJFVENIX0dMWVBIKQorICAgIHsKKyAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkg KHcsIG1hdHJpeCwgcm93LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywg dy0+Y3Vyc29yLnZwb3MsICZvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsICZvcG9pbnRfd2QpOworICAgICAgbWNfaGVscGVy ICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4LCB3 LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywg dy0+Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisgICAgICAgICAgICAgICAgIGN1 cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgY3Vyc29yX2ZnLCBjdXJzb3Jf YmcsCisgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3 X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgIE5JTFAgKEJWQVIgKGIsIG1jX2NvbmYp KQorICAgICAgICAgICAgICAgICA/IENIX0NBQ0hFCisgICAgICAgICAgICAgICAgIDogTUNfQ0FD SEUsIENVUlNPUl9JTkRJQ0FUT1IpOworICAgIH0KKyAgZWxzZSBpZiAoIWN1cnNvcl9hdF9mcmlu Z2VfcAorICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAmJiB2 cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID49IGhw b3Nfc3RhcnQKKyAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPCBocG9zX3N0YXJ0ICsgaHBv c19sZW5ndGgKKyAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZ UEgpCisgICAgeworICAgICAgLyogSWYgYSB1c2VyIGhhcyBzZXQgYHgtc3RyZXRjaC1jdXJzb3In IHRvIGEgbm9uLW5pbCB2YWx1ZSwgaGUvc2hlIGNob3NlIHRvCisgICAgICBoYXZlIGEgY3Vyc29y IHRoYXQgc3BhbnMgdGhlIGVudGlyZSBsZW5ndGggb2YgdGhlIFNUUkVUQ0hfR0xZUEguICovCisg ICAgICBpZiAoIXhfc3RyZXRjaF9jdXJzb3JfcCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRo ZSBNQ19IQkFSIHNoYWxsIGhhdmUgYSBgY3Vyc29yX3dpZHRoYCBvZiAxLiAqLworICAgICAgICAg IG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93LCB3LT5jdXJzb3IueCwgJm9w b2ludF9meCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IueSwg Jm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgdy0+Y3Vyc29yLnZwb3MsICZvcG9pbnRfaCwgTUNfSEJBUiwgMSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmb3BvaW50X3dkKTsKKyAgICAgICAgICBtY19oZWxwZXIg KHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54LCBvcG9pbnRfZngsCisg ICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IueSwgb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBv cywgdy0+Y3Vyc29yLnZwb3MsCisgICAgICAgICAgICAgICAgICAgICBvcG9pbnRfd2QsIG9wb2lu dF9oLCBNQ19IQkFSLCAxLCByb3dfcG9zaXRpb24sIGN1cnNvcl9mZywKKyAgICAgICAgICAgICAg ICAgICAgIGN1cnNvcl9iZywgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwg ZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgICAgIE5JTFAgKEJWQVIgKGIsIG1jX2NvbmYp KQorICAgICAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAg OiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgICAgIH0KKyAgICAgIG1jX2dldF9j dXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci55LCAmb3BvaW50X2Z5LCB3 LT5jdXJzb3IuaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci52 cG9zLCAmb3BvaW50X2gsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgY3Vyc29yX3dpZHRoLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4 LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnks CisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52 cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwg Y3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGN1cnNvcl9mZywgY3Vyc29yX2JnLAorICAgICAg ICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3do ZXJlLAorICAgICAgICAgICAgICAgICBOSUxQIChCVkFSIChiLCBtY19jb25mKSkKKyAgICAgICAg ICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAgICA6IE1DX0NBQ0hFLCBDVVJTT1Jf SU5ESUNBVE9SKTsKKyAgICB9CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgRFJBVyBBTkQgUkVDT1JEIEZBS0UgQ1VSU09SUworKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisgIGlmICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgJiYgTklMUCAo QlZBUiAoYiwgbWNfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAmJiBOSUxQIChCVkFSIChiLCBj aF9pbmFjdGl2ZV93aW5kb3dzKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKGIsIGZjX2luYWN0aXZl X3dpbmRvd3MpKSkKKyAgICByZXR1cm47CisgIGlmIChocG9zX2xlbmd0aCA9PSAxKQorICAgIHsK KyAgICAgIGlmICghTklMUCAoQlZBUiAoYiwgbWNfY29uZikpCisgICAgICAgICAgJiYgKGVzc2Vu dGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisg ICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWNfaW5hY3RpdmVfd2luZG93cykp KSkpCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUaGUgc3BhY2UgYXBwZW5kZWQgdG8gYSByb3cg ZW5kaW5nIHdpdGggYSBuZXcgbGluZQorICAgICAgICAgIGRvZXMgbm90IGhhdmUgYSBgZ2x5cGgt PmNoYXJwb3NgICgtMSwgMCkgdGhhdCB3ZSBjYW4KKyAgICAgICAgICB1c2UgZm9yIHRoaXMgcGFy dGljdWxhciBhcHBsaWNhdGlvbi4gIFdoZW4gdGhlcmUgaXMgYQorICAgICAgICAgIGBidWZmZXIt ZGlzcGxheS10YWJsZScgZW50cnkgdGhhdCBhc3NpZ25zIGEgdmlzaWJsZQorICAgICAgICAgIGds eXBoIHRvIGEgbmV3IGxpbmUsIHRoZXJlIGlzIG5vIHByb2JsZW0gYmVjYXVzZSB0aGF0CisgICAg ICAgICAgZ2x5cGggaGFzIGEgYGdseXBoLT5jaGFycG9zJyB0aGF0IHdlIGNhbiB1c2UuICBXaGVu CisgICAgICAgICAgbm8gdmlzaWJsZSBFT0wgZ2x5cGggZXhpc3RzLCB3ZSB1c2UgdGhlIGZvbGxv d2luZworICAgICAgICAgIHRlc3Q6ICB0aGUgYXBwZW5kZWQgc3BhY2UgaGFzIGEgcG9zaXRpb24g dGhhdCBpcyBvbmUKKyAgICAgICAgICBsZXNzIHRoYW4gdGhlIGVuZCBvZiB0aGUgbWF0cml4IHJv dy4gKi8KKyAgICAgICAgICBpbnQgaHBvcyA9IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XTsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnByZXZpb3VzX2dseXBoID0gKDAgPD0gaHBvcyAt IDEgJiYgaHBvcyAtIDEgPCByb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgaHBvcyAt IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICAg ICAgICAgIC8vIHN0cnVjdCBnbHlwaCAqbGFzdF9nbHlwaCA9IHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDE7CisgICAgICAgICAgYm9vbCBza2lwX3AgPSAo cHJldmlvdXNfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICYmIHByZXZp b3VzX2dseXBoLT5jaGFycG9zID09IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgLSAxCisg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgc3RhcnQtPmJ5dGVwb3MgIT0gZXNzZW50aWFscy56 dl9ieXRlKQorICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAg ICAgICAgICAgIC8qIFdoZW4gYSBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5IGNvbnRhaW5z CisgICAgICAgICAgICAgICAgICAgICAgICBhIHZpc2libGUgdGFiIGNoYXJhY3RlciAoIsK7Iiks IHRoZSBzdWJzZXF1ZW50CisgICAgICAgICAgICAgICAgICAgICAgICBTVFJFVENIX0dMWVBIIHdp bGwgaGF2ZSB0aGUgc2FtZSBzdGFydC0+Y2hhcnBvcworICAgICAgICAgICAgICAgICAgICAgICAg YXMgdGhlIGFmb3JlbWVudGlvbmVkIHZpc2libGUgdGFiIGNoYXJhY3Rlci4gKi8KKyAgICAgICAg ICAgICAgICAgICAgICAgIDogKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHByZXZpb3VzX2dseXBoLT5jaGFycG9zID09IHN0YXJ0LT5jaGFycG9z KQorICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAgICAg ICAgIDogZmFsc2U7CisgICAgICAgICAgaW50IHBvc2ludCA9IChyb3dfcG9zaXRpb24gPT0gUE9T VF9aVikKKyAgICAgICAgICAgICAgICAgICAgICAgICA/IC0xCisgICAgICAgICAgICAgICAgICAg ICAgIDogKHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAgICAgICAgICAgICAgICAgICAg PyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAgICAgICAgICAgICAgIDogKHN0YXJ0LT5ieXRlcG9z ICE9IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzdGFy dCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQor ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSAt IDEKKyAgICAgICAgICAgICAgICAgICAgICAgOiAoc3RhcnQtPmJ5dGVwb3MgPT0gZXNzZW50aWFs cy56dl9ieXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHN0YXJ0IC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpCisgICAgICAgICAgICAg ICAgICAgICAgICAgPyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAgICAgICAgICAgICAgIDogc3Rh cnQtPmNoYXJwb3M7CisgICAgICAgICAgTGlzcF9PYmplY3Qgc3BlY3MgPSBtY19hc3NvYyAobWFr ZV9maXhudW0gKHBvc2ludCksIEJWQVIgKGIsIG1jX2NvbmYpKTsKKyAgICAgICAgICBpZiAoKCho ZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgfHwgaGVh ZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICYmICFOSUxQIChzcGVjcykKKyAg ICAgICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAg ICAgICAgICAmJiAhc2tpcF9wCisgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiAhPSBQT1NU X1pWKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBMaXNwX09iamVjdCBsaXNwX3R5cGUg PSBtY19udGggKDEsIHNwZWNzKTsKKyAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBj dXJzb3JfdHlwZSA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAo bGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogbWNfbGlzcF90b19jdXJzb3JfdHlwZSAobGlzcF90eXBlKTsKKyAgICAgICAgICAgICAg Y3Vyc29yX3R5cGUgPSAoc3RhcnQtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBjdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCA9IChDT05T UCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gWEZJWE5V TSAoWENBUiAoWENEUiAobGlzcF90eXBlKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IC0xOworICAgICAgICAgICAgICBMaXNwX09iamVjdCBtY19mb3JlZ3JvdW5kID0gbWNf bnRoICgyLCBzcGVjcyk7CisgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAg ICAgICAgICAgICBpZiAoU1RSSU5HUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAg bWNfeHdfY29sb3JfdmFsdWVzICh3LCBtY19mb3JlZ3JvdW5kLCAmbHNsX2ZnKTsKKyAgICAgICAg ICAgICAgICBlbHNlIGlmIChWRUNUT1JQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLnJlZCA9IFhGTE9BVF9EQVRBIChBUkVG IChtY19mb3JlZ3JvdW5kLCAwKSk7CisgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5ncmVlbiA9 IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAxKSk7CisgICAgICAgICAgICAgICAg ICAgIGxzbF9mZy5ibHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDIpKTsK KyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKE5JTFAgKG1j X2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIHN0 YXJ0LCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCBwb3NpbnQsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIHJvd19wb3NpdGlvbiwgTVVMVElQTEVfQ1VSU09S Uyk7CisgICAgICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJp eCk7CisgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVY VF9BUkVBKTsKKyAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQs IFRFWFRfQVJFQSwgeCwgeF9saW1pdCwgcm93LT55LAorICAgICAgICAgICAgICAgICAgICAgICAg IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwgdnBvcywgY3Vyc29yX3R5cGUsCisgICAg ICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCBjdXJzb3JfbWF0cml4LCBlc3NlbnRp YWxzLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLCBNVUxU SVBMRV9DVVJTT1JTLCBkcmF3X3AsIGZyb21fd2hlcmUsIE1DX0NBQ0hFKTsKKyAgICAgICAgICAg IH0KKyAgICAgICAgfQorICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBmY192aXNpYmxlKSkKKyAg ICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICB8fCAoIWVzc2Vu dGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBmY19p bmFjdGl2ZV93aW5kb3dzKSkpKQorICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA8PSB0ZXh0 X2FyZWFfd2lkdGgKKyAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0gdy0+bWMubG51bV9w aXhlbF93aWR0aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB4X2xpbWl0ID0geCArIHN0YXJ0 LT5waXhlbF93aWR0aDsKKyAgICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9ICh3LT5j dXJzb3IueCA9PSBlc3NlbnRpYWxzLmZjX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5jdXJzb3IueSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RF WFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJz b3IudnBvcyA9PSB2cG9zKTsKKyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAg ICAgICBtY19jb2xvcl9waWNrZXIgKHcsIHN0YXJ0LCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCAtMSwg TUNfQkFSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBGSUxMX0NP TFVNTik7CisgICAgICAgICAgaWYgKHggKyBzdGFydC0+cGl4ZWxfd2lkdGggPD0gdGV4dF9hcmVh X3dpZHRoCisgICAgICAgICAgICAgICYmICgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9z ID4gMCkKKyAgICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAg ICAgICAgICAgICAmJiAoKHN0YXJ0ICE9IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVz ZWRbVEVYVF9BUkVBXSAtIDEKKyAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3gg Pj0geAorICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA8IHggKyBzdGFydC0+ cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB8fCAoc3RhcnQgPT0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMQorICAgICAgICAgICAgICAgICAg ICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB4KSkKKyAgICAgICAgICAgICAgJiYgcm93LT55IDw9 IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1 cnNvcl9wKQorICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRF WFRfQVJFQSwgeCwgeF9saW1pdCwgcm93LT55LAorICAgICAgICAgICAgICAgICAgICAgICBzdGFy dCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3MsIE1DX0JBUiwgMSwKKyAgICAgICAgICAg ICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xf ZmcsCisgICAgICAgICAgICAgICAgICAgICAgIEZJTExfQ09MVU1OLCBkcmF3X3AsIGZyb21fd2hl cmUsIEZDX0NBQ0hFKTsKKyAgICAgICAgfQorICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBjcm9z c2hhaXJzKSkKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaG9yaXpvbnRhbF9ydWxl cikpCisgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgfHwg KCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo YiwgY2hfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNv ci52cG9zKQorICAgICAgICB7CisgICAgICAgICAgaW50IHhfbGltaXQgPSAoc3RhcnQgPT0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAg ICAgICAgICAgICAgICAgID8gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAg ICA6IHggKyBzdGFydC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xf Zmc7CisgICAgICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBzdGFydCwgZXNzZW50aWFscywgJmxz bF9mZywgLTEsIE1DX0hCQVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRp b24sIEhPUklaT05UQUxfUlVMRVIpOworICAgICAgICAgIC8qIFByZXNlcnZlIHN1cHBvcnQgZm9y IGRlZmF1bHQgYmVoYXZpb3Igc3VjaCB0aGF0IGEgdXNlciBtYXkKKyAgICAgICAgICBzcGVjaWZ5 IHRoZSBoZWlnaHQgb2YgYW4gTUNfSEJBUiwgd2hpY2ggYmVnaW5zIGl0cyBqb3VybmV5CisgICAg ICAgICAgYXMgdGhlIGBjdXJzb3Jfd2lkdGgnLiAgYG1jX2dldF9jdXJzb3JfZ2VvbWV0cnknIHJl YWRqdXN0cy4gKi8KKyAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBzdGFydCwg VEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ctPnksCisgICAgICAgICAgICAgICAgICAgICBzdGFy dCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3MsIE1DX0hCQVIsIDEsCisgICAgICAgICAg ICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9m ZywKKyAgICAgICAgICAgICAgICAgICAgIEhPUklaT05UQUxfUlVMRVIsIGRyYXdfcCwgZnJvbV93 aGVyZSwgQ0hfQ0FDSEUpOworICAgICAgICB9CisgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIsIGNy b3NzaGFpcnMpKQorICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxl cikpCisgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgfHwg KCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo YiwgY2hfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAmJiAhZmlsbF9jb2x1bW5fdHJ1 bXBzX3ApCisgICAgICAgIHsKKyAgICAgICAgICBjdXJzb3JfdHlwZSA9IChzdGFydC0+dHlwZSA9 PSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX0JPWAor ICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19CQVI7CisgICAgICAgICAgaW50IHhfbGltaXQg PSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAgICAgICAgIGJvb2wgcmVhbF9m YWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci55ID09IHJvdy0+eQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAg IHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgc3Rh cnQsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgVkVSVElDQUxfUlVMRVIpOworICAgICAgICAgIGlm ICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICB8 fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgJiYgKChzdGFydCAhPSBy b3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxCisgICAgICAg ICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0geAorICAgICAgICAgICAgICAgICAgICYmIHct PmN1cnNvci54IDwgeCArIHN0YXJ0LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgIHx8 IChzdGFydCA9PSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0g LSAxCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0geCkpCisgICAgICAg ICAgICAgICYmIHJvdy0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAg ICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0 cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAgICAg ICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBjdXJz b3JfdHlwZSwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50 aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsCisgICAgICAgICAgICAgICAgICAgICAgIFZFUlRJ Q0FMX1JVTEVSLCBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAgICAgfQorICAg IH0KKyAgICBlbHNlCisgICAgICB7CisgICAgICAgIGludCByZWxhdGl2ZV94ID0gMDsKKyAgICAg ICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsr YXJlYSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gcm93 LT5nbHlwaHNbYXJlYV07CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGds eXBoICsgcm93LT51c2VkW2FyZWFdOworICAgICAgICAgICAgLyogR2x5cGggZm9yIGEgbGluZSBl bmQgaW4gdGV4dC4gKi8KKyAgICAgICAgICAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiBnbHlw aCA9PSBnbHlwaF9lbmQgJiYgZ2x5cGgtPmNoYXJwb3MgPiAwKQorICAgICAgICAgICAgICArK2ds eXBoX2VuZDsKKyAgICAgICAgICAgIGZvciAoOyBnbHlwaCA8IGdseXBoX2VuZDsgKytnbHlwaCkK KyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICh2cG9zICE9IHctPmN1cnNvci52 cG9zCisgICAgICAgICAgICAgICAgICAgICYmIGdseXBoICE9IGdseXBoX2VuZCAtIDEKKyAgICAg ICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194IDwgcmVsYXRpdmVfeAorICAgICAgICAg ICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAg ICAgJiYgTklMUCAoQlZBUiAoYiwgbWNfY29uZikpKQorICAgICAgICAgICAgICAgICAgYnJlYWs7 CisgICAgICAgICAgICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBtY19jb25mKSkKKyAgICAgICAg ICAgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmICFOSUxQIChCVkFSIChiLCBtY19pbmFjdGl2ZV93aW5kb3dzKSkpKSkKKyAgICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyogVGhlIHNwYWNlIGFwcGVuZGVkIHRvIGEg cm93IGVuZGluZyB3aXRoIGEgbmV3IGxpbmUgZG9lcworICAgICAgICAgICAgICAgICAgICBub3Qg aGF2ZSBhIGBnbHlwaC0+Y2hhcnBvc2AgKC0xLCAwKSB0aGF0IHdlIGNhbiB1c2UgZm9yIHRoaXMK KyAgICAgICAgICAgICAgICAgICAgcGFydGljdWxhciBhcHBsaWNhdGlvbi4gIFdoZW4gYSBgYnVm ZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5CisgICAgICAgICAgICAgICAgICAgIGFzc2lnbnMgYSB2 aXNpYmxlIGdseXBoIHRvIGEgbmV3IGxpbmUsIHRoZXJlIGlzIG5vIHByb2JsZW0KKyAgICAgICAg ICAgICAgICAgICAgYmVjYXVzZSB0aGF0IGdseXBoIGhhcyBhIGBnbHlwaC0+Y2hhcnBvcycgdGhh dCB3ZSBjYW4gdXNlLgorICAgICAgICAgICAgICAgICAgICBXaGVuIG5vIHZpc2libGUgRU9MIGds eXBoIGV4aXN0cywgd2UgdXNlIHRoZSBmb2xsb3dpbmcgdGVzdDoKKyAgICAgICAgICAgICAgICAg ICAgdGhlIGFwcGVuZGVkIHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMgb25lIGxlc3MgdGhh biB0aGUKKyAgICAgICAgICAgICAgICAgICAgZW5kIG9mIHRoZSBtYXRyaXggcm93LiAqLworICAg ICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICpwcmV2aW91c19nbHlwaCA9ICgw IDw9IGhwb3MgLSAxICYmIGhwb3MgLSAxIDwgcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0gKyBocG9zIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBOVUxMOworICAgICAgICAgICAgICAgICAgICAvLyBzdHJ1Y3Qg Z2x5cGggKmxhc3RfZ2x5cGggPSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RF WFRfQVJFQV0gLSAxOworICAgICAgICAgICAgICAgICAgICBib29sIHNraXBfcCA9IChwcmV2aW91 c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHBy ZXZpb3VzX2dseXBoLT5jaGFycG9zID09IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgLSAx CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT5ieXRlcG9zICE9 IGVzc2VudGlhbHMuenZfYnl0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFdoZW4gYSBgYnVm ZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5IGNvbnRhaW5zCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYSB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIgKCLCuyIpLCB0aGUgc3Vic2VxdWVu dAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNUUkVUQ0hfR0xZUEggd2lsbCBo YXZlIHRoZSBzYW1lIGdseXBoLT5jaGFycG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgYXMgdGhlIGFmb3JlbWVudGlvbmVkIHZpc2libGUgdGFiIGNoYXJhY3Rlci4gKi8KKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChwcmV2aW91c19nbHlwaCAhPSBOVUxM CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcHJldmlvdXNfZ2x5cGgt PmNoYXJwb3MgPT0gZ2x5cGgtPmNoYXJwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGZhbHNl OworICAgICAgICAgICAgICAgICAgICBpbnQgcG9zaW50ID0gKHJvd19wb3NpdGlvbiA9PSBQT1NU X1pWKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IC0xCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IChyb3dfcG9zaXRpb24gPT0gQVRfWlYpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGVzc2VudGlhbHMuenYKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoLT5ieXRlcG9zICE9IGVzc2VudGlhbHMuenZf Ynl0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGggLSByb3ct PmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cp IC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGgtPmJ5dGVwb3Mg PT0gZXNzZW50aWFscy56dl9ieXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJF QV0gLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGVzc2VudGlhbHMu enYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogZ2x5cGgtPmNoYXJwb3M7Cisg ICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0IHNwZWNzID0gbWNfYXNzb2MgKG1ha2VfZml4 bnVtIChwb3NpbnQpLCBCVkFSIChiLCBtY19jb25mKSk7CisgICAgICAgICAgICAgICAgICAgIGlm ICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAg ICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICAgICAg ICAgICAmJiAhTklMUCAoc3BlY3MpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnkg PD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAh c2tpcF9wCisgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gIT0gUE9TVF9a VikKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBMaXNw X09iamVjdCBsaXNwX3R5cGUgPSBtY19udGggKDEsIHNwZWNzKTsKKyAgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUgPSAoQ09OU1AgKGxpc3BfdHlw ZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbWNf bGlzcF90b19jdXJzb3JfdHlwZSAobGlzcF90eXBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAg IGN1cnNvcl90eXBlID0gKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0hPTExPV19CT1gKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiBjdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgICAg ICAgICAgIGludCBjdXJzb3Jfd2lkdGggPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBYRklYTlVNIChYQ0FSIChYQ0RSIChs aXNwX3R5cGUpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IC0xOworICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QgbWNfZm9yZWdyb3VuZCA9 IG1jX250aCAoMiwgc3BlY3MpOworICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JH QiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoU1RSSU5HUCAobWNfZm9yZWdy b3VuZCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX3h3X2NvbG9yX3ZhbHVlcyAodywg bWNfZm9yZWdyb3VuZCwgJmxzbF9mZyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Ug aWYgKFZFQ1RPUlAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5yZWQgPSBYRkxPQVRfREFU QSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgbHNsX2ZnLmdyZWVuID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDEpKTsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5ibHVlID0gWEZMT0FUX0RBVEEg KEFSRUYgKG1jX2ZvcmVncm91bmQsIDIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoTklMUCAobWNfZm9yZWdyb3Vu ZCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIGds eXBoLCBlc3NlbnRpYWxzLCAmbHNsX2ZnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBwb3NpbnQsIGN1cnNvcl90eXBlLCByb3dfcG9zaXRpb24sCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNP UlMpOworICAgICAgICAgICAgICAgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1Mg KHJvdywgbWF0cml4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2lu ZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1j X2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4X2xpbWl0LCByb3ctPnksIGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg dnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xf ZmcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlMs IGRyYXdfcCwgZnJvbV93aGVyZSwgTUNfQ0FDSEUpOworICAgICAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIs IGZjX3Zpc2libGUpKQorICAgICAgICAgICAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVf cAorICAgICAgICAgICAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGZjX2luYWN0aXZlX3dp bmRvd3MpKSkpCisgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA8PSB0ZXh0 X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHct Pm1jLmxudW1fcGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAg ICAgICAgICAgICAgICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLngg PT0gZXNzZW50aWFscy5mY194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPmN1cnNvci55ID09IHJvdy0+eQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBnbHlwaCAtIHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnZwb3MgPT0gdnBvcyk7CisgICAgICAgICAgICAgICAg ICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICAgICAgICAgICAgbWNf Y29sb3JfcGlja2VyICh3LCBnbHlwaCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIE1DX0JBUiwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRpb24sIEZJTExf Q09MVU1OKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGhwb3MgPj0gaHBvc19zdGFydAorICAg ICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAor ICAgICAgICAgICAgICAgICAgICAgICAgJiYgcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0 aCA8PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICgoaGVhZGVy X2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICYm ICgoZ2x5cGggIT0gZ2x5cGhfZW5kIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBlc3NlbnRpYWxzLmZjX3ggPj0gcmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPCByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRo KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChnbHlwaCA9PSBnbHlwaF9lbmQgLSAx CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSBy ZWxhdGl2ZV94KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+eSA8PSB3aW5kb3df dGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFyZWFsX2Zha2Vf Y3Vyc29yX3ApCisgICAgICAgICAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJv dywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZlX3gsIHhfbGltaXQsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICByb3ctPnksIGhwb3MsIHZwb3MsIE1DX0JBUiwgMSwgY3Vyc29yX21hdHJp eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMsIHJvd19wb3Np dGlvbiwgbHNsX2ZnLCBGSUxMX0NPTFVNTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGRyYXdfcCwgZnJvbV93aGVyZSwgRkNfQ0FDSEUpOworICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICAgIGlmICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAg ICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9ob3Jpem9udGFsX3J1bGVyKSkKKyAg ICAgICAgICAgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpKQorICAgICAg ICAgICAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGgg KHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdC IGxzbF9mZzsKKyAgICAgICAgICAgICAgICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBnbHlwaCwg ZXNzZW50aWFscywgJmxzbF9mZywgLTEsIE1DX0hCQVIsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBIT1JJWk9OVEFMX1JVTEVSKTsKKyAgICAgICAg ICAgICAgICAgICAgLyogUHJlc2VydmUgc3VwcG9ydCBmb3IgZGVmYXVsdCBiZWhhdmlvciBzdWNo IHRoYXQgYSB1c2VyIG1heQorICAgICAgICAgICAgICAgICAgICBzcGVjaWZ5IHRoZSBoZWlnaHQg b2YgYW4gTUNfSEJBUiwgd2hpY2ggYmVnaW5zIGl0cyBqb3VybmV5CisgICAgICAgICAgICAgICAg ICAgIGFzIHRoZSBgY3Vyc29yX3dpZHRoJy4gIGBtY19nZXRfY3Vyc29yX2dlb21ldHJ5JyByZWFk anVzdHMuICovCisgICAgICAgICAgICAgICAgICAgIGlmIChocG9zID49IGhwb3Nfc3RhcnQKKyAg ICAgICAgICAgICAgICAgICAgICAgICYmIGhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgp CisgICAgICAgICAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgs IGFyZWEsIHJlbGF0aXZlX3gsIHhfbGltaXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICByb3ctPnksIGhwb3MsIHZwb3MsIE1DX0hCQVIsIDEsIGN1cnNvcl9tYXRyaXgsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxz bF9mZywgSE9SSVpPTlRBTF9SVUxFUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGRyYXdfcCwgZnJvbV93aGVyZSwgQ0hfQ0FDSEUpOworICAgICAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICAgIGlmICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAg ICAgICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICB8fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAg ICAgICAgICAgJiYgIWZpbGxfY29sdW1uX3RydW1wc19wKQorICAgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IChnbHlwaC0+dHlwZSA9PSBJTUFHRV9H TFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0hPTExPV19CT1gK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0JBUjsKKyAgICAgICAgICAg ICAgICAgICAgaW50IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOwor ICAgICAgICAgICAgICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9ICh3LT5jdXJzb3Iu eSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+Y3Vyc29yLnZwb3MgPT0gdnBvcyk7CisgICAgICAgICAgICAgICAgICAgIGludCBo cG9zID0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAg ICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICAgICAgICAgICAgbWNfY29sb3JfcGlj a2VyICh3LCBnbHlwaCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIGN1cnNvcl90eXBlLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgVkVSVElDQUxf UlVMRVIpOworICAgICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0CisgICAg ICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisg ICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBv cyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0 ID09IDApCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGdseXBoICE9IGdseXBoX2VuZCAt IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gcmVsYXRp dmVfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHJlbGF0 aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg fHwgKGdseXBoID09IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+Y3Vyc29yLnggPj0gcmVsYXRpdmVfeCkpCisgICAgICAgICAgICAgICAgICAgICAg ICAmJiByb3ctPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICAg ICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgICAgICAgICAgIG1j X2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBj dXJzb3JfdHlwZSwgMSwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgbHNsX2ZnLCBWRVJUSUNBTF9SVUxFUiwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdfcCwgZnJvbV93aGVyZSwgQ0hf Q0FDSEUpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJlbGF0aXZlX3gg Kz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAg ICAgfQorICAvLyAgY2xvY2tfdCBjbG9ja19lbmQgPSBjbG9jaygpOworICAvLyAgZG91YmxlIGNw dV90aW1lX3VzZWQgPSAoKGRvdWJsZSkgKGNsb2NrX2VuZCAtIGNsb2NrX3N0YXJ0KSkgLyBDTE9D S1NfUEVSX1NFQzsKKyAgLy8gIGZwcmludGYgKHN0ZGVyciwgIm1jX2RyYXdfcm93ICglcyk6ICBU SU1FICglZilcbiIsIG1jX3dpbmRvdyAodyksIGNwdV90aW1lX3VzZWQpOworfQorCitib29sCitt Y19yZWRyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRy aXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgICAgIGVudW0gZ2x5cGhfcm93 X2FyZWEgYXJlYSwgaW50IHN0YXJ0X3gsIGludCBzdGFydF9ocG9zLCBpbnQgZW5kX2hwb3MsCisg ICAgICAgICAgICAgICBib29sIGNsZWFyX2VvbF9wLCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UgaGws CisgICAgICAgICAgICAgICBlbnVtIG1jX3JlZHJhd19yb3dfdHlwZSBmcm9tX3doZXJlKQorewor ICBib29sIGdvX3AgPSAoKHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVdID4gMAor ICAgICAgICAgICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hfQ0FDSEVdID4g MAorICAgICAgICAgICAgIC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ZQT1MgKHJvdywgbWF0cml4KTsKKyAgLyogU1RSRVRDSF9HTFlQSCBtYXkgY29udGFpbiBtb3Jl IHRoYW4gb25lIGZha2UgY3Vyc29yIGF0IHRoZSBzYW1lIEhQT1MuICovCisgIGZvciAoZW51bSBt Y19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICBjYWNoZV90eXBlIDwg Tk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGZvciAoaW50IG50 aCA9IDA7CisgICAgICAgICAgIG1jX3RyYXZlcnNlX2NhY2hlX3AgKHctPm1jX21hdHJpeCwgY2Fj aGVfdHlwZSwgdm50aCwgbnRoKTsKKyAgICAgICAgICAgKytudGgpCisgICAgICAgIHsKKyAgICAg ICAgICBpbnQgeCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0ueDsKKyAgICAgICAgICBpbnQgZnggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhdLmZ4OworICAgICAgICAgIGludCB5ID0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS55OworICAgICAgICAgIGludCBmeSA9IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZnk7CisgICAgICAgICAg aW50IGhwb3MgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd Lmhwb3M7CisgICAgICAgICAgaW50IHZwb3MgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLnZwb3M7CisgICAgICAgICAgaW50IHdkID0gdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS53ZDsKKyAgICAgICAgICBpbnQgaCA9 IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uaDsKKyAgICAg ICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5jdXJzb3JfdHlwZTsKKyAgICAgICAgICBpbnQg Y3Vyc29yX3dpZHRoID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXS5jdXJzb3Jfd2lkdGg7CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmcgPSB7LnJl ZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcucmVk LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcuZ3JlZW4sCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmZnLmJsdWV9OworICAgICAgICAgIC8vICBzdHJ1Y3QgbWNf UkdCIGxzbF9iZyA9IHsucmVkID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS5iZy5yZWQsCisgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAg IC5ncmVlbiA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0u YmcuZ3JlZW4sCisgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ibHVlfTsK KyAgICAgICAgICBib29sIGFjdGl2ZV9wID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXS5hY3RpdmVfcDsKKyAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlw aF9mbGF2b3IgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICBib29sIGVuYWJsZWRfcCA9IHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxlZF9wOworICAgICAgICAgIGlm ICh2cG9zID09IHZudGgKKyAgICAgICAgICAgICAgJiYgKChocG9zID49IHN0YXJ0X2hwb3MKKyAg ICAgICAgICAgICAgICAgICAmJiBocG9zIDwgZW5kX2hwb3MpCisgICAgICAgICAgICAgICAgICAv KiBBIGZsb2F0aW5nIGN1cnNvciBiZXlvbmQgdGhlIGVuZCBvZiB0aGUgZ2x5cGggcm93LiAqLwor ICAgICAgICAgICAgICAgICAgfHwgKGhwb3MgKyAxID09IHN0YXJ0X2hwb3MKKyAgICAgICAgICAg ICAgICAgICAgICAmJiBocG9zICsgMSA9PSBlbmRfaHBvcykpCisgICAgICAgICAgICAgICYmIGVu YWJsZWRfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgYm9vbCByZW1vdmVfcCA9IGZh bHNlOworICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgbWF0cml4LCByb3cs IHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBsc2xfZmcsIGFjdGl2ZV9w LAorICAgICAgICAgICAgICAgICAg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BlID0gTUNf Q0FDSEU7CisgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICsrY2FjaGVfdHlw ZSkKKyAgICB7CisgICAgICBmb3IgKGludCBudGggPSAwOworICAgICAgICAgICBtY190cmF2ZXJz ZV9jYWNoZV9wICh3LT5tY19tYXRyaXgsIGNhY2hlX3R5cGUsIHZudGgsIG50aCk7CisgICAgICAg ICAgICsrbnRoKQorICAgICAgICB7CisgICAgICAgICAgaW50IHggPSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLng7CisgICAgICAgICAgaW50IGZ4ID0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5meDsKKyAgICAgICAg ICBpbnQgeSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0u eTsKKyAgICAgICAgICBpbnQgZnkgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhdLmZ5OworICAgICAgICAgIGludCBocG9zID0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5ocG9zOworICAgICAgICAgIGludCB2cG9zID0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS52cG9zOworICAg ICAgICAgIGludCB3ZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0ud2Q7CisgICAgICAgICAgaW50IGggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLmg7CisgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJz b3JfdHlwZSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY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2b3IgZ2x5cGhfZmxhdm9yID0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAgYm9v bCBlbmFibGVkX3AgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmVuYWJsZWRfcDsKKyAgICAgICAgICAvKiBgbWF0cml4X3JvdycgaW4gYGRpc3BuZXcuY2Ag Y29udGFpbnMgdGhlIGZvbGxvd2luZyB0ZXN0cywKKyAgICAgICAgICBlYXNzZXJ0IChtYXRyaXgg JiYgbWF0cml4LT5yb3dzKTsKKyAgICAgICAgICBlYXNzZXJ0IChyb3cgPj0gMCAmJiByb3cgPCBt YXRyaXgtPm5yb3dzKTsgKi8KKyAgICAgICAgICBib29sIGJhcmZfY3Jhc2hfb25lID0gKG1hdHJp eCAmJiBtYXRyaXgtPnJvd3MpID8gZmFsc2UgOiB0cnVlOworICAgICAgICAgIGlmIChiYXJmX2Ny YXNoX29uZSkKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgIGJvb2wgYmFyZl9jcmFz aF90d28gPSAodnBvcyA+PSAwICYmIHZwb3MgPCBtYXRyaXgtPm5yb3dzKSA/IGZhbHNlIDogdHJ1 ZTsKKyAgICAgICAgICBpZiAoYmFyZl9jcmFzaF90d28pCisgICAgICAgICAgICBjb250aW51ZTsK KyAgICAgICAgICBpZiAodnBvcyA9PSB2bnRoCisgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZv ciA9PSBNQ19HTFlQSAorICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgICB7 CisgICAgICAgICAgICAgIG1jX2VyYXNlX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIHksIGhw b3MsIHZwb3MsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkKTsKKyAgICAgICAgICAgICAg dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3Ag PSBmYWxzZTsKKyAgICAgICAgICAgICAgLS13LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hl X3R5cGVdOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAodnBvcyA9PSB2bnRo CisgICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICBib29sIHJlbW92ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBtY19k cmF3X2VyYXNlX2h5YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBv cywgd2QsIGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90 eXBlLCBjdXJzb3Jfd2lkdGgsIGxzbF9iZywgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgcmVtb3ZlX3ApOworICAgICAgICAgICAg ICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxl ZF9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgLS13LT5tY19tYXRyaXguY3Vyc29yc191c2Vk W2NhY2hlX3R5cGVdOworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0gPSAwOworICAgIH0KK30KKwor LyogRXJhc2UgZmFrZSBjdXJzb3JzIGZyb20gKG1pbiwgcnVuLmN1cnJlbnRfeSwgcnVuLmRlc2ly ZWRfeSkgdG8gZW5kIG9mIHdpbmRvdy4KKyAgVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFU UklYX0RPV046Cis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AgICAgICB8CisgICstLS0tLS0t LS0tLS0tKyA8PSBydW4uY3VycmVudF95ID09IDU0MAorICB8ICAgICAgICAgICAgIHwKKyAgfCAg ICAgICAgICAgICB8IDw9IHJ1bi5kZXNpcmVkX3kgPT0gODEwIFtkb3duICjihpMpXSA9PSBydW4u Y3VycmVudF95ID4gcnVuLmRlc2lyZWRfeQorICB8ICAgICAgICAgICAgIHwgICAgcnVuLmhlaWdo dCA9IGl0Lmxhc3RfdmlzaWJsZV95IC0gcnVuLmRlc2lyZWRfeQorICB8ICAgICAgICAgICAgIHwg ICAgcnVuLmhlaWdodCA9PSAxMDgwIC0gODEwID09IDI3MAorICB8ICAgICAgICAgICAgIHwgICAg W1RvcCBwYXJ0IG9mIHRoZSBsb3dlciByZWN0YW5nbGUgZ2V0cyBjb3BpZWQgdG8gbG93ZXIgcnVu LmRlc2lyZWRfeS5dCisgIHwgICAgICAgICAgICAgfAorICArLS0tLS0tLS0tLS0tLSsgPD0gaXQu bGFzdF92aXNpYmxlX3kgPT0gMTA4MCAqLwordm9pZAorbWNfcHJlX3Njcm9sbF9jbGVhbiAoc3Ry dWN0IHdpbmRvdyAqdywgc3RydWN0IHJ1biBydW4sIGludCBzdGFydF92cG9zLAorICAgICAgICAg ICAgICAgICAgICAgaW50IG5yb3dzX3Njcm9sbGVkLCBlbnVtIG1jX3ByZV9zY3JvbGxfY2xlYW5f dHlwZSBmcm9tX3doZXJlKQoreworICBpZiAoTUlOSV9XSU5ET1dfUCAodykpCisgICAgcmV0dXJu OworICBib29sIGdvX29uZV9wID0gKHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVd ID4gMAorICAgICAgICAgICAgICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hf Q0FDSEVdID4gMAorICAgICAgICAgICAgICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3Vz ZWRbRkNfQ0FDSEVdID4gMCk7CisgIGJvb2wgZ29fdHdvX3AgPSAoQlVGRkVSUCAody0+Y29udGVu dHMpCisgICAgICAgICAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAg ICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKSk7 CisgIGlmIChtY19zdGRlcnJfcCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJtY19wcmVfc2Nyb2xs X2NsZWFuICglcyk6XG5cCisgICVzIHwgZ29fb25lX3AgKCVzKSB8IGdvX3R3b19wICglcylcblwK KyAgc3RhcnRfdnBvcyAoJWQpIHwgbnJvd3Nfc2Nyb2xsZWQgKCVkKVxuXAorICAlczogIHJ1bi5j dXJyZW50L2Rlc2lyZWRfeSAoJWQvJWQpIHwgcnVuLmhlaWdodCAoJWQpXG4iLAorICAgIG1jX3dp bmRvdyAodyksIChmcm9tX3doZXJlID09IFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJ WF9ET1dOKQorICAgICAgICAgICAgICAgICAgICAgPyAiVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJF TlRfTUFUUklYX0RPV04iCisgICAgICAgICAgICAgICAgICAgOiAoZnJvbV93aGVyZSA9PSBUUllf V0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfVVApCisgICAgICAgICAgICAgICAgICAgICA/ ICJUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfVVAiCisgICAgICAgICAgICAgICAg ICAgOiAoZnJvbV93aGVyZSA9PSBUUllfV0lORE9XX0lEKQorICAgICAgICAgICAgICAgICAgICAg PyAiVFJZX1dJTkRPV19JRCIKKyAgICAgICAgIC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T1cgKG1hdHJpeCwgdm50aCk7CisgICAgICBtY19lcmFzZV9yb3cgKHcsIG1hdHJpeCwgcm93KTsK KyAgICB9CisgIGlmICh1cGRhdGluZ19mcmFtZV9wKQorICAgIHVwZGF0ZV9lbmQgKGYpOworICAv LyBtY19yZXNldF9jYWNoZSAodyk7Cit9CisKK0RFRlVOICgibWMtc3RkZXJyIiwgRm1jX3N0ZGVy ciwgU21jX3N0ZGVyciwgMCwgMSwgIlAiLAorICAgICAgIGRvYzogLyogVG9nZ2xlIHRyYWNpbmcg b2YgbXVsdGlwbGUgZmFrZSBjdXJzb3JzLgorV2l0aCBBUkcsIHR1cm4gdHJhY2luZyBvbiBpZiBh bmQgb25seSBpZiBBUkcgaXMgcG9zaXRpdmUuICovKQorICAoTGlzcF9PYmplY3QgYXJnKQorewor ICBpZiAoTklMUCAoYXJnKSkKKyAgICBtY19zdGRlcnJfcCA9ICFtY19zdGRlcnJfcDsKKyAgZWxz ZQorICAgIHsKKyAgICAgIGFyZyA9IEZwcmVmaXhfbnVtZXJpY192YWx1ZSAoYXJnKTsKKyAgICAg IG1jX3N0ZGVycl9wID0gWEZJWE5VTSAoYXJnKSA+IDA7CisgICAgfQorICByZXR1cm4gUW5pbDsK K30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKIAwKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKgogCQkgICAgICBXaW5kb3cgZGlzcGxheSBkaW1lbnNp b25zCkBAIC0xMzUxMSw2ICsxODM4Niw2OSBAQCBoc2Nyb2xsX3dpbmRvd190cmVlIChMaXNwX09i amVjdCB3aW5kb3cpCiAJICAgICAgZWxzZQogCQlwdCA9IGNsaXBfdG9fYm91bmRzIChCRUdWLCBt YXJrZ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l0PTB4N2ZmZjVmYmY5ZTMwLAorICAgIHc9MHgxMWJmNzJjOTgsIHBvcz0weDEyMTI0M2Q1 MCkgYXQgeGRpc3AuYzo4Mjk5CisjNiAgMHgwMDAwMDAwMTAwMDRkMzdlIGluIGluaXRfdG9fcm93 X3N0YXJ0IChpdD0weDdmZmY1ZmJmOWUzMCwgdz0weDExYmY3MmM5OCwKKyAgICByb3c9MHgxMjEy NDNkMDApIGF0IHhkaXNwLmM6ODQyMworIzcgIDB4MDAwMDAwMDEwMDA2YzNmNyBpbiBoc2Nyb2xs X3dpbmRvd190cmVlICh3aW5kb3c9Li4uKSBhdCB4ZGlzcC5jOjE4NTQ2CisqLworCisgIC8qIGBp bml0X2l0ZXJhdG9yJzogIGVhc3NlcnQgKGNoYXJwb3MgPCAwCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHx8IChjaGFycG9zID49IEJVRl9CRUcgKGN1cnJlbnRfYnVmZmVyKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY2hhcnBvcyA8PSBaVikpOyAqLwor CisgIHN0cnVjdCBkaXNwbGF5X3BvcyAqcG9zID0gJmN1cnNvcl9yb3ctPnN0YXJ0OworICBwdHJk aWZmX3QgY2hhcnBvcyA9IENIQVJQT1MgKHBvcy0+cG9zKTsKKworICBib29sIGJhcmZfY3Jhc2hf b25lID0gKGNoYXJwb3MgPCAwCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGNoYXJwb3Mg Pj0gQlVGX0JFRyAoY3VycmVudF9idWZmZXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIGNoYXJwb3MgPD0gWlYpKQorICAgICAgICAgICAgICAgICAgICAgICAgPyBmYWxzZQorICAg ICAgICAgICAgICAgICAgICAgICAgOiB0cnVlOworICBpZiAoYmFyZl9jcmFzaF9vbmUpCisgICAg cmV0dXJuIGhzY3JvbGxlZF9wOworCisgIC8qIGByZXNlYXRfMSc6ICBDSEFSUE9TIChwb3MpID49 IEJFR1YgJiYgQ0hBUlBPUyAocG9zKSA8PSBaViAqLworICBib29sIGJhcmZfY3Jhc2hfdHdvID0g KGNoYXJwb3MgPj0gQkVHViAmJiBjaGFycG9zIDw9IFpWKQorICAgICAgICAgICAgICAgICAgICAg ICAgID8gZmFsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICA6IHRydWU7CisgIGlmIChiYXJm X2NyYXNoX3R3bykKKyAgICByZXR1cm4gaHNjcm9sbGVkX3A7CisKKy8qIGVuZCBNVUxUSVBMRS1D VVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgLyogTW92ZSBp dGVyYXRvciB0byBwdCBzdGFydGluZyBhdCBjdXJzb3Jfcm93LT5zdGFydCBpbgogCQkgYSBsaW5l IHdpdGggaW5maW5pdGUgd2lkdGguICAqLwogCSAgICAgIGluaXRfdG9fcm93X3N0YXJ0ICgmaXQs IHcsIGN1cnNvcl9yb3cpOwpAQCAtMTQzOTcsOSArMTkzMzUsMjIgQEAgcmVkaXNwbGF5X2ludGVy bmFsICh2b2lkKQogCSAgICAgICp3LT5kZXNpcmVkX21hdHJpeC0+bWV0aG9kID0gMDsKIAkgICAg ICBkZWJ1Z19tZXRob2RfYWRkICh3LCAib3B0aW1pemF0aW9uIDEiKTsKICNlbmRpZgorCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAjaWZkZWYg SEFWRV9XSU5ET1dfU1lTVEVNCisgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYm ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICBt Y191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIGZhbHNlKTsKKyAgICBlbHNlCiAJICAgICAgdXBk YXRlX3dpbmRvd19mcmluZ2VzICh3LCBmYWxzZSk7CiAjZW5kaWYKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogCSAgICAgIGdvdG8gdXBkYXRlOwogCSAgICB9CiAJICBlbHNlCkBAIC0x Nzc5MiwxMCArMjI3NDMsMjIgQEAgcmVkaXNwbGF5X3dpbmRvdyAoTGlzcF9PYmplY3Qgd2luZG93 LCBib29sIGp1c3RfdGhpc19vbmVfcCkKICAgICB9CiAKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNU RU0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworICBib29sIGtlZXBfY3VycmVudF9wID0gKGp1c3RfdGhpc19vbmVfcAorICAgICAgICAgICAg ICAgICAgICAgICAgIHx8ICghdXNlZF9jdXJyZW50X21hdHJpeF9wICYmICFvdmVybGF5X2Fycm93 X3NlZW4pCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgdy0+cHNldWRvX3dpbmRvd19wKTsK KworICBib29sIGZyaW5nZXNfdXBkYXRlZF9wID0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfdXBk YXRlX3dpbmRvd19mcmluZ2VzICh3LCBrZWVwX2N1cnJlbnRfcCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCBrZWVwX2N1cnJlbnRfcCk7CisK ICAgaWYgKEZSQU1FX1dJTkRPV19QIChmKQotICAgICAgJiYgdXBkYXRlX3dpbmRvd19mcmluZ2Vz ICh3LCAoanVzdF90aGlzX29uZV9wCi0JCQkJICAgIHx8ICghdXNlZF9jdXJyZW50X21hdHJpeF9w ICYmICFvdmVybGF5X2Fycm93X3NlZW4pCi0JCQkJICAgIHx8IHctPnBzZXVkb193aW5kb3dfcCkp KQorICAgICAgJiYgZnJpbmdlc191cGRhdGVkX3ApCiAgICAgewogICAgICAgdXBkYXRlX2JlZ2lu IChmKTsKICAgICAgIGJsb2NrX2lucHV0ICgpOwpAQCAtMTc4MTAsNiArMjI3NzMsOSBAQCByZWRp c3BsYXlfd2luZG93IChMaXNwX09iamVjdCB3aW5kb3csIGJvb2wganVzdF90aGlzX29uZV9wKQog ICAgICAgdXBkYXRlX2VuZCAoZik7CiAgICAgfQogCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAgIGlmIChXSU5ET1dfQk9UVE9NX0RJVklERVJfV0lEVEggKHcpKQogICAgIGd1aV9kcmF3 X2JvdHRvbV9kaXZpZGVyICh3KTsKICNlbmRpZiAvKiBIQVZFX1dJTkRPV19TWVNURU0gKi8KQEAg LTE4MTI1LDYgKzIzMDkxLDE2IEBAIHRyeV93aW5kb3dfcmV1c2luZ19jdXJyZW50X21hdHJpeCAo c3RydWN0IHdpbmRvdyAqdykKIAkgICAgICB1cGRhdGVfYmVnaW4gKGYpOwogCSAgICAgIGd1aV91 cGRhdGVfd2luZG93X2JlZ2luICh3KTsKIAkgICAgICBGUkFNRV9SSUYgKGYpLT5jbGVhcl93aW5k b3dfbW91c2VfZmFjZSAodyk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgICBtY19wcmVfc2Nyb2xsX2NsZWFuICh3LCBydW4sIHN0YXJ0 X3Zwb3MsIG5yb3dzX3Njcm9sbGVkLCBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhf RE9XTik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgICBGUkFNRV9SSUYg KGYpLT5zY3JvbGxfcnVuX2hvb2sgKHcsICZydW4pOwogCSAgICAgIGd1aV91cGRhdGVfd2luZG93 X2VuZCAodywgZmFsc2UsIGZhbHNlKTsKIAkgICAgICB1cGRhdGVfZW5kIChmKTsKQEAgLTE4Mjkx LDYgKzIzMjY3LDE2IEBAIHRyeV93aW5kb3dfcmV1c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0 IHdpbmRvdyAqdykKIAkgIHVwZGF0ZV9iZWdpbiAoZik7CiAJICBndWlfdXBkYXRlX3dpbmRvd19i ZWdpbiAodyk7CiAJICBGUkFNRV9SSUYgKGYpLT5jbGVhcl93aW5kb3dfbW91c2VfZmFjZSAodyk7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgICBtY19wcmVfc2Nyb2xsX2NsZWFuICh3LCBydW4sIHN0YXJ0X3Zwb3MsIG5yb3dzX3Njcm9s bGVkLCBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfVVApOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAJICBGUkFNRV9SSUYgKGYpLT5zY3JvbGxfcnVuX2hvb2sgKHcs ICZydW4pOwogCSAgZ3VpX3VwZGF0ZV93aW5kb3dfZW5kICh3LCBmYWxzZSwgZmFsc2UpOwogCSAg dXBkYXRlX2VuZCAoZik7CkBAIC0xOTI0NSw2ICsyNDIzMSwxNiBAQCB0cnlfd2luZG93X2lkIChz dHJ1Y3Qgd2luZG93ICp3KQogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogCSAgZ3VpX3VwZGF0 ZV93aW5kb3dfYmVnaW4gKHcpOwogCSAgRlJBTUVfUklGIChmKS0+Y2xlYXJfd2luZG93X21vdXNl X2ZhY2UgKHcpOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgICAgbWNfcHJlX3Njcm9sbF9jbGVhbiAodywgcnVuLCBmaXJzdF91bmNoYW5n ZWRfYXRfZW5kX3Zwb3MsIGR2cG9zLCBUUllfV0lORE9XX0lEKTsKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogCSAgRlJBTUVfUklGIChmKS0+c2Nyb2xsX3J1bl9ob29rICh3LCAmcnVu KTsKIAkgIGd1aV91cGRhdGVfd2luZG93X2VuZCAodywgZmFsc2UsIGZhbHNlKTsKICNlbmRpZgpA QCAtMjE1MjgsNiArMjY1MjQsMTcgQEAgbWF5YmVfcHJvZHVjZV9saW5lX251bWJlciAoc3RydWN0 IGl0ICppdCkKICAgICAgIFNFVF9URVhUX1BPUyAodGVtX2l0LnBvc2l0aW9uLCAtMSwgLTEpOwog ICAgICAgUFJPRFVDRV9HTFlQSFMgKCZ0ZW1faXQpOwogCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICAvKiBUaGlzIHBlcm1pdHMgdXMg dG8gaW5zcGVjdCB0aGUgSFBPUyBvZiBsaW5lIG51bWJlciBnbHlwaHMgYW5kIHRoZSBzcGFjZQor ICAgICAgcGFkZGluZyBiZWZvcmUvYWZ0ZXIgdGhlIGxpbmUgbnVtYmVycy4gIFdlIHNldCBgZ2x5 cGgtPmhwb3NgIGVsc2V3aGVyZS4gKi8KKyAgICAgIHRlbV9pdC5ocG9zICs9IDE7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIC8qIFN0b3AgcHJvZHVjaW5nIGdseXBocywg YW5kIHJlZnJhaW4gZnJvbSBwcm9kdWNpbmcgdGhlIGxpbmUKIAkgbnVtYmVyLCBpZiB3ZSBkb24n dCBoYXZlIGVub3VnaCBzcGFjZSBvbiB0aGlzIGxpbmUuICAqLwogICAgICAgaWYgKHRlbV9pdC5j dXJyZW50X3ggPj0gd2lkdGhfbGltaXQpCkBAIC0yMTUzOSw2ICsyNjU0NiwyOCBAQCBtYXliZV9w cm9kdWNlX2xpbmVfbnVtYmVyIChzdHJ1Y3QgaXQgKml0KQogCX0KICAgICB9CiAKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgc3RydWN0IGJ1 ZmZlciAqYiA9IFhCVUZGRVIgKGl0LT53LT5jb250ZW50cyk7CisgIHN0cnVjdCBidWZmZXIgKm9s ZF9idWZmZXIgPSBOVUxMOworICAvKiBOZWVkZWQgc28gdGhhdCBidWZmZXItbG9jYWwgdmFsdWVz IGNhbiBiZSBkZXRlcm1pbmVkOyBlLmcuLCB3aGVuIHN3aXRjaGluZworICB0byB0aGUgbWluaWJ1 ZmZlci4gKi8KKyAgaWYgKGIgIT0gY3VycmVudF9idWZmZXIpCisgICAgeworICAgICAgb2xkX2J1 ZmZlciA9IGN1cnJlbnRfYnVmZmVyOworICAgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAoYik7Cisg ICAgfQorICBpdC0+dy0+bWMubG51bV9waXhlbF93aWR0aCA9ICghTklMUCAoVmRpc3BsYXlfbGlu ZV9udW1iZXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRlbV9pdC5jdXJy ZW50X3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IDA7CisgIGlmIChvbGRfYnVm ZmVyKQorICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAgIC8qIFJlY29yZCB0aGUgd2lkdGggaW4gcGl4ZWxzIHdlIG5l ZWQgZm9yIHRoZSBsaW5lIG51bWJlciBkaXNwbGF5LiAgKi8KICAgaXQtPmxudW1fcGl4ZWxfd2lk dGggPSB0ZW1faXQuY3VycmVudF94OwogICAvKiBDb3B5IHRoZSBwcm9kdWNlZCBnbHlwaHMgaW50 byBJVCdzIGdseXBoX3Jvdy4gICovCkBAIC0yNzM2MCw2ICszMjM4OSwxNyBAQCBhcHBlbmRfZ2x5 cGggKHN0cnVjdCBpdCAqaXQpCiAJICAgIGdbMV0gPSAqZzsKIAkgIGdseXBoID0gaXQtPmdseXBo X3Jvdy0+Z2x5cGhzW2FyZWFdOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAg ICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRp b24pOwogICAgICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBpZiAoaXQtPnBp eGVsX3dpZHRoID4gMCkKQEAgLTI3NDQyLDYgKzMyNDgyLDE3IEBAIGFwcGVuZF9jb21wb3NpdGVf Z2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJICAgIGdbMV0gPSAqZzsKIAkgIGdseXBoID0gaXQtPmds eXBoX3Jvdy0+Z2x5cGhzW2l0LT5hcmVhXTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhw b3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gaXQtPmNtcF9pdC5j aGFycG9zOwogICAgICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBlYXNzZXJ0 IChpdC0+cGl4ZWxfd2lkdGggPD0gU0hSVF9NQVgpOwpAQCAtMjc2NTAsNiArMzI3MDEsMTcgQEAg cHJvZHVjZV9pbWFnZV9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgICBpZiAoZ2x5cGgg PCBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYSArIDFdKQogCXsKKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3Mg PSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9T IChpdC0+cG9zaXRpb24pOwogCSAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAJICBnbHlw aC0+cGl4ZWxfd2lkdGggPSBjbGlwX3RvX2JvdW5kcyAoLTEsIGl0LT5waXhlbF93aWR0aCwgU0hS VF9NQVgpOwpAQCAtMjc3NTMsNiArMzI4MTUsMTcgQEAgcHJvZHVjZV94d2lkZ2V0X2dseXBoIChz dHJ1Y3QgaXQgKml0KQogCX0KICAgICAgIGlmIChnbHlwaCA8IGl0LT5nbHlwaF9yb3ctPmdseXBo c1thcmVhICsgMV0pCiAJeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5 cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKworCiAJICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAJICBn bHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9IGNsaXBf dG9fYm91bmRzICgtMSwgaXQtPnBpeGVsX3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzgzOSw2ICsz MjkxMiwxNyBAQCBhcHBlbmRfc3RyZXRjaF9nbHlwaCAoc3RydWN0IGl0ICppdCwgTGlzcF9PYmpl Y3Qgb2JqZWN0LAogCSAgICB3aWR0aCAtPSBpdC0+Zmlyc3RfdmlzaWJsZV94IC0gaXQtPmN1cnJl bnRfeDsKIAkgIGVhc3NlcnQgKHdpZHRoID4gMCk7CiAJfQorCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0 LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1Mg KGl0LT5wb3NpdGlvbik7CiAgICAgICBnbHlwaC0+b2JqZWN0ID0gb2JqZWN0OwogICAgICAgLyog RklYTUU6IEl0IHdvdWxkIGJlIGJldHRlciB0byB1c2UgVFlQRV9NQVggaGVyZSwgYnV0CkBAIC0y ODI5Myw2ICszMzM3NywxNyBAQCBhcHBlbmRfZ2x5cGhsZXNzX2dseXBoIChzdHJ1Y3QgaXQgKml0 LCBpbnQgZmFjZV9pZCwgYm9vbCBmb3Jfbm9fZm9udCwgaW50IGxlbiwKIAkgICAgZ1sxXSA9ICpn OwogCSAgZ2x5cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYV07CiAJfQorCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlw aC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgq aXQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICBnbHlwaC0+Y2hhcnBv cyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAgICAgICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9i amVjdDsKICAgICAgIGVhc3NlcnQgKGl0LT5waXhlbF93aWR0aCA8PSBTSFJUX01BWCk7CkBAIC0y OTM0MywxMCArMzQ0MzgsMjAgQEAgZ3VpX2luc2VydF9nbHlwaHMgKHN0cnVjdCB3aW5kb3cgKncs IHN0cnVjdCBnbHlwaF9yb3cgKnVwZGF0ZWRfcm93LAogCiAgIC8qIFdyaXRlIHRoZSBnbHlwaHMu ICAqLwogICBocG9zID0gc3RhcnQgLSByb3ctPmdseXBoc1t1cGRhdGVkX2FyZWFdOworCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmICgh bWNfcmVkcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywgdXBkYXRlZF9hcmVhLCB3 LT5vdXRwdXRfY3Vyc29yLngsCisgICAgICAgICAgICAgICAgICAgICAgaHBvcywgaHBvcyArIGxl biwgZmFsc2UsIERSQVdfTk9STUFMX1RFWFQsIEdVSV9JTlNFUlRfR0xZUEhTKSkKICAgZHJhd19n bHlwaHMgKHcsIHctPm91dHB1dF9jdXJzb3IueCwgcm93LCB1cGRhdGVkX2FyZWEsCiAJICAgICAg IGhwb3MsIGhwb3MgKyBsZW4sCiAJICAgICAgIERSQVdfTk9STUFMX1RFWFQsIDApOwogCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIEFkdmFuY2UgdGhlIG91dHB1dCBjdXJzb3Iu ICAqLwogICB3LT5vdXRwdXRfY3Vyc29yLmhwb3MgKz0gbGVuOwogICB3LT5vdXRwdXRfY3Vyc29y LnggKz0gc2hpZnRfYnlfd2lkdGg7CkBAIC0yOTc3Miw5ICszNDg3NywxOSBAQCBndWlfZml4X292 ZXJsYXBwaW5nX2FyZWEgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywK IAkgIHdoaWxlIChpIDwgcm93LT51c2VkW2FyZWFdCiAJCSAmJiByb3ctPmdseXBoc1thcmVhXVtp XS5vdmVybGFwc192ZXJ0aWNhbGx5X3ApOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBpZiAoIW1jX3JlZHJhd19yb3cgKHcsIHct PmN1cnJlbnRfbWF0cml4LCByb3csIGFyZWEsIHN0YXJ0X3gsIHN0YXJ0LCBpLAorICAgICAgICAg IGZhbHNlLCBEUkFXX05PUk1BTF9URVhULCBHVUlfRklYX09WRVJMQVBQSU5HX0FSRUEpKQogCSAg ZHJhd19nbHlwaHMgKHcsIHN0YXJ0X3gsIHJvdywgYXJlYSwKIAkJICAgICAgIHN0YXJ0LCBpLAog CQkgICAgICAgRFJBV19OT1JNQUxfVEVYVCwgb3ZlcmxhcHMpOworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAJfQogICAgICAgZWxzZQogCXsKQEAgLTMwMDI1LDEwICszNTE0MCwxNyBA QCBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9uLAogICBu ZXdfY3Vyc29yX3R5cGUgPSBnZXRfd2luZG93X2N1cnNvcl90eXBlICh3LCBnbHlwaCwKIAkJCQkJ ICAgICZuZXdfY3Vyc29yX3dpZHRoLCAmYWN0aXZlX2N1cnNvcik7CiAKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgLyogSWYgY3Vyc29yIGlz IGN1cnJlbnRseSBiZWluZyBzaG93biBhbmQgd2UgZG9uJ3Qgd2FudCBpdCB0byBiZSBvcgogICAg ICBpdCBpcyBpbiB0aGUgd3JvbmcgcGxhY2UsIG9yIHRoZSBjdXJzb3IgdHlwZSBpcyBub3Qgd2hh dCB3ZSB3YW50LAogICAgICBlcmFzZSBpdC4gICovCiAgIGlmICh3LT5waHlzX2N1cnNvcl9vbl9w CisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMp KQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxl KSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikp CiAgICAgICAmJiAoIW9uCiAJICB8fCB3LT5waHlzX2N1cnNvci54ICE9IHgKIAkgIHx8IHctPnBo eXNfY3Vyc29yLnkgIT0geQpAQCAtMzAwNDEsNiArMzUxNjMsOSBAQCBkaXNwbGF5X2FuZF9zZXRf Y3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9uLAogCSAgICAgICYmIG5ld19jdXJzb3Jf d2lkdGggIT0gdy0+cGh5c19jdXJzb3Jfd2lkdGgpKSkKICAgICBlcmFzZV9waHlzX2N1cnNvciAo dyk7CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogRG9uJ3QgY2hlY2sgcGh5 c19jdXJzb3Jfb25fcCBoZXJlIGJlY2F1c2UgdGhhdCBmbGFnIGlzIG9ubHkgc2V0CiAgICAgIHRv IGZhbHNlIGluIHNvbWUgY2FzZXMgd2hlcmUgd2Uga25vdyB0aGF0IHRoZSBjdXJzb3IgaGFzIGJl ZW4KICAgICAgY29tcGxldGVseSBlcmFzZWQsIHRvIGF2b2lkIHRoZSBleHRyYSB3b3JrIG9mIGVy YXNpbmcgdGhlIGN1cnNvcgpAQCAtMzAwNTksOSArMzUxODQsMjAgQEAgZGlzcGxheV9hbmRfc2V0 X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBvbiwKICAgICAgIHctPnBoeXNfY3Vyc29y LnZwb3MgPSB2cG9zOwogICAgIH0KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworICBpZiAoTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRl bnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIG1jX2NvbmYpKSkKICAgRlJBTUVfUklGIChmKS0+ZHJhd193aW5kb3dfY3Vyc29yICh3 LCBnbHlwaF9yb3csIHgsIHksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg bmV3X2N1cnNvcl90eXBlLCBuZXdfY3Vyc29yX3dpZHRoLAogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIG9uLCBhY3RpdmVfY3Vyc29yKTsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogfQogCiAKQEAgLTMwMTU0LDcgKzM1MjkwLDE4IEBAIGRyYXdfcm93X3dpdGhf bW91c2VfZmFjZSAoc3RydWN0IHdpbmRvdyAqdywgaW50IHN0YXJ0X3gsIHN0cnVjdCBnbHlwaF9y b3cgKnJvdywKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KICAgaWYgKEZSQU1FX1dJTkRPV19Q IChYRlJBTUUgKHctPmZyYW1lKSkpCiAgICAgeworCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBpZiAoIW1jX3JlZHJhd19yb3cgKHcs IHctPmN1cnJlbnRfbWF0cml4LCByb3csIFRFWFRfQVJFQSwgc3RhcnRfeCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGZhbHNlLCBkcmF3LCBEUkFXX1JP V19XSVRIX01PVVNFX0ZBQ0UpKQogICAgICAgZHJhd19nbHlwaHMgKHcsIHN0YXJ0X3gsIHJvdywg VEVYVF9BUkVBLCBzdGFydF9ocG9zLCBlbmRfaHBvcywgZHJhdywgMCk7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICAgICAgIHJldHVybjsKICAgICB9CiAjZW5kaWYKQEAgLTMyMjE0 LDExICszNzM2MSwyMyBAQCBleHBvc2VfYXJlYSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGds eXBoX3JvdyAqcm93LCBjb25zdCBFbWFjc19SZWN0YW5nbGUgKnIsCiAgIHN0cnVjdCBnbHlwaCAq bGFzdDsKICAgaW50IGZpcnN0X3gsIHN0YXJ0X3gsIHg7CiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVB ICYmIHJvdy0+ZmlsbF9saW5lX3ApCisgICAgeworICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3 LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBhcmVhLCAwLCAwLCByb3ctPnVzZWRbYXJlYV0sCisg ICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlLCBEUkFXX05PUk1BTF9URVhULCBFWFBPU0Vf QVJFQV9PTkUpKQogICAgIC8qIElmIHJvdyBleHRlbmRzIGZhY2UgdG8gZW5kIG9mIGxpbmUgd3Jp dGUgdGhlIHdob2xlIGxpbmUuICAqLwogICAgIGRyYXdfZ2x5cGhzICh3LCAwLCByb3csIGFyZWEs CiAJCSAwLCByb3ctPnVzZWRbYXJlYV0sCiAJCSBEUkFXX05PUk1BTF9URVhULCAwKTsKKyAgICB9 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgZWxzZQogICAgIHsKICAgICAgIC8q IFNldCBTVEFSVF9YIHRvIHRoZSB3aW5kb3ctcmVsYXRpdmUgc3RhcnQgcG9zaXRpb24gZm9yIGRy YXdpbmcgZ2x5cGhzIG9mCkBAIC0zMjI1MCwxMSArMzc0MDksMjMgQEAgZXhwb3NlX2FyZWEgKHN0 cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgY29uc3QgRW1hY3NfUmVjdGFu Z2xlICpyLAogCSAgKytsYXN0OwogCX0KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAgICAgLyogUmVwYWludC4gICovCi0gICAgICBpZiAo bGFzdCA+IGZpcnN0KQorICAgICAgLyogRmxvYXRpbmcgZmFrZSBjdXJzb3JzIHdpbGwgZXhpc3Qg d2hlbiAobGFzdCA9PSBmaXJzdCkuICovCisgICAgICBpZiAoIW1jX3JlZHJhd19yb3cgKHcsIHct PmN1cnJlbnRfbWF0cml4LCByb3csIGFyZWEsIGZpcnN0X3ggLSBzdGFydF94LAorICAgICAgICAg ICAgICAgICAgICAgICAgICBmaXJzdCAtIHJvdy0+Z2x5cGhzW2FyZWFdLCBsYXN0IC0gcm93LT5n bHlwaHNbYXJlYV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlLCBEUkFXX05PUk1B TF9URVhULCBFWFBPU0VfQVJFQV9UV08pCisgICAgICAgICAgJiYgbGFzdCA+IGZpcnN0KQogCWRy YXdfZ2x5cGhzICh3LCBmaXJzdF94IC0gc3RhcnRfeCwgcm93LCBhcmVhLAogCQkgICAgIGZpcnN0 IC0gcm93LT5nbHlwaHNbYXJlYV0sIGxhc3QgLSByb3ctPmdseXBoc1thcmVhXSwKIAkJICAgICBE UkFXX05PUk1BTF9URVhULCAwKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAg IH0KIH0KIApAQCAtMzIyNjgsMTAgKzM3NDM5LDIyIEBAIGV4cG9zZV9saW5lIChzdHJ1Y3Qgd2lu ZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGNvbnN0IEVtYWNzX1JlY3RhbmdsZSAqcikK IHsKICAgZWFzc2VydCAocm93LT5lbmFibGVkX3ApOwogCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAgIGlmIChyb3ctPm1vZGVfbGluZV9wIHx8 IHctPnBzZXVkb193aW5kb3dfcCkKKyAgICB7CisgICAgICBpZiAoIW1jX3JlZHJhd19yb3cgKHcs IHctPmN1cnJlbnRfbWF0cml4LCByb3csIFRFWFRfQVJFQSwgMCwgMCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgcm93LT51c2VkW1RFWFRfQVJFQV0sIGZhbHNlLCBEUkFXX05PUk1BTF9URVhU LCBFWFBPU0VfTElORSkpCiAgICAgZHJhd19nbHlwaHMgKHcsIDAsIHJvdywgVEVYVF9BUkVBLAog CQkgMCwgcm93LT51c2VkW1RFWFRfQVJFQV0sCiAJCSBEUkFXX05PUk1BTF9URVhULCAwKTsKKyAg ICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgZWxzZQogICAgIHsKICAgICAg IGlmIChyb3ctPnVzZWRbTEVGVF9NQVJHSU5fQVJFQV0pCkBAIC0zMjgxOSw2ICszODAwMiwyMiBA QCBndWlfaW50ZXJzZWN0X3JlY3RhbmdsZXMgKGNvbnN0IEVtYWNzX1JlY3RhbmdsZSAqcjEsIGNv bnN0IEVtYWNzX1JlY3RhbmdsZSAqcjIsCiB2b2lkCiBzeW1zX29mX3hkaXNwICh2b2lkKQogewor CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisg IGRlZnN1YnIgKCZTbWNfZHVtcF9nbHlwaF9yb3cpOworCisgIGRlZnN1YnIgKCZTbWNfZHVtcF9n bHlwaF9tYXRyaXgpOworCisgIGRlZnN1YnIgKCZTbWNfY3VycmVudF9jb2x1bW4pOworCisgIGRl ZnN1YnIgKCZTbWNfc3RkZXJyKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBW d2l0aF9lY2hvX2FyZWFfc2F2ZV92ZWN0b3IgPSBRbmlsOwogICBzdGF0aWNwcm8gKCZWd2l0aF9l Y2hvX2FyZWFfc2F2ZV92ZWN0b3IpOwogCmRpZmYgLS1naXQgYS9zcmMveHRlcm0uYyBiL3NyYy94 dGVybS5jCmluZGV4IGM5NmFhNzQuLjdmOGYxYTAgMTAwNjQ0Ci0tLSBhL3NyYy94dGVybS5jCisr KyBiL3NyYy94dGVybS5jCkBAIC0xMzIsNiArMTMyLDkwNCBAQCBhbG9uZyB3aXRoIEdOVSBFbWFj cy4gIElmIG5vdCwgc2VlIDxodHRwczovL3d3dy5nbnUub3JnL2xpY2Vuc2VzLz4uICAqLwogI2lu Y2x1ZGUgPFgxMS9YS0JsaWIuaD4KICNlbmRpZgogCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisjaWZkZWYgR0xZUEhfREVCVUcKK3N0 YXRpYyB2b2lkIHhfY2hlY2tfZm9udCAoc3RydWN0IGZyYW1lICosIHN0cnVjdCBmb250ICopOwor I2VuZGlmCisKK3N0YXRpYyB2b2lkIHhfc2V0X21vZGVfbGluZV9mYWNlX2djIChzdHJ1Y3QgZ2x5 cGhfc3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NlIGlmIChzLT5o bCA9PSBEUkFXX0NVUlNPUikKKyAgICB7CisgICAgICBtY194X3NldF9jdXJzb3JfZ2MgKHMsIGN1 cnNvcl9nY19wKTsKKyAgICAgIHMtPnN0aXBwbGVkX3AgPSBmYWxzZTsKKyAgICB9CisgIGVsc2Ug aWYgKHMtPmhsID09IERSQVdfTU9VU0VfRkFDRSkKKyAgICB7CisgICAgICB4X3NldF9tb3VzZV9m YWNlX2djIChzKTsKKyAgICAgIHMtPnN0aXBwbGVkX3AgPSBzLT5mYWNlLT5zdGlwcGxlICE9IDA7 CisgICAgfQorICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX0lNQUdFX1JBSVNFRAorICAgICAgICAg ICB8fCBzLT5obCA9PSBEUkFXX0lNQUdFX1NVTktFTikKKyAgICB7CisgICAgICBzLT5nYyA9IHMt PmZhY2UtPmdjOworICAgICAgcy0+c3RpcHBsZWRfcCA9IHMtPmZhY2UtPnN0aXBwbGUgIT0gMDsK KyAgICB9CisgIGVsc2UKKyAgICBlbWFjc19hYm9ydCAoKTsKKyAgLyogR0MgbXVzdCBoYXZlIGJl ZW4gc2V0LiAqLworICBlYXNzZXJ0IChzLT5nYyAhPSAwKTsKK30KKworLyogRHJhdyBhIGhvbGxv dyBib3ggY3Vyc29yIG9uIHdpbmRvdyBXIGluIGdseXBoIHJvdyBST1cuICovCitzdGF0aWMgdm9p ZAorbWNfeF9kcmF3X2hvbGxvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlw aF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAg ICAgICAgICAgIGludCB4LCBpbnQgZngsIGludCB5LCBpbnQgZnksIGludCBocG9zLCBpbnQgdnBv cywgaW50IHdkLCBpbnQgaCkKK3sKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1df RlJBTUUgKHcpKTsKKyAgc3RydWN0IHhfZGlzc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mRvdyAq dywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisg ICAgICAgICAgICAgICAgICAgICAgICAgaW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50 IGhwb3MsIGludCB2cG9zLCBpbnQgd2QsCisgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGgs IHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLAorICAg ICAgICAgICAgICAgICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGgsIGVudW0gbWNfZmxhdm9yIGds eXBoX2ZsYXZvciwgYm9vbCBvbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0 aXZlX3ApCit7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7 CisgIC8qIFRoZSBmcmluZ2UgYml0bWFwcyBhcmUgcHJlc2VudGx5IGhhbmRsZWQgZWxzZXdoZXJl LCBidXQgY291bGQgc29tZWRheQorICBiZSBtYW5hZ2VkIChpbiBwYXJ0KSBhdCB0aGlzIHNlY3Rp b24gb2YgY29kZS4gKi8KKyAgaWYgKG9uX3ApCisgICAgeworICAgICAgaWYgKHJvdy0+ZXhhY3Rf d2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICYmIChyb3ctPnJldmVyc2VkX3AKKyAgICAg ICAgICAgICAgPyAoaHBvcyA8IDApCisgICAgICAgICAgICAgIDogKGhwb3MgPj0gcm93LT51c2Vk W1RFWFRfQVJFQV0pKSkKKyAgICAgICAgeworICAgICAgICAgIHJvdy0+Y3Vyc29yX2luX2ZyaW5n ZV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywgcm93 LT5yZXZlcnNlZF9wLCBjdXJzb3JfdHlwZSk7CisgICAgICAgIH0KK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91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9y ZWdpb25fZW5kX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgIGVsc2UgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAmJiBh Y3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3Mg PiByZWdpb25fYmVnCisgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hh cnBvcyA8IHJlZ2lvbl9lbmQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZV9pZCA9IGxvb2t1 cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW4tcmVnaW9u LXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhv bGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93 X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgIGVudW0g ZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwg aW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAg ICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9J RCAoZiwgaG9sbG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgIFhTZXRGb3Jl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YWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQg PSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWlu YWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVj dCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2lu YWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChG UkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19p bmFjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICBYU2V0QmFj a2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2dj LCBob2xsb3dfaW5hY3RpdmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAvKiBGb3JjZSBgbWNfeF9z ZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycuICov CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAgICAgICAgbWNfZHJhd19j dXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywg bHNsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIGN1cnNv cl90eXBlLC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19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwg eSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgICB9CisgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBUZW1wb3JhcmlseSBo aWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAg ICAgICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHhmbnMuYy4gKi8KKyAg ICAgICAgICAgICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYgYWN0 aXZlX3AKKyAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBvcyA9PSByZWdp b25fYmVnKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9p ZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3 LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItYXQtcmVnaW9uLXByZS16di1mYWNlIiks IHRydWUpOworICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVn aW9uX2JlZ19mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdf ZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9m YWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1 cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNl ICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFj ZV9pZCk7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZ IChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX2ZhY2UtPmZv cmVncm91bmQpOworICAgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElT UExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9yZWdp b25fYmVnX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg ICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAm JiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hh cnBvcyA9PSByZWdpb25fZW5kKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2VfaWQgPSBsb29r dXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWF0LXJlZ2lv bi1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2Ug KmhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3df YWN0aXZlX3JlZ2lvbl9lbmRfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgIGVudW0gZmFj ZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lE IChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBYU2V0Rm9y ZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2dj LCBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgICBY U2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vy c29yX2djLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZS0+YmFja2dyb3VuZCk7CisgICAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPiByZWdpb25fYmVnCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPCByZWdpb25f ZW5kKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgZW51bSBm YWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZV9pZCA9IGxvb2t1cF9uYW1l ZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW4tcm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3JfZ2Ms IGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9nYywgaG9sbG93X2luYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAg ICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAg ICAgICAgICAgLyogRm9yY2UgYG1jX3hfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRw dXRfZGF0YS54LT5jdXJzb3JfZ2MnLiAqLworICAgICAgICAgICAgICBib29sIGN1cnNvcl9nY19w ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwg cm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9w LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX2djX3ApOworICAg ICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0 X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgICAgICBYU2V0 QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29y X2djLCB4Z2N2LmJhY2tncm91bmQpOworICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOwor ICAgICAgICAgICAgICAvKiBEcmF3IHRoZSBmcmFtZSBhcm91bmQgdGhlIGJveC4gKi8KKyAgICAg ICAgICAgICAgbWNfeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwg eSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICAgIH0KKyAgICAgIGJyZWFrOwor ICAgIH0KKyAgICBjYXNlIE1DX0hPTExPV19CT1g6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQg Pj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAg ICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4 ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9y LnBpeGVsOworICAgICAgICAgIG1jX3hfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJv dywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAgZi0+b3V0cHV0 X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9 CisgICAgICAgIGVsc2UKKyAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0 cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgYnJlYWs7 CisgICAgfQorICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICB7CisgICAgICBpZiAobHNsLnJl ZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIC8qIFRl bXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJyBieSBib3Jyb3dp bmcgdGhlCisgICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhfbWFrZV9nYycgaW4geGZucy5jLiAq LworICAgICAgICB7CisgICAgICAgICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgWFNldEZv cmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9n YywgRlJBTUVfQkFDS0dST1VORF9QSVhFTCAoZikpOworICAgICAgICAgIFhTZXRCYWNrZ3JvdW5k IChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGNvbG9y LnBpeGVsKTsKKyAgICAgICAgICAvKiBGb3JjZSBgbWNfeF9zZXRfY3Vyc29yX2djJyB0byB1c2Ug YHMtPmYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycuICovCisgICAgICAgICAgYm9vbCBjdXJz b3JfZ2NfcCA9IHRydWU7CisgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJp eCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywgbHNsLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3As IGN1cnNvcl9nY19wKTsKKyAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZ IChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmZvcmVncm91bmQpOworICAg ICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0 YS54LT5jdXJzb3JfZ2MsIHhnY3YuYmFja2dyb3VuZCk7CisgICAgICAgICAgdW5ibG9ja19pbnB1 dCAoKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAg Ym9vbCBjdXJzb3JfZ2NfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5 cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywgbHNsLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUs IHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOwor ICAgIH0KKyAgICBjYXNlIE1DX0JBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYm IGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAv KiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICov CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7 CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IHRydWU7CisgICAg ICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnks IGhwb3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJz b3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAg IGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsK KyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBj dXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfeF9kcmF3 X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdk LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNf QkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAgYnJl YWs7CisgICAgfQorICAgIGNhc2UgTUNfSEJBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+ PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAg ICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhl bCcuICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gY29sb3Iu cGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IHRydWU7 CisgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwg eSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAg ICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3Jf cGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAg IGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSBmYWxzZTsKKyAgICAgICAgICAgIG1j X3hfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2 cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lk dGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICB9Cisg ICAgICBicmVhazsKKyAgICB9CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOwor ICB9CisgICAgICAgIH0KKyNpZmRlZiBIQVZFX1hfSTE4TgorICBpZiAodyA9PSBYV0lORE9XIChm LT5zZWxlY3RlZF93aW5kb3cpKQorICAgIGlmIChGUkFNRV9YSUMgKGYpICYmIChGUkFNRV9YSUNf U1RZTEUgKGYpICYgWElNUHJlZWRpdFBvc2l0aW9uKSkKKyAgICAgIHhpY19zZXRfcHJlZWRpdGFy ZWEgKHcsIHgsIHkpOworI2VuZGlmCisgICAgfQorICBYRmx1c2ggKEZSQU1FX1hfRElTUExBWSAo ZikpOworfQorCisvKiBEcmF3IHN0cmV0Y2ggZ2x5cGggc3RyaW5nIFMuICovCitzdGF0aWMgdm9p ZAorbWNfeF9kcmF3X3N0cmV0Y2hfZ2x5cGhfc3RyaW5nIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpz KQoreworICBlYXNzZXJ0IChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKTsK KyAgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAmJiAheF9zdHJldGNoX2N1cnNvcl9w KQorICAgIHsKKyAgICAgIC8qIElmIGB4LXN0cmV0Y2gtY3Vyc29yJyBpcyBuaWwsIGRvbid0IGRy YXcgYSBibG9jayBjdXJzb3IgYXMgd2lkZSBhcyB0aGUKKyAgICAgIHN0cmV0Y2ggZ2x5cGguICov CisgICAgICBpbnQgd2lkdGgsIGJhY2tncm91bmRfd2lkdGggPSBzLT5iYWNrZ3JvdW5kX3dpZHRo OworICAgICAgaW50IHggPSBzLT54OworICAgICAgaWYgKCFzLT5yb3ctPnJldmVyc2VkX3ApCisg ICAgICAgIHsKKyAgICAgICAgICBpbnQgbGVmdF94ID0gd2luZG93X2JveF9sZWZ0X29mZnNldCAo cy0+dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICBpZiAoeCA8IGxlZnRfeCkKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgYmFja2dyb3VuZF93aWR0aCAtPSBsZWZ0X3ggLSB4OworICAgICAg ICAgICAgICB4ID0gbGVmdF94OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVs c2UKKyAgICAgICAgICB7CisgICAgICAgICAgICAvKiBJbiBSMkwgcm93cywgZHJhdyB0aGUgY3Vy c29yIG9uIHRoZSByaWdodCBlZGdlIG9mIHRoZQorICAgICAgICAgICAgICAgc3RyZXRjaCBnbHlw aC4gKi8KKyAgICAgICAgICAgIGludCByaWdodF94ID0gd2luZG93X2JveF9yaWdodCAocy0+dywg VEVYVF9BUkVBKTsKKyAgICAgICAgICAgIGlmICh4ICsgYmFja2dyb3VuZF93aWR0aCA+IHJpZ2h0 X3gpCisgICAgICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0geCAtIHJpZ2h0X3g7CisgICAg ICAgICAgICB4ICs9IGJhY2tncm91bmRfd2lkdGg7CisgICAgICAgICAgfQorICAgICAgd2lkdGgg PSBtaW4gKEZSQU1FX0NPTFVNTl9XSURUSCAocy0+ZiksIGJhY2tncm91bmRfd2lkdGgpOworICAg ICAgaWYgKHMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgeCAtPSB3aWR0aDsKKyAgICAgIC8q IERyYXcgY3Vyc29yLiAqLworICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19iZ19yZWN0IChzLCB4 LCBzLT55LCB3aWR0aCwgcy0+aGVpZ2h0KTsKKyAgICAgIC8qIENsZWFyIHJlc3QgdXNpbmcgdGhl IEdDIG9mIHRoZSBvcmlnaW5hbCBub24tY3Vyc29yIGZhY2UuICovCisgICAgICBpZiAod2lkdGgg PCBiYWNrZ3JvdW5kX3dpZHRoKQorICAgICAgICB7CisgICAgICAgICAgaW50IHkgPSBzLT55Owor ICAgICAgICAgIGludCB3ID0gYmFja2dyb3VuZF93aWR0aCAtIHdpZHRoLCBoID0gcy0+aGVpZ2h0 OworICAgICAgICAgIFhSZWN0YW5nbGUgcjsKKyAgICAgICAgICBHQyBnYzsKKyAgICAgICAgICBp ZiAoIXMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgICAgIHggKz0gd2lkdGg7CisgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgeCA9IHMtPng7CisgICAgICAgICAgaWYgKHMtPnJvdy0+bW91 c2VfZmFjZV9wCisgICAgICAgICAgICAgICYmIGN1cnNvcl9pbl9tb3VzZV9mYWNlX3AgKHMtPncp KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICB4X3NldF9tb3VzZV9mYWNlX2djIChzKTsK KyAgICAgICAgICAgICAgZ2MgPSBzLT5nYzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNl CisgICAgICAgICAgICBnYyA9IHMtPmZhY2UtPmdjOworICAgICAgICAgIGdldF9nbHlwaF9zdHJp bmdfY2xpcF9yZWN0IChzLCAmcik7CisgICAgICAgICAgeF9zZXRfY2xpcF9yZWN0YW5nbGVzIChz LT5mLCBnYywgJnIsIDEpOworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdGlwcGxlKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICAvKiBGaWxsIGJhY2tncm91bmQgd2l0aCBhIHN0aXBwbGUg cGF0dGVybi4gKi8KKyAgICAgICAgICAgICAgWFNldEZpbGxTdHlsZSAoRlJBTUVfWF9ESVNQTEFZ IChzLT5mKSwgZ2MsIEZpbGxPcGFxdWVTdGlwcGxlZCk7CisgICAgICAgICAgICAgIHhfZmlsbF9y ZWN0YW5nbGUgKHMtPmYsIGdjLCB4LCB5LCB3LCBoKTsKKyAgICAgICAgIC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yaW5nIGluc3RlYWQgb2Yg WERyYXdJbWFnZVN0cmluZy4gKi8KKyAgaWYgKHMtPm5leHQgJiYgcy0+cmlnaHRfb3Zlcmhhbmcg JiYgIXMtPmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICBpbnQgd2lkdGg7CisgICAgICBzdHJ1 Y3QgZ2x5cGhfc3RyaW5nICpuZXh0OworICAgICAgZm9yICh3aWR0aCA9IDAsIG5leHQgPSBzLT5u ZXh0OworICAgICAgICAgICBuZXh0ICYmIHdpZHRoIDwgcy0+cmlnaHRfb3Zlcmhhbmc7CisgICAg ICAgICAgIHdpZHRoICs9IG5leHQtPndpZHRoLCBuZXh0ID0gbmV4dC0+bmV4dCkKKyAgICAgICAg aWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlICE9IElNQUdFX0dMWVBIKQorICAgICAgICAgIHsK KyAgICAgICAgICAgIG1jX3hfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4dCwgY3Vyc29yX2djX3Ap OworICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nIChuZXh0KTsKKyAgICAg ICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICAg ICAgICAgICAgICBtY194X2RyYXdfc3RyZXRjaF9nbHlwaF9zdHJpbmcgKG5leHQpOworICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQg KG5leHQsIHRydWUpOworICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAg ICB9CisgICAgfQorICAvKiBTZXQgdXAgUy0+Z2MsIHNldCBjbGlwcGluZyBhbmQgZHJhdyBTLiAq LworICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHMsIGN1cnNvcl9nY19wKTsKKyAgLyogRHJh dyByZWxpZWYgKGlmIGFueSkgaW4gYWR2YW5jZSBmb3IgY2hhci9jb21wb3NpdGlvbiBzbyB0aGF0 IHRoZQorICAgICBnbHlwaCBzdHJpbmcgY2FuIGJlIGRyYXduIG92ZXIgaXQuICovCisgIGlmICgh cy0+Zm9yX292ZXJsYXBzCisgICAgICAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gKKyAg ICAgICYmIChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICAgfHwg cy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKSkKKyAgICB7CisgICAgICB4 X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmcgKHMpOworICAgICAgeF9kcmF3X2dseXBoX3N0cmlu Z19iYWNrZ3JvdW5kIChzLCB0cnVlKTsKKyAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYm94IChz KTsKKyAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZyAocyk7CisgICAgICByZWxpZWZf ZHJhd25fcCA9IHRydWU7CisgICAgfQorICAgIGVsc2UgaWYgKCFzLT5jbGlwX2hlYWQgLyogZHJh d19nbHlwaHMgZGlkbid0IHNwZWNpZnkgYSBjbGlwIG1hc2suICovCisgICAgICAgICAgICAgJiYg IXMtPmNsaXBfdGFpbAorICAgICAgICAgICAgICYmICgocy0+cHJldiAmJiBzLT5wcmV2LT5obCAh PSBzLT5obCAmJiBzLT5sZWZ0X292ZXJoYW5nKQorICAgICAgICAgICAgICAgICB8fCAocy0+bmV4 dCAmJiBzLT5uZXh0LT5obCAhPSBzLT5obCAmJiBzLT5yaWdodF9vdmVyaGFuZykpKQorICAgICAg LyogV2UgbXVzdCBjbGlwIGp1c3QgdGhpcyBnbHlwaC4gIGxlZnRfb3ZlcmhhbmcgcGFydCBoYXMg YWxyZWFkeQorICAgICAgICAgZHJhd24gd2hlbiBzLT5wcmV2IHdhcyBkcmF3biwgYW5kIHJpZ2h0 X292ZXJoYW5nIHBhcnQgd2lsbCBiZQorICAgICAgICAgZHJhd24gbGF0ZXIgd2hlbiBzLT5uZXh0 IGlzIGRyYXduLiAqLworICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nX2V4YWN0bHkg KHMsIHMpOworICAgICAgZWxzZQorICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmcg KHMpOworICBzd2l0Y2ggKHMtPmZpcnN0X2dseXBoLT50eXBlKQorICAgIHsKKyAgICBjYXNlIElN QUdFX0dMWVBIOgorICAgICAgeF9kcmF3X2ltYWdlX2dseXBoX3N0cmluZyAocyk7CisgICAgICBi cmVhazsKKyAgICBjYXNlIFhXSURHRVRfR0xZUEg6CisgICAgICB4X2RyYXdfeHdpZGdldF9nbHlw aF9zdHJpbmcgKHMpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBTVFJFVENIX0dMWVBIOgorICAg ICAgbWNfeF9kcmF3X3N0cmV0Y2hfZ2x5cGhfc3RyaW5nIChzKTsKKyAgICAgIGJyZWFrOworICAg IGNhc2UgQ0hBUl9HTFlQSDoKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMpCisgICAgICAgIHMt PmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICAgICAgICB4X2RyYXdf Z2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIGZhbHNlKTsKKyAgICAgIHhfZHJhd19nbHlwaF9z dHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVhazsKKyAgICBjYXNlIENPTVBPU0lURV9H TFlQSDoKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMgfHwgKHMtPmNtcF9mcm9tID4gMAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0 b21hdGljKSkKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBl bHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgdHJ1ZSk7Cisg ICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAg IGJyZWFrOworICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9vdmVy bGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNl CisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgdHJ1ZSk7CisgICAg ICB4X2RyYXdfZ2x5cGhsZXNzX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJy ZWFrOworICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgICB9CisgIGlmICgh cy0+Zm9yX292ZXJsYXBzKQorICAgIHsKKyAgICAgIC8qIERyYXcgdW5kZXJsaW5lLiAqLworICAg ICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKHMt PmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAg ICAgICAgICAgICB4X2RyYXdfdW5kZXJ3YXZlIChzKTsKKyAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAg ICAgICAgICAgICAgWEdldEdDVmFsdWVzIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBzLT5nYywg R0NGb3JlZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAo RlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgcy0+Z2MsIHMtPmZhY2UtPnVuZGVybGluZV9jb2xvcik7 CisgICAgICAgICAgICAgICAgICB4X2RyYXdfdW5kZXJ3YXZlIChzKTsKKyAgICAgICAgICAgICAg ICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBzLT5nYywgeGdjdi5m b3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAg ZWxzZSBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRp b247CisgICAgICAgICAgICAgIGludCB5OworICAgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBz LT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfcAorICAgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+ ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgIC8qIFdlIHVzZSB0aGUgc2FtZSB1bmRlcmxpbmUgc3R5bGUg YXMgdGhlIHByZXZpb3VzIG9uZS4gKi8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMt PnByZXYtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9 IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBHZXQg dGhlIHVuZGVybGluZSB0aGlja25lc3MuICBEZWZhdWx0IGlzIDEgcGl4ZWwuICovCisgICAgICAg ICAgICAgICAgICBpZiAocy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4g MCkKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3Ro aWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgdGhp Y2tuZXNzID0gMTsKKyAgICAgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50 X2xpbmUpCisgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIHRoaWNr bmVzcykgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJs aW5lIHBvc2l0aW9uLiAgVGhpcyBpcyB0aGUgcmVjb21tZW5kZWQKKyAgICAgICAgICAgICAgICAg ICAgICAgICB2ZXJ0aWNhbCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRo ZSB0b3Agb2YKKyAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBp cyBhIHNpZ25lZCB2YWx1ZSBhY2NvcmRpbmcgdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAg ICAgc3BlY3MsIGFuZCBpdHMgZGVmYXVsdCBpcworICAgICAgICAgICAgICAgICAgICAgICAgIFJP VU5EICgobWF4aW11bSBkZXNjZW50KSAvIDIpLCB3aXRoCisgICAgICAgICAgICAgICAgICAgICAg ICAgUk9VTkQoeCkgPSBmbG9vciAoeCArIDAuNSkgICovCisgICAgICAgICAgICAgICAgICAgICAg aWYgKHhfdXNlX3VuZGVybGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVzCisgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49IDAp CisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPmZvbnQtPnVuZGVybGluZV9w b3NpdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChzLT5mb250KQorICAgICAg ICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+Zm9udC0+ZGVzY2VudCArIDEpIC8gMjsK KyAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICBwb3Np dGlvbiA9IHVuZGVybGluZV9taW5pbXVtX29mZnNldDsKKyAgICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWlu aW11bV9vZmZzZXQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyogQ2hlY2sg dGhlIHNhbml0eSBvZiB0aGlja25lc3MgYW5kIHBvc2l0aW9uLiAgV2Ugc2hvdWxkCisgICAgICAg ICAgICAgICAgIGF2b2lkIGRyYXdpbmcgdW5kZXJsaW5lIG91dCBvZiB0aGUgY3VycmVudCBsaW5l IGFyZWEuICovCisgICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDw9IHMtPnliYXNl ICsgcG9zaXRpb24pCisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gMSkg LSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQg PCBzLT55YmFzZSArIHBvc2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAgICAgIHRoaWNr bmVzcyA9IChzLT55ICsgcy0+aGVpZ2h0KSAtIChzLT55YmFzZSArIHBvc2l0aW9uKTsKKyAgICAg ICAgICAgICAgcy0+dW5kZXJsaW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAg ICAgcy0+dW5kZXJsaW5lX3Bvc2l0aW9uID0gcG9zaXRpb247CisgICAgICAgICAgICAgIHkgPSBz LT55YmFzZSArIHBvc2l0aW9uOworICAgICAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5l X2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMt PmdjLCBzLT54LCB5LCBzLT53aWR0aCwgdGhpY2tuZXNzKTsKKyAgICAgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAg ICAgICAgICAgICAgICAgWEdldEdDVmFsdWVzIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBzLT5n YywgR0NGb3JlZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3Vu ZCAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgcy0+Z2MsIHMtPmZhY2UtPnVuZGVybGluZV9jb2xv cik7CisgICAgICAgICAgICAgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBzLT5nYywgcy0+ eCwgeSwgcy0+d2lkdGgsIHRoaWNrbmVzcyk7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdy b3VuZCAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgcy0+Z2MsIHhnY3YuZm9yZWdyb3VuZCk7Cisg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAvKiBEcmF3 IG92ZXJsaW5lLiAqLworICAgICAgaWYgKHMtPmZhY2UtPm92ZXJsaW5lX3ApCisgICAgICAgIHsK KyAgICAgICAgICB1bnNpZ25lZCBsb25nIGR5ID0gMCwgaCA9IDE7CisgICAgICAgICAgaWY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GgsIGgpOworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgWEdDVmFsdWVzIHhnY3Y7CisgICAgICAgICAgICAgIFhHZXRHQ1ZhbHVl cyAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgcy0+Z2MsIEdDRm9yZWdyb3VuZCwgJnhnY3YpOwor ICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgcy0+ Z2MsIHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX2NvbG9yKTsKKyAgICAgICAgICAgICAgeF9maWxs X3JlY3RhbmdsZSAocy0+Ziwgcy0+Z2MsIHMtPngsIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOwor ICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgcy0+ Z2MsIHhnY3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIC8q IERyYXcgcmVsaWVmIGlmIG5vdCB5ZXQgZHJhd24uICovCisgICAgICBpZiAoIXJlbGllZl9kcmF3 bl9wICYmIHMtPmZhY2UtPmJveCAhPSBGQUNFX05PX0JPWCkKKyAgICAgICAgICB4X2RyYXdfZ2x5 cGhfc3RyaW5nX2JveCAocyk7CisgICAgICBpZiAocy0+cHJldikKKyAgICAgICAgeworICAgICAg ICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKnByZXY7CisgICAgICAgICAgZm9yIChwcmV2ID0gcy0+ cHJldjsgcHJldjsgcHJldiA9IHByZXYtPnByZXYpCisgICAgICAgICAgICBpZiAocHJldi0+aGwg IT0gcy0+aGwKKyAgICAgICAgICAgICAgICAmJiBwcmV2LT54ICsgcHJldi0+d2lkdGggKyBwcmV2 LT5yaWdodF9vdmVyaGFuZyA+IHMtPngpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICAvKiBBcyBwcmV2IHdhcyBkcmF3biB3aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwgd2UK KyAgICAgICAgICAgICAgICAgICBtdXN0IGRyYXcgdGhlIHJpZ2h0X292ZXJoYW5nIHBhcnQgdXNp bmcgcy0+aGwgbm93LiAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBz YXZlID0gcHJldi0+aGw7CisgICAgICAgICAgICAgICAgcHJldi0+aGwgPSBzLT5obDsKKyAgICAg ICAgICAgICAgICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHByZXYsIGN1cnNvcl9nY19wKTsK KyAgICAgICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywg cHJldik7CisgICAgICAgICAgICAgICAgaWYgKHByZXYtPmZpcnN0X2dseXBoLT50eXBlID09IENI QVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91 bmQgKHByZXYpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHhfZHJh d19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAg ICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChwcmV2LT5mLCBwcmV2LT5nYyk7CisgICAgICAg ICAgICAgICAgcHJldi0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIHByZXYtPm51bV9jbGlw cyA9IDA7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHMtPm5leHQpCisg ICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpuZXh0OworICAgICAgICAg IGZvciAobmV4dCA9IHMtPm5leHQ7IG5leHQ7IG5leHQgPSBuZXh0LT5uZXh0KQorICAgICAgICAg ICAgaWYgKG5leHQtPmhsICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYgbmV4dC0+eCAtIG5l eHQtPmxlZnRfb3ZlcmhhbmcgPCBzLT54ICsgcy0+d2lkdGgpCisgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAvKiBBcyBuZXh0IHdpbGwgYmUgZHJhd24gd2hpbGUgY2xpcHBlZCB0byBp dHMgb3duIGFyZWEsCisgICAgICAgICAgICAgICAgICAgd2UgbXVzdCBkcmF3IHRoZSBsZWZ0X292 ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwgbm93LiAqLworICAgICAgICAgICAgICAgIGVudW0gZHJh d19nbHlwaHNfZmFjZSBzYXZlID0gbmV4dC0+aGw7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwg PSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKG5leHQs IGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBp bmdfZXhhY3RseSAocywgbmV4dCk7CisgICAgICAgICAgICAgICAgaWYgKG5leHQtPmZpcnN0X2ds eXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhf c3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQp OworICAgICAgICAgICAgICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChuZXh0LT5mLCBuZXh0 LT5nYyk7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAg IG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgICAgbmV4dC0+Y2xpcF9oZWFkID0g cy0+bmV4dDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAvKiBSZXNldCBj bGlwcGluZy4gKi8KKyAgeF9yZXNldF9jbGlwX3JlY3RhbmdsZXMgKHMtPmYsIHMtPmdjKTsKKyAg cy0+bnVtX2NsaXBzID0gMDsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKIC8qIERlZmF1bHQgdG8gdXNpbmcgWElNIGlmIGF2YWls YWJsZS4gICovCiAjaWZkZWYgVVNFX1hJTQogYm9vbCB1c2VfeGltID0gdHJ1ZTsKQEAgLTExMDks NiArMjAwNywxNiBAQCBzdGF0aWMgdm9pZAogeF91cGRhdGVfYmVnaW4gKHN0cnVjdCBmcmFtZSAq ZikKIHsKICAgLyogTm90aGluZyB0byBkby4gICovCisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBm OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIC8qIERyYXcgYSB2ZXJ0aWNh bCB3aW5kb3cgYm9yZGVyIGZyb20gKHgseTApIHRvICh4LHkxKSAgKi8KQEAgLTEyNTQsNiArMjE2 MiwxNiBAQCB4X3VwZGF0ZV9lbmQgKHN0cnVjdCBmcmFtZSAqZikKICAgWEZsdXNoIChGUkFNRV9Y X0RJU1BMQVkgKGYpKTsKICAgdW5ibG9ja19pbnB1dCAoKTsKICNlbmRpZgorCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0 aW5nX2ZyYW1lID0gTlVMTDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAv KiBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCBmcm9tIHZhcmlvdXMgcGxhY2VzIGluIHhkaXNwLmMK QEAgLTEzMjM4LDYgKzE0MTU2LDIwIEBAIGV4dGVybiBmcmFtZV9wYXJtX2hhbmRsZXIgeF9mcmFt ZV9wYXJtX2hhbmRsZXJzW107CiAKIHN0YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSB4 X3JlZGlzcGxheV9pbnRlcmZhY2UgPQogICB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBg eHRlcm0uY2AgbXVzdCBiZSBpbiB0aGUgZXhhY3Qgc2FtZSBvcmRlciBhcyB0aGUKK2ByZWRpc3Bs YXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4dGVybi5oYCEgKi8KKworICBtY194X2RyYXdfd2luZG93 X2N1cnNvciwKKyAgbWNfeF9kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICAgIHhfZnJhbWVfcGFybV9oYW5kbGVycywKICAgICBndWlfcHJvZHVjZV9n bHlwaHMsCiAgICAgZ3VpX3dyaXRlX2dseXBocywK --Multipart_Wed_Jul_31_12:39:45_2019-1--