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: Thu, 17 Mar 2016 21:00:32 -0700 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by - "") Content-Type: multipart/mixed; boundary="Multipart_Thu_Mar_17_21:00:31_2016-1" X-Trace: ger.gmane.org 1458273688 13649 80.91.229.3 (18 Mar 2016 04:01:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Mar 2016 04:01:28 +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 Fri Mar 18 05:01: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 1aglb9-00006y-Vx for geb-bug-gnu-emacs@m.gmane.org; Fri, 18 Mar 2016 05:01:16 +0100 Original-Received: from localhost ([::1]:41431 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aglb9-0001gN-5U for geb-bug-gnu-emacs@m.gmane.org; Fri, 18 Mar 2016 00:01:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aglb1-0001aV-EV for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2016 00:01:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aglaw-0000AW-DB for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2016 00:01:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54512) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aglaw-0000AS-9F for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2016 00:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1aglaw-0000dD-3D for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2016 00: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: Fri, 18 Mar 2016 04:01: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.14582736442396 (code B ref 22873); Fri, 18 Mar 2016 04:01:02 +0000 Original-Received: (at 22873) by debbugs.gnu.org; 18 Mar 2016 04:00:44 +0000 Original-Received: from localhost ([127.0.0.1]:51639 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aglad-0000ca-TS for submit@debbugs.gnu.org; Fri, 18 Mar 2016 00:00:44 -0400 Original-Received: from cobb.liquidweb.com ([50.28.13.150]:49767) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aglab-0000cN-Vk for 22873@debbugs.gnu.org; Fri, 18 Mar 2016 00:00:42 -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=hDVf3qOU8DYIgailz6CWMt2ITwDAq7ZUS2EgP4fvp1c=; b=41bHz+dZKZ6xHXQxcoXFyjDMU4/mF8nRLpZQ0ei59gExsLc6o/sy80GLBeRBUjbn0YM7acP8bwlZKqNCG0QNAD4f9jIkm259CpD8uy15giuI1EbqY+FEhPL6DoNce+mD; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:52259 helo=server.private.localhost) by cobb.liquidweb.com with esmtp (Exim 4.82) (envelope-from ) id 1aglaS-0008Kc-Qp; Fri, 18 Mar 2016 00:00:33 -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:115019 Archived-At: --Multipart_Thu_Mar_17_21:00:31_2016-1 Content-Type: text/plain; charset=US-ASCII Attached is the next draft patch -- multiple_cursors_006.diff -- that applies to Emacs master branch as of March 17, 2016, bearing commit "2fbdb1bb4c878f8ae17bd69d1b4ff51c47497e41". This patch resolves the issue relating to a delay of the fake cursors appearing in Emacs for Windows. The bug was caused because I had erroneously thought that the tail end of `redisplay_window' would be a sufficient location to calculate window-start/end for all circumstances, but it turned out that initializing fake cursors by merely setting the `mc-list` variable does not necessarily trigger the tail end of the former internal function. Thus, there is now a second location at the beginning of `mc_calc' to determine window-start/end if it has not already been determined. Other changes include setting up a struct prefix of `mc` in window.h for the pointers, except for the Lisp_Object `mc_cache' which apparently requires special treatment not lending itself to using a prefix. That was the last of the known problems with fake cursors, so the next phase will be for me to try it out with a custom minor mode over the next few weeks to see what else may be needed. The current draft patch has been lightly tested on Emacs for all three (3) window systems -- X11 (no toolkit), Windows (XP SP-3), and OSX (10.6.8). (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_Thu_Mar_17_21:00:31_2016-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="multiple_cursors_006.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIuYyBiL3NyYy9idWZmZXIuYwppbmRleCA2MmIwYmM4Li4w NTk2MWVmIDEwMDY0NAotLS0gYS9zcmMvYnVmZmVyLmMKKysrIGIvc3JjL2J1ZmZlci5jCkBAIC01 MDczLDYgKzUwNzMsNyBAQCBpbml0X2J1ZmZlcl9vbmNlICh2b2lkKQogICBYU0VURkFTVElOVCAo QlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgZGlzcGxheV90YWJsZSksIGlkeCk7ICsraWR4Owog ICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgc3ludGF4X3RhYmxlKSwg aWR4KTsgKytpZHg7CiAgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBj YWNoZV9sb25nX3NjYW5zKSwgaWR4KT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gMCAmJiBncmVlbiA+PSAwKQorICAg ICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3Jf cGl4ZWwnLiAgKi8KKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYgPSBY RlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICAgICAgICAgICAgQ09MT1JSRUYgb3JpZ192YWwg 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 ICAvKiBXaGVuIGB3LT5tYy5zZXRfY3Vyc29yX2djID0gdHJ1ZScsIGZvcmNlIGB4X3NldF9jdXJz b3JfZ2MnIHRvCisgICAgICAgICAgICB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29y X2djJy4gICovCisgICAgICAgICAgICB3LT5tYy5zZXRfY3Vyc29yX2djID0gdHJ1ZTsKKyAgICAg ICAgICAgIGRyYXdfcGh5c19jdXJzb3JfZ2x5cGggKHcsIGdseXBoX3JvdywgRFJBV19DVVJTT1Ip OworICAgICAgICAgICAgdy0+bWMuc2V0X2N1cnNvcl9nYyA9IGZhbHNlOworICAgICAgICAgICAg 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 ZWFrOworICAgICAgZGVmYXVsdDoKKyAgICAgICAgZW1hY3NfYWJvcnQgKCk7C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WRpX3Vuc2hlbHZlX2NhY2hlIChpdGRhdGEsIGZhbHNl KTsKKyAgICB9CisgICAgZWxzZQorICAgICAgeworICAgICAgICB4ID0gLTE7CisgICAgICAgIHkg PSAtMTsKKyAgICAgICAgaHBvcyA9IC0xOworICAgICAgICB2cG9zID0gLTE7CisgICAgICB9Cisg IHJldHVybiBsaXN0biAoQ09OU1RZUEVfUFVSRSwgNCwgbWFrZV9udW1iZXIgKHgpLCBtYWtlX251 bWJlciAoeSksIG1ha2VfbnVtYmVyIChocG9zKSwgbWFrZV9udW1iZXIgKHZwb3MpKTsKK30KKwor aW50CittY19saXNwX3RvX2N1cnNvcl90eXBlIChMaXNwX09iamVjdCBhcmcpCit7CisgIGNoYXIg KnN0cjsKKyAgaWYgKFhUWVBFIChhcmcpID09IExpc3BfU3RyaW5nKQorICAgIHN0ciA9IFNTREFU QSAoYXJnKTsKKyAgZWxzZSBpZiAoWFRZUEUgKGFyZykgPT0gTGlzcF9TeW1ib2wpCisgICAgc3Ry ID0gU1NEQVRBIChTWU1CT0xfTkFNRSAoYXJnKSk7CisgIGVsc2UgcmV0dXJuIC0xOworICBpZiAo IXN0cmNtcCAoc3RyLCAiYm94IikpCisgICAgcmV0dXJuIEZJTExFRF9CT1hfQ1VSU09SOworICBp ZiAoIXN0cmNtcCAoc3RyLCAiaG9sbG93IikpCisgICAgcmV0dXJuIEhPTExPV19CT1hfQ1VSU09S OworICBpZiAoIXN0cmNtcCAoc3RyLCAiaGJhciIpKQorICAgIHJldHVybiBIQkFSX0NVUlNPUjsK KyAgaWYgKCFzdHJjbXAgKHN0ciwgImJhciIpKQorICAgIHJldHVybiBCQVJfQ1VSU09SOworICBp ZiAoIXN0cmNtcCAoc3RyLCAibm8iKSkKKyAgICByZXR1cm4gTk9fQ1VSU09SOworICByZXR1cm4g LTE7Cit9CisKKy8qIEVYQU1QTEUgIzE6CisgICAgKHNldHEgbWMtbGlzdCAnKAorICAgICAgKDMg ImhiYXIiIFsxLjAgMC4wID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LnN0YXJ0ID0gbWFya2VyX3Bvc2l0aW9uICh3LT5zdGFydCk7CisgIGlm ICghdy0+bWMuZW5kKQorICAgIHctPm1jLmVuZCA9IEJVRl9aIChYQlVGRkVSICh3LT5jb250ZW50 cykpIC0gdy0+d2luZG93X2VuZF9wb3M7CisgIGlmICh3LT5tY19jYWNoZQorICAgICAgJiYgKE5J TFAgKEZlcXVhbCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB3LT5tY19jYWNoZSksIEJWQVIgKGN1 cnJlbnRfYnVmZmVyLCBtY19saXN0KSkpCisgICAgICAgICAgfHwgdyAhPSBzdykpCisgICAgewor I2lmZGVmIEdMWVBIX0RFQlVHCisgIGRlYnVnX21ldGhvZF9hZGQgKHcsICJtY19jYWxjOiAgcmVt b3ZlIGN1cnNvcnMgdXNpbmcgY2FjaGUiKTsKKyNlbmRpZgorICAgICAgZm9yICh2bGlzdCA9IFhD QVIgKFhDRFIgKHctPm1jX2NhY2hlKSk7CisgICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAg ICAgICAgIHZsaXN0ID0gWENEUiAodmxpc3QpKQorICAgICAgICB7CisgICAgICAgICAgY3Vyc29y X3NwZWNfbGlzdCA9IFhDQVIgKFhDQVIgKHZsaXN0KSk7CisgICAgICAgICAgcG9zaW50ID0gWElO VCAoRm50aCAobWFrZV9udW1iZXIgKDApLCBjdXJzb3Jfc3BlY19saXN0KSk7CisgICAgICAgICAg Y3Vyc29yX3NwZWNfdHlwZSA9IEZudGggKG1ha2VfbnVtYmVyICgxKSwgY3Vyc29yX3NwZWNfbGlz dCk7CisgICAgICAgICAgaWYgKENPTlNQIChjdXJzb3Jfc3BlY190eXBlKSkKKyAgICAgICAgICAg IGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAoY3Vyc29yX3NwZWNf dHlwZSkpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1j X2xpc3BfdG9fY3Vyc29yX3R5cGUgKGN1cnNvcl9zcGVjX3R5cGUpOworICAgICAgICAgIGlmIChD T05TUCAoY3Vyc29yX3NwZWNfdHlwZSkpCisgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSBYSU5U IChYQ0FSIChYQ0RSIChjdXJzb3Jfc3BlY190eXBlKSkpOworICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSAxOworICAgICAgICAgIGN1cnNvcl9jb2xvcl92ZWN0 b3IgPSBGbnRoIChtYWtlX251bWJlciAoMiksIGN1cnNvcl9zcGVjX2xpc3QpOworICAgICAgICAg IHJlZCA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAwKSk7CisgICAg ICAgICAgZ3JlZW4gPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMSkp OworICAgICAgICAgIGJsdWUgPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3Rv ciwgMikpOworICAgICAgICAgIGlmIChwb3NpbnQKKyAgICAgICAgICAgICAgJiYgdy0+bWMuc3Rh cnQKKyAgICAgICAgICAgICAgJiYgdy0+bWMuZW5kCisgICAgICAgICAgICAgICYmIHBvc2ludCA+ PSB3LT5tYy5zdGFydAorICAgICAgICAgICAgICAmJiBwb3NpbnQgPD0gdy0+bWMuZW5kKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICB4X3lfaHBvc192cG9zX2xpc3QgPSBYQ0FSIChYQ0RS IChYQ0FSICh2bGlzdCkpKTsKKyAgICAgICAgICAgICAgeCA9IFhJTlQgKEZudGggKG1ha2VfbnVt YmVyICgwKSwgeF95X2hwb3NfdnBvc19saXN0KSk7CisgICAgICAgICAgICAgIHkgPSBYSU5UIChG bnRoIChtYWtlX251bWJlciAoMSksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAg ICBocG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDIpLCB4X3lfaHBvc192cG9zX2xpc3Qp KTsKKyAgICAgICAgICAgICAgdnBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgzKSwgeF95 X2hwb3NfdnBvc19saXN0KSk7CisgICAgICAgICAgICAgIG1jX2VyYXNlICh3LCB4LCB5LCBocG9z LCB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByZWQsIGdyZWVuLCBibHVlKTsKKyAg ICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgdy0+bWNfY2FjaGUgPSBRbmlsOworICAgIH0K KyAgICBlbHNlIGlmICh3ID09IHN3CisgICAgICAgICAgICAmJiB3LT5tYy5zdGFydAorICAgICAg ICAgICAgJiYgdy0+bWMuZW5kCisgICAgICAgICAgICAmJiB3LT5tYy5wcmV2X3N0YXJ0CisgICAg ICAgICAgICAmJiB3LT5tYy5wcmV2X2VuZAorICAgICAgICAgICAgJiYgdy0+bWMuc3RhcnQgPT0g dy0+bWMucHJldl9zdGFydAorICAgICAgICAgICAgJiYgdy0+bWMuZW5kID09IHctPm1jLnByZXZf ZW5kCisgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoY3VycmVudF9idWZmZXIsIG1jX2xpc3Qp KQorICAgICAgICAgICAgJiYgdy0+bWNfY2FjaGUKKyAgICAgICAgICAgICYmICFOSUxQIChGZXF1 YWwgKEZudGggKG1ha2VfbnVtYmVyICgwKSwgdy0+bWNfY2FjaGUpLCBCVkFSIChjdXJyZW50X2J1 ZmZlciwgbWNfbGlzdCkpKSkKKyAgICAgIHsKKyNpZmRlZiBHTFlQSF9ERUJVRworICBkZWJ1Z19t ZXRob2RfYWRkICh3LCAibWNfY2FsYzogIGRyYXcgY3Vyc29ycyB1c2luZyBjYWNoZSIpOworI2Vu ZGlmCisgICAgICAgIGZvciAodmxpc3QgPSBYQ0FSIChYQ0RSICh3LT5tY19jYWNoZSkpOworICAg ICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgICAgICAgdmxpc3QgPSBYQ0RSICh2bGlz dCkpCisgICAgICAgICAgeworICAgICAgICAgICAgY3Vyc29yX3NwZWNfbGlzdCA9IFhDQVIgKFhD QVIgKHZsaXN0KSk7CisgICAgICAgICAgICBwb3NpbnQgPSBYSU5UIChGbnRoIChtYWtlX251bWJl ciAoMCksIGN1cnNvcl9zcGVjX2xpc3QpKTsKKyAgICAgICAgICAgIGN1cnNvcl9zcGVjX3R5cGUg PSBGbnRoIChtYWtlX251bWJlciAoMSksIGN1cnNvcl9zcGVjX2xpc3QpOworICAgICAgICAgICAg aWYgKENPTlNQIChjdXJzb3Jfc3BlY190eXBlKSkKKyAgICAgICAgICAgICAgY3Vyc29yX3R5cGUg PSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChjdXJzb3Jfc3BlY190eXBlKSk7CisgICAg ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9f Y3Vyc29yX3R5cGUgKGN1cnNvcl9zcGVjX3R5cGUpOworICAgICAgICAgICAgaWYgKENPTlNQIChj dXJzb3Jfc3BlY190eXBlKSkKKyAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0gWElOVCAoWENB UiAoWENEUiAoY3Vyc29yX3NwZWNfdHlwZSkpKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgIGN1cnNvcl93aWR0aCA9IDE7CisgICAgICAgICAgICBjdXJzb3JfY29sb3JfdmVj dG9yID0gRm50aCAobWFrZV9udW1iZXIgKDIpLCBjdXJzb3Jfc3BlY19saXN0KTsKKyAgICAgICAg ICAgIHJlZCA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAwKSk7Cisg ICAgICAgICAgICBncmVlbiA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9y LCAxKSk7CisgICAgICAgICAgICBibHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xv cl92ZWN0b3IsIDIpKTsKKyAgICAgICAgICAgIGlmIChwb3NpbnQKKyAgICAgICAgICAgICAgICAm JiB3LT5tYy5zdGFydAorICAgICAgICAgICAgICAgICYmIHctPm1jLmVuZAorICAgICAgICAgICAg ICAgICYmIHBvc2ludCA+PSB3LT5tYy5zdGFydAorICAgICAgICAgICAgICAgICYmIHBvc2ludCA8 PSB3LT5tYy5lbmQpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB4X3lfaHBvc192 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 KEZudGggKG1ha2VfbnVtYmVyICgz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AocmVkID49IDAgJiYgYmx1ZSA+PSAwICYm IGdyZWVuID49IDApCisgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgeworICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYg PSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICAgICAgICBzdHJ1Y3QgeF9kaXNwbGF5X2lu Zm8gKmRweWluZm8gPSBGUkFNRV9ESVNQTEFZX0lORk8gKGYpOworICAgICAgICB1bnNpZ25lZCBs b25nIG9yaWdfdmFsID0gZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsOworICAgICAgICBp bnQgaW50X3JlZCA9IHJlZCAqIDY1NTM1OworICAgICAgICBpbnQgaW50X2dyZWVuID0gZ3JlZW4g KiA2NTUzNTsKKyAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDY1NTM1OworICAgICAgICBm LT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSB4X21ha2VfdHJ1ZWNvbG9yX3BpeGVsIChk cHlpbmZvLCBpbnRfcmVkLCBpbnRfZ3JlZW4sIGludF9ibHVlKTsKKyAgICAgICAgeF9kcmF3X2Jh cl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRoLCBIQkFSX0NVUlNPUik7CisgICAg ICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdfdmFsOworICAgICAgfQor ICAgICAgZWxzZQorICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJz b3Jfd2lkdGgsIEhCQVJfQ1VSU09SKTsKKyAgICBicmVhazsKKyAgfQorICBjYXNlIE5PX0NVUlNP UjoKKyAgICB3LT5waHlzX2N1cnNvcl93aWR0aCA9IDA7CisgICAgYnJlYWs7CisgIGRlZmF1bHQ6 CisgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KIAl9CiAKICNpZmRlZiBIQVZFX1hfSTE4Tgo= --Multipart_Thu_Mar_17_21:00:31_2016-1--