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: Wed, 16 Mar 2016 01:00:41 -0700 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by - "") Content-Type: multipart/mixed; boundary="Multipart_Wed_Mar_16_01:00:38_2016-1" X-Trace: ger.gmane.org 1458115295 17389 80.91.229.3 (16 Mar 2016 08:01:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Mar 2016 08:01:35 +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 Wed Mar 16 09:01:23 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 1ag6OP-0005jn-64 for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Mar 2016 09:01:22 +0100 Original-Received: from localhost ([::1]:53741 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag6OJ-0006ty-JY for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Mar 2016 04:01:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag6O9-0006tS-FN for bug-gnu-emacs@gnu.org; Wed, 16 Mar 2016 04:01:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ag6O6-0005k6-9k for bug-gnu-emacs@gnu.org; Wed, 16 Mar 2016 04:01:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52553) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag6O6-0005k2-6X for bug-gnu-emacs@gnu.org; Wed, 16 Mar 2016 04:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ag6O5-00068E-W0 for bug-gnu-emacs@gnu.org; Wed, 16 Mar 2016 04:01: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: Wed, 16 Mar 2016 08:01: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.145811525223544 (code B ref 22873); Wed, 16 Mar 2016 08:01:01 +0000 Original-Received: (at 22873) by debbugs.gnu.org; 16 Mar 2016 08:00:52 +0000 Original-Received: from localhost ([127.0.0.1]:49680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ag6Nw-00067g-GT for submit@debbugs.gnu.org; Wed, 16 Mar 2016 04:00:52 -0400 Original-Received: from cobb.liquidweb.com ([50.28.13.150]:51430) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ag6Nu-00067S-9G for 22873@debbugs.gnu.org; Wed, 16 Mar 2016 04:00:50 -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=I89/gqf0/MHHZfPrgP4k7SUP2sPPaZlGmWa/Xg0Mldw=; b=CNp/DBw9RBmDOKn0as2Qm/0ZscGJR86/hS3yRq41zJ1ClXq6MBomFB9e4r32s/p9aQkHAk/KawSBbU2h7eTbRyDLuuQy1uvTnkkXAPySG4fqDaxxCc4K+b7d4VWYLCX2; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:53766 helo=server.private.localhost) by cobb.liquidweb.com with esmtp (Exim 4.82) (envelope-from ) id 1ag6Nm-0001AZ-El; Wed, 16 Mar 2016 04:00:42 -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:114965 Archived-At: --Multipart_Wed_Mar_16_01:00:38_2016-1 Content-Type: text/plain; charset=US-ASCII This fifth draft patch `multiple_cursors_005.diff` fixes the problem mentioned in my last email with the FILLED_BOX_CURSOR (a fake cursor) sometimes taking on the background color of the primary active cursor. I see that the fake cursors do not always appear immediately in Emacs for Windows after pressing the F1 key to trigger the Lisp function `mc-test` -- i.e., there is a delay before the screen updates, so that will be one of my next projects to debug. I didn't update the master branch tonight, so the patch applies as of the March 13, 2016 commit bearing "181e92c4e060a7ce4740b561375f9ec9f473f144". (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) --Multipart_Wed_Mar_16_01:00:38_2016-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="multiple_cursors_005.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIuYyBiL3NyYy9idWZmZXIuYwppbmRleCA2MmIwYmM4Li4w NTk2MWVmIDEwMDY0NAotLS0gYS9zcmMvYnVmZmVyLmMKKysrIGIvc3JjL2J1ZmZlci5jCkBAIC01 MDczLDYgKzUwNzMsNyBAQCBpbml0X2J1ZmZlcl9vbmNlICh2b2lkKQogICBYU0VURkFTVElOVCAo QlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgZGlzcGxheV90YWJsZSksIGlkeCk7ICsraWR4Owog ICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgc3ludGF4X3RhYmxlKSwg aWR4KTsgKytpZHg7CiAgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBj YWNoZV9sb25nX3NjYW5zKSwgaWR4KTsgKytpZHg7CisgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVm ZmVyX2xvY2FsX2ZsYWdzLCBtY19saXN0KSwgaWR4KTsgKytpZHg7CiAgIFhTRVRGQVNUSU5UIChC VkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBjYXRlZ29yeV90YWJsZSksIGlkeCk7ICsraWR4Owog ICBYU0VURkFTVElOVCA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AgICAgICAgQ09MT1JSRUYgb3JpZ192YWwg PSBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbDsKKyAgICAgICAgICAgIGludCBpbnRf cmVkID0gcmVkICogMjU1OworICAgICAgICAgICAgaW50IGludF9ncmVlbiA9IGdyZWVuICogMjU1 OworICAgICAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDI1NTsKKyAgICAgICAgICAgIGYt Pm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gUEFMRVRURVJHQiAoaW50X3JlZCwgaW50 X2dyZWVuLCBpbnRfYmx1ZSk7CisgICAgICAgICAgICB4X2RyYXdfaG9sbG93X2N1cnNvciAodywg Z2x5cGhfcm93KTsKKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVs ID0gb3JpZ192YWw7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHhf ZHJhd19ob2xsb3dfY3Vyc29yICh3LCBnbHlwaF9yb3cpOworICAgICAgICBicmVhazsKKyAgICAg IH0KKyAgICAgIGNhc2UgRklMTEVEX0JPWF9DVVJTT1I6CisgICAgICB7CisgICAgICAgIC8qIFRP RE86ICBrZGIgdG8gY29uc2lkZXIgYWRkaW5nIHN1cHBvcnQgZm9yIG11bHRpcGxlIGN1cnNvciBm b3JlZ3JvdW5kCisgICAgICAgIGN1c3RvbWl6YXRpb24gb2YgYSBGSUxMRURfQk9YX0NVUlNPUi4g ICovCisgICAgICAgIGlmIChyZWQgPj0gMCAmJiBibHVlID49IDAgJiYgZ3JlZW4gPj0gMCkKKyAg ICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29y X2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgICAgZnVuY3Rpb25hbGl0eSBvZiBgeF9tYWtl X2djJyBpbiB3MzJmbnMuYy4gICovCisgICAgICAgICAgeworICAgICAgICAgICAgYmxvY2tfaW5w dXQgKCk7CisgICAgICAgICAgICBMaXNwX09iamVjdCB3aW5kb3cgPSAoc2VsZWN0ZWRfd2luZG93 KTsKKyAgICAgICAgICAgIHN0cnVjdCB3aW5kb3cgKncgPSBkZWNvZGVfbGl2ZV93aW5kb3cgKHdp bmRvdyk7CisgICAgICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFN RSAodykpOworICAgICAgICAgICAgaW50IGludF9yZWQgPSByZWQgKiAyNTU7CisgICAgICAgICAg ICBpbnQgaW50X2dyZWVuID0gZ3JlZW4gKiAyNTU7CisgICAgICAgICAgICBpbnQgaW50X2JsdWUg PSBibHVlICogMjU1OworICAgICAgICAgICAgWEdDVmFsdWVzIGdjX3ZhbHVlczsKKyAgICAgICAg ICAgIHVuc2lnbmVkIGxvbmcgbWFzayA9IEdDRm9udCB8IEdDRm9yZWdyb3VuZCB8IEdDQmFja2dy b3VuZDsKKyAgICAgICAgICAgIENPTE9SUkVGIG9yaWdfdmFsX2EgPSBGUkFNRV9CQUNLR1JPVU5E X1BJWEVMIChmKTsKKyAgICAgICAgICAgIENPTE9SUkVGIG9yaWdfdmFsX2IgPSBmLT5vdXRwdXRf ZGF0YS53MzItPmN1cnNvcl9waXhlbDsKKyAgICAgICAgICAgIGdjX3ZhbHVlcy5mb250ID0gRlJB TUVfRk9OVCAoZik7CisgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IEZSQU1FX0JB Q0tHUk9VTkRfUElYRUwgKGYpOworICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBQ QUxFVFRFUkdCIChpbnRfcmVkLCBpbnRfZ3JlZW4sIGludF9ibHVlKTsKKyAgICAgICAgICAgIGYt Pm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djCisgICAgICAgICAgICAgID0gWENyZWF0ZUdDIChO VUxMLCBGUkFNRV9XMzJfV0lORE9XIChmKSwgbWFzaywgJmdjX3ZhbHVlcyk7CisgICAgICAgICAg ICAvKiBXaGVuIGB3LT5tY19zZXRfY3Vyc29yX2djID0gdHJ1ZScsIGZvcmNlIGB4X3NldF9jdXJz b3JfZ2MnIHRvCisgICAgICAgICAgICB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29y X2djJy4gICovCisgICAgICAgICAgICB3LT5tY19zZXRfY3Vyc29yX2djID0gdHJ1ZTsKKyAgICAg ICAgICAgIGRyYXdfcGh5c19jdXJzb3JfZ2x5cGggKHcsIGdseXBoX3JvdywgRFJBV19DVVJTT1Ip OworICAgICAgICAgICAgdy0+bWNfc2V0X2N1cnNvcl9nYyA9IGZhbHNlOworICAgICAgICAgICAg Z2NfdmFsdWVzLmZvbnQgPSBGUkFNRV9GT05UIChmKTsKKyAgICAgICAgICAgIGdjX3ZhbHVlcy5m b3JlZ3JvdW5kID0gb3JpZ192YWxfYTsKKyAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5k ID0gb3JpZ192YWxfYjsKKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2dj CisgICAgICAgICAgICAgID0gWENyZWF0ZUdDIChOVUxMLCBGUkFNRV9XMzJfV0lORE9XIChmKSwg bWFzaywgJmdjX3ZhbHVlcyk7CisgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAg ICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBkcmF3X3BoeXNfY3Vyc29yX2dseXBo ICh3LCBnbHlwaF9yb3csIERSQVdfQ1VSU09SKTsKKyAgICAgICAgYnJlYWs7CisgICAgICB9Cisg ICAgICBjYXNlIEJBUl9DVVJTT1I6CisgICAgICB7CisgICAgICAgIGlmIChyZWQgPj0gMCAmJiBi bHVlID49IDAgJiYgZ3JlZW4gPj0gMCkKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sg YGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgeworICAg ICAgICAgICAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAg ICAgICAgICAgIENPTE9SUkVGIG9yaWdfdmFsID0gZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3Jf cGl4ZWw7CisgICAgICAgICAgICBpbnQgaW50X3JlZCA9IHJlZCAqIDI1NTsKKyAgICAgICAgICAg IGludCBpbnRfZ3JlZW4gPSBncmVlbiAqIDI1NTsKKyAgICAgICAgICAgIGludCBpbnRfYmx1ZSA9 IGJsdWUgKiAyNTU7CisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhl bCA9IFBBTEVUVEVSR0IgKGludF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOworICAgICAgICAg ICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRoLCBCQVJfQ1VS U09SKTsKKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3Jp Z192YWw7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHhfZHJhd19i YXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgQkFSX0NVUlNPUik7CisgICAg ICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBIQkFSX0NVUlNPUjoKKyAgICAgIHsKKyAg ICAgICAgaWYgKHJlZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBncmVlbiA+PSAwKQorICAgICAgICAg IC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwn LiAgKi8KKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUg KFdJTkRPV19GUkFNRSAodykpOworICAgICAgICAgICAgQ09MT1JSRUYgb3JpZ192YWwgPSBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbDsKKyAgICAgICAgICAgIGludCBpbnRfcmVkID0g cmVkICogMjU1OworICAgICAgICAgICAgaW50IGludF9ncmVlbiA9IGdyZWVuICogMjU1OworICAg ICAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDI1NTsKKyAgICAgICAgICAgIGYtPm91dHB1 dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gUEFMRVRURVJHQiAoaW50X3JlZCwgaW50X2dyZWVu LCBpbnRfYmx1ZSk7CisgICAgICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93 LCBjdXJzb3Jfd2lkdGgsIEhCQVJfQ1VSU09SKTsKKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRh LnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ192YWw7CisgICAgICAgICAgfQorICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgIHhfZHJhd19iYXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93 aWR0aCwgSEJBUl9DVVJTT1IpOworICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGNhc2Ug Tk9fQ1VSU09SOgorICAgICAgICB3LT5waHlzX2N1cnNvcl93aWR0aCA9IDA7CisgICAgICAgIGJy ZWFrOworICAgICAgZGVmYXVsdDoKKyAgICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KICAgICB9 CiB9CiAKZGlmZiAtLWdpdCBhL3NyYy93aW5kb3cuaCBiL3NyYy93aW5kb3cuaAppbmRleCA4NDE4 MGM5Li5iMDQ1MzA1IDEwMDY0NAotLS0gYS9zcmMvd2luZG93LmgKKysrIGIvc3JjL3dpbmRvdy5o CkBAIC0xNzgsNiArMTc4LDEwIEBAIHN0cnVjdCB3aW5kb3cKIC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dGhlIGN1cnNvci4gICovCisgIGlmICh3 LT5waHlzX2N1cnNvcl90eXBlID09IEhPTExPV19CT1hfQ1VSU09SKQorICAgIHsKKyAgICAgIGlu dCBob2xsb3dfeCwgaG9sbG93X3ksIHdpZHRoOworICAgICAgaWYgKCEodnBvcyA+PSAwCisgICAg ICAgICAgJiYgdnBvcyA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93cykpCisgICAgICAgIGN1cnNv cl9nbHlwaCA9IE5VTEw7CisgICAgICBpZiAoIWN1cnNvcl9yb3ctPmVuYWJsZWRfcCkKKyAgICAg ICAgY3Vyc29yX2dseXBoID0gTlVMTDsKKyAgICAgIGlmICh3LT5oc2Nyb2xsKQorICAgICAgICB7 CisgICAgICAgICAgLyogV2hlbiB0aGUgd2luZG93IGlzIGhzY3JvbGxlZCwgY3Vyc29yIGhwb3Mg Y2FuIGxlZ2l0aW1hdGVseSBiZQorICAgICAgICAgICBvdXQgb2YgYm91bmRzLCBidXQgd2UgZHJh dyB0aGUgY3Vyc29yIGF0IHRoZSBjb3JyZXNwb25kaW5nCisgICAgICAgICAgIHdpbmRvdyBtYXJn aW4gaW4gdGhhdCBjYXNlLiAgKi8KKyAgICAgICAgICBpZiAoIWN1cnNvcl9yb3ctPnJldmVyc2Vk X3AgJiYgaHBvcyA8IDApCisgICAgICAgICAgICBocG9zID0gMDsKKyAgICAgICAgICBpZiAoY3Vy c29yX3Jvdy0+cmV2ZXJzZWRfcCAmJiBocG9zID49IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVB XSkKKyAgICAgICAgICAgIGhwb3MgPSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOwor ICAgICAgICB9CisgICAgICBpZiAoMCA8PSBocG9zICYmIGhwb3MgPCBjdXJzb3Jfcm93LT51c2Vk W1RFWFRfQVJFQV0pCisgICAgICAgIGN1cnNvcl9nbHlwaCA9IGN1cnNvcl9yb3ctPmdseXBoc1tU RVhUX0FSRUFdICsgaHBvczsKKyAgICAgIGVsc2UKKyAgICAgICAgY3Vyc29yX2dseXBoID0gTlVM TDsKKyAgICAgIGlmIChjdXJzb3JfZ2x5cGggPT0gTlVMTCkKKyAgICAgICAgZ290byBkb25lOwor ICAgICAgd2lkdGggPSBjdXJzb3JfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgaG9sbG93X3gg PSB4OworICAgICAgaWYgKHggPCAwKQorICAgICAgICB7CisgICAgICAgICAgd2lkdGggKz0gaG9s bG93X3g7CisgICAgICAgICAgaG9sbG93X3ggPSAwOworICAgICAgICB9CisgICAgICB3aWR0aCA9 IG1pbiAod2lkdGgsIHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSkgLSBob2xsb3dfeCk7 CisgICAgICBob2xsb3dfeSA9IFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCBtYXggKGhlYWRl cl9saW5lX2hlaWdodCwgY3Vyc29yX3Jvdy0+eSkpOworICAgICAgaG9sbG93X3ggPSBXSU5ET1df VEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCBob2xsb3dfeCk7CisgICAgICBpZiAod2lkdGggPiAw KQorICAgICAgICBGUkFNRV9SSUYgKGYpLT5jbGVhcl9mcmFtZV9hcmVhIChmLCBob2xsb3dfeCwg aG9sbG93X3ksIHdpZHRoLCBjdXJzb3Jfcm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgfQorICAv KiBJZiBjdXJzb3IgaHBvcyBpcyBvdXQgb2YgYm91bmRzLCBkb24ndCBkcmF3IGdhcmJhZ2UuICBU aGlzIGNhbgorICAgICBoYXBwZW4gaW4gbWluaS1idWZmZXIgd2luZG93cyB3aGVuIHN3aXRjaGlu ZyBiZXR3ZWVuIGVjaG8gYXJlYQorICAgICBnbHlwaHMgYW5kIG1pbmktYnVmZmVyLiAgKi8KKyAg aWYgKChjdXJzb3Jfcm93LT5yZXZlcnNlZF9wCisgICAgICAgPyAoaHBvcyA+PSAwKQorICAgICAg IDogK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hwb3MgPSBwcmlvcl9ocG9zOworICB3LT5waHlzX2N1 cnNvci52cG9zID0gcHJpb3JfdnBvczsKKyAgdy0+cGh5c19jdXJzb3IueCA9IHByaW9yX3g7Cisg IHctPnBoeXNfY3Vyc29yLnkgPSBwcmlvcl95OworfQorCitMaXNwX09iamVjdAorbWNfeF95X2hw b3NfdnBvcyAoc3RydWN0IHdpbmRvdyAqdywgRU1BQ1NfSU5UIHBvc2ludCkKK3sKKyAgc3RydWN0 IGl0IGl0OworICB2b2lkICppdGRhdGEgPSBiaWRpX3NoZWx2ZV9jYWNoZSAoKTsKKyAgc3RydWN0 IHRleHRfcG9zIHB0LCBwb3M7CisgIGludCB4LCB5LCBocG9zLCB2cG9zOworICBpZiAody0+bWNf d2luZG93X3N0YXJ0CisgICAgICAmJiB3LT5tY193aW5kb3dfZW5kCisgICAgICAmJiBwb3NpbnQg Pj0gdy0+bWNfd2luZG93X3N0YXJ0CisgICAgICAmJiBwb3NpbnQgPD0gdy0+bWNfd2luZG93X2Vu ZCkKKyAgICB7CisgICAgICBTRVRfVEVYVF9QT1NfRlJPTV9NQVJLRVIgKHB0LCB3LT5zdGFydCk7 CisgICAgICBzdGFydF9kaXNwbGF5ICgmaXQsIHcsIHB0KTsKKyAgICAgIG1vdmVfaXRfdG8gKCZp dCwgcG9zaW50LCAtMSwgLTEsIC0xLCBNT1ZFX1RPX1BPUyk7CisgICAgICBwb3MgPSBpdC5jdXJy ZW50LnBvczsKKyAgICAgIHggPSBpdC5jdXJyZW50X3g7CisgICAgICB5ID0gaXQuY3VycmVudF95 OworICAgICAgaHBvcyA9IGl0Lmhwb3M7CisgICAgICB2cG9zID0gaXQudnBvczsKKyAgICAgIGJp ZGlfdW5zaGVsdmVfY2FjaGUgKGl0ZGF0YSwgZmFsc2UpOworICAgIH0KKyAgICBlbHNlCisgICAg ICB7CisgICAgICAgIHggPSAtMTsKKyAgICAgICAgeSA9IC0xOworICAgICAgICBocG9zID0gLTE7 CisgICAgICAgIHZwb3MgPSAtMTsKKyAgICAgIH0KKyAgcmV0dXJuIGxpc3RuIChDT05TVFlQRV9Q VVJFLCA0LCBtYWtlX251bWJlciAoeCksIG1ha2VfbnVtYmVyICh5KSwgbWFrZV9udW1iZXIgKGhw b3MpLCBtYWtlX251bWJlciAodnBvcykpOworfQorCitpbnQKK21jX2xpc3BfdG9fY3Vyc29yX3R5 cGUgKExpc3BfT2JqZWN0IGFyZykKK3sKKyAgY2hhciAqc3RyOworICBpZiAoWFRZUEUgKGFyZykg PT0gTGlzcF9TdHJpbmcpCisgICAgc3RyID0gU1NEQVRBIChhcmcpOworICBlbHNlIGlmIChYVFlQ RSAoYXJnKSA9PSBMaXNwX1N5bWJvbCkKKyAgICBzdHIgPSBTU0RBVEEgKFNZTUJPTF9OQU1FIChh cmcpKTsKKyAgZWxzZSByZXR1cm4gLTE7CisgIGlmICghc3RyY21wIChzdHIsICJib3giKSkKKyAg ICByZXR1cm4gRklMTEVEX0JPWF9DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIsICJob2xsb3ci KSkKKyAgICByZXR1cm4gSE9MTE9XX0JPWF9DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIsICJo YmFyIikpCisgICAgcmV0dXJuIEhCQVJfQ1VSU09SOworICBpZiAoIXN0cmNtcCAoc3RyLCAiYmFy IikpCisgICAgcmV0dXJuIEJBUl9DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIsICJubyIpKQor ICAgIHJldHVybiBOT19DVVJTT1I7CisgIHJldHVybiAtMTsKK30KKworLyogRVhBTVBMRSAjMToK KyAgICAoc2V0cSBtYy1saXN0ICcoCisgICAgICAoMyAiaGJhciIgWzEuMCAwLjAgMC4wXSkKKyAg ICAgICg0ICJiYXIiIFswLjAgMS4wIDAuMF0pCisgICAgICAoNSAiYm94IiBbMC4wIDAuMCAxLjBd KQorICAgICAgKDYgImhvbGxvdyIgWzAuOCAwLjQgMC4yXSkKKyAgICAgICg3ICgiaGJhciIgMykg WzEuMCA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NvbG9yX3ZlY3Rvciwgdmxpc3QsIHhfeV9ocG9z X3Zwb3NfbGlzdCwgYnVmOworICBMaXNwX09iamVjdCB0ZW1wID0gUW5pbDsKKyAgTGlzcF9PYmpl Y3QgcmVzdWx0ID0gUW5pbDsKKyAgc3RydWN0IGJ1ZmZlciAqYjsKKyAgc3RydWN0IGJ1ZmZlciAq b2xkX2J1ZmZlciA9IE5VTEw7CisgIGJ1ZiA9IHctPmNvbnRlbnRzOworICBDSEVDS19CVUZGRVIg KGJ1Zik7CisgIGIgPSBYQlVGRkVSIChidWYpOworICBpZiAoYiAhPSBjdXJyZW50X2J1ZmZlcikK KyAgICB7CisgICAgICBvbGRfYnVmZmVyID0gY3VycmVudF9idWZmZXI7CisgICAgICBzZXRfYnVm ZmVyX2ludGVybmFsIChiKTsKKyAgICB9CisgIGlmIChGbWluaWJ1ZmZlcnAgKGJ1ZikpCisgICAg Z290byBkb25lOworICBpZiAody0+bWNfY2FjaGUKKyAgICAgICYmIChOSUxQIChGZXF1YWwgKEZu dGggKG1ha2VfbnVtYmVyICgwKSwgdy0+bWNfY2FjaGUpLCBCVkFSIChjdXJyZW50X2J1ZmZlciwg bWNfbGlzdCkpKQorICAgICAgICAgIHx8IHcgIT0gc3cpKQorICAgIHsKKyNpZmRlZiBHTFlQSF9E RUJVRworICBkZWJ1Z19tZXRob2RfYWRkICh3LCAibWNfY2FsYzogIHJlbW92ZSBjdXJzb3JzIHVz aW5nIGNhY2hlIik7CisjZW5kaWYKKyAgICAgIGZvciAodmxpc3QgPSBYQ0FSIChYQ0RSICh3LT5t Y19jYWNoZSkpOworICAgICAgICAgICBDT05TUCAodmxpc3QpOworICAgICAgICAgICB2bGlzdCA9 IFhDRFIgKHZsaXN0KSkKKyAgICAgICAgeworICAgICAgICAgIGN1cnNvcl9zcGVjX2xpc3QgPSBY Q0FSIChYQ0FSICh2bGlzdCkpOworICAgICAgICAgIHBvc2ludCA9IFhJTlQgKEZudGggKG1ha2Vf bnVtYmVyICgwKSwgY3Vyc29yX3NwZWNfbGlzdCkpOworICAgICAgICAgIGN1cnNvcl9zcGVjX3R5 cGUgPSBGbnRoIChtYWtlX251bWJlciAoMSksIGN1cnNvcl9zcGVjX2xpc3QpOworICAgICAgICAg IGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlwZSkpCisgICAgICAgICAgICBjdXJzb3JfdHlwZSA9 IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGN1cnNvcl9zcGVjX3R5cGUpKTsKKyAgICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNv cl90eXBlIChjdXJzb3Jfc3BlY190eXBlKTsKKyAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9z cGVjX3R5cGUpKQorICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0gWElOVCAoWENBUiAoWENEUiAo Y3Vyc29yX3NwZWNfdHlwZSkpKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgY3Vy c29yX3dpZHRoID0gMTsKKyAgICAgICAgICBjdXJzb3JfY29sb3JfdmVjdG9yID0gRm50aCAobWFr ZV9udW1iZXIgKDIpLCBjdXJzb3Jfc3BlY19saXN0KTsKKyAgICAgICAgICByZWQgPSBYRkxPQVRf REFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMCkpOworICAgICAgICAgIGdyZWVuID0g WEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0b3IsIDEpKTsKKyAgICAgICAgICBi bHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0b3IsIDIpKTsKKyAgICAg ICAgICBpZiAocG9zaW50CisgICAgICAgICAgICAgICYmIHctPm1jX3dpbmRvd19zdGFydAorICAg ICAgICAgICAgICAmJiB3LT5tY193aW5kb3dfZW5kCisgICAgICAgICAgICAgICYmIHBvc2ludCA+ PSB3LT5tY193aW5kb3dfc3RhcnQKKyAgICAgICAgICAgICAgJiYgcG9zaW50IDw9IHctPm1jX3dp bmRvd19lbmQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHhfeV9ocG9zX3Zwb3NfbGlz dCA9IFhDQVIgKFhDRFIgKFhDQVIgKHZsaXN0KSkpOworICAgICAgICAgICAgICB4ID0gWElOVCAo Rm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAg ICAgeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3NfdnBvc19saXN0KSk7 CisgICAgICAgICAgICAgIGhwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMiksIHhfeV9o cG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICB2cG9zID0gWElOVCAoRm50aCAobWFrZV9u dW1iZXIgKDMpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgbWNfZXJhc2Ug KHcsIHgsIHksIGhwb3MsIHZwb3MsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJlZCwgZ3Jl ZW4sIGJsdWUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICB3LT5tY19jYWNoZSA9 IFFuaWw7CisgICAgfQorICAgIGVsc2UgaWYgKHcgPT0gc3cKKyAgICAgICAgICAgICYmIHctPm1j X3dpbmRvd19zdGFydAorICAgICAgICAgICAgJiYgdy0+bWNfd2luZG93X2VuZAorICAgICAgICAg ICAgJiYgdy0+bWNfcHJldmlvdXNfd2luZG93X3N0YXJ0CisgICAgICAgICAgICAmJiB3LT5tY19w cmV2aW91c193aW5kb3dfZW5kCisgICAgICAgICAgICAmJiB3LT5tY193aW5kb3dfc3RhcnQgPT0g dy0+bWNfcHJldmlvdXNfd2luZG93X3N0YXJ0CisgICAgICAgICAgICAmJiB3LT5tY193aW5kb3df ZW5kID09IHctPm1jX3ByZXZpb3VzX3dpbmRvd19lbmQKKyAgICAgICAgICAgICYmICFOSUxQIChC VkFSIChjdXJyZW50X2J1ZmZlciwgbWNfbGlzdCkpCisgICAgICAgICAgICAmJiB3LT5tY19jYWNo ZQorICAgICAgICAgICAgJiYgIU5JTFAgKEZlcXVhbCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB3 LT5tY19jYWNoZSksIEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBtY19saXN0KSkpKQorICAgICAgewor I2lmZGVmIEdMWVBIX0RFQlVHCisgIGRlYnVnX21ldGhvZF9hZGQgKHcsICJtY19jYWxjOiAgZHJh dyBjdXJzb3JzIHVzaW5nIGNhY2hlIik7CisjZW5kaWYKKyAgICAgICAgZm9yICh2bGlzdCA9IFhD QVIgKFhDRFIgKHctPm1jX2NhY2hlKSk7CisgICAgICAgICAgICAgQ09OU1AgKHZsaXN0KTsKKyAg ICAgICAgICAgICB2bGlzdCA9IFhDRFIgKHZsaXN0KSkKKyAgICAgICAgICB7CisgICAgICAgICAg ICBjdXJzb3Jfc3BlY19saXN0ID0gWENBUiAoWENBUiAodmxpc3QpKTsKKyAgICAgICAgICAgIHBv c2ludCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgwKSwgY3Vyc29yX3NwZWNfbGlzdCkpOwor ICAgICAgICAgICAgY3Vyc29yX3NwZWNfdHlwZSA9IEZudGggKG1ha2VfbnVtYmVyICgxKSwgY3Vy c29yX3NwZWNfbGlzdCk7CisgICAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9zcGVjX3R5cGUp KQorICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhD QVIgKGN1cnNvcl9zcGVjX3R5cGUpKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoY3Vyc29yX3NwZWNfdHlw ZSk7CisgICAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9zcGVjX3R5cGUpKQorICAgICAgICAg ICAgICBjdXJzb3Jfd2lkdGggPSBYSU5UIChYQ0FSIChYQ0RSIChjdXJzb3Jfc3BlY190eXBlKSkp OworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0gMTsK KyAgICAgICAgICAgIGN1cnNvcl9jb2xvcl92ZWN0b3IgPSBGbnRoIChtYWtlX251bWJlciAoMiks IGN1cnNvcl9zcGVjX2xpc3QpOworICAgICAgICAgICAgcmVkID0gWEZMT0FUX0RBVEEgKEFSRUYg KGN1cnNvcl9jb2xvcl92ZWN0b3IsIDApKTsKKyAgICAgICAgICAgIGdyZWVuID0gWEZMT0FUX0RB VEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0b3IsIDEpKTsKKyAgICAgICAgICAgIGJsdWUgPSBY RkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMikpOworICAgICAgICAgICAg aWYgKHBvc2ludAorICAgICAgICAgICAgICAgICYmIHctPm1jX3dpbmRvd19zdGFydAorICAgICAg ICAgICAgICAgICYmIHctPm1jX3dpbmRvd19lbmQKKyAgICAgICAgICAgICAgICAmJiBwb3NpbnQg Pj0gdy0+bWNfd2luZG93X3N0YXJ0CisgICAgICAgICAgICAgICAgJiYgcG9zaW50IDw9IHctPm1j X3dpbmRvd19lbmQpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB4X3lfaHBvc192 cG9zX2xpc3QgPSBYQ0FSIChYQ0RSIChYQ0FSICh2bGlzdCkpKTsKKyAgICAgICAgICAgICAgICB4 ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAg ICAgICAgICAgICAgICB5ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBvc192 cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICBocG9zID0gWElOVCAoRm50aCAobWFrZV9udW1i ZXIgKDIpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICB2cG9zID0gWElO VCAoRm50aCAobWFrZV9udW1iZXIgKDMpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAg ICAgICAgICBtY19kcmF3ICh3LCB4LCB5LCBocG9zLCB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vyc29y X3dpZHRoLCByZWQsIGdyZWVuLCBibHVlKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0K KyAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHcgPT0gc3cKKyAgICAgICAgICAgICAgICYmICFOSUxQ IChCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNfbGlzdCkpKQorICAgICAgICB7CisjaWZkZWYgR0xZ UEhfREVCVUcKKyAgZGVidWdfbWV0aG9kX2FkZCAodywgIm1jX2NhbGM6ICBkcmF3IGN1cnNvcnMg YW5ldyIpOworI2VuZGlmCisgICAgICAgICAgLyogRXJhc2UgYWxsIG9mIHRoZSBvbGQgY3Vyc29y cyBhdCB0aGUgcHJldmlvdXNseSByZWNvcmRlZCB4L3kvaHBvcy92cG9zIGV2ZW4KKyAgICAgICAg ICB0aG91Z2ggdGhlIGNvcnJlc3BvbmRpbmcgYHBvc2ludCcgaGFzIGNoYW5nZWQuICAqLworICAg ICAgICAgIGlmICh3LT5tY19jYWNoZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZm9y ICh2bGlzdCA9IFhDQVIgKFhDRFIgKHctPm1jX2NhY2hlKSk7CisgICAgICAgICAgICAgICAgICAg Q09OU1AgKHZsaXN0KTsKKyAgICAgICAgICAgICAgICAgICB2bGlzdCA9IFhDRFIgKHZsaXN0KSkK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBjdXJzb3Jfc3BlY19saXN0ID0g WENBUiAoWENBUiAodmxpc3QpKTsKKyAgICAgICAgICAgICAgICAgIHBvc2ludCA9IFhJTlQgKEZu dGggKG1ha2VfbnVtYmVyICgwKSwgY3Vyc29yX3NwZWNfbGlzdCkpOworICAgICAgICAgICAgICAg ICAgY3Vyc29yX3NwZWNfdHlwZSA9IEZudGggKG1ha2VfbnVtYmVyICgxKSwgY3Vyc29yX3NwZWNf bGlzdCk7CisgICAgICAgICAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9zcGVjX3R5cGUpKQor ICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUg KFhDQVIgKGN1cnNvcl9zcGVjX3R5cGUpKTsKKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAo Y3Vyc29yX3NwZWNfdHlwZSk7CisgICAgICAgICAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9z cGVjX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSBYSU5UIChYQ0FS IChYQ0RSIChjdXJzb3Jfc3BlY190eXBlKSkpOworICAgICAgICAgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0gMTsKKyAgICAgICAgICAgICAgICAg IGN1cnNvcl9jb2xvcl92ZWN0b3IgPSBGbnRoIChtYWtlX251bWJlciAoMiksIGN1cnNvcl9zcGVj X2xpc3QpOworICAgICAgICAgICAgICAgICAgcmVkID0gWEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNv cl9jb2xvcl92ZWN0b3IsIDApKTsKKyAgICAgICAgICAgICAgICAgIGdyZWVuID0gWEZMT0FUX0RB VEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0b3IsIDEpKTsKKyAgICAgICAgICAgICAgICAgIGJs dWUgPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMikpOworICAgICAg ICAgICAgICAgICAgeF95X2hwb3NfdnBvc19saXN0ID0gWENBUiAoWENEUiAoWENBUiAodmxpc3Qp KSk7CisgICAgICAgICAgICAgICAgICB4ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4 X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICAgIHkgPSBYSU5UIChGbnRoICht YWtlX251bWJlciAoMSksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICAgICAg aHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgeF95X2hwb3NfdnBvc19saXN0KSk7 CisgICAgICAgICAgICAgICAgICB2cG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDMpLCB4 X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICAgIG1jX2VyYXNlICh3LCB4LCB5 LCBocG9zLCB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByZWQsIGdyZWVuLCBibHVl KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIHctPm1jX2NhY2hlID0gUW5pbDsK KyAgICAgICAgICAgIH0KKyAgICAgICAgICBmb3IgKHZsaXN0ID0gQlZBUiAoY3VycmVudF9idWZm ZXIsIG1jX2xpc3QpOworICAgICAgICAgICAgICAgQ09OU1AgKHZsaXN0KTsKKyAgICAgICAgICAg ICAgIHZsaXN0ID0gWENEUiAodmxpc3QpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBj dXJzb3Jfc3BlY19saXN0ID0gWENBUiAodmxpc3QpOworICAgICAgICAgICAgICBwb3NpbnQgPSBY SU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIGN1cnNvcl9zcGVjX2xpc3QpKTsKKyAgICAgICAg ICAgICAgY3Vyc29yX3NwZWNfdHlwZSA9IEZudGggKG1ha2VfbnVtYmVyICgxKSwgY3Vyc29yX3Nw ZWNfbGlzdCk7CisgICAgICAgICAgICAgIGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlwZSkpCisg ICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FS IChjdXJzb3Jfc3BlY190eXBlKSk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChjdXJzb3Jfc3BlY190 eXBlKTsKKyAgICAgICAgICAgICAgaWYgKENPTlNQIChjdXJzb3Jfc3BlY190eXBlKSkKKyAgICAg ICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSBYSU5UIChYQ0FSIChYQ0RSIChjdXJzb3Jfc3BlY190 eXBlKSkpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIGN1cnNvcl93 aWR0aCA9IDE7CisgICAgICAgICAgICAgIGN1cnNvcl9jb2xvcl92ZWN0b3IgPSBGbnRoIChtYWtl X251bWJlciAoMiksIGN1cnNvcl9zcGVjX2xpc3QpOworICAgICAgICAgICAgICByZWQgPSBYRkxP QVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMCkpOworICAgICAgICAgICAgICBn cmVlbiA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAxKSk7CisgICAg ICAgICAgICAgIGJsdWUgPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3Rvciwg MikpOworICAgICAgICAgICAgICBpZiAocG9zaW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgIHhfeV9ocG9zX3Zwb3NfbGlzdCA9IG1jX3hfeV9ocG9zX3Zwb3MgKHcsIHBv c2ludCk7CisgICAgICAgICAgICAgICAgICB0ZW1wID0gRmNvbnMgKGN1cnNvcl9zcGVjX2xpc3Qs IEZjb25zICh4X3lfaHBvc192cG9zX2xpc3QsIFFuaWwpKTsKKyAgICAgICAgICAgICAgICAgIHJl c3VsdCA9IEZjb25zICh0ZW1wLCByZXN1bHQpOworICAgICAgICAgICAgICAgICAgeCA9IFhJTlQg KEZudGggKG1ha2VfbnVtYmVyICgwKSwgeF95X2hwb3NfdnBvc19saXN0KSk7CisgICAgICAgICAg ICAgICAgICB5ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBvc192cG9zX2xp c3QpKTsKKyAgICAgICAgICAgICAgICAgIGhwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAo MiksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICAgICAgdnBvcyA9IFhJTlQg KEZudGggKG1ha2VfbnVtYmVyICgzKSwgeF95X2hwb3NfdnBvc19saXN0KSk7CisgICAgICAgICAg ICAgICAgICBpZiAody0+bWNfd2luZG93X3N0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+bWNfd2luZG93X2VuZAorICAgICAgICAgICAgICAgICAgICAgICYmIHBvc2ludCA+PSB3LT5t Y193aW5kb3dfc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgICAmJiBwb3NpbnQgPD0gdy0+bWNf d2luZG93X2VuZCkKKyAgICAgICAgICAgICAgICAgICAgbWNfZHJhdyAodywgeCwgeSwgaHBvcywg dnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcmVkLCBncmVlbiwgYmx1ZSk7CisgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgIGlmIChyZXN1bHQpCisgICAg ICAgICAgICB3LT5tY19jYWNoZSA9IEZjb25zIChCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNfbGlz dCksIEZjb25zIChGcmV2ZXJzZSAocm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Zi0+b3V0cHV0X2RhdGEueC0+Y3Vy c29yX3BpeGVsJy4gICovCisgICAgICB7CisgICAgICAgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFN RSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICAgICAgIHN0cnVjdCB4X2Rpc3BsYXlfaW5mbyAqZHB5 aW5mbyA9IEZSQU1FX0RJU1BMQVlfSU5GTyAoZik7CisgICAgICAgIHVuc2lnbmVkIGxvbmcgb3Jp Z192YWwgPSBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWw7CisgICAgICAgIGludCBpbnRf cmVkID0gcmVkICogNjU1MzU7CisgICAgICAgIGludCBpbnRfZ3JlZW4gPSBncmVlbiAqIDY1NTM1 OworICAgICAgICBpbnQgaW50X2JsdWUgPSBibHVlICogNjU1MzU7CisgICAgICAgIGYtPm91dHB1 dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IHhfbWFrZV90cnVlY29sb3JfcGl4ZWwgKGRweWluZm8s IGludF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOworICAgICAgICB4X2RyYXdfaG9sbG93X2N1 cnNvciAodywgZ2x5cGhfcm93KTsKKyAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3Bp eGVsID0gb3JpZ192YWw7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19ob2xs b3dfY3Vyc29yICh3LCBnbHlwaF9yb3cpOworICAgIGJyZWFrOworICB9CisgIGNhc2UgRklMTEVE X0JPWF9DVVJTT1I6CisgIHsKKyAgICAgLyogVE9ETzogIGtkYiB0byBjb25zaWRlciBhZGRpbmcg c3VwcG9ydCBmb3IgbXVsdGlwbGUgY3Vyc29yIGZvcmVncm91bmQKKyAgICAgY3VzdG9taXphdGlv biBvZiBhIEZJTExFRF9CT1hfQ1VSU09SLiAgKi8KKyAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+ PSAwICYmIGdyZWVuID49IDApCisgICAg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N1cnNvcl9nYworICAgICAgICAgID0gWENyZWF0ZUdDIChGUkFN RV9YX0RJU1BMQVkgKGYpLCBGUkFNRV9YX1dJTkRPVyAoZiksIG1hc2ssICZnY192YWx1ZXMpOwor ICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgICBk cmF3X3BoeXNfY3Vyc29yX2dseXBoICh3LCBnbHlwaF9yb3csIERSQVdfQ1VSU09SKTsKKyAgICBi cmVhazsKKyAgfQorICBjYXNlIEJBUl9DVVJTT1I6CisgIHsKKyAgICBpZiAocmVkID49IDAgJiYg Ymx1ZSA+PSAwICYmIGdyZWVuID49IDApCisgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYt Pm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgeworICAgICAgICBzdHJ1 Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICAgICAgICBzdHJ1Y3Qg eF9kaXNwbGF5X2luZm8gKmRweWluZm8gPSBGUkFNRV9ESVNQTEFZX0lORk8gKGYpOworICAgICAg ICB1bnNpZ25lZCBsb25nIG9yaWdfdmFsID0gZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVs OworICAgICAgICBpbnQgaW50X3JlZCA9IHJlZCAqIDY1NTM1OworICAgICAgICBpbnQgaW50X2dy ZWVuID0gZ3JlZW4gKiA2NTUzNTsKKyAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDY1NTM1 OworICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSB4X21ha2VfdHJ1ZWNv bG9yX3BpeGVsIChkcHlpbmZvLCBpbnRfcmVkLCBpbnRfZ3JlZW4sIGludF9ibHVlKTsKKyAgICAg ICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRoLCBCQVJfQ1VS U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ID0gb3JpZ192YWw7CisgICAgICB9CisgICAg ICBlbHNlCisgICAgICAgIHhfZHJhd19iYXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93 aWR0aCwgSEJBUl9DVVJTT1IpOworICAgIGJyZWFrOworICB9CisgIGNhc2UgTk9fQ1VSU09SOgor ICAgIHctPnBoeXNfY3Vyc29yX3dpZHRoID0gMDsKKyAgICBicmVhazsKKyAgZGVmYXVsdDoKKyAg ICBlbWFjc19hYm9ydCAoKTsKKyAgfQogCX0KIAogI2lmZGVmIEhBVkVfWF9JMThOCg== --Multipart_Wed_Mar_16_01:00:38_2016-1--