From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.bugs Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). Date: Thu, 22 Aug 2019 22:19:54 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Thu_Aug_22_22:19:53_2019-1" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="173030"; 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 Fri Aug 23 07:48:08 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 1i12Qg-000fpA-6p for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Aug 2019 07:48:08 +0200 Original-Received: from localhost ([::1]:51768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i12Qe-0008VU-T0 for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Aug 2019 01:48:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46272) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i120Z-0004gJ-5C for bug-gnu-emacs@gnu.org; Fri, 23 Aug 2019 01:21:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i120W-0000Om-Kh for bug-gnu-emacs@gnu.org; Fri, 23 Aug 2019 01:21:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58288) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i120V-0000O0-4v for bug-gnu-emacs@gnu.org; Fri, 23 Aug 2019 01:21:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i120U-0003J6-UX for bug-gnu-emacs@gnu.org; Fri, 23 Aug 2019 01:21:03 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Keith David Bershatsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Aug 2019 05:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs Original-Received: via spool by 22873-submit@debbugs.gnu.org id=B22873.156653760312585 (code B ref 22873); Fri, 23 Aug 2019 05:21:02 +0000 Original-Received: (at 22873) by debbugs.gnu.org; 23 Aug 2019 05:20:03 +0000 Original-Received: from localhost ([127.0.0.1]:38875 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i11zW-0003Gl-71 for submit@debbugs.gnu.org; Fri, 23 Aug 2019 01:20:02 -0400 Original-Received: from gateway20.websitewelcome.com ([192.185.59.4]:46383) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i11zU-0003GL-2A for 22873@debbugs.gnu.org; Fri, 23 Aug 2019 01:20:00 -0400 Original-Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway20.websitewelcome.com (Postfix) with ESMTP id D0613400CC520 for <22873@debbugs.gnu.org>; Thu, 22 Aug 2019 23:15:15 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id 11zSiI32v4FKp11zSiNIzm; Fri, 23 Aug 2019 00:19:59 -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=Fu+hq/EkQRNAItBwkmQ6cqUG8FsPsUKMdGIEmQwNV5A=; b=Ynb2Cs30gNsHGNEo5zztrjh92Y yN/W0at/74Fde+8y0QE4Eo7VMfym66+w/YLSmYZsiS95CEdMzf1J1bSGfrimohm7xcPtpev3QW5SL TjpMfx29ySwKwMvLp9Pm0aEPC9ZC59ur7niABMBxjbGed5QplJe+1tDhv7WSySQqdccTlOcodYWfY PNP2Ycrhje8G3yArL2C1Deu9wx0r7QK0OYPMkEghqdlQ3SAjDuFdoFDC1w34Tao/zlUjHuu95fruf VUswWN0jOfyx75hZE9fO/CNa/PLHncYFLQ5YmyyAowzMGmJgrGtQUJvU/D+xMY3ATfpYucdAIzmoq MudK1qDQ==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:51997 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1i11zO-000PJP-Sy; Fri, 23 Aug 2019 00:19:58 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1i11zO-000PJP-Sy X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:51997 X-Source-Auth: lawlist X-Email-Count: 8 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:165643 Archived-At: --Multipart_Thu_Aug_22_22:19:53_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 022.003 [08/22/2019] CHANGELOG: - Fixed a bug preventing the visible fill column indicator from displaying on continuation lines when a partially visible glyph is straddling the window body width limit (aka text_area_width). - Fringe bitmap faces are now handled with `lookup_derived_face' instead of `lookup_named_face' so that the background color of the fringe will be taken into consideration (if it is different than the default background face). - `mc_draw_erase_hybrid': No need to call `mc_draw_fringe_bitmap' -- setting the rows with the necessary fringe bitmap data ensures `draw_row_fringe_bitmaps' will handle everything when needed. - `mc_update_window_erase': Fixed a couple of warnings during the build of Emacs relating to `fprintf' arguments not matching the expected %d\int format. - Revisions to the NOTES section of this commentary. - 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)) 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 of fake cursors from the previous redisplay is copied to a temporary `mc_matrix` under the name of `old_matrix`. `mc_update_text_area' (used for `!draw_p` / `draw_p` situations) calls `mc_draw_glyphs' (writes glyphs to the glass) followed by `mc_draw_row' (writes fake cursors to the glass immediately thereafter). 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. - The rest of our journey takes place wherever `draw_glyphs' would ordinarily be called, excluding `update_text_area'. If features 17684/22873 are active, `mc_redraw_row' calls `mc_draw_glyphs' (writes glyphs to the glass) and fake cursors are written to the glass immediately thereafter (if the coordinates coincide with prerecorded data in the `w->mc_matrix`). The functions containing the aforementioned calls are: . `gui_insert_glyphs' . `gui_fix_overlapping_area' . `draw_row_with_mouse_face' . `expose_area' . `expose_line' . `redraw_overlapped_rows' [which has been incorporated into `update_window'] - 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. - NS: As of 09/28/2018 (7946445962372c4255180af45cb7c857f1b0b5fa), the NS port no longer does anything useful during `update_window' except mark dirty rectangles. All drawing is now done when the MacOS calls `drawRect', which in turn calls `expose_frame'. 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.] --Multipart_Thu_Aug_22_22:19:53_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_08_22__20_16_49_786.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi43ODI3NTJmCi0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI4OCBAQAorOzs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Cis7OzsgQkVHSU4gbW9kaWZpY2F0aW9uIG9mIHRoZSBNdWx0aXBsZSBDdXJzb3Jz IGxpYnJhcnkgd3JpdHRlbiBieSAgTWFnbmFyIFN2ZWVuLgorCisoZGVmdmFyIHBhY2thZ2UtYXJj aGl2ZXMpCisKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsKQorKGRlZnZhciBtYy9t YXgtY3Vyc29ycykKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsKQorKGRlZnZhciBt Yy9tYXgtY3Vyc29ycykKKyhkZWZ2YXIgbWMvYWx3YXlzLXJ1bi1mb3ItYWxsKQorKGRlZnZhciBt Yy0tdGhpcy1jb21tYW5kKQorKGRlZnZhci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hdCAiJWQgYWN0aXZlIGN1 cnNvcnMuIENvbnRpbnVlPyAiIChtYy9udW0tY3Vyc29ycykpKQorICAgICAgICAgICAgKHNldHEg bWMvbWF4LWN1cnNvcnMgKHJlYWQtbnVtYmVyICJFbnRlciBhIG5ldywgdGVtcG9yYXJ5IG1heGlt dW06ICIpKQorICAgICAgICAgIChtYy9yZW1vdmUtZmFrZS1jdXJzb3JzKQorICAgICAgICAgIChl cnJvciAiQWJvcnRlZDogdG9vIG1hbnkgY3Vyc29ycyIpKSkpCisgICAgKGxldCAoKG92ZXJsYXkK KyAgICAgICAgICAgIChpZiBtYy91c2UtYnVpbHQtaW4tY3Vyc29ycworICAgICAgICAgICAgICAo bWFrZS1vdmVybGF5IChwb2ludCkgKHBvaW50KSkKKyAgICAgICAgICAgICAgKG1jL21ha2UtY3Vy c29yLW92ZXJsYXktYXQtcG9pbnQpKSkpCisgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAnbWMt aWQgKG9yIGlkIChtYy9jcmVhdGUtY3Vyc29yLWlkKSkpCisgICAgICAob3ZlcmxheS1wdXQgb3Zl cmxheSAndHlwZSAnZmFrZS1jdXJzb3IpCisgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAncHJp b3JpdHkgMTAwKQorICAgICAgKG1jL3N0b3JlLWN1cnJlbnQtc3RhdGUtaW4tb3ZlcmxheSBvdmVy bGF5KQorICAgICAgKHdoZW4gKHVzZS1yZWdpb24tcCkKKyAgICAgICAgKG92ZXJsYXktcHV0IG92 ZXJsYXkgJ3JlZ2lvbi1vdmVybGF5CisgICAgICAgICAgICAgICAgICAgICAobWMvbWFrZS1yZWdp b24tb3ZlcmxheS1iZXR3ZWVuLXBvaW50LWFuZC1tYXJrKSkpCisgICAgICBvdmVybGF5KSkKKwor ICAoZGVmdW4gbWMvZXhlY3V0ZS1jb21tYW5kLWZvci1hbGwtZmFrZS1jdXJzb3JzIChjbWQpCisg ICAgIkNhbGxzIENNRCBpbnRlcmFjdGl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y b3VnaAorICAgICAgICAgICAgICAgIChpZiAoZ2V0IG9yaWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1 cHBvcnRlZCkKKyAgICAgICAgICAgICAgICAgICAgKG1lc3NhZ2UgIiVTIGlzIG5vdCBzdXBwb3J0 ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4g KGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3Qg KG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1j L2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMv YWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2Nt ZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMv cHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29y cyBvcmlnaW5hbC1jb21tYW5kKSkpKQorICAgICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQt aW4tY3Vyc29ycworICAgICAgICAgICAgICAgIChzZXRxIG1jLWNvbmYKKyAgICAgICAgICAgICAg ICAgICAgICAgIChtYXBjYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoeCkg KGxpc3QgKG92ZXJsYXktc3RhcnQgeCkgImJhciIgbmlsKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgKG1jL2FsbC1mYWtlLWN1cnNvcnMpKSkpKSkpKSkpCisKKyAgKGRlZnVuIG1jL21hcmst bmV4dC1saWtlLXRoaXMtY3ljbGUtZm9yd2FyZCAoKQorICAiTWFya3MgbmV4dCBvY2N1cmVuY2Ug b2Ygd29yZCBsaWtlIHRoaXMgYW5kIGFkdmFuY2VzIGN1cnNvciB0byB0aGlzIG9jY3VycmVuY2Ui CisgIChpbnRlcmFjdGl2ZSkKKyAgICAobWMvbWFyay1uZXh0LWxpa2UtdGhpcyAxKSkKKworICAo ZGVmdW4gbWMvbWFyay1wcmV2aW91cy1saWtlLXRoaXMtY3ljbGUtZm9yd2FyZCAoKQorICAiTWFy a3MgbmV4dCBvY2N1cnJlbmNlIG9mIHdvcmQgbGlrZSB0aGlzIGFuZCBhZHZhbmNlcyBjdXJzb3Ig dG8gdGhpcyBvY2N1cnJlbmNlIgorICAoaW50ZXJhY3RpdmUpCisgICAgKG1jL21hcmstcHJldmlv dXMtbGlrZS10aGlzIDEpKQorCisgIChhZGQtdG8tbGlzdCAnbWMtLWRlZmF1bHQtY21kcy10by1y dW4tb25jZSAnbWMvbWFyay1uZXh0LWxpa2UtdGhpcy1jeWNsZS1mb3J3YXJkKQorCisgIChhZGQt dG8tbGlzdCAnbWMtLWRlZmF1bHQtY21kcy10by1ydW4tb25jZSAnbWMvbWFyay1wcmV2aW91cy1s aWtlLXRoaXMtY3ljbGUtZm9yd2FyZCkKKworICAobWVzc2FnZSAibW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VjdG9yIGJ5IDI1NS4gIGB4dGVybS5jJyB1c2VzCitgeF9t YWtlX3RydWVjb2xvcl9waXhlbCcsIHdoaWNoIHVzZXMgMTYtYml0IFJHQiAtLSB0aGUgY29udmVy c2lvbiBmcm9tIExTTAoraGFwcGVucyBpbnRlcm5hbGx5IGJ5IG11bHRpcGx5aW5nIGVhY2ggZWxl bWVudCBvZiB0aGUgTFNMIGNvbG9yIHZlY3RvciBieSA2NTUzNS4iCisoaW50ZXJhY3RpdmUpCisg IChsZXQgKChidWZmZXIgKGdldC1idWZmZXItY3JlYXRlICIqTUMtVEVTVCoiKSkpCisgICAgKHdp dGgtY3VycmVudC1idWZmZXIgYnVmZmVyCisgICAgICAoZXJhc2UtYnVmZmVyKQorICAgICAgKGlu c2VydCAiVGhpcyBpcyBhIHRlc3QhIikKKyAgICAgIChzZXRxIG1jLWNvbmYgJygoMSAiaGJhciIg Im1hZ2VudGEiKQorICAgICAgICAgICAgICAgICAgICAgICgyICJiYXIiICJwdXJwbGUiKQorICAg ICAgICAgICAgICAgICAgICAgICgzICJib3giICIjMDBGRjAwIikKKyAgICAgICAgICAgICAgICAg ICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAgICAgKDUgKCJo YmFyIiAzKSBbMS4wIDAuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAz KSBbMC4wIDEuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFu Z2VSZWQiKQorICAgICAgICAgICAgICAgICAgICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAg ICAgICAgICAgICAgICAgICg5ICJib3giICJncmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93 IChkaXNwbGF5LWJ1ZmZlciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2lu Y2UgdGhpcyBmaXJlcyBnbG9iYWxseSwgd2UgbXVzdC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KQorICAgICAgICAgICAgICAgICAgICAgKG51bGwgKy1wYXJlbnMtb3ZlcmxheXMt 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 LWNoZWNr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mcpCisgICAgICAgIChzZXRxIGJpZGktZGlzcGxheS1y ZW9yZGVyaW5nIG5pbCkpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICcrLS1zYXZl ZC1zdGF0ZSkgbmlsKQorICAgICAgKGRvbGlzdCAodmFyICcoYnVmZmVyLWRpc3BsYXktdGFibGUK KyAgICAgICAgICAgICAgICAgICAgIGZyaW5nZS1pbmRpY2F0b3ItYWxpc3QKKyAgICAgICAgICAg ICAgICAgICAgIHRhYi13aWR0aAorICAgICAgICAgICAgICAgICAgICAgbGluZS1tb3ZlLXZpc3Vh bAorICAgICAgICAgICAgICAgICAgICAgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgICAgICAgICAg ICAgIHRydW5jYXRlLXBhcnRpYWwtd2lkdGgtd2luZG93cworICAgICAgICAgICAgICAgICAgICAg d29yZC13cmFwKSkKKyAgICAgICAgKHdoZW4gKGxvY2FsLXZhcmlhYmxlLXAgdmFyKQorICAgICAg 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 ICAod2hlbiAobWVtcSAnKy1kcmF3L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AgICAgICAgICAgICAg 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 YXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIChkZWxldGUtb3ZlcmxheSBvKSkpKSkp KQorCisoZGVmdW4gKy1kZWxldGUtcGFyZW5zLW92ZXJsYXlzICgpCisgICh3aGVuICstcGFyZW5z LW92ZXJsYXlzLWV4aXN0LXAKKyAgICAoZG9saXN0IChmYWNlICcoKy1wYXJlbnMtb25lLWZhY2UK KyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtdHdvLWZhY2UKKyAgICAgICAgICAgICAgICAg ICAgKy1wYXJlbnMtdGhyZWUtZmFjZQorICAgICAgICAgICAgICAgICAgICArLXBhcmVucy1mb3Vy LWZhY2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtZml2ZS1mYWNlCisgICAgICAgICAg ICAgICAgICAgICstcGFyZW5zLXNpeC1mYWNlCisgICAgICAgICAgICAgICAgICAgICstcGFyZW5z LXNldmVuLWZhY2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtZWlnaHQtZmFjZQorICAg ICAgICAgICAgICAgICAgICArLXBhcmVucy1uaW5lLWZhY2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FuZCBmYy1tb2RlICstbW9kZSkKKyAgICAg IChzZXRxIGZjLW1vZGUgbmlsKQorICAgICAgKG1lc3NhZ2UgIlR1cm5lZCBPRkYgYGZjLW1vZGUn ICglcykgLS0gc2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuIiAoY3VycmVudC1idWZm ZXIpKSkKKyAgICAoZmMtbW9kZQorICAgICAgKHdoZW4gKGFuZCBnbG9iYWwtZWxkb2MtbW9kZQor ICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAoZ2xvYmFs LWVsZG9jLW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBqaXQtbG9jay1jb250ZXh0LXRpbWVy CisgICAgICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAg ICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVu ICh0aW1lcnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVy IGppdC1sb2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250 ZXh0LXRpbWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250 ZXh0LWZvbnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkp CisgICAgICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAg ICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVu ICh0aW1lcnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNh bmNlbC10aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChm c2V0ICd1bmRvLWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAgICAgICAgICAgICAobGFtYmRhICgp IChhZGQtdG8tbGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1jaGFuZ2VkLWJ1ZmZlcnMgKGN1cnJl bnQtYnVmZmVyKSkpKQorICAgICAgICAoZnNldCAndW5kby1hdXRvLWFtYWxnYW1hdGUgJ2lnbm9y ZSkpCisgICAgICAod2hlbiBibGluay1jdXJzb3ItbW9kZQorICAgICAgICAoYmxpbmstY3Vyc29y LW1vZGUgLTEpCisgICAgICAgICh3aGVuIChtZW1xICdibGluay1jdXJzb3ItY2hlY2sgcG9zdC1j b21tYW5kLWhvb2spCisgICAgICAgICAgKHJlbW92ZS1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAn YmxpbmstY3Vyc29yLWNoZWNrKSkpCisgICAgICAoc2V0cSBmYy12aXNpYmxlIHQpCisgICAgICA7 OzsgYGF1dG8tY29tcG9zaXRpb24tbW9kZScgaXMgbmVlZGVkIGZvciBjcm9zc2hhaXJzIHRvIHBy b3Blcmx5IGNhbGN1bGF0ZQorICAgICAgOzs7IGNvb3JkaW5hdGVzIG9mIGNvbXBvc2l0aW9uIGNo YXJhY3RlcnMuICBBdXRvbWF0aWNhbGx5IGJlY29tZXMgcGVybWFuZW50bHkKKyAgICAgIDs7OyBi dWZmZXItbG9jYWwgd2hlbiBzZXQuCisgICAgICAodW5sZXNzIGF1dG8tY29tcG9zaXRpb24tbW9k ZQorICAgICAgICAoc2V0cSBhdXRvLWNvbXBvc2l0aW9uLW1vZGUgdCkpCisgICAgICA7OzsgQGxh d2xpc3QgaXMgZm9jdXNpbmcgdGhlIGluaXRpYWwgZGV2ZWxvcG1lbnQgb2YgZmVhdHVyZSByZXF1 ZXN0cyAjMTc2OD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vcnMgMTYpIChiYWNrZ3JvdW5k IGRhcmspKQorICAgICA6Zm9yZWdyb3VuZCAiI2VlZThhYSIpCisgICAgKCgoY2xhc3MgY29sb3Ip IChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJi bHVlMSIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdy b3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZl cnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGAr LWV2ZW4taW5hY3RpdmUtcHJlLXp2LWZhY2UnLiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZm YWNlICstZXZlbi1hdC16di1mYWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4 KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgIkRlZXBQaW5rMSIpCisgICAg KCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAg IDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9y cyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQor ICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQor ICAgICA6Zm9yZWdyb3VuZCAiRGVlcFBpbmsxIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1j b2xvcnMgOCkpCisgICAgIDpmb3JlZ3JvdW5kICJ3aGl0ZSIpCisgICAgKCgodHlwZSB0dHkpIChj bGFzcyBtb25vKSkKKyAgICA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ZXJzZS12aWRlbyB0KQorICAgICh0IDpmb3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNl IGZvciBgKy1vZGQtaW5hY3RpdmUtYXQtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKwor KGRlZmZhY2UgKy1vZGQtcG9zdC16di1mYWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29s b3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTEiKQor ICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgbGlnaHQpKQor ICAgICA6Zm9yZWdyb3VuZCAiRGFya1NhbG1vbiIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4t Y29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTEi KQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQp KQorICAgICA6Zm9yZWdyb3VuZCAiRGFya1NhbG1vbiIpCisgICAgKCgoY2xhc3MgY29sb3IpICht aW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5 KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91 bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGArLW9kZC1wb3N0LXp2LWZhY2UnLiIKKyAgOmdyb3Vw ICcrLW1vZGUpCisKKyhkZWZmYWNlICstb2RkLWluYWN0aXZlLXBvc3QtenYtZmFjZQorICAnKCgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpm b3JlZ3JvdW5kICJzaWVubmE0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1p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yB0KQor ICAgICh0IDpmb3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBgKy1wb3N0LWZpbGwtcG9z dC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSArLXBvc3QtZmlsbC1p bmFjdGl2ZS1wb3N0LXp2LWZhY2UKKyAgJygoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgODgp IChiYWNrZ3JvdW5kIGRhcmspKQorICAgICA6Zm9yZWdyb3VuZCAiUGFsZUdyZWVuNCIpCisgICAg KCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAg IDpmb3JlZ3JvdW5kICJEYXJrT2xpdmVHcmVlbiIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4t Y29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgIlBhbGVHcmVl bjQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGln aHQpKQorICAgICA6Zm9yZWdyb3VuZCAiRGFya09saXZlR3JlZW4iKQorICAgICgoKGNsYXNzIGNv bG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikKKyAgICAoKCh0 eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQorICAgICh0IDpm b3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBgKy1wb3N0LWZpbGwtaW5hY3RpdmUtcG9z dC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSBmYy1wcmUtenYtZmFj ZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykp CisgICAgIDpmb3JlZ3JvdW5kICJncmV5MTUiKQorICAg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aW5saW5lIGZ1bmN0aW9ucyBkZWZp bmVkIGluIGJ1ZmZlci5oLiAgKi8KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJl Z2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworc3RhdGljIHZvaWQKK2JzZXRfbWNfcmVhbF9mYWtl X2N1cnNvciAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBiLT5tY19y ZWFsX2Zha2VfY3Vyc29yXyA9IHZhbDsKK30KKworc3RhdGljIHZvaWQKK2JzZXRfbWNfY29uZiAo c3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBiLT5tY19jb25mXyA9IHZh bDsKK30KKworc3RhdGljIHZvaWQKK2JzZXRfbWNfaW5hY3RpdmVfd2luZG93cyAoc3RydWN0IGJ1 ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBiLT5tY19pbmFjdGl2ZV93aW5kb3dzXyA9 IHZhbDsKK30KKworc3RhdGljIHZvaWQKK2JzZXRfY3Jvc3NoYWlycyAoc3RydWN0IGJ1ZmZlciAq YiwgTGlzcF9PYmplY3QgdmFsKQoreworICBiLT5jcm9zc2hhaXJzXyA9IHZhbDsKK30KKworc3Rh dGljIHZvaWQKK2JzZXRfY2hfaG9yaXpvbnRhbF9ydWxlciAoc3RydWN0IGJ1ZmZlciAqYiwgTGlz cF9PYmplY3QgdmFsKQoreworICBiLT5jaF9ob3Jpem9udGFsX3J1bGVyXyA9IHZhbDsKK30KKwor c3RhdGljIHZvaWQKK2JzZXRfY2hfdmVydGljYWxfcnVsZXIgKHN0cnVjdCBidWZmZXIgKmIsIExp c3BfT2JqZWN0IHZhbCkKK3sKKyAgYi0+Y2hfdmVydGljYWxfcnVsZXJfID0gdmFsOworfQorCitz dGF0aWMgdm9pZAorYnNldF9jaF9pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBM aXNwX09iamVjdCB2YWwpCit7CisgIGItPmNoX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQor CitzdGF0aWMgdm9pZAorYnNldF9mY192aXNpYmxlIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09i amVjdCB2YWwpCit7CisgIGItPmZjX3Zpc2libGVfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAor YnNldF9mY19pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2 YWwpCit7CisgIGItPmZjX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCisvKiBlbmQgTVVM VElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogc3RhdGljIHZv aWQKIGJzZXRfYWJicmV2X21vZGUgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkK IHsKQEAgLTUxNDUsNiArNTIwOCwyNCBAQCBpbml0X2J1ZmZlcl9vbmNlICh2b2lkKQogICBic2V0 X2xhc3Rfc2VsZWN0ZWRfd2luZG93ICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBtYWtlX2ZpeG51bSAo MCkpOwogCiAgIGlkeCA9IDE7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxh Z3MsIG1jX3JlYWxfZmFrZV9jdXJzb3IpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJW QVIgKCZidWZmZXJfbG9jYWxfZmxh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SICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBvdmVy d3JpdGVfbW9kZSksIGlkeCk7ICsraWR4OwpAQCAtNTIzMSw2ICs1MzEyLDI0IEBAIGluaXRfYnVm ZmVyX29uY2UgKHZvaWQpCiAgIC8qIE11c3QgZG8gdGhlc2UgYmVmb3JlIG1ha2luZyB0aGUgZmly c3QgYnVmZmVyISAqLwogCiAgIC8qIHJlYWwgc2V0dXAgaXMgZG9uZSBpbiBiaW5kaW5ncy5lbCAq LworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CisgIGJzZXRfbWNfcmVhbF9mYWtlX2N1cnNvciAoJmJ1ZmZlcl9kZWZhdWx0cywgUWhvbGxvdyk7 CisgIGJzZXRfbWNfY29uZiAoJmJ1ZmZlcl9kZWZhdWx0cywgUW5pbCk7CisgIGJzZXRfbWNfaW5h Y3RpdmVfd2luZG93cyAoJmJ1ZmZlcl9kZWZhdWx0cywgUXQpOworICBic2V0X2Nyb3NzaGFpcnMg KCZidWZmZXJfZGVmYXVsdHMsIFFuaWwpOworICBic2V0X2NoX2hvcml6b250YWxfcnVsZXIgKCZi dWZmZXJfZGVmYXVsdHMsIFF0KTsKKyAgYnNldF9jaF92ZXJ0aWNhbF9ydWxlciAoJmJ1ZmZlcl9k ZWZhdWx0cywgUXQpOworICBic2V0X2NoX2luYWN0aXZlX3dpbmRvd3MgKCZidWZmZXJfZGVmYXVs dHMsIFF0KTsKKyAgYnNldF9mY192aXNpYmxlICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKKyAg YnNldF9mY19pbmFjdGl2ZV93aW5kb3dzICgmYnVmZmVyX2RlZmF1bHRzLCBRdCk7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqK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1cnNvcnMgZmlsbCBjb2x1bW4gaW4gaW5hY3RpdmUgd2lu ZG93cy4gKi8pOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIHN0YXRpY3BybyAo Jmxhc3Rfb3ZlcmxheV9tb2RpZmljYXRpb25faG9va3MpOwogICBsYXN0X292ZXJsYXlfbW9kaWZp Y2F0aW9uX2hvb2tzID0gbWFrZV9uaWxfdmVjdG9yICgxMCk7CiAKZGlmZiAtLWdpdCBhL3NyYy9i dWZmZXIuaCBiL3NyYy9idWZmZXIuaAppbmRleCAyMDgwYTZmLi4xYWRhOTNlIDEwMDY0NAotLS0g YS9zcmMvYnVmZmVyLmgKKysrIGIvc3JjL2J1ZmZlci5oCkBAIC03NDAsNiArNzQwLDQwIEBAIHN0 cnVjdCBidWZmZXIKICAgICAgaW4gdGhlIGRpc3BsYXkgb2YgdGhpcyBidWZmZXIuICAqLwogICBM 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 RSB2b2lkCitic2V0X2Jsdl9tY19yZWFsX2Zha2VfY3Vyc29yIChzdHJ1Y3QgYnVmZmVyICpiLCBM aXNwX09iamVjdCB2YWwpCit7CisgIGItPm1jX3JlYWxfZmFrZV9jdXJzb3JfID0gdmFsOworfQor CitJTkxJTkUgdm9pZAorYnNldF9ibHZfbWNfY29uZiAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9P YmplY3QgdmFsKQoreworICBiLT5tY19jb25mXyA9IHZhbDsKK30KKworSU5MSU5FIHZvaWQKK2Jz ZXRfYmx2X21jX2luYWN0aXZlX3dpbmRvd3MgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0 IHZhbCkKK3sKKyAgYi0+bWNfaW5hY3RpdmVfd2luZG93c18gPSB2YWw7Cit9CisKK0lOTElORSB2 b2lkCitic2V0X2Jsdl9jcm9zc2hhaXJzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2 YWwpCit7CisgIGItPmNyb3NzaGFpcnNfID0gdmFsOworfQorCitJTkxJTkUgdm9pZAorYnNldF9i bHZfY2hfaG9yaXpvbnRhbF9ydWxlciAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFs KQoreworICBiLT5jaF9ob3Jpem9udGFsX3J1bGVyXyA9IHZhbDsKK30KKworSU5MSU5FIHZvaWQK K2JzZXRfYmx2X2NoX3ZlcnRpY2FsX3J1bGVyIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVj dCB2YWwpCit7CisgIGItPmNoX3ZlcnRpY2FsX3J1bGVyXyA9IHZhbDsKK30KKworSU5MSU5FIHZv aWQKK2JzZXRfYmx2X2NoX2luYWN0aXZlX3dpbmRvd3MgKHN0cnVjdCBidWZmZXIgKmIsIExpc3Bf T2JqZWN0IHZhbCkKK3sKKyAgYi0+Y2hfaW5hY3RpdmVfd2luZG93c18gPSB2YWw7Cit9CisKK0lO TElORSB2b2lkCitic2V0X2Jsdl9mY192aXNpYmxlIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09i 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 ICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICosIGludCwgaW50KTsKKworZXh0ZXJuIHZv aWQgbWNfeHdfY29sb3JfdmFsdWVzIChzdHJ1Y3Qgd2luZG93ICosIExpc3BfT2JqZWN0LCBzdHJ1 Y3QgbWNfUkdCICopOworCitleHRlcm4gYm9vbCBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHN0 cnVjdCB3aW5kb3cgKiwgYm9vbCk7CisKK2V4dGVybiBjaGFyICogbWNfd2luZG93IChzdHJ1Y3Qg d2luZG93ICopOworCitleHRlcm4gY2hhciAqIG1jX2NoYXJfdG9fc3RyaW5nIChpbnQpOworCitl eHRlcm4gY2hhciAqIG1jX2N1cnNvcl90eXBlX3RvX3N0cmluZyAoZW51bSBtY19jdXJzb3JfdHlw ZSk7CisKK2V4dGVybiBjaGFyICogbWNfZmxhdm9yX3RvX3N0cmluZyAoZW51bSBtY19mbGF2b3Ip OworCitleHRlcm4gY2hhciAqIG1jX2NhY2hlX3R5cGVfdG9fc3RyaW5nIChlbnVtIG1jX2NhY2hl X3R5cGUpOworCitleHRlcm4gY2hhciAqIG1jX3JlZHJhd19yb3dfdHlwZV90b19zdHJpbmcgKGVu dW0gbWNfcmVkcmF3X3Jvd190eXBlKTsKKworZXh0ZXJuIHZvaWQgbWNfY2FjaGVfaW5zcGVjdG9y IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBtY19tYXRyaXgpOworCitleHRlcm4gYm9vbCBtY190 cmF2ZXJzZV9jYWNoZV9wIChzdHJ1Y3QgbWNfbWF0cml4LCBlbnVtIG1jX2NhY2hlX3R5cGUsIGlu dCwgaW50KTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19mcmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2lu ZG93ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwgaW50LAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlKTsKKworZXh0ZXJuIGludCBtY19nZXRfZnJp bmdlX2JpdG1hcCAoc3RydWN0IHdpbmRvdyAqLCBMaXNwX09iamVjdCwgaW50LCBpbnQpOworCitl 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 c3BfT2JqZWN0LCBMaXNwX09iamVjdCk7CiAKIHN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ZykgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJp eCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51 bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLAorICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1 cnNvcl90eXBlLCBpbnQgd2QsIGJvb2wgYWN0aXZlX3AsIGJvb2wgY3Vyc29yX2djX3ApOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIEhhbmRsZXJzIGZvciBzZXR0aW5nIGZy YW1lIHBhcmFtZXRlcnMuICAqLwogICBmcmFtZV9wYXJtX2hhbmRsZXIgKmZyYW1lX3Bhcm1faGFu ZGxlcnM7CiAKZGlmZiAtLWdpdCBhL3NyYy9kaXNwbmV3LmMgYi9zcmMvZGlzcG5ldy5jCmluZGV4 IDAxMzFiNjMuLmFmNTg1OWYgMTAwNjQ0Ci0tLSBhL3NyYy9kaXNwbmV3LmMKKysrIGIvc3JjL2Rp c3BuZXcuYwpAQCAtNTYsNiArNTYsMTc4MiBAQCBhbG9uZyB3aXRoIEdOVSBFbWFjcy4gIElmIG5v dCwgc2VlIDxodHRwczovL3d3dy5nbnUub3JnL2xpY2Vuc2VzLz4uICAqLwogI2luY2x1ZGUgIncz Mi5oIgogI2VuZGlmCiAMCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBN VUxUSVBMRS1DVVJTT1JTICovCisKK3N0cnVjdCBnbHlwaHNfc2tpcHBlZAoreworICBwdHJkaWZm X3QgYWxsb2NhdGVkOworICBwdHJkaWZmX3QgdXNlZDsKKyAgc3RydWN0IHN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ydWN0IGdseXBo X3JvdyAqZCA9IE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCBpKTsKKyAgICAgIHN0cnVjdCBn bHlwaF9yb3cgKmMgPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSk7CisgICAgICBpZiAo Yy0+ZW5hYmxlZF9wCisgICAgICAgICAgJiYgZC0+ZW5hYmxlZF9wCisgICAgICAgICAgJiYgIWQt PnJlZHJhd19mcmluZ2VfYml0bWFwc19wCisgICAgICAgICAgJiYgYy0+eSA9PSBkLT55CisgICAg ICAgICAgJiYgTUFUUklYX1JPV19CT1RUT01fWSAoYykgPD0geWIKKyAgICAgICAgICAmJiBNQVRS SVhfUk9XX0JPVFRPTV9ZIChkKSA8PSB5YgorICAgICAgICAgICYmIHJvd19lcXVhbF9wIChjLCBk LCAxKSkKKyAgICAgICAgeworICAgICAgICAgIGFzc2lnbl9yb3cgKGMsIGQpOworICAgICAgICAg IGQtPmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAg ICBicmVhazsKKyAgICB9CisjaWZkZWYgSEFWRV9YV0lER0VUUworICAvKiBDdXJyZW50bHkgdGhp cyBzZWVtcyBuZWVkZWQgdG8gZGV0ZWN0IHh3aWRnZXQgbW92ZW1lbnQgcmVsaWFibHkuICovCisg ICAgcmV0dXJuIDA7CisjZW5kaWYKKyAgLyogR2l2ZSB1cCBpZiBzb21lIHJvd3MgaW4gdGhlIGRl c2lyZWQgbWF0cml4IGFyZSBub3QgZW5hYmxlZC4gKi8KKyAgaWYgKCEgTUFUUklYX1JPV19FTkFC TEVEX1AgKGRlc2lyZWRfbWF0cml4LCBpKSkKKyAgICByZXR1cm4gLTE7CisgIGZpcnN0X29sZCA9 IGZpcnN0X25ldyA9IGk7CisgIC8qIFNldCBsYXN0X25ldyB0byB0aGUgaW5kZXggKyAxIG9mIHRo ZSByb3cgdGhhdCByZWFjaGVzIHRoZQorICAgICBib3R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YXRyaXgsIGkpKTsKKyAgICAgIGlmIChib3R0b20gPD0geWIpCisgICAgICAgICsraTsK KyAgICAgIGlmIChib3R0b20gPj0geWIpCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgbGFzdF9v bGQgPSBpOworICAvKiBTa2lwIG92ZXIgcm93cyBlcXVhbCBhdCB0aGUgYm90dG9tLiAqLworICBp ID0gbGFzdF9uZXc7CisgIGogPSBsYXN0X29sZDsKKyAgd2hpbGUgKGkgLSAxID4gZmlyc3RfbmV3 CisgICAgICAgICAmJiBqIC0gMSA+IGZpcnN0X29sZAorICAgICAgICAgJiYgTUFUUklYX1JPV19F TkFCTEVEX1AgKGN1cnJlbnRfbWF0cml4LCBqIC0gMSkKKyAgICAgICAgICYmIChNQVRSSVhfUk9X IChjdXJyZW50X21hdHJpeCwgaiAtIDEpLT55CisgICAgICAgICAgICAgPT0gTUFUUklYX1JPVyAo ZGVzaXJlZF9tYXRyaXgsIGkgLSAxKS0+eSkKKyAgICAgICAgICYmICFNQVRSSVhfUk9XIChkZXNp cmVkX21hdHJpeCwgaSAtIDEpLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcAorICAgICAgICAgJiYg cm93X2VxdWFsX3AgKE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCBpIC0gMSksCisgICAgICAg ICAgICAgICAgICAgICAgICAgTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIGogLSAxKSwgMSkp CisgICAgLS1pLCAtLWo7CisgIGxhc3RfbmV3ID0gaTsKKyAgbGFzdF9vbGQgPSBqOworICAvKiBO b3RoaW5nIHRvIGRvIGlmIGFsbCByb3dzIGFyZSBlcXVhbC4gKi8KKyAgaWYgKGxhc3RfbmV3ID09 IGZpcnN0X25ldykKKyAgICByZXR1cm4gMDsKKyAgLyogQ2hlY2sgZm9yIGludGVnZXIgb3ZlcmZs b3cgaW4gc2l6ZSBjYWxjdWxhdGlvbi4KKyAgICAgSWYgbmV4dF9hbG1vc3RfcH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VfTUFYKTsKKyAgfQorICAvKiBSZWFsbG9jYXRlIHZlY3RvcnMsIHRhYmxl cyBldGMuIGlmIG5lY2Vzc2FyeS4gKi8KKyAgaWYgKGN1cnJlbnRfbWF0cml4LT5ucm93cyA+IG1j X29sZF9saW5lc19zaXplKQorICAgIG1jX29sZF9saW5lcyA9IHhwYWxsb2MgKG1jX29sZF9saW5l cywgJm1jX29sZF9saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRf bWF0cml4LT5ucm93cyAtIG1jX29sZF9saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAg ICAgIElOVF9NQVgsIHNpemVvZiAqbWNfb2xkX2xpbmVzKTsKKyAgaWYgKGRlc2lyZWRfbWF0cml4 LT5ucm93cyA+IG1jX25ld19saW5lc19zaXplKQorICAgIG1jX25ld19saW5lcyA9IHhwYWxsb2Mg KG1jX25ld19saW5lcywgJm1jX25ld19saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAg ICAgIGRlc2lyZWRfbWF0cml4LT5ucm93cyAtIG1jX25ld19saW5lc19zaXplLAorICAgICAgICAg ICAgICAgICAgICAgICAgIElOVF9NQVgsIHNpemVvZiAqbWNfbmV3X2xpbmVzKTsKKyAgbiA9IGRl c2lyZWRfbWF0cml4LT5ucm93czsKKyAgbiArPSBjdXJyZW50X21hdHJpeC0+bnJvd3M7CisgIGlm IChtY19yb3dfdGFibGVfc2l6ZSA8IDMgKiBuKQorICAgIHsKKyAgICAgIHB0cmRpZmZfdCBzaXpl ID0gbmV4dF9hbG1vc3RfcHJpbWUgKDMgKiBuKTsKKyAgICAgIG1jX3Jvd190YWJsZSA9IHhucmVh bGxvYyAobWNfcm93X3RhYmxlLCBzaXplLCBzaXplb2YgKm1jX3Jvd190YWJsZSk7CisgICAgICBt Y19yb3dfdGFibGVfc2l6ZSA9IHNpemU7CisgICAgICBtZW1zZXQgKG1jX3Jvd190YWJsZSwgMCwg c2l6ZSAqIHNpemVvZi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ICAgICAgZW50cnkg 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 Z2x5cGhfcm93ICpmcm9tLCAqdG87CisgICAgICAgICAgICBib29sIHRvX292ZXJsYXBwZWRfcDsK KyAgICAgICAgICAgIHRvID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIHItPmRlc2lyZWRf dnBvcyArIGopOworICAgICAgICAgICAgZnJvbSA9IE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4 LCByLT5kZXNpcmVkX3Zwb3MgKyBqKTsKKyAgICAgICAgICAgIHRvX292ZXJsYXBwZWRfcCA9IHRv LT5vdmVybGFwcGVkX3A7CisgICAgICAgICAgICBmcm9tLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNf cCA9IGZyb20tPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcDsKKyAgICAgICAgICAgIGFzc2lnbl9y b3cgKHRvLCBmcm9tKTsKKyAgICAgICAgICAgIC8qIFRoZSBhYm92ZSBgYXNzaWduX3JvdycgYWN0 dWFsbHkgZG9lcyBzd2FwLCBzbyBpZiB3ZSBoYWQKKyAgICAgICAgICAgICAgIGFu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gICAg 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 IHRoZSB0ZXh0IGFyZWEgb2Ygcm93IFZQT1MgaW4gd2luZG93IFcuCisgICBWYWx1ZSBpcyB0cnVl IGlmIGRpc3BsYXkgaGFzIGNoYW5nZWQuICovCitzdGF0aWMgYm9vbAorbWNfdXBkYXRlX3RleHRf YXJlYSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqdXBkYXRlZF9yb3csIGlu dCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX21hdHJpeCAqY3Vyc29y X21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19lc3NlbnRpYWxzIGVzc2Vu dGlhbHMsIGJvb2wgZHJhd19wKQoreworICBib29sIGRlYnVnX3AgPSBmYWxzZTsKKyAgc3RydWN0 IGdseXBoX3JvdyAqY3VycmVudF9yb3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwg dnBvcyk7CisgIHN0cnVjdCBnbHlwaF9yb3cgKmRlc2lyZWRfcm93ID0gTUFUUklYX1JPVyAody0+ ZGVzaXJlZF9tYXRyaXgsIHZwb3MpOworICBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSAqcmlm ID0gRlJBTUVfUklGIChYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpKTsKKyAgYm9vbCBjaGFuZ2Vk X3AgPSAwOworICBzdHJ1Y3QgbWNfUkdCIGxzbCA9IHsucmVkID0gLTEuMCwgLmdyZWVuID0gLTEu MCwgLmJsdWUgPSAtMS4wfTsKKyAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gTk9fRkxB Vk9SOworICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID0gTk9fQ1VSU09SOworICBp bnQgd2QgPSAtMTsKKyAgYm9vbCBjdXJzb3JfZ2NfcCA9IGZhbHNlOworICBzdHJ1Y3QgZ2x5cGhf bWF0cml4ICpkZXNpcmVkX21hdHJpeCA9IHctPmRlc2lyZWRfbWF0cml4OworICBpZiAoZGVidWdf cCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJtY191cGRhdGVfdGV4dF9hcmVhICglcyk6ICB2cG9z ICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgbWNfd2luZG93ICh3KSwgdnBvcyk7Cisg IC8qIEluYXNtdWNoIGFzIHdlIHByb2Nlc3MgdGhlIGN1cnNvciByb3cgYmVmb3JlIGFsbCBvdGhl ciByb3dzLCB3ZSBjYW4gcmVseQorICB1cG9uIHRoZSBwcmV2aW91cyBgZGVzaXJlZF9yb3dgIHRv IGJlIGFjY3VyYXRlLiAqLworICBlbnVtIG1jX3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24gPSAg bWNfcm93X3Bvc2l0aW9uICh3LCB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZGVzaXJlZF9y b3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA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ICAgICBpbnQgaHBvcyA9IGRlc2lyZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVB XSAtIHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICB3LT5vdXRwdXRf Y3Vyc29yLnggPQorICAgICAgICAgICAgbWNfZHJhd19nbHlwaHMgKHcsIGRlc2lyZWRfbWF0cml4 LCB1cGRhdGVkX3Jvdywgdy0+b3V0cHV0X2N1cnNvci54LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgIFRFWFRfQVJFQSwgaHBvcywgaHBvcyArIGxlbiwgRFJBV19OT1JNQUxfVEVYVCwgMCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCBsc2wsIGdseXBoX2ZsYXZvciwgY3Vy c29yX3R5cGUsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0 aXZlX3AsIGN1cnNvcl9nY19wLCBNQ19EUkFXX0dMWVBIX1NUUklORywKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICBkcmF3X3ApOworICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IuaHBvcyAr PSBsZW47CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgfQorICAgICAgLyog Q2xlYXIgdG8gZW5kIG9mIHdpbmRvdy4gKi8KKyAgICAgIGlmIChkcmF3X3ApCisgICAgICAgIHJp Zi0+Y2xlYXJfZW5kX29mX2xpbmUgKHcsIHVwZGF0ZWRfcm93LCBURVhUX0FSRUEsIC0xKTsKKyAg ICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAvKiBUaGlzIGVyYXNlcyB0aGUgY3Vyc29yLiAgV2Ug ZG8gdGhpcyBoZXJlIGJlY2F1c2UKKyAgICAgICAgIG5vdGljZW92ZXJ3cml0dGVuX3RleHRfY3Vy c29yIGNhbm5vdCBlYXNpbHkgY2hlY2sgdGhpcywgd2hpY2gKKyAgICAgICAgIG1pZ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GkgPSAw 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 Z2x5cGhzICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHctPm91dHB1dF9j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W5nIGdseXBocyBmb3IgdGhlIGhvcml6b250YWwvdmVydGljYWwgcnVsZXJzIGhlcmUuICov 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 IHN0cnVjdCBtY19SR0IgZGVidWdfZmcgPSB7LnJlZ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ICA/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 ICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVIsIGRyYXdfcCwgTk9XSEVSRSwg Tk9fQ0FDSEUpOworICAgICAgICAgIH0KKworICAgICAgfQorICByZXR1cm4gY2hhbmdlZF9wOwor fQorCisvKiBVcGRhdGUgcm93IFZQT1MgaW4gd2luZG93IFcuICBWYWx1ZSBpcyB0cnVlIGlmIGRp c3BsYXkgaGFzIGJlZW4gY2hhbmdlZC4gKi8KK3N0YXRpYyBib29sCittY191cGRhdGVfd2luZG93 X2xpbmUgKHN0cnVjdCB3aW5kb3cgKncsIGludCB2cG9zLCBib29sICptb3VzZV9mYWNlX292ZXJ3 cml0dGVuX3AsCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKmN1 cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19lc3NlbnRpYWxz IGVzc2VudGlhbHMsIGJvb2wgZHJhd19wKQoreworICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJyZW50 X3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml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lc2lyZWRfcm93LCBMRUZU X01BUkdJTl9BUkVBLCB2cG9zKTsKKyAgICAgICAgICAvKiBTZXR0aW5nIHRoaXMgZmxhZyB3aWxs IGVuc3VyZSB0aGUgdmVydGljYWwgYm9yZGVyLCBpZgorICAgICAgICAgICAgIGFueSwgYmV0d2Vl biB0aGlzIHdpbmRvdyBhbmQgdGhlIG9uZSBvbiBpdHMgbGVmdCB3aWxsIGJlCisgICAgICAgICAg ICAgcmVkcmF3bi4gIFRoaXMgaXMgbmVjZXNzYXJ5IGJlY2F1c2UgdXBkYXRpbmcgdGhlIGxlZnQK KyAgICAgICAgICAgICBtYXJnaW4gYXJlYSBjYW4gcG90ZW50aWFsbHkgZHJhdyBvdmVyIHRoZSBi b3JkZXIuICovCisgICAgICAgICAgY3VycmVudF9yb3ctPnJlZHJhd19mcmluZ2VfYml0bWFwc19w ID0gMTsKKyAgICAgICAgfQorICAgICAgYm9vbCB1cGRhdGVkX3AgPSBtY191cGRhdGVfdGV4dF9h cmVhICh3LCBkZXNpcmVkX3JvdywgdnBvcywgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywgZHJhd19wKTsKKyAgICAg IC8qIFVwZGF0ZSB0aGUgZGlzcGxheSBvZiB0aGUgdGV4dCBhcmVhLiAqLworICAgICAgaWYgKHVw ZGF0ZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAg aWYgKGN1cnJlbnRfcm93LT5tb3VzZV9mYWNlX3ApCisgICAgICAgICAgICAqbW91c2VfZmFjZV9v dmVyd3JpdHRlbl9wID0gMTsKKyAgICAgICAgfQorICAgICAgLyogVXBkYXRlIGRpc3BsYXkgb2Yg dGhlIHJpZ2h0IG1hcmdpbiBhcmVhLCBpZiB0aGVyZSBpcyBvbmUuICovCisgICAgICBpZiAoIWRl c2lyZWRfcm93LT5mdWxsX3dpZHRoX3A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V9QIChjdXJyZW50X3JvdykpKQorICAgICAgICByaWYtPmFmdGVyX3VwZGF0ZV93aW5kb3dfbGlu 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 ICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgaW50IG9sZF9jYWNoZV91 c2VkID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV07CisgICAg ICAgICAgICAgICAgICAgICAgaW50IG5ld19jYWNoZV91c2VkID0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICAgICAgICAgICAgICBmcHJp bnRmIChzdGRlcnIsICJNSVNTICglcyk6ICB2cG9zICglZCkgfCBocG9zICglZCB2LiAlZCkgfCBj aGFyICglcyB2LiAlcykgfCBjYWNoZV91c2VkICglZCB2LiAlZClcbiIsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAoY2FjaGVfdHlwZSA9PSBNQ19DQUNIRSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAiTUMiCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjYWNoZV90eXBlID09IENIX0NBQ0hFKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICJDSCIKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0gRkNfQ0FDSEUpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gIkZDIgorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiTk8iLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bd19udGhdLnZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmhwb3MsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uaHBvcywKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnUuY2gpLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC51LmNoKSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9sZF9jYWNoZV91c2VkLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2NhY2hlX3VzZWQpOworICAgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICghc2FtZV9wKQor ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogYG1hdHJpeF9yb3cnIGluIGBkaXNw bmV3LmNgIGNvbnRhaW5zIHRoZSBmb2xsb3dpbmcgdGVzdHMsCisgICAgICAgICAgICAgICAgZWFz c2VydCAobWF0cml4ICYmIG1hdHJpeC0+cm93cyk7CisgICAgICAgICAgICAgICAgZWFzc2VydCAo cm93ID49IDAgJiYgcm93IDwgbWF0cml4LT5ucm93cyk7ICovCisgICAgICAgICAgICAgICAgYm9v bCBiYXJmX2NyYXNoX29uZSA9ICh3LT5jdXJyZW50X21hdHJpeCAmJiB3LT5jdXJyZW50X21hdHJp eC0+cm93cykgPyBmYWxzZSA6IHRydWU7CisgICAgICAgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hf b25lKQorICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgYm9vbCBi YXJmX2NyYXNoX3R3byA9ICh2bnRoID49IDAgJiYgdm50aCA8IHctPmN1cnJlbnRfbWF0cml4LT5u cm93cykgPyBmYWxzZSA6IHRydWU7CisgICAgICAgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hfdHdv KQorICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgc3RydWN0IGds eXBoX3JvdyAqdm50aF9yb3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgdm50aCk7 CisgICAgICAgICAgICAgICAgaW50IHhfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0ueDsKKyAgICAgICAgICAgICAgICBpbnQgZnhfMCA9IG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZng7CisgICAgICAgICAgICAg ICAgaW50IHlfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf MF0ueTsKKyAgICAgICAgICAgICAgICBpbnQgZnlfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZnk7CisgICAgICAgICAgICAgICAgaW50IGhwb3NfMCA9 IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uaHBvczsKKyAg ICAgICAgICAgICAgICBpbnQgdnBvc18wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS52cG9zOworICAgICAgICAgICAgICAgIGludCB3ZF8wID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS53ZDsKKyAgICAgICAgICAg ICAgICBpbnQgaF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS5oOworICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGVf MCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uY3Vyc29y X3R5cGU7CisgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aF8wID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5jdXJzb3Jfd2lkdGg7CisgICAgICAg ICAgICAgICAgLy8gIHN0cnVjdCBtY19SR0IgbHNsX2ZnXzAgPSB7LnJlZCA9IG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcucmVkLAorICAgICAgICAgICAg ICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcuZ3JlZW4sCisgICAgICAgICAgICAg ICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZnLmJsdWV9OworICAgICAgICAgICAgICAg IHN0cnVjdCBtY19SR0IgbHNsX2JnXzAgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS5iZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIC5ibHVlID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5iZy5ibHVlfTsKKyAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wXzAgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmFjdGl2ZV9wOwor ICAgICAgICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvcl8wID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaF9mbGF2b3I7CisgICAg ICAgICAgICAgICAgYm9vbCBlbmFibGVkX3BfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMF0uZW5hYmxlZF9wOworICAgICAgICAgICAgICAgIGlmICh2cG9z XzAgPT0gdm50aAorICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3JfMCA9PSBNQ19H TFlQSAorICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3BfMAorICAgICAgICAgICAgICAg ICAgICAmJiB2bnRoX3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICBtY19lcmFzZV9jdXJzb3IgKHcsIHctPmN1cnJlbnRfbWF0cml4LCB2bnRo X3JvdywgeF8wLCB5XzAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaHBv c18wLCB2cG9zXzAsIGdseXBoX2ZsYXZvcl8wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGN1cnNvcl90eXBlXzAsIHdkXzApOworICAgICAgICAgICAgICAgICAgICBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmVuYWJsZWRfcCA9IGZh bHNlOworICAgICAgICAgICAgICAgICAgICAtLW9sZF9tYXRyaXguY3Vyc29yc191c2VkW2NhY2hl X3R5cGVdOworICAgICAgICAgICAgICAgICAgICAvKiBJZiB3ZSBpbmFkdmVydGVudGx5IGVyYXNl ZCBhbm90aGVyIGZha2UgY3Vyc29yIGF0IHRoZSBzYW1lCisgICAgICAgICAgICAgICAgICAgIEhQ T1MgdGhhdCBpcyBzdGlsbCBlbmFibGVkX3AgaW4gdGhlIGBvbGRfbWF0cml4YCwgdGhlbiByZWRy YXcgaXQuICovCisgICAgICAgICAgICAgICAgICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNh Y2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBl IDwgTk9fQ0FDSEU7CisgICAgICAgICAgICAgICAgICAgICAgICAgKytjYWNoZV90eXBlKQorICAg ICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IG50 aF8xID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVf cCAob2xkX21hdHJpeCwgY2FjaGVfdHlwZSwgdm50aCwgbnRoXzEpOworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICArK250aF8xKQorICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgaW50IHhfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMV0ueDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBp bnQgZnhfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0u Zng7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHlfMSA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0ueTsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICBpbnQgZnlfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMV0uZnk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhwb3NfMSA9IG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uaHBvczsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICBpbnQgdnBvc18xID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS52cG9zOworICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGludCB3ZF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8xXS53ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaF8xID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5oOworICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGVfMSA9IG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uY3Vyc29yX3R5cGU7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aF8xID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5jdXJzb3Jfd2lkdGg7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmdfMSA9IHsucmVkID0gb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5mZy5yZWQsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4g PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZnLmdyZWVu LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg LmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZn LmJsdWV9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBzdHJ1Y3QgbWNfUkdCIGxz bF9iZ18xID0gey5yZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXzFdLmJnLnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzFdLmJnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8v ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5iZy5ibHVlfTsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICBib29sIGFjdGl2ZV9wXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzFdLmFjdGl2ZV9wOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVu dW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvcl8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8xXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgYm9vbCBlbmFibGVkX3BfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMV0uZW5hYmxlZF9wOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJv b2wgZ29fcF8xID0gKGhwb3NfMCA9PSBocG9zXzEKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3BfMSk7CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgaWYgKCFnb19wXzEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51 ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wXzEgPSBmYWxzZTsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgdy0+ Y3VycmVudF9tYXRyaXgsIHZudGhfcm93LCB4XzEsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGZ4XzEsIHlfMSwgZnlfMSwgaHBvc18xLCB2cG9zXzEs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkXzEs IGhfMSwgY3Vyc29yX3R5cGVfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoXzEsIGxzbF9mZ18xLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcF8xLCBnbHlwaF9mbGF2 b3JfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg cmVtb3ZlX3BfMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlm ICh2cG9zXzAgPT0gdm50aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9w XzAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHZudGhfcm93LT5lbmFibGVkX3ApCisg ICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9w XzAgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3 LCB3LT5jdXJyZW50X21hdHJpeCwgdm50aF9yb3csIHhfMCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgZnhfMCwgeV8wLCBmeV8wLCBocG9zXzAsIHZwb3NfMCwg d2RfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaF8wLCBj dXJzb3JfdHlwZV8wLCBjdXJzb3Jfd2lkdGhfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgbHNsX2JnXzAsIGFjdGl2ZV9wXzAsIGdseXBoX2ZsYXZvcl8wLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVfcF8wKTsK KyAgICAgICAgICAgICAgICAgICAgICBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXzBdLmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgIC0t b2xkX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgICAgICAgICAg ICAgLyogSWYgd2UgaW5hZHZlcnRlbnRseSBlcmFzZWQgYW5vdGhlciBmYWtlIGN1cnNvciBhdCB0 aGUgc2FtZQorICAgICAgICAgICAgICAgICAgICAgIEhQT1MgdGhhdCBpcyBzdGlsbCBlbmFibGVk X3AgaW4gdGhlIGBvbGRfbWF0cml4YCwgdGhlbiByZWRyYXcgaXQuICovCisgICAgICAgICAgICAg ICAgICAgICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAg ICAgICAgICAgICAgICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBudGhfMiA9IDA7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVfcCAob2xkX21hdHJp eCwgY2FjaGVfdHlwZSwgdm50aCwgbnRoXzIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICsrbnRoXzIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgaW50IHhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMl0ueDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBm eF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5meDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB5XzIgPSBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLnk7CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBpbnQgZnlfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMl0uZnk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaHBvc18yID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5ocG9zOworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHZwb3NfMiA9IG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0udnBvczsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGludCB3ZF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8yXS53ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBoXzIgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmg7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlXzIg PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmN1cnNvcl90 eXBlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aF8yID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5jdXJzb3Jfd2lk dGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZ18y ID0gey5yZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJd LmZnLnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8yXS5mZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzJdLmZnLmJsdWV9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Ly8gIHN0cnVjdCBtY19SR0IgbHNsX2JnXzIgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uYmcucmVkLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5iZy5ncmVlbiwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVl ID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5iZy5ibHVl fTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3BfMiA9IG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uYWN0aXZlX3A7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3JfMiA9 IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZ2x5cGhfZmxh dm9yOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBlbmFibGVkX3BfMiA9IG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZW5hYmxlZF9wOwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBnb19wXzIgPSAoaHBvc18wID09IGhw b3NfMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZnhf MCA8PSBmeF8yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBmeF8wICsgd2RfMCA+IGZ4XzIgKyB3ZF8yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3BfMik7CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBpZiAoIWdvX3BfMikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29u dGludWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wXzIgPSBm YWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlk ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgdm50aF9yb3csIHhfMiwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmeF8yLCB5XzIsIGZ5XzIsIGhwb3Nf MiwgdnBvc18yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHdkXzIsIGhfMiwgY3Vyc29yX3R5cGVfMiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGhfMiwgbHNsX2ZnXzIsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZl X3BfMiwgZ2x5cGhfZmxhdm9yXzIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgcmVtb3ZlX3BfMik7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICB9CisgIGlmICh1cGRhdGluZ19mcmFt ZV9wKQorICAgIHVwZGF0ZV9lbmQgKGYpOworfQorCit2b2lkCittY191cGRhdGVfd2luZG93X2Ry eXJ1biAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wLCBzdHJ1Y3QgbWNfZXNzZW50aWFs cyBlc3NlbnRpYWxzKQoreworICBpZiAoIUJVRkZFUlAgKHctPmNvbnRlbnRzKSkKKyAgICByZXR1 cm47CisKKyAgaWYgKHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVdID09IDAKKyAg ICAgICYmIHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hfQ0FDSEVdID09IDAKKyAgICAgICYm IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVdID09IDAKKyAgICAgICYmIE5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAmJiBOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgcmV0dXJuOwor CisgIC8vIGNsb2NrX3QgY2xvY2tfc3RhcnQgPSBjbG9jaygpOworCisgIGJvb2wgZHJhd19wID0g ZmFsc2U7CisKKyAgc3RydWN0IGdseXBoX21hdHJpeCAqc2F2ZWRfZGVzaXJlZCA9IG1jX3NhdmVf Z2x5cGhfbWF0cml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GluZV9y b3cgPSBNQVRSSVhfTU9ERV9MSU5FX1JPVyAoZGVzaXJlZF9tYXRyaXgpOworICAgICAgaWYgKG1v ZGVfbGluZV9yb3ctPm1vZGVfbGluZV9wICYmIG1vZGVfbGluZV9yb3ctPmVuYWJsZWRfcCkKKyAg ICAgICAgeworICAgICAgICAgIG1vZGVfbGluZV9yb3ctPnkgPSB5YiArIFdJTkRPV19TQ1JPTExf QkFSX0FSRUFfSEVJR0hUICh3KTsKKyAgICAgICAgICB1cGRhdGVfd2luZG93X2xpbmUgKHcsIE1B VFJJWF9ST1dfVlBPUyAobW9kZV9saW5lX3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgZGVzaXJlZF9tYXRyaXgpLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisgICAgICAgIH0KKwor ICAgICAgLyogRmluZCBmaXJzdCBlbmFibGVkIHJvdy4gIE9wdGltaXphdGlvbnMgaW4gcmVkaXNw bGF5X2ludGVybmFsCisgICAgICAgICBtYXkgbGVhZCB0byBhbiB1cGRhdGUgd2l0aCBvbmx5IG9u ZSByb3cgZW5hYmxlZC4gIFRoZXJlIG1heQorICAgICAgICAgYmUgYWxzbyBjb21wbGV0ZWx5IGVt cHR5IG1hdHJpY2VzLiAqLworICAgICAgd2hpbGUgKHJvdyA8IGVuZCAmJiAhcm93LT5lbmFibGVk X3ApCisgICAgICAgICsrcm93OworCisgICAgICAvKiBUcnkgcmV1c2luZyBwYXJ0IG9mIHRoZSBk aXNwbGF5IGJ5IGNvcHlpbmcuICovCisgICAgICBpZiAocm93IDwgZW5kICYmICF3LT5kZXNpcmVk X21hdHJpeC0+bm9fc2Nyb2xsaW5nX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgcmMgPSBt Y19zY3JvbGxpbmdfd2luZG93ICh3LCBoZWFkZXJfbGluZV9yb3cgIT0gTlVMTCk7CisgICAgICAg ICAgaWYgKHJjIDwgMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogQWxsIHJvd3Mg d2VyZSBmb3VuZCB0byBiZSBlcXVhbC4gKi8KKyAgICAgICAgICAgICAgcGF1c2VkX3AgPSAwOwor ICAgICAgICAgICAgICBnb3RvIHNldF9jdXJzb3I7CisgICAgICAgICAgICB9CisgICAgICAgICAg ICBlbHNlIGlmIChyYyA+IDApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBX ZSd2ZSBzY3JvbGxlZCB0aGUgZGlzcGxheS4gKi8KKyAgICAgICAgICAgICAgICBmb3JjZV9wID0g MTsKKyAgICAgICAgICAgICAgICBjaGFuZ2VkX3AgPSAxOworICAgICAgICAgICAgICB9CisgICAg ICAgIH0KKyAgICAgIC8qIFByb2Nlc3MgdGhlIGN1cnNvciByb3cgYXQgdGhlIG91dHNldCBpZiBp dCBpcyB3aXRoaW4gYGRlc2lyZWRfbWF0cml4YC4KKyAgICAgIFdoZW4gcHJvY2Vzc2luZyBhbGwg b3RoZXIgcm93cywgd2Ugd2lsbCBxdWVyeSB0aGUgYHctPmN1cnJlbnRfbWF0cml4YCBmb3IgZGF0 YQorICAgICAgcmVsYXRpbmcgdG8gdGhlIGN1cnNvciByb3cuICBgbWFrZV9jdXJyZW50YCAod2l0 aGluIGB1cGRhdGVfd2luZG93X2xpbmUnKQorICAgICAgdXBkYXRlcyB0aGUgYHctPmN1cnJlbnRf bWF0cml4YCBmb3IgdGhlIGFwcGxpY2FibGUgcm93LiAgSW4gZG9pbmcgc28sIGhvd2V2ZXIsCisg ICAgICB0aGUgYXBwbGljYWJsZSByb3cgaW4gdGhlIGRlc2lyZWQgbWF0cml4IGlzIGFsdGVyZWQg c3VjaCB0aGF0IHdlIGNhbiBubyBsb25nZXIKKyAgICAgIHJlbHkgdXBvbiB0aGUgYWNjdXJhY3kg b2YgYFJPVy0+dXNlZFtURVhUX0FSRUFdYC4gIFRoZXJlZm9yZSwgd2UgbXVzdCBub3cgcmVseQor ICAgICAgZXhjbHVzaXZlbHkgdXBvbiBgdy0+Y3VycmVudF9tYXRyaXgnIGZvciBjdXJzb3Igcm93 IGJhc2VkIGRlY2lzaW9ucy4gKi8KKyAgICAgIGZvciAoc3RydWN0IGdseXBoX3JvdyAqbWNfcm93 ID0gcm93OworICAgICAgICAgICBtY19yb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3Bl bmRpbmcpOworICAgICAgICAgICArK21jX3JvdykKKyAgICAgICAgeworICAgICAgICAgIGludCB2 cG9zID0gTUFUUklYX1JPV19WUE9TIChtY19yb3csIHctPmRlc2lyZWRfbWF0cml4KTsKKyAgICAg ICAgICBpZiAobWNfcm93LT5lbmFibGVkX3AKKyAgICAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5j dXJzb3IudnBvcykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCA9 IHctPmRlc2lyZWRfbWF0cml4OworICAgICAgICAgICAgICBpZiAoIWZvcmNlX3AgJiYgKytuX3Vw ZGF0ZWQgJSBwcmVlbXB0X2NvdW50ID09IDApCisgICAgICAgICAgICAgICAgZGV0ZWN0X2lucHV0 X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgpOworICAgICAgICAgICAgICBjaGFuZ2VkX3Ag fD0gbWNfdXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRl bl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBj dXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCBkcmF3X3ApOworICAgICAgICAgICAgICBpZiAoTUFU UklYX1JPV19CT1RUT01fWSAocm93KSA+PSB5YikKKyAgICAgICAgICAgICAgICBmb3IgKGludCBp ID0gdnBvcyArIDE7IGkgPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAg ICAgICAgICAgICAgICBTRVRfTUFUUklYX1JPV19FTkFCTEVEX1AgKHctPmN1cnJlbnRfbWF0cml4 LCBpLCBmYWxzZSk7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAg ICB9CisgICAgICBjdXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAvKiBV cGRhdGUgdGhlIHJlc3Qgb2YgdGhlIGxpbmVzLiAqLworICAgICAgZm9yICg7IHJvdyA8IGVuZCAm JiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVuZGluZyk7ICsrcm93KQorICAgICAgICAvKiBzY3JvbGxp bmdfd2luZG93IHJlc2V0cyB0aGUgZW5hYmxlZF9wIGZsYWcgb2YgdGhlIHJvd3MgaXQgcmV1c2Vz IGZyb20KKyAgICAgICAgY3VycmVudF9tYXRyaXguICovCisgICAgICAgIGlmIChyb3ctPmVuYWJs ZWRfcCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBP UyAocm93LCB3LT5kZXNpcmVkX21hdHJpeCk7CisgICAgICAgICAgICAvKiBJZiB0aGUgYGN1cnNv cl9yb3dgIGlzIHdpdGhpbiB0aGUgYGRlc2lyZWRfbWF0cml4YCwgdGhlbiBpdCB3YXMKKyAgICAg ICAgICAgIHByb2Nlc3NlZCBoZXJlaW5hYm92ZSBhbmQgc2hvdWxkIGJlIHNraXBwZWQgYXQgdGhp cyB0aW1lLiAqLworICAgICAgICAgICAgaWYgKHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAg ICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgIGludCBpOworICAgICAgICAgICAgLyogV2Un bGwgaGF2ZSB0byBwbGF5IGEgbGl0dGxlIGJpdCB3aXRoIHdoZW4gdG8KKyAgICAgICAgICAgICAg IGRldGVjdF9pbnB1dF9wZW5kaW5nLiAgSWYgaXQncyBkb25lIHRvbyBvZnRlbiwKKyAgICAgICAg ICAgICAgIHNjcm9sbGluZyBsYXJnZSB3aW5kb3dzIHdpdGggcmVwZWF0ZWQgc2Nyb2xsLXVwCisg ICAgICAgICAgICAgICBjb21tYW5kcyB3aWxsIHRvbyBxdWlja2x5IHBhdXNlIHJlZGlzcGxheS4g Ki8KKyAgICAgICAgICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291 bnQgPT0gMCkKKyAgICAgICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVl emFibGVzICgpOworICAgICAgICAgICAgY2hhbmdlZF9wIHw9IG1jX3VwZGF0ZV93aW5kb3dfbGlu ZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMs IGRyYXdfcCk7CisgICAgICAgICAgICAvKiBNYXJrIGFsbCByb3dzIGJlbG93IHRoZSBsYXN0IHZp c2libGUgb25lIGluIHRoZSBjdXJyZW50CisgICAgICAgICAgICAgICBtYXRyaXggYXMgaW52YWxp ZC4gIFRoaXMgaXMgbmVjZXNzYXJ5IGJlY2F1c2Ugb2YKKyAgICAgICAgICAgICAgIHZhcmlhYmxl IGxpbmUgaGVpZ2h0cy4gIENvbnNpZGVyIHRoZSBjYXNlIG9mIHRocmVlCisgICAgICAgICAgICAg ICBzdWNjZXNzaXZlIHJlZGlzcGxheXMsIHdoZXJlIHRoZSBmaXJzdCBkaXNwbGF5cyA1CisgICAg ICAgICAgICAgICBsaW5lcywgdGhlIHNlY29uZCAzIGxpbmVzLCBhbmQgdGhlIHRoaXJkIDUgbGlu ZXMgYWdhaW4uCisgICAgICAgICAgICAgICBJZiB0aGUgc2Vjb25kIHJlZGlzcGxheSB3b3VsZG4n dCBtYXJrIHJvd3MgaW4gdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IG1hdHJpeCBpbnZhbGlk LCB0aGUgdGhpcmQgcmVkaXNwbGF5IG1pZ2h0IGJlCisgICAgICAgICAgICAgICB0ZW1wdGVkIHRv IG9wdGltaXplIHJlZGlzcGxheSBiYXNlZCBvbiBsaW5lcyBkaXNwbGF5ZWQKKyAgICAgICAgICAg ICAgIGluIHRoZSBmaXJzdCByZWRpc3BsYXkuICovCisgICAgICAgICAgICBpZiAoTUFUUklYX1JP V19CT1RUT01fWSAocm93KSA+PSB5YikKKyAgICAgICAgICAgICAgZm9yIChpID0gdnBvcyArIDE7 IGkgPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAgICAgICAg U0VUX01BVFJJWF9ST1dfRU5BQkxFRF9QICh3LT5jdXJyZW50X21hdHJpeCwgaSwgZmFsc2UpOwor ICAgICAgICAgIH0KKyAgICAgIC8qIFdhcyBkaXNwbGF5IHByZWVtcHRlZD8gKi8KKyAgICAgIHBh dXNlZF9wID0gcm93IDwgZW5kOworICAgICAgc2V0X2N1cnNvcjoKKyAgICAgIC8qIElmIHdlIGp1 bXBlZCBoZXJlIGZyb20gYHNldF9jdXJzb3JgLCB0aGVuIHNldCB0aGUgYGN1cnNvcl9tYXRyaXhg LiAqLworICAgICAgaWYgKGN1cnNvcl9tYXRyaXggPT0gTlVMTCkKKyAgICAgICAgY3Vyc29yX21h dHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgLyogUmVzZXQgYHJvd2AgdG8gMCBzbyB0 aGF0IGZha2UgY3Vyc29ycyBjYW4gYmUgZHJhd24gb24gcm93cyBwcmVjZWRpbmcgdGhlCisgICAg ICBmaXJzdCBgcm93LT5lbmFibGVkX3BgLiAgSnVzdCBwcmlvciB0byB0aGUgY2FsbCB0byBgc2Ny b2xsaW5nX3dpbmRvdycgYWJvdmUsCisgICAgICBgcm93YCB3YXMgYWR2YW5jZWQgdG8gdGhlIGZp cnN0IGByb3ctPmVuYWJsZWRfcGAuICovCisgICAgICBmb3IgKHN0cnVjdCBnbHlwaF9yb3cgKmRl c2lyZWRfcm93ID0gTUFUUklYX1JPVyAody0+ZGVzaXJlZF9tYXRyaXgsIDApOworICAgICAgICAg ICBkZXNpcmVkX3JvdyA8IGVuZAorICAgICAgICAgICAmJiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVu ZGluZykKKyAgICAgICAgICAgLyogVzMyIEVtYWNzIGNyYXNoZXMgb24gc3RhcnR1cCB3aXRob3V0 IGEgQlVGRkVSUCBjaGVjay4gKi8KKyAgICAgICAgICAgJiYgQlVGRkVSUCAody0+Y29udGVudHMp CisgICAgICAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19j b25mKSkKKyAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKTsKKyAgICAgICAgICAgKytkZXNpcmVkX3JvdykK KyAgICAgICAgeworICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChkZXNpcmVk X3Jvdywgdy0+ZGVzaXJlZF9tYXRyaXgpOworICAgICAgICAgIGlmIChkZXNpcmVkX3Jvdy0+ZW5h YmxlZF9wKQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgc3RydWN0IGdseXBoX3Jv dyAqY3VycmVudF9yb3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgdnBvcyk7Cisg ICAgICAgICAgZW51bSBtY19yb3dfcG9zaXRpb24gcm93X3Bvc2l0aW9uID0gbWNfcm93X3Bvc2l0 aW9uICh3LCBjdXJyZW50X3JvdywgY3VycmVudF9yb3csIHZwb3MpOworICAgICAgICAgIGlmIChj dXJyZW50X3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgbWNfZHJhd19yb3cgKHcsIHctPmN1 cnJlbnRfbWF0cml4LCBjdXJyZW50X3JvdywgY3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FSRUFd LAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfcm93LT54LCBjdXJyZW50X3Jvdy0+ dXNlZFtURVhUX0FSRUFdLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9t YXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgZHJhd19wLAorICAgICAgICAgICAgICAg ICAgICAgICAgIFNFVF9DVVJTT1JfT05FKTsKKyAgICAgICAgfQorCisgICAgICBtY19yZXN0b3Jl X2dseXBoX21hdHJpeCAoc2F2ZWRfZGVzaXJlZCwgdy0+ZGVzaXJlZF9tYXRyaXgpOworICAgICAg bWNfcmVzdG9yZV9nbHlwaF9tYXRyaXggKHNhdmVkX2N1cnJlbnQsIHctPmN1cnJlbnRfbWF0cml4 KTsKKworICAgICAgbWNfdXBkYXRlX3dpbmRvd19lcmFzZSAodywgb2xkX21hdHJpeCk7CisKKyAg ICAgIG1jX3hmcmVlX2NhY2hlX21hdHJpeCAodywgJm9sZF9tYXRyaXgpOworCisgICAgfQorICAv LyBjbG9ja190IGNsb2NrX2VuZCA9IGNsb2NrKCk7CisgIC8vIGRvdWJsZSBjcHVfdGltZV91c2Vk ID0gKChkb3VibGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7 CisgIC8vIGZwcmludGYgKHN0ZGVyciwgIm1jX3Njcm9sbGluZ193aW5kb3cgKCVzKTogIFRJTUUg KCVmKVxuIiwgbWNfd2luZG93ICh3KSwgY3B1X3RpbWVfdXNlZCk7Cit9CisKKy8qIGVuZCBNVUxU SVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBTdHJ1Y3R1 cmUgdG8gcGFzcyBkaW1lbnNpb25zIGFyb3VuZC4gIFVzZWQgZm9yIGNoYXJhY3RlciBib3VuZGlu ZwogICAgYm94ZXMsIGdseXBoIG1hdHJpeCBkaW1lbnNpb25zIGFuZCBhbGlrZS4gICovCiAKQEAg LTIyNDEsNiArNDAxNywxNiBAQCBmcmVlX3dpbmRvd19tYXRyaWNlcyAoc3RydWN0IHdpbmRvdyAq dykKIAkgIGZyZWVfZ2x5cGhfbWF0cml4ICh3LT5jdXJyZW50X21hdHJpeCk7CiAJICBmcmVlX2ds eXBoX21hdHJpeCAody0+ZGVzaXJlZF9tYXRyaXgpOwogCSAgdy0+Y3VycmVudF9tYXRyaXggPSB3 LT5kZXNpcmVkX21hdHJpeCA9IE5VTEw7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgbWNfeGZyZWVfY2FjaGVfbWF0cml4ICh3LCAmdy0+ bWNfbWF0cml4KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCX0KIAogICAgICAg LyogTmV4dCB3aW5kb3cgb24gc2FtZSBsZXZlbC4gICovCkBAIC0zMzg3LDYgKzUxNzMsMjYgQEAg Y2hlY2tfY3VycmVudF9tYXRyaXhfZmxhZ3MgKHN0cnVjdCB3aW5kb3cgKncpCiBzdGF0aWMgYm9v bAogdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogeworCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlm IChtY19zdGRlcnJfcCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJ1cGRhdGVfd2luZG93ICglcylc biIsIG1jX3dpbmRvdyAodykpOworCisgIHN0cnVjdCBtY19lc3NlbnRpYWxzIGVzc2VudGlhbHM7 CisgIG1jX3NldF9lc3NlbnRpYWxzICh3LCAmZXNzZW50aWFscyk7CisKKyAgbWNfdXBkYXRlX3dp bmRvd19kcnlydW4gKHcsIGZvcmNlX3AsIGVzc2VudGlhbHMpOworCisgIHN0cnVjdCBnbHlwaF9t YXRyaXggKmN1cnNvcl9tYXRyaXggPSBOVUxMOworCisgIGJvb2wgZHJhd19wID0gdHJ1ZTsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpkZXNp cmVkX21hdHJpeCA9IHctPmRlc2lyZWRfbWF0cml4OwogICBib29sIHBhdXNlZF9wOwogICBpbnQg cHJlZW1wdF9jb3VudCA9IGNsaXBfdG9fYm91bmRzICgxLCBiYXVkX3JhdGUgLyAyNDAwICsgMSwg SU5UX01BWCk7CkBAIC0zNDY0LDYgKzUyNzAsNDcgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdp bmRvdyAqdywgYm9vbCBmb3JjZV9wKQogCSAgICB9CiAJfQogCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIFByb2Nlc3MgdGhlIGN1cnNv ciByb3cgYXQgdGhlIG91dHNldCBpZiBpdCBpcyB3aXRoaW4gYGRlc2lyZWRfbWF0cml4YC4KKyAg V2hlbiBwcm9jZXNz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MCkKKyAgICAgICAgICAgIGRldGVj dF9pbnB1dF9wZW5kaW5nX2lnbm9yZV9zcXVlZXphYmxlcyAoKTsKKyAgICAgICAgICBjaGFuZ2Vk X3AgfD0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYg KCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICEgTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpKQorICAgICAgICAgICAgICAg ICAgICAgICA/IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3Zl cndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIGRyYXdfcCkKKyAgICAgICAgICAgICAgICAg ICAgICAgOiB1cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0 dGVuX3ApOworICAgICAgICAgIGlmIChNQVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHliKQor ICAgICAgICAgICAgZm9yIChpbnQgaSA9IHZwb3MgKyAxOyBpIDwgdy0+Y3VycmVudF9tYXRyaXgt Pm5yb3dzIC0gMTsgKytpKQorICAgICAgICAgICAgICBTRVRfTUFUUklYX1JPV19FTkFCTEVEX1Ag KHctPmN1cnJlbnRfbWF0cml4LCBpLCBmYWxzZSk7CisgICAgICAgICAgYnJlYWs7CisgICAgICAg IH0KKyAgICB9CisKKyAgY3Vyc29yX21hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICAvKiBVcGRhdGUgdGhlIHJlc3Qgb2YgdGhl IGxpbmVzLiAgKi8KICAgICAgIGZvciAoOyByb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlucHV0 X3BlbmRpbmcpOyArK3JvdykKIAkvKiBzY3JvbGxpbmdfd2luZG93IHJlc2V0cyB0aGUgZW5hYmxl ZF9wIGZsYWcgb2YgdGhlIHJvd3MgaXQKQEAgLTM0NzEsNiArNTMxOCwxOSBAQCB1cGRhdGVfd2lu ZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAJaWYgKHJvdy0+ZW5hYmxlZF9w KQogCSAgewogCSAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBkZXNpcmVkX21h dHJpeCk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKyAgICAgICAgICAvKiBJZiB0aGUgYGN1cnNvcl9yb3dgIGlzIHdpdGhpbiB0aGUgYGRl c2lyZWRfbWF0cml4YCwgdGhlbiBpdCB3YXMKKyAgICAgICAgICBwcm9jZXNzZWQgaGVyZWluYWJv dmUgYW5kIHNob3VsZCBiZSBza2lwcGVkIGF0IHRoaXMgdGltZS4gKi8KKyAgICAgICAgICBpZiAo dnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICBjb250aW51ZTsKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogCSAgICBpbnQgaTsKIAogCSAgICAvKiBXZSdsbCBoYXZlIHRv IHBsYXkgYSBsaXR0bGUgYml0IHdpdGggd2hlbiB0bwpAQCAtMzQ3OSw4ICs1MzM5LDIxIEBAIHVw ZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIAkgICAgICAgY29t bWFuZHMgd2lsbCB0b28gcXVpY2tseSBwYXVzZSByZWRpc3BsYXkuICAqLwogCSAgICBpZiAoIWZv cmNlX3AgJiYgKytuX3VwZGF0ZWQgJSBwcmVlbXB0X2NvdW50ID09IDApCiAJICAgICAgZGV0ZWN0 X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgpOwotCSAgICBjaGFuZ2VkX3AgfD0g dXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLAotCQkJCQkgICAgICZtb3VzZV9mYWNlX292ZXJ3 cml0dGVuX3ApOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgICAgICAgICAgY2hhbmdlZF9wIHw9IChCVUZGRVJQICh3LT5jb250ZW50cykK KyAgICAgICAgICAgICAgICAgICAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICB8fCAhIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNf dmlzaWJsZSkpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgPyBtY191cGRhdGVfd2luZG93X2xp bmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3AsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxz LCBkcmF3X3ApCisgICAgICAgICAgICAgICAgICAgICAgIDogdXBkYXRlX3dpbmRvd19saW5lICh3 LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wKTsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKIAogCSAgICAvKiBNYXJrIGFsbCByb3dzIGJlbG93IHRoZSBsYXN0IHZpc2libGUg b25lIGluIHRoZSBjdXJyZW50CiAJICAgICAgIG1hdHJpeCBhcyBpbnZhbGlkLiAgVGhpcyBpcyBu ZWNlc3NhcnkgYmVjYXVzZSBvZgpAQCAtMzUwMSw2ICs1Mzc0LDQxIEBAIHVwZGF0ZV93aW5kb3cg KHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIAogICAgIHNldF9jdXJzb3I6CiAKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyog SWYgd2UganVtcGVkIGhlcmUgZnJvbSBgc2V0X2N1cnNvcmAsIHRoZW4gc2V0IHRoZSBgY3Vyc29y X21hdHJpeGAuICovCisgIGlmIChjdXJzb3JfbWF0cml4ID09IE5VTEwpCisgICAgY3Vyc29yX21h dHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworCisgIC8qIFJlc2V0IGByb3dgIHRvIDAgc28gdGhh dCBmYWtlIGN1cnNvcnMgY2FuIGJlIGRyYXduIG9uIHJvd3MgcHJlY2VkaW5nIHRoZQorICBmaXJz dCBgcm93LT5lbmFibGVkX3BgLiAgSnVzdCBwcmlvciB0byB0aGUgY2FsbCB0byBgc2Nyb2xsaW5n X3dpbmRvdycgYWJvdmUsCis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RfcCkK KyAgICAgICAgbWNfZHJhd19yb3cgKHcsIHctPmN1cnJlbnRfbWF0cml4LCBjdXJyZW50X3Jvdywg Y3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAgICAgICAgICAgICAgY3Vy cmVudF9yb3ctPngsIGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0sIHZwb3MsCisgICAgICAg ICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGRy YXdfcCwgU0VUX0NVUlNPUl9UV08pOworICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAgICAgLyogVXBkYXRlIHRoZSBoZWFkZXIgbGluZSBhZnRlciBzY3JvbGxpbmcgYmVj YXVzZSBhIG5ldyBoZWFkZXIKIAkgbGluZSB3b3VsZCBvdGhlcndpc2Ugb3ZlcndyaXRlIGxpbmVz IGF0IHRoZSB0b3Agb2YgdGhlIHdpbmRvdwogCSB0aGF0IGNhbiBiZSBzY3JvbGxlZC4gICovCkBA IC0zNTE2LDcgKzU0MjQsNDkgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9v bCBmb3JjZV9wKQogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogCSAgaWYgKGNoYW5nZWRfcCAm JiByaWYtPmZpeF9vdmVybGFwcGluZ19hcmVhKQogCSAgICB7Ci0JICAgICAgcmVkcmF3X292ZXJs YXBwZWRfcm93cyAodywgeWIpOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisvKiBgcmVkcmF3X292ZXJsYXBwZWRfcm93cyc6ICBSZWRyYXcg bGluZX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fY3Vyc29yX3RvICh3LCBpLCAwLCByb3ctPnksIGFy ZWEgPT0gVEVYVF9BUkVBID8gcm93LT54IDogMCk7CisgICAgICAgICAgICAgIGlmICghbWNfcmVk cmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywgYXJlYSwgcm93LT54LCAwLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdy0+dXNlZFthcmVhXSwgdHJ1ZSwgRFJB V19OT1JNQUxfVEVYVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVUERBVEVf V0lORE9XX19SRURSQVdfT1ZFUkxBUFBFRF9ST1dTKQorICAgICAgICAgICAgICAgICAgJiYgcm93 LT51c2VkW2FyZWFdKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIEZSQU1F X1JJRiAoZiktPndyaXRlX2dseXBocyAodywgcm93LCByb3ctPmdseXBoc1thcmVhXSwgYXJlYSwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT51c2Vk W2FyZWFdKTsKKyAgICAgICAgICAgICAgICAgIEZSQU1FX1JJRiAoZiktPmNsZWFyX2VuZF9vZl9s aW5lICh3LCByb3csIGFyZWEsIC0xKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9 CisgICAgICAgICAgcm93LT5vdmVybGFwcGVkX3AgPSAwOworICAgICAgICB9CisgICAgICBpZiAo TUFUUklYX1JPV19CT1RUT01fWSAocm93KSA+PSB5YikKKyAgICAgICAgYnJlYWs7CisgICAgfQor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgcmVkcmF3X292ZXJsYXBwaW5n X3Jvd3MgKHcsIHliKTsKIAkgICAgfQogI2VuZGlmCkBAIC0zNTM2LDggKzU0ODYsMjAgQEAgdXBk YXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogI2VuZGlmCiAKICNp ZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAg ICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisg ICAgbWNfdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCAwKTsKKyAgICBlbHNlCiAgICAgICB1cGRh dGVfd2luZG93X2ZyaW5nZXMgKHcsIDApOwogCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgICAgICAvKiBFbmQgdGhlIHVwZGF0ZSBvZiB3aW5kb3cgVy4gIERvbid0IHNldCB0aGUgY3Vy c29yIGlmIHdlCiAgICAgICAgICBwYXVzZWQgdXBkYXRpbmcgdGhlIGRpc3BsYXkgYmVjYXVzZSBp biB0aGlzIGNhc2UsCiAgICAgICAgICBzZXRfd2luZG93X2N1cnNvcl9hZnRlcl91cGRhdGUgaGFz bid0IGJlZW4gY2FsbGVkLCBhbmQKZGlmZiAtLWdpdCBhL3NyYy9mcmFtZS5oIGIvc3JjL2ZyYW1l LmgKaW5kZXggZmE0NWEzMi4uNTNhZDEzMSAxMDA2NDQKLS0tIGEvc3JjL2ZyYW1lLmgKKysrIGIv c3JjL2ZyYW1lLmgKQEAgLTIwNSw2ICsyMDUsMTYgQEAgc3RydWN0IGZyYW1lCiAgIExpc3BfT2Jq ZWN0IHRvb2xfYmFyX2l0ZW1zOwogICAvKiB0b29sX2Jhcl9pdGVtcyBzaG91bGQgYmUgdGhlIGxh c3QgTGlzcF9PYmplY3QgbWVtYmVyLiAgKi8KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAvKiBOb24tbmlsIHdoZW4gdGhlIGZyYW1lIGlz IGluIHRoZSBwcm9jZXNzIG9mIGJlaW5nIHVwZGF0ZWQuICovCisgIHN0cnVjdCBmcmFtZSAqbWNf dXBkYXRpbmdfZnJhbWU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogQ2Fj aGUgb2YgcmVhbGl6ZWQgZmFjZXMuICAqLwogICBzdHJ1Y3QgZmFjZV9jYWNoZSAqZmFjZV9jYWNo ZTsKIApkaWZmIC0tZ2l0IGEvc3JjL2ZyaW5nZS5jIGIvc3JjL2ZyaW5nZS5jCmluZGV4IGQwZDU5 OTIuLjI1MmVkYWMgMTAwNjQ0Ci0tLSBhL3NyYy9mcmluZ2UuYworKysgYi9zcmMvZnJpbmdlLmMK QEAgLTQzNyw4ICs0MzcsNDYyIEBAIHN0YXRpYyB1bnNpZ25lZCBzaG9ydCBlbXB0eV9saW5lX2Jp dHNbXSA9IHsKICNkZWZpbmUgU1RBTkRBUkRfQklUTUFQX0hFSUdIVChiaXRzKSAoc2l6ZW9mIChi aXRzKS9CWVRFU19QRVJfQklUTUFQX1JPVykKICNkZWZpbmUgRlJCSVRTKGJpdHMpICBiaXRzLCBT VEFOREFSRF9CSVRNQVBfSEVJR0hUIChiaXRzKQogCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBgKy1mcmluZ2UtaGVscGVyLWRl Y2ltYWwnIGRlZmluZWQgaW4gYGNyb3NzaGFpcnMuZWxgICovCisKKy8qIFRPRE86ICBDb25zaWRl ciBhZGRpbmcgdGhlIGZvbGxvd2luZyBmcmluZ2UgYml0bWFwczoKKyAgKGRlZmluZS1mcmluZ2Ut Yml0bWFwICdicmVha3BvaW50ICJceDNjXHg3ZVx4ZmZceGZmXHhmZlx4ZmZceDdlXHgzYyIpCisg IChkZWZpbmUtZnJpbmdlLWJpdG1hcCAnaG9sbG93LXJpZ2h0LXRyaWFuZ2xlICJceGUwXHg5MFx4 ODhceDg0XHg4NFx4ODhceDkwXHhlMCIpICovCisKKy8qIDI0CisgICAgKCstZnJpbmdlLWhlbHBl ci1oZXhhZGVjaW1hbAorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAg InguLi4uLi4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLi54eC4uIgorICAgICAgIngu Li4ueHguIgorICAgICAgIngueHh4eHh4IgorICAgICAgIngueHh4eHh4IgorICAgICAgInguLi4u eHguIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLi4uLi4u IgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWdu ZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweDgwLCAw eDgwLCAweDgwLCAweDk4LCAweDhjLCAweDg2LCAweGJmLAorICAweGJmLCAweDg2LCAweDhjLCAw eDk4LCAweDgwLCAweDgwLCAweDgwfTsKKworLyogMjUKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhl eGFkZWNpbWFsCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4u Li4ueHgiCisgICAgICAiLnh4Li4ueHgiCisgICAgICAiLi54eC4ueHgiCisgICAgICAiLi4ueHgu eHgiCisgIC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Glj YWxfYmFyX2JpdHNbXSA9eworICAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4 MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4M307CisKKy8qIDMxCisgICAgKCstZnJpbmdl LWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgorICAgICAgInh4Li4uLi4uIgor ICAgICAgIiB4eC4uLi4uIgorICAgICAgIi54eC4uLi4uIgorICAgICAgIi4ueHguLi4uIgorICAg ICAgIi4ueHguLi4uIgorICAgICAgIi4uLnh4Li4uIgorICAgICAgIi4uLnh4Li4uIgorICAgICAg Ii4uLi54eC4uIgorICAgICAgIi4uLi54eC4uIgorICAgICAgIi4uLi4ueHguIgorICAgICAgIi4u Li4ueHguIgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IikKKyovCitzdGF0aWMg dW5zaWduZWQgc2hvcnQgbWNfYmFja3NsYXNoX2JpdHNbXSA9eworICAweGMwLCAweGMwLCAweGUw LCAweDYwLCAweDMwLCAweDMwLCAweDE4LCAweDE4LCAweGMsIDB4YywgMHg2LCAweDYsIDB4Mywg MHgzfTsKKworLyogMzIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAi eHguLi4uLi4iCisgICAgICAieHguLi4uLi4iCisgICAgICAieHh4Li4uLi4iCisgICAgICAieHh4 Li4uLi4iCisgICAgICAieC54eC4uLi4iCisgICAgICAieC54eC4uLi4iCisgICAgICAieC4ueHgu Li4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4uLnh4Li4iCisgICAgICAieC4uLnh4Li4i CisgICAgICAieC4uLi54eC4iCisgICAgICAieC4uLi54eC4iCisgICAgICAieC4uLi4ueHgiCisg ICAgICAieC4uLi4ueHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9i YXJfYmFja3NsYXNoX2JpdHNbXSA9eworICAweGMwLCAweGMwLCAweGUwLCAweGUwLCAweGIwLCAw eGIwLCAweDk4LAorICAweDk4LCAweDhjLCAweDhjLCAweDg2LCAweDg2LCAweDgzLCAweDgzfTsK KworLyogMzMKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLnh4eHh4 eC4iCisgICAgICAieHh4eC54Li4iCisgICAgICAieHh4eC54Li4iCisgICAgICAieHh4eC54Li4i CisgICAgICAiLnh4eC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisg ICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAg ICAiLi4ueC54Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19waWxjcm93X2JpdHNb XSA9eworICAweDdlLCAweGY0LCAweGY0LCAweGY0LCAweDc0LCAweDE0LCAweDE0LCAweDE0LCAw eDE0LCAweDE0LCAweDE0fTsKKworLyogMzQKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNp bWFsCisgICAgICAiLi54eHh4Li4iCisgICAgICAiLnh4eHh4eC4iCisgICAgICAieC4ueHguLngi CisgICAgICAieC4ueHguLngiCisgICAgICAieHh4eHh4eHgiCisgICAgICAieHguLi4ueHgiCisg ICAgICAieHh4Li54eHgiCisgICAgICAiLnh4eHh4eC4iCisgICAgICAiLi54eHh4Li4iKQorKi8K K3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zbWlsZXlfZmFjZV9iaXRzW10gPXsKKyAgMHgzYywg MHg3ZSwgMHg5OSwgMHg5OSwgMHhmZiwgMHhjMywgMHhlNywgMHg3ZSwgMHgzY307CisKKy8qIDM1 CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4ueC4uLi4uIgorICAg ICAgIi4uLnguLi4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLi4ueC4uIgorICAgICAg Ii4uLi54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC4uLi4uIikKKyovCitzdGF0 aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAweDIw LCAweDEwLCAweDgsIDB4NCwgMHg4LCAweDEwLCAweDIwfTsKKworLyogMzYKKyAgICAoKy1mcmlu Z2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi54Li4iCisgICAgICAiLi4uLnguLi4i CisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54Li4uLi4iCisgICAgICAiLi4ueC4uLi4iCisg ICAgICAiLi4uLnguLi4iCisgICAgICAiLi4uLi54Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY19zaW5nbGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHg0LCAweDgsIDB4MTAsIDB4 MjAsIDB4MTAsIDB4OCwgMHg0fTsKKworLyogMzcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFk ZWNpbWFsCisgICAgICAieHgueHguLi4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAiLi54eC54 eC4iCisgICAgICAiLi4ueHgueHgiCisgICAgICAiLi54eC54eC4iCisgICAgICAiLnh4Lnh4Li4i CisgICAgICAieHgueHguLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVf YW5nbGVfcmlnaHRfYml0c1tdID17CisgIDB4ZDgsIDB4NmMsIDB4MzYsIDB4MWIsIDB4MzYsIDB4 NmMsIDB4ZDh9OworCisvKiAzOAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAg ICAgICIuLi54eC54eCIKKyAgICAgICIuLnh4Lnh4LiIKKyAgICAgICIueHgueHguLiIKKyAgICAg ICJ4eC54eC4uLiIKKyAgICAgICIueHgueHguLiIKKyAgICAgICIuLnh4Lnh4LiIKKyAgICAgICIu Li54eC54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV9sZWZ0 X2JpdHNbXSA9eworICAweDFiLCAweDM2LCAweDZjLCAweGQ4LCAweDZjLCAweDM2LCAweDFifTsK KworLyogMzkKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC54Lngu Li4iCisgICAgICAiLngueC54Li4iCisgICAgICAiLi54LngueC4iCisgICAgICAiLi4ueC54Lngi CisgICAgICAiLi54LngueC4iCisgICAgICAiLngueC54Li4iCisgICAgICAieC54LnguLi4iKQor Ki8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfcmlnaHRfYml0c1tdID17 CisgIDB4YTgsIDB4NTQsIDB4MmEsIDB4MTUsIDB4MmEsIDB4NTQsIDB4YTh9OworCisvKiA0MAor ICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi54LngueCIKKyAgICAg ICIuLngueC54LiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICJ4LngueC4uLiIKKyAgICAgICIu eC54LnguLiIKKyAgICAgICIuLngueC54LiIKKyAgICAgICIuLi54LngueCIpCisqLworc3RhdGlj IHVuc2lnbmVkIHNob3J0IG1jX3RyaXBsZV9hbmdsZV9sZWZ0X2JpdHNbXSA9eworICAweDE1LCAw eDJhLCAweDU0LCAweGE4LCAweDU0LCAweDJhLCAweDE1fTsKKworLyogNDEKKyAgICAoKy1mcmlu Z2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4i CisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4iCisg ICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAg ICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAi Li4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfdXBf Yml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MTAsIDB4MjgsIDB4NDQsIDB4 ODIsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9OworCisvKiA0MgorICAgICgrLWZyaW5nZS1oZWxw ZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAg ICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIu eC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4u Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4u LiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3NpbmdsZV9hbmdsZV9kb3duX2JpdHNb XSA9eworICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDgyLCAweDQ0LCAweDI4LCAweDEwLCAw eDAwLCAweDAwLCAweDAwLCAweDAwfTsKKworLyogNDMKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhl eGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4u Li4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54 Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4i CisgICAgICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisg ICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5n bGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MTAsIDB4MjgsIDB4NDQsIDB4 OTIsIDB4MjgsIDB4NDQsIDB4ODIsIDB4MDAsIDB4MDAsIDB4MDB9OworCisvKiA0NAorICAgICgr LWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4u Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLngu LiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIK KyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAg ICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNo b3J0IG1jX2RvdWJsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDAwLCAweDAwLCAweDAwLCAw eDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDEwLCAweDAwLCAweDAwLCAweDAw fTsKKworLyogNDUKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4u Li4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54 Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4i CisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisg ICAgICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY190cmlwbGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4MTAsIDB4MjgsIDB4 NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4ODIsIDB4MDB9OworCisv KiA0NgorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIK KyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAg ICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAg ICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIu Li54Li4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1j X3F1YWRydXBsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDAwLCAweDgyLCAweDQ0LCAweDI4 LCAweDkyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDEwLCAweDAwfTsKKworLyog NDcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4ueC4uLi4iCisg ICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAg ICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAi Li54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54 LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iKQorKi8KK3N0YXRpYyB1 bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVwbGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MTAsIDB4 MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4OTIsIDB4Mj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Nf SU5UIGxuMSA9IDAsIGxuMiA9IDA7CisgIGludCBpeDEgPSByaWdodF9wOworICBpbnQgaXgyID0g aXgxICsgKHBhcnRpYWxfcCA/IDIgOiAwKTsKKyAgaWYgKChjbWFwID0gQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSksICFOSUxQIChjbWFwKSkKKyAg ICB7CisgICAgICBibTEgPSBtY19hc3NxIChiaXRtYXAsIGNtYXApOworICAgICAgaWYgKENPTlNQ IChibTEpKQorICB7CisgICAgaWYgKChibTEgPSBYQ0RSIChibTEpKSwgTklMUCAoYm0xKSkKKyAg ICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICAgIGlmIChDT05TUCAoYm0xKSkKKyAg ICAgIHsKKyAgICAgICAgbG4xID0gWEZJWE5VTSAoRmxlbmd0aCAoYm0xKSk7CisgICAgICAgIGlm IChwYXJ0aWFsX3ApCisgICAgICAgICAgeworICAgICAgICAgICAgaWYgKGxuMSA+IGl4MikKKyAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMSk7Cisg ICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAgIGdvdG8g Zm91bmQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBpZiAobG4xID4gaXgxKQorICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICAgICAg ICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5k OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgIH0KKyAgICBlbHNlIGlm ICgoYm0gPSBibTEsICFFUSAoYm0sIFF0KSkpCisgICAgICBnb3RvIGZvdW5kOworICB9CisgICAg fQorICBpZiAoIUVRIChjbWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNh dG9yX2FsaXN0KSkKKyAgICAgICYmICFOSUxQIChCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmlu Z2VfaW5kaWNhdG9yX2FsaXN0KSkpCisgICAgeworICAgICAgYm0yID0gbWNfYXNzcSAoYml0bWFw LCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSk7CisgICAg ICBpZiAoQ09OU1AgKGJtMikpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoKGJtMiA9IFhDRFIg KGJtMikpLCAhTklMUCAoYm0yKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKENP TlNQIChibTIpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGxuMiA9IFhG SVhOVU0gKEZsZW5ndGggKGJtMikpOworICAgICAgICAgICAgICAgICAgaWYgKHBhcnRpYWxfcCkK KyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGlmIChsbjIgPiBp eDIpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAg IGJtID0gbWNfbnRoIChpeDIsIGJtMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgh RVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAg ICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4 MSkKKyAgICB7CisgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAgICAgaWYgKCFFUSAo Ym0sIFF0KSkKKyAgICAgICAgZ290byBmb3VuZDsKKyAgICB9CisgIGlmIChsbjIgPiBpeDEpCisg ICAgeworICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0yKTsKKyAgICAgIGlmICghRVEgKGJtLCBR dCkpCisgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1B UDsKKyAgICB9CisgICAgZWxzZSBpZiAoKGJtID0gYm0yLCBOSUxQIChibSkpKQorICAgICAgcmV0 dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgIGZvdW5kOgorICByZXR1cm4gbG9va3VwX2ZyaW5n ZV9iaXRtYXAgKGJtKTsKK30KKworc3RhdGljIGludAorbWNfZ2V0X2xvZ2ljYWxfY3Vyc29yX2Jp dG1hcCAoc3RydWN0IHdpbmRvdyAqdywgTGlzcF9PYmplY3QgY3Vyc29yKQoreworICBMaXNwX09i amVjdCBjbWFwLCBibSA9IFFuaWw7CisgIGlmICgoY21hcCA9IEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgZnJpbmdlX2N1cnNvcl9hbGlzdCkpLCAhTklMUCAoY21hcCkpCisgICAgeworICAg ICAgYm0gPSBtY19hc3NxIChjdXJzb3IsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibSkpCisg ICAgICAgIHsKKyAgICAgICAgICBpZiAoKGJtID0gWENEUiAoYm0pKSwgTklMUCAoYm0pKQorICAg ICAgICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgcmV0dXJuIGxv b2t1cF9mcmluZ2VfYml0bWFwIChibSk7CisgICAgICAgIH0KKyAgICB9CisgIGlmIChFUSAoY21h cCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2N1cnNvcl9hbGlzdCkpKQorICAgIHJl dHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICBibSA9IG1jX2Fzc3EgKGN1cnNvciwg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4KKyAgICAgSWYgbm90IHBhcnRpYWwsIG9yIG5vIHBhcnRpYWwgc3Bl YyBpcyBwcmVzZW50LCB1c2Ugbm9uLXBhcnRpYWwgYml0bWFwLiAqLworICBpZiAoKGNtYXAgPSBC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKSwgIU5J TFAgKGNtYXApKQorICAgIHsKKyAgICAgIGJtMSA9IG1jX2Fzc3EgKGJpdG1hcCwgY21hcCk7Cisg ICAgICBpZiAoQ09OU1AgKGJtMSkpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoKGJtMSA9IFhD RFIgKGJtMSkpLCBOSUxQIChibTEpKQorICAgICAgICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9C SVRNQVA7CisgICAgICAgICAgaWYgKENPTlNQIChibTEpKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBsbjEgPSBYRklYTlVNIChGbGVuZ3RoIChibTEpKTsKKyAgICAgICAgICAgICAgaWYg KHBhcnRpYWxfcCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAobG4x ID4gaXgyKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgYm0g PSBtY19udGggKGl4MiwgYm0xKTsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwg UXQpKQorICAgICAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChsbjEgPiBpeDEpCisgICAgICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgYm0gPSBtY19udGggKGl4 MSwgYm0xKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAg ICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBp ZiAoKGJtID0gYm0xLCAhRVEgKGJtLCBRdCkpKQorICAgICAgICAgICAgICBnb3RvIGZvdW5kOwor ICAgICAgICB9CisgICAgfQorICBpZiAoIUVRIChjbWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRz LCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkKKyAgICAgICYmICFOSUxQIChCVkFSICgmYnVmZmVy X2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkpCisgICAgeworICAgICAgYm0yID0g bWNfYXNzcSAoYml0bWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9y X2FsaXN0KSk7CisgICAgICBpZiAoQ09OU1AgKGJtMikpCisgICAgICAgIHsKKyAgICAgICAgICBp ZiAoKGJtMiA9IFhDRFIgKGJtMikpLCAhTklMUCAoYm0yKSkKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgaWYgKENPTlNQIChibTIpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgIGxuMiA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMikpOworICAgICAgICAgICAgICAgICAg aWYgKHBhcnRpYWxfcCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ICAgIGlmIChsbjIgPiBpeDIpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMik7CisgICAgICAgICAgICAgICAg ICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg Z290byBmb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0K KyAgaWYgKGxuMSA+IGl4MSkKKyAgICB7CisgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOwor ICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgZ290byBmb3VuZDsKKyAgICB9CisgIGlm IChsbjIgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0yKTsKKyAgICAg IGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICByZXR1cm4gTUNf Tk9fRlJJTkdFX0JJVE1BUDsKKyAgICB9CisgICAgZWxzZSBpZiAoKGJtID0gYm0yLCBOSUxQIChi bSkpKQorICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgIGZvdW5kOgorICByZXR1 cm4gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJtKTsKK30KKworLyogUmVjYWxjdWxhdGUgdGhlIGJp dG1hcHMgdG8gc2hvdyBpbiB0aGUgZnJpbmdlcyBvZiB3aW5kb3cgVy4KKyAgIE9ubHkgbWFyayBy b3dzIHdpdGggbW9kaWZpZWQgYml0bWFwcyBmb3IgdXBkYXRlIGluIHJlZHJhd19mcmluZ2VfYml0 bWFwc19wLgorICAgSWYgS0VFUF9DVVJSRU5UX1AgaXMgMCwgdXBkYXRlIGN1cnJlbnRfbWF0cml4 IHRvby4gKi8KK2Jvb2wKK21jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAoc3RydWN0IHdpbmRvdyAq dywgYm9vbCBrZWVwX2N1cnJlbnRfcCkKK3sKKyAgc3RydWN0IGdseXBoX3JvdyAqcm93LCAqY3Vy ID0gMDsKKyAgaW50IHliID0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpOworICBpbnQgcm4sIG5y b3dzID0gdy0+Y3VycmV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xQIChpbmQpKSkKKyAgICB7Cisg ICAgICBpZiAoRVEgKGluZCwgUWxlZnQpIHx8IEVRIChpbmQsIFFyaWdodCkpCisgICAgICAgIGJv dW5kYXJ5X3RvcCA9IGJvdW5kYXJ5X2JvdCA9IGFycm93X3RvcCA9IGFycm93X2JvdCA9IGluZDsK KyAgICAgICAgZWxzZSBpZiAoQ09OU1AgKGluZCkKKyAgICAgICAgICAgICAgICAgJiYgQ09OU1Ag KFhDQVIgKGluZCkpKQorICAgICAgICB7CisgICAgICAgICAgTGlzcF9PYmplY3QgcG9zOworICAg ICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRdCwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAg ICAgICBib3VuZGFyeV90b3AgPSBib3VuZGFyeV9ib3QgPSBhcnJvd190b3AgPSBhcnJvd19ib3Qg PSBYQ0RSIChwb3MpOworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRdG9wLCBpbmQpLCAh TklMUCAocG9zKSkKKyAgICAgICAgICAgIGJvdW5kYXJ5X3RvcCA9IFhDRFIgKHBvcyk7CisgICAg ICAgICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFFib3R0b20sIGluZCksICFOSUxQIChwb3MpKQorICAg ICAgICAgICAgYm91bmRhcnlfYm90ID0gWENEUiAocG9zKTsKKyAgICAgICAgICBpZiAocG9zID0g bWNfYXNzcSAoUXVwLCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAgIGFycm93X3RvcCA9 IFhDRFIgKHBvcyk7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFFkb3duLCBpbmQpLCAh TklMUCAocG9zKSkKKyAgICAgICAgICAgIGFycm93X2JvdCA9IFhDRFIgKHBvcyk7CisgICAgICAg IH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIC8qIEFueXRoaW5nIGVsc2UgbWVhbnMgYm91bmRh cnkgb24gbGVmdCBhbmQgbm8gYXJyb3dzLiAqLworICAgICAgICAgIGJvdW5kYXJ5X3RvcCA9IGJv dW5kYXJ5X2JvdCA9IFFsZWZ0OworICAgIH0KKyAgdG9wX2luZF9ybiA9IGJvdF9pbmRfcm4gPSAt MTsKKyAgaWYgKCFOSUxQIChpbmQpKQorICAgIHsKKyAgICAgIGZvciAoeSA9IHctPnZzY3JvbGws IHJuID0gMDsKKyAgICAgICAgICAgeSA8IHliICYmIHJuIDwgbnJvd3M7CisgICAgICAgICAgIHkg Kz0gcm93LT5oZWlnaHQsICsrcm4pCisgICAgICAgIHsKKyAgICAgICAgICByb3cgPSB3LT5kZXNp cmVkX21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisg ICAgICAgICAgICByb3cgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAg IHJvdy0+aW5kaWNhdGVfYm9iX3AgPSByb3ctPmluZGljYXRlX3RvcF9saW5lX3AgPSAwOworICAg ICAgICAgIHJvdy0+aW5kaWNhdGVfZW9iX3AgPSByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3Ag PSAwOworICAgICAgICAgIGlmICghcm93LT5tb2RlX2xpbmVfcCkKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgaWYgKHRvcF9pbmRfcm4gPCAwICYmIHJvdy0+dmlzaWJsZV9oZWlnaHQgPiAw KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChNQVRSSVhfUk9XX1NU QVJUX0NIQVJQT1MgKHJvdykgPD0gQlVGX0JFR1YgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSkKKyAg ICAgICAgICAgICAgICAgICAgICAmJiAhTUFUUklYX1JPV19QQVJUSUFMTFlfVklTSUJMRV9BVF9U T1BfUCAodywgcm93KSkKKyAgICAgICAgICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib2JfcCA9 ICFOSUxQIChib3VuZGFyeV90b3ApOworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV90b3BfbGluZV9wID0gIU5JTFAgKGFycm93X3Rv cCk7CisgICAgICAgICAgICAgICAgICB0b3BfaW5kX3JuID0gcm47CisgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICBpZiAoYm90X2luZF9ybiA8IDApCisgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgPj0gQlVG X1pWIChYQlVGRkVSICh3LT5jb250ZW50cykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU1B VFJJWF9ST1dfUEFSVElBTExZX1ZJU0lCTEVfQVRfQk9UVE9NX1AgKHcsIHJvdykpCisgICAgICAg ICAgICAgICAgICAgIHJvdy0+aW5kaWNhdGVfZW9iX3AgPSAhTklMUCAoYm91bmRhcnlfYm90KSwg Ym90X2luZF9ybiA9IHJuOworICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh5ICsgcm93LT5o ZWlnaHQgPj0geWIpCisgICAgICAgICAgICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib3R0b21f bGluZV9wID0gIU5JTFAgKGFycm93X2JvdCksIGJvdF9pbmRfcm4gPSBybjsKKyAgICAgICAgICAg ICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGVtcHR5X3BvcyA9IEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgaW5kaWNhdGVfZW1wdHlfbGluZXMpOworICBpZiAo IU5JTFAgKGVtcHR5X3BvcykgJiYgIUVRIChlbXB0eV9wb3MsIFFyaWdodCkpCisgICAgZW1wdHlf cG9zID0gV0lORE9XX0xFRlRfRlJJTkdFX1dJRFRIICh3KSA9PSAwID8gUXJpZ2h0IDogUWxlZnQ7 CisgIGZvciAoeSA9IDA7IHkgPCBNQVhfQklUTUFQX0NBQ0hFOyB5KyspCisgICAgYml0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9ybjsKKyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgIHJvdyA9IHct PmN1cnJlbnRfbWF0cml4LT5yb3dzICsgdG9wX2luZF9ybjsKKyAgICAgIHRvcF9yb3dfZW5kc19h dF96dl9wID0gcm93LT5lbmRzX2F0X3p2X3A7CisgICAgICBpZiAocm93LT5pbmRpY2F0ZV9ib2Jf cCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChFUSAoYm91bmRhcnlfdG9wLCBRbGVmdCkpCisg ICAgICAgICAgICBibiA9ICgocm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90 LCBRbGVmdCkpCisgICAgICAgICAgICAgICAgICA/IE1DX0xFRlRfRlJJTkdFICgxLCBRdG9wX2Jv dHRvbSwgcm93LT5lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgICAgICA6IE1DX0xFRlRfRlJJ TkdFICgyLCBRdG9wLCAwKSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGJuID0g KChyb3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFyaWdodCkpCisgICAg ICAgICAgICAgICAgICAgID8gTUNfUklHSFRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwgcm93LT5l bmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgICAgICAgIDogTUNfUklHSFRfRlJJTkdFICgyLCBR dG9wLCAwKSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3Bf bGluZV9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChFUSAoYXJyb3dfdG9wLCBRbGVm dCkpCisgICAgICAgICAgICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAg ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBibiA9IE1DX1JJR0hUX0ZSSU5HRSAoNiwg UXVwLCAwKTsKKyAgICAgICAgICB9CisgICAgICBpZiAoYm4gIT0gTUNfTk9fRlJJTkdFX0JJVE1B UCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBmcmluZ2VfYml0bWFwICpmYiA9IGdldF9m cmluZ2VfYml0bWFwX2RhdGEgKGJuKTsKKyAgICAgICAgICBpZiAoZmItPmFsaWduID09IEFMSUdO X0JJVE1BUF9UT1AgJiYgZmItPnBlcmlvZCA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cxOworICAgICAgICAgICAgICBpbnQgdG9wX2luZF9t YXhfeTsKKyAgICAgICAgICAgICAgdG9wX2luZF9taW5feSA9IFdJTkRPV19IRUFERVJfTElORV9I RUlHSFQgKHcpOworICAgICAgICAgICAgICB0b3BfaW5kX21heF95ID0gdG9wX2luZF9taW5feSAr IGZiLT5oZWlnaHQ7CisgICAgICAgICAgICAgIGlmICh0b3BfaW5kX21heF95ID4geWIpCisgICAg ICAgICAgICAgICAgdG9wX2luZF9tYXhfeSA9IHliOworICAgICAgICAgICAgICBmb3IgKHkgPSBy b3ctPnkgKyByb3ctPmhlaWdodCwgcm4gPSB0b3BfaW5kX3JuICsgMTsKKyAgICAgICAgICAgICAg ICAgICB5IDwgdG9wX2luZF9tYXhfeSAmJiBybiA8IG5yb3dzOworICAgICAgICAgICAgICAgICAg IHkgKz0gcm93MS0+aGVpZ2h0LCBybisrKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgIGlmIChib3RfaW5kX3JuID49IDAgJiYgcm4gPj0gYm90X2luZF9ybikKKyAgICAgICAg ICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICByb3cxID0gdy0+ZGVzaXJlZF9t YXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICAgICAgICAgIGlmICghcm93MS0+ZW5hYmxlZF9w KQorICAgICAgICAgICAgICAgICAgICByb3cxID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBy bjsKKyAgICAgICAgICAgICAgICAgIHJvdzEtPmluZGljYXRlX2JvYl9wID0gcm93LT5pbmRpY2F0 ZV9ib2JfcDsKKyAgICAgICAgICAgICAgICAgIHJvdzEtPmluZGljYXRlX3RvcF9saW5lX3AgPSBy b3ctPmluZGljYXRlX3RvcF9saW5lX3A7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg fQorICAgICAgICB9CisgICAgfQorICBpZiAoYm90X2luZF9ybiA+PSAwKQorICAgIHsKKyAgICAg IGludCBibiA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICByb3cgPSB3LT5kZXNpcmVkX21h dHJpeC0+cm93cyArIGJvdF9pbmRfcm47CisgICAgICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAg ICAgICByb3cgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIGJvdF9pbmRfcm47CisgICAgICBi b3Rfcm93X2VuZHNfYXRfenZfcCA9IHJvdy0+ZW5kc19hdF96dl9wOworICAgICAgaWYgKHJvdy0+ aW5kaWNhdGVfZW9iX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoRVEgKGJvdW5kYXJ5X2Jv dCwgUWxlZnQpKQorICAgICAgICAgICAgYm4gPSBNQ19MRUZUX0ZSSU5HRSAoMywgUWJvdHRvbSwg cm93LT5lbmRzX2F0X3p2X3ApOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBibiA9 IE1DX1JJR0hUX0ZSSU5HRSAoMywgUWJvdHRvbSwgcm93LT5lbmRzX2F0X3p2X3ApOworICAgICAg ICB9CisgICAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCkKKyAgICAg ICAgICB7CisgICAgICAgICAgICBpZiAoRVEgKGFycm93X2JvdCwgUWxlZnQpKQorICAgICAgICAg ICAgICBibiA9IE1DX0xFRlRfRlJJTkdFICg3LCBRZG93biwgMCk7CisgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICBibiA9IE1DX1JJR0hUX0ZSSU5HRSAoNywgUWRvd24sIDApOwor ICAgICAgICAgIH0KKyAgICAgIGlmIChibiAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAg ICB7CisgICAgICAgICAgc3RydWN0IGZyaW5nZV9iaXRtYXAgKmZiID0gZ2V0X2ZyaW5nZV9iaXRt YXBfZGF0YSAoYm4pOworICAgICAgICAgIGlmIChmYi0+YWxpZ24gPT0gQUxJR05fQklUTUFQX0JP VFRPTSAmJiBmYi0+cGVyaW9kID09IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHN0 cnVjdCBnbHlwaF9yb3cgKnJvdzE7CisgICAgICAgICAgICAgIGludCBib3RfaW5kX21pbl95Owor ICAgICAgICAgICAgICBib3RfaW5kX21heF95ID0gcm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdo dDsKKyAgICAgICAgICAgICAgYm90X2luZF9taW5feSA9IGJvdF9pbmRfbWF4X3kgLSBmYi0+aGVp Z2h0OworICAgICAgICAgICAgICBpZiAoYm90X2luZF9taW5feSA8IFdJTkRPV19IRUFERVJfTElO RV9IRUlHSFQgKHcpKQorICAgICAgICAgICAgICAgIGJvdF9pbmRfbWluX3kgPSBXSU5ET1dfSEVB REVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgICAgICAgICAgZm9yICh5ID0gcm93LT55LCBybiA9 IGJvdF9pbmRfcm4gLSAxOworICAgICAgICAgICAgICAgICAgIHkgPj0gYm90X2luZF9taW5feSAm JiBybiA+PSAwOworICAgICAgICAgICAgICAgICAgIHkgLT0gcm93MS0+aGVpZ2h0LCBybi0tKQor ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmICh0b3BfaW5kX3JuID49IDAg JiYgcm4gPD0gdG9wX2luZF9ybikKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAg ICAgICAgICAgICByb3cxID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAg ICAgICAgICAgIGlmICghcm93MS0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgICAgICAgICByb3cx ID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICAgICAgICAgIHJvdzEt PmluZGljYXRlX2VvYl9wID0gcm93LT5pbmRpY2F0ZV9lb2JfcDsKKyAgICAgICAgICAgICAgICAg IHJvdzEtPmluZGljYXRlX2JvdHRvbV9saW5lX3AgPSByb3ctPmluZGljYXRlX2JvdHRvbV9saW5l X3A7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQor ICBib29sIGF1dG9faHNjcm9sbF9tb2RlX3AgPSBFUSAoRmJ1ZmZlcl9sb2NhbF92YWx1ZSAoUWF1 dG9faHNjcm9sbF9tb2RlLCB3LT5jb250ZW50cyksIFFjdXJyZW50X2xpbmUpOworICAvKiBFWEFN UExFOiAgKHNjcm9sbC1sZWZ0IDUpICovCisgIGJvb2wgaHNjbF9hbGxfdGVtcF9wID0gKHctPnN1 c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNj cm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAK KyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8q IEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIG5vdGhpbmcuICovCisgIGJvb2wgaHNjbF9hbGxf cGVybV8wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5t aW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNj cm9sbCA9PSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gc29t ZXRoaW5nIGVsc2UgYmVzaWRlcyBob3Jpem9udGFsbHkgc2Nyb2xsaW5nIHRoZQorICAgICAgICAg ICAgICAgY3VycmVudCBsaW5lIGRpZmZlcmVudGx5LgorICAgICAgICAgICAgICAgQ3VycmVudCBs aW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4gKi8KKyAgYm9v bCBoc2NsX2FsbF9wZXJtXzFfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5taW5faHNjcm9sbCA9PSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXgg PCBhbmQgLi4uCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRh bGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMl9wID0g KCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5o c2Nyb2xsID09IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9s bCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCAhPSB3 LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwtbGVmdCA1KTsgYW5kLCB0aGVuIHBy ZXNzIHRoZSBsZWZ0IGFycm93IGtleSBvbmUgdGltZS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQg bGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4qLworICBib29sIGhz Y2xfdGVtcF9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAg ICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5o c2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IDAp OworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgdGhhdCBjYXVzZXMg dGhlIGN1cnJlbnQgbGluZSB0byBiZQorICAgICAgICAgICAgICAgaG9yaXpvbnRhbGx5IHNjcm9s bGVkIGRpZmZlcmVudGx5LgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpv bnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfcGVybV9wID0gKCF3 LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNj cm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAg ICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAg ICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICBzdH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jYWNoZV90 eXBlID0gQ0hfQ0FDSEU7CisgIGZvciAoaW50IG50aCA9IDA7CisgICAgICAgbWNfdHJhdmVyc2Vf Y2FjaGVfcCAody0+bWNfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoX2NtLCBudGgpOworICAgICAg ICsrbnRoKQorICAgIHsKKyAgICAgIC8vICBpbnQgeCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhf Y21dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueDsKKyAgICAgIC8vICBpbnQgZnggPSB3LT5tY19t YXRyaXgudnBvc1t2bnRoX2NtXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZ4OworICAgICAgLy8g IGludCB5ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF9jbV0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XS55OworICAgICAgLy8gIGludCBmeSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhfY21dLmNhY2hl W2NhY2hlX3R5cGVdW250aF0uZnk7CisgICAgICAvLyAgaW50IGhwb3MgPSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoX2NtXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmhwb3M7CisgICAgICBpbnQgdnBv cyA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhfY21dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0udnBv czsKKyAgICAgIC8vICBpbnQgd2QgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoX2NtXS5jYWNoZVtj YWNoZV90eXBlXVtudGhdLndkOworICAgICAgLy8gIGludCBoID0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF9jbV0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5oOworICAgICAgZW51bSBtY19jdXJzb3Jf dHlwZSBjdXJzb3JfdHlwZSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhfY21dLmNhY2hlW2NhY2hl X3R5cGVdW250aF0uY3Vyc29yX3R5cGU7CisgICAgICAvLy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dHJpeC52cG9zW3ZudGhfY21dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGhfZmxh dm9yOworICAgICAgYm9vbCBlbmFibGVkX3AgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoX2NtXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmVuYWJsZWRfcDsKKyAgICAgIGlmICgodnBvcyA9PSB2bnRo X2RtIHx8IHZwb3MgPT0gdm50aF9jbSkKKyAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNf T1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICAgICAmJiAhaHNjbF9hbGxfdGVtcF9wCisgICAg ICAgICAgJiYgIWhzY2xfdGVtcF9wCisgICAgICAgICAgJiYgIWhzY2xfcGVybV9wCisgICAgICAg ICAgJiYgIWhzY2xfYWxsX3Blcm1fMF9wCisgICAgICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMV9w CisgICAgICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMl9wCisgICAgICAgICAgJiYgZW5hYmxlZF9w KQorICAgICAgICB7CisgICAgICAgICAgaW50IGZyaW5nZV9iaXRtYXAgPSBNQ19OT19GUklOR0Vf QklUTUFQOworICAgICAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQgPQor ICAgICAgICAgICAgKCFhY3RpdmVfcAorICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICAgID8g bG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWluYWN0 aXZlLXByZS16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0cnVlKQorICAgICAgICAgICAgOiAo YWN0aXZlX3ApCisgICAgICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1vdmVybGF5LWFycm93LXByZS16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0cnVl KQorICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgbWNfbGVmdF9mcmlu Z2VfZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG92ZXJsYXlfYXJyb3dfZmFjZV9pZAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7Cisg ICAgICAgICAgaWYgKHctPmhzY3JvbGwgIT0gMCkKKyAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAg PSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1vdmVybGF5LWFycm93IiksIGZh bHNlLCB0cnVlKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgZnJpbmdlX2JpdG1h cCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ciKSwg dHJ1ZSwgdHJ1ZSk7CisgICAgICAgICAgbWNfbGVmdF9mcmluZ2VfYml0bWFwID0gKGN1cnNvcl90 eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBmcmluZ2VfYml0bWFwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmICgo dnBvcyA9PSB2bnRoX2RtIHx8IHZwb3MgPT0gdm50aF9jbSkKKyAgICAgICAgICAgICAgICAgJiYg Z2x5cGhfZmxhdm9yID09IE1DX09WRVJMQVlfQVJST1dfQklUTUFQCisgICAgICAgICAgICAgICAg ICYmIChoc2NsX2FsbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Bl cm1fMF9wCisgICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzFfcAorICAgICAg ICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8yX3AKKyAgICAgICAgICAgICAgICAgICAg IHx8IGhzY2xfdGVtcF9wCisgICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX3Blcm1fcCkKKyAg ICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGlu dCBmcmluZ2VfYml0bWFwID0gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICAgIGVudW0g ZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQgPQorICAgICAgICAgICAgICAoIWFjdGl2ZV9w CisgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj aF9pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAgICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5hY3RpdmUtcHJlLXp2LWZh Y2UiKSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisgICAgICAgICAgICAgIDogKGFjdGl2ZV9wKQor ICAgICAgICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1v dmVybGF5LWFycm93LWhzY2wtcHJlLXp2LWZhY2UiKSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisg ICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgICAgbWNfbGVmdF9mcmlu Z2VfZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lk CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lE OworICAgICAgICAgICAgaWYgKGhzY2xfYWxsX3Blcm1fMF9wKQorICAgICAgICAgICAgICBmcmlu Z2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJt IiksIGZhbHNlLCBmYWxzZSk7CisgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1f MV9wKQorICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1h cCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1ZSwgZmFsc2UpOworICAgICAgICAgICAg ICAgIGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMl9wKQorICAgICAgICAgICAgICAgICAgZnJpbmdl X2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIp LCBmYWxzZSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX3Blcm1fcCkK KyAgICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFw ICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCB0cnVlLCB0cnVlKTsKKyAgICAgICAgICAgICAg ICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfdGVtcF9wKQorICAgICAgICAgICAgICAgICAgICAgIGZy aW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXRl bXAiKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2Ns X3RlbXBfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRf ZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXRlbXAiKSwgdHJ1ZSwgZmFsc2UpOwor ICAgICAgICAgICAgbWNfbGVmdF9mcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09IE1DX0xF RlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1D X05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKCh2cG9z ID09IHZudGhfZG0gfHwgdnBvcyA9PSB2bnRoX2NtKQorICAgICAgICAgICAgICAgICAgICAmJiAo Z2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAg ICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVD VEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2 b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRQorICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5 cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAg ICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdI VF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZF UlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1D X1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhf Zmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gpCisgICAgICAgICAgICAgICAgICAg ICYmIGVuYWJsZWRfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgTGlzcF9PYmplY3Qg Yml0bWFwX2ZsYXZvciA9IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdI VF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1j X2hvbGxvd19yZWN0YW5nbGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVD VEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IFFtY19yZXZlcnNlZF9ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0g TUNfSE9MTE9XX1JFQ1RBTkdMRSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBRbWNfaG9sbG93X3JlY3RhbmdsZQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdI VF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBR bWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IFFtY19yZXZlcnNlZF92ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNB TF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1j X3ZlcnRpY2FsX2JhcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxf YmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9m bGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBRbmlsOworICAgICAgICAg ICAgICBtY19yaWdodF9mcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZS SU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBs b29rdXBfZnJpbmdlX2JpdG1hcCAoYml0bWFwX2ZsYXZvcikKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgICAg IG1jX3JpZ2h0X2ZyaW5nZV9mYWNlX2lkID0KKyAgICAgICAgICAgICAgICAoY3Vyc29yX3R5cGUg PT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRp b24gPT0gUFJFX1pWCisgICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfUkVW RVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAg fHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVwor ICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJ Q0FMX0JBUikpCisgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2UgKHcsIGYs IGludGVybiAoIistcmV2ZXJzZWQtYmFyLXByZS16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0 cnVlKQorICAgICAgICAgICAgICAgIDogKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9C SVRNQVAKKyAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gQVRfWlYKKyAgICAg ICAgICAgICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNU QU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9y ID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAg ICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKSkKKyAg ICAgICAgICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1y ZXZlcnNlZC1iYXItYXQtenYtZmFjZSIpLCBGUklOR0VfRkFDRV9JRCwgdHJ1ZSkKKyAgICAgICAg ICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAg ICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBPU1RfWlYKKyAgICAgICAgICAgICAgICAg ICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRf QVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVS U0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICB8fCBn bHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKSkKKyAgICAgICAgICAgICAg ICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1iYXIt cG9zdC16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0cnVlKQorICAgICAgICAgICAgICAgIDog KGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAg ICAmJiByb3dfcG9zaXRpb24gPT0gUFJFX1pWCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhf Zmxhdm9yICE9IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAg ICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JF VkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRf ZmFjZSAodywgZiwgaW50ZXJuICgiKy1iYXItcHJlLXp2LWZhY2UiKSwgRlJJTkdFX0ZBQ0VfSUQs IHRydWUpCisgICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdF X0JJVE1BUAorICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBBVF9aVgorICAg ICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVD VEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9 IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAg ICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAg ICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistYmFyLWF0LXp2 LWZhY2UiKSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisgICAgICAgICAgICAgICAgOiAoY3Vyc29y X3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgICYmIHJv d19wb3NpdGlvbiA9PSBQT1NUX1pWCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9y ICE9IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAg ICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hU X0FSUk9XCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JF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9IE1DX0xFRlRfRlJJTkdFICgwLCBRdHJ1bmNh dGlvbiwgMCk7CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2JvYl9wICYmIEVRIChib3Vu ZGFyeV90b3AsIFFsZWZ0KSkKKyAgICAgICAgeworICAgICAgICAgIGxlZnQgPSAoKHJvdy0+aW5k aWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQpKQorICAgICAgICAgICAgICAg ICA/IE1DX0xFRlRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwgdG9wX3Jvd19lbmRzX2F0X3p2X3Ap CisgICAgICAgICAgICAgICAgIDogTUNfTEVGVF9GUklOR0UgKDIsIFF0b3AsIDApKTsKKyAgICAg ICAgICBpZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAgICAgICAgbGVmdF9vZmZzZXQgPSB0 b3BfaW5kX21pbl95IC0gcm93LT55OworICAgICAgICB9CisgICAgICBlbHNlIGlmIChyb3ctPmlu ZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFsZWZ0KSkKKyAgICAgICAgeworICAg ICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoMywgUWJvdHRvbSwgYm90X3Jvd19lbmRzX2F0 X3p2X3ApOworICAgICAgICAgIGlmIChib3RfaW5kX21heF95ID49IDApCisgICAgICAgICAgICBs ZWZ0X29mZnNldCA9IGJvdF9pbmRfbWF4X3kgLSAocm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdo dCk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKCghcm93LT5yZXZlcnNlZF9wICYmIE1BVFJJ WF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAocm93KSkKKyAgICAgICAgICAgICAgIHx8IChyb3ct PnJldmVyc2VkX3AgJiYgcm93LT5jb250aW51ZWRfcCkpCisgICAgICAgIGxlZnQgPSBNQ19MRUZU X0ZSSU5HRSAoNCwgUWNvbnRpbnVhdGlvbiwgMCk7CisgICAgICBlbHNlIGlmIChyb3ctPmluZGlj YXRlX2VtcHR5X2xpbmVfcCAmJiBFUSAoZW1wdHlfcG9zLCBRbGVmdCkpCisgICAgICAgIGxlZnQg PSBNQ19MRUZUX0ZSSU5HRSAoNSwgUWVtcHR5X2xpbmUsIDApOworICAgICAgZWxzZSBpZiAocm93 LT5pbmRpY2F0ZV90b3BfbGluZV9wICYmIEVRIChhcnJvd190b3AsIFFsZWZ0KSkKKyAgICAgICAg eworICAgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAg ICBpZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAgICAgICAgbGVmdF9vZmZzZXQgPSB0b3Bf aW5kX21pbl95IC0gcm93LT55OworICAgICAgICB9CisgICAgICBlbHNlIGlmIChyb3ctPmluZGlj YXRlX2JvdHRvbV9saW5lX3AgJiYgRVEgKGFycm93X2JvdCwgUWxlZnQpKQorICAgICAgICB7Cisg ICAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg3LCBRZG93biwgMCk7CisgICAgICAgICAg aWYgKGJvdF9pbmRfbWF4X3kgPj0gMCkKKyAgICAgICAgICAgIGxlZnRfb2Zmc2V0ID0gYm90X2lu ZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgfQorICAg ICAgZWxzZQorICAgICAgICBsZWZ0ID0gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgIC8qIERl Y2lkZSB3aGljaCBiaXRtYXAgdG8gZHJhdyBpbiB0aGUgcmlnaHQgZnJpbmdlLiAqLworICAgICAg aWYgKFdJTkRPV19SSUdIVF9GUklOR0VfV0lEVEggKHcpID09IDApCisgICAgICAgIHJpZ2h0ID0g TUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgIGVsc2UgaWYgKHJvdy0+cmlnaHRfdXNlcl9mcmlu Z2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHsKKyAgICAgICAgICBy aWdodCA9IHJvdy0+cmlnaHRfdXNlcl9mcmluZ2VfYml0bWFwOworICAgICAgICAgIHJpZ2h0X2Zh Y2VfaWQgPSByb3ctPnJpZ2h0X3VzZXJfZnJpbmdlX2ZhY2VfaWQ7CisgICAgICAgIH0KKyAgICAg IGVsc2UgaWYgKCghcm93LT5yZXZlcnNlZF9wICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3Ap CisgICAgICAgICAgICAgICB8fCAocm93LT5yZXZlcnNlZF9wICYmIHJvdy0+dHJ1bmNhdGVkX29u X2xlZnRfcCkpCisgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICgwLCBRdHJ1bmNhdGlv biwgMCk7CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2JvYl9wICYmIEVRIChib3VuZGFy eV90b3AsIFFyaWdodCkpCisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9ICgocm93LT5pbmRp Y2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICAgICAgID8g TUNfUklHSFRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwgdG9wX3Jvd19lbmRzX2F0X3p2X3ApCisg ICAgICAgICAgICAgOiBNQ19SSUdIVF9GUklOR0UgKDIsIFF0b3AsIDApKTsKKyAgICAgICAgICBp ZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2lu ZF9taW5feSAtIHJvdy0+eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0 ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICB7CisgICAgICAg ICAgcmlnaHQgPSBNQ19SSUdIVF9GUklOR0UgKDMsIFFib3R0b20sIGJvdF9yb3dfZW5kc19hdF96 dl9wKTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAgICAgICAgICAgcmln aHRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0 KTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgcm93LT5j b250aW51ZWRfcCkKKyAgICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgTUFUUklY X1JPV19DT05USU5VQVRJT05fTElORV9QIChyb3cpKSkKKyAgICAgICAgcmlnaHQgPSBNQ19SSUdI VF9GUklOR0UgKDQsIFFjb250aW51YXRpb24sIDApOworICAgICAgZWxzZSBpZiAocm93LT5pbmRp Y2F0ZV90b3BfbGluZV9wICYmIEVRIChhcnJvd190b3AsIFFyaWdodCkpCisgICAgICAgIHsKKyAg ICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICBp ZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2lu ZF9taW5feSAtIHJvdy0+eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0 ZV9ib3R0b21fbGluZV9wICYmIEVRIChhcnJvd19ib3QsIFFyaWdodCkpCisgICAgICAgIHsKKyAg ICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAg IGlmIChib3RfaW5kX21heF95ID49IDApCisgICAgICAgICAgICByaWdodF9vZmZzZXQgPSBib3Rf aW5kX21heF95IC0gKHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgICAgICB9Cisg ICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VtcHR5X2xpbmVfcCAmJiB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ICAgICAgcmVkcmF3X3AgPSAxLCByb3ctPnJlZHJhd19mcmlu Z2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgICBpZiAoIWtlZXBfY3VycmVudF9wKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gMTsK KyAgICAgICAgICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0Vf QklUTUFQCisgICAgICAgICAgICAgICAgICB8fCBtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1D X05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5mcmluZ2VfYml0bWFwX3Bl cmlvZGljX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg ICBjdXItPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IHBlcmlvZGljX3A7CisgICAgICAgICAg ICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAg ICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX2JpdG1hcCA9IG1jX2xlZnRfZnJpbmdlX2Jp dG1hcDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRf ZnJpbmdlX2JpdG1hcCA9IGxlZnQ7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9i aXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPmxlZnRf ZnJpbmdlX2ZhY2VfaWQgPSBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2VfZmFjZV9pZCA9IGxlZnRf ZmFjZV9pZDsKKyAgICAgICAgICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19O T19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2Vfb2Zmc2V0 ID0gMDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRf ZnJpbmdlX29mZnNldCA9IGxlZnRfb2Zmc2V0OworICAgICAgICAgICAgICBpZiAobWNfcmlnaHRf ZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1 ci0+cmlnaHRfZnJpbmdlX2JpdG1hcCA9IG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXA7CisgICAgICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfYml0bWFw ID0gcmlnaHQ7CisgICAgICAgICAgICAgIGlmIChtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1D X05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfZmFj ZV9pZCA9IG1jX3JpZ2h0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQgPSByaWdodF9mYWNlX2lk OworICAgICAgICAgICAgICBpZiAobWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklO R0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldCA9IDA7 CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmlu Z2Vfb2Zmc2V0ID0gcmlnaHRfb2Zmc2V0OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAg ICBpZiAocm93LT5vd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sKKyAgaWYgKHdoaWNoICE9IE1DX05P X0ZSSU5HRV9CSVRNQVApCisgICAgeworICAgICAgb2Zmc2V0ID0gMDsKKyAgICB9CisgICAgZWxz ZSBpZiAobGVmdF9wKQorICAgICAgeworICAgICAgICB3aGljaCA9IHJvdy0+bGVmdF9mcmluZ2Vf Yml0bWFwOworICAgICAgICBmYWNlX2lkID0gcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkOworICAg ICAgICBvZmZzZXQgPSByb3ctPmxlZnRfZnJpbmdlX29mZnNldDsKKyAgICAgIH0KKyAgICAgIGVs c2UKKyAgICAgICAgeworICAgICAgICAgIHdoaWNoID0gcm93LT5yaWdodF9mcmluZ2VfYml0bWFw OworICAgICAgICAgIGZhY2VfaWQgPSByb3ctPnJpZ2h0X2ZyaW5nZV9mYWNlX2lkOworICAgICAg ICAgIG9mZnNldCA9IHJvdy0+cmlnaHRfZnJpbmdlX29mZnNldDsKKyAgICAgICAgfQorICBpZiAo ZmFjZV9pZCA9PSBERUZBVUxUX0ZBQ0VfSUQpCisgICAgeworICAgICAgTGlzcF9PYmplY3QgZmFj ZSA9IGZyaW5nZV9mYWNlc1t3aGljaF07CisgICAgICBmYWNlX2lkID0gTklMUCAoZmFjZSkgPyBs b29rdXBfbmFtZWRfZmFjZSAodywgZiwgUWZyaW5nZSwgZmFsc2UpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBsb29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBmYWNlLCBGUklOR0VfRkFD RV9JRCwgMCk7CisgICAgICBpZiAoZmFjZV9pZCA8IDApCisgICAgICAgIGZhY2VfaWQgPSBGUklO R0VfRkFDRV9JRDsKKyAgICB9CisgIGZiID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAod2hpY2gp OworICBwZXJpb2QgPSBmYi0+cGVyaW9kOworICAvKiBDb252ZXJ0IHJvdyB0byBmcmFtZSBjb29y ZGluYXRlcy4gKi8KKyAgcC55ID0gV0lORE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ICB0aGUgZnJp bmdlLiAqLworICBwLmJ4ID0gLTE7CisgIGhlYWRlcl9saW5lX2hlaWdodCA9IFdJTkRPV19IRUFE RVJfTElORV9IRUlHSFQgKHcpOworICBwLmJ5ID0gV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcs IG1heCAoaGVhZGVyX2xpbmVfaGVpZ2h0LCByb3ctPnkpKTsKKyAgcC5ueSA9IHJvdy0+dmlzaWJs ZV9oZWlnaHQ7CisgIGlmIChsZWZ0X3ApCisgICAgeworICAgICAgaW50IHdkID0gV0lORE9XX0xF RlRfRlJJTkdFX1dJRFRIICh3KTsKKyAgICAgIGludCB4ID0gd2luZG93X2JveF9sZWZ0ICh3LCAo V0lORE9XX0hBU19GUklOR0VTX09VVFNJREVfTUFSR0lOUyAodykKKyAgICAgICAgICAgPyBMRUZU X01BUkdJTl9BUkVBCisgICAgICAgICAgIDogVEVYVF9BUkVBKSk7CisgICAgICBpZiAocC53ZCA+ IHdkKQorICAgICAgICBwLndkID0gd2Q7CisgICAgICBwLnggPSB4IC0gcC53ZCAtICh3ZCAtIHAu d2QpIC8gMjsKKyAgICAgIGlmIChwLndkIDwgd2QgfHwgcC55ID4gcC5ieSB8fCBwLnkgKyBwLmgg PCBwLmJ5ICsgcC5ueSkKKyAgICAgICAgeworICAgICAgICAgIC8qIElmIFcgaGFzIGEgdmVydGlj YWwgYm9yZGVyIHRvIGl0cyBsZWZ0LCBkb24ndCBkcmF3IG92ZXIgaXQuICovCisgICAgICAgICAg d2QgLT0gKCghV0lORE9XX0xFRlRNT1NUX1AgKHcpCisgICAgICAgICAgICAvKiBUaGlzIGNvdWxk IGJlIHdyb25nIHdoZW4gd2UgYWxsb3cgd2luZG93IGxvY2FsCisgICAgICAgICAgICAgICByaWdo dCBkaXZpZGVycyAtIGJ1dCB0aGUgd2luZG93IG9uIHRoZSBsZWZ0IGlzIGhhcmQKKyAgICAgICAg ICAgICAgIHRvIGdldC4gKi8KKyAgICAgICAgICAgICYmICF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worICAgICAgcC54ID0geCArICh3ZCAtIHAud2QpIC8gMjsKKyAgICAgIC8q IENsZWFyIHJpZ2h0IGZyaW5nZSBpZiBubyBiaXRtYXAgdG8gZHJhdyBvZiBpZiBiaXRtYXAgZG9l c24ndCBmaWxsCisgICB0aGUgZnJpbmdlLiAqLworICAgICAgaWYgKHAud2QgPCB3ZCB8fCBwLnkg PiBwLmJ5IHx8IHAueSArIHAuaCA8IHAuYnkgKyBwLm55KQorICAgICAgICB7CisgICAgICAgICAg cC5ieCA9IHg7CisgICAgICAgICAgcC5ueCA9IHdkOworICAgICAgICB9CisgICAgfQorICBpZiAo cC54ID49IFdJTkRPV19CT1hfTEVGVF9FREdFX1ggKHcpCisgICAgICAmJiAocC54ICsgcC53ZCkg PD0gV0lORE9XX0JPWF9MRUZUX0VER0VfWCAodykgKyBXSU5ET1dfUElYRUxfV0lEVEggKHcpKQor ICAgIEZSQU1FX1JJRiAoZiktPmRyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93LCAmcCk7Cit9CisK K3ZvaWQKK21jX2RyYXdfZnJpbmdlX2JpdG1hcCAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGds eXBoX3JvdyAqcm93LCBpbnQgbGVmdF9wLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBl KQoreworICBpbnQgb3ZlcmxheSA9IDA7CisgIGlmIChsZWZ0X3AgPT0gcm93LT5yZXZlcnNlZF9w ICYmIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wKQorICAgIHsKKyAgICAgIExpc3BfT2JqZWN0IGN1 cnNvciA9IFFuaWw7CisgICAgICBzd2l0Y2ggKGN1cnNvcl90eXBlKQorICAgICAgICB7CisgICAg ICAgIGNhc2UgTUNfRlJBTUVEX0JPWDoKKyAgICAgICAgICBpZiAocm93LT52aXNpYmxlX2hlaWdo dCA+PSBTVEFOREFSRF9CSVRNQVBfSEVJR0hUIChob2xsb3dfcmVjdGFuZ2xlX2JpdHMpKQorICAg ICAgICAgICAgY3Vyc29yID0gUWhvbGxvdzsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBj dXJzb3IgPSBRaG9sbG93X3NtYWxsOworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1D X0hPTExPV19CT1g6CisgICAgICAgICAgaWYgKHJvdy0+dmlzaWJsZV9oZWlnaHQgPj0gU1RBTkRB UkRfQklUTUFQX0hFSUdIVCAoaG9sbG93X3JlY3RhbmdsZV9iaXRzKSkKKyAgICAgICAgICAgIGN1 cnNvciA9IFFob2xsb3c7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgY3Vyc29yID0gUWhv bGxvd19zbWFsbDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19GSUxMRURfQk9Y OgorICAgICAgICAgIGN1cnNvciA9IFFib3g7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNh c2UgTUNfQkFSOgorICAgICAgICAgIGN1cnNvciA9IFFiYXI7CisgICAgICAgICAgYnJlYWs7Cisg ICAgICAgIGNhc2UgTUNfSEJBUjoKKyAgICAgICAgICBjdXJzb3IgPSBRaGJhcjsKKyAgICAgICAg ICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19OT19GUklOR0VfQklUTUFQOgorICAgICAgICBjYXNl IE1DX05PX0NVUlNPUjoKKyAgICAgICAgY2FzZSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOgorICAg ICAgICBjYXNlIE1DX0xFRlRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgZGVmYXVsdDoKKyAgICAg ICAgICB3LT5waHlzX2N1cnNvcl9vbl9wID0gMDsKKyAgICAgICAgICByb3ctPmN1cnNvcl9pbl9m cmluZ2VfcCA9IDA7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGlmICghTklM UCAoY3Vyc29yKSkKKyAgICAgICAgeworICAgICAgICAgIGludCBibSA9IG1jX2dldF9sb2dpY2Fs X2N1cnNvcl9iaXRtYXAgKHcsIGN1cnNvcik7CisgICAgICAgICAgaWYgKGJtICE9IE1DX05PX0ZS SU5HRV9CSVRNQVApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG1jX2RyYXdfZnJpbmdl X2JpdG1hcF8xICh3LCByb3csIGxlZnRfcCwgMiwgYm0pOworICAgICAgICAgICAgICBvdmVybGF5 ID0gRVEgKGN1cnNvciwgUWJveCkgPyAzIDogMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQor ICAgIH0KKyAgbWNfZHJhd19mcmluZ2VfYml0bWFwXzEgKHcsIHJvdywgbGVmdF9wLCBvdmVybGF5 LCBNQ19OT19GUklOR0VfQklUTUFQKTsKKyAgaWYgKGxlZnRfcCAmJiByb3ctPm92ZXJsYXlfYXJy b3dfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgbWNfZHJhd19mcmluZ2VfYml0 bWFwXzEgKHcsIHJvdywgMSwgMSwgcm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCk7Cit9CisKKy8q IGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAj ZGVmaW5lIE5PX0ZSSU5HRV9CSVRNQVAgMAogI2RlZmluZSBVTkRFRl9GUklOR0VfQklUTUFQIDEK ICNkZWZpbmUgTUFYX1NUQU5EQVJEX0ZSSU5HRV9CSVRNQVBTIEFSUkFZRUxUUyAoc3RhbmRhcmRf Yml0bWFwcykKQEAgLTE2OTksNiArMzIxNywxNjggQEAgUmV0dXJuIG5pbCBpZiBQT1MgaXMgbm90 IHZpc2libGUgaW4gV0lORE9XLiAgKi8pCiB2b2lkCiBzeW1zX29mX2ZyaW5nZSAodm9pZCkKIHsK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKio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V0IChRbWNfcXVhZHJ1cGxlX2FuZ2xlX2Rvd24sIFFmcmluZ2UsIG1ha2VfZml4bnVtICg0 OCkpOworICAvKiAoZ2V0ICcrLXF1YWRydXBsZS1hbmdsZS1kb3duICdmcmluZ2UpID0+IDQ4ICov CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAgIERFRlNZTSAoUXRydW5jYXRpb24sICJ0cnVuY2F0aW9uIik7CiAgIERFRlNZTSAoUWNv bnRpbnVhdGlvbiwgImNvbnRpbnVhdGlvbiIpOwogICBERUZTWU0gKFFvdmVybGF5X2Fycm93LCAi b3ZlcmxheS1hcnJvdyIpOwpkaWZmIC0tZ2l0IGEvc3JjL25zdGVybS5oIGIvc3JjL25zdGVybS5o CmluZGV4IDk3NzNlYjMuLmUzNGExMTYgMTAwNjQ0Ci0tLSBhL3NyYy9uc3Rlcm0uaAorKysgYi9z cmMvbnN0ZXJtLmgKQEAgLTY2Myw2ICs2NjMsMTYgQEAgdHlwZWRlZiBpZCBpbnN0YW5jZXR5cGU7 CiAKIEBpbnRlcmZhY2UgRW1hY3NTY3JvbGxlciA6IE5TU2Nyb2xsZXIKICAgeworCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgTlNSZWN0 IG1jX3JlY3RhbmdsZTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgc3RydWN0 IHdpbmRvdyAqd2luZG93OwogICAgc3RydWN0IGZyYW1lICpmcmFtZTsKICAgIE5TUmVzcG9uZGVy ICpwcmV2UmVzcG9uZGVyOwpAQCAtNjgzLDYgKzY5MywxOCBAQCB0eXBlZGVmIGlkIGluc3RhbmNl dHlwZTsKICAgIGludCBlbV93aG9sZTsKICAgIH0KIAorCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLSAodm9pZCltY19zZXRfcmVjdGFuZ2xlOiAo TlNSZWN0KXJlY3Q7CistIChOU1JlY3QpbWNfZ2V0X3JlY3RhbmdsZTsKKy0gKHN0cnVjdCB3aW5k b3cgKiltY19nZXRfd2luZG93OworLSAoYm9vbCltY19qdWRnZTsKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogLSAoaW5zdGFuY2V0eXBlKSBpbml0RnJhbWU6IChOU1JlY3QgKXIgd2lu ZG93OiAoTGlzcF9PYmplY3Qpd2luOwogLSAodm9pZClzZXRGcmFtZTogKE5TUmVjdClyOwogCmRp ZmYgLS1naXQgYS9zcmMvbnN0ZXJtLm0gYi9zcmMvbnN0ZXJtLm0KaW5kZXggMDIzMzE4Mi4uYjcw OGU5NCAxMDA2NDQKLS0tIGEvc3JjL25zdGVybS5tCisrKyBiL3NyYy9uc3Rlcm0ubQpAQCAtNzYs NiArNzYsOTc1IEBAIFVwZGF0ZWQgYnkgQ2hyaXN0aWFuIExpbXBhY2ggKGNocmlzQG5pY2UuY2gp CiBzdGF0aWMgRW1hY3NNZW51ICptYWluTWVudTsKICNlbmRpZgogCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCitzdGF0aWMgQk9PTCBu c19jbGlwX3RvX3JlY3QgKHN0cnVjd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PnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF0uaHBvczsKKyAgICAgICAgICBpbnQgdnBvcyA9IHMtPnctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0udnBvczsKKyAgICAgICAg ICBpbnQgd2QgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLndkOworICAgICAgICAgIGludCBoID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS5oOworICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vy c29yX3R5cGUgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmN1cnNvcl90eXBlOworICAgICAgICAgIC8vICBpbnQgY3Vyc29yX3dpZHRoID0gcy0+dy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5jdXJzb3Jfd2lkdGg7 CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmcgPSB7LnJlZCA9IHMtPnctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcucmVkLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgLmJsdWUgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhdLmZnLmJsdWV9OworICAgICAgICAgIC8vICBzdHJ1Y3QgbWNfUkdCIGxzbF9i ZyA9IHsucmVkID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXS5iZy5yZWQsCisgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVl biA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcu Z3JlZW4sCisgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gcy0+ dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ibHVlfTsK KyAgICAgICAgICBib29sIGFjdGl2ZV9wID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS5hY3RpdmVfcDsKKyAgICAgICAgICAvLyAgZW51bSBtY19mbGF2 b3IgZ2x5cGhfZmxhdm9yID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAgYm9vbCBlbmFibGVkX3AgPSBzLT53 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmVuYWJsZWRfcDsK KyAgICAgICAgICBib29sIGdvX3AgPSAodnBvcyA9PSB2bnRoCisgICAgICAgICAgICAgICAgICAg ICAgICYmIGhwb3MgPT0gY3Vyc29yX2dseXBoLT5ocG9zCisgICAgICAgICAgICAgICAgICAgICAg ICYmIGVuYWJsZWRfcCk7CisgICAgICAgICAgaWYgKCFnb19wKQorICAgICAgICAgICAgY29udGlu dWU7CisgICAgICAgICAgTlNSZWN0IHI7CisgICAgICAgICAgci5vcmlnaW4ueCA9IGZ4OworICAg ICAgICAgIHIub3JpZ2luLnkgPSBmeTsKKyAgICAgICAgICByLnNpemUuaGVpZ2h0ID0gaDsKKyAg ICAgICAgICByLnNpemUud2lkdGggPSB3ZDsKKyAgICAgICAgICBbW05TQ29sb3IgY29sb3JXaXRo Q2FsaWJyYXRlZFJlZDogbHNsX2ZnLnJlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGdyZWVuOiBsc2xfZmcuZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgYmx1ZTogbHNsX2ZnLmJsdWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBhbHBoYTogMS4wXSBzZXRdOworICAgICAgaWYgKGN1cnNvcl90eXBlID09IE1DX0ZS QU1FRF9CT1gpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZF UiAocy0+dy0+Y29udGVudHMpOworICAgICAgICAgIGJvb2wgcmVnaW9uX2FjdGl2ZV9wID0gKCFO SUxQIChWdHJhbnNpZW50X21hcmtfbW9kZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWFya19hY3RpdmUpKSk7CisgICAgICAgICAgcHRyZGlm Zl90IHJlZ2lvbl9iZWcgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IG1jX3JlZ2lvbl9saW1pdCAoMSkg OiAtMTsKKyAgICAgICAgICBwdHJkaWZmX3QgcmVnaW9uX2VuZCA9IChyZWdpb25fYWN0aXZlX3Ap ID8gbWNfcmVnaW9uX2xpbWl0ICgwKSA6IC0xOworICAgICAgICAgIGlmIChyZWdpb25fYWN0aXZl X3AKKyAgICAgICAgICAgICAgJiYgYWN0aXZlX3AKKyAgICAgICAgICAgICAgJiYgY3Vyc29yX2ds eXBoLT5jaGFycG9zID09IHJlZ2lvbl9iZWcpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdfZmFjZV9pZCA9IGxvb2t1cF9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mFrZS1jdXJzb3ItaW5hY3RpdmUtcHJl LXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhv bGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBob2xsb3dfaW5hY3RpdmVf ZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgTlNDb2xvciAqaG9sbG93X2luYWN0aXZl X2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9s bG93X2luYWN0aXZlX2ZhY2UpLCBzLT5mKTsKKyAgICAgICAgICAgICAgICAgICAgICBob2xsb3df Y29sb3IgPSBob2xsb3dfaW5hY3RpdmVfY29sb3I7CisgICAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgfQorICAgICAgICBlbHNlIGlmIChmYWNlICYmIE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFj ZSkgPT0gbnNfaW5kZXhfY29sb3IgKEZSQU1FX0NVUlNPUl9DT0xPUiAocy0+ZiksIHMtPmYpKQor ICAgICAgICAgIHsKKyAgICAgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFD RV9GT1JFR1JPVU5EIChmYWNlKSwgcy0+Zikgc2V0XTsKKyAgICAgICAgICAgIGhvbGxvd19jb2xv ciA9IEZSQU1FX0NVUlNPUl9DT0xPUiAocy0+Zik7CisgICAgICAgICAgfQorICAgICAgICAgIHN3 aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGNhc2UgTUNf Tk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAg Y2FzZSBNQ19OT19DVVJTT1I6CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAg IGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgICAgICAgY2FzZSBNQ19MRUZU X0ZSSU5HRV9CSVRNQVA6CisgICAgICAgICAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICAg ICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAg ICAgICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwg KHIpOworICAgICAgICAgICAgICAgIFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAgICAgICAg ICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICAgICAgICAgIFtG UkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpIHNldF07CisgICAgICAgICAgICAgICAgYnJlYWs7Cisg ICAgICAgICAgICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICAgICAgICAgICAgICBOU1JlY3RG aWxsIChyKTsKKyAgICAgICAgICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAgICAgICAg ICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgICAgICAg ICBbRlJBTUVfQ1VSU09SX0NPTE9SIChzLT5mKSBzZXRdOworICAgICAgICAgICAgICAgIGJyZWFr OworICAgICAgICAgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAgICAgICAgICAgTlNSZWN0Rmls bCAocik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfQkFS OgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgICAgIGJyZWFr OworICAgICAgICAgICAgfQorICAgICAgICAgIC8qIElmIGEgZ2x5cGggZXhpc3RzIChzLT5jaGFy MmIgIT0gTlVMTCksIHRoZW4gZHJhdyB0aGUgZ2x5cGggb24gdG9wIG9mIHRoZQorICAgICAgICAg IG5ld2x5IGRyYXduIHJlY3RhbmdsZSB0aGF0IHdhcyBjcmVhdGVkIGhlcmVpbmFib3ZlLiAgVG8g dGhlIGV4dGVudCB0aGF0IHdlCisgICAgICAgICAgd2FudCB0byBkb3VibGUtaW1wcmludCBnbHlw aHMgdG8gbWFrZSB0aGVtIGFwcGVhciB0byBiZSBzZW1pLWJvbGQsIGl0IGNhbgorICAgICAgICAg IGJlIGRvbmUgaGVyZSBmb3IgYWxsIGN1cnNvciB0eXBlcy4gIFRoZSBib3gtc3R5bGUgY3Vyc29y cyBhcmUgaW1wcmludGVkCisgICAgICAgICAgd2l0aCBnbHlwaHMgb25seSBvbmUgKDEpIHRpbWUu ICBUaGUgc2VtaS1ib2xkIGFwcGVhcmFuY2UgaXMgaGVscGZ1bCB3aGVuCisgICAgICAgICAgZGVi dWdnaW5nIHRvIHNlZSB0aGF0IHRoZSBjb29yZGluYXRlcyBhcmUgY29ycmVjdC4gKi8KKyAgICAg ICAgICBpZiAocy0+Y2hhcjJiICE9IE5VTEwKKyAgICAgICAgICAgICAgJiYgKGN1cnNvcl90eXBl ID09IE1DX0ZJTExFRF9CT1gKKyAgICAgICAgICAgICAgICAgIHx8IGN1cnNvcl90eXBlID09IE1D X0ZSQU1FRF9CT1gKKyAgICAgICAgICAgICAgICAgIHx8IGN1cnNvcl90eXBlID09IE1DX0hPTExP V19CT1gpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBCT09MIGlzQ29tcG9zaXRlID0g cy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIOworICAgICAgICAgICAgICBp ZiAoaXNDb21wb3NpdGUpCisgICAgICAgICAgICAgICAgbnNfZHJhd19jb21wb3NpdGVfZ2x5cGhf c3RyaW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZvbnQgKmZvbnQgPSBzLT5mYWNl LT5mb250OworICAgICAgICAgICAgICAgICAgICBpZiAoIWZvbnQpCisgICAgICAgICAgICAgICAg ICAgICAgZm9udCA9IEZSQU1FX0ZPTlQgKHMtPmYpOworICAgICAgICAgICAgICAgICAgICBib29s IHdpdGhfYmdfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBmb250LT5kcml2ZXItPmRy YXcgKHMsIHMtPmNtcF9mcm9tLCBzLT5uY2hhcnMsIHMtPngsIHMtPnliYXNlLCB3aXRoX2JnX3Ap OworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQor ICAvLyAgY2xvY2tfdCBjbG9ja19lbmQgPSBjbG9jaygpOworICAvLyAgZG91YmxlIGNwdV90aW1l X3VzZWQgPSAoKGRvdWJsZSkgKGNsb2NrX2VuZCAtIGNsb2NrX3N0YXJ0KSkgLyBDTE9DS1NfUEVS X1NFQzsKKyAgLy8gIGZwcmludGYgKHN0ZGVyciwgIm5zX2RyYXdfb3ZlcndyaXR0ZW4gKCVkKTog IFRJTUUgKCVmKVxuIiwgdnBvcywgY3B1X3RpbWVfdXNlZCk7Cit9CisKK3N0YXRpYyB2b2lkCitt Y19uc19kcmF3X3dpbmRvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9t YXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICAg aW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50IGhwb3MsIGludCB2cG9zLCBpbnQgd2Qs IGludCBoLAorICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2wsIGVudW0gbWNfY3Vy c29yX3R5cGUgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRo LCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsIGJvb2wgb25fcCwgYm9v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0 cml4LCByb3csIGhwb3MsIHZwb3MpOworICBzdHJ1Y3QgZmFjZSAqZmFjZTsKKyAgTlNDb2xvciAq aG9sbG93X2NvbG9yID0gRlJBTUVfQkFDS0dST1VORF9DT0xPUiAoZik7CisgIC8qIElmIGN1cnNv ciBpcyBvdXQgb2YgYm91bmRzLCBkb24ndCBkcmF3IGdhcmJhZ2UuICBUaGlzIGNhbiBoYXBwZW4K KyAgICAgaW4gbWluaS1idWZmZXIgd2luZG93cyB3aGVuIHN3aXRjaGluZyBiZXR3ZWVuIGVjaG8g YXJlYSBnbHlwaHMKKyAgICAgYW5kIG1pbmktYnVmZmVyLiAqLworICBpZiAoIW9uX3ApCisgICAg cmV0dXJuOworICBpZiAoY3Vyc29yX3R5cGUgPT0gTUNfTk9fQ1VSU09SKQorICAgIHJldHVybjsK KyAgLyogVGhlIGZyaW5nZSBiaXRtYXBzIGFyZSBwcmVzZW50bHkgaGFuZGxlZCBlbHNld2hlcmUs IGJ1dCBjb3VsZCBzb21lZGF5IGJlCisgIG1hbmFnZWQgKGluIHBhcnQpIGF0IHRoaXMgc2VjdGlv biBvZiBjb2RlLiAqLworICBpZiAocm93LT5leGFjdF93aW5kb3dfd2lkdGhfbGluZV9wCisgICAg ICAmJiAocm93LT5yZXZlcnNlZF9wCisgICAgICAgICA/IChocG9zIDwgMCkKKyAgICAgICAgIDog KGhwb3MgPj0gcm93LT51c2VkW1RFWFRfQVJFQV0pKSkKKyAgICB7CisgICAgICByb3ctPmN1cnNv cl9pbl9mcmluZ2VfcCA9IHRydWU7CisgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJv dywgcm93LT5yZXZlcnNlZF9wLCBjdXJzb3JfdHlwZSk7CisgICAgICByZXR1cm47CisgICAgfQor ICByLm9yaWdpbi54ID0gZng7CisgIHIub3JpZ2luLnkgPSBmeTsKKyAgci5zaXplLmhlaWdodCA9 IGg7CisgIHIuc2l6ZS53aWR0aCA9IHdkOworICAvKiBgbnNfY2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AgICAgZnBy aW50ZiAoc3RkZXJyLCAiXG5mb3JlZ3JvdW5kICglcykgfCBiYWNrZ3JvdW5kICglcylcbiIsCisg ICAgICAgICAgICAgICAgICAgICAgKCFOSUxQIChmb3JlZ3JvdW5kKSA/IFNTREFUQSAoZm9yZWdy b3VuZCkgOiAiTklMUCIpLAorICAgICAgICAgICAgICAgICAgICAgICghTklMUCAoYmFja2dyb3Vu ZCkgPyBTU0RBVEEgKGJhY2tncm91bmQpIDogIk5JTFAiKSk7CisgIC0gIEVYQU1QTEUgT0YgSE9X IFRPIENSRUFURSBBIENPTE9SIFdJVEggUkdCL0xTTCBmbG9hdCB2YWx1ZXM6CisgICAgIE5TQ29s b3IgKm15X2NvbG9yID0gW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogMS4wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBncmVlbjogMS4w CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1 ZTogMS4wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBhbHBoYTogMS4wXTsKKyAgLSAgQUxURVJOQVRJVkUgRVhBTVBMRToKKyAgICAgZW51bSBmYWNl X2lkIGRlYnVnZ2luZ19mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGlu dGVybiAoIistZGVidWdnaW5nLWZhY2UiKSwgdHJ1ZSk7CisgICAgIHN0cnVjdCBmYWNlICpkZWJ1 Z2dpbmdfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgZGVidWdnaW5nX2ZhY2VfaWQpOworICAg ICBOU0NvbG9yICpjb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVH Uk9VTkQgKGRlYnVnZ2luZ19mYWNlKSwgcy0+Zik7CisgICAgIFtjb2xvciBzZXRdOyAqLworICBp ZiAoZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBICisgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNf R0xZUEhMRVNTKQorICAgIFtbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2wucmVk CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IGxzbC5ncmVlbgorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiBsc2wuYmx1ZQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdIHNldF07CisgICAgZWxzZQorICAgICAgW0ZSQU1F X0NVUlNPUl9DT0xPUiAoZikgc2V0XTsKKyAgaWYgKGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9C T1gpCisgICAgeworICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKHctPmNvbnRlbnRz KTsKKyAgICAgIGJvb2wgcmVnaW9uX2FjdGl2ZV9wID0gKCFOSUxQIChWdHJhbnNpZW50X21hcmtf bW9kZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBt YXJrX2FjdGl2ZSkpKTsKKyAgICAgIHB0cmRpZmZfdCByZWdpb25fYmVnID0gKHJlZ2lvbl9hY3Rp dmVfcCkgPyBtY19yZWdpb25fbGltaXQgKDEpIDogLTE7CisgICAgICBwdHJkaWZmX3QgcmVnaW9u X2VuZCA9IChyZWdpb25fYWN0aXZlX3ApID8gbWNfcmVnaW9uX2xpbWl0ICgwKSA6IC0xOworICAg ICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICYmIGFjdGl2ZV9wCisgICAgICAgICAg JiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID09IHJlZ2lvbl9iZWcpCisgICAgICAgIHsKKyAgICAg ICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdpb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b3dfY29sb3IgPSBob2xsb3dfYWN0aXZl X3JlZ2lvbl9iZXR3ZWVuX2NvbG9yOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBp ZiAoYWN0aXZlX3ApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBlbnVtIGZhY2Vf aWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVy biAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAg ICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBo b2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19h Y3RpdmVfY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5E IChob2xsb3dfYWN0aXZlX2ZhY2UpLCBmKTsKKyAgICAgICAgICAgICAgICBob2xsb3dfY29sb3Ig PSBob2xsb3dfYWN0aXZlX2NvbG9yOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIC8q IFRoZSByZWdpb24gaXMgX25vdF8gdmlzaWJsZSBpbiB0aGUgaW5hY3RpdmUgd2luZG93IGJlY2F1 c2UgdGhlIG92ZXJsYXkgd2luZG93IHByb3BlcnR5IGlzIHVzZWQuICovCisgICAgICAgICAgICAg IGVsc2UgaWYgKCFhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNl IiksIHRydWUpOworICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2 ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAg ICAgICAgICAgICAgICBOU0NvbG9yICpob2xsb3dfaW5hY3RpdmVfY29sb3IgPSBuc19sb29rdXBf aW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChob2xsb3dfaW5hY3RpdmVfZmFjZSks IGYpOworICAgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2luYWN0aXZlX2Nv bG9yOworICAgICAgICAgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAoZmFjZSAmJiBOU19G QUNFX0JBQ0tHUk9VTkQgKGZhY2UpID09IG5zX2luZGV4X2NvbG9yIChGUkFNRV9DVVJTT1JfQ09M T1IgKGYpLCBmKSkKKyAgICAgIHsKKyAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChO U19GQUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBmKSBzZXRdOworICAgICAgICBob2xsb3dfY29sb3Ig PSBGUkFNRV9DVVJTT1JfQ09MT1IgKGYpOworICAgICAgfQorI2lmZGVmIE5TX0lNUExfQ09DT0EK KyAgTlNEaXNhYmxlU2NyZWVuVXBkYXRlcyAoKTsKKyNlbmRpZgorICBzd2l0Y2ggKGN1cnNvcl90 eXBlKQorICAgIHsKKyAgICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgYnJl YWs7CisgICAgICBjYXNlIE1DX05PX0NVUlNPUjoKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNl IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19M RUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19GSUxMRURf Qk9YOgorICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNl IE1DX0ZSQU1FRF9CT1g6CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBbaG9sbG93 X2NvbG9yIHNldF07CisgICAgICAgIE5TUmVjdEZpbGwgKE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7 CisgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKGYpIHNldF07CisgICAgICAgIGJyZWFrOwor ICAgICAgY2FzZSBNQ19IT0xMT1dfQk9YOgorICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAg ICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAo ciwgMSwgMSkpOworICAgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworICAgICAg ICBicmVhazsKKyAgICAgIGNhc2UgTUNfSEJBUjoKKyAgICAgICAgTlNSZWN0RmlsbCAocik7Cisg ICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgIHMgPSByOworICAgICAg ICAvKiBAbGF3bGlzdCBpcyBmb2N1c2luZyB0aGUgaW5pdGlhbCBkZXZlbG9wbWVudCBvZiBmZWF0 dXJlIHJlcXVlc3RzCisgICAgICAgICMxNzY4NCBhbmQgIzIyODczIG9uIEwyUiBsYW5ndWFnZXMu ICovCisgICAgICAgIGlmIChnbHlwaF9mbGF2b3IgIT0gTUNfR0xZUEgKKyAgICAgICAgICAgICYm IGdseXBoX2ZsYXZvciAhPSBNQ19HTFlQSExFU1MpCisgICAgICAgICAgeworICAgICAgICAgICAg LyogSWYgdGhlIGNoYXJhY3RlciB1bmRlciBjdXJzb3IgaXMgUjJMLCBkcmF3IHRoZSBiYXIgY3Vy c29yCisgICAgICAgICAgICAgICBvbiB0aGUgcmlnaHQgb2YgaXRzIGdseXBoLCByYXRoZXIgdGhh biBvbiB0aGUgbGVmdC4gKi8KKyAgICAgICAgICAgIGlmICgoY3Vyc29yX2dseXBoLT5yZXNvbHZl ZF9sZXZlbCAmIDEpICE9IDApCisgICAgICAgICAgICAgIHMub3JpZ2luLnggKz0gY3Vyc29yX2ds eXBoLT5waXhlbF93aWR0aCAtIHMuc2l6ZS53aWR0aDsKKyAgICAgICAgICB9CisgICAgICAgIE5T UmVjdEZpbGwgKHMpOworICAgICAgICBicmVhazsKKyAgICB9CisgIG5zX3Jlc2V0X2NsaXBwaW5n IChmKTsKKyAgLyogZHJhdyB0aGUgY2hhcmFjdGVyIHVuZGVyIHRoZSBjdXJzb3IgKi8KKyAgaWYg KGdseXBoX2ZsYXZvciAhPSBNQ19HTFlQSExFU1MKKyAgICAgICYmIChjdXJzb3JfdHlwZSA9PSBN Q19GUkFNRURfQk9YCisgICAgICAgICAgfHwgY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVEX0JPWAor ICAgICAgICAgIHx8IGN1cnNvcl90eXBlID09IE1DX0hPTExPV19CT1gKKyAgICAgICAgICB8fCAo ZGVidWdfcAorICAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19IQkFSKQorICAgICAg ICAgIHx8IChkZWJ1Z19wCisgICAgICAgICAgICAgICYmIGN1cnNvcl90eXBlID09IE1DX0JBUikp KQorICAgIHsKKyAgICAgIC8qIGBjdXJzb3JfZ2NfcGAgaXMgdXNlZCBvbmx5IGJ5IGB3MzJ0ZXJt LmNgIGFuZCBgeHRlcm0uYycuICovCisgICAgICBib29sIGN1cnNvcl9nY19wID0gZmFsc2U7Cisg ICAgICBjb25zdCBFbWFjc19SZWN0YW5nbGUgKnNhdmVkX2NsaXAgPSBOVUxMOworICAgICAgaWYg KHJvdy0+Y2xpcCAhPSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgc2F2ZWRfY2xpcCA9IHJv dy0+Y2xpcDsKKyAgICAgICAgICByb3ctPmNsaXAgPSBOVUxMOworICAgICAgICB9CisgICA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DRV9VTkRFUl9XQVZFKQorICAgICAgICB7CisgICAgICAgICAgaWYgKGZh Y2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIFtkZWZhdWx0Q29sIHNldF07 CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xv ciAoZmFjZS0+dW5kZXJsaW5lX2NvbG9yLCBzLT5mKSBzZXRdOworICAgICAgICAgIG5zX2RyYXdf dW5kZXJ3YXZlIChzLCB3aWR0aCwgeCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocy0+ ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgIHsKKyAg ICAgICAgICAgIE5TUmVjdCByOworICAgICAgICAgICAgdW5zaWduZWQgbG9uZyB0aGlja25lc3Ms IHBvc2l0aW9uOworICAgICAgICAgICAgLyogSWYgdGhlIHByZXYgd2FzIHVuZGVybGluZWQsIG1h dGNoIGl0cyBhcHBlYXJhbmNlLiAqLworICAgICAgICAgICAgaWYgKHMtPnByZXYgJiYgcy0+cHJl di0+ZmFjZS0+dW5kZXJsaW5lX3AKKyAgICAgICAgICAgICAgICAmJiBzLT5wcmV2LT5mYWNlLT51 bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUKKyAgICAgICAgICAgICAgICAmJiBzLT5w cmV2LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgIHRoaWNrbmVzcyA9IHMtPnByZXYtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAg ICAgICAgICAgcG9zaXRpb24gPSBzLT5wcmV2LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgIHN0cnVjdCBmb250ICpmb250OworICAgICAgICAgICAgICAgICAgdW5zaWduZWQg bG9uZyBkZXNjZW50OworICAgICAgICAgICAgICAgICAgZm9udD1zLT5mb250OworICAgICAgICAg ICAgICAgICAgZGVzY2VudCA9IHMtPnkgKyBzLT5oZWlnaHQgLSBzLT55YmFzZTsKKyAgICAgICAg ICAgICAgICAgIC8qIFVzZSB1bmRlcmxpbmUgdGhpY2tuZXNzIG9mIGZvbnQsIGRlZmF1bHRpbmcg dG8gMS4gKi8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IChmb250ICYmIGZvbnQtPnVu ZGVybGluZV90aGlja25lc3MgPiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBm b250LT51bmRlcmxpbmVfdGhpY2tuZXNzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IDE7CisgICAgICAgICAgICAgICAgICAvKiBEZXRlcm1pbmUgdGhlIG9mZnNldCBvZiB1bmRlcmxp bmluZyBmcm9tIHRoZSBiYXNlbGluZS4gKi8KKyAgICAgICAgICAgICAgICAgIGlmICh4X3VuZGVy bGluZV9hdF9kZXNjZW50X2xpbmUpCisgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gZGVz Y2VudCAtIHRoaWNrbmVzczsKKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoeF91c2VfdW5k ZXJsaW5lX3Bvc2l0aW9uX3Byb3BlcnRpZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgZm9udCAmJiBmb250LT51bmRlcmxpbmVfcG9zaXRpb24gPj0gMCkKKyAgICAgICAgICAgICAg ICAgICAgICBwb3NpdGlvbiA9IGZvbnQtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAg ICAgICAgICAgICBlbHNlIGlmIChmb250KQorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRp b24gPSBscm91bmQgKGZvbnQtPmRlc2NlbnQgLyAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSB1bmRlcmxpbmVfbWlu aW11bV9vZmZzZXQ7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IG1heCAocG9zaXRpb24s IHVuZGVybGluZV9taW5pbXVtX29mZnNldCk7CisgICAgICAgICAgICAgICAgICAvKiBFbnN1cmUg dW5kZXJsaW5pbmcgaXMgbm90IGNyb3BwZWQuICovCisgICAgICAgICAgICAgICAgICBpZiAoZGVz Y2VudCA8PSBwb3NpdGlvbikKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgICAgIHBvc2l0aW9uID0gZGVzY2VudCAtIDE7CisgICAgICAgICAgICAgICAgICAgICAgdGhp Y2tuZXNzID0gMTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBl bHNlIGlmIChkZXNjZW50IDwgcG9zaXRpb24gKyB0aGlja25lc3MpCisgICAgICAgICAgICAgICAg ICAgICAgdGhpY2tuZXNzID0gMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICBzLT51 bmRlcmxpbmVfdGhpY2tuZXNzID0gdGhpY2tuZXNzOworICAgICAgICAgICAgcy0+dW5kZXJsaW5l X3Bvc2l0aW9uID0gcG9zaXRpb247CisgICAgICAgICAgICByID0gTlNNYWtlUmVjdCAoeCwgcy0+ eWJhc2UgKyBwb3NpdGlvbiwgd2lkdGgsIHRoaWNrbmVzcyk7CisgICAgICAgICAgICBpZiAoZmFj ZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgICBbZGVmYXVsdENvbCBzZXRd OworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVk X2NvbG9yIChmYWNlLT51bmRlcmxpbmVfY29sb3IsIHMtPmYpIHNldF07CisgICAgICAgICAgICBO U1JlY3RGaWxsIChyKTsKKyAgICAgICAgICB9CisgICAgfQorICAvKiBEbyBvdmVybGluZS4gV2Ug Zm9sbG93IG90aGVyIHRlcm1zIGluIHVzaW5nIGEgdGhpY2tuZXNzIG9mIDEKKyAgICAgYW5kIGln bm9yaW5nIG92ZXJsaW5lX21hcmdpbi4gKi8KKyAgaWYgKGZhY2UtPm92ZXJsaW5lX3ApCisgICAg eworICAgICAgTlNSZWN0IHI7CisgICAgICByID0gTlNNYWtlUmVjdCAoeCwgcy0+eSwgd2lkdGgs IDEpOworICAgICAgaWYgKGZhY2UtPm92ZXJsaW5lX2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAg ICBbZGVmYXVsdENvbCBzZXRdOworICAgICAgICBlbHNlCisgICAgICAgICAgW25zX2xvb2t1cF9p bmRleGVkX2NvbG9yIChmYWNlLT5vdmVybGluZV9jb2xvciwgcy0+Zikgc2V0XTsKKyAgICAgIE5T UmVjdEZpbGwgKHIpOworICAgIH0KKyAgLyogRG8gc3RyaWtlLXRocm91Z2guICBXZSBmb2xsb3cg b3RoZXIgdGVybXMgZm9yIHRoaWNrbmVzcyBhbmQKKyAgICAgdmVydGljYWwgcG9zaXRpb24uKi8K KyAgaWYgKGZhY2UtPnN0cmlrZV90aHJvdWdoX3ApCisgICAgeworICAgICAgTlNSZWN0IHI7Cisg ICAgICB1bnNpZ25lZCBsb25nIGR5OworICAgICAgZHkgPSBscmludCAoKHMtPmhlaWdodCAtIDEp IC8gMik7CisgICAgICByID0gTlNNYWtlUmVjdCAoeCwgcy0+eSArIGR5LCB3aWR0aCwgMSk7Cisg ICAgICBpZiAoZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICAg IFtkZWZhdWx0Q29sIHNldF07CisgICAgICAgIGVsc2UKKyAgICAgICAgICBbbnNfbG9va3VwX2lu ZGV4ZWRfY29sb3IgKGZhY2UtPnN0cmlrZV90aHJvdWdoX2NvbG9yLCBzLT5mKSBzZXRdOworICAg ICAgTlNSZWN0RmlsbCAocik7CisgICAgfQorfQorCitzdGF0aWMgdm9pZAorbWNfbnNfZHVtcGds eXBoc19zdHJldGNoIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4 ICptYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJv dywgaW50IHdkKQoreworICBOU1JlY3QgclsyXTsKKyAgaW50IG4sIGk7CisgIHN0cnVjdCBmYWNl ICpmYWNlOworICBOU0NvbG9yICpmZ0NvbCwgKmJnQ29sOworICBpZiAoIXMtPmJhY2tncm91bmRf ZmlsbGVkX3ApCisgICAgeworICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0 IChzLCByKTsKKyAgICAgICpyID0gTlNNYWtlUmVjdCAocy0+eCwgcy0+eSwgcy0+YmFja2dyb3Vu ZF93aWR0aCwgcy0+aGVpZ2h0KTsKKyAgICAgIGlmICghbnNfY2xpcF90b19yZWN0IChzLT5mLCBy LCBuKSkKKyAgICAgICAgcmV0dXJuOworICAgICAgaWYgKHMtPmhsID09IERSQVdfTU9VU0VfRkFD RSkKKyAgICAgICAgeworICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIE1PVVNF X0hMX0lORk8gKHMtPmYpLT5tb3VzZV9mYWNlX2ZhY2VfaWQpOworICAgICAgICAgIGlmICghZmFj ZSkKKyAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIE1PVVNFX0ZBQ0VfSUQp OworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQg KHMtPmYsIHMtPmZpcnN0X2dseXBoLT5mYWNlX2lkKTsKKyAgICAgIGJnQ29sID0gbnNfbG9va3Vw X2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSksIHMtPmYpOworICAgICAg ZmdDb2wgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNl KSwgcy0+Zik7CisgICAgICBmb3IgKGkgPSAwOyBpIDwgbjsgKytpKQorICAgICAgICB7CisgICAg ICAgICAgaWYgKCFzLT5yb3ctPmZ1bGxfd2lkdGhfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgaW50IG92ZXJydW4sIGxlZnRvdmVycnVuOworICAgICAgICAgICAgICAvKiB0cnVuY2F0 ZSB0byBhdm9pZCBvdmVyd3JpdGluZyBmcmluZ2UgYW5kL29yIHNjcm9sbGJhciAqLworICAgICAg ICAgICAgICBvdmVycnVuID0gbWF4ICgwLCAocy0+eCArIHMtPmJhY2tncm91bmRfd2lkdGgpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIChXSU5ET1dfQk9YX1JJR0hUX0VER0Vf WCAocy0+dykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gV0lORE9XX1JJR0hUX0ZS SU5HRV9XSURUSCAocy0+dykpKTsKKyAgICAgICAgICAgICAgICAgICAgcltpXS5zaXplLndpZHRo IC09IG92ZXJydW47CisgICAgICAgICAgICAgIC8qIHRydW5jYXRlIHRvIGF2b2lkIG92ZXJ3cml0 aW5nIHRvIGxlZnQgb2YgdGhlIHdpbmRvdyBib3ggKi8KKyAgICAgICAgICAgICAgbGVmdG92ZXJy dW4gPSAoV0lORE9XX0JPWF9MRUZUX0VER0VfWCAocy0+dykKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKyBXSU5ET1dfTEVGVF9GUklOR0VfV0lEVEggKHMtPncpKSAtIHMtPng7CisgICAg ICAgICAgICAgIGlmIChsZWZ0b3ZlcnJ1biA+IDApCisgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgcltpXS5vcmlnaW4ueCArPSBsZWZ0b3ZlcnJ1bjsKKyAgICAgICAgICAgICAg IC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cnNvci4gKi8KKyAgICAgICAgICAgICAgaWYgKHMtPnctPnBoeXNfY3Vyc29y X3R5cGUgPT0gTUNfRklMTEVEX0JPWCkKKyAgICAgICAgICAgICAgICBtY19uc19kcmF3X3RleHRf ZGVjb3JhdGlvbiAocywgZmFjZSwgYmdDb2wsIHdpZHRoLCB4KTsKKyAgICAgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgICAgICBtY19uc19kcmF3X3RleHRfZGVjb3JhdGlvbiAocywgZmFj ZSwgZmdDb2wsIHdpZHRoLCB4KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAg ICAgICAgICB7CisgIC8vICBpbnQgcnggPSByW2ldLm9yaWdpbi54OworICAvLyAgaW50IHJ5ID0g cltpXS5vcmlnaW4ueTsKKyAgLy8gIGludCBydyA9IHJbaV0uc2l6ZS53aWR0aDsKKyAgLy8gIGlu dCByaCA9IHJbaV0uc2l6ZS5oZWlnaHQ7CisgIC8vICBmcHJpbnRmIChzdGRlcnIsICJtY19uc19k dW1wZ2x5cGhzX3N0cmV0Y2g6ICB2cG9zICglZCkgfCByeCAoJWQpIHwgcnkgKCVkKSB8IHJ3ICgl ZCkgfCByaCAoJWQpXG4iLAorICAvLyAgICAgICAgICAgICAgICAgICBzLT5maXJzdF9nbHlwaC0+ dnBvcywgcngsIHJ5LCBydywgcmgpOworICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyW2ldKTsK KyAgICAgICAgICAgIH0KKyAgICAgICAgICAvKiBEcmF3IG92ZXJsaW5pbmcsIGV0Yy4gb24gdGhl IHN0cmV0Y2ggZ2x5cGggKG9yIHRoZSBwYXJ0CisgICAgICAgICAgICAgb2YgdGhlIHN0cmV0Y2gg Z2x5cGggYWZ0ZXIgdGhlIGN1cnNvcikuICovCisgICAgICAgICAgbWNfbnNfZHJhd190ZXh0X2Rl Y29yYXRpb24gKHMsIGZhY2UsIGZnQ29sLCByW2ldLnNpemUud2lkdGgsCisgICAgICAgICAgICAg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bCAoYnIpOworICAvKiBEcmF3IHRoZSBpbWFnZS4uIGRvIHdlIG5lZWQgdG8gZHJhdyBwbGFjZWhv bGRlciBpZiBpbWcgPT1uaWw/ICovCisgIGlmIChpbWcgIT0gbmlsKQorICAgIHsKKyNpZmRlZiBO U19JTVBMX0NPQ09BCisgICAgICBOU1JlY3QgZHIgPSBOU01ha2VSZWN0ICh4LCB5LCBzLT5zbGlj ZS53aWR0aCwgcy0+c2xpY2UuaGVpZ2h0KTsKKyAgICAgIE5TUmVjdCBpciA9IE5TTWFrZVJlY3Qg KHMtPnNsaWNlLngsIHMtPnNsaWNlLnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBz LT5zbGljZS53aWR0aCwgcy0+c2xpY2UuaGVpZ2h0KTsKKyAgICAgIFtpbWcgZHJhd0luUmVjdDog ZHIKKyAgICAgICAgICAgICBmcm9tUmVjdDogaXIKKyAgICAgICAgICAgICBvcGVyYXRpb246IE5T Q29tcG9zaXRlU291cmNlT3ZlcgorICAgICAgICAgICAgICBmcmFjdGlvbjogMS4wCisgICAgICAg ICAgIHJlc3BlY3RGbGlwcGVkOiBZRVMKKyAgICAgICAgICAgICAgICBoaW50czogbmlsXTsKKyNl bHNlCisgICAgICBbaW1nIGNvbXBvc2l0ZVRvUG9pbnQ6IE5TTWFrZVBvaW50ICh4LCB5ICsgcy0+ c2xpY2UuaGVpZ2h0KQorICAgICAgICAgICAgICAgICAgb3BlcmF0aW9uOiBOU0NvbXBvc2l0ZVNv dXJjZU92ZXJdOworI2VuZGlmCisgICAgfQorICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IpCisg ICAgeworICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAocy0+Zikgc2V0XTsKKyAgICAgIGlmIChz LT53LT5waHlzX2N1cnNvcl90eXBlID09IE1DX0ZJTExFRF9CT1gpCisgICAgICAgIHRkQ29sID0g bnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0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AgICAgICAgICB0aCA9IHRvb2xfYmFyX2J1dHRvbl9yZWxpZWYgPj0gMCA/CisgICAgICAg ICAgICB0b29sX2Jhcl9idXR0b25fcmVsaWVmIDogREVGQVVMVF9UT09MX0JBUl9CVVRUT05fUkVM SUVGOworICAgICAgICAgIHJhaXNlZF9wID0gKHMtPmhsID09IERSQVdfSU1BR0VfUkFJU0VEKTsK KyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgdGggPSBh YnMgKHMtPmltZy0+cmVsaWVmKTsKKyAgICAgICAgICAgIHJhaXNlZF9wID0gKHMtPmltZy0+cmVs aWVmID4gMCk7CisgICAgICAgICAgfQorICAgICAgci5vcmlnaW4ueCA9IHggLSB0aDsKKyAgICAg IHIub3JpZ2luLnkgPSB5IC0gdGg7CisgICAgICByLnNpemUud2lkdGggPSBzLT5zbGljZS53aWR0 aCArIDIqdGgtMTsKKyAgICAgIHIuc2l6ZS5oZWlnaHQgPSBzLT5zbGljZS5oZWlnaHQgKyAyKnRo LTE7CisgICAgICBuc19kcmF3X3JlbGllZiAociwgdGgsIHJhaXNlZF9wLAorICAgICAgICAgICAg ICAgICAgICAgIHMtPnNsaWNlLnkgPT0gMCwKKyAgICAgICAgICAgICAgICAgICAgICBzLT5zbGlj ZS55ICsgcy0+c2xpY2UuaGVpZ2h0ID09IHMtPmltZy0+aGVpZ2h0LAorICAgICAgICAgICAgICAg ICAgICAgIHMtPnNsaWNlLnggPT0gMCwKKyAgICAgICAgICAgICAgICAgICAgICBzLT5zbGljZS54 ICsgcy0+c2xpY2Uud2lkdGggPT0gcy0+aW1nLT53aWR0aCwgcyk7CisgICAgfQorICAvKiBJZiB0 aGVyZSBpcyBubyBtYXNrLCB0aGUgYmFja2dyb3VuZCB3b24ndCBiZSBzZWVuLAorICAgICBzbyBk cmF3IGEgcmVjdGFuZ2xlIG9uIHRoZSBpbWFnZSBmb3IgdGhlIGN1cnNvci4KKyAgICAgRG8gdGhp cyBmb3IgYWxsIGltYWdlcywgZ2V0dGluZyB0cmFuc3BhcmVuY3kgcmlnaHQgaXMgbm90IHJlbGlh YmxlLiAqLworICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IpCisgICAgeworICAgICAgaW50IHRo aWNrbmVzcyA9IGFicyAocy0+aW1nLT5yZWxpZWYpOworICAgICAgaWYgKHRoaWNrbmVzcyA9PSAw KSB0aGlja25lc3MgPSAxOworICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEgKKyAgICAg ICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBITEVTUykKKyAgICAgIHsKKyAgICAgICAgTlND b2xvciAqYm9yZGVyX2NvbG9yID0gW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogbHNs LnJlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGdyZWVuOiBsc2wuZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogbHNsLmJsdWUKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYTogMS4wXTsK KyAgICAgICAgbnNfZHJhd19ib3ggKGJyLCB0aGlja25lc3MsIGJvcmRlcl9jb2xvciwgMSwgMSk7 CisgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIG5zX2RyYXdfYm94IChiciwgdGhpY2tuZXNz LCBGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpLCAxLCAxKTsKKyAgICB9Cit9CisKK3N0YXRpYyB2 b2lkCittY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQgKHN0cnVjdCBnbHlwaF9zdHJp bmcgKnMsIGNoYXIgZm9yY2VfcCkKK3sKKyAgTlNUUkFDRSAoIm1jX25zX21heWJlX2R1bXBnbHlw aHNfYmFja2dyb3VuZCIpOworICBpZiAoIXMtPmJhY2tncm91bmRfZmlsbGVkX3AvKiB8fCBzLT5o bCA9PSBEUkFXX01PVVNFX0ZBQ0UqLykKKyAgICB7CisgICAgICBpbnQgYm94X2xpbmVfd2lkdGgg PSBtYXggKHMtPmZhY2UtPmJveF9saW5lX3dpZHRoLCAwKTsKKyAgICAgIGlmIChGT05UX0hFSUdI VCAocy0+Zm9udCkgPCBzLT5oZWlnaHQgLSAyICogYm94X2xpbmVfd2lkdGgKKyAgICAgICAgICAv KiBXaGVuIHhkaXNwLmMgaWdub3JlcyBGT05UX0hFSUdIVCwgd2UgY2Fubm90IHRydXN0IGZvbnQK KyAgICAgICAgICAgICBkaW1lbnNpb25zLCBzaW5jZSB0aGUgYWN0dWFsIGdseXBocyBtaWdodCBi ZSBtdWNoCisgICAgICAgICAgICAgc21hbGxlci4gIFNvIGluIHRoYXQgY2FzZSB3ZSBhbHdheXMg Y2xlYXIgdGhlIHJlY3RhbmdsZQorICAgICAgICAgICAgIHdpdGggYmFja2dyb3VuZCBjb2xvci4g Ki8KKyAgICAgICAgICB8fCBGT05UX1RPT19ISUdIIChzLT5mb250KQorICAgICAgICAgIHx8IHMt PmZvbnRfbm90X2ZvdW5kX3AgfHwgcy0+ZXh0ZW5kc190b19lbmRfb2ZfbGluZV9wIHx8IGZvcmNl X3ApCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZmFjZSAqZmFjZTsKKyAgICAgICAgICBp ZiAocy0+aGwgPT0gRFJBV19NT1VTRV9GQUNFKQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBNT1VTRV9ITF9JTkZPIChzLT5mKS0+bW91c2Vf ZmFjZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgaWYgKCFmYWNlKQorICAgICAgICAgICAgICAg IGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIE1PVVNFX0ZBQ0VfSUQpOworICAgICAgICAgICAg fQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChz LT5mLCBzLT5maXJzdF9nbHlwaC0+ZmFjZV9pZCk7CisgICAgICAgICAgaWYgKCFmYWNlLT5zdGlw cGxlKQorICAgICAgICAgICAgWyhOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpICE9IDAKKyAgICAg ICAgICAgICAgPyBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChm YWNlKSwgcy0+ZikKKyAgICAgICAgICAgICAgOiBGUkFNRV9CQUNLR1JPVU5EX0NPTE9SIChzLT5m KSkgc2V0XTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgIHN0cnVjdCBuc19kaXNwbGF5X2luZm8gKmRweWluZm8gPSBGUkFNRV9ESVNQTEFZX0lORk8g KHMtPmYpOworICAgICAgICAgICAgICAgIFtbZHB5aW5mby0+Yml0bWFwc1tmYWNlLT5zdGlwcGxl LTFdLmltZyBzdGlwcGxlTWFza10gc2V0XTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIGlm IChzLT5obCAhPSBEUkFXX0NVUlNPUikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgcy0+ cmVjdGFuZ2xlX251a2VkX3AgPSB0cnVlOworICAgICAgICAgICAgICBOU1JlY3QgciA9IE5TTWFr ZVJlY3QgKHMtPngsIHMtPnkgKyBib3hfbGluZV93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHMtPmJhY2tncm91bmRfd2lkdGgsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBzLT5oZWlnaHQtMipib3hfbGluZV93aWR0aCk7CisgICAgICAgICAg ICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgfQorICAgICAgICAgIHMtPmJhY2tncm91 bmRfZmlsbGVkX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CB3aWR0aDsKKyAgICAgIHN0 cnVjdCBnbHlwaF9zdHJpbmcgKm5leHQ7CisgICAgICBmb3IgKHdpZHRoID0gMCwgbmV4dCA9IHMt Pm5leHQ7CisgICAgICAgICAgIG5leHQgJiYgd2lkdGggPCBzLT5yaWdodF9vdmVyaGFuZzsKKyAg ICAgICAgICAgd2lkdGggKz0gbmV4dC0+d2lkdGgsIG5leHQgPSBuZXh0LT5uZXh0KQorICAgICAg ICBpZiAobmV4dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgIT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAg eworICAgICAgICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlICE9IFNUUkVUQ0hfR0xZ UEgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBuID0gbnNfZ2V0X2dseXBoX3N0 cmluZ19jbGlwX3JlY3QgKHMtPm5leHQsIHIpOworICAgICAgICAgICAgICAgIGlmICghbnNfY2xp cF90b19yZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAg ICAgICAgICAgICBtY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQgKHMtPm5leHQsIDEp OworICAgICAgICAgICAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChzLT5mKTsKKyAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgbWNfbnNfZHVtcGdseXBo c19zdHJldGNoIChzLT5uZXh0LCBtYXRyaXgsIHJvdywgd2QpOworICAgICAgICAgICAgbmV4dC0+ bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICB9CisgICAgfQorICBpZiAoIXMtPmZvcl9vdmVybGFw cyAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gKKyAgICAgICYmIChzLT5maXJzdF9nbHlw aC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICAgfHwgcy0+Zmly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ZiwgciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIGlmIChzLT5m b3Jfb3ZlcmxhcHMKKyAgICAgICAgICB8fCAocy0+Y21wX2Zyb20gPiAwCisgICAgICAgICAgICAg ICYmICEgcy0+Zmlyc3RfZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykpCisgICAgICAgIHMtPmJhY2tn cm91bmRfZmlsbGVkX3AgPSAxOworICAgICAgICBlbHNlCisgICAgICAgICAgbWNfbnNfbWF5YmVf ZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLCBzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJ VEVfR0xZUEgpOworICAgICAgaW50IGZsYWdzID0gKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAg ICAgICAgICAgICAgICAgICA/IE5TX0RVTVBHTFlQSF9DVVJTT1IKKyAgICAgICAgICAgICAgICAg IDogKHMtPmhsID09IERSQVdfTU9VU0VfRkFDRSkKKyAgICAgICAgICAgICAgICAgICAgPyBOU19E VU1QR0xZUEhfTU9VU0VGQUNFCisgICAgICAgICAgICAgICAgICA6IChzLT5mb3Jfb3ZlcmxhcHMp CisgICAgICAgICAgICAgICAgICAgID8gTlNfRFVNUEdMWVBIX0ZPUkVHUk9VTkQKKyAgICAgICAg ICAgICAgICAgIDogTlNfRFVNUEdMWVBIX05PUk1BTDsKKyAgICAgIHVuc2lnbmVkIGxvbmcgc2F2 ZWRfZmcgPSBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpOworICAgICAgaWYgKHMtPmhsID09 IERSQVdfQ1VSU09SICYmIGN1cnNvcl90eXBlID09IE1DX0ZJTExFRF9CT1gpCisgICAgICAgIHsK KyAgICAgICAgICB1bnNpZ25lZCBsb25nIHRtcCA9IE5TX0ZBQ0VfQkFDS0dST1VORCAocy0+ZmFj ZSk7CisgICAgICAgICAgTlNfRkFDRV9CQUNLR1JPVU5EIChzLT5mYWNlKSA9IE5TX0ZBQ0VfRk9S RUdST1VORCAocy0+ZmFjZSk7CisgICAgICAgICAgTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNl KSA9IHRtcDsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX0NVUlNP UgorICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YCisgICAg ICAgICAgICAgICAgICYmIGFjdGl2ZV9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGVudW0g ZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPQorICAgICAgICAgICAgICBsb29rdXBfbmFt ZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1m YWNlIiksIHRydWUpOworICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFj ZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAg ICAgIE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgPSBOU19GQUNFX0ZPUkVHUk9VTkQgKGhv bGxvd19hY3RpdmVfZmFjZSk7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKHMtPmhs ID09IERSQVdfQ1VSU09SCisgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNf RlJBTUVEX0JPWAorICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAg eworICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPQor ICAgICAgICAgICAgICAgIGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBpbnRlcm4gKCIr LXJlYWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAg ICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAo cy0+ZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICBOU19GQUNFX0ZP UkVHUk9VTkQgKHMtPmZhY2UpID0gTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3dfaW5hY3RpdmVf ZmFjZSk7CisgICAgICAgICAgICB9CisgICAgICBpZiAocy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0g Q09NUE9TSVRFX0dMWVBIKQorICAgICAgICBuc19kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdf Zm9yZWdyb3VuZCAocyk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBi b29sIHdpdGhfYmdfcCA9ICgoZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX05PUk1BTCAmJiAhcy0+YmFj a2dyb3VuZF9maWxsZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGZsYWdz ID09IE5TX0RVTVBHTFlQSF9NT1VTRUZBQ0UpOworICAgICAgICAgICAgaWYgKHdpdGhfYmdfcCkK KyAgICAgICAgICAgICAgcy0+YmFja2dyb3VuZF9udWtlZF9wID0gdHJ1ZTsKKyAgICAgICAgICAg IGZvbnQtPmRyaXZlci0+ZHJhdyAocywgcy0+Y21wX2Zyb20sIHMtPm5jaGFycywgcy0+eCwgcy0+ eWJhc2UsIHdpdGhfYmdfcCk7CisgICAgICAgICAgfQorICAgICAgTlNDb2xvciAqY29sID0gKE5T X0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgIT0gMAorICAgICAgICAgICAgICAgICAgICAgPyBu c19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKSwgcy0+ ZikKKyAgICAgICAgICAgICAgICAgICAgIDogRlJB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CisgICAgICAgICAgICAgICAgICYmIGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gpCisg ICAgICAgICAgTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKSA9IHNhdmVkX2ZnOworICAgICAg bnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBHTFlQSExF U1NfR0xZUEg6CisgICAgICBuID0gbnNfZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIp OworICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQorICAgICAgICByZXR1 cm47CisgICAgICBpZiAocy0+Zm9yX292ZXJsYXBzCisgICAgICAgICAgfHwgKHMtPmNtcF9mcm9t ID4gMAorICAgICAgICAgICAgICAmJiAhIHMtPmZpcnN0X2dseXBoLT51LmNtcC5hdXRvbWF0aWMp KQorICAgICAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gMTsKKyAgICAgIGVsc2UKKyAgICAg ICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLCBzLT5maXJzdF9nbHlwaC0+ dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpOworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYp OworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICAg IH0KKyAgLyogRHJhdyBib3ggaWYgbm90IGRvbmUgYWxyZWFkeS4gKi8KKyAgaWYgKCFzLT5mb3Jf b3ZlcmxhcHMKKyAgICAgICYmICFib3hfZHJhd25fcAorICAgICAgJiYgcy0+ZmFjZS0+Ym94ICE9 IEZBQ0VfTk9fQk9YKQorICAgIHsKKyAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBf cmVjdCAocywgcik7CisgICAgICBpZiAoIW5zX2NsaXBfdG9fcmVjdCAocy0+ZiwgciwgbikpCisg ICAgICAgIHJldHVybjsKKyAgICAgIG5zX2R1bXBnbHlwaHNfYm94X29yX3JlbGllZiAocyk7Cisg ICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgfQorICBzLT5udW1fY2xpcHMgPSAw OworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KIAogICAgTlNUUkFDRSwgVHJhY2Ugc3VwcG9y dC4KQEAgLTEwNzksNiArMjA0OCwxNiBAQCBzdGF0aWMgTlNSZWN0IGNvbnN0cmFpbl9mcmFtZV9y ZWN0KE5TUmVjdCBmcmFtZVJlY3QsIGJvb2wgaXNGdWxsc2NyZWVuKQogICAgZXh0ZXJuYWwgKFJJ RikgY2FsbDsgd2hvbGUgZnJhbWUsIGNhbGxlZCBiZWZvcmUgZ3VpX3VwZGF0ZV93aW5kb3dfYmVn aW4KICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCiB7CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBm OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAjaWZkZWYgTlNfSU1QTF9DT0NPQQog ICBFbWFjc1ZpZXcgKnZpZXcgPSBGUkFNRV9OU19WSUVXIChmKTsKIApAQCAtMTEwOSw2ICsyMDg4 LDE2IEBAIHN0YXRpYyBOU1JlY3QgY29uc3RyYWluX2ZyYW1lX3JlY3QoTlNSZWN0IGZyYW1lUmVj dCwgYm9vbCBpc0Z1bGxzY3JlZW4pCiAKIC8qICAgaWYgKGYgPT0gTU9VU0VfSExfSU5GTyAoZikt Pm1vdXNlX2ZhY2VfbW91c2VfZnJhbWUpICovCiAgIE1PVVNFX0hMX0lORk8gKGYpLT5tb3VzZV9m YWNlX2RlZmVyID0gMDsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKIH0KIAogCkBAIC00NzU5LDYgKzU3NDgsMTcgQEAgaW4gY2Vy dGFpbiBzaXR1YXRpb25zIChyYXBpZCBpbmNvbWluZyBldmVudHMpLgogICAgICAgYmFyID0gW1tF bWFjc1Njcm9sbGVyIGFsbG9jXSBpbml0RnJhbWU6IHIgd2luZG93OiB3aW5dOwogICAgICAgd3Nl dF92ZXJ0aWNhbF9zY3JvbGxfYmFyICh3aW5kb3csIG1ha2VfbWludF9wdHIgKGJhcikpOwogICAg ICAgdXBkYXRlX3AgPSBZRVM7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgICAgIC8qIFRoaXMgaXMgb25seSBmb3IgZGVidWdnaW5nIHB1 cnBvc2VzLiAqLworICAgICAgW2JhciBtY19zZXRfcmVjdGFuZ2xlOiByXTsKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogICAgIH0KICAgZWxzZQogICAgIHsKQEAgLTQ3NjYsMTIgKzU3 NjYsMzAgQEAgaW4gY2VydGFpbiBzaXR1YXRpb25zIChyYXBpZCBpbmNvbWluZyBldmVudHMpLgog ICAgICAgYmFyID0gWE5TX1NDUk9MTF9CQVIgKHdpbmRvdy0+dmVydGljYWxfc2Nyb2xsX2Jhcik7 CiAgICAgICBvbGRSZWN0ID0gW2JhciBmcmFtZV07CiAgICAgICByLnNpemUud2lkdGggPSBvbGRS ZWN0LnNpemUud2lkdGg7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKICAgICAgIGlmIChGUkFNRV9MSVZFX1AgKGYpICYmICFOU0VxdWFsUmVj dHMgKG9sZFJlY3QsIHIpKQogICAgICAgICB7CisgICAgICAgICAgLyogVGhlIG1haW4gd2luZG93 IGhhcyBwcm9iYWJseSBiZWVuIHJlc2l6ZWQuICBHcmFjaW91c2x5IGRlbGV0ZSB0aGUKKyAgICAg ICAgICBvbGQgc2Nyb2xsIGJhciB3aXRob3V0IHJlcGFpbnRpbmcgaXRzIHJlY3RhbmdsZTsgYW5k LCBjcmVhdGUgYSBuZXcKKyAgICAgICAgICBzY3JvbGwgYmFyIGVsc2V3aGVyZS4qLwogICAgICAg ICAgIGlmIChvbGRSZWN0Lm9yaWdpbi54ICE9IHIub3JpZ2luLngpCisgICAgICAgICAgICB7CiAg ICAgICAgICAgICAgIG5zX2NsZWFyX2ZyYW1lX2FyZWEgKGYsIGxlZnQsIHRvcCwgd2lkdGgsIGhl aWdodCk7CisgICAgICAgICAgICAgIFtiYXIgbWNfanVkZ2VdOworICAgICAgICAgICAgICBiYXIg PSBbW0VtYWNzU2Nyb2xsZXIgYWxsb2NdIGluaXRGcmFtZTogciB3aW5kb3c6IHdpbl07CisgICAg ICAgICAgICAgIHdzZXRfdmVydGljYWxfc2Nyb2xsX2JhciAod2luZG93LCBtYWtlX21pbnRfcHRy IChiYXIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKICAgICAgICAgICBbYmFy IHNldEZyYW1lOiByXTsKICAgICAgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgICAgfQogCiAgIGlmICh1cGRhdGVfcCkKQEAgLTQ5MzEsOSArNTk0OSw1NyBAQCBpbiBjZXJ0 YWluIHNpdHVhdGlvbnMgKHJhcGlkIGluY29taW5nIGV2ZW50cykuCiAgICAgewogICAgICAgdmll dyA9IFtzdWJ2aWV3cyBvYmplY3RBdEluZGV4OiBpXTsKICAgICAgIGlmICghW3ZpZXcgaXNLaW5k T2ZDbGFzczogW0VtYWNzU2Nyb2xsZXIgY2xhc3NdXSkgY29udGludWU7Ci0gICAgICBpZiAoW3Zp ZXcganVkZ2VdKQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgIC8qIGBYU0VUV0lORE9XJyB3aWxsIHNvbWV0aW1lcyBjYXVzZSBFbWFjcyB0 byBjcmFzaCB3aGVuIHJ1bm5pbmcgdW5kZXIgZ2RiIGV2ZW4KKyAgdGhvdWdoICh3ICE9IE5VTEwp LiAgVGhlcmVmb3JlLCB3ZSBjYW5ub3QgcmVsaWFibHkgdXNlIGBXSU5ET1dfTElWRV9QJy4gKi8K KyAgc3RydWN0IHdpbmRvdyAqdyA9IFt2aWV3IG1jX2dldF93aW5kb3ddOworICBpZiAodyAhPSBO VUxMCisgICAgICAmJiBOSUxQICh3LT5jb250ZW50cykpCisgICAgeworICAgICAgQk9PTCBkZWJ1 Z19wID0gZmFsc2U7CisgICAgICBpZiAoZGVidWdfcAorICAgICAgICAgIC8qIGB3aW5kb3dfYm94 JyBjYWxscyBgd2luZG93X2JveF9oZWlnaHQnLCB3aGljaCB3aWxsIGNhdXNlIEVtYWNzIHRvCisg ICAgICAgICAgY3Jhc2ggaWYgRlJBTUVQICh3LT5mcmFtZSkgaXMgbm90IHNhdGlzZmllZC4gKi8K KyAgICAgICAgICAmJiBGUkFNRVAgKHctPmZyYW1lKSkKKyAgICAgICAgeworICAgICAgICAgIE5T UmVjdCByMCA9IFt2aWV3IG1jX2dldF9yZWN0YW5nbGVdOworICAgICAgICAgIGludCB4MCA9IE5T TWluWCAocjApOworICAgICAgICAgIGludCB5MCA9IE5TTWluWSAocjApOworICAgICAgICAgIGlu dCB3ZDAgPSBOU1dpZHRoIChyMCk7CisgICAgICAgICAgaW50IGgwID0gTlNIZWlnaHQgKHIwKTsK KyAgICAgICAgICBpbnQgd2luZG93X3ksIHdpbmRvd19oZWlnaHQ7CisgICAgICAgICAgd2luZG93 X2JveCAodywgQU5ZX0FSRUEsIDAsICZ3aW5kb3dfeSwgMCwgJndpbmRvd19oZWlnaHQpOworICAg ICAgICAgIGludCB0b3AgPSB3aW5kb3dfeTsKKyAgICAgICAgICBpbnQgaGVpZ2h0ID0gd2luZG93 X2hlaWdodDsKKyAgICAgICAgICBpbnQgd2lkdGggPSBXSU5ET1dfQ09ORklHX1NDUk9MTF9CQVJf Q09MUyAodykgKiBGUkFNRV9DT0xVTU5fV0lEVEggKGYpOworICAgICAgICAgIGludCBsZWZ0ID0g V0lORE9XX1NDUk9MTF9CQVJfQVJFQV9YICh3KTsKKyAgICAgICAgICBOU1JlY3QgcjEgPSBOU01h a2VSZWN0IChsZWZ0LCB0b3AsIHdpZHRoLCBoZWlnaHQpOworICAgICAgICAgIC8qIFRoZSBwYXJl bnQgdmlldyBpcyBmbGlwcGVkLCBzbyB3ZSBuZWVkIHRvIGZsaXAgeSB2YWx1ZS4gKi8KKyAgICAg ICAgICBFbWFjc1ZpZXcgKmZyYW1lX3ZpZXcgPSBGUkFNRV9OU19WSUVXIChmKTsKKyAgICAgICAg ICBOU1JlY3QgdiA9IFtmcmFtZV92aWV3IGZyYW1lXTsKKyAgICAgICAgICByMS5vcmlnaW4ueSA9 ICh2LnNpemUuaGVpZ2h0IC0gcjEuc2l6ZS5oZWlnaHQgLSByMS5vcmlnaW4ueSk7CisgICAgICAg ICAgaW50IHgxID0gTlNNaW5YIChyMSk7CisgICAgICAgICAgaW50IHkxID0gTlNNaW5ZIChyMSk7 CisgICAgICAgICAgaW50IHdkMSA9IE5TV2lkdGggKHIxKTsKKyAgICAgICAgICBpbnQgaDEgPSBO U0hlaWdodCAocjEpOworICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiVzIC0tIERFQUQ6XG5c CisgICAgICAgICAgeDAveDEgKCVkLyVkKSB8IHkwL3kxICglZC8lZCkgfCB3ZDAvd2QxICglZC8l ZCkgfCBoMC9oMSAoJWQvJWQpXG4iLAorICAgICAgICAgIG1jX3dpbmRvdyAodyksIHgwLCB4MSwg eTAsIHkxLCB3ZDAsIHdkMSwgaDAsIGgxKTsKKyAgICAgICAgfQorICAgICAgaWYgKFt2aWV3IG1j X2p1ZGdlXSkKICAgICAgICAgcmVtb3ZlZCA9IFlFUzsKICAgICB9CisgICAgZWxzZSBpZiAoW3Zp ZXcganVkZ2VdKQorICAgICAgcmVtb3ZlZCA9IFlFUzsKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKworICAgIH0KIAogICBpZiAocmVtb3ZlZCkKICAgICBbZXZpZXcgdXBkYXRlRnJhbWVT aXplOiBOT107CkBAIC01MDc0LDYgKzYxNDAsMjAgQEAgc3RhdGljIExpc3BfT2JqZWN0IG5zX3N0 cmluZ190b19saXNwbW9kIChjb25zdCBjaGFyICpzKQogZXh0ZXJuIGZyYW1lX3Bhcm1faGFuZGxl ciBuc19mcmFtZV9wYXJtX2hhbmRsZXJzW107CiBzdGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRl cmZhY2UgbnNfcmVkaXNwbGF5X2ludGVyZmFjZSA9CiB7CisKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNl JyBpbiBgbnN0ZXJtLm1gIG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitg cmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfbnNfZHJh d193aW5kb3dfY3Vyc29yLAorICBtY19uc19kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogICBuc19mcmFtZV9wYXJtX2hhbmRsZXJzLAogICBndWlfcHJv ZHVjZV9nbHlwaHMsCiAgIGd1aV93cml0ZV9nbHlwaHMsCkBAIC04NzExLDYgKzk3OTEsNDkgQEAg LSAoQk9PTCljYW5CZWNvbWVNYWluV2luZG93CiAKIEBpbXBsZW1lbnRhdGlvbiBFbWFjc1Njcm9s bGVyCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTogKE5TUmVjdClyZWN0Cit7CisgIG1jX3JlY3Rh bmdsZSA9IHJlY3Q7Cit9CisKKy0gKE5TUmVjdCltY19nZXRfcmVjdGFuZ2xlCit7CisgIHJldHVy biBtY19yZWN0YW5nbGU7Cit9CisKKy0gKHN0cnVjdCB3aW5kb3cgKiltY19nZXRfd2luZG93Cit7 CisgIHJldHVybiB3aW5kb3c7Cit9CisKKy0gKGJvb2wpbWNfanVkZ2UKK3sKKyAgTlNUUkFDRSAo IltFbWFjc1Njcm9sbGVyIG1jX2p1ZGdlXSIpOworICBib29sIHJldCA9IGNvbmRlbW5lZDsKKyAg YmxvY2tfaW5wdXQgKCk7CisgIGlmIChjb25kZW1uZWQpCisgICAgeworICAgICAgLyogZW5zdXJl IG90aGVyIHNjcm9sbGJhciB1cGRhdGVzIGFmdGVyIGRlbGV0aW9uICovCisgICAgICBFbWFjc1Zp ZXcgKnZpZXcgPSAoRW1hY3NWaWV3ICopRlJBTUVfTlNfVklFVyAoZnJhbWUpOworICAgICAgaWYg KHZpZXcgIT0gbmlsKQorICAgICAgICB2aWV3LT5zY3JvbGxiYXJzTmVlZGluZ1VwZGF0ZSsrOwor ICAgIH0KKyAgaWYgKHdpbmRvdykKKyAgICB3c2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHdpbmRv dywgUW5pbCk7CisgIHdpbmRvdyA9IDA7CisgIFtzZWxmIHJlbW92ZUZyb21TdXBlcnZpZXdXaXRo b3V0TmVlZGluZ0Rpc3BsYXldOworICBbc2VsZiByZWxlYXNlXTsKKyAgdW5ibG9ja19pbnB1dCAo KTsKKyAgcmV0dXJuIHJldDsKK30KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyog Zm9yIHJlcGVhdCBidXR0b24gcHVzaCAqLwogI2RlZmluZSBTQ1JPTExfQkFSX0ZJUlNUX0RFTEFZ IDAuNQogI2RlZmluZSBTQ1JPTExfQkFSX0NPTlRJTlVPVVNfREVMQVkg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jZXNzX3BlbmRpbmdfc2lnbmFscyAoKTsJCQlc CisgIH0gd2hpbGUgKGZhbHNlKQorCitzdGF0aWMgTGlzcF9PYmplY3QKK21jX3czMl9jb2xvcl9t YXBfbG9va3VwIChjb25zdCBjaGFyICpjb2xvcm5hbWUpCit7CisgIExpc3BfT2JqZWN0IHRhaWws IHJldCA9IFFuaWw7CisgIGJsb2NrX2lucHV0ICgpOworICBmb3IgKHRhaWwgPSBWdzMyX2NvbG9y X21hcDsgQ09OU1AgKHRhaWwpOyB0YWlsID0gWENEUiAodGFpbCkpCisgICAgeworICAgICAgcmVn aXN0ZXIgTGlzcF9PYmplY3QgZWx0LCB0ZW07CisgICAgICBlbHQgPSBYQ0FSICh0YWlsKTsKKyAg ICAgIGlmICghQ09OU1AgKGVsdCkpIGNvbnRpbnVlOworICAgICAgdGVtID0gWENBUiAoZWx0KTsK KyAgICAgIGlmIChsc3RyY21waSAoU1NEQVRBICh0ZW0pLCBjb2xvcm5hbWUpID09IDApCisgICAg ICAgIHsKKyAgICAgICAgICByZXQgPSBGY2RyIChlbHQpOworICAgICAgICAgIGJyZWFrOworICAg ICAgICB9CisgICAgICBNQ19RVUlUOworICAgIH0KKyAgdW5ibG9ja19pbnB1dCAoKTsKKyAgcmV0 dXJuIHJldDsKK30KKworc3RhdGljIExpc3BfT2JqZWN0CittY194X3RvX3czMl9jb2xvciAoY29u c3QgY2hhciAqIGNvbG9ybmFtZSkKK3sKKyAgcmVnaXN0ZXIgTGlzcF9PYmplY3QgcmV0ID0gUW5p bDsKKyAgYmxvY2tfaW5wdXQgKCk7CisgIGlmIChjb2xvcm5hbWVbMF0gPT0gJyMnKQorICAgIHsK KyAgICAgIC8qIENvdWxkIGJlIGFuIG9sZC1zdHlsZSBSR0IgRGV2aWNlIHNwZWNpZmljYXRpb24u ICovCisgICAgICBpbnQgc2l6ZSA9IHN0cmxlbiAoY29sb3JuYW1lICsgMSk7CisgICAgICBjaGFy ICpjb2xvciA9IGFsbG9jYSAoc2l6ZSArIDEpOworICAgICAgc3RyY3B5IChjb2xvciwgY29sb3Ju YW1lICsgMSk7CisgICAgICBpZiAoc2l6ZSA9PSAzIHx8IHNpemUgPT0gNiB8fCBzaXplID09IDkg fHwgc2l6ZSA9PSAxMikKKyAgICAgICAgeworICAgICAgICAgIFVJTlQgY29sb3J2YWw7CisgICAg ICAgICAgaW50IGksIHBvczsKKyAgICAgICAgICBwb3MgPSAwOworICAgICAgICAgIHNpemUgLz0g MzsKKyAgICAgICAgICBjb2xvcnZhbCA9IDA7CisgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDM7 IGkrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY2hhciAqZW5kOworICAgICAgICAg ICAgICBjaGFyIHQ7CisgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdmFsdWU7CisgICAgICAg ICAgICAgIC8qIFRoZSBjaGVjayBmb3IgJ3gnIGluIHRoZSBmb2xsb3dpbmcgY29uZGl0aW9uYWwg dGFrZXMgaW50bworICAgICAgICAgICAgICBhY2NvdW50IHRoZSBmYWN0IHRoYXQgc3RydG9sIGFs bG93cyBhICIweCIgaW4gZnJvbnQgb2YKKyAgICAgICAgICAgICAgb3VyIG51bWJlcnMsIGFuZCB3 ZSBkb24ndC4gKi8KKyAgICAgICAgICAgICAgaWYgKCFpc3hkaWdpdCAoY29sb3JbMF0pIHx8IGNv bG9yWzFdID09ICd4JykKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgdCA9 IGNvbG9yW3NpemVdOworICAgICAgICAgICAgICBjb2xvcltzaXplXSA9ICdcMCc7CisgICAgICAg ICAgICAgIHZhbHVlID0gc3RydG91bCAoY29sb3IsICZlbmQsIDE2KTsKKyAgICAgICAgICAgICAg Y29sb3Jbc2l6ZV0gPSB0OworICAgICAgICAgICAgICBpZiAoZXJybm8gPT0gRVJBTkdFIHx8IGVu ZCAtIGNvbG9yICE9IHNpemUpCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAg IHN3aXRjaCAoc2l6ZSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2FzZSAx OgorICAgICAgICAgICAgICAgICAgdmFsdWUgPSB2YWx1ZSAqIDB4MTA7CisgICAgICAgICAgICAg ICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIDI6CisgICAgICAgICAgICAgICAgICBi cmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIDM6CisgICAgICAgICAgICAgICAgICB2YWx1ZSAv PSAweDEwOworICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSA0 OgorICAgICAgICAgICAgICAgICAgdmFsdWUgLz0gMHgxMDA7CisgICAgICAgICAgICAgICAgICBi cmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGNvbG9ydmFsIHw9ICh2YWx1 ZSA8PCBwb3MpOworICAgICAgICAgICAgICBwb3MgKz0gMHg4OworICAgICAgICAgICAgICBpZiAo aSA9PSAyKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHVuYmxvY2tfaW5w dXQgKCk7CisgICAgICAgICAgICAgICAgICBYU0VUSU5UIChyZXQsIGNvbG9ydmFsKTsKKyAgICAg ICAgICAgICAgICAgIHJldHVybiByZXQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICBjb2xvciA9IGVuZDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgZWxzZSBp ZiAoc3RybmljbXAgKGNvbG9ybmFtZSwgInJnYjoiLCA0KSA9PSAwKQorICAgIHsKKyAgICAgIGNv bnN0IGNoYXIgKmNvbG9yOworICAgICAgVUlOVCBjb2xvcnZhbDsKKyAgICAgIGludCBpLCBwb3M7 CisgICAgICBwb3MgPSAwOworICAgICAgY29sb3J2YWwgPSAwOworICAgICAgY29sb3IgPSBjb2xv cm5hbWUgKyA0OworICAgICAgZm9yIChpID0gMDsgaSA8IDM7IGkrKykKKyAgICAgICAgeworICAg ICAgICAgIGNoYXIgKmVuZDsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIHZhbHVlOworICAgICAg ICAgIC8qIFRoZSBjaGVjayBmb3IgJ3gnIGluIHRoZSBmb2xsb3dpbmcgY29uZGl0aW9uYWwgdGFr ZXMgaW50bworICAgICAgICAgICAgIGFjY291bnQgdGhlIGZhY3QgdGhhdCBzdHJ0b2wgYWxsb3dz IGEgIjB4IiBpbiBmcm9udCBvZgorICAgICAgICAgICAgIG91ciBudW1iZXJzLCBhbmQgd2UgZG9u J3QuICovCisgICAgICAgICAgaWYgKCFpc3hkaWdpdCAoY29sb3JbMF0pIHx8IGNvbG9yWzFdID09 ICd4JykKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIHZhbHVlID0gc3RydG91bCAoY29s b3IsICZlbmQsIDE2KTsKKyAgICAgICAgICBpZiAoZXJybm8gPT0gRVJBTkdFKQorICAgICAgICAg ICAgYnJlYWs7CisgICAgICAgICAgc3dpdGNoIChlbmQgLSBjb2xvcikKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgIGNhc2UgMToKKyAgICAgICAgICAgICAgdmFsdWUgPSB2YWx1ZSAqIDB4MTAg KyB2YWx1ZTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDI6CisgICAg ICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAzOgorICAgICAgICAgICAgICB2YWx1 ZSAvPSAweDEwOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgNDoKKyAg ICAgICAgICAgICAgdmFsdWUgLz0gMHgxMDA7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAg ICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgdmFsdWUgPSBVTE9OR19NQVg7CisgICAgICAg ICAgICB9CisgICAgICAgICAgaWYgKHZhbHVlID09IFVMT05HX01BWCkKKyAgICAgICAgICAgIGJy ZWFrOworICAgICAgICAgIGNvbG9ydmFsIHw9ICh2YWx1ZSA8PCBwb3MpOworICAgICAgICAgIHBv cyArPSAweDg7CisgICAgICAgICAgaWYgKGkgPT0gMikKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgaWYgKCplbmQgIT0gJ1wwJykKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAg ICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgWFNFVElOVCAocmV0LCBjb2xv cnZhbCk7CisgICAgICAgICAgICAgIHJldHVybiByZXQ7CisgICAgICAgICAgICB9CisgICAgICAg ICAgaWYgKCplbmQgIT0gJy8nKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgY29sb3Ig PSBlbmQgKyAxOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UgaWYgKHN0cm5pY21wIChjb2xv cm5hbWUsICJyZ2JpOiIsIDUpID09IDApCisgICAgICB7CisgICAgICAgIC8qIFRoaXMgaXMgYW4g UkdCIEludGVuc2l0eSBzcGVjaWZpY2F0aW9uLiAqLworICAgICAgICBjb25zdCBjaGFyICpjb2xv cjsKKyAgICAgICAgVUlOVCBjb2xvcnZhbDsKKyAgICAgICAgaW50IGksIHBvczsKKyAgICAgICAg cG9zID0gMDsKKyAgICAgICAgY29sb3J2YWwgPSAwOworICAgICAgICBjb2xvciA9IGNvbG9ybmFt ZSArIDU7CisgICAgICAgIGZvciAoaSA9IDA7IGkgPCAzOyBpKyspCisgICAgICAgICAgeworICAg ICAgICAgICAgY2hhciAqZW5kOworICAgICAgICAgICAgZG91YmxlIHZhbHVlOworICAgICAgICAg ICAgVUlOVCB2YWw7CisgICAgICAgICAgICB2YWx1ZSA9IHN0cnRvZCAoY29sb3IsICZlbmQpOwor ICAgICAgICAgICAgaWYgKGVycm5vID09IEVSQU5HRSkKKyAgICAgICAgICAgICAgYnJlYWs7Cisg ICAgICAgICAgICBpZiAodmFsdWUgPCAwLjAgfHwgdmFsdWUgPiAxLjApCisgICAgICAgICAgICAg IGJyZWFrOworICAgICAgICAgICAgdmFsID0gKFVJTlQpKDB4MTAwICogdmFsdWUpOworICAgICAg ICAgICAgLyogV2UgdXNlZCAweDEwMCBpbnN0ZWFkIG9mIDB4RkYgdG8gZ2l2ZSBhIGNvbnRpbnVv dXMKKyAgICAgICAgICAgICAgIHJhbmdlIGJldHdlZW4gMC4wIGFuZCAxLjAgaW5jbHVzaXZlLiAg VGhlIG5leHQgc3RhdGVtZW50CisgICAgICAgICAgICAgICBmaXhlcyB0aGUgMS4wIGNhc2UuICov CisgICAgICAgICAgICBpZiAodmFsID09IDB4MTAwKQorICAgICAgICAgICAgICB2YWwgPSAweEZG OworICAgICAgICAgICAgY29sb3J2YWwgfD0gKHZhbCA8PCBwb3MpOworICAgICAgICAgICAgcG9z ICs9IDB4ODsKKyAgICAgICAgICAgIGlmIChpID09IDIpCisgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICBpZiAoKmVuZCAhPSAnXDAnKQorICAgICAgICAgICAgICAgICAgYnJlYWs7Cisg ICAgICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgICBYU0VUSU5U IChyZXQsIGNvbG9ydmFsKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gcmV0OworICAgICAgICAg ICAgICB9CisgICAgICAgICAgICBpZiAoKmVuZCAhPSAnLycpCisgICAgICAgICAgICAgIGJyZWFr OworICAgICAgICAgICAgY29sb3IgPSBlbmQgKyAxOworICAgICAgICAgIH0KKyAgICAgIH0KKyAg LyogSSBhbSBub3QgZ29pbmcgdG8gYXR0ZW1wdCB0byBoYW5kbGUgYW55IG9mIHRoZSBDSUUgY29s b3Igc2NoZW1lcworICAgICBvciBUZWtIVkMsIHNpbmNlIEkgZG9uJ3Qga25vdyB0aGUgYWxnb3Jp dGhtcyBmb3IgY29udmVyc2lvbiB0byBSR0IuCisgICAgIElmIHdlIGZhaWwgdG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lzIGFscmVhZHkgbWFwcGVkICovCisgICAgICAgICAgd2hpbGUgKGVudHJ5KQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICBpZiAoTUNfVzMyX0NPTE9SIChlbnRyeS0+ZW50cnkpID09IFhV RklYTlVNX1JBVyAodGVtKSkKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAg cHJldiA9ICZlbnRyeS0+bmV4dDsKKyAgICAgICAgICAgICAgZW50cnkgPSBlbnRyeS0+bmV4dDsK KyAgICAgICAgICAgIH0KKyAgICAgICAgICBpZiAoZW50cnkgPT0gTlVMTCAmJiBhbGxvY19wKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBub3QgYWxyZWFkeSBtYXBwZWQsIHNvIGFk ZCB0byBsaXN0ICovCisgICAgICAgICAgICAgIGVudHJ5ID0geG1hbGxvYyAoc2l6ZW9mIChzdHJ1 Y3QgdzMyX3BhbGV0dGVfZW50cnkpKTsKKyAgICAgICAgICAgICAgTUNfVzMyX1NFVF9DT0xPUiAo ZW50cnktPmVudHJ5LCBYVUZJWE5VTV9SQVcgKHRlbSkpOworICAgICAgICAgICAgICBlbnRyeS0+ bmV4dCA9IE5VTEw7CisgICAgICAgICAgICAgICpwcmV2ID0gZW50cnk7CisgICAgICAgICAgICAg IG9uZV93MzJfZGlzcGxheV9pbmZvLm51bV9jb2xvcnMrKzsKKyAgICAgICAgICAgICAgLyogc2V0 IGZsYWcgdGhhdCBwYWxldHRlIG11c3QgYmUgcmVnZW5lcmF0ZWQgKi8KKyAgICAgICAgICAgICAg b25lX3czMl9kaXNwbGF5X2luZm8ucmVnZW5fcGFsZXR0ZSA9IFRSVUU7CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICAgIC8qIEVuc3VyZSBDT0xPUlJFRiB2YWx1ZSBpcyBzbmFwcGVkIHRv IG5lYXJlc3QgY29sb3IgaW4gKGRlZmF1bHQpCisgICAgICAgICBwYWxldHRlIGJ5IHNpbXVsYXRp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IHsK KyAgICAgICAgICAgICAgYmFja2dyb3VuZF93aWR0aCAtPSBsZWZ0X3ggLSB4OworICAgICAgICAg ICAgICB4ID0gbGVmdF94OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UK KyAgICAgICAgIHsKKyAgICAgICAgICAgLyogSW4gUjJMIHJvd3MsIGRyYXcgdGhlIGN1cnNvciBv biB0aGUgcmlnaHQgZWRnZSBvZiB0aGUKKyAgICAgICAgICAgICAgc3RyZXRjaCBnbHlwaC4gKi8K KyAgICAgICAgICAgaW50IHJpZ2h0X3ggPSB3aW5kb3dfYm94X3JpZ2h0IChzLT53LCBURVhUX0FS RUEpOworICAgICAgICAgICBpZiAoeCArIGJhY2tncm91bmRfd2lkdGggPiByaWdodF94KQorICAg ICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0geCAtIHJpZ2h0X3g7CisgICAgICAgICAgIHgg Kz0gYmFja2dyb3VuZF93aWR0aDsKKyAgICAgICAgIH0KKyAgICAgIHdpZHRoID0gbWluIChGUkFN RV9DT0xVTU5fV0lEVEggKHMtPmYpLCBiYWNrZ3JvdW5kX3dpZHRoKTsKKyAgICAgIGlmIChzLT5y b3ctPnJldmVyc2VkX3ApCisgICAgICAgIHggLT0gd2lkdGg7CisgICAgICAvKiBEcmF3IGN1cnNv ci4gKi8KKyAgICAgIHczMl9kcmF3X2dseXBoX3N0cmluZ19iZ19yZWN0IChzLCB4LCBzLT55LCB3 aWR0aCwgcy0+aGVpZ2h0KTsKKyAgICAgIC8qIENsZWFyIHJlc3QgdXNpbmcgdGhlIEdDIG9mIHRo ZSBvcmlnaW5hbCBub24tY3Vyc29yIGZhY2UuICovCisgICAgICBpZiAod2lkdGggPCBiYWNrZ3Jv dW5kX3dpZHRoKQorICAgICAgICB7CisgICAgICAgICAgRW1hY3NfR0MgKmdjID0gcy0+ZmFjZS0+ Z2M7CisgICAgICAgICAgaW50IHkgPSBzLT55OworICAgICAgICAgIGludCB3ID0gYmFja2dyb3Vu ZF93aWR0aCAtIHdpZHRoLCBoID0gcy0+aGVpZ2h0OworICAgICAgICAgIFJFQ1QgcjsKKyAgICAg ICAgICBIREMgaGRjID0gcy0+aGRjOworICAgICAgICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9w KQorICAgICAgICAgICAgeCArPSB3aWR0aDsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgeCA9IHMtPng7CisgICAgICAgICAgaWYgKHMtPnJvdy0+bW91c2VfZmFjZV9wCisgICAgICAg ICAgICAgICYmIGN1cnNvcl9pbl9tb3VzZV9mYWNlX3AgKHMtPncpKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICB3MzJfc2V0X21vdXNlX2ZhY2VfZ2MgKHMpOworICAgICAgICAgICAgICBn YyA9IHMtPmdjOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICBnYyA9IHMtPmZhY2UtPmdjOworICAgICAgICAgIGdldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0 IChzLCAmcik7CisgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAoaGRjLCAmcik7Cisj aWYgMCAvKiBUT0RPOiBzdGlwcGxlICovCisgICAgICAgICAgaWYgKHMtPmZhY2UtPnN0aXBwbGUp CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIEZpbGwgYmFja2dyb3VuZCB3aXRoIGEg c3RpcHBsZSBwYXR0ZXJuLiAqLworICAgICAgICAgICAgICBYU2V0RmlsbFN0eWxlIChzLT5kaXNw bGF5LCBnYywgRmlsbE9wYXF1ZVN0aXBwbGVkKTsKKyAgICAgICAgICAgICAgWEZpbGxSZWN0YW5n bGUgKHMtPmRpc3BsYXksIHMtPndpbmRvdywgZ2MsIHgsIHksIHcsIGgpOworICAgICAgICAgICAg ICBYU2V0RmlsbFN0eWxlIChzLT5kaXNwbGF5LCBnYywgRmlsbFNvbGlkKTsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICAgIGVsc2UKKyNlbmRpZgorICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBnYy0+YmFja2dyb3VuZCwgeCwgeSwg dywgaCk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlIGlmICgh cy0+YmFja2dyb3VuZF9maWxsZWRfcCkKKyAgICAgIHsKKyAgICAgICAgaW50IGJhY2tncm91bmRf d2lkdGggPSBzLT5iYWNrZ3JvdW5kX3dpZHRoOworICAgICAgICBpbnQgeCA9IHMtPngsIGxlZnRf eCA9IHdpbmRvd19ib3hfbGVmdF9vZmZzZXQgKHMtPncsIFRFWFRfQVJFQSk7CisgICAgICAgIC8q IERvbid0IGRyYXcgaW50byBsZWZ0IG1hcmdpbiwgZnJpbmdlIG9yIHNjcm9sbGJhciBhcmVhCisg ICAgICAgICAgIGV4Y2VwdCBmb3IgaGVhZGVyIGxpbmUgYW5kIG1vZGUgbGluZS4gKi8KKyAgICAg ICAgaWYgKHggPCBsZWZ0X3ggJiYgIXMtPnJvdy0+bW9kZV9saW5lX3ApCisgICAgICAgICAgewor ICAgICAgICAgICAgYmFja2dyb3VuZF93aWR0aCAtPSBsZWZ0X3ggLSB4OworICAgICAgICAgICAg eCA9IGxlZnRfeDsKKyAgICAgICAgICB9CisgICAgICAgIGlmIChiYWNrZ3JvdW5kX3dpZHRoID4g MCkKKyAgICAgICAgICB3MzJfZHJhd19nbHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwgcy0+eSwg YmFja2dyb3VuZF93aWR0aCwgcy0+aGVpZ2h0KTsKKyAgICAgIH0KKyAgcy0+YmFja2dyb3VuZF9m aWxsZWRfcCA9IHRydWU7Cit9CisKKy8qIFNldCBTLT5nYyB0byBhIHN1aXRhYmxlIEdDIGZvciBk cmF3aW5nIGdseXBoIHN0cmluZyBTIGluIGN1cnNvcgorICAgZmFjZS4gKi8KK3N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5nYzsKKyAgICAg IHMtPnN0aXBwbGVkX3AgPSBzLT5mYWNlLT5zdGlwcGxlICE9IDA7CisgICAgfQorICAgIGVsc2Ug aWYgKHMtPmhsID09IERSQVdfSU5WRVJTRV9WSURFTykKKyAgICAgIHsKKyAgICAgICAgdzMyX3Nl dF9tb2RlX2xpbmVfZmFjZV9nYyAocyk7CisgICAgICAgIHMtPnN0aXBwbGVkX3AgPSBzLT5mYWNl LT5zdGlwcGxlICE9IDA7CisgICAgICB9CisgICAgICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX0NV UlNPUikKKyAgICAgICAgeworICAgICAgICAgIG1jX3czMl9zZXRfY3Vyc29yX2djIChzLCBjdXJz b3JfZ2NfcCk7CisgICAgICAgICAgcy0+c3RpcHBsZWRfcCA9IGZhbHNlOworICAgICAgICB9Cisg ICAgICAgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfTU9VU0VfRkFDRSkKKyAgICAgICAgICB7Cisg ICAgICAgICAgICB3MzJfc2V0X21vdXNlX2ZhY2VfZ2MgKHMpOworICAgICAgICAgICAgcy0+c3Rp cHBsZWRfcCA9IHMtPmZhY2UtPnN0aXBwbGUgIT0gMDsKKyAgICAgICAgICB9CisgICAgICAgICAg ZWxzZSBpZiAocy0+aGwgPT0gRFJBV19JTUFHRV9SQUlTRUQKKyAgICAgICAgICAgICAgICAgICB8 fCBzLT5obCA9PSBEUkFXX0lNQUdFX1NVTktFTikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgcy0+Z2MgPSBzLT5mYWNlLT5nYzsKKyAgICAgICAgICAgICAgcy0+c3RpcHBsZWRfcCA9IHMt PmZhY2UtPnN0aXBwbGUgIT0gMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIC8qIEdDIG11c3QgaGF2ZSBiZWVuIHNldC4g Ki8KKyAgZWFzc2VydCAocy0+Z2MgIT0gMCk7Cit9CisKKy8qIERyYXcgYSBob2xsb3cgYm94IGN1 cnNvciBvbiB3aW5kb3cgVyBpbiBnbHlwaCByb3cgUk9XLiAqLworc3RhdGljIHZvaWQKK21jX3cz Ml9kcmF3X2hvbGxvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRy aXggKm1hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cg KnJvdywgaW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgIGludCBocG9zLCBpbnQgdnBvcywgaW50IHdkLCBpbnQgaCkKK3sKKyAgc3RydWN0IGZy YW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgSERDIGhkYzsKKyAgUkVDVCBy ZWN0OworICBIQlJVU0ggaGIgPSBDcmVhdGVTb2xpZEJydXNoIChmLT5vdXRwdXRfZGF0YS53MzIt PmN1cnNvcl9waXhlbCk7CisgIC8qIEdldCB0aGUgZ2x5cGggdGhlIGN1cnNvciBpcyBvbi4gIElm IHdlIGNhbid0IHRlbGwgYmVjYXVzZQorICAgICB0aGUgY3VycmVudCBtYXRyaXggaXMgaW52YWxp ZCBvciBzdWNoLCBnaXZlIHVwLiAqLworICBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCA9IG1j X2dldF9jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBocG9zLCB2cG9zKTsKKyAgaWYgKGN1 cnNvcl9nbHlwaCA9PSBOVUxMKQorICAgIHsKKyAgICAgIERlbGV0ZU9iamVjdCAoaGIpOworICAg ICAgcmV0dXJuOworICAgIH0KKyAgaW50IHJsID0gZng7CisgIGludCBydCA9IGZ5OworICBpbnQg cnIgPSBybCArIHdkOworICBpbnQgcmIgPSBydCArIGg7CisgIC8vICBmcHJpbnRmIChzdGRlcnIs ICJNQ19IT0xMT1dfQk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VhUX0FSRUEsIGhkYyk7CisgICAgICAg IGludCByeCA9IGZ4OworICAgICAgICBpbnQgcnkgPSBmeTsKKyAgICAgICAgaW50IHJ3ID0gd2Q7 CisgICAgICAgIGludCByaCA9IGg7CisgICAgICAgIC8vICBmcHJpbnRmIChzdGRlcnIsICJNQ19I QkFSOiAgZnggKCVkKSB8IGZ5ICglZCkgfCB3ZCAoJWQpIHwgaCAoJWQpXG4iLAorICAgICAgICAv LyAgICAgICAgICAgICAgICAgICByeCwgcnksIHJ3LCByaCk7CisgICAgICAgIHczMl9maWxsX2Fy ZWEgKGYsIGhkYywgY3Vyc29yX2NvbG9yLCByeCwgcnksIHJ3LCByaCk7CisgICAgICAgIHczMl9z ZXRfY2xpcF9yZWN0YW5nbGUgKGhkYywgTlVMTCk7CisgICAgICAgIHJlbGVhc2VfZnJhbWVfZGMg KGYsIGhkYyk7CisgICAgICB9Cit9CisKKy8qIFJJRjogRHJhdyBvciBjbGVhciBjdXJzb3Igb24g d2luZG93IFcuICovCitzdGF0aWMgdm9pZAorbWNfdzMyX2RyYXdfd2luZG93X2N1cnNvciAoc3Ry dWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhf cm93ICpyb3csCisgICAgICAgICAgICAgICAgICBpbnQgeCwgaW50IGZ4LCBpbnQgeSwgaW50IGZ5 LCBpbnQgaHBvcywgaW50IHZwb3MsIGludCB3ZCwgaW50IGgsCisgICAgICAgICAgICAgICAgICBz dHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwKKyAgICAg ICAgICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGgsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZv ciwgYm9vbCBvbl9wLCBib29sIGFjdGl2ZV9wKQoreworICBpZiAob25fcCkKKyAgICB7CisgICAg ICAvKiBJZiB0aGlzIGlzIHRoZSBhY3RpdmUgY3Vyc29yLCB3ZSBuZWVkIHRvIHRyYWNrIGl0IHdp dGggdGhlCisgICAgICBzeXN0ZW0gY2FyZXQsIHNvIHRoaXJkIHBhcnR5IHNvZnR3YXJlIGxpa2Ug c2NyZWVuIG1hZ25pZmllcnMKKyAgICAgIGFuZCBzcGVlY2ggc3ludGhlc2l6ZXJzIGNhbiBmb2xs b3cgdGhlIGN1cnNvci4gKi8KKyAgICAgIGlmIChhY3RpdmVfcCkKKyAgICAgICAgeworICAgICAg ICAgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICAgICAg ICAgSFdORCBod25kID0gRlJBTUVfVzMyX1dJTkRPVyAoZik7CisgICAgICAgICAgdzMyX3N5c3Rl bV9jYXJldF94CisgICAgICAgICAgICA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVMX1ggKHcs IHgpOworICAgICAgICAgIC8qIEZJWE1FOiAgV2hhdCBzaG91bGQgd2UgdXNlIGluc3RlYWQgb2Yg YHctPnBoeXNfY3Vyc29yX2FzY2VudCc/ICovCisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJldF95 CisgICAgICAgICAgICA9IChXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgeSkKKyAgICAgICAg ICAgICAgICsgcm93LT5hc2NlbnQgLSB3LT5waHlzX2N1cnNvcl9hc2NlbnQpOworICAgICAgICAg IHczMl9zeXN0ZW1fY2FyZXRfd2luZG93ID0gdzsKKyAgICAgICAgICB3MzJfc3lzdGVtX2NhcmV0 X2hkcl9oZWlnaHQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgICAgICB3 MzJfc3lzdGVtX2NhcmV0X21vZGVfaGVpZ2h0ID0gV0lORE9XX01PREVfTElORV9IRUlHSFQgKHcp OworICAgICAgICAgIFBvc3RNZXNzYWdlIChod25kLCBXTV9JTUVfU1RBUlRDT01QT1NJVElPTiwg MC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AgICAgICAgICAgICAgZWxzZSBp ZiAoYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGVu dW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywg ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAg ICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9G Uk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBn Y192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZDsKKyAg ICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX2Zh Y2UtPmJhY2tncm91bmQ7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBl bHNlIGlmICghYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFt ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16 di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xs b3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2Vf aWQpOworICAgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3JvdW5kID0gaG9sbG93 X2luYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFs dWVzLmJhY2tncm91bmQgPSBob2xsb3dfaW5hY3RpdmVfZmFjZS0+YmFja2dyb3VuZDsKKyAgICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2dj ID0gWENyZWF0ZUdDIChOVUxMLCBGUkFNRV9XMzJfV0lORE9XIChmKSwgbWFzaywgJmdjX3ZhbHVl cyk7CisgICAgICAgICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgLyogRm9yY2UgYG1jX3cz Ml9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2dj Jy4gKi8KKyAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICBtY19k cmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9zLCB2 cG9zLCBsc2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwg Y3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAgIGYtPm91 dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djID0gb3JpZ2luYWxfY3Vyc29yX2djOworICAgICAgICAg IHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAgZi0+b3V0cHV0X2Rh dGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBtY193MzJfZHJh d19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9z LCB3ZCwgaCk7CisgICAgICAg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AgICAgICAg IGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdfZmFjZV9pZCA9IGxvb2t1cF9u YW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItYXQtcmVnaW9uLXBy ZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxv d19hY3RpdmVfcmVnaW9uX2JlZ19mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZl X3JlZ2lvbl9iZWdfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9s bG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIist cmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAg IHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxv d19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3Vu ZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgIGdj X3ZhbHVlcy5iYWNrZ3JvdW5kID0gaG9sbG93X2FjdGl2ZV9yZWdpb25fYmVnX2ZhY2UtPmZvcmVn cm91bmQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKHJlZ2lv bl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID09IHJlZ2lvbl9lbmQp CisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgIC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CisgICAgICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhv bGxvd19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIr LXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAg ICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChm LCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFs dWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAg ICAgICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19hY3RpdmVfZmFj ZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAg ICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2Vf aWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29y LWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAg ICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhv bGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFs dWVzLmZvcmVncm91bmQgPSBob2xsb3dfaW5hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfaW5hY3Rp dmVfZmFjZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MgPSBYQ3JlYXRlR0MgKE5VTEwsIEZS QU1FX1czMl9XSU5ET1cgKGYpLCBtYXNrLCAmZ2NfdmFsdWVzKTsKKyAgICAgICAgICAgICAgYmxv Y2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgIC8qIEZvcmNlIGBtY193MzJfc2V0X2N1cnNvcl9n YycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycuICovCisgICAgICAg ICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSB0cnVlOworICAgICAgICAgICAgICBtY19kcmF3X2N1 cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsLCBnbHlwaF9mbGF2b3IsIGN1 cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgZi0+ b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MgPSBvcmlnaW5hbF9jdXJzb3JfZ2M7CisgICAgICAg ICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgIG1jX3czMl9kcmF3X2hvbGxv d19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBo KTsKKyAgICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0hPTExP V19CT1g6CisgICAgeworICAgICAgaWYgKGxzbC5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vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgfQorICAg ICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfQkFSOgorICAgIHsKKyAgICAgIGlmIChsc2wu cmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgewor ICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJz b3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVs ID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlf cCA9IHRydWU7CisgICAgICAgICAgbWNfdzMyX2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCBy b3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaCwgY3Vyc29yX3dpZHRoLCBNQ19CQVIsIGN1cnNvcl9nY19pbnZpc2libGVf b2theV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9y aWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAg eworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IGZhbHNlOwor ICAgICAgICAgICAgbWNfdzMyX2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4 LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3Ap OworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0hCQVI6Cisg ICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1 ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAgZi0+b3V0cHV0X2Rh dGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBib29sIGN1cnNv cl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY193MzJfZHJhd19iYXJf Y3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIs IGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53 MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAg ICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNp YmxlX29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfdzMyX2RyYXdfYmFyX2N1cnNvciAo dywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNv cl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9 CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICB9CisgICAgfQorfQorCisv KiBEcmF3IGdseXBoIHN0cmluZyBTLiAqLworc3RhdGljIHZvaWQKK21jX3czMl9kcmF3X2dseXBo X3N0cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0 cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgIHN0 cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsCisgICAgICAgICAg ICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUsIGludCBjdXJz b3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3AsIGJvb2wg Y3Vyc29yX2djX3ApCit7CisgIGJvb2wgcmVsaWVmX2RyYXduX3AgPSAwOworICAvKiBJZiBTIGRy YXdzIGludG8gdGhlIGJhY2tncm91bmQgb2YgaXRzIHN1Y2Nlc3NvciwgZHJhdyB0aGUKKyAgICAg YmFja2dyb3VuZCBvZiB0aGUgc3VjY2Vzc29yIGZpcnN0IHNvIHRoYXQgUyBjYW4gZHJhdyBpbnRv IGl0LgorICAgICBUaGlzIG1ha2VzIFMtPm5leHQgdXNlIFhEcmF3U3RyaW5nIGluc3RlYWQgb2Yg WERyYXdJbWFnZVN0cmluZy4gKi8KKyAgaWYgKHMtPm5leHQgJiYgcy0+cmlnaHRfb3Zlcmhhbmcg JiYgIXMtPmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICBpbnQgd2lkdGg7CisgICAgICBzdHJ1 Y3QgZ2x5cGhfc3RyaW5nICpuZXh0OworICAgICAgZm9yICh3aWR0aCA9IDAsIG5leHQgPSBzLT5u ZXh0OworICAgICAgICAgICBuZXh0ICYmIHdpZHRoIDwgcy0+cmlnaHRfb3Zlcmhhbmc7CisgICAg ICAgICAgIHdpZHRoICs9IG5leHQtPndpZHRoLCBuZXh0ID0gbmV4dC0+bmV4dCkKKyAgICAgICAg aWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlICE9IElNQUdFX0dMWVBIKQorICAgICAgICAgIHsK KyAgICAgICAgICAgIG1jX3czMl9zZXRfZ2x5cGhfc3RyaW5nX2djIChuZXh0LCBjdXJzb3JfZ2Nf cCk7CisgICAgICAgICAgICB3MzJfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZyAobmV4dCk7Cisg ICAgICAgICAgICBpZiAobmV4dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQSCkK KyAgICAgICAgICAgICAgbWNfdzMyX2RyYXdfc3RyZXRjaF9nbHlwaF9zdHJpbmcgKG5leHQpOwor ICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgdzMyX2RyYXdfZ2x5cGhfc3RyaW5n X2JhY2tncm91bmQgKG5leHQsIHRydWUpOworICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0g MDsKKyAgICAgICAgICB9CisgICAgfQorICAvKiBTZXQgdXAgUy0+Z2MsIHNldCBjbGlwcGluZyBh bmQgZHJhdyBTLiAqLworICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAocywgY3Vyc29yX2dj X3ApOworICAvKiBEcmF3IHJlbGllZiAoaWYgYW55KSBpbiBhZHZhbmNlIGZvciBjaGFyL2NvbXBv c2l0aW9uIHNvIHRoYXQgdGhlCisgICAgIGdseXBoIHN0cmluZyBjYW4gYmUgZHJhd24gb3ZlciBp dC4gKi8KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMKKyAgICAgICYmIHMtPmZhY2UtPmJveCAhPSBG QUNFX05PX0JPWAorICAgICAgJiYgKHMtPmZpcnN0X2dseXBoLT50eXBlID09IEN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y0+Zmlyc3RfZ2x5cGgtPnR5cGUpCisgICAgeworICAgIGNhc2UgSU1B R0VfR0xZUEg6CisgICAgICB3MzJfZHJhd19pbWFnZV9nbHlwaF9zdHJpbmcgKHMpOworICAgICAg YnJlYWs7CisgICAgY2FzZSBTVFJFVENIX0dMWVBIOgorICAgICAgbWNfdzMyX2RyYXdfc3RyZXRj aF9nbHlwaF9zdHJpbmcgKHMpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBDSEFSX0dMWVBIOgor ICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRf cCA9IHRydWU7CisgICAgICBlbHNlCisgICAgICAgIHczMl9kcmF3X2dseXBoX3N0cmluZ19iYWNr Z3JvdW5kIChzLCBmYWxzZSk7CisgICAgICB3MzJfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3Vu ZCAocyk7CisgICAgICBicmVhazsKKyAgICBjYXNlIENPTVBPU0lURV9HTFlQSDoKKyAgICAgIGlm IChzLT5mb3Jfb3ZlcmxhcHMgfHwgKHMtPmNtcF9mcm9tID4gMAorICAgICAgICAgICYmICEgcy0+ Zmlyc3RfZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykpCisgICAgICAgIHMtPmJhY2tncm91bmRfZmls bGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICAgICAgICB3MzJfZHJhd19nbHlwaF9zdHJpbmdf YmFja2dyb3VuZCAocywgdHJ1ZSk7CisgICAgICB3MzJfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3Ry aW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBHTFlQSExFU1NfR0xZ UEg6CisgICAgICBpZiAocy0+Zm9yX292ZXJsYXBzKQorICAgICAgICBzLT5iYWNrZ3JvdW5kX2Zp bGxlZF9wID0gdHJ1ZTsKKyAgICAgIGVsc2UKKyAgICAgICAgdzMyX2RyYXdfZ2x5cGhfc3RyaW5n X2JhY2tncm91bmQgKHMsIGZhbHNlKTsKKyAgICAgIHczMl9kcmF3X2dseXBobGVzc19nbHlwaF9z dHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAg ZW1hY3NfYWJvcnQgKCk7CisgICAgfQorICBpZiAoIXMtPmZvcl9vdmVybGFwcykKKyAgICB7Cisg ICAgICAvKiBEcmF3IHVuZGVybGluZS4gKi8KKyAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVf cCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBG QUNFX1VOREVSX1dBVkUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIENPTE9SUkVGIGNv bG9yOworICAgICAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQor ICAgICAgICAgICAgICAgIGNvbG9yID0gcy0+Z2MtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgICAgY29sb3IgPSBzLT5mYWNlLT51bmRlcmxpbmVfY29s b3I7CisgICAgICAgICAgICAgIHczMl9kcmF3X3VuZGVyd2F2ZSAocywgY29sb3IpOworICAgICAg ICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZB Q0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgdW5zaWduZWQgbG9u ZyB0aGlja25lc3MsIHBvc2l0aW9uOworICAgICAgICAgICAgICBpbnQgeTsKKyAgICAgICAgICAg ICAgaWYgKHMtPnByZXYgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3AKKyAgICAgICAgICAg ICAgICAgICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElO RSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBXZSB1c2UgdGhlIHNh bWUgdW5kZXJsaW5lIHN0eWxlIGFzIHRoZSBwcmV2aW91cyBvbmUuICovCisgICAgICAgICAgICAg ICAgICB0aGlja25lc3MgPSBzLT5wcmV2LT51bmRlcmxpbmVfdGhpY2tuZXNzOworICAgICAgICAg ICAgICAgICAgcG9zaXRpb24gPSBzLT5wcmV2LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgLyogR2V0IHRoZSB1bmRlcmxpbmUgdGhpY2tuZXNzLiAgRGVmYXVsdCBpcyAx IHBpeGVsLiAqLworICAgICAgICAgICAgICAgICAgaWYgKHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5k ZXJsaW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMt PmZvbnQtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAgICAgICAgICAgICAgICAgaWYg KHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRfbGluZSkKKyAgICAgICAgICAgICAgICAgICAgcG9zaXRp b24gPSAocy0+aGVpZ2h0IC0gdGhpY2tuZXNzKSAtIChzLT55YmFzZSAtIHMtPnkpOworICAgICAg ICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICAgICAgLyogR2V0IHRoZSB1bmRlcmxpbmUgcG9zaXRpb24uICBUaGlzIGlzIHRoZSBy ZWNvbW1lbmRlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdmVydGljYWwgb2Zmc2V0IGlu IHBpeGVscyBmcm9tIHRoZSBiYXNlbGluZSB0byB0aGUgdG9wIG9mCisgICAgICAgICAgICAgICAg ICAgICAgICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBpcyBhIHNpZ25lZCB2YWx1ZSBhY2NvcmRp bmcgdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGVjcywgYW5kIGl0cyBkZWZh dWx0IGlzCisgICAgICAgICAgICAgICAgICAgICAgICAgICBST1VORCAoKG1heGltdW1fZGVzY2Vu dCkgLyAyKSwgd2l0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgUk9VTkQgKHgpID0gZmxv b3IgKHggKyAwLjUpICAqLworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHhfdXNlX3VuZGVy bGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg cy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb24gPj0gMCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb247Cisg ICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChzLT5mb250KQorICAgICAgICAgICAgICAg ICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5mb250LT5kZXNjZW50ICsgMSkgLyAyOworICAgICAg ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbWF4IChwb3Np dGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAgICAgICAgICAgICB9CisgICAg ICAgICAgICAgIC8qIENoZWNrIHRoZSBzYW5pdHkgb2YgdGhpY2tuZXNzIGFuZCBwb3NpdGlvbi4g IFdlIHNob3VsZAorICAgICAgICAgICAgICAgICBhdm9pZCBkcmF3aW5nIHVuZGVybGluZSBvdXQg b2YgdGhlIGN1cnJlbnQgbGluZSBhcmVhLiAqLworICAgICAgICAgICAgICBpZiAocy0+eSArIHMt PmhlaWdodCA8PSBzLT55YmFzZSArIHBvc2l0aW9uKQorICAgICAgICAgICAgICAgIHBvc2l0aW9u ID0gKHMtPmhlaWdodCAtIDEpIC0gKHMtPnliYXNlIC0gcy0+eSk7CisgICAgICAgICAgICAgIGlm IChzLT55ICsgcy0+aGVpZ2h0IDwgcy0+eWJhc2UgKyBwb3NpdGlvbiArIHRoaWNrbmVzcykKKyAg ICAgICAgICAgICAgICB0aGlja25lc3MgPSAocy0+eSArIHMtPmhlaWdodCkgLSAocy0+eWJhc2Ug KyBwb3NpdGlvbik7CisgICAgICAgICAgICAgIHMtPnVuZGVybGluZV90aGlja25lc3MgPSB0aGlj a25lc3M7CisgICAgICAgICAgICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9cG9zaXRpb247Cisg ICAgICAgICAgICAgIHkgPSBzLT55YmFzZSArIHBvc2l0aW9uOworICAgICAgICAgICAgICBpZiAo cy0+ZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgICAgIHczMl9maWxs X2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+Z2MtPmZvcmVncm91bmQsIHMtPngsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgeSwgcy0+d2lkdGgsIDEpOworICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFj ZS0+dW5kZXJsaW5lX2NvbG9yLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgeSwgcy0+d2lkdGgsIDEpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAvKiBE cmF3IG92ZXJsaW5lLiAqLworICAgICAgaWYgKHMtPmZhY2UtPm92ZXJsaW5lX3ApCisgICAgICAg IHsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIGR5ID0gMCwgaCA9IDE7CisgICAgICAgICAgaWYg KHMtPmZhY2UtPm92ZXJsaW5lX2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgdzMyX2Zp bGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5nYy0+Zm9yZWdyb3VuZCwgcy0+eCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmZhY2Ut Pm92ZXJsaW5lX2NvbG9yLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT55 ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgfQorICAgICAgLyogRHJhdyBzdHJpa2UtdGhy b3VnaC4gKi8KKyAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9wCisgICAgICAgICAg JiYgIUZPTlRfVEVYVE1FVFJJQyAocy0+Zm9udCkudG1TdHJ1Y2tPdXQpCisgICAgICAgIHsKKyAg ICAgICAgICB1bnNpZ25lZCBsb25nIGggPSAxOworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZHkg PSAocy0+aGVpZ2h0IC0gaCkgLyAyOworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2VfdGhy b3VnaF9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYs IHMtPmhkYywgcy0+Z2MtPmZvcmVncm91bmQsIHMtPngsIHMtPnkgKyBkeSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5mYWNlLT5zdHJpa2VfdGhyb3Vn aF9jb2xvciwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+eSArIGR5LCBz LT53aWR0aCwgaCk7CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgcmVsaWVmIGlmIG5vdCB5ZXQg ZHJhd24uICovCisgICAgICBpZiAoIXJlbGllZl9kcmF3bl9wICYmIHMtPmZhY2UtPmJveCAhPSBG QUNFX05PX0JPWCkKKyAgICAgICAgdzMyX2RyYXdfZ2x5cGhfc3RyaW5nX2JveCAocyk7CisgICAg ICBpZiAocy0+cHJldikKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcg KnByZXY7CisgICAgICAgICAgZm9yIChwcmV2ID0gcy0+cHJldjsgcHJldjsgcHJldiA9IHByZXYt PnByZXYpCisgICAgICAgICAgICBpZiAocHJldi0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAg ICAmJiBwcmV2LT54ICsgcHJldi0+d2lkdGggKyBwcmV2LT5yaWdodF9vdmVyaGFuZyA+IHMtPngp CisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBcyBwcmV2IHdhcyBkcmF3biB3 aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwgd2UKKyAgICAgICAgICAgICAgICAgICBtdXN0 IGRyYXcgdGhlIHJpZ2h0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwgbm93LiAqLworICAgICAg ICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gcHJldi0+aGw7CisgICAgICAg ICAgICAgICAgcHJldi0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY193MzJfc2V0X2ds eXBoX3N0cmluZ19nYyAocHJldiwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICAgIHczMl9z ZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nX2V4YWN0bHkgKHMsIHByZXYpOworICAgICAgICAgICAg ICAgIGlmIChwcmV2LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBIKQorICAgICAgICAg ICAgICAgICAgdzMyX2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgICAg ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB3MzJfZHJhd19jb21wb3NpdGVf Z2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAgICAgIHczMl9zZXRf Y2xpcF9yZWN0YW5nbGUgKHByZXYtPmhkYywgTlVMTCk7CisgICAgICAgICAgICAgICAgcHJldi0+ aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIHByZXYtPm51bV9jbGlwcyA9IDA7CisgICAgICAg ICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHMtPm5leHQpCisgICAgICAgIHsKKyAgICAg ICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpuZXh0OworICAgICAgICAgIGZvciAobmV4dCA9IHMt Pm5leHQ7IG5leHQ7IG5leHQgPSBuZXh0LT5uZXh0KQorICAgICAgICAgICAgaWYgKG5leHQtPmhs ICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYgbmV4dC0+eCAtIG5leHQtPmxlZnRfb3Zlcmhh bmcgPCBzLT54ICsgcy0+d2lkdGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAv KiBBcyBuZXh0IHdpbGwgYmUgZHJhd24gd2hpbGUgY2xpcHBlZCB0byBpdHMgb3duIGFyZWEsCisg ICAgICAgICAgICAgICAgICAgd2UgbXVzdCBkcmF3IHRoZSBsZWZ0X292ZXJoYW5nIHBhcnQgdXNp bmcgcy0+aGwgbm93LiAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBz YXZlID0gbmV4dC0+aGw7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzLT5obDsKKyAgICAg ICAgICAgICAgICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4dCwgY3Vyc29yX2djX3Ap OworICAgICAgICAgICAgICAgIHczMl9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nX2V4YWN0bHkg KHMsIG5leHQpOworICAgICAgICAgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSA9 PSBDSEFSX0dMWVBIKQorICAgICAgICAgICAgICAgICAgdzMyX2RyYXdfZ2x5cGhfc3RyaW5nX2Zv cmVncm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAg ICAgICB3MzJfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOwor ICAgICAgICAgICAgICAgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKG5leHQtPmhkYywgTlVMTCk7 CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIG5leHQt Pm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgICAgbmV4dC0+Y2xpcF9oZWFkID0gcy0+bmV4 dDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAvKiBSZXNldCBjbGlwcGlu Zy4gKi8KKyAgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAocy0+aGRjLCBOVUxMKTsKKyAgcy0+bnVt X2NsaXBzID0gMDsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIC8qIEZyaW5nZSBiaXRtYXBzLiAgKi8KIAogc3RhdGljIGludCBt YXhfZnJpbmdlX2JtcCA9IDA7CkBAIC01NDIsNiArMTcwMSwxNSBAQCB3MzJfdXBkYXRlX2JlZ2lu IChzdHJ1Y3QgZnJhbWUgKmYpCiAgIGlmICghIEZSQU1FX1czMl9QIChmKSkKICAgICByZXR1cm47 CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBmOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAgIC8qIFJlZ2VuZXJhdGUgZGlzcGxheSBwYWxldHRlIGJlZm9yZSBkcmF3aW5nIGlmIGxp c3Qgb2YgcmVxdWVzdGVkCiAgICAgIGNvbG9ycyBoYXMgY2hhbmdlZC4gKi8KICAgaWYgKGRpc3Bs YXlfaW5mby0+cmVnZW5fcGFsZXR0ZSkKQEAgLTY3NCw2ICsxODQyLDE2IEBAIHczMl91cGRhdGVf ZW5kIChzdHJ1Y3QgZnJhbWUgKmYpCiAKICAgLyogTW91c2UgaGlnaGxpZ2h0IG1heSBiZSBkaXNw bGF5ZWQgYWdhaW4uICAqLwogICBNT1VTRV9ITF9JTkZPIChmKS0+bW91c2VfZmFjZV9kZWZlciA9 IGZhbHNlOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gTlVMTDsKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogfQogCiAKQEAgLTQwMDIsMTMgKzUxODAsNzQgQEAgdzMyX3NldF92ZXJ0 aWNhbF9zY3JvbGxfYmFyIChzdHJ1Y3Qgd2luZG93ICp3LAogCSAgICAgIHJlbGVhc2VfZnJhbWVf ZGMgKGYsIGhkYyk7CiAJICAgICAgdzMyX2NsZWFyX3VuZGVyX2ludGVyb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gICAgICAgICAgICAgICAgIFNXUF9GUkFNRUNI QU5HRUQpOworICAgICAgICAgIGlmIChsZWZ0IDw9IGJhci0+bGVmdCkKKyAgICAgICAgICAgIG15 X3Nob3dfd2luZG93IChmLCBod25kLCBTV19ISURFKTsKKyAgICAgICAgICBNb3ZlV2luZG93ICho d25kLCBsZWZ0LCB0b3AsIHdpZHRoLCBtYXggKGhlaWdodCwgMSksIGxlZnQgPD0gYmFyLT5sZWZ0 KTsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCiAKIAkgIHNpLmNiU2l6ZSA9IHNpemVvZiAoc2kpOwogCSAgc2kuZk1hc2sgPSBTSUZfUkFO R0U7CkBAIC00Mjc3LDYgKzU1MTYsMjEgQEAgdzMyX2p1ZGdlX3Njcm9sbF9iYXJzIChzdHJ1Y3Qg ZnJhbWUgKmYpCiAgICAgewogICAgICAgc3RydWN0IHNjcm9sbF9iYXIgKmIgPSBYU0NST0xMX0JB UiAoYmFyKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNP UlMgKi8KKworICAgICAgLyogYERlc3Ryb3lXaW5kb3cnIHdpdGhpbiBgeF9zY3JvbGxfYmFyX3Jl bW92ZScgcmVwYWludHMgdGhlIHJlY3RhbmdsZS4KKyAgICAgIFRoZXJlZm9yZSwgd2UgZmlyc3Qg c2VuZCBhIG1lc3NhZ2UgdG8gaW5oaWJpdCByZXBhaW50aW5nLiAqLworICAgICAgaWYgKCFXSU5E T1dfTElWRV9QIChiLT53aW5kb3cpKQorICAgICAgICB7CisgICAgICAgICAgSFdORCBod25kID0g U0NST0xMX0JBUl9XMzJfV0lORE9XIChiKTsKKyAgICAgICAgICBTZW5kTWVzc2FnZSAoaHduZCwg V01fU0VUUkVEUkFXLCBmYWxzZSwgMCk7CisgICAgICAgIH0KKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICAgICAgdzMyX3Njcm9sbF9iYXJfcmVtb3ZlIChiKTsKIAogICAgICAgbmV4 dCA9IGItPm5leHQ7CkBAIC03MDg4LDYgKzgzNDIsMjAgQEAgZXh0ZXJuIGZyYW1lX3Bhcm1faGFu ZGxlciB3MzJfZnJhbWVfcGFybV9oYW5kbGVyc1tdOwogCiBzdGF0aWMgc3RydWN0IHJlZGlzcGxh eV9pbnRlcmZhY2UgdzMyX3JlZGlzcGxheV9pbnRlcmZhY2UgPQogeworCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBgcmVkaXNwbGF5X2lu dGVyZmFjZScgaW4gYHczMnRlcm0uY2AgbXVzdCBiZSBpbiB0aGUgZXhhY3Qgc2FtZSBvcmRlciBh cyB0aGUKK2ByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4dGVybi5oYCEgKi8KKworICBt Y193MzJfZHJhd193aW5kb3dfY3Vyc29yLAorICBtY193MzJfZHJhd19nbHlwaF9zdHJpbmcsCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgdzMyX2ZyYW1lX3Bhcm1faGFuZGxlcnMs CiAgIGd1aV9wcm9kdWNlX2dseXBocywKICAgZ3VpX3dyaXRlX2dseXBocywKZGlmZiAtLWdpdCBh L3NyYy93aW5kb3cuaCBiL3NyYy93aW5kb3cuaAppbmRleCA2YjBmMGU1Li4xNGRk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GludCBmeDsKKyAgICAgIGludCB5OworICAgICAgaW50IGZ5 OworICAgICAgaW50IGhwb3M7CisgICAgICBpbnQgdnBvczsKKyAgICAgIGludCB3ZDsKKyAgICAg IGludCBoOworICAgICAgZW51bSBtY19jdXJzb3JfdHlwZQorICAgICAgeworICAgICAgICAvKiBO T1RFOiAgVGhlIGZyaW5nZSBiaXRtYXAgZnJhbWV3b3JrIHJlbGllcyB1cG9uIE1DX05PX0ZSSU5H RV9CSVRNQVAKKyAgICAgICAgaGF2aW5nIGEgdmFsdWUgb2YgemVybyAoMCkuICovCisgICAgICAg IE1DX05PX0ZSSU5HRV9CSVRNQVAsCisgICAgICAgIE1DX05PX0NVUlNPUiwKKyAgICAgICAgTUNf UklHSFRfRlJJTkdFX0JJVE1BUCwKKyAgICAgICAgTUNfTEVGVF9GUklOR0VfQklUTUFQLAorICAg ICAgICBNQ19GUkFNRURfQk9YLAorICAgICAgICBNQ19GSUxMRURfQk9YLAorICAgICAgICBNQ19I T0xMT1dfQk9YLAorICAgICAgICBNQ19CQVIsCisgICAgICAgIE1DX0hCQVIKKyAgICAgIH0gY3Vy c29yX3R5cGU7CisgICAgICBpbnQgY3Vyc29yX3dpZHRoOworICAgICAgc3RydWN0IG1jX1JHQgor ICAgICAgeworICAgICAgICBkb3VibGUgcmVkOworICAgICAgICBkb3VibGUgZ3JlZW47CisgICAg ICAgIGRvdWJsZSBibHVlOworICAgICAgfSBmZywgYmc7CisgICAgICBib29sX2JmIGFjdGl2ZV9w IDogMTsKKyAgICAgIGVudW0gbWNfZmxhdm9yCisgICAgICB7CisgICAgICAgIE5PX0ZMQVZPUiwK KyAgICAgICAgTUNfR0xZUEgsCisgICAgICAgIE1DX0dMWVBITEVTUywKKyAgICAgICAgTUNfT1ZF UkxBWV9BUlJPV19CSVRNQVAsCisgICAgICAgIE1DX1BJTENST1csCisgICAgICAgIE1DX0hPTExP V19SRUNUQU5HTEVfUklHSFRfQVJST1csCisgICAgICAgIE1DX1JFVkVSU0VEX0hPTExPV19SRUNU QU5HTEVfUklHSFRfQVJST1csCisgICAgICAgIE1DX0hPTExPV19SRUNUQU5HTEUsCisgICAgICAg IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVywKKyAgICAgICAgTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XLAorICAgICAgICBNQ19WRVJUSUNBTF9CQVIsCisgICAgICAgIE1D X1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUiwKKyAgICAgICAgTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFT SAorICAgICAgfSBnbHlwaF9mbGF2b3I7CisgICAgICBlbnVtIG1jX3Jvd19wb3NpdGlvbgorICAg ICAgeworICAgICAgICBQUkVfWlYsCisgICAgICAgIEFUX1pWLAorICAgICAgICBQT1NUX1pWCisg ICAgICB9IHJvd19wb3NpdGlvbjsKKyAgICAgIGJvb2xfYmYgZW5hYmxlZF9wIDogMTsKKyAgICB9 ICpjYWNoZVs0XTsKKyAgfSAqdnBvczsKKyAgLyogVXNlZCBlbHNld2hlcmUuICovCisgIHN0cnVj dCBtY19lc3NlbnRpYWxzCisgIHsKKyAgICBib29sX2JmIGFjdGl2ZV9wIDogMTsKKyAgICBzdHJ1 Y3QgbWNfUkdCIGNoX2ZnWzNdLCBmY19mZ1szXSwgc3BfZmc7CisgICAgaW50IGZjX3g7CisgICAg aW50IHp2OworICAgIGludCB6dl9ieXRlOworICB9IGVzc2VudGlhbHM7CisgIC8qIFVzZWQgZWxz ZXdoZXJlLiAqLworICBlbnVtIG1jX2VuZ2luZV90eXBlCisgIHsKKyAgICBNVUxUSVBMRV9DVVJT T1JTLAorICAgIEhPUklaT05UQUxfUlVMRVIsCisgICAgVkVSVElDQUxfUlVMRVIsCisgICAgRklM TF9DT0xVTU4sCisgICAgQ1VSU09SX0lORElDQVRPUgorICB9IGFjdGlvbl90eXBlOworICAvKiBV c2VkIGVsc2V3aGVyZS4gKi8KKyAgZW51bSBtY19wcmVfc2Nyb2xsX2NsZWFuX3R5cGUKKyAgewor ICAgIFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJWF9ET1dOLAorICAgIFRSWV9XSU5E T1dfUkVVU0lOR19DVVJSRU5UX01BVFJJWF9VUCwKKyAgICBUUllfV0lORE9XX0lECisgIH0gbWNf cHJlX3Njcm9sbF9jbGVhbl90eXBlX19mcm9tX3doZXJlOworICAvKiBVc2VkIGVsc2V3aGVyZS4g Ki8KKyAgZW51bSBtY19kcmF3X3Jvd190eXBlCisgIHsKKyAgICBOT1dIRVJFLAorICAgIFNDUklC RV9PTkUsCisgICAgU0NSSUJFX1RXTywKKyAgICBTQ1JJQkVfVEhSRUUsCisgICAgU0tJUFBFRCwK KyAgICBQT1NUX0NIQU5HRUQsCisgICAgVU5DSEFOR0VELAorICAgIFNFVF9DVVJTT1JfT05FLAor ICAgIFNFVF9DVVJTT1JfVFdPCisgIH0gbWNfZHJhd19yb3dfdHlwZV9fZnJvbV93aGVyZTsKKyAg LyogVXNlZCBlbHNld2hlcmUuICovCisgIGVudW0gbWNfcmVkcmF3X3Jvd190eXBlCisgIHsKKyAg ICBVUERBVEVfV0lORE9XX19SRURSQVdfT1ZFUkxBUFBFRF9ST1dTLAorICAgIEdVSV9JTlNFUlRf R0xZUEhTLAorICAgIEdVSV9GSVhfT1ZFUkxBUFBJTkdfQVJFQSwKKyAgICBEUkFXX1JPV19XSVRI X01PVVNFX0ZBQ0UsCisgICAgRVhQT1NFX0FSRUFfT05FLAorICAgIEVYUE9TRV9BUkVBX1RXTywK KyAgICBFWFBPU0VfTElORQorICB9IG1jX3JlZHJhd19yb3dfdHlwZV9fZnJvbV93aGVyZTsKK30g bWNfbWF0cml4OworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogICAgIC8qIEN1cnN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gSEVBRCwgVEFJTCwJ XAorCQkJCQkgIEhMLCBYLCBMQVNUX1gpOwkJXAorCSAgICAgIGJyZWFrOwkJCQkJCQlcCisJCQkJ CQkJCQlcCisJICAgIGNhc2UgSU1BR0VfR0xZUEg6CQkJCQkJXAorCSAgICAgIE1DX0JVSUxEX0lN QUdFX0dMWVBIX1NUUklORyAoU1RBUlQsIEVORCwgSEVBRCwgVEFJTCwJCVwKKwkJCQkJSEwsIFgs IExBU1RfWCk7CQkJXAorCSAgICAgIGJyZWFrOworCisjZGVmaW5lIE1DX0JVSUxEX0dMWVBIX1NU UklOR1NfWFcoU1RBUlQsIEVORCwgSEVBRCwgVEFJTCwgSEwsIFgsIExBU1RfWCkJXAorICAgICAg ICAgICAgY2FzZSBYV0lER0VUX0dMWVBIOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgXAorICAgICAgICAgICAgICBNQ19CVUlMRF9YV0lER0VUX0dMWVBIX1NUUklORyAo U1RBUlQsIEVORCwgSEVBRCwgVEFJTCwgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgSEwsIFgsIExBU1RfWCk7ICAgICAgICAgICAgICAgXAorICAgICAg ICAgICAgICBicmVhazsKKworI2RlZmluZSBNQ19CVUlMRF9HTFlQSF9TVFJJTkdTXzIoU1RBUlQs IEVORCwgSEVBRCwgVEFJTCwgSEwsIFgsIExBU1RfWCkJXAorCSAgICBjYXNlIEdMWVBITEVTU19H TFlQSDoJCQkJCVwKKwkgICAgICBNQ19CVUlMRF9HTFlQSExFU1NfR0xZUEhfU1RSSU5HIChTVEFS VCwgRU5ELCBIRUFELCBUQUlMLAlcCisJCQkJCSAgICBITCwgWCwgTEFTVF9YKTsJCVwKKwkgICAg ICBicmVhazsJCQkJCQkJXAorCQkJCQkJCQkJXAorCSAgICBkZWZhdWx0OgkJCQkJCQlcCisJICAg ICAgZW1hY3NfYWJvcnQgKCk7CQkJCQkJXAorCSAgICB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CisgICAgICBYU0VUQ0RSICh0YWlsLCBlbGVtKTsKKyAgICAgIHRhaWwgPSBlbGVt OworICAgIH0KKyAgdmFfZW5kIChhcCk7CisgIHJldHVybiB2YWw7Cit9CisKK0xpc3BfT2JqZWN0 CittY19tZW1xIChMaXNwX09iamVjdCBlbHQsIExpc3BfT2JqZWN0IGxpc3QpCit7CisgIHdoaWxl ICgxKQorICAgIHsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpIHx8IEVRIChYQ0FSIChsaXN0KSwg ZWx0KSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBp ZiAoIUNPTlNQIChsaXN0KSB8fCBFUSAoWENBUiAobGlzdCksIGVsdCkpCisgICAgICAgIGJyZWFr OworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkgfHwg RVEgKFhDQVIgKGxpc3QpLCBlbHQpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RS IChsaXN0KTsKKyAgICB9CisgIHJldHVybiBsaXN0OworfQorCitMaXNwX09iamVjdAorbWNfbnRo IChpbnQgbnVtLCBMaXNwX09iamVjdCBsaXN0KQoreworICBmb3IgKGludCBpID0gMDsgaSA8IG51 bSAmJiAhTklMUCAobGlzdCk7IGkrKykKKyAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgIGlmIChD T05TUCAobGlzdCkpCisgICAgcmV0dXJuIFhDQVIgKGxpc3QpOworICAgIGVsc2UKKyAgICAgIHJl dHVybiBRbmlsOworfQorCitMaXNwX09iamVjdAorbWNfYXNzcSAoTGlzcF9PYmplY3Qga2V5LCBM aXNwX09iamVjdCBsaXN0KQoreworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBpZiAoIUNPTlNQ IChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAg ICYmIEVRIChYQ0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVhazsKKyAgICAg IGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAg fHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhDQVIgKFhDQVIg KGxpc3QpKSwga2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3Qp OworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxp c3QpKQorICAgICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBrZXkpKSkKKyAg ICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgfQorICBpZiAoQ09O U1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FSIChsaXN0KTsKKyAgICBlbHNlCisgICAgICByZXR1 cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QKK21jX2Fzc29jIChMaXNwX09iamVjdCBrZXksIExp c3BfT2JqZWN0IGxpc3QpCit7CisgIExpc3BfT2JqZWN0IGNhcjsKKyAgd2hpbGUgKDEpCisgICAg eworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxp c3QpKQorICAgICAgICAgICAgICAmJiAoY2FyID0gWENBUiAoWENBUiAobGlzdCkpLAorICAgICAg ICAgICAgICAgICAgRVEgKGNhciwga2V5KSB8fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkp CisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFD T05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAg ICAgICAmJiAoY2FyID0gWENBUiAoWENBUiAobGlzdCkpLAorICAgICAgICAgICAgICAgICAgRVEg KGNhciwga2V5KSB8fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAgICAgIGJyZWFr OworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAg ICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiAoY2FyID0g WENBUiAoWENBUiAobGlzdCkpLAorICAgICAgICAgICAgICAgICAgRVEgKGNhciwga2V5KSB8fCAh TklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9 IFhDRFIgKGxpc3QpOworICAgIH0KKyAgaWYgKENPTlNQIChsaXN0KSkKKyAgICByZXR1cm4gWENB UiAobGlzdCk7CisgICAgZWxzZQorICAgICAgcmV0dXJuIFFuaWw7Cit9CisKK0xpc3BfT2JqZWN0 CittY19wbGlzdF9nZXQgKExpc3BfT2JqZWN0IHBsaXN0LCBMaXNwX09iamVjdCBwcm9wKQorewor ICBMaXNwX09iamVjdCB0YWlsLCBoYWxmdGFpbDsKKyAgLyogaGFsZnRhaWwgaXMgdXNlZCB0byBk ZXRlY3QgY2lyY3VsYXIgbGlzdHMuICAqLworICB0YWlsID0gaGFsZnRhaWwgPSBwbGlzdDsKKyAg d2hpbGUgKENPTlNQICh0YWlsKSAmJiBDT05TUCAoWENEUiAodGFpbCkpKQorICAgIHsKKyAgICAg IGlmIChFUSAocHJvcCwgWENBUiAodGFpbCkpKQorICAgICAgICByZXR1cm4gWENBUiAoWENEUiAo dGFpbCkpOworICAgICAgdGFpbCA9IFhDRFIgKFhDRFIgKHRhaWwpKTsKKyAgICAgIGhhbGZ0YWls ID0gWENEUiAoaGFsZnRhaWwpOworICAgICAgaWYgKEVRICh0YWlsLCBoYWxmdGFpbCkpCisgICAg ICAgIGJyZWFrOworICAgIH0KKyAgcmV0dXJuIFFuaWw7Cit9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ki8KK3N0YXRpYyBpbnQKK21jX2NoZWNrX2Rpc3BsYXlfd2lkdGggKHB0cmRpZmZfdCBwb3MsIHB0 cmRpZmZfdCBjb2wsIHB0cmRpZmZfdCAqZW5kcG9zKQoreworICBMaXNwX09iamVjdCB2YWwsIG92 ZXJsYXk7CisgIGlmIChDT05TUCAodmFsID0gZ2V0X2NoYXJfcHJvcGVydHlfYW5kX292ZXJsYXkK KyAgICAgICAgICAgICAgKG1ha2VfZml4bnVtIChwb3MpLCBRZGlzcGxheSwgUW5pbCwgJm92ZXJs YXkpKQorICAgICAgJiYgRVEgKFFzcGFjZSwgWENBUiAodmFsKSkpCisgICAgeyAvKiBGSVhNRTog VXNlIGNhbGNfcGl4ZWxfd2lkdGhfb3JfaGVpZ2h0LiAqLworICAgICAgTGlzcF9PYmplY3QgcGxp c3QgPSBYQ0RSICh2YWwpLCBwcm9wOworICAgICAgaW50IHdpZHRoID0gLTE7CisgICAgICBFTUFD U19JTlQgYWxpZ25fdG9fbWF4ID0gKGNvbCA8IE1PU1RfUE9TSVRJVkVfRklYTlVNIC0gSU5UX01B WAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAoRU1BQ1NfSU5UKSBJTlRfTUFY ICsgY29sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1PU1RfUE9TSVRJVkVf RklYTlVNKTsKKyAgICAgIGlmICgocHJvcCA9IG1jX3BsaXN0X2dldCAocGxpc3QsIFFDd2lkdGgp LCBSQU5HRURfRklYTlVNUCAoMCwgcHJvcCwgSU5UX01BWCkpCisgICAgICAgICAgfHwgKHByb3Ag PSBtY19wbGlzdF9nZXQgKHBsaXN0LCBRQ3JlbGF0aXZlX3dpZHRoKSwKKyAgICAgICAgICAgICAg UkFOR0VEX0ZJWE5VTVAgKDAsIHByb3AsIElOVF9NQVgpKSkKKyAgICAgICAgd2lkdGggPSBYRklY TlVNIChwcm9wKTsKKyAgICAgICAgZWxzZSBpZiAoRkxPQVRQIChwcm9wKSAmJiAwIDw9IFhGTE9B VF9EQVRBIChwcm9wKQorICAgICAgICAgICAgICAgICAmJiBYRkxPQVRfREFUQSAocHJvcCkgPD0g SU5UX01BWCkKKyAgICAgICAgICB3aWR0aCA9IChpbnQpKFhGTE9BVF9EQVRBIChwcm9wKSArIDAu NSk7CisgICAgICAgICAgZWxzZSBpZiAoKHByb3AgPSBtY19wbGlzdF9nZXQgKHBsaXN0LCBRQ2Fs aWduX3RvKSwKKyAgICAgICAgICAgICAgICAgICAgUkFOR0VEX0ZJWE5VTVAgKGNvbCwgcHJvcCwg YWxpZ25fdG9fbWF4KSkpCisgICAgICAgICAgICB3aWR0aCA9IFhGSVhOVU0gKHByb3ApIC0gY29s OworICAgICAgICAgICAgICBlbHNlIGlmIChGTE9BVFAgKHByb3ApICYmIGNvbCA8PSBYRkxPQVRf REFUQSAocHJvcCkKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgKFhGTE9BVF9EQVRBIChwcm9w KSA8PSBhbGlnbl90b19tYXgpKQorICAgICAgICAgICAgICAgIHdpZHRoID0gKGludCkoWEZMT0FU X0RBVEEgKHByb3ApICsgMC41KSAtIGNvbDsKKyAgICAgIGlmICh3aWR0aCA+PSAwKQorICAgICAg ICB7CisgICAgICAgICAgcHRyZGlmZl90IHN0YXJ0OworICAgICAgICAgIGlmIChPVkVSTEFZUCAo b3ZlcmxheSkpCisgICAgICAgICAgICAqZW5kcG9zID0gT1ZFUkxBWV9QT1NJVElPTiAoT1ZFUkxB WV9FTkQgKG92ZXJsYXkpKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgZ2V0X3By b3BlcnR5X2FuZF9yYW5nZSAocG9zLCBRZGlzcGxheSwgJnZhbCwgJnN0YXJ0LCBlbmRwb3MsIFFu aWwpOworICAgICAgICAgIC8qIEZvciA6cmVsYXRpdmUtd2lkdGgsIHdlIG5lZWQgdG8gbXVsdGlw bHkgYnkgdGhlIGNvbHVtbgorICAgICAgICAgICAgIHdpZHRoIG9mIHRoZSBjaGFyYWN0ZXIgYXQg UE9TLCBpZiBpdCBpcyBncmVhdGVyIHRoYW4gMS4gKi8KKyAgICAgICAgICBpZiAoIU5JTFAgKG1j X3BsaXN0X2dldCAocGxpc3QsIFFDcmVsYXRpdmVfd2lkdGgpKQorICAgICAgICAgICAgICAmJiAh TklMUCAoQlZBUiAoY3VycmVudF9idWZmZXIsIGVuYWJsZV9tdWx0aWJ5dGVfY2hhcmFjdGVycykp KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpbnQgYiwgd2Q7CisgICAgICAgICAgICAg IHVuc2lnbmVkIGNoYXIgKnAgPSBCWVRFX1BPU19BRERSIChDSEFSX1RPX0JZVEUgKHBvcykpOwor ICAgICAgICAgICAgICBNQ19NVUxUSUJZVEVfQllURVNfV0lEVEggKHAsIGJ1ZmZlcl9kaXNwbGF5 X3RhYmxlICgpLCBiLCB3ZCk7CisgICAgICAgICAgICAgIHdpZHRoICo9IHdkOworICAgICAgICAg ICAgfQorICAgICAgICAgIHJldHVybiB3aWR0aDsKKyAgICAgICAgfQorICAgIH0KKyAgcmV0dXJu IC0xOworfQorCisvKiBUcnkgdG8gY29tcG9zZSB0aGUgY2hhcmFjdGVycyBhdCBDSEFSUE9TIGFj Y29yZGluZyB0byBjb21wb3NpdGlvbgorICAgcnVsZSBSVUxFIChbUEFUVEVSTiBQUkVWLUNIQVJT IEZVTkNdKS4gIExJTUlUIGxpbWl0cyB0aGUgY2hhcmFjdGVycworICAgdG8gY29tcG9zZS4gIFNU UklORywgaWYgbm90IG5pbCwgaXMgYSB0YXJnZXQgc3RyaW5nLiAgV0lOIGlzIGEKKyAgIHdpbmRv dyB3aGVyZSB0aGUgY2hhcmFjdGVycyBhcmUgYmVpbmcgZGlzcGxheWVkLiAgSWYgY2hhcmFjdGVy cyBhcmUKKyAgIHN1Y2Nlc3NmdWxseSBjb21wb3NlZCwgcmV0dXJuIHRoZSBjb21wb3NpdGlvbiBh cyBhIGdseXBoLXN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hcnBvczsKKyAg ICAgIGVsc2UKKyAgICAgICAgbGVuID0gc3RyaW5nX2J5dGVfdG9fY2hhciAoc3RyaW5nLCBieXRl cG9zICsgbGVuKSAtIGNoYXJwb3M7CisgICAgfQorICBpZiAobGVuIDw9IDApCisgICAgcmV0dXJu IHVuYmluZF90byAoY291bnQsIFFuaWwpOworICB0byA9IGxpbWl0ID0gY2hhcnBvcyArIGxlbjsK KyNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KKyAgaWYgKEZSQU1FX1dJTkRPV19QIChmKSkKKyAg ICB7CisgICAgICBmb250X29iamVjdCA9IGZvbnRfcmFuZ2UgKGNoYXJwb3MsIGJ5dGVwb3MsICZ0 bywgd2luLCBmYWNlLCBzdHJpbmcpOworICAgICAgaWYgKCEgRk9OVF9PQkpFQ1RfUCAoZm9udF9v YmplY3QpCisgICAgICAgICAgfHwgKCEgTklMUCAocmUpCisgICAgICAgICAgICAgICYmIHRvIDwg bGltaXQKKyAgICAgICAgICAgICAgJiYgKGZhc3RfbG9va2luZ19hdCAocmUsIGNoYXJwb3MsIGJ5 dGVwb3MsIHRvLCAtMSwgc3RyaW5nKSA8PSAwKSkpCisgICAgICAgIHJldHVybiB1bmJpbmRfdG8g KGNvdW50LCBRbmlsKTsKKyAgICB9CisgIGVsc2UKKyNlbmRpZiAgICAgICAgLyogbm90IEhBVkVf V0lORE9XX1NZU1RFTSAqLworICAgIGZvbnRfb2JqZWN0ID0gd2luLT5mcmFtZTsKKyAgbGdzdHJp bmcgPSBGY29tcG9zaXRpb25fZ2V0X2dzdHJpbmcgKHBvcywgbWFrZV9maXhudW0gKHRvKSwgZm9u dF9vYmplY3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmcp OworICBpZiAoTklMUCAoTEdTVFJJTkdfSUQgKGxnc3RyaW5nKSkpCisgICAgeworICAgICAgLyog U2F2ZSBwb2ludCBhcyBtYXJrZXIgYmVmb3JlIGNhbGxpbmcgb3V0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0xLCAmc3Rh cnQsICZlbmQsICZwcm9wLCBzdHJpbmcpOworICAgICAgY21wX2l0LT5pZCA9IGdldF9jb21wb3Np dGlvbl9pZCAoY2hhcnBvcywgYnl0ZXBvcywgZW5kIC0gc3RhcnQsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBwcm9wLCBzdHJpbmcpOworICAgICAgaWYgKGNtcF9pdC0+ aWQgPCAwKQorICAgICAgICBnb3RvIG5vX2NvbXBvc2l0aW9uOworICAgICAgY21wX2l0LT5uY2hh cnMgPSBlbmQgLSBzdGFydDsKKyAgICAgIGNtcF9pdC0+bmdseXBocyA9IGNvbXBvc2l0aW9uX3Rh YmxlW2NtcF9pdC0+aWRdLT5nbHlwaF9sZW47CisgICAgfQorICBlbHNlIGlmICh3KQorICAgIHsK KyAgICAgIExpc3BfT2JqZWN0IGxnc3RyaW5nID0gUW5pbDsKKyAgICAgIExpc3BfT2JqZWN0IHZh bCwgZWx0OworICAgICAgcHRyZGlmZl90IGk7CisgICAgICB2YWwgPSBDSEFSX1RBQkxFX1JFRiAo VmNvbXBvc2l0aW9uX2Z1bmN0aW9uX3RhYmxlLCBjbXBfaXQtPmNoKTsKKyAgICAgIGZvciAoaSA9 IDA7IGkgPCBjbXBfaXQtPnJ1bGVfaWR4OyBpKyssIHZhbCA9IFhDRFIgKHZhbCkpOworICAgICAg aWYgKGNoYXJwb3MgPCBlbmRwb3MpCisgICAgICAgIHsKKyAgICAgICAgICBmb3IgKDsgQ09OU1Ag KHZhbCk7IHZhbCA9IFhDRFIgKHZhbCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGVs dCA9IFhDQVIgKHZhbCk7CisgICAgICAgICAgICAgIGlmICghIFZFQ1RPUlAgKGVsdCkgfHwgQVNJ WkUgKGVsdCkgIT0gMworICAgICAgICAgICAgICAgICAgfHwgISBJTlRFR0VSUCAoQVJFRiAoZWx0 LCAxKSkpCisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgIGlmIChYRklY TkFUIChBUkVGIChlbHQsIDEpKSAhPSBjbXBfaXQtPmxvb2tiYWNrKQorICAgICAgICAgICAgICAg IGdvdG8gbm9fY29tcG9zaXRpb247CisgICAgICAgICAgICAgIGxnc3RyaW5nID0gbWNfYXV0b2Nt cF9jaGFycyAoZWx0LCBjaGFycG9zLCBieXRlcG9zLCBlbmRwb3MsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgdywgZmFjZSwgc3RyaW5nKTsKKyAgICAgICAgICAgICAg aWYgKGNvbXBvc2l0aW9uX2dzdHJpbmdfcCAobGdzdHJpbmcpKQorICAgICAgICAgICAgICAgIGJy ZWFrOworICAgICAgICAgICAgICBsZ3N0cmluZyA9IFFuaWw7CisgICAgICAgICAgICAgIC8qIENv bXBvc2l0aW9uIGZhaWxlZCBwZXJoYXBzIGJlY2F1c2UgdGhlIGZvbnQgZG9lc24ndAorICAgICAg ICAgICAgICAgICBzdXBwb3J0IHN1ZmZpY2llbnQgcmFuZ2Ugb2YgY2hhcmFjdGVycy4gIFRyeSB0 aGUKKyAgICAgICAgICAgICAgICAgb3RoZXIgY29tcG9zaXRpb24gcnVsZXMgaWYgYW55LiAgKi8K KyAgICAgICAgICAgIH0KKyAgICAgICAgICBjbXBfaXQtPnJldmVyc2VkX3AgPSAwOworICAgICAg ICB9CisgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICBwdHJkaWZmX3QgY3BvcyA9IGNo YXJwb3MsIGJwb3MgPSBieXRlcG9zOworICAgICAgICAgIGNtcF9pdC0+cmV2ZXJzZWRfcCA9IDE7 CisgICAgICAgICAgZWx0ID0gWENBUiAodmFsKTsKKyAgICAgICAgICBpZiAoY21wX2l0LT5sb29r YmFjayA+IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGNwb3MgPSBjaGFycG9zIC0g Y21wX2l0LT5sb29rYmFjazsKKyAgICAgICAgICAgICAgaWYgKFNUUklOR1AgKHN0cmluZykpCisg ICAgICAgICAgICAgICAgYnBvcyA9IHN0cmluZ19jaGFyX3RvX2J5dGUgKHN0cmluZywgY3Bvcyk7 CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBicG9zID0gQ0hBUl9UT19CWVRF IChjcG9zKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBsZ3N0cmluZyA9IG1jX2F1dG9jbXBf Y2hhcnMgKGVsdCwgY3BvcywgYnBvcywgY2hhcnBvcyArIDEsIHcsIGZhY2UsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmcpOworICAgICAgICAgIGlmICghIGNvbXBv c2l0aW9uX2dzdHJpbmdfcCAobGdzdHJpbmcpCisgICAgICAgICAgICAgIHx8IGNwb3MgKyBMR1NU UklOR19DSEFSX0xFTiAobGdzdHJpbmcpIC0gMSAhPSBjaGFycG9zKQorICAgICAgICAgICAgLyog Q29tcG9zaXRpb24gZmFpbGVkIG9yIGRpZG4ndCBjb3ZlciB0aGUgY3VycmVudAorICAgICAgICAg ICAgICAgY2hhcmFjdGVyLiAgKi8KKyAgICAgICAgICAgIGdvdG8gbm9fY29tcG9zaXRpb247Cisg ICAgICAgIH0KKyAgICAgIGlmIChOSUxQIChsZ3N0cmluZykpCisgICAgICAgIGdvdG8gbm9fY29t cG9zaXRpb247CisgICAgICBpZiAoTklMUCAoTEdTVFJJTkdfSUQgKGxnc3RyaW5nKSkpCisgICAg ICAgIGxnc3RyaW5nID0gY29tcG9zaXRpb25fZ3N0cmluZ19wdXRfY2FjaGUgKGxnc3RyaW5nLCAt MSk7CisgICAgICBjbXBfaXQtPmlkID0gWEZJWE5VTSAoTEdTVFJJTkdfSUQgKGxnc3RyaW5nKSk7 CisgICAgICBmb3IgKGkgPSAwOyBpIDwgTEdTVFJJTkdfR0xZUEhfTEVOIChsZ3N0cmluZyk7IGkr KykKKyAgICAgICAgaWYgKE5JTFAgKExHU1RSSU5HX0dMWVBIIChsZ3N0cm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leHQg cGxhY2UKKyAgICAgICAgICAgICB3aGVyZSB3ZSBtaWdodCBuZWVkIHRvIHNraXAgbW9yZSBpbnZp c2libGUgdGV4dC4gKi8KKyAgICAgICAgICBzY2FuID0gc2tpcF9pbnZpc2libGUgKHNjYW4sICZu ZXh0X2JvdW5kYXJ5LCBlbmQsIFFuaWwpOworICAgICAgICAgIGlmIChzY2FuICE9IG9sZF9zY2Fu KQorICAgICAgICAgICAgc2Nhbl9ieXRlID0gQ0hBUl9UT19CWVRFIChzY2FuKTsKKyAgICAgICAg ICBpZiAoc2NhbiA+PSBlbmQpCisgICAgICAgICAgICBnb3RvIGVuZGxvb3A7CisgICAgICAgIH0K KyAgICAgIC8qIFRlc3QgcmVhY2hpbmcgdGhlIGdvYWwgY29sdW1uLiAgV2UgZG8gdGhpcyBhZnRl ciBza2lwcGluZworICAgaW52aXNpYmxlIGNoYXJhY3RlcnMsIHNvIHRoYXQgd2UgcHV0IHBvaW50 IGJlZm9yZSB0aGUKKyAgIGNoYXJhY3RlciBvbiB3aGljaCB0aGUgY3Vyc29yIHdpbGwgYXBwZWFy LiAqLworICAgICAgaWYgKGNvbCA+PSBnb2FsKQorICAgICAgICBicmVhazsKKyAgICAgIHByZXZf Y29sID0gY29sOworICAgICAgeyAvKiBDaGVjayBkaXNwbGF5IHByb3BlcnR5LiAqLworICAgICAg ICBwdHJkaWZmX3QgZW5kcDsKKyAgICAgICAgaW50IHdpZHRoID0gbWNfY2hlY2tfZGlzcGxheV93 aWR0aCAoc2NhbiwgY29sLCAmZW5kcCk7CisgICAgICAgIGlmICh3aWR0aCA+PSAwKQorICAgICAg ICAgIHsKKyAgICAgICAgICAgIGNvbCArPSB3aWR0aDsKKyAgICAgICAgICAgIGlmIChlbmRwID4g c2NhbikgLyogQXZvaWQgaW5maW5pdGUgbG9vcHMgd2l0aCAwLXdpZHRoIG92ZXJsYXlzLiAqLwor ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2NhbiA9IGVuZHA7CisgICAgICAgICAg ICAgICAgc2Nhbl9ieXRlID0gQ0hBUl9UT19CWVRFIChzY2FuKTsKKyAgICAgICAgICAgICAgICBj b250aW51ZTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIC8q IENoZWNrIGNvbXBvc2l0aW9uIHNlcXVlbmNlLiAqLworICAgICAgaWYgKGNtcF9pdC5pZCA+PSAw CisgICAgICAgICAgfHwgKHNjYW4gPT0gY21wX2l0LnN0b3BfcG9zCisgICAgICAgICAgICAgICYm IG1jX2NvbXBvc2l0aW9uX3Jlc2VhdF9pdCAoJmNtcF9pdCwgc2Nhbiwgc2Nhbl9ieXRlLCBlbmQs IHcsIE5VTEwsIFFuaWwpKSkKKyAgICAgICAgY29tcG9zaXRpb25fdXBkYXRlX2l0ICgmY21wX2l0 LCBzY2FuLCBzY2FuX2J5dGUsIFFuaWwpOworICAgICAgaWYgKGNtcF9pdC5pZCA+PSAwKQorICAg ICAgICB7CisgICAgICAgICAgc2NhbiArPSBjbXBfaXQubmNoYXJzOworICAgICAgICAgIHNjYW5f Ynl0ZSArPSBjbXBfaXQubmJ5dGVzOworICAgICAgICAgIGlmIChzY2FuIDw9IGVuZCkKKyAgICAg ICAgICAgIGNvbCArPSBjbXBfaXQud2lkdGg7CisgICAgICAgICAgaWYgKGNtcF9pdC50byA9PSBj bXBfaXQubmdseXBocykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY21wX2l0LmlkID0g LTE7CisgICAgICAgICAgICAgIGNvbXBvc2l0aW9uX2NvbXB1dGVfc3RvcF9wb3MgKCZjbXBfaXQs IHNjYW4sIHNjYW5fYnl0ZSwgZW5kLCBRbmlsKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgY21wX2l0LmZyb20gPSBjbXBfaXQudG87CisgICAgICAgICAg Y29udGludWU7CisgICAgICAgIH0KKyAgICAgIGMgPSBGRVRDSF9CWVRFIChzY2FuX2J5dGUpOwor ICAgICAgLyogU2VlIGlmIHRoZXJlIGlzIGEgZGlzcGxheSB0YWJsZSBhbmQgaXQgcmVsYXRlcyB0 byB0aGlzIGNoYXJhY3Rlci4gKi8KKyAgICAgIGlmIChkcCAhPSAwCisgICAgICAgICAgJiYgISAo bXVsdGlieXRlICYmIExFQURJTkdfQ09ERV9QIChjKSkKKyAgICAgICAgICAmJiBWRUNUT1JQIChE SVNQX0NIQVJfVkVDVE9SIChkcCwgYykpKQorICAgICAgICB7CisgICAgICAgICAgTGlzcF9PYmpl Y3QgY2hhcnZlYzsKKyAgICAgICAgICBwdHJkaWZmX3QgaSwgbjsKKyAgICAgICAgICAvKiBUaGlz IGNoYXJhY3RlciBpcyBkaXNwbGF5ZWQgdXNpbmcgYSB2ZWN0b3Igb2YgZ2x5cGhzLgorICAgICAg ICAgICAgIFVwZGF0ZSB0aGUgY29sdW1uL3Bvc2l0aW9uIGJhc2VkIG9uIHRob3NlIGdseXBocy4g Ki8KKyAgICAgICAgICBjaGFydmVjID0gRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpOworICAgICAg ICAgIG4gPSBBU0laRSAoY2hhcnZlYyk7CisgICAgICAgICAgZm9yIChpID0gMDsgaSA8IG47IGkr KykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogVGhpcyBzaG91bGQgYmUgaGFuZGxl ZCB0aGUgc2FtZSBhcworICAgICAgICAgICAgICBuZXh0X2VsZW1lbnRfZnJvbV9kaXNwbGF5X3Zl Y3RvciBkb2VzIGl0LiAqLworICAgICAgICAgICAgICBMaXNwX09iamVjdCBlbnRyeSA9IEFSRUYg KGNoYXJ2ZWMsIGkpOworICAgICAgICAgICAgICBpZiAoR0xZUEhfQ09ERV9QIChlbnRyeSkpCisg ICAgICAgICAgICAgICAgYyA9IEdMWVBIX0NPREVfQ0hBUiAoZW50cnkpOworICAgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgICAgYyA9ICcgJzsKKyAgICAgICAgICAgICAgaWYgKGMgPT0g J1xuJykKKyAgICAgICAgICAgICAgICBnb3RvIGVuZGxvb3A7CisgICAgICAgICAgICAgIGlmIChj ID09ICdccicgJiYgRVEgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVfZGlzcGxheSks IFF0KSkKKyAgICAgICAgICAgICAgICBnb3RvIGVuZGxvb3A7CisgICAgICAgICAgICAgIGlmIChj ID09ICdcdCcpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgY29sICs9IHRh Yl93aWR0aDsKKyAgICAgICAgICAgICAgICAgIGNvbCA9IGNvbCAvIHRhYl93aWR0aCAqIHRhYl93 aWR0aDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICAgICAgKytjb2w7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQor ICAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIFRoZSBkaXNwbGF5IHRhYmxlIGRvZXNuJ3QgYWZm ZWN0IHRoaXMgY2hhcmFjdGVyOworICAgICAgICAgICAgICAgaXQgZGlzcGxheXMgYXMgaXRzZWxm LiAqLworICAgICAgICAgICAgaWYgKGMgPT0gJ1xuJykKKyAgICAgICAgICAgICAgZ290byBlbmRs b29wOworICAgICAgICAgICAgaWYgKGMgPT0gJ1xyJyAmJiBFUSAoQlZBUiAoY3VycmVudF9idWZm ZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKQorICAgICAgICAgICAgICBnb3RvIGVuZGxvb3A7 CisgICAgICAgICAgICBpZiAoYyA9PSAnXHQnKQorICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgY29sICs9IHRhYl93aWR0aDsKKyAgICAgICAgICAgICAgICBjb2wgPSBjb2wgLyB0YWJf d2lkdGggKiB0YWJfd2lkdGg7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZSBp ZiAobXVsdGlieXRlICYmIExFQURJTkdfQ09ERV9QIChjKSkKKyAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICAvKiBTdGFydCBvZiBtdWx0aS1ieXRlIGZvcm0uICovCisgICAgICAg ICAgICAgICAgICB1bnNpZ25lZCBjaGFyICpwdHI7CisgICAgICAgICAgICAgICAgICBpbnQgYnl0 ZXMsIHdpZHRoOworICAgICAgICAgICAgICAgICAgcHRyID0gQllURV9QT1NfQUREUiAoc2Nhbl9i eXRlKTsKKyAgICAgICAgICAgICAgICAgIE1DX01VTFRJQllURV9CWVRFU19XSURUSCAocHRyLCBk cCwgYnl0ZXMsIHdpZHRoKTsKKyAgICAgICAgICAgICAgICAgIC8qIFN1YnRyYWN0IG9uZSB0byBj b21wZW5zYXRlIGZvciB0aGUgaW5jcmVtZW50CisgICAgICAgICAgICAgICAgICB0aGF0IGlzIGdv aW5nIHRvIGhhcHBlbiBiZWxvdy4gKi8KKyAgICAgICAgICAgICAgICAgIHNjYW5fYnl0ZSArPSBi eXRlcyAtIDE7CisgICAgICAgICAgICAgICAgICBjb2wgKz0gd2lkdGg7CisgICAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKGN0bF9hcnJvdyAmJiAoYyA8IDA0MCB8fCBj ID09IDAxNzcpKQorICAgICAgICAgICAgICAgICAgY29sICs9IDI7CisgICAgICAgICAgICAgICAg ICBlbHNlIGlmIChjIDwgMDQwIHx8IGMgPj0gMDE3NykKKyAgICAgICAgICAgICAgICAgICAgY29s ICs9IDQ7CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICBj b2wrKzsKKyAgICAgICAgICB9CisgICAgICBzY2FuKys7CisgICAgICBzY2FuX2J5dGUrKzsKKyAg ICB9CisgZW5kbG9vcDoKKyAgbGFzdF9rbm93bl9jb2x1bW4gPSBjb2w7CisgIGxhc3Rfa25vd25f Y29sdW1uX3BvaW50ID0gcHQ7CisgIGxhc3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pOworICAgICAgICByZXR1cm4gY29sOworICAgICAgfQorICAgIH0KKyAgLyogU2Nh biBiYWNrd2FyZHMgZnJvbSBwb2ludCB0byB0aGUgcHJldmlvdXMgbmV3bGluZSwKKyAgICAgY291 bnRpbmcgd2lkdGguICBUYWIgY2hhcmFjdGVycyBhcmUgdGhlIG9ubHkgY29tcGxpY2F0ZWQgY2Fz ZS4gKi8KKyAgLyogTWFrZSBhIHBvaW50ZXIgZm9yIGRlY3JlbWVudGluZyB0aHJvdWdoIHRoZSBj aGFycyBiZWZvcmUgcG9pbnQuICovCisgIHB0ciA9IEJZVEVfUE9TX0FERFIgKENIQVJfVE9fQllU RSAocHQpIC0gMSkgKyAxOworICAvKiBNYWtlIGEgcG9pbnRlciB0byB3aGVyZSBjb25zZWN1dGl2 ZSBjaGFycyBsZWF2ZSBvZmYsCisgICAgIGdvaW5nIGJhY2t3YXJkcyBmcm9tIHBvaW50LiAqLwor ICBpZiAocHQgPT0gQkVHVikKKyAgICBzdG9wID0gcHRyOworICAgIGVsc2UgaWYgKHB0IDw9IEdQ VCB8fCBCRUdWID4gR1BUKQorICAgICAgc3RvcCA9IEJFR1ZfQUREUjsKKyAgICAgIGVsc2UKKyAg ICAgICAgc3RvcCA9IEdBUF9FTkRfQUREUjsKKyAgY29sID0gMCwgdGFiX3NlZW4gPSAwLCBwb3N0 X3RhYiA9IDA7CisgIHdoaWxlICgxKQorICAgIHsKKyAgICAgIHB0cmRpZmZfdCBpLCBuOworICAg ICAgTGlzcF9PYmplY3QgY2hhcnZlYzsKKyAgICAgIGlmIChwdHIgPT0gc3RvcCkKKyAgICAgICAg eworICAgICAgICAgIC8qIFdlIHN0b3BwZWQgZWl0aGVyIGZvciB0aGUgYmVnaW5uaW5nIG9mIHRo ZSBidWZmZXIKKyAgICAgICAgICAgICBvciBmb3IgdGhlIGdhcC4gKi8KKyAgICAgICAgICBpZiAo cHRyID09IEJFR1ZfQUREUikKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIC8qIEl0IHdh cyB0aGUgZ2FwLiAgSnVtcCBiYWNrIG92ZXIgaXQuICovCisgICAgICAgICAgc3RvcCA9IEJFR1Zf QUREUjsKKyAgICAgICAgICBwdHIgPSBHUFRfQUREUjsKKyAgICAgICAgICAvKiBDaGVjayB3aGV0 aGVyIHRoYXQgYnJpbmdzIHVzIHRvIGJlZ2lubmluZyBvZiBidWZmZXIuICovCisgICAgICAgICAg aWYgKEJFR1YgPj0gR1BUKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGMg PSAqLS1wdHI7CisgICAgICBpZiAoZHAgJiYgVkVDVE9SUCAoRElTUF9DSEFSX1ZFQ1RPUiAoZHAs IGMpKSkKKyAgICAgICAgeworICAgICAgICAgIGNoYXJ2ZWMgPSBESVNQX0NIQVJfVkVDVE9SIChk cCwgYyk7CisgICAgICAgICAgbiA9IEFTSVpFIChjaGFydmVjKTsKKyAgICAgICAgfQorICAgICAg ICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgY2hhcnZlYyA9IFFuaWw7CisgICAgICAg ICAgICBuID0gMTsKKyAgICAgICAgICB9CisgICAgICBmb3IgKGkgPSBuIC0gMTsgaSA+PSAwOyAt LWkpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoVkVDVE9SUCAoY2hhcnZlYykpCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIC8qIFRoaXMgc2hvdWxkIGJlIGhhbmRsZWQgdGhlIHNhbWUg YXMKKyAgICAgICAgICAgbmV4dF9lbGVtZW50X2Zyb21fZGlzcGxheV92ZWN0b3IgZG9lcyBpdC4g Ki8KKyAgICAgICAgICAgICAgTGlzcF9PYmplY3QgZW50cnkgPSBBUkVGIChjaGFydmVjLCBpKTsK KyAgICAgICAgICAgICAgaWYgKEdMWVBIX0NPREVfUCAoZW50cnkpKQorICAgICAgICAgICAgICAg IGMgPSBHTFlQSF9DT0RFX0NIQVIgKGVudHJ5KTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgICAgICBjID0gJyAnOworICAgICAgICAgICAgfQorICAgICAgICAgIGlmIChjID49 IDA0MCAmJiBjIDwgMDE3NykKKyAgICAgICAgICAgIGNvbCsrOworICAgICAgICAgICAgZWxzZSBp ZiAoYyA9PSAnXG4nCisgICAgICAgICAgICAgICAgICAgICB8fCAoYyA9PSAnXHInCisgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgRVEgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVf ZGlzcGxheSksIFF0KSkpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwdHIrKzsK KyAgICAgICAgICAgICAgICBnb3RvIHN0YXJ0X29mX2xpbmVfZm91bmQ7CisgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgZWxzZSBpZiAoYyA9PSAnXHQnKQorICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgIGlmICh0YWJfc2VlbikKKyAgICAgICAgICAgICAgICAgICAgY29s ID0gKChjb2wgKyB0YWJfd2lkdGgpIC8gdGFiX3dpZHRoKSAqIHRhYl93aWR0aDsKKyAgICAgICAg ICAgICAgICAgIHBvc3RfdGFiICs9IGNvbDsKKyAgICAgICAgICAgICAgICAgIGNvbCA9IDA7Cisg ICAgICAgICAgICAgICAgICB0YWJfc2VlbiA9IDE7CisgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICAgIGVsc2UgaWYgKFZFQ1RPUlAgKGNoYXJ2ZWMpKQorICAgICAgICAgICAgICAgICAg LyogV2l0aCBhIGRpc3BsYXkgdGFibGUgZW50cnksIEMgaXMgZGlzcGxheWVkIGFzIGlzLCBhbmQK KyAgICAgICAgICAgICAgICAgICAgIG5vdCBkaXNwbGF5ZWQgYXMgXE5OTiBvciBhcyBeTi4gIElm IEMgaXMgYSBzaW5nbGUtYnl0ZQorICAgICAgICAgICAgICAgICAgICAgY2hhcmFjdGVyLCBpdCB0 YWtlcyBvbmUgY29sdW1uLiAgSWYgQyBpcyBtdWx0aS1ieXRlIGluCisgICAgICAgICAgICAgICAg ICAgICBhIHVuaWJ5dGUgYnVmZmVyLCBpdCdzIHRyYW5zbGF0ZWQgdG8gdW5pYnl0ZSwgc28gaXQK KyAgICAgICAgICAgICAgICAgICAgIGFsc28gdGFrZXMgb25lIGNvbHVtbi4gKi8KKyAgICAgICAg ICAgICAgICAgICsrY29sOworICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAg ICAgICBjb2wgKz0gKGN0bF9hcnJvdyAmJiBjIDwgMDIwMCkgPyAyIDogNDsKKyAgICAgICAgfQor ICAgIH0KKyBzdGFydF9vZl9saW5lX2ZvdW5kOgorICBpZiAodGFiX3NlZW4pCisgICAgeworICAg ICAgY29sID0gKChjb2wgKyB0YWJfd2lkdGgpIC8gdGFiX3dpZHRoKSAqIHRhYl93aWR0aDsKKyAg ICAgIGNvbCArPSBwb3N0X3RhYjsKKyAgICB9CisgIGxhc3Rfa25vd25fY29sdW1uID0gY29sOwor ICBsYXN0X2tub3duX2NvbHVtbl9wb2ludCA9IHB0OworICBsYXN0X2tub3duX2NvbHVtbl9tb2Rp ZmllZCA9IE1PRElGRjsKKyAgaWYgKG9sZF9idWZmZXIpCisgICAgc2V0X2J1ZmZlcl9pbnRlcm5h bCAob2xkX2J1ZmZlcik7CisgIHJldHVybiBjb2w7Cit9CisKK0RFRlVOICgibWMtY3VycmVudC1j b2x1bW4iLCBGbWNfY3VycmVudF9jb2x1bW4sIFNtY19jdXJyZW50X2NvbHVtbiwgMiwgMiwgMCwK KyAgICAgICBkb2M6IC8qIFJldHVybiB0aGUgaG9yaXpvbnRhbCBwb3NpdGlvbiBvZiBwb2ludC4g IEJlZ2lubmluZyBvZiBsaW5lIGlzIGNvbHVtbiAwLgorVGhpcyBpcyBjYWxjdWxhdGVkIGJ5IGFk ZGluZyB0b2dldGhlciB0aGUgd2lkdGhzIG9mIGFsbCB0aGUgZGlzcGxheWVkCityZ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ciwg IkZSQU1FICglcykiLCBtY19mcmFtZSAoZikpOyAqLworY2hhciAqCittY19mcmFtZSAoc3RydWN0 IGZyYW1lICpmKQoreworICBMaXNwX09iamVjdCBmcmFtZTsKKyAgWFNFVEZSQU1FIChmcmFtZSwg Zik7CisgIHJldHVybiBTU0RBVEEgKEZwcmluMV90b19zdHJpbmcgKGZyYW1lLCBRbmlsKSk7Cit9 CisKKy8qIFVTQUdFOiAgZnByaW50ZiAoc3RkZXJyLCAiV0lORE9XICglcykiLCBtY193aW5kb3cg KHcpKTsgKi8KK2NoYXIgKgorbWNfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3KQoreworICBMaXNw X09iamVjdCB3aW5kb3c7CisgIFhTRVRXSU5ET1cgKHdpbmRvdywgdyk7CisgIHJldHVybiBTU0RB VEEgKEZwcmluMV90b19zdHJpbmcgKHdpbmRvdywgUW5pbCkpOworfQorCisvKiBVU0FHRTogIGZw cmludGYgKHN0ZGVyciwgIkNIQVJBQ1RFUiAoJXMpIiwgbWNfY2hhcl90b19zdHJpbmcgKGdseXBo LT51LmNoKSk7ICovCitjaGFyICoKK21jX2NoYXJfdG9fc3RyaW5nIChpbnQgYXJnKQoreworICBM aXNwX09iamVjdCBjaGFyYWN0ZXIgPSAoMCA8PSBhcmcgJiYgYXJnIDw9IE1BWF9DSEFSKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBGY2hhcl90b19zdHJpbmcgKG1ha2VfZml4bnVtIChh cmcpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBRbmlsOworICBjaGFyICogcmVzdWx0 ID0gKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDkpCisg ICAgICAgICAgICAgICAgICAgID8gIlxcdCIKKyAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChj aGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAgICAmJiBhcmcgPT0gMTApCisgICAgICAgICAg ICAgICAgICAgID8gIlxcbiIKKyAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIp CisgICAgICAgICAgICAgICAgICAgICAmJiBhcmcgPT0gMzIpCisgICAgICAgICAgICAgICAgICAg ID8gIlxccyIKKyAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAg ICAgICAgICAgICAgICAmJiBhcmcgIT0gOQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9 IDEwCisgICAgICAgICAgICAgICAgICAgICAmJiBhcmcgIT0gMzIpCisgICAgICAgICAgICAgICAg ICAgID8gU1NEQVRBIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICA6ICJcXD8iOworICBy ZXR1cm4gcmVzdWx0OworfQorCitpbnQKK21jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKExpc3BfT2Jq ZWN0IGFyZykKK3sKKyAgY2hhciAqc3RyOworICBpZiAoWFRZUEUgKGFyZykgPT0gTGlzcF9TdHJp bmcpCisgICAgc3RyID0gU1NEQVRBIChhcmcpOworICAgIGVsc2UgaWYgKFhUWVBFIChhcmcpID09 IExpc3BfU3ltYm9sKQorICAgICAgc3RyID0gU1NEQVRBIChTWU1CT0xfTkFNRSAoYXJnKSk7Cisg ICAgICBlbHNlIHJldHVybiAtMTsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgIm5vIikpCisgICAgcmV0 dXJuIE1DX05PX0NVUlNPUjsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgIm1jLWxlZnQtZnJpbmdlLWJp dG1hcCIpKQorICAgIHJldHVybiBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA7CisgIGlmICghc3RyY21w IChzdHIsICJtYy1yaWdodC1mcmluZ2UtYml0bWFwIikpCisgICAgcmV0dXJuIE1DX1JJR0hUX0ZS SU5HRV9CSVRNQVA7CisgIGlmICghc3RyY21wIChzdHIsICJib3giKSkKKyAgICByZXR1cm4gTUNf RklMTEVEX0JPWDsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgImZyYW1lZCIpKQorICAgIHJldHVybiBN Q19GUkFNRURfQk9YOworICBpZiAoIXN0cmNtcCAoc3RyLCAiaG9sbG93IikpCisgICAgcmV0dXJu IE1DX0hPTExPV19CT1g7CisgIGlmICghc3RyY21wIChzdHIsICJiYXIiKSkKKyAgICByZXR1cm4g TUNfQkFSOworICBpZiAoIXN0cmNtcCAoc3RyLCAiaGJhciIpKQorICAgIHJldHVybiBNQ19IQkFS OworICByZXR1cm4gLTE7Cit9CisKKy8qIFVTQUdFOiAgZnByaW50ZiAoc3RkZXJyLCAiQ1VSU09S IFRZUEUgKCVzKSIsIG1jX2N1cnNvcl90eXBlX3RvX3N0cmluZyAoYXJnKSk7ICovCitjaGFyICoK K21jX2N1cnNvcl90eXBlX3RvX3N0cmluZyAoZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlw ZSkKK3sKKyAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICB7CisgICAgICBjYXNlIE1DX0ZJTExF RF9CT1g6IHJldHVybiAiTUNfRklMTEVEX0JPWCI7CisgICAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6 IHJldHVybiAiTUNfRlJBTUVEX0JPWCI7CisgICAgICBjYXNlIE1DX0hPTExPV19CT1g6IHJldHVy biAiTUNfSE9MTE9XX0JPWCI7CisgICAgICBjYXNlIE1DX0JBUjogcmV0dXJuICJNQ19CQVIiOwor ICAgICAgY2FzZSBNQ19IQkFSOiByZXR1cm4gIk1DX0hCQVIiOworICAgICAgY2FzZSBNQ19MRUZU X0ZSSU5HRV9CSVRNQVA6IHJldHVybiAiTUNfTEVGVF9GUklOR0VfQklUTUFQIjsKKyAgICAgIGNh c2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDogcmV0dXJuICJNQ19SSUdIVF9GUklOR0VfQklUTUFQ IjsKKyAgICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDogcmV0dXJuICJNQ19OT19GUkl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udGggPSAwOworICAgICAgIHZudGggPCB3LT5tY19tYXRyaXgu dnBvc191c2VkOworICAgICAgICsrdm50aCkKKyAgICB7CisgICAgICBmb3IgKGVudW0gbWNfY2Fj aGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgICAgIGNhY2hlX3R5cGUgPCBO T19DQUNIRTsKKyAgICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgICB7CisgICAgICAgICAg aW50IGNhY2hlX2FsbG9jYXRlZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX2FsbG9j YXRlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICBpbnQgY2FjaGVfdXNlZCA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgZnByaW50ZiAo c3RkZXJyLCAiICAgIHZudGggKCVkKSB8IGNhY2hlX2FsbG9jYXRlZFslc10gKCVkKSB8IGNhY2hl X3VzZWRbJXNdICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB2bnRoLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgbWNfY2FjaGVfdHlwZV90b19zdHJpbmcgKGNhY2hlX3R5 cGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FjaGVfYWxsb2NhdGVkLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgbWNfY2FjaGVfdHlwZV90b19zdHJpbmcgKGNhY2hlX3R5cGUp LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FjaGVfdXNlZCk7CisgICAgICAgIH0KKyAg ICB9Cit9CisKK3ZvaWQKK21jX3NldF9sc2xfYmcgKHN0cnVjdCB3aW5kb3cgKncsIGVudW0gZmFj ZV9pZCBmYWNlX2lkLCBzdHJ1Y3QgbWNfUkdCICpsc2wpCit7CisgIHN0cnVjdCBmcmFtZSAqZiA9 IFhGUkFNRSAody0+ZnJhbWUpOworICBzdHJ1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ZG93X2RpdmlkZXJfZmlyc3RfcGl4ZWwgKi8KKyAgICAgICAgICB8fCBmYWNlX2lkID09IFdJTkRP V19ESVZJREVSX0xBU1RfUElYRUxfRkFDRV9JRCAvKiBRd2luZG93X2RpdmlkZXJfbGFzdF9waXhl bCAqLworICAgICAgICAgIHx8IGZhY2VfaWQgPT0gVkVSVElDQUxfQk9SREVSX0ZBQ0VfSUQgLyog UXZlcnRpY2FsX2JvcmRlciAqLworICAgICAgICAgIHx8IGZhY2VfaWQgPT0gSU5URVJOQUxfQk9S REVSX0ZBQ0VfSUQpKSAvKiBRaW50ZXJuYWxfYm9yZGVyICovCisgICAgZmFjZSA9IEZBQ0VfRlJP TV9JRCAoZiwgbG9va3VwX2Jhc2ljX2ZhY2UgKHcsIGYsIGZhY2VfaWQpKTsKKyAgICBlbHNlCisg ICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChmLCBmYWNlX2lkKTsKKyAgTGlzcF9PYmplY3QgY29s b3IgPSAoZmFjZSAhPSBOVUxMKQorICAgICAgICAgICAgICAgICAgICAgID8gZmFjZS0+bGZhY2Vb TEZBQ0VfQkFDS0dST1VORF9JTkRFWF0KKyAgICAgICAgICAgICAgICAgICAgICA6IGJ1aWxkX3N0 cmluZyAoIk9yYW5nZVJlZCIpOworICBtY194d19jb2xvcl92YWx1ZXMgKHcsIGNvbG9yLCBsc2wp OworfQorCit2b2lkCittY19zZXRfZXNzZW50aWFscyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0 IG1jX2Vzc2VudGlhbHMgKmVzc2VudGlhbHMpCit7CisgIGlmICghQlVGRkVSUCAody0+Y29udGVu dHMpKQorICAgIHJldHVybjsKKyAgaWYgKE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgbWNfY29uZikpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJ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nRpYWxzLT56diA9IFpWOworICBlc3NlbnRpYWxzLT56dl9ieXRlID0g WlZfQllURTsKKyAgZXNzZW50aWFscy0+ZmNfeCA9IChmaWxsX2NvbHVtbl9wCisgICAgICAgICAg ICAgICAgICAgICAgJiYgIU5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisgICAgICAgICAg ICAgICAgICAgICAgID8gKGZpbGxfY29sICogZnJhbWVfY2hhcl93aWR0aCkgKyB3LT5tYy5sbnVt X3BpeGVsX3dpZHRoIC0gaHNjbF94CisgICAgICAgICAgICAgICAgICAgICA6IChmaWxsX2NvbHVt bl9wCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBOSUxQIChWZGlzcGxheV9saW5lX251bWJl cnMpKQorICAgICAgICAgICAgICAgICAgICAgICA/IChmaWxsX2NvbCAqIGZyYW1lX2NoYXJfd2lk dGgpIC0gaHNjbF94CisgICAgICAgICAgICAgICAgICAgICA6IDA7CisgIGlmIChvbGRfYnVmZmVy KQorICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworICBlbnVtIGZhY2VfaWQg ZmlsbF9jb2x1bW5fcHJlX3p2X2ZhY2VfaWQgPQorICAgICghZXNzZW50aWFscy0+YWN0aXZlX3AK KyAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfaW5hY3RpdmVf d2luZG93cykpCisgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jv c3NoYWlycykpKQorICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiZmMt aW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICA6ICghZXNzZW50aWFscy0+YWN0aXZl X3AKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY19pbmFj dGl2ZV93aW5kb3dzKSkKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxf cnVsZXIpKQorICAgICAgICYmIHctPmN1cnNvci54ID09IGVzc2VudGlhbHMtPmZjX3gpCisgICAg ICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1vcG9pbnQtaW5hY3RpdmUt cHJlLXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICA6IChlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAg ICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAg ICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgJiYgdy0+ Y3Vyc29yLnggPT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2Ug KHcsIGYsIGludGVybiAoImZjLW9wb2ludC1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgIDogKCFl c3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAgICYmICFOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQIChCVkFS IChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgJiYgdy0+Y3Vyc29yLnggIT0gZXNzZW50 aWFscy0+ZmNfeCkKKyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZj LWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAgOiAoZXNzZW50aWFscy0+YWN0aXZl X3AKKyAg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KQorICAgICAgICAgICAgICAgICAgICAgOiAwOworICAgICAgZW51 bSBmYWNlX2lkIGV2ZW5fZmFjZV9pZCA9CisgICAgICAgICghZXNzZW50aWFscy5hY3RpdmVfcAor ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3Rp dmVfd2luZG93cykpKQorICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4g KCIrLWV2ZW4taW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgOiBsb29rdXBf bmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1ldmVuLXByZS16di1mYWNlIiksIHRydWUpOwor ICAgICAgc3RydWN0IGZhY2UgKmV2ZW5fZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgZXZlbl9mYWNl X2lkKTsKKyAgICAgIExpc3BfT2JqZWN0IGV2ZW5fY29sb3IgPSBldmVuX2ZhY2UtPmxmYWNlW0xG QUNFX0ZPUkVHUk9VTkRfSU5ERVhdOworICAgICAgc3RydWN0IG1jX1JHQiBldmVuX2ZvcmVncm91 bmQ7CisgICAgICBtY194d19jb2xvcl92YWx1ZXMgKHcsIGV2ZW5fY29sb3IsICZldmVuX2ZvcmVn cm91bmQpOworICAgICAgZW51bSBmYWNlX2lkIG9kZF9mYWNlX2lkID0KKyAgICAgICAgKCFlc3Nl bnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAgICAgID8gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistb2RkLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisg ICAgICAgIDogbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb2RkLXByZS16di1m YW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X2ZpbGxfZm9yZWdyb3VuZCk7CisgICAgICAvKiByZWQg Ki8KKyAgICAgIGlmICgoIWZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgJiYgY3VycmVudF9jb2wg JSAyICE9IDAKKyAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikKKyAgICAgICAg ICB8fCAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAmJiBjdXJyZW50X2NvbCAlIDIgIT0g MAorICAgICAgICAgICAgICAmJiBjdXJyZW50X2NvbCA8PSBmaWxsX2NvbAorICAgICAgICAgICAg ICAmJiByb3dfcG9zaXRpb24gPT0gUFJFX1pWKSkKKyAgICAgICAgeworICAgICAgICAgIGxzbF9m Zy0+cmVkID0gb2RkX2ZvcmVncm91bmQucmVkOworICAgICAgICAgIGxzbF9mZy0+Z3JlZW4gPSBv ZGRfZm9yZWdyb3VuZC5ncmVlbjsKKyAgICAgICAgICBsc2xfZmctPmJsdWUgPSBvZGRfZm9yZWdy b3VuZC5ibHVlOworICAgICAgICB9CisgICAgICAgIC8qIHllbGxvdyAqLworICAgICAgICBlbHNl IGlmICgoIWZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sICUg MiA9PSAwCisgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gUFJFX1pWKQorICAg ICAgICAgICAgICAgICB8fCAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAgICAgJiYg Y3VycmVudF9jb2wgJSAyID09IDAKKyAgICAgICAgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29s IDw9IGZpbGxfY29sCisgICAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gUFJF X1pWKSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBsc2xfZmctPnJlZCA9IGV2ZW5fZm9yZWdy b3VuZC5yZWQ7CisgICAgICAgICAgICBsc2xfZmctPmdyZWVuID0gZXZlbl9mb3JlZ3JvdW5kLmdy ZWVuOworICAgICAgICAgICAgbHNsX2ZnLT5ibHVlID0gZXZlbl9mb3JlZ3JvdW5kLmJsdWU7Cisg ICAgICAgICAgfQorICAgICAgICAgIC8qIGdyZWVuICovCisgICAgICAgICAgZWxzZSBpZiAoZmls bF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sID4gZmlsbF9jb2wK KyAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gUFJFX1pWKQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICBsc2xfZmctPnJlZCA9IGJleW9uZF9maWxsX2ZvcmVncm91bmQu cmVkOworICAgICAgICAgICAgICBsc2xfZmctPmdyZWVuID0gYmV5b25kX2ZpbGxfZm9yZWdyb3Vu ZC5ncmVlbjsKKyAgICAgICAgICAgICAgbHNsX2ZnLT5ibHVlID0gYmV5b25kX2ZpbGxfZm9yZWdy b3VuZC5ibHVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAocm93X3Bvc2l0 aW9uID09IEFUX1pWKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbHNsX2ZnLT5y ZWQgPSBlc3NlbnRpYWxzLnNwX2ZnLnJlZDsKKyAgICAgICAgICAgICAgICBsc2xfZmctPmdyZWVu ID0gZXNzZW50aWFscy5zcF9mZy5ncmVlbjsKKyAgICAgICAgICAgICAgICBsc2xfZmctPmJsdWUg PSBlc3NlbnRpYWxzLnNwX2ZnLmJsdWU7CisgICAgICAgICAgICAgIH0KKyAgICAgIGJyZWFrOwor ICAgIH0KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAgaWYgKGdseXBo ICE9IE5VTEwKKyAgICAgICAgICAmJiBnbHlwaC0+dS5jaCA9PSA5NQorICAgICAgICAgICYmIGN1 cnNvcl90eXBlID09IE1DX0hCQVIpCisgICAgICAgIHsKKyAgICAgICAgICBsc2xfZmct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X2ZnW3Jvd19wb3NpdGlvbl0uYmx1ZTsKKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBj YXNlIENVUlNPUl9JTkRJQ0FUT1I6CisgICAgeworICAgICAgc3RydWN0IGZyYW1lICpmID0gWEZS QU1FICh3LT5mcmFtZSk7CisgICAgICBlbnVtIGZhY2VfaWQgY3Vyc29yX2ZhY2VfaWQgPQorICAg ICAgICAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAgICAgJiYgcm93 X3Bvc2l0aW9uID09IFBSRV9aVikKKyAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBm LCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1 ZSkKKyAgICAgICAgOiAoZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAmJiByb3dfcG9z aXRpb24gPT0gUFJFX1pWKQorICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGlu dGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICA6 ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkKKyAgICAgICAgICAgJiYgcm93 X3Bvc2l0aW9uID09IEFUX1pWKQorICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywg ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLWF0LXp2LWZhY2UiKSwgdHJ1 ZSkKKyAgICAgICAgOiAoZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICA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UgaGwsIGludCBvdmVybGFwcywgaW50IHZwb3MsIHN0cnVjdCBtY19SR0IgbHNsLAor ICAgICAgICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwgZW51bSBtY19jdXJz b3JfdHlwZSBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICBpbnQgd2QsIGJvb2wgYWN0aXZl X3AsIGJvb2wgY3Vyc29yX2djX3AsCisgICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoX2Fj dGlvbiBhY3Rpb25fdHlwZSwgYm9vbCBkcmF3X3ApCit7CisgIGludCBzdGFydF94ID0geDsKKyAg aW50IHJlbGF0aXZlX3ggPSAwOworICBpbnQgbGVuZ3RoID0gMDsKKyAgLy8gIGlmIChtY19zdGRl cnJfcCkKKyAgLy8gICAgeworICAvLyAgICAgIGludCBzdGFydF9ocG9zID0gc3RhcnQ7CisgIC8v ICAgICAgaW50IGVuZF9ocG9zID0gZW5kOworICAvLyAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1j X2RyYXdfZ2x5cGhzICglZCk6ICBzdGFydF94ICglZCkgfCBzdGFydF9ocG9zICglZCkgfCBlbmRf aHBvcyAoJWQpXG4iLAorICAvLyAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgc3RhcnRfeCwg c3RhcnRfaHBvcywgZW5kX2hwb3MpOworICAvLyAgICB9CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhG UkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKmhlYWQsICp0 YWlsOworICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzOworICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpj bGlwX2hlYWQgPSBOVUxMLCAqY2xpcF90YWlsID0gTlVMTDsKKyAgaW50IGksIGosIHhfcmVhY2hl ZCwgbGFzdF94LCBhcmVhX2xlZnQgPSAwOworICBNQ19ERUNMQVJFX0hEQyAoaGRj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ja19tb3VzZV9mYWNlID0gZmFs c2U7CisgICAgICBpbnQgZHVtbXlfeCA9IDA7CisgICAgICAvKiBJZiBtb3VzZSBoaWdobGlnaHRp bmcgaXMgb24sIHdlIG1heSBuZWVkIHRvIGRyYXcgYWRqYWNlbnQKKyAgIGdseXBocyB1c2luZyBt b3VzZS1mYWNlIGhpZ2hsaWdodGluZy4gKi8KKyAgICAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAm JiByb3ctPm1vdXNlX2ZhY2VfcAorICAgICAgICAgICYmIGhsaW5mby0+bW91c2VfZmFjZV9iZWdf cm93ID49IDAKKyAgICAgICAgICAmJiBobGluZm8tPm1vdXNlX2ZhY2VfZW5kX3JvdyA+PSAwKQor ICAgICAgICB7CisgICAgICAgICAgcHRyZGlmZl90IHJvd192cG9zID0gTUFUUklYX1JPV19WUE9T IChyb3csIHctPmN1cnJlbnRfbWF0cml4KTsKKyAgICAgICAgICBpZiAocm93X3Zwb3MgPj0gaGxp bmZvLT5tb3VzZV9mYWNlX2JlZ19yb3cKKyAgICAgICAgICAgICAgJiYgcm93X3Zwb3MgPD0gaGxp bmZvLT5tb3VzZV9mYWNlX2VuZF9yb3cpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGNo ZWNrX21vdXNlX2ZhY2UgPSB0cnVlOworICAgICAgICAgICAgICBtb3VzZV9iZWdfY29sID0gKHJv d192cG9zID09IGhsaW5mby0+bW91c2VfZmFjZV9iZWdfcm93KQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBobGluZm8tPm1vdXNlX2ZhY2VfYmVnX2NvbAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAwOworICAgICAgICAgICAgICBtb3VzZV9lbmRfY29sID0gKHJvd192 cG9zID09IGhsaW5mby0+bW91c2VfZmFjZV9lbmRfcm93KQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBobGluZm8tPm1vdXNlX2ZhY2VfZW5kX2NvbAorICAgICAgICAgICAgICA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gICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgb3ZlcmxhcF9obCA9IERSQVdfTk9STUFMX1RFWFQ7CisgICAgICAgICAgaWYgKGhsID09 IG92ZXJsYXBfaGwgfHwgY2xpcF90YWlsID09IE5VTEwpCisgICAgICAgICAgICBjbGlwX3RhaWwg PSB0YWlsOworICAgICAgICAgIGkrKzsgICAgICAvKiBXZSBtdXN0IGluY2x1ZGUgdGhlIEl0aCBn bHlwaC4gKi8KKyAgICAgICAgICBNQ19CVUlMRF9HTFlQSF9TVFJJTkdTIChlbmQsIGksIGgsIHQs IG92ZXJsYXBfaGwsIHgsIGxhc3RfeCk7CisgICAgICAgICAgZm9yIChzID0gaDsgczsgcyA9IHMt Pm5leHQpCisgICAgICAgICAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gdHJ1ZTsKKyAgICAg ICAgICBjb21wdXRlX292ZXJoYW5nc19hbmRfeCAoaCwgdGFpbC0+eCArIHRhaWwtPndpZHRoLCBm YWxzZSk7CisgICAgICAgICAgYXBwZW5kX2dseXBoX3N0cmluZ19saXN0cyAoJmhlYWQsICZ0YWls LCBoLCB0KTsKKyAgICAgICAgfQorICAgICAgdGFpbCA9IGdseXBoX3N0cmluZ19jb250YWluaW5n X2JhY2tncm91bmRfd2lkdGggKHRhaWwpOworICAgICAgaWYgKGNsaXBfdGFpbCkKKyAgICAgICAg Y2xpcF90YWlsID0gZ2x5cGhfc3RyaW5nX2NvbnRhaW5pbmdfYmFja2dyb3VuZF93aWR0aCAoY2xp cF90YWlsKTsKKyAgICAgIGlmIChjbGlwX2hlYWQgfHwgY2xpcF90YWlsKQorICAgICAgICBmb3Ig KHMgPSBoZWFkOyBzOyBzID0gcy0+bmV4dCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBzLT5j bGlwX2hlYWQgPSBjbGlwX2hlYWQ7CisgICAgICAgICAgICBzLT5jbGlwX3RhaWwgPSBjbGlwX3Rh aWw7CisgICAgICAgICAgfQorICAgIH0K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YmIHJvdy0+b3Zlcmxh cHBlZF9wKQorICAgIHsKKyAgICAgIGlmIChyb3cgPiBtYXRyaXgtPnJvd3MKKyAgICAgICAgICAm JiBNQVRSSVhfUk9XX09WRVJMQVBTX1NVQ0NfUCAocm93IC0gMSkpCisgICAgICAgIGd1aV9maXhf b3ZlcmxhcHBpbmdfYXJlYSAodywgcm93IC0gMSwgVEVYVF9BUkVBLCBPVkVSTEFQU19FUkFTRURf Q1VSU09SKTsKKyAgICAgIGlmIChNQVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpIDwgd2luZG93X3Rl eHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgJiYgTUFUUklYX1JPV19PVkVSTEFQU19QUkVEX1Ag KHJvdyArIDEpKQorICAgICAgICBndWlfZml4X292ZXJsYXBwaW5nX2FyZWEgKHcsIHJvdyArIDEs IFRFWFRfQVJFQSwgT1ZFUkxBUFNfRVJBU0VEX0NVUlNPUik7CisgICAgfQorfQorCit2b2lkCitt Y19lcmFzZV9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1h dHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICBpbnQgeCwgaW50 IHksIGludCBocG9zLCBpbnQgdnBvcywgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLAorICAg ICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLCBpbnQgd2QpCit7 CisgIGJvb2wgZGVidWdfcCA9IGZhbHNlOworICBpZiAoZGVidWdfcCkKKyAgICBmcHJpbnRmIChz dGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICB4ICglZCkgfCB5ICglZCkgfCBocG9zICglZCkgfCB2 cG9zICglZCkgfCB3ZCAoJWQpXG5cCisgICAgZ2x5cGhfZmxhdm9yICglcykgfCBjdXJzb3JfdHlw ZSAoJXMpXG4iLAorICAgIHgsIHksIG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8fCBjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YKQorICAgIHsKKyAgICAg IGludCB0ZW1wX3ggPSB4OworICAgICAgaW50IGhlYWRlcl9saW5lX2hlaWdodCA9IFdJTkRPV19I RUFERVJfTElORV9IRUlHSFQgKHcpOworICAgICAgY3Vyc29yX2dseXBoID0gbWNfZ2V0X2N1cnNv cl9nbHlwaCAodywgbWF0cml4LCByb3csIGhwb3MsIHZwb3MpOworICAgICAgaWYgKGN1cnNvcl9n bHlwaCA9PSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAg ICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwg Nyk7CisgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICBpbnQgdGVtcF93ZCA9IGN1 cnNvcl9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICBpZiAodGVtcF94IDwgMCkKKyAgICAgICAg eworICAgICAgICAgIHRlbXBfd2QgKz0gdGVtcF94OworICAgICAgICAgIHRlbXBfeCA9IDA7Cisg ICAgICAgIH0KKyAgICAgIHRlbXBfd2QgPSBtaW4gKHdkLCB3aW5kb3dfYm94X3dpZHRoICh3LCBU RVhUX0FSRUEpIC0gdGVtcF94KTsKKyAgICAgIGludCBmeSA9IFdJTkRPV19UT19GUkFNRV9QSVhF TF9ZICh3LCBtYXggKGhlYWRlcl9saW5lX2hlaWdodCwgcm93LT55KSk7CisgICAgICBpbnQgZngg PSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCB0ZW1wX3gpOworICAgICAgaWYgKHRl bXBfd2QgPiAwKQorICAgICAgICBGUkFNRV9SSUYgKGYpLT5jbGVhcl9mcmFtZV9hcmVhIChmLCBm eCwgZnksIHRlbXBfd2QsIHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgIH0KKyAgLyogRXJhc2Ug dGhlI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gdnBvcyA8IDApCisgICAgcmV0dXJuOworICBzdHJ1 Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgYm9vbCBhdXRvX2hzY3JvbGxfbW9k ZV9wID0gRVEgKEZidWZmZXJfbG9jYWxfdmFsdWUgKFFhdXRvX2hzY3JvbGxfbW9kZSwgdy0+Y29u dGVudHMpLCBRY3VycmVudF9saW5lKTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwtbGVmdCA1KSAq LworICBib29sIGhzY2xfYWxsX3RlbXBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPm1pbl9oc2Nyb2xsID09IDApOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFu ZCBkbyBub3RoaW5nLiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMF9wID0gKHctPnN1c3BlbmRf YXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xs X21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9sbCk7Cisg IC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyBlbHNlIGJlc2lkZXMgaG9y aXpvbnRhbGx5IHNjcm9sbGluZyB0aGUKKyAgICAgICAgICAgICAgIGN1cnJlbnQgbGluZSBkaWZm ZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFs bHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8xX3AgPSAo IXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg YXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhz Y3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwg PiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+ aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIC4uLgorICAgICAgICAgICAg ICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRs eS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzJfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3Jv bGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA9PSAwCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1Q TEU6ICAoc2Nyb2xsLWxlZnQgNSk7IGFuZCwgdGhlbiBwcmVzcyB0aGUgbGVmdCBhcnJvdyBrZXkg b25lIHRpbWUuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkg c2Nyb2xsZWQgZGlmZmVyZW50bHkuKi8KKyAgYm9vbCBoc2NsX3RlbXBfcCA9ICghdy0+c3VzcGVu ZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9k ZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBD LXggPCBhbmQgZG8gc29tZXRoaW5nIHRoYXQgY2F1c2VzIHRoZSBjdXJyZW50IGxpbmUgdG8gYmUK KyAgICAgICAgICAgICAgIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4KKyAgICAg ICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJl bnRseS4gKi8KKyAgYm9vbCBoc2NsX3Blcm1fcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwK KyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9s bCAhPSB3LT5oc2Nyb2xsKTsKKyAgaW50IGZyaW5nZV9iaXRtYXAgPSBNQ19OT19GUklOR0VfQklU TUFQOworICBpbnQgZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgaWYgKCFyZW1vdmVfcAor ICAgICAgJiYgZ2x5cGhfZmxhdm9yID09IE1DX09WRVJMQVlfQVJST1dfQklUTUFQCisgICAgICAm JiAhaHNjbF9hbGxfdGVtcF9wCisgICAgICAmJiAhaHNjbF90ZW1wX3AKKyAgICAgICYmICFoc2Ns X3Blcm1fcAorICA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93IiksIHRydWUsIHRy dWUpOworICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNf TEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZy aW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklO R0VfQklUTUFQOworICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAg ICAgIHJvdy0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgIHJvdy0+ZnJpbmdlX2JpdG1h cF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAgfQorICAgIGVsc2UgaWYgKCFyZW1vdmVfcAorICAg ICAgICAgICAgICYmIGdseXBoX2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUAorICAg ICAgICAgICAgICYmIChoc2NsX2FsbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9h bGxfcGVybV8wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8xX3AKKyAgICAg ICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8yX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNj bF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9wZXJtX3ApKQorICAgICAgeworICAg ICAgICBlbnVtIGZhY2VfaWQgb3ZlcmxheV9hcnJvd19mYWNlX2lkID0KKyAgICAgICAgICAoIWFj dGl2ZV9wCisgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2Ug KHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2NsLWluY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lcm4gKCIrLWhzY2wtcGVybSIpLCB0cnVlLCB0cnVlKTsKKyAgICAg ICAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF90ZW1wX3ApCisgICAgICAgICAgICAgICAgICBm cmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC10 ZW1wIiksIGZhbHNlLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX3Rl bXBfcCkKKyAgICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2Vf Yml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtdGVtcCIpLCB0cnVlLCBmYWxzZSk7CisgICAgICAg IHJvdy0+bGVmdF9mcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdF X0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZyaW5nZV9iaXRt YXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRN QVA7CisgICAgICAgIHJvdy0+bGVmdF9mcmluZ2VfZmFjZV9pZCA9IGZhY2VfaWQ7CisgICAgICAg IHJvdy0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAgcm93LT5mcmluZ2VfYml0bWFw X3BlcmlvZGljX3AgPSBmYWxzZTsKKyAgICAgIH0KKyAgICAgIGVsc2UgaWYgKCFyZW1vdmVfcAor ICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJ R0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVS U0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBn bHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRQorICAgICAgICAgICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAg ICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hU X0FSUk9XCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FM X0JBUgorICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9W RVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVS VElDQUxfQkFSX0JBQ0tTTEFTSCkpCisgICAgICAgIHsKKyAgICAgICAgICBMaXNwX09iamVjdCBi aXRtYXBfZmxhdm9yID0gKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hU X0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xs b3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJ R0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1j X3JldmVyc2VkX2hvbGxvd19yZWN0YW5nbGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5H TEUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfaG9sbG93 X3JlY3RhbmdsZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlw aF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvdwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0g TUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9yaWdodF9h cnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2 b3IgPT0gTUNfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gUW1jX3ZlcnRpY2FsX2JhcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRp Y2FsX2JhcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9m bGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfYmFja3NsYXNoCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogUW5pbDsKKyAgICAgICAgICBmcmluZ2Vf Yml0bWFwID0gKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVApCisgICAgICAg ICAgICAgICAgICAgICAgICAgID8gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJpdG1hcF9mbGF2b3Ip CisgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAg ICAgICBmYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAg ICAgICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9X X1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBo X2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAg ICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxf QkFSKSkKKyAgICAgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2UgKHcsIGYs IGludGVybiAoIistcmV2ZXJzZWQtYmFyLXByZS16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0 cnVlKQorICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklO R0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19S RVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAg ICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJS T1cKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VE X1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistYmFyLXByZS16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0 cnVlKQorICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBy b3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9IGZhbHNlOworICAgICAgICAgIHJvdy0+cmlnaHRfZnJp bmdlX2JpdG1hcCA9IGZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgcm93LT5yaWdodF9mcmluZ2Vf ZmFjZV9pZCA9IGZhY2VfaWQ7CisgICAgICAgICAgcm93LT5yaWdodF9mcmluZ2Vfb2Zmc2V0ID0g MDsKKyAgICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IGZhbHNlOworICAg ICAgICB9CisgICAgICAgIGVsc2UgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAg ICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTKQorICAgICAgICAgIHsK KyAgICAgICAgICAgIGJvb2wgb25fcCA9IHRydWU7CisgICAgICAgICAgICBGUkFNRV9SSUYgKGYp LT5tY19zY3JpYmVfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgd2QsIGgs IGxzbCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBjdXJzb3Jfd2lkdGgsIGdseXBoX2ZsYXZvciwgb25fcCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wKTsKKyAgICAgICAgICB9Cit9 CisKKy8qIER1bXAgY29udGVudHMgb2YgZ2x5cGggR0xZUEggd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Y3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklMUCAo Z2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6ICct JykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+dS5jaCwK KyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3As CisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBvcywg Z2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAoZ2x5 cGgtPnUuY2gpKTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZ UEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01 ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJXNc biIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChy b3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAg IHJlbGF0aXZlX3gsCisgICAgICAgICdTJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAg ICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAgICAg ICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAg ICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICA6 ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAwdSwKKyAgICAg ICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAg ICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhf enZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAiXFxTIik7CisgICAgfQorICBlbHNlIGlmIChn bHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIs CisgICAgICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNnggJTRk ICUxLjFkJTEuMWQgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVz ZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ0knLAorICAgICAg ICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lk dGgsCisgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmltZ19pZCwKKyAgICAgICAgZ2x5 cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGds eXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ ICJaViIgOiAiLS0iLAorICAgICAgICAnLicpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5 cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAg ICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCIsCisgICAg ICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRb YXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZl X3gsCisgICAgICAgICcrJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZG RVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAgICAgICA6IChTVFJJ TkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICA6IChOSUxQ IChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICA6ICctJykpKSwK KyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5zaWduZWQgaW50KSBnbHlw aC0+dS5jbXAuaWQpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICU0ZCAlMS4xZCUxLjFkIiwK KyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3As CisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wKTsKKyAgICAgIGlmIChnbHlwaC0+dS5j bXAuYXV0b21hdGljKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICUzZCAlcyAuIFslZC0l ZF1cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2X3Ag PyAiWlYiIDogIi0tIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaC0+c2xpY2UuY21w LmZyb20sIGdseXBoLT5zbGljZS5jbXAudG8pOworICAgICAgICBlbHNlCisgICAgICAgIGZwcmlu dGYgKHN0ZGVyciwgIlxuIik7CisgICAgfQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBYV0lE R0VUX0dMWVBIKQorICAgIHsKKyNpZm5kZWYgSEFWRV9YV0lER0VUUworICAgICAgZWFzc3VtZSAo ZmFsc2UpOworI2Vsc2UKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAgJTVkLyUt NWQgJTVkICU0YyAlNmQgJWMgJTNkIDB4JTA1eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVjXG4i LAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93 LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICBy ZWxhdGl2ZV94LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAg ICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgPyAnQicKKyAgICAgICAgIDog KFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgOiAn LScpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+ZmFjZV9p ZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0 X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT51Lnh3aWRnZXQsCisgICAgICAgIGdseXBoLT5o cG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisjZW5kaWYKKyAg ICB9Cit9CisKKy8qIER1bXAgdGhlIGNvbnRlbnRzIG9mIGdseXBoIHJvdyBhdCBWUE9TIGluIE1B VFJJWCB0byBzdGRlcnIuCisgICBHTFlQSFMgMCBtZWFucyBkb24ndCBzaG93IGdseXBoIGNvbnRl bnRzLgorICAgR0xZUEhTIDEgbWVhbnMgc2hvdyBnbHlwaHMgaW4gc2hvcnQgZm9ybQorICAgR0xZ UEhTID4gMSBtZWFucyBzaG93IGdseXBocyBpbiBsb25nIGZvcm0uICovCit2b2lkCittY19kdW1w X2dseXBoX3JvdyAoc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgdnBvcywgaW50IGdseXBocykK K3sKKyAgaW50IHJlbGF0aXZlX3ggPSAwOworICBpZiAoZ2x5cGhzICE9IDEpCisgICAgeworICAg ICAgZnByaW50ZiAoc3RkZXJyLCAiXG5EVU1QIEdMWVBIIFJPV1xuIik7CisgICAgICBmcHJpbnRm IChzdGRlcnIsICJSb3cgICAgIFN0YXJ0ICAgICAgIEVuZCBVc2VkIG9FPjxcXENUWkZlc20gICAg IFggICAgWSAgICBXICAgIEggICAgViAgICBBICAgIFBcbiIpOworICAgICAgZnByaW50ZiAoc3Rk ZXJyLCAiPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwg IiUzZCAlOSJwRCJkICU5InBEImQgJTRkICUxLjFkJTEuMWQlMS4xZCUxLjFkXAorJTEuMWQlMS4x ZCUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCAgJTRkICU0ZCAlNGQgJTRkICU0ZCAlNGQg JTRkXG4iLAorICAgICAgICAgdnBvcywKKyAgICAgICAgIE1BVFJJWF9ST1dfU1RBUlRfQ0hBUlBP UyAocm93KSwKKyAgICAgICAgIE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdyksCisgICAgICAg ICByb3ctPnVzZWRbVEVYVF9BUkVBXSwKKyAgICAgICAgIHJvdy0+Y29udGFpbnNfb3ZlcmxhcHBp bmdfZ2x5cGhzX3AsCisgICAgICAgICByb3ctPmVuYWJsZWRfcCwKKyAgICAgICAgIHJvdy0+dHJ1 bmNhdGVkX29uX2xlZnRfcCwKKyAgICAgICAgIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3AsCisg ICAgICAgICByb3ctPmNvbnRpbnVlZF9wLAorICAgICAgICAgTUFUUklYX1JPV19DT05USU5VQVRJ T05fTElORV9QIChyb3cpLAorICAgICAgICAgTUFUUklYX1JPV19ESVNQTEFZU19URVhUX1AgKHJv dyksCisgICAgICAgICByb3ctPmVuZHNfYXRfenZfcCwKKyAgICAgICAgIHJvdy0+ZmlsbF9saW5l X3AsCisgICAgICAgICByb3ctPmVuZHNfaW5fbWlkZGxlX29mX2NoYXJfcCwKKyAgICAgICAgIHJv dy0+c3RhcnRzX2luX21pZGRsZV9vZl9jaGFyX3AsCisgICAgICAgICByb3ctPm1vdXNlX2ZhY2Vf cCwKKyAgICAgICAgIHJvdy0+eCwKKyAgICAgICAgIHJvdy0+eSwKKyAgICAgICAgIHJvdy0+cGl4 ZWxfd2lkdGgsCisgICAgICAgICByb3ctPmhlaWdodCwKKyAgICAgICAgIHJvdy0+dmlzaWJsZV9o ZWlnaHQsCisgICAgICAgICByb3ctPmFzY2VudCwKKyAgICAgICAgIHJvdy0+cGh5c19hc2NlbnQp OworICAgICAgLyogVGhlIG5leHQgMyBsaW5lcyBzaG91bGQgYWxpZ24gdG8gIlN0YXJ0IiBpbiB0 aGUgaGVhZGVyLiAqLworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAgICU5InBEImQgJTkicEQi ZFx0JTVkXG4iLCByb3ctPnN0YXJ0Lm92ZXJsYXlfc3RyaW5nX2luZGV4LAorICAgICAgICAgcm93 LT5lbmQub3ZlcmxheV9zdHJpbmdfaW5kZXgsCisgICAgICAgICByb3ctPmNvbnRpbnVhdGlvbl9s aW5lc193aWR0aCk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTkicEQiZCAlOSJwRCJk XG4iLAorICAgICAgICAgQ0hBUlBPUyAocm93LT5zdGFydC5zdHJpbmdfcG9zKSwKKyAgICAgICAg IENIQVJQT1MgKHJvdy0+ZW5kLnN0cmluZ19wb3MpKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwg IiAgICAlOWQgJTlkXG4iLCByb3ctPnN0YXJ0LmRwdmVjX2luZGV4LAorICAgICAgICAgcm93LT5l bmQuZHB2ZWNfaW5kZXgpOworICAgIH0KKyAgaWYgKGdseXBocyA+IDEpCisgICAgeworICAgICAg Zm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJl YSkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBo c1thcmVhXTsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsgcm93 LT51c2VkW2FyZWFdOworICAgICAgICAgIC8qIEdseXBoIGZvciBhIGxpbmUgZW5kIGluIHRleHQu ICovCisgICAgICAgICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYmIGdseXBoID09IGdseXBoX2Vu ZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDApCisgICAgICAgICAgICArK2dseXBoX2VuZDsKKyAgICAg ICAgICBpZiAoZ2x5cGggPCBnbHlwaF9lbmQpCisgICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIs ICJHbHlwaCMvVG90YWwgUmVsLlggVCAgICAgICBQb3MgTyAgIFcgICAgIENvZGUgRmFjZSBMUiBI UE9TIFpWIENcbiIpOworICAgICAgICAgIGZvciAoOyBnbHlwaCA8IGdseXBoX2VuZDsgKytnbHlw aCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfZHVtcF9nbHlwaCAocm93LCBnbHlw aCwgYXJlYSwgcmVsYXRpdmVfeCwgdnBvcyk7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0g Z2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAg IGVsc2UgaWYgKGdseXBocyA9PSAxKQorICAgICAgeworICAgICAgICBjaGFyIHNbU0hSVF9NQVgg KyA0XTsKKyAgICAgICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBM QVNUX0FSRUE7ICsrYXJlYSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgaTsKKyAgICAg ICAgICAgIGZvciAoaSA9IDA7IGkgPCByb3ctPnVzZWRbYXJlYV07ICsraSkKKyAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBoc1th cmVhXSArIGk7CisgICAgICAgICAgICAgICAgaWYgKGkgPT0gcm93LT51c2VkW2FyZWFdIC0gMQor ICAgICAgICAgICAgICAgICAgICAmJiBhcmVhID09IFRFWFRfQVJFQQorICAgICAgICAgICAgICAg ICAgICAmJiBOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAgICAgICAmJiBnbHlw aC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT51LmNo ID09ICcgJykKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc3RyY3B5 ICgmc1tpXSwgIltcXG5dIik7CisgICAgICAgICAgICAgICAgICAgIGkgKz0gNDsKKyAgICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IENI QVJfR0xZUEgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT51LmNoIDwgMHg4 MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPj0gJyAnKQorICAg ICAgICAgICAgICAgICAgICBzW2ldID0gZ2x5cGgtPnUuY2g7CisgICAgICAgICAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICBzW2ldID0gJy4nOworICAgICAgICAgICAgICB9 CisgICAgICAgICAgICBzW2ldID0gJ1wwJzsKKyAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwg IiUzZDogKCVkKSAnJXMnXG4iLCB2cG9zLCByb3ctPmVuYWJsZWRfcCwgcyk7CisgICAgICAgICAg fQorICAgICAgfQorfQorCitERUZVTiAoIm1jLWR1bXAtZ2x5cGgtcm93IiwgRm1jX2R1bXBfZ2x5 cGhfcm93LCBTbWNfZHVtcF9nbHlwaF9yb3csIDEsIDIsICJQIiwKKyAgICAgICBkb2M6IC8qIER1 bXAgZ2x5cGggcm93IFJPVyB0byBzdGRlcnIuCitJbnRlcmFjdGl2ZWx5LCBST1cgaXMgdGhlIHBy ZWZpeCBudW1lcmljIGFyZ3VtZW50IGFuZCBkZWZhdWx0cyB0bwordGhlIHJvdyB3aGljaCBkaXNw bGF5cyBwb2ludC4KK09wdGlvbmFsIGFyZ3VtZW50IEdMWVBIUyAwIG1lYW5zIGRvbid0IGR1bXAg Z2x5cGhzLgorR0xZUEhTIDEgbWVhbnMgZHVtcCBnbHlwaHMgaW4gc2hvcnQgZm9ybS4KK0dMWVBI UyA+IDEgb3Igb21pdHRlZCBtZWFucyBkdW1wIGdseXBocyBpbiBsb25nIGZvcm0uICAqLykKKyAg KExpc3BfT2JqZWN0IHJvdywgTGlzcF9PYmplY3QgZ2x5cGhzKQoreworICBzdHJ1Y3Qgd2luZG93 ICp3ID0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KTsKKyAgc3RydWN0IGdseXBoX21hdHJpeCAq bWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgIEVNQUNTX0lOVCB2cG9zOworICBpZiAoTklM UCAocm93KSkKKyAgICB7CisgICAgICBpbnQgZDEsIGQyLCBkMywgZDQsIGQ1LCB5cG9zOworICAg ICAgYm9vbCB2aXNpYmxlX3AgPSBwb3NfdmlzaWJsZV9wICh3LCBQVCwgJmQxLCAmZDIsICZkMywg JmQ0LCAmZDUsICZ5cG9zKTsKKyAgICAgIGludCBoZWFkZXJfbGluZV9oZWlnaHQgPSBXSU5ET1df SEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgIGludCB2b2Zmc2V0ID0gKGhlYWRlcl9saW5l X2hlaWdodCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICYmIHlwb3MgPiAwKQorICAgICAgICAg ICAgICAgICAgICAgID8geXBvcyArIDEKKyAgICAgICAgICAgICAgICAgICAgICA6IHlwb3M7Cisg ICAgICBpZiAodmlzaWJsZV9wKQorICAgICAgICB2cG9zID0gdm9mZnNldDsKKyAgICAgICAgZWxz ZQorICAgICAgICAgIHZwb3MgPSAwOworICAgIH0KKyAgICBlbHNlCisgICAgICB7CisgICAgICAg IENIRUNLX05VTUJFUiAocm93KTsKKyAgICAgICAgdnBvcyA9IFhGSVhOVU0gKHJvdyk7CisgICAg ICB9CisgIGlmICh2cG9zID49IDAgJiYgdnBvcyA8IG1hdHJpeC0+bnJvd3MpCisgICAgbWNfZHVt cF9nbHlwaF9yb3cgKE1BVFJJWF9ST1cgKG1hdHJpeCwgdnBvcyksCisgICAgICAgIHZwb3MsCisg ICAgICAgIFRZUEVfUkFOR0VEX0ZJWE5VTVAgKGludCwgZ2x5cGhzKSA/IFhGSVhOVU0gKGdseXBo cykgOiAyKTsKKyAgcmV0dXJuIFFuaWw7Cit9CisKK3ZvaWQKK21jX2R1bXBfZ2x5cGhfbWF0cml4 IChzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIGludCBnbHlwaHMpCit7CisgIGludCBpOwor ICB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ZmVyKSk7CisgIGZwcmludGYgKHN0ZGVyciwgIkN1 cnNvciB4ID0gJWQsIHkgPSAlZCwgaHBvcyA9ICVkLCB2cG9zID0gJWRcbiIsCisgICAgIHctPmN1 cnNvci54LCB3LT5jdXJzb3IueSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zKTsKKyAg ZnByaW50ZiAoc3RkZXJyLCAiPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09XG4iKTsKKyAgbWNfZHVtcF9nbHlwaF9tYXRyaXggKHctPmN1cnJlbnRfbWF0cml4LAor ICAgICAgICAgVFlQRV9SQU5HRURfRklYTlVNUCAoaW50LCBnbHlwaHMpID8gWEZJWE5VTSAoZ2x5 cGhzKSA6IDApOworICByZXR1cm4gUW5pbDsKK30KKworYm9vbAorbWNfdHJhdmVyc2VfY2FjaGVf cCAoc3RydWN0IG1jX21hdHJpeCBtYXRyaXgsIGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBl LAorICAgICAgICAgICAgICAgICAgICAgaW50IHZudGgsIGludCBudGgpCit7CisgIGlmICh2bnRo IDwgbWF0cml4LnZwb3NfdXNlZAorICAgICAgJiYgbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90 eXBlXSA+IDAKKyAgICAgICYmIG50aCA8IG1hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2Fj aGVfdHlwZV0pCisgICAgcmV0dXJuIHRydWU7CisgICAgZWxzZQorICAgICAgcmV0dXJuIGZhbHNl OworfQorCit2b2lkCittY19yZXNldF9jYWNoZSAoc3RydWN0IHdpbmRvdyAqdykKK3sKKyAgaWYg KCFCVUZGRVJQICh3LT5jb250ZW50cykpCisgICAgcmV0dXJuOworICBmb3IgKGVudW0gbWNfY2Fj aGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NB Q0hFOworICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICB7CisgICAgICBib29sIGJ2YXJfYWN0aXZl X3A7CisgICAgICBzd2l0Y2ggKGNhY2hlX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgICBjYXNl IE5PX0NBQ0hFOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICByZXR1cm47CisgICAgICAg ICAgICB9CisgICAgICAgICAgY2FzZSBNQ19DQUNIRToKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgJiYgTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkpCisgICAgICAgICAgICAg ICAgYnZhcl9hY3RpdmVfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKEJVRkZF UlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkKKyAgICAgICAgICAgICAgICAgIGJ2 YXJfYWN0aXZlX3AgPSB0cnVlOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0K KyAgICAgICAgICBjYXNlIENIX0NBQ0hFOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICBp ZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAmJiBOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICAgICAgICAgICAgICBi dmFyX2FjdGl2ZV9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoQlVGRkVSUCAo dy0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgICAgICAgICAgICAgYnZh cl9hY3RpdmVfcCA9IHRydWU7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQor ICAgICAgICAgIGNhc2UgRkNfQ0FDSEU6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlm IChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKQorICAgICAgICAgICAgICAgIGJ2 YXJfYWN0aXZlX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChCVUZGRVJQICh3 LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgICAgICAgICAgICAgICBidmFy X2FjdGl2ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICAgIGlmICghYnZhcl9hY3RpdmVfcCkKKyAgICAgICAgeworICAgICAgICAg IC8qIERlY3JlYXNlIHRoZSBzaXplIG9mIHRoZSBhcnJheSB0byBhIGJhcmUgbWluaW11bS4gKi8K KyAgICAgICAgICBmb3IgKGludCB2bnRoID0gMDsgdm50aCA8IHctPm1jX21hdHJpeC52cG9zX3Vz ZWQ7ICsrdm50aCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlX2FsbG9jYXRlZFtjYWNoZV90eXBlXSA+IDEpCisgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV0gPQorICAgICAgICAgICAgICAgICAgICB4bnJlYWxsb2MgKHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdLCAxLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHNpemVvZiAqdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV0pOworICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxs b2NhdGVkW2NhY2hlX3R5cGVdID0gMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0gPSAwOworICAg ICAgICAgICAgfQorICAgICAgICAgIHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlw ZV0gPSAwOworICAgICAgICB9CisgICAgICAgIC8vICBBbHRob3VnaCBpdCB3b3VsZCBub3QgYmUg dmVyeSBlZmZpY2llbnQsIGl0IGlzIHBvc3NpYmxlIHRvIHNldAorICAgICAgICAvLyAgdGhlIF91 c2VkXyBlbGVtZW50cyBvZiB0aGUgYXJyYXkgdG8gemVyby4gIEluIHN1Y2ggYSBjYXNlLCB0aGUK KyAgICAgICAgLy8gIC4uLl9lbHRzLmFsbG9jYXRlZFtjYWNoZV90eXBlXSB3b3VsZCByZW1haW4g dGhlIHNhbWUuCisgICAgICAgIC8vICBtZW1zZXQgKHctPm1jX21hdHJpeC52cG9zW0BdLmNhY2hl W2NhY2hlX3R5cGVdLCAwLCB3LT5tY19tYXRyaXgudnBvc1tAXS5jYWNoZV91c2VkW2NhY2hlX3R5 cGVdCisgICAgICAgIC8vICAgICAgICAgICogKHNpemVvZiAqdy0+bWNfbWF0cml4LnZwb3NbQF0u Y2FjaGVbY2FjaGVfdHlwZV0pKTsKKyAgICAgICAgLy8gIEF0IHRoaXMgdGltZSwgd2UgYXJlIGlu c3RlYWQgbGVhdmluZyB0aGUgYXJyYXkgYXMtaXMgd2l0aCB0aGUKKyAgICAgICAgLy8gIHVu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mxhdm9yLAorICAgICAgICAgICBib29sIGRy YXdfcCwgZW51bSBtY19kcmF3X3Jvd190eXBlIGZyb21fd2hlcmUsCisgICAgICAgICAgIGVudW0g bWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlLCBlbnVtIG1jX2VuZ2luZV90eXBlIGFjdGlvbl90eXBl KQoreworICBpbnQgdm50aCA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICBpZiAo bWNfc3RkZXJyX3AKKyAgICAgICYmIGRyYXdfcCkKKyAgICB7CisgICAgICBpbnQgY2hhcnBvcyA9 IGdseXBoLT5jaGFycG9zOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG5tY19oZWxwZXIgKCVz KTogIGZyb21fd2hlcmUgKCVzKVxuXAorICBhY3Rpb25fdHlwZSAoJXMpIHwgZmxhdm9yICglcykg fCBjaGFycG9zICglZClcblwKKyAgY2hhciAoJXMpIHwgeCAoJWQpIHwgZnggKCVkKSB8IHkgKCVk KSB8IGZ5ICglZCkgfCBocG9zICglZC8lZCkgfCB2cG9zICglZClcblwKKyAgaCAoJWQpIHwgY3Vy c29yX3R5cGUgKCVzKSB8IGN1cnNvcl93aWR0aCAoJWQpIHwgYWN0aXZlX3AgKCVzKVxuXAorICBG Ry1SR0IgKCVmLyVmLyVmKSB8IEJHLVJHQiAoJWYvJWYvJWYpXG4iLAorICAgICAgbWNfd2luZG93 ICh3KSwgbWNfZHJhd19yb3dfdHlwZV90b19zdHJpbmcgKGZyb21fd2hlcmUpLAorICAgICAgbWNf ZW5naW5lX3R5cGVfdG9fc3RyaW5nIChhY3Rpb25fdHlwZSksIG1jX2ZsYXZvcl90b19zdHJpbmcg KGdseXBoX2ZsYXZvciksCisgICAgICBjaGFycG9zLCBtY19jaGFyX3RvX3N0cmluZyAoZ2x5cGgt PnUuY2gpLCB4LCBmeCwgeSwgZnksIGhwb3MsCisgICAgICByb3ctPnVzZWRbVEVYVF9BUkVBXSAt IDEsIHZwb3MsIGgs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RyYXdfZXJhc2VfaHlicmlk ICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwgY3Vyc29y X3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGZvcmVn cm91bmQsIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAgIHJldHVybjsK KyAgICB9CisgICAgZWxzZSBpZiAoZHJhd19wCisgICAgICAgICAgICAgJiYgKGZyb21fd2hlcmUg PT0gU0NSSUJFX09ORQorICAgICAgICAgICAgICAgICB8fCBmcm9tX3doZXJlID09IFNDUklCRV9U V08KKyAgICAgICAgICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBTQ1JJQkVfVEhSRUUKKyAgICAg ICAgICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBOT1dIRVJFKSkKKyAgICAgIHsKKyAgICAgICAg bWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsIHdkLCBoLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgcmVtb3Zl X3ApOworICAgICAgICByZXR1cm47CisgICAgICB9CisgIGlmIChjYWNoZV90eXBlID09IE5PX0NB Q0hFKQorICAgIHJldHVybjsKKyAgKyt3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5 cGVdOworICBpZiAodm50aCA+PSB3LT5tY19tYXRyaXgudnBvc191c2VkKQorICAgIHctPm1jX21h dHJpeC52cG9zX3VzZWQgPSB2bnRoICsgMTsKKyAgaWYgKHctPm1jX21hdHJpeC52cG9zX2FsbG9j YXRlZCA8IHctPm1jX21hdHJpeC52cG9zX3VzZWQpCisgICAgeworICAgICAgaW50IG9sZF9hbGxv YyA9IHctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZDsKKyAgICAgIGludCBuZXdfZWx0cyA9IHct Pm1jX21hdHJpeC52cG9zX3VzZWQgLSB3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQ7CisgICAg ICB3LT5tY19tYXRyaXgudnBvcyA9IHhwYWxsb2MgKHctPm1jX21hdHJpeC52cG9zLCAmdy0+bWNf bWF0cml4LnZwb3NfYWxsb2NhdGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBuZXdfZWx0cywgSU5UX01BWCwgc2l6ZW9mICp3LT5tY19tYXRyaXgudnBvcyk7CisgICAgICBt ZW1zZXQgKHctPm1jX21hdHJpeC52cG9zICsgb2xkX2FsbG9jLCAwLAorICAgICAgICAgICAgICAg KHctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZCAtIG9sZF9hbGxvYykgKiBzaXplb2YgKnctPm1j X21hdHJpeC52cG9zKTsKKyAgICB9CisgICsrdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVf dXNlZFtjYWNoZV90eXBlXTsKKyAgaWYgKHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX2Fs bG9jYXRlZFtjYWNoZV90eXBlXSA8IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRb Y2FjaGVfdHlwZV0pCisgICAgeworICAgICAgaW50IG9sZF9hbGxvYyA9IHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlX2FsbG9jYXRlZFtjYWNoZV90eXBlXTsKKyAgICAgIGludCBuZXdfZWx0 cyA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0gLSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV07CisgICAgICB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSA9IHhwYWxsb2MgKHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfZWx0cywKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSU5U X01BWCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgc2l6ZW9mICp3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XSk7CisgICAgICBtZW1zZXQgKHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdICsgb2xkX2FsbG9jLCAwLAorICAgICAgICAgICAgICAgKHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlX2FsbG9jYXRlZFtjYWNoZV90eXBlXSAtIG9sZF9hbGxvYykKKyAgICAgICAgICAg ICAgICAgKiBzaXplb2YgKnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd KTsKKyAgICB9CisgIGludCBudGggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2Vk W2NhY2hlX3R5cGVdIC0gMTsKKyAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS5zYW1lX3AgPSBmYWxzZTsKKyAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bb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ZXh0IGxpbmUuICBUaGUgRlggY29vcmRpbmF0ZSBpcyBzZXQKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V3aGVyZTogIGB3LT5jdXJzb3IueGAgLyBg bWMuZmNfeGAuICovCit2b2lkCittY19nZXRfY3Vyc29yX2dlb21ldHJ5IChzdHJ1Y3Qgd2luZG93 ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAg ICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB4LCBpbnQgKmZ4LCBpbnQgeSwKKyAgICAgICAg ICAgICAgICAgICAgICAgIGludCAqZnksIGludCBocG9zLCBpbnQgdnBvcywgaW50ICpoLAorICAg ICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwgaW50 IGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCAqd2QpCit7CisgIHN0 cnVjdCBnbHlwaCAqZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywg aHBvcywgdnBvcyk7CisgIGlmIChnbHlwaCA9PSBOVUxMKQorICAgIHJldHVybjsKKyAgc3RydWN0 IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgKmZ4ID0gV0lORE9XX1RF WFRfVE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICpoID0gcm93LT52aXNpYmxlX2hlaWdodDsK KyAgLyogRG9uJ3QgbGV0IHRoZSBjdXJzb3IgZXhjZWVkIHRoZSBkaW1lbnNpb25zIG9mIHRoZSBy b3csIHNvIHRoYXQKKyAgdGhlIHVwcGVyL2xvd2VyIHNpZGUgb2YgdGhlIGJveCBhcmVuJ3QgY2xp cHBlZC4gICovCisgIGludCB3X2hlYWRlcl9saW5lX2hlaWdodCA9IFdJTkRPV19IRUFERVJfTElO RV9IRUlHSFQgKHcpOworICBpbnQgd190ZXh0X2JvdHRvbV95ID0gd2luZG93X3RleHRfYm90dG9t X3kgKHcpIC0gKmg7CisgIGlmICh5IDwgd19oZWFkZXJfbGluZV9oZWlnaHQpCisgICAgeworICAg ICAgKmggPSBtYXggKCpoIC0gKHdfaGVhZGVyX2xpbmVfaGVpZ2h0IC0geSkgKyAxLCAqaCk7Cisg ICAgICB5ID0gd19oZWFkZXJfbGluZV9oZWlnaHQgLSAxOworICAgICAgLy8gZnByaW50ZiAoc3Rk ZXJyLCAiQ09ORElUSU9OICMgMVxuIik7CisgICAgfQorICAgZWxzZSBpZiAoeSA+IHdfdGV4dF9i b3R0b21feSkKKyAgICAgeworICAgICAgICpoICs9IHkgLSB3X3RleHRfYm90dG9tX3k7CisgICAg ICAgeSA9IHdfdGV4dF9ib3R0b21feTsKKyAgICAgICAvLyBmcHJpbnRmIChzdGRlcnIsICJDT05E SVRJT04gIyAyXG4iKTsKKyAgICAgfQorICAqZnkgPSBXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAo dywgeSk7CisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgeworICAgICAgY2FzZSBNQ19CQVI6 CisgICAgICAgIHsKKyAgICAgICAgICBpZiAoY3Vyc29yX3dpZHRoIDwgMSkKKyAgICAgICAgICAg IGN1cnNvcl93aWR0aCA9IG1heCAoRlJBTUVfQ1VSU09SX1dJRFRIIChmKSwgMSk7CisgICAgICAg ICAgaWYgKGN1cnNvcl93aWR0aCA8IGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgICAqd2Qg PSBjdXJzb3Jfd2lkdGg7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2Ug TUNfSEJBUjoKKyAgICAgICAgeworICAgICAgICAgIGludCBjdXJzb3JfaGVpZ2h0ID0gKGN1cnNv cl93aWR0aCA8IDEpID8gbHJpbnQgKDAuMjUgKiAqaCkgOiBjdXJzb3Jfd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ICAgICAgICA/IE1BVFJJWF9ST1cgKGN1cnNvcl9tYXRyaXgsIHctPmN1 cnNvci52cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICBz dHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGN1cnNv cl9tYXRyaXgsIGN1cnNvcl9yb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICBib29sIGN1cnNvcl9hdF9mcmlu Z2VfcCA9IChjdXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5l X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gdGV4dF9h cmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09 IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRoKTsKKyAgYm9vbCBjdXJzb3JfYmV5b25kX2ZyaW5nZV9w ID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHctPmN1cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193 aWR0aF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNv ci54ID49IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+Y3Vyc29yLnggPj0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOworICBpbnQgZnJhbWVf Y2hhcl93aWR0aCA9IEZSQU1FX0NPTFVNTl9XSURUSCAoZik7CisgIGludCB0ZW1wX2ZhY2VfaWQg PSBnbHlwaC0+ZmFjZV9pZDsKKyAgc3RydWN0IG1jX1JHQiBiYWNrZ3JvdW5kOworICBtY19zZXRf bHNsX2JnICh3LCB0ZW1wX2ZhY2VfaWQsICZiYWNrZ3JvdW5kKTsKKyAgYm9vbCByZWFsX2Zha2Vf Y3Vyc29yX3AgPSAob3BvaW50X3ggPT0gcmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBvcG9pbnRfaHBvcyA9PSBocG9zCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9wb2ludF95ID09IHJvdy0+eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvcG9pbnRfdnBvcyA9PSB2cG9zKTsKKworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAg ICAgICAgICAgICAgICAgICAgICAgQkVHSU46ICBDSEFSX0dMWVBIIHwgR0xZUEhMRVNTX0dMWVBI ICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICBpZiAoZ2x5 cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgfHwgZ2x5cGgtPnR5cGUgPT0gR0xZUEhMRVNT X0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgZnByaW50ZiAoc3RkZXJy LAorICAgICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNngg JTRkICUxLjFkJTEuMWQgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ct PnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgKGdseXBoLT50 eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgID8gJ0MnCisgICAgICAgICA6ICdHJyksCisgICAg ICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAg ICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAg ICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgICAgICAgIGds eXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPnUuY2gsCisgICAgICAgIGdseXBoLT5m YWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+ cmlnaHRfYm94X2xpbmVfcCwKK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6ICBDSEFSX0dMWVBIIHwg R0xZUEhMRVNTX0dMWVBIICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworICAgIGNhc2UgSE9SSVpPTlRBTF9SVUxFUjoKKyAgICB7CisgICAgICBpZiAocmVsYXRpdmVf eCA8IHJvdy0+cGl4ZWxfd2lkdGgKKyAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQor ICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngs IHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlw ZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAg ICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwg ZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7 CisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFth cmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsK KyAgICAgICAgICBpZiAocmVsYXRpdmVfeCA8IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAg ICAgICAgICAgICBmeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAg ICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5 LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgIHhfbGltaXQgLSByZWxhdGl2 ZV94LCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sCisgICAgICAg ICAgICAgICAgICAgICBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9w LCBNQ19HTFlQSExFU1MsCisgICAgICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUs IGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAg fQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JV TEVSOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICAgKi8KKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6CisgICAgewor ICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9mcmluZ2VfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGludWVkX3Ap CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFS X0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29y X2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAh cm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9X CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2Zy aW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRy dW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FS RUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ct PnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNl ZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9w b2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBN Q19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hU X0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FM X0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNB TF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FM X0JBUgorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9C QVIpCisgICAgICAgIGN1cnNvcl90eXBlID0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUDsKKyAgICAg IHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2 ZV94LCBvcG9pbnRfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3ZCwg aCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBmb3JlZ3JvdW5kLAor ICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBnbHlwaF9m bGF2b3IsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSwg YWN0aW9uX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t ICovCisvKiAgICAgICAgICAgICAgIEZJTExfQ09MVU1OOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVT U19HTFlQSCAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAg IGNhc2UgRklMTF9DT0xVTU46CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxh dm9yID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0g LSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5m Y194ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoIU5J TFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGlj YWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3Bv aW50X3kgPT0geQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3Bv aW50X3Zwb3MgPT0gdnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNf R0xZUEg7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBn bHlwaCwgcmVsYXRpdmVfeCwgZmNfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAg ICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBmb3Jl Z3JvdW5kLAorICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9w LCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgY2Fj aGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisgICAgY2FzZSBDVVJTT1JfSU5ESUNBVE9SOgorICAgIHsKKyAgICAgIGJy ZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICB9CisgIH0KKy8qIC0tLS0t LS0tLS0tLS0t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AgKEJVRkZFUlAgKGdseXBo LT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9i amVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2Jq ZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAg ICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ZmFj ZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJp Z2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6 ICItLSIsCisgICAgICAgICJcXFMiKTsKKyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAgeworLyog LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExF X0NVUlNPUlM6ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgTVVMVElQTEVfQ1VSU09SUzoKKyAgICB7CisgICAg ICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5 LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNv cl93aWR0aCwgcm93X3Bvc2l0aW9uL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 cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJlbGF0 aXZlX3ggPD0geF9saW1pdCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChyZWxhdGl2ZV94IDwg cm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVs X3dpZHRoOworICAgICAgICAgIHRlbXBfZmFjZV9pZCA9IChyb3ctPmZpbGxfbGluZV9wKQorICAg ICAgICAgICAgICAgICAgICAgICAgID8gZ2x5cGgtPmZhY2VfaWQKKyAgICAgICAgICAgICAgICAg ICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGJhY2tn cm91bmQ7CisgICAgICAgICAgbWNfc2V0X2xzbF9iZyAodywgdGVtcF9mYWNlX2lkLCAmYmFja2dy b3VuZCk7CisgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0 aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgIHhfbGlt aXQgLSByZWxhdGl2ZV94LCBoLCBjdXJzb3JfdHlwZSwgeF9saW1pdCAtIHJlbGF0aXZlX3gsCisg ICAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsIGJhY2tncm91bmQs IGVzc2VudGlhbHMuYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICBNQ19HTFlQSExFU1Ms IGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgICB9 CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAg ICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIFNUUkVUQ0hfR0xZUEggICAgICAg ICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJU SUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBpZiAocm93LT5maWxsX2xpbmVfcAorICAgICAgICAg ICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAx CisgICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRo KQorICAgICAgICB0ZW1wX2ZhY2VfaWQgPSBnbHlwaC0+ZmFjZV9pZDsKKyAgICAgICAgZWxzZSBp ZiAoIXJvdy0+ZmlsbF9saW5lX3AKKyAgICAgICAgICAgICAgICAgJiYgZ2x5cGggLSByb3ctPmds eXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAg JiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAg IHRlbXBfZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgIHN0cnVjdCBtY19SR0IgYmFj a2dyb3VuZDsKKyAgICAgIG1jX3NldF9sc2xfYmcgKHcsIHRlbXBfZmFjZV9pZCwgJmJhY2tncm91 bmQpOworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9mcmlu Z2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGlu dWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElD QUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo Y3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hU X0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5 b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBy b3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNlZFtU RVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm ICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSExFU1M7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9y ID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBn bHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGds eXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3Ig PT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IE1DX1JJ R0hUX0ZSSU5HRV9CSVRNQVA7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1h dHJpeCwgcm93LCBnbHlwaCwgb3BvaW50X3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3MsIHZwb3Ms CisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3df cG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2Vu dGlhbHMuYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAg ICAgICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9 CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAg RklMTF9DT0xVTU46ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAqLworLyog LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7CisgICAg ICBpZiAocm93LT5maWxsX2xpbmVfcAorICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgZXNzZW50aWFs cy5mY194ID4gcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgdGVtcF9m YWNlX2lkID0gZ2x5cGgtPmZhY2VfaWQ7CisgICAgICAgIGVsc2UgaWYgKCFyb3ctPmZpbGxfbGlu ZV9wCisgICAgICAgICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9 PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNf eCA+IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgdGVtcF9mYWNl X2lkID0gREVGQVVMVF9GQUNFX0lEOworICAgICAgc3RydWN0IG1jX1JHQiBiYWNrZ3JvdW5kOwor ICAgICAgbWNfc2V0X2xzbF9iZyAodywgdGVtcF9mYWNlX2lkLCAmYmFja2dyb3VuZCk7CisgICAg ICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBNQ19HTFlQSExFU1M7CisgICAgICB3ZCA9 IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwa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LS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgQkVHSU46ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyog LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tICovCisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IElNQUdFX0dM WVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgZnByaW50ZiAoc3RkZXJyLAor ICAgICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNnggJTRk ICUxLjFkJTEuMWQgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVz ZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ0knLAorICAgICAg ICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAg ICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAg ICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4 ZWxfd2lkdGgsCisgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmltZ19pZCwKKyAgICAg ICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAg ICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhf enZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicpOworICBzd2l0Y2ggKGFjdGlvbl90eXBl KQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAg ICAgIE1VTFRJUExFX0NVUlNPUlM6ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAq LworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgor ICAgIHsKKyAgICAgIGN1cnNvcl90eXBlID0gTUNfSE9MTE9XX0JPWDsKKyAgICAgIG1jX2hlbHBl ciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZw b3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBy b3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVz c2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAg ICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0K Ky8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAg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IHsKKyAgICAgIGN1cnNvcl90eXBlID0gTUNfSE9M TE9XX0JPWDsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2 ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJz b3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAg ICAgICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3 X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBl KTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAg ICAgICAgICAgICAgICAgICAgICAgICAgRklMTF9DT0xVTU46ICBJTUFHRV9HTFlQSCAgICAgICAg ICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEZJ TExfQ09MVU1OOgorICAgIHsKKyAgICAgIGN1cnNvcl90eXBlID0gTUNfSE9MTE9XX0JPWDsKKyAg ICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwg ZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vy c29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJh Y2tncm91bmQsIGV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LS0tLS0tLS0tLS0tLS0tLS0g Ki8KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICB7CisgICAg aWYgKG1jX3N0ZGVycl9wKQorICAgICAgeworICAgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAg ICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4IiwKKyAg ICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgKChyb3ct PnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgICAg cmVsYXRpdmVfeCwKKyAgICAgICAgICAnKycsCisgICAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisg ICAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgID8gJ0InCisgICAg ICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgID8gJ1MnCisg ICAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICAgID8g JzAnCisgICAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICAgIGdseXBoLT5waXhlbF93 aWR0aCwKKyAgICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5jbXAuaWQpOworICAgICAg ICBmcHJpbnRmIChzdGRlcnIsICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAgICAgIGdseXBoLT5m YWNlX2lkLAorICAgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgICAgZ2x5 cGgtPnJpZ2h0X2JveF9saW5lX3ApOworICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMp CisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgJTNkICVzIC4gWyVkLSVkXVxuIiwKKyAgICAg ICAgICAgICAgICAgICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0i LAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgt PnNsaWNlLmNtcC50byk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIs ICJcbiIpOworICAgICAgfQorICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JT OiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgorICAgIHsKKyAgICAgIG1jX2hl bHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRo LCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQs IGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAg ICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAg IH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgIEhP UklaT05UQUxfUlVMRVI6ICBDT01QT1NJVEVfR0xZUEggICAgICAgICAgICAgICAgICAgICovCisv KiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAg eworICAgICAgaWYgKHJlbGF0aXZlX3ggPD0geF9saW1pdAorICAgICAgICAgICYmICFyZWFsX2Zh a2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCBy ZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2Qs IGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3VuZCwK KyAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19H TFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUs IGFjdGlvbl90eXBlKTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0g PT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJlbGF0aXZlX3ggPD0geF9saW1p dCkKKyAgICAgICAgeworICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRo OworICAgICAgICAgIHdoaWxlIChyZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgICAgICB7 CisgICAgICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2 ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgd2Qs IGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3VuZCwK KyAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9w LCBNQ19HTFlQSExFU1MsIGRyYXdfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tX3do ZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3gg Kz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgYnJl YWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAg ICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAgICAg ICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6 CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9m 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 ICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09 IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxf QkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VE X1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBN Q19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1D X1ZFUlRJQ0FMX0JBUgorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9W RVJUSUNBTF9CQVIpCisgICAgICAgIGN1cnNvcl90eXBlID0gTUNfUklHSFRfRlJJTkdFX0JJVE1B UDsKKyAgICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBo LCByZWxhdGl2ZV94LCBvcG9pbnRfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAg ICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBmb3Jl Z3JvdW5kLAorICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9w LCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgY2Fj aGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgRklMTF9DT0xVTU46ICBD T01QT1NJVEVfR0xZUEggICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworICAgIGNhc2UgRklMTF9DT0xVTU46CisgICAgeworICAgICAgZW51bSBtY19mbGF2 b3IgZ2x5cGhfZmxhdm9yID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ct PnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg ZXNzZW50aWFscy5mY194ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92 ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBNQ19HTFlQSDsKKyAgICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCBy b3csIGdseXBoLCByZWxhdGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAg ICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24s IGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0 aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAg ICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIENVUlNPUl9JTkRJQ0FUT1I6CisgICAgeworICAg ICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIH0KKyAgfQorLyog LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVO RDogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLSAqLworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBCRUdJTjogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAgICAg ICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIGVsc2UgaWYgKGdseXBo LT50eXBlID09IFhXSURHRVRfR0xZUEgpCisgIHsKKyNpZm5kZWYgSEFWRV9YV0lER0VUUworICAg IGVhc3N1bWUgKGZhbHNlKTsKKyNlbHNlCisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgZnBy aW50ZiAoc3RkZXJyLAorICAgICAgICAiXG4gICU1ZC8lLTVkICU1ZCAlNGMgJTZkICVjICUzZCAw eCUwNXggJTRkICUxLjFkJTEuMWQgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ct PmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAg OiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1gn LAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmpl Y3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkK KyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6ICctJykpLAorICAgICAgICBnbHlwaC0+ cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVm dF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAg Z2x5cGgtPnUueHdpZGdldCwKKyAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2X3AgPyAiWlYi IDogIi0tIiwKKyAgICAgICAgJy4nKTsKKyNlbmRpZgorICBzd2l0Y2ggKGFjdGlvbl90eXBlKQor ICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAg TVVMVElQTEVfQ1VSU09SUzogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLwor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgorICAg IHsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBm eCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlw ZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAg ICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZy b21fd2hlcmUsCisgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAg ICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAg ICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSOiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAg ICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05U QUxfUlVMRVI6CisgICAgeworICAgICAgaWYgKHJlbGF0aXZlX3ggPD0geF9saW1pdAorICAgICAg ICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4 LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAg ICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlv biwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxz LmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAg ICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJlbGF0 aXZlX3ggPD0geF9saW1pdCkKKyAgICAgICAgeworICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5 cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgIHdoaWxlIChyZWxhdGl2ZV94IDw9IHhfbGltaXQp CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3cs IGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAg ICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlv biwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3Nl bnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSExFU1MsIGRyYXdfcCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICBmcm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAgICAg ICAgIHJlbGF0aXZlX3ggKz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgfQorICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAg ICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVI6ICBYV0lER0VUX0dMWVBIICAg ICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2Ug VkVSVElDQUxfUlVMRVI6CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9y ID0gKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVk X29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNf VkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdI VF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2Jl eW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg Y3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3Ig PT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9y ID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGds eXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgfHwgZ2x5 cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9 PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgIGN1cnNvcl90eXBlID0gTUNfUklH SFRfRlJJTkdFX0JJVE1BUDsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBo LCByZWxhdGl2ZV94LCBvcG9pbnRfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAg ICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBmb3Jl Z3JvdW5kLAorICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9w LCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgY2Fj aGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgIEZJTExfQ09MVU1OOiAg WFdJREdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworICAgIGNhc2UgRklMTF9DT0xVTU46CisgICAgeworICAgICAgZW51bSBtY19mbGF2 b3IgZ2x5cGhfZmxhdm9yID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ct PnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg ZXNzZW50aWFscy5mY194ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92 ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBNQ19HTFlQSDsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxh dGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBo LCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisg ICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIGdseXBoX2Zs YXZvciwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICBjYWNoZV90eXBlLCBh Y3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS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oICh3LCBURVhUX0FSRUEpOworICBpbnQgaGVhZGVyX2xpbmVfZm9ybWF0 ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgIHN0cnVjdCBnbHlwaF9yb3cgKmN1 cnNvcl9yb3cgPSAody0+Y3Vyc29yLnZwb3MgIT0gLTEpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IE1BVFJJWF9ST1cgKGN1cnNvcl9tYXRyaXgsIHctPmN1cnNvci52cG9zKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICBzdHJ1Y3QgZ2x5cGgg KmN1cnNvcl9nbHlwaCA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGN1cnNvcl9tYXRyaXgsIGN1 cnNvcl9yb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiBOVUxMOworICBib29sIGN1cnNvcl9hdF9mcmluZ2VfcCA9IChjdXJz b3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jf cm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhw b3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIGN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gdGV4dF9hcmVhX3dpZHRoCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IGN1cnNvcl9yb3ct PnBpeGVsX3dpZHRoKTsKKyAgYm9vbCBjdXJzb3JfYmV5b25kX2ZyaW5nZV9wID0gKGN1cnNvcl9n bHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jf cm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNv ci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIWN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHRleHRf YXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29y LnggPj0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq CisgICAgICAgICAgICAgICAgICAgICAgICAgIFJFUExBQ0UgVEhFIFJFQUwgQ1VSU09SCisqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKyAgZW51bSBmYWNlX2lkIGJnX2ZhY2VfaWQgPSAoY3Vyc29y X2dseXBoICE9IE5VTEwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBjdXJzb3JfZ2x5 cGgtPmZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9J RDsKKyAgc3RydWN0IG1jX1JHQiBjdXJzb3JfYmc7CisgIG1jX3NldF9sc2xfYmcgKHcsIGJnX2Zh Y2VfaWQsICZjdXJzb3JfYmcpOworICAvKiBGSVhNRTogIFB1dCBpbiBzb21lIGNvZGUgdG8gZGVm YXVsdCB0byBNQ19IT0xMT1dfQk9YIGlmIHRoZSB1c2VyIGhhcworICB1bndpdHRpbmdseSBjb21l IHVwIHdpdGggc29tZSB1bmFjY2VwdGFibGUgZm9ybSBvZiB1bnJlY29nbml6ZWQgY3Vyc29yIHR5 cGUuICovCisgIExpc3BfT2JqZWN0IGxpc3BfdHlwZSA9IEJWQVIgKGIsIG1jX3JlYWxfZmFrZV9j dXJzb3IpOworICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID0gKENPTlNQIChsaXNw X3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNwX3Rv X2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOworICBpbnQg Y3Vyc29yX3dpZHRoID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAg PyBYRklYTlVNIChYQ0FSIChYQ0RSIChsaXNwX3R5cGUpKSkKKyAgICAgICAgICAgICAgICAgICAg IDogLTE7CisgIHN0cnVjdCBtY19SR0IgY3Vyc29yX2ZnOworICBtY19jb2xvcl9waWNrZXIgKHcs IGN1cnNvcl9nbHlwaCwgZXNzZW50aWFscywgJmN1cnNvcl9mZywgLTEsIGN1cnNvcl90eXBlLAor ICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgQ1VSU09SX0lORElDQVRPUik7CisgIGJv b2wgZmlsbF9jb2x1bW5fdHJ1bXBzX3AgPSAoIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1 bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwg ZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29y LnggPT0gZXNzZW50aWFscy5mY194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg IWN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFj dXJzb3JfYmV5b25kX2ZyaW5nZV9wKTsKKyAgLyogV2UgdXNlIGEgdGVzdCBzaW1pbGFyIHRvIHRo ZSByZWFsIGZha2UgY3Vyc29yIHNvIHRoYXQgdGhlIGZyaW5nZSBiaXRtYXAgaXMKKyAgb25seSBk cmF3biBvbmNlIHBlciB3aW5kb3cuICovCisgIGlmICh2cG9zID09IHctPmN1cnNvci52cG9zCisg ICAgICAmJiBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGggPT0gcm93LT51c2VkW1RFWFRfQVJFQV0K KyAgICAgICYmICFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmICFOSUxQIChC VkFSIChiLCBjaF9ob3Jpem9udGFsX3J1bGVyKSkpCisgICAgeworICAgICAgLyogZnJpbmdlIGJp dG1hcHMgdXNlIGZhY2VfaWQgdG8gc2V0IHRoZSBmb3JlZ3JvdW5kIGNvbG9yLiAgVGhlIG92ZXJs YXktYXJyb3cKKyAgICAgIGlzIHByZXNlbnRseSB0aGUgb25seSBzaXR1YXRpb24gd2hlcmUgdGhl IGBlc3NlbnRpYWxzLmFjdGl2ZV9wYCBhbmQgYG1pbmltYWxfcGAgYXJlCisgICAgICB1c2VkIHRv IGRldGVybWluZSB0aGUgYXBwbGljYWJsZSBmYWNlX2lkLiAqLworICAgICAgc3RydWN0IG1jX1JH QiBsc2xfZmcgPSB7LnJlZCA9IC0xLjAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAu Z3JlZW4gPSAtMS4wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgP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OworICAgICAgLyogR2x5cGggZm9yIGEgbGluZSBlbmQg aW4gdGV4dC4gKi8KKyAgICAgIGlmIChnbHlwaCA9PSBnbHlwaF9lbmQgJiYgZ2x5cGgtPmNoYXJw b3MgPiAwKQorICAgICAgICArK2dseXBoX2VuZDsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4 LCByb3csIGdseXBoX2VuZCAtIDEsIHctPmN1cnNvci54LCAtMSwgdy0+Y3Vyc29yLnksIC0xLAor ICAgICAgICAgICAgICAgICB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsIC0xLCAtMSwg TUNfUklHSFRfRlJJTkdFX0JJVE1BUCwKKyAgICAgICAgICAgICAgICAgLTEsIHJvd19wb3NpdGlv biwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsCisgICAgICAgICAg ICAgICAgIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLCBDSF9DQUNIRSwgQ1VSU09S X0lORElDQVRPUik7CisgICAgfQorICAvKiBDdXJzb3IgaXMgYmV5b25kIHRoZSByaWdodCBmcmlu Z2U7IGUuZy4sIHdoZW4gcmlnaHQgaG9yaXpvbnRhbCBzY3JvbGxpbmcuICovCisgIGVsc2UgaWYg KGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3Iu dnBvcworICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAg ICAgICYmIChocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgpID09IHJvdy0+dXNlZFtURVhUX0FSRUFd CisgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAg JiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hvcml6b250YWxfcnVsZXIpKSkKKyAgICB7CisgICAgICBl bnVtIG1jX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dHlwZSA9PSBNQ19OT19DVVJTT1IK KyAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAmJiB3LT5j dXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zIDwg aHBvc19zdGFydCArIGhwb3NfbGVuZ3RoKQorICAgIHsKKyAgICAgIC8qIFdoZW4gYSB1c2VyIGhh cyBub3Qgc3BlY2lmaWVkIGEgdmFsdWUgZm9yIGBtYy1yZWFsLWZha2UtY3Vyc29yJywgb3IgdGhl CisgICAgICB2YWx1ZSBpcyBgbm9gIGluIHRoZSBmb3JtIG9mIGEgc3ltYm9sIG9yIHN0cmluZywg dGhlbiB0aGUgZGVmYXVsdCB3ZSB1c2UKKyAgICAgIGFuIE1DX0JBUiBhbmQgYW4gTUNfSEJBUiAt LSBib3RoIGhhdmluZyBhIGN1cnNvcl93aWR0aCBvZiAxLiAqLworICAgICAgbWNfZ2V0X2N1cnNv cl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50X2Z4LCB3LT5j dXJzb3IueSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRfZnksIHctPmN1 cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgTUNfQkFSLCAxLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywg bWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vy c29yLnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1 cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBNQ19CQVIs IDEsIHJvd19wb3NpdGlvbiwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0aXZl X3AsCisgICAgICAgICAgICAgICAgIE1DX0dMWVBITEVTUywgZHJhd19wLCBmcm9tX3doZXJlLCBO SUxQIChCVkFSIChiLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOwor ICAgICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54 LCAmb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICZvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUNfSEJBUiwgMSwgJm9wb2ludF93ZCk7Cisg ICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54 LCBvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHct PmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAg ICAgICAgICAgICAgTUNfSEJBUiwgMSwgcm93X3Bvc2l0aW9uLCBjdXJzb3JfZmcsIGN1cnNvcl9i ZywgZXNzZW50aWFscy5hY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgTUNfR0xZUEgsIGRyYXdf cCwgZnJvbV93aGVyZSwgTklMUCAoQlZBUiAoYiwgbWNfY29uZikpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElD QVRPUik7CisgICAgfQorICBlbHNlIGlmICghY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAg ICYmIGN1cnNvcl9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29y LnZwb3MKKyAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPj0gaHBvc19zdGFydAorICAgICAg ICAgICAmJiB3LT5jdXJzb3IuaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAg ICAgICAmJiBjdXJzb3JfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAg ICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZv cG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9w b2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAmb3Bv aW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwg dy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIG9w b2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2lu dF9oLAorICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9z aXRpb24sIGN1cnNvcl9mZywgY3Vyc29yX2JnLAorICAgICAgICAgICAgICAgICBlc3NlbnRpYWxz LmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAg ICBOSUxQIChCVkFSIChiLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQor ICAgICAgICAgICAgICAgICA6IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgICB9Cisg IGVsc2UgaWYgKCFjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgJiYgY3Vyc29yX2dseXBo ICE9IE5VTEwKKyAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAg ICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICYmIHctPmN1cnNv ci5ocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICYmIGN1cnNvcl9n bHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICAgIHsKKyAgICAgIC8qIElmIGEgdXNlciBo YXMgc2V0IGB4LXN0cmV0Y2gtY3Vyc29yJyB0byBhIG5vbi1uaWwgdmFsdWUsIGhlL3NoZSBjaG9z ZSB0bworICAgICAgaGF2ZSBhIGN1cnNvciB0aGF0IHNwYW5zIHRoZSBlbnRpcmUgbGVuZ3RoIG9m IHRoZSBTVFJFVENIX0dMWVBILiAqLworICAgICAgaWYgKCF4X3N0cmV0Y2hfY3Vyc29yX3ApCisg ICAgICAgIHsKKyAgICAgICAgICAvKiBUaGUgTUNfSEJBUiBzaGFsbCBoYXZlIGEgYGN1cnNvcl93 aWR0aGAgb2YgMS4gKi8KKyAgICAgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRy aXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgdy0+Y3Vyc29yLnksICZvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gs IE1DX0hCQVIsIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF93 ZCk7CisgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3 LT5jdXJzb3IueCwgb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnks IG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLAorICAgICAgICAgICAg ICAgICAgICAgb3BvaW50X3dkLCBvcG9pbnRfaCwgTUNfSEJBUiwgMSwgcm93X3Bvc2l0aW9uLCBj dXJzb3JfZmcsCisgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0 aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgICAg ICBOSUxQIChCVkFSIChiLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FD SEUKKyAgICAgICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOwor ICAgICAgICB9CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywg dy0+Y3Vyc29yLngsICZvcG9pbnRfZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3 LT5jdXJzb3IueSwgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLCBjdXJzb3JfdHlwZSwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgJm9wb2ludF93ZCk7Cisg ICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54 LCBvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHct PmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAg ICAgICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBjdXJz b3JfZmcsIGN1cnNvcl9iZywKKyAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwg TUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgTklMUCAoQlZB UiAoYiwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAg ICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQorLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgIERSQVcgQU5EIFJFQ09SRCBG QUtFIENVUlNPUlMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBpZiAoIWVzc2VudGlhbHMu YWN0aXZlX3AKKyAgICAgICYmIE5JTFAgKEJWQVIgKGIsIG1jX2luYWN0aXZlX3dpbmRvd3MpKQor ICAgICAgJiYgTklMUCAoQlZBUiAoYiwgY2hfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAmJiBO SUxQIChCVkFSIChiLCBmY19pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAgcmV0dXJuOworICBpZiAo aHBvc19sZW5ndGggPT0gMSkKKyAgICB7CisgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIsIG1jX2Nv bmYpKQorICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgIHx8 ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIg KGIsIG1jX2luYWN0aXZlX3dpbmRvd3MpKSkpKQorICAgICAgICB7CisgICAgICAgICAgLyogVGhl IHNwYWNlIGFwcGVuZGVkIHRvIGEgcm93IGVuZGluZyB3aXRoIGEgbmV3IGxpbmUKKyAgICAgICAg ICBkb2VzIG5vdCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDApIHRoYXQgd2UgY2FuCisg ICAgICAgICAgdXNlIGZvciB0aGlzIHBhcnRpY3VsYXIgYXBwbGljYXRpb24uICBXaGVuIHRoZXJl IGlzIGEKKyAgICAgICAgICBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5IHRoYXQgYXNzaWdu cyBhIHZpc2libGUKKyAgICAgICAgICBnbHlwaCB0byBhIG5ldyBsaW5lLCB0aGVyZSBpcyBubyBw cm9ibGVtIGJlY2F1c2UgdGhhdAorICAgICAgICAgIGdseXBoIGhhcyBhIGBnbHlwaC0+Y2hhcnBv cycgdGhhdCB3ZSBjYW4gdXNlLiAgV2hlbgorICAgICAgICAgIG5vIHZpc2libGUgRU9MIGdseXBo IGV4aXN0cywgd2UgdXNlIHRoZSBmb2xsb3dpbmcKKyAgICAgICAgICB0ZXN0OiAgdGhlIGFwcGVu ZGVkIHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMgb25lCisgICAgICAgICAgbGVzcyB0aGFu IHRoZSBlbmQgb2YgdGhlIG1hdHJpeCByb3cuICovCisgICAgICAgICAgaW50IGhwb3MgPSBzdGFy dCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgc3RydWN0IGdseXBoICpwcmV2 aW91c19nbHlwaCA9ICgwIDw9IGhwb3MgLSAxICYmIGhwb3MgLSAxIDwgcm93LT51c2VkW1RFWFRf QVJFQV0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gcm93LT5n bHlwaHNbVEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogTlVMTDsKKyAgICAgICAgICAvLyBzdHJ1Y3QgZ2x5cGggKmxhc3RfZ2x5 cGggPSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOwor ICAgICAgICAgIGJvb2wgc2tpcF9wID0gKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9PSBNQVRSSVhfUk9X X0VORF9DSEFSUE9TIChyb3cpIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICYmIHN0YXJ0 LT5ieXRlcG9zICE9IGVzc2VudGlhbHMuenZfYnl0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAvKiBXaGVuIGEgYGJ1ZmZlci1kaXNw bGF5LXRhYmxlJyBlbnRyeSBjb250YWlucworICAgICAgICAgICAgICAgICAgICAgICAgYSB2aXNp YmxlIHRhYiBjaGFyYWN0ZXIgKCLCuyIpLCB0aGUgc3Vic2VxdWVudAorICAgICAgICAgICAgICAg ICAgICAgICAgU1RSRVRDSF9HTFlQSCB3aWxsIGhhdmUgdGhlIHNhbWUgc3RhcnQtPmNoYXJwb3MK KyAgICAgICAgICAgICAgICAgICAgICAgIGFzIHRoZSBhZm9yZW1lbnRpb25lZCB2aXNpYmxlIHRh YiBjaGFyYWN0ZXIuICovCisgICAgICAgICAgICAgICAgICAgICAgICA6IChwcmV2aW91c19nbHlw aCAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+ Y2hhcnBvcyA9PSBzdGFydC0+Y2hhcnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0 cnVlCisgICAgICAgICAgICAgICAgICAgICAgICA6IGZhbHNlOworICAgICAgICAgIGludCBwb3Np bnQgPSAocm93X3Bvc2l0aW9uID09IFBPU1RfWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAg PyAtMQorICAgICAgICAgICAgICAgICAgICAgICA6IChyb3dfcG9zaXRpb24gPT0gQVRfWlYpCisg ICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNzZW50aWFscy56dgorICAgICAgICAgICAgICAg ICAgICAgICA6IChzdGFydC0+Ynl0ZXBvcyAhPSBlc3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJv dy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJ WF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgLSAxCisgICAgICAgICAgICAgICAgICAgICAgIDogKHN0 YXJ0LT5ieXRlcG9zID09IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRf QVJFQV0gLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNzZW50aWFscy56dgorICAg ICAgICAgICAgICAgICAgICAgICA6IHN0YXJ0LT5jaGFycG9zOworICAgICAgICAgIExpc3BfT2Jq ZWN0IHNwZWNzID0gbWNfYXNzb2MgKG1ha2VfZml4bnVtIChwb3NpbnQpLCBCVkFSIChiLCBtY19j b25mKSk7CisgICAgICAgICAgaWYgKCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4g MCkKKyAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAg ICAgICAmJiAhTklMUCAoc3BlY3MpCisgICAgICAgICAgICAgICYmIHJvdy0+eSA8PSB3aW5kb3df dGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgJiYgIXNraXBfcAorICAgICAgICAgICAg ICAmJiByb3dfcG9zaXRpb24gIT0gUE9TVF9aVikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgTGlzcF9PYmplY3QgbGlzcF90eXBlID0gbWNfbnRoICgxLCBzcGVjcyk7CisgICAgICAgICAg ICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUgPSAoQ09OU1AgKGxpc3BfdHlwZSkp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG1jX2xp c3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGxp c3BfdHlwZSk7CisgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gKHN0YXJ0LT50eXBlID09IElN QUdFX0dMWVBIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX0JPWAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogY3Vyc29yX3R5cGU7CisgICAgICAgICAgICAg IGludCBjdXJzb3Jfd2lkdGggPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IFhGSVhOVU0gKFhDQVIgKFhDRFIgKGxpc3BfdHlwZSkpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAtMTsKKyAgICAgICAgICAgICAgTGlzcF9P YmplY3QgbWNfZm9yZWdyb3VuZCA9IG1jX250aCAoMiwgc3BlY3MpOworICAgICAgICAgICAgICBz dHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICAgICAgaWYgKFNUUklOR1AgKG1jX2ZvcmVn cm91bmQpKQorICAgICAgICAgICAgICAgIG1jX3h3X2NvbG9yX3ZhbHVlcyAodywgbWNfZm9yZWdy b3VuZCwgJmxzbF9mZyk7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoVkVDVE9SUCAobWNfZm9y ZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGxzbF9m Zy5yZWQgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMCkpOworICAgICAgICAg ICAgICAgICAgICBsc2xfZmcuZ3JlZW4gPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3Vu ZCwgMSkpOworICAgICAgICAgICAgICAgICAgICBsc2xfZmcuYmx1ZSA9IFhGTE9BVF9EQVRBIChB UkVGIChtY19mb3JlZ3JvdW5kLCAyKSk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgICAgICBlbHNlIGlmIChOSUxQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAgICAg ICAgbWNfY29sb3JfcGlja2VyICh3LCBzdGFydCwgZXNzZW50aWFscywgJmxzbF9mZywgcG9zaW50 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCByb3df cG9zaXRpb24sIE1VTFRJUExFX0NVUlNPUlMpOworICAgICAgICAgICAgICBpbnQgdnBvcyA9IE1B VFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAgICAgICBpbnQgeF9saW1pdCA9 IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICAgIG1jX2VuZ2lu ZSAodywgbWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwK KyAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0s IHZwb3MsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0 aCwgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLAorICAgICAgICAgICAg ICAgICAgICAgICAgIGxzbF9mZywgTVVMVElQTEVfQ1VSU09SUywgZHJhd19wLCBmcm9tX3doZXJl LCBNQ19DQUNIRSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlmICghTklMUCAo QlZBUiAoYiwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AK KyAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAg ICAmJiAhTklMUCAoQlZBUiAoYiwgZmNfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAv LyAmJiBlc3NlbnRpYWxzLmZjX3ggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgJiYgZXNz ZW50aWFscy5mY194IDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgJiYgZXNzZW50aWFscy5m Y194ID49IHctPm1jLmxudW1fcGl4ZWxfd2lkdGgpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQg eF9saW1pdCA9IHggKyBzdGFydC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgYm9vbCByZWFsX2Zh a2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnggPT0gZXNzZW50aWFscy5mY194CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnkgPT0gcm93LT55CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gc3Rh cnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLnZwb3MgPT0gdnBvcyk7CisgICAgICAgICAgc3RydWN0IG1j X1JHQiBsc2xfZmc7CisgICAgICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBzdGFydCwgZXNzZW50 aWFscywgJmxzbF9mZywgLTEsIE1DX0JBUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHJv d19wb3NpdGlvbiwgRklMTF9DT0xVTU4pOworICAgICAgICAgIGlmICh4IDwgdGV4dF9hcmVhX3dp ZHRoCisgICAgICAgICAgICAgIC8vIHggKyBzdGFydC0+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 bmRvd3MpKSkpCisgICAgICAgICAgICAgICAgICAgIC8vICYmIGVzc2VudGlhbHMuZmNfeCA8PSB0 ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194IDwg dGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+ PSB3LT5tYy5sbnVtX3BpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7 CisgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNv ci54ID09IGVzc2VudGlhbHMuZmNfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gZ2x5cGgg LSByb3ctPmdseXBoc1tURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgICAg ICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAg ICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAg IG1jX2NvbG9yX3BpY2tlciAodywgZ2x5cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19C QVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBG SUxMX0NPTFVNTik7CisgICAgICAgICAgICAgICAgICAgIGlmIChocG9zID49IGhwb3Nfc3RhcnQK KyAgICAgICAgICAgICAgICAgICAgICAgICYmIGhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5n dGgKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vICYmIHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4 ZWxfd2lkdGggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBy ZWxhdGl2ZV94IDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAo KGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICAgICAg ICAgICAmJiAoKGdseXBoICE9IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194IDwgcmVsYXRpdmVfeCArIGdseXBoLT5waXhl bF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoZ2x5cGggPT0gZ2x5cGhf ZW5kIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZj X3ggPj0gcmVsYXRpdmVfeCkpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnkgPD0g d2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcmVh bF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0 cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBNQ19CQVIsIDEsIGN1cnNv cl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLCBy b3dfcG9zaXRpb24sIGxzbF9mZywgRklMTF9DT0xVTU4sCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIEZDX0NBQ0hFKTsKKyAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQor ICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaG9yaXpvbnRhbF9ydWxl cikpCisgICAgICAgICAgICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaW5hY3RpdmVfd2luZG93cykpKSkK KyAgICAgICAgICAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaW50IHhfbGltaXQgPSB3aW5kb3dfYm94 X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGds eXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0 IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywg Z2x5cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19IQkFSLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgSE9SSVpPTlRBTF9SVUxFUik7Cisg ICAgICAgICAgICAgICAgICAgIC8qIFByZXNlcnZlIHN1cHBvcnQgZm9yIGRlZmF1bHQgYmVoYXZp b3Igc3VjaCB0aGF0IGEgdXNlciBtYXkKKyAgICAgICAgICAgICAgICAgICAgc3BlY2lmeSB0aGUg aGVpZ2h0IG9mIGFuIE1DX0hCQVIsIHdoaWNoIGJlZ2lucyBpdHMgam91cm5leQorICAgICAgICAg ICAgICAgICAgICBhcyB0aGUgYGN1cnNvcl93aWR0aCcuICBgbWNfZ2V0X2N1cnNvcl9nZW9tZXRy eScgcmVhZGp1c3RzLiAqLworICAgICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBocG9zX3N0 YXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFydCArIGhwb3Nf bGVuZ3RoKQorICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3cs IGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBNQ19IQkFSLCAxLCBjdXJzb3JfbWF0cml4 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywgcm93X3Bvc2l0 aW9uLCBsc2xfZmcsIEhPUklaT05UQUxfUlVMRVIsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAg ICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQor ICAgICAgICAgICAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAg ICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAg ICAgICAgICAgICAgICAgICYmICFmaWxsX2NvbHVtbl90cnVtcHNfcCkKKyAgICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSAoZ2x5cGgtPnR5cGUgPT0g SU1BR0VfR0xZUEgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19IT0xM T1dfQk9YCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19CQVI7CisgICAg ICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9B UkVBKTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+ Y3Vyc29yLnkgPT0gcm93LT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgICAgICAgICAg ICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAg ICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAgIG1jX2Nv bG9yX3BpY2tlciAodywgZ2x5cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBjdXJzb3JfdHlw ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRpb24sIFZF UlRJQ0FMX1JVTEVSKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGhwb3MgPj0gaHBvc19zdGFy dAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xl bmd0aAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChoZWFkZXJfbGluZV9mb3JtYXQgPiAw ICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5l X2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChnbHlwaCAhPSBnbHlw aF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49 IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLngg PCByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHx8IChnbHlwaCA9PSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHJlbGF0aXZlX3gpKQorICAgICAgICAgICAgICAg ICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgICAgICAg ICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwg eF9saW1pdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdy0+eSwgaHBvcywg dnBvcywgY3Vyc29yX3R5cGUsIDEsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywgVkVSVElDQUxf UlVMRVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hl cmUsIENIX0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZWxh dGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAg IH0KKyAgICAgIH0KKyAgLy8gIGNsb2NrX3QgY2xvY2tfZW5kID0gY2xvY2soKTsKKyAgLy8gIGRv dWJsZSBjcHVfdGltZV91c2VkID0gKChkb3VibGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkp IC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8vICBmcHJpbnRmIChzdGRlcnIsICJtY19kcmF3X3JvdyAo JXMpOiAgVElNRSAoJWYpXG4iLCBtY193aW5kb3cgKHcpLCBjcHVfdGltZV91c2VkKTsKK30KKwor Ym9vbAorbWNfcmVkcmF3X3JvdyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJp eCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICBlbnVtIGds eXBoX3Jvd19hcmVhIGFyZWEsIGludCBzdGFydF94LCBpbnQgc3RhcnRfaHBvcywgaW50IGVuZF9o cG9zLAorICAgICAgICAgICAgICAgYm9vbCBjbGVhcl9lb2xfcCwgZW51bSBkcmF3X2dseXBoc19m YWNlIGhsLAorICAgICAgICAgICAgICAgZW51bSBtY19yZWRyYXdfcm93X3R5cGUgZnJvbV93aGVy ZSkKK3sKKyAgYm9vbCBnb19wID0gKCh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hF XSA+IDAKKyAgICAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NB Q0hFXSA+IDAKKyAgICAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0ZD X0NBQ0hFXSA+IDApCisgICAgICAgICAgICAgICAmJiBhcmVhID09IFRFWFRfQVJFQQorICAgICAg ICAgICAgICAgJiYgcm93LT51c2VkW2FyZWFdKTs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oZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgY2FjaGVf dHlwZSA8IE5PX0NBQ0hFOworICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICB7CisgICAgICBmb3Ig KGludCBudGggPSAwOworICAgICAgICAgICBtY190cmF2ZXJzZV9jYWNoZV9wICh3LT5tY19tYXRy aXgsIGNhY2hlX3R5cGUsIHZudGgsIG50aCk7CisgICAgICAgICAgICsrbnRoKQorICAgICAgICB7 CisgICAgICAgICAgaW50IHggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhdLng7CisgICAgICAgICAgaW50IGZ4ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5meDsKKyAgICAgICAgICBpbnQgeSA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueTsKKyAgICAgICAgICBpbnQgZnkg PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZ5OworICAg ICAgICAgIGludCBocG9zID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXS5ocG9zOworICAgICAgICAgIGludCB2cG9zID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS52cG9zOworICAgICAgICAgIGludCB3ZCA9IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ud2Q7CisgICAgICAgICAg aW50IGggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmg7 CisgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vyc29yX3R5cGU7CisgICAgICAg ICAgaW50IGN1cnNvcl93aWR0aCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF0uY3Vyc29yX3dpZHRoOworICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2Zn ID0gey5yZWQgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmZnLnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZnLmdyZWVuLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mZy5ibHVlfTsKKyAgICAgICAgICAvLyAgc3Ry dWN0IG1jX1JHQiBsc2xfYmcgPSB7LnJlZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF0uYmcucmVkLAorICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAg ICAgICAgICAuZ3JlZW4gPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmJnLmdyZWVuLAorICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAu Ymx1ZSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcu Ymx1ZX07CisgICAgICAgICAgYm9vbCBhY3RpdmVfcCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYWN0aXZlX3A7CisgICAgICAgICAgZW51bSBtY19mbGF2 b3IgZ2x5cGhfZmxhdm9yID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAgYm9vbCBlbmFibGVkX3AgPSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmVuYWJsZWRfcDsKKyAgICAg ICAgICBpZiAodnBvcyA9PSB2bnRoCisgICAgICAgICAgICAgICYmICgoaHBvcyA+PSBzdGFydF9o cG9zCisgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGVuZF9ocG9zKQorICAgICAgICAgICAg ICAgICAgLyogQSBmbG9hdGluZyBjdXJzb3IgYmV5b25kIHRoZSBlbmQgb2YgdGhlIGdseXBoIHJv dy4gKi8KKyAgICAgICAgICAgICAgICAgIHx8IChocG9zICsgMSA9PSBzdGFydF9ocG9zCisgICAg ICAgICAgICAgICAgICAgICAgJiYgaHBvcyArIDEgPT0gZW5kX2hwb3MpKQorICAgICAgICAgICAg ICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGJvb2wgcmVtb3Zl X3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIG1hdHJp eCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgbHNsX2ZnLCBh Y3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZv ciwgcmVtb3ZlX3ApOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICByZXR1cm4g dHJ1ZTsKKyAgLy8gIGNsb2NrX2VuZCA9IGNsb2NrKCk7CisgIC8vICBkb3VibGUgdGltZV9jdXJz b3JzID0gKChkb3VibGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9T RUM7CisgIC8vICBmcHJpbnRmIChzdGRlcnIsICJtY19yZWRyYXdfcm93ICglZCk6ICBocG9zICgl ZC8lZCkgfCBnbHlwaHMgKCVmKSB8IGN1cnNvcnMgKCVmKVxuIiwKKyAgLy8gICAgICAgICAgICAg ICAgICAgdnBvcywgc3RhcnRfaHBvcywgZW5kX2hwb3MsIHRpbWVfZ2x5cGhzLCB0aW1lX2N1cnNv cnMpOworfQorCit2b2lkCittY19lcmFzZV9yb3cgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBn bHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93KQoreworICBpbnQgdm50 aCA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICBpZiAobWNfc3RkZXJyX3ApCisg ICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2Vfcm93ICglcyk6ICB2cG9zICglZClcbiIsIG1j X3dpbmRvdyAodyksIHZudGgpOworICAvLyAgaWYgKG1jX3N0ZGVycl9wKQorICAvLyAgICBmcHJp bnRmIChzdGRlcnIsICJtY19lcmFzZV9oZWxwZXIgKCVzKTogIGNhY2hlICglcykgfCB2cG9zICgl ZClcbiIsCisgIC8vICAgICAgbWNfd2luZG93ICh3KSwgbWNfY2FjaGVfdHlwZV90b19zdHJpbmcg KGNhY2hlX3R5cGUpLCB2bnRoKTsKKyAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlw ZSA9IE1DX0NBQ0hFOworICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICArK2Nh Y2hlX3R5cGUpCisgICAgeworICAgICAgZm9yIChpbnQgbnRoID0gMDsKKyAgICAgICAgICAgbWNf dHJhdmVyc2VfY2FjaGVfcCAody0+bWNfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGgpOwor ICAgICAgICAgICArK250aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB4ID0gdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS54OworICAgICAgICAgIGludCBm eCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZng7Cisg ICAgICAgICAgaW50IHkgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLnk7CisgICAgICAgICAgaW50IGZ5ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS5meTsKKyAgICAgICAgICBpbnQgaHBvcyA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uaHBvczsKKyAgICAgICAgICBpbnQg dnBvcyA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0udnBv czsKKyAgICAgICAgICBpbnQgd2QgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhdLndkOworICAgICAgICAgIGludCBoID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5oOworICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5 cGUgY3Vyc29yX3R5cGUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmN1cnNvcl90eXBlOworICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGggPSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl93aWR0aDsKKyAg ICAgICAgICAvLyAgc3RydWN0IG1jX1JHQiBsc2xfZmcgPSB7LnJlZCA9IHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcucmVkLAorICAgICAgICAgIC8vICAg ICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmZnLmdyZWVuLAorICAgICAgICAgIC8vICAgICAgICAgICAg ICAgICAgICAgICAgICAuYmx1ZSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF0uZmcuYmx1ZX07CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfYmcgPSB7 LnJlZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcu cmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcuZ3JlZW4sCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLmJsdWV9OworICAgICAgICAgIGJvb2wgYWN0aXZl X3AgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmFjdGl2 ZV9wOworICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGhfZmxhdm9yOworICAgICAg ICAgIGJvb2wgZW5hYmxlZF9wID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS5lbmFibGVkX3A7CisgICAgICAgICAgLyogYG1hdHJpeF9yb3cnIGluIGBkaXNw bmV3LmNgIGNvbnRhaW5zIHRoZSBmb2xsb3dpbmcgdGVzdHMsCisgICAgICAgICAgZWFzc2VydCAo bWF0cml4ICYmIG1hdHJpeC0+cm93cyk7CisgICAgICAgICAgZWFzc2VydCAocm93ID49IDAgJiYg cm93IDwgbWF0cml4LT5ucm93cyk7ICovCisgICAgICAgICAgYm9vbCBiYXJmX2NyYXNoX29uZSA9 IChtYXRyaXggJiYgbWF0cml4LT5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgICAgICAgICBpZiAo YmFyZl9jcmFzaF9vbmUpCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBib29sIGJh cmZfY3Jhc2hfdHdvID0gKHZwb3MgPj0gMCAmJiB2cG9zIDwgbWF0cml4LT5ucm93cykgPyBmYWxz ZSA6IHRydWU7CisgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hfdHdvKQorICAgICAgICAgICAgY29u dGludWU7CisgICAgICAgICAgaWYgKHZwb3MgPT0gdm50aAorICAgICAgICAgICAgICAmJiBnbHlw aF9mbGF2b3IgPT0gTUNfR0xZUEgKKyAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICBtY19lcmFzZV9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4 LCB5LCBocG9zLCB2cG9zLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCk7CisgICAgICAg ICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5h YmxlZF9wID0gZmFsc2U7CisgICAgICAgICAgICAgIC0tdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNl ZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKHZwb3Mg PT0gdm50aAorICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgYm9vbCByZW1vdmVfcCA9IHRydWU7CisgICAgICAgICAgICAg ICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhw b3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBj dXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBsc2xfYmcsIGFjdGl2ZV9wLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAg ICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgIC0tdy0+bWNfbWF0cml4LmN1cnNv cnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdID0gMDsKKyAgICB9 Cit9CisKKy8qIEVyYXNlIGZha2UgY3Vyc29ycyBmcm9tIChtaW4sIHJ1bi5jdXJyZW50X3ksIHJ1 bi5kZXNpcmVkX3kpIHRvIGVuZCBvZiB3aW5kb3cuCisgIFRSWV9XSU5ET1dfUkVVU0lOR19DVVJS RU5UX01BVFJJWF9ET1dOOgorICAgIHJ1bi5oZWlnaHQgPSBpdC5sYXN0X3Zpc2libGVfeSAtIHJ1 bi5kZXNpcmVkX3kKKyAgICBbZW1hY3MgLXE6ICBIb2xkIHVwLWFycm93IGtleSB0cmlnZ2VyaW5n IGF1dG8tcmVjZW50ZXIgYXQgc2Nyb2xsLW1hcmdpbi5dCisgIFRSWV9XSU5ET1dfUkVVU0lOR19D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J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAg ICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2Nv bmYpKSkpOworICBpZiAobWNfc3RkZXJyX3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfcHJl X3Njcm9sbF9jbGVhbiAoJXMpOlxuXAorICAlcyB8IGdvX29uZV9wICglcykgfCBnb190d29fcCAo JXMpXG5cCisgIHN0YXJ0X3Zwb3MgKCVkKSB8IG5yb3dzX3Njcm9sbGVkICglZClcblwKKyAgJXM6 ICBydW4uY3VycmVudC9kZXNpcmVkX3kgKCVkLyVkKSB8IHJ1bi5oZWlnaHQgKCVkKVxuIiwKKyAg ICBtY193aW5kb3cgKHcpLCAoZnJvbV93aGVyZSA9PSBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVO VF9NQVRSSVhfRE9XTikKKyAgICAgICAgICAgICAgICAgICAgID8gIlRSWV9XSU5ET1dfUkVVU0lO R19DVVJSRU5UX01BVFJJWF9ET1dOIgorICAgICAgICAgICAgICAgICAgIDogKGZyb21fd2hlcmUg PT0gVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQKQorICAgICAgICAgICAgICAg ICAgICAgPyAiVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQIgorICAgICAgICAg ICAgICAgICAgIDogKGZyb21fd2hlcmUgPT0gVFJZX1dJTkRPV19JRCkKKyAgICAgICAgICAgICAg ICAgICAgID8gIlRSWV9XSU5ET1dfSUQiCisgICAgICAgICAgICAgICAgICAgOiAiVU5LTk9XTiIs CisgICAgZ29fb25lX3AgPyAieWVzIiA6ICJubyIsIGdvX3R3b19wID8gInllcyIgOiAibm8iLAor ICAgIHN0YXJ0X3Zwb3MsIG5yb3dzX3Njcm9sbGVkLAorICAgIHJ1bi5jdXJ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aGUgKHcpOworfQorCitERUZVTiAoIm1jLXN0ZGVyciIsIEZt Y19zdGRlcnIsIFNtY19zdGRlcnIsIDAsIDEsICJQIiwKKyAgICAgICBkb2M6IC8qIFRvZ2dsZSB0 cmFjaW5nIG9mIG11bHRpcGxlIGZha2UgY3Vyc29ycy4KK1dpdGggQVJHLCB0dXJuIHRyYWNpbmcg b24gaWYgYW5kIG9ubHkgaWYgQVJHIGlzIHBvc2l0aXZlLiAqLykKKyAgKExpc3BfT2JqZWN0IGFy ZykKK3sKKyAgaWYgKE5JTFAgKGFyZykpCisgICAgbWNfc3RkZXJyX3AgPSAhbWNfc3RkZXJyX3A7 CisgIGVsc2UKKyAgICB7CisgICAgICBhcmcgPSBGcHJlZml4X251bWVyaWNfdmFsdWUgKGFyZyk7 CisgICAgICBtY19zdGRlcnJfcCA9IFhGSVhOVU0gKGFyZykgPiAwOworICAgIH0KKyAgcmV0dXJu IFFuaWw7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAMCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKIAkJICAgICAgV2luZG93IGRpc3BsYXkg ZGltZW5zaW9ucwpAQCAtMTM1MTEsNiArMTgzOTUsNjkgQEAgaHNjcm9sbF93aW5kb3dfdHJlZSAo TGlzcF9PYmplY3Qgd2luZG93KQogCSAgICAgIGVsc2UKIAkJcHQgPSBjbGlwX3RvX2JvdW5kcyAo QkVHViwgbWFya2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pLCBaVik7CiAKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS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ZmZmNWZiZjllMzAsIHc9MHgxMWJmNzJjOTgsCisgICAgcm93 PTB4MTIxMjQzZDAwKSBhdCB4ZGlzcC5jOjg0MjMKKyM3ICAweDAwMDAwMDAxMDAwNmMzZjcgaW4g aHNjcm9sbF93aW5kb3dfdHJlZSAod2luZG93PS4uLikgYXQgeGRpc3AuYzoxODU0NgorKi8KKwor ICAvKiBgaW5pdF9pdGVyYXRvcic6ICBlYXNzZXJ0IChjaGFycG9zIDwgMAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICB8fCAoY2hhcnBvcyA+PSBCVUZfQkVHIChjdXJyZW50X2J1ZmZl cikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGNoYXJwb3MgPD0gWlYp KTsgKi8KKworICBzdHJ1Y3QgZGlzcGxheV9wb3MgKnBvcyA9ICZjdXJzb3Jfcm93LT5zdGFydDsK KyAgcHRyZGlmZl90IGNoYXJwb3MgPSBDSEFSUE9TIChwb3MtPnBvcyk7CisKKyAgYm9vbCBiYXJm X2NyYXNoX29uZSA9IChjaGFycG9zIDwgMAorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChj aGFycG9zID49IEJVRl9CRUcgKGN1cnJlbnRfYnVmZmVyKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBjaGFycG9zIDw9IFpWKSkKKyAgICAgICAgICAgICAgICAgICAgICAgID8gZmFs c2UKKyAgICAgICAgICAgICAgICAgICAgICAgIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2hfb25l KQorICAgIHJldHVybiBoc2Nyb2xsZWRfcDsKKworICAvKiBgcmVzZWF0XzEnOiAgQ0hBUlBPUyAo cG9zKSA+PSBCRUdWICYmIENIQVJQT1MgKHBvcykgPD0gWlYgKi8KKyAgYm9vbCBiYXJmX2NyYXNo X3R3byA9IChjaGFycG9zID49IEJFR1YgJiYgY2hhcnBvcyA8PSBaVikKKyAgICAgICAgICAgICAg ICAgICAgICAgICA/IGZhbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgOiB0cnVlOworICBp ZiAoYmFyZl9jcmFzaF90d28pCisgICAgcmV0dXJuIGhzY3JvbGxlZF9wOworCisvKiBlbmQgTVVM VElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICAgIC8q IE1vdmUgaXRlcmF0b3IgdG8gcHQgc3RhcnRpbmcgYXQgY3Vyc29yX3Jvdy0+c3RhcnQgaW4KIAkJ IGEgbGluZSB3aXRoIGluZmluaXRlIHdpZHRoLiAgKi8KIAkgICAgICBpbml0X3RvX3Jvd19zdGFy dCAoJml0LCB3LCBjdXJzb3Jfcm93KTsKQEAgLTE0Mzk3LDkgKzE5MzQ0LDIyIEBAIHJlZGlzcGxh eV9pbnRlcm5hbCAodm9pZCkKIAkgICAgICAqdy0+ZGVzaXJlZF9tYXRyaXgtPm1ldGhvZCA9IDA7 CiAJICAgICAgZGVidWdfbWV0aG9kX2FkZCAodywgIm9wdGltaXphdGlvbiAxIik7CiAjZW5kaWYK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwog I2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQorICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisg ICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkp CisgICAgbWNfdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCBmYWxzZSk7CisgICAgZWxzZQogCSAg ICAgIHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgZmFsc2UpOwogI2VuZGlmCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKIAkgICAgICBnb3RvIHVwZGF0ZTsKIAkgICAgfQogCSAgZWxz ZQpAQCAtMTc3OTIsMTAgKzIyNzUyLDIyIEBAIHJlZGlzcGxheV93aW5kb3cgKExpc3BfT2JqZWN0 IHdpbmRvdywgYm9vbCBqdXN0X3RoaXNfb25lX3ApCiAgICAgfQogCiAjaWZkZWYgSEFWRV9XSU5E T1dfU1lTVEVNCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJT T1JTICovCisKKyAgYm9vbCBrZWVwX2N1cnJlbnRfcCA9IChqdXN0X3RoaXNfb25lX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICB8fCAoIXVzZWRfY3VycmVudF9tYXRyaXhfcCAmJiAhb3Zlcmxh eV9hcnJvd19zZWVuKQorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IHctPnBzZXVkb193aW5k b3dfcCk7CisKKyAgYm9vbCBmcmluZ2VzX3VwZGF0ZWRfcCA9IChCVUZGRVJQICh3LT5jb250ZW50 cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywga2VlcF9jdXJyZW50X3ApCisgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywga2VlcF9jdXJyZW50 X3ApOworCiAgIGlmIChGUkFNRV9XSU5ET1dfUCAoZikKLSAgICAgICYmIHVwZGF0ZV93aW5kb3df ZnJpbmdlcyAodywgKGp1c3RfdGhpc19vbmVfcAotCQkJCSAgICB8fCAoIXVzZWRfY3VycmVudF9t YXRyaXhfcCAmJiAhb3ZlcmxheV9hcnJvd19zZWVuKQotCQkJCSAgICB8fCB3LT5wc2V1ZG9fd2lu ZG93X3ApKSkKKyAgICAgICYmIGZyaW5nZXNfdXBkYXRlZF9wKQogICAgIHsKICAgICAgIHVwZGF0 ZV9iZWdpbiAoZik7CiAgICAgICBibG9ja19pbnB1dCAoKTsKQEAgLTE3ODEwLDYgKzIyNzgyLDkg QEAgcmVkaXNwbGF5X3dpbmRvdyAoTGlzcF9PYmplY3Qgd2luZG93LCBib29sIGp1c3RfdGhpc19v bmVfcCkKICAgICAgIHVwZGF0ZV9lbmQgKGYpOwogICAgIH0KIAorLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICBpZiAoV0lORE9XX0JPVFRPTV9ESVZJREVSX1dJRFRIICh3KSkKICAgICBn dWlfZHJhd19ib3R0b21fZGl2aWRlciAodyk7CiAjZW5kaWYgLyogSEFWRV9XSU5ET1dfU1lTVEVN ICovCkBAIC0xODEyNSw2ICsyMzEwMCwxNiBAQCB0cnlfd2luZG93X3JldXNpbmdfY3VycmVudF9t YXRyaXggKHN0cnVjdCB3aW5kb3cgKncpCiAJICAgICAgdXBkYXRlX2JlZ2luIChmKTsKIAkgICAg ICBndWlfdXBkYXRlX3dpbmRvd19iZWdpbiAodyk7CiAJICAgICAgRlJBTUVfUklGIChmKS0+Y2xl YXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgbWNfcHJlX3Njcm9sbF9jbGVhbiAodywgcnVu LCBzdGFydF92cG9zLCBucm93c19zY3JvbGxlZCwgVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRf TUFUUklYX0RPV04pOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgRlJB TUVfUklGIChmKS0+c2Nyb2xsX3J1bl9ob29rICh3LCAmcnVuKTsKIAkgICAgICBndWlfdXBkYXRl X3dpbmRvd19lbmQgKHcsIGZhbHNlLCBmYWxzZSk7CiAJICAgICAgdXBkYXRlX2VuZCAoZik7CkBA IC0xODI5MSw2ICsyMzI3NiwxNiBAQCB0cnlfd2luZG93X3JldXNpbmdfY3VycmVudF9tYXRyaXgg KHN0cnVjdCB3aW5kb3cgKncpCiAJICB1cGRhdGVfYmVnaW4gKGYpOwogCSAgZ3VpX3VwZGF0ZV93 aW5kb3dfYmVnaW4gKHcpOwogCSAgRlJBTUVfUklGIChmKS0+Y2xlYXJfd2luZG93X21vdXNlX2Zh Y2UgKHcpOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisgICAgbWNfcHJlX3Njcm9sbF9jbGVhbiAodywgcnVuLCBzdGFydF92cG9zLCBucm93 c19zY3JvbGxlZCwgVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQKTsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogCSAgRlJBTUVfUklGIChmKS0+c2Nyb2xsX3J1bl9o b29rICh3LCAmcnVuKTsKIAkgIGd1aV91cGRhdGVfd2luZG93X2VuZCAodywgZmFsc2UsIGZhbHNl KTsKIAkgIHVwZGF0ZV9lbmQgKGYpOwpAQCAtMTkyNDUsNiArMjQyNDAsMTYgQEAgdHJ5X3dpbmRv d19pZCAoc3RydWN0IHdpbmRvdyAqdykKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KIAkgIGd1 aV91cGRhdGVfd2luZG93X2JlZ2luICh3KTsKIAkgIEZSQU1FX1JJRiAoZiktPmNsZWFyX3dpbmRv d19tb3VzZV9mYWNlICh3KTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJ UExFLUNVUlNPUlMgKi8KKworICAgIG1jX3ByZV9zY3JvbGxfY2xlYW4gKHcsIHJ1biwgZmlyc3Rf dW5jaGFuZ2VkX2F0X2VuZF92cG9zLCBkdnBvcywgVFJZX1dJTkRPV19JRCk7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKIAkgIEZSQU1FX1JJRiAoZiktPnNjcm9sbF9ydW5faG9vayAo dywgJnJ1bik7CiAJICBndWlfdXBkYXRlX3dpbmRvd19lbmQgKHcsIGZhbHNlLCBmYWxzZSk7CiAj ZW5kaWYKQEAgLTIxNTI4LDYgKzI2NTMzLDE3IEBAIG1heWJlX3Byb2R1Y2VfbGluZV9udW1iZXIg KHN0cnVjdCBpdCAqaXQpCiAgICAgICBTRVRfVEVYVF9QT1MgKHRlbV9pdC5wb3NpdGlvbiwgLTEs IC0xKTsKICAgICAgIFBST0RVQ0VfR0xZUEhTICgmdGVtX2l0KTsKIAorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgLyogVGhpcyBwZXJt aXRzIHVzIHRvIGluc3BlY3QgdGhlIEhQT1Mgb2YgbGluZSBudW1iZXIgZ2x5cGhzIGFuZCB0aGUg c3BhY2UKKyAgICAgIHBhZGRpbmcgYmVmb3JlL2FmdGVyIHRoZSBsaW5lIG51bWJlcnMuICBXZSBz ZXQgYGdseXBoLT5ocG9zYCBlbHNld2hlcmUuICovCisgICAgICB0ZW1faXQuaHBvcyArPSAxOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICAvKiBTdG9wIHByb2R1Y2luZyBn bHlwaHMsIGFuZCByZWZyYWluIGZyb20gcHJvZHVjaW5nIHRoZSBsaW5lCiAJIG51bWJlciwgaWYg d2UgZG9uJ3QgaGF2ZSBlbm91Z2ggc3BhY2Ugb24gdGhpcyBsaW5lLiAgKi8KICAgICAgIGlmICh0 ZW1faXQuY3VycmVudF94ID49IHdpZHRoX2xpbWl0KQpAQCAtMjE1MzksNiArMjY1NTUsMjggQEAg bWF5YmVfcHJvZHVjZV9saW5lX251bWJlciAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgfQogCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIHN0 cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChpdC0+dy0+Y29udGVudHMpOworICBzdHJ1Y3QgYnVm ZmVyICpvbGRfYnVmZmVyID0gTlVMTDsKKyAgLyogTmVlZGVkIHNvIHRoYXQgYnVmZmVyLWxvY2Fs IHZhbHVlcyBjYW4gYmUgZGV0ZXJtaW5lZDsgZS5nLiwgd2hlbiBzd2l0Y2hpbmcKKyAgdG8gdGhl IG1pbmlidWZmZXIuICovCisgIGlmIChiICE9IGN1cnJlbnRfYnVmZmVyKQorICAgIHsKKyAgICAg IG9sZF9idWZmZXIgPSBjdXJyZW50X2J1ZmZlcjsKKyAgICAgIHNldF9idWZmZXJfaW50ZXJuYWwg KGIpOworICAgIH0KKyAgaXQtPnctPm1jLmxudW1fcGl4ZWxfd2lkdGggPSAoIU5JTFAgKFZkaXNw bGF5X2xpbmVfbnVtYmVycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0ZW1f aXQuY3VycmVudF94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAwOworICBpZiAo b2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBSZWNvcmQgdGhlIHdpZHRoIGluIHBpeGVs cyB3ZSBuZWVkIGZvciB0aGUgbGluZSBudW1iZXIgZGlzcGxheS4gICovCiAgIGl0LT5sbnVtX3Bp eGVsX3dpZHRoID0gdGVtX2l0LmN1cnJlbnRfeDsKICAgLyogQ29weSB0aGUgcHJvZHVjZWQgZ2x5 cGhzIGludG8gSVQncyBnbHlwaF9yb3cuICAqLwpAQCAtMjczNjAsNiArMzIzOTgsMTcgQEAgYXBw ZW5kX2dseXBoIChzdHJ1Y3QgaXQgKml0KQogCSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0 LT5nbHlwaF9yb3ctPmdseXBoc1thcmVhXTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhw b3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQt PnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgaWYg KGl0LT5waXhlbF93aWR0aCA+IDApCkBAIC0yNzQ0Miw2ICszMjQ5MSwxNyBAQCBhcHBlbmRfY29t cG9zaXRlX2dseXBoIChzdHJ1Y3QgaXQgKml0KQogCSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9 IGl0LT5nbHlwaF9yb3ctPmdseXBoc1tpdC0+YXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9 IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IGl0LT5j bXBfaXQuY2hhcnBvczsKICAgICAgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAg ZWFzc2VydCAoaXQtPnBpeGVsX3dpZHRoIDw9IFNIUlRfTUFYKTsKQEAgLTI3NjUwLDYgKzMyNzEw LDE3IEBAIHByb2R1Y2VfaW1hZ2VfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJfQogICAgICAgaWYg KGdseXBoIDwgaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2FyZWEgKyAxXSkKIAl7CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBo LT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCpp dCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIGdseXBoLT5jaGFycG9zID0g Q0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKIAkgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0Owog CSAgZ2x5cGgtPnBpeGVsX3dpZHRoID0gY2xpcF90b19ib3VuZHMgKC0xLCBpdC0+cGl4ZWxfd2lk dGgsIFNIUlRfTUFYKTsKQEAgLTI3NzUzLDYgKzMyODI0LDE3IEBAIHByb2R1Y2VfeHdpZGdldF9n bHlwaCAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgICBpZiAoZ2x5cGggPCBpdC0+Z2x5cGhfcm93 LT5nbHlwaHNbYXJlYSArIDFdKQogCXsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAg ICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogCSAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24p OwogCSAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAJICBnbHlwaC0+cGl4ZWxfd2lkdGgg PSBjbGlwX3RvX2JvdW5kcyAoLTEsIGl0LT5waXhlbF93aWR0aCwgU0hSVF9NQVgpOwpAQCAtMjc4 MzksNiArMzI5MjEsMTcgQEAgYXBwZW5kX3N0cmV0Y2hfZ2x5cGggKHN0cnVjdCBpdCAqaXQsIExp c3BfT2JqZWN0IG9iamVjdCwKIAkgICAgd2lkdGggLT0gaXQtPmZpcnN0X3Zpc2libGVfeCAtIGl0 LT5jdXJyZW50X3g7CiAJICBlYXNzZXJ0ICh3aWR0aCA+IDApOwogCX0KKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhw b3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBD SEFSUE9TIChpdC0+cG9zaXRpb24pOwogICAgICAgZ2x5cGgtPm9iamVjdCA9IG9iamVjdDsKICAg ICAgIC8qIEZJWE1FOiBJdCB3b3VsZCBiZSBiZXR0ZXIgdG8gdXNlIFRZUEVfTUFYIGhlcmUsIGJ1 dApAQCAtMjgyOTMsNiArMzMzODYsMTcgQEAgYXBwZW5kX2dseXBobGVzc19nbHlwaCAoc3RydWN0 IGl0ICppdCwgaW50IGZhY2VfaWQsIGJvb2wgZm9yX25vX2ZvbnQsIGludCBsZW4sCiAJICAgIGdb MV0gPSAqZzsKIAkgIGdseXBoID0gaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2FyZWFdOwogCX0KKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAg ICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllU RVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgZ2x5cGgt PmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwogICAgICAgZ2x5cGgtPm9iamVjdCA9 IGl0LT5vYmplY3Q7CiAgICAgICBlYXNzZXJ0IChpdC0+cGl4ZWxfd2lkdGggPD0gU0hSVF9NQVgp OwpAQCAtMjkzNDMsMTAgKzM0NDQ3LDIwIEBAIGd1aV9pbnNlcnRfZ2x5cGhzIChzdHJ1Y3Qgd2lu ZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICp1cGRhdGVkX3JvdywKIAogICAvKiBXcml0ZSB0aGUg Z2x5cGhzLiAgKi8KICAgaHBvcyA9IHN0YXJ0IC0gcm93LT5nbHlwaHNbdXBkYXRlZF9hcmVhXTsK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICBpZiAoIW1jX3JlZHJhd19yb3cgKHcsIHctPmN1cnJlbnRfbWF0cml4LCByb3csIHVwZGF0ZWRf YXJlYSwgdy0+b3V0cHV0X2N1cnNvci54LAorICAgICAgICAgICAgICAgICAgICAgIGhwb3MsIGhw b3MgKyBsZW4sIGZhbHNlLCBEUkFXX05PUk1BTF9URVhULCBHVUlfSU5TRVJUX0dMWVBIUykpCiAg IGRyYXdfZ2x5cGhzICh3LCB3LT5vdXRwdXRfY3Vyc29yLngsIHJvdywgdXBkYXRlZF9hcmVhLAog CSAgICAgICBocG9zLCBocG9zICsgbGVuLAogCSAgICAgICBEUkFXX05PUk1BTF9URVhULCAwKTsK IAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBBZHZhbmNlIHRoZSBvdXRwdXQg Y3Vyc29yLiAgKi8KICAgdy0+b3V0cHV0X2N1cnNvci5ocG9zICs9IGxlbjsKICAgdy0+b3V0cHV0 X2N1cnNvci54ICs9IHNoaWZ0X2J5X3dpZHRoOwpAQCAtMjk3NzIsOSArMzQ4ODYsMTkgQEAgZ3Vp X2ZpeF9vdmVybGFwcGluZ19hcmVhIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93 ICpyb3csCiAJICB3aGlsZSAoaSA8IHJvdy0+dXNlZFthcmVhXQogCQkgJiYgcm93LT5nbHlwaHNb YXJlYV1baV0ub3ZlcmxhcHNfdmVydGljYWxseV9wKTsKIAorCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgaWYgKCFtY19yZWRyYXdfcm93 ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBhcmVhLCBzdGFydF94LCBzdGFydCwgaSwKKyAg ICAgICAgICBmYWxzZSwgRFJBV19OT1JNQUxfVEVYVCwgR1VJX0ZJWF9PVkVSTEFQUElOR19BUkVB KSkKIAkgIGRyYXdfZ2x5cGhzICh3LCBzdGFydF94LCByb3csIGFyZWEsCiAJCSAgICAgICBzdGFy dCwgaSwKIAkJICAgICAgIERSQVdfTk9STUFMX1RFWFQsIG92ZXJsYXBzKTsKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogCX0KICAgICAgIGVsc2UKIAl7CkBAIC0zMDAyNSwxMCArMzUx NDksMTcgQEAgZGlzcGxheV9hbmRfc2V0X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBv biwKICAgbmV3X2N1cnNvcl90eXBlID0gZ2V0X3dpbmRvd19jdXJzb3JfdHlwZSAodywgZ2x5cGgs CiAJCQkJCSAgICAmbmV3X2N1cnNvcl93aWR0aCwgJmFjdGl2ZV9jdXJzb3IpOwogCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAgIC8qIElmIGN1 cnNvciBpcyBjdXJyZW50bHkgYmVpbmcgc2hvd24gYW5kIHdlIGRvbid0IHdhbnQgaXQgdG8gYmUg b3IKICAgICAgaXQgaXMgaW4gdGhlIHdyb25nIHBsYWNlLCBvciB0aGUgY3Vyc29yIHR5cGUgaXMg bm90IHdoYXQgd2Ugd2FudCwKICAgICAgZXJhc2UgaXQuICAqLwogICBpZiAody0+cGh5c19jdXJz b3Jfb25fcAorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9z c2hhaXJzKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNf dmlzaWJsZSkpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1j X2NvbmYpKQogICAgICAgJiYgKCFvbgogCSAgfHwgdy0+cGh5c19jdXJzb3IueCAhPSB4CiAJICB8 fCB3LT5waHlzX2N1cnNvci55ICE9IHkKQEAgLTMwMDQxLDYgKzM1MTcyLDkgQEAgZGlzcGxheV9h bmRfc2V0X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBvbiwKIAkgICAgICAmJiBuZXdf Y3Vyc29yX3dpZHRoICE9IHctPnBoeXNfY3Vyc29yX3dpZHRoKSkpCiAgICAgZXJhc2VfcGh5c19j dXJzb3IgKHcpOwogCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIERvbid0IGNo ZWNrIHBoeXNfY3Vyc29yX29uX3AgaGVyZSBiZWNhdXNlIHRoYXQgZmxhZyBpcyBvbmx5IHNldAog ICAgICB0byBmYWxzZSBpbiBzb21lIGNhc2VzIHdoZXJlIHdlIGtub3cgdGhhdCB0aGUgY3Vyc29y IGhhcyBiZWVuCiAgICAgIGNvbXBsZXRlbHkgZXJhc2VkLCB0byBhdm9pZCB0aGUgZXh0cmEgd29y ayBvZiBlcmFzaW5nIHRoZSBjdXJzb3IKQEAgLTMwMDU5LDkgKzM1MTkzLDIwIEBAIGRpc3BsYXlf YW5kX3NldF9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb24sCiAgICAgICB3LT5waHlz X2N1cnNvci52cG9zID0gdnBvczsKICAgICB9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKE5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBtY19jb25mKSkpCiAgIEZSQU1FX1JJRiAoZiktPmRyYXdfd2luZG93X2N1 cnNvciAodywgZ2x5cGhfcm93LCB4LCB5LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIG5ld19jdXJzb3JfdHlwZSwgbmV3X2N1cnNvcl93aWR0aCwKICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBvbiwgYWN0aXZlX2N1cnNvcik7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIH0KIAogCkBAIC0zMDE1NCw3ICszNTI5OSwxOCBAQCBkcmF3X3Jv d193aXRoX21vdXNlX2ZhY2UgKHN0cnVjdCB3aW5kb3cgKncsIGludCBzdGFydF94LCBzdHJ1Y3Qg Z2x5cGhfcm93ICpyb3csCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAgIGlmIChGUkFNRV9X SU5ET1dfUCAoWEZSQU1FICh3LT5mcmFtZSkpKQogICAgIHsKKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgaWYgKCFtY19yZWRyYXdf cm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBURVhUX0FSRUEsIHN0YXJ0X3gsCisgICAg ICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBmYWxzZSwgZHJhdywg RFJBV19ST1dfV0lUSF9NT1VTRV9GQUNFKSkKICAgICAgIGRyYXdfZ2x5cGhzICh3LCBzdGFydF94 LCByb3csIFRFWFRfQVJFQSwgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGRyYXcsIDApOworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICByZXR1cm47CiAgICAgfQogI2VuZGlmCkBA IC0zMjIxNCwxMSArMzczNzAsMjMgQEAgZXhwb3NlX2FyZWEgKHN0cnVjdCB3aW5kb3cgKncsIHN0 cnVjdCBnbHlwaF9yb3cgKnJvdywgY29uc3QgRW1hY3NfUmVjdGFuZ2xlICpyLAogICBzdHJ1Y3Qg Z2x5cGggKmxhc3Q7CiAgIGludCBmaXJzdF94LCBzdGFydF94LCB4OwogCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAgIGlmIChhcmVhID09IFRF WFRfQVJFQSAmJiByb3ctPmZpbGxfbGluZV9wKQorICAgIHsKKyAgICAgIGlmICghbWNfcmVkcmF3 X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywgYXJlYSwgMCwgMCwgcm93LT51c2VkW2Fy ZWFdLAorICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSwgRFJBV19OT1JNQUxfVEVYVCwg RVhQT1NFX0FSRUFfT05FKSkKICAgICAvKiBJZiByb3cgZXh0ZW5kcyBmYWNlIHRvIGVuZCBvZiBs aW5lIHdyaXRlIHRoZSB3aG9sZSBsaW5lLiAgKi8KICAgICBkcmF3X2dseXBocyAodywgMCwgcm93 LCBhcmVhLAogCQkgMCwgcm93LT51c2VkW2FyZWFdLAogCQkgRFJBV19OT1JNQUxfVEVYVCwgMCk7 CisgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIGVsc2UKICAgICB7CiAg ICAgICAvKiBTZXQgU1RBUlRfWCB0byB0aGUgd2luZG93LXJlbGF0aXZlIHN0YXJ0IHBvc2l0aW9u IGZvciBkcmF3aW5nIGdseXBocyBvZgpAQCAtMzIyNTAsMTEgKzM3NDE4LDIzIEBAIGV4cG9zZV9h cmVhIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGNvbnN0IEVtYWNz X1JlY3RhbmdsZSAqciwKIAkgICsrbGFzdDsKIAl9CiAKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgICAgIC8qIFJlcGFpbnQuICAqLwotICAg ICAgaWYgKGxhc3QgPiBmaXJzdCkKKyAgICAgIC8qIEZsb2F0aW5nIGZha2UgY3Vyc29ycyB3aWxs IGV4aXN0IHdoZW4gKGxhc3QgPT0gZmlyc3QpLiAqLworICAgICAgaWYgKCFtY19yZWRyYXdfcm93 ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBhcmVhLCBmaXJzdF94IC0gc3RhcnRfeCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgZmlyc3QgLSByb3ctPmdseXBoc1thcmVhXSwgbGFzdCAt IHJvdy0+Z2x5cGhzW2FyZWFdLAorICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSwgRFJB V19OT1JNQUxfVEVYVCwgRVhQT1NFX0FSRUFfVFdPKQorICAgICAgICAgICYmIGxhc3QgPiBmaXJz dCkKIAlkcmF3X2dseXBocyAodywgZmlyc3RfeCAtIHN0YXJ0X3gsIHJvdywgYXJlYSwKIAkJICAg ICBmaXJzdCAtIHJvdy0+Z2x5cGhzW2FyZWFdLCBsYXN0IC0gcm93LT5nbHlwaHNbYXJlYV0sCiAJ CSAgICAgRFJBV19OT1JNQUxfVEVYVCwgMCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICAgICB9CiB9CiAKQEAgLTMyMjY4LDEwICszNzQ0OCwyMiBAQCBleHBvc2VfbGluZSAoc3Ry dWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBjb25zdCBFbWFjc19SZWN0YW5n bGUgKnIpCiB7CiAgIGVhc3NlcnQgKHJvdy0+ZW5hYmxlZF9wKTsKIAorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICBpZiAocm93LT5tb2RlX2xp bmVfcCB8fCB3LT5wc2V1ZG9fd2luZG93X3ApCisgICAgeworICAgICAgaWYgKCFtY19yZWRyYXdf cm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBURVhUX0FSRUEsIDAsIDAsCisgICAgICAg ICAgICAgICAgICAgICAgICAgIHJvdy0+dXNlZFtURVhUX0FSRUFdLCBmYWxzZSwgRFJBV19OT1JN QUxfVEVYVCwgRVhQT1NFX0xJTkUpKQogICAgIGRyYXdfZ2x5cGhzICh3LCAwLCByb3csIFRFWFRf QVJFQSwKIAkJIDAsIHJvdy0+dXNlZFtURVhUX0FSRUFdLAogCQkgRFJBV19OT1JNQUxfVEVYVCwg MCk7CisgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIGVsc2UKICAgICB7 CiAgICAgICBpZiAocm93LT51c2VkW0xFRlRfTUFSR0lOX0FSRUFdKQpAQCAtMzI4MTksNiArMzgw MTEsMjIgQEAgZ3VpX2ludGVyc2VjdF9yZWN0YW5nbGVzIChjb25zdCBFbWFjc19SZWN0YW5nbGUg KnIxLCBjb25zdCBFbWFjc19SZWN0YW5nbGUgKnIyLAogdm9pZAogc3ltc19vZl94ZGlzcCAodm9p ZCkKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMg Ki8KKworICBkZWZzdWJyICgmU21jX2R1bXBfZ2x5cGhfcm93KTsKKworICBkZWZzdWJyICgmU21j X2R1bXBfZ2x5cGhfbWF0cml4KTsKKworICBkZWZzdWJyICgmU21jX2N1cnJlbnRfY29sdW1uKTsK KworICBkZWZzdWJyICgmU21jX3N0ZGVycik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICAgVndpdGhfZWNob19hcmVhX3NhdmVfdmVjdG9yID0gUW5pbDsKICAgc3RhdGljcHJvICgm VndpdGhfZWNob19hcmVhX3NhdmVfdmVjdG9yKTsKIApkaWZmIC0tZ2l0IGEvc3JjL3h0ZXJtLmMg Yi9zcmMveHRlcm0uYwppbmRleCBjOTZhYTc0Li43ZjhmMWEwIDEwMDY0NAotLS0gYS9zcmMveHRl cm0uYworKysgYi9zcmMveHRlcm0uYwpAQCAtMTMyLDYgKzEzMiw5MDQgQEAgYWxvbmcgd2l0aCBH TlUgRW1hY3MuICBJZiBub3QsIHNlZSA8aHR0cHM6Ly93d3cuZ251Lm9yZy9saWNlbnNlcy8+LiAg Ki8KICNpbmNsdWRlIDxYMTEvWEtCbGliLmg+CiAjZW5kaWYKIAorCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworI2lmZGVmIEdMWVBIX0RF QlVHCitzdGF0aWMgdm9pZCB4X2NoZWNrX2ZvbnQgKHN0cnVjdCBmcmFtZSAqLCBzdHJ1Y3QgZm9u dCAqKTsKKyNlbmRpZgorCitzdGF0aWMgdm9pZCB4X3NldF9tb2RlX2xpbmVfZmFjZV9nYyAoc3Ry dWN0IGdseXBoX3N0cmluZyAqKTsKKworc3RhdGljIHZvaWQgeF9zZXRfbW91c2VfZmFjZV9nYyAo c3RydWN0IGdseXBoX3N0cmluZyAqKTsKKworc3R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ydWN0IGdseXBoX3JvdyAq cm93LAorICAgICAgICAgICAgICAgICAgICAgICAgIGludCB4LCBpbnQgZngsIGludCB5LCBpbnQg ZnksIGludCBocG9zLCBpbnQgdnBvcywgaW50IHdkLAorICAgICAgICAgICAgICAgICAgICAgICAg IGludCBoLCBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlw ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoLCBlbnVtIG1jX2Zs YXZvciBnbHlwaF9mbGF2b3IsIGJvb2wgb25fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBi b29sIGFjdGl2ZV9wKQoreworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFN RSAodykpOworICAvKiBUaGUgZnJpbmdlIGJpdG1hcHMgYXJlIHByZXNlbnRseSBoYW5kbGVkIGVs c2V3aGVyZSwgYnV0IGNvdWxkIHNvbWVkYXkKKyAgYmUgbWFuYWdlZCAoaW4gcGFydCkgYXQgdGhp cyBzZWN0aW9uIG9mIGNvZGUuICovCisgIGlmIChvbl9wKQorICAgIHsKKyAgICAgIGlmIChyb3ct PmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICAmJiAocm93LT5yZXZlcnNlZF9w CisgICAgICAgICAgICAgID8gKGhwb3MgPCAwKQorICAgICAgICAgICAgICA6IChocG9zID49IHJv dy0+dXNlZFtURVhUX0FSRUFdKSkpCisgICAgICAgIHsKKyAgICAgICAgICByb3ctPmN1cnNvcl9p bl9mcmluZ2VfcCA9IHRydWU7CisgICAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwICh3LCBy b3csIHJvdy0+cmV2ZXJzZWRfcCwgY3Vyc29yX3R5cGUpOworICAgICAgICB9CisgICAgICBlbHNl CisgICAgICAgIHsKKyAgQ29sb3JtYXAgY21hcCA9IEZSQU1FX1hfQ09MT1J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isg ICAgICBicmVhazsKKyAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6CisgICAgeworICAgICAgc3RydWN0 IGdseXBoICpjdXJzb3JfZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJv dywgaHBvcywgdnBvcyk7CisgICAgICBpZiAoY3Vyc29yX2dseXBoID09IE5VTEwpCisgICAgICAg IHJldHVybjsKKyAgICAgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSICh3LT5jb250ZW50cyk7 CisgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5zaWVudF9tYXJrX21v ZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWFy a19hY3RpdmUpKSk7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZyA9IChyZWdpb25fYWN0aXZl X3ApID8gbWNfcmVnaW9uX2xpbWl0ICgxKSA6IC0xOworICAgICAgcHRyZGlmZl90IHJlZ2lvbl9l bmQgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IG1jX3JlZ2lvbl9saW1pdCAoMCkgOiAtMTsKKyAgICAg IGlmIChjdXJzb3JfZ2x5cGgtPnR5cGUgIT0gSU1BR0VfR0xZUEggJiYgbHNsLnJlZCA+PSAwICYm IGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAv KiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycgYnkgYm9y cm93aW5nIHRoZQorICAgICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhfbWFrZV9nYycgaW4geGZu cy5jLiAqLworICAgICAgICAgIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgJiYg YWN0aXZlX3AKKyAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGF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C0+Y3Vy c29yX2djLCBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAg ICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlLT5mb3JlZ3JvdW5k KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoYWN0aXZlX3Ap CisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBo b2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgi Ky1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAg ICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBo b2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3Vu ZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xs b3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgICBYU2V0QmFj a2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2dj LCBob2xsb3dfYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd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ZhY2UgKHcs IGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAg ICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0Vf RlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAg WFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1 cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAg ICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2UtPmJhY2tncm91bmQp OworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocmVnaW9u X2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID4gcmVnaW9uX2Jl ZworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zIDwg cmVnaW9uX2VuZCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAg IGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQgPSBsb29r dXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluLXJlZ2lv bi1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFj ZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBo b2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAg ICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUp OworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2Ug PSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAg ICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9k YXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAg ICAgICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+ b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2Zh Y2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAg ICAgIGVsc2UgaWYgKGFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29r dXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1m YWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICA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ICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRw dXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kKTsK KyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgYmxvY2tfaW5wdXQgKCk7 CisgICAgICAgICAgICAgIC8qIEZvcmNlIGBtY194X3NldF9jdXJzb3JfZ2MnIHRvIHVzZSBgcy0+ Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJy4gKi8KKyAgICAgICAgICAgICAgYm9vbCBjdXJz b3JfZ2NfcCA9IHRydWU7CisgICAgICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBt YXRyaXgsIHJvdywgRFJBV19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBh Y3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9nY19w KTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYt Pm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdjdi5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAg ICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9nYywgeGdjdi5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICAgICAgdW5ibG9ja19pbnB1 dCAoKTsKKyAgICAgICAgICAgICAgLyogRHJhdyB0aGUgZnJhbWUgYXJvdW5kIHRoZSBib3guICov CisgICAgICAgICAgICAgIG1jX3hfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywg eCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAgICB9CisgICAgICBi cmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19IT0xMT1dfQk9YOgorICAgIHsKKyAgICAgIGlmIChs c2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAg eworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vy c29yX3BpeGVsJy4gKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwg PSBjb2xvci5waXhlbDsKKyAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0 cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgIGYt Pm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAg ICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgbWNfeF9kcmF3X2hvbGxvd19jdXJzb3Ig KHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAg IGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgeworICAgICAgaWYg KGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAg ICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycgYnkg Ym9ycm93aW5nIHRoZQorICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHhm bnMuYy4gKi8KKyAgICAgICAgeworICAgICAgICAgIGJsb2Nr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seXBoICh3LCBtYXRyaXgsIHJvdywgRFJBV19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsIGxz bCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIGN1cnNv cl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICB9CisgICAgICBi cmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19CQVI6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQg Pj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAg ICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4 ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9y LnBpeGVsOworICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVl OworICAgICAgICAgIG1jX3hfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngs IHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgY3Vyc29yX3dpZHRoLCBNQ19CQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAg ICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3Jf cGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAg IGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSBmYWxzZTsKKyAgICAgICAgICAgIG1j X3hfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2 cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lk dGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIH0KKyAg ICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0hCQVI6CisgICAgeworICAgICAgaWYgKGxz bC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7 CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJz b3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9 IGNvbG9yLnBpeGVsOworICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3Ag PSB0cnVlOworICAgICAgICAgIG1jX3hfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywg eCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgY3Vyc29yX3dpZHRoLCBNQ19IQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlf cCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxf Y3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAg ICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAg ICAgICBtY194X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwg aHBvcywgdnBvcywgd2QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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aW50IGxlZnRfeCA9IHdpbmRvd19ib3hfbGVmdF9v ZmZzZXQgKHMtPncsIFRFWFRfQVJFQSk7CisgICAgICAgICAgaWYgKHggPCBsZWZ0X3gpCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0gbGVmdF94IC0geDsK KyAgICAgICAgICAgICAgeCA9IGxlZnRfeDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAg ICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgLyogSW4gUjJMIHJvd3MsIGRyYXcg dGhlIGN1cnNvciBvbiB0aGUgcmlnaHQgZWRnZSBvZiB0aGUKKyAgICAgICAgICAgICAgIHN0cmV0 Y2ggZ2x5cGguICovCisgICAgICAgICAgICBpbnQgcmlnaHRfeCA9IHdpbmRvd19ib3hfcmlnaHQg KHMtPncsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICBpZiAoeCArIGJhY2tncm91bmRfd2lkdGgg PiByaWdodF94KQorICAgICAgICAgICAgICBiYWNrZ3JvdW5kX3dpZHRoIC09IHggLSByaWdodF94 OworICAgICAgICAgICAgeCArPSBiYWNrZ3JvdW5kX3dpZHRoOworICAgICAgICAgIH0KKyAgICAg IHdpZHRoID0gbWluIChGUkFNRV9DT0xVTU5fV0lEVEggKHMtPmYpLCBiYWNrZ3JvdW5kX3dpZHRo KTsKKyAgICAgIGlmIChzLT5yb3ctPnJldmVyc2VkX3ApCisgICAgICAgIHggLT0gd2lkdGg7Cisg ICAgICAvKiBEcmF3IGN1cnNvci4gKi8KKyAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmdfcmVj dCAocywgeCwgcy0+eSwgd2lkdGgsIHMtPmhlaWdodCk7CisgICAgICAvKiBDbGVhciByZXN0IHVz aW5nIHRoZSBHQyBvZiB0aGUgb3JpZ2luYWwgbm9uLWN1cnNvciBmYWNlLiAqLworICAgICAgaWYg KHdpZHRoIDwgYmFja2dyb3VuZF93aWR0aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB5ID0g cy0+eTsKKyAgICAgICAgICBpbnQgdyA9IGJhY2tncm91bmRfd2lkdGggLSB3aWR0aCwgaCA9IHMt PmhlaWdodDsKKyAgICAgICAgICBYUmVjdGFuZ2xlIHI7CisgICAgICAgICAgR0MgZ2M7CisgICAg ICAgICAgaWYgKCFzLT5yb3ctPnJldmVyc2VkX3ApCisgICAgICAgICAgICB4ICs9IHdpZHRoOwor ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHggPSBzLT54OworICAgICAgICAgIGlmIChzLT5y b3ctPm1vdXNlX2ZhY2VfcAorICAgICAgICAgICAgICAmJiBjdXJzb3JfaW5fbW91c2VfZmFjZV9w IChzLT53KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgeF9zZXRfbW91c2VfZmFjZV9n YyAocyk7CisgICAgICAgICAgICAgIGdjID0gcy0+Z2M7CisgICAgICAgICAgICB9CisgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgZ2MgPSBzLT5mYWNlLT5nYzsKKyAgICAgICAgICBnZXRfZ2x5 cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgJnIpOworICAgICAgICAgIHhfc2V0X2NsaXBfcmVjdGFu Z2xlcyAocy0+ZiwgZ2MsICZyLCAxKTsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+c3RpcHBsZSkK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogRmlsbCBiYWNrZ3JvdW5kIHdpdGggYSBz dGlwcGxlIHBhdHRlcm4uICovCisgICAgICAgICAgICAgIFhTZXRGaWxsU3R5bGUgKEZSQU1FX1hf RElTUExBWSAocy0+ZiksIGdjLCBGaWxsT3BhcXVlU3RpcHBsZWQpOworICAgICAgICAgICAgICB4 X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBnYywgeCwgeSwgdywgaCk7CisgICAgICAgICAgICAgIFhT ZXRGaWxsU3R5bGUgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIGdjLCBGaWxsU29saWQpOworICAg ICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg WEdDVmFsdWVzIHhnY3Y7CisgICAgICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAoRlJBTUVfWF9ESVNQ TEFZIChzLT5mKSwgZ2MsIEdDRm9yZWdyb3VuZCB8IEdDQmFja2dyb3VuZCwgJnhnY3YpOworICAg ICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgZ2MsIHhn Y3YuYmFja2dyb3VuZCk7CisgICAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIGdj LCB4LCB5LCB3LCBoKTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElT UExBWSAocy0+ZiksIGdjLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgICAgfQorICAgICAg ICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChzLT5mLCBnYyk7CisgICAgICAgIH0KKyAgICB9 CisgIGVsc2UgaWYgKCFzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wKQorICAgIHsKKyAgICAgIGludCBi YWNrZ3JvdW5kX3dpZHRoID0gcy0+YmFja2dyb3VuZF93aWR0aDsKKyAgICAgIGludCB4ID0gcy0+ eCwgbGVmdF94ID0gd2luZG93X2JveF9sZWZ0X29mZnNldCAocy0+dywgVEVYVF9BUkVBKTsKKyAg ICAgIC8qIERvbid0IGRyYXcgaW50byBsZWZ0IG1hcmdpbiwgZnJpbmdlIG9yIHNjcm9sbGJhciBh cmVhCisgICAgICAgICBleGNlcHQgZm9yIGhlYWRlciBsaW5lIGFuZCBtb2RlIGxpbmUuICovCisg ICAgICBpZiAoeCA8IGxlZnRfeCAmJiAhcy0+cm93LT5tb2RlX2xpbmVfcCkKKyAgICAgICAgewor ICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0gbGVmdF94IC0geDsKKyAgICAgICAgICB4ID0g bGVmdF94OworICAgICAgICB9CisgICAgICBpZiAoYmFja2dyb3VuZF93aWR0aCA+IDApCisgICAg ICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwgcy0+eSwgYmFja2dyb3VuZF93 aWR0aCwgcy0+aGVpZ2h0KTsKKyAgICB9CisgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVl OworfQorCisvKiBEcmF3IGdseXBoIHN0cmluZyBTLiAqLworc3RhdGljIHZvaWQKK21jX3hfZHJh d19nbHlwaF9zdHJpbmcgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIHN0cnVjdCBnbHlwaF9tYXRy aXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICAgICAg ICAgc3RydWN0IG1jX1JHQiBsc2wsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwKKyAgICAg ICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUsIGludCBj dXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wLCBib29s IGN1cnNvcl9nY19wKQoreworICBib29sIHJlbGllZl9kcmF3bl9wID0gZmFsc2U7CisgIC8qIElm IFMgZHJhd3MgaW50byB0aGUgYmFja2dyb3VuZCBvZiBpdHMgc3VjY2Vzc29ycywgZHJhdyB0aGUK KyAgICAgYmFja2dyb3VuZCBvZiB0aGUgc3VjY2Vzc29ycyBmaXJzdCBzbyB0aGF0IFMgY2FuIGRy YXcgaW50byBpdC4KKyAgICAgVGhpcyBtYWtlcyBTLT5uZXh0IHVzZSBYRHJhd1N0cmluZyBpbnN0 ZWFkIG9mIFhEcmF3SW1hZ2VTdHJpbmcuICovCisgIGlmIChzLT5uZXh0ICYmIHMtPnJpZ2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X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIHRy dWUpOworICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7 CisgICAgICBicmVhazsKKyAgICBjYXNlIEdMWVBITEVTU19HTFlQSDoKKyAgICAgIGlmIChzLT5m b3Jfb3ZlcmxhcHMpCisgICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAg ICAgZWxzZQorICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIHRydWUp OworICAgICAgeF9kcmF3X2dseXBobGVzc19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7Cisg ICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgICAgfQor ICBpZiAoIXMtPmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICAvKiBEcmF3IHVuZGVybGluZS4g Ki8KKyAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfcCkKKyAgICAgICAgeworICAgICAgICAg IGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX1dBVkUpCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3Ap CisgICAgICAgICAgICAgICAgeF9kcmF3X3VuZGVyd2F2ZSAocyk7CisgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBYR0NWYWx1ZXMgeGdjdjsK KyAgICAgICAgICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwg cy0+Z2MsIEdDRm9yZWdyb3VuZCwgJnhnY3YpOworICAgICAgICAgICAgICAgICAgWFNldEZvcmVn cm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCBzLT5mYWNlLT51bmRlcmxpbmVf Y29sb3IpOworICAgICAgICAgICAgICAgICAgeF9kcmF3X3VuZGVyd2F2ZSAocyk7CisgICAgICAg ICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgcy0+Z2Ms IHhnY3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAg ICAgICAgIGVsc2UgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElO RSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgdW5zaWduZWQgbG9uZyB0aGlja25lc3Ms IHBvc2l0aW9uOworICAgICAgICAgICAgICBpbnQgeTsKKyAgICAgICAgICAgICAgaWYgKHMtPnBy ZXYgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3AKKyAgICAgICAgICAgICAgICAgICYmIHMt PnByZXYtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBXZSB1c2UgdGhlIHNhbWUgdW5kZXJsaW5l IHN0eWxlIGFzIHRoZSBwcmV2aW91cyBvbmUuICovCisgICAgICAgICAgICAgICAgICB0aGlja25l c3MgPSBzLT5wcmV2LT51bmRlcmxpbmVfdGhpY2tuZXNzOworICAgICAgICAgICAgICAgICAgcG9z aXRpb24gPSBzLT5wcmV2LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg LyogR2V0IHRoZSB1bmRlcmxpbmUgdGhpY2tuZXNzLiAgRGVmYXVsdCBpcyAxIHBpeGVsLiAqLwor ICAgICAgICAgICAgICAgICAgaWYgKHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNr bmVzcyA+IDApCisgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPmZvbnQtPnVuZGVy bGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg ICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAgICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRf ZGVzY2VudF9saW5lKQorICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQg LSB0aGlja25lc3MpIC0gKHMtPnliYXNlIC0gcy0+eSk7CisgICAgICAgICAgICAgICAgICBlbHNl CisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhl IHVuZGVybGluZSBwb3NpdGlvbi4gIFRoaXMgaXMgdGhlIHJlY29tbWVuZGVkCisgICAgICAgICAg ICAgICAgICAgICAgICAgdmVydGljYWwgb2Zmc2V0IGluIHBpeGVscyBmcm9tIHRoZSBiYXNlbGlu ZSB0byB0aGUgdG9wIG9mCisgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIHVuZGVybGluZS4g IFRoaXMgaXMgYSBzaWduZWQgdmFsdWUgYWNjb3JkaW5nIHRvIHRoZQorICAgICAgICAgICAgICAg ICAgICAgICAgIHNwZWNzLCBhbmQgaXRzIGRlZmF1bHQgaXMKKyAgICAgICAgICAgICAgICAgICAg ICAgICBST1VORCAoKG1heGltdW0gZGVzY2VudCkgLyAyKSwgd2l0aAorICAgICAgICAgICAgICAg ICAgICAgICAgIFJPVU5EKHgpID0gZmxvb3IgKHggKyAwLjUpICAqLworICAgICAgICAgICAgICAg ICAgICAgIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGllcworICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlv biA+PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5mb250LT51bmRl cmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocy0+Zm9udCkK KyAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmZvbnQtPmRlc2NlbnQgKyAx KSAvIDI7CisgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAg ICAgcG9zaXRpb24gPSB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQ7CisgICAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbWF4IChwb3NpdGlvbiwgdW5kZXJs aW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIC8q IENoZWNrIHRoZSBzYW5pdHkgb2YgdGhpY2tuZXNzIGFuZCBwb3NpdGlvbi4gIFdlIHNob3VsZAor ICAgICAgICAgICAgICAgICBhdm9pZCBkcmF3aW5nIHVuZGVybGluZSBvdXQgb2YgdGhlIGN1cnJl bnQgbGluZSBhcmVhLiAqLworICAgICAgICAgICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8PSBz LT55YmFzZSArIHBvc2l0aW9uKQorICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdo dCAtIDEpIC0gKHMtPnliYXNlIC0gcy0+eSk7CisgICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+ aGVpZ2h0IDwgcy0+eWJhc2UgKyBwb3NpdGlvbiArIHRoaWNrbmVzcykKKyAgICAgICAgICAgICAg ICB0aGlja25lc3MgPSAocy0+eSArIHMtPmhlaWdodCkgLSAocy0+eWJhc2UgKyBwb3NpdGlvbik7 CisgICAgICAgICAgICAgIHMtPnVuZGVybGluZV90aGlja25lc3MgPSB0aGlja25lc3M7CisgICAg ICAgICAgICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9IHBvc2l0aW9uOworICAgICAgICAgICAg ICB5ID0gcy0+eWJhc2UgKyBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVu ZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChz LT5mLCBzLT5nYywgcy0+eCwgeSwgcy0+d2lkdGgsIHRoaWNrbmVzcyk7CisgICAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBYR0NWYWx1ZXMgeGdj djsKKyAgICAgICAgICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAoRlJBTUVfWF9ESVNQTEFZIChzLT5m KSwgcy0+Z2MsIEdDRm9yZWdyb3VuZCwgJnhnY3YpOworICAgICAgICAgICAgICAgICAgWFNldEZv cmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCBzLT5mYWNlLT51bmRlcmxp bmVfY29sb3IpOworICAgICAgICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAocy0+Ziwgcy0+ Z2MsIHMtPngsIHksIHMtPndpZHRoLCB0aGlja25lc3MpOworICAgICAgICAgICAgICAgICAgWFNl dEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCB4Z2N2LmZvcmVncm91 bmQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAg LyogRHJhdyBvdmVybGluZS4gKi8KKyAgICAgIGlmIChzLT5mYWNlLT5vdmVybGluZV9wKQorICAg ICAgICB7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBkeSA9IDAsIGggPSAxOworICAgICAgICAg IGlmIChzLT5mYWNlLT5vdmVybGluZV9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIHhf ZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBzLT55ICsgZHksIHMtPndpZHRoLCBo KTsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIFhHQ1ZhbHVl cyB4Z2N2OworICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKEZSQU1FX1hfRElTUExBWSAocy0+ ZiksIHMtPmdjLCBHQ0ZvcmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAgWFNldEZvcmVn cm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCBzLT5mYWNlLT5vdmVybGluZV9j b2xvcik7CisgICAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54 LCBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQg KEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAg ICAgICAgfQorICAgICAgICB9CisgICAgICAvKiBEcmF3IHN0cmlrZS10aHJvdWdoLiAqLworICAg ICAgaWYgKHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX3ApCisgICAgICAgIHsKKyAgICAgICAgICB1 bnNpZ25lZCBsb25nIGggPSAxOworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAocy0+aGVp Z2h0IC0gaCkgLyAyOworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xv cl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdj LCBzLT54LCBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICBlbHNlCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAgICAgICBYR2V0 R0NWYWx1ZXMgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCBHQ0ZvcmVncm91bmQsICZ4 Z2N2KTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ ZiksIHMtPmdjLCBzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvcik7CisgICAgICAgICAgICAg IHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBzLT55ICsgZHksIHMtPndpZHRo LCBoKTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ ZiksIHMtPmdjLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgICAvKiBEcmF3IHJlbGllZiBpZiBub3QgeWV0IGRyYXduLiAqLworICAgICAgaWYgKCFyZWxp ZWZfZHJhd25fcCAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisgICAgICAgICAgeF9k cmF3X2dseXBoX3N0cmluZ19ib3ggKHMpOworICAgICAgaWYgKHMtPnByZXYpCisgICAgICAgIHsK KyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpwcmV2OworICAgICAgICAgIGZvciAocHJl diA9IHMtPnByZXY7IHByZXY7IHByZXYgPSBwcmV2LT5wcmV2KQorICAgICAgICAgICAgaWYgKHBy ZXYtPmhsICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYgcHJldi0+eCArIHByZXYtPndpZHRo ICsgcHJldi0+cmlnaHRfb3ZlcmhhbmcgPiBzLT54KQorICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgLyogQXMgcHJldiB3YXMgZHJhd24gd2hpbGUgY2xpcHBlZCB0byBpdHMgb3duIGFy ZWEsIHdlCisgICAgICAgICAgICAgICAgICAgbXVzdCBkcmF3IHRoZSByaWdodF9vdmVyaGFuZyBw YXJ0IHVzaW5nIHMtPmhsIG5vdy4gKi8KKyAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhz X2ZhY2Ugc2F2ZSA9IHByZXYtPmhsOworICAgICAgICAgICAgICAgIHByZXYtPmhsID0gcy0+aGw7 CisgICAgICAgICAgICAgICAgbWNfeF9zZXRfZ2x5cGhfc3RyaW5nX2djIChwcmV2LCBjdXJzb3Jf Z2NfcCk7CisgICAgICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nX2V4YWN0 bHkgKHMsIHByZXYpOworICAgICAgICAgICAgICAgIGlmIChwcmV2LT5maXJzdF9nbHlwaC0+dHlw ZSA9PSBDSEFSX0dMWVBIKQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19m b3JlZ3JvdW5kIChwcmV2KTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg ICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChwcmV2KTsKKyAgICAg ICAgICAgICAgICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAocHJldi0+ZiwgcHJldi0+Z2MpOwor ICAgICAgICAgICAgICAgIHByZXYtPmhsID0gc2F2ZTsKKyAgICAgICAgICAgICAgICBwcmV2LT5u dW1fY2xpcHMgPSAwOworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlmIChzLT5u ZXh0KQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqbmV4dDsKKyAg ICAgICAgICBmb3IgKG5leHQgPSBzLT5uZXh0OyBuZXh0OyBuZXh0ID0gbmV4dC0+bmV4dCkKKyAg ICAgICAgICAgIGlmIChuZXh0LT5obCAhPSBzLT5obAorICAgICAgICAgICAgICAgICYmIG5leHQt PnggLSBuZXh0LT5sZWZ0X292ZXJoYW5nIDwgcy0+eCArIHMtPndpZHRoKQorICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgLyogQXMgbmV4dCB3aWxsIGJlIGRyYXduIHdoaWxlIGNsaXBw ZWQgdG8gaXRzIG93biBhcmVhLAorICAgICAgICAgICAgICAgICAgIHdlIG11c3QgZHJhdyB0aGUg bGVmdF9vdmVyaGFuZyBwYXJ0IHVzaW5nIHMtPmhsIG5vdy4gKi8KKyAgICAgICAgICAgICAgICBl bnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9IG5leHQtPmhsOworICAgICAgICAgICAgICAgIG5l eHQtPmhsID0gcy0+aGw7CisgICAgICAgICAgICAgICAgbWNfeF9zZXRfZ2x5cGhfc3RyaW5nX2dj IChuZXh0LCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5n X2NsaXBwaW5nX2V4YWN0bHkgKHMsIG5leHQpOworICAgICAgICAgICAgICAgIGlmIChuZXh0LT5m aXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBIKQorICAgICAgICAgICAgICAgICAgeF9kcmF3 X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChuZXh0KTsKKyAgICAgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5k IChuZXh0KTsKKyAgICAgICAgICAgICAgICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAobmV4dC0+ ZiwgbmV4dC0+Z2MpOworICAgICAgICAgICAgICAgIG5leHQtPmhsID0gc2F2ZTsKKyAgICAgICAg ICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgICAgICAgIG5leHQtPmNsaXBf aGVhZCA9IHMtPm5leHQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgLyog UmVzZXQgY2xpcHBpbmcuICovCisgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChzLT5mLCBzLT5n Yyk7CisgIHMtPm51bV9jbGlwcyA9IDA7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICov CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBEZWZhdWx0IHRvIHVzaW5nIFhJTSBp ZiBhdmFpbGFibGUuICAqLwogI2lmZGVmIFVTRV9YSU0KIGJvb2wgdXNlX3hpbSA9IHRydWU7CkBA IC0xMTA5LDYgKzIwMDcsMTYgQEAgc3RhdGljIHZvaWQKIHhfdXBkYXRlX2JlZ2luIChzdHJ1Y3Qg ZnJhbWUgKmYpCiB7CiAgIC8qIE5vdGhpbmcgdG8gZG8uICAqLworCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2Zy YW1lID0gZjsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAvKiBEcmF3IGEg dmVydGljYWwgd2luZG93IGJvcmRlciBmcm9tICh4LHkwKSB0byAoeCx5MSkgICovCkBAIC0xMjU0 LDYgKzIxNjIsMTYgQEAgeF91cGRhdGVfZW5kIChzdHJ1Y3QgZnJhbWUgKmYpCiAgIFhGbHVzaCAo RlJBTUVfWF9ESVNQTEFZIChmKSk7CiAgIHVuYmxvY2tfaW5wdXQgKCk7CiAjZW5kaWYKKworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5t Y191cGRhdGluZ19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IH0KIAogLyogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgZnJvbSB2YXJpb3VzIHBsYWNlcyBpbiB4 ZGlzcC5jCkBAIC0xMzIzOCw2ICsxNDE1NiwyMCBAQCBleHRlcm4gZnJhbWVfcGFybV9oYW5kbGVy IHhfZnJhbWVfcGFybV9oYW5kbGVyc1tdOwogCiBzdGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRl cmZhY2UgeF9yZWRpc3BsYXlfaW50ZXJmYWNlID0KICAgeworCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBgcmVkaXNwbGF5X2ludGVyZmFj ZScgaW4gYHh0ZXJtLmNgIG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitg cmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfeF9kcmF3 X3dpbmRvd19jdXJzb3IsCisgIG1jX3hfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICAgICB4X2ZyYW1lX3Bhcm1faGFuZGxlcnMsCiAgICAgZ3VpX3By b2R1Y2VfZ2x5cGhzLAogICAgIGd1aV93cml0ZV9nbHlwaHMsCg== --Multipart_Thu_Aug_22_22:19:53_2019-1--