From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.bugs Subject: bug#17684: #22873 (multiple fake cursors); and, #17684 (crosshairs). Date: Sat, 29 Jun 2019 22:42:10 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sat_Jun_29_22:42:10_2019-1" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="194346"; mail-complaints-to="usenet@blaine.gmane.org" Cc: johnw@gnu.org, mbork@mbork.pl, rms@gnu.org, akioburns@icloud.com To: 22873@debbugs.gnu.org,17684@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 30 07:43:48 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 1hhScs-000HSa-SO for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Jun 2019 07:43:48 +0200 Original-Received: from localhost ([::1]:43078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hhScr-00070o-55 for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Jun 2019 01:43:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35872) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hhScE-00070X-IJ for bug-gnu-emacs@gnu.org; Sun, 30 Jun 2019 01:43:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hhScC-00082O-7q for bug-gnu-emacs@gnu.org; Sun, 30 Jun 2019 01:43:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59933) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hhScA-00080f-Os for bug-gnu-emacs@gnu.org; Sun, 30 Jun 2019 01:43:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hhScA-0004Lv-HI for bug-gnu-emacs@gnu.org; Sun, 30 Jun 2019 01:43:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Keith David Bershatsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Jun 2019 05:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17684 X-GNU-PR-Package: emacs Original-Received: via spool by 17684-submit@debbugs.gnu.org id=B17684.156187333916671 (code B ref 17684); Sun, 30 Jun 2019 05:43:02 +0000 Original-Received: (at 17684) by debbugs.gnu.org; 30 Jun 2019 05:42:19 +0000 Original-Received: from localhost ([127.0.0.1]:45244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hhSbS-0004Ko-UC for submit@debbugs.gnu.org; Sun, 30 Jun 2019 01:42:19 -0400 Original-Received: from gateway34.websitewelcome.com ([192.185.148.222]:36360) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hhSbQ-0004KZ-I7 for 17684@debbugs.gnu.org; Sun, 30 Jun 2019 01:42:17 -0400 Original-Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway34.websitewelcome.com (Postfix) with ESMTP id F1223EBF174 for <17684@debbugs.gnu.org>; Sun, 30 Jun 2019 00:42:15 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id hSbPhfTT5iQerhSbPhA8Lk; Sun, 30 Jun 2019 00:42:15 -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=afngZaUX0wcFQEsRkU6LIPE0DTtlWWO3YSgqdGO+IW0=; b=lGrVEJZxfX5hVkDWOT56yf1ivE sD3TUyRrVEbQOfvPxgRE6WEPNdmeyAKwZbaPcstl7nTsuKYb6rk6zfRr/0HaXrHLcXchn84KisWfK bQWOUSO824CSg5qtoHNVuzCgROF94OeDl064g4itYZ3KJjOov4iajSoXRtsdST1DGvL+Xk0bLvHDO ILd5FV2if9BaEzs1nxY0SfJByE9QASo3KPHn+QECxmXFB99bz6IuYTmkUVb2s9csoiR/OtT1L2Snz wS+T1boptync7gFtcpG1KP4867Lko+dx36NeY7A9JrGm2ogD8QbFK1DYkEHhNzLPiJgzJrdjxMPzA relbw6yg==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:54194 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hhSbL-003tZj-I8; Sun, 30 Jun 2019 00:42:14 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1hhSbL-003tZj-I8 X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:54194 X-Source-Auth: lawlist X-Email-Count: 6 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:173297 --Multipart_Sat_Jun_29_22:42:10_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 021.004 [06/29/2019] CHANGELOG: - Fake cursors can now be suppressed in the inactive windows by setting to `nil' the buffer-local variables `mc-inactive-windows', `fc-inactive-windows', and/or `ch-inactive-windows'. The left fringe bitmap indicator that coincides with the line containing POINT (if `ch-horizontal-ruler' is non-nil) is drawn in the inactive windows regardless of the boolean value of `ch-inactive-windows' -- this is an intended feature. The real fake cursor coinciding with the line containing POINT for inactive windows is drawn in the inactive windows -- this is an intended feature. [Support for _suppression_ of fake cursors in the inactive windows had previously been disabled for an appreciable period of time because work needed to be done to ensure fake cursors are drawn correctly when `mc/fc/ch-inactive-windows' is non-nil; e.g., different colors for fake cursors in the inactive-windows.] - Miscellaneous tidying-up of some code. SCREENSHOTS (X11, W32, NS): https://www.lawlist.com/images/22873_17684_light_dark_backgrounds.png SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 04/08/2019: git reset --hard a038df77de7b1aa2d73a6478493b8838b59e4982 Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed")))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out both the crosshairs feature and the visible fill column indicator feature, type: M-x +-mode - To try out just the visible fill column indicator feature, type: M-x fc-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, that package must be installed. If the multiple-cursors package is already installed, then just (require 'crosshairs) and `crosshairs.el` will redefine a few of the multiple-cursors functions and set up a few keyboard shortcuts. If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors) (mc/built-in-cursors)) TODO: - 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. - `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.] - NOTE: As to `mc_scrolling_window', it would appear that there is no tangible benefit to rotating the current/prospective cache of fake cursors to compare the data before removing the fake cursors. When scrolling the display, only _some_ lines are copied to new locations. Areas that are not overwritten may have fake cursors and those may not necessarily be removed if desired/current matrix glyphs are equal. The test for `GLYPH_EQUAL_P' does not take into consideration the existence of a fake cursor, and the glyph (with a fake cursor) may not be updated as a result thereof. As to lines that are not copied, portions may be updated and fake cursors would be removed thereby. --Multipart_Sat_Jun_29_22:42:10_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_06_29__20_23_09_354.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi43ODI3NTJmCi0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI4OCBAQAorOzs7Ozs7Ozs7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lLWN1 cnNvcnMtbW9kZSAwKQorICAgICAgICAod2hlbiB0aGlzLW9yaWdpbmFsLWNvbW1hbmQKKyAgICAg ICAgICAobGV0ICgob3JpZ2luYWwtY29tbWFuZCAob3IgbWMtLXRoaXMtY29tbWFuZAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29tbWFuZC1yZW1hcHBpbmcgdGhpcy1v cmlnaW5hbC1jb21tYW5kKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0 aGlzLW9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgIDs7IHNraXAga2V5Ym9hcmQgbWFj cm9zLCBzaW5jZSB0aGV5IHdpbGwgZ2VuZXJhdGUgYWN0dWFsIGNvbW1hbmRzIHRoYXQgYXJlCisg ICAgICAgICAgICA7OyBhbHNvIHJ1biBpbiB0aGUgY29tbWFuZCBsb29wIC0gd2UnbGwgaGFuZGxl IHRob3NlIGxhdGVyIGluc3RlYWQuCisgICAgICAgICAgICAod2hlbiAoZnVuY3Rpb25wIG9yaWdp bmFsLWNvbW1hbmQpCisgICAgICAgICAgICAgIDs7IGlmIGl0J3MgYSBsYW1iZGEsIHdlIGNhbid0 IGtub3cgaWYgaXQncyBzdXBwb3J0ZWQgb3Igbm90CisgICAgICAgICAgICAgIDs7IC0gc28gZ28g YWhlYWQgYW5kIGFzc3VtZSBpdCdzIG9rLCBiZWNhdXNlIHdlJ3JlIGp1c3Qgb3B0aW1pc3RpYyBs aWtlIHRoYXQKKyAgICAgICAgICAgICAgKGlmIChvciAobm90IChzeW1ib2xwIG9yaWdpbmFsLWNv bW1hbmQpKQorICAgICAgICAgICAgICAgICAgICAgIDs7IGxhbWJkYSByZWdpc3RlcmVkIGJ5IHNt YXJ0cmVwCisgICAgICAgICAgICAgICAgICAgICAgKHN0cmluZy1wcmVmaXgtcCAiKCIgKHN5bWJv bC1uYW1lIG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgICAgICAgIChtYy9leGVjdXRl LWNvbW1hbmQtZm9yLWFsbC1mYWtlLWN1cnNvcnMgb3JpZ2luYWwtY29tbWFuZCkKKyAgICAgICAg ICAgICAgICA7OyBzbWFydHJlcCBgaW50ZXJuJ3MgY29tbWFuZHMgaW50byBvd24gb2JhcnJheSB0 byBoZWxwCisgICAgICAgICAgICAgICAgOzsgYGRlc2NyaWJlLWJpbmRpbmdzJy4gIFNvLCBsZXQn cyByZS1gaW50ZXJuJyBoZXJlIHRvCisgICAgICAgICAgICAgICAgOzsgbWFrZSB0aGUgY29tbWFu ZCBjb21wYXJhYmxlIGJ5IGBlcScuCisgICAgICAgICAgICAgICAgKHNldHEgb3JpZ2luYWwtY29t bWFuZCAoaW50ZXJuIChzeW1ib2wtbmFtZSBvcmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAgICAg ICAgICAgOzsgb3RoZXJ3aXNlIGl0J3MgYSBzeW1ib2wsIGFuZCB3ZSBjYW4gYmUgbW9yZSB0aG9y b3VnaAorICAgICAgICAgICAgICAgIChpZiAoZ2V0IG9yaWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1 cHBvcnRlZCkKKyAgICAgICAgICAgICAgICAgICAgKG1lc3NhZ2UgIiVTIGlzIG5vdCBzdXBwb3J0 ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4g KGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3Qg KG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1j L2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMv YWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2Nt ZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMv cHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29y cyBvcmlnaW5hbC1jb21tYW5kKSkpKQorICAgICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQt aW4tY3Vyc29ycworICAgICAgICAgICAgICAgIChzZXRxIG1jLWNvbmYKKyAgICAgICAgICAgICAg ICAgICAgICAgIChtYXBjYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoeCkg KGxpc3QgKG92ZXJsYXktc3RhcnQgeCkgImJhciIgbmlsKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgKG1jL2FsbC1mYWtlLWN1cnNvcnMpKSkpKSkpKSkpCisKKyAgKGRlZnVuIG1jL21hcmst bmV4dC1saWtlLXRoaXMtY3ljbGUtZm9yd2FyZCAoKQorICAiTWFya3MgbmV4dCBvY2N1cmVuY2Ug b2Ygd29yZCBsaWtlIHRoaXMgYW5kIGFkdmFuY2VzIGN1cnNvciB0byB0aGlzIG9jY3VycmVuY2Ui CisgIChpbnRlcmFjdGl2ZSkKKyAgICAob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IiICJwdXJwbGUiKQorICAg ICAgICAgICAgICAgICAgICAgICgzICJib3giICIjMDBGRjAwIikKKyAgICAgICAgICAgICAgICAg ICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAgICAgKDUgKCJo YmFyIiAzKSBbMS4wIDAuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAz KSBbMC4wIDEuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFu Z2VSZWQiKQorICAgICAgICAgICAgICAgICAgICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAg ICAgICAgICAgICAgICAgICg5ICJib3giICJncmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93 IChkaXNwbGF5LWJ1ZmZlciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2lu Y2UgdGhpcyBmaXJlcyBnbG9iYWxseSwgd2UgbXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jv c3NoYWlycyBhcHBlYXIgaW4uIgorICAod2hlbiArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVt cSBsYXN0LWNvbW1hbmQgKy1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVs bCArLXBhcmVucy1wKSkKKyAgICAgICgrLXBhcmVucy1mbikpCisgICAgKHdoZW4gKy10aW1lci12 YXIKKyAgICAgIChzZXRxIHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1p ZGxlLWxpc3QpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkpKQorCisoZGVmdW4gKy1k cmF3LWZvcnRod2l0aCAoKQorIkltbWVkaWF0ZWx5IGRlbGV0ZS9kcmF3IG1hdGNoaW5nIHBhcmVu dGhlc2VzLiIKKyAgKCstZHJhdy1jcm9zc2hhaXJzICdmb3JjZSkpCisKKyhkZWZ1biArLWRyYXct Y3Jvc3NoYWlycyAoJm9wdGlvbmFsIGZvcmNlKQorIkltbWVkaWF0ZWx5IGRlbGV0ZSBtYXRjaGlu ZyBwYXJlbnRoZXNlcy4gIElmIEZPUkNFIGlzIG5vbi1uaWwsIHRoZW4gaW1tZWRpYXRlbHkKK2Ry YXcgbWF0Y2hpbmcgcGFyZW50aGVzaXM7IG90aGVyd2lzZSwgZHJhdyB0aGVtIG9uIGFuIGlkbGUt dGllci4iCisgICh3aGVuICstbW9kZQorICAgICh3aGVuICstdGltZXItdmFyCisgICAgICAoc2V0 cSB0aW1lci1pZGxlLWxpc3QgKGRlbHEgKy10aW1lci12YXIgdGltZXItaWRsZS1saXN0KSkKKyAg ICAgIChzZXRxICstdGltZXItdmFyIG5pbCkpCisgICAgKHVubGVzcyAob3IgKG1lbXEgdGhpcy1j b21tYW5kICstcGFyZW5zLWV4Y2x1c2lvbnMpCisgICAgICAgICAgICAgICAgKGFuZCAobnVsbCAr LXBhcmVucy1wKQorICAgICAgICAgICAgICAgICAgICAgKG51bGwgKy1wYXJlbnMtb3ZlcmxheXMt ZXhpc3QtcCkpKQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZv cmNlCisgICAgICAocHJvZ24KKyAgICAgICAgKHdoZW4gKy1wYXJlbnMtcAorICAgICAgICAgICgr LXBhcmVucy1mbikpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGlt ZXIgKy1pZGxlLXRpbWVyLXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKyhkZWZ2YXIg ZmMtbW9kZSkKKworOzs7IyMjYXV0b2xvYWQKKyhkZWZpbmUtbWlub3ItbW9kZSArLW1vZGUKKyJN aW5vciBtb2RlIGZvciBkaXNwbGF5aW5nIGEgaG9yaXpvbnRhbCBydWxlci4iCisgIDppbml0LXZh bHVlIG5pbAorICA6bGlnaHRlciAiICsiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisg IDpncm91cCAnKy1tb2RlCisgIChjb25kCisgICAgKCstbW9kZQorICAgICAgOzs7IGArLW1vZGUn IGhhcyB0aGUgYWJpbGl0eSB0byBhbHNvIGRpc3BsYXkgYSBmaWxsIGNvbHVtbiBpbmRpY2F0b3Iu CisgICAgICA7OzsgU2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuCisgICAgICAod2hl biBmYy1tb2RlCisgICAgICAgIChmYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFs LWVsZG9jLW1vZGUKKyAgICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2Fu eSkKKyAgICAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAg ICAgICAgKGdsb2JhbC1lbGRvYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2st Y29udGV4dC10aW1lcgorICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAn YW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQor ICAgICAgICAod2hlbiAodGltZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAg KGNhbmNlbC10aW1lciBqaXQtbG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEg aml0LWxvY2stY29udGV4dC10aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAn aml0LWxvY2stY29udGV4dC1mb250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4 dC10aW1lciBuaWwpKQorICAgICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAn YW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQor ICAgICAgICAod2hlbiAodGltZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQor ICAgICAgICAgIChjYW5jZWwtdGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIp KQorICAgICAgICAoZnNldCAndW5kby1hdXRvLS11bmRvYWJsZS1jaGFuZ2UKKyAgICAgICAgICAg ICAgKGxhbWJkYSAoKSAoYWRkLXRvLWxpc3QgJ3VuZG8tYXV0by0tdW5kb2FibHktY2hhbmdlZC1i dWZmZXJzIChjdXJyZW50LWJ1ZmZlcikpKSkKKyAgICAgICAgKGZzZXQgJ3VuZG8tYXV0by1hbWFs Z2FtYXRlICdpZ25vcmUpKQorICAgICAgKHdoZW4gYmxpbmstY3Vyc29yLW1vZGUKKyAgICAgICAg KGJsaW5rLWN1cnNvci1tb2RlIC0xKQorICAgICAgICAod2hlbiAobWVtcSAnYmxpbmstY3Vyc29y LWNoZWNrIHBvc3QtY29tbWFuZC1ob29rKQorICAgICAgICAgIChyZW1vdmUtaG9vayAncG9zdC1j b21tYW5kLWhvb2sgJ2JsaW5rLWN1cnNvci1jaGVjaykpKQorICAgICAgKHNldHEgY3Jvc3NoYWly cyB0KQorICAgICAgKHdoZW4gKy1maWxsLWNvbHVtbgorICAgICAgICAoc2V0cSBmYy12aXNpYmxl IHQpKQorICAgICAgOzs7IGBhdXRvLWNvbXBvc2l0aW9uLW1vZGUnIGlzIG5lZWRlZCBmb3IgY3Jv c3NoYWlycyB0byBwcm9wZXJseSBjYWxjdWxhdGUKKyAgICAgIDs7OyBjb29yZGluYXRlcyBvZiBj b21wb3NpdGlvbiBjaGFyYWN0ZXJzLiAgQXV0b21hdGljYWxseSBiZWNvbWVzIHBlcm1hbmVudGx5 CisgICAgICA7OzsgYnVmZmVyLWxvY2FsIHdoZW4gc2V0LgorICAgICAgKHVubGVzcyBhdXRvLWNv bXBvc2l0aW9uLW1vZGUKKyAgICA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g ICAgIChwdXNoIChjb25zIHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICstLXNhdmVkLXN0YXRlKSkp CisgICAgICAoc2V0cSBmaWxsLWNvbHVtbiA4MCkKKyAgICAgIChzZXRxIGRpc3BsYXktbGluZS1u dW1iZXJzIHQpCisgICAgICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1s aW5lKQorICAgICAgKHNldHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAoc2V0cSBidWZm ZXItZGlzcGxheS10YWJsZSArLWJ1ZmZlci1kaXNwbGF5LXRhYmxlKQorICAgICAgKHNldHEgdGFi LXdpZHRoIDQpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlz dWFsKSB0KQorICAgICAgKHNldHEgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgKGNvbmQKKyAgICAg ICAgICAoKGxldCAoKGxzdCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisgICAgICAg ICAgICAgICAgICBtb2RlKQorICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAg ICAod2hpbGUgKHNldHEgbW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAgICAgKHdoZW4gKGRl cml2ZWQtbW9kZS1wIG1vZGUpCisgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkp KSkKKyAgICAgICAgICAgKChtZW1xIG1ham9yLW1vZGUgKy10cnVuY2F0ZS1saW5lcy1tYWpvci1t b2RlcykpCisgICAgICAgICAgICh0CisgICAgICAgICAgICAgbmlsKSkpCisgICAgICAoc2V0ICht YWtlLWxvY2FsLXZhcmlhYmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRvd3MpIG5pbCkK KyAgICAgIChzZXRxIHdvcmQtd3JhcCB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGlu ZXMgdCkKKyAgICAgIChzZXRxIGluZGljYXRlLWJ1ZmZlci1ib3VuZGFyaWVzICdsZWZ0KQorICAg ICAgKHNldHEgZnJpbmdlLWluZGljYXRvci1hbGlzdAorICAgICAgICAgIDs7OyBoc2NsX2FsbF90 ZW1wX3AgfCBoc2NsX3RlbXBfcAorICAgICAgICAnKCgrLWhzY2wtdGVtcCAuICgrLXNpbmdsZS1h bmdsZS1sZWZ0CisgICAgICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLWxlZnQp KQorICAgICAgICAgIDs7OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxsX3Blcm1fMV9wIHwg aHNjbF9hbGxfcGVybV8yX3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICgrLWhzY2wtcGVybSAu ICgrLXNpbmdsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1h bmdsZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLXRyaXBsZS1hbmdsZS11cAorICAg ICAgICAgICAgICAgICAgICAgICAgICArLXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAg KCstb3ZlcmxheS1hcnJvdyAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICArLWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAgKHRydW5jYXRp b24gLiAoKy1mcmluZ2UtbGVmdC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICstZnJp bmdlLXJpZ2h0LWFycm93KSkKKyAgICAgICAgICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxl ZnQtY3VybHktYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNoKSkK KyAgICAgICAgICAob3ZlcmxheS1hcnJvdyAuICstZnJpbmdlLXJpZ2h0LXRyaWFuZ2xlKQorICAg ICAgICAgICh1cCAuICstZnJpbmdlLXVwLWFycm93KQorICAgICAgICAgIChkb3duIC4gKy1mcmlu Z2UtZG93bi1hcnJvdykKKyAgICAgICAgICAodG9wIC4gKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUp CisgICAgICAgICAgKGJvdHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAg ICAgICAodG9wLWJvdHRvbSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQKKyAgICAgICAgICAgICAg ICAgICAgICAgICArLWZyaW5nZS1yaWdodC1icmFja2V0CisgICAgICAgICAgICAgICAgICAgICAg ICAgKy1mcmluZ2UtdG9wLXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgKy1m cmluZ2UtdG9wLWxlZnQtYW5nbGUpKQorICAgICAgICAgIChlbXB0eS1saW5lIC4gKy1mcmluZ2Ut ZW1wdHktbGluZSkKKyAgICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmsp KSkKKyAgICAgIChzZXRxIGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94IC4gKy1mcmluZ2UtbGVm dC10cmlhbmdsZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaG9sbG93IC4g Ky1ob2xsb3ctcmVjdGFuZ2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChi YXIgLiArLXZlcnRpY2FsLWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo aGJhciAuICstZnJpbmdlLWhvcml6b250YWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIChob2xsb3ctc21hbGwgLiArLWZyaW5nZS1ob2xsb3ctc3F1YXJlKSkpCisgICAg ICAoaWYgKG9yICstZm9ydGh3aXRoCisgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZp eC1hcmcgJyg0KSkpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJh dy1mb3J0aHdpdGggJ2FwcGVuZCAnbG9jYWwpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21t YW5kLWhvb2sgJystZHJhdy1jcm9zc2hhaXJzICdhcHBlbmQgJ2xvY2FsKSkKKyAgICAgICh3aGVu ICstZm9ydGh3aXRoCisgICAgICAgIChhZGQtaG9vayAnd2luZG93LWNvbmZpZ3VyYXRpb24tY2hh bmdlLWhvb2sgJystZHJhdy1mb3J0aHdpdGggbmlsICdsb2NhbCkpCisgICAgICAoYWRkLWhvb2sg J2NoYW5nZS1tYWpvci1tb2RlLWhvb2sgJ3R1cm4tb2ZmLSstbW9kZSBuaWwgJ2xvY2FsKQorICAg ICAgOzs7IE1hdGNoaW5nIHBhcmVudGhlc2VzIGRyYXdpbmcgZm9ydGh3aXRoIGludGVyZmVyZXMg d2l0aCB5YXNuaXBwZXQuCisgICAgICAod2hlbiArLWZvcnRod2l0aAorICAgICAgICAoc2V0cSAr LXBhcmVucy1wIG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55 KQorICAgICAgICAoY29uZAorICAgICAgICAgICgrLWZvcnRod2l0aAorICAgICAgICAgICAgKG1l c3NhZ2UgIlR1cm5lZCBPTiBgKy1tb2RlJyAtLSBEcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzIGlt bWVkaWF0ZWx5LiIpKQorICAgICAgICAgICgoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkp CisgICAgICAgICAgICA7OzsgTWF0Y2hpbmcgcGFyZW50aGVzZXMgd2lsbCBiZSBkcmF3biBpbW1l ZGlhdGVseS4KKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScgLS0gT3B0 aW1pemVkIGZvciBkZWJ1Z2dpbmcgcHVycG9zZXMuIikpCisgICAgICAgICAgKHQKKyAgICAgICAg ICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScuIikpKSkpCisgICAgKHQKKyAgICAgIChr aWxsLWxvY2FsLXZhcmlhYmxlICdmaWxsLWNvbHVtbikKKyAgICAgIChraWxsLWxvY2FsLXZhcmlh YmxlICdhdXRvLWhzY3JvbGwtbW9kZSkKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdoc2Ny b2xsLXN0ZXApCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnY3Jvc3NoYWlycykKKyAgICAg IChraWxsLWxvY2FsLXZhcmlhYmxlICdmYy12aXNpYmxlKQorICAgICAgKGtpbGwtbG9jYWwtdmFy aWFibGUgJ2Rpc3BsYXktbGluZS1udW1iZXJzKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUg J2Rpc3BsYXktbGluZS1udW1iZXJzLXdpZHRoKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUg J21jLWNvbmYpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnYnVmZmVyLWRpc3BsYXktdGFi bGUpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAndGFiLXdpZHRoKQorICAgICAgKGtpbGwt bG9jYWwtdmFyaWFibGUgJ2xpbmUtbW92ZS12aXN1YWwpCisgICAgICAoa2lsbC1sb2NhbC12YXJp YWJsZSAndHJ1bmNhdGUtbGluZXMpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAndHJ1bmNh dGUtcGFydGlhbC13aWR0aC13aW5kb3dzKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ3dv cmQtd3JhcCkKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdpbmRpY2F0ZS1lbXB0eS1saW5l cykKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdpbmRpY2F0ZS1idWZmZXItYm91bmRhcmll cykKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdmcmluZ2UtaW5kaWNhdG9yLWFsaXN0KQor ICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ2ZyaW5nZS1jdXJzb3ItYWxpc3QpCisgICAgICAo a2lsbC1sb2NhbC12YXJpYWJsZSAnKy1mb3J0aHdpdGgpCisgICAgICAoZG9saXN0IChzYXZlZCAr LS1zYXZlZC1zdGF0ZSkKKyAgICAgICAgKHNldCAobWFrZS1sb2NhbC12YXJpYWJsZSAoY2FyIHNh dmVkKSkgKGNkciBzYXZlZCkpKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJystLXNhdmVk LXN0YXRlKQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykKKyAgICAgICh3aGVuICht ZW1xICcrLWRyYXctZm9ydGh3aXRoIHBvc3QtY29tbWFuZC1ob29rKQorICAgICAgICAocmVtb3Zl LWhvb2sgJ3Bvc3QtY29tbWFuZC1ob29rICcrLWRyYXctZm9ydGh3aXRoICdsb2NhbCkpCisgICAg ICAod2hlbiAobWVtcSAnKy1kcmF3LWNyb3NzaGFpcnMgcG9zdC1jb21tYW5kLWhvb2spCisgICAg ICAgIChyZW1vdmUtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJhdy1jcm9zc2hhaXJzICds b2NhbCkpCisgICAgICAod2hlbiAobWVtcSAnKy1kcmF3LWZvcnRod2l0aCB3aW5kb3ctY29uZmln dXJhdGlvbi1jaGFuZ2UtaG9vaykKKyAgICAgICAgKHJlbW92ZS1ob29rICd3aW5kb3ctY29uZmln dXJhdGlvbi1jaGFuZ2UtaG9vayAnKy1kcmF3LWZvcnRod2l0aCAnbG9jYWwpKQorICAgICAgKHJl bW92ZS1ob29rICdjaGFuZ2UtbWFqb3ItbW9kZS1ob29rICd0dXJuLW9mZi0rLW1vZGUgJ2xvY2Fs KQorICAgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgICAgKHNldHEgdGltZXItaWRsZS1saXN0 IChkZWxxICstdGltZXItdmFyIHRpbWVyLWlkbGUtbGlzdCkpCisgICAgICAgIChzZXRxICstdGlt ZXItdmFyIG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQor ICAgICAgICAobWVzc2FnZSAiVHVybmVkIE9GRiBgKy1tb2RlJy4iKSkpKSkKKworKGRlZnVuIHR1 cm4tb2ZmLSstbW9kZSAoKQorICAoKy1tb2RlIC0xKSkKKworOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7CisKKyhkZWZ1biArLXBhcmVucy1mbiAoKQorICAiRG9jLXN0cmluZy4iCisgIChsZXQqICgo b3BvaW50IChwb2ludCkpCisgICAgICAgICAoZnJvbSAoaWYgKy1wYXJlbnMtZnJvbS1mbgorICAg ICAgICAgICAgICAgICAoZnVuY2FsbCArLXBhcmVucy1mcm9tLWZuKQorICAgICAgICAgICAgICAg ICAocG9pbnQtbWluKSkpCisgICAgICAgICAod2luIChzZWxlY3RlZC13aW5kb3cpKQorICAgICAg ICAgKGkgMCkKKyAgICAgICAgIChwcmVjZWRpbmctY2hhciAocHJlY2VkaW5nLWNoYXIpKQorICAg ICAgICAgKG9jaGFyIChjaGFyLWFmdGVyIG9wb2ludCkpCisgICAgICAgICAocG9zMQorICAgICAg ICAgICAoY29uZAorICAgICAgICAgICAgICgoYW5kIG9jaGFyCisgICAgICAgICAgICAgICAgICAg KG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDApID0+IG9wZW5pbmcgcGFyZW50aGVzaXMKKyAgICAg ICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgNDApCisgICAgICAgICAgICAgICAgICAgICAgIDs7 OyAoY2hhci10by1zdHJpbmcgOTEpID0+IG9wZW5pbmcgc3F1YXJlIGJyYWNrZXQKKyAgICAgICAg ICAgICAgICAgICAgICAgKD0gb2NoYXIgOTEpCisgICAgICAgICAgICAgICAgICAgICAgIDs7OyAo Y2hhci10by1zdHJpbmcgMTIzKSA9PiBvcGVuaW5nIHdhdnkgYnJhY2tldAorICAgICAgICAgICAg ICAgICAgICAgICAoPSBvY2hhciAxMjMpKSkKKyAgICAgICAgICAgICAgICAobWluICgxKyBvcG9p bnQpIChwb2ludC1tYXgpKSkKKyAgICAgICAgICAgICAoKG9yIDs7OyAoY2hhci10by1zdHJpbmcg NDEpID0+IGNsb3NpbmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGlu Zy1jaGFyIDQxKQorICAgICAgICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyA5MykgPT4g Y2xvc2luZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAgICAgICAgKD0gcHJlY2VkaW5nLWNo YXIgOTMpCisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDEyNSkgPT4gY2xv c2luZyB3YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDEy NSkpCisgICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWluKSAoMS0gb3BvaW50KSkpCisgICAg ICAgICAgICAgKHQKKyAgICAgICAgICAgICAgICBvcG9pbnQpKSkKKyAgICAgICAgIHBvczIKKyAg ICAgICAgIHNlbGVjdGVkLWZhY2UpCisgICAgKHNhdmUtZXhjdXJzaW9uCisgICAgICAoY29uZGl0 aW9uLWNhc2UgbmlsCisgICAgICAgICh3aGlsZSAoc2V0cSBwb3MxIChudGggMSAocGFyc2UtcGFy dGlhbC1zZXhwIGZyb20gcG9zMSkpKQorICAgICAgICAgIChzZXRxIHBvczIgKHNjYW4tc2V4cHMg cG9zMSAxKSkKKyAgICAgICAgICAoaWYgKD0gaSAxMCkKKyAgICAgICAgICAgIChzZXRxIGkgMSkK KyAgICAgICAgICAgIChzZXRxIGkgKDErIGkpKSkKKyAgICAgICAgICAoc2V0cSBzZWxlY3RlZC1m YWNlIChjb25kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLW9uZS1mYWNlKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAyKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICcrLXBhcmVucy10d28tZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKCg9IGkgMykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1w YXJlbnMtdGhyZWUtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkg NCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtZm91ci1mYWNl KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA1KQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1maXZlLWZhY2UpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICgoPSBpIDYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJystcGFyZW5zLXNpeC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAoKD0gaSA3KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1z ZXZlbi1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA4KQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1laWdodC1mYWNlKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA5KQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICcrLXBhcmVucy1uaW5lLWZhY2UpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICgoPSBpIDEwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICcrLXBhcmVucy10ZW4tZmFjZSkpKQorICAgICAgICAgIChsZXQgKChvdiAobWFrZS1vdmVybGF5 IHBvczEgKDErIHBvczEpKSkpCisgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZl LXdpbmRvd3MKKyAgICAgICAgICAgICAgKG92ZXJsYXktcHV0IG92ICd3aW5kb3cgd2luKSkKKyAg ICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBzZWxlY3RlZC1mYWNlKSkKKyAgICAgICAg ICAod2hlbiBwb3MyCisgICAgICAgICAgICAobGV0ICgob3YgKG1ha2Utb3ZlcmxheSAoMS0gcG9z MikgcG9zMikpKQorICAgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRv d3MKKyAgICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ3dpbmRvdyB3aW4pKQorICAgICAg ICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0ZWQtZmFjZSkpKSkKKyAgICAgICAg KGVycm9yIG5pbCkpKQorICAgIChzZXRxICstcGFyZW5zLW92ZXJsYXlzLWV4aXN0LXAgdCkpKQor CisoZGVmdW4gKy1yZW1vdmUtb3ZlcmxheXMgKGJlZyBlbmQgbmFtZSB2YWwpCisiUmVtb3ZlIHRo ZSBvdmVybGF5cyB0aGF0IGFyZSBgZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXNgLgorSW5jbHVk ZXMgYSB1bmlxdWUgc2l0dWF0aW9uIHdoZW4gYW4gb3ZlcmxheSB3aXRoIGFuIGAnYWZ0ZXItc3Ry aW5nYCBwcm9wZXJ0eQoraXMgYXQgdGhlIHZlcnkgZW5kIG9mIGEgbmFycm93ZWQtYnVmZmVyLiIK KyAgKGxldCogKChwb2ludC1tYXggKHBvaW50LW1heCkpCisgICAgICAgICAocG9pbnQtbWluIChw b2ludC1taW4pKQorICAgICAgICAgKG5hcnJvd2VkLXAgKGJ1ZmZlci1uYXJyb3dlZC1wKSkKKyAg ICAgICAgIChiZWcgKGlmIGJlZyBiZWcgcG9pbnQtbWluKSkKKyAgICAgICAgIChlbmQKKyAgICAg ICAgICAgKGNvbmQKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5h cnJvd2VkLXApCisgICAgICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAgIGVuZCkKKyAg ICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAg ICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICBwb2ludC1tYXgpCisgICAg ICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAg ICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKDwgZW5kIHBvaW50LW1heCkpCisgICAgICAgICAg ICAgICBlbmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQt cAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKD0gZW5kIHBvaW50LW1h eCkpCisgICAgICAgICAgICAgICAoMSsgZW5kKSkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAg ICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAg ICAgICAgICAgICAoMSsgcG9pbnQtbWF4KSkgKSkKKyAgICAgICAgIChvdmVybGF5cworICAgICAg ICAgICAocHJvZ24KKyAgICAgICAgICAgICAob3ZlcmxheS1yZWNlbnRlciBlbmQpCisgICAgICAg ICAgICAgKG92ZXJsYXlzLWluIGJlZyBlbmQpKSkpCisgICAgKHdoZW4gKGFuZCBiZWcgZW5kIG5h bWUgdmFsKQorICAgICAgKGRvbGlzdCAobyBvdmVybGF5cykKKyAgICAgICAgKGNvbmQKKyAgICAg ICAgICAoKGFuZCAoZXEgbmFtZSAnZmFjZSkKKyAgICAgICAgICAgICAgICAoZXEgKG92ZXJsYXkt Z2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIDs7IEVpdGhlciBwdXNoIHRoaXMgb3Zlcmxh eSBvdXRzaWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsgb3Igc3BsaXQgaXQgdG8gZXhjbHVk ZSBiZWcuLi5lbmQKKyAgICAgICAgICAgIDs7IG9yIGRlbGV0ZSBpdCBlbnRpcmVseSAoaWYgaXQg aXMgY29udGFpbmVkIGluIGJlZy4uLmVuZCkuCisgICAgICAgICAgICAoaWYgKDwgKG92ZXJsYXkt c3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAgIChpZiAoPiAob3ZlcmxheS1lbmQgbykgZW5k KQorICAgICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IChj b3B5LW92ZXJsYXkgbykKKyAgICAgICAgICAgICAgICAgIChvdmVybGF5LXN0YXJ0IG8pIGJlZykK KyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkpCisg ICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gKG92ZXJsYXktc3RhcnQgbykgYmVnKSkK KyAgICAgICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBvKSBlbmQpCisgICAgICAgICAgICAg ICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkKKyAgICAgICAgICAgICAg ICAoZGVsZXRlLW92ZXJsYXkgbykpKSkKKyAgICAgICAgICAoKGFuZCAobm90IChlcSBuYW1lICdm YWNlKSkKKyAgICAgICAgICAgICAgICAoZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXMgKG92ZXJs YXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIChkZWxldGUtb3ZlcmxheS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ZSkKKworKGRlZnZhciBmYy10aW1lci12YXIgbmlsCisiVGltZXIgdXNl ZCB0byBoaWdobGlnaHQgY3VycmVudCBjb2x1bW4gd2hlbmV2ZXIgRW1hY3MgaXMgaWRsZS4iKQor Cis7OzsjIyNhdXRvbG9hZAorKGRlZmluZS1taW5vci1tb2RlIGZjLW1vZGUKKyJNaW5vciBtb2Rl IGZvciBkaXNwbGF5aW5nIGEgdmlzdWFsIGZpbGwgY29sdW1uLiIKKyAgOmluaXQtdmFsdWUgbmls CisgIDpsaWdodGVyICIgRkMiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisgIDpncm91 cCAnZmMtbW9kZQorICAoY29uZAorICAgIDs7OyBgKy1tb2RlJyBoYXMgdGhlIGFiaWxpdHkgdG8g YWxzbyBkaXNwbGF5IGEgZmlsbCBjb2x1bW4gaW5kaWNhdG9yLgorICAgIDs7OyBTZWUgdGhlIHZh cmlhYmxlIGArLWZpbGwtY29sdW1uJy4KKyAgICAoKGFuZCBmYy1tb2RlICstbW9kZSkKKyAgICAg IChzZXRxIGZjLW1vZGUgbmlsKQorICAgICAgKG1lc3NhZ2UgIlR1cm5lZCBPRkYgYGZjLW1vZGUn ICglcykgLS0gc2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuIiAoY3VycmVudC1idWZm ZXIpKSkKKyAgICAoZmMtbW9kZQorICAgICAgKHdoZW4gKGFuZCBnbG9iYWwtZWxkb2MtbW9kZQor ICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAoZ2xvYmFs LWVsZG9jLW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBqaXQtbG9jay1jb250ZXh0LXRpbWVy CisgICAgICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAg ICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVu ICh0aW1lcnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVy IGppdC1sb2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250 ZXh0LXRpbWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250 ZXh0LWZvbnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkp CisgICAgICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAg ICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVu ICh0aW1lcnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNh bmNlbC10aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChm c2V0ICd1bmRvLWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAgICAgICAgICAgICAobGFtYmRhICgp IChhZGQtdG8tbGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1jaGFuZ2VkLWJ1ZmZlcnMgKGN1cnJl bnQtYnVmZmVyKSkpKQorICAgICAgICAoZnNldCAndW5kby1hdXRvLWFtYWxnYW1hdGUgJ2lnbm9y ZSkpCisgICAgICAod2hlbiBibGluay1jdXJzb3ItbW9kZQorICAgICAgICAoYmxpbmstY3Vyc29y LW1vZGUgLTEpCisgICAgICAgICh3aGVuIChtZW1xICdibGluay1jdXJzb3ItY2hlY2sgcG9zdC1j b21tYW5kLWhvb2spCisgICAgICAgICAgKHJlbW92ZS1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAn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ci1wb3N0LXp2LWZhY2UnLiIK KyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICstcmV2ZXJzZWQtYmFyLXByZS16di1mYWNl CisgICcoKHQgKDpmb3JlZ3JvdW5kICJjeWFuMSIpKSkKKyAgIkZhY2UgZm9yIGArLXJldmVyc2Vk LWJhci1wcmUtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1yZXZl cnNlZC1iYXItYXQtenYtZmFjZQorICAnKCh0ICg6Zm9yZWdyb3VuZCAiY2hhcnRyZXVzZSIpKSkK KyAgIkZhY2UgZm9yIGArLXJldmVyc2VkLWJhci1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1t b2RlKQorCisoZGVmZmFjZSArLXJldmVyc2VkLWJhci1wb3N0LXp2LWZhY2UKKyAgJygodCAoOmZv cmVncm91bmQgImN5YW40IikpKQorICAiRmFjZSBmb3IgYCstcmV2ZXJzZWQtYmFyLXBvc3QtenYt ZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1ldmVuLXByZS16di1mYWNl CisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkK KyAgICAgOmZvcmVncm91bmQgInllbGxvdyIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29s b3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJjeWFuMSIpCisg ICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAg ICAgOmZvcmVncm91bmQgInllbGxvdyIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3Jz IDE2KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJjeWFuMSIpCisgICAg KCgoY2xhc3MgY29sb3IpIChtaW4tY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JzIDg4 KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgIkRlZXBQaW5rMSIpCisgICAg KCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAg IDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9y cyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQor ICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQor ICAgICA6Zm9yZWdyb3VuZCAiRGVlcFBpbmsxIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1j b2xvcnMgOCkpCisgICAgIDpmb3JlZ3JvdW5kICJ3aGl0ZSIpCisgICAgKCgodHlwZSB0dHkpIChj bGFzcyBtb25vKSkKKyAgICAgOmludmVyc2UtdmlkZW8gdCkKKyAgICAodCA6Zm9yZWdyb3VuZCAi cGluayIpKQorICAiRmFjZSBmb3IgYCstZXZlbi1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1t b2RlKQorCisoZGVmZmFjZSArLWV2ZW4taW5hY3RpdmUtYXQtenYtZmFjZQorICAnKCgoKGNsYXNz IGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3Jv dW5kICJEZWVwUGluazQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJh Y2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAiRGVlcFBpbms0IikKKyAgICAoKChj bGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5kIGRhcmspKQorICAgICA6Zm9y ZWdyb3VuZCAiRGVlcFBpbms0IikKKyAgICAoKChjbGFzc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AobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQp KQorICAgICA6Zm9yZWdyb3VuZCAiRGFya1NhbG1vbiIpCisgICAgKCgoY2xhc3MgY29sb3IpICht aW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5 KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91 bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGArLW9kZC1wb3N0LXp2LWZhY2UnLiIKKyAgOmdyb3Vw ICcrLW1vZGUpCisKKyhkZWZmYWNlICstb2RkLWluYWN0aXZlLXBvc3QtenYtZmFjZQorICAnKCgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpm b3JlZ3JvdW5kICJzaWVubmE0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgODgp IChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpm b3JlZ3JvdW5kICJzaWVubmE0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYp IChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikK KyAgICAoKCh0eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQor ICAgICh0IDpmb3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBgKy1vZGQtaW5hY3RpdmUt cG9z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orICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGln aHQpKQorICAgICA6Zm9yZWdyb3VuZCAiRGFya09saXZlR3JlZW4iKQorICAgICgoKGNsYXNzIGNv bG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikKKyAgICAoKCh0 eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQorICAgICh0IDpm b3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBgKy1wb3N0LWZpbGwtaW5hY3RpdmUtcG9z dC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSBmYy1wcmUtenYtZmFj ZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykp CisgICAgIDpmb3JlZ3JvdW5kICJncmV5MTUiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNv bG9ycyA4OCkgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAiZ3JleTE1IikK KyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5kIGRhcmspKQor ICAgICA6Zm9yZWdyb3VuZCAiZ3JleTE1IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xv cnMgMTYpIChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgImdyZXkxNSIpCisg ICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hp dGUiKQorICAgICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVv IHQpCisgICAgKHQgOmZvcmVncm91bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9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ZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBiLT5tY19pbmFjdGl2ZV93aW5kb3dzXyA9 IHZhbDsKK30KKworc3RhdGljIHZvaWQKK2JzZXRfY3Jvc3NoYWlycyAoc3RydWN0IGJ1ZmZlciAq YiwgTGlzcF9PYmplY3QgdmFsKQoreworICBiLT5jcm9zc2hhaXJzXyA9IHZhbDsKK30KKworc3Rh dGljIHZvaWQKK2JzZXRfY2hfaG9yaXpvbnRhbF9ydWxlciAoc3RydWN0IGJ1ZmZlciAqYiwgTGlz cF9PYmplY3QgdmFsKQoreworICBiLT5jaF9ob3Jpem9udGFsX3J1bGVyXyA9IHZhbDsKK30KKwor c3RhdGljIHZvaWQKK2JzZXRfY2hfdmVydGljYWxfcnVsZXIgKHN0cnVjdCBidWZmZXIgKmIsIExp c3BfT2JqZWN0IHZhbCkKK3sKKyAgYi0+Y2hfdmVydGljYWxfcnVsZXJfID0gdmFsOworfQorCitz dGF0aWMgdm9pZAorYnNldF9jaF9pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBM aXNwX09iamVjdCB2YWwpCit7CisgIGItPmNoX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQor CitzdGF0aWMgdm9pZAorYnNldF9mY192aXNpYmxlIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09i amVjdCB2YWwpCit7CisgIGItPmZjX3Zpc2libGVfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAor YnNldF9mY19pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2 YWwpCit7CisgIGItPmZjX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCisvKiBlbmQgTVVM VElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogc3RhdGljIHZ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isgIGJzZXRfbWNfaW5h Y3RpdmVfd2luZG93cyAoJmJ1ZmZlcl9kZWZhdWx0cywgUXQpOworICBic2V0X2Nyb3NzaGFpcnMg KCZidWZmZXJfZGVmYXVsdHMsIFFuaWwpOworICBic2V0X2NoX2hvcml6b250YWxfcnVsZXIgKCZi dWZmZXJfZGVmYXVsdHMsIFF0KTsKKyAgYnNldF9jaF92ZXJ0aWNhbF9ydWxlciAoJmJ1ZmZlcl9k ZWZhdWx0cywgUXQpOworICBic2V0X2NoX2luYWN0aXZlX3dpbmRvd3MgKCZidWZmZXJfZGVmYXVs dHMsIFF0KTsKKyAgYnNldF9mY192aXNpYmxlICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKKyAg YnNldF9mY19pbmFjdGl2ZV93aW5kb3dzICgmYnVmZmVyX2RlZmF1bHRzLCBRdCk7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgYnNldF9tb2RlX2xpbmVfZm9ybWF0ICgmYnVmZmVy X2RlZmF1bHRzLCBidWlsZF9wdXJlX2Nfc3RyaW5nICgiJS0iKSk7CiAgIGJzZXRfaGVhZGVyX2xp bmVfZm9ybWF0ICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKICAgYnNldF9hYmJyZXZfbW9kZSAo JmJ1ZmZlcl9kZWZhdWx0cywgUW5pbCk7CkBAIC01NDU4LDYgKzU1NTcsNTEgQEAgZGVmdmFyX3Bl cl9idWZmZXIgKHN0cnVjdCBMaXNwX0J1ZmZlcl9PYmpmd2QgKmJvX2Z3ZCwgY29uc3QgY2hhciAq bmFtZXN0cmluZywKIHZvaWQKIHN5bXNfb2ZfYnVmZmVyICh2b2lkKQogeworCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVM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BidWZmZXIuICAqLwogICBM aXNwX09iamVjdCBleHRyYV9saW5lX3NwYWNpbmdfOwogCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIFRoZSBjdXJzb3IgdHlwZSBvZiB0 aGUgcmVhbCBmYWtlIGN1cnNvci4gKi8KKyAgTGlzcF9PYmplY3QgbWNfcmVhbF9mYWtlX2N1cnNv cl87CisKKyAgLyogVGhlIG5hbWUgb2YgbGlzdCB1c2VkIGJ5IG11bHRpcGxlIGN1cnNvcnMgZm9y IG5leHQgcmVkaXNwbGF5LiAqLworICBMaXNwX09iamVjdCBtY19jb25mXzsKKworICAvKiBXaGV0 aGVyIHRvIGRyYXcgbXVsdGlwbGUgY3Vyc29ycyBpbiBpbmFjdGl2ZSB3aW5kb3dzLiAqLworICBM aXNwX09iamVjdCBtY19pbmFjdGl2ZV93aW5kb3dzXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUg YnVmZmVyLWxvY2FsIHZhcmlhYmxlLiAqLworICBMaXNwX09iamVjdCBjcm9zc2hhaXJzXzsKKwor ICAvKiBUaGUgbmFtZSBvZiB0aGUgY3Jvc3NoYWlycyBob3Jpem9udGFsIHJ1bGVyLiAqLworICBM aXNwX09iamVjdCBjaF9ob3Jpem9udGFsX3J1bGVyXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUg Y3Jvc3NoYWlycyB2ZXJ0aWNhbCBydWxlci4gKi8KKyAgTGlzcF9PYmplY3QgY2hfdmVydGljYWxf cnVsZXJfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBjcm9zc2hhaXJzIGluIGluYWN0aXZlIHdp bmRvd3MuICovCisgIExpc3BfT2JqZWN0IGNoX2luYWN0aXZlX3dpbmRvd3NfOworCisgIC8qIFRo ZSBuYW1lIG9mIHRoZSBidWZmZXItbG9jYWwgdmFyaWFibGUuICovCisgIExpc3BfT2JqZWN0IGZj X3Zpc2libGVfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBtdWx0aXBsZSBjdXJzb3JzIGZpbGwg Y29sdW1uIGluIGluYWN0aXZlIHdpbmRvd3MuICovCisgIExpc3BfT2JqZWN0IGZjX2luYWN0aXZl X3dpbmRvd3NfOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIEN1cnNvciB0 eXBlIHRvIGRpc3BsYXkgaW4gbm9uLXNlbGVjdGVkIHdpbmRvd3MuCiAgICAgIHQgbWVhbnMgdG8g dXNlIGhvbGxvdyBib3ggY3Vyc29yLgogICAgICBTZWUgYGN1cnNvci10eXBlJyBmb3Igb3RoZXIg dmFsdWVzLiAgKi8KQEAgLTc4NywxNCArODIxLDIxIEBAIHN0cnVjdCBidWZmZXIKICAgICAgYW4g aW5kaXJlY3QgYnVmZmVyIHNpbmNlIGl0IGNvdW50cyBhcyBpdHMgYmFzZSBidWZmZXIuICAqLwog ICBpbnQgd2luZG93X2NvdW50OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCiAgIC8qIEEgbm9uLXplcm8gdmFsdWUgaW4gc2xvdCBJRFggbWVh bnMgdGhhdCBwZXItYnVmZmVyIHZhcmlhYmxlCiAgICAgIHdpdGggaW5kZXggSURYIGhhcyBhIGxv Y2FsIHZhbHVlIGluIHRoaXMgYnVmZmVyLiAgVGhlIGluZGV4IElEWAogICAgICBmb3IgYSBidWZm ZXItbG9jYWwgdmFyaWFibGUgaXMgc3RvcmVkIGluIHRoYXQgdmFyaWFibGUncyBzbG90CiAgICAg IGluIGJ1ZmZlcl9sb2NhbF9mbGFncyBhcyBhIExpc3AgaW50ZWdlci4gIElmIHRoZSBpbmRleCBp cyAtMSwKICAgICAgdGhpcyBtZWFucyB0aGUgdmFyaWFibGUgaXMgYWx3YXlzIGxvY2FsIGluIGFs bCBidWZmZXJzLiAgKi8KLSNkZWZpbmUgTUFYX1BFUl9CVUZGRVJfVkFSUyA1MAorI2RlZmluZSBN QVhfUEVSX0JVRkZFUl9WQVJTIDYwCiAgIGNoYXIgbG9jYWxfZmxhZ3NbTUFYX1BFUl9CVUZGRVJf VkFSU107CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogU2V0IHRvIHRoZSBt b2R0aW1lIG9mIHRoZSB2aXNpdGVkIGZpbGUgd2hlbiByZWFkIG9yIHdyaXR0ZW4uCiAgICAgIG1v ZHRpbWUudHZfbnNlYyA9PSBOT05FWElTVEVOVF9NT0RUSU1FX05TRUNTIG1lYW5zCiAgICAgIHZp c2l0ZWQgZmlsZSB3YXMgbm9uZXhpc3RlbnQuICBtb2R0aW1lLnR2X25zZWMgPT0KQEAgLTkwMyw2 ICs5NDQsNjkgQEAgWEJVRkZFUiAoTGlzcF9PYmplY3QgYSkKIC8qIE1vc3QgY29kZSBzaG91bGQg dXNlIHRoZXNlIGZ1bmN0aW9ucyB0byBzZXQgTGlzcCBmaWVsZHMgaW4gc3RydWN0CiAgICBidWZm ZXIuICAoU29tZSBzZXR0ZXJzIHRoYXQgYXJlIHByaXZhdGUgdG8gYSBzaW5nbGUgLmMgZmlsZSBh cmUKICAgIGRlZmluZWQgYXMgc3RhdGljIGluIHRob3NlIGZpbGVzLikgICovCisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK0lOTElO RSB2b2lkCitic2V0X2Js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Y3QgYnVmZmVyICpiLCBMaXNwX09i amVjdCB2YWwpCit7CisgIGItPmZjX3Zpc2libGVfID0gdmFsOworfQorCitJTkxJTkUgdm9pZAor YnNldF9ibHZfZmNfaW5hY3RpdmVfd2luZG93cyAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmpl Y3QgdmFsKQoreworICBiLT5mY19pbmFjdGl2ZV93aW5kb3dzXyA9IHZhbDsKK30KKworLyogZW5k IE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIElOTElO RSB2b2lkCiBic2V0X2JpZGlfcGFyYWdyYXBoX2RpcmVjdGlvbiAoc3RydWN0IGJ1ZmZlciAqYiwg TGlzcF9PYmplY3QgdmFsKQogewpkaWZmIC0tZ2l0IGEvc3JjL2Rpc3BleHRlcm4uaCBiL3NyYy9k aXNwZXh0ZXJuLmgKaW5kZXggMWE1MzY1Ni4uNGQ3NjdlYSAxMDA2NDQKLS0tIGEvc3JjL2Rpc3Bl eHRlcm4uaAorKysgYi9zcmMvZGlzcGV4dGVybi5oCkBAIC0xMDAsNiArMTAwLDEyOSBAQCB0eXBl ZGVmIGludCBDdXJzb3I7CiAjZGVmaW5lIE5hdGl2ZVJlY3RhbmdsZSBpbnQKICNlbmRpZgogCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLwor CitzdHJ1Y3QgZ2x5cGg7CisKK3N0cnVjdCBnbHlwaF9yb3c7CisKK3N0cnVjdCBnbHlwaF9tYXRy aXg7CisKK2VudW0gZHJhd19nbHlwaHNfZmFjZTsKKworZW51bSBnbHlwaF9yb3dfYXJlYTsKKwor c3RydWN0IG1jX21hdHJpeDsKKworZW51bSBtY19jYWNoZV90eXBlOworCitlbnVtIG1jX2N1cnNv cl90eXBlOworCitlbnVtIG1jX2ZsYXZvcjsKKworc3RydWN0IG1jX1JHQjsKKworc3RydWN0IG1j X2Vzc2VudGlhbHM7CisKK2VudW0gbWNfZHJhd19yb3dfdHlwZTsKKworZW51bSBtY19lbmdpbmVf dHlwZTsKKworZW51bSBtY19yb3dfcG9zaXRpb247CisKK2VudW0gbWNfcmVkcmF3X3Jvd190eXBl OworCitlbnVtIGRyYXdfZ2x5cGhfYWN0aW9uOworCitleHRlcm4gTGlzcF9PYmplY3QgbWNfbGlz dG4gKHB0cmRpZmZfdCwgTGlzcF9PYmplY3QsIC4uLik7CisKK2V4dGVybiBMaXNwX09iamVjdCBt Y19udGggKGludCwgTGlzcF9PYmplY3QpOworCitleHRlcm4gTGlzcF9PYmplY3QgbWNfYXNzcSAo TGlzcF9PYmplY3QsIExpc3BfT2JqZWN0KTsKKworZXh0ZXJuIGVudW0gbWNfcm93X3Bvc2l0aW9u IG1jX3Jvd19wb3NpdGlvbiAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhf cm93ICosIGludCk7CisKK2V4dGVybiBwdHJkaWZmX3QgbWNfcmVnaW9uX2xpbWl0IChib29sKTsK KworZXh0ZXJuIHN0cnVjdCBnbHlwaCAqIG1jX2dldF9jdXJzb3JfZ2x5cGggKHN0cnVjdCB3aW5k b3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKiwgaW50LCBpbnQpOworCitleHRlcm4g dm9pZCBtY194d19jb2xvcl92YWx1ZXMgKHN0cnVjdCB3aW5kb3cgKiwgTGlzcF9PYmplY3QsIHN0 cnVjdCBtY19SR0IgKik7CisKK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x5cGhfbWF0 cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0 IGdseXBoICosIGludCwgaW50LCBpbnQsIGludCwgaW50LCBpbnQsCisgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCwgc3RydWN0IGdseXBoX21hdHJpeCAqLAor ICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfZXNzZW50aWFscywgZW51bSBtY19yb3df cG9zaXRpb24sIHN0cnVjdCBtY19SR0IsCisgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNf ZW5naW5lX3R5cGUsIGJvb2wsIGVudW0gbWNfZHJhd19yb3dfdHlwZSwKKyAgICAgICAgICAgICAg ICAgICAgICAgZW51bSBtY19jYWNoZV90eXBlKTsKKworZXh0ZXJuIHZvaWQgbWNfc2V0X2Vzc2Vu dGlhbHMgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IG1jX2Vzc2VudGlhbHMgKik7CisKK2V4dGVy biB2b2lkIG1jX2RyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXgg Kiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBn bHlwaCAqLCBpbnQsIGludCwgaW50LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosCisgICAgICAgICAg ICAgICAgICAgICAgICAgc3RydWN0IG1jX2Vzc2VudGlhbHMsIGVudW0gbWNfcm93X3Bvc2l0aW9u LCBib29sLAorICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfZHJhd19yb3dfdHlwZSk7 CisKK2V4dGVybiBib29sIG1jX3JlZHJhd19yb3cgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGds eXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAg ICAgICBlbnVtIGdseXBoX3Jvd19hcmVhLCBpbnQsIGludCwgaW50LCBib29sLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlLCBlbnVtIG1jX3JlZHJhd19y b3dfdHlwZSk7CisKK2V4dGVybiB2b2lkIG1jX3Jlc2V0X2NhY2hlIChzdHJ1Y3Qgd2luZG93ICop OworCitleHRlcm4gdm9pZCBtY19kcmF3X2N1cnNvcl9nbHlwaCAoc3RydWN0IHdpbmRvdyAqLCBz dHJ1Y3QgZ2x5cGhfbWF0cml4ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg c3RydWN0IGdseXBoX3JvdyAqLCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIGludCwgc3RydWN0IG1jX1JHQiwgZW51bSBt Y19mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJz b3JfdHlwZSwgaW50LCBib29sLCBib29sKTsKKworZXh0ZXJuIHZvaWQgbWNfZXJhc2VfY3Vyc29y IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwgc3RydWN0IGdseXBoX3Jv dyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGludCwgaW50LCBpbnQsIGVu dW0gbWNfZmxhdm9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNv cl90eXBlLCBpbnQpOworCitleHRlcm4gdm9pZCBtY19kcmF3X2VyYXNlX2h5YnJpZCAoc3RydWN0 IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGludCwgaW50LCBpbnQsIGludCwg aW50LCBpbnQsIGludCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1j X2N1cnNvcl90eXBlLCBpbnQsIHN0cnVjdCBtY19SR0IsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYm9vbCwgZW51bSBtY19mbGF2b3IsIGJvb2wpOworCitleHRlcm4gaW50IG1j X2RyYXdfZ2x5cGhzIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwgc3Ry dWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBlbnVtIGds eXBoX3Jvd19hcmVhLCBwdHJkaWZmX3QsIHB0cmRpZmZfdCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSwgaW50LCBpbnQsIHN0cnVjdCBtY19SR0IsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2ZsYXZvciwgZW51bSBtY19jdXJzb3Jf dHlwZSwgaW50LCBib29sLCBib29sLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBk cmF3X2dseXBoX2FjdGlvbiwgYm9vbCk7CisKK2V4dGVybiBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICog bWNfc2F2ZV9nbHlwaF9tYXRyaXggKHN0cnVjdCBnbHlwaF9tYXRyaXggKik7CisKK2V4dGVybiB2 b2lkIG1jX3Jlc3RvcmVfZ2x5cGhfbWF0cml4IChzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVj dCBnbHlwaF9tYXRyaXggKik7CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAvKiBUZXh0IGN1cnNvciB0eXBlcy4gICovCiAKIGVudW0g dGV4dF9jdXJzb3Jfa2luZHMKQEAgLTM4Miw2ICs1MDUsMTggQEAgc3RydWN0IGdseXBoX3NsaWNl CiAKIHN0cnVjdCBnbHlwaAogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgIGludCByZWxhdGl2ZV94LCBocG9zOworCisgIHB0cmRpZmZf dCBieXRlcG9zOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFBvc2l0aW9u IGZyb20gd2hpY2ggdGhpcyBnbHlwaCB3YXMgZHJhd24uICBJZiBgb2JqZWN0JyBiZWxvdyBpcyBh CiAgICAgIExpc3Agc3RyaW5nLCB0aGlzIGlzIGFuIGluZGV4IGludG8gdGhhdCBzdHJpbmcuICBJ ZiBpdCBpcyBhCiAgICAgIGJ1ZmZlciwgdGhpcyBpcyBhIHBvc2l0aW9uIGluIHRoYXQgYnVmZmVy LiAgSW4gYWRkaXRpb24sIHNvbWUKQEAgLTEyNDgsNiArMTM4MywyOCBAQCBlbnVtIGRyYXdfZ2x5 cGhzX2ZhY2UKIAogc3RydWN0IGdseXBoX3N0cmluZwogeworCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgYm9vbF9iZiBsZWZ0X292ZXJ3 cml0dGVuX3AgOiAxOworCisgICAgYm9vbF9iZiByaWdodF9vdmVyd3JpdHRlbl9wIDogMTsKKwor ICAgIGJvb2xfYmYgcmVjdGFuZ2xlX251a2VkX3AgOiAxOworCisgICAgYm9vbF9iZiBiYWNrZ3Jv dW5kX251a2VkX3AgOiAxOworCisgICAgZW51bSBkcmF3X2dseXBoX2FjdGlvbgorICAgIHsKKyAg ICAgIE1DX0RSQVdfR0xZUEhfU1RSSU5HLAorICAgICAgTUNfRVJBU0VfR0xZUEhfU1RSSU5HCisg ICAgfSBhY3Rpb25fdHlwZTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBY LW9yaWdpbiBvZiB0aGUgc3RyaW5nLiAgKi8KICAgaW50IHg7CiAKQEAgLTI4MTIsNiArMjk2OSwy OCBAQCB0eXBlZGVmIHZvaWQgKCpmcmFtZV9wYXJtX2hhbmRsZXIpIChzdHJ1Y3QgZnJhbWUgKiwg TGlzcF9PYmplY3QsIExpc3BfT2JqZWN0KTsKIAogc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UK IHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBuc3Rlcm0ubWAgfCBgdzMydGVybS5jYCB8 IGB4dGVybS5jYCBtdXN0IGJlIGluIHRoZQorZXhhY3Qgc2FtZSBvcmRlciBhcyB0aGUgYHJlZGlz cGxheV9pbnRlcmZhY2UnIGluIGBkaXNwZXh0ZXJuLmhgISAqLworCisgIC8qIGBtY19uc19kcmF3 X3dpbmRvd19jdXJzb3InIHwgYG1jX3czMl9kcmF3X3dpbmRvd19jdXJzb3InIHwgYG1jX3hfZHJh d193aW5kb3dfY3Vyc29yJyAqLworICB2b2lkICgqbWNfc2NyaWJlX2N1cnNvcikgKHN0cnVjdCB3 aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwKKyAgICAgICAgc3RydWN0IGds eXBoX3JvdyAqZ2x5cGhfcm93LC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cuYworKysgYi9zcmMv ZGlzcG5ldy5jCkBAIC01Niw2ICs1NiwxODI0IEBAIGFsb25nIHdpdGggR05VIEVtYWNzLiAgSWYg bm90LCBzZWUgPGh0dHBzOi8vd3d3LmdudS5vcmcvbGljZW5zZXMvPi4gICovCiAjaW5jbHVkZSAi dzMyLmgiCiAjZW5kaWYKIAwKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2lu IE1VTFRJUExFLUNVUlNPUlMgKi8KKworc3RydWN0IGdseXBoc19za2lwcGVkCit7CisgIHB0cmRp ZmZfdCBhbGxvY2F0ZWQ7CisgIHB0cmRpZmZfdCB1c2VkOworICBzdHJ1Y3Qgc2tpcHBlZF9pdGVt cworICAgIHsKKyAgICAgIGludCB4OworICAgICAgaW50IGhwb3M7CisgICAgICBib29sIGVuYWJs ZWRfcDsKKyAgICB9ICpza2lwcGVkOworfSBhcnJheV9nbHlwaHNfc2tpcHBlZDsKKworc3RydWN0 IG1jX3Jvd19lbnRyeQoreworICBpbnQgb2xkX3VzZXMsIG5ld191c2VzOworICBpbnQgbmV3X2xp bmVfbnVtYmVyOworICBwdHJkaWZmX3QgYnVja2V0OworICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3c7 CisgIHN0cnVjdCBtY19yb3dfZW50cnkgKm5leHQ7Cit9Oworc3RhdGljIHN0cnVjdCBtY19yb3df ZW50cnkgKm1jX3Jvd19lbnRyeV9wb29sOworc3RhdGljIHB0cmRpZmZfdCBtY19yb3dfZW50cnlf cG9vbF9zaXplOworc3RhdGljIHB0cmRpZmZfdCBtY19yb3dfZW50cnlfaWR4Oworc3RhdGljIHN0 cnVjdCBtY19yb3dfZW50cnkgKiptY19yb3dfdGFibGU7CitzdGF0aWMgcHRyZGlmZl90IG1jX3Jv d190YWJsZV9zaXplOworc3RhdGljIHN0cnVjdCBtY19yb3dfZW50cnkgK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2kpCisgICAgeworICAgICAgc3RydWN0IGdseXBoX3JvdyAqZnJvbSA9IHNhdmVk LT5yb3dzICsgaTsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnRvID0gbWF0cml4LT5yb3dzICsg aTsKKyAgICAgIHB0cmRpZmZfdCBuYnl0ZXMgPSBmcm9tLT51c2VkW1RFWFRfQVJFQV0gKiBzaXpl b2YgKHN0cnVjdCBnbHlwaCk7CisgICAgICBtZW1jcHkgKHRvLT5nbHlwaHNbVEVYVF9BUkVBXSwg ZnJvbS0+Z2x5cGhzW1RFWFRfQVJFQV0sIG5ieXRlcyk7CisgICAgICB0by0+dXNlZFtURVhUX0FS RUFdID0gZnJvbS0+dXNlZFtURVhUX0FSRUFdOworICAgICAgdG8tPmhhc2ggPSBmcm9tLT5oYXNo OworICAgICAgdG8tPnggPSBmcm9tLT54OworICAgICAgdG8tPnkgPSBmcm9tLT55OworICAgICAg dG8tPnBpeGVsX3dpZHRoID0gZnJvbS0+cGl4ZWxfd2lkdGg7CisgICAgICB0by0+YXNjZW50ID0g ZnJvbS0+YXNjZW50OworICAgICAgdG8tPmhlaWdodCA9IGZyb20tPmhlaWdodDsKKyAgICAgIHRv LT5waHlzX2FzY2VudCA9IGZyb20tPnBoeXNfYXNjZW50OworICAgICAgdG8tPnBoeXNfaGVpZ2h0 ID0gZnJvbS0+cGh5c19oZWlnaHQ7CisgICAgICB0by0+dmlzaWJsZV9oZWlnaHQgPSBmcm9tLT52 aXNpYmxlX2hlaWdodDsKKyAgICAgIHRvLT5leHRyYV9saW5lX3NwYWNpbmcgPSBmcm9tLT5leHRy YV9saW5lX3NwYWNpbmc7CisgICAgICB0by0+c3RhcnQgPSBmcm9tLT5zdGFydDsKKyAgICAgIHRv LT5lbmQgPSBmcm9tLT5lbmQ7CisgICAgICB0by0+bWlucG9zID0gZnJvbS0+bWlucG9zOworICAg ICAgdG8tPm1heHBvcyA9IGZyb20tPm1heHBvczsKKyAgICAgIHRvLT5vdmVybGF5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yZW50X21hdHJpeCA9IHctPmN1cnJlbnRf bWF0cml4OworICBpbnQgeWIgPSB3aW5kb3dfdGV4dF9ib3R0b21feSAodyk7CisgIHB0cmRpZmZf dCBpOworICBpbnQgaiwgZmlyc3Rfb2xkLCBmaXJzdF9uZXcsIGxhc3Rfb2xkLCBsYXN0X25ldzsK KyAgaW50IG5ydW5zLCBydW5faWR4OworICBwdHJkaWZmX3QgbjsKKyAgc3RydWN0IG1jX3Jvd19l bnRyeSAqZW50cnk7CisgIC8vIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlICpyaWYgPSBGUkFN RV9SSUYgKFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSkpOworICAvKiBTa2lwIG92ZXIgcm93cyBl cXVhbCBhdCB0aGUgc3RhcnQuICovCisgIGZvciAoaSA9IGhlYWRlcl9saW5lX3A7IGkgPCBjdXJy ZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgeworICAgICAgc3RydWN0IGdseXBoX3Jv dyAqZCA9IE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCBpKTsKKyAgICAgIHN0cnVjdCBnbHlw aF9yb3cgKmMgPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSk7CisgICAgICBpZiAoYy0+ ZW5hYmxlZF9wCisgICAgICAgICAgJiYgZC0+ZW5hYmxlZF9wCisgICAgICAgICAgJiYgIWQtPnJl ZHJhd19mcmluZ2VfYml0bWFwc19wCisgICAgICAgICAgJiYgYy0+eSA9PSBkLT55CisgICAgICAg ICAgJiYgTUFUUklYX1JPV19CT1RUT01fWSAoYykgPD0geWIKKyAgICAgICAgICAmJiBNQVRSSVhf Uk9XX0JPVFRPTV9ZIChkKSA8PSB5YgorICAgICAgICAgICYmIHJvd19lcXVhbF9wIChjLCBkLCAx KSkKKyAgICAgICAgeworICAgICAgICAgIGFzc2lnbl9yb3cgKGMsIGQpOworICAgICAgICAgIGQt PmVuYWJsZWRfcCA9IGZ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gICBicmVh azsKKyAgICB9CisgIGxhc3RfbmV3ID0gaTsKKyAgLyogU2V0IGxhc3Rfb2xkIHRvIHRoZSBpbmRl eCArIDEgb2YgdGhlIHJvdyB0aGF0IHJlYWNoZXMgdGhlIGJvdHRvbQorICAgICBib3VuZGFyeSBp biB0aGUgY3VycmVudCBtYXRyaXguICBXZSBkb24ndCBsb29rIGF0IHRoZSBlbmFibGVkCisgICAg IGZsYWcgaGVyZSBiZWNhdXNlIHdlIHBsYW4gdG8gcmV1c2UgcGFydCBvZiB0aGUgZGlzcGxheSBl dmVuIGlmCisgICAgIG90aGVyIHBhcnRzIGFyZSBkaXNhYmxlZC4gKi8KKyAgaSA9IGZpcnN0X29s ZCArIDE7CisgIHdoaWxlIChpIDwgY3VycmVudF9tYXRyaXgtPm5yb3dzIC0gMSkKKyAgICB7Cisg ICAgICBpbnQgYm90dG9tID0gTUFUUklYX1JPV19CT1RUT01fWSAoTUFUUklYX1JPVyAoY3VycmVu dF9tYXRyaXgsIGkpKTsKKyAgICAgIGlmIChib3R0b20gPD0geWIpCisgICAgICAgICsraTsKKyAg ICAgIGlmIChib3R0b20gPj0geWIpCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgbGFzdF9vbGQg PSBpOworICAvKiBTa2lwIG92ZXIgcm93cyBlcXVhbCBhdCB0aGUgYm90dG9tLiAqLworICBpID0g bGFzdF9uZXc7CisgIGogPSBsYXN0X29sZDsKKyAgd2hpbGUgKGkgLSAxID4gZmlyc3RfbmV3Cisg ICAgICAgICAmJiBqIC0gMSA+IGZpcnN0X29sZAorICAgICAgICAgJiYgTUFUUklYX1JPV19FTkFC TEVEX1AgKGN1cnJlbnRfbWF0cml4LCBqIC0gMSkKKyAgICAgICAgICYmIChNQVRSSVhfUk9XIChj dXJyZW50X21hdHJpeCwgaiAtIDEpLT55CisgICAgICAgICAgICAgPT0gTUFUUklYX1JPVyAoZGVz aXJlZF9tYXRyaXgsIGkgLSAxKS0+eSkKKyAgICAgICAgICYmICF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xMTMp IHdvdWxkIGJlIDEyNy4gKi8KKyAgeworICAgIHZlcmlmeSAoTkVYVF9BTE1PU1RfUFJJTUVfTElN SVQgPT0gMTEpOworICAgIGVudW0geyBuZXh0X2FsbW9zdF9wcmltZV9pbmNyZW1lbnRfbWF4ID0g MTAgfTsKKyAgICBwdHJkaWZmX3Qgcm93X3RhYmxlX21heCA9CisgICAgICAobWluIChQVFJESUZG X01BWCwgU0laRV9NQVgpIC8gKDMgKiBzaXplb2YgKm1jX3Jvd190YWJsZSkKKyAgICAgICAtIG5l eHRfYWxtb3N0X3ByaW1lX2luY3JlbWVudF9tYXgpOworICAgIHB0cmRpZmZfdCBjdXJyZW50X25y b3dzX21heCA9IHJvd190YWJsZV9tYXggLSBkZXNpcmVkX21hdHJpeC0+bnJvd3M7CisgICAgaWYg KGN1cnJlbnRfbnJvd3NfbWF4IDwgY3VycmVudF9tYXRyaXgtPm5yb3dzKQorICAgICAgbWVtb3J5 X2Z1bGwgKFNJWkVfTUFYKTsKKyAgfQorICAvKiBSZWFsbG9jYXRlIHZlY3RvcnMsIHRhYmxlcyBl dGMuIGlmIG5lY2Vzc2FyeS4gKi8KKyAgaWYgKGN1cnJlbnRfbWF0cml4LT5ucm93cyA+IG1jX29s ZF9saW5lc19zaXplKQorICAgIG1jX29sZF9saW5lcyA9IHhwYWxsb2MgKG1jX29sZF9saW5lcywg Jm1jX29sZF9saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfbWF0 cml4LT5ucm93cyAtIG1jX29sZF9saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAg IElOVF9NQVgsIHNpemVvZiAqbWNfb2xkX2xpbmVzKTsKKyAgaWYgKGRlc2lyZWRfbWF0cml4LT5u cm93cyA+IG1jX25ld19saW5lc19zaXplKQorICAgIG1jX25ld19saW5lcyA9IHhwYWxsb2MgKG1j X25ld19saW5lcywgJm1jX25ld19saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAg IGRlc2lyZWRfbWF0cml4LT5ucm93cyAtIG1jX25ld19saW5lc19zaXplLAorICAgICAgICAgICAg ICAgICAgICAgICAgIElOVF9NQVgsIHNpemVvZiAqbWNfbmV3X2xpbmVzKTsKKyAgbiA9IGRlc2ly ZWRfbWF0cml4LT5ucm93czsKKyAgbiArPSBjdXJyZW50X21hdHJpeC0+bnJvd3M7CisgIGlmICht Y19yb3dfdGFibGVfc2l6ZSA8IDMgKiBuKQorICAgIHsKKyAgICAgIHB0cmRpZmZfdCBzaXplID0g bmV4dF9hbG1vc3RfcHJpbWUgKDMgKiBuKTsKKyAgICAgIG1jX3Jvd190YWJsZSA9IHhucmVhbGxv YyAobWNfcm93X3RhYmxlLCBzaXplLCBzaXplb2YgKm1jX3Jvd190YWJsZSk7CisgICAgICBtY19y b3dfdGFibGVfc2l6ZSA9IHNpemU7CisgICAgICBtZW1zZXQgKG1jX3Jvd190YWJsZSwgMCwgc2l6 ZSAqIHNpemVvZiAqbWNfcm93X3RhYmxlKTsKKyAgICB9CisgIGlmIChuID4gbWNfcm93X2VudHJ5 X3Bvb2xfc2l6ZSkKKyAgICBtY19yb3dfZW50cnlfcG9vbCA9IHhwYWxsb2MgKG1jX3Jvd19lbnRy eV9wb29sLCAmbWNfcm93X2VudHJ5X3Bvb2xfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIG4gLSBtY19yb3dfZW50cnlfcG9vbF9zaXplLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgLTEsIHNpemVvZiAqbWNfcm93X2VudHJ5X3Bvb2wpOworICBpZiAoZGVzaXJlZF9t YXRyaXgtPm5yb3dzID4gbWNfcnVuc19zaXplKQorICAgIHsKKyAgICAgIG1jX3J1bnMgPSB4bnJl YWxsb2MgKG1jX3J1bnMsIGRlc2lyZWRfbWF0cml4LT5ucm93cywgc2l6ZW9mICptY19ydW5zKTsK KyAgICAgIG1jX3J1bl9wb29sID0geG5yZWFsbG9jIChtY19ydW5fcG9vbCwgZGVzaXJlZF9tYXRy aXgtPm5yb3dzLCBzaXplb2YgKm1jX3J1bl9wb29sKTsKKyAgICAgIG1jX3J1bnNfc2l6ZSA9IGRl c2lyZWRfbWF0cml4LT5ucm93czsKKyAgICB9CisgIG5ydW5zID0gcnVuX2lkeCA9IDA7CisgIG1j X3Jvd19lbnRyeV9pZHggPSAwOworICAvKiBBZGQgcm93cyBmcm9tIHRoZSBjdXJyZW50IGFuZCBk ZXNpcmVkIG1hdHJpeCB0byB0aGUgaGFzaCB0YWJsZQorICAgICByb3dfaGFzaF90YWJsZSB0byBi ZSBhYmxlIHRvIGZpbmQgZXF1YWwgb25lcyBxdWlja2x5LiAqLworICBmb3IgKGkgPSBmaXJzdF9v bGQ7IGkgPCBsYXN0X29sZDsgKytpKQorICAgIHsKKyAgICAgIGlmIChNQVRSSVhfUk9XX0VOQUJM RURfUCAoY3VycmVudF9tYXRyaXgsIGkpKQorICAgICAgICB7CisgICAgICAgICAgZW50cnkgPSBt Y19hZGRfcm93X2VudHJ5IChNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSkpOworICAgICAg ICAgIG1jX29sZF9saW5lc1tpXSA9IGVudHJ5OworICAgICAgICAgICsrZW50cnktPm9sZF91c2Vz OworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIG1jX29sZF9saW5lc1tpXSA9IE5VTEw7 CisgICAgfQorICBmb3IgKGkgPSBmaXJzdF9uZXc7IGkgPCBsYXN0X25ldzsgKytpKQorICAgIHsK KyAgICAgIGVhc3NlcnQgKE1BVFJJWF9ST1dfRU5BQkxFRF9QIChkZXNpcmVkX21hdHJpeCwgaSkp OworICAgICAgZW50cnkgPSBtY19hZGRfcm93X2VudHJ5IChNQVRSSVhfUk9XIChkZXNpcmVkX21h dHJpeCwgaSkpOworICAgICAgKytlbnRyeS0+bmV3X3VzZXM7CisgICAgICBlbnRyeS0+bmV3X2xp bmVfbnVtYmVyID0gaTsKKyAgICAgIG1jX25ld19saW5lc1tpXSA9IGVudHJ5OworICAgIH0KKyAg LyogSWRlbnRpZnkgbW92ZXMgYmFzZWQgb24gbGluZXMgdGhhdCBhcmUgdW5pcXVlIGFuZCBlcXVh bAorICAgICBpbiBib3RoIG1hdHJpY2VzLiAqLworICBmb3IgKGkgPSBmaXJzdF9vbGQ7IGkgPCBs YXN0X29sZDspCisgICAgaWYgKG1jX29sZF9saW5lc1tpXQorICAgICAgICAmJiBtY19vbGRfbGlu ZXNbaV0tPm9sZF91c2VzID09IDEKKyAgICAgICAgJiYgbWNfb2xkX2xpbmVzW2ldLT5uZXdfdXNl cyA9PSAxKQorICAgICAgeworICAgICAgICBpbnQgcCwgcTsKKyAgICAgICAgaW50IG5ld19saW5l ID0gbWNfb2xkX2xpbmVzW2ldLT5uZXdfbGluZV9udW1iZXI7CisgICAgICAgIHN0cnVjdCBydW4g KnJ1biA9IG1jX3J1bl9wb29sICsgcnVuX2lkeCsrOworICAgICAgICAvKiBSZWNvcmQgbW92ZS4g Ki8KKyAgICAgICAgcnVuLT5jdXJyZW50X3Zwb3MgPSBpOworICAgICAgICBydW4tPmN1cnJlbnRf eSA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBpKS0+eTsKKyAgICAgICAgcnVuLT5kZXNp cmVkX3Zwb3MgPSBuZXdfbGluZTsKKyAgICAgICAgcnVuLT5kZXNpcmVkX3kgPSBNQVRSSVhfUk9X IChkZXNpcmVkX21hdHJpeCwgbmV3X2xpbmUpLT55OworICAgICAgICBydW4tPm5yb3dzID0gMTsK KyAgICAgICAgcnVuLT5oZWlnaHQgPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSktPmhl aWdodDsKKyAgICAgICAgLyogRXh0ZW5kIGJhY2t3YXJkLiAqLworICAgICAgICBwID0gaSAtIDE7 CisgICAgICAgIHEgPSBuZXdfbGluZSAtIDE7CisgICAgICAgIHdoaWxlIChwID4gZmlyc3Rfb2xk CisgICAgICAgICAgICAgICAmJiBxID4gZmlyc3RfbmV3CisgICAgICAgICAgICAgICAmJiBtY19v bGRfbGluZXNbcF0gPT0gbWNfbmV3X2xpbmVzW3FdKQorICAgICAgICAgIHsKKyAgICAgICAgICAg IGludCBoID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIHApLT5oZWlnaHQ7CisgICAgICAg ICAgICAtLXJ1bi0+Y3VycmVudF92cG9zOworICAgICAgICAgICAgLS1ydW4tPmRlc2lyZWRfdnBv czsKKyAgICAgICAgICAgICsrcnVuLT5ucm93czsKKyAgICAgICAgICAgIHJ1bi0+aGVpZ2h0ICs9 IGg7CisgICAgICAgICAgICBydW4tPmRlc2lyZWRfeSAtPSBoOworICAgICAgICAgICAgcnVuLT5j dXJyZW50X3kgLT0gaDsKKyAgICAgICAgICAgIC0tcCwgLS1xOworICAgICAgICAgIH0KKyAgICAg ICAgLyogRXh0ZW5kIGZvcndhcmQuICovCisgICAgICAgIHAgPSBpICsgMTsKKyAgICAgICAgcSA9 IG5ld19saW5lICsgMTsKKyAgICAgICAgd2hpbGUgKHAgPCBsYXN0X29sZAorICAgICAgICAgICAg ICAgJiYgcSA8IGxhc3RfbmV3CisgICAgICAgICAgICAgICAmJiBtY19vbGRfbGluZXNbcF0gPT0g bWNfbmV3X2xpbmVzW3FdKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCBoID0gTUFUUklY X1JPVyAoY3VycmVudF9tYXRyaXgsIHApLT5oZWlnaHQ7CisgICAgICAgICAgICArK3J1bi0+bnJv d3M7CisgICAgICAgICAgICBydW4tPmhlaWdodCArPSBoOworICAgICAgICAgICAgKytwLCArK3E7 CisgICAgICAgICAgfQorICAgICAgICAvKiBJbnNlcnQgcnVuIGludG8gbGlzdCBvZiBhbGwgcnVu cy4gIE9yZGVyIHJ1bnMgYnkgY29waWVkCisgICAgICAgICAgIHBpeGVsIGxpbmVzLiAgTm90ZSB0 aGF0IHdlIHJlY29yZCBydW5zIHRoYXQgZG9uJ3QgaGF2ZSB0bworICAgICAgICAgICBiZSBjb3Bp ZWQgYmVjYXVzZSB0aGV5IGFyZSBhbHJlYWR5IGluIHBsYWNlLiAgVGhpcyBpcyBkb25lCisgICAg ICAgICAgIGJlY2F1c2Ugd2UgY2FuIGF2b2lkIGNhbGxpbmcgdXBkYXRlX3dpbmRvd19saW5lIGlu IHRoaXMKKyAgICAgICAgICAgY2FzZS4gKi8KKyAgICAgICAgZm9yIChwID0gMDsgcCA8IG5ydW5z ICYmIG1jX3J1bnNbcF0tPmhlaWdodCA+IHJ1bi0+aGVpZ2h0OyArK3ApCisgICAgICAgICAgOwor ICAgICAgICBmb3IgKHEgPSBucnVuczsgcSA+IHA7IC0tcSkKKyAgICAgICAgICBtY19ydW5zW3Fd ID0gbWNfcnVuc1txIC0gMV07CisgICAgICAgIG1jX3J1bnNbcF0gPSBydW47CisgICAgICAgICsr bnJ1bnM7CisgICAgICAgIGkgKz0gcnVuLT5ucm93czsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAg ICAgICAgKytpOworICAvKiBEbyB0aGUgbW92ZXMuICBEbyBpdCBpbiBhIHdheSB0aGF0IHdlIGRv bid0IG92ZXJ3cml0ZSBzb21ldGhpbmcKKyAgICAgd2Ugd2FudCB0byBjb3B5IGxhdGVyIG9uLiAg VGhpcyBpcyBub3Qgc29sdmFibGUgaW4gZ2VuZXJhbAorICAgICBiZWNhdXNlIHRoZXJlIGlzIG9u bHkgb25lIGRpc3BsYXkgYW5kIHdlIGRvbid0IGhhdmUgYSB3YXkgdG8KKyAgICAgZXhjaGFuZ2Ug YXJlYXMgb24gdGhpcyBkaXNwbGF5LiAgRXhhbXBsZToKKyAgICAgICAgICArLS0tLS0tLS0tLS0r ICAgICAgICstLS0tLS0tLS0tLSsKKyAgICAgICAgICB8ICAgICBBICAgICB8ICAgICAgIHwgICAg IEIgICAgIHwKKyAgICAgICAgICArLS0tLS0tLS0tLS0rICAtLT4gICstLS0tLS0tLS0tLSsKKyAg ICAgICAgICB8ICAgICBCICAgICB8ICAgICAgIHwgICAgIEEgICAgIHwKKyAgICAgICAgICArLS0t LS0tLS0tLS0rICAgICAgICstLS0tLS0tLS0tLSsKKyAgICAgSW5zdGVhZCwgcHJlZmVyIGJpZ2dl ciBtb3ZlcywgYW5kIGludmFsaWRhdGUgbW92ZXMgdGhhdCB3b3VsZAorICAgICBjb3B5IGZyb20g d2hlcmUgd2UgY29waWVkIHRvLiAqLworICBmb3IgKGkgPSAwOyBpIDwgbnJ1bnM7ICsraSkKKyAg ICBpZiAobWNfcnVuc1tpXS0+bnJvd3MgPiAwKQorICAgICAgeworICAgICAgICBzdHJ1Y3QgcnVu ICpyID0gbWNfcnVuc1tpXTsKKyAgICAgICAgaWYgKHItPmN1cnJlbnRfeSAhPSByLT5kZXNpcmVk X3kpCisgICAgICAgICAgeworICAgICAgICAgICAgLy8gIGZwcmludGYgKHN0ZGVyciwgIiVzOiAg ci0+Y3VycmVudC9kZXNpcmVkX3Zwb3MgKCVkLyVkKSB8IHItPmN1cnJlbnQvZGVzaXJlZF95ICgl ZC8lZClcbiIsCisgICAgICAgICAgICAvLyAgICAgICAgICAgci0+Y3VycmVudF95IDwgci0+ZGVz aXJlZF95ID8gIuKGkyIgOiAi4oaRIiwKKyAgICAgICAgICAgIC8vICAgICAgICAgICByLT5jdXJy ZW50X3Zwb3MsIHItPmRlc2lyZWRfdnBvcywgci0+Y3VycmVudF95LCByLT5kZXNpcmVkX3kpOwor ICAgICAgICAgICAgLy8gIHJpZi0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOworICAgICAg ICAgICAgLy8gIHJpZi0+c2Nyb2xsX3J1bl9ob29rICh3LCByKTsKKyAgICAgICAgICB9CisgICAg ICAgIC8qIFRydW5jYXRlIHJ1bnMgdGhhdCBjb3B5IHRvIHdoZXJlIHdlIGNvcGllZCB0bywgYW5k CisgICAgICAgICAgIGludmFsaWRhdGUgcnVucyB0aGF0IGNvcHkgZnJvbSB3aGVyZSB3ZSBjb3Bp ZWQgdG8uICovCisgICAgICAgIGZvciAoaiA9IG5ydW5zIC0gMTsgaiA+IGk7IC0taikKKyAgICAg ICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgcnVuICpwID0gbWNfcnVuc1tqXTsKKyAgICAgICAg ICAgIGJvb2wgdHJ1bmNhdGVkX3AgPSAwOworICAgICAgICAgICAgaWYgKHAtPm5yb3dzID4gMAor ICAgICAgICAgICAgICAgICYmIHAtPmRlc2lyZWRfeSA8IHItPmRlc2lyZWRfeSArIHItPmhlaWdo dAorICAgICAgICAgICAgICAgICYmIHAtPmRlc2lyZWRfeSArIHAtPmhlaWdodCA+IHItPmRlc2ly ZWRfeSkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChwLT5kZXNpcmVkX3kg PCByLT5kZXNpcmVkX3kpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg IHAtPm5yb3dzID0gci0+ZGVzaXJlZF92cG9zIC0gcC0+ZGVzaXJlZF92cG9zOworICAgICAgICAg ICAgICAgICAgICBwLT5oZWlnaHQgPSByLT5kZXNpcmVkX3kgLSBwLT5kZXNpcmVkX3k7CisgICAg ICAgICAgICAgICAgICAgIHRydW5jYXRlZF9wID0gMTsKKyAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgIGludCBucm93c19jb3BpZWQgPSAoci0+ZGVzaXJlZF92cG9zICsgci0+bnJvd3MKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHAtPmRlc2lyZWRfdnBvcyk7Cisg ICAgICAgICAgICAgICAgICAgIGlmIChwLT5ucm93cyA8PSBucm93c19jb3BpZWQpCisgICAgICAg ICAgICAgICAgICAgICAgcC0+bnJvd3MgPSAwOworICAgICAgICAgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgaW50 IGhlaWdodF9jb3BpZWQgPSAoci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gcC0+ZGVzaXJlZF95KTsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgcC0+Y3VycmVudF92cG9zICs9IG5yb3dzX2NvcGllZDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgcC0+ZGVzaXJlZF92cG9zICs9IG5yb3dzX2NvcGllZDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+bnJvd3MgLT0gbnJvd3NfY29waWVkOworICAg ICAgICAgICAgICAgICAgICAgICAgICBwLT5jdXJyZW50X3kgKz0gaGVpZ2h0X2NvcGllZDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgcC0+ZGVzaXJlZF95ICs9IGhlaWdodF9jb3BpZWQ7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmhlaWdodCAtPSBoZWlnaHRfY29waWVkOworICAg ICAgICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZWRfcCA9IDE7CisgICAgICAgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgIGlmIChyLT5jdXJyZW50X3kgIT0gci0+ZGVzaXJlZF95CisgICAgICAgICAgICAgICAgLyog VGhlIGNvbmRpdGlvbiBiZWxvdyBpcyBlcXVpdmFsZW50IHRvCisgICAgICAgICAgICAgICAgICAg KChwLT5jdXJyZW50X3kgPj0gci0+ZGVzaXJlZF95CisgICAgICAgICAgICAgICAgICAgICAmJiBw LT5jdXJyZW50X3kgPCByLT5kZXNpcmVkX3kgKyByLT5oZWlnaHQpCisgICAgICAgICAgICAgICAg ICAgIHx8IChwLT5jdXJyZW50X3kgKyBwLT5oZWlnaHQgPiByLT5kZXNpcmVkX3kKKyAgICAgICAg ICAgICAgICAgICAgICAgICYmIChwLT5jdXJyZW50X3kgKyBwLT5oZWlnaHQKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICA8PSByLT5kZXNpcmVkX3kgKyByLT5oZWlnaHQpKSkKKyAgICAgICAg ICAgICAgICAgICBiZWNhdXNlIHdlIGhhdmUgMCA8IHAtPmhlaWdodCA8PSByLT5oZWlnaHQuICov CisgICAgICAgICAgICAgICAgJiYgcC0+Y3VycmVudF95IDwgci0+ZGVzaXJlZF95ICsgci0+aGVp Z2h0CisgICAgICAgICAgICAgICAgJiYgcC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0ID4gci0+ZGVz aXJlZF95KQorICAgICAgICAgICAgICBwLT5ucm93cyA9IDA7CisgICAgICAgICAgICAvKiBSZW9y ZGVyIHJ1bnMgYnkgY29waWVkIHBpeGVsIGxpbmVzIGlmIHRydW5jYXRlZC4gKi8KKyAgICAgICAg ICAgIGlmICh0cnVuY2F0ZWRfcCAmJiBwLT5ucm93cyA+IDApCisgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICBpbnQgayA9IG5ydW5zIC0gMTsKKyAgICAgICAgICAgICAgICB3aGlsZSAo bWNfcnVuc1trXS0+bnJvd3MgPT0gMCB8fCBtY19ydW5zW2tdLT5oZWlnaHQgPCBwLT5oZWlnaHQp CisgICAgICAgICAgICAgICAgICBrLS07CisgICAgICAgICAgICAgICAgbWVtbW92ZSAobWNfcnVu cyArIGosIG1jX3J1bnMgKyBqICsgMSwgKGsgLSBqKSAqIHNpemVvZiAoKm1jX3J1bnMpKTsKKyAg ICAgICAgICAgICAgICBtY19ydW5zW2tdID0gcDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAg IH0KKyAgICAgICAgLyogQXNzaWduIG1hdHJpeCByb3dzLiAqLworICAgICAgICBmb3IgKGogPSAw OyBqIDwgci0+bnJvd3M7ICsraikKKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5 cGhfcm93ICpmcm9tLCAqdG87Cisg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ZWQgYnkKKyAgYG1ha2VfY3VycmVudCcgaW4gYHVwZGF0ZV93aW5kb3dfbGlu ZScsIG9yIGJlY2F1c2UgdGhlIHByZXZpb3VzIHJvdyB3b3VsZCBiZQorICB0aGUgc2FtZSBpbiBi b3RoIG1hdHJpY2VzIGlmIHdlIGp1bXBlZCB0byBgc2V0X2N1cnNvcjpgIHdpdGhpbiBgdXBkYXRl X3dpbmRvdycKKyAgYW5kIGBtY191cGRhdGVfd2luZG93X2RyeXJ1bicuICovCisgIGludCBwcmV2 X21hdHJpeF9yb3dfc3RhcnRfYnl0ZXBvcyA9ICh2cG9zICE9IDApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19TVEFSVF9CWVRFUE9TIChjdXJyZW50 X3JvdyAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogLTE7Cisg IGludCBwcmV2X21hdHJpeF9yb3dfZW5kX2J5dGVwb3MgPSAodnBvcyAhPSAwKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VORF9CWVRFUE9TIChjdXJy ZW50X3JvdyAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IC0xOwor ICBpbnQgbWF0cml4X3Jvd19zdGFydF9ieXRlcG9zID0gTUFUUklYX1JPV19TVEFSVF9CWVRFUE9T IChkZXNpcmVkX3Jvdyk7CisgIGludCBtYXRyaXhfcm93X2VuZF9ieXRlcG9zID0gTUFUUklYX1JP V19FTkRfQllURVBPUyAoZGVzaXJlZF9yb3cpOworICAvKiBUaGUgZmlyc3QgY29uZGl0aW9uIHRl c3RzIGZvciBhIHNvbGl0YXJ5IHJvdyBjb250YWluaW5nIFpWLCBwcmVjZWRlZCBieSBhCisgIHJv dyBjb250YWluaW5nIGEgcGVudWx0aW1hdGUgZ2x5cGggd2l0aCBhIGNoYXJwb3Mgb2YgWlYgLSAx IGZvbGxvd2VkIGJ5IGFuIGVuZAorICBvZiByb3cgc3BhY2UgZ2x5cGggd2l0aCBhIGNoYXJwb3Mg b2YgMC4gIFRoZSBvdGhlciBjb25kaXRpb25zIHRlc3QgZm9yIGFuIGVtcHR5CisgIGJ1ZmZlciAo bm90IG5hcnJvd2VkKSwgb3IgYW4gZW1wdHkgbmFycm93ZWQgYnVmZmVyLiAqLworICBib29sIHJv d19hdF96dl9wID0gKCh2cG9zICE9IDAKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgKGN1cnJl bnRfcm93IC0gMSktPnVzZWRbVEVYVF9BUkVBXSA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAg JiYgcHJldl9tYXRyaXhfcm93X3N0YXJ0X2J5dGVwb3MgIT0gcHJldl9tYXRyaXhfcm93X2VuZF9i eXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAgICYmICEoY3VycmVudF9yb3cgLSAxKS0+ZW5k c19hdF96dl9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIG1hdHJpeF9yb3dfc3RhcnRfYnl0 ZXBvcyA9PSBtYXRyaXhfcm93X2VuZF9ieXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAgICYm IGRlc2lyZWRfcm93LT5lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgfHwgKCgo aGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID09IDEpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICB8fCAoaGVhZGVyX2xpbmVfZm9ybWF0ID09IDAgJiYgdnBvcyA9PSAwKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgYnVmZmVyX25hcnJvd2VkX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgYm9iX3Jlc3BlY3RfbmFycm93ID09IGVvYl9yZXNwZWN0X25hcnJvdykK KyAgICAgICAgICAgICAgICAgICAgICB8fCAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZw b3MgPT0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChoZWFkZXJfbGluZV9mb3Jt YXQgPT0gMCAmJiB2cG9zID09IDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBib2Jf ZGlzcmVnYXJkX25hcnJvdyA9PSBlb2JfZGlzcmVnYXJkX25hcnJvdykpOworICAvKiBJZiBsaW5l LW51bWJlcnMgYXJlIGFjdGl2ZSwgdGhlbiBzcGFjZSBnbHlwaCBwYWRkaW5nIGVxdWFsIHRvIGl0 cyB3aWR0aAorICBjb3VudGVkIGluIEhQT1MgYXJlIGZvbGxvd2VkIGJ5IGEgc2luZ2xlIHJvdyBl bmQgc3BhY2UgZ2x5cGguICBMaW5lIG51bWJlcgorICBwYWRkaW5nIHNwYWNlIGdseXBocyBoYXZl IGEgY2hhcnBvcyBvZiAtMSwgd2hlcmVhcyB0aGUgZW5kIG9mIHJvdyBzcGFjZSBnbHlwaAorICBo YXMgYSBjaGFycG9zIG9mIDAuICBJZiBsaW5lIG51bWJlcnMgYXJlIGluYWN0aXZlLCB0aGVuIHRo ZSByb3cgd2lsbCBjb250YWluCisgIGEgc29saXRhcnkgc3BhY2UgZ2x5cGggd2l0aCBhIGNoYXJw b3Mgb2YgLTEuICovCisgIGJvb2wgcm93X2JleW9uZF96dl9wID0gKG1hdHJpeF9yb3dfc3RhcnRf Ynl0ZXBvcyA9PSBtYXRyaXhfcm93X2VuZF9ieXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAg ICAgICYmICFyb3dfYXRfenZfcCk7CisgIHJldHVybiAocm93X2F0X3p2X3ApCisgICAgICAgICAg ID8gQVRfWlYKKyAgICAgICAgIDogKHJvd19iZXlvbmRfenZfcCkKKyAgICAgICAgICAgPyBQT1NU X1pWCisgICAgICAgICA6IFBSRV9aVjsKK30KKworLyogVXBkYXRlIHRoZSBkaXNwbGF5IG9mIHRo ZSB0ZXh0IGFyZWEgb2Ygcm93IFZQT1MgaW4gd2luZG93IFcuCisg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nRmIChzdGRlcnIsICJtY191cGRhdGVfdGV4dF9hcmVhICglcyk6ICB2cG9zICgl ZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgbWNfd2luZG93ICh3KSwgdnBvcyk7CisgIC8q IEluYXNtdWNoIGFzIHdlIHByb2Nlc3MgdGhlIGN1cnNvciByb3cgYmVmb3JlIGFsbCBvdGhlciBy b3dzLCB3ZSBjYW4gcmVseQorICB1cG9uIHRoZSBwcmV2aW91cyBgZGVzaXJlZF9yb3dgIHRvIGJl IGFjY3VyYXRlLiAqLworICBlbnVtIG1jX3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24gPSAgbWNf cm93X3Bvc2l0aW9uICh3LCB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZGVzaXJlZF9yb3cK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBjdXJyZW50X3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZGVzaXJlZF9yb3csIHZwb3MpOworICAvKiBJZiByb3dzIGFyZSBh dCBkaWZmZXJlbnQgWCBvciBZLCBvciByb3dzIGhhdmUgZGlmZmVyZW50IGhlaWdodCwKKyAgICAg b3IgdGhlIGN1cnJlbnQgcm93IGlzIG1hcmtlZCBpbnZhbGlkLCB3cml0ZSB0aGUgZW50aXJlIGxp bmUuICovCisgIGlmICghY3VycmVudF9yb3ctPmVuYWJsZWRfcAorICAgICAgfHwgZGVzaXJlZF9y b3ctPnkgIT0gY3VycmVudF9yb3ctPnkKKyAgICAgIHx8IGRlc2lyZWRfcm93LT5hc2NlbnQgIT0g Y3VycmVudF9yb3ctPmFzY2VudAorICAgICAgfHwgZGVzaXJlZF9yb3ctPnBoeXNfYXNjZW50ICE9 IGN1cnJlbnRfcm93LT5waHlz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V1JJVEUgRU5USVJFIFJP VzpcblwKKyAgICAgICAgICB2cG9zICglZCkgfCBjaGFyICglZC8lcykgfCBzdGFydF94OiAoJWQp IHwgc3RhcnRfaHBvcyAoJWQvJWQpXG4iLAorICAgICAgICAgIHZwb3MsIGRlc2lyZWRfcm93LT5n bHlwaHNbVEVYVF9BUkVBXS0+dS5jaCwKKyAgICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAoZGVz aXJlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdLT51LmNoKSwKKyAgICAgICAgICBkZXNpcmVkX3Jv dy0+eCwgMCwgZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpOworICAgICAgaWYgKGRl c2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgIHsKKyAgICAgICAgICBibG9ja19p bnB1dCAoKTsKKyAgICAgICAgICBpbnQgbGVuID0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVB XTsKKyAgICAgICAgICBpbnQgaHBvcyA9IGRlc2lyZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSAt IHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICB3LT5vdXRwdXRfY3Vy c29yLnggPQorICAgICAgICAgICAgbWNfZHJhd19nbHlwaHMgKHcsIGRlc2lyZWRfbWF0cml4LCB1 cGRhdGVkX3Jvdywgdy0+b3V0cHV0X2N1cnNvci54LAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgIFRFWFRfQVJFQSwgaHBvcywgaHBvcyArIGxlbiwgRFJBV19OT1JNQUxfVEVYVCwgMCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29y X3R5cGUsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZl X3AsIGN1cnNvcl9nY19wLCBNQ19EUkFXX0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gc28gdGhhdCB0aGUgZmFjZSBleHRlbnNpb24g YWN0dWFsbHkgdGFrZXMgcGxhY2UuICovCisgICAgICAgIGlmIChNQVRSSVhfUk9XX0VYVEVORFNf RkFDRV9QIChkZXNpcmVkX3JvdykKKyAgICAgICAgICAgICYmIChkZXNpcmVkX3N0b3BfcG9zIDwg Y3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgIHx8IChkZXNpcmVk X3N0b3BfcG9zID09IGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAg ICAgICAgJiYgIU1BVFJJWF9ST1dfRVhURU5EU19GQUNFX1AgKGN1cnJlbnRfcm93KSkpKQorICAg ICAgICAgIC0tZGVzaXJlZF9zdG9wX3BvczsKKyAgICAgICAgc3RvcCA9IG1pbiAoY3VycmVudF9y b3ctPnVzZWRbVEVYVF9BUkVBXSwgZGVzaXJlZF9zdG9wX3Bvcyk7CisgICAgICAgIGkgPSAwOwor ICAgICAgICB4ID0gZGVzaXJlZF9yb3ctPng7CisgICAgICAgIGludCBjbGVhcl90b194ID0gMDsK KworICAgICAgICAvKiBMb29wIG92ZXIgZ2x5cGhzIHRoYXQgY3VycmVudCBhbmQgZGVzaXJlZCBy b3cgbWF5IGhhdmUgaW4gY29tbW9uLiAqLworICAgICAgICB3aGlsZSAoaSA8IHN0b3ApCisgICAg ICAgICAgeworICAgICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCA9IDA7CisgICAg ICAgICAgICBib29sIGNhbl9za2lwX3AgPSAhYWJvcnRfc2tpcHBpbmc7CisgICAgICAgICAgICAv KiBTa2lwIG92ZXIgZ2x5cGhzIHRoYXQgYm90aCByb3dzIGhhdmUgaW4gY29tbW9uLiAgVGhlc2Ug ZG9uJ3QgaGF2ZQorICAgICAgICAgICAgdG8gYmUgd3JpdHRlbi4gIFdlIGNhbid0IHNraXAgaWYg dGhlIGxhc3QgY3VycmVudCBnbHlwaCBvdmVybGFwcyB0aGUKKyAgICAgICAgICAgIGdseXBoIHRv IGl0cyByaWdodC4gIEZvciBleGFtcGxlLCBjb25zaWRlciBhIGN1cnJlbnQgcm93IG9mIGBpZicg d2l0aAorICAgICAgICAgICAgdGhlIGBmJyBpbiBDb3VyaWVyIGJvbGQgc28gdGhhdCBpdCBvdmVy bGFwcyB0aGUgYCAnIHRvIGl0cyByaWdodC4KKyAgICAgICAgICAgIElmIHRoZSBkZXNpcmVkIHJv dyBpcyBgICcsIHdlIHdvdWxkIHNraXAgb3ZlciB0aGUgc3BhY2UgYWZ0ZXIgdGhlCisgICAgICAg ICAgICBgaWYnIGFuZCB0aGVyZSB3b3VsZCByZW1haW4gYSBwaXhlbCBmcm9tIHRoZSBgZicgb24g dGhlIHNjcmVlbi4gKi8KKyAgICAgICAgICAgIGlmIChvdmVybGFwcGluZ19nbHlwaHNfcCAmJiBp ID4gMCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5 cGggPSAmY3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FSRUFdW2kgLSAxXTsKKyAgICAgICAgICAg ICAgICBpbnQgbGVmdCwgcmlnaHQ7CisgICAgICAgICAgICAgICAgcmlmLT5nZXRfZ2x5cGhfb3Zl cmhhbmdzIChnbHlwaCwgWEZSQU1FICh3LT5mcmFtZSksICZsZWZ0LCAmcmlnaHQpOworICAgICAg ICAgICAgICAgIGNhbl9za2lwX3AgPSAocmlnaHQgPT0gMCAmJiAhYWJvcnRfc2tpcHBpbmcpOwor ICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoY2FuX3NraXBfcCkKKyAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgIGludCBzdGFydF9ocG9zID0gaTsKKyAgICAgICAgICAgICAg ICB3aGlsZSAoaSA8IHN0b3AKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgR0xZUEhfRVFVQUxf UCAoZGVzaXJlZF9nbHlwaCwgY3VycmVudF9nbHlwaCkpCisgICAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICAgICsrYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZDsKKyAgICAgICAg ICAgICAgICAgICAgaWYgKGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZCA8IGFycmF5X2ds eXBoc19za2lwcGVkLnVzZWQpCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICAgICAgaW50IG9sZF9hbGxvYyA9IGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRl ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBuZXdfZWx0cyA9IGFycmF5X2dseXBoc19z a2lwcGVkLnVzZWQgLSBhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQ7CisgICAgICAgICAg ICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkID0KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgeHBhbGxvYyAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmFycmF5X2dseXBoc19za2lwcGVkLmFs bG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElOVF9NQVgsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAqYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBl ZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtZW1zZXQgKGFycmF5X2dseXBoc19za2lwcGVk LnNraXBwZWQgKyBvbGRfYWxsb2MsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkIC0gb2xkX2FsbG9jKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAqIHNpemVvZiAqYXJyYXlfZ2x5cGhzX3NraXBwZWQu c2tpcHBlZCk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBp bnQgbnRoID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCAtIDE7CisgICAgICAgICAgICAgICAg ICAgIGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbbnRoXS54ID0geDsKKyAgICAgICAgICAg ICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLmhwb3MgPSBpOworICAg ICAgICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkW250aF0uZW5hYmxl ZF9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgeCArPSBkZXNpcmVkX2dseXBoLT5waXhl bF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgKytkZXNpcmVkX2dseXBoLCArK2N1cnJlbnRf Z2x5cGgsICsraTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvKiBDb25z aWRlciB0aGUgY2FzZSB0aGF0IHRoZSBjdXJyZW50IHJvdyBjb250YWlucyAieHh4IHBwcCBnZ2ci IGluCisgICAgICAgICAgICAgICAgaXRhbGljIENvdXJpZXIgZm9udCwgYW5kIHRoZSBkZXNpcmVk IHJvdyBpcyAieHh4IGdnZyIuICBUaGUgY2hhcmFjdGVyIGBwJworICAgICAgICAgICAgICAgIGhh cyBsYmVhcmluZywgYGcnIGhhcyBub3QuICBUaGUgbG9vcCBhYm92ZSB3aWxsIHN0b3AgaW4gZnJv bnQgb2YgdGhlCisgICAgICAgICAgICAgICAgZmlyc3QgYHAnIGluIHRoZSBjdXJyZW50IHJvdy4g IElmIHdlIHdvdWxkIHN0YXJ0IHdyaXRpbmcgZ2x5cGhzIHRoZXJlLCB3ZQorICAgICAgICAgICAg ICAgIHdvdWxkbid0IGVyYXNlIHRoZSBsYmVhcmluZyBvZiB0aGUgYHAnLiAgVGhlIHJlc3Qgb2Yg dGhlIGxiZWFyaW5nIHByb2JsZW0KKyAgICAgICAgICAgICAgICBpcyB0aGVuIHRha2VuIGNhcmUg b2YgYnkgZHJhd19nbHlwaHMuICovCisgICAgICAgICAgICAgICAgaWYgKG92ZXJsYXBwaW5nX2ds eXBoc19wCisgICAgICAgICAgICAgICAgICAgICYmIGkgPiAwCisgICAgICAgICAgICAgICAgICAg ICYmIGkgPCBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAg ICYmIChjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IGRlc2lyZWRfcm93LT51c2VkW1RF WFRfQVJFQV0pKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpbnQg bGVmdCwgcmlnaHQ7CisgICAgICAgICAgICAgICAgICAgIHJpZi0+Z2V0X2dseXBoX292ZXJoYW5n cyAoY3VycmVudF9nbHlwaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBYRlJBTUUgKHct PmZyYW1lKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbGVmdCwgJnJpZ2h0KTsKKyAg ICAgICAgICAgICAgICAgICAgd2hpbGUgKGxlZnQgPiAwICYmIGkgPiAwKQorICAgICAgICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC0taSwgLS1kZXNpcmVkX2dseXBo LCAtLWN1cnJlbnRfZ2x5cGg7CisgICAgICAgICAgICAgICAgICAgICAgICB4IC09IGRlc2lyZWRf Z2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgbGVmdCAtPSBkZXNp cmVkX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgICAgICAgIC8qIEFib3J0IHRoZSBza2lwcGluZyBhbGdvcml0aG0gaWYgd2UgZW5kIHVw IGJlZm9yZQorICAgICAgICAgICAgICAgICAgICAgICBvdXIgc3RhcnRpbmcgcG9pbnQsIHRvIGF2 b2lkIGxvb3BpbmcgKGJ1ZyMxMDcwKS4KKyAgICAgICAgICAgICAgICAgICAgICAgVGhpcyBjYW4g aGFwcGVuIHdoZW4gdGhlIGxiZWFyaW5nIGlzIGxhcmdlciB0aGFuCisgICAgICAgICAgICAgICAg ICAgICAgIHRoZSBwaXhlbCB3aWR0aC4gKi8KKyAgICAgICAgICAgICAgICAgICAgYWJvcnRfc2tp cHBpbmcgPSAoaSA8IHN0YXJ0X2hwb3MpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAvKiBUcnkgdG8gYXZvaWQgd3JpdGluZyB0aGUgZW50aXJlIHJl c3Qgb2YgdGhlIGRlc2lyZWQgcm93CisgICAgICAgICAgICAgICBieSBsb29raW5nIGZvciBhIHJl c3luYyBwb2ludC4gIFRoaXMgbWFpbmx5IHByZXZlbnRzCisgICAgICAgICAgICAgICBtb2RlIGxp bmUgZmxpY2tlcmluZyBpbiB0aGUgY2FzZSB0aGUgbW9kZSBsaW5lIGlzIGluCisgICAgICAgICAg ICAgICBmaXhlZC1waXRjaCBmb250LCB3aGljaCBpdCB1c3VhbGx5IHdpbGwgYmUuICovCisgICAg ICAgICAgICBpZiAoaSA8IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICBpbnQgc3RhcnRfeCA9IHgsIHN0YXJ0X2hwb3MgPSBpOwor ICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqc3RhcnQgPSBkZXNpcmVkX2dseXBoOworICAg ICAgICAgICAgICAgIGludCBjdXJyZW50X3ggPSB4OworICAgICAgICAgICAgICAgIGJvb2wgc2tp cF9maXJzdF9wID0gIWNhbl9za2lwX3A7CisgICAgICAgICAgICAgICAgLyogRmluZCB0aGUgbmV4 dCBnbHlwaCB0aGF0J3MgZXF1YWwgYWdhaW4uICovCisgICAgICAgICAgICAgICAgd2hpbGUgKGkg PCBzdG9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIChza2lwX2ZpcnN0X3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgIHx8ICFHTFlQSF9FUVVBTF9QIChkZXNpcmVkX2dseXBoLCBjdXJy ZW50X2dseXBoKSkKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgeCA9PSBjdXJyZW50X3gpCisg ICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHggKz0gZGVzaXJlZF9nbHlw aC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfeCArPSBjdXJyZW50 X2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgKytkZXNpcmVkX2dseXBo LCArK2N1cnJlbnRfZ2x5cGgsICsraTsKKyAgICAgICAgICAgICAgICAgICAgc2tpcF9maXJzdF9w ID0gMDsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmb3IgKGludCBlbHQg PSAwOworICAgICAgICAgICAgICAgICAgICAgZWx0IDwgYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNl ZDsKKyAgICAgICAgICAgICAgICAgICAgICsrZWx0KQorICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICBpbnQgeCA9IGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbZWx0 XS54OworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGFycmF5X2dseXBoc19za2lwcGVk LnNraXBwZWRbZWx0XS5ocG9zOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnRh cmdldF9nbHlwaCA9CisgICAgICAgICAgICAgICAgICAgICAgbWNfZ2V0X2N1cnNvcl9nbHlwaCAo dywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBocG9zLCB2cG9zKTsKKyAgICAgICAgICAg ICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZiAoc3Rk ZXJyLCAiU0tJUFBFRDogIHZwb3MgKCVkKSB8IGNoYXIgKCVkLyVzKSB8IHg6ICglZCkgfCBocG9z ICglZC8lZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9z LCB0YXJnZXRfZ2x5cGgtPnUuY2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBtY19jaGFyX3RvX3N0cmluZyAodGFyZ2V0X2dseXBoLT51LmNoKSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHgsIGhwb3MsIHVwZGF0ZWRfcm93LT51c2VkW1RF WFRfQVJFQV0gLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgbWNfZHJhd19yb3cgKHcsIGRlc2ly ZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCB4LCAxLCB2cG9zLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93 X3Bvc2l0aW9uLCBkcmF3X3AsIFNLSVBQRUQpOworICAgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICAgIGlmIChpID09IHN0YXJ0X2hwb3MgfHwgeCAhPSBjdXJyZW50X3gpCisgICAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGkgPSBzdGFydF9ocG9zOworICAgICAg ICAgICAgICAgICAgICB4ID0gc3RhcnRfeDsKKyAgICAgICAgICAgICAgICAgICAgZGVzaXJlZF9n bHlwaCA9IHN0YXJ0OworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9zLCBzdGFydF9o cG9zLCBkZXNpcmVkX3Jvdy0+eSwgc3RhcnRfeCk7CisgICAgICAgICAgICAgICAgLyogUmUtZHJh dyBhIHBvcnRpb24gb2YgdGhlIHJvdy4gKi8KKyAgICAgICAgICAgICAgICBpZiAoZGVidWdfcCkK KyAgICAgICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlJFRFJBVyBTRUdNRU5UOlxuXAor ICAgICAgICAgICAgICAgICAgICB2cG9zICglZCkgfCBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwg aHBvcyAoJWQvJWQpIHwgbGVuZ3RoICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgIHZwb3Ms IHN0YXJ0LT51LmNoLCBtY19jaGFyX3RvX3N0cmluZyAoc3RhcnQtPnUuY2gpLAorICAgICAgICAg ICAgICAgICAgICBzdGFydF94LCBzdGFydF9ocG9zLCB1cGRhdGVkX3Jvdy0+dXNlZFtURVhUX0FS RUFdIC0gMSwgaSAtIHN0YXJ0X2hwb3MpOworICAgICAgICAgICAgICAgIGJsb2NrX2lucHV0ICgp OworICAgICAgICAgICAgICAgIGludCBsZW4gPSBpIC0gc3RhcnRfaHBvczsKKyAgICAgICAgICAg ICAgICBpbnQgaHBvcyA9IHN0YXJ0IC0gdXBkYXRlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdOwor ICAgICAgICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9CisgICAgICAgICAgICAgICAgICBt Y19kcmF3X2dseXBocyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB3LT5vdXRwdXRf Y3Vyc29yLngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVEVYVF9BUkVBLCBo cG9zLCBocG9zICsgbGVuLCBEUkFXX05PUk1BTF9URVhULAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDAsIHZwb3MsIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2Qs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwg Y3Vyc29yX2djX3AsIE1DX0RSQVdfR0xZUEhfU1RSSU5HLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGRyYXdfcCk7CisgICAgICAgICAgICAgICAgdy0+b3V0cHV0X2N1cnNvci5o cG9zICs9IGxlbjsKKyAgICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAg ICAgICAgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHN0YXJ0 LCBzdGFydF94LCBpIC0gc3RhcnRfaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg dnBvcywgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsIFND UklCRV9UV08pOworICAgICAgICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgICAg IH0KKyAgICAgICAgICB9CisKKyAgICAgICAgLyogV3JpdGUgdGhlIHJlc3QuICovCisgICAgICAg IGlmIChpIDwgZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICB7CisgICAg ICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9zLCBpLCBkZXNpcmVkX3Jvdy0+eSwgeCk7 CisgICAgICAgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJy LCAiRFJBVyBSRU1BSU5ERVIgT0YgVEhFIFJPVzpcblwKKyAgICAgICAgICAgICAgICB2cG9zICgl ZCkgfCBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwgaHBvcyAoJWQvJWQpIHwgbGVuZ3RoICglZClc biIsCisgICAgICAgICAgICAgICAgdnBvcywgZGVzaXJlZF9nbHlwaC0+dS5jaCwgbWNfY2hhcl90 b19zdHJpbmcgKGRlc2lyZWRfZ2x5cGgtPnUuY2gpLAorICAgICAgICAgICAgICAgIHgsIGksIGRl c2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxLCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FS RUFdIC0gaSk7CisgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgIGludCBs ZW4gPSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gaTsKKyAgICAgICAgICAgIGludCBo cG9zID0gZGVzaXJlZF9nbHlwaCAtIHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAg ICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9CisgICAgICAgICAgICAgIG1jX2RyYXdfZ2x5 cGhzICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHctPm91dHB1dF9jdXJzb3IueCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRFWFRfQVJFQSwgaHBvcywgaHBvcyArIGxl biwgRFJBV19OT1JNQUxfVEVYVCwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZw b3MsIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCwgTUNfRFJBV19H TFlQSF9TVFJJTkcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3ApOworICAg ICAgICAgICAgdy0+b3V0cHV0X2N1cnNvci5ocG9zICs9IGxlbjsKKyAgICAgICAgICAgIHVuYmxv Y2tfaW5wdXQgKCk7CisgICAgICAgICAgICAvKiBGSVhNRTogIEFsdGhvdWdoIHdlIG5lZWQgdG8g dXBkYXRlIHRoZSBjYWNoZSBiZXR3ZWVuIHRoZSBlbmQgb2YKKyAgICAgICAgICAgIHVwZGF0ZWRf cm93IGFuZCB0aGUgcmlnaHQgd2luZG93IGVkZ2UsIGl0IGlzIG5vdCBuZWNlc3NhcnkgdG8gZHJh dworICAgICAgICAgICAgdGhvc2UgZmFrZSBjdXJzb3JzLiBBbHRob3VnaCB3ZSBtYXkgbm90IGJl IGFibGUgdG8gc2VlIGl0IHdpdGggdGhlCisgICAgICAgICAgICBuYWtlZCBleWUsIHRob3NlIGZh a2UgY3Vyc29ycyBhcmUgYmVpbmcgc3VwZXJpbXBvc2VkIG9uIHRoZSBleGlzdGluZworICAgICAg ICAgICAgZmFrZSBjdXJzb3JzIHRoYXQgZG8gbm90IGdldCBlcmFzZWQgYnkgdGhlIGNvZGUgaW4g dGhlIHNlY3Rpb24gYmVsb3cuCisgICAgICAgICAgICBJdCB3b3VsZCBiZSBiZXR0ZXIgdG8gb25s eSB1cGRhdGUgdGhlIGNhY2hlIGFuZCBzdXBwcmVzcyBkb3VibGUtZHJhd2luZworICAgICAgICAg ICAgdGhlIGZha2UgY3Vyc29ycyBmb3IgdGhlIGFmb3JlbWVudGlvbmVkIGFyZWEgYXQgaXNzdWUu ICovCisgICAgICAgICAgICBtY19kcmF3X3JvdyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRf cm93LCBkZXNpcmVkX2dseXBoLCB4LAorICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2lyZWRf cm93LT51c2VkW1RFWFRfQVJFQV0gLSBpLCB2cG9zLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAg ICAgICAgICAgICAgICAgIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgZHJhd19wLCBTQ1JJQkVf VEhSRUUpOworICAgICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAgICAgICAgICB9CisgICAgICAg ICAgLyogRXZlcnl0aGluZyBhZnRlciB0aGUgcHJldmlvdXMgY2hhbmdlIHJlbWFpbmVkIHRoZSBz YW1lLiAgYGlgIGFuZCBgeGAgd2VyZQorICAgICAgICAgIGluY3JlbWVudGVkIHRvIHRoZSBlbmQg b2YgdGhlIGdseXBoIHJvdy4gIGkgPT0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAg ICAgICAgIFRoZSBgdy0+b3V0cHV0X2N1cnNvci54L3kvaHBvcy92cG9zYCBpcyBhdCB0aGUgZW5k IG9mIHRoZSBwcmV2aW91cyBjaGFuZ2UuCisgICAgICAgICAgV2hlbiB0aGlzIHNpdHVhdGlvbiBl eGlzdHMsIHRoZSBkaXN0YW5jZSBiZXR3ZWVuIHRoZSBlbmQgb2YgdGhlIGdseXBoIHJvdyBhbmQK KyAgICAgICAgICB0aGUgcmlnaHQgZWRnZSBvZiB0aGUgd2luZG93IHdpbGwgX25vdF8gYmUgY2xl YXJlZC4gIFRoZXJlZm9yZSwgaXQgaXMgb2theSB0bworICAgICAgICAgIGRyYXcgdGhlIGZsb2F0 aW5nIGdseXBocyBmb3IgdGhlIGhvcml6b250YWwvdmVydGljYWwgcnVsZXJzIGhlcmUuICovCisg ICAgICAgICAgZWxzZSBpZiAoY2hhbmdlZF9wCisgICAgICAgICAgICAgICAgICAgJiYgdy0+b3V0 cHV0X2N1cnNvci5ocG9zICE9IHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIGludCB4ID0gdy0+b3V0cHV0X2N1cnNvci54OworICAgICAg ICAgICAgICBpbnQgaHBvcyA9IHctPm91dHB1dF9jdXJzb3IuaHBvczsKKyAgICAgICAgICAgICAg c3RydWN0IGdseXBoICpzdGFydCA9IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGRlc2lyZWRfbWF0 cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgdXBkYXRlZF9yb3csIGhwb3MsIHZwb3MpOworICAgICAgICAgICAgICBpZiAody0+b3V0 cHV0X2N1cnNvci54ID09IHVwZGF0ZWRfcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAg ICB4IC09IHN0YXJ0LT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisg ICAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiUE9TVC1DSEFOR0VEOiAgdnBvcyAoJWQp IHwgeCAoJWQpIHwgaHBvcyAoJWQvJWQpIHwgY2hhciAoJWQvJXMpXG4iLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgdnBvcywgeCwgaHBvcywgdXBkYXRlZF9yb3ctPnVzZWRbVEVY VF9BUkVBXSAtIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydC0+dS5j aCwgbWNfY2hhcl90b19zdHJpbmcgKHN0YXJ0LT51LmNoKSk7CisgICAgICAgICAgICAgIG1jX2Ry YXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHN0YXJ0LCB4LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIGhwb3Ms IHZwb3MsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRp YWxzLCByb3dfcG9zaXRpb24sIGRyYXdfcCwgUE9TVF9DSEFOR0VEKTsKKyAgICAgICAgICAgIH0K KyAgICAgICAgICAgIC8qIFRoZXJlIHdlcmUgbm8gY2hhbmdlcyBhbmQgaSA9PSBkZXNpcmVkX3Jv dy0+dXNlZFtURVhUX0FSRUFdICovCisgICAgICAgICAgICBlbHNlIGlmICghY2hhbmdlZF9wKQor ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgICAg ICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJVTkNIQU5HRUQgLS0gV1JJVEUgRU5USVJFIExJTkU6 ICB2cG9zICglZCkgfCByb3ctPnVzZWQgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgdnBvcywgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpOworICAg ICAgICAgICAgICAgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3cs IGRlc2lyZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgZGVzaXJlZF9yb3ctPngsIGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0sIHZwb3Ms CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMs IHJvd19wb3NpdGlvbiwgZHJhd19wLCBVTkNIQU5HRUQpOworICAgICAgICAgICAgICB9CisKKyAg ICAgICAgLyogTWF5YmUgY2xlYXIgdG8gZW5kIG9mIGxpbmUuICovCisgICAgICAgIGlmIChNQVRS SVhfUk9XX0VYVEVORFNfRkFDRV9QIChkZXNpcmVkX3JvdykpCisgICAgICAgICAgeworICAgICAg ICAgICAgLyogSWYgbmV3IHJvdyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRleHQgYXJlYSwg bm90aGluZworICAgICAgICAgICAgICAgaGFzIHRvIGJlIGNsZWFyZWQsIGlmIGFuZCBvbmx5IGlm IHdlIGRpZCBhIHdyaXRlX2dseXBocworICAgICAgICAgICAgICAgYWJvdmUuICBUaGlzIGlzIG1h ZGUgc3VyZSBieSBzZXR0aW5nIGRlc2lyZWRfc3RvcF9wb3MKKyAgICAgICAgICAgICAgIGFwcHJv cHJpYXRlbHkgYWJvdmUuICovCisgICAgICAgICAgICBlYXNzZXJ0IChpIDwgZGVzaXJlZF9yb3ct PnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgfHwgKChkZXNpcmVkX3Jvdy0+ dXNlZFtURVhUX0FSRUFdID09IGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgTUFUUklYX1JPV19FWFRFTkRTX0ZBQ0VfUCAoY3VycmVudF9y b3cpKSk7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKE1BVFJJWF9ST1dfRVhURU5E U19GQUNFX1AgKGN1cnJlbnRfcm93KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyog SWYgb2xkIHJvdyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRleHQgYXJlYSwgY2xlYXIuICov CisgICAgICAgICAgICAgIGlmIChpID49IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisg ICAgICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgaSwgZGVzaXJlZF9yb3ct PnksIGRlc2lyZWRfcm93LT5waXhlbF93aWR0aCk7CisgICAgICAgICAgICAgIGlmIChkcmF3X3Ap CisgICAgICAgICAgICAgICAgcmlmLT5jbGVhcl9lbmRfb2ZfbGluZSAodywgdXBkYXRlZF9yb3cs IFRFWFRfQVJFQSwgLTEpOworICAgICAgICAgICAgICBjbGVhcl90b194ID0gLTE7CisgICAgICAg ICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlm IChkZXNpcmVkX3Jvdy0+cGl4ZWxfd2lkdGggPCBjdXJyZW50X3Jvdy0+cGl4ZWxfd2lkdGgpCisg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBPdGhlcndpc2UgY2xlYXIgdG8gdGhl IGVuZCBvZiB0aGUgb2xkIHJvdy4gIEV2ZXJ5dGhpbmcKKyAgICAgICAgICAgICAgICAgICBhZnRl ciB0aGF0IHBvc2l0aW9uIHNob3VsZCBiZSBjbGVhciBhbHJlYWR5LiAqLworICAgICAgICAgICAg ICAgIGludCB4bGltOworICAgICAgICAgICAgICAgIGlmIChpID49IGRlc2lyZWRfcm93LT51c2Vk W1RFWFRfQVJFQV0pCisgICAgICAgICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9z LCBpLCBkZXNpcmVkX3Jvdy0+eSwgZGVzaXJlZF9yb3ctPnBpeGVsX3dpZHRoKTsKKyAgICAgICAg ICAgICAgICAvKiBJZiBjdXJzb3IgaXMgZGlzcGxheWVkIGF0IHRoZSBlbmQgb2YgdGhlIGxpbmUs IG1ha2Ugc3VyZQorICAgICAgICAgICAgICAgICAgIGl0J3MgY2xlYXJlZC4gIE5vd2FkYXlzIHdl IGRvbid0IGhhdmUgYSBwaHlzX2N1cnNvcl9nbHlwaAorICAgICAgICAgICAgICAgICAgIHdpdGgg d2hpY2ggdG8gZXJhc2UgdGhlIGN1cnNvciAoYmVjYXVzZSB0aGlzIG1ldGhvZAorICAgICAgICAg ICAgICAgICAgIGRvZXNuJ3Qgd29yayB3aXRoIGxiZWFyaW5nL3JiZWFyaW5nKSwgc28gd2UgbXVz dCBkbyBpdCB0aGlzIHdheS4gKi8KKyAgICAgICAgICAgICAgICBpZiAodnBvcyA9PSB3LT5waHlz X2N1cnNvci52cG9zCisgICAgICAgICAgICAgICAgICAgICYmIChkZXNpcmVkX3Jvdy0+cmV2ZXJz ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgPyAody0+cGh5c19jdXJzb3IuaHBvcyA8IDAp CisgICAgICAgICAgICAgICAgICAgICAgICA6ICh3LT5waHlzX2N1cnNvci5ocG9zID49IGRlc2ly ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pKSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgICAgdy0+cGh5c19jdXJzb3Jfb25fcCA9IDA7CisgICAgICAgICAgICAgICAgICAg IHhsaW0gPSAtMTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICAgICAgeGxpbSA9IGN1cnJlbnRfcm93LT5waXhlbF93aWR0aDsKKyAg ICAgICAgICAgICAgICBpZiAoZHJhd19wKQorICAgICAgICAgICAgICAgICAgcmlmLT5jbGVhcl9l bmRfb2ZfbGluZSAodywgdXBkYXRlZF9yb3csIFRFWFRfQVJFQSwgeGxpbSk7CisgICAgICAgICAg ICAgICAgY2xlYXJfdG9feCA9IHhsaW07CisgICAgICAgICAgICAgICAgY2hhbmdlZF9wID0gMTsK KyAgICAgICAgICAgICAgfQorCisgICAgICAgIGlmIChjaGFuZ2VkX3AKKyAgICAgICAgICAgICYm IGNsZWFyX3RvX3ggIT0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgdGV4dF9hcmVh X3dpZHRoID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgIHN0 cnVjdCBtY19SR0IgZGVidWdfZmcgPSB7LnJlZCA9IDAuODY3LCAuZ3JlZW4gPSAwLjg2NywgLmJs dWUgPSAwLjg2N307CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnRhcmdldF9nbHlwaCA9Cisg ICAgICAgICAgICAgIHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHVwZGF0ZWRfcm93 LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgICAgICAgLyogYG1jX2VuZ2luZScgb25seSBk cmF3cyBhbiBNQ19HTFlQSCB3aGVuIHggPCB1cGRhdGVkX3Jvdy0+cGl4ZWxfd2lkdGguCisgICAg ICAgICAgICBUaGUgY3VycmVudCBkZXNpZ24gaW5oaWJpdHMgZHJhd2luZyBvdmVyIGFuIGV4aXN0 aW5nIGdseXBoIGF0IHRoZSBlbmQgb2YgYQorICAgICAgICAgICAgd29yZC13cmFwcGVkIGxpbmUu ICBTYWlkIGdseXBoIHJlY2VpdmVzIGEgZmFrZSBjdXJzb3IgaW4gZWl0aGVyIG9uZSBvZiB0aGUK KyAgICAgICAgICAgIHByZXZpb3VzIHNlY3Rpb25zIGFib3ZlLCBhbmQgc2hvdWxkIG5vdCBiZSBv dmVyd3JpdHRlbiB3aXRoIGFub3RoZXIgb25lLgorICAgICAgICAgICAgVGhpcyBkZXNpZ24gaXMg bmVlZGVkIGJlY2F1c2UgYSB3b3JkLXdyYXBwZWQgbGluZSBkb2VzIG5vdCByZWNlaXZlIGFuIGV4 dHJhCisgICAgICAgICAgICBzcGFjZSBsaWtlIG5vbi13b3JkLXdyYXBwZWQgbGluZXMgZG8uICov CisgICAgICAgICAgICBpbnQgeCA9IHVwZGF0ZWRfcm93LT5waXhlbF93aWR0aDsKKyAgICAgICAg ICAgIGludCBocG9zID0gdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDE7CisgICAgICAg ICAgICBpbnQgeF9saW1pdCA9IChjbGVhcl90b194ID09IC0xKQorICAgICAgICAgICAgICAgICAg ICAgICAgICA/IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICA6IGNs ZWFyX3RvX3g7CisgICAgICAgICAgICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKyAg ICAgICAgICAgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgICAgICAgICAgIHN0cnVjdCBidWZmZXIg KmIgPSBYQlVGRkVSIChidWYpOworICAgICAgICAgICAgYm9vbCBmaWxsX2NvbHVtbl90cnVtcHNf cCA9ICghTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgZmNfdmlzaWJsZSkp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54 ID09IGVzc2VudGlhbHMuZmNfeCk7CisgICAgICAgICAgICBpZiAodHJhY2VfcmVkaXNwbGF5X3Ap CisgICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX3VwZGF0ZV90ZXh0X2FyZWEgKGZs b2F0aW5nKTogIHZwb3MgKCVkKSB8IHhfbGltaXQgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICB2cG9zLCB4X2xpbWl0KTsKKyAgICAgICAgICAgIGlmIChCVUZGRVJQICh3 LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgZmNfdmlzaWJs ZSkpCisgICAgICAgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAg ICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAmJiAhTklMUCAoQlZBUiAoYiwgZmNfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAg ICAgICAmJiB4IDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFs cy5mY194ID49IHgKKyAgICAgICAgICAgICAgICAmJiB0YXJnZXRfZ2x5cGggIT0gTlVMTAorICAg ICAgICAgICAgICAgICYmIGRyYXdfcCkKKyAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBkZXNp cmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHRhcmdldF9nbHlwaCwgVEVYVF9BUkVBLAorICAgICAg ICAgICAgICAgICAgICAgICAgIHgsIHhfbGltaXQsIHVwZGF0ZWRfcm93LT55LCBocG9zLCB2cG9z LCBNQ19CQVIsIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNz ZW50aWFscywgcm93X3Bvc2l0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgIGRlYnVnX3Ag PyBkZWJ1Z19mZyA6IGVzc2VudGlhbHMuZmNfZmdbcm93X3Bvc2l0aW9uXSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICBGSUxMX0NPTFVNTiwgZHJhd19wLCBOT1dIRVJFLCBOT19DQUNIRSk7Cisg ICAgICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgJiYg IU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICYmICFOSUxQIChC VkFSIChiLCBjaF9ob3Jpem9udGFsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAmJiAoZXNzZW50 aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMuYWN0aXZl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9pbmFjdGl2 ZV93aW5kb3dzKSkpKQorICAgICAgICAgICAgICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAg ICAgICAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAg JiYgdGFyZ2V0X2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAmJiBkcmF3X3ApCisgICAg ICAgICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJn ZXRfZ2x5cGgsIFRFWFRfQVJFQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB4LCB4X2xpbWl0 LCB1cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfSEJBUiwgMSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sCisgICAg ICAgICAgICAgICAgICAgICAgICAgZGVidWdfcCA/IGRlYnVnX2ZnIDogZXNzZW50aWFscy5jaF9m Z1tyb3dfcG9zaXRpb25dLAorICAgICAgICAgICAgICAgICAgICAgICAgIEhPUklaT05UQUxfUlVM RVIsIGRyYXdfcCwgTk9XSEVSRSwgTk9fQ0FDSEUpOworICAgICAgICAgICAgaWYgKEJVRkZFUlAg KHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjcm9zc2hh aXJzKSkKKyAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVs ZXIpKQorICAgICAgICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAg ICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAg ICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAg ICAgICAgJiYgIWZpbGxfY29sdW1uX3RydW1wc19wCisgICAgICAgICAgICAgICAgJiYgeCA8IHRl eHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICYmIHZwb3MgIT0gdy0+Y3Vyc29yLnZwb3MK KyAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSB4CisgICAgICAgICAgICAgICAgJiYg dGFyZ2V0X2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAg ICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRf Z2x5cGgsIFRFWFRfQVJFQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB4LCB4X2xpbWl0LCB1 cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfQkFSLCAxLAorICAgICAgICAgICAgICAgICAg ICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwKKyAgICAgICAg ICAgICAgICAgICAgICAgICBkZWJ1Z19wID8gZGVidWdfZmcgOiBlc3NlbnRpYWxzLmNoX2ZnW3Jv d19wb3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HJhd19m cmluZ2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgfQorICAgICAgYm9vbCB1cGRhdGVkX3AgPSBt Y191cGRhdGVfdGV4dF9hcmVhICh3LCBkZXNpcmVkX3JvdywgdnBvcywgY3Vyc29yX21hdHJpeCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywg ZHJhd19wKTsKKyAgICAgIC8qIFVwZGF0ZSB0aGUgZGlzcGxheSBvZiB0aGUgdGV4dCBhcmVhLiAq LworICAgICAgaWYgKHVwZGF0ZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGNoYW5nZWRfcCA9 IDE7CisgICAgICAgICAgaWYgKGN1cnJlbnRfcm93LT5tb3VzZV9mYWNlX3ApCisgICAgICAgICAg ICAqbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wID0gMTsKKyAgICAgICAgfQorICAgICAgLyogVXBk YXRlIGRpc3BsYXkgb2YgdGhlIHJpZ2h0IG1hcmdpbiBhcmVhLCBpZiB0aGVyZSBpcyBvbmUuICov CisgICAgICBpZiAoIWRlc2lyZWRfcm93LT5mdWxsX3dpZHRoX3AgJiYgdy0+cmlnaHRfbWFyZ2lu X2NvbHMgPiAwKQorICAgICAgICB7CisgICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAgICAgICAg ICB1cGRhdGVfbWFyZ2luYWxfYXJlYSAodywgZGVzaXJlZF9yb3csIFJJR0hUX01BUkdJTl9BUkVB LCB2cG9zKTsKKyAgICAgICAgfQorICAgICAgLyogRHJhdyB0cnVuY2F0aW9uIG1hcmtzIGV0Yy4g Ki8KKyAgICAgIGlmICghY3VycmVudF9yb3ctPmVuYWJsZWRfcAorICAgICAgICAgIHx8IGRlc2ly ZWRfcm93LT55ICE9IGN1cnJlbnRfcm93LT55CisgICAgICAgICAgfHwgZGVzaXJlZF9yb3ctPnZp c2libGVfaGVpZ2h0ICE9IGN1cnJlbnRfcm93LT52aXNpYmxlX2hla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zZWRbTUNfQ0FDSEVdID4gMAorICAgICAgICAgICAgICAgICAgIHx8 IG9sZF9tYXRyaXguY3Vyc29yc191c2VkW0NIX0NBQ0hFXSA+IDAKKyAgICAgICAgICAgICAgICAg ICB8fCBvbGRfbWF0cml4LmN1cnNvcnNfdXNlZFtGQ19DQUNIRV0gPiAwKTsKKyAgYm9vbCBnb190 d29fcCA9IChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAmJiAoIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAg ICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zp c2libGUpKQorICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBtY19jb25mKSkpKTsKKyAgYm9vbCB1cGRhdGluZ19mcmFtZV9wID0gZmFs c2U7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBpZiAoWEZSQU1F ICh3LT5mcmFtZSkgIT0gZi0+bWNfdXBkYXRpbmdfZnJhbWUKKyAgICAgICYmIChnb19vbmVfcCB8 fCBnb190d29fcCkpCisgICAgeworICAgICAgdXBkYXRpbmdfZnJhbWVfcCA9IHRydWU7CisgICAg ICB1cGRhdGVfYmVnaW4gKGYpOworICAgIH0KKyAgaWYgKHctPnBoeXNfY3Vyc29yX29uX3AKKyAg ICAgICYmIGdvX3R3b19wKQorICAgIGVyYXNlX3BoeXNfY3Vyc29yICh3KTsKKyAgZm9yIChpbnQg dm50aCA9IDA7CisgICAgICAgZ29fb25lX3AKKyAgICAgICAmJiB2bnRoIDwgdy0+bWNfbWF0cml4 LnZwb3NfdXNlZDsKKyAgICAgICArK3ZudGgpCisgICAgeworICAgICAgZm9yIChlbnVtIG1jX2Nh Y2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgICAgICBjYWNoZV90eXBlIDwg Tk9fQ0FDSEU7CisgICAgICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICAgICAgZm9yIChpbnQgbnRo XzAgPSAwOworICAgICAgICAgICAgIG1jX3RyYXZlcnNlX2NhY2hlX3AgKG9sZF9tYXRyaXgsIGNh Y2hlX3R5cGUsIHZudGgsIG50aF8wKTsKKyAgICAgICAgICAgICArK250aF8wKQorICAgICAgICAg IHsKKyAgICAgICAgICAgIGJvb2wgc2FtZV9wID0gZmFsc2U7CisgICAgICAgICAgICBmb3IgKGlu dCB3X250aCA9IDA7IHdfbnRoIDwgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtj YWNoZV90eXBlXTsgKyt3X250aCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNh bWVfcCB8PSAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5n bHlwaC50eXBlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC50eXBlCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzBdLmdseXBoLmJ5dGVwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLmJ5 dGVwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGguY2hhcnBvcworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVt3X250aF0uZ2x5cGguY2hhcnBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC51LnZhbAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudS52YWwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0u Z2x5cGguZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguZmFjZV9pZAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS5nbHlwaC5wYWRkaW5nX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LmdseXBoLnBhZGRpbmdfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5sZWZ0X2JveF9saW5l X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLmxlZnRfYm94X2xpbmVfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8wXS5nbHlwaC5yaWdodF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS5nbHlwaC5yaWdodF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnZv ZmZzZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnZvZmZzZXQKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMF0uZ2x5cGgucGl4ZWxfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBo LnBpeGVsX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnNsaWNlLmltZy54CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcueAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8w XS5nbHlwaC5zbGljZS5pbWcueQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguc2xpY2Uu aW1nLnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGguc2xpY2UuaW1nLndpZHRoCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcud2lkdGgKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf MF0uZ2x5cGguc2xpY2UuaW1nLmhlaWdodAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9 PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgu c2xpY2UuaW1nLmhlaWdodAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5zbGljZS5jbXAuZnJv bQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguc2xpY2UuY21wLmZyb20KKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0ueAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ueAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS5meAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZngKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0u eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ueQorICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5meQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVt3X250aF0uZnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uaHBvcworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0uaHBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS52cG9zCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS52cG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLndkCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW3dfbnRoXS53ZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5oCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3dfbnRoXS5oCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmN1cnNvcl90eXBlCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS5jdXJzb3JfdHlwZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5jdXJzb3Jfd2lkdGgK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmN1cnNvcl93aWR0aAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8w XS5mZy5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmZnLnJlZAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS5mZy5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZmcuZ3JlZW4KKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0uZmcuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZmcuYmx1ZQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS5iZy5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmJnLnJlZAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8wXS5iZy5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uYmcu Z3JlZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYmcuYmx1ZQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250 aF0uYmcuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5hY3RpdmVfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVt3X250aF0uYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGhfZmxhdm9yCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaF9mbGF2b3IKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZW5h YmxlZF9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5lbmFibGVkX3ApOworICAgICAgICAgICAg ICAgIC8qIEZvcmNlIHRoZSBmcmluZ2UgYml0bWFwcyB0byBhbHdheXMgYmUgcmVzZXQvcmVkcmF3 bi4gKi8KKyAgICAgICAgICAgICAgICBpZiAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS5jdXJzb3JfdHlwZQorICAgICAgICAgICAgICAgICAgICAgID09IHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5jdXJzb3JfdHlw ZQorICAgICAgICAgICAgICAgICAgICAmJiAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS5jdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVAKKyAg ICAgICAgICAgICAgICAgICAgICAgIHx8IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMF0uY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkpCisg ICAgICAgICAgICAgICAgICBzYW1lX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBpZiAoc2Ft ZV9wKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvLyAgZnByaW50 ZiAoc3RkZXJyLCAiSElUICglcyk6ICB2cG9zICglZCkgfCBocG9zICglZCkgfCBjaGFyICglcylc biIsCisgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIChjYWNoZV90eXBl ID09IE1DX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAg ID8gIk1DIgorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICA6IChjYWNo ZV90eXBlID09IENIX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAg ICAgICAgID8gIkNIIgorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICA6 IChjYWNoZV90eXBlID09IEZDX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAg ICAgICAgICAgICAgID8gIkZDIgorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAg ICAgICA6ICJOTyIsCisgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS52cG9zLAorICAg ICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uaHBvcywKKyAgICAgICAgICAgICAgICAgICAg Ly8gICAgICAgICAgICAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC51LmNoKSk7CisgICAgICAgICAg ICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRo XS5zYW1lX3AgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgICAgIC8vICBmcHJpbnRmIChzdGRlcnIsICJNSVNTICglcyk6ICB2 cG9zICglZCkgfCBocG9zICglZCB2LiAlZCkgfCBjaGFyICglcyB2LiAlcykgfCBjYWNoZV91c2Vk ICglZCB2LiAlZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAg ICAgKGNhY2hlX3R5cGUgPT0gTUNfQ0FDSEUpCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAg ICAgICAgICAgICAgICAgICA/ICJNQyIKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAg ICAgICAgICAgICA6IChjYWNoZV90eXBlID09IENIX0NBQ0hFKQorICAgICAgICAgICAgICAgICAg ICAgIC8vICAgICAgICAgICAgICAgICAgICAgPyAiQ0giCisgICAgICAgICAgICAgICAgICAgICAg Ly8gICAgICAgICAgICAgICAgICAgOiAoY2FjaGVfdHlwZSA9PSBGQ19DQUNIRSkKKyAgICAgICAg ICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgID8gIkZDIgorICAgICAgICAgICAg ICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIDogIk5PIiwKKyAgICAgICAgICAgICAgICAg ICAgICAvLyAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0udnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAg ICAgICAgICAgICBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBd Lmhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgdy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmhwb3MsCisgICAgICAg ICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgudS5jaCks CisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgbWNfY2hhcl90b19z dHJpbmcgKHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5n bHlwaC51LmNoKSwKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSwKKyAgICAgICAgICAg ICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZV91c2VkW2NhY2hlX3R5cGVdKTsKKyAgICAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uc2FtZV9wID0gZmFsc2U7Cisg ICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKCFz YW1lX3ApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBgbWF0cml4X3Jvdycg aW4gYGRpc3BuZXcuY2AgY29udGFpbnMgdGhlIGZvbGxvd2luZyB0ZXN0cywKKyAgICAgICAgICAg ICAgICBlYXNzZXJ0IChtYXRyaXggJiYgbWF0cml4LT5yb3dzKTsKKyAgICAgICAgICAgICAgICBl YXNzZXJ0IChyb3cgPj0gMCAmJiByb3cgPCBtYXRyaXgtPm5yb3dzKTsgKi8KKyAgICAgICAgICAg ICAgICBib29sIGJhcmZfY3Jhc2hfb25lID0gKHctPmN1cnJlbnRfbWF0cml4ICYmIHctPmN1cnJl bnRfbWF0cml4LT5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgICAgICAgICAgICAgICBpZiAoYmFy Zl9jcmFzaF9vbmUpCisgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAg ICBib29sIGJhcmZfY3Jhc2hfdHdvID0gKHZudGggPj0gMCAmJiB2bnRoIDwgdy0+Y3VycmVudF9t YXRyaXgtPm5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgICAgICAgICAgICAgICBpZiAoYmFyZl9j cmFzaF90d28pCisgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICBz dHJ1Y3QgZ2x5cGhfcm93ICp2bnRoX3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4 LCB2bnRoKTsKKyAgICAgICAgICAgICAgICBpbnQgeF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS54OworICAgICAgICAgICAgICAgIGludCBmeF8wID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5meDsKKyAgICAg ICAgICAgICAgICBpbnQgeV8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS55OworICAgICAgICAgICAgICAgIGludCBmeV8wID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5meTsKKyAgICAgICAgICAgICAgICBpbnQg aHBvc18wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5o cG9zOworICAgICAgICAgICAgICAgIGludCB2cG9zXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnZwb3M7CisgICAgICAgICAgICAgICAgaW50IHdkXzAg PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLndkOworICAg ICAgICAgICAgICAgIGludCBoXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXzBdLmg7CisgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJz b3JfdHlwZV8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8w XS5jdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoXzAgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmN1cnNvcl93aWR0aDsK KyAgICAgICAgICAgICAgICAvLyAgc3RydWN0IG1jX1JHQiBsc2xfZmdfMCA9IHsucmVkID0gb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5mZy5yZWQsCisgICAg ICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5mZy5ncmVlbiwKKyAgICAg ICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcuYmx1ZX07CisgICAgICAg ICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfYmdfMCA9IHsucmVkID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5iZy5yZWQsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmJnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzBdLmJnLmJsdWV9OworICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZl X3BfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYWN0 aXZlX3A7CisgICAgICAgICAgICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yXzAgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoX2ZsYXZv cjsKKyAgICAgICAgICAgICAgICBib29sIGVuYWJsZWRfcF8wID0gb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5lbmFibGVkX3A7CisgICAgICAgICAgICAgICAg aWYgKHZwb3NfMCA9PSB2bnRoCisgICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvcl8w ID09IE1DX0dMWVBICisgICAgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcF8wCisgICAgICAg ICAgICAgICAgICAgICYmIHZudGhfcm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAgIG1jX2VyYXNlX2N1cnNvciAodywgdy0+Y3VycmVudF9tYXRy aXgsIHZudGhfcm93LCB4XzAsIHlfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBocG9zXzAsIHZwb3NfMCwgZ2x5cGhfZmxhdm9yXzAsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGVfMCwgd2RfMCk7CisgICAgICAgICAgICAgICAg ICAgIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZW5hYmxl ZF9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIC0tb2xkX21hdHJpeC5jdXJzb3JzX3Vz ZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgICAgICAgICAgIC8qIElmIHdlIGluYWR2ZXJ0ZW50 bHkgZXJhc2VkIGFub3RoZXIgZmFrZSBjdXJzb3IgYXQgdGhlIHNhbWUKKyAgICAgICAgICAgICAg ICAgICAgSFBPUyB0aGF0IGlzIHN0aWxsIGVuYWJsZWRfcCBpbiB0aGUgYG9sZF9tYXRyaXhgLCB0 aGVuIHJlZHJhdyBpdC4gKi8KKyAgICAgICAgICAgICAgICAgICAgZm9yIChlbnVtIG1jX2NhY2hl X3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgICAgICAgICAgICAgICAgICAgIGNh Y2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICArK2NhY2hlX3R5 cGUpCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZm9y IChpbnQgbnRoXzEgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY190cmF2ZXJz ZV9jYWNoZV9wIChvbGRfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGhfMSk7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICsrbnRoXzEpCisgICAgICAgICAgICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeF8xID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS54OworICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGludCBmeF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8xXS5meDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeV8xID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS55OworICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGludCBmeV8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8xXS5meTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaHBv c18xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5ocG9z OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB2cG9zXzEgPSBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLnZwb3M7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaW50IHdkXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXzFdLndkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBoXzEgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmg7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZV8xID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5jdXJzb3JfdHlw ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoXzEgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmN1cnNvcl93aWR0aDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZ18xID0gey5y ZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZnLnJl ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0u ZmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMV0uZmcuYmx1ZX07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIHN0cnVjdCBt Y19SR0IgbHNsX2JnXzEgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMV0uYmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAg ICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMV0uYmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmJnLmJsdWV9OworICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3BfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMV0uYWN0aXZlX3A7CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICBib29sIGVuYWJsZWRfcF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8xXS5lbmFibGVkX3A7CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgYm9vbCBnb19wXzEgPSAoaHBvc18wID09IGhwb3NfMQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcF8xKTsKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICBpZiAoIWdvX3BfMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3BfMSA9 IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlk ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgdm50aF9yb3csIHhfMSwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnhfMSwgeV8xLCBmeV8xLCBocG9zXzEs IHZwb3NfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgd2RfMSwgaF8xLCBjdXJzb3JfdHlwZV8xLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGhfMSwgbHNsX2ZnXzEsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wXzEsIGds eXBoX2ZsYXZvcl8xLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICByZW1vdmVfcF8xKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAg IGVsc2UgaWYgKHZwb3NfMCA9PSB2bnRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBl bmFibGVkX3BfMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdm50aF9yb3ctPmVuYWJs ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGJvb2wg cmVtb3ZlX3BfMCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgbWNfZHJhd19lcmFzZV9o eWJyaWQgKHcsIHctPmN1cnJlbnRfbWF0cml4LCB2bnRoX3JvdywgeF8wLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmeF8wLCB5XzAsIGZ5XzAsIGhwb3NfMCwg dnBvc18wLCB3ZF8wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBoXzAsIGN1cnNvcl90eXBlXzAsIGN1cnNvcl93aWR0aF8wLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBsc2xfYmdfMCwgYWN0aXZlX3BfMCwgZ2x5cGhfZmxh dm9yXzAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92 ZV9wXzApOworICAgICAgICAgICAgICAgICAgICAgIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMF0uZW5hYmxlZF9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAg ICAgICAgLS1vbGRfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICAg ICAgICAgICAgICAvKiBJZiB3ZSBpbmFkdmVydGVudGx5IGVyYXNlZCBhbm90aGVyIGZha2UgY3Vy c29yIGF0IHRoZSBzYW1lCisgICAgICAgICAgICAgICAgICAgICAgSFBPUyB0aGF0IGlzIHN0aWxs IGVuYWJsZWRfcCBpbiB0aGUgYG9sZF9tYXRyaXhgLCB0aGVuIHJlZHJhdyBpdC4gKi8KKyAgICAg ICAgICAgICAgICAgICAgICBmb3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNf Q0FDSEU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7 CisgICAgICAgICAgICAgICAgICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgICAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IG50aF8yID0g MDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY190cmF2ZXJzZV9jYWNoZV9wIChv bGRfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGhfMik7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKytudGhfMikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS54OworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgaW50IGZ4XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzJdLmZ4OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHlfMiA9IG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0ueTsKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGludCBmeV8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8yXS5meTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBo cG9zXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmhw b3M7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgdnBvc18yID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS52cG9zOworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgaW50IHdkXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzJdLndkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50 IGhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uaDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29y X3R5cGVfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0u Y3Vyc29yX3R5cGU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dp ZHRoXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmN1 cnNvcl93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0Ig bHNsX2ZnXzIgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMl0uZmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzJdLmZnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZmcuYmx1ZX07CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAvLyAgc3RydWN0IG1jX1JHQiBsc2xfYmdfMiA9IHsucmVkID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5iZy5yZWQsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmJnLmdyZWVuLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAg ICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJd LmJnLmJsdWV9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBhY3RpdmVfcF8y ID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5hY3RpdmVf cDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2Zs YXZvcl8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5n bHlwaF9mbGF2b3I7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGVuYWJsZWRf cF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5lbmFi bGVkX3A7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGdvX3BfMiA9IChocG9z XzAgPT0gaHBvc18yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBmeF8wIDw9IGZ4XzIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIGZ4XzAgKyB3ZF8wID4gZnhfMiArIHdkXzIKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcF8yKTsKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGlmICghZ29fcF8yKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVtb3Zl X3BfMiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfZHJhd19lcmFz ZV9oeWJyaWQgKHcsIHctPmN1cnJlbnRfbWF0cml4LCB2bnRoX3JvdywgeF8yLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ4XzIsIHlfMiwgZnlf MiwgaHBvc18yLCB2cG9zXzIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgd2RfMiwgaF8yLCBjdXJzb3JfdHlwZV8yLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aF8yLCBsc2xf ZmdfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBhY3RpdmVfcF8yLCBnbHlwaF9mbGF2b3JfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVfcF8yKTsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgIH0KKyAgaWYgKHVwZGF0 aW5nX2ZyYW1lX3ApCisgICAgdXBkYXRlX2VuZCAoZik7Cit9CisKK3ZvaWQKK21jX3VwZGF0ZV93 aW5kb3dfZHJ5cnVuIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3AsIHN0cnVjdCBtY19l c3NlbnRpYWxzIGVzc2VudGlhbHMpCit7CisgIGlmICghQlVGRkVSUCAody0+Y29udGVudHMpKQor ICAgIHJldHVybjsKKworICBpZiAody0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtNQ19DQUNIRV0g PT0gMAorICAgICAgJiYgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtDSF9DQUNIRV0gPT0gMAor ICAgICAgJiYgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtGQ19DQUNIRV0gPT0gMAorICAgICAg JiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICYm IE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAm JiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkKKyAgICBy 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gICAgICB9CisgICAgICAgIGVsc2UK KyAgICAgICAgICBoZWFkZXJfbGluZV9yb3cgPSBOVUxMOworCisgICAgICAvKiBVcGRhdGUgdGhl IG1vZGUgbGluZSwgaWYgbmVjZXNzYXJ5LiAqLworICAgICAgc3RydWN0IGdseXBoX3JvdyAqbW9k ZV9saW5lX3JvdyA9IE1BVFJJWF9NT0RFX0xJTkVfUk9XIChkZXNpcmVkX21hdHJpeCk7CisgICAg ICBpZiAobW9kZV9saW5lX3Jvdy0+bW9kZV9saW5lX3AgJiYgbW9kZV9saW5lX3Jvdy0+ZW5hYmxl ZF9wKQorICAgICAgICB7CisgICAgICAgICAgbW9kZV9saW5lX3Jvdy0+eSA9IHliICsgV0lORE9X X1NDUk9MTF9CQVJfQVJFQV9IRUlHSFQgKHcpOworICAgICAgICAgIHVwZGF0ZV93aW5kb3dfbGlu ZSAodywgTUFUUklYX1JPV19WUE9TIChtb2RlX2xpbmVfcm93LAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNpcmVkX21hdHJpeCksCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wKTsKKyAgICAg ICAgfQorCisgICAgICAvKiBGaW5kIGZpcnN0IGVuYWJsZWQgcm93LiAgT3B0aW1pemF0aW9ucyBp biByZWRpc3BsYXlfaW50ZXJuYWwKKyAgICAgICAgIG1heSBsZWFkIHRvIGFuIHVwZGF0ZSB3aXRo IG9ubHkgb25lIHJvdyBlbmFibGVkLiAgVGhlcmUgbWF5CisgICAgICAgICBiZSBhbHNvIGNvbXBs ZXRlbHkgZW1wdHkgbWF0cmljZXMuICovCisgICAgICB3aGlsZSAocm93IDwgZW5kICYmICFyb3ct PmVuYWJsZWRfcCkKKyAgICAgICAgKytyb3c7CisKKyAgICAgIC8qIFRyeSByZXVzaW5nIHBhcnQg b2YgdGhlIGRpc3BsYXkgYnkgY29weWluZy4gKi8KKyAgICAgIGlmIChyb3cgPCBlbmQgJiYgIXct PmRlc2lyZWRfbWF0cml4LT5ub19zY3JvbGxpbmdfcCkKKyAgICAgICAgeworICAgICAgICAgIGlu dCByYyA9IG1jX3Njcm9sbGluZ193aW5kb3cgKHcsIGhlYWRlcl9saW5lX3JvdyAhPSBOVUxMKTsK KyAgICAgICAgICBpZiAocmMgPCAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBB bGwgcm93cyB3ZXJlIGZvdW5kIHRvIGJlIGVxdWFsLiAqLworICAgICAgICAgICAgICBwYXVzZWRf cCA9IDA7CisgICAgICAgICAgICAgIGdvdG8gc2V0X2N1cnNvcjsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgICAgIGVsc2UgaWYgKHJjID4gMCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgIC8qIFdlJ3ZlIHNjcm9sbGVkIHRoZSBkaXNwbGF5LiAqLworICAgICAgICAgICAgICAgIGZv cmNlX3AgPSAxOworICAgICAgICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgICAg IH0KKyAgICAgICAgfQorICAgICAgLyogUHJvY2VzcyB0aGUgY3Vyc29yIHJvdyBhdCB0aGUgb3V0 c2V0IGlmIGl0IGlzIHdpdGhpbiBgZGVzaXJlZF9tYXRyaXhgLgorICAgICAgV2hlbiBwcm9jZXNz aW5nIGFsbCBvdGhlciByb3dzLCB3ZSB3aWxsIHF1ZXJ5IHRoZSBgdy0+Y3VycmVudF9tYXRyaXhg IGZvciBkYXRhCisgICAgICByZWxhdGluZyB0byB0aGUgY3Vyc29yIHJvdy4gIGBtYWtlX2N1cnJl bnRgICh3aXRoaW4gYHVwZGF0ZV93aW5kb3dfbGluZScpCisgICAgICB1cGRhdGVzIHRoZSBgdy0+ Y3VycmVudF9tYXRyaXhgIGZvciB0aGUgYXBwbGljYWJsZSByb3cuICBJbiBkb2luZyBzbywgaG93 ZXZlciwKKyAgICAgIHRoZSBhcHBsaWNhYmxlIHJvdyBpbiB0aGUgZGVzaXJlZCBtYXRyaXggaXMg YWx0ZXJlZCBzdWNoIHRoYXQgd2UgY2FuIG5vIGxvbmdlcgorICAgICAgcmVseSB1cG9uIHRoZSBh Y2N1cmFjeSBvZiBgUk9XLT51c2VkW1RFWFRfQVJFQV1gLiAgVGhlcmVmb3JlLCB3ZSBtdXN0IG5v dyByZWx5CisgICAgICBleGNsdXNpdmVseSB1cG9uIGB3LT5jdXJyZW50X21hdHJpeCcgZm9yIGN1 cnNvciByb3cgYmFzZWQgZGVjaXNpb25zLiAqLworICAgICAgZm9yIChzdHJ1Y3QgZ2x5cGhfcm93 ICptY19yb3cgPSByb3c7CisgICAgICAgICAgIG1jX3JvdyA8IGVuZCAmJiAoZm9yY2VfcCB8fCAh aW5wdXRfcGVuZGluZyk7CisgICAgICAgICAgICsrbWNfcm93KQorICAgICAgICB7CisgICAgICAg ICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKG1jX3Jvdywgdy0+ZGVzaXJlZF9tYXRyaXgp OworICAgICAgICAgIGlmIChtY19yb3ctPmVuYWJsZWRfcAorICAgICAgICAgICAgICAmJiB2cG9z ID09IHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjdXJzb3Jf bWF0cml4ID0gdy0+ZGVzaXJlZF9tYXRyaXg7CisgICAgICAgICAgICAgIGlmICghZm9yY2VfcCAm JiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkKKyAgICAgICAgICAgICAgICBkZXRl Y3RfaW5wdXRfcGVuZGluZ19pZ25vcmVfc3F1ZWV6YWJsZXMgKCk7CisgICAgICAgICAgICAgIGNo YW5nZWRfcCB8PSBtY191cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292 ZXJ3cml0dGVuX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIGRyYXdfcCk7CisgICAgICAgICAgICAg IGlmIChNQVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHliKQorICAgICAgICAgICAgICAgIGZv ciAoaW50IGkgPSB2cG9zICsgMTsgaSA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93cyAtIDE7ICsr aSkKKyAgICAgICAgICAgICAgICAgIFNFVF9NQVRSSVhfUk9XX0VOQUJMRURfUCAody0+Y3VycmVu dF9tYXRyaXgsIGksIGZhbHNlKTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICAgIGN1cnNvcl9tYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAg ICAgIC8qIFVwZGF0ZSB0aGUgcmVzdCBvZiB0aGUgbGluZXMuICovCisgICAgICBmb3IgKDsgcm93 IDwgZW5kICYmIChmb3JjZV9wIHx8ICFpbnB1dF9wZW5kaW5nKTsgKytyb3cpCisgICAgICAgIC8q IHNjcm9sbGluZ193aW5kb3cgcmVzZXRzIHRoZSBlbmFibGVkX3AgZmxhZyBvZiB0aGUgcm93cyBp dCByZXVzZXMgZnJvbQorICAgICAgICBjdXJyZW50X21hdHJpeC4gKi8KKyAgICAgICAgaWYgKHJv dy0+ZW5hYmxlZF9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCB2cG9zID0gTUFUUklY X1JPV19WUE9TIChyb3csIHctPmRlc2lyZWRfbWF0cml4KTsKKyAgICAgICAgICAgIC8qIElmIHRo ZSBgY3Vyc29yX3Jvd2AgaXMgd2l0aGluIHRoZSBgZGVzaXJlZF9tYXRyaXhgLCB0aGVuIGl0IHdh cworICAgICAgICAgICAgcHJvY2Vzc2VkIGhlcmVpbmFib3ZlIGFuZCBzaG91bGQgYmUgc2tpcHBl ZCBhdCB0aGlzIHRpbWUuICovCisgICAgICAgICAgICBpZiAodnBvcyA9PSB3LT5jdXJzb3IudnBv cykKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgaW50IGk7CisgICAgICAgICAg ICAvKiBXZSdsbCBoYXZlIHRvIHBsYXkgYSBsaXR0bGUgYml0IHdpdGggd2hlbiB0bworICAgICAg ICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmcuICBJZiBpdCdzIGRvbmUgdG9vIG9mdGVuLAor ICAgICAgICAgICAgICAgc2Nyb2xsaW5nIGxhcmdlIHdpbmRvd3Mgd2l0aCByZXBlYXRlZCBzY3Jv bGwtdXAKKyAgICAgICAgICAgICAgIGNvbW1hbmRzIHdpbGwgdG9vIHF1aWNrbHkgcGF1c2UgcmVk aXNwbGF5LiAqLworICAgICAgICAgICAgaWYgKCFmb3JjZV9wICYmICsrbl91cGRhdGVkICUgcHJl ZW1wdF9jb3VudCA9PSAwKQorICAgICAgICAgICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZ19pZ25v cmVfc3F1ZWV6YWJsZXMgKCk7CisgICAgICAgICAgICBjaGFuZ2VkX3AgfD0gbWNfdXBkYXRlX3dp bmRvd19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNz ZW50aWFscywgZHJhd19wKTsKKyAgICAgICAgICAgIC8qIE1hcmsgYWxsIHJvd3MgYmVsb3cgdGhl IGxhc3QgdmlzaWJsZSBvbmUgaW4gdGhlIGN1cnJlbnQKKyAgICAgICAgICAgICAgIG1hdHJpeCBh cyBpbnZhbGlkLiAgVGhpcyBpcyBuZWNlc3NhcnkgYmVjYXVzZSBvZgorICAgICAgICAgICAgICAg dmFyaWFibGUgbGluZSBoZWlnaHRzLiAgQ29uc2lkZXIgdGhlIGNhc2Ugb2YgdGhyZWUKKyAgICAg ICAgICAgICAgIHN1Y2Nlc3NpdmUgcmVkaXNwbGF5cywgd2hlcmUgdGhlIGZpcnN0IGRpc3BsYXlz IDUKKyAgICAgICAgICAgICAgIGxpbmVzLCB0aGUgc2Vjb25kIDMgbGluZXMsIGFuZCB0aGUgdGhp cmQgNSBsaW5lcyBhZ2Fpbi4KKyAgICAgICAgICAgICAgIElmIHRoZSBzZWNvbmQgcmVkaXNwbGF5 IHdvdWxkbid0IG1hcmsgcm93cyBpbiB0aGUKKyAgICAgICAgICAgICAgIGN1cnJlbnQgbWF0cml4 IGludmFsaWQsIHRoZSB0aGlyZCByZWRpc3BsYXkgbWlnaHQgYmUKKyAgICAgICAgICAgICAgIHRl bXB0ZWQgdG8gb3B0aW1pemUgcmVkaXNwbGF5IGJhc2VkIG9uIGxpbmVzIGRpc3BsYXllZAorICAg ICAgICAgICAgICAgaW4gdGhlIGZpcnN0IHJlZGlzcGxheS4gKi8KKyAgICAgICAgICAgIGlmIChN QVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHliKQorICAgICAgICAgICAgICBmb3IgKGkgPSB2 cG9zICsgMTsgaSA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93cyAtIDE7ICsraSkKKyAgICAgICAg ICAgICAgICBTRVRfTUFUUklYX1JPV19FTkFCTEVEX1AgKHctPmN1cnJlbnRfbWF0cml4LCBpLCBm YWxzZSk7CisgICAgICAgICAgfQorICAgICAgLyogV2FzIGRpc3BsYXkgcHJlZW1wdGVkPyAqLwor ICAgICAgcGF1c2VkX3AgPSByb3cgPCBlbmQ7CisgICAgICBzZXRfY3Vyc29yOgorICAgICAgLyog SWYgd2UganVtcGVkIGhlcmUgZnJvbSBgc2V0X2N1cnNvcmAsIHRoZW4gc2V0IHRoZSBgY3Vyc29y X21hdHJpeGAuICovCisgICAgICBpZiAoY3Vyc29yX21hdHJpeCA9PSBOVUxMKQorICAgICAgICBj dXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAvKiBSZXNldCBgcm93YCB0 byAwIHNvIHRoYXQgZmFrZSBjdXJzb3JzIGNhbiBiZSBkcmF3biBvbiByb3dzIHByZWNlZGluZyB0 aGUKKyAgICAgIGZpcnN0IGByb3ctPmVuYWJsZWRfcGAuICBKdXN0IHByaW9yIHRvIHRoZSBjYWxs IHRvIGBzY3JvbGxpbmdfd2luZG93JyBhYm92ZSwKKyAgICAgIGByb3dgIHdhcyBhZHZhbmNlZCB0 byB0aGUgZmlyc3QgYHJvdy0+ZW5hYmxlZF9wYC4gKi8KKyAgICAgIGZvciAoc3RydWN0IGdseXBo X3JvdyAqZGVzaXJlZF9yb3cgPSBNQVRSSVhfUk9XICh3LT5kZXNpcmVkX21hdHJpeCwgMCk7Cisg ICAgICAgICAgIGRlc2lyZWRfcm93IDwgZW5kCisgICAgICAgICAgICYmIChmb3JjZV9wIHx8ICFp bnB1dF9wZW5kaW5nKQorICAgICAgICAgICAvKiBXMzIgRW1hY3MgY3Jhc2hlcyBvbiBzdGFydHVw IHdpdGhvdXQgYSBCVUZGRVJQIGNoZWNrLiAqLworICAgICAgICAgICAmJiBCVUZGRVJQICh3LT5j b250ZW50cykKKyAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpOworICAgICAgICAgICArK2Rlc2ly ZWRfcm93KQorICAgICAgICB7CisgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1Mg KGRlc2lyZWRfcm93LCB3LT5kZXNpcmVkX21hdHJpeCk7CisgICAgICAgICAgaWYgKGRlc2lyZWRf cm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBzdHJ1Y3Qg Z2x5cGhfcm93ICpjdXJyZW50X3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2 cG9zKTsKKyAgICAgICAgICBlbnVtIG1jX3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24gPSBtY19y b3dfcG9zaXRpb24gKHcsIGN1cnJlbnRfcm93LCBjdXJyZW50X3JvdywgdnBvcyk7CisgICAgICAg ICAgaWYgKGN1cnJlbnRfcm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICBtY19kcmF3X3JvdyAo dywgdy0+Y3VycmVudF9tYXRyaXgsIGN1cnJlbnRfcm93LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RF WFRfQVJFQV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudF9yb3ctPngsIGN1cnJl bnRfcm93LT51c2VkW1RFWFRfQVJFQV0sIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAg Y3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsCisgICAgICAg ICAgICAgICAgICAgICAgICAgU0VUX0NVUlNPUl9PTkUpOworICAgICAgICB9CisKKyAgICAgIG1j X3Jlc3RvcmVfZ2x5cGhfbWF0cml4IChzYXZlZF9kZXNpcmVkLCB3LT5kZXNpcmVkX21hdHJpeCk7 CisgICAgICBtY19yZXN0b3JlX2dseXBoX21hdHJpeCAoc2F2ZWRfY3VycmVudCwgdy0+Y3VycmVu dF9tYXRyaXgpOworCisgICAgICBtY191cGRhdGVfd2luZG93X2VyYXNlICh3LCBvbGRfbWF0cml4 KTsKKworICAgICAgbWNfeGZyZWVfY2FjaGVfbWF0cml4ICh3LCAmb2xkX21hdHJpeCk7CisKKyAg ICB9CisgIC8vIGNsb2NrX3QgY2xvY2tfZW5kID0gY2xvY2soKTsKKyAgLy8gZG91YmxlIGNwdV90 aW1lX3VzZWQgPSAoKGRvdWJsZSkgKGNsb2NrX2VuZCAtIGNsb2NrX3N0YXJ0KSkgLyBDTE9DS1Nf UEVSX1NFQzsKKyAgLy8gZnByaW50ZiAoc3RkZXJyLCAibWNfc2Nyb2xsaW5nX3dpbmRvdyAoJXMp OiAgVElNRSAoJWYpXG4iLCBtY193aW5kb3cgKHcpLCBjcHVfdGltZV91c2VkKTsKK30KKworLyog ZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8q IFN0cnVjdHVyZSB0byBwYXNzIGRpbWVuc2lvbnMgYXJvdW5kLiAgVXNlZCBmb3IgY2hhcmFjdGVy IGJvdW5kaW5nCiAgICBib3hlcywgZ2x5cGggbWF0cml4IGRpbWVuc2lvbnMgYW5kIGFsaWtlLiAg Ki8KIApAQCAtMjI0MSw2ICs0MDU5LDE2IEBAIGZyZWVfd2luZG93X21hdHJpY2VzIChzdHJ1Y3Qg d2luZG93ICp3KQogCSAgZnJlZV9nbHlwaF9tYXRyaXggKHctPmN1cnJlbnRfbWF0cml4KTsKIAkg IGZyZWVfZ2x5cGhfbWF0cml4ICh3LT5kZXNpcmVkX21hdHJpeCk7CiAJICB3LT5jdXJyZW50X21h dHJpeCA9IHctPmRlc2lyZWRfbWF0cml4ID0gTlVMTDsKKworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBtY194ZnJlZV9jYWNoZV9tYXRyaXgg KHcsICZ3LT5tY19tYXRyaXgpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJfQog CiAgICAgICAvKiBOZXh0IHdpbmRvdyBvbiBzYW1lIGxldmVsLiAgKi8KQEAgLTMzODcsNiArNTIx NSwyNiBAQCBjaGVja19jdXJyZW50X21hdHJpeF9mbGFncyAoc3RydWN0IHdpbmRvdyAqdykKIHN0 YXRpYyBib29sCiB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3Ap CiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAgIGZwcmludGYgKHN0ZGVyciwgInVwZGF0 ZV93aW5kb3cgKCVzKVxuIiwgbWNfd2luZG93ICh3KSk7CisKKyAgc3RydWN0IG1jX2Vzc2VudGlh bHMgZXNzZW50aWFsczsKKyAgbWNfc2V0X2Vzc2VudGlhbHMgKHcsICZlc3NlbnRpYWxzKTsKKwor ICBtY191cGRhdGVfd2luZG93X2RyeXJ1biAodywgZm9yY2VfcCwgZXNzZW50aWFscyk7CisKKyAg c3RydWN0IGdseXBoX21hdHJpeCAqY3Vyc29yX21hdHJpeCA9IE5VTEw7CisKKyAgYm9vbCBkcmF3 X3AgPSB0cnVlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIHN0cnVjdCBnbHlw aF9tYXRyaXggKmRlc2lyZWRfbWF0cml4ID0gdy0+ZGVzaXJlZF9tYXRyaXg7CiAgIGJvb2wgcGF1 c2VkX3A7CiAgIGludCBwcmVlbXB0X2NvdW50ID0gY2xpcF90b19ib3VuZHMgKDEsIGJhdWRfcmF0 ZSAvIDI0MDAgKyAxLCBJTlRfTUFYKTsKQEAgLTM0NjAsNiArNTMwOCw0NyBAQCB1cGRhdGVfd2lu ZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAJICAgIH0KIAl9CiAKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogUHJv Y2VzcyB0aGUgY3Vyc29yIHJvdyBhdCB0aGUgb3V0c2V0IGlmIGl0IGlzIHdpdGhpbiBgZGVzaXJl ZF9tYXRyaXhgLgorICBXaGVuIHByb2Nlc3NpbmcgYWxsIG90aGVyIHJvd3MsIHdlIHdpbGwgcXVl cnkgdGhlIGB3LT5jdXJyZW50X21hdHJpeGAgZm9yIGRhdGEKKyAgcmVsYXRpbmcgdG8gdGhlIGN1 cnNvciByb3cuICBgbWFrZV9jdXJyZW50YCAod2l0aGluIGB1cGRhdGVfd2luZG93X2xpbmUnKQor ICB1cGRhdGVzIHRoZSBgdy0+Y3VycmVudF9tYXRyaXhgIGZvciB0aGUgYXBwbGljYWJsZSByb3cu ICBJbiBkb2luZyBzbywgaG93ZXZlciwKKyAgdGhlIGFwcGxpY2FibGUgcm93IGluIHRoZSBkZXNp cmVkIG1hdHJpeCBpcyBhbHRlcmVkIHN1Y2ggdGhhdCB3ZSBjYW4gbm8gbG9uZ2VyCisgIHJlbHkg dXBvbiB0aGUgYWNjdXJhY3kgb2YgYFJPVy0+dXNlZFtURVhUX0FSRUFdYC4gIFRoZXJlZm9yZSwg d2UgbXVzdCBub3cgcmVseQorICBleGNsdXNpdmVseSB1cG9uIGB3LT5jdXJyZW50X21hdHJpeCcg Zm9yIGN1cnNvciByb3cgYmFzZWQgZGVjaXNpb25zLiAqLworICBmb3IgKHN0cnVjdCBnbHlwaF9y b3cgKm1jX3JvdyA9IHJvdzsKKyAgICAgICBtY19yb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlu cHV0X3BlbmRpbmcpOworICAgICAgICsrbWNfcm93KQorICAgIHsKKyAgICAgIGludCB2cG9zID0g TUFUUklYX1JPV19WUE9TIChtY19yb3csIGRlc2lyZWRfbWF0cml4KTsKKyAgICAgIGlmIChtY19y b3ctPmVuYWJsZWRfcAorICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAg ICAgIHsKKyAgICAgICAgICBjdXJzb3JfbWF0cml4ID0gZGVzaXJlZF9tYXRyaXg7CisgICAgICAg ICAgaWYgKCFmb3JjZV9wICYmICsrbl91cGRhdGVkICUgcHJlZW1wdF9jb3VudCA9PSAwKQorICAg ICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgpOworICAg ICAgICAgIGNoYW5nZWRfcCB8PSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAg ICAgICAgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29u ZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg fHwgISBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkpCisg ICAgICAgICAgICAgICAgICAgICAgID8gbWNfdXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLCAm bW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgZHJhd19wKQorICAg ICAgICAgICAgICAgICAgICAgICA6IHVwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNl X2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kg KHJvdykgPj0geWIpCisgICAgICAgICAgICBmb3IgKGludCBpID0gdnBvcyArIDE7IGkgPCB3LT5j dXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAgICAgIFNFVF9NQVRSSVhf Uk9XX0VOQUJMRURfUCAody0+Y3VycmVudF9tYXRyaXgsIGksIGZhbHNlKTsKKyAgICAgICAgICBi cmVhazsKKyAgICAgICAgfQorICAgIH0KKworICBjdXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9t YXRyaXg7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIC8qIFVwZGF0ZSB0 aGUgcmVzdCBvZiB0aGUgbGluZXMuICAqLwogICAgICAgZm9yICg7IHJvdyA8IGVuZCAmJiAoZm9y Y2VfcCB8fCAhaW5wdXRfcGVuZGluZyk7ICsrcm93KQogCS8qIHNjcm9sbGluZ193aW5kb3cgcmVz ZXRzIHRoZSBlbmFibGVkX3AgZmxhZyBvZiB0aGUgcm93cyBpdApAQCAtMzQ2Nyw2ICs1MzU2LDE5 IEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIAlpZiAo cm93LT5lbmFibGVkX3ApCiAJICB7CiAJICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChy b3csIGRlc2lyZWRfbWF0cml4KTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgICAgIC8qIElmIHRoZSBgY3Vyc29yX3Jvd2AgaXMg d2l0aGluIHRoZSBgZGVzaXJlZF9tYXRyaXhgLCB0aGVuIGl0IHdhcworICAgICAgICAgIHByb2Nl c3NlZCBoZXJlaW5hYm92ZSBhbmQgc2hvdWxkIGJlIHNraXBwZWQgYXQgdGhpcyB0aW1lLiAqLwor ICAgICAgICAgIGlmICh2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICAgIGNvbnRpbnVl OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgIGludCBpOwogCiAJICAgIC8q IFdlJ2xsIGhhdmUgdG8gcGxheSBhIGxpdHRsZSBiaXQgd2l0aCB3aGVuIHRvCkBAIC0zNDc1LDgg KzUzNzcsMjEgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9w KQogCSAgICAgICBjb21tYW5kcyB3aWxsIHRvbyBxdWlja2x5IHBhdXNlIHJlZGlzcGxheS4gICov CiAJICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkK IAkgICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZ19pZ25vcmVfc3F1ZWV6YWJsZXMgKCk7Ci0JICAg IGNoYW5nZWRfcCB8PSB1cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsCi0JCQkJCSAgICAgJm1v dXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgICAgICBjaGFuZ2VkX3AgfD0gKEJVRkZFUlAg KHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICEgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBmY192aXNpYmxlKSkpKQorICAgICAgICAgICAgICAgICAgICAgICA/IG1jX3Vw ZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRy aXgsIGVzc2VudGlhbHMsIGRyYXdfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgOiB1cGRhdGVf d2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3ApOworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKwogCiAJICAgIC8qIE1hcmsgYWxsIHJvd3MgYmVsb3cgdGhl IGxhc3QgdmlzaWJsZSBvbmUgaW4gdGhlIGN1cnJlbnQKIAkgICAgICAgbWF0cml4IGFzIGludmFs aWQuICBUaGlzIGlzIG5lY2Vzc2FyeSBiZWNhdXNlIG9mCkBAIC0zNDk3LDYgKzU0MTIsNDEgQEAg dXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogCiAgICAgc2V0 X2N1cnNvcjoKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNP UlMgKi8KKworICAvKiBJZiB3ZSBqdW1wZWQgaGVyZSBmcm9tIGBzZXRfY3Vyc29yYCwgdGhlbiBz ZXQgdGhlIGBjdXJzb3JfbWF0cml4YC4gKi8KKyAgaWYgKGN1cnNvcl9tYXRyaXggPT0gTlVMTCkK KyAgICBjdXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisKKyAgLyogUmVzZXQgYHJv d2AgdG8gMCBzbyB0aGF0IGZha2UgY3Vyc29ycyBjYW4gYmUgZHJhd24gb24gcm93cyBwcmVjZWRp bmcgdGhlCisgIGZpcnN0IGByb3ctPmVuYWJsZWRfcGAuICBKdXN0IHByaW9yIHRvIHRoZSBjYWxs IHRvIGBzY3JvbGxpbmdfd2luZG93JyBhYm92ZSwKKyAgYHJvd2Agd2FzIGFkdmFuY2VkIHRvIHRo ZSBmaXJzdCBgcm93LT5lbmFibGVkX3BgLiAqLworICBmb3IgKHN0cnVjdCBnbHlwaF9yb3cgKmRl c2lyZWRfcm93ID0gTUFUUklYX1JPVyAoZGVzaXJlZF9tYXRyaXgsIDApOworICAgICAgIGRlc2ly ZWRfcm93IDwgZW5kCisgICAgICAgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3BlbmRpbmcpCisgICAg ICAgLyogVzMyIEVtYWNzIGNyYXNoZXMgb24gc3RhcnR1cCB3aXRob3V0IGEgQlVGRkVSUCBjaGVj ay4gKi8KKyAgICAgICAmJiBCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAmJiAoIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgIHx8ICFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAg ICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpOwor ICAgICAgICsrZGVzaXJlZF9yb3cpCisgICAgeworICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9X X1ZQT1MgKGRlc2lyZWRfcm93LCBkZXNpcmVkX21hdHJpeCk7CisgICAgICBpZiAoZGVzaXJlZF9y b3ctPmVuYWJsZWRfcCkKKyAgICAgICAgY29udGludWU7CisgICA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wICYmIHJpZi0+Zml4X292ZXJsYXBwaW5nX2FyZWEpCiAJICAgIHsKLQkgICAg ICByZWRyYXdfb3ZlcmxhcHBlZF9yb3dzICh3LCB5Yik7CisKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRyYXdfb3ZlcmxhcHBlZF9y b3dzJzogIFJlZHJhdyBsaW5lcyBmcm9tIHRoZSBjdXJyZW50IG1hdHJpeCBvZiB3aW5kb3cgVwor dGhhdCBhcmUgb3ZlcmxhcHBlZCBieSBvdGhlciByb3dzLiAgWUIgaXMgYm90dG9tLW1vc3QgeS1w b3NpdGlvbiBpbiBXLiAgSWYgcm93cworb3ZlcmxhcHBpbmcgb3RoZXJzIGhhdmUgYmVlbiBjaGFu Z2VkLCB0aGUgcm93cyBiZWluZyBvdmVybGFwcGVkIGhhdmUgdG8gYmUKK3JlZHJhd24uICBUaGlz IHdvbid0IGRyYXcgbGluZXMgdGhhdCBoYXZlIGFscmVhZHkgYmVlbiBkcmF3biBpbiB1cGRhdGVf d2luZG93CitsaW5lIGJlY2F1c2Ugb3ZlcmxhcHBlZF9wIGluIGRlc2lyZWQgcm93cyBpcyAwLCBz byBhZnRlciByb3cgYXNzaWdubWVudAorb3ZlcmxhcHBlZF9wIGluIGN1cnJlbnQgcm93cyBpcyAw LiAqLworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICBm b3IgKGludCBpID0gMDsgaSA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93czsgKytpKQorICAgIHsK KyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdyA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsg aTsKKyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgIGJyZWFrOworICAgICAgICBl bHNlIGlmIChyb3ctPm1vZGVfbGluZV9wKQorICAgICAgICAgIGNvbnRpbnVlOworICAgICAgaWYg KHJvdy0+b3ZlcmxhcHBlZF9wKQorICAgICAgICB7CisgICAgICAgICAgZm9yIChlbnVtIGdseXBo X3Jvd19hcmVhIGFyZWEgPSBMRUZUX01BUkdJTl9BUkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2Fy ZWEpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG91dHB1dF9jdXJzb3JfdG8gKHcsIGks IDAsIHJvdy0+eSwgYXJlYSA9PSBURVhUX0FSRUEgPyByb3ctPnggOiAwKTsKKyAgICAgICAgICAg ICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBhcmVhLCBy b3ctPngsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT51c2VkW2Fy ZWFdLCB0cnVlLCBEUkFXX05PUk1BTF9URVhULAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIFVQREFURV9XSU5ET1dfX1JFRFJBV19PVkVSTEFQUEVEX1JPV1MpCisgICAgICAgICAg ICAgICAgICAmJiByb3ctPnVzZWRbYXJlYV0pCisgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgRlJBTUVfUklGIChmKS0+d3JpdGVfZ2x5cGhzICh3LCByb3csIHJvdy0+Z2x5cGhz W2FyZWFdLCBhcmVhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICByb3ctPnVzZWRbYXJlYV0pOworICAgICAgICAgICAgICAgICAgRlJBTUVfUklGIChmKS0+ Y2xlYXJfZW5kX29mX2xpbmUgKHcsIHJvdywgYXJlYSwgLTEpOworICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgIH0KKyAgICAgICAgICByb3ctPm92ZXJsYXBwZWRfcCA9IDA7CisgICAgICAg IH0KKyAgICAgIGlmIChNQVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHliKQorICAgICAgICBi cmVhazsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgICByZWRy YXdfb3ZlcmxhcHBpbmdfcm93cyAodywgeWIpOwogCSAgICB9CiAjZW5kaWYKQEAgLTM1MzEsMTAg KzU1MjMsMjEgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9w KQogICAgICAgc3RyY3B5ICh3LT5jdXJyZW50X21hdHJpeC0+bWV0aG9kLCB3LT5kZXNpcmVkX21h dHJpeC0+bWV0aG9kKTsKICNlbmRpZgogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCisgIGlmIChC VUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcs IDApOworICAgIGVsc2UKICAgICAgIHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgMCk7CiAjZW5k aWYKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgLyogRW5kIHRoZSB1cGRh dGUgb2Ygd2luZG93IFcuICBEb24ndCBzZXQgdGhlIGN1cnNvciBpZiB3ZQogICAgICAgICAgcGF1 c2VkIHVwZGF0aW5nIHRoZSBkaXNwbGF5IGJlY2F1c2UgaW4gdGhpcyBjYXNlLA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LiIKKyAg ICAgICJ4Li4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3ZlcnRpY2FsX2Jh cl9yaWdodF9hcnJvd19iaXRzW10gPXsKKyAgMHg4MCwgMHg4MCwgMHg4MCwgMHg5OCwgMHg4Yywg MHg4NiwgMHhiZiwKKyAgMHhiZiwgMHg4NiwgMHg4YywgMHg5OCwgMHg4MCwgMHg4MCwgMHg4MH07 CisKKy8qIDI1CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4u Lnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi54eC4uLnh4 IgorICAgICAgIi4ueHguLnh4IgorICAgICAgIi4uLnh4Lnh4IgorICAgICAgInh4eHh4eHh4Igor ICAgICAgInh4eHh4eHh4IgorICAgICAgIi4uLnh4Lnh4IgorICAgICAgIi4ueHguLnh4IgorICAg ICAgIi54eC4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAg Ii4uLi4uLnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcmV2ZXJzZWRfdmVydGlj YWxfYmFyX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweDMsIDB4MywgMHgzLCAweDYzLCAweDMz LCAweDFiLCAweGZmLCAweGZmLCAweDFiLCAweDMzLCAweDYzLCAweDMsIDB4MywgMHgzfTsKKwor LyogMjYKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgi CisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4ueHguLngiCisg ICAgICAieC4uLnh4LngiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC54eHh4eHgiCisgICAg ICAieC54eHh4eHgiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC4uLnh4LngiCisgICAgICAi eC4ueHguLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieHh4 eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3dfcmVjdGFuZ2xlX3Jp Z2h0X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDk5LCAweDhkLCAweDg3 LCAweGJmLAorICAweGJmLCAweDg3LCAweDhkLCAweDk5LCAweDgxLCAweDgxLCAweGZmfTsKKwor LyogMjcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgi CisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC54eC4ueHgiCisg ICAgICAieC4ueHgueHgiCisgICAgICAieC4uLnh4eHgiCisgICAgICAieHh4eHh4eHgiCisgICAg ICAieHh4eHh4eHgiCisgICAgICAieC4uLnh4eHgiCisgICAgICAieC4ueHgueHgiCisgICAgICAi eC54eC4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieHh4 eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19yZXZlcnNlZF9ob2xsb3dfcmVj dGFuZ2xlX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweGIxLCAw eDk5LCAweDhkLCAweGZmLAorICAweGZmLCAweDhkLCAweDk5LCAweGIxLCAweDgxLCAweDgxLCAw eGZmfTsKKworLyogMjgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAi eHh4eHh4eHgiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4u Li4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4u LngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngi CisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisg ICAgICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3dfcmVj dGFuZ2xlX2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAw eDgxLAorICAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweGZmfTsKKworLyog MjkKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4uLi4iCisg ICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAg ICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAi eC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4u Li4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4u Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9iYXJfYml0c1tdID17 CisgIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsCisgIDB4ODAsIDB4 ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODB9OworCisvKiAzMAorICAgICgrLWZyaW5n ZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIK KyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAg ICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAg ICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIu Li4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGlj IHVuc2lnbmVkIHNob3J0IG1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9iaXRzW10gPXsKKyAgMHgz LCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4Mywg MHgzLCAweDN9OworCisvKiAzMQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAg ICAgICJ4eC4uLi4uLiIKKyAgICAgICJ4eC4uLi4uLiIKKyAgICAgICIgeHguLi4uLiIKKyAgICAg ICIueHguLi4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIu Li54eC4uLiIKKyAgICAgICIuLi54eC4uLiIKKyAgICAgICIuLi4ueHguLiIKKyAgICAgICIuLi4u eHguLiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLi54 eCIKKyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2JhY2tz bGFzaF9iaXRzW10gPXsKKyAgMHhjMCwgMHhjMCwgMHhlMCwgMHg2MCwgMHgzMCwgMHgzMCwgMHgx OCwgMHgxOCwgMHhjLCAweGMsIDB4NiwgMHg2LCAweDMsIDB4M307CisKKy8qIDMyCisgICAgKCst ZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgorICAgICAgInh4Li4u Li4uIgorICAgICAgInh4eC4uLi4uIgorICAgICAgInh4eC4uLi4uIgorICAgICAgIngueHguLi4u IgorICAgICAgIngueHguLi4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLnh4Li4uIgor ICAgICAgInguLi54eC4uIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLi4ueHguIgorICAg ICAgInguLi4ueHguIgorICAgICAgInguLi4uLnh4IgorICAgICAgInguLi4uLnh4IikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaF9iaXRzW10gPXsK KyAgMHhjMCwgMHhjMCwgMHhlMCwgMHhlMCwgMHhiMCwgMHhiMCwgMHg5OCwKKyAgMHg5OCwgMHg4 YywgMHg4YywgMHg4NiwgMHg4NiwgMHg4MywgMHg4M307CisKKy8qIDMzCisgICAgKCstZnJpbmdl LWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi54eHh4eHguIgorICAgICAgInh4eHgueC4uIgor ICAgICAgInh4eHgueC4uIgorICAgICAgInh4eHgueC4uIgorICAgICAgIi54eHgueC4uIgorICAg ICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAg Ii4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIikKKyovCitzdGF0 aWMgdW5zaWduZWQgc2hvcnQgbWNfcGlsY3Jvd19iaXRzW10gPXsKKyAgMHg3ZSwgMHhmNCwgMHhm NCwgMHhmNCwgMHg3NCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNH07CisKKy8q IDM0CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4ueHh4eC4uIgor ICAgICAgIi54eHh4eHguIgorICAgICAgInguLnh4Li54IgorICAgICAgInguLnh4Li54IgorICAg ICAgInh4eHh4eHh4IgorICAgICAgInh4Li4uLnh4IgorICAgICAgInh4eC4ueHh4IgorICAgICAg Ii54eHh4eHguIgorICAgICAgIi4ueHh4eC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQg bWNfc21pbGV5X2ZhY2VfYml0c1tdID17CisgIDB4M2MsIDB4N2UsIDB4OTksIDB4OTksIDB4ZmYs IDB4YzMsIDB4ZTcsIDB4N2UsIDB4M2N9OworCisvKiAzNQorICAgICgrLWZyaW5nZS1oZWxwZXIt aGV4YWRlY2ltYWwKKyAgICAgICIuLnguLi4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIu Li4ueC4uLiIKKyAgICAgICIuLi4uLnguLiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIuLi54 Li4uLiIKKyAgICAgICIuLnguLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3Np bmdsZV9hbmdsZV9yaWdodF9iaXRzW10gPXsKKyAgMHgyMCwgMHgxMCwgMHg4LCAweDQsIDB4OCwg MHgxMCwgMHgyMH07CisKKy8qIDM2CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAor ICAgICAgIi4uLi4ueC4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAg ICAgIi4ueC4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAg Ii4uLi4ueC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX2xl ZnRfYml0c1tdID17CisgIDB4NCwgMHg4LCAweDEwLCAweDIwLCAweDEwLCAweDgsIDB4NH07CisK Ky8qIDM3CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Lnh4Li4u IgorICAgICAgIi54eC54eC4uIgorICAgICAgIi4ueHgueHguIgorICAgICAgIi4uLnh4Lnh4Igor ICAgICAgIi4ueHgueHguIgorICAgICAgIi54eC54eC4uIgorICAgICAgInh4Lnh4Li4uIikKKyov CitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9ewor ICAweGQ4LCAweDZjLCAweDM2LCAweDFiLCAweDM2LCAweDZjLCAweGQ4fTsKKworLyogMzgKKyAg ICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4ueHgueHgiCisgICAgICAi Li54eC54eC4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAieHgueHguLi4iCisgICAgICAiLnh4 Lnh4Li4iCisgICAgICAiLi54eC54eC4iCisgICAgICAiLi4ueHgueHgiKQorKi8KK3N0YXRpYyB1 bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxYiwgMHgz NiwgMHg2YywgMHhkOCwgMHg2YywgMHgzNiwgMHgxYn07CisKKy8qIDM5CisgICAgKCstZnJpbmdl LWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIngueC54Li4uIgorICAgICAgIi54LngueC4uIgor ICAgICAgIi4ueC54LnguIgorICAgICAgIi4uLngueC54IgorICAgICAgIi4ueC54LnguIgorICAg ICAgIi54LngueC4uIgorICAgICAgIngueC54Li4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hv cnQgbWNfdHJpcGxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAweGE4LCAweDU0LCAweDJhLCAw eDE1LCAweDJhLCAweDU0LCAweGE4fTsKKworLyogNDAKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhl eGFkZWNpbWFsCisgICAgICAiLi4ueC54LngiCisgICAgICAiLi54LngueC4iCisgICAgICAiLngu eC54Li4iCisgICAgICAieC54LnguLi4iCisgICAgICAiLngueC54Li4iCisgICAgICAiLi54Lngu eC4iCisgICAgICAiLi4ueC54LngiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlw bGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxNSwgMHgyYSwgMHg1NCwgMHhhOCwgMHg1NCwg MHgyYSwgMHgxNX07CisKKy8qIDQxCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAor ICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAg ICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAg Ii54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4u Li4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMg dW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAwLCAweDAw LCAweDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDgyLCAweDAwLCAweDAwLCAweDAwLCAw eDAwfTsKKworLyogNDIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAi Li4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4u Li4uLi4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54Lngu Li4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4i CisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25l ZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgw MCwgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMH07 CisKKy8qIDQzCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4u Li4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4u IgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAg ICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAw LCAweDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyLCAw eDAwLCAweDAwLCAweDAwfTsKKworLyogNDQKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNp bWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4i CisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisg ICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAg ICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAi Li4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfZG93 bl9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5Miwg MHg0NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwgMHgwMH07CisKKy8qIDQ1CisgICAgKCstZnJp bmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4u IgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAg ICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAg Ii4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdHJpcGxlX2FuZ2xlX3Vw X2JpdHNbXSA9eworICAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAw eDkyLCAweDI4LCAweDQ0LCAweDgyLCAweDAwfTsKKworLyogNDYKKyAgICAoKy1mcmluZ2UtaGVs cGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAieC4uLi4ueC4iCisgICAg ICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAi LnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLngu Li54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4u Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVwbGVfYW5nbGVfZG93bl9i aXRzW10gPXsKKyAgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5 MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMH07CisKKy8qIDQ3CisgICAgKCstZnJpbmdlLWhlbHBl ci1oZXhhZGVjaW1hbAorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAg Ii54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54 Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4u eC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4u IgorICAgICAgInguLi4uLnguIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcXVhZHJ1 cGxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAw eDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyfTsKKworLyogNDgK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4ueC4iCisgICAg ICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAi LnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLngu Li54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54 Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iKQorKi8KK3N0YXRpYyB1bnNp Z25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHg4MiwgMHg0NCwg MHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgy OCwgMHgxMH07CisKIC8qIE5PVEU6ICBUaGUgb3JkZXIgb2YgdGhlc2UgYml0bWFwcyBtdXN0IG1h dGNoIHRoZSBzZXF1ZW5jZQogICAgdXNlZCBpbiBmcmluZ2UuZWwgdG8gZGVmaW5lIHRoZSBjb3Jy ZXNwb25kaW5nIHN5bWJvbHMuICAqLwogCkBAIC00NjcsOCArOTIxLDEwNzQgQEAgc3RhdGljIHN0 cnVjdCBmcmluZ2VfYml0bWFwIHN0YW5kYXJkX2JpdG1hcHNbXSA9CiAgIHsgRlJCSVRTICh2ZXJ0 aWNhbF9iYXJfYml0cyksICAgICAgID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PSBRbmlsLCBibTsKKyAgRU1BQ1NfSU5UIGxuMSA9IDAsIGxuMiA9IDA7Cisg IGludCBpeDEgPSByaWdodF9wOworICBpbnQgaXgyID0gaXgxICsgKHBhcnRpYWxfcCA/IDIgOiAw KTsKKyAgaWYgKChjbWFwID0gQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmcmluZ2VfaW5k aWNhdG9yX2FsaXN0KSksICFOSUxQIChjbWFwKSkKKyAgICB7CisgICAgICBibTEgPSBtY19hc3Nx IChiaXRtYXAsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibTEpKQorICB7CisgICAgaWYgKChi bTEgPSBYQ0RSIChibTEpKSwgTklMUCAoYm0xKSkKKyAgICAgIHJldHVybiBNQ19OT19GUklOR0Vf QklUTUFQOworICAgIGlmIChDT05TUCAoYm0xKSkKKyAgICAgIHsKKyAgICAgICAgbG4xID0gWEZJ WE5VTSAoRmxlbmd0aCAoYm0xKSk7CisgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAgICAg eworICAgICAgICAgICAgaWYgKGxuMSA+IGl4MikKKyAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMSk7CisgICAgICAgICAgICAgICAgaWYgKCFFUSAo Ym0sIFF0KSkKKyAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgIH0K KyAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBpZiAobG4xID4gaXgxKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGJt ID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQp KQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgIH0KKyAgICAgIH0KKyAgICBlbHNlIGlmICgoYm0gPSBibTEsICFFUSAoYm0sIFF0 KSkpCisgICAgICBnb3RvIGZvdW5kOworICB9CisgICAgfQorICBpZiAoIUVRIChjbWFwLCBCVkFS ICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkKKyAgICAgICYmICFO SUxQIChCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkpCisg ICAgeworICAgICAgYm0yID0gbWNfYXNzcSAoYml0bWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRz LCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSk7CisgICAgICBpZiAoQ09OU1AgKGJtMikpCisgICAg ICAgIHsKKyAgICAgICAgICBpZiAoKGJtMiA9IFhDRFIgKGJtMikpLCAhTklMUCAoYm0yKSkKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKENPTlNQIChibTIpKQorICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgIGxuMiA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMikpOwor ICAgICAgICAgICAgICAgICAgaWYgKHBhcnRpYWxfcCkKKyAgICAgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgICAgIGlmIChsbjIgPiBpeDIpCisgICAgICAgICAgICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMik7 CisgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0K KyAgICAgICAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4MSkKKyAgICB7CisgICAgICBibSA9IG1j X250aCAoaXgxLCBibTEpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgZ290byBm b3VuZDsKKyAgICB9CisgIGlmIChsbjIgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19udGgg KGl4MSwgYm0yKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgIGdvdG8gZm91bmQ7 CisgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICB9CisgICAgZWxzZSBpZiAo KGJtID0gYm0yLCBOSUxQIChibSkpKQorICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7 CisgIGZvdW5kOgorICByZXR1cm4gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJtKTsKK30KKworc3Rh dGljIGludAorbWNfZ2V0X2xvZ2ljYWxfY3Vyc29yX2JpdG1hcCAoc3RydWN0IHdpbmRvdyAqdywg TGlzcF9PYmplY3QgY3Vyc29yKQoreworICBMaXNwX09iamVjdCBjbWFwLCBibSA9IFFuaWw7Cisg IGlmICgoY21hcCA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZnJpbmdlX2N1cnNvcl9h bGlzdCkpLCAhTklMUCAoY21hcCkpCisgICAgeworICAgICAgYm0gPSBtY19hc3NxIChjdXJzb3Is IGNtYXApOworICAgICAgaWYgKENPTlNQIChibSkpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAo KGJtID0gWENEUiAoYm0pKSwgTklMUCAoYm0pKQorICAgICAgICAgICAgcmV0dXJuIE1DX05PX0ZS SU5HRV9CSVRNQVA7CisgICAgICAgICAgcmV0dXJuIGxvb2t1cF9mcmluZ2VfYml0bWFwIChibSk7 CisgICAgICAgIH0KKyAgICB9CisgIGlmIChFUSAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0 cywgZnJpbmdlX2N1cnNvcl9hbGlzdCkpKQorICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQ OworICBib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x1ZSBpZiBub3QgZm91bmQgaGVyZS4KKyAgICAg SWYgbm90IHBhcnRpYWwsIG9yIG5vIHBhcnRpYWwgc3BlYyBpcyBwcmVzZW50LCB1c2Ugbm9uLXBh cnRpYWwgYml0bWFwLiAgKi8KKyAgaWYgKChjbWFwID0gQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSksICFOSUxQIChjbWFwKSkKKyAgICB7CisgICAg ICBibTEgPSBtY19hc3NxIChiaXRtYXAsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibTEpKQor ICAgICAgICB7CisgICAgICAgICAgaWYgKChibTEgPSBYQ0RSIChibTEpKSwgTklMUCAoYm0xKSkK KyAgICAgICAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgIGlmIChD T05TUCAoYm0xKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbG4xID0gWEZJWE5VTSAo Rmxlbmd0aCAoYm0xKSk7CisgICAgICAgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKGxuMSA+IGl4MikKKyAgICAgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMSk7Cisg ICAgICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAg ICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgICBpZiAobG4xID4gaXgxKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICAgICAgICAg ICAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICBn b3RvIGZvdW5kOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKChibSA9IGJtMSwgIUVRIChibSwg UXQpKSkKKyAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgfQorICAgIH0KKyAgaWYg KCFFUSAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlz dCkpCisgICAgICAmJiAhTklMUCAoQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGlj YXRvcl9hbGlzdCkpKQorICAgIHsKKyAgICAgIGJtMiA9IG1jX2Fzc3EgKGJpdG1hcCwgQlZBUiAo JmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpOworICAgICAgaWYgKENP TlNQIChibTIpKQorICAgICAgICB7CisgICAgICAgICAgaWYgKChibTIgPSBYQ0RSIChibTIpKSwg IU5JTFAgKGJtMikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChDT05TUCAoYm0y KSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBsbjIgPSBYRklYTlVNIChG bGVuZ3RoIChibTIpKTsKKyAgICAgICAgICAgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAobG4yID4gaXgyKQorICAg ICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBibSA9IG1j X250aCAoaXgyLCBibTIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwg UXQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGlmIChsbjEgPiBpeDEpCisgICAg eworICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkp CisgICAgICAgIGdvdG8gZm91bmQ7CisgICAgfQorICBpZiAobG4yID4gaXgxKQorICAgIHsKKyAg ICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMik7CisgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAg ICAgICBnb3RvIGZvdW5kOworICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAg fQorICAgIGVsc2UgaWYgKChibSA9IGJtMiwgTklMUCAoYm0pKSkKKyAgICAgIHJldHVybiBNQ19O T19GUklOR0VfQklUTUFQOworICBmb3VuZDoKKyAgcmV0dXJuIGxvb2t1cF9mcmluZ2VfYml0bWFw IChibSk7Cit9CisKKy8qIFJlY2FsY3VsYXRlIHRoZSBiaXRtYXBzIHRvIHNob3cgaW4gdGhlIGZy aW5nZXMgb2Ygd2luZG93IFcuCisgICBPbmx5IG1hcmsgcm93cyB3aXRoIG1vZGlmaWVkIGJpdG1h cHMgZm9yIHVwZGF0ZSBpbiByZWRyYXdfZnJpbmdlX2JpdG1hcHNfcC4KKyAgIElmIEtFRVBfQ1VS UkVOVF9QIGlzIDAsIHVwZGF0ZSBjdXJyZW50X21hdHJpeCB0b28uICovCitib29sCittY191cGRh dGVfd2luZG93X2ZyaW5nZXMgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wga2VlcF9jdXJyZW50X3Ap Cit7CisgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgKmN1ciA9IDA7CisgIGludCB5YiA9IHdpbmRv d190ZXh0X2JvdHRvbV95ICh3KTsKKyAgaW50IHJuLCBucm93cyA9IHctPmN1cnJ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gKGluZCkpKQorICAgIHsKKyAgICAgIGlmIChFUSAoaW5kLCBRbGVm dCkgfHwgRVEgKGluZCwgUXJpZ2h0KSkKKyAgICAgICAgYm91bmRhcnlfdG9wID0gYm91bmRhcnlf Ym90ID0gYXJyb3dfdG9wID0gYXJyb3dfYm90ID0gaW5kOworICAgICAgICBlbHNlIGlmIChDT05T UCAoaW5kKQorICAgICAgICAgICAgICAgICAmJiBDT05TUCAoWENBUiAoaW5kKSkpCisgICAgICAg IHsKKyAgICAgICAgICBMaXNwX09iamVjdCBwb3M7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fz c3EgKFF0LCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAgIGJvdW5kYXJ5X3RvcCA9IGJv dW5kYXJ5X2JvdCA9IGFycm93X3RvcCA9IGFycm93X2JvdCA9IFhDRFIgKHBvcyk7CisgICAgICAg ICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFF0b3AsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAg ICAgYm91bmRhcnlfdG9wID0gWENEUiAocG9zKTsKKyAgICAgICAgICBpZiAocG9zID0gbWNfYXNz cSAoUWJvdHRvbSwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBib3VuZGFyeV9ib3Qg PSBYQ0RSIChwb3MpOworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRdXAsIGluZCksICFO SUxQIChwb3MpKQorICAgICAgICAgICAgYXJyb3dfdG9wID0gWENEUiAocG9zKTsKKyAgICAgICAg ICBpZiAocG9zID0gbWNfYXNzcSAoUWRvd24sIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAg ICAgYXJyb3dfYm90ID0gWENEUiAocG9zKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAg ICAgICAgLyogQW55dGhpbmcgZWxzZSBtZWFucyBib3VuZGFyeSBvbiBsZWZ0IGFuZCBubyBhcnJv d3MuICAqLworICAgICAgICAgIGJvdW5kYXJ5X3RvcCA9IGJvdW5kYXJ5X2JvdCA9IFFsZWZ0Owor ICAgIH0KKyAgdG9wX2luZF9ybiA9IGJvdF9pbmRfcm4gPSAtMTsKKyAgaWYgKCFOSUxQIChpbmQp KQorICAgIHsKKyAgICAgIGZvciAoeSA9IHctPnZzY3JvbGwsIHJuID0gMDsKKyAgICAgICAgICAg eSA8IHliICYmIHJuIDwgbnJvd3M7CisgICAgICAgICAgIHkgKz0gcm93LT5oZWlnaHQsICsrcm4p CisgICAgICAgIHsKKyAgICAgICAgICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJu OworICAgICAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICByb3cgPSB3LT5j dXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgIHJvdy0+aW5kaWNhdGVfYm9iX3Ag PSByb3ctPmluZGljYXRlX3RvcF9saW5lX3AgPSAwOworICAgICAgICAgIHJvdy0+aW5kaWNhdGVf ZW9iX3AgPSByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgPSAwOworICAgICAgICAgIGlmICgh cm93LT5tb2RlX2xpbmVfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKHRvcF9p bmRfcm4gPCAwICYmIHJvdy0+dmlzaWJsZV9oZWlnaHQgPiAwKQorICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgIGlmIChNQVRSSVhfUk9XX1NUQVJUX0NIQVJQT1MgKHJvdykgPD0g QlVGX0JFR1YgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSkKKyAgICAgICAgICAgICAgICAgICAgICAm JiAhTUFUUklYX1JPV19QQVJUSUFMTFlfVklTSUJMRV9BVF9UT1BfUCAodywgcm93KSkKKyAgICAg ICAgICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib2JfcCA9ICFOSUxQIChib3VuZGFyeV90b3Ap OworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgcm93LT5p bmRpY2F0ZV90b3BfbGluZV9wID0gIU5JTFAgKGFycm93X3RvcCk7CisgICAgICAgICAgICAgICAg ICB0b3BfaW5kX3JuID0gcm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBpZiAo Ym90X2luZF9ybiA8IDApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYg KE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgPj0gQlVGX1pWIChYQlVGRkVSICh3LT5jb250 ZW50cykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU1BVFJJWF9ST1dfUEFSVElBTExZX1ZJ U0lCTEVfQVRfQk9UVE9NX1AgKHcsIHJvdykpCisgICAgICAgICAgICAgICAgICAgIHJvdy0+aW5k aWNhdGVfZW9iX3AgPSAhTklMUCAoYm91bmRhcnlfYm90KSwgYm90X2luZF9ybiA9IHJuOworICAg ICAgICAgICAgICAgICAgICBlbHNlIGlmICh5ICsgcm93LT5oZWlnaHQgPj0geWIpCisgICAgICAg ICAgICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wID0gIU5JTFAgKGFycm93 X2JvdCksIGJvdF9pbmRfcm4gPSBybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICB9CisgIGVtcHR5X3BvcyA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRl bnRzKSwgaW5kaWNhdGVfZW1wdHlfbGluZXMpOworICBpZiAoIU5JTFAgKGVtcHR5X3BvcykgJiYg IUVRIChlbXB0eV9wb3MsIFFyaWdodCkpCisgICAgZW1wdHlfcG9zID0gV0lORE9XX0xFRlRfRlJJ TkdFX1dJRFRIICh3KSA9PSAwID8gUXJpZ2h0IDogUWxlZnQ7CisgIGZvciAoeSA9IDA7IHkgPCBN QVhfQklUTUFQX0NBQ0hFOyB5KyspCisgICAgYml0bWFwX2NhY2hl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p ZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICByb3cgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93 cyArIHRvcF9pbmRfcm47CisgICAgICB0b3Bfcm93X2VuZHNfYXRfenZfcCA9IHJvdy0+ZW5kc19h dF96dl9wOworICAgICAgaWYgKHJvdy0+aW5kaWNhdGVfYm9iX3ApCisgICAgICAgIHsKKyAgICAg ICAgICBpZiAoRVEgKGJvdW5kYXJ5X3RvcCwgUWxlZnQpKQorICAgICAgICAgICAgYm4gPSAoKHJv dy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQpKQorICAgICAgICAg ICAgICAgICAgPyBNQ19MRUZUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ZW5kc19hdF96 dl9wKQorICAgICAgICAgICAgICAgICAgOiBNQ19MRUZUX0ZSSU5HRSAoMiwgUXRvcCwgMCkpOwor ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBibiA9ICgocm93LT5pbmRpY2F0ZV9lb2Jf cCAmJiBFUSAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICAgICAgICAgICAgICA/IE1D X1JJR0hUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKQorICAgICAg ICAgICAgICAgICAgICA6IE1DX1JJR0hUX0ZSSU5HRSAoMiwgUXRvcCwgMCkpOworICAgICAgICB9 CisgICAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCkKKyAgICAgICAgICB7 CisgICAgICAgICAgICBpZiAoRVEgKGFycm93X3RvcCwgUWxlZnQpKQorICAgICAgICAgICAgICBi biA9IE1DX0xFRlRfRlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAgICAgICAg fQorICAgICAgaWYgKGJuICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHsKKyAgICAg ICAgICBzdHJ1Y3QgZnJpbmdlX2JpdG1hcCAqZmIgPSBnZXRfZnJpbmdlX2JpdG1hcF9kYXRhIChi bik7CisgICAgICAgICAgaWYgKGZiLT5hbGlnbiA9PSBBTElHTl9CSVRNQVBfVE9QICYmIGZiLT5w ZXJpb2QgPT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3Jv dyAqcm93MTsKKyAgICAgICAgICAgICAgaW50IHRvcF9pbmRfbWF4X3k7CisgICAgICAgICAgICAg IHRvcF9pbmRfbWluX3kgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgICAg ICAgICAgdG9wX2luZF9tYXhfeSA9IHRvcF9pbmRfbWluX3kgKyBmYi0+aGVpZ2h0OworICAgICAg ICAgICAgICBpZiAodG9wX2luZF9tYXhfeSA+IHliKQorICAgICAgICAgICAgICAgIHRvcF9pbmRf bWF4X3kgPSB5YjsKKyAgICAgICAgICAgICAgZm9yICh5ID0gcm93LT55ICsgcm93LT5oZWlnaHQs IHJuID0gdG9wX2luZF9ybiArIDE7CisgICAgICAgICAgICAgICAgICAgeSA8IHRvcF9pbmRfbWF4 X3kgJiYgcm4gPCBucm93czsKKyAgICAgICAgICAgICAgICAgICB5ICs9IHJvdzEtPmhlaWdodCwg cm4rKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAoYm90X2luZF9y biA+PSAwICYmIHJuID49IGJvdF9pbmRfcm4pCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOwor ICAgICAgICAgICAgICAgICAgcm93MSA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm47Cisg ICAgICAgICAgICAgICAgICBpZiAoIXJvdzEtPmVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgICAg ICAgcm93MSA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICAgICAg ICByb3cxLT5pbmRpY2F0ZV9ib2JfcCA9IHJvdy0+aW5kaWNhdGVfYm9iX3A7CisgICAgICAgICAg ICAgICAgICByb3cxLT5pbmRpY2F0ZV90b3BfbGluZV9wID0gcm93LT5pbmRpY2F0ZV90b3BfbGlu ZV9wOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0K KyAgaWYgKGJvdF9pbmRfcm4gPj0gMCkKKyAgICB7CisgICAgICBpbnQgYm4gPSBNQ19OT19GUklO R0VfQklUTUFQOworICAgICAgcm93ID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBib3RfaW5k X3JuOworICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgcm93ID0gdy0+Y3VycmVu dF9tYXRyaXgtPnJvd3MgKyBib3RfaW5kX3JuOworICAgICAgYm90X3Jvd19lbmRzX2F0X3p2X3Ag PSByb3ctPmVuZHNfYXRfenZfcDsKKyAgICAgIGlmIChyb3ctPmluZGljYXRlX2VvYl9wKQorICAg ICAgICB7CisgICAgICAgICAgaWYgKEVRIChib3VuZGFyeV9ib3QsIFFsZWZ0KSkKKyAgICAgICAg ICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDMsIFFib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKTsK KyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDMs IFFib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlm IChyb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3ApCisgICAgICAgICAgeworICAgICAgICAgICAg aWYgKEVRIChhcnJvd19ib3QsIFFsZWZ0KSkKKyAgICAgICAgICAgICAgYm4gPSBNQ19MRUZUX0ZS SU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg Ym4gPSBNQ19SSUdIVF9GUklOR0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICB9CisgICAgICBp ZiAoYm4gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVj dCBmcmluZ2VfYml0bWFwICpmYiA9IGdldF9mcmluZ2VfYml0bWFwX2RhdGEgKGJuKTsKKyAgICAg ICAgICBpZiAoZmItPmFsaWduID09IEFMSUdOX0JJVE1BUF9CT1RUT00gJiYgZmItPnBlcmlvZCA9 PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cx OworICAgICAgICAgICAgICBpbnQgYm90X2luZF9taW5feTsKKyAgICAgICAgICAgICAgYm90X2lu ZF9tYXhfeSA9IHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQ7CisgICAgICAgICAgICAgIGJv dF9pbmRfbWluX3kgPSBib3RfaW5kX21heF95IC0gZmItPmhlaWdodDsKKyAgICAgICAgICAgICAg aWYgKGJvdF9pbmRfbWluX3kgPCBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KSkKKyAgICAg ICAgICAgICAgICBib3RfaW5kX21pbl95ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7 CisgICAgICAgICAgICAgIGZvciAoeSA9IHJvdy0+eSwgcm4gPSBib3RfaW5kX3JuIC0gMTsKKyAg ICAgICAgICAgICAgICAgICB5ID49IGJvdF9pbmRfbWluX3kgJiYgcm4gPj0gMDsKKyAgICAgICAg ICAgICAgICAgICB5IC09IHJvdzEtPmhlaWdodCwgcm4tLSkKKyAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICBpZiAodG9wX2luZF9ybiA+PSAwICYmIHJuIDw9IHRvcF9pbmRfcm4p CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgcm93MSA9IHct PmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICAgICAgICBpZiAoIXJvdzEt PmVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgcm93MSA9IHctPmN1cnJlbnRfbWF0cml4 LT5yb3dzICsgcm47CisgICAgICAgICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV9lb2JfcCA9IHJv dy0+aW5kaWNhdGVfZW9iX3A7CisgICAgICAgICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV9ib3R0 b21fbGluZV9wID0gcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wOworICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgTGlzcF9PYmplY3QgYnVmID0g dy0+Y29udGVudHM7CisgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgYm9vbCBhdXRvX2hzY3JvbGxf bW9kZV9wID0gRVEgKEZidWZmZXJfbG9jYWxfdmFsdWUgKFFhdXRvX2hzY3JvbGxfbW9kZSwgYnVm KSwgUWN1cnJlbnRfbGluZSk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSkgKi8KKyAg Ym9vbCBoc2NsX2FsbF90ZW1wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8g bm90aGluZy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBfcCA9ICh3LT5zdXNwZW5kX2F1dG9f aHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2Rl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOworICAvKiBF WEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgZWxzZSBiZXNpZGVzIGhvcml6b250 YWxseSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IGxpbmUgZGlmZmVyZW50 bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRhbGx5IHNj cm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMV9wID0gKCF3LT5z dXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9f aHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xs ID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3Jv bGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAuLi4KKyAgICAgICAgICAgICAgIEN1 cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICov CisgIGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPT0gMAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAg KHNjcm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxlZnQgYXJyb3cga2V5IG9uZSB0 aW1lLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5IHNjcm9s bGVkIGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1wX3AgPSAoIXctPnN1c3BlbmRfYXV0 b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAor ICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwg YW5kIGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVudCBsaW5lIHRvIGJlCisgICAg ICAgICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuCisgICAgICAgICAg ICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHku ICovCisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAg ICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAg ICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICA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IGludCBtY19yaWdodF9mcmluZ2VfZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsK KyAgZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBDSF9DQUNIRTsKKyAgZm9yIChpbnQg bnRoID0gMDsKKyAgICAgICBtY190cmF2ZXJzZV9jYWNoZV9wICh3LT5tY19tYXRyaXgsIGNhY2hl X3R5cGUsIHZudGhfY20sIG50aCk7CisgICAgICAgKytudGgpCisgICAgeworICAgICAgLy8gIGlu dCB4ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF9jbV0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS54 OworICAgICAgLy8gIGludCBmeCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhfY21dLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF0uZng7CisgICAgICAvLyAgaW50IHkgPSB3LT5tY19tYXRyaXgudnBvc1t2 bnRoX2NtXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLnk7CisgICAgICAvLyAgaW50IGZ5ID0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF9jbV0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5meTsKKyAgICAg IC8vICBpbnQgaHBvcyA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhfY21dLmNhY2hlW2NhY2hlX3R5 cGVdW250aF0uaHBvczsKKyAgICAgIGludCB2cG9zID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF9j bV0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS52cG9zOworICAgICAgLy8gIGludCB3ZCA9IHctPm1j X21hdHJpeC52cG9zW3ZudGhfY21dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ud2Q7CisgICAgICAv LyAgaW50IGggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoX2NtXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmg7CisgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID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NoZVtjYWNoZV90eXBlXVtudGhdLmFjdGl2ZV9wOworICAgICAgZW51 bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF9jbV0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS5nbHlwaF9mbGF2b3I7CisgICAgICBib29sIGVuYWJsZWRfcCA9 IHctPm1jX21hdHJpeC52cG9zW3ZudGhfY21dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxl ZF9wOworICAgICAgaWYgKCh2cG9zID09IHZudGhfZG0gfHwgdnBvcyA9PSB2bnRoX2NtKQorICAg ICAgICAgICYmIGdseXBoX2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUAorICAgICAg ICAgICYmICFoc2NsX2FsbF90ZW1wX3AKKyAgICAgICAgICAmJiAhaHNjbF90ZW1wX3AKKyAgICAg ICAgICAmJiAhaHNjbF9wZXJtX3AKKyAgICAgICAgICAmJiAhaHNjbF9hbGxfcGVybV8wX3AKKyAg ICAgICAgICAmJiAhaHNjbF9hbGxfcGVybV8xX3AKKyAgICAgICAgICAmJiAhaHNjbF9hbGxfcGVy bV8yX3AKKyAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpbnQg ZnJpbmdlX2JpdG1hcCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgZW51bSBmYWNl X2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgICAoIWFjdGl2ZV9wCisgICAg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3Rp dmVfd2luZG93cykpKQorICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1vdmVybGF5LWFycm93LWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAg ICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAo dywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LXByZS16di1mYWNlIiksIHRydWUpCisgICAg ICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9mYWNl X2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAg ICBpZiAody0+aHNjcm9sbCAhPSAwKQorICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dl dF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ciKSwgZmFsc2UsIHRy dWUpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNf Z2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJvdyIpLCB0cnVlLCB0 cnVlKTsKKyAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0g TUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBN Q19OT19GUklOR0VfQklUTUFQOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKCh2cG9zID09 IHZudGhfZG0gfHwgdnBvcyA9PSB2bnRoX2NtKQorICAgICAgICAgICAgICAgICAmJiBnbHlwaF9m bGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICAgICAgICAgICAgJiYgKGhz Y2xfYWxsX3RlbXBfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8wX3AK KyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMV9wCisgICAgICAgICAgICAg ICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNj bF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfcGVybV9wKQorICAgICAgICAg ICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgeworICAgICAgICAgICAgaW50IGZyaW5n ZV9iaXRtYXAgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgICAgZW51bSBmYWNlX2lk IG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgICAgICghYWN0aXZlX3AKKyAgICAg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0 aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwg aW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1 ZSkKKyAgICAgICAgICAgICAgOiAoYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgPyBsb29rdXBf bmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtcHJlLXp2LWZh Y2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAg ICBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdF X0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBvdmVybGF5 X2Fycm93X2ZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBE RUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgICBpZiAoaHNjbF9hbGxfcGVybV8wX3ApCisgICAg ICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJu ICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAgICAgZWxzZSBpZiAo aHNjbF9hbGxfcGVybV8xX3ApCisgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dl dF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCB0cnVlLCBmYWxzZSk7 CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8yX3ApCisgICAgICAgICAg ICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAo IistaHNjbC1wZXJtIiksIGZhbHNlLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYg KGhzY2xfcGVybV9wKQorICAgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0 X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIHRydWUsIHRydWUpOwor ICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF90ZW1wX3ApCisgICAgICAgICAg ICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRl cm4gKCIrLWhzY2wtdGVtcCIpLCBmYWxzZSwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAg IGVsc2UgaWYgKGhzY2xfdGVtcF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgZnJpbmdlX2Jp dG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtdGVtcCIpLCB0 cnVlLCBmYWxzZSk7CisgICAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29y X3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICB9CisgICAgICAgICAg ZWxzZSBpZiAoKHZwb3MgPT0gdm50aF9kbSB8fCB2cG9zID09IHZudGhfY20pCisgICAgICAgICAg ICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9B UlJPVworICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVS U0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAg IHx8IGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAgICAgICAg ICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisg ICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVS VElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9m bGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAg ICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkKKyAgICAg ICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBMaXNwX09iamVjdCBiaXRtYXBfZmxhdm9yID0gKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1df UkVDVEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBRbWNfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVS U0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX2hvbGxvd19yZWN0YW5nbGVfcmln aHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGds eXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVS VElDQUxfQkFSX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvdwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9y ID09IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19yZXZl cnNlZF92ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJf YmFja3NsYXNoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFFu aWw7CisgICAgICAgICAgICAgIG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUg PT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IGxvb2t1cF9mcmluZ2VfYml0bWFwIChiaXRtYXBfZmxhdm9yKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsK KyAgICAgICAgICAgICAgbWNfcmlnaHRfZnJpbmdlX2ZhY2VfaWQgPQorICAgICAgICAgICAgICAg IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAg ICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYKKyAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2Zs YXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAg ICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNf UkVWRVJTRURfVkVSVElDQUxfQkFSKSkKKyAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVk X2ZhY2UgKHcsIGYsIGludGVybiAoIistcmV2ZXJzZWQtYmFyLXByZS16di1mYWNlIiksIHRydWUp CisgICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1B UAorICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBBVF9aVgorICAgICAgICAg ICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdM RV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0g TUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAg ICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQorICAgICAg ICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNl ZC1iYXItYXQtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgIDogKGN1cnNvcl90eXBl ID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9z aXRpb24gPT0gUE9TVF9aVgorICAgICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0g TUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAg ICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hU X0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZF UlNFRF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1iYXItcG9zdC16di1mYWNlIiksIHRydWUpCisg ICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAor ICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYKKyAgICAgICAgICAg ICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9S SUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZF UlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlw aF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAg PyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1iYXItcHJlLXp2LWZhY2UiKSwg dHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0Vf QklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IEFUX1pWCisgICAg ICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX0hPTExPV19SRUNU QU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0g TUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAg JiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAg ICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistYmFyLWF0LXp2LWZh Y2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9G UklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBPU1Rf WlYKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9M TE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2Zs YXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAg ICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAg ICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1iYXIt cG9zdC16di1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7 Cisg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W9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxl ZnQpKQorICAgICAgICAgICAgICAgICA/IE1DX0xFRlRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwg dG9wX3Jvd19lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgICAgIDogTUNfTEVGVF9GUklOR0Ug KDIsIFF0b3AsIDApKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAg ICAgICAgbGVmdF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55OworICAgICAgICB9Cisg ICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFs ZWZ0KSkKKyAgICAgICAgeworICAgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoMywgUWJv dHRvbSwgYm90X3Jvd19lbmRzX2F0X3p2X3ApOworICAgICAgICAgIGlmIChib3RfaW5kX21heF95 ID49IDApCisgICAgICAgICAgICBsZWZ0X29mZnNldCA9IGJvdF9pbmRfbWF4X3kgLSAocm93LT55 ICsgcm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKCghcm93 LT5yZXZlcnNlZF9wICYmIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAocm93KSkKKyAg ICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jb250aW51ZWRfcCkpCisg ICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNCwgUWNvbnRpbnVhdGlvbiwgMCk7CisgICAg ICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VtcHR5X2xpbmVfcCAmJiBFUSAoZW1wdHlfcG9zLCBR bGVmdCkpCisgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNSwgUWVtcHR5X2xpbmUsIDAp OworICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGluZV9wICYmIEVRIChhcnJvd190 b3AsIFFsZWZ0KSkKKyAgICAgICAgeworICAgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAo NiwgUXVwLCAwKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAgICAg ICAgbGVmdF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55OworICAgICAgICB9CisgICAg ICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgJiYgRVEgKGFycm93X2JvdCwg UWxlZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg3LCBR ZG93biwgMCk7CisgICAgICAgICAgaWYgKGJvdF9pbmRfbWF4X3kgPj0gMCkKKyAgICAgICAgICAg IGxlZnRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVp Z2h0KTsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAgICBsZWZ0ID0gTUNfTk9fRlJJTkdF X0JJVE1BUDsKKyAgICAgIC8qIERlY2lkZSB3aGljaCBiaXRtYXAgdG8gZHJhdyBpbiB0aGUgcmln aHQgZnJpbmdlLiAgKi8KKyAgICAgIGlmIChXSU5ET1dfUklHSFRfRlJJTkdFX1dJRFRIICh3KSA9 PSAwKQorICAgICAgICByaWdodCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICBlbHNlIGlm IChyb3ctPnJpZ2h0X3VzZXJfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQor ICAgICAgICB7CisgICAgICAgICAgcmlnaHQgPSByb3ctPnJpZ2h0X3VzZXJfZnJpbmdlX2JpdG1h cDsKKyAgICAgICAgICByaWdodF9mYWNlX2lkID0gcm93LT5yaWdodF91c2VyX2ZyaW5nZV9mYWNl X2lkO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gICAgIGVsc2UgaWYgKCghcm93 LT5yZXZlcnNlZF9wICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICB8fCAocm93 LT5yZXZlcnNlZF9wICYmIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAocm93KSkpCisg ICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICg0LCBRY29udGludWF0aW9uLCAwKTsKKyAg ICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCAmJiBFUSAoYXJyb3dfdG9wLCBR cmlnaHQpKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklOR0UgKDYs IFF1cCwgMCk7CisgICAgICAgICAgaWYgKHRvcF9pbmRfbWluX3kgPj0gMCkKKyAgICAgICAgICAg IHJpZ2h0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSByb3ctPnk7CisgICAgICAgIH0KKyAgICAg IGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCAmJiBFUSAoYXJyb3dfYm90LCBR cmlnaHQpKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklOR0UgKDcs IFFkb3duLCAwKTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAgICAgICAg ICAgcmlnaHRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZpc2libGVf aGVpZ2h0KTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9lbXB0eV9s aW5lX3AgJiYgRVEgKGVtcHR5X3BvcywgUXJpZ2h0KSkKKyAgICAgICAgcmlnaHQgPSBNQ19SSUdI VF9GUklOR0UgKDUsIFFlbXB0eV9saW5lLCAwKTsKKyAgICAgIGVsc2UKKyAgICAgICAgcmlnaHQg PSBNQ19OT19GUklOR0VfQklU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VyLT5yZWRyYXdf ZnJpbmdlX2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9i aXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgfHwgbWNfcmln aHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAg IGN1ci0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBw ZXJpb2RpY19wOworICAgICAgICAgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFwICE9IE1D X05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9iaXRt YXAgPSBtY19sZWZ0X2ZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSBsZWZ0OworICAgICAgICAgICAg ICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAg ICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gbWNfbGVmdF9mcmluZ2VfZmFj ZV9pZDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRf ZnJpbmdlX2ZhY2VfaWQgPSBsZWZ0X2ZhY2VfaWQ7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0 X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBj dXItPmxlZnRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9vZmZzZXQgPSBsZWZ0X29mZnNldDsKKyAgICAg ICAgICAgICAgaWYgKG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1B UCkKKyAgICAgICAgICAgICAgICBjdXItPnJpZ2h0X2ZyaW5nZV9iaXRtYXAgPSBtY19yaWdodF9m cmluZ2VfYml0bWFwOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIGN1 ci0+cmlnaHRfZnJpbmdlX2JpdG1hcCA9IHJpZ2h0OworICAgICAgICAgICAgICBpZiAobWNfcmln aHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAg IGN1ci0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQgPSBtY19yaWdodF9mcmluZ2VfZmFjZV9pZDsKKyAg ICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPnJpZ2h0X2ZyaW5nZV9m YWNlX2lkID0gcmlnaHRfZmFjZV9pZDsKKyAgICAgICAgICAgICAgaWYgKG1jX3JpZ2h0X2ZyaW5n ZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPnJp Z2h0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldCA9IHJpZ2h0X29mZnNldDsKKyAgICAgICAg ICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgPCAw KQorICAgICAgICByb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwID0gbWNfZ2V0X2xvZ2ljYWxfZnJp bmdlX2JpdG1hcCAodywgUW92ZXJsYXlfYXJyb3csIDAsIDApOworICAgICAgaWYgKHJvdy0+b3Zl cmxheV9hcnJvd19iaXRtYXAgIT0gY3VyLT5vdmVybGF5X2Fycm93X2JpdG1hcCkKKyAgICAgICAg eworICAgICAgICAgIHJlZHJhd19wID0gMSwgcm93LT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9 IDE7CisgICAgICAgICAgaWYgKCFrZWVwX2N1cnJlbnRfcCkKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgY3VyLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAgICAg IGN1ci0+b3ZlcmxheV9hcnJvd19iaXRtYXAgPSByb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwOwor ICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFw ICE9IE1DX05PX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICB8fCBtY19yaWdodF9mcmluZ2VfYml0 bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHJvdy0+ZnJpbmdlX2JpdG1hcF9w ZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgIGVsc2UKKyAgICAgICAgICByb3ctPmZyaW5nZV9i aXRtYXBfcGVyaW9kaWNfcCA9IHBlcmlvZGljX3A7CisgICAgICBpZiAobWNfbGVmdF9mcmluZ2Vf Yml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHJvdy0+bGVmdF9mcmluZ2Vf Yml0bWFwID0gbWNfbGVmdF9mcmluZ2VfYml0bWFwOworICAgICAgICBlbHNlCisgICAgICAgICAg cm93LT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSBsZWZ0OworICAgICAgaWYgKG1jX2xlZnRfZnJpbmdl X2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICByb3ctPmxlZnRfZn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EVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgcC5ieSA9IFdJ TkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCBtYXggKGhlYWRlcl9saW5lX2hlaWdodCwgcm93LT55 KSk7CisgIHAubnkgPSByb3ctPnZpc2libGVfaGVpZ2h0OworICBpZiAobGVmdF9wKQorICAgIHsK KyAgICAgIGludCB3ZCA9IFdJTkRPV19MRUZUX0ZSSU5HRV9XSURUSCAodyk7CisgICAgICBpbnQg eCA9IHdpbmRvd19ib3hfbGVmdCAodywgKFdJTkRPV19IQVNfRlJJTkdFU19PVVRTSURFX01BUkdJ TlMgKHcpCisgICAgICAgICAgID8gTEVGVF9NQVJHSU5fQVJFQQorICAgICAgICAgICA6IFRFWFRf QVJFQSkpOworICAgICAgaWYgKHAud2QgPiB3ZCkKKyAgICAgICAgcC53ZCA9IHdkOworICAgICAg cC54ID0geCAtIHAud2QgLSAod2QgLSBwLndkKSAvIDI7CisgICAgICBpZiAocC53ZCA8IHdkIHx8 IHAueSA+IHAuYnkgfHwgcC55ICsgcC5oIDwgcC5ieSArIHAubnkpCisgICAgICAgIHsKKyAgICAg ICAgICAvKiBJZiBXIGhhcyBhIHZlcnRpY2FsIGJvcmRlciB0byBpdHMgbGVmdCwgZG9uJ3QgZHJh dyBvdmVyIGl0LiAgKi8KKyAgICAgICAgICB3ZCAtPSAoKCFXSU5ET1dfTEVGVE1PU1RfUCAodykK KyAgICAgICAgICAgIC8qIFRoaXMgY291bGQgYmUgd3Jvbmcgd2hlbiB3ZSBhbGxvdyB3aW5kb3cg bG9jYWwKKyAgICAgICAgICAgICAgIHJpZ2h0IGRpdmlkZXJzIC0gYnV0IHRoZSB3aW5kb3cgb24g dGhlIGxlZnQgaXMgaGFyZAorICAgICAgICAgICAgICAgdG8gZ2V0LiAgKi8KKyAgICAgICAgICAg ICYmICFGUkFNRV9SSUdIVF9ESVZJREVSX1dJRFRIIChmKQorICAgICAgICAgICAgJiYgIVdJTkRP V19IQVNfVkVSVElDQUxfU0NST0xMX0JBUiAodykKKyAgICAgICAgICAgIC8qIEJ1dCBkb24ndCBy ZWR1Y2UgdGhlIGZyaW5nZSB3aWR0aCBpZiB0aGUgd2luZG93CisgICAgICAgICAgICAgICBoYXMg YSBsZWZ0IG1hcmdpbiwgYmVjYXVzZSB0aGF0IG1lYW5zIHdlIGFyZSBub3QKKyAgICAgICAgICAg ICAgIGluIGRhbmdlciBvZiBkcmF3aW5nIG92ZXIgdGhlIHZlcnRpY2FsIGJvcmRlciwKKyAgICAg ICAgICAgICAgIGFuZCBPVE9IIGxlYXZpbmcgb3V0IHRoYXQgb25lIHBpeGVsIGxlYXZlcyBiZWhp bmQKKyAgICAgICAgICAgICAgIHRyYWNlcyBvZiB0aGUgY3Vyc29yLCBpZiBpdCB3YXMgaW4gY29s dW1uIHplcm8KKyAgICAgICAgICAgICAgIGJlZm9yZSBkcmF3aW5nIG5vbi1lbXB0eSBtYXJnaW4g YXJlYS4gICovCisgICAgICAgICAgICAmJiB3LT5sZWZ0X21hcmdpbl9jb2xzID09IDApCisgICAg ICAgICAgID8gMSA6IDApOworICAgICAgICAgIHAuYnggPSB4IC0gd2Q7CisgICAgICAgICAgcC5u eCA9IHdkOworICAgICAgICB9CisgICAgfQorICBlbHNlCisgICAgeworICAgICAgaW50IHggPSB3 aW5kb3dfYm94X3JpZ2h0ICh3LAorICAgICAgICAoV0lORE9XX0hBU19GUklOR0VTX09VVFNJREVf TUFSR0lOUyAodykKKyAgICAgICAgID8gUklHSFRfTUFSR0lOX0FSRUEKKyAgICAgICAgIDogVEVY VF9BUkVBKSk7CisgICAgICBpbnQgd2QgPSBXSU5ET1dfUklHSFRfRlJJTkdFX1dJRFRIICh3KTsK KyAgICAgIGlmIChwLndkID4gd2QpCisgICAgICAgIHAud2QgPSB3ZDsKKyAgICAgIHAueCA9IHgg KyAod2QgLSBwLndkKSAvIDI7CisgICAgICAvKiBDbGVhciByaWdodCBmcmluZ2UgaWYgbm8gYml0 bWFwIHRvIGRyYXcgb2YgaWYgYml0bWFwIGRvZXNuJ3QgZmlsbAorICAgdGhlIGZyaW5nZS4gICov CisgICAgICBpZiAocC53ZCA8IHdkIHx8IHAueSA+IHAuYnkgfHwgcC55ICsgcC5oIDwgcC5ieSAr IHAubnkpCisgICAgICAgIHsKKyAgICAgICAgICBwLmJ4ID0geDsKKyAgICAgICAgICBwLm54ID0g d2Q7CisgICAgICAgIH0KKyAgICB9CisgIGlmIChwLnggPj0gV0lORE9XX0JPWF9MRUZUX0VER0Vf WCAodykKKyAgICAgICYmIChwLnggKyBwLndkKSA8PSBXSU5ET1dfQk9YX0xFRlRfRURHRV9YICh3 KSArIFdJTkRPV19QSVhFTF9XSURUSCAodykpCisgICAgRlJBTUVfUklGIChmKS0+ZHJhd19mcmlu Z2VfYml0bWFwICh3LCByb3csICZwKTsKK30KKwordm9pZAorbWNfZHJhd19mcmluZ2VfYml0bWFw IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCBsZWZ0X3AsIGVu dW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUpCit7CisgIGludCBvdmVybGF5ID0gMDsKKyAg aWYgKGxlZnRfcCA9PSByb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jdXJzb3JfaW5fZnJpbmdlX3Ap CisgICAgeworICAgICAgTGlzcF9PYmplY3QgY3Vyc29yID0gUW5pbDsKKyAgICAgIHN3aXRjaCAo Y3Vyc29yX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOgorICAg ICAgICAgIGlmIChyb3ctPnZpc2libGVfaGVpZ2h0ID49IFNUQU5EQVJEX0JJVE1BUF9IRUlHSFQg KGhvbGxvd19yZWN0YW5nbGVfYml0cykpCisgICAgICAgICAgICBjdXJzb3IgPSBRaG9sbG93Owor ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGN1cnNvciA9IFFob2xsb3dfc21hbGw7CisgICAg ICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICAgICAgICBpZiAo cm93LT52aXNpYmxlX2hlaWdodCA+PSBTVEFOREFSRF9CSVRNQVBfSEVJR0hUIChob2xsb3dfcmVj dGFuZ2xlX2JpdHMpKQorICAgICAgICAgICAgY3Vyc29yID0gUWhvbGxvdzsKKyAgICAgICAgICBl bHNlCisgICAgICAgICAgICBjdXJzb3IgPSBRaG9sbG93X3NtYWxsOworICAgICAgICAgIGJyZWFr OworICAgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgICAgY3Vyc29yID0gUWJveDsK KyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgICAgY3Vyc29y ID0gUWJhcjsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19IQkFSOgorICAgICAg ICAgIGN1cnNvciA9IFFoYmFyOworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1DX05P X0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgorICAgICAgICBjYXNl IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklU TUFQOgorICAgICAgICBkZWZhdWx0OgorICAgICAgICAgIHctPnBoeXNfY3Vyc29yX29uX3AgPSAw OworICAgICAgICAgIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gMDsKKyAgICAgICAgICBicmVh azsKKyAgICAgICAgfQorICAgICAgaWYgKCFOSUxQIChjdXJzb3IpKQorICAgICAgICB7CisgICAg ICAgICAgaW50IGJtID0gbWNfZ2V0X2xvZ2ljYWxfY3Vyc29yX2JpdG1hcCAodywgY3Vyc29yKTsK KyAgICAgICAgICBpZiAoYm0gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwXzEgKHcsIHJvdywgbGVmdF9wLCAy LCBibSk7CisgICAgICAgICAgICAgIG92ZXJsYXkgPSBFUSAoY3Vyc29yLCBRYm94KSA/IDMgOiAx OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBtY19kcmF3X2ZyaW5nZV9iaXRt YXBfMSAodywgcm93LCBsZWZ0X3AsIG92ZXJsYXksIE1DX05PX0ZSSU5HRV9CSVRNQVApOworICBp ZiAobGVmdF9wICYmIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJ VE1BUCkKKyAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXBfMSAodywgcm93LCAxLCAxLCByb3ctPm92 ZXJsYXlfYXJyb3dfYml0bWFwKTsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICNkZWZpbmUgTk9fRlJJTkdFX0JJVE1BUCAwCiAj ZGVmaW5lIFVOREVGX0ZSSU5HRV9CSVRNQVAgMQogI2RlZmluZSBNQVhfU1RBTkRBUkRfRlJJTkdF X0JJVE1BUFMgQVJSQVlFTFRTIChzdGFuZGFyZF9iaXRtYXBzKQpAQCAtMTcwMCw2ICszMjIwLDE2 OCBAQCBSZXR1cm4gbmlsIGlmIFBPUyBpcyBub3QgdmlzaWJsZSBpbiBXSU5ET1cuICAqLykKIHZv aWQKIHN5bXNfb2ZfZnJpbmdlICh2b2lkKQogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIChnZXQgJ2VtcHR5LWxpbmUg J2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2xlLWRvd24gJ2ZyaW5nZSkgPT4gNDggKi8KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMg Ki8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgREVGU1lNIChRdHJ1bmNhdGlvbiwg InRydW5jYXRpb24iKTsKICAgREVGU1lNIChRY29udGludWF0aW9uLCAiY29udGludWF0aW9uIik7 CiAgIERFRlNZTSAoUW92ZXJsYXlfYXJyb3csICJvdmVybGF5LWFycm93Iik7CmRpZmYgLS1naXQg YS9zcmMvbnN0ZXJtLmggYi9zcmMvbnN0ZXJtLmgKaW5kZXggNzhjZTYwOC4uOGVmMGRmZSAxMDA2 NDQKLS0tIGEvc3JjL25zdGVybS5oCisrKyBiL3NyYy9uc3Rlcm0uaApAQCAtNjYwLDYgKzY2MCwx NiBAQCB0eXBlZGVmIGlkIGluc3RhbmNldHlwZTsKIAogQGludGVyZmFjZSBFbWFjc1Njcm9sbGVy IDogTlNTY3JvbGxlcgogICB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgICBOU1JlY3QgbWNfcmVjdGFuZ2xlOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAgICBzdHJ1Y3Qgd2luZG93ICp3aW5kb3c7CiAgICBzdHJ1Y3Qg ZnJhbWUgKmZyYW1lOwogICAgTlNSZXNwb25kZXIgKnByZXZSZXNwb25kZXI7CkBAIC02ODAsNiAr NjkwLDE4IEBAIHR5cGVkZWYgaWQgaW5zdGFuY2V0eXBlOwogICAgaW50IGVtX3dob2xlOwogICAg fQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CistICh2b2lkKW1jX3NldF9yZWN0YW5nbGU6IChOU1JlY3QpcmVjdDsKKy0gKE5TUmVjdCltY19n ZXRfcmVjdGFuZ2xlOworLSAoc3RydWN0IHdpbmRvdyAqKW1jX2dldF93aW5kb3c7CistIChib29s KW1jX2p1ZGdlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAtIChpbnN0YW5jZXR5 cGUpIGluaXRGcmFtZTogKE5TUmVjdCApciB3aW5kb3c6IChMaXNwX09iamVjdCl3aW47CiAtICh2 b2lkKXNldEZyYW1lOiAoTlNSZWN0KXI7CiAKZGlmZiAtLWdpdCBhL3NyYy9uc3Rlcm0ubSBiL3Ny Yy9uc3Rlcm0ubQppbmRleCA4MWQzNmJlLi5kZmU2MDU5IDEwMDY0NAotLS0gYS9zcmMvbnN0ZXJt Lm0KKysrIGIvc3JjL25zdGVybS5tCkBAIC03Niw2ICs3Niw5NzkgQEAgVXBkYXRlZCBieSBDaHJp c3RpYW4gTGltcGFjaCAoY2hyaXNAbmljZS5jaCkKIHN0YXRpYyBFbWFjc01lbnUgKm1haW5NZW51 OwogI2VuZGlmCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBM RS1DVVJTT1JTICovCisKK3N0YXRpYyBCT09MIG5zX2NsaXBfdG9fcmVjdCAoc3RydWN0IGZyYW1l ICosIE5TUmVjdCAqLCBpbnQpOworCitzdGF0aWMgdm9pZCBuc19yZXNldF9jbGlwcGluZyAoc3Ry dWN0IGZyYW1lICopOworCitzdGF0aWMgdm9pZCBuc19kdW1wZ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xvY2tfaW5wdXQgKCk7CisgICAgICBs c2wtPnJlZCA9IC0xLjA7CisgICAgICBsc2wtPmdyZWVuID0gLTEuMDsKKyAgICAgIGxzbC0+Ymx1 ZSA9IC0xLjA7CisgICAgfQorICBbW2NvbCBjb2xvclVzaW5nRGVmYXVsdENvbG9yU3BhY2VdCisg ICAgICAgIGdldFJlZDogJnJlZCBncmVlbjogJmdyZWVuIGJsdWU6ICZibHVlIGFscGhhOiAmYWxw aGFdOworICB1bmJsb2NrX2lucHV0ICgpOworICBsc2wtPnJlZCA9IHJlZDsKKyAgbHNsLT5ncmVl biA9IGdyZWVuOworICBsc2wtPmJsdWUgPSBibHVlOworfQorCitzdGF0aWMgdm9pZAorbWNfbnNf ZHJhd19vdmVyd3JpdHRlbiAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21h dHJpeCAqbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAq cm93LCBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCkKK3sKKyAgLy8gIGludCB2cG9zID0gTUFU UklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgIC8vICBjbG9ja190IGNsb2NrX3N0YXJ0ID0g Y2xvY2soKTsKKyAgLy8gbnNfZHJhd191bmRlcndhdmUgKHMsIHMtPndpZHRoLCBzLT54KTsKKyAg TlNDb2xvciAqaG9sbG93X2NvbG9yID0gRlJBTUVfQkFDS0dST1VORF9DT0xPUiAocy0+Zik7Cisg IHN0cnVjdCBmYWNlICpmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBERUZBVUxUX0ZBQ0VfSUQp OworICBpbnQgdm50aCA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAvKiBTVFJF VENIX0dMWVBIIG1heSBjb250YWluIG1vcmUgdGhhbiBvbmUgZmFrZSBjdXJzb3IgYXQgdGhlIHNh bWUgSFBPUy4KKyAgTk9URTogIEEgZmFrZSBjdXJzb3IgZnJvbSBvbmUgY2FjaGUgbWF5IG92ZXJ3 cml0ZSBhIGZha2UgY3Vyc29yIGZyb20gYW5vdGhlcgorICBjYWNoZSAtLSB0aHVzLCB3ZSBtdXN0 IGNoZWNrIHRoZW0gYWxsIGZvciBvdmVyd3JpdHRlbiBmYWtlIGN1cnNvcnMuICovCisgIGZvciAo ZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICBjYWNoZV90 eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGZvciAo aW50IG50aCA9IDA7CisgICAgICAgICAgIHMKKyAgICAgICAgICAgJiYgbWNfdHJhdmVyc2VfY2Fj aGVfcCAocy0+dy0+bWNfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGgpOworICAgICAgICAg ICArK250aCkKKyAgICAgICAgeworICAgICAgICAgIC8vICBpbnQgeCA9IHMtPnctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueDsKKyAgICAgICAgICBpbnQgZngg PSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZ4Owor ICAgICAgICAgIC8vICBpbnQgeSA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF0ueTsKKyAgICAgICAgICBpbnQgZnkgPSBzLT53LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZ5OworICAgICAgICAgIGludCBocG9zID0g cy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5ocG9zOwor ICAgICAgICAgIGludCB2cG9zID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXS52cG9zOworICAgICAgICAgIGludCB3ZCA9IHMtPnctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ud2Q7CisgICAgICAgICAgaW50IGggPSBz LT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmg7CisgICAg ICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IHMtPnctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vyc29yX3R5cGU7CisgICAgICAgICAg Ly8gIGludCBjdXJzb3Jfd2lkdGggPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhdLmN1cnNvcl93aWR0aDsKKyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxz bF9mZyA9IHsucmVkID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXS5mZy5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVu ID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mZy5n cmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IHMtPnctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcuYmx1ZX07CisgICAg ICAgICAgLy8gIHN0cnVjdCBtY19SR0IgbHNsX2JnID0gey5yZWQgPSBzLT53LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLnJlZCwKKyAgICAgICAgICAvLyAg ICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ncmVlbiwKKyAgICAgICAgICAvLyAgICAgICAg ICAgICAgICAgICAgICAgICAgLmJsdWUgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLmJnLmJsdWV9OworICAgICAgICAgIGJvb2wgYWN0aXZlX3AgPSBz LT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmFjdGl2ZV9w OworICAgICAgICAgIC8vICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBzLT53LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoX2ZsYXZvcjsKKyAg ICAgICAgICBib29sIGVuYWJsZWRfcCA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF0uZW5hYmxlZF9wOworICAgICAgICAgIGJvb2wgZ29fcCA9ICh2cG9z ID09IHZudGgKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA9PSBjdXJzb3JfZ2x5cGgt Pmhwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKTsKKyAgICAgICAgICBp ZiAoIWdvX3ApCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBOU1JlY3QgcjsKKyAg ICAgICAgICByLm9yaWdpbi54ID0gZng7CisgICAgICAgICAgci5vcmlnaW4ueSA9IGZ5OworICAg ICAgICAgIHIuc2l6ZS5oZWlnaHQgPSBoOworICAgICAgICAgIHIuc2l6ZS53aWR0aCA9IHdkOwor ICAgICAgICAgIFtbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2xfZmcucmVkCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IGxzbF9mZy5ncmVlbgor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiBsc2xfZmcuYmx1ZQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdIHNldF07Cisg ICAgICBpZiAoY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICAgICAgeworICAgICAg ICAgIExpc3BfT2JqZWN0IGJ1ZiA9IHMtPnctPmNvbnRlbnRzOworICAgICAgICAgIENIRUNLX0JV RkZFUiAoYnVmKTsKKyAgICAgICAgICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsK KyAgICAgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5zaWVudF9tYXJr X21vZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIg KGIsIG1hcmtfYWN0aXZlKSkpOworICAgICAgICAgIHB0cmRpZmZfdCByZWdpb25fYmVnID0gKHJl Z2lvbl9hY3RpdmVfcCkgPyBtY19yZWdpb25fbGltaXQgKDEpIDogLTE7CisgICAgICAgICAgcHRy ZGlmZl90IHJlZ2lvbl9lbmQgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IG1jX3JlZ2lvbl9saW1pdCAo MCkgOiAtMTsKKyAgICAgICAgICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICYm IGFjdGl2ZV9wCisgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBvcyA9PSByZWdp b25fYmVnKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93 X2FjdGl2ZV9yZWdpb25fYmVnX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ ZiwgaW50ZXJuICgiKy1yZWFsLWZha2Ut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3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZSksIHMtPmYpOworICAg ICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vl bl9jb2xvcjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoYWN0 aXZlX3ApCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGVudW0gZmFj ZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAg ICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9G Uk9NX0lEIChzLT5mLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAg ICBOU0NvbG9yICpob2xsb3dfYWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3Ig KE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2FjdGl2ZV9mYWNlKSwgcy0+Zik7CisgICAgICAg ICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVfY29sb3I7CisgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAg ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9s bG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50 ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOwor ICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9 IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAg ICAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19pbmFjdGl2ZV9jb2xvciA9IG5zX2xvb2t1cF9p bmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19pbmFjdGl2ZV9mYWNlKSwg cy0+Zik7CisgICAgICAgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2luYWN0 aXZlX2NvbG9yOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxz ZSBpZiAoZmFjZSAmJiBOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpID09IG5zX2luZGV4X2NvbG9y IChGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpLCBzLT5mKSkKKyAgICAgICAgICB7CisgICAgICAg ICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSks IHMtPmYpIHNldF07CisgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBGUkFNRV9DVVJTT1JfQ09M T1IgKHMtPmYpOworICAgICAgICAgIH0KKyAgICAgICAgICBzd2l0Y2ggKGN1cnNvcl90eXBlKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBjYXNlIE1DX05PX0ZSSU5HRV9CSVRNQVA6Cisg ICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgor ICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX1JJR0hUX0ZSSU5H RV9CSVRNQVA6CisgICAgICAgICAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAg ICAgICAgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgICAgICAgICAgTlNSZWN0Rmls bCAocik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfRlJB TUVEX0JPWDoKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgICAg ICBbaG9sbG93X2NvbG9yIHNldF07CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNl dFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgICAgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChz LT5mKSBzZXRdOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1D X0hPTExPV19CT1g6CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAg ICAgICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKE5T SW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgICAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xP UiAocy0+Zikgc2V0XTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2Fz ZSBNQ19IQkFSOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAg ICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX0JBUjoKKyAgICAgICAgICAgICAgICBO U1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgICAvKiBJZiBhIGdseXBoIGV4aXN0cyAocy0+Y2hhcjJiICE9IE5VTEwpLCB0aGVuIGRy YXcgdGhlIGdseXBoIG9uIHRvcCBvZiB0aGUKKyAgICAgICAgICBuZXdseSBkcmF3biByZWN0YW5n bGUgdGhhdCB3YXMgY3JlYXRlZCBoZXJlaW5hYm92ZS4gIFRvIHRoZSBleHRlbnQgdGhhdCB3ZQor ICAgICAgICAgIHdhbnQgdG8gZG91YmxlLWltcHJpbnQgZ2x5cGhzIHRvIG1ha2UgdGhlbSBhcHBl YXIgdG8gYmUgc2VtaS1ib2xkLCBpdCBjYW4KKyAgICAgICAgICBiZSBkb25lIGhlcmUgZm9yIGFs bCBjdXJzb3IgdHlwZXMuICBUaGUgYm94LXN0eWxlIGN1cnNvcnMgYXJlIGltcHJpbnRlZAorICAg ICAgICAgIHdpdGggZ2x5cGhzIG9ubHkgb25lICgxKSB0aW1lLiAgVGhlIHNlbWktYm9sZCBhcHBl YXJhbmNlIGlzIGhlbHBmdWwgd2hlbgorICAgICAgICAgIGRlYnVnZ2luZyB0byBzZWUgdGhhdCB0 aGUgY29vcmRpbmF0ZXMgYXJlIGNvcnJlY3QuICovCisgICAgICAgICAgaWYgKHMtPmNoYXIyYiAh PSBOVUxMCisgICAgICAgICAgICAgICYmIChjdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YCisg ICAgICAgICAgICAgICAgICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YCisgICAgICAg ICAgICAgICAgICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19IT0xMT1dfQk9YKSkKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgQk9PTCBpc0NvbXBvc2l0ZSA9IHMtPmZpcnN0X2dseXBoLT50eXBl ID09IENPTVBPU0lURV9HTFlQSDsKKyAgICAgICAgICAgICAgaWYgKGlzQ29tcG9zaXRlKQorICAg ICAgICAgICAgICAgIG5zX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChz KTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAgIHN0cnVjdCBmb250ICpmb250ID0gcy0+ZmFjZS0+Zm9udDsKKyAgICAgICAgICAg ICAgICAgICAgaWYgKCFmb250KQorICAgICAgICAgICAgICAgICAgICAgIGZvbnQgPSBGUkFNRV9G T05UIChzLT5mKTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCB3aXRoX2JnX3AgPSBmYWxzZTsK KyAgICAgICAgICAgICAgICAgICAgZm9udC0+ZHJpdmVyLT5kcmF3IChzLCBzLT5jbXBfZnJvbSwg cy0+bmNoYXJzLCBzLT54LCBzLT55YmFzZSwgd2l0aF9iZ19wKTsKKyAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgLy8gIGNsb2NrX3QgY2xvY2tf ZW5kID0gY2xvY2soKTsKKyAgLy8gIGRvdWJsZSBjcHVfdGltZV91c2VkID0gKChkb3VibGUpIChj bG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8vICBmcHJpbnRm IChzdGRlcnIsICJuc19kcmF3X292ZXJ3cml0dGVuICglZCk6ICBUSU1FICglZilcbiIsIHZwb3Ms IGNwdV90aW1lX3VzZWQpOworfQorCitzdGF0aWMgdm9pZAorbWNfbnNfZHJhd193aW5kb3dfY3Vy c29yIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVj dCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgICAgICAgIGludCB4LCBpbnQgZngsIGludCB5 LCBpbnQgZnksIGludCBocG9zLCBpbnQgdnBvcywgaW50IHdkLCBpbnQgaCwKKyAgICAgICAgICAg ICAgICAgIHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBl LAorICAgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCwgZW51bSBtY19mbGF2b3IgZ2x5 cGhfZmxhdm9yLCBib29sIG9uX3AsIGJvb2wgYWN0aXZlX3ApCit7CisgIC8qIFRoZSBwcmlvciBi dWcgb2YgYSBkb3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HN0ZGVyciwg IlxuZm9yZWdyb3VuZCAoJXMpIHwgYmFja2dyb3VuZCAoJXMpXG4iLAorICAgICAgICAgICAgICAg ICAgICAgICghTklMUCAoZm9yZWdyb3VuZCkgPyBTU0RBVEEgKGZvcmVncm91bmQpIDogIk5JTFAi KSwKKyAgICAgICAgICAgICAgICAgICAgICAoIU5JTFAgKGJhY2tncm91bmQpID8gU1NEQVRBIChi YWNrZ3JvdW5kKSA6ICJOSUxQIikpOworICAtICBFWEFNUExFIE9GIEhPVyBUTyBDUkVBVEUgQSBD T0xPUiBXSVRIIFJHQi9MU0wgZmxvYXQgdmFsdWVzOgorICAgICBOU0NvbG9yICpteV9jb2xvciA9 IFtOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IDEuMAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IDEuMAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsdWU6IDEuMAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF07 CisgIC0gIEFMVEVSTkFUSVZFIEVYQU1QTEU6CisgICAgIGVudW0gZmFjZV9pZCBkZWJ1Z2dpbmdf ZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBpbnRlcm4gKCIrLWRlYnVn Z2luZy1mYWNlIiksIHRydWUpOworICAgICBzdHJ1Y3QgZmFjZSAqZGVidWdnaW5nX2ZhY2UgPSBG QUNFX0ZST01fSUQgKHMtPmYsIGRlYnVnZ2luZ19mYWNlX2lkKTsKKyAgICAgTlNDb2xvciAqY29s b3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChkZWJ1Z2dp bmdfZmFjZSksIHMtPmYpOworICAgICBbY29sb3Igc2V0XTsgKi8KKyAgaWYgKGdseXBoX2ZsYXZv ciA9PSBNQ19HTFlQSAorICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBITEVTUykKKyAg ICBbW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogbHNsLnJlZAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGdyZWVuOiBsc2wuZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYmx1ZTogbHNsLmJsdWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBhbHBoYTogMS4wXSBzZXRdOworICAgIGVsc2UKKyAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1Ig KGYpIHNldF07CisgIGlmIChjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YKQorICAgIHsKKyAg ICAgIExpc3BfT2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRzOworICAgICAgQ0hFQ0tfQlVGRkVSIChi dWYpOworICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1Zik7CisgICAgICBib29s IHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5zaWVudF9tYXJrX21vZGUpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWFya19hY3RpdmUpKSk7 CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZyA9IChyZWdpb25fYWN0aXZlX3ApID8gbWNfcmVn aW9uX2xpbWl0ICgxKSA6IC0xOworICAgICAgcHRyZGlmZl90IHJlZ2lvbl9lbmQgPSAocmVnaW9u X2FjdGl2ZV9wKSA/IG1jX3JlZ2lvbl9saW1pdCAoMCkgOiAtMTsKKyAgICAgIGlmIChyZWdpb25f YWN0aXZlX3AKKyAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICYmIGN1cnNvcl9nbHlw aC0+Y2hhcnBvcyA9PSByZWdpb25fYmVn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2UgTUNfTEVGVF9GUklOR0VfQklU TUFQOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICAgICAg TlNSZWN0RmlsbCAocik7CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19GUkFNRURfQk9Y OgorICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgW2hvbGxvd19jb2xvciBzZXRdOwor ICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICBbRlJB TUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNf SE9MTE9XX0JPWDoKKyAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIFtob2xsb3dfY29s b3Igc2V0XTsKKyAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAg ICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAoZikgc2V0XTsKKyAgICAgICAgYnJlYWs7CisgICAg ICBjYXNlIE1DX0hCQVI6CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBicmVhazsK KyAgICAgIGNhc2UgTUNfQkFSOgorICAgICAgICBzID0gcjsKKyAgICAgICAgLyogQGxhd2xpc3Qg aXMgZm9jdXNpbmcgdGhlIGluaXRpYWwgZGV2ZWxvcG1lbnQgb2YgZmVhdHVyZSByZXF1ZXN0cwor ICAgICAgICAjMTc2ODQgYW5kICMyMjg3MyBvbiBMMlIgbGFuZ3VhZ2VzLiAqLworICAgICAgICBp ZiAoZ2x5cGhfZmxhdm9yICE9IE1DX0dMWVBICisgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3Ig IT0gTUNfR0xZUEhMRVNTKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIElmIHRoZSBjaGFy YWN0ZXIgdW5kZXIgY3Vyc29yIGlzIFIyTCwgZHJhdyB0aGUgYmFyIGN1cnNvcgorICAgICAgICAg ICAgICAgb24gdGhlIHJpZ2h0IG9mIGl0cyBnbHlwaCwgcmF0aGVyIHRoYW4gb24gdGhlIGxlZnQu ICovCisgICAgICAgICAgICBpZiAoKGN1cnNvcl9nbHlwaC0+cmVzb2x2ZWRfbGV2ZWwgJiAxKSAh PSAwKQorICAgICAgICAgICAgICBzLm9yaWdpbi54ICs9IGN1cnNvcl9nbHlwaC0+cGl4ZWxfd2lk dGggLSBzLnNpemUud2lkdGg7CisgICAgICAgICAgfQorICAgICAgICBOU1JlY3RGaWxsIChzKTsK KyAgICAgICAgYnJlYWs7CisgICAgfQorICBuc19yZXNldF9jbGlwcGluZyAoZik7CisgIC8qIGRy YXcgdGhlIGNoYXJhY3RlciB1bmRlciB0aGUgY3Vyc29yICovCisgIGlmIChnbHlwaF9mbGF2b3Ig IT0gTUNfR0xZUEhMRVNTCisgICAgICAmJiAoY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWAor ICAgICAgICAgIHx8IGN1cnNvcl90eXBlID09IE1DX0ZJTExFRF9CT1gKKyAgICAgICAgICB8fCBj dXJzb3JfdHlwZSA9PSBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgfHwgKGRlYnVnX3AKKyAgICAg ICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfSEJBUikKKyAgICAgICAgICB8fCAoZGVidWdf cAorICAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19CQVIpKSkKKyAgICB7CisgICAg ICAvKiBgY3Vyc29yX2djX3BgIGlzIHVzZWQgb25seSBieSBgdzMydGVybS5jYCBhbmQgYHh0ZXJt LmMnLiAqLworICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IGZhbHNlOworICAgICAgWFJlY3Rhbmds ZSAqc2F2ZWRfY2xpcCA9IE5VTEw7CisgICAgICBpZiAocm93LT5jbGlwICE9IE5VTEwpCisgICAg ICAgIHsKKyAgICAgIC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ZhY2UtPnVuZGVybGluZV9wKQor ICAgIHsKKyAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX1dB VkUpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9w KQorICAgICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChmYWNlLT51bmRlcmxpbmVfY29sb3Is IHMtPmYpIHNldF07CisgICAgICAgICAgbnNfZHJhd191bmRlcndhdmUgKHMsIHdpZHRoLCB4KTsK KyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBG QUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgeworICAgICAgICAgICAgTlNSZWN0IHI7CisgICAg ICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CisgICAgICAgICAgICAv KiBJZiB0aGUgcHJldiB3YXMgdW5kZXJsaW5lZCwgbWF0Y2ggaXRzIGFwcGVhcmFuY2UuICovCisg ICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfcAorICAg ICAgICAgICAgICAgICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5E RVJfTElORQorICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPnVuZGVybGluZV90aGlja25lc3Mg PiAwKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+cHJl di0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnBy ZXYtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgc3RydWN0IGZvbnQgKmZv bnQ7CisgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIGRlc2NlbnQ7CisgICAgICAgICAg ICAgICAgICBmb250PXMtPmZvbnQ7CisgICAgICAgICAgICAgICAgICBkZXNjZW50ID0gcy0+eSAr IHMtPmhlaWdodCAtIHMtPnliYXNlOworICAgICAgICAgICAgICAgICAgLyogVXNlIHVuZGVybGlu ZSB0aGlja25lc3Mgb2YgZm9udCwgZGVmYXVsdGluZyB0byAxLiAqLworICAgICAgICAgICAgICAg ICAgdGhpY2tuZXNzID0gKGZvbnQgJiYgZm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDApCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZvbnQtPnVuZGVybGluZV90aGlja25lc3MK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMTsKKyAgICAgICAgICAgICAgICAgIC8q IERldGVybWluZSB0aGUgb2Zmc2V0IG9mIHVuZGVybGluaW5nIGZyb20gdGhlIGJhc2VsaW5lLiAq LworICAgICAgICAgICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRfbGluZSkKKyAg ICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNjZW50IC0gdGhpY2tuZXNzOworICAgICAg ICAgICAgICAgICAgICBlbHNlIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGll cworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBmb250ICYmIGZvbnQtPnVuZGVybGlu ZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gZm9udC0+ dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGZvbnQp CisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGxyb3VuZCAoZm9udC0+ZGVzY2Vu dCAvIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAg ICAgICAgICBwb3NpdGlvbiA9IHVuZGVybGluZV9taW5pbXVtX29mZnNldDsKKyAgICAgICAgICAg ICAgICAgIHBvc2l0aW9uID0gbWF4IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0 KTsKKyAgICAgICAgICAgICAgICAgIC8qIEVuc3VyZSB1bmRlcmxpbmluZyBpcyBub3QgY3JvcHBl ZC4gKi8KKyAgICAgICAgICAgICAgICAgIGlmIChkZXNjZW50IDw9IHBvc2l0aW9uKQorICAgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNjZW50 IC0gMTsKKyAgICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGRlc2NlbnQgPCBwb3NpdGlv biArIHRoaWNrbmVzcykKKyAgICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHMtPnVuZGVybGluZV90aGlja25lc3MgPSB0aGlj a25lc3M7CisgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPSBwb3NpdGlvbjsKKyAg ICAgICAgICAgIHIgPSBOU01ha2VSZWN0ICh4LCBzLT55YmFzZSArIHBvc2l0aW9uLCB3aWR0aCwg dGhpY2tuZXNzKTsKKyAgICAgICAgICAgIGlmIChmYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3Ap CisgICAgICAgICAgICAgIFtkZWZhdWx0Q29sIHNldF07CisgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZhY2UtPnVuZGVybG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x5cGgtPmZh Y2VfaWQpOworICAgICAgYmdDb2wgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9C QUNLR1JPVU5EIChmYWNlKSwgcy0+Zik7CisgICAgICBmZ0NvbCA9IG5zX2xvb2t1cF9pbmRleGVk X2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICAgIGZvciAoaSA9 IDA7IGkgPCBuOyArK2kpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoIXMtPnJvdy0+ZnVsbF93 aWR0aF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpbnQgb3ZlcnJ1biwgbGVmdG92 ZXJydW47CisgICAgICAgICAgICAgIC8qIHRydW5jYXRlIHRvIGF2b2lkIG92ZXJ3cml0aW5nIGZy aW5nZSBhbmQvb3Igc2Nyb2xsYmFyICovCisgICAgICAgICAgICAgIG92ZXJydW4gPSBtYXggKDAs IChzLT54ICsgcy0+YmFja2dyb3VuZF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIC0gKFdJTkRPV19CT1hfUklHSFRfRURHRV9YIChzLT53KQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgLSBXSU5ET1dfUklHSFRfRlJJTkdFX1dJRFRIIChzLT53KSkpOworICAg ICAgICAgICAgICAgICAgICByW2ldLnNpemUud2lkdGggLT0gb3ZlcnJ1bjsKKyAgICAgICAgICAg ICAgLyogdHJ1bmNhdGUgdG8gYXZvaWQgb3ZlcndyaXRpbmcgdG8gbGVmdCBvZiB0aGUgd2luZG93 IGJveCAqLworICAgICAgICAgICAgICBsZWZ0b3ZlcnJ1biA9IChXSU5ET1dfQk9YX0xFRlRfRURH RV9YIChzLT53KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIFdJTkRPV19MRUZUX0ZS SU5HRV9XSURUSCAocy0+dykpIC0gcy0+eDsKKyAgICAgICAgICAgICAgaWYgKGxlZnRvdmVycnVu ID4gMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICByW2ldLm9yaWdpbi54 ICs9IGxlZnRvdmVycnVuOworICAgICAgICAgICAgICAgICAgcltpXS5zaXplLndpZHRoIC09IGxl ZnRvdmVycnVuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyogWFhYOiBUcnkg dG8gd29yayBiZXR3ZWVuIHByb2JsZW0gd2hlcmUgYSBzdHJldGNoIGdseXBoIG9uCisgICAgICAg ICAgICAgICAgIGEgcGFydGlhbGx5LXZpc2libGUgYm90dG9tIHJvdyB3aWxsIGNsZWFyIHBhcnQg b2YgdGhlCisgICAgICAgICAgICAgICAgIG1vZGVsaW5lLCBhbmQgYW5vdGhlciB3aGVyZSBsaXN0 LWJ1ZmZlcnMgaGVhZGVycyBhbmQgc2ltaWxhcgorICAgICAgICAgICAgICAgICByb3dzIGVycm9u ZW91c2x5IGhhdmUgdmlzaWJsZV9oZWlnaHQgc2V0IHRvIDAuICBOb3Qgc3VyZQorICAgICAgICAg ICAgICAgICB3aGVyZSB0aGlzIGlzIGNvbWluZyBmcm9tIGFzIG90aGVyIHRlcm1zIHNlZW0gbm90 IHRvIHNob3cuICovCisgICAgICAgICAgICAgIHJbaV0uc2l6ZS5oZWlnaHQgPSBtaW4gKHMtPmhl aWdodCwgcy0+cm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgICAgICB9CisgICAgICAgICAg W2JnQ29sIHNldF07CisgICAgICAgICAgLyogTk9URTogdW5kZXIgTlMgdGhpcyBpcyBOT1QgdXNl ZCB0byBkcmF3IGN1cnNvcnMsIGJ1dCB3ZSBtdXN0IGF2b2lkCisgICAgICAgICAgICAgb3Zlcndy aXRpbmcgY3Vyc29yICh1c3VhbGx5IHdoZW4gY3Vyc29yIG9uIGEgdGFiKSAqLworICAgICAgICAg IGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgIC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ICAgTlNSZWN0RmlsbCAocltpXSk7CisgICAg ICAgICAgICAgIC8qIERyYXcgb3ZlcmxpbmluZywgZXRjLiBvbiB0aGUgY3Vyc29yLiAqLworICAg ICAgICAgICAgICBpZiAocy0+dy0+cGh5c19jdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YKQor ICAgICAgICAgICAgICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCBiZ0Nv bCwgd2lkdGgsIHgpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIG1j X25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCBmZ0NvbCwgd2lkdGgsIHgpOworICAg ICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgLy8gIGludCByeCA9 IHJbaV0ub3JpZ2luLng7CisgIC8vICBpbnQgcnkgPSByW2ldLm9yaWdpbi55OworICAvLyAgaW50 IHJ3ID0gcltpXS5zaXplLndpZHRoOworICAvLyAgaW50IHJoID0gcltpXS5zaXplLmhlaWdodDsK KyAgLy8gIGZwcmludGYgKHN0ZGVyciwgIm1jX25zX2R1bXBnbHlwaHNfc3RyZXRjaDogIHZwb3Mg KCVkKSB8IHJ4ICglZCkgfCByeSAoJWQpIHwgcncgKCVkKSB8IHJoICglZClcbiIsCisgIC8vICAg ICAgICAgICAgICAgICAgIHMtPmZpcnN0X2dseXBoLT52cG9zLCByeCwgcnksIHJ3LCByaCk7Cisg ICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHJbaV0pOworICAgICAgICAgICAgfQorICAgICAgICAg IC8qIERyYXcgb3ZlcmxpbmluZywgZXRjLiBvbiB0aGUgc3RyZXRjaCBnbHlwaCAob3IgdGhlIHBh cnQKKyAgICAgICAgICAgICBvZiB0aGUgc3RyZXRjaCBnbHlwaCBhZnRlciB0aGUgY3Vyc29yKS4g Ki8KKyAgICAgICAgICBtY19uc19kcmF3X3R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TWFrZVJlY3QgKHgsIHksIHMtPnNsaWNlLndpZHRo LCBzLT5zbGljZS5oZWlnaHQpOworICBOU1JlY3RGaWxsIChicik7CisgIC8qIERyYXcgdGhlIGlt YWdlLi4gZG8gd2UgbmVlZCB0byBkcmF3IHBsYWNlaG9sZGVyIGlmIGltZyA9PW5pbD8gKi8KKyAg aWYgKGltZyAhPSBuaWwpCisgICAgeworI2lmZGVmIE5TX0lNUExfQ09DT0EKKyAgICAgIE5TUmVj dCBkciA9IE5TTWFrZVJlY3QgKHgsIHksIHMtPnNsaWNlLndpZHRoLCBzLT5zbGljZS5oZWlnaHQp OworICAgICAgTlNSZWN0IGlyID0gTlNNYWtlUmVjdCAocy0+c2xpY2UueCwgcy0+c2xpY2UueSwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLndpZHRoLCBzLT5zbGljZS5o ZWlnaHQpOworICAgICAgW2ltZyBkcmF3SW5SZWN0OiBkcgorICAgICAgICAgICAgIGZyb21SZWN0 OiBpcgorICAgICAgICAgICAgIG9wZXJhdGlvbjogTlNDb21wb3NpdGVTb3VyY2VPdmVyCisgICAg ICAgICAgICAgIGZyYWN0aW9uOiAxLjAKKyAgICAgICAgICAgcmVzcGVjdEZsaXBwZWQ6IFlFUwor ICAgICAgICAgICAgICAgIGhpbnRzOiBuaWxdOworI2Vsc2UKKyAgICAgIFtpbWcgY29tcG9zaXRl VG9Qb2ludDogTlNNYWtlUG9pbnQgKHgsIHkgKyBzLT5zbGljZS5oZWlnaHQpCisgICAgICAgICAg ICAgICAgICBvcGVyYXRpb246IE5TQ29tcG9zaXRlU291cmNlT3Zlcl07CisjZW5kaWYKKyAgICB9 CisgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikKKyAgICB7CisgICAgICBbRlJBTUVfQ1VSU09S X0NPTE9SIChzLT5mKSBzZXRdOworICAgICAgaWYgKHMtPnctPnBoeXNfY3Vyc29yX3R5cGUgPT0g TUNfRklMTEVEX0JPWCkK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FX1NVTktFTiB8fCBzLT5o bCA9PSBEUkFXX0lNQUdFX1JBSVNFRCkKKyAgICAgICAgeworICAgICAgICAgIHRoID0gdG9vbF9i YXJfYnV0dG9uX3JlbGllZiA+PSAwID8KKyAgICAgICAgICAgIHRvb2xfYmFyX2J1dHRvbl9yZWxp ZWYgOiBERUZBVUxUX1RPT0xfQkFSX0JVVFRPTl9SRUxJRUY7CisgICAgICAgICAgcmFpc2VkX3Ag PSAocy0+aGwgPT0gRFJBV19JTUFHRV9SQUlTRUQpOworICAgICAgICB9CisgICAgICAgIGVsc2UK KyAgICAgICAgICB7CisgICAgICAgICAgICB0aCA9IGFicyAocy0+aW1nLT5yZWxpZWYpOworICAg ICAgICAgICAgcmFpc2VkX3AgPSAocy0+aW1nLT5yZWxpZWYgPiAwKTsKKyAgICAgICAgICB9Cisg ICAgICByLm9yaWdpbi54ID0geCAtIHRoOworICAgICAgci5vcmlnaW4ueSA9IHkgLSB0aDsKKyAg ICAgIHIuc2l6ZS53aWR0aCA9IHMtPnNsaWNlLndpZHRoICsgMip0aC0xOworICAgICAgci5zaXpl LmhlaWdodCA9IHMtPnNsaWNlLmhlaWdodCArIDIqdGgtMTsKKyAgICAgIG5zX2RyYXdfcmVsaWVm IChyLCB0aCwgcmFpc2VkX3AsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueSA9PSAw LAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnkgKyBzLT5zbGljZS5oZWlnaHQgPT0g cy0+aW1nLT5oZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueCA9PSAwLAor ICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnggKyBzLT5zbGljZS53aWR0aCA9PSBzLT5p bWctPndpZHRoLCBzKTsKKyAgICB9CisgIC8qIElmIHRoZXJlIGlzIG5vIG1hc2ssIHRoZSBiYWNr Z3JvdW5kIHdvbid0IGJlIHNlZW4sCisgICAgIHNvIGRyYXcgYSByZWN0YW5nbGUgb24gdGhlIGlt YWdlIGZvciB0aGUgY3Vyc29yLgorICAgICBEbyB0aGlzIGZvciBhbGwgaW1hZ2VzLCBnZXR0aW5n IHRyYW5zcGFyZW5jeSByaWdodCBpcyBub3QgcmVsaWFibGUuICovCisgIGlmIChzLT5obCA9PSBE UkFXX0NVUlNPUikKKyAgICB7CisgICAgICBpbnQgdGhpY2tuZXNzID0gYWJzIChzLT5pbWctPnJl bGllZik7CisgICAgICBpZiAodGhpY2tuZXNzID09IDApIHRoaWNrbmVzcyA9IDE7CisgICAgaWYg KGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNf R0xZUEhMRVNTKQorICAgICAgeworICAgICAgICBOU0NvbG9yICpib3JkZXJfY29sb3IgPSBbTlND b2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2wucmVkCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IGxzbC5ncmVlbgor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBibHVlOiBsc2wuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdOworICAgICAgICBuc19kcmF3X2JveCAoYnIs IHRoaWNrbmVzcywgYm9yZGVyX2NvbG9yLCAxLCAxKTsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAg ICAgICAgbnNfZHJhd19ib3ggKGJyLCB0aGlja25lc3MsIEZSQU1FX0NVUlNPUl9DT0xPUiAocy0+ ZiksIDEsIDEpOworICAgIH0KK30KKworc3RhdGljIHZvaWQKK21jX25zX21heWJlX2R1bXBnbHlw aHNfYmFja2dyb3VuZCAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgY2hhciBmb3JjZV9wKQorewor ICBOU1RSQUNFICgibWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIik7CisgIGlmICgh cy0+YmFja2dyb3VuZF9maWxsZWRfcC8qIHx8IHMtPmhsID09IERSQVdfTU9VU0VfRkFDRSovKQor ICAgIHsKKyAgICAgIGludCBib3hfbGluZV93aWR0aCA9IG1heCAocy0+ZmFjZS0+Ym94X2xpbmVf d2lkdGgsIDApOworICAgICAgaWYgKEZPTlRfSEVJR0hUIChzLT5mb250KSA8IHMtPmhlaWdodCAt IDIgKiBib3hfbGluZV93aWR0aAorICAgICAgICAgIC8qIFdoZW4geGRpc3AuYyBpZ25vcmVzIEZP TlRfSEVJR0hULCB3ZSBjYW5ub3QgdHJ1c3QgZm9udAorICAgICAgICAgICAgIGRpbWVuc2lvbnMs IHNpbmNlIHRoZSBhY3R1YWwgZ2x5cGhzIG1pZ2h0IGJlIG11Y2gKKyAgICAgICAgICAgICBzbWFs bGVyLiAgU28gaW4gdGhhdCBjYXNlIHdlIGFsd2F5cyBjbGVhciB0aGUgcmVjdGFuZ2xlCisgICAg ICAgICAgICAgd2l0aCBiYWNrZ3JvdW5kIGNvbG9yLiAqLworICAgICAgICAgIHx8IEZPTlRfVE9P X0hJR0ggKHMtPmZvbnQpCisgICAgICAgICAgfHwgcy0+Zm9udF9ub3RfZm91bmRfcCB8fCBzLT5l eHRlbmRzX3RvX2VuZF9vZl9saW5lX3AgfHwgZm9yY2VfcCkKKyAgICAgICAgeworICAgICAgICAg IHN0cnVjdCBmYWNlICpmYWNlOworICAgICAgICAgIGlmIChzLT5obCA9PSBEUkFXX01PVVNFX0ZB Q0UpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMt PmYsIE1PVVNFX0hMX0lORk8gKHMtPmYpLT5tb3VzZV9mYWNlX2ZhY2VfaWQpOworICAgICAgICAg ICAgICBpZiAoIWZhY2UpCisgICAgICAgICAgICAgICAgZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ ZiwgTU9VU0VfRkFDRV9JRCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIHMtPmZpcnN0X2dseXBoLT5mYWNl X2lkKTsKKyAgICAgICAgICBpZiAoIWZhY2UtPnN0aXBwbGUpCisgICAgICAgICAgICBbKE5TX0ZB Q0VfQkFDS0dST1VORCAoZmFjZSkgIT0gMAorICAgICAgICAgICAgICA/IG5zX2xvb2t1cF9pbmRl eGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKQorICAgICAgICAgICAg ICA6IEZSQU1FX0JBQ0tHUk9VTkRfQ09MT1IgKHMtPmYpKSBzZXRdOworICAgICAgICAgICAgZWxz ZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RydWN0IG5zX2Rpc3BsYXlfaW5m byAqZHB5aW5mbyA9IEZSQU1FX0RJU1BMQVlfSU5GTyAocy0+Zik7CisgICAgICAgICAgICAgICAg W1tkcHlpbmZvLT5iaXRtYXBzW2ZhY2UtPnN0aXBwbGUtMV0uaW1nIHN0aXBwbGVNYXNrXSBzZXRd OworICAgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKHMtPmhsICE9IERSQVdfQ1VSU09SKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBzLT5yZWN0YW5nbGVfbnVrZWRfcCA9IHRydWU7 CisgICAgICAgICAgICAgIE5TUmVjdCByID0gTlNNYWtlUmVjdCAocy0+eCwgcy0+eSArIGJveF9s aW5lX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+YmFja2dy b3VuZF93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPmhlaWdo dC0yKmJveF9saW5lX3dpZHRoKTsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7Cis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oYW5nICYmICFzLT5mb3Jfb3ZlcmxhcHMpCisg ICAgeworICAgICAgaW50IHdpZHRoOworICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqbmV4dDsK KyAgICAgIGZvciAod2lkdGggPSAwLCBuZXh0ID0gcy0+bmV4dDsKKyAgICAgICAgICAgbmV4dCAm JiB3aWR0aCA8IHMtPnJpZ2h0X292ZXJoYW5nOworICAgICAgICAgICB3aWR0aCArPSBuZXh0LT53 aWR0aCwgbmV4dCA9IG5leHQtPm5leHQpCisgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+ dHlwZSAhPSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpZiAobmV4dC0+ Zmlyc3RfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkKKyAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocy0+bmV4dCwg cik7CisgICAgICAgICAgICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQor ICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIG1jX25zX21heWJlX2R1 bXBnbHlwaHNfYmFja2dyb3VuZCAocy0+bmV4dCwgMSk7CisgICAgICAgICAgICAgICAgbnNfcmVz ZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICBtY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2ggKHMtPm5leHQsIG1hdHJp eCwgcm93LCB3ZCk7CisgICAgICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAgICAg IH0KKyAgICB9CisgIGlmICghcy0+Zm9yX292ZXJsYXBzICYmIHMtPmZhY2UtPmJveCAhPSBGQUNF X05PX0JPWAorICAgICAgJiYgKHMtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAg ICAgICAgICB8fCBzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpKQorICAg IHsKKyAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7CisgICAg ICBpZiAoIW5zX2NsaXBfdG9fcmVjdCAocy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsKKyAg ICAgIG1jX25zX21heWJlX2R1bXBnbHlwaHNfYmFja2dyb3VuZCAocywgMSk7CisgICAgICBuc19k dW1wZ2x5cGhzX2JveF9vcl9yZWxpZWYgKHMpOworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMt PmYpOworICAgICAgYm94X2RyYXduX3AgPSAxOworICAgIH0KKyAgc3dpdGNoIChzLT5maXJzdF9n bHlwaC0+dHlwZSkKKyAgICB7CisgICAgY2FzZSBJTUFHRV9HTFlQSDoKKyAgICAgIG4gPSBuc19n ZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW5zX2NsaXBfdG9f cmVjdCAocy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIG1jX25zX2R1bXBnbHlw aHNfaW1hZ2UgKHMsIHJbMF0sIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgYWN0aXZl X3ApOworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgYnJlYWs7CisgICAg Y2FzZSBTVFJFVENIX0dMWVBIOgorICAgICAgbWNfbnNfZHVtcGdseXBoc19zdHJldGNoIChzLCBt YXRyaXgsIHJvdywgd2QpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBDSEFSX0dMWVBIOgorICAg IGNhc2UgQ09NUE9TSVRFX0dMWVBIOgorICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xp cF9yZWN0IChzLCByKTsKKyAgICAgIGlmICghbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuKSkK KyAgICAgICAgcmV0dXJuOworICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcworICAgICAgICAgIHx8 IChzLT5jbXBfZnJvbSA+IDAKKyAgICAgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5j bXAuYXV0b21hdGljKSkKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAg ICAgIGVsc2UKKyAgICAgICAgICBtY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQgKHMs IHMtPmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCk7CisgICAgICBpbnQgZmxh Z3MgPSAocy0+aGwgPT0gRFJBV19DVVJTT1IpCisgICAgICAgICAgICAgICAgICAgID8gTlNfRFVN UEdMWVBIX0NVUlNPUgorICAgICAgICAgICAgICAgICAgOiAocy0+aGwgPT0gRFJBV19NT1VTRV9G QUNFKQorICAgICAgICAgICAgICAgICAgICA/IE5TX0RVTVBHTFlQSF9NT1VTRUZBQ0UKKyAgICAg ICAgICAgICAgICAgIDogKHMtPmZvcl9vdmVybGFwcykKKyAgICAgICAgICAgICAgICAgICAgPyBO U19EVU1QR0xZUEhfRk9SRUdST1VORAorICAgICAgICAgICAgICAgICAgOiBOU19EVU1QR0xZUEhf Tk9STUFMOworICAgICAgdW5zaWduZWQgbG9uZyBzYXZlZF9mZyA9IE5TX0ZBQ0VfRk9SRUdST1VO RCAocy0+ZmFjZSk7CisgICAgICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IgJiYgY3Vyc29yX3R5 cGUgPT0gTUNfRklMTEVEX0JPWCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcg dG1wID0gTlNfRkFDRV9CQUNLR1JPVU5EIChzLT5mYWNlKTsKKyAgICAgICAgICBOU19GQUNFX0JB Q0tHUk9VTkQgKHMtPmZhY2UpID0gTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKTsKKyAgICAg ICAgICBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpID0gdG1wOworICAgICAgICB9CisgICAg ICAgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAgICAgICAgICAgICYmIGN1 cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gKKyAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3Ap CisgICAgICAgICAgeworICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfZmFj ZV9pZCA9CisgICAgICAgICAgICAgIGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBpbnRl cm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAg ICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBo b2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgTlNfRkFDRV9GT1JFR1JPVU5EIChz LT5mYWNlKSA9IE5TX0ZBQ0VfRk9SRUdST1VORCAoaG9sbG93X2FjdGl2ZV9mYWNlKTsKKyAgICAg ICAgICB9CisgICAgICAgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IKKyAgICAgICAg ICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YCisgICAgICAgICAgICAg ICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGVudW0gZmFj ZV9pZCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCA9CisgICAgICAgICAgICAgICAgbG9va3VwX25h bWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2 ZS1wcm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AgICAgICAgICAgICAgICAg OiBGUkFNRV9GT1JFR1JPVU5EX0NPTE9SIChzLT5mKSk7CisgICAgICBbY29sIHNldF07CisgICAg ICAvKiBEcmF3IHVuZGVybGluZSwgb3ZlcmxpbmUsIHN0cmlrZS10aHJvdWdoLiAqLworICAgICAg bWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHMsIHMtPmZhY2UsIGNvbCwgcy0+d2lkdGgsIHMt PngpOworICAgICAgaWYgKHMtPmZpcnN0X2dseXBoLT50eXBlICE9IENPTVBPU0lURV9HTFlQSAor ICAgICAgICAgICYmIChzLT5sZWZ0X292ZXJ3cml0dGVuX3AgfHwgcy0+cmlnaHRfb3ZlcndyaXR0 ZW5fcCkKKyAgICAgICAgICAmJiAocy0+YmFja2dyb3VuZF9udWtlZF9wIHx8IHMtPnJlY3Rhbmds ZV9udWtlZF9wKQorICAgICAgICAgICYmIChzLT5hY3Rpb25fdHlwZSA9PSBNQ19EUkFXX0dMWVBI X1NUUklOR3x8IHMtPmFjdGlvbl90eXBlID09IE1DX0VSQVNFX0dMWVBIX1NUUklORykpCisgICAg ICAgIG1jX25zX2RyYXdfb3ZlcndyaXR0ZW4gKHMsIG1hdHJpeCwgcm93LCBzLT5maXJzdF9nbHlw aCk7CisgICAgICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IKKyAgICAgICAgICAmJiBjdXJzb3Jf dHlwZSA9PSBNQ19GSUxMRURfQk9YKQorICAgICAgICB7CisgICAgICAgICAgdW5zaWduZWQgbG9u ZyB0bXAgPSBOU19GQUNFX0JBQ0tHUk9VTkQgKHMtPmZhY2UpOworICAgICAgICAgIE5TX0ZBQ0Vf QkFDS0dST1VORCAocy0+ZmFjZSkgPSBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpOworICAg ICAgICAgIE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgPSB0bXA7CisgICAgICAgIH0KKyAg ICAgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IKKyAgICAgICAgICAgICAgICAgJiYg Y3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICAgICAgICBOU19GQUNFX0ZPUkVHUk9V TkQgKHMtPmZhY2UpID0gc2F2ZWRfZmc7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7 CisgICAgICBicmVhazsKKyAgICBjYXNlIEdMWVBITEVTU19HTFlQSDoKKyAgICAgIG4gPSBuc19n ZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW5zX2NsaXBfdG9f cmVjdCAocy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIGlmIChzLT5mb3Jfb3Zl cmxhcHMKKyAgICAgICAgICB8fCAocy0+Y21wX2Zyb20gPiAwCisgICAgICAgICAgICAgICYmICEg cy0+Zmlyc3RfZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykpCisgICAgICAgIHMtPmJhY2tncm91bmRf ZmlsbGVkX3AgPSAxOworICAgICAgZWxzZQorICAgICAgICBtY19uc19tYXliZV9kdW1wZ2x5cGhz X2JhY2tncm91bmQgKHMsIHMtPmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCk7 CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBicmVhazsKKyAgICBkZWZh dWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgICAgfQorICAvKiBEcmF3IGJveCBpZiBub3Qg ZG9uZSBhbHJlYWR5LiAqLworICBpZiAoIXMtPmZvcl9vdmVybGFwcworICAgICAgJiYgIWJveF9k cmF3bl9wCisgICAgICAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisgICAgeworICAg ICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICgh bnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAgcmV0dXJuOworICAgICAgbnNf ZHVtcGdseXBoc19ib3hfb3JfcmVsaWVmIChzKTsKKyAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChz LT5mKTsKKyAgICB9CisgIHMtPm51bV9jbGlwcyA9IDA7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1D VVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiA9PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PQogCiAgICBOU1RSQUNFLCBUcmFjZSBzdXBwb3J0LgpAQCAtMTEwOSw2ICsyMDgyLDE2IEBA IHN0YXRpYyBOU1JlY3QgY29uc3RyYWluX2ZyYW1lX3JlY3QoTlNSZWN0IGZyYW1lUmVjdCwgYm9v bCBpc0Z1bGxzY3JlZW4pCiAgICBleHRlcm5hbCAoUklGKSBjYWxsOyB3aG9sZSBmcmFtZSwgY2Fs bGVkIGJlZm9yZSB1cGRhdGVfd2luZG93X2JlZ2luCiAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLwog eworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gZjsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogI2lmZGVmIE5TX0lNUExfQ09DT0EKICAgRW1hY3NWaWV3ICp2aWV3ID0gRlJBTUVfTlNf VklFVyAoZik7CiAKQEAgLTEyMDksNiArMjE5MiwxNiBAQCBzdGF0aWMgTlNSZWN0IGNvbnN0cmFp bl9mcmFtZV9yZWN0KE5TUmVjdCBmcmFtZVJlY3QsIGJvb2wgaXNGdWxsc2NyZWVuKQogCiAvKiAg IGlmIChmID09IE1PVVNFX0hMX0lORk8gKGYpLT5tb3VzZV9mYWNlX21vdXNlX2ZyYW1lKSAqLwog ICBNT1VTRV9ITF9JTkZPIChmKS0+bW91c2VfZmFjZV9kZWZlciA9IDA7CisKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRp bmdfZnJhbWUgPSBOVUxMOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIApA QCAtNDgwMyw2ICs1Nzk2LDE3IEBAIGluIGNlcnRhaW4gc2l0dWF0aW9ucyAocmFwaWQgaW5jb21p bmcgZXZlbnRzKS4KICAgICAgIGJhciA9IFtbRW1hY3NTY3JvbGxlciBhbGxvY10gaW5pdEZyYW1l OiByIHdpbmRvdzogd2luXTsKICAgICAgIHdzZXRfdmVydGljYWxfc2Nyb2xsX2JhciAod2luZG93 LCBtYWtlX21pbnRfcHRyIChiYXIpKTsKICAgICAgIHVwZGF0ZV9wID0gWUVTOworCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICAvKiBU aGlzIGlzIG9ubHkgZm9yIGRlYnVnZ2luZyBwdXJwb3Nlcy4gKi8KKyAgICAgIFtiYXIgbWNfc2V0 X3JlY3RhbmdsZTogcl07CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB9CiAg IGVsc2UKICAgICB7CkBAIC00ODEwLDEyICs1ODE0LDMwIEBAIGluIGNlcnRhaW4gc2l0dWF0aW9u cyAocmFwaWQgaW5jb21pbmcgZXZlbnRzKS4KICAgICAgIGJhciA9IFhOU19TQ1JPTExfQkFSICh3 aW5kb3ctPnZlcnRpY2FsX3Njcm9sbF9iYXIpOwogICAgICAgb2xkUmVjdCA9IFtiYXIgZnJhbWVd OwogICAgICAgci5zaXplLndpZHRoID0gb2xkUmVjdC5zaXplLndpZHRoOworCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAgICAgICBpZiAoRlJB TUVfTElWRV9QIChmKSAmJiAhTlNFcXVhbFJlY3RzIChvbGRSZWN0LCByKSkKICAgICAgICAgewor ICAgICAgICAgIC8qIFRoZSBtYWluIHdpbmRvdyBoYXMgcHJvYmFibHkgYmVlbiByZXNpemVkLiAg R3JhY2lvdXNseSBkZWxldGUgdGhlCisgICAgICAgICAgb2xkIHNjcm9sbCBiYXIgd2l0aG91dCBy ZXBhaW50aW5nIGl0cyByZWN0YW5nbGU7IGFuZCwgY3JlYXRlIGEgbmV3CisgICAgICAgICAgc2Ny b2xsIGJhciBlbHNld2hlcmUuKi8KICAgICAgICAgICBpZiAob2xkUmVjdC5vcmlnaW4ueCAhPSBy Lm9yaWdpbi54KQorICAgICAgICAgICAgewogICAgICAgICAgICAgICBuc19jbGVhcl9mcmFtZV9h cmVhIChmLCBsZWZ0LCB0b3AsIHdpZHRoLCBoZWlnaHQpOworICAgICAgICAgICAgICBbYmFyIG1j X2p1ZGdlXTsKKyAgICAgICAgICAgICAgYmFyID0gW1tFbWFjc1Njcm9sbGVyIGFsbG9jXSBpbml0 RnJhbWU6IHIgd2luZG93OiB3aW5dOworICAgICAgICAgICAgICB3c2V0X3ZlcnRpY2FsX3Njcm9s bF9iYXIgKHdpbmRvdywgbWFrZV9taW50X3B0ciAoYmFyKSk7CisgICAgICAgICAgICB9CisgICAg ICAgICAgICBlbHNlCiAgICAgICAgICAgW2JhciBzZXRGcmFtZTogcl07CiAgICAgICAgIH0KKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgIH0KIAogICBpZiAodXBkYXRlX3ApCkBA IC00OTc1LDkgKzU5OTcsNTcgQEAgaW4gY2VydGFpbiBzaXR1YXRpb25zIChyYXBpZCBpbmNvbWlu ZyBldmVudHMpLgogICAgIHsKICAgICAgIHZpZXcgPSBbc3Vidmlld3Mgb2JqZWN0QXRJbmRleDog aV07CiAgICAgICBpZiAoIVt2aWV3IGlzS2luZE9mQ2xhc3M6IFtFbWFjc1Njcm9sbGVyIGNsYXNz XV0pIGNvbnRpbnVlOwotICAgICAgaWYgKFt2aWV3IGp1ZGdlXSkKKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAvKiBgWFNFVFdJTkRPVycg d2lsbCBzb21ldGltZXMgY2F1c2UgRW1hY3MgdG8gY3Jhc2ggd2hlbiBydW5uaW5nIHVuZGVyIGdk YiBldmVuCisgIHRob3VnaCAodyAhPSBOVUxMKS4gIFRoZXJlZm9yZSwgd2UgY2Fubm90IHJlbGlh Ymx5IHVzZSBgV0lORE9XX0xJVkVfUCcuICovCisgIHN0cnVjdCB3aW5kb3cgKncgPSBbdmlldyBt Y19nZXRfd2luZG93XTsKKyAgaWYgKHcgIT0gTlVMTAorICAgICAgJiYgTklMUCAody0+Y29udGVu dHMpKQorICAgIHsKKyAgICAgIEJPT0wgZGVidWdfcCA9IGZhbHNlOworICAgICAgaWYgKGRlYnVn X3AKKyAgICAgICAgICAvKiBgd2luZG93X2JveCcgY2FsbHMgYHdpbmRvd19ib3hfaGVpZ2h0Jywg d2hpY2ggd2lsbCBjYXVzZSBFbWFjcyB0bworICAgICAgICAgIGNyYXNoIGlmIEZSQU1FUCAody0+ ZnJhbWUpIGlzIG5vdCBzYXRpc2ZpZWQuICovCisgICAgICAgICAgJiYgRlJBTUVQICh3LT5mcmFt ZSkpCisgICAgICAgIHsKKyAgICAgICAgICBOU1JlY3QgcjAgPSBbdmlldyBtY19nZXRfcmVjdGFu Z2xlXTsKKyAgICAgICAgICBpbnQgeDAgPSBOU01pblggKHIwKTsKKyAgICAgICAgICBpbnQgeTAg PSBOU01pblkgKHIwKTsKKyAgICAgICAgICBpbnQgd2QwID0gTlNXaWR0aCAocjApOworICAgICAg ICAgIGludCBoMCA9IE5TSGVpZ2h0IChyMCk7CisgICAgICAgICAgaW50IHdpbmRvd195LCB3aW5k b3dfaGVpZ2h0OworICAgICAgICAgIHdpbmRvd19ib3ggKHcsIEFOWV9BUkVBLCAwLCAmd2luZG93 X3ksIDAsICZ3aW5kb3dfaGVpZ2h0KTsKKyAgICAgICAgICBpbnQgdG9wID0gd2luZG93X3k7Cisg ICAgICAgICAgaW50IGhlaWdodCA9IHdpbmRvd19oZWlnaHQ7CisgICAgICAgICAgaW50IHdpZHRo ID0gV0lORE9XX0NPTkZJR19TQ1JPTExfQkFSX0NPTFMgKHcpICogRlJBTUVfQ09MVU1OX1dJRFRI IChmKTsKKyAgICAgICAgICBpbnQgbGVmdCA9IFdJTkRPV19TQ1JPTExfQkFSX0FSRUFfWCAodyk7 CisgICAgICAgICAgTlNSZWN0IHIxID0gTlNNYWtlUmVjdCAobGVmdCwgdG9wLCB3aWR0aCwgaGVp Z2h0KTsKKyAgICAgICAgICAvKiBUaGUgcGFyZW50IHZpZXcgaXMgZmxpcHBlZCwgc28gd2UgbmVl ZCB0byBmbGlwIHkgdmFsdWUuICovCisgICAgICAgICAgRW1hY3NWaWV3ICpmcmFtZV92aWV3ID0g RlJBTUVfTlNfVklFVyAoZik7CisgICAgICAgICAgTlNSZWN0IHYgPSBbZnJhbWVfdmlldyBmcmFt ZV07CisgICAgICAgICAgcjEub3JpZ2luLnkgPSAodi5zaXplLmhlaWdodCAtIHIxLnNpemUuaGVp Z2h0IC0gcjEub3JpZ2luLnkpOworICAgICAgICAgIGludCB4MSA9IE5TTWluWCAocjEpOworICAg ICAgICAgIGludCB5MSA9IE5TTWluWSAocjEpOworICAgICAgICAgIGludCB3ZDEgPSBOU1dpZHRo IChyMSk7CisgICAgICAgICAgaW50IGgxID0gTlNIZWlnaHQgKHIxKTsKKyAgICAgICAgICBmcHJp bnRmIChzdGRlcnIsICIlcyAtLSBERUFEOlxuXAorICAgICAgICAgIHgwL3gxICglZC8lZCkgfCB5 MC95MSAoJWQvJWQpIHwgd2QwL3dkMSAoJWQvJWQpIHwgaDAvaDEgKCVkLyVkKVxuIiwKKyAgICAg ICAgICBtY193aW5kb3cgKHcpLCB4MCwgeDEsIHkwLCB5MSwgd2QwLCB3ZDEsIGgwLCBoMSk7Cisg ICAgICAgIH0KKyAgICAgIGlmIChbdmlldyBtY19qdWRnZV0pCiAgICAgICAgIHJlbW92ZWQgPSBZ RVM7CiAgICAgfQorICAgIGVsc2UgaWYgKFt2aWV3IGp1ZGdlXSkKKyAgICAgIHJlbW92ZWQgPSBZ RVM7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKKyAgICB9CiAKICAgaWYgKHJlbW92 ZWQpCiAgICAgW2V2aWV3IHVwZGF0ZUZyYW1lU2l6ZTogTk9dOwpAQCAtNTEwNiw2ICs2MTc2LDIw IEBAIHN0YXRpYyBMaXNwX09iamVjdCBuc19zdHJpbmdfdG9fbGlzcG1vZCAoY29uc3QgY2hhciAq cykKIGV4dGVybiBmcmFtZV9wYXJtX2hhbmRsZXIgbnNfZnJhbWVfcGFybV9oYW5kbGVyc1tdOwog c3RhdGljIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlIG5zX3JlZGlzcGxheV9pbnRlcmZhY2Ug PQogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAq LworCisvKiBgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYG5zdGVybS5tYCBtdXN0IGJlIGluIHRo ZSBleGFjdCBzYW1lIG9yZGVyIGFzIHRoZQorYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBkaXNw ZXh0ZXJuLmhgISAqLworCisgIG1jX25zX2RyYXdfd2luZG93X2N1cnNvciwKKyAgbWNfbnNfZHJh d19nbHlwaF9zdHJpbmcsCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgbnNfZnJh bWVfcGFybV9oYW5kbGVycywKICAgeF9wcm9kdWNlX2dseXBocywKICAgeF93cml0ZV9nbHlwaHMs CkBAIC04NzIxLDYgKzk4MDUsNDkgQEAgLSAoQk9PTCljYW5CZWNvbWVNYWluV2luZG93CiAKIEBp bXBsZW1lbnRhdGlvbiBFbWFjc1Njcm9sbGVyCiAKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTogKE5T UmVjdClyZWN0Cit7CisgIG1jX3JlY3RhbmdsZSA9IHJlY3Q7Cit9CisKKy0gKE5TUmVjdCltY19n ZXRfcmVjdGFuZ2xlCit7CisgIHJldHVybiBtY19yZWN0YW5nbGU7Cit9CisKKy0gKHN0cnVjdCB3 aW5kb3cgKiltY19nZXRfd2luZG93Cit7CisgIHJldHVybiB3aW5kb3c7Cit9CisKKy0gKGJvb2wp bWNfanVkZ2UKK3sKKyAgTlNUUkFDRSAoIltFbWFjc1Njcm9sbGVyIG1jX2p1ZGdlXSIpOworICBi b29sIHJldCA9IGNvbmRlbW5lZDsKKyAgYmxvY2tfaW5wdXQgKCk7CisgIGlmIChjb25kZW1uZWQp CisgICAgeworICAgICAgLyogZW5zdXJlIG90aGVyIHNjcm9sbGJhciB1cGRhdGVzIGFmdGVyIGRl bGV0aW9uICovCisgICAgICBFbWFjc1ZpZXcgKnZpZXcgPSAoRW1hY3NWaWV3ICopRlJBTUVfTlNf VklFVyAoZnJhbWUpOworICAgICAgaWYgKHZpZXcgIT0gbmlsKQorICAgICAgICB2aWV3LT5zY3Jv bGxiYXJzTmVlZGluZ1VwZGF0ZSsrOworICAgIH0KKyAgaWYgKHdpbmRvdykKKyAgICB3c2V0X3Zl cnRpY2FsX3Njcm9sbF9iYXIgKHdpbmRvdywgUW5pbCk7CisgIHdpbmRvdyA9IDA7CisgIFtzZWxm IHJlbW92ZUZyb21TdXBlcnZpZXdXaXRob3V0TmVlZGluZ0Rpc3BsYXldOworICBbc2VsZiByZWxl YXNlXTsKKyAgdW5ibG9ja19pbnB1dCAoKTsKKyAgcmV0dXJuIHJldDsKK30KKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogLyogZm9yIHJlcGVhdCBidXR0b24gcHVzaCAqLwogI2RlZmlu ZSBTQ1JPTExfQkFSX0ZJUlNUX0RFTEFZIDAuNQogI2RlZmluZSBTQ1JPTExfQkFSX0NPTlRJTlVP VVNfREVMQVkgKDEuMCAvI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W50IGxlZnRfeCA9IHdpbmRvd19ib3hf bGVmdF9vZmZzZXQgKHMtPncsIFRFWFRfQVJFQSk7CisgICAgICAgICAgaWYgKHggPCBsZWZ0X3gp CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0gbGVmdF94 IC0geDsKKyAgICAgICAgICAgICAgeCA9IGxlZnRfeDsKKyAgICAgICAgICAgIH0KKyAgICAgICAg fQorICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgIC8qIEluIFIyTCByb3dzLCBkcmF3 IHRoZSBjdXJzb3Igb24gdGhlIHJpZ2h0IGVkZ2Ugb2YgdGhlCisgICAgICAgICAgICAgc3RyZXRj aCBnbHlwaC4gICovCisgICAgICAgICAgaW50IHJpZ2h0X3ggPSB3aW5kb3dfYm94X3JpZ2h0IChz LT53LCBURVhUX0FSRUEpOworICAgICAgICAgIGlmICh4ICsgYmFja2dyb3VuZF93aWR0aCA+IHJp Z2h0X3gpCisgICAgICAgICAgICBiYWNrZ3JvdW5kX3dpZHRoIC09IHggLSByaWdodF94OworICAg ICAgICAgIHggKz0gYmFja2dyb3VuZF93aWR0aDsKKyAgICAgICAgfQorICAgICAgd2lkdGggPSBt aW4gKEZSQU1FX0NPTFVNTl9XSURUSCAocy0+ZiksIGJhY2tncm91bmRfd2lkdGgpOworICAgICAg aWYgKHMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgeCAtPSB3aWR0aDsKKyAgICAgIC8qIERy YXcgY3Vyc29yLiAgKi8KKyAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwg cy0+eSwgd2lkdGgsIHMtPmhlaWdodCk7CisgICAgICAvKiBDbGVhciByZXN0IHVzaW5nIHRoZSBH QyBvZiB0aGUgb3JpZ2luYWwgbm9uLWN1cnNvciBmYWNlLiAgKi8KKyAgICAgIGlmICh3aWR0aCA8 IGJhY2tncm91bmRfd2lkdGgpCisgICAgICAgIHsKKyAgICAgICAgICBYR0NWYWx1ZXMgKmdjID0g cy0+ZmFjZS0+Z2M7CisgICAgICAgICAgaW50IHkgPSBzLT55OworICAgICAgICAgIGludCB3ID0g YmFja2dyb3VuZF93aWR0aCAtIHdpZHRoLCBoID0gcy0+aGVpZ2h0OworICAgICAgICAgIFJFQ1Qg cjsKKyAgICAgICAgICAgICAgICBIREMgaGRjID0gcy0+aGRjOworICAgICAgICAgIGlmICghcy0+ cm93LT5yZXZlcnNlZF9wKQorICAgICAgICAgICAgeCArPSB3aWR0aDsKKyAgICAgICAgICBlbHNl CisgICAgICAgICAgICB4ID0gcy0+eDsKKyAgICAgICAgICBpZiAocy0+cm93LT5tb3VzZV9mYWNl X3AKKyAgICAgICAgICAgICAgJiYgY3Vyc29yX2luX21vdXNlX2ZhY2VfcCAocy0+dykpCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIHhfc2V0X21vdXNlX2ZhY2VfZ2MgKHMpOworICAgICAg ICAgICAgICBnYyA9IHMtPmdjOworICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgIGdjID0gcy0+ZmFjZS0+Z2M7CisgICAgICAgICAgZ2V0X2dseXBoX3N0cmluZ19jbGlw X3JlY3QgKHMsICZyKTsKKyAgICAgICAgICB3MzJfc2V0X2NsaXBfcmVjdGFuZ2xlIChoZGMsICZy KTsKKyNpZiAwIC8qIFRPRE86IHN0aXBwbGUgKi8KKyAgICAgICAgICBpZiAocy0+ZmFjZS0+c3Rp cHBsZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogRmlsbCBiYWNrZ3JvdW5kIHdp dGggYSBzdGlwcGxlIHBhdHRlcm4uICAqLworICAgICAgICAgICAgICBYU2V0RmlsbFN0eWxlIChz LT5kaXNwbGF5LCBnYywgRmlsbE9wYXF1ZVN0aXBwbGVkKTsKKyAgICAgICAgICAgICAgWEZpbGxS ZWN0YW5nbGUgKHMtPmRpc3BsYXksIHMtPndpbmRvdywgZ2MsIHgsIHksIHcsIGgpOworICAgICAg ICAgICAgICBYU2V0RmlsbFN0eWxlIChzLT5kaXNwbGF5LCBnYywgRmlsbFNvbGlkKTsKKyAgICAg ICAgICAgIH0KKyAgICAgICAgICBlbHNlCisjZW5kaWYKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBnYy0+YmFja2dyb3VuZCwgeCwgeSwg dywgaCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGVsc2UgaWYgKCFzLT5i YWNrZ3JvdW5kX2ZpbGxlZF9wKQorICAgIHsKKyAgICAgIGludCBiYWNrZ3JvdW5kX3dpZHRoID0g cy0+YmFja2dyb3VuZF93aWR0aDsKKyAgICAgIGludCB4ID0gcy0+eCwgbGVmdF94ID0gd2luZG93 X2JveF9sZWZ0X29mZnNldCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAgIC8qIERvbid0IGRyYXcg aW50byBsZWZ0IG1hcmdpbiwgZnJpbmdlIG9yIHNjcm9sbGJhciBhcmVhCisgICAgICAgICBleGNl cHQgZm9yIGhlYWRlciBsaW5lIGFuZCBtb2RlIGxpbmUuICAqLworICAgICAgaWYgKHggPCBsZWZ0 X3ggJiYgIXMtPnJvdy0+bW9kZV9saW5lX3ApCisgICAgICAgIHsKKyAgICAgICAgICBiYWNrZ3Jv dW5kX3dpZHRoIC09IGxlZnRfeCAtIHg7CisgICAgICAgICAgeCA9IGxlZnRfeDsKKyAgICAgICAg fQorICAgICAgaWYgKGJhY2tncm91bmRfd2lkdGggPiAwKQorICAgICAgICB4X2RyYXdfZ2x5cGhf c3RyaW5nX2JnX3JlY3QgKHMsIHgsIHMtPnksIGJhY2tncm91bmRfd2lkdGgsIHMtPmhlaWdodCk7 CisgICAgfQorICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gdHJ1ZTsKK30KKworLyogU2V0IFMt PmdjIHRvIGEgc3Vp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pCisgICAgeworICAgICAgcy0+Z2MgPSBzLT5mYWNlLT5nYzsKKyAgICAg IHMtPnN0aXBwbGVkX3AgPSBzLT5mYWNlLT5zdGlwcGxlICE9IDA7CisgICAgfQorICBlbHNlIGlm IChzLT5obCA9PSBEUkFXX0lOVkVSU0VfVklERU8pCisgICAgeworICAgICAgeF9zZXRfbW9kZV9s aW5lX2ZhY2VfZ2MgKHMpOworICAgICAgcy0+c3RpcHBsZWRfcCA9IHMtPmZhY2UtPnN0aXBwbGUg IT0gMDsKKyAgICB9CisgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgIHsKKyAg ICAgIG1jX3czMl9zZXRfY3Vyc29yX2djIChzLCBjdXJzb3JfZ2NfcCk7CisgICAgICBzLT5zdGlw cGxlZF9wID0gZmFsc2U7CisgICAgfQorICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX01PVVNFX0ZB Q0UpCisgICAgeworICAgICAgeF9zZXRfbW91c2VfZmFjZV9nYyAocyk7CisgICAgICBzLT5zdGlw cGxlZF9wID0gcy0+ZmFjZS0+c3RpcHBsZSAhPSAwOworICAgIH0KKyAgZWxzZSBpZiAocy0+aGwg PT0gRFJBV19JTUFHRV9SQUlTRUQKKyAgICAgICAgICAgfHwgcy0+aGwgPT0gRFJBV19JTUFHRV9T VU5LRU4pCisgICAgeworICAgICAgcy0+Z2MgPSBzLT5mYWNlLT5nYzsKKyAgICAgIHMtPnN0aXBw bGVkX3AgPSBzLT5mYWNlLT5zdGlwcGxlICE9IDA7CisgICAgfQorICBlbHNlCisgICAgZW1hY3Nf YWJvcnQgKCk7CisgIC8qIEdDIG11c3QgaGF2ZSBiZWVuIHNldC4gICovCisgIGVhc3NlcnQgKHMt PmdjICE9IDApOworfQorCisvKiBEcmF3IGEgaG9sbG93IGJveCBjdXJzb3Igb24gd2luZG93IFcg aW4gZ2x5cGggcm93IFJPVy4gICovCitzdGF0aWMgdm9pZAorbWNfdzMyX2RyYXdfaG9sbG93X2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nNvci4gICovCisgICAgICBpZiAoYWN0aXZlX3ApCisgICAgICAgIHsK KyAgICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOwor ICAgICAgICAgIEhXTkQgaHduZCA9IEZSQU1FX1czMl9XSU5ET1cgKGYpOworICAgICAgICAgIHcz Ml9zeXN0ZW1fY2FyZXRfeAorICAgICAgICAgICAgPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhF TF9YICh3LCB4KTsKKyAgICAgICAgICAvKiBGSVhNRTogIFdoYXQgc2hvdWxkIHdlIHVzZSBpbnN0 ZWFkIG9mIGB3LT5waHlzX2N1cnNvcl9hc2NlbnQnPyAqLworICAgICAgICAgIHczMl9zeXN0ZW1f Y2FyZXRfeQorICAgICAgICAgICAgPSAoV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIHkpCisg ICAgICAgICAgICAgICArIHJvdy0+YXNjZW50IC0gdy0+cGh5c19jdXJzb3JfYXNjZW50KTsKKyAg ICAgICAgICB3MzJfc3lzdGVtX2NhcmV0X3dpbmRvdyA9IHc7CisgICAgICAgICAgdzMyX3N5c3Rl bV9jYXJldF9oZHJfaGVpZ2h0ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAg ICAgICAgdzMyX3N5c3RlbV9jYXJldF9tb2RlX2hlaWdodCA9IFdJTkRPV19NT0RFX0xJTkVfSEVJ R0hUICh3KTsKKyAgICAgICAgICBQb3N0TWVzc2FnZSAoaHduZCwgV01fSU1FX1NUQVJUQ09NUE9T SVRJT04sIDAsIDApOworICAgICAgICAgIC8qIElmIHRoZSBzaXplIG9mIHRoZSBhY3RpdmUgY3Vy c29yIGNoYW5nZWQsIGRlc3Ryb3kgdGhlIG9sZAorICAgICAgICAgICAgIHN5c3RlbSBjYXJldC4g ICovCisgICAgICAgICAgaWYgKHczMl9zeXN0ZW1fY2FyZXRfaHduZAorICAgICAgICAgICAgICA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X2VuZCkKKyAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZl X3JlZ2lvbl9lbmRfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIr LXJlYWwtZmFrZS1jdXJzb3ItYXQtcmVnaW9uLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAg ICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZSA9IEZB Q0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2VfaWQpOworICAgICAg ICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFt ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiks IHRydWUpOworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2Ug PSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAg ICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7 CisgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3Jl Z2lvbl9lbmRfZmFjZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgYWN0 aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID4g cmVnaW9uX2JlZworICAgICAgICAgICAgICAgICAgICAgIC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JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYg KGN1cnNvcl9nbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCAmJiBsc2wucmVkID49IDAgJiYgbHNs LmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICAv KiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4g ICovCisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9y X3BpeGVsOworICAgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4 LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgICAgZi0+ b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7Cisg ICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg LyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycgYnkg Ym9ycm93aW5nIHRoZQorICAgICAgICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2Mn IGluIHczMmZucy5jLiAgKi8KKyAgICAgICAgICAgICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAg ICAgICAgICAgICAgICAgJiYgYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9n bHlwaC0+Y2hhcnBvcyA9PSByZWdpb25fYmVnKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdfZmFjZV9pZCA9 IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItYXQt cmVnaW9uLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgc3RydWN0IGZh Y2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2JlZ19mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xs b3dfYWN0aXZlX3JlZ2lvbl9iZWdfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBlbnVtIGZh Y2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGlu dGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAg ICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQg KGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBnY192YWx1ZXMu Zm9yZWdyb3VuZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAg ICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gaG9sbG93X2FjdGl2ZV9yZWdpb25fYmVnX2Zh Y2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2Ug aWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9w CisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID09IHJl Z2lvbl9lbmQpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGVudW0g ZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9m YWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItYXQtcmVnaW9uLXByZS16di1m YWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2Fj dGl2ZV9yZWdpb25fZW5kX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfcmVn aW9uX2VuZF9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxv d19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJl YWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAg IHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxv d19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3Jv dW5kID0gaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICAgICAg ICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlLT5i YWNrZ3JvdW5kOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBp ZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID4g cmVnaW9uX2JlZworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5j aGFycG9zIDwgcmVnaW9uX2VuZCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2Vf aWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29y LWluLXJlZ2lvbi1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICBz dHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlID0gRkFDRV9GUk9N X0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQpOworICAgICAgICAg ICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBf bmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNl IiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0 aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAg ICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2Zh Y2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91 bmQgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2UtPmZvcmVncm91bmQ7CisgICAg ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoYWN0aXZlX3Ap CisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBm YWNlX2lkIGhvbGxvd19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBp bnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAg ICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9G Uk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAg ICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7 CisgICAgICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19h Y3RpdmVfZmFjZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0 aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZh a2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01f SUQgKGYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfaW5hY3RpdmVfZmFjZS0+Zm9yZWdyb3Vu ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xs b3dfaW5hY3RpdmVfZmFjZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MgPSBYQ3JlYXRlR0Mg KE5VTEwsIEZSQU1FX1czMl9XSU5ET1cgKGYpLCBtYXNrLCAmZ2NfdmFsdWVzKTsKKyAgICAgICAg ICAgICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgIC8qIEZvcmNlIGBtY193MzJfc2V0 X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycuICAq LworICAgICAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICAgICAg bWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBv cywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbCwgZ2x5cGhf Zmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCk7CisgICAgICAg ICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djID0gb3JpZ2luYWxfY3Vyc29yX2dj OworICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAgICBtY193MzJf ZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2 cG9zLCB3ZCwgaCk7CisgICAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2Fz ZSBNQ19IT0xMT1dfQk9YOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdy ZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICA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LCB3ZCwgYWN0aXZlX3As CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX2djX3ApOworICAgICAg ICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0JBUjoKKyAgICB7CisgICAg ICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisg ICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRh LnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5j dXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZp c2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3 LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2dj X2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29y X3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UK KyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9w ID0gZmFsc2U7CisgICAgICAgICAgICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgs IHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNp YmxlX29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2Ug TUNfSEJBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAw ICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBo aWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAg Zi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAgICAg ICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY193 MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2 cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lk dGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAg ICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJz b3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfdzMyX2RyYXdf YmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2Qs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1D X0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAg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KTsKKyAgICAgIHhfZHJhd19nbHlwaGxlc3NfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQg KHMpOworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOwor ICAgIH0KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMpCisgICAgeworICAgICAgLyogRHJhdyB1bmRl cmxpbmUuICAqLworICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9wKQorICAgICAgICB7Cisg ICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgQ09MT1JSRUYgY29sb3I7CisgICAgICAgICAg ICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgICAg Y29sb3IgPSBzLT5nYy0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICAgIGNvbG9yID0gcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yOworICAgICAgICAgICAgICB3 MzJfZHJhd191bmRlcndhdmUgKHMsIGNvbG9yKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBl bHNlIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlv bjsKKyAgICAgICAgICAgICAgaW50IHk7CisgICAgICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMt PnByZXYtPmZhY2UtPnVuZGVybGluZV9wCisgICAgICAgICAgICAgICAgICAmJiBzLT5wcmV2LT5m YWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgLyogV2UgdXNlIHRoZSBzYW1lIHVuZGVybGluZSBzdHlsZSBh cyB0aGUgcHJldmlvdXMgb25lLiAgKi8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMt PnByZXYtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9 IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBHZXQg dGhlIHVuZGVybGluZSB0aGlja25lc3MuICBEZWZhdWx0IGlzIDEgcGl4ZWwuICAqLworICAgICAg ICAgICAgICAgICAgaWYgKHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+ IDApCisgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPmZvbnQtPnVuZGVybGluZV90 aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHRo aWNrbmVzcyA9IDE7CisgICAgICAgICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2Vu dF9saW5lKQorICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSB0aGlj a25lc3MpIC0gKHMtPnliYXNlIC0gcy0+eSk7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVy bGluZSBwb3NpdGlvbi4gIFRoaXMgaXMgdGhlIHJlY29tbWVuZGVkCisgICAgICAgICAgICAgICAg ICAgICAgICAgdmVydGljYWwgb2Zmc2V0IGluIHBpeGVscyBmcm9tIHRoZSBiYXNlbGluZSB0byB0 aGUgdG9wIG9mCisgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIHVuZGVybGluZS4gIFRoaXMg aXMgYSBzaWduZWQgdmFsdWUgYWNjb3JkaW5nIHRvIHRoZQorICAgICAgICAgICAgICAgICAgICAg ICAgIHNwZWNzLCBhbmQgaXRzIGRlZmF1bHQgaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICBS T1VORCAoKG1heGltdW1fZGVzY2VudCkgLyAyKSwgd2l0aAorICAgICAgICAgICAgICAgICAgICAg ICAgIFJPVU5EICh4KSA9IGZsb29yICh4ICsgMC41KSAgKi8KKyAgICAgICAgICAgICAgICAgICAg ICBpZiAoeF91c2VfdW5kZXJsaW5lX3Bvc2l0aW9uX3Byb3BlcnRpZXMKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgcy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb24gPj0g MCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+Zm9udC0+dW5kZXJsaW5l X3Bvc2l0aW9uOworICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHMtPmZvbnQpCisgICAg ICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5mb250LT5kZXNjZW50ICsgMSkgLyAy OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IG1h eCAocG9zaXRpb24sIHVuZGVybGluZV9taW5pbXVtX29mZnNldCk7CisgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICAvKiBDaGVjayB0aGUgc2FuaXR5IG9mIHRoaWNrbmVzcyBhbmQgcG9z aXRpb24uICBXZSBzaG91bGQKKyAgICAgICAgICAgICAgICAgYXZvaWQgZHJhd2luZyB1bmRlcmxp bmUgb3V0IG9mIHRoZSBjdXJyZW50IGxpbmUgYXJlYS4gICovCisgICAgICAgICAgICAgIGlmIChz LT55ICsgcy0+aGVpZ2h0IDw9IHMtPnliYXNlICsgcG9zaXRpb24pCisgICAgICAgICAgICAgICAg cG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gMSkgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAg ICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPCBzLT55YmFzZSArIHBvc2l0aW9uICsgdGhpY2tu ZXNzKQorICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IChzLT55ICsgcy0+aGVpZ2h0KSAtIChz LT55YmFzZSArIHBvc2l0aW9uKTsKKyAgICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3RoaWNrbmVz cyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3Bvc2l0aW9uID1wb3Np dGlvbjsKKyAgICAgICAgICAgICAgeSA9IHMtPnliYXNlICsgcG9zaXRpb247CisgICAgICAgICAg ICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgICAg dzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5nYy0+Zm9yZWdyb3VuZCwgcy0+eCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5LCBzLT53aWR0aCwgMSk7CisgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMt PmZhY2UtPnVuZGVybGluZV9jb2xvciwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICB5LCBzLT53aWR0aCwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIC8q IERyYXcgb3ZlcmxpbmUuICAqLworICAgICAgaWYgKHMtPmZhY2UtPm92ZXJsaW5lX3ApCisgICAg ICAgIHsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIGR5ID0gMCwgaCA9IDE7CisgICAgICAgICAg aWYgKHMtPmZhY2UtPm92ZXJsaW5lX2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgdzMy X2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5nYy0+Zm9yZWdyb3VuZCwgcy0+eCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmZh Y2UtPm92ZXJsaW5lX2NvbG9yLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBz LT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgfQorICAgICAgLyogRHJhdyBzdHJpa2Ut dGhyb3VnaC4gICovCisgICAgICBpZiAocy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfcAorICAgICAg ICAgICYmICFGT05UX1RFWFRNRVRSSUMgKHMtPmZvbnQpLnRtU3RydWNrT3V0KQorICAgICAgICB7 CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBoID0gMTsKKyAgICAgICAgICB1bnNpZ25lZCBsb25n IGR5ID0gKHMtPmhlaWdodCAtIGgpIC8gMjsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+c3RyaWtl X3Rocm91Z2hfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChz LT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LCBzLT55ICsgZHksCisgICAgICAg ICAgICAgICAgICAgICAgICAgICBzLT53aWR0aCwgaCk7CisgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5mYWNlLT5zdHJpa2VfdGhyb3Vn aF9jb2xvciwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+ d2lkdGgsIGgpOworICAgICAgICB9CisgICAgICAvKiBEcmF3IHJlbGllZiBpZiBub3QgeWV0IGRy YXduLiAgKi8KKyAgICAgIGlmICghcmVsaWVmX2RyYXduX3AgJiYgcy0+ZmFjZS0+Ym94ICE9IEZB Q0VfTk9fQk9YKQorICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JveCAocyk7CisgICAgICBp ZiAocy0+cHJldikKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKnBy ZXY7CisgICAgICAgICAgZm9yIChwcmV2ID0gcy0+cHJldjsgcHJldjsgcHJldiA9IHByZXYtPnBy ZXYpCisgICAgICAgICAgICBpZiAocHJldi0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAgICAm JiBwcmV2LT54ICsgcHJldi0+d2lkdGggKyBwcmV2LT5yaWdodF9vdmVyaGFuZyA+IHMtPngpCisg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBcyBwcmV2IHdhcyBkcmF3biB3aGls ZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwgd2UKKyAgICAgICAgICAgICAgICAgICBtdXN0IGRy YXcgdGhlIHJpZ2h0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwgbm93LiAgKi8KKyAgICAgICAg ICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9IHByZXYtPmhsOworICAgICAgICAg ICAgICAgIHByZXYtPmhsID0gcy0+aGw7CisgICAgICAgICAgICAgICAgbWNfdzMyX3NldF9nbHlw aF9zdHJpbmdfZ2MgKHByZXYsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9n bHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgcHJldik7CisgICAgICAgICAgICAgICAg aWYgKHByZXYtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAg ICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5n X2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAgICAgIHczMl9zZXRfY2xpcF9yZWN0YW5n bGUgKHByZXYtPmhkYywgTlVMTCk7CisgICAgICAgICAgICAgICAgcHJldi0+aGwgPSBzYXZlOwor ICAgICAgICAgICAgICAgIHByZXYtPm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgIH0KKyAg ICAgICAgfQorICAgICAgaWYgKHMtPm5leHQpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3Qg Z2x5cGhfc3RyaW5nICpuZXh0OworICAgICAgICAgIGZvciAobmV4dCA9IHMtPm5leHQ7IG5leHQ7 IG5leHQgPSBuZXh0LT5uZXh0KQorICAgICAgICAgICAgaWYgKG5leHQtPmhsICE9IHMtPmhsCisg ICAgICAgICAgICAgICAgJiYgbmV4dC0+eCAtIG5leHQtPmxlZnRfb3ZlcmhhbmcgPCBzLT54ICsg cy0+d2lkdGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBcyBuZXh0IHdp bGwgYmUgZHJhd24gd2hpbGUgY2xpcHBlZCB0byBpdHMgb3duIGFyZWEsCisgICAgICAgICAgICAg ICAgICAgd2UgbXVzdCBkcmF3IHRoZSBsZWZ0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwgbm93 LiAgKi8KKyAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9IG5leHQt PmhsOworICAgICAgICAgICAgICAgIG5leHQtPmhsID0gcy0+aGw7CisgICAgICAgICAgICAgICAg bWNfdzMyX3NldF9nbHlwaF9zdHJpbmdfZ2MgKG5leHQsIGN1cnNvcl9nY19wKTsKKyAgICAgICAg ICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgbmV4dCk7Cisg ICAgICAgICAgICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgp CisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQp OworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19jb21wb3Np dGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIHczMl9z ZXRfY2xpcF9yZWN0YW5nbGUgKG5leHQtPmhkYywgTlVMTCk7CisgICAgICAgICAgICAgICAgbmV4 dC0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAg ICAgICAgICAgICAgbmV4dC0+Y2xpcF9oZWFkID0gcy0+bmV4dDsKKyAgICAgICAgICAgICAgfQor ICAgICAgICB9CisgICAgfQorICAvKiBSZXNldCBjbGlwcGluZy4gICovCisgIHczMl9zZXRfY2xp cF9yZWN0YW5nbGUgKHMtPmhkYywgTlVMTCk7CisgIHMtPm51bV9jbGlwcyA9IDA7Cit9CisKKy8q IGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAv KiBGcmluZ2UgYml0bWFwcy4gICovCiAKIHN0YXRpYyBpbnQgbWF4X2ZyaW5nZV9ibXAgPSAwOwpA QCAtNTQ1LDYgKzE0MTcsMTUgQEAgeF91cGRhdGVfYmVnaW4gKHN0cnVjdCBmcmFtZSAqZikKICAg aWYgKCEgRlJBTUVfVzMyX1AgKGYpKQogICAgIHJldHVybjsKIAorCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFt ZSA9IGY7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogUmVnZW5lcmF0ZSBk aXNwbGF5IHBhbGV0dGUgYmVmb3JlIGRyYXdpbmcgaWYgbGlzdCBvZiByZXF1ZXN0ZWQKICAgICAg Y29sb3JzIGhhcyBjaGFuZ2VkLiAqLwogICBpZiAoZGlzcGxheV9pbmZvLT5yZWdlbl9wYWxldHRl KQpAQCAtNzU0LDYgKzE2MzUsMTYgQEAgeF91cGRhdGVfZW5kIChzdHJ1Y3QgZnJhbWUgKmYpCiAK ICAgLyogTW91c2UgaGlnaGxpZ2h0IG1heSBiZSBkaXNwbGF5ZWQgYWdhaW4uICAqLwogICBNT1VT RV9ITF9JTkZPIChmKS0+bW91c2VfZmFjZV9kZWZlciA9IGZhbHNlOworCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5n X2ZyYW1lID0gTlVMTDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAKQEAg LTQwNDEsMTMgKzQ5MzIsNzQgQEAgdzMyX3NldF92ZXJ0aWNhbF9zY3JvbGxfYmFyIChzdHJ1Y3Qg d2luZG93ICp3LAogCSAgICAgIHJlbGVhc2VfZnJhbWVfZGMgKGYsIGhkYyk7CiAJICAgICAgeF9j bGVhcl91bmRlcl9pbnRlcm5hbF9ib3JkZXIgKGYpOwogCSAgICB9CisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqK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EFOR0VEKTsKKyAgICAgICAgICBpZiAobGVm dCA8PSBiYXItPmxlZnQpCisgICAgICAgICAgICBteV9zaG93X3dpbmRvdyAoZiwgaHduZCwgU1df SElERSk7CisgICAgICAgICAgTW92ZVdpbmRvdyAoaHduZCwgbGVmdCwgdG9wLCB3aWR0aCwgbWF4 IChoZWlnaHQsIDEpLCBsZWZ0IDw9IGJhci0+bGVmdCk7CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJT T1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwogCiAJICBzaS5jYlNpemUgPSBzaXpl b2YgKHNpKTsKIAkgIHNpLmZNYXNrID0gU0lGX1JBTkdFOwpAQCAtNDMxNiw2ICs1MjY4LDIxIEBA IHczMl9qdWRnZV9zY3JvbGxfYmFycyAoc3RydWN0IGZyYW1lICpmKQogICAgIHsKICAgICAgIHN0 cnVjdCBzY3JvbGxfYmFyICpiID0gWFNDUk9MTF9CQVIgKGJhcik7CiAKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIC8qIGBEZXN0cm95 V2luZG93JyB3aXRoaW4gYHhfc2Nyb2xsX2Jhcl9yZW1vdmUnIHJlcGFpbnRzIHRoZSByZWN0YW5n bGUuCisgICAgICBUaGVyZWZvcmUsIHdlIGZpcnN0IHNlbmQgYSBtZXNzYWdlIHRvIGluaGliaXQg cmVwYWludGluZy4gKi8KKyAgICAgIGlmICghV0lORE9XX0xJVkVfUCAoYi0+d2luZG93KSkKKyAg ICAgICAgeworICAgICAgICAgIEhXTkQgaHduZCA9IFNDUk9MTF9CQVJfVzMyX1dJTkRPVyAoYik7 CisgICAgICAgICAgU2VuZE1lc3NhZ2UgKGh3bmQsIFdNX1NFVFJFRFJBVywgZmFsc2UsIDApOwor ICAgICAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIHhfc2Nyb2xs X2Jhcl9yZW1vdmUgKGIpOwogCiAgICAgICBuZXh0ID0gYi0+bmV4dDsKQEAgLTcwOTEsNiArODA1 OCwyMCBAQCBleHRlcm4gZnJhbWVfcGFybV9oYW5kbGVyIHczMl9mcmFtZV9wYXJtX2hhbmRsZXJz W107CiAKIHN0YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSB3MzJfcmVkaXNwbGF5X2lu dGVyZmFjZSA9CiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1D VVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgdzMydGVybS5jYCBtdXN0 IGJlIGluIHRoZSBleGFjdCBzYW1lIG9yZGVyIGFzIHRoZQorYHJlZGlzcGxheV9pbnRlcmZhY2Un IGluIGBkaXNwZXh0ZXJuLmhgISAqLworCisgIG1jX3czMl9kcmF3X3dpbmRvd19jdXJzb3IsCisg IG1jX3czMl9kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogICB3MzJfZnJhbWVfcGFybV9oYW5kbGVycywKICAgeF9wcm9kdWNlX2dseXBocywKICAgeF93 cml0ZV9nbHlwaHMsCmRpZmYgLS1naXQgYS9zcmMvd2luZG93LmggYi9zcmMvd2luZG93LmgKaW5k ZXggZmRlZjQwNy4uMmIwYjliNCAxMDA2NDQKLS0tIGEvc3JjL3dpbmRvdy5oCisrKyBiL3NyYy93 aW5kb3cuaApAQCAtMzI0LDYgKzMyNCwxNDcgQEAgc3RydWN0IHdpbmRvdwogCiAjaWZkZWYgSEFW RV9XSU5ET1dfU1lTVEVNCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBN VUxUSVBMRS1DVVJTT1JTICovCisKKy8qIFN1ZmZpeGVzIGZvciB0aGUgYG1jYCB3aW5kb3cgcG9p bnRlciBwcmVmaXguICovCitzdHJ1Y3QgbXVsdGlwbGVfY3Vyc29ycworeworICAvKiBUaGUgcmVj b3JkZWQgcGl4ZWwgd2lkdGggb2YgdGhlIGxhc3QgbGluZSBudW1iZXIgZHJhd24gZHVyaW5nIHJl ZGlzcGxheSAqLworICBpbnQgbG51bV9waXhlbF93aWR0aDsKK30gbWM7CisKK3N0cnVjdCBtY19t YXRyaXgKK3sKKyAgcHRyZGlmZl90IHZwb3NfYWxsb2NhdGVkOworICBwdHJkaWZmX3QgdnBvc191 c2VkOworICBwdHJkaWZmX3QgY3Vyc29yc191c2VkWzRdOworICBlbnVtIG1jX2NhY2hlX3R5cGUK KyAgeworICAgIE1DX0NBQ0hFLAorICAgIENIX0NBQ0hFLAorICAgIEZDX0NBQ0hFLAorICAgIE5P X0NBQ0hFCisgIH0gY2FjaGVfdHlwZTsKKyAgc3RydWN0IG1jX3Zwb3MKKyAgeworICAgIHB0cmRp ZmZfdCBjYWNoZV9hbGxvY2F0ZWRbNF07CisgICAgcHRyZGlmZl90IGNhY2hlX3VzZWRbNF07Cisg ICAgc3RydWN0IG1jX2NvbnRlbnRzCisgICAgeworICAgICAgYm9vbF9iZiBzYW1lX3AgOiAxOwor ICAgICAgc3RydWN0IGdseXBoIGdseXBoOworICAgICAgaW50IHg7CisgICAgICBpbnQgZng7Cisg ICAgICBpbnQgeTsKKyAgICAgIGludCBmeTsKKyAgICAgIGludCBocG9zOworICAgICAgaW50IHZw b3M7CisgICAgICBpbnQgd2Q7CisgICAgICBpbnQgaDsKKyAgICAgIGVudW0gbWNfY3Vyc29yX3R5 cGUKKyAgICAgIHsKKyAgICAgICAgLyogTk9URTogIFRoZSBmcmluZ2UgYml0bWFwIGZyYW1ld29y ayByZWxpZXMgdXBvbiBNQ19OT19GUklOR0VfQklUTUFQCisgICAgICAgIGhhdmluZyBhIHZhbHVl IG9mIHplcm8gKDApLiAqLworICAgICAgICBNQ19OT19GUklOR0VfQklUTUFQLAorICAgICAgICBN Q19OT19DVVJTT1IsCisgICAgICAgIE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAsCisgICAgICAgIE1D X0xFRlRfRlJJTkdFX0JJVE1BUCwKKyAgICAgICAgTUNfRlJBTUVEX0JPWCwKKyAgICAgICAgTUNf RklMTEVEX0JPWCwKKyAgICAgICAgTUNfSE9MTE9XX0JPWCwKKyAgICAgICAgTUNfQkFSLAorICAg ICAgICBNQ19IQkFSCisgICAgICB9IGN1cnNvcl90eXBlOworICAgICAgaW50IGN1cnNvcl93aWR0 aDsKKyAgICAgIHN0cnVjdCBtY19SR0IKKyAgICAgIHsKKyAgICAgICAgZG91YmxlIHJlZDsKKyAg ICAgICAgZG91YmxlIGdyZWVuOworICAgICAgICBkb3VibGUgYmx1ZTsKKyAgICAgIH0gZmcsIGJn OworICAgICAgYm9vbF9iZiBhY3RpdmVfcCA6IDE7CisgICAgICBlbnVtIG1jX2ZsYXZvcgorICAg ICAgeworICAgICAgICBOT19GTEFWT1IsCisgICAgICAgIE1DX0dMWVBILAorICAgICAgICBNQ19H TFlQSExFU1MsCisgICAgICAgIE1DX09WRVJMQVlfQVJST1dfQklUTUFQLAorICAgICAgICBNQ19Q SUxDUk9XLAorICAgICAgICBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XLAorICAgICAg ICBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XLAorICAgICAgICBNQ19I T0xMT1dfUkVDVEFOR0xFLAorICAgICAgICBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1csCisg ICAgICAgIE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVywKKyAgICAgICAgTUNf VkVSVElDQUxfQkFSLAorICAgICAgICBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIsCisgICAgICAg IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgIH0gZ2x5cGhfZmxhdm9yOworICAgICAg Ym9vbF9iZiBlbmFibGVkX3AgOiAxOworICAgIH0gKmNhY2hlWzRdOworICB9ICp2cG9zOworICAv KiBVc2VkIGVsc2V3aGVyZS4gKi8KKyAgc3RydWN0IG1jX2Vzc2VudGlhbHMKKyAgeworICAgIGVu dW0gbWNfcm93X3Bvc2l0aW9uCisgICAgeworICAgICAgUFJFX1pWLAorICAgICAgQVRfWlYsCisg ICAgICBQT1NUX1pWCisgICAgfSByb3dfcG9zaXRpb247CisgICAgYm9vbF9iZiBhY3RpdmVfcCA6 IDE7CisgICAgc3RydWN0IG1jX1JHQiBjaF9mZ1szXSwgZmNfZmdbM10sIHNwX2ZnOworICAgIGlu dCBmY194OworICAgIGludCB6djsKKyAgICBpbnQgenZfYnl0ZTsKKyAgfSBlc3NlbnRpYWxzOwor ICAvKiBVc2VkIGVsc2V3aGVyZS4gKi8KKyAgZW51bSBtY19lbmdpbmVfdHlwZQorICB7CisgICAg TVVMVElQTEVfQ1VSU09SUywKKyAgICBIT1JJWk9OVEFMX1JVTEVSLAorICAgIFZFUlRJQ0FMX1JV TEVSLAorICAgIEZJTExfQ09MVU1OLAorICAgIENVUlNPUl9JTkRJQ0FUT1IKKyAgfSBhY3Rpb25f dHlwZTsKKyAgLyogVXNlZCBlbHNld2hlcmUuICovCisgIGVudW0gbWNfcHJlX3Njcm9sbF9jbGVh bl90eXBlCisgIHsKKyAgICBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfRE9XTiwK KyAgICBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfVVAsCisgICAgVFJZX1dJTkRP V19JRAorICB9IG1jX3ByZV9zY3JvbGxfY2xlYW5fdHlwZV9fZnJvbV93aGVyZTsKKyAgLyogVXNl ZCBlbHNld2hlcmUuICovCisgIGVudW0gbWNfZHJhd19yb3dfdHlwZQorICB7CisgICAgTk9XSEVS RSwKKyAgICBTQ1JJQkVfT05FLAorICAgIFNDUklCRV9UV08sCisgICAgU0NSSUJFX1RIUkVFLAor ICAgIFNLSVBQRUQsCisgICAgUE9TVF9DSEFOR0VELAorICAgIFVOQ0hBTkdFRCwKKyAgICBTRVRf Q1VSU09SX09ORSwKKyAgICBTRVRfQ1VSU09SX1RXTworICB9IG1jX2RyYXdfcm93X3R5cGVfX2Zy b21fd2hlcmU7CisgIC8qIFVzZWQgZWxzZXdoZXJlLiAqLworICBlbnVtIG1jX3JlZHJhd19yb3df dHlwZQorICB7CisgICAgVVBEQVRFX1dJTkRPV19fUkVEUkFXX09WRVJMQVBQRURfUk9XUywKKyAg ICBYX0lOU0VSVF9HTFlQSFMsCisgICAgWF9GSVhfT1ZFUkxBUFBJTkdfQVJFQSwKKyAgICBEUkFX X1JPV19XSVRIX01PVVNFX0ZBQ0UsCisgICAgRVhQT1NFX0FSRUFfT05FLAorICAgIEVYUE9TRV9B UkVBX1RXTywKKyAgICBFWFBPU0VfTElORQorICB9IG1jX3JlZHJhd19yb3dfdHlwZV9fZnJvbV93 aGVyZTsKK30gbWNfbWF0cml4OworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogICAgIC8qIEN1cnNvciB0eXBlIG9mIGxhc3QgY3Vyc29y IGRyYXduIG9uIHRoZSB3aW5kb3cuICAqLwogICAgIGVudW0gdG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BlYXNzdW1lICgwIDwgY291bnQpOworICBMaXNwX09iamVjdCB2YWwgPSBGY29ucyAo YXJnLCBRbmlsKTsKKyAgTGlzcF9PYmplY3QgdGFpbCA9IHZhbDsKKyAgdmFfbGlzdCBhcDsKKyAg dmFfc3RhcnQgKGFwLCBhcmcpOworICBmb3IgKHB0cmRpZmZfdCBpID0gMTsgaSA8IGNvdW50OyBp KyspCisgICAgeworICAgICAgTGlzcF9PYmplY3QgZWxlbSA9IEZjb25zICh2YV9hcmcgKGFwLCBM aXNwX09iamVjdCksIFFuaWwpOworICAgICAgWFNFVENEUiAodGFpbCwgZWxlbSk7CisgICAgICB0 YWlsID0gZWxlbTsKKyAgICB9CisgIHZhX2VuZCAoYXApOworICByZXR1cm4gdmFsOworfQorCitM aXNwX09iamVjdAorbWNfbWVtcSAoTGlzcF9PYmplY3QgZWx0LCBMaXNwX09iamVjdCBsaXN0KQor eworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KSB8fCBFUSAoWENB UiAobGlzdCksIGVsdCkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3Qp OworICAgICAgaWYgKCFDT05TUCAobGlzdCkgfHwgRVEgKFhDQVIgKGxpc3QpLCBlbHQpKQorICAg ICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1Ag KGxpc3QpIHx8IEVRIChYQ0FSIChsaXN0KSwgZWx0KSkKKyAgICAgICAgYnJlYWs7CisgICAgICBs aXN0ID0gWENEUiAobGlzdCk7CisgICAgfQorICByZXR1cm4gbGlzdDsKK30KKworTGlzcF9PYmpl Y3QKK21jX250aCAoaW50IG51bSwgTGlzcF9PYmplY3QgbGlzdCkKK3sKKyAgZm9yIChpbnQgaSA9 IDA7IGkgPCBudW0gJiYgIU5JTFAgKGxpc3QpOyBpKyspCisgICAgbGlzdCA9IFhDRFIgKGxpc3Qp OworICBpZiAoQ09OU1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FSIChsaXN0KTsKKyAgICBlbHNl CisgICAgICByZXR1cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QKK21jX2Fzc3EgKExpc3BfT2Jq ZWN0IGtleSwgTGlzcF9PYmplY3QgbGlzdCkKK3sKKyAgd2hpbGUgKDEpCisgICAgeworICAgICAg aWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAg ICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBrZXkpKSkKKyAgICAgICAgYnJl YWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQor ICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYmIEVRIChY Q0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBY Q0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQ IChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhDQVIgKFhDQVIgKGxpc3QpKSwg a2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgIH0K KyAgaWYgKENPTlNQIChsaXN0KSkKKyAgICByZXR1cm4gWENBUiAobGlzdCk7CisgICAgZWxzZQor ICAgICAgcmV0dXJuIFFuaWw7Cit9CisKK0xpc3BfT2JqZWN0CittY19hc3NvYyAoTGlzcF9PYmpl Y3Qga2V5LCBMaXNwX09iamVjdCBsaXN0KQoreworICBMaXNwX09iamVjdCBjYXI7CisgIHdoaWxl ICgxKQorICAgIHsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQ IChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgKGNhciA9IFhDQVIgKFhDQVIgKGxpc3Qp KSwKKyAgICAgICAgICAgICAgICAgIEVRIChjYXIsIGtleSkgfHwgIU5JTFAgKEZlcXVhbCAoY2Fy LCBrZXkpKSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAg ICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkK KyAgICAgICAgICAgICAgJiYgKGNhciA9IFhDQVIgKFhDQVIgKGxpc3QpKSwKKyAgICAgICAgICAg ICAgICAgIEVRIChjYXIsIGtleSkgfHwgIU5JTFAgKEZlcXVhbCAoY2FyLCBrZXkpKSkpKQorICAg ICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1Ag KGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAg JiYgKGNhciA9IFhDQVIgKFhDQVIgKGxpc3QpKSwKKyAgICAgICAgICAgICAgICAgIEVRIChjYXIs IGtleSkgfHwgIU5JTFAgKEZlcXVhbCAoY2FyLCBrZXkpKSkpKQorICAgICAgICBicmVhazsKKyAg ICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICB9CisgIGlmIChDT05TUCAobGlzdCkpCisgICAg cmV0dXJuIFhDQVIgKGxpc3QpOworICAgIGVsc2UKKyAgICAgIHJldHVybiBRbmlsOworfQorCitM aXNwX09iamVjdAorbWNfcGxpc3RfZ2V0IChMaXNwX09iamVjdCBwbGlzdCwgTGlzcF9PYmplY3Qg cHJvcCkKK3sKKyAgTGlzcF9PYmplY3QgdGFpbCwgaGFsZnRhaWw7CisgIC8qIGhhbGZ0YWlsIGlz IHVzZWQgdG8gZGV0ZWN0IGNpcmN1bGFyIGxpc3RzLiAgKi8KKyAgdGFpbCA9IGhhbGZ0YWlsID0g cGxpc3Q7CisgIHdoaWxlIChDT05TUCAodGFpbCkgJiYgQ09OU1AgKFhDRFIgKHRhaWwpKSkKKyAg ICB7CisgICAgICBpZiAoRVEgKHByb3AsIFhDQVIgKHRhaWwpKSkKKyAgICAgICAgcmV0dXJuIFhD QVIgKFhDRFIgKHRhaWwpKTsKKyAgICAgIHRhaWwgPSBYQ0RSIChYQ0RSICh0YWlsKSk7CisgICAg ICBoYWxmdGFpbCA9IFhDRFIgKGhhbGZ0YWlsKTsKKyAgICAgIGlmIChFUSAodGFpbCwgaGFsZnRh aWwpKQorICAgICAgICBicmVhazsKKyAgICB9CisgIHJldHVybiBRbmlsOworfQorCisvKiBSRUdJ T04gQkVHSU46ICBtY19yZWdpb25fbGltaXQgKDEpCisgICBSRUdJT04gRU5EOiAgbWNfcmVnaW9u X2xpbWl0ICgwKSAqLworcHRyZGlmZl90CittY19yZWdpb25fbGltaXQgKGJvb2wgYmVnaW5fcCkK K3sKKyAgaWYgKCFOSUxQIChWdHJhbnNpZW50X21hcmtfbW9kZSkKKyAgICAgICYmIE5JTFAgKFZt YXJrX2V2ZW5faWZfaW5hY3RpdmUpCisgICAgICAmJiBOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZl ciwgbWFya19hY3RpdmUpKSkKKyAgICB4c2lnbmFsMCAoUW1hcmtfaW5hY3RpdmUpOworICBMaXNw X09iamVjdCBtYXJrZXIgPSBCVkFSIChjdXJyZW50X2J1ZmZlciwgbWFyayk7CisgIGludCBtID0g KFhNQVJLRVIgKG1hcmtlciktPmJ1ZmZlcikKKyAgICAgICAgICA/IFhNQVJLRVIgKG1hcmtlcikt PmNoYXJwb3MKKyAgICAgICAgICA6IC0xOworICByZXR1cm4gKG0gPT0gLTEpCisgICAgICAgICAg ID8gLTEKKyAgICAgICAgIDogKFBUIDwgbSkgPT0gYmVnaW5fcAorICAgICAgICAgICA/IFBUCisg ICAgICAgICA6IGNsaXBfdG9fYm91bmRzIChCRUdWLCB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X0ZJWE5VTSk7CisgICAgICBpZiAoKHByb3AgPSBtY19wbGlzdF9nZXQgKHBsaXN0 LCBRQ3dpZHRoKSwgUkFOR0VEX0ZJWE5VTVAgKDAsIHByb3AsIElOVF9NQVgpKQorICAgICAgICAg IHx8IChwcm9wID0gbWNfcGxpc3RfZ2V0IChwbGlzdCwgUUNyZWxhdGl2ZV93aWR0aCksCisgICAg ICAgICAgICAgIFJBTkdFRF9GSVhOVU1QICgwLCBwcm9wLCBJTlRfTUFYKSkpCisgICAgICAgIHdp ZHRoID0gWEZJWE5VTSAocHJvcCk7CisgICAgICAgIGVsc2UgaWYgKEZMT0FUUCAocHJvcCkgJiYg MCA8PSBYRkxPQVRfREFUQSAocHJvcCkKKyAgICAgICAgICAgICAgICAgJiYgWEZMT0FUX0RBVEEg KHByb3ApIDw9IElOVF9NQVgpCisgICAgICAgICAgd2lkdGggPSAoaW50KShYRkxPQVRfREFUQSAo cHJvcCkgKyAwLjUpOworICAgICAgICAgIGVsc2UgaWYgKChwcm9wID0gbWNfcGxpc3RfZ2V0IChw bGlzdCwgUUNhbGlnbl90byksCisgICAgICAgICAgICAgICAgICAgIFJBTkdFRF9GSVhOVU1QIChj b2wsIHByb3AsIGFsaWduX3RvX21heCkpKQorICAgICAgICAgICAgd2lkdGggPSBYRklYTlVNIChw cm9wKSAtIGNvbDsKKyAgICAgICAgICAgICAgZWxzZSBpZiAoRkxPQVRQIChwcm9wKSAmJiBjb2wg PD0gWEZMT0FUX0RBVEEgKHByb3ApCisgICAgICAgICAgICAgICAgICAgICAgICYmIChYRkxPQVRf REFUQSAocHJvcCkgPD0gYWxpZ25fdG9fbWF4KSkKKyAgICAgICAgICAgICAgICB3aWR0aCA9IChp bnQpKFhGTE9BVF9EQVRBIChwcm9wKSArIDAuNSkgLSBjb2w7CisgICAgICBpZiAod2lkdGggPj0g MCkKKyAgICAgICAgeworICAgICAgICAgIHB0cmRpZmZfdCBzdGFydDsKKyAgICAgICAgICBpZiAo T1ZFUkx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AgICAgICAgcHRyZGlmZl90IG9sZF9zY2FuID0gc2NhbjsKKyAgICAgICAgICAv KiBUaGlzIHVwZGF0ZXMgTkVYVF9CT1VOREFSWSB0byB0aGUgbmV4dCBwbGFjZQorICAgICAgICAg ICAgIHdoZXJlIHdlIG1pZ2h0IG5lZWQgdG8gc2tpcCBtb3JlIGludmlzaWJsZSB0ZXh0LiAqLwor ICAgICAgICAgIHNjYW4gPSBza2lwX2ludmlzaWJsZSAoc2NhbiwgJm5leHRfYm91bmRhcnksIGVu ZCwgUW5pbCk7CisgICAgICAgICAgaWYgKHNjYW4gIT0gb2xkX3NjYW4pCisgICAgICAgICAgICBz Y2FuX2J5dGUgPSBDSEFSX1RPX0JZVEUgKHNjYW4pOworICAgICAgICAgIGlmIChzY2FuID49IGVu ZCkKKyAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgfQorICAgICAgLyogVGVzdCBy ZWFjaGluZyB0aGUgZ29hbCBjb2x1bW4uICBXZSBkbyB0aGlzIGFmdGVyIHNraXBwaW5nCisgICBp bnZpc2libGUgY2hhcmFjdGVycywgc28gdGhhdCB3ZSBwdXQgcG9pbnQgYmVmb3JlIHRoZQorICAg Y2hhcmFjdGVyIG9uIHdoaWNoIHRoZSBjdXJzb3Igd2lsbCBhcHBlYXIuICovCisgICAgICBpZiAo Y29sID49IGdvYWwpCisgICAgICAgIGJyZWFrOworICAgICAgcHJldl9jb2wgPSBjb2w7CisgICAg ICB7IC8qIENoZWNrIGRpc3BsYXkgcHJvcGVydHkuICovCisgICAgICAgIHB0cmRpZmZfdCBlbmRw OworICAgICAgICBpbnQgd2lkdGggPSBtY19jaGVja19kaXNwbGF5X3dpZHRoIChzY2FuLCBjb2ws ICZlbmRwKTsKKyAgICAgICAgaWYgKHdpZHRoID49IDApCisgICAgICAgICAgeworICAgICAgICAg ICAgY29sICs9IHdpZHRoOworICAgICAgICAgICAgaWYgKGVuZHAgPiBzY2FuKSAvKiBBdm9pZCBp bmZpbml0ZSBsb29wcyB3aXRoIDAtd2lkdGggb3ZlcmxheXMuICovCisgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICBzY2FuID0gZW5kcDsKKyAgICAgICAgICAgICAgICBzY2FuX2J5dGUg PSBDSEFSX1RPX0JZVEUgKHNjYW4pOworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAg ICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgfQorICAgICAgLyogQ2hlY2sgY29tcG9zaXRp b24gc2VxdWVuY2UuICovCisgICAgICBpZiAoY21wX2l0LmlkID49IDAKKyAgICAgICAgICB8fCAo c2NhbiA9PSBjbXBfaXQuc3RvcF9wb3MKKyAgICAgICAgICAgICAgJiYgY29tcG9zaXRpb25fcmVz ZWF0X2l0ICgmY21wX2l0LCBzY2FuLCBzY2FuX2J5dGUsIGVuZCwgdywgTlVMTCwgUW5pbCkpKQor ICAgICAgICBjb21wb3NpdGlvbl91cGRhdGVfaXQgKCZjbXBfaXQsIHNjYW4sIHNjYW5fYnl0ZSwg UW5pbCk7CisgICAgICBpZiAoY21wX2l0LmlkID49IDApCisgICAgICAgIHsKKyAgICAgICAgICBz Y2FuICs9IGNtcF9pdC5uY2hhcnM7CisgICAgICAgICAgc2Nhbl9ieXRlICs9IGNtcF9pdC5uYnl0 ZXM7CisgICAgICAgICAgaWYgKHNjYW4gPD0gZW5kKQorICAgICAgICAgICAgY29sICs9IGNtcF9p dC53aWR0aDsKKyAgICAgICAgICBpZiAoY21wX2l0LnRvID09IGNtcF9pdC5uZ2x5cGhzKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBjbXBfaXQuaWQgPSAtMTsKKyAgICAgICAgICAgICAg Y29tcG9zaXRpb25fY29tcHV0ZV9zdG9wX3BvcyAoJmNtcF9pdCwgc2Nhbiwgc2Nhbl9ieXRlLCBl bmQsIFFuaWwpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICBjbXBfaXQuZnJvbSA9IGNtcF9pdC50bzsKKyAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAg fQorICAgICAgYyA9IEZFVENIX0JZVEUgKHNjYW5fYnl0ZSk7CisgICAgICAvKiBTZWUgaWYgdGhl cmUgaXMgYSBkaXNwbGF5IHRhYmxlIGFuZCBpdCByZWxhdGVzIHRvIHRoaXMgY2hhcmFjdGVyLiAq LworICAgICAgaWYgKGRwICE9IDAKKyAgICAgICAgICAmJiAhIChtdWx0aWJ5dGUgJiYgTEVBRElO R19DT0RFX1AgKGMpKQorICAgICAgICAgICYmIFZFQ1RPUlAgKERJU1BfQ0hBUl9WRUNUT1IgKGRw LCBjKSkpCisgICAgICAgIHsKKyAgICAgICAgICBMaXNwX09iamVjdCBjaGFydmVjOworICAgICAg ICAgIHB0cmRpZmZfdCBpLCBuOworICAgICAgICAgIC8qIFRoaXMgY2hhcmFjdGVyIGlzIGRpc3Bs YXllZCB1c2luZyBhIHZlY3RvciBvZiBnbHlwaHMuCisgICAgICAgICAgICAgVXBkYXRlIHRoZSBj b2x1bW4vcG9zaXRpb24gYmFzZWQgb24gdGhvc2UgZ2x5cGhzLiAqLworICAgICAgICAgIGNoYXJ2 ZWMgPSBESVNQX0NIQVJfVkVDVE9SIChkcCwgYyk7CisgICAgICAgICAgbiA9IEFTSVpFIChjaGFy dmVjKTsKKyAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbjsgaSsrKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICAvKiBUaGlzIHNob3VsZCBiZSBoYW5kbGVkIHRoZSBzYW1lIGFzCisgICAg ICAgICAgICAgIG5leHRfZWxlbWVudF9mcm9tX2Rpc3BsYXlfdmVjdG9yIGRvZXMgaXQuICovCisg ICAgICAgICAgICAgIExpc3BfT2JqZWN0IGVudHJ5ID0gQVJFRiAoY2hhcnZlYywgaSk7CisgICAg ICAgICAgICAgIGlmIChHTFlQSF9DT0RFX1AgKGVudHJ5KSkKKyAgICAgICAgICAgICAgICBjID0g R0xZUEhfQ09ERV9DSEFSIChlbnRyeSk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICBjID0gJyAnOworICAgICAgICAgICAgICBpZiAoYyA9PSAnXG4nKQorICAgICAgICAgICAg ICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgICAgaWYgKGMgPT0gJ1xyJyAmJiBFUSAoQlZB UiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKQorICAgICAgICAgICAg ICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgICAgaWYgKGMgPT0gJ1x0JykKKyAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICBjb2wgKz0gdGFiX3dpZHRoOworICAgICAgICAg ICAgICAgICAgY29sID0gY29sIC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOworICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICArK2NvbDsKKyAg ICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAg ICAgICAgLyogVGhlIGRpc3BsYXkgdGFibGUgZG9lc24ndCBhZmZlY3QgdGhpcyBjaGFyYWN0ZXI7 CisgICAgICAgICAgICAgICBpdCBkaXNwbGF5cyBhcyBpdHNlbGYuICovCisgICAgICAgICAgICBp ZiAoYyA9PSAnXG4nKQorICAgICAgICAgICAgICBnb3RvIGVuZGxvb3A7CisgICAgICAgICAgICBp ZiAoYyA9PSAnXHInICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rpc3Bs YXkpLCBRdCkpCisgICAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgIGlmIChj ID09ICdcdCcpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjb2wgKz0gdGFiX3dp ZHRoOworICAgICAgICAgICAgICAgIGNvbCA9IGNvbCAvIHRhYl93aWR0aCAqIHRhYl93aWR0aDsK KyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChtdWx0aWJ5dGUgJiYgTEVB RElOR19DT0RFX1AgKGMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8q IFN0YXJ0IG9mIG11bHRpLWJ5dGUgZm9ybS4gKi8KKyAgICAgICAgICAgICAgICAgIHVuc2lnbmVk IGNoYXIgKnB0cjsKKyAgICAgICAgICAgICAgICAgIGludCBieXRlcywgd2lkdGg7CisgICAgICAg ICAgICAgICAgICBwdHIgPSBCWVRFX1BPU19BRERSIChzY2FuX2J5dGUpOworICAgICAgICAgICAg ICAgICAgTUNfTVVMVElCWVRFX0JZVEVTX1dJRFRIIChwdHIsIGRwLCBieXRlcywgd2lkdGgpOwor ICAgICAgICAgICAgICAgICAgLyogU3VidHJhY3Qgb25lIHRvIGNvbXBlbnNhdGUgZm9yIHRoZSBp bmNyZW1lbnQKKyAgICAgICAgICAgICAgICAgIHRoYXQgaXMgZ29pbmcgdG8gaGFwcGVuIGJlbG93 LiAqLworICAgICAgICAgICAgICAgICAgc2Nhbl9ieXRlICs9IGJ5dGVzIC0gMTsKKyAgICAgICAg ICAgICAgICAgIGNvbCArPSB3aWR0aDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg ICAgZWxzZSBpZiAoY3RsX2Fycm93ICYmIChjIDwgMDQwIHx8IGMgPT0gMDE3NykpCisgICAgICAg ICAgICAgICAgICBjb2wgKz0gMjsKKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGMgPCAwNDAg fHwgYyA+PSAwMTc3KQorICAgICAgICAgICAgICAgICAgICBjb2wgKz0gNDsKKyAgICAgICAgICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgIGNvbCsrOworICAgICAgICAgIH0K KyAgICAgIHNjYW4rKzsKKyAgICAgIHNjYW5fYnl0ZSsrOworICAgIH0KKyB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W5fZm9yX2NvbHVtbiAoJnB0 LCAmY29sLCBOVUxMLCBwdCk7CisgICAgICB7CisgICAgICAgIGlmIChvbGRfYnVmZmVyKQorICAg ICAgICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworICAgICAgICByZXR1cm4g Y29sOworICAgICAgfQorICAgIH0KKyAgLyogU2NhbiBiYWNrd2FyZHMgZnJvbSBwb2ludCB0byB0 aGUgcHJldmlvdXMgbmV3bGluZSwKKyAgICAgY291bnRpbmcgd2lkdGguICBUYWIgY2hhcmFjdGVy cyBhcmUgdGhlIG9ubHkgY29tcGxpY2F0ZWQgY2FzZS4gKi8KKyAgLyogTWFrZSBhIHBvaW50ZXIg Zm9yIGRlY3JlbWVudGluZyB0aHJvdWdoIHRoZSBjaGFycyBiZWZvcmUgcG9pbnQuICovCisgIHB0 ciA9IEJZVEVfUE9TX0FERFIgKENIQVJfVE9fQllURSAocHQpIC0gMSkgKyAxOworICAvKiBNYWtl IGEgcG9pbnRlciB0byB3aGVyZSBjb25zZWN1dGl2ZSBjaGFycyBsZWF2ZSBvZmYsCisgICAgIGdv aW5nIGJhY2t3YXJkcyBmcm9tIHBvaW50LiAqLworICBpZiAocHQgPT0gQkVHVikKKyAgICBzdG9w ID0gcHRyOworICAgIGVsc2UgaWYgKHB0IDw9IEdQVCB8fCBCRUdWID4gR1BUKQorICAgICAgc3Rv cCA9IEJFR1ZfQUREUjsKKyAgICAgIGVsc2UKKyAgICAgICAgc3RvcCA9IEdBUF9FTkRfQUREUjsK KyAgY29sID0gMCwgdGFiX3NlZW4gPSAwLCBwb3N0X3RhYiA9IDA7CisgIHdoaWxlICgxKQorICAg IHsKKyAgICAgIHB0cmRpZmZfdCBpLCBuOworICAgICAgTGlzcF9PYmplY3QgY2hhcnZlYzsKKyAg ICAgIGlmIChwdHIgPT0gc3RvcCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFdlIHN0b3BwZWQg ZWl0aGVyIGZvciB0aGUgYmVnaW5uaW5nIG9mIHRoZSBidWZmZXIKKyAgICAgICAgICAgICBvciBm b3IgdGhlIGdhcC4gKi8KKyAgICAgICAgICBpZiAocHRyID09IEJFR1ZfQUREUikKKyAgICAgICAg ICAgIGJyZWFrOworICAgICAgICAgIC8qIEl0IHdhcyB0aGUgZ2FwLiAgSnVtcCBiYWNrIG92ZXIg aXQuICovCisgICAgICAgICAgc3RvcCA9IEJFR1ZfQUREUjsKKyAgICAgICAgICBwdHIgPSBHUFRf QUREUjsKKyAgICAgICAgICAvKiBDaGVjayB3aGV0aGVyIHRoYXQgYnJpbmdzIHVzIHRvIGJlZ2lu bmluZyBvZiBidWZmZXIuICovCisgICAgICAgICAgaWYgKEJFR1YgPj0gR1BUKQorICAgICAgICAg ICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGMgPSAqLS1wdHI7CisgICAgICBpZiAoZHAgJiYg VkVDVE9SUCAoRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpKSkKKyAgICAgICAgeworICAgICAgICAg IGNoYXJ2ZWMgPSBESVNQX0NIQVJfVkVDVE9SIChkcCwgYyk7CisgICAgICAgICAgbiA9IEFTSVpF IChjaGFydmVjKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAg ICAgICAgY2hhcnZlYyA9IFFuaWw7CisgICAgICAgICAgICBuID0gMTsKKyAgICAgICAgICB9Cisg ICAgICBmb3IgKGkgPSBuIC0gMTsgaSA+PSAwOyAtLWkpCisgICAgICAgIHsKKyAgICAgICAgICBp ZiAoVkVDVE9SUCAoY2hhcnZlYykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIFRo aXMgc2hvdWxkIGJlIGhhbmRsZWQgdGhlIHNhbWUgYXMKKyAgICAgICAgICAgbmV4dF9lbGVtZW50 X2Zyb21fZGlzcGxheV92ZWN0b3IgZG9lcyBpdC4gKi8KKyAgICAgICAgICAgICAgTGlzcF9PYmpl Y3QgZW50cnkgPSBBUkVGIChjaGFydmVjLCBpKTsKKyAgICAgICAgICAgICAgaWYgKEdMWVBIX0NP REVfUCAoZW50cnkpKQorICAgICAgICAgICAgICAgIGMgPSBHTFlQSF9DT0RFX0NIQVIgKGVudHJ5 KTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjID0gJyAnOworICAg ICAgICAgICAgfQorICAgICAgICAgIGlmIChjID49IDA0MCAmJiBjIDwgMDE3NykKKyAgICAgICAg ICAgIGNvbCsrOworICAgICAgICAgICAgZWxzZSBpZiAoYyA9PSAnXG4nCisgICAgICAgICAgICAg ICAgICAgICB8fCAoYyA9PSAnXHInCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgRVEgKEJW QVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVfZGlzcGxheSksIFF0KSkpCisgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICBwdHIrKzsKKyAgICAgICAgICAgICAgICBnb3RvIHN0YXJ0 X29mX2xpbmVfZm91bmQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZSBpZiAo YyA9PSAnXHQnKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmICh0YWJf c2VlbikKKyAgICAgICAgICAgICAgICAgICAgY29sID0gKChjb2wgKyB0YWJfd2lkdGgpIC8gdGFi X3dpZHRoKSAqIHRhYl93aWR0aDsKKyAgICAgICAgICAgICAgICAgIHBvc3RfdGFiICs9IGNvbDsK KyAgICAgICAgICAgICAgICAgIGNvbCA9IDA7CisgICAgICAgICAgICAgICAgICB0YWJfc2VlbiA9 IDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKFZFQ1RPUlAg KGNoYXJ2ZWMpKQorICAgICAgICAgICAgICAgICAgLyogV2l0aCBhIGRpc3BsYXkgdGFibGUgZW50 cnksIEMgaXMgZGlzcGxheWVkIGFzIGlzLCBhbmQKKyAgICAgICAgICAgICAgICAgICAgIG5vdCBk aXNwbGF5ZWQgYXMgXE5OTiBvciBhcyBeTi4gIElmIEMgaXMgYSBzaW5nbGUtYnl0ZQorICAgICAg ICAgICAgICAgICAgICAgY2hhcmFjdGVyLCBpdCB0YWtlcyBvbmUgY29sdW1uLiAgSWYgQyBpcyBt dWx0aS1ieXRlIGluCisgICAgICAgICAgICAgICAgICAgICBhIHVuaWJ5dGUgYnVmZmVyLCBpdCdz IHRyYW5zbGF0ZWQgdG8gdW5pYnl0ZSwgc28gaXQKKyAgICAgICAgICAgICAgICAgICAgIGFsc28g dGFrZXMgb25lIGNvbHVtbi4gKi8KKyAgICAgICAgICAgICAgICAgICsrY29sOworICAgICAgICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICBjb2wgKz0gKGN0bF9hcnJvdyAmJiBj IDwgMDIwMCkgPyAyIDogNDsKKyAgICAgICAgfQorICAgIH0KKyBzdGFydF9vZl9saW5lX2ZvdW5k OgorICBpZiAodGFiX3NlZW4pCisgICAgeworICAgICAgY29sID0gKChjb2wgKyB0YWJfd2lkdGgp IC8gdGFiX3dpZHRoKSAqIHRhYl93aWR0aDsKKyAgICAgIGNvbCArPSBwb3N0X3RhYjsKKyAgICB9 CisgIGxhc3Rfa25vd25fY29sdW1uID0gY29sOworICBsYXN0X2tub3duX2NvbHVtbl9wb2ludCA9 IHB0OworICBsYXN0X2tub3duX2NvbHVtbl9tb2RpZmllZCA9IE1PRElGRjsKKyAgaWYgKG9sZF9i dWZmZXIpCisgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisgIHJldHVybiBj b2w7Cit9CisKK0RFRlVOICgibWMtY3VycmVudC1jb2x1bW4iLCBGbWNfY3VycmVudF9jb2x1bW4s IFNtY19jdXJyZW50X2NvbHVtbiwgMiwgMiwgMCwKKyAgICAgICBkb2M6IC8qIFJldHVybiB0aGUg aG9yaXpvbnRhbCBwb3NpdGlvbiBvZiBwb2ludC4gIEJlZ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IFhTRVRGQVNUSU5UICh0ZW1wLCBt Y19jdXJyZW50X2NvbHVtbiAodywgWEZJWE5VTSAocHQpKSk7CisgIHJldHVybiB0ZW1wOworfQor CisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIkZSQU1FICglcykiLCBtY19mcmFtZSAoZikp OyAqLworY2hhciAqCittY19mcmFtZSAoc3RydWN0IGZyYW1lICpmKQoreworICBMaXNwX09iamVj dCBmcmFtZTsKKyAgWFNFVEZSQU1FIChmcmFtZSwgZik7CisgIHJldHVybiBTU0RBVEEgKEZwcmlu MV90b19zdHJpbmcgKGZyYW1lLCBRbmlsKSk7Cit9CisKKy8qIFVTQUdFOiAgZnByaW50ZiAoc3Rk ZXJyLCAiV0lORE9XICglcykiLCBtY193aW5kb3cgKHcpKTsgKi8KK2NoYXIgKgorbWNfd2luZG93 IChzdHJ1Y3Qgd2luZG93ICp3KQoreworICBMaXNwX09iamVjdCB3aW5kb3c7CisgIFhTRVRXSU5E T1cgKHdpbmRvdywgdyk7CisgIHJldHVybiBTU0RBVEEgKEZwcmluMV90b19zdHJpbmcgKHdpbmRv dywgUW5pbCkpOworfQorCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIkNIQVJBQ1RFUiAo JXMpIiwgbWNfY2hhcl90b19zdHJpbmcgKGdseXBoLT51LmNoKSk7ICovCitjaGFyICoKK21jX2No YXJfdG9fc3RyaW5nIChpbnQgYXJnKQoreworICBMaXNwX09iamVjdCBjaGFyYWN0ZXIgPSAoMCA8 PSBhcmcgJiYgYXJnIDw9IE1BWF9DSEFSKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBG Y2hhcl90b19zdHJpbmcgKG1ha2VfZml4bnVtIChhcmcpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBRbmlsOworICBjaGFyICogcmVzdWx0ID0gKCFOSUxQIChjaGFyYWN0ZXIpCisgICAg ICAgICAgICAgICAgICAgJiYgYXJnID09IDkpCisgICAgICAgICAgICAgICAgICAgID8gIlxcdCIK KyAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAg ICAgICAmJiBhcmcgPT0gMTApCisgICAgICAgICAgICAgICAgICAgID8gIlxcbiIKKyAgICAgICAg ICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAgICAmJiBh cmcgPT0gMzIpCisgICAgICAgICAgICAgICAgICAgID8gIlxccyIKKyAgICAgICAgICAgICAgICAg IDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAgICAmJiBhcmcgIT0gOQor ICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9IDEwCisgICAgICAgICAgICAgICAgICAgICAm JiBhcmcgIT0gMzIpCisgICAgICAgICAgICAgICAgICAgID8gU1NEQVRBIChjaGFyYWN0ZXIpCisg ICAgICAgICAgICAgICAgICA6ICJcXD8iOworICByZXR1cm4gcmVzdWx0OworfQorCitpbnQKK21j X2xpc3BfdG9fY3Vyc29yX3R5cGUgKExpc3BfT2JqZWN0IGFyZykKK3sKKyAgY2hhciAqc3RyOwor ICBpZiAoWFRZUEUgKGFyZykgPT0gTGlzcF9TdHJpbmcpCisgICAgc3RyID0gU1NEQVRBIChhcmcp OworICAgIGVsc2UgaWYgKFhUWVBFIChhcmcpID09IExpc3BfU3ltYm9sKQorICAgICAgc3RyID0g U1NEQVRBIChTWU1CT0xfTkFNRSAoYXJnKSk7CisgICAgICBlbHNlIHJldHVybiAtMTsKKyAgaWYg KCFzdHJjbXAgKHN0ciwgIm5vIikpCisgICAgcmV0dXJuIE1DX05PX0NVUlNPUjsKKyAgaWYgKCFz dHJjbXAgKHN0ciwgIm1jLWxlZnQtZnJpbmdlLWJpdG1hcCIpKQorICAgIHJldHVybiBNQ19MRUZU X0ZSSU5HRV9CSVRNQVA7CisgIGlmICghc3RyY21wIChzdHIsICJtYy1yaWdodC1mcmluZ2UtYml0 bWFwIikpCisgICAgcmV0dXJuIE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA7CisgIGlmICghc3RyY21w IChzdHIsICJib3giKSkKKyAgICByZXR1cm4gTUNfRklMTEVEX0JPWDsKKyAgaWYgKCFzdHJjbXAg KHN0ciwgImZyYW1lZCIpKQorICAgIHJldHVybiBNQ19GUkFNRURfQk9YOworICBpZiAoIXN0cmNt cCAoc3RyLCAiaG9sbG93IikpCisgICAgcmV0dXJuIE1DX0hPTExPV19CT1g7CisgIGlmICghc3Ry Y21wIChzdHIsICJiYXIiKSkKKyAgICByZXR1cm4gTUNfQkFSOworICBpZiAoIXN0cmNtcCAoc3Ry LCAiaGJhciIpKQorICAgIHJldHVybiBNQ19IQkFSOworICByZXR1cm4gLTE7Cit9CisKKy8qIFVT QUdFOiAgZnByaW50ZiAoc3RkZXJyLCAiQ1VSU09SIFRZUEUgKCVzKSIsIG1jX2N1cnNvcl90eXBl X3RvX3N0cmluZyAoYXJnKSk7ICovCitjaGFyICoKK21jX2N1cnNvcl90eXBlX3RvX3N0cmluZyAo ZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSkKK3sKKyAgc3dpdGNoIChjdXJzb3JfdHlw ZSkKKyAgICB7CisgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6IHJldHVybiAiTUNfRklMTEVEX0JP WCI7CisgICAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6IHJldHVybiAiTUNfRlJBTUVEX0JPWCI7Cisg ICAgICBjYXNlIE1DX0hPTExPV19CT1g6IHJldHVybiAiTUNfSE9MTE9XX0JPWCI7CisgICAgICBj YXNlIE1DX0JBUjogcmV0dXJuICJNQ19CQVIiOworICAgICAgY2FzZSBNQ19IQkFSOiByZXR1cm4g Ik1DX0hCQVIiOworICAgICAgY2FzZSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA6IHJldHVybiAiTUNf TEVGVF9GUklOR0VfQklUTUFQIjsKKyAgICAgIGNhc2UgTUNfUklH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05F OiByZXR1cm4gIlNDUklCRV9PTkUiOworICAgICAgY2FzZSBTQ1JJQkVfVFdPOiByZXR1cm4gIlND UklCRV9UV08iOworICAgICAgY2FzZSBTQ1JJQkVfVEhSRUU6IHJldHVybiAiU0NSSUJFX1RIUkVF IjsKKyAgICAgIGNhc2UgU0tJUFBFRDogcmV0dXJuICJTS0lQUEVEIjsKKyAgICAgIGNhc2UgUE9T VF9DSEFOR0VEOiByZXR1cm4gIlBPU1RfQ0hBTkdFRCI7CisgICAgICBjYXNlIFVOQ0hBTkdFRDog cmV0dXJuICJVTkNIQU5HRUQiOworICAgICAgY2FzZSBTRVRfQ1VSU09SX09ORTogcmV0dXJuICJT RVRfQ1VSU09SX09ORSI7CisgICAgICBjYXNlIFNFVF9DVVJTT1JfVFdPOiByZXR1cm4gIlNFVF9D VVJTT1JfVFdPIjsKKyAgICAgIGRlZmF1bHQ6CisgICAgICByZXR1cm4gIlVOS05PV04iOworICAg IH0KK30KKworLyogVVNBR0U6ICBmcHJpbnRmIChzdGRlcnIsICJGUk9NX1dIRVJFICglcykiLCBt Y19kcmF3X3Jvd190eXBlX3RvX3N0cmluZyAoYXJnKSk7ICovCitjaGFyICoKK21jX3JlZHJhd19y b3dfdHlwZV90b19zdHJpbmcgKGVudW0gbWNfcmVkcmF3X3Jvd190eXBlIGZyb21fd2hlcmUpCit7 CisgIHN3aXRjaCAoZnJvbV93aGVyZSkKKyAgICB7CisgICAgICBjYXNlIFVQREFURV9XSU5ET1df X1JFRFJBV19PVkVSTEFQUEVEX1JPV1M6IHJldHVybiAiVVBEQVRFX1dJTkRPV19fUkVEUkFXX09W RVJMQVBQRURfUk9XUyI7CisgICAgICBjYXNlIFhfSU5TRVJUX0dMWVBIUzogcmV0dXJuICJYX0lO U0VSVF9HTFlQSFMiOworICAgICAgY2FzZSBYX0ZJWF9PVkVSTEFQUElOR19BUkVBOiByZXR1cm4g IlhfRklYX09WRVJMQVBQSU5HX0FSRUEiOworICAgICAgY2FzZSBEUkFXX1JPV19XSVRIX01PVVNF X0ZBQ0U6IHJldHVybiAiRFJBV19ST1dfV0lUSF9NT1VTRV9GQUNFIjsKKyAgICAgIGNhc2UgRVhQ T1NFX0FSRUFfT05FOiByZXR1cm4gIkVYUE9TRV9BUkVBX09ORSI7CisgICAgICBjYXNlIEVYUE9T RV9BUkVBX1RXTzogcmV0dXJuICJFWFBPU0VfQVJFQV9UV08iOworICAgICAgY2FzZSBFWFBPU0Vf TElORTogcmV0dXJuICJFWFBPU0VfTElORSI7CisgICAgICBkZWZhdWx0OgorICAgICAgcmV0dXJu ICJVTktOT1dOIjsKKyAgICB9Cit9CisKK3ZvaWQKK21jX2NhY2hlX2luc3BlY3RvciAoc3RydWN0 IHdpbmRvdyAqdywgc3RydWN0IG1jX21hdHJpeCBtYXRyaXgpCit7CisgIGludCB2cG9zX2FsbG9j YXRlZCA9IHctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZDsKKyAgaW50IHZwb3NfdXNlZCA9IHct Pm1jX21hdHJpeC52cG9zX3VzZWQ7CisgIGZwcmludGYgKHN0ZGVyciwgIiVzOiAgbWF0cml4LnZw b3NfYWxsb2NhdGVkICglZCkgfCBtYXRyaXgudnBvc191c2VkICglZClcbiIsCisgICAgICAgICAg ICAgICAgICAgbWNfd2luZG93ICh3KSwgdnBvc19hbGxvY2F0ZWQsIHZwb3NfdXNlZCk7CisgIGZv ciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICBjYWNo ZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGlu dCBjdXJzb3JzX3VzZWQgPSB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdOwor ICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICBtYXRyaXguY3Vyc29yc191c2VkWyVzXSAoJWQpXG4i LAorICAgICAgICAgICAgICAgICAgICAgICBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAoY2FjaGVf dHlwZSksIGN1cnNvcnNfdXNlZCk7CisgICAgfQorICBmb3IgKGludCB2bnRoID0gMDsKKyAgICAg ICB2bnRoIDwgdy0+bWNfbWF0cml4LnZwb3NfdXNlZDsKKyAgICAgICArK3ZudGgpCisgICAgewor ICAgICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAg ICAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgICAgICsrY2FjaGVfdHlwZSkK KyAgICAgICAgeworICAgICAgICAgIGludCBjYWNoZV9hbGxvY2F0ZWQgPSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgaW50IGNh Y2hlX3VzZWQgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVd OworICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgICB2bnRoICglZCkgfCBjYWNoZV9hbGxv Y2F0ZWRbJXNdICglZCkgfCBjYWNoZV91c2VkWyVzXSAoJWQpXG4iLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgdm50aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2NhY2hlX3R5 cGVfdG9fc3RyaW5nIChjYWNoZV90eXBlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGNh Y2hlX2FsbG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2NhY2hlX3R5cGVf dG9fc3RyaW5nIChjYWNoZV90eXBlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhY2hl X3VzZWQpOworICAgICAgICB9CisgICAgfQorfQorCit2b2lkCittY19zZXRfbHNsX2JnIChzdHJ1 Y3Qgd2luZG93ICp3LCBlbnVtIGZhY2Vfa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NjbF94ID0gdy0+ aHNjcm9sbCAqIGZyYW1lX2NoYXJfd2lkdGg7CisgIGlmIChiICE9IGN1cnJlbnRfYnVmZmVyKQor ICAgIHsKKyAgICAgIG9sZF9idWZmZXIgPSBjdXJyZW50X2J1ZmZlcjsKKyAgICAgIHNldF9idWZm ZXJfaW50ZXJuYWwgKGIpOworICAgIH0KKyAgZXNzZW50aWFscy0+enYgPSBaVjsKKyAgZXNzZW50 aWFscy0+enZfYnl0ZSA9IFpWX0JZVEU7CisgIGVzc2VudGlhbHMtPmZjX3ggPSAoZmlsbF9jb2x1 bW5fcAorICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChWZGlzcGxheV9saW5lX251bWJl cnMpKQorICAgICAgICAgICAgICAgICAgICAgICA/IChmaWxsX2NvbCAqIGZyYW1lX2NoYXJfd2lk dGgpICsgdy0+bWMubG51bV9waXhlbF93aWR0aCAtIGhzY2xfeAorICAgICAgICAgICAgICAgICAg ICAgOiAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgTklMUCAoVmRp c3BsYXlfbGluZV9udW1iZXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgPyAoZmlsbF9jb2wg KiBmcmFtZV9jaGFyX3dpZHRoKSAtIGhzY2xfeAorICAgICAgICAgICAgICAgICAgICAgOiAwOwor ICBpZiAob2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsK KyAgZW51bSBmYWNlX2lkIGZpbGxfY29sdW1uX3ByZV96dl9mYWNlX2lkID0KKyAgICAoIWVzc2Vu dGlhbHMtPmFjdGl2ZV9wCisgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVybiAoImZjLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAgOiAoIWVz c2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgZmNfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgJiYgIU5JTFAgKEJWQVIg KGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAmJiB3LT5jdXJzb3IueCA9PSBlc3NlbnRp YWxzLT5mY194KQorICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiZmMt b3BvaW50LWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAgOiAoZXNzZW50aWFscy0+ YWN0aXZlX3AKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj cm9zc2hhaXJzKSkKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIp KQorICAgICAgICYmIHctPmN1cnNvci54ID09IGVzc2VudGlhbHMtPmZjX3gpCisgICAgICA/IGxv b2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1vcG9pbnQtcHJlLXp2LWZhY2UiKSwg dHJ1ZSkKKyAgICA6ICghZXNzZW50aWFscy0+YWN0aXZlX3AKKyAgICAgICAmJiAhTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY19pbmFjdGl2ZV93aW5kb3dzKSkKKyAgICAgICAm JiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAg ICAmJiAhTklMUCAoQlZBUiAoYiwgY2hf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gICBzdHJ1Y3QgZmFjZSAqYmV5b25kX2ZpbGxfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwg YmV5b25kX2ZpbGxfZmFjZV9pZCk7CisgICAgICBMaXNwX09iamVjdCBiZXlvbmRfZmlsbF9jb2xv ciA9IGJleW9uZF9maWxsX2ZhY2UtPmxmYWNlW0xGQUNFX0ZPUkVHUk9VTkRfSU5ERVhdOworICAg ICAgc3RydWN0IG1jX1JHQiBiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kOworICAgICAgbWNfeHdfY29s b3JfdmFsdWVzICh3LCBiZXlvbmRfZmlsbF9jb2xvciwgJmJleW9uZF9maWxsX2ZvcmVncm91bmQp OworICAgICAgLyogcmVkICovCisgICAgICBpZiAoKCFmaWxsX2NvbHVtbl9wCisgICAgICAgICAg ICYmIGN1cnJlbnRfY29sICUgMiAhPSAwCisgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQ UkVfWlYpCisgICAgICAgICAgfHwgKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgJiYgY3Vy cmVudF9jb2wgJSAyICE9IDAKKyAgICAgICAgICAgICAgJiYgY3VycmVudF9jb2wgPD0gZmlsbF9j b2wKKyAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikpCisgICAgICAgIHsK KyAgICAgICAgICBsc2xfZmctPnJlZCA9IG9kZF9mb3JlZ3JvdW5kLnJlZDsKKyAgICAgICAgICBs c2xfZmctPmdyZWVuID0gb2RkX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAgbHNsX2ZnLT5i bHVlID0gb2RkX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgfQorICAgICAgICAvKiB5ZWxsb3cg Ki8KKyAgICAgICAgZWxzZSBpZiAoKCFmaWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgICAgICAm JiBjdXJyZW50X2NvbCAlIDIgPT0gMAorICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9u ID09IFBSRV9aVikKKyAgICAgICAgICAgICAgICAgfHwgKGZpbGxfY29sdW1uX3AKKyAgICAgICAg ICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sICUgMiA9PSAwCisgICAgICAgICAgICAgICAgICAg ICAmJiBjdXJyZW50X2NvbCA8PSBmaWxsX2NvbAorICAgICAgICAgICAgICAgICAgICAgJiYgcm93 X3Bvc2l0aW9uID09IFBSRV9aVikpCisgICAgICAgICAgeworICAgICAgICAgICAgbHNsX2ZnLT5y ZWQgPSBldmVuX2ZvcmVncm91bmQucmVkOworICAgICAgICAgICAgbHNsX2ZnLT5ncmVlbiA9IGV2 ZW5fZm9yZWdyb3VuZC5ncmVlbjsKKyAgICAgICAgICAgIGxzbF9mZy0+Ymx1ZSA9IGV2ZW5fZm9y ZWdyb3VuZC5ibHVlOworICAgICAgICAgIH0KKyAgICAgICAgICAvKiBncmVlbiAqLworICAgICAg ICAgIGVsc2UgaWYgKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICAmJiBjdXJyZW50 X2NvbCA+IGZpbGxfY29sCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBS RV9aVikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbHNsX2ZnLT5yZWQgPSBiZXlvbmRf ZmlsbF9mb3JlZ3JvdW5kLnJlZDsKKyAgICAgICAgICAgICAgbHNsX2ZnLT5ncmVlbiA9IGJleW9u ZF9maWxsX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAgICAgIGxzbF9mZy0+Ymx1ZSA9IGJl eW9uZF9maWxsX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVs c2UgaWYgKHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgIGxzbF9mZy0+cmVkID0gZXNzZW50aWFscy5zcF9mZy5yZWQ7CisgICAgICAgICAgICAg ICAgbHNsX2ZnLT5ncmVlbiA9IGVzc2VudGlhbHMuc3BfZmcuZ3JlZW47CisgICAgICAgICAgICAg ICAgbHNsX2ZnLT5ibHVlID0gZXNzZW50aWFscy5zcF9mZy5ibHVlOworICAgICAgICAgICAgICB9 CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBIT1JJWk9OVEFMX1JVTEVSOgorICAgIHsK KyAgICAgIGlmIChnbHlwaCAhPSBOVUxMCisgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPT0gOTUK KyAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19IQkFSKQorICAgICAgICB7CisgICAgICAg ICAgbHNsX2ZnLT5yZWQgPSBlc3NlbnRpYWxzLnNwX2ZnLnJlZDsKKyAgICAgICAgICBsc2xfZmct PmdyZWVuID0gZXNzZW50aWFscy5zcF9mZy5ncmVlbjsKKyAgICAgICAgICBsc2xfZmctPmJsdWUg PSBlc3NlbnRpYWxzLnNwX2ZnLmJsdWU7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAg ICAgIHsKKyAgICAgICAgICAgIGxzbF9mZy0+cmVkID0gZXNzZW50aWFscy5jaF9mZ1tyb3dfcG9z aXRpb25dLnJlZDsKKyAgICAgICAgICAgIGxzbF9mZy0+Z3JlZW4gPSBlc3NlbnRpYWxzLmNoX2Zn W3Jvd19wb3NpdGlvbl0uZ3JlZW47CisgICAgICAgICAgICBsc2xfZmctPmJsdWUgPSBlc3NlbnRp YWxzLmNoX2ZnW3Jvd19wb3NpdGlvbl0uYmx1ZTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsK KyAgICB9CisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBsc2xfZmctPnJl ZCA9IGVzc2VudGlhbHMuY2hfZmdbcm93X3Bvc2l0aW9uXS5yZWQ7CisgICAgICBsc2xfZmctPmdy ZWVuID0gZXNzZW50aWFscy5jaF9mZ1tyb3dfcG9zaXRpb25dLmdyZWVuOworICAgICAgbHNsX2Zn LT5ibHVlID0gZXNzZW50aWFscy5jaF9mZ1tyb3dfcG9zaXRpb25dLmJsdWU7CisgICAgICBicmVh azsKKyAgICB9CisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7CisgICAgICBsc2xfZmctPnJl ZCA9IGVzc2VudGlhbHMuZmNfZmdbcm93X3Bvc2l0aW9uXS5yZWQ7CisgICAgICBsc2xfZmctPmdy ZWVuID0gZXNzZW50aWFscy5mY19mZ1tyb3dfcG9zaXRpb25dLmdyZWVuOworICAgICAgbHNsX2Zn LT5ibHVlID0gZXNzZW50aWFscy5mY19mZ1tyb3dfcG9zaXRpb25dLmJsdWU7CisgICAgICBicmVh azsKKyAgICB9CisgICAgY2FzZSBDVVJTT1JfSU5ESUNBVE9SOgorICAgIHsKKyAgICAgIHN0cnVj dCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICAgICAgZW51bSBmYWNlX2lkIGN1cnNv cl9mYWNlX2lkID0KKyAgICAgICAgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAmJiAh TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkK KyAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpCisgICAgICAgICAgPyBsb29rdXBf bmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXBy ZS16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAg ICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikKKyAgICAgICAgICA/IGxvb2t1cF9uYW1l ZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwg dHJ1ZSkKKyAgICAgICAgOiAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgJiYgIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVfd2luZG93cykpCisg ICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAgICAgID8gbG9va3Vw X25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1h dC16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAg ICAgICAgJiYgcm93X3Bvc2l0aW9uID09IEFUX1pWKQorICAgICAgICAgID8gbG9va3VwX25hbWVk X2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1hdC16di1mYWNlIiksIHRy dWUpCisgICAgICAgIDogbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1m YWtlLWN1cnNvci1hdC16di1mYWNlIiksIHRydWUpOworICAgICAgc3RydWN0IGZhY2UgKmN1cnNv cl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBjdXJzb3JfZmFjZV9pZCk7CisgICAgICBMaXNwX09i amVjdCBjdXJzb3JfY29sb3IgPSBjdXJzb3JfZmFjZS0+bGZhY2VbTEZBQ0VfRk9SRUdST1VORF9J TkRFWF07CisgICAgICBtY194d19jb2xvcl92YWx1ZXMgKHcsIGN1cnNvcl9jb2xvciwgbHNsX2Zn KTsKKyAgICAgIGJyZWFrOworICAgIH0KKyAgfQorfQorCisvKiBEcmF3IGdseXBocyBiZXR3ZWVu IFNUQVJUIGFuZCBFTkQgaW4gQVJFQSBvZiBST1cgb24gd2luZG93IFcsCisgICBzdGFydGluZyBh dCB4LXBvc2l0aW9uIFguICBYIGlzIHJlbGF0aXZlIHRvIEFSRUEgaW4gVy4gIEhMIGlzIGEKK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ZXJsYXBzICYmIHJvdy0+Y29udGFpbnNfb3ZlcmxhcHBpbmdfZ2x5cGhzX3Ap CisgICAgeworICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqaCwgKnQ7CisgICAgICBNb3VzZV9I TEluZm8gKmhsaW5mbyA9IE1PVVNFX0hMX0lORk8gKGYpOworICAgICAgaW50IG1vdXNlX2JlZ19j b2wgVU5JTklULCBtb3VzZV9lbmRfY29sIFVOSU5JVDsKKyAgICAgIGJvb2wgY2hlY2tfbW91c2Vf ZmFjZSA9IGZhbHNlOworICAgICAgaW50IGR1bW15X3ggPSAwOworICAgICAgLyogSWYgbW91c2Ug aGlnaGxpZ2h0aW5nIGlzIG9uLCB3ZSBtYXkgbmVlZCB0byBkcmF3IGFkamFjZW50CisgICBnbHlw aHMgdXNpbmcgbW91c2UtZmFjZSBoaWdobGlnaHRpbmcuICovCisgICAgICBpZiAoYXJlYSA9PSBU RVhUX0FSRUEgJiYgcm93LT5tb3VzZV9mYWNlX3AKKyAgICAgICAgICAmJiBobGluZm8tPm1vdXNl X2ZhY2VfYmVnX3JvdyA+PSAwCisgICAgICAgICAgJiYgaGxpbmZvLT5tb3VzZV9mYWNlX2VuZF9y b3cgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIHB0cmRpZmZfdCByb3dfdnBvcyA9IE1BVFJJ WF9ST1dfVlBPUyAocm93LCB3LT5jdXJyZW50X21hdHJpeCk7CisgICAgICAgICAgaWYgKHJvd192 cG9zID49IGhsaW5mby0+bW91c2VfZmFjZV9iZWdfcm93CisgICAgICAgICAgICAgICYmIHJvd192 cG9zIDw9IGhsaW5mby0+bW91c2VfZmFjZV9lbmRfcm93KQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBjaGVja19tb3VzZV9mYWNlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgbW91c2VfYmVn X2NvbCA9IChyb3dfdnBvcyA9PSBobGluZm8tPm1vdXNlX2ZhY2VfYmVnX3JvdykKKyAgICAgICAg ICA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SRVRDSF9HTFlQSCBpcyBgbGVmdF9vdmVyd3JpdHRlbmAu ICBEcmF3aW5nCisgICAgICAgICAgbm9ybWFsIHRleHQgZHVyaW5nIGB1cGRhdGVfd2luZG93JyAo RFJBV19OT1JNQUxfVEVYVCkgY2FuIGFsc28gZXJhc2UgZmFrZQorICAgICAgICAgIGN1cnNvcnMg dGhhdCBhcmUgYGxlZnRfb3ZlcndyaXR0ZW4nLiAqLworICAgICAgICAgIGxlbmd0aCA9IDA7Cisg ICAgICAgICAgZm9yIChzID0gaDsgczsgcyA9IHMtPm5leHQpCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIHMtPmxlZnRfb3ZlcndyaXR0ZW5fcCA9IHRydWU7CisgICAgICAgICAgICAgIHMt PmFjdGlvbl90eXBlID0gYWN0aW9uX3R5cGU7CisgICAgICAgICAgICAgIGxlbmd0aCArPSBzLT5m aXJzdF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgICAgcmVsYXRp dmVfeCA9IHN0YXJ0X3ggLSBsZW5ndGg7CisgICAgICAgICAgZm9yIChzID0gaDsgczsgcyA9IHMt Pm5leHQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHMtPmZpcnN0X2dseXBoLT5yZWxh dGl2ZV94ID0gcmVsYXRpdmVfeDsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBzLT5maXJz dF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgICAgc3RhcnQgPSBp OworICAgICAgICAgIGNvbXB1dGVfb3ZlcmhhbmdzX2FuZF94ICh0LCBoZWFkLT54LCB0cnVlKTsK KyAgICAgICAgICBwcmVwZW5kX2dseXBoX3N0cmluZ19saXN0cyAoJmhlYWQsICZ0YWlsLCBoLCB0 KTsKKyAgICAgICAgICBpZiAoY2xpcF9oZWFkID09IE5VTEwpCisgICAgICAgICAgICBjbGlwX2hl YWQgPSBoZWFkOworICAgICAg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AgICAg IE1DX0JVSUxEX0dMWVBIX1NUUklOR1MgKGksIHN0YXJ0LCBoLCB0LCBvdmVybGFwX2hsLCBkdW1t eV94LCBsYXN0X3gpOworICAgICAgICAgIGZvciAocyA9IGg7IHM7IHMgPSBzLT5uZXh0KQorICAg ICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICAgICAgY29tcHV0 ZV9vdmVyaGFuZ3NfYW5kX3ggKHQsIGhlYWQtPngsIHRydWUpOworICAgICAgICAgIHByZXBlbmRf Z2x5cGhfc3RyaW5nX2xpc3RzICgmaGVhZCwgJnRhaWwsIGgsIHQpOworICAgICAgICB9CisgICAg ICAvKiBBcHBlbmQgZ2x5cGhzIHN0cmluZ3MgZm9yIGdseXBocyBmb2xsb3dpbmcgdGhlIGxhc3Qg Z2x5cGgKKyAgICAgIHN0cmluZyB0YWlsIHRoYXQgYXJlIG92ZXJ3cml0dGVuIGJ5IHRhaWwuICBU aGUgYmFja2dyb3VuZCBvZgorICAgICAgdGhlc2Ugc3RyaW5ncyBoYXMgdG8gYmUgZHJhd24gYmVj YXVzZSB0YWlsJ3MgZm9yZWdyb3VuZCBkcmF3cworICAgICAgb3ZlciBpdC4gKi8KKyAgICAgIGkg PSByaWdodF9vdmVyd3JpdHRlbiAodGFpbCk7CisgICAgICBpZiAoaSA+PSAwKQorICAgICAgICB7 CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIG92ZXJsYXBfaGw7CisgICAgICAgICAg aWYgKGNoZWNrX21vdXNlX2ZhY2UKKyAgICAgICAgICAgICAgJiYgbW91c2VfYmVnX2NvbCA8IGkg JiYgbW91c2VfZW5kX2NvbCA+IGVuZCkKKyAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX01P VVNFX0ZBQ0U7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBE UkFXX05PUk1BTF9URVhUOworICAgICAgICAgIGlmIChob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gICAgICAgZW51bSBkcmF3X2dseXBo c19mYWNlIG92ZXJsYXBfaGw7CisgICAgICAgICAgaWYgKGNoZWNrX21vdXNlX2ZhY2UKKyAgICAg ICAgICAgICAgJiYgbW91c2VfYmVnX2NvbCA8IGkgJiYgbW91c2VfZW5kX2NvbCA+IGVuZCkKKyAg ICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX01PVVNFX0ZBQ0U7CisgICAgICAgICAgICBlbHNl CisgICAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgICAg IGlmIChobCA9PSBvdmVybGFwX2hsIHx8IGNsaXBfdGFpbCA9PSBOVUxMKQorICAgICAgICAgICAg Y2xpcF90YWlsID0gdGFpbDsKKyAgICAgICAgICBpKys7ICAgICAgLyogV2UgbXVzdCBpbmNsdWRl IHRoZSBJdGggZ2x5cGguICovCisgICAgICAgICAgTUNfQlVJTERfR0xZUEhfU1RSSU5HUyAoZW5k LCBpLCBoLCB0LCBvdmVybGFwX2hsLCB4LCBsYXN0X3gpOworICAgICAgICAgIGZvciAocyA9IGg7 IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRy dWU7CisgICAgICAgICAgY29tcHV0ZV9vdmVyaGFuZ3NfYW5kX3ggKGgsIHRhaWwtPnggKyB0YWls LT53aWR0aCwgZmFsc2UpOworICAgICAgICAgIGFwcGVuZF9nbHlwaF9zdHJpbmdfbGlzdHMgKCZo ZWFkLCAmdGFpbCwgaCwgdCk7CisgICAgICAgIH0KKyAgICAgIHRhaWwgPSBnbHlwaF9zdHJpbmdf Y29udGFpbmluZ19iYWNrZ3JvdW5kX3dpZHRoICh0YWlsKTsKKyAgICAgIGlmIChjbGlwX3RhaWwp CisgICAgICAgIGNsaXBfdGFpbCA9IGdseXBoX3N0cmluZ19jb250YWluaW5nX2JhY2tncm91bmRf d2lkdGggKGNsaXBfdGFpbCk7CisgICAgICBpZiAoY2xpcF9oZWFkIHx8IGNsaXBfdGFpbCkKKyAg ICAgICAgZm9yIChzID0gaGVhZDsgczsgcyA9IHMtPm5leHQpCisgICAgICAgICAgeworICAgICAg ICAgICAgcy0+Y2xpcF9oZWFkID0gY2xpcF9oZWFkOworICAgICAgICAgICAgcy0+Y2xpcF90YWls ID0gY2xpcF90YWlsOworICAgICAgICAgIH0KKyAgICB9CisgIC8qIERyYXcgYWxsIHN0cmluZ3Mu ICovCisgIGZvciAocyA9IGhlYWQ7IHMgJiYgZHJhd19wOyBzID0gcy0+bmV4dCkKKyAgICBGUkFN RV9SSUYgKGYpLT5tY19zY3JpYmVfc3RyaW5nIChzLCBtYXRyaXgsIHJvdywgbHNsLCBnbHlwaF9m bGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUs IHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworI2lmbmRlZiBIQVZFX05TCisgIC8qIFdoZW4g Zm9jdXMgYSBzb2xlIGZyYW1lIGFuZCBtb3ZlIGhvcml6b250YWxseSwgdGhpcyBjbGVhcnMgb25f cAorICAgICBjYXVzaW5nIGEgZmFpbHVyZSB0byBlcmFzZSBwcmV2IGN1cnNvciBwb3NpdGlvbi4g Ki8KKyAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBCisgICAgICAmJiAhcm93LT5mdWxsX3dpZHRoX3AK KyAgICAgIC8qIFdoZW4gZHJhd2luZyBvdmVybGFwcGluZyByb3dzLCBvbmx5IHRoZSBnbHlwaCBz dHJpbmdzJworICAgICAgZm9yZWdyb3VuZCBpcyBkcmF3biwgd2hpY2ggZG9lc24ndCBlcmFzZSBh IGN1cnNvciBjb21wbGV0ZWx5LiAqLworICAgICAgJiYgIW92ZXJsYXBzKQorICAgIHsKKyAgICAg IGludCB4MCA9IGNsaXBfaGVhZCA/IGNsaXBfaGVhZC0+eCA6IChoZWFkID8gaGVhZC0+eCA6IHgp OworICAgIC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XRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAq cm93LAorICAgICAgICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCwgaW50 IHgsIGludCBocG9zLCBpbnQgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNf UkdCIGxzbCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLAorICAgICAgICAgICAgICAgICAg ICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUsIGludCB3ZCwgYm9vbCBhY3RpdmVf cCwKKyAgICAgICAgICAgICAgICAgICAgICBib29sIGN1cnNvcl9nY19wKQoreworICAvLyAgc3Ry dWN0IGdseXBoICpjdXJzb3JfZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgs IHJvdywgaHBvcywgdnBvcyk7CisgIC8vICBmcHJpbnRmIChzdGRlcnIsICJtY19kcmF3X2N1cnNv cl9nbHlwaDogIGNoICglZCkgfCB4ICglZCksIGhwb3MgKCVkKSwgdnBvcyglZCksIGhsICglZClc biIsCisgIC8vICAgICAgICAgICAgICAgICAgICBjdXJzb3JfZ2x5cGgtPnUuY2gsIHgsIGhwb3Ms IHZwb3MsIGhsKTsKKyAgYmxvY2tfaW5wdXQgKCk7CisgIGJvb2wgZHJhd19wID0gdHJ1ZTsKKyAg bWNfZHJhd19nbHlwaHMgKHcsIG1hdHJpeCwgcm93LCB4LCBURVhUX0FSRUEsIGhwb3MsIGhwb3Mg KyAxLCBobCwgMCwgdnBvcywgbHNsLAorICAgICAgICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCBj dXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCwKKyAgICAgICAgICAgICAgICAg IE1DX0RSQVdfR0xZUEhfU1RSSU5HLCBkcmF3X3ApOworICB1bmJsb2NrX2lucHV0ICgpOworICAv KiBXaGVuIHdlIGVyYXNlIHRoZSBjdXJzb3IsIGFuZCBST1cgaXMgb3ZlcmxhcHBlZCBieSBvdGhl ciByb3dzLCBtYWtlCisgIHN1cmUgdGhhdCB0aGVzZSBvdmVybGFwcGluZyBwYXJ0cyBvZiBvdGhl ciByb3dzIGFyZSByZWRyYXduLiAqLworICBpZiAoaGwgPT0gRFJBV19OT1JNQUxfVEVYVCAmJiBy b3ctPm92ZXJsYXBwZWRfcCkKKyAgICB7CisgICAgICBpZiAocm93ID4gbWF0cml4LT5yb3dzCisg ICAgICAgICAgJiYgTUFUUklYX1JPV19PVkVSTEFQU19TVUNDX1AgKHJvdyAtIDEpKQorICAgICAg ICB4X2ZpeF9vdmVybGFwcGluZ19hcmVhICh3LCByb3cgLSAxLCBURVhUX0FSRUEsIE9WRVJMQVBT X0VSQVNFRF9DVVJTT1IpOworICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKHJvdykgPCB3 aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAmJiBNQVRSSVhfUk9XX09WRVJMQVBT X1BSRURfUCAocm93ICsgMSkpCisgICAgICAgIHhfZml4X292ZXJsYXBwaW5nX2FyZWEgKHcsIHJv dyArIDEsIFRFWFRfQVJFQSwgT1ZFUkxBUFNfRVJBU0VEX0NVUlNPUik7CisgICAgfQorfQorCit2 b2lkCittY19lcmFzZV9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRy aXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICBpbnQg eCwgaW50IHksIGludCBocG9zLCBpbnQgdnBvcywgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9y LAorICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLCBpbnQg d2QpCit7CisgIGJvb2wgZGVidWdfcCA9IGZhbHNlOworICBpZiAoZGVidWdfcCkKKyAg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ocG9zICYmIGhwb3Mg Pj0gMCkKKyAgICBtb3VzZV9mYWNlX2hlcmVfcCA9IHRydWU7CisgIC8qIE1heWJlIGNsZWFyIHRo ZSBkaXNwbGF5IHVuZGVyIHRoZSBjdXJzb3IuICovCisgIGlmIChjdXJzb3JfdHlwZSA9PSBNQ19I T0xMT1dfQk9YCisgICAgICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YKQorICAgIHsK KyAgICAgIGludCB0ZW1wX3ggPSB4OworICAgICAgaW50IGhlYWRlcl9saW5lX2hlaWdodCA9IFdJ TkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAgICAgY3Vyc29yX2dseXBoID0gbWNfZ2V0 X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIGhwb3MsIHZwb3MpOworICAgICAgaWYgKGN1 cnNvcl9nbHlwaCA9PSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgaWYgKGRlYnVnX3ApCisg ICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4gKCVk KVxuIiwgNyk7CisgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICBpbnQgdGVtcF93 ZCA9IGN1cnNvcl9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICBpZiAodGVtcF94IDwgMCkKKyAg ICAgICAgeworICAgICAgICAgIHRlbXBfd2QgKz0gdGVtcF94OworICAgICAgICAgIHRlbXBfeCA9 IDA7CisgICAgICAgIH0KKyAgICAgIHRlbXBfd2QgPSBtaW4gKHdkLCB3aW5kb3dfYm94X3dpZHRo ICh3LCBURVhUX0FSRUEpIC0gdGVtcF94KTsKKyAgICAgIGludCBmeSA9IFdJTkRPV19UT19GUkFN RV9QSVhFTF9ZICh3LCBtYXggKGhlYWRlcl9saW5lX2hlaWdodCwgcm93LT55KSk7CisgICAgICBp bnQgZnggPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhF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jhc2hf dHdvKQorICAgIHJldHVybjsKKyAgaWYgKHggPCAwCisgICAgICB8fCB5IDwgMAorICAgICAgfHwg aHBvcyA8IDAKKyAgICAgIHx8IHZwb3MgPCAwKQorICAgIHJldHVybjsKKyAgTGlzcF9PYmplY3Qg YnVmID0gdy0+Y29udGVudHM7CisgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgYm9vbCBhdXRvX2hz Y3JvbGxfbW9kZV9wID0gRVEgKEZidWZmZXJfbG9jYWxfdmFsdWUgKFFhdXRvX2hzY3JvbGxfbW9k ZSwgYnVmKSwgUWN1cnJlbnRfbGluZSk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSkg Ki8KKyAgYm9vbCBoc2NsX2FsbF90ZW1wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBh bmQgZG8gbm90aGluZy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBfcCA9ICh3LT5zdXNwZW5k X2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9s bF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOwor ICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgZWxzZSBiZXNpZGVzIGhv cml6b250YWxseSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IGxpbmUgZGlm ZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRh bGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMV9wID0g KCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5o c2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xs ID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHct PmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAuLi4KKyAgICAgICAgICAg ICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50 bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Ny b2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPT0gMAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICAvKiBFWEFN UExFOiAgKHNjcm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxlZnQgYXJyb3cga2V5 IG9uZSB0aW1lLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5 IHNjcm9sbGVkIGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1wX3AgPSAoIXctPnN1c3Bl bmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21v ZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUg Qy14IDwgYW5kIGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVudCBsaW5lIHRvIGJl CisgICAgICAgICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuCisgICAg ICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVy ZW50bHkuICovCisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xs CisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3Jv bGwgIT0gdy0+aHNjcm9sbCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUp OworICBpbnQgZnJpbmdlX2JpdG1hcCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgIGludCBmYWNl X2lkID0gREVGQVVMVF9GQUNFX0lEOworICBpZiAoIXJlbW92ZV9wCisgICAgICAmJiBnbHlwaF9m b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G9mICh3aGlj aCAhPSBOT19GUklOR0VfQklUTUFQKS4gIEF0IHRoaXMgdGltZSwgQGxhd2xpc3QgcHJlZmVycyBu b3QgdG8KKyAgICAgIHJlbHkgdXBvbiBhIExpc3Agc2V0dGluZyB1c2luZyBgc2V0LWZyaW5nZS1i aXRtYXAtZmFjZScuICovCisgICAgICByb3ctPmxlZnRfZnJpbmdlX2JpdG1hcCA9IChjdXJzb3Jf dHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICByb3ctPmxlZnRfZnJpbmdlX2ZhY2VfaWQgPSBm YWNlX2lkOworICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgcm93LT5m cmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxzZTsKKyAgICAgIG1jX2RyYXdfZnJpbmdlX2Jp dG1hcCAodywgcm93LCB0cnVlLCBjdXJzb3JfdHlwZSk7CisgICAgfQorICAgIGVsc2UgaWYgKCFy ZW1vdmVfcAorICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FSUk9X X0JJVE1BUAorICAgICAgICAgICAgICYmIChoc2NsX2FsbF90ZW1wX3AKKyAgICAgICAgICAgICAg ICAgfHwgaHNjbF9hbGxfcGVybV8wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVy bV8xX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8yX3AKKyAgICAgICAgICAg ICAgICAgfHwgaHNjbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9wZXJtX3ApKQor ICAgICAgeworICAgICAgICBlbnVtIGZhY2VfaWQgb3ZlcmxheV9hcnJvd19mYWNlX2lkID0KKyAg ICAgICAgICAoIWFjdGl2ZV9wCisgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICA/IGxvb2t1cF9u YW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaHNjbC1pbmFjdGl2ZS1w cmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgIDogKGFjdGl2ZV9wKQorICAgICAgICAgICAg PyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wt cHJlLXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAg ICAgZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAg ICAgICAgICAgICAgICA/IG92ZXJsYXlfYXJyb3dfZmFjZV9pZAorICAgICAgICAgICAgICAgICAg OiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgIGlmIChoc2NsX2FsbF9wZXJtXzBfcCkKKyAgICAg ICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIist aHNjbC1wZXJtIiksIGZhbHNlLCBmYWxzZSk7CisgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxf cGVybV8xX3ApCisgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRt YXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIHRydWUsIGZhbHNlKTsKKyAgICAgICAgICAg IGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMl9wKQorICAgICAgICAgICAgICBmcmluZ2VfYml0bWFw ID0gbWNfZ2V0X2ZyaW5nZV9ia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OworICAgICAgfQorICAgICAgZWxzZSBpZiAoIXJlbW92ZV9wCisgICAgICAg ICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJS T1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9M TE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2Zs YXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhf Zmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAg IHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cK KyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisg ICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FM X0JBUgorICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9C QVJfQkFDS1NMQVNIKSkKKyAgICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IGJpdG1hcF9m bGF2b3IgPSAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19yZWN0 YW5nbGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJS T1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJz ZWRfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFu Z2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZv ciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZF UlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBN Q19WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBRbWNfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFy CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9 PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiBRbmlsOworICAgICAgICAgIGZyaW5nZV9iaXRtYXAg PSAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBsb29rdXBfZnJpbmdlX2JpdG1hcCAoYml0bWFwX2ZsYXZvcikKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgIGZh Y2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAg ICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFO R0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9y ID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAg ICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQor ICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAo IistcmV2ZXJzZWQtYmFyLXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgICAgICAg IDogKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAg ICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVf UklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1D X1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAg ICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAg ICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistYmFyLXBy ZS16di1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lE OworICAgICAgICAgIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gZmFsc2U7CisgICAgICAgICAg cm93LT5yaWdodF9mcmluZ2VfYml0bWFwID0gZnJpbmdlX2JpdG1hcDsKKyAgICAgICAgICByb3ct PnJpZ2h0X2ZyaW5nZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgICAgICByb3ctPnJpZ2h0X2Zy aW5nZV9vZmZzZXQgPSAwOworICAgICAgICAgIHJvdy0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19w ID0gZmFsc2U7CisgICAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwICh3LCByb3csIGZhbHNl LCBjdXJzb3JfdHlwZSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoZ2x5cGhfZmxhdm9y ID09IE1DX0dMWVBICisgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQ SExFU1MpCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBvbl9wID0gdHJ1ZTsKKyAgICAg ICAgICAgIEZSQU1FX1JJRiAoZiktPm1jX3NjcmliZV9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4 LCBmeCwgeSwgZnksIGhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICB2cG9zLCB3ZCwgaCwgbHNsLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgZ2x5cGhfZmxhdm9yLCBv bl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZl X3ApOworICAgICAgICAgIH0KK30KKworLyogRHVtcCBjb250ZW50cyBvZiBnbHlwaCBHTFlQSCB0 byBzdGRlcnIuICBST1cgYW5kIEFSRUEgYXJlCisgICB0aGUgZ2x5cGggcm93IGFuZCBhcmVhIHdo ZXJlIHRoZSBnbHlwaCBjb21lcyBmcm9tLiAqLwordm9pZAorbWNfZHVtcF9nbHlwaCAoc3RydWN0 IGdseXBoX3JvdyAqcm93LCBzdHJ1Y3QgZ2x5cGggKmdseXBoLCBpbnQgYXJlYSwKKyAgICAgICAg ICAgICAgIGludCByZWxhdGl2ZV94LCBpbnQgdnBvcykKK3sKKyAgYm9vbCBnbHlwaF96dl9wID0g KGdseXBoIC0gcm93LT5nbHlwaHNbYXJlYV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAg ICAgICAgICAgICAgICAgJiYgTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSA9PSBaVik7Cisg IGlmIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICB8fCBnbHlwaC0+dHlwZSA9PSBH TFlQSExFU1NfR0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAi ICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFk ICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwK KyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0g MSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dM WVBICisgICAgICAgICA/ICdDJworICAgICAgICAgOiAnRycpLAorICAgICAgICBnbHlwaC0+Y2hh cnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJwor ICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisg ICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcK KyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisg ICAgICAgIGdseXBoLT51LmNoLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5 cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisg ICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgIG1j X2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgt PnR5cGUgPT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsCisg ICAgICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNnggJTRkICUx LjFkJTEuMWQgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhU X0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRb YXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1MnLAorICAgICAgICBn bHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAg ICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgs CisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxl ZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAg IGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICJcXFMiKTsK KyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQorICAgIHsKKyAg ICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBE ImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVjXG4iLAorICAgICAgICBn bHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFd ID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAor ICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAo Z2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ0InCisgICAgICAgICAgOiAoU1RSSU5HUCAo Z2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgOiAoTklMUCAoZ2x5 cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgOiAnLScpKSksCisgICAg ICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2lnbmVkIGludCkgZ2x5cGgtPnUu aW1nX2lkLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94 X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBo LT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisgICAgfQor ICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpCisgICAgeworICAgICAg ZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAl YyAlM2QgMHglMDZ4IiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAor ICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAx KSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJysnLAorICAgICAgICBnbHlwaC0+Y2hh cnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdC JworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdT JworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICcwJwor ICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAg ICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmNtcC5pZCk7CisgICAgICBmcHJpbnRmIChzdGRlcnIs ICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5 cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3ApOwor ICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmludGYgKHN0ZGVy ciwgIiAgJTNkICVzIC4gWyVkLSVkXVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBnbHlw aC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAgICAgICAgICAgICAg ICAgIGdseXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgtPnNsaWNlLmNtcC50byk7CisgICAgICAg IGVsc2UKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG4iKTsKKyAgICB9CisgIGVsc2UgaWYg KGdseXBoLT50eXBlID09IFhXSURHRVRfR0xZUEgpCisgICAgeworI2lmbmRlZiBIQVZFX1hXSURH RVRTCisgICAgICBlYXNzdW1lIChmYWxzZSk7CisjZWxzZQorICAgICAgZnByaW50ZiAoc3RkZXJy LAorICAgICAgICAiICAlNWQvJS01ZCAlNWQgJTRjICU2ZCAlYyAlM2QgMHglMDV4ICU0ZCAlMS4x ZCUxLjFkICAlM2QgJXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9B UkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2Fy ZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdYJywKKyAgICAgICAgZ2x5 cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAg ICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAg ID8gJ1MnCisgICAgICAgICA6ICctJykpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisg ICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAor ICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnUueHdpZGdl dCwKKyAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAg ICAgJy4nKTsKKyNlbmRpZgorICAgIH0KK30KKworLyogRHVtcCB0aGUgY29udGVudHMgb2YgZ2x5 cGggcm93IGF0IFZQT1MgaW4gTUFUUklYIHRvIHN0ZGVyci4KKyAgIEdMWVBIUyAwIG1lYW5zIGRv bid0IHNob3cgZ2x5cGggY29udGVudHMuCisgICBHTFlQSFMgMSBtZWFucyBzaG93IGdseXBocyBp biBzaG9ydCBmb3JtCisgICBHTFlQSFMgPiAxIG1lYW5zIHNob3cgZ2x5cGhzIGluIGxvbmcgZm9y bS4gKi8KK3ZvaWQKK21jX2R1bXBfZ2x5cGhfcm93IChzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGlu dCB2cG9zLCBpbnQgZ2x5cGhzKQoreworICBpbnQgcmVsYXRpdmVfeCA9IDA7CisgIGlmIChnbHlw aHMgIT0gMSkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJcbkRVTVAgR0xZUEggUk9X XG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIlJvdyAgICAgU3RhcnQgICAgICAgRW5kIFVz ZWQgb0U+PFxcQ1RaRmVzbSAgICAgWCAgICBZICAgIFcgICAgSCAgICBWICAgIEEgICAgUFxuIik7 CisgICAgICBmcHJpbnRmIChzdGRlcnIsICI9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiIpOworICAg ICAgZnByaW50ZiAoc3RkZXJyLCAiJTNkICU5InBEImQgJTkicEQiZCAlNGQgJTEuMWQlMS4xZCUx LjFkJTEuMWRcCislMS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkICAlNGQg JTRkICU0ZCAlNGQgJTRkICU0ZCAlNGRcbiIsCisgICAgICAgICB2cG9zLAorICAgICAgICAgTUFU UklYX1JPV19TVEFSVF9DSEFSUE9TIChyb3cpLAorICAgICAgICAgTUFUUklYX1JPV19FTkRfQ0hB UlBPUyAocm93KSwKKyAgICAgICAgIHJvdy0+dXNlZFtURVhUX0FSRUFdLAorICAgICAgICAgcm93 LT5jb250YWluc19vdmVybGFwcGluZ19nbHlwaHNfcCwKKyAgICAgICAgIHJvdy0+ZW5hYmxlZF9w LAorICAgICAgICAgcm93LT50cnVuY2F0ZWRfb25fbGVmdF9wLAorICAgICAgICAgcm93LT50cnVu Y2F0ZWRfb25fcmlnaHRfcCwKKyAgICAgICAgIHJvdy0+Y29udGludWVkX3AsCisgICAgICAgICBN QVRSSVhfUk9XX0NPTlRJTlVBVElPTl9MSU5FX1AgKHJvdyksCisgICAgICAgICBNQVRSSVhfUk9X X0RJU1BMQVlTX1RFWFRfUCAocm93KSwKKyAgICAgICAgIHJvdy0+ZW5kc19hdF96dl9wLAorICAg ICAgICAgcm93LT5maWxsX2xpbmVfcCwKKyAgICAgICAgIHJvdy0+ZW5kc19pbl9taWRkbGVfb2Zf Y2hhcl9wLAorICAgICAgICAgcm93LT5zdGFydHNfaW5fbWlkZGxlX29mX2NoYXJfcCwKKyAgICAg ICAgIHJvdy0+bW91c2VfZmFjZV9wLAorICAgICAgICAgcm93LT54LAorICAgICAgICAgcm93LT55 LAorICAgICAgICAgcm93LT5waXhlbF93aWR0aCwKKyAgICAgICAgIHJvdy0+aGVpZ2h0LAorICAg ICAgICAgcm93LT52aXNpYmxlX2hlaWdodCwKKyAgICAgICAgIHJvdy0+YXNjZW50LAorICAgICAg ICAgcm93LT5waHlzX2FzY2VudCk7CisgICAgICAvKiBUaGUgbmV4dCAzIGxpbmVzIHNob3VsZCBh bGlnbiB0byAiU3RhcnQiIGluIHRoZSBoZWFkZXIuICovCisgICAgICBmcHJpbnRmIChzdGRlcnIs ICIgICAgJTkicEQiZCAlOSJwRCJkXHQlNWRcbiIsIHJvdy0+c3RhcnQub3ZlcmxheV9zdHJpbmdf aW5kZXgsCisgICAgICAgICByb3ctPmVuZC5vdmVybGF5X3N0cmluZ19pbmRleCwKKyAgICAgICAg IHJvdy0+Y29udGludWF0aW9uX2xpbmVzX3dpZHRoKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwg IiAgICAlOSJwRCJkICU5InBEImRcbiIsCisgICAgICAgICBDSEFSUE9TIChyb3ctPnN0YXJ0LnN0 cmluZ19wb3MpLAorICAgICAgICAgQ0hBUlBPUyAocm93LT5lbmQuc3RyaW5nX3BvcykpOworICAg ICAgZnByaW50ZiAoc3RkZXJyLCAiICAgICU5ZCAlOWRcbiIsIHJvdy0+c3RhcnQuZHB2ZWNfaW5k ZXgsCisgICAgICAgICByb3ctPmVuZC5kcHZlY19pbmRleCk7CisgICAgfQorICBpZiAoZ2x5cGhz ID4gMSkKKyAgICB7CisgICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9NQVJHSU5fQVJFQTsgYXJl YSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBo ICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdOworICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5 cGhfZW5kID0gZ2x5cGggKyByb3ctPnVzZWRbYXJlYV07CisgICAgICAgICAgLyogR2x5cGggZm9y IGEgbGluZSBlbmQgaW4gdGV4dC4gKi8KKyAgICAgICAgICBpZiAoYXJlYSA9PSBURVhUX0FSRUEg JiYgZ2x5cGggPT0gZ2x5cGhfZW5kICYmIGdseXBoLT5jaGFycG9zID4gMCkKKyAgICAgICAgICAg ICsrZ2x5cGhfZW5kOworICAgICAgICAgIGlmIChnbHlwaCA8IGdseXBoX2VuZCkKKyAgICAgICAg ICAgIGZwcmludGYgKHN0ZGVyciwgIkdseXBoIy9Ub3RhbCBSZWwuWCBUICAgICAgIFBvcyBPICAg VyAgICAgQ29kZSBGYWNlIExSIEhQT1MgWlYgQ1xuIik7CisgICAgICAgICAgZm9yICg7IGdseXBo IDwgZ2x5cGhfZW5kOyArK2dseXBoKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19k dW1wX2dseXBoIChyb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB2cG9zKTsKKyAgICAgICAg ICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAoZ2x5cGhzID09IDEpCisgICAgICB7CisgICAg ICAgIGNoYXIgc1tTSFJUX01BWCArIDRdOworICAgICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9N QVJHSU5fQVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAgICAgIHsKKyAgICAg ICAgICAgIGludCBpOworICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHJvdy0+dXNlZFthcmVh XTsgKytpKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICpn bHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdICsgaTsKKyAgICAgICAgICAgICAgICBpZiAoaSA9PSBy b3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICYmIGFyZWEgPT0gVEVYVF9B UkVBCisgICAgICAgICAgICAgICAgICAgICYmIE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICAgICAgICAgICYmIGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgICAgICAg ICAgICAgJiYgZ2x5cGgtPnUuY2ggPT0gJyAnKQorICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICBzdHJjcHkgKCZzW2ldLCAiW1xcbl0iKTsKKyAgICAgICAgICAgICAgICAg ICAgaSArPSA0OworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBp ZiAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgZ2x5cGgtPnUuY2ggPCAweDgwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlw aC0+dS5jaCA+PSAnICcpCisgICAgICAgICAgICAgICAgICAgIHNbaV0gPSBnbHlwaC0+dS5jaDsK KyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgIHNbaV0gPSAn Lic7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHNbaV0gPSAnXDAnOworICAgICAgICAg ICAgZnByaW50ZiAoc3RkZXJyLCAiJTNkOiAoJWQpICclcydcbiIsIHZwb3MsIHJvdy0+ZW5hYmxl ZF9wLCBzKTsKKyAgICAgICAgICB9CisgICAgICB9Cit9CisKK0RFRlVOICgibWMtZHVtcC1nbHlw aC1yb3ciLCBGbWNfZHVtcF9nbHlwaF9yb3csIFNtY19kdW1wX2dseXBoX3JvdywgMSwgMiwgIlAi LAorICAgICAgIGRvYzogLyogRHVtcCBnbHlwaCByb3cgUk9XIHRvIHN0ZGVyci4KK0ludGVyYWN0 aXZlbHksIFJPVyBpcyB0aGUgcHJlZml4IG51bWVyaWMgYXJndW1lbnQgYW5kIGRlZmF1bHRzIHRv Cit0aGUgcm93IHdoaWNoIGRpc3BsYXlzIHBvaW50LgorT3B0aW9uYWwgYXJndW1lbnQgR0xZUEhT IDAgbWVhbnMgZG9uJ3QgZHVtcCBnbHlwaHMuCitHTFlQSFMgMSBtZWFucyBkdW1wIGdseXBocyBp biBzaG9ydCBmb3JtLgorR0xZUEhTID4gMSBvciBvbWl0dGVkIG1lYW5zIGR1bXAgZ2x5cGhzIGlu IGxvbmcgZm9ybS4gICovKQorICAoTGlzcF9PYmplY3Qgcm93LCBMaXNwX09iamVjdCBnbHlwaHMp Cit7CisgIHN0cnVjdCB3aW5kb3cgKncgPSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpOworICBz dHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgRU1BQ1Nf SU5UIHZwb3M7CisgIGlmIChOSUxQIChyb3cpKQorICAgIHsKKyAgICAgIGludCBkMSwgZDIsIGQz LCBkNCwgZDUsIHlwb3M7CisgICAgICBib29sIHZpc2libGVfcCA9IHBvc192aXNpYmxlX3AgKHcs IFBULCAmZDEsICZkMiwgJmQzLCAmZDQsICZkNSwgJnlwb3MpOworICAgICAgaW50IGhlYWRlcl9s aW5lX2hlaWdodCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAgICAgaW50IHZv ZmZzZXQgPSAoaGVhZGVyX2xpbmVfaGVpZ2h0ID4gMAorICAgICAgICAgICAgICAgICAgICAgJiYg eXBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgPyB5cG9zICsgMQorICAgICAgICAgICAg ICAgICAgICAgIDogeXBvczsKKyAgICAgIGlmICh2aXNpYmxlX3ApCisgICAgICAgIHZwb3MgPSB2 b2Zmc2V0OworICAgICAgICBlbHNlCisgICAgICAgICAgdnBvcyA9IDA7CisgICAgfQorICAgIGVs c2UKKyAgICAgIHsKKyAgICAgICAgQ0hFQ0tfTlVNQkVSIChyb3cpOworICAgICAgICB2cG9zID0g WEZJWE5VTSAocm93KTsKKyAgICAgIH0KKyAgaWYgKHZwb3MgPj0gMCAmJiB2cG9zIDwgbWF0cml4 LT5ucm93cykKKyAgICBtY19kdW1wX2dseXBoX3JvdyAoTUFUUklYX1JPVyAobW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CB3aW5kb3cgKncgPSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpOworICBzdHJ1 Y3QgYnVmZmVyICpidWZmZXIgPSBYQlVGRkVSICh3LT5jb250ZW50cyk7CisgIGZwcmludGYgKHN0 ZGVyciwgIlBUID0gJSJwRCJkLCBCRUdWID0gJSJwRCJkLiBaViA9ICUicEQiZFxuIiwKKyAgICAg QlVGX1BUIChidWZmZXIpLCBCVUZfQkVHViAoYnVmZmVyKSwgQlVGX1pWIChidWZmZXIpKTsKKyAg ZnByaW50ZiAoc3RkZXJyLCAiQ3Vyc29yIHggPSAlZCwgeSA9ICVkLCBocG9zID0gJWQsIHZwb3Mg PSAlZFxuIiwKKyAgICAgdy0+Y3Vyc29yLngsIHctPmN1cnNvci55LCB3LT5jdXJzb3IuaHBvcywg dy0+Y3Vyc29yLnZwb3MpOworICBmcHJpbnRmIChzdGRlcnIsICI9PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiIpOworICBtY19kdW1wX2dseXBoX21hdHJpeCAo dy0+Y3VycmVudF9tYXRyaXgsCisgICAgICAgICBUWVBFX1JBTkdFRF9GSVhOVU1QIChpbnQsIGds eXBocykgPyBYRklYTlVNIChnbHlwaHMpIDogMCk7CisgIHJldHVybiBRbmlsOworfQorCitib29s CittY190cmF2ZXJzZV9jYWNoZV9wIChzdHJ1Y3QgbWNfbWF0cml4IG1hdHJpeCwgZW51bSBtY19j YWNoZV90eXBlIGNhY2hlX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICBpbnQgdm50aCwgaW50 IG50aCkKK3sKKyAgaWYgKHZudGggPCBtYXRyaXgudnBvc191c2VkCisgICAgICAmJiBtYXRyaXgu Y3Vyc29yc191c2VkW2NhY2hlX3R5cGVdID4gMAorICAgICAgJiYgbnRoIDwgbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSkKKyAgICByZXR1cm4gdHJ1ZTsKKyAgICBlbHNl CisgICAgICByZXR1cm4gZmFsc2U7Cit9CisKK3ZvaWQKK21jX3Jlc2V0X2NhY2hlIChzdHJ1Y3Qg d2luZG93ICp3KQoreworICBpZiAoIUJVRkZFUlAgKHctPmNvbnRlbnRzKSkKKyAgICByZXR1cm47 CisgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAg ICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsKKyAg ICAgIGJvb2wgYnZhcl9hY3RpdmVfcDsKKyAgICAgIHN3aXRjaCAoY2FjaGVfdHlwZSkKKyAgICAg ICAgeworICAgICAgICAgIGNhc2UgTk9fQ0FDSEU6CisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBjYXNlIE1DX0NBQ0hFOgorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAg ICAgICAgICAgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2Nv bmYpKSkKKyAgICAgICAgICAgICAgICBidmFyX2FjdGl2ZV9wID0gZmFsc2U7CisgICAgICAgICAg ICAgICAgZWxzZSBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQor ICAgICAgICAgICAgICAgICAgYnZhcl9hY3RpdmVfcCA9IHRydWU7CisgICAgICAgICAgICAgIGJy ZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgIGNhc2UgQ0hfQ0FDSEU6CisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAg ICAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykp KQorICAgICAgICAgICAgICAgIGJ2YXJfYWN0aXZlX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAg ICBlbHNlIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAg ICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisg ICAgICAgICAgICAgICAgICBidmFyX2FjdGl2ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgYnJl YWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgY2FzZSBGQ19DQUNIRToKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAg ICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkp CisgICAgICAgICAgICAgICAgYnZhcl9hY3RpdmVfcCA9IGZhbHNlOworICAgICAgICAgICAgICAg IGVsc2UgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAg ICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkKKyAg ICAgICAgICAgICAgICAgIGJ2YXJfYWN0aXZlX3AgPSB0cnVlOworICAgICAgICAgICAgICBicmVh azsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKCFidmFyX2FjdGl2ZV9wKQor ICAgICAgICB7CisgICAgICAgICAgLyogRGVjcmVhc2UgdGhlIHNpemUgb2YgdGhlIGFycmF5IHRv IGEgYmFyZSBtaW5pbXVtLiAqLworICAgICAgICAgIGZvciAoaW50IHZudGggPSAwOyB2bnRoIDwg dy0+bWNfbWF0cml4LnZwb3NfdXNlZDsgKyt2bnRoKQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICBpZiAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5 cGVdID4gMSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSA9CisgICAgICAgICAgICAgICAgICAgIHhu cmVhbGxvYyAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV0sIDEsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mICp3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXSk7CisgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV0gPSAxOworICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtj YWNoZV90eXBlXSA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgdy0+bWNfbWF0cml4LmN1 cnNvcnNfdXNlZFtjYWNoZV90eXBlXSA9IDA7CisgICAgICAgIH0KKyAgICAgICAgLy8gIEFsdGhv dWdoIGl0IHdvdWxkIG5vdCBiZSB2ZXJ5IGVmZmljaWVudCwgaXQgaXMgcG9zc2libGUgdG8gc2V0 CisgICAgICAgIC8vICB0aGUgX3VzZWRfIGVsZW1lbnRzIG9mIHRoZSBhcnJheSB0byB6ZXJvLiAg SW4gc3VjaCBhIGNhc2UsIHRoZQorICAgICAgICAvLyAgLi4uX2VsdHMuYWxsb2NhdGVkW2NhY2hl X3R5cGVdIHdvdWxkIHJlbWFpbiB0aGUgc2FtZS4KKyAgICAgICAgLy8gIG1lbXNldCAody0+bWNf bWF0cml4LnZwb3NbQF0uY2FjaGVb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orICAg ICAgICAgICBpbnQgd2QsIGludCBoLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLCBp bnQgY3Vyc29yX3dpZHRoLAorICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGZvcmVncm91bmQsIHN0 cnVjdCBtY19SR0IgYmFja2dyb3VuZCwgYm9vbCBhY3RpdmVfcCwKKyAgICAgICAgICAgZW51bSBt Y19mbGF2b3IgZ2x5cGhfZmxhdm9yLCBib29sIGRyYXdfcCwgZW51bSBtY19kcmF3X3Jvd190eXBl IGZyb21fd2hlcmUsCisgICAgICAgICAgIGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlLCBl bnVtIG1jX2VuZ2luZV90eXBlIGFjdGlvbl90eXBlKQoreworICBpbnQgdm50aCA9IE1BVFJJWF9S T1dfVlBPUyAocm93LCBtYXRyaXgpOworICBpZiAobWNfc3RkZXJyX3AKKyAgICAgICYmIGRyYXdf cCkKKyAgICB7CisgICAgICBpbnQgY2hhcnBvcyA9IGdseXBoLT5jaGFycG9zOworICAgICAgZnBy aW50ZiAoc3RkZXJyLCAiXG5tY19oZWxwZXIgKCVzKTogIGZyb21fd2hlcmUgKCVzKVxuXAorICBh Y3Rpb25fdHlwZSAoJXMpIHwgZmxhdm9yICglcykgfCBjaGFycG9zICglZClcblwKKyAgY2hhciAo JXMpIHwgeCAoJWQpIHwgZnggKCVkKSB8IHkgKCVkKSB8IGZ5ICglZCkgfCBocG9zICglZC8lZCkg fCB2cG9zICglZClcblwKKyAgaCAoJWQpIHwgY3Vyc29yX3R5cGUgKCVzKSB8IGN1cnNvcl93aWR0 aCAoJWQpIHwgYWN0aXZlX3AgKCVzKVxuXAorICBGRy1SR0IgKCVmLyVmLyVmKSB8IEJHLVJHQiAo JWYvJWYvJWYpXG4iLAorICAgICAgbWNfd2luZG93ICh3KSwgbWNfZHJhd19yb3dfdHlwZV90b19z dHJpbmcgKGZyb21fd2hlcmUpLAorICAgICAgbWNfZW5naW5lX3R5cGVfdG9fc3RyaW5nIChhY3Rp b25fdHlwZSksIG1jX2ZsYXZvcl90b19zdHJpbmcgKGdseXBoX2ZsYXZvciksCisgICAgICBjaGFy cG9zLCBtY19jaGFyX3RvX3N0cmluZyAoZ2x5cGgtPnUuY2gpLCB4LCBmeCwgeSwgZnksIGhwb3Ms CisgICAgICByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEsIHZwb3MsIGgsIG1jX2N1cnNvcl90eXBl X3RvX3N0cmluZyAoY3Vyc29yX3R5cGUpLAorICAgICAgY3Vyc29yX3dpZHRoLCAoYWN0aXZlX3Ag PyAidHJ1ZSIgOiAiZmFsc2UiKSwgZm9yZWdyb3VuZC5yZWQsIGZvcmVncm91bmQuZ3JlZW4sCisg ICAgICBmb3JlZ3JvdW5kLmJsdWUsIGJhY2tncm91bmQucmVkLCBiYWNrZ3JvdW5kLmdyZWVuLCBi YWNrZ3JvdW5kLmJsdWUpOworICAgIH0KKyAgYm9vbCByZW1vdmVfcCA9IGZhbHNlOworICBpZiAo ZHJhd19wCisgICAgICAmJiAoZnJvbV93aGVyZSA9PSBTS0lQUEVECisgICAgICAgICAgfHwgZnJv bV93aGVyZSA9PSBQT1NUX0NIQU5HRUQKKyAgICAgICAgICB8fCBmcm9tX3doZXJlID09IFVOQ0hB TkdFRAorICAgICAgICAgIHx8IGZyb21fd2hlcmUgPT0gU0VUX0NVUlNPUl9UV08pKQorICAgIHsK KyAgICAgIGJvb2wgc2FtZV9wID0gZmFsc2U7CisgICAgICBmb3IgKGludCBudGggPSAwOyBudGgg PCB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdOyArK250aCkK KyAgICAgICAgeworICAgICAgICAgIHNhbWVfcCB8PQorICAgICAgICAgICAgKHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uc2FtZV9wID09IHRydWUKKyAgICAg ICAgICAgICAmJiB3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9yLCByZW1vdmVfcCk7CisgICAgICByZXR1cm47CisgICAgfQorICAgIGVsc2UgaWYg KGRyYXdfcAorICAgICAgICAgICAgICYmIChmcm9tX3doZXJlID09IFNDUklCRV9PTkUKKyAgICAg ICAgICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBTQ1JJQkVfVFdPCisgICAgICAgICAgICAgICAg IHx8IGZyb21fd2hlcmUgPT0gU0NSSUJFX1RIUkVFCisgICAgICAgICAgICAgICAgIHx8IGZyb21f d2hlcmUgPT0gTk9XSEVSRSkpCisgICAgICB7CisgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlk ICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwgY3Vyc29y X3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGZvcmVn cm91bmQsIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAgICAgcmV0dXJu OworICAgICAgfQorICBpZiAoY2FjaGVfdHlwZSA9PSBOT19DQUNIRSkKKyAgICByZXR1cm47Cisg ICsrdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgaWYgKHZudGggPj0g dy0+bWNfbWF0cml4LnZwb3NfdXNlZCkKKyAgICB3LT5tY19tYXRyaXgudnBvc191c2VkID0gdm50 aCArIDE7CisgIGlmICh3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQgPCB3LT5tY19tYXRyaXgu dnBvc191c2VkKQorICAgIHsKKyAgICAgIGludCBvbGRfYWxsb2MgPSB3LT5tY19tYXRyaXgudnBv c19hbGxvY2F0ZWQ7CisgICAgICBpbnQgbmV3X2VsdHMgPSB3LT5tY19tYXRyaXgudnBvc191c2Vk IC0gdy0+bWNfbWF0cml4LnZwb3NfYWxsb2NhdGVkOworICAgICAgdy0+bWNfbWF0cml4LnZwb3Mg PSB4cGFsbG9jICh3LT5tY19tYXRyaXgudnBvcywgJnctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRl ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMsIElOVF9NQVgs IHNpemVvZiAqdy0+bWNfbWF0cml4LnZwb3MpOworICAgICAgbWVtc2V0ICh3LT5tY19tYXRyaXgu dnBvcyArIG9sZF9hbGxvYywgMCwKKyAgICAgICAgICAgICAgICh3LT5tY19tYXRyaXgudnBvc19h bGxvY2F0ZWQgLSBvbGRfYWxsb2MpICogc2l6ZW9mICp3LT5tY19tYXRyaXgudnBvcyk7CisgICAg fQorICArK3ctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV07Cisg IGlmICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV0g PCB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdKQorICAgIHsK KyAgICAgIGludCBvbGRfYWxsb2MgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxv Y2F0ZWRbY2FjaGVfdHlwZV07CisgICAgICBpbnQgbmV3X2VsdHMgPSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdIC0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdOworICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV0gPSB4cGFsbG9jICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX2FsbG9j YXRlZFtjYWNoZV90eXBlXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElOVF9NQVgsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAqdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV0pOworICAgICAgbWVtc2V0ICh3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSArIG9sZF9hbGxvYywgMCwK KyAgICAgICAgICAgICAgICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRb Y2FjaGVfdHlwZV0gLSBvbGRfYWxsb2MpCisgICAgICAgICAgICAgICAgICogc2l6ZW9mICp3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSk7CisgICAgfQorICBpbnQgbnRo ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSAtIDE7Cisg IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uc2FtZV9wID0g ZmFsc2U7CisgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0u Z2x5cGgudHlwZSA9IGdseXBoLT50eXBlOworICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLmJ5dGVwb3MgPSBnbHlwaC0+Ynl0ZXBvczsKKyAgdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaG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ptYXRyaXgsCisgICAgICAg ICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB4LCBpbnQgKmZ4LCBp bnQgeSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCAqZnksIGludCBocG9zLCBpbnQgdnBv cywgaW50ICpoLAorICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBj dXJzb3JfdHlwZSwgaW50IGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGlu dCAqd2QpCit7CisgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3 LCBtYXRyaXgsIHJvdywgaHBvcywgdnBvcyk7CisgIGlmIChnbHlwaCA9PSBOVUxMKQorICAgIHJl dHVybjsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAg KmZ4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICpoID0gcm93LT52 aXNpYmxlX2hlaWdodDsKKyAgLyogRG9uJ3QgbGV0IHRoZSBjdXJzb3IgZXhjZWVkIHRoZSBkaW1l bnNpb25zIG9mIHRoZSByb3csIHNvIHRoYXQKKyAgdGhlIHVwcGVyL2xvd2VyIHNpZGUgb2YgdGhl IGJveCBhcmVuJ3QgY2xpcHBlZC4gICovCisgIGludCB3X2hlYWRlcl9saW5lX2hlaWdodCA9IFdJ TkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICBpbnQgd190ZXh0X2JvdHRvbV95ID0gd2lu ZG93X3RleHRfYm90dG9tX3kgKHcpIC0gKmg7CisgIGlmICh5IDwgd19oZWFkZXJfbGluZV9oZWln aHQpCisgICAgeworICAgICAgKmggPSBtYXggKCpoIC0gKHdfaGVhZGVyX2xpbmVfaGVpZ2h0IC0g eSkgKyAxLCAqaCk7CisgICAgICB5ID0gd19oZWFkZXJfbGluZV9oZWlnaHQgLSAxOworICAgICAg Ly8gZnByaW50ZiAoc3RkZXJyLCAiQ09ORElUSU9OICMgMVxuIik7CisgICAgfQorICAgZWxzZSBp ZiAoeSA+IHdfdGV4dF9ib3R0b21feSkKKyAgICAgeworICAgICAgICpoICs9IHkgLSB3X3RleHRf Ym90dG9tX3k7CisgICAgICAgeSA9IHdfdGV4dF9ib3R0b21feTsKKyAgICAgICAvLyBmcHJpbnRm IChzdGRlcnIsICJDT05ESVRJT04gIyAyXG4iKTsKKyAgICAgfQorICAqZnkgPSBXSU5ET1dfVE9f RlJBTUVfUElYRUxfWSAodywgeSk7CisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgeworICAg ICAgY2FzZSBNQ19CQVI6CisgICAgICAgIHsKKyAgICAgICAgICBpZiAoY3Vyc29yX3dpZHRoIDwg MSkKKyAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IG1heCAoRlJBTUVfQ1VSU09SX1dJRFRIIChm KSwgMSk7CisgICAgICAgICAgaWYgKGN1cnNvcl93aWR0aCA8IGdseXBoLT5waXhlbF93aWR0aCkK KyAgICAgICAgICAqd2QgPSBjdXJzb3Jfd2lkdGg7CisgICAgICAgICAgYnJlYWs7CisgICAgICAg IH0KKyAgICAgIGNhc2UgTUNfSEJBUjoKKyAgICAgICAgeworICAgICAgICAgIGludCBjdXJzb3Jf aGVpZ2h0ID0gKGN1cnNvcl93aWR0aCA8IDEpID8gbHJpbnQgKDAuMjUgKiAqaCkgOiBjdXJzb3Jf d2lkdGg7CisgICAgICAgICAgaWYgKGN1cnNvcl9oZWlnaHQgPiByb3ctPmhlaWdodCkKKyAgICAg ICAgICAgIGN1cnNvcl9oZWlnaHQgPSByb3ctPmhlaWdodDsKKyAgICAgICAgICAvKiBDdXJzb3Ig c21hbGxlciB0aGFuIGxpbmUgaGVpZ2h0LCBzbyBtb3ZlIGRvd24uICovCisgICAgICAgICAgaWYg KCpoID4gY3Vyc29yX2hlaWdodCkK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isgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19nZXRfY3Vyc29yX2dseXBoICh3 LCBjdXJzb3JfbWF0cml4LCBjdXJzb3Jfcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9z KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgYm9vbCBjdXJzb3Jf YXRfZnJpbmdlX3AgPSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgY3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPmN1cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT5leGFjdF93aW5kb3dfd2lk dGhfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09 IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJz b3IueCA9PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7CisgIGJvb2wgY3Vyc29yX2JleW9uZF9m cmluZ2VfcCA9IChjdXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgY3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0K KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFjdXJzb3Jfcm93LT5leGFjdF93 aW5kb3dfd2lkdGhfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5jdXJzb3IueCA+PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPmN1cnNvci54ID49IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRoKTsKKyAgaW50 IGZyYW1lX2NoYXJfd2lkdGggPSBGUkFNRV9DT0xVTU5fV0lEVEggKGYpOworICBpbnQgdGVtcF9m YWNlX2lkID0gZ2x5cGgtPmZhY2VfaWQ7CisgIHN0cnVjdCBtY19SR0IgYmFja2dyb3VuZDsKKyAg bWNfc2V0X2xzbF9iZyAodywgdGVtcF9mYWNlX2lkLCAmYmFja2dyb3VuZCk7CisgIGJvb2wgcmVh bF9mYWtlX2N1cnNvcl9wID0gKG9wb2ludF94ID09IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgb3BvaW50X2hwb3MgPT0gaHBvcworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBvcyk7CisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworLyogICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVT U19HTFlQSCAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAg aWYgKGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgIHx8IGdseXBoLT50eXBlID09IEdM WVBITEVTU19HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgIGZwcmludGYg KHN0ZGVyciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2Qg MHglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAw IDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgIChn bHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICA/ICdDJworICAgICAgICAgOiAnRycp LAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmpl Y3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkK KyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQor ICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICAg ICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBoLT51LmNoLAorICAgICAgICBn bHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAg Z2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9w ID8gIlpWIiA6ICItLSIsCisgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkp OworICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0t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WxhdGl2ZV94IDwgcm93 LT5waXhlbF93aWR0aAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAg IG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnks IGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJz b3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgZXNz ZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlw ZSwKKyAgICAgICAgICAgICAgICAgICBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAm JiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAocmVsYXRp dmVfeCA8IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHJl bGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICBmeCArPSBnbHlw aC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgICAgbWNfaGVscGVyICh3LCBt YXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAg ICAgICAgICAgICAgICAgICAgIHhfbGltaXQgLSByZWxhdGl2ZV94LCBoLCBjdXJzb3JfdHlwZSwg Y3Vyc29yX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwgYmFja2dyb3Vu ZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEhMRVNTLAorICAgICAgICAgICAgICAgICAg ICAgZHJhd19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAg IH0KKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAg ICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEgg ICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZF UlRJQ0FMX1JVTEVSOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9 IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9v bl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZF UlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRf QVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlv bmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1 cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSAxCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9yID09 IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9 PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlw aF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGdseXBo X2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0g TUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IE1DX1JJR0hU X0ZSSU5HRV9CSVRNQVA7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJp eCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgb3BvaW50X2Z4LCB5LCBmeSwgaHBvcywgdnBvcywK KyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVn cm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3As IGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLAorICAgICAgICAg ICAgICAgICBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgRklMTF9DT0xVTU46ICBDSEFSX0dMWVBIIHwg R0xZUEhMRVNTX0dMWVBIICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t ICovCisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBn bHlwaF9mbGF2b3IgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNl ZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBlc3Nl bnRpYWxzLmZjX3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj aF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAg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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgQkVHSU46ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAgICAg Ki8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBT VFJFVENIX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgZnByaW50ZiAo c3RkZXJyLAorICAgICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAw eCUwNnggJTRkICUxLjFkJTEuMWQgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ct PmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAg OiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1Mn LAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmpl Y3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkK KyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQor ICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBn bHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwK Ky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AgICAgICAgICAgIEhPUklaT05UQUxfUlVM RVI6ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworICAgIGNhc2UgSE9SSVpPTlRBTF9SVUxFUjoKKyAgICB7CisgICAgICBpZiAo cmVsYXRpdmVfeCA8IHJvdy0+cGl4ZWxfd2lkdGgKKyAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1 cnNvcl9wKQorICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRp dmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgIHdkLCBoLCBj dXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAg ICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21f d2hlcmUsIGNhY2hlX3R5cGUsCisgICAgICAgICAgICAgICAgICAgYWN0aW9uX3R5cGUpOworICAg ICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0g LSAxCisgICAgICAgICAgJiYgcmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAgICB7CisgICAg ICAgICAgaWYgKHJlbGF0aXZlX3ggPCByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgcmVs YXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgdGVtcF9mYWNlX2lkID0g KHJvdy0+ZmlsbF9saW5lX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBnbHlwaC0+ZmFj ZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAg ICAgIHN0cnVjdCBtY19SR0IgYmFja2dyb3VuZDsKKyAgICAgICAgICBtY19zZXRfbHNsX2JnICh3 LCB0ZW1wX2ZhY2VfaWQsICZiYWNrZ3JvdW5kKTsKKyAgICAgICAgICBtY19oZWxwZXIgKHcsIG1h dHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAg ICAgICAgICAgICAgICAgICAgeF9saW1pdCAtIHJlbGF0aXZlX3gsIGgsIGN1cnNvcl90eXBlLCB4 X2xpbWl0IC0gcmVsYXRpdmVfeCwKKyAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQsIGJh Y2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBITEVTUywKKyAgICAgICAgICAg ICAgICAgICAgIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOwor ICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K Ky8qICAgICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIFNUUkVUQ0hfR0xZ UEggICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAg Y2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBpZiAocm93LT5maWxsX2xpbmVfcAor ICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRb YXJlYV0gLSAxCisgICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsgZ2x5cGgtPnBp eGVsX3dpZHRoKQorICAgICAgICB0ZW1wX2ZhY2VfaWQgPSBnbHlwaC0+ZmFjZV9pZDsKKyAgICAg ICAgZWxzZSBpZiAoIXJvdy0+ZmlsbF9saW5lX3AKKyAgICAgICAgICAgICAgICAgJiYgZ2x5cGgg LSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAg ICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQor ICAgICAgICAgIHRlbXBfZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgIHN0cnVjdCBt Y19SR0IgYmFja2dyb3VuZDsKKyAgICAgIG1jX3NldF9sc2xfYmcgKHcsIHRlbXBfZmFjZV9pZCwg JmJhY2tncm91bmQpOworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNv cl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJv dy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g TUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0 X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxf QkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChj dXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmlu Z2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jv dy0+dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSExFU1M7CisgICAgICBpZiAoZ2x5 cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGds eXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAg ICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVk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RCJk LyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVz ICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAg ICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAg ICAgICByZWxhdGl2ZV94LAorICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAor ICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAg ICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAg ICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICA/ICcwJworICAgICAg ICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAg KHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuaW1nX2lkLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwK KyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2Jv eF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIs CisgICAgICAgICcuJyk7CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09S UzogIElNQUdFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0t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CwgeSwgZnksIGhwb3MsIHZwb3MsCisg ICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVn cm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVf cCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwKKyAgICAgICAgICAg ICAgICAgICBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVI6 ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tICovCisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBjdXJzb3JfdHlw ZSA9IE1DX0hPTExPV19CT1g7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlw aCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3 ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwK KyAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwg ZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwKKyAgICAgICAgICAgICAgICAgYWN0aW9uX3R5cGUpOwor ICAgICAgYnJlYWs7C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8KKyAgfQorICB9Cisv KiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBFTkQ6ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tICovCisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAg ICAgICAgICAgICAgICAgICAgICAgQkVHSU46ICBDT01QT1NJVEVfR0xZUEggICAgICAgICAgICAg ICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgZWxzZSBpZiAoZ2x5 cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQor ICAgICAgeworICAgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICAgIlxuICU1InBEImQv JS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4IiwKKyAgICAgICAgICBnbHlwaCAtIHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkg PyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAg ICAgICAnKycsCisgICAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgICAgKEJVRkZFUlAg KGdseXBoLT5vYmplY3QpCisgICAgICAgICAgID8gJ0InCisgICAgICAgICAgIDogKFNUUklOR1Ag KGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICAgIDogKE5J TFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAg ICAgIDogJy0nKSkpLAorICAgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgICAo dW5zaWduZWQgaW50KSBnbHlwaC0+dS5jbXAuaWQpOworICAgICAgICBmcHJpbnRmIChzdGRlcnIs ICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICAg IGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5l X3ApOworICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmludGYg KHN0ZGVyciwgIiAgJTNkICVzIC4gWyVkLSVkXVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAgICAgICAg ICAgICAgICAgIGdseXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgtPnNsaWNlLmNtcC50byk7Cisg ICAgICAgIGVsc2UKKyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJcbiIpOworICAgICAgfQor ICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8q ICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVV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hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9z LAorICAgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBm b3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0 aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsCisgICAgICAg ICAgICAgICAgICAgYWN0aW9uX3R5cGUpOworICAgICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgcmVsYXRpdmVf eCA8PSB4X2xpbWl0KQorICAgICAgICB7CisgICAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+ cGl4ZWxfd2lkdGg7CisgICAgICAgICAgd2hpbGUgKHJlbGF0aXZlX3ggPD0geF9saW1pdCkKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5 cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAg ICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFj a2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBN Q19HTFlQSExFU1MsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0g ZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgYnJlYWs7 CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAg ICAgICBWRVJUSUNBTF9SVUxFUjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAgICAgICAg Ki8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6Cisg ICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9mcmlu 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 ICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJv dy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAg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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNl IEZJTExfQ09MVU1OOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9 IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+ IHJlbGF0aXZlX3gpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNf R0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF96 dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVT UworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKEJWQVIgKGIs IGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg IU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3kgPT0geQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0g dnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExF U1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAg ICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRp dmVfeCw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AgICAgICAgICAgICAgICAgIEJFR0lOOiAgWFdJ REdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0gKi8KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gWFdJREdFVF9HTFlQSCkKKyAgewor I2lmbmRlZiBIQVZFX1hXSURHRVRTCisgICAgZWFzc3VtZSAoZmFsc2UpOworI2Vsc2UKKyAgICBp ZiAobWNfc3RkZXJyX3ApCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICJcbiAgJTVk LyUtNWQgJTVkICU0YyAlNmQgJWMgJTNkIDB4JTA1eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVj XG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgo cm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAg ICByZWxhdGl2ZV94LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAg ICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6 IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAg IDogJy0nKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPmZh Y2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5y aWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+dS54d2lkZ2V0LAorICAgICAgICBnbHlw aC0+aHBvcywgZ2x5cGhfenZfcCA/ICJ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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBj YXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAgaWYgKHJlbGF0aXZlX3ggPD0geF9s aW1pdAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBl ciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZw b3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgs IGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5h Y3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwKKyAgICAg ICAgICAgICAgICAgICBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2 ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBo LT5waXhlbF93aWR0aDsKKyAgICAgICAgICB3aGlsZSAocmVsYXRpdmVfeCA8PSB4X2xpbWl0KQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBn bHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAg ICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBi YWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3As IE1DX0dMWVBITEVTUywgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICAgICAg ICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCAr PSBmcmFtZV9jaGFyX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBicmVh azsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAg ICAgICAgICBWRVJUSUNBTF9SVUxFUjogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAgICAgICAg ICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoK KyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoY3Vyc29yX2F0X2Zy aW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT5jb250 aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJU SUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmICFyb3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfUklH SFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9i ZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT51c2Vk W1RFWFRfQVJFQV0gIT0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0g cm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb3BvaW50X3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IE1DX0dMWVBIOworICAgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9C QVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURf VkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1D X1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNf VkVSVElDQUxfQkFSCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZF UlRJQ0FMX0JBUikKKyAgICAgICAgY3Vyc29yX3R5cGUgPSBNQ19SSUdIVF9GUklOR0VfQklUTUFQ OworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIG9w b2ludF9meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJz b3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAg ICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93 aGVyZSwKKyAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAg YnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAg ICAgICAgICAgICAgIEZJTExfQ09MVU1OOiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAgICAgICAg ICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgRklMTF9DT0xVTU46 CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID4gcmVsYXRpdmVfeCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIG1jX2hlbHBlciAo dywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZw b3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBm b3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2 ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAg Y2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBDVVJTT1JfSU5ESUNBVE9SOgorICAgIHsKKyAgICAg IGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICB9CisgIH0KKy8qIC0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRU5E OiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0gKi8KK30KKwordm9pZAorbWNfZHJhd19yb3cgKHN0cnVjdCB3aW5kb3cgKncs IHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAg ICAgICAgICAgIHN0cnVjdCBnbHlwaCAqc3RhcnQsIGludCB4LCBpbnQgaHBvc19sZW5ndGgsIGlu dCB2cG9zLAorICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKmN1cnNvcl9tYXRyaXgs IHN0cnVjdCBtY19lc3NlbnRpYWxzIGVzc2VudGlhbHMsCisgICAgICAgICAgICAgZW51bSBtY19y b3dfcG9zaXRpb24gcm93X3Bvc2l0aW9uLCBib29sIGRyYXdfcCwgZW51bSBtY19kcmF3X3Jvd190 eXBlIGZyb21fd2hlcmUpCit7CisgIC8vICBjbG9ja190IGNsb2NrX3N0YXJ0ID0gY2xvY2soKTsK KyAgLyogVzMyIEVtYWNzIGNyYXNoZXMgb24gc3RhcnR1cCB3aXRob3V0IGEgYEJVRkZFUlAnIGNo ZWNrIGluIGB1cGRhdGVfd2luZG93Jy4gKi8KKyAgaWYgKCFCVUZGRVJQICh3LT5jb250ZW50cykp CisgICAgcmV0dXJuOworICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKyAgQ0hFQ0tf QlVGRkVSIChidWYpOworICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgaWYg KE5JTFAgKEJWQVIgKGIsIG1jX2NvbmYpKQorICAgICAgJiYgTklMUCAoQlZBUiAoYiwgY3Jvc3No YWlycykpCisgICAgICAmJiBOSUxQIChCVkFSIChiLCBmY192aXNpYmxlKSkpCisgICAgcmV0dXJu OworICBzdHJ1Y3QgZ2x5cGhfcm93ICpib3R0b21fcm93ID0gTUFUUklYX0JPVFRPTV9URVhUX1JP VyAobWF0cml4LCB3KTsKKyAgaW50IGJvdHRvbV92cG9zID0gTUFUUklYX1JPV19WUE9TIChib3R0 b21fcm93LCBtYXRyaXgpOworICBpZiAodnBvcyA9PSBib3R0b21fdnBvcykKKyAgICByZXR1cm47 CisgIGlmICghcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgcmV0dXJuOworICBpbnQgaHBvc19z dGFydCA9IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgaWYgKHRyYWNlX3JlZGlz cGxheV9wKQorICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2RyYXdfcm93ICglZCk6ICBkcmF3X3Ag KCVzKSB8IGhwb3MgKCVkKSB8IGxlbiAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgdnBv cywgZHJhd19wID8gInkiIDogIm4iLCBocG9zX3N0YXJ0LCBocG9zX2xlbmd0aCk7CisgIGludCBv cG9pbnRfZngsIG9wb2ludF9meSwgb3BvaW50X3dkLCBvcG9pbnRfaDsKKyAgaW50IHRleHRfYXJl YV93aWR0aCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgIGludCBoZWFkZXJf bGluZV9mb3JtYXQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgc3RydWN0IGds eXBoX3JvdyAqY3Vyc29yX3JvdyA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPVyAoY3Vyc29yX21hdHJpeCwgdy0+Y3Vy c29yLnZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIHN0 cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBoID0gKHctPmN1cnNvci52cG9zICE9IC0xKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgY3Vyc29y X21hdHJpeCwgY3Vyc29yX3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcykKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIGJvb2wgY3Vyc29yX2F0X2ZyaW5n ZV9wID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSB0ZXh0X2Fy ZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0g Y3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOworICBib29sIGN1cnNvcl9iZXlvbmRfZnJpbmdlX3Ag PSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dp ZHRoX2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29y LnggPj0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5jdXJzb3IueCA+PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7CisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgUkVQTEFDRSBUSEUgUkVBTCBD VVJTT1IKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBlbnVtIGZhY2VfaWQgYmdfZmFjZV9p ZCA9IChjdXJzb3JfZ2x5cGggIT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IGN1cnNvcl9nbHlwaC0+ZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogREVG QVVMVF9GQUNFX0lEOworICBzdHJ1Y3QgbWNfUkdCIGN1cnNvcl9iZzsKKyAgbWNfc2V0X2xzbF9i ZyAodywgYmdfZmFjZV9pZCwgJmN1cnNvcl9iZyk7CisgIC8qIEZJWE1FOiAgUHV0IGluIHNvbWUg Y29kZSB0byBkZWZhdWx0IHRvIE1DX0hPTExPV19CT1ggaWYgdGhlIHVzZXIgaGFzCisgIHVud2l0 dGluZ2x5IGNvbWUgdXAgd2l0aCBzb21lIHVuYWNjZXB0YWJsZSBmb3JtIG9mIHVucmVjb2duaXpl ZCBjdXJzb3IgdHlwZS4gKi8KKyAgTGlzcF9PYmplY3QgbGlzcF90eXBlID0gQlZBUiAoYiwgbWNf cmVhbF9mYWtlX2N1cnNvcik7CisgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUgPSAo Q09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGxpc3BfdHlw ZSk7CisgIGludCBjdXJzb3Jfd2lkdGggPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAg ICAgICAgICAgICA/IFhGSVhOVU0gKFhDQVIgKFhDRFIgKGxpc3BfdHlwZSkpKQorICAgICAgICAg ICAgICAgICAgICAgOiAtMTsKKyAgc3RydWN0IG1jX1JHQiBjdXJzb3JfZmc7CisgIG1jX2NvbG9y X3BpY2tlciAodywgY3Vyc29yX2dseXBoLCBlc3NlbnRpYWxzLCAmY3Vyc29yX2ZnLCAtMSwgY3Vy c29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBDVVJTT1JfSU5ESUNB VE9SKTsKKyAgYm9vbCBmaWxsX2NvbHVtbl90cnVtcHNfcCA9ICghTklMUCAoQlZBUiAoYiwgY2hf dmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQ IChCVkFSIChiLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5jdXJzb3IueCA9PSBlc3NlbnRpYWxzLmZjX3gKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiAhY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgIWN1cnNvcl9iZXlvbmRfZnJpbmdlX3ApOworICAvKiBXZSB1c2UgYSB0ZXN0IHNp bWlsYXIgdG8gdGhlIHJlYWwgZmFrZSBjdXJzb3Igc28gdGhhdCB0aGUgZnJpbmdlIGJpdG1hcCBp cworICBvbmx5IGRyYXduIG9uY2UgcGVyIHdpbmRvdy4gKi8KKyAgaWYgKHZwb3MgPT0gdy0+Y3Vy c29yLnZwb3MKKyAgICAgICYmIGhwb3Nfc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AgICAg ICAgICAgICAgICBmcm9tX3doZXJlLCBDSF9DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAg fQorICBpZiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52 cG9zCisgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAmJiB3LT5j dXJzb3IuaHBvcyA9PSBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgKKyAgICAgICYmICFOSUxQIChC VkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9ob3Jpem9u dGFsX3J1bGVyKSkpCisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0g TUNfSE9MTE9XX1JFQ1RBTkdMRTsKKyAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmds eXBoc1tURVhUX0FSRUFdOworICAgICAgc3RydWN0IGdseXBoICpnbHlwaF9lbmQgPSBnbHlwaCAr IHJvdy0+dXNlZFtURVhUX0FSRUFdOworICAgICAgLyogR2x5cGggZm9yIGEgbGluZSBlbmQgaW4g dGV4dC4gKi8KKyAgICAgIGlmIChnbHlwaCA9PSBnbHlwaF9lbmQgJiYgZ2x5cGgtPmNoYXJwb3Mg PiAwKQorICAgICAgICArK2dseXBoX2VuZDsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCBy b3csIGdseXBoX2VuZCAtIDEsIHctPmN1cnNvci54LCAtMSwgdy0+Y3Vyc29yLnksIC0xLAorICAg ICAgICAgICAgICAgICB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsIC0xLCAtMSwgTUNf UklHSFRfRlJJTkdFX0JJVE1BUCwKKyAgICAgICAgICAgICAgICAgLTEsIGN1cnNvcl9mZywgY3Vy c29yX2JnLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBnbHl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yX3dpZHRoIG9mIDEuICovCisgICAgICBtY19n ZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRf ZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9m eSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBNQ19CQVIsIDEsICZvcG9pbnRfd2QpOworICAgICAgbWNfaGVs cGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4 LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBv cywgdy0+Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisgICAgICAgICAgICAgICAg IE1DX0JBUiwgMSwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1D X0dMWVBITEVTUywKKyAgICAgICAgICAgICAgICAgZHJhd19wLCBmcm9tX3doZXJlLCBOSUxQIChC VkFSIChiLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IENIX0NBQ0hFCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNI RSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBt YXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1 cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQ19I QkFSLCAxLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1 cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAg ICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9p bnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBNQ19IQkFSLCAxLCBjdXJzb3JfZmcs IGN1cnNvcl9iZywgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwKKyAgICAg ICAgICAgICAgICAgZnJvbV93aGVyZSwgTklMUCAoQlZBUiAoYiwgbWNfY29uZikpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQorICBlbHNlIGlmICgh Y3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaCAhPSBOVUxMCisg ICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgJiYgdy0+Y3Vy c29yLmhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA8IGhw b3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPnR5cGUg IT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3 LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHct PmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBj dXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAo dywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+ Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHct PmN1cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBjdXJz b3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBjdXJzb3JfZmcsIGN1cnNvcl9iZywgZXNzZW50aWFscy5h Y3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwg TklMUCAoQlZBUiAoYiwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQor ICBlbHNlIGlmICghY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlw aCAhPSBOVUxMCisgICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAg ICAgJiYgdy0+Y3Vyc29yLmhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAmJiB3LT5jdXJz b3IuaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAmJiBjdXJzb3Jf Z2x5cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICAvKiBJZiBhIHVzZXIg aGFzIHNldCBgeC1zdHJldGNoLWN1cnNvcicgdG8gYSBub24tbmlsIHZhbHVlLCBoZS9zaGUgY2hv c2UgdG8KKyAgICAgIGhhdmUgYSBjdXJzb3IgdGhhdCBzcGFucyB0aGUgZW50aXJlIGxlbmd0aCBv ZiB0aGUgU1RSRVRDSF9HTFlQSC4gKi8KKyAgICAgIGlmICgheF9zdHJldGNoX2N1cnNvcl9wKQor ICAgICAgICB7CisgICAgICAgICAgLyogVGhlIE1DX0hCQVIgc2hhbGwgaGF2ZSBhIGBjdXJzb3Jf d2lkdGhgIG9mIDEuICovCisgICAgICAgICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0 cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHctPmN1cnNvci55LCAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9o LCBNQ19IQkFSLCAxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRf d2QpOworICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwg dy0+Y3Vyc29yLngsIG9wb2ludF9meCwKKyAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci55 LCBvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywKKyAgICAgICAgICAg ICAgICAgICAgIG9wb2ludF93ZCwgb3BvaW50X2gsIE1DX0hCQVIsIDEsIGN1cnNvcl9mZywgY3Vy c29yX2JnLAorICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZ UEgsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgICAgIE5JTFAgKEJWQVIg KGIsIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAg ICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgICAgIH0KKyAg ICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93LCB3LT5jdXJzb3IueCwg Jm9wb2ludF9meCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci55LCAm b3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBl ciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwg dy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3Ms IHctPmN1cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBj dXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBjdXJzb3JfZmcsIGN1cnNvcl9iZywgZXNzZW50aWFs cy5hY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVy ZSwgTklMUCAoQlZBUiAoYiwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAg fQorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgIERS QVcgQU5EIFJFQ09SRCBGQUtFIENVUlNPUlMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBp ZiAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICYmIE5JTFAgKEJWQVIgKGIsIG1jX2luYWN0 aXZlX3dpbmRvd3MpKQorICAgICAgJiYgTklMUCAoQlZBUiAoYiwgY2hfaW5hY3RpdmVfd2luZG93 cykpCisgICAgICAmJiBOSUxQIChCVkFSIChiLCBmY19pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAg cmV0dXJuOworICBpZiAoaHBvc19sZW5ndGggPT0gMSkKKyAgICB7CisgICAgICBpZiAoIU5JTFAg KEJWQVIgKGIsIG1jX2NvbmYpKQorICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisg ICAgICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAg JiYgIU5JTFAgKEJWQVIgKGIsIG1jX2luYWN0aXZlX3dpbmRvd3MpKSkpKQorICAgICAgICB7Cisg ICAgICAgICAgLyogVGhlIHNwYWNlIGFwcGVuZGVkIHRvIGEgcm93IGVuZGluZyB3aXRoIGEgbmV3 IGxpbmUKKyAgICAgICAgICBkb2VzIG5vdCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDAp IHRoYXQgd2UgY2FuCisgICAgICAgICAgdXNlIGZvciB0aGlzIHBhcnRpY3VsYXIgYXBwbGljYXRp b24uICBXaGVuIHRoZXJlIGlzIGEKKyAgICAgICAgICBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVu dHJ5IHRoYXQgYXNzaWducyBhIHZpc2libGUKKyAgICAgICAgICBnbHlwaCB0byBhIG5ldyBsaW5l LCB0aGVyZSBpcyBubyBwcm9ibGVtIGJlY2F1c2UgdGhhdAorICAgICAgICAgIGdseXBoIGhhcyBh IGBnbHlwaC0+Y2hhcnBvcycgdGhhdCB3ZSBjYW4gdXNlLiAgV2hlbgorICAgICAgICAgIG5vIHZp c2libGUgRU9MIGdseXBoIGV4aXN0cywgd2UgdXNlIHRoZSBmb2xsb3dpbmcKKyAgICAgICAgICB0 ZXN0OiAgdGhlIGFwcGVuZGVkIHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMgb25lCisgICAg ICAgICAgbGVzcyB0aGFuIHRoZSBlbmQgb2YgdGhlIG1hdHJpeCByb3cuICovCisgICAgICAgICAg aW50IGhwb3MgPSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgc3Ry dWN0IGdseXBoICpwcmV2aW91c19nbHlwaCA9ICgwIDw9IGhwb3MgLSAxICYmIGhwb3MgLSAxIDwg cm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgICAgICAgICAvLyBzdHJ1Y3Qg Z2x5cGggKmxhc3RfZ2x5cGggPSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RF WFRfQVJFQV0gLSAxOworICAgICAgICAgIGJvb2wgc2tpcF9wID0gKHByZXZpb3VzX2dseXBoICE9 IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hhcnBv cyA9PSBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpIC0gMQorICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHN0YXJ0LT5ieXRlcG9zICE9IGVzc2VudGlhbHMuenZfYnl0ZSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAvKiBXaGVu IGEgYGJ1ZmZlci1kaXNwbGF5LXRhYmxlJyBlbnRyeSBjb250YWlucworICAgICAgICAgICAgICAg ICAgICAgICAgYSB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIgKCLCuyIpLCB0aGUgc3Vic2VxdWVudAor ICAgICAgICAgICAgICAgICAgICAgICAgU1RSRVRDSF9HTFlQSCB3aWxsIGhhdmUgdGhlIHNhbWUg c3RhcnQtPmNoYXJwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgIGFzIHRoZSBhZm9yZW1lbnRp b25lZCB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIuICovCisgICAgICAgICAgICAgICAgICAgICAgICA6 IChwcmV2aW91c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBw cmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9PSBzdGFydC0+Y2hhcnBvcykKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICA6IGZhbHNlOworICAg ICAgICAgIGludCBwb3NpbnQgPSAocm93X3Bvc2l0aW9uID09IFBPU1RfWlYpCisgICAgICAgICAg ICAgICAgICAgICAgICAgPyAtMQorICAgICAgICAgICAgICAgICAgICAgICA6IChyb3dfcG9zaXRp b24gPT0gQVRfWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNzZW50aWFscy56dgor ICAgICAgICAgICAgICAgICAgICAgICA6IChzdGFydC0+Ynl0ZXBvcyAhPSBlc3NlbnRpYWxzLnp2 X2J5dGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgc3RhcnQgLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdID09IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgLSAxCisgICAgICAgICAgICAg ICAgICAgICAgIDogKHN0YXJ0LT5ieXRlcG9zID09IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0g cm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNz ZW50aWFscy56dgorICAgICAgICAgICAgICAgICAgICAgICA6IHN0YXJ0LT5jaGFycG9zOworICAg ICAgICAgIExpc3BfT2JqZWN0IHNwZWNzID0gbWNfYXNzb2MgKG1ha2VfZml4bnVtIChwb3NpbnQp LCBCVkFSIChiLCBtY19jb25mKSk7CisgICAgICAgICAgaWYgKCgoaGVhZGVyX2xpbmVfZm9ybWF0 ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9 PSAwKQorICAgICAgICAgICAgICAmJiAhTklMUCAoc3BlY3MpCisgICAgICAgICAgICAgICYmIHJv dy0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgJiYgIXNraXBf cAorICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gIT0gUE9TVF9aVikKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgTGlzcF9PYmplY3QgbGlzcF90eXBlID0gbWNfbnRoICgxLCBzcGVj cyk7CisgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUgPSAoQ09O U1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxpc3BfdHlwZSkpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1jX2xpc3BfdG9f Y3Vyc29yX3R5cGUgKGxpc3BfdHlwZSk7CisgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gKHN0 YXJ0LT50eXBlID09IElNQUdFX0dMWVBIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g TUNfSE9MTE9XX0JPWAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogY3Vyc29yX3R5cGU7 CisgICAgICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGggPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFhGSVhOVU0gKFhDQVIgKFhDRFIgKGxp c3BfdHlwZSkpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAtMTsKKyAgICAg ICAgICAgICAgTGlzcF9PYmplY3QgbWNfZm9yZWdyb3VuZCA9IG1jX250aCAoMiwgc3BlY3MpOwor ICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICAgICAgaWYgKFNU UklOR1AgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgIG1jX3h3X2NvbG9yX3ZhbHVl cyAodywgbWNfZm9yZWdyb3VuZCwgJmxzbF9mZyk7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAo VkVDVE9SUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAgIGxzbF9mZy5yZWQgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwg MCkpOworICAgICAgICAgICAgICAgICAgICBsc2xfZmcuZ3JlZW4gPSBYRkxPQVRfREFUQSAoQVJF RiAobWNfZm9yZWdyb3VuZCwgMSkpOworICAgICAgICAgICAgICAgICAgICBsc2xfZmcuYmx1ZSA9 IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAyKSk7CisgICAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChOSUxQIChtY19mb3JlZ3JvdW5kKSkKKyAg ICAgICAgICAgICAgICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBzdGFydCwgZXNzZW50aWFscywg JmxzbF9mZywgcG9zaW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1 cnNvcl90eXBlLCByb3dfcG9zaXRpb24sIE1VTFRJUExFX0NVUlNPUlMpOworICAgICAgICAgICAg ICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAgICAg ICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAg ICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhf bGltaXQsIHJvdy0+eSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0sIHZwb3MsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAg ICAgIGN1cnNvcl93aWR0aCwgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9u LAorICAgICAgICAgICAgICAgICAgICAgICAgIGxzbF9mZywgTVVMVElQTEVfQ1VSU09SUywgZHJh d19wLCBmcm9tX3doZXJlLCBNQ19DQUNIRSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAg ICAgIGlmICghTklMUCAoQlZBUiAoYiwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgJiYgKGVzc2Vu dGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisg ICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgZmNfaW5hY3RpdmVfd2luZG93cykp KSkKKyAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAg ICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHctPm1jLmxudW1fcGl4ZWxfd2lkdGgpCisgICAg ICAgIHsKKyAgICAgICAgICBpbnQgeF9saW1pdCA9IHggKyBzdGFydC0+cGl4ZWxfd2lkdGg7Cisg ICAgICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnggPT0gZXNzZW50 aWFscy5mY194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnkgPT0gcm93LT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+Y3Vyc29yLmhwb3MgPT0gc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnZwb3MgPT0gdnBvcyk7 CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgbWNfY29sb3JfcGlj a2VyICh3LCBzdGFydCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIE1DX0JBUiwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgRklMTF9DT0xVTU4pOworICAgICAgICAg IGlmICh4ICsgc3RhcnQtPnBpeGVsX3dpZHRoIDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAg ICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAg ICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgJiYgKChz dGFydCAhPSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAx CisgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHgKKyAgICAgICAgICAg ICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPCB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoKQorICAg ICAgICAgICAgICAgICAgfHwgKHN0YXJ0ID09IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ct PnVzZWRbVEVYVF9BUkVBXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxz LmZjX3ggPj0geCkpCisgICAgICAgICAgICAgICYmIHJvdy0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0 b21feSAodykKKyAgICAgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAg ICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGlt aXQsIHJvdy0+eSwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdLCB2cG9zLCBNQ19CQVIsIDEsCisgICAgICAgICAgICAgICAgICAgICAgIGN1cnNv cl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgbHNsX2ZnLAorICAgICAgICAgICAg ICAgICAgICAgICBGSUxMX0NPTFVNTiwgZHJhd19wLCBmcm9tX3doZXJlLCBGQ19DQUNIRSk7Cisg ICAgICAgIH0KKyAgICAgIGlmICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAg ICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hvcml6b250YWxfcnVsZXIpKQorICAgICAgICAgICYm IChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3Rp dmVfcAorICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2luYWN0aXZlX3dp bmRvd3MpKSkpCisgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAg eworICAgICAgICAgIGludCB4X2xpbWl0ID0gKHN0YXJ0ID09IHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICA/ IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgOiB4ICsgc3RhcnQtPnBp eGVsX3dpZHRoOworICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgIG1j X2NvbG9yX3BpY2tlciAodywgc3RhcnQsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19IQkFS LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBIT1JJWk9OVEFMX1JV TEVSKTsKKyAgICAgICAgICAvKiBQcmVzZXJ2ZSBzdXBwb3J0IGZvciBkZWZhdWx0IGJlaGF2aW9y IHN1Y2ggdGhhdCBhIHVzZXIgbWF5CisgICAgICAgICAgc3BlY2lmeSB0aGUgaGVpZ2h0IG9mIGFu IE1DX0hCQVIsIHdoaWNoIGJlZ2lucyBpdHMgam91cm5leQorICAgICAgICAgIGFzIHRoZSBgY3Vy c29yX3dpZHRoJy4gIGBtY19nZXRfY3Vyc29yX2dlb21ldHJ5JyByZWFkanVzdHMuICovCisgICAg ICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9s aW1pdCwgcm93LT55LAorICAgICAgICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdLCB2cG9zLCBNQ19IQkFSLCAxLAorICAgICAgICAgICAgICAgICAgICAgY3Vyc29y X21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsCisgICAgICAgICAgICAg ICAgICAgICBIT1JJWk9OVEFMX1JVTEVSLCBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsK KyAgICAgICAgfQorICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAg ICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICYm IChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3Rp dmVfcAorICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2luYWN0aXZlX3dp bmRvd3MpKSkpCisgICAgICAgICAgJiYgIWZpbGxfY29sdW1uX3RydW1wc19wKQorICAgICAgICB7 CisgICAgICAgICAgY3Vyc29yX3R5cGUgPSAoc3RhcnQtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisg ICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0hPTExPV19CT1gKKyAgICAgICAgICAgICAgICAg ICAgICAgIDogTUNfQkFSOworICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0 aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9ICh3 LT5jdXJzb3IueSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsKKyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxz bF9mZzsKKyAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIHN0YXJ0LCBlc3NlbnRpYWxzLCAm bHNsX2ZnLCAtMSwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICByb3df cG9zaXRpb24sIFZFUlRJQ0FMX1JVTEVSKTsKKyAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9m b3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9y bWF0ID09IDApCisgICAgICAgICAgICAgICYmICgoc3RhcnQgIT0gcm93LT5nbHlwaHNbVEVYVF9B UkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMQorICAgICAgICAgICAgICAgICAgICYmIHct PmN1cnNvci54ID49IHgKKyAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHggKyBz dGFydC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB8fCAoc3RhcnQgPT0gcm93LT5n bHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMQorICAgICAgICAgICAg ICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHgpKQorICAgICAgICAgICAgICAmJiByb3ctPnkg PD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICYmICFyZWFsX2Zha2Vf Y3Vyc29yX3ApCisgICAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBzdGFydCwg VEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ctPnksCisgICAgICAgICAgICAgICAgICAgICAgIHN0 YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwgdnBvcywgY3Vyc29yX3R5cGUsIDEsCisgICAg ICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlv biwgbHNsX2ZnLAorICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUiwgZHJhd19w LCBmcm9tX3doZXJlLCBDSF9DQUNIRSk7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAg ICAgeworICAgICAgICBpbnQgcmVsYXRpdmVfeCA9IDA7CisgICAgICAgIGZvciAoaW50IGFyZWEg PSBMRUZUX01BUkdJTl9BUkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2FyZWEpCisgICAgICAgICAg eworICAgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdOwor ICAgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaF9lbmQgPSBnbHlwaCArIHJvdy0+dXNlZFth cmVhXTsKKyAgICAgICAgICAgIC8qIEdseXBoIGZvciBhIGxpbmUgZW5kIGluIHRleHQuICovCisg ICAgICAgICAgICBpZiAoYXJlYSA9PSBURVhUX0FSRUEgJiYgZ2x5cGggPT0gZ2x5cGhfZW5kICYm IGdseXBoLT5jaGFycG9zID4gMCkKKyAgICAgICAgICAgICAgKytnbHlwaF9lbmQ7CisgICAgICAg ICAgICBmb3IgKDsgZ2x5cGggPCBnbHlwaF9lbmQ7ICsrZ2x5cGgpCisgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICBpZiAodnBvcyAhPSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAg ICAgICAgICAmJiBnbHlwaCAhPSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICYm IGVzc2VudGlhbHMuZmNfeCA8IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgJiYgdy0+ Y3Vyc29yLnggPCByZWxhdGl2ZV94CisgICAgICAgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIg KGIsIG1jX2NvbmYpKSkKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAg IGlmICghTklMUCAoQlZBUiAoYiwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICYmIChl c3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICB8fCAoIWVzc2VudGlh bHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo YiwgbWNfaW5hY3RpdmVfd2luZG93cykpKSkpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgICAgIC8qIFRoZSBzcGFjZSBhcHBlbmRlZCB0byBhIHJvdyBlbmRpbmcgd2l0aCBh IG5ldyBsaW5lIGRvZXMKKyAgICAgICAgICAgICAgICAgICAgbm90IGhhdmUgYSBgZ2x5cGgtPmNo YXJwb3NgICgtMSwgMCkgdGhhdCB3ZSBjYW4gdXNlIGZvciB0aGlzCisgICAgICAgICAgICAgICAg ICAgIHBhcnRpY3VsYXIgYXBwbGljYXRpb24uICBXaGVuIGEgYGJ1ZmZlci1kaXNwbGF5LXRhYmxl JyBlbnRyeQorICAgICAgICAgICAgICAgICAgICBhc3NpZ25zIGEgdmlzaWJsZSBnbHlwaCB0byBh IG5ldyBsaW5lLCB0aGVyZSBpcyBubyBwcm9ibGVtCisgICAgICAgICAgICAgICAgICAgIGJlY2F1 c2UgdGhhdCBnbHlwaCBoYXMgYSBgZ2x5cGgtPmNoYXJwb3MnIHRoYXQgd2UgY2FuIHVzZS4KKyAg ICAgICAgICAgICAgICAgICAgV2hlbiBubyB2aXNpYmxlIEVPTCBnbHlwaCBleGlzdHMsIHdlIHVz ZSB0aGUgZm9sbG93aW5nIHRlc3Q6CisgICAgICAgICAgICAgICAgICAgIHRoZSBhcHBlbmRlZCBz cGFjZSBoYXMgYSBwb3NpdGlvbiB0aGF0IGlzIG9uZSBsZXNzIHRoYW4gdGhlCisgICAgICAgICAg ICAgICAgICAgIGVuZCBvZiB0aGUgbWF0cml4IHJvdy4gKi8KKyAgICAgICAgICAgICAgICAgICAg aW50IGhwb3MgPSBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgICAg ICAgICAgIHN0cnVjdCBnbHlwaCAqcHJldmlvdXNfZ2x5cGggPSAoMCA8PSBocG9zIC0gMSAmJiBo cG9zIC0gMSA8IHJvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgaHBv cyAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogTlVMTDsKKyAgICAgICAgICAgICAgICAgICAgLy8gc3RydWN0IGdseXBoICpsYXN0X2dseXBo ID0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAg ICAgICAgICAgICAgICAgICAgYm9vbCBza2lwX3AgPSAocHJldmlvdXNfZ2x5cGggIT0gTlVMTAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hh cnBvcyA9PSBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpIC0gMQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+Ynl0ZXBvcyAhPSBlc3NlbnRpYWxzLnp2X2J5 dGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBXaGVuIGEgYGJ1ZmZlci1kaXNwbGF5LXRhYmxl JyBlbnRyeSBjb250YWlucworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEgdmlz aWJsZSB0YWIgY2hhcmFjdGVyICgiwrsiKSwgdGhlIHN1YnNlcXVlbnQKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBTVFJFVENIX0dMWVBIIHdpbGwgaGF2ZSB0aGUgc2FtZSBnbHlw aC0+Y2hhcnBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFzIHRoZSBhZm9y ZW1lbnRpb25lZCB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIuICovCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAocHJldmlvdXNfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHByZXZpb3VzX2dseXBoLT5jaGFycG9zID09IGdseXBo LT5jaGFycG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0cnVlCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBmYWxzZTsKKyAgICAgICAgICAgICAg ICAgICAgaW50IHBvc2ludCA9IChyb3dfcG9zaXRpb24gPT0gUE9TVF9aVikKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyAtMQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAocm93X3Bvc2l0aW9uID09IEFUX1pWKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChnbHlwaC0+Ynl0ZXBvcyAhPSBlc3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XSA9PSByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSAtIDEKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoLT5ieXRlcG9zID09IGVzc2VudGlhbHMuenZf Ynl0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGggLSByb3ct PmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IGdseXBoLT5jaGFycG9zOworICAgICAgICAgICAgICAgICAg ICBMaXNwX09iamVjdCBzcGVjcyA9IG1jX2Fzc29jIChtYWtlX2ZpeG51bSAocG9zaW50KSwgQlZB UiAoYiwgbWNfY29uZikpOworICAgICAgICAgICAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9m b3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGhlYWRl cl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKHNw ZWNzKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2Jv dHRvbV95ICh3KQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXNraXBfcAorICAgICAgICAg ICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uICE9IFBPU1RfWlYpCisgICAgICAgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QgbGlzcF90eXBl ID0gbWNfbnRoICgxLCBzcGVjcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1 cnNvcl90eXBlIGN1cnNvcl90eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfbGlzcF90 b19jdXJzb3JfdHlwZSAoWENBUiAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1jX2xpc3BfdG9fY3Vyc29yX3R5 cGUgKGxpc3BfdHlwZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IChn bHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogY3Vyc29yX3R5cGU7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY3Vyc29y X3dpZHRoID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gWEZJWE5VTSAoWENBUiAoWENEUiAobGlzcF90eXBlKSkpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAtMTsKKyAgICAgICAgICAg ICAgICAgICAgICAgIExpc3BfT2JqZWN0IG1jX2ZvcmVncm91bmQgPSBtY19udGggKDIsIHNwZWNz KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAg ICAgICAgICAgICAgICAgICAgaWYgKFNUUklOR1AgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAg ICAgICAgICAgICAgICAgICBtY194d19jb2xvcl92YWx1ZXMgKHcsIG1jX2ZvcmVncm91bmQsICZs c2xfZmcpOworICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChWRUNUT1JQIChtY19m b3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBsc2xfZmcucmVkID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVn cm91bmQsIDApKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5ncmVlbiA9 IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAxKSk7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBsc2xfZmcuYmx1ZSA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3Jv dW5kLCAyKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKE5JTFAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBnbHlwaCwgZXNzZW50aWFscywg JmxzbF9mZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg cG9zaW50LCBjdXJzb3JfdHlwZSwgcm93X3Bvc2l0aW9uLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTKTsKKyAgICAgICAgICAg ICAgICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7Cisg ICAgICAgICAgICAgICAgICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcs IFRFWFRfQVJFQSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJp eCwgcm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgeF9saW1pdCwgcm93LT55LCBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIGN1cnNvcl90eXBl LCBjdXJzb3Jfd2lkdGgsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgbHNsX2ZnLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTLCBkcmF3X3AsIGZyb21fd2hl cmUsIE1DX0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBmY192aXNpYmxlKSkKKyAg ICAgICAgICAgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFOSUxQIChCVkFSIChiLCBmY19pbmFjdGl2ZV93aW5kb3dzKSkpKQorICAgICAg ICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAg ICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB3LT5tYy5sbnVtX3BpeGVsX3dp ZHRoKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpbnQgeF9saW1p dCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICAgICAgICAg IGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci54ID09IGVzc2VudGlhbHMuZmNf eAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5j dXJzb3IueSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct PmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGds eXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0 IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywg Z2x5cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19CQVIsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBGSUxMX0NPTFVNTik7CisgICAgICAg ICAgICAgICAgICAgIGlmIChocG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAgICAgICAgICAg ICAgICYmIGhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgKKyAgICAgICAgICAgICAgICAg ICAgICAgICYmIHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGggPD0gdGV4dF9hcmVhX3dp ZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAg JiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVf Zm9ybWF0ID09IDApCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGdseXBoICE9IGdseXBo X2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194 ID49IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFs cy5mY194IDwgcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICB8fCAoZ2x5cGggPT0gZ2x5cGhfZW5kIC0gMQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0gcmVsYXRpdmVfeCkpCisgICAg ICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcp CisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAg ICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCBy ZWxhdGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93 LT55LCBocG9zLCB2cG9zLCBNQ19CQVIsIDEsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywgRklM TF9DT0xVTU4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21f d2hlcmUsIEZDX0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBp ZiAoIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAmJiAh TklMUCAoQlZBUiAoYiwgY2hfaG9yaXpvbnRhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAg ICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICB8fCAoIWVz c2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAo QlZBUiAoYiwgY2hfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAgICAgICAgICAgJiYg dnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgICAgaW50IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOwor ICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9B UkVBXTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAg ICAgICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgZ2x5cGgsIGVzc2VudGlhbHMsICZsc2xf ZmcsIC0xLCBNQ19IQkFSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJv d19wb3NpdGlvbiwgSE9SSVpPTlRBTF9SVUxFUik7CisgICAgICAgICAgICAgICAgICAgIC8qIFBy ZXNlcnZlIHN1cHBvcnQgZm9yIGRlZmF1bHQgYmVoYXZpb3Igc3VjaCB0aGF0IGEgdXNlciBtYXkK KyAgICAgICAgICAgICAgICAgICAgc3BlY2lmeSB0aGUgaGVpZ2h0IG9mIGFuIE1DX0hCQVIsIHdo aWNoIGJlZ2lucyBpdHMgam91cm5leQorICAgICAgICAgICAgICAgICAgICBhcyB0aGUgYGN1cnNv cl93aWR0aCcuICBgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeScgcmVhZGp1c3RzLiAqLworICAgICAg ICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICAgICAgICAg ICAgICAmJiBocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoKQorICAgICAgICAgICAgICAg ICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94 LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9z LCB2cG9zLCBNQ19IQkFSLCAxLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsIEhPUklaT05UQUxf UlVMRVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hl cmUsIENIX0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAo IU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAmJiAhTklM UCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAmJiAo ZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgfHwgKCFlc3NlbnRp YWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIg KGIsIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAgICAgICAgICAgICYmICFmaWxs X2NvbHVtbl90cnVtcHNfcCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg ICAgY3Vyc29yX3R5cGUgPSAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBNQ19CQVI7CisgICAgICAgICAgICAgICAgICAgIGludCB4X2xp bWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAg ICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnkgPT0gcm93LT55CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52 cG9zID09IHZwb3MpOworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBs c2xfZmc7CisgICAgICAgICAgICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgZ2x5cGgsIGVz c2VudGlhbHMsICZsc2xfZmcsIC0xLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICByb3dfcG9zaXRpb24sIFZFUlRJQ0FMX1JVTEVSKTsKKyAgICAgICAg ICAgICAgICAgICAgaWYgKGhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAgICAgICAgICAg ICAgJiYgaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAgICAgICAg ICAgICAgJiYgKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAg ICAgICAgICAgICAgICAgJiYgKChnbHlwaCAhPSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHJlbGF0aXZlX3gKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPCByZWxhdGl2ZV94ICsgZ2x5cGgtPnBp eGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChnbHlwaCA9PSBnbHlw aF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54 ID49IHJlbGF0aXZlX3gpKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT55IDw9IHdp bmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJlYWxf ZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJp eCwgcm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwgeF9saW1pdCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHJvdy0+eSwgaHBvcywgdnBvcywgY3Vyc29yX3R5cGUsIDEsIGN1 cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxz LCByb3dfcG9zaXRpb24sIGxzbF9mZywgVkVSVElDQUxfUlVMRVIsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93 aWR0aDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgIH0KKyAgLy8gIGNsb2Nr X3QgY2xvY2tfZW5kID0gY2xvY2soKTsKKyAgLy8gIGRvdWJsZSBjcHVfdGltZV91c2VkID0gKChk b3VibGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8v ICBmcHJpbnRmIChzdGRlcnIsICJtY19kcmF3X3JvdyAoJXMpOiAgVElNRSAoJWYpXG4iLCBtY193 aW5kb3cgKHcpLCBjcHVfdGltZV91c2VkKTsKK30KKworYm9vbAorbWNfcmVkcmF3X3JvdyAoc3Ry dWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhf cm93ICpyb3csCisgICAgICAgICAgICAgICBlbnVtIGdseXBoX3Jvd19hcmVhIGFyZWEsIGludCBz dGFydF94LCBpbnQgc3RhcnRfaHBvcywgaW50IGVuZF9ocG9zLAorICAgICAgICAgICAgICAgYm9v bCBjbGVhcl9lb2xfcCwgZW51bSBkcmF3X2dseXBoc19mYWNlIGhsLAorICAgICAgICAgICAgICAg ZW51bSBtY19yZWRyYXdfcm93X3R5cGUgZnJvbV93aGVyZSkKK3sKKyAgYm9vbCBnb19wID0gKCh3 LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA+IDA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BjbG9jaygpOworICBp bnQgdm50aCA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAvKiBTVFJFVENIX0dM WVBIIG1heSBjb250YWluIG1vcmUgdGhhbiBvbmUgZmFrZSBjdXJzb3IgYXQgdGhlIHNhbWUgSFBP Uy4gKi8KKyAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOwor ICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICArK2NhY2hlX3R5cGUpCisgICAg eworICAgICAgZm9yIChpbnQgbnRoID0gMDsKKyAgICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVf cCAody0+bWNfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGgpOworICAgICAgICAgICArK250 aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB4ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXS54OworICAgICAgICAgIGludCBmeCA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZng7CisgICAgICAgICAgaW50IHkg PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLnk7CisgICAg ICAgICAgaW50IGZ5ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXS5meTsKKyAgICAgICAgICBpbnQgaHBvcyA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF0uaHBvczsKKyAgICAgICAgICBpbnQgdnBvcyA9IHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0udnBvczsKKyAgICAgICAgICBp bnQgd2QgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLndk OworICAgICAgICAgIGludCBoID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS5oOworICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUg PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl90 eXBlOworICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl93aWR0aDsKKyAgICAgICAgICBzdHJ1Y3Qg bWNfUkdCIGxzbF9mZyA9IHsucmVkID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXS5mZy5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg LmdyZWVuID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5m Zy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcuYmx1ZX07CisgICAg ICAgICAgLy8gIHN0cnVjdCBtY19SR0IgbHNsX2JnID0gey5yZWQgPSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLnJlZCwKKyAgICAgICAgICAvLyAgICAg ICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ncmVlbiwKKyAgICAgICAgICAvLyAgICAgICAgICAgICAg ICAgICAgICAgICAgLmJsdWUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhdLmJnLmJsdWV9OworICAgICAgICAgIGJvb2wgYWN0aXZlX3AgPSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmFjdGl2ZV9wOworICAgICAgICAg IGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGhfZmxhdm9yOworICAgICAgICAgIGJvb2wgZW5hYmxl ZF9wID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFi bGVkX3A7CisgICAgICAgICAgaWYgKHZwb3MgPT0gdm50aAorICAgICAgICAgICAgICAmJiAoKGhw b3MgPj0gc3RhcnRfaHBvcworICAgICAgICAgICAgICAgICAgICYmIGhwb3MgPCBlbmRfaHBvcykK KyAgICAgICAgICAgICAgICAgIC8qIEEgZmxvYXRpbmcgY3Vyc29yIGJleW9uZCB0aGUgZW5kIG9m IHRoZSBnbHlwaCByb3cuICovCisgICAgICAgICAgICAgICAgICB8fCAoaHBvcyArIDEgPT0gc3Rh cnRfaHBvcworICAgICAgICAgICAgICAgICAgICAgICYmIGhwb3MgKyAxID09IGVuZF9ocG9zKSkK KyAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBib29sIHJlbW92ZV9wID0gZmFsc2U7CisgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHli cmlkICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lk dGgsIGxzbF9mZywgYWN0aXZ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k7CisgIGZvciAoZW51 bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICBjYWNoZV90eXBl IDwgTk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGZvciAoaW50 IG50aCA9IDA7CisgICAgICAgICAgIG1jX3RyYXZlcnNlX2NhY2hlX3AgKHctPm1jX21hdHJpeCwg Y2FjaGVfdHlwZSwgdm50aCwgbnRoKTsKKyAgICAgICAgICAgKytudGgpCisgICAgICAgIHsKKyAg ICAgICAgICBpbnQgeCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0ueDsKKyAgICAgICAgICBpbnQgZnggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLmZ4OworICAgICAgICAgIGludCB5ID0gdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS55OworICAgICAgICAgIGludCBmeSA9IHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZnk7CisgICAgICAg ICAgaW50IGhwb3MgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmhwb3M7CisgICAgICAgICAgaW50IHZwb3MgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLnZwb3M7CisgICAgICAgICAgaW50IHdkID0gdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS53ZDsKKyAgICAgICAgICBpbnQg aCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uaDsKKyAg ICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIG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aGVfdHlwZV1bbnRoXS5hY3RpdmVfcDsKKyAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBn bHlwaF9mbGF2b3IgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICBib29sIGVuYWJsZWRfcCA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxlZF9wOworICAgICAgICAg IC8qIGBtYXRyaXhfcm93JyBpbiBgZGlzcG5ldy5jYCBjb250YWlucyB0aGUgZm9sbG93aW5nIHRl c3RzLAorICAgICAgICAgIGVhc3NlcnQgKG1hdHJpeCAmJiBtYXRyaXgtPnJvd3MpOworICAgICAg ICAgIGVhc3NlcnQgKHJvdyA+PSAwICYmIHJvdyA8IG1hdHJpeC0+bnJvd3MpOyAqLworICAgICAg ICAgIGJvb2wgYmFyZl9jcmFzaF9vbmUgPSAobWF0cml4ICYmIG1hdHJpeC0+cm93cykgPyBmYWxz ZSA6IHRydWU7CisgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hfb25lKQorICAgICAgICAgICAgY29u dGludWU7CisgICAgICAgICAgYm9vbCBiYXJmX2NyYXNoX3R3byA9ICh2cG9zID49IDAgJiYgdnBv cyA8IG1hdHJpeC0+bnJvd3MpID8gZmFsc2UgOiB0cnVlOworICAgICAgICAgIGlmIChiYXJmX2Ny YXNoX3R3bykKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgIGlmICh2cG9zID09IHZu dGgKKyAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBICisgICAgICAgICAg ICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfZXJhc2Vf Y3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgeSwgaHBvcywgdnBvcywgZ2x5cGhfZmxhdm9yLCBj dXJzb3JfdHlwZSwgd2QpOworICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICAgICAgICAt LXctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgICB9Cisg ICAgICAgICAgICBlbHNlIGlmICh2cG9zID09IHZudGgKKyAgICAgICAgICAgICAgICAgICAgICYm IGVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGJvb2wgcmVtb3Zl X3AgPSB0cnVlOworICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCBtYXRy aXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgbHNsX2Jn LCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGhf Zmxhdm9yLCByZW1vdmVfcCk7CisgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3AgPSBmYWxzZTsKKyAgICAgICAgICAg ICAgICAtLXctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAg ICAgIH0KKyAgICAgICAgfQorICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNl ZFtjYWNoZV90eXBlXSA9IDA7CisgICAgfQorfQorCisvKiBFcmFzZSBmYWtlIGN1cnNvcnMgZnJv bSAobWluLCBydW4uY3VycmVudF95LCBydW4uZGVzaXJlZF95KSB0byBlbmQgb2Ygd2luZG93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PiAwCisgICAgICAgICAgICAg ICAgICAgfHwgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtGQ19DQUNIRV0gPiAwKTsKKyAgYm9v bCBnb190d29fcCA9IChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAm JiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAg ICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGZjX3Zpc2libGUpKQorICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkpKTsKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9w KQorICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX3ByZV9zY3JvbGxfY2xlYW4gKCVzKTpcblwKKyAg JXMgfCBnb19vbmVfcCAoJXMpIHwgZ29fdHdvX3AgKCVzKVxuXAorICBzdGFydF92cG9zICglZCkg fCBucm93c19zY3JvbGxlZCAoJWQpXG5cCisgICVzOiAgcnVuLmN1cnJlbnQvZGVzaXJlZF95ICgl ZC8lZCkgfCBydW4uaGVpZ2h0ICglZClcbiIsCisgICAgbWNfd2luZG93ICh3KSwgKGZyb21fd2hl cmUgPT0gVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX0RPV04pCisgICAgICAgICAg ICAgICAgICAgICA/ICJUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfRE9XTiIKKyAg ICAgICAgICAgICAgICAgICA6IChmcm9tX3doZXJlID09IFRSWV9XSU5ET1dfUkVVU0lOR19DVVJS RU5UX01BVFJJWF9VUCkKKyAgICAgICAgICAgICAgICAgICAgID8gIlRSWV9XSU5ET1dfUkVVU0lO R19DVVJSRU5UX01BVFJJWF9VUCIKKyAgICAgICAgICAgICAgICAgICA6IChmcm9tX3doZXJlID09 IFRSWV9XSU5ET1dfSUQpCisgICAgICAgICAgICAgICAgICAgICA/ICJUUllfV0lORE9XX0lEIgor ICAgICAgICAgICAgICAgICAgIDogIlVOS05PV04iLAorICAgIGdvX29uZV9wID8gInllcyIgOiAi bm8iLCBnb190d29fcCA/ICJ5ZXMiIDogIm5vIiwKKyAgICBzdGFydF92cG9zLCBucm93c19zY3Jv bGxlZCwKKyAgICBydW4uY3VycmVudF95IDwgcnVuLmRlc2lyZWRfeSA/ICLihpMiIDogIuKGkSIs CisgICAgcnVuLmN1cnJlbnRfeSwgcnVuLmRlc2lyZWRfeSwgcnVuLmhlaWdodCk7CisgIGlmICgh Z29fb25lX3AgJiYgIWdvX3R3b19wKQorICAgIHJldHVybjsKKyAgYm9vbCB1cGRhdGluZ19mcmFt ZV9wID0gZmFsc2U7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBp ZiAoWEZSQU1FICh3LT5mcmFtZSkgIT0gZi0+bWNfdXBkYXRpbmdfZnJhbWUKKyAgICAgICYmIChn b19vbmVfcCB8fCBnb190d29fcCkpCisgICAgeworICAgICAgdXBkYXRpbmdfZnJhbWVfcCA9IHRy dWU7CisgICAgICB1cGRhdGVfYmVnaW4gKGYpOworICAgIH0KKyAgaWYgKHctPnBoeXNfY3Vyc29y X29uX3AKKyAgICAgICYmIGdvX3R3b19wKQorICAgIGVyYXNlX3BoeXNfY3Vyc29yICh3KTsKKyAg c3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgIGZvciAo aW50IHZudGggPSBzdGFydF92cG9zOworICAgICAgIG1hdHJpeCAhPSBOVUxMCisgICAgICAgJiYg dm50aCA8IG1hdHJpeC0+bnJvd3MKKyAgICAgICAmJiBNQVRSSVhfUk9XIChtYXRyaXgsIHZudGgp LT5lbmFibGVkX3AKKyAgICAgICAmJiBnb19vbmVfcDsKKyAgICAgICArK3ZudGgpCisgICAgewor ICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93ID0gTUFUUklYX1JPVyAobWF0cml4LCB2bnRoKTsK KyAgICAgIG1jX2VyYXNlX3JvdyAodywgbWF0cml4LCByb3cpOworICAgIH0KKyAgaWYgKHVwZGF0 aW5nX2ZyYW1lX3ApCisgICAgdXBkYXRlX2VuZCAoZik7CisgIC8vIG1jX3Jlc2V0X2NhY2hlICh3 KTsKK30KKworREVGVU4gKCJtYy1zdGRlcnIiLCBGbWNfc3RkZXJyLCBTbWNfc3RkZXJyLCAwLCAx LCAiUCIsCisgICAgICAgZG9jOiAvKiBUb2dnbGUgdHJhY2luZyBvZiBtdWx0aXBsZSBmYWtlIGN1 cnNvcnMuCitXaXRoIEFSRywgdHVybiB0cmFjaW5nIG9uIGlmIGFuZCBvbmx5IGlmIEFSRyBpcyBw b3NpdGl2ZS4gKi8pCisgIChMaXNwX09iamVjdCBhcmcpCit7CisgIGlmIChOSUxQIChhcmcpKQor ICAgIG1jX3N0ZGVycl9wID0gIW1jX3N0ZGVycl9wOworICBlbHNlCisgICAgeworICAgICAgYXJn ID0gRnByZWZpeF9udW1lcmljX3ZhbHVlIChhcmcpOworICAgICAgbWNfc3RkZXJyX3AgPSBYRklY TlVNIChhcmcpID4gMDsKKyAgICB9CisgIHJldHVybiBRbmlsOworfQorCisvKiBlbmQgTVVMVElQ TEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogDAogLyoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqCiAJCSAgICAgIFdpbmRvdyBkaXNwbGF5IGRpbWVuc2lvbnMKQEAgLTEzMzk1LDYgKzE4 MDM2LDY5IEBAIGhzY3JvbGxfd2luZG93X3RyZWUgKExpc3BfT2JqZWN0IHdpb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NSAgMHgw MDAwMDAwMTAwMDRjZTAxIGluIGluaXRfZnJvbV9kaXNwbGF5X3BvcyAoaXQ9MHg3ZmZmNWZiZjll MzAsCisgICAgdz0weDExYmY3MmM5OCwgcG9zPTB4MTIxMjQzZDUwKSBhdCB4ZGlzcC5jOjgyOTkK KyM2ICAweDAwMDAwMDAxMDAwNGQzN2UgaW4gaW5pdF90b19yb3dfc3RhcnQgKGl0PTB4N2ZmZjVm YmY5ZTMwLCB3PTB4MTFiZjcyYzk4LAorICAgIHJvdz0weDEyMTI0M2QwMCkgYXQgeGRpc3AuYzo4 NDIzCisjNyAgMHgwMDAwMDAwMTAwMDZjM2Y3IGluIGhzY3JvbGxfd2luZG93X3RyZWUgKHdpbmRv dz0uLi4pIGF0IHhkaXNwLmM6MTg1NDYKKyovCisKKyAgLyogYGluaXRfaXRlcmF0b3InOiAgZWFz c2VydCAoY2hhcnBvcyA8IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGNo YXJwb3MgPj0gQlVGX0JFRyAoY3VycmVudF9idWZmZXIpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBjaGFycG9zIDw9IFpWKSk7ICovCisKKyAgc3RydWN0IGRpc3BsYXlf cG9zICpwb3MgPSAmY3Vyc29yX3Jvdy0+c3RhcnQ7CisgIHB0cmRpZmZfdCBjaGFycG9zID0gQ0hB UlBPUyAocG9zLT5wb3MpOworCisgIGJvb2wgYmFyZl9jcmFzaF9vbmUgPSAoY2hhcnBvcyA8IDAK KyAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoY2hhcnBvcyA+PSBCVUZfQkVHIChjdXJyZW50 X2J1ZmZlcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY2hhcnBvcyA8PSBaVikp CisgICAgICAgICAgICAgICAgICAgICAgICA/IGZhbHNlCisgICAgICAgICAgICAgICAgICAgICAg ICA6IHRydWU7CisgIGlmIChiYXJmX2NyYXNoX29uZSkKKyAgICByZXR1cm4gaHNjcm9sbGVkX3A7 CisKKyAgLyogYHJlc2VhdF8xJzogIENIQVJQT1MgKHBvcykgPj0gQkVHViAmJiBDSEFSUE9TIChw b3MpIDw9IFpWICovCisgIGJvb2wgYmFyZl9jcmFzaF90d28gPSAoY2hhcnBvcyA+PSBCRUdWICYm IGNoYXJwb3MgPD0gWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBmYWxzZQorICAgICAg ICAgICAgICAgICAgICAgICAgIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2hfdHdvKQorICAgIHJl dHVybiBoc2Nyb2xsZWRfcDsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKIAkgICAgICAvKiBNb3ZlIGl0ZXJhdG9yIHRvIHB0IHN0YXJ0 aW5nIGF0IGN1cnNvcl9yb3ctPnN0YXJ0IGluCiAJCSBhIGxpbmUgd2l0aCBpbmZpbml0ZSB3aWR0 aC4gICovCiAJICAgICAgaW5pdF90b19yb3dfc3RhcnQgKCZpdCwgdywgY3Vyc29yX3Jvdyk7CkBA IC0xNDI4Nyw5ICsxODk5MSwyMiBAQCByZWRpc3BsYXlfaW50ZXJuYWwgKHZvaWQpCiAJICAgICAg KnctPmRlc2lyZWRfbWF0cml4LT5tZXRob2QgPSAwOwogCSAgICAgIGRlYnVnX21ldGhvZF9hZGQg KHcsICJvcHRpbWl6YXRpb24gMSIpOwogI2VuZGlmCisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0K KyAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgIG1jX3VwZGF0ZV93aW5kb3dfZnJp bmdlcyAodywgZmFsc2UpOworICAgIGVsc2UKIAkgICAgICB1cGRhdGVfd2luZG93X2ZyaW5nZXMg KHcsIGZhbHNlKTsKICNlbmRpZgorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAg ICAgZ290byB1cGRhdGU7CiAJICAgIH0KIAkgIGVsc2UKQEAgLTE3Njg3LDEwICsyMjQwNCwyMiBA QCByZWRpc3BsYXlfd2luZG93IChMaXNwX09iamVjdCB3aW5kb3csIGJvb2wganVzdF90aGlzX29u ZV9wKQogICAgIH0KIAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQorCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGJvb2wga2VlcF9jdXJy ZW50X3AgPSAoanVzdF90aGlzX29uZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKCF1 c2VkX2N1cnJlbnRfbWF0cml4X3AgJiYgIW92ZXJsYXlfYXJyb3dfc2VlbikKKyAgICAgICAgICAg ICAgICAgICAgICAgICB8fCB3LT5wc2V1ZG9fd2luZG93X3ApOworCisgIGJvb2wgZnJpbmdlc191 cGRhdGVkX3AgPSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykp KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMg KHcsIGtlZXBfY3VycmVudF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgOiB1cGRhdGVf d2luZG93X2ZyaW5nZXMgKHcsIGtlZXBfY3VycmVudF9wKTsKKwogICBpZiAoRlJBTUVfV0lORE9X X1AgKGYpCi0gICAgICAmJiB1cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIChqdXN0X3RoaXNfb25l X3AKLQkJCQkgICAgfHwgKCF1c2VkX2N1cnJlbnRfbWF0cml4X3AgJiYgIW92ZXJsYXlfYXJyb3df c2VlbikKLQkJCQkgICAgfHwgdy0+cHNldWRvX3dpbmRvd19wKSkpCisgICAgICAmJiBmcmluZ2Vz X3VwZGF0ZWRfcCkKICAgICB7CiAgICAgICB1cGRhdGVfYmVnaW4gKGYpOwogICAgICAgYmxvY2tf aW5wdXQgKCk7CkBAIC0xNzcwNSw2ICsyMjQzNCw5IEBAIHJlZGlzcGxheV93aW5kb3cgKExpc3Bf T2JqZWN0IHdpbmRvdywgYm9vbCBqdXN0X3RoaXNfb25lX3ApCiAgICAgICB1cGRhdGVfZW5kIChm KTsKICAgICB9CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgaWYgKFdJTkRPV19C T1RUT01fRElWSURFUl9XSURUSCAodykpCiAgICAgeF9kcmF3X2JvdHRvbV9kaXZpZGVyICh3KTsK ICNlbmRpZiAvKiBIQVZFX1dJTkRPV19TWVNURU0gKi8KQEAgLTE4MDEwLDYgKzIyNzQyLDcgQEAg dHJ5X3dpbmRvd19yZXVzaW5nX2N1cnJlbnRfbWF0cml4IChzdHJ1Y3Qgd2luZG93ICp3KQogCSAg ICAgc2Nyb2xsX3J1bl9ob29rIHdpbGwgY2xlYXIgdGhlIGN1cnNvciwgYW5kIHVzZSB0aGUKIAkg ICAgIGN1cnJlbnQgbWF0cml4IHRvIGdldCB0aGUgaGVpZ2h0IG9mIHRoZSByb3cgdGhlIGN1cnNv ciBpcwogCSAgICAgaW4uICAqLworCiAJICBydW4uY3VycmVudF95ID0gc3RhcnRfcm93LT55Owog CSAgcnVuLmRlc2lyZWRfeSA9IGl0LmN1cnJlbnRfeTsKIAkgIHJ1bi5oZWlnaHQgPSBpdC5sYXN0 X3Zpc2libGVfeSAtIGl0LmN1cnJlbnRfeTsKQEAgLTE4MDE5LDYgKzIyNzUyLDE2IEBAIHRyeV93 aW5kb3dfcmV1c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRvdyAqdykKIAkgICAgICB1 cGRhdGVfYmVnaW4gKGYpOwogCSAgICAgIEZSQU1FX1JJRiAoZiktPnVwZGF0ZV93aW5kb3dfYmVn aW5faG9vayAodyk7CiAJICAgICAgRlJBTUVfUklGIChmKS0+Y2xlYXJfd2luZG93X21vdXNlX2Zh Y2UgKHcpOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisgICAgbWNfcHJlX3Njcm9sbF9jbGVhbiAodywgcnVuLCBzdGFydF92cG9zLCBucm93 c19zY3JvbGxlZCwgVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX0RPV04pOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgRlJBTUVfUklGIChmKS0+c2Nyb2xs X3J1bl9ob29rICh3LCAmcnVuKTsKIAkgICAgICBGUkFNRV9SSUYgKGYpLT51cGRhdGVfd2luZG93 X2VuZF9ob29rICh3LCBmYWxzZSwgZmFsc2UpOwogCSAgICAgIHVwZGF0ZV9lbmQgKGYpOwpAQCAt MTgxNzMsNiArMjI5MTYsNyBAQCB0cnlfd2luZG93X3JldXNpbmdfY3VycmVudF9tYXRyaXggKHN0 cnVjdCB3aW5kb3cgKncpCiAJfQogCiAgICAgICAvKiBTY3JvbGwgdGhlIGRpc3BsYXkuICAqLwor CiAgICAgICBydW4uY3VycmVudF95ID0gZmlyc3RfcmV1c2FibGVfcm93LT55OwogICAgICAgcnVu LmRlc2lyZWRfeSA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOwogICAgICAgcnVuLmhl aWdodCA9IGl0Lmxhc3RfdmlzaWJsZV95IC0gcnVuLmN1cnJlbnRfeTsKQEAgLTE4MTgzLDYgKzIy OTI3LDE2IEBAIHRyeV93aW5kb3dfcmV1c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRv dyAqdykKIAkgIHVwZGF0ZV9iZWdpbiAoZik7CiAJICBGUkFNRV9SSUYgKGYpLT51cGRhdGVfd2lu ZG93X2JlZ2luX2hvb2sgKHcpOwogCSAgRlJBTUVfUklGIChmKS0+Y2xlYXJfd2luZG93X21vdXNl X2ZhY2UgKHcpOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgICAgbWNfcHJlX3Njcm9sbF9jbGVhbiAodywgcnVuLCBzdGFydF92cG9zLCBu cm93c19zY3JvbGxlZCwgVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQKTsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgRlJBTUVfUklGIChmKS0+c2Nyb2xsX3J1 bl9ob29rICh3LCAmcnVuKTsKIAkgIEZSQU1FX1JJRiAoZiktPnVwZGF0ZV93aW5kb3dfZW5kX2hv b2sgKHcsIGZhbHNlLCBmYWxzZSk7CiAJICB1cGRhdGVfZW5kIChmKTsKQEAgLTE5MTI3LDYgKzIz ODgxLDcgQEAgdHJ5X3dpbmRvd19pZCAoc3RydWN0IHdpbmRvdyAqdykKICAgLyogU2Nyb2xsIHRo ZSBkaXNwbGF5LiAgRG8gaXQgYmVmb3JlIGNoYW5naW5nIHRoZSBjdXJyZW50IG1hdHJpeCBzbwog ICAgICB0aGF0IHh0ZXJtLmMgZG9lc24ndCBnZXQgY29uZnVzZWQgYWJvdXQgd2hlcmUgdGhlIGN1 cnNvciBnbHlwaCBpcwogICAgICBmb3VuZC4gICovCisKICAgaWYgKGR5ICYmIHJ1bi5oZWlnaHQp CiAgICAgewogICAgICAgdXBkYXRlX2JlZ2luIChmKTsKQEAgLTE5MTM1LDYgKzIzODkwLDE2IEBA IHRyeV93aW5kb3dfaWQgKHN0cnVjdCB3aW5kb3cgKncpCiAJewogCSAgRlJBTUVfUklGIChmKS0+ dXBkYXRlX3dpbmRvd19iZWdpbl9ob29rICh3KTsKIAkgIEZSQU1FX1JJRiAoZiktPmNsZWFyX3dp bmRvd19tb3VzZV9mYWNlICh3KTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworICAgIG1jX3ByZV9zY3JvbGxfY2xlYW4gKHcsIHJ1biwgZmly c3RfdW5jaGFuZ2VkX2F0X2VuZF92cG9zLCBkdnBvcywgVFJZX1dJTkRPV19JRCk7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKIAkgIEZSQU1FX1JJRiAoZiktPnNjcm9sbF9ydW5faG9v ayAodywgJnJ1bik7CiAJICBGUkFNRV9SSUYgKGYpLT51cGRhdGVfd2luZG93X2VuZF9ob29rICh3 LCBmYWxzZSwgZmFsc2UpOwogCX0KQEAgLTIxMjczLDYgKzI2MDM4LDE3IEBAIG1heWJlX3Byb2R1 Y2VfbGluZV9udW1iZXIgKHN0cnVjdCBpdCAqaXQpCiAgICAgICBTRVRfVEVYVF9QT1MgKHRlbV9p dC5wb3NpdGlvbiwgLTEsIC0xKTsKICAgICAgIFBST0RVQ0VfR0xZUEhTICgmdGVtX2l0KTsKIAor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAg ICAgLyogVGhpcyBwZXJtaXRzIHVzIHRvIGluc3BlY3QgdGhlIEhQT1Mgb2YgbGluZSBudW1iZXIg Z2x5cGhzIGFuZCB0aGUgc3BhY2UKKyAgICAgIHBhZGRpbmcgYmVmb3JlL2FmdGVyIHRoZSBsaW5l IG51bWJlcnMuICBXZSBzZXQgYGdseXBoLT5ocG9zYCBlbHNld2hlcmUuICovCisgICAgICB0ZW1f aXQuaHBvcyArPSAxOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICAvKiBT dG9wIHByb2R1Y2luZyBnbHlwaHMsIGFuZCByZWZyYWluIGZyb20gcHJvZHVjaW5nIHRoZSBsaW5l CiAJIG51bWJlciwgaWYgd2UgZG9uJ3QgaGF2ZSBlbm91Z2ggc3BhY2Ugb24gdGhpcyBsaW5lLiAg Ki8KICAgICAgIGlmICh0ZW1faXQuY3VycmVudF94ID49IHdpZHRoX2xpbWl0KQpAQCAtMjEyODQs NiArMjYwNjAsMzAgQEAgbWF5YmVfcHJvZHVjZV9saW5lX251bWJlciAoc3RydWN0IGl0ICppdCkK IAl9CiAgICAgfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgIExpc3BfT2JqZWN0IGJ1ZiA9IGl0LT53LT5jb250ZW50czsKKyAgQ0hFQ0tf QlVGRkVSIChidWYpOworICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgc3Ry dWN0IGJ1ZmZlciAqb2xkX2J1ZmZlciA9IE5VTEw7CisgIC8qIE5lZWRlZCBzbyB0aGF0IGJ1ZmZl ci1sb2NhbCB2YWx1ZXMgY2FuIGJlIGRldGVybWluZWQ7IGUuZy4sIHdoZW4gc3dpdGNoaW5nCisg IHRvIHRoZSBtaW5pYnVmZmVyLiAqLworICBpZiAoYiAhPSBjdXJyZW50X2J1ZmZlcikKKyAgICB7 CisgICAgICBvbGRfYnVmZmVyID0gY3VycmVudF9idWZmZXI7CisgICAgICBzZXRfYnVmZmVyX2lu dGVybmFsIChiKTsKKyAgICB9CisgIGl0LT53LT5tYy5sbnVtX3BpeGVsX3dpZHRoID0gKCFOSUxQ IChWZGlzcGxheV9saW5lX251bWJlcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gdGVtX2l0LmN1cnJlbnRfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMDsK KyAgaWYgKG9sZF9idWZmZXIpCisgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogUmVjb3JkIHRoZSB3aWR0aCBp biBwaXhlbHMgd2UgbmVlZCBmb3IgdGhlIGxpbmUgbnVtYmVyIGRpc3BsYXkuICAqLwogICBpdC0+ bG51bV9waXhlbF93aWR0aCA9IHRlbV9pdC5jdXJyZW50X3g7CiAgIC8qIENvcHkgdGhlIHByb2R1 Y2VkIGdseXBocyBpbnRvIElUJ3MgZ2x5cGhfcm93LiAgKi8KQEAgLTI3MDkyLDYgKzMxODkyLDE3 IEBAIGFwcGVuZF9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5 cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9 IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQ T1MgKGl0LT5wb3NpdGlvbik7CiAgICAgICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKICAg ICAgIGlmIChpdC0+cGl4ZWxfd2lkdGggPiAwKQpAQCAtMjcxNzUsNiArMzE5ODYsMTcgQEAgYXBw ZW5kX2NvbXBvc2l0ZV9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAkgICAgZ1sxXSA9ICpnOwogCSAg Z2x5cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbaXQtPmFyZWFdOwogCX0KKworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgt Pmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0 KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3Mg PSBpdC0+Y21wX2l0LmNoYXJwb3M7CiAgICAgICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsK ICAgICAgIGVhc3NlcnQgKGl0LT5waXhlbF93aWR0aCA8PSBTSFJUX01BWCk7CkBAIC0yNzM4Myw2 ICszMjIwNSwxNyBAQCBwcm9kdWNlX2ltYWdlX2dseXBoIChzdHJ1Y3QgaXQgKml0KQogCX0KICAg ICAgIGlmIChnbHlwaCA8IGl0LT5nbHlwaF9yb3ctPmdseXBoc1thcmVhICsgMV0pCiAJeworCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAg ICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRF UE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICBnbHlwaC0+Y2hh cnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAJICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9i amVjdDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9IGNsaXBfdG9fYm91bmRzICgtMSwgaXQtPnBp eGVsX3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzQ4Niw2ICszMjMxOSwxNyBAQCBwcm9kdWNlX3h3 aWRnZXRfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJfQogICAgICAgaWYgKGdseXBoIDwgaXQtPmds eXBoX3Jvdy0+Z2x5cGhzW2FyZWEgKyAxXSkKIAl7CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhw b3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKIAkgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBv c2l0aW9uKTsKIAkgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogCSAgZ2x5cGgtPnBpeGVs X3dpZHRoID0gY2xpcF90b19ib3VuZHMgKC0xLCBpdC0+cGl4ZWxfd2lkdGgsIFNIUlRfTUFYKTsK QEAgLTI3NTcyLDYgKzMyNDE2LDE3IEBAIGFwcGVuZF9zdHJldGNoX2dseXBoIChzdHJ1Y3QgaXQg Kml0LCBMaXNwX09iamVjdCBvYmplY3QsCiAJICAgIHdpZHRoIC09IGl0LT5maXJzdF92aXNpYmxl X3ggLSBpdC0+Y3VycmVudF94OwogCSAgZWFzc2VydCAod2lkdGggPiAwKTsKIAl9CisKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGds eXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1Mg KCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFy cG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3QgPSBvYmpl Y3Q7CiAgICAgICAvKiBGSVhNRTogSXQgd291bGQgYmUgYmV0dGVyIHRvIHVzZSBUWVBFX01BWCBo ZXJlLCBidXQKQEAgLTI4MDI2LDYgKzMyODgxLDE3IEBAIGFwcGVuZF9nbHlwaGxlc3NfZ2x5cGgg KHN0cnVjdCBpdCAqaXQsIGludCBmYWNlX2lkLCBib29sIGZvcl9ub19mb250LCBpbnQgbGVuLAog CSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1thcmVhXTsK IAl9CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9 IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAg IGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5v YmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgZWFzc2VydCAoaXQtPnBpeGVsX3dpZHRoIDw9IFNI UlRfTUFYKTsKQEAgLTI5MDc2LDEwICszMzk0MiwyMCBAQCB4X2luc2VydF9nbHlwaHMgKHN0cnVj dCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnVwZGF0ZWRfcm93LAogCiAgIC8qIFdyaXRl IHRoZSBnbHlwaHMuICAqLwogICBocG9zID0gc3RhcnQgLSByb3ctPmdseXBoc1t1cGRhdGVkX2Fy ZWFdOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAq LworCisgIGlmICghbWNfcmVkcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywgdXBk YXRlZF9hcmVhLCB3LT5vdXRwdXRfY3Vyc29yLngsCisgICAgICAgICAgICAgICAgICAgICAgaHBv cywgaHBvcyArIGxlbiwgZmFsc2UsIERSQVdfTk9STUFMX1RFWFQsIFhfSU5TRVJUX0dMWVBIUykp CiAgIGRyYXdfZ2x5cGhzICh3LCB3LT5vdXRwdXRfY3Vyc29yLngsIHJvdywgdXBkYXRlZF9hcmVh LAogCSAgICAgICBocG9zLCBocG9zICsgbGVuLAogCSAgICAgICBEUkFXX05PUk1BTF9URVhULCAw KTsKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBBZHZhbmNlIHRoZSBvdXRw dXQgY3Vyc29yLiAgKi8KICAgdy0+b3V0cHV0X2N1cnNvci5ocG9zICs9IGxlbjsKICAgdy0+b3V0 cHV0X2N1cnNvci54ICs9IHNoaWZ0X2J5X3dpZHRoOwpAQCAtMjk1MDUsOSArMzQzODEsMTkgQEAg eF9maXhfb3ZlcmxhcHBpbmdfYXJlYSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3Jv dyAqcm93LAogCSAgd2hpbGUgKGkgPCByb3ctPnVzZWRbYXJlYV0KIAkJICYmIHJvdy0+Z2x5cGhz W2FyZWFdW2ldLm92ZXJsYXBzX3ZlcnRpY2FsbHlfcCk7CiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGlmICghbWNfcmVkcmF3X3Jv dyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywgYXJlYSwgc3RhcnRfeCwgc3RhcnQsIGksCisg ICAgICAgICAgZmFsc2UsIERSQVdfTk9STUFMX1RFWFQsIFhfRklYX09WRVJMQVBQSU5HX0FSRUEp KQogCSAgZHJhd19nbHlwaHMgKHcsIHN0YXJ0X3gsIHJvdywgYXJlYSwKIAkJICAgICAgIHN0YXJ0 LCBpLAogCQkgICAgICAgRFJBV19OT1JNQUxfVEVYVCwgb3ZlcmxhcHMpOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAJfQogICAgICAgZWxzZQogCXsKQEAgLTI5NzU4LDEwICszNDY0 NCwxNyBAQCBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9u LAogICBuZXdfY3Vyc29yX3R5cGUgPSBnZXRfd2luZG93X2N1cnNvcl90eXBlICh3LCBnbHlwaCwK IAkJCQkJICAgICZuZXdfY3Vyc29yX3dpZHRoLCAmYWN0aXZlX2N1cnNvcik7CiAKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgLyogSWYgY3Vy c29yIGlzIGN1cnJlbnRseSBiZWluZyBzaG93biBhbmQgd2UgZG9uJ3Qgd2FudCBpdCB0byBiZSBv cgogICAgICBpdCBpcyBpbiB0aGUgd3JvbmcgcGxhY2UsIG9yIHRoZSBjdXJzb3IgdHlwZSBpcyBu b3Qgd2hhdCB3ZSB3YW50LAogICAgICBlcmFzZSBpdC4gICovCiAgIGlmICh3LT5waHlzX2N1cnNv cl9vbl9wCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250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seXBoX3JvdywgeCwgeSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBuZXdfY3Vyc29yX3R5cGUsIG5ld19jdXJzb3Jfd2lkdGgsCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgb24sIGFjdGl2ZV9jdXJzb3IpOworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpZiAoTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmIE5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAmJiBOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkKKyAgICBGUkFNRV9SSUYg KGYpLT5kcmF3X3dpbmRvd19jdXJzb3IgKHcsIGdseXBoX3JvdywgeCwgeSwgbmV3X2N1cnNvcl90 eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2N1cnNvcl93 aWR0aCwgb24sIGFjdGl2ZV9jdXJzb3IpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiB9CiAKIApAQCAtMjk4ODcsNyArMzQ3OTMsMTggQEAgZHJhd19yb3dfd2l0aF9tb3VzZV9mYWNl IChzdHJ1Y3Qgd2luZG93ICp3LCBpbnQgc3RhcnRfeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAog I2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogICBpZiAoRlJBTUVfV0lORE9XX1AgKFhGUkFNRSAo dy0+ZnJhbWUpKSkKICAgICB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgICAgIGlmICghbWNfcmVkcmF3X3JvdyAodywgdy0+Y3VycmVu dF9tYXRyaXgsIHJvdywgVEVYVF9BUkVBLCBzdGFydF94LAorICAgICAgICAgICAgICAgICAgICAg ICAgICBzdGFydF9ocG9zLCBlbmRfaHBvcywgZmFsc2UsIGRyYXcsIERSQVdfUk9XX1dJVEhfTU9V U0VfRkFDRSkpCiAgICAgICBkcmF3X2dseXBocyAodywgc3RhcnRfeCwgcm93LCBURVhUX0FSRUEs IHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBkcmF3LCAwKTsKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICAgICAgcmV0dXJuOwogICAgIH0KICNlbmRpZgpAQCAtMzE5NDUsMTEgKzM2ODYy LDIzIEBAIGV4cG9zZV9hcmVhIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpy b3csIFhSZWN0YW5nbGUgKnIsCiAgIHN0cnVjdCBnbHlwaCAqbGFzdDsKICAgaW50IGZpcnN0X3gs IHN0YXJ0X3gsIHg7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1D VVJTT1JTICovCisKICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYmIHJvdy0+ZmlsbF9saW5lX3Ap CisgICAgeworICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwg cm93LCBhcmVhLCAwLCAwLCByb3ctPnVzZWRbYXJlYV0sCisgICAgICAgICAgICAgICAgICAgICAg ICAgIGZhbHNlLCBEUkFXX05PUk1BTF9URVhULCBFWFBPU0VfQVJFQV9PTkUpKQogICAgIC8qIElm IHJvdyBleHRlbmRzIGZhY2UgdG8gZW5kIG9mIGxpbmUgd3JpdGUgdGhlIHdob2xlIGxpbmUuICAq LwogICAgIGRyYXdfZ2x5cGhzICh3LCAwLCByb3csIGFyZWEsCiAJCSAwLCByb3ctPnVzZWRbYXJl YV0sCiAJCSBEUkFXX05PUk1BTF9URVhULCAwKTsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICAgZWxzZQogICAgIHsKICAgICAgIC8qIFNldCBTVEFSVF9YIHRvIHRoZSB3 aW5kb3ctcmVsYXRpdmUgc3RhcnQgcG9zaXRpb24gZm9yIGRyYXdpbmcgZ2x5cGhzIG9mCkBAIC0z MTk4MSwxMSArMzY5MTAsMjMgQEAgZXhwb3NlX2FyZWEgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVj dCBnbHlwaF9yb3cgKnJvdywgWFJlY3RhbmdsZSAqciwKIAkgICsrbGFzdDsKIAl9CiAKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgICAgIC8q IFJlcGFpbnQuICAqLwotICAgICAgaWYgKGxhc3QgPiBmaXJzdCkKKyAgICAgIC8qIEZsb2F0aW5n IGZha2UgY3Vyc29ycyB3aWxsIGV4aXN0IHdoZW4gKGxhc3QgPT0gZmlyc3QpLiAqLworICAgICAg aWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBhcmVhLCBmaXJz dF94IC0gc3RhcnRfeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZmlyc3QgLSByb3ctPmds eXBoc1thcmVhXSwgbGFzdCAtIHJvdy0+Z2x5cGhzW2FyZWFdLAorICAgICAgICAgICAgICAgICAg ICAgICAgICBmYWxzZSwgRFJBV19OT1JNQUxfVEVYVCwgRVhQT1NFX0FSRUFfVFdPKQorICAgICAg ICAgICYmIGxhc3QgPiBmaXJzdCkKIAlkcmF3X2dseXBocyAodywgZmlyc3RfeCAtIHN0YXJ0X3gs IHJvdywgYXJlYSwKIAkJICAgICBmaXJzdCAtIHJvdy0+Z2x5cGhzW2FyZWFdLCBsYXN0IC0gcm93 LT5nbHlwaHNbYXJlYV0sCiAJCSAgICAgRFJBV19OT1JNQUxfVEVYVCwgMCk7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICB9CiB9CiAKQEAgLTMxOTk5LDEwICszNjk0MCwyMiBA QCBleHBvc2VfbGluZSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBY UmVjdGFuZ2xlICpyKQogewogICBlYXNzZXJ0IChyb3ctPmVuYWJsZWRfcCk7CiAKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgaWYgKHJvdy0+ bW9kZV9saW5lX3AgfHwgdy0+cHNldWRvX3dpbmRvd19wKQorICAgIHsKKyAgICAgIGlmICghbWNf cmVkcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywgVEVYVF9BUkVBLCAwLCAwLAor ICAgICAgICAgICAgICAgICAgICAgICAgICByb3ctPnVzZWRbVEVYVF9BUkVBXSwgZmFsc2UsIERS QVdfTk9STUFMX1RFWFQsIEVYUE9TRV9MSU5FKSkKICAgICBkcmF3X2dseXBocyAodywgMCwgcm93 LCBURVhUX0FSRUEsCiAJCSAwLCByb3ctPnVzZWRbVEVYVF9BUkVBXSwKIAkJIERSQVdfTk9STUFM X1RFWFQsIDApOworICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBlbHNl CiAgICAgewogICAgICAgaWYgKHJvdy0+dXNlZFtMRUZUX01BUkdJTl9BUkVBXSkKQEAgLTMyNTUw LDYgKzM3NTAzLDIyIEBAIHhfaW50ZXJzZWN0X3JlY3RhbmdsZXMgKFhSZWN0YW5nbGUgKnIxLCBY UmVjdGFuZ2xlICpyMiwgWFJlY3RhbmdsZSAqcmVzdWx0KQogdm9pZAogc3ltc19vZl94ZGlzcCAo dm9pZCkKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNP UlMgKi8KKworICBkZWZzdWJyICgmU21jX2R1bXBfZ2x5cGhfcm93KTsKKworICBkZWZzdWJyICgm U21jX2R1bXBfZ2x5cGhfbWF0cml4KTsKKworICBkZWZzdWJyICgmU21jX2N1cnJlbnRfY29sdW1u KTsKKworICBkZWZzdWJyICgmU21jX3N0ZGVycik7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKICAgVndpdGhfZWNob19hcmVhX3NhdmVfdmVjdG9yID0gUW5pbDsKICAgc3RhdGljcHJv ICgmVndpdGhfZWNob19hcmVhX3NhdmVfdmVjdG9yKTsKIApkaWZmIC0tZ2l0IGEvc3JjL3h0ZXJt LmMgYi9zcmMveHRlcm0uYwppbmRleCA1YWEzZTNmLi4wZTVkNzViIDEwMDY0NAotLS0gYS9zcmMv eHRlcm0uYworKysgYi9zcmMveHRlcm0uYwpAQCAtMTM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YXBo aWNzX2V4cG9zdXJlcyA9IEZhbHNlOworICAgICAgaWYgKGdjKQorICAgICAgICBYQ2hhbmdlR0Mg KGRweSwgZ2MsIG1hc2ssICZ4Z2N2KTsKKyAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAg IGdjID0gWENyZWF0ZUdDIChkcHksIHdpbmRvdywgbWFzaywgJnhnY3YpOworICAgICAgICAgIEZS QU1FX0RJU1BMQVlfSU5GTyAoZiktPnNjcmF0Y2hfY3Vyc29yX2djID0gZ2M7CisgICAgICAgIH0K KyAgICAgIHhfY2xpcF90b19yb3cgKHcsIHJvdywgVEVYVF9BUkVBLCBnYyk7CisgICAgICB4X2Zp bGxfcmVjdGFuZ2xlIChmLCBnYywgZngsIGZ5LCB3ZCwgaCk7CisgICAgICB4X3Jlc2V0X2NsaXBf cmVjdGFuZ2xlcyAoZiwgZ2MpOworICAgIH0KK30KKworLyogUklGOiBEcmF3IGN1cnNvciBvbiB3 aW5kb3cgVy4gKi8KK3N0YXRpYyB2b2lkCittY194X2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0 IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93 ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHgsIGludCBmeCwgaW50IHksIGlu dCBmeSwgaW50IGhwb3MsIGludCB2cG9zLCBpbnQgd2QsCisgICAgICAgICAgICAgICAgICAgICAg ICAgaW50IGgsIHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90 eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGgsIGVudW0gbWNf Zmxhdm9yIGdseXBoX2ZsYXZvciwgYm9vbCBvbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAg IGJvb2wgYWN0aXZlX3ApCit7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGU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AgICAgICAgICAgICAgICBzdHJ1Y3QgZmFj ZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxv d19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICBlbnVtIGZhY2Vf aWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVy biAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAg ICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBo b2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChG UkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19h Y3RpdmVfZmFjZS0+Zm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQg KEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93 X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgIGVsc2UgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAg ICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgt PmNoYXJwb3MgPiByZWdpb25fYmVnCisgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9n bHlwaC0+Y2hhcnBvcyA8IHJlZ2lvbl9lbmQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgZW51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ywgaG9sbG93X2Fj dGl2ZV9yZWdpb25fYmVnX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9n bHlwaC0+Y2hhcnBvcyA9PSByZWdpb25fZW5kKQorICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2Vf aWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29y LWF0LXJlZ2lvbi1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgc3Ry dWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlID0gRkFDRV9GUk9NX0lEIChm LCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAg IGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAo dywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOwor ICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFD RV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAg ICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+ Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAg ICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2Rh dGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZS0+YmFja2dyb3Vu ZCk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChyZWdp b25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPiByZWdpb25f YmVnCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3Mg PCByZWdpb25fZW5kKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg ICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZV9pZCA9IGxv b2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW4tcmVn aW9uLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBm YWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYs IGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZV9pZCk7CisgICAgICAgICAgICAgICAg ICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9m YWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1 ZSk7CisgICAgICAgICAgICA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dW5kIChGUkFN RV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19hY3Rp dmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKCFhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2 ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtl LWN1cnNvci1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lE IChmLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAg IFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5j dXJzb3JfZ2MsIGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91 dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2luYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQp OworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBibG9ja19pbnB1dCAo KTsKKyAgICAgICAgICAgICAgLyogRm9yY2UgYG1jX3hfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBz LT5mLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MnLiAqLworICAgICAgICAgICAgICBib29sIGN1 cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcs IG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2Qs IGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX2dj X3ApOworICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwg Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAg ICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEu eC0+Y3Vyc29yX2djLCB4Z2N2LmJhY2tncm91bmQpOworICAgICAgICAgICAgICB1bmJsb2NrX2lu cHV0ICgpOworICAgICAgICAgICAgICAvKiBEcmF3IHRoZSBmcmFtZSBhcm91bmQgdGhlIGJveC4g Ki8KKyAgICAgICAgICAgICAgbWNfeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93 LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICAgIH0KKyAgICAg IGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0hPTExPV19CT1g6CisgICAgeworICAgICAgaWYg KGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAg ICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5j dXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhl bCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgIG1jX3hfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBt YXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAg Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOwor ICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNv ciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAg ICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICB7CisgICAgICBp ZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAg ICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJyBi eSBib3Jyb3dpbmcgdGhlCisgICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhfbWFrZV9nYycgaW4g eGZucy5jLiAqLworICAgICAgICB7CisgICAgICAgICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICAg ICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9nYywgRlJBTUVfQkFDS0dST1VORF9QSVhFTCAoZikpOworICAgICAgICAgIFhTZXRC YWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3Jf Z2MsIGNvbG9yLnBpeGVsKTsKKyAgICAgICAgICAvKiBGb3JjZSBgbWNfeF9zZXRfY3Vyc29yX2dj JyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycuICovCisgICAgICAgICAg Ym9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGgg KHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywgbHNsLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwg YWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVf WF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmZvcmVncm91 bmQpOworICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5v dXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIHhnY3YuYmFja2dyb3VuZCk7CisgICAgICAgICAgdW5i bG9ja19pbnB1dCAoKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAg ICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfZHJhd19j dXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywg bHNsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vy c29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAgIH0KKyAgICAg IGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0JBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJl ZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAg ICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9w aXhlbCcuICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gY29s b3IucGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IHRy dWU7CisgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBm eCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOwor ICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNv cl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAg ICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAg bWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93 aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgfQor ICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfSEJBUjoKKyAgICB7CisgICAgICBpZiAo bHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAg IHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1 cnNvcl9waXhlbCcuICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVs ID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlf cCA9IHRydWU7CisgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93 LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2th eV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5h bF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAg ICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSBmYWxzZTsKKyAgICAg ICAgICAgIG1jX3hfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5 LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBj dXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAg ICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fi b3J0ICgpOworICB9CisgICAgICAgIH0KKyNpZmRlZiBIQVZFX1hfSTE4TgorICBpZiAodyA9PSBY V0lORE9XIChmLT5zZWxlY3RlZF93aW5kb3cpKQorICAgIGlmIChGUkFNRV9YSUMgKGYpICYmIChG UkFNRV9YSUNfU1RZTEUgKGYpICYgWElNUHJlZWRpdFBvc2l0aW9uKSkKKyAgICAgIHhpY19zZXRf cHJlZWRpdGFyZWEgKHcsIHgsIHkpOworI2VuZGlmCisgICAgfQorICBYRmx1c2ggKEZSQU1FX1hf RElTUExBWSAoZikpOworfQorCisvKiBEcmF3IHN0cmV0Y2ggZ2x5cGggc3RyaW5nIFMuICovCitz dGF0aWMgdm9pZAorbWNfeF9kcmF3X3N0cmV0Y2hfZ2x5cGhfc3RyaW5nIChzdHJ1Y3QgZ2x5cGhf c3RyaW5nICpzKQoreworICBlYXNzZXJ0IChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJFVENI X0dMWVBIKTsKKyAgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAmJiAheF9zdHJldGNo X2N1cnNvcl9wKQorICAgIHsKKyAgICAgIC8qIElmIGB4LXN0cmV0Y2gtY3Vyc29yJyBpcyBuaWws IGRvbid0IGRyYXcgYSBibG9jayBjdXJzb3IgYXMgd2lkZSBhcyB0aGUKKyAgICAgIHN0cmV0Y2gg Z2x5cGguICovCisgICAgICBpbnQgd2lkdGgsIGJhY2tncm91bmRfd2lkdGggPSBzLT5iYWNrZ3Jv dW5kX3dpZHRoOworICAgICAgaW50IHggPSBzLT54OworICAgICAgaWYgKCFzLT5yb3ctPnJldmVy c2VkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgbGVmdF94ID0gd2luZG93X2JveF9sZWZ0 X29mZnNldCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICBpZiAoeCA8IGxlZnRfeCkKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgYmFja2dyb3VuZF93aWR0aCAtPSBsZWZ0X3ggLSB4 OworICAgICAgICAgICAgICB4ID0gbGVmdF94OworICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICAvKiBJbiBSMkwgcm93cywgZHJh dyB0aGUgY3Vyc29yIG9uIHRoZSByaWdodCBlZGdlIG9mIHRoZQorICAgICAgICAgICAgICAgc3Ry ZXRjaCBnbHlwaC4gKi8KKyAgICAgICAgICAgIGludCByaWdodF94ID0gd2luZG93X2JveF9yaWdo dCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgIGlmICh4ICsgYmFja2dyb3VuZF93aWR0 aCA+IHJpZ2h0X3gpCisgICAgICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0geCAtIHJpZ2h0 X3g7CisgICAgICAgICAgICB4ICs9IGJhY2tncm91bmRfd2lkdGg7CisgICAgICAgICAgfQorICAg ICAgd2lkdGggPSBtaW4gKEZSQU1FX0NPTFVNTl9XSURUSCAocy0+ZiksIGJhY2tncm91bmRfd2lk dGgpOworICAgICAgaWYgKHMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgeCAtPSB3aWR0aDsK KyAgICAgIC8qIERyYXcgY3Vyc29yLiAqLworICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19iZ19y ZWN0IChzLCB4LCBzLT55LCB3aWR0aCwgcy0+aGVpZ2h0KTsKKyAgICAgIC8qIENsZWFyIHJlc3Qg dXNpbmcgdGhlIEdDIG9mIHRoZSBvcmlnaW5hbCBub24tY3Vyc29yIGZhY2UuICovCisgICAgICBp ZiAod2lkdGggPCBiYWNrZ3JvdW5kX3dpZHRoKQorICAgICAgICB7CisgICAgICAgICAgaW50IHkg PSBzLT55OworICAgICAgICAgIGludCB3ID0gYmFja2dyb3VuZF93aWR0aCAtIHdpZHRoLCBoID0g cy0+aGVpZ2h0OworICAgICAgICAgIFhSZWN0YW5nbGUgcjsKKyAgICAgICAgICBHQyBnYzsKKyAg ICAgICAgICBpZiAoIXMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgICAgIHggKz0gd2lkdGg7 CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeCA9IHMtPng7CisgICAgICAgICAgaWYgKHMt PnJvdy0+bW91c2VfZmFjZV9wCisgICAgICAgICAgICAgICYmIGN1cnNvcl9pbl9tb3VzZV9mYWNl X3AgKHMtPncpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICB4X3NldF9tb3VzZV9mYWNl X2djIChzKTsKKyAgICAgICAgICAgICAgZ2MgPSBzLT5nYzsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgICBlbHNlCisgICAgICAgICAgICBnYyA9IHMtPmZhY2UtPmdjOworICAgICAgICAgIGdldF9n bHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCAmcik7CisgICAgICAgICAgeF9zZXRfY2xpcF9yZWN0 YW5nbGVzIChzLT5mLCBnYywgJnIsIDEpOworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdGlwcGxl KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBGaWxsIGJhY2tncm91bmQgd2l0aCBh IHN0aXBwbGUgcGF0dGVybi4gKi8KKyAgICAgICAgICAgICAgWFNldEZpbGxTdHlsZSAocy0+ZGlz cGxheSwgZ2MsIEZpbGxPcGFxdWVTdGlwcGxlZCk7CisgICAgICAgICAgICAgIHhfZmlsbF9yZWN0 YW5nbGUgKHMtPmYsIGdjLCB4LCB5LCB3LCBoKTsKKyAgICAgICAgICAgICAgWFNldEZpbGxTdHls ZSAocy0+ZGlzcGxheSwgZ2MsIEZpbGxTb2xpZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBYR0NWYWx1ZXMgeGdjdjsKKyAgICAg ICAgICAgICAgWEdldEdDVmFsdWVzIChzLT5kaXNwbGF5LCBnYywgR0NGb3JlZ3JvdW5kIHwgR0NC YWNrZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNw bGF5LCBnYywgeGdjdi5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICAgICAgeF9maWxsX3JlY3Rhbmds ZSAocy0+ZiwgZ2MsIHgsIHksIHcsIGg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G1jX3hfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4dCwgY3Vyc29y X2djX3ApOworICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nIChuZXh0KTsK KyAgICAgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBI KQorICAgICAgICAgICAgICBtY194X2RyYXdfc3RyZXRjaF9nbHlwaF9zdHJpbmcgKG5leHQpOwor ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tn cm91bmQgKG5leHQsIHRydWUpOworICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAg ICAgICAgICB9CisgICAgfQorICAvKiBTZXQgdXAgUy0+Z2MsIHNldCBjbGlwcGluZyBhbmQgZHJh dyBTLiAqLworICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHMsIGN1cnNvcl9nY19wKTsKKyAg LyogRHJhdyByZWxpZWYgKGlmIGFueSkgaW4gYWR2YW5jZSBmb3IgY2hhci9jb21wb3NpdGlvbiBz byB0aGF0IHRoZQorICAgICBnbHlwaCBzdHJpbmcgY2FuIGJlIGRyYXduIG92ZXIgaXQuICovCisg IGlmICghcy0+Zm9yX292ZXJsYXBzCisgICAgICAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19C T1gKKyAgICAgICYmIChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAg ICAgfHwgcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKSkKKyAgICB7Cisg ICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmcgKHMpOworICAgICAgeF9kcmF3X2dseXBo X3N0cmluZ19iYWNrZ3JvdW5kIChzLCB0cnVlKTsKKyAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdf Ym94IChzKTsKKyAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZyAocyk7CisgICAgICBy ZWxpZWZfZHJhd25fcCA9IHRydWU7CisgICAgfQorICAgIGVsc2UgaWYgKCFzLT5jbGlwX2hlYWQg LyogZHJhd19nbHlwaHMgZGlkbid0IHNwZWNpZnkgYSBjbGlwIG1hc2suICovCisgICAgICAgICAg ICAgJiYgIXMtPmNsaXBfdGFpbAorICAgICAgICAgICAgICYmICgocy0+cHJldiAmJiBzLT5wcmV2 LT5obCAhPSBzLT5obCAmJiBzLT5sZWZ0X292ZXJoYW5nKQorICAgICAgICAgICAgICAgICB8fCAo cy0+bmV4dCAmJiBzLT5uZXh0LT5obCAhPSBzLT5obCAmJiBzLT5yaWdodF9vdmVyaGFuZykpKQor ICAgICAgLyogV2UgbXVzdCBjbGlwIGp1c3QgdGhpcyBnbHlwaC4gIGxlZnRfb3ZlcmhhbmcgcGFy dCBoYXMgYWxyZWFkeQorICAgICAgICAgZHJhd24gd2hlbiBzLT5wcmV2IHdhcyBkcmF3biwgYW5k IHJpZ2h0X292ZXJoYW5nIHBhcnQgd2lsbCBiZQorICAgICAgICAgZHJhd24gbGF0ZXIgd2hlbiBz LT5uZXh0IGlzIGRyYXduLiAqLworICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nX2V4 YWN0bHkgKHMsIHMpOworICAgICAgZWxzZQorICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xp cHBpbmcgKHMpOworICBzd2l0Y2ggKHMtPmZpcnN0X2dseXBoLT50eXBlKQorICAgIHsKKyAgICBj YXNlIElNQUdFX0dMWVBIOgorICAgICAgeF9kcmF3X2ltYWdlX2dseXBoX3N0cmluZyAocyk7Cisg ICAgICBicmVhazsKKyAgICBjYXNlIFhXSURHRVRfR0xZUEg6CisgICAgICB4X2RyYXdfeHdpZGdl dF9nbHlwaF9zdHJpbmcgKHMpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBTVFJFVENIX0dMWVBI OgorICAgICAgbWNfeF9kcmF3X3N0cmV0Y2hfZ2x5cGhfc3RyaW5nIChzKTsKKyAgICAgIGJyZWFr OworICAgIGNhc2UgQ0hBUl9HTFlQSDoKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMpCisgICAg ICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICAgICAgICB4 X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIGZhbHNlKTsKKyAgICAgIHhfZHJhd19n bHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVhazsKKyAgICBjYXNlIENPTVBP U0lURV9HTFlQSDoKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMgfHwgKHMtPmNtcF9mcm9tID4g MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5j bXAuYXV0b21hdGljKSkKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7Cisg ICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgdHJ1 ZSk7CisgICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsK KyAgICAgIGJyZWFrOworICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgorICAgICAgaWYgKHMtPmZv cl9vdmVybGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAg ICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgdHJ1ZSk7 CisgICAgICB4X2RyYXdfZ2x5cGhsZXNzX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAg ICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgICB9Cisg IGlmICghcy0+Zm9yX292ZXJsYXBzKQorICAgIHsKKyAgICAgIC8qIERyYXcgdW5kZXJsaW5lLiAq LworICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9wKQorICAgICAgICB7CisgICAgICAgICAg aWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkKKyAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkK KyAgICAgICAgICAgICAgICB4X2RyYXdfdW5kZXJ3YXZlIChzKTsKKyAgICAgICAgICAgICAgZWxz ZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2Owor ICAgICAgICAgICAgICAgICAgWEdldEdDVmFsdWVzIChzLT5kaXNwbGF5LCBzLT5nYywgR0NGb3Jl Z3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlz cGxheSwgcy0+Z2MsIHMtPmZhY2UtPnVuZGVybGluZV9jb2xvcik7CisgICAgICAgICAgICAgICAg ICB4X2RyYXdfdW5kZXJ3YXZlIChzKTsKKyAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5k IChzLT5kaXNwbGF5LCBzLT5nYywgeGdjdi5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5 cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICB1bnNp Z25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CisgICAgICAgICAgICAgIGludCB5OworICAg ICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfcAorICAg ICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9V TkRFUl9MSU5FKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qIFdlIHVz ZSB0aGUgc2FtZSB1bmRlcmxpbmUgc3R5bGUgYXMgdGhlIHByZXZpb3VzIG9uZS4gKi8KKyAgICAg ICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPnByZXYtPnVuZGVybGluZV90aGlja25lc3M7Cisg ICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsK KyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSB0aGlja25lc3MuICBEZWZh dWx0IGlzIDEgcGl4ZWwuICovCisgICAgICAgICAgICAgICAgICBpZiAocy0+Zm9udCAmJiBzLT5m b250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tu ZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gMTsKKyAgICAgICAgICAgICAgICAg IGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50X2xpbmUpCisgICAgICAgICAgICAgICAgICAgIHBv c2l0aW9uID0gKHMtPmhlaWdodCAtIHRoaWNrbmVzcykgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAg ICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHBvc2l0aW9uLiAgVGhpcyBpcyB0aGUgcmVj b21tZW5kZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJ0aWNhbCBvZmZzZXQgaW4gcGl4 ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRoZSB0b3Agb2YKKyAgICAgICAgICAgICAgICAgICAg ICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBpcyBhIHNpZ25lZCB2YWx1ZSBhY2NvcmRpbmcgdG8g dGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgc3BlY3MsIGFuZCBpdHMgZGVmYXVsdCBpcwor ICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EICgobWF4aW11bSBkZXNjZW50KSAvIDIpLCB3 aXRoCisgICAgICAgICAgICAgICAgICAgICAgICAgUk9VTkQoeCkgPSBmbG9vciAoeCArIDAuNSkg ICovCisgICAgICAgICAgICAgICAgICAgICAgaWYgKHhfdXNlX3VuZGVybGluZV9wb3NpdGlvbl9w cm9wZXJ0aWVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHMtPmZvbnQgJiYgcy0+Zm9u dC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49IDApCisgICAgICAgICAgICAgICAgICAgICAgICBwb3Np dGlvbiA9IHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICAgICAg ICBlbHNlIGlmIChzLT5mb250KQorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAo cy0+Zm9udC0+ZGVzY2VudCArIDEpIC8gMjsKKyAgICAgICAgICAgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHVuZGVybGluZV9taW5pbXVtX29mZnNl dDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBt YXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQpOworICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgLyogQ2hlY2sgdGhlIHNhbml0eSBvZiB0aGlja25lc3MgYW5kIHBv c2l0aW9uLiAgV2Ugc2hvdWxkCisgICAgICAgICAgICAgICAgIGF2b2lkIGRyYXdpbmcgdW5kZXJs aW5lIG91dCBvZiB0aGUgY3VycmVudCBsaW5lIGFyZWEuICovCisgICAgICAgICAgICAgIGlmIChz LT55ICsgcy0+aGVpZ2h0IDw9IHMtPnliYXNlICsgcG9zaXRpb24pCisgICAgICAgICAgICAgICAg cG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gMSkgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAg ICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPCBzLT55YmFzZSArIHBvc2l0aW9uICsgdGhpY2tu ZXNzKQorICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IChzLT55ICsgcy0+aGVpZ2h0KSAtIChz LT55YmFzZSArIHBvc2l0aW9uKTsKKyAgICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3RoaWNrbmVz cyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3Bvc2l0aW9uID0gcG9z aXRpb247CisgICAgICAgICAgICAgIHkgPSBzLT55YmFzZSArIHBvc2l0aW9uOworICAgICAgICAg ICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgICAg IHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCB5LCBzLT53aWR0aCwgdGhpY2tu ZXNzKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAgICAgICAgICAgWEdldEdDVmFsdWVzIChz LT5kaXNwbGF5LCBzLT5nYywgR0NGb3JlZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAg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CAhPSBG QUNFX05PX0JPWCkKKyAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JveCAocyk7CisgICAg ICBpZiAocy0+cHJldikKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcg KnByZXY7CisgICAgICAgICAgZm9yIChwcmV2ID0gcy0+cHJldjsgcHJldjsgcHJldiA9IHByZXYt PnByZXYpCisgICAgICAgICAgICBpZiAocHJldi0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAg ICAmJiBwcmV2LT54ICsgcHJldi0+d2lkdGggKyBwcmV2LT5yaWdodF9vdmVyaGFuZyA+IHMtPngp CisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBcyBwcmV2IHdhcyBkcmF3biB3 aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwgd2UKKyAgICAgICAgICAgICAgICAgICBtdXN0 IGRyYXcgdGhlIHJpZ2h0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwgbm93LiAqLworICAgICAg ICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gcHJldi0+aGw7CisgICAgICAg ICAgICAgICAgcHJldi0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY194X3NldF9nbHlw aF9zdHJpbmdfZ2MgKHByZXYsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9n bHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgcHJldik7CisgICAgICAgICAgICAgICAg aWYgKHByZXYtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAg ICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5n X2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAgICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5n bGVzIChwcmV2LT5mLCBwcmV2LT5nYyk7CisgICAgICAgICAgICAgICAgcHJldi0+aGwgPSBzYXZl OworICAgICAgICAgICAgICAgIHByZXYtPm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgIH0K KyAgICAgICAgfQorICAgICAgaWYgKHMtPm5leHQpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1 Y3QgZ2x5cGhfc3RyaW5nICpuZXh0OworICAgICAgICAgIGZvciAobmV4dCA9IHMtPm5leHQ7IG5l eHQ7IG5leHQgPSBuZXh0LT5uZXh0KQorICAgICAgICAgICAgaWYgKG5leHQtPmhsICE9IHMtPmhs CisgICAgICAgICAgICAgICAgJiYgbmV4dC0+eCAtIG5leHQtPmxlZnRfb3ZlcmhhbmcgPCBzLT54 ICsgcy0+d2lkdGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBcyBuZXh0 IHdpbGwgYmUgZHJhd24gd2hpbGUgY2xpcHBlZCB0byBpdHMgb3duIGFyZWEsCisgICAgICAgICAg ICAgICAgICAgd2UgbXVzdCBkcmF3IHRoZSBsZWZ0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwg bm93LiAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gbmV4 dC0+aGw7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAg ICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKG5leHQsIGN1cnNvcl9nY19wKTsKKyAgICAgICAg ICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgbmV4dCk7Cisg ICAgICAgICAgICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgp CisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQp OworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19jb21wb3Np dGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIHhfcmVz ZXRfY2xpcF9yZWN0YW5nbGVzIChuZXh0LT5mLCBuZXh0LT5nYyk7CisgICAgICAgICAgICAgICAg bmV4dC0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7Cisg ICAgICAgICAgICAgICAgbmV4dC0+Y2xpcF9oZWFkID0gcy0+bmV4dDsKKyAgICAgICAgICAgICAg fQorICAgICAgICB9CisgICAgfQorICAvKiBSZXNldCBjbGlwcGluZy4gKi8KKyAgeF9yZXNldF9j bGlwX3JlY3RhbmdsZXMgKHMtPmYsIHMtPmdjKTsKKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKwor LyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IC8qIERlZmF1bHQgdG8gdXNpbmcgWElNIGlmIGF2YWlsYWJsZS4gICovCiAjaWZkZWYgVVNFX1hJ TQogYm9vbCB1c2VfeGltID0gdHJ1ZTsKQEAgLTk5OSw2ICsxODc4LDE1IEBAIHhfdXBkYXRlX2Jl Z2luIChzdHJ1Y3QgZnJhbWUgKmYpCiAgIGlmIChGUkFNRV9UT09MVElQX1AgKGYpICYmICFGUkFN RV9WSVNJQkxFX1AgKGYpKQogICAgIHJldHVybjsKIAorCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IGY7 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgaWYgKCEgRlJBTUVfQ1JfU1VSRkFD RSAoZikpCiAgICAgewogICAgICAgaW50IHdpZHRoLCBoZWlnaHQ7CkBAIC0xMjY2LDYgKzIxNTQs MTYgQEAgeF91cGRhdGVfZW5kIChzdHJ1Y3QgZnJhbWUgKmYpCiAgIFhGbHVzaCAoRlJBTUVfWF9E SVNQTEFZIChmKSk7CiAgIHVuYmxvY2tfaW5wdXQgKCk7CiAjZW5kaWYKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGlu Z19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIH0KIAogLyog VGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgZnJvbSB2YXJpb3VzIHBsYWNlcyBpbiB4ZGlzcC5jCkBA IC0xMzEwMCw2ICsxMzk5OCwyMCBAQCB4X2FjdGl2YXRlX3RpbWVvdXRfYXRpbWVyICh2b2lkKQog CiBzdGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UgeF9yZWRpc3BsYXlfaW50ZXJmYWNl ID0KICAgeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisvKiBgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYHh0ZXJtLmNgIG11c3QgYmUgaW4g dGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRp c3BleHRlcm4uaGAhICovCisKKyAgbWNfeF9kcmF3X3dpbmRvd19jdXJzb3IsCisgIG1jX3hfZHJh d19nbHlwaF9zdHJpbmcsCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB4X2Zy YW1lX3Bhcm1faGFuZGxlcnMsCiAgICAgeF9wcm9kdWNlX2dseXBocywKICAgICB4X3dyaXRlX2ds eXBocywK --Multipart_Sat_Jun_29_22:42:10_2019-1--