From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.bugs Subject: bug#22873: Can we support multiple Cursors? Date: Mon, 28 Mar 2016 20:45:07 -0700 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by - "") Content-Type: multipart/mixed; boundary="Multipart_Mon_Mar_28_20:45:06_2016-1" X-Trace: ger.gmane.org 1459223190 7155 80.91.229.3 (29 Mar 2016 03:46:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Mar 2016 03:46:30 +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 Tue Mar 29 05:46:18 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1akkbh-0007gO-L5 for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 Mar 2016 05:46:18 +0200 Original-Received: from localhost ([::1]:44282 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akkbd-0006gT-QU for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Mar 2016 23:46:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akkbX-0006gA-Vv for bug-gnu-emacs@gnu.org; Mon, 28 Mar 2016 23:46:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akkbS-00053a-Sx for bug-gnu-emacs@gnu.org; Mon, 28 Mar 2016 23:46:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45577) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akkbS-00053W-PC for bug-gnu-emacs@gnu.org; Mon, 28 Mar 2016 23:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1akkbS-00066M-Hf for bug-gnu-emacs@gnu.org; Mon, 28 Mar 2016 23:46:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Keith David Bershatsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Mar 2016 03:46:02 +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.145922311923394 (code B ref 22873); Tue, 29 Mar 2016 03:46:02 +0000 Original-Received: (at 22873) by debbugs.gnu.org; 29 Mar 2016 03:45:19 +0000 Original-Received: from localhost ([127.0.0.1]:42704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1akkak-00065G-LY for submit@debbugs.gnu.org; Mon, 28 Mar 2016 23:45:18 -0400 Original-Received: from cobb.liquidweb.com ([50.28.13.150]:55666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1akkai-000654-QA for 22873@debbugs.gnu.org; Mon, 28 Mar 2016 23:45:17 -0400 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; bh=5Ph/CdErNKMUcQyrUN0Dn562IZaTv4Z7RMs5OGDlO8Q=; b=kQiw1olgOWUOOOCPFX+1N+7Kf/lvaT1BdYUzviJegMGoxlg8SyasZehb3ln7yoKChI5crwpE6IqtPB/n2m7InR7gbduq0ryV7bfIMhW9YCKe1vAht7AxOzmFZ3+/ZDRf; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:55279 helo=server.local.localhost) by cobb.liquidweb.com with esmtp (Exim 4.82) (envelope-from ) id 1akkaX-0002yf-RZ; Mon, 28 Mar 2016 23:45:06 -0400 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cobb.liquidweb.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-Get-Message-Sender-Via: cobb.liquidweb.com: acl_c_relayhosts_text_entry: lawlist|lawlist.com 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:115680 Archived-At: --Multipart_Mon_Mar_28_20:45:06_2016-1 Content-Type: text/plain; charset=US-ASCII The attached multiple_cursors_007.diff applies to the master branch as of today, March 28, 2016, bearing commit a30e7e12ed8465e2565dd318d921bc87f52ce18e. mc_calc now runs from the applicable nsterm.m/w32term.c/xterm.c, instead of xdisp.c. mc-calc has been broken down into 3 distinct sections, rather than if / if else / if else. A bool argument has been added to mc_calc -- true for remove/cleanup, false for draw fake cursors. The real cursor is redrawn if mc-list is set to Qnil (just in case it got erased during cleanup). I do not believe mc_calc needs to run inside xdisp.c where draw_window_cursor is called at either location. I've lightly tested this patch on Windows (XP SP-3), X11 (on an OSX box), and OSX (10.6.8). I've switched over my own in-house setup to use this latest patch and I will be making notes of any problems as they arise -- e.g., I see there are a few rare instances where some of the fake cursors are not getting erased on OSX, and I see that Windows is a little slow drawing fake cursors when dealing with about 50 on the screen [I'm testing in a virtual machine called Parallels). My primary usage of fake cursors is a vertical line that tracks the cursor position (compatible with word-wrap), and my secondary usage is with Magnar's library. The usage of this patch is as follows: (defun mc-test (&optional list) "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. Color vector is LSL (The Linden Scripting Language), rather than standard RGB. `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) (setq mc-list (if list list '( (3 "hbar" [1.0 0.0 0.0]) (4 "bar" [0.0 1.0 0.0]) (5 "box" [0.0 0.0 1.0]) (6 "hollow" [0.8 0.4 0.2]) (7 ("hbar" 3) [1.0 0.0 1.0]) (8 ("bar" 3) [0.0 1.0 1.0]))))) (global-set-key [f1] 'mc-test) For anyone interested in trying out this latest patch with Magnar's library, the following are the only modifications that I am are of that would be needed (as of today, 03/28/2016) -- blue colored bar cursor for even numbered columns, red colored bar cursor for odd numbered columns. One of the nifty things I see is that these fake cursors work well when placed at the very end of a line. (require 'multiple-cursors) (defun mc/clear-mc-list () (setq mc-list nil)) (add-hook 'multiple-cursors-mode-disabled-hook 'mc/clear-mc-list) (defun mc/create-fake-cursor-at-point (&optional id) "Add a fake cursor and possibly a fake active region overlay based on point and mark. Saves the current state in the overlay to be restored later." (unless mc--max-cursors-original (setq mc--max-cursors-original mc/max-cursors)) (when mc/max-cursors (unless (< (mc/num-cursors) mc/max-cursors) (if (yes-or-no-p (format "%d active cursors. Continue? " (mc/num-cursors))) (setq mc/max-cursors (read-number "Enter a new, temporary maximum: ")) (mc/remove-fake-cursors) (error "Aborted: too many cursors")))) (let ((overlay (make-overlay (point) (point)))) (overlay-put overlay 'mc-id (or id (mc/create-cursor-id))) (overlay-put overlay 'type 'fake-cursor) (overlay-put overlay 'priority 100) (mc/store-current-state-in-overlay overlay) (when (use-region-p) (overlay-put overlay 'region-overlay (mc/make-region-overlay-between-point-and-mark))) (let* ( (overlays (mc/all-fake-cursors)) (lst (mapcar (lambda (x) (save-excursion (let* ( current-column (pos (overlay-start x))) (goto-char pos) (setq current-column (current-column)) (cond ((oddp current-column) (list pos "bar" [1.0 0.0 0.0])) ;; red ((evenp current-column) (list pos "bar" [0.0 0.0 1.0])))))) ;; blue overlays)) ) (setq mc-list lst)) overlay)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; --Multipart_Mon_Mar_28_20:45:06_2016-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="multiple_cursors_007.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIuYyBiL3NyYy9idWZmZXIuYwppbmRleCA2MmIwYmM4Li4w NTk2MWVmIDEwMDY0NAotLS0gYS9zcmMvYnVmZmVyLmMKKysrIGIvc3JjL2J1ZmZlci5jCkBAIC01 MDczLDYgKzUwNzMsNyBAQCBpbml0X2J1ZmZlcl9vbmNlICh2b2lkKQogICBYU0VURkFTVElOVCAo QlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgZGlzcGxheV90YWJsZSksIGlkeCk7ICsraWR4Owog ICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgc3ludGF4X3RhYmxlKSwg aWR4KTsgKytpZHg7CiAgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBj YWNoZV9sb25nX3NjYW5zKSwgaWR4KTsgKytpZHg7CisgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVm ZmVyX2xvY2FsX2ZsYWdzLCBtY19saXN0KSwgaWR4KTsgKytpZHg7CiAgIFhTRVRGQVNUSU5UIChC VkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBjYX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qLworICAgICAgaWYgKCghTklMUCAoQlZBUiAo Y3VycmVudF9idWZmZXIsIG1jX2xpc3QpKSB8fCB3LT5tY19jYWNoZSkKKyAgICAgICAgICAmJiAh TUlOSV9XSU5ET1dfUCAodykpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoTklMUCAoQlZBUiAo Y3VycmVudF9idWZmZXIsIG1jX2xpc3QpKSAmJiB3LT5tY19jYWNoZSkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgbWNfY2FsYyAodywgMSk7IC8qIFJlbW92ZSBmYWtlIGN1cnNvcnMuICAq LworICAgICAgICAgICAgICBpZiAoY3Vyc29yX29uX3ApIC8qIFJlZHJhdyByZWFsIGN1cnNvci4g ICovCisgICAgICAgICAgICAgICAgZGlzcGxheV9hbmRfc2V0X2N1cnNvciAodywgMSwKKyAgICAg ICAgICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IuaHBvcywgdy0+b3V0cHV0X2N1cnNvci52cG9z LAorICAgICAgICAgICAgICAgICAgdy0+b3V0cHV0X2N1cnNvci54LCB3LT5vdXRwdXRfY3Vyc29y LnkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBtY19j YWxjICh3LCAwKTsgLyogRHJhdyBmYWtlIGN1cnNvcnMgICovCisgICAgICAgIH0KKwogICAgICAg aWYgKGRyYXdfd2luZG93X2ZyaW5nZXMgKHcsIDEpKQogCXsKIAkgIGlmIChXSU5ET1dfUklHSFRf RElWSURFUl9XSURUSCAodykpCkBAIC0yODExLDcgKzI4MjksNyBAQCBzdGF0aWMgdm9pZCBoaWRl X2JlbGwgKCkKIHN0YXRpYyB2b2lkCiBuc19kcmF3X3dpbmRvd19jdXJzb3IgKHN0cnVjdCB3aW5k b3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKmdseXBoX3JvdywKIAkJICAgICAgIGludCB4LCBpbnQg eSwgZW51bSB0ZXh0X2N1cnNvcl9raW5kcyBjdXJzb3JfdH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hhdCBhIGZha2UgY3Vyc29yCisgICAgICBpcyBub3QgZXJyb25lb3VzbHkgZXJhc2Vk IGR1cmluZyBzYWlkIHByb2Nlc3MuICBJZiB0aGUgYG1jLWxpc3QnIGhhcyBqdXN0IGJlZW4KKyAg ICAgIHNldCB0byBgUW5pbCcsIHRoZW4gcmVtb3ZlIGZha2UgY3Vyc29ycyBhbmQgcmVkcmF3IHRo ZSByZWFsIGN1cnNvci4gICovCisgICAgICBpZiAoKCFOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZl ciwgbWNfbGlzdCkpIHx8IHctPm1jX2NhY2hlKQorICAgICAgICAgICYmICFNSU5JX1dJTkRPV19Q ICh3KSkKKyAgICAgICAgeworICAgICAgICAgIGlmIChOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZl ciwgbWNfbGlzdCkpICYmIHctPm1jX2NhY2hlKQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBtY19jYWxjICh3LCAxKTsgLyogUmVtb3ZlIGZha2UgY3Vyc29ycy4gICovCisgICAgICAgICAg ICAgIGlmIChjdXJzb3Jfb25fcCkgLyogUmVkcmF3IHJlYWwgY3Vyc29yLiAgKi8KKyAgICAgICAg ICAgICAgICBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yICh3LCAxLAorICAgICAgICAgICAgICAgICAg dy0+b3V0cHV0X2N1cnNvci5ocG9zLCB3LT5vdXRwdXRfY3Vyc29yLnZwb3MsCisgICAgICAgICAg ICAgICAgICB3LT5vdXRwdXRfY3Vyc29yLngsIHctPm91dHB1dF9jdXJzb3IueSk7CisgICAgICAg ICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIG1jX2NhbGMgKHcsIDApOyAv KiBEcmF3IGZha2UgY3Vyc29ycyAgKi8KKyAgICAgICAgfQorCiAgICAgICBpZiAoZHJhd193aW5k b3dfZnJpbmdlcyAodywgdHJ1ZSkpCiAJewogCSAgaWYgKFdJTkRPV19SSUdIVF9ESVZJREVSX1dJ R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hc2UgSE9MTE9XX0JPWF9DVVJTT1I6CisgICAgICB7CisgICAgICAg IGlmIChyZWQgPj0gMCAmJiBibHVlID49IDAgJiYgZ3JlZW4gPj0gMCkKKyAgICAgICAgICAvKiBU ZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICov CisgICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5E T1dfRlJBTUUgKHcpKTsKKyAgICAgICAgICAgIENPTE9SUkVGIG9yaWdfdmFsID0gZi0+b3V0cHV0 X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWw7CisgICAgICAgICAgICBpbnQgaW50X3JlZCA9IHJlZCAq IDI1NTsKKyAgICAgICAgICAgIGludCBpbnRfZ3JlZW4gPSBncmVlbiAqIDI1NTsKKyAgICAgICAg ICAgIGludCBpbnRfYmx1ZSA9IGJsdWUgKiAyNTU7CisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0 YS53MzItPmN1cnNvcl9waXhlbCA9IFBBTEVUVEVSR0IgKGludF9yZWQsIGludF9ncmVlbiwgaW50 X2JsdWUpOworICAgICAgICAgICAgeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIGdseXBoX3Jvdyk7 CisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdfdmFs OworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB4X2RyYXdfaG9sbG93 X2N1cnNvciAodywgZ2x5cGhfcm93KTsKKyAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBj YXNlIEZJTExFRF9CT1hfQ1VSU09SOgorICAgICAgeworICAgICAgICAvKiBUT0RPOiAga2RiIHRv IGNvbnNpZGVyIGFkZGluZyBzdXBwb3J0IGZvciBtdWx0aXBsZSBjdXJzb3IgZm9yZWdyb3VuZAor ICAgICAgICBjdXN0b21pemF0aW9uIG9mIGEgRklMTEVEX0JPWF9DVVJTT1IuICAqLworICAgICAg ICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVuID49IDApCisgICAgICAgICAgLyog VGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycgYnkgYm9y cm93aW5nIHRoZQorICAgICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhfbWFrZV9nYycgaW4gdzMy Zm5zLmMuICAqLworICAgICAgICAgIHsKKyAgICAgICAgICAgIGJsb2NrX2lucHV0ICgpOworICAg ICAgICAgICAgTGlzcF9PYmplY3Qgd2luZG93ID0gKHNlbGVjdGVkX3dpbmRvdyk7CisgICAgICAg ICAgICBzdHJ1Y3Qgd2luZG93ICp3ID0gZGVjb2RlX2xpdmVfd2luZG93ICh3aW5kb3cpOworICAg ICAgICAgICAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAg ICAgICAgICAgIGludCBpbnRfcmVkID0gcmVkICogMjU1OworICAgICAgICAgICAgaW50IGludF9n cmVlbiA9IGdyZWVuICogMjU1OworICAgICAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDI1 NTsKKyAgICAgICAgICAgIFhHQ1ZhbHVlcyBnY192YWx1ZXM7CisgICAgICAgICAgICB1bnNpZ25l ZCBsb25nIG1hc2sgPSBHQ0ZvbnQgfCBHQ0ZvcmVncm91bmQgfCBHQ0JhY2tncm91bmQ7CisgICAg ICAgICAgICBDT0xPUlJFRiBvcmlnX3ZhbF9hID0gRlJBTUVfQkFDS0dST1VORF9QSVhFTCAoZik7 CisgICAgICAgICAgICBDT0xPUlJFRiBvcmlnX3ZhbF9iID0gZi0+b3V0cHV0X2RhdGEudzMyLT5j dXJzb3JfcGl4ZWw7CisgICAgICAgICAgICBnY192YWx1ZXMuZm9udCA9IEZSQU1FX0ZPTlQgKGYp OworICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBGUkFNRV9CQUNLR1JPVU5EX1BJ WEVMIChmKTsKKyAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gUEFMRVRURVJHQiAo aW50X3JlZCwgaW50X2dyZWVuLCBpbnRfYmx1ZSk7CisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0 YS53MzItPmN1cnNvcl9nYworICAgICAgICAgICAgICA9IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVf VzMyX1dJTkRPVyAoZiksIG1hc2ssICZnY192YWx1ZXMpOworICAgICAgICAgICAgLyogV2hlbiBg dy0+bWMuc2V0X2N1cnNvcl9nYyA9IHRydWUnLCBmb3JjZSBgeF9zZXRfY3Vyc29yX2djJyB0bwor ICAgICAgICAgICAgdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycuICAqLwor ICAgICAgICAgICAgdy0+bWMuc2V0X2N1cnNvcl9nYyA9IHRydWU7CisgICAgICAgICAgICBkcmF3 X3BoeXNfY3Vyc29yX2dseXBoICh3LCBnbHlwaF9yb3csIERSQVdfQ1VSU09SKTsKKyAgICAgICAg ICAgIHctPm1jLnNldF9jdXJzb3JfZ2MgPSBmYWxzZTsKKyAgICAgICAgICAgIGdjX3ZhbHVlcy5m b250ID0gRlJBTUVfRk9OVCAoZik7CisgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9 IG9yaWdfdmFsX2E7CisgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IG9yaWdfdmFs X2I7CisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYworICAgICAgICAg ICAgICA9IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiksIG1hc2ssICZnY192 YWx1ZXMpOworICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICB9CisgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgZHJhd19waHlzX2N1cnNvcl9nbHlwaCAodywgZ2x5cGhf cm93LCBEUkFXX0NVUlNPUik7CisgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBC QVJfQ1VSU09SOgorICAgICAgeworICAgICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYm IGdyZWVuID49IDApCisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRf ZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIHsKKyAgICAgICAgICAgIHN0 cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICAgICAgICAgICBD T0xPUlJFRiBvcmlnX3ZhbCA9IGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsOworICAg ICAgICAgICAgaW50IGludF9yZWQgPSByZWQgKiAyNTU7CisgICAgICAgICAgICBpbnQgaW50X2dy ZWVuID0gZ3JlZW4gKiAyNTU7CisgICAgICAgICAgICBpbnQgaW50X2JsdWUgPSBibHVlICogMjU1 OworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBQQUxFVFRF UkdCIChpbnRfcmVkLCBpbnRfZ3JlZW4sIGludF9ibHVlKTsKKyAgICAgICAgICAgIHhfZHJhd19i YXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgQkFSX0NVUlNPUik7CisgICAg ICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdfdmFsOworICAg ICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAo dywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEJBUl9DVVJTT1IpOworICAgICAgICBicmVhazsK KyAgICAgIH0KKyAgICAgIGNhc2UgSEJBUl9DVVJTT1I6CisgICAgICB7CisgICAgICAgIGlmIChy ZWQgPj0gMCAmJiBibHVlID49IDAgJiYgZ3JlZW4gPj0gMCkKKyAgICAgICAgICAvKiBUZW1wb3Jh cmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAg ICAgICAgeworICAgICAgICAgICAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJB TUUgKHcpKTsKKyAgICAgICAgICAgIENPTE9SUkVGIG9yaWdfdmFsID0gZi0+b3V0cHV0X2RhdGEu dzMyLT5jdXJzb3JfcGl4ZWw7CisgICAgICAgICAgICBpbnQgaW50X3JlZCA9IHJlZCAqIDI1NTsK KyAgICAgICAgICAgIGludCBpbnRfZ3JlZW4gPSBncmVlbiAqIDI1NTsKKyAgICAgICAgICAgIGlu dCBpbnRfYmx1ZSA9IGJsdWUgKiAyNTU7CisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzIt PmN1cnNvcl9waXhlbCA9IFBBTEVUVEVSR0IgKGludF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUp OworICAgICAgICAgICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dp ZHRoLCBIQkFSX0NVUlNPUik7CisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNv cl9waXhlbCA9IG9yaWdfdmFsOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAg ICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEhCQVJf Q1VSU09SKTsKKyAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIE5PX0NVUlNPUjoK KyAgICAgICAgdy0+cGh5c19jdXJzb3Jfd2lkdGggPSAwOworICAgICAgICBicmVhazs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Aody0+cGh5c19jdXJzb3JfdHlwZSA9PSBIT0xM T1dfQk9YX0NVUlNPUikKKyAgICB7CisgICAgICBpbnQgaG9sbG93X3gsIGhvbGxvd195LCB3aWR0 aDsKKyAgICAgIGlmICghKHZwb3MgPj0gMAorICAgICAgICAgICYmIHZwb3MgPCB3LT5jdXJyZW50 X21hdHJpeC0+bnJvd3MpKQorICAgICAgICBjdXJzb3JfZ2x5cGggPSBOVUxMOworICAgICAgaWYg KCFjdXJzb3Jfcm93LT5lbmFibGVkX3ApCisgICAgICAgIGN1cnNvcl9nbHlwaCA9IE5VTEw7Cisg ICAgICBpZiAody0+aHNjcm9sbCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFdoZW4gdGhlIHdp bmRvdyBpcyBoc2Nyb2xsZWQsIGN1cnNvciBocG9zIGNhbiBsZWdpdGltYXRlbHkgYmUKKyAgICAg ICAgICAgb3V0IG9mIGJvdW5kcywgYnV0IHdlIGRyYXcgdGhlIGN1cnNvciBhdCB0aGUgY29ycmVz cG9uZGluZworICAgICAgICAgICB3aW5kb3cgbWFyZ2luIGluIHRoYXQgY2FzZS4gICovCisgICAg ICAgICAgaWYgKCFjdXJzb3Jfcm93LT5yZXZlcnNlZF9wICYmIGhwb3MgPCAwKQorICAgICAgICAg ICAgaHBvcyA9IDA7CisgICAgICAgICAgaWYgKGN1cnNvcl9yb3ctPnJldmVyc2VkX3AgJiYgaHBv cyA+PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgICBocG9zID0gY3Vy c29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgICAgICAgfQorICAgICAgaWYgKDAgPD0g aHBvcyAmJiBocG9zIDwgY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAgICBjdXJz b3JfZ2x5cGggPSBjdXJzb3Jfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3M7CisgICAgICBl bHNlCisgICAgICAgIG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yX3Jvdy0+dXNl ZFtURVhUX0FSRUFdKSkpCisgICAgeworICAgICAgaW50IHgxOworICAgICAgLyogV2hlbiB0aGUg d2luZG93IGlzIGhzY3JvbGxlZCwgY3Vyc29yIGhwb3MgY2FuIGxlZ2l0aW1hdGVseSBiZQorICAg b3V0IG9mIGJvdW5kcywgYnV0IHdlIGRyYXcgdGhlIGN1cnNvciBhdCB0aGUgY29ycmVzcG9uZGlu ZworICAgd2luZG93IG1hcmdpbiBpbiB0aGF0IGNhc2UuICAqLworICAgICAgaWYgKCFjdXJzb3Jf cm93LT5yZXZlcnNlZF9wICYmIGhwb3MgPCAwKQorICAgICAgICBocG9zID0gMDsKKyAgICAgIGlm IChjdXJzb3Jfcm93LT5yZXZlcnNlZF9wICYmIGhwb3MgPj0gY3Vyc29yX3Jvdy0+dXNlZFtURVhU X0FSRUFdKQorICAgICAgICBocG9zID0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsK KyAgICAgIHgxID0gZHJhd19nbHlwaHMgKHcsIHgsIGN1cnNvcl9yb3csIFRFWFRfQVJFQSwgaHBv cywgaHBvcyArIDEsIERSQVdfTk9STUFMX1RFWFQsIDApOworICAgICAgaWYgKGN1cnNvcl9yb3ct Pm92ZXJsYXBwZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIHctPnBoeXNfY3Vyc29yX3dpZHRo ID0geDEgLSB4OworICAgICAgICAgIGlmIChjdXJzb3Jfcm93ID4gdy0+Y3VycmVudF9tYXRyaXgt PnJvd3MKKyAgICAgICAgICAgICAgJiYgTUFUUklYX1JPV19PVkVSTEFQU19TVUNDX1AgKGN1cnNv cl9yb3cgLSAxKSkKKyAgICAgICAgICAgIHhfZml4X292ZXJsYXBwaW5nX2FyZWEgKHcsIGN1cnNv cl9yb3cgLSAxLCBURVhUX0FSRUEsIE9WRVJMQVBTX0VSQVNFRF9DVVJTT1IpOworICAgICAgICAg IGlmIChNQVRSSVhfUk9XX0JPVFRPTV9ZIChjd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Zwb3M7CisgIHctPnBoeXNfY3Vyc29yLnggPSBwcmlvcl94OworICB3 LT5waHlzX2N1cnNvci55ID0gcHJpb3JfeTsKK30KKworTGlzcF9PYmplY3QKK21jX3hfeV9ocG9z X3Zwb3MgKHN0cnVjdCB3aW5kb3cgKncsIEVNQUNTX0lOVCBwb3NpbnQpCit7CisgIHN0cnVjdCBp dCBpdDsKKyAgdm9pZCAqaXRkYXRhID0gYmlkaV9zaGVsdmVfY2FjaGUgKCk7CisgIHN0cnVjdCB0 ZXh0X3BvcyBwdCwgcG9zOworICBpbnQgeCwgeSwgaHBvcywgdnBvczsKKyAgaWYgKHctPm1jLnN0 YXJ0CisgICAgICAmJiB3LT5tYy5lbmQKKyAgICAgICYmIHBvc2ludCA+PSB3LT5tYy5zdGFydAor ICAgICAgJiYgcG9zaW50IDw9IHctPm1jLmVuZCkKKyAgICB7CisgICAgICBTRVRfVEVYVF9QT1Nf RlJPTV9NQVJLRVIgKHB0LCB3LT5zdGFydCk7CisgICAgICBzdGFydF9kaXNwbGF5ICgmaXQsIHcs IHB0KTsKKyAgICAgIG1vdmVfaXRfdG8gKCZpdCwgcG9zaW50LCAtMSwgLTEsIC0xLCBNT1ZFX1RP X1BPUyk7CisgICAgICBwb3MgPSBpdC5jdXJyZW50LnBvczsKKyAgICAgIHggPSBpdC5jdXJyZW50 X3g7CisgICAgICB5ID0gaXQuY3VycmVudF95OworICAgICAgaHBvcyA9IGl0Lmhwb3M7CisgICAg ICB2cG9zID0gaXQudnBvczsKKyAgICAgIGJpZGlfdW5zaGVsdmVfY2FjaGUgKGl0ZGF0YSwgZmFs c2UpOworICAgIH0KKyAgICBlbHNlCisgICAgICB7CisgICAgICAgIHggPSAtMTsKKyAgICAgICAg eSA9IC0xOworICAgICAgICBocG9zID0gLTE7CisgICAgICAgIHZwb3MgPSAtMTsKKyAgICAgIH0K KyAgcmV0dXJuIGxpc3RuIChDT05TVFlQRV9QVVJFLCA0LCBtYWtlX251bWJlciAoeCksIG1ha2Vf bnVtYmVyICh5KSwgbWFrZV9udW1iZXIgKGhwb3MpLCBtYWtlX251bWJlciAodnBvcykpOworfQor CitpbnQKK21jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKExpc3BfT2JqZWN0IGFyZykKK3sKKyAgY2hh ciAqc3RyOworICBpZiAoWFRZUEUgKGFyZykgPT0gTGlzcF9TdHJpbmcpCisgICAgc3RyID0gU1NE QVRBIChhcmcpOworICBlbHNlIGlmIChYVFlQRSAoYXJnKSA9PSBMaXNwX1N5bWJvbCkKKyAgICBz dHIgPSBTU0RBVEEgKFNZTUJPTF9OQU1FIChhcmcpKTsKKyAgZWxzZSByZXR1cm4gLTE7CisgIGlm ICghc3RyY21wIChzdHIsICJib3giKSkKKyAgICByZXR1cm4gRklMTEVEX0JPWF9DVVJTT1I7Cisg IGlmICghc3RyY21wIChzdHIsICJob2xsb3ciKSkKKyAgICByZXR1cm4gSE9MTE9XX0JPWF9DVVJT T1I7CisgIGlmICghc3RyY21wIChzdHIsICJoYmFyIikpCisgICAgcmV0dXJuIEhCQVJfQ1VSU09S OworICBpZiAoIXN0cmNtcCAoc3RyLCAiYmFyIikpCisgICAgcmV0dXJuIEJBUl9DVVJTT1I7Cisg IGlmICghc3RyY21wIChzdHIsICJubyIpKQorICAgIHJldHVybiBOT19DVVJTT1I7CisgIHJldHVy biAtMTsKK30KKworLyogRVhBTVBMRSAjMToKKyAgICAoc2V0cSBtYy1saXN0ICcoCisgICAgICAo MyAiaGJhciIgWzEuMCAwLjAgMC4wXSkKKyAgICAgICg0ICJiYXIiIFswLjAgMS4wIDAuMF0pCisg ICAgICAoNSAiYm94IiBbMC4wIDAuMCAxLjBdKQorICAgICAgKDYgImhvbGxvdyIgWzAuOCAwLjQg MC4yXSkKKyAgICAgICg3ICgiaGJhciIgMykgWzEuMCAwLjAgMS4wXSkKKyAgICAgICg4ICgiYmFy IiAzKSBbMC4wIDEuMCAxLjBdKSkpCisgICBFWEFNUExFICMyOiAgKHNldHEgbWM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GlzdG4gKENPTlNUWVBFX1BVUkUsIDMsCisgICAgICAgICAgICAgb3Zfc3Rh cnQsCisgICAgICAgICAgICAgYnVpbGRfcHVyZV9jX3N0cmluZyAoImJhciIpLAorICAgICAgICAg ICAgIENBTExOIChGdmVjdG9yLCBtYWtlX2Zsb2F0ICgwLjApLCBtYWtlX2Zsb2F0ICgwLjApLCBt YWtlX2Zsb2F0ICgxLjApKSk7CisgICAgICAgICAgIEFVVE9fU1RSSU5HIChmb3JtYXRfdHdvLCAi dGVtcF9saXN0OiAgJXMiKTsKKyAgICAgICAgICAgQ0FMTE4gKEZtZXNzYWdlLCBmb3JtYXRfdHdv LCB0ZW1wX2xpc3QpOworICAgICAgICAgICBuZXdfbGlzdCA9IEZjb25zICh0ZW1wX2xpc3QsIG5l d19saXN0KTsKKyAgICAgICAgIH0KKyAgICAgICB9CisgICAgIEFVVE9fU1RSSU5HIChmb3JtYXRf dGhyZWUsICJuZXdfbGlzdDogICVzIik7CisgICAgIENBTExOIChGbWVzc2FnZSwgZm9ybWF0X3Ro cmVlLCBuZXdfbGlzdCk7CisgICAgIGlmICghTklMUCAobmV3X2xpc3QpKQorICAgICAgIGJzZXRf bWNfbGlzdCAoY3VycmVudF9idWZmZXIsIG5ld19saXN0KTsgICovCisKKyAgaWYgKHJlbW92ZQor ICAgICAgfHwgKHctPm1jX2NhY2hlICYmIE5JTFAgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBtY19s aXN0KSkpCisgICAgICB8fCAody0+bWNfY2FjaGUgJiYgIU5JTFAgKEJWQVIgKGN1cnJlbnRfYnVm ZmVyLCBtY19saXN0KSkgJiYgdyAhPSBzdykpCisgICAgeworI2lmZGVmIEdMWVBIX0RFQlVHCisg IGRlYnVnX21ldGhvZF9hZGQgKHcsICJtY19jYWxjOiAgcmVtb3ZlIGN1cnNvcnMgdXNpbmcgY2Fj aGUiKTsKKyNlbmRpZgorICAgICAgZm9yICh2bGlzdCA9IFhDQVIgKFhDRFIgKHctPm1jX2NhY2hl KSk7CisgICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgICAgIHZsaXN0ID0gWENEUiAo dmxpc3QpKQorICAgICAgICB7CisgICAgICAgICAgY3Vyc29yX3NwZWNfbGlzdCA9IFhDQVIgKFhD QVIgKHZsaXN0KSk7CisgICAgICAgICAgcG9zaW50ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIg KDApLCBjdXJzb3Jfc3BlY19saXN0KSk7CisgICAgICAgICAgY3Vyc29yX3NwZWNfdHlwZSA9IEZu dGggKG1ha2VfbnVtYmVyICgxKSwgY3Vyc29yX3NwZWNfbGlzdCk7CisgICAgICAgICAgaWYgKENP TlNQIChjdXJzb3Jfc3BlY190eXBlKSkKKyAgICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlz cF90b19jdXJzb3JfdHlwZSAoWENBUiAoY3Vyc29yX3NwZWNfdHlwZSkpOworICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUg KGN1cnNvcl9zcGVjX3R5cGUpOworICAgICAgICAgIGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlw ZSkpCisgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSBYSU5UIChYQ0FSIChYQ0RSIChjdXJzb3Jf c3BlY190eXBlKSkpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBjdXJzb3Jfd2lk dGggPSAxOworICAgICAgICAgIGN1cnNvcl9jb2xvcl92ZWN0b3IgPSBGbnRoIChtYWtlX251bWJl ciAoMiksIGN1cnNvcl9zcGVjX2xpc3QpOworICAgICAgICAgIHJlZCA9IFhGTE9BVF9EQVRBIChB UkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAwKSk7CisgICAgICAgICAgZ3JlZW4gPSBYRkxPQVRf REFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMSkpOworICAgICAgICAgIGJsdWUgPSBY RkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMikpOworICAgICAgICAgIGlm IChwb3NpbnQKKyAgICAgICAgICAgICAgJiYgcG9zaW50ICE9IFBUICAvKiBQcm90ZWN0IHRoZSBy ZWFsIGN1cnNvciBmcm9tIGJlaW5nIGVyYXNlZC4gICovCisgICAgICAgICAgICAgICYmIHctPm1j LnN0YXJ0CisgICAgICAgICAgICAgICYmIHctPm1jLmVuZAorICAgICAgICAgICAgICAmJiBwb3Np bnQgPj0gdy0+bWMuc3RhcnQKKyAgICAgICAgICAgICAgJiYgcG9zaW50IDw9IHctPm1jLmVuZCkK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgeF95X2hwb3NfdnBvc19saXN0ID0gWENBUiAo WENEUiAoWENBUiAodmxpc3QpKSk7CisgICAgICAgICAgICAgIHggPSBYSU5UIChGbnRoIChtYWtl X251bWJlciAoMCksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICB5ID0gWElO VCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAg ICAgICAgaHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgeF95X2hwb3NfdnBvc19s aXN0KSk7CisgICAgICAgICAgICAgIHZwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMyks IHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICBtY19lcmFzZSAodywgeCwgeSwg aHBvcywgdnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcmVkLCBncmVlbiwgYmx1ZSk7 CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIHctPm1jX2NhY2hlID0gUW5pbDsKKyAg ICB9CisKKyAgaWYgKCFyZW1vdmUKKyAgICAgICYmIHcgPT0gc3cKKyAgICAgICYmIHctPm1jLnN0 YXJ0CisgICAgICAmJiB3LT5tYy5lbmQKKyAgICAgICYmIHctPm1jLnByZXZfc3RhcnQKKyAgICAg ICYmIHctPm1jLnByZXZfZW5kCisgICAgICAmJiB3LT5tYy5zdGFydCA9PSB3LT5tYy5wcmV2X3N0 YXJ0CisgICAgICAmJiB3LT5tYy5lbmQgPT0gdy0+bWMucHJldl9lbmQKKyAgICAgICYmICFOSUxQ IChCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNfbGlzdCkpCisgICAgICAmJiB3LT5tY19jYWNoZQor ICAgICAgJiYgIU5JTFAgKEZlcXVhbCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB3LT5tY19jYWNo ZSksIEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBtY19saXN0KSkpKQorICAgIHsKKyNpZmRlZiBHTFlQ SF9ERUJVRworICBkZWJ1Z19tZXRob2RfYWRkICh3LCAibWNfY2FsYzogIGRyYXcgY3Vyc29ycyB1 c2luZyBjYWNoZSIpOworI2VuZGlmCisgICAgICBmb3IgKHZsaXN0ID0gWENBUiAoWENEUiAody0+ bWNfY2FjaGUpKTsKKyAgICAgICAgICAgQ09OU1AgKHZsaXN0KTsKKyAgICAgICAgICAgdmxpc3Qg PSBYQ0RSICh2bGlzdCkpCisgICAgICAgIHsKKyAgICAgICAgICBjdXJzb3Jfc3BlY19saXN0ID0g WENBUiAoWENBUiAodmxpc3QpKTsKKyAgICAgICAgICBwb3NpbnQgPSBYSU5UIChGbnRoIChtYWtl X251bWJlciAoMCksIGN1cnNvcl9zcGVjX2xpc3QpKTsKKyAgICAgICAgICBjdXJzb3Jfc3BlY190 eXBlID0gRm50aCAobWFrZV9udW1iZXIgKDEpLCBjdXJzb3Jfc3BlY19saXN0KTsKKyAgICAgICAg ICBpZiAoQ09OU1AgKGN1cnNvcl9zcGVjX3R5cGUpKQorICAgICAgICAgICAgY3Vyc29yX3R5cGUg PSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChjdXJzb3Jfc3BlY190eXBlKSk7CisgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJz b3JfdHlwZSAoY3Vyc29yX3NwZWNfdHlwZSk7CisgICAgICAgICAgaWYgKENPTlNQIChjdXJzb3Jf c3BlY190eXBlKSkKKyAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IFhJTlQgKFhDQVIgKFhDRFIg KGN1cnNvcl9zcGVjX3R5cGUpKSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGN1 cnNvcl93aWR0aCA9IDE7CisgICAgICAgICAgY3Vyc29yX2NvbG9yX3ZlY3RvciA9IEZudGggKG1h a2VfbnVtYmVyICgyKSwgY3Vyc29yX3NwZWNfbGlzdCk7CisgICAgICAgICAgcmVkID0gWEZMT0FU X0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0b3IsIDApKTsKKyAgICAgICAgICBncmVlbiA9 IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAxKSk7CisgICAgICAgICAg Ymx1ZSA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAyKSk7CisgICAg ICAgICAgaWYgKHBvc2ludAorICAgICAgICAgICAgICAmJiB3LT5tYy5zdGFydAorICAgICAgICAg ICAgICAmJiB3LT5tYy5lbmQKKyAgICAgICAgICAgICAgJiYgcG9zaW50ID49IHctPm1jLnN0YXJ0 CisgICAgICAgICAgICAgICYmIHBvc2ludCA8PSB3LT5tYy5lbmQpCisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIHhfeV9ocG9zX3Zwb3NfbGlzdCA9IFhDQVIgKFhDRFIgKFhDQVIgKHZsaXN0 KSkpOworICAgICAgICAgICAgICB4ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lf aHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgeSA9IFhJTlQgKEZudGggKG1ha2VfbnVt YmVyICgxKSwgeF95X2hwb3NfdnBvc19saXN0KSk7CisgICAgICAgICAgICAgIGhwb3MgPSBYSU5U IChGbnRoIChtYWtlX251bWJlciAoMiksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAg ICAgICB2cG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDMpLCB4X3lfaHBvc192cG9zX2xp c3QpKTsKKyAgICAgICAgICAgICAgbWNfZHJhdyAodywgeCwgeSwgaHBvcywgdnBvcywgY3Vyc29y X3R5cGUsIGN1cnNvcl93aWR0aCwgcmVkLCBncmVlbiwgYmx1ZSk7CisgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICB9CisKKyAgaWYgKCFyZW1vdmUKKyAgICAgICYmIHcgPT0gc3cKKyAgICAg ICYmIHctPm1jLnN0YXJ0CisgICAgICAmJiB3LT5tYy5lbmQKKyAgICAgICYmICFOSUxQIChCVkFS IChjdXJyZW50X2J1ZmZlciwgbWNfbGlzdCkpCisgICAgICAmJiAoIXctPm1jX2NhY2hlCisgICAg ICAgICAgfHwKKyAgICAgICAgICBOSUxQIChGZXF1YWwgKEZudGggKG1ha2VfbnVtYmVyICgwKSwg dy0+bWNfY2FjaGUpLCBCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNfbGlzdCkpKSkpCisgICAgewor I2lmZGVmIEdMWVBIX0RFQlVHCisgIGRlYnVnX21ldGhvZF9hZGQgKHcsICJtY19jYWxjOiAgZHJh dyBjdXJzb3JzIGFuZXciKTsKKyNlbmRpZgorICAgICAgLyogRXJhc2UgYWxsIG9mIHRoZSBvbGQg Y3Vyc29ycyBhdCB0aGUgcHJldmlvdXNseSByZWNvcmRlZCB4L3kvaHBvcy92cG9zIGV2ZW4KKyAg ICAgIHRob3VnaCB0aGUgY29ycmVzcG9uZGluZyBgcG9zaW50JyBoYXMgY2hhbmdlZC4gICovCisg ICAgICBpZiAody0+bWNfY2FjaGUpCisgICAgICAgIHsKKyAgICAgICAgICBmb3IgKHZsaXN0ID0g WENBUiAoWENEUiAody0+bWNfY2FjaGUpKTsKKyAgICAgICAgICAgICAgIENPTlNQICh2bGlzdCk7 CisgICAgICAgICAgICAgICB2bGlzdCA9IFhDRFIgKHZsaXN0KSkKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgY3Vyc29yX3NwZWNfbGlzdCA9IFhDQVIgKFhDQVIgKHZsaXN0KSk7CisgICAg ICAgICAgICAgIHBvc2ludCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgwKSwgY3Vyc29yX3Nw ZWNfbGlzdCkpOworICAgICAgICAgICAgICBjdXJzb3Jfc3BlY190eXBlID0gRm50aCAobWFrZV9u dW1iZXIgKDEpLCBjdXJzb3Jfc3BlY19saXN0KTsKKyAgICAgICAgICAgICAgaWYgKENPTlNQIChj dXJzb3Jfc3BlY190eXBlKSkKKyAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3Bf dG9fY3Vyc29yX3R5cGUgKFhDQVIgKGN1cnNvcl9zcGVjX3R5cGUpKTsKKyAgICAgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29y X3R5cGUgKGN1cnNvcl9zcGVjX3R5cGUpOworICAgICAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNv cl9zcGVjX3R5cGUpKQorICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IFhJTlQgKFhDQVIg KFhDRFIgKGN1cnNvcl9zcGVjX3R5cGUpKSk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0gMTsKKyAgICAgICAgICAgICAgY3Vyc29yX2NvbG9y X3ZlY3RvciA9IEZudGggKG1ha2VfbnVtYmVyICgyKSwgY3Vyc29yX3NwZWNfbGlzdCk7CisgICAg ICAgICAgICAgIHJlZCA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAw KSk7CisgICAgICAgICAgICAgIGdyZWVuID0gWEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xv cl92ZWN0b3IsIDEpKTsKKyAgICAgICAgICAgICAgYmx1ZSA9IFhGTE9BVF9EQVRBIChBUkVGIChj dXJzb3JfY29sb3JfdmVjdG9yLCAyKSk7CisgICAgICAgICAgICAgIHhfeV9ocG9zX3Zwb3NfbGlz dCA9IFhDQVIgKFhDRFIgKFhDQVIgKHZsaXN0KSkpOworICAgICAgICAgICAgICB4ID0gWElOVCAo Rm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAg ICAgeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3NfdnBvc19saXN0KSk7 CisgICAgICAgICAgICAgIGhwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMiksIHhfeV9o cG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICB2cG9zID0gWElOVCAoRm50aCAobWFrZV9u dW1iZXIgKDMpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgbWNfZXJhc2Ug KHcsIHgsIHksIGhwb3MsIHZwb3MsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJlZCwgZ3Jl ZW4sIGJsdWUpOworICAgICAgICAgICAgfQorICAgICAgICAgIHctPm1jX2NhY2hlID0gUW5pbDsK KyAgICAgICAgfQorICAgICAgZm9yICh2bGlzdCA9IEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBtY19s aXN0KTsKKyAgICAgICAgICAgQ09OU1AgKHZsaXN0KTsKKyAgICAgICAgICAgdmxpc3QgPSBYQ0RS ICh2bGlzdCkpCisgICAgICAgIHsKKyAgICAgICAgICBjdXJzb3Jfc3BlY19saXN0ID0gWENBUiAo dmxpc3QpOworICAgICAgICAgIHBvc2ludCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgwKSwg Y3Vyc29yX3NwZWNfbGlzdCkpOworICAgICAgICAgIGN1cnNvcl9zcGVjX3R5cGUgPSBGbnRoICht YWtlX251bWJlciAoMSksIGN1cnNvcl9zcGVjX2xpc3QpOworICAgICAgICAgIGlmIChDT05TUCAo Y3Vyc29yX3NwZWNfdHlwZSkpCisgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9f Y3Vyc29yX3R5cGUgKFhDQVIgKGN1cnNvcl9zcGVjX3R5cGUpKTsKKyAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChjdXJz b3Jfc3BlY190eXBlKTsKKyAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9zcGVjX3R5cGUpKQor ICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0gWElOVCAoWENBUiAoWENEUiAoY3Vyc29yX3NwZWNf dHlwZSkpKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0g MTsKKyAgICAgICAgICBjdXJzb3JfY29sb3JfdmVjdG9yID0gRm50aCAobWFrZV9udW1iZXIgKDIp LCBjdXJzb3Jfc3BlY19saXN0KTsKKyAgICAgICAgICByZWQgPSBYRkxPQVRfREFUQSAoQVJFRiAo Y3Vyc29yX2NvbG9yX3ZlY3RvciwgMCkpOworICAgICAgICAgIGdyZWVuID0gWEZMT0FUX0RBVEEg KEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0b3IsIDEpKTsKKyAgICAgICAgICBibHVlID0gWEZMT0FU X0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0b3IsIDIpKTsKKyAgICAgICAgICBpZiAocG9z aW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICB4X3lfaHBvc192cG9zX2xpc3QgPSBt Y194X3lfaHBvc192cG9zICh3LCBwb3NpbnQpOworICAgICAgICAgICAgICB0ZW1wID0gRmNvbnMg KGN1cnNvcl9zcGVjX2xpc3QsIEZjb25zICh4X3lfaHBvc192cG9zX2xpc3QsIFFuaWwpKTsKKyAg ICAgICAgICAgICAgcmVzdWx0ID0gRmNvbnMgKHRlbXAsIHJlc3VsdCk7CisgICAgICAgICAgICAg IHggPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOwor ICAgICAgICAgICAgICB5ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBvc192 cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgaHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVy ICgyKSwgeF95X2hwb3NfdnBvc19saXN0KSk7CisgICAgICAgICAgICAgIHZwb3MgPSBYSU5UIChG bnRoIChtYWtlX251bWJlciAoMyksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAg ICBpZiAody0+bWMuc3RhcnQKKyAgICAgICAgICAgICAgICAgICYmIHctPm1jLmVuZAorICAgICAg ICAgICAgICAgICAgJiYgcG9zaW50ID49IHctPm1jLnN0YXJ0CisgICAgICAgICAgICAgICAgICAm JiBwb3NpbnQgPD0gdy0+bWMuZW5kKQorICAgICAgICAgICAgICAgIG1jX2RyYXcgKHcsIHgsIHks IGhwb3MsIHZwb3MsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJlZCwgZ3JlZW4sIGJsdWUp OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAocmVzdWx0KQorICAgICAgICB3 LT5tY19jYWNoZSA9IEZjb25zIChCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNfbGlzdCksIEZjb25z IChGcmV2ZXJzZSAocmVzdWx0KSwgUW5pbCkpOworICAgIH0KKyAgaWYgKG9sZF9idW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iB0aGUgYG1jLWxpc3QnIGhhcyBqdXN0IGJlZW4KKyAgICAgIHNl dCB0byBgUW5pbCcsIHRoZW4gcmVtb3ZlIGZha2UgY3Vyc29ycyBhbmQgcmVkcmF3IHRoZSByZWFs IGN1cnNvci4gICovCisgICAgICBpZiAoKCFOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNf bGlzdCkpIHx8IHctPm1jX2NhY2hlKQorICAgICAgICAgICYmICFNSU5JX1dJTkRPV19QICh3KSkK KyAgICAgICAgeworICAgICAgICAgIGlmIChOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNf bGlzdCkpICYmIHctPm1jX2NhY2hlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19j YWxjICh3LCAxKTsgLyogUmVtb3ZlIGZha2UgY3Vyc29ycy4gICovCisgICAgICAgICAgICAgIGlm IChjdXJzb3Jfb25fcCkgLyogUmVkcmF3IHJlYWwgY3Vyc29yLiAgKi8KKyAgICAgICAgICAgICAg ICBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yICh3LCAxLAorICAgICAgICAgICAgICAgICAgdy0+b3V0 cHV0X2N1cnNvci5ocG9zLCB3LT5vdXRwdXRfY3Vyc29yLnZwb3MsCisgICAgICAgICAgICAgICAg ICB3LT5vdXRwdXRfY3Vyc29yLngsIHctPm91dHB1dF9jdXJzb3IueSk7CisgICAgICAgICAgICB9 CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIG1jX2NhbGMgKHcsIDApOyAvKiBEcmF3 IGZha2UgY3Vyc29ycyAgKi8KKyAgICAgICAgfQorCiAgICAgICBpZiAoZHJhd193aW5kb3dfZnJp bmdlcyAodywgdHJ1ZSkpCiAJewogCSAgaWYgKFdJTkRPV19SSUdIVF9ESVZJREVSX1dJRFRIICh3 KSkKQEAgLTE0NDksMTAgKzE0NjcsMTMgQEAgc3RhdGljIHZvaWQgeF9jaGVja19mb250IChzdHJ1 Y3QgZnJhbWUgKiwgc3R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hc2Ug SE9MTE9XX0JPWF9DVVJTT1I6CisgIHsKKyAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYm IGdyZWVuID49IDApCisgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgeworICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYg PSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICAgICAgICBzdHJ1Y3QgeF9kaXNwbGF5X2lu Zm8gKmRweWluZm8gPSBGUkFNRV9ESVNQTEFZX0lORk8gKGYpOworICAgICAgICB1bnNpZ25lZCBs b25nIG9yaWdfdmFsID0gZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsOworICAgICAgICBp bnQgaW50X3JlZCA9IHJlZCAqIDY1NTM1OworICAgICAgICBpbnQgaW50X2dyZWVuID0gZ3JlZW4g KiA2NTUzNTsKKyAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDY1NTM1OworICAgICAgICBm LT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSB4X21ha2VfdHJ1ZWNvbG9yX3BpeGVsIChk cHlpbmZvLCBpbnRfcmVkLCBpbnRfZ3JlZW4sIGludF9ibHVlKTsKKyAgICAgICAgeF9kcmF3X2hv bGxvd19jdXJzb3IgKHcsIGdseXBoX3Jvdyk7CisgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1 cnNvcl9waXhlbCA9IG9yaWdfdmFsOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgICB4X2Ry YXdfaG9sbG93X2N1cnNvciAodywgZ2x5cGhfcm93KTsKKyAgICBicmVhazsKKyAgfQorICBjYXNl IEZJTExFRF9CT1hfQ1VSU09SOgorICB7CisgICAgIC8qIFRPRE86ICBrZGIgdG8gY29uc2lkZXIg YWRkaW5nIHN1cHBvcnQgZm9yIG11bHRpcGxlIGN1cnNvciBmb3Jl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0geF9tYWtl X3RydWVjb2xvcl9waXhlbCAoZHB5aW5mbywgaW50X3JlZCwgaW50X2dyZWVuLCBpbnRfYmx1ZSk7 CisgICAgICAgIHhfZHJhd19iYXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwg QkFSX0NVUlNPUik7CisgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9y aWdfdmFsOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAo dywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEJBUl9DVVJTT1IpOworICAgIGJyZWFrOworICB9 CisgIGNhc2UgSEJBUl9DVVJTT1I6CisgIHsKKyAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAw ICYmIGdyZWVuID49IDApCisgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9k YXRhLngtPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgeworICAgICAgICBzdHJ1Y3QgZnJhbWUg KmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICAgICAgICBzdHJ1Y3QgeF9kaXNwbGF5 X2luZm8gKmRweWluZm8gPSBGUkFNRV9ESVNQTEFZX0lORk8gKGYpOworICAgICAgICB1bnNpZ25l ZCBsb25nIG9yaWdfdmFsID0gZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsOworICAgICAg ICBpbnQgaW50X3JlZCA9IHJlZCAqIDY1NTM1OworICAgICAgICBpbnQgaW50X2dyZWVuID0gZ3Jl ZW4gKiA2NTUzNTsKKyAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDY1NTM1OworICAgICAg ICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSB4X21ha2VfdHJ1ZWNvbG9yX3BpeGVs IChkcHlpbmZvLCBpbnRfcmVkLCBpbnRfZ3JlZW4sIGludF9ibHVlKTsKKyAgICAgICAgeF9kcmF3 X2Jhcl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRoLCBIQkFSX0NVUlNPUik7Cisg ICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdfdmFsOworICAgICAg fQorICAgICAgZWxzZQorICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBj dXJzb3Jfd2lkdGgsIEhCQVJfQ1VSU09SKTsKKyAgICBicmVhazsKKyAgfQorICBjYXNlIE5PX0NV UlNPUjoKKyAgICB3LT5waHlzX2N1cnNvcl93aWR0aCA9IDA7CisgICAgYnJlYWs7CisgIGRlZmF1 bHQ6CisgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KIAl9CiAKICNpZmRlZiBIQVZFX1hfSTE4Tgo= --Multipart_Mon_Mar_28_20:45:06_2016-1--