From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.bugs Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). Date: Thu, 02 May 2019 17:48:18 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Thu_May__2_17:48:18_2019-1" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="131522"; mail-complaints-to="usenet@blaine.gmane.org" To: 22873@debbugs.gnu.org,17684@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 03 02:52:33 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMMRD-000TJJ-0H for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 May 2019 02:52:32 +0200 Original-Received: from localhost ([127.0.0.1]:60603 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMRB-0004CT-SS for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 May 2019 20:52:29 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMNw-0001iW-TS for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 20:49:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMMNt-00066T-Qi for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 20:49:08 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33862) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hMMNq-00063X-Hd for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 20:49:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hMMNq-0005Lx-EC for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 20:49: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: Fri, 03 May 2019 00:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs Original-Received: via spool by 22873-submit@debbugs.gnu.org id=B22873.155684450520516 (code B ref 22873); Fri, 03 May 2019 00:49:02 +0000 Original-Received: (at 22873) by debbugs.gnu.org; 3 May 2019 00:48:25 +0000 Original-Received: from localhost ([127.0.0.1]:47405 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hMMNF-0005Kq-M3 for submit@debbugs.gnu.org; Thu, 02 May 2019 20:48:25 -0400 Original-Received: from gateway20.websitewelcome.com ([192.185.68.24]:47768) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hMMND-0005Kc-KJ for 22873@debbugs.gnu.org; Thu, 02 May 2019 20:48:24 -0400 Original-Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 10E9B400C8785 for <22873@debbugs.gnu.org>; Thu, 2 May 2019 19:48:23 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id MMNCh0oyu2qH7MMNChJcec; Thu, 02 May 2019 19:48:23 -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:To:From:Message-ID:Date: Sender:Reply-To:Cc: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=WOHT6MWSwnwOhJYpNhxA++qA6w/E2jxrv+CXJGgHNqc=; b=YhGyoJ+SHoIajC0QOOguV0lzBj Ht//9n7hoxFMcquGe8zEmk0meU0CaRiAgwtDUfmJCANfgB4iUbMwCCBRkwpScUn6XvTpZOhupNZmh coWU0fg429mcFrD1IRFBMykUgPVcH3SF+Ln/OYWwq6ijGOJwOfimgrEM2j9lSre6j1i+UBeW7vgR/ HfpIDHnLdAY7Nvx7kcLd/NeCCeSEowphEcjT0uESGgwwOPsO3m4UCucMtaw9wAxNu8ML678rmSIXD zPd+k7o6fBDno/l7OfipOmfjwgrpkCp6Lzk1M0iP5BvClNiLVYs9c2AzpzXQOjNMZEHZJxinhy3oh IUxc2LFQ==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:51411 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from ) id 1hMMN9-000khW-ER; Thu, 02 May 2019 19:48:22 -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: 1hMMN9-000khW-ER X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:51411 X-Source-Auth: lawlist X-Email-Count: 2 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:158683 Archived-At: --Multipart_Thu_May__2_17:48:18_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 019.002 [05/02/2019] CHANGELOG: - Eliminated the usage of a Lisp_Object within `mc_update_text_area' in favor of an array of structs. [Every Lisp_Object that is eliminated will reduce the need for garbage collection.] - Eliminated `mc/save-window-scroll' when using the multiple-crosshairs library written by Magnar Sveen. [Said function caused non-selected windows to be updated during redisplay, resulting in undue slowdown.] - Miscellaneous changes regarding when/what stderr messages are to appear when running M-x trace-redisplay; and, changed the name of the function responsible for erasing fake cursors and resetting the cache: `mc_pre_scroll_clean'. Eliminated the message to run "M-x mc-install" when `crosshairs.el` loads. SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 04/08/2019: git reset --hard a038df77de7b1aa2d73a6478493b8838b59e4982 Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed")))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out the crosshairs feature, type: M-x +-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, install that package first. [If the multiple-cursors package is installed, an eval-after-load "multiple-cursors-core" statement within `crosshairs.el` will redefine a couple of functions and set up a few keyboard shortcuts.] If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors)) TODO: - Add support for `ch_inactive_windows' and `fc_inactive_windows'. - When using the multiple fake cursors feature, a fake cursor does not show up at zv_p. - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - Reduce the removal of fake cursors to the bare minimum when scrolling the text on the glass directly, and whenever `update_window' is called. - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create an minimal working example and file a bug report. - There is a bug affecting an older version of Emacs for the NS port that causes partial line flickering when the same characters are grouped together (;;;;;;) and MC_GLYPHLESS cursors are above or below -- having the same background color as the frame; e.g., black on black (used to erase a glyphless cursor). The partial flickering is only noticeable with rapid fire; e.g., holding down the right/left arrow key. When changing the color of the glyphless cursor, the issue is not present. [@lawlist has verified that the X and HPOS coordinates are accurate.] - There is a bug affecting the recorded `w->mc.lnum_pixel_width` that is observable when not running under gdb, but disappears when running under gdb. While viewing a folded org-mode buffer, the non-gdb instance had a visible line number pixel-width of 44, but Emacs treated it as fluctuating between 44 and 55 as the cursor was moved to the end of line. In the gdb instance, the visible line number pixel width was 55 with no fluctuation under the same conditions as the non-gdb instance. This appears to be a different bug than bug#32177 (current line number shifts one column to the left) because the line number of the current line does not shift left, and changing the bidi settings did not correct the issue. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. --Multipart_Thu_May__2_17:48:18_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_05_02__17_44_54_096.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zYmJkNjk3Ci0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI4MiBAQAorOzs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Cis7OzsgQkVHSU4gbW9kaWZpY2F0aW9uIG9mIHRoZSBNdWx0aXBsZSBDdXJzb3Jz IGxpYnJhcnkgd3JpdHRlbiBieSAgTWFnbmFyIFN2ZWVuLgorCisoZGVmdmFyIHBhY2thZ2UtYXJj aGl2ZXMpCisKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsKQorKGRlZnZhciBtYy9t YXgtY3Vyc29ycykKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsKQorKGRlZnZhciBt Yy9tYXgtY3Vyc29ycykKKyhkZWZ2YXIgbWMvYWx3YXlzLXJ1bi1mb3ItYWxsKQorKGRlZnZhciBt Yy0tdGhpcy1jb21tYW5kKQorKGRlZnZhciBtYy9jbWRzLXRvLXJ1bi1vbmNlKQorKGRlZnZhciBt Yy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1mb3ItYWxsKQorKGRlZnZhciBtYy9jbWRzLXRvLXJ1bi1m b3ItYWxsKQor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RlciBhIG5ldywgdGVtcG9yYXJ5IG1heGlt dW06ICIpKQorICAgICAgICAgIChtYy9yZW1vdmUtZmFrZS1jdXJzb3JzKQorICAgICAgICAgIChl cnJvciAiQWJvcnRlZDogdG9vIG1hbnkgY3Vyc29ycyIpKSkpCisgICAgKGxldCAoKG92ZXJsYXkK KyAgICAgICAgICAgIChpZiBtYy91c2UtYnVpbHQtaW4tY3Vyc29ycworICAgICAgICAgICAgICAo bWFrZS1vdmVybGF5IChwb2ludCkgKHBvaW50KSkKKyAgICAgICAgICAgICAgKG1jL21ha2UtY3Vy c29yLW92ZXJsYXktYXQtcG9pbnQpKSkpCisgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAnbWMt aWQgKG9yIGlkIChtYy9jcmVhdGUtY3Vyc29yLWlkKSkpCisgICAgICAob3ZlcmxheS1wdXQgb3Zl cmxheSAndHlwZSAnZmFrZS1jdXJzb3IpCisgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAncHJp b3JpdHkgMTAwKQorICAgICAgKG1jL3N0b3JlLWN1cnJlbnQtc3RhdGUtaW4tb3ZlcmxheSBvdmVy bGF5KQorICAgICAgKHdoZW4gKHVzZS1yZWdpb24tcCkKKyAgICAgICAgKG92ZXJsYXktcHV0IG92 ZXJsYXkgJ3JlZ2lvbi1vdmVybGF5CisgICAgICAgICAgICAgICAgICAgICAobWMvbWFrZS1yZWdp b24tb3ZlcmxheS1iZXR3ZWVuLXBvaW50LWFuZC1tYXJrKSkpCisgICAgICBvdmVybGF5KSkKKwor ICAoZGVmdW4gbWMvZXhlY3V0ZS1jb21tYW5kLWZvci1hbGwtZmFrZS1jdXJzb3JzIChjbWQpCisg ICAgIkNhbGxzIENNRCBpbnRlcmFjdGl2ZWx5IGZvciBlYWNoIGN1cnNvci4KKyAgSXQgd29ya3Mg YnkgbW92aW5nIHBvaW50IHRvIHRoZSBmYWtlIGN1cnNvciwgc2V0dGluZworICB1cCB0aGUgcHJv cGVyIGVudmlyb25tZW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vdCBzdXBwb3J0 ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4g KGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3Qg KG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1j L2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMv YWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2Nt ZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMv cHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29y cyBvcmlnaW5hbC1jb21tYW5kKSkpKQorICAgICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQt aW4tY3Vyc29ycworICAgICAgICAgICAgICAgIChzZXRxIG1jLWNvbmYKKyAgICAgICAgICAgICAg IC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lY3RvciBieSA2NTUzNS4iCisoaW50ZXJhY3RpdmUpCisgIChsZXQgKChidWZmZXIg KGdldC1idWZmZXItY3JlYXRlICIqTUMtVEVTVCoiKSkpCisgICAgKHdpdGgtY3VycmVudC1idWZm ZXIgYnVmZmVyCisgICAgICAoZXJhc2UtYnVmZmVyKQorICAgICAgKGluc2VydCAiVGhpcyBpcyBh IHRlc3QhIikKKyAgICAgIChzZXRxIG1jLWNvbmYgJygoMSAiaGJhciIgIm1hZ2VudGEiKQorICAg ICAgICAgICAgICAgICAgICAgICgyICJiYXIiICJwdXJwbGUiKQorICAgICAgICAgICAgICAgICAg ICAgICgzICJib3giICIjMDBGRjAwIikKKyAgICAgICAgICAgICAgICAgICAgICAoNCAiaG9sbG93 IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAgICAgKDUgKCJoYmFyIiAzKSBbMS4wIDAu MCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAzKSBbMC4wIDEuMCAxLjBd KQorICAgICAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFuZ2VSZWQiKQorICAgICAg ICAgICAgICAgICAgICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAgICAgICAgICAgICAgICAg ICg5ICJib3giICJncmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93IChkaXNwbGF5LWJ1ZmZl ciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2luY2UgdGhpcyBmaXJlcyBn bG9iYWxseSwgd2UgbXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jvc3NoYWlycyBhcHBlYXIg aW4uIgorICAod2hlbiArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVtcSBsYXN0LWNvbW1hbmQg Ky1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVsbCArLXBhcmVucy1wKSkK KyAgICAgICgrLXBhcmVucy1mbikpCisgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgIChzZXRx IHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1pZGxlLWxpc3QpKQorICAg ICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkpKQorCisoZGVmdW4gKy1kcmF3LWZvcnRod2l0aCAo KQorIkltbWVkaWF0ZWx5IGRlbGV0ZS9kcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzLiIKKyAgKCst ZHJhdy1jcm9zc2hhaXJzICdmb3JjZSkpCisKKyhkZWZ1biArLWRyYXctY3Jvc3NoYWlycyAoJm9w dGlvbmFsIGZvcmNlKQorIkltbWVkaWF0ZWx5IGRlbGV0ZSBtYXRjaGluZyBwYXJlbnRoZXNlcy4g IElmIEZPUkNFIGlzIG5vbi1uaWwsIHRoZW4gaW1tZWRpYXRlbHkKK2RyYXcgbWF0Y2hpbmcgcGFy ZW50aGVzaXM7IG90aGVyd2lzZSwgZHJhdyB0aGVtIG9uIGFuIGlkbGUtdGllci4iCisgICh3aGVu ICstbW9kZQorICAgICh3aGVuICstdGltZXItdmFyCisgICAgICAoc2V0cSB0aW1lci1pZGxlLWxp c3QgKGRlbHEgKy10aW1lci12YXIgdGltZXItaWRsZS1saXN0KSkKKyAgICAgIChzZXRxICstdGlt ZXItdmFyIG5pbCkpCisgICAgKHVubGVzcyAob3IgKG1lbXEgdGhpcy1jb21tYW5kICstcGFyZW5z LWV4Y2x1c2lvbnMpCisgICAgICAgICAgICAgICAgKGFuZCAobnVsbCArLXBhcmVucy1wKQorICAg ICAgICAgICAgICAgICAgICAgKG51bGwgKy1wYXJlbnMtb3ZlcmxheXMtZXhpc3QtcCkpKQorICAg ICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZvcmNlCisgICAgICAocHJv Z24KKyAgICAgICAgKHdoZW4gKy1wYXJlbnMtcAorICAgICAgICAgICgrLXBhcmVucy1mbikpKQor ICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGltZXIgKy1pZGxlLXRpbWVy LXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKyhkZWZ2YXIgZmMtbW9kZSkKKworOzs7 IyMjYXV0b2xvYWQKKyhkZWZpbmUtbWlub3ItbW9kZSArLW1vZGUKKyJNaW5vciBtb2RlIGZvciBk aXNwbGF5aW5nIGEgaG9yaXpvbnRhbCBydWxlci4iCisgIDppbml0LXZhbHVlIG5pbAorICA6bGln aHRlciAiICsiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisgIDpncm91cCAnKy1tb2Rl CisgIChjb25kCisgICAgKCstbW9kZQorICAgICAgOzs7IGArLW1vZGUnIGhhcyB0aGUgYWJpbGl0 eSB0byBhbHNvIGRpc3BsYXkgYSBmaWxsIGNvbHVtbiBpbmRpY2F0b3IuCisgICAgICA7OzsgU2Vl IHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuCisgICAgICAod2hlbiBmYy1tb2RlCisgICAg ICAgIChmYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFsLWVsZG9jLW1vZGUKKyAg ICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgICAg ICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAgKGdsb2JhbC1l bGRvYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2stY29udGV4dC10aW1lcgor ICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAo dGltZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciBq aXQtbG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEgaml0LWxvY2stY29udGV4 dC10aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAnaml0LWxvY2stY29udGV4 dC1mb250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4dC10aW1lciBuaWwpKQor ICAgICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAo dGltZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQorICAgICAgICAgIChjYW5j ZWwtdGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpKQorICAgICAgICAoZnNl dCAndW5kby1hdXRvLS11bmRvYWJsZS1jaGFuZ2UKKyAgICAgICAgICAgICAgKGxhbWJkYSAoKSAo YWRkLXRvLWxpc3QgJ3VuZG8tYXV0by0tdW5kb2FibHktY2hhbmdlZC1idWZmZXJzIChjdXJyZW50 LWJ1ZmZlcikpKSkKKyAgICAgICAgKGZzZXQgJ3VuZG8tYXV0by1hbWFsZ2FtYXRlICdpZ25vcmUp KQorICAgICAgKHdoZW4gYmxpbmstY3Vyc29yLW1vZGUKKyAgICAgICAgKGJsaW5rLWN1cnNvci1t b2RlIC0xKQorICAgICAgICAod2hlbiAobWVtcSAnYmxpbmstY3Vyc29yLWNoZWNrIHBvc3QtY29t bWFuZC1ob29rKQorICAgICAgICAgIChyZW1vdmUtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJ2Js aW5rLWN1cnNvci1jaGVjaykpKQorICAgICAgKHNldHEgY3Jvc3NoYWlycyB0KQorICAgICAgKHdo ZW4gKy1maWxsLWNvbHVtbgorICAgICAgICAoc2V0cSBmYy12aXNpYmxlIHQpKQorICAgICAgOzs7 I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RpY2F0b3ItYWxpc3QKKyAgICAgICAgICAgICAgICAgICAgIHRhYi13 aWR0aAorICAgICAgICAgICAgICAgICAgICAgbGluZS1tb3ZlLXZpc3VhbAorICAgICAgICAgICAg ICAgICAgICAgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgICAgICAgICAgICAgIHRydW5jYXRlLXBh cnRpYWwtd2lkdGgtd2luZG93cworICAgICAgICAgICAgICAgICAgICAgd29yZC13cmFwKSkKKyAg ICAgICAgKHdoZW4gKGxvY2FsLXZhcmlhYmxlLXAgdmFyKQorICAgICAgICAgIChwdXNoIChjb25z IHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICstLXNhdmVkLXN0YXRlKSkpCisgICAgICAoc2V0cSBm aWxsLWNvbHVtbiA4MCkKKyAgICAgIChzZXRxIGRpc3BsYXktbGluZS1udW1iZXJzIHQpCisgICAg ICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1saW5lKQorICAgICAgKHNl dHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAoc2V0cSBidWZmZXItZGlzcGxheS10YWJs ZSArLWJ1ZmZlci1kaXNwbGF5LXRhYmxlKQorICAgICAgKHNldHEgdGFiLXdpZHRoIDQpCisgICAg ICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlzdWFsKSB0KQorICAgICAg KHNldHEgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKGxldCAoKGxz dCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisgICAgICAgICAgICAgICAgICBtb2Rl KQorICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAgICAod2hpbGUgKHNldHEg bW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAgICAgKHdoZW4gKGRlcml2ZWQtbW9kZS1wIG1v ZGUpCisgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkpKSkKKyAgICAgICAgICAg KChtZW1xIG1ham9yLW1vZGUgKy10cnVuY2F0ZS1saW5lcy1tYWpvci1tb2RlcykpCisgICAgICAg ICAgICh0CisgICAgICAgICAgICAgbmlsKSkpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlh YmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRvd3MpIG5pbCkKKyAgICAgIChzZXRxIHdv cmQtd3JhcCB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGluZXMgdCkKKyAgICAgIChz ZXRxIGluZGljYXRlLWJ1ZmZlci1ib3VuZGFyaWVzICdsZWZ0KQorICAgICAgKHNldHEgZnJpbmdl LWluZGljYXRvci1hbGlzdAorICAgICAgICAgIDs7OyBoc2NsX2FsbF90ZW1wX3AgfCBoc2NsX3Rl bXBfcAorICAgICAgICAnKCgrLWhzY2wtdGVtcCAuICgrLXNpbmdsZS1hbmdsZS1sZWZ0CisgICAg ICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLWxlZnQpKQorICAgICAgICAgIDs7 OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxsX3Blcm1fMV9wIHwgaHNjbF9hbGxfcGVybV8y X3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICgrLWhzY2wtcGVybSAuICgrLXNpbmdsZS1hbmds ZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1hbmdsZS11cAorICAgICAg ICAgICAgICAgICAgICAgICAgICArLXRyaXBsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAg ICAgICAgICArLXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAgKCstb3ZlcmxheS1hcnJv dyAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAr LWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAgKHRydW5jYXRpb24gLiAoKy1mcmluZ2Ut bGVmdC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJpZ2h0LWFycm93 KSkKKyAgICAgICAgICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxlZnQtY3VybHktYXJyb3cK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNoKSkKKyAgICAgICAgICAob3Zl cmxheS1hcnJvdyAuICstZnJpbmdlLXJpZ2h0LXRyaWFuZ2xlKQorICAgICAgICAgICh1cCAuICst ZnJpbmdlLXVwLWFycm93KQorICAgICAgICAgIChkb3duIC4gKy1mcmluZ2UtZG93bi1hcnJvdykK KyAgICAgICAgICAodG9wIC4gKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUpCisgICAgICAgICAgKGJv dHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAgICAgICAodG9wLWJvdHRv bSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICArLWZy aW5nZS1yaWdodC1icmFja2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtdG9w LXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtdG9wLWxlZnQt YW5nbGUpKQorICAgICAgICAgIChlbXB0eS1saW5lIC4gKy1mcmluZ2UtZW1wdHktbGluZSkKKyAg ICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmspKSkKKyAgICAgIChzZXRx IGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94IC4gKy1mcmluZ2UtbGVmdC10cmlhbmdsZSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaG9sbG93IC4gKy1ob2xsb3ctcmVjdGFu Z2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChiYXIgLiArLXZlcnRpY2Fs LWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaGJhciAuICstZnJpbmdl LWhvcml6b250YWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChob2xs b3ctc21hbGwgLiArLWZyaW5nZS1ob2xsb3ctc3F1YXJlKSkpCisgICAgICAoaWYgKG9yICstZm9y dGh3aXRoCisgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisg ICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJhdy1mb3J0aHdpdGggJ2Fw cGVuZCAnbG9jYWwpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJh dy1jcm9zc2hhaXJzICdhcHBlbmQgJ2xvY2FsKSkKKyAgICAgICh3aGVuICstZm9ydGh3aXRoCisg ICAgICAgIChhZGQtaG9vayAnd2luZG93LWNvbmZpZ3VyYXRpb24tY2hhbmdlLWhvb2sgJystZHJh dy1mb3J0aHdpdGggbmlsICdsb2NhbCkpCisgICAgICAoYWRkLWhvb2sgJ2NoYW5nZS1tYWpvci1t b2RlLWhvb2sgJ3R1cm4tb2ZmLSstbW9kZSBuaWwgJ2xvY2FsKQorICAgICAgKHdoZW4gKGNhbGxl ZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKy1mb3J0 aHdpdGgKKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScgLS0gRHJhdyBt YXRjaGluZyBwYXJlbnRoZXNlcyBpbW1lZGlhdGVseS4iKSkKKyAgICAgICAgICAoKGVxdWFsIGN1 cnJlbnQtcHJlZml4LWFyZyAnKDQpKQorICAgICAgICAgICAgOzs7IE1hdGNoaW5nIHBhcmVudGhl c2VzIHdpbGwgYmUgZHJhd24gaW1tZWRpYXRlbHkuCisgICAgICAgICAgIC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dHktbGluZXMpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnaW5k aWNhdGUtYnVmZmVyLWJvdW5kYXJpZXMpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnZnJp bmdlLWluZGljYXRvci1hbGlzdCkKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdmcmluZ2Ut Y3Vyc29yLWFsaXN0KQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJytmb3J0aHdpdGgpCisg ICAgICAoZG9saXN0IChzYXZlZCArLS1zYXZlZC1zdGF0ZSkKKyAgICAgICAgKHNldCAobWFrZS1s b2NhbC12YXJpYWJsZSAoY2FyIHNhdmVkKSkgKGNkciBzYXZlZCkpKQorICAgICAgKGtpbGwtbG9j YWwtdmFyaWFibGUgJystLXNhdmVkLXN0YXRlKQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVy bGF5cykKKyAgICAgICh3aGVuIChtZW1xICcrLWRyYXctZm9ydGh3aXRoIHBvc3QtY29tbWFuZC1o b29rKQorICAgICAgICAocmVtb3ZlLWhvb2sgJ3Bvc3QtY29tbWFuZC1ob29rICcrLWRyYXctZm9y dGh3aXRoICdsb2NhbCkpCisgICAgICAod2hlbiAobWVtcSAnKy1kcmF3LWNyb3NzaGFpcnMgcG9z dC1jb21tYW5kLWhvb2spCisgICAgICAgIChyZW1vdmUtaG9vayAncG9zdC1jb21tYW5kLWhvb2sg JystZHJhdy1jcm9zc2hhaXJzICdsb2NhbCkpCisgICAgICAod2hlbiAobWVtcSAnKy1kcmF3LWZv cnRod2l0aCB3aW5kb3ctY29uZmlndXJhdGlvbi1jaGFuZ2UtaG9vaykKKyAgICAgICAgKHJlbW92 ZS1ob29rICd3aW5kb3ctY29uZmlndXJhdGlvbi1jaGFuZ2UtaG9vayAnKy1kcmF3LWZvcnRod2l0 aCAnbG9jYWwpKQorICAgICAgKHJlbW92ZS1ob29rICdjaGFuZ2UtbWFqb3ItbW9kZS1ob29rICd0 dXJuLW9mZi0rLW1vZGUgJ2xvY2FsKQorICAgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgICAg KHNldHEgdGltZXItaWRsZS1saXN0IChkZWxxICstdGltZXItdmFyIHRpbWVyLWlkbGUtbGlzdCkp CisgICAgICAgIChzZXRxICstdGltZXItdmFyIG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWlu dGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAobWVzc2FnZSAiVHVybmVkIE9GRiBgKy1tb2Rl Jy4iKSkpKSkKKworKGRlZnVuIHR1cm4tb2ZmLSstbW9kZSAoKQorICAoKy1tb2RlIC0xKSkKKwor Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7CisKKyhkZWZ1biArLXBhcmVucy1mbiAoKQorICAiRG9j LXN0cmluZy4iCisgIChsZXQqICgob3BvaW50IChwb2ludCkpCisgICAgICAgICAoZnJvbSAoaWYg Ky1wYXJlbnMtZnJvbS1mbgorICAgICAgICAgICAgICAgICAoZnVuY2FsbCArLXBhcmVucy1mcm9t LWZuKQorICAgICAgICAgICAgICAgICAocG9pbnQtbWluKSkpCisgICAgICAgICAod2luIChzZWxl Y3RlZC13aW5kb3cpKQorICAgICAgICAgKGkgMCkKKyAgICAgICAgIChwcmVjZWRpbmctY2hhciAo cHJlY2VkaW5nLWNoYXIpKQorICAgICAgICAgKG9jaGFyIChjaGFyLWFmdGVyIG9wb2ludCkpCisg ICAgICAgICAocG9zMQorICAgICAgICAgICAoY29uZAorICAgICAgICAgICAgICgoYW5kIG9jaGFy CisgICAgICAgICAgICAgICAgICAgKG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDApID0+IG9wZW5p bmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgNDApCisgICAg ICAgICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgOTEpID0+IG9wZW5pbmcgc3F1 YXJlIGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgOTEpCisgICAgICAg ICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgMTIzKSA9PiBvcGVuaW5nIHdhdnkg YnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAoPSBvY2hhciAxMjMpKSkKKyAgICAgICAg ICAgICAgICAobWluICgxKyBvcG9pbnQpIChwb2ludC1tYXgpKSkKKyAgICAgICAgICAgICAoKG9y IDs7OyAoY2hhci10by1zdHJpbmcgNDEpID0+IGNsb3NpbmcgcGFyZW50aGVzaXMKKyAgICAgICAg ICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDQxKQorICAgICAgICAgICAgICAgICAgOzs7IChj aGFyLXRvLXN0cmluZyA5MykgPT4gY2xvc2luZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAg ICAgICAgKD0gcHJlY2VkaW5nLWNoYXIgOTMpCisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXIt dG8tc3RyaW5nIDEyNSkgPT4gY2xvc2luZyB3YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAg ICg9IHByZWNlZGluZy1jaGFyIDEyNSkpCisgICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWlu KSAoMS0gb3BvaW50KSkpCisgICAgICAgICAgICAgKHQKKyAgICAgICAgICAgICAgICBvcG9pbnQp KSkKKyAgICAgICAgIHBvczIKKyAgICAgICAgIHNlbGVjdGVkLWZhY2UpCisgICAgKHNhdmUtZXhj dXJzaW9uCisgICAgICAoY29uZGl0aW9uLWNhc2UgbmlsCisgICAgICAgICh3aGlsZSAoc2V0cSBw b3MxIChudGggMSAocGFyc2UtcGFydGlhbC1zZXhwIGZyb20gcG9zMSkpKQorICAgICAgICAgIChz ZXRxIHBvczIgKHNjYW4tc2V4cHMgcG9zMSAxKSkKKyAgICAgICAgICAoaWYgKD0gaSAxMCkKKyAg ICAgICAgICAgIChzZXRxIGkgMSkKKyAgICAgICAgICAgIChzZXRxIGkgKDErIGkpKSkKKyAgICAg ICAgICAoc2V0cSBzZWxlY3RlZC1mYWNlIChjb25kCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICgoPSBpIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFy ZW5zLW9uZS1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAyKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10d28tZmFjZSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgMykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtdGhyZWUtZmFjZSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKCg9IGkgNCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAnKy1wYXJlbnMtZm91ci1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo KD0gaSA1KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1maXZl LWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDYpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXNpeC1mYWNlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA3KQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICcrLXBhcmVucy1zZXZlbi1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoKD0gaSA4KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBh cmVucy1laWdodC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA5 KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1uaW5lLWZhY2Up CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEwKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10ZW4tZmFjZSkpKQorICAgICAgICAgIChs ZXQgKChvdiAobWFrZS1vdmVybGF5IHBvczEgKDErIHBvczEpKSkpCisgICAgICAgICAgICAodW5s ZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRvd3MKKyAgICAgICAgICAgICAgKG92ZXJsYXktcHV0 IG92ICd3aW5kb3cgd2luKSkKKyAgICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBzZWxl Y3RlZC1mYWNlKSkKKyAgICAgICAgICAod2hlbiBwb3MyCisgICAgICAgICAgICAobGV0ICgob3Yg KG1ha2Utb3ZlcmxheSAoMS0gcG9zMikgcG9zMikpKQorICAgICAgICAgICAgICAodW5sZXNzICst cGFyZW5zLWluYWN0aXZlLXdpbmRvd3MKKyAgICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3Yg J3dpbmRvdyB3aW4pKQorICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0 ZWQtZmFjZSkpKSkKKyAgICAgICAgKGVycm9yIG5pbCkpKQorICAgIChzZXRxICstcGFyZW5zLW92 ZXJsYXlzLWV4aXN0LXAgdCkpKQorCisoZGVmdW4gKy1yZW1vdmUtb3ZlcmxheXMgKGJlZyBlbmQg bmFtZSB2YWwpCisiUmVtb3ZlIHRoZSBvdmVybGF5cyB0aGF0IGFyZSBgZXF1YWwtaW5jbHVkaW5n LXByb3BlcnRpZXNgLgorSW5jbHVkZXMgYSB1bmlxdWUgc2l0dWF0aW9uIHdoZW4gYW4gb3Zlcmxh eSB3aXRoIGFuIGAnYWZ0ZXItc3RyaW5nYCBwcm9wZXJ0eQoraXMgYXQgdGhlIHZlcnkgZW5kIG9m IGEgbmFycm93ZWQtYnVmZmVyLiIKKyAgKGxldCogKChwb2ludC1tYXggKHBvaW50LW1heCkpCisg ICAgICAgICAocG9pbnQtbWluIChwb2ludC1taW4pKQorICAgICAgICAgKG5hcnJvd2VkLXAgKGJ1 ZmZlci1uYXJyb3dlZC1wKSkKKyAgICAgICAgIChiZWcgKGlmIGJlZyBiZWcgcG9pbnQtbWluKSkK KyAgICAgICAgIChlbmQKKyAgICAgICAgICAgKGNvbmQKKyAgICAgICAgICAgICAoKGFuZAorICAg ICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAgICAgICAgICAgICAgIGVuZCkKKyAg ICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAo bm90IG5hcnJvd2VkLXApCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAg ICAgICBwb2ludC1tYXgpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFy cm93ZWQtcAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKDwgZW5kIHBv aW50LW1heCkpCisgICAgICAgICAgICAgICBlbmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAg ICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAg ICAgICAgKD0gZW5kIHBvaW50LW1heCkpCisgICAgICAgICAgICAgICAoMSsgZW5kKSkKKyAgICAg ICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAg ICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICAoMSsgcG9pbnQtbWF4KSkgKSkKKyAgICAg ICAgIChvdmVybGF5cworICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAgICAob3ZlcmxheS1y ZWNlbnRlciBlbmQpCisgICAgICAgICAgICAgKG92ZXJsYXlzLWluIGJlZyBlbmQpKSkpCisgICAg KHdoZW4gKGFuZCBiZWcgZW5kIG5hbWUgdmFsKQorICAgICAgKGRvbGlzdCAobyBvdmVybGF5cykK KyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKGFuZCAoZXEgbmFtZSAnZmFjZSkKKyAgICAgICAg ICAgICAgICAoZXEgKG92ZXJsYXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIDs7IEVp dGhlciBwdXNoIHRoaXMgb3ZlcmxheSBvdXRzaWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsg b3Igc3BsaXQgaXQgdG8gZXhjbHVkZSBiZWcuLi5lbmQKKyAgICAgICAgICAgIDs7IG9yIGRlbGV0 ZSBpdCBlbnRpcmVseSAoaWYgaXQgaXMgY29udGFpbmVkIGluIGJlZy4uLmVuZCkuCisgICAgICAg ICAgICAoaWYgKDwgKG92ZXJsYXktc3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAgIChpZiAo PiAob3ZlcmxheS1lbmQgbykgZW5kKQorICAgICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAg ICAgICAobW92ZS1vdmVybGF5IChjb3B5LW92ZXJsYXkgbykKKyAgICAgICAgICAgICAgICAgIChv dmVybGF5LXN0YXJ0IG8pIGJlZykKKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5k IChvdmVybGF5LWVuZCBvKSkpCisgICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gKG92 ZXJsYXktc3RhcnQgbykgYmVnKSkKKyAgICAgICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBv KSBlbmQpCisgICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVu ZCBvKSkKKyAgICAgICAgICAgICAgICAoZGVsZXRlLW92ZXJsYXkgbykpKSkKKyAgICAgICAgICAo KGFuZCAobm90ICh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vYmFsLWVsZG9jLW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBq aXQtbG9jay1jb250ZXh0LXRpbWVyCisgICAgICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3Rp dmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcg Jyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAg ICAgICAgICAoY2FuY2VsLXRpbWVyIGppdC1sb2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7 OyAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAn cmVwZWF0ICdqaXQtbG9jay1jb250ZXh0LWZvbnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9j ay1jb250ZXh0LXRpbWVyIG5pbCkpCisgICAgICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3Rp dmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcg Jyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnkt dGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFy eS10aW1lcikpCisgICAgICAgIChmc2V0ICd1bmRvLWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAg ICAgICAgICAgICAobGFtYmRhICgpIChhZGQtdG8tbGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1j aGFuZ2VkLWJ1ZmZlcnMgKGN1cnJlbnQtYnVmZmVyKSkpKQorICAgICAgICAoZnNldCAndW5kby1h dXRvLWFtYWxnYW1hdGUgJ2lnbm9yZSkpCisgICAgICAod2hlbiBibGluay1jdXJzb3ItbW9kZQor ICAgICAgICAoYmxpbmstY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uZCBN VUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiBzdGF0aWMg dm9pZAogYnNldF9hYmJyZXZfbW9kZSAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFs KQogewpAQCAtNTE0Miw2ICs1MjA1LDI0IEBAIGluaXRfYnVmZmVyX29uY2UgKHZvaWQpCiAgIGJz ZXRfbGFzdF9zZWxlY3RlZF93aW5kb3cgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG1ha2VfZml4bnVt ICgwKSk7CiAKICAgaWR4ID0gMTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9m bGFncywgbWNfcmVhbF9mYWtlX2N1cnNvciksIGlkeCk7ICsraWR4OworICBYU0VURkFTVElOVCAo QlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbWNfY29uZiksIGlkeCk7ICsraWR4OworICBYU0VU RkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbWNfaW5hY3RpdmVfd2luZG93cyks IGlkeCk7ICsraWR4OworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywg Y3Jvc3NoYWlycyksIGlkeCk7ICsraWR4OworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9s b2NhbF9mbGFncywgY2hfaG9yaXpvbnRhbF9ydWxlciksIGlkeCk7ICsraWR4OworICBYU0VURkFT VElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgY2hfdmVydGljYWxfcnVsZXIpLCBpZHgp OyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIGNoX2lu YWN0aXZlX3dpbmRvd3MpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZm ZXJfbG9jYWxfZmxhZ3MsIGZjX3Zpc2libGUpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQg KEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIGZjX2luYWN0aXZlX3dpbmRvd3MpLCBpZHgpOyAr K2lkeDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBYU0VURkFTVElOVCAoQlZB UiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbW9kZV9saW5lX2Zvcm1hdCksIGlkeCk7ICsraWR4Owog ICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgYWJicmV2X21vZGUpLCBp ZHgpOyArK2lkeDsKICAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG92 ZXJ3cml0ZV9tb2RlKSwgaWR4KTsgKytpZHg7CkBAIC01MjI4LDYgKzUzMDksMjQgQEAgaW5pdF9i dWZmZXJfb25jZSAodm9pZCkKICAgLyogTXVzdCBkbyB0aGVzZSBiZWZvcmUgbWFraW5nIHRoZSBm aXJzdCBidWZmZXIhICovCiAKICAgLyogcmVhbCBzZXR1cCBpcyBkb25lIGluIGJpbmRpbmdzLmVs ICovCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgYnNldF9tY19yZWFsX2Zha2VfY3Vyc29yICgmYnVmZmV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zcmMvYnVmZmVyLmgKQEAgLTczNiw2ICs3MzYsNDAgQEAg c3RydWN0IGJ1ZmZlcgogICAgICBpbiB0aGUgZGlzcGxheSBvZiB0aGlzIGJ1ZmZlci4gICovCiAg IExpc3BfT2JqZWN0IGV4dHJhX2xpbmVfc3BhY2luZ187CiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogVGhlIGN1cnNvciB0eXBlIG9m IHRoZSByZWFsIGZha2UgY3Vyc29yLiAqLworICBMaXNwX09iamVjdCBtY19yZWFsX2Zha2VfY3Vy c29yXzsKKworICAvKiBUaGUgbmFtZSBvZiBsaXN0IHVzZWQgYnkgbXVsdGlwbGUgY3Vyc29ycyBm b3IgbmV4dCByZWRpc3BsYXkuICovCisgIExpc3BfT2JqZWN0IG1jX2NvbmZfOworCisgIC8qIFdo ZXRoZXIgdG8gZHJhdyBtdWx0aXBsZSBjdXJzb3JzIGluIGluYWN0aXZlIHdpbmRvd3MuICovCisg IExpc3BfT2JqZWN0IG1jX2luYWN0aXZlX3dpbmRvd3NfOworCisgIC8qIFRoZSBuYW1lIG9mIHRo ZSBidWZmZXItbG9jYWwgdmFyaWFibGUuICovCisgIExpc3BfT2JqZWN0IGNyb3NzaGFpcnNfOwor CisgIC8qIFRoZSBuYW1lIG9mIHRoZSBjcm9zc2hhaXJzIGhvcml6b250YWwgcnVsZXIuICovCisg IExpc3BfT2JqZWN0IGNoX2hvcml6b250YWxfcnVsZXJfOworCisgIC8qIFRoZSBuYW1lIG9mIHRo ZSBjcm9zc2hhaXJzIHZlcnRpY2FsIHJ1bGVyLiAqLworICBMaXNwX09iamVjdCBjaF92ZXJ0aWNh bF9ydWxlcl87CisKKyAgLyogV2hldGhlciB0byBkcmF3IGNyb3NzaGFpcnMgaW4gaW5hY3RpdmUg d2luZG93cy4gKi8KKyAgTGlzcF9PYmplY3QgY2hfaW5hY3RpdmVfd2luZG93c187CisKKyAgLyog VGhlIG5hbWUgb2YgdGhlIGJ1ZmZlci1sb2NhbCB2YXJpYWJsZS4gKi8KKyAgTGlzcF9PYmplY3Qg ZmNfdmlzaWJsZV87CisKKyAgLyogV2hldGhlciB0byBkcmF3IG11bHRpcGxlIGN1cnNvcnMgZmls bCBjb2x1bW4gaW4gaW5hY3RpdmUgd2luZG93cy4gKi8KKyAgTGlzcF9PYmplY3QgZmNfaW5hY3Rp dmVfd2luZG93c187CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogQ3Vyc29y IHR5cGUgdG8gZGlzcGxheSBpbiBub24tc2VsZWN0ZWQgd2luZG93cy4KICAgICAgdCBtZWFucyB0 byB1c2UgaG9sbG93IGJveCBjdXJzb3IuCiAgICAgIFNlZSBgY3Vyc29yLXR5cGUnIGZvciBvdGhl ciB2YWx1ZXMuICAqLwpAQCAtNzg3LDE0ICs4MjEsMjEgQEAgc3RydWN0IGJ1ZmZlcgogICAgICBh biBpbmRpcmVjdCBidWZmZXIgc2luY2UgaXQgY291bnRzIGFzIGl0cyBiYXNlIGJ1ZmZlci4gICov CiAgIGludCB3aW5kb3dfY291bnQ7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKICAgLyogQSBub24temVybyB2YWx1ZSBpbiBzbG90IElEWCBt ZWFucyB0aGF0IHBlci1idWZmZXIgdmFyaWFibGUKICAgICAgd2l0aCBpbmRleCBJRFggaGFzIGEg bG9jYWwgdmFsdWUgaW4gdGhpcyBidWZmZXIuICBUaGUgaW5kZXggSURYCiAgICAgIGZvciBhIGJ1 ZmZlci1sb2NhbCB2YXJpYWJsZS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KQoreworICBiLT5jaF9pbmFjdGl2ZV93aW5kb3dzXyA9IHZhbDsKK30KKwor SU5MSU5FIHZvaWQKK2JzZXRfYmx2X2ZjX3Zpc2libGUgKHN0cnVjdCBidWZmZXIgKmIsIExpc3Bf T2JqZWN0IHZhbCkKK3sKKyAgYi0+ZmNfdmlzaWJsZV8gPSB2YWw7Cit9CisKK0lOTElORSB2b2lk Citic2V0X2Jsdl9mY19pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09i amVjdCB2YWwpCit7CisgIGItPmZjX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCisvKiBl bmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogSU5M SU5FIHZvaWQKIGJzZXRfYmlkaV9wYXJhZ3JhcGhfZGlyZWN0aW9uIChzdHJ1Y3QgYnVmZmVyICpi LCBMaXNwX09iamVjdCB2YWwpCiB7CmRpZmYgLS1naXQgYS9zcmMvZGlzcGV4dGVybi5oIGIvc3Jj L2Rpc3BleHRlcm4uaAppbmRleCAxYTUzNjU2Li5kNjg5YTJkIDEwMDY0NAotLS0gYS9zcmMvZGlz cGV4dGVybi5oCisrKyBiL3NyYy9kaXNwZXh0ZXJuLmgKQEAgLTEwMCw2ICsxMDAsMzYgQEAgdHlw ZWRlZiBpbnQgQ3Vyc29yOwogI2RlZmluZSBOYXRpdmVSZWN0YW5nbGUgaW50CiAjZW5kaWYKIAor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8K KworLyogRm9yd2FyZCBwcm90b3R5cGUgZGVmaW5pdGlvbnMuICovCitlbnVtIHR5cGVfb2ZfY2Fj aGU7CisKK2VudW0gdHlwZV9vZl9jdXJzb3I7CisKK2VudW0gbWNfZmxhdm9yOworCitlbnVtIHR5 cGVfb2ZfYWN0aW9uCit7CisgIE1VTFRJUExFX0NVUlNPUlMsCisgIEhPUklaT05UQUxfUlVMRVIs CisgIFZFUlRJQ0FMX1JVTEVSLAorICBGSUxMX0NPTFVNTgorfTsKKworc3RydWN0IG1jX1JHQgor eworICBkb3VibGUgcmVkOworICBkb3VibGUgZ3JlZW47CisgIGRvdWJsZSBibHVlOworfTsKKwor LyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IC8qIFRleHQgY3Vyc29yIHR5cGVzLiAgKi8KIAogZW51bSB0ZXh0X2N1cnNvcl9raW5kcwpAQCAt MzgyLDYgKzQxMiwyMCBAQCBzdHJ1Y3QgZ2x5cGhfc2xpY2UKIAogc3RydWN0IGdseXBoCiB7CisK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAg aW50IHgsIHksIGhwb3MsIHZwb3M7CisKKyAgaW50IHJlbGF0aXZlX3g7CisKKyAgYm9vbF9iZiB6 dl9wIDogMTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBQb3NpdGlvbiBm cm9tIHdoaWNoIHRoaXMgZ2x5cGggd2FzIGRyYXduLiAgSWYgYG9iamVjdCcgYmVsb3cgaXMgYQog ICAgICBMaXNwIHN0cmluZywgdGhpcyBpcyBhbiBpbmRleCBpbnRvIHRoYXQgc3RyaW5nLiAgSWYg aXQgaXMgYQogICAgICBidWZmZXIsIHRoaXMgaXMgYSBwb3NpdGlvbiBpbiB0aGF0IGJ1ZmZlci4g IEluIGFkZGl0aW9uLCBzb21lCkBAIC0xMjQ4LDYgKzEyOTIsMjggQEAgZW51bSBkcmF3X2dseXBo c19mYWNlCiAKIHN0cnVjdCBnbHlwaF9zdHJpbmcKIHsKKworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIGJvb2xfYmYgbGVmdF9vdmVyd3Jp dHRlbl9wIDogMTsKKworICAgIGJvb2xfYmYgcmlnaHRfb3ZlcndyaXR0ZW5fcCA6IDE7CisKKyAg ICBib29sX2JmIHJlY3RhbmdsZV9udWtlZF9wIDogMTsKKworICAgIGJvb2xfYmYgYmFja2dyb3Vu ZF9udWtlZF9wIDogMTsKKworICAgIGVudW0gZHJhd19nbHlwaF9hY3Rpb24KKyAgICB7CisgICAg ICBNQ19EUkFXX0dMWVBILAorICAgICAgTUNfRVJBU0VfR0xZUEgKKyAgICB9IGFjdGlvbl90eXBl OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFgtb3JpZ2luIG9mIHRoZSBz dHJpbmcuICAqLwogICBpbnQgeDsKIApAQCAtMjIxNiw2ICsyMjgyLDE2IEBAIHN0cnVjdCBjb21w b3NpdGlvbl9pdAogCiBzdHJ1Y3QgaXQKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBib29sX2JmIHp2X3AgOiAxOworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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yIGN1cnNvcl90eXBlLCBpbnQgd2QsIGJvb2wgYWN0aXZlX3As IGJvb2wgY3Vyc29yX2djX3ApOworCisgIHZvaWQgKCptY19zY3JpYmVfY3Vyc29yKSAoc3RydWN0 IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAgICAgICBzdHJ1Y3Qg Z2x5cGhfcm93ICpnbHlwaF9yb3csIGludCB4LCBpbnQgZngsIGludCB5LCBpbnQgZnksIGludCBo cG9zLAorICAgICAgICBpbnQgdnBvcywgaW50IHdkLCBpbnQgaCwgc3RydWN0IG1jX1JHQiBsc2ws IGVudW0gdHlwZV9vZl9jdXJzb3IgY3Vyc29yX3R5cGUsCisgICAgICAgIGludCBjdXJzb3Jfd2lk dGgsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwgYm9vbCBvbl9wLCBib29sIGFjdGl2ZV9w KTsKKworICB2b2lkICgqbWNfc2NyaWJlX3N0cmluZykgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMs IHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAg ICAgICBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLAorICAg ICAgICBlbnVtIHR5cGVfb2ZfY3Vyc29yIGN1cnNvcl90eXBlLCBpbnQgd2QsIGJvb2wgYWN0aXZl X3AsIGJvb2wgY3Vyc29yX2djX3ApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAg IC8qIEhhbmRsZXJzIGZvciBzZXR0aW5nIGZyYW1lIHBhcmFtZXRlcnMuICAqLwogICBmcmFtZV9w YXJtX2hhbmRsZXIgKmZyYW1lX3Bhcm1faGFuZGxlcnM7CiAKQEAgLTMyNzAsNiArMzM3MSw2NyBA QCBleHRlcm4gdm9pZCBnZXRfZm9udF9hc2NlbnRfZGVzY2VudCAoc3RydWN0IGZvbnQgKiwgaW50 ICosIGludCAqKTsKIAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCitleHRlcm4gTGlz cF9PYmplY3QgbWNfbGlzdG4gKHB0cmRpZmZfdCwgTGlzcF9PYmplY3QsIC4uLik7CisKK2V4dGVy biBMaXNwX09iamVjdCBtY19udGggKGludCwgTGlzcF9PYmplY3QpOworCitleHRlcm4gTGlzcF9P YmplY3QgbWNfYXNzcSAoTGlzcF9PYmplY3QsIExpc3BfT2JqZWN0KTsKKworZXh0ZXJuIHZvaWQg bWNfeHdfY29sb3JfdmFsdWVzIChzdHJ1Y3Qgd2luZG93ICosIExpc3BfT2JqZWN0LCBzdHJ1Y3Qg bWNfUkdCICopOworCitleHRlcm4gYm9vbCBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHN0cnVj dCB3aW5kb3cgKiwgYm9vbCk7CisKK2V4dGVybiBjaGFyICogbWNfd2luZG93IChzdHJ1Y3Qgd2lu ZG93ICopOworCitleHRlcm4gY2hhciAqIG1jX2NoYXJfdG9fc3RyaW5nIChpbnQpOworCitleHRl cm4gY2hhciAqIG1jX2N1cnNvcl90eXBlX3RvX3N0cmluZyAoZW51bSB0eXBlX29mX2N1cnNvcik7 CisKK2V4dGVybiBjaGFyICogbWNfZmxhdm9yX3RvX3N0cmluZyAoZW51bSBtY19mbGF2b3IpOwor CitleHRlcm4gdm9pZCBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHN0cnVjdCB3aW5kb3cgKiwgc3Ry dWN0IGdseXBoX3JvdyAqLCBpbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGVudW0gdHlwZV9vZl9jdXJzb3IpOworCitleHRlcm4gaW50IG1jX2dldF9mcmluZ2VfYml0bWFw IChzdHJ1Y3Qgd2luZG93ICosIExpc3BfT2JqZWN0LCBpbnQsIGludCk7CisKK2V4dGVybiB2b2lk IG1jX2VuZ2luZSAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVj dCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICosIGlu dCwgaW50LCBpbnQsIGludCwgaW50LCBpbnQsCisgICAgICAgICAgICAgICAgICAgICAgIGVudW0g dHlwZV9vZl9jdXJzb3IsIGludCwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBpbnQsCisgICAgICAg ICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IsIGJvb2wsIGVudW0gdHlwZV9vZl9hY3Rpb24s IGJvb2wsCisgICAgICAgICAgICAgICAgICAgICAgIGVudW0gdHlwZV9vZl9jYWNoZSk7CisKK2V4 dGVybiB2b2lkIG1jX3NldF9lc3NlbnRpYWxzIChzdHJ1Y3Qgd2luZG93ICosIGJvb2wsIHN0cnVj dCBtY19SR0IgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdC ICosIGludCAqKTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19yb3cgKHN0cnVjdCB3aW5kb3cgKiwg c3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAg ICAgICAgICAgICAgc3RydWN0IGdseXBoICosIGludCwgaW50LCBpbnQsIGludCwgYm9vbCwgc3Ry dWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgIGludCwgc3RydWN0 IG1jX1JHQiwgc3RydWN0IG1jX1JHQiwgYm9vbCk7CisKK2V4dGVybiB2b2lkIG1jX3JlZHJhd19y b3cgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhf cm93ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGludCwgaW50LCBib29sLCBl bnVtIGRyYXdfZ2x5cGhzX2ZhY2UpOworCitleHRlcm4gdm9pZCBtY19yZXNldF9jYWNoZSAoc3Ry dWN0IHdpbmRvdyAqLCBlbnVtIHR5cGVfb2ZfY2FjaGUpOworCitleHRlcm4gdm9pZCBtY19wcmVf c2Nyb2xsX2NsZWFuIChzdHJ1Y3Qgd2luZG93ICopOworCitleHRlcm4gdm9pZCBtY19kcmF3X2N1 cnNvcl9nbHlwaCAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqLCBlbnVtIGRy YXdfZ2x5cGhzX2ZhY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBp bnQsIGludCwgc3RydWN0IG1jX1JHQiwgZW51bSBtY19mbGF2b3IsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZW51bSB0eXBlX29mX2N1cnNvciwgaW50LCBib29sLCBib29sKTsK KworZXh0ZXJuIHZvaWQgbWNfeF93cml0ZV9nbHlwaHMgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0 IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgc3RydWN0IGdseXBoICosIGVudW0gZ2x5cGhfcm93X2FyZWEsIGludCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGludCwgc3RydWN0IG1jX1JHQiwgZW51 bSBtY19mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSB0eXBlX29m X2N1cnNvciwgaW50LCBib29sLCBib29sKTsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8K Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICNpZmRlZiBHTFlQSF9ERUJVRwogZXh0ZXJu IHZvaWQgZHVtcF9nbHlwaF9zdHJpbmcgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKikgRVhURVJOQUxM WV9WSVNJQkxFOwogI2VuZGlmCmRpZmYgLS1naXQgYS9zcmMvZGlzcG5ldy5jIGIvc3JjL2Rpc3Bu ZXcuYwppbmRleCBjY2IwOGVjLi42MGYzMTZkIDEwMDY0NAotLS0gYS9zcmMvZGlzcG5ldy5jCisr KyBiL3NyYy9kaXNwbmV3LmMKQEAgLTU2LDYgKzU2LDQ2OCBAQCBhbG9uZyB3aXRoIEdOVSBFbWFj cy4gIElmIG5vdCwgc2VlIDxodHRwczovL3d3dy5nbnUub3JnL2xpY2Vuc2VzLz4uICAqLwogI2lu Y2x1ZGUgInczMi5oIgogI2VuZGlmCiAMCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK3N0cnVjdCBtY19SR0IgY2hfZm9yZWdyb3Vu ZCA9IHsucmVkID0gLTEuMCwgLmdyZWVuID0gLTEuMCwgLmJsdWUgPSAtMS4wfTsKKworc3RydWN0 IG1jX1JHQiBmY19mb3JlZ3JvdW5kID0gey5yZWQgPSAtMS4wLCAuZ3JlZW4gPSAtMS4wLCAuYmx1 ZSA9IC0xLjB9OworCitpbnQgZmNfeCA9IDA7CisKK3N0cnVjdCBnbHlwaF9tYXRyaXggKmN1cnNv cl9tYXRyaXg7CisKK3N0cnVjdCBnbHlwaHNfc2tpcHBlZAoreworICBwdHJka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FWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICYmICFNQVRSSVhfUk9XX0VY VEVORFNfRkFDRV9QIChjdXJyZW50X3JvdykpKSkKKyAgICAgICAgLS1kZXNpcmVkX3N0b3BfcG9z OworCisgICAgICBzdG9wID0gbWluIChjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdLCBkZXNp cmVkX3N0b3BfcG9zKTsKKyAgICAgIGkgPSAwOworICAgICAgeCA9IGRlc2lyZWRfcm93LT54Owor ICAgICAgaW50IGNsZWFyX3RvX3ggPSAwOworCisgICAgICAvKiBMb29wIG92ZXIgZ2x5cGhzIHRo YXQgY3VycmVudCBhbmQgZGVzaXJlZCByb3cgbWF5IGhhdmUgaW4gY29tbW9uLiAqLworICAgICAg d2hpbGUgKGkgPCBzdG9wKQorICB7CisKKyAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC51c2VkID0g MDsKKworICAgIGJvb2wgY2FuX3NraXBfcCA9ICFhYm9ydF9za2lwcGluZzsKKworICAgIC8qIFNr aXAgb3ZlciBnbHlwaHMgdGhhdCBib3RoIHJvd3MgaGF2ZSBpbiBjb21tb24uICBUaGVzZQorICAg ICAgIGRvbid0IGhhdmUgdG8gYmUgd3JpdHRlbi4gIFdlIGNhbid0IHNraXAgaWYgdGhlIGxhc3QK KyAgICAgICBjdXJyZW50IGdseXBoIG92ZXJsYXBzIHRoZSBnbHlwaCB0byBpdHMgcmlnaHQuICBG b3IKKyAgICAgICBleGFtcGxlLCBjb25zaWRlciBhIGN1cnJlbnQgcm93IG9mIGBpZiAnIHdpdGgg dGhlIGBmJyBpbgorICAgICAgIENvdXJpZXIgYm9sZCBzbyB0aGF0IGl0IG92ZXJsYXBzIHRoZSBg ICcgdG8gaXRzIHJpZ2h0LgorICAgICAgIElmIHRoZSBkZXNpcmVkIHJvdyBpcyBgICcsIHdlIHdv dWxkIHNraXAgb3ZlciB0aGUgc3BhY2UKKyAgICAgICBhZnRlciB0aGUgYGlmJyBhbmQgdGhlcmUg d291bGQgcmVtYWluIGEgcGl4ZWwgZnJvbSB0aGUKKyAgICAgICBgZicgb24gdGhlIHNjcmVlbi4g Ki8KKyAgICBpZiAob3ZlcmxhcHBpbmdfZ2x5cGhzX3AgJiYgaSA+IDApCisgICAgICB7CisgICAg ICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSAmY3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FSRUFd W2kgLSAxXTsKKyAgICAgICAgaW50IGxlZnQsIHJpZ2h0OworICAgICAgICByaWYtPmdldF9nbHlw aF9vdmVyaGFuZ3MgKGdseXBoLCBYRlJBTUUgKHctPmZyYW1lKSwgJmxlZnQsICZyaWdodCk7Cisg ICAgICAgIGNhbl9za2lwX3AgPSAocmlnaHQgPT0gMCAmJiAhYWJvcnRfc2tpcHBpbmcpOworICAg ICAgfQorCisgICAgaWYgKGNhbl9za2lwX3ApCisgICAgICB7CisgICAgICAgIGludCBzdGFydF9o cG9zID0gaTsKKworICAgICAgICB3aGlsZSAoaSA8IHN0b3AKKyAgICAgICAgICAgICAgICYmIEdM WVBIX0VRVUFMX1AgKGRlc2lyZWRfZ2x5cGgsIGN1cnJlbnRfZ2x5cGgpKQorICAgICAgICAgIHsK KyAgICAgICAgICAgICsrYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZDsKKyAgICAgICAgICAgIGlm IChhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQgPCBhcnJheV9nbHlwaHNfc2tpcHBlZC51 c2VkKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaW50IG9sZF9hbGxvYyA9IGFy cmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZDsKKyAgICAgICAgICAgICAgICBpbnQgbmV3X2Vs dHMgPSBhcnJheV9nbHlwaHNfc2tpcHBlZC51c2VkIC0gYXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxs b2NhdGVkOworICAgICAgICAgICAgICAgIGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWQgPQor ICAgICAgICAgICAgICAgICAgeHBhbGxvYyAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICZhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0 ZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfZWx0cywKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgIElOVF9NQVgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2Yg KmFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWQpOworICAgICAgICAgICAgICAgIG1lbXNldCAo YXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCArIG9sZF9hbGxvYywgMCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkIC0gb2xkX2FsbG9j KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBzaXplb2YgKmFycmF5X2dseXBoc19za2lw cGVkLnNraXBwZWQpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpbnQgbnRoID0gYXJy YXlfZ2x5cGhzX3NraXBwZWQudXNlZCAtIDE7CisgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tp cHBlZC5za2lwcGVkW250aF0ueCA9IHg7CisgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBl ZC5za2lwcGVkW250aF0uaHBvcyA9IGk7CisgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBl ZC5za2lwcGVkW250aF0uZW5hYmxlZF9wID0gdHJ1ZTsKKyAgICAgICAgICAgIHggKz0gZGVzaXJl ZF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICArK2Rlc2lyZWRfZ2x5cGgsICsrY3Vy cmVudF9nbHlwaCwgKytpOworICAgICAgICAgIH0KKworICAgICAgICAvKiBDb25zaWRlciB0aGUg Y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AgICAgICB7CisgICAgICAgICAgICAg ICAgLS1pLCAtLWRlc2lyZWRfZ2x5cGgsIC0tY3VycmVudF9nbHlwaDsKKyAgICAgICAgICAgICAg ICB4IC09IGRlc2lyZWRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICAgIGxlZnQg LT0gZGVzaXJlZF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgIC8qIEFib3J0IHRoZSBza2lwcGluZyBhbGdvcml0aG0gaWYgd2UgZW5kIHVwIGJlZm9yZQor ICAgICAgICAgICAgICAgb3VyIHN0YXJ0aW5nIHBvaW50LCB0byBhdm9pZCBsb29waW5nIChidWcj MTA3MCkuCisgICAgICAgICAgICAgICBUaGlzIGNhbiBoYXBwZW4gd2hlbiB0aGUgbGJlYXJpbmcg aXMgbGFyZ2VyIHRoYW4KKyAgICAgICAgICAgICAgIHRoZSBwaXhlbCB3aWR0aC4gKi8KKyAgICAg ICAgICAgIGFib3J0X3NraXBwaW5nID0gKGkgPCBzdGFydF9ocG9zKTsKKyAgICAgICAgICB9Cisg ICAgICB9CisKKyAgICAvKiBUcnkgdG8gYXZvaWQgd3JpdGluZyB0aGUgZW50aXJlIHJlc3Qgb2Yg dGhlIGRlc2lyZWQgcm93CisgICAgICAgYnkgbG9va2luZyBmb3IgYSByZXN5bmMgcG9pbnQuICBU aGlzIG1haW5seSBwcmV2ZW50cworICAgICAgIG1vZGUgbGluZSBmbGlja2VyaW5nIGluIHRoZSBj YXNlIHRoZSBtb2RlIGxpbmUgaXMgaW4KKyAgICAgICBmaXhlZC1waXRjaCBmb250LCB3aGljaCBp dCB1c3VhbGx5IHdpbGwgYmUuICovCisgICAgaWYgKGkgPCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhU X0FSRUFdKQorICAgICAgeworICAgICAgICBpbnQgc3RhcnRfeCA9IHgsIHN0YXJ0X2hwb3MgPSBp OworICAgICAgICBzdHJ1Y3QgZ2x5cGggKnN0YXJ0ID0gZGVzaXJlZF9nbHlwaDsKKyAgICAgICAg aW50IGN1cnJlbnRfeCA9IHg7CisgICAgICAgIGJvb2wgc2tpcF9maXJzdF9wID0gIWNhbl9za2lw X3A7CisgICAgICAgIC8qIEZpbmQgdGhlIG5leHQgZ2x5cGggdGhhdCdzIGVxdWFsIGFnYWluLiAq LworICAgICAgICB3aGlsZSAoaSA8IHN0b3AKKyAgICAgICAgICAgICAgICYmIChza2lwX2ZpcnN0 X3AKKyAgICAgICAgICAgICAgICAgICB8fCAhR0xZUEhfRVFVQUxfUCAoZGVzaXJlZF9nbHlwaCwg Y3VycmVudF9nbHlwaCkpCisgICAgICAgICAgICAgICAmJiB4ID09IGN1cnJlbnRfeCkKKyAgICAg ICAgICB7CisgICAgICAgICAgICB4ICs9IGRlc2lyZWRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAg ICAgICAgICAgY3VycmVudF94ICs9IGN1cnJlbnRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAg ICAgICAgKytkZXNpcmVkX2dseXBoLCArK2N1cnJlbnRfZ2x5cGgsICsraTsKKyAgICAgICAgICAg IHNraXBfZmlyc3RfcCA9IDA7CisgICAgICAgICAgfQorCisgIGZvciAoaW50IGVsdCA9IDA7Cisg ICAgICAgZWx0IDwgYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZAorICAgICAgICYmIHZwb3MgIT0g Ym90dG9tX3Zwb3M7CisgICAgICAgKytlbHQpCisgICAgeworICAgICAgaW50IHggPSBhcnJheV9n bHlwaHNfc2tpcHBlZC5za2lwcGVkW2VsdF0ueDsKKyAgICAgIGludCBocG9zID0gYXJyYXlfZ2x5 cGhzX3NraXBwZWQuc2tpcHBlZFtlbHRdLmhwb3M7CisgICAgICBzdHJ1Y3QgZ2x5cGggKnRhcmdl dF9nbHlwaCA9CisgICAgICAgIG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGRlc2lyZWRfbWF0cml4 LCB1cGRhdGVkX3JvdywgaHBvcywgdnBvcyk7CisgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAg ZnByaW50ZiAoc3RkZXJyLCAiU0tJUFBFRDogIGNoYXIgKCVkLyVzKSB8IHg6ICglZCkgfCBocG9z ICglZCkgfCB2cG9zICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0X2ds eXBoLT51LmNoLCBtY19jaGFyX3RvX3N0cmluZyAodGFyZ2V0X2dseXBoLT51LmNoKSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICB4LCBocG9zLCB2cG9zKTsKKyAgICAgIG1jX2RyYXdfcm93ICh3 LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHRhcmdldF9nbHlwaCwgeCwgMSwgdnBvcywK KyAgICAgICAgICAgICAgICAgICBib3R0b21fdnBvcywgYWN0aXZlX3AsIGN1cnNvcl9tYXRyaXgs IGZjX3gsIGNoX2ZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgZmNfZm9yZWdyb3VuZCwg dHJ1ZSk7CisgICAgfQorCisgICAgICAgIGlmIChpID09IHN0YXJ0X2hwb3MgfHwgeCAhPSBjdXJy ZW50X3gpCisgICAgICAgICAgeworICAgICAgICAgICAgaSA9IHN0YXJ0X2hwb3M7CisgICAgICAg ICAgICB4ID0gc3RhcnRfeDsKKyAgICAgICAgICAgIGRlc2lyZWRfZ2x5cGggPSBzdGFydDsKKyAg ICAgICAgICAgIGJyZWFrOworICAgICAgICAgIH0KKworICAgICAgICBvdXRwdXRfY3Vyc29yX3Rv ICh3LCB2cG9zLCBzdGFydF9ocG9zLCBkZXNpcmVkX3Jvdy0+eSwgc3RhcnRfeCk7CisKKyAgLyog UmUtZHJhdyBhIHBvcnRpb24gb2YgdGhlIHJvdy4gKi8KKworICBpZiAoZGVidWdfcAorICAgICAg JiYgdnBvcyAhPSBib3R0b21fdnBvcykKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJS RURSQV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F0ZWRfcm93LCBzdGFydCwgeCwKKyAg ICAgICAgICAgICAgICAgICAgIHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSBocG9zLCB2 cG9zLCBib3R0b21fdnBvcywKKyAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBjdXJzb3Jf bWF0cml4LCBmY194LCBjaF9mb3JlZ3JvdW5kLCBmY19mb3JlZ3JvdW5kLAorICAgICAgICAgICAg ICAgICAgICAgdHJ1ZSk7CisgICAgICB9CisgICAgICAvKiBUaGVyZSB3ZXJlIG5vIGNoYW5nZXMg YW5kIGkgPT0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAqLworICAgICAgZWxzZSBpZiAo IWNoYW5nZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICAg ICAgZnByaW50ZiAoc3RkZXJyLCAiVU5DSEFOR0VEIC0tIFdSSVRFIEVOVElSRSBMSU5FLlxuIik7 CisgICAgICAgICAgbWNfZHJhd19yb3cgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3Jvdywg ZGVzaXJlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAgICAgICAgICAgICAgICBk ZXNpcmVkX3Jvdy0+eCwgZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAg ICAgICAgICAgICAgICAgICAgYm90dG9tX3Zwb3MsIGFjdGl2ZV9wLCBjdXJzb3JfbWF0cml4LCBm Y194LCBjaF9mb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICBmY19mb3JlZ3JvdW5k LCB0cnVlKTsKKyAgICAgICAgfQorCisgICAgICAvKiBNYXliZSBjbGVhciB0byBlbmQgb2YgbGlu ZS4gKi8KKyAgICAgIGlmIChNQVRSSVhfUk9XX0VYVEVORFNfRkFDRV9QIChkZXNpcmVkX3Jvdykp CisgICAgICAgIHsKKy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PCAwKQorICAgICAgICAgICAgICAgICAgOiAody0+cGh5c19j dXJzb3IuaHBvcyA+PSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKSkpCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIHctPnBoeXNfY3Vyc29yX29uX3AgPSAwOworICAgICAgICAgICAg ICB4bGltID0gLTE7CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAg eGxpbSA9IGN1cnJlbnRfcm93LT5waXhlbF93aWR0aDsKKyAgICAgICAgICByaWYtPmNsZWFyX2Vu ZF9vZl9saW5lICh3LCB1cGRhdGVkX3JvdywgVEVYVF9BUkVBLCB4bGltKTsKKyAgICAgICAgICBj bGVhcl90b194ID0geGxpbTsKKyAgICAgICAgICBjaGFuZ2VkX3AgPSAxOworICAgICAgICB9CisK KyAgaWYgKGNoYW5nZWRfcAorICAgICAgJiYgY2xlYXJfdG9feCAhPSAwKQorICAgIHsKKyAgICAg IGludCB0ZXh0X2FyZWFfd2lkdGggPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOwor ICAgICAgc3RydWN0IG1jX1JHQiBkZWJ1Z19mZyA9IHsucmVkID0gMC44NjcsIC5ncmVlbiA9IDAu ODY3LCAuYmx1ZSA9IDAuODY3fTsKKyAgICAgIHN0cnVjdCBnbHlwaCAqdGFyZ2V0X2dseXBoID0g dXBkYXRlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdICsgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9B UkVBXSAtIDE7CisgICAgICAvKiBgbWNfZW5naW5lJyBvbmx5IGRyYXdzIGFuIE1DX0dMWVBIIHdo ZW4geCA8IHVwZGF0ZWRfcm93LT5waXhlbF93aWR0aC4KKyAgICAgIFRoZSBjdXJyZW50IGRlc2ln biBpbmhpYml0cyBkcmF3aW5nIG92ZXIgYW4gZXhpc3RpbmcgZ2x5cGggYXQgdGhlIGVuZCBvZiBh CisgICAgICB3b3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LCBmY194LAorICAgICAgICAgICAgICAgICAgIGRlYnVnX3AgPyBk ZWJ1Z19mZyA6IGNoX2ZvcmVncm91bmQsIGFjdGl2ZV9wLCBWRVJUSUNBTF9SVUxFUiwKKyAgICAg ICAgICAgICAgICAgICB0cnVlLCBOT19DQUNIRSk7CisKKyAgICAgIGlmIChCVUZGRVJQICh3LT5j b250ZW50cykKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBmY192aXNpYmxlKSkKKyAgICAgICAgICAmJiB4IDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAg ICAgJiYgZmNfeCA+PSB4CisgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9IE5VTEwpCisgICAg ICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5 cGgsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwKKyAgICAgICAgICAgICAgICAgICB1cGRhdGVkX3Jv dy0+eSwgaHBvcywgdnBvcywgTUNfQkFSLCAxLCBjdXJzb3JfbWF0cml4LCBmY194LAorICAgICAg ICAgICAgICAgICAgIGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGZjX2ZvcmVncm91bmQsIGFjdGl2ZV9w LCBGSUxMX0NPTFVNTiwKKyAgICAgICAgICAgICAgICAgICB0cnVlLCBOT19DQUNIRSk7CisKKyAg ICB9CisgICAgfQorICByZXR1cm4gY2hhbmdlZF9wOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VS U09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogU3RydWN0dXJlIHRvIHBh c3MgZGltZW5zaW9ucyBhcm91bmQuICBVc2VkIGZvciBjaGFyYWN0ZXIgYm91bmRpbmcKICAgIGJv eGVzLCBnbHlwaCBtYXRyaXggZGltZW5zaW9ucyBhbmQgYWxpa2UuICAqLwogCkBAIC0zMjgyLDEw ICszNzQ0LDM2IEBAIHJlZHJhd19vdmVybGFwcGVkX3Jvd3MgKHN0cnVjdCB3aW5kb3cgKncsIGlu dCB5YikKIAkgICAgewogCSAgICAgIG91dHB1dF9jdXJzb3JfdG8gKHcsIGksIDAsIHJvdy0+eSwK IAkJCQlhcmVhID09IFRFWFRfQVJFQSA/IHJvdy0+eCA6IDApOwotCSAgICAgIGlmIChyb3ctPnVz ZWRbYXJlYV0pCisKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworICBpZiAoKHctPm1jX2VsdHMudXNlZCA+IDAgfHwgdy0+Y2hfZWx0cy51c2Vk ID4gMCB8fCB3LT5mY19lbHRzLnVzZWQgPiAwKQorICAgICAgJiYgYXJlYSA9PSBURVhUX0FSRUEK KyAgICAgICYmIHJvdy0+dXNlZFthcmVhXSkKKyAgICB7CisgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0 cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgIGludCBzdGFydF94ID0gcm93 LT54OworICAgICAgaW50IHN0YXJ0X2hwb3MgPSAwOworICAgICAgaW50IGVuZF9ocG9zID0gcm93 LT51c2VkW2FyZWFdOworICAgICAgYm9vbCBjbGVhcl9lb2xfcCA9IHRydWU7CisgICAgICBlbnVt IGRyYXdfZ2x5cGhzX2ZhY2UgaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgVFJBQ0UgKChz dGRlcnIsICJyZWRyYXdfb3ZlcmxhcHBlZF9yb3dzICglZCk6ICBzdGFydF94ICglZCkgfCBzdGFy dF9ocG9zICglZCkgfCBlbmRfaHBvcyAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgIGks IHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zKSk7CisgICAgICBtY19yZWRyYXdfcm93ICh3 LCBtYXRyaXgsIHJvdywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGNsZWFyX2VvbF9w LCBobCk7CisgICAgfQorICAgIGVsc2UgaWYgKHJvdy0+dXNlZFthcmVhXSkKKyAgICAgIHsKIAkJ RlJBTUVfUklGIChmKS0+d3JpdGVfZ2x5cGhzICh3LCByb3csIHJvdy0+Z2x5cGhzW2FyZWFdLAog ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJlYSwgcm93LT51 c2VkW2FyZWFdKTsKIAkgICAgICBGUkFNRV9SSUYgKGYpLT5jbGVhcl9lbmRfb2ZfbGluZSAodywg cm93LCBhcmVhLCAtMSk7CisgICAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IAkgICAgfQogCiAJICByb3ctPm92ZXJsYXBwZWRfcCA9IDA7CkBAIC0zMzg4LDYgKzM4NzYsMjgg QEAgc3RhdGljIGJvb2wKIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9y Y2VfcCkKIHsKICAgc3RydWN0IGdseXBoX21hdHJpeCAqZGVzaXJlZF9tYXRyaXggPSB3LT5kZXNp cmVkX21hdHJpeDsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJ UExFLUNVUlNPUlMgKi8KKworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAo c3RkZXJyLCAidXBkYXRlX3dpbmRvdyAoJXMpXG4iLCBtY193aW5kb3cgKHcpKTsKKworICBjdXJz b3JfbWF0cml4ID0gTlVMTDsKKworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1l KTsKKyAgYm9vbCBhY3RpdmVfcCA9ICh3ID09IFhXSU5ET1cgKGYtPnNlbGVjdGVkX3dpbmRvdykK KyAgICAgICAgICAgICAgICAgICAmJiBmID09IEZSQU1FX0RJU1BMQVlfSU5GTyAoZiktPnhfaGln aGxpZ2h0X2ZyYW1lKTsKKworICBtY19zZXRfZXNzZW50aWFscyAodywgYWN0aXZlX3AsICZjaF9m b3JlZ3JvdW5kLCAmZmNfZm9yZWdyb3VuZCwgJmZjX3gpOworCisgIG1jX3ByZV9zY3JvbGxfY2xl YW4gKHcpOworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICBib29sIHBhdXNlZF9wOwogICBpbnQgcHJlZW1wdF9jb3VudCA9IGNsaXBf dG9fYm91bmRzICgxLCBiYXVkX3JhdGUgLyAyNDAwICsgMSwgSU5UX01BWCk7CiAgIHN0cnVjdCBy ZWRpc3BsYXlfaW50ZXJmYWNlICpyaWYgPSBGUkFNRV9SSUYgKFhGUkFNRSAoV0lORE9XX0ZSQU1F ICh3KSkpOwpAQCAtMzQ2MCw2ICszOTcwLDQxIEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5k b3cgKncsIGJvb2wgZm9yY2VfcCkKIAkgICAgfQogCX0KIAorCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAvKiBQcm9jZXNzIHRoZSBjdXJzb3Ig cm93IGF0IHRoZSBvdXRzZXQgaWYgaXQgaXMgd2l0aGluIGBkZXNpcmVkX21hdHJpeGAuCisgIFdo ZW4gcHJvY2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2NvdW50ID09IDApCisgICAgICAgICAgICBkZXRlY3Rf aW5wdXRfcGVuZGluZ19pZ25vcmVfc3F1ZWV6YWJsZXMgKCk7CisgICAgICAgICAgY2hhbmdlZF9w IHw9IHVwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5f cCk7CisgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKHJvdykgPj0geWIpCisgICAg ICAgICAgICBmb3IgKGludCBpID0gdnBvcyArIDE7IGkgPCB3LT5jdXJyZW50X21hdHJpeC0+bnJv d3MgLSAxOyArK2kpCisgICAgICAgICAgICAgIFNFVF9NQVRSSVhfUk9XX0VOQUJMRURfUCAody0+ Y3VycmVudF9tYXRyaXgsIGksIGZhbHNlKTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQor ICAgIH0KKworICBjdXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICAgIC8qIFVwZGF0ZSB0aGUgcmVzdCBvZiB0aGUgbGlu ZXMuICAqLwogICAgICAgZm9yICg7IHJvdyA8IGVuZCAmJiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVu ZGluZyk7ICsrcm93KQogCS8qIHNjcm9sbGluZ193aW5kb3cgcmVzZXRzIHRoZSBlbmFibGVkX3Ag ZmxhZyBvZiB0aGUgcm93cyBpdApAQCAtMzQ2Nyw2ICs0MDEyLDE5IEBAIHVwZGF0ZV93aW5kb3cg KHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIAlpZiAocm93LT5lbmFibGVkX3ApCiAJ ICB7CiAJICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIGRlc2lyZWRfbWF0cml4 KTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworICAvKiBJZiB0aGUgYGN1cnNvcl9yb3dgIGlzIHdpdGhpbiB0aGUgYGRlc2lyZWRfbWF0cml4 YCwgdGhlbiBpdCB3YXMgcHJvY2VlZAorICBoZXJlaW5hYm92ZSBhbmQgc2hvdWxkIGJlIHNraXBw ZWQgYXQgdGhpcyB0aW1lLiAqLworICBpZiAodnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICBj b250aW51ZTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICBpbnQgaTsKIAog CSAgICAvKiBXZSdsbCBoYXZlIHRvIHBsYXkgYSBsaXR0bGUgYml0IHdpdGggd2hlbiB0bwpAQCAt MzQ5Nyw2ICs0MDU1LDQzIEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wg Zm9yY2VfcCkKIAogICAgIHNldF9jdXJzb3I6CiAKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogSWYgd2UganVtcGVkIGhlcmUgZnJvbSBg c2V0X2N1cnNvcmAsIHRoZW4gc2V0IHRoZSBgY3Vyc29yX21hdHJpeGAuICovCisgIGlmIChjdXJz b3JfbWF0cml4ID09IE5VTEwpCisgICAgY3Vyc29yX21hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4 OworCisgIC8qIFJlc2V0IGByb3dgIHRvIDAgc28gdGhhdCBmYWtlIGN1cnNvcnMgY2FuIGJlIGRy YXduIG9uIHJvd3MgcHJlY2VkaW5nIHRoZQor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UyAoYm90dG9tX3Jvdywgdy0+Y3VycmVudF9tYXRyaXgpOworICAgICBzdHJ1Y3QgZ2x5cGhfcm93 ICpjdXJyZW50X3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAg ICAgaWYgKGN1cnJlbnRfcm93LT5lbmFibGVkX3ApCisgICAgICAgbWNfZHJhd19yb3cgKHcsIHct PmN1cnJlbnRfbWF0cml4LCBjdXJyZW50X3JvdywgY3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FS RUFdLAorICAgICAgICAgICAgICAgICAgICBjdXJyZW50X3Jvdy0+eCwgY3VycmVudF9yb3ctPnVz ZWRbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgYm90dG9tX3Zwb3MsIGFj dGl2ZV9wLCBjdXJzb3JfbWF0cml4LCBmY194LCBjaF9mb3JlZ3JvdW5kLAorICAgICAgICAgICAg ICAgICAgICBmY19mb3JlZ3JvdW5kLCB0cnVlKTsKKyAgIH0KKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICAgICAgLyogVXBkYXRlIHRoZSBoZWFkZXIgbGluZSBhZnRlciBzY3JvbGxp bmcgYmVjYXVzZSBhIG5ldyBoZWFkZXIKIAkgbGluZSB3b3VsZCBvdGhlcndpc2Ugb3ZlcndyaXRl IGxpbmVzIGF0IHRoZSB0b3Agb2YgdGhlIHdpbmRvdwogCSB0aGF0IGNhbiBiZSBzY3JvbGxlZC4g ICovCkBAIC0zNTMxLDEwICs0MTI2LDIxIEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cg KncsIGJvb2wgZm9yY2VfcCkKICAgICAgIHN0cmNweSAody0+Y3VycmVudF9tYXRyaXgtPm1ldGhv ZCwgdy0+ZGVzaXJlZF9tYXRyaXgtPm1ldGhvZCk7CiAjZW5kaWYKIAorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogI2lmZGVmIEhBVkVfV0lORE9X X1NZU1RFTQorICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAmJiAhTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgbWNfdXBkYXRlX3dp bmRvd19mcmluZ2VzICh3LCAwKTsKKyAgICBlbHNlCiAgICAgICB1cGRhdGVfd2luZG93X2ZyaW5n ZXMgKHcsIDApOwogI2VuZGlmCiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAg IC8qIEVuZCB0aGUgdXBkYXRlIG9mIHdpbmRvdyBXLiAgRG9uJ3Qgc2V0IHRoZSBjdXJzb3IgaWYg d2UKICAgICAgICAgIHBhdXNlZCB1cGRhdGluZyB0aGUgZGlzcGxheSBiZWNhdXNlIGluIHRoaXMg Y2FzZSwKICAgICAgICAgIHNldF93aW5kb3dfY3Vyc29yX2FmdGVyX3VwZGF0ZSBoYXNuJ3QgYmVl biBjYWxsZWQsIGFuZApAQCAtMzg1MiwxNCArNDQ1OCwyOCBAQCB1cGRhdGVfd2luZG93X2xpbmUg KHN0cnVjdCB3aW5kb3cgKncsIGludCB2cG9zLCBib29sICptb3VzZV9mYWNlX292ZXJ3cml0dGVu X3ApCiAJICBjdXJyZW50X3Jvdy0+cmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AgPSAxOwogCX0KIAor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBi b29sIHVwZGF0ZWRfcCA9IChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAg ICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAg ICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICB8fCAhIE5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKSkKKyAgICAgICAgICAgICAgICAg ICA/IG1jX3VwZGF0ZV90ZXh0X2FyZWEgKHcsIGRlc2lyZWRfcm93LCB2cG9zKQorICAgICAgICAg ICAgICAgICAgIDogdXBkYXRlX3RleHRfYXJlYSAodywgZGVzaXJlZF9yb3csIHZwb3MpOworCiAg ICAgICAvKiBVcGRhdGUgdGhlIGRpc3BsYXkgb2YgdGhlIHRleHQgYXJlYS4gICovCi0gICAgICBp ZiAodXBkYXRlX3RleHRfYXJlYSAodywgZGVzaXJlZF9yb3csIHZwb3MpKQorICAgICAgaWYgKHVw ZGF0ZWRfcCkKIAl7CiAJICBjaGFuZ2VkX3AgPSAxOwogCSAgaWYgKGN1cnJlbnRfcm93LT5tb3Vz ZV9mYWNlX3ApCiAJICAgICptb3VzZV9mYWNlX292ZXJ3cml0dGVuX3AgPSAxOwogCX0KIAorLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgLyogVXBkYXRlIGRpc3BsYXkgb2YgdGhl IHJpZ2h0IG1hcmdpbiBhcmVhLCBpZiB0aGVyZSBpcyBvbmUuICAqLwogICAgICAgaWYgKCFkZXNp cmVkX3Jvdy0+ZnVsbF93aWR0aF9wICYmIHctPnJpZ2h0X21hcmdpbl9jb2x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RpY2FsX2Jh 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 ZXNwb25kaW5nIHN5bWJvbHMuICAqLwogCkBAIC00NjcsOCArOTIxLDEwNDQgQEAgc3RhdGljIHN0 cnVjdCBmcmluZ2VfYml0bWFwIHN0YW5kYXJkX2JpdG1hcHNbXSA9CiAgIHsgRlJCSVRTICh2ZXJ0 aWNhbF9iYXJfYml0cyksICAgICAgIDgsIDAsIEFMSUdOX0JJVE1BUF9DRU5URVIsIDAgfSwKICAg eyBGUkJJVFMgKGhvcml6b250YWxfY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PSByaWdodF9wOworICBpbnQgaXgyID0gaXgxICsgKHBhcnRpYWxfcCA/IDIgOiAw KTsKKyAgaWYgKChjbWFwID0gQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmcmluZ2VfaW5k aWNhdG9yX2FsaXN0KSksICFOSUxQIChjbWFwKSkKKyAgICB7CisgICAgICBibTEgPSBtY19hc3Nx IChiaXRtYXAsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibTEpKQorICB7CisgICAgaWYgKChi bTEgPSBYQ0RSIChibTEpKSwgTklMUCAoYm0xKSkKKyAgICAgIHJldHVybiBNQ19OT19GUklOR0Vf QklUTUFQOworICAgIGlmIChDT05TUCAoYm0xKSkKKyAgICAgIHsKKyAgICAgICAgbG4xID0gWEZJ WE5VTSAoRmxlbmd0aCAoYm0xKSk7CisgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgeworICAg ICAgaWYgKGxuMSA+IGl4MikKKyAgICAgICAgeworICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIs IGJtMSk7CisgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgIGdvdG8gZm91bmQ7Cisg ICAgICAgIH0KKyAgICB9CisgICAgICAgIGVsc2UKKyAgICB7CisgICAgICBpZiAobG4xID4gaXgx KQorICAgICAgICB7CisgICAgICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsKKyAgICAgICAg ICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgfQorICAgIH0K KyAgICAgIH0KKyAgICBlbHNlIGlmICgoYm0gPSBibTEsICFFUSAoYm0sIFF0KSkpCisgICAgICBn b3RvIGZvdW5kOworICB9CisgICAgfQorICBpZiAoIUVRIChjbWFwLCBCVkFSICgmYnVmZmVyX2Rl ZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkKKyAgICAgICYmICFOSUxQIChCVkFSICgm YnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkpCisgICAgeworICAgICAg Ym0yID0gbWNfYXNzcSAoYml0bWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5k aWNhdG9yX2FsaXN0KSk7CisgICAgICBpZiAoQ09OU1AgKGJtMikpCisgIHsKKyAgICBpZiAoKGJt MiA9IFhDRFIgKGJtMikpLCAhTklMUCAoYm0yKSkKKyAgICAgIHsKKyAgICAgICAgaWYgKENPTlNQ IChibTIpKQorICAgIHsKKyAgICAgIGxuMiA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMikpOworICAg ICAgaWYgKHBhcnRpYWxfcCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChsbjIgPiBpeDIpCisg ICAgICB7CisgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMik7CisgICAgICAgIGlmICghRVEg KGJtLCBRdCkpCisgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgIH0KKyAgICAgICAgfQorICAg IH0KKyAgICAgIH0KKyAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4MSkKKyAgICB7CisgICAgICBi bSA9IG1jX250aCAoaXgxLCBibTEpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgZ290byBm b3VuZDsKKyAgICB9CisgIGlmIChsbjIgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19udGgg KGl4MSwgYm0yKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgIGdvdG8gZm91bmQ7CisgICAg ICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICB9CisgIGVsc2UgaWYgKChibSA9IGJt MiwgTklMUCAoYm0pKSkKKyAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyBmb3VuZDoK KyAgcmV0dXJuIGxvb2t1cF9mcmluZ2VfYml0bWFwIChibSk7Cit9CisKK3N0YXRpYyBpbnQKK21j X2dldF9sb2dpY2Fs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RlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICBpZiAoQ09OU1AgKGJtMSkp CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGxuMSA9IFhGSVhOVU0gKEZsZW5ndGggKGJt MSkpOworICAgICAgICAgICAgICBpZiAocGFydGlhbF9wKQorICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgIGlmIChsbjEgPiBpeDIpCisgICAgICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgyLCBibTEpOworICAgICAgICAgICAg ICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5k OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKGxuMSA+IGl4 MSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNf bnRoIChpeDEsIGJtMSk7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkK KyAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAoKGJtID0g Ym0xLCAhRVEgKGJtLCBRdCkpKQorICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgfQor ICAgIH0KKyAgaWYgKCFFUSAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2lu ZGljYXRvcl9hbGlzdCkpCisgICAgICAmJiAhTklMUCAoQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywg ZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpKQorICAgIHsKKyAgICAgIGJtMiA9IG1jX2Fzc3EgKGJp dG1hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpOwor ICAgICAgaWYgKENPTlNQIChibTIpKQorICAgICAgICB7CisgICAgICAgICAgaWYgKChibTIgPSBY Q0RSIChibTIpKSwgIU5JTFAgKGJtMikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlm IChDT05TUCAoYm0yKSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBsbjIgPSBYRklYTlVNIChG bGVuZ3RoIChibTIpKTsKKyAgICAgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICBpZiAobG4yID4gaXgyKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBibSA9IG1jX250aCAoaXgyLCBibTIpOworICAgICAgICAgICAgICBpZiAoIUVRIChi bSwgUXQpKQorICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICB9CisgICAg ICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9 CisgIGlmIChsbjEgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsK KyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgIGdvdG8gZm91bmQ7CisgICAgfQorICBpZiAobG4y ID4gaXgxKQorICAgIHsKKyAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMik7CisgICAgICBpZiAo IUVRIChibSwgUXQpKQorICAgICAgICBnb3RvIGZvdW5kOworICAgICAgcmV0dXJuIE1DX05PX0ZS SU5HRV9CSVRNQVA7CisgICAgfQorICAgIGVsc2UgaWYgKChibSA9IGJtMiwgTklMUCAoYm0pKSkK KyAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyBmb3VuZDoKKyAgcmV0dXJuIGxvb2t1 cF9mcmluZ2VfYml0bWFwIChibSk7Cit9Cis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pdCdzIE9L IHRoYXQgdG9wX3Jvd19lbmRzX2F0X3p2X3AKKyAgICAgaXMgbm90IGluaXRpYWxpemVkIGhlcmUu ICBTaW1pbGFybHkgZm9yIGJvdF9pbmRfcm4sCisgICAgIHJvdy0+aW5kaWNhdGVfZW9iX3AgYW5k IGJvdF9yb3dfZW5kc19hdF96dl9wLiAgKi8KKyAgaW50IHRvcF9yb3dfZW5kc19hdF96dl9wIE1D X0lGX0xJTlQgKD0gMCksIGJvdF9yb3dfZW5kc19hdF96dl9wIE1DX0lGX0xJTlQgKD0gMCk7Cisg IGlmICh3LT5wc2V1ZG9fd2luZG93X3ApCisgICAgcmV0dXJuIDA7CisgIGlmICghTUlOSV9XSU5E T1dfUCAodykKKyAgICAgICYmIChpbmQgPSBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGlu ZGljYXRlX2J1ZmZlcl9ib3VuZGFyaWVzKSwgIU5JTFAgKGluZCkpKQorICAgIHsKKyAgICAgIGlm IChFUSAoaW5kLCBRbGVmdCkgfHwgRVEgKGluZCwgUXJpZ2h0KSkKKyAgICAgICAgYm91bmRhcnlf dG9wID0gYm91bmRhcnlfYm90ID0gYXJyb3dfdG9wID0gYXJyb3dfYm90ID0gaW5kOworICAgICAg ZWxzZSBpZiAoQ09OU1AgKGluZCkKKyAgICAgICAgICAgICAgICYmIENPTlNQIChYQ0FSIChpbmQp KSkKKyAgICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IHBvczsKKyAgICAgICAgICBpZiAo cG9zID0gbWNfYXNzcSAoUXQsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAgYm91bmRh cnlfdG9wID0gYm91bmRhcnlfYm90ID0gYXJyb3dfdG9wID0gYXJyb3dfYm90ID0gWENEUiAocG9z KTsKKyAgICAgICAgICBpZiAocG9zID0gbWNfYXNzcSAoUXRvcCwgaW5kKSwgIU5JTFAgKHBvcykp CisgICAgICAgICAgICBib3VuZGFyeV90b3AgPSBYQ0RSIChwb3MpOworICAgICAgICAgIGlmIChw b3MgPSBtY19hc3NxIChRYm90dG9tLCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAgIGJv dW5kYXJ5X2JvdCA9IFhDRFIgKHBvcyk7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFF1 cCwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBhcnJvd190b3AgPSBYQ0RSIChwb3Mp OworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRZG93biwgaW5kKSwgIU5JTFAgKHBvcykp CisgICAgICAgICAgICBhcnJvd19ib3QgPSBYQ0RSIChwb3MpOworICAgICAgICB9CisgICAgICBl bHNlCisgICAgICAgIC8qIEFueXRoaW5nIGVsc2UgbWVhbnMgYm91bmRhcnkgb24gbGVmdCBhbmQg bm8gYXJyb3dzLiAgKi8KKyAgICAgICAgYm91bmRhcnlfdG9wID0gYm91bmRhcnlfYm90ID0gUWxl ZnQ7CisgICAgfQorICB0b3BfaW5kX3JuID0gYm90X2luZF9ybiA9IC0xOworICBpZiAoIU5JTFAg KGluZCkpCisgICAgeworICAgICAgZm9yICh5ID0gdy0+dnNjcm9sbCwgcm4gPSAwOworICAgICAg ICAgICB5IDwgeWIgJiYgcm4gPCBucm93czsKKyAgICAgICAgICAgeSArPSByb3ctPmhlaWdodCwg KytybikKKyAgICAgICAgeworICAgICAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dz ICsgcm47CisgICAgICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgICAgIHJvdyA9 IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgcm93LT5pbmRpY2F0ZV9i b2JfcCA9IHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCA9IDA7CisgICAgICAgICAgcm93LT5pbmRp Y2F0ZV9lb2JfcCA9IHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCA9IDA7CisgICAgICAgICAg aWYgKCFyb3ctPm1vZGVfbGluZV9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAo dG9wX2luZF9ybiA8IDAgJiYgcm93LT52aXNpYmxlX2hlaWdodCA+IDApCisgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfU1RBUlRfQ0hBUlBPUyAocm93 KSA8PSBCVUZfQkVHViAoWEJVRkZFUiAody0+Y29udGVudHMpKQorICAgICAgICAgICAgICAgICAg ICAgICYmICFNQVRSSVhfUk9XX1BBUlRJQUxMWV9WSVNJQkxFX0FUX1RPUF9QICh3LCByb3cpKQor ICAgICAgICAgICAgICAgICAgICByb3ctPmluZGljYXRlX2JvYl9wID0gIU5JTFAgKGJvdW5kYXJ5 X3RvcCk7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHJvdy0+ aW5kaWNhdGVfdG9wX2xpbmVfcCA9ICFOSUxQIChhcnJvd190b3ApOworICAgICAgICAgICAgICAg ICAgdG9wX2luZF9ybiA9IHJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgaWYg KGJvdF9pbmRfcm4gPCAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlm IChNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpID49IEJVRl9aViAoWEJVRkZFUiAody0+Y29u dGVudHMpKQorICAgICAgICAgICAgICAgICAgICAgICYmICFNQVRSSVhfUk9XX1BBUlRJQUxMWV9W SVNJQkxFX0FUX0JPVFRPTV9QICh3LCByb3cpKQorICAgICAgICAgICAgICAgICAgICByb3ctPmlu ZGljYXRlX2VvYl9wID0gIU5JTFAgKGJvdW5kYXJ5X2JvdCksIGJvdF9pbmRfcm4gPSBybjsKKyAg ICAgICAgICAgICAgICAgIGVsc2UgaWYgKHkgKyByb3ctPmhlaWdodCA+PSB5YikKKyAgICAgICAg ICAgICAgIC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XJ0aWFsX3BdID0JCQlcCisgICAgICBtY19nZXRfbG9naWNhbF9m cmluZ2VfYml0bWFwICh3LCB3aGljaCwgMSwgcGFydGlhbF9wKSkpCisgIC8qIEV4dGVuZCB0b3At YWxpZ25lZCB0b3AgaW5kaWNhdG9yIChvciBib3R0b20tYWxpZ25lZCBib3R0b20KKyAgICAgaW5k aWNhdG9yKSB0byBhZGphY2VudCByb3dzIGlmIGl0IGRvZXNuJ3QgZml0IGluIG9uZSByb3cuICAq LworICB0b3BfaW5kX21pbl95ID0gYm90X2luZF9tYXhfeSA9IC0xOworICBpZiAodG9wX2luZF9y biA+PSAwKQorICAgIHsKKyAgICAgIGludCBibiA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAg ICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHRvcF9pbmRfcm47CisgICAgICBpZiAo IXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICByb3cgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyAr IHRvcF9pbmRfcm47CisgICAgICB0b3Bfcm93X2VuZHNfYXRfenZfcCA9IHJvdy0+ZW5kc19hdF96 dl9wOworICAgICAgaWYgKHJvdy0+aW5kaWNhdGVfYm9iX3ApCisgICAgICAgIHsKKyAgICAgICAg ICBpZiAoRVEgKGJvdW5kYXJ5X3RvcCwgUWxlZnQpKQorICAgICAgICAgICAgYm4gPSAoKHJvdy0+ aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQpKQorICAgICAgICAgICAg PyBNQ19MRUZUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKQorICAg ICAgICAgICAgOiBNQ19MRUZUX0ZSSU5HRSAoMiwgUXRvcCwgMCkpOworICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgIGJuID0gKChyb3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9i b3QsIFFyaWdodCkpCisgICAgICAgICAgICA/IE1DX1JJR0hUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0 b20sIHJvdy0+ZW5kc19hdF96dl9wKQorICAgICAgICAgICAgOiBNQ19SSUdIVF9GUklOR0UgKDIs IFF0b3AsIDApKTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3Bf bGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKEVRIChhcnJvd190b3AsIFFsZWZ0KSkK KyAgICAgICAgICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAg ICAgIH0KKyAgICAgIGlmIChibiAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICB7Cisg ICAgICAgICAgc3RydWN0IGZyaW5nZV9iaXRtYXAgKmZiID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0 YSAoYm4pOworICAgICAgICAgIGlmIChmYi0+YWxpZ24gPT0gQUxJR05fQklUTUFQX1RPUCAmJiBm Yi0+cGVyaW9kID09IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHN0cnVjdCBnbHlw aF9yb3cgKnJvdzE7CisgICAgICAgICAgICAgIGludCB0b3BfaW5kX21heF95OworICAgICAgICAg ICAgICB0b3BfaW5kX21pbl95ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAg ICAgICAgICAgIHRvcF9pbmRfbWF4X3kgPSB0b3BfaW5kX21pbl95ICsgZmItPmhlaWdodDsKKyAg ICAgICAgICAgICAgaWYgKHRvcF9pbmRfbWF4X3kgPiB5YikKKyAgICAgICAgICAgICAgICB0b3Bf aW5kX21heF95ID0geWI7CisgICAgICAgICAgICAgIGZvciAoeSA9IHJvdy0+eSArIHJvdy0+aGVp Z2h0LCBybiA9IHRvcF9pbmRfcm4gKyAxOworICAgICAgICAgICAgICAgICAgIHkgPCB0b3BfaW5k X21heF95ICYmIHJuIDwgbnJvd3M7CisgICAgICAgICAgICAgICAgICAgeSArPSByb3cxLT5oZWln aHQsIHJuKyspCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKGJvdF9p bmRfcm4gPj0gMCAmJiBybiA+PSBib3RfaW5kX3JuKQorICAgICAgICAgICAgICAgICAgICBicmVh azsKKyAgICAgICAgICAgICAgICAgIHJvdzEgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJu OworICAgICAgICAgICAgICAgICAgaWYgKCFyb3cxLT5lbmFibGVkX3ApCisgICAgICAgICAgICAg ICAgICAgIHJvdzEgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgICAg ICAgICAgcm93MS0+aW5kaWNhdGVfYm9iX3AgPSByb3ctPmluZGljYXRlX2JvYl9wOworICAgICAg ICAgICAgICAgICAgcm93MS0+aW5kaWNhdGVfdG9wX2xpbmVfcCA9IHJvdy0+aW5kaWNhdGVfdG9w X2xpbmVfcDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAg ICB9CisgIGlmIChib3RfaW5kX3JuID49IDApCisgICAgeworICAgICAgaW50IGJuID0gTUNfTk9f RlJJTkdFX0JJVE1BUDsKKyAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgYm90 X2luZF9ybjsKKyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgIHJvdyA9IHctPmN1 cnJlbnRfbWF0cml4LT5yb3dzICsgYm90X2luZF9ybjsKKyAgICAgIGJvdF9yb3dfZW5kc19hdF96 dl9wID0gcm93LT5lbmRzX2F0X3p2X3A7CisgICAgICBpZiAocm93LT5pbmRpY2F0ZV9lb2JfcCkK KyAgICAgICAgeworICAgICAgICAgIGlmIChFUSAoYm91bmRhcnlfYm90LCBRbGVmdCkpCisgICAg ICAgICAgICBibiA9IE1DX0xFRlRfRlJJTkdFICgzLCBRYm90dG9tLCByb3ctPmVuZHNfYXRfenZf cCk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDMs IFFib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAo cm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKEVR IChhcnJvd19ib3QsIFFsZWZ0KSkKKyAgICAgICAgICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDcs IFFkb3duLCAwKTsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBibiA9IE1DX1JJR0hUX0ZS SU5HRSAoNywgUWRvd24sIDApOworICAgICAgICB9CisgICAgICBpZiAoYm4gIT0gTUNfTk9fRlJJ TkdFX0JJVE1BUCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBmcmluZ2VfYml0bWFwICpm YiA9IGdldF9mcmluZ2VfYml0bWFwX2RhdGEgKGJuKTsKKyAgICAgICAgICBpZiAoZmItPmFsaWdu ID09IEFMSUdOX0JJVE1BUF9CT1RUT00gJiYgZmItPnBlcmlvZCA9PSAwKQorICAgICAgICAgICAg eworICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cxOworICAgICAgICAgICAgICBp bnQgYm90X2luZF9taW5feTsKKyAgICAgICAgICAgICAgYm90X2luZF9tYXhfeSA9IHJvdy0+eSAr IHJvdy0+dmlzaWJsZV9oZWlnaHQ7CisgICAgICAgICAgICAgIGJvdF9pbmRfbWluX3kgPSBib3Rf aW5kX21heF95IC0gZmItPmhlaWdodDsKKyAgICAgICAgICAgICAgaWYgKGJvdF9pbmRfbWluX3kg PCBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KSkKKyAgICAgICAgICBib3RfaW5kX21pbl95 ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICAgICAgICAgIGZvciAoeSA9 IHJvdy0+eSwgcm4gPSBib3RfaW5kX3JuIC0gMTsKKyAgICAgICAgICAgICB5ID49IGJvdF9pbmRf bWluX3kgJiYgcm4gPj0gMDsKKyAgICAgICAgICAgICB5IC09IHJvdzEtPmhlaWdodCwgcm4tLSkK KyAgICAgICAgICB7CisgICAgICAgICAgICBpZiAodG9wX2luZF9ybiA+PSAwICYmIHJuIDw9IHRv cF9pbmRfcm4pCisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgcm93MSA9IHctPmRl c2lyZWRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICBpZiAoIXJvdzEtPmVuYWJsZWRf cCkKKyAgICAgICAgICAgICAgcm93MSA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47Cisg ICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV9lb2JfcCA9IHJvdy0+aW5kaWNhdGVfZW9iX3A7Cisg ICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wID0gcm93LT5pbmRpY2F0ZV9i b3R0b21fbGluZV9wOworICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAg IH0KKyAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y29udGVudHM7CisgIENIRUNLX0JVRkZFUiAoYnVm KTsKKyAgYm9vbCBhdXRvX2hzY3JvbGxfbW9kZV9wID0gRVEgKEZidWZmZXJfbG9jYWxfdmFsdWUg KFFhdXRvX2hzY3JvbGxfbW9kZSwgYnVmKSwgUWN1cnJlbnRfbGluZSk7CisgIC8qIEVYQU1QTEU6 ICAoc2Nyb2xsLWxlZnQgNSkgKi8KKyAgYm9vbCBoc2NsX2FsbF90ZW1wX3AgPSAody0+c3VzcGVu ZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xs X21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhB TVBMRTogIEMtdSBDLXggPCBhbmQgZG8gbm90aGluZy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJt XzBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9o c2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xs ID09IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhp bmcgZWxzZSBiZXNpZGVzIGhvcml6b250YWxseSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAg ICBjdXJyZW50IGxpbmUgZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUg aXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhz Y2xfYWxsX3Blcm1fMV9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct Pm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFu ZCAuLi4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkg c2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXct PnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0 b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3Jv bGwgPT0gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4g MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhz Y3JvbGwpOworICAvKiBFWEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3Mg dGhlIGxlZnQgYXJyb3cga2V5IG9uZSB0aW1lLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5l IF9pc18gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90 ZW1wX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAg JiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3Jv bGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7Cisg IC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUg Y3VycmVudCBsaW5lIHRvIGJlCisgICAgICAgICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQg ZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFs bHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1 c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xs X21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAg ICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9 IFhGUkFNRSAody0+ZnJhbWUpOworICBmb3IgKHkgPSB3LT52c2Nyb2xsLCBybiA9IDA7CisgICAg ICAgeSA8IHliICYmIHJuIDwgbnJvd3M7CisgICAgICAgeSArPSByb3ctPmhlaWdodCwgcm4rKykK KyAgICB7CisgIGludCBsZWZ0LCByaWdodDsKKyAgdW5zaWduZWQgbGVmdF9mYWNlX2lkLCByaWdo dF9mYWNlX2lkOworICBpbnQgbGVmdF9vZmZzZXQsIHJpZ2h0X29mZnNldDsKKyAgYm9vbCBwZXJp b2RpY19wOworICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJuOworICBjdXIgPSB3 LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICBpbnQgdnBvc19kZXNpcmVkID0gTUFUUklY X1JPV19WUE9TICh3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJuLCB3LT5kZXNpcmVkX21hdHJp eCk7CisgIGludCB2cG9zX2N1cnJlbnQgPSBNQVRSSVhfUk9XX1ZQT1MgKHctPmN1cnJlbnRfbWF0 cml4LT5yb3dzICsgcm4sIHctPmN1cnJlbnRfbWF0cml4KTsKKyAgaW50IG1jX2xlZnRfZnJpbmdl X2Jp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fYWxsX3Blcm1fMV9w CisgICAgICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMl9wCisgICAgICAgICAgJiYgZW5hYmxlZF9w KQorICAgICAgICB7CisgICAgICAgICAgaW50IGZyaW5nZV9iaXRtYXAgPSBNQ19OT19GUklOR0Vf QklUTUFQOworICAgICAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQgPQor ICAgICAgICAgICAgKCFhY3RpdmVfcAorICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICAgID8g bG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1pbmFjdGl2 ZS1mYWNlIiksIHRydWUpCisgICAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgICAg PyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWZhY2Ui KSwgdHJ1ZSkKKyAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgIG1jX2xl ZnRfZnJpbmdlX2ZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQ KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBvdmVybGF5X2Fycm93X2Zh Y2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNF X0lEOworICAgICAgICAgIGlmICh3LT5oc2Nyb2xsICE9IDApCisgICAgICAgICAgICBmcmluZ2Vf Yml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJv dyIpLCBmYWxzZSwgdHJ1ZSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGZyaW5n ZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1vdmVybGF5LWFy cm93IiksIHRydWUsIHRydWUpOworICAgICAgICAgIG1jX2xlZnRfZnJpbmdlX2JpdG1hcCA9IChj dXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgIH0KKyAgICAgICAgZWxz ZSBpZiAoKHZwb3MgPT0gdnBvc19kZXNpcmVkIHx8IHZwb3MgPT0gdnBvc19jdXJyZW50KQorICAg ICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAK KyAgICAgICAgICAgICAgICAgJiYgKGhzY2xfYWxsX3RlbXBfcAorICAgICAgICAgICAgICAgICAg ICAgfHwgaHNjbF9hbGxfcGVybV8wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxs X3Blcm1fMV9wCisgICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAg ICAgICAgICAgICAgICAgICAgfHwgaHNjbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8 IGhzY2xfcGVybV9wKQorICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAg eworICAgICAgICAgICAgaW50IGZyaW5nZV9iaXRtYXAgPSBNQ19OT19GUklOR0VfQklUTUFQOwor ICAgICAgICAgICAgZW51bSBmYWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAg ICAgICAgICghYWN0aXZlX3AKKyAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICAgICAgPyBs b29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5h Y3RpdmUtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAg ICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJy b3ctaHNjbC1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOwor ICAgICAgICAgICAgbWNfbGVmdF9mcmluZ2VfZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19M RUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgICAgaWYgKGhzY2xfYWxsX3Blcm1f MF9wKQorICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAg KHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIGZhbHNlLCBmYWxzZSk7CisgICAgICAgICAgICAg IGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMV9wKQorICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRt YXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1 ZSwgZmFsc2UpOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMl9wKQor ICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3 LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCBmYWxzZSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAg ICBlbHNlIGlmIChoc2NsX3Blcm1fcCkKKyAgICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1h cCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCB0cnVl LCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfdGVtcF9wKQor ICAgICAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1h cCAodywgaW50ZXJuICgiKy1oc2NsLXRlbXAiKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAg ICAgICAgICAgICBlbHNlIGlmIChoc2NsX3RlbXBfcCkKKyAgICAgICAgICAgICAgICAgICAgICAg IGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2Ns LXRlbXAiKSwgdHJ1ZSwgZmFsc2UpOworICAgICAgICAgICAgbWNfbGVmdF9mcmluZ2VfYml0bWFw ID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgfQor ICAgICAgICAgIGVsc2UgaWYgKCh2cG9zID09IHZwb3NfZGVzaXJlZCB8fCB2cG9zID09IHZwb3Nf Y3VycmVudCkKKyAgICAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xM T1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAg ICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5H TEUKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAg ICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAg ICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIK KyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9C QVJfQkFDS1NMQVNIKQorICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGJpdG1hcF9mbGF2b3IgPSAoZ2x5cGhf Zmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0 X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVykKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRf aG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19y ZWN0YW5nbGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGds eXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9h cnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhf Zmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGlj YWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXIKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2JhcgorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JB Ul9CQUNLU0xBU0gpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogUW5pbDsKKyAgICAgICAgICAgICAgbWNfcmlnaHRfZnJpbmdlX2Jp dG1hcCA9IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJp dG1hcF9mbGF2b3IpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBN Q19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgICAgICBtY19yaWdodF9mcmluZ2VfZmFjZV9p ZCA9CisgICAgICAgICAgICAgICAgKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRN QVAKKyAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xM T1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9m bGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAg ICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKSkK KyAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIist cmV2ZXJzZWQtdmVydGljYWwtYmFyLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChj dXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAg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2libGVfaGVpZ2h0 KTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgTUFUUklY X1JPV19DT05USU5VQVRJT05fTElORV9QIChyb3cpKQorICAgICAgICAgICAgICAgfHwgKHJvdy0+ cmV2ZXJzZWRfcCAmJiByb3ctPmNvbnRpbnVlZF9wKSkKKyAgICAgICAgbGVmdCA9IE1DX0xFRlRf RlJJTkdFICg0LCBRY29udGludWF0aW9uLCAwKTsKKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNh dGVfZW1wdHlfbGluZV9wICYmIEVRIChlbXB0eV9wb3MsIFFsZWZ0KSkKKyAgICAgICAgbGVmdCA9 IE1DX0xFRlRfRlJJTkdFICg1LCBRZW1wdHlfbGluZSwgMCk7CisgICAgICBlbHNlIGlmIChyb3ct PmluZGljYXRlX3RvcF9saW5lX3AgJiYgRVEgKGFycm93X3RvcCwgUWxlZnQpKQorICAgICAgICB7 CisgICAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAg IGlmICh0b3BfaW5kX21pbl95ID49IDApCisgICAgICAgICAgICBsZWZ0X29mZnNldCA9IHRvcF9p bmRfbWluX3kgLSByb3ctPnk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNh dGVfYm90dG9tX2xpbmVfcCAmJiBFUSAoYXJyb3dfYm90LCBRbGVmdCkpCisgICAgICAgIHsKKyAg ICAgICAgICBsZWZ0ID0gTUNfTEVGVF9GUklOR0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICBp ZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAgICAgICAgICAgbGVmdF9vZmZzZXQgPSBib3RfaW5k X21heF95IC0gKHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgICAgICB9CisgICAg ICBlbHNlCisgICAgICAgIGxlZnQgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgLyogRGVj aWRlIHdoaWNoIGJpdG1hcCB0byBkcmF3IGluIHRoZSByaWdodCBmcmluZ2UuICAqLworICAgICAg aWYgKFdJTkRPV19SSUdIVF9GUklOR0VfV0lEVEggKHcpID09IDApCisgICAgICAgIHJpZ2h0ID0g TUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgIGVsc2UgaWYgKHJvdy0+cmlnaHRfdXNlcl9mcmlu Z2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHsKKyAgICAgICAgICBy aWdodCA9IHJvdy0+cmlnaHRfdXNlcl9mcmluZ2VfYml0bWFwOworICAgICAgICAgIHJpZ2h0X2Zh Y2VfaWQgPSByb3ctPnJpZ2h0X3VzZXJfZnJpbmdlX2ZhY2VfaWQ7CisgICAgICAgIH0KKyAgICAg IGVsc2UgaWYgKCghcm93LT5yZXZlcnNlZF9wICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3Ap CisgICAgICAgICAgICAgICB8fCAocm93LT5yZXZlcnNlZF9wICYmIHJvdy0+dHJ1bmNhdGVkX29u X2xlZnRfcCkpCisgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICgwLCBRdHJ1bmNhdGlv biwgMCk7CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2JvYl9wICYmIEVRIChib3VuZGFy eV90b3AsIFFyaWdodCkpCisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9ICgocm93LT5pbmRp Y2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICAgICAgID8g TUNfUklHSFRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwgdG9wX3Jvd19lbmRzX2F0X3p2X3ApCisg ICAgICAgICAgICAgOiBNQ19SSUdIVF9GUklOR0UgKDIsIFF0b3AsIDApKTsKKyAgICAgICAgICBp ZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2lu ZF9taW5feSAtIHJvdy0+eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0 ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICB7CisgICAgICAg ICAgcmlnaHQgPSBNQ19SSUdIVF9GUklOR0UgKDMsIFFib3R0b20sIGJvdF9yb3dfZW5kc19hdF96 dl9wKTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAgICAgICAgICAgcmln aHRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0 KTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgcm93LT5j b250aW51ZWRfcCkKKyAgICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgTUFUUklY X1JPV19DT05USU5VQVRJT05fTElORV9QIChyb3cpKSkKKyAgICAgICAgcmlnaHQgPSBNQ19SSUdI VF9GUklOR0UgKDQsIFFjb250aW51YXRpb24sIDApOworICAgICAgZWxzZSBpZiAocm93LT5pbmRp Y2F0ZV90b3BfbGluZV9wICYmIEVRIChhcnJvd190b3AsIFFyaWdodCkpCisgICAgICAgIHsKKyAg ICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICBp ZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2lu ZF9taW5feSAtIHJvdy0+eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0 ZV9ib3R0b21fbGluZV9wICYmIEVRIChhcnJvd19ib3QsIFFyaWdodCkpCisgICAgICAgIHsKKyAg ICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAg IGlmIChib3RfaW5kX21heF95ID49IDApCisgICAgICAgICAgICByaWdodF9vZmZzZXQgPSBib3Rf aW5kX21heF95IC0gKHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgICAgICB9Cisg ICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VtcHR5X2xpbmVfcCAmJiBFUSAoZW1wdHlfcG9z LCBRcmlnaHQpKQorICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoNSwgUWVtcHR5X2xp bmUsIDApOworICAgICAgZWxzZQorICAgICAgICByaWdodCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7 CisgICAgICBwZXJpb2RpY19wID0gKGdldF9mcmluZ2VfYml0bWFwX2RhdGEgKGxlZnQpLT5wZXJp b2QgIT0gMAorICAgICAgICAgICAgICAgICAgICB8fCBnZXRfZnJpbmdlX2JpdG1hcF9kYXRhIChy aWdodCktPnBlcmlvZCAhPSAwKTsKKyAgICAgIGlmIChyb3ctPnkgIT0gY3VyLT55CisgICAgICAg ICAgfHwgcm93LT52aXNpYmxlX2hlaWdodCAhPSBjdXItPnZpc2libGVfaGVpZ2h0CisgICAgICAg ICAgfHwgcm93LT5lbmRzX2F0X3p2X3AgIT0gY3VyLT5lbmRzX2F0X3p2X3AKKyAgICAgICAgICB8 fCBsZWZ0ICE9IGN1ci0+bGVmdF9mcmluZ2VfYml0bWFwCisgICAgICAgICAgfHwgcmlnaHQgIT0g Y3VyLT5yaWdodF9mcmluZ2VfYml0bWFwCisgICAgICAgICAgfHwgbGVmdF9mYWNlX2lkICE9IGN1 ci0+bGVmdF9mcmluZ2VfZmFjZV9pZAorICAgICAgICAgIHx8IHJpZ2h0X2ZhY2VfaWQgIT0gY3Vy LT5yaWdodF9mcmluZ2VfZmFjZV9pZAorICAgICAgICAgIHx8IGxlZnRfb2Zmc2V0ICE9IGN1ci0+ bGVmdF9mcmluZ2Vfb2Zmc2V0CisgICAgICAgICAgfHwgcmlnaHRfb2Zmc2V0ICE9IGN1ci0+cmln aHRfZnJpbmdlX29mZnNldAorICAgICAgICAgIHx8IHBlcmlvZGljX3AgIT0gY3VyLT5mcmluZ2Vf Yml0bWFwX3BlcmlvZGljX3AKKyAgICAgICAgICB8fCBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFw c19wKQorICAgICAgICB7CisgICAgICAgICAgcmVkcmF3X3AgPSAxLCByb3ctPnJlZHJhd19mcmlu Z2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgICBpZiAoIWtlZXBfY3VycmVudF9wKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gMTsK KyAgICAgICAgICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0Vf QklUTUFQCisgICAgICAgICAgICAgICAgICB8fCBtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1D X05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5mcmluZ2VfYml0bWFwX3Bl cmlvZGljX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg ICBjdXItPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IHBlcmlvZGljX3A7CisgICAgICAgICAg ICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAg ICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX2JpdG1hcCA9IG1jX2xlZnRfZnJpbmdlX2Jp dG1hcDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRf ZnJpbmdlX2JpdG1hcCA9IGxlZnQ7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9i aXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPmxlZnRf ZnJpbmdlX2ZhY2VfaWQgPSBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2VfZmFjZV9pZCA9IGxlZnRf ZmFjZV9pZDsKKyAgICAgICAgICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19O T19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2Vfb2Zmc2V0 ID0gMDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRf ZnJpbmdlX29mZnNldCA9IGxlZnRfb2Zmc2V0OworICAgICAgICAgICAgICBpZiAobWNfcmlnaHRf ZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1 ci0+cmlnaHRfZnJpbmdlX2JpdG1hcCA9IG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXA7CisgICAgICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfYml0bWFw ID0gcmlnaHQ7CisgICAgICAgICAgICAgIGlmIChtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1D X05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfZmFj ZV9pZCA9IG1jX3JpZ2h0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQgPSByaWdodF9mYWNlX2lk OworICAgICAgICAgICAgICBpZiAobWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklO R0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldCA9IDA7 CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmlu Z2Vfb2Zmc2V0ID0gcmlnaHRfb2Zmc2V0OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAg ICBpZiAocm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCA8IDApCisgICAgICAgIHJvdy0+b3Zlcmxh eV9hcnJvd19iaXRtYXAgPSBtY19nZXRfbG9naWNhbF9mcmluZ2VfYml0bWFwICh3LCBRb3Zlcmxh eV9hcnJvdywgMCwgMCk7CisgICAgICBpZiAocm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCAhPSBj dXItPm92ZXJsYXlfYXJyb3dfYml0bWFwKQorICAgICAgICB7CisgICAgICAgICAgcmVkcmF3X3Ag PSAxLCByb3ctPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgICBpZiAoIWtl ZXBfY3VycmVudF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjdXItPnJlZHJhd19m cmluZ2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgICAgICAgY3VyLT5vdmVybGF5X2Fycm93X2Jp dG1hcCA9IHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXA7CisgICAgICAgICAgICB9CisgICAgICAg IH0KKyAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1B UAorICAgICAgICAgIHx8IG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJ VE1BUCkKKyAgICAgICAgcm93LT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxzZTsKKyAg ICAgICAgZWxzZQorICAgICAgICAgIHJvdy0+ZnJpbmdlX2JpdG1hcF9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Agc3RydWN0IGZyaW5nZV9iaXRtYXAgKmZiOworICBpbnQg cGVyaW9kOworICBpbnQgZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgaW50IG9mZnNldCwg aGVhZGVyX2xpbmVfaGVpZ2h0OworICBwLm92ZXJsYXlfcCA9IChvdmVybGF5ICYgMSkgPT0gMTsK KyAgcC5jdXJzb3JfcCA9IChvdmVybGF5ICYgMikgPT0gMjsKKyAgaWYgKHdoaWNoICE9IE1DX05P X0ZSSU5HRV9CSVRNQVApCisgICAgeworICAgICAgb2Zmc2V0ID0gMDsKKyAgICB9CisgICAgZWxz ZSBpZiAobGVmdF9wKQorICAgICAgeworICAgICAgICB3aGljaCA9IHJvdy0+bGVmdF9mcmluZ2Vf Yml0bWFwOworICAgICAgICBmYWNlX2lkID0gcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkOworICAg ICAgICBvZmZzZXQgPSByb3ctPmxlZnRfZnJpbmdlX29mZnNldDsKKyAgICAgIH0KKyAgICAgIGVs c2UKKyAgICAgICAgeworICAgICAgICAgIHdoaWNoID0gcm93LT5yaWdodF9mcmluZ2VfYml0bWFw OworICAgICAgICAgIGZhY2VfaWQgPSByb3ctPnJpZ2h0X2ZyaW5nZV9mYWNlX2lkOworICAgICAg ICAgIG9mZnNldCA9IHJvdy0+cmlnaHRfZnJpbmdlX29mZnNldDsKKyAgICAgICAgfQorICBpZiAo ZmFjZV9pZCA9PSBERUZBVUxUX0ZBQ0VfSUQpCisgICAgeworICAgICAgTGlzcF9PYmplY3QgZmFj ZSA9IGZyaW5nZV9mYWNlc1t3aGljaF07CisgICAgICBmYWNlX2lkID0gTklMUCAoZmFjZSkgPyBs b29rdXBfbmFtZWRfZmFjZSAodywgZiwgUWZyaW5nZSwgZmFsc2UpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBsb29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBmYWNlLCBGUklOR0VfRkFD RV9JRCwgMCk7CisgICAgICBpZiAoZmFjZV9pZCA8IDApCisgICAgICAgIGZhY2VfaWQgPSBGUklO R0VfRkFDRV9JRDsKKyAgICB9CisgIGZiID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAod2hpY2gp OworICBwZXJpb2QgPSBmYi0+cGVyaW9kOworICAvKiBDb252ZXJ0IHJvdyB0byBmcmFtZSBjb29y ZGluYXRlcy4gICovCisgIHAueSA9IFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCByb3ctPnkp ICsgb2Zmc2V0OworICBwLndoaWNoID0gd2hpY2g7CisgIHAuYml0cyA9IGZiLT5iaXRzOworICBw LndkID0gZmItPndpZHRoOworICBwLmggPSBmYi0+aGVpZ2h0OworICBwLmRoID0gKHBlcmlvZCA+ IDAgPyAocC55ICUgcGVyaW9kKSA6IDApOworICBwLmggLT0gcC5kaDsKKyAgLyogQWRqdXN0IHkg dG8gdGhlIG9mZnNldCBpbiB0aGUgcm93IHRvIHN0YXJ0IGRyYXdpbmcgdGhlIGJpdG1hcC4gICov CisgIHN3aXRjaCAoZmItPmFsaWduKQorICAgIHsKKyAgICBjYXNlIEFMSUdOX0JJVE1BUF9DRU5U RVI6CisgICAgICBwLnkgKz0gKHJvdy0+aGVpZ2h0IC0gcC5oKSAvIDI7CisgICAgICBicmVhazsK KyAgICBjYXNlIEFMSUdOX0JJVE1BUF9CT1RUT006CisgICAgICBwLnkgKz0gKHJvdy0+dmlzaWJs ZV9oZWlnaHQgLSBwLmgpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBBTElHTl9CSVRNQVBfVE9Q OgorICAgICAgYnJlYWs7CisgICAgfQorICBwLmZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGZhY2Vf aWQpOworICBpZiAocC5mYWNlID09IE5VTEwpCisgICAgeworICAgICAgLyogVGhpcyBjb3VsZCBo YXBwZW4gYWZ0ZXIgY2xlYXJpbmcgZmFjZSBjYWNoZS4KKyAgIEJ1dCBpdCBzaG91bGRuJ3QgaGFw cGVuIGFueW1vcmUuICArK2tmcyAqLworICAgICAgcmV0dXJuOworICAgIH0KKyAgcHJlcGFyZV9m YWNlX2Zvcl9kaXNwbGF5IChmLCBwLmZhY2UpOworICAvKiBDbGVhciBsZWZ0IGZyaW5nZSBpZiBu byBiaXRtYXAgdG8gZHJhdyBvciBpZiBiaXRtYXAgZG9lc24ndCBmaWxsCisgICAgIHRoZSBmcmlu Z2UuICAqLworICBwLmJ4ID0gLTE7CisgIGhlYWRlcl9saW5lX2hlaWdodCA9IFdJTkRPV19IRUFE RVJfTElORV9IRUlHSFQgKHcpOworICBwLmJ5ID0gV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcs IG1heCAoaGVhZGVyX2xpbmVfaGVpZ2h0LCByb3ctPnkpKTsKKyAgcC5ueSA9IHJvdy0+dmlzaWJs ZV9oZWlnaHQ7CisgIGlmIChsZWZ0X3ApCisgICAgeworICAgICAgaW50IHdkID0gV0lORE9XX0xF RlRfRlJJTkdFX1dJRFRIICh3KTsKKyAgICAgIGludCB4ID0gd2luZG93X2JveF9sZWZ0ICh3LCAo V0lORE9XX0hBU19GUklOR0VTX09VVFNJREVfTUFSR0lOUyAodykKKyAgICAgICAgICAgPyBMRUZU X01BUkdJTl9BUkVBCisgICAgICAgICAgIDogVEVYVF9BUkVBKSk7CisgICAgICBpZiAocC53ZCA+ IHdkKQorICAgICAgICBwLndkID0gd2Q7CisgICAgICBwLnggPSB4IC0gcC53ZCAtICh3ZCAtIHAu d2QpIC8gMjsKKyAgICAgIGlmIChwLndkIDwgd2QgfHwgcC55ID4gcC5ieSB8fCBwLnkgKyBwLmgg PCBwLmJ5ICsgcC5ueSkKKyAgICAgICAgeworICAgICAgICAgIC8qIElmIFcgaGFzIGEgdmVydGlj YWwgYm9yZGVyIHRvIGl0cyBsZWZ0LCBkb24ndCBkcmF3IG92ZXIgaXQuICAqLworICAgICAgICAg IHdkIC09ICgoIVdJTkRPV19MRUZUTU9TVF9QICh3KQorICAgICAgICAgICAgLyogVGhpcyBjb3Vs ZCBiZSB3cm9uZyB3aGVuIHdlIGFsbG93IHdpbmRvdyBsb2NhbAorICAgICAgICAgICAgICAgcmln aHQgZGl2aWRlcnMgLSBidXQgdGhlIHdpbmRvdyBvbiB0aGUgbGVmdCBpcyBoYXJkCisgICAgICAg ICAgICAgICB0byBnZXQuICAqLworICAgICAgICAgICAgJiYgIUZSQU1FX1JJR0hUX0RJVklERVJf V0lEVEggKGYpCisgICAgICAgICAgICAmJiAhV0lORE9XX0hBU19WRVJUSUNBTF9TQ1JPTExfQkFS ICh3KQorICAgICAgICAgICAgLyogQnV0IGRvbid0IHJlZHVjZSB0aGUgZnJpbmdlIHdpZHRoIGlm IHRoZSB3aW5kb3cKKyAgICAgICAgICAgICAgIGhhcyBhIGxlZnQgbWFyZ2luLCBiZWNhdXNlIHRo YXQgbWVhbnMgd2UgYXJlIG5vdAorICAgICAgICAgICAgICAgaW4gZGFuZ2VyIG9mIGRyYXdpbmcg b3ZlciB0aGUgdmVydGljYWwgYm9yZGVyLAorICAgICAgICAgICAgICAgYW5kIE9UT0ggbGVhdmlu ZyBvdXQgdGhhdCBvbmUgcGl4ZWwgbGVhdmVzIGJlaGluZAorICAgICAgICAgICAgICAgdHJhY2Vz IG9mIHRoZSBjdXJzb3IsIGlmIGl0IHdhcyBpbiBjb2x1bW4gemVybworICAgICAgICAgICAgICAg YmVmb3JlIGRyYXdpbmcgbm9uLWVtcHR5IG1hcmdpbiBhcmVhLiAgKi8KKyAgICAgICAgICAgICYm IHctPmxlZnRfbWFyZ2luX2NvbHMgPT0gMCkKKyAgICAgICAgICAgPyAxIDogMCk7CisgICAgICAg ICAgcC5ieCA9IHggLSB3ZDsKKyAgICAgICAgICBwLm54ID0gd2Q7CisgICAgICAgIH0KKyAgICB9 CisgIGVsc2UKKyAgICB7CisgICAgICBpbnQgeCA9IHdpbmRvd19ib3hfcmlnaHQgKHcsCisgICAg ICAgIChXSU5ET1dfSEFTX0ZSSU5HRVNfT1VUU0lERV9NQVJHSU5TICh3KQorICAgICAgICAgPyBS SUdIVF9NQVJHSU5fQVJFQQorICAgICAgICAgOiBURVhUX0FSRUEpKTsKKyAgICAgIGludCB3ZCA9 IFdJTkRPV19SSUdIVF9GUklOR0VfV0lEVEggKHcpOworICAgICAgaWYgKHAud2QgPiB3ZCkKKyAg ICAgICAgcC53ZCA9IHdkOworICAgICAgcC54ID0geCArICh3ZCAtIHAud2QpIC8gMjsKKyAgICAg IC8qIENsZWFyIHJpZ2h0IGZyaW5nZSBpZiBubyBiaXRtYXAgdG8gZHJhdyBvZiBpZiBiaXRtYXAg ZG9lc24ndCBmaWxsCisgICB0aGUgZnJpbmdlLiAgKi8KKyAgICAgIGlmIChwLndkIDwgd2QgfHwg cC55ID4gcC5ieSB8fCBwLnkgKyBwLmggPCBwLmJ5ICsgcC5ueSkKKyAgICAgICAgeworICAgICAg ICAgIHAuYnggPSB4OworICAgICAgICAgIHAubnggPSB3ZDsKKyAgICAgICAgfQorICAgIH0KKyAg aWYgKHAueCA+PSBXSU5ET1dfQk9YX0xFRlRfRURHRV9YICh3KQorICAgICAgJiYgKHAueCArIHAu d2QpIDw9IFdJTkRPV19CT1hfTEVGVF9FREdFX1ggKHcpICsgV0lORE9XX1BJWEVMX1dJRFRIICh3 KSkKKyAgICBGUkFNRV9SSUYgKGYpLT5kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywgJnApOwor fQorCit2b2lkCittY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVj dCBnbHlwaF9yb3cgKnJvdywgaW50IGxlZnRfcCwgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3Jf dHlwZSkKK3sKKyAgaW50IG92ZXJsYXkgPSAwOworICBpZiAobGVmdF9wID09IHJvdy0+cmV2ZXJz ZWRfcCAmJiByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCkKKyAgICB7CisgICAgICBMaXNwX09iamVj dCBjdXJzb3IgPSBRbmlsOworICAgICAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICAgICAgewor ICAgICAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6CisgICAgICAgICAgaWYgKHJvdy0+dmlzaWJsZV9o ZWlnaHQgPj0gU1RBTkRBUkRfQklUTUFQX0hFSUdIVCAoaG9sbG93X3JlY3RhbmdsZV9iaXRzKSkK KyAgICAgICAgICAgIGN1cnNvciA9IFFob2xsb3c7CisgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgY3Vyc29yID0gUWhvbGxvd19zbWFsbDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2Fz ZSBNQ19IT0xMT1dfQk9YOgorICAgICAgICAgIGlmIChyb3ctPnZpc2libGVfaGVpZ2h0ID49IFNU QU5EQVJEX0JJVE1BUF9IRUlHSFQgKGhvbGxvd19yZWN0YW5nbGVfYml0cykpCisgICAgICAgICAg ICBjdXJzb3IgPSBRaG9sbG93OworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGN1cnNvciA9 IFFob2xsb3dfc21hbGw7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfRklMTEVE X0JPWDoKKyAgICAgICAgICBjdXJzb3IgPSBRYm94OworICAgICAgICAgIGJyZWFrOworICAgICAg ICBjYXNlIE1DX0JBUjoKKyAgICAgICAgICBjdXJzb3IgPSBRYmFyOworICAgICAgICAgIGJyZWFr OworICAgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAgICAgY3Vyc29yID0gUWhiYXI7CisgICAg ICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgICAg Y2FzZSBNQ19OT19DVVJTT1I6CisgICAgICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoK KyAgICAgICAgY2FzZSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGRlZmF1bHQ6Cisg ICAgICAgICAgdy0+cGh5c19jdXJzb3Jfb25fcCA9IDA7CisgICAgICAgICAgcm93LT5jdXJzb3Jf aW5fZnJpbmdlX3AgPSAwOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBpZiAo IU5JTFAgKGN1cnNvcikpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgYm0gPSBtY19nZXRfbG9n aWNhbF9jdXJzb3JfYml0bWFwICh3LCBjdXJzb3IpOworICAgICAgICAgIGlmIChibSAhPSBNQ19O T19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19kcmF3X2Zy aW5nZV9iaXRtYXBfMSAodywgcm93LCBsZWZ0X3AsIDIsIGJtKTsKKyAgICAgICAgICAgICAgb3Zl cmxheSA9IEVRIChjdXJzb3IsIFFib3gpID8gMyA6IDE7CisgICAgICAgICAgICB9CisgICAgICAg IH0KKyAgICB9CisgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcF8xICh3LCByb3csIGxlZnRfcCwgb3Zl cmxheSwgTUNfTk9fRlJJTkdFX0JJVE1BUCk7CisgIGlmIChsZWZ0X3AgJiYgcm93LT5vdmVybGF5 X2Fycm93X2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgIG1jX2RyYXdfZnJpbmdl X2JpdG1hcF8xICh3LCByb3csIDEsIDEsIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXApOworfQor CisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogI2RlZmluZSBOT19GUklOR0VfQklUTUFQIDAKICNkZWZpbmUgVU5ERUZfRlJJTkdFX0JJVE1B UCAxCiAjZGVmaW5lIE1BWF9TVEFOREFSRF9GUklOR0VfQklUTUFQUyBBUlJBWUVMVFMgKHN0YW5k YXJkX2JpdG1hcHMpC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ldCAnKy1xdWFkcnVwbGUtYW5n bGUtdXAgJ2ZyaW5nZSkgPT4gNDcgKi8KKworICAvKiA0OCAqLworICBERUZTWU0gKFFtY19xdWFk cnVwbGVfYW5nbGVfZG93biwgIistcXVhZHJ1cGxlLWFuZ2xlLWRvd24iKTsKKyAgVmZyaW5nZV9i aXRtYXBzID0gRmNvbnMgKFFtY19xdWFkcnVwbGVfYW5nbGVfZG93biwgVmZyaW5nZV9iaXRtYXBz KTsKKyAgRnB1dCAoUW1jX3F1YWRydXBsZV9hbmdsZV9kb3duLCBRZnJpbmdlLCBtYWtlX2ZpeG51 bSAoNDgpKTsKKyAgLyogKGdldCAnKy1xdWFkcnVwbGUtYW5nbGUtZG93biAnZnJpbmdlKSA9PiA0 OCAqLworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICBERUZTWU0gKFF0cnVuY2F0aW9uLCAidHJ1bmNhdGlvbiIpOwogICBERUZTWU0g KFFjb250aW51YXRpb24sICJjb250aW51YXRpb24iKTsKICAgREVGU1lNIChRb3ZlcmxheV9hcnJv dywgIm92ZXJsYXktYXJyb3ciKTsKZGlmZiAtLWdpdCBhL3NyYy9uc3Rlcm0uaCBiL3NyYy9uc3Rl cm0uaAppbmRleCA3OGNlNjA4Li44ZWYwZGZlIDEwMDY0NAotLS0gYS9zcmMvbnN0ZXJtLmgKKysr IGIvc3JjL25zdGVybS5oCkBAIC02NjAsNiArNjYwLDE2IEBAIHR5cGVkZWYgaWQgaW5zdGFuY2V0 eXBlOwogCiBAaW50ZXJmYWNlIEVtYWNzU2Nyb2xsZXIgOiBOU1Njcm9sbGVyCiAgIHsKKworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIE5T UmVjdCBtY19yZWN0YW5nbGU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgIHN0 cnVjdCB3aW5kb3cgKndpbmRvdzsKICAgIHN0cnVjdCBmcmFtZSAqZnJhbWU7CiAgICBOU1Jlc3Bv bmRlciAqcHJldlJlc3BvbmRlcjsKQEAgLTY4MCw2ICs2OTAsMTggQEAgdHlwZWRlZiBpZCBpbnN0 YW5jZXR5cGU7CiAgICBpbnQgZW1fd2hvbGU7CiAgICB9CiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3Rhbmds ZTogKE5TUmVjdClyZWN0OworLSAoTlNSZWN0KW1jX2dldF9yZWN0YW5nbGU7CistIChzdHJ1Y3Qg d2luZG93ICopbWNfZ2V0X3dpbmRvdzsKKy0gKGJvb2wpbWNfanVkZ2U7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIC0gKGluc3RhbmNldHlwZSkgaW5pdEZyYW1lOiAoTlNSZWN0ICly IHdpbmRvdzogKExpc3BfT2JqZWN0KXdpbjsKIC0gKHZvaWQpc2V0RnJhbWU6IChOU1JlY3QpcjsK IApkaWZmIC0tZ2l0IGEvc3JjL25zdGVybS5tIGIvc3JjL25zdGVybS5tCmluZGV4IDgxZDM2YmUu LmEwMWZiOTMgMTAwNjQ0Ci0tLSBhL3NyYy9uc3Rlcm0ubQorKysgYi9zcmMvbnN0ZXJtLm0KQEAg LTc2LDYgKzc2LDEwOTEgQEAgVXBkYXRlZCBieSBDa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BhcyBk aXJ0eSBhbmQgcmV0dXJuIE5PLCBvdGhlcndpc2UgcmV0dXJuIFlFUy4KKyAgIFRha2UgaW50byBj b25zaWRlcmF0aW9uIGByb3ctPmNsaXBgIGlmIGl0IHdhcyBzZXQgYnkgYGV4cG9zZV93aW5kb3cn LgorICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KK3sKKyAgTlNUUkFDRV9XSEVOIChOU1RSQUNFX0dS T1VQX0ZPQ1VTLCAibWNfbnNfY2xpcF90b19yZWN0Iik7CisgIGlmIChyKQorICAgIHsKKyAgICAg IE5TVFJBQ0VfUkVDVCAoInIiLCAqcik7CisgICAgICBpZiAoW05TVmlldyBmb2N1c1ZpZXddID09 IEZSQU1FX05TX1ZJRVcgKGYpKQorICAgICAgICB7CisgICAgICAgICAgW1tOU0dyYXBoaWNzQ29u dGV4dCBjdXJyZW50Q29udGV4dF0gc2F2ZUdyYXBoaWNzU3RhdGVdOworICAgICAgICAgIGlmIChu ID09IDIpCisgICAgICAgICAgICBOU1JlY3RDbGlwTGlzdCAociwgMik7CisgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAocm93LT5jbGlwICE9IE5V TEwpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIE5TUmVjdCByX2Ns aXA7CisgICAgICAgICAgICAgICAgICAgIHJfY2xpcC5vcmlnaW4ueCA9IHJvdy0+Y2xpcC0+eDsK KyAgICAgICAgICAgICAgICAgICAgcl9jbGlwLm9yaWdpbi55ID0gcm93LT5jbGlwLT55OworICAg ICAgICAgICAgICAgICAgICByX2NsaXAuc2l6ZS53aWR0aCA9IHJvdy0+Y2xpcC0+d2lkdGg7Cisg ICAgICAgICAgICAgICAgICAgIHJfY2xpcC5zaXplLmhlaWdodCA9IHJvdy0+Y2xpcC0+aGVpZ2h0 OworICAgICAgICAgICAgICAgICAgICBOU1JlY3Qgcl9zYXZlOworICAgICAgICAgICAgICAgICAg ICByX3NhdmUub3JpZ2luLnggPSByWzBdLm9yaWdpbi54OworICAgICAgICAgICAgICAgICAgICBy X3NhdmUub3JpZ2luLnkgPSByWzBdLm9yaWdpbi55OworICAgICAgICAgICAgICAgICAgICByX3Nh dmUuc2l6ZS53aWR0aCA9IHJbMF0uc2l6ZS53aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgcl9z YXZlLnNpemUuaGVpZ2h0ID0gclswXS5zaXplLmhlaWdodDsKKyAgICAgICAgICAgICAgICAgICAg bWNfbnNfaW50ZXJzZWN0X3JlY3RhbmdsZXMgKCZyX3NhdmUsICZyX2NsaXAsICZyWzBdKTsKKyAg ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBOU1JlY3RDbGlwICgqcik7CisgICAg ICAgICAgICAgIH0KKyAgICAgICAgICByZXR1cm4gWUVTOworICAgICAgICB9CisgICAgICBlbHNl CisgICAgICAgIHsKKyAgICAgICAgICBOU1ZpZXcgKnZpZXcgPSBGUkFNRV9OU19WSUVXIChmKTsK KyAgICAgICAgICBpbnQgaTsKKyAgICAgICAgICBmb3IgKGkgPSAwIDsgaSA8IG4gOyBpKyspCisg ICAgICAgICAgICBbdmlldyBzZXROZWVkc0Rpc3BsYXlJblJlY3Q6cltpXV07CisgICAgICAgIH0K KyAgICB9CisgIHJldHVybiBOTzsKK30KKworc3RhdGljIHZvaWQKK21jX25zX2RyYXdfd2luZG93 X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBz dHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICBpbnQgeCwgaW50IGZ4LCBp bnQgeSwgaW50IGZ5LCBpbnQgaHBvcywgaW50IHZwb3MsIGludCB3ZCwgaW50IGgsCisgICAgICAg ICAgICAgICA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iKSwKKyAgICAgICAgICAgICAgICAgICAgICAoIU5J TFAgKGJhY2tncm91bmQpID8gU1NEQVRBIChiYWNrZ3JvdW5kKSA6ICJOSUxQIikpOworICAtICBF WEFNUExFIE9GIEhPVyBUTyBDUkVBVEUgQSBDT0xPUiBXSVRIIFJHQi9MU0wgZmxvYXQgdmFsdWVz OgorICAgICBOU0NvbG9yICpteV9jb2xvciA9IFtOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRS ZWQ6IDEuMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZ3JlZW46IDEuMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGJsdWU6IDEuMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgYWxwaGE6IDEuMF07CisgIC0gIEFMVEVSTkFUSVZFIEVYQU1QTEU6Cisg ICAgIGVudW0gZmFjZV9pZCBkZWJ1Z2dpbmdfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChz LT53LCBzLT5mLCBpbnRlcm4gKCIrLWRlYnVnZ2luZy1mYWNlIiksIHRydWUpOworICAgICBzdHJ1 Y3QgZmFjZSAqZGVidWdnaW5nX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGRlYnVnZ2luZ19m YWNlX2lkKTsKKyAgICAgTlNDb2xvciAqY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAo TlNfRkFDRV9GT1JFR1JPVU5EIChkZWJ1Z2dpbmdfZmFjZSksIHMtPmYpOworICAgICBbY29sb3Ig c2V0XTsgKi8KKyAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgfHwgZ2x5cGhf Zmxhdm9yID09IE1DX0dMWVBITEVTUykKKyAgICBbW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRl ZFJlZDogbHNsLnJlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVuOiBsc2wu Z3JlZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogbHNsLmJsdWUKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYTogMS4wXSBzZXRdOworICAgIGVsc2UK KyAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKGYpIHNldF07CisgIGlmIChjdXJzb3JfdHlwZSA9 PSBNQ19GUkFNRURfQk9YKQorICAgIHsKKyAgICAgIExpc3BfT2JqZWN0IGJ1ZiA9IHctPmNvbnRl bnRzOworICAgICAgQ0hFQ0tfQlVGRkVSIChidWYpOworICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9 IFhCVUZGRVIgKGJ1Zik7CisgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRy YW5zaWVudF9tYXJrX21vZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklM UCAoQlZBUiAoYiwgbWFya19hY3RpdmUpKSk7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZ2lu bmluZyA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9iZWdpbm5pbmcgKCkp IDogLTE7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2VuZCA9IChyZWdpb25fYWN0aXZlX3ApID8g WEZJWE5VTSAoRnJlZ2lvbl9lbmQgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3Qgb3BvaW50X3B0 ID0gKHcgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBYRklYTlVNIChGbWFy a2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pKTsKKyAgICAgIGJvb2wgcmVnaW9uX2luX2JvdW5kc19w ID0gKHJl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aWQgPSBsb29rdXBfbmFt ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXJlZ2lvbi1mYWNlIiks IHRydWUpOworICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX291 dF9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfZmFjZV9p ZCk7CisgICAgICAgICAgICBOU0NvbG9yICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfY29sb3Ig PSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3dfYWN0 aXZlX3JlZ2lvbl9vdXRfZmFjZSksIGYpOworICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9s bG93X2FjdGl2ZV9yZWdpb25fb3V0X2NvbG9yOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNl IGlmICghcmVnaW9uX2FjdGl2ZV9wICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVk X2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOwor ICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9N X0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICBOU0NvbG9yICpo b2xsb3dfYWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFD S0dST1VORCAoaG9sbG93X2FjdGl2ZV9mYWNlKSwgZik7CisgICAgICAgICAgICAgIGhvbGxvd19j b2xvciA9IGhvbGxvd19hY3RpdmVfY29sb3I7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAv KiBUaGUgcmVnaW9uIGlzIF9ub3RfIHZpc2libGUgaW4gdGhlIGluYWN0aXZlIHdpbmRvdyBiZWNh dXNlIHRoZSBvdmVybGF5IHdpbmRvdyBwcm9wZXJ0eSBpcyB1c2VkLiAqLworICAgICAgICAgICAg ZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZW51 bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1mYWNlIiksIHRydWUpOwor ICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0Vf RlJPTV9JRCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgIE5T Q29sb3IgKmhvbGxvd19pbmFjdGl2ZV9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChO U19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19pbmFjdGl2ZV9mYWNlKSwgZik7CisgICAgICAgICAg ICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2luYWN0aXZlX2NvbG9yOworICAgICAgICAgICAg ICB9CisgICAgfQorICAgIGVsc2UgaWYgKGZhY2UgJiYgTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNl KSA9PSBuc19pbmRleF9jb2xvciAoRlJBTUVfQ1VSU09SX0NPTE9SIChmKSwgZikpCisgICAgICB7 CisgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChm YWNlKSwgZikgc2V0XTsKKyAgICAgICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VSU09SX0NPTE9S IChmKTsKKyAgICAgIH0KKyNpZmRlZiBOU19JTVBMX0NPQ09BCisgIE5TRGlzYWJsZVNjcmVlblVw ZGF0ZXMgKCk7CisjZW5kaWYKKyAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICB7CisgICAgICBj YXNlIE1DX05PX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19O T19DVVJTT1I6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19SSUdIVF9GUklOR0VfQklU TUFQOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgor ICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICAgICAgTlNSZWN0 RmlsbCAocik7CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOgorICAg ICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAg ICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICBbRlJBTUVfQ1VS U09SX0NPTE9SIChmKSBzZXRdOworICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfSE9MTE9X X0JPWDoKKyAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIFtob2xsb3dfY29sb3Igc2V0 XTsKKyAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAg W0ZSQU1FX0NVUlNPUl9DT0xPUiAoZikgc2V0XTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNl IE1DX0hCQVI6CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBicmVhazsKKyAgICAg IGNhc2UgTUNfQkFSOgorICAgICAgICBzID0gcjsKKyAgICAgICAgLyogQGxhd2xpc3QgaXMgZm9j dXNpbmcgdGhlIGluaXRpYWwgZGV2ZWxvcG1lbnQgb2YgZmVhdHVyZSByZXF1ZXN0cworICAgICAg ICAjMTc2ODQgYW5kICMyMjg3MyBvbiBMMlIgbGFuZ3VhZ2VzLiAqLworICAgICAgICBpZiAoZ2x5 cGhfZmxhdm9yICE9IE1DX0dMWVBICisgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNf R0xZUEhMRVNTKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIElmIHRoZSBjaGFyYWN0ZXIg dW5kZXIgY3Vyc29yIGlzIFIyTCwgZHJhdyB0aGUgYmFyIGN1cnNvcgorICAgICAgICAgICAgICAg b24gdGhlIHJpZ2h0IG9mIGl0cyBnbHlwaCwgcmF0aGVyIHRoYW4gb24gdGhlIGxlZnQuICAqLwor ICAgICAgICAgICAgaWYgKChjdXJzb3JfZ2x5cGgtPnJlc29sdmVkX2xldmVsICYgMSkgIT0gMCkK KyAgICAgICAgICAgICAgcy5vcmlnaW4ueCArPSBjdXJzb3JfZ2x5cGgtPnBpeGVsX3dpZHRoIC0g cy5zaXplLndpZHRoOworICAgICAgICAgIH0KKyAgICAgICAgTlNSZWN0RmlsbCAocyk7CisgICAg ICAgIGJyZWFrOworICAgIH0KKyAgbnNfcmVzZXRfY2xpcHBpbmcgKGYpOworICAvKiBkcmF3IHRo ZSBjaGFyYWN0ZXIgdW5kZXIgdGhlIGN1cnNvciAqLworICBpZiAoZ2x5cGhfZmxhdm9yICE9IE1D X0dMWVBITEVTUworICAgICAgJiYgKGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gKKyAgICAg ICAgICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YCisgICAgICAgICAgfHwgY3Vyc29y X3R5cGUgPT0gTUNfSE9MTE9XX0JPWAorICAgICAgICAgIHx8IChkZWJ1Z19wCisgICAgICAgICAg ICAgICYmIGN1cnNvcl90eXBlID09IE1DX0hCQVIpCisgICAgICAgICAgfHwgK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or ICAgIHJldHVybjsKKyAgLyogRG8gdW5kZXJsaW5lLiAqLworICBpZiAoZmFjZS0+dW5kZXJsaW5l X3ApCisgICAgeworICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5E RVJfV0FWRSkKKyAgICAgICAgeworICAgICAgICAgIGlmIChmYWNlLT51bmRlcmxpbmVfZGVmYXVs dGVkX3ApCisgICAgICAgICAgICBbZGVmYXVsdENvbCBzZXRdOworICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoZmFjZS0+dW5kZXJsaW5lX2NvbG9y LCBzLT5mKSBzZXRdOworICAgICAgICAgIG5zX2RyYXdfdW5kZXJ3YXZlIChzLCB3aWR0aCwgeCk7 CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZB Q0VfVU5ERVJfTElORSkKKyAgICAgICAgeworICAgICAgICAgIE5TUmVjdCByOworICAgICAgICAg IHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAgICAgICAgICAvKiBJZiB0aGUg cHJldiB3YXMgdW5kZXJsaW5lZCwgbWF0Y2ggaXRzIGFwcGVhcmFuY2UuICovCisgICAgICAgICAg aWYgKHMtPnByZXYgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3AKKyAgICAgICAgICAgICAg JiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FCisgICAg ICAgICAgICAgICYmIHMtPnByZXYtPnVuZGVybGluZV90aGlja25lc3MgPiAwKQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICB0aGlja25lc3MgPSBzLT5wcmV2LT51bmRlcmxpbmVfdGhpY2tu ZXNzOworICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlv bjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIHN0cnVjdCBmb250ICpmb250OworICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIGRl c2NlbnQ7CisgICAgICAgICAgICAgIGZvbnQ9cy0+Zm9udDsKKyAgICAgICAgICAgICAgZGVzY2Vu dCA9IHMtPnkgKyBzLT5oZWlnaHQgLSBzLT55YmFzZTsKKyAgICAgICAgICAgICAgLyogVXNlIHVu ZGVybGluZSB0aGlja25lc3Mgb2YgZm9udCwgZGVmYXVsdGluZyB0byAxLiAqLworICAgICAgICAg ICAgICB0aGlja25lc3MgPSAoZm9udCAmJiBmb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkK KyAgICAgICAgICAgICAgICA/IGZvbnQtPnVuZGVybGluZV90aGlja25lc3MgOiAxOworICAgICAg ICAgICAgICAvKiBEZXRlcm1pbmUgdGhlIG9mZnNldCBvZiB1bmRlcmxpbmluZyBmcm9tIHRoZSBi YXNlbGluZS4gKi8KKyAgICAgICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRfbGlu ZSkKKyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGRlc2NlbnQgLSB0aGlja25lc3M7CisgICAg ICAgICAgICAgIGVsc2UgaWYgKHhfdXNlX3VuZGVybGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVzCisg ICAgICAgICAgICAgICAgICAgICAgICYmIGZvbnQgJiYgZm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9u ID49IDApCisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBmb250LT51bmRlcmxpbmVfcG9zaXRp b247CisgICAgICAgICAgICAgIGVsc2UgaWYgKGZvbnQpCisgICAgICAgICAgICAgICAgcG9zaXRp b24gPSBscm91bmQgKGZvbnQtPmRlc2NlbnQgLyAyKTsKKyAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgIHBvc2l0aW9uID0gdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0OworICAgICAg ICAgICAgICBwb3NpdGlvbiA9IG1heCAocG9zaXRpb24sIHVuZGVybGluZV9taW5pbXVtX29mZnNl dCk7CisgICAgICAgICAgICAgIC8qIEVuc3VyZSB1bmRlcmxpbmluZyBpcyBub3QgY3JvcHBlZC4g Ki8KKyAgICAgICAgICAgICAgaWYgKGRlc2NlbnQgPD0gcG9zaXRpb24pCisgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNjZW50IC0gMTsKKyAgICAgICAg ICAgICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICBlbHNlIGlmIChkZXNjZW50IDwgcG9zaXRpb24gKyB0aGlja25lc3MpCisgICAgICAgICAgICAg ICAgdGhpY2tuZXNzID0gMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBzLT51bmRlcmxpbmVf dGhpY2tuZXNzID0gdGhpY2tuZXNzOworICAgICAgICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9 IHBvc2l0aW9uOworICAgICAgICAgIHIgPSBOU01ha2VSZWN0ICh4LCBzLT55YmFzZSArIHBvc2l0 aW9uLCB3aWR0aCwgdGhpY2tuZXNzKTsKKyAgICAgICAgICBpZiAoZmFjZS0+dW5kZXJsaW5lX2Rl ZmF1bHRlZF9wKQorICAgICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAgICBlbHNl CisgICAgICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZhY2UtPnVuZGVybGluZV9j b2xvciwgcy0+Zikgc2V0XTsKKyAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgfQor ICAgIH0KKyAgLyogRG8gb3ZlcmxpbmUuIFdlIGZvbGxvdyBvdGhlciB0ZXJtcyBpbiB1c2luZyBh IHRoaWNrbmVzcyBvZiAxCisgICAgIGFuZCBpZ25vcmluZyBvdmVybGluZV9tYXJnaW4uICovCisg IGlmIChmYWNlLT5vdmVybGluZV9wKQorICAgIHsKKyAgICAgIE5TUmVjdCByOworICAgICAgciA9 IE5TTWFrZVJlY3QgKHgsIHMtPnksIHdpZHRoLCAxKTsKKyAgICAgIGlmIChmYWNlLT5vdmVybGlu ZV9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgIGVs c2UKKyAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChmYWNlLT5vdmVybGluZV9jb2xv ciwgcy0+Zikgc2V0XTsKKyAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgIH0KKyAgLyogRG8gc3Ry aWtlLXRocm91Z2guICBXZSBmb2xsb3cgb3RoZXIgdGVybXMgZm9yIHRoaWNrbmVzcyBhbmQKKyAg ICAgdmVydGljYWwgcG9zaXRpb24uKi8KKyAgaWYgKGZhY2UtPnN0cmlrZV90aHJvdWdoX3ApCisg ICAgeworICAgICAgTlNSZWN0IHI7CisgICAgICB1bnNpZ25lZCBsb25nIGR5OworICAgICAgZHkg PSBscmludCAoKHMtPmhlaWdodCAtIDEpIC8gMik7CisgICAgICByID0gTlNNYWtlUmVjdCAoeCwg cy0+eSArIGR5LCB3aWR0aCwgMSk7CisgICAgICBpZiAoZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29s b3JfZGVmYXVsdGVkX3ApCisgICAgICAgIFtkZWZhdWx0Q29sIHNldF07CisgICAgICBlbHNlCisg ICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29s b3IsIHMtPmYpIHNldF07CisgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICB9Cit9CisKK3N0YXRp YyB2b2lkCittY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2ggKHN0cnVjdCBnbHlwaF9zdHJpbmcg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tPnJvdy0+ZnVsbF93aWR0aF9wKQorICAg ICAgICAgICAgeworICAgICAgICBpbnQgb3ZlcnJ1biwgbGVmdG92ZXJydW47CisgICAgICAgICAg ICAgIC8qIHRydW5jYXRlIHRvIGF2b2lkIG92ZXJ3cml0aW5nIGZyaW5nZSBhbmQvb3Igc2Nyb2xs YmFyICovCisgICAgICAgIG92ZXJydW4gPSBtYXggKDAsIChzLT54ICsgcy0+YmFja2dyb3VuZF93 aWR0aCkKKyAgICAgICAgICAgLSAoV0lORE9XX0JPWF9SSUdIVF9FREdFX1ggKHMtPncpCisgICAg ICAgIC0gV0lORE9XX1JJR0hUX0ZSSU5HRV9XSURUSCAocy0+dykpKTsKKyAgICAgICAgICAgICAg cltpXS5zaXplLndpZHRoIC09IG92ZXJydW47CisgICAgICAgIC8qIHRydW5jYXRlIHRvIGF2b2lk IG92ZXJ3cml0aW5nIHRvIGxlZnQgb2YgdGhlIHdpbmRvdyBib3ggKi8KKyAgICAgICAgbGVmdG92 ZXJydW4gPSAoV0lORE9XX0JPWF9MRUZUX0VER0VfWCAocy0+dykKKyAgICAgICAgICAgKyBXSU5E T1dfTEVGVF9GUklOR0VfV0lEVEggKHMtPncpKSAtIHMtPng7CisgICAgICAgIGlmIChsZWZ0b3Zl cnJ1biA+IDApCisgICAgICAgICAgeworICAgICAgICAgICAgcltpXS5vcmlnaW4ueCArPSBsZWZ0 b3ZlcnJ1bjsKKyAgICAgICAgICAgIHJbaV0uc2l6ZS53aWR0aCAtPSBsZWZ0b3ZlcnJ1bjsKKyAg ICAgICAgICB9CisgICAgICAgICAgICAgIC8qIFhYWDogVHJ5IHRvIHdvcmsgYmV0d2VlbiBwcm9i bGVtIHdoZXJlIGEgc3RyZXRjaCBnbHlwaCBvbgorICAgICAgICAgICAgICAgICBhIHBhcnRpYWxs eS12aXNpYmxlIGJvdHRvbSByb3cgd2lsbCBjbGVhciBwYXJ0IG9mIHRoZQorICAgICAgICAgICAg ICAgICBtb2RlbGluZSwgYW5k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ZWln aHQgLT0gMTsKKyAgICAgICAgICAgICAgLy8gIGVudW0gZmFjZV9pZCBkZWJ1Z2dpbmdfZmFjZV9p ZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBpbnRlcm4gKCIrLWRlYnVnZ2luZy1m YWNlIiksIHRydWUpOworICAgICAgICAgICAgICAvLyAgc3RydWN0IGZhY2UgKmRlYnVnZ2luZ19m YWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBkZWJ1Z2dpbmdfZmFjZV9pZCk7CisgICAgICAgICAg ICAgIC8vICBOU0NvbG9yICpjb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNF X0ZPUkVHUk9VTkQgKGRlYnVnZ2luZ19mYWNlKSwgcy0+Zik7CisgICAgICAgICAgICAgIC8vICBb Y29sb3Igc2V0XTsKKyAgICAgICAgICAgICAgQ0dGbG9hdCB4ID0gcltpXS5vcmlnaW4ueDsKKyAg ICAgICAgICAgICAgQ0dGbG9hdCB3aWR0aCA9IHdkOworICAgICAgICAgICAgICByW2ldLnNpemUu d2lkdGggLT0gd2lkdGg7CisgICAgICAgICAgICAgIHJbaV0ub3JpZ2luLnggKz0gd2lkdGg7Cisg ICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHJbaV0pOworICAgICAgICAgICAgICAvKiBEcmF3IG92 ZXJsaW5pbmcsIGV0Yy4gb24gdGhlIGN1cnNvci4gKi8KKyAgICAgICAgICAgICAgaWYgKHMtPnct PnBoeXNfY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVEX0JPWCkKKyAgICAgICAgICAgICAgICBtY19u c19kcmF3X3RleHRfZGVjb3JhdGlvbiAocywgZmFjZSwgYmdDb2wsIHdpZHRoLCB4KTsKKyAgICAg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBtY19uc19kcmF3X3RleHRfZGVjb3Jh dGlvbiAocywgZmFjZSwgZmdDb2wsIHdpZHRoLCB4KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAg ICBlbHNlCisgICAgICAgICAgICB7CisgIC8vICBpbnQgcnggPSByW2ldLm9yaWdpbi54OworICAv LyAgaW50IHJ5ID0gcltpXS5vcmlnaW4ueTsKKyAgLy8gIGludCBydyA9IHJbaV0uc2l6ZS53aWR0 aDsKKyAgLy8gIGludCByaCA9IHJbaV0uc2l6ZS5oZWlnaHQ7CisgIC8vICBmcHJpbnRmIChzdGRl cnIsICJtY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2g6ICB2cG9zICglZCkgfCByeCAoJWQpIHwgcnkg KCVkKSB8IHJ3ICglZCkgfCByaCAoJWQpXG4iLAorICAvLyAgICAgICAgICAgICAgICAgICBzLT5m aXJzdF9nbHlwaC0+dnBvcywgcngsIHJ5LCBydywgcmgpOworICAgICAgICAgICAgICBOU1JlY3RG aWxsIChyW2ldKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAvKiBEcmF3IG92ZXJsaW5pbmcs IGV0Yy4gb24gdGhlIHN0cmV0Y2ggZ2x5cGggKG9yIHRoZSBwYXJ0CisgICAgICAgICAgICAgb2Yg dGhlIHN0cmV0Y2ggZ2x5cGggYWZ0ZXIgdGhlIGN1cnNvcikuICovCisgICAgICAgICAgbWNfbnNf ZHJhd190ZXh0X2RlY29yYXRpb24gKHMsIGZhY2UsIGZnQ29sLCByW2ldLnNpemUud2lkdGgsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJbaV0ub3JpZ2luLngpOworICAg ICAgICB9CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBzLT5iYWNrZ3Jv dW5kX2ZpbGxlZF9wID0gMTsKKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkCittY19uc19kdW1wZ2x5 cGhzX2ltYWdlIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzLCBOU1JlY3Qgciwgc3RydWN0IG1jX1JH QiBsc2wsCisgICAgICAgICAgICAgICAgICA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0Vf Rk9SRUdST1VORCAoZmFjZSksIHMtPmYpOworICAgIH0KKyAgLyogRHJhdyB1bmRlcmxpbmUsIG92 ZXJsaW5lLCBzdHJpa2UtdGhyb3VnaC4gKi8KKyAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24g KHMsIGZhY2UsIHRkQ29sLCBici5zaXplLndpZHRoLCBici5vcmlnaW4ueCk7CisgIC8qIERyYXcg cmVsaWVmLCBpZiByZXF1ZXN0ZWQgKi8KKyAgaWYgKHMtPmltZy0+cmVsaWVmIHx8IHMtPmhsID09 RFJBV19JTUFHRV9SQUlTRUQgfHwgcy0+aGwgPT1EUkFXX0lNQUdFX1NVTktFTikKKyAgICB7Cisg ICAgICBpZiAocy0+aGwgPT0gRFJBV19JTUFHRV9TVU5LRU4gfHwgcy0+aGwgPT0gRFJBV19JTUFH RV9SQUlTRUQpCisgICAgICAgIHsKKyAgICAgICAgICB0aCA9IHRvb2xfYmFyX2J1dHRvbl9yZWxp ZWYgPj0gMCA/CisgICAgICAgICAgICB0b29sX2Jhcl9idXR0b25fcmVsaWVmIDogREVGQVVMVF9U T09MX0JBUl9CVVRUT05fUkVMSUVGOworICAgICAgICAgIHJhaXNlZF9wID0gKHMtPmhsID09IERS QVdfSU1BR0VfUkFJU0VEKTsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAgICB7CisgICAg ICAgICAgdGggPSBhYnMgKHMtPmltZy0+cmVsaWVmKTsKKyAgICAgICAgICByYWlzZWRfcCA9IChz LT5pbWctPnJlbGllZiA+IDApOworICAgICAgICB9CisgICAgICByLm9yaWdpbi54ID0geCAtIHRo OworICAgICAgci5vcmlnaW4ueSA9IHkgLSB0aDsKKyAgICAgIHIuc2l6ZS53aWR0aCA9IHMtPnNs aWNlLndpZHRoICsgMip0aC0xOworICAgICAgci5zaXplLmhlaWdodCA9IHMtPnNsaWNlLmhlaWdo dCArIDIqdGgtMTsKKyAgICAgIG5zX2RyYXdfcmVsaWVmIChyLCB0aCwgcmFpc2VkX3AsCisgICAg ICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueSA9PSAwLAorICAgICAgICAgICAgICAgICAgICAg IHMtPnNsaWNlLnkgKyBzLT5zbGljZS5oZWlnaHQgPT0gcy0+aW1nLT5oZWlnaHQsCisgICAgICAg ICAgICAgICAgICAgICAgcy0+c2xpY2UueCA9PSAwLAorICAgICAgICAgICAgICAgICAgICAgIHMt PnNsaWNlLnggKyBzLT5zbGljZS53aWR0aCA9PSBzLT5pbWctPndpZHRoLCBzKTsKKyAgICB9Cisg IC8qIElmIHRoZXJlIGlzIG5vIG1hc2ssIHRoZSBiYWNrZ3JvdW5kIHdvbid0IGJlIHNlZW4sCisg ICAgIHNvIGRyYXcgYSByZWN0YW5nbGUgb24gdGhlIGltYWdlIGZvciB0aGUgY3Vyc29yLgorICAg ICBEbyB0aGlzIGZvciBhbGwgaW1hZ2VzLCBnZXR0aW5nIHRyYW5zcGFyZW5jeSByaWdodCBpcyBu b3QgcmVsaWFibGUuICAqLworICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IpCisgICAgeworICAg ICAgaW50IHRoaWNrbmVzcyA9IGFicyAocy0+aW1nLT5yZWxpZWYpOworICAgICAgaWYgKHRoaWNr bmVzcyA9PSAwKSB0aGlja25lc3MgPSAxOworICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfR0xZ UEgKKyAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBITEVTUykKKyAgICAgIHsKKyAg ICAgICAgTlNDb2xvciAqYm9yZGVyX2NvbG9yID0gW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRl ZFJlZDogbHNsLnJlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGdyZWVuOiBsc2wuZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogbHNsLmJsdWUKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBo YTogMS4wXTsKKyAgICAgICAgbnNfZHJhd19ib3ggKGJyLCB0aGlja25lc3MsIGJvcmRlcl9jb2xv ciwgMSwgMSk7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIG5zX2RyYXdfYm94IChiciwg dGhpY2tuZXNzLCBGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpLCAxLCAxKTsKKyAgICB9Cit9CisK K3N0YXRpYyB2b2lkCittY19uc19vdmVyd3JpdHRlbl9oZWxwZXIgKHN0cnVjdCBnbHlwaF9zdHJp bmcgKnMsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93LCBlbnVtIHR5cGVfb2ZfY2FjaGUgY2FjaGVfdHlw ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaCkKK3sKKyAg Ly8gbnNfZHJhd191bmRlcndhdmUgKHMsIHMtPndpZHRoLCBzLT54KTsKKyAgTlNDb2xvciAqaG9s bG93X2NvbG9yID0gRlJBTUVfQkFDS0dST1VORF9DT0xPUiAocy0+Zik7CisgIHN0cnVjdCBmYWNl ICpmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBERUZBVUxUX0ZBQ0VfSUQpOworICBpbnQgcm93 X3Zwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgc3RydWN0IG11bHRpcGxl X2N1cnNvcnNfY2FjaGUgZm9vX2VsdHM7CisgIHN3aXRjaCAoY2FjaGVfdHlwZSkKKyAgICB7Cisg ICAgICBjYXNlIE5PX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgYnJlYWs7CisgICAgICAg IH0KKyAgICAgIGNhc2UgTUNfQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBmb29fZWx0cy5j YWNoZXMgPSBzLT53LT5tY19lbHRzLmNhY2hlczsKKyAgICAgICAgICBmb29fZWx0cy5hbGxvY2F0 ZWQgPSBzLT53LT5tY19lbHRzLmFsbG9jYXRlZDsKKyAgICAgICAgICBmb29fZWx0cy51c2VkID0g cy0+dy0+bWNfZWx0cy51c2VkOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBj YXNlIENIX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgZm9vX2VsdHMuY2FjaGVzID0gcy0+ dy0+Y2hfZWx0cy5jYWNoZXM7CisgICAgICAgICAgZm9vX2VsdHMuYWxsb2NhdGVkID0gcy0+dy0+ Y2hfZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgZm9vX2VsdHMudXNlZCA9IHMtPnctPmNoX2Vs dHMudXNlZDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBGQ19DQUNI RToKKyAgICAgICAgeworICAgICAgICAgIGZvb19lbHRzLmNhY2hlcyA9IHMtPnctPmZjX2VsdHMu Y2FjaGVzOworICAgICAgICAgIGZvb19lbHRzLmFsbG9jYXRlZCA9IHMtPnctPmZjX2VsdHMuYWxs b2NhdGVkOworICAgICAgICAgIGZvb19lbHRzLnVzZWQgPSBzLT53LT5mY19lbHRzLnVzZWQ7Cisg ICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisgIC8qIFNUUkVUQ0hfR0xZUEggbWF5 IGNvbnRhaW4gbW9yZSB0aGFuIG9uZSBmYWtlIGN1cnNvciBhdCB0aGUgc2FtZSBIUE9TLiAqLwor ICBmb3IgKGludCBlbHQgPSAwOyBlbHQgPCBmb29fZWx0cy51c2VkOyArK2VsdCkKKyAgICB7Cisg ICAgICBpbnQgeCA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLng7CisgICAgICBpbnQgZnggPSBmb29f ZWx0cy5jYWNoZXNbZWx0XS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bHRdLmJh Y2tncm91bmQuYmx1ZX07CisgICAgICBib29sIGFjdGl2ZV9wID0gZm9vX2VsdHMuY2FjaGVzW2Vs dF0uYWN0aXZlX3A7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBmb29fZWx0 cy5jYWNoZXNbZWx0XS5nbHlwaF9mbGF2b3I7CisgICAgICBib29sIGVuYWJsZWRfcCA9IGZvb19l bHRzLmNhY2hlc1tlbHRdLmVuYWJsZWRfcDsKKyAgICAgIGJvb2wgZ29fcCA9ICh2cG9zID09IHJv d192cG9zCisgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA9PSBnbHlwaC0+aHBvcworICAgICAg ICAgICAgICAgICAgICYmIGVuYWJsZWRfcCk7CisgICAgICBpZiAoIWdvX3ApCisgICAgICAgIGNv bnRpbnVlOworICAgICAgTlNSZWN0IHI7CisgICAgICByLm9yaWdpbi54ID0gZng7CisgICAgICBy Lm9yaWdpbi55ID0gZnk7CisgICAgICByLnNpemUuaGVpZ2h0ID0gaDsKKyAgICAgIHIuc2l6ZS53 aWR0aCA9IHdkOworICAgICAgW1tOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IGxzbF9m Zy5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVuOiBsc2xfZmcuZ3Jl ZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiBsc2xfZmcuYmx1ZQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF0gc2V0XTsKKyAgaWYg KGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gpCisgICAgeworICAgICAgTGlzcF9PYmplY3Qg YnVmID0gcy0+dy0+Y29udGVudHM7CisgICAgICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgICAgICBz dHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgICAgIGJvb2wgcmVnaW9uX2FjdGl2 ZV9wID0gKCFOSUxQIChWdHJhbnNpZW50X21hcmtfbW9kZSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBtYXJrX2FjdGl2ZSkpKTsKKyAgICAgIHB0cmRp ZmZfdCByZWdpb25fYmVnaW5uaW5nID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBYRklYTlVNIChGcmVn aW9uX2JlZ2lubmluZyAoKSkgOiAtMTsKKyAgICAgIHB0cmRpZmZfdCByZWdpb25fZW5kID0gKHJl Z2lvbl9hY3RpdmVfcCkgPyBYRklYTlVNIChGcmVnaW9uX2VuZCAoKSkgOiAtMTsKKyAgICAgIHB0 cmRpZmZfdCBvcG9pbnRfcHQgPSAocy0+dyA9PSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUFQKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IFhGSVhOVU0gKEZtYXJrZXJfcG9zaXRpb24gKHMtPnctPnBvaW50bSkpOworICAgICAg Ym9vbCByZWdpb25faW5fYm91bmRzX3AgPSAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfcHQgPj0gcmVnaW9uX2JlZ2lubmluZworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3B0IDwgcmVnaW9uX2VuZCk7 CisgICAgICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgJiYgcmVnaW9uX2luX2JvdW5k c19wCisgICAgICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgIHsKKyAgICAgICAgICBlbnVtIGZh Y2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChz LT53LCBzLT5mLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1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FsLWZha2UtY3Vyc29yLWluYWN0aXZlLWZhY2UiKSwg dHJ1ZSk7CisgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2ZV9mYWNl ID0gRkFDRV9GUk9NX0lEIChzLT5mLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAg ICAgICAgICAgTlNDb2xvciAqaG9sbG93X2luYWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2luZGV4 ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2luYWN0aXZlX2ZhY2UpLCBzLT5m KTsKKyAgICAgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xsb3dfaW5hY3RpdmVfY29sb3I7 CisgICAgICAgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAoZmFjZSAmJiBOU19GQUNFX0JB Q0tHUk9VTkQgKGZhY2UpID09IG5zX2luZGV4X2NvbG9yIChGUkFNRV9DVVJTT1JfQ09MT1IgKHMt PmYpLCBzLT5mKSkKKyAgICAgIHsKKyAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChO U19GQUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBzLT5mKSBzZXRdOworICAgICAgICBob2xsb3dfY29s b3IgPSBGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpOworICAgICAgfQorICAgICAgc3dpdGNoIChj dXJzb3JfdHlwZSkKKyAgICAgICAgeworICAgICAgICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1B UDoKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgorICAg ICAgICAgICAgYnJlYWs7CisgICAgICAgICAgY2FzZSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOgor ICAgICAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAgICAgICAgIGNhc2UgTUNf RklMTEVEX0JPWDoKKyAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgYnJl YWs7CisgICAgICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOgorICAgICAgICAgICAgTlNSZWN0Rmls bCAocik7CisgICAgICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAgICAgICAgICBOU1Jl Y3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICAgICAgW0ZSQU1FX0NVUlNP Ul9DT0xPUiAocy0+Zikgc2V0XTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2Ug TUNfSE9MTE9XX0JPWDoKKyAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAg W2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3Qg KHIsIDEsIDEpKTsKKyAgICAgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpIHNldF07 CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAgICAg ICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgTUNf QkFSOgorICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICBicmVhazsKKyAg ICAgICAgfQorICAgICAgLyogSWYgYSBnbHlwaCBleGlzdHMgKHMtPmNoYXIyYiAhPSBOVUxMKSwg dGhlbiBkcmF3IHRoZSBnbHlwaCBvbiB0b3Agb2YgdGhlCisgICAgICBuZXdseSBkcmF3biByZWN0 YW5nbGUgdGhhdCB3YXMgY3JlYXRlZCBoZXJlaW5hYm92ZS4gIFRvIHRoZSBleHRlbnQgdGhhdCB3 ZQorICAgICAgd2FudCB0byBkb3VibGUtaW1wcmludCBnbHlwaHMgdG8gbWFrZSB0aGVtIGFwcGVh ciB0byBiZSBzZW1pLWJvbGQsIGl0IGNhbgorICAgICAgYmUgZG9uZSBoZXJlIGZvciBhbGwgY3Vy c29yIHR5cGVzLiAgVGhlIGJveC1zdHlsZSBjdXJzb3JzIGFyZSBpbXByaW50ZWQKKyAgICAgIHdp dGggZ2x5cGhzIG9ubHkgb25lICgxKSB0aW1lLiAgVGhlIHNlbWktYm9sZCBhcHBlYXJhbmNlIGlz IGhlbHBmdWwgd2hlbgorICAgICAgZGVidWdnaW5nIHRvIHNlZSB0aGF0IHRoZSBjb29yZGluYXRl cyBhcmUgY29ycmVjdC4gKi8KKyAgICAgIGlmIChzLT5jaGFyMmIgIT0gTlVMTAorICAgICAgICAg ICYmIChjdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YCisgICAgICAgICAgICAgIHx8IGN1cnNv cl90eXBlID09IE1DX0ZSQU1FRF9CT1gKKyAgICAgICAgICAgICAgfHwgY3Vyc29yX3R5cGUgPT0g TUNfSE9MTE9XX0JPWCkpCisgICAgICAgIHsKKyAgICAgICAgICBCT09MIGlzQ29tcG9zaXRlID0g cy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIOworICAgICAgICAgIGlmIChp c0NvbXBvc2l0ZSkKKyAgICAgICAgICAgIG5zX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19m b3JlZ3JvdW5kIChzKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgIHN0cnVjdCBmb250ICpmb250ID0gcy0+ZmFjZS0+Zm9udDsKKyAgICAgICAgICAg ICAgICBpZiAoIWZvbnQpCisgICAgICAgICAgICAgICAgICBmb250ID0gRlJBTUVfRk9OVCAocy0+ Zik7CisgICAgICAgICAgICAgICAgYm9vbCB3aXRoX2JnX3AgPSBmYWxzZTsKKyAgICAgICAgICAg ICAgICBmb250LT5kcml2ZXItPmRyYXcgKHMsIHMtPmNtcF9mcm9tLCBzLT5uY2hhcnMsIHMtPngs IHM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seXBoc19iYWNrZ3JvdW5kIik7 CisgIGlmICghcy0+YmFja2dyb3VuZF9maWxsZWRfcC8qIHx8IHMtPmhsID09IERSQVdfTU9VU0Vf RkFDRSovKQorICAgIHsKKyAgICAgIGludCBib3hfbGluZV93aWR0aCA9IG1heCAocy0+ZmFjZS0+ Ym94X2xpbmVfd2lkdGgsIDApOworICAgICAgaWYgKEZPTlRfSEVJR0hUIChzLT5mb250KSA8IHMt PmhlaWdodCAtIDIgKiBib3hfbGluZV93aWR0aAorICAgICAgICAgIC8qIFdoZW4geGRpc3AuYyBp Z25vcmVzIEZPTlRfSEVJR0hULCB3ZSBjYW5ub3QgdHJ1c3QgZm9udAorICAgICAgICAgICAgIGRp bWVuc2lvbnMsIHNpbmNlIHRoZSBhY3R1YWwgZ2x5cGhzIG1pZ2h0IGJlIG11Y2gKKyAgICAgICAg ICAgICBzbWFsbGVyLiAgU28gaW4gdGhhdCBjYXNlIHdlIGFsd2F5cyBjbGVhciB0aGUgcmVjdGFu Z2xlCisgICAgICAgICAgICAgd2l0aCBiYWNrZ3JvdW5kIGNvbG9yLiAgKi8KKyAgICAgICAgICB8 fCBGT05UX1RPT19ISUdIIChzLT5mb250KQorICAgICAgICAgIHx8IHMtPmZvbnRfbm90X2ZvdW5k X3AgfHwgcy0+ZXh0ZW5kc190b19lbmRfb2ZfbGluZV9wIHx8IGZvcmNlX3ApCisgICAgICB7Cisg ICAgICAgICAgc3RydWN0IGZhY2UgKmZhY2U7CisgICAgICAgICAgaWYgKHMtPmhsID09IERSQVdf TU9VU0VfRkFDRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZmFjZSA9IEZBQ0VfRlJP TV9JRCAocy0+ZiwKKyAgICAgICAgICAgTU9VU0VfSExfSU5GTyAocy0+ZiktPm1vdXNlX2ZhY2Vf ZmFjZV9pZCk7CisgICAgICAgICAgICAgIGlmICghZmFjZSkKKyAgICAgICAgICAgICAgICBmYWNl ID0gRkFDRV9GUk9NX0lEIChzLT5mLCBNT1VTRV9GQUNFX0lEKTsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgICBlbHNlCisgICAgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBzLT5m aXJzdF9nbHlwaC0+ZmFjZV9pZCk7CisgICAgICAgICAgaWYgKCFmYWNlLT5zdGlwcGxlKQorICAg ICAgICAgICAgWyhOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpICE9IDAKKyAgICAgICAgICAgICAg PyBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSwgcy0+ ZikKKyAgICAgICAgICAgICAgOiBGUkFNRV9CQUNLR1JPVU5EX0NPTE9SIChzLT5mKSkgc2V0XTsK KyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHN0cnVjdCBuc19k aXNwbGF5X2luZm8gKmRweWluZm8gPSBGUkFNRV9ESVNQTEFZX0lORk8gKHMtPmYpOworICAgICAg ICAgICAgICBbW2RweWluZm8tPmJpdG1hcHNbZmFjZS0+c3RpcHBsZS0xXS5pbWcgc3RpcHBsZU1h c2tdIHNldF07CisgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKHMtPmhsICE9IERSQVdfQ1VS U09SKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzLT5yZWN0YW5nbGVfbnVrZWRfcCA9 IHRydWU7CisgICAgICAgICAgICAgIE5TUmVjdCByID0gTlNNYWtlUmVjdCAocy0+eCwgcy0+eSAr IGJveF9saW5lX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+ YmFja2dyb3VuZF93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMt PmhlaWdodC0yKmJveF9saW5lX3dpZHRoKTsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7 CisgICAgICAgICAgICB9CisgICAgcy0+YmFja2dyb3Vu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CisgIGlmIChzLT5uZXh0ICYmIHMtPnJpZ2h0X292ZXJoYW5nICYmICFzLT5mb3Jfb3Zlcmxh cHMpCisgICAgeworICAgICAgaW50IHdpZHRoOworICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAq bmV4dDsKKyAgICAgIGZvciAod2lkdGggPSAwLCBuZXh0ID0gcy0+bmV4dDsKKyAgICAgICAgICAg bmV4dCAmJiB3aWR0aCA8IHMtPnJpZ2h0X292ZXJoYW5nOworICAgICAgICAgICB3aWR0aCArPSBu ZXh0LT53aWR0aCwgbmV4dCA9IG5leHQtPm5leHQpCisgICAgICAgIGlmIChuZXh0LT5maXJzdF9n bHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpZiAo bmV4dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkKKyAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocy0+ bmV4dCwgcik7CisgICAgICAgICAgICAgICAgaWYgKCFtY19uc19jbGlwX3RvX3JlY3QgKHMtPmYs IHIsIG4sIHJvdykpCisgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAg bWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLT5uZXh0LCAxKTsKKyAgICAgICAg ICAgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIG1jX25zX2R1bXBn bHlwaHNfc3RyZXRjaCAocy0+bmV4dCwgd2QsIHJvdyk7CisgICAgICAgICAgICAgICAgaWYgKChz LT5uZXh0LT5sZWZ0X292ZXJ3cml0dGVuX3AgfHwgcy0+bmV4dC0+cmlnaHRfb3ZlcndyaXR0ZW5f cCkKKyAgICAgICAgICAgICAgICAgICAgJiYgcy0+bmV4dC0+YWN0aW9uX3R5cGUgPT0gTUNfRFJB V19HTFlQSCkKKyAgICAgICAgICAgICAgICAgIG1jX25zX2RyYXdfb3ZlcndyaXR0ZW4gKHMtPm5l eHQsIG1hdHJpeCwgcm93LCBzLT5uZXh0LT5maXJzdF9nbHlwaCk7CisgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgfQorICAgIH0KKyAg aWYgKCFzLT5mb3Jfb3ZlcmxhcHMgJiYgcy0+ZmFjZS0+Ym94ICE9IEZBQ0VfTk9fQk9YCisgICAg ICAmJiAocy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgIHx8IHMt PmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCkpCisgICAgeworICAgICAgbiA9 IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICghbWNfbnNf Y2xpcF90b19yZWN0IChzLT5mLCByLCBuLCByb3cpKQorICAgICAgICByZXR1cm47CisgICAgICBt Y19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQgKHMsIDEpOworICAgICAgbnNfZHVtcGds eXBoc19ib3hfb3JfcmVsaWVmIChzKTsKKyAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChzLT5mKTsK KyAgICAgIGJveF9kcmF3bl9wID0gMTsKKyAgICB9CisgIHN3aXRjaCAocy0+Zmlyc3RfZ2x5cGgt PnR5cGUpCisgICAgeworICAgIGNhc2UgSU1BR0VfR0xZUEg6CisgICAgICBuID0gbnNfZ2V0X2ds eXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIpOworICAgICAgaWYgKCFtY19uc19jbGlwX3RvX3Jl Y3QgKHMtPmYsIHIsIG4sIHJvdykpCisgICAgICAgIHJldHVybjsKKyAgIC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RCAocy0+ZiwgaG9s bG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgIE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ ZmFjZSkgPSBOU19GQUNFX0ZPUkVHUk9VTkQgKGhvbGxvd19hY3RpdmVfZmFjZSk7CisgICAgICAg ICAgfQorICAgICAgICAgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAgICAg ICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWAorICAgICAgICAgICAgICAg ICAgICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBlbnVtIGZhY2Vf aWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLWZhY2UiKSwgdHJ1ZSk7Cisg ICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJP TV9JRCAocy0+ZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICBOU19G QUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpID0gTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3dfaW5h Y3RpdmVfZmFjZSk7CisgICAgICAgICAgICB9CisgICAgICB7CisgICAgICAgIEJPT0wgaXNDb21w b3NpdGUgPSBzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEg7CisgICAgICAg IGlmIChpc0NvbXBvc2l0ZSkKKyAgICAgICAgICBuc19kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJp bmdfZm9yZWdyb3VuZCAocyk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBib29sIHdpdGhfYmdfcCA9ICgoZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX05PUk1BTCAm JiAhcy0+YmFja2dyb3VuZF9maWxsZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgfHwgZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX01PVVNFRkFDRSk7CisgICAgICAgICAgICAgIGlm ICh3aXRoX2JnX3ApCisgICAgICAgICAgICAgICAgcy0+YmFja2dyb3VuZF9udWtlZF9wID0gdHJ1 ZTsKKyAgICAgICAgICAgICAgZm9udC0+ZHJpdmVyLT5kcmF3IChzLCBzLT5jbXBfZnJvbSwgcy0+ bmNoYXJzLCBzLT54LCBzLT55YmFzZSwgd2l0aF9iZ19wKTsKKyAgICAgICAgICAgIH0KKyAgICAg IH0KKyAgICAgIHsKKyAgICAgICAgTlNDb2xvciAqY29sID0gKE5TX0ZBQ0VfRk9SRUdST1VORCAo cy0+ZmFjZSkgIT0gMAorICAgICAgICAgICAgICAgICAgICAgICAgPyBuc19sb29rdXBfaW5kZXhl ZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKSwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPmYpCisgICAgICAgICAgICAgICAg ICAgICAgICA6IEZSQU1FX0ZPUkVHUk9VTkRfQ09MT1IgKHMtPmYpKTsKKyAgICAgICAgW2NvbCBz ZXRdOworICAgICAgICAvKiBEcmF3IHVuZGVybGluZSwgb3ZlcmxpbmUsIHN0cmlrZS10aHJvdWdo LiAqLworICAgICAgICBtY19uc19kcmF3X3RleHRfZGVjb3JhdGlvbiAocywgcy0+ZmFjZSwgY29s LCBzLT53aWR0aCwgcy0+eCk7CisgICAgICB9CisgICAgICB7CisgICAgICAgIGlmIChzLT5maXJz dF9nbHlwaC0+dHlwZSAhPSBDT01QT1NJVEVfR0xZUEgKKyAgICAgICAgICAgICYmIChzLT5sZWZ0 X292ZXJ3cml0dGVuX3AgfHwgc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WYgKHMt PmZvcl9vdmVybGFwcyB8fCAocy0+Y21wX2Zyb20gPiAwCisgICAgICAgICAgICAmJiAhIHMtPmZp cnN0X2dseXBoLT51LmNtcC5hdXRvbWF0aWMpKQorICAgICAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxl ZF9wID0gMTsKKyAgICAgIGVsc2UKKyAgICAgICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNr Z3JvdW5kIChzLCBzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpOworICAg ICAgLyogLi4uICovCisgICAgICAvKiBOb3QgeWV0IGltcGxlbWVudGVkLiAgKi8KKyAgICAgIC8q IC4uLiAqLworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgYnJlYWs7Cisg ICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICAgIH0KKyAgLyogRHJhdyBib3gg aWYgbm90IGRvbmUgYWxyZWFkeS4gKi8KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMgJiYgIWJveF9k cmF3bl9wICYmIHMtPmZhY2UtPmJveCAhPSBGQUNFX05PX0JPWCkKKyAgICB7CisgICAgICBuID0g bnNfZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIpOworICAgICAgaWYgKCFtY19uc19j bGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4sIHJvdykpCisgICAgICAgIHJldHVybjsKKyAgICAgIG5z X2R1bXBnbHlwaHNfYm94X29yX3JlbGllZiAocyk7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAo cy0+Zik7CisgICAgfQorICBzLT5udW1fY2xpcHMgPSAwOworfQorCisvKiBlbmQgTVVMVElQTEUt Q1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogPT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT0KIAogICAgTlNUUkFDRSwgVHJhY2Ugc3VwcG9ydC4KQEAgLTExMDksNiArMjE5NCwxNiBA QCBzdGF0aWMgTlNSZWN0IGNvbnN0cmFpbl9mcmFtZV9yZWN0KE5TUmVjdCBmcmFtZVJlY3QsIGJv b2wgaXNGdWxsc2NyZWVuKQogICAgZXh0ZXJuYWwgKFJJRikgY2FsbDsgd2hvbGUgZnJhbWUsIGNh bGxlZCBiZWZvcmUgdXBkYXRlX3dpbmRvd19iZWdpbgogICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K IHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IGY7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKICNpZmRlZiBOU19JTVBMX0NPQ09BCiAgIEVtYWNzVmlldyAqdmlldyA9IEZSQU1FX05T X1ZJRVcgKGYpOwogCkBAIC0xMjA5LDYgKzIzMDQsMTYgQEAgc3RhdGljIE5TUmVjdCBjb25zdHJh aW5fZnJhbWVfcmVjdChOU1JlY3QgZnJhbWVSZWN0LCBib29sIGlzRnVsbHNjcmVlbikKIAogLyog ICBpZiAoZiA9PSBNT1VTRV9ITF9JTkZPIChmKS0+bW91c2VfZmFjZV9tb3VzZV9mcmFtZSkgKi8K ICAgTU9VU0VfSExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfZGVmZXIgPSAwOworCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0 aW5nX2ZyYW1lID0gTlVMTDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAK QEAgLTQ4MDMsNiArNTkwOCwxNyBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMgKHJhcGlkIGluY29t aW5nIGV2ZW50cykuCiAgICAgICBiYXIgPSBbW0VtYWNzU2Nyb2xsZXIgYWxsb2NdIGluaXRGcmFt ZTogciB3aW5kb3c6IHdpbl07CiAgICAgICB3c2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHdpbmRv dywgbWFrZV9taW50X3B0ciAoYmFyKSk7CiAgICAgICB1cGRhdGVfcCA9IFlFUzsKKworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgLyog VGhpcyBpcyBvbmx5IGZvciBkZWJ1Z2dpbmcgcHVycG9zZXMuICovCisgICAgICBbYmFyIG1jX3Nl dF9yZWN0YW5nbGU6IHJdOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgfQog ICBlbHNlCiAgICAgewpAQCAtNDgxMCwxMiArNTkyNiwzMCBAQCBpbiBjZXJ0YWluIHNpdHVhdGlv bnMgKHJhcGlkIGluY29taW5nIGV2ZW50cykuCiAgICAgICBiYXIgPSBYTlNfU0NST0xMX0JBUiAo d2luZG93LT52ZXJ0aWNhbF9zY3JvbGxfYmFyKTsKICAgICAgIG9sZFJlY3QgPSBbYmFyIGZyYW1l XTsKICAgICAgIHIuc2l6ZS53aWR0aCA9IG9sZFJlY3Quc2l6ZS53aWR0aDsKKworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAgICAgaWYgKEZS QU1FX0xJVkVfUCAoZikgJiYgIU5TRXF1YWxSZWN0cyAob2xkUmVjdCwgcikpCiAgICAgICAgIHsK KyAgICAgICAgICAvKiBUaGUgbWFpbiB3aW5kb3cgaGFzIHByb2JhYmx5IGJlZW4gcmVzaXplZC4g IEdyYWNpb3VzbHkgZGVsZXRlIHRoZQorICAgICAgICAgIG9sZCBzY3JvbGwgYmFyIHdpdGhvdXQg cmVwYWludGluZyBpdHMgcmVjdGFuZ2xlOyBhbmQsIGNyZWF0ZSBhIG5ldworICAgICAgICAgIHNj cm9sbCBiYXIgZWxzZXdoZXJlLiovCiAgICAgICAgICAgaWYgKG9sZFJlY3Qub3JpZ2luLnggIT0g ci5vcmlnaW4ueCkKKyAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgbnNfY2xlYXJfZnJhbWVf YXJlYSAoZiwgbGVmdCwgdG9wLCB3aWR0aCwgaGVpZ2h0KTsKKyAgICAgICAgICAgICAgW2JhciBt Y19qdWRnZV07CisgICAgICAgICAgICAgIGJhciA9IFtbRW1hY3NTY3JvbGxlciBhbGxvY10gaW5p dEZyYW1lOiByIHdpbmRvdzogd2luXTsKKyAgICAgICAgICAgICAgd3NldF92ZXJ0aWNhbF9zY3Jv bGxfYmFyICh3aW5kb3csIG1ha2VfbWludF9wdHIgKGJhcikpOworICAgICAgICAgICAgfQorICAg ICAgICAgICAgZWxzZQogICAgICAgICAgIFtiYXIgc2V0RnJhbWU6IHJdOwogICAgICAgICB9CisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB9CiAKICAgaWYgKHVwZGF0ZV9wKQpA QCAtNDk3NSw5ICs2MTA5LDU3IEBAIGluIGNlcnRhaW4gc2l0dWF0aW9ucyAocmFwaWQgaW5jb21p bmcgZXZlbnRzKS4KICAgICB7CiAgICAgICB2aWV3ID0gW3N1YnZpZXdzIG9iamVjdEF0SW5kZXg6 IGldOwogICAgICAgaWYgKCFbdmlldyBpc0tpbmRPZkNsYXNzOiBbRW1hY3NTY3JvbGxlciBjbGFz c11dKSBjb250aW51ZTsKLSAgICAgIGlmIChbdmlldyBqdWRnZV0pCisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogYFhTRVRXSU5ET1cn IHdpbGwgc29tZXRpbWVzIGNhdXNlIEVtYWNzIHRvIGNyYXNoIHdoZW4gcnVubmluZyB1bmRlciBn ZGIgZXZlbgorICB0aG91Z2ggKHcgIT0gTlVMTCkuICBUaGVyZWZvcmUsIHdlIGNhbm5vdCByZWxp YWJseSB1c2UgYFdJTkRPV19MSVZFX1AnLiAqLworICBzdHJ1Y3Qgd2luZG93ICp3ID0gW3ZpZXcg bWNfZ2V0X3dpbmRvd107CisgIGlmICh3ICE9IE5VTEwKKyAgICAgICYmIE5JTFAgKHctPmNvbnRl bnRzKSkKKyAgICB7CisgICAgICBCT09MIGRlYnVnX3AgPSBmYWxzZTsKKyAgICAgIGlmIChkZWJ1 Z19wCisgICAgICAgICAgLyogYHdpbmRvd19ib3gnIGNhbGxzIGB3aW5kb3dfYm94X2hlaWdodCcs IHdoaWNoIHdpbGwgY2F1c2UgRW1hY3MgdG8KKyAgICAgICAgICBjcmFzaCBpZiBGUkFNRVAgKHct PmZyYW1lKSBpcyBub3Qgc2F0aXNmaWVkLiAqLworICAgICAgICAgICYmIEZSQU1FUCAody0+ZnJh bWUpKQorICAgICAgICB7CisgICAgICAgICAgTlNSZWN0IHIwID0gW3ZpZXcgbWNfZ2V0X3JlY3Rh bmdsZV07CisgICAgICAgICAgaW50IHgwID0gTlNNaW5YIChyMCk7CisgICAgICAgICAgaW50IHkw ID0gTlNNaW5ZIChyMCk7CisgICAgICAgICAgaW50IHdkMCA9IE5TV2lkdGggKHIwKTsKKyAgICAg ICAgICBpbnQgaDAgPSBOU0hlaWdodCAocjApOworICAgICAgICAgIGludCB3aW5kb3dfeSwgd2lu ZG93X2hlaWdodDsKKyAgICAgICAgICB3aW5kb3dfYm94ICh3LCBBTllfQVJFQSwgMCwgJndpbmRv d195LCAwLCAmd2luZG93X2hlaWdodCk7CisgICAgICAgICAgaW50IHRvcCA9IHdpbmRvd195Owor ICAgICAgICAgIGludCBoZWlnaHQgPSB3aW5kb3dfaGVpZ2h0OworICAgICAgICAgIGludCB3aWR0 aCA9IFdJTkRPV19DT05GSUdfU0NST0xMX0JBUl9DT0xTICh3KSAqIEZSQU1FX0NPTFVNTl9XSURU SCAoZik7CisgICAgICAgICAgaW50IGxlZnQgPSBXSU5ET1dfU0NST0xMX0JBUl9BUkVBX1ggKHcp OworICAgICAgICAgIE5TUmVjdCByMSA9IE5TTWFrZVJlY3QgKGxlZnQsIHRvcCwgd2lkdGgsIGhl aWdodCk7CisgICAgICAgICAgLyogVGhlIHBhcmVudCB2aWV3IGlzIGZsaXBwZWQsIHNvIHdlIG5l ZWQgdG8gZmxpcCB5IHZhbHVlLiAqLworICAgICAgICAgIEVtYWNzVmlldyAqZnJhbWVfdmlldyA9 IEZSQU1FX05TX1ZJRVcgKGYpOworICAgICAgICAgIE5TUmVjdCB2ID0gW2ZyYW1lX3ZpZXcgZnJh bWVdOworICAgICAgICAgIHIxLm9yaWdpbi55ID0gKHYuc2l6ZS5oZWlnaHQgLSByMS5zaXplLmhl aWdodCAtIHIxLm9yaWdpbi55KTsKKyAgICAgICAgICBpbnQgeDEgPSBOU01pblggKHIxKTsKKyAg ICAgICAgICBpbnQgeTEgPSBOU01pblkgKHIxKTsKKyAgICAgICAgICBpbnQgd2QxID0gTlNXaWR0 aCAocjEpOworICAgICAgICAgIGludCBoMSA9IE5TSGVpZ2h0IChyMSk7CisgICAgICAgICAgZnBy aW50ZiAoc3RkZXJyLCAiJXMgLS0gREVBRDpcblwKKyAgICAgICAgICB4MC94MSAoJWQvJWQpIHwg eTAveTEgKCVkLyVkKSB8IHdkMC93ZDEgKCVkLyVkKSB8IGgwL2gxICglZC8lZClcbiIsCisgICAg ICAgICAgbWNfd2luZG93ICh3KSwgeDAsIHgxLCB5MCwgeTEsIHdkMCwgd2QxLCBoMCwgaDEpOwor ICAgICAgICB9CisgICAgICBpZiAoW3ZpZXcgbWNfanVkZ2VdKQogICAgICAgICByZW1vdmVkID0g WUVTOwogICAgIH0KKyAgICBlbHNlIGlmIChbdmlldyBqdWRnZV0pCisgICAgICByZW1vdmVkID0g WUVTOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCisgICAgfQogCiAgIGlmIChyZW1v dmVkKQogICAgIFtldmlldyB1cGRhdGVGcmFtZVNpemU6IE5PXTsKQEAgLTUxMDYsNiArNjI4OCwy MSBAQCBzdGF0aWMgTGlzcF9PYmplY3QgbnNfc3RyaW5nX3RvX2xpc3Btb2QgKGNvbnN0IGNoYXIg KnMpCiBleHRlcm4gZnJhbWVfcGFybV9oYW5kbGVyIG5zX2ZyYW1lX3Bhcm1faGFuZGxlcnNbXTsK IHN0YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSBuc19yZWRpc3BsYXlfaW50ZXJmYWNl ID0KIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMg Ki8KKworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBuc3Rlcm0ubWAgbXVzdCBiZSBpbiB0 aGUgZXhhY3Qgc2FtZSBvcmRlciBhcyB0aGUKK2ByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgZGlz cGV4dGVybi5oYCEgKi8KKworICBtY194X3dyaXRlX2dseXBocywKKyAgbWNfbnNfZHJhd193aW5k b3dfY3Vyc29yLAorICBtY19uc19kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogICBuc19mcmFtZV9wYXJtX2hhbmRsZXJzLAogICB4X3Byb2R1Y2VfZ2x5 cGhzLAogICB4X3dyaXRlX2dseXBocywKQEAgLTg3MjEsNiArOTkxOCw0OSBAQCAtIChCT09MKWNh bkJlY29tZU1haW5XaW5kb3cKIAogQGltcGxlbWVudGF0aW9uIEVtYWNzU2Nyb2xsZXIKIAorCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLSAodm9p ZCltY19zZXRfcmVjdGFuZ2xlOiAoTlNSZWN0KXJlY3QKK3sKKyAgbWNfcmVjdGFuZ2xlID0gcmVj dDsKK30KKworLSAoTlNSZWN0KW1jX2dldF9yZWN0YW5nbGUKK3sKKyAgcmV0dXJuIG1jX3JlY3Rh bmdsZTsKK30KKworLSAoc3RydWN0IHdpbmRvdyAqKW1jX2dldF93aW5kb3cKK3sKKyAgcmV0dXJu IHdpbmRvdzsKK30KKworLSAoYm9vbCltY19qdWRnZQoreworICBOU1RSQUNFICgiW0VtYWNzU2Ny b2xsZXIgbWNfanVkZ2VdIik7CisgIGJvb2wgcmV0ID0gY29uZGVtbmVkOworICBibG9ja19pbnB1 dCAoKTsKKyAgaWYgKGNvbmRlbW5lZCkKKyAgICB7CisgICAgICAvKiBlbnN1cmUgb3RoZXIgc2Ny b2xsYmFyIHVwZGF0ZXMgYWZ0ZXIgZGVsZXRpb24gKi8KKyAgICAgIEVtYWNzVmlldyAqdmlldyA9 IChFbWFjc1ZpZXcgKilGUkFNRV9OU19WSUVXIChmcmFtZSk7CisgICAgICBpZiAodmlldyAhPSBu aWwpCisgICAgICAgIHZpZXctPnNjcm9sbGJhcnNOZWVkaW5nVXBkYXRlKys7CisgICAgfQorICBp ZiAod2luZG93KQorICAgIHdzZXRfdmVydGljYWxfc2Nyb2xsX2JhciAod2luZG93LCBRbmlsKTsK KyAgd2luZG93ID0gMDsKKyAgW3NlbGYgcmVtb3ZlRnJvbVN1cGVydmlld1dpdGhvdXROZWVkaW5n RGlzcGxheV07CisgIFtzZWxmIHJlbGVhc2VdOworICB1bmJsb2NrX2lucHV0ICgpOworICByZXR1 cm4gcmV0OworfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBmb3IgcmVwZWF0 IGJ1dHRvbiBwdXNoICovCiAjZGVmaW5lIFNDUk9MTF9CQVJfRklSU1RfREVMQVkgMC41CiAjZGVm aW5lIFNDUk9MTF9CQVJfQ09OVElOVU9VU19ERUxBWSAoMS4wIC8gMTUpCmRpZmYgLS1naXQgYS9z cmMvcGR1bXBlci5jIGIvc3JjL3BkdW1wZXIuYwppbmRleCBjYjI5MTVjLi4zNmQ4YmZlIDEwMDY0 NAotLS0gYS9zcmMvcGR1bXBlci5jCisrKyBiL3NyYy9wZHVtcGVyLmMKQEAgLTI3NzAsNyArMjc3 MCw3IEBAIGR1bXBfaGFzaF90YWJsZSAoc3RydWN0IGR1bXBfY29udGV4dCAqY3R4LAogc3RhdGlj IGR1bXBfb2ZmCiBkdW1wX2J1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SAvIDY1NTM1LjA7CisgICAg fQorICBlbHNlCisgICAgeworICAgICAgbHNsLT5yZWQgPSAtMS4wOworICAgICAgbHNsLT5ncmVl biA9IC0xLjA7CisgICAgICBsc2wtPmJsdWUgPSAtMS4wOworICAgIH0KK30KKworLyogRHJhdyBz dHJldGNoIGdseXBoIHN0cmluZyBTLiAgKi8KK3N0YXRpYyB2b2lkCittY193MzJfZHJhd19zdHJl dGNoX2dseXBoX3N0cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAqcykKK3sKKyAgZWFzc2VydCAo cy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQSCk7CisgIGlmIChzLT5obCA9PSBE UkFXX0NVUlNPUgorICAgICAgJiYgIXhfc3RyZXRjaF9jdXJzb3JfcCkKKyAgICB7CisgICAgICAv KiBJZiBgeC1zdHJldGNoLWN1cnNvcicgaXMgbmlsLCBkb24ndCBkcmF3IGEgYmxvY2sgY3Vyc29y IGFzCisgICB3aWRlIGFzIHRoZSBzdHJldGNoIGdseXBoLiAgKi8KKyAgICAgIGludCB3aWR0aCwg YmFja2dyb3VuZF93aWR0aCA9IHMtPmJhY2tncm91bmRfd2lkdGg7CisgICAgICBpbnQgeCA9IHMt Png7CisgICAgICBpZiAoIXMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgeworICAgIGludCBsZWZ0X3gg PSB3aW5kb3dfYm94X2xlZnRfb2Zmc2V0IChzLT53LCBURVhUX0FSRUEpOworICAgIGlmICh4IDwg bGVmdF94KQorICAgICAgeworICAgICAgICBiYWNrZ3JvdW5kX3dpZHRoIC09IGxlZnRfeCAtIHg7 CisgICAgICAgIHggPSBsZWZ0X3g7CisgICAgICB9CisgIH0KKyAgICAgIGVsc2UKKyAgeworICAg IC8qIEluIFIyTCByb3dzLCBkcmF3IHRoZSBjdXJzb3Igb24gdGhlIHJpZ2h0IGVkZ2Ugb2YgdGhl CisgICAgICAgc3RyZXRjaCBnbHlwaC4gICovCisgICAgaW50IHJpZ2h0X3ggPSB3aW5kb3dfYm94 X3JpZ2h0IChzLT53LCBURVhUX0FSRUEpOworICAgIGlmICh4ICsgYmFja2dyb3VuZF93aWR0aCA+ IHJpZ2h0X3gpCisgICAgICBiYWNrZ3JvdW5kX3dpZHRoIC09IHggLSByaWdodF94OworICAgIHgg Kz0gYmFja2dyb3VuZF93aWR0aDsKKyAgfQorICAgICAgd2lkdGggPSBtaW4gKEZSQU1FX0NPTFVN Tl9XSURUSCAocy0+ZiksIGJhY2tncm91bmRfd2lkdGgpOworICAgICAgaWYgKHMtPnJvdy0+cmV2 ZXJzZWRfcCkKKyAgeCAtPSB3aWR0aDsKKyAgICAgIC8qIERyYXcgY3Vyc29yLiAgKi8KKyAgICAg IHhfZHJhd19nbHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwgcy0+eSwgd2lkdGgsIHMtPmhlaWdo dCk7CisgICAgICAvKiBDbGVhciByZXN0IHVzaW5nIHRoZSBHQyBvZiB0aGUgb3JpZ2luYWwgbm9u LWN1cnNvciBmYWNlLiAgKi8KKyAgICAgIGlmICh3aWR0aCA8IGJhY2tncm91bmRfd2lkdGgpCisg IHsKKyAgICBYR0NWYWx1ZXMgKmdjID0gcy0+ZmFjZS0+Z2M7CisgICAgaW50IHkgPSBzLT55Owor ICAgIGludCB3ID0gYmFja2dyb3VuZF93aWR0aCAtIHdpZHRoLCBoID0gcy0+aGVpZ2h0OworICAg IFJFQ1QgcjsKKyAgICAgICAgICBIREMgaGRjID0gcy0+aGRjOworICAgIGlmICghcy0+cm93LT5y ZXZlcnNlZF9wKQorICAgICAgeCArPSB3aWR0aDsKKyAgICBlbHNlCisgICAgICB4ID0gcy0+eDsK KyAgICBpZiAocy0+cm93LT5tb3VzZV9mYWNlX3AKKyAgICAgICAgJiYgY3Vyc29yX2luX21vdXNl X2ZhY2VfcCAocy0+dykpCisgICAgICB7CisgICAgICAgIHhfc2V0X21vdXNlX2ZhY2VfZ2MgKHMp OworICAgICAgICB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odCA9IFdJTkRPV19NT0RFX0xJTkVfSEVJR0hU ICh3KTsKKyAgICAgICAgICBQb3N0TWVzc2FnZSAoaHduZCwgV01fSU1FX1NUQVJUQ09NUE9TSVRJ T04sIDAsIDApOworICAgICAgICAgIC8qIElmIHRoZSBzaXplIG9mIHRoZSBhY3RpdmUgY3Vyc29y IGNoYW5nZWQsIGRlc3Ryb3kgdGhlIG9sZAorICAgICAgICAgICAgIHN5c3RlbSBjYXJldC4gICov CisgICAgICAgICAgaWYgKHczMl9zeXN0ZW1fY2FyZXRfaHduZAorICAgICAgICAgICAgICAmJiAo dzMyX3N5c3RlbV9jYXJldF9oZWlnaHQgIT0gaCkpCisgICAgICAgICAgICBQb3N0TWVzc2FnZSAo aHduZCwgV01fRU1BQ1NfREVTVFJPWV9DQVJFVCwgMCwgMCk7CisgICAgICAgICAgdzMyX3N5c3Rl bV9jYXJldF9oZWlnaHQgPSBoOworICAgICAgICAgIC8qIE1vdmUgdGhlIHN5c3RlbSBjYXJldC4g ICovCisgICAgICAgICAgUG9zdE1lc3NhZ2UgKGh3bmQsIFdNX0VNQUNTX1RSQUNLX0NBUkVULCAw LCAwKTsKKyAgICAgICAgfQorICAgICAgLyogVGhlIGZyaW5nZSBiaXRtYXBzIGFyZSBwcmVzZW50 bHkgaGFuZGxlZCBlbHNld2hlcmUsIGJ1dCBjb3VsZCBzb21lZGF5CisgICAgICBiZSBtYW5hZ2Vk IChpbiBwYXJ0KSBhdCB0aGlzIHNlY3Rpb24gb2YgY29kZS4gKi8KKyAgICAgIGlmIChyb3ctPmV4 YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICAmJiAocm93LT5yZXZlcnNlZF9wCisg ICAgICAgICAgICAgPyAoaHBvcyA8IDApCisgICAgICAgICAgICAgOiAoaHBvcyA+PSByb3ctPnVz ZWRbVEVYVF9BUkVBXSkpKQorICAgICAgICB7CisgICAgICAgICAgcm93LT5jdXJzb3JfaW5fZnJp bmdlX3AgPSB0cnVl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ZWRf d2luZG93KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFBUCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiBYRklYTlVNIChGbWFya2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pKTsK KyAgICAgIGJvb2wgcmVnaW9uX2luX2JvdW5kc19wID0gKHJlZ2lvbl9hY3RpdmVfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3B0ID49IHJlZ2lvbl9iZWdpbm5p bmcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF9wdCA8IHJlZ2lv bl9lbmQpOworICAgICAgaWYgKGN1cnNvcl9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCAmJiBs c2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAg eworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5j dXJzb3JfZ2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAgICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4 X21ha2VfZ2MnIGluIHczMmZucy5jLiAgKi8KKyAgICAgICAgICBpZiAocmVnaW9uX2FjdGl2ZV9w CisgICAgICAgICAgICAgICYmIHJlZ2lvbl9pbl9ib3VuZHNfcAorICAgICAgICAgICAgICAmJiBh Y3RpdmVfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxv d19hY3RpdmVfcmVnaW9uX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJu ICgiKy1yZWFsLWZha2UtY3Vyc29yLXJlZ2lvbi1mYWNlIiksIHRydWUpOworICAgICAgICAgICAg ICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZSA9IEZ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Y2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3Vw X25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRy dWUpOworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBG QUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAg Z2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7Cisg ICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3JlZ2lv bl9vdXRfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBl bHNlIGlmICghcmVnaW9uX2FjdGl2ZV9wICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBs b29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWZhY2Ui KSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9m YWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAg ICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVn cm91bmQ7CisgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19h Y3RpdmVfZmFjZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg IC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nY19wID0gdHJ1ZTsKKyAgICAgICAgICBtY19kcmF3X2N1cnNv cl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLCBsc2ws CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5 cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRh LnczMi0+Y3Vyc29yX2djID0gb3JpZ2luYWxfY3Vyc29yX2djOworICAgICAgICAgIHVuYmxvY2tf aW5wdXQgKCk7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0 YS53MzItPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+ Y3Vyc29yX3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93 X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgp OworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxf Y3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGN1cnNvcl9nbHlwaC0+ dHlwZSA9PSBJTUFHRV9HTFlQSCAmJiBsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYg bHNsLmJsdWUgPj0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICAvKiBUZW1wb3JhcmlseSBo aWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAg ICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAg ICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5 LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMy LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgICAgfQorICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkg aGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQor ICAgICAgICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHczMmZucy5jLiAg Ki8KKyAgICAgICAgICAgICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAg JiYgcmVnaW9uX2luX2JvdW5kc19wCisgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcCkKKyAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2Fj dGl2ZV9yZWdpb25fZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIr LXJlYWwtZmFrZS1jdXJzb3ItcmVnaW9uLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAg ICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZSA9IEZBQ0VfRlJPTV9JRCAo ZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBlbnVt IGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYs IGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICAgICAgICAgICAg ICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwg aG9sbG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5mb3Jl Z3JvdW5kID0gaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICAg ICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9mYWNlLT5iYWNr Z3JvdW5kOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmIChyZWdp b25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcmVnaW9uX2luX2JvdW5k c19wCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3Jl Z2lvbl9vdXRfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJl YWwtZmFrZS1jdXJzb3ItcmVnaW9uLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAg IHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfZmFjZSA9IEZBQ0VfRlJPTV9J RCAoZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fb3V0X2ZhY2VfaWQpOworICAgICAgICAgICAgICAg ICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICAg ICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9G Uk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBn Y192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZDsKKyAg ICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3Jl Z2lvbl9vdXRfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgICAgIGVsc2UgaWYgKCFyZWdpb25fYWN0aXZlX3AgJiYgYWN0aXZlX3ApCisgICAgICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93 X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVh bC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVj dCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3Rp dmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQg PSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAg Z2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQ7Cisg ICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgLyogVGhlIHJlZ2lvbiBp cyBfbm90XyB2aXNpYmxlIGluIHRoZSBpbmFjdGl2ZSB3aW5kb3cgYmVjYXVzZSB0aGUgb3Zlcmxh eSB3aW5kb3cgcHJvcGVydHkgaXMgdXNlZC4gKi8KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBp ZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1l ZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtZmFjZSIp LCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5h Y3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOwor ICAgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfaW5h Y3RpdmVfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVl cy5iYWNrZ3JvdW5kID0gaG9sbG93X2luYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNv cl9nYyA9IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiksIG1hc2ssICZnY192 YWx1ZXMpOworICAgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyog Rm9yY2UgYG1jX3czMl9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLncz Mi0+Y3Vyc29yX2djJy4gICovCisgICAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSB0cnVl OworICAgICAgICAgICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERS QVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgbHNsLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNv cl9nY19wKTsKKyAgICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MgPSBv cmlnaW5hbF9jdXJzb3JfZ2M7CisgICAgICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAg ICAgICAgICAgIG1jX3czMl9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBm eCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICAgIH0KKyAgICAgIGJyZWFr OworICAgIH0KKyAgICBjYXNlIE1DX0hPTExPV19CT1g6CisgICAgeworICAgICAgaWYgKGxzbC5y ZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7Cisg ICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNv cl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVs ID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywg bWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAg IGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVs OworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBtY193MzJfZHJhd19ob2xsb3df Y3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7 CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19GSUxMRURfQk9YOgorICAgIHsKKyAg ICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkK KyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2Rh dGEudzMyLT5jdXJzb3JfZ2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAgICAgICAgICBmdW5jdGlvbmFs aXR5IG9mIGB4X21ha2VfZ2MnIGluIHczMmZucy5jLiAgKi8KKyAgICAgICAgICBibG9ja19pbnB1 dCAoKTsKKyAgICAgICAgICBYR0NWYWx1ZXMgZ2NfdmFsdWVzOworICAgICAgICAgIHVuc2lnbmVk IGxvbmcgbWFzayA9IEdDRm9udCB8IEdDRm9yZWdyb3VuZCB8IEdDQmFja2dyb3VuZDsKKyAgICAg ICAgICBnY192YWx1ZXMuZm9udCA9IEZSQU1FX0ZPTlQgKGYpOworICAgICAgICAgIGdjX3ZhbHVl cy5mb3JlZ3JvdW5kID0gRlJBTUVfQkFDS0dST1VORF9QSVhFTCAoZik7CisgICAgICAgICAgZ2Nf dmFsdWVzLmJhY2tncm91bmQgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0 YS53MzItPmN1cnNvcl9nYyA9IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiks IG1hc2ssICZnY192YWx1ZXMpOworICAgICAgICAgIC8qIEZvcmNlIGBtY193MzJfc2V0X2N1cnNv cl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycuICAqLworICAg ICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSB0cnVlOworICAgICAgICAgIG1jX2RyYXdfY3Vyc29y X2dseXBoICh3LCBtYXRyaXgsIHJvdywgRFJBV19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsIGxzbCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlw ZSwgd2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEu dzMyLT5jdXJzb3JfZ2MgPSBvcmlnaW5hbF9jdXJzb3JfZ2M7CisgICAgICAgICAgdW5ibG9ja19p bnB1dCAoKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAg ICAgYm9vbCBjdXJzb3JfZ2NfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfZHJhd19jdXJzb3Jf Z2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5 cGUsIHdkLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJz b3JfZ2NfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNf QkFSOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYg bHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFj ayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgIGJv b2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3czMl9k cmF3X2Jhcl9jdXJ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pbnZpc2libGVf b2theV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9y aWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAg eworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IGZhbHNlOwor ICAgICAgICAgICAgbWNfdzMyX2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4 LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29y X2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0K KyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KKyAgICB9Cit9CisKKy8q IERyYXcgZ2x5cGggc3RyaW5nIFMuICAqLworc3RhdGljIHZvaWQKK21jX3czMl9kcmF3X2dseXBo X3N0cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0 cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgIHN0 cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsCisgICAgICAgICAg ICAgICAgICAgICAgICAgIGVudW0gdHlwZV9vZl9jdXJzb3IgY3Vyc29yX3R5cGUsIGludCBjdXJz b3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3AsIGJvb2wg Y3Vyc29yX2djX3ApCit7CisgIGJvb2wgcmVsaWVmX2RyYXduX3AgPSAwOworICAvKiBJZiBTIGRy YXdzIGludG8gdGhlIGJhY2tncm91bmQgb2YgaXRzIHN1Y2Nlc3NvciwgZHJhdyB0aGUKKyAgICAg YmFja2dyb3VuZCBvZiB0aGUgc3VjY2Vzc29yIGZpcnN0IHNvIHRoYXQgUyBjYW4gZHJhdyBpbnRv IGl0LgorICAgICBUaGlzIG1ha2VzIFMtPm5leHQgdXNlIFhEcmF3U3RyaW5nIGluc3RlYWQgb2Yg WERyYXdJbWFnZVN0cmluZy4gICovCisgIGlmIChzLT5uZXh0ICYmIHMtPnJpZ2h0X292ZXJoYW5n ICYmICFzLT5mb3Jfb3ZlcmxhcHMpCisgICAgeworICAgICAgaW50IHdpZHRoOworICAgICAgc3Ry dWN0IGdseXBoX3N0cmluZyAqbmV4dDsKKyAgICAgIGZvciAod2lkdGggPSAwLCBuZXh0ID0gcy0+ bmV4dDsKKyAgICAgICAgICAgbmV4dCAmJiB3aWR0aCA8IHMtPnJpZ2h0X292ZXJoYW5nOworICAg ICAgICAgICB3aWR0aCArPSBuZXh0LT53aWR0aCwgbmV4dCA9IG5leHQtPm5leHQpCisgICAgICAg IGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICB7 CisgICAgICAgICAgICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4dCwgY3Vyc29yX2dj X3ApOworICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nIChuZXh0KTsKKyAg ICAgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQor ICAgICAgICAgICAgICBtY193MzJfZHJhd19zdHJldGNoX2dseXBoX3N0cmluZyAobmV4dCk7Cisg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dy b3VuZCAobmV4dCwgdHJ1ZSk7CisgICAgICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAg ICAgICAgIH0KKyAgICB9CisgIC8qIFNldCB1cCBTL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ZWRfcCA9IHRydWU7CisgICAgICBl bHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgdHJ1ZSk7Cisg ICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAg IGJyZWFrOworICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9vdmVy bGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNl CisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgZmFsc2UpOworICAg ICAgeF9kcmF3X2dseXBobGVzc19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBi cmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgICAgfQorICBpZiAo IXMtPmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICAvKiBEcmF3IHVuZGVybGluZS4gICovCisg ICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpZiAo cy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9XQVZFKQorICAgICAgICAgICAg eworICAgICAgICAgICAgICBDT0xPUlJFRiBjb2xvcjsKKyAgICAgICAgICAgICAgaWYgKHMtPmZh Y2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICBjb2xvciA9IHMtPmdj LT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgY29sb3Ig PSBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3I7CisgICAgICAgICAgICAgIHczMl9kcmF3X3VuZGVy d2F2ZSAocywgY29sb3IpOworICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKHMtPmZh Y2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgdW5zaWduZWQgbG9uZyB0aGlja25lc3MsIHBvc2l0aW9uOworICAgICAgICAg ICAgICBpbnQgeTsKKyAgICAgICAgICAgICAgaWYgKHMtPnByZXYgJiYgcy0+cHJldi0+ZmFjZS0+ dW5kZXJsaW5lX3AKKyAgICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGlu ZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAvKiBXZSB1c2UgdGhlIHNhbWUgdW5kZXJsaW5lIHN0eWxlIGFzIHRoZSBwcmV2aW91 cyBvbmUuICAqLworICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+cHJldi0+dW5kZXJs aW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+cHJldi0+dW5k ZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5l IHRoaWNrbmVzcy4gIERlZmF1bHQgaXMgMSBwaXhlbC4gICovCisgICAgICAgICAgICAgICAgICBp ZiAocy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAg ICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAg ICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gMTsK KyAgICAgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50X2xpbmUpCisgICAg ICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIHRoaWNrbmVzcykgLSAocy0+ eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHBvc2l0aW9u LiAgVGhpcyBpcyB0aGUgcmVjb21tZW5kZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJ0 aWNhbCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRoZSB0b3Agb2YKKyAg ICAgICAgICAgICAgICAgICAgICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBpcyBhIHNpZ25lZCB2 YWx1ZSBhY2NvcmRpbmcgdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgc3BlY3MsIGFu ZCBpdHMgZGVmYXVsdCBpcworICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EICgobWF4aW11 bV9kZXNjZW50KSAvIDIpLCB3aXRoCisgICAgICAgICAgICAgICAgICAgICAgICAgUk9VTkQgKHgp ID0gZmxvb3IgKHggKyAwLjUpICAqLworICAgICAgICAgICAgICAgICAgICAgIGlmICh4X3VzZV91 bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGllcworICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAg ICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb247Cisg ICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocy0+Zm9udCkKKyAgICAgICAgICAgICAgICAg ICAgICAgIHBvc2l0aW9uID0gKHMtPmZvbnQtPmRlc2NlbnQgKyAxKSAvIDI7CisgICAgICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbWF4IChwb3NpdGlvbiwg dW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgIC8qIENoZWNrIHRoZSBzYW5pdHkgb2YgdGhpY2tuZXNzIGFuZCBwb3NpdGlvbi4gIFdlIHNo b3VsZAorICAgICAgICAgICAgICAgICBhdm9pZCBkcmF3aW5nIHVuZGVybGluZSBvdXQgb2YgdGhl IGN1cnJlbnQgbGluZSBhcmVhLiAgKi8KKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWln aHQgPD0gcy0+eWJhc2UgKyBwb3NpdGlvbikKKyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChz LT5oZWlnaHQgLSAxKSAtIChzLT55YmFzZSAtIHMtPnkpOworICAgICAgICAgICAgICBpZiAocy0+ eSArIHMtPmhlaWdodCA8IHMtPnliYXNlICsgcG9zaXRpb24gKyB0aGlja25lc3MpCisgICAgICAg ICAgICAgICAgdGhpY2tuZXNzID0gKHMtPnkgKyBzLT5oZWlnaHQpIC0gKHMtPnliYXNlICsgcG9z aXRpb24pOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfdGhpY2tuZXNzID0gdGhpY2tuZXNz OworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPXBvc2l0aW9uOworICAgICAg ICAgICAgICB5ID0gcy0+eWJhc2UgKyBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgaWYgKHMtPmZh Y2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVh IChzLT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHksIHMtPndpZHRoLCAxKTsKKyAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFjZS0+dW5kZXJs aW5lX2NvbG9yLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHksIHMtPndp ZHRoLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyogRHJhdyBvdmVybGlu ZS4gICovCisgICAgICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfcCkKKyAgICAgICAgeworICAgICAg ICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAwLCBoID0gMTsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+ b3ZlcmxpbmVfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChz LT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgcy0+eSArIGR5LCBzLT53aWR0aCwgaCk7CisgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFjZS0+b3ZlcmxpbmVf Y29sb3IsIHMtPngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+ d2lkdGgsIGgpOworICAgICAgICB9CisgICAgICAvKiBEcmF3IHN0cmlrZS10aHJvdWdoLiAgKi8K KyAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9wCisgICAgICAgICAgJiYgIUZPTlRf VEVYVE1FVFJJQyAocy0+Zm9udCkudG1TdHJ1Y2tPdXQpCisgICAgICAgIHsKKyAgICAgICAgICB1 bnNpZ25lZCBsb25nIGggPSAxOworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAocy0+aGVp Z2h0IC0gaCkgLyAyOworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xv cl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywg cy0+Z2MtPmZvcmVncm91bmQsIHMtPngsIHMtPnkgKyBkeSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB3MzJfZmls bF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX2NvbG9yLCBzLT54 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+eSArIGR5LCBzLT53aWR0aCwgaCk7Cisg ICAgICAgIH0KKyAgICAgIC8qIERyYXcgcmVsaWVmIGlmIG5vdCB5ZXQgZHJhd24uICAqLworICAg ICAgaWYgKCFyZWxpZWZfZHJhd25fcCAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisg ICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYm94IChzKTsKKyAgICAgIGlmIChzLT5wcmV2KQor ICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqcHJldjsKKyAgICAgICAg ICBmb3IgKHByZXYgPSBzLT5wcmV2OyBwcmV2OyBwcmV2ID0gcHJldi0+cHJldikKKyAgICAgICAg ICAgIGlmIChwcmV2LT5obCAhPSBzLT5obAorICAgICAgICAgICAgICAgICYmIHByZXYtPnggKyBw cmV2LT53aWR0aCArIHByZXYtPnJpZ2h0X292ZXJoYW5nID4gcy0+eCkKKyAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgIC8qIEFzIHByZXYgd2FzIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8g aXRzIG93biBhcmVhLCB3ZQorICAgICAgICAgICAgICAgICAgIG11c3QgZHJhdyB0aGUgcmlnaHRf b3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICAqLworICAgICAgICAgICAgICAgIGVudW0g ZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gcHJldi0+aGw7CisgICAgICAgICAgICAgICAgcHJldi0+ aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAo cHJldiwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19j bGlwcGluZ19leGFjdGx5IChzLCBwcmV2KTsKKyAgICAgICAgICAgICAgICBpZiAocHJldi0+Zmly c3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19n bHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocHJldik7CisgICAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAo cHJldik7CisgICAgICAgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAocHJldi0+aGRj LCBOVUxMKTsKKyAgICAgICAgICAgICAgICBwcmV2LT5obCA9IHNhdmU7CisgICAgICAgICAgICAg ICAgcHJldi0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAg ICBpZiAocy0+bmV4dCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcg Km5leHQ7CisgICAgICAgICAgZm9yIChuZXh0ID0gcy0+bmV4dDsgbmV4dDsgbmV4dCA9IG5leHQt Pm5leHQpCisgICAgICAgICAgICBpZiAobmV4dC0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAg ICAmJiBuZXh0LT54IC0gbmV4dC0+bGVmdF9vdmVyaGFuZyA8IHMtPnggKyBzLT53aWR0aCkKKyAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEFzIG5leHQgd2lsbCBiZSBkcmF3biB3 aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwKKyAgICAgICAgICAgICAgICAgICB3ZSBtdXN0 IGRyYXcgdGhlIGxlZnRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICAqLworICAgICAg ICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gbmV4dC0+aGw7CisgICAgICAg ICAgICAgICAgbmV4dC0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY193MzJfc2V0X2ds eXBoX3N0cmluZ19nYyAobmV4dCwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICAgIHhfc2V0 X2dseXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBuZXh0KTsKKyAgICAgICAgICAgICAg ICBpZiAobmV4dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkKKyAgICAgICAgICAg ICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJp bmdfZm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3Rh bmdsZSAobmV4dC0+aGRjLCBOVUxMKTsKKyAgICAgICAgICAgICAgICBuZXh0LT5obCA9IHNhdmU7 CisgICAgICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICAgICAgICBu ZXh0LT5jbGlwX2hlYWQgPSBzLT5uZXh0OworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAg ICB9CisgIC8qIFJlc2V0IGNsaXBwaW5nLiAgKi8KKyAgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAo cy0+aGRjLCBOVUxMKTsKKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyogZW5kIE1VTFRJUExF LUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qIEZyaW5nZSBiaXRt YXBzLiAgKi8KIAogc3RhdGljIGludCBtYXhfZnJpbmdlX2JtcCA9IDA7CkBAIC01NDUsNiArMTM5 OCwxNSBAQCB4X3VwZGF0ZV9iZWdpbiAoc3RydWN0IGZyYW1lICpmKQogICBpZiAoISBGUkFNRV9X MzJfUCAoZikpCiAgICAgcmV0dXJuOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gZjsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBSZWdlbmVyYXRlIGRpc3BsYXkgcGFsZXR0 ZSBiZWZvcmUgZHJhd2luZyBpZiBsaXN0IG9mIHJlcXVlc3RlZAogICAgICBjb2xvcnMgaGFzIGNo YW5nZWQuICovCiAgIGlmIChkaXNwbGF5X2luZm8tPnJlZ2VuX3BhbGV0dGUpCkBAIC03NTQsNiAr MTYxNiwxNiBAQCB4X3VwZGF0ZV9lbmQgKHN0cnVjdCBmcmFtZSAqZikKIAogICAvKiBNb3VzZSBo aWdobGlnaHQgbWF5IGJlIGRpc3BsYXllZCBhZ2Fpbi4gICovCiAgIE1PVVNFX0hMX0lORk8gKGYp LT5tb3VzZV9mYWNlX2RlZmVyID0gZmFsc2U7CisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBOVUxM OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIApAQCAtNDA0MSwxMyArNDkx Myw3NCBAQCB3MzJfc2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHN0cnVjdCB3aW5kb3cgKncsCiAJ ICAgICAgcmVsZWFzZV9mcmFtZV9kYyAoZiwgaGRjKTsKIAkgICAgICB4X2NsZWFyX3VuZGVyX2lu dGVybmFsX2JvcmRlciAoZik7CiAJICAgIH0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogUkVQQUlOVElORyBXSEVOIFJFTU9W SU5HIFNDUk9MTCBCQVI6CisKKy0gU2VxdWVuY2Ugb2YgRXZlbnRzOgorCisgIC4gYHJlZGlzcGxh eV9pbnRlcm5hbCcgY2FsbHMgdGhlIGBjb25kZW1uX3Njcm9sbF9iYXJzX2hvb2snLCB3aGljaCBt YXJrcyBhbGwKKyAgICBzY3JvbGwgYmFycyBhcyBjYW5kaWRhdGVzIGZvciBkZWxldGlvbi4KKwor ICAuIFRoZW4gYHJlZGlzcGxheV9pbnRlcm5hbCcgY2FsbHMgYHJlZGlzcGxheV93aW5kb3dzJywg d2hpY2ggd2Fsa3MgdGhlCisgICAgd2luZG93LXRyZWUgYW5kIGV4YW1pbmVzIGVhY2ggd2luZG93 LCB3aGVyZWJ5IGVhY2ggd2luZG93IHRoYXQgaXMgc3RpbGwgYWxpdmUKKyAgICBpbiB0aGUgd2lu ZG93LXRyZWUgInJlZGVlbXMiIGl0cyBzY3JvbGwgYmFycyBieSBtYXJraW5nIHRoZW0gbm90IHRv IGJlCisgICAgZGVsZXRlZC4KKworICAuIFRoZW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X3dpbmRvdyAoZiwgaHdu ZCwgU1dfSElERSk7Ci0vKiogICAgICAgICAgIE1vdmVXaW5kb3cgKGh3bmQsIGxlZnQsIHRvcCwg d2lkdGgsIG1heCAoaGVpZ2h0LCAxKSwgVFJVRSk7ICoqLwotCSAgLyogVHJ5IHRvIG5vdCBkcmF3 IG92ZXIgY2hpbGQgZnJhbWVzLiAgKi8KLQkgIFNldFdpbmRvd1BvcyAoaHduZCwgSFdORF9CT1RU T00sIGxlZnQsIHRvcCwgd2lkdGgsIG1heCAoaGVpZ2h0LCAxKSwKLSAgICAgICAgICAgICAgICAg ICAgICAgIFNXUF9GUkFNRUNIQU5HRUQpOworICAgICAgICAgIGlmIChsZWZ0IDw9IGJhci0+bGVm dCkKKyAgICAgICAgICAgIG15X3Nob3dfd2luZG93IChmLCBod25kLCBTV19ISURFKTsKKyAgICAg ICAgICBNb3ZlV2luZG93IChod25kLCBsZWZ0LCB0b3AsIHdpZHRoLCBtYXggKGhlaWdodCwgMSks IGxlZnQgPD0gYmFyLT5sZWZ0KTsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCiAKIAkgIHNpLmNiU2l6ZSA9IHNpemVvZiAoc2kpOwogCSAg c2kuZk1hc2sgPSBTSUZfUkFOR0U7CkBAIC00MzE2LDYgKzUyNDksMjEgQEAgdzMyX2p1ZGdlX3Nj cm9sbF9iYXJzIChzdHJ1Y3QgZnJhbWUgKmYpCiAgICAgewogICAgICAgc3RydWN0IHNjcm9sbF9i YXIgKmIgPSBYU0NST0xMX0JBUiAoYmFyKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgLyogYERlc3Ryb3lXaW5kb3cnIHdpdGhp biBgeF9zY3JvbGxfYmFyX3JlbW92ZScgcmVwYWludHMgdGhlIHJlY3RhbmdsZS4KKyAgICAgIFRo ZXJlZm9yZSwgd2UgZmlyc3Qgc2VuZCBhIG1lc3NhZ2UgdG8gaW5oaWJpdCByZXBhaW50aW5nLiAq LworICAgICAgaWYgKCFXSU5ET1dfTElWRV9QIChiLT53aW5kb3cpKQorICAgICAgICB7CisgICAg ICAgICAgSFdORCBod25kID0gU0NST0xMX0JBUl9XMzJfV0lORE9XIChiKTsKKyAgICAgICAgICBT ZW5kTWVzc2FnZSAoaHduZCwgV01fU0VUUkVEUkFXLCBmYWxzZSwgMCk7CisgICAgICAgIH0KKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgeF9zY3JvbGxfYmFyX3JlbW92ZSAo Yik7CiAKICAgICAgIG5leHQgPSBiLT5uZXh0OwpAQCAtNzA5MSw2ICs4MDM5LDIxIEBAIGV4dGVy biBmcmFtZV9wYXJtX2hhbmRsZXIgdzMyX2ZyYW1lX3Bhcm1faGFuZGxlcnNbXTsKIAogc3RhdGlj IHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlIHczMl9yZWRpc3BsYXlfaW50ZXJmYWNlID0KIHsK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor LyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGB3MzJ0ZXJtLmNgIG11c3QgYmUgaW4gdGhlIGV4 YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3BleHRl cm4uaGAhICovCisKKyAgbWNfeF93cml0ZV9nbHlwaHMsCisgIG1jX3czMl9kcmF3X3dpbmRvd19j dXJzb3IsCisgIG1jX3czMl9kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICB3MzJfZnJhbWVfcGFybV9oYW5kbGVycywKICAgeF9wcm9kdWNlX2dseXBo cywKICAgeF93cml0ZV9nbHlwaHMsCmRpZmYgLS1naXQgYS9zcmMvd2luZG93LmggYi9zcmMvd2lu ZG93LmgKaW5kZXggZmRlZjQwNy4uZjI5NzViZSAxMDA2NDQKLS0tIGEvc3JjL3dpbmRvdy5oCisr KyBiL3NyYy93aW5kb3cuaApAQCAtODgsNiArODgsODQgQEAgZGlzcGxheSB0aGUgbWVudSBiYXIg b3IgdGhlIHRvb2wgYmFyICh3aGVuIEVtYWNzIHVzZXMgdG9vbGtpdHMgdGhhdAogZG9uJ3QgZGlz cGxheSB0aGVpciBvd24gbWVudSBiYXIgYW5kIHRvb2wgYmFyKSBvciBhIHRvb2x0aXAgaW4gYQog dG9vbHRpcCBmcmFtZSAod2hlbiB0b29sdGlwcyBhcmUgbm90IGRpc3BsYXkgYnkgdGhlIHRvb2xr aXQpLiAgKi8KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExF LUNVUlNPUlMgKi8KKworLyogU3VmZml4ZXMgZm9yIHRoZSBgbWNgIHdpbmRvdyBwb2ludGVyIHBy ZWZpeC4gKi8KK3N0cnVjdCBtdWx0aXBsZV9jdXJzb3JzCit7CisgIC8qIFRoZSByZWNvcmRlZCBw aXhlbCB3aWR0aCBvZiB0aGUgbGFzdCBsaW5lIG51bWJlciBkcmF3biBkdXJpbmcgcmVkaXNwbGF5 ICovCisgIGludCBsbnVtX3BpeGVsX3dpZHRoOworfTsKKworc3RydWN0IG11bHRpcGxlX2N1cnNv cnNfY2FjaGUKK3sKKyAgcHRyZGlmZl90IGFsbG9jYXRlZDsKKyAgcHRyZGlmZl90IHVzZWQ7Cisg IGVudW0gdHlwZV9vZl9jYWNoZQorICAgIHsKKyAgICAgIE5PX0NBQ0hFLAorICAgICAgTUNfQ0FD SEUsCisgICAgICBDSF9DQUNIRSwKKyAgICAgIEZDX0NBQ0hFCisgICAgfSBjYWNoZV90eXBlOwor ICBzdHJ1Y3QgaXRlbXNfaW5fY2FjaGUKKyAgICB7CisgICAgICBpbnQgeDsKKyAgICAgIGludCBm eDsKKyAgICAgIGludCB5OworICAgICAgaW50IGZ5OworICAgICAgaW50IGhwb3M7CisgICAgICBp bnQgdnBvczsKKyAgICAgIGludCB3ZDsKKyAgICAgIGludCBoOworICAgICAgZW51bSB0eXBlX29m X2N1cnNvcgorICAgICAgICB7CisgICAgICAgICAgLyogTk9URTogIFRoZSBmcmluZ2UgYml0bWFw IGZyYW1ld29yayByZWxpZXMgdXBvbiBNQ19OT19GUklOR0VfQklUTUFQCisgICAgICAgICAgSEFW SU5HIEEgVkFMVUUgT0YgWkVSTyAoMCkuICovCisgICAgICAgICAgTUNfTk9fRlJJTkdFX0JJVE1B UCwKKyAgICAgICAgICBNQ19OT19DVVJTT1IsCisgICAgICAgICAgTUNfUklHSFRfRlJJTkdFX0JJ VE1BUCwKKyAgICAgICAgICBNQ19MRUZUX0ZSSU5HRV9CSVRNQVAsCisgICAgICAgICAgTUNfRlJB TUVEX0JPWCwKKyAgICAgICAgICBNQ19GSUxMRURfQk9YLAorICAgICAgICAgIE1DX0hPTExPV19C T1gsCisgICAgICAgICAgTUNfQkFSLAorICAgICAgICAgIE1DX0hCQVIKKyAgICAgICAgfSBjdXJz b3JfdHlwZTsKKyAgICAgIGludCBjdXJzb3Jfd2lkdGg7CisgICAgICBzdHJ1Y3QgUkdCCisgICAg ICAgIHsKKyAgICAgICAgICBkb3VibGUgcmVkOworICAgICAgICAgIGRvdWJsZSBncmVlbjsKKyAg ICAgICAgICBkb3VibGUgYmx1ZTsKKyAgICAgICAgfSBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kOwor ICAgICAgYm9vbCBhY3RpdmVfcDsKKyAgICAgIGVudW0gbWNfZmxhdm9yCisgICAgICAgIHsKKyAg ICAgICAgICBOT19GTEFWT1IsCisgICAgICAgICAgTUNfR0xZUEgsCisgICAgICAgICAgTUNfR0xZ UEhMRVNTLAorICAgICAgICAgIE1DX09WRVJMQVlfQVJST1dfQklUTUFQLAorICAgICAgICAgIE1D X1BJTENST1csCisgICAgICAgICAgTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVywKKyAg ICAgICAgICBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XLAorICAgICAg ICAgIE1DX0hPTExPV19SRUNUQU5HTEUsCisgICAgICAgICAgTUNfVkVSVElDQUxfQkFSX1JJR0hU X0FSUk9XLAorICAgICAgICAgIE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVywK KyAgICAgICAgICBNQ19WRVJUSUNBTF9CQVIsCisgICAgICAgICAgTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSLAorICAgICAgICAgIE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgfSBn bHlwaF9mbGF2b3I7CisgICAgICBib29sIGVuYWJsZWRfcDsKKyAgICB9ICpjYWNoZXM7Cit9Owor CisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK Kwogc3RydWN0IGN1cnNvcl9wb3MKIHsKICAgLyogUGl4ZWwgcG9zaXRpb24uICBUaGVzZSBhcmUg YWx3YXlzIHdpbmRvdyByZWxhdGl2ZS4gICovCkBAIC0zMjQsNiArNDAyLDIxIEBAIHN0cnVjdCB3 aW5kb3cKIAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgc3RydWN0IG11bHRpcGxlX2N1 cnNvcnMgbWM7CisKKyAgICBzdHJ1Y3QgbXVsdGlwbGVfY3Vyc29yc19jYWNoZSBtY19lbHRzOwor CisgICAgc3RydWN0IG11bHRpcGxlX2N1cnNvcnNfY2FjaGUgY2hfZWx0czsKKworICAgIHN0cnVj dCBtdWx0aXBsZV9jdXJzb3JzX2NhY2hlIGZjX2VsdHM7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgICAvKiBDdXJzb3IgdHlwZSBvZiBsYXN0IGN1cnNvciBkcmF3biBvbiB0aGUg d2luZG93LiAgKi8KICAgICBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIHBoeXNfY3Vyc29yX3R5cGU7 CiAKQEAgLTExMjAsNiArMTIxMywxNSBAQCBleHRlcm4gdm9pZCByZWRpc3BsYXlfb3RoZXJfd2lu ZG93cyAodm9pZCk7CiAKIHN0cnVjdCBnbHlwaCAqZ2V0X3BoeXNfY3Vyc29yX2dseXBoIChzdHJ1 Y3Qgd2luZG93ICp3KTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKworc3RydWN0IGdseXBoICptY19nZXRfY3Vyc29yX2dseXBoIChzdHJ1Y3Qg d2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cg KnJvdywgaW50IGhwb3MsIGludCB2cG9zKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogLyogVHJ1ZSBpZiBXSU5ET1cgaXMgYSB2YWxpZCB3aW5kb3cuICAqLwogI2RlZmluZSBXSU5E T1dfVkFMSURfUChXSU5ET1cpCQkJCQlcCiAgIChXSU5ET1dQIChXSU5ET1cpICYmICFOSUxQIChY V0lORE9XIChXSU5ET1cpLT5jb250ZW50cykpCVwKZGlmZiAtLWdpdCBhL3NyYy94ZGlzcC5jIGIv c3JjL3hkaXNwLmMKaW5kZXggYTg4ZmM2OS4uMjgyYTU0MyAxMDA2NDQKLS0tIGEvc3JjL3hkaXNw LmMKKysrIGIvc3JjL3hkaXNwLmMKQEAgLTkyMSw2ICs5MjEsNDEwMCBAQCBzdGF0aWMgdm9pZCBz aG93X21vdXNlX2ZhY2UgKE1vdXNlX0hMSW5mbyAqLCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UpOwog c3RhdGljIGJvb2wgY29vcmRzX2luX21vdXNlX2ZhY2VfcCAoc3RydWN0IHdpbmRvdyAqLCBpbnQs IGludCk7CiAKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1D VVJTT1JTICovCisKKy8qIE1VTFRJUExFLUNVUlNPUlM6ICBFbWFjcyBCdWcgIzIyODczIChmZWF0 dXJlIHJlcXVlc3QpCisKKyAgQ1JPU1NIQUlSUzogIEVtYWNzIEJ1ZyAjMTc2ODQgKGZlYXR1cmUg cmVxdWVzdCkKKworCitWRVJTSU9OOgorCistIDAxOS4wMDIgWzA1LzAyLzIwMTldCistIDAxOS4w MDEgWzA0LzI4LzIwMTldCistIDAxOS4wMDAgWzA0LzIwLz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IgPT4gbWFrZV9maXhudW0KKworWElO VCA9PiBYRklYTlVNCisKK1hGQVNUSU5UID0+IFhGSVhOQVQKKworTGlzcF9PYmplY3Qgc3RyaW5n ID0gRnByaW4xX3RvX3N0cmluZyAoaV9zdG9yZSwgUW5pbCk7CitjaGFyICpjaGFyX3N0cmluZyA9 IFNTREFUQSAoc3RyaW5nKTsKK2ZwcmludGYgKHN0ZGVyciwgImlfc3RvcmU6ICAlc1xuIiwgY2hh cl9zdHJpbmcpOworCitjaGFyICp3X2NvbnRlbnRzID0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKSAm JiBTVFJJTkdQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG5hbWUpKSkKKyAgICAgICAg ICAgICAgICAgICA/IFNTREFUQSAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBuYW1lKSkK KyAgICAgICAgICAgICAgICAgICA6ICJuaWwiOworZnByaW50ZiAoc3RkZXJyLCAiXG5CdWZmZXIg KCVzKVxuIiwgd19jb250ZW50cyk7CisKK3N0cnVjdCBmYWNlICpmYWNlID0gLi4uCitMaXNwX09i amVjdCBmb3JlZ3JvdW5kID0gZmFjZS0+bGZhY2VbTEZBQ0VfRk9SRUdST1VORF9JTkRFWF07CitM aXNwX09iamVjdCBiYWNrZ3JvdW5kID0gZmFjZS0+bGZhY2VbTEZBQ0VfQkFDS0dST1VORF9JTkRF WF07CitmcHJpbnRmIChzdGRlcnIsICJcbmZvcmVncm91bmQgKCVzKSB8IGJhY2tncm91bmQgKCVz KVxuIiwKKyAgICAgICAgICAgICAgICAgKCFOSUxQIChmb3JlZ3JvdW5kKSA/IFNTREFUQSAoZm9y ZWdyb3VuZCkgOiAiTklMUCIpLAorICAgICAgICAgICAgICAgICAoIU5JTFAgKGJhY2tncm91bmQp ID8gU1NEQVRBIChiYWNrZ3JvdW5kKSA6ICJOSUxQIikpOworCitmcHJpbnRmIChzdGRlcnIsICJN eSBsaXNwIG9iamVjdDogICVzX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CQkJCQkgIEhMLCBYLCBMQVNUX1gpOwkJ XAorCSAgICAgIGJyZWFrOwkJCQkJCQlcCisJCQkJCQkJCQlcCisJICAgIGNhc2UgSU1BR0VfR0xZ UEg6CQkJCQkJXAorCSAgICAgIE1DX0JVSUxEX0lNQUdFX0dMWVBIX1NUUklORyAoU1RBUlQsIEVO RCwgSEVBRCwgVEFJTCwJCVwKKwkJCQkJSEwsIFgsIExBU1RfWCk7CQkJXAorCSAgICAgIGJyZWFr OworCisjZGVmaW5lIE1DX0JVSUxEX0dMWVBIX1NUUklOR1NfWFcoU1RBUlQsIEVORCwgSEVBRCwg VEFJTCwgSEwsIFgsIExBU1RfWCkJXAorICAgICAgICAgICAgY2FzZSBYV0lER0VUX0dMWVBIOiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICBN Q19CVUlMRF9YV0lER0VUX0dMWVBIX1NUUklORyAoU1RBUlQsIEVORCwgSEVBRCwgVEFJTCwgICAg ICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEwsIFgsIExB U1RfWCk7ICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICBicmVhazsKKworI2RlZmluZSBN Q19CVUlMRF9HTFlQSF9TVFJJTkdTXzIoU1RBUlQsIEVORCwgSEVBRCwgVEFJTCwgSEwsIFgsIExB U1RfWCkJXAorCSAgICBjYXNlIEdMWVBITEVTU19HTFlQSDoJCQkJCVwKKwkgICAgICBNQ19CVUlM RF9HTFlQSExFU1NfR0xZUEhfU1RSSU5HIChTVEFSVCwgRU5ELCBIRUFELCBUQUlMLAlcCisJCQkJ CSAgICBITCwgWCwgTEFTVF9YKTsJCVwKKwkgICAgICBicmVhazsJCQkJCQkJXAorCQkJCQkJCQkJ XAorCSAgICBkZWZhdWx0OgkJCQkJCQlcCisJICAgICAgZW1hY3NfYWJvcnQgKCk7CQkJCQkJXAor CSAgICB9CQkJCQkJCQlcCisJCQkJC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ICh0 YWlsLCBlbGVtKTsKKyAgICAgIHRhaWwgPSBlbGVtOworICAgIH0KKyAgdmFfZW5kIChhcCk7Cisg IHJldHVybiB2YWw7Cit9CisKK0xpc3BfT2JqZWN0CittY19tZW1xIChMaXNwX09iamVjdCBlbHQs IExpc3BfT2JqZWN0IGxpc3QpCit7CisgIHdoaWxlICgxKQorICAgIHsKKyAgICAgIGlmICghQ09O U1AgKGxpc3QpIHx8IEVRIChYQ0FSIChsaXN0KSwgZWx0KSkKKyAgICAgICAgYnJlYWs7CisgICAg ICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KSB8fCBFUSAoWENB UiAobGlzdCksIGVsdCkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3Qp OworICAgICAgaWYgKCFDT05TUCAobGlzdCkgfHwgRVEgKFhDQVIgKGxpc3QpLCBlbHQpKQorICAg ICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICB9CisgIHJldHVybiBs aXN0OworfQorCitMaXNwX09iamVjdAorbWNfbnRoIChpbnQgbnVtLCBMaXNwX09iamVjdCBsaXN0 KQoreworICBmb3IgKGludCBpID0gMDsgaSA8IG51bSAmJiAhTklMUCAobGlzdCk7IGkrKykKKyAg ICBsaXN0ID0gWENEUiAobGlzdCk7CisgIGlmIChDT05TUCAobGlzdCkpCisgICAgcmV0dXJuIFhD QVIgKGxpc3QpOworICAgIGVsc2UKKyAgICAgIHJldHVybiBRbmlsOworfQorCitMaXNwX09iamVj dAorbWNfYXNzcSAoTGlzcF9PYmplY3Qga2V5LCBMaXNwX09iamVjdCBsaXN0KQoreworICB3aGls ZSAoMSkKKyAgICB7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05T UCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYmIEVRIChYQ0FSIChYQ0FSIChsaXN0KSks IGtleSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAg IGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAg ICAgICAgICAgICAgJiYgRVEgKFhDQVIgKFhDQVIgKGxpc3QpKSwga2V5KSkpCisgICAgICAgIGJy ZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkK KyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiBFUSAo WENBUiAoWENBUiAobGlzdCkpLCBrZXkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0g WENEUiAobGlzdCk7CisgICAgfQorICBpZiAoQ09OU1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FS IChsaXN0KTsKKyAgICBlbHNlCisgICAgICByZXR1cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QK K21jX2Fzc29jIChMaXNwX09iamVjdCBrZXksIExpc3BfT2JqZWN0IGxpc3QpCit7CisgIExpc3Bf T2JqZWN0IGNhcjsKKyAgd2hpbGUgKDEpCisgICAgeworICAgICAgaWYgKCFDT05TUCAobGlzdCkK KyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiAoY2Fy ID0gWENBUiAoWENBUiAobGlzdCkpLAorICAgICAgICAgICAgICAgICAgRVEgKGNhciwga2V5KSB8 fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlz dCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAo Q09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiAoY2FyID0gWENBUiAoWENBUiAo bGlzdCkpLAorICAgICAgICAgICAgICAgICAgRVEgKGNhciwga2V5KSB8fCAhTklMUCAoRmVxdWFs IChjYXIsIGtleSkpKSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3Qp OworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxp c3QpKQorICAgICAgICAgICAgICAmJiAoY2FyID0gWENBUiAoWENBUiAobGlzdCkpLAorICAgICAg ICAgICAgICAgICAgRVEgKGNhciwga2V5KSB8fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkp CisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgIH0KKyAgaWYg KENPTlNQIChsaXN0KSkKKyAgICByZXR1cm4gWENBUiAobGlzdCk7CisgICAgZWxzZQorICAgICAg cmV0dXJuIFFuaWw7Cit9CisKK0xpc3BfT2JqZWN0CittY19wbGlzdF9nZXQgKExpc3BfT2JqZWN0 IHBsaXN0LCBMaXNwX09iamVjdCBwcm9wKQoreworICBMaXNwX09iamVjdCB0YWlsLCBoYWxmdGFp bDsKKyAgLyogaGFsZnRhaWwgaXMgdXNlZCB0byBkZXRlY3QgY2lyY3VsYXIgbGlzdHMuICAqLwor ICB0YWlsID0gaGFsZnRhaWwgPSBwbGlzdDsKKyAgd2hpbGUgKENPTlNQICh0YWlsKSAmJiBDT05T UCAoWENEUiAodGFpbCkpKQorICAgIHsKKyAgICAgIGlmIChFUSAocHJvcCwgWENBUiAodGFpbCkp KQorICAgICAgICByZXR1cm4gWENBUiAoWENEUiAodGFpbCkpOworICAgICAgdGFpbCA9IFhDRFIg KFhDRFIgKHRhaWwpKTsKKyAgICAgIGhhbGZ0YWlsID0gWENEUiAoaGFsZnRhaWwpOworICAgICAg aWYgKEVRICh0YWlsLCBoYWxmdGFpbCkpCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgcmV0dXJu IFFuaWw7Cit9CisKKy8qIENoZWNrIHRoZ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ZiAoc2NhbiA+PSBlbmQpCisgICAgICBn b3RvIGVuZGxvb3A7CisgIH0KKyAgICAgIC8qIFRlc3QgcmVhY2hpbmcgdGhlIGdvYWwgY29sdW1u LiAgV2UgZG8gdGhpcyBhZnRlciBza2lwcGluZworICAgaW52aXNpYmxlIGNoYXJhY3RlcnMsIHNv IHRoYXQgd2UgcHV0IHBvaW50IGJlZm9yZSB0aGUKKyAgIGNoYXJhY3RlciBvbiB3aGljaCB0aGUg Y3Vyc29yIHdpbGwgYXBwZWFyLiAqLworICAgICAgaWYgKGNvbCA+PSBnb2FsKQorICBicmVhazsK KyAgICAgIHByZXZfY29sID0gY29sOworICAgICAgeyAvKiBDaGVjayBkaXNwbGF5IHByb3BlcnR5 LiAqLworICBwdHJkaWZmX3QgZW5kcDsKKyAgaW50IHdpZHRoID0gbWNfY2hlY2tfZGlzcGxheV93 aWR0aCAoc2NhbiwgY29sLCAmZW5kcCk7CisgIGlmICh3aWR0aCA+PSAwKQorICAgIHsKKyAgICAg IGNvbCArPSB3aWR0aDsKKyAgICAgIGlmIChlbmRwID4gc2NhbikgLyogQXZvaWQgaW5maW5pdGUg bG9vcHMgd2l0aCAwLXdpZHRoIG92ZXJsYXlzLiAqLworICAgICAgICB7CisgICAgc2NhbiA9IGVu ZHA7CisgICAgc2Nhbl9ieXRlID0gQ0hBUl9UT19CWVRFIChzY2FuKTsKKyAgICBjb250aW51ZTsK KyAgICAgICAgfQorICAgIH0KKyAgICAgIH0KKyAgICAgIC8qIENoZWNrIGNvbXBvc2l0aW9uIHNl cXVlbmNlLiAqLworICAgICAgaWYgKGNtcF9pdC5pZCA+PSAwCisgICAgfHwgKHNjYW4gPT0gY21w X2l0LnN0b3BfcG9zCisgICAgICAgICYmIGNvbXBvc2l0aW9uX3Jlc2VhdF9pdCAoJmNtcF9pdCwg c2Nhbiwgc2Nhbl9ieXRlLCBlbmQsCisgICAgICAgICAgdywgTlVMTCwgUW5pbCkpKQorICBjb21w b3NpdGlvbl91cGRh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XJ2ZWMgPSBESVNQX0NIQVJf VkVDVE9SIChkcCwgYyk7CisgICAgbiA9IEFTSVpFIChjaGFydmVjKTsKKyAgICBmb3IgKGkgPSAw OyBpIDwgbjsgaSsrKQorICAgICAgeworICAgICAgICAvKiBUaGlzIHNob3VsZCBiZSBoYW5kbGVk IHRoZSBzYW1lIGFzCisgICAgIG5leHRfZWxlbWVudF9mcm9tX2Rpc3BsYXlfdmVjdG9yIGRvZXMg aXQuICovCisgICAgICAgIExpc3BfT2JqZWN0IGVudHJ5ID0gQVJFRiAoY2hhcnZlYywgaSk7Cisg ICAgICAgIGlmIChHTFlQSF9DT0RFX1AgKGVudHJ5KSkKKyAgICBjID0gR0xZUEhfQ09ERV9DSEFS IChlbnRyeSk7CisgICAgICAgIGVsc2UKKyAgICBjID0gJyAnOworICAgICAgICBpZiAoYyA9PSAn XG4nKQorICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgaWYgKGMgPT0gJ1xyJyAmJiBFUSAoQlZB UiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKQorICAgIGdvdG8gZW5k bG9vcDsKKyAgICAgICAgaWYgKGMgPT0gJ1x0JykKKyAgICB7CisgICAgICBjb2wgKz0gdGFiX3dp ZHRoOworICAgICAgY29sID0gY29sIC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOworICAgIH0KKyAg ICAgICAgZWxzZQorICAgICsrY29sOworICAgICAgfQorICB9CisgICAgICBlbHNlCisgIHsKKyAg ICAvKiBUaGUgZGlzcGxheSB0YWJsZSBkb2Vzbid0IGFmZmVjdCB0aGlzIGNoYXJhY3RlcjsKKyAg ICAgICBpdCBkaXNwbGF5cyBhcyBpdHNlbGYuICovCisgICAgaWYgKGMgPT0gJ1xuJykKKyAgICAg IGdvdG8gZW5kbG9vcDsKKyAgICBpZiAoYyA9PSAnXHInICYmIEVRIChCVkFSIChjdXJyZW50X2J1 ZmZlciwgc2VsZWN0aXZlX2Rpc3BsYXkpLCBRdCkpCisgICAgICBnb3RvIGVuZGxvb3A7CisgICAg aWYgKGMgPT0gJ1x0JykKKyAgICAgIHsKKyAgICAgICAgY29sICs9IHRhYl93aWR0aDsKKyAgICAg ICAgY29sID0gY29sIC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOworICAgICAgfQorICAgIGVsc2Ug aWYgKG11bHRpYnl0ZSAmJiBMRUFESU5HX0NPREVfUCAoYykpCisgICAgICB7CisgICAgICAgIC8q IFN0YXJ0IG9mIG11bHRpLWJ5dGUgZm9ybS4gKi8KKyAgICAgICAgdW5zaWduZWQgY2hhciAqcHRy OworICAgICAgICBpbnQgYnl0ZXMsIHdpZHRoOworICAgICAgICBwdHIgPSBCWVRFX1BPU19BRERS IChzY2FuX2J5dGUpOworICAgICAgICBNQ19NVUxUSUJZVEVfQllURVNfV0lEVEggKHB0ciwgZHAs IGJ5dGVzLCB3aWR0aCk7CisgICAgICAgIC8qIFN1YnRyYWN0IG9uZSB0byBjb21wZW5zYXRlIGZv ciB0aGUgaW5jcmVtZW50CisgICAgIHRoYXQgaXMgZ29pbmcgdG8gaGFwcGVuIGJlbG93LiAqLwor ICAgICAgICBzY2FuX2J5dGUgKz0gYnl0ZXMgLSAxOworICAgICAgICBjb2wgKz0gd2lkdGg7Cisg ICAgICB9CisgICAgZWxzZSBpZiAoY3RsX2Fycm93ICYmIChjIDwgMDQwIHx8IGMgPT0gMDE3Nykp CisgICAgICBjb2wgKz0gMjsKKyAgICBlbHNlIGlmIChjIDwgMDQwIHx8IGMgPj0gMDE3NykKKyAg ICAgIGNvbCArPSA0OworICAgIGVsc2UKKyAgICAgIGNvbCsrOworICB9CisgICAgICBzY2FuKys7 CisgICAgICBzY2FuX2J5dGUrKzsKKyAgICB9CisgZW5kbG9vcDoKKyAgbGFzdF9rbm93bl9jb2x1 bW4gPSBjb2w7CisgIGxhc3Rfa25vd25fY29sdW1uX3BvaW50ID0gcHQ7CisgIGxhc3Rfa25vd25f Y29sdW1uX21v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jb2w7CisgIHVuc2lnbmVkIGNoYXIg KnB0ciwgKnN0b3A7CisgIGJvb2wgdGFiX3NlZW47CisgIHB0cmRpZmZfdCBwb3N0X3RhYjsKKyAg aW50IGM7CisgIGludCB0YWJfd2lkdGggPSBTQU5FX1RBQl9XSURUSCAoY3VycmVudF9idWZmZXIp OworICBib29sIGN0bF9hcnJvdyA9ICFOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZlciwgY3RsX2Fy cm93KSk7CisgIHN0cnVjdCBMaXNwX0NoYXJfVGFibGUgKmRwID0gYnVmZmVyX2Rpc3BsYXlfdGFi bGUgKCk7CisgIGlmIChwdCA9PSBsYXN0X2tub3duX2NvbHVtbl9wb2ludAorICAgICAgJiYgTU9E SUZGID09IGxhc3Rfa25vd25fY29sdW1uX21vZGlmaWVkKQorICAgIHsKKyAgICAgIGlmIChvbGRf YnVmZmVyKQorICAgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKyAgICAg IHJldHVybiBsYXN0X2tub3duX2NvbHVtbjsKKyAgICB9CisgIC8qIElmIHRoZSBidWZmZXIgaGFz IG92ZXJsYXlzLCB0ZXh0IHByb3BlcnRpZXMsCisgICAgIG9yIG11bHRpYnl0ZSBjaGFyYWN0ZXJz LCB1c2UgYSBtb3JlIGdlbmVyYWwgYWxnb3JpdGhtLiAqLworICBpZiAoYnVmZmVyX2ludGVydmFs cyAoY3VycmVudF9idWZmZXIpCisgICAgICB8fCBidWZmZXJfaGFzX292ZXJsYXlzICgpCisgICAg ICB8fCBaICE9IFpfQllURSkKKyAgICB7CisgICAgICBFTUFDU19JTlQgY29sID0gTU9TVF9QT1NJ VElWRV9GSVhOVU07CisgICAgICBtY19zY2FuX2Zvcl9jb2x1bW4gKCZwdCwgJmNvbCwgTlVMTCwg cHQpOworICAgICAgeworICAgICAgICBpZiAob2xkX2J1ZmZlcikKKyAgICAgICAgICBzZXRfYnVm ZmVyX2ludGVybmFsIChvbGRfYnVmZmVyK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BvdmVyIGl0LiAq LworICAgIHN0b3AgPSBCRUdWX0FERFI7CisgICAgcHRyID0gR1BUX0FERFI7CisgICAgLyogQ2hl Y2sgd2hldGhlciB0aGF0IGJyaW5ncyB1cyB0byBiZWdpbm5pbmcgb2YgYnVmZmVyLiAqLworICAg IGlmIChCRUdWID49IEdQVCkKKyAgICAgIGJyZWFrOworICB9CisgICAgICBjID0gKi0tcHRyOwor ICAgICAgaWYgKGRwICYmIFZFQ1RPUlAgKERJU1BfQ0hBUl9WRUNUT1IgKGRwLCBjKSkpCisgIHsK KyAgICBjaGFydmVjID0gRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpOworICAgIG4gPSBBU0laRSAo Y2hhcnZlYyk7CisgIH0KKyAgICAgIGVsc2UKKyAgeworICAgIGNoYXJ2ZWMgPSBRbmlsOworICAg IG4gPSAxOworICB9CisgICAgICBmb3IgKGkgPSBuIC0gMTsgaSA+PSAwOyAtLWkpCisgIHsKKyAg ICBpZiAoVkVDVE9SUCAoY2hhcnZlYykpCisgICAgICB7CisgICAgICAgIC8qIFRoaXMgc2hvdWxk IGJlIGhhbmRsZWQgdGhlIHNhbWUgYXMKKyAgICAgbmV4dF9lbGVtZW50X2Zyb21fZGlzcGxheV92 ZWN0b3IgZG9lcyBpdC4gKi8KKyAgICAgICAgTGlzcF9PYmplY3QgZW50cnkgPSBBUkVGIChjaGFy dmVjLCBpKTsKKyAgICAgICAgaWYgKEdMWVBIX0NPREVfUCAoZW50cnkpKQorICAgIGMgPSBHTFlQ SF9DT0RFX0NIQVIgKGVudHJ5KTsKKyAgICAgICAgZWxzZQorICAgIGMgPSAnICc7CisgICAgICB9 CisgICAgaWYgKGMgPj0gMDQwICYmIGMgPCAwMTc3KQorICAgICAgY29sKys7CisgICAgZWxzZSBp ZiAoYyA9PSAnXG4nCisgICAgICAgfHwgKGMgPT0gJ1xyJworICAgICAgICAgICAmJiBFUSAoQlZB UiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKSkKKyAgICAgIHsKKyAg ICAgICAgcHRyKys7CisgICAgICAgIGdvdG8gc3RhcnRfb2ZfbGluZV9mb3VuZDsKKyAgICAgIH0K KyAgICBlbHNlIGlmIChjID09ICdcdCcpCisgICAgICB7CisgICAgICAgIGlmICh0YWJfc2VlbikK KyAgICBjb2wgPSAoKGNvbCArIHRhYl93aWR0aCkgLyB0YWJfd2lkdGgpICogdGFiX3dpZHRoOwor ICAgICAgICBwb3N0X3RhYiArPSBjb2w7CisgICAgICAgIGNvbCA9IDA7CisgICAgICAgIHRhYl9z ZWVuID0gMTsKKyAgICAgIH0KKyAgICBlbHNlIGlmIChWRUNUT1JQIChjaGFydmVjKSkKKyAgICAg IC8qIFdpdGggYSBkaXNwbGF5IHRhYmxlIGVudHJ5LCBDIGlzIGRpc3BsYXllZCBhcyBpcywgYW5k CisgICAgICAgICBub3QgZGlzcGxheWVkIGFzIFxOTk4gb3IgYXMgXk4uICBJZiBDIGlzIGEgc2lu Z2xlLWJ5dGUKKyAgICAgICAgIGNoYXJhY3RlciwgaXQgdGFrZXMgb25lIGNvbHVtbi4gIElmIEMg aXMgbXVsdGktYnl0ZSBpbgorICAgICAgICAgYSB1bmlieXRlIGJ1ZmZlciwgaXQncyB0cmFuc2xh dGVkIHRvIHVuaWJ5dGUsIHNvIGl0CisgICAgICAgICBhbHNvIHRha2VzIG9uZSBjb2x1bW4uICov CisgICAgICArK2NvbDsKKyAgICBlbHNlCisgICAgICBjb2wgKz0gKGN0bF9hcnJvdyAmJiBjIDwg MDIwMCkgPyAyIDogNDsKKyAgfQorICAgIH0KKyBzdGFydF9vZl9saW5lX2ZvdW5kOgorICBpZiAo dGFiX3NlZW4pCisgICAgeworICAgICAgY29sID0gKChjb2wgKyB0YWJfd2lkdGgpIC8gdGFiX3dp ZHRoKSAqIHRhYl93aWR0aDsKKyAgICAgIGNvbCArPSBwb3N0X3RhYjsKKyAgICB9CisgIGxhc3Rf a25vd25fY29sdW1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2No YXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkpOyAqLworY2hhciAqCittY19jaGFyX3RvX3N0cmlu ZyAoaW50IGFyZykKK3sKKyAgTGlzcF9PYmplY3QgY2hhcmFjdGVyID0gKDAgPD0gYXJnICYmIGFy ZyA8PSBNQVhfQ0hBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgID8gRmNoYXJfdG9fc3Ry aW5nIChtYWtlX2ZpeG51bSAoYXJnKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIDogUW5p bDsKKyAgY2hhciAqIHJlc3VsdCA9ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAg ICAgICYmIGFyZyA9PSA5KQorICAgICAgICAgICAgICAgICAgICA/ICJcXHQiCisgICAgICAgICAg ICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJn ID09IDEwKQorICAgICAgICAgICAgICAgICAgICA/ICJcXG4iCisgICAgICAgICAgICAgICAgICA6 ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDMyKQor ICAgICAgICAgICAgICAgICAgICA/ICJcXHMiCisgICAgICAgICAgICAgICAgICA6ICghTklMUCAo Y2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9IDkKKyAgICAgICAgICAg ICAgICAgICAgICYmIGFyZyAhPSAxMAorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9IDMy KQorICAgICAgICAgICAgICAgICAgICA/IFNTREFUQSAoY2hhcmFjdGVyKQorICAgICAgICAgICAg ICAgICAgOiAiXFw/IjsKKyAgcmV0dXJuIHJlc3VsdDsKK30KKworaW50CittY19saXNwX3RvX2N1 cnNvcl90eXBlIChMaXNwX09iamVjdCBhcmcpCit7CisgIGNoYXIgKnN0cjsKKyAgaWYgKFhUWVBF IChhcmcpID09IExpc3BfU3RyaW5nKQorICAgIHN0ciA9IFNTREFUQSAoYXJnKTsKKyAgICBlbHNl IGlmIChYVFlQRSAoYXJnKSA9PSBMaXNwX1N5bWJvbCkKKyAgICAgIHN0ciA9IFNTREFUQSAoU1lN Qk9MX05BTUUgKGFyZykpOworICAgICAgZWxzZSByZXR1cm4gLTE7CisgIGlmICghc3RyY21wIChz dHIsICJubyIpKQorICAgIHJldHVybiBNQ19OT19DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIs ICJtYy1sZWZ0LWZyaW5nZS1iaXRtYXAiKSkKKyAgICByZXR1cm4gTUNfTEVGVF9GUklOR0VfQklU TUFQOworICBpZiAoIXN0cmNtcCAoc3RyLCAibWMtcmlnaHQtZnJpbmdlLWJpdG1hcCIpKQorICAg IHJldHVybiBNQ19SSUdIVF9GUklOR0VfQklUTUFQOworICBpZiAoIXN0cmNtcCAoc3RyLCAiYm94 IikpCisgICAgcmV0dXJuIE1DX0ZJTExFRF9CT1g7CisgIGlmICghc3RyY21wIChzdHIsICJmcmFt ZWQiKSkKKyAgICByZXR1cm4gTUNfRlJBTUVEX0JPWDsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgImhv bGxvdyIpKQorICAgIHJldHVybiBNQ19IT0xMT1dfQk9YOworICBpZiAoIXN0cmNtcCAoc3RyLCAi YmFyIikpCisgICAgcmV0dXJuIE1DX0JBUjsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgImhiYXIiKSkK KyAgICByZXR1cm4gTUNfSEJBUjsKKyAgcmV0dXJuIC0xOworfQorCisvKiBVU0FHRTogIGZwcmlu dGYgKHN0ZGVyciwgIkNVUlNPUiBUWVBFICglcykiLCBtY19jdXJzb3JfdHlwZV90b19zdHJpbmcg KGFyZykpOyAqLworY2hhciAqCittY19jdXJzb3JfdHlwZV90b19zdHJpbmcgKGVudW0gdHlwZV9v Zl9jdXJzb3IgY3Vyc29yX3R5cGUpCit7CisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgewor ICAgICAgY2FzZSBNQ19GSUx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bmQsIGhlYWQsIHRhaWwsIGhsLCB4LCBsYXN0X3gpOworICBpZiAodGFpbCkKKyAgICB7 CisgICAgICBzID0gZ2x5cGhfc3RyaW5nX2NvbnRhaW5pbmdfYmFja2dyb3VuZF93aWR0aCAodGFp bCk7CisgICAgICB4X3JlYWNoZWQgPSBzLT54ICsgcy0+YmFja2dyb3VuZF93aWR0aDsKKyAgICB9 CisgIGVsc2UKKyAgICB4X3JlYWNoZWQgPSB4OworICAvKiBJZiB0aGVyZSBhcmUgYW55IGdseXBo cyB3aXRoIGxiZWFyaW5nIDwgMCBvciByYmVhcmluZyA+IHdpZHRoIGluCisgICAgIHRoZSByb3cs IHJlZHJhdyBzb21lIGdseXBocyBpbiBmcm9udCBvciBmb2xsb3dpbmcgdGhlIGdseXBoCisgICAg IHN0cmluZ3MgYnVpbHQgYWJvdmUuICovCisgIGlmIChoZWFkICYmICFvdmVybGFwcyAmJiByb3ct PmNvbnRhaW5zX292ZXJsYXBwaW5nX2dseXBoc19wKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlw aF9zdHJpbmcgKmgsICp0OworICAgICAgTW91c2VfSExJbmZvICpobGluZm8gPSBNT1VTRV9ITF9J TkZPIChmKTsKKyAgICAgIGludCBtb3VzZV9iZWdfY29sIFVOSU5JVCwgbW91c2VfZW5kX2NvbCBV TklOSVQ7CisgICAgICBib29sIGNoZWNrX21vdXNlX2ZhY2UgPSBmYWxzZTsKKyAgICAgIGludCBk dW1teV94ID0gMDsKKyAgICAgIC8qIElmIG1vdXNlIGhpZ2hsaWdodGluZyBpcyBvbiwgd2UgbWF5 IG5lZWQgdG8gZHJhdyBhZGphY2VudAorICAgZ2x5cGhzIHVzaW5nIG1vdXNlLWZhY2UgaGlnaGxp Z2h0aW5nLiAqLworICAgICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYmIHJvdy0+bW91c2VfZmFj ZV9wCisgICAgJiYgaGxpbmZvLT5tb3VzZV9mYWNlX2JlZ19yb3cgPj0gMAorICAgICYmIGhsaW5m by0+bW91c2VfZmFjZV9lbmRfcm93ID49IDApCisgIHsKKyAgICBwdHJkaWZmX3Qgcm93X3Zwb3Mg PSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgdy0+Y3VycmVudF9tYXRyaXgpOworICAgIGlmIChyb3df dnBvcyA+PSBobGluZm8tPm1vdXNlX2ZhY2VfYmVnX3JvdworICAgICAgICAmJiByb3dfdnBvcyA8 PSBobGluZm8tPm1vdXNlX2ZhY2VfZW5kX3JvdykKKyAgICAgIHsKKyAgICAgICAgY2hlY2tfbW91 c2VfZmFjZSA9IHRydWU7CisgICAgICAgIG1vdXNlX2JlZ19jb2wgPSAocm93X3Zwb3MgPT0gaGxp bmZvLT5tb3VzZV9mYWNlX2JlZ19yb3cpCisgICAgICAgICAgICAgICAgICAgICAgICA/IGhsaW5m by0+bW91c2VfZmFjZV9iZWdfY29sCisgICAgICAgICAgICAgICAgICAgICAgICA6IDA7CisgICAg ICAgIG1vdXNlX2VuZF9jb2wgPSAocm93X3Zwb3MgPT0gaGxpbmZvLT5tb3VzZV9mYWNlX2VuZF9y b3cpCisgICAgICAgICAgICAgICAgICAgICAgICA/IGhsaW5mby0+bW91c2VfZmFjZV9lbmRfY29s CisgICAgICAgICAgICAgICAgICAgICAgICA6IHJvdy0+dXNlZFtURVhUX0FSRUFdOworICAgICAg fQorICB9CisgICAgICAvKiBDb21wdXRlIG92ZXJoYW5ncyBmb3IgYWxsIGdseXBoIHN0cmluZ3Mu ICovCisgICAgICBpZiAoRlJBTUVfUklGIChmKS0+Y29tcHV0ZV9nbHlwaF9zdHJpbmdfb3Zlcmhh bmdzKQorICBmb3IgKHMgPSBoZWFkOyBzOyBzID0gcy0+bmV4dCkKKyAgICBGUkFNRV9SSUYgKGYp LT5jb21wdXRlX2dseXBoX3N0cmluZ19vdmVyaGFuZ3MgKHMpOworICAgICAgLyogUHJlcGVuZCBn bHlwaCBzdHJpbmdzIGZvciBnbHlwaHMgaW4gZnJvbnQ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ID0gdGFpbDsKKyAgICBpKys7ICAgICAgLyog V2UgbXVzdCBpbmNsdWRlIHRoZSBJdGggZ2x5cGguICovCisgICAgTUNfQlVJTERfR0xZUEhfU1RS SU5HUyAoZW5kLCBpLCBoLCB0LAorICAgICAgICAgICAgIG92ZXJsYXBfaGwsIHgsIGxhc3RfeCk7 CisgICAgZm9yIChzID0gaDsgczsgcyA9IHMtPm5leHQpCisgICAgICBzLT5iYWNrZ3JvdW5kX2Zp bGxlZF9wID0gdHJ1ZTsKKyAgICBjb21wdXRlX292ZXJoYW5nc19hbmRfeCAoaCwgdGFpbC0+eCAr IHRhaWwtPndpZHRoLCBmYWxzZSk7CisgICAgYXBwZW5kX2dseXBoX3N0cmluZ19saXN0cyAoJmhl YWQsICZ0YWlsLCBoLCB0KTsKKyAgfQorICAgICAgdGFpbCA9IGdseXBoX3N0cmluZ19jb250YWlu aW5nX2JhY2tncm91bmRfd2lkdGggKHRhaWwpOworICAgICAgaWYgKGNsaXBfdGFpbCkKKyAgY2xp cF90YWlsID0gZ2x5cGhfc3RyaW5nX2NvbnRhaW5pbmdfYmFja2dyb3VuZF93aWR0aCAoY2xpcF90 YWlsKTsKKyAgICAgIGlmIChjbGlwX2hlYWQgfHwgY2xpcF90YWlsKQorICBmb3IgKHMgPSBoZWFk OyBzOyBzID0gcy0+bmV4dCkKKyAgICB7CisgICAgICBzLT5jbGlwX2hlYWQgPSBjbGlwX2hlYWQ7 CisgICAgICBzLT5jbGlwX3RhaWwgPSBjbGlwX3RhaWw7CisgICAgfQorICAgIH0KKyAgLyogRHJh dyBhbGwgc3RyaW5ncy4gKi8KKyAgZm9yIChzID0gaGVhZDsgczsgcyA9IHMtPm5leHQpCisgICAg RlJBTUVfUklGIChmKS0+bWNfc2NyaWJlX3N0cmluZyAocywgbWF0cml4LCByb3csIGxzbCwgZ2x5 cGhfZmxhdm9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90 eXBlLCB3ZCwg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orICAgICAgICAgICAgICAgICAgICAg IHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsCisgICAgICAg ICAgICAgICAgICAgICAgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3JfdHlwZSwgaW50IHdkLCBi b29sIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3ApCit7 CisgIHN0cnVjdCBnbHlwaF9yb3cgKmJvdHRvbV9yb3cgPSBNQVRSSVhfQk9UVE9NX1RFWFRfUk9X IChtYXRyaXgsIHcpOworICBpbnQgYm90dG9tX3Zwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKGJvdHRv bV9yb3csIG1hdHJpeCk7CisvKgorICAgICAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGggPSBt Y19nZXRfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgaHBvcywgdnBvcyk7CisgICAgICBm cHJpbnRmIChzdGRlcnIsICJtY19kcmF3X2N1cnNvcl9nbHlwaDogIGNoICglZCkgfCB4ICglZCks IGhwb3MgKCVkKSwgdnBvcyglZCksIGhsICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAg IGN1cnNvcl9nbHlwaC0+dS5jaCwgeCwgaHBvcywgdnBvcywgaGwpOworKi8KKyAgYmxvY2tfaW5w dXQgKCk7CisgIG1jX2RyYXdfZ2x5cGhzICh3LCBtYXRyaXgsIHJvdywgeCwgVEVYVF9BUkVBLCBo cG9zLCBocG9zICsgMSwgaGwsIDAsCisgICAgICAgICAgICAgICAgICB2cG9zLCBib3R0b21fdnBv cywgbHNsLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsCisgICAgICAg ICAgICAgICAgICBjdXJzb3JfZ2NfcCwgTUNfRFJBV19HTFlQSCk7CisgIHVuYmxvY2tfaW5wdXQg KCk7CisgIC8qIFdoZW4gd2UgZ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bWF0cml4LT5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgaWYgKGJhcmZf Y3Jhc2hfb25lKQorICAgIHJldHVybjsKKyAgYm9vbCBiYXJmX2NyYXNoX3R3byA9ICh2cG9zID49 IDAgJiYgdnBvcyA8IG1hdHJpeC0+bnJvd3MpID8gZmFsc2UgOiB0cnVlOworICBpZiAoYmFyZl9j cmFzaF90d28pCisgICAgcmV0dXJuOworICBpZiAoeCA8IDAKKyAgICAgIHx8IHkgPCAwCisgICAg ICB8fCBocG9zIDwgMAorICAgICAgfHwgdnBvcyA8IDApCisgICAgcmV0dXJuOworICBMaXNwX09i amVjdCBidWYgPSB3LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYpOworICBib29sIGF1 dG9faHNjcm9sbF9tb2RlX3AgPSBFUSAoRmJ1ZmZlcl9sb2NhbF92YWx1ZSAoUWF1dG9faHNjcm9s bF9tb2RlLCBidWYpLCBRY3VycmVudF9saW5lKTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwtbGVm dCA1KSAqLworICBib29sIGhzY2xfYWxsX3RlbXBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9s bAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IDApOworICAvKiBFWEFNUExFOiAgQy11IEMt eCA8IGFuZCBkbyBub3RoaW5nLiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMF9wID0gKHctPnN1 c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19o c2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwg PiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9s bCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyBlbHNlIGJlc2lk ZXMgaG9yaXpvbnRhbGx5IHNjcm9sbGluZyB0aGUKKyAgICAgICAgICAgICAgIGN1cnJlbnQgbGlu ZSBkaWZmZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jp em9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8x X3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hz Y3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwg PT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIC4uLgorICAgICAg ICAgICAgICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZm ZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzJfcCA9ICghdy0+c3VzcGVuZF9hdXRv X2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9k ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA9PSAwCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIC8q IEVYQU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSk7IGFuZCwgdGhlbiBwcmVzcyB0aGUgbGVmdCBhcnJv dyBrZXkgb25lIHRpbWUuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9u dGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuKi8KKyAgYm9vbCBoc2NsX3RlbXBfcCA9ICghdy0+ c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3Jv bGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTog IEMtdSBDLXggPCBhbmQgZG8gc29tZXRoaW5nIHRoYXQgY2F1c2VzIHRoZSBjdXJyZW50IGxpbmUg dG8gYmUKKyAgICAgICAgICAgICAgIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4K KyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBk aWZmZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX3Blcm1fcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hz Y3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAg ICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5f aHNjcm9sbCA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9wCisgICAgICAgICAgICAgICAg IHx8IGhzY2xfYWxsX3Blcm1fMl9wCisgICAgICAgICAgICAgICAgIHx8IGhzY2xfdGVtcF9wCisg ICAgICAgICAgICAgICAgIHx8IGhzY2xfcGVybV9wKSkKKyAgICAgIHsKKyAgICAgICAgZW51bSBm YWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgKCFhY3RpdmVfcAorICAg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2 ZV93aW5kb3dzKSkpCisgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJu ICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5hY3RpdmUtZmFjZSIpLCB0cnVlKQorICAgICAgICAg IDogKGFjdGl2ZV9wKQorICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtZmFjZSIpLCB0cnVlKQorICAgICAgICAgIDogREVG QVVMVF9GQUNFX0lEOworICAgICAgICBmYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRf RlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lk CisgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgaWYgKGhzY2xf YWxsX3Blcm1fMF9wKQorICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2Jp dG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAg ICBlbHNlIGlmIChoc2NsX2FsbF9wZXJtXzFfcCkKKyAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAg PSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1ZSwg ZmFsc2UpOworICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8yX3ApCisgICAgICAg ICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgi Ky1oc2NsLXBlcm0iKSwgZmFsc2UsIHRydWUpOworICAgICAgICAgICAgICBlbHNlIGlmIChoc2Ns X3Blcm1fcCkKKyAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9i aXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIHRydWUsIHRydWUpOworICAgICAgICAg ICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3RlbXBfcCkKKyAgICAgICAgICAgICAgICAgIGZyaW5n ZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXRlbXAi KSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfdGVtcF9w KQorICAgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRt YXAgKHcsIGludGVybiAoIistaHNjbC10ZW1wIiksIHRydWUsIGZhbHNlKTsKKyAgICAgICAgLyog QXMgdG8gYHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXBgLCB0aGUgZmFjZSBtYXkgYmUgY2hhbmdl ZCB1c2luZworICAgICAgICB0aGUgYGZhY2UtcmVtYXBwaW5nLWFsaXN0JyBzbyBsb25nIGFzIHdl IGhhdmUgYSBMaXNwIHNldHRpbmcgb2Y6CisgICAgICAgICAgKHNldC1mcmluZ2UtYml0bWFwLWZh Y2UgJystZnJpbmdlLXJpZ2h0LWFycm93ICcrLW92ZXJsYXktYXJyb3ctZmFjZSkKKyAgICAgICAg SWYgd2UgdXNlI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W5nZV9iaXRtYXBfcGVy aW9kaWNfcCA9IGZhbHNlOworICAgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywg dHJ1ZSwgY3Vyc29yX3R5cGUpOworICAgICAgfQorICAgICAgZWxzZSBpZiAoIXJlbW92ZV9wCisg ICAgICAgICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklH SFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJT RURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGds eXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAgICAgICAgICAgfHwg Z2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAg ICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRf QVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxf QkFSCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZF UlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJU SUNBTF9CQVJfQkFDS1NMQVNIKSkKKyAgICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IGJp dG1hcF9mbGF2b3IgPSAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRf QVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxv d19yZWN0YW5nbGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklH SFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNf cmV2ZXJzZWRfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdM RSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3df cmVjdGFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBo X2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBN Q19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX3JpZ2h0X2Fy cm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZv ciA9PSBNQ19WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBRbWNfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGlj YWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2Zs YXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBRbmlsOworICAgICAgICAgIGZyaW5nZV9i aXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBsb29rdXBfZnJpbmdlX2JpdG1hcCAoYml0bWFwX2ZsYXZvcikK KyAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAg ICAgIGZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAg ICAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1df UkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhf Zmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAg ICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9C QVIpKQorICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGlu dGVybiAoIistcmV2ZXJzZWQtdmVydGljYWwtYmFyLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAg ICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAg ICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9XX1JF Q1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2 b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAg ICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisg ICAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgi Ky12ZXJ0aWNhbC1iYXItZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgICAgICA6IERFRkFV TFRfRkFDRV9JRDsKKyAgICAgICAgICByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9IGZhbHNlOwor ICAgICAgICAgIHJvdy0+cmlnaHRfZnJpbmdlX2JpdG1hcCA9IGZyaW5nZV9iaXRtYXA7CisgICAg ICAgICAgcm93LT5yaWdodF9mcmluZ2VfZmFjZV9pZCA9IGZhY2VfaWQ7CisgICAgICAgICAgcm93 LT5yaWdodF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBf cGVyaW9kaWNfcCA9IGZhbHNlOworICAgICAgICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcCAodywg cm93LCBmYWxzZSwgY3Vyc29yX3R5cGUpOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGds eXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3Ig PT0gTUNfR0xZUEhMRVNTKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgb25fcCA9IHRy dWU7CisgICAgICAgICAgICBGUkFNRV9SSUYgKGYpLT5tY19zY3JpYmVfY3Vyc29yICh3LCBtYXRy aXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgdnBvcywgd2QsIGgsIGxzbCwgY3Vyc29yX3R5cGUsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGdseXBo X2ZsYXZvciwgb25fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGFjdGl2ZV9wKTsKKyAgICAgICAgICB9Cit9CisKKy8qIER1bXAgY29udGVudHMgb2YgZ2x5 cGggR0xZUEggdG8gc3RkZXJyLiAgUk9XIGFuZCBBUkVBIGFyZQorICAgdGhlIGdseXBoIHJvdyBh bmQgYXJlYSB3aGVyZSB0aGUgZ2x5cGggY29tZXMgZnJvbS4gKi8KK3ZvaWQKK21jX2R1bXBfZ2x5 cGggKHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgc3RydWN0IGdseXBoICpnbHlwaCwgaW50IGFyZWEs IGludCByZWxhdGl2ZV94KQoreworICBpZiAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAg ICAgfHwgZ2x5cGgtPnR5cGUgPT0gR0xZUEhMRVNTX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmlu dGYgKHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNk IDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAlNWQgJTRkICAlM2QgICUzZCAlcyAlc1xuIiwKKyAgICAg ICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFth cmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVf eCwKKyAgICAgICAgKGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgID8gJ0MnCisg ICAgICAgICA6ICdHJyksCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVS UCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChn bHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAgKGds eXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAnLScp KSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPnUuY2gsCisg ICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAor ICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBo LT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIs CisgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkpOworICAgIH0KKyAgZWxz ZSBpZiAoZ2x5cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRm IChzdGRlcnIsCisgICAgICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAw eCUwNnggJTRkICUxLjFkJTEuMWQgJTVkICU0ZCAgJTNkICAlM2QgJXMgJXNcbiIsCisgICAgICAg IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJl YV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gs CisgICAgICAgICdTJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQ IChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAgICAgICA6IChTVFJJTkdQ IChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICA6IChOSUxQIChn bHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICA6ICctJykpKSwKKyAg ICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAwdSwKKyAgICAgICAgZ2x5cGgtPmZh Y2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5y aWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9z LCBnbHlwaC0+dnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgIlxcUyIp OworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgewor ICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTki cEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVj XG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgo cm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAg ICByZWxhdGl2ZV94LAorICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAg ICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ0InCisgICAgICAg ICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAg ICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJzAnCisgICAgICAgICAg OiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2lnbmVk IGludCkgZ2x5cGgtPnUuaW1nX2lkLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAg Z2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3As CisgICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBn bHlwaC0+enZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicpOworICAgIH0KKyAgZWxzZSBp ZiAoZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYg KHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4 JTA2eCIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAg KChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAg ICAgIHJlbGF0aXZlX3gsCisgICAgICAgICcrJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisg ICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAg ICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAg ICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAg ICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5zaWdu ZWQgaW50KSBnbHlwaC0+dS5jbXAuaWQpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICU0ZCAl MS4xZCUxLjFkIiwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0 X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wKTsKKyAgICAgIGlm IChnbHlwaC0+dS5jbXAuYXV0b21hdGljKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTVk ICU0ZCAgJTNkICAlM2QgJXMgLiBbJWQtJWRdXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAg IGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZf cCA/ICJaViIgOiAiLS0iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT5zbGljZS5j bXAuZnJvbSwgZ2x5cGgtPnNsaWNlLmNtcC50byk7CisgICAgICAgIGVsc2UKKyAgICAgICAgZnBy aW50ZiAoc3RkZXJyLCAiXG4iKTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IFhX SURHRVRfR0xZUEgpCisgICAgeworI2lmbmRlZiBIQVZFX1hXSURHRVRTCisgICAgICBlYXNzdW1l IChmYWxzZSk7CisjZWxzZQorICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICAlNWQv JS01ZCAlNWQgJTRjICU2ZCAlYyAlM2QgMHglMDV4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUz ZCAgJTNkICVzICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0s CisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAt IDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5j aGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgPyAn QicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdT JworICAgICAgICAgOiAnLScpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAg ICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAg ICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT51Lnh3aWRnZXQsCisg ICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlw aC0+enZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicpOworI2VuZGlmCisgICAgfQorfQor CisvKiBEdW1wIHRoZSBjb250ZW50cyBvZiBnbHlwaCByb3cgYXQgVlBPUyBpbiBNQVRSSVggdG8g c3RkZXJyLgorICAgR0xZUEhTIDAgbWVhbnMgZG9uJ3Qgc2hvdyBnbHlwaCBjb250ZW50cy4KKyAg IEdMWVBIUyAxIG1lYW5zIHNob3cgZ2x5cGhzIGluIHNob3J0IGZvcm0KKyAgIEdMWVBIUyA+IDEg bWVhbnMgc2hvdyBnbHlwaHMgaW4gbG9uZyBmb3JtLiAqLwordm9pZAorbWNfZHVtcF9nbHlwaF9y b3cgKHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IHZwb3MsIGludCBnbHlwaHMpCit7CisgIGlu dCByZWxhdGl2ZV94ID0gMDsKKyAgaWYgKGdseXBocyAhPSAxKQorICAgIHsKKyAgICAgIGZwcmlu dGYgKHN0ZGVyciwgIlxuRFVNUCBHTFlQSCBST1dcbiIpOworICAgICAgZnByaW50ZiAoc3RkZXJy LCAiUm93ICAgICBTdGFydCAgICAgICBFbmQgVXNlZCBvRT48XFxDVFpGZXNtICAgICBYICAgIFkg ICAgVyAgICBIICAgIFYgICAgQSAgICBQXG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIj09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PVxuIik7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIlM2QgJTki cEQiZCAlOSJwRCJkICU0ZCAlMS4xZCUxLjFkJTEuMWQlMS4xZFwKKyUxLjFkJTEuMWQlMS4xZCUx LjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQgICU0ZCAlNGQgJTRkICU0ZCAlNGQgJTRkICU0ZFxuIiwK KyAgICAgICAgIHZwb3MsCisgICAgICAgICBNQVRSSVhfUk9XX1NUQVJUX0NIQVJQT1MgKHJvdyks CisgICAgICAgICBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpLAorICAgICAgICAgcm93LT51 c2VkW1RFWFRfQVJFQV0sCisgICAgICAgICByb3ctPmNvbnRhaW5zX292ZXJsYXBwaW5nX2dseXBo c19wLAorICAgICAgICAgcm93LT5lbmFibGVkX3AsCisgICAgICAgICByb3ctPnRydW5jYXRlZF9v bl9sZWZ0X3AsCisgICAgICAgICByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wLAorICAgICAgICAg cm93LT5jb250aW51ZWRfcCwKKyAgICAgICAgIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVf UCAocm93KSwKKyAgICAgICAgIE1BVFJJWF9ST1dfRElTUExBWVNfVEVYVF9QIChyb3cpLAorICAg ICAgICAgcm93LT5lbmRzX2F0X3p2X3AsCisgICAgICAgICByb3ctPmZpbGxfbGluZV9wLAorICAg ICAgICAgcm93LT5lbmRzX2luX21pZGRsZV9vZl9jaGFyX3AsCisgICAgICAgICByb3ctPnN0YXJ0 c19pbl9taWRkbGVfb2ZfY2hhcl9wLAorICAgICAgICAgcm93LT5tb3VzZV9mYWNlX3AsCisgICAg ICAgICByb3ctPngsCisgICAgICAgICByb3ctPnksCisgICAgICAgICByb3ctPnBpeGVsX3dpZHRo LAorICAgICAgICAgcm93LT5oZWlnaHQsCisgICAgICAgICByb3ctPnZpc2libGVfaGVpZ2h0LAor ICAgICAgICAgcm93LT5hc2NlbnQsCisgICAgICAgICByb3ctPnBoeXNfYXNjZW50KTsKKyAgICAg IC8qIFRoZSBuZXh0IDMgbGluZXMgc2hvdWxkIGFsaWduIHRvICJTdGFydCIgaW4gdGhlIGhlYWRl ci4gKi8KKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgICAlOSJwRCJkICU5InBEImRcdCU1ZFxu Iiwgcm93LT5zdGFydC5vdmVybGF5X3N0cmluZ19pbmRleCwKKyAgICAgICAgIHJvdy0+ZW5kLm92 ZXJsYXlfc3RyaW5nX2luZGV4LAorICAgICAgICAgcm93LT5jb250aW51YXRpb25fbGluZXNfd2lk dGgpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAgICU5InBEImQgJTkicEQiZFxuIiwKKyAg ICAgICAgIENIQVJQT1MgKHJvdy0+c3RhcnQuc3RyaW5nX3BvcyksCisgICAgICAgICBDSEFSUE9T IChyb3ctPmVuZC5zdHJpbmdfcG9zKSk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTlk ICU5ZFxuIiwgcm93LT5zdGFydC5kcHZlY19pbmRleCwKKyAgICAgICAgIHJvdy0+ZW5kLmRwdmVj X2luZGV4KTsKKyAgICB9CisgIGlmIChnbHlwaHMgPiAxKQorICAgIHsKKyAgICAgIGZvciAoaW50 IGFyZWEgPSBMRUZUX01BUkdJTl9BUkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2FyZWEpCisgIHsK KyAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV07CisgICAgc3RydWN0 IGdseXBoICpnbHlwaF9lbmQgPSBnbHlwaCArIHJvdy0+dXNlZFthcmVhXTsKKyAgICAvKiBHbHlw aCBmb3IgYSBsaW5lIGVuZCBpbiB0ZXh0LiAqLworICAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAm JiBnbHlwaCA9PSBnbHlwaF9lbmQgJiYgZ2x5cGgtPmNoYXJwb3MgPiAwKQorICAgICAgKytnbHlw aF9lbmQ7CisgICAgaWYgKGdseXBoIDwgZ2x5cGhfZW5kKQorICAgICAgZnByaW50ZiAoc3RkZXJy LCAiR2x5cGgjL1RvdGFsIFJlbC5YIFQgICAgICAgUG9zIE8gICBXICAgICBDb2RlIEZhY2UgTFIg ICAgIFggICAgWSBIUE9TIFZQT1MgWlYgQ1xuIik7CisgICAgZm9yICg7IGdseXBoIDwgZ2x5cGhf ZW5kOyArK2dseXBoKQorICAgICAgeworICAgICAgICBtY19kdW1wX2dseXBoIChyb3csIGdseXBo LCBhcmVhLCByZWxhdGl2ZV94KTsKKyAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxf d2lkdGg7CisgICAgICB9CisgIH0KKyAgICB9CisgIGVsc2UgaWYgKGdseXBocyA9PSAxKQorICAg IHsKKyAgICAgIGNoYXIgc1tTSFJUX01BWCArIDRdOworICAgICAgZm9yIChpbnQgYXJlYSA9IExF RlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgeworICAgIGludCBp OworICAgIGZvciAoaSA9IDA7IGkgPCByb3ctPnVzZWRbYXJlYV07ICsraSkKKyAgICAgIHsKKyAg ICAgICAgc3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdICsgaTsKKyAgICAg ICAgaWYgKGkgPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgJiYgYXJlYSA9PSBURVhUX0FS RUEKKyAgICAgICYmI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F9PYmplY3Qg Z2x5cGhzKQoreworICBzdHJ1Y3Qgd2luZG93ICp3ID0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93 KTsKKyAgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4OworICBFTUFDU19JTlQgdnBvczsKKyAg aWYgKE5JTFAgKHJvdykpCisgICAgeworICAgICAgaW50IGQxLCBkMiwgZDMsIGQ0LCBkNSwgeXBv czsKKyAgICAgIGJvb2wgdmlzaWJsZV9wID0gcG9zX3Zpc2libGVfcCAodywgUFQsICZkMSwgJmQy LCAmZDMsICZkNCwgJmQ1LCAmeXBvcyk7CisgICAgICBpbnQgaGVhZGVyX2xpbmVfaGVpZ2h0ID0g V0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICBpbnQgdm9mZnNldCA9IChoZWFk ZXJfbGluZV9oZWlnaHQgPiAwCisgICAgICAgICAgICAgICAgICAgICAmJiB5cG9zID4gMCkKKyAg ICAgICAgICAgICAgICAgICAgICA/IHlwb3MgKyAxCisgICAgICAgICAgICAgICAgICAgICAgOiB5 cG9zOworICAgICAgaWYgKHZpc2libGVfcCkKKyAgICAgICAgdnBvcyA9IHZvZmZzZXQ7CisgICAg ICAgIGVsc2UKKyAgICAgICAgICB2cG9zID0gMDsKKyAgICB9CisgICAgZWxzZQorICAgICAgewor ICAgICAgICBDSEVDS19OVU1CRVIgKHJvdyk7CisgICAgICAgIHZwb3MgPSBYRklYTlVNIChyb3cp OworICAgICAgfQorICBtYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgaWYgKHZwb3MgPj0g MCAmJiB2cG9zIDwgbWF0cml4LT5ucm93cykKKyAgICBtY19kdW1wX2dseXBoX3JvdyAoTUFUUklY X1JPVyAobWF0cml4LCB2cG9zKSwKKyAgICAgICAgdnBvcywKKyAgICAgICAgVFlQRV9SQU5HRURf RklYTlVNUCAoaW50LCBnbHlwaHMpID8gWEZJWE5VTSAoZ2x5cGhzKSA6IDIpO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mludGYgKHN0ZGVyciwgIlBUID0gJSJwRCJkLCBCRUdWID0gJSJwRCJkLiBaViA9 ICUicEQiZFxuIiwKKyAgICAgQlVGX1BUIChidWZmZXIpLCBCVUZfQkVHViAoYnVmZmVyKSwgQlVG X1pWIChidWZmZXIpKTsKKyAgZnByaW50ZiAoc3RkZXJyLCAiQ3Vyc29yIHggPSAlZCwgeSA9ICVk LCBocG9zID0gJWQsIHZwb3MgPSAlZFxuIiwKKyAgICAgdy0+Y3Vyc29yLngsIHctPmN1cnNvci55 LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MpOworICBmcHJpbnRmIChzdGRlcnIsICI9 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiIpOworICBtY19k dW1wX2dseXBoX21hdHJpeCAody0+Y3VycmVudF9tYXRyaXgsCisgICAgICAgICBUWVBFX1JBTkdF RF9GSVhOVU1QIChpbnQsIGdseXBocykgPyBYRklYTlVNIChnbHlwaHMpIDogMCk7CisgIHJldHVy biBRbmlsOworfQorCit2b2lkCittY19yZXNldF9jYWNoZSAoc3RydWN0IHdpbmRvdyAqdywgZW51 bSB0eXBlX29mX2NhY2hlIGNhY2hlX3R5cGUpCit7CisgIHN3aXRjaCAoY2FjaGVfdHlwZSkKKyAg ICB7CisgICAgICBjYXNlIE5PX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgYnJlYWs7Cisg ICAgICAgIH0KKyAgICAgIGNhc2UgTUNfQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBpZiAo QlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICYmIHctPm1jX2VsdHMu dXNlZCA+IDEpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIERlY3JlYXNlIHRoZSBz aXplIG9mIHRoZSBhc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mICFOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkKKyAgICAgICAgICAgICAgdy0+ bWNfZWx0cy51c2VkID0gMDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2Fz ZSBDSF9DQUNIRToKKyAgICAgICAgeworICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50 cykKKyAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj cm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgJiYgdy0+Y2hfZWx0cy51c2VkID4gMSkKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgLyogRGVjcmVhc2UgdGhlIHNpemUgb2YgdGhlIGFycmF5 IHRvIGEgYmFyZSBtaW5pbXVtLiAqLworICAgICAgICAgICAgICB3LT5jaF9lbHRzLmNhY2hlcyA9 IHhucmVhbGxvYyAody0+Y2hfZWx0cy5jYWNoZXMsIDEsIHNpemVvZiAqdy0+Y2hfZWx0cy5jYWNo ZXMpOworICAgICAgICAgICAgICB3LT5jaF9lbHRzLnVzZWQgPSAwOworICAgICAgICAgICAgICB3 LT5jaF9lbHRzLmFsbG9jYXRlZCA9IDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyAg QWx0aG91Z2ggaXQgd291bGQgbm90IGJlIHZlcnkgZWZmaWNpZW50LCBpdCBpcyBwb3NzaWJsZSB0 byBzZXQKKyAgICAgICAgICAgIC8vICB0aGUgX3VzZWRfIGVsZW1lbnRzIG9mIHRoZSBhcnJheSB0 byB6ZXJvLiAgSW4gc3VjaCBhIGNhc2UsIHRoZQorICAgICAgICAgICAgLy8gIC4uLl9lbHRzLmFs bG9jYXRlZCB3b3VsZCByZW1haW4gdGhlIHNhbWUuCisgICAgICAgICAgICAvLyAgbWVtc2V0ICh3 LT5jaF9lbHRzLmNhY2hlcywgMCwgdy0+Y2hfZWx0cy51c2VkICogKHNpemVvZiAqdy0+Y2hfZWx0 cy5jYWNoZXMpKTsKKyAgICAgICAgICAgIC8vICBBdCB0aGlzIHRpbWUsIHdlIGFyZSBpbnN0ZWFk IGxlYXZpbmcgdGhlIGFycmF5IGFzLWlzIHdpdGggdGhlCisgICAgICAgICAgICAvLyAgdW5kZXJz dGFuZGluZyB0aGF0IGl0IHdpbGwgY29udGFpbiBvdXRkYXRlZCBkYXRhIChha2EgZ2FyYmFnZSku CisgICAgICAgICAgICAvLyAgVXNpbmcgdGhlIGNvdW50ZXIgYHctPmNoX2VsdHMudXNlZGAsIHdl IHRyYWNrIGN1cnJlbnQgZGF0YS4KKyAgICAgICAgICAgIGVsc2UgaWYgKEJVRkZFUlAgKHctPmNv bnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgICAgICAgICB3LT5jaF9lbHRzLnVzZWQg PSAwOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIEZDX0NBQ0hFOgor ICAgICAgICB7CisgICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAg ICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQor ICAgICAgICAgICAgICAmJiB3LT5mY19lbHRzLnVzZWQgPiAxKQorICAgICAgICAgICAgeworICAg ICAgICAgICAgICAvKiBEZWNyZWFzZSB0aGUgc2l6ZSBvZiB0aGUgYXJyYXkgdG8gYSBiYXJlIG1p bmltdW0uICovCisgICAgICAgICAgICAgIHctPmZjX2VsdHMuY2FjaGVzID0geG5yZWFsbG9jICh3 LT5mY19lbHRzLmNhY2hlcywgMSwgc2l6ZW9mICp3LT5mY19lbHRzLmNhY2hlcyk7CisgICAgICAg ICAgICAgIHctPmZjX2VsdHMudXNlZCA9IDA7CisgICAgICAgICAgICAgIHctPmZjX2VsdHMuYWxs b2NhdGVkID0gMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vICBBbHRob3VnaCBpdCB3 b3VsZCBub3QgYmUgdmVyeSBlZmZpY2llbnQsIGl0IGlzIHBvc3NpYmxlIHRvIHNldAorICAgICAg ICAgICAgLy8gIHRoZSBfdXNlZF8gZWxlbWVudHMgb2YgdGhlIGFycmF5IHRvIHplcm8uICBJbiBz dWNoIGEgY2FzZSwgdGhlCisgICAgICAgICAgICAvLyAgLi4uX2VsdHMuYWxsb2NhdGVkIHdvdWxk IHJlbWFpbiB0aGUgc2FtZS4KKyAgICAgICAgICAgIC8vICBtZW1zZXQgKHctPmZjX2VsdHMuY2Fj aGVzLCAwLCB3LT5mY19lbHRzLnVzZWQgKiAoc2l6ZW9mICp3LT5mY19lbHRzLmNhY2hlcykpOwor ICAgICAgICAgICAgLy8gIEF0IHRoaXMgdGltZSwgd2UgYXJlIGluc3RlYWQgbGVhdmluZyB0aGUg YXJyYXkgYXMtaXMgd2l0aCB0aGUKKyAgICAgICAgICAgIC8vICB1bmRlcnN0YW5kaW5nIHRoYXQg aXQgd2lsbCBjb250YWluIG91dGRhdGVkIGRhdGEgKGFrYSBnYXJiYWdlKS4KKyAgICAgICAgICAg IC8vICBVc2luZyB0aGUgY291bnRlciBgdy0+ZmNfZWx0cy51c2VkYCwgd2UgdHJhY2sgY3VycmVu dCBkYXRhLgorICAgICAgICAgICAgZWxzZSBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAg ICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBm Y192aXNpYmxlKSkpCisgICAgICAgICAgICAgIHctPmZjX2VsdHMudXNlZCA9IDA7CisgICAgICAg ICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkCittY19oZWxwZXIg KHN0cnVjdCB3aW5kb3cgKncsIHN0cnVj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R0aCwgZm9yZWdyb3VuZCwgYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgcmVtb3ZlX3ApOwor ICBzdHJ1Y3QgbXVsdGlwbGVfY3Vyc29yc19jYWNoZSBmb29fZWx0czsKKyAgc3dpdGNoIChjYWNo ZV90eXBlKQorICAgIHsKKyAgICAgIGNhc2UgTk9fQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAg ICAvKiBEbyBub3QgY29udGludWUgdG8gdGhlIGxhc3Qgc2VjdGlvbiB0aGF0IHBvcHVsYXRlcyB0 aGUgY2FjaGUgd2l0aAorICAgICAgICAgIGN1cnNvciBkYXRhLCBhcyB0aGF0IHdpbGwgY2F1c2Ug YSBTSUdTRUdWIChzZWdtZW50YXRpb24gZmF1bHQpLiAqLworICAgICAgICAgIHJldHVybjsKKyAg ICAgICAgfQorICAgICAgY2FzZSBNQ19DQUNIRToKKyAgICAgICAgeworICAgICAgICAgICsrdy0+ bWNfZWx0cy51c2VkOworICAgICAgICAgIGlmICh3LT5tY19lbHRzLmFsbG9jYXRlZCA8IHctPm1j X2VsdHMudXNlZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaW50IG9sZF9hbGxvYyA9 IHctPm1jX2VsdHMuYWxsb2NhdGVkOworICAgICAgICAgICAgICBpbnQgbmV3X2VsdHMgPSB3LT5t Y19lbHRzLnVzZWQgLSB3LT5tY19lbHRzLmFsbG9jYXRlZDsKKyAgICAgICAgICAgICAgdy0+bWNf ZWx0cy5jYWNoZXMgPSB4cGFsbG9jICh3LT5tY19lbHRzLmNhY2hlcywgJnctPm1jX2VsdHMuYWxs b2NhdGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19l bHRzLCBJTlRfTUFYLCBzaXplb2YgKnctPm1jX2VsdHMuY2FjaGVzKTsKKyAgICAgICAgICAgICAg bWVtc2V0ICh3LT5tY19lbHRzLmNhY2hlcyArIG9sZF9hbGxvYywgMCwKKyAgICAgICAgICAgICAg ICAgICAgICAgKHctPm1jX2VsdHMuYWxsb2NhdGVkIC0gb2xkX2FsbG9jKSAqIHNpemVvZiAqdy0+ bWNfZWx0cy5jYWNoZXMpOworICAgICAgICAgICAgfQorICAgICAgICAgIGZvb19lbHRzLmNhY2hl cyA9IHctPm1jX2VsdHMuY2FjaGVzOworICAgICAgICAgIGZvb19lbHRzLmFsbG9jYXRlZCA9IHct Pm1jX2VsdHMuYWxsb2NhdGVkOworICAgICAgICAgIGZvb19lbHRzLnVzZWQgPSB3LT5tY19lbHRz LnVzZWQ7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2UgQ0hfQ0FDSEU6 CisgICAgICAgIHsKKyAgICAgICAgICArK3ctPmNoX2VsdHMudXNlZDsKKyAgICAgICAgICBpZiAo dy0+Y2hfZWx0cy5hbGxvY2F0ZWQgPCB3LT5jaF9lbHRzLnVzZWQpCisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIGludCBvbGRfYWxsb2MgPSB3LT5jaF9lbHRzLmFsbG9jYXRlZDsKKyAgICAg ICAgICAgICAgaW50IG5ld19lbHRzID0gdy0+Y2hfZWx0cy51c2VkIC0gdy0+Y2hfZWx0cy5hbGxv Y2F0ZWQ7CisgICAgICAgICAgICAgIHctPmNoX2VsdHMuY2FjaGVzID0geHBhbGxvYyAody0+Y2hf ZWx0cy5jYWNoZXMsICZ3LT5jaF9lbHRzLmFsbG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBuZXdfZWx0cywgSU5UX01BWCwgc2l6ZW9mICp3LT5jaF9l bHRzLmNhY2hlcyk7CisgICAgICAgICAgICAgIG1lbXNldCAody0+Y2hfZWx0cy5jYWNoZXMgKyBv bGRfYWxsb2MsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICh3LT5jaF9lbHRzLmFsbG9jYXRl ZCAtIG9sZF9hbGxvYykgKiBzaXplb2YgKnctPmNoX2VsdHMuY2FjaGVzKTsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICBmb29fZWx0cy5jYWNoZXMgPSB3LT5jaF9lbHRzLmNhY2hlczsKKyAgICAg ICAgICBmb29fZWx0cy5hbGxvY2F0ZWQgPSB3LT5jaF9lbHRzLmFsbG9jYXRlZDsKKyAgICAgICAg ICBmb29fZWx0cy51c2VkID0gdy0+Y2hfZWx0cy51c2VkOworICAgICAgICAgIGJyZWFrOworICAg ICAgICB9CisgICAgICBjYXNlIEZDX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgKyt3LT5m Y19lbHRzLnVzZWQ7CisgICAgICAgICAgaWYgKHctPmZjX2VsdHMuYWxsb2NhdGVkIDwgdy0+ZmNf ZWx0cy51c2VkKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpbnQgb2xkX2FsbG9jID0g dy0+ZmNfZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgICAgIGludCBuZXdfZWx0cyA9IHctPmZj X2VsdHMudXNlZCAtIHctPmZjX2VsdHMuYWxsb2NhdGVkOworICAgICAgICAgICAgICB3LT5mY19l bHRzLmNhY2hlcyA9IHhwYWxsb2MgKHctPmZjX2VsdHMuY2FjaGVzLCAmdy0+ZmNfZWx0cy5hbGxv Y2F0ZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2Vs dHMsIElOVF9NQVgsIHNpemVvZiAqdy0+ZmNfZWx0cy5jYWNoZXMpOworICAgICAgICAgICAgICBt ZW1zZXQgKHctPmZjX2VsdHMuY2FjaGVzICsgb2xkX2FsbG9jLCAwLAorICAgICAgICAgICAgICAg ICAgICAgICAody0+ZmNfZWx0cy5hbGxvY2F0ZWQgLSBvbGRfYWxsb2MpICogc2l6ZW9mICp3LT5m Y19lbHRzLmNhY2hlcyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgZm9vX2VsdHMuY2FjaGVz ID0gdy0+ZmNfZWx0cy5jYWNoZXM7CisgICA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jdXJzb3IueGAgLyBgbWMu ZmNfeGAuICovCit2b2lkCittY19nZXRfY3Vyc29yX2dlb21ldHJ5IChzdHJ1Y3Qgd2luZG93ICp3 LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICBz dHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB4LCBpbnQgKmZ4LCBpbnQgeSwKKyAgICAgICAgICAg ICAgICAgICAgICAgIGludCAqZnksIGludCBocG9zLCBpbnQgdnBvcywgaW50ICpoLAorICAgICAg ICAgICAgICAgICAgICAgICAgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3JfdHlwZSwgaW50IGN1 cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCAqd2QpCit7CisgIHN0cnVj dCBnbHlwaCAqZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgaHBv cywgdnBvcyk7CisgIGlmIChnbHlwaCA9PSBOVUxMKQorICAgIHJldHVybjsKKyAgc3RydWN0IGZy YW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgKmZ4ID0gV0lORE9XX1RFWFRf VE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICpoID0gcm93LT52aXNpYmxlX2hlaWdodDsKKyAg LyogRG9uJ3QgbGV0IHRoZSBjdXJzb3IgZXhjZWVkIHRoZSBkaW1lbnNpb25zIG9mIHRoZSByb3cs IHNvIHRoYXQKKyAgdGhlIHVwcGVyL2xvd2VyIHNpZGUgb2YgdGhlIGJveCBhcmVuJ3QgY2xpcHBl ZC4gICovCisgIGludCB3X2hlYWRlcl9saW5lX2hlaWdodCA9IFdJTkRPV19IRUFERVJfTElORV9I RUlHSFQgKHcpOworICBpbnQgd190ZXh0X2JvdHRvbV95ID0gd2luZG93X3RleHRfYm90dG9tX3kg KHcpIC0gKmg7CisgIGlmICh5IDwgd19oZWFkZXJfbGluZV9oZWlnaHQpCisgICAgeworICAgICAg KmggPSBtYXggKCpoIC0gKHdfaGVhZGVyX2xpbmVfaGVpZ2h0IC0geSkgKyAxLCAqaCk7CisgICAg ICB5ID0gd19oZWFkZXJfbGluZV9oZWlnaHQgLSAxOworICAgICAgLy8gZnByaW50ZiAoc3RkZXJy LCAiQ09ORElUSU9OICMgMVxuIik7CisgICAgfQorICAgZWxzZSBpZiAoeSA+IHdfdGV4dF9ib3R0 b21feSkKKyAgICAgeworICAgICAgICpoICs9IHkgLSB3X3RleHRfYm90dG9tX3k7CisgICAgICAg eSA9IHdfdGV4dF9ib3R0b21feTsKKyAgICAgICAvLyBmcHJpbnRmIChzdGRlcnIsICJDT05ESVRJ T04gIyAyXG4iKTsKKyAgICAgfQorICAqZnkgPSBXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywg eSk7CisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgeworICAgICAgY2FzZSBNQ19CQVI6Cisg ICAgICAgIHsKKyAgICAgICAgICBpZiAoY3Vyc29yX3dpZHRoIDwgMSkKKyAgICAgICAgICAgIGN1 cnNvcl93aWR0aCA9IG1heCAoRlJBTUVfQ1VSU09SX1dJRFRIIChmKSwgMSk7CisgICAgICAgICAg aWYgKGN1cnNvcl93aWR0aCA8IGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgICAqd2QgPSBj dXJzb3Jfd2lkdGg7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2UgTUNf SEJBUjoKKyAgICAgICAgeworICAgICAgICAgIGludCBjdXJzb3JfaGVpZ2h0ID0gKGN1cnNvcl93 aWR0aCA8IDEpID8gbHJpbnQgKDAuMjUgKiAqaCkgOiBjdXJzb3Jfd2lkdGg7CisgICAgICAgICAg aWYgKGN1cnNvcl9oZWlnaHQgPiByb3ctPmhlaWdodCkKKyAgICAgICAgICAgIGN1cnNvcl9oZWln aHQgPSByb3ctPmhlaWdodDsKKy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AgICAg ICAgICAgICAgICAgICAgICA/IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGN1cnNvcl9tYXRyaXgs IGN1cnNvcl9yb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBOVUxMOworICBib29sIGN1cnNvcl9hdF9mcmluZ2VfcCA9IChj dXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJz b3Jfcm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29y Lmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIGN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gdGV4dF9hcmVhX3dpZHRo CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IGN1cnNvcl9y b3ctPnBpeGVsX3dpZHRoKTsKKyAgYm9vbCBjdXJzb3JfYmV5b25kX2ZyaW5nZV9wID0gKGN1cnNv cl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJz b3Jfcm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1 cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgIWN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5l X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHRl eHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnggPj0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOworICBpbnQgZnJhbWVfY2hhcl93aWR0 aCA9IEZSQU1FX0NPTFVNTl9XSURUSCAoZik7CisgIGludCB0ZW1wX2ZhY2VfaWQgPSBnbHlwaC0+ ZmFjZV9pZDsKKyAgc3RydWN0IG1jX1JHQiBiYWNrZ3JvdW5kOworICBtY19zZXRfbHNsX2JnICh3 LCB0ZW1wX2ZhY2VfaWQsICZiYWNrZ3JvdW5kKTsKKyAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3Ag PSAob3BvaW50X3ggPT0gcmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvcG9pbnRfaHBvcyA9PSBocG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9w b2ludF95ID09IGdseXBoLT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2lu dF92cG9zID09IHZwb3MpOworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAg ICAgICAgICAgICAgICBCRUdJTjogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAgICAg ICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIGlmIChnbHlwaC0+dHlw ZSA9PSBDSEFSX0dMWVBICisgICAgICB8fCBnbHlwaC0+dHlwZSA9PSBHTFlQSExFU1NfR0xZUEgp CisgIHsKKyAgICBpZiAobWNfc3RkZXJyX3ApCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAg ICAgICJcbiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEu MWQlMS4xZCAlNWQgJTRkICAlM2QgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ct PmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAg OiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgKGds eXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgID8gJ0MnCisgICAgICAgICA6ICdHJyks CisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVj dCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQor ICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisg ICAgICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgICAg ICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPnUuY2gsCisgICAgICAgIGds eXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBn bHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlw aC0+aHBvcywgZ2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAg IG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkpOworICBzd2l0Y2ggKGFjdGlvbl90eXBl KQorICB7CisvKiAt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5waXhlbF93aWR0aAorICAgICAg ICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4 LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAg ICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQs IGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3 X3AsIGNhY2hlX3R5cGUpOworICAgICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgcmVsYXRpdmVfeCA8PSB4X2xp bWl0KQorICAgICAgICB7CisgICAgICAgICAgaWYgKHJlbGF0aXZlX3ggPCByb3ctPnBpeGVsX3dp ZHRoKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5w aXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgZnggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAg ICAgICAgICAgfQorICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCBy ZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICB4 X2xpbWl0IC0gcmVsYXRpdmVfeCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwKKyAgICAg ICAgICAgICAgICAgICAgIGZvcmVncm91bmQsIGJhY2tncm91bmQsIGFjdGl2ZV9wLCBNQ19HTFlQ SExFU1MsIGRyYXdfcCwKKyAgICAgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUpOworICAgICAg ICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAg ICAgICAgICAgICAgVkVSVElDQUxfUlVMRVI6ICBDSEFSX0dMWVBIIHwgR0xZUEhMRVNTX0dMWVBI ICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBW RVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3Ig PSAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRf b25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hU X0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5 b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBj dXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0gIT0gMQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHp2X3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgaWYgKGdseXBoX2ZsY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UgRklMTF9DT0xVTU46CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5 cGhfZmxhdm9yID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRb YXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICYmIGZjX3ggPj0gcm93LT5waXhlbF93aWR0 aCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAg ICAgOiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAg ICAgICAgICAgICAgOiAoIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX3ZlcnRp Y2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSB5CisgICAg ICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBvcykKKyAgICAgICAgICAgICAg ICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAg ICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxh dGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBo LCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAg ICAgICAgICAgICAgICBhY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3AsIGNhY2hlX3R5cGUp OworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS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lYV0gLSAxKSwKKyAg ICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1MnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywK KyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAg ICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAg ICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAg ICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAg IDB1LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xp bmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT54 LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIg OiAiLS0iLAorICAgICAgICAiXFxTIik7CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBM RV9DVVJTT1JTOiAgU1RSRVRDSF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAg ICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJv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IHJvdy0+ dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAg ICAgIHsKKyAgICAgICAgICBpZiAocmVsYXRpdmVfeCA8IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAg ICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICB0ZW1w X2ZhY2VfaWQgPSAocm93LT5maWxsX2xpbmVfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICA/ IGdseXBoLT5mYWNlX2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0Vf SUQ7CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBiYWNrZ3JvdW5kOworICAgICAgICAgIG1jX3Nl dF9sc2xfYmcgKHcsIHRlbXBfZmFjZV9pZCwgJmJhY2tncm91bmQpOworICAgICAgICAgIG1jX2hl bHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsCisgICAgICAgICAgICAgICAgICAgICB4X2xpbWl0IC0gcmVsYXRpdmVfeCwgaCwgY3Vy c29yX3R5cGUsIHhfbGltaXQgLSByZWxhdGl2ZV94LAorICAgICAgICAgICAgICAgICAgICAgZm9y ZWdyb3VuZCwgYmFja2dyb3VuZCwgYWN0aXZlX3AsIE1DX0dMWVBITEVTUywgZHJhd19wLAorICAg ICAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSk7CisgICAgICAgIH0KKyAgICAgIGJyZWFrOwor ICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAg ICAgIFZFUlRJQ0FMX1JVTEVSOiAgU1RSRVRDSF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICov CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAg IHsKKyAgICAgIGlmIChyb3ctPmZpbGxfbGluZV9wCisgICAgICAgICAgJiYgZ2x5cGggLSByb3ct PmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiBv cG9pbnRfeCA+IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgIHRlbXBf ZmFjZV9pZCA9IGdseXBoLT5mYWNlX2lkOworICAgICAgICBlbHNlIGlmICghcm93LT5maWxsX2xp bmVfcAorICAgICAgICAgICAgICAgICAmJiBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0g PT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+IHJl bGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgdGVtcF9mYWNlX2lkID0g REVGQVVMVF9GQUNFX0lEOworICAgICAgc3RydWN0IG1jX1JHQiBiYWNrZ3JvdW5kOworICAgICAg bWNfc2V0X2xzbF9iZyAodywgdGVtcF9mYWNlX2lkLCAmYmFja2dyb3VuZCk7CisgICAgICBlbnVt IG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNI CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRp bnVlZF9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50 cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29u X3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVW RVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0gIT0gMQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVk X29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNf UkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IE1DX0dMWVBITEVTUzsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxf QkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VE X1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBN Q19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1D X1ZFUlRJQ0FMX0JBUgorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9W RVJUSUNBTF9CQVIpCisgICAgICAgIGN1cnNvcl90eXBlID0gTUNfUklHSFRfRlJJTkdFX0JJVE1B UDsKKyAgICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBo LCBvcG9pbnRfeCwgb3BvaW50X2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAg ICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91 bmQsCisgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgY2Fj aGVfdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K Ky8qICAgICAgICAgICAgICAgICAgICAgICAgICAgRklMTF9DT0xVTU46ICBTVFJFVENIX0dMWVBI ICAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0t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dseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ct PnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJl bGF0aXZlX3gsCisgICAgICAgICdJJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAg IChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNU UklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAo TklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAg ICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5zaWdu ZWQgaW50KSBnbHlwaC0+dS5pbWdfaWQsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAg ICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVf cCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3Ms IGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisgIHN3aXRjaCAoYWN0 aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAg ICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUzogIElNQUdFX0dMWVBIICAgICAgICAgICAgICAg ICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIE1VTFRJUExFX0NV UlNPUlM6CisgICAgeworICAgICAgY3Vyc29yX3R5cGUgPSBNQ19IT0xMT1dfQk9YOworICAgICAg bWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwg aHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jf d2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgIGFjdGl2ZV9w LCBNQ19HTFlQSCwgZHJhd19wLCBjYWNoZV90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgSE9SSVpP TlRBTF9SVUxFUjogIElNQUdFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAg ICAgY3Vyc29yX3R5cGUgPSBNQ19IT0xMT1dfQk9YOworICAgICAgaWYgKCFyZWFsX2Zha2VfY3Vy c29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2 ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1 cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAg ICAgICAgICAgICAgYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGNhY2hlX3R5cGUpOworICAg ICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAg ICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSOiAgSU1BR0VfR0xZUEggICAgICAgICAgICAg ICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxf UlVMRVI6CisgICAgeworICAgICAgY3Vyc29yX3R5cGUgPSBNQ19IT0xMT1dfQk9YOworICAgICAg bWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwg aHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jf d2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgIGFjdGl2ZV9w LCBNQ19HTFlQSCwgZHJhd19wLCBjYWNoZV90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgRklM TF9DT0xVTU46ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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VfR0xZUEgg ICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAg ZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICB7CisgICAgaWYgKG1j X3N0ZGVycl9wKQorICAgICAgeworICAgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICAg IlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4IiwKKyAgICAgICAg ICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgKChyb3ctPnVzZWRb YXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgICAgcmVsYXRp dmVfeCwKKyAgICAgICAgICAnKycsCisgICAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAg ICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgID8gJ0InCisgICAgICAgICAg IDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgID8gJ1MnCisgICAgICAg ICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICAgID8gJzAnCisg ICAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwK KyAgICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5jbXAuaWQpOworICAgICAgICBmcHJp bnRmIChzdGRlcnIsICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAgICAgIGdseXBoLT5mYWNlX2lk LAorICAgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgICAgZ2x5cGgtPnJp Z2h0X2JveF9saW5lX3ApOworICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAg ICAgIGZwcmludGYgKHN0ZGVyciwgIiAlNWQgJTRkICAlM2QgICUzZCAlcyAuIFslZC0lZF1cbiIs CisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBv cywgZ2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICAgICAg ICAgICAgICAgICAgZ2x5cGgtPnNsaWNlLmNtcC5mcm9tLCBnbHlwaC0+c2xpY2UuY21wLnRvKTsK KyAgICAgICAgZWxzZQorICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlxuIik7CisgICAgICB9 CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLwor LyogICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlM6ICBDT01QT1NJVEVfR0xZ UEggICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBj YXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgs IHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAg ICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJh Y2tncm91bmQsCisgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBj YWNoZV90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworLyogICAgICAgICAgICAgICAgICAgICAgIEhPUklaT05UQUxfUlVMRVI6ICBDT01QT1NJVEVf R0xZUEggICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAg ICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAgaWYgKHJlbGF0aXZlX3ggPD0g eF9saW1pdAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hl bHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lk dGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgYWN0aXZlX3As IE1DX0dMWVBILCBkcmF3X3AsIGNhY2hlX3R5cGUpOworICAgICAgaWYgKGdseXBoIC0gcm93LT5n bHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgcmVs YXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAgICB7CisgICAgICAgICAgcmVsYXRpdmVfeCArPSBn bHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgd2hpbGUgKHJlbGF0aXZlX3ggPD0geF9saW1p dCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJv dywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAg ICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3Vu ZCwgYmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcCwgTUNfR0xZ UEhMRVNTLCBkcmF3X3AsIGNhY2hlX3R5cGUpOworICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9 IGZyYW1lX2NoYXJfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGJyZWFr OworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAg ICAgICAgVkVSVElDQUxfUlVMRVI6ICBDT01QT1NJVEVfR0xZUEggICAgICAgICAgICAgICAgICAg ICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgor ICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJzb3JfYXRfZnJp bmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNvbnRp bnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJ Q0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog KGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdI VF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2Jl eW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg cm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPnVzZWRb VEVYVF9BUkVBXSAhPSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSBy b3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog TUNfR0xZUEg7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdI VF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElD QUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNB TF9CQVIKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxf QkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA7CisgICAg ICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRp dmVfeCwgb3BvaW50X2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2Qs IGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisg ICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgY2FjaGVfdHlw ZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAg ICAgICAgICAgICAgICAgICAgICAgICBGSUxMX0NPTFVNTjogIENPTVBPU0lURV9HTFlQSCAgICAg ICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBG SUxMX0NPTFVNTjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAo Z2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAg ICAgICAgICAgICAgICAgICAgICAmJiBmY194ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAg ICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiAoenZfcCkKKyAgICAg ICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiAoIU5J TFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAg ICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAg JiYgb3BvaW50X3Zwb3MgPT0gdnBvcykKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhM RVNTCisgICAgIC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S0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IFhX SURHRVRfR0xZUEgpCisgIHsKKyNpZm5kZWYgSEFWRV9YV0lER0VUUworICAgIGVhc3N1bWUgKGZh bHNlKTsKKyNlbHNlCisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgZnByaW50ZiAoc3RkZXJy LAorICAgICAgICAiXG4gICU1ZC8lLTVkICU1ZCAlNGMgJTZkICVjICUzZCAweCUwNXggJTRkICUx LjFkJTEuMWQgJTVkICU0ZCAgJTNkICAlM2QgJXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAw IDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdY JywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2Jq ZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3Qp CisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAnLScpKSwKKyAgICAgICAgZ2x5cGgt PnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxl ZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAg IGdseXBoLT51Lnh3aWRnZXQsCisgICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhw b3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicp OworI2VuZGlmCisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCis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ggPD0geF9saW1pdAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAg ICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwg ZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBj dXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAg YWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGNhY2hlX3R5cGUpOworICAgICAgaWYgKGdseXBo IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAg ICAgJiYgcmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAgICB7CisgICAgICAgICAgcmVsYXRp dmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgd2hpbGUgKHJlbGF0aXZlX3gg PD0geF9saW1pdCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfaGVscGVyICh3LCBt YXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAg ICAgICAgICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwg Zm9yZWdyb3VuZCwgYmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVf cCwgTUNfR0xZUEhMRVNTLCBkcmF3X3AsIGNhY2hlX3R5cGUpOworICAgICAgICAgICAgICByZWxh dGl2ZV94ICs9IGZyYW1lX2NoYXJfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAg ICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAg ICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSOiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAg ICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FM X1JVTEVSOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJz b3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBy b3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdo dF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FM X0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo Y3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJp bmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9y b3ctPnVzZWRbVEVYVF9BUkVBXSAhPSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9B UkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FM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2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoZ2x5cGgg LSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAg ICAgICAgICAgICAgICAmJiBmY194ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAg ID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiAoenZfcCkKKyAgICAgICAgICAg ICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKEJW QVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAg ICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgJiYgb3Bv aW50X3Zwb3MgPT0gdnBvcykKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisg ICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4 LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAg ICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5k LCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBhY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBk cmF3X3AsIGNhY2hlX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisgIH0KKyAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBFTkQ6ICBYV0lER0VUX0dMWVBIICAgICAgICAgICAgICAg ICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworfQorCit2b2lkCittY19k cmF3X3JvdyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBz dHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgc3RydWN0IGdseXBoICpzdGFydCwg aW50IHgsIGludCBocG9zX2xlbmd0aCwgaW50IHZwb3MsCisgICAgICAgICAgICAgaW50IGJvdHRv bV92cG9zLCBib29sIGFjdGl2ZV9wLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpjdXJzb3JfbWF0cml4 LAorICAgICAgICAgICAgIGludCBmY194LCBzdHJ1Y3QgbWNfUkdCIGNoX2ZvcmVncm91bmQsIHN0 cnVjdCBtY19SR0IgZmNfZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICBib29sIGRyYXdfcCkKK3sK KyAgLy8gIGNsb2NrX3QgY2xvY2tfc3RhcnQgPSBjbG9jaygpOworICAvKiBOVCBFbWFjcyBjcmFz aGVzIG9uIHN0YXJ0dXAgd2l0aG91dCBhIGBCVUZGRVJQJyBjaGVjayBpbiBgdXBkYXRlX3dpbmRv dycuICovCisgIGlmICghQlVGRkVSUCAody0+Y29udGVudHMpKQorICAgIHJldHVybjsKKyAgaWYg KE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAmJiBO SUxQIChCVkFS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AgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gTUFUUklYX1JPVyAoY3Vyc29yX21hdHJpeCwgdy0+Y3Vyc29yLnZw b3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIHN0cnVjdCBn bHlwaCAqY3Vyc29yX2dseXBoID0gKHctPmN1cnNvci52cG9zICE9IC0xKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgY3Vyc29yX21hdHJp eCwgY3Vyc29yX3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIGJvb2wgY3Vyc29yX2F0X2ZyaW5nZV9wID0g KGN1cnNvcl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1 cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJz b3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSB0ZXh0X2FyZWFfd2lk dGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gY3Vyc29y X3Jvdy0+cGl4ZWxfd2lkdGgpOworICBib29sIGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AgPSAoY3Vy c29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1 cnN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F9jcnB3X3AgKCVkKVxuIiwKKyAgLy8g ICAgdnBvcywgaHBvc19zdGFydCwgaHBvc19sZW5ndGgsIHctPmN1cnNvci54LCB0ZXh0X2FyZWFf d2lkdGgsIHJvdy0+dXNlZFtURVhUX0FSRUFdLCByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wLAor ICAvLyAgICBjZ19wLCBjcl9wLCBjaF9jcnUsIGNyZXd3bF9wLCBjeF90YXdfcCwgY3hfY3Jwd19w KTsKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICBS RVBMQUNFIFRIRSBSRUFMIENVUlNPUgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIGVudW0g ZmFjZV9pZCBiZ19mYWNlX2lkID0gKGN1cnNvcl9nbHlwaCAhPSBOVUxMKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gY3Vyc29yX2dseXBoLT5mYWNlX2lkCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgIHN0cnVjdCBtY19SR0IgY3Vyc29yX2Jn OworICBtY19zZXRfbHNsX2JnICh3LCBiZ19mYWNlX2lkLCAmY3Vyc29yX2JnKTsKKyAgLyogRklY TUU6ICBQdXQgaW4gc29tZSBjb2RlIHRvIGRlZmF1bHQgdG8gTUNfSE9MTE9XX0JPWCBpZiB0aGUg dXNlciBoYXMKKyAgdW53aXR0aW5nbHkgY29tZSB1cCB3aXRoIHNvbWUgdW5hY2NlcHRhYmxlIGZv cm0gb2YgdW5yZWNvZ25pemVkIGN1cnNvciB0eXBlLiAqLworICBMaXNwX09iamVjdCBsaXNwX3R5 cGUgPSBCVkFSIChiLCBtY19yZWFsX2Zha2VfY3Vyc29yKTsK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orICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gaHBvc19zdGFydCAr IGhwb3NfbGVuZ3RoCisgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBjcm9zc2hhaXJzKSkKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGNoX2hvcml6b250YWxfcnVsZXIpKSkKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBn bHlwaF9mbGF2b3IgPSBNQ19IT0xMT1dfUkVDVEFOR0xFOworICAgICAgbWNfaGVscGVyICh3LCBt YXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgLTEsIHctPmN1cnNvci55LCAt MSwKKyAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCAtMSwg LTEsIE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAsIC0xLAorICAgICAgICAgICAgICAgICBjdXJzb3Jf ZmcsIGN1cnNvcl9iZywgYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBDSF9DQUNIRSk7 CisgICAgfQorICAvKiBDdXJzb3IgaXMgYmV5b25kIHRoZSByaWdodCBmcmluZ2U7IGUuZy4sIHdo ZW4gcmlnaHQgaG9yaXpvbnRhbCBzY3JvbGxpbmcuICovCisgIGVsc2UgaWYgKGN1cnNvcl9iZXlv bmRfZnJpbmdlX3AKKyAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAg ICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICYmIChocG9z X3N0YXJ0ICsgaHBvc19sZW5ndGgpID09IHJvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAg ICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorIC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gICAgIHZhbHVlIGlzIGBub2AgaW4gdGhl IGZvcm0gb2YgYSBzeW1ib2wgb3Igc3RyaW5nLCB0aGVuIHRoZSBkZWZhdWx0IHdlIHVzZQorICAg ICAgYW4gTUNfQkFSIGFuZCBhbiBNQ19IQkFSIC0tIGJvdGggaGF2aW5nIGEgY3Vyc29yX3dpZHRo IG9mIDEuICovCisgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywg dy0+Y3Vyc29yLngsICZvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCAm b3BvaW50X2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQ19CQVIsIDEsICZvcG9p bnRfd2QpOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3 LT5jdXJzb3IueCwgb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgb3Bv aW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwgb3BvaW50 X2gsCisgICAgICAgICAgICAgICAgIE1DX0JBUiwgMSwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGFj dGl2ZV9wLCBNQ19HTFlQSExFU1MsCisgICAgICAgICAgICAgICAgIGRyYXdfcCwgTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICA/IENIX0NBQ0hFCisgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSk7Cisg ICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngs ICZvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Jm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQ19IQkFSLCAxLCAmb3BvaW50X3dkKTsKKyAg ICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngs IG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+ Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAg ICAgICAgICAgICBNQ19IQkFSLCAxLCBjdXJzb3JfZmcsIGN1cnNvcl9iZywgYWN0aXZlX3AsIE1D X0dMWVBILCBkcmF3X3AsCisgICAgICAgICAgICAgICAgIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAg ICAgICAgICAgICAgOiBNQ19DQUNIRSk7CisgICAgfQorICBlbHNlIGlmICghY3Vyc29yX2F0X2Zy aW5nZV9wCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICYm IHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPj0g aHBvc19zdGFydAorICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA8IGhwb3Nfc3RhcnQgKyBo cG9zX2xlbmd0aAorICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9H TFlQSCkKKyAgICB7CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJv dywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9z LCAmb3BvaW50X2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwg Y3Vyc29yX3dpZHRoLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCBy b3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisg ICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9z LCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vy c29yX3dpZHRoLCBjdXJzb3JfZmcsIGN1cnNvcl9iZywgYWN0aXZlX3AsCisgICAgICAgICAgICAg ICAgIE1DX0dMWVBILCBkcmF3X3AsIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg bWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSk7CisgICAgfQor ICBlbHNlIGlmICghY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlw aCAhPSBOVUxMCisgICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAg ICAgJiYgdy0+Y3Vyc29yLmhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAmJiB3LT5jdXJz b3IuaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAmJiBjdXJzb3Jf Z2x5cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICAvKiBJZiBhIHVzZXIg aGFzIHNldCBgeC1zdHJldGNoLWN1cnNvcicgdG8gYSBub24tbmlsIHZhbHVlLCBoZS9zaGUgY2hv c2UgdG8KKyAgICAgIGhhdmUgYSBjdXJzb3IgdGhhdCBzcGFucyB0aGUgZW50aXJlIGxlbmd0aCBv ZiB0aGUgU1RSRVRDSF9HTFlQSC4gKi8KKyAgICAgIGlmICgheF9zdHJldGNoX2N1cnNvcl9wKQor ICAgICAgICB7CisgICAgICAgICAgLyogVGhlIE1DX0hCQVIgc2hhbGwgaGF2ZSBhIGBjdXJzb3Jf d2lkdGhgIG9mIDEuICovCisgICAgICAgICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0 cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHctPmN1cnNvci55LCAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9o LCBNQ19IQkFSLCAxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRf d2QpOworICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwg dy0+Y3Vyc29yLngsIG9wb2ludF9meCwKKyAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci55 LCBvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywKKyAgICAgICAgICAg ICAgICAgICAgIG9wb2ludF93ZCwgb3BvaW50X2gsIE1DX0hCQVIsIDEsIGN1cnNvcl9mZywgY3Vy c29yX2JnLAorICAgICAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3As CisgICAgICAgICAgICAgICAgICAgICBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAg ICAgICAgICAgOiBNQ19DQUNIRSk7CisgICAgICAgIH0KKyAgICAgIG1jX2dldF9jdXJzb3JfZ2Vv bWV0cnkgKHcsIG1hdHJpeCwgcm93LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci55LCAmb3BvaW50X2Z5LCB3LT5jdXJzb3Iu aHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci52cG9zLCAmb3Bv aW50X2gsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29y X3dpZHRoLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1 cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAg ICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9p bnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dp ZHRoLCBjdXJzb3JfZmcsIGN1cnNvcl9iZywgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgIE1D X0dMWVBILCBkcmF3X3AsIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29u ZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSk7CisgICAgfQorLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgIERSQVcgQU5EIFJF Q09SRCBGQUtFIENVUlNPUlMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBpZiAoaHBvc19s ZW5ndGggPT0gMSkKKyAgICB7CisgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICB7CisgICAgICAgICAgLyogVGhlIHNwYWNlIGFw cGVuZGVkIHRvIGEgcm93IGVuZGluZyB3aXRoIGEgbmV3IGxpbmUKKyAgICAgICAgICBkb2VzIG5v dCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDApIHRoYXQgd2UgY2FuCisgICAgICAgICAg dXNlIGZvciB0aGlzIHBhcnRpY3VsYXIgYXBwbGljYXRpb24uICBXaGVuIHRoZXJlIGlzIGEKKyAg ICAgICAgICBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5IHRoYXQgYXNzaWducyBhIHZpc2li bGUKKyAgICAgICAgICBnbHlwaCB0byBhIG5ldyBsaW5lLCB0aGVyZSBpcyBubyBwcm9ibGVtIGJl Y2F1c2UgdGhhdAorICAgICAgICAgIGdseXBoIGhhcyBhIGBnbHlwaC0+Y2hhcnBvcycgdGhhdCB3 ZSBjYW4gdXNlLiAgV2hlbgorICAgICAgICAgIG5vIHZpc2libGUgRU9MIGdseXBoIGV4aXN0cywg d2UgdXNlIHRoZSBmb2xsb3dpbmcKKyAgICAgICAgICB0ZXN0OiAgdGhlIGFwcGVuZGVkIHNwYWNl IGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMgb25lCisgICAgICAgICAgbGVzcyB0aGFuIHRoZSBlbmQg b2YgdGhlIG1hdHJpeCByb3cuICovCisgICAgICAgICAgaW50IGhwb3MgPSBzdGFydCAtIHJvdy0+ Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgc3RydWN0IGdseXBoICpwcmV2aW91c19nbHlw aCA9ICgwIDw9IGhwb3MgLSAxICYmIGhwb3MgLSAxIDwgcm93LT51c2VkW1RFWFRfQVJFQV0pCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gcm93LT5nbHlwaHNbVEVY VF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogTlVMTDsKKyAgICAgICAgICBib29sIHNraXBfcCA9IChwcmV2aW91c19nbHlwaCAhPSBO VUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcHJldmlvdXNfZ2x5cGgtPmNoYXJwb3Mg PT0gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSAtIDEpOworICAgICAgICAgIGludCBwb3Np bnQgPSAoc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFtURVhUX0FS RUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VORF9DSEFSUE9T IChyb3cpIC0gMQorICAgICAgICAgICAgICAgICAgICAgICA6IHN0YXJ0LT5jaGFycG9zOworICAg ICAgICAgIExpc3BfT2JqZWN0IHNwZWNzID0gbWNfYXNzb2MgKG1ha2VfZml4bnVtIChwb3NpbnQp LCBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKTsKKyAgICAgICAgICBpZiAo KChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgfHwg aGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICYmICFOSUxQIChzcGVjcykK KyAgICAgICAgICAgICAgJiYgc3RhcnQtPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisg ICAgICAgICAgICAgICYmICFza2lwX3AKKyAgICAgICAgICAgICAgJiYgIXN0YXJ0LT56dl9wKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBMaXNwX09iamVjdCBsaXNwX3R5cGUgPSBtY19u dGggKDEsIHNwZWNzKTsKKyAgICAgICAgICAgICAgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3Jf dHlwZSA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAobGlzcF90 eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog bWNfbGlzcF90b19jdXJzb3JfdHlwZSAobGlzcF90eXBlKTsKKyAgICAgICAgICAgICAgY3Vyc29y X3R5cGUgPSAoc3RhcnQtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBj dXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCA9IChDT05TUCAobGlz cF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gWEZJWE5VTSAoWENB UiAoWENEUiAobGlzcF90eXBlKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IC0xOworICAgICAgICAgICAgICBMaXNwX09iamVjdCBtY19mb3JlZ3JvdW5kID0gbWNfbnRoICgy LCBzcGVjcyk7CisgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgZm9yZWdyb3VuZDsKKyAgICAg ICAgICAgICAgaWYgKFNUUklOR1AgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgIG1j X3h3X2NvbG9yX3ZhbHVlcyAodywgbWNfZm9yZWdyb3VuZCwgJmZvcmVncm91bmQpOworICAgICAg ICAgICAgICAgIGVsc2UgaWYgKFZFQ1RPUlAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgICBkb3VibGUgcmVkX2ZnID0gWEZMT0FUX0RBVEEg KEFSRUYgKG1jX2ZvcmVncm91bmQsIDApKTsKKyAgICAgICAgICAgICAgICAgICAgZG91YmxlIGdy ZWVuX2ZnID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDEpKTsKKyAgICAgICAg ICAgICAgICAgICAgZG91YmxlIGJsdWVfZmcgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdy b3VuZCwgMikpOworICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLnJlZCA9IHJlZF9mZzsK KyAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZC5ncmVlbiA9IGdyZWVuX2ZnOworICAgICAg ICAgICAgICAgICAgICBmb3JlZ3JvdW5kLmJsdWUgPSBibHVlX2ZnOworICAgICAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoTklMUCAobWNfZm9yZWdyb3VuZCkpCisg ICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLnJl ZCA9IGNoX2ZvcmVncm91bmQucmVkOworICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQu Z3JlZW4gPSBjaF9mb3JlZ3JvdW5kLmdyZWVuOworICAgICAgICAgICAgICAgICAgICAgIGZvcmVn cm91bmQuYmx1ZSA9IGNoX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOwor ICAgICAgICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJF QSk7CisgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIHN0YXJ0LCBURVhU X0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdGFy dCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3MsIGN1cnNvcl90eXBlLAorICAgICAgICAg ICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgY3Vyc29yX21hdHJpeCwgZmNfeCwgZm9yZWdy b3VuZCwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09S UywgZHJhd19wLCBNQ19DQUNIRSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlm ICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAg ICAgICAmJiBmY194IDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICYmIGZjX3ggPj0gdy0+ bWMubG51bV9waXhlbF93aWR0aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB4X2xpbWl0ID0g eCArIHN0YXJ0LT5waXhlbF93aWR0aDsKKyAgICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3Jf cCA9ICh3LT5jdXJzb3IueCA9PSBmY194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+Y3Vyc29yLnkgPT0gc3RhcnQtPnkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RF WFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJz b3IudnBvcyA9PSB2cG9zKTsKKyAgICAgICAgICBpZiAoeCArIHN0YXJ0LT5waXhlbF93aWR0aCA8 PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgJiYgKChoZWFkZXJfbGluZV9mb3JtYXQg PiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0 ID09IDApCisgICAgICAgICAgICAgICYmICgoZmNfeCA+PSB4CisgICAgICAgICAgICAgICAgICAg JiYgZmNfeCA8IHggKyBzdGFydC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB8fCBz dGFydCA9PSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAx KQorICAgICAgICAgICAgICAmJiBzdGFydC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykK KyAgICAgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgIG1jX2Vu Z2luZSAodywgbWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+ eSwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFd LCB2cG9zLCBNQ19CQVIsIDEsCisgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgs IGZjX3gsIGZjX2ZvcmVncm91bmQsIGFjdGl2ZV9wLCBGSUxMX0NPTFVNTiwKKyAgICAgICAgICAg ICAgICAgICAgICAgZHJhd19wLCBGQ19DQUNIRSk7CisgICAgICAgIH0KKyAgICAgIGlmICghTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAm JiAhTklMUCAoQlZBUiAoYiwgY2hfaG9yaXpvbnRhbF9ydWxlcikpCisgICAgICAgICAgJiYgdnBv cyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgeworICAgICAgICAgIGludCB4X2xp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gICAgICBjdXJzb3JfdHlwZSA9IChzdGFydC0+dHlwZSA9 PSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX0JPWAor ICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19CQVI7CisgICAgICAgICAgaW50IHhfbGltaXQg PSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAgICAgICAgIGJvb2wgcmVhbF9m YWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci55ID09IHN0YXJ0LT55CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnZwb3MgPT0gdnBvcyk7CisgICAgICAg ICAgaWYgKCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAg ICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAmJiAoKHctPmN1 cnNvci54ID49IHgKKyAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHggKyBzdGFy dC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB8fCBzdGFydCA9PSByb3ctPmdseXBo c1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQorICAgICAgICAgICAgICAm JiBzdGFydC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgJiYg IXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCBy b3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAgICAgICAgICAg ICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBjdXJzb3JfdHlw ZSwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZmNfeCwgY2hfZm9y ZWdyb3VuZCwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVS LCBkcmF3X3AsIENIX0NBQ0hFKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgICB7 CisgICAgICAgIGludCByZWxhdGl2ZV94ID0gMDsKKyAgICAgICAgZm9yIChpbnQgYXJlYSA9IExF RlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgICAgICAgICB7Cisg ICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV07CisgICAg ICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51c2VkW2FyZWFd OworICAgICAgICAgICAgLyogR2x5cGggZm9yIGEgbGluZSBlbmQgaW4gdGV4dC4gKi8KKyAgICAg ICAgICAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiBnbHlwaCA9PSBnbHlwaF9lbmQgJiYgZ2x5 cGgtPmNoYXJwb3MgPiAwKQorICAgICAgICAgICAgICArK2dseXBoX2VuZDsKKyAgICAgICAgICAg IGZvciAoOyBnbHlwaCA8IGdseXBoX2VuZDsgKytnbHlwaCkKKyAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgIGlmICh2cG9zICE9IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAg ICAgICYmIGdseXBoICE9IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgJiYgZmNf eCA8IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPCByZWxh dGl2ZV94CisgICAgICAgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAg ICAgICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkK KyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyogVGhlIHNwYWNlIGFw cGVuZGVkIHRvIGEgcm93IGVuZGluZyB3aXRoIGEgbmV3IGxpbmUgZG9lcworICAgICAgICAgICAg ICAgICAgICBub3QgaGF2ZSBhIGBnbHlwaC0+Y2hhcnBvc2AgKC0xLCAwKSB0aGF0IHdlIGNhbiB1 c2UgZm9yIHRoaXMKKyAgICAgICAgICAgICAgICAgICAgcGFydGljdWxhciBhcHBsaWNhdGlvbi4g IFdoZW4gYSBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5CisgICAgICAgICAgICAgICAgICAg IGFzc2lnbnMgYSB2aXNpYmxlIGdseXBoIHRvIGEgbmV3IGxpbmUsIHRoZXJlIGlzIG5vIHByb2Js ZW0KKyAgICAgICAgICAgICAgICAgICAgYmVjYXVzZSB0aGF0IGdseXBoIGhhcyBhIGBnbHlwaC0+ Y2hhcnBvcycgdGhhdCB3ZSBjYW4gdXNlLgorICAgICAgICAgICAgICAgICAgICBXaGVuIG5vIHZp c2libGUgRU9MIGdseXBoIGV4aXN0cywgd2UgdXNlIHRoZSBmb2xsb3dpbmcgdGVzdDoKKyAgICAg ICAgICAgICAgICAgICAgdGhlIGFwcGVuZGVkIHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMg b25lIGxlc3MgdGhhbiB0aGUKKyAgICAgICAgICAgICAgICAgICAgZW5kIG9mIHRoZSBtYXRyaXgg cm93LiAqLworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICpwcmV2aW91 c19nbHlwaCA9ICgwIDw9IGhwb3MgLSAxICYmIGhwb3MgLSAxIDwgcm93LT51c2VkW1RFWFRfQVJF QV0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyBocG9zIC0gMQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICAgICAgICAgICAgICAgICAg ICBib29sIHNraXBfcCA9IChwcmV2aW91c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHByZXZpb3VzX2dseXBoLT5jaGFycG9zID09IE1BVFJJWF9S T1dfRU5EX0NIQVJQT1MgKHJvdykgLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogV2hlbiBh IGBidWZmZXItZGlzcGxheS10YWJsZScgZW50cnkgY29udGFpbnMKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBhIHZpc2libGUgdGFiIGNoYXJhY3RlciAoIsK7IiksIHRoZSBzdWJz ZXF1ZW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU1RSRVRDSF9HTFlQSCB3 aWxsIGhhdmUgdGhlIHNhbWUgZ2x5cGgtPmNoYXJwb3MKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBhcyB0aGUgYWZvcmVtZW50aW9uZWQgdmlzaWJsZSB0YWIgY2hhcmFjdGVyLiAq LworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHByZXZpb3VzX2dseXBoICE9 IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19n bHlwaC0+Y2hhcnBvcyA9PSBnbHlwaC0+Y2hhcnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog ZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIGludCBwb3NpbnQgPSAoZ2x5cGggLSByb3ctPmds eXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgLSAxCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGdseXBoLT5jaGFycG9zOworICAgICAgICAg ICAgICAgICAgICBMaXNwX09iamVjdCBzcGVjcyA9IG1jX2Fzc29jIChtYWtlX2ZpeG51bSAocG9z aW50KSwgQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSk7CisgICAgICAgICAg ICAgICAgICAgIGlmICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAg ICAgICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAg ICAgICAgICAgICAgICAgICAmJiAhTklMUCAoc3BlY3MpCisgICAgICAgICAgICAgICAgICAgICAg ICAmJiBnbHlwaC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAg ICAgICAgICAgICYmICFza2lwX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFnbHlwaC0+ enZfcCkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBM aXNwX09iamVjdCBsaXNwX3R5cGUgPSBtY19udGggKDEsIHNwZWNzKTsKKyAgICAgICAgICAgICAg ICAgICAgICAgIGVudW0gdHlwZV9vZl9jdXJzb3IgY3Vyc29yX3R5cGUgPSAoQ09OU1AgKGxpc3Bf dHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog bWNfbGlzcF90b19jdXJzb3JfdHlwZSAobGlzcF90eXBlKTsKKyAgICAgICAgICAgICAgICAgICAg ICAgIGN1cnNvcl90eXBlID0gKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0hPTExPV19CT1gKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBjdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAg ICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGggPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBYRklYTlVNIChYQ0FSIChYQ0RS IChsaXNwX3R5cGUpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IC0xOworICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QgbWNfZm9yZWdyb3Vu ZCA9IG1jX250aCAoMiwgc3BlY3MpOworICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1j X1JHQiBmb3JlZ3JvdW5kOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFNUUklOR1AgKG1j X2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICBtY194d19jb2xvcl92YWx1 ZXMgKHcsIG1jX2ZvcmVncm91bmQsICZmb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgZWxzZSBpZiAoVkVDVE9SUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG91YmxlIHJlZF9m ZyA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAwKSk7CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBkb3VibGUgZ3JlZW5fZmcgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNf Zm9yZWdyb3VuZCwgMSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG91YmxlIGJs dWVfZmcgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMikpOworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZC5yZWQgPSByZWRfZmc7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLmdyZWVuID0gZ3JlZW5fZmc7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLmJsdWUgPSBibHVlX2ZnOworICAgICAg ICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNl IGlmIChOSUxQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLnJlZCA9IGNoX2ZvcmVn cm91bmQucmVkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZC5ncmVl biA9IGNoX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBm b3JlZ3JvdW5kLmJsdWUgPSBjaF9mb3JlZ3JvdW5kLmJsdWU7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9X X1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0 ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAgICAg ICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4X2xpbWl0LCByb3ctPnksIGdseXBo IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgdnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgY3Vyc29yX21hdHJpeCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmNfeCwgZm9yZWdyb3VuZCwgYWN0aXZl X3AsIE1VTFRJUExFX0NVUlNPUlMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGRyYXdfcCwgTUNfQ0FDSEUpOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAgICYmIGZjX3ggPD0gdGV4 dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICYmIGZjX3ggPj0gdy0+bWMubG51bV9w aXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaW50 IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAgICAgICAgICAg ICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9ICh3LT5jdXJzb3IueCA9PSBmY194Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNv ci55ID09IGdseXBoLT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5j dXJzb3IudnBvcyA9PSB2cG9zKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IGhwb3MgPSBnbHlw aCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgICAgICAgICAgIGlmIChocG9z ID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIGhwb3MgPCBocG9zX3N0 YXJ0ICsgaHBvc19sZW5ndGgKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIHJlbGF0aXZlX3gg KyBnbHlwaC0+cGl4ZWxfd2lkdGggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAg ICAgICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAg ICAgICAgICAgICAgICAgICAmJiAoKGdseXBoICE9IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgZmNfeCA+PSByZWxhdGl2ZV94CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIGZjX3ggPCByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChnbHlwaCA9PSBnbHlwaF9lbmQgLSAxCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGZjX3ggPj0gcmVsYXRpdmVfeCkpCisg ICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21f eSAodykKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisg ICAgICAgICAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIGFy ZWEsIHJlbGF0aXZlX3gsIHhfbGltaXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICByb3ctPnksIGhwb3MsIHZwb3MsIE1DX0JBUiwgMSwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGZjX3gsIGZjX2ZvcmVncm91bmQsIGFjdGl2ZV9wLCBG SUxMX0NPTFVNTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdfcCwgRkNf Q0FDSEUpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hvcml6b250YWxfcnVsZXIpKQorICAgICAgICAg ICAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcs IFRFWFRfQVJFQSk7CisgICAgICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSByb3ct PmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICAvKiBQcmVzZXJ2ZSBzdXBw b3J0IGZvciBkZWZhdWx0IGJlaGF2aW9yIHN1Y2ggdGhhdCBhIHVzZXIgbWF5CisgICAgICAgICAg ICAgICAgICAgIHNwZWNpZnkgdGhlIGhlaWdodCBvZiBhbiBNQ19IQkFSLCB3aGljaCBiZWdpbnMg aXRzIGpvdXJuZXkKKyAgICAgICAgICAgICAgICAgICAgYXMgdGhlIGBjdXJzb3Jfd2lkdGgnLiAg YG1jX2dldF9jdXJzb3JfZ2VvbWV0cnknIHJlYWRqdXN0cy4gKi8KKyAgICAgICAgICAgICAgICAg ICAgaWYgKGhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBv cyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aCkKKyAgICAgICAgICAgICAgICAgICAgICBtY19l bmdpbmUgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwgeF9saW1pdCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdy0+eSwgaHBvcywgdnBvcywgTUNf SEJBUiwgMSwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGZjX3gsIGNoX2ZvcmVncm91bmQsIGFjdGl2ZV9wLCBIT1JJWk9OVEFMX1JVTEVSLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd19wLCBDSF9DQUNIRSk7CisgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZB UiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAmJiAhZmlsbF9j b2x1bW5fdHJ1bXBzX3ApCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg IGN1cnNvcl90eXBlID0gKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX0JPWAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogTUNfQkFSOworICAgICAgICAgICAgICAgICAgICBpbnQgeF9saW1p dCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICAgICAgICAg IGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci55ID09IGdseXBoLT55CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52 cG9zID09IHZwb3MpOworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGhwb3MgPj0gaHBv c19zdGFydAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGhwb3Nfc3RhcnQgKyBo cG9zX2xlbmd0aAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChoZWFkZXJfbGluZV9mb3Jt YXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGhlYWRl cl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChnbHlwaCAh PSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNv ci54ID49IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnggPCByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHx8IChnbHlwaCA9PSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHJlbGF0aXZlX3gpKQorICAgICAgICAg ICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisg ICAgICAgICAgICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAg ICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxh dGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55 LCBocG9zLCB2cG9zLCBjdXJzb3JfdHlwZSwgMSwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGZjX3gsIGNoX2ZvcmVncm91bmQsIGFjdGl2ZV9wLCBWRVJU SUNBTF9SVUxFUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdfcCwgQ0hf Q0FDSEUpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJlbGF0aXZlX3gg Kz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAg ICAgfQorICAvLyAgY2xvY2tfdCBjbG9ja19lbmQgPSBjbG9jaygpOworICAvLyAgZG91YmxlIGNw dV90aW1lX3VzZWQgPSAoKGRvdWJsZSkgKGNsb2NrX2VuZCAtIGNsb2NrX3N0YXJ0KSkgLyBDTE9D S1NfUEVSX1NFQzsKKyAgLy8gIGZwcmludGYgKHN0ZGVyciwgIm1jX2RyYXdfcm93ICglcyk6ICBU SU1FICglZilcbiIsIG1jX3dpbmRvdyAodyksIGNwdV90aW1lX3VzZWQpOworfQorCit2b2lkCitt Y19yZWRyYXdfaGVscGVyIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpt YXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgICAgICAgIGVudW0gdHlw ZV9vZl9jYWNoZSBjYWNoZV90eXBlLCBpbnQgc3RhcnRfaHBvcywgaW50IGVuZF9ocG9zKQorewor ICBpbnQgcm93X3Zwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgc3RydWN0 IG11bHRpcGxlX2N1cnNvcnNfY2FjaGUgZm9vX2VsdHM7CisgIHN3aXRjaCAoY2FjaGVfdHlwZSkK KyAgICB7CisgICAgICBjYXNlIE5PX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgYnJlYWs7 CisgICAgICAgIH0KKyAgICAgIGNhc2UgTUNfQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBm b29fZWx0cy5jYWNoZXMgPSB3LT5tY19lbHRzLmNhY2hlczsKKyAgICAgICAgICBmb29fZWx0cy5h bGxvY2F0ZWQgPSB3LT5tY19lbHRzLmFsbG9jYXRlZDsKKyAgICAgICAgICBmb29fZWx0cy51c2Vk ID0gdy0+bWNfZWx0cy51c2VkOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBj YXNlIENIX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgZm9vX2VsdHMuY2FjaGVzID0gdy0+ Y2hfZWx0cy5jYWNoZXM7CisgICAgICAgICAgZm9vX2VsdHMuYWxsb2NhdGVkID0gdy0+Y2hfZWx0 cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgZm9vX2VsdHMudXNlZCA9IHctPmNoX2VsdHMudXNlZDsK KyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBGQ19DQUNIRToKKyAgICAg ICAgeworICAgICAgICAgIGZvb19lbHRzLmNhY2hlcyA9IHctPmZjX2VsdHMuY2FjaGVzOworICAg ICAgICAgIGZvb19lbHRzLmFsbG9jYXRlZCA9IHctPmZjX2VsdHMuYWxsb2NhdGVkOworICAgICAg ICAgIGZvb19lbHRzLnVzZWQgPSB3LT5mY19lbHRzLnVzZWQ7CisgICAgICAgICAgYnJlYWs7Cisg ICAgICAgIH0KKyAgICB9CisgIC8qIFNUUkVUQ0hfR0xZUEggbWF5IGNvbnRhaW4gbW9yZSB0aGFu IG9uZSBmYWtlIGN1cnNv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ZWx0XS5iYWNr Z3JvdW5kLnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IGZvb19l bHRzLmNhY2hlc1tlbHRdLmJhY2tncm91bmQuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAuYmx1ZSA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLmJhY2tncm91bmQuYmx1ZX07Cisg ICAgICBib29sIGFjdGl2ZV9wID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0uYWN0aXZlX3A7CisgICAg ICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5nbHlw aF9mbGF2b3I7CisgICAgICBib29sIGVuYWJsZWRfcCA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLmVu YWJsZWRfcDsKKyAgICAgIGlmICh2cG9zID09IHJvd192cG9zCisgICAgICAgICAgJiYgKChocG9z ID49IHN0YXJ0X2hwb3MKKyAgICAgICAgICAgICAgICYmIGhwb3MgPCBlbmRfaHBvcykKKyAgICAg ICAgICAgICAgLyogQSBmbG9hdGluZyBjdXJzb3IgYmV5b25kIHRoZSBlbmQgb2YgdGhlIGdseXBo IHJvdy4gKi8KKyAgICAgICAgICAgICAgfHwgKGhwb3MgKyAxID09IHN0YXJ0X2hwb3MKKyAgICAg ICAgICAgICAgICAgICYmIGhwb3MgKyAxID09IGVuZF9ocG9zKSkKKyAgICAgICAgICAmJiBlbmFi bGVkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBib29sIHJlbW92ZV9wID0gZmFsc2U7CisgICAg ICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnks IGhwb3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJz b3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBsc2xfZmcsIGFjdGl2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zLCB0aW1lX2ds eXBocywgdGltZV9jdXJzb3JzKTsKK30KKwordm9pZAorbWNfZXJhc2VfaGVscGVyIChzdHJ1Y3Qg d2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cg KnJvdywKKyAgICAgICAgICAgICAgICAgZW51bSB0eXBlX29mX2NhY2hlIGNhY2hlX3R5cGUpCit7 CisgIGludCByb3dfdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAvLyAg aWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAvLyAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFz ZV9oZWxwZXIgKCVzKTogIGNhY2hlICglcykgfCB2cG9zICglZClcbiIsCisgIC8vICAgICAgbWNf d2luZG93ICh3KSwgbWNfY2FjaGVfdHlwZV90b19zdHJpbmcgKGNhY2hlX3R5cGUpLCByb3dfdnBv cyk7CisgIHN0cnVjdCBtdWx0aXBsZV9jdXJzb3JzX2NhY2hlIGZvb19lbHRzOworICBzd2l0Y2gg KGNhY2hlX3R5cGUpCisgICAgeworICAgICAgY2FzZSBOT19DQUNIRToKKyAgICAgICAgeworICAg ICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIE1DX0NBQ0hFOgorICAgICAgICB7 CisgICAgICAgICAgZm9vX2VsdHMuY2FjaGVzID0gdy0+bWNfZWx0cy5jYWNoZXM7CisgICAgICAg ICAgZm9vX2VsdHMuYWxsb2NhdGVkID0gdy0+bWNfZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAg Zm9vX2VsdHMudXNlZCA9IHctPm1jX2VsdHMudXNlZDsKKyAgICAgICAgICBicmVhazsKKyAgICAg ICAgfQorICAgICAgY2FzZSBDSF9DQUNIRToKKyAgICAgICAgeworICAgICAgICAgIGZvb19lbHRz LmNhY2hlcyA9IHctPmNoX2VsdHMuY2FjaGVzOworICAgICAgICAgIGZvb19lbHRzLmFsbG9jYXRl ZCA9IHctPmNoX2VsdHMuYWxsb2NhdGVkOworICAgICAgICAgIGZvb19lbHRzLnVzZWQgPSB3LT5j aF9lbHRzLnVzZWQ7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2UgRkNf Q0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBmb29fZWx0cy5jYWNoZXMgPSB3LT5mY19lbHRz LmNhY2hlczsKKyAgICAgICAgICBmb29fZWx0cy5hbGxvY2F0ZWQgPSB3LT5mY19lbHRzLmFsbG9j YXRlZDsKKyAgICAgICAgICBmb29fZWx0cy51c2VkID0gdy0+ZmNfZWx0cy51c2VkOworICAgICAg ICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorICBmb3IgKGludCBlbHQgPSAwOyBlbHQgPCBm b29fZWx0cy51c2VkOyArK2VsdCkKKyAgICB7CisgICAgICBpbnQgeCA9IGZvb19lbHRzLmNhY2hl c1tlbHRdLng7CisgICAgICBpbnQgZnggPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5meDsKKyAgICAg IGludCB5ID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0ueTsKKyAgICAgIGludCBmeSA9IGZvb19lbHRz LmNhY2hlc1tlbHRdLmZ5OworICAgICAgaW50IGhwb3MgPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5o cG9zOworICAgICAgaW50IHZwb3MgPSBmb29fZWx0cy5jYWNoZXNbZWx0XS52cG9zOworICAgICAg aW50IHdkID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0ud2Q7CisgICAgICBpbnQgaCA9IGZvb19lbHRz LmNhY2hlc1tlbHRdLmg7CisgICAgICBlbnVtIHR5cGVfb2ZfY3Vyc29yIGN1cnNvcl90eXBlID0g Zm9vX2VsdHMuY2FjaGVzW2VsdF0uY3Vyc29yX3R5cGU7CisgICAgICBpbnQgY3Vyc29yX3dpZHRo ID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0uY3Vy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YmFyZl9jcmFzaF9vbmUgPSAobWF0cml4ICYmIG1hdHJpeC0+cm93cykgPyBmYWxzZSA6IHRy dWU7CisgICAgICBpZiAoYmFyZl9jcmFzaF9vbmUpCisgICAgICAgIGNvbnRpbnVlOworICAgICAg Ym9vbCBiYXJmX2NyYXNoX3R3byA9ICh2cG9zID49IDAgJiYgdnBvcyA8IG1hdHJpeC0+bnJvd3Mp ID8gZmFsc2UgOiB0cnVlOworICAgICAgaWYgKGJhcmZfY3Jhc2hfdHdvKQorICAgICAgICBjb250 aW51ZTsKKyAgICAgIGlmICh2cG9zID09IHJvd192cG9zCisgICAgICAgICAgJiYgZ2x5cGhfZmxh dm9yID09IE1DX0dMWVBICisgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICB7CisgICAg ICAgICAgbWNfZXJhc2VfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgeSwgaHBvcywgdnBvcywg Z2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QpOworICAgICAgICAgIGZvb19lbHRzLmNhY2hl c1tlbHRdLmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKHZw b3MgPT0gcm93X3Zwb3MKKyAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAg IHsKKyAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3AgPSB0cnVlOworICAgICAgICAgICAgbWNfZHJh d19lcmFzZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3Ms IHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBj dXJzb3Jfd2lkdGgsIGxzbF9iZywgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgZ2x5cGhfZmxhdm9yLCByZW1vdmVfcCk7CisgICAgICAgICAgICBmb29fZWx0cy5j YWNoZXNbZWx0XS5lbmFibGVkX3AgPSBmYWxzZTsKKyAgICAgICAgICB9CisgICAgfQorfQorCit2 b2lkCittY19lcmFzZV9yb3cgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXgg Km1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93KQoreworICBpbnQgdnBvcyA9IE1BVFJJWF9S T1dfVlBPUyAocm93LCBtYXRyaXgpOworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnBy aW50ZiAoc3RkZXJyLCAibWNfZXJhc2Vfcm93ICglcyk6ICB2cG9zICglZClcbiIsIG1jX3dpbmRv dyAodyksIHZwb3MpOworICBtY19lcmFzZV9oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBNQ19DQUNI RSk7CisgIG1jX2VyYXNlX2hlbHBlciAodywgbWF0cml4LCByb3csIENIX0NBQ0hFKTsKKyAgbWNf ZXJhc2VfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgRkNfQ0FDSEUpOworfQorCit2b2lkCittY19z ZXRfZXNzZW50aWFscyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBhY3RpdmVfcCwgc3RydWN0IG1j X1JHQiAqY2hfZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCICpm Y19mb3JlZ3JvdW5kLCBpbnQgKmZjX3gpCit7CisgIGlmICghQlVGRkVSUCAody0+Y29udGVudHMp KQorICAgIHJldHVybjsKKyAgaWYgKE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg bWNfY29uZikpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNy b3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBm Y192aXNpYmxlKSkpCisgICAgcmV0dXJuOworICBzdHJ1Y3QgZnJhbWUgKm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AgICAgICAgOiAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICYm IE5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisgICAgICAgICAgICA/IChmaWxsX2NvbCAq IGZyYW1lX2NoYXJfd2lkdGgpIC0gaHNjbF94CisgICAgICAgICAgOiAwOworICBpZiAob2xkX2J1 ZmZlcikKKyAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKyAgZW51bSBmYWNl X2lkIGZpbGxfY29sdW1uX2ZhY2VfaWQgPQorICAgICghYWN0aXZlX3AKKyAgICAgJiYgIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfaW5hY3RpdmVfd2luZG93cykpCisgICAg ICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAg ICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiZmMtaW5hY3RpdmUtZmFjZSIp LCB0cnVlKQorICAgIDogKCFhY3RpdmVfcAorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAgICYmICFOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQ IChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0g KmZjX3gpCisgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1vcG9p bnQtaW5hY3RpdmUtZmFjZSIpLCB0cnVlKQorICAgIDogKGFjdGl2ZV9wCisgICAgICAgJiYgIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgJiYg IU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iAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKSk7CisgIGlmICh0cmFjZV9y ZWRpc3BsYXlfcCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJtY19wcmVfc2Nyb2xsX2NsZWFuICgl cyk6ICBnb19vbmVfcCAoJXMpIHwgZ29fdHdvX3AgKCVzKVxuIiwKKyAgICAgICAgICAgICAgICAg ICAgIG1jX3dpbmRvdyAodyksIGdvX29uZV9wID8gInllcyIgOiAibm8iLCBnb190d29fcCA/ICJ5 ZXMiIDogIm5vIik7CisgIGlmICghZ29fb25lX3AgJiYgIWdvX3R3b19wKQorICAgIHJldHVybjsK KyAgYm9vbCB1cGRhdGluZ19mcmFtZV9wID0gZmFsc2U7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhG UkFNRSAody0+ZnJhbWUpOworICBpZiAoWEZSQU1FICh3LT5mcmFtZSkgIT0gZi0+bWNfdXBkYXRp bmdfZnJhbWUKKyAgICAgICYmIChnb19vbmVfcCB8fCBnb190d29fcCkpCisgICAgeworICAgICAg dXBkYXRpbmdfZnJhbWVfcCA9IHRydWU7CisgICAgICB1cGRhdGVfYmVnaW4gKGYpOworICAgIH0K KyAgaWYgKHctPnBoeXNfY3Vyc29yX29uX3AKKyAgICAgICYmIGdvX3R3b19wKQorICAgIGVyYXNl X3BoeXNfY3Vyc29yICh3KTsKKyAgc3RydWN0IGdseXBoX21hdHJpeCAqY3VycmVudF9tYXRyaXgg PSB3LT5jdXJyZW50X21hdHJpeDsKKyAgZm9yIChpbnQgdnBvcyA9IDA7CisgICAgICAgdnBvcyA8 IGN1cnJlbnRfbWF0cml4LT5ucm93cworICAgICAgICYmIE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0 cml4LCB2cG9zKS0+ZW5hYmxlZF9wCisgICAgICAgJiYgZ29fb25lX3A7CisgICAgICAgKyt2cG9z KQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdyA9IE1BVFJJWF9ST1cgKGN1cnJl bnRfbWF0cml4LCB2cG9zKTsKKyAgICAgIG1jX2VyYXNlX3JvdyAodywgY3VycmVudF9tYXRyaXgs IHJvdyk7CisgICAgfQorICBpZiAodXBkYXRpbmdfZnJhbWVfcCkKKyAgICB1cGRhdGVfZW5kIChm KTsKKyAgbWNfcmVzZXRfY2FjaGUgKHcsIE1DX0NBQ0hFKTsKKyAgbWNfcmVzZXRfY2FjaGUgKHcs IENIX0NBQ0hFKTsKKyAgbWNfcmVzZXRfY2FjaGUgKHcsIEZDX0NBQ0hFKTsKK30KKworREVGVU4g KCJtYy1zdGRlcnIiLCBGbWNfc3RkZXJyLCBTbWNfc3RkZXJyLCAwLCAxLCAiUCIsCisgICAgICAg ZG9jOiAvKiBUb2dnbGUgdHJhY2luZyBvZiBtdWx0aXBsZSBmYWtlIGN1cnNvcnMuCitXaXRoIEFS RywgdHVybiB0cmFjaW5nIG9uIGlmIGFuZCBvbmx5IGlmIEFSRyBpcyBwb3NpdGl2ZS4gKi8pCisg IChMaXNwX09iamVjdCBhcmcpCit7CisgIGlmIChOSUxQIChhcmcpKQorICAgIG1jX3N0ZGVycl9w ID0gIW1jX3N0ZGVycl9wOworICBlbHNlCisgICAgeworICAgICAgYXJnID0gRnByZWZpeF9udW1l cmljX3ZhbHVlIChhcmcpOworICAgICAgbWNfc3RkZXJyX3AgPSBYRklYTlVNIChhcmcpID4gMDsK KyAgICB9CisgIHJldHVybiBRbmlsOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogDAogLyoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKio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gICAgICAgICAgICAgICAgICAgICAgJiYgY2hhcnBvcyA8PSBaVikpCisgICAgICAgICAgICAg ICAgICAgICAgICA/IGZhbHNlCisgICAgICAgICAgICAgICAgICAgICAgICA6IHRydWU7CisgIGlm IChiYXJmX2NyYXNoX29uZSkKKyAgICByZXR1cm4gaHNjcm9sbGVkX3A7CisKKyAgLyogYHJlc2Vh dF8xJzogIENIQVJQT1MgKHBvcykgPj0gQkVHViAmJiBDSEFSUE9TIChwb3MpIDw9IFpWICovCisg IGJvb2wgYmFyZl9jcmFzaF90d28gPSAoY2hhcnBvcyA+PSBCRUdWICYmIGNoYXJwb3MgPD0gWlYp CisgICAgICAgICAgICAgICAgICAgICAgICAgPyBmYWxzZQorICAgICAgICAgICAgICAgICAgICAg ICAgIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2hfdHdvKQorICAgIHJldHVybiBoc2Nyb2xsZWRf cDsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKIAkgICAgICAvKiBNb3ZlIGl0ZXJhdG9yIHRvIHB0IHN0YXJ0aW5nIGF0IGN1cnNvcl9y b3ctPnN0YXJ0IGluCiAJCSBhIGxpbmUgd2l0aCBpbmZpbml0ZSB3aWR0aC4gICovCiAJICAgICAg aW5pdF90b19yb3dfc3RhcnQgKCZpdCwgdywgY3Vyc29yX3Jvdyk7CkBAIC0xNDI4Nyw5ICsxODQ0 NCwyMiBAQCByZWRpc3BsYXlfaW50ZXJuYWwgKHZvaWQpCiAJICAgICAgKnctPmRlc2lyZWRfbWF0 cml4LT5tZXRob2QgPSAwOwogCSAgICAgIGRlYnVnX21ldGhvZF9hZGQgKHcsICJvcHRpbWl6YXRp b24gMSIpOwogI2VuZGlmCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KKyAgaWYgKEJVRkZFUlAg KHctPmNvbnRlbnRzKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgY3Jvc3NoYWlycykpKQorICAgIG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgZmFsc2Up OworICAgIGVsc2UKIAkgICAgICB1cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIGZhbHNlKTsKICNl bmRpZgorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgZ290byB1cGRhdGU7 CiAJICAgIH0KIAkgIGVsc2UKQEAgLTE3Njg3LDEwICsyMTg1NywyMiBAQCByZWRpc3BsYXlfd2lu ZG93IChMaXNwX09iamVjdCB3aW5kb3csIGJvb2wganVzdF90aGlzX29uZV9wKQogICAgIH0KIAog I2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGJvb2wga2VlcF9jdXJyZW50X3AgPSAoanVzdF90 aGlzX29uZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKCF1c2VkX2N1cnJlbnRfbWF0 cml4X3AgJiYgIW92ZXJsYXlfYXJyb3dfc2VlbikKKyAgICAgICAgICAgICAgICAgICAgICAgICB8 fCB3LT5wc2V1ZG9fd2luZG93X3ApOworCisgIGJvb2wgZnJpbmdlc191cGRhdGVkX3AgPSAoQlVG RkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIGtlZXBfY3VycmVu dF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgOiB1cGRhdGVfd2luZG93X2ZyaW5nZXMg KHcsIGtlZXBfY3VycmVudF9wKTsKKwogICBpZiAoRlJBTUVfV0lORE9XX1AgKGYpCi0gICAgICAm JiB1cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIChqdXN0X3RoaXNfb25lX3AKLQkJCQkgICAgfHwg KCF1c2VkX2N1cnJlbnRfbWF0cml4X3AgJiYgIW92ZXJsYXlfYXJyb3dfc2VlbikKLQkJCQkgICAg fHwgdy0+cHNldWRvX3dpbmRvd19wKSkpCisgICAgICAmJiBmcmluZ2VzX3VwZGF0ZWRfcCkKICAg ICB7CiAgICAgICB1cGRhdGVfYmVnaW4gKGYpOwogICAgICAgYmxvY2tfaW5wdXQgKCk7CkBAIC0x NzcwNSw2ICsyMTg4Nyw5IEBAIHJlZGlzcGxheV93aW5kb3cgKExpc3BfT2JqZWN0IHdpbmRvdywg Ym9vbCBqdXN0X3RoaXNfb25lX3ApCiAgICAgICB1cGRhdGVfZW5kIChmKTsKICAgICB9CiAKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgaWYgKFdJTkRPV19CT1RUT01fRElWSURFUl9X SURUSCAodykpCiAgICAgeF9kcmF3X2JvdHRvbV9kaXZpZGVyICh3KTsKICNlbmRpZiAvKiBIQVZF X1dJTkRPV19TWVNURU0gKi8KQEAgLTE4MDEwLDYgKzIyMTk1LDE5IEBAIHRyeV93aW5kb3dfcmV1 c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRvdyAqdykKIAkgICAgIHNjcm9sbF9ydW5f aG9vayB3aWxsIGNsZWFyIHRoZSBjdXJzb3IsIGFuZCB1c2UgdGhlCiAJICAgICBjdXJyZW50IG1h dHJpeCB0byBnZXQgdGhlIGhlaWdodCBvZiB0aGUgcm93IHRoZSBjdXJzb3IgaXMKIAkgICAgIGlu LiAgKi8KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMg Ki8KKworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAidHJ5 X3dpbmRvd19yZXVzaW5nX2N1cnJlbnRfbWF0cml4IFsxIG9mIDJdICglcylcbiIsIG1jX3dpbmRv dyAodykpOworCisgIG1jX3ByZV9zY3JvbGxfY2xlYW4gKHcpOworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAJICBydW4uY3VycmVudF95ID0gc3RhcnRfcm93LT55OwogCSAgcnVuLmRl c2lyZWRfeSA9IGl0LmN1cnJlbnRfeTsKIAkgIHJ1bi5oZWlnaHQgPSBpdC5sYXN0X3Zpc2libGVf eSAtIGl0LmN1cnJlbnRfeTsKQEAgLTE4MTczLDYgKzIyMzcxLDE5IEBAIHRyeV93aW5kb3dfcmV1 c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRvdyAqdykKIAl9CiAKICAgICAgIC8qIFNj cm9sbCB0aGUgZGlzcGxheS4gICovCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAgIGZwcmlu dGYgKHN0ZGVyciwgInRyeV93aW5kb3dfcmV1c2luZ19jdXJyZW50X21hdHJpeCBbMiBvZiAyXSAo JXMpXG4iLCBtY193aW5kb3cgKHcpKTsKKworICBtY19wcmVfc2Nyb2xsX2NsZWFuICh3KTsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgcnVuLmN1cnJlbnRfeSA9IGZpcnN0 X3JldXNhYmxlX3Jvdy0+eTsKICAgICAgIHJ1bi5kZXNpcmVkX3kgPSBXSU5ET1dfSEVBREVSX0xJ TkVfSEVJR0hUICh3KTsKICAgICAgIHJ1bi5oZWlnaHQgPSBpdC5sYXN0X3Zpc2libGVfeSAtIHJ1 bi5jdXJyZW50X3k7CkBAIC0xOTEyNyw2ICsyMzMzOCwxOSBAQCB0cnlfd2luZG93X2lkIChzdHJ1 Y3Qgd2luZG93ICp3KQogICAvKiBTY3JvbGwgdGhlIGRpc3BsYXkuICBEbyBpdCBiZWZvcmUgY2hh bmdpbmcgdGhlIGN1cnJlbnQgbWF0cml4IHNvCiAgICAgIHRoYXQgeHRlcm0uYyBkb2Vzbid0IGdl dCBjb25mdXNlZCBhYm91dCB3aGVyZSB0aGUgY3Vyc29yIGdseXBoIGlzCiAgICAgIGZvdW5kLiAg Ki8KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAidHJ5X3dp bmRvd19pZCAoJXMpXG4iLCBtY193aW5kb3cgKHcpKTsKKworICBtY19wcmVfc2Nyb2xsX2NsZWFu ICh3KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBpZiAoZHkgJiYgcnVuLmhl aWdodCkKICAgICB7CiAgICAgICB1cGRhdGVfYmVnaW4gKGYpOwpAQCAtMjAxMzMsNiArMjQzNTcs MTcgQEAgYXBwZW5kX3NwYWNlX2Zvcl9uZXdsaW5lIChzdHJ1Y3QgaXQgKml0LCBib29sIGRlZmF1 bHRfZmFjZV9wKQogCSAgbWVtc2V0ICgmaXQtPnBvc2l0aW9uLCAwLCBzaXplb2YgaXQtPnBvc2l0 aW9uKTsKIAkgIGl0LT5vYmplY3QgPSBRbmlsOwogCSAgaXQtPmMgPSBpdC0+Y2hhcl90b19kaXNw bGF5ID0gJyAnOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgICAgICBpZiAoSVRfQllURVBPUyAoKml0KSA+PSBaVl9CWVRFKQorICAgICAg ICBpdC0+enZfcCA9IHRydWU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIGl0 LT5sZW4gPSAxOwogCiAJICAvKiBJZiB0aGUgZGVmYXVsdCBmYWNlIHdhcyByZW1hcHBlZCwgYmUg c3VyZSB0byB1c2UgdGhlCkBAIC0yMTI2OSw5ICsyNTUwNCwyMiBAQCBtYXliZV9wcm9kdWNlX2xp bmVfbnVtYmVyIChzdHJ1Y3QgaXQgKml0KQogICAgICAgZWxzZQogCXRlbV9pdC5jID0gdGVtX2l0 LmNoYXJfdG9fZGlzcGxheSA9ICpwOwogICAgICAgdGVtX2l0LmxlbiA9IDE7CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGlmIChi ZXlvbmRfenYpCisgICAgICAgIHRlbV9pdC56dl9wID0gdHJ1ZTsKKyAgICAgIHRlbV9pdC5jdXJy ZW50X3kgPSBpdC0+Y3VycmVudF95OworICAgICAgdGVtX2l0LnZwb3MgPSBpdC0+dnBvczsKICAg ICAgIC8qIE1ha2Ugc3VyZSB0aGVzZSBnbHlwaHMgd2lsbCBoYXZlIGEgInBvc2l0aW9uIiBvZiAt MS4gICovCiAgICAgICBTRVRfVEVYVF9QT1MgKHRlbV9pdC5wb3NpdGlvbiwgLTEsIC0xKTsKICAg ICAgIFBST0RVQ0VfR0xZUEhTICgmdGVtX2l0KTsKKyAgICAgIHRlbV9pdC5ocG9zICs9IDE7CisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCiAKICAgICAgIC8qIFN0b3AgcHJvZHVjaW5nIGds eXBocywgYW5kIHJlZnJhaW4gZnJvbSBwcm9kdWNpbmcgdGhlIGxpbmUKIAkgbnVtYmVyLCBpZiB3 ZSBkb24ndCBoYXZlIGVub3VnaCBzcGFjZSBvbiB0aGlzIGxpbmUuICAqLwpAQCAtMjEyODQsNiAr MjU1MzIsMzAgQEAgbWF5YmVfcHJvZHVjZV9saW5lX251bWJlciAoc3RydWN0IGl0ICppdCkKIAl9 CiAgICAgfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisgIExpc3BfT2JqZWN0IGJ1ZiA9IGl0LT53LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVG RkVSIChidWYpOworICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgc3RydWN0 IGJ1ZmZlciAqb2xkX2J1ZmZlciA9IE5VTEw7CisgIC8qIE5lZWRlZCBzbyB0aGF0IGJ1ZmZlci1s b2NhbCB2YWx1ZXMgY2FuIGJlIGRldGVybWluZWQ7IGUuZy4sIHdoZW4gc3dpdGNoaW5nCisgIHRv IHRoZSBtaW5pYnVmZmVyLiAqLworICBpZiAoYiAhPSBjdXJyZW50X2J1ZmZlcikKKyAgICB7Cisg ICAgICBvbGRfYnVmZmVyID0gY3VycmVudF9idWZmZXI7CisgICAgICBzZXRfYnVmZmVyX2ludGVy bmFsIChiKTsKKyAgICB9CisgIGl0LT53LT5tYy5sbnVtX3BpeGVsX3dpZHRoID0gKCFOSUxQIChW ZGlzcGxheV9saW5lX251bWJlcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g dGVtX2l0LmN1cnJlbnRfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMDsKKyAg aWYgKG9sZF9idWZmZXIpCisgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogUmVjb3JkIHRoZSB3aWR0aCBpbiBw aXhlbHMgd2UgbmVlZCBmb3IgdGhlIGxpbmUgbnVtYmVyIGRpc3BsYXkuICAqLwogICBpdC0+bG51 bV9waXhlbF93aWR0aCA9IHRlbV9pdC5jdXJyZW50X3g7CiAgIC8qIENvcHkgdGhlIHByb2R1Y2Vk IGdseXBocyBpbnRvIElUJ3MgZ2x5cGhfcm93LiAgKi8KQEAgLTI3MDkyLDYgKzMxMzY0LDIwIEBA IGFwcGVuZF9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGgg PSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9IGl0LT5j dXJyZW50X3g7CisgICAgICBnbHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICBnbHlwaC0+ aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKyAgICAgIGds eXBoLT56dl9wID0gaXQtPnp2X3A7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAg ICAgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBo LT5vYmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgaWYgKGl0LT5waXhlbF93aWR0aCA+IDApCkBA IC0yNzE3NSw2ICszMTQ2MSwyMCBAQCBhcHBlbmRfY29tcG9zaXRlX2dseXBoIChzdHJ1Y3QgaXQg Kml0KQogCSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1tp dC0+YXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUt Q1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7CisgICAgICBnbHlw aC0+eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAg ICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKyAgICAgIGdseXBoLT56dl9wID0gaXQtPnp2X3A7 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0g aXQtPmNtcF9pdC5jaGFycG9zOwogICAgICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAg ICAgICBlYXNzZXJ0IChpdC0+cGl4ZWxfd2lkdGggPD0gU0hSVF9NQVgpOwpAQCAtMjczODMsNiAr MzE2ODMsMjAgQEAgcHJvZHVjZV9pbWFnZV9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAg ICBpZiAoZ2x5cGggPCBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYSArIDFdKQogCXsKKworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAg Z2x5cGgtPnggPSBpdC0+Y3VycmVudF94OworICAgICAgZ2x5cGgtPnkgPSBpdC0+Y3VycmVudF95 OworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT52cG9zID0gaXQt PnZwb3M7CisgICAgICBnbHlwaC0+enZfcCA9IGl0LT56dl9wOworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAJICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7 CiAJICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9 IGNsaXBfdG9fYm91bmRzICgtMSwgaXQtPnBpeGVsX3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzQ4 Niw2ICszMTgwMCwyMCBAQCBwcm9kdWNlX3h3aWRnZXRfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJ fQogICAgICAgaWYgKGdseXBoIDwgaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2FyZWEgKyAxXSkKIAl7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgICAgIGdseXBoLT54ID0gaXQtPmN1cnJlbnRfeDsKKyAgICAgIGdseXBoLT55ID0gaXQtPmN1 cnJlbnRfeTsKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+dnBv cyA9IGl0LT52cG9zOworICAgICAgZ2x5cGgtPnp2X3AgPSBpdC0+enZfcDsKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogCSAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9z aXRpb24pOwogCSAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAJICBnbHlwaC0+cGl4ZWxf d2lkdGggPSBjbGlwX3RvX2JvdW5kcyAoLTEsIGl0LT5waXhlbF93aWR0aCwgU0hSVF9NQVgpOwpA QCAtMjc1NzIsNiArMzE5MDAsMjAgQEAgYXBwZW5kX3N0cmV0Y2hfZ2x5cGggKHN0cnVjdCBpdCAq aXQsIExpc3BfT2JqZWN0IG9iamVjdCwKIAkgICAgd2lkdGggLT0gaXQtPmZpcnN0X3Zpc2libGVf eCAtIGl0LT5jdXJyZW50X3g7CiAJICBlYXNzZXJ0ICh3aWR0aCA+IDApOwogCX0KKworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5 cGgtPnggPSBpdC0+Y3VycmVudF94OworICAgICAgZ2x5cGgtPnkgPSBpdC0+Y3VycmVudF95Owor ICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT52cG9zID0gaXQtPnZw b3M7CisgICAgICBnbHlwaC0+enZfcCA9IGl0LT56dl9wOworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7 CiAgICAgICBnbHlwaC0+b2JqZWN0ID0gb2JqZWN0OwogICAgICAgLyogRklYTUU6IEl0IHdvdWxk IGJlIGJldHRlciB0byB1c2UgVFlQRV9NQVggaGVyZSwgYnV0CkBAIC0yODAyNiw2ICszMjM2OCwy MCBAQCBhcHBlbmRfZ2x5cGhsZXNzX2dseXBoIChzdHJ1Y3QgaXQgKml0LCBpbnQgZmFjZV9pZCwg Ym9vbCBmb3Jfbm9fZm9udCwgaW50IGxlbiwKIAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGggPSBp dC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJy ZW50X3g7CisgICAgICBnbHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICBnbHlwaC0+aHBv cyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKyAgICAgIGdseXBo LT56dl9wID0gaXQtPnp2X3A7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAg IGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5v YmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgZWFzc2VydCAoaXQtPnBpeGVsX3dpZHRoIDw9IFNI UlRfTUFYKTsKQEAgLTI5MDc2LDEwICszMzQzMiwzMyBAQCB4X2luc2VydF9nbHlwaHMgKHN0cnVj dCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnVwZGF0ZWRfcm93LAogCiAgIC8qIFdyaXRl IHRoZSBnbHlwaHMuICAqLwogICBocG9zID0gc3RhcnQgLSByb3ctPmdseXBoc1t1cGRhdGVkX2Fy ZWFdOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAq LworCisgIGlmICgody0+bWNfZWx0cy51c2VkID4gMCB8fCB3LT5jaF9lbHRzLnVzZWQgPiAwIHx8 IHctPmZjX2VsdHMudXNlZCA+IDApCisgICAgICAmJiB1cGRhdGVkX2FyZWEgPT0gVEVYVF9BUkVB KQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRf bWF0cml4OworICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsK KyAgICAgIGludCBzdGFydF94ID0gdy0+b3V0cHV0X2N1cnNvci54OworICAgICAgaW50IHN0YXJ0 X2hwb3MgPSBocG9zOworICAgICAgaW50IGVuZF9ocG9zID0gaHBvcyArIGxlbjsKKyAgICAgIGJv b2wgY2xlYXJfZW9sX3AgPSBmYWxzZTsKKyAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCA9 IERSQVdfTk9STUFMX1RFWFQ7CisgICAgICBUUkFDRSAoKHN0ZGVyciwgInhfaW5zZXJ0X2dseXBo cyAoJWQpOiAgc3RhcnRfeCAoJWQpIHwgc3RhcnRfaHBvcyAoJWQpIHwgZW5kX2hwb3MgKCVkKVxu IiwKKyAgICAgICAgICAgICAgICAgICAgICB2cG9zLCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRf aHBvcykpOworICAgICAgbWNfcmVkcmF3X3JvdyAodywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0 YXJ0X2hwb3MsIGVuZF9ocG9zLCBjbGVhcl9lb2xfcCwgaGwpOworICAgIH0KKyAgICBlbHNlCiAg IGRyYXdfZ2x5cGhzICh3LCB3LT5vdXRwdXRfY3Vyc29yLngsIHJvdywgdXBkYXRlZF9hcmVhLAog CSAgICAgICBocG9zLCBocG9zICsgbGVuLAogCSAgICAgICBEUkFXX05PUk1BTF9URVhULCAwKTsK IAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBBZHZhbmNlIHRoZSBvdXRwdXQg Y3Vyc29yLiAgKi8KICAgdy0+b3V0cHV0X2N1cnNvci5ocG9zICs9IGxlbjsKICAgdy0+b3V0cHV0 X2N1cnNvci54ICs9IHNoaWZ0X2J5X3dpZHRoOwpAQCAtMjk1MDUsOSArMzM4ODQsMzEgQEAgeF9m aXhfb3ZlcmxhcHBpbmdfYXJlYSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAq cm93LAogCSAgd2hpbGUgKGkgPCByb3ctPnVzZWRbYXJlYV0KIAkJICYmIHJvdy0+Z2x5cGhzW2Fy ZWFdW2ldLm92ZXJsYXBzX3ZlcnRpY2FsbHlfcCk7CiAKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgICAgaWYgKCh3LT5tY19lbHRzLnVz ZWQgPiAwIHx8IHctPmNoX2VsdHMudXNlZCA+IDAgfHwgdy0+ZmNfZWx0cy51c2VkID4gMCkKKyAg ICAgICAgICAgICYmIGFyZWEgPT0gVEVYVF9BUkVBKQorICAgICAgICAgIHsKKyAgICAgICAgICAg IHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAg ICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAg ICAgIGludCBzdGFydF9ocG9zID0gc3RhcnQ7CisgICAgICAgICAgICBpbnQgZW5kX2hwb3MgPSBp OworICAgICAgICAgICAgYm9vbCBjbGVhcl9lb2xfcCA9IGZhbHNlOworICAgICAgICAgICAgZW51 bSBkcmF3X2dseXBoc19mYWNlIGhsID0gRFJBV19OT1JNQUxfVEVYVDsKKyAgICAgICAgICAgIFRS QUNFICgoc3RkZXJyLCAieF9maXhfb3ZlcmxhcHBpbmdfYXJlYSAoJWQpOiAgc3RhcnRfeCAoJWQp IHwgc3RhcnRfaHBvcyAoJWQpIHwgZW5kX2hwb3MgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICB2cG9zLCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcykpOworICAgICAg ICAgICAgbWNfcmVkcmF3X3JvdyAodywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3Ms IGVuZF9ocG9zLCBjbGVhcl9lb2xfcCwgaGwpOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNl CiAJICBkcmF3X2dseXBocyAodywgc3RhcnRfeCwgcm93LCBhcmVhLAogCQkgICAgICAgc3RhcnQs IGksCiAJCSAgICAgICBEUkFXX05PUk1BTF9URVhULCBvdmVybGFwcyk7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIAl9CiAgICAgICBlbHNlCiAJewpAQCAtMjk3NTgsMTAgKzM0MTU5 LDE3IEBAIGRpc3BsYXlfYW5kX3NldF9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb24s CiAgIG5ld19jdXJzb3JfdHlwZSA9IGdldF93aW5kb3dfY3Vyc29yX3R5cGUgKHcsIGdseXBoLAog CQkJCQkgICAgJm5ld19jdXJzb3Jfd2lkdGgsICZhY3RpdmVfY3Vyc29yKTsKIAorCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAvKiBJZiBjdXJz b3IgaXMgY3VycmVudGx5IGJlaW5nIHNob3duIGFuZCB3ZSBkb24ndCB3YW50IGl0IHRvIGJlIG9y CiAgICAgIGl0IGlzIGluIHRoZSB3cm9uZyBwbGFjZSwgb3IgdGhlIGN1cnNvciB0eXBlIGlzIG5v dCB3aGF0IHdlIHdhbnQsCiAgICAgIGVyYXNlIGl0LiAgKi8KICAgaWYgKHctPnBoeXNfY3Vyc29y X29uX3AKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3No YWlycykpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zp c2libGUpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19j b25mKSkKICAgICAgICYmICghb24KIAkgIHx8IHctPnBoeXNfY3Vyc29yLnggIT0geAogCSAgfHwg dy0+cGh5c19jdXJzb3IueSAhPSB5CkBAIC0yOTc3NCw2ICszNDE4Miw5IEBAIGRpc3BsYXlfYW5k X3NldF9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb24sCiAJICAgICAgJiYgbmV3X2N1 cnNvcl93aWR0aCAhPSB3LT5waHlzX2N1cnNvcl93aWR0aCkpKQogICAgIGVyYXNlX3BoeXNfY3Vy c29yICh3KTsKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBEb24ndCBjaGVj ayBwaHlzX2N1cnNvcl9vbl9wIGhlcmUgYmVjYXVzZSB0aGF0IGZsYWcgaXMgb25seSBzZXQKICAg ICAgdG8gZmFsc2UgaW4gc29tZSBjYXNlcyB3aGVyZSB3ZSBrbm93IHRoYXQgdGhlIGN1cnNvciBo YXMgYmVlbgogICAgICBjb21wbGV0ZWx5IGVyYXNlZCwgdG8gYXZvaWQgdGhlIGV4dHJhIHdvcmsg b2YgZXJhc2luZyB0aGUgY3Vyc29yCkBAIC0yOTc5Miw5ICszNDIwMywxOSBAQCBkaXNwbGF5X2Fu ZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9uLAogICAgICAgdy0+cGh5c19j dXJzb3IudnBvcyA9IHZwb3M7CiAgICAgfQogCi0gIEZSQU1FX1JJRiAoZiktPmRyYXdfd2luZG93 X2N1cnNvciAodywgZ2x5cGhfcm93LCB4LCB5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIG5ld19jdXJzb3JfdHlwZSwgbmV3X2N1cnNvcl93aWR0aCwKLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBvbiwgYWN0aXZlX2N1cnNvcik7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmIChOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICYmIE5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgIEZSQU1FX1JJRiAo ZiktPmRyYXdfd2luZG93X2N1cnNvciAodywgZ2x5cGhfcm93LCB4LCB5LCBuZXdfY3Vyc29yX3R5 cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY3Vyc29yX3dp ZHRoLCBvbiwgYWN0aXZlX2N1cnNvcik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IH0KIAogCkBAIC0yOTg4Nyw3ICszNDMwOCwyNyBAQCBkcmF3X3Jvd193aXRoX21vdXNlX2ZhY2Ug KHN0cnVjdCB3aW5kb3cgKncsIGludCBzdGFydF94LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCiAj aWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAgIGlmIChGUkFNRV9XSU5ET1dfUCAoWEZSQU1FICh3 LT5mcmFtZSkpKQogICAgIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJ UExFLUNVUlNPUlMgKi8KKworICAgICAgaWYgKHctPm1jX2VsdHMudXNlZCA+IDAgfHwgdy0+Y2hf ZWx0cy51c2VkID4gMCB8fCB3LT5mY19lbHRzLnVzZWQgPiAwKQorICAgICAgICB7CisgICAgICAg ICAgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAg ICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAg ICBib29sIGNsZWFyX2VvbF9wID0gZmFsc2U7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19m YWNlIGhsID0gZHJhdzsKKyAgICAgICAgICBUUkFDRSAoKHN0ZGVyciwgImRyYXdfcm93X3dpdGhf bW91c2VfZmFjZSAoJWQpOiAgc3RhcnRfeCAoJWQpIHwgc3RhcnRfaHBvcyAoJWQpIHwgZW5kX2hw b3MgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgc3RhcnRfeCwgc3Rh cnRfaHBvcywgZW5kX2hwb3MpKTsKKyAgICAgICAgICBtY19yZWRyYXdfcm93ICh3LCBtYXRyaXgs IHJvdywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGNsZWFyX2VvbF9wLCBobCk7Cisg ICAgICAgIH0KKyAgICAgICAgZWxzZQogICAgICAgZHJhd19nbHlwaHMgKHcsIHN0YXJ0X3gsIHJv dywgVEVYVF9BUkVBLCBzdGFydF9ocG9zLCBlbmRfaHBvcywgZHJhdywgMCk7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICAgIHJldHVybjsKICAgICB9CiAjZW5kaWYKQEAgLTMx OTQ1LDExICszNjM4NiwzNCBAQCBleHBvc2VfYXJlYSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0 IGdseXBoX3JvdyAqcm93LCBYUmVjdGFuZ2xlICpyLAogICBzdHJ1Y3QgZ2x5cGggKmxhc3Q7CiAg IGludCBmaXJzdF94LCBzdGFydF94LCB4OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiByb3ct PmZpbGxfbGluZV9wKQorICAgIHsKKyAgICAgIGlmICh3LT5tY19lbHRzLnVzZWQgPiAwIHx8IHct PmNoX2VsdHMudXNlZCA+IDAgfHwgdy0+ZmNfZWx0cy51c2VkID4gMCkKKyAgICAgICAgeworICAg ICAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4Owor ICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAg ICAgICAgaW50IHN0YXJ0X3ggPSAwOworICAgICAgICAgIGludCBzdGFydF9ocG9zID0gMDsKKyAg ICAgICAgICBpbnQgZW5kX2hwb3MgPSByb3ctPnVzZWRbVEVYVF9BUkVBXTsKKyAgICAgICAgICBi b29sIGNsZWFyX2VvbF9wID0gZmFsc2U7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNl IGhsID0gRFJBV19OT1JNQUxfVEVYVDsKKyAgICAgICAgICBUUkFDRSAoKHN0ZGVyciwgImV4cG9z ZV9hcmVhICglZCk6ICBXcml0ZSB0aGUgd2hvbGUgbGluZS5cbiIsIHZwb3MpKTsKKyAgICAgICAg ICBtY19yZWRyYXdfcm93ICh3LCBtYXRyaXgsIHJvdywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5k X2hwb3MsIGNsZWFyX2VvbF9wLCBobCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQogICAgIC8q IElmIHJvdyBleHRlbmRzIGZhY2UgdG8gZW5kIG9mIGxpbmUgd3JpdGUgdGhlIHdob2xlIGxpbmUu ICAqLwogICAgIGRyYXdfZ2x5cGhzICh3LCAwLCByb3csIGFyZWEsCiAJCSAwLCByb3ctPnVzZWRb YXJlYV0sCiAJCSBEUkFXX05PUk1BTF9URVhULCAwKTsKKyAgICB9CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKICAgZWxzZQogICAgIHsKICAgICAgIC8qIFNldCBTVEFSVF9YIHRvIHRo ZSB3aW5kb3ctcmVsYXRpdmUgc3RhcnQgcG9zaXRpb24gZm9yIGRyYXdpbmcgZ2x5cGhzIG9mCkBA IC0zMTk4MSwxMSArMzY0NDUsMzQgQEAgZXhwb3NlX2FyZWEgKHN0cnVjdCB3aW5kb3cgKncsIHN0 cnVjdCBnbHlwaF9yb3cgKnJvdywgWFJlY3RhbmdsZSAqciwKIAkgICsrbGFzdDsKIAl9CiAKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgICAg IC8qIFJlcGFpbnQuICAqLwotICAgICAgaWYgKGxhc3QgPiBmaXJzdCkKKyAgICAgIC8qIEZsb2F0 aW5nIGZha2UgY3Vyc29ycyB3aWxsIGV4aXN0IHdoZW4gKGxhc3QgPT0gZmlyc3QpLiAqLworICAg ICAgaWYgKCh3LT5tY19lbHRzLnVzZWQgPiAwIHx8IHctPmNoX2VsdHMudXNlZCA+IDAgfHwgdy0+ ZmNfZWx0cy51c2VkID4gMCkKKyAgICAgICAgICAmJiBhcmVhID09IFRFWFRfQVJFQSkKKyAgICAg ICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRf bWF0cml4OworICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJp eCk7CisgICAgICAgICAgc3RhcnRfeCA9IGZpcnN0X3ggLSBzdGFydF94OworICAgICAgICAgIGlu dCBzdGFydF9ocG9zID0gZmlyc3QgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAg IGludCBlbmRfaHBvcyA9IGxhc3QgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAg IGJvb2wgY2xlYXJfZW9sX3AgPSBmYWxzZTsKKyAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2Zh Y2UgaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgICAgIFRSQUNFICgoc3RkZXJyLCAiZXhw b3NlX2FyZWEgKCVkKTogIHN0YXJ0X3ggKCVkKSB8IHN0YXJ0X2hwb3MgKCVkKSB8IGVuZF9ocG9z ICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIHN0YXJ0X3gsIHN0YXJ0 X2hwb3MsIGVuZF9ocG9zKSk7CisgICAgICAgICAgbWNfcmVkcmF3X3JvdyAodywgbWF0cml4LCBy b3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBjbGVhcl9lb2xfcCwgaGwpOworICAg ICAgICB9CisgICAgICAgIGVsc2UgaWYgKGxhc3QgPiBmaXJzdCkKIAlkcmF3X2dseXBocyAodywg Zmlyc3RfeCAtIHN0YXJ0X3gsIHJvdywgYXJlYSwKIAkJICAgICBmaXJzdCAtIHJvdy0+Z2x5cGhz W2FyZWFdLCBsYXN0IC0gcm93LT5nbHlwaHNbYXJlYV0sCiAJCSAgICAgRFJBV19OT1JNQUxfVEVY VCwgMCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB9CiB9CiAKQEAgLTMx OTk5LDEwICszNjQ4NiwzMyBAQCBleHBvc2VfbGluZSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0 IGdseXBoX3JvdyAqcm93LCBYUmVjdGFuZ2xlICpyKQogewogICBlYXNzZXJ0IChyb3ctPmVuYWJs ZWRfcCk7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKICAgaWYgKHJvdy0+bW9kZV9saW5lX3AgfHwgdy0+cHNldWRvX3dpbmRvd19wKQorICAg IHsKKyAgICAgIGlmICh3LT5tY19lbHRzLnVzZWQgPiAwIHx8IHctPmNoX2VsdHMudXNlZCA+IDAg fHwgdy0+ZmNfZWx0cy51c2VkID4gMCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlw aF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgICAgIGludCB2cG9z ID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAgICAgICAgaW50IHN0YXJ0X3gg PSAwOworICAgICAgICAgIGludCBzdGFydF9ocG9zID0gMDsKKyAgICAgICAgICBpbnQgZW5kX2hw b3MgPSByb3ctPnVzZWRbVEVYVF9BUkVBXTsKKyAgICAgICAgICBib29sIGNsZWFyX2VvbF9wID0g ZmFsc2U7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIGhsID0gRFJBV19OT1JNQUxf VEVYVDsKKyAgICAgICAgICBUUkFDRSAoKHN0ZGVyciwgImV4cG9zZV9saW5lICglZCk6ICBXcml0 ZSB0aGUgd2hvbGUgbGluZS5cbiIsIHZwb3MpKTsKKyAgICAgICAgICBtY19yZWRyYXdfcm93ICh3 LCBtYXRyaXgsIHJvdywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGNsZWFyX2VvbF9w LCBobCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQogICAgIGRyYXdfZ2x5cGhzICh3LCAwLCBy b3csIFRFWFRfQVJFQSwKIAkJIDAsIHJvdy0+dXNlZFtURVhUX0FSRUFdLAogCQkgRFJBV19OT1JN QUxfVEVYVCwgMCk7CisgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIGVs c2UKICAgICB7CiAgICAgICBpZiAocm93LT51c2VkW0xFRlRfTUFSR0lOX0FSRUFdKQpAQCAtMzI1 NTAsNiArMzcwNjAsMjIgQEAgeF9pbnRlcnNlY3RfcmVjdGFuZ2xlcyAoWFJlY3RhbmdsZSAqcjEs IFhSZWN0YW5nbGUgKnIyLCBYUmVjdGFuZ2xlICpyZXN1bHQpCiB2b2lkCiBzeW1zX29mX3hkaXNw ICh2b2lkKQogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgIGRlZnN1YnIgKCZTbWNfZHVtcF9nbHlwaF9yb3cpOworCisgIGRlZnN1YnIg KCZTbWNfZHVtcF9nbHlwaF9tYXRyaXgpOworCisgIGRlZnN1YnIgKCZTbWNfY3VycmVudF9jb2x1 bW4pOworCisgIGRlZnN1YnIgKCZTbWNfc3RkZXJyKTsKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICBWd2l0aF9lY2hvX2FyZWFfc2F2ZV92ZWN0b3IgPSBRbmlsOwogICBzdGF0aWNw cm8gKCZWd2l0aF9lY2hvX2FyZWFfc2F2ZV92ZWN0b3IpOwogCmRpZmYgLS1naXQgYS9zcmMveHRl cm0uYyBiL3NyYy94dGVybS5jCmluZGV4IDVhYTNlM2YuLjk1M2ExMDQgMTAwNjQ0Ci0tLSBhL3Ny Yy94dGVybS5jCisrKyBiL3NyYy94dGVybS5jCkBAIC0xMzIsNiArMTMyLDg2OSBAQCBhbG9uZyB3 aXRoIEdOVSBFbWFjcy4gIElmIG5vdCwgc2VlIDxodHRwczovL3d3dy5nb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RhbmdsZXMgKGYsIGdjKTsKK30KKworLyogRHJh dyBhIGJhciBjdXJzb3Igb24gd2luZG93IFcgaW4gZ2x5cGggcm93IFJPVy4gKi8KK3N0YXRpYyB2 b2lkCittY194X2RyYXdfYmFyX2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBo X21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAg ICAgICAgaW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50IGhwb3MsIGludCB2cG9zLCBp bnQgd2QsIGludCBoLAorICAgICAgICAgICAgICAgICAgICAgIGludCB3aWR0aCwgZW51bSB0eXBl X29mX2N1cnNvciBraW5kLCBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKQoreworICBz dHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgLyogSWYgY3Vyc29yIGlzIG91 dCBvZiBib3VuZHMsIGRvbid0IGRyYXcgZ2FyYmFnZS4gIFRoaXMgY2FuIGhhcHBlbgorICAgICBp biBtaW5pLWJ1ZmZlciB3aW5kb3dzIHdoZW4gc3dpdGNoaW5nIGJldHdlZW4gZWNobyBhcmVhIGds eXBocworICAgICBhbmQgbWluaS1idWZmZXIuICAqLworICBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9n bHlwaCA9IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBocG9zLCB2cG9zKTsK KyAgaWYgKGN1cnNvcl9nbHlwaCA9PSBOVUxMKQorICAgIHJldHVybjsKKyAgLyogRXhwZXJpbWVu dGFsIGF2b2lkYW5jZSBvZiBjdXJzb3Igb24geHdpZGdldC4gICovCisgIGlmIChjdXJzb3JfZ2x5 cGgtPnR5cGUgPT0gWFdJREdFVF9HTFlQSCkKKyAgICByZXR1cm47CisgIC8qIElmIG9uIGFuIGlt YWdlLCBkcmF3IGxpa2U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ZUdDIChkcHksIHdpbmRvdywgbWFzaywgJnhnY3YpOworICAgICAgICAgIEZSQU1FX0RJU1BMQVlf SU5GTyAoZiktPnNjcmF0Y2hfY3Vyc29yX2djID0gZ2M7CisgICAgICAgIH0KKyAgICAgIHhfY2xp cF90b19yb3cgKHcsIHJvdywgVEVYVF9BUkVBLCBnYyk7CisgICAgICB4X2ZpbGxfcmVjdGFuZ2xl IChmLCBnYywgZngsIGZ5LCB3ZCwgaCk7CisgICAgICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAo ZiwgZ2MpOworICAgIH0KK30KKworLyogUklGOiBEcmF3IGN1cnNvciBvbiB3aW5kb3cgVy4gKi8K K3N0YXRpYyB2b2lkCittY194X2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywg c3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAg ICAgICAgICAgICAgICAgICAgICAgaW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50IGhw b3MsIGludCB2cG9zLCBpbnQgd2QsIGludCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0 cnVjdCBtY19SR0IgbHNsLCBlbnVtIHR5cGVfb2ZfY3Vyc29yIGN1cnNvcl90eXBlLCBpbnQgY3Vy c29yX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBo X2ZsYXZvciwgYm9vbCBvbl9wLCBib29sIGFjdGl2ZV9wKQoreworICBzdHJ1Y3QgZnJhbWUgKmYg PSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICAvKiBUaGUgZnJpbmdlIGJpdG1hcHMgYXJl IHByZXNlbnRseSBoYW5kbGVkIGVsc2V3aGVyZSwgYnV0IGNvdWxkIHNvbWVkYXkKKyAgYmUgbWFu YWdlZCAoaW4gcGFydCkgYXQgdGhpcyBzZWN0aW9uIG9mIGNvZGU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Z3JlZW4pOworICBjb2xvci5ibHVlID0gbWluICg2NTUzNSwgNjU1MzUgKiBs c2wuYmx1ZSk7CisgIC8qIGB4X2FsbG9jX25lYXJlc3RfY29sb3InIHNldHMgdGhlIGBjb2xvci5w aXhlbGAuICovCisgIHhfYWxsb2NfbmVhcmVzdF9jb2xvciAoZiwgY21hcCwgJmNvbG9yKTsKKyAg c3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgeworICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoK KyAgICAgIGJyZWFrOworICAgIGNhc2UgTUNfTk9fQ1VSU09SOgorICAgICAgYnJlYWs7CisgICAg Y2FzZSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOgorICAgICAgYnJlYWs7CisgICAgY2FzZSBNQ19M RUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICBicmVhazsKKyAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6 CisgICAgeworICAgICAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGggPSBtY19nZXRfY3Vyc29y X2dseXBoICh3LCBtYXRyaXgsIHJvdywgaHBvcywgdnBvcyk7CisgICAgICBpZiAoY3Vyc29yX2ds eXBoID09IE5VTEwpCisgICAgICAgIHJldHVybjsKKyAgICAgIExpc3BfT2JqZWN0IGJ1ZiA9IHct PmNvbnRlbnRzOworICAgICAgQ0hFQ0tfQlVGRkVSIChidWYpOworICAgICAgc3RydWN0IGJ1ZmZl ciAqYiA9IFhCVUZGRVIgKGJ1Zik7CisgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklM UCAoVnRyYW5zaWVudF9tYXJrX21vZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiAhTklMUCAoQlZBUiAoYiwgbWFya19hY3RpdmUpKSk7CisgICAgICBwdHJkaWZmX3QgcmVnaW9u X2JlZ2lubmluZyA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9iZWdpbm5p bmcgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2VuZCA9IChyZWdpb25fYWN0aXZl X3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9lbmQgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3Qgb3Bv aW50X3B0ID0gKHcgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBYRklYTlVN IChGbWFya2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pKTsKKyAgICAgIGJvb2wgcmVnaW9uX2luX2Jv dW5kc19wID0gKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb3BvaW50X3B0ID49IHJlZ2lvbl9iZWdpbm5pbmcKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIG9wb2ludF9wdCA8IHJlZ2lvbl9lbmQpOworICAgICAgaWYgKGN1cnNv cl9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCAmJiBsc2wucmVkID49IDAgJiYgbHNsLmdyZWVu ID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFy aWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhl CisgICAgICAgICAgZnVuY3Rpb25hbGl0eSBvZiBgeF9tYWtlX2djJyBpbiB4Zm5zLmMuICAqLwor ICAgICAgICAgIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgJiYgcmVnaW9uX2lu X2JvdW5kc19wCisgICAgICAgICAgICAgICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgeworICAg ICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fZmFj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ICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElT UExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2luYWN0aXZlX2Zh Y2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJB TUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfaW5h Y3RpdmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAg YmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgLyogRm9yY2UgYG1jX3hfc2V0X2N1cnNvcl9nYycg dG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MnLiAgKi8KKyAgICAgICAgICBi b29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAo dywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLCBsc2wsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBh Y3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9Y X0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIHhnY3YuZm9yZWdyb3Vu ZCk7CisgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91 dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdjdi5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICB1bmJs b2NrX2lucHV0ICgpOworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0 X2RhdGEueC0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hY2UtPmJhY2tncm91bmQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAh cmVnaW9uX2luX2JvdW5kc19wCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3Ap CisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBo b2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBm LCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcmVnaW9uLWZhY2UiKSwgdHJ1ZSk7CisgICAg ICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfZmFj ZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fb3V0X2ZhY2VfaWQpOwor ICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0g bG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNl IiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2 ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAg ICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0 cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQpOwor ICAgICAgICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwg Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfZmFj ZS0+Zm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBl bHNlIGlmICghcmVnaW9uX2FjdGl2ZV9wICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfZmFj ZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJz b3ItZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9s bG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQp OworICAgICAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkg KGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19hY3RpdmVfZmFjZS0+Zm9y ZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hf RElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9m YWNlLT5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAg ICAgICAvKiBUaGUgcmVnaW9uIGlzIF9ub3RfIHZpc2libGUgaW4gdGhlIGluYWN0aXZlIHdpbmRv dyBiZWNhdXNlIHRoZSBvdmVybGF5IHdpbmRvdyBwcm9wZXJ0eSBpcyB1c2VkLiAqLworICAgICAg ICAgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9m YWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1 cnNvci1pbmFjdGl2ZS1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgc3Ry dWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3df aW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3Vu ZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xs b3dfaW5hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBY U2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vy c29yX2djLCBob2xsb3dfaW5hY3RpdmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAg LyogRm9yY2UgYG1jX3hfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS54 LT5jdXJzb3JfZ2MnLiAgKi8KKyAgICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7 CisgICAgICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgRFJB V19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAg ICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9nYywgeGdjdi5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgWFNldEJhY2tncm91 bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdj di5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAg ICAgICAgLyogRHJhdyB0aGUgZnJhbWUgYXJvdW5kIHRoZSBib3guICovCisgICAgICAgICAgICAg IG1jX3hfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBo cG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9Cisg ICAgY2FzZSBNQ19IT0xMT1dfQk9YOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYg bHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8q IFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4gICov CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7 CisgICAgICAgICAgbWNfeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBm eCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54 LT5jdXJzb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vcl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAg ICBtY194X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBv cywgdnBvcywgd2QsIGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxl X29rYXlfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3Jp Z2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7 CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7Cisg ICAgICAgICAgICBtY194X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5 LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2Nf aW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAg IGNhc2UgTUNfSEJBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVl biA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3Jh cmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICAqLworICAgICAg ICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAg ICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1j X3hfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2 cG9zLCB3ZCwgaCwgY3Vyc29yX3dpZHRoLCBNQ19IQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29r YXlfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2lu YWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7Cisg ICAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAg ICAgICAgICBtY194X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBm eSwgaHBvcywgdnBvcywgd2QsIGgsIGN1cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29yX2djX2lu dmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBk ZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KKyAgICAgICAgfQorI2lmZGVmIEhB VkVfWF9JMThOCisgIGlmICh3ID09IFhXSU5ET1cgKGYtPnNlbGVjdGVkX3dpbmRvdykpCisgICAg aWYgKEZSQU1FX1hJQyAoZikgJiYgKEZSQU1FX1hJQ19TVFlMRSAoZikgJiBYSU1QcmVlZGl0UG9z aXRpb24pKQorICAgICAgeGljX3NldF9wcmVlZGl0YXJlYSAodywgeCwgeSk7CisjZW5kaWYKKyAg ICB9CisgIFhGbHVzaCAoRlJBTUVfWF9ESVNQTEFZIChmKSk7Cit9CisKKy8qIERyYXcgc3RyZXRj aCBnbHlwaCBzdHJpbmcgUy4gICovCitzdGF0aWMgdm9pZAorbWNfeF9kcmF3X3N0cmV0Y2hfZ2x5 cGhfc3RyaW5nIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzKQoreworICBlYXNzZXJ0IChzLT5maXJz dF9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKTsKKyAgaWYgKHMtPmhsID09IERSQVdfQ1VS U09SCisgICAgICAmJiAheF9zdHJldGNoX2N1cnNvcl9wKQorICAgIHsKKyAgICAgIC8qIElmIGB4 LXN0cmV0Y2gtY3Vyc29yJyBpcyBuaWwsIGRvbid0IGRyYXcgYSBibG9jayBjdXJzb3IgYXMKKyAg IHdpZGUgYXMgdGhlIHN0cmV0Y2ggZ2x5cGguICAqLworICAgICAgaW50IHdpZHRoLCBiYWNrZ3Jv dW5kX3dpZHRoID0gcy0+YmFja2dyb3VuZF93aWR0aDsKKyAgICAgIGludCB4ID0gcy0+eDsKKyAg ICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQorICB7CisgICAgaW50IGxlZnRfeCA9IHdpbmRv d19ib3hfbGVmdF9vZmZzZXQgKHMtPncsIFRFWFRfQVJFQSk7CisgICAgaWYgKHggPCBsZWZ0X3gp CisgICAgICB7CisgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0gbGVmdF94IC0geDsKKyAgICAg ICAgeCA9IGxlZnRfeDsKKyAgICAgIH0KKyAgfQorICAgICAgZWxzZQorICB7CisgICAgLyogSW4g UjJMIHJvd3MsIGRyYXcgdGhlIGN1cnNvciBvbiB0aGUgcmlnaHQgZWRnZSBvZiB0aGUKKyAgICAg ICBzdHJldGNoIGdseXBoLiAgKi8KKyAgICBpbnQgcmlnaHRfeCA9IHdpbmRvd19ib3hfcmlnaHQg KHMtPncsIFRFWFRfQVJFQSk7CisgICAgaWYgKHggKyBiYWNrZ3JvdW5kX3dpZHRoID4gcmlnaHRf eCkKKyAgICAgIGJhY2tncm91bmRfd2lkdGggLT0geCAtIHJpZ2h0X3g7CisgICAgeCArPSBiYWNr Z3JvdW5kX3dpZHRoOworICB9CisgICAgICB3aWR0aCA9IG1pbiAoRlJBTUVfQ09MVU1OX1dJRFRI IChzLT5mKSwgYmFja2dyb3VuZF93aWR0aCk7CisgICAgICBpZiAocy0+cm93LT5yZXZlcnNlZF9w KQorICB4IC09IHdpZHRoOworICAgICAgLyogRHJhdy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yAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKm5leHQ7CisgICAgICBmb3IgKHdpZHRoID0gMCwg bmV4dCA9IHMtPm5leHQ7CisgICAgICAgICAgIG5leHQgJiYgd2lkdGggPCBzLT5yaWdodF9vdmVy aGFuZzsKKyAgICAgICAgICAgd2lkdGggKz0gbmV4dC0+d2lkdGgsIG5leHQgPSBuZXh0LT5uZXh0 KQorICAgICAgICBpZiAobmV4dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgIT0gSU1BR0VfR0xZUEgpCisg ICAgICAgICAgeworICAgICAgICAgICAgbWNfeF9zZXRfZ2x5cGhfc3RyaW5nX2djIChuZXh0LCBj dXJzb3JfZ2NfcCk7CisgICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmcgKG5l eHQpOworICAgICAgICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlID09IFNUUkVUQ0hf R0xZUEgpCisgICAgICAgICAgICAgIG1jX3hfZHJhd19zdHJldGNoX2dseXBoX3N0cmluZyAobmV4 dCk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdf YmFja2dyb3VuZCAobmV4dCwgdHJ1ZSk7CisgICAgICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAw OworICAgICAgICAgIH0KKyAgICB9CisgIC8qIFNldCB1cCBTLT5nYywgc2V0IGNsaXBwaW5nIGFu ZCBkcmF3IFMuICAqLworICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHMsIGN1cnNvcl9nY19w KTsKKyAgLyogRHJhdyByZWxpZWYgKGlmIGFueSkgaW4gYWR2YW5jZSBmb3IgY2hhci9jb21wb3Np dGlvbiBzbyB0aGF0IHRoZQorICAgICBnbHlwaCBzdHJpbmcgY2FuIGJlIGRyYXduIG92ZXIgaXQu ICAqLworICBpZiAoIXMtPmZvcl9vdmVybGFwcworICAgICAgJiYgcy0+ZmFjZS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xhcHMpCisgIHMtPmJhY2tncm91 bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2Jh Y2tncm91bmQgKHMsIHRydWUpOworICAgICAgeF9kcmF3X2dseXBobGVzc19nbHlwaF9zdHJpbmdf Zm9yZWdyb3VuZCAocyk7CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3Nf YWJvcnQgKCk7CisgICAgfQorICBpZiAoIXMtPmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICAv KiBEcmF3IHVuZGVybGluZS4gICovCisgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3ApCisg ICAgICAgIHsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9V TkRFUl9XQVZFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5k ZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgICAgIHhfZHJhd191bmRlcndhdmUgKHMp OworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgWEdDVmFsdWVzIHhnY3Y7CisgICAgICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKHMtPmRp c3BsYXksIHMtPmdjLCBHQ0ZvcmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAgICAgIFhT ZXRGb3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBzLT5nYywgcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9y KTsKKyAgICAgICAgICAgICAgICAgIHhfZHJhd191bmRlcndhdmUgKHMpOworICAgICAgICAgICAg ICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCB4Z2N2LmZvcmVncm91bmQp OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChz LT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICB7 CisgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAgICAg ICAgICAgICAgaW50IHk7CisgICAgICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZh Y2UtPnVuZGVybGluZV9wCisgICAgICAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9 PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg LyogV2UgdXNlIHRoZSBzYW1lIHVuZGVybGluZSBzdHlsZSBhcyB0aGUgcHJldmlvdXMgb25lLiAg Ki8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPnByZXYtPnVuZGVybGluZV90aGlj a25lc3M7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGluZV9w b3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSB0aGlja25l c3MuICBEZWZhdWx0IGlzIDEgcGl4ZWwuICAqLworICAgICAgICAgICAgICAgICAgaWYgKHMtPmZv bnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAgICAgICAgICAg ICAgIHRoaWNrbmVzcyA9IHMtPmZvbnQtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAg ICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2VudF9saW5lKQorICAgICAgICAgICAg ICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSB0aGlja25lc3MpIC0gKHMtPnliYXNlIC0g cy0+eSk7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSBwb3NpdGlvbi4gIFRoaXMg aXMgdGhlIHJlY29tbWVuZGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgdmVydGljYWwgb2Zm c2V0IGluIHBpeGVscyBmcm9tIHRoZSBiYXNlbGluZSB0byB0aGUgdG9wIG9mCisgICAgICAgICAg ICAgICAgICAgICAgICAgdGhlIHVuZGVybGluZS4gIFRoaXMgaXMgYSBzaWduZWQgdmFsdWUgYWNj b3JkaW5nIHRvIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgIHNwZWNzLCBhbmQgaXRzIGRl ZmF1bHQgaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICBST1VORCAoKG1heGltdW0gZGVzY2Vu dCkgLyAyKSwgd2l0aAorICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EKHgpID0gZmxvb3Ig KHggKyAwLjUpICAqLworICAgICAgICAgICAgICAgICAgICAgIGlmICh4X3VzZV91bmRlcmxpbmVf cG9zaXRpb25fcHJvcGVydGllcworICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzLT5mb250 ICYmIHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAgICAgICAg ICAgICAgcG9zaXRpb24gPSBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAg ICAgICAgICAgICAgZWxzZSBpZiAocy0+Zm9udCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHBv c2l0aW9uID0gKHMtPmZvbnQtPmRlc2NlbnQgKyAxKSAvIDI7CisgICAgICAgICAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSB1bmRlcmxpbmVfbWlu aW11bV9vZmZzZXQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIHBv c2l0aW9uID0gbWF4IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgIC8qIENoZWNrIHRoZSBzYW5pdHkgb2YgdGhpY2tu ZXNzIGFuZCBwb3NpdGlvbi4gIFdlIHNob3VsZAorICAgICAgICAgICAgICAgICBhdm9pZCBkcmF3 aW5nIHVuZGVybGluZSBvdXQgb2YgdGhlIGN1cnJlbnQgbGluZSBhcmVhLiAgKi8KKyAgICAgICAg ICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPD0gcy0+eWJhc2UgKyBwb3NpdGlvbikKKyAgICAg ICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSAxKSAtIChzLT55YmFzZSAtIHMtPnkp OworICAgICAgICAgICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8IHMtPnliYXNlICsgcG9zaXRp b24gKyB0aGlja25lc3MpCisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gKHMtPnkgKyBzLT5o ZWlnaHQpIC0gKHMtPnliYXNlICsgcG9zaXRpb24pOworICAgICAgICAgICAgICBzLT51bmRlcmxp bmVfdGhpY2tuZXNzID0gdGhpY2tuZXNzOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9z aXRpb24gPSBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgeSA9IHMtPnliYXNlICsgcG9zaXRpb247 CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAg ICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAocy0+Ziwgcy0+Z2MsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHMtPngsIHksIHMtPndpZHRoLCB0aGlja25lc3MpOworICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgWEdDVmFs dWVzIHhnY3Y7CisgICAgICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKHMtPmRpc3BsYXksIHMt PmdjLCBHQ0ZvcmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3Jv dW5kIChzLT5kaXNwbGF5LCBzLT5nYywgcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yKTsKKyAgICAg ICAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHMtPngsIHksIHMtPndpZHRoLCB0aGlja25lc3MpOworICAg ICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCB4Z2N2LmZv cmVncm91bmQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQor ICAgICAgLyogRHJhdyBvdmVybGluZS4gICovCisgICAgICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVf cCkKKyAgeworICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAwLCBoID0gMTsKKyAgICBpZiAocy0+ZmFj ZS0+b3ZlcmxpbmVfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChz LT5mLCBzLT5nYywgcy0+eCwgcy0+eSArIGR5LAorICAgICAgICAgIHMtPndpZHRoLCBoKTsKKyAg ICBlbHNlCisgICAgICB7CisgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICBYR2V0R0NW YWx1ZXMgKHMtPmRpc3BsYXksIHMtPmdjLCBHQ0ZvcmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAg WFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCBz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cmVsaWVmIGlmIG5vdCB5ZXQgZHJhd24uICAqLworICAgICAgaWYgKCFyZWxpZWZfZHJh d25fcCAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisgIHhfZHJhd19nbHlwaF9zdHJp bmdfYm94IChzKTsKKyAgICAgIGlmIChzLT5wcmV2KQorICB7CisgICAgc3RydWN0IGdseXBoX3N0 cmluZyAqcHJldjsKKyAgICBmb3IgKHByZXYgPSBzLT5wcmV2OyBwcmV2OyBwcmV2ID0gcHJldi0+ cHJldikKKyAgICAgIGlmIChwcmV2LT5obCAhPSBzLT5obAorICAgICYmIHByZXYtPnggKyBwcmV2 LT53aWR0aCArIHByZXYtPnJpZ2h0X292ZXJoYW5nID4gcy0+eCkKKyAgICAgICAgeworICAgIC8q IEFzIHByZXYgd2FzIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8gaXRzIG93biBhcmVhLCB3ZQorICAg ICAgIG11c3QgZHJhdyB0aGUgcmlnaHRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICAq LworICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gcHJldi0+aGw7CisgICAgcHJldi0+ aGwgPSBzLT5obDsKKyAgICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHByZXYsIGN1cnNvcl9n Y19wKTsKKyAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgcHJldik7 CisgICAgaWYgKHByZXYtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICB4 X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgIGVsc2UKKyAgICAgIHhf ZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgIHhfcmVz ZXRfY2xpcF9yZWN0YW5nbGVzIChwcmV2LT5mLCBwcmV2LT5nYyk7CisgICAgc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PSAwOworICAgIG5leHQtPmNsaXBfaGVhZCA9IHMtPm5leHQ7CisgICAgICAgIH0KKyAgfQor ICAgIH0KKyAgLyogUmVzZXQgY2xpcHBpbmcuICAqLworICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xl cyAocy0+Ziwgcy0+Z2MpOworICBzLT5udW1fY2xpcHMgPSAwOworfQorCisvKiBlbmQgTVVMVElQ TEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogRGVmYXVsdCB0 byB1c2luZyBYSU0gaWYgYXZhaWxhYmxlLiAgKi8KICNpZmRlZiBVU0VfWElNCiBib29sIHVzZV94 aW0gPSB0cnVlOwpAQCAtOTk5LDYgKzE4NjIsMTUgQEAgeF91cGRhdGVfYmVnaW4gKHN0cnVjdCBm cmFtZSAqZikKICAgaWYgKEZSQU1FX1RPT0xUSVBfUCAoZikgJiYgIUZSQU1FX1ZJU0lCTEVfUCAo ZikpCiAgICAgcmV0dXJuOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gZjsKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogICBpZiAoISBGUkFNRV9DUl9TVVJGQUNFIChmKSkKICAgICB7 CiAgICAgICBpbnQgd2lkdGgsIGhlaWdodDsKQEAgLTEyNjYsNiArMjEzOCwxNiBAQCB4X3VwZGF0 ZV9lbmQgKHN0cnVjdCBmcmFtZSAqZikKICAgWEZsdXNoIChGUkFNRV9YX0RJU1BMQVkgKGYpKTsK ICAgdW5ibG9ja19pbnB1dCAoKTsKICNlbmRpZgorCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gTlVM TDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAvKiBUaGlzIGZ1bmN0aW9u IGlzIGNhbGxlZCBmcm9tIHZhcmlvdXMgcGxhY2VzIGluIHhkaXNwLmMKQEAgLTEzMTAwLDYgKzEz OTgyLDIxIEBAIHhfYWN0aXZhdGVfdGltZW91dF9hdGltZXIgKHZvaWQpCiAKIHN0YXRpYyBzdHJ1 Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSB4X3JlZGlzcGxheV9pbnRlcmZhY2UgPQogICB7CisKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGBy ZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgeHRlcm0uY2AgbXVzdCBiZSBpbiB0aGUgZXhhY3Qgc2Ft ZSBvcmRlciBhcyB0aGUKK2ByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4dGVybi5oYCEg Ki8KKworICBtY194X3dyaXRlX2dseXBocywKKyAgbWNfeF9kcmF3X3dpbmRvd19jdXJzb3IsCisg IG1jX3hfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK ICAgICB4X2ZyYW1lX3Bhcm1faGFuZGxlcnMsCiAgICAgeF9wcm9kdWNlX2dseXBocywKICAgICB4 X3dyaXRlX2dseXBocywK --Multipart_Thu_May__2_17:48:18_2019-1--