From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.bugs Subject: bug#22873: Can we support multiple Cursors? Date: Sun, 30 Jul 2017 10:39:45 -0700 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sun_Jul_30_10:39:45_2017-1" X-Trace: blaine.gmane.org 1501436419 26829 195.159.176.226 (30 Jul 2017 17:40:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 30 Jul 2017 17:40:19 +0000 (UTC) Cc: John Wiegley , Marcin Borkowski , Richard Stallman To: 22873@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 30 19:40:11 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dbsCF-0006MD-Jp for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Jul 2017 19:40:08 +0200 Original-Received: from localhost ([::1]:56048 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dbsCL-0007em-9z for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Jul 2017 13:40:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dbsCE-0007cF-4V for bug-gnu-emacs@gnu.org; Sun, 30 Jul 2017 13:40:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dbsCA-0007Qc-R4 for bug-gnu-emacs@gnu.org; Sun, 30 Jul 2017 13:40:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60052) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dbsCA-0007QG-Ey for bug-gnu-emacs@gnu.org; Sun, 30 Jul 2017 13:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dbsCA-0002HU-0e for bug-gnu-emacs@gnu.org; Sun, 30 Jul 2017 13:40:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Keith David Bershatsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Jul 2017 17:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22873-submit@debbugs.gnu.org id=B22873.15014363938750 (code B ref 22873); Sun, 30 Jul 2017 17:40:01 +0000 Original-Received: (at 22873) by debbugs.gnu.org; 30 Jul 2017 17:39:53 +0000 Original-Received: from localhost ([127.0.0.1]:34496 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dbsC0-0002H1-Kn for submit@debbugs.gnu.org; Sun, 30 Jul 2017 13:39:52 -0400 Original-Received: from gateway22.websitewelcome.com ([192.185.46.233]:39137) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dbsBx-0002Gs-W9 for 22873@debbugs.gnu.org; Sun, 30 Jul 2017 13:39:50 -0400 Original-Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway22.websitewelcome.com (Postfix) with ESMTP id 7EAB514010 for <22873@debbugs.gnu.org>; Sun, 30 Jul 2017 12:39:48 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id bsBQd8cTAc72gbsBQd3GP4; Sun, 30 Jul 2017 12:39:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=+1JmwdhsNQdis9wfPVra/ezccOpuxefbHYi3b4D4y0w=; b=F+ay9fr+ZXW4HFTLF9PFSJLGHe i1pKYKfc2dfVf9NN/MPIwcGVTSE+7fWbKxJsq0J0sPIyJE5ik4hRSIXQjt5U/Es3vcgpTr82pYCg1 Ox4LNFF85Z/nWzFGg9lWNVDvtszWVZGYwiv+BgG24g41XsHas5UvIrNxQMelL+0j32KRQTFpqbzz3 oxWpuIVwG1pSEJfVbwASdHv1hL4Di+qP2ICTwTJG84VKSJgnHjuVY4QZNE46rxhkLPlxHBTfuJVq8 jswn7YutLD/Ld/ZDYt/1KPSJWq4Jb3qYTOlKOyeQXU6xGqD87aAzDmJV+EuMo8qMC1g6h5XVAXyKm 3DN/zXgg==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:50691 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from ) id 1dbsBu-000t09-J5; Sun, 30 Jul 2017 12:39:47 -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-Exim-ID: 1dbsBu-000t09-J5 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:50691 X-Source-Auth: lawlist X-Email-Count: 5 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: 208.118.235.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:135163 Archived-At: --Multipart_Sun_Jul_30_10:39:45_2017-1 Content-Type: text/plain; charset=US-ASCII VERSION: 009 - The patch applies to commit a30e7e12ed8465e2565dd318d921bc87f52ce18e from 03/28/2016. [@lawlist is unable to use the current master branch for daily workflow due to certain unrelated bugs. Until those unrelated bugs are resolved, @lawlist will continue using earlier versions of the master branch. @lawlist is tentatively thinking of moving forwards in time to October 1, 2016 bearing commit bb2ef5c6f7058b149adc9230a3db7d1fbd423c51, but testing will be needed prior thereto.] WHAT'S NEW: - `mc_store_previous_values': Recording values of the current command loop (to be compared against the previous command loop) has been consolidated into one function, which makes the modification to `xdisp.c` cleaner. - Bug Fixes: Enabling error checking when configuring the build revealed a few errors in the code that have now been corrected. It turned out that `update_window_end` is called in about 99% of the locations where multiple cursors need to be removed. A previous attempted optimization of `mc_calc` prevented cursor removal, and that bug has now been fixed. Fixed two crashes; one was caused by an improper usage of `intern_c_string`, and another was caused by attempting to remove cursors directly from `xdisp.c` instead of letting `update_window_end` do its job. TODO: - Track down the cause for the 1% of the time when multiple fake cursors are not being removed. [It may have something to do with redisplay being interrupted due to keyboard activity, or perhaps when windows/frames are changing size?] - Optimize drawing and removal of multiple fake cursors. - Implement a way to properly calculate x, y, hpos, vpos when overlays are present. The overlay after-string property wreaks havoc on the current method of calculating coordinates. - Try and motivate one or more real programmers to take over from here. ROAD MAP: - The first stage is the creation/removal of fake cursors. - The second stage will be built-in functionality similar to the multiple cursors library by Magnar Sveen. INSTALLATION: - STEP #1 (clone master branch): git clone -b master git://git.sv.gnu.org/emacs.git - STEP #2: cd over to the root of the `emacs` source directory cloned in the first step above. - STEP #3 (hard reset): git reset --hard a30e7e12ed8465e2565dd318d921bc87f52ce18e The following message is displayed in the terminal: "HEAD is now at a30e7e1 Mention the `M-q' changes" - STEP #4 (put the patch in place): Copy the latest patch (multiple_cursors_008.diff) to the root of the emacs source directory cloned in the first step above. - STEP #5 (apply the patch): git apply multiple_cursors_009.diff - STEP #6: ./autogen.sh - STEP #7: Configure the build for X, MS Windows, or OSX; e.g.,: ./configure --with-ns - STEP #8: make - STEP #9: make install - STEP #10: Launch the newly built Emacs, and copy the following function to the `*scratch*` buffer, and type `M-x mc-test`. (defun mc-test () "Draw fake cursors at all POS defined in the `mc-list'. Multiple fake cursors are supported by GUI versions of Emacs built for X, Windows and OSX. Popular forms of specifying colors such as \"red\" and \"#FF0000\" are now supported, as well as LSL color vectors such as [1.0 0.0 0.0]. For those users who choose the former familiar methods of specifying colors with strings, `mc_color_vector_calculate' will convert those strings to LSL color vectors. The color vectors are commonly referred to as LSL (The Linden Scripting Language). `nsterm.m' uses `NSColor', which works well with LSL. `w32term.c' uses `PALETTERGB' or `RGB', and the conversion from LSL is done internally by multiplying each element of the LSL color vector by 255. `xterm.c' uses `x_make_truecolor_pixel', which uses 16-bit RGB -- the conversion from LSL happens internally by multiplying each element of the LSL color vector by 65535." (interactive) (let ((buffer (get-buffer-create "*MC-TEST*"))) (with-current-buffer buffer (erase-buffer) (insert "This is a test!") (setq mc-list '((1 "hbar" "red") (2 "bar" "yellow") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0])))) (select-window (display-buffer buffer)) ;;; The trigger in `keyboard.c` is not activated in this example, so we ;;; Force the multiple cursors to be drawn. (mc-draw-erase (selected-window))))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NfbGlzdCkpCisgICAgICAgICAgICAg IHx8ICghTklMUCAody0+bWNfY2FjaGUpICYmIChFUSAody0+Y29udGVudHMsIFhDQVIgKEZudGgg KG1ha2VfbnVtYmVyICgyKSwgdy0+bWNfY2FjaGUpKSkpKSkKKyAgICAgICAgICAmJiAhTUlOSV9X SU5ET1dfUCAodykpCisgICAgICAgIHsKKyAgICAgICAgICAvKiBSZW1vdmUgZmFrZSBjdXJzb3Jz LiAgKi8KKyAgICAgICAgICBpZiAoKCFOSUxQICh3LT5tY19jYWNoZSkgJiYgKEVRICh3LT5jb250 ZW50cywgWENBUiAoRm50aCAobWFrZV9udW1iZXIgKDIpLCB3LT5tY19jYWNoZSkpKSkpKQorICAg ICAgICAgICAgbWNfY2FsYyAodywgMSk7CisgICAgICAgICAgLyogRHJhdyBmYWtlIGN1cnNvcnMg ICovCisgICAgICAgICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1j X2xpc3QpKSkKKyAgICAgICAgICAgIG1jX2NhbGMgKHcsIDApOworICAgICAgICB9CisKKyAgICAg IC8qIEZpcnN0IGF0dGVtcHQgYXQgZGVhbGluZyB3aXRoIGEgYHJlZGlzcGxheV9wcmVzZXJ2ZV9l Y2hvX2FyZWEnIHNpdHVhdGlvbi4gICovCisgICAgICBpZiAoIXctPm1jLmRyYXdfZXJhc2UKKyAg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19saXN0KSkK KyAgICAgICAgICAmJiAhTklMUCAody0+bWNfY2FjaGUpCisgICAgICAgICAgJiYgKEVRICh3LT5j b250ZW50cywgWENBUiAoRm50aCAobWFrZV9udW1iZXIgKDIpLCB3LT5tY19jYWNoZSkpKSkKKyAg ICAgICAgICAmJiAhTUlOSV9XSU5ET1dfUCAodykpCisgICAgICAgIHsKKyAgICAgICAgICAvKiBS ZW1vdmUgZmFrZSBjdXJzb3JzLiAgKi8KKyAgICAgICAgICBt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YWwgPSBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbDsKKyAg ICAgICAgICBpbnQgaW50X3JlZCA9IHJlZCAqIDI1NTsKKyAgICAgICAgICBpbnQgaW50X2dyZWVu ID0gZ3JlZW4gKiAyNTU7CisgICAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDI1NTsKKyAg ICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IFBBTEVUVEVSR0IgKGlu dF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOworICAgICAgICAgIHhfZHJhd19ob2xsb3dfY3Vy c29yICh3LCBnbHlwaF9yb3cpOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29y X3BpeGVsID0gb3JpZ192YWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHhf ZHJhd19ob2xsb3dfY3Vyc29yICh3LCBnbHlwaF9yb3cpOworICAgICAgYnJlYWs7CisgICAgfQor ICAgIGNhc2UgRklMTEVEX0JPWF9DVVJTT1I6CisgICAgeworICAgICAgLyogVE9ETzogIGtkYiB0 byBjb25zaWRlciBhZGRpbmcgc3VwcG9ydCBmb3IgbXVsdGlwbGUgY3Vyc29yIGZvcmVncm91bmQK KyAgICAgIGN1c3RvbWl6YXRpb24gb2YgYSBGSUxMRURfQk9YX0NVUlNPUi4gICovCisgICAgICBp ZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVuID49IDApCisgICAgICAgIC8qIFRlbXBv cmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MnIGJ5IGJvcnJvd2lu ZyB0aGUKKyAgICAgICAgZnVuY3Rpb25hbGl0eSBvZiBgeF9tYWtlX2djJyBpbiB3MzJmbnMuYy4g ICovCisgICAgICAgIHsKKyAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICBMaXNw X09iam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X2djID0gdHJ1ZScsIGZvcmNlIGB4X3NldF9j dXJzb3JfZ2MnIHRvCisgICAgICAgICAgdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS53MzItPmN1cnNv cl9nYycuICAqLworICAgICAgICAgIHctPm1jLnNldF9jdXJzb3JfZ2MgPSB0cnVlOworICAgICAg ICAgIGRyYXdfcGh5c19jdXJzb3JfZ2x5cGggKHcsIGdseXBoX3JvdywgRFJBV19DVVJTT1IpOwor ICAgICAgICAgIHctPm1jLnNldF9jdXJzb3JfZ2MgPSBmYWxzZTsKKyAgICAgICAgICBnY192YWx1 ZXMuZm9udCA9IEZSQU1FX0ZPTlQgKGYpOworICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3JvdW5k ID0gb3JpZ192YWxfYTsKKyAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IG9yaWdfdmFs X2I7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MKKyAgICAgICAgICAg ID0gWENyZWF0ZUdDIChOVUxMLCBGUkFNRV9XMzJfV0lORE9XIChmKSwgbWFzaywgJmdjX3ZhbHVl cyk7CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgfQorICAgICAgICBlbHNl CisgICAgICAgICAgZHJhd19waHlzX2N1cnNvcl9nbHlwaCAodywgZ2x5cGhfcm93LCBEUkFXX0NV UlNPUik7CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBCQVJfQ1VSU09SOgorICAgIHsK KyAgICAgIGlmIChyZWQgPj0gMCAmJiBibHVlID49IDAgJiYgZ3JlZW4gPj0gMCkKKyAgICAgICAg LyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcu ICAqLworICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5E T1dfRlJBTUUgKHcpKTsKKyAgICAgICAgICBDT0xPUlJFRiBvcmlnX3ZhbCA9IGYtPm91dHB1dF9k YXRhLnczMi0+Y3Vyc29yX3BpeGVsOworICAgICAgICAgIGludCBpbnRfcmVkID0gcmVkICogMjU1 OworICAgICAgICAgIGludCBpbnRfZ3JlZW4gPSBncmVlbiAqIDI1NTsKKyAgICAgICAgICBpbnQg aW50X2JsdWUgPSBibHVlICogMjU1OworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vy c29yX3BpeGVsID0gUEFMRVRURVJHQiAoaW50X3JlZCwgaW50X2dyZWVuLCBpbnRfYmx1ZSk7Cisg ICAgICAgICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRoLCBC QVJfQ1VSU09SKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9 IG9yaWdfdmFsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB4X2RyYXdfYmFy X2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEJBUl9DVVJTT1IpOworICAgICAg YnJlYWs7CisgICAgfQorICAgIGNhc2UgSEJBUl9DVVJTT1I6CisgICAgeworICAgICAgaWYgKHJl ZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBncmVlbiA+PSAwKQorICAgICAgICAvKiBUZW1wb3Jhcmls eSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAg IHsKKyAgICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykp OworICAgICAgICAgIENPTE9SUkVGIG9yaWdfdmFsID0gZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJz b3JfcGl4ZWw7CisgICAgICAgICAgaW50IGludF9yZWQgPSByZWQgKiAyNTU7CisgICAgICAgICAg aW50IGludF9ncmVlbi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c3RyaW5ncyB0byBMU0wgY29sb3IgdmVjdG9ycy4KK1RoZSBjb2xvciB2 ZWN0b3JzIGFyZSBjb21tb25seSByZWZlcnJlZCB0byBhcyBMU0wgKFRoZSBMaW5kZW4gU2NyaXB0 aW5nIExhbmd1YWdlKS4KK2Buc3Rlcm0ubScgdXNlcyBgTlNDb2xvcicsIHdoaWNoIHdvcmtzIHdl bGwgd2l0aCBMU0wuICBgdzMydGVybS5jJyB1c2VzCitgUEFMRVRURVJHQicgb3IgYFJHQicsIGFu ZCB0aGUgY29udmVyc2lvbiBmcm9tIExTTCBpcyBkb25lIGludGVybmFsbHkgYnkKK211bHRpcGx5 aW5nIGVhY2ggZWxlbWVudCBvZiB0aGUgTFNMIGNvbG9yIHZlY3RvciBieSAyNTUuICBgeHRlcm0u YycgdXNlcworYHhfbWFrZV90cnVlY29sb3JfcGl4ZWwnLCB3aGljaCB1c2VzIDE2LWJpdCBSR0Ig LS0gdGhlIGNvbnZlcnNpb24gZnJvbSBMU0wKK2hhcHBlbnMgaW50ZXJuYWxseSBieSBtdWx0aXBs eWluZyBlYWNoIGVsZW1lbnQgb2YgdGhlIExTTCBjb2xvciB2ZWN0b3IgYnkgNjU1MzUuIgorKGlu dGVyYWN0aXZlKQorICAobGV0ICgoYnVmZmVyIChnZXQtYnVmZmVyLWNyZWF0ZSAiKk1DLVRFU1Qq IikpKQorICAgIChsYXdsaXN0LXdpdGgtY3VycmVudC1idWZmZXIgYnVmZmVyCisgICAgICAoZXJh c2UtYnVmZmVyKQorICAgICAgKGluc2VydCAiVGhpcyBpcyBhIHRlc3QhIikKKyAgICAgIChzZXRx IG1jLWxpc3QgJygoMSAiaGJhciIgIm1hZ2VudGEiKQorICAgICAgICAgICAgICAgICAgICAgICgy ICJiYXIiICJwdXJwbGUiKQorICAgICAgICAgICAgICAgICAgICAgICgzICJib3giICIjMDBGRjAw IikKKyAgICAgICAgICAgICAgICAgICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAg ICAgICAgICAgICAgICAgKDUgKCJoYmFyIiAzKSBbMS4wIDAuMCAxLjBdKQorICAgICAgICAgICAg ICAgICAgICAgICg2ICgiYmFyIiAzKSBbMC4wIDEuMCAxLjBdKSkpKQorICAgIChzZWxlY3Qtd2lu ZG93IChsYXdsaXN0LWRpc3BsYXktYnVmZmVyIGJ1ZmZlcikpCisgICAgOzs7IFRoZSB0cmlnZ2Vy IGluIGBrZXlib2FyZC5jYCBpcyBub3QgYWN0aXZhdGVkIGluIHRoaXMgZXhhbXBsZSwgc28gd2UK KyAgICA7OzsgZm9yY2UgdGhlIG11bHRpcGxlIGN1cnNvcnMgdG8gYmUgZHJhd24uCisgICAgKG1j LWRyYXctZXJhc2UgKHNlbGVjdGVkLXdpbmRvdykpKSkKKworKGRlZnVuIGN1cnNvci1vbiAoKQor KGludGVyYWN0aXZlKQorICAobGV0KiAoCisgICAgICAod2luZG93IChzZWxlY3RlZC13aW5kb3cp KQorICAgICAgKHBvc24gKHBvc24tYXQtcG9pbnQgKDEtIChwb2ludCkpKSkKKyAgICAgIChudGgt MiAobnRoIDIgcG9zbikpCisgICAgICAoeCAoY2FyIG50aC0yKSkKKyAgICAgICh5IChjZHIgbnRo LTIpKQorICAgICAgKG50aC02IChudGggNiBwb3NuKSkKKyAgICAgIChocG9zIChjYXIgbnRoLTYp KQorICAgICAgKHZwb3MgKGNkciBudGgtNikpCisgICAgICAoeC15LWhwb3MtdnBvcyAobGlzdCB4 IHkgaHBvcyB2cG9zKSkKKyAgICAgIChjdXJzb3ItdHlwZSAiYm94IikKKyAgICAgIChjdXJzb3It d2lkdGggMSkKKyAgICAgIChjb2xvci12ZWN0b3IgWzEuMCAwLjAgMS4wXSkgKQorICAgIChtYy1k cmF3LWZuIHdpbmRvdyB4LXktaHBvcy12cG9zIGN1cnNvci10eXBlIGN1cnNvci13aWR0aCBjb2xv ci12ZWN0b3IpKSkKKworKGRlZnVuIGN1cnNvci1vZmYgKCkKKyhpbnRlcmFjdGl2ZSkKKyAgKGxl dCogKAorICAgICAgKHdpbmRvdyAoc2VsZWN0ZWQtd2luZG93KSkKKyAgICAgIChwb3NuIChwb3Nu LWF0LXBvaW50ICgxLSAocG9pbnQpKSkpCisgICAgICAobnRoLTIgKG50aCAyIHBvc24pKQorICAg ICAgKHggKGNhciBudGgtMikpCisgICAgICAoeSAoY2RyIG50aC0yKSkKKyAgICAgIChudGgtNiAo bnRoIDYgcG9zbikpCisgICAgICAoaHBvcyAoY2FyIG50aC02KSkKKyAgICAgICh2cG9zIChjZHIg bnRoLTYpKQorICAgICAgKHgteS1ocG9zLXZwb3MgKGxpc3QgeCB5IGhwb3MgdnBvcykpCisgICAg ICAoY3Vyc29yLXR5cGUgImJveCIpCisgICAgICAoY3Vyc29yLXdpZHRoIDEpKQorICAgIChtYy1l cmFzZS1mbiB3aW5kb3cgeC15LWhwb3MtdnBvcyBjdXJzb3ItdHlwZSBjdXJzb3Itd2lkdGgpKSkK KworKGRlZnVuIHgteS1ocG9zLXZwb3MgKCkKKyJEZXNjcmliZSBjb29yZGluYXRlcywgdHlwZSwg ZGlzcGxheSBhbmQgYWZ0ZXItc3RyaW5nLiIKKyhpbnRlcmFjdGl2ZSkKKyAgKGxldCogKAorICAg ICAgKHBvc2ludCAocG9pbnQpKQorICAgICAgKHdpbiAoc2VsZWN0ZWQtd2luZG93KSkKKyAgICAg IChzdGFydCAod2luZG93LXN0YXJ0IHdpbikpCisgICAgICAoZW5kICh3aW5kb3ctZW5kIHdpbiB0 KSkKKyAgICAgIChyZXN1bHQgKG1jLXgteS1ocG9zLXZwb3MtZm4gd2luIHBvc2ludCBzdGFydCBl bmQpKSApCisgICAgKG1lc3NhZ2UgIngveS9ocG9zL3Zwb3M6ICAlcyIgcmVzdWx0KSkpCisKKyhk ZWZ1biBwcmludC1tYy1jYWNoZSAoKQorKGludGVyYWN0aXZlKQorICAobWVzc2FnZSAiJXMiICht Yy1jYWNoZS1mbikpKQorCisoZ2xvYmFsLXNldC1rZXkgW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PSBmYWxzZTsKKyAgaWYgKHBvc2ludCA+ PSBzdGFydAorICAgICAgJiYgcG9zaW50IDw9IGVuZCkKKyAgICB7CisgICAgICBvdmVybGF5cyA9 IEZvdmVybGF5c19pbiAobWFrZV9udW1iZXIgKHBvc2ludCksIChtYWtlX251bWJlciAocG9zaW50 ICsgMSkpKTsKKyAgICAgIGlmICghTklMUCAob3ZlcmxheXMpKQorICAgICAgICB7CisgICAgICAg ICAgZm9yIChvdl9saXN0ID0gb3ZlcmxheXM7CisgICAgICAgICAgICAgICBDT05TUCAob3ZfbGlz dCk7CisgICAgICAgICAgICAgICBvdl9saXN0ID0gWENEUiAob3ZfbGlzdCkpCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIG92ID0gWENBUiAob3ZfbGlzdCk7CisgICAgICAgICAgICAgIG92 X3F1ZXJ5X3R5cGUgPSBGb3ZlcmxheV9nZXQgKG92LCBvdl90eXBlKTsKKyAgICAgICAgICAgICAg b3ZfcXVlcnlfZGlzcGxheSA9IEZvdmVybGF5X2dldCAob3YsIFFkaXNwbGF5KTsKKyAgICAgICAg ICAgICAgb3ZfcXVlcnlfYWZ0ZXJfc3RyaW5nID0gRm92ZXJsYXlfZ2V0IChvdiwgUWFmdGVyX3N0 cmluZyk7CisgICAgICAgICAgICAgIGlmIChFUSAob3ZfcXVlcnlfdHlwZSwgb3ZfY29sX2Vvdmwp KQorICAgICAgICAgICAgICAgIG92X2ZvdW5kX3R5cGVfY29sZW92bCA9IHRydWU7CisgICAgICAg ICAgICAgIGlmIChFUSAob3ZfcXVlcnlfdHlwZSwgb3ZfcmlnaHRfZnJpbmdlKSkKKyAgICAgICAg ICAgICAgICBvdl9mb3VuZF90eXBlX3JpZ2h0ZnJpbmdlID0gdHJ1ZTsKKyAgICAgICAgICAgICAg aWYgKCFOSUxQIChvdl9xdWVyeV9hZnRlcl9zdHJpbmcpKQorICAgICAgICAgICAgICAgIG92X2Zv dW5kX2FmdGVyc3RyaW5nID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAg U0VUX1RFWFRfUE9TX0ZST01fTUFSS0VSIChwdCwgdy0+c3RhcnQpOworICAgICAgc3RhcnRfZGlz cGxheSAoJml0LCB3LCBwdCk7CisgICAgICBtb3ZlX2l0X3RvICgmaXQsIHBvc2ludCwgLTEsIC0x LCAtMSwgTU9WRV9UT19QT1MpOworICAgICAgeSA9IGl0LmN1cnJlbnRfeTsKKyAgICAgIHZwb3Mg PSBpdC52cG9zOworICAgICAgaWYgKG92X2ZvdW5kX3R5cGVfY29sZW92bCkKKyAgICAgICAgewor ICAgICAgICAgIFRFTVBfU0VUX1BUX0JPVEggKENIQVJQT1MgKGl0LmN1cnJlbnQucG9zKSwgQllU RVBPUyAoaXQuY3VycmVudC5wb3MpKTsKKyAgICAgICAgICBwZW92bF9jb2wgPSBjdXJyZW50X2Nv bHVtbiAoKSAtIDE7CisgICAgICAgICAgbW92ZV9pdF9ieV9saW5lcyAoJml0LCAtMSk7CisgICAg ICAgICAgVEVNUF9TRVRfUFRfQk9USCAoQ0hBUlBPUyAoaXQuY3VycmVudC5wb3MpLCBCWVRFUE9T IChpdC5jdXJyZW50LnBvcykpOworICAgICAgICAgIHBib3ZsX2NvbCA9IGN1cnJlbnRfY29sdW1u ICgpOworICAgICAgICAgIGNvbF9lb3ZsID0gcGVvdmxfY29sIC0gcGJvdmxfY29sOworICAgICAg ICAgIHggPSBjb2xfZW92bCAqIGZyYW1lX2NoYXJfd2lkdGg7CisgICAgICAgICAgaHBvcyA9IGNv bF9lb3ZsOworICAgICAgICAgIFRFTVBfU0VUX1BUX0JPVEggKG9wb2ludCwgb2J5dGVwb3MpOwor ICAgICAgICB9CisgICAgICAgIC8qIFNwZWNpYWwgaGFuZGxpbmcgZm9yIGBhZnRlci1zdHJpbmcn IGFuZCBlb2Igc2l0dWF0aW9ucy4gICovCisgICAgICAgIGVsc2UgaWYgKG92X2ZvdW5kX2FmdGVy c3RyaW5nCisgICAgICAgICAgICAgICAgIHx8IEZFVENIX0JZVEUgKElUX0JZVEVQT1MgKGl0KSkg PT0gJ1xuJworICAgICAgICAgICAgICAgICB8fCBwb3NpbnQgPT0gWlYpCisgICAgICAgICAgewor ICAgICAgICAgICAgVEVNUF9TRVRfUFRfQk9USCAoQ0hBUlBPUyAoaXQuY3VycmVudC5wb3MpLCBC WVRFUE9TIChpdC5jdXJyZW50LnBvcykpOworICAgICAgICAgICAgcGVvdmxfY29sID0gY3VycmVu dF9jb2x1bW4gKCk7CisgICAgICAgICAgICAvKiBEVlBPUyA9PSAwIG1lYW5zIG1vdmUgdG8gdGhl IHN0YXJ0IG9mIHRoZSBzY3JlZW4gbGluZS4gICovCisgICAgICAgICAgICBtb3ZlX2l0X2J5X2xp bmVzICgmaXQsIDApOworICAgICAgICAgICAgVEVNUF9TRVRfUFRfQk9USCAoQ0hBUlBPUyAoaXQu Y3VycmVudC5wb3MpLCBCWVRFUE9TIChpdC5jdXJyZW50LnBvcykpOworICAgICAgICAgICAgcGJv dmxfY29sID0gY3VycmVudF9jb2x1bW4gKCk7CisgICAgICAgICAgICBjb2xfZW92bCA9IHBlb3Zs X2NvbCAtIHBib3ZsX2NvbDsKKyAgICAgICAgICAgIHggPSBjb2xfZW92bCAqIGZyYW1lX2NoYXJf d2lkdGg7CisgICAgICAgICAgICBocG9zID0gY29sX2Vvdmw7CisgICAgICAgICAgICBURU1QX1NF VF9QVF9CT1RIIChvcG9pbnQsIG9ieXRlcG9zKTsKKyAgICAgICAgICB9CisgICAgICAgICAgZWxz ZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICB4ID0gaXQuY3VycmVudF94OworICAgICAg ICAgICAgICBocG9zID0gaXQuaHBvczsKKyAgICAgICAgICAgIH0KKyAgICAgIGJpZGlfdW5zaGVs dmVfY2FjaGUgKGl0ZGF0YSwgZmFsc2UpOworICAgIH0KKyAgICBlbHNlCisgICAgICB7CisgICAg ICAgIHggPSAtMTsKKyAgICAgICAgeSA9IC0xOworICAgIC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fZXJhc2UpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAody0+bWMuc3RhcnQpCisg ICAgICAgICAgICB7CisgICAgICAgICAgICAgIHctPm1jLnByZXZfc3RhcnQgPSB3LT5tYy5zdGFy dDsKKyAgICAgICAgICAgICAgeF95X2hwb3NfdnBvcyA9IEZudGggKG1ha2VfbnVtYmVyICgwKSwg bWNfeF95X2hwb3NfdnBvcyAodywgdy0+bWMucHJldl9zdGFydCwgc3RhcnQsIGVuZCkpOworICAg ICAgICAgICAgICB3LT5tYy5wcmV2X3N0YXJ0X3ggPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAo MCksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICAgICAgdy0+bWMucHJldl9zdGFydF95ID0g WElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAg ICAgIHctPm1jLnByZXZfc3RhcnRfaHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwg eF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAgICB3LT5tYy5wcmV2X3N0YXJ0X3Zwb3MgPSBY SU5UIChGbnRoIChtYWtlX251bWJlciAoMyksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHct Pm1jLnByZXZfc3RhcnQgPSAtMTsKKyAgICAgICAgICAgICAgICB3LT5tYy5wcmV2X3N0YXJ0X3gg PSAtMTsKKyAgICAgICAgICAgICAgICB3LT5tYy5wcmV2X3N0YXJ0X3kgPSAtMTsKKyAgICAgICAg ICAgICAgICB3LT5tYy5wcmV2X3N0YXJ0X2hwb3MgPSAtMTsKKyAgICAgICAgICAgICAgICB3LT5t Yy5wcmV2X3N0YXJ0X3Zwb3MgPSAtMTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIGlmICh3 LT5tYy5lbmQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHctPm1jLnByZXZfZW5kID0g dy0+bWMuZW5kOworICAgICAgICAgICAgICAvKiBlb2IgSVMgdmlzaWJsZS4KKyAgICAgICAgICAg ICAgRXhjbHVkZXMgYSBzaXR1YXRpb24gd2hlbiBsYXN0IHZpc2libGUgbGluZSBhdCBib3R0b20g b2Ygd2luZG93IGNvbnRhaW5zIGVvYi4gICovCisgICAgICAgICAgICAgIGlmICh3LT5tYy5wcmV2 X2VuZCA9PSBlbmQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgeF95X2hw b3NfdnBvcyA9IEZudGggKG1ha2VfbnVtYmVyICgwKSwgbWNfeF95X2hwb3NfdnBvcyAodywgdy0+ bWMucHJldl9lbmQsIHN0YXJ0LCBlbmQpKTsKKyAgICAgICAgICAgICAgICAgIHctPm1jLnByZXZf ZW5kX3ggPSB3LT5tYy5lbmRfeDsKKyAgICAgICAgICAgICAgICAgIHctPm1jLnByZXZfZW5kX3kg PSB3LT5tYy5lbmRfeTsKKyAgICAgICAgICAgICAgICAgIHctPm1jLnByZXZfZW5kX2hwb3MgPSB3 LT5tYy5lbmRfaHBvczsKKyAgICAgICAgICAgICAgICAgIHctPm1jLnByZXZfZW5kX3Zwb3MgPSB3 LT5tYy5lbmRfdnBvczsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLyogZW9i IGlzIE5PVCB2aXNpYmxlLgorICAgICAgICAgICAgICAgIEV4Y2x1ZGVzIGEgc2l0dWF0aW9uIHdo ZW4gbGFzdCB2aXNpYmxlIGxpbmUgYXQgYm90dG9tIG9mIHdpbmRvdyBjb250YWlucyBlb2IuICAq Ki8KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAgIHhfeV9ocG9zX3Zwb3MgPSBGbnRoIChtYWtlX251bWJlciAoMCksIG1jX3hfeV9o cG9zX3Zwb3MgKHcsIHctPm1jLnByZXZfZW5kLCBzdGFydCwgZW5kKSk7CisgICAgICAgICAgICAg ICAgICAgIHctPm1jLnByZXZfZW5kX3ggPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIHhf eV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICAgICAgICAgICAgdy0+bWMucHJldl9lbmRfeSA9IFhJ TlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAg ICAgICAgICB3LT5tYy5wcmV2X2VuZF9ocG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDIp LCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAgICAgICAgICAgIHctPm1jLnByZXZfZW5kX3Zw b3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMyksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgIHctPm1jLnByZXZfZW5kID0gLTE7CisgICAgICAgICAg ICAgICAgdy0+bWMucHJldl9lbmRfeCA9IC0xOworICAgICAgICAgICAgICAgIHctPm1jLnByZXZf ZW5kX3kgPSAtMTsKKyAgICAgICAgICAgICAgICB3LT5tYy5wcmV2X2VuZF9ocG9zID0gLTE7Cisg ICAgICAgICAgICAgICAgdy0+bWMucHJldl9lbmRfdnBvcyA9IC0xOworICAgICAgICAgICAgICB9 CisgICAgICAgICAgaWYgKHctPm1jLm9wb2ludCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgdy0+bWMucHJldl9vcG9pbnQgPSB3LT5tYy5vcG9pbnQ7CisgICAgICAgICAgICAgIHctPm1j LnByZXZfb3BvaW50X3ggPSB3LT5tYy5vcG9pbnRfeDsKKyAgICAgICAgICAgICAgdy0+bWMucHJl dl9vcG9pbnRfeSA9IHctPm1jLm9wb2ludF95OworICAgICAgICAgICAgICB3LT5tYy5wcmV2X29w b2ludF9ocG9zID0gdy0+bWMub3BvaW50X2hwb3M7CisgICAgICAgICAgICAgIHctPm1jLnByZXZf b3BvaW50X3Zwb3MgPSB3LT5tYy5vcG9pbnRfdnBvczsKKyAgICAgICAgICAgIH0KKyAgICAgICAg ICB3LT5tYy5vcG9pbnQgPSBQVDsKKyAgICAgICAgICB4X3lfaHBvc192cG9zID0gRm50aCAobWFr ZV9udW1iZXIgKDApLCBtY194X3lfaHBvc192cG9zICh3LCB3LT5tYy5vcG9pbnQsIHN0YXJ0LCBl bmQpKTsKKyAgICAgICAgICB3LT5tYy5vcG9pbnRfeCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVy ICgwKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgIHctPm1jLm9wb2ludF95ID0gWElOVCAo Rm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAgdy0+bWMu b3BvaW50X2hwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMiksIHhfeV9ocG9zX3Zwb3Mp KTsKKyAgICAgICAgICB3LT5tYy5vcG9pbnRfdnBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVy ICgzKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgIHctPm1jLnN0YXJ0ID0gc3RhcnQ7Cisg ICAgICAgICAgeF95X2hwb3NfdnBvcyA9IEZudGggKG1ha2VfbnVtYmVyICgwKSwgbWNfeF95X2hw b3NfdnBvcyAodywgc3RhcnQsIHN0YXJ0LCBlbmQpKTsKKyAgICAgICAgICB3LT5tYy5zdGFydF94 ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAg ICAgdy0+bWMuc3RhcnRfeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3Nf dnBvcykpOworICAgICAgICAgIHctPm1jLnN0YXJ0X2hwb3MgPSBYSU5UIChGbnRoIChtYWtlX251 bWJlciAoMiksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICB3LT5tYy5zdGFydF92cG9zID0g WElOVCAoRm50aCAobWFrZV9udW1iZXIgKDMpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAg dy0+bWMuZW5kID0gZW5kOworICAgICAgICAgIHhfeV9ocG9zX3Zwb3MgPSBGbnRoIChtYWtlX251 bWJlciAoMCksIG1jX3hfeV9ocG9zX3Zwb3MgKHcsIGVuZCwgc3RhcnQsIGVuZCkpOworICAgICAg ICAgIHctPm1jLmVuZF94ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192 cG9zKSk7CisgICAgICAgICAgdy0+bWMuZW5kX3kgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAo MSksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICB3LT5tYy5lbmRfaHBvcyA9IFhJTlQgKEZu dGggKG1ha2VfbnVtYmVyICgyKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgIHctPm1jLmVu ZF92cG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDMpLCB4X3lfaHBvc192cG9zKSk7Cisg ICAgICAgICAgLyogU3RhcnQgcmVtYWlucyB0aGUgc2FtZS4gICovCisgICAgICAgICAgaWYgKHct Pm1jLnByZXZfc3RhcnRfdnBvcyA9PSB3LT5tYy5zdGFydF92cG9zCisgICAgICAgICAgICAgIHx8 IHctPm1jLnByZXZfZW5kIDwgdy0+bWMuc3RhcnQpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIHctPm1jLnlfZGlmZiA9IDA7CisgICAgICAgICAgICAgIHctPm1jLnZwb3NfZGlmZiA9IDA7 CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvKiBTY3JlZW4gbW92ZWQg4pa8IC0tIGUuZy4s IGBwcmV2aW91cy1saW5lJywgYHNjcm9sbC1kb3duJy4gICovCisgICAgICAgICAgICBlbHNlIGlm ICh3LT5tYy5wcmV2X3N0YXJ0X3Zwb3MgPiAwKQorICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgdy0+bWMueV9kaWZmID0gKHctPm1jLnByZXZfc3RhcnRfeSAtIHctPm1jLnN0YXJ0X3kp ICogLTE7CisgICAgICAgICAgICAgICAgdy0+bWMudnBvc19kaWZmID0gKHctPm1jLnByZXZfc3Rh cnRfdnBvcyAtIHctPm1jLnN0YXJ0X3Zwb3MpICogLTE7CisgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgICAgLyogU2NyZWVuIG1vdmVkIOKWsiAoZW9iIE5PVCB2aXNpYmxlKSAtLSBlLmcuLCBg bmV4dC1saW5lJywgYHNjcm9sbC11cCcuICAqLworICAgICAgICAgICAgICBlbHNlIGlmICh3LT5t Yy5lbmRfdnBvcyA+IHctPm1jLnByZXZfZW5kX3Zwb3MgJiYgdy0+bWMucHJldl9lbmQgIT0gLTEp CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgdy0+bWMueV9kaWZmID0gdy0+ bWMuZW5kX3kgLSB3LT5tYy5wcmV2X2VuZF95OworICAgICAgICAgICAgICAgICAgdy0+bWMudnBv c19kaWZmID0gdy0+bWMuZW5kX3Zwb3MgLSB3LT5tYy5wcmV2X2VuZF92cG9zOworICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICAvKiBTY3JlZW4gbW92ZWQg4payIChlb2IgSVMgdmlz aWJsZSkgLS0gZS5nLiwgYG5leHQtbGluZScsIGBzY3JvbGwtdXAnLiAgKi8KKyAgICAgICAgICAg ICAgICBlbHNlIGlmICh3LT5tYy5lbmRfdnBvcyA8IHctPm1jLnByZXZfZW5kX3Zwb3MgJiYgdy0+ bWMucHJldl9lbmQgIT0gLTEpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgIHctPm1jLnlfZGlmZiA9IHctPm1jLnByZXZfZW5kX3kgLSB3LT5tYy5lbmRfeTsKKyAgICAg ICAgICAgICAgICAgICAgdy0+bWMudnBvc19kaWZmID0gdy0+bWMucHJldl9lbmRfdnBvcyAtIHct Pm1jLmVuZF92cG9zOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgLyog U2NyZWVuIG1vdmVkIOKWsiAoZW9iIGp1c3QgYmVjYW1lIHZpc2libGUpIC0tIGUuZy4sIGBuZXh0 LWxpbmUnLCBgc2Nyb2xsLXVwJy4KKyAgICAgICAgICAgICAgICAgIEFic2VudCBzdWJ0cmFjdGlu ZyAxIGZyb20gdy0+bWMucHJldl9lbmQsIHRoYXQgcG9pbnQgYW5kIHRoZSBuZXcgdy0+bWMuZW5k IGFyZQorICAgICAgICAgICAgICAgICAgb24gdGhlIHNhbWUgbGluZSBhbmQgaXQgYXBwZWFycyB0 aGF0IG5vdGhpbmcgaGFzIGNoYW5nZWQgLS0gdy0+bWMucHJldl9lbmQgaXMKKyAgICAgICAgICAg ICAgICAgIG9uIHRoZSBmYXIgbGVmdCBvZiB0aGUgbGluZSBhbmQgdy0+bWMuZW5kIGlzIG9uIHRo ZSBmYXIgcmlnaHQgb2YgdGhlIGxpbmUuICAqLworICAgICAgICAgICAgICAgICAgZWxzZSBpZiAo dy0+bWMuZW5kX3Zwb3MgPT0gdy0+bWMucHJldl9lbmRfdnBvcykKKyAgICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICAgIHhfeV9ocG9zX3Zwb3MgPSBGbnRoIChtYWtlX251 bWJlciAoMCksIG1jX3hfeV9ocG9zX3Zwb3MgKHcsIHctPm1jLnByZXZfZW5kIC0gMSwgc3RhcnQs IGVuZCkpOworICAgICAgICAgICAgICAgICAgICAgIHctPm1jLnByZXZfZW5kX3ggPSBYSU5UIChG bnRoIChtYWtlX251bWJlciAoMCksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICAgICAgICAg ICAgICB3LT5tYy5wcmV2X2VuZF95ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lf aHBvc192cG9zKSk7CisgICAgICAgICAgICAgICAgICAgICAgdy0+bWMucHJldl9lbmRfaHBvcyA9 IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAg ICAgICAgICAgICAgIHctPm1jLnByZXZfZW5kX3Zwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJl ciAoMyksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICAgICAgICAgICAgICB3LT5tYy55X2Rp ZmYgPSB3LT5tYy5lbmRfeSAtIHctPm1jLnByZXZfZW5kX3k7CisgICAgICAgICAgICAgICAgICAg ICAgdy0+bWMudnBvc19kaWZmID0gdy0+bWMuZW5kX3Zwb3MgLSB3LT5tYy5wcmV2X2VuZF92cG9z OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLyogYG1jLWxpc3RgIGhh cyBqdXN0IGJlZW4gaW5pdGlhbGl6ZWQgLS0gcHJldmlvdXMgc3RhcnQvZW5kIGFyZSBzZXQgdG8g LTEuICAqLworICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh3LT5tYy5wcmV2X2VuZCA9PSAt MSkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICB3LT5t Yy55X2RpZmYgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgdy0+bWMudnBvc19kaWZmID0g MDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKHctPm1jLnlfZGlmZiA8 IDApCisgICAgICAgICAgICB3LT5tYy55X2RpZmYgPSBhYnMgKHctPm1jLnlfZGlmZik7CisgICAg ICAgICAgICBlbHNlIGlmICh3LT5tYy55X2RpZmYgPiAwKQorICAgICAgICAgICAgICB3LT5tYy55 X2RpZmYgPSB3LT5tYy55X2RpZmYgKiAtMTsKKyAgICAgICAgICBpZiAody0+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Fi bGVkX3ApCisgICAgICAgIGN1cnNvcl9nbHlwaCA9IE5VTEw7CisgICAgICBpZiAody0+aHNjcm9s bCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFdoZW4gdGhlIHdpbmRvdyBpcyBoc2Nyb2xsZWQs IGN1cnNvciBocG9zIGNhbiBsZWdpdGltYXRlbHkgYmUKKyAgICAgICAgICAgb3V0IG9mIGJvdW5k cywgYnV0IHdlIGRyYXcgdGhlIGN1cnNvciBhdCB0aGUgY29ycmVzcG9uZGluZworICAgICAgICAg ICB3aW5kb3cgbWFyZ2luIGluIHRoYXQgY2FzZS4gICovCisgICAgICAgICAgaWYgKCFjdXJzb3Jf cm93LT5yZXZlcnNlZF9wICYmIGhwb3MgPCAwKQorICAgICAgICAgICAgaHBvcyA9IDA7CisgICAg ICAgICAgaWYgKGN1cnNvcl9yb3ctPnJldmVyc2VkX3AgJiYgaHBvcyA+PSBjdXJzb3Jfcm93LT51 c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgICBocG9zID0gY3Vyc29yX3Jvdy0+dXNlZFtURVhU X0FSRUFdIC0gMTsKKyAgICAgICAgfQorICAgICAgaWYgKDAgPD0gaHBvcyAmJiBocG9zIDwgY3Vy c29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAgICBjdXJzb3JfZ2x5cGggPSBjdXJzb3Jf cm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3M7CisgICAgICBlbHNlCisgICAgICAgIGN1cnNv cl9nbHlwaCA9IE5VTEw7CisgICAgICBpZiAoY3Vyc29yX2dseXBoID09IE5VTEwpCisgICAgICAg IGdvdG8gZG9uZTsKKyAgICAgIHdpZHRoID0gY3Vyc29yX2dseXBoLT5waXhlbF93aWR0aDsKKyAg ICAgIGhvbGxvd194ID0geDsKKyAgICAgIGlmICh4IDwgMCkKKyAgICAgICAgeworICAgICAgICAg IHdpZHRoICs9IGhvbGxvd194OworICAgICAgICAgIGhvbGxvd194ID0gMDsKKyAgICAgICAgfQor ICAgICAgd2lkdGggPSBtaW4gKHdpZHRoLCB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEp IC0gaG9sbG93X3gpOworICAgICAgaG9sbG93X3kgPSBXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAo dywgbWF4IChoZWFkZXJfbGluZV9oZWlnaHQsIGN1cnNvcl9yb3ctPnkpKTsKKyAgICAgIGhvbGxv d194ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgaG9sbG93X3gpOworICAgICAg aWYgKHdpZHRoID4gMCkKKyAgICAgICAgRlJBTUVfUklGIChmKS0+Y2xlYXJfZnJhbWVfYXJlYSAo ZiwgaG9sbG93X3gsIGhvbGxvd195LCB3aWR0aCwgY3Vyc29yX3Jvdy0+dmlzaWJsZV9oZWlnaHQp OworICAgIH0KKyAgaWYgKChjdXJzb3Jfcm93LT5yZXZlcnNlZF9wCisgICAgICAgPyAoaHBvcyA+ PSAwKQorICAgICAgIDogKGhwb3MgPCBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0pKSkKKyAg ICB7CisgICAgICBpbnQgeDE7CisgICAgICBpZiAoIWN1cnNvcl9yb3ctPnJldmVyc2VkX3AgJiYg aHBvcyA8IDApCisgICAgICAgIGhwb3MgPSAwOworICAgICAgaWYgKGN1cnNvcl9yb3ctPnJldmVy c2VkX3AgJiYgaHBvcyA+PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgIGhw b3MgPSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgeDEgPSBkcmF3X2ds eXBocyAodywgeCwgY3Vyc29yX3JvdywgVEVYVF9BUkVBLCBocG9zLCBocG9zICsgMSwgRFJBV19O T1JNQUxfVEVYVCwgMCk7CisgICAgICBpZiAoY3Vyc29yX3Jvdy0+b3ZlcmxhcHBlZF9wKQorICAg ICAgICB7CisgICAgICAgICAgdy0+cGh5c19j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fcm93LT55OworICBGUkFNRV9SSUYgKGYpLT5kcmF3X3dp bmRvd19jdXJzb3IgKHcsIGdseXBoX3JvdywgeCwgeSwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0 aCwgMSwgMCwgcmVkLCBncmVlbiwgYmx1ZSk7CisgIC8qIFJlc3RvcmUgdGhlIHByZXZpb3VzIHZh bHVlcyBmb3Igdy0+cGh5c19jdXJzb3IueC95L2hwb3MvdnBvcy4gICovCisgIHctPnBoeXNfY3Vy c29yLmhwb3MgPSBwcmlvcl9ocG9zOworICB3LT5waHlzX2N1cnNvci52cG9zID0gcHJpb3JfdnBv czsKKyAgdy0+cGh5c19jdXJzb3IueCA9IHByaW9yX3g7CisgIHctPnBoeXNfY3Vyc29yLnkgPSBw cmlvcl95OworfQorCitpbnQKK21jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKExpc3BfT2JqZWN0IGFy ZykKK3sKKyAgY2hhciAqc3RyOworICBpZiAoWFRZUEUgKGFyZykgPT0gTGlzcF9TdHJpbmcpCisg ICAgc3RyID0gU1NEQVRBIChhcmcpOworICBlbHNlIGlmIChYVFlQRSAoYXJnKSA9PSBMaXNwX1N5 bWJvbCkKKyAgICBzdHIgPSBTU0RBVEEgKFNZTUJPTF9OQU1FIChhcmcpKTsKKyAgZWxzZSByZXR1 cm4gLTE7CisgIGlmICghc3RyY21wIChzdHIsICJib3giKSkKKyAgICByZXR1cm4gRklMTEVEX0JP WF9DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIsICJob2xsb3ciKSkKKyAgICByZXR1cm4gSE9M TE9XX0JPWF9DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIsICJoYmFyIikpCisgICAgcmV0dXJu IEhCQVJfQ1VSU09SOworICBpZiAoIXN0cmNtcCAoc3RyLCAiYmFyIikpCisgICAgcmV0dXJuIEJB Ul9DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIsICJubyIpKQorICAgIHJldHVybiBOT19DVVJT T1I7CisgIHJld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YQ0RSICh2bGlzdCkpCisg ICAgICAgIHsKKyAgICAgICAgICBjdXJzb3Jfc3BlY19saXN0ID0gWENBUiAoWENBUiAodmxpc3Qp KTsKKyAgICAgICAgICBwb3NpbnQgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIGN1cnNv cl9zcGVjX2xpc3QpKTsKKyAgICAgICAgICBjdXJzb3Jfc3BlY190eXBlID0gRm50aCAobWFrZV9u dW1iZXIgKDEpLCBjdXJzb3Jfc3BlY19saXN0KTsKKyAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNv cl9zcGVjX3R5cGUpKQorICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNv cl90eXBlIChYQ0FSIChjdXJzb3Jfc3BlY190eXBlKSk7CisgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoY3Vyc29yX3Nw ZWNfdHlwZSk7CisgICAgICAgICAgaWYgKENPTlNQIChjdXJzb3Jfc3BlY190eXBlKSkKKyAgICAg ICAgICAgIGN1cnNvcl93aWR0aCA9IFhJTlQgKFhDQVIgKFhDRFIgKGN1cnNvcl9zcGVjX3R5cGUp KSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IDE7Cisg ICAgICAgICAgaWYgKHBvc2ludCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgeF95X2hw b3NfdnBvcyA9IFhDQVIgKFhDRFIgKFhDQVIgKHZsaXN0KSkpOworICAgICAgICAgICAgICB4ID0g WElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAg ICAgIHkgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMSksIHhfeV9ocG9zX3Zwb3MpKTsKKyAg ICAgICAgICAgICAgaHBvcyA9IFhJTlQgKEZudGggKG1ha2Vf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ChGZXF1YWwgKEZudGggKG1ha2VfbnVtYmVyICgwKSwgdy0+bWNfY2FjaGUpLCBC VkFSIChiLCBtY19saXN0KSkpKQorICAgIHsKKyNpZmRlZiBHTFlQSF9ERUJVRworICBkZWJ1Z19t ZXRob2RfYWRkICh3LCAibWNfY2FsYzogIGRyYXcgY3Vyc29ycyB1c2luZyBjYWNoZSIpOworI2Vu ZGlmCisgICAgICBmb3IgKHZsaXN0ID0gWENBUiAoWENEUiAody0+bWNfY2FjaGUpKTsKKyAgICAg ICAgICAgQ09OU1AgKHZsaXN0KTsKKyAgICAgICAgICAgdmxpc3QgPSBYQ0RSICh2bGlzdCkpCisg ICAgICAgIHsKKyAgICAgICAgICBjdXJzb3Jfc3BlY19saXN0ID0gWENBUiAoWENBUiAodmxpc3Qp KTsKKyAgICAgICAgICBwb3NpbnQgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIGN1cnNv cl9zcGVjX2xpc3QpKTsKKyAgICAgICAgICBjdXJzb3Jfc3BlY190eXBlID0gRm50aCAobWFrZV9u dW1iZXIgKDEpLCBjdXJzb3Jfc3BlY19saXN0KTsKKyAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNv cl9zcGVjX3R5cGUpKQorICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNv cl90eXBlIChYQ0FSIChjdXJzb3Jfc3BlY190eXBlKSk7CisgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoY3Vyc29yX3Nw ZWNfdHlwZSk7CisgICAgICAgICAgaWYgKENPTlNQIChjdXJzb3Jfc3BlY190eXBlKSkKKyAgICAg ICAgICAgIGN1cnNvcl93aWR0aCA9IFhJTlQgKFhDQVIgKFhDRFIgKGN1cnNvcl9zcGVjX3R5cGUp KSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IDE7Cisg ICAgICAgICAgY3Vyc29yX2NvbG9yX3ZlY3RvciA9IEZudGggKG1ha2VfbnVtYmVyICgyKSwgY3Vy c29yX3NwZWNfbGlzdCk7CisgICAgICAgICAgaWYgKFNUUklOR1AgKGN1cnNvcl9jb2xvcl92ZWN0 b3IpKQorICAgICAgICAgICAgY3Vyc29yX2NvbG9yX3ZlY3RvciA9IG1jX2NvbG9yX3ZlY3Rvcl9j YWxjdWxhdGUgKHcsIGN1cnNvcl9jb2xvcl92ZWN0b3IpOworICAgICAgICAgIHJlZCA9IFhGTE9B VF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAwKSk7CisgICAgICAgICAgZ3JlZW4g PSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMSkpOworICAgICAgICAg IGJsdWUgPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMikpOworICAg ICAgICAgIGlmIChwb3NpbnQKKyAgICAgICAgICAgICAgJiYgdy0+bWMuc3RhcnQKKyAgICAgICAg ICAgICAgJiYgdy0+bWMuZW5kCisgICAgICAgICAgICAgICYmIHBvc2ludCA+PSB3LT5tYy5zdGFy dAorICAgICAgICAgICAgICAmJiBwb3NpbnQgPD0gdy0+bWMuZW5kKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICB4X3lfaHBvc192cG9zID0gWENBUiAoWENEUiAoWENBUiAodmxpc3QpKSk7 CisgICAgICAgICAgICAgIHggPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIHhfeV9ocG9z X3Zwb3MpKTsKKyAgICAgICAgICAgICAgeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwg eF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAgICBocG9zID0gWElOVCAoRm50aCAobWFrZV9u dW1iZXIgKDIpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAgICAgIHZwb3MgPSBYSU5UIChG bnRoIChtYWtlX251bWJlciAoMyksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICAgICAgbWNf ZHJhdyAodywgeCwgeSwgaHBvcywgdnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcmVk LCBncmVlbiwgYmx1ZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgLyog RHJhdyB0aGUgY3Vyc29ycyBhbmV3IGJlY2F1c2Ugc29tZXRoaW5nIGhhcyBjaGFuZ2VkLCBlLmcu LCB0aGUgZmlyc3QgZWxlbWVudCBvZgorICAgICAgIHctPm1jX2NhY2hlIGlzIE5PVCB0aGUgc2Ft ZSBhcyB0aGUgbG9jYWwgdmFyaWFibGUgbWNfbGlzdDsgYW5kL29yLCB0aGUgcHJldmlvdXMvCisg ICAgICAgY3VycmVudCB3aW5kb3ctc3RhcnQvd2luZG93LWVuZCBhcmUgTk9UIHRoZSBzYW1lIChl LmcuLCBzY3JvbGxpbmcgaGFzIG9jY3VycmVkKS4KKyAgICAgICBTZW1pLWV4cGVuc2l2ZSBjYWxj dWxhdGlvbiBvZiBjb29yZGluYXRlcyBpcyByZXF1aXJlZC4gKi8KKyAgICBlbHNlIGlmICghcmVt b3ZlCisgICAgICAgICAgICAgJiYgdyA9PSBzdworICAgICAgICAgICAgICYmIHctPm1jLnN0YXJ0 CisgICAgICAgICAgICAgJiYgdy0+bWMuZW5kCisgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIg KGIsIG1jX2xpc3QpKSkKKyAgICAgIHsKKyAgI2lmZGVmIEdMWVBIX0RFQlVHCisgICAgZGVidWdf bWV0aG9kX2FkZCAodywgIm1jX2NhbGM6ICBkcmF3IGN1cnNvcnMgYW5ldyIpOworICAjZW5kaWYK KyAgICAgICAgZm9yICh2bGlzdCA9IEJWQVIgKGIsIG1jX2xpc3QpOworICAgICAgICAgICAgIENP TlNQICh2bGlzdCk7CisgICAgICAgICAgICAgdmxpc3QgPSBYQ0RSICh2bGlzdCkpCisgICAgICAg ICAgeworICAgICAgICAgICAgY3Vyc29yX3NwZWNfbGlzdCA9IFhDQVIgKHZsaXN0KTsKKyAgICAg ICAgICAgIHBvc2ludCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgwKSwgY3Vyc29yX3NwZWNf bGlzdCkpOworICAgICAgICAgICAgY3Vyc29yX3NwZWNfdHlwZSA9IEZudGggKG1ha2VfbnVtYmVy ICgxKSwgY3Vyc29yX3NwZWNfbGlzdCk7CisgICAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9z cGVjX3R5cGUpKQorICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29y X3R5cGUgKFhDQVIgKGN1cnNvcl9zcGVjX3R5cGUpKTsKKyAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoY3Vyc29y X3NwZWNfdHlwZSk7CisgICAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9zcGVjX3R5cGUpKQor ICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSBYSU5UIChYQ0FSIChYQ0RSIChjdXJzb3Jfc3Bl Y190eXBlKSkpOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgY3Vyc29yX3dp ZHRoID0gMTsKKyAgICAgICAgICAgIGN1cnNvcl9jb2xvcl92ZWN0b3IgPSBGbnRoIChtYWtlX251 bWJlciAoMiksIGN1cnNvcl9zcGVjX2xpc3QpOworICAgICAgICAgICAgaWYgKFNUUklOR1AgKGN1 cnNvcl9jb2xvcl92ZWN0b3IpKQorICAgICAgICAgICAgICBjdXJzb3JfY29sb3JfdmVjdG9yID0g bWNfY29sb3JfdmVjdG9yX2NhbGN1bGF0ZSAodywgY3Vyc29yX2NvbG9yX3ZlY3Rvcik7CisgICAg ICAgICAgICByZWQgPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMCkp OworICAgICAgICAgICAgZ3JlZW4gPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3Zl Y3RvciwgMSkpOworICAgICAgICAgICAgYmx1ZSA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3Jf Y29sb3JfdmVjdG9yLCAyKSk7CisgICAgICAgICAgICB4X3lfaHBvc192cG9zID0gRm50aCAobWFr ZV9udW1iZXIgKDApLCBtY194X3lfaHBvc192cG9zICh3LCBwb3NpbnQsIHctPm1jLnN0YXJ0LCB3 LT5tYy5lbmQpKTsKKyAgICAgICAgICAgIHRlbXAgPSBGY29ucyAoY3Vyc29yX3NwZWNfbGlzdCwg RmNvbnMgKHhfeV9ocG9zX3Zwb3MsIFFuaWwpKTsKKyAgICAgICAgICAgIHJlc3VsdCA9IEZjb25z ICh0ZW1wLCByZXN1bHQpOworICAgICAgICAgICAgeCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVy ICgwKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAgeSA9IFhJTlQgKEZudGggKG1ha2Vf bnVtYmVyICgxKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAgaHBvcyA9IFhJTlQgKEZu dGggKG1ha2VfbnVtYmVyICgyKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAgdnBvcyA9 IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgzKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAg ICAgaWYgKHctPm1jLnN0YXJ0CisgICAgICAgICAgICAgICAgJiYgdy0+bWMuZW5kCisgICAgICAg ICAgICAgICAgJiYgcG9zaW50ID49IHctPm1jLnN0YXJ0CisgICAgICAgICAgICAgICAgJiYgcG9z aW50IDw9IHctPm1jLmVuZCkKKyAgICAgICAgICAgICAgbWNfZHJhdyAodywgeCwgeSwgaHBvcywg dnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcmVkLCBncmVlbiwgYmx1ZSk7CisgICAg ICAgICAgfQorLyogYHctPm1jX2NhY2hlJyBpcyBzZXQgZm9yIHRoZSB3aW5kb3csIG5vdCBidWZm ZXIrd2luZG93IC0tIGkuZS4sIGFsbCBidWZmZXJzIGFwcGVhcmluZworaW4gdGhlIHNhbWUgd2lu ZG93IHZpYSBgc3dpdGNoLXRvLWJ1ZmZlcicgd2lsbCBoYXZlIGB3LT5tY19jYWNoZScuICBUaGlz IGJlaGF2aW9yCitpcyBjb25zaXN0ZW50IHdpdGggZnVuY3Rpb25zIHN1Y2ggYXMgYHNldC13aW5k b3ctZGlzcGxheS10YWJsZScuICBXZSBkZWFsIHdpdGggdGhpcyBpbgorYG5zdGVybS5tJyAvIGB3 MzJ0ZXJtLmMnIC8gYHh0ZXJtLmMnIGJ5IGNvbXBhcmluZyBgdy0+Y29udGVudHMnIHRvIHRoZSB2 YWx1ZSBvZiB0aGUgYGJ1ZicKK3N0b3JlZCBpbiBgdy0+bWNfY2FjaGUnOiAgKEVRICh3LT5jb250 ZW50cywgWENBUiAoRm50aCAobWFrZV9udW1iZXIgKDIpLCB3LT5tY19jYWNoZSkpKSkgICovCisg ICAgICAgIGlmICghTklMUCAocmVzdWx0KSkKKyAgICAgICAgICB3c2V0X21jX2NhY2hlICh3LCBs aXN0biAoQ09OU1RZUEVfSEVBUCwgMywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBCVkFSIChiLCBtY19saXN0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBGcmV2ZXJzZSAocmVzdWx0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBGY29ucyAoYnVmLCBRbmlsKSkpOworICAgICAgfQorICB3LT5tYy5kcmF3X2VyYXNlID0g ZmFsc2U7CisgIGlmIChvbGRfYnVmZmVyKQorICAgIHNldF9idWZmZXJfaW50ZXJuYWw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V9udW1iZXIgKDIpLCB3LT5t Y19jYWNoZSkpKSkpKQorICAgICAgICAgICYmICFNSU5JX1dJTkRPV19QICh3KSkKKyAgICAgICAg eworICAgICAgICAgIC8qIFJlbW92ZSBmYWtlIGN1cnNvcnMuICAqLworICAgICAgICAgIGlmICgo dy0+bWNfY2FjaGUgJiYgKEVRICh3LT5jb250ZW50cywgWENBUiAoRm50aCAobWFrZV9udW1iZXIg KDIpLCB3LT5tY19jYWNoZSkpKSkpKQorICAgICAgICAgICAgbWNfY2FsYyAodywgMSk7CisgICAg ICAgICAgLyogRHJhdyBmYWtlIGN1cnNvcnMgICovCisgICAgICAgICAgaWYgKCFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2xpc3QpKSkKKyAgICAgICAgICAgIG1jX2NhbGMg KHcsIDApOworICAgICAgICB9CisKKyAgICAgIC8qIEZpcnN0IGF0dGVtcHQgYXQgZGVhbGluZyB3 aXRoIGEgYHJlZGlzcGxheV9wcmVzZXJ2ZV9lY2hvX2FyZWEnIHNpdHVhdGlvbi4gICovCisgICAg ICBpZiAoIXctPm1jLmRyYXdfZXJhc2UKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBtY19saXN0KSkKKyAgICAgICAgICAmJiB3LT5tY19jYWNoZQorICAg ICAgICAgICYmIChFUSAody0+Y29udGVudHMsIFhDQVIgKEZudGggKG1ha2VfbnVtYmVyICgyKSwg dy0+bWNfY2FjaGUpKSkpCisgICAgICAgICAgJiYgIU1JTklfV0lORE9XX1AgKHcpKQorICAgICAg ICB7CisgICAgICAgICAgLyogUmVtb3ZlIGZha2UgY3Vyc29ycy4gICovCisgICAgICAgICAgbWNf Y2FsYyAodywgMSk7CisgICAgICAgICAgLyogRHJhdyBmYWtlIGN1cnNvcnMgICovCisgICAgICAg ICAgbWNfY2FsYyAodywgMCk7CisgICAgICAgIH0KKworLyogRU5EIG11bHRpcGxlIGN1cnNvc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aCAoY3Vyc29yX3R5cGUpCisgIHsKKyAgICBjYXNlIEhPTExPV19C T1hfQ1VSU09SOgorICAgIHsKKyAgICAgIGlmIChyZWQgPj0gMCAmJiBibHVlID49IDAgJiYgZ3Jl ZW4gPj0gMCkKKyAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54 LT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBmcmFtZSAq ZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICAgICAgICAgc3RydWN0IHhfZGlzcGxh eV9pbmZvICpkcHlpbmZvID0gRlJBTUVfRElTUExBWV9JTkZPIChmKTsKKyAgICAgICAgICB1bnNp Z25lZCBsb25nIG9yaWdfdmFsID0gZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsOworICAg ICAgICAgIGludCBpbnRfcmVkID0gcmVkICogNjU1MzU7CisgICAgICAgICAgaW50IGludF9ncmVl biA9IGdyZWVuICogNjU1MzU7CisgICAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDY1NTM1 OworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IHhfbWFrZV90cnVl Y29sb3JfcGl4ZWwgKGRweWluZm8sIGludF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOworICAg ICAgICAgIHhfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBnbHlwaF9yb3cpOworICAgICAgICAgIGYt Pm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdfdmFsOworICAgICAgICB9CisgICAg ICAgIGVsc2UKKyAgICAgICAgICB4X2RyYXdfaG9sbG93X2N1cnNvciAodywgZ2x5cGhfcm93KTsK KyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIEZJTExFRF9CT1hfQ1VSU09SOgorICAgIHsK KyAgICAgICAvKiBUT0RPOiAga2RiIHRvIGNvbnNpZGVyIGFkZGluZyBzdXBwb3J0IGZvciBtdWx0 aXBsZSBjdXJzb3IgZm9yZWdyb3VuZAorICAgICAgIGN1c3RvbWl6YXRpb24gb2YgYSBGSUxMRURf Qk9YX0NVUlNPUi4gICovCisgICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVu ID49IDApCisgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+ Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhf bWFrZV9nYycgaW4geGZucy5jLiAgKi8KKyAgICAgICAgeworICAgICAgICAgIGJsb2NrX2lucHV0 ICgpOworICAgICAgICAgIExpc3BfT2JqZWN0IHdpbmRvdyA9IChzZWxlY3RlZF93aW5kb3cpOwor ICAgICAgICAgIHN0cnVjdCB3aW5kb3cgKncgPSBkZWNvZGVfbGl2ZV93aW5kb3cgKHdpbmRvdyk7 CisgICAgICAgICAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsK KyAgICAgICAgICBzdHJ1Y3QgeF9kaXNwbGF5X2luZm8gKmRweWluZm8gPSBGUkFNRV9ESVNQTEFZ X0lORk8gKGYpOworICAgICAgICAgIGludCBpbnRfcmVkID0gcmVkICogNjU1MzU7CisgICAgICAg ICAgaW50IGludF9ncmVlbiA9IGdyZWVuICogNjU1MzU7CisgICAgICAgICAgaW50IGludF9ibHVl ID0gYmx1ZSAqIDY1NTM1OworICAgICAgICAgIFhHQ1ZhbHVlcyBnY192YWx1ZXM7CisgICAgICAg ICAgdW5zaWduZWQgbG9uZyBtYXNrID0gR0NGb3JlZ3JvdW5kIHwgR0NCYWNrZ3JvdW5kIHwgR0NG aWxsU3R5bGUgfCBHQ0xpbmVXaWR0aDsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIG9y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