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, 14 Mar 2016 15:38:55 -0700 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by - "") Content-Type: multipart/mixed; boundary="Multipart_Mon_Mar_14_15:38:53_2016-1" X-Trace: ger.gmane.org 1457995226 9258 80.91.229.3 (14 Mar 2016 22:40:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Mar 2016 22:40:26 +0000 (UTC) Cc: John Wiegley , Marcin Borkowski , 22873@debbugs.gnu.org, Richard Stallman To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 14 23:40:14 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 1afb9o-0001wR-ST for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Mar 2016 23:40:13 +0100 Original-Received: from localhost ([::1]:44396 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afb9n-0006Bn-Vc for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Mar 2016 18:40:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afb9j-000691-Mw for bug-gnu-emacs@gnu.org; Mon, 14 Mar 2016 18:40:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afb9e-0005Vb-It for bug-gnu-emacs@gnu.org; Mon, 14 Mar 2016 18:40:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51151) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afb9e-0005VX-F0 for bug-gnu-emacs@gnu.org; Mon, 14 Mar 2016 18:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1afb9e-00015G-80 for bug-gnu-emacs@gnu.org; Mon, 14 Mar 2016 18:40:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Keith David Bershatsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Mar 2016 22:40: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.14579951454098 (code B ref 22873); Mon, 14 Mar 2016 22:40:02 +0000 Original-Received: (at 22873) by debbugs.gnu.org; 14 Mar 2016 22:39:05 +0000 Original-Received: from localhost ([127.0.0.1]:48278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1afb8j-000141-Bi for submit@debbugs.gnu.org; Mon, 14 Mar 2016 18:39:05 -0400 Original-Received: from cobb.liquidweb.com ([50.28.13.150]:54278) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1afb8h-00013X-R0 for 22873@debbugs.gnu.org; Mon, 14 Mar 2016 18:39:04 -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=xQt9jb1ae8O3BWMtpSJLydEq5hpTDeAyTWwZq+yzyM4=; b=UNBZ5hVDT3yud1pw/pXe8cAXH+meysHGXOePhMjreQsFdZjPM6OY4Y+79aYb2Ji4Bfg9e6yXaAhjlYLZP0xoRE16CxN5NBiKB5opwSrscdI2xm3C/4AfdrAbLkZ1luLR; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:52638 helo=server.private.localhost) by cobb.liquidweb.com with esmtp (Exim 4.82) (envelope-from ) id 1afb8Z-0000N3-2r; Mon, 14 Mar 2016 18:38:55 -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:114914 Archived-At: --Multipart_Mon_Mar_14_15:38:53_2016-1 Content-Type: text/plain; charset=US-ASCII Thank you, Eli, for resolving the issue with the `mc_cache` being GC'ed behind my back. As per your suggestion, I moved the Lisp_Object definition of `mc_cache` in `window.h` to above the section beginning with the comment "No Lisp data may follow below this point . . . ." I also moved the other mc-realted `int` and `bool_bf` definitions into the section beginning with "#ifdef HAVE_WINDOW_SYSTEM". The enclosed `multiple_cursors_004.diff` applies to Emacs master branch from last night (March 13, 2016) bearing commit "181e92c4e060a7ce4740b561375f9ec9f473f144". Multiple fake cursors now have preliminary support on all three (3) window systems -- i.e., X (--with-x --with-x-toolkit=no), Windows (XP SP-3) and OSX (10.6.8). I will need to track down why (on Emacs for Windows) a fake cursor appearing as FILLED_BOX_CURSOR sometimes takes on the background color of the real active cursor. This seems to depend upon whether I start with Emacs -Q versus a full configuration, so perhaps it won't be that difficult to track down. I haven't done any calculations regarding the time needed to run `mc_x_y_hpos_vpos` on each position for fake cursors, so I don't really know how advantageous a cache is and whether more effort should be made to perfect a caching mechanism. I'm assuming that just multiplying the LSL color vector elements by 255 for Windows and by 65535 for X is sufficient to obtain the exact color, but it certainly appears to look okay to my untrained eyes. (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_Mon_Mar_14_15:38:53_2016-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="multiple_cursors_004.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIuYyBiL3NyYy9idWZmZXIuYwppbmRleCA2MmIwYmM4Li4w NTk2MWVmIDEwMDY0NAotLS0gYS9zcmMvYnVmZmVyLmMKKysrIGIvc3JjL2J1ZmZlci5jCkBAIC01 MDczLDYgKzUwNzMsNyBAQCBpbml0X2J1ZmZlcl9vbmNlICh2b2lkKQogICBYU0VURkFTVElOVCAo QlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgZGlzcGxheV90YWJsZSksIGlkeCk7ICsraWR4Owog ICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbG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gICBmLT5vdXRwdXRfZGF0YS53MzItPmN1 cnNvcl9waXhlbCA9IG9yaWdfdmFsOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAg ICAgICAgICB4X2RyYXdfaG9sbG93X2N1cnNvciAodywgZ2x5cGhfcm93KTsKKyAgICAgICAgYnJl YWs7CisgICAgICB9CisgICAgICBjYXNlIEZJTExFRF9CT1hfQ1VSU09SOgorICAgICAgeworICAg ICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVuID49IDApCisgICAgICAgICAg LyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYy0+Zm9y ZWdyb3VuZCcKKyAgICAgICAgICBhbmQgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djLT5i YWNrZ3JvdW5kJy4gICovCisgICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0IGZyYW1lICpm ID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgICAgICAgICAgIENPTE9SUkVGIG9yaWdf dmFsX2EsIG9yaWdfdmFsX2I7CisgICAgICAgICAgICBvcmlnX3ZhbF9hID0gZi0+b3V0cHV0X2Rh dGEudzMyLT5jdXJzb3JfZ2MtPmZvcmVncm91bmQ7CisgICAgICAgICAgICBvcmlnX3ZhbF9iID0g Zi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MtPmJhY2tncm91bmQ7CisgICAgICAgICAgICBp bnQgaW50X3JlZCA9IHJlZCAqIDI1NTsKKyAgICAgICAgICAgIGludCBpbnRfZ3JlZW4gPSBncmVl biAqIDI1NTsKKyAgICAgICAgICAgIGludCBpbnRfYmx1ZSA9IGJsdWUgKiAyNTU7CisgICAgICAg ICAgICAvKiBUT0RPOiAga2RiIHRvIGNvbnNpZGVyIGFkZGluZyBzdXBwb3J0IGZvciBtdWx0aXBs ZSBjdXJzb3IgZm9yZWdyb3VuZAorICAgICAgICAgICAgY3VzdG9taXphdGlvbiBvZiBhIEZJTExF RF9CT1hfQ1VSU09SLiAgKi8KKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29y X2djLT5mb3JlZ3JvdW5kID0gRlJBTUVfQkFDS0dST1VORF9QSVhFTCAoZik7CisgICAgICAgICAg ICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYy0+YmFja2dyb3VuZCA9IFBBTEVUVEVSR0Ig KGludF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOworICAgICAgICAgICAgZHJhd19waHlzX2N1 cnNvcl9nbHlwaCAodywgZ2x5cGhfcm93LCBEUkFXX0NVUlNPUik7CisgICAgICAgICAgICBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYy0+Zm9yZWdyb3VuZCA9IG9yaWdfdmFsX2E7CisgICAg ICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYy0+YmFja2dyb3VuZCA9IG9yaWdf dmFsX2I7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGRyYXdfcGh5 c19jdXJzb3JfZ2x5cGggKHcsIGdseXBoX3JvdywgRFJBV19DVVJTT1IpOworICAgICAgICBicmVh azsKKyAgICAgIH0KKyAgICAgIGNhc2UgQkFSX0NVUlNPUjoKKyAgICAgIHsKKyAgICAgICAgaWYg KHJlZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBncmVlbiA+PSAwKQorICAgICAgICAgIC8qIFRlbXBv cmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAg ICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19G UkFNRSAodykpOworICAgICAgICAgICAgQ09MT1JSRUYgb3JpZ192YWwgPSBmLT5vdXRwdXRfZGF0 YS53MzItPmN1cnNvcl9waXhlbDsKKyAgICAgICAgICAgIGludCBpbnRfcmVkID0gcmVkICogMjU1 OworICAgICAgICAgICAgaW50IGludF9ncmVlbiA9IGdyZWVuICogMjU1OworICAgICAgICAgICAg aW50IGludF9ibHVlID0gYmx1ZSAqIDI1NTsKKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLncz Mi0+Y3Vyc29yX3BpeGVsID0gUEFMRVRURVJHQiAoaW50X3JlZCwgaW50X2dyZWVuLCBpbnRfYmx1 ZSk7CisgICAgICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jf d2lkdGgsIEJBUl9DVVJTT1IpOworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJz b3JfcGl4ZWwgPSBvcmlnX3ZhbDsKKyAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRoLCBCQVJf Q1VSU09SKTsKKyAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIEhCQVJfQ1VSU09S OgorICAgICAgeworICAgICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVuID49 IDApCisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzIt PmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIHsKKyAgICAgICAgICAgIHN0cnVjdCBmcmFt ZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICAgICAgICAgICBDT0xPUlJFRiBv cmlnX3ZhbCA9IGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsOworICAgICAgICAgICAg aW50IGludF9yZWQgPSByZWQgKiAyNTU7CisgICAgICAgICAgICBpbnQgaW50X2dyZWVuID0gZ3Jl ZW4gKiAyN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ZWx5IGJlCisgICAgICAgICAgIG91dCBvZiBib3VuZHMsIGJ1dCB3ZSBkcmF3IHRoZSBjdXJz b3IgYXQgdGhlIGNvcnJlc3BvbmRpbmcKKyAgICAgICAgICAgd2luZG93IG1hcmdpbiBpbiB0aGF0 IGNhc2UuICAqLworICAgICAgICAgIGlmICghY3Vyc29yX3Jvdy0+cmV2ZXJzZWRfcCAmJiBocG9z IDwgMCkKKyAgICAgICAgICAgIGhwb3MgPSAwOworICAgICAgICAgIGlmIChjdXJzb3Jfcm93LT5y ZXZlcnNlZF9wICYmIGhwb3MgPj0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAg ICAgICAgaHBvcyA9IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDE7CisgICAgICAgIH0K KyAgICAgIGlmICgwIDw9IGhwb3MgJiYgaHBvcyA8IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVB XSkKKyAgICAgICAgY3Vyc29yX2dseXBoID0gY3Vyc29yX3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0g KyBocG9zOworICAgICAgZWxzZQorICAgICAgICBjdXJzb3JfZ2x5cGggPSBOVUxMOworICAgICAg aWYgKGN1cnNvcl9nbHlwaCA9PSBOVUxMKQorICAgICAgICBnb3RvIGRvbmU7CisgICAgICB3aWR0 aCA9IGN1cnNvcl9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICBob2xsb3dfeCA9IHg7CisgICAg ICBpZiAoeCA8IDApCisgICAgICAgIHsKKyAgICAgICAgICB3aWR0aCArPSBob2xsb3dfeDsKKyAg ICAgICAgICBob2xsb3dfeCA9IDA7CisgICAgICAgIH0KKyAgICAgIHdpZHRoID0gbWluICh3aWR0 aCwgd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKSAtIGhvbGxvd194KTsKKyAgICAgIGhv bGxvd195ID0gV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIG1he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gICYmIHctPm1jX3dpbmRvd19lbmQKKyAgICAgICYmIHBvc2ludCA+PSB3LT5tY193 aW5kb3dfc3RhcnQKKyAgICAgICYmIHBvc2ludCA8PSB3LT5tY193aW5kb3dfZW5kKQorICAgIHsK KyAgICAgIFNFVF9URVhUX1BPU19GUk9NX01BUktFUiAocHQsIHctPnN0YXJ0KTsKKyAgICAgIHN0 YXJ0X2Rpc3BsYXkgKCZpdCwgdywgcHQpOworICAgICAgbW92ZV9pdF90byAoJml0LCBwb3NpbnQs IC0xLCAtMSwgLTEsIE1PVkVfVE9fUE9TKTsKKyAgICAgIHBvcyA9IGl0LmN1cnJlbnQucG9zOwor ICAgICAgeCA9IGl0LmN1cnJlbnRfeDsKKyAgICAgIHkgPSBpdC5jdXJyZW50X3k7CisgICAgICBo cG9zID0gaXQuaHBvczsKKyAgICAgIHZwb3MgPSBpdC52cG9zOworICAgICAgYmlkaV91bnNoZWx2 ZV9jYWNoZSAoaXRkYXRhLCBmYWxzZSk7CisgICAgfQorICAgIGVsc2UKKyAgICAgIHsKKyAgICAg ICAgeCA9IC0xOworICAgICAgICB5ID0gLTE7CisgICAgICAgIGhwb3MgPSAtMTsKKyAgICAgICAg dnBvcyA9IC0xOworICAgICAgfQorICByZXR1cm4gbGlzdG4gKENPTlNUWVBFX1BVUkUsIDQsIG1h a2VfbnVtYmVyICh4KSwgbWFrZV9udW1iZXIgKHkpLCBtYWtlX251bWJlciAoaHBvcyksIG1ha2Vf bnVtYmVyICh2cG9zKSk7Cit9CisKK2ludAorbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoTGlzcF9P YmplY3QgYXJnKQoreworICBjaGFyICpzdHI7CisgIGlmIChYVFlQRSAoYXJnKSA9PSBMaXNwX1N0 cmluZykKKyAgICBzdHIgPSBTU0RBVEEgKGFyZyk7CisgIGVsc2UgaWYgKFhUWVBFIChhcmcpID09 IExpc3BfU3ltYm9sKQorICAgIHN0ciA9IFNTREFUQSAoU1lNQk9MX05BTUUgKGFyZyk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ZmVycCAoYnVmKSkKKyAgICBnb3RvIGRvbmU7 CisgIGlmICh3LT5tY19jYWNoZQorICAgICAgJiYgKE5JTFAgKEZlcXVhbCAoRm50aCAobWFrZV9u dW1iZXIgKDApLCB3LT5tY19jYWNoZSksIEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBtY19saXN0KSkp CisgICAgICAgICAgfHwgdyAhPSBzdykpCisgICAgeworI2lmZGVmIEdMWVBIX0RFQlVHCisgIGRl YnVnX21ldGhvZF9hZGQgKHcsICJtY19jYWxjOiAgcmVtb3ZlIGN1cnNvcnMgdXNpbmcgY2FjaGUi KTsKKyNlbmRpZgorICAgICAgZm9yICh2bGlzdCA9IFhDQVIgKFhDRFIgKHctPm1jX2NhY2hlKSk7 CisgICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgICAgIHZsaXN0ID0gWENEUiAodmxp c3QpKQorICAgICAgICB7CisgICAgICAgICAgY3Vyc29yX3NwZWNfbGlzdCA9IFhDQVIgKFhDQVIg KHZsaXN0KSk7CisgICAgICAgICAgcG9zaW50ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDAp LCBjdXJzb3Jfc3BlY19saXN0KSk7CisgICAgICAgICAgY3Vyc29yX3NwZWNfdHlwZSA9IEZudGgg KG1ha2VfbnVtYmVyICgxKSwgY3Vyc29yX3NwZWNfbGlzdCk7CisgICAgICAgICAgaWYgKENPTlNQ IChjdXJzb3Jfc3BlY190eXBlKSkKKyAgICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90 b19jdXJzb3JfdHlwZSAoWENBUiAoY3Vyc29yX3NwZWNfdHlwZSkpOworICAgICAgICAgICAgZWxz ZQorICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGN1 cnNvcl9zcGVjX3R5cGUpOworICAgICAgICAgIGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlwZSkp CisgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSBYSU5UIChYQ0FSIChYQ0RSIChjdXJzb3Jfc3Bl Y190eXBlKSkpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgg PSAxOworICAgICAgICAgIGN1cnNvcl9jb2xvcl92ZWN0b3IgPSBGbnRoIChtYWtlX251bWJlciAo MiksIGN1cnNvcl9zcGVjX2xpc3QpOworICAgICAgICAgIHJlZCA9IFhGTE9BVF9EQVRBIChBUkVG IChjdXJzb3JfY29sb3JfdmVjdG9yLCAwKSk7CisgICAgICAgICAgZ3JlZW4gPSBYRkxPQVRfREFU QSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMSkpOworICAgICAgICAgIGJsdWUgPSBYRkxP QVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMikpOworICAgICAgICAgIGlmIChw b3NpbnQKKyAgICAgICAgICAgICAgJiYgdy0+bWNfd2luZG93X3N0YXJ0CisgICAgICAgICAgICAg ICYmIHctPm1jX3dpbmRvd19lbmQKKyAgICAgICAgICAgICAgJiYgcG9zaW50ID49IHctPm1jX3dp bmRvd19zdGFydAorICAgICAgICAgICAgICAmJiBwb3NpbnQgPD0gdy0+bWNfd2luZG93X2VuZCkK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgeF95X2hwb3NfdnBvc19saXN0ID0gWENBUiAo WENEUiAoWENBUiAodmxpc3QpKSk7CisgICAgICAgICAgICAgIHggPSBYSU5UIChGbnRoIChtYWtl X251bWJlciAoMCksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICB5ID0gWElO VCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAg ICAgICAgaHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgeF95X2hwb3NfdnBvc19s aXN0KSk7CisgICAgICAgICAgICAgIHZwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMyks IHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICBtY19lcmFzZSAodywgeCwgeSwg aHBvcywgdnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcmVkLCBncmVlbiwgYmx1ZSk7 CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIHctPm1jX2NhY2hlID0gUW5pbDsKKyAg ICB9CisgICAgZWxzZSBpZiAodyA9PSBzdworICAgICAgICAgICAgJiYgdy0+bWNfd2luZG93X3N0 YXJ0CisgICAgICAgICAgICAmJiB3LT5tY193aW5kb3dfZW5kCisgICAgICAgICAgICAmJiB3LT5t Y19wcmV2aW91c193aW5kb3dfc3RhcnQKKyAgICAgICAgICAgICYmIHctPm1jX3ByZXZpb3VzX3dp bmRvd19lbmQKKyAgICAgICAgICAgICYmIHctPm1jX3dpbmRvd19zdGFydCA9PSB3LT5tY19wcmV2 aW91c193aW5kb3dfc3RhcnQKKyAgICAgICAgICAgICYmIHctPm1jX3dpbmRvd19lbmQgPT0gdy0+ bWNfcHJldmlvdXNfd2luZG93X2VuZAorICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGN1cnJl bnRfYnVmZmVyLCBtY19saXN0KSkKKyAgICAgICAgICAgICYmIHctPm1jX2NhY2hlCisgICAgICAg ICAgICAmJiAhTklMUCAoRmVxdWFsIChGbnRoIChtYWtlX251bWJlciAoMCksIHctPm1jX2NhY2hl KSwgQlZBUiAoY3VycmVudF9idWZmZXIsIG1jX2xpc3QpKSkpCisgICAgICB7CisjaWZkZWYgR0xZ UEhfREVCVUcKKyAgZGVidWdfbWV0aG9kX2FkZCAodywgIm1jX2NhbGM6ICBkcmF3IGN1cnNvcnMg dXNpbmcgY2FjaGUiKTsKKyNlbmRpZgorICAgICAgICBmb3IgKHZsaXN0ID0gWENBUiAoWENEUiAo dy0+bWNfY2FjaGUpKTsKKyAgICAgICAgICAgICBDT05TUCAodmxpc3QpOworICAgICAgICAgICAg IHZsaXN0ID0gWENEUiAodmxpc3QpKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGN1cnNvcl9z cGVjX2xpc3QgPSBYQ0FSIChYQ0FSICh2bGlzdCkpOworICAgICAgICAgICAgcG9zaW50ID0gWElO VCAoRm50aCAobWFrZV9udW1iZXIgKDApLCBjdXJzb3Jfc3BlY19saXN0KSk7CisgICAgICAgICAg ICBjdXJzb3Jfc3BlY190eXBlID0gRm50aCAobWFrZV9udW1iZXIgKDEpLCBjdXJzb3Jfc3BlY19s aXN0KTsKKyAgICAgICAgICAgIGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlwZSkpCisgICAgICAg ICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAoY3Vyc29y X3NwZWNfdHlwZSkpOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgY3Vyc29y X3R5cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChjdXJzb3Jfc3BlY190eXBlKTsKKyAgICAg ICAgICAgIGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlwZSkpCisgICAgICAgICAgICAgIGN1cnNv cl93aWR0aCA9IFhJTlQgKFhDQVIgKFhDRFIgKGN1cnNvcl9zcGVjX3R5cGUpKSk7CisgICAgICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSAxOworICAgICAgICAg ICAgY3Vyc29yX2NvbG9yX3ZlY3RvciA9IEZudGggKG1ha2VfbnVtYmVyICgyKSwgY3Vyc29yX3Nw ZWNfbGlzdCk7CisgICAgICAgICAgICByZWQgPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2Nv bG9yX3ZlY3RvciwgMCkpOworICAgICAgICAgICAgZ3JlZW4gPSBYRkxPQVRfREFUQSAoQVJFRiAo Y3Vyc29yX2NvbG9yX3ZlY3RvciwgMSkpOworICAgICAgICAgICAgYmx1ZSA9IFhGTE9BVF9EQVRB IChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAyKSk7CisgICAgICAgICAgICBpZiAocG9zaW50 CisgICAgICAgICAgICAgICAgJiYgdy0+bWNfd2luZG93X3N0YXJ0CisgICAgICAgICAgICAgICAg JiYgdy0+bWNfd2luZG93X2VuZAorICAgICAgICAgICAgICAgICYmIHBvc2ludCA+PSB3LT5tY193 aW5kb3dfc3RhcnQKKyAgICAgICAgICAgICAgICAmJiBwb3NpbnQgPD0gdy0+bWNfd2luZG93X2Vu ZCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHhfeV9ocG9zX3Zwb3NfbGlzdCA9 IFhDQVIgKFhDRFIgKFhDQVIgKHZsaXN0KSkpOworICAgICAgICAgICAgICAgIHggPSBYSU5UIChG bnRoIChtYWtlX251bWJlciAoMCksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAg ICAgIHkgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMSksIHhfeV9ocG9zX3Zwb3NfbGlzdCkp OworICAgICAgICAgICAgICAgIGhwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMiksIHhf eV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICAgIHZwb3MgPSBYSU5UIChGbnRoICht YWtlX251bWJlciAoMyksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICAgIG1j X2RyYXcgKHcsIHgsIHksIGhwb3MsIHZwb3MsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJl ZCwgZ3JlZW4sIGJsdWUpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgfQor ICAgICAgZWxzZSBpZiAodyA9PSBzdworICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGN1 cnJlbnRfYnVmZmVyLCBtY19saXN0KSkpCisgICAgICAgIHsKKyNpZmRlZiBHTFlQSF9ERUJVRwor ICBkZWJ1Z19tZXRob2RfYWRkICh3LCAibWNfY2FsYzogIGRyYXcgY3Vyc29ycyBhbmV3Iik7Cisj ZW5kaWYKKyAgICAgICAgICAvKiBFcmFzZSBhbGwgb2YgdGhlIG9sZCBjdXJzb3JzIGF0IHRoZSBw cmV2aW91c2x5IHJlY29yZGVkIHgveS9ocG9zL3Zwb3MgZXZlbgorICAgICAgICAgIHRob3VnaCB0 aGUgY29ycmVzcG9uZGluZyBgcG9zaW50JyBoYXMgY2hhbmdlZC4gICovCisgICAgICAgICAgaWYg KHctPm1jX2NhY2hlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBmb3IgKHZsaXN0ID0g WENBUiAoWENEUiAody0+bWNfY2FjaGUpKTsKKyAgICAgICAgICAgICAgICAgICBDT05TUCAodmxp c3QpOworICAgICAgICAgICAgICAgICAgIHZsaXN0ID0gWENEUiAodmxpc3QpKQorICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGN1cnNvcl9zcGVjX2xpc3QgPSBYQ0FSIChYQ0FS ICh2bGlzdCkpOworICAgICAgICAgICAgICAgICAgcG9zaW50ID0gWElOVCAoRm50aCAobWFrZV9u dW1iZXIgKDApLCBjdXJzb3Jfc3BlY19saXN0KSk7CisgICAgICAgICAgICAgICAgICBjdXJzb3Jf c3BlY190eXBlID0gRm50aCAobWFrZV9udW1iZXIgKDEpLCBjdXJzb3Jfc3BlY19saXN0KTsKKyAg ICAgICAgICAgICAgICAgIGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlwZSkpCisgICAgICAgICAg ICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAoY3Vy c29yX3NwZWNfdHlwZSkpOworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAg ICAgICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChjdXJzb3Jfc3Bl Y190eXBlKTsKKyAgICAgICAgICAgICAgICAgIGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlwZSkp CisgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IFhJTlQgKFhDQVIgKFhDRFIgKGN1 cnNvcl9zcGVjX3R5cGUpKSk7CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSAxOworICAgICAgICAgICAgICAgICAgY3Vyc29yX2Nv bG9yX3ZlY3RvciA9IEZudGggKG1ha2VfbnVtYmVyICgyKSwgY3Vyc29yX3NwZWNfbGlzdCk7Cisg ICAgICAgICAgICAgICAgICByZWQgPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3Zl Y3RvciwgMCkpOworICAgICAgICAgICAgICAgICAgZ3JlZW4gPSBYRkxPQVRfREFUQSAoQVJFRiAo Y3Vyc29yX2NvbG9yX3ZlY3RvciwgMSkpOworICAgICAgICAgICAgICAgICAgYmx1ZSA9IFhGTE9B VF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAyKSk7CisgICAgICAgICAgICAgICAg ICB4X3lfaHBvc192cG9zX2xpc3QgPSBYQ0FSIChYQ0RSIChYQ0FSICh2bGlzdCkpKTsKKyAgICAg ICAgICAgICAgICAgIHggPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIHhfeV9ocG9zX3Zw b3NfbGlzdCkpOworICAgICAgICAgICAgICAgICAgeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVy ICgxKSwgeF95X2hwb3NfdnBvc19saXN0KSk7CisgICAgICAgICAgICAgICAgICBocG9zID0gWElO VCAoRm50aCAobWFrZV9udW1iZXIgKDIpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAg ICAgICAgICAgIHZwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMyksIHhfeV9ocG9zX3Zw b3NfbGlzdCkpOworICAgICAgICAgICAgICAgICAgbWNfZXJhc2UgKHcsIHgsIHksIGhwb3MsIHZw b3MsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJlZCwgZ3JlZW4sIGJsdWUpOworICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgdy0+bWNfY2FjaGUgPSBRbmlsOworICAgICAgICAg ICAgfQorICAgICAgICAgIGZvciAodmxpc3QgPSBCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNfbGlz dCk7CisgICAgICAgICAgICAgICBDT05TUCAodmxpc3QpOworICAgICAgICAgICAgICAgdmxpc3Qg PSBYQ0RSICh2bGlzdCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGN1cnNvcl9zcGVj X2xpc3QgPSBYQ0FSICh2bGlzdCk7CisgICAgICAgICAgICAgIHBvc2ludCA9IFhJTlQgKEZudGgg KG1ha2VfbnVtYmVyICgwKSwgY3Vyc29yX3NwZWNfbGlzdCkpOworICAgICAgICAgICAgICBjdXJz b3Jfc3BlY190eXBlID0gRm50aCAobWFrZV9udW1iZXIgKDEpLCBjdXJzb3Jfc3BlY19saXN0KTsK KyAgICAgICAgICAgICAgaWYgKENPTlNQIChjdXJzb3Jfc3BlY190eXBlKSkKKyAgICAgICAgICAg ICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGN1cnNvcl9z cGVjX3R5cGUpKTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXJz b3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGN1cnNvcl9zcGVjX3R5cGUpOworICAg ICAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9zcGVjX3R5cGUpKQorICAgICAgICAgICAgICAg IGN1cnNvcl93aWR0aCA9IFhJTlQgKFhDQVIgKFhDRFIgKGN1cnNvcl9zcGVjX3R5cGUpKSk7Cisg ICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0gMTsK KyAgICAgICAgICAgICAgY3Vyc29yX2NvbG9yX3ZlY3RvciA9IEZudGggKG1ha2VfbnVtYmVyICgy KSwgY3Vyc29yX3NwZWNfbGlzdCk7CisgICAgICAgICAgICAgIHJlZCA9IFhGTE9BVF9EQVRBIChB UkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAwKSk7CisgICAgICAgICAgICAgIGdyZWVuID0gWEZM T0FUX0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0b3IsIDEpKTsKKyAgICAgICAgICAgICAg Ymx1ZSA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAyKSk7CisgICAg ICAgICAgICAgIGlmIChwb3NpbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgeF95X2hwb3NfdnBvc19saXN0ID0gbWNfeF95X2hwb3NfdnBvcyAodywgcG9zaW50KTsKKyAg ICAgICAgICAgICAgICAgIHRlbXAgPSBGY29ucyAoY3Vyc29yX3NwZWNfbGlzdCwgRmNvbnMgKHhf eV9ocG9zX3Zwb3NfbGlzdCwgUW5pbCkpOworICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gRmNv bnMgKHRlbXAsIHJlc3VsdCk7CisgICAgICAgICAgICAgICAgICB4ID0gWElOVCAoRm50aCAobWFr ZV9udW1iZXIgKDApLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICAgIHkg PSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMSksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAg ICAgICAgICAgICAgICAgaHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgeF95X2hw b3NfdnBvc19saXN0KSk7CisgICAgICAgICAgICAgICAgICB2cG9zID0gWElOVCAoRm50aCAobWFr ZV9udW1iZXIgKDMpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICAgIGlm ICh3LT5tY193aW5kb3dfc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5tY193aW5k b3dfZW5kCisgICAgICAgICAgICAgICAgICAgICAgJiYgcG9zaW50ID49IHctPm1jX3dpbmRvd19z dGFydAorICAgICAgICAgICAgICAgICAgICAgICYmIHBvc2ludCA8PSB3LT5tY193aW5kb3dfZW5k KQorICAgICAgICAgICAgICAgICAgICBtY19kcmF3ICh3LCB4LCB5LCBocG9zLCB2cG9zLCBjdXJz b3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByZWQsIGdyZWVuLCBibHVlKTsKKyAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKHJlc3VsdCkKKyAgICAgICAgICAgIHct Pm1jX2NhY2hlID0gRmNvbnMgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBtY19saXN0KSwgRmNvbnMg KEZyZXZlcnNlIChyZXN1bHQpLCBRbmlsKSk7CisgICAgICAgIH0KKyAgZG9uZToKKyAgaWYgKG9s ZF9idWZmZXIpCisgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7Cit9CiAKIC8q IERpc3BsYXkgb3IgY2xlYXIgY3Vyc29yIG9mIHdpbmRvdyBXLiAgSWYgIU9OLCBjbGVhciB0aGUg Y3Vyc29yLgogICAgSWYgT04sIGRpc3BsYXkgdGhlIGN1cnNvcjsgd2hlcmUgdG8gcHV0IHRoZSBj dXJzb3IgaXMgc3BlY2lmaWVkIGJ5CkBAIC0yODMzMCw2ICsyODc0MCwxNCBAQCBkaXNwbGF5X2Fu ZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9uLAogICBib29sIGFjdGl2ZV9j dXJzb3I7CiAgIHN0cnVjdCBnbHlwaF9yb3c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2x5cGgg KHcsIGdseXBoX3JvdywgRFJBV19DVVJTT1IpOworICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3Vu ZCA9IG9yaWdfdmFsX2E7CisgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gb3JpZ192YWxf YjsKKyAgICAgICAgZ2NfdmFsdWVzLmZpbGxfc3R5bGUgPSBGaWxsT3BhcXVlU3RpcHBsZWQ7Cisg ICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYworICAgICAgICAgID0gWENyZWF0ZUdD IChGUkFNRV9YX0RJU1BMQVkgKGYpLCBGUkFNRV9YX1dJTkRPVyAoZiksCisgICAgICAgICAgICAg ICAgICAoR0NGb3JlZ3JvdW5kIHwgR0NCYWNrZ3JvdW5kIHwgR0NGaWxsU3R5bGUgfCBHQ0xpbmVX aWR0aCksICZnY192YWx1ZXMpOworICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgfQor ICAgICAgZWxzZQorICAgICAgICBkcmF3X3BoeXNfY3Vyc29yX2dseXBoICh3LCBnbHlwaF9yb3cs IERSQVdfQ1VSU09SKTsKKyAgICBicmVhazsKKyAgfQorICBjYXNlIEJBUl9DVVJTT1I6CisgIHsK KyAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVuID49IDApCisgICAgICAvKiBU ZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICAqLwor ICAgICAgeworICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAo dykpOworICAgICAgICBzdHJ1Y3QgeF9kaXNwbGF5X2luZm8gKmRweWluZm8gPSBGUkFNRV9ESVNQ TEFZX0lORk8gKGYpOworICAgICAgICB1bnNpZ25lZCBsb25nIG9yaWdfdmFsID0gZi0+b3V0cHV0 X2RhdGEueC0+Y3Vyc29yX3BpeGVsOworICAgICAgICB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AgIGludCBp bnRfZ3JlZW4gPSBncmVlbiAqIDY1NTM1OworICAgICAgICBpbnQgaW50X2JsdWUgPSBibHVlICog NjU1MzU7CisgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IHhfbWFrZV90 cnVlY29sb3JfcGl4ZWwgKGRweWluZm8sIGludF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOwor ICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEhC QVJfQ1VSU09SKTsKKyAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3Jp Z192YWw7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19iYXJfY3Vyc29yICh3 LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgSEJBUl9DVVJTT1IpOworICAgIGJyZWFrOworICB9 CisgIGNhc2UgTk9fQ1VSU09SOgorICAgIHctPnBoeXNfY3Vyc29yX3dpZHRoID0gMDsKKyAgICBi cmVhazsKKyAgZGVmYXVsdDoKKyAgICBlbWFjc19hYm9ydCAoKTsKKyAgfQogCX0KIAogI2lmZGVm IEhBVkVfWF9JMThOCg== --Multipart_Mon_Mar_14_15:38:53_2016-1--