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: Tue, 08 Mar 2016 22:27:02 -0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by - "") Content-Type: multipart/mixed; boundary="Multipart_Tue_Mar__8_22:27:01_2016-1" X-Trace: ger.gmane.org 1457504907 18937 80.91.229.3 (9 Mar 2016 06:28:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Mar 2016 06:28:27 +0000 (UTC) Cc: 22873@debbugs.gnu.org To: Marcin Borkowski , John Wiegley , Richard Stallman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 09 07:28:16 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 1adXbR-0000Zk-7R for geb-bug-gnu-emacs@m.gmane.org; Wed, 09 Mar 2016 07:28:13 +0100 Original-Received: from localhost ([::1]:39384 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adXbQ-0000bO-Ao for geb-bug-gnu-emacs@m.gmane.org; Wed, 09 Mar 2016 01:28:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adXbK-0000bD-Su for bug-gnu-emacs@gnu.org; Wed, 09 Mar 2016 01:28:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1adXbG-0001on-KB for bug-gnu-emacs@gnu.org; Wed, 09 Mar 2016 01:28:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adXbG-0001oj-G8 for bug-gnu-emacs@gnu.org; Wed, 09 Mar 2016 01:28:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1adXbG-0001xe-98 for bug-gnu-emacs@gnu.org; Wed, 09 Mar 2016 01:28:02 -0500 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: Wed, 09 Mar 2016 06:28: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.14575048337478 (code B ref 22873); Wed, 09 Mar 2016 06:28:02 +0000 Original-Received: (at 22873) by debbugs.gnu.org; 9 Mar 2016 06:27:13 +0000 Original-Received: from localhost ([127.0.0.1]:40414 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1adXaS-0001wX-NB for submit@debbugs.gnu.org; Wed, 09 Mar 2016 01:27:12 -0500 Original-Received: from cobb.liquidweb.com ([50.28.13.150]:38894) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1adXaQ-0001wJ-Lc for 22873@debbugs.gnu.org; Wed, 09 Mar 2016 01:27:11 -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; bh=kgmqyX7DfQTzbZBaYUw+d4U5F1ChPR0TLMEhJPpXHJA=; b=8S2uwGPGqsBecBkZ/+9AEGVrwULbFlxfPr1wT0sGruuAzcA+Rc8ws5JdVwSjSFbu1IDAn2zao/pTTItfjUQEoBXcTnGPyuk9jEjtQfEfJhpI9bJbKiFK4xR1uKf9z+lU; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:56454 helo=server.private.localhost) by cobb.liquidweb.com with esmtp (Exim 4.82) (envelope-from ) id 1adXaH-00031Q-Mw; Wed, 09 Mar 2016 01:27:02 -0500 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:114627 Archived-At: --Multipart_Tue_Mar__8_22:27:01_2016-1 Content-Type: text/plain; charset=US-ASCII The second draft of the proposed feature for multiple fake cursors is attached. For the record, I'm not a programmer -- just a hobbyist -- and the draft patch is not meant to be a proposed official patch -- it is just a working proof concept. The patch contains a few extra things that I use for debugging and also for drawing my solid vertical line that tracks the cursor position. It has been tested to some extent on Emacs built for OSX 10.6.8 and Windows XP (SP-3). Different colors for each fake cursor have already been implemented on Emacs for OSX, but I haven't yet looked into how to accomplish that objective on Emacs for Windows. The draft concept patch is for the master branch as of March 8, 2016 bearing commit "e0400b72a24d67b53f71c8b97915cae599e36c37". After applying the patch, the new feature can be tested as follows: (defun mc-test (&optional list) "Draw fake cursors at all POS defined in the `mc-list'." (interactive) (setq mc-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" [1.0 1.0 1.0]) (7 ("hbar" 3) [1.0 0.0 1.0]) (8 ("bar" 3) [0.0 1.0 1.0])))) (global-set-key [f1] 'mc-test) To remove the cursors or change the cursors, just modify the buffer-local variable `mc-list' -- e.g., `(setq mc-list nil)` removes them all. The colors on OSX are the standard RGB color vector. Thank you, Marcin, for the referral to the ideit feature. I will certainly try that feature out in the next few days, but have been buried in life's daily activities and also in acquiring the necessary skills to implement the fake cursors feature. It sure would be great if a real programmer (instead of just a hobbyist like myself) could take this feature to the next level. If the Windows setup is anything similar to OSX, implementing colors should not be that difficult to achieve (at least I hope that is the case). I would like this feature to be similar to the original cursor such that a variable like `cursor-in-non-selected-windows' can be used to make the fake cursors displayed in only the selected window or in all windows where those points are visible. At the present time, I've set it up so that only the selected window receives the fake cursors (as that is my personal preference). Thank you for taking an interest in this potential new feature, Keith ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; At Sat, 05 Mar 2016 07:59:52 +0100, Marcin Borkowski wrote: > > * * * > > Out of curiosity: did you try iedit? How does it compare wrt speed in > such extreme cases? (If it's applicable at all, that is - it's way > simpler than multiple-cursors, of course.) --Multipart_Tue_Mar__8_22:27:01_2016-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="multiple_cursors.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIuYyBiL3NyYy9idWZmZXIuYwppbmRleCA5OGI2MWMzLi4w ZDNlYTc0IDEwMDY0NAotLS0gYS9zcmMvYnVmZmVyLmMKKysrIGIvc3JjL2J1ZmZlci5jCkBAIC01 MDczLDYgKzUwNzMsOSBAQCBpbml0X2J1ZmZlcl9vbmNlICh2b2lkKQogICBYU0VURkFTVElOVCAo QlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgZGlzcGxheV90YWJsZSksIGlkeCk7ICsraWR4Owog ICBYU0VURkFTVElOVC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ICAgICBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIGN1cnNvcl90eXBlLAotCQkJICAg ICAgaW50IGN1cnNvcl93aWR0aCwgYm9vbCBvbl9wLCBib29sIGFjdGl2ZV9wKTsKKwkJCSAgICAg IGludCBjdXJzb3Jfd2lkdGgsIGJvb2wgb25fcCwgYm9vbCBhY3RpdmVfcCwKKwkJCSAgICAgIGlu dCByZWQsIGludCBncmVlbiwgaW50IGJsdWUpOwogCiAgIC8qIERyYXcgdmVydGljYWwgYm9yZGVy IGZvciB3aW5kb3cgVyBmcm9tIChYLFlfMCkgdG8gKFgsWV8xKS4gICovCiAgIHZvaWQgKCpkcmF3 X3ZlcnRpY2FsX3dpbmRvd19ib3JkZXIpIChzdHJ1Y3Qgd2luZG93ICp3LApAQCAtMzI4NywxMSAr MzI4OCwxMSBAQCBleHRlcm4gdm9pZCB4X2ZpeF9vdmVybGFwcGluZ19hcmVhIChzdHJ1Y3Qgd2lu ZG93ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gZ2x5cGhfcm93X2FyZWEsIGludCk7CiBleHRlcm4gdm9pZCBkcmF3X3BoeXNf Y3Vyc29yX2dseXBoIChzdHJ1Y3Qgd2luZG93ICosCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICosCi0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UpOworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlLCBjaGFyICopOwogZXh0ZXJuIHZv aWQgZ2V0X3BoeXNfY3Vyc29yX2dlb21ldHJ5IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlw aF9yb3cgKiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3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hbCAoYik7CisgICAg fQorICBpZiAody0+d2luZG93X3N0YXJ0X2VuZF9ob29rX3BlbmRpbmcKKyAgICAgICAgJiYgKCFO SUxQIChCVkFSIChjdXJyZW50X2J1ZmZlciwgd2luZG93X3N0YXJ0X2VuZF9ob29rKSkKKyAgICAg ICAgICAgIHx8ICFOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNfbGlzdCkpCisgICAgICAg ICAgICB8fCB3LT5tY19jYWNoZSkpCisgICAgeworICAgICAgaWYgKCgocG9zaW50ID49IENIQVJQ T1MgKHN0YXJ0cCkgJiYgcG9zaW50IDw9IEJVRl9aViAoYikpCisgICAgICAgICAgICAmJiBDSEFS UE9TIChzdGFydHApID49IEJVRl9CRUdWIChiKQorICAgICAgICAgICAgJiYgQ0hBUlBPUyAoc3Rh cnRwKSA8PSBCVUZfWlYgKGIpCisgICAgICAgICAgICAmJiBwb3NfdmlzaWJsZV9wICh3LCBwb3Np bnQsICZ4LCAmeSwgJnJ0b3AsICZyYm90LCAmcm93aCwgJnZwb3MpKSkKKyAgICAgICAgZnVsbHlf cCA9ICFydG9wICYmICFyYm90OworICAgICAgaWYgKGZ1bGx5X3ApCisgICAgICAgIHsKKyAgICAg ICAgICB3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50X3ByZXZpb3VzX3dpbmRvd19zdGFydCA9 IHctPndpbmRvd19zdGFydF9lbmRfaG9va19pbnRfd2luZG93X3N0YXJ0OworICAgICAgICAgIHct PndpbmRvd19zdGFydF9lbmRfaG9va19pbnRfd2luZG93X3N0YXJ0ID0gc3RhcnRwX2ludGVnZXI7 CisgICAgICAgICAgaXRkYXRhID0gYmlkaV9zaGVsdmVfY2FjaGUgKCk7CisgICAgICAgICAgc3Rh cnRfZGlzcGxheSAoJml0LCB3LCBzdGFydHApOworICAgICAgICAgIG1vdmVfaXRfdmVydGljYWxs eSAoJml0LCB3aW5kb3dfYm94X2hlaWdodCAodykpOworICAgICAgICAgIGlmIChpdC5jdXJyZW50 X3kgPCBpdC5sYXN0X3Zpc2libGVfeSkKKyAgICAgICAgICAgIG1vdmVfaXRfcGFzdF9lb2wgKCZp dCk7CisgICAgICAgICAgZW5kcCA9IChJVF9DSEFSUE9TIChpdCkpOworICAgICAgICAgIHctPndp bmRvd19zdGFydF9lbmRfaG9va19pbnRfcHJldmlvdXNfd2luZG93X2VuZCA9IHctPndpbmRvd19z dGFydF9lbmRfaG9va19pbnRfd2luZG93X2VuZDsKKyAgICAgICAgICB3LT53aW5kb3dfc3RhcnRf ZW5kX2hvb2tfaW50X3dpbmRvd19lbmQgPSBlbmRwOworICAgICAgICAgIGJpZGlfdW5zaGVsdmVf Y2FjaGUgKGl0ZGF0YSwgZmFsc2UpOworICAgICAgICAgIFNFVF9QVCAoc3RhcnRwX2ludGVnZXIp OworICAgICAgICAgIHBib2xfc3RhcnRwID0gWElOVCAoRmxpbmVfYmVnaW5uaW5nX3Bvc2l0aW9u IChRbmlsKSk7CisgICAgICAgICAgU0VUX1BUIChlbmRwKTsKKyAgICAgICAgICBwZW9sX2VuZHAg PSBYSU5UIChGbGluZV9lbmRfcG9zaXRpb24gKFFuaWwpKTsKKyAgICAgICAgICBTRVRfUFQgKHBv c2ludCk7CisjaWZkZWYgR0xZUEhfREVCVUcKKyAgICAgICAgICBkZWJ1Z19tZXRob2RfYWRkICh3 LCAiJXMgLS0geDogJWQgfCB5OiAlZCB8IHN0YXJ0cDogJWQgfCBlbmRwOiAlZCB8IHBib2xfc3Rh cnRwOiAlZCB8IHBlb2xfZW5kcDogJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHN0cmluZywgeCwgeSwgc3RhcnRwX2ludGVnZXIsIGVuZHAsIHBib2xfc3RhcnRwLCBwZW9sX2Vu ZHApOworI2VuZGlmCisgICAgICAgICAgLyogUmVzZXQgdGhlIGZsYWcgX2JlZm9yZV8gY2FsbGlu ZyBMaXNwLCBub3QgYWZ0ZXIsIHNvIHRoYXQKKyAgICAgICAgICAgICBpZiBMaXNwIGRvZXMgc2ln bmFsIGFuIGVycm9yLCB0aGUgZmxhZyB3aWxsIGJlIHJlc2V0LCBhbmQKKyAgICAgICAgICAgICB3 b24ndCBjYXVzZSB0aGUgaG9vayB0byBiZSBjYWxsZWQgYWQgbmF1c2VhbS4gICovCisgICAgICAg ICAgdy0+d2luZG93X3N0YXJ0X2VuZF9ob29rX3BlbmRpbmcgPSBmYWxzZTsKKyAgICAgICAgICAv KiBXaGVuIGNhbGxpbmcgTGlzcCBmcm9tIHJlZGlzcGxheSwgYWx3YXlzIHVzZSBzYWZlX2NhbGws IHRvIGJlCisgICAgICAgICAgICAgcHJvdGVjdGVkIGFnYWluc3QgZXJyb3JzIHNpZ25hbGVkIGJ5 IHRoYXQgTGlzcC4gICovCisgICAgICAgICAgLyogc2FmZV9jYWxsOiAgZm4sIGFyZzEsIGFyZzIs IGFyZzMsIGFyZzQsIGFyZzUsIGFyZzYsIGFyZzcgICovCisgICAgICAgICAgc2FmZV9jYWxsICg4 LAorICAgICAgICAgICAgICBRcnVuX2hvb2tfd2l0aF9hcmdzLAorICAgICAgICAgICAgICBRd2lu ZG93X3N0YXJ0X2VuZF9ob29rLAorICAgICAgICAgICAgICB3aW5kb3csCisgICAgICAgICAgICAg IG1ha2VfbnVtYmVyIChzdGFydHBfaW50ZWdlciksCisgICAgICAgICAgICAgIG1ha2VfbnVtYmVy IChlbmRwKSwKKyAgICAgICAgICAgICAgbWFrZV9udW1iZXIgKHBib2xfc3RhcnRwKSwKKyAgICAg ICAgICAgICAgbWFrZV9udW1iZXIgKHBlb2xfZW5kcCksCisgICAgICAgICAgICAgIGZ1bGx5X3Ag PyBRdCA6IFFuaWwpOworICAgICAgICAgIC8qIEF0IHRoZSBjYXRjaC1hbGwgd2hlbiBzY3JvbGxp bmcgd2l0aCB0aGUgbW91c2Ugd2hlZWwsIHRoaXMgbmV4dCBzZWN0aW9uIGNhdXNlcyBhIHZpc3Vh bCBmbGFzaAorICAgICAgICAgIG9mIGN1cnNvciBpbiB0aGUgd3JvbmcgcG9zaXRpb24gZHVlIHRv IFNFVF9QVCBhYm92ZS4gICovCisgICAgICAgICAgaWYgKGZvcmNlKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBjbGVhcl9nbHlwaF9tYXRyaXggKHctPmRlc2lyZWRfbWF0cml4KTsKKyAg ICAgICAgICAgICAgdHJ5X3dpbmRvdyAod2luZG93LCBzdGFydHAsIDApOworICAgICAgICAgICAg fQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisjaWZkZWYgR0xZUEhfREVC VUcKKyAgICAgICAgICAgIC8qIFNlZSB0aGUgZG9jLXN0cmluZyBmb3IgYHBvcy12aXNpYmxlLWlu LXdpbmRvdy1wJy4gICovCisgICAgICAgICAgICBkZWJ1Z19tZXRob2RfYWRkICh3LCAiJXMgLS0g eDogJWQgfCB5OiAlZCB8IHJ0b3A6ICVkIHwgcmJvdCAlZCB8IHJvd2g6ICVkIHwgdnBvczogJWQi LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyaW5nLCB4LCB5LCBydG9wLCBy Ym90LCByb3doLCB2cG9zKTsKKyNlbmRpZgorICAgICAgICAgIH0KKyAgICB9CisgIGlmIChvbGRf YnVmZmVyKQorICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworfQogCiAvKiBQ ZXJoYXBzIGluIHRoZSBmdXR1cmUgYXZvaWQgcmVjZW50ZXJpbmcgd2luZG93cyBpZiBpdAogICAg aXMgbm90IG5lY2Vzc2FyeTsgY3VycmVudGx5IHRoYXQgY2F1c2VzIHNvbWUgcHJvYmxlbXMuICAq LwpAQCAtMTM2ODcsNiArMTM3NzQsNyBAQCByZWRpc3BsYXlfaW50ZXJuYWwgKHZvaWQpCiAgICAg ICAmJiBtYXRjaF9wCiAgICAgICAmJiAhdy0+Zm9yY2Vfc3RhcnQKICAgICAgICYmICF3LT5vcHRp b25hbF9uZXdfc3Rhcn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HN0YXJ0cG9zKQorICAgIHsKKyAgICAgIGxp bmUgPSB3LT5iYXNlX2xpbmVfbnVtYmVyOworICAgICAgbGluZXBvcyA9IHctPmJhc2VfbGluZV9w b3M7CisgICAgICBsaW5lcG9zX2J5dGUgPSBidWZfY2hhcnBvc190b19ieXRlcG9zIChiLCBsaW5l cG9zKTsKKyAgICB9CisgIGVsc2UKKyAgICB7CisgICAgICBsaW5lID0gMTsKKyAgICAgIGxpbmVw b3MgPSBCVUZfQkVHViAoYik7CisgICAgICBsaW5lcG9zX2J5dGUgPSBCVUZfQkVHVl9CWVRFIChi KTsKKyAgICB9CisgIC8qIENvdW50IGxpbmVzIGZyb20gYmFzZSBsaW5lIHRvIHdpbmRvdyBzdGFy dCBwb3NpdGlvbi4gICovCisgIG5saW5lcyA9IGRpc3BsYXlfY291bnRfbGluZXMgKGxpbmVwb3Nf Ynl0ZSwKKyAgICAgICAgICAgICAgc3RhcnRwb3NfYnl0ZSwKKyAgICAgICAgICAgICAgc3RhcnRw b3MsICZqdW5rKTsKKyAgdG9wbGluZSA9IG5saW5lcyArIGxpbmU7CisgIC8qIERldGVybWluZSBh IG5ldyBiYXNlIGxpbmUsIGlmIHRoZSBvbGQgb25lIGlzIHRvbyBjbG9zZQorICAgICBvciB0b28g ZmFyIGF3YXksIG9yIGlmIHdlIGRpZCBub3QgaGF2ZSBvbmUuCisgICAgICJUb28gY2xvc2UiIG1l YW5zIGl0J3MgcGxhdXNpYmxlIGEgc2Nyb2xsLWRvd24gd291bGQKKyAgICAgZ28gYmFjayBwYXN0 IGl0LiAgKi8KKyAgaWYgKHN0YXJ0cG9zID09IEJVRl9CRUdWIChiKSkKKyAgICB7CisgICAgICB3 LT5iYXNlX2xpbmVfbnVtYmVyID0gdG9wbGluZTsKKyAgICAgIHctPmJhc2VfbGluZV9wb3MgPSBC VUZfQkVHViAoYik7CisgICAgfQorICBlbHNlIGlmIChubGluZXMgPCBoZWlnaHQgKyAyNSB8fCBu bGluZXMgPiBoZWlnaHQgKiAzICsgNTAKKyAgICAgfHwgbGluZXBvcyA9PSBCVUZfQkVHViAoYikp CisgICAgeworICAgICAgcHRyZGlmZl90IGxpbWl0ID0gQlVGX0JFR1YgKGIpOworICAgICAgcHRy ZGlmZl90IGxpbWl0X2J5dGUgPSBCVUZfQkVHVl9CWVRFIChiKTsKKyAgICAgIHB0cmRpZmZfdCBw b3NpdGlvbjsKKyAgICAgIHB0cmRpZmZfdCBkaXN0YW5jZSA9CisgICAgICAgIChoZWlnaHQgKiAy ICsgMzApICogbGluZV9udW1iZXJfZGlzcGxheV9saW1pdF93aWR0aDsKKyAgICAgIGlmIChzdGFy dHBvcyAtIGRpc3RhbmNlID4gbGltaXQpCisgICAgICAgIHsKKyAgICBsaW1pdCA9IHN0YXJ0cG9z IC0gZGlzdGFuY2U7CisgICAgbGltaXRfYnl0ZSA9IENIQVJfVE9fQllURSAobGltaXQpOworICAg ICAgICB9CisgICAgICBubGluZXMgPSBkaXNwbGF5X2NvdW50X2xpbmVzIChzdGFydHBvc19ieXRl LAorICAgICAgICAgICAgbGltaXRfYnl0ZSwKKyAgICAgICAgICAgIC0gKGhlaWdodCAqIDIgKyAz MCksCisgICAgICAgICAgICAmcG9zaXRpb24pOworICAgICAgLyogSWYgd2UgY291bGRuJ3QgZmlu ZCB0aGUgbGluZXMgd2Ugd2FudGVkIHdpdGhpbgorICAgICAgICAgbGluZV9udW1iZXJfZGlzcGxh eV9saW1pdF93aWR0aCBjaGFycyBwZXIgbGluZSwKKyAgICAgICAgIGdpdmUgdXAgb24gbGluZSBu dW1iZXJzIGZvciB0aGlzIHdpbmRvdy4gICovCisgICAgICBpZiAocG9zaXRpb24gPT0gbGltaXRf Ynl0ZSAmJiBsaW1pdCA9PSBzdGFydHBvcyAtIGRpc3RhbmNlKQorICAgICAgICB7CisgICAgdy0+ YmFzZV9saW5lX3BvcyA9IC0xOworICAgIHctPmJhc2VfbGluZV9udW1iZXIgPSAwOworICAgIGdv dG8gbm9fdmFsdWU7CisgICAgICAgIH0KKyAgICAgIHctPmJhc2VfbGluZV9udW1iZXIgPSB0b3Bs aW5lIC0gbmxpbmVzOworICAgICAgdy0+YmFzZV9saW5lX3BvcyA9IEJZVEVfVE9fQ0hBUiAocG9z aXRpb24pOworICAgIH0KKyAgLyogTm93IGNvdW50IGxpbmVzIGZyb20gdGhlIHN0YXJ0IHBvcyB0 byBwb2ludC4gICovCisgIG5saW5lcyA9IGRpc3BsYXlfY291bnRfbGluZXMgKHN0YXJ0cG9zX2J5 dGUsIFBUX0JZVEUsIFBULCAmanVuayk7CisgIC8qIE1ha2UgdGhlIHN0cmluZyB0byBzaG93LiAg Ki8KKyAgcGludDJzdHIgKGRlY29kZV9tb2RlX3NwZWNfYnVmLCB3aWR0aCwgdG9wbGluZSArIG5s aW5lcyk7CisgIHJldHVybiBkZWNvZGVfbW9kZV9zcGVjX2J1ZjsKKyAgICBub192YWx1ZToKKyAg ICAgICAgeworICAgIGNoYXIgKnAgPSBkZWNvZGVfbW9kZV9zcGVjX2J1ZjsKKyAgICBpbnQgcGFk ID0gd2lkdGggLSAyOworICAgIHdoaWxlIChwYWQtLSA+IDApCisgICAgICAqcCsrID0gJyAnOwor ICAgICpwKysgPSAnPyc7CisgICAgKnArKyA9ICc/JzsKKyAgICAqcCA9ICdcMCc7CisgICAgcmV0 dXJuIGRlY29kZV9tb2RlX3NwZWNfYnVmOworICB9CisgICAgICB9CisgICAgICBicmVhazsKKyAg ICB9CisgIGlmIChTVFJJTkdQIChvYmopKQorICAgIHsKKyAgICAgICpzdHJpbmcgPSBvYmo7Cisg ICAgICByZXR1cm4gU1NEQVRBIChvYmopOworICAgIH0KKyAgZWxzZQorICAgIHJldHVybiAiIjsK K30KKworREVGVU4gKCJsaW5lLW51bWJlci1hdC1wb3NpdGlvbiIsIEZsaW5lX251bWJlcl9hdF9w b3NpdGlvbiwgU2xpbmVfbnVtYmVyX2F0X3Bvc2l0aW9uLCAxLCAyLCAwLAorICAgICAgIGRvYzog LyogU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0YXJ0KTsKKyAgd2hpbGUgKFF0KQorICAgIHsKKyAgICAgIG9sZF9wYm9sID0gWElOVCAo RmxpbmVfYmVnaW5uaW5nX3Bvc2l0aW9uIChRbmlsKSk7CisgICAgICBvbGRfcGVvbCA9IFhJTlQg KEZsaW5lX2VuZF9wb3NpdGlvbiAoUW5pbCkpOworICAgICAgcGJvdmwgPSBQVDsKKyAgICAgIHNw ZWMgPSBpbnRlcm5hbF9saW5lX251bWJlcl9hdF9wb3NpdGlvbiAodywgJ2wnLCAwLCAmZm9vX3N0 cmluZyk7CisgICAgICBsaW5lID0gYnVpbGRfc3RyaW5nIChzcGVjKTsKKyAgICAgIGxpbmUgPSBG c3RyaW5nX3RvX251bWJlciAobGluZSwgbWFrZV9udW1iZXIgKDEwKSk7CisgICAgICBGdmVydGlj YWxfbW90aW9uIChtYWtlX251bWJlciAoMSksIHdpbmRvdywgUW5pbCk7CisgICAgICAvKiBteV95 ID0gKGZyYW1lX2NoYXJfaGVpZ2h0ICogY291bnRlcikgKyB3aW5kb3dfaGVhZGVyX2xpbmVfaGVp Z2h0OyAgKi8KKyAgICAgIC8qIG15X3kgPSBmcmFtZV9jaGFyX2hlaWdodCAqIGNvdW50ZXI7ICAq LworICAgICAgbmV3X3Bib2wgPSBYSU5UIChGbGluZV9iZWdpbm5pbmdfcG9zaXRpb24gKFFuaWwp KTsKKyAgICAgIG5ld19wZW9sID0gWElOVCAoRmxpbmVfZW5kX3Bvc2l0aW9uIChRbmlsKSk7Cisg ICAgICBpZiAoUFQgPT0gZW5kICYmICEoUFQgPT0gbmV3X3Bib2wpKQorICAgICAgICBwZW92bCA9 IGVuZDsKKyAgICAgICAgZWxzZSBpZiAob2xkX3Bib2wgPT0gb2xkX3Blb2wpCisgICAgICAgICAg eworICAgICAgICAgICAgcGJvdmwgPSBvbGRfcGJvbDsKKyAgICAgICAgICAgIHBlb3ZsID0gb2xk X3Blb2w7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHBlb3ZsID0g UFQgLSAxOworICAgICAgY29sX2VvdmwgPSBwZW92bCAtIHBib3ZsOworICAgICAgcGJvdmxfbWlu dXNfMSA9IHBib3ZsIC0gMTsKKyAgICAgIHBlb3ZsX3BsdXNfMSA9IHBlb3ZsICsgMTsKKyAgICAg IGlmIChvbGRfcGJvbCA9PSBvbGRfcGVvbCkKKyAgICAgICAgcGZjaSA9IG9sZF9wYm9sOworICAg ICAgICBlbHNlIGlmICgocGJvdmwgKyB2Y29sKSA8PSBwZW92bCkKKyAgICAgICAgICBwZmNpID0g cGJvdmwgKyB2Y29sOworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHBmY2kgPSBwZW92bDsK KyAgICAgIGlmIChwZmNpID4gMCAmJiAhKHBmY2kgPj0gbWF4KSkKKyAgICAgICAgeworICAgICAg ICAgIC8qIHRlbXAgPSBGcG9zbl9hdF9wb2ludCAobWFrZV9udW1iZXIgKHBmY2kpLCB3aW5kb3cp OworICAgICAgICAgIHggPSBYSU5UIChYQ0FSIChGbnRoIChtYWtlX251bWJlciAoMiksIHRlbXAp KSk7CisgICAgICAgICAgeSA9IFhJTlQgKFhDRFIgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgdGVt cCkpKTsKKyAgICAgICAgICBocG9zID0gWElOVCAoWENBUiAoRm50aCAobWFrZV9udW1iZXIgKDYp LCB0ZW1wKSkpOworICAgICAgICAgIHZwb3MgPSBYSU5UIChYQ0RSIChGbnRoIChtYWtlX251bWJl ciAoNiksIHRlbXApKSk7ICAqLworICAgICAgICAgIHBmY2lfbWludXNfMSA9IHBmY2kgLSAxOwor ICAgICAgICAgIHBmY2lfcGx1c18xID0gcGZjaSArIDE7CisgICAgICAgIH0KKyAgICAgIGlmIChw ZmNpID4gMCAmJiAhKHBmY2kgPj0gbWF4KSkKKyAgICAgICAgY2hhcl9hdF9wZmNpID0gKEZjaGFy X2FmdGVyIChtYWtlX251bWJlciAocGZjaSkpKTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIGNo YXJfYXRfcGZjaSA9IFFuaWw7CisgICAgICBpZiAocGZjaV9taW51c18xID4gMCAmJiAhKHBmY2lf bWludXNfMSA+PSBtYXgpKQorICAgICAgICBjaGFyX2JlZm9yZV9wZmNpID0gKEZjaGFyX2FmdGVy IChtYWtlX251bWJlciAocGZjaV9taW51c18xKSkpOworICAgICAgICBlbHNlCisgICAgICAgICAg Y2hhcl9iZWZvcmVfcGZjaSA9IFFuaWw7CisgICAgICBpZiAocGZjaV9wbHVzXzEgPiAwICYmICEo cGZjaV9wbHVzXzEgPj0gbWF4KSkKKyAgICAgICAgY2hhcl9hZnRlcl9wZmNpID0gKEZjaGFyX2Fm dGVyIChtYWtlX251bWJlciAocGZjaV9wbHVzXzEpKSk7CisgICAgICAgIGVsc2UKKyAgICAgICAg ICBjaGFyX2FmdGVyX3BmY2kgPSBRbmlsOworICAgICAgaWYgKHBlb3ZsID4gMCAmJiAhKHBlb3Zs ID49IG1heCkpCisgICAgICAgIGNoYXJfYXRfcGVvdmwgPSAoRmNoYXJfYWZ0ZXIgKG1ha2VfbnVt YmVyIChwZW92bCkpKTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIGNoYXJfYXRfcGVvdmwgPSBR bmlsOworICAgICAgaWYgKEZjaGFyYWN0ZXJwIChjaGFyX2F0X3BmY2ksIFFuaWwpKQorICAgICAg ICBzdHJpbmdfY2hhcl9hdF9wZmNpID0gKEZjaGFyX3RvX3N0cmluZyAoY2hhcl9hdF9wZmNpKSk7 CisgICAgICAgIGVsc2UKKyAgICAgICAgICBzdHJpbmdfY2hhcl9hdF9wZmNpID0gUW5pbDsKKyAg ICAgIGlmIChGY2hhcmFjdGVycCAoY2hhcl9iZWZvcmVfcGZjaSwgUW5pbCkpCisgICAgICAgIHN0 cmluZ19jaGFyX2JlZm9yZV9wZmNpID0gKEZjaGFyX3RvX3N0cmluZyAoY2hhcl9iZWZvcmVfcGZj aSkpOworICAgICAgICBlbHNlCisgICAgICAgIC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bWJlciAobXlfeCksIG1ha2VfbnVtYmVyIChteV95KSwgbWFrZV9udW1iZXIgKHZj b2wpLCBtYWtlX251bWJlciAoY291bnRlcikpLCBRbmlsKSksCisgICAgICAgIEZjb25zIChidWls ZF9wdXJlX2Nfc3RyaW5nICgicG9zbi1hdC1wZmNpICh4LCB5LCBocG9zLCB2cG9zKSIpLAorICAg ICAgICAgIEZjb25zIChsaXN0biAoQ09OU1RZUEVfUFVSRSwgNCwgbWFrZV9udW1iZXIgKHgpLCBt YWtlX251bWJlciAoeSksIG1ha2VfbnVtYmVyIChocG9zKSwgbWFrZV9udW1iZXIgKHZwb3MpKSwg UW5pbCkpICAqLworICAgICAgaWYgKE5JTFAgKHJlc3VsdCkpCisgICAgICAgIHJlc3VsdCA9IEZj b25zICh0ZW1wLCBRbmlsKTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIHJlc3VsdCA9IEZjb25z ICh0ZW1wLCByZXN1bHQpOworICAgICAgY291bnRlciA9IDEgKyBjb3VudGVyOworICAgICAgaWYg KFBUID49IGVuZCB8fCBQVCA9PSBtYXgpCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgU0VUX1BU IChvcG9pbnQpOworICBpZiAob2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVyX2ludGVybmFsIChv bGRfYnVmZmVyKTsKKyAgYnNldF9wb3NuX2xpc3QgKGN1cnJlbnRfYnVmZmVyLCBGcmV2ZXJzZSAo cmVzdWx0KSk7CisgIHJldHVybiBCVkFSIChjdXJyZW50X2J1ZmZlciwgcG9zbl9saXN0KTsKK30K IAogLyogQ291bnQgdXAgdG8gQ09VTlQgbGluZXMgc3RhcnRpbmcgZnJvbSBTVEFSVF9CWVRFLiAg Q09VTlQgbmVnYXRpdmUKICAgIG1lYW5zIGNvdW50IGxpbmVzIGJhY2sgZnJvbSBTVEFSVF9CWVRF LiAgQnV0IGRvbid0IGdvIGJleW9uZApAQCAtMjgxNTEsOCArMjg2MjMsMTUgQEAgeF9maXhf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AgIGN1cnNvcl9n bHlwaCA9IE5VTEw7CisgICAgICBpZiAody0+aHNjcm9sbCkKKyAgICAgICAgeworICAgICAgICAg IC8qIFdoZW4gdGhlIHdpbmRvdyBpcyBoc2Nyb2xsZWQsIGN1cnNvciBocG9zIGNhbiBsZWdpdGlt YXRlbHkgYmUKKyAgICAgICAgICAgb3V0IG9mIGJvdW5kcywgYnV0IHdlIGRyYXcgdGhlIGN1cnNv ciBhdCB0aGUgY29ycmVzcG9uZGluZworICAgICAgICAgICB3aW5kb3cgbWFyZ2luIGluIHRoYXQg Y2FzZS4gICovCisgICAgICAgICAgaWYgKCFjdXJzb3Jfcm93LT5yZXZlcnNlZF9wICYmIGhwb3Mg PCAwKQorICAgICAgICAgICAgaHBvcyA9IDA7CisgICAgICAgICAgaWYgKGN1cnNvcl9yb3ctPnJl dmVyc2VkX3AgJiYgaHBvcyA+PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAg ICAgICBocG9zID0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgICAgICAgfQor ICAgICAgaWYgKDAgPD0gaHBvcyAmJiBocG9zIDwgY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFd KQorICAgICAgICBjdXJzb3JfZ2x5cGggPSBjdXJzb3Jfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSAr IGhwb3M7CisgICAgICBlbHNlCisgICAgICAgIGN1cnNvcl9nbHlwaCA9IE5VTEw7CisgICAgICBp ZiAoY3Vyc29yX2dseXBoID09IE5VTEwpCisgICAgICAgIGdvdG8gbWFya19jdXJzb3Jfb2ZmOwor ICAgICAgd2lkdGggPSBjdXJzb3JfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgaG9sbG93X3gg PSB4OworICAgICAgaWYgKHggPCAwKQorICAgICAgICB7CisgICAgICAgICAgd2lkdGggKz0gaG9s bG93X3g7CisgICAgICAgICAgaG9sbG93X3ggPSAwOworICAgICAgICB9CisgICAgICB3aWR0aCA9 IG1pbiAod2lkdGgsIHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSkgLSBob2xsb3dfeCk7 CisgICAgICBob2xsb3dfeSA9IFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCBtYXggKGhlYWRl cl9saW5lX2hlaWdodCwgY3Vyc29yX3Jvdy0+eSkpOworICAgICAgaG9sbG93X3ggPSBXSU5ET1df VEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCBob2xsb3dfeCk7CisgICAgICBpZiAod2lkdGggPiAw KQorICAgICAgICBGUkFNRV9SSUYgKGYpLT5jbGVhcl9mcmFtZV9hcmVhIChmLCBob2xsb3dfeCwg aG9sbG93X3ksIHdpZHRoLCBjdXJzb3Jfcm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgfQorICAv KiBFcmFzZSB0aGUgY3Vyc29yIGJ5IHJlZHJhd2luZyB0aGUgY2hhcmFjdGVyIHVuZGVybmVhdGgg aXQuICAqLworICBpZiAobW91c2VfZmFjZV9oZXJlX3ApCisgICAgaGwgPSBEUkFXX01PVVNFX0ZB Q0U7CisgIGVsc2UKKyAgICBobCA9IERSQVdfTk9STUFMX1RFWFQ7CisgIC8qIElmIGN1cnNvciBo cG9zIGlzIG91dCBvZiBib3VuZHMsIGRvbid0IGRyYXcgZ2FyYmFnZS4gIFRoaXMgY2FuCisgICAg IGhhcHBlbiBpbiBtaW5pLWJ1ZmZlciB3aW5kb3dzIHdoZW4gc3dpdGNoaW5nIGJldHdlZW4gZWNo byBhcmVhCisgICAgIGdseXBocyBhbmQgbWluaS1idWZmZXIuICAqLworICBpZiAoKGN1cnNvcl9y b3ctPnJldmVyc2VkX3AKKyAgICAgICA/IChocG9zID49IDApCisgICAgICAgOiAoaHBvcyA8IGN1 cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXSkpKQorICAgIHsKKyAgICAgIGludCB4MTsKKyAgICAg IC8qIFdoZW4gdGhlIH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W50X21hdHJpeC0+cm93cworICAgICAgICAgICAg ICAgICYmIE1BVFJJWF9ST1dfT1ZFUkxBUFNfU1VDQ19QIChjdXJzb3Jfcm93IC0gMSkpCisgICAg ICAgICAgICAgIHhfZml4X292ZXJsYXBwaW5nX2FyZWEgKHcsIGN1cnNvcl9yb3cgLSAxLCBURVhU X0FSRUEsCisgICAgICAgICAgICAgICAgICAgIE9WRVJMQVBTX0VSQVNFRF9DVVJTT1IpOworICAg ICAgICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKGN1cnNvcl9yb3cpIDwgd2luZG93X3Rl eHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICAgJiYgTUFUUklYX1JPV19PVkVSTEFQU19Q UkVEX1AgKGN1cnNvcl9yb3cgKyAxKSkKKyAgICAgICAgICAgICAgeF9maXhfb3ZlcmxhcHBpbmdf YXJlYSAodywgY3Vyc29yX3JvdyArIDEsIFRFWFRfQVJFQSwKKyAgICAgICAgICAgICAgICAgICAg T1ZFUkxBUFNfRVJBU0VEX0NVUlNPUik7CisgICAgICAgICAgfQorICAgIH0KKyAgbWFya19jdXJz b3Jfb2ZmOgorICBRbmlsOworfQorCit2b2lkCittY19kcmF3IChzdHJ1Y3Qgd2luZG93ICp3LCBi b29sIG9uLCBFTUFDU19JTlQgeCwgRU1BQ1NfSU5UIHksIEVNQUNTX0lOVCBocG9zLCBFTUFDU19J TlQgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gdGV4dF9jdXJzb3Jfa2lu ZHMgY3Vyc29yX3R5cGUsIGludCBjdXJzb3Jfd2lkdGgsIGludCByZWQsIGludCBncmVlbiwgaW50 IGJsdWUpCit7CisgIGludCBoZWFkZXJfbGluZV9oZWlnaHQgPSBXSU5ET1dfSEVBREVSX0xJTkVf SEVJR0hUICh3KTsKKyAgaWYgKGhlYWRlcl9saW5lX2hlaWdodCA+IDApCisgICAgdnBvcyA9IHZw b3MgKyAxOworICBzdHJ1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 YXJ0X2VuZF9ob29rX2ludF93aW5kb3dfZW5kKQorICAgIHsKKyAgICAgIFNFVF9URVhUX1BPU19G Uk9NX01BUktFUiAocHQsIHctPnN0YXJ0KTsKKyAgICAgIHN0YXJ0X2Rpc3BsYXkgKCZpdCwgdywg cHQpOworICAgICAgbW92ZV9pdF90byAoJml0LCBwb3NpbnQsIC0xLCAtMSwgLTEsIE1PVkVfVE9f UE9TKTsKKyAgICAgIHBvcyA9IGl0LmN1cnJlbnQucG9zOworICAgICAgeCA9IGl0LmN1cnJlbnRf eDsKKyAgICAgIHkgPSBpdC5jdXJyZW50X3k7CisgICAgICBocG9zID0gaXQuaHBvczsKKyAgICAg IHZwb3MgPSBpdC52cG9zOworICAgICAgYmlkaV91bnNoZWx2ZV9jYWNoZSAoaXRkYXRhLCBmYWxz ZSk7CisgICAgfQorICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgeCA9IC0xOworICAgICAgICB5 ID0gLTE7CisgICAgICAgIGhwb3MgPSAtMTsKKyAgICAgICAgdnBvcyA9IC0xOworICAgICAgfQor ICByZXR1cm4gbGlzdG4gKENPTlNUWVBFX1BVUkUsIDQsIG1ha2VfbnVtYmVyICh4KSwgbWFrZV9u dW1iZXIgKHkpLCBtYWtlX251bWJlciAoaHBvcyksIG1ha2VfbnVtYmVyICh2cG9zKSk7Cit9CisK K2ludAorbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoTGlzcF9PYmplY3QgYXJnKQoreworICBjaGFy ICpzdHI7CisgIGlmIChYVFlQRSAoYXJnKSA9PSBMaXNwX1N0cmluZykKKyAgICBzdHIgPSBTU0RB VEEgKGFyZyk7CisgIGVsc2UgaWYgKFhUWVBFIChhcmcpID09IExpc3BfU3ltYm9sKQorICAgIHN0 ciA9IFNTREFUQSAoU1lNQk9MX05BTUUgKGFyZykpOworICBlbHNlIHJldHVybiAtMTsKKyAgaWYg KCFzdHJjbXAgKHN0ciwgImJveCIpKQorICAgIHJldHVybiBGSUxMRURfQk9YX0NVUlNPUjsKKyAg aWYgKCFzdHJjbXAgKHN0ciwgImhvbGxvdyIpKQorICAgIHJldHVybiBIT0xMT1dfQk9YX0NVUlNP UjsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgImhiYXIiKSkKKyAgICByZXR1cm4gSEJBUl9DVVJTT1I7 CisgIGlmICghc3RyY21wIChzdHIsICJiYXIiKSkKKyAgICByZXR1cm4gQkFSX0NVUlNPUjsKKyAg aWYgKCFzdHJjbXAgKHN0ciwgIm5vIikpCisgICAgcmV0dXJuIE5PX0NVUlNPUjsKKyAgcmV0dXJu IC0xOworfQorCisvKiBFWEFNUExFICMxOiAgKHNldHEgbWMtbGlzdCAnKCgzICJoYmFyIiBbMS4w IDAuMCAwLjBdKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoNCAidmJhciIgWzAu MCAxLjAgMS4wXSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDUgImJveCIgWzEu MCAxLjAgMS4wXSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDYgImhvbGxvdyIg WzEuMCAwLjAgMS4wXSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDcgKCJoYmFy IiAzKSBbMS4wIDAuMCAwLjBdKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoOCAo InZiYXIiIDMpIFswLjAgMS4wIDEuMF0pKSkKKyAgIEVYQU1QTEUgIzI6ICAoc2V0cSBtYy1saXN0 IG5pbCkKK1RoZSBgbWNfY2FjaGUnIGlzIGtlcHQgaW4gdGhlIGZvbGxvd2luZyBleGFtcGxlIGZv cm1hdDoKKycoKAorICAoMyAiaGJhciIgWzEuMCAwLjAgMC4wXSkKKyAgKDQgInZiYXIiIFswLjAg MS4wIDEuMF0pCisgICg1ICJib3giIFsxLjAgMS4wIDEuMF0pCisgICg2ICJob2xsb3ciIFsxLjAg MC4wIDEuMF0pCisgICg3ICgiaGJhciIgMykgWzEuMCAwLjAgM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YSU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIGN1cnNvcl9zcGVjX2xp c3QpKTsKKyAgICAgICAgICBjdXJzb3Jfc3BlY190eXBlID0gRm50aCAobWFrZV9udW1iZXIgKDEp LCBjdXJzb3Jfc3BlY19saXN0KTsKKyAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9zcGVjX3R5 cGUpKQorICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChY Q0FSIChjdXJzb3Jfc3BlY190eXBlKSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAg IGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoY3Vyc29yX3NwZWNfdHlwZSk7 CisgICAgICAgICAgaWYgKENPTlNQIChjdXJzb3Jfc3BlY190eXBlKSkKKyAgICAgICAgICAgIGN1 cnNvcl93aWR0aCA9IFhJTlQgKFhDQVIgKFhDRFIgKGN1cnNvcl9zcGVjX3R5cGUpKSk7CisgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IDE7CisgICAgICAgICAg Y3Vyc29yX2NvbG9yX3ZlY3RvciA9IEZudGggKG1ha2VfbnVtYmVyICgyKSwgY3Vyc29yX3NwZWNf bGlzdCk7CisgICAgICAgICAgcmVkID0gWEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92 ZWN0b3IsIDApKTsKKyAgICAgICAgICBncmVlbiA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3Jf Y29sb3JfdmVjdG9yLCAxKSk7CisgICAgICAgICAgYmx1ZSA9IFhGTE9BVF9EQVRBIChBUkVGIChj dXJzb3JfY29sb3JfdmVjdG9yLCAyKSk7CisgICAgICAgICAgaWYgKHBvc2ludAorICAgICAgICAg ICAgICAmJiB3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50X3dpbmRvd19zdGFydAorICAgICAg ICAgICAgICAmJiB3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50X3dpbmRvd19lbmQKKyAgICAg ICAgICAgICAgJiYgcG9zaW50ID49IHctPndpbmRvd19zdGFydF9lbmRfaG9va19pbnRfd2luZG93 X3N0YXJ0CisgICAgICAgICAgICAgICYmIHBvc2ludCA8PSB3LT53aW5kb3dfc3RhcnRfZW5kX2hv b2tfaW50X3dpbmRvd19lbmQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHhfeV9ocG9z X3Zwb3NfbGlzdCA9IFhDQVIgKFhDRFIgKFhDQVIgKHZsaXN0KSkpOworICAgICAgICAgICAgICB4 ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAg ICAgICAgICAgICAgeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3NfdnBv c19saXN0KSk7CisgICAgICAgICAgICAgIGhwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAo MiksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICB2cG9zID0gWElOVCAoRm50 aCAobWFrZV9udW1iZXIgKDMpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAg bWNfZXJhc2UgKHcsIHgsIHksIGhwb3MsIHZwb3MsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgs IHJlZCwgZ3JlZW4sIGJsdWUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICB3LT5t Y19jYWNoZSA9IFFuaWw7CisgICAgfQorICAgIGVsc2UgaWYgKHcgPT0gc3cKKyAgICAgICAgICAg ICYmIHctPndpbmRvd19zdGFydF9lbmRfaG9va19pbnRfd2luZG93X3N0YXJ0CisgICAgICAgICAg ICAmJiB3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50X3dpbmRvd19lbmQKKyAgICAgICAgICAg ICYmIHctPndpbmRvd19zdGFydF9lbmRfaG9va19pbnRfcHJldmlvdXNfd2luZG93X3N0YXJ0Cisg ICAgICAgICAgICAmJiB3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50X3ByZXZpb3VzX3dpbmRv d19lbmQKKyAgICAgICAgICAgICYmIHctPndpbmRvd19zdGFydF9lbmRfaG9va19pbnRfd2luZG93 X3N0YXJ0ID09IHctPndpbmRvd19zdGFydF9lbmRfaG9va19pbnRfcHJldmlvdXNfd2luZG93X3N0 YXJ0CisgICAgICAgICAgICAmJiB3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50X3dpbmRvd19l bmQgPT0gdy0+d2luZG93X3N0YXJ0X2VuZF9ob29rX2ludF9wcmV2aW91c193aW5kb3dfZW5kCisg ICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoY3VycmVudF9idWZmZXIsIG1jX2xpc3QpKQorICAg ICAgICAgICAgJiYgdy0+bWNfY2FjaGUKKyAgICAgICAgICAgICYmICFOSUxQIChGZXF1YWwgKEZu dGggKG1ha2VfbnVtYmVyICgwKSwgdy0+bWNfY2FjaGUpLCBCVkFSIChjdXJyZW50X2J1ZmZlciwg bWNfbGlzdCkpKSkKKyAgICAgIHsKKyNpZmRlZiBHTFlQSF9ERUJVRworICBkZWJ1Z19tZXRob2Rf YWRkICh3LCAibWNfY2FsYzogIGRyYXcgY3Vyc29ycyB1c2luZyBjYWNoZSIpOworI2VuZGlmCisg ICAgICAgIGZvciAodmxpc3QgPSBYQ0FSIChYQ0RSICh3LT5tY19jYWNoZSkpOworICAgICAgICAg ICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgICAgICAgdmxpc3QgPSBYQ0RSICh2bGlzdCkpCisg ICAgICAgICAgeworICAgICAgICAgICAgY3Vyc29yX3NwZWNfbGlzdCA9IFhDQVIgKFhDQVIgKHZs aXN0KSk7CisgICAgICAgICAgICBwb3NpbnQgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMCks IGN1cnNvcl9zcGVjX2xpc3QpKTsKKyAgICAgICAgICAgIGN1cnNvcl9zcGVjX3R5cGUgPSBGbnRo IChtYWtlX251bWJlciAoMSksIGN1cnNvcl9zcGVjX2xpc3QpOworICAgICAgICAgICAgaWYgKENP TlNQIChjdXJzb3Jfc3BlY190eXBlKSkKKyAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSBtY19s aXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChjdXJzb3Jfc3BlY190eXBlKSk7CisgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29y X3R5cGUgKGN1cnNvcl9zcGVjX3R5cGUpOworICAgICAgICAgICAgaWYgKENPTlNQIChjdXJzb3Jf c3BlY190eXBlKSkKKyAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0gWElOVCAoWENBUiAoWENE UiAoY3Vyc29yX3NwZWNfdHlwZSkpKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICAgIGN1cnNvcl93aWR0aCA9IDE7CisgICAgICAgICAgICBjdXJzb3JfY29sb3JfdmVjdG9yID0g Rm50aCAobWFrZV9udW1iZXIgKDIpLCBjdXJzb3Jfc3BlY19saXN0KTsKKyAgICAgICAgICAgIHJl ZCA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAwKSk7CisgICAgICAg ICAgICBncmVlbiA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAxKSk7 CisgICAgICAgICAgICBibHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0 b3IsIDIpKTsKKyAgICAgICAgICAgIGlmIChwb3NpbnQKKyAgICAgICAgICAgICAgICAmJiB3LT53 aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50X3dpbmRvd19zdGFydAorICAgICAgICAgICAgICAgICYm IHctPndpbmRvd19zdGFydF9lbmRfaG9va19pbnRfd2luZG93X2VuZAorICAgICAgICAgICAgICAg ICYmIHBvc2ludCA+PSB3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50X3dpbmRvd19zdGFydAor ICAgICAgICAgICAgICAgICYmIHBvc2ludCA8PSB3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50 X3dpbmRvd19lbmQpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB4X3lfaHBvc192 cG9zX2xpc3QgPSBYQ0FSIChYQ0RSIChYQ0FSICh2bGlzdCkpKTsKKyAgICAgICAgICAgICAgICB4 ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAg ICAgICAgICAgICAgICB5ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBvc192 cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICBocG9zID0gWElOVCAoRm50aCAobWFrZV9udW1i ZXIgKDIpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICB2cG9zID0gWElO VCAoRm50aCAobWFrZV9udW1iZXIgKDMpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAg ICAgICAgICBtY19kcmF3ICh3LCAxLCB4LCB5LCBocG9zLCB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vy c29yX3dpZHRoLCByZWQsIGdyZWVuLCBibHVlKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAg IH0KKyAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHcgPT0gc3cKKyAgICAgICAgICAgICAgICYmICFO SUxQIChCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNfbGlzdCkpKQorICAgICAgICB7CisjaWZkZWYg R0xZUEhfREVCVUcKKyAgZGVidWdfbWV0aG9kX2FkZCAodywgIm1jX2NhbGM6ICBkcmF3IGN1cnNv cnMgYW5ldyIpOworI2VuZGlmCisgICAgICAgICAgZm9yICh2bGlzdCA9IEJWQVIgKGN1cnJlbnRf YnVmZmVyLCBtY19saXN0KTsKKyAgICAgICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAg ICAgICAgICB2bGlzdCA9IFhDRFIgKHZsaXN0KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgY3Vyc29yX3NwZWNfbGlzdCA9IFhDQVIgKHZsaXN0KTsKKyAgICAgICAgICAgICAgcG9zaW50 ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCBjdXJzb3Jfc3BlY19saXN0KSk7CisgICAg ICAgICAgICAgIGN1cnNvcl9zcGVjX3R5cGUgPSBGbnRoIChtYWtlX251bWJlciAoMSksIGN1cnNv cl9zcGVjX2xpc3QpOworICAgICAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9zcGVjX3R5cGUp KQorICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAo WENBUiAoY3Vyc29yX3NwZWNfdHlwZSkpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoY3Vyc29yX3Nw ZWNfdHlwZSk7CisgICAgICAgICAgICAgIGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlwZSkpCisg ICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0gWElOVCAoWENBUiAoWENEUiAoY3Vyc29yX3Nw ZWNfdHlwZSkpKTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXJz b3Jfd2lkdGggPSAxOworICAgICAgICAgICAgICBjdXJzb3JfY29sb3JfdmVjdG9yID0gRm50aCAo bWFrZV9udW1iZXIgKDIpLCBjdXJzb3Jfc3BlY19saXN0KTsKKyAgICAgICAgICAgICAgcmVkID0g WEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0b3IsIDApKTsKKyAgICAgICAgICAg ICAgZ3JlZW4gPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMSkpOwor ICAgICAgICAgICAgICBibHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0 b3IsIDIpKTsKKyAgICAgICAgICAgICAgaWYgKHBvc2ludCkKKyAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICB4X3lfaHBvc192cG9zX2xpc3QgPSBtY194X3lfaHBvc192cG9zICh3 LCBwb3NpbnQpOworICAgICAgICAgICAgICAgICAgdGVtcCA9IEZjb25zIChjdXJzb3Jfc3BlY19s aXN0LCBGY29ucyAoeF95X2hwb3NfdnBvc19saXN0LCBRbmlsKSk7CisgICAgICAgICAgICAgICAg ICByZXN1bHQgPSBGY29ucyAodGVtcCwgcmVzdWx0KTsKKyAgICAgICAgICAgICAgICAgIHggPSBY SU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAg ICAgICAgICAgICAgeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3NfdnBv c19saXN0KSk7CisgICAgICAgICAgICAgICAgICBocG9zID0gWElOVCAoRm50aCAobWFrZV9udW1i ZXIgKDIpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICAgIHZwb3MgPSBY SU5UIChGbnRoIChtYWtlX251bWJlciAoMyksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAg ICAgICAgICAgICAgaWYgKHctPndpbmRvd19zdGFydF9lbmRfaG9va19pbnRfd2luZG93X3N0YXJ0 CisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+d2luZG93X3N0YXJ0X2VuZF9ob29rX2ludF93 aW5kb3dfZW5kC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