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: Sun, 28 Apr 2019 18:21:05 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sun_Apr_28_18:21:05_2019-1" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="262995"; mail-complaints-to="usenet@blaine.gmane.org" To: 22873@debbugs.gnu.org,17684@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 29 03:22:21 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 1hKuzr-0012kC-LX for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Apr 2019 03:22:21 +0200 Original-Received: from localhost ([127.0.0.1]:50413 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKuzq-00018j-8N for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Apr 2019 21:22:18 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39401) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKuzd-00018R-Rp for bug-gnu-emacs@gnu.org; Sun, 28 Apr 2019 21:22:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hKuzb-0001b0-TX for bug-gnu-emacs@gnu.org; Sun, 28 Apr 2019 21:22:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52789) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hKuza-0001aZ-Fe for bug-gnu-emacs@gnu.org; Sun, 28 Apr 2019 21:22:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hKuza-00081U-3g for bug-gnu-emacs@gnu.org; Sun, 28 Apr 2019 21:22: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: Mon, 29 Apr 2019 01:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17684 X-GNU-PR-Package: emacs Original-Received: via spool by 17684-submit@debbugs.gnu.org id=B17684.155650087430779 (code B ref 17684); Mon, 29 Apr 2019 01:22:02 +0000 Original-Received: (at 17684) by debbugs.gnu.org; 29 Apr 2019 01:21:14 +0000 Original-Received: from localhost ([127.0.0.1]:38100 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hKuyn-00080M-RZ for submit@debbugs.gnu.org; Sun, 28 Apr 2019 21:21:13 -0400 Original-Received: from gateway36.websitewelcome.com ([192.185.193.119]:27909) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hKuyk-000807-Ts for 17684@debbugs.gnu.org; Sun, 28 Apr 2019 21:21:11 -0400 Original-Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway36.websitewelcome.com (Postfix) with ESMTP id C1EF5400C91C4 for <17684@debbugs.gnu.org>; Sun, 28 Apr 2019 19:39:48 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id Kuyjhiyi7YTGMKuyjhoBIJ; Sun, 28 Apr 2019 20:21:10 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:To:From:Message-ID:Date: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Aq/DoOMYYkuq0pe3US8+Fcm4V7zAMiysN5qnRr8F0Zg=; b=TvpLG1YAu83tf/ghl2nnmoTBuj BW4pBd9+27i5rEboopb01XodTUGhif3Ou50z6kRFL4jazDyJFNb6zjlqGqsF+6bbF49VW0iEqVwLJ gibOZCU08e+lo1Kwvu2ew0oboeFAcQkQXx0Rlzg3EeeUbrB6B61KNo13pV13m5sgE04m/VobVETey 2PiKaGblww3Kx/xPRI2V3K/P/9FmLYQKqP64ZpRwnSW2mm81HWawjfhxKvM6WB5CBPJUkWIrygsNi PWkrkdpoewTxyj4JkJjLskm/QRT7lMPFrGVBXJEULvrifaUrpeSKJ9a0rb984hr1RryW9j4FzNmw2 wFnFLG6w==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:54786 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from ) id 1hKuyg-000vjN-7o; Sun, 28 Apr 2019 20:21:08 -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: 1hKuyg-000vjN-7o X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:54786 X-Source-Auth: lawlist X-Email-Count: 8 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:158411 Archived-At: --Multipart_Sun_Apr_28_18:21:05_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 019.001 [04/28/2019] CHANGELOG: - With the gracious assistance of Paul Eggert on the Emacs Devel mailing list, the caches of fake cursors are now properly being reset. [The error was due to a failure to assign the returned value of xnrealloc back to the cache.] - Bug fix relating to floating fake cursors that were not being erased. [This was caused because the glyph_flavor had erroneously been set by `mc_engine' as MC_GLYPH instead of MC_GLYPHLESS, and `mc_erase_cursor' was called instead of `mc_draw_erase_hybrid' (which handles MC_GLYPHLESS, among other things). - Restored the triggering of update_begin/end when fake cursors are being erased. `mc_erase_pre_scroll_display' handles erasing and resetting of the caches. - Added a mechanism to track the matrix containing the row with the real cursor. update_window now updates that row before other rows within the desired_matrix so that data relating to that row is available when processing all other rows. This is useful when determining which right fringe bitmaps to use when the crosshairs feature is active; e.g., cursor is either at or beyond the fringe. - Added new fringe bitmaps and corresponding face that are used when cursor is beyond the fringe; e.g., when horizontal scrolling to the right. One set of bitmaps are used when cursor is exactly at the fringe (a rare, but reproducible occurrence); and, another set when cursor is beyond the fringe. Tests for each occurrence have been improved. The new tests permit Emacs to also handle a situation where the fake cursors are partially visible when not quite at the fringe, which is noticeable when the real fake cursor is greater than 1 pixel wide; e.g., a hollow box cursor. - Fixed a crash when debugging ns_judges_scroll_bars and wrapped the debugging code in a condition to limit its usage. - All remaining function parameters dealing with RGB have been consolidated into struct mc_RGB instead of individual parameters for each color. - Color determination for all three platforms is now streamlined a bit more with `mc_xw_color_values'. . NS platform needs no conversion after obtaining RGBA values from colorUsingDefaultColorSpace, which are stored in a mc_RGB sttruct until needed. . W32 platform: RGB values are obtained from `w32_defined_color' and divided by 65535, which are then stored in a mc_RGB struct until needed. When needed, those values are multiplied by 255 (result not to exceed 255). . X11 platform: RGB values are obtained from `x_defined_color' and divided by 65535, which are then stored in a mc_RGB struct until needed. When needed, those values are multiplied by 65535 (result not to exceed 65535). - Verified that garbage collection is under control. - Fixed a bug that prevented the vertical ruler of crosshairs from drawing when the fill column was at the fringe (exactly). - Fixed a bug affecting the drawing of a hollow cursor around images, which was due to the wrong cursor type being set before calling `mc_get_cursor_geometry'. - Fixed a bug that prevented the real cursor from sometimes being erased. 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_Sun_Apr_28_18:21:05_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_04_28__14_54_14_311.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi42NmE5ZmNlCi0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI1NyBAQAorOzs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs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jYW4ndCBrbm93IGlmIGl0J3Mgc3VwcG9ydGVkIG9yIG5vdAorICAgICAgICAg ICAgICA7OyAtIHNvIGdvIGFoZWFkIGFuZCBhc3N1bWUgaXQncyBvaywgYmVjYXVzZSB3ZSdyZSBq dXN0IG9wdGltaXN0aWMgbGlrZSB0aGF0CisgICAgICAgICAgICAgIChpZiAob3IgKG5vdCAoc3lt Ym9scCBvcmlnaW5hbC1jb21tYW5kKSkKKyAgICAgICAgICAgICAgICAgICAgICA7OyBsYW1iZGEg cmVnaXN0ZXJlZCBieSBzbWFydHJlcAorICAgICAgICAgICAgICAgICAgICAgIChzdHJpbmctcHJl Zml4LXAgIigiIChzeW1ib2wtbmFtZSBvcmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAgICAgICAg ICAgICAobWMvZXhlY3V0ZS1jb21tYW5kLWZvci1hbGwtZmFrZS1jdXJzb3JzIG9yaWdpbmFsLWNv bW1hbmQpCisgICAgICAgICAgICAgICAgOzsgc21hcnRyZXAgYGludGVybidzIGNvbW1hbmRzIGlu dG8gb3duIG9iYXJyYXkgdG8gaGVscAorICAgICAgICAgICAgICAgIDs7IGBkZXNjcmliZS1iaW5k aW5ncycuICBTbywgbGV0J3MgcmUtYGludGVybicgaGVyZSB0bworICAgICAgICAgICAgICAgIDs7 IG1ha2UgdGhlIGNvbW1hbmQgY29tcGFyYWJsZSBieSBgZXEnLgorICAgICAgICAgICAgICAgIChz ZXRxIG9yaWdpbmFsLWNvbW1hbmQgKGludGVybiAoc3ltYm9sLW5hbWUgb3JpZ2luYWwtY29tbWFu ZCkpKQorICAgICAgICAgICAgICAgIDs7IG90aGVyd2lzZSBpdCdzIGEgc3ltYm9sLCBhbmQgd2Ug Y2FuIGJlIG1vcmUgdGhvcm91Z2gKKyAgICAgICAgICAgICAgICAoaWYgKGdldCBvcmlnaW5hbC1j b21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpCisgICAgICAgICAgICAgICAgICAgIChtZXNzYWdlICIl UyBpcyBub3Qgc3VwcG9ydGVkIHdpdGggbXVsdGlwbGUgY3Vyc29ycyVzIgorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIChnZXQgb3JpZ2luYWwtY29tbWFuZCAnbWMtLXVuc3VwcG9ydGVkKSkKKyAgICAgICAg ICAgICAgICAgICh3aGVuIChhbmQgb3JpZ2luYWwtY29tbWFuZAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAobm90IChtZW1xIG9yaWdpbmFsLWNvbW1hbmQgbWMtLWRlZmF1bHQtY21kcy10 by1ydW4tb25jZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3QgKG1lbXEgb3Jp Z2luYWwtY29tbWFuZCBtYy9jbWRzLXRvLXJ1bi1vbmNlKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKG9yIG1jL2Fsd2F5cy1ydW4tZm9yLWFsbAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1 bi1mb3ItYWxsKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG1lbXEgb3JpZ2lu YWwtY29tbWFuZCBtYy9jbWRzLXRvLXJ1bi1mb3ItYWxsKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKG1jL3Byb21wdC1mb3ItaW5jbHVzaW9uLWluLXdoaXRlbGlzdCBvcmlnaW5h bC1jb21tYW5kKSkpCisgICAgICAgICAgICAgICAgICAgIChtYy9leGVjdXRlLWNvbW1hbmQtZm9y LWFsbC1mYWtlLWN1cnNvcnMgb3JpZ2luYWwtY29tbWFuZCkpKSkKKyAgICAgICAgICAgICAgKHdo ZW4gbWMvdXNlLWJ1aWx0LWluLWN1cnNvcnMKKyAgICAgICAgICAgICAgICAoc2V0cSBtYy1jb25m CisgICAgICAgIC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itoYXBwZW5z IGludGVybmFsbHkgYnkgbXVsdGlwbHlpbmcgZWFjaCBlbGVtZW50IG9mIHRoZSBMU0wgY29sb3Ig dmVjdG9yIGJ5IDY1NTM1LiIKKyhpbnRlcmFjdGl2ZSkKKyAgKGxldCAoKGJ1ZmZlciAoZ2V0LWJ1 ZmZlci1jcmVhdGUgIipNQy1URVNUKiIpKSkKKyAgICAod2l0aC1jdXJyZW50LWJ1ZmZlciBidWZm ZXIKKyAgICAgIChlcmFzZS1idWZmZXIpCisgICAgICAoaW5zZXJ0ICJUaGlzIGlzIGEgdGVzdCEi KQorICAgICAgKHNldHEgbWMtY29uZiAnKCgxICJoYmFyIiAibWFnZW50YSIpCisgICAgICAgICAg ICAgICAgICAgICAgKDIgImJhciIgInB1cnBsZSIpCisgICAgICAgICAgICAgICAgICAgICAgKDMg ImJveCIgIiMwMEZGMDAiKQorICAgICAgICAgICAgICAgICAgICAgICg0ICJob2xsb3ciICIjMDAw MEZGIikKKyAgICAgICAgICAgICAgICAgICAgICAoNSAoImhiYXIiIDMpIFsxLjAgMC4wIDEuMF0p CisgICAgICAgICAgICAgICAgICAgICAgKDYgKCJiYXIiIDMpIFswLjAgMS4wIDEuMF0pCisgICAg ICAgICAgICAgICAgICAgICAgKDcgImZyYW1lZCIgIk9yYW5nZVJlZCIpCisgICAgICAgICAgICAg ICAgICAgICAgKDggImJveCIgImdyZXkyNSIpCisgICAgICAgICAgICAgICAgICAgICAgKDkgImJv eCIgImdyZXk3NSIpKSkpCisgICAgKHNlbGVjdC13aW5kb3cgKGRpc3BsYXktYnVmZmVyIGJ1ZmZl cikpKSkKKworKGRlZnVuICstdGltZXItZm4gKCkKKyJTaW5jZSB0aGlzIGZpcmVzIGdsb2JhbGx5 LCB3ZSBtdXN0IGNvbnRyb2wgd2hpY2ggYnVmZmVycyBjcm9zc2hhaXJzIGFwcGVhciBpbi4iCisg ICh3aGVuICstbW9kZQorICAgICh1bmxlc3MgKG9yIChtZW1xIGxhc3QtY29tbWFuZCArLXBhcmVu cy1leGNsdXNpb25zKQorICAgICAgICAgICAgICAgIChudWxsICstcGFyZW5zLXApKQorICAgICAg KCstcGFyZW5zLWZuKSkKKyAgICAod2hlbiArLXRpbWVyLXZhcgorICAgICAgKHNldHEgdGltZXIt aWRsZS1saXN0IChkZWxxICstdGltZXItdmFyIHRpbWVyLWlkbGUtbGlzdCkpCisgICAgICAoc2V0 cSArLXRpbWVyLXZhciBuaWwpKSkpCisKKyhkZWZ1biArLWRyYXctZm9ydGh3aXRoICgpCisiSW1t ZWRpYXRlbHkgZGVsZXRlL2RyYXcgbWF0Y2hpbmcgcGFyZW50aGVzZXMuIgorICAoKy1kcmF3LWNy b3NzaGFpcnMgJ2ZvcmNlKSkKKworKGRlZnVuICstZHJhdy1jcm9zc2hhaXJzICgmb3B0aW9uYWwg Zm9yY2UpCisiSW1tZWRpYXRlbHkgZGVsZXRlIG1hdGNoaW5nIHBhcmVudGhlc2VzLiAgSWYgRk9S Q0UgaXMgbm9uLW5pbCwgdGhlbiBpbW1lZGlhdGVseQorZHJhdyBtYXRjaGluZyBwYXJlbnRoZXNp czsgb3RoZXJ3aXNlLCBkcmF3IHRoZW0gb24gYW4gaWRsZS10aWVyLiIKKyAgKHdoZW4gKy1tb2Rl CisgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgIChzZXRxIHRpbWVyLWlkbGUtbGlzdCAoZGVs cSArLXRpbWVyLXZhciB0aW1lci1pZGxlLWxpc3QpKQorICAgICAgKHNldHEgKy10aW1lci12YXIg bmlsKSkKKyAgICAodW5sZXNzIChvciAobWVtcSB0aGlzLWNvbW1hbmQgKy1wYXJlbnMtZXhjbHVz aW9ucykKKyAgICAgICAgICAgICAgICAoYW5kIChudWxsICstcGFyZW5zLXApCisgICAgICAgICAg ICAgICAgICAgICAobnVsbCArLXBhcmVucy1vdmVybGF5cy1leGlzdC1wKSkpCisgICAgICAoKy1k ZWxldGUtcGFyZW5zLW92ZXJsYXlzKSkKKyAgICAoaWYgZm9yY2UKKyAgICAgIChwcm9nbgorICAg ICAgICAod2hlbiArLXBhcmVucy1wCisgICAgICAgICAgKCstcGFyZW5zLWZuKSkpCisgICAgICAo c2V0cSArLXRpbWVyLXZhciAocnVuLXdpdGgtaWRsZS10aW1lciArLWlkbGUtdGltZXItc2Vjb25k cyBuaWwgIycrLXRpbWVyLWZuKSkpKSkKKworKGRlZnZhciBmYy1tb2RlKQorCis7OzsjIyNhdXRv bG9hZAorKGRlZmluZS1taW5vci1tb2RlICstbW9kZQorIk1pbm9yIG1vZGUgZm9yIGRpc3BsYXlp bmcgYSBob3Jpem9udGFsIHJ1bGVyLiIKKyAgOmluaXQtdmFsdWUgbmlsCisgIDpsaWdodGVyICIg KyIKKyAgOmtleW1hcCBuaWwKKyAgOmdsb2JhbCBuaWwKKyAgOmdyb3VwICcrLW1vZGUKKyAgKGNv bmQKKyAgICAoKy1tb2RlCisgICAgICA7OzsgYCstbW9kZScgaGFzIHRoZSBhYmlsaXR5IHRvIGFs c28gZGlzcGxheSBhIGZpbGwgY29sdW1uIGluZGljYXRvci4KKyAgICAgIDs7OyBTZWUgdGhlIHZh cmlhYmxlIGArLWZpbGwtY29sdW1uJy4KKyAgICAgICh3aGVuIGZjLW1vZGUKKyAgICAgICAgKGZj LW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBnbG9iYWwtZWxkb2MtbW9kZQorICAgICAgICAg ICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAgICAgICAgICAo ZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAoZ2xvYmFsLWVsZG9jLW1v ZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBqaXQtbG9jay1jb250ZXh0LXRpbWVyCisgICAgICAg ICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAg IChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAg aml0LWxvY2stY29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVyIGppdC1sb2Nr LWNvbnRleHQtdGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVy IChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250ZXh0LWZvbnRp ZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkpCisgICAgICAo d2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAg IChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAg dW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1l ciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChmc2V0ICd1bmRv LWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAgICAgICAgICAgICAobGFtYmRhICgpIChhZGQtdG8t bGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1jaGFuZ2VkLWJ1ZmZlcnMgKGN1cnJlbnQtYnVmZmVy KSkpKQorICAgICAgICAoZnNldCAndW5kby1hdXRvLWFtYWxnYW1hdGUgJ2lnbm9yZSkpCisgICAg ICAod2hlbiBibGluay1jdXJzb3ItbW9kZQorICAgICAgICAoYmxpbmstY3Vyc29yLW1vZGUgLTEp CisgICAgICAgICh3aGVuIChtZW1xICdibGluay1jdXJzb3ItY2hlY2sgcG9zdC1jb21tYW5kLWhv b2spCisgICAgICAgICAgKHJlbW92ZS1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAnYmxpbmstY3Vy c29yLWNoZWNrKSkpCisgICAgICAoc2V0cSBjcm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AgICAo ZG9saXN0ICh2YXIgJyhidWZmZXItZGlzcGxheS10YWJsZQorICAgICAgICAgICAgICAgICAgICAg ZnJpbmdlLWluZGljYXRvci1hbGlzdAorICAgICAgICAgICAgICAgICAgICAgdGFiLXdpZHRoCisg ICAgICAgICAgICAgICAgICAgICBsaW5lLW1vdmUtdmlzdWFsCisgICAgICAgICAgICAgICAgICAg ICB0cnVuY2F0ZS1saW5lcworICAgICAgICAgICAgICAgICAgICAgdHJ1bmNhdGUtcGFydGlhbC13 aWR0aC13aW5kb3dzCisgICAgICAgICAgICAgICAgICAgICB3b3JkLXdyYXApKQorICAgICAgICAo d2hlbiAobG9jYWwtdmFyaWFibGUtcCB2YXIpCisgICAgICAgICAgKHB1c2ggKGNvbnMgdmFyIChz eW1ib2wtdmFsdWUgdmFyKSkgKy0tc2F2ZWQtc3RhdGUpKSkKKyAgICAgIChzZXRxIGZpbGwtY29s dW1uIDgwKQorICAgICAgKHNldHEgZGlzcGxheS1saW5lLW51bWJlcnMgdCkKKyAgICAgIChzZXRx LWxvY2FsIGF1dG8taHNjcm9sbC1tb2RlICdjdXJyZW50LWxpbmUpCisgICAgICAoc2V0cS1sb2Nh bCBoc2Nyb2xsLXN0ZXAgNSkKKyAgICAgIChzZXRxIGJ1ZmZlci1kaXNwbGF5LXRhYmxlICstYnVm ZmVyLWRpc3BsYXktdGFibGUpCisgICAgICAoc2V0cSB0YWItd2lkdGggNCkKKyAgICAgIChzZXQg KG1ha2UtbG9jYWwtdmFyaWFibGUgJ2xpbmUtbW92ZS12aXN1YWwpIHQpCisgICAgICAoc2V0cSB0 cnVuY2F0ZS1saW5lcworICAgICAgICAoY29uZAorICAgICAgICAgICgobGV0ICgobHN0ICstdHJ1 bmNhdGUtbGluZXMtZGVyaXZlZC1tb2RlcykKKyAgICAgICAgICAgICAgICAgIG1vZGUpCisgICAg ICAgICAgICAoY2F0Y2ggJ2ZvdW5kCisgICAgICAgICAgICAgICh3aGlsZSAoc2V0cSBtb2RlIChw b3AgbHN0KSkKKyAgICAgICAgICAgICAgICAod2hlbiAoZGVyaXZlZC1tb2RlLXAgbW9kZSkKKyAg ICAgICAgICAgICAgICAgICh0aHJvdyAnZm91bmQgdCkpKSkpKQorICAgICAgICAgICAoKG1lbXEg bWFqb3ItbW9kZSArLXRydW5jYXRlLWxpbmVzLW1ham9yLW1vZGVzKSkKKyAgICAgICAgICAgKHQK KyAgICAgICAgICAgICBuaWwpKSkKKyAgICAgIChzZXQgKG1ha2UtbG9jYWwtdmFyaWFibGUgJ3Ry dW5jYXRlLXBhcnRpYWwtd2lkdGgtd2luZG93cykgbmlsKQorICAgICAgKHNldHEgd29yZC13cmFw IHQpCisgICAgICAoc2V0cSBpbmRpY2F0ZS1lbXB0eS1saW5lcyB0KQorICAgICAgKHNldHEgaW5k aWNhdGUtYnVmZmVyLWJvdW5kYXJpZXMgJ2xlZnQpCisgICAgICAoc2V0cSBmcmluZ2UtaW5kaWNh dG9yLWFsaXN0CisgICAgICAgICAgOzs7IGhzY2xfYWxsX3RlbXBfcCB8IGhzY2xfdGVtcF9wCisg ICAgICAgICcoKCstaHNjbC10ZW1wIC4gKCstc2luZ2xlLWFuZ2xlLWxlZnQKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgKy1kb3VibGUtYW5nbGUtbGVmdCkpCisgICAgICAgICAgOzs7IGhzY2xf YWxsX3Blcm1fMF9wIHwgaHNjbF9hbGxfcGVybV8xX3AgfCBoc2NsX2FsbF9wZXJtXzJfcCB8IGhz Y2xfcGVybV9wCisgICAgICAgICAgKCstaHNjbC1wZXJtIC4gKCstc2luZ2xlLWFuZ2xlLXVwCisg ICAgICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLXVwCisgICAgICAgICAgICAg ICAgICAgICAgICAgICstdHJpcGxlLWFuZ2xlLXVwCisgICAgICAgICAgICAgICAgICAgICAgICAg ICstcXVhZHJ1cGxlLWFuZ2xlLXVwKSkKKyAgICAgICAgICAoKy1vdmVybGF5LWFycm93IC4gKCst ZnJpbmdlLWxlZnQtYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdl LXJpZ2h0LWFycm93KSkKKyAgICAgICAgICAodHJ1bmNhdGlvbiAuICgrLWZyaW5nZS1sZWZ0LWFy cm93CisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtcmlnaHQtYXJyb3cpKQorICAg ICAgICAgIChjb250aW51YXRpb24gLiAoKy1mcmluZ2UtbGVmdC1jdXJseS1hcnJvdworICAgICAg ICAgICAgICAgICAgICAgICAgICAgKy1iYWNrc2xhc2gpKQorICAgICAgICAgIChvdmVybGF5LWFy cm93IC4gKy1mcmluZ2UtcmlnaHQtdHJpYW5nbGUpCisgICAgICAgICAgKHVwIC4gKy1mcmluZ2Ut dXAtYXJyb3cpCisgICAgICAgICAgKGRvd24gLiArLWZyaW5nZS1kb3duLWFycm93KQorICAgICAg ICAgICh0b3AgLiArLWZyaW5nZS10b3AtbGVmdC1hbmdsZSkKKyAgICAgICAgICAoYm90dG9tIC4g Ky1mcmluZ2UtYm90dG9tLXJpZ2h0LWFuZ2xlKQorICAgICAgICAgICh0b3AtYm90dG9tIC4gKCst ZnJpbmdlLWxlZnQtYnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJp Z2h0LWJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICArLWZyaW5nZS10b3AtcmlnaHQt YW5nbGUKKyAgICAgICAgICAgICAgICAgICAgICAgICArLWZyaW5nZS10b3AtbGVmdC1hbmdsZSkp CisgICAgICAgICAgKGVtcHR5LWxpbmUgLiArLWZyaW5nZS1lbXB0eS1saW5lKQorICAgICAgICAg ICh1bmtub3duIC4gKy1mcmluZ2UtcXVlc3Rpb24tbWFyaykpKQorICAgICAgKHNldHEgZnJpbmdl LWN1cnNvci1hbGlzdCAnKChib3ggLiArLWZyaW5nZS1sZWZ0LXRyaWFuZ2xlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIChob2xsb3cgLiArLWhvbGxvdy1yZWN0YW5nbGUpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGJhciAuICstdmVydGljYWwtYmFyKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChoYmFyIC4gKy1mcmluZ2UtaG9yaXpv bnRhbC1iYXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGhvbGxvdy1zbWFs bCAuICstZnJpbmdlLWhvbGxvdy1zcXVhcmUpKSkKKyAgICAgIChpZiAob3IgKy1mb3J0aHdpdGgK KyAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAg KGFkZC1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAnKy1kcmF3LWZvcnRod2l0aCAnYXBwZW5kICds b2NhbCkKKyAgICAgICAgKGFkZC1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAnKy1kcmF3LWNyb3Nz aGFpcnMgJ2FwcGVuZCAnbG9jYWwpKQorICAgICAgKHdoZW4gKy1mb3J0aHdpdGgKKyAgICAgICAg KGFkZC1ob29rICd3aW5kb3ctY29uZmlndXJhdGlvbi1jaGFuZ2UtaG9vayAnKy1kcmF3LWZvcnRo d2l0aCBuaWwgJ2xvY2FsKSkKKyAgICAgIChhZGQtaG9vayAnY2hhbmdlLW1ham9yLW1vZGUtaG9v ayAndHVybi1vZmYtKy1tb2RlIG5pbCAnbG9jYWwpCisgICAgICAod2hlbiAoY2FsbGVkLWludGVy YWN0aXZlbHktcCAnYW55KQorICAgICAgICAoY29uZAorICAgICAgICAgICgrLWZvcnRod2l0aAor ICAgICAgICAgICAgKG1lc3NhZ2UgIlR1cm5lZCBPTiBgKy1tb2RlJyAtLSBEcmF3IG1hdGNoaW5n IHBhcmVudGhlc2VzIGltbWVkaWF0ZWx5LiIpKQorICAgICAgICAgICgoZXF1YWwgY3VycmVudC1w cmVmaXgtYXJnICcoNCkpCisgICAgICAgICAgICA7OzsgTWF0Y2hpbmcgcGFyZW50aGVzZXMgd2ls bCBiZSBkcmF3biBpbW1lZGlhdGVseS4KKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04g YCstbW9kZScgLS0gT3B0aW1pemVkIGZvciBkZWJ1Z2dpbmcgcHVycG9zZXMuIikpCisgICAgICAg ICAgKHQKKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScuIikpKSkpCisg ICAgKHQKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdmaWxsLWNvbHVtbikKKyAgICAgIChr aWxsLWxvY2FsLXZhcmlhYmxlICdhdXRvLWhzY3JvbGwtbW9kZSkKKyAgICAgIChraWxsLWxvY2Fs LXZhcmlhYmxlICdoc2Nyb2xsLXN0ZXApCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnY3Jv c3NoYWlycykKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdmYy12aXNpYmxlKQorICAgICAg KGtpbGwtbG9jYWwtdmFyaWFibGUgJ2Rpc3BsYXktbGluZS1udW1iZXJzKQorICAgICAgKGtpbGwt bG9jYWwtdmFyaWFibGUgJ2Rpc3BsYXktbGluZS1udW1iZXJzLXdpZHRoKQorICAgICAgKGtpbGwt bG9jYWwtdmFyaWFibGUgJ21jLWNvbmYpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnYnVm ZmVyLWRpc3BsYXktdGFibGUpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAndGFiLXdpZHRo KQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ2xpbmUtbW92ZS12aXN1YWwpCisgICAgICAo a2lsbC1sb2NhbC12YXJpYWJsZSAndHJ1bmNhdGUtbGluZXMpCisgICAgICAoa2lsbC1sb2NhbC12 YXJpYWJsZSAndHJ1bmNhdGUtcGFydGlhbC13aWR0aC13aW5kb3dzK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b2NoYXIKKyAgICAg ICAgICAgICAgICAgICAob3IgOzs7IChjaGFyLXRvLXN0cmluZyA0MCkgPT4gb3BlbmluZyBwYXJl bnRoZXNpcworICAgICAgICAgICAgICAgICAgICAgICAoPSBvY2hhciA0MCkKKyAgICAgICAgICAg ICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyA5MSkgPT4gb3BlbmluZyBzcXVhcmUgYnJh Y2tldAorICAgICAgICAgICAgICAgICAgICAgICAoPSBvY2hhciA5MSkKKyAgICAgICAgICAgICAg ICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyAxMjMpID0+IG9wZW5pbmcgd2F2eSBicmFja2V0 CisgICAgICAgICAgICAgICAgICAgICAgICg9IG9jaGFyIDEyMykpKQorICAgICAgICAgICAgICAg IChtaW4gKDErIG9wb2ludCkgKHBvaW50LW1heCkpKQorICAgICAgICAgICAgICgob3IgOzs7IChj aGFyLXRvLXN0cmluZyA0MSkgPT4gY2xvc2luZyBwYXJlbnRoZXNpcworICAgICAgICAgICAgICAg ICAgKD0gcHJlY2VkaW5nLWNoYXIgNDEpCisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8t c3RyaW5nIDkzKSA9PiBjbG9zaW5nIHNxdWFyZSBicmFja2V0CisgICAgICAgICAgICAgICAgICAo PSBwcmVjZWRpbmctY2hhciA5MykKKyAgICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJp bmcgMTI1KSA9PiBjbG9zaW5nIHdhdnkgYnJhY2tldAorICAgICAgICAgICAgICAgICAgKD0gcHJl Y2VkaW5nLWNoYXIgMTI1KSkKKyAgICAgICAgICAgICAgICAobWF4IChwb2ludC1taW4pICgxLSBv cG9pbnQpKSkKKyAgICAgICAgICAgICAodAorICAgICAgICAgICAgICAgIG9wb2ludCkpKQorICAg ICAgICAgcG9zMgorICAgICAgICAgc2VsZWN0ZWQtZmFjZSkKKyAgICAoc2F2ZS1leGN1cnNpb24K KyAgICAgIChjb25kaXRpb24tY2FzZSBuaWwKKyAgICAgICAgKHdoaWxlIChzZXRxIHBvczEgKG50 aCAxIChwYXJzZS1wYXJ0aWFsLXNleHAgZnJvbSBwb3MxKSkpCisgICAgICAgICAgKHNldHEgcG9z MiAoc2Nhbi1zZXhwcyBwb3MxIDEpKQorICAgICAgICAgIChpZiAoPSBpIDEwKQorICAgICAgICAg ICAgKHNldHEgaSAxKQorICAgICAgICAgICAgKHNldHEgaSAoMSsgaSkpKQorICAgICAgICAgIChz ZXRxIHNlbGVjdGVkLWZhY2UgKGNvbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg KCg9IGkgMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtb25l LWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDIpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXR3by1mYWNlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAzKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICcrLXBhcmVucy10aHJlZS1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoKD0gaSA0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBh cmVucy1mb3VyLWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDUp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLWZpdmUtZmFjZSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgNikKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtc2l4LWZhY2UpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICgoPSBpIDcpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJystcGFyZW5zLXNldmVuLWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICgoPSBpIDgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLWVp Z2h0LWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDkpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLW5pbmUtZmFjZSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgMTApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJystcGFyZW5zLXRlbi1mYWNlKSkpCisgICAgICAgICAgKGxldCAoKG92 IChtYWtlLW92ZXJsYXkgcG9zMSAoMSsgcG9zMSkpKSkKKyAgICAgICAgICAgICh1bmxlc3MgKy1w YXJlbnMtaW5hY3RpdmUtd2luZG93cworICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ3dp bmRvdyB3aW4pKQorICAgICAgICAgICAgKG92ZXJsYXktcHV0IG92ICdmYWNlIHNlbGVjdGVkLWZh Y2UpKQorICAgICAgICAgICh3aGVuIHBvczIKKyAgICAgICAgICAgIChsZXQgKChvdiAobWFrZS1v dmVybGF5ICgxLSBwb3MyKSBwb3MyKSkpCisgICAgICAgICAgICAgICh1bmxlc3MgKy1wYXJlbnMt aW5hY3RpdmUtd2luZG93cworICAgICAgICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnd2luZG93 IHdpbikpCisgICAgICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBzZWxlY3RlZC1mYWNl KSkpKQorICAgICAgICAoZXJyb3IgbmlsKSkpCisgICAgKHNldHEgKy1wYXJlbnMtb3ZlcmxheXMt ZXhpc3QtcCB0KSkpCisKKyhkZWZ1biArLXJlbW92ZS1vdmVybGF5cyAoYmVnIGVuZCBuYW1lIHZh bCkKKyJSZW1vdmUgdGhlIG92ZXJsYXlzIHRoYXQgYXJlIGBlcXVhbC1pbmNsdWRpbmctcHJvcGVy dGllc2AuCitJbmNsdWRlcyBhIHVuaXF1ZSBzaXR1YXRpb24gd2hlbiBhbiBvdmVybGF5IHdpdGgg YW4gYCdhZnRlci1zdHJpbmdgIHByb3BlcnR5CitpcyBhdCB0aGUgdmVyeSBlbmQgb2YgYSBuYXJy b3dlZC1idWZmZXIuIgorICAobGV0KiAoKHBvaW50LW1heCAocG9pbnQtbWF4KSkKKyAgICAgICAg IChwb2ludC1taW4gKHBvaW50LW1pbikpCisgICAgICAgICAobmFycm93ZWQtcCAoYnVmZmVyLW5h cnJvd2VkLXApKQorICAgICAgICAgKGJlZyAoaWYgYmVnIGJlZyBwb2ludC1taW4pKQorICAgICAg ICAgKGVuZAorICAgICAgICAgICAoY29uZAorICAgICAgICAgICAgICgoYW5kCisgICAgICAgICAg ICAgICAgIChub3QgbmFycm93ZWQtcCkKKyAgICAgICAgICAgICAgICAgZW5kKQorICAgICAgICAg ICAgICAgZW5kKQorICAgICAgICAgICAgICgoYW5kCisgICAgICAgICAgICAgICAgIChub3QgbmFy cm93ZWQtcCkKKyAgICAgICAgICAgICAgICAgKG51bGwgZW5kKSkKKyAgICAgICAgICAgICAgIHBv aW50LW1heCkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICBuYXJyb3dlZC1w CisgICAgICAgICAgICAgICAgIGVuZAorICAgICAgICAgICAgICAgICAoPCBlbmQgcG9pbnQtbWF4 KSkKKyAgICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAg ICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAgICAgIGVuZAorICAgICAgICAgICAgICAgICAo PSBlbmQgcG9pbnQtbWF4KSkKKyAgICAgICAgICAgICAgICgxKyBlbmQpKQorICAgICAgICAgICAg ICgoYW5kCisgICAgICAgICAgICAgICAgIG5hcnJvd2VkLXAKKyAgICAgICAgICAgICAgICAgKG51 bGwgZW5kKSkKKyAgICAgICAgICAgICAgICgxKyBwb2ludC1tYXgpKSApKQorICAgICAgICAgKG92 ZXJsYXlzCisgICAgICAgICAgIChwcm9nbgorICAgICAgICAgICAgIChvdmVybGF5LXJlY2VudGVy IGVuZCkKKyAgICAgICAgICAgICAob3ZlcmxheXMtaW4gYmVnIGVuZCkpKSkKKyAgICAod2hlbiAo YW5kIGJlZyBlbmQgbmFtZSB2YWwpCisgICAgICAoZG9saXN0IChvIG92ZXJsYXlzKQorICAgICAg ICAoY29uZAorICAgICAgICAgICgoYW5kIChlcSBuYW1lICdmYWNlKQorICAgICAgICAgICAgICAg IChlcSAob3ZlcmxheS1nZXQgbyBuYW1lKSB2YWwpKQorICAgICAgICAgICAgOzsgRWl0aGVyIHB1 c2ggdGhpcyBvdmVybGF5IG91dHNpZGUgYmVnLi4uZW5kCisgICAgICAgICAgICA7OyBvciBzcGxp dCBpdCB0byBleGNsdWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsgb3IgZGVsZXRlIGl0IGVu dGlyZWx5IChpZiBpdCBpcyBjb250YWluZWQgaW4gYmVnLi4uZW5kKS4KKyAgICAgICAgICAgIChp ZiAoPCAob3ZlcmxheS1zdGFydCBvKSBiZWcpCisgICAgICAgICAgICAgICAgKGlmICg+IChvdmVy bGF5LWVuZCBvKSBlbmQpCisgICAgICAgICAgICAgIChwcm9nbgorICAgICAgICAgICAgICAgICht b3ZlLW92ZXJsYXkgKGNvcHktb3ZlcmxheSBvKQorICAgICAgICAgICAgICAgICAgKG92ZXJsYXkt c3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAgIChtb3ZlLW92ZXJsYXkgbyBlbmQgKG92ZXJs YXktZW5kIG8pKSkKKyAgICAgICAgICAgICAgICAgIChtb3ZlLW92ZXJsYXkgbyAob3ZlcmxheS1z dGFydCBvKSBiZWcpKQorICAgICAgICAgICAgICAoaWYgKD4gKG92ZXJsYXktZW5kIG8pIGVuZCkK KyAgICAgICAgICAgICAgICAgIChtb3ZlLW92ZXJsYXkgbyBlbmQgKG92ZXJsYXktZW5kIG8pKQor ICAgICAgICAgICAgICAgIChkZWxldGUtb3ZlcmxheSBvKSkpKQorICAgICAgICAgICgoYW5kIChu b3QgKGVxIG5hbWUgJ2ZhY2UpKQorICAgICAgICAgICAgICAgIChlcXVhbC1pbmNsdWRpbmctcHJv cGVydGllcyAob3ZlcmxheS1nZXQgbyBuYW1lKSB2YWwpKQorICAgICAgICAgICAgKGRlbGV0ZS1v dmVybGF5IG8pKSkpKSkpCisKKyhkZWZ1biArLWRlbGV0ZS1wYXJlbnMtb3ZlcmxheXMgKCkKKyAg KHdoZW4gKy1wYXJlbnMtb3ZlcmxheXMtZXhpc3QtcAorICAgIChkb2xpc3QgKGZhY2UgJygrLXBh cmVucy1vbmUtZmFjZQorICAgICAgICAgICAgICAgICAgICArLXBhcmVucy10d28tZmFjZQorICAg ICAgICAgICAgICAgICAgICArLXBhcmVucy10aHJlZS1mYWNlCisgICAgICAgICAgICAgICAgICAg ICstcGFyZW5zLWZvdXItZmFjZQorICAgICAgICAgICAgICAgICAgICArLXBhcmVucy1maXZlLWZh Y2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtc2l4LWZhY2UKKyAgICAgICAgICAgICAg ICAgICAgKy1wYXJlbnMtc2V2ZW4tZmFjZQorICAgICAgICAgICAgICAgICAgICArLXBhcmVucy1l aWdodC1mYWNlCisgICAgICAgICAgICAgICAgICAgICstcGFyZW5zLW5pbmUtZmFjZQorICAgICAg ICAgICAgICAgICAgICArLXBhcmVucy10ZW4tZmFjZSkpCisgICAgICAoKy1yZW1vdmUtb3Zlcmxh eXMgbmlsIG5pbCAnZmFjZSBmYWNlKSkKKyAgICAoc2V0cSArLXBhcmVucy1vdmVybGF5cy1leGlz dC1wIG5pbCkpKQorCis7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7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XJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisg ICAgICAgIChnbG9iYWwtZWxkb2MtbW9kZSAtMSkpCisgICAgICAod2hlbiAoYW5kIGppdC1sb2Nr LWNvbnRleHQtdGltZXIKKyAgICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAg J2FueSkKKyAgICAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkK KyAgICAgICAgKHdoZW4gKHRpbWVycCBqaXQtbG9jay1jb250ZXh0LXRpbWVyKQorICAgICAgICAg IChjYW5jZWwtdGltZXIgaml0LWxvY2stY29udGV4dC10aW1lcikpCisgICAgICAgIDs7IChzZXRx IGppdC1sb2NrLWNvbnRleHQtdGltZXIgKHJ1bi13aXRoLWlkbGUtdGltZXIgNS4wICdyZXBlYXQg J2ppdC1sb2NrLWNvbnRleHQtZm9udGlmeSkpCisgICAgICAgIChzZXRxIGppdC1sb2NrLWNvbnRl eHQtdGltZXIgbmlsKSkKKyAgICAgICh3aGVuIChhbmQgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAg J2FueSkKKyAgICAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkK KyAgICAgICAgKHdoZW4gKHRpbWVycCB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikK KyAgICAgICAgICAoY2FuY2VsLXRpbWVyIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVy KSkKKyAgICAgICAgKGZzZXQgJ3VuZG8tYXV0by0tdW5kb2FibGUtY2hhbmdlCisgICAgICAgICAg ICAgIChsYW1iZGEgKCkgKGFkZC10by1saXN0ICd1bmRvLWF1dG8tLXVuZG9hYmx5LWNoYW5nZWQt YnVmZmVycyAoY3VycmVudC1idWZmZXIpKSkpCisgICAgICAgIChmc2V0ICd1bmRvLWF1dG8tYW1h bGdhbWF0ZSAnaWdub3Jl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or eworICBiLT5mY19pbmFjdGl2ZV93aW5kb3dzXyA9IHZhbDsKK30KKworLyogZW5kIE1VTFRJUExF LUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIHN0YXRpYyB2b2lkCiBi c2V0X2FiYnJldl9tb2RlIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCiB7CkBA IC01MTQyLDYgKzUyMDUsMjQgQEAgaW5pdF9idWZmZXJfb25jZSAodm9pZCkKICAgYnNldF9sYXN0 X3NlbGVjdGVkX3dpbmRvdyAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbWFrZV9maXhudW0gKDApKTsK IAogICBpZHggPSAxOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUt Q1VSU09SUyAqLworCisgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBt Y19yZWFsX2Zha2VfY3Vyc29yKSwgaWR4KTsgKytpZHg7CisgIFhTRVRGQVNUSU5UIChCVkFSICgm YnVmZmVyX2xvY2FsX2ZsYWdzLCBtY19jb25mKSwgaWR4KTsgKytpZHg7CisgIFhTRVRGQVNUSU5U IChCVkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBtY19pbmFjdGl2ZV93aW5kb3dzKSwgaWR4KTsg KytpZHg7CisgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBjcm9zc2hh aXJzKSwgaWR4KTsgKytpZHg7CisgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2FsX2Zs YWdzLCBjaF9ob3Jpem9udGFsX3J1bGVyKSwgaWR4KTsgKytpZHg7CisgIFhTRVRGQVNUSU5UIChC VkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBjaF92ZXJ0aWNhbF9ydWxlciksIGlkeCk7ICsraWR4 OworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgY2hfaW5hY3RpdmVf d2luZG93cyksIGlkeCk7ICsraWR4OworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2Nh bF9mbGFncywgZmNfdmlzaWJsZSksIGlkeCk7ICsraWR4OworICBYU0VURkFTVElOVCAoQlZBUiAo JmJ1ZmZlcl9sb2NhbF9mbGFncywgZmNfaW5hY3RpdmVfd2luZG93cyksIGlkeCk7ICsraWR4Owor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVm ZmVyX2xvY2FsX2ZsYWdzLCBtb2RlX2xpbmVfZm9ybWF0KSwgaWR4KTsgKytpZHg7CiAgIFhTRVRG QVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBhYmJyZXZfbW9kZSksIGlkeCk7ICsr aWR4OwogICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgb3ZlcndyaXRl X21vZGUpLCBpZHgpOyArK2lkeDsKQEAgLTUyMjgsNiArNTMwOSwyNCBAQCBpbml0X2J1ZmZlcl9v bmNlICh2b2lkKQogICAvKiBNdXN0IGRvIHRoZXNlIGJlZm9yZSBtYWtpbmcgdGhlIGZpcnN0IGJ1 ZmZlciEgKi8KIAogICAvKiByZWFsIHNldHVwIGlzIGRvbmUgaW4gYmluZGluZ3MuZWwgKi8KKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTF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IExpc3BfT2JqZWN0IGNoX3ZlcnRpY2FsX3J1bGVy XzsKKworICAvKiBXaGV0aGVyIHRvIGRyYXcgY3Jvc3NoYWlycyBpbiBpbmFjdGl2ZSB3aW5kb3dz LiAqLworICBMaXNwX09iamVjdCBjaF9pbmFjdGl2ZV93aW5kb3dzXzsKKworICAvKiBUaGUgbmFt ZSBvZiB0aGUgYnVmZmVyLWxvY2FsIHZhcmlhYmxlLiAqLworICBMaXNwX09iamVjdCBmY192aXNp YmxlXzsKKworICAvKiBXaGV0aGVyIHRvIGRyYXcgbXVsdGlwbGUgY3Vyc29ycyBmaWxsIGNvbHVt biBpbiBpbmFjdGl2ZSB3aW5kb3dzLiAqLworICBMaXNwX09iamVjdCBmY19pbmFjdGl2ZV93aW5k b3dzXzsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBDdXJzb3IgdHlwZSB0 byBkaXNwbGF5IGluIG5vbi1zZWxlY3RlZCB3aW5kb3dzLgogICAgICB0IG1lYW5zIHRvIHVzZSBo b2xsb3cgYm94IGN1cnNvci4KICAgICAgU2VlIGBjdXJzb3ItdHlwZScgZm9yIG90aGVyIHZhbHVl cy4gICovCkBAIC03ODcsMTQgKzgyMSwyMSBAQCBzdHJ1Y3QgYnVmZmVyCiAgICAgIGFuIGluZGly ZWN0IGJ1ZmZlciBzaW5jZSBpdCBjb3VudHMgYXMgaXRzIGJhc2UgYnVmZmVyLiAgKi8KICAgaW50 IHdpbmRvd19jb3VudDsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKwogICAvKiBBIG5vbi16ZXJvIHZhbHVlIGluIHNsb3QgSURYIG1lYW5zIHRo YXQgcGVyLWJ1ZmZlciB2YXJpY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gc2luZ2xlIC5jIGZpbGUgYXJlCiAg ICBkZWZpbmVkIGFzIHN0YXRpYyBpbiB0aG9zZSBmaWxlcy4pICAqLworCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCitJTkxJTkUgdm9p ZAorYnNldF9ibHZfbWNfcmVhbF9mYWtlX2N1cnNvciAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9P YmplY3QgdmFsKQoreworICBiLT5tY19yZWFsX2Zha2VfY3Vyc29yXyA9IHZhbDsKK30KKworSU5M SU5FIHZvaWQKK2JzZXRfYmx2X21jX2NvbmYgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0 IHZhbCkKK3sKKyAgYi0+bWNfY29uZl8gPSB2YWw7Cit9CisKK0lOTElORSB2b2lkCitic2V0X2Js dl9tY19pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwp Cit7CisgIGItPm1jX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCitJTkxJTkUgdm9pZAor YnNldF9ibHZfY3Jvc3NoYWlycyAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQor eworICBiLT5jcm9zc2hhaXJzXyA9IHZhbDsKK30KKworSU5MSU5FIHZvaWQKK2JzZXRfYmx2X2No X2hvcml6b250YWxfcnVsZXIgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkKK3sK KyAgYi0+Y2hfaG9yaXpvbnRhbF9ydWxlcl8gPSB2YWw7Cit9CisKK0lOTElORSB2b2lkCitic2V0 X2Jsdl9jaF92ZXJ0aWNhbF9ydWxlciAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFs KQoreworICBiLT5jaF92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KioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBG b3J3YXJkIHByb3RvdHlwZSBkZWZpbml0aW9ucy4gKi8KK2VudW0gdHlwZV9vZl9jYWNoZTsKKwor ZW51bSB0eXBlX29mX2N1cnNvcjsKKworZW51bSBtY19mbGF2b3I7CisKK2VudW0gdHlwZV9vZl9h Y3Rpb24KK3sKKyAgTVVMVElQTEVfQ1VSU09SUywKKyAgSE9SSVpPTlRBTF9SVUxFUiwKKyAgVkVS VElDQUxfUlVMRVIsCisgIEZJTExfQ09MVU1OCit9OworCitzdHJ1Y3QgbWNfUkdCCit7CisgIGRv dWJsZSByZWQ7CisgIGRvdWJsZSBncmVlbjsKKyAgZG91YmxlIGJsdWU7Cit9OworCisvKiBlbmQg TVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogVGV4 dCBjdXJzb3IgdHlwZXMuICAqLwogCiBlbnVtIHRleHRfY3Vyc29yX2tpbmRzCkBAIC0zODIsNiAr NDEyLDIwIEBAIHN0cnVjdCBnbHlwaF9zbGljZQogCiBzdHJ1Y3QgZ2x5cGgKIHsKKworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpbnQgeCwg eSwgaHBvcywgdnBvczsKKworICBpbnQgcmVsYXRpdmVfeDsKKworICBib29sX2JmIHp2X3AgOiAx OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFBvc2l0aW9uIGZyb20gd2hp Y2ggdGhpcyBnbHlwaCB3YXMgZHJhd24uICBJZiBgb2JqZWN0JyBiZWxvdyBpcyBhCiAgICAgIExp c3Agc3RyaW5nLCB0aGlzIGlzIGFuIGluZGV4IGludG8gdGhhdCBzdHJpbmcuICBJZiBpdCBpcyBh CiAgICAgIGJ1ZmZlciwgdGhpcyBpcyBhIHBvc2l0aW9uIGluIHRoYXQgYnVmZmVyLiAgSW4gYWRk aXRpb24sIHNvbWUKQEAgLTEyNDgsNiArMTI5MiwyOCBAQCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UK IAogc3RydWN0IGdseXBoX3N0cmluZwogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgYm9vbF9iZiBsZWZ0X292ZXJ3cml0dGVuX3Ag OiAxOworCisgICAgYm9vbF9iZiByaWdodF9vdmVyd3JpdHRlbl9wIDogMTsKKworICAgIGJvb2xf YmYgcmVjdGFuZ2xlX251a2VkX3AgOiAxOworCisgICAgYm9vbF9iZiBiYWNrZ3JvdW5kX251a2Vk X3AgOiAxOworCisgICAgZW51bSBkcmF3X2dseXBoX2FjdGlvbgorICAgIHsKKyAgICAgIE1DX0RS QVdfR0xZUEgsCisgICAgICBNQ19FUkFTRV9HTFlQSAorICAgIH0gYWN0aW9uX3R5cGU7CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogWC1vcmlnaW4gb2YgdGhlIHN0cmluZy4g ICovCiAgIGludCB4OwogCkBAIC0yMjE2LDYgKzIyODIsMTYgQEAgc3RydWN0IGNvbXBvc2l0aW9u X2l0CiAKIHN0cnVjdCBpdAogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgIGJvb2xfYmYgenZfcCA6IDE7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKICAgLyogVGhlIHdpbmRvdyBpbiB3aGljaCB3ZSBpdGVyYXRlIG92ZXIg Y3VycmVudF9idWZmZXIgKG9yIGEgc3RyaW5nKS4gICovCiAgIExpc3BfT2JqZWN0IHdpbmRvdzsK ICAgc3RydWN0IHdpbmRvdyAqdzsKQEAgLTI4MTIsNiArMjg4OCwzMSBAQCB0eXBlZGVmIHZvaWQg KCpmcmFtZV9wYXJtX2hhbmRsZXIpIChzdHJ1Y3QgZnJhbWUgKiwgTGlzcF9PYmplY3QsIExpc3Bf T2JqZWN0KTsKIAogc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UKIHsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogYHJlZGlzcGxheV9p bnRlcmZhY2UnIGluIGBuc3Rlcm0ubWAgXCBgdzMydGVybS5jYCBcIGB4dGVybS5jYCBtdXN0IGJl IGluIHRoZQorZXhhY3Qgc2FtZSBvcmRlciBhcyB0aGUgYHJlZGlzcGxheV9pbnRlcmZhY2UnIGlu IGBkaXNwZXh0ZXJuLmhgISAqLworCisgIHZvaWQgKCptY19zY3JpYmVfZ2x5cGhzKSAoc3RydWN0 IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93 ICpyb3csCisgICAgICAgIHN0cnVjdCBnbHlwaCAqc3RyaW5nLCBlbnVtIGdseXBoX3Jvd19hcmVh IGFyZWEsIGludCBsZW4sIGludCB2cG9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GFu ZGxlcnMgZm9yIHNldHRpbmcgZnJhbWUgcGFyYW1ldGVycy4gICovCiAgIGZyYW1lX3Bhcm1faGFu ZGxlciAqZnJhbWVfcGFybV9oYW5kbGVyczsKIApAQCAtMzI3MCw2ICszMzcxLDY3IEBAIGV4dGVy biB2b2lkIGdldF9mb250X2FzY2VudF9kZXNjZW50IChzdHJ1Y3QgZm9udCAqLCBpbnQgKiwgaW50 ICopOwogCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK2V4dGVybiBMaXNwX09iamVj dCBtY19saXN0biAocHRyZGlmZl90LCBMaXNwX09iamVjdCwgLi4uKTsKKworZXh0ZXJuIExpc3Bf T2JqZWN0IG1jX250aCAoaW50LCBMaXNwX09iamVjdCk7CisKK2V4dGVybiBMaXNwX09iamVjdCBt Y19hc3NxIChMaXNwX09iamVjdCwgTGlzcF9PYmplY3QpOworCitleHRlcm4gdm9pZCBtY194d19j b2xvcl92YWx1ZXMgKHN0cnVjdCB3aW5kb3cgKiwgTGlzcF9PYmplY3QsIHN0cnVjdCBtY19SR0Ig Kik7CisKK2V4dGVybiBib29sIG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAoc3RydWN0IHdpbmRv dyAqLCBib29sKTsKKworZXh0ZXJuIGNoYXIgKiBtY193aW5kb3cgKHN0cnVjdCB3aW5kb3cgKik7 CisKK2V4dGVybiBjaGFyICogbWNfY2hhcl90b19zdHJpbmcgKGludCk7CisKK2V4dGVybiBjaGFy ICogbWNfY3Vyc29yX3R5cGVfdG9fc3RyaW5nIChlbnVtIHR5cGVfb2ZfY3Vyc29yKTsKKworZXh0 ZXJuIGNoYXIgKiBtY19mbGF2b3JfdG9fc3RyaW5nIChlbnVtIG1jX2ZsYXZvcik7CisKK2V4dGVy biB2b2lkIG1jX2RyYXdfZnJpbmdlX2JpdG1hcCAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5 cGhfcm93ICosIGludCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSB0 eXBlX29mX2N1cnNvcik7CisKK2V4dGVybiBpbnQgbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHN0cnVj dCB3aW5kb3cgKiwgTGlzcF9PYmplY3QsIGludCwgaW50KTsKKworZXh0ZXJuIHZvaWQgbWNfZW5n aW5lIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwgc3RydWN0IGdseXBo X3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKiwgaW50LCBpbnQs IGludCwgaW50LCBpbnQsIGludCwKKyAgICAgICAgICAgICAgICAgICAgICAgZW51bSB0eXBlX29m X2N1cnNvciwgaW50LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIGludCwKKyAgICAgICAgICAgICAg ICAgICAgICAgc3RydWN0IG1jX1JHQiwgYm9vbCwgZW51bSB0eXBlX29mX2FjdGlvbiwgYm9vbCwK KyAgICAgICAgICAgICAgICAgICAgICAgZW51bSB0eXBlX29mX2NhY2hlKTsKKworZXh0ZXJuIHZv aWQgbWNfc2V0X2Vzc2VudGlhbHMgKHN0cnVjdCB3aW5kb3cgKiwgYm9vbCwgc3RydWN0IG1jX1JH QiAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgKiwgaW50 ICopOworCitleHRlcm4gdm9pZCBtY19kcmF3X3JvdyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3Qg Z2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAg ICAgICBzdHJ1Y3QgZ2x5cGggKiwgaW50LCBpbnQsIGludCwgaW50LCBib29sLCBzdHJ1Y3QgZ2x5 cGhfbWF0cml4ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBzdHJ1Y3QgbWNfUkdC LCBzdHJ1Y3QgbWNfUkdCLCBib29sKTsKKworZXh0ZXJuIHZvaWQgbWNfcmVkcmF3X3JvdyAoc3Ry dWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCwgaW50LCBpbnQsIGJvb2wsIGVudW0gZHJh d19nbHlwaHNfZmFjZSk7CisKK2V4dGVybiB2b2lkIG1jX3Jlc2V0X2NhY2hlIChzdHJ1Y3Qgd2lu ZG93ICosIGVudW0gdHlwZV9vZl9jYWNoZSk7CisKK2V4dGVybiB2b2lkIG1jX2VyYXNlX3ByZV9z Y3JvbGxfZGlzcGxheSAoc3RydWN0IHdpbmRvdyAqKTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19j dXJzb3JfZ2x5cGggKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKiwgZW51bSBk cmF3X2dseXBoc19mYWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCwg aW50LCBpbnQsIHN0cnVjdCBtY19SR0IsIGVudW0gbWNfZmxhdm9yLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGVudW0gdHlwZV9vZl9jdXJzb3IsIGludCwgYm9vbCwgYm9vbCk7 CisKK2V4dGVybiB2b2lkIG1jX3hfd3JpdGVfZ2x5cGhzIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVj dCBnbHlwaF9tYXRyaXggKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqLCBlbnVtIGdseXBoX3Jvd19hcmVhLCBpbnQsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIHN0cnVjdCBtY19SR0IsIGVu dW0gbWNfZmxhdm9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gdHlwZV9v Zl9jdXJzb3IsIGludCwgYm9vbCwgYm9vbCk7CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICov CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAjaWZkZWYgR0xZUEhfREVCVUcKIGV4dGVy biB2b2lkIGR1bXBfZ2x5cGhfc3RyaW5nIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICopIEVYVEVSTkFM TFlfVklTSUJMRTsKICNlbmRpZgpkaWZmIC0tZ2l0IGEvc3JjL2Rpc3BuZXcuYyBiL3NyYy9kaXNw bmV3LmMKaW5kZXggY2NiMDhlYy4uMmJmMTZkNCAxMDA2NDQKLS0tIGEvc3JjL2Rpc3BuZXcuYwor KysgYi9zcmMvZGlzcG5ldy5jCkBAIC01Niw2ICs1Niw0NjYgQEAgYWxvbmcgd2l0aCBHTlUgRW1h Y3MuICBJZiBub3QsIHNlZSA8aHR0cHM6Ly93d3cuZ251Lm9yZy9saWNlbnNlcy8+LiAgKi8KICNp bmNsdWRlICJ3MzIuaCIKICNlbmRpZgogDAorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCitzdHJ1Y3QgbWNfUkdCIGNoX2ZvcmVncm91 bmQgPSB7LnJlZCA9IC0xLjAsIC5ncmVlbiA9IC0xLjAsIC5ibHVlID0gLTEuMH07CisKK3N0c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gLTE7CisgIGJvb2wgYWN0aXZlX3AgPSAodyA9PSBYV0lORE9XIChm LT5zZWxlY3RlZF93aW5kb3cpCisgICAgICAgICAgICAgICAgICAgJiYgZiA9PSBGUkFNRV9ESVNQ TEFZX0lORk8gKGYpLT54X2hpZ2hsaWdodF9mcmFtZSk7CisgIGJvb2wgY3Vyc29yX2djX3AgPSBm YWxzZTsKKyAgc3RydWN0IGdseXBoX21hdHJpeCAqZGVzaXJlZF9tYXRyaXggPSB3LT5kZXNpcmVk X21hdHJpeDsKKyAgc3RydWN0IGdseXBoX3JvdyAqYm90dG9tX3JvdyA9IE1BVFJJWF9CT1RUT01f VEVYVF9ST1cgKGRlc2lyZWRfbWF0cml4LCB3KTsKKyAgaW50IGJvdHRvbV92cG9zID0gTUFUUklY X1JPV19WUE9TIChib3R0b21fcm93LCBkZXNpcmVkX21hdHJpeCk7CisgIGlmIChkZWJ1Z19wCisg ICAgICAmJiB2cG9zICE9IGJvdHRvbV92cG9zKQorICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX3Vw ZGF0ZV90ZXh0X2FyZWEgKCVzKTogIHZwb3MgKCVkKSB8IGJvdHRvbV92cG9zICglZClcbiIsCisg ICAgICAgICAgICAgICAgICAgICAgbWNfd2luZG93ICh3KSwgdnBvcywgYm90dG9tX3Zwb3MpOwor CisgIC8qIElmIHJvd3MgYXJlIGF0IGRpZmZlcmVudCBYIG9yIFksIG9yIHJvd3MgaGF2ZSBkaWZm ZXJlbnQgaGVpZ2h0LAorICAgICBvciB0aGUgY3VycmVudCByb3cgaXMgbWFya2VkIGludmFsaWQs IHdyaXRlIHRoZSBlbnRpcmUgbGluZS4gICovCisgIGlmICghY3VycmVudF9yb3ctPmVuYWJsZWRf cAorICAgICAgfHwgZGVzaXJlZF9yb3ctPnkgIT0gY3VycmVudF9yb3ctPnkKKyAgICAgIHx8IGRl c2lyZWRfcm93LT5hc2NlbnQgIT0gY3VycmVudF9yb3ctPmFzY2VudAorICAgICAgfHwgZGVz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ZXJsYXBw aW5nX2dseXBoc19wICYmIGkgPiAwKQorICAgICAgeworICAgICAgICBzdHJ1Y3QgZ2x5cGggKmds eXBoID0gJmN1cnJlbnRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXVtpIC0gMV07CisgICAgICAgIGlu dCBsZWZ0LCByaWdodDsKKworICAgICAgICByaWYtPmdldF9nbHlwaF9vdmVyaGFuZ3MgKGdseXBo LCBYRlJBTUUgKHctPmZyYW1lKSwKKyAgICAgICAgICAmbGVmdCwgJnJpZ2h0KTsKKyAgICAgICAg Y2FuX3NraXBfcCA9IChyaWdodCA9PSAwICYmICFhYm9ydF9za2lwcGluZyk7CisgICAgICB9CisK KyAgICBpZiAoY2FuX3NraXBfcCkKKyAgICAgIHsKKyAgICAgICAgaW50IHN0YXJ0X2hwb3MgPSBp OworCisgICAgICAgIHdoaWxlIChpIDwgc3RvcAorICAgICAgICAgJiYgR0xZUEhfRVFVQUxfUCAo ZGVzaXJlZF9nbHlwaCwgY3VycmVudF9nbHlwaCkpCisgICAgeworICAgICAgaV9zdG9yZSA9IEZj b25zIChGY29ucyAobWFrZV9maXhudW0gKHgpLCBtYWtlX2ZpeG51bSAoaSkpLCBpX3N0b3JlKTsK KyAgICAgIHggKz0gZGVzaXJlZF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICArK2Rlc2lyZWRf Z2x5cGgsICsrY3VycmVudF9nbHlwaCwgKytpOworICAgIH0KKworICBpX3N0b3JlID0gRm5yZXZl cnNlIChpX3N0b3JlKTsKKworICAgICAgICAvKiBDb25zaWRlciB0aGUgY2FzZSB0aGF0IHRoZSBj dXJyZW50IHJvdyBjb250YWlucyAieHh4CisgICAgIHBwcCBnZ2ciIGluIGl0YWxpYyBDb3VyaWVy IGZvbnQsIGFuZCB0aGUgZGVzaXJlZCByb3cKKyAgICAgaXMgInh4eCBnZ2ciLiAgVGhlIGNoYXJh Y3RlciBgcCcgaGFzIGxiZWFyaW5nLCBgZycKKyAgICAgaGFzIG5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JyLCAiaV9zdG9yZTogIGNoYXIgKCVkLyVzKSB8IHg6ICgl ZCkgfCBocG9zICglZCkgfCB2cG9zICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAg dGFyZ2V0X2dseXBoLT51LmNoLCBtY19jaGFyX3RvX3N0cmluZyAodGFyZ2V0X2dseXBoLT51LmNo KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB4LCBocG9zLCB2cG9zKTsKKyAgICAgIG1jX2Ry YXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHRhcmdldF9nbHlwaCwgeCwg MSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICBib3R0b21fdnBvcywgYWN0aXZlX3AsIGN1cnNv cl9tYXRyaXgsIGZjX3gsIGNoX2ZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgZmNfZm9y ZWdyb3VuZCwgdHJ1ZSk7CisgICAgfQorCisgICAgICAgIGlmIChpID09IHN0YXJ0X2hwb3MgfHwg eCAhPSBjdXJyZW50X3gpCisgICAgeworICAgICAgaSA9IHN0YXJ0X2hwb3M7CisgICAgICB4ID0g c3RhcnRfeDsKKyAgICAgIGRlc2lyZWRfZ2x5cGggPSBzdGFydDsKKyAgICAgIGJyZWFrOworICAg IH0KKworICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9zLCBzdGFydF9ocG9zLCBkZXNp cmVkX3Jvdy0+eSwgc3RhcnRfeCk7CisKKyAgLyogUmUtZHJhdyBhIHBvcnRpb24gb2YgdGhlIHJv dy4gKi8KKworICBpZiAoZGVidWdfcAorICAgICAgJiYgdnBvcyAhPSBib3R0b21fdnBvcykKKyAg ICB7CisKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIlJFRFJBVyBTRUdNRU5UOlxuXAorICAgICAg Y2hhciAoJWQvJXMpIHwgc3RhcnRfeDogKCVkKSB8IHN0YXJ0X2hwb3MgKCVkKSB8IGxlbmd0aCAo JWQpIHwgdnBvcyAoJWQpXG4iLAorICAgICAgc3RhcnQtPnUuY2gsIG1jX2NoYXJfdG9fc3RyaW5n IChzdGFydC0+dS5jaCksCisgICAgICBzdGFydF94LCBzdGFydF9ocG9zLCBpIC0gc3RhcnRfaHBv cywgdnBvcyk7CisgICAgfQorCisgIHJpZi0+bWNfc2NyaWJlX2dseXBocyAodywgZGVzaXJlZF9t YXRyaXgsIHVwZGF0ZWRfcm93LCBzdGFydCwgVEVYVF9BUkVBLCBpIC0gc3RhcnRfaHBvcywKKyAg ICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCBib3R0b21fdnBvcywgbHNsLAorICAgICAgICAg ICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwg Y3Vyc29yX2djX3ApOworCisgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRl ZF9yb3csIHN0YXJ0LCBzdGFydF94LCBpIC0gc3RhcnRfaHBvcywKKyAgICAgICAgICAgICAgIHZw b3MsIGJvdHRvbV92cG9zLCBhY3RpdmVfcCwgY3Vyc29yX21hdHJpeCwgZmNfeCwgY2hfZm9yZWdy b3VuZCwKKyAgICAgICAgICAgICAgIGZjX2ZvcmVncm91bmQsIHRydWUpOworCisgICAgICAgIGNo YW5nZWRfcCA9IDE7CisgICAgICB9CisgIH0KKworICAgICAgLyogV3JpdGUgdGhlIHJlc3QuICAq LworICAgICAgaWYgKGkgPCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICB7CisgICAg b3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgaSwgZGVzaXJlZF9yb3ctPnksIHgpOworCisgIGlm IChkZWJ1Z19wCisgICAgICAmJiB2cG9zICE9IGJvdHRvbV92cG9zKQorICAgIHsKKyAgICAgIGZw cmludGYgKHN0ZGVyciwgIkRSQVcgUkVNQUlOREVSIE9GIFRIRSBST1c6XG5cCisgICAgICBjaGFy ICgl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bHlwaHMgZm9yIHRoZSBob3Jpem9udGFsL3ZlcnRpY2FsIHJ1bGVycyBo ZXJlLiAqLworICAgIGVsc2UgaWYgKGNoYW5nZWRfcCkKKyAgICAgIHsKKyAgICAgICAgaW50IHgg PSB3LT5vdXRwdXRfY3Vyc29yLng7CisgICAgICAgIGludCBocG9zID0gKHctPm91dHB1dF9jdXJz b3IuaHBvcyA9PSB1cGRhdGVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAgICAgICAgICAg ICAgID8gdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEKKyAgICAgICAgICAgICAgICAg ICA6IHctPm91dHB1dF9jdXJzb3IuaHBvczsKKyAgICAgICAgc3RydWN0IGdseXBoICpzdGFydCA9 IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgaHBv cywgdnBvcyk7CisgICAgICAgIGlmICh3LT5vdXRwdXRfY3Vyc29yLnggPT0gdXBkYXRlZF9yb3ct PnBpeGVsX3dpZHRoKQorICAgICAgICAgIHggLT0gc3RhcnQtPnBpeGVsX3dpZHRoOworICAgICAg ICBpZiAoZGVidWdfcCkKKyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJDSEFOR0VEIC0gRlJP TTogIGNoYXIgKCVkLyVzKSB8IHggKCVkKSB8IGhwb3MgKCVkKSAtLSBUTyBFTkQuXG4iLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQtPnUuY2gsIG1jX2NoYXJfdG9fc3RyaW5nIChz dGFydC0+dS5jaCksIHgsIGhwb3MpOworICAgICAgICBtY19kcmF3X3JvdyAodywgZGVzaXJlZF9t YXRyaXgsIHVwZGF0ZWRfcm93LCBzdGFydCwgeCwKKyAgICAgICAgICAgICAgICAgICAgIHVwZGF0 ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSBocG9zLCB2cG9zLCBib3R0b21fdnBvcywKKyAgICAg ICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBjdXJzb3JfbWF0cml4LCBmY194LCBjaF9mb3JlZ3Jv dW5kLCBmY19mb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgdHJ1ZSk7CisgICAgICB9 CisgICAgICAvKiBUaGVyZSB3ZXJlIG5vIGNoYW5nZXMgYW5kIGkgPT0gZGVzaXJlZF9yb3ctPnVz ZWRbVEVYVF9BUkVBXSAqLworICAgICAgZWxzZSBpZiAoIWNoYW5nZWRfcCkKKyAgICAgICAgewor ICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiVU5D SEFOR0VEIC0tIFdSSVRFIEVOVElSRSBMSU5FLlxuIik7CisgICAgICAgICAgbWNfZHJhd19yb3cg KHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgZGVzaXJlZF9yb3ctPmdseXBoc1tURVhU X0FSRUFdLAorICAgICAgICAgICAgICAgICAgICAgICBkZXNpcmVkX3Jvdy0+eCwgZGVzaXJlZF9y b3ctPnVzZWRbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgYm90dG9t X3Zwb3MsIGFjdGl2ZV9wLCBjdXJzb3JfbWF0cml4LCBmY194LCBjaF9mb3JlZ3JvdW5kLAorICAg ICAgICAgICAgICAgICAgICAgICBmY19mb3JlZ3JvdW5kLCB0cnVlKTsKKyAgICAgICAgfQorCisg ICAgICAvKiBNYXliZSBjbGVhciB0byBlbmQgb2YgbGluZS4gICovCisgICAgICBpZiAoTUFUUklY X1JPV19FWFRFTkRTX0ZBQ0VfUCAoZGVzaXJlZF9yb3cpKQorICB7CisgICAgLyogSWYgbmV3IHJv dyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRleHQgYXJlYSwgbm90aGluZworICAgICAgIGhh cyB0byBiZSBjbGVhcmVkLCBpZiBhbmQgb25seSBpZiB3ZSBkaWQgY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kby4gKi8KKyAg ICAgIGludCB4ID0gdXBkYXRlZF9yb3ctPnBpeGVsX3dpZHRoOworICAgICAgaW50IGhwb3MgPSB1 cGRhdGVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgICAgIGludCB4X2xpbWl0ID0gKGNs ZWFyX3RvX3ggPT0gLTEpCisgICAgICAgICAgICAgICAgICAgID8gdGV4dF9hcmVhX3dpZHRoCisg ICAgICAgICAgICAgICAgICAgIDogY2xlYXJfdG9feDsKKyAgICAgIGlmICh0cmFjZV9yZWRpc3Bs YXlfcCkKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfdXBkYXRlX3RleHRfYXJlYSAoZmxv YXRpbmcpOiAgdnBvcyAoJWQpIHwgeF9saW1pdCAoJWQpXG4iLCB2cG9zLCB4X2xpbWl0KTsKKwor ICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICYmICFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICYmICFOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2hvcml6b250YWxfcnVsZXIpKQorICAg ICAgICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAmJiB2cG9zID09IHctPmN1 cnNvci52cG9zCisgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9IE5VTEwpCisgICAgICAgIG1j X2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRF WFRfQVJFQSwgeCwgeF9saW1pdCwKKyAgICAgICAgICAgICAgICAgICB1cGRhdGVkX3Jvdy0+eSwg aHBvcywgdnBvcywgTUNfSEJBUiwgMSwgY3Vyc29yX21hdHJpeCwgZmNfeCwKKyAgICAgICAgICAg ICAgICAgICBkZWJ1Z19wID8gZGVidWdfZmcgOiBjaF9mb3JlZ3JvdW5kLCBhY3RpdmVfcCwgSE9S SVpPTlRBTF9SVUxFUiwKKyAgICAgICAgICAgICAgICAgICB0cnVlLCBOT19DQUNIRSk7CisKKyAg ICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAmJiAhTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAg ICAgJiYgeCA8IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICYmIHZwb3MgIT0gdy0+Y3Vyc29y LnZwb3MKKyAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSB4CisgICAgICAgICAgJiYgdGFyZ2V0 X2dseXBoICE9IE5VTEwpCisgICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVw ZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwKKyAgICAgICAg ICAgICAgICAgICB1cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfQkFSLCAxLCBjdXJzb3Jf bWF0cml4LCBmY194LAorICAgICAgICAgICAgICAgICAgIGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGNo X2ZvcmVncm91bmQsIGFjdGl2ZV9wLCBWRVJUSUNBTF9SVUxFUiwKKyAgICAgICAgICAgICAgICAg ICB0cnVlLCBOT19DQUNIRSk7CisKKyAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxl KSkKKyAgICAgICAgICAmJiB4IDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgJiYgZmNfeCA+ PSB4CisgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9IE5VTEwpCisgICAgICAgIG1jX2VuZ2lu ZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJF QSwgeCwgeF9saW1pdCwKKyAgICAgICAgICAgICAgICAgICB1cGRhdGVkX3Jvdy0+eSwgaHBvcywg dnBvcywgTUNfQkFSLCAxLCBjdXJzb3JfbWF0cml4LCBmY194LAorICAgICAgICAgICAgICAgICAg IGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGZjX2ZvcmVncm91bmQsIGFjdGl2ZV9wLCBGSUxMX0NPTFVN TiwKKyAgICAgICAgICAgICAgICAgICB0cnVlLCBOT19DQUNIRSk7CisKKyAgICB9CisgICAgfQor CisgIHJldHVybiBjaGFuZ2VkX3A7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBTdHJ1Y3R1cmUgdG8gcGFzcyBkaW1lbnNp b25zIGFyb3VuZC4gIFVzZWQgZm9yIGNoYXJhY3RlciBib3VuZGluZwogICAgYm94ZXMsIGdseXBo IG1hdHJpeCBkaW1lbnNpb25zIGFuZCBhbGlrZS4gICovCiAKQEAgLTMyODIsMTAgKzM3NDIsMzYg QEAgcmVkcmF3X292ZXJsYXBwZWRfcm93cyAoc3RydWN0IHdpbmRvdyAqdywgaW50IHliKQogCSAg ICB7CiAJICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgaSwgMCwgcm93LT55LAogCQkJCWFyZWEg PT0gVEVYVF9BUkVBID8gcm93LT54IDogMCk7Ci0JICAgICAgaWYgKHJvdy0+dXNlZFthcmVhXSkK KworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CisgIGlmICgody0+bWNfZWx0cy51c2VkID4gMCB8fCB3LT5jaF9lbHRzLnVzZWQgPiAwIHx8IHct PmZjX2VsdHMudXNlZCA+IDApCisgICAgICAmJiBhcmVhID09IFRFWFRfQVJFQQorICAgICAgJiYg cm93LT51c2VkW2FyZWFdKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJp eCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgaW50IHN0YXJ0X3ggPSByb3ctPng7CisgICAg ICBpbnQgc3RhcnRfaHBvcyA9IDA7CisgICAgICBpbnQgZW5kX2hwb3MgPSByb3ctPnVzZWRbYXJl YV07CisgICAgICBib29sIGNsZWFyX2VvbF9wID0gdHJ1ZTsKKyAgICAgIGVudW0gZHJhd19nbHlw aHNfZmFjZSBobCA9IERSQVdfTk9STUFMX1RFWFQ7CisgICAgICBUUkFDRSAoKHN0ZGVyciwgInJl ZHJhd19vdmVybGFwcGVkX3Jvd3MgKCVkKTogIHN0YXJ0X3ggKCVkKSB8IHN0YXJ0X2hwb3MgKCVk KSB8IGVuZF9ocG9zICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgaSwgc3RhcnRfeCwg c3RhcnRfaHBvcywgZW5kX2hwb3MpKTsKKyAgICAgIG1jX3JlZHJhd19yb3cgKHcsIG1hdHJpeCwg cm93LCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcywgY2xlYXJfZW9sX3AsIGhsKTsKKyAg ICB9CisgICAgZWxzZSBpZiAocm93LT51c2VkW2FyZWFdKQorICAgICAgewogCQlGUkFNRV9SSUYg KGYpLT53cml0ZV9nbHlwaHMgKHcsIHJvdywgcm93LT5nbHlwaHNbYXJlYV0sCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmVhLCByb3ctPnVzZWRbYXJlYV0p OwogCSAgICAgIEZSQU1FX1JJRiAoZiktPmNsZWFyX2VuZF9vZl9saW5lICh3LCByb3csIGFyZWEs IC0xKTsKKyAgICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICB9CiAK IAkgIHJvdy0+b3ZlcmxhcHBlZF9wID0gMDsKQEAgLTMzODgsNiArMzg3NCwyOCBAQCBzdGF0aWMg Ym9vbAogdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogewog ICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpkZXNpcmVkX21hdHJpeCA9IHctPmRlc2lyZWRfbWF0cml4 OworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09S UyAqLworCisgIGlmICh0cmFjZV9yZWRpc3BsYXlfcCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJ1 cGRhdGVfd2luZG93ICglcylcbiIsIG1jX3dpbmRvdyAodykpOworCisgIGN1cnNvcl9tYXRyaXgg PSBOVUxMOworCisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBib29s IGFjdGl2ZV9wID0gKHcgPT0gWFdJTkRPVyAoZi0+c2VsZWN0ZWRfd2luZG93KQorICAgICAgICAg ICAgICAgICAgICYmIGYgPT0gRlJBTUVfRElTUExBWV9JTkZPIChmKS0+eF9oaWdobGlnaHRfZnJh bWUpOworCisgIG1jX3NldF9lc3NlbnRpYWxzICh3LCBhY3RpdmVfcCwgJmNoX2ZvcmVncm91bmQs ICZmY19mb3JlZ3JvdW5kLCAmZmNfeCk7CisKKyAgbWNfZXJhc2VfcHJlX3Njcm9sbF9kaXNwbGF5 ICh3KTsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgYm9vbCBwYXVzZWRfcDsKICAgaW50IHByZWVtcHRfY291bnQgPSBjbGlwX3Rv X2JvdW5kcyAoMSwgYmF1ZF9yYXRlIC8gMjQwMCArIDEsIElOVF9NQVgpOwogICBzdHJ1Y3QgcmVk aXNwbGF5X2ludGVyZmFjZSAqcmlmID0gRlJBTUVfUklGIChYRlJBTUUgKFdJTkRPV19GUkFNRSAo dykpKTsKQEAgLTM0NjAsNiArMzk2OCw0MSBAQCB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2luZG93 ICp3LCBib29sIGZvcmNlX3ApCiAJICAgIH0KIAl9CiAKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogUHJvY2VzcyB0aGUgY3Vyc29yIHJv dyBhdCB0aGUgb3V0c2V0IGlmIGl0IGlzIHdpdGhpbiBgZGVzaXJlZF9tYXRyaXhgLgorICBXaGVu IHByb2Nlc3NpbmcgYWxsIG90aGVyIHJvd3MsIHdlIHdpbGwgcXVlcnkgdGhlIGB3LT5jdXJyZW50 X21hdHJpeGAgZm9yIGRhdGEKKyAgcmVsYXRpbmcgdG8gdGhlIGN1cnNvciByb3cuICBgbWFrZV9j dXJyZW50YCAod2l0aGluIGB1cGRhdGVfd2luZG93X2xpbmUnKQorICB1cGRhdGVzIHRoZSBgdy0+ Y3VycmVudF9tYXRyaXhgIGZvciB0aGUgYXBwbGljYWJsZSByb3cuICBJbiBkb2luZyBzbywgaG93 ZXZlciwKKyAgdGhlIGFwcGxpY2FibGUgcm93IGluIHRoZSBkZXNpcmVkIG1hdHJpeCBpcyBhbHRl cmVkIHN1Y2ggdGhhdCB3ZSBjYW4gbm8gbG9uZ2VyCisgIHJlbHkgdXBvbiB0aGUgYWNjdXJhY3kg b2YgYFJPVy0+dXNlZFtURVhUX0FSRUFdYC4gIFRoZXJlZm9yZSwgd2UgbXVzdCBub3cgcmVseQor ICBleGNsdXNpdmVseSB1cG9uIGB3LT5jdXJyZW50X21hdHJpeCcgZm9yIGN1cnNvciByb3cgYmFz ZWQgZGVjaXNpb25zLiAqLworICBmb3IgKHN0cnVjdCBnbHlwaF9yb3cgKm1jX3JvdyA9IHJvdzsK KyAgICAgICBtY19yb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3BlbmRpbmcpOworICAg ICAgICsrbWNfcm93KQorICAgIHsKKyAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TICht Y19yb3csIGRlc2lyZWRfbWF0cml4KTsKKyAgICAgIGlmIChtY19yb3ctPmVuYWJsZWRfcAorICAg ICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgIHsKKyAgICAgICAgICBj dXJzb3JfbWF0cml4ID0gZGVzaXJlZF9tYXRyaXg7CisgICAgICAgICAgaWYgKCFmb3JjZV9wICYm ICsrbl91cGRhdGVkICUgcHJlZW1wdF9jb3VudCA9PSAwKQorICAgICAgICAgICAgZGV0ZWN0X2lu cHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgpOworICAgICAgICAgIGNoYW5nZWRfcCB8 PSB1cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3Ap OworICAgICAgICAgIGlmIChNQVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHliKQorICAgICAg ICAgICAgZm9yIChpbnQgaSA9IHZwb3MgKyAxOyBpIDwgdy0+Y3VycmVudF9tYXRyaXgtPm5yb3dz IC0gMTsgKytpKQorICAgICAgICAgICAgICBTRVRfTUFUUklYX1JPV19FTkFCTEVEX1AgKHctPmN1 cnJlbnRfbWF0cml4LCBpLCBmYWxzZSk7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAg ICB9CisKKyAgY3Vyc29yX21hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAgICAgICAvKiBVcGRhdGUgdGhlIHJlc3Qgb2YgdGhlIGxpbmVz LiAgKi8KICAgICAgIGZvciAoOyByb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3BlbmRp bmcpOyArK3JvdykKIAkvKiBzY3JvbGxpbmdfd2luZG93IHJlc2V0cyB0aGUgZW5hYmxlZF9wIGZs YWcgb2YgdGhlIHJvd3MgaXQKQEAgLTM0NjcsNiArNDAxMCwxOSBAQCB1cGRhdGVfd2luZG93IChz dHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAJaWYgKHJvdy0+ZW5hYmxlZF9wKQogCSAg ewogCSAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBkZXNpcmVkX21hdHJpeCk7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgLyogSWYgdGhlIGBjdXJzb3Jfcm93YCBpcyB3aXRoaW4gdGhlIGBkZXNpcmVkX21hdHJpeGAs IHRoZW4gaXQgd2FzIHByb2NlZWQKKyAgaGVyZWluYWJvdmUgYW5kIHNob3VsZCBiZSBza2lwcGVk IGF0IHRoaXMgdGltZS4gKi8KKyAgaWYgKHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgY29u dGludWU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgaW50IGk7CiAKIAkg ICAgLyogV2UnbGwgaGF2ZSB0byBwbGF5IGEgbGl0dGxlIGJpdCB3aXRoIHdoZW4gdG8KQEAgLTM0 OTcsNiArNDA1Myw0MyBAQCB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZv cmNlX3ApCiAKICAgICBzZXRfY3Vyc29yOgogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIElmIHdlIGp1bXBlZCBoZXJlIGZyb20gYHNl dF9jdXJzb3JgLCB0aGVuIHNldCB0aGUgYGN1cnNvcl9tYXRyaXhgLiAqLworICBpZiAoY3Vyc29y X21hdHJpeCA9PSBOVUxMKQorICAgIGN1cnNvcl9tYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsK KworICAvKiBSZXNldCBgcm93YCB0byAwIHNvIHRoYXQgZmFrZSBjdXJzb3JzIGNhbiBiZSBkcmF3 biBvbiByb3dzIHByZWNlZGluZyB0aGUKKyAgZmlyc3QgYHJvdy0+ZW5hYmxlZF9wYC4gIEp1c3Qg cHJpb3IgdG8gdGhlIGNhbGwgdG8gYHNjcm9sbGluZ193aW5kb3cnIGFib3ZlLAorICBgcm93YCB3 YXMgYWR2YW5jZWQgdG8gdGhlIGZpcnN0IGByb3ctPmVuYWJsZWRfcGAuICovCisgIGZvciAoc3Ry dWN0IGdseXBoX3JvdyAqZGVzaXJlZF9yb3cgPSBNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJpeCwg MCk7CisgICAgICAgZGVzaXJlZF9yb3cgPCBlbmQKKyAgICAgICAmJiAoZm9yY2VfcCB8fCAhaW5w dXRfcGVuZGluZykKKyAgICAgICAvKiBOVCBFbWFjcyBjcmFzaGVzIG9uIHN0YXJ0dXAgd2l0aG91 dCBhIEJVRkZFUlAgY2hlY2suICovCisgICAgICAgJiYgQlVGRkVSUCAody0+Y29udGVudHMpCisg ICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQor ICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hh aXJzKSkKKyAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg ZmNfdmlzaWJsZSkpKTsKKyAgICAgICArK2Rlc2lyZWRfcm93KQorICAgeworICAgICBpbnQgdnBv cyA9IE1BVFJJWF9ST1dfVlBPUyAoZGVzaXJlZF9yb3csIGRlc2lyZWRfbWF0cml4KTsKKyAgICAg aWYgKGRlc2lyZWRfcm93LT5lbmFibGVkX3ApCisgICAgICAgY29udGludWU7CisgICAgIHN0cnVj dCBnbHlwaF9yb3cgKmJvdHRvbV9yb3cgPSBNQVRSSVhfQk9UVE9NX1RFWFRfUk9XICh3LT5jdXJy ZW50X21hdHJpeCwgdyk7CisgICAgIGludCBib3R0b21fdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAo Ym90dG9tX3Jvdywgdy0+Y3VycmVudF9tYXRyaXgpOworICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpj dXJyZW50X3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAgICAg aWYgKGN1cnJlbnRfcm93LT5lbmFibGVkX3ApCisgICAgICAgbWNfZHJhd19yb3cgKHcsIHctPmN1 cnJlbnRfbWF0cml4LCBjdXJyZW50X3JvdywgY3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FSRUFd LAorICAgICAgICAgICAgICAgICAgICBjdXJyZW50X3Jvdy0+eCwgY3VycmVudF9yb3ctPnVzZWRb VEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgYm90dG9tX3Zwb3MsIGFjdGl2 ZV9wLCBjdXJzb3JfbWF0cml4LCBmY194LCBjaF9mb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAg ICAgICBmY19mb3JlZ3JvdW5kLCB0cnVlKTsKKyAgIH0KKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICAgICAgLyogVXBkYXRlIHRoZSBoZWFkZXIgbGluZSBhZnRlciBzY3JvbGxpbmcg YmVjYXVzZSBhIG5ldyBoZWFkZXIKIAkgbGluZSB3b3VsZCBvdGhlcndpc2Ugb3ZlcndyaXRlIGxp bmVzIGF0IHRoZSB0b3Agb2YgdGhlIHdpbmRvdwogCSB0aGF0IGNhbiBiZSBzY3JvbGxlZC4gICov CkBAIC0zNTMxLDEwICs0MTI0LDIxIEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncs IGJvb2wgZm9yY2VfcCkKICAgICAgIHN0cmNweSAody0+Y3VycmVudF9tYXRyaXgtPm1ldGhvZCwg dy0+ZGVzaXJlZF9tYXRyaXgtPm1ldGhvZCk7CiAjZW5kaWYKIAorCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogI2lmZGVmIEhBVkVfV0lORE9XX1NZ U1RFTQorICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAmJiAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgbWNfdXBkYXRlX3dpbmRv d19mcmluZ2VzICh3LCAwKTsKKyAgICBlbHNlCiAgICAgICB1cGRhdGVfd2luZG93X2ZyaW5nZXMg KHcsIDApOwogI2VuZGlmCiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIC8q IEVuZCB0aGUgdXBkYXRlIG9mIHdpbmRvdyBXLiAgRG9uJ3Qgc2V0IHRoZSBjdXJzb3IgaWYgd2UK ICAgICAgICAgIHBhdXNlZCB1cGRhdGluZyB0aGUgZGlzcGxheSBiZWNhdXNlIGluIHRoaXMgY2Fz ZSwKICAgICAgICAgIHNldF93aW5kb3dfY3Vyc29yX2FmdGVyX3VwZGF0ZSBoYXNuJ3QgYmVlbiBj YWxsZWQsIGFuZApAQCAtMzg1MiwxNCArNDQ1NiwyOCBAQCB1cGRhdGVfd2luZG93X2xpbmUgKHN0 cnVjdCB3aW5kb3cgKncsIGludCB2cG9zLCBib29sICptb3VzZV9mYWNlX292ZXJ3cml0dGVuX3Ap CiAJICBjdXJyZW50X3Jvdy0+cmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AgPSAxOwogCX0KIAorCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBib29s IHVwZGF0ZWRfcCA9IChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAg JiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAg ICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg Y3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICB8fCAhIE5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKSkKKyAgICAgICAgICAgICAgICAgICA/ IG1jX3VwZGF0ZV90ZXh0X2FyZWEgKHcsIGRlc2lyZWRfcm93LCB2cG9zKQorICAgICAgICAgICAg ICAgICAgIDogdXBkYXRlX3RleHRfYXJlYSAodywgZGVzaXJlZF9yb3csIHZwb3MpOworCiAgICAg ICAvKiBVcGRhdGUgdGhlIGRpc3BsYXkgb2YgdGhlIHRleHQgYXJlYS4gICovCi0gICAgICBpZiAo dXBkYXRlX3RleHRfYXJlYSAodywgZGVzaXJlZF9yb3csIHZwb3MpKQorICAgICAgaWYgKHVwZGF0 ZWRfcCkKIAl7CiAJICBjaGFuZ2VkX3AgPSAxOwogCSAgaWYgKGN1cnJlbnRfcm93LT5tb3VzZV9m YWNlX3ApCiAJICAgICptb3VzZV9mYWNlX292ZXJ3cml0dGVuX3AgPSAxOwogCX0KIAorLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogICAgICAgLyogVXBkYXRlIGRpc3BsYXkgb2YgdGhlIHJp Z2h0IG1hcmdpbiBhcmVhLCBpZiB0aGVyZSBpcyBvbmUuICAqLwogICAgICAgaWYgKCFkZXNpcmVk X3Jvdy0+ZnVsbF93aWR0aF9wICYmIHctPnJpZ2h0X21hcmdpbl9jb2xzID4gMCkKIAl7CmRpZmYg LS1naXQgYS9zcmMvZnJhbWUuaCBiL3NyYy9mcmFtZS5oCmluZGV4IGVjOGY2MTQuLmVlYWY3MWUg MTAwNjQ0Ci0tLSBhL3NyYy9mcmFtZS5oCisrKyBiL3NyYy9mcmFtZS5oCkBAIC0yMDUsNiArMjA1 LDE2IEBAIHN0cnVjdCBmcmFtZQogICBMaXNwX09iamVjdCB0b29sX2Jhcl9pdGVtczsKICAgLyog dG9vbF9iYXJfaXRlbXMgc2hvdWxkIGJlIHRoZSBsYXN0IExpc3BfT2JqZWN0IG1lbWJlci4gICov CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgLyogTm9uLW5pbCB3aGVuIHRoZSBmcmFtZSBpcyBpbiB0aGUgcHJvY2VzcyBvZiBiZWluZyB1 cGRhdGVkLiAqLworICBzdHJ1Y3QgZnJhbWUgKm1jX3VwZGF0aW5nX2ZyYW1lOworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAgIC8qIENhY2hlIG9mIHJlYWxpemVkIGZhY2VzLiAgKi8K ICAgc3RydWN0IGZhY2VfY2FjaGUgKmZhY2VfY2FjaGU7CiAKZGlmZiAtLWdpdCBhL3NyYy9mcmlu Z2UuYyBiL3NyYy9mcmluZ2UuYwppbmRleCAzMzVhNmViLi4wZGJlYTVmIDEwMDY0NAotLS0gYS9z cmMvZnJpbmdlLmMKKysrIGIvc3JjL2ZyaW5nZS5jCkBAIC00MzgsNiArNDM4LDQ2MCBAQCBzdGF0 aWMgdW5zaWduZWQgc2hvcnQgZW1wdHlfbGluZV9iaXRzW10gPSB7CiAjZGVmaW5lIFNUQU5EQVJE X0JJVE1BUF9IRUlHSFQoYml0cykgKHNpemVvZiAoYml0cykvQllURVNfUEVSX0JJVE1BUF9ST1cp CiAjZGVmaW5lIEZSQklUUyhiaXRzKSAgYml0cywgU1RBTkRBUkRfQklUTUFQX0hFSUdIVCAoYml0 cykKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNVUlNP UlMgKi8KKworLyogYCstZnJpbmdlLWhlbHBlci1kZWNpbWFsJyBkZWZpbmVkIGluIGBjcm9zc2hh aXJzLmVsYCAqLworCisvKiBUT0RPOiAgQ29uc2lkZXIgYWRkaW5nIHRoZSBmb2xsb3dpbm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gorICAgICAgIi4uLnh4Lnh4IgorICAgICAgIi4ueHguLnh4IgorICAgICAg Ii54eC4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4u Li4uLnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcmV2ZXJzZWRfdmVydGljYWxf YmFyX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweDMsIDB4MywgMHgzLCAweDYzLCAweDMzLCAw eDFiLCAweGZmLCAweGZmLCAweDFiLCAweDMzLCAweDYzLCAweDMsIDB4MywgMHgzfTsKKworLyog MjYKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgiCisg ICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4ueHguLngiCisgICAg ICAieC4uLnh4LngiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC54eHh4eHgiCisgICAgICAi eC54eHh4eHgiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC4uLnh4LngiCisgICAgICAieC4u eHguLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieHh4eHh4 eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0 X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDk5LCAweDhkLCAweDg3LCAw eGJmLAorICAweGJmLCAweDg3LCAweDhkLCAweDk5LCAweDgxLCAweDgxLCAweGZmfTsKKworLyog MjcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgiCisg ICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC54eC4ueHgiCisgICAg ICAieC4ueHgueHgiCisgICAgICAieC4uLnh4eHgiCisgICAgICAieHh4eHh4eHgiCisgICAgICAi eHh4eHh4eHgiCisgICAgICAieC4uLnh4eHgiCisgICAgICAieC4ueHgueHgiCisgICAgICAieC54 eC4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieHh4eHh4 eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19yZXZlcnNlZF9ob2xsb3dfcmVjdGFu Z2xlX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweGIxLCAweDk5 LCAweDhkLCAweGZmLAorICAweGZmLCAweDhkLCAweDk5LCAweGIxLCAweDgxLCAweDgxLCAweGZm fTsKKworLyogMjgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4 eHh4eHgiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4u LngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngi CisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisg ICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAg ICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3dfcmVjdGFu Z2xlX2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgx LAorICAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweGZmfTsKKworLyogMjkK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4uLi4iCisgICAg ICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAi eC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4u Li4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4u Li4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4i KQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9iYXJfYml0c1tdID17Cisg IDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsCisgIDB4ODAsIDB4ODAs IDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODB9OworCisvKiAzMAorICAgICgrLWZyaW5nZS1o ZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAg ICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAg ICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIu Li4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4u Li54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGljIHVu c2lnbmVkIHNob3J0IG1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9iaXRzW10gPXsKKyAgMHgzLCAw eDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgz LCAweDN9OworCisvKiAzMQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAg ICJ4eC4uLi4uLiIKKyAgICAgICJ4eC4uLi4uLiIKKyAgICAgICIgeHguLi4uLiIKKyAgICAgICIu eHguLi4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIuLi54 eC4uLiIKKyAgICAgICIuLi54eC4uLiIKKyAgICAgICIuLi4ueHguLiIKKyAgICAgICIuLi4ueHgu LiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLi54eCIK KyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2JhY2tzbGFz aF9iaXRzW10gPXsKKyAgMHhjMCwgMHhjMCwgMHhlMCwgMHg2MCwgMHgzMCwgMHgzMCwgMHgxOCwg MHgxOCwgMHhjLCAweGMsIDB4NiwgMHg2LCAweDMsIDB4M307CisKKy8qIDMyCisgICAgKCstZnJp bmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgorICAgICAgInh4Li4uLi4u IgorICAgICAgInh4eC4uLi4uIgorICAgICAgInh4eC4uLi4uIgorICAgICAgIngueHguLi4uIgor ICAgICAgIngueHguLi4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLnh4Li4uIgorICAg ICAgInguLi54eC4uIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLi4ueHguIgorICAgICAg InguLi4ueHguIgorICAgICAgInguLi4uLnh4IgorICAgICAgInguLi4uLnh4IikKKyovCitzdGF0 aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaF9iaXRzW10gPXsKKyAg MHhjMCwgMHhjMCwgMHhlMCwgMHhlMCwgMHhiMCwgMHhiMCwgMHg5OCwKKyAgMHg5OCwgMHg4Yywg MHg4YywgMHg4NiwgMHg4NiwgMHg4MywgMHg4M307CisKKy8qIDMzCisgICAgKCstZnJpbmdlLWhl bHBlci1oZXhhZGVjaW1hbAorICAgICAgIi54eHh4eHguIgorICAgICAgInh4eHgueC4uIgorICAg ICAgInh4eHgueC4uIgorICAgICAgInh4eHgueC4uIgorICAgICAgIi54eHgueC4uIgorICAgICAg Ii4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4u LngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIikKKyovCitzdGF0aWMg dW5zaWduZWQgc2hvcnQgbWNfcGlsY3Jvd19iaXRzW10gPXsKKyAgMHg3ZSwgMHhmNCwgMHhmNCwg MHhmNCwgMHg3NCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNH07CisKKy8qIDM0 CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4ueHh4eC4uIgorICAg ICAgIi54eHh4eHguIgorICAgICAgInguLnh4Li54IgorICAgICAgInguLnh4Li54IgorICAgICAg Inh4eHh4eHh4IgorICAgICAgInh4Li4uLnh4IgorICAgICAgInh4eC4ueHh4IgorICAgICAgIi54 eHh4eHguIgorICAgICAgIi4ueHh4eC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNf c21pbGV5X2ZhY2VfYml0c1tdID17CisgIDB4M2MsIDB4N2UsIDB4OTksIDB4OTksIDB4ZmYsIDB4 YzMsIDB4ZTcsIDB4N2UsIDB4M2N9OworCisvKiAzNQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4 YWRlY2ltYWwKKyAgICAgICIuLnguLi4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4u eC4uLiIKKyAgICAgICIuLi4uLnguLiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIuLi54Li4u LiIKKyAgICAgICIuLnguLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3Npbmds ZV9hbmdsZV9yaWdodF9iaXRzW10gPXsKKyAgMHgyMCwgMHgxMCwgMHg4LCAweDQsIDB4OCwgMHgx MCwgMHgyMH07CisKKy8qIDM2CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAg ICAgIi4uLi4ueC4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAg Ii4ueC4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4u Li4ueC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX2xlZnRf Yml0c1tdID17CisgIDB4NCwgMHg4LCAweDEwLCAweDIwLCAweDEwLCAweDgsIDB4NH07CisKKy8q IDM3CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Lnh4Li4uIgor ICAgICAgIi54eC54eC4uIgorICAgICAgIi4ueHgueHguIgorICAgICAgIi4uLnh4Lnh4IgorICAg ICAgIi4ueHgueHguIgorICAgICAgIi54eC54eC4uIgorICAgICAgInh4Lnh4Li4uIikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAw eGQ4LCAweDZjLCAweDM2LCAweDFiLCAweDM2LCAweDZjLCAweGQ4fTsKKworLyogMzgKKyAgICAo Ky1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4ueHgueHgiCisgICAgICAiLi54 eC54eC4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAieHgueHguLi4iCisgICAgICAiLnh4Lnh4 Li4iCisgICAgICAiLi54eC54eC4iCisgICAgICAiLi4ueHgueHgiKQorKi8KK3N0YXRpYyB1bnNp Z25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxYiwgMHgzNiwg MHg2YywgMHhkOCwgMHg2YywgMHgzNiwgMHgxYn07CisKKy8qIDM5CisgICAgKCstZnJpbmdlLWhl bHBlci1oZXhhZGVjaW1hbAorICAgICAgIngueC54Li4uIgorICAgICAgIi54LngueC4uIgorICAg ICAgIi4ueC54LnguIgorICAgICAgIi4uLngueC54IgorICAgICAgIi4ueC54LnguIgorICAgICAg Ii54LngueC4uIgorICAgICAgIngueC54Li4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQg bWNfdHJpcGxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAweGE4LCAweDU0LCAweDJhLCAweDE1 LCAweDJhLCAweDU0LCAweGE4fTsKKworLyogNDAKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFk ZWNpbWFsCisgICAgICAiLi4ueC54LngiCisgICAgICAiLi54LngueC4iCisgICAgICAiLngueC54 Li4iCisgICAgICAieC54LnguLi4iCisgICAgICAiLngueC54Li4iCisgICAgICAiLi54LngueC4i CisgICAgICAiLi4ueC54LngiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVf YW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxNSwgMHgyYSwgMHg1NCwgMHhhOCwgMHg1NCwgMHgy YSwgMHgxNX07CisKKy8qIDQxCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAg ICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAg Ii4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54 Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4u Li4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5z aWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAwLCAweDAwLCAw eDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDgyLCAweDAwLCAweDAwLCAweDAwLCAweDAw fTsKKworLyogNDIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4u Li4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4u Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4i CisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisg ICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY19zaW5nbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwg MHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMH07CisK Ky8qIDQzCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4u IgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAg ICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAg Ii4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0 aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAwLCAw eDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyLCAweDAw LCAweDAwLCAweDAwfTsKKworLyogNDQKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFs CisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisg ICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAg ICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAi Li4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4u Li4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfZG93bl9i aXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0 NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwgMHgwMH07CisKKy8qIDQ1CisgICAgKCstZnJpbmdl LWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAg ICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAg Ii4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi4u Li4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdHJpcGxlX2FuZ2xlX3VwX2Jp dHNbXSA9eworICAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDky LCAweDI4LCAweDQ0LCAweDgyLCAweDAwfTsKKworLyogNDYKKyAgICAoKy1mcmluZ2UtaGVscGVy LWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAi LnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLngu Li54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54 Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4i KQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVwbGVfYW5nbGVfZG93bl9iaXRz W10gPXsKKyAgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5Miwg MHg0NCwgMHgyOCwgMHgxMCwgMHgwMH07CisKKy8qIDQ3CisgICAgKCstZnJpbmdlLWhlbHBlci1o ZXhhZGVjaW1hbAorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54 Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4u eC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4u IgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgor ICAgICAgInguLi4uLnguIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcXVhZHJ1cGxl X2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0 LCAweDkyLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyfTsKKworLyogNDgKKyAg ICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4ueC4iCisgICAgICAi LnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLngu Li54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54 Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ue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ZJWE5V TSAoRmxlbmd0aCAoYm0xKSk7CisgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgeworICAgICAg aWYgKGxuMSA+IGl4MikKKyAgICAgICAgeworICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJt MSk7CisgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgIGdvdG8gZm91bmQ7CisgICAg ICAgIH0KKyAgICB9CisgICAgICAgIGVsc2UKKyAgICB7CisgICAgICBpZiAobG4xID4gaXgxKQor ICAgICAgICB7CisgICAgICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsKKyAgICAgICAgICBp ZiAoIUVRIChibSwgUXQpKQorICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgfQorICAgIH0KKyAg ICAgIH0KKyAgICBlbHNlIGlmICgoYm0gPSBibTEsICFFUSAoYm0sIFF0KSkpCisgICAgICBnb3Rv IGZvdW5kOworICB9CisgICAgfQorICBpZiAoIUVRIChjbWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1 bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkKKyAgICAgICYmICFOSUxQIChCVkFSICgmYnVm ZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkpCisgICAgeworICAgICAgYm0y ID0gbWNfYXNzcSAoYml0bWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNh dG9yX2FsaXN0KSk7CisgICAgICBpZiAoQ09OU1AgKGJtMikpCisgIHsKKyAgICBpZiAoKGJtMiA9 IFhDRFIgKGJtMikpLCAhTklMUCAoYm0yKSkKKyAgICAgIHsKKyAgICAgICAgaWYgKENPTlNQIChi bTIpKQorICAgIHsKKyAgICAgIGxuMiA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMikpOworICAgICAg aWYgKHBhcnRpYWxfcCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChsbjIgPiBpeDIpCisgICAg ICB7CisgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMik7CisgICAgICAgIGlmICghRVEgKGJt LCBRdCkpCisgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgIH0KKyAgICAgICAgfQorICAgIH0K KyAgICAgIH0KKyAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4MSkKKyAgICB7CisgICAgICBibSA9 IG1jX250aCAoaXgxLCBibTEpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgZ290byBmb3Vu ZDsKKyAgICB9CisgIGlmIChsbjIgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19udGggKGl4 MSwgYm0yKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgIGdvdG8gZm91bmQ7CisgICAgICBy ZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICB9CisgIGVsc2UgaWYgKChibSA9IGJtMiwg TklMUCAoYm0pKSkKKyAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyBmb3VuZDoKKyAg cmV0dXJuIGxvb2t1cF9mcmluZ2VfYml0bWFwIChibSk7Cit9CisKK3N0YXRpYyBpbnQKK21jX2dl dF9sb2dpY2FsX2N1cnNvcl9iaXRtYXAgKHN0cnVjdCB3aW5kb3cgKncsIExpc3BfT2JqZWN0IGN1 cnNvcikKK3sKKyAgTGlzcF9PYmplY3QgY21hcCwgYm0gPSBRbmlsOworICBpZiAoKGNtYXAgPSBC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZyaW5nZV9jdXJzb3JfYWxpc3QpKSwgIU5JTFAg KGNtYXApKQorICAgIHsKKyAgICAgIGJtID0gbWNfYXNzcSAoY3Vyc29yLCBjbWFwKTsKKyAgICAg IGlmIChDT05TUCAoYm0pKQorICAgICAgICB7CisgICAgICAgICAgaWYgKChibSA9IFhDRFIgKGJt KSksIE5JTFAgKGJtKSkKKyAgICAgICAgICAgIHJldHVybiBNQ19OT19G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SB1c2UgZm9yIGxlZnQgcmlnaHQgcGFydGlhbC1sZWZ0IHBhcnRpYWwtcmln aHQKKyAgSWYgYW55IHZhbHVlIGluIGxvY2FsIGJpbmRpbmcgaXMgbm90IHByZXNlbnQgb3IgdCwg dXNlIGdsb2JhbCB2YWx1ZS4KKyAgICAgSWYgcGFydGlhbCwgbG9va3VwIHBhcnRpYWwgYml0bWFw IGluIGRlZmF1bHQgdmFsdWUgaWYgbm90IGZvdW5kIGhlcmUuCisgICAgIElmIG5vdCBwYXJ0aWFs LCBvciBubyBwYXJ0aWFsIHNwZWMgaXMgcHJlc2VudCwgdXNlIG5vbi1wYXJ0aWFsIGJpdG1hcC4g ICovCisgIGlmICgoY21hcCA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZnJpbmdlX2lu ZGljYXRvcl9hbGlzdCkpLCAhTklMUCAoY21hcCkpCisgICAgeworICAgICAgYm0xID0gbWNfYXNz cSAoYml0bWFwLCBjbWFwKTsKKyAgICAgIGlmIChDT05TUCAoYm0xKSkKKyAgICAgICAgeworICAg ICAgICAgIGlmICgoYm0xID0gWENEUiAoYm0xKSksIE5JTFAgKGJtMSkpCisgICAgICAgICAgICBy ZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICBpZiAoQ09OU1AgKGJtMSkpCisg ICAgICAgICAgICB7CisgICAgICAgICAgICAgIGxuMSA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMSkp OworICAgICAgICAgICAgICBpZiAocGFydGlhbF9wKQorICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgIGlmIChsbjEgPiBpeDIpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgyLCBibTEpOworICAgICAgICAgICAgICAg ICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOwor ICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKGxuMSA+IGl4MSkK KyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRo IChpeDEsIGJtMSk7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAg ICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAoKGJtID0gYm0x LCAhRVEgKGJtLCBRdCkpKQorICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgfQorICAg IH0KKyAgaWYgKCFFUSAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGlj YXRvcl9hbGlzdCkpCisgICAgICAmJiAhTklMUCAoQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJp bmdlX2luZGljYXRvcl9hbGlzdCkpKQorICAgIHsKKyAgICAgIGJtMiA9IG1jX2Fzc3EgKGJpdG1h cCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpOworICAg ICAgaWYgKENPTlNQIChibTIpKQorICAgICAgICB7CisgICAgICAgICAgaWYgKChibTIgPSBYQ0RS IChibTIpKSwgIU5JTFAgKGJtMikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChD T05TUCAoYm0yKSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBsbjIgPSBYRklYTlVNIChGbGVu Z3RoIChibTIpKTsKKyAgICAgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICBpZiAobG4yID4gaXgyKQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICBibSA9IG1jX250aCAoaXgyLCBibTIpOworICAgICAgICAgICAgICBpZiAoIUVRIChibSwg UXQpKQorICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICB9CisgICAgICAg ICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cisg IGlmIChsbjEgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsKKyAg ICAgIGlmICghRVEgKGJtLCBRdCkpCisgIGdvdG8gZm91bmQ7CisgICAgfQorICBpZiAobG4yID4g aXgxKQorICAgIHsKKyAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMik7CisgICAgICBpZiAoIUVR IChibSwgUXQpKQorICAgICAgICBnb3RvIGZvdW5kOworICAgICAgcmV0dXJuIE1DX05PX0ZSSU5H RV9CSVRNQVA7CisgICAgfQorICAgIGVsc2UgaWYgKChibSA9IGJtMiwgTklMUCAoYm0pKSkKKyAg ICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyBmb3VuZDoKKyAgcmV0dXJuIGxvb2t1cF9m cmluZ2VfYml0bWFwIChibSk7Cit9CisKKy8qIFJlY2FsY3VsYXRlIHRoZSBiaXRtYXBzIHRvIHNo b3cgaW4gdGhlIGZyaW5nZXMgb2Ygd2luZG93IFcuCisgICBPbmx5IG1hcmsgcm93cyB3aXRoIG1v ZGlmaWVkIGJpdG1hcHMgZm9yIHVwZGF0ZSBpbiByZWRyYXdfZnJpbmdlX2JpdG1hcHNfcC4KKyAg IElmIEtFRVBfQ1VSUkVOVF9QIGlzIDAsIHVwZGF0ZSBjdXJyZW50X21hdHJpeCB0b28uICovCiti b29sCittY191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wga2Vl cF9jdXJyZW50X3ApCit7CisgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgKmN1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mQgPSBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGluZGlj YXRlX2J1ZmZlcl9ib3VuZGFyaWVzKSwgIU5JTFAgKGluZCkpKQorICAgIHsKKyAgICAgIGlmIChF USAoaW5kLCBRbGVmdCkgfHwgRVEgKGluZCwgUXJpZ2h0KSkKKyAgICAgICAgYm91bmRhcnlfdG9w ID0gYm91bmRhcnlfYm90ID0gYXJyb3dfdG9wID0gYXJyb3dfYm90ID0gaW5kOworICAgICAgZWxz ZSBpZiAoQ09OU1AgKGluZCkKKyAgICAgICAgICAgICAgICYmIENPTlNQIChYQ0FSIChpbmQpKSkK KyAgICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IHBvczsKKyAgICAgICAgICBpZiAocG9z ID0gbWNfYXNzcSAoUXQsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAgYm91bmRhcnlf dG9wID0gYm91bmRhcnlfYm90ID0gYXJyb3dfdG9wID0gYXJyb3dfYm90ID0gWENEUiAocG9zKTsK KyAgICAgICAgICBpZiAocG9zID0gbWNfYXNzcSAoUXRvcCwgaW5kKSwgIU5JTFAgKHBvcykpCisg ICAgICAgICAgICBib3VuZGFyeV90b3AgPSBYQ0RSIChwb3MpOworICAgICAgICAgIGlmIChwb3Mg PSBtY19hc3NxIChRYm90dG9tLCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAgIGJvdW5k YXJ5X2JvdCA9IFhDRFIgKHBvcyk7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFF1cCwg aW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBhcnJvd190b3AgPSBYQ0RSIChwb3MpOwor ICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRZG93biwgaW5kKSwgIU5JTFAgKHBvcykpCisg ICAgICAgICAgICBhcnJvd19ib3QgPSBYQ0RSIChwb3MpOworICAgICAgICB9CisgICAgICBlbHNl CisgICAgICAgIC8qIEFueXRoaW5nIGVsc2UgbWVhbnMgYm91bmRhcnkgb24gbGVmdCBhbmQgbm8g YXJyb3dzLiAgKi8KKyAgICAgICAgYm91bmRhcnlfdG9wID0gYm91bmRhcnlfYm90ID0gUWxlZnQ7 CisgICAgfQorICB0b3BfaW5kX3JuID0gYm90X2luZF9ybiA9IC0xOworICBpZiAoIU5JTFAgKGlu ZCkpCisgICAgeworICAgICAgZm9yICh5ID0gdy0+dnNjcm9sbCwgcm4gPSAwOworICAgICAgICAg ICB5IDwgeWIgJiYgcm4gPCBucm93czsKKyAgICAgICAgICAgeSArPSByb3ctPmhlaWdodCwgKyty bikKKyAgICAgICAgeworICAgICAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsg cm47CisgICAgICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgICAgIHJvdyA9IHct PmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib2Jf cCA9IHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCA9IDA7CisgICAgICAgICAgcm93LT5pbmRpY2F0 ZV9lb2JfcCA9IHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCA9IDA7CisgICAgICAgICAgaWYg KCFyb3ctPm1vZGVfbGluZV9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAodG9w X2luZF9ybiA8IDAgJiYgcm93LT52aXNpYmxlX2hlaWdodCA+IDApCisgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfU1RBUlRfQ0hBUlBPUyAocm93KSA8 PSBCVUZfQkVHViAoWEJVRkZFUiAody0+Y29udGVudHMpKQorICAgICAgICAgICAgICAgICAgICAg ICYmICFNQVRSSVhfUk9XX1BBUlRJQUxMWV9WSVNJQkxFX0FUX1RPUF9QICh3LCByb3cpKQorICAg ICAgICAgICAgICAgICAgICByb3ctPmluZGljYXRlX2JvYl9wID0gIU5JTFAgKGJvdW5kYXJ5X3Rv cCk7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHJvdy0+aW5k aWNhdGVfdG9wX2xpbmVfcCA9ICFOSUxQIChhcnJvd190b3ApOworICAgICAgICAgICAgICAgICAg dG9wX2luZF9ybiA9IHJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgaWYgKGJv dF9pbmRfcm4gPCAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChN QVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpID49IEJVRl9aViAoWEJVRkZFUiAody0+Y29udGVu dHMpKQorICAgICAgICAgICAgICAgICAgICAgICYmICFNQVRSSVhfUk9XX1BBUlRJQUxMWV9WSVNJ QkxFX0FUX0JPVFRPTV9QICh3LCByb3cpKQorICAgICAgICAgICAgICAgICAgICByb3ctPmluZGlj YXRlX2VvYl9wID0gIU5JTFAgKGJvdW5kYXJ5X2JvdCksIGJvdF9pbmRfcm4gPSBybjsKKyAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKHkgKyByb3ctPmhlaWdodCA+PSB5YikKKyAgICAgICAgICAg ICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wID0gIU5JTFAgKGFycm93X2JvdCks IGJvdF9pbmRfcm4gPSBybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAg ICAgIH0KKyAgICB9CisgIGVtcHR5X3BvcyA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg aW5kaWNhdGVfZW1wdHlfbGluZXMpOworICBpZiAoIU5JTFAgKGVtcHR5X3BvcykgJiYgIUVRIChl bXB0eV9wb3MsIFFyaWdodCkpCisgICAgZW1wdHlfcG9zID0gV0lORE9XX0xFRlRfRlJJTkdFX1dJ RFRIICh3KSA9PSAwID8gUXJpZ2h0IDogUWxlZnQ7CisgIGZvciAoe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ICBy b3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHRvcF9pbmRfcm47CisgICAgICBpZiAoIXJv dy0+ZW5hYmxlZF9wKQorICAgICAgICByb3cgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHRv cF9pbmRfcm47CisgICAgICB0b3Bfcm93X2VuZHNfYXRfenZfcCA9IHJvdy0+ZW5kc19hdF96dl9w OworICAgICAgaWYgKHJvdy0+aW5kaWNhdGVfYm9iX3ApCisgICAgICAgIHsKKyAgICAgICAgICBp ZiAoRVEgKGJvdW5kYXJ5X3RvcCwgUWxlZnQpKQorICAgICAgICAgICAgYm4gPSAoKHJvdy0+aW5k aWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQpKQorICAgICAgICAgICAgPyBN Q19MRUZUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKQorICAgICAg ICAgICAgOiBNQ19MRUZUX0ZSSU5HRSAoMiwgUXRvcCwgMCkpOworICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgIGJuID0gKChyb3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3Qs IFFyaWdodCkpCisgICAgICAgICAgICA/IE1DX1JJR0hUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20s IHJvdy0+ZW5kc19hdF96dl9wKQorICAgICAgICAgICAgOiBNQ19SSUdIVF9GUklOR0UgKDIsIFF0 b3AsIDApKTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGlu ZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKEVRIChhcnJvd190b3AsIFFsZWZ0KSkKKyAg ICAgICAgICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAgICAgICAgZWxz ZQorICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAgICAg IH0KKyAgICAgIGlmIChibiAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICB7CisgICAg ICAgICAgc3RydWN0IGZyaW5nZV9iaXRtYXAgKmZiID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAo Ym4pOworICAgICAgICAgIGlmIChmYi0+YWxpZ24gPT0gQUxJR05fQklUTUFQX1RPUCAmJiBmYi0+ cGVyaW9kID09IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9y b3cgKnJvdzE7CisgICAgICAgICAgICAgIGludCB0b3BfaW5kX21heF95OworICAgICAgICAgICAg ICB0b3BfaW5kX21pbl95ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICAg ICAgICAgIHRvcF9pbmRfbWF4X3kgPSB0b3BfaW5kX21pbl95ICsgZmItPmhlaWdodDsKKyAgICAg ICAgICAgICAgaWYgKHRvcF9pbmRfbWF4X3kgPiB5YikKKyAgICAgICAgICAgICAgICB0b3BfaW5k X21heF95ID0geWI7CisgICAgICAgICAgICAgIGZvciAoeSA9IHJvdy0+eSArIHJvdy0+aGVpZ2h0 LCBybiA9IHRvcF9pbmRfcm4gKyAxOworICAgICAgICAgICAgICAgICAgIHkgPCB0b3BfaW5kX21h eF95ICYmIHJuIDwgbnJvd3M7CisgICAgICAgICAgICAgICAgICAgeSArPSByb3cxLT5oZWlnaHQs IHJuKyspCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKGJvdF9pbmRf cm4gPj0gMCAmJiBybiA+PSBib3RfaW5kX3JuKQorICAgICAgICAgICAgICAgICAgICBicmVhazsK KyAgICAgICAgICAgICAgICAgIHJvdzEgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJuOwor ICAgICAgICAgICAgICAgICAgaWYgKCFyb3cxLT5lbmFibGVkX3ApCisgICAgICAgICAgICAgICAg ICAgIHJvdzEgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgICAgICAg ICAgcm93MS0+aW5kaWNhdGVfYm9iX3AgPSByb3ctPmluZGljYXRlX2JvYl9wOworICAgICAgICAg ICAgICAgICAgcm93MS0+aW5kaWNhdGVfdG9wX2xpbmVfcCA9IHJvdy0+aW5kaWNhdGVfdG9wX2xp bmVfcDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9 CisgIGlmIChib3RfaW5kX3JuID49IDApCisgICAgeworICAgICAgaW50IGJuID0gTUNfTk9fRlJJ TkdFX0JJVE1BUDsKKyAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgYm90X2lu ZF9ybjsKKyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgIHJvdyA9IHctPmN1cnJl bnRfbWF0cml4LT5yb3dzICsgYm90X2luZF9ybjsKKyAgICAgIGJvdF9yb3dfZW5kc19hdF96dl9w ID0gcm93LT5lbmRzX2F0X3p2X3A7CisgICAgICBpZiAocm93LT5pbmRpY2F0ZV9lb2JfcCkKKyAg ICAgICAgeworICAgICAgICAgIGlmIChFUSAoYm91bmRhcnlfYm90LCBRbGVmdCkpCisgICAgICAg ICAgICBibiA9IE1DX0xFRlRfRlJJTkdFICgzLCBRYm90dG9tLCByb3ctPmVuZHNfYXRfenZfcCk7 CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDMsIFFi b3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93 LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKEVRIChh cnJvd19ib3QsIFFsZWZ0KSkKKyAgICAgICAgICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDcsIFFk b3duLCAwKTsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBibiA9IE1DX1JJR0hUX0ZSSU5H RSAoNywgUWRvd24sIDApOworICAgICAgICB9CisgICAgICBpZiAoYm4gIT0gTUNfTk9fRlJJTkdF X0JJVE1BUCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBmcmluZ2VfYml0bWFwICpmYiA9 IGdldF9mcmluZ2VfYml0bWFwX2RhdGEgKGJuKTsKKyAgICAgICAgICBpZiAoZmItPmFsaWduID09 IEFMSUdOX0JJVE1BUF9CT1RUT00gJiYgZmItPnBlcmlvZCA9PSAwKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cxOworICAgICAgICAgICAgICBpbnQg Ym90X2luZF9taW5feTsKKyAgICAgICAgICAgICAgYm90X2luZF9tYXhfeSA9IHJvdy0+eSArIHJv dy0+dmlzaWJsZV9oZWlnaHQ7CisgICAgICAgICAgICAgIGJvdF9pbmRfbWluX3kgPSBib3RfaW5k X21heF95IC0gZmItPmhlaWdodDsKKyAgICAgICAgICAgICAgaWYgKGJvdF9pbmRfbWluX3kgPCBX SU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KSkKKyAgICAgICAgICBib3RfaW5kX21pbl95ID0g V0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICAgICAgICAgIGZvciAoeSA9IHJv dy0+eSwgcm4gPSBib3RfaW5kX3JuIC0gMTsKKyAgICAgICAgICAgICB5ID49IGJvdF9pbmRfbWlu X3kgJiYgcm4gPj0gMDsKKyAgICAgICAgICAgICB5IC09IHJvdzEtPmhlaWdodCwgcm4tLSkKKyAg ICAgICAgICB7CisgICAgICAgICAgICBpZiAodG9wX2luZF9ybiA+PSAwICYmIHJuIDw9IHRvcF9p bmRfcm4pCisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgcm93MSA9IHctPmRlc2ly ZWRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICBpZiAoIXJvdzEtPmVuYWJsZWRfcCkK KyAgICAgICAgICAgICAgcm93MSA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAg ICAgICAgICByb3cxLT5pbmRpY2F0ZV9lb2JfcCA9IHJvdy0+aW5kaWNhdGVfZW9iX3A7CisgICAg ICAgICAgICByb3cxLT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wID0gcm93LT5pbmRpY2F0ZV9ib3R0 b21fbGluZV9wOworICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0K KyAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y29udGVudHM7CisgIENIRUNLX0JVRkZFUiAoYnVmKTsK KyAgYm9vbCBhdXRvX2hzY3JvbGxfbW9kZV9wID0gRVEgKEZidWZmZXJfbG9jYWxfdmFsdWUgKFFh dXRvX2hzY3JvbGxfbW9kZSwgYnVmKSwgUWN1cnJlbnRfbGluZSk7CisgIC8qIEVYQU1QTEU6ICAo c2Nyb2xsLWxlZnQgNSkgKi8KKyAgYm9vbCBoc2NsX2FsbF90ZW1wX3AgPSAody0+c3VzcGVuZF9h dXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21v ZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBM RTogIEMtdSBDLXggPCBhbmQgZG8gbm90aGluZy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBf cCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Ny b2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09 IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcg ZWxzZSBiZXNpZGVzIGhvcml6b250YWxseSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAgICBj dXJyZW50IGxpbmUgZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMg X25vdF8gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xf YWxsX3Blcm1fMV9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1p bl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAu Li4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Ny b2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1 c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19o c2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwg PT0gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3Jv bGwpOworICAvKiBFWEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhl IGxlZnQgYXJyb3cga2V5IG9uZSB0aW1lLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9p c18gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1w X3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYg YXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwg PiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8q IEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3Vy cmVudCBsaW5lIHRvIGJlCisgICAgICAgICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlm ZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkg c2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3Bl bmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21v ZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIHN0cnVjdCBmcmF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gICAgICAgICAgICAgICAg ICAgICAgICAgICAuYmx1ZSA9IHctPmNoX2VsdHMuY2FjaGVzW2VsdF0uYmFja2dyb3VuZC5ibHVl fTsKKyAgICAgIGJvb2wgYWN0aXZlX3AgPSB3LT5jaF9lbHRzLmNhY2hlc1tlbHRdLmFjdGl2ZV9w OworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gdy0+Y2hfZWx0cy5jYWNoZXNb ZWx0XS5nbHlwaF9mbGF2b3I7CisgICAgICBib29sIGVuYWJsZWRfcCA9IHctPmNoX2VsdHMuY2Fj aGVzW2VsdF0uZW5hYmxlZF9wOworICAgICAgaWYgKCh2cG9zID09IHZwb3NfZGVzaXJlZCB8fCB2 cG9zID09IHZwb3NfY3VycmVudCkKKyAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNfT1ZF UkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICAgICAmJiAhaHNjbF9hbGxfdGVtcF9wCisgICAgICAg ICAgJiYgIWhzY2xfdGVtcF9wCisgICAgICAgICAgJiYgIWhzY2xfcGVybV9wCisgICAgICAgICAg JiYgIWhzY2xfYWxsX3Blcm1fMF9wCisgICAgICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMV9wCisg ICAgICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMl9wCisgICAgICAgICAgJiYgZW5hYmxlZF9wKQor ICAgICAgICB7CisgICAgICAgICAgaW50IGZyaW5nZV9iaXRtYXAgPSBNQ19OT19GUklOR0VfQklU TUFQOworICAgICAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQgPQorICAg ICAgICAgICAgKCFhY3RpdmVfcAorICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICAgID8gbG9v a3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1pbmFjdGl2ZS1m YWNlIiksIHRydWUpCisgICAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgPyBs b29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWZhY2UiKSwg dHJ1ZSkKKyAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgIG1jX2xlZnRf ZnJpbmdlX2ZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBvdmVybGF5X2Fycm93X2ZhY2Vf aWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lE OworICAgICAgICAgIGlmICh3LT5oc2Nyb2xsICE9IDApCisgICAgICAgICAgICBmcmluZ2VfYml0 bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJvdyIp LCBmYWxzZSwgdHJ1ZSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGZyaW5nZV9i aXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1vdmVybGF5LWFycm93 IiksIHRydWUsIHRydWUpOworICAgICAgICAgIG1jX2xlZnRfZnJpbmdlX2JpdG1hcCA9IChjdXJz b3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBp ZiAoKHZwb3MgPT0gdnBvc19kZXNpcmVkIHx8IHZwb3MgPT0gdnBvc19jdXJyZW50KQorICAgICAg ICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAg ICAgICAgICAgICAgICAgJiYgKGhzY2xfYWxsX3RlbXBfcAorICAgICAgICAgICAgICAgICAgICAg fHwgaHNjbF9hbGxfcGVybV8wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Bl cm1fMV9wCisgICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAgICAg ICAgICAgICAgICAgICAgfHwgaHNjbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhz Y2xfcGVybV9wKQorICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgewor ICAgICAgICAgICAgaW50IGZyaW5nZV9iaXRtYXAgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAg ICAgICAgICAgZW51bSBmYWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAg ICAgICghYWN0aXZlX3AKKyAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICAgICAgPyBsb29r dXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5hY3Rp dmUtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAg ICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ct aHNjbC1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAg ICAgICAgICAgbWNfbGVmdF9mcmluZ2VfZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZU X0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g b3ZlcmxheV9hcnJvd19mYWNlX2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgICAgaWYgKGhzY2xfYWxsX3Blcm1fMF9w KQorICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcs IGludGVybiAoIistaHNjbC1wZXJtIiksIGZhbHNlLCBmYWxzZSk7CisgICAgICAgICAgICAgIGVs c2UgaWYgKGhzY2xfYWxsX3Blcm1fMV9wKQorICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAg PSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1ZSwg ZmFsc2UpOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMl9wKQorICAg ICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBp bnRlcm4gKCIrLWhzY2wtcGVybSIpLCBmYWxzZSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICBl bHNlIGlmIChoc2NsX3Blcm1fcCkKKyAgICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9 IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCB0cnVlLCB0 cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfdGVtcF9wKQorICAg ICAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAo dywgaW50ZXJuICgiKy1oc2NsLXRlbXAiKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAgICAg ICAgICAgICBlbHNlIGlmIChoc2NsX3RlbXBfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgIGZy aW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXRl bXAiKSwgdHJ1ZSwgZmFsc2UpOworICAgICAgICAgICAgbWNfbGVmdF9mcmluZ2VfYml0bWFwID0g KGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgfQorICAg ICAgICAgIGVsc2UgaWYgKCh2cG9zID09IHZwb3NfZGVzaXJlZCB8fCB2cG9zID09IHZwb3NfY3Vy cmVudCkKKyAgICAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1df UkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9m bGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAg ICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUK KyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9C QVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9 PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAg ICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAg ICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAg ICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJf QkFDS1NMQVNIKQorICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGJpdG1hcF9mbGF2b3IgPSAoZ2x5cGhfZmxh dm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fy cm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9m bGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVykKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfaG9s bG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19yZWN0 YW5nbGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBo X2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJv dworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxh dm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxf YmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZF UlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2JhcgorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9C QUNLU0xBU0gpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g UW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogUW5pbDsKKyAgICAgICAgICAgICAgbWNfcmlnaHRfZnJpbmdlX2JpdG1h cCA9IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJpdG1h cF9mbGF2b3IpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19O T19GUklOR0VfQklUTUFQOworICAgICAgICAgICAgICBtY19yaWdodF9mcmluZ2VfZmFjZV9pZCA9 CisgICAgICAgICAgICAgICAgKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAK KyAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1df UkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2 b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAg ICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKSkKKyAg ICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmV2 ZXJzZWQtdmVydGljYWwtYmFyLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJz b3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYg Z2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cK KyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9 IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgID8gbG9va3VwX25h bWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistdmVydGljYWwtYmFyLWZhY2UiKSwgdHJ1ZSkKKyAg ICAgICAgICAgICAgICA6IERFRkFVTFRfRk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ZSwgMCk7CisgICAgICBlbHNlIGlmIChyb3ctPmlu ZGljYXRlX3RvcF9saW5lX3AgJiYgRVEgKGFycm93X3RvcCwgUWxlZnQpKQorICAgICAgICB7Cisg ICAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAgIGlm ICh0b3BfaW5kX21pbl95ID49IDApCisgICAgICAgICAgICBsZWZ0X29mZnNldCA9IHRvcF9pbmRf bWluX3kgLSByb3ctPnk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVf Ym90dG9tX2xpbmVfcCAmJiBFUSAoYXJyb3dfYm90LCBRbGVmdCkpCisgICAgICAgIHsKKyAgICAg ICAgICBsZWZ0ID0gTUNfTEVGVF9GUklOR0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICBpZiAo Ym90X2luZF9tYXhfeSA+PSAwKQorICAgICAgICAgICAgbGVmdF9vZmZzZXQgPSBib3RfaW5kX21h eF95IC0gKHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgICAgICB9CisgICAgICBl bHNlCisgICAgICAgIGxlZnQgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgLyogRGVjaWRl IHdoaWNoIGJpdG1hcCB0byBkcmF3IGluIHRoZSByaWdodCBmcmluZ2UuICAqLworICAgICAgaWYg KFdJTkRPV19SSUdIVF9GUklOR0VfV0lEVEggKHcpID09IDApCisgICAgICAgIHJpZ2h0ID0gTUNf Tk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgIGVsc2UgaWYgKHJvdy0+cmlnaHRfdXNlcl9mcmluZ2Vf Yml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHsKKyAgICAgICAgICByaWdo dCA9IHJvdy0+cmlnaHRfdXNlcl9mcmluZ2VfYml0bWFwOworICAgICAgICAgIHJpZ2h0X2ZhY2Vf aWQgPSByb3ctPnJpZ2h0X3VzZXJfZnJpbmdlX2ZhY2VfaWQ7CisgICAgICAgIH0KKyAgICAgIGVs c2UgaWYgKCghcm93LT5yZXZlcnNlZF9wICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisg ICAgICAgICAgICAgICB8fCAocm93LT5yZXZlcnNlZF9wICYmIHJvdy0+dHJ1bmNhdGVkX29uX2xl ZnRfcCkpCisgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICgwLCBRdHJ1bmNhdGlvbiwg MCk7CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2JvYl9wICYmIEVRIChib3VuZGFyeV90 b3AsIFFyaWdodCkpCisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9ICgocm93LT5pbmRpY2F0 ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICAgICAgID8gTUNf UklHSFRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwgdG9wX3Jvd19lbmRzX2F0X3p2X3ApCisgICAg ICAgICAgICAgOiBNQ19SSUdIVF9GUklOR0UgKDIsIFF0b3AsIDApKTsKKyAgICAgICAgICBpZiAo dG9wX2luZF9taW5feSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2luZF9t aW5feSAtIHJvdy0+eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9l b2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICB7CisgICAgICAgICAg cmlnaHQgPSBNQ19SSUdIVF9GUklOR0UgKDMsIFFib3R0b20sIGJvdF9yb3dfZW5kc19hdF96dl9w KTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAgICAgICAgICAgcmlnaHRf b2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0KTsK KyAgICAgICAgfQorICAgICAgZWxzZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jb250 aW51ZWRfcCkKKyAgICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgTUFUUklYX1JP V19DT05USU5VQVRJT05fTElORV9QIChyb3cpKSkKKyAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9G UklOR0UgKDQsIFFjb250aW51YXRpb24sIDApOworICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0 ZV90b3BfbGluZV9wICYmIEVRIChhcnJvd190b3AsIFFyaWdodCkpCisgICAgICAgIHsKKyAgICAg ICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICBpZiAo dG9wX2luZF9taW5feSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2luZF9t aW5feSAtIHJvdy0+eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9i b3R0b21fbGluZV9wICYmIEVRIChhcnJvd19ib3QsIFFyaWdodCkpCisgICAgICAgIHsKKyAgICAg ICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAgIGlm IChib3RfaW5kX21heF95ID49IDApCisgICAgICAgICAgICByaWdodF9vZmZzZXQgPSBib3RfaW5k X21heF95IC0gKHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgICAgICB9CisgICAg ICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VtcHR5X2xpbmVfcCAmJiBFUSAoZW1wdHlfcG9zLCBR cmlnaHQpKQorICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoNSwgUWVtcHR5X2xpbmUs IDApOworICAgICAgZWxzZQorICAgICAgICByaWdodCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7Cisg ICAgICBwZXJpb2RpY19wID0gKGdldF9mcmluZ2VfYml0bWFwX2RhdGEgKGxlZnQpLT5wZXJpb2Qg IT0gMAorICAgICAgICAgICAgICAgICAgICB8fCBnZXRfZnJpbmdlX2JpdG1hcF9kYXRhIChyaWdo dCktPnBlcmlvZCAhPSAwKTsKKyAgICAgIGlmIChyb3ctPnkgIT0gY3VyLT55CisgICAgICAgICAg fHwgcm93LT52aXNpYmxlX2hlaWdodCAhPSBjdXItPnZpc2libGVfaGVpZ2h0CisgICAgICAgICAg fHwgcm93LT5lbmRzX2F0X3p2X3AgIT0gY3VyLT5lbmRzX2F0X3p2X3AKKyAgICAgICAgICB8fCBs ZWZ0ICE9IGN1ci0+bGVmdF9mcmluZ2VfYml0bWFwCisgICAgICAgICAgfHwgcmlnaHQgIT0gY3Vy LT5yaWdodF9mcmluZ2VfYml0bWFwCisgICAgICAgICAgfHwgbGVmdF9mYWNlX2lkICE9IGN1ci0+ bGVmdF9mcmluZ2VfZmFjZV9pZAorICAgICAgICAgIHx8IHJpZ2h0X2ZhY2VfaWQgIT0gY3VyLT5y aWdodF9mcmluZ2VfZmFjZV9pZAorICAgICAgICAgIHx8IGxlZnRfb2Zmc2V0ICE9IGN1ci0+bGVm dF9mcmluZ2Vfb2Zmc2V0CisgICAgICAgICAgfHwgcmlnaHRfb2Zmc2V0ICE9IGN1ci0+cmlnaHRf ZnJpbmdlX29mZnNldAorICAgICAgICAgIHx8IHBlcmlvZGljX3AgIT0gY3VyLT5mcmluZ2VfYml0 bWFwX3BlcmlvZGljX3AKKyAgICAgICAgICB8fCBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19w KQorICAgICAgICB7CisgICAgICAgICAgcmVkcmF3X3AgPSAxLCByb3ctPnJlZHJhd19mcmluZ2Vf Yml0bWFwc19wID0gMTsKKyAgICAgICAgICBpZiAoIWtlZXBfY3VycmVudF9wKQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gMTsKKyAg ICAgICAgICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklU TUFQCisgICAgICAgICAgICAgICAgICB8fCBtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05P X0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5mcmluZ2VfYml0bWFwX3Blcmlv ZGljX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBj dXItPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IHBlcmlvZGljX3A7CisgICAgICAgICAgICAg IGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAg ICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX2JpdG1hcCA9IG1jX2xlZnRfZnJpbmdlX2JpdG1h cDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJp bmdlX2JpdG1hcCA9IGxlZnQ7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRt YXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJp bmdlX2ZhY2VfaWQgPSBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2VfZmFjZV9pZCA9IGxlZnRfZmFj ZV9pZDsKKyAgICAgICAgICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19G UklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0g MDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJp bmdlX29mZnNldCA9IGxlZnRfb2Zmc2V0OworICAgICAgICAgICAgICBpZiAobWNfcmlnaHRfZnJp bmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+ cmlnaHRfZnJpbmdlX2JpdG1hcCA9IG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXA7CisgICAgICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfYml0bWFwID0g cmlnaHQ7CisgICAgICAgICAgICAgIGlmIChtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05P X0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfZmFjZV9p ZCA9IG1jX3JpZ2h0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQgPSByaWdodF9mYWNlX2lkOwor ICAgICAgICAgICAgICBpZiAobWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0Vf QklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldCA9IDA7Cisg ICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2Vf b2Zmc2V0ID0gcmlnaHRfb2Zmc2V0OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBp ZiAocm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCA8IDApCisgICAgICAgIHJvdy0+b3ZlcmxheV9h cnJvd19iaXRtYXAgPSBtY19nZXRfbG9naWNhbF9mcmluZ2VfYml0bWFwICh3LCBRb3ZlcmxheV9h cnJvdywgMCwgMCk7CisgICAgICBpZiAocm93LT5vdmVybGF5X2Fycm93X2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AgICBmYWNlX2lkID0gcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkOworICAgICAg ICBvZmZzZXQgPSByb3ctPmxlZnRfZnJpbmdlX29mZnNldDsKKyAgICAgIH0KKyAgICAgIGVsc2UK KyAgICAgICAgeworICAgICAgICAgIHdoaWNoID0gcm93LT5yaWdodF9mcmluZ2VfYml0bWFwOwor ICAgICAgICAgIGZhY2VfaWQgPSByb3ctPnJpZ2h0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAg IG9mZnNldCA9IHJvdy0+cmlnaHRfZnJpbmdlX29mZnNldDsKKyAgICAgICAgfQorICBpZiAoZmFj ZV9pZCA9PSBERUZBVUxUX0ZBQ0VfSUQpCisgICAgeworICAgICAgTGlzcF9PYmplY3QgZmFjZSA9 IGZyaW5nZV9mYWNlc1t3aGljaF07CisgICAgICBmYWNlX2lkID0gTklMUCAoZmFjZSkgPyBsb29r dXBfbmFtZWRfZmFjZSAodywgZiwgUWZyaW5nZSwgZmFsc2UpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiBsb29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBmYWNlLCBGUklOR0VfRkFDRV9J RCwgMCk7CisgICAgICBpZiAoZmFjZV9pZCA8IDApCisgICAgICAgIGZhY2VfaWQgPSBGUklOR0Vf RkFDRV9JRDsKKyAgICB9CisgIGZiID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAod2hpY2gpOwor ICBwZXJpb2QgPSBmYi0+cGVyaW9kOworICAvKiBDb252ZXJ0IHJvdyB0byBmcmFtZSBjb29yZGlu YXRlcy4gICovCisgIHAueSA9IFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCByb3ctPnkpICsg b2Zmc2V0OworICBwLndoaWNoID0gd2hpY2g7CisgIHAuYml0cyA9IGZiLT5iaXRzOworICBwLndk ID0gZmItPndpZHRoOworICBwLmggPSBmYi0+aGVpZ2h0OworICBwLmRoID0gKHBlcmlvZCA+IDAg P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KTsKKyAgcC5ueSA9IHJvdy0+dmlzaWJsZV9o ZWlnaHQ7CisgIGlmIChsZWZ0X3ApCisgICAgeworICAgICAgaW50IHdkID0gV0lORE9XX0xFRlRf RlJJTkdFX1dJRFRIICh3KTsKKyAgICAgIGludCB4ID0gd2luZG93X2JveF9sZWZ0ICh3LCAoV0lO RE9XX0hBU19GUklOR0VTX09VVFNJREVfTUFSR0lOUyAodykKKyAgICAgICAgICAgPyBMRUZUX01B UkdJTl9BUkVBCisgICAgICAgICAgIDogVEVYVF9BUkVBKSk7CisgICAgICBpZiAocC53ZCA+IHdk KQorICAgICAgICBwLndkID0gd2Q7CisgICAgICBwLnggPSB4IC0gcC53ZCAtICh3ZCAtIHAud2Qp IC8gMjsKKyAgICAgIGlmIChwLndkIDwgd2QgfHwgcC55ID4gcC5ieSB8fCBwLnkgKyBwLmggPCBw LmJ5ICsgcC5ueSkKKyAgICAgICAgeworICAgICAgICAgIC8qIElmIFcgaGFzIGEgdmVydGljYWwg Ym9yZGVyIHRvIGl0cyBsZWZ0LCBkb24ndCBkcmF3IG92ZXIgaXQuICAqLworICAgICAgICAgIHdk IC09ICgoIVdJTkRPV19MRUZUTU9TVF9QICh3KQorICAgICAgICAgICAgLyogVGhpcyBjb3VsZCBi ZSB3cm9uZyB3aGVuIHdlIGFsbG93IHdpbmRvdyBsb2NhbAorICAgICAgICAgICAgICAgcmlnaHQg ZGl2aWRlcnMgLSBidXQgdGhlIHdpbmRvdyBvbiB0aGUgbGVmdCBpcyBoYXJkCisgICAgICAgICAg ICAgICB0byBnZXQuICAqLworICAgICAgICAgICAgJiYgIUZSQU1FX1JJR0hUX0RJVklERVJfV0lE VEggKGYpCisgICAgICAgICAgICAmJiAhV0lORE9XX0hBU19WRVJUSUNBTF9TQ1JPTExfQkFSICh3 KQorICAgICAgICAgICAgLyogQnV0IGRvbid0IHJlZHVjZSB0aGUgZnJpbmdlIHdpZHRoIGlmIHRo ZSB3aW5kb3cKKyAgICAgICAgICAgICAgIGhhcyBhIGxlZnQgbWFyZ2luLCBiZWNhdXNlIHRoYXQg bWVhbnMgd2UgYXJlIG5vdAorICAgICAgICAgICAgICAgaW4gZGFuZ2VyIG9mIGRyYXdpbmcgb3Zl ciB0aGUgdmVydGljYWwgYm9yZGVyLAorICAgICAgICAgICAgICAgYW5kIE9UT0ggbGVhdmluZyBv dXQgdGhhdCBvbmUgcGl4ZWwgbGVhdmVzIGJlaGluZAorICAgICAgICAgICAgICAgdHJhY2VzIG9m IHRoZSBjdXJzb3IsIGlmIGl0IHdhcyBpbiBjb2x1bW4gemVybworICAgICAgICAgICAgICAgYmVm b3JlIGRyYXdpbmcgbm9uLWVtcHR5IG1hcmdpbiBhcmVhLiAgKi8KKyAgICAgICAgICAgICYmIHct PmxlZnRfbWFyZ2luX2NvbHMgPT0gMCkKKyAgICAgICAgICAgPyAxIDogMCk7CisgICAgICAgICAg cC5ieCA9IHggLSB3ZDsKKyAgICAgICAgICBwLm54ID0gd2Q7CisgICAgICAgIH0KKyAgICB9Cisg IGVsc2UKKyAgICB7CisgICAgICBpbnQgeCA9IHdpbmRvd19ib3hfcmlnaHQgKHcsCisgICAgICAg IChXSU5ET1dfSEFTX0ZSSU5HRVNfT1VUU0lERV9NQVJHSU5TICh3KQorICAgICAgICAgPyBSSUdI VF9NQVJHSU5fQVJFQQorICAgICAgICAgOiBURVhUX0FSRUEpKTsKKyAgICAgIGludCB3ZCA9IFdJ TkRPV19SSUdIVF9GUklOR0VfV0lEVEggKHcpOworICAgICAgaWYgKHAud2QgPiB3ZCkKKyAgICAg ICAgcC53ZCA9IHdkOworICAgICAgcC54ID0geCArICh3ZCAtIHAud2QpIC8gMjsKKyAgICAgIC8q IENsZWFyIHJpZ2h0IGZyaW5nZSBpZiBubyBiaXRtYXAgdG8gZHJhdyBvZiBpZiBiaXRtYXAgZG9l c24ndCBmaWxsCisgICB0aGUgZnJpbmdlLiAgKi8KKyAgICAgIGlmIChwLndkIDwgd2QgfHwgcC55 ID4gcC5ieSB8fCBwLnkgKyBwLmggPCBwLmJ5ICsgcC5ueSkKKyAgICAgICAgeworICAgICAgICAg IHAuYnggPSB4OworICAgICAgICAgIHAubnggPSB3ZDsKKyAgICAgICAgfQorICAgIH0KKyAgaWYg KHAueCA+PSBXSU5ET1dfQk9YX0xFRlRfRURHRV9YICh3KQorICAgICAgJiYgKHAueCArIHAud2Qp IDw9IFdJTkRPV19CT1hfTEVGVF9FREdFX1ggKHcpICsgV0lORE9XX1BJWEVMX1dJRFRIICh3KSkK KyAgICBGUkFNRV9SSUYgKGYpLT5kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywgJnApOworfQor Cit2b2lkCittY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBn bHlwaF9yb3cgKnJvdywgaW50IGxlZnRfcCwgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3JfdHlw ZSkKK3sKKyAgaW50IG92ZXJsYXkgPSAwOworICBpZiAobGVmdF9wID09IHJvdy0+cmV2ZXJzZWRf cCAmJiByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCkKKyAgICB7CisgICAgICBMaXNwX09iamVjdCBj dXJzb3IgPSBRbmlsOworICAgICAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICAgICAgeworICAg ICAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6CisgICAgICAgICAgaWYgKHJvdy0+dmlzaWJsZV9oZWln aHQgPj0gU1RBTkRBUkRfQklUTUFQX0hFSUdIVCAoaG9sbG93X3JlY3RhbmdsZV9iaXRzKSkKKyAg ICAgICAgICAgIGN1cnNvciA9IFFob2xsb3c7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAg Y3Vyc29yID0gUWhvbGxvd19zbWFsbDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBN Q19IT0xMT1dfQk9YOgorICAgICAgICAgIGlmIChyb3ctPnZpc2libGVfaGVpZ2h0ID49IFNUQU5E QVJEX0JJVE1BUF9IRUlHSFQgKGhvbGxvd19yZWN0YW5nbGVfYml0cykpCisgICAgICAgICAgICBj dXJzb3IgPSBRaG9sbG93OworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGN1cnNvciA9IFFo b2xsb3dfc21hbGw7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfRklMTEVEX0JP WDoKKyAgICAgICAgICBjdXJzb3IgPSBRYm94OworICAgICAgICAgIGJyZWFrOworICAgICAgICBj YXNlIE1DX0JBUjoKKyAgICAgICAgICBjdXJzb3IgPSBRYmFyOworICAgICAgICAgIGJyZWFrOwor ICAgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAgICAgY3Vyc29yID0gUWhiYXI7CisgICAgICAg ICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgY2Fz ZSBNQ19OT19DVVJTT1I6CisgICAgICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAg ICAgICAgY2FzZSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGRlZmF1bHQ6CisgICAg ICAgICAgdy0+cGh5c19jdXJzb3Jfb25fcCA9IDA7CisgICAgICAgICAgcm93LT5jdXJzb3JfaW5f ZnJpbmdlX3AgPSAwOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBpZiAoIU5J TFAgKGN1cnNvcikpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgYm0gPSBtY19nZXRfbG9naWNh bF9jdXJzb3JfYml0bWFwICh3LCBjdXJzb3IpOworICAgICAgICAgIGlmIChibSAhPSBNQ19OT19G UklOR0VfQklUTUFQKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19kcmF3X2ZyaW5n ZV9iaXRtYXBfMSAodywgcm93LCBsZWZ0X3AsIDIsIGJtKTsKKyAgICAgICAgICAgICAgb3Zlcmxh eSA9IEVRIChjdXJzb3IsIFFib3gpID8gMyA6IDE7CisgICAgICAgICAgICB9CisgICAgICAgIH0K KyAgICB9CisgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcF8xICh3LCByb3csIGxlZnRfcCwgb3Zlcmxh eSwgTUNfTk9fRlJJTkdFX0JJVE1BUCk7CisgIGlmIChsZWZ0X3AgJiYgcm93LT5vdmVybGF5X2Fy cm93X2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgIG1jX2RyYXdfZnJpbmdlX2Jp dG1hcF8xICh3LCByb3csIDEsIDEsIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXApOworfQorCisv KiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog I2RlZmluZSBOT19GUklOR0VfQklUTUFQIDAKICNkZWZpbmUgVU5ERUZfRlJJTkdFX0JJVE1BUCAx CiAjZGVmaW5lIE1BWF9TVEFOREFSRF9GUklOR0VfQklUTUFQUyBBUlJBWUVMVFMgKHN0YW5kYXJk X2JpdG1hcHMpCkBAIC0xNzAwLDYgKzMxOTAsMTY4IEBAIFJldHVybiBuaWwgaWYgUE9TIGlzIG5v dCB2aXNpYmxlIGluIFdJTkRPVy4gICovKQogdm9pZAogc3ltc19vZl9mcmluZ2UgKHZvaWQpCiB7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKyAgLyogKGdldCAnZW1wdHktbGluZSAnZnJpbmdlKSA9PiAyMyA9PiB0aGUgbGFzdCBz dGFuZGFyZC1iaXRtYXAgYmVmb3JlIHRoaXMgb25lLgorICBTZWUgYGZyaW5nZS5lbGAuICovCisK KyAgLyogMjQgKi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VMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICBERUZTWU0gKFF0cnVuY2F0aW9uLCAidHJ1bmNhdGlvbiIpOwogICBERUZTWU0gKFFj b250aW51YXRpb24sICJjb250aW51YXRpb24iKTsKICAgREVGU1lNIChRb3ZlcmxheV9hcnJvdywg Im92ZXJsYXktYXJyb3ciKTsKZGlmZiAtLWdpdCBhL3NyYy9uc3Rlcm0uaCBiL3NyYy9uc3Rlcm0u aAppbmRleCA3OGNlNjA4Li44ZWYwZGZlIDEwMDY0NAotLS0gYS9zcmMvbnN0ZXJtLmgKKysrIGIv c3JjL25zdGVybS5oCkBAIC02NjAsNiArNjYwLDE2IEBAIHR5cGVkZWYgaWQgaW5zdGFuY2V0eXBl OwogCiBAaW50ZXJmYWNlIEVtYWNzU2Nyb2xsZXIgOiBOU1Njcm9sbGVyCiAgIHsKKworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIE5TUmVj dCBtY19yZWN0YW5nbGU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgIHN0cnVj dCB3aW5kb3cgKndpbmRvdzsKICAgIHN0cnVjdCBmcmFtZSAqZnJhbWU7CiAgICBOU1Jlc3BvbmRl ciAqcHJldlJlc3BvbmRlcjsKQEAgLTY4MCw2ICs2OTAsMTggQEAgdHlwZWRlZiBpZCBpbnN0YW5j ZXR5cGU7CiAgICBpbnQgZW1fd2hvbGU7CiAgICB9CiAKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTog KE5TUmVjdClyZWN0OworLSAoTlNSZWN0KW1jX2dldF9yZWN0YW5nbGU7CistIChzdHJ1Y3Qgd2lu ZG93ICopbWNfZ2V0X3dpbmRvdzsKKy0gKGJvb2wpbWNfanVkZ2U7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKIC0gKGluc3RhbmNldHlwZSkgaW5pdEZyYW1lOiAoTlNSZWN0IClyIHdp bmRvdzogKExpc3BfT2JqZWN0KXdpbjsKIC0gKHZvaWQpc2V0RnJhbWU6IChOU1JlY3QpcjsKIApk aWZmIC0tZ2l0IGEvc3JjL25zdGVybS5tIGIvc3JjL25zdGVybS5tCmluZGV4IDgxZDM2YmUuLmEw MWZiOTMgMTAwNjQ0Ci0tLSBhL3NyYy9uc3Rlcm0ubQorKysgYi9zcmMvbnN0ZXJtLm0KQEAgLTc2 LDYgKzc2LDEwOTEgQEAgVXBkYXRlZCBieSBDaHJpc3RpYW4gTGltcGFjaCAoY2hyaXNAbmljZS5j aCkKIHN0YXRpYyBFbWFjc01lbnUgKm1haW5NZW51OwogI2VuZGlmCiAKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK3N0YXRpYyB2b2lk IG5zX3Jlc2V0X2NsaXBwaW5nIChzdHJ1Y3QgZnJhbWUgKik7CisKK3N0YXRpYyB2b2lkIG5zX2R1 bXBnbHlwaHNfYm94X29yX3JlbGllZiAoc3RydWN0IGdseXBoX3N0cmluZyAqKTsKKworc3RhdGlj IHZvaWQgbnNfZHJhd19jb21wb3NpdGVfZ2x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pZiAoW05TVmlldyBmb2N1c1ZpZXddID09IEZS QU1FX05TX1ZJRVcgKGYpKQorICAgICAgICB7CisgICAgICAgICAgW1tOU0dyYXBoaWNzQ29udGV4 dCBjdXJyZW50Q29udGV4dF0gc2F2ZUdyYXBoaWNzU3RhdGVdOworICAgICAgICAgIGlmIChuID09 IDIpCisgICAgICAgICAgICBOU1JlY3RDbGlwTGlzdCAociwgMik7CisgICAgICAgICAgICBlbHNl CisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAocm93LT5jbGlwICE9IE5VTEwp CisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIE5TUmVjdCByX2NsaXA7 CisgICAgICAgICAgICAgICAgICAgIHJfY2xpcC5vcmlnaW4ueCA9IHJvdy0+Y2xpcC0+eDsKKyAg ICAgICAgICAgICAgICAgICAgcl9jbGlwLm9yaWdpbi55ID0gcm93LT5jbGlwLT55OworICAgICAg ICAgICAgICAgICAgICByX2NsaXAuc2l6ZS53aWR0aCA9IHJvdy0+Y2xpcC0+d2lkdGg7CisgICAg ICAgICAgICAgICAgICAgIHJfY2xpcC5zaXplLmhlaWdodCA9IHJvdy0+Y2xpcC0+aGVpZ2h0Owor ICAgICAgICAgICAgICAgICAgICBOU1JlY3Qgcl9zYXZlOworICAgICAgICAgICAgICAgICAgICBy X3NhdmUub3JpZ2luLnggPSByWzBdLm9yaWdpbi54OworICAgICAgICAgICAgICAgICAgICByX3Nh dmUub3JpZ2luLnkgPSByWzBdLm9yaWdpbi55OworICAgICAgICAgICAgICAgICAgICByX3NhdmUu c2l6ZS53aWR0aCA9IHJbMF0uc2l6ZS53aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgcl9zYXZl LnNpemUuaGVpZ2h0ID0gclswXS5zaXplLmhlaWdodDsKKyAgICAgICAgICAgICAgICAgICAgbWNf bnNfaW50ZXJzZWN0X3JlY3RhbmdsZXMgKCZyX3NhdmUsICZyX2NsaXAsICZyWzBdKTsKKyAgICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBOU1JlY3RDbGlwICgqcik7CisgICAgICAg ICAgICAgIH0KKyAgICAgICAgICByZXR1cm4gWUVTOworICAgICAgICB9CisgICAgICBlbHNlCisg ICAgICAgIHsKKyAgICAgICAgICBOU1ZpZXcgKnZpZXcgPSBGUkFNRV9OU19WSUVXIChmKTsKKyAg ICAgICAgICBpbnQgaTsKKyAgICAgICAgICBmb3IgKGkgPSAwIDsgaSA8IG4gOyBpKyspCisgICAg ICAgICAgICBbdmlldyBzZXROZWVkc0Rpc3BsYXlJblJlY3Q6cltpXV07CisgICAgICAgIH0KKyAg ICB9CisgIHJldHVybiBOTzsKK30KKworc3RhdGljIHZvaWQKK21jX25zX2RyYXdfd2luZG93X2N1 cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1 Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICBpbnQgeCwgaW50IGZ4LCBpbnQg eSwgaW50IGZ5LCBpbnQgaHBvcywgaW50IHZwb3MsIGludCB3ZCwgaW50IGgsCisgICAgICAgICAg ICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3JfdHlw ZSwKKyAgICAgICAgICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGgsIGVudW0gbWNfZmxhdm9yIGds eXBoX2ZsYXZvciwgYm9vbCBvbl9wLCBib29sIGFjdGl2ZV9wKQoreworICAvKiBUaGUgcHJpb3Ig YnVnIG9mIGEgZG91YmxlIGltcHJpbnQgb24gdGhlIGdseXBoIHdoZXJlIGFuIE1DX0hCQVIgYW5k CisgIE1DX0JBUiBpcyBwbGFjZWQgaXMgcXVpdGUgaGVscGZ1bCB0byB2aXN1YWxpemUgZXJyb3Jz IHdoZW4gZGVidWdnaW5nLiAqLworICBib29sIGRlYnVnX3AgPSBmYWxzZTs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ZmZlciB3aW5kb3dzIHdoZW4gc3dpdGNoaW5nIGJldHdlZW4gZWNobyBhcmVhIGdseXBocwor ICAgICBhbmQgbWluaS1idWZmZXIuICAqLworICBpZiAoIW9uX3ApCisgICAgcmV0dXJuOworICBp ZiAoY3Vyc29yX3R5cGUgPT0gTUNfTk9fQ1VSU09SKQorICAgIHJldHVybjsKKyAgLyogVGhlIGZy aW5nZSBiaXRtYXBzIGFyZSBwcmVzZW50bHkgaGFuZGxlZCBlbHNld2hlcmUsIGJ1dCBjb3VsZCBz b21lZGF5IGJlCisgIG1hbmFnZWQgKGluIHBhcnQpIGF0IHRoaXMgc2VjdGlvbiBvZiBjb2RlLiAq LworICBpZiAocm93LT5leGFjdF93aW5kb3dfd2lkdGhfbGluZV9wCisgICAgICAmJiAocm93LT5y ZXZlcnNlZF9wCisgICAgICAgICA/IChocG9zIDwgMCkKKyAgICAgICAgIDogKGhwb3MgPj0gcm93 LT51c2VkW1RFWFRfQVJFQV0pKSkKKyAgICB7CisgICAgICByb3ctPmN1cnNvcl9pbl9mcmluZ2Vf cCA9IHRydWU7CisgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywgcm93LT5yZXZl cnNlZF9wLCBjdXJzb3JfdHlwZSk7CisgICAgICByZXR1cm47CisgICAgfQorICByLm9yaWdpbi54 ID0gZng7CisgIHIub3JpZ2luLnkgPSBmeTsKKyAgci5zaXplLmhlaWdodCA9IGg7CisgIHIuc2l6 ZS53aWR0aCA9IHdkOworICBpZiAoIW1jX25zX2NsaXBfdG9fcmVjdCAoZiwgJnIsIDEsIHJvdykp CisgICAgcmV0dXJuOworICBmYWNlID0gRkFDRV9GUk9NX0lEIChmLCBjdXJzb3JfZ2x5cGgtPmZh Y2VfaWQpOworLyogRVhBTVBMRSBPRiBIT1cgVE8gTE9PSy1VUCBBIENPTE9SOgorICAgICBlbnVt IGZhY2VfaWQgZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXZl cnRpY2FsLWJhci1mYWNlIiksIHRydWUpOworICAgICBzdHJ1Y3QgZmFjZSAqZmFjZSA9IEZBQ0Vf RlJPTV9JRCAoZiwgZmFjZV9pZCk7CisgICAgIE5TQ29sb3IgKmNvbG9yID0gbnNfbG9va3VwX2lu ZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSksIGYpOworICAtICBFWEFNUExF IE9GIEhPVyBUTyBQUklOVCBBIENPTE9SIFRPIFNUREVSUjoKKyAgICAgTGlzcF9PYmplY3QgZm9y ZWdyb3VuZCA9IGZhY2UtPmxmYWNlW0xGQUNFX0ZPUkVHUk9VTkRfSU5ERVhdOworICAgICBMaXNw X09iamVjdCBiYWNrZ3JvdW5kID0gZmFjZS0+bGZhY2VbTEZBQ0VfQkFDS0dST1VORF9JTkRFWF07 CisgICAgIGZwcmludGYgKHN0ZGVyciwgIlxuZm9yZWdyb3VuZCAoJXMpIHwgYmFja2dyb3VuZCAo JXMpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICghTklMUCAoZm9yZWdyb3VuZCkgPyBTU0RB VEEgKGZvcmVncm91bmQpIDogIk5JTFAiKSwKKyAgICAgICAgICAgICAgICAgICAgICAoIU5JTFAg KGJhY2tncm91bmQpID8gU1NEQVRBIChiYWNrZ3JvdW5kKSA6ICJOSUxQIikpOworICAtICBFWEFN UExFIE9GIEhPVyBUTyBDUkVBVEUgQSBDT0xPUiBXSVRIIFJHQi9MU0wgZmxvYXQgdmFsdWVzOgor ICAgICBOU0NvbG9yICpteV9jb2xvciA9IFtOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6 IDEuMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Z3JlZW46IDEuMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGJsdWU6IDEuMAorICAgICAgICAgICAgIC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J1Zik7CisgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5z aWVudF9tYXJrX21vZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAo QlZBUiAoYiwgbWFya19hY3RpdmUpKSk7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZ2lubmlu ZyA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9iZWdpbm5pbmcgKCkpIDog LTE7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2VuZCA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJ WE5VTSAoRnJlZ2lvbl9lbmQgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3Qgb3BvaW50X3B0ID0g KHcgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBYRklYTlVNIChGbWFya2Vy X3Bvc2l0aW9uICh3LT5wb2ludG0pKTsKKyAgICAgIGJvb2wgcmVnaW9uX2luX2JvdW5kc19wID0g KHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3Bv aW50X3B0ID49IHJlZ2lvbl9iZWdpbm5pbmcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9wb2ludF9wdCA8IHJlZ2lvbl9lbmQpOworICAgICAgaWYgKHJlZ2lvbl9hY3RpdmVf cAorICAgICAgICAgICYmIHJlZ2lvbl9pbl9ib3VuZHNfcAorICAgICAgICAgICYmIGFjdGl2ZV9w KQorICAgICAgICB7CisgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9u X2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2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AgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93 X2FjdGl2ZV9yZWdpb25fb3V0X2NvbG9yOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlm ICghcmVnaW9uX2FjdGl2ZV9wICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICAg ICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lE IChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICBOU0NvbG9yICpob2xs b3dfYWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dS T1VORCAoaG9sbG93X2FjdGl2ZV9mYWNlKSwgZik7CisgICAgICAgICAgICAgIGhvbGxvd19jb2xv ciA9IGhvbGxvd19hY3RpdmVfY29sb3I7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvKiBU aGUgcmVnaW9uIGlzIF9ub3RfIHZpc2libGUgaW4gdGhlIGluYWN0aXZlIHdpbmRvdyBiZWNhdXNl IHRoZSBvdmVybGF5IHdpbmRvdyBwcm9wZXJ0eSBpcyB1c2VkLiAqLworICAgICAgICAgICAgZWxz ZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZW51bSBm YWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYs IGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1mYWNlIiksIHRydWUpOworICAg ICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJP TV9JRCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgIE5TQ29s b3IgKmhvbGxvd19pbmFjdGl2ZV9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19G QUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19pbmFjdGl2ZV9mYWNlKSwgZik7CisgICAgICAgICAgICAg ICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2luYWN0aXZlX2NvbG9yOworICAgICAgICAgICAgICB9 CisgICAgfQorICAgIGVsc2UgaWYgKGZhY2UgJiYgTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSA9 PSBuc19pbmRleF9jb2xvciAoRlJBTUVfQ1VSU09SX0NPTE9SIChmKSwgZikpCisgICAgICB7Cisg ICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNl KSwgZikgc2V0XTsKKyAgICAgICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VSU09SX0NPTE9SIChm KTsKKyAgICAgIH0KKyNpZmRlZiBOU19JTVBMX0NPQ09BCisgIE5TRGlzYWJsZVNjcmVlblVwZGF0 ZXMgKCk7CisjZW5kaWYKKyAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICB7CisgICAgICBjYXNl IE1DX05PX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19OT19D VVJTT1I6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19SSUdIVF9GUklOR0VfQklUTUFQ OgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAg ICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICAgICAgTlNSZWN0Rmls bCAocik7CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOgorICAgICAg ICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICBO U1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICBbRlJBTUVfQ1VSU09S X0NPTE9SIChmKSBzZXRdOworICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfSE9MTE9XX0JP WDoKKyAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIFtob2xsb3dfY29sb3Igc2V0XTsK KyAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgW0ZS QU1FX0NVUlNPUl9DT0xPUiAoZikgc2V0XTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1D X0hCQVI6CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBicmVhazsKKyAgICAgIGNh c2UgTUNfQkFSOgorICAgICAgICBzID0gcjsKKyAgICAgICAgLyogQGxhd2xpc3QgaXMgZm9jdXNp bmcgdGhlIGluaXRpYWwgZGV2ZWxvcG1lbnQgb2YgZmVhdHVyZSByZXF1ZXN0cworICAgICAgICAj MTc2ODQgYW5kICMyMjg3MyBvbiBMMlIgbGFuZ3VhZ2VzLiAqLworICAgICAgICBpZiAoZ2x5cGhf Zmxhdm9yICE9IE1DX0dMWVBICisgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfR0xZ UEhMRVNTKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIElmIHRoZSBjaGFyYWN0ZXIgdW5k ZXIgY3Vyc29yIGlzIFIyTCwgZHJhdyB0aGUgYmFyIGN1cnNvcgorICAgICAgICAgICAgICAgb24g dGhlIHJpZ2h0IG9mIGl0cyBnbHlwaCwgcmF0aGVyIHRoYW4gb24gdGhlIGxlZnQuICAqLworICAg ICAgICAgICAgaWYgKChjdXJzb3JfZ2x5cGgtPnJlc29sdmVkX2xldmVsICYgMSkgIT0gMCkKKyAg ICAgICAgICAgICAgcy5vcmlnaW4ueCArPSBjdXJzb3JfZ2x5cGgtPnBpeGVsX3dpZHRoIC0gcy5z aXplLndpZHRoOworICAgICAgICAgIH0KKyAgICAgICAgTlNSZWN0RmlsbCAocyk7CisgICAgICAg IGJyZWFrOworICAgIH0KKyAgbnNfcmVzZXRfY2xpcHBpbmcgKGYpOworICAvKiBkcmF3IHRoZSBj aGFyYWN0ZXIgdW5kZXIgdGhlIGN1cnNvciAqLworICBpZiAoZ2x5cGhfZmxhdm9yICE9IE1DX0dM WVBITEVTUworICAgICAgJiYgKGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gKKyAgICAgICAg ICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YCisgICAgICAgICAgfHwgY3Vyc29yX3R5 cGUgPT0gTUNfSE9MTE9XX0JPWAorICAgICAgICAgIHx8IChkZWJ1Z19wCisgICAgICAgICAgICAg ICYmIGN1cnNvcl90eXBlID09IE1DX0hCQVIpCisgICAgICAgICAgfHwgKGRlYnVnX3AKKyAgICAg ICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfQkFSKSkpCisgICAgeworICAgICAgLyogYGN1 cnNvcl9nY19wYCBpcyB1c2VkIG9ubHkgYnkgYHczMnRlcm0uY2AgYW5kIGB4dGVybS5jJy4gKi8K KyAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSBmYWxzZTsKKyAgICAgIG1jX2RyYXdfY3Vyc29yX2ds eXBoICh3LCBtYXRyaXgsIHJvdywgRFJBV19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsIGxzbCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwg YWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICB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7Cisg ICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0Vf VU5ERVJfTElORSkKKyAgICAgICAgeworICAgICAgICAgIE5TUmVjdCByOworICAgICAgICAgIHVu c2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAgICAgICAgICAvKiBJZiB0aGUgcHJl diB3YXMgdW5kZXJsaW5lZCwgbWF0Y2ggaXRzIGFwcGVhcmFuY2UuICovCisgICAgICAgICAgaWYg KHMtPnByZXYgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3AKKyAgICAgICAgICAgICAgJiYg cy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FCisgICAgICAg ICAgICAgICYmIHMtPnByZXYtPnVuZGVybGluZV90aGlja25lc3MgPiAwKQorICAgICAgICAgICAg eworICAgICAgICAgICAgICB0aGlja25lc3MgPSBzLT5wcmV2LT51bmRlcmxpbmVfdGhpY2tuZXNz OworICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsK KyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIHN0cnVjdCBmb250ICpmb250OworICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIGRlc2Nl bnQ7CisgICAgICAgICAgICAgIGZvbnQ9cy0+Zm9udDsKKyAgICAgICAgICAgICAgZGVzY2VudCA9 IHMtPnkgKyBzLT5oZWlnaHQgLSBzLT55YmFzZTsKKyAgICAgICAgICAgICAgLyogVXNlIHVuZGVy bGluZSB0aGlja25lc3Mgb2YgZm9udCwgZGVmYXVsdGluZyB0byAxLiAqLworICAgICAgICAgICAg ICB0aGlja25lc3MgPSAoZm9udCAmJiBmb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAg ICAgICAgICAgICAgICA/IGZvbnQtPnVuZGVybGluZV90aGlja25lc3MgOiAxOworICAgICAgICAg ICAgICAvKiBEZXRlcm1pbmUgdGhlIG9mZnNldCBvZiB1bmRlcmxpbmluZyBmcm9tIHRoZSBiYXNl bGluZS4gKi8KKyAgICAgICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRfbGluZSkK KyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGRlc2NlbnQgLSB0aGlja25lc3M7CisgICAgICAg ICAgICAgIGVsc2UgaWYgKHhfdXNlX3VuZGVybGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVzCisgICAg ICAgICAgICAgICAgICAgICAgICYmIGZvbnQgJiYgZm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49 IDApCisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBmb250LT51bmRlcmxpbmVfcG9zaXRpb247 CisgICAgICAgICAgICAgIGVsc2UgaWYgKGZvbnQpCisgICAgICAgICAgICAgICAgcG9zaXRpb24g PSBscm91bmQgKGZvbnQtPmRlc2NlbnQgLyAyKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgIHBvc2l0aW9uID0gdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0OworICAgICAgICAg ICAgICBwb3NpdGlvbiA9IG1heCAocG9zaXRpb24sIHVuZGVybGluZV9taW5pbXVtX29mZnNldCk7 CisgICAgICAgICAgICAgIC8qIEVuc3VyZSB1bmRlcmxpbmluZyBpcyBub3QgY3JvcHBlZC4gKi8K KyAgICAgICAgICAgICAgaWYgKGRlc2NlbnQgPD0gcG9zaXRpb24pCisgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNjZW50IC0gMTsKKyAgICAgICAgICAg ICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBl bHNlIGlmIChkZXNjZW50IDwgcG9zaXRpb24gKyB0aGlja25lc3MpCisgICAgICAgICAgICAgICAg dGhpY2tuZXNzID0gMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBzLT51bmRlcmxpbmVfdGhp Y2tuZXNzID0gdGhpY2tuZXNzOworICAgICAgICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9IHBv c2l0aW9uOworICAgICAgICAgIHIgPSBOU01ha2VSZWN0ICh4LCBzLT55YmFzZSArIHBvc2l0aW9u LCB3aWR0aCwgdGhpY2tuZXNzKTsKKyAgICAgICAgICBpZiAoZmFjZS0+dW5kZXJsaW5lX2RlZmF1 bHRlZF9wKQorICAgICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAgICBlbHNlCisg ICAgICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZhY2UtPnVuZGVybGluZV9jb2xv ciwgcy0+Zikgc2V0XTsKKyAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgfQorICAg IH0KKyAgLyogRG8gb3ZlcmxpbmUuIFdlIGZvbGxvdyBvdGhlciB0ZXJtcyBpbiB1c2luZyBhIHRo aWNrbmVzcyBvZiAxCisgICAgIGFuZCBpZ25vcmluZyBvdmVybGluZV9tYXJnaW4uICovCisgIGlm IChmYWNlLT5vdmVybGluZV9wKQorICAgIHsKKyAgICAgIE5TUmVjdCByOworICAgICAgciA9IE5T TWFrZVJlY3QgKHgsIHMtPnksIHdpZHRoLCAxKTsKKyAgICAgIGlmIChmYWNlLT5vdmVybGluZV9j b2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgIGVsc2UK KyAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChmYWNlLT5vdmVybGluZV9jb2xvciwg cy0+Zikgc2V0XTsKKyAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgIH0KKyAgLyogRG8gc3RyaWtl LXRocm91Z2guICBXZSBmb2xsb3cgb3RoZXIgdGVybXMgZm9yIHRoaWNrbmVzcyBhbmQKKyAgICAg dmVydGljYWwgcG9zaXRpb24uKi8KKyAgaWYgKGZhY2UtPnN0cmlrZV90aHJvdWdoX3ApCisgICAg eworICAgICAgTlNSZWN0IHI7CisgICAgICB1bnNpZ25lZCBsb25nIGR5OworICAgICAgZHkgPSBs cmludCAoKHMtPmhlaWdodCAtIDEpIC8gMik7CisgICAgICByID0gTlNNYWtlUmVjdCAoeCwgcy0+ eSArIGR5LCB3aWR0aCwgMSk7CisgICAgICBpZiAoZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3Jf ZGVmYXVsdGVkX3ApCisgICAgICAgIFtkZWZhdWx0Q29sIHNldF07CisgICAgICBlbHNlCisgICAg ICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3Is IHMtPmYpIHNldF07CisgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICB9Cit9CisKK3N0YXRpYyB2 b2lkCittY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2ggKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIGlu dCB3ZCwgc3RydWN0IGdseXBoX3JvdyAqcm93KQoreworICBOU1JlY3QgclsyXTsKKyAgaW50IG4s IGk7CisgIHN0cnVjdCBmYWNlICpmYWNlOworICBOU0NvbG9yICpmZ0NvbCwgKmJnQ29sOworICBp ZiAoIXMtPmJhY2tncm91bmRfZmlsbGVkX3ApCisgICAgeworICAgICAgbiA9IG5zX2dldF9nbHlw aF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgICpyID0gTlNNYWtlUmVjdCAocy0+eCwg cy0+eSwgcy0+YmFja2dyb3VuZF93aWR0aCwgcy0+aGVpZ2h0KTsKKyAgICAgIGlmICghbWNfbnNf Y2xpcF90b19yZWN0IChzLT5mLCByLCBuLCByb3cpKQorICAgICAgICByZXR1cm47CisgICAgICBp ZiAocy0+aGwgPT0gRFJBV19NT1VTRV9GQUNFKQorICAgICAgIHsKKyAgICAgICAgIGZhY2UgPSBG QUNFX0ZST01fSUQgKHMtPmYsIE1PVVNFX0hMX0lORk8gKHMtPmYpLT5tb3VzZV9mYWNlX2ZhY2Vf aWQpOworICAgICAgICAgaWYgKCFmYWNlKQorICAgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lE IChzLT5mLCBNT1VTRV9GQUNFX0lEKTsKKyAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgZmFj ZSA9IEZBQ0VfRlJPTV9JRCAocy0+Ziwgcy0+Zmlyc3RfZ2x5cGgtPmZhY2VfaWQpOworICAgICAg YmdDb2wgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNl KSwgcy0+Zik7CisgICAgICBmZ0NvbCA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNF X0ZPUkVHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICAgIGZvciAoaSA9IDA7IGkgPCBuOyArK2kp CisgICAgICAgIHsKKyAgICAgICAgICBpZiAoIXMtPnJvdy0+ZnVsbF93aWR0aF9wKQorICAgICAg ICAgICAgeworICAgICAgICBpbnQgb3ZlcnJ1biwgbGVmdG92ZXJydW47CisgICAgICAgICAgICAg IC8qIHRydW5jYXRlIHRvIGF2b2lkIG92ZXJ3cml0aW5nIGZyaW5nZSBhbmQvb3Igc2Nyb2xsYmFy ICovCisgICAgICAgIG92ZXJydW4gPSBtYXggKDAsIChzLT54ICsgcy0+YmFja2dyb3VuZF93aWR0 aCkKKyAgICAgICAgICAgLSAoV0lORE9XX0JPWF9SSUdIVF9FREdFX1ggKHMtPncpCisgICAgICAg IC0gV0lORE9XX1JJR0hUX0ZSSU5HRV9XSURUSCAocy0+dykpKTsKKyAgICAgICAgICAgICAgcltp XS5zaXplLndpZHRoIC09IG92ZXJydW47CisgICAgICAgIC8qIHRydW5jYXRlIHRvIGF2b2lkIG92 ZXJ3cml0aW5nIHRvIGxlZnQgb2YgdGhlIHdpbmRvdyBib3ggKi8KKyAgICAgICAgbGVmdG92ZXJy dW4gPSAoV0lORE9XX0JPWF9MRUZUX0VER0VfWCAocy0+dykKKyAgICAgICAgICAgKyBXSU5ET1df TEVGVF9GUklOR0VfV0lEVEggKHMtPncpKSAtIHMtPng7CisgICAgICAgIGlmIChsZWZ0b3ZlcnJ1 biA+IDApCisgICAgICAgICAgeworICAgICAgICAgICAgcltpXS5vcmlnaW4ueCArPSBsZWZ0b3Zl cnJ1bjsKKyAgICAgICAgICAgIHJbaV0uc2l6ZS53aWR0aCAtPSBsZWZ0b3ZlcnJ1bjsKKyAgICAg ICAgICB9CisgICAgICAgICAgICAgIC8qIFhYWDogVHJ5IHRvIHdvcmsgYmV0d2VlbiBwcm9ibGVt IHdoZXJlIGEgc3RyZXRjaCBnbHlwaCBvbgorICAgICAgICAgICAgICAgICBhIHBhcnRpYWxseS12 aXNpYmxlIGJvdHRvbSByb3cgd2lsbCBjbGVhciBwYXJ0IG9mIHRoZQorICAgICAgICAgICAgICAg ICBtb2RlbGluZSwgYW5kIGFub3RoZXIgd2hlcmUgbGlzdC1idWZmZXJzIGhlYWRlcnMgYW5kIHNp bWlsYXIKKyAgICAgICAgICAgICAgICAgcm93cyBlcnJvbmVvdXNseSBoYXZlIHZpc2libGVfaGVp Z2h0IHNldCB0byAwLiAgTm90IHN1cmUKKyAgICAgICAgICAgICAgICAgd2hlcmUgdGhpcyBpcyBj b21pbmcgZnJvbSBhcyBvdGhlciB0ZXJtcyBzZWVtIG5vdCB0byBzaG93LiAqLworICAgICAgICAg ICAgICByW2ldLnNpemUuaGVpZ2h0ID0gbWluIChzLT5oZWlnaHQsIHMtPnJvdy0+dmlzaWJsZV9o ZWlnaHQpOworICAgICAgICAgICAgfQorICAgICAgICAgIFtiZ0NvbCBzZXRdOworICAgICAgICAg IC8qIE5PVEU6IHVuZGVyIE5TIHRo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AgIC8vICBbY29s b3Igc2V0XTsKKyAgICAgICAgICAgICAgQ0dGbG9hdCB4ID0gcltpXS5vcmlnaW4ueDsKKyAgICAg ICAgICAgICAgQ0dGbG9hdCB3aWR0aCA9IHdkOworICAgICAgICAgICAgICByW2ldLnNpemUud2lk dGggLT0gd2lkdGg7CisgICAgICAgICAgICAgIHJbaV0ub3JpZ2luLnggKz0gd2lkdGg7CisgICAg ICAgICAgICAgIE5TUmVjdEZpbGwgKHJbaV0pOworICAgICAgICAgICAgICAvKiBEcmF3IG92ZXJs aW5pbmcsIGV0Yy4gb24gdGhlIGN1cnNvci4gKi8KKyAgICAgICAgICAgICAgaWYgKHMtPnctPnBo eXNfY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVEX0JPWCkKKyAgICAgICAgICAgICAgICBtY19uc19k cmF3X3RleHRfZGVjb3JhdGlvbiAocywgZmFjZSwgYmdDb2wsIHdpZHRoLCB4KTsKKyAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBtY19uc19kcmF3X3RleHRfZGVjb3JhdGlv biAocywgZmFjZSwgZmdDb2wsIHdpZHRoLCB4KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBl bHNlCisgICAgICAgICAgICB7CisgIC8vICBpbnQgcnggPSByW2ldLm9yaWdpbi54OworICAvLyAg aW50IHJ5ID0gcltpXS5vcmlnaW4ueTsKKyAgLy8gIGludCBydyA9IHJbaV0uc2l6ZS53aWR0aDsK KyAgLy8gIGludCByaCA9IHJbaV0uc2l6ZS5oZWlnaHQ7CisgIC8vICBmcHJpbnRmIChzdGRlcnIs ICJtY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2g6ICB2cG9zICglZCkgfCByeCAoJWQpIHwgcnkgKCVk KSB8IHJ3ICglZCkgfCByaCAoJWQpXG4iLAorICAvLyAgICAgICAgICAgICAgICAgICBzLT5maXJz dF9nbHlwaC0+dnBvcywgcngsIHJ5LCBydywgcmgpOworICAgICAgICAgICAgICBOU1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saWNlLmhlaWdo dCk7CisgICAgfQorICBOU1JlY3RGaWxsIChicik7CisgIC8qIERyYXcgdGhlIGltYWdlLi4gZG8g d2UgbmVlZCB0byBkcmF3IHBsYWNlaG9sZGVyIGlmIGltZyA9PW5pbD8gKi8KKyAgaWYgKGltZyAh PSBuaWwpCisgICAgeworI2lmZGVmIE5TX0lNUExfQ09DT0EKKyAgICAgIE5TUmVjdCBkciA9IE5T TWFrZVJlY3QgKHgsIHksIHMtPnNsaWNlLndpZHRoLCBzLT5zbGljZS5oZWlnaHQpOworICAgICAg TlNSZWN0IGlyID0gTlNNYWtlUmVjdCAocy0+c2xpY2UueCwgcy0+c2xpY2UueSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLndpZHRoLCBzLT5zbGljZS5oZWlnaHQpOwor ICAgICAgW2ltZyBkcmF3SW5SZWN0OiBkcgorICAgICAgICAgICAgIGZyb21SZWN0OiBpcgorICAg ICAgICAgICAgIG9wZXJhdGlvbjogTlNDb21wb3NpdGVTb3VyY2VPdmVyCisgICAgICAgICAgICAg IGZyYWN0aW9uOiAxLjAKKyAgICAgICAgICAgcmVzcGVjdEZsaXBwZWQ6IFlFUworICAgICAgICAg ICAgICAgIGhpbnRzOiBuaWxdOworI2Vsc2UKKyAgICAgIFtpbWcgY29tcG9zaXRlVG9Qb2ludDog TlNNYWtlUG9pbnQgKHgsIHkgKyBzLT5zbGljZS5oZWlnaHQpCisgICAgICAgICAgICAgICAgICBv cGVyYXRpb246IE5TQ29tcG9zaXRlU291cmNlT3Zlcl07CisjZW5kaWYKKyAgICB9CisgIGlmIChz LT5obCA9PSBEUkFXX0NVUlNPUikKKyAgICB7CisgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAocy0+ Zikgc2V0XTsKKyAgICBpZiAocy0+dy0+cGh5c19jdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9Y KQorICAgICAgdGRDb2wgPSBuc19sb29rdXBfaW5kZXhlZF9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lTRUQpCisgICAgICAgIHsKKyAgICAgICAgICB0aCA9IHRvb2xfYmFyX2J1dHRvbl9yZWxpZWYg Pj0gMCA/CisgICAgICAgICAgICB0b29sX2Jhcl9idXR0b25fcmVsaWVmIDogREVGQVVMVF9UT09M X0JBUl9CVVRUT05fUkVMSUVGOworICAgICAgICAgIHJhaXNlZF9wID0gKHMtPmhsID09IERSQVdf SU1BR0VfUkFJU0VEKTsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAg ICAgdGggPSBhYnMgKHMtPmltZy0+cmVsaWVmKTsKKyAgICAgICAgICByYWlzZWRfcCA9IChzLT5p bWctPnJlbGllZiA+IDApOworICAgICAgICB9CisgICAgICByLm9yaWdpbi54ID0geCAtIHRoOwor ICAgICAgci5vcmlnaW4ueSA9IHkgLSB0aDsKKyAgICAgIHIuc2l6ZS53aWR0aCA9IHMtPnNsaWNl LndpZHRoICsgMip0aC0xOworICAgICAgci5zaXplLmhlaWdodCA9IHMtPnNsaWNlLmhlaWdodCAr IDIqdGgtMTsKKyAgICAgIG5zX2RyYXdfcmVsaWVmIChyLCB0aCwgcmFpc2VkX3AsCisgICAgICAg ICAgICAgICAgICAgICAgcy0+c2xpY2UueSA9PSAwLAorICAgICAgICAgICAgICAgICAgICAgIHMt PnNsaWNlLnkgKyBzLT5zbGljZS5oZWlnaHQgPT0gcy0+aW1nLT5oZWlnaHQsCisgICAgICAgICAg ICAgICAgICAgICAgcy0+c2xpY2UueCA9PSAwLAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNs aWNlLnggKyBzLT5zbGljZS53aWR0aCA9PSBzLT5pbWctPndpZHRoLCBzKTsKKyAgICB9CisgIC8q IElmIHRoZXJlIGlzIG5vIG1hc2ssIHRoZSBiYWNrZ3JvdW5kIHdvbid0IGJlIHNlZW4sCisgICAg IHNvIGRyYXcgYSByZWN0YW5nbGUgb24gdGhlIGltYWdlIGZvciB0aGUgY3Vyc29yLgorICAgICBE byB0aGlzIGZvciBhbGwgaW1hZ2VzLCBnZXR0aW5nIHRyYW5zcGFyZW5jeSByaWdodCBpcyBub3Qg cmVsaWFibGUuICAqLworICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IpCisgICAgeworICAgICAg aW50IHRoaWNrbmVzcyA9IGFicyAocy0+aW1nLT5yZWxpZWYpOworICAgICAgaWYgKHRoaWNrbmVz cyA9PSAwKSB0aGlja25lc3MgPSAxOworICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEgK KyAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBITEVTUykKKyAgICAgIHsKKyAgICAg ICAgTlNDb2xvciAqYm9yZGVyX2NvbG9yID0gW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJl ZDogbHNsLnJlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGdyZWVuOiBsc2wuZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogbHNsLmJsdWUKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYTog MS4wXTsKKyAgICAgICAgbnNfZHJhd19ib3ggKGJyLCB0aGlja25lc3MsIGJvcmRlcl9jb2xvciwg MSwgMSk7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIG5zX2RyYXdfYm94IChiciwgdGhp Y2tuZXNzLCBGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpLCAxLCAxKTsKKyAgICB9Cit9CisKK3N0 YXRpYyB2b2lkCittY19uc19vdmVyd3JpdHRlbl9oZWxwZXIgKHN0cnVjdCBnbHlwaF9zdHJpbmcg KnMsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgc3RydWN0IGdseXBoX3JvdyAqcm93LCBlbnVtIHR5cGVfb2ZfY2FjaGUgY2FjaGVfdHlwZSwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaCkKK3sKKyAgLy8g bnNfZHJhd191bmRlcndhdmUgKHMsIHMtPndpZHRoLCBzLT54KTsKKyAgTlNDb2xvciAqaG9sbG93 X2NvbG9yID0gRlJBTUVfQkFDS0dST1VORF9DT0xPUiAocy0+Zik7CisgIHN0cnVjdCBmYWNlICpm YWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBERUZBVUxUX0ZBQ0VfSUQpOworICBpbnQgcm93X3Zw b3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgc3RydWN0IG11bHRpcGxlX2N1 cnNvcnNfY2FjaGUgZm9vX2VsdHM7CisgIHN3aXRjaCAoY2FjaGVfdHlwZSkKKyAgICB7CisgICAg ICBjYXNlIE5PX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0K KyAgICAgIGNhc2UgTUNfQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBmb29fZWx0cy5jYWNo ZXMgPSBzLT53LT5tY19lbHRzLmNhY2hlczsKKyAgICAgICAgICBmb29fZWx0cy5hbGxvY2F0ZWQg PSBzLT53LT5tY19lbHRzLmFsbG9jYXRlZDsKKyAgICAgICAgICBmb29fZWx0cy51c2VkID0gcy0+ dy0+bWNfZWx0cy51c2VkOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNl IENIX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgZm9vX2VsdHMuY2FjaGVzID0gcy0+dy0+ Y2hfZWx0cy5jYWNoZXM7CisgICAgICAgICAgZm9vX2VsdHMuYWxsb2NhdGVkID0gcy0+dy0+Y2hf ZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgZm9vX2VsdHMudXNlZCA9IHMtPnctPmNoX2VsdHMu dXNlZDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBGQ19DQUNIRToK KyAgICAgICAgeworICAgICAgICAgIGZvb19lbHRzLmNhY2hlcyA9IHMtPnctPmZjX2VsdHMuY2Fj aGVzOworICAgICAgICAgIGZvb19lbHRzLmFsbG9jYXRlZCA9IHMtPnctPmZjX2VsdHMuYWxsb2Nh dGVkOworICAgICAgICAgIGZvb19lbHRzLnVzZWQgPSBzLT53LT5mY19lbHRzLnVzZWQ7CisgICAg ICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisgIC8qIFNUUkVUQ0hfR0xZUEggbWF5IGNv bnRhaW4gbW9yZSB0aGFuIG9uZSBmYWtlIGN1cnNvciBhdCB0aGUgc2FtZSBIUE9TLiAqLworICBm b3IgKGludCBlbHQgPSAwOyBlbHQgPCBmb29fZWx0cy51c2VkOyArK2VsdCkKKyAgICB7CisgICAg ICBpbnQgeCA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLng7CisgICAgICBpbnQgZnggPSBmb29fZWx0 cy5jYWNoZXNbZWx0XS5meDsKKyAgICAgIGludCB5ID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0ueTsK KyAgICAgIGludCBmeSA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLmZ5OworICAgICAgaW50IGhwb3Mg PSBmb29fZWx0cy5jYWNoZXNbZWx0XS5ocG9zOworICAgICAgaW50IHZwb3MgPSBmb29fZWx0cy5j YWNoZXNbZWx0XS52cG9zOworICAgICAgaW50IHdkID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0ud2Q7 CisgICAgICBpbnQgaCA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLmg7CisgICAgICBlbnVtIHR5cGVf b2ZfY3Vyc29yIGN1cnNvcl90eXBlID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0uY3Vyc29yX3R5cGU7 CisgICAgICBpbnQgY3Vyc29yX3dpZHRoID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0uY3Vyc29yX3dp ZHRoOworICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmcgPSB7LnJlZCA9IGZvb19lbHRzLmNhY2hl c1tlbHRdLmZvcmVncm91bmQucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdy ZWVuID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0uZm9yZWdyb3VuZC5ncmVlbiwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIC5ibHVlID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0uZm9yZWdyb3Vu ZC5ibHVlfTsKKyAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2JnID0gey5yZWQgPSBmb29fZWx0cy5j YWNoZXNbZWx0XS5iYWNrZ3JvdW5kLnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IC5ncmVlbiA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLmJhY2tncm91bmQuZ3JlZW4sCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLmJhY2tn cm91bmQuYmx1ZX07CisgICAgICBib29sIGFjdGl2ZV9wID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0u YWN0aXZlX3A7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBmb29fZWx0cy5j YWNoZXNbZWx0XS5nbHlwaF9mbGF2b3I7CisgICAgICBib29sIGVuYWJsZWRfcCA9IGZvb19lbHRz LmNhY2hlc1tlbHRdLmVuYWJsZWRfcDsKKyAgICAgIGJvb2wgZ29fcCA9ICh2cG9zID09IHJvd192 cG9zCisgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA9PSBnbHlwaC0+aHBvcworICAgICAgICAg ICAgICAgICAgICYmIGVuYWJsZWRfcCk7CisgICAgICBpZiAoIWdvX3ApCisgICAgICAgIGNvbnRp bnVlOworICAgICAgTlNSZWN0IHI7CisgICAgICByLm9yaWdpbi54ID0gZng7CisgICAgICByLm9y aWdpbi55ID0gZnk7CisgICAgICByLnNpemUuaGVpZ2h0ID0gaDsKKyAgICAgIHIuc2l6ZS53aWR0 aCA9IHdkOworICAgICAgW1tOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IGxzbF9mZy5y ZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVuOiBsc2xfZmcuZ3JlZW4K KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiBsc2xfZmcuYmx1ZQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF0gc2V0XTsKKyAgaWYgKGN1 cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gpCisgICAgeworICAgICAgTGlzcF9PYmplY3QgYnVm ID0gcy0+dy0+Y29udGVudHM7CisgICAgICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgICAgICBzdHJ1 Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgICAgIGJvb2wgcmVnaW9uX2FjdGl2ZV9w ID0gKCFOSUxQIChWdHJhbnNpZW50X21hcmtfbW9kZSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFOSUxQIChCVkFSIChiLCBtYXJrX2FjdGl2ZSkpKTsKKyAgICAgIHB0cmRpZmZf dCByZWdpb25fYmVnaW5uaW5nID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBYRklYTlVNIChGcmVnaW9u X2JlZ2lubmluZyAoKSkgOiAtMTsKKyAgICAgIHB0cmRpZmZfdCByZWdpb25fZW5kID0gKHJlZ2lv bl9hY3RpdmVfcCkgPyBYRklYTlVNIChGcmVnaW9uX2VuZCAoKSkgOiAtMTsKKyAgICAgIHB0cmRp ZmZfdCBvcG9pbnRfcHQgPSAocy0+dyA9PSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gUFQKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IFhGSVhOVU0gKEZtYXJrZXJfcG9zaXRpb24gKHMtPnctPnBvaW50bSkpOworICAgICAgYm9v bCByZWdpb25faW5fYm91bmRzX3AgPSAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfcHQgPj0gcmVnaW9uX2JlZ2lubmluZworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3B0IDwgcmVnaW9uX2VuZCk7Cisg ICAgICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgJiYgcmVnaW9uX2luX2JvdW5kc19w CisgICAgICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgIHsKKyAgICAgICAgICBlbnVtIGZhY2Vf aWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53 LCBzLT5mLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcmVnaW9uLWZhY2UiKSwgdHJ1ZSk7 CisgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2UgPSBGQUNF X0ZST01fSUQgKHMtPmYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2VfaWQpOworICAgICAgICAg IE5TQ29sb3IgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRf Y29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZSksIHMt PmYpOworICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2NvbG9y OworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKHJlZ2lvbl9hY3RpdmVfcAorIC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X0JBQ0tH Uk9VTkQgKGZhY2UpID09IG5zX2luZGV4X2NvbG9yIChGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYp LCBzLT5mKSkKKyAgICAgIHsKKyAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19G QUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBzLT5mKSBzZXRdOworICAgICAgICBob2xsb3dfY29sb3Ig PSBGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpOworICAgICAgfQorICAgICAgc3dpdGNoIChjdXJz b3JfdHlwZSkKKyAgICAgICAgeworICAgICAgICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoK KyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgorICAgICAg ICAgICAgYnJlYWs7CisgICAgICAgICAgY2FzZSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOgorICAg ICAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAgICAgICAgIGNhc2UgTUNfRklM TEVEX0JPWDoKKyAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgYnJlYWs7 CisgICAgICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOgorICAgICAgICAgICAgTlNSZWN0RmlsbCAo cik7CisgICAgICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAgICAgICAgICBOU1JlY3RG aWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICAgICAgW0ZSQU1FX0NVUlNPUl9D T0xPUiAocy0+Zikgc2V0XTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgTUNf SE9MTE9XX0JPWDoKKyAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgW2hv bGxvd19jb2xvciBzZXRdOworICAgICAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIs IDEsIDEpKTsKKyAgICAgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpIHNldF07Cisg ICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAgICAgICBO U1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgTUNfQkFS OgorICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICBicmVhazsKKyAgICAg ICAgfQorICAgICAgLyogSWYgYSBnbHlwaCBleGlzdHMgKHMtPmNoYXIyYiAhPSBOVUxMKSwgdGhl biBkcmF3IHRoZSBnbHlwaCBvbiB0b3Agb2YgdGhlCisgICAgICBuZXdseSBkcmF3biByZWN0YW5n bGUgdGhhdCB3YXMgY3JlYXRlZCBoZXJlaW5hYm92ZS4gIFRvIHRoZSBleHRlbnQgdGhhdCB3ZQor ICAgICAgd2FudCB0byBkb3VibGUtaW1wcmludCBnbHlwaHMgdG8gbWFrZSB0aGVtIGFwcGVhciB0 byBiZSBzZW1pLWJvbGQsIGl0IGNhbgorICAgICAgYmUgZG9uZSBoZXJlIGZvciBhbGwgY3Vyc29y IHR5cGVzLiAgVGhlIGJveC1zdHlsZSBjdXJzb3JzIGFyZSBpbXByaW50ZWQKKyAgICAgIHdpdGgg Z2x5cGhzIG9ubHkgb25lICgxKSB0aW1lLiAgVGhlIHNlbWktYm9sZCBhcHBlYXJhbmNlIGlzIGhl bHBmdWwgd2hlbgorICAgICAgZGVidWdnaW5nIHRvIHNlZSB0aGF0IHRoZSBjb29yZGluYXRlcyBh cmUgY29ycmVjdC4gKi8KKyAgICAgIGlmIChzLT5jaGFyMmIgIT0gTlVMTAorICAgICAgICAgICYm IChjdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YCisgICAgICAgICAgICAgIHx8IGN1cnNvcl90 eXBlID09IE1DX0ZSQU1FRF9CT1gKKyAgICAgICAgICAgICAgfHwgY3Vyc29yX3R5cGUgPT0gTUNf SE9MTE9XX0JPWCkpCisgICAgICAgIHsKKyAgICAgICAgICBCT09MIGlzQ29tcG9zaXRlID0gcy0+ Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIOworICAgICAgICAgIGlmIChpc0Nv bXBvc2l0ZSkKKyAgICAgICAgICAgIG5zX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3Jl Z3JvdW5kIChzKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgIHN0cnVjdCBmb250ICpmb250ID0gcy0+ZmFjZS0+Zm9udDsKKyAgICAgICAgICAgICAg ICBpZiAoIWZvbnQpCisgICAgICAgICAgICAgICAgICBmb250ID0gRlJBTUVfRk9OVCAocy0+Zik7 CisgICAgICAgICAgICAgICAgYm9vbCB3aXRoX2JnX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAg ICBmb250LT5kcml2ZXItPmRyYXcgKHMsIHMtPmNtcF9mcm9tLCBzLT5uY2hhcnMsIHMtPngsIHMt PnliYXNlLCB3aXRoX2JnX3ApOworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cit9 CisKK3N0YXRpYyB2b2lkCittY19uc19kcmF3X292ZXJ3cml0dGVuIChzdHJ1Y3QgZ2x5cGhfc3Ry aW5nICpzLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsCisgICAgICAgICAgICAgICAgICAg ICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIHN0cnVjdCBnbHlwaCAqZ2x5cGgpCit7CisgIC8v ICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAvLyAgY2xvY2tf dCBjbG9ja19zdGFydCA9IGNsb2NrKCk7CisgIG1jX25zX292ZXJ3cml0dGVuX2hlbHBlciAocywg bWF0cml4LCByb3csIE1DX0NBQ0hFLCBnbHlwaCk7CisgIG1jX25zX292ZXJ3cml0dGVuX2hlbHBl ciAocywgbWF0cml4LCByb3csIENIX0NBQ0hFLCBnbHlwaCk7CisgIG1jX25zX292ZXJ3cml0dGVu X2hlbHBlciAocywgbWF0cml4LCByb3csIEZDX0NBQ0hFLCBnbHlwaCk7CisgIC8vICBjbG9ja190 IGNsb2NrX2VuZCA9IGNsb2NrKCk7CisgIC8vICBkb3VibGUgY3B1X3RpbWVfdXNlZCA9ICgoZG91 YmxlKSAoY2xvY2tfZW5kIC0gY2xvY2tfc3RhcnQpKSAvIENMT0NLU19QRVJfU0VDOworICAvLyAg ZnByaW50ZiAoc3RkZXJyLCAibnNfZHJhd19vdmVyd3JpdHRlbiAoJWQpOiAgVElNRSAoJWYpXG4i LCB2cG9zLCBjcHVfdGltZV91c2VkKTsKK30KKworc3RhdGljIHZvaWQKK21jX25zX21heWJlX2R1 bXBnbHlwaHNfYmFja2dyb3VuZCAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgY2hhciBmb3JjZV9w KQoreworICBOU1RSQUNFICgibWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIik7Cisg IGlmICghcy0+YmFja2dyb3VuZF9maWxsZWRfcC8qIHx8IHMtPmhsID09IERSQVdfTU9VU0VfRkFD RSovKQorICAgIHsKKyAgICAgIGludCBib3hfbGluZV93aWR0aCA9IG1heCAocy0+ZmFjZS0+Ym94 X2xpbmVfd2lkdGgsIDApOworICAgICAgaWYgKEZPTlRfSEVJR0hUIChzLT5mb250KSA8IHMtPmhl aWdodCAtIDIgKiBib3hfbGluZV93aWR0aAorICAgICAgICAgIC8qIFdoZW4geGRpc3AuYyBpZ25v cmVzIEZPTlRfSEVJR0hULCB3ZSBjYW5ub3QgdHJ1c3QgZm9udAorICAgICAgICAgICAgIGRpbWVu c2lvbnMsIHNpbmNlIHRoZSBhY3R1YWwgZ2x5cGhzIG1pZ2h0IGJlIG11Y2gKKyAgICAgICAgICAg ICBzbWFsbGVyLiAgU28gaW4gdGhhdCBjYXNlIHdlIGFsd2F5cyBjbGVhciB0aGUgcmVjdGFuZ2xl CisgICAgICAgICAgICAgd2l0aCBiYWNrZ3JvdW5kIGNvbG9yLiAgKi8KKyAgICAgICAgICB8fCBG T05UX1RPT19ISUdIIChzLT5mb250KQorICAgICAgICAgIHx8IHMtPmZvbnRfbm90X2ZvdW5kX3Ag fHwgcy0+ZXh0ZW5kc190b19lbmRfb2ZfbGluZV9wIHx8IGZvcmNlX3ApCisgICAgICB7CisgICAg ICAgICAgc3RydWN0IGZhY2UgKmZhY2U7CisgICAgICAgICAgaWYgKHMtPmhsID09IERSQVdfTU9V U0VfRkFDRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZmFjZSA9IEZBQ0VfRlJPTV9J RCAocy0+ZiwKKyAgICAgICAgICAgTU9VU0VfSExfSU5GTyAocy0+ZiktPm1vdXNlX2ZhY2VfZmFj ZV9pZCk7CisgICAgICAgICAgICAgIGlmICghZmFjZSkKKyAgICAgICAgICAgICAgICBmYWNlID0g RkFDRV9GUk9NX0lEIChzLT5mLCBNT1VTRV9GQUNFX0lEKTsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgICBlbHNlCisgICAgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBzLT5maXJz dF9nbHlwaC0+ZmFjZV9pZCk7CisgICAgICAgICAgaWYgKCFmYWNlLT5zdGlwcGxlKQorICAgICAg ICAgICAgWyhOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpICE9IDAKKyAgICAgICAgICAgICAgPyBu c19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSwgcy0+ZikK KyAgICAgICAgICAgICAgOiBGUkFNRV9CQUNLR1JPVU5EX0NPTE9SIChzLT5mKSkgc2V0XTsKKyAg ICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHN0cnVjdCBuc19kaXNw bGF5X2luZm8gKmRweWluZm8gPSBGUkFNRV9ESVNQTEFZX0lORk8gKHMtPmYpOworICAgICAgICAg ICAgICBbW2RweWluZm8tPmJpdG1hcHNbZmFjZS0+c3RpcHBsZS0xXS5pbWcgc3RpcHBsZU1hc2td IHNldF07CisgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKHMtPmhsICE9IERSQVdfQ1VSU09S KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzLT5yZWN0YW5nbGVfbnVrZWRfcCA9IHRy dWU7CisgICAgICAgICAgICAgIE5TUmVjdCByID0gTlNNYWtlUmVjdCAocy0+eCwgcy0+eSArIGJv eF9saW5lX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+YmFj a2dyb3VuZF93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPmhl aWdodC0yKmJveF9saW5lX3dpZHRoKTsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7Cisg ICAgICAgICAgICB9CisgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAgICB9Cisg ICAgfQorfQorCitzdGF0aWMgdm9pZAorbWNfbnNfZHJhd19nbHlwaF9zdHJpbmcgKHN0cnVjdCBn bHlwaF9zdHJpbmcgKnMsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBo X3JvdyAqcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsLCBl bnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgZW51 bSB0eXBlX29mX2N1cnNvciBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBp bnQgd2QsIGJvb2wgYWN0aXZlX3AsIGJvb2wgY3Vyc29yX2djX3ApCisvKiAtLS0tLS0tLS0tLS0t LS0tLS0tLS0tL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lQSCkKKyAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocy0+bmV4 dCwgcik7CisgICAgICAgICAgICAgICAgaWYgKCFtY19uc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIs IG4sIHJvdykpCisgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgbWNf bnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLT5uZXh0LCAxKTsKKyAgICAgICAgICAg ICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIG1jX25zX2R1bXBnbHlw aHNfc3RyZXRjaCAocy0+bmV4dCwgd2QsIHJvdyk7CisgICAgICAgICAgICAgICAgaWYgKChzLT5u ZXh0LT5sZWZ0X292ZXJ3cml0dGVuX3AgfHwgcy0+bmV4dC0+cmlnaHRfb3ZlcndyaXR0ZW5fcCkK KyAgICAgICAgICAgICAgICAgICAgJiYgcy0+bmV4dC0+YWN0aW9uX3R5cGUgPT0gTUNfRFJBV19H TFlQSCkKKyAgICAgICAgICAgICAgICAgIG1jX25zX2RyYXdfb3ZlcndyaXR0ZW4gKHMtPm5leHQs IG1hdHJpeCwgcm93LCBzLT5uZXh0LT5maXJzdF9nbHlwaCk7CisgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgfQorICAgIH0KKyAgaWYg KCFzLT5mb3Jfb3ZlcmxhcHMgJiYgcy0+ZmFjZS0+Ym94ICE9IEZBQ0VfTk9fQk9YCisgICAgICAm JiAocy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgIHx8IHMtPmZp cnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCkpCisgICAgeworICAgICAgbiA9IG5z X2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICghbWNfbnNfY2xp cF90b19yZWN0IChzLT5mLCByLCBuLCByb3cpKQorICAgICAgICByZXR1cm47CisgICAgICBtY19u c19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQgKHMsIDEpOworICAgICAgbnNfZHVtcGdseXBo c19ib3hfb3JfcmVsaWVmIChzKTsKKyAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChzLT5mKTsKKyAg ICAgIGJveF9kcmF3bl9wID0gMTsKKyAgICB9CisgIHN3aXRjaCAocy0+Zmlyc3RfZ2x5cGgtPnR5 cGUpCisgICAgeworICAgIGNhc2UgSU1BR0VfR0xZUEg6CisgICAgICBuID0gbnNfZ2V0X2dseXBo X3N0cmluZ19jbGlwX3JlY3QgKHMsIHIpOworICAgICAgaWYgKCFtY19uc19jbGlwX3RvX3JlY3Qg KHMtPmYsIHIsIG4sIHJvdykpCisgICAgICAgIHJldHVybjsKKyAgICAgIG1jX25zX2R1bXBnbHlw aHNfaW1hZ2UgKHMsIHJbMF0sIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgYWN0aXZl X3ApOworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgYnJlYWs7CisgICAg Y2FzZSBTVFJFVENIX0dMWVBIOgorICAgICAgbWNfbnNfZHVtcGdseXBoc19zdHJldGNoIChzLCB3 ZCwgcm93KTsKKyAgICAgIGlmICgocy0+bGVmdF9vdmVyd3JpdHRlbl9wIHx8IHMtPnJpZ2h0X292 ZXJ3cml0dGVuX3ApCisgICAgICAgICAgJiYgcy0+YWN0aW9uX3R5cGUgPT0gTUNfRFJBV19HTFlQ SCkKKyAgICAgICAgbWNfbnNfZHJhd19vdmVyd3JpdHRlbiAocywgbWF0cml4LCByb3csIHMtPmZp cnN0X2dseXBoK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kQgKHMtPmZhY2UpOworICAg ICAgICAgIE5TX0ZBQ0VfQkFDS0dST1VORCAocy0+ZmFjZSkgPSBOU19GQUNFX0ZPUkVHUk9VTkQg KHMtPmZhY2UpOworICAgICAgICAgIE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgPSB0bXA7 CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IKKyAgICAg ICAgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWAorICAgICAgICAgICAg ICAgICAmJiBhY3RpdmVfcCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBlbnVtIGZhY2VfaWQg aG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGlu dGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgc3Ry dWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93 X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgIE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFj ZSkgPSBOU19GQUNFX0ZPUkVHUk9VTkQgKGhvbGxvd19hY3RpdmVfZmFjZSk7CisgICAgICAgICAg fQorICAgICAgICAgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAgICAgICAg ICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWAorICAgICAgICAgICAgICAgICAg ICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQg aG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+Ziwg aW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLWZhY2UiKSwgdHJ1ZSk7CisgICAg ICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9J RCAocy0+ZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICBOU19GQUNF X0ZPUkVHUk9VTkQgKHMtPmZhY2UpID0gTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3dfaW5hY3Rp dmVfZmFjZSk7CisgICAgICAgICAgICB9CisgICAgICB7CisgICAgICAgIEJPT0wgaXNDb21wb3Np dGUgPSBzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEg7CisgICAgICAgIGlm IChpc0NvbXBvc2l0ZSkKKyAgICAgICAgICBuc19kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdf Zm9yZWdyb3VuZCAocyk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICBib29sIHdpdGhfYmdfcCA9ICgoZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX05PUk1BTCAmJiAh cy0+YmFja2dyb3VuZF9maWxsZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg fHwgZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX01PVVNFRkFDRSk7CisgICAgICAgICAgICAgIGlmICh3 aXRoX2JnX3ApCisgICAgICAgICAgICAgICAgcy0+YmFja2dyb3VuZF9udWtlZF9wID0gdHJ1ZTsK KyAgICAgICAgICAgICAgZm9udC0+ZHJpdmVyLT5kcmF3IChzLCBzLT5jbXBfZnJvbSwgcy0+bmNo YXJzLCBzLT54LCBzLT55YmFzZSwgd2l0aF9iZ19wKTsKKyAgICAgICAgICAgIH0KKyAgICAgIH0K KyAgICAgIHsKKyAgICAgICAgTlNDb2xvciAqY29sID0gKE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ ZmFjZSkgIT0gMAorICAgICAgICAgICAgICAgICAgICAgICAgPyBuc19sb29rdXBfaW5kZXhlZF9j b2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPmYpCisgICAgICAgICAgICAgICAgICAg ICAgICA6IEZSQU1FX0ZPUkVHUk9VTkRfQ09MT1IgKHMtPmYpKTsKKyAgICAgICAgW2NvbCBzZXRd OworICAgICAgICAvKiBEcmF3IHVuZGVybGluZSwgb3ZlcmxpbmUsIHN0cmlrZS10aHJvdWdoLiAq LworICAgICAgICBtY19uc19kcmF3X3RleHRfZGVjb3JhdGlvbiAocywgcy0+ZmFjZSwgY29sLCBz LT53aWR0aCwgcy0+eCk7CisgICAgICB9CisgICAgICB7CisgICAgICAgIGlmIChzLT5maXJzdF9n bHlwaC0+dHlwZSAhPSBDT01QT1NJVEVfR0xZUEgKKyAgICAgICAgICAgICYmIChzLT5sZWZ0X292 ZXJ3cml0dGVuX3AgfHwgcy0+cmlnaHRfb3ZlcndyaXR0ZW5fcCkKKyAgICAgICAgICAgICYmIChz LT5iYWNrZ3JvdW5kX251a2VkX3AgfHwgcy0+cmVjdGFuZ2xlX251a2VkX3ApCisgICAgICAgICAg ICAmJiBzLT5hY3Rpb25fdHlwZSA9PSBNQ19EUkFXX0dMWVBIKQorICAgICAgICAgIG1jX25zX2Ry YXdfb3ZlcndyaXR0ZW4gKHMsIG1hdHJpeCwgcm93LCBzLT5maXJzdF9nbHlwaCk7CisgICAgICB9 CisgICAgICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IKKyAgICAgICAgICAmJiBjdXJzb3JfdHlw ZSA9PSBNQ19GSUxMRURfQk9YKQorICAgICAgICB7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyB0 bXAgPSBOU19GQUNFX0JBQ0tHUk9VTkQgKHMtPmZhY2UpOworICAgICAgICAgIE5TX0ZBQ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OworICAgIH0KKyAgLyogRHJhdyBib3ggaWYg bm90IGRvbmUgYWxyZWFkeS4gKi8KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMgJiYgIWJveF9kcmF3 bl9wICYmIHMtPmZhY2UtPmJveCAhPSBGQUNFX05PX0JPWCkKKyAgICB7CisgICAgICBuID0gbnNf Z2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIpOworICAgICAgaWYgKCFtY19uc19jbGlw X3RvX3JlY3QgKHMtPmYsIHIsIG4sIHJvdykpCisgICAgICAgIHJldHVybjsKKyAgICAgIG5zX2R1 bXBnbHlwaHNfYm94X29yX3JlbGllZiAocyk7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+ Zik7CisgICAgfQorICBzLT5udW1fY2xpcHMgPSAwOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VS U09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogPT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT0KIAogICAgTlNUUkFDRSwgVHJhY2Ugc3VwcG9ydC4KQEAgLTExMDksNiArMjE5NCwxNiBAQCBz dGF0aWMgTlNSZWN0IGNvbnN0cmFpbl9mcmFtZV9yZWN0KE5TUmVjdCBmcmFtZVJlY3QsIGJvb2wg aXNGdWxsc2NyZWVuKQogICAgZXh0ZXJuYWwgKFJJRikgY2FsbDsgd2hvbGUgZnJhbWUsIGNhbGxl ZCBiZWZvcmUgdXBkYXRlX3dpbmRvd19iZWdpbgogICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KIHsK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICBmLT5tY191cGRhdGluZ19mcmFtZSA9IGY7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICNpZmRlZiBOU19JTVBMX0NPQ09BCiAgIEVtYWNzVmlldyAqdmlldyA9IEZSQU1FX05TX1ZJ RVcgKGYpOwogCkBAIC0xMjA5LDYgKzIzMDQsMTYgQEAgc3RhdGljIE5TUmVjdCBjb25zdHJhaW5f ZnJhbWVfcmVjdChOU1JlY3QgZnJhbWVSZWN0LCBib29sIGlzRnVsbHNjcmVlbikKIAogLyogICBp ZiAoZiA9PSBNT1VTRV9ITF9JTkZPIChmKS0+bW91c2VfZmFjZV9tb3VzZV9mcmFtZSkgKi8KICAg TU9VU0VfSExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfZGVmZXIgPSAwOworCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5n X2ZyYW1lID0gTlVMTDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAKQEAg LTQ4MDMsNiArNTkwOCwxNyBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMgKHJhcGlkIGluY29taW5n IGV2ZW50cykuCiAgICAgICBiYXIgPSBbW0VtYWNzU2Nyb2xsZXIgYWxsb2NdIGluaXRGcmFtZTog ciB3aW5kb3c6IHdpbl07CiAgICAgICB3c2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHdpbmRvdywg bWFrZV9taW50X3B0ciAoYmFyKSk7CiAgICAgICB1cGRhdGVfcCA9IFlFUzsKKworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgLyogVGhp cyBpcyBvbmx5IGZvciBkZWJ1Z2dpbmcgcHVycG9zZXMuICovCisgICAgICBbYmFyIG1jX3NldF9y ZWN0YW5nbGU6IHJdOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgfQogICBl bHNlCiAgICAgewpAQCAtNDgxMCwxMiArNTkyNiwzMCBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMg KHJhcGlkIGluY29taW5nIGV2ZW50cykuCiAgICAgICBiYXIgPSBYTlNfU0NST0xMX0JBUiAod2lu ZG93LT52ZXJ0aWNhbF9zY3JvbGxfYmFyKTsKICAgICAgIG9sZFJlY3QgPSBbYmFyIGZyYW1lXTsK ICAgICAgIHIuc2l6ZS53aWR0aCA9IG9sZFJlY3Quc2l6ZS53aWR0aDsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAgICAgaWYgKEZSQU1F X0xJVkVfUCAoZikgJiYgIU5TRXF1YWxSZWN0cyAob2xkUmVjdCwgcikpCiAgICAgICAgIHsKKyAg ICAgICAgICAvKiBUaGUgbWFpbiB3aW5kb3cgaGFzIHByb2JhYmx5IGJlZW4gcmVzaXplZC4gIEdy YWNpb3VzbHkgZGVsZXRlIHRoZQorICAgICAgICAgIG9sZCBzY3JvbGwgYmFyIHdpdGhvdXQgcmVw YWludGluZyBpdHMgcmVjdGFuZ2xlOyBhbmQsIGNyZWF0ZSBhIG5ldworICAgICAgICAgIHNjcm9s bCBiYXIgZWxzZXdoZXJlLiovCiAgICAgICAgICAgaWYgKG9sZFJlY3Qub3JpZ2luLnggIT0gci5v cmlnaW4ueCkKKyAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgbnNfY2xlYXJfZnJhbWVfYXJl YSAoZiwgbGVmdCwgdG9wLCB3aWR0aCwgaGVpZ2h0KTsKKyAgICAgICAgICAgICAgW2JhciBtY19q dWRnZV07CisgICAgICAgICAgICAgIGJhciA9IFtbRW1hY3NTY3JvbGxlciBhbGxvY10gaW5pdEZy YW1lOiByIHdpbmRvdzogd2luXTsKKyAgICAgICAgICAgICAgd3NldF92ZXJ0aWNhbF9zY3JvbGxf YmFyICh3aW5kb3csIG1ha2VfbWludF9wdHIgKGJhcikpOworICAgICAgICAgICAgfQorICAgICAg ICAgICAgZWxzZQogICAgICAgICAgIFtiYXIgc2V0RnJhbWU6IHJdOwogICAgICAgICB9CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB9CiAKICAgaWYgKHVwZGF0ZV9wKQpAQCAt NDk3NSw5ICs2MTA5LDU3IEBAIGluIGNlcnRhaW4gc2l0dWF0aW9ucyAocmFwaWQgaW5jb21pbmcg ZXZlbnRzKS4KICAgICB7CiAgICAgICB2aWV3ID0gW3N1YnZpZXdzIG9iamVjdEF0SW5kZXg6IGld OwogICAgICAgaWYgKCFbdmlldyBpc0tpbmRPZkNsYXNzOiBbRW1hY3NTY3JvbGxlciBjbGFzc11d KSBjb250aW51ZTsKLSAgICAgIGlmIChbdmlldyBqdWRnZV0pCisKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogYFhTRVRXSU5ET1cnIHdp bGwgc29tZXRpbWVzIGNhdXNlIEVtYWNzIHRvIGNyYXNoIHdoZW4gcnVubmluZyB1bmRlciBnZGIg ZXZlbgorICB0aG91Z2ggKHcgIT0gTlVMTCkuICBUaGVyZWZvcmUsIHdlIGNhbm5vdCByZWxpYWJs eSB1c2UgYFdJTkRPV19MSVZFX1AnLiAqLworICBzdHJ1Y3Qgd2luZG93ICp3ID0gW3ZpZXcgbWNf Z2V0X3dpbmRvd107CisgIGlmICh3ICE9IE5VTEwKKyAgICAgICYmIE5JTFAgKHctPmNvbnRlbnRz KSkKKyAgICB7CisgICAgICBCT09MIGRlYnVnX3AgPSBmYWxzZTsKKyAgICAgIGlmIChkZWJ1Z19w CisgICAgICAgICAgLyogYHdpbmRvd19ib3gnIGNhbGxzIGB3aW5kb3dfYm94X2hlaWdodCcsIHdo aWNoIHdpbGwgY2F1c2UgRW1hY3MgdG8KKyAgICAgICAgICBjcmFzaCBpZiBGUkFNRVAgKHctPmZy YW1lKSBpcyBub3Qgc2F0aXNmaWVkLiAqLworICAgICAgICAgICYmIEZSQU1FUCAody0+ZnJhbWUp KQorICAgICAgICB7CisgICAgICAgICAgTlNSZWN0IHIwID0gW3ZpZXcgbWNfZ2V0X3JlY3Rhbmds ZV07CisgICAgICAgICAgaW50IHgwID0gTlNNaW5YIChyMCk7CisgICAgICAgICAgaW50IHkwID0g TlNNaW5ZIChyMCk7CisgICAgICAgICAgaW50IHdkMCA9IE5TV2lkdGggKHIwKTsKKyAgICAgICAg ICBpbnQgaDAgPSBOU0hlaWdodCAocjApOworICAgICAgICAgIGludCB3aW5kb3dfeSwgd2luZG93 X2hlaWdodDsKKyAgICAgICAgICB3aW5kb3dfYm94ICh3LCBBTllfQVJFQSwgMCwgJndpbmRvd195 LCAwLCAmd2luZG93X2hlaWdodCk7CisgICAgICAgICAgaW50IHRvcCA9IHdpbmRvd195OworICAg ICAgICAgIGludCBoZWlnaHQgPSB3aW5kb3dfaGVpZ2h0OworICAgICAgICAgIGludCB3aWR0aCA9 IFdJTkRPV19DT05GSUdfU0NST0xMX0JBUl9DT0xTICh3KSAqIEZSQU1FX0NPTFVNTl9XSURUSCAo Zik7CisgICAgICAgICAgaW50IGxlZnQgPSBXSU5ET1dfU0NST0xMX0JBUl9BUkVBX1ggKHcpOwor ICAgICAgICAgIE5TUmVjdCByMSA9IE5TTWFrZVJlY3QgKGxlZnQsIHRvcCwgd2lkdGgsIGhlaWdo dCk7CisgICAgICAgICAgLyogVGhlIHBhcmVudCB2aWV3IGlzIGZsaXBwZWQsIHNvIHdlIG5lZWQg dG8gZmxpcCB5IHZhbHVlLiAqLworICAgICAgICAgIEVtYWNzVmlldyAqZnJhbWVfdmlldyA9IEZS QU1FX05TX1ZJRVcgKGYpOworICAgICAgICAgIE5TUmVjdCB2ID0gW2ZyYW1lX3ZpZXcgZnJhbWVd OworICAgICAgICAgIHIxLm9yaWdpbi55ID0gKHYuc2l6ZS5oZWlnaHQgLSByMS5zaXplLmhlaWdo dCAtIHIxLm9yaWdpbi55KTsKKyAgICAgICAgICBpbnQgeDEgPSBOU01pblggKHIxKTsKKyAgICAg ICAgICBpbnQgeTEgPSBOU01pblkgKHIxKTsKKyAgICAgICAgICBpbnQgd2QxID0gTlNXaWR0aCAo cjEpOworICAgICAgICAgIGludCBoMSA9IE5TSGVpZ2h0IChyMSk7CisgICAgICAgICAgZnByaW50 ZiAoc3RkZXJyLCAiJXMgLS0gREVBRDpcblwKKyAgICAgICAgICB4MC94MSAoJWQvJWQpIHwgeTAv eTEgKCVkLyVkKSB8IHdkMC93ZDEgKCVkLyVkKSB8IGgwL2gxICglZC8lZClcbiIsCisgICAgICAg ICAgbWNfd2luZG93ICh3KSwgeDAsIHgxLCB5MCwgeTEsIHdkMCwgd2QxLCBoMCwgaDEpOworICAg ICAgICB9CisgICAgICBpZiAoW3ZpZXcgbWNfanVkZ2VdKQogICAgICAgICByZW1vdmVkID0gWUVT OwogICAgIH0KKyAgICBlbHNlIGlmIChbdmlldyBqdWRnZV0pCisgICAgICByZW1vdmVkID0gWUVT OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCisgICAgfQogCiAgIGlmIChyZW1vdmVk KQogICAgIFtldmlldyB1cGRhdGVGcmFtZVNpemU6IE5PXTsKQEAgLTUxMDYsNiArNjI4OCwyMSBA QCBzdGF0aWMgTGlzcF9PYmplY3QgbnNfc3RyaW5nX3RvX2xpc3Btb2QgKGNvbnN0IGNoYXIgKnMp CiBleHRlcm4gZnJhbWVfcGFybV9oYW5kbGVyIG5zX2ZyYW1lX3Bhcm1faGFuZGxlcnNbXTsKIHN0 YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSBuc19yZWRpc3BsYXlfaW50ZXJmYWNlID0K IHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBuc3Rlcm0ubWAgbXVzdCBiZSBpbiB0aGUg ZXhhY3Qgc2FtZSBvcmRlciBhcyB0aGUKK2ByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4 dGVybi5oYCEgKi8KKworICBtY194X3dyaXRlX2dseXBocywKKyAgbWNfbnNfZHJhd193aW5kb3df Y3Vyc29yLAorICBtY19uc19kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICBuc19mcmFtZV9wYXJtX2hhbmRsZXJzLAogICB4X3Byb2R1Y2VfZ2x5cGhz LAogICB4X3dyaXRlX2dseXBocywKQEAgLTg3MjEsNiArOTkxOCw0OSBAQCAtIChCT09MKWNhbkJl Y29tZU1haW5XaW5kb3cKIAogQGltcGxlbWVudGF0aW9uIEVtYWNzU2Nyb2xsZXIKIAorCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLSAodm9pZClt Y19zZXRfcmVjdGFuZ2xlOiAoTlNSZWN0KXJlY3QKK3sKKyAgbWNfcmVjdGFuZ2xlID0gcmVjdDsK K30KKworLSAoTlNSZWN0KW1jX2dldF9yZWN0YW5nbGUKK3sKKyAgcmV0dXJuIG1jX3JlY3Rhbmds ZTsKK30KKworLSAoc3RydWN0IHdpbmRvdyAqKW1jX2dldF93aW5kb3cKK3sKKyAgcmV0dXJuIHdp bmRvdzsKK30KKworLSAoYm9vbCltY19qdWRnZQoreworICBOU1RSQUNFICgiW0VtYWNzU2Nyb2xs ZXIgbWNfanVkZ2VdIik7CisgIGJvb2wgcmV0ID0gY29uZGVtbmVkOworICBibG9ja19pbnB1dCAo KTsKKyAgaWYgKGNvbmRlbW5lZCkKKyAgICB7CisgICAgICAvKiBlbnN1cmUgb3RoZXIgc2Nyb2xs YmFyIHVwZGF0ZXMgYWZ0ZXIgZGVsZXRpb24gKi8KKyAgICAgIEVtYWNzVmlldyAqdmlldyA9IChF bWFjc1ZpZXcgKilGUkFNRV9OU19WSUVXIChmcmFtZSk7CisgICAgICBpZiAodmlldyAhPSBuaWwp CisgICAgICAgIHZpZXctPnNjcm9sbGJhcnNOZWVkaW5nVXBkYXRlKys7CisgICAgfQorICBpZiAo d2luZG93KQorICAgIHdzZXRfdmVydGljYWxfc2Nyb2xsX2JhciAod2luZG93LCBRbmlsKTsKKyAg d2luZG93ID0gMDsKKyAgW3NlbGYgcmVtb3ZlRnJvbVN1cGVydmlld1dpdGhvdXROZWVkaW5nRGlz cGxheV07CisgIFtzZW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ET1cgKGYpOworICAgICAgICAgIHczMl9zeXN0 ZW1fY2FyZXRfeAorICAgICAgICAgICAgPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3 LCB4KTsKKyAgICAgICAgICAvKiBGSVhNRTogIFdoYXQgc2hvdWxkIHdlIHVzZSBpbnN0ZWFkIG9m IGB3LT5waHlzX2N1cnNvcl9hc2NlbnQnPyAqLworICAgICAgICAgIHczMl9zeXN0ZW1fY2FyZXRf eQorICAgICAgICAgICAgPSAoV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIHkpCisgICAgICAg ICAgICAgICArIHJvdy0+YXNjZW50IC0gdy0+cGh5c19jdXJzb3JfYXNjZW50KTsKKyAgICAgICAg ICB3MzJfc3lzdGVtX2NhcmV0X3dpbmRvdyA9IHc7CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJl dF9oZHJfaGVpZ2h0ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICAgICAg dzMyX3N5c3RlbV9jYXJldF9tb2RlX2hlaWdodCA9IFdJTkRPV19NT0RFX0xJTkVfSEVJR0hUICh3 KTsKKyAgICAgICAgICBQb3N0TWVzc2FnZSAoaHduZCwgV01fSU1FX1NUQVJUQ09NUE9TSVRJT04s IDAsIDApOworICAgICAgICAgIC8qIElmIHRoZSBzaXplIG9mIHRoZSBhY3RpdmUgY3Vyc29yIGNo YW5nZWQsIGRlc3Ryb3kgdGhlIG9sZAorICAgICAgICAgICAgIHN5c3RlbSBjYXJldC4gICovCisg ICAgICAgICAgaWYgKHczMl9zeXN0ZW1fY2FyZXRfaHduZAorICAgICAgICAgICAgICAmJiAodzMy X3N5c3RlbV9jYXJldF9oZWlnaHQgIT0gaCkpCisgICAgICAgICAgICBQb3N0TWVzc2FnZSAoaHdu ZCwgV01fRU1BQ1NfREVTVFJPWV9DQVJFVCwgMCwgMCk7CisgICAgICAgICAgdzMyX3N5c3RlbV9j YXJldF9oZWlnaH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T2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRzOworICAgICAgQ0hFQ0tfQlVGRkVSIChidWYp OworICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1Zik7CisgICAgICBib29sIHJl Z2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5zaWVudF9tYXJrX21vZGUpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWFya19hY3RpdmUpKSk7Cisg ICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZ2lubmluZyA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJ WE5VTSAoRnJlZ2lvbl9iZWdpbm5pbmcgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3QgcmVnaW9u X2VuZCA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9lbmQgKCkpIDogLTE7 CisgICAgICBwdHJkaWZmX3Qgb3BvaW50X3B0ID0gKHcgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2lu ZG93KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFBUCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBYRklYTlVNIChGbWFya2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pKTsKKyAg ICAgIGJvb2wgcmVnaW9uX2luX2JvdW5kc19wID0gKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3B0ID49IHJlZ2lvbl9iZWdpbm5pbmcK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF9wdCA8IHJlZ2lvbl9l bmQpOworICAgICAgaWYgKGN1cnNvcl9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCAmJiBsc2wu cmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKK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xvd19hY3RpdmVfcmVnaW9uX2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAgICAg ICB9CisgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAg ICAgICAgICYmICFyZWdpb25faW5fYm91bmRzX3AKKyAgICAgICAgICAgICAgICAgICAgICYmIGFj dGl2ZV9wKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhv bGxvd19hY3RpdmVfcmVnaW9uX291dF9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYs IGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1yZWdpb24tZmFjZSIpLCB0cnVlKTsKKyAgICAg ICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fb3V0X2ZhY2UgPSBG QUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX291dF9mYWNlX2lkKTsKKyAgICAg ICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25h bWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUp OworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNF X0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgZ2Nf dmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAg ICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9v dXRfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNl IGl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VsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1 cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOwor ICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vy c29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGN1cnNvcl9nbHlwaC0+dHlw ZSA9PSBJTUFHRV9HTFlQSCAmJiBsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNs LmJsdWUgPj0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWph Y2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgICBm LT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAg ICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBm eSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5j dXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgICAgfQorICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlq YWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAg ICAgICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHczMmZucy5jLiAgKi8K KyAgICAgICAgICAgICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYg cmVnaW9uX2luX2JvdW5kc19wCisgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcCkKKyAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2 ZV9yZWdpb25fZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJl YWwtZmFrZS1jdXJzb3ItcmVnaW9uLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICBz dHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwg aG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBlbnVtIGZh Y2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGlu dGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAg ICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9s bG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3Jv dW5kID0gaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICAgICAg Z2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9mYWNlLT5iYWNrZ3Jv dW5kOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25f YWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcmVnaW9uX2luX2JvdW5kc19w CisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYWN0aXZ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WNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1m YWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBm YWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVf ZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBo b2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAgZ2Nf dmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQ7CisgICAg ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgLyogVGhlIHJlZ2lvbiBpcyBf bm90XyB2aXNpYmxlIGluIHRoZSBpbmFjdGl2ZSB3aW5kb3cgYmVjYXVzZSB0aGUgb3ZlcmxheSB3 aW5kb3cgcHJvcGVydHkgaXMgdXNlZC4gKi8KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAo IWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAg ICAgIGVudW0gZmFjZV9pZCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9m YWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtZmFjZSIpLCB0 cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3Rp dmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAg ICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfaW5hY3Rp dmVfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5i YWNrZ3JvdW5kID0gaG9sbG93X2luYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9n YyA9IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiksIG1hc2ssICZnY192YWx1 ZXMpOworICAgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyogRm9y Y2UgYG1jX3czMl9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLnczMi0+ Y3Vyc29yX2djJy4gICovCisgICAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSB0cnVlOwor ICAgICAgICAgICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdf Q1VSU09SLCB4LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgbHNsLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9n Y19wKTsKKyAgICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MgPSBvcmln aW5hbF9jdXJzb3JfZ2M7CisgICAgICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAg ICAgICAgIG1jX3czMl9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwg eSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICAgIH0KKyAgICAgIGJyZWFrOwor ICAgIH0KKyAgICBjYXNlIE1DX0hPTExPV19CT1g6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQg Pj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAg ICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9w aXhlbCcuICAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0g Y29sb3JfcGl4ZWw7CisgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0 cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgIGYt Pm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOwor ICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBtY193MzJfZHJhd19ob2xsb3dfY3Vy c29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7Cisg ICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19GSUxMRURfQk9YOgorICAgIHsKKyAgICAg IGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAg ICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEu dzMyLT5jdXJzb3JfZ2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAgICAgICAgICBmdW5jdGlvbmFsaXR5 IG9mIGB4X21ha2VfZ2MnIGluIHczMmZucy5jLiAgKi8KKyAgICAgICAgICBibG9ja19pbnB1dCAo KTsKKyAgICAgICAgICBYR0NWYWx1ZXMgZ2NfdmFsdWVzOworICAgICAgICAgIHVuc2lnbmVkIGxv bmcgbWFzayA9IEdDRm9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yAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUs IHdkLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jf Z2NfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfQkFS OgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNs LmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBg Zi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBmLT5vdXRw dXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgIGJvb2wg Y3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3czMl9kcmF3 X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdk LCBoLCBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOwor ICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vy c29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAg ICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAg ICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBo cG9zLCB2cG9zLCB3ZCwgaCwgY3Vyc29yX3dpZHRoLCBNQ19CQVIsIGN1cnNvcl9nY19pbnZpc2li bGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBN Q19IQkFSOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAg JiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhp amFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBm LT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAg IGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3cz Ml9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZw b3MsIHdkLCBoLCBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2th eV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdp bmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgewor ICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IGZhbHNlOworICAg ICAgICAgICAgbWNfdzMyX2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5 LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29yX2dj X2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAg ICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KKyAgICB9Cit9CisKKy8qIERy YXcgZ2x5cGggc3RyaW5nIFMuICAqLworc3RhdGljIHZvaWQKK21jX3czMl9kcmF3X2dseXBoX3N0 cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4 LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVj dCBtY19SR0IgbHNsLCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsCisgICAgICAgICAgICAg ICAgICAgICAgICAgIGVudW0gdHlwZV9vZl9jdXJzb3IgY3Vyc29yX3R5cGUsIGludCBjdXJzb3Jf d2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3AsIGJvb2wgY3Vy c29yX2djX3ApCit7CisgIGJvb2wgcmVsaWVmX2RyYXduX3AgPSAwOworICAvKiBJZiBTIGRyYXdz IGludG8gdGhlIGJhY2tncm91bmQgb2YgaXRzIHN1Y2Nlc3NvciwgZHJhdyB0aGUKKyAgICAgYmFj a2dyb3VuZCBvZiB0aGUgc3VjY2Vzc29yIGZpcnN0IHNvIHRoYXQgUyBjYW4gZHJhdyBpbnRvIGl0 LgorICAgICBUaGlzIG1ha2VzIFMtPm5leHQgdXNlIFhEcmF3U3RyaW5nIGluc3RlYWQgb2YgWERy YXdJbWFnZVN0cmluZy4gICovCisgIGlmIChzLT5uZXh0ICYmIHMtPnJpZ2h0X292ZXJoYW5nICYm ICFzLT5mb3Jfb3ZlcmxhcHMpCisgICAgeworICAgICAgaW50IHdpZHRoOworICAgICAgc3RydWN0 IGdseXBoX3N0cmluZyAqbmV4dDsKKyAgICAgIGZvciAod2lkdGggPSAwLCBuZXh0ID0gcy0+bmV4 dDsKKyAgICAgICAgICAgbmV4dCAmJiB3aWR0aCA8IHMtPnJpZ2h0X292ZXJoYW5nOworICAgICAg ICAgICB3aWR0aCArPSBuZXh0LT53aWR0aCwgbmV4dCA9IG5leHQtPm5leHQpCisgICAgICAgIGlm IChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICB7Cisg ICAgICAgICAgICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4dCwgY3Vyc29yX2djX3Ap OworICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nIChuZXh0KTsKKyAgICAg ICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICAg ICAgICAgICAgICBtY193MzJfZHJhd19zdHJldGNoX2dseXBoX3N0cmluZyAobmV4dCk7CisgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3Vu ZCAobmV4dCwgdHJ1ZSk7CisgICAgICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAg ICAgIH0KKyAgICB9CisgIC8qIFNldCB1cCBTLT5nYywgc2V0IGNsaXBwaW5nIGFuZCBkcmF3IFMu ICAqLworICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAocywgY3Vyc29yX2djX3ApOworICAv KiBEcmF3IHJlbGllZiAoaWYgYW55KSBpbiBhZHZhbmNlIGZvciBjaGFyL2NvbXBvc2l0aW9uIHNv IHRoYXQgdGhlCisgICAgIGdseXBoIHN0cmluZyBjYW4gYmUgZHJhd24gb3ZlciBpdC4gICovCisg IGlmICghcy0+Zm9yX292ZXJsYXBzCisgICAgICAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19C T1gKKyAgICAgICYmIChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAg ICAgfHwgcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKSkKKyAgICB7Cisg ICA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cgKHMpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBTVFJF VENIX0dMWVBIOgorICAgICAgbWNfdzMyX2RyYXdfc3RyZXRjaF9nbHlwaF9zdHJpbmcgKHMpOwor ICAgICAgYnJlYWs7CisgICAgY2FzZSBDSEFSX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9vdmVy bGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNl CisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgZmFsc2UpOworICAg ICAgeF9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJyZWFrOworICAg IGNhc2UgQ09NUE9TSVRFX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcyB8fCAocy0+ Y21wX2Zyb20gPiAwCisgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0b21h dGljKSkKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNl CisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgdHJ1ZSk7CisgICAg ICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJy ZWFrOworICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9vdmVybGFw cykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNlCisg ICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgZmFsc2UpOworICAgICAg eF9kcmF3X2dseXBobGVzc19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVh azsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgICAgfQorICBpZiAoIXMt PmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICAvKiBEcmF3IHVuZGVybGluZS4gICovCisgICAg ICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpZiAocy0+ ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9XQVZFKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBDT0xPUlJFRiBjb2xvcjsKKyAgICAgICAgICAgICAgaWYgKHMtPmZhY2Ut PnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICBjb2xvciA9IHMtPmdjLT5m b3JlZ3JvdW5kOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgY29sb3IgPSBz LT5mYWNlLT51bmRlcmxpbmVfY29sb3I7CisgICAgICAgICAgICAgIHczMl9kcmF3X3VuZGVyd2F2 ZSAocywgY29sb3IpOworICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKHMtPmZhY2Ut PnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgdW5zaWduZWQgbG9uZyB0aGlja25lc3MsIHBvc2l0aW9uOworICAgICAgICAgICAg ICBpbnQgeTsKKyAgICAgICAgICAgICAgaWYgKHMtPnByZXYgJiYgcy0+cHJldi0+ZmFjZS0+dW5k ZXJsaW5lX3AKKyAgICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV90 eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgICAvKiBXZSB1c2UgdGhlIHNhbWUgdW5kZXJsaW5lIHN0eWxlIGFzIHRoZSBwcmV2aW91cyBv bmUuICAqLworICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+cHJldi0+dW5kZXJsaW5l X3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+cHJldi0+dW5kZXJs aW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHRo aWNrbmVzcy4gIERlZmF1bHQgaXMgMSBwaXhlbC4gICovCisgICAgICAgICAgICAgICAgICBpZiAo cy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAgICAg ICAgICAgICAgdGhpY2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAg ICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gMTsKKyAg ICAgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50X2xpbmUpCisgICAgICAg ICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIHRoaWNrbmVzcykgLSAocy0+eWJh c2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHBvc2l0aW9uLiAg VGhpcyBpcyB0aGUgcmVjb21tZW5kZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJ0aWNh bCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRoZSB0b3Agb2YKKyAgICAg ICAgICAgICAgICAgICAgICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBpcyBhIHNpZ25lZCB2YWx1 ZSBhY2NvcmRpbmcgdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgc3BlY3MsIGFuZCBp dHMgZGVmYXVsdCBpcworICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EICgobWF4aW11bV9k ZXNjZW50KSAvIDIpLCB3aXRoCisgICAgICAgICAgICAgICAgICAgICAgICAgUk9VTkQgKHgpID0g Zmxvb3IgKHggKyAwLjUpICAqLworICAgICAgICAgICAgICAgICAgICAgIGlmICh4X3VzZV91bmRl cmxpbmVfcG9zaXRpb25fcHJvcGVydGllcworICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBz LT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAg ICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAg ICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocy0+Zm9udCkKKyAgICAgICAgICAgICAgICAgICAg ICAgIHBvc2l0aW9uID0gKHMtPmZvbnQtPmRlc2NlbnQgKyAxKSAvIDI7CisgICAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbWF4IChwb3NpdGlvbiwgdW5k ZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg IC8qIENoZWNrIHRoZSBzYW5pdHkgb2YgdGhpY2tuZXNzIGFuZCBwb3NpdGlvbi4gIFdlIHNob3Vs ZAorICAgICAgICAgICAgICAgICBhdm9pZCBkcmF3aW5nIHVuZGVybGluZSBvdXQgb2YgdGhlIGN1 cnJlbnQgbGluZSBhcmVhLiAgKi8KKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQg PD0gcy0+eWJhc2UgKyBwb3NpdGlvbikKKyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5o ZWlnaHQgLSAxKSAtIChzLT55YmFzZSAtIHMtPnkpOworICAgICAgICAgICAgICBpZiAocy0+eSAr IHMtPmhlaWdodCA8IHMtPnliYXNlICsgcG9zaXRpb24gKyB0aGlja25lc3MpCisgICAgICAgICAg ICAgICAgdGhpY2tuZXNzID0gKHMtPnkgKyBzLT5oZWlnaHQpIC0gKHMtPnliYXNlICsgcG9zaXRp b24pOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfdGhpY2tuZXNzID0gdGhpY2tuZXNzOwor ICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPXBvc2l0aW9uOworICAgICAgICAg ICAgICB5ID0gcy0+eWJhc2UgKyBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgaWYgKHMtPmZhY2Ut PnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChz LT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHksIHMtPndpZHRoLCAxKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFjZS0+dW5kZXJsaW5l X2NvbG9yLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHksIHMtPndpZHRo LCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyogRHJhdyBvdmVybGluZS4g ICovCisgICAgICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfcCkKKyAgICAgICAgeworICAgICAgICAg IHVuc2lnbmVkIGxvbmcgZHkgPSAwLCBoID0gMTsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+b3Zl cmxpbmVfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5m LCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgcy0+eSArIGR5LCBzLT53aWR0aCwgaCk7CisgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFjZS0+b3ZlcmxpbmVfY29s b3IsIHMtPngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+d2lk dGgsIGgpOworICAgICAgICB9CisgICAgICAvKiBEcmF3IHN0cmlrZS10aHJvdWdoLiAgKi8KKyAg ICAgIGlmIChzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9wCisgICAgICAgICAgJiYgIUZPTlRfVEVY VE1FVFJJQyAocy0+Zm9udCkudG1TdHJ1Y2tPdXQpCisgICAgICAgIHsKKyAgICAgICAgICB1bnNp Z25lZCBsb25nIGggPSAxOworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAocy0+aGVpZ2h0 IC0gaCkgLyAyOworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvcl9k ZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ Z2MtPmZvcmVncm91bmQsIHMtPngsIHMtPnkgKyBkeSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB3MzJfZmlsbF9h cmVhIChzLT5mLCBzLT5oZGMsIHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX2NvbG9yLCBzLT54LAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+eSArIGR5LCBzLT53aWR0aCwgaCk7CisgICAg ICAgIH0KKyAgICAgIC8qIERyYXcgcmVsaWVmIGlmIG5vdCB5ZXQgZHJhd24uICAqLworICAgICAg aWYgKCFyZWxpZWZfZHJhd25fcCAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisgICAg ICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYm94IChzKTsKKyAgICAgIGlmIChzLT5wcmV2KQorICAg ICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqcHJldjsKKyAgICAgICAgICBm b3IgKHByZXYgPSBzLT5wcmV2OyBwcmV2OyBwcmV2ID0gcHJldi0+cHJldikKKyAgICAgICAgICAg IGlmIChwcmV2LT5obCAhPSBzLT5obAorICAgICAgICAgICAgICAgICYmIHByZXYtPnggKyBwcmV2 LT53aWR0aCArIHByZXYtPnJpZ2h0X292ZXJoYW5nID4gcy0+eCkKKyAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgIC8qIEFzIHByZXYgd2FzIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8gaXRz IG93biBhcmVhLCB3ZQorICAgICAgICAgICAgICAgICAgIG11c3QgZHJhdyB0aGUgcmlnaHRfb3Zl cmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICAqLworICAgICAgICAgICAgICAgIGVudW0gZHJh d19nbHlwaHNfZmFjZSBzYXZlID0gcHJldi0+aGw7CisgICAgICAgICAgICAgICAgcHJldi0+aGwg PSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAocHJl diwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlw cGluZ19leGFjdGx5IChzLCBwcmV2KTsKKyAgICAgICAgICAgICAgICBpZiAocHJldi0+Zmlyc3Rf Z2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19nbHlw aF9zdHJpbmdfZm9yZWdyb3VuZCAocHJldik7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocHJl dik7CisgICAgICAgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAocHJldi0+aGRjLCBO VUxMKTsKKyAgICAgICAgICAgICAgICBwcmV2LT5obCA9IHNhdmU7CisgICAgICAgICAgICAgICAg cHJldi0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBp ZiAocy0+bmV4dCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKm5l eHQ7CisgICAgICAgICAgZm9yIChuZXh0ID0gcy0+bmV4dDsgbmV4dDsgbmV4dCA9IG5leHQtPm5l eHQpCisgICAgICAgICAgICBpZiAobmV4dC0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAgICAm JiBuZXh0LT54IC0gbmV4dC0+bGVmdF9vdmVyaGFuZyA8IHMtPnggKyBzLT53aWR0aCkKKyAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEFzIG5leHQgd2lsbCBiZSBkcmF3biB3aGls ZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwKKyAgICAgICAgICAgICAgICAgICB3ZSBtdXN0IGRy YXcgdGhlIGxlZnRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICAqLworICAgICAgICAg ICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gbmV4dC0+aGw7CisgICAgICAgICAg ICAgICAgbmV4dC0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY193MzJfc2V0X2dseXBo X3N0cmluZ19nYyAobmV4dCwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICAgIHhfc2V0X2ds eXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBuZXh0KTsKKyAgICAgICAgICAgICAgICBp ZiAobmV4dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkKKyAgICAgICAgICAgICAg ICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdf Zm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3Rhbmds ZSAobmV4dC0+aGRjLCBOVUxMKTsKKyAgICAgICAgICAgICAgICBuZXh0LT5obCA9IHNhdmU7Cisg ICAgICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICAgICAgICBuZXh0 LT5jbGlwX2hlYWQgPSBzLT5uZXh0OworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9 CisgIC8qIFJlc2V0IGNsaXBwaW5nLiAgKi8KKyAgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAocy0+ aGRjLCBOVUxMKTsKKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyogZW5kIE1VTFRJUExFLUNV UlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qIEZyaW5nZSBiaXRtYXBz LiAgKi8KIAogc3RhdGljIGludCBtYXhfZnJpbmdlX2JtcCA9IDA7CkBAIC01NDUsNiArMTM5OCwx NSBAQCB4X3VwZGF0ZV9iZWdpbiAoc3RydWN0IGZyYW1lICpmKQogICBpZiAoISBGUkFNRV9XMzJf UCAoZikpCiAgICAgcmV0dXJuOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gZjsKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogICAvKiBSZWdlbmVyYXRlIGRpc3BsYXkgcGFsZXR0ZSBi ZWZvcmUgZHJhd2luZyBpZiBsaXN0IG9mIHJlcXVlc3RlZAogICAgICBjb2xvcnMgaGFzIGNoYW5n ZWQuICovCiAgIGlmIChkaXNwbGF5X2luZm8tPnJlZ2VuX3BhbGV0dGUpCkBAIC03NTQsNiArMTYx NiwxNiBAQCB4X3VwZGF0ZV9lbmQgKHN0cnVjdCBmcmFtZSAqZikKIAogICAvKiBNb3VzZSBoaWdo bGlnaHQgbWF5IGJlIGRpc3BsYXllZCBhZ2Fpbi4gICovCiAgIE1PVVNFX0hMX0lORk8gKGYpLT5t b3VzZV9mYWNlX2RlZmVyID0gZmFsc2U7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBOVUxMOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIApAQCAtNDA0MSwxMyArNDkxMyw3 NCBAQCB3MzJfc2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHN0cnVjdCB3aW5kb3cgKncsCiAJICAg ICAgcmVsZWFzZV9mcmFtZV9kYyAoZiwgaGRjKTsKIAkgICAgICB4X2NsZWFyX3VuZGVyX2ludGVy bmFsX2JvcmRlciAoZik7CiAJICAgIH0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogUkVQQUlOVElORy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Z0LCB0b3AsIHdpZHRoLCBtYXggKGhlaWdodCwgMSksIGxl ZnQgPD0gYmFyLT5sZWZ0KTsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCiAKIAkgIHNpLmNiU2l6ZSA9IHNpemVvZiAoc2kpOwogCSAgc2ku Zk1hc2sgPSBTSUZfUkFOR0U7CkBAIC00MzE2LDYgKzUyNDksMjEgQEAgdzMyX2p1ZGdlX3Njcm9s bF9iYXJzIChzdHJ1Y3QgZnJhbWUgKmYpCiAgICAgewogICAgICAgc3RydWN0IHNjcm9sbF9iYXIg KmIgPSBYU0NST0xMX0JBUiAoYmFyKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgLyogYERlc3Ryb3lXaW5kb3cnIHdpdGhpbiBg eF9zY3JvbGxfYmFyX3JlbW92ZScgcmVwYWludHMgdGhlIHJlY3RhbmdsZS4KKyAgICAgIFRoZXJl Zm9yZSwgd2UgZmlyc3Qgc2VuZCBhIG1lc3NhZ2UgdG8gaW5oaWJpdCByZXBhaW50aW5nLiAqLwor ICAgICAgaWYgKCFXSU5ET1dfTElWRV9QIChiLT53aW5kb3cpKQorICAgICAgICB7CisgICAgICAg ICAgSFdORCBod25kID0gU0NST0xMX0JBUl9XMzJfV0lORE9XIChiKTsKKyAgICAgICAgICBTZW5k TWVzc2FnZSAoaHduZCwgV01fU0VUUkVEUkFXLCBmYWxzZSwgMCk7CisgICAgICAgIH0KKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgeF9zY3JvbGxfYmFyX3JlbW92ZSAoYik7 CiAKICAgICAgIG5leHQgPSBiLT5uZXh0OwpAQCAtNzA5MSw2ICs4MDM5LDIxIEBAIGV4dGVybiBm cmFtZV9wYXJtX2hhbmRsZXIgdzMyX2ZyYW1lX3Bhcm1faGFuZGxlcnNbXTsKIAogc3RhdGljIHN0 cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlIHczMl9yZWRpc3BsYXlfaW50ZXJmYWNlID0KIHsKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyog YHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGB3MzJ0ZXJtLmNgIG11c3QgYmUgaW4gdGhlIGV4YWN0 IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3BleHRlcm4u aGAhICovCisKKyAgbWNfeF93cml0ZV9nbHlwaHMsCisgIG1jX3czMl9kcmF3X3dpbmRvd19jdXJz b3IsCisgIG1jX3czMl9kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICB3MzJfZnJhbWVfcGFybV9oYW5kbGVycywKICAgeF9wcm9kdWNlX2dseXBocywK ICAgeF93cml0ZV9nbHlwaHMsCmRpZmYgLS1naXQgYS9zcmMvd2luZG93LmggYi9zcmMvd2luZG93 LmgKaW5kZXggZmRlZjQwNy4uNzIyMDU4MiAxMDA2NDQKLS0tIGEvc3JjL3dpbmRvdy5oCisrKyBi L3NyYy93aW5kb3cuaApAQCAtODgsNiArODgsODQgQEAgZGlzcGxheSB0aGUgbWVudSBiYXIgb3Ig dGhlIHRvb2wgYmFyICh3aGVuIEVtYWNzIHVzZXMgdG9vbGtpdHMgdGhhdAogZG9uJ3QgZGlzcGxh eSB0aGVpciBvd24gbWVudSBiYXIgYW5kIHRvb2wgYmFyKSBvciBhIHRvb2x0aXAgaW4gYQogdG9v bHRpcCBmcmFtZSAod2hlbiB0b29sdGlwcyBhcmUgbm90IGRpc3BsYXkgYnkgdGhlIHRvb2xraXQp LiAgKi8KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNV UlNPUlMgKi8KKworLyogU3VmZml4ZXMgZm9yIHRoZSBgbWNgIHdpbmRvdyBwb2ludGVyIHByZWZp eC4gKi8KK3N0cnVjdCBtdWx0aXBsZV9jdXJzb3JzCit7CisgIC8qIFRoZSByZWNvcmRlZCBwaXhl bCB3aWR0aCBvZiB0aGUgbGFzdCBsaW5lIG51bWJlciBkcmF3biBkdXJpbmcgcmVkaXNwbGF5ICov CisgIGludCBsbnVtX3BpeGVsX3dpZHRoOworfTsKKworc3RydWN0IG11bHRpcGxlX2N1cnNvcnNf Y2FjaGUKK3sKKyAgcHRyZGlmZl90IGFsbG9jYXRlZDsKKyAgcHRyZGlmZl90IHVzZWQ7CisgIGVu dW0gdHlwZV9vZl9jYWNoZQorICAgIHsKKyAgICAgIE5PX0NBQ0hFLAorICAgICAgTUNfQ0FDSEUs CisgICAgICBDSF9DQUNIRSwKKyAgICAgIEZDX0NBQ0hFCisgICAgfSBjYWNoZV90eXBlOworICBz dHJ1Y3QgaXRlbXMKKyAgICB7CisgICAgICBpbnQgeDsKKyAgICAgIGludCBmeDsKKyAgICAgIGlu dCB5OworICAgICAgaW50IGZ5OworICAgICAgaW50IGhwb3M7CisgICAgICBpbnQgdnBvczsKKyAg ICAgIGludCB3ZDsKKyAgICAgIGludCBoOworICAgICAgZW51bSB0eXBlX29mX2N1cnNvcgorICAg ICAgICB7CisgICAgICAgICAgLyogTk9URTogIFRoZSBmcmluZ2UgYml0bWFwIGZyYW1ld29yayBy ZWxpZXMgdXBvbiBNQ19OT19GUklOR0VfQklUTUFQCisgICAgICAgICAgSEFWSU5HIEEgVkFMVUUg T0YgWkVSTyAoMCkuICovCisgICAgICAgICAgTUNfTk9fRlJJTkdFX0JJVE1BUCwKKyAgICAgICAg ICBNQ19OT19DVVJTT1IsCisgICAgICAgICAgTUNfUklHSFRfRlJJTkdFX0JJVE1BUCwKKyAgICAg ICAgICBNQ19MRUZUX0ZSSU5HRV9CSVRNQVAsCisgICAgICAgICAgTUNfRlJBTUVEX0JPWCwKKyAg ICAgICAgICBNQ19GSUxMRURfQk9YLAorICAgICAgICAgIE1DX0hPTExPV19CT1gsCisgICAgICAg ICAgTUNfQkFSLAorICAgICAgICAgIE1DX0hCQVIKKyAgICAgICAgfSBjdXJzb3JfdHlwZTsKKyAg ICAgIGludCBjdXJzb3Jfd2lkdGg7CisgICAgICBzdHJ1Y3QgUkdCCisgICAgICAgIHsKKyAgICAg ICAgICBkb3VibGUgcmVkOworICAgICAgICAgIGRvdWJsZSBncmVlbjsKKyAgICAgICAgICBkb3Vi bGUgYmx1ZTsKKyAgICAgICAgfSBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kOworICAgICAgYm9vbCBh Y3RpdmVfcDsKKyAgICAgIGVudW0gbWNfZmxhdm9yCisgICAgICAgIHsKKyAgICAgICAgICBOT19G TEFWT1IsCisgICAgICAgICAgTUNfR0xZUEgsCisgICAgICAgICAgTUNfR0xZUEhMRVNTLAorICAg ICAgICAgIE1DX09WRVJMQVlfQVJST1dfQklUTUFQLAorICAgICAgICAgIE1DX1BJTENST1csCisg ICAgICAgICAgTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVywKKyAgICAgICAgICBNQ19S RVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XLAorICAgICAgICAgIE1DX0hPTExP V19SRUNUQU5HTEUsCisgICAgICAgICAgTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XLAorICAg ICAgICAgIE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVywKKyAgICAgICAgICBN Q19WRVJUSUNBTF9CQVIsCisgICAgICAgICAgTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSLAorICAg ICAgICAgIE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgfSBnbHlwaF9mbGF2b3I7 CisgICAgICBib29sIGVuYWJsZWRfcDsKKyAgICB9ICpjYWNoZXM7Cit9OworCisvKiBlbmQgTVVM VElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogc3RydWN0IGN1 cnNvcl9wb3MKIHsKICAgLyogUGl4ZWwgcG9zaXRpb24uICBUaGVzZSBhcmUgYWx3YXlzIHdpbmRv dyByZWxhdGl2ZS4gICovCkBAIC0zMjQsNiArNDAyLDIxIEBAIHN0cnVjdCB3aW5kb3cKIAogI2lm ZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgc3RydWN0IG11bHRpcGxlX2N1cnNvcnMgbWM7CisK KyAgICBzdHJ1Y3QgbXVsdGlwbGVfY3Vyc29yc19jYWNoZSBtY19lbHRzOworCisgICAgc3RydWN0 IG11bHRpcGxlX2N1cnNvcnNfY2FjaGUgY2hfZWx0czsKKworICAgIHN0cnVjdCBtdWx0aXBsZV9j dXJzb3JzX2NhY2hlIGZjX2VsdHM7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAg ICAvKiBDdXJzb3IgdHlwZSBvZiBsYXN0IGN1cnNvciBkcmF3biBvbiB0aGUgd2luZG93LiAgKi8K ICAgICBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIHBoeXNfY3Vyc29yX3R5cGU7CiAKQEAgLTExMjAs NiArMTIxMywxNSBAQCBleHRlcm4gdm9pZCByZWRpc3BsYXlfb3RoZXJfd2luZG93cyAodm9pZCk7 CiAKIHN0cnVjdCBnbHlwaCAqZ2V0X3BoeXNfY3Vyc29yX2dseXBoIChzdHJ1Y3Qgd2luZG93ICp3 KTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K Kworc3RydWN0IGdseXBoICptY19nZXRfY3Vyc29yX2dseXBoIChzdHJ1Y3Qgd2luZG93ICp3LCBz dHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IGhw b3MsIGludCB2cG9zKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogVHJ1ZSBp ZiBXSU5ET1cgaXMgYSB2YWxpZCB3aW5kb3cuICAqLwogI2RlZmluZSBXSU5ET1dfVkFMSURfUChX SU5ET1cpCQkJCQlcCiAgIChXSU5ET1dQIChXSU5ET1cpICYmICFOSUxQIChYV0lORE9XIChXSU5E T1cpLT5jb250ZW50cykpCVwKZGlmZiAtLWdpdCBhL3NyYy94ZGlzcC5jIGIvc3JjL3hkaXNwLmMK aW5kZXggYTg4ZmM2OS4uNWZmOGMxYiAxMDA2NDQKLS0tIGEvc3JjL3hkaXNwLmMKKysrIGIvc3Jj L3hkaXNwLmMKQEAgLTkyMSw2ICs5MjEsNDE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yIGNyZWF0ZWQgaW4gU3RlcCAxLCBh cHBseSB0aGUgcGF0Y2g6CisKK2dpdCBhcHBseSAvcGF0aC90by90aGUvcGF0Y2guZGlmZgorCitT dGVwIDQ6ICAuL2F1dG9nZW4uc2gKKworU3RlcCA1OiAgLi9jb25maWd1cmUgLi4uIFt5b3VyIGN1 c3RvbSBvcHRpb25zXQorCitTdGVwIDY6ICBtYWtlCisKK1N0ZXAgNzogIG1ha2UgaW5zdGFsbAor CisKK1VTQUdFOgorCistIEZvciBhIG1pbmltYWwgd29ya2luZyBleGFtcGxlIG9mIGJ1aWx0LWlu IGZha2UgY3Vyc29ycywgdHlwZTogIE0teCBtYy10ZXN0CisKKyAgOzs7IFRVUk4gT04gRkFLRSBD VVJTT1JTIChidWZmZXIgcG9zaXRpb24sIGN1cnNvci10eXBlLCBjdXJzb3IgY29sb3IpOgorCisg IChzZXRxIG1jLWNvbmYgJygoMSAiaGJhciIgIm1hZ2VudGEiKQorICAgICAgICAgICAgICAgICAg KDIgImJhciIgInB1cnBsZSIpCisgICAgICAgICAgICAgICAgICAoMyAiYm94IiAiIzAwRkYwMCIp CisgICAgICAgICAgICAgICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAg ICAgICAoNSAoImhiYXIiIDMpIFsxLjAgMC4wIDEuMF0pCisgICAgICAgICAgICAgICAgICAoNiAo ImJhciIgMykgWzAuMCAxLjAgMS4wXSkKKyAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJP cmFuZ2VSZWQiKSkpKQorCisgIDs7OyBUVVJOIE9GRiBGQUtFIENVUlNPUlM6CisKKyAgKHNldHEg bWMtY29uZiBuaWwpCisKKy0gVG8gdHJ5IG91dCB0aGUgY3Jvc3NoYWlycyBmZWF0dXJlLCB0eXBl OiAgTS14ICstbW9kZQorCistIFRvIHRyeSBvdXQgYnVpbHQtaW4gZmFrZSBjdXJzb3JzIHdpdGgg TWFnbmFyIFN2ZWVuJ3MgbXVsdGl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bmcpOworCitjaGFyICp3X2NvbnRl bnRzID0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKSAmJiBTVFJJTkdQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIG5hbWUpKSkKKyAgICAgICAgICAgICAgICAgICA/IFNTREFUQSAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBuYW1lKSkKKyAgICAgICAgICAgICAgICAgICA6ICJuaWwi OworZnByaW50ZiAoc3RkZXJyLCAiXG5CdWZmZXIgKCVzKVxuIiwgd19jb250ZW50cyk7CisKK3N0 cnVjdCBmYWNlICpmYWNlID0gLi4uCitMaXNwX09iamVjdCBmb3JlZ3JvdW5kID0gZmFjZS0+bGZh Y2VbTEZBQ0VfRk9SRUdST1VORF9JTkRFWF07CitMaXNwX09iamVjdCBiYWNrZ3JvdW5kID0gZmFj ZS0+bGZhY2VbTEZBQ0VfQkFDS0dST1VORF9JTkRFWF07CitmcHJpbnRmIChzdGRlcnIsICJcbmZv cmVncm91bmQgKCVzKSB8IGJhY2tncm91bmQgKCVzKVxuIiwKKyAgICAgICAgICAgICAgICAgKCFO SUxQIChmb3JlZ3JvdW5kKSA/IFNTREFUQSAoZm9yZWdyb3VuZCkgOiAiTklMUCIpLAorICAgICAg ICAgICAgICAgICAoIU5JTFAgKGJhY2tncm91bmQpID8gU1NEQVRBIChiYWNrZ3JvdW5kKSA6ICJO SUxQIikpOworCitmcHJpbnRmIChzdGRlcnIsICJNeSBsaXNwIG9iamVjdDogICVzXG4iLCBTU0RB VEEgKEZjaGFyX3RvX3N0cmluZyAobWFrZV9maXhudW0gKDEwMSkpKSk7CisKK2ZwcmludGYgKHN0 ZGVyciwgInN0cmluZzogJXMgfCBpbnQ6ICVkXG4iLCAiZm9vIiwgNjkpOworCitpZiAoQlVGRkVS UCAody0+Y29udGVudHMpICYmIFNUUklOR1AgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg bmFtZSkpKQorICBmcHJpbnRmIChz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E1DX0JVSUxEX0dMWVBI X1NUUklOR1NfWFcoU1RBUlQsIEVORCwgSEVBRCwgVEFJTCwgSEwsIFgsIExBU1RfWCkJXAorICAg ICAgICAgICAgY2FzZSBYV0lER0VUX0dMWVBIOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgXAorICAgICAgICAgICAgICBNQ19CVUlMRF9YV0lER0VUX0dMWVBIX1NUUklO RyAoU1RBUlQsIEVORCwgSEVBRCwgVEFJTCwgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgSEwsIFgsIExBU1RfWCk7ICAgICAgICAgICAgICAgXAorICAg ICAgICAgICAgICBicmVhazsKKworI2RlZmluZSBNQ19CVUlMRF9HTFlQSF9TVFJJTkdTXzIoU1RB UlQsIEVORCwgSEVBRCwgVEFJTCwgSEwsIFgsIExBU1RfWCkJXAorCSAgICBjYXNlIEdMWVBITEVT U19HTFlQSDoJCQkJCVwKKwkgICAgICBNQ19CVUlMRF9HTFlQSExFU1NfR0xZUEhfU1RSSU5HIChT VEFSVCwgRU5ELCBIRUFELCBUQUlMLAlcCisJCQkJCSAgICBITCwgWCwgTEFTVF9YKTsJCVwKKwkg ICAgICBicmVhazsJCQkJCQkJXAorCQkJCQkJCQkJXAorCSAgICBkZWZhdWx0OgkJCQkJCQlcCisJ ICAgICAgZW1hY3NfYWJvcnQgKCk7CQkJCQkJXAorCSAgICB9CQkJCQkJCQlcCisJCQkJCQkJCQlc CisJICBpZiAocykJCQkJCQkJXAorCSAgICB7CQkJCQkJCQlcCisJICAgICAgc2V0X2dseXBoX3N0 cmluZ19iYWNrZ3JvdW5kX3dpZHRoIChzLCBTVEFSVCwgTEFTVF9YKTsJXAorCSAgICAgIChYKSAr PSBzLT53aWR0aDsJCQkJCQlcCisJICAgIH0JCQkJCQkJCVwKKwl9CQkJCQkJCQlcCisgICAgfSB3 aGlsZSAoZmFsc2UpCisKKyNkZWZpbmUgTUNfQlVJTERf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KyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAg ICBpZiAoIUNPTlNQIChsaXN0KSB8fCBFUSAoWENBUiAobGlzdCksIGVsdCkpCisgICAgICAgIGJy ZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkg fHwgRVEgKFhDQVIgKGxpc3QpLCBlbHQpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBY Q0RSIChsaXN0KTsKKyAgICB9CisgIHJldHVybiBsaXN0OworfQorCitMaXNwX09iamVjdAorbWNf bnRoIChpbnQgbnVtLCBMaXNwX09iamVjdCBsaXN0KQoreworICBmb3IgKGludCBpID0gMDsgaSA8 IG51bSAmJiAhTklMUCAobGlzdCk7IGkrKykKKyAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgIGlm IChDT05TUCAobGlzdCkpCisgICAgcmV0dXJuIFhDQVIgKGxpc3QpOworICAgIGVsc2UKKyAgICAg IHJldHVybiBRbmlsOworfQorCitMaXNwX09iamVjdAorbWNfYXNzcSAoTGlzcF9PYmplY3Qga2V5 LCBMaXNwX09iamVjdCBsaXN0KQoreworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBpZiAoIUNP TlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAg ICAgICYmIEVRIChYQ0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVhazsKKyAg ICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAg ICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhDQVIgKFhD QVIgKGxpc3QpKSwga2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxp c3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIg KGxpc3QpKQorICAgICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBrZXkpKSkK KyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgfQorICBpZiAo Q09OU1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FSIChsaXN0KTsKKyAgICBlbHNlCisgICAgICBy ZXR1cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QKK21jX2Fzc29jIChMaXNwX09iamVjdCBrZXks IExpc3BfT2JqZWN0IGxpc3QpCit7CisgIExpc3BfT2JqZWN0IGNhcjsKKyAgd2hpbGUgKDEpCisg ICAgeworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIg KGxpc3QpKQorICAgICAgICAgICAgICAmJiAoY2FyID0gWENBUiAoWENBUiAobGlzdCkpLAorICAg ICAgICAgICAgICAgICAgRVEgKGNhciwga2V5KSB8fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkp KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYg KCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAg ICAgICAgICAmJiAoY2FyID0gWENBUiAoWENBUiAobGlzdCkpLAorICAgICAgICAgICAgICAgICAg RVEgKGNhciwga2V5KSB8fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAgICAgIGJy ZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkK KyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiAoY2Fy ID0gWENBUiAoWENBUiAobGlzdCkpLAorICAgICAgICAgICAgICAgICAgRVEgKGNhciwga2V5KSB8 fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlz dCA9IFhDRFIgKGxpc3QpOworICAgIH0KKyAgaWYgKENPTlNQIChsaXN0KSkKKyAgICByZXR1cm4g WENBUiAobGlzdCk7CisgICAgZWxzZQorICAgICAgcmV0dXJuIFFuaWw7Cit9CisKK0xpc3BfT2Jq ZWN0CittY19wbGlzdF9nZXQgKExpc3BfT2JqZWN0IHBsaXN0LCBMaXNwX09iamVjdCBwcm9wKQor eworICBMaXNwX09iamVjdCB0YWlsLCBoYWxmdGFpbDsKKyAgLyogaGFsZnRhaWwgaXMgdXNlZCB0 byBkZXRlY3QgY2lyY3VsYXIgbGlzdHMuICAqLworICB0YWlsID0gaGFsZnRhaWwgPSBwbGlzdDsK KyAgd2hpbGUgKENPTlNQICh0YWlsKSAmJiBDT05TUCAoWENEUiAodGFpbCkpKQorICAgIHsKKyAg ICAgIGlmIChFUSAocHJvcCwgWENBUiAodGFpbCkpKQorICAgICAgICByZXR1cm4gWENBUiAoWENE UiAodGFpbCkpOworICAgICAgdGFpbCA9IFhDRFIgKFhDRFIgKHRhaWwpKTsKKyAgICAgIGhhbGZ0 YWlsID0gWENEUiAoaGFsZnRhaWwpOworICAgICAgaWYgKEVRICh0YWlsLCBoYWxmdGFpbCkpCisg ICAgICAgIGJyZWFrOworICAgIH0KKyAgcmV0dXJuIFFuaWw7Cit9CisKKy8qIENoZWNrIHRoZSBw cmVzZW5jZSBvZiBhIGRpc3BsYXkgcHJvcGVydHkgYW5kIGNvbXB1dGUgaXRzIHdpZHRoLgorICAg SWYgYSBwcm9wZXJ0eSB3YXMgZm91bmQgYW5kIGl0cyB3aWR0aCB3YXMgZm91bmQgYXMgd2VsbCwg cmV0dXJuCisgICBpdHMgd2lkdGggKD49IDApIGFuZCBzZXQgdGhlIHBvc2l0aW9uIG9mIHRoZSBl bmQgb2YgdGhlIHByb3BlcnR5CisgICBp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gY3Vyc29yIHdpbGwgYXBwZWFyLiAqLworICAg ICAgaWYgKGNvbCA+PSBnb2FsKQorICBicmVhazsKKyAgICAgIHByZXZfY29sID0gY29sOworICAg ICAgeyAvKiBDaGVjayBkaXNwbGF5IHByb3BlcnR5LiAqLworICBwdHJkaWZmX3QgZW5kcDsKKyAg aW50IHdpZHRoID0gbWNfY2hlY2tfZGlzcGxheV93aWR0aCAoc2NhbiwgY29sLCAmZW5kcCk7Cisg IGlmICh3aWR0aCA+PSAwKQorICAgIHsKKyAgICAgIGNvbCArPSB3aWR0aDsKKyAgICAgIGlmIChl bmRwID4gc2NhbikgLyogQXZvaWQgaW5maW5pdGUgbG9vcHMgd2l0aCAwLXdpZHRoIG92ZXJsYXlz LiAqLworICAgICAgICB7CisgICAgc2NhbiA9IGVuZHA7CisgICAgc2Nhbl9ieXRlID0gQ0hBUl9U T19CWVRFIChzY2FuKTsKKyAgICBjb250aW51ZTsKKyAgICAgICAgfQorICAgIH0KKyAgICAgIH0K KyAgICAgIC8qIENoZWNrIGNvbXBvc2l0aW9uIHNlcXVlbmNlLiAqLworICAgICAgaWYgKGNtcF9p dC5pZCA+PSAwCisgICAgfHwgKHNjYW4gPT0gY21wX2l0LnN0b3BfcG9zCisgICAgICAgICYmIGNv bXBvc2l0aW9uX3Jlc2VhdF9pdCAoJmNtcF9pdCwgc2Nhbiwgc2Nhbl9ieXRlLCBlbmQsCisgICAg ICAgICAgdywgTlVMTCwgUW5pbCkpKQorICBjb21wb3NpdGlvbl91cGRhdGVfaXQgKCZjbXBfaXQs IHNjYW4sIHNjYW5fYnl0ZSwgUW5pbCk7CisgICAgICBpZiAoY21wX2l0LmlkID49IDApCisgIHsK KyAgICBzY2FuICs9IGNtcF9pdC5uY2hhcnM7CisgICAgc2Nhbl9ieXRlICs9IGNtcF9pdC5uYnl0 ZXM7CisgICAgaWYgKHNjYW4gPD0gZW5kKQorICAgICAgY29sICs9IGNtcF9pdC53aWR0aDsKKyAg ICBpZiAoY21wX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ICAgIExpc3BfT2JqZWN0 IGVudHJ5ID0gQVJFRiAoY2hhcnZlYywgaSk7CisgICAgICAgIGlmIChHTFlQSF9DT0RFX1AgKGVu dHJ5KSkKKyAgICBjID0gR0xZUEhfQ09ERV9DSEFSIChlbnRyeSk7CisgICAgICAgIGVsc2UKKyAg ICBjID0gJyAnOworICAgICAgICBpZiAoYyA9PSAnXG4nKQorICAgIGdvdG8gZW5kbG9vcDsKKyAg ICAgICAgaWYgKGMgPT0gJ1xyJyAmJiBFUSAoQlZBUiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2 ZV9kaXNwbGF5KSwgUXQpKQorICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgaWYgKGMgPT0gJ1x0 JykKKyAgICB7CisgICAgICBjb2wgKz0gdGFiX3dpZHRoOworICAgICAgY29sID0gY29sIC8gdGFi X3dpZHRoICogdGFiX3dpZHRoOworICAgIH0KKyAgICAgICAgZWxzZQorICAgICsrY29sOworICAg ICAgfQorICB9CisgICAgICBlbHNlCisgIHsKKyAgICAvKiBUaGUgZGlzcGxheSB0YWJsZSBkb2Vz bid0IGFmZmVjdCB0aGlzIGNoYXJhY3RlcjsKKyAgICAgICBpdCBkaXNwbGF5cyBhcyBpdHNlbGYu ICovCisgICAgaWYgKGMgPT0gJ1xuJykKKyAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICBpZiAoYyA9 PSAnXHInICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rpc3BsYXkpLCBR dCkpCisgICAgICBnb3RvIGVuZGxvb3A7CisgICAgaWYgKGMgPT0gJ1x0JykKKyAgICAgIHsKKyAg ICAgICAgY29sICs9IHRhYl93aWR0aDsKKyAgICAgICAgY29sID0gY29sIC8gdGFiX3dpZHRoICog dGFiX3dpZHRoOworICAgICAgfQorICAgIGVsc2UgaWYgKG11bHRpYnl0ZSAmJiBMRUFESU5HX0NP REVfUCAoYykpCisgICAgICB7CisgICAgICAgIC8qIFN0YXJ0IG9mIG11bHRpLWJ5dGUgZm9ybS4g Ki8KKyAgICAgICAgdW5zaWduZWQgY2hhciAqcHRyOworICAgICAgICBpbnQgYnl0ZXMsIHdpZHRo OworICAgICAgICBwdHIgPSBCWVRFX1BPU19BRERSIChzY2FuX2J5dGUpOworICAgICAgICBNQ19N VUxUSUJZVEVfQllURVNfV0lEVEggKHB0ciwgZHAsIGJ5dGVzLCB3aWR0aCk7CisgICAgICAgIC8q IFN1YnRyYWN0IG9uZSB0byBjb21wZW5zYXRlIGZvciB0aGUgaW5jcmVtZW50CisgICAgIHRoYXQg aXMgZ29pbmcgdG8gaGFwcGVuIGJlbG93LiAqLworICAgICAgICBzY2FuX2J5dGUgKz0gYnl0ZXMg LSAxOworICAgICAgICBjb2wgKz0gd2lkdGg7CisgICAgICB9CisgICAgZWxzZSBpZiAoY3RsX2Fy cm93ICYmIChjIDwgMDQwIHx8IGMgPT0gMDE3NykpCisgICAgICBjb2wgKz0gMjsKKyAgICBlbHNl IGlmIChjIDwgMDQwIHx8IGMgPj0gMDE3NykKKyAgICAgIGNvbCArPSA0OworICAgIGVsc2UKKyAg ICAgIGNvbCsrOworICB9CisgICAgICBzY2FuKys7CisgICAgICBzY2FuX2J5dGUrKzsKKyAgICB9 CisgZW5kbG9vcDoKKyAgbGFzdF9rbm93bl9jb2x1bW4gPSBjb2w7CisgIGxhc3Rfa25vd25fY29s dW1uX3BvaW50ID0gcHQ7CisgIGxhc3Rfa25vd25fY29sdW1uX21vZGlmaWVkID0gTU9ESUZGOwor ICBpZiAoZ29hbGNvbCkKKyAgICAqZ29hbGNvbCA9IGNvbDsKKyAgaWYgKGVuZHBvcykKKyAgICAq ZW5kcG9zID0gc2NhbjsKKyAgaWYgKHByZXZjb2wpCisgICAgKnByZXZjb2wgPSBwcmV2X2NvbDsK K30KKworcHRyZGlmZl90CittY19jdXJyZW50X2NvbHVtbiAoc3RydWN0IHdpbmRvdyAqdywgcHRy ZGlmZl90IHB0KQoreworIC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N0cnVjdCBMaXNwX0NoYXJf VGFibGUgKmRwID0gYnVmZmVyX2Rpc3BsYXlfdGFibGUgKCk7CisgIGlmIChwdCA9PSBsYXN0X2tu b3duX2NvbHVtbl9wb2ludAorICAgICAgJiYgTU9ESUZGID09IGxhc3Rfa25vd25fY29sdW1uX21v ZGlmaWVkKQorICAgIHsKKyAgICAgIGlmIChvbGRfYnVmZmVyKQorICAgICAgICBzZXRfYnVmZmVy X2ludGVybmFsIChvbGRfYnVmZmVyKTsKKyAgICAgIHJldHVybiBsYXN0X2tub3duX2NvbHVtbjsK KyAgICB9CisgIC8qIElmIHRoZSBidWZmZXIgaGFzIG92ZXJsYXlzLCB0ZXh0IHByb3BlcnRpZXMs CisgICAgIG9yIG11bHRpYnl0ZSBjaGFyYWN0ZXJzLCB1c2UgYSBtb3JlIGdlbmVyYWwgYWxnb3Jp dGhtLiAqLworICBpZiAoYnVmZmVyX2ludGVydmFscyAoY3VycmVudF9idWZmZXIpCisgICAgICB8 fCBidWZmZXJfaGFzX292ZXJsYXlzICgpCisgICAgICB8fCBaICE9IFpfQllURSkKKyAgICB7Cisg ICAgICBFTUFDU19JTlQgY29sID0gTU9TVF9QT1NJVElWRV9GSVhOVU07CisgICAgICBtY19zY2Fu X2Zvcl9jb2x1bW4gKCZwdCwgJmNvbCwgTlVMTCwgcHQpOworICAgICAgeworICAgICAgICBpZiAo b2xkX2J1ZmZlcikKKyAgICAgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsK KyAgICAgICAgcmV0dXJuIGNvbDsKKyAgICAgIH0KKyAgICB9CisgIC8qIFNjYW4gYmFja3dhcmRz IGZyb20gcG9pbnQgdG8gdGhlIHByZXZpb3VzIG5ld2xpbmUsCisgICAgIGNvdW50aW5nIHdpZHRo LiAgVGFiIGNoYXJhY3RlcnMgYXJlIHRoZSBvbmx5IGNvbXBsaWNhdGVkIGNhc2UuICovCisgIC8q IE1ha2UgYSBwb2ludGVyIGZvciBkZWN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gKERJ U1BfQ0hBUl9WRUNUT1IgKGRwLCBjKSkpCisgIHsKKyAgICBjaGFydmVjID0gRElTUF9DSEFSX1ZF Q1RPUiAoZHAsIGMpOworICAgIG4gPSBBU0laRSAoY2hhcnZlYyk7CisgIH0KKyAgICAgIGVsc2UK KyAgeworICAgIGNoYXJ2ZWMgPSBRbmlsOworICAgIG4gPSAxOworICB9CisgICAgICBmb3IgKGkg PSBuIC0gMTsgaSA+PSAwOyAtLWkpCisgIHsKKyAgICBpZiAoVkVDVE9SUCAoY2hhcnZlYykpCisg ICAgICB7CisgICAgICAgIC8qIFRoaXMgc2hvdWxkIGJlIGhhbmRsZWQgdGhlIHNhbWUgYXMKKyAg ICAgbmV4dF9lbGVtZW50X2Zyb21fZGlzcGxheV92ZWN0b3IgZG9lcyBpdC4gKi8KKyAgICAgICAg TGlzcF9PYmplY3QgZW50cnkgPSBBUkVGIChjaGFydmVjLCBpKTsKKyAgICAgICAgaWYgKEdMWVBI X0NPREVfUCAoZW50cnkpKQorICAgIGMgPSBHTFlQSF9DT0RFX0NIQVIgKGVudHJ5KTsKKyAgICAg ICAgZWxzZQorICAgIGMgPSAnICc7CisgICAgICB9CisgICAgaWYgKGMgPj0gMDQwICYmIGMgPCAw MTc3KQorICAgICAgY29sKys7CisgICAgZWxzZSBpZiAoYyA9PSAnXG4nCisgICAgICAgfHwgKGMg PT0gJ1xyJworICAgICAgICAgICAmJiBFUSAoQlZBUiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2 ZV9kaXNwbGF5KSwgUXQpKSkKKyAgICAgIHsKKyAgICAgICAgcHRyKys7CisgICAgICAgIGdvdG8g c3RhcnRfb2ZfbGluZV9mb3VuZDsKKyAgICAgIH0KKyAgICBlbHNlIGlmIChjID09ICdcdCcpCisg ICAgICB7CisgICAgICAgIGlmICh0YWJfc2VlbikKKyAgICBjb2wgPSAoKGNvbCArIHRhYl93aWR0 aCkgLyB0YWJfd2lkdGgpICogdGFiX3dpZHRoOworICAgICAgICBwb3N0X3RhYiArPSBjb2w7Cisg ICAgICAgIGNvbCA9IDA7CisgICAgICAgIHRhYl9zZWVuID0gMTsKKyAgICAgIH0KKyAgICBlbHNl IGlmIChWRUNUT1JQIChjaGFydmVjKSkKKyAgICAgIC8qIFdpdGggYSBkaXNwbGF5IHRhYmxlIGVu dHJ5LCBDIGlzIGRpc3BsYXllZCBhcyBpcywgYW5kCisgICAgICAgICBub3QgZGlzcGxheWVkIGFz IFxOTk4gb3IgYXMgXk4uICBJZiBDIGlzIGEgc2luZ2xlLWJ5dGUKKyAgICAgICAgIGNoYXJhY3Rl ciwgaXQgdGFrZXMgb25lIGNvbHVtbi4gIElmIEMgaXMgbXVsdGktYnl0ZSBpbgorICAgICAgICAg YSB1bmlieXRlIGJ1ZmZlciwgaXQncyB0cmFuc2xhdGVkIHRvIHVuaWJ5dGUsIHNvIGl0CisgICAg ICAgICBhbHNvIHRha2VzIG9uZSBjb2x1bW4uICovCisgICAgICArK2NvbDsKKyAgICBlbHNlCisg ICAgICBjb2wgKz0gKGN0bF9hcnJvdyAmJiBjIDwgMDIwMCkgPyAyIDogNDsKKyAgfQorICAgIH0K KyBzdGFydF9vZl9saW5lX2ZvdW5kOgorICBpZiAodGFiX3NlZW4pCisgICAgeworICAgICAgY29s ID0gKChjb2wgKyB0YWJfd2lkdGgpIC8gdGFiX3dpZHRoKSAqIHRhYl93aWR0aDsKKyAgICAgIGNv bCArPSBwb3N0X3RhYjsKKyAgICB9CisgIGxhc3Rfa25vd25fY29sdW1uID0gY29sOworICBsYXN0 X2tub3duX2NvbHVtbl9wb2ludCA9IHB0OworICBsYXN0X2tub3duX2NvbHVtbl9tb2RpZmllZCA9 IE1PRElGRjsKKyAgaWYgKG9sZF9idWZmZXIpCisgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9i dWZmZXIpOworICByZXR1cm4gY29sOworfQorCitERUZVTiAoIm1jLWN1cnJlbnQtY29sdW1uIiwg Rm1jX2N1cnJlbnRfY29sdW1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b3csIExpc3BfT2JqZWN0IHB0KQoreworICBzdHJ1Y3Qgd2luZG93ICp3 ID0gZGVjb2RlX2xpdmVfd2luZG93ICh3aW5kb3cpOworICBMaXNwX09iamVjdCB0ZW1wOworICBY U0VURkFTVElOVCAodGVtcCwgbWNfY3VycmVudF9jb2x1bW4gKHcsIFhGSVhOVU0gKHB0KSkpOwor ICByZXR1cm4gdGVtcDsKK30KKworLyogVVNBR0U6ICBmcHJpbnRmIChzdGRlcnIsICJGUkFNRSAo JXMpIiwgbWNfZnJhbWUgKGYpKTsgKi8KK2NoYXIgKgorbWNfZnJhbWUgKHN0cnVjdCBmcmFtZSAq ZikKK3sKKyAgTGlzcF9PYmplY3QgZnJhbWU7CisgIFhTRVRGUkFNRSAoZnJhbWUsIGYpOworICBy ZXR1cm4gU1NEQVRBIChGcHJpbjFfdG9fc3RyaW5nIChmcmFtZSwgUW5pbCkpOworfQorCisvKiBV U0FHRTogIGZwcmludGYgKHN0ZGVyciwgIldJTkRPVyAoJXMpIiwgbWNfd2luZG93ICh3KSk7ICov CitjaGFyICoKK21jX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdykKK3sKKyAgTGlzcF9PYmplY3Qg d2luZG93OworICBYU0VUV0lORE9XICh3aW5kb3csIHcpOworICByZXR1cm4gU1NEQVRBIChGcHJp bjFfdG9fc3RyaW5nICh3aW5kb3csIFFuaWwpKTsKK30KKworLyogVVNBR0U6ICBmcHJpbnRmIChz dGRlcnIsICJDSEFSQUNURVIgKCVzKSIsIG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkp OyAqLworY2hhciAqCittY19jaGFyX3RvX3N0cmluZyAoaW50IGFyZykKK3sKKyAgTGlzcF9PYmpl Y3QgY2hhcmFjdGVyID0gKDAgPD0gYXJnICYmIGFyZyA8PSBNQVhfQ0hBUikKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gRmNoYXJfdG9fc3RyaW5nIChtYWtlX2ZpeG51bSAoYXJnKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogUW5pbDsKKyAgY2hhciAqIHJlc3VsdCA9ICghTklM UCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICYmIGFyZyA9PSA5KQorICAgICAgICAg ICAgICAgICAgICA/ICJcXHQiCisgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVy KQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDEwKQorICAgICAgICAgICAgICAgICAg ICA/ICJcXG4iCisgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAg ICAgICAgICAgICAgICAgJiYgYXJnID09IDMyKQorICAgICAgICAgICAgICAgICAgICA/ICJcXHMi CisgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAg ICAgICAgJiYgYXJnICE9IDkKKyAgICAgICAgICAgICAgICAgICAgICYmIGFyZyAhPSAxMAorICAg ICAgICAgICAgICAgICAgICAgJiYgYXJnICE9IDMyKQorICAgICAgICAgICAgICAgICAgICA/IFNT REFUQSAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgOiAiXFw/IjsKKyAgcmV0dXJuIHJl c3VsdDsKK30KKworaW50CittY19saXNwX3RvX2N1cnNvcl90eXBlIChMaXNwX09iamVjdCBhcmcp Cit7CisgIGNoYXIgKnN0cjsKKyAgaWYgKFhUWVBFIChhcmcpID09IExpc3BfU3RyaW5nKQorICAg IHN0ciA9IFNTREFUQSAoYXJnKTsKKyAgICBlbHNlIGlmIChYVFlQRSAoYXJnKSA9PSBMaXNwX1N5 bWJvbCkKKyAgICAgIHN0ciA9IFNTREFUQSAoU1lNQk9MX05BTUUgKGFyZykpOworICAgICAgZWxz ZSByZXR1cm4gLTE7CisgIGlmICghc3RyY21wIChzdHIsICJubyIpKQorICAgIHJldHVybiBNQ19O T19DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIsICJtYy1sZWZ0LWZyaW5nZS1iaXRtYXAiKSkK KyAgICByZXR1cm4gTUNfTEVGVF9GUklOR0VfQklUTUFQOworICBpZiAoIXN0cmNtcCAoc3RyLCAi bWMtcmlnaHQtZnJpbmdlLWJpdG1hcCIpKQorICAgIHJldHVybiBNQ19SSUdIVF9GUklOR0VfQklU TUFQOworICBpZiAoIXN0cmNtcCAoc3RyLCAiYm94IikpCisgICAgcmV0dXJuIE1DX0ZJTExFRF9C T1g7CisgIGlmICghc3RyY21wIChzdHIsICJmcmFtZWQiKSkKKyAgICByZXR1cm4gTUNfRlJBTUVE X0JPWDsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgImhvbGxvdyIpKQorICAgIHJldHVybiBNQ19IT0xM T1dfQk9YOworICBpZiAoIXN0cmNtcCAoc3RyLCAiYmFyIikpCisgICAgcmV0dXJuIE1DX0JBUjsK KyAgaWYgKCFzdHJjbXAgKHN0ciwgImhiYXIiKSkKKyAgICByZXR1cm4gTUNfSEJBUjsKKyAgcmV0 dXJuIC0xOworfQorCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIkNVUlNPUiBUWVBFICgl cykiLCBtY19jdXJzb3JfdHlwZV90b19zdHJpbmcgKGFyZykpOyAqLworY2hhciAqCittY19jdXJz b3JfdHlwZV90b19zdHJpbmcgKGVudW0gdHlwZV9vZl9jdXJzb3IgY3Vyc29yX3R5cGUpCit7Cisg IHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgeworICAgICAgY2FzZSBNQ19GSUxMRURfQk9YOiBy ZXR1cm4gIk1DX0ZJTExFRF9CT1giOworICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOiByZXR1cm4g Ik1DX0ZSQU1FRF9CT1giOworICAgICAgY2FzZSBNQ19IT0xMT1dfQk9YOiByZXR1cm4gIk1DX0hP TExPV19CT1giOworICAgICAgY2FzZSBNQ19CQVI6IHJldHVybiAiTUNfQkFSIjsKKyAgICAgIGNh c2UgTUNfSEJBUjogcmV0dXJuICJN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KKyAg ICBtY19mbGF2b3JfdG9fc3RyaW5nIChnbHlwaF9mbGF2b3IpLCBtY19jdXJzb3JfdHlwZV90b19z dHJpbmcgKGN1cnNvcl90eXBlKSk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJh bWUpOworICBNb3VzZV9ITEluZm8gKmhsaW5mbyA9IE1PVVNFX0hMX0lORk8gKGYpOworICBib29s IG1vdXNlX2ZhY2VfaGVyZV9wID0gZmFsc2U7CisgIHN0cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBo OworICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UgaGw7CisgIC8qIE5vIGN1cnNvciBkaXNwbGF5ZWQg b3Igcm93IGludmFsaWRhdGVkID0+IG5vdGhpbmcgdG8gZG8gb24gdGhlIHNjcmVlbi4gKi8KKyAg aWYgKGN1cnNvcl90eXBlID09IE1DX05PX0NVUlNPUikKKyAgICB7CisgICAgICBpZiAoZGVidWdf cCkKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2VfY3Vyc29yOiAgcmV0dXJuICgl ZClcbiIsIDEpOworICAgICAgcmV0dXJuOworICAgIH0KKyAgLyogVlBPUyA+PSBtYXRyaXgtPm5y b3dzIG1lYW5zIHRoYXQgd2luZG93IGhhcyBiZWVuIHJlc2l6ZWQuCisgICAgIERvbid0IGJvdGhl ciB0byBlcmFzZSB0aGUgY3Vyc29yLiAqLworICBpZiAodnBvcyA+PSBtYXRyaXgtPm5yb3dzKQor ICAgIHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19l cmFzZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwgMik7CisgICAgICByZXR1cm47CisgICAgfQor ICAvKiBJZiByb3cgY29udGFpbmluZyBjdXJzb3IgaXMgbWFya2VkIGludmFsaWQsIHRoZXJlIGlz IG5vdGhpbmcgd2UKKyAgICAgY2FuIGRvLiAqLworICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAg IHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFz ZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwgMyk7CisgICAgICByZXR1cm47CisgICAgfQorICAv KiBJZiBsaW5lIHNwYWNpbmcgaXMgPiAwLCBvbGQgY3Vyc29yIG1heSBvbmx5IGJlIHBhcnRpYWxs eSB2aXNpYmxlIGluCisgICAgIHdpbmRvdyBhZnRlciBzcGxpdC13aW5kb3cuICBTbyBhZGp1c3Qg dmlzaWJsZSBoZWlnaHQuICovCisgIHJvdy0+dmlzaWJsZV9oZWlnaHQgPSBtaW4gKHJvdy0+dmlz aWJsZV9oZWlnaHQsCisgICAgICAgICAgICB3aW5kb3dfdGV4dF9ib3R0b21feSAodykgLSByb3ct PnkpOworICAvKiBJZiByb3cgaXMgY29tcGxldGVseSBpbnZpc2libGUsIGRvbid0IGF0dGVtcHQg dG8gZGVsZXRlIGEgY3Vyc29yIHdoaWNoCisgICAgIGlzbid0IHRoZXJlLiAgVGhpcyBjYW4gaGFw cGVuIGlmIGN1cnNvciBpcyBhdCB0b3Agb2YgYSB3aW5kb3csIGFuZAorICAgICB3ZSBzd2l0Y2gg dG8gYSBidWZmZXIgd2l0aCBhIGhlYWRlciBsaW5lIGluIHRoYXQgd2luZG93LiAqLworICBpZiAo cm93LT52aXNpYmxlX2hlaWdodCA8PSAwKQorICAgIHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAg ICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwg NCk7CisgICAgICByZXR1cm47CisgICAgfQorICAvKiBJZiBjdXJzb3IgaXMgaW4gdGhlIGZyaW5n ZSwgZXJhc2UgYnkgZHJhd2luZyBhY3R1YWwgYml0bWFwIHRoZXJlLiAqLworICBpZiAocm93LT5j dXJzb3JfaW5fZnJpbm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B7CisgICAgICBpbnQgdGVtcF94ID0geDsKKyAgICAgIGludCBoZWFkZXJfbGluZV9o ZWlnaHQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgIGN1cnNvcl9nbHlw aCA9IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBocG9zLCB2cG9zKTsKKyAg ICAgIGlmIChjdXJzb3JfZ2x5cGggPT0gTlVMTCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChk ZWJ1Z19wKQorICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2VfY3Vyc29yOiAg cmV0dXJuICglZClcbiIsIDcpOworICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAg aW50IHRlbXBfd2QgPSBjdXJzb3JfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgaWYgKHRlbXBf eCA8IDApCisgICAgICAgIHsKKyAgICAgICAgICB0ZW1wX3dkICs9IHRlbXBfeDsKKyAgICAgICAg ICB0ZW1wX3ggPSAwOworICAgICAgICB9CisgICAgICB0ZW1wX3dkID0gbWluICh3ZCwgd2luZG93 X2JveF93aWR0aCAodywgVEVYVF9BUkVBKSAtIHRlbXBfeCk7CisgICAgICBpbnQgZnkgPSBXSU5E T1dfVE9fRlJBTUVfUElYRUxfWSAodywgbWF4IChoZWFkZXJfbGluZV9oZWlnaHQsIHJvdy0+eSkp OworICAgICAgaW50IGZ4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgdGVtcF94 KTsKKyAgICAgIGlmICh0ZW1wX3dkID4gMCkKKyAgICAgICAgRlJBTUVfUklGIChmKS0+Y2xlYXJf ZnJhbWVfYXJlYSAoZiwgZngsIGZ5LCB0ZW1wX3dkLCByb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAg ICB9CisgIC8qIEVyYXNlIHRoZSBjdXJzb3IgYnkgcmVkcmF3aW5nIHRoZSBja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Ky0gRHJhdy9lcmFzZSBhbGwgZ2x5cGhsZXNz IGN1cnNvcnMuICovCit2b2lkCittY19kcmF3X2VyYXNlX2h5YnJpZCAoc3RydWN0IHdpbmRvdyAq dywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisg ICAgICAgICAgICAgICAgICAgICAgaW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50IGhw b3MsIGludCB2cG9zLCBpbnQgd2QsIGludCBoLAorICAgICAgICAgICAgICAgICAgICAgIGVudW0g dHlwZV9vZl9jdXJzb3IgY3Vyc29yX3R5cGUsIGludCBjdXJzb3Jfd2lkdGgsCisgICAgICAgICAg ICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2wsIGJvb2wgYWN0aXZlX3AsIGVudW0gbWNfZmxh dm9yIGdseXBoX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wKQor eworICAvKiBgbWF0cml4X3JvdycgaW4gYGRpc3BuZXcuY2AgY29udGFpbnMgdGhlIGZvbGxvd2lu ZyB0ZXN0cywKKyAgZWFzc2VydCAobWF0cml4ICYmIG1hdHJpeC0+cm93cyk7CisgIGVhc3NlcnQg KHJvdyA+PSAwICYmIHJvdyA8IG1hdHJpeC0+bnJvd3MpOyAqLworICBib29sIGJhcmZfY3Jhc2hf b25lID0gKG1hdHJpeCAmJiBtYXRyaXgtPnJvd3MpID8gZmFsc2UgOiB0cnVlOworICBpZiAoYmFy Zl9jcmFzaF9vbmUpCisgICAgcmV0dXJuOworICBib29sIGJhcmZfY3Jhc2hfdHdvID0gKHZwb3Mg Pj0gMCAmJiB2cG9zIDwgbWF0cml4LT5ucm93cykgPyBmYWxzZSA6IHRydWU7CisgIGlmIChiYXJm X2NyYXNoX3R3bykKKyAgICByZXR1cm47CisgIGlmICh4IDwgMAorICAgICAgfHwgeSA8IDAKKyAg ICAgIHx8IGhwb3MgPCAwCisgICAgICB8fCB2cG9zIDwgMCkKKyAgICByZXR1cm47CisgIExpc3Bf T2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRzOworICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgIGJvb2wg YXV0b19oc2Nyb2xsX21vZGVfcCA9IEVRIChGYnVmZmVyX2xvY2FsX3ZhbHVlIChRYXV0b19oc2Ny b2xsX21vZGUsIGJ1ZiksIFFjdXJyZW50X2xpbmUpOworICAvKiBFWEFNUExFOiAgKHNjcm9sbC1s ZWZ0IDUpICovCisgIGJvb2wgaHNjbF9hbGxfdGVtcF9wID0gKHctPnN1c3BlbmRfYXV0b19oc2Ny b2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUg Qy14IDwgYW5kIGRvIG5vdGhpbmcuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8wX3AgPSAody0+ c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRv X2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9s bCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSB3LT5oc2Ny b2xsKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gc29tZXRoaW5nIGVsc2UgYmVz aWRlcyBob3Jpem9udGFsbHkgc2Nyb2xsaW5nIHRoZQorICAgICAgICAgICAgICAgY3VycmVudCBs aW5lIGRpZmZlcmVudGx5LgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhv cml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJt XzFfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5f aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9s bCA9PSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgLi4uCisgICAg ICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRp ZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMl9wID0gKCF3LT5zdXNwZW5kX2F1 dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9t b2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID09IDAKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCAhPSB3LT5oc2Nyb2xsKTsKKyAg LyogRVhBTVBMRTogIChzY3JvbGwtbGVmdCA1KTsgYW5kLCB0aGVuIHByZXNzIHRoZSBsZWZ0IGFy cm93IGtleSBvbmUgdGltZS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6 b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4qLworICBib29sIGhzY2xfdGVtcF9wID0gKCF3 LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNj cm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAg ICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IDApOworICAvKiBFWEFNUExF OiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgdGhhdCBjYXVzZXMgdGhlIGN1cnJlbnQgbGlu ZSB0byBiZQorICAgICAgICAgICAgICAgaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5 LgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5IHNjcm9sbGVk IGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfcGVybV9wID0gKCF3LT5zdXNwZW5kX2F1dG9f aHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAg ICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAg ICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1p bl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHct PmZyYW1lKTsKKyAgaW50IGZyaW5nZV9iaXRtYXAgPSBNQ19OT19GUklOR0VfQklUTUFQOworICBp bnQgZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgaWYgKCFyZW1vdmVfcAorICAgICAgJiYg Z2x5cGhfZmxhdm9yID09IE1DX09WRVJMQVlfQVJST1dfQklUTUFQCisgICAgICAmJiAhaHNjbF9h bGxfdGVtcF9wCisgICAgICAmJiA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pc3Agc2V0dGluZyB1c2luZyBgc2V0LWZyaW5nZS1iaXRtYXAtZmFjZScuICovCisgICAg ICByb3ctPmxlZnRfZnJpbmdlX2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5H RV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1h cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7 CisgICAgICByb3ctPmxlZnRfZnJpbmdlX2ZhY2VfaWQgPSBmYWNlX2lkOworICAgICAgcm93LT5s ZWZ0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgcm93LT5mcmluZ2VfYml0bWFwX3BlcmlvZGlj X3AgPSBmYWxzZTsKKyAgICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93LCB0cnVlLCBj dXJzb3JfdHlwZSk7CisgICAgfQorICAgIGVsc2UgaWYgKCFyZW1vdmVfcAorICAgICAgICAgICAg ICYmIGdseXBoX2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUAorICAgICAgICAgICAg ICYmIChoc2NsX2FsbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8w X3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8xX3AKKyAgICAgICAgICAgICAg ICAgfHwgaHNjbF9hbGxfcGVybV8yX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF90ZW1wX3AK KyAgICAgICAgICAgICAgICAgfHwgaHNjbF9wZXJtX3ApKQorICAgICAgeworICAgICAgICBlbnVt IGZhY2VfaWQgb3ZlcmxheV9hcnJvd19mYWNlX2lkID0KKyAgICAgICAgICAoIWFjdGl2ZV9wCisg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0 aXZl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VlZGVk LgorICAgICAgICBgbWNfZHJhd19mcmluZ2VfYml0bWFwXzEnIGlzIHNvbWV3aGF0IGNvbmZ1c2lu ZyBhbmQgcmVxdWlyZWQgc3RkZXJyIG1lc3NhZ2VzCisgICAgICAgIHRvIHNlZSB0aGF0IGByb3ct Pm92ZXJsYXlfYXJyb3dfYml0bWFwYCBzYXRpc2ZpZXMgdGhlIGZpcnN0IGNvbmRpdGlvbgorICAg ICAgICBvZiAod2hpY2ggIT0gTk9fRlJJTkdFX0JJVE1BUCkuICBBdCB0aGlzIHRpbWUsIEBsYXds aXN0IHByZWZlcnMgbm90IHRvCisgICAgICAgIHJlbHkgdXBvbiBhIExpc3Agc2V0dGluZyB1c2lu ZyBgc2V0LWZyaW5nZS1iaXRtYXAtZmFjZScuICovCisgICAgICAgIHJvdy0+bGVmdF9mcmluZ2Vf Yml0bWFwID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQ OworICAgICAgICByb3ctPmxlZnRfZnJpbmdlX2ZhY2VfaWQgPSBmYWNlX2lkOworICAgICAgICBy b3ctPmxlZnRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICAgIHJvdy0+ZnJpbmdlX2JpdG1hcF9w ZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93 LCB0cnVlLCBjdXJzb3JfdHlwZSk7CisgICAgICB9CisgICAgICBlbHNlIGlmICghcmVtb3ZlX3AK KyAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9S SUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZF UlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgfHwg Z2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUKKyAgICAgICAgICAgICAgICAgICB8 fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAg ICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdI VF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNB TF9CQVIKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURf VkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZF UlRJQ0FMX0JBUl9CQUNLU0xBU0gpKQorICAgICAgICB7CisgICAgICAgICAgTGlzcF9PYmplY3Qg Yml0bWFwX2ZsYXZvciA9IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdI VF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfaG9s bG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9S SUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFt Y19yZXZlcnNlZF9ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFO R0xFKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxv d19yZWN0YW5nbGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5 cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3cK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09 IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19yZXZlcnNlZF92ZXJ0aWNhbF9iYXJfcmlnaHRf YXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxh dm9yID09IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19yZXZlcnNlZF92ZXJ0 aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhf Zmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFFuaWw7CisgICAgICAgICAgZnJpbmdl X2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAg ICAgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9mcmluZ2VfYml0bWFwIChiaXRtYXBfZmxhdm9y KQorICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAg ICAgICAgZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisg ICAgICAgICAgICAgICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExP V19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAg ICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FM X0JBUikpCisgICAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwg aW50ZXJuICgiKy1yZXZlcnNlZC12ZXJ0aWNhbC1iYXItZmFjZSIpLCB0cnVlKQorICAgICAgICAg ICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAg ICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9IT0xMT1df UkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2Zs YXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAg ICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikK KyAgICAgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4g KCIrLXZlcnRpY2FsLWJhci1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgICAgICAgIDogREVG QVVMVF9GQUNFX0lEOworICAgICAgICAgIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gZmFsc2U7 CisgICAgICAgICAgcm93LT5yaWdodF9mcmluZ2VfYml0bWFwID0gZnJpbmdlX2JpdG1hcDsKKyAg ICAgICAgICByb3ctPnJpZ2h0X2ZyaW5nZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgICAgICBy b3ctPnJpZ2h0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgICAgIHJvdy0+ZnJpbmdlX2JpdG1h cF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwICh3 LCByb3csIGZhbHNlLCBjdXJzb3JfdHlwZSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAo Z2x5cGhfZmxhdm9yID09IE1DX0dMWVBICisgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19HTFlQSExFU1MpCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBvbl9wID0g dHJ1ZTsKKyAgICAgICAgICAgIEZSQU1FX1JJRiAoZiktPm1jX3NjcmliZV9jdXJzb3IgKHcsIG1h dHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICB2cG9zLCB3ZCwgaCwgbHNsLCBjdXJzb3JfdHlwZSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgZ2x5 cGhfZmxhdm9yLCBvbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgYWN0aXZlX3ApOworICAgICAgICAgIH0KK30KKworLyogRHVtcCBjb250ZW50cyBvZiBn bHlwaCBHTFlQSCB0byBzdGRlcnIuICBST1cgYW5kIEFSRUEgYXJlCisgICB0aGUgZ2x5cGggcm93 IGFuZCBhcmVhIHdoZXJlIHRoZSBnbHlwaCBjb21lcyBmcm9tLiAqLwordm9pZAorbWNfZHVtcF9n bHlwaCAoc3RydWN0IGdseXBoX3JvdyAqcm93LCBzdHJ1Y3QgZ2x5cGggKmdseXBoLCBpbnQgYXJl YSwgaW50IHJlbGF0aXZlX3gpCit7CisgIGlmIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisg ICAgICB8fCBnbHlwaC0+dHlwZSA9PSBHTFlQSExFU1NfR0xZUEgpCisgICAgeworICAgICAgZnBy aW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAl M2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVzXG4iLAorICAg ICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2Vk W2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2 ZV94LAorICAgICAgICAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgPyAnQycK KyAgICAgICAgIDogJ0cnKSwKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZG RVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1Ag KGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklMUCAo Z2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6ICct JykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+dS5jaCwK KyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3As CisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+eCwgZ2x5 cGgtPnksIGdseXBoLT5ocG9zLCBnbHlwaC0+dnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0t IiwKKyAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKGdseXBoLT51LmNoKSk7CisgICAgfQorICBl bHNlIGlmIChnbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmlu dGYgKHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNk IDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAlNWQgJTRkICAlM2QgICUzZCAlcyAlc1xuIiwKKyAgICAg ICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFth cmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVf eCwKKyAgICAgICAgJ1MnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZF UlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklO R1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAg KGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAor ICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgt PnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhw b3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAiXFxT Iik7CisgICAgfQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICB7 CisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAl OSJwRCJkICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgJTVkICU0ZCAgJTNkICAlM2QgJXMg JWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAg KChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAg ICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdJJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisg ICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAg ICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAg ICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAg ICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5zaWdu ZWQgaW50KSBnbHlwaC0+dS5pbWdfaWQsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAg ICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVf cCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3Ms IGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisgICAgfQorICBlbHNl IGlmIChnbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpCisgICAgeworICAgICAgZnByaW50 ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2Qg MHglMDZ4IiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAg ICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAg ICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJysnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywK KyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdCJworICAg ICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAg ICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICcwJworICAgICAg ICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgICh1bnNp Z25lZCBpbnQpIGdseXBoLT51LmNtcC5pZCk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTRk ICUxLjFkJTEuMWQiLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxl ZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3ApOworICAgICAg aWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAl NWQgJTRkICAlM2QgICUzZCAlcyAuIFslZC0lZF1cbiIsCisgICAgICAgICAgICAgICAgICAgICAg ICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3MsIGdseXBoLT56 dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPnNsaWNl LmNtcC5mcm9tLCBnbHlwaC0+c2xpY2UuY21wLnRvKTsKKyAgICAgICAgZWxzZQorICAgICAgICBm cHJpbnRmIChzdGRlcnIsICJcbiIpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0g WFdJREdFVF9HTFlQSCkKKyAgICB7CisjaWZuZGVmIEhBVkVfWFdJREdFVFMKKyAgICAgIGVhc3N1 bWUgKGZhbHNlKTsKKyNlbHNlCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICIgICU1 ZC8lLTVkICU1ZCAlNGMgJTZkICVjICUzZCAweCUwNXggJTRkICUxLjFkJTEuMWQgJTVkICU0ZCAg JTNkICAlM2QgJXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFd IC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdYJywKKyAgICAgICAgZ2x5cGgt PmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICA/ ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8g J1MnCisgICAgICAgICA6ICctJykpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAg ICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAg ICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnUueHdpZGdldCwK KyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3MsIGds eXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisjZW5kaWYKKyAgICB9Cit9 CisKKy8qIER1bXAgdGhlIGNvbnRlbnRzIG9mIGdseXBoIHJvdyBhdCBWUE9TIGluIE1BVFJJWCB0 byBzdGRlcnIuCisgICBHTFlQSFMgMCBtZWFucyBkb24ndCBzaG93IGdseXBoIGNvbnRlbnRzLgor ICAgR0xZUEhTIDEgbWVhbnMgc2hvdyBnbHlwaHMgaW4gc2hvcnQgZm9ybQorICAgR0xZUEhTID4g MSBtZWFucyBzaG93IGdseXBocyBpbiBsb25nIGZvcm0uICovCit2b2lkCittY19kdW1wX2dseXBo X3JvdyAoc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgdnBvcywgaW50IGdseXBocykKK3sKKyAg aW50IHJlbGF0aXZlX3ggPSAwOworICBpZiAoZ2x5cGhzICE9IDEpCisgICAgeworICAgICAgZnBy aW50ZiAoc3RkZXJyLCAiXG5EVU1QIEdMWVBIIFJPV1xuIik7CisgICAgICBmcHJpbnRmIChzdGRl cnIsICJSb3cgICAgIFN0YXJ0ICAgICAgIEVuZCBVc2VkIG9FPjxcXENUWkZlc20gICAgIFggICAg WSAgICBXICAgIEggICAgViAgICBBICAgIFBcbiIpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAi PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09XG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiUzZCAl OSJwRCJkICU5InBEImQgJTRkICUxLjFkJTEuMWQlMS4xZCUxLjFkXAorJTEuMWQlMS4xZCUxLjFk JTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCAgJTRkICU0ZCAlNGQgJTRkICU0ZCAlNGQgJTRkXG4i LAorICAgICAgICAgdnBvcywKKyAgICAgICAgIE1BVFJJWF9ST1dfU1RBUlRfQ0hBUlBPUyAocm93 KSwKKyAgICAgICAgIE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdyksCisgICAgICAgICByb3ct PnVzZWRbVEVYVF9BUkVBXSwKKyAgICAgICAgIHJvdy0+Y29udGFpbnNfb3ZlcmxhcHBpbmdfZ2x5 cGhzX3AsCisgICAgICAgICByb3ctPmVuYWJsZWRfcCwKKyAgICAgICAgIHJvdy0+dHJ1bmNhdGVk X29uX2xlZnRfcCwKKyAgICAgICAgIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3AsCisgICAgICAg ICByb3ctPmNvbnRpbnVlZF9wLAorICAgICAgICAgTUFUUklYX1JPV19DT05USU5VQVRJT05fTElO RV9QIChyb3cpLAorICAgICAgICAgTUFUUklYX1JPV19ESVNQTEFZU19URVhUX1AgKHJvdyksCisg ICAgICAgICByb3ctPmVuZHNfYXRfenZfcCwKKyAgICAgICAgIHJvdy0+ZmlsbF9saW5lX3AsCisg ICAgICAgICByb3ctPmVuZHNfaW5fbWlkZGxlX29mX2NoYXJfcCwKKyAgICAgICAgIHJvdy0+c3Rh cnRzX2luX21pZGRsZV9vZl9jaGFyX3AsCisgICAgICAgICByb3ctPm1vdXNlX2ZhY2VfcCwKKyAg ICAgICAgIHJvdy0+eCwKKyAgICAgICAgIHJvdy0+eSwKKyAgICAgICAgIHJvdy0+cGl4ZWxfd2lk dGgsCisgICAgICAgICByb3ctPmhlaWdodCwKKyAgICAgICAgIHJvdy0+dmlzaWJsZV9oZWlnaHQs CisgICAgICAgICByb3ctPmFzY2VudCwKKyAgICAgICAgIHJvdy0+cGh5c19hc2NlbnQpOworICAg ICAgLyogVGhlIG5leHQgMyBsaW5lcyBzaG91bGQgYWxpZ24gdG8gIlN0YXJ0IiBpbiB0aGUgaGVh ZGVyLiAqLworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAgICU5InBEImQgJTkicEQiZFx0JTVk XG4iLCByb3ctPnN0YXJ0Lm92ZXJsYXlfc3RyaW5nX2luZGV4LAorICAgICAgICAgcm93LT5lbmQu b3ZlcmxheV9zdHJpbmdfaW5kZXgsCisgICAgICAgICByb3ctPmNvbnRpbnVhdGlvbl9saW5lc193 aWR0aCk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTkicEQiZCAlOSJwRCJkXG4iLAor ICAgICAgICAgQ0hBUlBPUyAocm93LT5zdGFydC5zdHJpbmdfcG9zKSwKKyAgICAgICAgIENIQVJQ T1MgKHJvdy0+ZW5kLnN0cmluZ19wb3MpKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgICAl OWQgJTlkXG4iLCByb3ctPnN0YXJ0LmRwdmVjX2luZGV4LAorICAgICAgICAgcm93LT5lbmQuZHB2 ZWNfaW5kZXgpOworICAgIH0KKyAgaWYgKGdseXBocyA+IDEpCisgICAgeworICAgICAgZm9yIChp bnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAg eworICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBoc1thcmVhXTsKKyAgICBzdHJ1 Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51c2VkW2FyZWFdOworICAgIC8qIEds eXBoIGZvciBhIGxpbmUgZW5kIGluIHRleHQuICovCisgICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVB ICYmIGdseXBoID09IGdseXBoX2VuZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDApCisgICAgICArK2ds eXBoX2VuZDsKKyAgICBpZiAoZ2x5cGggPCBnbHlwaF9lbmQpCisgICAgICBmcHJpbnRmIChzdGRl cnIsICJHbHlwaCMvVG90YWwgUmVsLlggVCAgICAgICBQb3MgTyAgIFcgICAgIENvZGUgRmFjZSBM UiAgICAgWCAgICBZIEhQT1MgVlBPUyBaViBDXG4iKTsKKyAgICBmb3IgKDsgZ2x5cGggPCBnbHlw aF9lbmQ7ICsrZ2x5cGgpCisgICAgICB7CisgICAgICAgIG1jX2R1bXBfZ2x5cGggKHJvdywgZ2x5 cGgsIGFyZWEsIHJlbGF0aXZlX3gpOworICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhl bF93aWR0aDsKKyAgICAgIH0KKyAgfQorICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGhzID09IDEpCisg ICAgeworICAgICAgY2hhciBzW1NIUlRfTUFYICsgNF07CisgICAgICBmb3IgKGludCBhcmVhID0g TEVGVF9NQVJHSU5fQVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICB7CisgICAgaW50 IGk7CisgICAgZm9yIChpID0gMDsgaSA8IHJvdy0+dXNlZFthcmVhXTsgKytpKQorICAgICAgewor ICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV0gKyBpOworICAg ICAgICBpZiAoaSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAmJiBhcmVhID09IFRFWFRf QVJFQQorICAgICAgJiYgTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICYmIGdseXBoLT50eXBl ID09IENIQVJfR0xZUEgKKyAgICAgICYmIGdseXBoLT51LmNoID09ICcgJykKKyAgICB7CisgICAg ICBzdHJjcHkgKCZzW2ldLCAiW1xcbl0iKTsKKyAgICAgIGkgKz0gNDsKKyAgICB9CisgICAgICAg IGVsc2UgaWYgKGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgICAgJiYgZ2x5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wb3NfdmlzaWJsZV9wICh3LCBQVCwgJmQxLCAm ZDIsICZkMywgJmQ0LCAmZDUsICZ5cG9zKTsKKyAgICAgIGludCBoZWFkZXJfbGluZV9oZWlnaHQg PSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgIGludCB2b2Zmc2V0ID0gKGhl YWRlcl9saW5lX2hlaWdodCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICYmIHlwb3MgPiAwKQor ICAgICAgICAgICAgICAgICAgICAgID8geXBvcyArIDEKKyAgICAgICAgICAgICAgICAgICAgICA6 IHlwb3M7CisgICAgICBpZiAodmlzaWJsZV9wKQorICAgICAgICB2cG9zID0gdm9mZnNldDsKKyAg ICAgICAgZWxzZQorICAgICAgICAgIHZwb3MgPSAwOworICAgIH0KKyAgICBlbHNlCisgICAgICB7 CisgICAgICAgIENIRUNLX05VTUJFUiAocm93KTsKKyAgICAgICAgdnBvcyA9IFhGSVhOVU0gKHJv dyk7CisgICAgICB9CisgIG1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICBpZiAodnBvcyA+ PSAwICYmIHZwb3MgPCBtYXRyaXgtPm5yb3dzKQorICAgIG1jX2R1bXBfZ2x5cGhfcm93IChNQVRS SVhfUk9XIChtYXRyaXgsIHZwb3MpLAorICAgICAgICB2cG9zLAorICAgICAgICBUWVBFX1JBTkdF RF9GSVhOVU1QIChpbnQsIGdseXBocykgPyBYRklYTlVNIChnbHlwaHMpIDogMik7CisgIHJldHVy biBRbmlsOworfQorCit2b2lkCittY19kdW1wX2dseXBoX21hdHJpeCAoc3RydWN0IGdseXBoX21h dHJpeCAqbWF0cml4LCBpbnQgZ2x5cGhzKQoreworICBpbnQgaTsKKyAgZm9yIChpID0gMDsgaSA8 IG1hdHJpeC0+bnJvd3M7ICsraSkKKyAgICBtY19kdW1wX2dseXBoX3JvdyAoTUFUUklYX1JPVyAo bWF0cml4LCBpKSwgaSwgZ2x5cGhzKTsKK30KKworREVGVU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5jdXJzb3IueCwgdy0+Y3Vyc29y LnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcyk7CisgIGZwcmludGYgKHN0ZGVyciwg Ij09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuIik7CisgIG1j X2R1bXBfZ2x5cGhfbWF0cml4ICh3LT5jdXJyZW50X21hdHJpeCwKKyAgICAgICAgIFRZUEVfUkFO R0VEX0ZJWE5VTVAgKGludCwgZ2x5cGhzKSA/IFhGSVhOVU0gKGdseXBocykgOiAwKTsKKyAgcmV0 dXJuIFFuaWw7Cit9CisKK3ZvaWQKK21jX3Jlc2V0X2NhY2hlIChzdHJ1Y3Qgd2luZG93ICp3LCBl bnVtIHR5cGVfb2ZfY2FjaGUgY2FjaGVfdHlwZSkKK3sKKyAgc3dpdGNoIChjYWNoZV90eXBlKQor ICAgIHsKKyAgICAgIGNhc2UgTk9fQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBicmVhazsK KyAgICAgICAgfQorICAgICAgY2FzZSBNQ19DQUNIRToKKyAgICAgICAgeworICAgICAgICAgIGlm IChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgJiYgdy0+bWNfZWx0 cy51c2VkID4gMSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogRGVjcmVhc2UgdGhl IHNpemUgb2YgdGhlIGFycmF5IHRvIGEgYmFyZSBtaW5pbXVtLiAqLworICAgICAgICAgICAgICB3 LT5tY19lbHRzLmNhY2hlcyA9IHhucmVhbGxvYyAody0+bWNfZWx0cy5jYWNoZXMsIDEsIHNpemVv ZiAqdy0+bWNfZWx0cy5jYWNoZXMpOworICAgICAgICAgICAgICB3LT5tY19lbHRzLnVzZWQgPSAw OworICAgICAgICAgICAgICB3LT5tY19lbHRzLmFsbG9jYXRlZCA9IDE7CisgICAgICAgICAgICB9 CisgICAgICAgICAgICAvLyAgQWx0aG91Z2ggaXQgd291bGQgbm90IGJlIHZlcnkgZWZmaWNpZW50 LCBpdCBpcyBwb3NzaWJsZSB0byBzZXQKKyAgICAgICAgICAgIC8vICB0aGUgX3VzZWRfIGVsZW1l bnRzIG9mIHRoZSBhcnJheSB0byB6ZXJvLiAgSW4gc3VjaCBhIGNhc2UsIHRoZQorICAgICAgICAg ICAgLy8gIC4uLl9lbHRzLmFsbG9jYXRlZCB3b3VsZCByZW1haW4gdGhlIHNhbWUuCisgICAgICAg ICAgICAvLyAgbWVtc2V0ICh3LT5tY19lbHRzLmNhY2hlcywgMCwgdy0+bWNfZWx0cy51c2VkICog KHNpemVvZiAqdy0+bWNfZWx0cy5jYWNoZXMpKTsKKyAgICAgICAgICAgIC8vICBBdCB0aGlzIHRp bWUsIHdlIGFyZSBpbnN0ZWFkIGxlYXZpbmcgdGhlIGFycmF5IGFzLWlzIHdpdGggdGhlCisgICAg ICAgICAgICAvLyAgdW5kZXJzdGFuZGluZyB0aGF0IGl0IHdpbGwgY29udGFpbiBvdXRkYXRlZCBk YXRhIChha2EgZ2FyYmFnZSkuCisgICAgICAgICAgICAvLyAgVXNpbmcgdGhlIGNvdW50ZXIgYHct Pm1jX2VsdHMudXNlZGAsIHdlIHRyYWNrIGN1cnJlbnQgZGF0YS4KKyAgICAgICAgICAgIGVsc2Ug aWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICAgICAgICB3 LT5tY19lbHRzLnVzZWQgPSAwOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBj YXNlIENIX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRl bnRzKQorICAgICAgICAgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAmJiB3LT5jaF9lbHRzLnVzZWQgPiAxKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICAvKiBEZWNyZWFzZSB0aGUgc2l6ZSBvZiB0aGUgYXJy YXkgdG8gYSBiYXJlIG1pbmltdW0uICovCisgICAgICAgICAgICAgIHctPmNoX2VsdHMuY2FjaGVz ID0geG5yZWFsbG9jICh3LT5jaF9lbHRzLmNhY2hlcywgMSwgc2l6ZW9mICp3LT5jaF9lbHRzLmNh Y2hlcyk7CisgICAgICAgICAgICAgIHctPmNoX2VsdHMudXNlZCA9IDA7CisgICAgICAgICAgICAg IHctPmNoX2VsdHMuYWxsb2NhdGVkID0gMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8v ICBBbHRob3VnaCBpdCB3b3VsZCBub3QgYmUgdmVyeSBlZmZpY2llbnQsIGl0IGlzIHBvc3NpYmxl IHRvIHNldAorICAgICAgICAgICAgLy8gIHRoZSBfdXNlZF8gZWxlbWVudHMgb2YgdGhlIGFycmF5 IHRvIHplcm8uICBJbiBzdWNoIGEgY2FzZSwgdGhlCisgICAgICAgICAgICAvLyAgLi4uX2VsdHMu YWxsb2NhdGVkIHdvdWxkIHJlbWFpbiB0aGUgc2FtZS4KKyAgICAgICAgICAgIC8vICBtZW1zZXQg KHctPmNoX2VsdHMuY2FjaGVzLCAwLCB3LT5jaF9lbHRzLnVzZWQgKiAoc2l6ZW9mICp3LT5jaF9l bHRzLmNhY2hlcykpOworICAgICAgICAgICAgLy8gIEF0IHRoaXMgdGltZSwgd2UgYXJlIGluc3Rl YWQgbGVhdmluZyB0aGUgYXJyYXkgYXMtaXMgd2l0aCB0aGUKKyAgICAgICAgICAgIC8vICB1bmRl cnN0YW5kaW5nIHRoYXQgaXQgd2lsbCBjb250YWluIG91dGRhdGVkIGRhdGEgKGFrYSBnYXJiYWdl KS4KKyAgICAgICAgICAgIC8vICBVc2luZyB0aGUgY291bnRlciBgdy0+Y2hfZWx0cy51c2VkYCwg d2UgdHJhY2sgY3VycmVudCBkYXRhLgorICAgICAgICAgICAgZWxzZSBpZiAoQlVGRkVSUCAody0+ Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICAgICAgICAgIHctPmNoX2VsdHMudXNl ZCA9IDA7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2UgRkNfQ0FDSEU6 CisgICAgICAgIHsKKyAgICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAg ICAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkp CisgICAgICAgICAgICAgICYmIHctPmZjX2VsdHMudXNlZCA+IDEpCisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIC8qIERlY3JlYXNlIHRoZSBzaXplIG9mIHRoZSBhcnJheSB0byBhIGJhcmUg bWluaW11bS4gKi8KKyAgICAgICAgICAgICAgdy0+ZmNfZWx0cy5jYWNoZXMgPSB4bnJlYWxsb2Mg KHctPmZjX2VsdHMuY2FjaGVzLCAxLCBzaXplb2YgKnctPmZjX2VsdHMuY2FjaGVzKTsKKyAgICAg ICAgICAgICAgdy0+ZmNfZWx0cy51c2VkID0gMDsKKyAgICAgICAgICAgICAgdy0+ZmNfZWx0cy5h bGxvY2F0ZWQgPSAxOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gIEFsdGhvdWdoIGl0 IHdvdWxkIG5vdCBiZSB2ZXJ5IGVmZmljaWVudCwgaXQgaXMgcG9zc2libGUgdG8gc2V0CisgICAg ICAgICAgICAvLyAgdGhlIF91c2VkXyBlbGVtZW50cyBvZiB0aGUgYXJyYXkgdG8gemVyby4gIElu IHN1Y2ggYSBjYXNlLCB0aGUKKyAgICAgICAgICAgIC8vICAuLi5fZWx0cy5hbGxvY2F0ZWQgd291 bGQgcmVtYWluIHRoZSBzYW1lLgorICAgICAgICAgICAgLy8gIG1lbXNldCAody0+ZmNfZWx0cy5j YWNoZXMsIDAsIHctPmZjX2VsdHMudXNlZCAqIChzaXplb2YgKnctPmZjX2VsdHMuY2FjaGVzKSk7 CisgICAgICAgICAgICAvLyAgQXQgdGhpcyB0aW1lLCB3ZSBhcmUgaW5zdGVhZCBsZWF2aW5nIHRo ZSBhcnJheSBhcy1pcyB3aXRoIHRoZQorICAgICAgICAgICAgLy8gIHVuZGVyc3RhbmRpbmcgdGhh dCBpdCB3aWxsIGNvbnRhaW4gb3V0ZGF0ZWQgZGF0YSAoYWthIGdhcmJhZ2UpLgorICAgICAgICAg ICAgLy8gIFVzaW5nIHRoZSBjb3VudGVyIGB3LT5mY19lbHRzLnVzZWRgLCB3ZSB0cmFjayBjdXJy ZW50IGRhdGEuCisgICAgICAgICAgICBlbHNlIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAg ICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGZjX3Zpc2libGUpKSkKKyAgICAgICAgICAgICAgdy0+ZmNfZWx0cy51c2VkID0gMDsKKyAgICAg ICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KK30KKworc3RhdGljIHZvaWQKK21jX2hlbHBl ciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3Qg Z2x5cGhfcm93ICpyb3csCisgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGgsIGludCB4LCBp bnQgZngsIGludCB5LCBpbnQgZnksIGludCBocG9zLCBpbnQgdnBvcywKKyAgICAgICAgICAgaW50 IHdkLCBpbnQgaCwgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3Jf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9uIHRoYXQgcG9wdWxhdGVz IHRoZSBjYWNoZSB3aXRoCisgICAgICAgICAgY3Vyc29yIGRhdGEsIGFzIHRoYXQgd2lsbCBjYXVz ZSBhIFNJR1NFR1YgKHNlZ21lbnRhdGlvbiBmYXVsdCkuICovCisgICAgICAgICAgcmV0dXJuOwor ICAgICAgICB9CisgICAgICBjYXNlIE1DX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgKyt3 LT5tY19lbHRzLnVzZWQ7CisgICAgICAgICAgaWYgKHctPm1jX2VsdHMuYWxsb2NhdGVkIDwgdy0+ bWNfZWx0cy51c2VkKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpbnQgb2xkX2FsbG9j ID0gdy0+bWNfZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgICAgIGludCBuZXdfZWx0cyA9IHct Pm1jX2VsdHMudXNlZCAtIHctPm1jX2VsdHMuYWxsb2NhdGVkOworICAgICAgICAgICAgICB3LT5t Y19lbHRzLmNhY2hlcyA9IHhwYWxsb2MgKHctPm1jX2VsdHMuY2FjaGVzLCAmdy0+bWNfZWx0cy5h bGxvY2F0ZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3 X2VsdHMsIElOVF9NQVgsIHNpemVvZiAqdy0+bWNfZWx0cy5jYWNoZXMpOworICAgICAgICAgICAg ICBtZW1zZXQgKHctPm1jX2VsdHMuY2FjaGVzICsgb2xkX2FsbG9jLCAwLAorICAgICAgICAgICAg ICAgICAgICAgICAody0+bWNfZWx0cy5hbGxvY2F0ZWQgLSBvbGRfYWxsb2MpICogc2l6ZW9mICp3 LT5tY19lbHRzLmNhY2hlcyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgZm9vX2VsdHMuY2Fj aGVzID0gdy0+bWNfZWx0cy5jYWNoZXM7CisgICAgICAgICAgZm9vX2VsdHMuYWxsb2NhdGVkID0g dy0+bWNfZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgZm9vX2VsdHMudXNlZCA9IHctPm1jX2Vs dHMudXNlZDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBDSF9DQUNI RToKKyAgICAgICAgeworICAgICAgICAgICsrdy0+Y2hfZWx0cy51c2VkOworICAgICAgICAgIGlm ICh3LT5jaF9lbHRzLmFsbG9jYXRlZCA8IHctPmNoX2VsdHMudXNlZCkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgaW50IG9sZF9hbGxvYyA9IHctPmNoX2VsdHMuYWxsb2NhdGVkOworICAg ICAgICAgICAgICBpbnQgbmV3X2VsdHMgPSB3LT5jaF9lbHRzLnVzZWQgLSB3LT5jaF9lbHRzLmFs bG9jYXRlZDsKKyAgICAgICAgICAgICAgdy0+Y2hfZWx0cy5jYWNoZXMgPSB4cGFsbG9jICh3LT5j aF9lbHRzLmNhY2hlcywgJnctPmNoX2VsdHMuYWxsb2NhdGVkLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19lbHRzLCBJTlRfTUFYLCBzaXplb2YgKnctPmNo X2VsdHMuY2FjaGVzKTsKKyAgICAgICAgICAgICAgbWVtc2V0ICh3LT5jaF9lbHRzLmNhY2hlcyAr IG9sZF9hbGxvYywgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgKHctPmNoX2VsdHMuYWxsb2Nh dGVkIC0gb2xkX2FsbG9jKSAqIHNpemVvZiAqdy0+Y2hfZWx0cy5jYWNoZXMpOworICAgICAgICAg ICAgfQorICAgICAgICAgIGZvb19lbHRzLmNhY2hlcyA9IHctPmNoX2VsdHMuY2FjaGVzOworICAg ICAgICAgIGZvb19lbHRzLmFsbG9jYXRlZCA9IHctPmNoX2VsdHMuYWxsb2NhdGVkOworICAgICAg ICAgIGZvb19lbHRzLnVzZWQgPSB3LT5jaF9lbHRzLnVzZWQ7CisgICAgICAgICAgYnJlYWs7Cisg ICAgICAgIH0KKyAgICAgIGNhc2UgRkNfQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICArK3ct PmZjX2VsdHMudXNlZDsKKyAgICAgICAgICBpZiAody0+ZmNfZWx0cy5hbGxvY2F0ZWQgPCB3LT5m Y19lbHRzLnVzZWQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGludCBvbGRfYWxsb2Mg PSB3LT5mY19lbHRzLmFsbG9jYXRlZDsKKyAgICAgICAgICAgICAgaW50IG5ld19lbHRzID0gdy0+ ZmNfZWx0cy51c2VkIC0gdy0+ZmNfZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgICAgIHctPmZj X2VsdHMuY2FjaGVzID0geHBhbGxvYyAody0+ZmNfZWx0cy5jYWNoZXMsICZ3LT5mY19lbHRzLmFs bG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdf ZWx0cywgSU5UX01BWCwgc2l6ZW9mICp3LT5mY19lbHRzLmNhY2hlcyk7CisgICAgICAgICAgICAg IG1lbXNldCAody0+ZmNfZWx0cy5jYWNoZXMgKyBvbGRfYWxsb2MsIDAsCisgICAgICAgICAgICAg ICAgICAgICAgICh3LT5mY19lbHRzLmFsbG9jYXRlZCAtIG9sZF9hbGxvYykgKiBzaXplb2YgKnct PmZjX2VsdHMuY2FjaGVzKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBmb29fZWx0cy5jYWNo ZXMgPSB3LT5mY19lbHRzLmNhY2hlczsKKyAgICAgICAgICBmb29fZWx0cy5hbGxvY2F0ZWQgPSB3 LT5mY19lbHRzLmFsbG9jYXRlZDsKKyAgICAgICAgICBmb29fZWx0cy51c2VkID0gdy0+ZmNfZWx0 cy51c2VkOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorICBpbnQgbnRoID0g Zm9vX2VsdHMudXNlZCAtIDE7CisgIGZvb19lbHRzLmNhY2hlc1tudGhdLnggPSB4OworICBmb29f ZWx0cy5jYWNoZXNbbnRoXS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ICAgICAgaW50byBjb25zaWRlcmF0aW9uIGB4LXN0cmV0Y2gtY3Vyc29yJyBhbmQg YGN1cnNvcl90eXBlYC4KKyAgIEg6ICBNQ19IQkFSIGlzIDEgcGl4ZWwsIGFuZCBhbGwgb3RoZXJz IGFyZSBST1ctPlZJU0lCTEVfSEVJR0hULgorICAgICAgIEZJWE1FOiAgQWRkIGNvbmRpdGlvbnMg Zm9yIHVzZXItc3BlY2lmaWVkIHRoaWNrbmVzcyBvZiBNQ19CQVIgYW5kCisgICAgICAgICAgICAg ICBNQ19IQkFSIGFzIHRvIGBtYy1yZWFsLWZha2UtY3Vyc29yJy4KKyAgIE1VTFRJUExFX0NVUlNP UlM6ICBXZSBkbyBub3QgdXNlIHRoaXMgZnVuY3Rpb24uCisgICBIT1JJWk9OVEFMX1JVTEVSOiAg V2Ugd2FudCBhIHVuaXZlcnNhbCBGWSBjb29yZGluYXRlIGZvciBhIGxldmVsIHJ1bGVyLgorICAg VkVSVElDQUxfUlVMRVIgYW5kIEZJTExfQ09MVU1OOiAgV2Ugd2FudCBhbiBIIHRoYXQgZW5zdXJl cyBubyBnYXAgYmV0d2VlbiB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHByZXZpb3VzL25leHQgbGluZS4gIFRoZSBGWCBjb29yZGluYXRlIGlzIHNldAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXdoZXJlOiAgYHctPmN1cnNvci54YCAvIGBt Yy5mY194YC4gKi8KK3ZvaWQKK21jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHN0cnVjdCB3aW5kb3cg KncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAg IHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IHgsIGludCAqZngsIGludCB5LAorICAgICAgICAg ICAgICAgICAgICAgICAgaW50ICpmeSwgaW50IGhwb3MsIGludCB2cG9zLCBpb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KmggKz0geSAtIHdfdGV4dF9ib3R0b21feTsKKyAgICAg ICB5ID0gd190ZXh0X2JvdHRvbV95OworICAgICAgIC8vIGZwcmludGYgKHN0ZGVyciwgIkNPTkRJ VElPTiAjIDJcbiIpOworICAgICB9CisgICpmeSA9IFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3 LCB5KTsKKyAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICB7CisgICAgICBjYXNlIE1DX0JBUjoK KyAgICAgICAgeworICAgICAgICAgIGlmIChjdXJzb3Jfd2lkdGggPCAxKQorICAgICAgICAgICAg Y3Vyc29yX3dpZHRoID0gbWF4IChGUkFNRV9DVVJTT1JfV0lEVEggKGYpLCAxKTsKKyAgICAgICAg ICBpZiAoY3Vyc29yX3dpZHRoIDwgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAgICp3ZCA9 IGN1cnNvcl93aWR0aDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBN Q19IQkFSOgorICAgICAgICB7CisgICAgICAgICAgaW50IGN1cnNvcl9oZWlnaHQgPSAoY3Vyc29y X3dpZHRoIDwgMSkgPyBscmludCAoMC4yNSAqICpoKSA6IGN1cnNvcl93aWR0aDsKKyAgICAgICAg ICBpZiAoY3Vyc29yX2hlaWdodCA+IHJvdy0+aGVpZ2h0KQorICAgICAgICAgICAgY3Vyc29yX2hl aWdodCA9IHJvdy0+aGVpZ2h0OworICAgICAgICAgIC8qIEN1cnNvciBzbWFsbGVyIHRoYW4gbGlu ZSBoZWlnaHQsIHNvIG1vdmUgZG93bi4gKi8KKyAgICAgICAgICBpZiAoKmggPiBjdXJzb3JfaGVp Z2h0KQorICAgICAgICAgICAgKmZ5ICs9ICpoIC0gY3Vyc29yX2hlaWdodDsKKyAgICAgICAgICAq aCA9IGN1cnNvcl9oZWlnaHQ7CisgICAgICAgICAgKndkID0gZ2x5cGgtPnBpeGVsX3dpZHRoOwor ICAgICAgICAgIGJy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bnQgZmNfZnggPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCBm Y194KTsKKyAgYm9vbCB6dl9wID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSBy b3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAmJiBNQVRSSVhfUk9XX0VORF9DSEFS UE9TIChyb3cpID09IFpWKTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7 CisgIExpc3BfT2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRzOworICBDSEVDS19CVUZGRVIgKGJ1Zik7 CisgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChidWYpOworICBpbnQgdGV4dF9hcmVhX3dp ZHRoID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgc3RydWN0IGdseXBoX3Jv dyAqY3Vyc29yX3JvdyA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gTUFUUklYX1JPVyAoY3Vyc29yX21hdHJpeCwgdy0+Y3Vyc29yLnZw b3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIHN0cnVjdCBn bHlwaCAqY3Vyc29yX2dseXBoID0gKHctPmN1cnNvci52cG9zICE9IC0xKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgY3Vyc29yX21hdHJp eCwgY3Vyc29yX3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIGJvb2wgY3Vyc29yX2F0X2ZyaW5nZV9wID0g KGN1cnNvcl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1 cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJz b3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSB0ZXh0X2FyZWFfd2lk dGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gY3Vyc29y X3Jvdy0+cGl4ZWxfd2lkdGgpOworICBib29sIGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AgPSAoY3Vy c29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1 cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+ Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiAhY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xp bmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0g dGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5j dXJzb3IueCA+PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7CisgIGludCBmcmFtZV9jaGFyX3dp ZHRoID0gRlJBTUVfQ09MVU1OX1dJRFRIIChmKTsKKyAgaW50IHRlbXBfZmFjZV9pZCA9IGdseXBo LT5mYWNlX2lkOworICBzdHJ1Y3QgbWNfUkdCIGJhY2tncm91bmQ7CisgIG1jX3NldF9sc2xfYmcg KHcsIHRlbXBfZmFjZV9pZCwgJmJhY2tncm91bmQpOworICBib29sIHJlYWxfZmFrZV9jdXJzb3Jf cCA9IChvcG9pbnRfeCA9PSByZWxhdGl2ZV94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIG9wb2ludF9ocG9zID09IGhwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b3BvaW50X3kgPT0gZ2x5cGgtPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3Bv aW50X3Zwb3MgPT0gdnBvcyk7CisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAg ICAgICAgICAgICAgICAgIEJFR0lOOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAg ICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgaWYgKGdseXBoLT50 eXBlID09IENIQVJfR0xZUEgKKyAgICAgIHx8IGdseXBoLT50eXBlID09IEdMWVBITEVTU19HTFlQ SCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAg ICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAl MS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVzXG4iLAorICAgICAgICBnbHlwaCAtIHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8g MCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAo Z2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgPyAnQycKKyAgICAgICAgIDogJ0cn KSwKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2Jq ZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3Qp CisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkK KyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAg ICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+dS5jaCwKKyAgICAgICAg Z2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAg IGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGds eXBoLT5ocG9zLCBnbHlwaC0+dnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAg ICAgbWNfY2hhcl90b19zdHJpbmcgKGdseXBoLT51LmNoKSk7CisgIHN3aXRjaCAoYWN0aW9uX3R5 cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICBNVUxU SVBMRV9DVVJTT1JTOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAg ICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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gYmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgICBhY3RpdmVfcCwgTUNfR0xZUEgsIGRy YXdfcCwgY2FjaGVfdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2ZV94IDw9IHhf bGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAocmVsYXRpdmVfeCA8IHJvdy0+cGl4ZWxf d2lkdGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgt PnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICBmeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7Cisg ICAgICAgICAgICB9CisgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgs IHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAg IHhfbGltaXQgLSByZWxhdGl2ZV94LCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLAorICAg ICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwgYWN0aXZlX3AsIE1DX0dM WVBITEVTUywgZHJhd19wLAorICAgICAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSk7CisgICAg ICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyog ICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZ UEggICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNl IFZFUlRJQ0FMX1JVTEVSOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZv ciA9IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9w CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRl ZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1D X1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklH SFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9i ZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSAxCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoenZfcCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9yID09IE1D X1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBN Q19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9m bGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGdseX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gICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAg ICAgICA6ICh6dl9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAg ICAgICAgICAgICAgICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAg ICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVy dGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF95ID09IHkKKyAg ICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAg ICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOwor ICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJl bGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2Qs IGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisg ICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgY2FjaGVfdHlw ZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgfQor ICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAg RU5EOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICAgICAqLwor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyog ICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgU1RSRVRDSF9HTFlQSCAgICAgICAg ICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgZWxzZSBp ZiAoZ2x5cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJf cCkKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQg JWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNk ICVzICVzXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAg ICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAor ICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnUycsCisgICAgICAgIGdseXBoLT5jaGFycG9z LAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAg ICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAg ICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICA/ICcwJworICAg ICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAg ICAgMHUsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hf bGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgt PngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpW IiA6ICItLSIsCisgICAgICAgICJcXFMiKTsKKyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAgewor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJ UExFX0NVUlNPUlM6ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgTVVMVElQTEVfQ1VSU09SUzoKKyAgICB7Cisg ICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHks IGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1 cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgYWN0 aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGNhY2hlX3R5cGUpO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CA9IChyb3ctPmZpbGxfbGluZV9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ID8gZ2x5cGgtPmZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFD RV9JRDsKKyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGJhY2tncm91bmQ7CisgICAgICAgICAgbWNf c2V0X2xzbF9iZyAodywgdGVtcF9mYWNlX2lkLCAmYmFja2dyb3VuZCk7CisgICAgICAgICAgbWNf aGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBv cywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgIHhfbGltaXQgLSByZWxhdGl2ZV94LCBoLCBj dXJzb3JfdHlwZSwgeF9saW1pdCAtIHJlbGF0aXZlX3gsCisgICAgICAgICAgICAgICAgICAgICBm b3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLCBhY3RpdmVfcCwgTUNfR0xZUEhMRVNTLCBkcmF3X3AsCisg ICAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBlKTsKKyAgICAgICAgfQorICAgICAgYnJlYWs7 CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAg ICAgICAgVkVSVElDQUxfUlVMRVI6ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAgICAgICAgICAg Ki8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6Cisg ICAgeworICAgICAgaWYgKHJvdy0+ZmlsbF9saW5lX3AKKyAgICAgICAgICAmJiBnbHlwaCAtIHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYm IG9wb2ludF94ID4gcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgdGVt cF9mYWNlX2lkID0gZ2x5cGgtPmZhY2VfaWQ7CisgICAgICAgIGVsc2UgaWYgKCFyb3ctPmZpbGxf bGluZV9wCisgICAgICAgICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICYmIG9wb2ludF94ID4g cmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgICB0ZW1wX2ZhY2VfaWQg PSBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICBzdHJ1Y3QgbWNfUkdCIGJhY2tncm91bmQ7CisgICAg ICBtY19zZXRfbHNsX2JnICh3LCB0ZW1wX2ZhY2VfaWQsICZiYWNrZ3JvdW5kKTsKKyAgICAgIGVu dW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xB U0gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmlu Z2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29u dGludWVkX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ct PnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRf b25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSAx CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0 ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBN Q19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogTUNfR0xZUEhMRVNTOworICAgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJT RURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XC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EJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAo U1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6 IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAg ICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgICh1bnNp Z25lZCBpbnQpIGdseXBoLT51LmltZ19pZCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAg ICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGlu ZV9wLAorICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9zLCBnbHlwaC0+dnBv cywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgJy4nKTsKKyAgc3dpdGNoIChh Y3Rpb25fdHlwZSkKKyAgeworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAg ICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgSU1BR0VfR0xZUEggICAgICAgICAgICAg ICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgTVVMVElQTEVf Q1VSU09SUzoKKyAgICB7CisgICAgICBjdXJzb3JfdHlwZSA9IE1DX0hPTExPV19CT1g7CisgICAg ICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRp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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAg ICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVI6ICBJTUFHRV9HTFlQSCAgICAgICAgICAg ICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNB TF9SVUxFUjoKKyAgICB7CisgICAgICBjdXJzb3JfdHlwZSA9IE1DX0hPTExPV19CT1g7CisgICAg ICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5 LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNv cl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgYWN0aXZl X3AsIE1DX0dMWVBILCBkcmF3X3AsIGNhY2hlX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICBG SUxMX0NPTFVNTjogIElNQUdFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgRklMTF9DT0xVTU46CisgICAgeworICAgICAg Y3Vyc29yX3R5cGUgPSBNQ19IT0xMT1dfQk9YOworICAgICAgbWNfaGVscGVyICh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0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpCisgIHsKKyAgICBpZiAo bWNfc3RkZXJyX3ApCisgICAgICB7CisgICAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAg ICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNngiLAorICAgICAg ICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAoKHJvdy0+dXNl ZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgICByZWxh dGl2ZV94LAorICAgICAgICAgICcrJywKKyAgICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAg ICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgPyAnQicKKyAgICAgICAg ICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgPyAnUycKKyAgICAg ICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgICAgPyAnMCcK KyAgICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRo LAorICAgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmNtcC5pZCk7CisgICAgICAgIGZw cmludGYgKHN0ZGVyciwgIiAlNGQgJTEuMWQlMS4xZCIsCisgICAgICAgICAgZ2x5cGgtPmZhY2Vf aWQsCisgICAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgICBnbHlwaC0+ cmlnaHRfYm94X2xpbmVfcCk7CisgICAgICBpZiAoZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykKKyAg ICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICU1ZCAlNGQgICUzZCAgJTNkICVzIC4gWyVkLSVkXVxu IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5o cG9zLCBnbHlwaC0+dnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgICAg ICAgICAgICAgICAgICBnbHlwaC0+c2xpY2UuY21wLmZyb20sIGdseXBoLT5zbGljZS5jbXAudG8p OworICAgICAgICBlbHNlCisgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG4iKTsKKyAgICAg IH0KKyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAgeworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICov CisvKiAgICAgICAgICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUzogIENPTVBPU0lURV9H TFlQSCAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAg IGNhc2UgTVVMVElQTEVfQ1VSU09SUzoKKyAgICB7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJp eCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAg ICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwg YmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3As IGNhY2hlX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t ICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIENPTVBPU0lU RV9HTFlQSCAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLwor ICAgIGNhc2UgSE9SSVpPTlRBTF9SVUxFUjoKKyAgICB7CisgICAgICBpZiAocmVsYXRpdmVfeCA8 PSB4X2xpbWl0CisgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgbWNf aGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBv cywgdnBvcywKKyAgICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93 aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgICBhY3RpdmVf cCwgTUNfR0xZUEgsIGRyYXdfcCwgY2FjaGVfdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSByb3ct PmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiBy ZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICByZWxhdGl2ZV94ICs9 IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICB3aGlsZSAocmVsYXRpdmVfeCA8PSB4X2xp bWl0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwg cm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAg ICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3Jv dW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBNQ19H TFlQSExFU1MsIGRyYXdfcCwgY2FjaGVfdHlwZSk7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3gg Kz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgYnJl YWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAg ICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAgICAg ICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6 CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9m cmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29u dGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVS VElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJ R0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3Jf YmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNl ZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09 IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6ICh6dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJ R0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJ Q0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJU SUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJ Q0FMX0JBUgorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNB TF9CQVIpCisgICAgICAgIGN1cnNvcl90eXBlID0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUDsKKyAg ICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxh dGl2ZV94LCBvcG9pbnRfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3 ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwK KyAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBjYWNoZV90 eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyog ICAgICAgICAgICAgICAgICAgICAgICAgIEZJTExfQ09MVU1OOiAgQ09NUE9TSVRFX0dMWVBIICAg ICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNl IEZJTExfQ09MVU1OOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9 IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQor ICAgICAgICAgICAgICAgICAgICAgICYmIGZjX3ggPiByZWxhdGl2ZV94KQorICAgICAgICAgICAg ICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICh6dl9wKQorICAg ICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICgh TklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQorICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAg ICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQ SExFU1MKKyAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgd2QgPSAxOworICAg ICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZjX2Z4LCB5 LCBmeSwgaHBvcywg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HRVRTCisgICAgZWFzc3VtZSAo ZmFsc2UpOworI2Vsc2UKKyAgICBpZiAobWNfc3RkZXJyX3ApCisgICAgICBmcHJpbnRmIChzdGRl cnIsCisgICAgICAgICJcbiAgJTVkLyUtNWQgJTVkICU0YyAlNmQgJWMgJTNkIDB4JTA1eCAlNGQg JTEuMWQlMS4xZCAlNWQgJTRkICAlM2QgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/ IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAg J1gnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5v YmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVj dCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6ICctJykpLAorICAgICAgICBnbHlw aC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+ bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAg ICAgZ2x5cGgtPnUueHdpZGdldCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+ aHBvcywgZ2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcu Jyk7CisjZW5kaWYKKyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAgeworLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisvKiAgICAgICAg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IGZ4LCB5 LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUs IGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAg ICBhY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgY2FjaGVfdHlwZSk7CisgICAgICBpZiAoZ2x5 cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAg ICAgICAmJiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICByZWxh dGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICB3aGlsZSAocmVsYXRpdmVf eCA8PSB4X2xpbWl0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19oZWxwZXIgKHcs IG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAor ICAgICAgICAgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRo LCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2 ZV9wLCBNQ19HTFlQSExFU1MsIGRyYXdfcCwgY2FjaGVfdHlwZSk7CisgICAgICAgICAgICAgIHJl bGF0aXZlX3ggKz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQor ICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAg ICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVI6ICBYV0lER0VUX0dMWVBIICAgICAgICAg ICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElD QUxfUlVMRVI6CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1 cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3Jp Z2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJP VworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9m cmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29y X3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhU X0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6ICh6dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVS U0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYX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ZWxhdGl2ZV94KQorICAgICAgICAgICAgICAgICAg ICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICh6dl9wKQorICAgICAgICAg ICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICghTklMUCAo QlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAg ICAgICAgICAgICAgICYmIG9wb2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAgICAmJiBv cG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MK KyAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgbWNfaGVscGVyICh3LCBtYXRy aXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAg ICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91 bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3Is IGRyYXdfcCwgY2FjaGVfdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0gKi8KKyAgfQorICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgI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AgICBy ZXR1cm47CisgIGlmICh2cG9zID09IGJvdHRvbV92cG9zKQorICAgIHJldHVybjsKKyAgaWYgKCFy b3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICByZXR1cm47CisgIGludCBocG9zX3N0YXJ0ID0gc3Rh cnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisg ICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZHJhd19yb3cgKCVzKTogIHZwb3MgKCVkKSB8IGhwb3Mg KCVkKSB8IGxlbiAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgbWNfd2luZG93ICh3KSwg dnBvcywgaHBvc19zdGFydCwgaHBvc19sZW5ndGgpOworICBMaXNwX09iamVjdCB3aW5kb3c7Cisg IFhTRVRXSU5ET1cgKHdpbmRvdywgdyk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ ZnJhbWUpOworICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVS IChidWYpOworICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgaW50IG9wb2lu dF9meCwgb3BvaW50X2Z5LCBvcG9pbnRfd2QsIG9wb2ludF9oOworICBpbnQgdGV4dF9hcmVhX3dp ZHRoID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgaW50IGhlYWRlcl9saW5l X2Zvcm1hdCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICBzdHJ1Y3QgZ2x5cGhf cm93ICpjdXJzb3Jfcm93ID0gKHctPmN1cnNvci52cG9zICE9IC0xKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XIChjdXJzb3JfbWF0cml4LCB3LT5jdXJzb3Iu dnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgc3RydWN0 IGdseXBoICpjdXJzb3JfZ2x5cGggPSAody0+Y3Vyc29yLnZwb3MgIT0gLTEpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBjdXJzb3JfbWF0 cml4LCBjdXJzb3Jfcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgYm9vbCBjdXJzb3JfYXRfZnJpbmdlX3Ag PSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg Y3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1 cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT5leGFjdF93aW5kb3dfd2lkdGhfbGluZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IHRleHRfYXJlYV93 aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSBjdXJz b3Jfcm93LT5waXhlbF93aWR0aCk7CisgIGJvb2wgY3Vyc29yX2JleW9uZF9mcmluZ2VfcCA9IChj dXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg Y3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAg ICAgICAgICA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mNhdGVkX29uX3JpZ2h0X3As CisgIC8vICAgIGNnX3AsIGNyX3AsIGNoX2NydSwgY3Jld3dsX3AsIGN4X3Rhd19wLCBjeF9jcnB3 X3ApOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAg IFJFUExBQ0UgVEhFIFJFQUwgQ1VSU09SCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgZW51 bSBmYWNlX2lkIGJnX2ZhY2VfaWQgPSAoY3Vyc29yX2dseXBoICE9IE5VTEwpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBjdXJzb3JfZ2x5cGgtPmZhY2VfaWQKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgc3RydWN0IG1jX1JHQiBjdXJzb3Jf Ymc7CisgIG1jX3NldF9sc2xfYmcgKHcsIGJnX2ZhY2VfaWQsICZjdXJzb3JfYmcpOworICAvKiBG SVhNRTogIFB1dCBpbiBzb21lIGNvZGUgdG8gZGVmYXVsdCB0byBNQ19IT0xMT1dfQk9YIGlmIHRo ZSB1c2VyIGhhcworICB1bndpdHRpbmdseSBjb21lIHVwIHdpdGggc29tZSB1bmFjY2VwdGFibGUg Zm9ybSBvZiB1bnJlY29nbml6ZWQgY3Vyc29yIHR5cGUuICovCisgIExpc3BfT2JqZWN0IGxpc3Bf dHlwZSA9IEJWQVIgKGIsIG1jX3JlYWxfZmFrZV9jdXJzb3IpOworICBlbnVtIHR5cGVfb2ZfY3Vy c29yIGN1cnNvcl90eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gbWNfbGlzcF90b19jdXJzb3JfdHlwZSA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0xZUEgsIG9uZSB2ZXJ0aWNhbCBiYXIsIGFuZCBvbmUgaG9yaXpvbnRh bCBiYXIuICBUaGUKKyAgcHJvYmxlbSB3aXRoIHRoaXMgaXMgdGhhdCB0aGUgbGV0dGVyIGF0IHBv aW50IGdldHMgd3JpdHRlbiB0d2ljZSBhbmQgd2lsbCBiZQorICBqdXN0IGEgbGl0dGxlIHRoaWNr ZXIgdGhhbiBhcyB3b3VsZCBub3JtYWxseSBiZSB0aGUgY2FzZS4gKi8KKyAgYm9vbCBmaWxsX2Nv bHVtbl90cnVtcHNfcCA9ICghTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHctPmN1cnNvci54ID09IGZjX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAh Y3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWN1 cnNvcl9iZXlvbmRfZnJpbmdlX3ApOworICAvKiBGSVhNRTogIERldmlzZSBhIHN5c3RlbSBzbyB0 aGF0IHRoaXMgb25seSBoYXBwZW5zIG9uY2UgcGVyIHJvdyB3aGVuCisgIGBocG9zX2xlbmd0aGAg aXMgbGVzcyB0aGFuIHRoZSBlbnRpcmUgcm93LiAqLworICBpZiAodnBvcyA9PSB3LT5jdXJzb3Iu dnBvcworICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3No YWlycykpCisgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9o b3Jpem9udGFsX3J1bGVyKSkpCisgICAgeworICAgICAgLyogZnJpbmdlIGJpdG1hcHMgdXNlIGZh Y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VIgLS0gYm90aCBoYXZpbmcgYSBjdXJzb3Jfd2lk dGggb2YgMS4gKi8KKyAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93 LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3Ms ICZvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1DX0JBUiwgMSwgJm9w b2ludF93ZCk7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgs IHctPmN1cnNvci54LCBvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICBv cG9pbnRfZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50X3dkLCBvcG9p bnRfaCwKKyAgICAgICAgICAgICAgICAgTUNfQkFSLCAxLCBjdXJzb3JfZmcsIGN1cnNvcl9iZywg YWN0aXZlX3AsIE1DX0dMWVBITEVTUywKKyAgICAgICAgICAgICAgICAgZHJhd19wLCBOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAg ICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0NBQ0hFKTsK KyAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93LCB3LT5jdXJzb3Iu eCwgJm9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsICZvcG9pbnRfaCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1DX0hCQVIsIDEsICZvcG9pbnRfd2QpOwor ICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3Iu eCwgb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgb3BvaW50X2Z5LCB3 LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisgICAg ICAgICAgICAgICAgIE1DX0hCQVIsIDEsIGN1cnNvcl9mZywgY3Vyc29yX2JnLCBhY3RpdmVfcCwg TUNfR0xZUEgsIGRyYXdfcCwKKyAgICAgICAgICAgICAgICAgTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAg ICAgICAgICAgICAgICA6IE1DX0NBQ0hFKTsKKyAgICB9CisgIGVsc2UgaWYgKCFjdXJzb3JfYXRf ZnJpbmdlX3AKKyAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAg JiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+ PSBocG9zX3N0YXJ0CisgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zIDwgaHBvc19zdGFydCAr IGhwb3NfbGVuZ3RoCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+dHlwZSAhPSBTVFJFVENI X0dMWVBIKQorICAgIHsKKyAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwg cm93LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZw b3MsICZvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBl LCBjdXJzb3Jfd2lkdGgsICZvcG9pbnRfd2QpOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgs IHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwK KyAgICAgICAgICAgICAgICAgb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZw b3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBj dXJzb3Jfd2lkdGgsIGN1cnNvcl9mZywgY3Vyc29yX2JnLCBhY3RpdmVfcCwKKyAgICAgICAgICAg ICAgICAgTUNfR0xZUEgsIGRyYXdfcCwgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBDSF9DQUNI RQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0NBQ0hFKTsKKyAgICB9 CisgIGVsc2UgaWYgKCFjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgJiYgY3Vyc29yX2ds eXBoICE9IE5VTEwKKyAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAg ICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICYmIHctPmN1 cnNvci5ocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICYmIGN1cnNv cl9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICAgIHsKKyAgICAgIC8qIElmIGEgdXNl ciBoYXMgc2V0IGB4LXN0cmV0Y2gtY3Vyc29yJyB0byBhIG5vbi1uaWwgdmFsdWUsIGhlL3NoZSBj aG9zZSB0bworICAgICAgaGF2ZSBhIGN1cnNvciB0aGF0IHNwYW5zIHRoZSBlbnRpcmUgbGVuZ3Ro IG9mIHRoZSBTVFJFVENIX0dMWVBILiAqLworICAgICAgaWYgKCF4X3N0cmV0Y2hfY3Vyc29yX3Ap CisgICAgICAgIHsKKyAgICAgICAgICAvKiBUaGUgTUNfSEJBUiBzaGFsbCBoYXZlIGEgYGN1cnNv cl93aWR0aGAgb2YgMS4gKi8KKyAgICAgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBt YXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnksICZvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci52cG9zLCAmb3BvaW50 X2gsIE1DX0hCQVIsIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2lu dF93ZCk7CisgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBo LCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29y LnksIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLAorICAgICAgICAg ICAgICAgICAgICAgb3BvaW50X3dkLCBvcG9pbnRfaCwgTUNfSEJBUiwgMSwgY3Vyc29yX2ZnLCBj dXJzb3JfYmcsCisgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdf cCwKKyAgICAgICAgICAgICAgICAgICAgIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICA/IENIX0NBQ0hFCisgICAgICAgICAg ICAgICAgICAgICA6IE1DX0NBQ0hFKTsKKyAgICAgICAgfQorICAgICAgbWNfZ2V0X2N1cnNvcl9n ZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50X2Z4LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnksICZvcG9pbnRfZnksIHctPmN1cnNv ci5ocG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnZwb3MsICZv cG9pbnRfaCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJz b3Jfd2lkdGgsICZvcG9pbnRfd2QpOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywg Y3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwKKyAgICAg ICAgICAgICAgICAgb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsIG9w b2ludF93ZCwgb3BvaW50X2gsCisgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jf d2lkdGgsIGN1cnNvcl9mZywgY3Vyc29yX2JnLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAg TUNfR0xZUEgsIGRyYXdfcCwgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19j b25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0NBQ0hFKTsKKyAgICB9CisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgRFJBVyBBTkQg UkVDT1JEIEZBS0UgQ1VSU09SUworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIGlmIChocG9z X2xlbmd0aCA9PSAxKQorICAgIHsKKyAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBtY19jb25mKSkpCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUaGUgc3BhY2Ug YXBwZW5kZWQgdG8gYSByb3cgZW5kaW5nIHdpdGggYSBuZXcgbGluZQorICAgICAgICAgIGRvZXMg bm90IGhhdmUgYSBgZ2x5cGgtPmNoYXJwb3NgICgtMSwgMCkgdGhhdCB3ZSBjYW4KKyAgICAgICAg ICB1c2UgZm9yIHRoaXMgcGFydGljdWxhciBhcHBsaWNhdGlvbi4gIFdoZW4gdGhlcmUgaXMgYQor ICAgICAgICAgIGBidWZmZXItZGlzcGxheS10YWJsZScgZW50cnkgdGhhdCBhc3NpZ25zIGEgdmlz aWJsZQorICAgICAgICAgIGdseXBoIHRvIGEgbmV3IGxpbmUsIHRoZXJlIGlzIG5vIHByb2JsZW0g YmVjYXVzZSB0aGF0CisgICAgICAgICAgZ2x5cGggaGFzIGEgYGdseXBoLT5jaGFycG9zJyB0aGF0 IHdlIGNhbiB1c2UuICBXaGVuCisgICAgICAgICAgbm8gdmlzaWJsZSBFT0wgZ2x5cGggZXhpc3Rz LCB3ZSB1c2UgdGhlIGZvbGxvd2luZworICAgICAgICAgIHRlc3Q6ICB0aGUgYXBwZW5kZWQgc3Bh Y2UgaGFzIGEgcG9zaXRpb24gdGhhdCBpcyBvbmUKKyAgICAgICAgICBsZXNzIHRoYW4gdGhlIGVu ZCBvZiB0aGUgbWF0cml4IHJvdy4gKi8KKyAgICAgICAgICBpbnQgaHBvcyA9IHN0YXJ0IC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnByZXZpb3VzX2ds eXBoID0gKDAgPD0gaHBvcyAtIDEgJiYgaHBvcyAtIDEgPCByb3ctPnVzZWRbVEVYVF9BUkVBXSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyByb3ctPmdseXBoc1tU RVhUX0FSRUFdICsgaHBvcyAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBOVUxMOworICAgICAgICAgIGJvb2wgc2tpcF9wID0gKHByZXZpb3VzX2dseXBoICE9 IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hhcnBv cyA9PSBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpIC0gMSk7CisgICAgICAgICAgaW50IHBv c2ludCA9IChzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRf QVJFQV0gLSAxKQorICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1dfRU5EX0NIQVJQ T1MgKHJvdykgLSAxCisgICAgICAgICAgICAgICAgICAgICAgIDogc3RhcnQtPmNoYXJwb3M7Cisg ICAgICAgICAgTGlzcF9PYmplY3Qgc3BlY3MgPSBtY19hc3NvYyAobWFrZV9maXhudW0gKHBvc2lu dCksIEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpOworICAgICAgICAgIGlm ICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICB8 fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgJiYgIU5JTFAgKHNwZWNz KQorICAgICAgICAgICAgICAmJiBzdGFydC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykK KyAgICAgICAgICAgICAgJiYgIXNraXBfcAorICAgICAgICAgICAgICAmJiAhc3RhcnQtPnp2X3Ap CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGxpc3BfdHlwZSA9IG1j X250aCAoMSwgc3BlY3MpOworICAgICAgICAgICAgICBlbnVtIHR5cGVfb2ZfY3Vyc29yIGN1cnNv cl90eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChsaXNw X3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOworICAgICAgICAgICAgICBjdXJz b3JfdHlwZSA9IChzdGFydC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IE1DX0hPTExPV19CT1gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IGN1cnNvcl90eXBlOworICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoID0gKENPTlNQIChs aXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBYRklYTlVNIChY Q0FSIChYQ0RSIChsaXNwX3R5cGUpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogLTE7CisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IG1jX2ZvcmVncm91bmQgPSBtY19udGgg KDIsIHNwZWNzKTsKKyAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBmb3JlZ3JvdW5kOworICAg ICAgICAgICAgICBpZiAoU1RSSU5HUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAg bWNfeHdfY29sb3JfdmFsdWVzICh3LCBtY19mb3JlZ3JvdW5kLCAmZm9yZWdyb3VuZCk7CisgICAg ICAgICAgICAgICAgZWxzZSBpZiAoVkVDVE9SUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGRvdWJsZSByZWRfZmcgPSBYRkxPQVRfREFU QSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMCkpOworICAgICAgICAgICAgICAgICAgICBkb3VibGUg Z3JlZW5fZmcgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMSkpOworICAgICAg ICAgICAgICAgICAgICBkb3VibGUgYmx1ZV9mZyA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3Jl Z3JvdW5kLCAyKSk7CisgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQucmVkID0gcmVkX2Zn OworICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLmdyZWVuID0gZ3JlZW5fZmc7CisgICAg ICAgICAgICAgICAgICAgIGZvcmVncm91bmQuYmx1ZSA9IGJsdWVfZmc7CisgICAgICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChOSUxQIChtY19mb3JlZ3JvdW5kKSkK KyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQu cmVkID0gY2hfZm9yZWdyb3VuZC5yZWQ7CisgICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3Vu ZC5ncmVlbiA9IGNoX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAgICAgICAgICAgICAgZm9y ZWdyb3VuZC5ibHVlID0gY2hfZm9yZWdyb3VuZC5ibHVlOworICAgICAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7 CisgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9B UkVBKTsKKyAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRF WFRfQVJFQSwgeCwgeF9saW1pdCwgcm93LT55LAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0 YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwgdnBvcywgY3Vyc29yX3R5cGUsCisgICAgICAg ICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCBjdXJzb3JfbWF0cml4LCBmY194LCBmb3Jl Z3JvdW5kLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJT T1JTLCBkcmF3X3AsIE1DX0NBQ0hFKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAg aWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAg ICAgICAgICYmIGZjX3ggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgJiYgZmNfeCA+PSB3 LT5tYy5sbnVtX3BpeGVsX3dpZHRoKQorICAgICAgICB7CisgICAgICAgICAgaW50IHhfbGltaXQg PSB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoOworICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNv cl9wID0gKHctPmN1cnNvci54ID09IGZjX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5jdXJzb3IueSA9PSBzdGFydC0+eQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IHN0YXJ0IC0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1 cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgIGlmICh4ICsgc3RhcnQtPnBpeGVsX3dpZHRo IDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1h dCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3Jt YXQgPT0gMCkKKyAgICAgICAgICAgICAgJiYgKChmY194ID49IHgKKyAgICAgICAgICAgICAgICAg ICAmJiBmY194IDwgeCArIHN0YXJ0LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgIHx8 IHN0YXJ0ID09IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAt IDEpCisgICAgICAgICAgICAgICYmIHN0YXJ0LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3 KQorICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgbWNf ZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwgcm93 LT55LAorICAgICAgICAgICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0sIHZwb3MsIE1DX0JBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJp eCwgZmNfeCwgZmNfZm9yZWdyb3VuZCwgYWN0aXZlX3AsIEZJTExfQ09MVU1OLAorICAgICAgICAg ICAgICAgICAgICAgICBkcmF3X3AsIEZDX0NBQ0hFKTsKKyAgICAgICAgfQorICAgICAgaWYgKCFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAg ICYmICFOSUxQIChCVkFSIChiLCBjaF9ob3Jpem9udGFsX3J1bGVyKSkKKyAgICAgICAgICAmJiB2 cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICB7CisgICAgICAgICAgaW50IHhfbGltaXQg PSAoc3RhcnQgPT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFd IC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgID8gdGV4dF9hcmVhX3dpZHRoCisgICAgICAg ICAgICAgICAgICAgICAgICA6IHggKyBzdGFydC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgLyog UHJlc2VydmUgc3VwcG9ydCBmb3IgZGVmYXVsdCBiZWhhdmlvciBzdWNoIHRoYXQgYSB1c2VyIG1h eQorICAgICAgICAgIHNwZWNpZnkgdGhlIGhlaWdodCBvZiBhbiBNQ19IQkFSLCB3aGljaCBiZWdp bnMgaXRzIGpvdXJuZXkKKyAgICAgICAgICBhcyB0aGUgYGN1cnNvcl93aWR0aCcuICBgbWNfZ2V0 X2N1cnNvcl9nZW9tZXRyeScgcmVhZGp1c3RzLiAqLworICAgICAgICAgIG1jX2VuZ2luZSAodywg bWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAg ICAgICAgICAgICAgICAgIHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwgdnBvcywgTUNf SEJBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGZjX3gsIGNoX2Zv cmVncm91bmQsIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxF UiwgZHJhd19wLCBDSF9DQUNIRSk7CisgICAgICAgIH0KKyAgICAgIGlmICghTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAmJiAhTklMUCAo QlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICYmICFmaWxsX2NvbHVtbl90 cnVtcHNfcCkKKyAgICAgICAgeworICAgICAgICAgIGN1cnNvcl90eXBlID0gKHN0YXJ0LT50eXBl ID09IElNQUdFX0dMWVBIKQorICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19IT0xMT1dfQk9Y CisgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0JBUjsKKyAgICAgICAgICBpbnQgeF9saW1p dCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgYm9vbCByZWFs X2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnkgPT0gc3RhcnQtPnkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsKKyAgICAg ICAgICBpZiAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAg ICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICYmICgody0+ Y3Vyc29yLnggPj0geAorICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54IDwgeCArIHN0 YXJ0LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgIHx8IHN0YXJ0ID09IHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpCisgICAgICAgICAgICAg ICYmIHN0YXJ0LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAm JiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgs IHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwgcm93LT55LAorICAgICAgICAgICAg ICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3MsIGN1cnNvcl90 eXBlLCAxLAorICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBmY194LCBjaF9m b3JlZ3JvdW5kLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVM RVIsIGRyYXdfcCwgQ0hfQ0FDSEUpOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICAg IHsKKyAgICAgICAgaW50IHJlbGF0aXZlX3ggPSAwOworICAgICAgICBmb3IgKGludCBhcmVhID0g TEVGVF9NQVJHSU5fQVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAgICAgIHsK KyAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBoc1thcmVhXTsKKyAg ICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGhfZW5kID0gZ2x5cGggKyByb3ctPnVzZWRbYXJl YV07CisgICAgICAgICAgICAvKiBHbHlwaCBmb3IgYSBsaW5lIGVuZCBpbiB0ZXh0LiAqLworICAg ICAgICAgICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYmIGdseXBoID09IGdseXBoX2VuZCAmJiBn bHlwaC0+Y2hhcnBvcyA+IDApCisgICAgICAgICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgICAg ICAgZm9yICg7IGdseXBoIDwgZ2x5cGhfZW5kOyArK2dseXBoKQorICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgaWYgKHZwb3MgIT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgICAg ICAgICAgJiYgZ2x5cGggIT0gZ2x5cGhfZW5kIC0gMQorICAgICAgICAgICAgICAgICAgICAmJiBm Y194IDwgcmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHJl bGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBtY19jb25mKSkpCisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAg ICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikp KQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBUaGUgc3BhY2Ug YXBwZW5kZWQgdG8gYSByb3cgZW5kaW5nIHdpdGggYSBuZXcgbGluZSBkb2VzCisgICAgICAgICAg ICAgICAgICAgIG5vdCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDApIHRoYXQgd2UgY2Fu IHVzZSBmb3IgdGhpcworICAgICAgICAgICAgICAgICAgICBwYXJ0aWN1bGFyIGFwcGxpY2F0aW9u LiAgV2hlbiBhIGBidWZmZXItZGlzcGxheS10YWJsZScgZW50cnkKKyAgICAgICAgICAgICAgICAg ICAgYXNzaWducyBhIHZpc2libGUgZ2x5cGggdG8gYSBuZXcgbGluZSwgdGhlcmUgaXMgbm8gcHJv YmxlbQorICAgICAgICAgICAgICAgICAgICBiZWNhdXNlIHRoYXQgZ2x5cGggaGFzIGEgYGdseXBo LT5jaGFycG9zJyB0aGF0IHdlIGNhbiB1c2UuCisgICAgICAgICAgICAgICAgICAgIFdoZW4gbm8g dmlzaWJsZSBFT0wgZ2x5cGggZXhpc3RzLCB3ZSB1c2UgdGhlIGZvbGxvd2luZyB0ZXN0OgorICAg ICAgICAgICAgICAgICAgICB0aGUgYXBwZW5kZWQgc3BhY2UgaGFzIGEgcG9zaXRpb24gdGhhdCBp cyBvbmUgbGVzcyB0aGFuIHRoZQorICAgICAgICAgICAgICAgICAgICBlbmQgb2YgdGhlIG1hdHJp eCByb3cuICovCisgICAgICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmds eXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnByZXZp b3VzX2dseXBoID0gKDAgPD0gaHBvcyAtIDEgJiYgaHBvcyAtIDEgPCByb3ctPnVzZWRbVEVYVF9B UkVBXSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgICAgICAgICAgICAgICAg ICAgIGJvb2wgc2tpcF9wID0gKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgcHJldmlvdXNfZ2x5cGgtPmNoYXJwb3MgPT0gTUFUUklY X1JPV19FTkRfQ0hBUlBPUyAocm93KSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBXaGVu IGEgYGJ1ZmZlci1kaXNwbGF5LXRhYmxlJyBlbnRyeSBjb250YWlucworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGEgdmlzaWJsZSB0YWIgY2hhcmFjdGVyICgiwrsiKSwgdGhlIHN1 YnNlcXVlbnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTVFJFVENIX0dMWVBI IHdpbGwgaGF2ZSB0aGUgc2FtZSBnbHlwaC0+Y2hhcnBvcworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGFzIHRoZSBhZm9yZW1lbnRpb25lZCB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIu ICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAocHJldmlvdXNfZ2x5cGgg IT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHByZXZpb3Vz X2dseXBoLT5jaGFycG9zID09IGdseXBoLT5jaGFycG9zKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgaW50IHBvc2ludCA9IChnbHlwaCAtIHJvdy0+ Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSAtIDEKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogZ2x5cGgtPmNoYXJwb3M7CisgICAgICAg ICAgICAgICAgICAgIExpc3BfT2JqZWN0IHNwZWNzID0gbWNfYXNzb2MgKG1ha2VfZml4bnVtIChw b3NpbnQpLCBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKTsKKyAgICAgICAg ICAgICAgICAgICAgaWYgKCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChzcGVjcykKKyAgICAgICAgICAgICAgICAgICAg ICAgICYmIGdseXBoLT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAg ICAgICAgICAgICAgJiYgIXNraXBfcAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWdseXBo LT56dl9wKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAg IExpc3BfT2JqZWN0IGxpc3BfdHlwZSA9IG1jX250aCAoMSwgc3BlY3MpOworICAgICAgICAgICAg ICAgICAgICAgICAgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3JfdHlwZSA9IChDT05TUCAobGlz cF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxpc3BfdHlwZSkpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOworICAgICAgICAgICAgICAgICAg ICAgICAgY3Vyc29yX3R5cGUgPSAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX0JPWAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGN1cnNvcl90eXBlOworICAgICAgICAgICAg ICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFhGSVhOVU0gKFhDQVIgKFhD RFIgKGxpc3BfdHlwZSkpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogLTE7CisgICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBtY19mb3JlZ3Jv dW5kID0gbWNfbnRoICgyLCBzcGVjcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qg bWNfUkdCIGZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoU1RSSU5HUCAo bWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX3h3X2NvbG9yX3Zh bHVlcyAodywgbWNfZm9yZWdyb3VuZCwgJmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAg ICAgICAgICBlbHNlIGlmIChWRUNUT1JQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3VibGUgcmVk X2ZnID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDApKTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGRvdWJsZSBncmVlbl9mZyA9IFhGTE9BVF9EQVRBIChBUkVGICht Y19mb3JlZ3JvdW5kLCAxKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3VibGUg Ymx1ZV9mZyA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAyKSk7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLnJlZCA9IHJlZF9mZzsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQuZ3JlZW4gPSBncmVlbl9mZzsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQuYmx1ZSA9IGJsdWVfZmc7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVs c2UgaWYgKE5JTFAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQucmVkID0gY2hfZm9y ZWdyb3VuZC5yZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLmdy ZWVuID0gY2hfZm9yZWdyb3VuZC5ncmVlbjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGZvcmVncm91bmQuYmx1ZSA9IGNoX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9S T1dfVlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAgICAgICAgICAgICAgICAgaW50IHhfbGlt aXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAgICAgICAgICAgICAgICAg ICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZlX3gs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHhfbGltaXQsIHJvdy0+eSwgZ2x5 cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBjdXJzb3JfbWF0cml4LAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmY194LCBmb3JlZ3JvdW5kLCBhY3Rp dmVfcCwgTVVMVElQTEVfQ1VSU09SUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZHJhd19wLCBNQ19DQUNIRSk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgZmNfeCA8PSB0 ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgJiYgZmNfeCA+PSB3LT5tYy5sbnVt X3BpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBp bnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAg ICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci54ID09IGZjX3gK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnkgPT0gZ2x5cGgtPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct PmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGds eXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGhw b3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGhwb3Nf c3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgcmVsYXRpdmVf eCArIGdseXBoLT5waXhlbF93aWR0aCA8PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAg ICAgICAgICAgICYmICgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICYmICgoZ2x5cGggIT0gZ2x5cGhfZW5kIC0gMQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBmY194ID49IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgZmNfeCA8IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGdseXBoID09IGdseXBoX2VuZCAtIDEK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZmNfeCA+PSByZWxhdGl2ZV94KSkK KyAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT55IDw9IHdpbmRvd190ZXh0X2JvdHRv bV95ICh3KQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkK KyAgICAgICAgICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwg YXJlYSwgcmVsYXRpdmVfeCwgeF9saW1pdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHJvdy0+eSwgaHBvcywgdnBvcywgTUNfQkFSLCAxLCBjdXJzb3JfbWF0cml4LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgZmNfeCwgZmNfZm9yZWdyb3VuZCwgYWN0aXZlX3As IEZJTExfQ09MVU1OLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd19wLCBG Q19DQUNIRSk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKCFOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaG9yaXpvbnRhbF9ydWxlcikpCisgICAgICAg ICAgICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAo dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IGhwb3MgPSBnbHlwaCAtIHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgICAgICAgICAgIC8qIFByZXNlcnZlIHN1 cHBvcnQgZm9yIGRlZmF1bHQgYmVoYXZpb3Igc3VjaCB0aGF0IGEgdXNlciBtYXkKKyAgICAgICAg ICAgICAgICAgICAgc3BlY2lmeSB0aGUgaGVpZ2h0IG9mIGFuIE1DX0hCQVIsIHdoaWNoIGJlZ2lu cyBpdHMgam91cm5leQorICAgICAgICAgICAgICAgICAgICBhcyB0aGUgYGN1cnNvcl93aWR0aCcu ICBgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeScgcmVhZGp1c3RzLiAqLworICAgICAgICAgICAgICAg ICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBo cG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoKQorICAgICAgICAgICAgICAgICAgICAgIG1j X2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBN Q19IQkFSLCAxLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZmNfeCwgY2hfZm9yZWdyb3VuZCwgYWN0aXZlX3AsIEhPUklaT05UQUxfUlVMRVIsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3AsIENIX0NBQ0hFKTsKKyAgICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChC VkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICYmICFmaWxs X2NvbHVtbl90cnVtcHNfcCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg ICAgY3Vyc29yX3R5cGUgPSAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBNQ19CQVI7CisgICAgICAgICAgICAgICAgICAgIGludCB4X2xp bWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAg ICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnkgPT0gZ2x5cGgtPnkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29y LnZwb3MgPT0gdnBvcyk7CisgICAgICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBo cG9zX3N0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFydCAr IGhwb3NfbGVuZ3RoCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGhlYWRlcl9saW5lX2Zv cm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgaGVh ZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGdseXBo ICE9IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnggPj0gcmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5j dXJzb3IueCA8IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgfHwgKGdseXBoID09IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gcmVsYXRpdmVfeCkpCisgICAgICAg ICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykK KyAgICAgICAgICAgICAgICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAg ICAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIGFyZWEsIHJl bGF0aXZlX3gsIHhfbGltaXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3ct PnksIGhwb3MsIHZwb3MsIGN1cnNvcl90eXBlLCAxLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgZmNfeCwgY2hfZm9yZWdyb3VuZCwgYWN0aXZlX3AsIFZF UlRJQ0FMX1JVTEVSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd19wLCBD SF9DQUNIRSk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmVsYXRpdmVf eCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICB9Cisg ICAgICB9CisgIC8vICBjbG9ja190IGNsb2NrX2VuZCA9IGNsb2NrKCk7CisgIC8vICBkb3VibGUg Y3B1X3RpbWVfdXNlZCA9ICgoZG91YmxlKSAoY2xvY2tfZW5kIC0gY2xvY2tfc3RhcnQpKSAvIENM T0NLU19QRVJfU0VDOworICAvLyAgZnByaW50ZiAoc3RkZXJyLCAibWNfZHJhd19yb3cgKCVzKTog IFRJTUUgKCVmKVxuIiwgbWNfd2luZG93ICh3KSwgY3B1X3RpbWVfdXNlZCk7Cit9CisKK3ZvaWQK K21jX3JlZHJhd19oZWxwZXIgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXgg Km1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICAgZW51bSB0 eXBlX29mX2NhY2hlIGNhY2hlX3R5cGUsIGludCBzdGFydF9ocG9zLCBpbnQgZW5kX2hwb3MpCit7 CisgIGludCByb3dfdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICBzdHJ1 Y3QgbXVsdGlwbGVfY3Vyc29yc19jYWNoZSBmb29fZWx0czsKKyAgc3dpdGNoIChjYWNoZV90eXBl KQorICAgIHsKKyAgICAgIGNhc2UgTk9fQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBicmVh azsKKyAgICAgICAgfQorICAgICAgY2FzZSBNQ19DQUNIRToKKyAgICAgICAgeworICAgICAgICAg IGZvb19lbHRzLmNhY2hlcyA9IHctPm1jX2VsdHMuY2FjaGVzOworICAgICAgICAgIGZvb19lbHRz LmFsbG9jYXRlZCA9IHctPm1jX2VsdHMuYWxsb2NhdGVkOworICAgICAgICAgIGZvb19lbHRzLnVz ZWQgPSB3LT5tY19lbHRzLnVzZWQ7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAg IGNhc2UgQ0hfQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBmb29fZWx0cy5jYWNoZXMgPSB3 LT5jaF9lbHRzLmNhY2hlczsKKyAgICAgICAgICBmb29fZWx0cy5hbGxvY2F0ZWQgPSB3LT5jaF9l bHRzLmFsbG9jYXRlZDsKKyAgICAgICAgICBmb29fZWx0cy51c2VkID0gdy0+Y2hfZWx0cy51c2Vk OworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIEZDX0NBQ0hFOgorICAg ICAgICB7CisgICAgICAgICAgZm9vX2VsdHMuY2FjaGVzID0gdy0+ZmNfZWx0cy5jYWNoZXM7Cisg ICAgICAgICAgZm9vX2VsdHMuYWxsb2NhdGVkID0gdy0+ZmNfZWx0cy5hbGxvY2F0ZWQ7CisgICAg ICAgICAgZm9vX2VsdHMudXNlZCA9IHctPmZjX2VsdHMudXNlZDsKKyAgICAgICAgICBicmVhazsK KyAgICAgICAgfQorICAgIH0KKyAgLyogU1RSRVRDSF9HTFlQSCBtYXkgY29udGFpbiBtb3JlIHRo YW4gb25lIGZha2UgY3Vyc29yIGF0IHRoZSBzYW1lIEhQT1MuICovCisgIGZvciAoaW50IGVsdCA9 IDA7IGVsdCA8IGZvb19lbHRzLnVzZWQ7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Zm9v X2VsdHMuY2FjaGVzW2VsdF0uYmFja2dyb3VuZC5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIC5ibHVlID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0uYmFja2dyb3VuZC5ibHVlfTsK KyAgICAgIGJvb2wgYWN0aXZlX3AgPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5hY3RpdmVfcDsKKyAg ICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLmds eXBoX2ZsYXZvcjsKKyAgICAgIGJvb2wgZW5hYmxlZF9wID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0u ZW5hYmxlZF9wOworICAgICAgaWYgKHZwb3MgPT0gcm93X3Zwb3MKKyAgICAgICAgICAmJiAoKGhw b3MgPj0gc3RhcnRfaHBvcworICAgICAgICAgICAgICAgJiYgaHBvcyA8IGVuZF9ocG9zKQorICAg ICAgICAgICAgICAvKiBBIGZsb2F0aW5nIGN1cnNvciBiZXlvbmQgdGhlIGVuZCBvZiB0aGUgZ2x5 cGggcm93LiAqLworICAgICAgICAgICAgICB8fCAoaHBvcyArIDEgPT0gc3RhcnRfaHBvcworICAg ICAgICAgICAgICAgICAgJiYgaHBvcyArIDEgPT0gZW5kX2hwb3MpKQorICAgICAgICAgICYmIGVu YWJsZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGJvb2wgcmVtb3ZlX3AgPSBmYWxzZTsKKyAg ICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBm eSwgaHBvcywgdnBvcywgd2QsIGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1 cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGxzbF9mZywgYWN0aXZlX3AsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgcmVtb3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Vj dCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3Jv dyAqcm93LAorICAgICAgICAgICAgICAgICBlbnVtIHR5cGVfb2ZfY2FjaGUgY2FjaGVfdHlwZSkK K3sKKyAgaW50IHJvd192cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgIGlm ICh0cmFjZV9yZWRpc3BsYXlfcCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9oZWxw ZXIgKCVzKTogIGNhY2hlICglcykgfCB2cG9zICglZClcbiIsCisgICAgICBtY193aW5kb3cgKHcp LCBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAoY2FjaGVfdHlwZSksIHJvd192cG9zKTsKKyAgc3Ry dWN0IG11bHRpcGxlX2N1cnNvcnNfY2FjaGUgZm9vX2VsdHM7CisgIHN3aXRjaCAoY2FjaGVfdHlw ZSkKKyAgICB7CisgICAgICBjYXNlIE5PX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgYnJl YWs7CisgICAgICAgIH0KKyAgICAgIGNhc2UgTUNfQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAg ICBmb29fZWx0cy5jYWNoZXMgPSB3LT5tY19lbHRzLmNhY2hlczsKKyAgICAgICAgICBmb29fZWx0 cy5hbGxvY2F0ZWQgPSB3LT5tY19lbHRzLmFsbG9jYXRlZDsKKyAgICAgICAgICBmb29fZWx0cy51 c2VkID0gdy0+bWNfZWx0cy51c2VkOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAg ICBjYXNlIENIX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgZm9vX2VsdHMuY2FjaGVzID0g dy0+Y2hfZWx0cy5jYWNoZXM7CisgICAgICAgICAgZm9vX2VsdHMuYWxsb2NhdGVkID0gdy0+Y2hf ZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgZm9vX2VsdHMudXNlZCA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HNlIDogdHJ1ZTsKKyAgICAg IGlmIChiYXJmX2NyYXNoX29uZSkKKyAgICAgICAgY29udGludWU7CisgICAgICBib29sIGJhcmZf Y3Jhc2hfdHdvID0gKHZwb3MgPj0gMCAmJiB2cG9zIDwgbWF0cml4LT5ucm93cykgPyBmYWxzZSA6 IHRydWU7CisgICAgICBpZiAoYmFyZl9jcmFzaF90d28pCisgICAgICAgIGNvbnRpbnVlOworICAg ICAgaWYgKHZwb3MgPT0gcm93X3Zwb3MKKyAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNf R0xZUEgKKyAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBtY19l cmFzZV9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCB5LCBocG9zLCB2cG9zLCBnbHlwaF9mbGF2 b3IsIGN1cnNvcl90eXBlLCB3ZCk7CisgICAgICAgICAgZm9vX2VsdHMuY2FjaGVzW2VsdF0uZW5h YmxlZF9wID0gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAodnBvcyA9PSByb3df dnBvcworICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgeworICAgICAg ICAgICAgYm9vbCByZW1vdmVfcCA9IHRydWU7CisgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5 YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0 aCwgbHNsX2JnLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBn bHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAgICAgICAgIGZvb19lbHRzLmNhY2hlc1tlbHRd LmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICAgIH0KKyAgICB9C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BidWYgPSB3LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYpOwor ICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgc3RydWN0IGJ1ZmZlciAqb2xk X2J1ZmZlciA9IE5VTEw7CisgIHB0cmRpZmZfdCBvcG9pbnQgPSAodyA9PSBYV0lORE9XIChzZWxl Y3RlZF93aW5kb3cpKQorICAgICAgICAgICAgICAgICAgICAgPyBQVAorICAgICAgICAgICAgICAg ICAgICAgOiBYRklYTlVNIChGbWFya2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pKTsKKyAgcHRyZGlm Zl90IGZjX2N1cnJlbnRfY29sID0gbWNfY3VycmVudF9jb2x1bW4gKHcsIG9wb2ludCk7CisgIGlu dCBmcmFtZV9jaGFyX3dpZHRoID0gRlJBTUVfQ09MVU1OX1dJRFRIIChmKTsKKyAgYm9vbCBmaWxs X2NvbHVtbl9wID0gIU5JTFAgKEJWQVIgKGIsIGZpbGxfY29sdW1uKSk7CisgIGludCBmaWxsX2Nv bCA9IFhGSVhOVU0gKEJWQVIgKGIsIGZpbGxfY29sdW1uKSk7CisgIGludCBoc2NsX3ggPSB3LT5o c2Nyb2xsICogZnJhbWVfY2hhcl93aWR0aDsKKyAgaWYgKGIgIT0gY3VycmVudF9idWZmZXIpCisg ICAgeworICAgICAgb2xkX2J1ZmZlciA9IGN1cnJlbnRfYnVmZmVyOworICAgICAgc2V0X2J1ZmZl cl9pbnRlcm5hbCAoYik7CisgICAgfQorICAqZmNfeCA9IChmaWxsX2NvbHVtbl9wCisgICAgICAg ICAgICYmICFOSUxQIChWZGlzcGxheV9saW5lX251bWJlcnMpKQorICAgICAgICAgICAgPyAoZmls bF9jb2wgKiBmcmFtZV9jaGFyX3dpZHRoKSArIHctPm1jLmxudW1fcGl4ZWxfd2lkdGggLSBoc2Ns X3gKKyAgICAgICAgICA6IChmaWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgJiYgTklMU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SkpCisgICAgICAgICAgICAgICAg ICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkp OworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJh c2VfcHJlX3Njcm9sbF9kaXNwbGF5ICglcyk6ICBnb19vbmVfcCAoJXMpIHwgZ29fdHdvX3AgKCVz KVxuIiwKKyAgICAgICAgICAgICAgICAgICAgIG1jX3dpbmRvdyAodyksIGdvX29uZV9wID8gInll cyIgOiAibm8iLCBnb190d29fcCA/ICJ5ZXMiIDogIm5vIik7CisgIGlmICghZ29fb25lX3AgJiYg IWdvX3R3b19wKQorICAgIHJldHVybjsKKyAgYm9vbCB1cGRhdGluZ19mcmFtZV9wID0gZmFsc2U7 CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBpZiAoWEZSQU1FICh3 LT5mcmFtZSkgIT0gZi0+bWNfdXBkYXRpbmdfZnJhbWUKKyAgICAgICYmIChnb19vbmVfcCB8fCBn b190d29fcCkpCisgICAgeworICAgICAgdXBkYXRpbmdfZnJhbWVfcCA9IHRydWU7CisgICAgICB1 cGRhdGVfYmVnaW4gKGYpOworICAgIH0KKyAgaWYgKHctPnBoeXNfY3Vyc29yX29uX3AKKyAgICAg ICYmIGdvX3R3b19wKQorICAgIGVyYXNlX3BoeXNfY3Vyc29yICh3KTsKKyAgc3RydWN0IGdseXBo X21hdHJpeCAqY3VycmVudF9tYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgZm9yIChpbnQg dnBvcyA9IDA7CisgICAgICAgdnBvcyA8IGN1cnJlbnRfbWF0cml4LT5ucm93cworICAgICAgICYm IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCB2cG9zKS0+ZW5hYmxlZF9wCisgICAgICAgJiYg Z29fb25lX3A7CisgICAgICAgKyt2cG9zKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cg KnJvdyA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAgICAgIG1jX2VyYXNl X3JvdyAodywgY3VycmVudF9tYXRyaXgsIHJvdyk7CisgICAgfQorICBpZiAodXBkYXRpbmdfZnJh bWVfcCkKKyAgICB1cGRhdGVfZW5kIChmKTsKKyAgbWNfcmVzZXRfY2FjaGUgKHcsIE1DX0NBQ0hF KTsKKyAgbWNfcmVzZXRfY2FjaGUgKHcsIENIX0NBQ0hFKTsKKyAgbWNfcmVzZXRfY2FjaGUgKHcs IEZDX0NBQ0hFKTsKK30KKworREVGVU4gKCJtYy1zdGRlcnIiLCBGbWNfc3RkZXJyLCBTbWNfc3Rk ZXJyLCAwLCAxLCAiUCIsCisgICAgICAgZG9jOiAvKiBUb2dnbGUgdHJhY2luZyBvZiBtdWx0aXBs ZSBmYWtlIGN1cnNvcnMuCitXaXRoIEFSRywgdHVybiB0cmFjaW5nIG9uIGlmIGFuZCBvbmx5IGlm IEFSRyBpcyBwb3NpdGl2ZS4gKi8pCisgIChMaXNwX09iamVjdCBhcmcpCit7CisgIGlmIChOSUxQ IChhcmcpKQorICAgIG1jX3N0ZGVycl9wID0gIW1jX3N0ZGVycl9wOworICBlbHNlCisgICAgewor ICAgICAgYXJnID0gRnByZWZpeF9udW1lcmljX3ZhbHVlIChhcmcpOworICAgICAgbWNfc3RkZXJy X3AgPSBYRklYTlVNIChhcmcpID4gMDsKKyAgICB9CisgIHJldHVybiBRbmlsOworfQorCisvKiBl bmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogDAog LyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqCiAJCSAgICAgIFdpbmR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v cyA8PSBaVikpCisgICAgICAgICAgICAgICAgICAgICAgICA/IGZhbHNlCisgICAgICAgICAgICAg ICAgICAgICAgICA6IHRydWU7CisgIGlmIChiYXJmX2NyYXNoX29uZSkKKyAgICByZXR1cm4gaHNj cm9sbGVkX3A7CisKKyAgLyogYHJlc2VhdF8xJzogIENIQVJQT1MgKHBvcykgPj0gQkVHViAmJiBD SEFSUE9TIChwb3MpIDw9IFpWICovCisgIGJvb2wgYmFyZl9jcmFzaF90d28gPSAoY2hhcnBvcyA+ PSBCRUdWICYmIGNoYXJwb3MgPD0gWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBmYWxz ZQorICAgICAgICAgICAgICAgICAgICAgICAgIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2hfdHdv KQorICAgIHJldHVybiBoc2Nyb2xsZWRfcDsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8K Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgICAvKiBNb3ZlIGl0ZXJhdG9yIHRv IHB0IHN0YXJ0aW5nIGF0IGN1cnNvcl9yb3ctPnN0YXJ0IGluCiAJCSBhIGxpbmUgd2l0aCBpbmZp bml0ZSB3aWR0aC4gICovCiAJICAgICAgaW5pdF90b19yb3dfc3RhcnQgKCZpdCwgdywgY3Vyc29y X3Jvdyk7CkBAIC0xNDI4Nyw5ICsxODQ3MywyMiBAQCByZWRpc3BsYXlfaW50ZXJuYWwgKHZvaWQp CiAJICAgICAgKnctPmRlc2lyZWRfbWF0cml4LT5tZXRob2QgPSAwOwogCSAgICAgIGRlYnVnX21l dGhvZF9hZGQgKHcsICJvcHRpbWl6YXRpb24gMSIpOwogI2VuZGlmCisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICNpZmRlZiBIQVZFX1dJTkRP V19TWVNURU0KKyAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgJiYgIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgIG1jX3VwZGF0ZV93 aW5kb3dfZnJpbmdlcyAodywgZmFsc2UpOworICAgIGVsc2UKIAkgICAgICB1cGRhdGVfd2luZG93 X2ZyaW5nZXMgKHcsIGZhbHNlKTsKICNlbmRpZgorCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAJICAgICAgZ290byB1cGRhdGU7CiAJICAgIH0KIAkgIGVsc2UKQEAgLTE3Njg3LDEwICsy MTg4NiwyMiBAQCByZWRpc3BsYXlfd2luZG93IChMaXNwX09iamVjdCB3aW5kb3csIGJvb2wganVz dF90aGlzX29uZV9wKQogICAgIH0KIAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQorCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGJvb2wg a2VlcF9jdXJyZW50X3AgPSAoanVzdF90aGlzX29uZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgfHwgKCF1c2VkX2N1cnJlbnRfbWF0cml4X3AgJiYgIW92ZXJsYXlfYXJyb3dfc2VlbikKKyAg ICAgICAgICAgICAgICAgICAgICAgICB8fCB3LT5wc2V1ZG9fd2luZG93X3ApOworCisgIGJvb2wg ZnJpbmdlc191cGRhdGVkX3AgPSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jv c3NoYWlycykpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY191cGRhdGVfd2luZG93 X2ZyaW5nZXMgKHcsIGtlZXBfY3VycmVudF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg OiB1cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIGtlZXBfY3VycmVudF9wKTsKKwogICBpZiAoRlJB TUVfV0lORE9XX1AgKGYpCi0gICAgICAmJiB1cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIChqdXN0 X3RoaXNfb25lX3AKLQkJCQkgICAgfHwgKCF1c2VkX2N1cnJlbnRfbWF0cml4X3AgJiYgIW92ZXJs YXlfYXJyb3dfc2VlbikKLQkJCQkgICAgfHwgdy0+cHNldWRvX3dpbmRvd19wKSkpCisgICAgICAm JiBmcmluZ2VzX3VwZGF0ZWRfcCkKICAgICB7CiAgICAgICB1cGRhdGVfYmVnaW4gKGYpOwogICAg ICAgYmxvY2tfaW5wdXQgKCk7CkBAIC0xNzcwNSw2ICsyMTkxNiw5IEBAIHJlZGlzcGxheV93aW5k b3cgKExpc3BfT2JqZWN0IHdpbmRvdywgYm9vbCBqdXN0X3RoaXNfb25lX3ApCiAgICAgICB1cGRh dGVfZW5kIChmKTsKICAgICB9CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgaWYg KFdJTkRPV19CT1RUT01fRElWSURFUl9XSURUSCAodykpCiAgICAgeF9kcmF3X2JvdHRvbV9kaXZp ZGVyICh3KTsKICNlbmRpZiAvKiBIQVZFX1dJTkRPV19TWVNURU0gKi8KQEAgLTE4MDEwLDYgKzIy MjI0LDE5IEBAIHRyeV93aW5kb3dfcmV1c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRv dyAqdykKIAkgICAgIHNjcm9sbF9ydW5faG9vayB3aWxsIGNsZWFyIHRoZSBjdXJzb3IsIGFuZCB1 c2UgdGhlCiAJICAgICBjdXJyZW50IG1hdHJpeCB0byBnZXQgdGhlIGhlaWdodCBvZiB0aGUgcm93 IHRoZSBjdXJzb3IgaXMKIAkgICAgIGluLiAgKi8KKworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisg ICAgZnByaW50ZiAoc3RkZXJyLCAidHJ5X3dpbmRvd19yZXVzaW5nX2N1cnJlbnRfbWF0cml4IFsx IG9mIDJdICglcylcbiIsIG1jX3dpbmRvdyAodykpOworCisgIG1jX2VyYXNlX3ByZV9zY3JvbGxf ZGlzcGxheSAodyk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIHJ1bi5jdXJy ZW50X3kgPSBzdGFydF9yb3ctPnk7CiAJICBydW4uZGVzaXJlZF95ID0gaXQuY3VycmVudF95Owog CSAgcnVuLmhlaWdodCA9IGl0Lmxhc3RfdmlzaWJsZV95IC0gaXQuY3VycmVudF95OwpAQCAtMTgx NzMsNiArMjI0MDAsMTkgQEAgdHJ5X3dpbmRvd19yZXVzaW5nX2N1cnJlbnRfbWF0cml4IChzdHJ1 Y3Qgd2luZG93ICp3KQogCX0KIAogICAgICAgLyogU2Nyb2xsIHRoZSBkaXNwbGF5LiAgKi8KKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBp ZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAidHJ5X3dpbmRvd19y ZXVzaW5nX2N1cnJlbnRfbWF0cml4IFsyIG9mIDJdICglcylcbiIsIG1jX3dpbmRvdyAodykpOwor CisgIG1jX2VyYXNlX3ByZV9zY3JvbGxfZGlzcGxheSAodyk7CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICAgICAgIHJ1bi5jdXJyZW50X3kgPSBmaXJzdF9yZXVzYWJsZV9yb3ctPnk7 CiAgICAgICBydW4uZGVzaXJlZF95ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CiAg ICAgICBydW4uaGVpZ2h0ID0gaXQubGFzdF92aXNpYmxlX3kgLSBydW4uY3VycmVudF95OwpAQCAt MTkxMjcsNiArMjMzNjcsMTkgQEAgdHJ5X3dpbmRvd19pZCAoc3RydWN0IHdpbmRvdyAqdykKICAg LyogU2Nyb2xsIHRoZSBkaXNwbGF5LiAgRG8gaXQgYmVmb3JlIGNoYW5naW5nIHRoZSBjdXJyZW50 IG1hdHJpeCBzbwogICAgICB0aGF0IHh0ZXJtLmMgZG9lc24ndCBnZXQgY29uZnVzZWQgYWJvdXQg d2hlcmUgdGhlIGN1cnNvciBnbHlwaCBpcwogICAgICBmb3VuZC4gICovCisKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKHRyYWNlX3Jl ZGlzcGxheV9wKQorICAgIGZwcmludGYgKHN0ZGVyciwgInRyeV93aW5kb3dfaWQgKCVzKVxuIiwg bWNfd2luZG93ICh3KSk7CisKKyAgbWNfZXJhc2VfcHJlX3Njcm9sbF9kaXNwbGF5ICh3KTsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBpZiAoZHkgJiYgcnVuLmhlaWdodCkKICAg ICB7CiAgICAgICB1cGRhdGVfYmVnaW4gKGYpOwpAQCAtMjAxMzMsNiArMjQzODYsMTcgQEAgYXBw ZW5kX3NwYWNlX2Zvcl9uZXdsaW5lIChzdHJ1Y3QgaXQgKml0LCBib29sIGRlZmF1bHRfZmFjZV9w KQogCSAgbWVtc2V0ICgmaXQtPnBvc2l0aW9uLCAwLCBzaXplb2YgaXQtPnBvc2l0aW9uKTsKIAkg IGl0LT5vYmplY3QgPSBRbmlsOwogCSAgaXQtPmMgPSBpdC0+Y2hhcl90b19kaXNwbGF5ID0gJyAn OworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CisgICAgICBpZiAoSVRfQllURVBPUyAoKml0KSA+PSBaVl9CWVRFKQorICAgICAgICBpdC0+enZf cCA9IHRydWU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIGl0LT5sZW4gPSAx OwogCiAJICAvKiBJZiB0aGUgZGVmYXVsdCBmYWNlIHdhcyByZW1hcHBlZCwgYmUgc3VyZSB0byB1 c2UgdGhlCkBAIC0yMTI2OSw5ICsyNTUzMywyMiBAQCBtYXliZV9wcm9kdWNlX2xpbmVfbnVtYmVy IChzdHJ1Y3QgaXQgKml0KQogICAgICAgZWxzZQogCXRlbV9pdC5jID0gdGVtX2l0LmNoYXJfdG9f ZGlzcGxheSA9ICpwOwogICAgICAgdGVtX2l0LmxlbiA9IDE7CisKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGlmIChiZXlvbmRfenYp CisgICAgICAgIHRlbV9pdC56dl9wID0gdHJ1ZTsKKyAgICAgIHRlbV9pdC5jdXJyZW50X3kgPSBp dC0+Y3VycmVudF95OworICAgICAgdGVtX2l0LnZwb3MgPSBpdC0+dnBvczsKICAgICAgIC8qIE1h a2Ugc3VyZSB0aGVzZSBnbHlwaHMgd2lsbCBoYXZlIGEgInBvc2l0aW9uIiBvZiAtMS4gICovCiAg ICAgICBTRVRfVEVYVF9QT1MgKHRlbV9pdC5wb3NpdGlvbiwgLTEsIC0xKTsKICAgICAgIFBST0RV Q0VfR0xZUEhTICgmdGVtX2l0KTsKKyAgICAgIHRlbV9pdC5ocG9zICs9IDE7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCiAKICAgICAgIC8qIFN0b3AgcHJvZHVjaW5nIGdseXBocywgYW5k IHJlZnJhaW4gZnJvbSBwcm9kdWNpbmcgdGhlIGxpbmUKIAkgbnVtYmVyLCBpZiB3ZSBkb24ndCBo YXZlIGVub3VnaCBzcGFjZSBvbiB0aGlzIGxpbmUuICAqLwpAQCAtMjEyODQsNiArMjU1NjEsMzAg QEAgbWF5YmVfcHJvZHVjZV9saW5lX251bWJlciAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgfQog CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisg IExpc3BfT2JqZWN0IGJ1ZiA9IGl0LT53LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYp OworICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgc3RydWN0IGJ1ZmZlciAq b2xkX2J1ZmZlciA9IE5VTEw7CisgIC8qIE5lZWRlZCBzbyB0aGF0IGJ1ZmZlci1sb2NhbCB2YWx1 ZXMgY2FuIGJlIGRldGVybWluZWQ7IGUuZy4sIHdoZW4gc3dpdGNoaW5nCisgIHRvIHRoZSBtaW5p YnVmZmVyLiAqLworICBpZiAoYiAhPSBjdXJyZW50X2J1ZmZlcikKKyAgICB7CisgICAgICBvbGRf YnVmZmVyID0gY3VycmVudF9idWZmZXI7CisgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChiKTsK KyAgICB9CisgIGl0LT53LT5tYy5sbnVtX3BpeGVsX3dpZHRoID0gKCFOSUxQIChWZGlzcGxheV9s aW5lX251bWJlcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gdGVtX2l0LmN1 cnJlbnRfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMDsKKyAgaWYgKG9sZF9i dWZmZXIpCisgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgLyogUmVjb3JkIHRoZSB3aWR0aCBpbiBwaXhlbHMgd2Ug bmVlZCBmb3IgdGhlIGxpbmUgbnVtYmVyIGRpc3BsYXkuICAqLwogICBpdC0+bG51bV9waXhlbF93 aWR0aCA9IHRlbV9pdC5jdXJyZW50X3g7CiAgIC8qIENvcHkgdGhlIHByb2R1Y2VkIGdseXBocyBp bnRvIElUJ3MgZ2x5cGhfcm93LiAgKi8KQEAgLTI3MDkyLDYgKzMxMzkzLDIwIEBAIGFwcGVuZF9n bHlwaCAoc3RydWN0IGl0ICppdCkKIAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGggPSBpdC0+Z2x5 cGhfcm93LT5nbHlwaHNbYXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7 CisgICAgICBnbHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICBnbHlwaC0+aHBvcyA9IGl0 LT5ocG9zOworICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKyAgICAgIGdseXBoLT56dl9w ID0gaXQtPnp2X3A7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBo LT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3Qg PSBpdC0+b2JqZWN0OwogICAgICAgaWYgKGl0LT5waXhlbF93aWR0aCA+IDApCkBAIC0yNzE3NSw2 ICszMTQ5MCwyMCBAQCBhcHBlbmRfY29tcG9zaXRlX2dseXBoIChzdHJ1Y3QgaXQgKml0KQogCSAg ICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1tpdC0+YXJlYV07 CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAq LworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7CisgICAgICBnbHlwaC0+eSA9IGl0 LT5jdXJyZW50X3k7CisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgt PnZwb3MgPSBpdC0+dnBvczsKKyAgICAgIGdseXBoLT56dl9wID0gaXQtPnp2X3A7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gaXQtPmNtcF9p dC5jaGFycG9zOwogICAgICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBlYXNz ZXJ0IChpdC0+cGl4ZWxfd2lkdGggPD0gU0hSVF9NQVgpOwpAQCAtMjczODMsNiArMzE3MTIsMjAg QEAgcHJvZHVjZV9pbWFnZV9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgICBpZiAoZ2x5 cGggPCBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYSArIDFdKQogCXsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPngg PSBpdC0+Y3VycmVudF94OworICAgICAgZ2x5cGgtPnkgPSBpdC0+Y3VycmVudF95OworICAgICAg Z2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT52cG9zID0gaXQtPnZwb3M7Cisg ICAgICBnbHlwaC0+enZfcCA9IGl0LT56dl9wOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAJICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAJICBnbHlw aC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9IGNsaXBfdG9f Ym91bmRzICgtMSwgaXQtPnBpeGVsX3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzQ4Niw2ICszMTgy OSwyMCBAQCBwcm9kdWNlX3h3aWRnZXRfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJfQogICAgICAg aWYgKGdseXBoIDwgaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2FyZWEgKyAxXSkKIAl7CisKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGds eXBoLT54ID0gaXQtPmN1cnJlbnRfeDsKKyAgICAgIGdseXBoLT55ID0gaXQtPmN1cnJlbnRfeTsK KyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+dnBvcyA9IGl0LT52 cG9zOworICAgICAgZ2x5cGgtPnp2X3AgPSBpdC0+enZfcDsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogCSAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwog CSAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAJICBnbHlwaC0+cGl4ZWxfd2lkdGggPSBj bGlwX3RvX2JvdW5kcyAoLTEsIGl0LT5waXhlbF93aWR0aCwgU0hSVF9NQVgpOwpAQCAtMjc1NzIs NiArMzE5MjksMjAgQEAgYXBwZW5kX3N0cmV0Y2hfZ2x5cGggKHN0cnVjdCBpdCAqaXQsIExpc3Bf T2JqZWN0IG9iamVjdCwKIAkgICAgd2lkdGggLT0gaXQtPmZpcnN0X3Zpc2libGVfeCAtIGl0LT5j dXJyZW50X3g7CiAJICBlYXNzZXJ0ICh3aWR0aCA+IDApOwogCX0KKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPnggPSBp dC0+Y3VycmVudF94OworICAgICAgZ2x5cGgtPnkgPSBpdC0+Y3VycmVudF95OworICAgICAgZ2x5 cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT52cG9zID0gaXQtPnZwb3M7CisgICAg ICBnbHlwaC0+enZfcCA9IGl0LT56dl9wOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAgICAgICBn bHlwaC0+b2JqZWN0ID0gb2JqZWN0OwogICAgICAgLyogRklYTUU6IEl0IHdvdWxkIGJlIGJldHRl ciB0byB1c2UgVFlQRV9NQVggaGVyZSwgYnV0CkBAIC0yODAyNiw2ICszMjM5NywyMCBAQCBhcHBl bmRfZ2x5cGhsZXNzX2dseXBoIChzdHJ1Y3QgaXQgKml0LCBpbnQgZmFjZV9pZCwgYm9vbCBmb3Jf bm9fZm9udCwgaW50IGxlbiwKIAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGggPSBpdC0+Z2x5cGhf cm93LT5nbHlwaHNbYXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7Cisg ICAgICBnbHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5o cG9zOworICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKyAgICAgIGdseXBoLT56dl9wID0g aXQtPnp2X3A7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5j aGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3QgPSBp dC0+b2JqZWN0OwogICAgICAgZWFzc2VydCAoaXQtPnBpeGVsX3dpZHRoIDw9IFNIUlRfTUFYKTsK QEAgLTI5MDc2LDEwICszMzQ2MSwzMyBAQCB4X2luc2VydF9nbHlwaHMgKHN0cnVjdCB3aW5kb3cg KncsIHN0cnVjdCBnbHlwaF9yb3cgKnVwZGF0ZWRfcm93LAogCiAgIC8qIFdyaXRlIHRoZSBnbHlw aHMuICAqLwogICBocG9zID0gc3RhcnQgLSByb3ctPmdseXBoc1t1cGRhdGVkX2FyZWFdOworCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlm ICgody0+bWNfZWx0cy51c2VkID4gMCB8fCB3LT5jaF9lbHRzLnVzZWQgPiAwIHx8IHctPmZjX2Vs dHMudXNlZCA+IDApCisgICAgICAmJiB1cGRhdGVkX2FyZWEgPT0gVEVYVF9BUkVBKQorICAgIHsK KyAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4Owor ICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgIGlu dCBzdGFydF94ID0gdy0+b3V0cHV0X2N1cnNvci54OworICAgICAgaW50IHN0YXJ0X2hwb3MgPSBo cG9zOworICAgICAgaW50IGVuZF9ocG9zID0gaHBvcyArIGxlbjsKKyAgICAgIGJvb2wgY2xlYXJf ZW9sX3AgPSBmYWxzZTsKKyAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCA9IERSQVdfTk9S TUFMX1RFWFQ7CisgICAgICBUUkFDRSAoKHN0ZGVyciwgInhfaW5zZXJ0X2dseXBocyAoJWQpOiAg c3RhcnRfeCAoJWQpIHwgc3RhcnRfaHBvcyAoJWQpIHwgZW5kX2hwb3MgKCVkKVxuIiwKKyAgICAg ICAgICAgICAgICAgICAgICB2cG9zLCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcykpOwor ICAgICAgbWNfcmVkcmF3X3JvdyAodywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3Ms IGVuZF9ocG9zLCBjbGVhcl9lb2xfcCwgaGwpOworICAgIH0KKyAgICBlbHNlCiAgIGRyYXdfZ2x5 cGhzICh3LCB3LT5vdXRwdXRfY3Vyc29yLngsIHJvdywgdXBkYXRlZF9hcmVhLAogCSAgICAgICBo cG9zLCBocG9zICsgbGVuLAogCSAgICAgICBEUkFXX05PUk1BTF9URVhULCAwKTsKIAorLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogICAvKiBBZHZhbmNlIHRoZSBvdXRwdXQgY3Vyc29yLiAg Ki8KICAgdy0+b3V0cHV0X2N1cnNvci5ocG9zICs9IGxlbjsKICAgdy0+b3V0cHV0X2N1cnNvci54 ICs9IHNoaWZ0X2J5X3dpZHRoOwpAQCAtMjk1MDUsOSArMzM5MTMsMzEgQEAgeF9maXhfb3Zlcmxh cHBpbmdfYXJlYSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LAogCSAg d2hpbGUgKGkgPCByb3ctPnVzZWRbYXJlYV0KIAkJICYmIHJvdy0+Z2x5cGhzW2FyZWFdW2ldLm92 ZXJsYXBzX3ZlcnRpY2FsbHlfcCk7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgICAgaWYgKCh3LT5tY19lbHRzLnVzZWQgPiAwIHx8 IHctPmNoX2VsdHMudXNlZCA+IDAgfHwgdy0+ZmNfZWx0cy51c2VkID4gMCkKKyAgICAgICAgICAg ICYmIGFyZWEgPT0gVEVYVF9BUkVBKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHN0cnVjdCBn bHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgICAgICAgaW50 IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAgICAgIGludCBz dGFydF9ocG9zID0gc3RhcnQ7CisgICAgICAgICAgICBpbnQgZW5kX2hwb3MgPSBpOworICAgICAg ICAgICAgYm9vbCBjbGVhcl9lb2xfcCA9IGZhbHNlOworICAgICAgICAgICAgZW51bSBkcmF3X2ds eXBoc19mYWNlIGhsID0gRFJBV19OT1JNQUxfVEVYVDsKKyAgICAgICAgICAgIFRSQUNFICgoc3Rk ZXJyLCAieF9maXhfb3ZlcmxhcHBpbmdfYXJlYSAoJWQpOiAgc3RhcnRfeCAoJWQpIHwgc3RhcnRf aHBvcyAoJWQpIHwgZW5kX2hwb3MgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICB2cG9zLCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcykpOworICAgICAgICAgICAgbWNf cmVkcmF3X3JvdyAodywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9z LCBjbGVhcl9lb2xfcCwgaGwpOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCiAJICBkcmF3 X2dseXBocyAodywgc3RhcnRfeCwgcm93LCBhcmVhLAogCQkgICAgICAgc3RhcnQsIGksCiAJCSAg ICAgICBEUkFXX05PUk1BTF9URVhULCBvdmVybGFwcyk7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKIAl9CiAgICAgICBlbHNlCiAJewpAQCAtMjk3NTgsMTAgKzM0MTg4LDE3IEBAIGRp c3BsYXlfYW5kX3NldF9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb24sCiAgIG5ld19j dXJzb3JfdHlwZSA9IGdldF93aW5kb3dfY3Vyc29yX3R5cGUgKHcsIGdseXBoLAogCQkJCQkgICAg Jm5ld19jdXJzb3Jfd2lkdGgsICZhY3RpdmVfY3Vyc29yKTsKIAorCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAvKiBJZiBjdXJzb3IgaXMgY3Vy cmVudGx5IGJlaW5nIHNob3duIGFuZCB3ZSBkb24ndCB3YW50IGl0IHRvIGJlIG9yCiAgICAgIGl0 IGlzIGluIHRoZSB3cm9uZyBwbGFjZSwgb3IgdGhlIGN1cnNvciB0eXBlIGlzIG5vdCB3aGF0IHdl IHdhbnQsCiAgICAgIGVyYXNlIGl0LiAgKi8KICAgaWYgKHctPnBoeXNfY3Vyc29yX29uX3AKKyAg ICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisg ICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQor ICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKICAg ICAgICYmICghb24KIAkgIHx8IHctPnBoeXNfY3Vyc29yLnggIT0geAogCSAgfHwgdy0+cGh5c19j dXJzb3IueSAhPSB5CkBAIC0yOTc3NCw2ICszNDIxMSw5IEBAIGRpc3BsYXlfYW5kX3NldF9jdXJz b3IgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb24sCiAJICAgICAgJiYgbmV3X2N1cnNvcl93aWR0 aCAhPSB3LT5waHlzX2N1cnNvcl93aWR0aCkpKQogICAgIGVyYXNlX3BoeXNfY3Vyc29yICh3KTsK IAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBEb24ndCBjaGVjayBwaHlzX2N1 cnNvcl9vbl9wIGhlcmUgYmVjYXVzZSB0aGF0IGZsYWcgaXMgb25seSBzZXQKICAgICAgdG8gZmFs c2UgaW4gc29tZSBjYXNlcyB3aGVyZSB3ZSBrbm93IHRoYXQgdGhlIGN1cnNvciBoYXMgYmVlbgog ICAgICBjb21wbGV0ZWx5IGVyYXNlZCwgdG8gYXZvaWQgdGhlIGV4dHJhIHdvcmsgb2YgZXJhc2lu ZyB0aGUgY3Vyc29yCkBAIC0yOTc5Miw5ICszNDIzMiwxOSBAQCBkaXNwbGF5X2FuZF9zZXRfY3Vy c29yIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9uLAogICAgICAgdy0+cGh5c19jdXJzb3IudnBv cyA9IHZwb3M7CiAgICAgfQogCi0gIEZSQU1FX1JJRiAoZiktPmRyYXdfd2luZG93X2N1cnNvciAo dywgZ2x5cGhfcm93LCB4LCB5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG5ld19jdXJzb3JfdHlwZSwgbmV3X2N1cnNvcl93aWR0aCwKLSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBvbiwgYWN0aXZlX2N1cnNvcik7CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmIChOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgIEZSQU1FX1JJRiAoZiktPmRyYXdf d2luZG93X2N1cnNvciAodywgZ2x5cGhfcm93LCB4LCB5LCBuZXdfY3Vyc29yX3R5cGUsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY3Vyc29yX3dpZHRoLCBvbiwg YWN0aXZlX2N1cnNvcik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIH0KIAogCkBA IC0yOTg4Nyw3ICszNDMzNywyNyBAQCBkcmF3X3Jvd193aXRoX21vdXNlX2ZhY2UgKHN0cnVjdCB3 aW5kb3cgKncsIGludCBzdGFydF94LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCiAjaWZkZWYgSEFW RV9XSU5ET1dfU1lTVEVNCiAgIGlmIChGUkFNRV9XSU5ET1dfUCAoWEZSQU1FICh3LT5mcmFtZSkp KQogICAgIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNP UlMgKi8KKworICAgICAgaWYgKHctPm1jX2VsdHMudXNlZCA+IDAgfHwgdy0+Y2hfZWx0cy51c2Vk ID4gMCB8fCB3LT5mY19lbHRzLnVzZWQgPiAwKQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0 IGdseXBoX21hdHJpeCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAgICAgaW50 IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAgICBib29sIGNs ZWFyX2VvbF9wID0gZmFsc2U7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIGhsID0g ZHJhdzsKKyAgICAgICAgICBUUkFDRSAoKHN0ZGVyciwgImRyYXdfcm93X3dpdGhfbW91c2VfZmFj ZSAoJWQpOiAgc3RhcnRfeCAoJWQpIHwgc3RhcnRfaHBvcyAoJWQpIHwgZW5kX2hwb3MgKCVkKVxu IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgc3RhcnRfeCwgc3RhcnRfaHBvcywg ZW5kX2hwb3MpKTsKKyAgICAgICAgICBtY19yZWRyYXdfcm93ICh3LCBtYXRyaXgsIHJvdywgc3Rh cnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGNsZWFyX2VvbF9wLCBobCk7CisgICAgICAgIH0K KyAgICAgICAgZWxzZQogICAgICAgZHJhd19nbHlwaHMgKHcsIHN0YXJ0X3gsIHJvdywgVEVYVF9B UkVBLCBzdGFydF9ocG9zLCBlbmRfaHBvcywgZHJhdywgMCk7CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICAgICAgIHJldHVybjsKICAgICB9CiAjZW5kaWYKQEAgLTMxOTQ1LDExICsz NjQxNSwzNCBAQCBleHBvc2VfYXJlYSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3Jv dyAqcm93LCBYUmVjdGFuZ2xlICpyLAogICBzdHJ1Y3QgZ2x5cGggKmxhc3Q7CiAgIGludCBmaXJz dF94LCBzdGFydF94LCB4OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCiAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiByb3ctPmZpbGxfbGlu ZV9wKQorICAgIHsKKyAgICAgIGlmICh3LT5tY19lbHRzLnVzZWQgPiAwIHx8IHctPmNoX2VsdHMu dXNlZCA+IDAgfHwgdy0+ZmNfZWx0cy51c2VkID4gMCkKKyAgICAgICAgeworICAgICAgICAgIHN0 cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgICAg IGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAgICAgICAgaW50 IHN0YXJ0X3ggPSAwOworICAgICAgICAgIGludCBzdGFydF9ocG9zID0gMDsKKyAgICAgICAgICBp bnQgZW5kX2hwb3MgPSByb3ctPnVzZWRbVEVYVF9BUkVBXTsKKyAgICAgICAgICBib29sIGNsZWFy X2VvbF9wID0gZmFsc2U7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIGhsID0gRFJB V19OT1JNQUxfVEVYVDsKKyAgICAgICAgICBUUkFDRSAoKHN0ZGVyciwgImV4cG9zZV9hcmVhICgl ZCk6ICBXcml0ZSB0aGUgd2hvbGUgbGluZS5cbiIsIHZwb3MpKTsKKyAgICAgICAgICBtY19yZWRy YXdfcm93ICh3LCBtYXRyaXgsIHJvdywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGNs ZWFyX2VvbF9wLCBobCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQogICAgIC8qIElmIHJvdyBl eHRlbmRzIGZhY2UgdG8gZW5kIG9mIGxpbmUgd3JpdGUgdGhlIHdob2xlIGxpbmUuICAqLwogICAg IGRyYXdfZ2x5cGhzICh3LCAwLCByb3csIGFyZWEsCiAJCSAwLCByb3ctPnVzZWRbYXJlYV0sCiAJ CSBEUkFXX05PUk1BTF9URVhULCAwKTsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKICAgZWxzZQogICAgIHsKICAgICAgIC8qIFNldCBTVEFSVF9YIHRvIHRoZSB3aW5kb3ct cmVsYXRpdmUgc3RhcnQgcG9zaXRpb24gZm9yIGRyYXdpbmcgZ2x5cGhzIG9mCkBAIC0zMTk4MSwx MSArMzY0NzQsMzQgQEAgZXhwb3NlX2FyZWEgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlw aF9yb3cgKnJvdywgWFJlY3RhbmdsZSAqciwKIAkgICsrbGFzdDsKIAl9CiAKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgICAgIC8qIFJlcGFp bnQuICAqLwotICAgICAgaWYgKGxhc3QgPiBmaXJzdCkKKyAgICAgIC8qIEZsb2F0aW5nIGZha2Ug Y3Vyc29ycyB3aWxsIGV4aXN0IHdoZW4gKGxhc3QgPT0gZmlyc3QpLiAqLworICAgICAgaWYgKCh3 LT5tY19lbHRzLnVzZWQgPiAwIHx8IHctPmNoX2VsdHMudXNlZCA+IDAgfHwgdy0+ZmNfZWx0cy51 c2VkID4gMCkKKyAgICAgICAgICAmJiBhcmVhID09IFRFWFRfQVJFQSkKKyAgICAgICAgeworICAg ICAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4Owor ICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAg ICAgICAgc3RhcnRfeCA9IGZpcnN0X3ggLSBzdGFydF94OworICAgICAgICAgIGludCBzdGFydF9o cG9zID0gZmlyc3QgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgIGludCBlbmRf aHBvcyA9IGxhc3QgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgIGJvb2wgY2xl YXJfZW9sX3AgPSBmYWxzZTsKKyAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UgaGwgPSBE UkFXX05PUk1BTF9URVhUOworICAgICAgICAgIFRSQUNFICgoc3RkZXJyLCAiZXhwb3NlX2FyZWEg KCVkKTogIHN0YXJ0X3ggKCVkKSB8IHN0YXJ0X2hwb3MgKCVkKSB8IGVuZF9ocG9zICglZClcbiIs CisgICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVu ZF9ocG9zKSk7CisgICAgICAgICAgbWNfcmVkcmF3X3JvdyAodywgbWF0cml4LCByb3csIHN0YXJ0 X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBjbGVhcl9lb2xfcCwgaGwpOworICAgICAgICB9Cisg ICAgICAgIGVsc2UgaWYgKGxhc3QgPiBmaXJzdCkKIAlkcmF3X2dseXBocyAodywgZmlyc3RfeCAt IHN0YXJ0X3gsIHJvdywgYXJlYSwKIAkJICAgICBmaXJzdCAtIHJvdy0+Z2x5cGhzW2FyZWFdLCBs YXN0IC0gcm93LT5nbHlwaHNbYXJlYV0sCiAJCSAgICAgRFJBV19OT1JNQUxfVEVYVCwgMCk7CisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB9CiB9CiAKQEAgLTMxOTk5LDEwICsz NjUxNSwzMyBAQCBleHBvc2VfbGluZSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3Jv dyAqcm93LCBYUmVjdGFuZ2xlICpyKQogewogICBlYXNzZXJ0IChyb3ctPmVuYWJsZWRfcCk7CiAK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAg aWYgKHJvdy0+bW9kZV9saW5lX3AgfHwgdy0+cHNldWRvX3dpbmRvd19wKQorICAgIHsKKyAgICAg IGlmICh3LT5tY19lbHRzLnVzZWQgPiAwIHx8IHctPmNoX2VsdHMudXNlZCA+IDAgfHwgdy0+ZmNf ZWx0cy51c2VkID4gMCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXgg Km1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgICAgIGludCB2cG9zID0gTUFUUklY X1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAgICAgICAgaW50IHN0YXJ0X3ggPSAwOworICAg ICAgICAgIGludCBzdGFydF9ocG9zID0gMDsKKyAgICAgICAgICBpbnQgZW5kX2hwb3MgPSByb3ct PnVzZWRbVEVYVF9BUkVBXTsKKyAgICAgICAgICBib29sIGNsZWFyX2VvbF9wID0gZmFsc2U7Cisg ICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIGhsID0gRFJBV19OT1JNQUxfVEVYVDsKKyAg ICAgICAgICBUUkFDRSAoKHN0ZGVyciwgImV4cG9zZV9saW5lICglZCk6ICBXcml0ZSB0aGUgd2hv bGUgbGluZS5cbiIsIHZwb3MpKTsKKyAgICAgICAgICBtY19yZWRyYXdfcm93ICh3LCBtYXRyaXgs IHJvdywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGNsZWFyX2VvbF9wLCBobCk7Cisg ICAgICAgIH0KKyAgICAgICAgZWxzZQogICAgIGRyYXdfZ2x5cGhzICh3LCAwLCByb3csIFRFWFRf QVJFQSwKIAkJIDAsIHJvdy0+dXNlZFtURVhUX0FSRUFdLAogCQkgRFJBV19OT1JNQUxfVEVYVCwg MCk7CisgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIGVsc2UKICAgICB7 CiAgICAgICBpZiAocm93LT51c2VkW0xFRlRfTUFSR0lOX0FSRUFdKQpAQCAtMzI1NTAsNiArMzcw ODksMjIgQEAgeF9pbnRlcnNlY3RfcmVjdGFuZ2xlcyAoWFJlY3RhbmdsZSAqcjEsIFhSZWN0YW5n bGUgKnIyLCBYUmVjdGFuZ2xlICpyZXN1bHQpCiB2b2lkCiBzeW1zX29mX3hkaXNwICh2b2lkKQog eworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CisgIGRlZnN1YnIgKCZTbWNfZHVtcF9nbHlwaF9yb3cpOworCisgIGRlZnN1YnIgKCZTbWNfZHVt cF9nbHlwaF9tYXRyaXgpOworCisgIGRlZnN1YnIgKCZTbWNfY3VycmVudF9jb2x1bW4pOworCisg IGRlZnN1YnIgKCZTbWNfc3RkZXJyKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICBWd2l0aF9lY2hvX2FyZWFfc2F2ZV92ZWN0b3IgPSBRbmlsOwogICBzdGF0aWNwcm8gKCZWd2l0 aF9lY2hvX2FyZWFfc2F2ZV92ZWN0b3IpOwogCmRpZmYgLS1naXQgYS9zcmMveHRlcm0uYyBiL3Ny Yy94dGVybS5jCmluZGV4IDVhYTNlM2YuLjk1M2ExMDQgMTAwNjQ0Ci0tLSBhL3NyYy94dGVybS5j CisrKyBiL3NyYy94dGVybS5jCkBAIC0xMzIsNiArMTMyLDg2OSBAQCBhbG9uZyB3aXRoIEdOVSBF bWFjcy4gIElmIG5vdCwgc2VlIDxodHRwczovL3d3dy5nbnUub3JnL2xp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TsKK30KKworLyogRHJhdyBhIGJhciBj dXJzb3Igb24gd2luZG93IFcgaW4gZ2x5cGggcm93IFJPVy4gKi8KK3N0YXRpYyB2b2lkCittY194 X2RyYXdfYmFyX2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAq bWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgaW50 IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50IGhwb3MsIGludCB2cG9zLCBpbnQgd2QsIGlu dCBoLAorICAgICAgICAgICAgICAgICAgICAgIGludCB3aWR0aCwgZW51bSB0eXBlX29mX2N1cnNv ciBraW5kLCBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKQoreworICBzdHJ1Y3QgZnJh bWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgLyogSWYgY3Vyc29yIGlzIG91dCBvZiBib3Vu ZHMsIGRvbid0IGRyYXcgZ2FyYmFnZS4gIFRoaXMgY2FuIGhhcHBlbgorICAgICBpbiBtaW5pLWJ1 ZmZlciB3aW5kb3dzIHdoZW4gc3dpdGNoaW5nIGJldHdlZW4gZWNobyBhcmVhIGdseXBocworICAg ICBhbmQgbWluaS1idWZmZXIuICAqLworICBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCA9IG1j X2dldF9jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBocG9zLCB2cG9zKTsKKyAgaWYgKGN1 cnNvcl9nbHlwaCA9PSBOVUxMKQorICAgIHJldHVybjsKKyAgLyogRXhwZXJpbWVudGFsIGF2b2lk YW5jZSBvZiBjdXJzb3Igb24geHdpZGdldC4gICovCisgIGlmIChjdXJzb3JfZ2x5cGgtPnR5cGUg PT0gWFdJREdFVF9HTFlQSCkKKyAgICByZXR1cm47CisgIC8qIElmIG9uIGFuIGltYWdlLCBkcmF3 IGxpa2UgYSBub3JtYWwgY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ibHVlID0gbWluICg2NTUzNSwgNjU1MzUgKiBsc2wuYmx1ZSk7 CisgIC8qIGB4X2FsbG9jX25lYXJlc3RfY29sb3InIHNldHMgdGhlIGBjb2xvci5waXhlbGAuICov CisgIHhfYWxsb2NfbmVhcmVzdF9jb2xvciAoZiwgY21hcCwgJmNvbG9yKTsKKyAgc3dpdGNoIChj dXJzb3JfdHlwZSkKKyAgeworICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgIGJy ZWFrOworICAgIGNhc2UgTUNfTk9fQ1VSU09SOgorICAgICAgYnJlYWs7CisgICAgY2FzZSBNQ19S SUdIVF9GUklOR0VfQklUTUFQOgorICAgICAgYnJlYWs7CisgICAgY2FzZSBNQ19MRUZUX0ZSSU5H RV9CSVRNQVA6CisgICAgICBicmVhazsKKyAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6CisgICAgewor ICAgICAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3 LCBtYXRyaXgsIHJvdywgaHBvcywgdnBvcyk7CisgICAgICBpZiAoY3Vyc29yX2dseXBoID09IE5V TEwpCisgICAgICAgIHJldHVybjsKKyAgICAgIExpc3BfT2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRz OworICAgICAgQ0hFQ0tfQlVGRkVSIChidWYpOworICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhC VUZGRVIgKGJ1Zik7CisgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5z aWVudF9tYXJrX21vZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAo QlZBUiAoYiwgbWFya19hY3RpdmUpKSk7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZ2lubmlu ZyA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9iZWdpbm5pbmcgKCkpIDog LTE7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2VuZCA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJ WE5VTSAoRnJlZ2lvbl9lbmQgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3Qgb3BvaW50X3B0ID0g KHcgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBYRklYTlVNIChGbWFya2Vy X3Bvc2l0aW9uICh3LT5wb2ludG0pKTsKKyAgICAgIGJvb2wgcmVnaW9uX2luX2JvdW5kc19wID0g KHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3Bv aW50X3B0ID49IHJlZ2lvbl9iZWdpbm5pbmcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9wb2ludF9wdCA8IHJlZ2lvbl9lbmQpOworICAgICAgaWYgKGN1cnNvcl9nbHlwaC0+ dHlwZSAhPSBJTUFHRV9HTFlQSCAmJiBsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYg bHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFj ayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAg ICAgZnVuY3Rpb25hbGl0eSBvZiBgeF9tYWtlX2djJyBpbiB4Zm5zLmMuICAqLworICAgICAgICAg IGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgJiYgcmVnaW9uX2luX2JvdW5kc19w CisgICAgICAgICAgICAgICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZV9pZCA9IGxvb2t1cF9u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ncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiks IGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2luYWN0aXZlX2ZhY2UtPmZvcmVn cm91bmQpOworICAgICAgICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQ TEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfaW5hY3RpdmVfZmFj ZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgYmxvY2tfaW5w dXQgKCk7CisgICAgICAgICAgLyogRm9yY2UgYG1jX3hfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBz LT5mLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MnLiAgKi8KKyAgICAgICAgICBib29sIGN1cnNv cl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4 LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLCBsc2wsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwg Y3Vyc29yX2djX3ApOworICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkg KGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIHhnY3YuZm9yZWdyb3VuZCk7CisgICAg ICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9nYywgeGdjdi5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICB1bmJsb2NrX2lucHV0 ICgpOworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+ Y3Vyc29yX3Bpe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Y2tncm91bmQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlm IChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcmVnaW9uX2lu X2JvdW5kc19wCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0 aXZlX3JlZ2lvbl9vdXRfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4g KCIrLXJlYWwtZmFrZS1jdXJzb3ItcmVnaW9uLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAg ICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfZmFjZSA9IEZBQ0Vf RlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fb3V0X2ZhY2VfaWQpOworICAgICAgICAg ICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25h bWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUp OworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0g RkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAg ICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEu eC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAg ICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKS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CisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0g bG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFj dGl2ZS1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2Ug KmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfaW5hY3RpdmVf ZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVf WF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfaW5hY3Rp dmVfZmFjZS0+Zm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBYU2V0QmFja2dy b3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBo b2xsb3dfaW5hY3RpdmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyogRm9yY2Ug YG1jX3hfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS54LT5jdXJzb3Jf Z2MnLiAgKi8KKyAgICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAgICAg ICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgRFJBV19DVVJTT1Is IHgsIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsc2ws IGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgWFNldEZv cmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9n YywgeGdjdi5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1F X1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdjdi5iYWNrZ3Jv dW5kKTsKKyAgICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyog RHJhdyB0aGUgZnJhbWUgYXJvdW5kIHRoZSBib3guICovCisgICAgICAgICAgICAgIG1jX3hfZHJh d19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9z LCB3ZCwgaCk7CisgICAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBN Q19IT0xMT1dfQk9YOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVu ID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFy aWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAg ICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAg ICAgbWNfeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnks IGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3Jf cGl4ZWwgP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pc2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY194X2Ry YXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywg d2QsIGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7 CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vy c29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAg ICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAg ICBtY194X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBv cywgdnBvcywgd2QsIGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxl X29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNf SEJBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYm IGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWph Y2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91 dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgIGJvb2wg Y3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3hfZHJhd19i YXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwg aCwgY3Vyc29yX3dpZHRoLCBNQ19IQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7Cisg ICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29y X3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAg ICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAgICBt Y194X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywg dnBvcywgd2QsIGgsIGN1cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9v a2F5X3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBkZWZhdWx0Ogor ICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KKyAgICAgICAgfQorI2lmZGVmIEhBVkVfWF9JMThO CisgIGlmICh3ID09IFhXSU5ET1cgKGYtPnNlbGVjdGVkX3dpbmRvdykpCisgICAgaWYgKEZSQU1F X1hJQyAoZikgJiYgKEZSQU1FX1hJQ19TVFlMRSAoZikgJiBYSU1QcmVlZGl0UG9zaXRpb24pKQor ICAgICAgeGljX3NldF9wcmVlZGl0YXJlYSAodywgeCwgeSk7CisjZW5kaWYKKyAgICB9CisgIFhG bHVzaCAoRlJBTUVfWF9ESVNQTEFZIChmKSk7Cit9CisKKy8qIERyYXcgc3RyZXRjaCBnbHlwaCBz dHJpbmcgUy4gICovCitzdGF0aWMgdm9pZAorbWNfeF9kcmF3X3N0cmV0Y2hfZ2x5cGhfc3RyaW5n IChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzKQoreworICBlYXNzZXJ0IChzLT5maXJzdF9nbHlwaC0+ dHlwZSA9PSBTVFJFVENIX0dMWVBIKTsKKyAgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SC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CBnbHlwaF9zdHJpbmcgKm5leHQ7CisgICAgICBmb3IgKHdpZHRoID0gMCwgbmV4dCA9IHMt Pm5leHQ7CisgICAgICAgICAgIG5leHQgJiYgd2lkdGggPCBzLT5yaWdodF9vdmVyaGFuZzsKKyAg ICAgICAgICAgd2lkdGggKz0gbmV4dC0+d2lkdGgsIG5leHQgPSBuZXh0LT5uZXh0KQorICAgICAg ICBpZiAobmV4dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgIT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAg eworICAgICAgICAgICAgbWNfeF9zZXRfZ2x5cGhfc3RyaW5nX2djIChuZXh0LCBjdXJzb3JfZ2Nf cCk7CisgICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmcgKG5leHQpOworICAg ICAgICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZUEgpCisg ICAgICAgICAgICAgIG1jX3hfZHJhd19zdHJldGNoX2dseXBoX3N0cmluZyAobmV4dCk7CisgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3Vu ZCAobmV4dCwgdHJ1ZSk7CisgICAgICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAg ICAgIH0KKyAgICB9CisgIC8qIFNldCB1cCBTLT5nYywgc2V0IGNsaXBwaW5nIGFuZCBkcmF3IFMu ICAqLworICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHMsIGN1cnNvcl9nY19wKTsKKyAgLyog RHJhdyByZWxpZWYgKGlmIGFueSkgaW4gYWR2YW5jZSBmb3IgY2hhci9jb21wb3NpdGlvbiBzbyB0 aGF0IHRoZQorICAgICBnbHlwaCBzdHJpbmcgY2FuIGJlIGRyYXduIG92ZXIgaXQuICAqLworICBp ZiAoIXMtPmZvcl9vdmVybGFwcworICAgICAgJiYgcy0+ZmFjZS0+Ym94IC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HMpCisgIHMtPmJhY2tncm91bmRfZmlsbGVk X3AgPSB0cnVlOworICAgICAgZWxzZQorICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQg KHMsIHRydWUpOworICAgICAgeF9kcmF3X2dseXBobGVzc19nbHlwaF9zdHJpbmdfZm9yZWdyb3Vu ZCAocyk7CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7 CisgICAgfQorICBpZiAoIXMtPmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICAvKiBEcmF3IHVu ZGVybGluZS4gICovCisgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3ApCisgICAgICAgIHsK KyAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9XQVZF KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX2Rl ZmF1bHRlZF9wKQorICAgICAgICAgICAgICAgIHhfZHJhd191bmRlcndhdmUgKHMpOworICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgWEdDVmFs dWVzIHhnY3Y7CisgICAgICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKHMtPmRpc3BsYXksIHMt PmdjLCBHQ0ZvcmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3Jv dW5kIChzLT5kaXNwbGF5LCBzLT5nYywgcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yKTsKKyAgICAg ICAgICAgICAgICAgIHhfZHJhd191bmRlcndhdmUgKHMpOworICAgICAgICAgICAgICAgICAgWFNl dEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChzLT5mYWNlLT51 bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAgICAgICAgICAgICAg aW50IHk7CisgICAgICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVy bGluZV9wCisgICAgICAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VO REVSX0xJTkUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgLyogV2UgdXNl IHRoZSBzYW1lIHVuZGVybGluZSBzdHlsZSBhcyB0aGUgcHJldmlvdXMgb25lLiAgKi8KKyAgICAg ICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPnByZXYtPnVuZGVybGluZV90aGlja25lc3M7Cisg ICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsK KyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSB0aGlja25lc3MuICBEZWZh dWx0IGlzIDEgcGl4ZWwuICAqLworICAgICAgICAgICAgICAgICAgaWYgKHMtPmZvbnQgJiYgcy0+ Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAgICAgICAgICAgICAgIHRoaWNr bmVzcyA9IHMtPmZvbnQtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAgICAgICAgICAg ICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2VudF9saW5lKQorICAgICAgICAgICAgICAgICAgICBw b3NpdGlvbiA9IChzLT5oZWlnaHQgLSB0aGlja25lc3MpIC0gKHMtPnliYXNlIC0gcy0+eSk7Cisg ICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSBwb3NpdGlvbi4gIFRoaXMgaXMgdGhlIHJl Y29tbWVuZGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgdmVydGljYWwgb2Zmc2V0IGluIHBp eGVscyBmcm9tIHRoZSBiYXNlbGluZSB0byB0aGUgdG9wIG9mCisgICAgICAgICAgICAgICAgICAg ICAgICAgdGhlIHVuZGVybGluZS4gIFRoaXMgaXMgYSBzaWduZWQgdmFsdWUgYWNjb3JkaW5nIHRv IHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgIHNwZWNzLCBhbmQgaXRzIGRlZmF1bHQgaXMK KyAgICAgICAgICAgICAgICAgICAgICAgICBST1VORCAoKG1heGltdW0gZGVzY2VudCkgLyAyKSwg d2l0aAorICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EKHgpID0gZmxvb3IgKHggKyAwLjUp ICAqLworICAgICAgICAgICAgICAgICAgICAgIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25f cHJvcGVydGllcworICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzLT5mb250ICYmIHMtPmZv bnQtPnVuZGVybGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgcG9z aXRpb24gPSBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgICAg ICAgZWxzZSBpZiAocy0+Zm9udCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0g KHMtPmZvbnQtPmRlc2NlbnQgKyAxKSAvIDI7CisgICAgICAgICAgICAgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSB1bmRlcmxpbmVfbWluaW11bV9vZmZz ZXQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0g bWF4IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgIC8qIENoZWNrIHRoZSBzYW5pdHkgb2YgdGhpY2tuZXNzIGFuZCBw b3NpdGlvbi4gIFdlIHNob3VsZAorICAgICAgICAgICAgICAgICBhdm9pZCBkcmF3aW5nIHVuZGVy bGluZSBvdXQgb2YgdGhlIGN1cnJlbnQgbGluZSBhcmVhLiAgKi8KKyAgICAgICAgICAgICAgaWYg KHMtPnkgKyBzLT5oZWlnaHQgPD0gcy0+eWJhc2UgKyBwb3NpdGlvbikKKyAgICAgICAgICAgICAg ICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSAxKSAtIChzLT55YmFzZSAtIHMtPnkpOworICAgICAg ICAgICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8IHMtPnliYXNlICsgcG9zaXRpb24gKyB0aGlj a25lc3MpCisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gKHMtPnkgKyBzLT5oZWlnaHQpIC0g KHMtPnliYXNlICsgcG9zaXRpb24pOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfdGhpY2tu ZXNzID0gdGhpY2tuZXNzOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPSBw b3NpdGlvbjsKKyAgICAgICAgICAgICAgeSA9IHMtPnliYXNlICsgcG9zaXRpb247CisgICAgICAg ICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAg ICAgeF9maWxsX3JlY3RhbmdsZSAocy0+Ziwgcy0+Z2MsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHMtPngsIHksIHMtPndpZHRoLCB0aGlja25lc3MpOworICAgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgWEdDVmFsdWVzIHhnY3Y7 CisgICAgICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKHMtPmRpc3BsYXksIHMtPmdjLCBHQ0Zv cmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5k aXNwbGF5LCBzLT5nYywgcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yKTsKKyAgICAgICAgICAgICAg ICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHMtPngsIHksIHMtPndpZHRoLCB0aGlja25lc3MpOworICAgICAgICAgICAg ICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCB4Z2N2LmZvcmVncm91bmQp OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyog RHJhdyBvdmVybGluZS4gICovCisgICAgICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfcCkKKyAgewor ICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAwLCBoID0gMTsKKyAgICBpZiAocy0+ZmFjZS0+b3Zlcmxp bmVfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBzLT5n Yywgcy0+eCwgcy0+eSArIGR5LAorICAgICAgICAgIHMtPndpZHRoLCBoKTsKKyAgICBlbHNlCisg ICAgICB7CisgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICBYR2V0R0NWYWx1ZXMgKHMt PmRpc3BsYXksIHMtPmdjLCBHQ0ZvcmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgWFNldEZvcmVn cm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCBzLT5mYW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IGlmIG5vdCB5ZXQgZHJhd24uICAqLworICAgICAgaWYgKCFyZWxpZWZfZHJhd25fcCAmJiBz LT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisgIHhfZHJhd19nbHlwaF9zdHJpbmdfYm94IChz KTsKKyAgICAgIGlmIChzLT5wcmV2KQorICB7CisgICAgc3RydWN0IGdseXBoX3N0cmluZyAqcHJl djsKKyAgICBmb3IgKHByZXYgPSBzLT5wcmV2OyBwcmV2OyBwcmV2ID0gcHJldi0+cHJldikKKyAg ICAgIGlmIChwcmV2LT5obCAhPSBzLT5obAorICAgICYmIHByZXYtPnggKyBwcmV2LT53aWR0aCAr IHByZXYtPnJpZ2h0X292ZXJoYW5nID4gcy0+eCkKKyAgICAgICAgeworICAgIC8qIEFzIHByZXYg d2FzIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8gaXRzIG93biBhcmVhLCB3ZQorICAgICAgIG11c3Qg ZHJhdyB0aGUgcmlnaHRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICAqLworICAgIGVu dW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gcHJldi0+aGw7CisgICAgcHJldi0+aGwgPSBzLT5o bDsKKyAgICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHByZXYsIGN1cnNvcl9nY19wKTsKKyAg ICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgcHJldik7CisgICAgaWYg KHByZXYtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICB4X2RyYXdfZ2x5 cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgIGVsc2UKKyAgICAgIHhfZHJhd19jb21w b3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgIHhfcmVzZXRfY2xpcF9y ZWN0YW5nbGVzIChwcmV2LT5mLCBwcmV2LT5nYyk7CisgICAgcHJldi0+aGw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ICAgIG5leHQtPmNsaXBfaGVhZCA9IHMtPm5leHQ7CisgICAgICAgIH0KKyAgfQorICAgIH0KKyAg LyogUmVzZXQgY2xpcHBpbmcuICAqLworICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAocy0+Ziwg cy0+Z2MpOworICBzLT5udW1fY2xpcHMgPSAwOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09S UyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogRGVmYXVsdCB0byB1c2luZyBY SU0gaWYgYXZhaWxhYmxlLiAgKi8KICNpZmRlZiBVU0VfWElNCiBib29sIHVzZV94aW0gPSB0cnVl OwpAQCAtOTk5LDYgKzE4NjIsMTUgQEAgeF91cGRhdGVfYmVnaW4gKHN0cnVjdCBmcmFtZSAqZikK ICAgaWYgKEZSQU1FX1RPT0xUSVBfUCAoZikgJiYgIUZSQU1FX1ZJU0lCTEVfUCAoZikpCiAgICAg cmV0dXJuOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gZjsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICBpZiAoISBGUkFNRV9DUl9TVVJGQUNFIChmKSkKICAgICB7CiAgICAgICBp bnQgd2lkdGgsIGhlaWdodDsKQEAgLTEyNjYsNiArMjEzOCwxNiBAQCB4X3VwZGF0ZV9lbmQgKHN0 cnVjdCBmcmFtZSAqZikKICAgWEZsdXNoIChGUkFNRV9YX0RJU1BMQVkgKGYpKTsKICAgdW5ibG9j a19pbnB1dCAoKTsKICNlbmRpZgorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gTlVMTDsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAvKiBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxl ZCBmcm9tIHZhcmlvdXMgcGxhY2VzIGluIHhkaXNwLmMKQEAgLTEzMTAwLDYgKzEzOTgyLDIxIEBA IHhfYWN0aXZhdGVfdGltZW91dF9hdGltZXIgKHZvaWQpCiAKIHN0YXRpYyBzdHJ1Y3QgcmVkaXNw bGF5X2ludGVyZmFjZSB4X3JlZGlzcGxheV9pbnRlcmZhY2UgPQogICB7CisKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlf aW50ZXJmYWNlJyBpbiBgeHRlcm0uY2AgbXVzdCBiZSBpbiB0aGUgZXhhY3Qgc2FtZSBvcmRlciBh cyB0aGUKK2ByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4dGVybi5oYCEgKi8KKworICBt Y194X3dyaXRlX2dseXBocywKKyAgbWNfeF9kcmF3X3dpbmRvd19jdXJzb3IsCisgIG1jX3hfZHJh d19nbHlwaF9zdHJpbmcsCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB4X2Zy YW1lX3Bhcm1faGFuZGxlcnMsCiAgICAgeF9wcm9kdWNlX2dseXBocywKICAgICB4X3dyaXRlX2ds eXBocywK --Multipart_Sun_Apr_28_18:21:05_2019-1--