From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.bugs Subject: bug#17684: #22873 (multiple fake cursors); and, #17684 (crosshairs). Date: Mon, 08 Apr 2019 21:03:20 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Mon_Apr__8_21:03:20_2019-1" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="232523"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 17684@debbugs.gnu.org, 22873@debbugs.gnu.org To: eliz@gnu.org, mbork@mbork.pl, rms@gnu.org, johnw@gnu.org, akioburns@icloud.com, athird@googlemail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 09 06:04:24 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 1hDhzi-000utv-7a for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Apr 2019 06:04:23 +0200 Original-Received: from localhost ([127.0.0.1]:34683 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDhzh-00007U-0R for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Apr 2019 00:04:21 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDhzR-000072-Eb for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2019 00:04:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hDhzP-0004ez-IN for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2019 00:04:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36880) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hDhzO-0004eU-9s for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2019 00:04:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hDhzO-0007xu-29 for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2019 00:04: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: Tue, 09 Apr 2019 04:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17684 X-GNU-PR-Package: emacs Original-Received: via spool by 17684-submit@debbugs.gnu.org id=B17684.155478260830560 (code B ref 17684); Tue, 09 Apr 2019 04:04:01 +0000 Original-Received: (at 17684) by debbugs.gnu.org; 9 Apr 2019 04:03:28 +0000 Original-Received: from localhost ([127.0.0.1]:50425 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDhyq-0007wq-D8 for submit@debbugs.gnu.org; Tue, 09 Apr 2019 00:03:28 -0400 Original-Received: from gateway31.websitewelcome.com ([192.185.143.35]:12711) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDhyn-0007wh-Ti for 17684@debbugs.gnu.org; Tue, 09 Apr 2019 00:03:26 -0400 Original-Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway31.websitewelcome.com (Postfix) with ESMTP id 1C08A88646 for <17684@debbugs.gnu.org>; Mon, 8 Apr 2019 23:03:25 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id DhymhYd7QiQerDhymhIZCR; Mon, 08 Apr 2019 23:03:25 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Jnwwt/2GxyGacvQnqChiVGvAKViHZanh4qyJPZInpf8=; b=hG0qD0dbUVrRf/kyLAvTL0CBcw jSkd8NylHMGRnfxoTtaZqNjvLVThWLZxGfRQloU8ZkSSopULdSoeWvEeXU08Tjq2kObzka96UrJJF em7flypvyspvzabudY4PUESgv5b55lGxnXW3R3iCcc0idx658p1sQT91BYJan9xf0RJE97h4nKyyA y6e7YpX/WNNoJq7sXMy96b4Z7CokuFtInLQgSOhXsOum+MjUL28zBlcsi9qP8ugOB2Ez881uaTuPr R+2Hahgwp4Y1ebX087JpI7A3vXo7f7MU3yzQwY/98T4ybt0fwbB+UXURdhPZUnc+6o0Ag5OPD/U4f AOo2KS0w==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:54693 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from ) id 1hDhyj-0003Iy-7s; Mon, 08 Apr 2019 23:03:23 -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: 1hDhyj-0003Iy-7s X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:54693 X-Source-Auth: lawlist X-Email-Count: 1 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:157388 Archived-At: --Multipart_Mon_Apr__8_21:03:20_2019-1 Content-Type: text/plain; charset=US-ASCII This is version 018.000 of a proof concept for multiple fake cursors and crosshairs. Special thanks to Eli Z. and Alan T. for helping me out on numerous issues over the past few months -- greatly appreciated!!! VERSION: - 018.000 [04/08/2019] CHANGELOG: - Creation of fake cursors now immediately follows calls to `draw_glyphs'. - Removal of fake cursors occurs prior to Emacs scrolling the text on the glass directly and at the outset of `update_window'. - The NS port now automatically redraws fake cursors that got erased because they were left/right overwritten glyphs, but work still needs to be done on the w32 and X ports. The future plan of attack for the w32 and X ports is probably similar to the NS port; i.e., left/right overwritten glyphs have their strings tagged during `mc_draw_glyphs' and are dealt with on a per port basis when FRAME_RIF (f)->mc_scribe_string is called. - Semi-duplicate functions have been created so as to reduce the number of entry points into the core code base of Emacs. [This approach enables semi- worry free tinkering without the risk of breaking something important.] - Removal of scroll bars no longer erase fake cursors when windows are resized or deleted on the NS and w32 ports. [I didn't see any issues on an X11 build.] - Numerous bug fixes, some minor and some major. 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: - 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 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_Mon_Apr__8_21:03:20_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_04_08__18_56_23_226.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDc1NQppbmRleCAwMDAwMDAwLi5mYzVlY2VmOQotLS0gL2Rldi9udWxsCisr KyBiL2xpc3AvY3Jvc3NoYWlycy5lbApAQCAtMCwwICsxLDEyNDkgQEAKKzs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7OworOzs7IEJFR0lOIG1vZGlmaWNhdGlvbiBvZiB0aGUgTXVsdGlwbGUgQ3Vyc29y cyBsaWJyYXJ5IHdyaXR0ZW4gYnkgIE1hZ25hciBTdmVlbi4KKworKGRlZnZhciBwYWNrYWdlLWFy Y2hpdmVzKQorCisoZGVmdmFyIG1jLS1tYXgtY3Vyc29ycy1vcmlnaW5hbCkKKyhkZWZ2YXIgbWMv bWF4LWN1cnNvcnMpCisoZGVmdmFyIG1jLS1tYXgtY3Vyc29ycy1vcmlnaW5hbCkKKyhkZWZ2YXIg bWMvbWF4LWN1cnNvcnMpCisoZGVmdmFyIG1jL2Fsd2F5cy1ydW4tZm9yLWFsbCkKKyhkZWZ2YXIg bWMtLXRoaXMtY29tbWFuZCkKKyhkZWZ2YXIgbWMvY21kcy10by1ydW4tb25jZSkKKyhkZWZ2YXIg bWMtLWRlZmF1bHQtY21kcy10by1ydW4tZm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LW9yaWdpbmFsIG1jL21heC1jdXJzb3Jz KSkKKyAgICAod2hlbiBtYy9tYXgtY3Vyc29ycworICAgICAgKHVubGVzcyAoPCAobWMvbnVtLWN1 cnNvcnMpIG1jL21heC1jdXJzb3JzKQorICAgICAgICAoaWYgKHllcy1vci1uby1wIChmb3JtYXQg IiVkIGFjdGl2ZSBjdXJzb3JzLiBDb250aW51ZT8gIiAobWMvbnVtLWN1cnNvcnMpKSkKKyAgICAg ICAgICAgIChzZXRxIG1jL21heC1jdXJzb3JzIChyZWFkLW51bWJlciAiRW50ZXIgYSBuZXcsIHRl bXBvcmFyeSBtYXhpbXVtOiAiKSkKKyAgICAgICAgICAobWMvcmVtb3ZlLWZha2UtY3Vyc29ycykK KyAgICAgICAgICAoZXJyb3IgIkFib3J0ZWQ6IHRvbyBtYW55IGN1cnNvcnMiKSkpKQorICAgIChs ZXQgKChvdmVybGF5CisgICAgICAgICAgICAoaWYgbWMvdXNlLWJ1aWx0LWluLWN1cnNvcnMKKyAg ICAgICAgICAgICAgKG1ha2Utb3ZlcmxheSAocG9pbnQpIChwb2ludCkpCisgICAgICAgICAgICAg IChtYy9tYWtlLWN1cnNvci1vdmVybGF5LWF0LXBvaW50KSkpKQorICAgICAgKG92ZXJsYXktcHV0 IG92ZXJsYXkgJ21jLWlkIChvciBpZCAobWMvY3JlYXRlLWN1cnNvci1pZCkpKQorICAgICAgKG92 ZXJsYXktcHV0IG92ZXJsYXkgJ3R5cGUgJ2Zha2UtY3Vyc29yKQorICAgICAgKG92ZXJsYXktcHV0 IG92ZXJsYXkgJ3ByaW9yaXR5IDEwMCkKKyAgICAgIChtYy9zdG9yZS1jdXJyZW50LXN0YXRlLWlu LW92ZXJsYXkgb3ZlcmxheSkKKyAgICAgICh3aGVuICh1c2UtcmVnaW9uLXApCisgICAgICAgIChv dmVybGF5LXB1dCBvdmVybGF5ICdyZWdpb24tb3ZlcmxheQorICAgICAgICAgICAgICAgICAgICAg KG1jL21ha2UtcmVnaW9uL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gICAgICAgICAgICAgICAgICAgIChjb21tYW5k LXJlbWFwcGluZyB0aGlzLW9yaWdpbmFsLWNvbW1hbmQpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHRoaXMtb3JpZ2luYWwtY29tbWFuZCkpKQorICAgICAgICAgICAgOzsg c2tpcCBrZXlib2FyZCBtYWNyb3MsIHNpbmNlIHRoZXkgd2lsbCBnZW5lcmF0ZSBhY3R1YWwgY29t bWFuZHMgdGhhdCBhcmUKKyAgICAgICAgICAgIDs7IGFsc28gcnVuIGluIHRoZSBjb21tYW5kIGxv b3AgLSB3ZSdsbCBoYW5kbGUgdGhvc2UgbGF0ZXIgaW5zdGVhZC4KKyAgICAgICAgICAgICh3aGVu IChmdW5jdGlvbnAgb3JpZ2luYWwtY29tbWFuZCkKKyAgICAgICAgICAgICAgOzsgaWYgaXQncyBh IGxhbWJkYSwgd2UgY2FuJ3Qga25vdyBpZiBpdCdzIHN1cHBvcnRlZCBvciBub3QKKyAgICAgICAg ICAgICAgOzsgLSBzbyBnbyBhaGVhZCBhbmQgYXNzdW1lIGl0J3Mgb2ssIGJlY2F1c2Ugd2UncmUg anVzdCBvcHRpbWlzdGljIGxpa2UgdGhhdAorICAgICAgICAgICAgICAoaWYgKG9yIChub3QgKHN5 bWJvbHAgb3JpZ2luYWwtY29tbWFuZCkpCisgICAgICAgICAgICAgICAgICAgICAgOzsgbGFtYmRh IHJlZ2lzdGVyZWQgYnkgc21hcnRyZXAKKyAgICAgICAgICAgICAgICAgICAgICAoc3RyaW5nLXBy ZWZpeC1wICIoIiAoc3ltYm9sLW5hbWUgb3JpZ2luYWwtY29tbWFuZCkpKQorICAgICAgICAgICAg ICAgICAgKG1jL2V4ZWN1dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29ycyBvcmlnaW5hbC1j b21tYW5kKQorICAgICAgICAgICAgICAgIDs7IHNtYXJ0cmVwIGBpbnRlcm4ncyBjb21tYW5kcyBp bnRvIG93biBvYmFycmF5IHRvIGhlbHAKKyAgICAgICAgICAgICAgICA7OyBgZGVzY3JpYmUtYmlu ZGluZ3MnLiAgU28sIGxldCdzIHJlLWBpbnRlcm4nIGhlcmUgdG8KKyAgICAgICAgICAgICAgICA7 OyBtYWtlIHRoZSBjb21tYW5kIGNvbXBhcmFibGUgYnkgYGVxJy4KKyAgICAgICAgICAgICAgICAo c2V0cSBvcmlnaW5hbC1jb21tYW5kIChpbnRlcm4gKHN5bWJvbC1uYW1lIG9yaWdpbmFsLWNvbW1h bmQpKSkKKyAgICAgICAgICAgICAgICA7OyBvdGhlcndpc2UgaXQncyBhIHN5bWJvbCwgYW5kIHdl IGNhbiBiZSBtb3JlIHRob3JvdWdoCisgICAgICAgICAgICAgICAgKGlmIChnZXQgb3JpZ2luYWwt Y29tbWFuZCAnbWMtLXVuc3VwcG9ydGVkKQorICAgICAgICAgICAgICAgICAgICAobWVzc2FnZSAi JVMgaXMgbm90IHN1cHBvcnRlZCB3aXRoIG11bHRpcGxlIGN1cnNvcnMlcyIKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgb3JpZ2luYWwtY29tbWFuZAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoZ2V0IG9yaWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1cHBvcnRlZCkpCisgICAgICAg ICAgICAgICAgICAod2hlbiAoYW5kIG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMt dG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobm90IChtZW1xIG9y aWdpbmFsLWNvbW1hbmQgbWMvY21kcy10by1ydW4tb25jZSkpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIChvciBtYy9hbHdheXMtcnVuLWZvci1hbGwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIChtZW1xIG9yaWdpbmFsLWNvbW1hbmQgbWMtLWRlZmF1bHQtY21kcy10by1y dW4tZm9yLWFsbCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtZW1xIG9yaWdp bmFsLWNvbW1hbmQgbWMvY21kcy10by1ydW4tZm9yLWFsbCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIChtYy9wcm9tcHQtZm9yLWluY2x1c2lvbi1pbi13aGl0ZWxpc3Qgb3JpZ2lu YWwtY29tbWFuZCkpKQorICAgICAgICAgICAgICAgICAgICAobWMvZXhlY3V0ZS1jb21tYW5kLWZv ci1hbGwtZmFrZS1jdXJzb3JzIG9yaWdpbmFsLWNvbW1hbmQpKSkpCisgICAgICAgICAgICAgICh3 aGVuIG1jL3VzZS1idWlsdC1pbi1jdXJzb3JzCisgICAgICAgICAgICAgICAgKHNldHEgbWMtY29u ZgorICAgICAgICAgICAgICAgICAgICAgICAgKG1hcGNhcgorICAgICAgICAgICAgICAgICAgICAg ICAgICAobGFtYmRhICh4KSAobGlzdCAob3ZlcmxheS1zdGFydCB4KSAiYmFyIiBuaWwpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAobWMvYWxsLWZha2UtY3Vyc29ycykpKSkpKSkpKSkKKwor ICAoZGVmdW4gbWMvbWFyay1uZXh0LWxpa2UtdGhpcy1jeWNsZS1mb3J3YXJkICgpCisgICJNYXJr cyBuZXh0IG9jY3VyZW5jZSBvZiB3b3JkIGxpa2UgdGhpcyBhbmQgYWR2YW5jZXMgY3Vyc29yIHRv IHRoaXMgb2NjdXJyZW5jZSIKKyAgKGludGVyYWN0aXZlKQorICAgIChtYy9tYXJrLW5leHQtbGlr ZS10aGlzIDEpKQorCisgIChkZWZ1biBtYy9tYXJrLXByZXZpb3VzLWxpa2UtdGhpcy1jeWNsZS1m b3J3YXJkICgpCisgICJNYXJrcyBuZXh0IG9jY3VycmVuY2Ugb2Ygd29yZCBsaWtlIHRoaXMgYW5k IGFkd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CcsIHdoaWNoIHVzZXMgMTYt Yml0IFJHQiAtLSB0aGUgY29udmVyc2lvbiBmcm9tIExTTAoraGFwcGVucyBpbnRlcm5hbGx5IGJ5 IG11bHRpcGx5aW5nIGVhY2ggZWxlbWVudCBvZiB0aGUgTFNMIGNvbG9yIHZlY3RvciBieSA2NTUz NS4iCisoaW50ZXJhY3RpdmUpCisgIChsZXQgKChidWZmZXIgKGdldC1idWZmZXItY3JlYXRlICIq TUMtVEVTVCoiKSkpCisgICAgKHdpdGgtY3VycmVudC1idWZmZXIgYnVmZmVyCisgICAgICAoZXJh c2UtYnVmZmVyKQorICAgICAgKGluc2VydCAiVGhpcyBpcyBhIHRlc3QhIikKKyAgICAgIChzZXRx IG1jLWNvbmYgJygoMSAiaGJhciIgIm1hZ2VudGEiKQorICAgICAgICAgICAgICAgICAgICAgICgy ICJiYXIiICJwdXJwbGUiKQorICAgICAgICAgICAgICAgICAgICAgICgzICJib3giICIjMDBGRjAw IikKKyAgICAgICAgICAgICAgICAgICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAg ICAgICAgICAgICAgICAgKDUgKCJoYmFyIiAzKSBbMS4wIDAuMCAxLjBdKQorICAgICAgICAgICAg ICAgICAgICAgICg2ICgiYmFyIiAzKSBbMC4wIDEuMCAxLjBdKQorICAgICAgICAgICAgICAgICAg ICAgICg3ICJmcmFtZWQiICJPcmFuZ2VSZWQiKSkpKQorICAgIChzZWxlY3Qtd2luZG93IChkaXNw bGF5LWJ1ZmZlciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2luY2UgdGhp cyBmaXJlcyBnbG9iYWxseSwgd2UgbXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jvc3NoYWly cyBhcHBlYXIgaW4uIgorICAod2hlbiArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVtcSBsYXN0 LWNvbW1hbmQgKy1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVsbCArLXBh cmVucy1wKSkKKyAgICAgICgrLXBhcmVucy1mbikpCisgICAgKHdoZW4gKy10aW1lci12YXIKKyAg ICAgIChzZXRxIHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1pZGxlLWxp c3QpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkpKQorCisoZGVmdW4gKy1kcmF3LWZv cnRod2l0aCAoKQorICAiRm9yY2UgYm90aCBydWxlcnMgdG8gYmUgZHJhd24vcmVkcmF3bi4iCisg ICgrLWRyYXctY3Jvc3NoYWlycyAnZm9yY2UpKQorCisoZGVmdW4gKy1kcmF3LWNyb3NzaGFpcnMg KCZvcHRpb25hbCBmb3JjZSkKKyAgKHdoZW4gKy1tb2RlCisgICAgKHdoZW4gKy10aW1lci12YXIK KyAgICAgIChzZXRxIHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1pZGxl LWxpc3QpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkKKyAgICAodW5sZXNzIChvciAo bWVtcSB0aGlzLWNvbW1hbmQgKy1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAo YW5kIChudWxsICstcGFyZW5zLXApCisgICAgICAgICAgICAgICAgICAgICAobnVsbCArLXBhcmVu cy1vdmVybGF5cy1leGlzdC1wKSkpCisgICAgICAoKy1kZWxldGUtcGFyZW5zLW92ZXJsYXlzKSkK KyAgICAoaWYgZm9yY2UKKyAgICAgIChwcm9nbgorICAgICAgICAod2hlbiArLXBhcmVucy1wCisg ICAgICAgICAgKCstcGFyZW5zLWZuKSkpCisgICAgICAoc2V0cSArLXRpbWVyLXZhciAocnVuLXdp dGgtaWRsZS10aW1lciArLWlkbGUtdGltZXItc2Vjb25kcyBuaWwgIycrLXRpbWVyLWZuKSkpKSkK KworKGRlZnZhciBmYy1tb2RlKQorCis7OzsjIyNhdXRvbG9hZAorKGRlZmluZS1taW5vci1tb2Rl ICstbW9kZQorIk1pbm9yIG1vZGUgZm9yIGRpc3BsYXlpbmcgYSBob3Jpem9udGFsIHJ1bGVyLiIK KyAgOmluaXQtdmFsdWUgbmlsCisgIDpsaWdodGVyICIgKyIKKyAgOmtleW1hcCBuaWwKKyAgOmds b2JhbCBuaWwKKyAgOmdyb3VwICcrLW1vZGUKKyAgKGNvbmQKKyAgICAoKy1tb2RlCisgICAgICA7 OzsgYCstbW9kZScgaGFzIHRoZSBhYmlsaXR5IHRvIGFsc28gZGlzcGxheSBhIGZpbGwgY29sdW1u IGluZGljYXRvci4KKyAgICAgIDs7OyBTZWUgdGhlIHZhcmlhYmxlIGArLWZpbGwtY29sdW1uJy4K KyAgICAgICh3aGVuIGZjLW1vZGUKKyAgICAgICAgKGZjLW1vZGUgLTEpKQorICAgICAgKHdoZW4g KGFuZCBnbG9iYWwtZWxkb2MtbW9kZQorICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0 aXZlbHktcCAnYW55KQorICAgICAgICAgICAgICAgICAob3IgKGVxdWFsIGN1cnJlbnQtcHJlZml4 LWFyZyAnKDQpKQorICAgICAgICAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFy ZyAnKDE2KSkpKQorICAgICAgICAoZ2xvYmFsLWVsZG9jLW1vZGUgLTEpKQorICAgICAgKHdoZW4g KGFuZCBqaXQtbG9jay1jb250ZXh0LXRpbWVyCisgICAgICAgICAgICAgICAgIChjYWxsZWQtaW50 ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChvciAoZXF1YWwgY3VycmVudC1w cmVmaXgtYXJnICcoNCkpCisgICAgICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVm aXgtYXJnICcoMTYpKSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgaml0LWxvY2stY29udGV4dC10 aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVyIGppdC1sb2NrLWNvbnRleHQtdGltZXIpKQor ICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIChydW4td2l0aC1pZGxlLXRp bWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250ZXh0LWZvbnRpZnkpKQorICAgICAgICAoc2V0 cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkpCisgICAgICAod2hlbiAoYW5kIChjYWxsZWQt aW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChvciAoZXF1YWwgY3VycmVu dC1wcmVmaXgtYXJnICcoNCkpCisgICAgICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1w cmVmaXgtYXJnICcoMTYpKSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgdW5kby1hdXRvLWN1cnJl bnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciB1bmRvLWF1dG8tY3Vy cmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChmc2V0ICd1bmRvLWF1dG8tLXVuZG9hYmxl LWNoYW5nZQorICAgICAgICAgICAgICAobGFtYmRhICgpIChhZGQtdG8tbGlzdCAndW5kby1hdXRv LS11bmRvYWJseS1jaGFuZ2VkLWJ1ZmZlcnMgKGN1cnJlbnQtYnVmZmVyKSkpKQorICAgICAgICAo ZnNldCAndW5kby1hdXRvLWFtYWxnYW1hdGUgJ2lnbm9yZSkpCisgICAgICAod2hlbiBibGluay1j dXJzb3ItbW9kZQorICAgICAgICAoYmxpbmstY3Vyc29yLW1vZGUgLTEpCisgICAgICAgICh3aGVu IChtZW1xICdibGluay1jdXJzb3ItY2hlY2sgcG9zdC1jb21tYW5kLWhvb2spCisgICAgICAgICAg KHJlbW92ZS1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAnYmxpbmstY3Vyc29yLWNoZWNrKSkpCisg ICAgICAoc2V0cSBjcm9zc2hhaXJzIHQpCisgICAgICAod2hlbiAr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XItZGlzcGxheS10YWJsZQorICAgICAgICAgICAgICAgICAgICAgZnJpbmdlLWluZGljYXRv ci1hbGlzdAorICAgICAgICAgICAgICAgICAgICAgdGFiLXdpZHRoCisgICAgICAgICAgICAgICAg ICAgICBsaW5lLW1vdmUtdmlzdWFsCisgICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZS1saW5l cworICAgICAgICAgICAgICAgICAgICAgdHJ1bmNhdGUtcGFydGlhbC13aWR0aC13aW5kb3dzCisg ICAgICAgICAgICAgICAgICAgICB3b3JkLXdyYXApKQorICAgICAgICAod2hlbiAobG9jYWwtdmFy aWFibGUtcCB2YXIpCisgICAgICAgICAgKHB1c2ggKGNvbnMgdmFyIChzeW1ib2wtdmFsdWUgdmFy KSkgKy0tc2F2ZWQtc3RhdGUpKSkKKyAgICAgIChzZXRxIGZpbGwtY29sdW1uIDgwKQorICAgICAg KHNldHEgZGlzcGxheS1saW5lLW51bWJlcnMgdCkKKyAgICAgIChzZXRxLWxvY2FsIGF1dG8taHNj cm9sbC1tb2RlICdjdXJyZW50LWxpbmUpCisgICAgICAoc2V0cS1sb2NhbCBoc2Nyb2xsLXN0ZXAg NSkKKyAgICAgIChzZXRxIGJ1ZmZlci1kaXNwbGF5LXRhYmxlICstYnVmZmVyLWRpc3BsYXktdGFi bGUpCisgICAgICAoc2V0cSB0YWItd2lkdGggNCkKKyAgICAgIChzZXQgKG1ha2UtbG9jYWwtdmFy aWFibGUgJ2xpbmUtbW92ZS12aXN1YWwpIHQpCisgICAgICAoc2V0cSB0cnVuY2F0ZS1saW5lcwor ICAgICAgICAoY29uZAorICAgICAgICAgICgobGV0ICgobHN0ICstdHJ1bmNhdGUtbGluZXMtZGVy aXZlZC1tb2RlcykKKyAgICAgICAgICAgICAgICAgIG1vZGUpCisgICAgICAgICAgICAoY2F0Y2gg J2ZvdW5kCisgICAgICAgICAgICAgICh3aGlsZSAoc2V0cSBtb2RlIChwb3AgbHN0KSkKKyAgICAg ICAgICAgICAgICAod2hlbiAoZGVyaXZlZC1tb2RlLXAgbW9kZSkKKyAgICAgICAgICAgICAgICAg ICh0aHJvdyAnZm91bmQgdCkpKSkpKQorICAgICAgICAgICAoKG1lbXEgbWFqb3ItbW9kZSArLXRy dW5jYXRlLWxpbmVzLW1ham9yLW1vZGVzKSkKKyAgICAgICAgICAgKHQKKyAgICAgICAgICAgICBu aWwpKSkKKyAgICAgIChzZXQgKG1ha2UtbG9jYWwtdmFyaWFibGUgJ3RydW5jYXRlLXBhcnRpYWwt d2lkdGgtd2luZG93cykgbmlsKQorICAgICAgKHNldHEgd29yZC13cmFwIHQpCisgICAgICAoc2V0 cSBpbmRpY2F0ZS1lbXB0eS1saW5lcyB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtYnVmZmVyLWJv dW5kYXJpZXMgJ2xlZnQpCisgICAgICAoc2V0cSBmcmluZ2UtaW5kaWNhdG9yLWFsaXN0CisgICAg ICAgICAgOzs7IGhzY2xfYWxsX3RlbXBfcCB8IGhzY2xfdGVtcF9wCisgICAgICAgICcoKCstaHNj bC10ZW1wIC4gKCstc2luZ2xlLWFuZ2xlLWxlZnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAg Ky1kb3VibGUtYW5nbGUtbGVmdCkpCisgICAgICAgICAgOzs7IGhzY2xfYWxsX3Blcm1fMF9wIHwg aHNjbF9hbGxfcGVybV8xX3AgfCBoc2NsX2FsbF9wZXJtXzJfcCB8IGhzY2xfcGVybV9wCisgICAg ICAgICAgKCstaHNjbC1wZXJtIC4gKCstc2luZ2xlLWFuZ2xlLXVwCisgICAgICAgICAgICAgICAg ICAgICAgICAgICstZG91YmxlLWFuZ2xlLXVwCisgICAgICAgICAgICAgICAgICAgICAgICAgICst dHJpcGxlLWFuZ2xlLXVwCisgICAgICAgICAgICAgICAgICAgICAgICAgICstcXVhZHJ1cGxlLWFu Z2xlLXVwKSkKKyAgICAgICAgICAoKy1vdmVybGF5LWFycm93IC4gKCstZnJpbmdlLWxlZnQtYXJy b3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJpZ2h0LWFycm93KSkK KyAgICAgICAgICAodHJ1bmNhdGlvbiAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAg ICAgICAgICAgICAgICAgKy1mcmluZ2UtcmlnaHQtYXJyb3cpKQorICAgICAgICAgIChjb250aW51 YXRpb24gLiAoKy1mcmluZ2UtbGVmdC1jdXJseS1hcnJvdworICAgICAgICAgICAgICAgICAgICAg ICAgICAgKy1iYWNrc2xhc2gpKQorICAgICAgICAgIChvdmVybGF5LWFycm93IC4gKy1mcmluZ2Ut cmlnaHQtdHJpYW5nbGUpCisgICAgICAgICAgKHVwIC4gKy1mcmluZ2UtdXAtYXJyb3cpCisgICAg ICAgICAgKGRvd24gLiArLWZyaW5nZS1kb3duLWFycm93KQorICAgICAgICAgICh0b3AgLiArLWZy aW5nZS10b3AtbGVmdC1hbmdsZSkKKyAgICAgICAgICAoYm90dG9tIC4gKy1mcmluZ2UtYm90dG9t LXJpZ2h0LWFuZ2xlKQorICAgICAgICAgICh0b3AtYm90dG9tIC4gKCstZnJpbmdlLWxlZnQtYnJh Y2tldAorICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJpZ2h0LWJyYWNrZXQKKyAg ICAgICAgICAgICAgICAgICAgICAgICArLWZyaW5nZS10b3AtcmlnaHQtYW5nbGUKKyAgICAgICAg ICAgICAgICAgICAgICAgICArLWZyaW5nZS10b3AtbGVmdC1hbmdsZSkpCisgICAgICAgICAgKGVt cHR5LWxpbmUgLiArLWZyaW5nZS1lbXB0eS1saW5lKQorICAgICAgICAgICh1bmtub3duIC4gKy1m cmluZ2UtcXVlc3Rpb24tbWFyaykpKQorICAgICAgKHNldHEgZnJpbmdlLWN1cnNvci1hbGlzdCAn KChib3ggLiArLWZyaW5nZS1sZWZ0LXRyaWFuZ2xlKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIChob2xsb3cgLiArLWhvbGxvdy1yZWN0YW5nbGUpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgKGJhciAuICstdmVydGljYWwtYmFyKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIChoYmFyIC4gKy1mcmluZ2UtaG9yaXpvbnRhbC1iYXIpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGhvbGxvdy1zbWFsbCAuICstZnJpbmdlLWhv bGxvdy1zcXVhcmUpKSkKKyAgICAgIChpZiArLWZvcnRod2l0aAorICAgICAgICAoYWRkLWhvb2sg J3Bvc3QtY29tbWFuZC1ob29rICcrLWRyYXctZm9ydGh3aXRoICdhcHBlbmQgJ2xvY2FsKQorICAg ICAgICAoYWRkLWhvb2sgJ3Bvc3QtY29tbWFuZC1ob29rICcrLWRyYXctY3Jvc3NoYWlycyAnYXBw ZW5kICdsb2NhbCkpCisgICAgICAod2hlbiArLWZvcnRod2l0aAorICAgICAgICAoYWRkLWhvb2sg J3dpbmRvdy1jb25maWd1cmF0aW9uLWNoYW5nZS1ob29rICcrLWRyYXctZm9ydGh3aXRoIG5pbCAn bG9jYWwpKQorICAgICAgKGFkZC1ob29rICdjaGFuZ2UtbWFqb3ItbW9kZS1ob29rICd0dXJuLW9m Zi0rLW1vZGUgbmlsICdsb2NhbCkKKyAgICAgICh3aGVuIChjYWxsZWQtaW50ZXJhY3RpdmVseS1w ICdhbnkpCisgICAgICAgIChjb25kCisgICAgICAgICAgKChlcXVhbCBjdXJyZW50LXByZWZpeC1h cmcgJyg0KSkKKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScgLS0gZGVi dWdnaW5nIG1vZGUgV0lUSCBpZGxlLXRpbWVyLiIpKQorICAgICAgICAgICgoZXF1YWwgY3VycmVu dC1wcmVmaXgtYXJnICcoMTYpKQorICAgICAgICAgICAgKG1lc3NhZ2UgIlR1cm5lZCBPTiBgKy1t b2RlJyAtLSBkZWJ1Z2dpbmcgbW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ob2NoYXIgKGNo YXItYWZ0ZXIgb3BvaW50KSkKKyAgICAgICAgIChwb3MxCisgICAgICAgICAgIChjb25kCisgICAg ICAgICAgICAgKChhbmQgb2NoYXIKKyAgICAgICAgICAgICAgICAgICAob3IgOzs7IChjaGFyLXRv LXN0cmluZyA0MCkgPT4gb3BlbmluZyBwYXJlbnRoZXNpcworICAgICAgICAgICAgICAgICAgICAg ICAoPSBvY2hhciA0MCkKKyAgICAgICAgICAgICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmlu ZyA5MSkgPT4gb3BlbmluZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAo PSBvY2hhciA5MSkKKyAgICAgICAgICAgICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyAx MjMpID0+IG9wZW5pbmcgd2F2eSBicmFja2V0CisgICAgICAgICAgICAgICAgICAgICAgICg9IG9j aGFyIDEyMykpKQorICAgICAgICAgICAgICAgIChtaW4gKDErIG9wb2ludCkgKHBvaW50LW1heCkp KQorICAgICAgICAgICAgICgob3IgOzs7IChjaGFyLXRvLXN0cmluZyA0MSkgPT4gY2xvc2luZyBw YXJlbnRoZXNpcworICAgICAgICAgICAgICAgICAgKD0gcHJlY2VkaW5nLWNoYXIgNDEpCisgICAg ICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDkzKSA9PiBjbG9zaW5nIHNxdWFyZSBi cmFja2V0CisgICAgICAgICAgICAgICAgICAoPSBwcmVjZWRpbmctY2hhciA5MykKKyAgICAgICAg ICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgMTI1KSA9PiBjbG9zaW5nIHdhdnkgYnJhY2tl dAorICAgICAgICAgICAgICAgICAgKD0gcHJlY2VkaW5nLWNoYXIgMTI1KSkKKyAgICAgICAgICAg ICAgICAobWF4IChwb2ludC1taW4pICgxLSBvcG9pbnQpKSkKKyAgICAgICAgICAgICAodAorICAg ICAgICAgICAgICAgIG9wb2ludCkpKQorICAgICAgICAgcG9zMgorICAgICAgICAgc2VsZWN0ZWQt ZmFjZSkKKyAgICAoc2F2ZS1leGN1cnNpb24KKyAgICAgIChjb25kaXRpb24tY2FzZSBuaWwKKyAg ICAgICAgKHdoaWxlIChzZXRxIHBvczEgKG50aCAxIChwYXJzZS1wYXJ0aWFsLXNleHAgZnJvbSBw b3MxKSkpCisgICAgICAgICAgKHNldHEgcG9zMiAoc2Nhbi1zZXhwcyBwb3MxIDEpKQorICAgICAg ICAgIChpZiAoPSBpIDEwKQorICAgICAgICAgICAgKHNldHEgaSAxKQorICAgICAgICAgICAgKHNl dHEgaSAoMSsgaSkpKQorICAgICAgICAgIChzZXRxIHNlbGVjdGVkLWZhY2UgKGNvbmQKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgMSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAnKy1wYXJlbnMtb25lLWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICgoPSBpIDIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJyst cGFyZW5zLXR3by1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAz KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10aHJlZS1mYWNl KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA0KQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1mb3VyLWZhY2UpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICgoPSBpIDUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJystcGFyZW5zLWZpdmUtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgKCg9IGkgNikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMt c2l4LWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDcpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXNldmVuLWZhY2UpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDgpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJystcGFyZW5zLWVpZ2h0LWZhY2UpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICgoPSBpIDkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JystcGFyZW5zLW5pbmUtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9 IGkgMTApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXRlbi1m YWNlKSkpCisgICAgICAgICAgKGxldCAoKG92IChtYWtlLW92ZXJsYXkgcG9zMSAoMSsgcG9zMSkp KSkKKyAgICAgICAgICAgICh1bmxlc3MgKy1wYXJlbnMtaW5hY3RpdmUtd2luZG93cworICAgICAg ICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ3dpbmRvdyB3aW4pKQorICAgICAgICAgICAgKG92ZXJs YXktcHV0IG92ICdmYWNlIHNlbGVjdGVkLWZhY2UpKQorICAgICAgICAgICh3aGVuIHBvczIKKyAg ICAgICAgICAgIChsZXQgKChvdiAobWFrZS1vdmVybGF5ICgxLSBwb3MyKSBwb3MyKSkpCisgICAg ICAgICAgICAgICh1bmxlc3MgKy1wYXJlbnMtaW5hY3RpdmUtd2luZG93cworICAgICAgICAgICAg ICAgIChvdmVybGF5LXB1dCBvdiAnd2luZG93IHdpbikpCisgICAgICAgICAgICAgIChvdmVybGF5 LXB1dCBvdiAnZmFjZSBzZWxlY3RlZC1mYWNlKSkpKQorICAgICAgICAoZXJyb3IgbmlsKSkpCisg ICAgKHNldHEgKy1wYXJlbnMtb3ZlcmxheXMtZXhpc3QtcCB0KSkpCisKKyhkZWZ1biArLXJlbW92 ZS1vdmVybGF5cyAoYmVnIGVuZCBuYW1lIHZhbCkKKyJSZW1vdmUgdGhlIG92ZXJsYXlzIHRoYXQg YXJlIGBlcXVhbC1pbmNsdWRpbmctcHJvcGVydGllc2AuCitJbmNsdWRlcyBhIHVuaXF1ZSBzaXR1 YXRpb24gd2hlbiBhbiBvdmVybGF5IHdpdGggYW4gYCdhZnRlci1zdHJpbmdgIHByb3BlcnR5Citp cyBhdCB0aGUgdmVyeSBlbmQgb2YgYSBuYXJyb3dlZC1idWZmZXIuIgorICAobGV0KiAoKHBvaW50 LW1heCAocG9pbnQtbWF4KSkKKyAgICAgICAgIChwb2ludC1taW4gKHBvaW50LW1pbikpCisgICAg ICAgICAobmFycm93ZWQtcCAoYnVmZmVyLW5hcnJvd2VkLXApKQorICAgICAgICAgKGJlZyAoaWYg YmVnIGJlZyBwb2ludC1taW4pKQorICAgICAgICAgKGVuZAorICAgICAgICAgICAoY29uZAorICAg ICAgICAgICAgICgoYW5kCisgICAgICAgICAgICAgICAgIChub3QgbmFycm93ZWQtcCkKKyAgICAg ICAgICAgICAgICAgZW5kKQorICAgICAgICAgICAgICAgZW5kKQorICAgICAgICAgICAgICgoYW5k CisgICAgICAgICAgICAgICAgIChub3QgbmFycm93ZWQtcCkKKyAgICAgICAgICAgICAgICAgKG51 bGwgZW5kKSkKKyAgICAgICAgICAgICAgIHBvaW50LW1heCkKKyAgICAgICAgICAgICAoKGFuZAor ICAgICAgICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAgICAgIGVuZAorICAgICAg ICAgICAgICAgICAoPCBlbmQgcG9pbnQtbWF4KSkKKyAgICAgICAgICAgICAgIGVuZCkKKyAgICAg ICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAg ICAgIGVuZAorICAgICAgICAgICAgICAgICAoPSBlbmQgcG9pbnQtbWF4KSkKKyAgICAgICAgICAg ICAgICgxKyBlbmQpKQorICAgICAgICAgICAgICgoYW5kCisgICAgICAgICAgICAgICAgIG5hcnJv d2VkLXAKKyAgICAgICAgICAgICAgICAgKG51bGwgZW5kKSkKKyAgICAgICAgICAgICAgICgxKyBw b2ludC1tYXgpKSApKQorICAgICAgICAgKG92ZXJsYXlzCisgICAgICAgICAgIChwcm9nbgorICAg ICAgICAgICAgIChvdmVybGF5LXJlY2VudGVyIGVuZCkKKyAgICAgICAgICAgICAob3ZlcmxheXMt aW4gYmVnIGVuZCkpKSkKKyAgICAod2hlbiAoYW5kIGJlZyBlbmQgbmFtZSB2YWwpCisgICAgICAo ZG9saXN0IChvIG92ZXJsYXlzKQorICAgICAgICAoY29uZAorICAgICAgICAgICgoYW5kIChlcSBu YW1lICdmYWNlKQorICAgICAgICAgICAgICAgIChlcSAob3ZlcmxheS1nZXQgbyBuYW1lKSB2YWwp KQorICAgICAgICAgICAgOzsgRWl0aGVyIHB1c2ggdGhpcyBvdmVybGF5IG91dHNpZGUgYmVnLi4u ZW5kCisgICAgICAgICAgICA7OyBvciBzcGxpdCBpdCB0byBleGNsdWRlIGJlZy4uLmVuZAorICAg ICAgICAgICAgOzsgb3IgZGVsZXRlIGl0IGVudGlyZWx5IChpZiBpdCBpcyBjb250YWluZWQgaW4g YmVnLi4uZW5kKS4KKyAgICAgICAgICAgIChpZiAoPCAob3ZlcmxheS1zdGFydCBvKSBiZWcpCisg ICAgICAgICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBvKSBlbmQpCisgICAgICAgICAgICAg IChwcm9nbgorICAgICAgICAgICAgICAgIChtb3ZlLW92ZXJsYXkgKGNvcHktb3ZlcmxheSBvKQor ICAgICAgICAgICAgICAgICAgKG92ZXJsYXktc3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAg IChtb3ZlLW92ZXJsYXkgbyBlbmQgKG92ZXJsYXktZW5kIG8pKSkKKyAgICAgICAgICAgICAgICAg IChtb3ZlLW92ZXJsYXkgbyAob3ZlcmxheS1zdGFydCBvKSBiZWcpKQorICAgICAgICAgICAgICAo aWYgKD4gKG92ZXJsYXktZW5kIG8pIGVuZCkKKyAgICAgICAgICAgICAgICAgIChtb3ZlLW92ZXJs YXkgbyBlbmQgKG92ZXJsYXktZW5kIG8pKQorICAgICAgICAgICAgICAgIChkZWxldGUtb3Zlcmxh eSBvKSkpKQorICAgICAgICAgICgoYW5kIChub3QgKGVxIG5hbWUgJ2ZhY2UpKQorICAgICAgICAg ICAgICAgIChlcXVhbC1pbmNsdWRpbmctcHJvcGVydGllcyAob3ZlcmxheS1nZXQgbyBuYW1lKSB2 YWwpKQorICAgICAgICAgICAgKGRlbGV0ZS1vdmVybGF5IG8pKSkpKSkpCisKKyhkZWZ1biArLWRl bGV0ZS1wYXJlbnMtb3ZlcmxheXMgKCkKKyAgKHdoZW4gKy1wYXJlbnMtb3ZlcmxheXMtZXhpc3Qt cAorICAgIChkb2xpc3QgKGZhY2UgJygrLXBhcmVucy1vbmUtZmFjZQorICAgICAgICAgICAgICAg ICAgICArLXBhcmVucy10d28tZmFjZQorICAgICAgICAgICAgICAgICAgICArLXBhcmVucy10aHJl ZS1mYWNlCisgICAgICAgICAgICAgICAgICAgICstcGFyZW5zLWZvdXItZmFjZQorICAgICAgICAg ICAgICAgICAgICArLXBhcmVucy1maXZlLWZhY2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJl bnMtc2l4LWZhY2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtc2V2ZW4tZmFjZQorICAg ICAgICAgICAgICAgICAgICArLXBhcmVucy1laWdodC1mYWNlCisgICAgICAgICAgICAgICAgICAg ICstcGFyZW5zLW5pbmUtZmFjZQorICAgICAgICAgICAgICAgICAgICArLXBhcmVucy10ZW4tZmFj ZSkpCisgICAgICAoKy1yZW1vdmUtb3ZlcmxheXMgbmlsIG5pbCAnZmFjZSBmYWNlKSkKKyAgICAo c2V0cSArLXBhcmVucy1vdmVybGF5cy1leGlzdC1wIG5pbCkpKQorCis7Ozs7Ozs7Ozs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iIKKyIuLi54eC4uLiIKKyIuLi54eC4uLiIKKyIuLi54 eC4uLiIKKyJ4eHh4eHh4eCIKKyIueHh4eHh4LiIKKyIuLnh4eHguLiIKKyIuLi54eC4uLiIpIG5p bCBuaWwgJ2JvdHRvbSkKKworKGRlZmluZS1mcmluZ2UtYml0bWFwICcrLWZyaW5nZS1sZWZ0LWN1 cmx5LWFycm93ICgrLWZyaW5nZS1oZWxwZXItZGVjaW1hbAorIi4uLnh4eHguIgorIi4ueHh4eHgu IgorIi54eC4uLi4uIgorIi54eHguLnguIgorIi54eHh4eHguIgorIi4ueHh4eHguIgorIi4uLnh4 eHguIgorIi4ueHh4eHguIikgbmlsIG5pbCAnY2VudGVyKQorCisoZGVmaW5lLWZyaW5nZS1iaXRt YXAgJystZnJpbmdlLXJpZ2h0LWN1cmx5LWFycm93ICgrLWZyaW5nZS1oZWxwZXItZGVjaW1hbAor Ii54eHh4Li4uIgorIi54eHh4eC4uIgorIi4uLi4ueHguIgorIi54Li54eHguIgorIi54eHh4eHgu IgorIi54eHh4eC4uIgorIi54eHh4Li4uIgorIi54eHh4eC4uIikgbmlsIG5pbCAnY2VudGVyKQor CisoZGVmaW5lLWZyaW5nZS1iaXRtYXAgJystZnJpbmdlLWxlZnQtdHJpYW5nbGUgKCstZnJpbmdl LWhlbHBlci1kZWNpbWFsCisiLi4uLi4ueHgiCisiLi4uLnh4eHgiCisiLi4ueHh4eHgiCisiLi54 eHh4eHgiCisiLi54eHh4eHgiCisiLi4ueHh4eHgiCisiLi4uLnh4eHgiCisiLi4uLi4ueHgiKSBu aWwgbmlsICdjZW50ZXIpCisKKyhkZWZpbmUtZnJpbmdlLWJpdG1hcCAnKy1mcmluZ2UtcmlnaHQt dHJpYW5nbGUgKCstZnJpbmdlLWhlbHBlci1kZWNpbWFsCisieHguLi4uLi4iCisieHh4eC4uLi4i CisieHh4eHguLi4iCisieHh4eHh4Li4iCisieHh4eHh4Li4iCisieHh4eHguLi4iCisieHh4eC4u Li4iCis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dlLWhlbHBlci1kZWNpbWFsCisieHh4eHh4Li4iCisi eHh4eHh4Li4iCisieHguLi4uLi4iCisieHguLi4uLi4iCisieHguLi4uLi4iCisieHguLi4uLi4i CisieHguLi4uLi4iCisieHguLi4uLi4iCisieHh4eHh4Li4iCisieHh4eHh4Li4iKSBuaWwgbmls ICdjZW50ZXIpCisKKyhkZWZpbmUtZnJpbmdlLWJpdG1hcCAnKy1mcmluZ2UtcmlnaHQtYnJhY2tl dCAoKy1mcmluZ2UtaGVscGVyLWRlY2ltYWwKKyIuLnh4eHh4eCIKKyIuLnh4eHh4eCIKKyIuLi4u Li54eCIKKyIuLi4uLi54eCIKKyIuLi4uLi54eCIKKyIuLi4uLi54eCIKKyIuLi4uLi54eCIKKyIu Li4uLi54eCIKKyIuLnh4eHh4eCIKKyIuLnh4eHh4eCIpIG5pbCBuaWwgJ2NlbnRlcikKKworKGRl ZmluZS1mcmluZ2UtYml0bWFwICcrLWZyaW5nZS1maWxsZWQtcmVjdGFuZ2xlICgrLWZyaW5nZS1o ZWxwZXItZGVjaW1hbAorInh4eHh4eHguIgorInh4eHh4eHguIgorInh4eHh4eHguIgorInh4eHh4 eHguIgorInh4eHh4eHguIgorInh4eHh4eHguIgorInh4eHh4eHguIgorInh4eHh4eHguIgorInh4 eHh4eHguIgorInh4eHh4eHguIgorInh4eHh4eHguIgorInh4eHh4eHguIgorInh4eHh4eHguIikg bmlsIG5pbCAnY2VudGVyKQorCisoZGVmaW5lLWZyaW5nZS1iaXRtYXAgJystZnJpbmdlLWhvbGxv dy1zcXVhcmUgKCstZnJpbmdlLWhlbHBlci1kZWNpbWFsCisiLnh4eHh4eC4iCisiLnguLi4ueC4i CisiLnguLi4ueC4iCisiLnguLi4ueC4iCisiLnguLi4ueC4iCisiLnh4eHh4eC4iKSBuaWwgbmls ICdjZW50ZXIpCisKKyhkZWZpbmUtZnJpbmdlLWJpdG1hcCAnKy1mcmluZ2UtZmlsbGVkLXNxdWFy ZSAoKy1mcmluZ2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lCisgICAgICAgICAgICAgICAg IChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBj dXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgIChnbG9iYWwtZWxkb2MtbW9kZSAtMSkp CisgICAgICAod2hlbiAoYW5kIGppdC1sb2NrLWNvbnRleHQtdGltZXIKKyAgICAgICAgICAgICAg ICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgICAgICAgICAgKGVxdWFs IGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAgKHdoZW4gKHRpbWVycCBqaXQtbG9j ay1jb250ZXh0LXRpbWVyKQorICAgICAgICAgIChjYW5jZWwtdGltZXIgaml0LWxvY2stY29udGV4 dC10aW1lcikpCisgICAgICAgIDs7IChzZXRxIGppdC1sb2NrLWNvbnRleHQtdGltZXIgKHJ1bi13 aXRoLWlkbGUtdGltZXIgNS4wICdyZXBlYXQgJ2ppdC1sb2NrLWNvbnRleHQtZm9udGlmeSkpCisg ICAgICAgIChzZXRxIGppdC1sb2NrLWNvbnRleHQtdGltZXIgbmlsKSkKKyAgICAgICh3aGVuIChh bmQgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgICAgICAgICAgKGVxdWFs IGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAgKHdoZW4gKHRpbWVycCB1bmRvLWF1 dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVyIHVuZG8t YXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKSkKKyAgICAgICAgKGZzZXQgJ3VuZG8tYXV0by0t dW5kb2FibGUtY2hhbmdlCisgICAgICAgICAgICAgIChsYW1iZGEgKCkgKGFkZC10by1saXN0ICd1 bmRvLWF1dG8tLXVuZG9hYmx5LWNoYW5n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S4KKyAgICAgIDs7OyBI b3dldmVyLCBtb3N0IHVzZXJzIHdpbGwgcHJvYmFibHkgbm90IHdhbnQgdGhpcyBwYXJ0aWN1bGFy IHNldHRpbmcuCisgICAgICAodW5sZXNzIChudWxsIGJpZGktZGlzcGxheS1yZW9yZGVyaW5nKQor ICAgICAgICAoc2V0cSBiaWRpLWRpc3BsYXktcmVvcmRlcmluZyBuaWwpKQorICAgICAgKHVubGVz cyAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgICAg KGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAgKHNldHEgZmlsbC1jb2x1 bW4gODApCisgICAgICAgIChhZGQtaG9vayAnY2hhbmdlLW1ham9yLW1vZGUtaG9vayAndHVybi1v ZmYtZmMtbW9kZSBuaWwgJ2xvY2FsKSkKKyAgICAgICh3aGVuIChjYWxsZWQtaW50ZXJhY3RpdmVs eS1wICdhbnkpCisgICAgICAgIChpZiAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpCisg ICAgICAgICAgKG1lc3NhZ2UgIlR1cm5lZCBPTiBgZmMtbW9kZScgLS0gZGVidWdnaW5nIG1vZGUu IikKKyAgICAgICAgICAobWVzc2FnZSAiVHVybmVkIE9OIGBmYy1tb2RlJy4iKSkpKQorICAgICh0 CisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnZmlsbC1jb2x1bW4pCisgICAgICAoa2lsbC1s b2NhbC12YXJpYWJsZSAnZmMtdmlzaWJsZSkKKyAgICAgIChyZW1vdmUtaG9vayAnY2hhbmdlLW1h am9yLW1vZGUtaG9vayAndHVybi1vZmYtZmMtbW9kZSAnbG9jYWwpCisgICAgICAod2hlbiAoY2Fs bGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAobWVzc2FnZSAiVHVybmVkIE9GRiBg ZmMtbW9kZScuIikpKSkpCisKKyhkZWZ1biB0d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Y19jb25mXyA9IHZhbDsKK30KKworc3RhdGljIHZvaWQK K2JzZXRfbWNfaW5hY3RpdmVfd2luZG93cyAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3Qg dmFsKQoreworICBiLT5tY19pbmFjdGl2ZV93aW5kb3dzXyA9IHZhbDsKK30KKworc3RhdGljIHZv aWQKK2JzZXRfY3Jvc3NoYWlycyAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQor eworICBiLT5jcm9zc2hhaXJzXyA9IHZhbDsKK30KKworc3RhdGljIHZvaWQKK2JzZXRfY2hfaG9y aXpvbnRhbF9ydWxlciAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBi LT5jaF9ob3Jpem9udGFsX3J1bGVyXyA9IHZhbDsKK30KKworc3RhdGljIHZvaWQKK2JzZXRfY2hf dmVydGljYWxfcnVsZXIgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkKK3sKKyAg Yi0+Y2hfdmVydGljYWxfcnVsZXJfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAorYnNldF9jaF9p bmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7Cisg IGItPmNoX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAorYnNldF9m Y192aXNpYmxlIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPmZj X3Zpc2libGVfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAorYnNldF9mY19pbmFjdGl2ZV93aW5k b3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPmZjX2luYWN0 aXZlX3dpbmRvd3NfID0gdmFsOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyog KioqKio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TsgKytpZHg7CisgIFhTRVRGQVNUSU5U IChCVkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSwgaWR4KTsg KytpZHg7CisgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBmY192aXNp YmxlKSwgaWR4KTsgKytpZHg7CisgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2FsX2Zs YWdzLCBmY19pbmFjdGl2ZV93aW5kb3dzKSwgaWR4KTsgKytpZHg7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKICAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3Ms IG1vZGVfbGluZV9mb3JtYXQpLCBpZHgpOyArK2lkeDsKICAgWFNFVEZBU1RJTlQgKEJWQVIgKCZi dWZmZXJfbG9jYWxfZmxhZ3MsIGFiYnJldl9tb2RlKSwgaWR4KTsgKytpZHg7CiAgIFhTRVRGQVNU SU5UIChCVkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBvdmVyd3JpdGVfbW9kZSksIGlkeCk7ICsr aWR4OwpAQCAtNTIyOCw2ICs1MzA5LDI0IEBAIGluaXRfYnVmZmVyX29uY2UgKHZvaWQpCiAgIC8q IE11c3QgZG8gdGhlc2UgYmVmb3JlIG1ha2luZyB0aGUgZmlyc3QgYnVmZmVyISAqLwogCiAgIC8q IHJlYWwgc2V0dXAgaXMgZG9uZSBpbiBiaW5kaW5ncy5lbCAqLworCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGJzZXRfbWNfcmVhbF9mYWtl X2N1cnNvciAoJmJ1Z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KioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBE RUZTWU0gKFFtY19yZWFsX2Zha2VfY3Vyc29yLCAibWMtcmVhbC1mYWtlLWN1cnNvciIpOworICBE RUZTWU0gKFFtY19jb25mLCAibWMtY29uZiIpOworICBERUZTWU0gKFFtY19pbmFjdGl2ZV93aW5k b3dzLCAibWMtaW5hY3RpdmUtd2luZG93cyIpOworICBERUZTWU0gKFFjcm9zc2hhaXJzLCAiY3Jv c3NoYWlycyIpOworICBERUZTWU0gKFFjaF9ob3Jpem9udGFsX3J1bGVyLCAiY2gtaG9yaXpvbnRh bC1ydWxlciIpOworICBERUZTWU0gKFFjaF92ZXJ0aWNhbF9ydWxlciwgImNoLXZlcnRpY2FsLXJ1 bGVyIik7CisgIERFRlNZTSAoUWNoX2luYWN0aXZlX3dpbmRvd3MsICJjaC1pbmFjdGl2ZS13aW5k b3dzIik7CisgIERFRlNZTSAoUWZjX3Zpc2libGUsICJmYy12aXNpYmxlIik7CisgIERFRlNZTSAo UWZjX3Zpc2libGVfaW5hY3RpdmVfd2luZG93LCAiZmMtaW5hY3RpdmUtd2luZG93Iik7CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgREVGU1lNIChRY2hvaWNlLCAiY2hvaWNlIik7 CiAgIERFRlNZTSAoUWxlZnQsICJsZWZ0Iik7CiAgIERFRlNZTSAoUXJpZ2h0LCAicmlnaHQiKTsK QEAgLTU1MDEsNiArNTYxNyw0MSBAQCBzeW1zX29mX2J1ZmZlciAodm9pZCkKICAgRnB1dCAoUXBy b3RlY3RlZF9maWVsZCwgUWVycm9yX21lc3NhZ2UsCiAJYnVpbGRfcHVyZV9jX3N0cmluZyAoIkF0 dGVtcHQgdG8gbW9kaWZ5IGEgcHJvdGVjdGVkIGZpZW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5kb3dzKSwgUW5pbCwKKyAgICBkb2M6IC8qIFdoZW4gbm9uLW5p bCwgZHJhdyBtdWx0aXBsZSBjdXJzb3JzIGZpbGwgY29sdW1uIGluIGluYWN0aXZlIHdpbmRvd3Mu ICovKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBERUZWQVJfUEVSX0JVRkZF UiAoImhlYWRlci1saW5lLWZvcm1hdCIsCiAJCSAgICAgJkJWQVIgKGN1cnJlbnRfYnVmZmVyLCBo ZWFkZXJfbGluZV9mb3JtYXQpLAogCQkgICAgIFFuaWwsCkBAIC02MjEzLDYgKzYzNjQsMTAgQEAg YW5kIGRpc3JlZ2FyZCBhIGByZWFkLW9ubHknIHRleHQgcHJvcGVydHkgaWYgdGhlIHByb3BlcnR5 IHZhbHVlCiBpcyBhIG1lbWJlciBvZiB0aGUgbGlzdC4gICovKTsKICAgVmluaGliaXRfcmVhZF9v bmx5ID0gUW5pbDsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKwogICBERUZWQVJfUEVSX0JVRkZFUiAoImN1cnNvci10eXBlIiwgJkJWQVIgKGN1 cnJlbnRfYnVmZmVyLCBjdXJzb3JfdHlwZSksIFFuaWwsCiAJCSAgICAgZG9jOiAvKiBDdXJzb3Ig dG8gdXNlIHdoZW4gdGhpcyBidWZmZXIgaXMgaW4gdGhlIHNlbGVjdGVkIHdpbmRvdy4KIFZhbHVl cyBhcmUgaW50ZXJwcmV0ZWQgYXMgZm9sbG93czoKQEAgLTYyMjAsNiArNjM3NSw3IEBAIFZhbHVl cyBhcmUgaW50ZXJwcmV0ZWQgYXMgZm9sbG93czoKICAgdCAgICAgICAgICAgICAgIHVzZSB0aGUg Y3Vyc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BvZiB0aGUgY3Jvc3NoYWlycyB2ZXJ0aWNhbCBydWxlci4gKi8KKyAgTGlzcF9PYmpl Y3QgY2hfdmVydGljYWxfcnVsZXJfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBjcm9zc2hhaXJz IGluIGluYWN0aXZlIHdpbmRvd3MuICovCisgIExpc3BfT2JqZWN0IGNoX2luYWN0aXZlX3dpbmRv d3NfOworCisgIC8qIFRoZSBuYW1lIG9mIHRoZSBidWZmZXItbG9jYWwgdmFyaWFibGUuICovCisg IExpc3BfT2JqZWN0IGZjX3Zpc2libGVfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBtdWx0aXBs ZSBjdXJzb3JzIGZpbGwgY29sdW1uIGluIGluYWN0aXZlIHdpbmRvd3MuICovCisgIExpc3BfT2Jq ZWN0IGZjX2luYWN0aXZlX3dpbmRvd3NfOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgIC8qIElmIHRoZSB3aWR0aCBydW4gY2FjaGUgaXMgZW5hYmxlZCwgdGhpcyB0YWJsZSBjb250 YWlucyB0aGUKICAgICAgY2hhcmFjdGVyIHdpZHRocyB3aWR0aF9ydW5fY2FjaGUgKHNlZSBhYm92 ZSkgYXNzdW1lcy4gIFdoZW4gd2UKICAgICAgZG8gYSB0aG9yb3VnaCByZWRpc3BsYXksIHdlIGNv bXBhcmUgdGhpcyBhZ2FpbnN0IHRoZSBidWZmZXIncwpAQCAtNzg3LDE0ICs4MjEsMjEgQEAgc3Ry dWN0IGJ1ZmZlcgogICAgICBhbiBpbmRpcmVjdCBidWZmZXIgc2luY2UgaXQgY291bnRzIGFzIGl0 cyBiYXNlIGJ1ZmZlci4gICovCiAgIGludCB3aW5kb3dfY291bnQ7CiAKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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W50IEN1cnNvcjsKICNkZWZpbmUgTmF0aXZlUmVjdGFu Z2xlIGludAogI2VuZGlmCiAKLS8qIFRleHQgY3Vyc29yIHR5cGVzLiAgKi8KIAorLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK2VudW0gZHJh d19nbHlwaAoreworICBNQ19EUkFXX0dMWVBILAorICBNQ19FUkFTRV9HTFlQSAorfTsKKworZW51 bSB0eXBlX29mX2NhY2hlCit7CisgIE1DX1RFTVBfQ0FDSEUsCisgIE1DX0NBQ0hFLAorICBDSF9D QUNIRSwKKyAgRkNfQ0FDSEUKK307CisKK2VudW0gdHlwZV9vZl9hY3Rpb24KK3sKKyAgTVVMVElQ TEVfQ1VSU09SUywKKyAgSE9SSVpPTlRBTF9SVUxFUiwKKyAgVkVSVElDQUxfUlVMRVIsCisgIEZJ TExfQ09MVU1OCit9OworCitlbnVtIG1jX2ZsYXZvcgoreworICBOT19GTEFWT1IsCisgIE1DX0dM WVBILAorICBNQ19HTFlQSExFU1MsCisgIE1DX09WRVJMQVlfQVJST1dfQklUTUFQLAorICBNQ19Q SUxDUk9XLAorICBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XLAorICBNQ19IT0xMT1df UkVDVEFOR0xFLAorICBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1csCisgIE1DX1ZFUlRJQ0FM X0JBUiwKKyAgTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorfTsKKworLyogVGV4dCBjdXJzb3Ig dHlwZXMuICovCiBlbnVtIHRleHRfY3Vyc29yX2tpbmRzCiB7CisgIFJJR0hUX0ZSSU5HRV9CSVRN QVAgPSAtNCwKKyAgTEVGVF9GUklOR0VfQklUTUFQID0gLTMsCiAgIERFRkFVTFRfQ1VSU09SID0g LTIsCiAgIE5PX0NVUlNPUiA9IC0xLAorICBOT19GUklOR0VfQklUTUFQID0gMCwKKyAgRlJBTUVE X0JPWF9DVVJTT1IsCiAgIEZJTExFRF9CT1hfQ1VSU09SLAogICBIT0xMT1dfQk9YX0NVUlNPUiwK ICAgQkFSX0NVUlNPUiwKICAgSEJBUl9DVVJTT1IKIH07CiAKKy8qIGVuZCBNVUxUSVBMRS1DVVJT T1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBWYWx1ZXMgcmV0dXJuZWQg ZnJvbSBjb29yZGluYXRlc19pbl93aW5kb3cuICAqLwogCiBlbnVtIHdpbmRvd19wYXJ0CkBAIC0z ODIsNiArNDI5LDIwIEBAIHN0cnVjdCBnbHlwaF9zbGljZQogCiBzdHJ1Y3QgZ2x5cGgKIHsKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBp bnQgeCwgeSwgaHBvcywgdnBvczsKKworICBpbnQgcmVsYXRpdmVfeDsKKworICBib29sX2JmIHp2 X3AgOiAxOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFBvc2l0aW9uIGZy b20gd2hpY2ggdGhpcyBnbHlwaCB3YXMgZHJhd24uICBJZiBgb2JqZWN0JyBiZWxvdyBpcyBhCiAg ICAgIExpc3Agc3RyaW5nLCB0aGlzIGlzIGFuIGluZGV4IGludG8gdGhhdCBzdHJpbmcuICBJZiBp dCBpcyBhCiAgICAgIGJ1ZmZlciwgdGhpcyBpcyBhIHBvc2l0aW9uIGluIHRoYXQgYnVmZmVyLiAg SW4gYWRkaXRpb24sIHNvbWUKQEAgLTEyNDgsNiArMTMwOSwyNCBAQCBlbnVtIGRyYXdfZ2x5cGhz X2ZhY2UKIAogc3RydWN0IGdseXBoX3N0cmluZwogeworCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgYm9vbF9iZiBsZWZ0X292ZXJ3cml0 dGVuX3AgOiAxOworCisgICAgYm9vbF9iZiByaWdodF9vdmVyd3JpdHRlbl9wIDogMTsKKworICAg IGJvb2xfYmYgcmVjdGFuZ2xlX251a2VkX3AgOiAxOworCisgICAgYm9vbF9iZiBiYWNrZ3JvdW5k X251a2VkX3AgOiAxOworCisgICAgZW51bSB0eXBlX29mX2FjdGlvbiBhY3Rpb247CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgLyogWC1vcmlnaW4gb2YgdGhlIHN0cmluZy4gICov CiAgIGludCB4OwogCkBAIC0yMjE2LDYgKzIyOTUsMTYgQEAgc3RydWN0IGNvbXBvc2l0aW9uX2l0 CiAKIHN0cnVjdCBpdAogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCisgIGJvb2xfYmYgenZfcCA6IDE7CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICAgLyogVGhlIHdpbmRvdyBpbiB3aGljaCB3ZSBpdGVyYXRlIG92ZXIgY3Vy cmVudF9idWZmZXIgKG9yIGEgc3RyaW5nKS4gICovCiAgIExpc3BfT2JqZWN0IHdpbmRvdzsKICAg c3R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1Y3QgZm9udCAqLCBpbnQgKiwgaW50ICopOwogCiAjaWZkZWYgSEFWRV9X SU5ET1dfU1lTVEVNCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxU SVBMRS1DVVJTT1JTICovCisKK2V4dGVybiBMaXNwX09iamVjdCBtY19udGggKGludCBudW0sIExp c3BfT2JqZWN0IGxpc3QpOworCitleHRlcm4gTGlzcF9PYmplY3QgbWNfYXNzcSAoTGlzcF9PYmpl Y3Qga2V5LCBMaXNwX09iamVjdCBsaXN0KTsKKworZXh0ZXJuIExpc3BfT2JqZWN0IG1jX2hpdF9w IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwgc3RydWN0IGdseXBoX3Jv dyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIHR5cGVfb2ZfY2FjaGUsIHN0 cnVjdCBnbHlwaCAqKTsKKworZXh0ZXJuIGJvb2wgbWNfdXBkYXRlX3dpbmRvd19mcmluZ2VzIChz dHJ1Y3Qgd2luZG93ICosIGJvb2wpOworCitleHRlcm4gY2hhciAqIG1jX3dpbmRvdyAoc3RydWN0 IHdpbmRvdyAqKTsKKworZXh0ZXJuIGNoYXIgKiBtY19jaGFyX3RvX3N0cmluZyAoaW50KTsKKwor ZXh0ZXJuIGNoYXIgKiBtY19jdXJzb3JfdHlwZV90b19zdHJpbmcgKGludCk7CisKK2V4dGVybiBj aGFyICogbWNfZmxhdm9yX3RvX3N0cmluZyAoaW50KTsKKworZXh0ZXJuIGludCBtY19saXNwX3Rv X2N1cnNvcl90eXBlIChMaXNwX09iamVjdCk7CisKK2V4dGVybiBpbnQgbWNfZ2V0X2ZyaW5nZV9i aXRtYXAgKHN0cnVjdCB3aW5kb3cgKiwgTGlzcF9PYmplY3QsIGludCwgaW50KTsKKworZXh0ZXJu IHZv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9tYXRyaXggKiwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICosIGVudW0gZHJhd19nbHlwaHNfZmFj ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGludCwgaW50LCBkb3Vi bGUsIGRvdWJsZSwgZG91YmxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVu dW0gbWNfZmxhdm9yLCBlbnVtIHRleHRfY3Vyc29yX2tpbmRzLCBpbnQsIGJvb2wsIGJvb2wpOwor CitleHRlcm4gdm9pZCBtY194X3dyaXRlX2dseXBocyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3Qg Z2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKiwgZW51bSBnbHlwaF9yb3dfYXJlYSwgaW50LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCwgaW50LCBkb3VibGUsIGRvdWJsZSwgZG91 YmxlLCBlbnVtIG1jX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVt IHRleHRfY3Vyc29yX2tpbmRzLCBpbnQsIGJvb2wsIGJvb2wpOworCisvKiBlbmQgTVVMVElQTEUt Q1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogI2lmZGVmIEdMWVBIX0RF QlVHCiBleHRlcm4gdm9pZCBkdW1wX2dseXBoX3N0cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAq KSBFWFRFUk5BTExZX1ZJU0lCTEU7CiAjZW5kaWYKZGlmZiAtLWdpdCBhL3NyYy9kaXNwbmV3LmMg Yi9zcmMvZGlzcG5ldy5jCmluZGV4IGNjYjA4ZWMuL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cCA9ICFjYW5fc2tpcF9wOworCisgICAgICAgIC8qIEZpbmQgdGhlIG5leHQgZ2x5 cGggdGhhdCdzIGVxdWFsIGFnYWluLiAgKi8KKyAgICAgICAgd2hpbGUgKGkgPCBzdG9wCisgICAg ICAgICAmJiAoc2tpcF9maXJzdF9wCisgICAgICAgfHwgIUdMWVBIX0VRVUFMX1AgKGRlc2lyZWRf Z2x5cGgsIGN1cnJlbnRfZ2x5cGgpKQorICAgICAgICAgJiYgeCA9PSBjdXJyZW50X3gpCisgICAg eworICAgICAgeCArPSBkZXNpcmVkX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgIGN1cnJlbnRf eCArPSBjdXJyZW50X2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICsrZGVzaXJlZF9nbHlwaCwg KytjdXJyZW50X2dseXBoLCArK2k7CisgICAgICBza2lwX2ZpcnN0X3AgPSAwOworICAgIH0KKwor ICBpZiAoZGVidWdfcAorICAgICAgJiYgdnBvcyAhPSBib3R0b21fdnBvcworICAgICAgJiYgIU5J TFAgKGlfc3RvcmUpKQorICAgIHsKKyAgICAgIExpc3BfT2JqZWN0IHN0cmluZyA9IEZwcmluMV90 b19zdHJpbmcgKGlfc3RvcmUsIFFuaWwpOworICAgICAgY2hhciAqY2hhcl9zdHJpbmcgPSBTU0RB VEEgKHN0cmluZyk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJpX3N0b3JlOiAgdnBvcyAoJWQp IHwgJXNcbiIsIHZwb3MsIGNoYXJfc3RyaW5nKTsKKyAgICB9CisKKyAgZm9yICg7CisgICAgICAg Q09OU1AgKGlfc3RvcmUpCisgICAgICAgJiYgdnBvcyAhPSBib3R0b21fdnBvczsKKyAgICAgICBp X3N0b3JlID0gWENEUiAoaV9zdG9yZSkpCisgICAgeworICAgICAgaW50IHggPSBYRklYTlVNIChY Q0FSIChYQ0FSIChpX3N0b3JlKSkpOworICAgICAgaW50IGhwb3MgPSBYRklYTlVNIChYQ0RSIChY Q0FSIChpX3N0b3JlKSkpOworICAgICAgc3RydWN0IGdseXBoICp0YXJnZXRfZ2x5cGggPSBtY19n ZXRfY3Vyc29yX2dseXBoICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIGhwb3MsIHZw b3MpOworICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgIHsKKyAgICAgICAgICBmcHJpbnRmIChz dGRlcnIsICJpX3N0b3JlOiAgY2hhciAoJWQvJXMpIHwgeDogKCVkKSB8IGhwb3MgKCVkKSB8IHZw b3MgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldF9nbHlwaC0+dS5j aCwgbWNfY2hhcl90b19zdHJpbmcgKHRhcmdldF9nbHlwaC0+dS5jaCksCisgICAgICAgICAgICAg ICAgICAgICAgICAgICB4LCBocG9zLCB2cG9zKTsKKyAgICAgICAgfQorICAgICAgbWNfZHJhd19y b3cgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCB4LCAxLCB2 cG9zLAorICAgICAgICAgICAgICAgICAgIGJvdHRvbV92cG9zLCBhY3RpdmVfcCwgdHJ1ZSk7Cisg ICAgfQorCisgICAgICAgIGlmIChpID09IHN0YXJ0X2hwb3MgfHwgeCAhPSBjdXJyZW50X3gpCisg ICAgeworICAgICAgaSA9IHN0YXJ0X2hwb3M7CisgICAgICB4ID0gc3RhcnRfeDsKKyAgICAgIGRl c2lyZWRfZ2x5cGggPSBzdGFydDsKKyAgICAgIGJyZWFrOworICAgIH0KKworICAgICAgICBvdXRw dXRfY3Vyc29yX3RvICh3LCB2cG9zLCBzdGFydF9ocG9zLCBkZXNpcmVkX3Jvdy0+eSwgc3RhcnRf eCk7CisKKyAgLyogUmUtZHJhdyBhIHBvcnRpb24gb2YgdGhlIHJvdy4gKi8KKworICBpZiAoZGVi dWdfcAorICAgICAgJiYgdnBvcyAhPSBib3R0b21fdnBvcykKKyAgICB7CisKKyAgICAgIGZwcmlu dGYgKHN0ZGVyciwgIlJFRFJBVyBTRUdNRU5UOlxuXAorICAgICAgY2hhciAoJWQvJXMpIHwgc3Rh cnRfeDogKCVkKSB8IHN0YXJ0X2hwb3MgKCVkKSB8IGxlbmd0aCAoJWQpIHwgdnBvcyAoJWQpXG4i LAorICAgICAgc3RhcnQtPnUuY2gsIG1jX2NoYXJfdG9fc3RyaW5nIChzdGFydC0+dS5jaCksCisg ICAgICBzdGFydF94LCBzdGFydF9ocG9zLCBpIC0gc3RhcnRfaHBvcywgdnBvcyk7CisgICAgfQor CisgIHJpZi0+bWNfc2NyaWJlX2dseXBocyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93 LCBzdGFydCwgVEVYVF9BUkVBLCBpIC0gc3RhcnRfaHBvcywKKyAgICAgICAgICAgICAgICAgICAg ICAgICB2cG9zLCBib3R0b21fdnBvcywgcmVkLCBncmVlbiwgYmx1ZSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNv cl9nY19wKTsKKworICBtY19kcmF3X3JvdyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93 LCBzdGFydCwgc3RhcnRfeCwgaSAtIHN0YXJ0X2hwb3MsCisgICAgICAgICAgICAgICB2cG9zLCBi b3R0b21fdnBvcywgYWN0aXZlX3AsIHRydWUpOworCisgICAgICAgIGNoYW5nZWRfcCA9IDE7Cisg ICAgICB9CisgIH0KKworICAgICAgLyogV3JpdGUgdGhlIHJlc3QuICAqLworICAgICAgaWYgKGkg PCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICB7CisgICAgb3V0cHV0X2N1cnNvcl90 byAodywgdnBvcywgaSwgZGVzaXJlZF9yb3ctPnksIHgpOworCisgIGlmIChkZWJ1Z19wCisgICAg ICAmJiB2cG9zICE9IGJvdHRvbV92cG9zKQorICAgI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G9hdGlu ZyBnbHlwaHMgZm9yIHRoZSBob3Jpem9udGFsL3ZlcnRpY2FsIHJ1bGVycyBoZXJlLiAqLworICAg IGVsc2UgaWYgKGNoYW5nZWRfcCkKKyAgICAgIHsKKyAgICAgICAgaW50IHggPSB3LT5vdXRwdXRf Y3Vyc29yLng7CisgICAgICAgIGludCBocG9zID0gKHctPm91dHB1dF9jdXJzb3IuaHBvcyA9PSB1 cGRhdGVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAgICAgICAgICAgICAgID8gdXBkYXRl ZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEKKyAgICAgICAgICAgICAgICAgICA6IHctPm91dHB1 dF9jdXJzb3IuaHBvczsKKyAgICAgICAgc3RydWN0IGdseXBoICpzdGFydCA9IG1jX2dldF9jdXJz b3JfZ2x5cGggKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgaHBvcywgdnBvcyk7Cisg ICAgICAgIGlmICh3LT5vdXRwdXRfY3Vyc29yLnggPT0gdXBkYXRlZF9yb3ctPnBpeGVsX3dpZHRo KQorICAgICAgICAgIHggLT0gc3RhcnQtPnBpeGVsX3dpZHRoOworICAgICAgICBpZiAoZGVidWdf cCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJDSEFOR0VEIC0g RlJPTTogIGNoYXIgKCVkLyVzKSB8IHggKCVkKSB8IGhwb3MgKCVkKSAtLSBUTyBFTkQuXG4iLAor ICAgICAgICAgICAgICAgICAgICAgc3RhcnQtPnUuY2gsIG1jX2NoYXJfdG9fc3RyaW5nIChzdGFy dC0+dS5jaCksCisgICAgICAgICAgICAgICAgICAgICB4LCBocG9zKTsKKyAgICAgICAgICB9Cisg ICAgICAgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHN0YXJ0 LCB4LCB1cGRhdGVkX3Jvdy0+dXNlZFtURVhUX0FSRUF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cmQtd3JhcHBlZCBsaW5lcyBkby4gKi8KKyAgICAgIGlu dCB4ID0gdXBkYXRlZF9yb3ctPnBpeGVsX3dpZHRoOworICAgICAgaW50IGhwb3MgPSB1cGRhdGVk X3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgICAgIGludCB4X2xpbWl0ID0gKGNsZWFyX3Rv X3ggPT0gLTEpCisgICAgICAgICAgICAgICAgICAgID8gdGV4dF9hcmVhX3dpZHRoCisgICAgICAg ICAgICAgICAgICAgIDogY2xlYXJfdG9feDsKKyAgICAgIGlmICh0cmFjZV9yZWRpc3BsYXlfcCkK KyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfdXBkYXRlX3RleHRfYXJlYSAoZmxvYXRpbmcp OiAgdnBvcyAoJWQpIHwgeF9saW1pdCAoJWQpXG4iLCB2cG9zLCB4X2xpbWl0KTsKKworICAgICAg aWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAg ICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2hvcml6b250 YWxfcnVsZXIpKQorICAgICAgICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAm JiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9IE5V TEwpCisgICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0 YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwKKyAgICAgICAgICAgICAgICAgICB1 cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgSEJBUl9DVVJTT1IsIDEsCisgICAgICAgICAgICAg ICAgICAgZGVidWdfcCA/IGRlYnVnX2ZnIDogdy0+Y2hfZm9yZWdyb3VuZCwgYWN0aXZlX3AsIEhP UklaT05UQUxfUlVMRVIsIHRydWUsICZyZXN1bHQpOworCisgICAgICBpZiAoIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgJiYgIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAg ICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAmJiB2cG9zICE9IHctPmN1cnNv ci52cG9zCisgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0geAorICAgICAgICAgICYmIHRhcmdl dF9nbHlwaCAhPSBOVUxMKQorICAgICAgICBtY19lbmdpbmUgKHcsIGRlc2lyZWRfbWF0cml4LCB1 cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCBURVhUX0FSRUEsIHgsIHhfbGltaXQsCisgICAgICAg ICAgICAgICAgICAgdXBkYXRlZF9yb3ctPnksIGhwb3MsIHZwb3MsIEJBUl9DVVJTT1IsIDEsCisg ICAgICAgICAgICAgICAgICAgZGVidWdfcCA/IGRlYnVnX2ZnIDogdy0+Y2hfZm9yZWdyb3VuZCwg YWN0aXZlX3AsIFZFUlRJQ0FMX1JVTEVSLCB0cnVlLCAmcmVzdWx0KTsKKworICAgICAgaWYgKCFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgICAg ICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAmJiB3LT5tYy5mY194ID49IHgKKyAg ICAgICAgICAmJiB0YXJnZXRfZ2x5cGggIT0gTlVMTCkKKyAgICAgICAgbWNfZW5naW5lICh3LCBk ZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHRhcmdldF9nbHlwaCwgVEVYVF9BUkVBLCB4LCB4 X2xpbWl0LAorICAgICAgICAgICAgICAgICAgIHVwZGF0ZWRfcm93LT55LCBocG9zLCB2cG9zLCBC QVJfQ1VSU09SLCAxLAorICAgICAgICAgICAgICAgICAgIGRlYnVnX3AgPyBkZWJ1Z19mZyA6IHct PmZjX2ZvcmVncm91bmQsIGFjdGl2ZV9wLCBGSUxMX0NPTFVNTiwgdHJ1ZSwgJnJlc3VsdCk7CisK KyAgICB9CisgICAgfQorCisgIHJldHVybiBjaGFuZ2VkX3A7Cit9CisKKy8qIGVuZCBNVUxUSVBM RS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBTdHJ1Y3R1cmUg dG8gcGFzcyBkaW1lbnNpb25zIGFyb3VuZC4gIFVzZWQgZm9yIGNoYXJhY3RlciBib3VuZGluZwog ICAgYm94ZXMsIGdseXBoIG1hdHJpeCBkaW1lbnNpb25zIGFuZCBhbGlrZS4gICovCiAKQEAgLTMy ODIsMTAgKzM3MzMsMzYgQEAgcmVkcmF3X292ZXJsYXBwZWRfcm93cyAoc3RydWN0IHdpbmRvdyAq dywgaW50IHliKQogCSAgICB7CiAJICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgaSwgMCwgcm93 LT55LAogCQkJCWFyZWEgPT0gVEVYVF9BUkVBID8gcm93LT54IDogMCk7Ci0JICAgICAgaWYgKHJv dy0+dXNlZFthcmVhXSkKKworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCisgIGlmICgoIU5JTFAgKHctPm1jX2NhY2hlKSB8fCAhTklMUCAody0+ Y2hfY2FjaGUpIHx8ICFOSUxQICh3LT5mY19jYWNoZSkpCisgICAgICAmJiBhcmVhID09IFRFWFRf QVJFQQorICAgICAgJiYgcm93LT51c2VkW2FyZWFdKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlw aF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgaW50IHN0YXJ0X3gg PSByb3ctPng7CisgICAgICBpbnQgc3RhcnRfaHBvcyA9IDA7CisgICAgICBpbnQgZW5kX2hwb3Mg PSByb3ctPnVzZWRbYXJlYV07CisgICAgICBib29sIGNsZWFyX2VvbF9wID0gdHJ1ZTsKKyAgICAg IGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCA9IERSQVdfTk9STUFMX1RFWFQ7CisgICAgICBUUkFD RSAoKHN0ZGVyciwgInJlZHJhd19vdmVybGFwcGVkX3Jvd3MgKCVkKTogIHN0YXJ0X3ggKCVkKSB8 IHN0YXJ0X2hwb3MgKCVkKSB8IGVuZF9ocG9zICglZClcbiIsCisgICAgICAgICAgICAgICAgICAg ICAgaSwgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MpKTsKKyAgICAgIG1jX3JlZHJhd19y b3cgKHcsIG1hdHJpeCwgcm93LCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcywgY2xlYXJf ZW9sX3AsIGhsKTsKKyAgICB9CisgICAgZWxzZSBpZiAocm93LT51c2VkW2FyZWFdKQorICAgICAg ewogCQlGUkFNRV9SSUYgKGYpLT53cml0ZV9nbHlwaHMgKHcsIHJvdywgcm93LT5nbHlwaHNbYXJl YV0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmVhLCBy b3ctPnVzZWRbYXJlYV0pOwogCSAgICAgIEZSQU1FX1JJRiAoZiktPmNsZWFyX2VuZF9vZl9saW5l ICh3LCByb3csIGFyZWEsIC0xKTsKKyAgICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogCSAgICB9CiAKIAkgIHJvdy0+b3ZlcmxhcHBlZF9wID0gMDsKQEAgLTMzODgsNiArMzg2 NSw1MiBAQCBzdGF0aWMgYm9vbAogdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9v bCBmb3JjZV9wKQogewogICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpkZXNpcmVkX21hdHJpeCA9IHct PmRlc2lyZWRfbWF0cml4OworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4g TVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmICh0cmFjZV9yZWRpc3BsYXlfcCkKKyAgICBmcHJp bnRmIChzdGRlcnIsICJ1cGRhdGVfd2luZG93ICglcylcbiIsIG1jX3dpbmRvdyAodykpOworCisg IHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBib29sIGFjdGl2ZV9wID0g KHcgPT0gWFdJTkRPVyAoZi0+c2VsZWN0ZWRfd2luZG93KQorICAgICAgICAgICAgICAgICAgICYm IGYgPT0gRlJBTUVfRElTUExBWV9JTkZPIChmKS0+eF9oaWdobGlnaHRfZnJhbWUpOworICBtY19z ZXRfZXNzZW50aWFscyAodywgYWN0aXZlX3ApOworCisgIHN0cnVjdCBnbHlwaF9tYXRyaXggKmN1 cnJlbnRfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisKKyAgYm9vbCB1cGRhdGluZ19mcmFt ZV9wID0gZmFsc2U7CisKKyAgYm9vbCBnb19wID0gKCFOSUxQICh3LT5tY19jYWNoZSkgfHwgIU5J TFAgKHctPmNoX2NhY2hlKSB8fCAhTklMUCAody0+ZmNfY2FjaGUpCisgICAgICAgICAgICAgICB8 fCAoQlVGRkVSUCAody0+Y29udGVudHMpICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIG1jX2NvbmYpKSkKKyAgICAgICAgICAgICAgIHx8IChCVUZGRVJQICh3LT5jb250ZW50 cykgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQor ICAgICAgICAgICAgICAgfHwgKEJVRkZFUlAgKHctPmNvbnRlbnRzKSAmJiAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpKTsKKworICBpZiAoZ29fcAorICAg ICAgJiYgWEZSQU1FICh3LT5mcmFtZSkgIT0gWEZSQU1FICh3LT5mcmFtZSktPm1jX3VwZGF0aW5n X2ZyYW1lKQorICAgIHsKKyAgICAgIHVwZGF0aW5nX2ZyYW1lX3AgPSB0cnVlOworICAgICAgdXBk YXRlX2JlZ2luIChYRlJBTUUgKHctPmZyYW1lKSk7CisgICAgfQorCisgIGZvciAoaW50IHZwb3Mg PSAwOworICAgICAgIHZwb3MgPCBjdXJyZW50X21hdHJpeC0+bnJvd3MKKyAgICAgICAmJiBNQVRS SVhfUk9XIChjdXJyZW50X21hdHJpeCwgdnBvcyktPmVuYWJsZWRfcAorICAgICAgICYmICghTklM UCAody0+bWNfY2FjaGUpIHx8ICFOSUxQICh3LT5jaF9jYWNoZSkgfHwgIU5JTFAgKHctPmZjX2Nh Y2hlKSk7CisgICAgICAgKyt2cG9zKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJv dyA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAgICAgIG1jX2VyYXNlX3Jv dyAodywgY3VycmVudF9tYXRyaXgsIHJvdyk7CisgICAgfQorICB3c2V0X21jX2NhY2hlICh3LCBR bmlsKTsKKyAgd3NldF9jaF9jYWNoZSAodywgUW5pbCk7CisgIHdzZXRfZmNfY2FjaGUgKHcsIFFu aWwpOworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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suICovCisgICAgICAgICYmIEJVRkZFUlAgKHctPmNvbnRlbnRz KQorICAgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29u ZikpCisgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj cm9zc2hhaXJzKSkKKyAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGZjX3Zpc2libGUpKSk7CisgICAgICAgICsrZGVzaXJlZF9yb3cpCisgICAgeworICAg ICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKGRlc2lyZWRfcm93LCBkZXNpcmVkX21hdHJp eCk7CisgICAgICBpZiAoZGVzaXJlZF9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgY29udGludWU7 CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpib3R0b21fcm93ID0gTUFUUklYX0JPVFRPTV9URVhU X1JPVyAoY3VycmVudF9tYXRyaXgsIHcpOworICAgICAgaW50IGJvdHRvbV92cG9zID0gTUFUUklY X1JPV19WUE9TIChib3R0b21fcm93LCBjdXJyZW50X21hdHJpeCk7CisgICAgICBzdHJ1Y3QgZ2x5 cGhfcm93ICpjdXJyZW50X3JvdyA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCB2cG9zKTsK KyAgICAgIGlmIChjdXJyZW50X3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICBtY19kcmF3X3JvdyAo dywgY3VycmVudF9tYXRyaXgsIGN1cnJlbnRfcm93LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRf QVJFQV0sCisgICAgICAgICAgICAgICAgICAgICBjdXJyZW50X3Jvdy0+eCwgY3VycmVudF9yb3ct PnVzZWRbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgIGJvdHRvbV92cG9z LCBhY3RpdmVfcCwgdHJ1ZSk7CisgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgICAgICAvKiBVcGRhdGUgdGhlIGhlYWRlciBsaW5lIGFmdGVyIHNjcm9sbGluZyBiZWNhdXNl IGEgbmV3IGhlYWRlcgogCSBsaW5lIHdvdWxkIG90aGVyd2lzZSBvdmVyd3JpdGUgbGluZXMgYXQg dGhlIHRvcCBvZiB0aGUgd2luZG93CiAJIHRoYXQgY2FuIGJlIHNjcm9sbGVkLiAgKi8KQEAgLTM1 MzEsMTAgKzQwODcsMjEgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBm b3JjZV9wKQogICAgICAgc3RyY3B5ICh3LT5jdXJyZW50X21hdHJpeC0+bWV0aG9kLCB3LT5kZXNp cmVkX21hdHJpeC0+bWV0aG9kKTsKICNlbmRpZgogCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCisg IGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICBtY191cGRhdGVfd2luZG93X2ZyaW5n ZXMgKHcsIDApOworICAgIGVsc2UKICAgICAgIHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgMCk7 CiAjZW5kaWYKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgLyogRW5kIHRo ZSB1cGRhdGUgb2Ygd2luZG93IFcuICBEb24ndCBzZXQgdGhlIGN1cnNvciBpZiB3ZQogICAgICAg ICAgcGF1c2VkIHVwZGF0aW5nIHRoZSBkaXNwbGF5IGJlY2F1c2UgaW4gdGhpcyBjYXNlLAogICAg ICAgICAgc2V0X3dpbmRvd19jdXJzb3JfYWZ0ZXJfdXBkYXRlIGhhc24ndCBiZWVuIGNhbGxlZCwg YW5kCkBAIC0zNTUyLDYgKzQxMTksMTYgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAq dywgYm9vbCBmb3JjZV9wKQogICB4d2lkZ2V0X2VuZF9yZWRpc3BsYXkgKHcsIHctPmN1cnJlbnRf bWF0cml4KTsKICAgY2xlYXJfZ2x5cGhfbWF0cml4IChkZXNpcmVkX21hdHJpeCk7CiAKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKHVw ZGF0aW5nX2ZyYW1lX3ApCisgICAgdXBkYXRlX2VuZCAoWEZSQU1FICh3LT5mcmFtZSkpOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIHJldHVybiBwYXVzZWRfcDsKIH0KIApAQCAt Mzg1MiwxNCArNDQyOSwzMCBAQCB1cGRhdGVfd2luZG93X2xpbmUgKHN0cnVjdCB3aW5kb3cgKncs IGludCB2cG9zLCBib29sICptb3VzZV9mYWNlX292ZXJ3cml0dGVuX3ApCiAJICBjdXJyZW50X3Jv dy0+cmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AgPSAxOwogCX0KIAorCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBib29sIHVwZGF0ZWRfcCA9ICgh QlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgPyB1cGRhdGVfdGV4dF9h cmVhICh3LCBkZXNpcmVkX3JvdywgdnBvcykKKyAgICAgICAgICAgICAgICAgICA6IChCVUZGRVJQ ICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAmJiBOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgICYmIE5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAg ICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNp YmxlKSkpCisgICAgICAgICAgICAgICAgICAgICA/IHVwZGF0ZV90ZXh0X2FyZWEgKHcsIGRlc2ly ZWRfcm93LCB2cG9zKQorICAgICAgICAgICAgICAgICAgIDogbWNfdXBkYXRlX3RleHRfYXJlYSAo dywgZGVzaXJlZF9yb3csIHZwb3MpKTsKKwogICAgICAgLyogVXBkYXRlIHRoZSBkaXNwbGF5IG9m IHRoZSB0ZXh0IGFyZWEuICAqLwotICAgICAgaWYgKHVwZGF0ZV90ZXh0X2FyZWEgKHcsIGRlc2ly ZWRfcm93LCB2cG9zKSkKKyAgICAgIGlmICh1cGRhdGVkX3ApCiAJewogCSAgY2hhbmdlZF9wID0g MTsKIAkgIGlmIChjdXJyZW50X3Jvdy0+bW91c2VfZmFjZV9wKQogCSAgICAqbW91c2VfZmFjZV9v dmVyd3JpdHRlbl9wID0gMTsKIAl9CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAg ICAgIC8qIFVwZGF0ZSBkaXNwbGF5IG9mIHRoZSByaWdodCBtYXJnaW4gYXJlYSwgaWYgdGhlcmUg aXMgb25lLiAgKi8KICAgICAgIGlmICghZGVzaXJlZF9yb3ctPmZ1bGxfd2lkdGhfcCAmJiB3LT5y aWdodF9tYXJnaW5fY29scyA+IDApCiAJewpkaWZmIC0tZ2l0IGEvc3JjL2ZyYW1lLmggYi9zcmMv ZnJhbWUuaAppbmRleCBlYzhmNjE0Li5lZWFmNzFlIDEwMDY0NAotLS0gYS9zcmMvZnJhbWUuaAor KysgYi9zcmMvZnJhbWUuaApAQCAtMjA1LDYgKzIwNSwxNiBAQCBzdHJ1Y3QgZnJhbWUKICAgTGlz cF9PYmplY3QgdG9vbF9iYXJfaXRlbXM7CiAgIC8qIHRvb2xfYmFyX2l0ZW1zIHNob3VsZCBiZSB0 aGUgbGFzdCBMaXNwX09iamVjdCBtZW1iZXIuICAqLwogCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIE5vbi1uaWwgd2hlbiB0aGUgZnJh bWUgaXMgaW4gdGhlIHByb2Nlc3Mgb2YgYmVpbmcgdXBkYXRlZC4gKi8KKyAgc3RydWN0IGZyYW1l ICptY191cGRhdGluZ19mcmFtZTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAv KiBDYWNoZSBvZiByZWFsaXplZCBmYWNlcy4gICovCiAgIHN0cnVjdCBmYWNlX2NhY2hlICpmYWNl X2NhY2hlOwogCmRpZmYgLS1naXQgYS9zcmMvZnJpbmdlLmMgYi9zcmMvZnJpbmdlLmMKaW5kZXgg MzM1YTZlYi4uNjE0ODhkZSAxMDA2NDQKLS0tIGEvc3JjL2ZyaW5nZS5jCisrKyBiL3NyYy9mcmlu Z2UuYwpAQCAtNDM4LDYgKzQzOCwzOTkgQEAgc3RhdGljIHVuc2lnbmVkIHNob3J0IGVtcHR5X2xp bmVfYml0c1tdID0gewogI2RlZmluZSBTVEFOREFSRF9CSVRNQVBfSEVJR0hUKGJpdHMpIChzaXpl b2YgKGJpdHMpL0JZVEVTX1BFUl9CSVRNQVBfUk9XKQogI2RlZmluZSBGUkJJVFMoYml0cykgIGJp dHMsIFNUQU5EQVJEX0JJVE1BUF9IRUlHSFQgKGJpdHMpCiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGArLWZyaW5nZS1oZWxw ZXItZGVjaW1hbCcgZGVmaW5lZCBpbiBgY3Jvc3NoYWlycy5lbGAgKi8KKworLyogMjQKKyAgICAo Ky1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4u Li4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4uLnh4 Li4iCisgICAgICAieC4uLi54eC4iCisgICAgICAieC54eHh4eHgiCisgICAgICAieC54eHh4eHgi CisgICAgICAieC4uLi54eC4iCisgICAgICAieC4uLnh4Li4iCisgICAgICAieC4ueHguLi4iCisg ICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iKQorKi8K K3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3dfYml0c1td ID17CisgIDB4ODAsIDB4ODAsIDB4ODAsIDB4OTgsIDB4OGMsIDB4ODYsIDB4YmYsCisgIDB4YmYs IDB4ODYsIDB4OGMsIDB4OTgsIDB4ODAsIDB4ODAsIDB4ODB9OworCisvKiAyNQorICAgICgrLWZy aW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4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A9eworICAweGMwLCAweGMwLCAweGUwLCAweDYwLCAweDMwLCAweDMwLCAweDE4 LCAweDE4LCAweGMsIDB4YywgMHg2LCAweDYsIDB4MywgMHgzfTsKKworLyogMjkKKyAgICAoKy1m cmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHguLi4uLi4iCisgICAgICAieHguLi4u Li4iCisgICAgICAieHh4Li4uLi4iCisgICAgICAieHh4Li4uLi4iCisgICAgICAieC54eC4uLi4i CisgICAgICAieC54eC4uLi4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4ueHguLi4iCisg ICAgICAieC4uLnh4Li4iCisgICAgICAieC4uLnh4Li4iCisgICAgICAieC4uLi54eC4iCisgICAg ICAieC4uLi54eC4iCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiKQorKi8KK3N0 YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9iYXJfYmFja3NsYXNoX2JpdHNbXSA9ewor ICAweGMwLCAweGMwLCAweGUwLCAweGUwLCAweGIwLCAweGIwLCAweDk4LAorICAweDk4LCAweDhj LCAweDhjLCAweDg2LCAweDg2LCAweDgzLCAweDgzfTsKKworLyogMzAKKyAgICAoKy1mcmluZ2Ut aGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLnh4eHh4eC4iCisgICAgICAieHh4eC54Li4iCisg ICAgICAieHh4eC54Li4iCisgICAgICAieHh4eC54Li4iCisgICAgICAiLnh4eC54Li4iCisgICAg ICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAi Li4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iKQorKi8KK3N0YXRp YyB1bnNpZ25lZCBzaG9ydCBtY19waWxjcm93X2JpdHNbXSA9eworICAweDdlLCAweGY0LCAweGY0 LCAweGY0LCAweDc0LCAweDE0LCAweDE0LCAweDE0LCAweDE0LCAweDE0LCAweDE0fTsKKworLyog MzEKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi54eHh4Li4iCisg ICAgICAiLnh4eHh4eC4iCisgICAgICAieC4ueHguLngiCisgICAgICAieC4ueHguLngiCisgICAg ICAieHh4eHh4eHgiCisgICAgICAieHguLi4ueHgiCisgICAgICAieHh4Li54eHgiCisgICAgICAi Lnh4eHh4eC4iCisgICAgICAiLi54eHh4Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBt Y19zbWlsZXlfZmFjZV9iaXRzW10gPXsKKyAgMHgzYywgMHg3ZSwgMHg5OSwgMHg5OSwgMHhmZiwg MHhjMywgMHhlNywgMHg3ZSwgMHgzY307CisKKy8qIDMyCisgICAgKCstZnJpbmdlLWhlbHBlci1o ZXhhZGVjaW1hbAorICAgICAgIi4ueC4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4u Li54Li4uIgorICAgICAgIi4uLi4ueC4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLngu Li4uIgorICAgICAgIi4ueC4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2lu Z2xlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAweDIwLCAweDEwLCAweDgsIDB4NCwgMHg4LCAw eDEwLCAweDIwfTsKKworLyogMzMKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisg ICAgICAiLi4uLi54Li4iCisgICAgICAiLi4uLnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAg ICAiLi54Li4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLnguLi4iCisgICAgICAi Li4uLi54Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfbGVm dF9iaXRzW10gPXsKKyAgMHg0LCAweDgsIDB4MTAsIDB4MjAsIDB4MTAsIDB4OCwgMHg0fTsKKwor LyogMzQKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHgueHguLi4i CisgICAgICAiLnh4Lnh4Li4iCisgICAgICAiLi54eC54eC4iCisgICAgICAiLi4ueHgueHgiCisg ICAgICAiLi54eC54eC4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAieHgueHguLi4iKQorKi8K K3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfcmlnaHRfYml0c1tdID17Cisg IDB4ZDgsIDB4NmMsIDB4MzYsIDB4MWIsIDB4MzYsIDB4NmMsIDB4ZDh9OworCisvKiAzNQorICAg ICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi54eC54eCIKKyAgICAgICIu Lnh4Lnh4LiIKKyAgICAgICIueHgueHguLiIKKyAgICAgICJ4eC54eC4uLiIKKyAgICAgICIueHgu eHguLiIKKyAgICAgICIuLnh4Lnh4LiIKKyAgICAgICIuLi54eC54eCIpCisqLworc3RhdGljIHVu c2lnbmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV9sZWZ0X2JpdHNbXSA9eworICAweDFiLCAweDM2 LCAweDZjLCAweGQ4LCAweDZjLCAweDM2LCAweDFifTsKKworLyogMzYKKyAgICAoKy1mcmluZ2Ut aGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC54LnguLi4iCisgICAgICAiLngueC54Li4iCisg ICAgICAiLi54LngueC4iCisgICAgICAiLi4ueC54LngiCisgICAgICAiLi54LngueC4iCisgICAg ICAiLngueC54Li4iCisgICAgICAieC54LnguLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9y dCBtY190cmlwbGVfYW5nbGVfcmlnaHRfYml0c1tdID17CisgIDB4YTgsIDB4NTQsIDB4MmEsIDB4 MTUsIDB4MmEsIDB4NTQsIDB4YTh9OworCisvKiAzNworICAgICgrLWZyaW5nZS1oZWxwZXItaGV4 YWRlY2ltYWwKKyAgICAgICIuLi54LngueCIKKyAgICAgICIuLngueC54LiIKKyAgICAgICIueC54 LnguLiIKKyAgICAgICJ4LngueC4uLiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICIuLngueC54 LiIKKyAgICAgICIuLi54LngueCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBs ZV9hbmdsZV9sZWZ0X2JpdHNbXSA9eworICAweDE1LCAweDJhLCAweDU0LCAweGE4LCAweDU0LCAw eDJhLCAweDE1fTsKKworLyogMzgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisg ICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAg ICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAi LnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4u Li4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1 bnNpZ25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4MDAs IDB4MDAsIDB4MDAsIDB4MTAsIDB4MjgsIDB4NDQsIDB4ODIsIDB4MDAsIDB4MDAsIDB4MDAsIDB4 MDB9OworCisvKiAzOQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIu Li4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4u Li4uLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4u LiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIK KyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVk IHNob3J0IG1jX3NpbmdsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDAwLCAweDAwLCAweDAw LCAweDAwLCAweDgyLCAweDQ0LCAweDI4LCAweDEwLCAweDAwLCAweDAwLCAweDAwLCAweDAwfTsK KworLyogNDAKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4u Li4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4i CisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisg ICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAg ICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0 YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAs IDB4MDAsIDB4MDAsIDB4MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4ODIsIDB4 MDAsIDB4MDAsIDB4MDB9OworCisvKiA0MQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2lt YWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIK KyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAg ICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAg ICIuLi54Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIu Li4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV9kb3du X2JpdHNbXSA9eworICAweDAwLCAweDAwLCAweDAwLCAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAw eDQ0LCAweDI4LCAweDEwLCAweDAwLCAweDAwLCAweDAwfTsKKworLyogNDIKKyAgICAoKy1mcmlu Z2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4i CisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisg ICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAg ICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAi Li4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfdXBf Yml0c1tdID17CisgIDB4MDAsIDB4MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4 OTIsIDB4MjgsIDB4NDQsIDB4ODIsIDB4MDB9OworCisvKiA0MworICAgICgrLWZyaW5nZS1oZWxw ZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAg ICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIu eC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4u LnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4uLi4u LiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3F1YWRydXBsZV9hbmdsZV9kb3duX2Jp dHNbXSA9eworICAweDAwLCAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDky LCAweDQ0LCAweDI4LCAweDEwLCAweDAwfTsKKworLyogNDQKKyAgICAoKy1mcmluZ2UtaGVscGVy LWhleGFkZWNpbWFsCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAi LnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLngu Li54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54 Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4i CisgICAgICAieC4uLi4ueC4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVw bGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4 NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4ODJ9OworCisvKiA0NQor ICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4Li4uLi54LiIKKyAgICAg ICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIu eC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4u LnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLngu LiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4uLiIpCisqLworc3RhdGljIHVuc2ln bmVkIHNob3J0IG1jX3RyaXBsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDgyLCAweDQ0LCAw eDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ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4KKyAgIElmIEtFRVBfQ1VSUkVOVF9QIGlzIDAsIHVwZGF0ZSBjdXJy ZW50X21hdHJpeCB0b28uICAqLworYm9vbAorbWNfdXBkYXRlX3dpbmRvd19mcmluZ2VzIChzdHJ1 Y3Qgd2luZG93ICp3LCBib29sIGtlZXBfY3VycmVudF9wKQoreworICBzdHJ1Y3QgZ2x5cGhfcm93 ICpyb3csICpjdXIgPSAwOworICBpbnQgeWIgPSB3aW5kb3dfdGV4dF9ib3R0b21feSAodyk7Cisg IGludCBybiwgbnJvd3MgPSB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3M7CisgIGludCB5OworICBi b29sIHJlZHJhd19wID0gMDsKKyAgTGlzcF9PYmplY3QgYm91bmRhcnlfdG9wID0gUW5pbCwgYm91 bmRhcnlfYm90ID0gUW5pbDsKKyAgTGlzcF9PYmplY3QgYXJyb3dfdG9wID0gUW5pbCwgYXJyb3df Ym90ID0gUW5pbDsKKyAgTGlzcF9PYmplY3QgZW1wdHlfcG9zOworICBMaXNwX09iamVjdCBpbmQg PSBRbmlsOworI2RlZmluZSBNQVhfQklUTUFQX0NBQ0hFICg4KjQpCisgIGludCBiaXRtYXBfY2Fj aGVbTUFYX0JJVE1BUF9DQUNIRV07CisgIGludCB0b3BfaW5kX3JuLCBib3RfaW5kX3JuOworICBp bnQgdG9wX2luZF9taW5feSwgYm90X2luZF9tYXhfeTsKKyAgLyogdG9wX2luZF9ybiBpcyBzZXQg dG8gYSBub25uZWdhdGl2ZSB2YWx1ZSB3aGVuZXZlcgorICAgICByb3ctPmluZGljYXRlX2JvYl9w IGlzIHNldCwgc28gaXQncyBPSyB0aGF0IHRvcF9yb3dfZW5kc19hdF96dl9wCisgICAgIGlzIG5v dCBpbml0aWFsaXplZCBoZXJlLiAgU2ltaWxhcmx5IGZvciBib3RfaW5kX3JuLAorICAgICByb3ct PmluZGljYXRlX2VvYl9wIGFuZCBib3Rfcm93X2VuZHNfYXRfenZfcC4gICovCisgIGludCB0b3Bf cm93X2VuZHNfYXRfenZfcCBNQ19JRl9MSU5UICg9IDApLCBib3Rfcm93X2VuZHNfYXRfenZfcCBN Q19JRl9MSU5UICg9IDApOworICBpZiAody0+cHNldWRvX3dpbmRvd19wKQorICAgIHJldHVybiAw OworICBpZiAoIU1JTklfV0lORE9XX1AgKHcpCisgICAgICAmJiAoaW5kID0gQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBpbmRpY2F0ZV9idWZmZXJfYm91bmRhcmllcyksICFOSUxQIChpbmQp KSkKKyAgICB7CisgICAgICBpZiAoRVEgKGluZCwgUWxlZnQpIHx8IEVRIChpbmQsIFFyaWdodCkp CisgICAgICAgIGJvdW5kYXJ5X3RvcCA9IGJvdW5kYXJ5X2JvdCA9IGFycm93X3RvcCA9IGFycm93 X2JvdCA9IGluZDsKKyAgICAgIGVsc2UgaWYgKENPTlNQIChpbmQpCisgICAgICAgICAgICAgICAm JiBDT05TUCAoWENBUiAoaW5kKSkpCisgIHsKKyAgICBMaXNwX09iamVjdCBwb3M7CisgICAgaWYg KHBvcyA9IG1jX2Fzc3EgKFF0LCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgIGJvdW5kYXJ5X3Rv cCA9IGJvdW5kYXJ5X2JvdCA9IGFycm93X3RvcCA9IGFycm93X2JvdCA9IFhDRFIgKHBvcyk7Cisg ICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFF0b3AsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgYm91 bmRhcnlfdG9wID0gWENEUiAocG9zKTsKKyAgICBpZiAocG9zID0gbWNfYXNzcSAoUWJvdHRvbSwg aW5kKSwgIU5JTFAgKHBvcykpCisgICAgICBib3VuZGFyeV9ib3QgPSBYQ0RSIChwb3MpOworICAg IGlmIChwb3MgPSBtY19hc3NxIChRdXAsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgYXJyb3df dG9wID0gWENEUiAocG9zKTsKKyAgICBpZiAocG9zID0gbWNfYXNzcSAoUWRvd24sIGluZCksICFO SUxQIChwb3MpKQorICAgICAgYXJyb3dfYm90ID0gWENEUiAocG9zKTsKKyAgfQorICAgICAgZWxz ZQorICAgICAgICAvKiBBbnl0aGluZyBlbHNlIG1lYW5zIGJvdW5kYXJ5IG9uIGxlZnQgYW5kIG5v IGFycm93cy4gICovCisgICAgICAgIGJvdW5kYXJ5X3RvcCA9IGJvdW5kYXJ5X2JvdCA9IFFsZWZ0 OworICAgIH0KKyAgdG9wX2luZF9ybiA9IGJvdF9pbmRfcm4gPSAtMTsKKyAgaWYgKCFOSUxQIChp bmQpKQorICAgIHsKKyAgICAgIGZvciAoeSA9IHctPnZzY3JvbGwsIHJuID0gMDsKKyAgICAgeSA8 IHliICYmIHJuIDwgbnJvd3M7CisgICAgIHkgKz0gcm93LT5oZWlnaHQsICsrcm4pCisgIHsKKyAg ICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJuOworICAgIGlmICghcm93LT5lbmFi bGVkX3ApCisgICAgICByb3cgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICAgIHJv dy0+aW5kaWNhdGVfYm9iX3AgPSByb3ctPmluZGljYXRlX3RvcF9saW5lX3AgPSAwOworICAgIHJv dy0+aW5kaWNhdGVfZW9iX3AgPSByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgPSAwOworICAg IGlmICghcm93LT5tb2RlX2xpbmVfcCkKKyAgICAgIHsKKyAgICAgICAgaWYgKHRvcF9pbmRfcm4g PCAwICYmIHJvdy0+dmlzaWJsZV9oZWlnaHQgPiAwKQorICAgIHsKKyAgICAgIGlmIChNQVRSSVhf Uk9XX1NUQVJUX0NIQVJQT1MgKHJvdykgPD0gQlVGX0JFR1YgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSkKKyAgICAgICAgICAmJiAhTUFUUklYX1JPV19QQVJUSUFMTFlfVklTSUJMRV9BVF9UT1BfUCAo dywgcm93KSkKKyAgICAgICAgcm93LT5pbmRpY2F0ZV9ib2JfcCA9ICFOSUxQIChib3VuZGFyeV90 b3ApOworICAgICAgZWxzZQorICAgICAgICByb3ctPmluZGljYXRlX3RvcF9saW5lX3AgPSAhTklM UCAoYXJyb3dfdG9wKTsKKyAgICAgIHRvcF9pbmRfcm4gPSBybjsKKyAgICB9CisgICAgICAgIGlm IChib3RfaW5kX3JuIDwgMCkKKyAgICB7CisgICAgICBpZiAoTUFUUklYX1JPV19FTkRfQ0hBUlBP UyAocm93KSA+PSBCVUZfWlYgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSkKKyAgICAgICAgICAmJiAh TUFUUklYX1JPV19QQVJUSUFMTFlfVklTSUJMRV9BVF9CT1RUT01fUCAodywgcm93KSkKKyAgICAg ICAgcm93LT5pbmRpY2F0ZV9lb2JfcCA9ICFOSUxQIChib3VuZGFyeV9ib3QpLCBib3RfaW5kX3Ju ID0gcm47CisgICAgICBlbHNlIGlmICh5ICsgcm93LT5oZWlnaHQgPj0geWIpCisgICAgICAgIHJv dy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCA9ICFOSUxQIChhcnJvd19ib3QpLCBib3RfaW5kX3Ju ID0gcm47CisgICAgfQorICAgICAgfQorICB9CisgICAgfQorICBlbXB0eV9wb3MgPSBCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGluZGljYXRlX2VtcHR5X2xpbmVzKTsKKyAgaWYgKCFOSUxQ IChlbXB0eV9wb3MpICYmICFFUSAoZW1wdHlfcG9zLCBRcmlnaHQpKQorICAgIGVtcHR5X3BvcyA9 IFdJTkRPV19MRUZUX0ZSSU5HRV9XSURUSCAodykgPT0gMCA/IFFyaWdodCA6IFFsZWZ0OworICBm b3IgKHkgPSAwOyB5IDwgTUFYX0JJVE1BUF9DQUNIRTsgeSsrKQorICAgIGJpdG1hcF9jYWNoZVt5 XSA9IC0xOworI2RlZmluZSBMRUZUX0ZSSU5HRShjYWNoZSwgd2hpY2gsIHBhcnRpYWxfcCkgICAg ICBcCisgIChiaXRtYXBfY2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yAgICAgICAgaW50IHRvcF9pbmRfbWF4X3k7CisgICAgICAgIHRvcF9pbmRfbWluX3kg PSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgICAgdG9wX2luZF9tYXhfeSA9 IHRvcF9pbmRfbWluX3kgKyBmYi0+aGVpZ2h0OworICAgICAgICBpZiAodG9wX2luZF9tYXhfeSA+ IHliKQorICAgIHRvcF9pbmRfbWF4X3kgPSB5YjsKKyAgICAgICAgZm9yICh5ID0gcm93LT55ICsg cm93LT5oZWlnaHQsIHJuID0gdG9wX2luZF9ybiArIDE7CisgICAgICAgeSA8IHRvcF9pbmRfbWF4 X3kgJiYgcm4gPCBucm93czsKKyAgICAgICB5ICs9IHJvdzEtPmhlaWdodCwgcm4rKykKKyAgICB7 CisgICAgICBpZiAoYm90X2luZF9ybiA+PSAwICYmIHJuID49IGJvdF9pbmRfcm4pCisgICAgICAg IGJyZWFrOworICAgICAgcm93MSA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm47CisgICAg ICBpZiAoIXJvdzEtPmVuYWJsZWRfcCkKKyAgICAgICAgcm93MSA9IHctPmN1cnJlbnRfbWF0cml4 LT5yb3dzICsgcm47CisgICAgICByb3cxLT5pbmRpY2F0ZV9ib2JfcCA9IHJvdy0+aW5kaWNhdGVf Ym9iX3A7CisgICAgICByb3cxLT5pbmRpY2F0ZV90b3BfbGluZV9wID0gcm93LT5pbmRpY2F0ZV90 b3BfbGluZV9wOworICAgIH0KKyAgICAgIH0KKyAgfQorICAgIH0KKyAgaWYgKGJvdF9pbmRfcm4g Pj0gMCkKKyAgICB7CisgICAgICBpbnQgYm4gPSBOT19GUklOR0VfQklUTUFQOworICAgICAgcm93 ID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBib3RfaW5kX3JuOworICAgICAgaWYgKCFyb3ct PmVuYWJsZWRfcCkKKyAgcm93ID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBib3RfaW5kX3Ju OworICAgICAgYm90X3Jvd19lbmRzX2F0X3p2X3AgPSByb3ctPmVuZHNfYXRfenZfcDsKKyAgICAg IGlmIChyb3ctPmluZGljYXRlX2VvYl9wKQorICB7CisgICAgaWYgKEVRIChib3VuZGFyeV9ib3Qs IFFsZWZ0KSkKKyAgICAgIGJuID0gTEVGVF9GUklOR0UgKDMsIFFib3R0b20sIHJvdy0+ZW5kc19h dF96dl9wKTsKKyAgICBlbHNlCisgICAgICBibiA9IFJJR0hUX0ZSSU5HRSAoMywgUWJvdHRvbSwg cm93LT5lbmRzX2F0X3p2X3ApOworICB9CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2Jv dHRvbV9saW5lX3ApCisgIHsKKyAgICBpZiAoRVEgKGFycm93X2JvdCwgUWxlZnQpKQorICAgICAg Ym4gPSBMRUZUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgIGVsc2UKKyAgICAgIGJuID0gUklH SFRfRlJJTkdFICg3LCBRZG93biwgMCk7CisgIH0KKyAgICAgIGlmIChibiAhPSBOT19GUklOR0Vf QklUTUFQKQorICB7CisgICAgc3RydWN0IGZyaW5nZV9iaXRtYXAgKmZiID0gZ2V0X2ZyaW5nZV9i aXRtYXBfZGF0YSAoYm4pOworICAgIGlmIChmYi0+YWxpZ24gPT0gQUxJR05fQklUTUFQX0JPVFRP TSAmJiBmYi0+cGVyaW9kID09IDApCisgICAgICB7CisgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cg KnJvdzE7CisgICAgICAgIGludCBib3RfaW5kX21pbl95OworICAgICAgICBib3RfaW5kX21heF95 ID0gcm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdodDsKKyAgICAgICAgYm90X2luZF9taW5feSA9 IGJvdF9pbmRfbWF4X3kgLSBmYi0+aGVpZ2h0OworICAgICAgICBpZiAoYm90X2luZF9taW5feSA8 IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpKQorICAgIGJvdF9pbmRfbWluX3kgPSBXSU5E T1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgICAgZm9yICh5ID0gcm93LT55LCBybiA9 IGJvdF9pbmRfcm4gLSAxOworICAgICAgIHkgPj0gYm90X2luZF9taW5feSAmJiBybiA+PSAwOwor ICAgICAgIHkgLT0gcm93MS0+aGVpZ2h0LCBybi0tKQorICAgIHsKKyAgICAgIGlmICh0b3BfaW5k X3JuID49IDAgJiYgcm4gPD0gdG9wX2luZF9ybikKKyAgICAgICAgYnJlYWs7CisgICAgICByb3cx ID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAgIGlmICghcm93MS0+ZW5hYmxl ZF9wKQorICAgICAgICByb3cxID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAg IHJvdzEtPmluZGljYXRlX2VvYl9wID0gcm93LT5pbmRpY2F0ZV9lb2JfcDsKKyAgICAgIHJvdzEt PmluZGljYXRlX2JvdHRvbV9saW5lX3AgPSByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3A7Cisg ICAgfQorICAgICAgfQorICB9CisgICAgfQorICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50 czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYpOworICBib29sIGF1dG9faHNjcm9sbF9tb2RlX3AgPSBF USAoRmJ1ZmZlcl9sb2NhbF92YWx1ZSAoUWF1dG9faHNjcm9sbF9tb2RlLCBidWYpLCBRY3VycmVu dF9saW5lKTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwtbGVmdCA1KSAqLworICBib29sIGhzY2xf YWxsX3RlbXBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9o c2Nyb2xsID09IDApOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBub3RoaW5nLiAq LworICBib29sIGhzY2xfYWxsX3Blcm1fMF9wID0gKHctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBD LXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyBlbHNlIGJlc2lkZXMgaG9yaXpvbnRhbGx5IHNjcm9s bGluZyB0aGUKKyAgICAgICAgICAgICAgIGN1cnJlbnQgbGluZSBkaWZmZXJlbnRseS4KKyAgICAg ICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlm ZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8xX3AgPSAoIXctPnN1c3BlbmRfYXV0 b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21v ZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9sbCk7CisgIC8q IEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIC4uLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5l IGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4gKi8KKyAgYm9vbCBo c2NsX2FsbF9wZXJtXzJfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA9PSAwCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxl ZnQgNSk7IGFuZCwgdGhlbiBwcmVzcyB0aGUgbGVmdCBhcnJvdyBrZXkgb25lIHRpbWUuCisgICAg ICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVy ZW50bHkuKi8KKyAgYm9vbCBoc2NsX3RlbXBfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwK KyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gc29t ZXRoaW5nIHRoYXQgY2F1c2VzIHRoZSBjdXJyZW50IGxpbmUgdG8gYmUKKyAgICAgICAgICAgICAg IGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJl bnQgbGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS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obWNf bnRoICgyLCBmb3VydGVlbl9lbGVtZW50cykpOworICAgICAgICBmeSA9IFhGSVhOVU0gKG1jX250 aCAoMywgZm91cnRlZW5fZWxlbWVudHMpKTsKKyAgICAgICAgaHBvcyA9IFhGSVhOVU0gKG1jX250 aCAoNCwgZm91cnRlZW5fZWxlbWVudHMpKTsKKyAgICAgICAgdnBvcyA9IFhGSVhOVU0gKG1jX250 aCAoNSwgZm91cnRlZW5fZWxlbWVudHMpKTsKKyAgICAgICAgd2QgPSBYRklYTlVNIChtY19udGgg KDYsIGZvdXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICAgIGggPSBYRklYTlVNIChtY19udGggKDcs IGZvdXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19j dXJzb3JfdHlwZSAobWNfbnRoICg4LCBmb3VydGVlbl9lbGVtZW50cykpOworICAgICAgICBjdXJz b3Jfd2lkdGggPSBYRklYTlVNIChtY19udGggKDksIGZvdXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAg ICAgIGZvcmVncm91bmQgPSBtY19udGggKDEwLCBmb3VydGVlbl9lbGVtZW50cyk7CisgICAgICAg IGJhY2tncm91bmQgPSBtY19udGggKDExLCBmb3VydGVlbl9lbGVtZW50cyk7CisgICAgICAgIGFj dGl2ZV9wID0gWEZJWE5VTSAobWNfbnRoICgxMiwgZm91cnRlZW5fZWxlbWVudHMpKTsKKyAgICAg ICAgZ2x5cGhfZmxhdm9yID0gWEZJWE5VTSAobWNfbnRoICgxMywgZm91cnRlZW5fZWxlbWVudHMp KTsKKyAgICAgICAgaWYgKCh2cG9zID09IHZwb3NfZGVzaXJlZCB8fCB2cG9zID09IHZwb3NfY3Vy cmVudCkKKyAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FSUk9XX0JJ VE1BUAorICAgICAgICAgICAgJiYgIWhzY2xfYWxsX3RlbXBfcAorICAgICAgICAgICAgJiYgIWhz Y2xfdGVtcF9wCisgICAgICAgICAgICAmJiAhaHNjbF9wZXJtX3AKKyAgICAgICAgICAgICYmICFo c2NsX2FsbF9wZXJtXzBfcAorICAgICAgICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMV9wCisgICAg ICAgICAgICAmJiAhaHNjbF9hbGxfcGVybV8yX3ApCisgICAgICAgICAgeworICAgICAgICAgICAg ZW51bSBmYWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgICAgICghYWN0 aXZlX3AKKyAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRf ZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWluYWN0aXZlLWZhY2UiKSwgdHJ1 ZSkKKyAgICAgICAgICAgICAgOiAoYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgPyBsb29rdXBf bmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWZhY2UiKSwgdHJ1ZSkK KyAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgICBtY19sZWZ0X2Zy aW5nZV9mYWNlX2lkID0gKGN1cnNvcl90eXBlID09IExFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBvdmVybGF5X2Fycm93X2ZhY2VfaWQK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7 CisgICAgICAgICAgICBpZiAody0+aHNjcm9sbCAhPSAwKQorICAgICAgICAgICAgICBmcmluZ2Vf Yml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJv dyIpLCBmYWxzZSwgdHJ1ZSk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBm cmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3Zlcmxh eS1hcnJvdyIpLCB0cnVlLCB0cnVlKTsKKyAgICAgICAgICAgIG1jX2xlZnRfZnJpbmdlX2JpdG1h cCA9IChjdXJzb3JfdHlwZSA9PSBMRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBmcmluZ2VfYml0bWFwCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBOT19GUklOR0VfQklUTUFQOworICAgICAgICAgIH0KKyAgICAg ICAgICBlbHNlIGlmICgodnBvcyA9PSB2cG9zX2Rlc2lyZWQgfHwgdnBvcyA9PSB2cG9zX2N1cnJl bnQpCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yID09IE1DX09WRVJMQVlfQVJS T1dfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgKGhzY2xfYWxsX3RlbXBfcAorICAgICAg ICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzBfcAorICAgICAgICAgICAgICAgICAg ICAgICB8fCBoc2NsX2FsbF9wZXJtXzFfcAorICAgICAgICAgICAgICAgICAgICAgICB8fCBoc2Ns X2FsbF9wZXJtXzJfcAorICAgICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX3RlbXBfcAorICAg ICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX3Blcm1fcCkpCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQgPQorICAgICAgICAg ICAgICAgICghYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVfd2luZG93cykpKQorICAgICAgICAgICAgICAg ID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2Ns LWluYWN0aXZlLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChhY3RpdmVfcCkKKyAg ICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3Zl cmxheS1hcnJvdy1oc2NsLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IERFRkFVTFRf RkFDRV9JRDsKKyAgICAgICAgICAgICAgbWNfbGVmdF9mcmluZ2VfZmFjZV9pZCA9IChjdXJzb3Jf dHlwZSA9PSBMRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBvdmVybGF5X2Fycm93X2ZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICAgICAgaWYg KGhzY2xfYWxsX3Blcm1fMF9wKQorICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19n ZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIGZhbHNl KTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF9wZXJtXzFfcCkKKyAgICAgICAg ICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJu ICgiKy1oc2NsLXBlcm0iKSwgdHJ1ZSwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgZWxzZSBp ZiAoaHNjbF9hbGxfcGVybV8yX3ApCisgICAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAg PSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2Us IHRydWUpOworICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX3Blcm1fcCkKKyAgICAg ICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcs IGludGVybiAoIistaHNjbC1wZXJtIiksIHRydWUsIHRydWUpOworICAgICAgICAgICAgICAgICAg ICAgIGVsc2UgaWYgKGhzY2xfYWxsX3RlbXBfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgIGZy aW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXRl bXAiKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhz Y2xfdGVtcF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNf Z2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC10ZW1wIiksIHRydWUsIGZhbHNl KTsKKyAgICAgICAgICAgICAgbWNfbGVmdF9mcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09 IExFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBOT19GUklOR0VfQklUTUFQOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBp ZiAoKHZwb3MgPT0gdnBvc19kZXNpcmVkIHx8IHZwb3MgPT0gdnBvc19jdXJyZW50KQorICAgICAg ICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9S SUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICB8fGdseXBoX2ZsYXZvciA9PSBN Q19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAgICAgICAgICAgICAgICAgIHx8Z2x5cGhfZmxh dm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAg ICAgICB8fGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgfHxnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkpCisg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBiaXRtYXBfZmxhdm9y ID0gKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVj dGFuZ2xlX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19yZWN0YW5n bGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhf Zmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJy b3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhf Zmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JB Ul9CQUNLU0xBU0gpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBRbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IFFuaWw7CisgICAgICAgICAgICAgICAgbWNfcmlnaHRfZnJp bmdlX2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9PSBSSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBfZnJpbmdlX2JpdG1h cCAoYml0bWFwX2ZsYXZvcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICAgICAgICBtY19yaWdodF9mcmluZ2Vf ZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBSSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVybiAoIistdmVydGljYWwtYmFyLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAg ICAgICAgfQorICAgICAgICAgIH0KKyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgIHJvdyA9 IGN1cjsKKyAgICAgIGxlZnRfZmFjZV9pZCA9IHJpZ2h0X2ZhY2VfaWQgPSBERUZBV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x LCBRdG9wX2JvdHRvbSwgdG9wX3Jvd19lbmRzX2F0X3p2X3ApCisgICAgICAgOiBSSUdIVF9GUklO R0UgKDIsIFF0b3AsIDApKTsKKyAgICBpZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAgcmln aHRfb2Zmc2V0ID0gdG9wX2luZF9taW5feSAtIHJvdy0+eTsKKyAgfQorICAgICAgZWxzZSBpZiAo cm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICB7Cisg ICAgcmlnaHQgPSBSSUdIVF9GUklOR0UgKDMsIFFib3R0b20sIGJvdF9yb3dfZW5kc19hdF96dl9w KTsKKyAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAgICAgcmlnaHRfb2Zmc2V0ID0gYm90 X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgfQorICAgICAg ZWxzZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAg IHx8IChyb3ctPnJldmVyc2VkX3AgJiYgTUFUUklYX1JPV19DT05USU5VQVRJT05fTElORV9QIChy b3cpKSkKKyAgcmlnaHQgPSBSSUdIVF9GUklOR0UgKDQsIFFjb250aW51YXRpb24sIDApOworICAg ICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGluZV9wICYmIEVRIChhcnJvd190b3AsIFFy aWdodCkpCisgIHsKKyAgICByaWdodCA9IFJJR0hUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICBp ZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2luZF9taW5f eSAtIHJvdy0+eTsKKyAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9ib3R0b21fbGlu ZV9wICYmIEVRIChhcnJvd19ib3QsIFFyaWdodCkpCisgIHsKKyA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ICAgaWYgKG1jX2xl ZnRfZnJpbmdlX2JpdG1hcCAhPSBOT19GUklOR0VfQklUTUFQKQorICAgICAgICAgIGN1ci0+bGVm dF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBjdXItPmxl ZnRfZnJpbmdlX29mZnNldCA9IGxlZnRfb2Zmc2V0OworICAgICAgICBpZiAobWNfcmlnaHRfZnJp bmdlX2JpdG1hcCAhPSBOT19GUklOR0VfQklUTUFQKQorICAgICAgICAgIGN1ci0+cmlnaHRfZnJp bmdlX2JpdG1hcCA9IG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfYml0bWFwID0gcmlnaHQ7CisgICAgICAgIGlmICht Y19yaWdodF9mcmluZ2VfYml0bWFwICE9IE5PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgY3Vy LT5yaWdodF9mcmluZ2VfZmFjZV9pZCA9IG1jX3JpZ2h0X2ZyaW5nZV9mYWNlX2lkOworICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQgPSByaWdodF9m YWNlX2lkOworICAgICAgICBpZiAobWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBOT19GUklOR0Vf QklUTUFQKQorICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2Vfb2Zmc2V0ID0gcmlnaHRfb2Zm c2V0OworICAgICAgfQorICB9CisgICAgICBpZiAocm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCA8 IDApCisgIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgPSBnZXRfbG9naWNhbF9mcmluZ2VfYml0 bWFwICh3LCBRb3ZlcmxheV9hcnJvdywgMCw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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogI2RlZmluZSBOT19GUklOR0VfQklUTUFQIDAKICNkZWZpbmUg VU5ERUZfRlJJTkdFX0JJVE1BUCAxCiAjZGVmaW5lIE1BWF9TVEFOREFSRF9GUklOR0VfQklUTUFQ UyBBUlJBWUVMVFMgKHN0YW5kYXJkX2JpdG1hcHMpCkBAIC04MjcsNiArMTg0MiwyMSBAQCBkcmF3 X2ZyaW5nZV9iaXRtYXAgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywg aW50IGxlZnRfcCkKIAogICAgICAgc3dpdGNoICh3LT5waHlzX2N1cnNvcl90eXBlKQogCXsKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworCWNh c2UgRlJBTUVEX0JPWF9DVVJTT1I6CisJICBpZiAocm93LT52aXNpYmxlX2hlaWdodCA+PSBTVEFO REFSRF9CSVRNQVBfSEVJR0hUIChob2xsb3dfcmVjdGFuZ2xlX2JpdHMpKQorCSAgICBjdXJzb3Ig PSBRaG9sbG93OworCSAgZWxzZQorCSAgICBjdXJzb3IgPSBRaG9sbG93X3NtYWxsOworCSAgYnJl YWs7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAljYXNlIEhPTExPV19CT1hfQ1VS U09SOgogCSAgaWYgKHJvdy0+dmlzaWJsZV9oZWlnaHQgPj0gU1RBTkRBUkRfQklUTUFQX0hFSUdI VCAoaG9sbG93X3JlY3RhbmdsZV9iaXRzKSkKIAkgICAgY3Vyc29yID0gUWhvbGxvdzsKQEAgLTE3 MjQsNiArMjc1NCwxNTAgQEAgSWYgbmlsLCBhbH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3duLCAiKy1xdWFkcnVwbGUtYW5nbGUtZG93biIpOworICBWZnJp bmdlX2JpdG1hcHMgPSBGY29ucyAoUW1jX3F1YWRydXBsZV9hbmdsZV9kb3duLCBWZnJpbmdlX2Jp dG1hcHMpOworICBGcHV0IChRbWNfcXVhZHJ1cGxlX2FuZ2xlX2Rvd24sIFFmcmluZ2UsIG1ha2Vf Zml4bnVtICg0NSkpOworICAvKiAoZ2V0ICcrLXF1YWRydXBsZS1hbmdsZS1kb3duICdmcmluZ2Up ID0+IDQ1ICovCisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiB9CiAKIC8qIEdhcmJhZ2UgY29sbGVjdGlvbiBob29rICovCmRpZmYgLS1n aXQgYS9zcmMvbnN0ZXJtLmggYi9zcmMvbnN0ZXJtLmgKaW5kZXggNzhjZTYwOC4uOGVmMGRmZSAx MDA2NDQKLS0tIGEvc3JjL25zdGVybS5oCisrKyBiL3NyYy9uc3Rlcm0uaApAQCAtNjYwLDYgKzY2 MCwxNiBAQCB0eXBlZGVmIGlkIGluc3RhbmNldHlwZTsKIAogQGludGVyZmFjZSBFbWFjc1Njcm9s bGVyIDogTlNTY3JvbGxlcgogICB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBOU1JlY3QgbWNfcmVjdGFuZ2xlOworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAgICBzdHJ1Y3Qgd2luZG93ICp3aW5kb3c7CiAgICBzdHJ1 Y3QgZnJhbWUgKmZyYW1lOwogICAgTlNSZXNwb25kZXIgKnByZXZSZXNwb25kZXI7CkBAIC02ODAs NiArNjkwLDE4IEBAIHR5cGVkZWYgaWQgaW5zdGFuY2V0eXBlOwogICAgaW50IGVtX3dob2xlOwog ICAgfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAq LworCistICh2b2lkKW1jX3NldF9yZWN0YW5nbGU6IChOU1JlY3QpcmVjdDsKKy0gKE5TUmVjdClt Y19nZXRfcmVjdGFuZ2xlOworLSAoc3RydWN0IHdpbmRvdyAqKW1jX2dldF93aW5kb3c7CistIChi b29sKW1jX2p1ZGdlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAtIChpbnN0YW5j ZXR5cGUpIGluaXRGcmFtZTogKE5TUmVjdCApciB3aW5kb3c6IChMaXNwX09iamVjdCl3aW47CiAt ICh2b2lkKXNldEZyYW1lOiAoTlNSZWN0KXI7CiAKZGlmZiAtLWdpdCBhL3NyYy9uc3Rlcm0ubSBi L3NyYy9uc3Rlcm0ubQppbmRleCA4MWQzNmJlLi41YmJiZjllIDEwMDY0NAotLS0gYS9zcmMvbnN0 ZXJtLm0KKysrIGIvc3JjL25zdGVybS5tCkBAIC03Niw2ICs3NiwxMDQ4IEBAIFVwZGF0ZWQgYnkg Q2hyaXN0aWFuIExpbXBhY2ggKGNocmlzQG5pY2UuY2gpCiBzdGF0aWMgRW1hY3NNZW51ICptYWlu TWVudTsKICNlbmRpZgogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVM VElQTEUtQ1VSU09SUyAqLworCitzdGF0aWMgdm9pZCBuc19yZXNldF9jb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gorICAgLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KK3sKKyAgTlNUUkFDRV9XSEVOIChOU1RSQUNFX0dST1VQX0ZPQ1VTLCAibWNfbnNfY2xp cF90b19yZWN0Iik7CisgIGlmIChyKQorICAgIHsKKyAgICAgIE5TVFJBQ0VfUkVDVCAoInIiLCAq cik7CisgICAgICBpZiAoW05TVmlldyBmb2N1c1ZpZXddID09IEZSQU1FX05TX1ZJRVcgKGYpKQor ICAgICAgICB7CisgICAgICAgICAgW1tOU0dyYXBoaWNzQ29udGV4dCBjdXJyZW50Q29udGV4dF0g c2F2ZUdyYXBoaWNzU3RhdGVdOworICAgICAgICAgIGlmIChuID09IDIpCisgICAgICAgICAgICBO U1JlY3RDbGlwTGlzdCAociwgMik7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICBpZiAocm93LT5jbGlwICE9IE5VTEwpCisgICAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgIE5TUmVjdCByX2NsaXA7CisgICAgICAgICAgICAgICAg ICAgIHJfY2xpcC5vcmlnaW4ueCA9IHJvdy0+Y2xpcC0+eDsKKyAgICAgICAgICAgICAgICAgICAg cl9jbGlwLm9yaWdpbi55ID0gcm93LT5jbGlwLT55OworICAgICAgICAgICAgICAgICAgICByX2Ns aXAuc2l6ZS53aWR0aCA9IHJvdy0+Y2xpcC0+d2lkdGg7CisgICAgICAgICAgICAgICAgICAgIHJf Y2xpcC5zaXplLmhlaWdodCA9IHJvdy0+Y2xpcC0+aGVpZ2h0OworICAgICAgICAgICAgICAgICAg ICBOU1JlY3Qgcl9zYXZlOworICAgICAgICAgICAgICAgICAgICByX3NhdmUub3JpZ2luLnggPSBy WzBdLm9yaWdpbi54OworICAgICAgICAgICAgICAgICAgICByX3NhdmUub3JpZ2luLnkgPSByWzBd Lm9yaWdpbi55OworICAgICAgICAgICAgICAgICAgICByX3NhdmUuc2l6ZS53aWR0aCA9IHJbMF0u c2l6ZS53aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgcl9zYXZlLnNpemUuaGVpZ2h0ID0gclsw XS5zaXplLmhlaWdodDsKKyAgICAgICAgICAgICAgICAgICAgbWNfbnNfaW50ZXJzZWN0X3JlY3Rh bmdsZXMgKCZyX3NhdmUsICZyX2NsaXAsICZyWzBdKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICBOU1JlY3RDbGlwICgqcik7CisgICAgICAgICAgICAgIH0KKyAgICAgICAg ICByZXR1cm4gWUVTOworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAg ICBOU1ZpZXcgKnZpZXcgPSBGUkFNRV9OU19WSUVXIChmKTsKKyAgICAgICAgICBpbnQgaTsKKyAg ICAgICAgICBmb3IgKGkgPSAwIDsgaSA8IG4gOyBpKyspCisgICAgICAgICAgICBbdmlldyBzZXRO ZWVkc0Rpc3BsYXlJblJlY3Q6cltpXV07CisgICAgICAgIH0KKyAgICB9CisgIHJldHVybiBOTzsK K30KKworc3RhdGljIHZvaWQKK21jX25zX2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0IHdpbmRv dyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cs CisgICAgICAgICAgICAgICAgICBpbnQgeCwgaW50IGZ4LCBpbnQgeSwgaW50IGZ5LCBpbnQgaHBv cywgaW50IHZwb3MsIGludCB3ZCwgaW50IGgsCisgICAgICAgICAgICAgICAgICBkb3VibGUgcmVk LCBkb3VibGUgZ3JlZW4sIGRvdWJsZSBibHVlLCBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIGN1cnNv cl90eXBlLAorICAgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCwgZW51bSBtY19mbGF2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TREFUQSAoZm9yZWdyb3VuZCkgOiAiTklMUCIpLAorICAgICAgICAgICAgICAgICAg ICAgICghTklMUCAoYmFja2dyb3VuZCkgPyBTU0RBVEEgKGJhY2tncm91bmQpIDogIk5JTFAiKSk7 CisgIC0gIEVYQU1QTEUgT0YgSE9XIFRPIENSRUFURSBBIENPTE9SIFdJVEggUkdCL0xTTCBmbG9h dCB2YWx1ZXM6CisgICAgIE5TQ29sb3IgKm15X2NvbG9yID0gW05TQ29sb3IgY29sb3JXaXRoQ2Fs aWJyYXRlZFJlZDogMS4wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBncmVlbjogMS4wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgYmx1ZTogMS4wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBhbHBoYTogMS4wXTsKKyAgLSAgQUxURVJOQVRJVkUgRVhB TVBMRToKKyAgICAgZW51bSBmYWNlX2lkIGRlYnVnZ2luZ19mYWNlX2lkID0gbG9va3VwX25hbWVk X2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistZGVidWdnaW5nLWZhY2UiKSwgdHJ1ZSk7Cisg ICAgIHN0cnVjdCBmYWNlICpkZWJ1Z2dpbmdfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgZGVi dWdnaW5nX2ZhY2VfaWQpOworICAgICBOU0NvbG9yICpjb2xvciA9IG5zX2xvb2t1cF9pbmRleGVk X2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGRlYnVnZ2luZ19mYWNlKSwgcy0+Zik7CisgICAg IFtjb2xvciBzZXRdOyAqLworICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBICisgICAgICB8 fCBnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTKQorICAgIFtbTlNDb2xvciBjb2xvcldpdGhD YWx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BkYXRlcyAoKTsKKyNlbmRpZgorICBzd2l0Y2ggKGN1cnNvcl90eXBl KQorICAgIHsKKyAgICAgIGNhc2UgUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgYnJlYWs7 CisgICAgICBjYXNlIExFRlRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgYnJlYWs7CisgICAgICBj YXNlIE5PX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBERUZBVUxU X0NVUlNPUjoKKyAgICAgIGNhc2UgTk9fQ1VSU09SOgorICAgICAgICBicmVhazsKKyAgICAgIGNh c2UgRklMTEVEX0JPWF9DVVJTT1I6CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBi cmVhazsKKyAgICAgIGNhc2UgRlJBTUVEX0JPWF9DVVJTT1I6CisgICAgICAgIE5TUmVjdEZpbGwg KHIpOworICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAgICAgIE5TUmVjdEZpbGwgKE5T SW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKGYpIHNl dF07CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBIT0xMT1dfQk9YX0NVUlNPUjoKKyAgICAg ICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAg TlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgW0ZSQU1FX0NVUlNP Ul9DT0xPUiAoZikgc2V0XTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIEhCQVJfQ1VSU09S OgorICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIEJB Ul9DVVJTT1I6CisgICAgICAgIHMgPSByOworICAgICAgICAvKiBAbGF3bGlzdCBpcyBmb2N1c2lu ZyB0aGUgaW5pdGlhbCBkZXZlbG9wbWVudCBvZiBmZWF0dXJlIHJlcXVlc3RzCisgICAgICAgICMx NzY4NCBhbmQgIzIyODczIG9uIEwyUiBsYW5ndWFnZXMuICovCisgICAgICAgIGlmIChnbHlwaF9m bGF2b3IgIT0gTUNfR0xZUEgKKyAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19HTFlQ SExFU1MpCisgICAgICAgICAgeworICAgICAgICAgICAgLyogSWYgdGhlIGNoYXJhY3RlciB1bmRl ciBjdXJzb3IgaXMgUjJMLCBkcmF3IHRoZSBiYXIgY3Vyc29yCisgICAgICAgICAgICAgICBvbiB0 aGUgcmlnaHQgb2YgaXRzIGdseXBoLCByYXRoZXIgdGhhbiBvbiB0aGUgbGVmdC4gICovCisgICAg ICAgICAgICBpZiAoKGN1cnNvcl9nbHlwaC0+cmVzb2x2ZWRfbGV2ZWwgJiAxKSAhPSAwKQorICAg ICAgICAgICAgICBzLm9yaWdpbi54ICs9IGN1cnNvcl9nbHlwaC0+cGl4ZWxfd2lkdGggLSBzLnNp emUud2lkdGg7CisgICAgICAgICAgfQorICAgICAgICBOU1JlY3RGaWxsIChzKTsKKyAgICAgICAg YnJlYWs7CisgICAgfQorICBuc19yZXNldF9jbGlwcGluZyAoZik7CisgIC8qIGRyYXcgdGhlIGNo YXJhY3RlciB1bmRlciB0aGUgY3Vyc29yICovCisgIGlmIChnbHlwaF9mbGF2b3IgIT0gTUNfR0xZ UEhMRVNTCisgICAgICAmJiAoY3Vyc29yX3R5cGUgPT0gRlJBTUVEX0JPWF9DVVJTT1IKKyAgICAg ICAgICB8fCBjdXJzb3JfdHlwZSA9PSBGSUxMRURfQk9YX0NVUlNPUgorICAgICAgICAgIHx8IGN1 cnNvcl90eXBlID09IEhPTExPV19CT1hfQ1VSU09SCisgICAgICAgICAgfHwgKGRlYnVnX3AKKyAg ICAgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gSEJBUl9DVVJTT1IpCisgICAgIC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S0tLS0tLS0gKi8KK3sKKyAgaWYgKHMtPmZvcl9vdmVybGFwcykK KyAgICByZXR1cm47CisgIC8qIERvIHVuZGVybGluZS4gKi8KKyAgaWYgKGZhY2UtPnVuZGVybGlu ZV9wKQorICAgIHsKKyAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VO REVSX1dBVkUpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoZmFjZS0+dW5kZXJsaW5lX2RlZmF1 bHRlZF9wKQorICAgICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAgICBlbHNlCisg ICAgICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZhY2UtPnVuZGVybGluZV9jb2xv ciwgcy0+Zikgc2V0XTsKKyAgICAgICAgICBuc19kcmF3X3VuZGVyd2F2ZSAocywgd2lkdGgsIHgp OworICAgICAgICB9CisgICAgICBlbHNlIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBG QUNFX1VOREVSX0xJTkUpCisgICAgICAgIHsKKyAgICAgICAgICBOU1JlY3QgcjsKKyAgICAgICAg ICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CisgICAgICAgICAgLyogSWYgdGhl IHByZXYgd2FzIHVuZGVybGluZWQsIG1hdGNoIGl0cyBhcHBlYXJhbmNlLiAqLworICAgICAgICAg IGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV9wCisgICAgICAgICAgICAg ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORQorICAg ICAgICAgICAgICAmJiBzLT5wcmV2LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+cHJldi0+dW5kZXJsaW5lX3RoaWNr bmVzczsKKyAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5wcmV2LT51bmRlcmxpbmVfcG9zaXRp b247CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBzdHJ1Y3QgZm9udCAqZm9udDsKKyAgICAgICAgICAgICAgdW5zaWduZWQgbG9uZyBk ZXNjZW50OworICAgICAgICAgICAgICBmb250PXMtPmZvbnQ7CisgICAgICAgICAgICAgIGRlc2Nl bnQgPSBzLT55ICsgcy0+aGVpZ2h0IC0gcy0+eWJhc2U7CisgICAgICAgICAgICAgIC8qIFVzZSB1 bmRlcmxpbmUgdGhpY2tuZXNzIG9mIGZvbnQsIGRlZmF1bHRpbmcgdG8gMS4gKi8KKyAgICAgICAg ICAgICAgdGhpY2tuZXNzID0gKGZvbnQgJiYgZm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDAp CisgICAgICAgICAgICAgICAgPyBmb250LT51bmRlcmxpbmVfdGhpY2tuZXNzIDogMTsKKyAgICAg ICAgICAgICAgLyogRGV0ZXJtaW5lIHRoZSBvZmZzZXQgb2YgdW5kZXJsaW5pbmcgZnJvbSB0aGUg YmFzZWxpbmUuICovCisgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50X2xp bmUpCisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNjZW50IC0gdGhpY2tuZXNzOworICAg ICAgICAgICAgICBlbHNlIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGllcwor ICAgICAgICAgICAgICAgICAgICAgICAmJiBmb250ICYmIGZvbnQtPnVuZGVybGluZV9wb3NpdGlv biA+PSAwKQorICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gZm9udC0+dW5kZXJsaW5lX3Bvc2l0 aW9uOworICAgICAgICAgICAgICBlbHNlIGlmIChmb250KQorICAgICAgICAgICAgICAgIHBvc2l0 aW9uID0gbHJvdW5kIChmb250LT5kZXNjZW50IC8gMik7CisgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICBwb3NpdGlvbiA9IHVuZGVybGluZV9taW5pbXVtX29mZnNldDsKKyAgICAg ICAgICAgICAgcG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWluaW11bV9vZmZz ZXQpOworICAgICAgICAgICAgICAvKiBFbnN1cmUgdW5kZXJsaW5pbmcgaXMgbm90IGNyb3BwZWQu ICovCisgICAgICAgICAgICAgIGlmIChkZXNjZW50IDw9IHBvc2l0aW9uKQorICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gZGVzY2VudCAtIDE7CisgICAgICAg ICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg ICAgZWxzZSBpZiAoZGVzY2VudCA8IHBvc2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAg ICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgcy0+dW5kZXJsaW5l X3RoaWNrbmVzcyA9IHRoaWNrbmVzczsKKyAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24g PSBwb3NpdGlvbjsKKyAgICAgICAgICByID0gTlNNYWtlUmVjdCAoeCwgcy0+eWJhc2UgKyBwb3Np dGlvbiwgd2lkdGgsIHRoaWNrbmVzcyk7CisgICAgICAgICAgaWYgKGZhY2UtPnVuZGVybGluZV9k ZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIFtkZWZhdWx0Q29sIHNldF07CisgICAgICAgICAgZWxz ZQorICAgICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChmYWNlLT51bmRlcmxpbmVf Y29sb3IsIHMtPmYpIHNldF07CisgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIH0K KyAgICB9CisgIC8qIERvIG92ZXJsaW5lLiBXZSBmb2xsb3cgb3RoZXIgdGVybXMgaW4gdXNpbmcg YSB0aGlja25lc3Mgb2YgMQorICAgICBhbmQgaWdub3Jpbmcgb3ZlcmxpbmVfbWFyZ2luLiAqLwor ICBpZiAoZmFjZS0+b3ZlcmxpbmVfcCkKKyAgICB7CisgICAgICBOU1JlY3QgcjsKKyAgICAgIHIg PSBOU01ha2VSZWN0ICh4LCBzLT55LCB3aWR0aCwgMSk7CisgICAgICBpZiAoZmFjZS0+b3Zlcmxp bmVfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICAgIFtkZWZhdWx0Q29sIHNldF07CisgICAgICBl bHNlCisgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoZmFjZS0+b3ZlcmxpbmVfY29s b3IsIHMtPmYpIHNldF07CisgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICB9CisgIC8qIERvIHN0 cmlrZS10aHJvdWdoLiAgV2UgZm9sbG93IG90aGVyIHRlcm1zIGZvciB0aGlja25lc3MgYW5kCisg ICAgIHZlcnRpY2FsIHBvc2l0aW9uLiovCisgIGlmIChmYWNlLT5zdHJpa2VfdGhyb3VnaF9wKQor ICAgIHsKKyAgICAgIE5TUmVjdCByOworICAgICAgdW5zaWduZWQgbG9uZyBkeTsKKyAgICAgIGR5 ID0gbHJpbnQgKChzLT5oZWlnaHQgLSAxKSAvIDIpOworICAgICAgciA9IE5TTWFrZVJlY3QgKHgs IHMtPnkgKyBkeSwgd2lkdGgsIDEpOworICAgICAgaWYgKGZhY2UtPnN0cmlrZV90aHJvdWdoX2Nv bG9yX2RlZmF1bHRlZF9wKQorICAgICAgICBbZGVmYXVsdENvbCBzZXRdOworICAgICAgZWxzZQor ICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZhY2UtPnN0cmlrZV90aHJvdWdoX2Nv bG9yLCBzLT5mKSBzZXRdOworICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgfQorfQorCitzdGF0 aWMgdm9pZAorbWNfbnNfZHVt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kgPSAwOyBpIDwgbjsg KytpKQorICAgICAgICB7CisgICAgICAgICAgaWYgKCFzLT5yb3ctPmZ1bGxfd2lkdGhfcCkKKyAg ICAgICAgICAgIHsKKyAgICAgICAgaW50IG92ZXJydW4sIGxlZnRvdmVycnVuOworICAgICAgICAg ICAgICAvKiB0cnVuY2F0ZSB0byBhdm9pZCBvdmVyd3JpdGluZyBmcmluZ2UgYW5kL29yIHNjcm9s bGJhciAqLworICAgICAgICBvdmVycnVuID0gbWF4ICgwLCAocy0+eCArIHMtPmJhY2tncm91bmRf d2lkdGgpCisgICAgICAgICAgIC0gKFdJTkRPV19CT1hfUklHSFRfRURHRV9YIChzLT53KQorICAg ICAgICAtIFdJTkRPV19SSUdIVF9GUklOR0VfV0lEVEggKHMtPncpKSk7CisgICAgICAgICAgICAg IHJbaV0uc2l6ZS53aWR0aCAtPSBvdmVycnVuOworICAgICAgICAvKiB0cnVuY2F0ZSB0byBhdm9p ZCBvdmVyd3JpdGluZyB0byBsZWZ0IG9mIHRoZSB3aW5kb3cgYm94ICovCisgICAgICAgIGxlZnRv dmVycnVuID0gKFdJTkRPV19CT1hfTEVGVF9FREdFX1ggKHMtPncpCisgICAgICAgICAgICsgV0lO RE9XX0xFRlRfRlJJTkdFX1dJRFRIIChzLT53KSkgLSBzLT54OworICAgICAgICBpZiAobGVmdG92 ZXJydW4gPiAwKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHJbaV0ub3JpZ2luLnggKz0gbGVm dG92ZXJydW47CisgICAgICAgICAgICByW2ldLnNpemUud2lkdGggLT0gbGVmdG92ZXJydW47Cisg ICAgICAgICAgfQorICAgICAgICAgICAgICAvKiBYWFg6IFRyeSB0byB3b3JrIGJldHdlZW4gcHJv YmxlbSB3aGVyZSBhIHN0cmV0Y2ggZ2x5cGggb24KKyAgICAgICAgICAgICAgICAgYSBwYXJ0aWFs bHktdmlzaWJsZSBib3R0b20gcm93IHdpbGwgY2xlYXIgcGFydCBvZiB0aGUKKyAgICAgICAgICAg ICAgICAgbW9kZWxpbmUsIGFuZCBhbm90aGVyIHdoZXJlIGxpc3QtYnVmZmVycyBoZWFkZXJzIGFu ZCBzaW1pbGFyCisgICAgICAgICAgICAgICAgIHJvd3MgZXJyb25lb3VzbHkgaGF2ZSB2aXNpYmxl X2hlaWdodCBzZXQgdG8gMC4gIE5vdCBzdXJlCisgICAgICAgICAgICAgICAgIHdoZXJlIHRoaXMg aXMgY29taW5nIGZyb20gYXMgb3RoZXIgdGVybXMgc2VlbSBub3QgdG8gc2hvdy4gKi8KKyAgICAg ICAgICAgICAgcltpXS5zaXplLmhlaWdodCA9IG1pbiAocy0+aGVpZ2h0LCBzLT5yb3ctPnZpc2li bGVfaGVpZ2h0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBbYmdDb2wgc2V0XTsKKyAgICAg ICAgICAvKiBOT1RFOiB1bmRlciBOUyB0aGlzIGlzIE5PVCB1c2VkIHRvIGRyYXcgY3Vyc29ycywg YnV0IHdlIG11c3QgYXZvaWQKKyAgICAgICAgICAgICBvdmVyd3JpdGluZyBjdXJzb3IgKHVzdWFs bHkgd2hlbiBjdXJzb3Igb24gYSB0YWIpICovCisgICAgICAgICAgaWYgKHMtPmhsID09IERSQVdf Q1VSU09SKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBGSVhNRTogIERvIHdlIHN0 aWxsIG5lZWQgdG8gcHJldmVudCB0aGlzIHNlY3Rpb24gb2YgY29kZSBmcm9tCisgICAgICAgICAg ICAgIGVyYXNpbmcgdGhlIGZha2UgSEJBUl9DVVJTT1IgdGhhdCBleHRlbmRzIHRoZSBlbnRpcmUg bGVuZ3RoIG9mIHRoZQorICAgICAgICAgICAgICBTVFJFVENIX0dMWVBIPyAgVGhpcyBtYXkgaGF2 ZSBiZWVuIGRvbmUgcHJpb3IgdG8gdGhlIGZpeCByZWxhdGluZworICAgICAgICAgICAgICB0byBs ZWZ0L3JpZ2h0IG92ZXJ3cml0dGVuIGdseXBocy4gKi8KKyAgICAgICAgICAgICAgcltpXS5zaXpl LmhlaWdodCAtPSAxOworICAgICAgICAgICAgICAvLyAgZW51bSBmYWNlX2lkIGRlYnVnZ2luZ19m YWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistZGVidWdn aW5nLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgIC8vICBzdHJ1Y3QgZmFjZSAqZGVidWdn aW5nX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGRlYnVnZ2luZ19mYWNlX2lkKTsKKyAgICAg ICAgICAgICAgLy8gIE5TQ29sb3IgKmNvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5T X0ZBQ0VfRk9SRUdST1VORCAoZGVidWdnaW5nX2ZhY2UpLCBzLT5mKTsKKyAgICAgICAgICAgICAg Ly8gIFtjb2xvciBzZXRdOworICAgICAgICAgICAgICBDR0Zsb2F0IHggPSByW2ldLm9yaWdpbi54 OworICAgICAgICAgICAgICBDR0Zsb2F0IHdpZHRoID0gd2Q7CisgICAgICAgICAgICAgIHJbaV0u c2l6ZS53aWR0aCAtPSB3aWR0aDsKKyAgICAgICAgICAgICAgcltpXS5vcmlnaW4ueCArPSB3aWR0 aDsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocltpXSk7CisgICAgICAgICAgICAgIC8qIERy YXcgb3ZlcmxpbmluZywgZXRjLiBvbiB0aGUgY3Vyc29yLiAqLworICAgICAgICAgICAgICBpZiAo cy0+dy0+cGh5c19jdXJzb3JfdHlwZSA9PSBGSUxMRURfQk9YX0NVUlNPUikKKyAgICAgICAgICAg ICAgICBtY19uc19kcmF3X3RleHRfZGVjb3JhdGlvbiAocywgZmFjZSwgYmdDb2wsIHdpZHRoLCB4 KTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBtY19uc19kcmF3X3Rl eHRfZGVjb3JhdGlvbiAocywgZmFjZSwgZmdDb2wsIHdpZHRoLCB4KTsKKyAgICAgICAgICAgIH0K KyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgIC8vICBpbnQgcnggPSByW2ldLm9yaWdp bi54OworICAvLyAgaW50IHJ5ID0gcltpXS5vcmlnaW4ueTsKKyAgLy8gIGludCBydyA9IHJbaV0u c2l6ZS53aWR0aDsKKyAgLy8gIGludCByaCA9IHJbaV0uc2l6ZS5oZWlnaHQ7CisgIC8vICBmcHJp bnRmIChzdGRlcnIsICJtY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2g6ICB2cG9zICglZCkgfCByeCAo JWQpIHwgcnkgKCVkKSB8IHJ3ICglZCkgfCByaCAoJWQpXG4iLAorICAvLyAgICAgICAgICAgICAg ICAgICBzLT5maXJzdF9nbHlwaC0+dnBvcywgcngsIHJ5LCBydywgcmgpOworICAgICAgICAgICAg ICBOU1JlY3RGaWxsIChyW2ldKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAvKiBEcmF3IG92 ZXJsaW5pbmcsIGV0Yy4gb24gdGhlIHN0cmV0Y2ggZ2x5cGggKG9yIHRoZSBwYXJ0CisgICAgICAg ICAgICAgb2YgdGhlIHN0cmV0Y2ggZ2x5cGggYWZ0ZXIgdGhlIGN1cnNvcikuICovCisgICAgICAg ICAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHMsIGZhY2UsIGZnQ29sLCByW2ldLnNpemUu d2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJbaV0ub3JpZ2lu LngpOworICAgICAgICB9CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBz LT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gMTsKKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkCittY19u c19kdW1wZ2x5cGhzX2ltYWdlIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzLCBOU1JlY3QgciwgZG91 YmxlIHJlZCwgZ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sb29rdXBfaW5kZXhlZF9jb2xv ciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNlKSwgcy0+Zik7CisgICAgfQorICAvKiBEcmF3IHVu ZGVybGluZSwgb3ZlcmxpbmUsIHN0cmlrZS10aHJvdWdoLiAqLworICBtY19uc19kcmF3X3RleHRf ZGVjb3JhdGlvbiAocywgZmFjZSwgdGRDb2wsIGJyLnNpemUud2lkdGgsIGJyLm9yaWdpbi54KTsK KyAgLyogRHJhdyByZWxpZWYsIGlmIHJlcXVlc3RlZCAqLworICBpZiAocy0+aW1nLT5yZWxpZWYg fHwgcy0+aGwgPT1EUkFXX0lNQUdFX1JBSVNFRCB8fCBzLT5obCA9PURSQVdfSU1BR0VfU1VOS0VO KQorICAgIHsKKyAgICAgIGlmIChzLT5obCA9PSBEUkFXX0lNQUdFX1NVTktFTiB8fCBzLT5obCA9 PSBEUkFXX0lNQUdFX1JBSVNFRCkKKyAgICAgICAgeworICAgICAgICAgIHRoID0gdG9vbF9iYXJf YnV0dG9uX3JlbGllZiA+PSAwID8KKyAgICAgICAgICAgIHRvb2xfYmFyX2J1dHRvbl9yZWxpZWYg OiBERUZBVUxUX1RPT0xfQkFSX0JVVFRPTl9SRUxJRUY7CisgICAgICAgICAgcmFpc2VkX3AgPSAo cy0+aGwgPT0gRFJBV19JTUFHRV9SQUlTRUQpOworICAgICAgICB9CisgICAgICBlbHNlCisgICAg ICAgIHsKKyAgICAgICAgICB0aCA9IGFicyAocy0+aW1nLT5yZWxpZWYpOworICAgICAgICAgIHJh aXNlZF9wID0gKHMtPmltZy0+cmVsaWVmID4gMCk7CisgICAgICAgIH0KKyAgICAgIHIub3JpZ2lu LnggPSB4IC0gdGg7CisgICAgICByLm9yaWdpbi55ID0geSAtIHRoOworICAgICAgci5zaXplLndp ZHRoID0gcy0+c2xpY2Uud2lkdGggKyAyKnRoLTE7CisgICAgICByLnNpemUuaGVpZ2h0ID0gcy0+ c2xpY2UuaGVpZ2h0ICsgMip0aC0xOworICAgICAgbnNfZHJhd19yZWxpZWYgKHIsIHRoLCByYWlz ZWRfcCwKKyAgICAgICAgICAgICAgICAgICAgICBzLT5zbGljZS55ID09IDAsCisgICAgICAgICAg ICAgICAgICAgICAgcy0+c2xpY2UueSArIHMtPnNsaWNlLmhlaWdodCA9PSBzLT5pbWctPmhlaWdo dCwKKyAgICAgICAgICAgICAgICAgICAgICBzLT5zbGljZS54ID09IDAsCisgICAgICAgICAgICAg ICAgICAgICAgcy0+c2xpY2UueCArIHMtPnNsaWNlLndpZHRoID09IHMtPmltZy0+d2lkdGgsIHMp OworICAgIH0KKyAgLyogSWYgdGhlcmUgaXMgbm8gbWFzaywgdGhlIGJhY2tncm91bmQgd29uJ3Qg YmUgc2VlbiwKKyAgICAgc28gZHJhdyBhIHJlY3RhbmdsZSBvbiB0aGUgaW1hZ2UgZm9yIHRoZSBj dXJzb3IuCisgICAgIERvIHRoaXMgZm9yIGFsbCBpbWFnZXMsIGdldHRpbmcgdHJhbnNwYXJlbmN5 IHJpZ2h0IGlzIG5vdCByZWxpYWJsZS4gICovCisgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikK KyAgICB7CisgICAgICBpbnQgdGhpY2tuZXNzID0gYWJzIChzLT5pbWctPnJlbGllZik7CisgICAg ICBpZiAodGhpY2tuZXNzID09IDApIHRoaWNrbmVzcyA9IDE7CisgICAgaWYgKGdseXBoX2ZsYXZv ciA9PSBNQ19HTFlQSAorICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTKQor ICAgICAgeworICAgICAgICBOU0NvbG9yICpib3JkZXJfY29sb3IgPSBbTlNDb2xvciBjb2xvcldp dGhDYWxpYnJhdGVkUmVkOiByZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBncmVlbjogZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogYmx1ZQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhh OiAxLjBdOworICAgICAgICBuc19kcmF3X2JveCAoYnIsIHRoaWNrbmVzcywgYm9yZGVyX2NvbG9y LCAxLCAxKTsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgICAgbnNfZHJhd19ib3ggKGJyLCB0 aGlja25lc3MsIEZSQU1FX0NVUlNPUl9DT0xPUiAocy0+ZiksIDEsIDEpOworICAgIH0KK30KKwor c3RhdGljIHZvaWQKK21jX25zX292ZXJ3cml0dGVuX2hlbHBlciAoc3RydWN0IGdseXBoX3N0cmlu ZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAg ICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGVudW0gdHlwZV9vZl9jYWNoZSBjYWNoZV90eXBl LAorICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoKQoreworICAv LyBuc19kcmF3X3VuZGVyd2F2ZSAocywgcy0+d2lkdGgsIHMtPngpOworICBOU0NvbG9yICpob2xs b3dfY29sb3IgPSBGUkFNRV9CQUNLR1JPVU5EX0NPTE9SIChzLT5mKTsKKyAgc3RydWN0IGZhY2Ug KmZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIERFRkFVTFRfRkFDRV9JRCk7CisgIC8qIFNUUkVU Q0hfR0xZUEggbWF5IGNvbnRhaW4gbW9yZSB0aGFuIG9uZSBmYWtlIGN1cnNvciBhdCB0aGUgc2Ft ZSBIUE9TLiAqLworICBmb3IgKExpc3BfT2JqZWN0IHZsaXN0ID0gbWNfaGl0X3AgKHMtPncsIG1h dHJpeCwgcm93LCBjYWNoZV90eXBlLCBnbHlwaCk7CisgICAgICAgQ09OU1AgKHZsaXN0KTsKKyAg ICAgICB2bGlzdCA9IFhDRFIgKHZsaX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5fZWxl bWVudHMpOworICAgICAgYm9vbCBhY3RpdmVfcCA9IFhGSVhOVU0gKG1jX250aCAoMTIsIGZvdXJ0 ZWVuX2VsZW1lbnRzKSk7CisgICAgICAvLyAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0g WEZJWE5VTSAobWNfbnRoICgxMywgZm91cnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIE5TUmVjdCBy OworICAgICAgci5vcmlnaW4ueCA9IGZ4OworICAgICAgci5vcmlnaW4ueSA9IGZ5OworICAgICAg ci5zaXplLmhlaWdodCA9IGg7CisgICAgICByLnNpemUud2lkdGggPSB3ZDsKKyAgICAgIGRvdWJs ZSB0ZW1wX3JlZCA9ICghTklMUCAoZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICAgICAg ICA/IFhGTE9BVF9EQVRBIChBUkVGIChmb3JlZ3JvdW5kLCAwKSkKKyAgICAgICAgICAgICAgICAg ICAgICAgIDogLTEuMDsKKyAgICAgIGRvdWJsZSB0ZW1wX2dyZWVuID0gKCFOSUxQIChmb3JlZ3Jv dW5kKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPyBYRkxPQVRfREFUQSAoQVJFRiAoZm9y ZWdyb3VuZCwgMSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgIDogLTEuMDsKKyAgICAgIGRv dWJsZSB0ZW1wX2JsdWUgPSAoIU5JTFAgKGZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAg ICAgICAgID8gWEZMT0FUX0RBVEEgKEFSRUYgKGZvcmVncm91bmQsIDIpKQorICAgICAgICAgICAg ICAgICAgICAgICAgIDogLTEuMDsKKyAgICAgIC8qIFNvbWUgb2YgdGhlc2UgdmFsdWVzIGNvbWUg dGhyb3VnaCBhcyAxLjAwMzkwNiwgd2hpY2ggY2F1c2VzIGEgYnJlYWthZ2UKKyAgICAgIG9mIHRo ZSBjb2xvcnMgaW4gdGhhdCBtdWx0aXBsaWNhdGlvbiBieSB0aGUgYmFzZSB3aWxsIGV4Y2VlZCB0 aGUgYmFzZS4gKi8KKyAgICAgIGRvdWJsZSByZWQgPSAodGVtcF9yZWQgPiAxLjApCisgICAgICAg ICAgICAgICAgICAgPyAxLjAKKyAgICAgICAgICAgICAgICAgICA6IHRlbXBfcmVkOworICAgICAg ZG91YmxlIGdyZWVuID0gKHRlbXBfZ3JlZW4gPiAxLjApCisgICAgICAgICAgICAgICAgICAgICA/ IDEuMAorICAgICAgICAgICAgICAgICAgICAgOiB0ZW1wX2dyZWVuOworICAgICAgZG91YmxlIGJs dWUgPSAodGVtcF9ibHVlID4gMS4wKQorICAgICAgICAgICAgICAgICAgICA/IDEuMAorICAgICAg ICAgICAgICAgICAgICA6IHRlbXBfYmx1ZTsKKyAgICAgIFtbTlNDb2xvciBjb2xvcldpdGhDYWxp YnJhdGVkUmVkOiByZWQgZ3JlZW46IGdyZWVuIGJsdWU6IGJsdWUgYWxwaGE6IDEuMF0gc2V0XTsK KyAgaWYgKGN1cnNvcl90eXBlID09IEZSQU1FRF9CT1hfQ1VSU09SKQorICAgIHsKKyAgICAgIExp c3BfT2JqZWN0IGJ1ZiA9IHMtPnctPmNvbnRlbnRzOworICAgICAgQ0hFQ0tfQlVGRkVSIChidWYp OworICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1Zik7CisgICAgICBib29sIHJl Z2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5zaWVudF9tYXJrX21vZGUpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWFya19hY3RpdmUpKSk7Cisg ICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZ2lubmluZyA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJ WE5VTSAoRnJlZ2lvbl9iZWdpbm5pbmcgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3QgcmVnaW9u X2VuZCA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9lbmQgKCkpIDogLTE7 CisgICAgICBwdHJkaWZmX3Qgb3BvaW50X3B0ID0gKHMtPncgPT0gWFdJTkRPVyAoc2VsZWN0ZWRf d2luZG93KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFBUCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiBYRklYTlVNIChGbWFya2VyX3Bvc2l0aW9uIChzLT53LT5wb2ludG0p KTsKKyAgICAgIGJvb2wgcmVnaW9uX2luX2JvdW5kc19wID0gKHJlZ2lvbl9hY3RpdmVfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3B0ID49IHJlZ2lvbl9iZWdp bm5pbmcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF9wdCA8IHJl Z2lvbl9lbmQpOworICAgICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICYmIHJlZ2lv bl9pbl9ib3VuZHNfcAorICAgICAgICAgICYmIGFjdGl2ZV9wKQorICAgICAgICB7CisgICAgICAg ICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2VfaWQgPSBsb29rdXBfbmFt ZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXJlZ2lvbi1m YWNlIiksIHRydWUpOworICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lv bl9mYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9mYWNlX2lk KTsKKyAgICAgICAgICBOU0NvbG9yICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9jb2xvciA9IG5zX2xv b2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19hY3RpdmVfcmVn aW9uX2ZhY2UpLCBzLT5mKTsKKyAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xsb3dfYWN0aXZl X3JlZ2lvbl9jb2xvcjsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZl X3AKKyAgICAgICAgICAgICAgICAgJiYgIXJlZ2lvbl9pbl9ib3VuZHNfcAorICAgICAgICAgICAg ICAgICAmJiBhY3RpdmVfcCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBlbnVtIGZhY2VfaWQg aG9sbG93X2FjdGl2ZV9yZWdpb25fb3V0X2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+ dywgcy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXJlZ2lvbi1mYWNlIiksIHRydWUp OworICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX291dF9mYWNl ID0gRkFDRV9GUk9NX0lEIChzLT5mLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfZmFjZV9pZCk7 CisgICAgICAgICAgICBOU0NvbG9yICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfY29sb3IgPSBu c19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3dfYWN0aXZl X3JlZ2lvbl9vdXRfZmFjZSksIHMtPmYpOworICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9s bG93X2FjdGl2ZV9yZWdpb25fb3V0X2NvbG9yOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNl IGlmICghcmVnaW9uX2FjdGl2ZV9wICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVk X2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1m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AgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2luYWN0 aXZlX2NvbG9yOworICAgICAgICAgICAgICB9CisgICAgfQorICAgIGVsc2UgaWYgKGZhY2UgJiYg TlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSA9PSBuc19pbmRleF9jb2xvciAoRlJBTUVfQ1VSU09S X0NPTE9SIChzLT5mKSwgcy0+ZikpCisgICAgICB7CisgICAgICAgIFtuc19sb29rdXBfaW5kZXhl ZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNlKSwgcy0+Zikgc2V0XTsKKyAgICAgICAg aG9sbG93X2NvbG9yID0gRlJBTUVfQ1VSU09SX0NPTE9SIChzLT5mKTsKKyAgICAgIH0KKyAgICAg IHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgICBjYXNlIFJJR0hUX0ZS SU5HRV9CSVRNQVA6CisgICAgICAgICAgY2FzZSBMRUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAg ICAgY2FzZSBOT19GUklOR0VfQklUTUFQOgorICAgICAgICAgIGNhc2UgREVGQVVMVF9DVVJTT1I6 CisgICAgICAgICAgY2FzZSBOT19DVVJTT1I6CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAg ICBjYXNlIEZJTExFRF9CT1hfQ1VSU09SOgorICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7Cisg ICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlIEZSQU1FRF9CT1hfQ1VSU09SOgorICAg ICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07 CisgICAgICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAg ICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAocy0+Zikgc2V0XTsKKyAgICAgICAgICAgIGJyZWFr OworICAgICAgICAgIGNhc2UgSE9MTE9XX0JPWF9DVVJTT1I6CisgICAgICAgICAgICBOU1JlY3RG aWxsIChyKTsKKyAgICAgICAgICAgIFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAgICAgIE5T UmVjdEZpbGwgKE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgICAgICBbRlJBTUVfQ1VS U09SX0NPTE9SIChzLT5mKSBzZXRdOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgY2Fz ZSBIQkFSX0NVUlNPUjoKKyAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAg YnJlYWs7CisgICAgICAgICAgY2FzZSBCQVJfQ1VSU09SOgorICAgICAgICAgICAgTlNSZWN0Rmls bCAocik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgLyogSWYgYSBnbHlw aCBleGlzdHMgKHMtPmNoYXIyYiAhPSBOVUxMKSwgdGhlbiBkcmF3IHRoZSBnbHlwaCBvbiB0b3Ag b2YgdGhlCisgICAgICBuZXdseSBkcmF3biByZWN0YW5nbGUgdGhhdCB3YXMgY3JlYXRlZCBoZXJl aW5hYm92ZS4gIFRvIHRoZSBleHRlbnQgdGhhdCB3ZQorICAgICAgd2FudCB0byBkb3VibGUtaW1w cmludCBnbHlwaHMgdG8gbWFrZSB0aGVtIGFwcGVhciB0byBiZSBzZW1pLWJvbGQsIGl0IGNhbgor ICAgICAgYmUgZG9uZSBoZXJlIGZvciBhbGwgY3Vyc29yIHR5cGVzLiAgVGhlIGJveC1zdHlsZSBj dXJzb3JzIGFyZSBpbXByaW50ZWQKKyAgICAgIHdpdGggZ2x5cGhzIG9ubHkgb25lICgxKSB0aW1l LiAgVGhlIHNlbWktYm9sZCBhcHBlYXJhbmNlIGlzIGhlbHBmdWwgd2hlbgorICAgICAgZGVidWdn aW5nIHRvIHNlZSB0aGF0IHRoZSBjb29yZGluYXRlcyBhcmUgY29ycmVjdC4gKi8KKyAgICAgIGlm IChzLT5jaGFyMmIgIT0gTlVMTAorICAgICAgICAgICYmIChjdXJzb3JfdHlwZSA9PSBGSUxMRURf Qk9YX0NVUlNPUgorICAgICAgICAgICAgICB8fCBjdXJzb3JfdHlwZSA9PSBGUkFNRURfQk9YX0NV UlNPUgorICAgICAgICAgICAgICB8fCBjdXJzb3JfdHlwZSA9PSBIT0xMT1dfQk9YX0NVUlNPUikp CisgICAgICAgIHsKKyAgICAgICAgICBCT09MIGlzQ29tcG9zaXRlID0gcy0+Zmlyc3RfZ2x5cGgt PnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIOworICAgICAgICAgIGlmIChpc0NvbXBvc2l0ZSkKKyAg ICAgICAgICAgIG5zX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsK KyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0cnVj dCBmb250ICpmb250ID0gcy0+ZmFjZS0+Zm9udDsKKyAgICAgICAgICAgICAgICBpZiAoIWZvbnQp CisgICAgICAgICAgICAgICAgICBmb250ID0gRlJBTUVfRk9OVCAocy0+Zik7CisgICAgICAgICAg ICAgICAgYm9vbCB3aXRoX2JnX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBmb250LT5kcml2 ZXItPmRyYXcgKHMsIHMtPmNtcF9mcm9tLCBzLT5uY2hhcnMsIHMtPngsIHMtPnliYXNlLCB3aXRo X2JnX3ApOworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cit9CisKK3N0YXRpYyB2 b2lkCittY19uc19kcmF3X292ZXJ3cml0dGVuIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzLCBzdHJ1 Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qg Z2x5cGhfcm93ICpyb3csIHN0cnVjdCBnbHlwaCAqZ2x5cGgpCit7CisgIC8vICBpbnQgdnBvcyA9 IE1B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gICAgICBpZiAoRk9OVF9IRUlHSFQgKHMtPmZvbnQpIDwgcy0+aGVp Z2h0IC0gMiAqIGJveF9saW5lX3dpZHRoCisgICAgICAgICAgLyogV2hlbiB4ZGlzcC5jIGlnbm9y ZXMgRk9OVF9IRUlHSFQsIHdlIGNhbm5vdCB0cnVzdCBmb250CisgICAgICAgICAgICAgZGltZW5z aW9ucywgc2luY2UgdGhlIGFjdHVhbCBnbHlwaHMgbWlnaHQgYmUgbXVjaAorICAgICAgICAgICAg IHNtYWxsZXIuICBTbyBpbiB0aGF0IGNhc2Ugd2UgYWx3YXlzIGNsZWFyIHRoZSByZWN0YW5nbGUK KyAgICAgICAgICAgICB3aXRoIGJhY2tncm91bmQgY29sb3IuICAqLworICAgICAgICAgIHx8IEZP TlRfVE9PX0hJR0ggKHMtPmZvbnQpCisgICAgICAgICAgfHwgcy0+Zm9udF9ub3RfZm91bmRfcCB8 fCBzLT5leHRlbmRzX3RvX2VuZF9vZl9saW5lX3AgfHwgZm9yY2VfcCkKKyAgICAgIHsKKyAgICAg ICAgICBzdHJ1Y3QgZmFjZSAqZmFjZTsKKyAgICAgICAgICBpZiAocy0+aGwgPT0gRFJBV19NT1VT RV9GQUNFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lE IChzLT5mLAorICAgICAgICAgICBNT1VTRV9ITF9JTkZPIChzLT5mKS0+bW91c2VfZmFjZV9mYWNl X2lkKTsKKyAgICAgICAgICAgICAgaWYgKCFmYWNlKQorICAgICAgICAgICAgICAgIGZhY2UgPSBG QUNFX0ZST01fSUQgKHMtPmYsIE1PVVNFX0ZBQ0VfSUQpOworICAgICAgICAgICAgfQorICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIHMtPmZpcnN0 X2dseXBoLT5mYWNlX2lkKTsKKyAgICAgICAgICBpZiAoIWZhY2UtPnN0aXBwbGUpCisgICAgICAg ICAgICBbKE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSkgIT0gMAorICAgICAgICAgICAgICA/IG5z X2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKQor ICAgICAgICAgICAgICA6IEZSQU1FX0JBQ0tHUk9VTkRfQ09MT1IgKHMtPmYpKSBzZXRdOworICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgc3RydWN0IG5zX2Rpc3Bs YXlfaW5mbyAqZHB5aW5mbyA9IEZSQU1FX0RJU1BMQVlfSU5GTyAocy0+Zik7CisgICAgICAgICAg ICAgIFtbZHB5aW5mby0+Yml0bWFwc1tmYWNlLT5zdGlwcGxlLTFdLmltZyBzdGlwcGxlTWFza10g c2V0XTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBpZiAocy0+aGwgIT0gRFJBV19DVVJTT1Ip CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHMtPnJlY3RhbmdsZV9udWtlZF9wID0gdHJ1 ZTsKKyAgICAgICAgICAgICAgTlNSZWN0IHIgPSBOU01ha2VSZWN0IChzLT54LCBzLT55ICsgYm94 X2xpbmVfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT5iYWNr Z3JvdW5kX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+aGVp Z2h0LTIqYm94X2xpbmVfd2lkdGgpOworICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAg ICAgICAgICAgIH0KKyAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gMTsKKyAgICAgIH0KKyAg ICB9Cit9CisKKworc3RhdGljIHZvaWQKK21jX25zX2RyYXdfZ2x5cGhfc3RyaW5nIChzdHJ1Y3Qg Z2x5cGhfc3RyaW5nICpzLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRya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mluZyAqbmV4dDsKKyAgICAgIGZvciAod2lkdGggPSAwLCBuZXh0ID0g cy0+bmV4dDsKKyAgICAgICAgICAgbmV4dCAmJiB3aWR0aCA8IHMtPnJpZ2h0X292ZXJoYW5nOwor ICAgICAgICAgICB3aWR0aCArPSBuZXh0LT53aWR0aCwgbmV4dCA9IG5leHQtPm5leHQpCisgICAg ICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCkKKyAgICAgICAg ICB7CisgICAgICAgICAgICBpZiAobmV4dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9H TFlQSCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIG4gPSBuc19nZXRfZ2x5cGhf c3RyaW5nX2NsaXBfcmVjdCAocy0+bmV4dCwgcik7CisgICAgICAgICAgICAgICAgaWYgKCFtY19u c19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4sIHJvdykpCisgICAgICAgICAgICAgICAgICByZXR1 cm47CisgICAgICAgICAgICAgICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChz LT5uZXh0LCAxKTsKKyAgICAgICAgICAgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7Cisg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgIG1jX25zX2R1bXBnbHlwaHNfc3RyZXRjaCAocy0+bmV4dCwgd2QsIHJvdyk7Cisg ICAgICAgICAgICAgICAgaWYgKChzLT5uZXh0LT5sZWZ0X292ZXJ3cml0dGVuX3AgfHwgcy0+bmV4 dC0+cmlnaHRfb3ZlcndyaXR0ZW5fcCkKKyAgICAgICAgICAgICAgICAgICAgJiYgcy0+bmV4dC0+ YWN0aW9uID09IE1DX0RSQVdfR0xZUEgpCisgICAgICAgICAgICAgICAgICBtY19uc19kcmF3X292 ZXJ3cml0dGVuIChzLT5uZXh0LCBtYXRyaXgsIHJvdywgcy0+bmV4dC0+Zmlyc3RfZ2x5cGgpOwor ICAgICAgICAgICAgICB9CisgICAgICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAg ICAgIH0KKyAgICB9CisgIGlmICghcy0+Zm9yX292ZXJsYXBzICYmIHMtPmZhY2UtPmJveCAhPSBG QUNFX05PX0JPWAorICAgICAgJiYgKHMtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgK KyAgICAgICAgICB8fCBzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpKQor ICAgIHsKKyAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7Cisg ICAgICBpZiAoIW1jX25zX2NsaXBfdG9fcmVjdCAocy0+Ziwgciwgbiwgcm93KSkKKyAgICAgICAg cmV0dXJuOworICAgICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLCAxKTsK KyAgICAgIG5zX2R1bXBnbHlwaHNfYm94X29yX3JlbGllZiAocyk7CisgICAgICBuc19yZXNldF9j bGlwcGluZyAocy0+Zik7CisgICAgICBib3hfZHJhd25fcCA9IDE7CisgICAgfQorICBzd2l0Y2gg KHMtPmZpcnN0X2dseXBoLT50eXBlKQorICAgIHsKKyAgICBjYXNlIElNQUdFX0dMWVBIOgorICAg ICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICgh bWNfbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuLCByb3cpKQorICAgICAgICByZXR1cm47Cisg ICAgICBtY19uc19kdW1wZ2x5cGhzX2ltYWdlIChzLCByWzBdLCByZWQsIGdyZWVuLCBibHVlLCBn bHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCBhY3RpdmVfcCk7CisgICAgICBuc19yZXNldF9jbGlw cGluZyAoc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93X2FjdGl2ZV9mYWNlKTsKKyAgICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAo cy0+aGwgPT0gRFJBV19DVVJTT1IKKyAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9 PSBGUkFNRURfQk9YX0NVUlNPUgorICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2Zh Y2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZh a2UtY3Vyc29yLWluYWN0aXZlLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgIHN0cnVjdCBm YWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2lu YWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZh Y2UpID0gTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3dfaW5hY3RpdmVfZmFjZSk7CisgICAgICAg ICAgICB9CisgICAgICB7CisgICAgICAgIEJPT0wgaXNDb21wb3NpdGUgPSBzLT5maXJzdF9nbHlw aC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEg7CisgICAgICAgIGlmIChpc0NvbXBvc2l0ZSkKKyAg ICAgICAgICBuc19kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7Cisg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBib29sIHdpdGhfYmdf cCA9ICgoZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX05PUk1BTCAmJiAhcy0+YmFja2dyb3VuZF9maWxs ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZmxhZ3MgPT0gTlNfRFVN UEdMWVBIX01PVVNFRkFDRSk7CisgICAgICAgICAgICAgIGlmICh3aXRoX2JnX3ApCisgICAgICAg ICAgICAgICAgcy0+YmFja2dyb3VuZF9udWtlZF9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgZm9u dC0+ZHJpdmVyLT5kcmF3IChzLCBzLT5jbXBfZnJvbSwgcy0+bmNoYXJzLCBzLT54LCBzLT55YmFz ZSwgd2l0aF9iZ19wKTsKKyAgICAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIHsKKyAgICAgICAg TlNDb2xvciAqY29sID0gKE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgIT0gMAorICAgICAg ICAgICAgICAgICAgICAgICAgPyBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JF R1JPVU5EIChzLT5mYWNlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHMtPmYpCisgICAgICAgICAgICAgICAgICAgICAgICA6IEZSQU1FX0ZPUkVH Uk9VTkRfQ09MT1IgKHMtPmYpKTsKKyAgICAgICAgW2NvbCBzZXRdOworICAgICAgICAvKiBEcmF3 IHVuZGVybGluZSwgb3ZlcmxpbmUsIHN0cmlrZS10aHJvdWdoLiAqLworICAgICAgICBtY19uc19k cmF3X3RleHRfZGVjb3JhdGlvbiAocywgcy0+ZmFjZSwgY29sLCBzLT53aWR0aCwgcy0+eCk7Cisg ICAgICB9CisgICAgICB7CisgICAgICAgIGlmIChzLT5maXJzdF9nbHlwaC0+dHlwZSAhPSBDT01Q T1NJVEVfR0xZUEgKKyAgICAgICAgICAgICYmIChzLT5sZWZ0X292ZXJ3cml0dGVuX3AgfHwgcy0+ cmlnaHRfb3ZlcndyaXR0ZW5fcCkKKyAgICAgICAgICAgICYmIChzLT5iYWNrZ3JvdW5kX251a2Vk X3AgfHwgcy0+cmVjdGFuZ2xlX251a2VkX3ApCisgICAgICAgICAgICAmJiBzLT5hY3Rpb24gPT0g TUNfRFJBV19HTFlQSCkKKyAgICAgICAgICBtY19uc19kcmF3X292ZXJ3cml0dGVuIChzLCBtYXRy aXgsIHJvdywgcy0+Zmlyc3RfZ2x5cGgpOworICAgICAgfQorICAgICAgaWYgKHMtPmhsID09IERS QVdfQ1VSU09SCisgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gRklMTEVEX0JPWF9DVVJTT1Ip CisgICAgICAgIHsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIHRtcCA9IE5TX0ZBQ0VfQkFDS0dS T1VORCAocy0+ZmFjZSk7CisgICAgICAgICAgTlNfRkFDRV9CQUNLR1JPVU5EIChzLT5mYWNlKSA9 IE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSk7CisgICAgICAgICAgTlNfRkFDRV9GT1JFR1JP VU5EIChzLT5mYWNlKSA9IHRtcDsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChzLT5obCA9 PSBEUkFXX0NVUlNPUgorICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBGUkFNRURf Qk9YX0NVUlNPUikKKyAgICAgICAgICBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpID0gc2F2 ZWRfZmc7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBicmVhazsKKyAg ICBjYXNlIEdMWVBITEVTU19HTFlQSDoKKyAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2Ns aXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW1jX25zX2NsaXBfdG9fcmVjdCAocy0+Ziwgciwg biwgcm93KSkKKyAgICAgICAgcmV0dXJuOworICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcyB8fCAo cy0+Y21wX2Zyb20gPiAwCisgICAgICAgICAgICAmJiAhIHMtPmZpcnN0X2dseXBoLT51LmNtcC5h dXRvbWF0aWMpKQorICAgICAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gMTsKKyAgICAgIGVs c2UKKyAgICAgICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLCBzLT5maXJz dF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpOworICAgICAgLyogLi4uICovCisgICAg ICAvKiBOb3QgeWV0IGltcGxlbWVudGVkLiAgKi8KKyAgICAgIC8qIC4uLiAqLworICAgICAgbnNf cmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAg IGVtYWNzX2Fib3J0ICgpOworICAgIH0KKyAgLyogRHJhdyBib3ggaWYgbm90IGRvbmUgYWxyZWFk eS4gKi8KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMgJiYgIWJveF9kcmF3bl9wICYmIHMtPmZhY2Ut PmJveCAhPSBGQUNFX05PX0JPWCkKKyAgICB7CisgICAgICBuID0gbnNfZ2V0X2dseXBoX3N0cmlu Z19jbGlwX3JlY3QgKHMsIHIpOworICAgICAgaWYgKCFtY19uc19jbGlwX3RvX3JlY3QgKHMtPmYs IHIsIG4sIHJvdykpCisgICAgICAgIHJldHVybjsKKyAgICAgIG5zX2R1bXBnbHlwaHNfYm94X29y X3JlbGllZiAocyk7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgfQorICBz LT5udW1fY2xpcHMgPSAwOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KIAogICAgTlNUUkFD RSwgVHJhY2Ugc3VwcG9ydC4KQEAgLTExMDksNiArMjE1MSwxNiBAQCBzdGF0aWMgTlNSZWN0IGNv bnN0cmFpbl9mcmFtZV9yZWN0KE5TUmVjdCBmcmFtZVJlY3QsIGJvb2wgaXNGdWxsc2NyZWVuKQog ICAgZXh0ZXJuYWwgKFJJRikgY2FsbDsgd2hvbGUgZnJhbWUsIGNhbGxlZCBiZWZvcmUgdXBkYXRl X3dpbmRvd19iZWdpbgogICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KIHsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGlu Z19mcmFtZSA9IGY7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICNpZmRlZiBOU19J TVBMX0NPQ09BCiAgIEVtYWNzVmlldyAqdmlldyA9IEZSQU1FX05TX1ZJRVcgKGYpOwogCkBAIC0x MjA5LDYgKzIyNjEsMTYgQEAgc3RhdGljIE5TUmVjdCBjb25zdHJhaW5fZnJhbWVfcmVjdChOU1Jl Y3QgZnJhbWVSZWN0LCBib29sIGlzRnVsbHNjcmVlbikKIAogLyogICBpZiAoZiA9PSBNT1VTRV9I TF9JTkZPIChmKS0+bW91c2VfZmFjZV9tb3VzZV9mcmFtZSkgKi8KICAgTU9VU0VfSExfSU5GTyAo ZiktPm1vdXNlX2ZhY2VfZGVmZXIgPSAwOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gTlVMTDsK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAKQEAgLTMyMzUsNiArNDI5Nywy OCBAQCBOb3RlIHRoYXQgQ1VSU09SX1dJRFRIIGlzIG1lYW5pbmdmdWwgb25seSBmb3IgKGgpYmFy IGN1cnNvcnMuCiAKICAgICAgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCiAgICAgICAgIHsKKworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIGNh c2UgUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgIGJyZWFrOworICAgIGNhc2UgTEVGVF9GUklO R0VfQklUTUFQOgorICAgICAgYnJlYWs7CisgICAgY2FzZSBOT19GUklOR0VfQklUTUFQOgorICAg ICAgYnJlYWs7CisgICAgY2FzZSBGUkFNRURfQk9YX0NVUlNPUjoKKyAgICAgIC8qIFRoaXMgZmVh dHVyZSBoYXMgYmVlbiBkZWxpYmVyYXRlbHkgZGlzYWJsZWQgZm9yIHRoZSB0aW1lIGJlaW5nLiAq LworICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAg ICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAgW0ZSQU1FX0NVUlNP Ul9DT0xPUiAoZikgc2V0XTsKKyAgICAgIGJyZWFrOworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKworCiAgICAgICAgIGNhc2UgREVGQVVMVF9DVVJTT1I6CiAgICAgICAgIGNhc2UgTk9fQ1VS U09SOgogICAgICAgICAgIGJyZWFrOwpAQCAtMzI2MiwxMCArNDM0NiwxOSBAQCBOb3RlIHRoYXQg Q1VSU09SX1dJRFRIIGlzIG1lYW5pbmdmdWwgb25seSBmb3IgKGgpYmFyIGN1cnNvcnMuCiAgICAg ICAgICAgYnJlYWs7CiAgICAgICAgIH0KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAgICAgLyogRHJhdyB0aGUgY2hhcmFjdGVyIHVuZGVy IHRoZSBjdXJzb3IuICBPdGhlciB0ZXJtcyBvbmx5IGRyYXcKICAgICAgICAgIHRoZSBjaGFyYWN0 ZXIgb24gdG9wIG9mIGJveCBjdXJzb3JzLCBzbyBkbyB0aGUgc2FtZSBoZXJlLiAgKi8KLSAgICAg IGlmIChjdXJzb3JfdHlwZSA9PSBGSUxMRURfQk9YX0NVUlNPUiB8fCBjdXJzb3JfdHlwZSA9PSBI T0xMT1dfQk9YX0NVUlNPUikKLSAgICAgICAgZHJhd19waHlzX2N1cnNvcl9nbHlwaCAodywgZ2x5 cGhfcm93LCBEUkFXX0NVUlNPUik7CisgIGlmIChjdXJzb3JfdHlwZSA9PSBGUkFNRURfQk9YX0NV UlNPUgorICAgICAgfHwgY3Vyc29yX3R5cGUgPT0gRklMTEVEX0JPWF9DVVJTT1IKKyAgICAgIHx8 IGN1cnNvcl90eXBlID09IEhPTExPV19CT1hfQ1VSU09SKQorICAgIGRyYXdfcGh5c19jdXJzb3Jf Z2x5cGggKHcsIGdseXBoX3JvdywgRFJBV19DVVJTT1IpOworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKwogCiAgICAgICBuc19yZXNldF9jbGlwcGluZyAoZik7CiAgICAgfQpAQCAtNDgwMyw2 ICs1ODk2LDE3IEBAIGluIGNlcnRhaW4gc2l0dWF0aW9ucyAocmFwaWQgaW5jb21pbmcgZXZlbnRz KS4KICAgICAgIGJhciA9IFtbRW1hY3NTY3JvbGxlciBhbGxvY10gaW5pdEZyYW1lOiByIHdpbmRv dzogd2luXTsKICAgICAgIHdzZXRfdmVydGljYWxfc2Nyb2xsX2JhciAod2luZG93LCBtYWtlX21p bnRfcHRyIChiYXIpKTsKICAgICAgIHVwZGF0ZV9wID0gWUVTOworCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICAvKiBUaGlzIGlzIG9u bHkgZm9yIGRlYnVnZ2luZyBwdXJwb3Nlcy4gKi8KKyAgICAgIFtiYXIgbWNfc2V0X3JlY3Rhbmds ZTogcl07CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB9CiAgIGVsc2UKICAg ICB7CkBAIC00ODEwLDEyICs1OTE0LDMwIEBAIGluIGNlcnRhaW4gc2l0dWF0aW9ucyAocmFwaWQg aW5jb21pbmcgZXZlbnRzKS4KICAgICAgIGJhciA9IFhOU19TQ1JPTExfQkFSICh3aW5kb3ctPnZl cnRpY2FsX3Njcm9sbF9iYXIpOwogICAgICAgb2xkUmVjdCA9IFtiYXIgZnJhbWVdOwogICAgICAg ci5zaXplLndpZHRoID0gb2xkUmVjdC5zaXplLndpZHRoOworCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAgICAgICBpZiAoRlJBTUVfTElWRV9Q IChmKSAmJiAhTlNFcXVhbFJlY3RzIChvbGRSZWN0LCByKSkKICAgICAgICAgeworICAgICAgICAg IC8qIFRoZSBtYWluIHdpbmRvdyBoYXMgcHJvYmFibHkgYmVlbiByZXNpemVkLiAgR3JhY2lvdXNs eSBkZWxldGUgdGhlCisgICAgICAgICAgb2xkIHNjcm9sbCBiYXIgd2l0aG91dCByZXBhaW50aW5n IGl0cyByZWN0YW5nbGU7IGFuZCwgY3JlYXRlIGEgbmV3CisgICAgICAgICAgc2Nyb2xsIGJhciBl bHNld2hlcmUuKi8KICAgICAgICAgICBpZiAob2xkUmVjdC5vcmlnaW4ueCAhPSByLm9yaWdpbi54 KQorICAgICAgICAgICAgewogICAgICAgICAgICAgICBuc19jbGVhcl9mcmFtZV9hcmVhIChmLCBs ZWZ0LCB0b3AsIHdpZHRoLCBoZWlnaHQpOworICAgICAgICAgICAgICBbYmFyIG1jX2p1ZGdlXTsK KyAgICAgICAgICAgICAgYmFyID0gW1tFbWFjc1Njcm9sbGVyIGFsbG9jXSBpbml0RnJhbWU6IHIg d2luZG93OiB3aW5dOworICAgICAgICAgICAgICB3c2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHdp bmRvdywgbWFrZV9taW50X3B0ciAoYmFyKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBl bHNlCiAgICAgICAgICAgW2JhciBzZXRGcmFtZTogcl07CiAgICAgICAgIH0KKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogICAgIH0KIAogICBpZiAodXBkYXRlX3ApCkBAIC00OTc1LDkg KzYwOTcsNTIgQEAgaW4gY2VydGFpbiBzaXR1YXRpb25zIChyYXBpZCBpbmNvbWluZyBldmVudHMp LgogICAgIHsKICAgICAgIHZpZXcgPSBbc3Vidmlld3Mgb2JqZWN0QXRJbmRleDogaV07CiAgICAg ICBpZiAoIVt2aWV3IGlzS2luZE9mQ2xhc3M6IFtFbWFjc1Njcm9sbGVyIGNsYXNzXV0pIGNvbnRp bnVlOwotICAgICAgaWYgKFt2aWV3IGp1ZGdlXSkKKworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAvKiBgWFNFVFdJTkRPVycgd2lsbCBzb21l dGltZXMgY2F1c2UgRW1hY3MgdG8gY3Jhc2ggd2hlbiBydW5uaW5nIHVuZGVyIGdkYiBldmVuCisg IHRob3VnaCAodyAhPSBOVUxMKS4gIFRoZXJlZm9yZSwgd2UgY2Fubm90IHJlbGlhYmx5IHVzZSBg V0lORE9XX0xJVkVfUCcuICovCisgIHN0cnVjdCB3aW5kb3cgKncgPSBbdmlldyBtY19nZXRfd2lu ZG93XTsKKyAgaWYgKHcgIT0gTlVMTAorICAgICAgJiYgTklMUCAody0+Y29udGVudHMpKQorICAg IHsKKyAgICAgIEJPT0wgZGVidWdfcCA9IGZhbHNlOworICAgICAgTlNSZWN0IHIwID0gW3ZpZXcg bWNfZ2V0X3JlY3RhbmdsZV07CisgICAgICBpbnQgeDAgPSBOU01pblggKHIwKTsKKyAgICAgIGlu dCB5MCA9IE5TTWluWSAocjApOworICAgICAgaW50IHdkMCA9IE5TV2lkdGggKHIwKTsKKyAgICAg IGludCBoMCA9IE5TSGVpZ2h0IChyMCk7CisgICAgICBpbnQgd2luZG93X3ksIHdpbmRvd19oZWln aHQ7CisgICAgICB3aW5kb3dfYm94ICh3LCBBTllfQVJFQSwgMCwgJndpbmRvd195LCAwLCAmd2lu ZG93X2hlaWdodCk7CisgICAgICBpbnQgdG9wID0gd2luZG93X3k7CisgICAgICBpbnQgaGVpZ2h0 ID0gd2luZG93X2hlaWdodDsKKyAgICAgIGludCB3aWR0aCA9IFdJTkRPV19DT05GSUdfU0NST0xM X0JBUl9DT0xTICh3KSAqIEZSQU1FX0NPTFVNTl9XSURUSCAoZik7CisgICAgICBpbnQgbGVmdCA9 IFdJTkRPV19TQ1JPTExfQkFSX0FSRUFfWCAodyk7CisgICAgICBOU1JlY3QgcjEgPSBOU01ha2VS ZWN0IChsZWZ0LCB0b3AsIHdpZHRoLCBoZWlnaHQpOworICAgICAgLyogVGhlIHBhcmVudCB2aWV3 IGlzIGZsaXBwZWQsIHNvIHdlIG5lZWQgdG8gZmxpcCB5IHZhbHVlLiAqLworICAgICAgRW1hY3NW aWV3ICpmcmFtZV92aWV3ID0gRlJBTUVfTlNfVklFVyAoZik7CisgICAgICBOU1JlY3QgdiA9IFtm cmFtZV92aWV3IGZyYW1lXTsKKyAgICAgIHIxLm9yaWdpbi55ID0gKHYuc2l6ZS5oZWlnaHQgLSBy MS5zaXplLmhlaWdodCAtIHIxLm9yaWdpbi55KTsKKyAgICAgIGludCB4MSA9IE5TTWluWCAocjEp OworICAgICAgaW50IHkxID0gTlNNaW5ZIChyMSk7CisgICAgICBpbnQgd2QxID0gTlNXaWR0aCAo cjEpOworICAgICAgaW50IGgxID0gTlNIZWlnaHQgKHIxKTsKKyAgICAgIGlmIChkZWJ1Z19wKQor ICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIlcyAtLSBERUFEOlxuXAorICAgICAgICB4MC94MSAo JWQvJWQpIHwgeTAveTEgKCVkLyVkKSB8IHdkMC93ZDEgKCVkLyVkKSB8IGgwL2gxICglZC8lZClc biIsCisgICAgICAgIG1jX3dpbmRvdyAodyksIHgwLCB4MSwgeTAsIHkxLCB3ZDAsIHdkMSwgaDAs IGgxKTsKKyAgICAgIGlmIChbdmlldyBtY19qdWRnZV0pCiAgICAgICAgIHJlbW92ZWQgPSBZRVM7 CiAgICAgfQorICAgIGVsc2UgaWYgKFt2aWV3IGp1ZGdlXSkKKyAgICAgIHJlbW92ZWQgPSBZRVM7 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKKyAgICB9CiAKICAgaWYgKHJlbW92ZWQp CiAgICAgW2V2aWV3IHVwZGF0ZUZyYW1lU2l6ZTogTk9dOwpAQCAtNTEwNiw2ICs2MjcxLDIxIEBA IHN0YXRpYyBMaXNwX09iamVjdCBuc19zdHJpbmdfdG9fbGlzcG1vZCAoY29uc3QgY2hhciAqcykK IGV4dGVybiBmcmFtZV9wYXJtX2hhbmRsZXIgbnNfZnJhbWVfcGFybV9oYW5kbGVyc1tdOwogc3Rh dGljIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlIG5zX3JlZGlzcGxheV9pbnRlcmZhY2UgPQog eworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CisvKiBgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYG5zdGVybS5tYCBtdXN0IGJlIGluIHRoZSBl eGFjdCBzYW1lIG9yZGVyIGFzIHRoZQorYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBkaXNwZXh0 ZXJuLmhgISAqLworCisgIG1jX3hfd3JpdGVfZ2x5cGhzLAorICBtY19uc19kcmF3X3dpbmRvd19j dXJzb3IsCisgIG1jX25zX2RyYXdfZ2x5cGhfc3RyaW5nLAorCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiAgIG5zX2ZyYW1lX3Bhcm1faGFuZGxlcnMsCiAgIHhfcHJvZHVjZV9nbHlwaHMs CiAgIHhfd3JpdGVfZ2x5cGhzLApAQCAtODcyMSw2ICs5OTAxLDQ5IEBAIC0gKEJPT0wpY2FuQmVj b21lTWFpbldpbmRvdwogCiBAaW1wbGVtZW50YXRpb24gRW1hY3NTY3JvbGxlcgogCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCistICh2b2lkKW1j X3NldF9yZWN0YW5nbGU6IChOU1JlY3QpcmVjdAoreworICBtY19yZWN0YW5nbGUgPSByZWN0Owor fQorCistIChOU1JlY3QpbWNfZ2V0X3JlY3RhbmdsZQoreworICByZXR1cm4gbWNfcmVjdGFuZ2xl OworfQorCistIChzdHJ1Y3Qgd2luZG93ICopbWNfZ2V0X3dpbmRvdworeworICByZXR1cm4gd2lu ZG93OworfQorCistIChib29sKW1jX2p1ZGdlCit7CisgIE5TVFJBQ0UgKCJbRW1hY3NTY3JvbGxl ciBtY19qdWRnZV0iKTsKKyAgYm9vbCByZXQgPSBjb25kZW1uZWQ7CisgIGJsb2NrX2lucHV0ICgp OworICBpZiAoY29uZGVtbmVkKQorICAgIHsKKyAgICAgIC8qIGVuc3VyZSBvdGhlciBzY3JvbGxi YXIgdXBkYXRlcyBhZnRlciBkZWxldGlvbiAqLworICAgICAgRW1hY3NWaWV3ICp2aWV3ID0gKEVt YWNzVmlldyAqKUZSQU1FX05TX1ZJRVcgKGZyYW1lKTsKKyAgICAgIGlmICh2aWV3ICE9IG5pbCkK KyAgICAgICAgdmlldy0+c2Nyb2xsYmFyc05lZWRpbmdVcGRhdGUrKzsKKyAgICB9CisgIGlmICh3 aW5kb3cpCisgICAgd3NldF92ZXJ0aWNhbF9zY3JvbGxfYmFyICh3aW5kb3csIFFuaWwpOworICB3 aW5kb3cgPSAwOworICBbc2VsZiByZW1vdmVGcm9tU3VwZXJ2aWV3V2l0aG91dE5lZWRpbmdEaXNw bGF5XTsKKyAgW3NlbGYgcmVsZWFzZV07CisgIHVuYmxvY2tfaW5wdXQgKCk7CisgIHJldHVybiBy ZXQ7Cit9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqL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isgICAgICAmJiAheF9zdHJldGNoX2N1cnNvcl9wKQorICAgIHsKKyAgICAgIC8qIElm IGB4LXN0cmV0Y2gtY3Vyc29yJyBpcyBuaWwsIGRvbid0IGRyYXcgYSBibG9jayBjdXJzb3IgYXMK KyAgIHdpZGUgYXMgdGhlIHN0cmV0Y2ggZ2x5cGguICAqLworICAgICAgaW50IHdpZHRoLCBiYWNr Z3JvdW5kX3dpZHRoID0gcy0+YmFja2dyb3VuZF93aWR0aDsKKyAgICAgIGludCB4ID0gcy0+eDsK KyAgICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQorICB7CisgICAgaW50IGxlZnRfeCA9IHdp bmRvd19ib3hfbGVmdF9vZmZzZXQgKHMtPncsIFRFWFRfQVJFQSk7CisgICAgaWYgKHggPCBsZWZ0 X3gpCisgICAgICB7CisgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0gbGVmdF94IC0geDsKKyAg ICAgICAgeCA9IGxlZnRfeDsKKyAgICAgIH0KKyAgfQorICAgICAgZWxzZQorICB7CisgICAgLyog SW4gUjJMIHJvd3MsIGRyYXcgdGhlIGN1cnNvciBvbiB0aGUgcmlnaHQgZWRnZSBvZiB0aGUKKyAg ICAgICBzdHJldGNoIGdseXBoLiAgKi8KKyAgICBpbnQgcmlnaHRfeCA9IHdpbmRvd19ib3hfcmln aHQgKHMtPncsIFRFWFRfQVJFQSk7CisgICAgaWYgKHggKyBiYWNrZ3JvdW5kX3dpZHRoID4gcmln aHRfeCkKKyAgICAgIGJhY2tncm91bmRfd2lkdGggLT0geCAtIHJpZ2h0X3g7CisgICAgeCArPSBi YWNrZ3JvdW5kX3dpZHRoOworICB9CisgICAgICB3aWR0aCA9IG1pbiAoRlJBTUVfQ09MVU1OX1dJ RFRIIChzLT5mKSwgYmFja2dyb3VuZF93aWR0aCk7CisgICAgICBpZiAocy0+cm93LT5yZXZlcnNl ZF9wKQorICB4IC09IHdpZHRoOworICAgICAgLyogRHJhdyBjdXJzb3IuICAqLworICAgICAgeF9k cmF3X2dseXBoX3N0cmluZ19iZ19yZWN0IChzLCB4LCBzLT55LCB3aWR0aCwgcy0+aGVpZ2h0KTsK KyAgICAgIC8qIENsZWFyIHJlc3QgdXNpbmcgdGhlIEdDIG9mIHRoZSBvcmlnaW5hbCBub24tY3Vy c29yIGZhY2UuICAqLworICAgICAgaWYgKHdpZHRoIDwgYmFja2dyb3VuZF93aWR0aCkKKyAgewor ICAgIFhHQ1ZhbHVlcyAqZ2MgPSBzLT5mYWNlLT5nYzsKKyAgICBpbnQgeSA9IHMtPnk7CisgICAg aW50IHcgPSBiYWNrZ3JvdW5kX3dpZHRoIC0gd2lkdGgsIGggPSBzLT5oZWlnaHQ7CisgICAgUkVD VCByOworICAgICAgICAgIEhEQyBoZGMgPSBzLT5oZGM7CisgICAgaWYgKCFzLT5yb3ctPnJldmVy c2VkX3ApCisgICAgICB4ICs9IHdpZHRoOworICAgIGVsc2UKKyAgICAgIHggPSBzLT54OworICAg IGlmIChzLT5yb3ctPm1vdXNlX2ZhY2VfcAorICAgICAgICAmJiBjdXJzb3JfaW5fbW91c2VfZmFj ZV9wIChzLT53KSkKKyAgICAgIHsKKyAgICAgICAgeF9zZXRfbW91c2VfZmFjZV9nYyAocyk7Cisg ICAgICAgIGdjID0gcy0+Z2M7CisgICAgICB9CisgICAgZWxzZQorICAgICAgZ2MgPSBzLT5mYWNl LT5nYzsKKyAgICBnZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgJnIpOworICAgIHczMl9z ZXRfY2xpcF9yZWN0YW5nbGUgKGhkYywgJnIpOworI2lmIDAgLyogVE9ETzogc3RpcHBsZSAqLwor ICAgIGlmIChzLT5mYWNlLT5zdGlwcGxlKQorICAgICAgeworICAgICAgICAvKiBGaWxsIGJhY2tn cm91bmQgd2l0aCBhIHN0aXBwbGUgcGF0dGVybi4gICovCisgICAgICAgIFhTZXRGaWxsU3R5bGUg KHMtPmRpc3BsYXksIGdjLCBGaWxsT3BhcXVlU3RpcHBsZWQpOworICAgICAgICBYRmlsbFJlY3Rh bmdsZSAocy0+ZGlzcGxheSwgcy0+d2luZG93LCBnYywgeCwgeSwgdywgaCk7CisgICAgICAgIFhT ZXRGaWxsU3R5bGUgKHMtPmRpc3BsYXksIGdjLCBGaWxsU29saWQpOworICAgICAgfQorICAgIGVs c2UKKyNlbmRpZgorICAgICAgICAgICAgeworICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChz LT5mLCBzLT5oZGMsIGdjLT5iYWNrZ3JvdW5kLCB4LCB5LCB3LCBoKTsKKyAgICAgICAgICAgIH0K KyAgICAgICAgfQorICAgIH0KKyAgZWxzZSBpZiAoIXMtPmJhY2tncm91bmRfZmlsbGVkX3ApCisg ICAgeworICAgICAgaW50IGJhY2tncm91bmRfd2lkdGggPSBzLT5iYWNrZ3JvdW5kX3dpZHRoOwor ICAgICAgaW50IHggPSBzLT54LCBsZWZ0X3ggPSB3aW5kb3dfYm94X2xlZnRfb2Zmc2V0IChzLT53 LCBURVhUX0FSRUEpOworICAgICAgLyogRG9uJ3QgZHJhdyBpbnRvIGxlZnQgbWFyZ2luLCBmcmlu Z2Ugb3Igc2Nyb2xsYmFyIGFyZWEKKyAgICAgICAgIGV4Y2VwdCBmb3IgaGVhZGVyIGxpbmUgYW5k IG1vZGUgbGluZS4gICovCisgICAgICBpZiAoeCA8IGxlZnRfeCAmJiAhcy0+cm93LT5tb2RlX2xp bmVfcCkKKyAgeworICAgIGJhY2tncm91bmRfd2lkdGggLT0gbGVmdF94IC0geDsKKyAgICB4ID0g bGVmdF94OworICB9CisgICAgICBpZiAoYmFja2dyb3VuZF93aWR0aCA+IDApCisgIHhfZHJhd19n bHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwgcy0+eSwgYmFja2dyb3VuZF93aWR0aCwgcy0+aGVp Z2h0KTsKKyAgICB9CisgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworfQorCisvKiBT ZXQgUy0+Z2MgdG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NfREVTVFJPWV9DQVJFVCwgMCwgMCk7CisgICAg dzMyX3N5c3RlbV9jYXJldF9oZWlnaHQgPSBoOworICAgIC8qIE1vdmUgdGhlIHN5c3RlbSBjYXJl dC4gICovCisgICAgUG9zdE1lc3NhZ2UgKGh3bmQsIFdNX0VNQUNTX1RSQUNLX0NBUkVULCAwLCAw KTsKKyAgICAgICAgfQorICAgICAgaWYgKHJvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAor ICAgICAgICAgICYmIChyb3ctPnJldmVyc2VkX3AKKyAgICAgICAgICAgICA/IChocG9zIDwgMCkK KyAgICAgICAgICAgICA6IChocG9zID49IHJvdy0+dXNlZFtURVhUX0FSRUFdKSkpCisgICAgICAg IHsKKyAgICAgICAgICByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9IHRydWU7CisgICAgICAgICAg ZHJhd19mcmluZ2VfYml0bWFwICh3LCByb3csIHJvdy0+cmV2ZXJzZWRfcCk7CisgICAgICAgICAg cmV0dXJuOworICAgICAgICB9CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZS QU1FICh3KSk7CisgIENPTE9SUkVGIG9yaWdpbmFsX2N1cnNvcl9waXhlbCA9IGYtPm91dHB1dF9k YXRhLnczMi0+Y3Vyc29yX3BpeGVsOworICAvKiB4dGVybS5jL3h0ZXJtLmggdXNlIEdDOyB3aGVy ZWFzLCB3MzJ0ZXJtLmMvdzMydGVybS5oIHVzZSBYR0NWYWx1ZXMgKiAqLworICBYR0NWYWx1ZXMg Km9yaWdpbmFsX2N1cnNvcl9nYyA9IGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djOworICBk b3VibGUgYmFzZSA9IDI1NS4wOworICBkb3VibGUgdGVybV9yZWQgPSBiYXNlICogcmVkOworICBk b3VibGUgdGVybV9ncmVlbiA9IGJhc2UgKiBncmVlbjsKKyAgZG91YmxlIHRlcm1fYmx1ZSA9IGJh c2UgKiBibHVlO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sKKyAgICAgIExpc3BfT2JqZWN0IGJ1ZiA9IHct PmNvbnRlbnRzOworICAgICAgQ0hFQ0tfQlVGRkVSIChidWYpOworICAgICAgc3RydWN0IGJ1ZmZl ciAqYiA9IFhCVUZGRVIgKGJ1Zik7CisgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklM UCAoVnRyYW5zaWVudF9tYXJrX21vZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiAhTklMUCAoQlZBUiAoYiwgbWFya19hY3RpdmUpKSk7CisgICAgICBwdHJkaWZmX3QgcmVnaW9u X2JlZ2lubmluZyA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9iZWdpbm5p bmcgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2VuZCA9IChyZWdpb25fYWN0aXZl X3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9lbmQgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3Qgb3Bv aW50X3B0ID0gKHcgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBYRklYTlVN IChGbWFya2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pKTsKKyAgICAgIGJvb2wgcmVnaW9uX2luX2Jv dW5kc19wID0gKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb3BvaW50X3B0ID49IHJlZ2lvbl9iZWdpbm5pbmcKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIG9wb2ludF9wdCA8IHJlZ2lvbl9lbmQpOworICAgICAgaWYgKGN1cnNv cl9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCAmJiByZWQgPj0gMCAmJiBibHVlID49IDAgJiYg Z3JlZW4gPj0gMCkKKyAg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d19hY3RpdmVfcmVnaW9uX2ZhY2Ut PmJhY2tncm91bmQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25f YWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICYmICFyZWdpb25faW5fYm91bmRzX3AKKyAg ICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX291dF9mYWNlX2lkID0g bG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1yZWdp b24tZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2Fj dGl2ZV9yZWdpb25fb3V0X2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfcmVn aW9uX291dF9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2Fj dGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1m YWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpo b2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9p ZCk7CisgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZl X2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQg PSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgICBlbHNlIGl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MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3Bp eGVsOworICAgICAgICAgIG1jX3czMl9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93 LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICBmLT5vdXRwdXRf ZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAg fQorICAgICAgICBlbHNlIGlmIChjdXJzb3JfZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEggJiYg cmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVuID49IDApCisgICAgICAgICAgeworICAgICAg ICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9w aXhlbCcuICAqLworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwg PSBjb2xvcl9waXhlbDsKKyAgICAgICAgICAgIG1jX3czMl9kcmF3X2hvbGxvd19jdXJzb3IgKHcs IG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAg ICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3Bp eGVsOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3Jf Z2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAgICAgICAgICAgICAgZnVuY3Rpb25hbGl0eSBvZiBgeF9t YWtlX2djJyBpbiB3MzJmbnMuYy4gICovCisgICAgICAgICAgICAgIGlmIChyZWdpb25fYWN0aXZl X3AKKyAgICAgICAgICAgICAgICAgICYmIHJlZ2lvbl9pbl9ib3VuZHNfcAorICAgICAgICAgICAg ICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRf ZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXJlZ2lvbi1mYWNlIiksIHRy dWUpOworICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9u X2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2VfaWQpOwor ICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfZmFjZV9pZCA9IGxv b2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItZmFjZSIp LCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2Zh Y2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAg ICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+Zm9yZWdy b3VuZDsKKyAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gaG9sbG93X2Fj dGl2ZV9yZWdpb25fZmFjZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgICAgZWxzZSBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgIXJlZ2lvbl9pbl9ib3VuZHNfcAorICAgICAgICAgICAgICAgICAgICAgICAgICYmIGFj dGl2ZV9wKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBlbnVtIGZh Y2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fb3V0X2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXJlZ2lvbi1mYWNlIiksIHRydWUp OworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25f b3V0X2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX291dF9mYWNl X2lkKTsKKyAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfZmFj ZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJz b3ItZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxv d19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9mYWNlX2lkKTsK KyAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZl X2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3Jv dW5kID0gaG9sbG93X2FjdGl2ZV9yZWdpb25fb3V0X2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmICghcmVnaW9uX2FjdGl2ZV9w ICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg ICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVf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JlZ3JvdW5kID0gaG9sbG93X2luYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAg ICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19pbmFjdGl2ZV9mYWNl LT5iYWNrZ3JvdW5kOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZi0+ b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MgPSBYQ3JlYXRlR0MgKE5VTEwsIEZSQU1FX1czMl9X SU5ET1cgKGYpLCBtYXNrLCAmZ2NfdmFsdWVzKTsKKyAgICAgICAgICAgICAgYmxvY2tfaW5wdXQg KCk7CisgICAgICAgICAgICAgIC8qIEZvcmNlIGBtY193MzJfc2V0X2N1cnNvcl9nYycgdG8gdXNl IGBzLT5mLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycuICAqLworICAgICAgICAgICAgICBi b29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5 cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZCwgZ3JlZW4sIGJsdWUsIGdseXBoX2ZsYXZv ciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAg ICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYyA9IG9yaWdpbmFsX2N1cnNvcl9nYzsKKyAg ICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgbWNfdzMyX2RyYXdf aG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywg d2QsIGgpOworICAgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgSE9M TE9XX0JPWF9DVVJTT1I6CisgICAgeworICAgICAgaWYgKHJlZCA+PSAwICYmIGJsdWUgPj0gMCAm JiBncmVlbiA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNr IGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91 dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgbWNf dzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBv cywgdnBvcywgd2QsIGgpOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3Bp eGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAg ICAgICAgICBtY193MzJfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngs IHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2Fz ZSBGSUxMRURfQk9YX0NVUlNPUjoKKyAgICB7CisgICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+ PSAwICYmIGdyZWVuID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBo aWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisg ICAgICAgICAgZnVuY3Rpb25hbGl0eSBvZiBgeF9tYWtlX2djJyBpbiB3MzJmbnMuYy4gICovCisg ICAgICAgICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgWEdDVmFsdWVzIGdjX3ZhbHVlczsK KyAgICAgICAgICB1bnNpZ25lZCBsb25nIG1hc2sgPSBHQ0Zvb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LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHJlZCwgZ3JlZW4sIGJsdWUsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3Rp dmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAg ICBjYXNlIEJBUl9DVVJTT1I6CisgICAgeworICAgICAgaWYgKHJlZCA+PSAwICYmIGJsdWUgPj0g MCAmJiBncmVlbiA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlq YWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYt Pm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAg Ym9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IHRydWU7CisgICAgICAgICAgbWNfdzMy X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBv cywgd2QsIGgsIGN1cnNvcl93aWR0aCwgQkFSX0NVUlNPUiwgY3Vyc29yX2djX2ludmlzaWJsZV9v a2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3Jp Z2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7 CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7Cisg ICAgICAgICAgICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngs IHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwgY3Vyc29yX3dpZHRoLCBCQVJfQ1VSU09SLCBjdXJz b3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAg fQorICAgIGNhc2UgSEJBUl9DVVJTT1I6CisgICAgeworICAgICAgaWYgKHJlZCA+PSAwICYmIGJs dWUgPj0gMCAmJiBncmVlbiA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJp bHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICAqLworICAgICAg ICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAg ICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IHRydWU7CisgICAgICAgICAg bWNfdzMyX2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBv cywgdnBvcywgd2QsIGgsIGN1cnNvcl93aWR0aCwgSEJBUl9DVVJTT1IsIGN1cnNvcl9nY19pbnZp c2libGVfb2theV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhl bCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAg ICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IGZh bHNlOworICAgICAgICAgICAgbWNfdzMyX2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3cs IHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1cnNvcl93aWR0aCwgSEJBUl9DVVJT T1IsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVh azsKKyAgICB9CisgICAgY2FzZSBOT19DVVJTT1I6CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0 OgorICAgICA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gICB4X2RyYXdfZ2x5cGhsZXNzX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChz KTsKKyAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAg ICB9CisgIGlmICghcy0+Zm9yX292ZXJsYXBzKQorICAgIHsKKyAgICAgIC8qIERyYXcgdW5kZXJs aW5lLiAgKi8KKyAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfcCkKKyAgICAgICAgeworICAg ICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX1dBVkUpCisg ICAgICAgICAgICB7CisgICAgICAgICAgICAgIENPTE9SUkVGIGNvbG9yOworICAgICAgICAgICAg ICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgICAgIGNv bG9yID0gcy0+Z2MtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICBjb2xvciA9IHMtPmZhY2UtPnVuZGVybGluZV9jb2xvcjsKKyAgICAgICAgICAgICAgdzMy X2RyYXdfdW5kZXJ3YXZlIChzLCBjb2xvcik7CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxz ZSBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247 CisgICAgICAgICAgICAgIGludCB5OworICAgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5w cmV2LT5mYWNlLT51bmRlcmxpbmVfcAorICAgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+ZmFj ZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgIC8qIFdlIHVzZSB0aGUgc2FtZSB1bmRlcmxpbmUgc3R5bGUgYXMg dGhlIHByZXZpb3VzIG9uZS4gICovCisgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSBzLT5w cmV2LT51bmRlcmxpbmVfdGhpY2tuZXNzOworICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBz LT5wcmV2LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgLyogR2V0IHRo ZSB1bmRlcmxpbmUgdGhpY2tuZXNzLiAgRGVmYXVsdCBpcyAxIHBpeGVsLiAgKi8KKyAgICAgICAg ICAgICAgICAgIGlmIChzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV90aGlja25lc3MgPiAw KQorICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSBzLT5mb250LT51bmRlcmxpbmVfdGhp Y2tuZXNzOworICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB0aGlj a25lc3MgPSAxOworICAgICAgICAgICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRf bGluZSkKKyAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gdGhpY2tu ZXNzKSAtIChzLT55YmFzZSAtIHMtPnkpOworICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgLyogR2V0IHRoZSB1bmRlcmxp bmUgcG9zaXRpb24uICBUaGlzIGlzIHRoZSByZWNvbW1lbmRlZAorICAgICAgICAgICAgICAgICAg ICAgICAgIHZlcnRpY2FsIG9mZnNldCBpbiBwaXhlbHMgZnJvbSB0aGUgYmFzZWxpbmUgdG8gdGhl IHRvcCBvZgorICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSB1bmRlcmxpbmUuICBUaGlzIGlz IGEgc2lnbmVkIHZhbHVlIGFjY29yZGluZyB0byB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAg ICBzcGVjcywgYW5kIGl0cyBkZWZhdWx0IGlzCisgICAgICAgICAgICAgICAgICAgICAgICAgUk9V TkQgKChtYXhpbXVtX2Rlc2NlbnQpIC8gMiksIHdpdGgKKyAgICAgICAgICAgICAgICAgICAgICAg ICBST1VORCAoeCkgPSBmbG9vciAoeCArIDAuNSkgICovCisgICAgICAgICAgICAgICAgICAgICAg aWYgKHhfdXNlX3VuZGVybGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVzCisgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49IDAp CisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPmZvbnQtPnVuZGVybGluZV9w b3NpdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChzLT5mb250KQorICAgICAg ICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+Zm9udC0+ZGVzY2VudCArIDEpIC8gMjsK KyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBtYXgg KHBvc2l0aW9uLCB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQpOworICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgLyogQ2hlY2sgdGhlIHNhbml0eSBvZiB0aGlja25lc3MgYW5kIHBvc2l0 aW9uLiAgV2Ugc2hvdWxkCisgICAgICAgICAgICAgICAgIGF2b2lkIGRyYXdpbmcgdW5kZXJsaW5l IG91dCBvZiB0aGUgY3VycmVudCBsaW5lIGFyZWEuICAqLworICAgICAgICAgICAgICBpZiAocy0+ eSArIHMtPmhlaWdodCA8PSBzLT55YmFzZSArIHBvc2l0aW9uKQorICAgICAgICAgICAgICAgIHBv c2l0aW9uID0gKHMtPmhlaWdodCAtIDEpIC0gKHMtPnliYXNlIC0gcy0+eSk7CisgICAgICAgICAg ICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDwgcy0+eWJhc2UgKyBwb3NpdGlvbiArIHRoaWNrbmVz cykKKyAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAocy0+eSArIHMtPmhlaWdodCkgLSAocy0+ eWJhc2UgKyBwb3NpdGlvbik7CisgICAgICAgICAgICAgIHMtPnVuZGVybGluZV90aGlja25lc3Mg PSB0aGlja25lc3M7CisgICAgICAgICAgICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9cG9zaXRp b247CisgICAgICAgICAgICAgIHkgPSBzLT55YmFzZSArIHBvc2l0aW9uOworICAgICAgICAgICAg ICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgICAgIHcz Ml9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+Z2MtPmZvcmVncm91bmQsIHMtPngsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgeSwgcy0+d2lkdGgsIDEpOworICAgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5m YWNlLT51bmRlcmxpbmVfY29sb3IsIHMtPngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgeSwgcy0+d2lkdGgsIDEpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAvKiBE cmF3IG92ZXJsaW5lLiAgKi8KKyAgICAgIGlmIChzLT5mYWNlLT5vdmVybGluZV9wKQorICAgICAg ICB7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBkeSA9IDAsIGggPSAxOworICAgICAgICAgIGlm IChzLT5mYWNlLT5vdmVybGluZV9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIHczMl9m aWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+Z2MtPmZvcmVncm91bmQsIHMtPngsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5mYWNl LT5vdmVybGluZV9jb2xvciwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+ eSArIGR5LCBzLT53aWR0aCwgaCk7CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgc3RyaWtlLXRo cm91Z2guICAqLworICAgICAgaWYgKHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX3AKKyAgICAgICAg ICAmJiAhRk9OVF9URVhUTUVUUklDIChzLT5mb250KS50bVN0cnVja091dCkKKyAgICAgICAgewor ICAgICAgICAgIHVuc2lnbmVkIGxvbmcgaCA9IDE7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBk eSA9IChzLT5oZWlnaHQgLSBoKSAvIDI7CisgICAgICAgICAgaWYgKHMtPmZhY2UtPnN0cmlrZV90 aHJvdWdoX2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+ Ziwgcy0+aGRjLCBzLT5nYy0+Zm9yZWdyb3VuZCwgcy0+eCwgcy0+eSArIGR5LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgcy0+d2lkdGgsIGgpOworICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hf Y29sb3IsIHMtPngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT55ICsgZHksIHMtPndp ZHRoLCBoKTsKKyAgICAgICAgfQorICAgICAgLyogRHJhdyByZWxpZWYgaWYgbm90IHlldCBkcmF3 bi4gICovCisgICAgICBpZiAoIXJlbGllZl9kcmF3bl9wICYmIHMtPmZhY2UtPmJveCAhPSBGQUNF X05PX0JPWCkKKyAgICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19ib3ggKHMpOworICAgICAgaWYg KHMtPnByZXYpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpwcmV2 OworICAgICAgICAgIGZvciAocHJldiA9IHMtPnByZXY7IHByZXY7IHByZXYgPSBwcmV2LT5wcmV2 KQorICAgICAgICAgICAgaWYgKHByZXYtPmhsICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYg cHJldi0+eCArIHByZXYtPndpZHRoICsgcHJldi0+cmlnaHRfb3ZlcmhhbmcgPiBzLT54KQorICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogQXMgcHJldiB3YXMgZHJhd24gd2hpbGUg Y2xpcHBlZCB0byBpdHMgb3duIGFyZWEsIHdlCisgICAgICAgICAgICAgICAgICAgbXVzdCBkcmF3 IHRoZSByaWdodF9vdmVyaGFuZyBwYXJ0IHVzaW5nIHMtPmhsIG5vdy4gICovCisgICAgICAgICAg ICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIHNhdmUgPSBwcmV2LT5obDsKKyAgICAgICAgICAg ICAgICBwcmV2LT5obCA9IHMtPmhsOworICAgICAgICAgICAgICAgIG1jX3czMl9zZXRfZ2x5cGhf c3RyaW5nX2djIChwcmV2LCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAgICAgeF9zZXRfZ2x5 cGhfc3RyaW5nX2NsaXBwaW5nX2V4YWN0bHkgKHMsIHByZXYpOworICAgICAgICAgICAgICAgIGlm IChwcmV2LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBIKQorICAgICAgICAgICAgICAg ICAgeF9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChwcmV2KTsKKyAgICAgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19m b3JlZ3JvdW5kIChwcmV2KTsKKyAgICAgICAgICAgICAgICB3MzJfc2V0X2NsaXBfcmVjdGFuZ2xl IChwcmV2LT5oZGMsIE5VTEwpOworICAgICAgICAgICAgICAgIHByZXYtPmhsID0gc2F2ZTsKKyAg ICAgICAgICAgICAgICBwcmV2LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgICAgICB9CisgICAg ICAgIH0KKyAgICAgIGlmIChzLT5uZXh0KQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGds eXBoX3N0cmluZyAqbmV4dDsKKyAgICAgICAgICBmb3IgKG5leHQgPSBzLT5uZXh0OyBuZXh0OyBu ZXh0ID0gbmV4dC0+bmV4dCkKKyAgICAgICAgICAgIGlmIChuZXh0LT5obCAhPSBzLT5obAorICAg ICAgICAgICAgICAgICYmIG5leHQtPnggLSBuZXh0LT5sZWZ0X292ZXJoYW5nIDwgcy0+eCArIHMt PndpZHRoKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogQXMgbmV4dCB3aWxs IGJlIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8gaXRzIG93biBhcmVhLAorICAgICAgICAgICAgICAg ICAgIHdlIG11c3QgZHJhdyB0aGUgbGVmdF9vdmVyaGFuZyBwYXJ0IHVzaW5nIHMtPmhsIG5vdy4g ICovCisgICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIHNhdmUgPSBuZXh0LT5o bDsKKyAgICAgICAgICAgICAgICBuZXh0LT5obCA9IHMtPmhsOworICAgICAgICAgICAgICAgIG1j X3czMl9zZXRfZ2x5cGhfc3RyaW5nX2djIChuZXh0LCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAg ICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nX2V4YWN0bHkgKHMsIG5leHQpOworICAg ICAgICAgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBIKQor ICAgICAgICAgICAgICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChuZXh0KTsK KyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB4X2RyYXdfY29tcG9zaXRl X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChuZXh0KTsKKyAgICAgICAgICAgICAgICB3MzJfc2V0 X2NsaXBfcmVjdGFuZ2xlIChuZXh0LT5oZGMsIE5VTEwpOworICAgICAgICAgICAgICAgIG5leHQt PmhsID0gc2F2ZTsKKyAgICAgICAgICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAg ICAgICAgICAgIG5leHQtPmNsaXBfaGVhZCA9IHMtPm5leHQ7CisgICAgICAgICAgICAgIH0KKyAg ICAgICAgfQorICAgIH0KKyAgLyogUmVzZXQgY2xpcHBpbmcuICAqLworICB3MzJfc2V0X2NsaXBf cmVjdGFuZ2xlIChzLT5oZGMsIE5VTEwpOworICBzLT5udW1fY2xpcHMgPSAwOworfQorCisvKiBl bmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyog RnJpbmdlIGJpdG1hcHMuICAqLwogCiBzdGF0aWMgaW50IG1heF9mcmluZ2VfYm1wID0gMDsKQEAg LTU0NSw2ICsxMzc4LDE1IEBAIHhfdXBkYXRlX2JlZ2luIChzdHJ1Y3QgZnJhbWUgKmYpCiAgIGlm ICghIEZSQU1FX1czMl9QIChmKSkKICAgICByZXR1cm47CiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUg PSBmOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFJlZ2VuZXJhdGUgZGlz cGxheSBwYWxldHRlIGJlZm9yZSBkcmF3aW5nIGlmIGxpc3Qgb2YgcmVxdWVzdGVkCiAgICAgIGNv bG9ycyBoYXMgY2hhbmdlZC4gKi8KICAgaWYgKGRpc3BsYXlfaW5mby0+cmVnZW5fcGFsZXR0ZSkK QEAgLTc1NCw2ICsxNTk2LDE2IEBAIHhfdXBkYXRlX2VuZCAoc3RydWN0IGZyYW1lICpmKQogCiAg IC8qIE1vdXNlIGhpZ2hsaWdodCBtYXkgYmUgZGlzcGxheWVkIGFnYWluLiAgKi8KICAgTU9VU0Vf SExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfZGVmZXIgPSBmYWxzZTsKKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19m cmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIH0KIAogCkBAIC00 MDQxLDEzICs0ODkzLDc0IEBAIHczMl9zZXRfdmVydGljYWxfc2Nyb2xsX2JhciAoc3RydWN0IHdp bmRvdyAqdywKIAkgICAgICByZWxlYXNlX2ZyYW1lX2RjIChmLCBoZGMpOwogCSAgICAgIHhfY2xl YXJfdW5kZXJfaW50ZXJuYWxfYm9yZGVyIChmKTsKIAkgICAgfQorCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogYmVnaW4gT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aW5kb3cgKGYsIGh3bmQsIFNXX0hJ REUpOworICAgICAgICAgIE1vdmVXaW5kb3cgKGh3bmQsIGxlZnQsIHRvcCwgd2lkdGgsIG1heCAo aGVpZ2h0LCAxKSwgbGVmdCA8PSBiYXItPmxlZnQpOworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09S UyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKIAogCSAgc2kuY2JTaXplID0gc2l6ZW9m IChzaSk7CiAJICBzaS5mTWFzayA9IFNJRl9SQU5HRTsKQEAgLTQzMTYsNiArNTIyOSwyMSBAQCB3 MzJfanVkZ2Vfc2Nyb2xsX2JhcnMgKHN0cnVjdCBmcmFtZSAqZikKICAgICB7CiAgICAgICBzdHJ1 Y3Qgc2Nyb2xsX2JhciAqYiA9IFhTQ1JPTExfQkFSIChiYXIpOwogCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICAvKiBgRGVzdHJveVdp bmRvdycgd2l0aGluIGB4X3Njcm9sbF9iYXJfcmVtb3ZlJyByZXBhaW50cyB0aGUgcmVjdGFuZ2xl LgorICAgICAgVGhlcmVmb3JlLCB3ZSBmaXJzdCBzZW5kIGEgbWVzc2FnZSB0byBpbmhpYml0IHJl cGFpbnRpbmcuICovCisgICAgICBpZiAoIVdJTkRPV19MSVZFX1AgKGItPndpbmRvdykpCisgICAg ICAgIHsKKyAgICAgICAgICBIV05EIGh3bmQgPSBTQ1JPTExfQkFSX1czMl9XSU5ET1cgKGIpOwor ICAgICAgICAgIFNlbmRNZXNzYWdlIChod25kLCBXTV9TRVRSRURSQVcsIGZhbHNlLCAwKTsKKyAg ICAgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICB4X3Njcm9sbF9i YXJfcmVtb3ZlIChiKTsKIAogICAgICAgbmV4dCA9IGItPm5leHQ7CkBAIC01OTcyLDYgKzY5MDAs MjUgQEAgdzMyX2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGds eXBoX3JvdyAqZ2x5cGhfcm93LAogCiAgICAgICBzd2l0Y2ggKGN1cnNvcl90eXBlKQogCXsKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAg IGNhc2UgUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgIGJyZWFrOworICAgIGNhc2UgTEVGVF9G UklOR0VfQklUTUFQOgorICAgICAgYnJlYWs7CisgICAgY2FzZSBOT19GUklOR0VfQklUTUFQOgor ICAgICAgYnJlYWs7CisgICAgY2FzZSBGUkFNRURfQk9YX0NVUlNPUjoKKyAgICAgIC8qIFRoaXMg ZmVhdHVyZSBoYXMgYmVlbiBkZWxpYmVyYXRlbHkgZGlzYWJsZWQgZm9yIHRoZSB0aW1lIGJlaW5n LiAqLworICAgICAgeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIGdseXBoX3Jvdyk7CisgICAgICBi cmVhazsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCWNhc2UgSE9MTE9XX0JPWF9D VVJTT1I6CiAJICB4X2RyYXdfaG9sbG93X2N1cnNvciAodywgZ2x5cGhfcm93KTsKIAkgIGJyZWFr OwpAQCAtNzA5MSw2ICs4MDM4LDIxIEBAIGV4dGVybiBmcmFtZV9wYXJtX2hhbmRsZXIgdzMyX2Zy YW1lX3Bhcm1faGFuZGxlcnNbXTsKIAogc3RhdGljIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNl IHczMl9yZWRpc3BsYXlfaW50ZXJmYWNlID0KIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGlu IGB3MzJ0ZXJtLmNgIG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVk aXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfeF93cml0ZV9n bHlwaHMsCisgIG1jX3czMl9kcmF3X3dpbmRvd19jdXJzb3IsCisgIG1jX3czMl9kcmF3X2dseXBo X3N0cmluZywKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICB3MzJfZnJhbWVfcGFy bV9oYW5kbGVycywKICAgeF9wcm9kdWNlX2dseXBocywKICAgeF93cml0ZV9nbHlwaHMsCmRpZmYg LS1naXQgYS9zcmMvd2luZG93LmggYi9zcmMvd2luZG93LmgKaW5kZXggZmRlZjQwNy4uMzY3MGIy MyAxMDA2NDQKLS0tIGEvc3JjL3dpbmRvdy5oCisrKyBiL3NyYy93aW5kb3cuaApAQCAtODgsNiAr ODgsMjMgQEAgZGlzcGxheSB0aGUgbWVudSBiYXIgb3IgdGhlIHRvb2wgYmFyICh3aGVuIEVtYWNz IHVzZXMgdG9vbGtpdHMgdGhhdAogZG9uJ3QgZGlzcGxheSB0aGVpciBvd24gbWVudSBiYXIgYW5k IHRvb2wgYmFyKSBvciBhIHRvb2x0aXAgaW4gYQogdG9vbHRpcCBmcmFtZSAod2hlbiB0b29sdGlw cyBhcmUgbm90IGRpc3BsYXkgYnkgdGhlIHRvb2xraXQpLiAgKi8KIAorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogU3VmZml4ZXMgZm9yIHRo ZSBgbWNgIHdpbmRvdyBwb2ludGVyIHByZWZpeC4gKi8KK3N0cnVjdCBtdWx0aXBsZV9jdXJzb3Jz Cit7CisgIC8qIFBpeGVsIHBvc2l0aW9uICh3aW5kb3cgcmVsYXRpdmUpIG9mIGhvcml6b250YWwv dmVydGljYWwgcnVsZXJzLiAqLworICBpbnQgZmNfeDsKKworICAvKiBUaGUgcmVjb3JkZWQgcGl4 ZWwgd2lkdGggb2YgdGhlIGxhc3QgbGluZSBudW1iZXIgZHJhd24gZHVyaW5nIHJlZGlzcGxheSAq LworICBpbnQgbG51bV9waXhlbF93aWR0aDsKK307CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKIHN0cnVjdCBjdXJzb3JfcG9zCiB7CiAgIC8qIFBpeGVsIHBvc2l0aW9uLiAgVGhlc2Ug YXJlIGFsd2F5cyB3aW5kb3cgcmVsYXRpdmUuICAqLwpAQCAtMjA5LDYgKzIyNiwzMyBAQCBzdHJ1 Y3Qgd2luZG93CiAgICAgLyogQW4gYWxpc3Qgd2l0aCBwYXJhbWV0ZXJzLiAgKi8KICAgICBMaXNw X09iamVjdCB3aW5kb3dfcGFyYW1ldGVyczsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIExpc3BfT2JqZWN0IG1jX3RlbXBfY2FjaGU7 CisKKyAgICAvKiBUaGUgY2FjaGUgZm9yIG11bHRpcGxlIGZha2UgY3Vyc29ycy4gKi8KKyAgICBM aXNwX09iamVjdCBtY19jYWNoZTsKKworICAgIC8qIFRoZSBjYWNoZSBmb3IgY3Jvc3NoYWlycy4g Ki8KKyAgICBMaXNwX09iamVjdCBjaF9jYWNoZTsKKworICAgIC8qIFRoZSBjYWNoZSBmb3Igdmlz aWJsZSBmaWxsIGNvbHVtbi4gKi8KKyAgICBMaXNwX09iamVjdCBmY19jYWNoZTsKKworICAgIC8q IEwuUy5MLiBjb2xvciB2ZWN0b3IgdXNlZCBieSBjcm9zc2hhaXJzLiAqLworICAgIExpc3BfT2Jq ZWN0IGNoX2ZvcmVncm91bmQ7CisKKyAgICAvKiBMLlMuTC4gY29sb3IgdmVjdG9yIHVzZWQgYnkg dmlzaWJsZSBmaWxsIGNvbHVtbi4gKi8KKyAgICBMaXNwX09iamVjdCBmY19mb3JlZ3JvdW5kOwor CisvKiBOT1RFOiAgQXMgb2YgMDQvMDgvMjAxOSAoYTAzOGRmNzdkZTdiMWFhMmQ3M2E2NDc4NDkz Yjg4MzhiNTllNDk4MiksIHRoZSBMQVNUCisgICBMaXNwX09iamVjdCBtdXN0IGJlIGBtb2RlX2xp bmVfaGVscF9lY2hvJy4gKi8KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgIC8q IFRoZSBoZWxwIGVjaG8gdGV4dCBmb3IgdGhpcyB3aW5kb3cuICBRbmlsIGlmIHRoZXJlJ3Mgbm9u ZS4gICovCiAgICAgTGlzcF9PYmplY3QgbW9kZV9saW5lX2hlbHBfZWNobzsKIApAQCAtMzI0LDYg KzM2OCwxNiBAQCBzdHJ1Y3Qgd2luZG93CiAKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KIAor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAg IC8qIFRoZSBwcmVmaXggZm9yIHdpbmRvdyBwb2ludGVycyByZWxhdGluZyB0byBtdWx0aXBsZSBj dXJzb3JzLiAgKi8KKyAgICBzdHJ1Y3QgbXVsdGlwbGVfY3Vyc29ycyBtYzsKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogICAgIC8qIEN1cnNvciB0eXBlIG9mIGxhc3QgY3Vyc29yIGRy YXduIG9uIHRoZSB3aW5kb3cuICAqLwogICAgIGVudW0gdGV4dF9jdXJzb3Jfa2luZHMgcGh5c19j dXJzb3JfdHlwZTsKIApAQCAtNDQzLDYgKzQ5Nyw0OSBAQCBzdHJ1Y3Qgd2luZG93CiAgICAgcHRy ZGlmZl90IHdpbmRvd19lbmRfYnl0ZXBvczsKICAgfSBHQ0FMSUdORURfU1RSVUNUOwogCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCitJTkxJTkUg dm9pZAord3NldF9tY190ZW1wX2NhY2hlIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNwX09iamVjdCB2 YWwpCit7CisgIHctPm1jX3RlbXBfY2FjaGUgPSB2YWw7Cit9CisKK0lOTElORSB2b2lkCit3c2V0 X21jX2NhY2hlIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNwX09iamVjdCB2YWwpCit7CisgIHctPm1j X2NhY2hlID0gdmFsOworfQorCitJTkxJTkUgdm9pZAord3NldF9jaF9jYWNoZSAoc3RydWN0IHdp bmRvdyAqdywgTGlzcF9PYmplY3QgdmFsKQoreworICB3LT5jaF9jYWNoZSA9IHZhbDsKK30KKwor SU5MSU5FIHZvaWQKK3dzZXRfZmNfY2FjaGUgKHN0cnVjdCB3aW5kb3cgKncsIExpc3BfT2JqZWN0 IHZhbCkKK3sKKyAgdy0+ZmNfY2FjaGUgPSB2YWw7Cit9CisKK0lOTElORSB2b2lkCit3c2V0X2No X2ZvcmVncm91bmQgKHN0cnVjdCB3aW5kb3cgKncsIExpc3BfT2JqZWN0IHZhbCkKK3sKKyAgdy0+ Y2hfZm9yZWdyb3VuZCA9IHZhbDsKK30KKworSU5MSU5FIHZvaWQKK3dzZXRfZmNfZm9yZWdyb3Vu ZCAoc3RydWN0IHdpbmRvdyAqdywgTGlzcF9PYmplY3QgdmFsKQoreworICB3LT5mY19mb3JlZ3Jv dW5kID0gdmFsOworfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiBJTkxJTkUgYm9v bAogV0lORE9XUCAoTGlzcF9PYmplY3QgYSkKIHsKQEAgLTExMjAsNiArMTIxNywxNSBAQCBleHRl cm4gdm9pZCByZWRpc3BsYXlfb3RoZXJfd2luZG93cyAodm9pZCk7CiAKIHN0cnVjdCBnbHlwaCAq Z2V0X3BoeXNfY3Vyc29yX2dseXBoIChzdHJ1Y3Qgd2luZG93ICp3KTsKIAorCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworc3RydWN0IGdseXBoICpt Y19nZXRfY3Vyc29yX2dseXBoIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4 ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IGhwb3MsIGludCB2cG9zKTsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogVHJ1ZSBpZiBXSU5ET1cgaXMgYSB2YWxp ZCB3aW5kb3cuICAqLwogI2RlZmluZSBXSU5ET1dfVkFMSURfUChXSU5ET1cpCQkJCQlcCiAgIChX SU5ET1dQIChXSU5ET1cpICYmICFOSUxQIChYV0lORE9XIChXSU5ET1cpLT5jb250ZW50cykpCVwK ZGlmZiAtLWdpdCBhL3NyYy94ZGlzcC5jIGIvc3JjL3hkaXNwLmMKaW5kZXggYTg4ZmM2OS4uODk2 NTE4YyAxMDA2NDQKLS0tIGEvc3JjL3hkaXNwLmMKKysrIGIvc3JjL3hkaXNwLmMKQEAgLTkyMSw2 ICs5MjEsNDA4MSBAQCBzdGF0aWMgdm9pZCBzaG93X21vdXNlX2ZhY2UgKE1vdXNlX0hMSW5mbyAq LCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UpOwogc3RhdGljIGJvb2wgY29vcmRzX2luX21vdXNlX2Zh Y2VfcCAoc3RydWN0IHdpbmRvdyAqLCBpbnQsIGludCk7CiAKIAorLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIE1VTFRJUExFLUNVUlNP UlM6ICBFbWFjcyBCdWcgIzIyODczIChmZWF0dXJlIHJlcXVlc3QpCisKKyAgQ1JPU1NIQUlSUzog IEVtYWNzIEJ1ZyAjMTc2ODQgKGZlYXR1cmUgcmVxdWVzdCkKKworCitWRVJTSU9OOgorCistIDAx OC4wMDAgWzA0LzA4LzIwMTldCistIDAxNy4wMDAgWzEyLzEzLzIwMThdCistIDAxNi4wMDAgWzEx LzIwLzIwMThdCistIDAxNS4wMDAgWzExLzEwLzIwMThdCistIDAxNC4wMDAgWzA4LzI4LzIwMThd CisKKworQ0hBTkdFTE9HOgorCistIENyZWF0a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ICAgICAgY2FzZSBYV0lER0VUX0dM WVBIOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAg ICAgICBNQ19CVUlMRF9YV0lER0VUX0dMWVBIX1NUUklORyAoU1RBUlQsIEVORCwgSEVBRCwgVEFJ TCwgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEws IFgsIExBU1RfWCk7ICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICBicmVhazsKKworI2Rl ZmluZSBNQ19CVUlMRF9HTFlQSF9TVFJJTkdTXzIoU1RBUlQsIEVORCwgSEVBRCwgVEFJTCwgSEws IFgsIExBU1RfWCkJXAorCSAgICBjYXNlIEdMWVBITEVTU19HTFlQSDoJCQkJCVwKKwkgICAgICBN Q19CVUlMRF9HTFlQSExFU1NfR0xZUEhfU1RSSU5HIChTVEFSVCwgRU5ELCBIRUFELCBUQUlMLAlc CisJCQkJCSAgICBITCwgWCwgTEFTVF9YKTsJCVwKKwkgICAgICBicmVhazsJCQkJCQkJXAorCQkJ CQkJCQkJXAorCSAgICBkZWZhdWx0OgkJCQkJCQlcCisJICAgICAgZW1hY3NfYWJvcnQgKCk7CQkJ CQkJXAorCSAgICB9CQkJCQkJCQlcCisJCQkJCQkJCQlcCisJICBpZiAocykJCQkJCQkJXAorCSAg ICB7CQkJCQkJCQlcCisJICAgICAgc2V0X2dseXBoX3N0cmluZ19iYWNrZ3JvdW5kX3dpZHRoIChz LCBTVEFSVCwgTEFTVF9YKTsJXAorCSAgICAgIChYKSArPSBzLT53aWR0aDsJCQkJCQlcCisJICAg IH0JCQkJCQkJCVwKKwl9CQkJCQkJCQlcCisgICAgfSB3aGlsZSAoZmFsc2UpCisKKyNkZWZpbmUg TUNfQlVJTERfR0xZUEhfU1RSSU5HUyhTVEFSVCwgRU5ELCBIRUFELCBUQUlMLCBITCwgWCwgTEFT VF9YKQlcCisgICAgTUNfQlVJTERfR0xZUEhfU1RS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DApCisKK0xpc3BfT2JqZWN0CittY192ZWN0 b3IgKGludCBsZW5ndGgpCit7CisgIHN0cnVjdCBMaXNwX1ZlY3RvciAqcCA9IGFsbG9jYXRlX3Zl Y3RvciAobGVuZ3RoKTsKKyAgZm9yIChwdHJkaWZmX3QgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykK KyAgICBwLT5jb250ZW50c1tpXSA9IFFuaWw7CisgIHJldHVybiBtYWtlX2xpc3BfcHRyIChwLCBM aXNwX1ZlY3Rvcmxpa2UpOworfQorCitMaXNwX09iamVjdAorbWNfbnRoIChpbnQgbnVtLCBMaXNw X09iamVjdCBsaXN0KQoreworICBmb3IgKGludCBpID0gMDsgaSA8IG51bSAmJiAhTklMUCAobGlz dCk7IGkrKykKKyAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgIGlmIChDT05TUCAobGlzdCkpCisg ICAgcmV0dXJuIFhDQVIgKGxpc3QpOworICAgIGVsc2UKKyAgICAgIHJldHVybiBRbmlsOworfQor CitMaXNwX09iamVjdAorbWNfYXNzcSAoTGlzcF9PYmplY3Qga2V5LCBMaXNwX09iamVjdCBsaXN0 KQoreworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAg ICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYmIEVRIChYQ0FSIChY Q0FSIChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChs aXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FS IChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhDQVIgKFhDQVIgKGxpc3QpKSwga2V5KSkp CisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFD T05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAg ICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBrZXkpKSkKKyAgICAgICAgYnJlYWs7Cisg ICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgfQorICBpZiAoQ09OU1AgKGxpc3QpKQorICAg IHJldHVybiBYQ0FSIChsaXN0KTsKKyAgICBlbHNlCisgICAgICByZXR1cm4gUW5pbDsKK30KKwor TGlzcF9PYmplY3QKK21jX2Fzc29jIChMaXNwX09iamVjdCBrZXksIExpc3BfT2JqZWN0IGxpc3Qp Cit7CisgIExpc3BfT2JqZWN0IGNhcjsKKyAgd2hpbGUgKDEpCisgICAgeworICAgICAgaWYgKCFD T05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAg ICAgICAmJiAoY2FyID0gWENBUiAoWENBUiAobGlzdCkpLAorICAgICAgICAgICAgICAgICAgRVEg KGNhciwga2V5KSB8fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAgICAgIGJyZWFr OworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAg ICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiAoY2FyID0g WENBUiAoWENBUiAobGlzdCkpLAorICAgICAgICAgICAgICAgICAgRVEgKGNhciwga2V5KSB8fCAh TklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9 IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09O U1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiAoY2FyID0gWENBUiAoWENBUiAobGlz dCkpLAorICAgICAgICAgICAgICAgICAgRVEgKGNhciwga2V5KSB8fCAhTklMUCAoRmVxdWFsIChj YXIsIGtleSkpKSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOwor ICAgIH0KKyAgaWYgKENPTlNQIChsaXN0KSkKKyAgICByZXR1cm4gWENBUiAobGlzdCk7CisgICAg ZWxzZQorICAgICAgcmV0dXJuIFFuaWw7Cit9CisKK0xpc3BfT2JqZWN0CittY19wbGlzdF9nZXQg KExpc3BfT2JqZWN0IHBsaXN0LCBMaXNwX09iamVjdCBwcm9wKQoreworICBMaXNwX09iamVjdCB0 YWlsLCBoYWxmdGFpbDsKKyAgLyogaGFsZnRhaWwgaXMgdXNlZCB0byBkZXRlY3QgY2lyY3VsYXIg bGlzdHMuICAqLworICB0YWlsID0gaGFsZnRhaWwgPSBwbGlzdDsKKyAgd2hpbGUgKENPTlNQICh0 YWlsKSAmJiBDT05TUCAoWENEUiAodGFpbCkpKQorICAgIHsKKyAgICAgIGlmIChFUSAocHJvcCwg WENBUiAodGFpbCkpKQorICAgICAgICByZXR1cm4gWENBUiAoWENEUiAodGFpbCkpOworICAgICAg dGFpbCA9IFhDRFIgKFhDRFIgKHRhaWwpKTsKKyAgICAgIGhhbGZ0YWlsID0gWENEUiAoaGFsZnRh aWwpOworICAgICAgaWYgKEVRICh0YWlsLCBoYWxmdGFpbCkpCisgICAgICAgIGJyZWFrOworICAg IH0KKyAgcmV0dXJuIFFuaWw7Cit9CisKK0xpc3BfT2JqZWN0CittY19tZW1xIChMaXNwX09iamVj dCBlbHQsIExpc3BfT2JqZWN0IGxpc3QpCit7CisgIHdoaWxlICgxKQorICAgIHsKKyAgICAgIGlm ICghQ09OU1AgKGxpc3QpIHx8IEVRIChYQ0FSIChsaXN0KSwgZWx0KSkKKyAgICAgICAgYnJlYWs7 CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KSB8fCBF USAoWENBUiAobGlzdCksIGVsdCkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIg KGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkgfHwgRVEgKFhDQVIgKGxpc3QpLCBlbHQp KQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICB9CisgIHJl dHVybiBsaXN0OworfQorCitMaXNwX09iamVjdAorbWNfbGlzdG4gKHB0cmRpZmZfdCBjb3VudCwg TGlzcF9PYmplY3QgYXJnLCAuLi4pCit7CisgIGVhc3N1bWUgKDAgPCBjb3VudCk7CisgIExpc3Bf T2JqZWN0IHZhbCA9IEZjb25zIChhcmcsIFFuaWwpOworICBMaXNwX09iamVjdCB0YWlsID0gdmFs OworICB2YV9saXN0IGFwOworICB2YV9zdGFydCAoYXAsIGFyZyk7CisgIGZvciAocHRyZGlmZl90 IGkgPSAxOyBpIDwgY291bnQ7IGkrKykKKyAgICB7CisgICAgICBMaXNwX09iamVjdCBlbGVtID0g RmNvbnMgKHZhX2FyZyAoYXAsIExpc3BfT2JqZWN0KSwgUW5pbCk7CisgICAgICBYU0VUQ0RSICh0 YWlsLCBlbGVtKTsKKyAgICAgIHRhaWwgPSBlbGVtOworICAgIH0KKyAgdmFfZW5kIChhcCk7Cisg IHJldHVybiB2YWw7Cit9CisKKy8qIENoZWNrIHRoZSBwcmVzZW5jZSBvZiBhIGRpc3BsYXkgcHJv cGVydHkgYW5kIGNvbXB1dGUgaXRzIHdpZHRoLgorICAgSWYgYSBwcm9wZXJ0eSB3YXMgZm91bmQg YW5kIGl0cyB3aWR0aCB3YXMgZm91bmQgYXMgd2VsbCwgcmV0dXJuCisgICBpdHMgd2lkdGggKD49 IDApIGFuZCBzZXQgdGhlIHBvc2l0aW9uIG9mIHRoZSBlbmQgb2YgdGhlIHByb3BlcnR5CisgICBp biBFTkRQT1MuCisgICBPdGhlcndpc2UganVzdCByZXR1cm4gLTEuICovCitzdGF0aWMgaW50Citt Y19jaGVja19kaXNwbGF5X3dpZHRoIChwdHJkaWZmX3Qg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SAr IDAuNSk7CisgICAgICBlbHNlIGlmICgocHJvcCA9IG1jX3BsaXN0X2dldCAocGxpc3QsIFFDYWxp Z25fdG8pLAorICAgIFJBTkdFRF9GSVhOVU1QIChjb2wsIHByb3AsIGFsaWduX3RvX21heCkpKQor ICB3aWR0aCA9IFhGSVhOVU0gKHByb3ApIC0gY29sOworICAgICAgZWxzZSBpZiAoRkxPQVRQIChw cm9wKSAmJiBjb2wgPD0gWEZMT0FUX0RBVEEgKHByb3ApCisgICAgICAgICAmJiAoWEZMT0FUX0RB VEEgKHByb3ApIDw9IGFsaWduX3RvX21heCkpCisgIHdpZHRoID0gKGludCkoWEZMT0FUX0RBVEEg KHByb3ApICsgMC41KSAtIGNvbDsKKyAgICAgIGlmICh3aWR0aCA+PSAwKQorICB7CisgICAgcHRy ZGlmZl90IHN0YXJ0OworICAgIGlmIChPVkVSTEFZUCAob3ZlcmxheSkpCisgICAgICAqZW5kcG9z ID0gT1ZFUkxBWV9QT1NJVElPTiAoT1ZFUkxBWV9FTkQgKG92ZXJsYXkpKTsKKyAgICBlbHNlCisg ICAgICBnZXRfcHJvcGVydHlfYW5kX3JhbmdlIChwb3MsIFFkaXNwbGF5LCAmdmFsLCAmc3RhcnQs IGVuZHBvcywgUW5pbCk7CisgICAgLyogRm9yIDpyZWxhdGl2ZS13aWR0aCwgd2UgbmVlZCB0byBt dWx0aXBseSBieSB0aGUgY29sdW1uCisgICAgICAgd2lkdGggb2YgdGhlIGNoYXJhY3RlciBhdCBQ T1MsIGlmIGl0IGlzIGdyZWF0ZXIgdGhhbiAxLiAqLworICAgIGlmICghTklMUCAobWNfcGxpc3Rf Z2V0IChwbGlzdCwgUUNyZWxhdGl2ZV93aWR0aCkpCisgICAgICAgICYmICFOSUxQIChCVkFSIChj dXJyZW50X2J1ZmZlciwgZW5hYmxlX211bHRpYnl0ZV9jaGFyYWN0ZXJzKSkpCisgICAgICB7Cisg ICAgICAgIGludCBiLCB3ZDsKKyAgICAgICAgdW5zaWduZ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UEhfQ09E RV9DSEFSIChlbnRyeSk7CisgICAgICAgIGVsc2UKKyAgICBjID0gJyAnOworICAgICAgICBpZiAo YyA9PSAnXG4nKQorICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgaWYgKGMgPT0gJ1xyJyAmJiBF USAoQlZBUiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKQorICAgIGdv dG8gZW5kbG9vcDsKKyAgICAgICAgaWYgKGMgPT0gJ1x0JykKKyAgICB7CisgICAgICBjb2wgKz0g dGFiX3dpZHRoOworICAgICAgY29sID0gY29sIC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOworICAg IH0KKyAgICAgICAgZWxzZQorICAgICsrY29sOworICAgICAgfQorICB9CisgICAgICBlbHNlCisg IHsKKyAgICAvKiBUaGUgZGlzcGxheSB0YWJsZSBkb2Vzbid0IGFmZmVjdCB0aGlzIGNoYXJhY3Rl cjsKKyAgICAgICBpdCBkaXNwbGF5cyBhcyBpdHNlbGYuICovCisgICAgaWYgKGMgPT0gJ1xuJykK KyAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICBpZiAoYyA9PSAnXHInICYmIEVRIChCVkFSIChjdXJy ZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rpc3BsYXkpLCBRdCkpCisgICAgICBnb3RvIGVuZGxvb3A7 CisgICAgaWYgKGMgPT0gJ1x0JykKKyAgICAgIHsKKyAgICAgICAgY29sICs9IHRhYl93aWR0aDsK KyAgICAgICAgY29sID0gY29sIC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOworICAgICAgfQorICAg IGVsc2UgaWYgKG11bHRpYnl0ZSAmJiBMRUFESU5HX0NPREVfUCAoYykpCisgICAgICB7CisgICAg ICAgIC8qIFN0YXJ0IG9mIG11bHRpLWJ5dGUgZm9ybS4gKi8KKyAgICAgICAgdW5zaWduZWQgY2hh ciAqcHRyOworICAgICAgICBpbnQgYnl0ZXMsIHdpZHRoOworICAgICAgICBwdHIgPSBCWVRFX1BP U19BRERSIChzY2FuX2J5dGUpOworICAgICAgICBNQ19NVUxUSUJZVEVfQllURVNfV0lEVEggKHB0 ciwgZHAsIGJ5dGVzLCB3aWR0aCk7CisgICAgICAgIC8qIFN1YnRyYWN0IG9uZSB0byBjb21wZW5z YXRlIGZvciB0aGUgaW5jcmVtZW50CisgICAgIHRoYXQgaXMgZ29pbmcgdG8gaGFwcGVuIGJlbG93 LiAqLworICAgICAgICBzY2FuX2J5dGUgKz0gYnl0ZXMgLSAxOworICAgICAgICBjb2wgKz0gd2lk dGg7CisgICAgICB9CisgICAgZWxzZSBpZiAoY3RsX2Fycm93ICYmIChjIDwgMDQwIHx8IGMgPT0g MDE3NykpCisgICAgICBjb2wgKz0gMjsKKyAgICBlbHNlIGlmIChjIDwgMDQwIHx8IGMgPj0gMDE3 NykKKyAgICAgIGNvbCArPSA0OworICAgIGVsc2UKKyAgICAgIGNvbCsrOworICB9CisgICAgICBz Y2FuKys7CisgICAgICBzY2FuX2J5dGUrKzsKKyAgICB9CisgZW5kbG9vcDoKKyAgbGFzdF9rbm93 bl9jb2x1bW4gPSBjb2w7CisgIGxhc3Rfa25vd25fY29sdW1uX3BvaW50ID0gcHQ7CisgIGxhc3Rf a25vd25fY29sdW1uX21vZGlmaWVkID0gTU9ESUZGOworICBpZiAoZ29hbGNvbCkKKyAgICAqZ29h bGNvbCA9IGNvbDsKKyAgaWYgKGVuZHBvcykKKyAgICAqZW5kcG9zID0gc2NhbjsKKyAgaWYgKHBy ZXZjb2wpCisgICAgKnByZXZjb2wgPSBwcmV2X2NvbDsKK30KKworcHRyZGlmZl90CittY19jdXJy ZW50X2NvbHVtbiAoc3RydWN0IHdpbmRvdyAqdywgcHRyZGlmZl90IHB0KQoreworICAvKiBgYnVm X2NoYXJwb3NfdG9fYnl0ZXBvcyc6ICBlYXNzZXJ0IChCVUZfQkVHIChiKSA8PSBjaGFycG9zICYm IGNoYXJwb3MgPD0gQlVGX1ogKGIpKTsgK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gICAg JiYgTU9ESUZGID09IGxhc3Rfa25vd25fY29sdW1uX21vZGlmaWVkKQorICAgIHsKKyAgICAgIGlm IChvbGRfYnVmZmVyKQorICAgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsK KyAgICAgIHJldHVybiBsYXN0X2tub3duX2NvbHVtbjsKKyAgICB9CisgIC8qIElmIHRoZSBidWZm ZXIgaGFzIG92ZXJsYXlzLCB0ZXh0IHByb3BlcnRpZXMsCisgICAgIG9yIG11bHRpYnl0ZSBjaGFy YWN0ZXJzLCB1c2UgYSBtb3JlIGdlbmVyYWwgYWxnb3JpdGhtLiAqLworICBpZiAoYnVmZmVyX2lu dGVydmFscyAoY3VycmVudF9idWZmZXIpCisgICAgICB8fCBidWZmZXJfaGFzX292ZXJsYXlzICgp CisgICAgICB8fCBaICE9IFpfQllURSkKKyAgICB7CisgICAgICBFTUFDU19JTlQgY29sID0gTU9T VF9QT1NJVElWRV9GSVhOVU07CisgICAgICBtY19zY2FuX2Zvcl9jb2x1bW4gKCZwdCwgJmNvbCwg TlVMTCwgcHQpOworICAgICAgeworICAgICAgICBpZiAob2xkX2J1ZmZlcikKKyAgICAgICAgICBz ZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKyAgICAgICAgcmV0dXJuIGNvbDsKKyAg ICAgIH0KKyAgICB9CisgIC8qIFNjYW4gYmFja3dhcmRzIGZyb20gcG9pbnQgdG8gdGhlIHByZXZp b3VzIG5ld2xpbmUsCisgICAgIGNvdW50aW5nIHdpZHRoLiAgVGFiIGNoYXJhY3RlcnMgYXJlIHRo ZSBvbmx5IGNvbXBsaWNhdGVkIGNhc2UuICovCisgIC8qIE1ha2UgYSBwb2ludGVyIGZvciBkZWNy ZW1lbnRpbmcgdGhyb3VnaCB0aGUgY2hhcnMgYmVmb3JlIHBvaW50LiAqLworICBwdHIgPSBCWVRF X1BPU19BRERSIChDSEFSX1RPX0JZVEUgKHB0KSAtIDEpICsgM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Yyk7CisgIH0KKyAgICAgIGVsc2UKKyAgeworICAgIGNoYXJ2ZWMgPSBRbmls OworICAgIG4gPSAxOworICB9CisgICAgICBmb3IgKGkgPSBuIC0gMTsgaSA+PSAwOyAtLWkpCisg IHsKKyAgICBpZiAoVkVDVE9SUCAoY2hhcnZlYykpCisgICAgICB7CisgICAgICAgIC8qIFRoaXMg c2hvdWxkIGJlIGhhbmRsZWQgdGhlIHNhbWUgYXMKKyAgICAgbmV4dF9lbGVtZW50X2Zyb21fZGlz cGxheV92ZWN0b3IgZG9lcyBpdC4gKi8KKyAgICAgICAgTGlzcF9PYmplY3QgZW50cnkgPSBBUkVG IChjaGFydmVjLCBpKTsKKyAgICAgICAgaWYgKEdMWVBIX0NPREVfUCAoZW50cnkpKQorICAgIGMg PSBHTFlQSF9DT0RFX0NIQVIgKGVudHJ5KTsKKyAgICAgICAgZWxzZQorICAgIGMgPSAnICc7Cisg ICAgICB9CisgICAgaWYgKGMgPj0gMDQwICYmIGMgPCAwMTc3KQorICAgICAgY29sKys7CisgICAg ZWxzZSBpZiAoYyA9PSAnXG4nCisgICAgICAgfHwgKGMgPT0gJ1xyJworICAgICAgICAgICAmJiBF USAoQlZBUiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKSkKKyAgICAg IHsKKyAgICAgICAgcHRyKys7CisgICAgICAgIGdvdG8gc3RhcnRfb2ZfbGluZV9mb3VuZDsKKyAg ICAgIH0KKyAgICBlbHNlIGlmIChjID09ICdcdCcpCisgICAgICB7CisgICAgICAgIGlmICh0YWJf c2VlbikKKyAgICBjb2wgPSAoKGNvbCArIHRhYl93aWR0aCkgLyB0YWJfd2lkdGgpICogdGFiX3dp ZHRoOworICAgICAgICBwb3N0X3RhYiArPSBjb2w7CisgICAgICAgIGNvbCA9IDA7CisgICAgICAg IHRhYl9zZWVuID0gMTsKKyAgICAgIH0KKyAgICBlbHNlIGlmIChWRUNUT1JQIChjaGFydmVjKSkK KyAgICAgIC8qIFdpdGggYSBkaXNwbGF5IHRhYmxlIGVudHJ5LCBDIGlzIGRpc3BsYXllZCBhcyBp cywgYW5kCisgICAgICAgICBub3QgZGlzcGxheWVkIGFzIFxOTk4gb3IgYXMgXk4uICBJZiBDIGlz IGEgc2luZ2xlLWJ5dGUKKyAgICAgICAgIGNoYXJhY3RlciwgaXQgdGFrZXMgb25lIGNvbHVtbi4g IElmIEMgaXMgbXVsdGktYnl0ZSBpbgorICAgICAgICAgYSB1bmlieXRlIGJ1ZmZlciwgaXQncyB0 cmFuc2xhdGVkIHRvIHVuaWJ5dGUsIHNvIGl0CisgICAgICAgICBhbHNvIHRha2VzIG9uZSBjb2x1 bW4uICovCisgICAgICArK2NvbDsKKyAgICBlbHNlCisgICAgICBjb2wgKz0gKGN0bF9hcnJvdyAm JiBjIDwgMDIwMCkgPyAyIDogNDsKKyAgfQorICAgIH0KKyBzdGFydF9vZl9saW5lX2ZvdW5kOgor ICBpZiAodGFiX3NlZW4pCisgICAgeworICAgICAgY29sID0gKChjb2wgKyB0YWJfd2lkdGgpIC8g dGFiX3dpZHRoKSAqIHRhYl93aWR0aDsKKyAgICAgIGNvbCArPSBwb3N0X3RhYjsKKyAgICB9Cisg IGxhc3Rfa25vd25fY29sdW1uID0gY29sOworICBsYXN0X2tub3duX2NvbHVtbl9wb2ludCA9IHB0 OworICBsYXN0X2tub3duX2NvbHVtbl9tb2RpZmllZCA9IE1PRElGRjsKKyAgaWYgKG9sZF9idWZm ZXIpCisgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworICByZXR1cm4gY29sOwor fQorCitERUZVTiAoIm1jLWN1cnJlbnQtY29sdW1uIiwgRm1jX2N1cnJlbnRfY29sdW1uLCBTbWNf Y3VycmVudF9jb2x1bW4sIDIsIDIsIDAsCisgICAgICAgZG9jOiAvKiBSZXR1cm4gdGhlIGhvcml6 b250YWwgcG9zaXRpb24gb2YgcG9pbnQuICBCZWdpbm5pbmcgb2YgbG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CAodGVtcCwgbWNfY3Vy cmVudF9jb2x1bW4gKHcsIFhGSVhOVU0gKHB0KSkpOworICByZXR1cm4gdGVtcDsKK30KKworLyog VVNBR0U6ICBmcHJpbnRmIChzdGRlcnIsICJGUkFNRSAoJXMpIiwgbWNfZnJhbWUgKGYpKTsgKi8K K2NoYXIgKgorbWNfZnJhbWUgKHN0cnVjdCBmcmFtZSAqZikKK3sKKyAgTGlzcF9PYmplY3QgZnJh bWU7CisgIFhTRVRGUkFNRSAoZnJhbWUsIGYpOworICByZXR1cm4gU1NEQVRBIChGcHJpbjFfdG9f c3RyaW5nIChmcmFtZSwgUW5pbCkpOworfQorCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwg IldJTkRPVyAoJXMpIiwgbWNfd2luZG93ICh3KSk7ICovCitjaGFyICoKK21jX3dpbmRvdyAoc3Ry dWN0IHdpbmRvdyAqdykKK3sKKyAgTGlzcF9PYmplY3Qgd2luZG93OworICBYU0VUV0lORE9XICh3 aW5kb3csIHcpOworICByZXR1cm4gU1NEQVRBIChGcHJpbjFfdG9fc3RyaW5nICh3aW5kb3csIFFu aWwpKTsKK30KKworLyogVVNBR0U6ICBmcHJpbnRmIChzdGRlcnIsICJDSEFSQUNURVIgKCVzKSIs IG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkpOyAqLworY2hhciAqCittY19jaGFyX3Rv X3N0cmluZyAoaW50IGFyZykKK3sKKyAgTGlzcF9PYmplY3QgY2hhcmFjdGVyID0gKENIQVJBQ1RF UlAgKG1ha2VfZml4bnVtIChhcmcpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgID8gRmNo YXJfdG9fc3RyaW5nIChtYWtlX2ZpeG51bSAoYXJnKSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogUW5pbDsKKyAgY2hhciAqIHJlc3VsdCA9ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAg ICAgICAgICAgICAgICYmIGFyZyA9PSA5KQorICAgICAgICAgICAgICAgICAgICA/IFNTREFUQSAo YnVpbGRfc3RyaW5nICgiXFx0IikpCisgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFj dGVyKQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDEwKQorICAgICAgICAgICAgICAg ICAgICA/IFNTREFUQSAoYnVpbGRfc3RyaW5nICgiXFxuIikpCisgICAgICAgICAgICAgICAgICA6 ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDMyKQor ICAgICAgICAgICAgICAgICAgICA/IFNTREFUQSAoYnVpbGRfc3RyaW5nICgiXFxzIikpCisgICAg ICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAg JiYgYXJnICE9IDkKKyAgICAgICAgICAgICAgICAgICAgICYmIGFyZyAhPSAxMAorICAgICAgICAg ICAgICAgICAgICAgJiYgYXJnICE9IDMyKQorICAgICAgICAgICAgICAgICAgICA/IFNTREFUQSAo Y2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgOiBTU0RBVEEgKGJ1aWxkX3N0cmluZyAoIlxc PyIpKTsKKyAgcmV0dXJuIHJlc3VsdDsKK30KKworaW50CittY19saXNwX3RvX2N1cnNvcl90eXBl IChMaXNwX09iamVjdCBhcmcpCit7CisgIGNoYXIgKnN0cjsKKyAgaWYgKFhUWVBFIChhcmcpID09 IExpc3BfU3RyaW5nKQorICAgIHN0ciA9IFNTREFUQSAoYXJnKTsKKyAgZWxzZSBpZiAoWFRZUEUg KGFyZykgPT0gTGlzcF9TeW1ib2wpCisgICAgc3RyID0gU1NEQVRBIChTWU1CT0xfTkFNRSAoYXJn KSk7CisgIGVsc2UgcmV0dXJuIC0xOworICBpZiAoIXN0cmNtcCAoc3RyLCAiYm94IikpCisgICAg cmV0dXJuIEZJTExFRF9CT1hfQ1VSU09SOworICBpZiAoIXN0cmNtcCAoc3RyLCAiZnJhbWVkIik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F9BUlJPVzogcmV0dXJuIFNTREFUQSAoYnVp bGRfc3RyaW5nICgiTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XIikpOworICAgICAgY2FzZSBN Q19WRVJUSUNBTF9CQVI6IHJldHVybiBTU0RBVEEgKGJ1aWxkX3N0cmluZyAoIk1DX1ZFUlRJQ0FM X0JBUiIpKTsKKyAgICAgIGNhc2UgTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSDogcmV0dXJuIFNT REFUQSAoYnVpbGRfc3RyaW5nICgiTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCIpKTsKKyAgICAg IGRlZmF1bHQ6CisgICAgICByZXR1cm4gU1NEQVRBIChidWlsZF9zdHJpbmcgKCJVTktOT1dOIikp OworICAgIH0KK30KKworTGlzcF9PYmplY3QKK21jX2NvbG9yX3ZlY3Rvcl9jYWxjIChzdHJ1Y3Qg d2luZG93ICp3LCBMaXNwX09iamVjdCBjb2xvcikKK3sKKyAgQ0hFQ0tfU1RSSU5HIChjb2xvcik7 CisgIGludCBpID0gMDsKKyAgZG91YmxlIHZhbG1heCA9IFhGSVhOVU0gKFhDQVIgKEZ4d19jb2xv cl92YWx1ZXMgKGJ1aWxkX3N0cmluZyAoIiNmZmZmZmYiKSwgdy0+ZnJhbWUpKSk7CisgIExpc3Bf T2JqZWN0IHZlY3RvciA9IG1jX3ZlY3RvciAoMyk7CisgIGlmICghTklMUCAobWNfbWVtcSAoKEZm cmFtZXAgKHctPmZyYW1lKSksIG1jX2xpc3RuICgzLCBpbnRlcm4gKCJ4IiksCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlcm4gKCJ3 MzIiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGludGVybiAoIm5zIikpKSkpCisgICAgeworICAgICAgZm9yIChMaXNwX09iamVjdCB2 bGlzdCA9IEZ4d19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wX09iamVjdCBjbWFwLCBibTEgPSBRbmls LCBibTIgPSBRbmlsLCBibTsKKyAgRU1BQ1NfSU5UIGxuMSA9IDAsIGxuMiA9IDA7CisgIGludCBp eDEgPSByaWdodF9wOworICBpbnQgaXgyID0gaXgxICsgKHBhcnRpYWxfcCA/IDIgOiAwKTsKKyAg aWYgKChjbWFwID0gQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmcmluZ2VfaW5kaWNhdG9y X2FsaXN0KSksICFOSUxQIChjbWFwKSkKKyAgICB7CisgICAgICBibTEgPSBtY19hc3NxIChiaXRt YXAsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibTEpKQorICB7CisgICAgaWYgKChibTEgPSBY Q0RSIChibTEpKSwgTklMUCAoYm0xKSkKKyAgICAgIHJldHVybiBOT19GUklOR0VfQklUTUFQOwor ICAgIGlmIChDT05TUCAoYm0xKSkKKyAgICAgIHsKKyAgICAgICAgbG4xID0gWEZJWE5VTSAoRmxl bmd0aCAoYm0xKSk7CisgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgeworICAgICAgaWYgKGxu MSA+IGl4MikKKyAgICAgICAgeworICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMSk7Cisg ICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgIH0K KyAgICB9CisgICAgICAgIGVsc2UKKyAgICB7CisgICAgICBpZiAobG4xID4gaXgxKQorICAgICAg ICB7CisgICAgICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsKKyAgICAgICAgICBpZiAoIUVR IChibSwgUXQpKQorICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgfQorICAgIH0KKyAgICAgIH0K KyAgICBlbHNlIGlmICgoYm0gPSBibTEsICFFUSAoYm0sIFF0KSkpCisgICAgICBnb3RvIGZvdW5k OworICB9CisgICAgfQorICBpZiAoIUVRIChjbWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBm cmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkKKyAgICAgICYmICFOSUxQIChCVkFSICgmYnVmZmVyX2Rl ZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkpCisgICAgeworICAgICAgYm0yID0gbWNf YXNzcSAoYml0bWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2Fs aXN0KSk7CisgICAgICBpZiAoQ09OU1AgKGJtMikpCisgIHsKKyAgICBpZiAoKGJtMiA9IFhDRFIg KGJtMikpLCAhTklMUCAoYm0yKSkKKyAgICAgIHsKKyAgICAgICAgaWYgKENPTlNQIChibTIpKQor ICAgIHsKKyAgICAgIGxuMiA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMikpOworICAgICAgaWYgKHBh cnRpYWxfcCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChsbjIgPiBpeDIpCisgICAgICB7Cisg ICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMik7CisgICAgICAgIGlmICghRVEgKGJtLCBRdCkp CisgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICAg IH0KKyAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4MSkKKyAgICB7CisgICAgICBibSA9IG1jX250 aCAoaXgxLCBibTEpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgZ290byBmb3VuZDsKKyAg ICB9CisgIGlmIChsbjIgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0y KTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgIGdvdG8gZm91bmQ7CisgICAgICByZXR1cm4g Tk9fRlJJTkdFX0JJVE1BUDsKKyAgICB9CisgIGVsc2UgaWYgKChibSA9IGJtMiwgTklMUCAoYm0p KSkKKyAgICByZXR1cm4gTk9fRlJJTkdFX0JJVE1BUDsKKyBmb3Vu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CArIHRhaWwtPndpZHRoLCBmYWxzZSk7CisgICAgYXBwZW5k X2dseXBoX3N0cmluZ19saXN0cyAoJmhlYWQsICZ0YWlsLCBoLCB0KTsKKyAgfQorICAgICAgdGFp bCA9IGdseXBoX3N0cmluZ19jb250YWluaW5nX2JhY2tncm91bmRfd2lkdGggKHRhaWwpOworICAg ICAgaWYgKGNsaXBfdGFpbCkKKyAgY2xpcF90YWlsID0gZ2x5cGhfc3RyaW5nX2NvbnRhaW5pbmdf YmFja2dyb3VuZF93aWR0aCAoY2xpcF90YWlsKTsKKyAgICAgIGlmIChjbGlwX2hlYWQgfHwgY2xp cF90YWlsKQorICBmb3IgKHMgPSBoZWFkOyBzOyBzID0gcy0+bmV4dCkKKyAgICB7CisgICAgICBz LT5jbGlwX2hlYWQgPSBjbGlwX2hlYWQ7CisgICAgICBzLT5jbGlwX3RhaWwgPSBjbGlwX3RhaWw7 CisgICAgfQorICAgIH0KKyAgLyogRHJhdyBhbGwgc3RyaW5ncy4gKi8KKyAgZm9yIChzID0gaGVh ZDsgczsgcyA9IHMtPm5leHQpCisgICAgRlJBTUVfUklGIChmKS0+bWNfc2NyaWJlX3N0cmluZyAo cywgbWF0cml4LCByb3csIHJlZCwgZ3JlZW4sIGJsdWUsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9nY19wKTsKKyNpZm5k ZWYgSEFWRV9OUworICAvKiBXaGVuIGZvY3VzIGEgc29sZSBmcmFtZSBhbmQgbW92ZSBob3Jpem9u dGFsbHksIHRoaXMgY2xlYXJzIG9uX3AKKyAgICAgY2F1c2luZyBhIGZhaWx1cmUgdG8gZXJhc2Ug cHJldiBjdXJzb3IgcG9zaXRpb24uICovCisgIGlmIChhcmVhID09IFRFWFRfQVJFQQorICAgICAg JiYgI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Lngs IHVwZGF0ZWRfYXJlYSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgaHBvcywgaHBvcyArIGxl biwgRFJBV19OT1JNQUxfVEVYVCwgMCwgdnBvcywgYm90dG9tX3Zwb3MsCisgICAgICAgICAgICAg ICAgICAgICAgICAgIHJlZCwgZ3JlZW4sIGJsdWUsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUs IHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcCwgY3Vyc29yX2djX3AsIE1D X0RSQVdfR0xZUEgpOworICB1bmJsb2NrX2lucHV0ICgpOworICAvKiBBZHZhbmNlIHRoZSBvdXRw dXQgY3Vyc29yLiAqLworICB3LT5vdXRwdXRfY3Vyc29yLmhwb3MgKz0gbGVuOworICB3LT5vdXRw dXRfY3Vyc29yLnggPSB4OworfQorCisvKiBFWFBPUlQ6CisgICBEcmF3IHRoZSBjdXJzb3IgZ2x5 cGggb2Ygd2luZG93IFcgaW4gZ2x5cGggcm93IFJPVy4gIFNlZSB0aGUKKyAgIGNvbW1lbnQgb2Yg ZHJhd19nbHlwaHMgZm9yIHRoZSBtZWFuaW5nIG9mIEhMLiAqLwordm9pZAorbWNfZHJhd19jdXJz b3JfZ2x5cGggKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwg c3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICAgICAgIGVudW0gZHJhd19n bHlwaHNfZmFjZSBobCwgaW50IHgsIGludCBocG9zLCBpbnQgdnBvcywKKyAgICAgICAgICAgICAg ICAgICAgICBkb3VibGUgcmVkLCBkb3VibGUgZ3JlZW4sIGRvdWJsZSBibHVlLCBlbnVtIG1jX2Zs YXZvciBnbHlwaF9mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgZW51bSB0ZXh0X2N1cnNv cl9raW5kcyBjdXJzb3JfdHlwZSwgaW50IHdkLCBib29sIGFjdGl2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worICBpZiAoaGwgPT0gRFJBV19OT1JNQUxfVEVYVCAmJiByb3ctPm92 ZXJsYXBwZWRfcCkKKyAgICB7CisgICAgICBpZiAocm93ID4gbWF0cml4LT5yb3dzCisgICAgICAg ICAgJiYgTUFUUklYX1JPV19PVkVSTEFQU19TVUNDX1AgKHJvdyAtIDEpKQorICAgICAgICB4X2Zp eF9vdmVybGFwcGluZ19hcmVhICh3LCByb3cgLSAxLCBURVhUX0FSRUEsIE9WRVJMQVBTX0VSQVNF RF9DVVJTT1IpOworICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKHJvdykgPCB3aW5kb3df dGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAmJiBNQVRSSVhfUk9XX09WRVJMQVBTX1BSRURf UCAocm93ICsgMSkpCisgICAgICAgIHhfZml4X292ZXJsYXBwaW5nX2FyZWEgKHcsIHJvdyArIDEs IFRFWFRfQVJFQSwgT1ZFUkxBUFNfRVJBU0VEX0NVUlNPUik7CisgICAgfQorfQorCit2b2lkCitt Y19lcmFzZV9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1h dHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICBpbnQgeCwgaW50 IHksIGludCBocG9zLCBpbnQgdnBvcywgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLAorICAg ICAgICAgICAgICAgICBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIGN1cnNvcl90eXBlLCBpbnQgd2Qp Cit7CisgIGJvb2wgZGVidWdfcCA9IGZhbHNlOworICBpZiAoZGVidWdfcCkKKyAgICBmcHJpbnRm IChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICB4ICglZCkgfCB5ICglZCkgfCBocG9zICglZCkg fCB2cG9zICglZCkgfCB3ZCAoJWQpXG5cCisgICAgZ2x5cGhfZmxhdm9yICglcykgfCBjdXJzb3Jf dHl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T1hfQ1VSU09SCisg ICAgICB8fCBjdXJzb3JfdHlwZSA9PSBGUkFNRURfQk9YX0NVUlNPUikKKyAgICB7CisgICAgICBp bnQgdGVtcF94ID0geDsKKyAgICAgIGludCBoZWFkZXJfbGluZV9oZWlnaHQgPSBXSU5ET1dfSEVB REVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgIGN1cnNvcl9nbHlwaCA9IG1jX2dldF9jdXJzb3Jf Z2x5cGggKHcsIG1hdHJpeCwgcm93LCBocG9zLCB2cG9zKTsKKyAgICAgIGlmIChjdXJzb3JfZ2x5 cGggPT0gTlVMTCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICAg ICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2VfY3Vyc29yOiAgcmV0dXJuICglZClcbiIsIDcp OworICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgaW50IHRlbXBfd2QgPSBjdXJz b3JfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgaWYgKHRlbXBfeCA8IDApCisgICAgICAgIHsK KyAgICAgICAgICB0ZW1wX3dkICs9IHRlbXBfeDsKKyAgICAgICAgICB0ZW1wX3ggPSAwOworICAg ICAgICB9CisgICAgICB0ZW1wX3dkID0gbWluICh3ZCwgd2luZG93X2JveF93aWR0aCAodywgVEVY VF9BUkVBKSAtIHRlbXBfeCk7CisgICAgICBpbnQgZnkgPSBXSU5ET1dfVE9fRlJBTUVfUElYRUxf WSAodywgbWF4IChoZWFkZXJfbGluZV9oZWlnaHQsIHJvdy0+eSkpOworICAgICAgaW50IGZ4ID0g V0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgdGVtcF94KTsKKyAgICAgIGlmICh0ZW1w X3dkID4gMCkKKyAgICAgICAgRlJBTUVfUklGIChmKS0+Y2xlYXJfZnJhbWVfYXJlYSAoZiwgZngs IGZ5LCB0ZW1wX3dkLCByb3ctPnZpc2libGVfaGVpZ2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ZfY3Jhc2hfdHdvKQorICAg IHJldHVybjsKKyAgaWYgKHggPCAwCisgICAgICB8fCB5IDwgMAorICAgICAgfHwgaHBvcyA8IDAK KyAgICAgIHx8IHZwb3MgPCAwKQorICAgIHJldHVybjsKKyAgTGlzcF9PYmplY3QgYnVmID0gdy0+ Y29udGVudHM7CisgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgYm9vbCBhdXRvX2hzY3JvbGxfbW9k ZV9wID0gRVEgKEZidWZmZXJfbG9jYWxfdmFsdWUgKFFhdXRvX2hzY3JvbGxfbW9kZSwgYnVmKSwg UWN1cnJlbnRfbGluZSk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSkgKi8KKyAgYm9v bCBoc2NsX2FsbF90ZW1wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gbm90 aGluZy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNj cm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOworICAvKiBFWEFN UExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgZWxzZSBiZXNpZGVzIGhvcml6b250YWxs eSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IGxpbmUgZGlmZmVyZW50bHku CisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9s bGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMV9wID0gKCF3LT5zdXNw ZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNj cm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4g MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwp OworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAuLi4KKyAgICAgICAgICAgICAgIEN1cnJl bnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisg IGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPT0gMAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgKHNj cm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxlZnQgYXJyb3cga2V5IG9uZSB0aW1l LgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5IHNjcm9sbGVk IGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1wX3AgPSAoIXctPnN1c3BlbmRfYXV0b19o c2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5k IGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVudCBsaW5lIHRvIGJlCisgICAgICAg ICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuCisgICAgICAgICAgICAg ICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICov CisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAg ICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAg ICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hz Y3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+ aHNjcm9sbCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBpbnQg ZnJpbmdlX2JpdG1hcCA9IE5PX0ZSSU5HRV9CSVRNQVA7CisgIGludCBmYWNlX2lkID0gREVGQVVM VF9GQUNFX0lEOworICBpZiAoIXJlbW92ZV9wCisgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNf T1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICYmICFoc2NsX2FsbF90ZW1wX3AKKyAgICAgICYm ICFoc2NsX3RlbXBfcAorICAgICAgJiYgIWhzY2xfcGVybV9wCisgICAgICAmJiAhaHNjbF9hbGxf cGVybV8wX3AKKyAgICAgICYmICFoc2NsX2FsbF9wZXJtXzFfcAorICAgICAgJiYgIWhzY2xfYWxs X3Blcm1fMl9wKQorICAgIHsKKyAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2Vf aWQgPQorICAgICAgICAoIWFjdGl2ZV9wCisgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAgICAgID8gbG9va3Vw X25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1pbmFjdGl2ZS1mYWNl IiksIHRydWUpCisgICAgICAgIDogKGFjdGl2ZV9wKQorICAgICAgICAgID8gbG9va3VwX25hbWVk X2ZhY2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1mYWNlIiksIHRydWUpCisgICAg ICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBM RUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgPyBvdmVybGF5X2Fycm93X2ZhY2Vf aWQKKyAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgIC8qIGZyaW5nZV9i aXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgUW92ZXJsYXlfYXJyb3csIGZhbHNlLCBm YWxzZSk7ICovCisgICAgICBpZiAody0+aHNjcm9sbCAhPSAwKQorICAgICAgICBmcmluZ2VfYml0 bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludG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AgQXQgdGhpcyB0aW1lLCBAbGF3bGlz dCBwcmVmZXJzIG5vdCB0bworICAgICAgcmVseSB1cG9uIGEgTGlzcCBzZXR0aW5nIHVzaW5nIGBz ZXQtZnJpbmdlLWJpdG1hcC1mYWNlJy4gKi8KKyAgICAgIHJvdy0+bGVmdF9mcmluZ2VfYml0bWFw ID0gKGN1cnNvcl90eXBlID09IExFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IE5PX0ZSSU5HRV9CSVRNQVA7CisgICAgICByb3ctPmxl ZnRfZnJpbmdlX2ZhY2VfaWQgPSBmYWNlX2lkOworICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9vZmZz ZXQgPSAwOworICAgICAgcm93LT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxzZTsKKyAg ICAgIGRyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93LCB0cnVlKTsKKyAgICB9CisgICAgZWxzZSBp ZiAoIXJlbW92ZV9wCisgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yID09IE1DX09WRVJMQVlf QVJST1dfQklUTUFQCisgICAgICAgICAgICAgJiYgKGhzY2xfYWxsX3RlbXBfcAorICAgICAgICAg ICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzBfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2Fs bF9wZXJtXzFfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAgICAg ICAgICAgICAgICB8fCBoc2NsX3RlbXBfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX3Blcm1f cCkpCisgICAgICB7CisgICAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQg PQorICAgICAgICAgICghYWN0aXZlX3AKKyAgICAg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ST1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9X X1JFQ1RBTkdMRQorICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJU SUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3Ig PT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09 IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gpKQorICAgICAgICB7CisgICAgICAgICAgTGlzcF9P YmplY3QgYml0bWFwX2ZsYXZvciA9IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdM RV9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBR bWNfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFu Z2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZv ciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJU SUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNf dmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGds eXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBRbmlsOworICAgICAgICAgIGZy aW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBfZnJpbmdlX2JpdG1hcCAoYml0bWFwX2ZsYXZv cikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOT19GUklOR0VfQklUTUFQOworICAgICAg ICAgIGZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAg ICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy12ZXJ0 aWNhbC1iYXItZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFD RV9JRDsKKyAgICAgICAgICByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9IGZhbHNlOworICAgICAg ICAgIHJvdy0+cmlnaHRfZnJpbmdlX2JpdG1hcCA9IGZyaW5nZV9iaXRtYXA7CisgICAgICAgICAg cm93LT5yaWdodF9mcmluZ2VfZmFjZV9pZCA9IGZhY2VfaWQ7CisgICAgICAgICAgcm93LT5yaWdo dF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9k aWNfcCA9IGZhbHNlOworICAgICAgICAgIGRyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93LCBmYWxz ZSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBI CisgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSExFU1MpCisgICAg ICAgICAgeworICAgICAgICAgICAgZG91YmxlIHRlbXBfcmVkID0gWEZMT0FUX0RBVEEgKEFSRUYg KGNvbG9yX3ZlY3RvciwgMCkpOworICAgICAgICAgICAgZG91YmxlIHRlbXBfZ3JlZW4gPSBYRkxP QVRfREFUQSAoQVJFRiAoY29sb3JfdmVjdG9yLCAxKSk7CisgICAgICAgICAgICBkb3VibGUgdGVt cF9ibHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKGNvbG9yX3ZlY3RvciwgMikpOworICAgICAgICAg ICAgLyogU29tZSBvZiB0aGVzZSB2YWx1ZXMgY29tZSB0aHJvdWdoIGFzIDEuMDAzOTA2LCB3aGlj aCBjYXVzZXMgYSBicmVha2FnZQorICAgICAgICAgICAgb2YgdGhlIGNvbG9ycyBpbiB0aGF0IG11 bHRpcGxpY2F0aW9uIGJ5IHRoZSBiYXNlIHdpbGwgZXhjZWVkIHRoZSBiYXNlLiAqLworICAgICAg ICAgICAgZG91YmxlIHJlZCA9ICh0ZW1wX3JlZCA+IDEuMCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICA/IDEuMAorICAgICAgICAgICAgICAgICAgICAgICAgIDogdGVtcF9yZWQ7CisgICAgICAg ICAgICBkb3VibGUgZ3JlZW4gPSAodGVtcF9ncmVlbiA+IDEuMCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gMS4wCisgICAgICAgICAgICAgICAgICAgICAgICAgICA6IHRlbXBfZ3JlZW47 CisgICAgICAgICAgICBkb3VibGUgYmx1ZSA9ICh0ZW1wX2JsdWUgPiAxLjApCisgICAgICAgICAg ICAgICAgICAgICAgICAgID8gMS4wCisgICAgICAgICAgICAgICAgICAgICAgICAgIDogdGVtcF9i bHVlOworICAgICAgICAgICAgYm9vbCBvbl9wID0gdHJ1ZTsKKyAgICAgICAgICAgIEZSQU1FX1JJ RiAoZiktPm1jX3NjcmliZV9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhw b3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgd2Qs IGgsIHJlZCwgZ3JlZW4sIGJsdWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZ2x5cGhfZmxhdm9yLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uX3AsIGFjdGl2ZV9wKTsKKyAg ICAgICAgICB9Cit9CisKKy8qIER1bXAgY29udGVudHMgb2YgZ2x5cGggR0xZUEggdG8gc3RkZXJy LiAgUk9XIGFuZCBBUkVBIGFyZQorICAgdGhlIGdseXBoIHJvdyBhbmQgYXJlYSB3aGVyZSB0aGUg Z2x5cGggY29tZXMgZnJvbS4gKi8KK3ZvaWQKK21jX2R1bXBfZ2x5cGggKHN0cnVjdCBnbHlwaF9y b3cgKnJvdywgc3RydWN0IGdseXBoICpnbHlwaCwgaW50IGFyZWEsIGludCByZWxhdGl2ZV94KQor eworICBpZiAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgfHwgZ2x5cGgtPnR5cGUg PT0gR0xZUEhMRVNTX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAg ICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQl MS4xZCAlNWQgJTRkICAlM2QgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmds eXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiBy b3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgKGdseXBo LT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgID8gJ0MnCisgICAgICAgICA6ICdHJyksCisg ICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkK KyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAg ICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBo LT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPnUuY2gsCisgICAgICAgIGdseXBoLT5mYWNl X2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmln aHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywg Z2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgIG1jX2NoYXJf dG9fc3RyaW5nIChnbHlwaC0+dS5jaCkpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUg PT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAg ICIgJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEu MWQgJTVkICU0ZCAgJTNkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93 LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdTJywKKyAg ICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQor ICAgICAgICAgICAgPyAnQicKKyAgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQor ICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAg ICAgICAgICAgPyAnMCcKKyAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVs X3dpZHRoLAorICAgICAgICAwdSwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGds eXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAor ICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9zLCBnbHlwaC0+dnBvcywgZ2x5 cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgIlxcUyIpOworICAgIH0KKyAgZWxzZSBp ZiAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3Rk ZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4 ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVjXG4iLAorICAgICAgICBnbHlw aCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09 IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAg ICAgICAnSScsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5 cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ0InCisgICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5 cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgOiAoTklMUCAoZ2x5cGgt Pm9iamVjdCkKKyAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgOiAnLScpKSksCisgICAgICAg IGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuaW1n X2lkLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xp bmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT54 LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIg OiAiLS0iLAorICAgICAgICAnLicpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0g Q09NUE9TSVRFX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAg IiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCIsCisgICAgICAgIGds eXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0g PT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisg ICAgICAgICcrJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChn bHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAgICAgICA6IChTVFJJTkdQIChn bHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICA6IChOSUxQIChnbHlw aC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICA6ICctJykpKSwKKyAgICAg ICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5j bXAuaWQpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICU0ZCAlMS4xZCUxLjFkIiwKKyAgICAg ICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAg ICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wKTsKKyAgICAgIGlmIChnbHlwaC0+dS5jbXAuYXV0 b21hdGljKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTVkICU0ZCAgJTNkICAlM2QgJXMg LiBbJWQtJWRdXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT54LCBnbHlwaC0+ eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAiLS0iLAor ICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgtPnNs aWNlLmNtcC50byk7CisgICAgICAgIGVsc2UKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG4i KTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IFhXSURHRVRfR0xZUEgpCisgICAg eworI2lmbmRlZiBIQVZFX1hXSURHRVRTCisgICAgICBlYXNzdW1lIChmYWxzZSk7CisjZWxzZQor ICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICAlNWQvJS01ZCAlNWQgJTRjICU2ZCAl YyAlM2QgMHglMDV4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVjXG4iLAor ICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51 c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxh dGl2ZV94LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAo QlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNU UklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgOiAnLScp KSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwK KyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2Jv eF9saW5lX3AsCisgICAgICAgIGdseXBoLT51Lnh3aWRnZXQsCisgICAgICAgIGdseXBoLT54LCBn bHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAi LS0iLAorICAgICAgICAnLicpOworI2VuZGlmCisgICAgfQorfQorCisvKiBEdW1wIHRoZSBjb250 ZW50cyBvZiBnbHlwaCByb3cgYXQgVlBPUyBpbiBNQVRSSVggdG8gc3RkZXJyLgorICAgR0xZUEhT IDAgbWVhbnMgZG9uJ3Qgc2hvdyBnbHlwaCBjb250ZW50cy4KKyAgIEdMWVBIUyAxIG1lYW5zIHNo b3cgZ2x5cGhzIGluIHNob3J0IGZvcm0KKyAgIEdMWVBIUyA+IDEgbWVhbnMgc2hvdyBnbHlwaHMg aW4gbG9uZyBmb3JtLiAqLwordm9pZAorbWNfZHVtcF9nbHlwaF9yb3cgKHN0cnVjdCBnbHlwaF9y b3cgKnJvdywgaW50IHZwb3MsIGludCBnbHlwaHMpCit7CisgIGludCByZWxhdGl2ZV94ID0gMDsK KyAgaWYgKGdseXBocyAhPSAxKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIlxuRFVN UCBHTFlQSCBST1dcbiIpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiUm93ICAgICBTdGFydCAg ICAgICBFbmQgVXNlZCBvRT48XFxDVFpGZXNtICAgICBYICAgIFkgICAgVyAgICBIICAgIFYgICAg QSAgICBQXG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIj09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PVxuIik7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIlM2QgJTkicEQiZCAlOSJwRCJkICU0ZCAl MS4xZCUxLjFkJTEuMWQlMS4xZFwKKyUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFk JTEuMWQgICU0ZCAlNGQgJTRkICU0ZCAlNGQgJTRkICU0ZFxuIiwKKyAgICAgICAgIHZwb3MsCisg ICAgICAgICBNQVRSSVhfUk9XX1NUQVJUX0NIQVJQT1MgKHJvdyksCisgICAgICAgICBNQVRSSVhf Uk9XX0VORF9DSEFSUE9TIChyb3cpLAorICAgICAgICAgcm93LT51c2VkW1RFWFRfQVJFQV0sCisg ICAgICAgICByb3ctPmNvbnRhaW5zX292ZXJsYXBwaW5nX2dseXBoc19wLAorICAgICAgICAgcm93 LT5lbmFibGVkX3AsCisgICAgICAgICByb3ctPnRydW5jYXRlZF9vbl9sZWZ0X3AsCisgICAgICAg ICByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wLAorICAgICAgICAgcm93LT5jb250aW51ZWRfcCwK KyAgICAgICAgIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAocm93KSwKKyAgICAgICAg IE1BVFJJWF9ST1dfRElTUExBWVNfVEVYVF9QIChyb3cpLAorICAgICAgICAgcm93LT5lbmRzX2F0 X3p2X3AsCisgICAgICAgICByb3ctPmZpbGxfbGluZV9wLAorICAgICAgICAgcm93LT5lbmRzX2lu X21pZGRsZV9vZl9jaGFyX3AsCisgICAgICAgICByb3ctPnN0YXJ0c19pbl9taWRkbGVfb2ZfY2hh cl9wLAorICAgICAgICAgcm93LT5tb3VzZV9mYWNlX3AsCisgICAgICAgICByb3ctPngsCisgICAg ICAgICByb3ctPnksCisgICAgICAgICByb3ctPnBpeGVsX3dpZHRoLAorICAgICAgICAgcm93LT5o ZWlnaHQsCisgICAgICAgICByb3ctPnZpc2libGVfaGVpZ2h0LAorICAgICAgICAgcm93LT5hc2Nl bnQsCisgICAgICAgICByb3ctPnBoeXNfYXNjZW50KTsKKyAgICAgIC8qIFRoZSBuZXh0IDMgbGlu ZXMgc2hvdWxkIGFsaWduIHRvICJTdGFydCIgaW4gdGhlIGhlYWRlci4gKi8KKyAgICAgIGZwcmlu dGYgKHN0ZGVyciwgIiAgICAlOSJwRCJkICU5InBEImRcdCU1ZFxuIiwgcm93LT5zdGFydC5vdmVy bGF5X3N0cmluZ19pbmRleCwKKyAgICAgICAgIHJvdy0+ZW5kLm92ZXJsYXlfc3RyaW5nX2luZGV4 LAorICAgICAgICAgcm93LT5jb250aW51YXRpb25fbGluZXNfd2lkdGgpOworICAgICAgZnByaW50 ZiAoc3RkZXJyLCAiICAgICU5InBEImQgJTkicEQiZFxuIiwKKyAgICAgICAgIENIQVJQT1MgKHJv dy0+c3RhcnQuc3RyaW5nX3BvcyksCisgICAgICAgICBDSEFSUE9TIChyb3ctPmVuZC5zdHJpbmdf cG9zKSk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTlkICU5ZFxuIiwgcm93LT5zdGFy dC5kcHZlY19pbmRleCwKKyAgICAgICAgIHJvdy0+ZW5kLmRwdmVjX2luZGV4KTsKKyAgICB9Cisg IGlmIChnbHlwaHMgPiAxKQorICAgIHsKKyAgICAgIGZvciAoaW50IGFyZWEgPSBMRUZUX01BUkdJ Tl9BUkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2FyZWEpCisgIHsKKyAgICBzdHJ1Y3QgZ2x5cGgg KmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV07CisgICAgc3RydWN0IGdseXBoICpnbHlwaF9lbmQg PSBnbHlwaCArIHJvdy0+dXNlZFthcmVhXTsKKyAgICAvKiBHbHlwaCBmb3IgYSBsaW5lIGVuZCBp biB0ZXh0LiAqLworICAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiBnbHlwaCA9PSBnbHlwaF9l bmQgJiYgZ2x5cGgtPmNoYXJwb3MgPiAwKQorICAgICAgKytnbHlwaF9lbmQ7CisgICAgaWYgKGds eXBoIDwgZ2x5cGhfZW5kKQorICAgICAgZnByaW50ZiAoc3RkZXJyLCAiR2x5cGgjL1RvdGFsIFJl bC5YIFQgICAgICAgUG9zIE8gICBXICAgICBDb2RlIEZhY2UgTFIgICAgIFggICAgWSBIUE9TIFZQ T1MgWlYgQ1xuIik7CisgICAgZm9yICg7IGdseXBoIDwgZ2x5cGhfZW5kOyArK2dseXBoKQorICAg ICAgeworICAgICAgICBtY19kdW1wX2dseXBoIChyb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94 KTsKKyAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICB9Cisg IH0KKyAgICB9CisgIGVsc2UgaWYgKGdseXBocyA9PSAxKQorICAgIHsKKyAgICAgIGNoYXIgc1tT SFJUX01BWCArIDRdOworICAgICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFy ZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgeworICAgIGludCBpOworICAgIGZvciAoaSA9IDA7 IGkgPCByb3ctPnVzZWRbYXJlYV07ICsraSkKKyAgICAgIHsKKyAgICAgICAgc3RydWN0IGdseXBo ICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdICsgaTsKKyAgICAgICAgaWYgKGkgPT0gcm93LT51 c2VkW2FyZWFdIC0gMQorICAgICAgJiYgYXJlYSA9PSBURVhUX0FSRUEKKyAgICAgICYmIE5JTFAg KGdseXBoLT5vYmplY3QpCisgICAgICAmJiBnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAg ICAmJiBnbHlwaC0+dS5jaCA9PSAnICcpCisgICAgeworICAgICAgc3RyY3B5ICgmc1tpXSwgIltc XG5dIik7CisgICAgICBpICs9IDQ7CisgICAgfQorICAgICAgICBlbHNlIGlmIChnbHlwaC0+dHlw ZSA9PSBDSEFSX0dMWVBICisgICAgICAgICAgICYmIGdseXBoLT51LmNoIDwgMHg4MAorICAgICAg ICAgICAmJiBnbHlwaC0+dS5jaCA+PSAnICcpCisgICAgc1tpXSA9IGdseXBoLT51LmNoOworICAg ICAgICBlbHNlCisgICAgc1tpXSA9ICcuJzsKKyAgICAgIH0KKyAgICBzW2ldID0gJ1wwJzsKKyAg ICBmcHJpbnRmIChzdGRlcnIsICIlM2Q6ICglZCkgJyVzJ1xuIiwgdnBvcywgcm93LT5lbmFibGVk X3AsIHMpOworICB9CisgICAgfQorfQorCitERUZVTiAoIm1jLWR1bXAtZ2x5cGgtcm93IiwgRm1j X2R1bXBfZ2x5cGhfcm93LCBTbWNfZHVtcF9nbHlwaF9yb3csIDEsIDIsICJQIiwKKyAgICAgICBk b2M6IC8qIER1bXAgZ2x5cGggcm93IFJPVyB0byBzdGRlcnIuCitJbnRlcmFjdGl2ZWx5LCBST1cg aXMgdGhlIHByZWZpeCBudW1lcmljIGFyZ3VtZW50IGFuZCBkZWZhdWx0cyB0bwordGhlIHJvdyB3 aGljaCBkaXNwbGF5cyBwb2ludC4KK09wdGlvbmFsIGFyZ3VtZW50IEdMWVBIUyAwIG1lYW5zIGRv bid0IGR1bXAgZ2x5cGhzLgorR0xZUEhTIDEgbWVhbnMgZHVtcCBnbHlwaHMgaW4gc2hvcnQgZm9y bS4KK0dMWVBIUyA+IDEgb3Igb21pdHRlZCBtZWFucyBkdW1wIGdseXBocyBpbiBsb25nIGZvcm0u ICAqLykKKyAgKExpc3BfT2JqZWN0IHJvdywgTGlzcF9PYmplY3QgZ2x5cGhzKQoreworICBzdHJ1 Y3Qgd2luZG93ICp3ID0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KTsKKyAgc3RydWN0IGdseXBo X21hdHJpeCAqbWF0cml4OworICBFTUFDU19JTlQgdnBvczsKKyAgaWYgKE5JTFAgKHJvdykpCisg ICAgeworICAgICAgaW50IGQxLCBkMiwgZDMsIGQ0LCBkNSwgeXBvczsKKyAgICAgIGJvb2wgdmlz aWJsZV9wID0gcG9zX3Zpc2libGVfcCAodywgUFQsICZkMSwgJmQyLCAmZDMsICZkNCwgJmQ1LCAm eXBvcyk7CisgICAgICBpbnQgaGVhZGVyX2xpbmVfaGVpZ2h0ID0gV0lORE9XX0hFQURFUl9MSU5F X0hFSUdIVCAodyk7CisgICAgICBpbnQgdm9mZnNldCA9IChoZWFkZXJfbGluZV9oZWlnaHQgPiAw CisgICAgICAgICAgICAgICAgICAgICAmJiB5cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgICAg ICA/IHlwb3MgKyAxCisgICAgICAgICAgICAgICAgICAgICAgOiB5cG9zOworICAgICAgaWYgKHZp c2libGVfcCkKKyAgICAgICAgdnBvcyA9IHZvZmZzZXQ7CisgICAgICAgIGVsc2UKKyAgICAgICAg ICB2cG9zID0gMDsKKyAgICB9CisgICAgZWxzZQorICAgICAgeworICAgICAgICBDSEVDS19OVU1C RVIgKHJvdyk7CisgICAgICAgIHZwb3MgPSBYRklYTlVNIChyb3cpOworICAgICAgfQorICBtYXRy aXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgaWYgKHZwb3MgPj0gMCAmJiB2cG9zIDwgbWF0cml4 LT5ucm93cykKKyAgICBtY19kdW1wX2dseXBoX3JvdyAoTUFUUklYX1JPVyAobWF0cml4LCB2cG9z KSwKKyAgICAgICAgdnBvcywKKyAgICAgICAgVFlQRV9SQU5HRURfRklYTlVNUCAoaW50LCBnbHlw aHMpID8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VGRkVSICh3LT5jb250ZW50cyk7CisgIGZwcmludGYgKHN0 ZGVyciwgIlBUID0gJSJwRCJkLCBCRUdWID0gJSJwRCJkLiBaViA9ICUicEQiZFxuIiwKKyAgICAg QlVGX1BUIChidWZmZXIpLCBCVUZfQkVHViAoYnVmZmVyKSwgQlVGX1pWIChidWZmZXIpKTsKKyAg ZnByaW50ZiAoc3RkZXJyLCAiQ3Vyc29yIHggPSAlZCwgeSA9ICVkLCBocG9zID0gJWQsIHZwb3Mg PSAlZFxuIiwKKyAgICAgdy0+Y3Vyc29yLngsIHctPmN1cnNvci55LCB3LT5jdXJzb3IuaHBvcywg dy0+Y3Vyc29yLnZwb3MpOworICBmcHJpbnRmIChzdGRlcnIsICI9PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiIpOworICBtY19kdW1wX2dseXBoX21hdHJpeCAo dy0+Y3VycmVudF9tYXRyaXgsCisgICAgICAgICBUWVBFX1JBTkdFRF9GSVhOVU1QIChpbnQsIGds eXBocykgPyBYRklYTlVNIChnbHlwaHMpIDogMCk7CisgIHJldHVybiBRbmlsOworfQorCitzdGF0 aWMgdm9pZAorbWNfaGVscGVyIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4 ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgc3RydWN0IGdseXBo ICpnbHlwaCwgaW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50IGhwb3MsIGludCB2cG9z LAorICAgICAgICAgICBpbnQgd2QsIGludCBoLCBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIGN1cnNv cl90eXBlLCBpbnQgY3Vyc29yX3dpZHRoLAorICAgICAgICAgICBMaXNwX09iamVjdCBmb3JlZ3Jv dW5kLCBMaXNwX09iamVjdCBiYWNrZ3JvdW5kLCBib29sIGFjdGl2ZV9wLAorICAgICAgICAgICBl bnVtIG1jX2Zs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9yKSwKKyAgICByZWRfZmcsIGdyZWVu X2ZnLCBibHVlX2ZnLCByZWRfYmcsIGdyZWVuX2JnLCBibHVlX2JnKTsKKyAgYm9vbCByZW1vdmVf cCA9IGZhbHNlOworICBpZiAoZHJhd19wKQorICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCBt YXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwgY3Vyc29yX3R5cGUs CisgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYWN0 aXZlX3AsIGdseXBoX2ZsYXZvciwgcmVtb3ZlX3ApOworICBMaXNwX09iamVjdCBmb3VydGVlbl9l bGVtZW50cyA9IG1jX2xpc3RuICgxNCwgbWFrZV9maXhudW0gKHgpLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFrZV9maXhudW0gKGZ4KSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ha2VfZml4bnVtICh5 KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ha2Vf Zml4bnVtIChmeSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBtYWtlX2ZpeG51bSAoaHBvcyksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBtYWtlX2ZpeG51bSAodnBvcyksCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWtlX2ZpeG51bSAod2QpLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFrZV9maXhudW0gKGgpLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfY3Vyc29y X3R5cGVfdG9fbGlzcCAoY3Vyc29yX3R5cGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgbWFrZV9maXhudW0gKGN1cnNvcl93aWR0aCksCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ha2VfZml4 bnVtIChhY3RpdmVfcCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBtYWtlX2ZpeG51bSAoZ2x5cGhfZmxhdm9yKSk7CisgICpyZXN1bHQgPSBGY29ucyAo Zm91cnRlZW5fZWxlbWVudHMsICpyZXN1bHQpOworICB3c2V0X21jX3RlbXBfY2FjaGUgKHcsICpy ZXN1bHQpOworfQorCisvKiBSZXR1cm4gYSBwb2ludGVyIHRvIHRoZSBnbHlwaCBXJ3MgcGh5c2lj YWwgY3Vyc29yIGlzIG9uLiAgVmFsdWUgaXMgbnVsbCBpZiBXJ3MKKyAgIG1hdHJpeCBpcyBpbnZh bGlkLCBzbyB0aGF0IG5vIG1lYW5pbmdmdWwgZ2x5cGggY2FuIGJlIHJldHVybmVkLiAqLworc3Ry dWN0IGdseXBoICoKK21jX2dldF9jdXJzb3JfZ2x5cGggKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVj dCBnbHlwaF9tYXRyaXggKm1hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlw aF9yb3cgKnJvdywgaW50IGhwb3MsIGludCB2cG9zKQoreworICBzdHJ1Y3QgZ2x5cGggKmdseXBo OworICBpZiAoISh2cG9zID49IDAKKyAgICAgICAgJiYgdnBvcyA8IG1hdHJpeC0+bnJvd3MpKQor ICAgIHJldHVybiBOVUxMOworICBpZiAoIXJvd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VsZXIuCisgICBWRVJU SUNBTF9SVUxFUiBhbmQgRklMTF9DT0xVTU46ICBXZSB3YW50IGFuIEggdGhhdCBlbnN1cmVzIG5v IGdhcCBiZXR3ZWVuIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJl dmlvdXMvbmV4dCBsaW5lLiAgVGhlIEZYIGNvb3JkaW5hdGUgaXMgc2V0CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBlbHNld2hlcmU6ICBgdy0+Y3Vyc29yLnhgIC8gYG1jLmZj X3hgLiAqLwordm9pZAorbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAoc3RydWN0IHdpbmRvdyAqdywg c3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgc3Ry dWN0IGdseXBoX3JvdyAqcm93LCBpbnQgeCwgaW50ICpmeCwgaW50IHksCisgICAgICAgICAgICAg ICAgICAgICAgICBpbnQgKmZ5LCBpbnQgaHBvcywgaW50IHZwb3MsIGludCAqaCwKKyAgICAgICAg ICAgICAgICAgICAgICAgIGVudW0gdGV4dF9jdXJzb3Jfa2luZHMgY3Vyc29yX3R5cGUsIGludCBj dXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgKndkKQoreworICBzdHJ1 Y3QgZ2x5cGggKmdseXBoID0gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIGhw b3MsIHZwb3MpOworICBpZiAoZ2x5cGggPT0gTlVMTCkKKyAgICByZXR1cm47CisgIHN0cnVjdCBm cmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICpmeCA9IFdJTkRPV19URVhU X1RPX0ZSQU1FX1BJWEVMX1ggKHcsIHgpOworICAqaCA9IHJvdy0+dmlzaWJsZV9oZWlnaHQ7Cisg IC8qIERvbid0IGxldCB0aGUgY3Vyc29yIGV4Y2VlZCB0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vcl93aWR0aDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2Fz ZSBIQkFSX0NVUlNPUjoKKyAgICAgICAgeworICAgICAgICAgIGludCBjdXJzb3JfaGVpZ2h0ID0g KGN1cnNvcl93aWR0aCA8IDEpID8gbHJpbnQgKDAuMjUgKiAqaCkgOiBjdXJzb3Jfd2lkdGg7Cisg ICAgICAgICAgaWYgKGN1cnNvcl9oZWlnaHQgPiByb3ctPmhlaWdodCkKKyAgICAgICAgICAgIGN1 cnNvcl9oZWlnaHQgPSByb3ctPmhlaWdodDsKKyAgICAgICAgICAvKiBDdXJzb3Igc21hbGxlciB0 aGFuIGxpbmUgaGVpZ2h0LCBzbyBtb3ZlIGRvd24uICovCisgICAgICAgICAgaWYgKCpoID4gY3Vy c29yX2hlaWdodCkKKyAgICAgICAgICAgICpmeSArPSAqaCAtIGN1cnNvcl9oZWlnaHQ7CisgICAg ICAgICAgKmggPSBjdXJzb3JfaGVpZ2h0OworICAgICAgICAgICp3ZCA9IGdseXBoLT5waXhlbF93 aWR0aDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBSSUdIVF9GUklO R0VfQklUTUFQOgorICAgICAgY2FzZSBMRUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICBjYXNlIERF RkFVTFRfQ1VSU09SOgorICAgICAgY2FzZSBOT19DVVJTT1I6CisgICAgICBjYXNlIE5PX0ZSSU5H RV9CSVRNQVA6CisgICAgICBjYXNlIEZSQU1FRF9CT1hfQ1VSU09SOgorICAgICAgY2FzZSBGSUxM RURfQk9YX0NVUlNPUjoKKyAgICAgIGNhc2UgSE9MTE9XX0JPWF9DVVJTT1I6CisgICAgICBkZWZh dWx0OgorICAgICAgLyogQ29tcHV0ZSB0aGUgd2lkdGggb2YgdGhlIHJlY3RhbmdsZSB0byBkcmF3 LiAgSWYgb24gYSBzdHJldGNoIGdseXBoLCBhbmQKKyAgICAgIGB4LXN0cmV0Y2gt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Uk9X IChtYXRyaXgsIHctPmN1cnNvci52cG9zKTsKKyAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGgg PSBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIGN1cnNvcl9yb3csIHctPmN1cnNvci5o cG9zLCB3LT5jdXJzb3IudnBvcyk7CisgIGJvb2wgY3Vyc29yX2luX2ZyaW5nZV9wID0gKGN1cnNv cl9nbHlwaCAhPSBOVUxMKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gb3BvaW50X3gg KyBjdXJzb3JfZ2x5cGgtPnBpeGVsX3dpZHRoID49IHRleHRfYXJlYV93aWR0aAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogZmFsc2U7CisgIGludCBmcmFtZV9jaGFyX3dpZHRoID0gRlJB TUVfQ09MVU1OX1dJRFRIIChmKTsKKyAgaW50IHRlbXBfZmFjZV9pZCA9IGdseXBoLT5mYWNlX2lk OworICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9IChvcG9pbnRfeCA9PSByZWxhdGl2ZV94Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF9ocG9zID09IGhwb3MKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3kgPT0gZ2x5cGgtPnkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBvcyk7CisKKy8qIC0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgQ0hBUl9H TFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0gKi8KKyAgaWYgKGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgIHx8IGds eXBoLT50eXBlID09IEdMWVBITEVTU19HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkK KyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMg JTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVz ICVzXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAg ICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAg ICAgICByZWxhdGl2ZV94LAorICAgICAgICAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAg ICAgICAgPyAnQycKKyAgICAgICAgIDogJ0cnKSwKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisg ICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAg IDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAg ICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAg ICAgICAgICA6ICctJykpKSwKKyAgICAgICAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAg ICAgICBnbHlwaC0+dS5jaCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBo LT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAg ICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9zLCBnbHlw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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBIT1JJWk9OVEFMX1JV TEVSOgorICAgIHsKKyAgICAgIGlmIChyZWxhdGl2ZV94IDwgcm93LT5waXhlbF93aWR0aAorICAg ICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0 cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAg ICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91 bmQsCisgICAgICAgICAgICAgICAgICAgbWNfYmdfbHNsICh3LCB0ZW1wX2ZhY2VfaWQpLCBhY3Rp dmVfcCwKKyAgICAgICAgICAgICAgICAgICBNQ19HTFlQSCwgZHJhd19wLCByZXN1bHQpOworICAg ICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0g LSAxCisgICAgICAgICAgJiYgcmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAgICB7CisgICAg ICAgICAgaWYgKHJlbGF0aXZlX3ggPCByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAg ICAgICAgZnggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICAg IG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnks IGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICB4X2xpbWl0IC0gcmVsYXRpdmVfeCwg aCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgIGZvcmVn cm91bmQsIG1jX2JnX2xzbCAodywgdGVtcF9mYWNlX2lkKSwgYWN0aXZlX3AsCisgICAgICAgICAg ICAgICAgICAgICBNQ19HTFlQSExFU1MsIGRyYXdfcCwgcmVzdWx0KTsKKyAgICAgICAgfQorICAg ICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAg ICAgIFZFUlRJQ0FMX1JVTEVSOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAg ICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxf UlVMRVI6CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNv cl9pbl9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9y aWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJS T1cKKyAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAg ICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBN Q19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2lu X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3Jp Z2h0X3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcCkKKyAgICAg ICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgOiAo Z2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAg ICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAg ICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICh6 dl9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAg ICAgICA6IE1DX0dMWVBIOworICAgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9C QVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxf QkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9C QVIpCisgICAgICAgIGN1cnNvcl90eXBlID0gUklHSFRfRlJJTkdFX0JJVE1BUDsKKyAgICAgIHdk ID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94 LCBvcG9pbnRfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3ZCwgaCwg Y3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAg bWNfYmdfbHNsICh3LCB0ZW1wX2ZhY2VfaWQpLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAg Z2x5cGhfZmxhdm9yLCBkcmF3X3AsIHJlc3VsdCk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAt LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgRklMTF9DT0xVTU46ICBDSEFS X0dMWVBIIHwgR0xZUEhMRVNTX0dMWVBIICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7CisgICAgICBlbnVtIG1j X2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09 IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWMuZmNfeCA+ PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MK KyAgICAgICAgICAgICAgICAgICA6ICh6dl9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19H TFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWly cykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICYmIG9w b2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9z KQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAg ICA6IE1DX0dMWVBIOworICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgs IHJvd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IGVsc2UgaWYgKGdseXBoLT50 eXBlID09IFNUUkVUQ0hfR0xZUEgpCisgIHsKKyAgICBpZiAobWNfc3RkZXJyX3ApCisgICAgICBm cHJpbnRmIChzdGRlcnIsCisgICAgICAgICJcbiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQg JWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAlNWQgJTRkICAlM2QgICUzZCAlcyAlc1xuIiwK KyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+ dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVs YXRpdmVfeCwKKyAgICAgICAgJ1MnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAg KEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RS SU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChO SUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAg IDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIDB1LAorICAg ICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAg ICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT54LCBnbHlwaC0+ eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAiLS0iLAor ICAgICAgICAiXFxTIik7CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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F93 aWR0aAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBl ciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZw b3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgs IGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgbWNfYmdfbHNsICh3LCB0ZW1wX2ZhY2Vf aWQpLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICBNQ19HTFlQSCwgZHJhd19wLCByZXN1 bHQpOworICAgICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVz ZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgcmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAg ICB7CisgICAgICAgICAgaWYgKHJlbGF0aXZlX3ggPCByb3ctPnBpeGVsX3dpZHRoKQorICAgICAg ICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgdGVtcF9m YWNlX2lkID0gKHJvdy0+ZmlsbF9saW5lX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBn bHlwaC0+ZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lE OworICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94 LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICB4X2xpbWl0IC0g cmVsYXRpdmVfeCwgaCwgY3Vyc29yX3R5cGUsIHhfbGltaXQgLSByZWxhdGl2ZV94LAorICAgICAg ICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwgbWNfYmdfbHNsICh3LCB0ZW1wX2ZhY2VfaWQpLCBh Y3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgIE1DX0dMWVBITEVTUywgZHJhd19wLCByZXN1 bHQpOworICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIFNUUkVU Q0hfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICov CisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBpZiAocm93LT5maWxsX2xp bmVfcAorICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ct PnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsgZ2x5 cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICB0ZW1wX2ZhY2VfaWQgPSBnbHlwaC0+ZmFjZV9pZDsK KyAgICAgICAgZWxzZSBpZiAoIXJvdy0+ZmlsbF9saW5lX3AKKyAgICAgICAgICAgICAgICAgJiYg Z2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAg ICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dp ZHRoKQorICAgICAgICAgIHRlbXBfZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgIGVu dW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAg ICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAg ICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAg OiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT5jb250 aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFT SAorICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAgICAg ICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wCisgICAgICAgICAgICAgICAg ICAgICAgJiYgIXJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZF UlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEhMRVNTOworICAgICAgaWYg KGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8 fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIpCisgICAgICAgIGN1cnNvcl90eXBlID0g UklHSFRfRlJJTkdFX0JJVE1BUDsKKyAgICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywg bWF0cml4LCByb3csIGdseXBoLCBvcG9pbnRfeCwgb3BvaW50X2Z4LCB5LCBmeSwgaHBvcywgdnBv cywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZv cmVncm91bmQsCisgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAod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gTUNfR0xZUEhMRVNTOworICAgICAgd2QgPSAxOworICAgICAgbWNfaGVs cGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHctPm1jLmZjX3gsIGZjX2Z4LCB5LCBmeSwgaHBv cywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lk dGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVtcF9mYWNl X2lkKSwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgZHJhd19wLCBy ZXN1bHQpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisg IH0KKyAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBFTkQ6ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAgICAg Ki8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K Ky8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQkVHSU46ICBJTUFHRV9HTFlQSCAgICAg ICAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIGVs c2UgaWYgKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVy cl9wKQorICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiXG4gJTUicEQiZC8lLTVkICU1 ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgJTVkICU0ZCAgJTNkICAl M2QgJXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAg ICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSks CisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdJJywKKyAgICAgICAgZ2x5cGgtPmNoYXJw b3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAg ICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAg ICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisg ICAgICAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAg ICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5pbWdfaWQsCisgICAgICAgIGdseXBoLT5mYWNl X2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmln aHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywg Z2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7Cisg IHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyog ICAgICAgICAgICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUzogIElNQUdFX0dMWVBIICAg ICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNl IE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAgICAgY3Vyc29yX3R5cGUgPSBIT0xMT1dfQk9Y X0NVUlNPUjsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2 ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJz b3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICBtY19i Z19sc2wgKHcsIHRlbXBfZmFjZV9pZCksIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICBNQ19H TFlQSCwgZHJhd19wLCByZXN1bHQpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVS OiAgSU1BR0VfR0xZUEggICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworICAgIGNhc2UgSE9SSVpPTlRBTF9SVUxFUjoKKyAgICB7CisgICAgICBjdXJzb3Jf dHlwZSA9IEhPTExPV19CT1hfQ1VSU09SOworICAgICAgaWYgKCFyZWFsX2Zha2VfY3Vyc29yX3Ap CisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBm eCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90 eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgbWNfYmdf bHNsICh3LCB0ZW1wX2ZhY2VfaWQpLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICBNQ19H TFlQSCwgZHJhd19wLCByZXN1bHQpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVS OiAgSU1BR0VfR0xZUEggICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6CisgICAgeworICAgICAgY3Vyc29yX3R5 cGUgPSBIT0xMT1dfQk9YX0NVUlNPUjsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3cs IGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAg ICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLAorICAgICAg ICAgICAgICAgICBtY19iZ19sc2wgKHcsIHRlbXBfZmFjZV9pZCksIGFjdGl2ZV9wLAorICAgICAg ICAgICAgICAgICBNQ19HTFlQSCwgZHJhd19wLCByZXN1bHQpOworICAgICAgYnJlYWs7CisgICAg fQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAg ICBGSUxMX0NPTFVNTjogIElNQUdFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgRklMTF9DT0xVTU46CisgICAgeworICAg ICAgY3Vyc29yX3R5cGUgPSBIT0xMT1dfQk9YX0NVUlNPUjsKKyAgICAgIG1jX2hlbHBlciAodywg bWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisg ICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3Jv dW5kLAorICAgICAgICAgICAgICAgICBtY19iZ19sc2wgKHcsIHRlbXBfZmFjZV9pZCksIGFjdGl2 ZV9wLAorICAgICAgICAgICAgICAgICBNQ19HTFlQSCwgZHJhd19wLCByZXN1bHQpOworICAgICAg YnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIH0KKyAgfQorLyogLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRU5E OiAgSU1BR0VfR0xZUEggICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLSAqLworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAg ICAgICAgICAgICAgICAgIEJFR0lOOiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAgICAgICAgICAg ICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIGVsc2UgaWYgKGdseXBoLT50 eXBlID09IENPTVBPU0lURV9HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAg IHsKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAgICJcbiAlNSJwRCJkLyUtNWQg JTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCIsCisgICAgICAgICAgZ2x5cGggLSByb3ctPmds eXBoc1tURVhUX0FSRUFdLAorICAgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6 IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICAg JysnLAorICAgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAgIChCVUZGRVJQIChnbHlw aC0+b2JqZWN0KQorICAgICAgICAgICA/ICdCJworICAgICAgICAgICA6IChTVFJJTkdQIChnbHlw aC0+b2JqZWN0KQorICAgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgICA6IChOSUxQIChn bHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgICA6 ICctJykpKSwKKyAgICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgICAgKHVuc2ln bmVkIGludCkgZ2x5cGgtPnUuY21wLmlkKTsKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICU0 ZCAlMS4xZCUxLjFkIiwKKyAgICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgICBnbHlw aC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wKTsK KyAgICAgIGlmIChnbHlwaC0+dS5jbXAuYXV0b21hdGljKQorICAgICAgICBmcHJpbnRmIChzdGRl cnIsICIgJTVkICU0ZCAgJTNkICAlM2QgJXMgLiBbJWQtJWRdXG4iLAorICAgICAgICAgICAgICAg ICAgICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBn bHlwaC0+enZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBo LT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgtPnNsaWNlLmNtcC50byk7CisgICAgICAgIGVsc2UKKyAg ICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJcbiIpOworICAgICAgfQorICBzd2l0Y2ggKGFjdGlv bl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAg ICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAgICAgICAg ICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJT T1JTOgorICAgIHsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxh dGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBj dXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICBt Y19iZ19sc2wgKHcsIHRlbXBfZmFjZV9pZCksIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICBN Q19HTFlQSCwgZHJhd19wLCByZXN1bHQpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxF UjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworICAgIGNhc2UgSE9SSVpPTlRBTF9SVUxFUjoKKyAgICB7CisgICAgICBpZiAo cmVsYXRpdmVfeCA8PSB4X2xpbWl0CisgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkK KyAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4 LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5 cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICBtY19iZ19s c2wgKHcsIHRlbXBfZmFjZV9pZCksIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgIE1DX0dM WVBILCBkcmF3X3AsIHJlc3VsdCk7CisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhU X0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2ZV94IDw9 IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhl bF93aWR0aDsKKyAgICAgICAgICB3aGlsZSAocmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwg cmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAg ICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLAorICAgICAg ICAgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVtcF9mYWNlX2lkKSwgYWN0aXZlX3As CisgICAgICAgICAgICAgICAgICAgICAgICAgTUNfR0xZUEhMRVNTLCBkcmF3X3AsIHJlc3VsdCk7 CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAg ICAgIH0KKyAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENPTVBP U0lURV9HTFlQSCAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3Ig Z2x5cGhfZmxhdm9yID0gKGN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAm JiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfaW5f ZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAg ICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAg ICAgICAgICAgOiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYg IXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93 LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisg ICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJv dy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+IHJl bGF0aXZlX3gpCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAg ICAgICAgICAgIDogKHp2X3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUwor ICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9yID09 IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9 PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09 IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgY3Vyc29yX3R5cGUgPSBSSUdIVF9GUklOR0VfQklU TUFQOworICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5 cGgsIHJlbGF0aXZlX3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAg ICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLAorICAg ICAgICAgICAgICAgICBtY19iZ19sc2wgKHcsIHRlbXBfZmFjZV9pZCksIGFjdGl2ZV9wLAorICAg ICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgcmVzdWx0KTsKKyAgICAgIGJyZWFr OworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAg ICAgICAgIEZJTExfQ09MVU1OOiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAgICAgICAgICAgICAg ICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEZJTExfQ09MVU1OOgorICAg IHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChnbHlwaCAtIHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAg ICAgICYmIHctPm1jLmZjX3ggPiByZWxhdGl2ZV94KQorICAgICAgICAgICAgICAgICAgICAgPyBN Q19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICh6dl9wKQorICAgICAgICAgICAgICAg ICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICghTklMUCAoQlZBUiAo YiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAg ICAgICAgICYmIG9wb2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRf dnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAg ICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVy ICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwgaHBvcywg dnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgs IGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVtcF9mYWNlX2lk KSwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgZHJhd19wLCByZXN1 bHQpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS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seXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ct PnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJl bGF0aXZlX3gsCisgICAgICAgICdYJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAg IChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNU UklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAn LScpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+ZmFjZV9p ZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0 X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT51Lnh3aWRnZXQsCisgICAgICAgIGdseXBoLT54 LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIg OiAiLS0iLAorICAgICAgICAnLicpOworI2VuZGlmCisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisg IHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICBN VUxUSVBMRV9DVVJTT1JTOiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICovCisv KiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAg eworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4 LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBl LCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAo dywgdGVtcF9mYWNlX2lkKSwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgIE1DX0dMWVBILCBk cmF3X3AsIHJlc3VsdCk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIFhXSURH RVRfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICov CisgICAgY2FzZSBIT1JJWk9OVEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChyZWxhdGl2ZV94 IDw9IHhfbGltaXQKKyAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICBt Y19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBo cG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29y X3dpZHRoLCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVt cF9mYWNlX2lkKSwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgTUNfR0xZUEgsIGRyYXdf cCwgcmVzdWx0KTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0g cm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJlbGF0aXZlX3ggPD0geF9saW1pdCkK KyAgICAgICAgeworICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOwor ICAgICAgICAgIHdoaWxlIChyZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94 LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgd2QsIGgs IGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAg ICAgICAgICAgbWNfYmdfbHNsICh3LCB0ZW1wX2ZhY2VfaWQpLCBhY3RpdmVfcCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICBNQ19HTFlQSExFU1MsIGRyYXdfcCwgcmVzdWx0KTsKKyAgICAgICAg ICAgICAgcmVsYXRpdmVfeCArPSBmcmFtZV9jaGFyX3dpZHRoOworICAgICAgICAgICAgfQorICAg ICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8q ICAgICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIFhXSURHRVRfR0xZUEgg ICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2Fz ZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2 b3IgPSAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1 bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JB Ul9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9pbl9mcmluZ2VfcAor ICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAg ICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICA6 IChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVu Y2F0ZWRfb25fcmlnaHRfcAorICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVl ZF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAg ICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2Fy ZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF94ID4gcmVsYXRpdmVfeCkK KyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAg OiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAg ICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHw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pCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAg ICAgICAgIDogKHp2X3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAg ICAgICAgICAgICAgICAgIDogKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAg ICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92 ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3kgPT0geQor ICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF92cG9zID09IHZwb3MpCisgICAgICAgICAg ICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7 CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZmNf ZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5 cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgbWNfYmdfbHNs ICh3LCB0ZW1wX2ZhY2VfaWQpLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgZ2x5cGhfZmxh dm9yLCBkcmF3X3AsIHJlc3VsdCk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0gKi8KKyAgfQorICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIEVORDogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAg ICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCit9CisKK3ZvaWQKK21j X2RyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgs IHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnN0YXJ0 LCBpbnQgeCwgaW50IGhwb3NfbGVuZ3RoLCBpbnQgdnBvcywKKyAgICAgICAgICAgICBpbnQgYm90 dG9tX3Zwb3MsIGJvb2wgYWN0aXZlX3AsIGJvb2wgZHJhd19wKQoreworLyoKKyAgY2xvY2tfdCBj bG9ja19zdGFydCA9IGNsb2NrKCk7CisqLworICAvKiBOVCBFbWFjcyBjcmFzaGVzIG9uIHN0YXJ0 dXAgd2l0aG91dCBhIGBCVUZGRVJQJyBjaGVjayBpbiBgdXBkYXRlX3dpbmRvdycuICovCisgIGlm ICghQlVGRkVSUCAody0+Y29udGVudHMpKQorICAgIHJldHVybjsKKyAgaWYgKE5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAmJiBOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgcmV0dXJuOworICBpZiAo dnBvcyA9PSBib3R0b21fdnBvcykKKyAgICByZXR1cm47CisgIGlmICghcm93LT51c2VkW1RFWFRf QVJFQV0pCisgICAgcmV0dXJuOworICBpbnQgaHBvc19zdGFydCA9IHN0YXJ0IC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXTsKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAgIGZwcmludGYgKHN0 ZGVyciwgIm1jX2RyYXdfcm93ICglcyk6ICB2cG9zICglZCkgfCBocG9zICglZCkgfCBsZW4gKCVk KVxuIiwKKyAgICAgICAgICAgICAgICAgICAgIG1jX3dpbmRvdyAodyksIHZwb3MsIGhwb3Nfc3Rh cnQsIGhwb3NfbGVuZ3RoKTsKKyAgTGlzcF9PYmplY3Qgd2luZG93OworICBYU0VUV0lORE9XICh3 aW5kb3csIHcpOworICBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCA9CisgICAgbWNfZ2V0X2N1 cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBv cyk7CisgIGludCBvcG9pbnRfZngsIG9wb2ludF9meSwgb3BvaW50X3dkLCBvcG9pbnRfaDsKKyAg c3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIExpc3BfT2JqZWN0IGJ1ZiA9 IHctPmNvbnRlbnRzOworICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgIHN0cnVjdCBidWZmZXIgKmIg PSBYQlVGRkVSIChidWYpOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBCRUdJTiBKT1VSTkVZIC4uLgorKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisgIGludCBmcmFtZV9jaGFyX3dpZHRoID0gRlJBTUVfQ09MVU1OX1dJRFRIIChmKTsKKyAg aW50IHRleHRfYXJlYV93aWR0aCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7Cisg IGludCBoZWFkZXJfbGluZV9mb3JtYXQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsK KyAgYm9vbCBjdXJzb3JfaW5fZnJpbmdlX3AgPSB3LT5jdXJzb3IueCArIGZyYW1lX2NoYXJfd2lk dGggPj0gdGV4dF9hcmVhX3dpZHRoOworICBMaXNwX09iamVjdCBtY19yZXN1bHQgPSBRbmlsOwor ICBMaXNwX09iamVjdCBjaF9yZXN1bHQgPSBRbmlsOworICBMaXNwX09iamVjdCBmY19yZXN1bHQg PSBRbmlsOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAg ICAgICBFUkFTRSBUSEUgUkVBTCBDVVJTT1IKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBp ZiAoZHJhd19wCisgICAgICAmJiB3LT5waHlzX2N1cnNvcl9vbl9wCisgICAgICAmJiB2cG9zID09 IHctPmN1cnNvci52cG9zKQorICAgIHsKKyAgICAgIG1jX2VyYXNlX2N1cnNvciAodywgbWF0cml4 LCByb3csIHctPmN1cnNvci54LCB3LT5jdXJzb3IueSwgdy0+Y3Vyc29yLmhwb3MsCisgICAgICAg ICAgICAgICAgICAgICAgIHctPmN1cnNvci52cG9zLCBNQ19HTFlQSCwgdy0+cGh5c19jdXJzb3Jf dHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX2dseXBoLT5waXhlbF93aWR0aCk7 CisgICAgICB3LT5waHlzX2N1cnNvcl9vbl9wID0gZmFsc2U7CisgICAgICB3LT5waHlzX2N1cnNv cl90eXBlID0gTk9fQ1VSU09SOworICAgIH0KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAg ICAgICAgICAgICAgICAgICAgICAgICBSRVBMQUNFIFRIRSBSRUFMIENVUlNPUgorKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisgIGVudW0gZmFjZV9pZCBiZ19mYWNlX2lkID0gKGN1cnNvcl9nbHlw aCA9PSBOVUxMKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gREVGQVVMVF9GQUNFX0lE CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBjdXJzb3JfZ2x5cGgtPmZhY2VfaWQ7Cisg IC8qIEZJWE1FOiAgUHV0IGluIHNvbWUgY29kZSB0byBkZWZhdWx0IHRvIEhPTExPV19CT1hfQ1VS U09SIGlmIHRoZSB1c2VyIGhhcworICB1bndpdHRpbmdseSBjb21lIHVwIHdpdGggc29tZSB1bmFj Y2VwdGFibGUgZm9ybSBvZiB1bnJlY29nbml6ZWQgY3Vyc29yIHR5cGUuICovCisgIExpc3BfT2Jq ZWN0IGxpc3BfdHlwZSA9IEJWQVIgKGIsIG1jX3JlYWxfZmFrZV9jdXJzb3IpOworICBlbnVtIHRl eHRfY3Vyc29yX2tpbmRzIGN1cnNvcl90eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfbGlzcF90b19jdXJzb3JfdHlw ZSAoWENBUiAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGxpc3BfdHlwZSk7CisgIGludCBjdXJzb3Jf d2lkdGggPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICA/IFhGSVhO VU0gKFhDQVIgKFhDRFIgKGxpc3BfdHlwZSkpKQorICAgICAgICAgICAgICAgICAgICAgOiAt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yLnZwb3MKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgY2hfaG9yaXpvbnRhbF9ydWxlcikpKQorICAgIHsKKyAgICAgIG1j X2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIC0xLCB3 LT5jdXJzb3IueSwgLTEsIHctPmN1cnNvci5ocG9zLAorICAgICAgICAgICAgICAgICB3LT5jdXJz b3IudnBvcywgLTEsIC0xLCBMRUZUX0ZSSU5HRV9CSVRNQVAsIC0xLAorICAgICAgICAgICAgICAg ICBmZ19sc2wsIG1jX2JnX2xzbCAodywgYmdfZmFjZV9pZCksIGFjdGl2ZV9wLAorICAgICAgICAg ICAgICAgICBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUCwgZHJhd19wLCAmY2hfcmVzdWx0KTsKKyAg ICB9CisgIGlmIChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29y LnZwb3MKKyAgICAgICYmIHctPmN1cnNvci5ocG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICYmIHct PmN1cnNvci5ocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisgICAgICAmJiAhTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmICFOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2hvcml6b250YWxfcnVsZXIpKSkKKyAg ICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoY3Vyc29yX2luX2ZyaW5n ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT5jb250aW51 ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19QSUxDUk9X CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfaW5fZnJpbmdl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNh dGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g TUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX1JFQ1RBTkdMRQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOT19GTEFWT1I7CisgICAgICBt Y19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54LCAtMSwg dy0+Y3Vyc29yLnksIC0xLCB3LT5jdXJzb3IuaHBvcywKKyAgICAgICAgICAgICAgICAgdy0+Y3Vy c29yLnZwb3MsIC0xLCAtMSwgUklHSFRfRlJJTkdFX0JJVE1BUCwgLTEsIGN1cnNvcl9mZywKKyAg ICAgICAgICAgICAgICAgbWNfYmdfbHNsICh3LCBiZ19mYWNlX2lkKSwgYWN0aXZlX3AsIGdseXBo X2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgZHJhd19wLCAmY2hfcmVzdWx0KTsKKyAgICB9Cisg ICAgLyogRVhBTVBMRSAoYnVmZmVyLWxvY2FsKTogIChzZXRxIG1jLXJlYWwtZmFrZS1jdXJzb3Ig bmlsLyduby8ibm8iKSAqLworICAgIGVsc2UgaWYgKCFjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAg ICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBOT19DVVJTT1IKKyAgICAgICAgICAgICAmJiB2cG9z ID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPj0gaHBv c19zdGFydAorICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zIDwgaHBvc19zdGFydCArIGhw b3NfbGVuZ3RoKQorICAgIHsKKyAgICAgIC8qIFdoZW4gYSB1c2VyIGhhcyBub3Qgc3BlY2lmaWVk IGEgdmFsdWUgZm9yIGBtYy1yZWFsLWZha2UtY3Vyc29yJywgb3IgdGhlCisgICAgICB2YWx1ZSBp cyBgbm9gIGluIHRoZSBmb3JtIG9mIGEgc3ltYm9sIG9yIHN0cmluZywgdGhlbiB0aGUgZGVmYXVs dCB3ZSB1c2UKKyAgICAgIGFuIEJBUl9DVVJTT1IgYW5kIGFuIEhCQVJfQ1VSU09SIC0tIGJvdGgg aGF2aW5nIGEgY3Vyc29yX3dpZHRoIG9mIDEuICovCisgICAgICBtY19nZXRfY3Vyc29yX2dlb21l dHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsIHctPmN1cnNvci55 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhw b3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBCQVJfQ1VSU09SLCAxLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0 cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29y LnksIG9wb2ludF9meSwKKyAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNv ci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLCBCQVJfQ1VSU09SLAorICAgICAgICAgICAgICAg ICAxLCBjdXJzb3JfZmcsIG1jX2JnX2xzbCAodywgYmdfZmFjZV9pZCksIGFjdGl2ZV9wLCBNQ19H TFlQSExFU1MsCisgICAgICAgICAgICAgICAgIGRyYXdfcCwgTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gJmNoX3Jlc3VsdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAm bWNfcmVzdWx0KTsKKyAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93 LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3Ms ICZvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhCQVJfQ1VSU09SLCAx LCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9n bHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksIG9wb2ludF9meSwKKyAg ICAgICAgICAgICAgICAgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9pbnRfd2Qs IG9wb2ludF9oLCBIQkFSX0NVUlNPUiwKKyAgICAgICAgICAgICAgICAgMSwgY3Vyc29yX2ZnLCBt Y19iZ19sc2wgKHcsIGJnX2ZhY2VfaWQpLCBhY3RpdmVfcCwgTUNfR0xZUEgsCisgICAgICAgICAg ICAgICAgIGRyYXdfcCwgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25m KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJmNoX3Jlc3VsdAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAmbWNfcmVzdWx0KTsKKyAgICB9Cisg ICAgZWxzZSBpZiAoIWN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAgICAgICYmIHZwb3MgPT0g dy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0 YXJ0CisgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19s ZW5ndGgKKyAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9HTFlQ SCkKKyAgICB7CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywg dy0+Y3Vyc29yLngsICZvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCAm b3BvaW50X2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vy c29yX3dpZHRoLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3cs IGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksIG9wb2lu dF9meSwKKyAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBv cG9pbnRfd2QsIG9wb2ludF9oLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgY3Vyc29y X3dpZHRoLCBjdXJzb3JfZmcsIG1jX2JnX2xzbCAodywgYmdfZmFjZV9pZCksIGFjdGl2ZV9wLAor ICAgICAgICAgICAgICAgICBNQ19HTFlQSCwgZHJhd19wLCBOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/ICZjaF9yZXN1bHQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAmbWNf cmVzdWx0KTsKKyAgICB9CisgIGVsc2UgaWYgKCFjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAg ICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBv cyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zIDwgaHBvc19zdGFy dCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+dHlwZSA9PSBTVFJF VENIX0dMWVBIKQorICAgIHsKKyAgICAgIC8qIElmIGEgdXNlciBoYXMgc2V0IGB4LXN0cmV0Y2gt Y3Vyc29yJyB0byBhIG5vbi1uaWwgdmFsdWUsIGhlL3NoZSBjaG9zZSB0bworICAgICAgaGF2ZSBh IGN1cnNvciB0aGF0IHNwYW5zIHRoZSBlbnRpcmUgbGVuZ3RoIG9mIHRoZSBTVFJFVENIX0dMWVBI LiAqLworICAgICAgaWYgKCF4X3N0cmV0Y2hfY3Vyc29yX3ApCisgICAgICAgIHsKKyAgICAgICAg ICAvKiBUaGUgSEJBUl9DVVJTT1Igc2hhbGwgaGF2ZSBhIGBjdXJzb3Jfd2lkdGhgIG9mIDEuICov CisgICAgICAgICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1 cnNvci54LCAmb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHct PmN1cnNvci55LCAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLCBIQkFSX0NVUlNPUiwg MSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmb3BvaW50X3dkKTsKKyAgICAg ICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54 LCBvcG9pbnRfZngsIHctPmN1cnNvci55LCBvcG9pbnRfZnksCisgICAgICAgICAgICAgICAgICAg ICB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisg ICAgICAgICAgICAgICAgICAgICBIQkFSX0NVUlNPUiwgMSwgY3Vyc29yX2ZnLCBtY19iZ19sc2wg KHcsIGJnX2ZhY2VfaWQpLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgIE1DX0dMWVBI LCBkcmF3X3AsIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAmY2hfcmVz dWx0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAm bWNfcmVzdWx0KTsKKyAgICAgICAgfQorICAgICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywg bWF0cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgdy0+Y3Vyc29yLnksICZvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnZwb3MsICZvcG9pbnRfaCwgY3Vy c29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsICZv cG9pbnRfd2QpOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBo LCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwgb3BvaW50X2Z5LAorICAgICAg ICAgICAgICAgICB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwgb3Bv aW50X2gsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGN1cnNv cl9mZywgbWNfYmdfbHNsICh3LCBiZ19mYWNlX2lkKSwgYWN0aXZlX3AsCisgICAgICAgICAgICAg ICAgIE1DX0dMWVBILCBkcmF3X3AsIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg bWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICZjaF9y ZXN1bHQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogJm1jX3Jlc3Vs dCk7CisgICAgfQorICBpZiAoaHBvc19sZW5ndGggPT0gMSkKKyAgICB7CisgICAgICBpZiAoIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICB7Cisg ICAgICAgICAgLyogVGhlIHNwYWNlIGFwcGVuZGVkIHRvIGEgcm93IGVuZGluZyB3aXRoIGEgbmV3 IGxpbmUKKyAgICAgICAgICBkb2VzIG5vdCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDAp IHRoYXQgd2UgY2FuCisgICAgICAgICAgdXNlIGZvciB0aGlzIHBhcnRpY3VsYXIgYXBwbGljYXRp b24uICBXaGVuIHRoZXJlIGlzIGEKKyAgICAgICAgICBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVu dHJ5IHRoYXQgYXNzaWducyBhIHZpc2libGUKKyAgICAgICAgICBnbHlwaCB0byBhIG5ldyBsaW5l LCB0aGVyZSBpcyBubyBwcm9ibGVtIGJlY2F1c2UgdGhhdAorICAgICAgICAgIGdseXBoIGhhcyBh IGBnbHlwaC0+Y2hhcnBvcycgdGhhdCB3ZSBjYW4gdXNlLiAgV2hlbgorICAgICAgICAgIG5vIHZp c2libGUgRU9MIGdseXBoIGV4aXN0cywgd2UgdXNlIHRoZSBmb2xsb3dpbmcKKyAgICAgICAgICB0 ZXN0OiAgdGhlIGFwcGVuZGVkIHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMgb25lCisgICAg ICAgICAgbGVzcyB0aGFuIHRoZSBlbmQgb2YgdGhlIG1hdHJpeCByb3cuICovCisgICAgICAgICAg aW50IGhwb3MgPSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgc3Ry dWN0IGdseXBoICpwcmV2aW91c19nbHlwaCA9ICgwIDw9IGhwb3MgLSAxICYmIGhwb3MgLSAxIDwg cm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgICAgICAgICBib29sIHNraXBf cCA9IChwcmV2aW91c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYg cHJldmlvdXNfZ2x5cGgtPmNoYXJwb3MgPT0gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSAt IDEpOworICAgICAgICAgIGludCBwb3NpbnQgPSAoc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FS RUFdID09IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAg PyBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpIC0gMQorICAgICAgICAgICAgICAgICAgICAg ICA6IHN0YXJ0LT5jaGFycG9zOworICAgICAgICAgIExpc3BfT2JqZWN0IHNwZWNzID0gbWNfYXNz b2MgKG1ha2VfZml4bnVtIChwb3NpbnQpLCBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1j X2NvbmYpKTsKKyAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3Mg PiAwKQorICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAg ICAgICAgICYmICFOSUxQIChzcGVjcykKKyAgICAgICAgICAgICAgJiYgc3RhcnQtPnkgPD0gd2lu ZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICYmICFza2lwX3AKKyAgICAgICAg ICAgICAgJiYgIXN0YXJ0LT56dl9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBMaXNw X09iamVjdCBsaXNwX3R5cGUgPSBtY19udGggKDEsIHNwZWNzKTsKKyAgICAgICAgICAgICAgZW51 bSB0ZXh0X2N1cnNvcl9raW5kcyBjdXJzb3JfdHlwZSA9IChDT05TUCAobGlzcF90eXBlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfbGlz cF90b19jdXJzb3JfdHlwZSAoWENBUiAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbWNfbGlzcF90b19jdXJzb3JfdHlwZSAo bGlzcF90eXBlKTsKKyAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCA9IChDT05TUCAobGlz cF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gWEZJWE5VTSAoWENB UiAoWENEUiAobGlzcF90eXBlKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IC0xOworICAgICAgICAgICAgICBMaXNwX09iamVjdCBtY19mb3JlZ3JvdW5kID0gbWNfbnRoICgy LCBzcGVjcyk7CisgICAgICAgICAgICAgIGlmIChTVFJJTkdQIChtY19mb3JlZ3JvdW5kKSkKKyAg ICAgICAgICAgICAgICBtY19mb3JlZ3JvdW5kID0gbWNfY29sb3JfdmVjdG9yX2NhbGMgKHcsIG1j X2ZvcmVncm91bmQpOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKE5JTFAgKG1jX2ZvcmVncm91 bmQpKQorICAgICAgICAgICAgICAgICAgbWNfZm9yZWdyb3VuZCA9IHctPmNoX2ZvcmVncm91bmQ7 CisgICAgICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7 CisgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9B UkVBKTsKKyAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRF WFRfQVJFQSwgeCwgeF9saW1pdCwgcm93LT55LCBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0sIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93 aWR0aCwgbWNfZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcCwg TVVMVElQTEVfQ1VSU09SUywgZHJhd19wLCAmbWNfcmVzdWx0KTsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgfQorICAgICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZj X3Zpc2libGUpKQorICAgICAgICAgICYmIHctPm1jLmZjX3ggPD0gdGV4dF9hcmVhX3dpZHRoCisg ICAgICAgICAgJiYgdy0+bWMuZmNfeCA+PSB3LT5tYy5sbnVtX3BpeGVsX3dpZHRoKQorICAgICAg ICB7CisgICAgICAgICAgaW50IHhfbGltaXQgPSB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoOworICAg ICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci54ID09IHctPm1jLmZj X3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueSA9 PSBzdGFydC0+eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1 cnNvci5ocG9zID09IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAg ICAgICAgIGlmICh4ICsgc3RhcnQtPnBpeGVsX3dpZHRoIDw9IHRleHRfYXJlYV93aWR0aAorICAg ICAgICAgICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAg ICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAg JiYgKCh3LT5tYy5mY194ID49IHgKKyAgICAgICAgICAgICAgICAgICAmJiB3LT5tYy5mY194IDwg eCArIHN0YXJ0LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgIHx8IHN0YXJ0ID09IHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpCisgICAgICAg ICAgICAgICYmIHN0YXJ0LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAg ICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgbWNfZW5naW5lICh3LCBt YXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwgcm93LT55LCBzdGFydCAt IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgIEJB Ul9DVVJTT1IsIDEsIHctPmZjX2ZvcmVncm91bmQsIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAg ICAgICAgICBGSUxMX0NPTFVNTiwgZHJhd19wLCAmZmNfcmVzdWx0KTsKKyAgICAgICAgfQorICAg ICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQor ICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9ob3Jpem9udGFsX3J1bGVyKSkKKyAgICAg ICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICB7CisgICAgICAgICAgaW50 IHhfbGltaXQgPSAoc3RhcnQgPT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtU RVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgID8gdGV4dF9hcmVhX3dpZHRo CisgICAgICAgICAgICAgICAgICAgICAgICA6IHggKyBzdGFydC0+cGl4ZWxfd2lkdGg7CisgICAg ICAgICAgLyogUHJlc2VydmUgc3VwcG9ydCBmb3IgZGVmYXVsdCBiZWhhdmlvciBzdWNoIHRoYXQg YSB1c2VyIG1heQorICAgICAgICAgIHNwZWNpZnkgdGhlIGhlaWdodCBvZiBhbiBIQkFSX0NVUlNP Uiwgd2hpY2ggYmVnaW5zIGl0cyBqb3VybmV5CisgICAgICAgICAgYXMgdGhlIGBjdXJzb3Jfd2lk dGgnLiAgYG1jX2dldF9jdXJzb3JfZ2VvbWV0cnknIHJlYWRqdXN0cy4gKi8KKyAgICAgICAgICBt Y19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBzdGFydCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LCBy b3ctPnksIHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAgICAg ICAgICAgICAgIEhCQVJfQ1VSU09SLCAxLCB3LT5jaF9mb3JlZ3JvdW5kLCBhY3RpdmVfcCwKKyAg ICAgICAgICAgICAgICAgICAgIEhPUklaT05UQUxfUlVMRVIsIGRyYXdfcCwgJmNoX3Jlc3VsdCk7 CisgICAgICAgIH0KKyAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxf cnVsZXIpKQorICAgICAgICAgICYmICFmaWxsX2NvbHVtbl90cnVtcHNfcCkKKyAgICAgICAgewor ICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsK KyAgICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9ICh3LT5jdXJzb3IueSA9PSBzdGFy dC0+eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52 cG9zID09IHZwb3MpOworICAgICAgICAgIGlmICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYg dnBvcyA+IDApCisgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAg ICAgICAgICAgICAgJiYgKCh3LT5jdXJzb3IueCA+PSB4CisgICAgICAgICAgICAgICAgICAgJiYg dy0+Y3Vyc29yLnggPCB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAg fHwgc3RhcnQgPT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFd IC0gMSkKKyAgICAgICAgICAgICAgJiYgc3RhcnQtPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kg KHcpCisgICAgICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgICAgICBt Y19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBzdGFydCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LCBy b3ctPnksIHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAgICAg ICAgICAgICAgICAgQkFSX0NVUlNPUiwgMSwgdy0+Y2hfZm9yZWdyb3VuZCwgYWN0aXZlX3AsCisg ICAgICAgICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSLCBkcmF3X3AsICZjaF9yZXN1bHQp OworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgaW50IHJlbGF0 aXZlX3ggPSAwOworICAgICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9NQVJHSU5fQVJFQTsgYXJl YSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHN0cnVjdCBn bHlwaCAqZ2x5cGggPSByb3ctPmdseXBoc1thcmVhXTsKKyAgICAgICAgICAgIHN0cnVjdCBnbHlw aCAqZ2x5cGhfZW5kID0gZ2x5cGggKyByb3ctPnVzZWRbYXJlYV07CisgICAgICAgICAgICAvKiBH bHlwaCBmb3IgYSBsaW5lIGVuZCBpbiB0ZXh0LiAqLworICAgICAgICAgICAgaWYgKGFyZWEgPT0g VEVYVF9BUkVBICYmIGdseXBoID09IGdseXBoX2VuZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDApCisg ICAgICAgICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgICAgICAgZm9yICg7IGdseXBoIDwgZ2x5 cGhfZW5kOyArK2dseXBoKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHZw b3MgIT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGggIT0gZ2x5 cGhfZW5kIC0gMQorICAgICAgICAgICAgICAgICAgICAmJiB3LT5tYy5mY194IDwgcmVsYXRpdmVf eAorICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHJlbGF0aXZlX3gKKyAgICAg ICAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19j b25mKSkpCisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBpZiAoIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBUaGUgc3BhY2UgYXBwZW5kZWQgdG8gYSBy b3cgZW5kaW5nIHdpdGggYSBuZXcgbGluZSBkb2VzCisgICAgICAgICAgICAgICAgICAgIG5vdCBo YXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDApIHRoYXQgd2UgY2FuIHVzZSBmb3IgdGhpcwor ICAgICAgICAgICAgICAgICAgICBwYXJ0aWN1bGFyIGFwcGxpY2F0aW9uLiAgV2hlbiBhIGBidWZm ZXItZGlzcGxheS10YWJsZScgZW50cnkKKyAgICAgICAgICAgICAgICAgICAgYXNzaWducyBhIHZp c2libGUgZ2x5cGggdG8gYSBuZXcgbGluZSwgdGhlcmUgaXMgbm8gcHJvYmxlbQorICAgICAgICAg ICAgICAgICAgICBiZWNhdXNlIHRoYXQgZ2x5cGggaGFzIGEgYGdseXBoLT5jaGFycG9zJyB0aGF0 IHdlIGNhbiB1c2UuCisgICAgICAgICAgICAgICAgICAgIFdoZW4gbm8gdmlzaWJsZSBFT0wgZ2x5 cGggZXhpc3RzLCB3ZSB1c2UgdGhlIGZvbGxvd2luZyB0ZXN0OgorICAgICAgICAgICAgICAgICAg ICB0aGUgYXBwZW5kZWQgc3BhY2UgaGFzIGEgcG9zaXRpb24gdGhhdCBpcyBvbmUgbGVzcyB0aGFu IHRoZQorICAgICAgICAgICAgICAgICAgICBlbmQgb2YgdGhlIG1hdHJpeCByb3cuICovCisgICAg ICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFd OworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnByZXZpb3VzX2dseXBoID0gKDAg PD0gaHBvcyAtIDEgJiYgaHBvcyAtIDEgPCByb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gcm93LT5nbHlwaHNb VEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IE5VTEw7CisgICAgICAgICAgICAgICAgICAgIGJvb2wgc2tpcF9w ID0gKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgcHJldmlvdXNfZ2x5cGgtPmNoYXJwb3MgPT0gTUFUUklYX1JPV19FTkRfQ0hBUlBP UyAocm93KSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRydWUK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBXaGVuIGEgYGJ1ZmZlci1kaXNw bGF5LXRhYmxlJyBlbnRyeSBjb250YWlucworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGEgdmlzaWJsZSB0YWIgY2hhcmFjdGVyICgiwrsiKSwgdGhlIHN1YnNlcXVlbnQKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTVFJFVENIX0dMWVBIIHdpbGwgaGF2ZSB0aGUg c2FtZSBnbHlwaC0+Y2hhcnBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFz IHRoZSBhZm9yZW1lbnRpb25lZCB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIuICovCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAocHJldmlvdXNfZ2x5cGggIT0gTlVMTAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHByZXZpb3VzX2dseXBoLT5jaGFycG9z ID09IGdseXBoLT5jaGFycG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBmYWxzZTsKKyAgICAg ICAgICAgICAgICAgICAgaW50IHBvc2ludCA9IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSAtIDEKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogZ2x5cGgtPmNoYXJwb3M7CisgICAgICAgICAgICAgICAgICAgIExp c3BfT2JqZWN0IHNwZWNzID0gbWNfYXNzb2MgKG1ha2VfZml4bnVtIChwb3NpbnQpLCBCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKTsKKyAgICAgICAgICAgICAgICAgICAgaWYg KCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICYmICFOSUxQIChzcGVjcykKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT55 IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAgICAgICAgICAgJiYg IXNraXBfcAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWdseXBoLT56dl9wKQorICAgICAg ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGxp c3BfdHlwZSA9IG1jX250aCAoMSwgc3BlY3MpOworICAgICAgICAgICAgICAgICAgICAgICAgZW51 bSB0ZXh0X2N1cnNvcl9raW5kcyBjdXJzb3JfdHlwZSA9IChDT05TUCAobGlzcF90eXBlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxpc3BfdHlwZSkpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBtY19s aXNwX3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOworICAgICAgICAgICAgICAgICAgICAgICAg aW50IGN1cnNvcl93aWR0aCA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IFhGSVhOVU0gKFhDQVIgKFhDRFIgKGxpc3BfdHlw ZSkpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogLTE7Cisg ICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBtY19mb3JlZ3JvdW5kID0gbWNfbnRo ICgyLCBzcGVjcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoU1RSSU5HUCAobWNfZm9y ZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2ZvcmVncm91bmQgPSBtY19j b2xvcl92ZWN0b3JfY2FsYyAodywgbWNfZm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgICAg ICAgICAgIGVsc2UgaWYgKE5JTFAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgIG1jX2ZvcmVncm91bmQgPSB3LT5jaF9mb3JlZ3JvdW5kOworICAgICAgICAgICAg ICAgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAg ICAgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywg VEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4 LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LCByb3ctPnksIGdseXBoIC0g cm93LT5nbHlwaHNbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgbWNfZm9yZWdyb3VuZCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIE1VTFRJUExFX0NVUlNPUlMs IGRyYXdfcCwgJm1jX3Jlc3VsdCk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWMuZmNf eCA8PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWMuZmNfeCA+ PSB3LT5tYy5sbnVtX3BpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7 CisgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNv ci54ID09IHctPm1jLmZjX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLnkgPT0gZ2x5cGgtPnkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgICAgICAg ICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAg ICAgICAgICAgICAgaWYgKGhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAgICAgICAgICAg ICAgJiYgaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAgICAgICAg ICAgICAgJiYgcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCA8PSB0ZXh0X2FyZWFfd2lk dGgKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAm JiB2cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9m b3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICgoZ2x5cGggIT0gZ2x5cGhf ZW5kIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5tYy5mY194ID49IHJl bGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWMuZmNfeCA8IHJl bGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgfHwgKGdseXBoID09IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+bWMuZmNfeCA+PSByZWxhdGl2ZV94KSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICYmIGdseXBoLT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAg ICAgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgICAgICAgICAg ICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwgeF9s aW1pdCwgcm93LT55LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgQkFSX0NVUlNPUiwgMSwgdy0+ZmNfZm9yZWdyb3VuZCwgYWN0aXZlX3AsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBGSUxMX0NPTFVNTiwgZHJhd19wLCAmZmNfcmVzdWx0KTsK KyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICYm ICFOSUxQIChCVkFSIChiLCBjaF9ob3Jpem9udGFsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAg ICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgaW50IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FS RUEpOworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgLyogUHJlc2VydmUgc3VwcG9ydCBmb3Ig ZGVmYXVsdCBiZWhhdmlvciBzdWNoIHRoYXQgYSB1c2VyIG1heQorICAgICAgICAgICAgICAgICAg ICBzcGVjaWZ5IHRoZSBoZWlnaHQgb2YgYW4gSEJBUl9DVVJTT1IsIHdoaWNoIGJlZ2lucyBpdHMg am91cm5leQorICAgICAgICAgICAgICAgICAgICBhcyB0aGUgYGN1cnNvcl93aWR0aCcuICBgbWNf Z2V0X2N1cnNvcl9nZW9tZXRyeScgcmVhZGp1c3RzLiAqLworICAgICAgICAgICAgICAgICAgICBp ZiAoaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwg aHBvc19zdGFydCArIGhwb3NfbGVuZ3RoKQorICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2lu ZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LCByb3ct PnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIQkFSX0NV UlNPUiwgMSwgdy0+Y2hfZm9yZWdyb3VuZCwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSLCBkcmF3X3AsICZjaF9yZXN1bHQpOworICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgIU5J TFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgJiYg IWZpbGxfY29sdW1uX3RydW1wc19wKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7Cisg ICAgICAgICAgICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci55 ID09IGdseXBoLT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgICAgICAgICAgICBpbnQg aHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAg ICAgaWYgKGhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBv cyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAgICAgICAgICAgICAgJiYg KChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAgICAg ICAgICAgJiYgKChnbHlwaCAhPSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPmN1cnNvci54ID49IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPCByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRo KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChnbHlwaCA9PSBnbHlwaF9lbmQgLSAx CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHJlbGF0 aXZlX3gpKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnkgPD0gd2luZG93X3Rl eHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1 cnNvcl9wKQorICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3cs IGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBCQVJfQ1VSU09SLCAxLCB3LT5jaF9mb3Jl Z3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIFZFUlRJ Q0FMX1JVTEVSLCBkcmF3X3AsICZjaF9yZXN1bHQpOworICAgICAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAg ICAgICB9CisgICAgICAgICAgfQorICAgICAgfQorICB3c2V0X21jX3RlbXBfY2FjaGUgKHcsIFFu aWwpOworICBpZiAoTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkp CisgICAgd3NldF9tY19jYWNoZSAodywgUW5pbCk7CisgICAgZWxzZSBpZiAoIU5JTFAgKG1jX3Jl c3VsdCkKKyAgICAgICAgICAgICAmJiAhTklMUCAody0+bWNfY2FjaGUpKQorICAgICAgd3NldF9t Y19jYWNoZSAodywgQ0FMTE4gKEZhcHBlbmQsIHctPm1jX2NhY2hlLCBtY19yZXN1bHQpKTsKKyAg ICAgIGVsc2UgaWYgKCFOSUxQIChtY19yZXN1bHQpCisgICAgICAgICAgICAgICAmJiBOSUxQICh3 LT5tY19jYWNoZSkpCisgICAgICAgIHdzZXRfbWNfY2FjaGUgKHcsIG1jX3Jlc3VsdCk7CisgIGlm IChOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICB3 c2V0X2NoX2NhY2hlICh3LCBRbmlsKTsKKyAgICBlbHNlIGlmICghTklMUCAoY2hfcmVzdWx0KQor ICAgICAgICAgICAgICYmICFOSUxQICh3LT5jaF9jYWNoZSkpCisgICAgICB3c2V0X2NoX2NhY2hl ICh3LCBDQUxMTiAoRmFwcGVuZCwgdy0+Y2hfY2FjaGUsIGNoX3Jlc3VsdCkpOworICAgICAgZWxz ZSBpZiAoIU5JTFAgKGNoX3Jlc3VsdCkKKyAgIC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zsKKyAgc3dpdGNoIChjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGNhc2UgTUNfVEVNUF9D QUNIRToKKyAgICAgICAgeworICAgICAgICAgIGNhY2hlID0gdy0+bWNfdGVtcF9jYWNoZTsKKyAg ICAgICAgICBjYWNoZV9zdHJpbmcgPSBTU0RBVEEgKGJ1aWxkX3N0cmluZyAoIk1DX1RFTVBfQ0FD SEUiKSk7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2UgTUNfQ0FDSEU6 CisgICAgICAgIHsKKyAgICAgICAgICBjYWNoZSA9IHctPm1jX2NhY2hlOworICAgICAgICAgIGNh Y2hlX3N0cmluZyA9IFNTREFUQSAoYnVpbGRfc3RyaW5nICgiTUNfQ0FDSEUiKSk7CisgICAgICAg ICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2UgQ0hfQ0FDSEU6CisgICAgICAgIHsKKyAg ICAgICAgICBjYWNoZSA9IHctPmNoX2NhY2hlOworICAgICAgICAgIGNhY2hlX3N0cmluZyA9IFNT REFUQSAoYnVpbGRfc3RyaW5nICgiQ0hfQ0FDSEUiKSk7CisgICAgICAgICAgYnJlYWs7CisgICAg ICAgIH0KKyAgICAgIGNhc2UgRkNfQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBjYWNoZSA9 IHctPmZjX2NhY2hlOworICAgICAgICAgIGNhY2hlX3N0cmluZyA9IFNTREFUQSAoYnVpbGRfc3Ry aW5nICgiRkNfQ0FDSEUiKSk7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9Cisg IExpc3BfT2JqZWN0IHJlc3VsdCA9IFFuaWw7CisgIGludCByb3dfdnBvcyA9IE1BVFJJWF9ST1df VlBPUyAocm93LCBtYXRyaXgpOworICBpZiAoTklMUCAoY2FjaGUpKQorICAgIHJldHVybiByZXN1 bHQ7CisgIC8qIFNUUkVUQ0hfR0xZUEggbWF5IGNvbnRhaW4gbW9yZSB0aG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Bmb3VydGVlbl9lbGVtZW50cykpOworICAgICAgLy8gIExpc3BfT2JqZWN0IGZv cmVncm91bmQgPSBtY19udGggKDEwLCBmb3VydGVlbl9lbGVtZW50cyk7CisgICAgICAvLyAgTGlz cF9PYmplY3QgYmFja2dyb3VuZCA9IG1jX250aCAoMTEsIGZvdXJ0ZWVuX2VsZW1lbnRzKTsKKyAg ICAgIC8vICBib29sIGFjdGl2ZV9wID0gWEZJWE5VTSAobWNfbnRoICgxMiwgZm91cnRlZW5fZWxl bWVudHMpKTsKKyAgICAgIC8vICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBYRklYTlVN IChtY19udGggKDEzLCBmb3VydGVlbl9lbGVtZW50cykpOworICAgICAgaWYgKHZwb3MgPT0gcm93 X3Zwb3MKKyAgICAgICAgICAmJiBocG9zID09IGdseXBoLT5ocG9zKQorICAgICAgICByZXN1bHQg PSBGY29ucyAoZm91cnRlZW5fZWxlbWVudHMsIHJlc3VsdCk7CisgICAgfQorICByZXR1cm4gcmVz dWx0OworfQorCit2b2lkCittY19yZWRyYXdfaGVscGVyIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1 Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAg ICAgICAgICAgIGVudW0gdHlwZV9vZl9jYWNoZSBjYWNoZV90eXBlLCBpbnQgc3RhcnRfaHBvcywg aW50IGVuZF9ocG9zKQoreworICBMaXNwX09iamVjdCBjYWNoZSA9IFFuaWw7CisgIGNoYXIgKiBj YWNoZV9zdHJpbmc7CisgIHN3aXRjaCAoY2FjaGVfdHlwZSkKKyAgICB7CisgICAgICBjYXNlIE1D X1RFTVBfQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBjYWNoZSA9IHctPm1jX3RlbXBfY2Fj aGU7CisgICAgICAgICAgY2FjaGVfc3RyaW5nID0gU1NEQVRBIChidWlsZF9zdHJpbmcgKCJNQ19U RU1QX0NBQ0hFIikpOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIE1D X0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgY2FjaGUgPSB3LT5tY19jYWNoZTsKKyAgICAg ICAgICBjYWNoZV9zdHJpbmcgPSBTU0RBVEEgKGJ1aWxkX3N0cmluZyAoIk1DX0NBQ0hFIikpOwor ICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIENIX0NBQ0hFOgorICAgICAg ICB7CisgICAgICAgICAgY2FjaGUgPSB3LT5jaF9jYWNoZTsKKyAgICAgICAgICBjYWNoZV9zdHJp bmcgPSBTU0RBVEEgKGJ1aWxkX3N0cmluZyAoIkNIX0NBQ0hFIikpOworICAgICAgICAgIGJyZWFr OworICAgICAgICB9CisgICAgICBjYXNlIEZDX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAg Y2FjaGUgPSB3LT5mY19jYWNoZTsKKyAgICAgICAgICBjYWNoZV9zdHJpbmcgPSBTU0RBVEEgKGJ1 aWxkX3N0cmluZyAoIkZDX0NBQ0hFIikpOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9Cisg ICAgfQorICBpbnQgcm93X3Zwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAg Ly8gIGlmICh0cmFjZV9yZWRpc3BsYXlfcCkKKyAgLy8gICAgZnByaW50ZiAoc3RkZXJyLCAibWNf cmVkcmF3X2hlbHBlciAoJWQpOiAgY2FjaGUgKCVzLyVzKSB8IHN0YXJ0X2hwb3MgKCVkKSB8IGVu ZF9ocG9zICglZClcbiIsCisgIC8vICAgICAgcm93X3Zwb3MsIGNhY2hlX3N0cmluZywgIU5JTFAg KGNhY2hlKSA/ICJub24tbmlsIiA6ICJuaWwiLCBzdGFydF9ocG9zLCBlbmRfaHBvcyk7CisgIGlm IChOSUxQIChjYWNoZSkpCisgICAgcmV0dXJuOworICBMaXNwX09iamVjdCB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BtY19saXNwX3RvX2N1cnNvcl90eXBlIChtY19udGggKDgs IGZvdXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBjdXJzb3Jfd2lkdGggPSBYRklYTlVNIChtY19u dGggKDksIGZvdXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBmb3JlZ3JvdW5kID0gbWNfbnRoICgx MCwgZm91cnRlZW5fZWxlbWVudHMpOworICAgICAgYmFja2dyb3VuZCA9IG1jX250aCAoMTEsIGZv dXJ0ZWVuX2VsZW1lbnRzKTsKKyAgICAgIGFjdGl2ZV9wID0gWEZJWE5VTSAobWNfbnRoICgxMiwg Zm91cnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGdseXBoX2ZsYXZvciA9IFhGSVhOVU0gKG1jX250 aCAoMTMsIGZvdXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBib29sIHJlbW92ZV9wID0gZmFsc2U7 CisgICAgICBpZiAodnBvcyA9PSByb3dfdnBvcworICAgICAgICAgICYmICgoaHBvcyA+PSBzdGFy dF9ocG9zCisgICAgICAgICAgICAgICAmJiBocG9zIDwgZW5kX2hwb3MpCisgICAgICAgICAgICAg IC8qIEEgZmxvYXRpbmcgY3Vyc29yIGJleW9uZCB0aGUgZW5kIG9mIHRoZSBnbHlwaCByb3cuICov CisgICAgICAgICAgICAgIHx8IChocG9zICsgMSA9PSBzdGFydF9ocG9zCisgICAgICAgICAgICAg ICAgICAmJiBocG9zICsgMSA9PSBlbmRfaHBvcykpKQorICAgICAgICBtY19kcmF3X2VyYXNlX2h5 YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBm b3JlZ3JvdW5kLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBo X2ZsYXZvciwgcmVtb3Zl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K21jX2VyYXNlX2hlbHBlciAo c3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5 cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgIGVudW0gdHlwZV9vZl9jYWNoZSBjYWNoZV90 eXBlKQoreworICBMaXNwX09iamVjdCBjYWNoZSA9IFFuaWw7CisgIGNoYXIgKiBjYWNoZV9zdHJp bmc7CisgIHN3aXRjaCAoY2FjaGVfdHlwZSkKKyAgICB7CisgICAgICBjYXNlIE1DX1RFTVBfQ0FD SEU6CisgICAgICAgIHsKKyAgICAgICAgICBjYWNoZSA9IHctPm1jX3RlbXBfY2FjaGU7CisgICAg ICAgICAgY2FjaGVfc3RyaW5nID0gU1NEQVRBIChidWlsZF9zdHJpbmcgKCJNQ19URU1QX0NBQ0hF IikpOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIE1DX0NBQ0hFOgor ICAgICAgICB7CisgICAgICAgICAgY2FjaGUgPSB3LT5tY19jYWNoZTsKKyAgICAgICAgICBjYWNo ZV9zdHJpbmcgPSBTU0RBVEEgKGJ1aWxkX3N0cmluZyAoIk1DX0NBQ0hFIikpOworICAgICAgICAg IGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIENIX0NBQ0hFOgorICAgICAgICB7CisgICAg ICAgICAgY2FjaGUgPSB3LT5jaF9jYWNoZTsKKyAgICAgICAgICBjYWNoZV9zdHJpbmcgPSBTU0RB VEEgKGJ1aWxkX3N0cmluZyAoIkNIX0NBQ0hFIikpOworICAgICAgICAgIGJyZWFrOworICAgICAg ICB9CisgICAgICBjYXNlIEZDX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgY2FjaGUgPSB3 LT5mY19jYWNoZTsKKyAgICAgICAgICBjYWNoZV9zdHJpbmcgPSBTU0RBVEEgKGJ1aWxkX3N0cmlu ZyAoIkZDX0NBQ0hFIikpOworICAgICAgICAgIGJyZWFr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m93ID49IDAgJiYgcm93 IDwgbWF0cml4LT5ucm93cyk7ICovCisgICAgICBib29sIGJhcmZfY3Jhc2hfb25lID0gKG1hdHJp eCAmJiBtYXRyaXgtPnJvd3MpID8gZmFsc2UgOiB0cnVlOworICAgICAgaWYgKGJhcmZfY3Jhc2hf b25lKQorICAgICAgICBjb250aW51ZTsKKyAgICAgIGJvb2wgYmFyZl9jcmFzaF90d28gPSAodnBv cyA+PSAwICYmIHZwb3MgPCBtYXRyaXgtPm5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgICAgIGlm IChiYXJmX2NyYXNoX3R3bykKKyAgICAgICAgY29udGludWU7CisgICAgICBib29sIHJlbW92ZV9w ID0gdHJ1ZTsKKyAgICAgIGlmICh2cG9zID09IHJvd192cG9zCisgICAgICAgICAgJiYgZ2x5cGhf Zmxhdm9yID09IE1DX0dMWVBIKQorICAgICAgICBtY19lcmFzZV9jdXJzb3IgKHcsIG1hdHJpeCwg cm93LCB4LCB5LCBocG9zLCB2cG9zLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCk7Cisg ICAgICAgIGVsc2UgaWYgKHZwb3MgPT0gcm93X3Zwb3MpCisgICAgICAgICAgbWNfZHJhd19lcmFz ZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBo LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dp ZHRoLCBiYWNrZ3JvdW5kLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZ2x5cGhfZmxhdm9yLCByZW1vdmVfcCk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAg cmVzdWx0ID0gRmNvbnMgKGZvdXJ0ZWVuX2VsZW1lbnRzLCByZXN1bHQpOworICAgIH0KKyAgc3dp dGNoIChjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGNhc2UgTUNfVEVNUF9DQUNIRToKKyAgICAg ICAgeworICAgICAgICAgIGlmICghTklMUCAocmVzdWx0KSkKKyAgICAgICAgICAgIHdzZXRfbWNf dGVtcF9jYWNoZSAodywgRnJldmVyc2UgKHJlc3VsdCkpOworICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICB3c2V0X21jX3RlbXBfY2FjaGUgKHcsIFFuaWwpOworICAgICAgICAgIGJyZWFr OworICAgICAgICB9CisgICAgICBjYXNlIE1DX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAg aWYgKCFOSUxQIChyZXN1bHQpKQorICAgICAgICAgICAgd3NldF9tY19jYWNoZSAodywgRnJldmVy c2UgKHJlc3VsdCkpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB3c2V0X21jX2Nh Y2hlICh3LCBRbmlsKTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBD SF9DQUNIRToKKyAgICAgICAgeworICAgICAgICAgIGlmICghTklMUCAocmVzdWx0KSkKKyAgICAg ICAgICAgIHdzZXRfY2hfY2FjaGUgKHcsIEZyZXZlcnNlIChyZXN1bHQpKTsKKyAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgd3NldF9jaF9jYWNoZSAodywgUW5pbCk7CisgICAgICAgICAg YnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2UgRkNfQ0FDSEU6CisgICAgICAgIHsKKyAgICAg ICAgICBpZiAoIU5JTFAgKHJlc3VsdCkpCisgICAgICAgICAgICB3c2V0X2ZjX2NhY2hlICh3LCBG cmV2ZXJzZSAocmVzdWx0KSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHdzZXRf ZmNfY2FjaGUgKHcsIFFuaWwpOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQor fQorCit2b2lkCittY19lcmFzZV9yb3cgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9t YXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93KQoreworICBpbnQgdnBvcyA9IE1B VFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisg ICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2Vfcm93ICglcyk6ICB2cG9zICglZClcbiIsIG1j X3dpbmRvdyAodyksIHZwb3MpOworICBtY19lcmFzZV9oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBN Q19DQUNIRSk7CisgIG1jX2VyYXNlX2hlbHBlciAodywgbWF0cml4LCByb3csIENIX0NBQ0hFKTsK KyAgbWNfZXJhc2VfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgRkNfQ0FDSEUpOworfQorCit2b2lk CittY19zZXRfZXNzZW50aWFscyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBhY3RpdmVfcCkKK3sK KyAgaWYgKCFCVUZGRVJQICh3LT5jb250ZW50cykpCisgICAgcmV0dXJuOworICBzdHJ1Y3QgZnJh bWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y29udGVu dHM7CisgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIg KGJ1Zik7CisgIHN0cnVjdCBidWZmZXIgKm9sZF9idWZmZXIgPSBOVUxMOworICBwdHJkaWZmX3Qg b3BvaW50ID0gKHcgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KSkKKyAgICAgICAgICAgICAg ICAgICAgID8gUFQKKyAgICAgICAgICAgICAgICAgICAgIDogWEZJWE5VTSAoRm1hcmtlcl9wb3Np dGlvbiAody0+cG9pbnRtKSk7CisgIHB0cmRpZmZfdCBmY19jdXJyZW50X2NvbCA9IG1jX2N1cnJl bnRfY29sdW1uICh3LCBvcG9pbnQpOworICBpbnQgZnJhbWVfY2hhcl93aWR0aCA9IEZSQU1FX0NP TFVNTl9XSURUSCAoZik7CisgIGJvb2wgZmlsbF9jb2x1bW5fcCA9ICFOSUxQIChCVkFSIChiLCBm aWxsX2NvbHVtbikpOworICBpbnQgZmlsbF9jb2wgPSBYRklYTlVNIChCVkFSIChiLCBmaWxsX2Nv bHVtbikpOworICBpbnQgaHNjbF94ID0gdy0+aHNjcm9sbCAqIGZyYW1lX2NoYXJfd2lkdGg7Cisg IGlmIChiICE9IGN1cnJlbnRfYnVmZmVyKQorICAgIHsKKyAgICAgIG9sZF9idWZmZXIgPSBjdXJy ZW50X2J1ZmZlcjsKKyAgICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKGIpOworICAgIH0KKyAgdy0+ bWMuZmNfeCA9IChmaWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgICAgJiYgIU5JTFAgKFZkaXNw bGF5X2xpbmVfbnVtYmVycykpCisgICAgICAgICAgICAgICAgID8gKGZpbGxfY29sICogZnJhbWVf Y2hhcl93aWR0aCkgKyB3LT5tYy5sbnVtX3BpeGVsX3dpZHRoIC0gaHNjbF94CisgICAgICAgICAg ICAgICA6IChmaWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgICAgICAmJiBOSUxQIChWZGlzcGxh eV9saW5lX251bWJlcnMpKQorICAgICAgICAgICAgICAgICA/IChmaWxsX2NvbCAqIGZyYW1lX2No YXJfd2lkdGgpIC0gaHNjbF94CisgICAgICAgICAgICAgICA6IDA7CisgIGlmIChvbGRfYnVmZmVy KQorICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworICBlbnVtIGZhY2VfaWQg ZmlsbF9jb2x1bW5fZmFjZV9pZCA9CisgICAgKCFhY3RpdmVfcAorICAgICAmJiAhTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY19pbmFjdGl2ZV93aW5kb3dzKSkKKyAgICAgJiYg TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29ud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ZSkpOworICAgIH0KKyAgZm9yIChpbnQgdnBvcyA9IDA7CisgICAgICAgdnBvcyA8IGN1 cnJlbnRfbWF0cml4LT5ucm93cworICAgICAgICYmIE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4 LCB2cG9zKS0+ZW5hYmxlZF9wCisgICAgICAgJiYgKCFOSUxQICh3LT5tY19jYWNoZSkgfHwgIU5J TFAgKHctPmNoX2NhY2hlKSB8fCAhTklMUCAody0+ZmNfY2FjaGUpKTsKKyAgICAgICArK3Zwb3Mp CisgICAgeworICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93ID0gTUFUUklYX1JPVyAoY3VycmVu dF9tYXRyaXgsIHZwb3MpOworICAgICAgbWNfZXJhc2Vfcm93ICh3LCBjdXJyZW50X21hdHJpeCwg cm93KTsKKyAgICB9CisgIHdzZXRfbWNfY2FjaGUgKHcsIFFuaWwpOworICB3c2V0X2NoX2NhY2hl ICh3LCBRbmlsKTsKKyAgd3NldF9mY19jYWNoZSAodywgUW5pbCk7CisgIGlmICh1cGRhdGluZ19m cmFtZV9wKQorICAgIHVwZGF0ZV9lbmQgKFhGUkFNRSAody0+ZnJhbWUpKTsKK30KKworREVGVU4g KCJtYy1zdGRlcnIiLCBGbWNfc3RkZXJyLCBTbWNfc3RkZXJyLCAwLCAxLCAiUCIsCisgICAgICAg ZG9jOiAvKiBUb2dnbGUgdHJhY2luZyBvZiBtdWx0aXBsZSBmYWtlIGN1cnNvcnMuCitXaXRoIEFS RywgdHVybiB0cmFjaW5nIG9uIGlmIGFuZCBvbmx5IGlmIEFSRyBpcyBwb3NpdGl2ZS4gKi8pCisg IChMaXNwX09iamVjdCBhcmcpCit7CisgIGlmIChOSUxQIChhcmcpKQorICAgIG1jX3N0ZGVycl9w ID0gIW1jX3N0ZGVycl9wOworICBlbHNlCisgICAgeworICAgICAgYXJnID0gRnByZWZpeF9udW1l cmljX3ZhbHVlIChhcmcpOworICAgICAgbWNfc3RkZXJyX3AgPSBYRklYTlVNIChhcmcpID4gMDsK KyAgICB9CisgIHJldHVybiBRbmlsOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogDAogLyoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAJCSAgICAg IFdpbmRvdyBkaXNwbGF5IGRpbWVuc2lvbnMKQEAgLTEzMzk1LDYgKzE3NDcwLDY5IEBAIGhzY3Jv bGxfd2luZG93X3RyZWUgKExpc3BfT2JqZWN0IHdpbmRvdykKIAkgICAgICBlbHNlCiAJCXB0ID0g Y2xpcF90b19ib3VuZHMgKEJFR1YsIG1hcmtlcl9wb3NpdGlvbiAody0+cG9pbnRtKSwgWlYpOwog CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAq LworCisvKiAoZ2RiKSBidAorIzAgIHRlcm1pbmF0ZV9kdWVfdG9fc2lnbmFsIChzaWc9NiwgYmFj a3RyYWNlX2xpbWl0PTIxNDc0ODM2NDcpIGF0IGVtYWNzLmM6MzU5CisjMSAgMHgwMDAwMDAwMTAw MWVlOTk2IGluIGRpZSAoCisgICAgbXNnPTB4MTAwMzJmYzg4ICJjaGFycG9zIDwgMCB8fCAoY2hh cnBvcyA+PSBCVUZfQkVHIChjdXJyZW50X2J1ZmZlcikgJiYgY2hhcnBvcyA8PSBaVikiLCBmaWxl PTB4MTAwMzJlMzJkICJ4ZGlzcC5jIiwgbGluZT03OTUxKSBhdCBhbGxvYy5jOjcyMTQKKyMyICAw eDAwMDAwMDAxMDAwNGQyYWIgaW4gaW5pdF9pdGVyYXRvciAoaXQ9MHg3ZmZmN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SAmY3Vy c29yX3Jvdy0+c3RhcnQ7CisgIHB0cmRpZmZfdCBjaGFycG9zID0gQ0hBUlBPUyAocG9zLT5wb3Mp OworCisgIGJvb2wgYmFyZl9jcmFzaF9vbmUgPSAoY2hhcnBvcyA8IDAKKyAgICAgICAgICAgICAg ICAgICAgICAgICB8fCAoY2hhcnBvcyA+PSBCVUZfQkVHIChjdXJyZW50X2J1ZmZlcikKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgY2hhcnBvcyA8PSBaVikpCisgICAgICAgICAgICAg ICAgICAgICAgICA/IGZhbHNlCisgICAgICAgICAgICAgICAgICAgICAgICA6IHRydWU7CisgIGlm IChiYXJmX2NyYXNoX29uZSkKKyAgICByZXR1cm4gaHNjcm9sbGVkX3A7CisKKyAgLyogYHJlc2Vh dF8xJzogIENIQVJQT1MgKHBvcykgPj0gQkVHViAmJiBDSEFSUE9TIChwb3MpIDw9IFpWICovCisg IGJvb2wgYmFyZl9jcmFzaF90d28gPSAoY2hhcnBvcyA+PSBCRUdWICYmIGNoYXJwb3MgPD0gWlYp CisgICAgICAgICAgICAgICAgICAgICAgICAgPyBmYWxzZQorICAgICAgICAgICAgICAgICAgICAg ICAgIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2hfdHdvKQorICAgIHJldHVybiBoc2Nyb2xsZWRf cDsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKIAkgICAgICAvKiBNb3ZlIGl0ZXJhdG9yIHRvIHB0IHN0YXJ0aW5nIGF0IGN1cnNvcl9y b3ctPnN0YXJ0IGluCiAJCSBhIGxpbmUgd2l0aCBpbmZpbml0ZSB3aWR0aC4gICovCiAJICAgICAg aW5pdF90b19yb3dfc3RhcnQgKCZpdCwgdywgY3Vyc29yX3Jvdyk7CkBAIC0xNDI4Nyw5ICsxODQy NSwyMiBAQCByZWRpc3BsYXlfaW50ZXJuYWwgKHZvaWQpCiAJICAgICAgKnctPmRlc2lyZWRfbWF0 cml4LT5tZXRob2QgPSAwOwogCSAgICAgIGRlYnVnX21ldGhvZF9hZGQgKHcsICJvcHRpbWl6YXRp b24gMSIpOwogI2VuZGlmCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KKyAgaWYgKEJVRkZFUlAg KHctPmNvbnRlbnRzKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgY3Jvc3NoYWlycykpKQorICAgIG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgZmFsc2Up OworICAgIGVsc2UKIAkgICAgICB1cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIGZhbHNlKTsKICNl bmRpZgorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgZ290byB1cGRhdGU7 CiAJICAgIH0KIAkgIGVsc2UKQEAgLTE3Njg3LDEwICsyMTgzOCwyMSBAQCByZWRpc3BsYXlfd2lu ZG93IChMaXNwX09iamVjdCB3aW5kb3csIGJvb2wganVzdF90aGlzX29uZV9wKQogICAgIH0KIAog I2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGJvb2wga2VlcF9jdXJyZW50X3AgPSAoanVzdF90 aGlzX29uZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKCF1c2VkX2N1cnJlbnRfbWF0 cml4X3AgJiYgIW92ZXJsYXlfYXJyb3dfc2VlbikKKyAgICAgICAgICAgICAgICAgICAgICAgICB8 fCB3LT5wc2V1ZG9fd2luZG93X3ApOworCisgIGJvb2wgZnJpbmdlc191cGRhdGVkX3AgPSAoIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIGtlZXBfY3Vy cmVudF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgOiB1cGRhdGVfd2luZG93X2ZyaW5n ZXMgKHcsIGtlZXBfY3VycmVudF9wKTsKKwogICBpZiAoRlJBTUVfV0lORE9XX1AgKGYpCi0gICAg ICAmJiB1cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIChqdXN0X3RoaXNfb25lX3AKLQkJCQkgICAg fHwgKCF1c2VkX2N1cnJlbnRfbWF0cml4X3AgJiYgIW92ZXJsYXlfYXJyb3dfc2VlbikKLQkJCQkg ICAgfHwgdy0+cHNldWRvX3dpbmRvd19wKSkpCisgICAgICAmJiBmcmluZ2VzX3VwZGF0ZWRfcCkK ICAgICB7CiAgICAgICB1cGRhdGVfYmVnaW4gKGYpOwogICAgICAgYmxvY2tfaW5wdXQgKCk7CkBA IC0xNzcwNSw2ICsyMTg2Nyw5IEBAIHJlZGlzcGxheV93aW5kb3cgKExpc3BfT2JqZWN0IHdpbmRv dywgYm9vbCBqdXN0X3RoaXNfb25lX3ApCiAgICAgICB1cGRhdGVfZW5kIChmKTsKICAgICB9CiAK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgaWYgKFdJTkRPV19CT1RUT01fRElWSURF Ul9XSURUSCAodykpCiAgICAgeF9kcmF3X2JvdHRvbV9kaXZpZGVyICh3KTsKICNlbmRpZiAvKiBI QVZFX1dJTkRPV19TWVNURU0gKi8KQEAgLTE4MDEwLDYgKzIyMTc1LDE5IEBAIHRyeV93aW5kb3df cmV1c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRvdyAqdykKIAkgICAgIHNjcm9sbF9y dW5faG9vayB3aWxsIGNsZWFyIHRoZSBjdXJzb3IsIGFuZCB1c2UgdGhlCiAJICAgICBjdXJyZW50 IG1hdHJpeCB0byBnZXQgdGhlIGhlaWdodCBvZiB0aGUgcm93IHRoZSBjdXJzb3IgaXMKIAkgICAg IGluLiAgKi8KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNP UlMgKi8KKworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAi dHJ5X3dpbmRvd19yZXVzaW5nX2N1cnJlbnRfbWF0cml4IFsxIG9mIDJdICglcylcbiIsIG1jX3dp bmRvdyAodykpOworCisgIG1jX2VyYXNlX3ByZV9zY3JvbGxfZGlzcGxheSAodyk7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKIAkgIHJ1bi5jdXJyZW50X3kgPSBzdGFydF9yb3ctPnk7 CiAJICBydW4uZGVzaXJlZF95ID0gaXQuY3VycmVudF95OwogCSAgcnVuLmhlaWdodCA9IGl0Lmxh c3RfdmlzaWJsZV95IC0gaXQuY3VycmVudF95OwpAQCAtMTgxNzMsNiArMjIzNTEsMTkgQEAgdHJ5 X3dpbmRvd19yZXVzaW5nX2N1cnJlbnRfbWF0cml4IChzdHJ1Y3Qgd2luZG93ICp3KQogCX0KIAog ICAgICAgLyogU2Nyb2xsIHRoZSBkaXNwbGF5LiAgKi8KKworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpZiAodHJhY2VfcmVkaXNwbGF5X3Ap CisgICAgZnByaW50ZiAoc3RkZXJyLCAidHJ5X3dpbmRvd19yZXVzaW5nX2N1cnJlbnRfbWF0cml4 IFsyIG9mIDJdICglcylcbiIsIG1jX3dpbmRvdyAodykpOworCisgIG1jX2VyYXNlX3ByZV9zY3Jv bGxfZGlzcGxheSAodyk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIHJ1 bi5jdXJyZW50X3kgPSBmaXJzdF9yZXVzYWJsZV9yb3ctPnk7CiAgICAgICBydW4uZGVzaXJlZF95 ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CiAgICAgICBydW4uaGVpZ2h0ID0gaXQu bGFzdF92aXNpYmxlX3kgLSBydW4uY3VycmVudF95OwpAQCAtMTkxMjcsNiArMjMzMTgsMTkgQEAg dHJ5X3dpbmRvd19pZCAoc3RydWN0IHdpbmRvdyAqdykKICAgLyogU2Nyb2xsIHRoZSBkaXNwbGF5 LiAgRG8gaXQgYmVmb3JlIGNoYW5naW5nIHRoZSBjdXJyZW50IG1hdHJpeCBzbwogICAgICB0aGF0 IHh0ZXJtLmMgZG9lc24ndCBnZXQgY29uZnVzZWQgYWJvdXQgd2hlcmUgdGhlIGN1cnNvciBnbHlw aCBpcwogICAgICBmb3VuZC4gICovCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAgIGZwcmlu dGYgKHN0ZGVyciwgInRyeV93aW5kb3dfaWQgKCVzKVxuIiwgbWNfd2luZG93ICh3KSk7CisKKyAg bWNfZXJhc2VfcHJlX3Njcm9sbF9kaXNwbGF5ICh3KTsKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICBpZiAoZHkgJiYgcnVuLmhlaWdodCkKICAgICB7CiAgICAgICB1cGRhdGVfYmVn aW4gKGYpOwpAQCAtMjAxMzMsNiArMjQzMzcsMTcgQEAgYXBwZW5kX3NwYWNlX2Zvcl9uZXdsaW5l IChzdHJ1Y3QgaXQgKml0LCBib29sIGRlZmF1bHRfZmFjZV9wKQogCSAgbWVtc2V0ICgmaXQtPnBv c2l0aW9uLCAwLCBzaXplb2YgaXQtPnBvc2l0aW9uKTsKIAkgIGl0LT5vYmplY3QgPSBRbmlsOwog CSAgaXQtPmMgPSBpdC0+Y2hhcl90b19kaXNwbGF5ID0gJyAnOworCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBpZiAoSVRfQllURVBP UyAoKml0KSA+PSBaVl9CWVRFKQorICAgICAgICBpdC0+enZfcCA9IHRydWU7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKIAkgIGl0LT5sZW4gPSAxOwogCiAJICAvKiBJZiB0aGUgZGVm YXVsdCBmYWNlIHdhcyByZW1hcHBlZCwgYmUgc3VyZSB0byB1c2UgdGhlCkBAIC0yMTI2OSw5ICsy NTQ4NCwyMiBAQCBtYXliZV9wcm9kdWNlX2xpbmVfbnVtYmVyIChzdHJ1Y3QgaXQgKml0KQogICAg ICAgZWxzZQogCXRlbV9pdC5jID0gdGVtX2l0LmNoYXJfdG9fZGlzcGxheSA9ICpwOwogICAgICAg dGVtX2l0LmxlbiA9IDE7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKyAgICAgIGlmIChiZXlvbmRfenYpCisgICAgICAgIHRlbV9pdC56dl9w ID0gdHJ1ZTsKKyAgICAgIHRlbV9pdC5jdXJyZW50X3kgPSBpdC0+Y3VycmVudF95OworICAgICAg dGVtX2l0LnZwb3MgPSBpdC0+dnBvczsKICAgICAgIC8qIE1ha2Ugc3VyZSB0aGVzZSBnbHlwaHMg d2lsbCBoYXZlIGEgInBvc2l0aW9uIiBvZiAtMS4gICovCiAgICAgICBTRVRfVEVYVF9QT1MgKHRl bV9pdC5wb3NpdGlvbiwgLTEsIC0xKTsKICAgICAgIFBST0RVQ0VfR0xZUEhTICgmdGVtX2l0KTsK KyAgICAgIHRlbV9pdC5ocG9zICs9IDE7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiAK ICAgICAgIC8qIFN0b3AgcHJvZHVjaW5nIGdseXBocywgYW5kIHJlZnJhaW4gZnJvbSBwcm9kdWNp bmcgdGhlIGxpbmUKIAkgbnVtYmVyLCBpZiB3ZSBkb24ndCBoYXZlIGVub3VnaCBzcGFjZSBvbiB0 aGlzIGxpbmUuICAqLwpAQCAtMjEyODQsNiArMjU1MTIsMzAgQEAgbWF5YmVfcHJvZHVjZV9saW5l X251bWJlciAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgfQogCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIExpc3BfT2JqZWN0IGJ1ZiA9IGl0 LT53LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYpOworICBzdHJ1Y3QgYnVmZmVyICpi ID0gWEJVRkZFUiAoYnVmKTsKKyAgc3RydWN0IGJ1ZmZlciAqb2xkX2J1ZmZlciA9IE5VTEw7Cisg IC8qIE5lZWRlZCBzbyB0aGF0IGJ1ZmZlci1sb2NhbCB2YWx1ZXMgY2FuIGJlIGRldGVybWluZWQ7 IGUuZy4sIHdoZW4gc3dpdGNoaW5nCisgIHRvIHRoZSBtaW5pYnVmZmVyLiAqLworICBpZiAoYiAh PSBjdXJyZW50X2J1ZmZlcikKKyAgICB7CisgICAgICBvbGRfYnVmZmVyID0gY3VycmVudF9idWZm ZXI7CisgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChiKTsKKyAgICB9CisgIGl0LT53LT5tYy5s bnVtX3BpeGVsX3dpZHRoID0gKCFOSUxQIChWZGlzcGxheV9saW5lX251bWJlcnMpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gdGVtX2l0LmN1cnJlbnRfeAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogMDsKKyAgaWYgKG9sZF9idWZmZXIpCisgICAgc2V0X2J1ZmZl cl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK ICAgLyogUmVjb3JkIHRoZSB3aWR0aCBpbiBwaXhlbHMgd2UgbmVlZCBmb3IgdGhlIGxpbmUgbnVt YmVyIGRpc3BsYXkuICAqLwogICBpdC0+bG51bV9waXhlbF93aWR0aCA9IHRlbV9pdC5jdXJyZW50 X3g7CiAgIC8qIENvcHkgdGhlIHByb2R1Y2VkIGdseXBocyBpbnRvIElUJ3MgZ2x5cGhfcm93LiAg Ki8KQEAgLTI3MDkyLDYgKzMxMzQ0LDIwIEBAIGFwcGVuZF9nbHlwaCAoc3RydWN0IGl0ICppdCkK IAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYV07 CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAq LworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7CisgICAgICBnbHlwaC0+eSA9IGl0 LT5jdXJyZW50X3k7CisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgt PnZwb3MgPSBpdC0+dnBvczsKKyAgICAgIGdseXBoLT56dl9wID0gaXQtPnp2X3A7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAo aXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAg aWYgKGl0LT5waXhlbF93aWR0aCA+IDApCkBAIC0yNzE3NSw2ICszMTQ0MSwyMCBAQCBhcHBlbmRf Y29tcG9zaXRlX2dseXBoIChzdHJ1Y3QgaXQgKml0KQogCSAgICBnWzFdID0gKmc7CiAJICBnbHlw aCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1tpdC0+YXJlYV07CiAJfQorCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9 IGl0LT5jdXJyZW50X3g7CisgICAgICBnbHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICBn bHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKyAg ICAgIGdseXBoLT56dl9wID0gaXQtPnp2X3A7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICAgICAgIGdseXBoLT5jaGFycG9zID0gaXQtPmNtcF9pdC5jaGFycG9zOwogICAgICAgZ2x5 cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBlYXNzZXJ0IChpdC0+cGl4ZWxfd2lkdGgg PD0gU0hSVF9NQVgpOwpAQCAtMjczODMsNiArMzE2NjMsMjAgQEAgcHJvZHVjZV9pbWFnZV9nbHlw aCAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgICBpZiAoZ2x5cGggPCBpdC0+Z2x5cGhfcm93LT5n bHlwaHNbYXJlYSArIDFdKQogCXsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPnggPSBpdC0+Y3VycmVudF94OworICAg ICAgZ2x5cGgtPnkgPSBpdC0+Y3VycmVudF95OworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBv czsKKyAgICAgIGdseXBoLT52cG9zID0gaXQtPnZwb3M7CisgICAgICBnbHlwaC0+enZfcCA9IGl0 LT56dl9wOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICBnbHlwaC0+Y2hhcnBv cyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAJICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVj dDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9IGNsaXBfdG9fYm91bmRzICgtMSwgaXQtPnBpeGVs X3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzQ4Niw2ICszMTc4MCwyMCBAQCBwcm9kdWNlX3h3aWRn ZXRfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJfQogICAgICAgaWYgKGdseXBoIDwgaXQtPmdseXBo X3Jvdy0+Z2x5cGhzW2FyZWEgKyAxXSkKIAl7CisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT54ID0gaXQtPmN1cnJlbnRf eDsKKyAgICAgIGdseXBoLT55ID0gaXQtPmN1cnJlbnRfeTsKKyAgICAgIGdseXBoLT5ocG9zID0g aXQtPmhwb3M7CisgICAgICBnbHlwaC0+dnBvcyA9IGl0LT52cG9zOworICAgICAgZ2x5cGgtPnp2 X3AgPSBpdC0+enZfcDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgZ2x5cGgt PmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwogCSAgZ2x5cGgtPm9iamVjdCA9IGl0 LT5vYmplY3Q7CiAJICBnbHlwaC0+cGl4ZWxfd2lkdGggPSBjbGlwX3RvX2JvdW5kcyAoLTEsIGl0 LT5waXhlbF93aWR0aCwgU0hSVF9NQVgpOwpAQCAtMjc1NzIsNiArMzE4ODAsMjAgQEAgYXBwZW5k X3N0cmV0Y2hfZ2x5cGggKHN0cnVjdCBpdCAqaXQsIExpc3BfT2JqZWN0IG9iamVjdCwKIAkgICAg d2lkdGggLT0gaXQtPmZpcnN0X3Zpc2libGVfeCAtIGl0LT5jdXJyZW50X3g7CiAJICBlYXNzZXJ0 ICh3aWR0aCA+IDApOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJ UExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPnggPSBpdC0+Y3VycmVudF94OworICAgICAg Z2x5cGgtPnkgPSBpdC0+Y3VycmVudF95OworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsK KyAgICAgIGdseXBoLT52cG9zID0gaXQtPnZwb3M7CisgICAgICBnbHlwaC0+enZfcCA9IGl0LT56 dl9wOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICBnbHlwaC0+Y2hhcnBv cyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAgICAgICBnbHlwaC0+b2JqZWN0ID0gb2JqZWN0 OwogICAgICAgLyogRklYTUU6IEl0IHdvdWxkIGJlIGJldHRlciB0byB1c2UgVFlQRV9NQVggaGVy ZSwgYnV0CkBAIC0yODAyNiw2ICszMjM0OCwyMCBAQCBhcHBlbmRfZ2x5cGhsZXNzX2dseXBoIChz dHJ1Y3QgaXQgKml0LCBpbnQgZmFjZV9pZCwgYm9vbCBmb3Jfbm9fZm9udCwgaW50IGxlbiwKIAkg ICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYV07CiAJ fQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7CisgICAgICBnbHlwaC0+eSA9IGl0LT5j dXJyZW50X3k7CisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPnZw b3MgPSBpdC0+dnBvczsKKyAgICAgIGdseXBoLT56dl9wID0gaXQtPnp2X3A7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQt PnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgZWFz c2VydCAoaXQtPnBpeGVsX3dpZHRoIDw9IFNIUlRfTUFYKTsKQEAgLTI5MDc2LDEwICszMzQxMiwz MyBAQCB4X2luc2VydF9nbHlwaHMgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cg KnVwZGF0ZWRfcm93LAogCiAgIC8qIFdyaXRlIHRoZSBnbHlwaHMuICAqLwogICBocG9zID0gc3Rh cnQgLSByb3ctPmdseXBoc1t1cGRhdGVkX2FyZWFdOworCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmICgoIU5JTFAgKHctPm1jX2NhY2hl KSB8fCAhTklMUCAody0+Y2hfY2FjaGUpIHx8ICFOSUxQICh3LT5mY19jYWNoZSkpCisgICAgICAm JiB1cGRhdGVkX2FyZWEgPT0gVEVYVF9BUkVBKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9t YXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgaW50IHZwb3MgPSBNQVRS SVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgIGludCBzdGFydF94ID0gdy0+b3V0cHV0 X2N1cnNvci54OworICAgICAgaW50IHN0YXJ0X2hwb3MgPSBocG9zOworICAgICAgaW50IGVuZF9o cG9zID0gaHBvcyArIGxlbjsKKyAgICAgIGJvb2wgY2xlYXJfZW9sX3AgPSBmYWxzZTsKKyAgICAg IGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCA9IERSQVdfTk9STUFMX1RFWFQ7CisgICAgICBUUkFD RSAoKHN0ZGVyciwgInhfaW5zZXJ0X2dseXBocyAoJWQpOiAgc3RhcnRfeCAoJWQpIHwgc3RhcnRf aHBvcyAoJWQpIHwgZW5kX2hwb3MgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICB2cG9z LCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcykpOworICAgICAgbWNfcmVkcmF3X3JvdyAo dywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBjbGVhcl9lb2xf cCwgaGwpOworICAgIH0KKyAgICBlbHNlCiAgIGRyYXdfZ2x5cGhzICh3LCB3LT5vdXRwdXRfY3Vy c29yLngsIHJvdywgdXBkYXRlZF9hcmVhLAogCSAgICAgICBocG9zLCBocG9zICsgbGVuLAogCSAg ICAgICBEUkFXX05PUk1BTF9URVhULCAwKTsKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogICAvKiBBZHZhbmNlIHRoZSBvdXRwdXQgY3Vyc29yLiAgKi8KICAgdy0+b3V0cHV0X2N1cnNv ci5ocG9zICs9IGxlbjsKICAgdy0+b3V0cHV0X2N1cnNvci54ICs9IHNoaWZ0X2J5X3dpZHRoOwpA QCAtMjkxNzcsNiArMzM1MzYsMTYgQEAgZ2V0X3NwZWNpZmllZF9jdXJzb3JfdHlwZSAoTGlzcF9P YmplY3QgYXJnLCBpbnQgKndpZHRoKQogewogICBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIHR5cGU7 CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgaWYgKEVRIChhcmcsIFFmcmFtZWQpKQorICAgIHJldHVybiBGUkFNRURfQk9YX0NVUlNPUjsK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBpZiAoTklMUCAoYXJnKSkKICAgICBy ZXR1cm4gTk9fQ1VSU09SOwogCkBAIC0yOTMyNiw5ICszMzY5NSwxOSBAQCBnZXRfd2luZG93X2N1 cnNvcl90eXBlIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGggKmdseXBoLCBpbnQgKndp ZHRoLAogICAgICAgYWx0X2N1cnNvciA9IEJWQVIgKGIsIGN1cnNvcl9pbl9ub25fc2VsZWN0ZWRf d2luZG93cyk7CiAgICAgICBpZiAoIUVRIChRdCwgYWx0X2N1cnNvcikpCiAJcmV0dXJuIGdldF9z cGVjaWZpZWRfY3Vyc29yX3R5cGUgKGFsdF9jdXJzb3IsIHdpZHRoKTsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAgICAgLyogdCBtZWFu cyBtb2RpZnkgdGhlIG5vcm1hbCBjdXJzb3IgdHlwZS4gICovCi0gICAgICBpZiAoY3Vyc29yX3R5 cGUgPT0gRklMTEVEX0JPWF9DVVJTT1IpCi0JY3Vyc29yX3R5cGUgPSBIT0xMT1dfQk9YX0NVUlNP UjsKKyAgICAgIGlmIChjdXJzb3JfdHlwZSA9PSBGSUxMRURfQk9YX0NVUlNPUgorICAgICAgICAg IHx8IGN1cnNvcl90eXBlID09IEZSQU1FRF9CT1hfQ1VSU09SKQorICAgICAgICBjdXJzb3JfdHlw ZSA9IEhPTExPV19CT1hfQ1VSU09SOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAg ICAgICBlbHNlIGlmIChjdXJzb3JfdHlwZSA9PSBCQVJfQ1VSU09SICYmICp3aWR0aCA+IDEpCiAJ LS0qd2lkdGg7CiAgICAgICByZXR1cm4gY3Vyc29yX3R5cGU7CkBAIC0yOTM0MSw3ICszMzcyMCwx NyBAQCBnZXRfd2luZG93X2N1cnNvcl90eXBlIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5 cGggKmdseXBoLCBpbnQgKndpZHRoLAogICAgICAgICByZXR1cm4gTk9fQ1VSU09SOwogICAgICAg aWYgKGdseXBoICE9IE5VTEwgJiYgZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCiAJewotCSAg aWYgKGN1cnNvcl90eXBlID09IEZJTExFRF9CT1hfQ1VSU09SKQorCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisJICBpZiAoY3Vyc29yX3R5cGUg PT0gRklMTEVEX0JPWF9DVVJTT1IKKyAgICAgICAgICB8fCBjdXJzb3JfdHlwZSA9PSBGUkFNRURf Qk9YX0NVUlNPUikKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICB7CiAJICAg ICAgLyogVXNpbmcgYSBibG9jayBjdXJzb3Igb24gbGFyZ2UgaW1hZ2VzIGNhbiBiZSB2ZXJ5IGFu bm95aW5nLgogCQkgU28gdXNlIGEgaG9sbG93IGN1cnNvciBmb3IgImxhcmdlIiBpbWFnZXMuCkBA IC0yOTM5Myw5ICszMzc4MiwxNyBAQCBnZXRfd2luZG93X2N1cnNvcl90eXBlIChzdHJ1Y3Qgd2lu ZG93ICp3LCBzdHJ1Y3QgZ2x5cGggKmdseXBoLCBpbnQgKndpZHRoLAogICAgICAgIG5hcnJvdyBb aF1iYXIgICA8LT4gICBubyBjdXJzb3IKICAgICAgICBvdGhlciB0eXBlICAgICAgPC0+ICAgbm8g Y3Vyc29yICAqLwogCi0gIGlmIChjdXJzb3JfdHlwZSA9PSBGSUxMRURfQk9YX0NVUlNPUikKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYg KGN1cnNvcl90eXBlID09IEZJTExFRF9CT1hfQ1VSU09SCisgICAgICB8fCBjdXJzb3JfdHlwZSA9 PSBGUkFNRURfQk9YX0NVUlNPUikKICAgICByZXR1cm4gSE9MTE9XX0JPWF9DVVJTT1I7CiAKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgaWYgKChjdXJzb3JfdHlwZSA9PSBCQVJfQ1VS U09SIHx8IGN1cnNvcl90eXBlID09IEhCQVJfQ1VSU09SKSAmJiAqd2lkdGggPiAxKQogICAgIHsK ICAgICAgICp3aWR0aCA9IDE7CkBAIC0yOTUwNSw5ICszMzkwMiwzMSBAQCB4X2ZpeF9vdmVybGFw cGluZ19hcmVhIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCiAJICB3 aGlsZSAoaSA8IHJvdy0+dXNlZFthcmVhXQogCQkgJiYgcm93LT5nbHlwaHNbYXJlYV1baV0ub3Zl cmxhcHNfdmVydGljYWxseV9wKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgICBpZiAoKCFOSUxQICh3LT5tY19jYWNoZSkgfHwg IU5JTFAgKHctPmNoX2NhY2hlKSB8fCAhTklMUCAody0+ZmNfY2FjaGUpKQorICAgICAgICAgICAg JiYgYXJlYSA9PSBURVhUX0FSRUEpCisgICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0IGds eXBoX21hdHJpeCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAgICAgICBpbnQg dnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAgICAgaW50IHN0 YXJ0X2hwb3MgPSBzdGFydDsKKyAgICAgICAgICAgIGludCBlbmRfaHBvcyA9IGk7CisgICAgICAg ICAgICBib29sIGNsZWFyX2VvbF9wID0gZmFsc2U7CisgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5 cGhzX2ZhY2UgaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgICAgICAgVFJBQ0UgKChzdGRl cnIsICJ4X2ZpeF9vdmVybGFwcGluZ19hcmVhICglZCk6ICBzdGFydF94ICglZCkgfCBzdGFydF9o cG9zICglZCkgfCBlbmRfaHBvcyAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg IHZwb3MsIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zKSk7CisgICAgICAgICAgICBtY19y ZWRyYXdfcm93ICh3LCBtYXRyaXgsIHJvdywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3Ms IGNsZWFyX2VvbF9wLCBobCk7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKIAkgIGRyYXdf Z2x5cGhzICh3LCBzdGFydF94LCByb3csIGFyZWEsCiAJCSAgICAgICBzdGFydCwgaSwKIAkJICAg ICAgIERSQVdfTk9STUFMX1RFWFQsIG92ZXJsYXBzKTsKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogCX0KICAgICAgIGVsc2UKIAl7CkBAIC0yOTY1Miw4ICszNDA3MSwxNyBAQCBlcmFz ZV9waHlzX2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdykKICAgICAgICYmIGN1cnNvcl9yb3ctPnVz ZWRbVEVYVF9BUkVBXSA+IGhwb3MgJiYgaHBvcyA+PSAwKQogICAgIG1vdXNlX2ZhY2VfaGVyZV9w ID0gdHJ1ZTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNP UlMgKi8KKwogICAvKiBNYXliZSBjbGVhciB0aGUgZGlzcGxheSB1bmRlciB0aGUgY3Vyc29yLiAg Ki8KLSAgaWYgKHctPnBoeXNfY3Vyc29yX3R5cGUgPT0gSE9MTE9XX0JPWF9DVVJTT1IpCisgIGlm ICh3LT5waHlzX2N1cnNvcl90eXBlID09IEhPTExPV19CT1hfQ1VSU09SCisgICAgICB8fCB3LT5w aHlzX2N1cnNvcl90eXBlID09IEZSQU1FRF9CT1hfQ1VSU09SKQorCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAgICAgewogICAgICAgaW50IHgsIHk7CiAgICAgICBpbnQgaGVhZGVyX2xp bmVfaGVpZ2h0ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CkBAIC0yOTc1OCwxMCAr MzQxODYsMTcgQEAgZGlzcGxheV9hbmRfc2V0X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgYm9v bCBvbiwKICAgbmV3X2N1cnNvcl90eXBlID0gZ2V0X3dpbmRvd19jdXJzb3JfdHlwZSAodywgZ2x5 cGgsCiAJCQkJCSAgICAmbmV3X2N1cnNvcl93aWR0aCwgJmFjdGl2ZV9jdXJzb3IpOwogCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAgIC8qIElm IGN1cnNvciBpcyBjdXJyZW50bHkgYmVpbmcgc2hvd24gYW5kIHdlIGRvbid0IHdhbnQgaXQgdG8g YmUgb3IKICAgICAgaXQgaXMgaW4gdGhlIHdyb25nIHBsYWNlLCBvciB0aGUgY3Vyc29yIHR5cGUg aXMgbm90IHdoYXQgd2Ugd2FudCwKICAgICAgZXJhc2UgaXQuICAqLwogICBpZiAody0+cGh5c19j dXJzb3Jfb25fcAorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj cm9zc2hhaXJzKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg ZmNfdmlzaWJsZSkpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IG1jX2NvbmYpKQogICAgICAgJiYgKCFvbgogCSAgfHwgdy0+cGh5c19jdXJzb3IueCAhPSB4CiAJ ICB8fCB3LT5waHlzX2N1cnNvci55ICE9IHkKQEAgLTI5Nzc0LDYgKzM0MjA5LDkgQEAgZGlzcGxh eV9hbmRfc2V0X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBvbiwKIAkgICAgICAmJiBu ZXdfY3Vyc29yX3dpZHRoICE9IHctPnBoeXNfY3Vyc29yX3dpZHRoKSkpCiAgICAgZXJhc2VfcGh5 c19jdXJzb3IgKHcpOwogCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIERvbid0 IGNoZWNrIHBoeXNfY3Vyc29yX29uX3AgaGVyZSBiZWNhdXNlIHRoYXQgZmxhZyBpcyBvbmx5IHNl dAogICAgICB0byBmYWxzZSBpbiBzb21lIGNhc2VzIHdoZXJlIHdlIGtub3cgdGhhdCB0aGUgY3Vy c29yIGhhcyBiZWVuCiAgICAgIGNvbXBsZXRlbHkgZXJhc2VkLCB0byBhdm9pZCB0aGUgZXh0cmEg d29yayBvZiBlcmFzaW5nIHRoZSBjdXJzb3IKQEAgLTI5NzkyLDkgKzM0MjMwLDE5IEBAIGRpc3Bs YXlfYW5kX3NldF9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb24sCiAgICAgICB3LT5w aHlzX2N1cnNvci52cG9zID0gdnBvczsKICAgICB9CiAKLSAgRlJBTUVfUklGIChmKS0+ZHJhd193 aW5kb3dfY3Vyc29yICh3LCBnbHlwaF9yb3csIHgsIHksCi0gICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgbmV3X2N1cnNvcl90eXBlLCBuZXdfY3Vyc29yX3dpZHRoLAotICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uLCBhY3RpdmVfY3Vyc29yKTsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKE5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAmJiBO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgJiYg TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkpCisgICAgRlJBTUVf UklGIChmKS0+ZHJhd193aW5kb3dfY3Vyc29yICh3LCBnbHlwaF9yb3csIHgsIHksIG5ld19jdXJz b3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19jdXJz b3Jfd2lkdGgsIG9uLCBhY3RpdmVfY3Vyc29yKTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogfQogCiAKQEAgLTI5ODg3LDcgKzM0MzM1LDI3IEBAIGRyYXdfcm93X3dpdGhfbW91c2Vf ZmFjZSAoc3RydWN0IHdpbmRvdyAqdywgaW50IHN0YXJ0X3gsIHN0cnVjdCBnbHlwaF9yb3cgKnJv dywKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KICAgaWYgKEZSQU1FX1dJTkRPV19QIChYRlJB TUUgKHctPmZyYW1lKSkpCiAgICAgeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBpZiAoIU5JTFAgKHctPm1jX2NhY2hlKSB8fCAh TklMUCAody0+Y2hfY2FjaGUpIHx8ICFOSUxQICh3LT5mY19jYWNoZSkpCisgICAgICAgIHsKKyAg ICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsK KyAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAg ICAgICAgIGJvb2wgY2xlYXJfZW9sX3AgPSBmYWxzZTsKKyAgICAgICAgICBlbnVtIGRyYXdfZ2x5 cGhzX2ZhY2UgaGwgPSBkcmF3OworICAgICAgICAgIFRSQUNFICgoc3RkZXJyLCAiZHJhd19yb3df d2l0aF9tb3VzZV9mYWNlICglZCk6ICBzdGFydF94ICglZCkgfCBzdGFydF9ocG9zICglZCkgfCBl bmRfaHBvcyAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCBzdGFydF94 LCBzdGFydF9ocG9zLCBlbmRfaHBvcykpOworICAgICAgICAgIG1jX3JlZHJhd19yb3cgKHcsIG1h dHJpeCwgcm93LCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcywgY2xlYXJfZW9sX3AsIGhs KTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCiAgICAgICBkcmF3X2dseXBocyAodywgc3RhcnRf eCwgcm93LCBURVhUX0FSRUEsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBkcmF3LCAwKTsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgcmV0dXJuOwogICAgIH0KICNlbmRpZgpA QCAtMzE5NDUsMTEgKzM2NDEzLDM0IEBAIGV4cG9zZV9hcmVhIChzdHJ1Y3Qgd2luZG93ICp3LCBz dHJ1Y3QgZ2x5cGhfcm93ICpyb3csIFhSZWN0YW5nbGUgKnIsCiAgIHN0cnVjdCBnbHlwaCAqbGFz dDsKICAgaW50IGZpcnN0X3gsIHN0YXJ0X3gsIHg7CiAKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYm IHJvdy0+ZmlsbF9saW5lX3ApCisgICAgeworICAgICAgaWYgKCFOSUxQICh3LT5tY19jYWNoZSkg fHwgIU5JTFAgKHctPmNoX2NhY2hlKSB8fCAhTklMUCAody0+ZmNfY2FjaGUpKQorICAgICAgICB7 CisgICAgICAgICAgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRy aXg7CisgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsK KyAgICAgICAgICBpbnQgc3RhcnRfeCA9IDA7CisgICAgICAgICAgaW50IHN0YXJ0X2hwb3MgPSAw OworICAgICAgICAgIGludCBlbmRfaHBvcyA9IHJvdy0+dXNlZFtURVhUX0FSRUFdOworICAgICAg ICAgIGJvb2wgY2xlYXJfZW9sX3AgPSBmYWxzZTsKKyAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhz X2ZhY2UgaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgICAgIFRSQUNFICgoc3RkZXJyLCAi ZXhwb3NlX2FyZWEgKCVkKTogIFdyaXRlIHRoZSB3aG9sZSBsaW5lLlxuIiwgdnBvcykpOworICAg ICAgICAgIG1jX3JlZHJhd19yb3cgKHcsIG1hdHJpeCwgcm93LCBzdGFydF94LCBzdGFydF9ocG9z LCBlbmRfaHBvcywgY2xlYXJfZW9sX3AsIGhsKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCiAg ICAgLyogSWYgcm93IGV4dGVuZHMgZmFjZSB0byBlbmQgb2YgbGluZSB3cml0ZSB0aGUgd2hvbGUg bGluZS4gICovCiAgICAgZHJhd19nbHlwaHMgKHcsIDAsIHJvdywgYXJlYSwKIAkJIDAsIHJvdy0+ dXNlZFthcmVhXSwKIAkJIERSQVdfTk9STUFMX1RFWFQsIDApOworICAgIH0KKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogICBlbHNlCiAgICAgewogICAgICAgLyogU2V0IFNUQVJUX1gg dG8gdGhlIHdpbmRvdy1yZWxhdGl2ZSBzdGFydCBwb3NpdGlvbiBmb3IgZHJhd2luZyBnbHlwaHMg b2YKQEAgLTMxOTgxLDExICszNjQ3MiwzNCBAQCBleHBvc2VfYXJlYSAoc3RydWN0IHdpbmRvdyAq dywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBYUmVjdGFuZ2xlICpyLAogCSAgKytsYXN0OwogCX0K IAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwog ICAgICAgLyogUmVwYWludC4gICovCi0gICAgICBpZiAobGFzdCA+IGZpcnN0KQorICAgICAgLyog RmxvYXRpbmcgZmFrZSBjdXJzb3JzIHdpbGwgZXhpc3Qgd2hlbiAobGFzdCA9PSBmaXJzdCkuICov CisgICAgICBpZiAoKCFOSUxQICh3LT5tY19jYWNoZSkgfHwgIU5JTFAgKHctPmNoX2NhY2hlKSB8 fCAhTklMUCAody0+ZmNfY2FjaGUpKQorICAgICAgICAgICYmIGFyZWEgPT0gVEVYVF9BUkVBKQor ICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4ID0gdy0+Y3Vy cmVudF9tYXRyaXg7CisgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywg bWF0cml4KTsKKyAgICAgICAgICBzdGFydF94ID0gZmlyc3RfeCAtIHN0YXJ0X3g7CisgICAgICAg ICAgaW50IHN0YXJ0X2hwb3MgPSBmaXJzdCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAg ICAgICAgaW50IGVuZF9ocG9zID0gbGFzdCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAg ICAgICAgYm9vbCBjbGVhcl9lb2xfcCA9IGZhbHNlOworICAgICAgICAgIGVudW0gZHJhd19nbHlw aHNfZmFjZSBobCA9IERSQVdfTk9STUFMX1RFWFQ7CisgICAgICAgICAgVFJBQ0UgKChzdGRlcnIs ICJleHBvc2VfYXJlYSAoJWQpOiAgc3RhcnRfeCAoJWQpIHwgc3RhcnRfaHBvcyAoJWQpIHwgZW5k X2hwb3MgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgc3RhcnRfeCwg c3RhcnRfaHBvcywgZW5kX2hwb3MpKTsKKyAgICAgICAgICBtY19yZWRyYXdfcm93ICh3LCBtYXRy aXgsIHJvdywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGNsZWFyX2VvbF9wLCBobCk7 CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAobGFzdCA+IGZpcnN0KQogCWRyYXdfZ2x5cGhz ICh3LCBmaXJzdF94IC0gc3RhcnRfeCwgcm93LCBhcmVhLAogCQkgICAgIGZpcnN0IC0gcm93LT5n bHlwaHNbYXJlYV0sIGxhc3QgLSByb3ctPmdseXBoc1thcmVhXSwKIAkJICAgICBEUkFXX05PUk1B TF9URVhULCAwKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgIH0KIH0KIApA QCAtMzE5OTksMTAgKzM2NTEzLDMzIEBAIGV4cG9zZV9saW5lIChzdHJ1Y3Qgd2luZG93ICp3LCBz dHJ1Y3QgZ2x5cGhfcm93ICpyb3csIFhSZWN0YW5nbGUgKnIpCiB7CiAgIGVhc3NlcnQgKHJvdy0+ ZW5hYmxlZF9wKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKwogICBpZiAocm93LT5tb2RlX2xpbmVfcCB8fCB3LT5wc2V1ZG9fd2luZG93X3Ap CisgICAgeworICAgICAgaWYgKCFOSUxQICh3LT5tY19jYWNoZSkgfHwgIU5JTFAgKHctPmNoX2Nh Y2hlKSB8fCAhTklMUCAody0+ZmNfY2FjaGUpKQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0 IGdseXBoX21hdHJpeCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAgICAgaW50 IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAgICBpbnQgc3Rh cnRfeCA9IDA7CisgICAgICAgICAgaW50IHN0YXJ0X2hwb3MgPSAwOworICAgICAgICAgIGludCBl bmRfaHBvcyA9IHJvdy0+dXNlZFtURVhUX0FSRUFdOworICAgICAgICAgIGJvb2wgY2xlYXJfZW9s X3AgPSBmYWxzZTsKKyAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UgaGwgPSBEUkFXX05P Uk1BTF9URVhUOworICAgICAgICAgIFRSQUNFICgoc3RkZXJyLCAiZXhwb3NlX2xpbmUgKCVkKTog IFdyaXRlIHRoZSB3aG9sZSBsaW5lLlxuIiwgdnBvcykpOworICAgICAgICAgIG1jX3JlZHJhd19y b3cgKHcsIG1hdHJpeCwgcm93LCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcywgY2xlYXJf ZW9sX3AsIGhsKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCiAgICAgZHJhd19nbHlwaHMgKHcs IDAsIHJvdywgVEVYVF9BUkVBLAogCQkgMCwgcm93LT51c2VkW1RFWFRfQVJFQV0sCiAJCSBEUkFX X05PUk1BTF9URVhULCAwKTsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK ICAgZWxzZQogICAgIHsKICAgICAgIGlmIChyb3ctPnVzZWRbTEVGVF9NQVJHSU5fQVJFQV0pCkBA IC0zMjU1MCw2ICszNzA4NywyNCBAQCB4X2ludGVyc2VjdF9yZWN0YW5nbGVzIChYUmVjdGFuZ2xl ICpyMSwgWFJlY3RhbmdsZSAqcjIsIFhSZWN0YW5nbGUgKnJlc3VsdCkKIHZvaWQKIHN5bXNfb2Zf eGRpc3AgKHZvaWQpCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKyAgZGVmc3ViciAoJlNtY19kdW1wX2dseXBoX3Jvdyk7CisKKyAgZGVm c3ViciAoJlNtY19kdW1wX2dseXBoX21hdHJpeCk7CisKKyAgZGVmc3ViciAoJlNtY19jdXJyZW50 X2NvbHVtbik7CisKKyAgZGVmc3ViciAoJlNtY19zdGRlcnIpOworCisgIERFRlNZTSAoUWZyYW1l ZCwgImZyYW1lZCIpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIFZ3aXRoX2Vj aG9fYXJlYV9zYXZlX3ZlY3RvciA9IFFuaWw7CiAgIHN0YXRpY3BybyAoJlZ3aXRoX2VjaG9fYXJl YV9zYXZlX3ZlY3Rvcik7CiAKZGlmZiAtLWdpdCBhL3NyYy94dGVybS5jIGIvc3JjL3h0ZXJtLmMK aW5kZXggNWFhM2UzZi4uOTEyZThmYiAxMDA2NDQKLS0tIGEvc3JjL3h0ZXJtLmMKKysrIGIvc3Jj L3h0ZXJtLmMKQEAgLTEzMiw2ICsxMzIsODU1IEBAIGFsb25nIHdpdGggR05VIEVtYWNzLiAgSWYg bm90LCBzZWUgPGh0dHBzOi8vd3d3LmdudS5vcmcvbGljZW5zZXMvPi4gICovCiAjaW5jbHVkZSA8 WDExL1hLQmxpYi5oPgogI2VuZGlmCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioq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KTsKKyAgICAgIGlmIChjdXJz b3JfZ2x5cGggPT0gTlVMTCkKKyAgICAgICAgcmV0dXJuOworICAgICAgTGlzcF9PYmplY3QgYnVm ID0gdy0+Y29udGVudHM7CisgICAgICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgICAgICBzdHJ1Y3Qg YnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgICAgIGJvb2wgcmVnaW9uX2FjdGl2ZV9wID0g KCFOSUxQIChWdHJhbnNpZW50X21hcmtfbW9kZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmICFOSUxQIChCVkFSIChiLCBtYXJrX2FjdGl2ZSkpKTsKKyAgICAgIHB0cmRpZmZfdCBy ZWdpb25fYmVnaW5uaW5nID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBYRklYTlVNIChGcmVnaW9uX2Jl Z2lubmluZyAoKSkgOiAtMTsKKyAgICAgIHB0cmRpZmZfdCByZWdpb25fZW5kID0gKHJlZ2lvbl9h Y3RpdmVfcCkgPyBYRklYTlVNIChGcmVnaW9uX2VuZCAoKSkgOiAtMTsKKyAgICAgIHB0cmRpZmZf dCBvcG9pbnRfcHQgPSAodyA9PSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gUFQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFhG SVhOVU0gKEZtYXJrZXJfcG9zaXRpb24gKHctPnBvaW50bSkpOworICAgICAgYm9vbCByZWdpb25f aW5fYm91bmRzX3AgPSAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBvcG9pbnRfcHQgPj0gcmVnaW9uX2JlZ2lubmluZworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3B0IDwgcmVnaW9uX2VuZCk7CisgICAgICBpZiAo Y3Vyc29yX2dseXBoLT50eXBlICE9IElNQUdFX0d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54LT5jdXJzb3JfcGl4ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICAgIG1jX3hfZHJh d19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9z LCB3ZCwgaCk7CisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBv cmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRf ZGF0YS54LT5jdXJzb3JfZ2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAgICAgICAgICAgICAgZnVuY3Rp b25hbGl0eSBvZiBgeF9tYWtlX2djJyBpbiB4Zm5zLmMuICAqLworICAgICAgICAgICAgICBpZiAo cmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAmJiByZWdpb25faW5fYm91bmRzX3AK KyAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9mYWNlX2lkID0g bG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1yZWdp b24tZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3df YWN0aXZlX3JlZ2lvbl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lv bl9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZl X2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICg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kgKGYpLCBm LT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19hY3RpdmVfZmFjZS0+Zm9yZWdyb3Vu ZCk7CisgICAgICAgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExB WSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5i YWNrZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAv KiBUaGUgcmVnaW9uIGlzIF9ub3RfIHZpc2libGUgaW4gdGhlIGluYWN0aXZlIHdpbmRvdyBiZWNh dXNlIHRoZSBvdmVybGF5IHdpbmRvdyBwcm9wZXJ0eSBpcyB1c2VkLiAqLworICAgICAgICAgICAg ICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lk ID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1p bmFjdGl2ZS1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZh Y2UgKmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfaW5hY3Rp dmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJB TUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfaW5h Y3RpdmVfZmFjZS0+Zm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBYU2V0QmFj a2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2dj LCBob2xsb3dfaW5hY3RpdmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyogRm9y Y2UgYG1jX3hfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS54LT5jdXJz b3JfZ2MnLiAgKi8KKyAgICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAg ICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgRFJBV19DVVJT T1IsIHgsIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBy ZWQsIGdyZWVuLCBibHVlLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3As IGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElT UExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdjdi5mb3JlZ3JvdW5kKTsK KyAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91 dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdjdi5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICAgICAg dW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyogRHJhdyB0aGUgZnJhbWUgYXJvdW5k IHRoZSBib3guICovCisgICAgICAgICAgICAgIG1jX3hfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBt YXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAg ICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBIT0xMT1dfQk9YX0NVUlNPUjoKKyAg ICB7CisgICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVuID49IDApCisgICAg ICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9w aXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgIG1jX3hfZHJhd19ob2xsb3dfY3Vyc29yICh3 LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAg ICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVs OworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1 cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOwor ICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgRklMTEVEX0JPWF9DVVJTT1I6CisgICAgewor ICAgICAgaWYgKHJlZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBncmVlbiA+PSAwKQorICAgICAgICAv KiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycgYnkgYm9y cm93aW5nIHRoZQorICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHhmbnMu Yy4gICovCisgICAgICAgIHsKKyAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICBY U2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vy c29yX2djLCBGUkFNRV9CQUNLR1JPVU5EX1BJWEVMIChmKSk7CisgICAgICAgICAgWFNldEJhY2tn cm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywg Y29sb3IucGl4ZWwpOworICAgICAgICAgIC8qIEZvcmNlIGBtY194X3NldF9jdXJzb3JfZ2MnIHRv IHVzZSBgcy0+Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJy4gICovCisgICAgICAgICAgYm9v bCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcs IG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgcmVkLCBncmVlbiwgYmx1ZSwgZ2x5cGhfZmxhdm9yLCBjdXJzb3Jf dHlwZSwgd2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgWFNldEZvcmVncm91 bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdj di5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZ IChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmJhY2tncm91bmQpOworICAg ICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAg ICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSBmYWxzZTsKKyAgICAgICAgICAg IG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgRFJBV19DVVJTT1IsIHgsIGhw b3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVkLCBncmVlbiwg Ymx1ZSwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2Nf cCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgQkFSX0NVUlNP UjoKKyAgICB7CisgICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVuID49IDAp CisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9k YXRhLngtPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1 cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlz aWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3hfZHJhd19iYXJfY3Vyc29yICh3LCBt YXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwgY3Vyc29yX3dpZHRo LCBCQVJfQ1VSU09SLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgZi0+ b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAg ICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNv cl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAgICBtY194X2RyYXdfYmFy X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgs IGN1cnNvcl93aWR0aCwgQkFSX0NVUlNPUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOwor ICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIEhCQVJfQ1VSU09SOgor ICAgIHsKKyAgICAgIGlmIChyZWQgPj0gMCAmJiBibHVlID49IDAgJiYgZ3JlZW4gPj0gMCkKKyAg ICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEu eC0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29y X3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxl X29rYXlfcCA9IHRydWU7CisgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJp eCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLCBjdXJzb3Jfd2lkdGgsIEhC QVJfQ1VSU09SLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgZi0+b3V0 cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAg ICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNvcl9n Y19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAgICBtY194X2RyYXdfYmFyX2N1 cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1 cnNvcl93aWR0aCwgSEJBUl9DVVJTT1IsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAg ICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBOT19DVVJTT1I6CisgICAg ICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KKyAgICAg ICAgfQorI2lmZGVmIEhBVkVfWF9JMThOCisgIGlmICh3ID09IF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T51bmRlcmxpbmVfZGVmYXVsdGVkX3Ap CisgICAgICAgICAgICAgICAgeF9kcmF3X3VuZGVyd2F2ZSAocyk7CisgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBYR0NWYWx1ZXMgeGdjdjsK KyAgICAgICAgICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAocy0+ZGlzcGxheSwgcy0+Z2MsIEdDRm9y ZWdyb3VuZCwgJnhnY3YpOworICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRp c3BsYXksIHMtPmdjLCBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3IpOworICAgICAgICAgICAgICAg ICAgeF9kcmF3X3VuZGVyd2F2ZSAocyk7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3Vu ZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHhnY3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90 eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgdW5z aWduZWQgbG9uZyB0aGlja25lc3MsIHBvc2l0aW9uOworICAgICAgICAgICAgICBpbnQgeTsKKyAg ICAgICAgICAgICAgaWYgKHMtPnByZXYgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3AKKyAg ICAgICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBXZSB1c2UgdGhlIHNhbWUg dW5kZXJsaW5lIHN0eWxlIGFzIHRoZSBwcmV2aW91cyBvbmUuICAqLworICAgICAgICAgICAgICAg ICAgdGhpY2tuZXNzID0gcy0+cHJldi0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAg ICAgICAgIHBvc2l0aW9uID0gcy0+cHJldi0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHRoaWNrbmVzcy4gIERlZmF1bHQgaXMgMSBw aXhlbC4gICovCisgICAgICAgICAgICAgICAgICBpZiAocy0+Zm9udCAmJiBzLT5mb250LT51bmRl cmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+ Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gMTsKKyAgICAgICAgICAgICAgICAgIGlmICh4X3Vu ZGVybGluZV9hdF9kZXNjZW50X2xpbmUpCisgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0g KHMtPmhlaWdodCAtIHRoaWNrbmVzcykgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAg IC8qIEdldCB0aGUgdW5kZXJsaW5lIHBvc2l0aW9uLiAgVGhpcyBpcyB0aGUgcmVjb21tZW5kZWQK KyAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJ0aWNhbCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20g dGhlIGJhc2VsaW5lIHRvIHRoZSB0b3Agb2YKKyAgICAgICAgICAgICAgICAgICAgICAgICB0aGUg dW5kZXJsaW5lLiAgVGhpcyBpcyBhIHNpZ25lZCB2YWx1ZSBhY2NvcmRpbmcgdG8gdGhlCisgICAg ICAgICAgICAgICAgICAgICAgICAgc3BlY3MsIGFuZCBpdHMgZGVmYXVsdCBpcworICAgICAgICAg ICAgICAgICAgICAgICAgIFJPVU5EICgobWF4aW11bSBkZXNjZW50KSAvIDIpLCB3aXRoCisgICAg ICAgICAgICAgICAgICAgICAgICAgUk9VTkQoeCkgPSBmbG9vciAoeCArIDAuNSkgICovCisgICAg ICAgICAgICAgICAgICAgICAgaWYgKHhfdXNlX3VuZGVybGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVz CisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJs aW5lX3Bvc2l0aW9uID49IDApCisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMt PmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlm IChzLT5mb250KQorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+Zm9udC0+ ZGVzY2VudCArIDEpIC8gMjsKKyAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAg ICAgICAgICAgICAgICBwb3NpdGlvbiA9IHVuZGVybGluZV9taW5pbXVtX29mZnNldDsKKyAgICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBtYXggKHBvc2l0 aW9uLCB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQpOworICAgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgICAgLyogQ2hlY2sgdGhlIHNhbml0eSBvZiB0aGlja25lc3MgYW5kIHBvc2l0aW9uLiAg V2Ugc2hvdWxkCisgICAgICAgICAgICAgICAgIGF2b2lkIGRyYXdpbmcgdW5kZXJsaW5lIG91dCBv ZiB0aGUgY3VycmVudCBsaW5lIGFyZWEuICAqLworICAgICAgICAgICAgICBpZiAocy0+eSArIHMt PmhlaWdodCA8PSBzLT55YmFzZSArIHBvc2l0aW9uKQorICAgICAgICAgICAgICAgIHBvc2l0aW9u ID0gKHMtPmhlaWdodCAtIDEpIC0gKHMtPnliYXNlIC0gcy0+eSk7CisgICAgICAgICAgICAgIGlm IChzLT55ICsgcy0+aGVpZ2h0IDwgcy0+eWJhc2UgKyBwb3NpdGlvbiArIHRoaWNrbmVzcykKKyAg ICAgICAgICAgICAgICB0aGlja25lc3MgPSAocy0+eSArIHMtPmhlaWdodCkgLSAocy0+eWJhc2Ug KyBwb3NpdGlvbik7CisgICAgICAgICAgICAgIHMtPnVuZGVybGluZV90aGlja25lc3MgPSB0aGlj a25lc3M7CisgICAgICAgICAgICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9IHBvc2l0aW9uOwor ICAgICAgICAgICAgICB5ID0gcy0+eWJhc2UgKyBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgaWYg KHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICB4X2ZpbGxf cmVjdGFuZ2xlIChzLT5mLCBzLT5nYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg cy0+eCwgeSwgcy0+d2lkdGgsIHRoaWNrbmVzcyk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBYR0NWYWx1ZXMgeGdjdjsKKyAgICAgICAg ICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAocy0+ZGlzcGxheSwgcy0+Z2MsIEdDRm9yZWdyb3VuZCwg JnhnY3YpOworICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMt PmdjLCBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3IpOworICAgICAgICAgICAgICAgICAgeF9maWxs X3JlY3RhbmdsZSAocy0+Ziwgcy0+Z2MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgcy0+eCwgeSwgcy0+d2lkdGgsIHRoaWNrbmVzcyk7CisgICAgICAgICAgICAgICAgICBYU2V0 Rm9yZWdyb3VuZCAoc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Y29sb3JfZGVmYXVsdGVk X3ApCisgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBzLT5nYywgcy0+eCwgcy0+eSArIGR5 LAorICAgICAgICAgIHMtPndpZHRoLCBoKTsKKyAgICBlbHNlCisgICAgICB7CisgICAgICAgIFhH Q1ZhbHVlcyB4Z2N2OworICAgICAgICBYR2V0R0NWYWx1ZXMgKHMtPmRpc3BsYXksIHMtPmdjLCBH Q0ZvcmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXks IHMtPmdjLCBzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvcik7CisgICAgICAgIHhfZmlsbF9y ZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBzLT55ICsgZHksCisgICAgICAgICAgICBzLT53 aWR0aCwgaCk7CisgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBzLT5nYywgeGdj di5mb3JlZ3JvdW5kKTsKKyAgICAgIH0KKyAgfQorICAgICAgLyogRHJhdyByZWxpZWYgaWYgbm90 IHlldCBkcmF3bi4gICovCisgICAgICBpZiAoIXJlbGllZl9kcmF3bl9wICYmIHMtPmZhY2UtPmJv eCAhPSBGQUNFX05PX0JPWCkKKyAgeF9kcmF3X2dseXBoX3N0cmluZ19ib3ggKHMpOworICAgICAg aWYgKHMtPnByZXYpCisgIHsKKyAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpwcmV2OworICAgIGZv ciAocHJldiA9IHMtPnByZXY7IHByZXY7IHByZXYgPSBwcmV2LT5wcmV2KQorICAgICAgaWYgKHBy ZXYtPmhsICE9IHMtPmhsCisgICAgJiYgcHJldi0+eCArIHByZXYtPndpZHRoICsgcHJldi0+cmln aHRfb3ZlcmhhbmcgPiBzLT54KQorICAgICAgICB7CisgICAgLyogQXMgcHJldiB3YXMgZHJhd24g d2hpbGUgY2xpcHBlZCB0byBpdHMgb3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c2lu ZyBzLT5obCBub3cuICAqLworICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gbmV4dC0+ aGw7CisgICAgbmV4dC0+aGwgPSBzLT5obDsKKyAgICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2Mg KG5leHQsIGN1cnNvcl9nY19wKTsKKyAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhh Y3RseSAocywgbmV4dCk7CisgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJf R0xZUEgpCisgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOworICAg IGVsc2UKKyAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5l eHQpOworICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChuZXh0LT5mLCBuZXh0LT5nYyk7Cisg ICAgbmV4dC0+aGwgPSBzYXZlOworICAgIG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAgbmV4dC0+ Y2xpcF9oZWFkID0gcy0+bmV4dDsKKyAgICAgICAgfQorICB9CisgICAgfQorICAvKiBSZXNldCBj bGlwcGluZy4gICovCisgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChzLT5mLCBzLT5nYyk7Cisg IHMtPm51bV9jbGlwcyA9IDA7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBEZWZhdWx0IHRvIHVzaW5nIFhJTSBpZiBhdmFp bGFibGUuICAqLwogI2lmZGVmIFVTRV9YSU0KIGJvb2wgdXNlX3hpbSA9IHRydWU7CkBAIC05OTks NiArMTg0OCwxNSBAQCB4X3VwZGF0ZV9iZWdpbiAoc3RydWN0IGZyYW1lICpmKQogICBpZiAoRlJB TUVfVE9PTFRJUF9QIChmKSAmJiAhRlJBTUVfVklTSUJMRV9QIChmKSkKICAgICByZXR1cm47CiAK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAg Zi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBmOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgIGlmICghIEZSQU1FX0NSX1NVUkZBQ0UgKGYpKQogICAgIHsKICAgICAgIGludCB3aWR0aCwg aGVpZ2h0OwpAQCAtMTI2Niw2ICsyMTI0LDE2IEBAIHhfdXBkYXRlX2VuZCAoc3RydWN0IGZyYW1l ICpmKQogICBYRmx1c2ggKEZSQU1FX1hfRElTUExBWSAoZikpOwogICB1bmJsb2NrX2lucHV0ICgp OwogI2VuZGlmCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJT T1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBOVUxMOworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiB9CiAKIC8qIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIGZyb20gdmFy aW91cyBwbGFjZXMgaW4geGRpc3AuYwpAQCAtOTUxMCw2ICsxMDM3OCwyNSBAQCB4X2RyYXdfd2lu ZG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqZ2x5cGhfcm93 LCBpbnQgeCwKIAl7CiAJICBzd2l0Y2ggKGN1cnNvcl90eXBlKQogCSAgICB7CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBjYXNlIFJJ R0hUX0ZSSU5HRV9CSVRNQVA6CisgICAgICBicmVhazsKKyAgICBjYXNlIExFRlRfRlJJTkdFX0JJ VE1BUDoKKyAgICAgIGJyZWFrOworICAgIGNhc2UgTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgIGJy ZWFrOworICAgIGNhc2UgRlJBTUVEX0JPWF9DVVJTT1I6CisgICAgICAvKiBUaGlzIGZlYXR1cmUg aGFzIGJlZW4gZGVsaWJlcmF0ZWx5IGRpc2FibGVkIGZvciB0aGUgdGltZSBiZWluZy4gKi8KKyAg ICAgIHhfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBnbHlwaF9yb3cpOworICAgICAgYnJlYWs7CisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgY2FzZSBIT0xMT1dfQk9YX0NVUlNP UjoKIAkgICAgICB4X2RyYXdfaG9sbG93X2N1cnNvciAodywgZ2x5cGhfcm93KTsKIAkgICAgICBi cmVhazsKQEAgLTEzMTAwLDYgKzEzOTg3LDIxIEBAIHhfYWN0aXZhdGVfdGltZW91dF9hdGltZXIg KHZvaWQpCiAKIHN0YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSB4X3JlZGlzcGxheV9p bnRlcmZhY2UgPQogICB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgeHRlcm0uY2AgbXVz dCBiZSBpbiB0aGUgZXhhY3Qgc2FtZSBvcmRlciBhcyB0aGUKK2ByZWRpc3BsYXlfaW50ZXJmYWNl JyBpbiBgZGlzcGV4dGVybi5oYCEgKi8KKworICBtY194X3dyaXRlX2dseXBocywKKyAgbWNfeF9k cmF3X3dpbmRvd19jdXJzb3IsCisgIG1jX3hfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICB4X2ZyYW1lX3Bhcm1faGFuZGxlcnMsCiAgICAgeF9w cm9kdWNlX2dseXBocywKICAgICB4X3dyaXRlX2dseXBocywK --Multipart_Mon_Apr__8_21:03:20_2019-1--