From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.bugs Subject: bug#22873: Can we support multiple Cursors? Date: Sun, 25 Jun 2017 15:09:16 -0700 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sun_Jun_25_15:09:16_2017-1" X-Trace: blaine.gmane.org 1498428620 11938 195.159.176.226 (25 Jun 2017 22:10:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 25 Jun 2017 22:10:20 +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 Jun 26 00:10:15 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPFjS-0002nY-15 for geb-bug-gnu-emacs@m.gmane.org; Mon, 26 Jun 2017 00:10:15 +0200 Original-Received: from localhost ([::1]:43994 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPFjX-0003MM-1s for geb-bug-gnu-emacs@m.gmane.org; Sun, 25 Jun 2017 18:10:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPFjM-0003KC-4h for bug-gnu-emacs@gnu.org; Sun, 25 Jun 2017 18:10:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dPFjH-0003fs-20 for bug-gnu-emacs@gnu.org; Sun, 25 Jun 2017 18:10:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35055) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dPFjG-0003fk-RS for bug-gnu-emacs@gnu.org; Sun, 25 Jun 2017 18:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dPFjG-0006Ul-I1 for bug-gnu-emacs@gnu.org; Sun, 25 Jun 2017 18:10: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: Sun, 25 Jun 2017 22:10: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.149842856324916 (code B ref 22873); Sun, 25 Jun 2017 22:10:02 +0000 Original-Received: (at 22873) by debbugs.gnu.org; 25 Jun 2017 22:09:23 +0000 Original-Received: from localhost ([127.0.0.1]:37732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPFic-0006To-V2 for submit@debbugs.gnu.org; Sun, 25 Jun 2017 18:09:23 -0400 Original-Received: from gateway34.websitewelcome.com ([192.185.150.114]:40746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPFia-0006Tf-Fo for 22873@debbugs.gnu.org; Sun, 25 Jun 2017 18:09:21 -0400 Original-Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway34.websitewelcome.com (Postfix) with ESMTP id 023D71468 for <22873@debbugs.gnu.org>; Sun, 25 Jun 2017 17:09:19 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id PFi4dSDAT8mWRPFi4dXMWk; Sun, 25 Jun 2017 17:08:48 -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: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Q8karhwnDyDq3XmeDQ9dKlYqkZ6cvgob6NQcsYCOUHo=; b=ajzuDMmKecAGDPVJQoVOmMuP09 CmY7cKLdBi7nx6suRHjnCqdo67f3qjVzq5rqVlcZhTmcCbctubTksGcYE9xrfC7jMOvtCPmRdfu6V IEhPFQIna3LP9KasXRdITg96933vWU9nMcDZIcE/d5XsndRzbh4U2smev6hVVnPe/fK+GsqixNUeL Q0dG90JtJXTsWSg6khV74MSRvsA2F6ZgpqsMdsABoNe1askFkSsoJrn7eA3cribOB/vUaLNwT+8TI /YsKJeh1rbEDYwB4B4VZmif5f2RA942Dcl4MVFxk4FC3xJSfDs5TzmfqteA6SMGTN+YKuUUBb2CoK 1kXCWAXg==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:52707 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from ) id 1dPFiX-0045XG-HX; Sun, 25 Jun 2017 17:09:17 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.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-BWhitelist: no X-Source-IP: 45.48.239.195 X-Exim-ID: 1dPFiX-0045XG-HX X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:52707 X-Source-Auth: lawlist X-Email-Count: 4 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t 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" Xref: news.gmane.org gmane.emacs.bugs:133903 Archived-At: --Multipart_Sun_Jun_25_15:09:16_2017-1 Content-Type: text/plain; charset=US-ASCII WHAT'S NEW: - Fake cursors now only appear in the selected-window if the `mc-list' is defined -- i.e., the fake cursors are removed when the window loses focus, and they are added again when the window acquires focus. - `mc_color_vector_calculate` will take the familiar Emacs way of specifying colors (e.g., "red" and "#FF0000") and convert them internally to the LSL color vector. The conversion process is transparent to the user. - `mc_remove_when_scrolled` will remove multiple cursors when scrolling. This is important because `update_window_end` will not remove the cursors when scrolling. [There was an emacs-devel thread (about 1.5 years ago) where I had sought help tracking the multiple cursors when scrolling. It turned out that the method of tracking cursors was not the problem (since they don't move) -- it was simply that `update_window_end` was not being called in that circumstance.] - `mc_x_y_hpos_vpos' contains some extra `stuff` that is irrelevant to the functionality of this patch -- the extra `stuff` is used by me as a workaround to deal with the overlay after-string property that gets in the way of properly calculating coordinates. [See the TODO section below.] - The patch applies to commit a30e7e12ed8465e2565dd318d921bc87f52ce18e from 03/28/2016. [See apology for the inconvenience further down below.] TODO: - Optimize drawing and removal of multiple fake cursors. - Fix any bugs (there will surely be many). - Implement a way to properly calculate x, y, hpos, vpos when overlays are present -- e.g., the overlay after-string property wreaks havoc on the current method of calculating coordinates. - Try and convince one or more real programmers to take over from here, since we now have a working proof concept. [I am just a weekend hobbyist without any formal programming study.] SUGGESTION: I would respectfully suggest to the Emacs development team that multiple cursors be implemented in two stages: - The first stage would be the creation and removal of fake cursors to be used kind of like overlays. I.e., specify the `point`, cursor-style, and color. The suggestion by Eli Z. to support specifying colors with strings like "red" and "#FF0000" has now been implemented. - The second stage would be to implement built-in functionality similar to the multiple cursors library by Magnar Sveen. [In an earlier section of this thread, I mentioned a substantial slow-down that I experienced when using the library written by Mr. Sveen. I have since discovered that it was due to `line-number-at-pos', and I have already reached out to the author with an alternative suggestion to use (format-mode-line "%l").] INSTALLATION (for anyone a little less familiar): STEP #1 (clone master branch): git clone -b master git://git.sv.gnu.org/emacs.git STEP #2: cd over to the root of the `emacs` source directory cloned in the first step above. STEP #3 (hard reset): git reset --hard a30e7e12ed8465e2565dd318d921bc87f52ce18e You will see a message: "HEAD is now at a30e7e1 Mention the `M-q' changes" [We need to go back in time to 03/28/2016 as that is the master branch version that I am still using -- sorry for the inconvenience. I will update to the latest version of Emacs at some point in the future as time permits. Creating patches that apply to a "moving target" is challenging.] STEP #4 (put the patch in place): Copy the latest patch (multiple_cursors_008.diff) to the root of the emacs source directory cloned in the first step above. STEP #5 (apply the patch): git apply multiple_cursors_008.diff STEP #6: ./autogen.sh STEP #7: Configure the build for X, MS Windows, or OSX; e.g.,: ./configure --with-ns STEP #8: make STEP #9: make install STEP #10: Launch the newly built Emacs, and copy the following function to the `*scratch*` buffer, and type `M-x mc-test`. (defun mc-test () "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. Popular forms of specifying colors such as \"red\" and \"#FF0000\" are now supported, as well as LSL color vectors such as [1.0 0.0 0.0]. For those users who choose the former familiar methods of specifying colors with strings, `mc_color_vector_calculate' will convert those strings to LSL color vectors. The color vectors are commonly referred to as LSL (The Linden Scripting Language). `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) (let ((buffer (get-buffer-create "*MC-TEST*"))) (with-current-buffer buffer (erase-buffer) (insert "This is a test!") (setq mc-list '((1 "hbar" "red") (2 "bar" "yellow") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0])))) (select-window (display-buffer buffer)) ;;; The trigger in `keyboard.c` is not activated in this example, so we ;;; Force the multiple cursors to be drawn. (mc-draw-erase (selected-window)))) --Multipart_Sun_Jun_25_15:09:16_2017-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="multiple_cursors_008.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIuYyBiL3NyYy9idWZmZXIuYwppbmRleCA2MmIwYmM4Li41 Yjk0NjliIDEwMDY0NAotLS0gYS9zcmMvYnVmZmVyLmMKKysrIGIvc3JjL2J1ZmZlci5jCkBAIC01 MDU2LDYgKzUwNTYsMTYgQEAgaW5pdF9idWZmZXJfb25jZSAodm9pZCkKICAgYnNldF9sYXN0X3Nl bGVjdGVkX3dpbmRvdyAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbWFrZV9udW1iZXIgKDApKTsKIAog ICBpZHggPSAxOworCisKKy8qIDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsgKi8KKy8qIG11bHRpcGxl IGN1cnNvcnMgKi8KKworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywg bWNfbGlzdCksIGlkeCk7ICsraWR4OworCisvKiA7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs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GUpKSkpKSkKKyAgICAgICAgICAmJiAhTUlOSV9XSU5ET1dfUCAo dykpCisgICAgICAgIHsKKyAgICAgICAgICAvKiBSZW1vdmUgZmFrZSBjdXJzb3JzLiAgKi8KKyAg ICAgICAgICBpZiAoKHctPm1jX2NhY2hlICYmIChFUSAody0+Y29udGVudHMsIFhDQVIgKEZudGgg KG1ha2VfbnVtYmVyICgyKSwgdy0+bWNfY2FjaGUpKSkpKSkKKyAgICAgICAgICAgIG1jX2NhbGMg KHcsIDEpOworICAgICAgICAgIC8qIERyYXcgZmFrZSBjdXJzb3JzICAqLworICAgICAgICAgIGlm ICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19saXN0KSkpCisgICAgICAg ICAgICBtY19jYWxjICh3LCAwKTsKKyAgICAgICAgfQorCisgICAgICAvKiBGaXJzdCBhdHRlbXB0 IGF0IGRlYWxpbmcgd2l0aCBhIGByZWRpc3BsYXlfcHJlc2VydmVfZWNob19hcmVhJyBzaXR1YXRp b24uICAqLworICAgICAgaWYgKCF3LT5tYy5kcmF3X2VyYXNlCisgICAgICAgICAgJiYgIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfbGlzdCkpCisgICAgICAgICAgJiYgdy0+ bWNfY2FjaGUKKyAgICAgICAgICAmJiAoRVEgKHctPmNvbnRlbnRzLCBYQ0FSIChGbnRoIChtYWtl X251bWJlciAoMiksIHctPm1jX2NhY2hlKSkpKQorICAgICAgICAgICYmICFNSU5JX1dJTkRPV19Q ICh3KSkKKyAgICAgICAgeworICAgICAgICAgIC8qIFJlbW92ZSBmYWtlIGN1cnNvcnMuICAqLwor ICAgICAgICAgIG1jX2NhbGMgKHcsIDEpOworICAgICAgICAgIC8qIERyYXcgZmFrZSBjdXJzb3Jz ICAqLworICAgICAgICAgIG1jX2NhbGMgKHcsIDApOworICAgICAgICB9CisKKy8qIEVORCBtdWx0 aXBsZSBjdXJzb3JzICovCisvKiA7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ZSA+PSAwICYmIGdyZWVuID49IDApCisg ICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3Jf cGl4ZWwnLiAgKi8KKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFN RSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICAgICAgICAgQ09MT1JSRUYgb3JpZ192YWwgPSBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbDsKKyAgICAgICAgICBpbnQgaW50X3JlZCA9IHJl ZCAqIDI1NTsKKyAgICAgICAgICBpbnQgaW50X2dyZWVuID0gZ3JlZW4gKiAyNTU7CisgICAgICAg ICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDI1NTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53 MzItPmN1cnNvcl9waXhlbCA9IFBBTEVUVEVSR0IgKGludF9yZWQsIGludF9ncmVlbiwgaW50X2Js dWUpOworICAgICAgICAgIHhfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBnbHlwaF9yb3cpOworICAg ICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ192YWw7CisgICAg ICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHhfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBn bHlwaF9yb3cpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgRklMTEVEX0JPWF9DVVJT T1I6CisgICAgeworICAgICAgLyogVE9ETzogIGtkYiB0byBjb25zaWRlciBhZGRpbmcgc3VwcG9y dCBmb3IgbXVsdGlwbGUgY3Vyc29yIGZvcmVncm91bmQKKyAgICAgIGN1c3RvbWl6YXRpb24gb2Yg YSBGSUxMRURfQk9YX0NVUlNPUi4gICovCisgICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAw ICYmIGdyZWVuID49IDApCisgICAgICAgIC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f cmVkLCBpbnRfZ3JlZW4sIGludF9ibHVlKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzIt PmN1cnNvcl9nYworICAgICAgICAgICAgPSBYQ3JlYXRlR0MgKE5VTEwsIEZSQU1FX1czMl9XSU5E T1cgKGYpLCBtYXNrLCAmZ2NfdmFsdWVzKTsKKyAgICAgICAgICAvKiBXaGVuIGB3LT5tYy5zZXRf Y3Vyc29yX2djID0gdHJ1ZScsIGZvcmNlIGB4X3NldF9jdXJzb3JfZ2MnIHRvCisgICAgICAgICAg dXNlIGBzLT5mLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycuICAqLworICAgICAgICAgIHct Pm1jLnNldF9jdXJzb3JfZ2MgPSB0cnVlOworICAgICAgICAgIGRyYXdfcGh5c19jdXJzb3JfZ2x5 cGggKHcsIGdseXBoX3JvdywgRFJBV19DVVJTT1IpOworICAgICAgICAgIHctPm1jLnNldF9jdXJz b3JfZ2MgPSBmYWxzZTsKKyAgICAgICAgICBnY192YWx1ZXMuZm9udCA9IEZSQU1FX0ZPTlQgKGYp OworICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3JvdW5kID0gb3JpZ192YWxfYTsKKyAgICAgICAg ICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IG9yaWdfdmFsX2I7CisgICAgICAgICAgZi0+b3V0cHV0 X2RhdGEudzMyLT5jdXJzb3JfZ2MKKyAgICAgICAgICAgID0gWENyZWF0ZUdDIChOVUxMLCBGUkFN RV9XMzJfV0lORE9XIChmKSwgbWFzaywgJmdjX3ZhbHVlcyk7CisgICAgICAgICAgdW5ibG9ja19p bnB1dCAoKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgZHJhd19waHlzX2N1 cnNvcl9nbHlwaCAodywgZ2x5cGhfcm93LCBEUkFXX0NVUlNPUik7CisgICAgICBicmVhazsKKyAg ICB9CisgICAgY2FzZSBCQVJfQ1VSU09SOgorICAgIHsKKyAgICAgIGlmIChyZWQgPj0gMCAmJiBi bHVlID49IDAgJiYgZ3JlZW4gPj0gMCkKKyAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBm LT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICB7CisgICAgICAg ICAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgICAgICAg ICBDT0xPUlJFRiBvcmlnX3ZhbCA9IGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsOwor ICAgICAgICAgIGludCBpbnRfcmVkID0gcmVkICogMjU1OworICAgICAgICAgIGludCBpbnRfZ3Jl ZW4gPSBncmVlbiAqIDI1NTsKKyAgICAgICAgICBpbnQgaW50X2JsdWUgPSBibHVlICogMjU1Owor ICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gUEFMRVRURVJHQiAo aW50X3JlZCwgaW50X2dyZWVuLCBpbnRfYmx1ZSk7CisgICAgICAgICAgeF9kcmF3X2Jhcl9jdXJz b3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRoLCBCQVJfQ1VSU09SKTsKKyAgICAgICAgICBm LT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdfdmFsOworICAgICAgICB9Cisg ICAgICAgIGVsc2UKKyAgICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBj dXJzb3Jfd2lkdGgsIEJBUl9DVVJTT1IpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2Ug SEJBUl9DVVJTT1I6CisgICAgeworICAgICAgaWYgKHJlZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBn cmVlbiA+PSAwKQorICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRh LnczMi0+Y3Vyc29yX3BpeGVsJy4g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ib29sIG92X2ZvdW5kX3R5cGVfY29sZW92bCA9 IGZhbHNlOworICBib29sIG92X2ZvdW5kX2FmdGVyc3RyaW5nID0gZmFsc2U7CisgIGJvb2wgb3Zf Zm91bmRfdHlwZV9yaWdodGZyaW5nZSA9IGZhbHNlOworICBpZiAocG9zaW50ID49IHN0YXJ0Cisg ICAgICAmJiBwb3NpbnQgPD0gZW5kKQorICAgIHsKKyAgICAgIG92ZXJsYXlzID0gRm92ZXJsYXlz X2luIChtYWtlX251bWJlciAocG9zaW50KSwgKG1ha2VfbnVtYmVyIChwb3NpbnQgKyAxKSkpOwor ICAgICAgaWYgKCFOSUxQIChvdmVybGF5cykpCisgICAgICAgIHsKKyAgICAgICAgICBmb3IgKG92 X2xpc3QgPSBvdmVybGF5czsKKyAgICAgICAgICAgICAgIENPTlNQIChvdl9saXN0KTsKKyAgICAg ICAgICAgICAgIG92X2xpc3QgPSBYQ0RSIChvdl9saXN0KSkKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgb3YgPSBYQ0FSIChvdl9saXN0KTsKKyAgICAgICAgICAgICAgb3ZfcXVlcnlfdHlw ZSA9IEZvdmVybGF5X2dldCAob3YsIG92X3R5cGUpOworICAgICAgICAgICAgICBvdl9xdWVyeV9k aXNwbGF5ID0gRm92ZXJsYXlfZ2V0IChvdiwgUWRpc3BsYXkpOworICAgICAgICAgICAgICBvdl9x dWVyeV9hZnRlcl9zdHJpbmcgPSBGb3ZlcmxheV9nZXQgKG92LCBRYWZ0ZXJfc3RyaW5nKTsKKyAg ICAgICAgICAgICAgaWYgKEVRIChvdl9xdWVyeV90eXBlLCBvdl9jb2xfZW92bCkpCisgICAgICAg ICAgICAgICAgb3ZfZm91bmRfdHlwZV9jb2xlb3ZsID0gdHJ1ZTsKKyAgICAgICAgICAgICAgaWYg KEVRIChvdl9xdWVyeV90eXBlLCBvdl9yaWdodF9mcmluZ2UpKQorICAgICAgICAgICAgICAgIG92 X2ZvdW5kX3R5cGVfcmlnaHRmcmluZ2UgPSB0cnVlOworICAgICAgICAgICAgICBpZiAoIU5JTFAg KG92X3F1ZXJ5X2FmdGVyX3N0cmluZykpCisgICAgICAgICAgICAgICAgb3ZfZm91bmRfYWZ0ZXJz dHJpbmcgPSB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBTRVRfVEVYVF9Q T1NfRlJPTV9NQVJLRVIgKHB0LCB3LT5zdGFydCk7CisgICAgICBzdGFydF9kaXNwbGF5ICgmaXQs IHcsIHB0KTsKKyAgICAgIG1vdmVfaXRfdG8gKCZpdCwgcG9zaW50LCAtMSwgLTEsIC0xLCBNT1ZF X1RPX1BPUyk7CisgICAgICB5ID0gaXQuY3VycmVudF95OworICAgICAgdnBvcyA9IGl0LnZwb3M7 CisgICAgICBpZiAob3ZfZm91bmRfdHlwZV9jb2xlb3ZsKQorICAgICAgICB7CisgICAgICAgICAg VEVNUF9TRVRfUFRfQk9USCAoQ0hBUlBPUyAoaXQuY3VycmVudC5wb3MpLCBCWVRFUE9TIChpdC5j dXJyZW50LnBvcykpOworICAgICAgICAgIHBlb3ZsX2NvbCA9IGN1cnJlbnRfY29sdW1uICgpIC0g MTsKKyAgICAgICAgICBtb3ZlX2l0X2J5X2xpbmVzICgmaXQsIC0xKTsKKyAgICAgICAgICBURU1Q X1NFVF9QVF9CT1RIIChDSEFSUE9TIChpdC5jdXJyZW50LnBvcyksIEJZVEVQT1MgKGl0LmN1cnJl bnQucG9zKSk7CisgICAgICAgICAgcGJvdmxfY29sID0gY3VycmVudF9jb2x1bW4gKCk7CisgICAg ICAgICAgY29sX2VvdmwgPSBwZW92bF9jb2wgLSBwYm92bF9jb2w7CisgICAgICAgICAgeCA9IGNv bF9lb3ZsICogZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICBocG9zID0gY29sX2Vvdmw7Cisg ICAgICAgICAgVEVNUF9TRVRfUFRfQk9USCAob3BvaW50LCBvYnl0ZXBvcyk7CisgICAgICAgIH0K KyAgICAgICAgLyogU3BlY2lhbCBoYW5kbGluZyBmb3IgYGFmdGVyLXN0cmluZycgYW5kIGVvYiBz aXR1YXRpb25zLiAgKi8KKyAgICAgICAgZWxzZSBpZiAob3ZfZm91bmRfYWZ0ZXJzdHJpbmcKKyAg ICAgICAgICAgICAgICAgfHwgRkVUQ0hfQllURSAoSVRfQllURVBPUyAoaXQpKSA9PSAnXG4nCisg ICAgICAgICAgICAgICAgIHx8IHBvc2ludCA9PSBaVikKKyAgICAgICAgICB7CisgICAgICAgICAg ICBURU1QX1NFVF9QVF9CT1RIIChDSEFSUE9TIChpdC5jdXJyZW50LnBvcyksIEJZVEVQT1MgKGl0 LmN1cnJlbnQucG9zKSk7CisgICAgICAgICAgICBwZW92bF9jb2wgPSBjdXJyZW50X2NvbHVtbiAo KTsKKyAgICAgICAgICAgIC8qIERWUE9TID09IDAgbWVhbnMgbW92ZSB0byB0aGUgc3RhcnQgb2Yg dGhlIHNjcmVlbiBsaW5lLiAgKi8KKyAgICAgICAgICAgIG1vdmVfaXRfYnlfbGluZXMgKCZpdCwg MCk7CisgICAgICAgICAgICBURU1QX1NFVF9QVF9CT1RIIChDSEFSUE9TIChpdC5jdXJyZW50LnBv cyksIEJZVEVQT1MgKGl0LmN1cnJlbnQucG9zKSk7CisgICAgICAgICAgICBwYm92bF9jb2wgPSBj dXJyZW50X2NvbHVtbiAoKTsKKyAgICAgICAgICAgIGNvbF9lb3ZsID0gcGVvdmxfY29sIC0gcGJv dmxfY29sOworICAgICAgICAgICAgeCA9IGNvbF9lb3ZsICogZnJhbWVfY2hhcl93aWR0aDsKKyAg ICAgICAgICAgIGhwb3MgPSBjb2xfZW92bDsKKyAgICAgICAgICAgIFRFTVBfU0VUX1BUX0JPVEgg KG9wb2ludCwgb2J5dGVwb3MpOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIHggPSBpdC5jdXJyZW50X3g7CisgICAgICAgICAgICAgIGhw b3MgPSBp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LCB3aWR0aDsKKyAgICAgIGlmICghKHZwb3MgPj0gMAorICAgICAgICAg ICYmIHZwb3MgPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MpKQorICAgICAgICBjdXJzb3JfZ2x5 cGggPSBOVUxMOworICAgICAgaWYgKCFjdXJzb3Jfcm93LT5lbmFibGVkX3ApCisgICAgICAgIGN1 cnNvcl9nbHlwaCA9IE5VTEw7CisgICAgICBpZiAody0+aHNjcm9sbCkKKyAgICAgICAgeworICAg ICAgICAgIC8qIFdoZW4gdGhlIHdpbmRvdyBpcyBoc2Nyb2xsZWQsIGN1cnNvciBocG9zIGNhbiBs ZWdpdGltYXRlbHkgYmUKKyAgICAgICAgICAgb3V0IG9mIGJvdW5kcywgYnV0IHdlIGRyYXcgdGhl IGN1cnNvciBhdCB0aGUgY29ycmVzcG9uZGluZworICAgICAgICAgICB3aW5kb3cgbWFyZ2luIGlu IHRoYXQgY2FzZS4gICovCisgICAgICAgICAgaWYgKCFjdXJzb3Jfcm93LT5yZXZlcnNlZF9wICYm IGhwb3MgPCAwKQorICAgICAgICAgICAgaHBvcyA9IDA7CisgICAgICAgICAgaWYgKGN1cnNvcl9y b3ctPnJldmVyc2VkX3AgJiYgaHBvcyA+PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0pCisg ICAgICAgICAgICBocG9zID0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgICAg ICAgfQorICAgICAgaWYgKDAgPD0gaHBvcyAmJiBocG9zIDwgY3Vyc29yX3Jvdy0+dXNlZFtURVhU X0FSRUFdKQorICAgICAgICBjdXJzb3JfZ2x5cGggPSBjdXJzb3Jfcm93LT5nbHlwaHNbVEVYVF9B UkVBXSArIGhwb3M7CisgICAgICBlbHNlCisgICAgICAgIGN1cnNvcl9nbHlwaCA9IE5VTEw7Cisg ICAgICBpZiAoY3Vyc29yX2dseXBoID09IE5VTEwpCisgICAgICAgIGdvdG8gZG9uZTsKKyAgICAg IHdpZHRoID0gY3Vyc29yX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgIGhvbGxvd194ID0geDsK KyAgICAgIGlmICh4IDwgMCkKKyAgICAgICAgeworICAgICAgICAgIHdpZHRoICs9IGhvbGxvd194 OworICAgICAgICAgIGhvbGxvd194ID0gMDsKKyAgICAgICAgfQorICAgICAgd2lkdGggPSBtaW4g KHdpZHRoLCB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpIC0gaG9sbG93X3gpOworICAg ICAgaG9sbG93X3kgPSBXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgbWF4IChoZWFkZXJfbGlu ZV9oZWlnaHQsIGN1cnNvcl9yb3ctPnkpKTsKKyAgICAgIGhvbGxvd194ID0gV0lORE9XX1RFWFRf VE9fRlJBTUVfUElYRUxfWCAodywgaG9sbG93X3gpOworICAgICAgaWYgKHdpZHRoID4gMCkKKyAg ICAgICAgRlJBTUVfUklGIChmKS0+Y2xlYXJfZnJhbWVfYXJlYSAoZiwgaG9sbG93X3gsIGhvbGxv d195LCB3aWR0aCwgY3Vyc29yX3Jvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgIH0KKyAgaWYgKChj dXJzb3Jfcm93LT5yZXZlcnNlZF9wCisgICAgICAgPyAoaHBvcyA+PSAwKQorICAgICAgIDogKGhw b3MgPCBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0pKSkKKyAgICB7CisgICAgICBpbnQgeDE7 CisgICAgICBpZiAoIWN1cnNvcl9yb3ctPnJldmVyc2VkX3AgJiYgaHBvcyA8IDApCisgICAgICAg IGhwb3MgPSAwOworICAgICAgaWYgKGN1cnNvcl9yb3ctPnJldmVyc2VkX3AgJiYgaHBvcyA+PSBj dXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgIGhwb3MgPSBjdXJzb3Jfcm93LT51 c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgeDEgPSBkcmF3X2dse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R0aW5nIG5ldyB2YWx1ZXMu ICAqLworICB3LT5waHlzX2N1cnNvci5ocG9zID0gaHBvczsKKyAgdy0+cGh5c19jdXJzb3IudnBv cyA9IHZwb3M7CisgIHctPnBoeXNfY3Vyc29yLnggPSB4OworICB3LT5waHlzX2N1cnNvci55ID0g Z2x5cGhfcm93LT55OworICBGUkFNRV9SSUYgKGYpLT5kcmF3X3dpbmRvd19jdXJzb3IgKHcsIGds eXBoX3JvdywgeCwgeSwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgMSwgMCwgcmVkLCBncmVl biwgYmx1ZSk7CisgIC8qIFJlc3RvcmUgdGhlIHByZXZpb3VzIHZhbHVlcyBmb3Igdy0+cGh5c19j dXJzb3IueC95L2hwb3MvdnBvcy4gICovCisgIHctPnBoeXNfY3Vyc29yLmhwb3MgPSBwcmlvcl9o cG9zOworICB3LT5waHlzX2N1cnNvci52cG9zID0gcHJpb3JfdnBvczsKKyAgdy0+cGh5c19jdXJz b3IueCA9IHByaW9yX3g7CisgIHctPnBoeXNfY3Vyc29yLnkgPSBwcmlvcl95OworfQorCitpbnQK K21jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKExpc3BfT2JqZWN0IGFyZykKK3sKKyAgY2hhciAqc3Ry OworICBpZiAoWFRZUEUgKGFyZykgPT0gTGlzcF9TdHJpbmcpCisgICAgc3RyID0gU1NEQVRBIChh cmcpOworICBlbHNlIGlmIChYVFlQRSAoYXJnKSA9PSBMaXNwX1N5bWJvbCkKKyAgICBzdHIgPSBT U0RBVEEgKFNZTUJPTF9OQU1FIChhcmcpKTsKKyAgZWxzZSByZXR1cm4gLTE7CisgIGlmICghc3Ry Y21wIChzdHIsICJib3giKSkKKyAgICByZXR1cm4gRklMTEVEX0JPWF9DVVJTT1I7CisgIGlmICgh c3RyY21wIChzdHIsICJob2xsb3ciKSkKKyAgICByZXR1cm4gSE9MTE9XX0JPWF9DVVJTT1I7Cisg IGlmICghc3RyY21wIChzdHIsICJoYmFyIikpCisgICAgcmV0dXJuIEhCQVJfQ1VSU09SOworICBp ZiAoIXN0cmNtcCAoc3RyLCAiYmFyIikpCisgICAgcmV0dXJuIEJBUl9DVVJTT1I7CisgIGlmICgh c3RyY21wIChzdHIsICJubyIpKQorICAgIHJldHVybiBOT19DVVJTT1I7CisgIHJldHVybiAtMTsK K30KKworLyogRVhBTVBMRSAjMToKKyAgICAoc2V0cSBtYy1saXN0ICcoCisgICAgICAoMyAiaGJh ciIgWzEuMCAwLjAgMC4wXSkKKyAgICAgICg0ICJiYXIiIFswLjAgMS4wIDAuMF0pCisgICAgICAo NSAiYm94IiBbMC4wIDAuMCAxLjBdKQorICAgICAgKDYgImhvbGxvdyIgWzAuOCAwLjQgMC4yXSkK KyAgICAgICg3ICgiaGJhciIgMykgWzEuMCAwLjAgMS4wXSkKKyAgICAgICg4ICgiYmFyIiAzKSBb MC4wIDEuMCAxLjBdKSkpCisgICBFWEFNUExFICMyOiAgKHNldHEgbWMtbGlzdCBuaWwpCitUaGUg YG1jX2NhY2hlJyBpcyBrZXB0IGluIHRoZSBmb2xsb3dpbmcgZXhhbXBsZSBmb3JtYXQ6CisgICgo CisgICAgKDMgaGJhciBbMS4wIDAuMCAwLjBdKQorICAgICg0IGJhciBbMC4wIDEuMCAwLjBdKQor ICAgICg1IGJveCBbMC4wIDAuMCAxLjBdKQorICAgICg2IGhvbGxvdyBbMC44IDAuNCAwLjJdKQor ICAgICg3IChoYmFyIDMpIFsxLjAgMC4wIDEuMF0pCisgICAgKDggKGJhciAzKSBbMC4wIDEuMCAx LjBdKSkKKyAgICgKKyAgICAoKDMgaGJhciBbMS4wIDAuMCAwLjBdKSAoMjIgMjAgMiAwKSkKKyAg ICAoKDQgYmFyIFswLjAgMS4wIDAuMF0pICgzMyAyMCAzIDApKQorICAgICgoNSBib3ggWzAuMCAw LjAgMS4wXSkgKDQ0IDIwIDQgMCkpCisgICAgKCg2IGhvbGxvdyBbMC44IDAuNCAwLjJdKSAoNTUg MjAgN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0+bWMub3BvaW50X3kgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMSksIHhfeV9ocG9zX3Zw b3MpKTsKKyAgICAgIHctPm1jLm9wb2ludF9ocG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIg KDIpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICB3LT5tYy5vcG9pbnRfdnBvcyA9IFhJTlQgKEZu dGggKG1ha2VfbnVtYmVyICgzKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgdy0+bWMuc3RhcnQg PSBzdGFydDsKKyAgICAgIHhfeV9ocG9zX3Zwb3MgPSBGbnRoIChtYWtlX251bWJlciAoMCksIG1j X3hfeV9ocG9zX3Zwb3MgKHcsIHN0YXJ0LCBzdGFydCwgZW5kKSk7CisgICAgICB3LT5tYy5zdGFy dF94ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192cG9zKSk7CisgICAg ICB3LT5tYy5zdGFydF95ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBvc192 cG9zKSk7CisgICAgICB3LT5tYy5zdGFydF9ocG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIg KDIpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICB3LT5tYy5zdGFydF92cG9zID0gWElOVCAoRm50 aCAobWFrZV9udW1iZXIgKDMpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICB3LT5tYy5lbmQgPSBl bmQ7CisgICAgICB4X3lfaHBvc192cG9zID0gRm50aCAobWFrZV9udW1iZXIgKDApLCBtY194X3lf aHBvc192cG9zICh3LCBlbmQsIHN0YXJ0LCBlbmQpKTsKKyAgICAgIHctPm1jLmVuZF94ID0gWElO VCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192cG9zKSk7CisgICAgICB3LT5tYy5l bmRfeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3NfdnBvcykpOworICAg ICAgdy0+bWMuZW5kX2hwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMiksIHhfeV9ocG9z X3Zwb3MpKTsKKyAgICAgIHctPm1jLmVuZF92cG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIg KDMpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICB3LT5tYy55X2RpZmYgPSAwOworICAgICAgdy0+ bWMudnBvc19kaWZmID0gMDsKKyAgICB9CisgIGlmICgocmVtb3ZlICYmIHctPm1jX2NhY2hlICYm IE5JTFAgKEJWQVIgKGIsIG1jX2xpc3QpKSkKKyAgICAgIHx8ICh3LT5tY19jYWNoZSAmJiBCVkFS IChiLCBtY19saXN0KSAmJiAocmVtb3ZlIHx8IHcgIT0gc3cpKSkKKyAgICB7CisjaWZkZWYgR0xZ UEhfREVCVUcKKyAgZGVidWdfbWV0aG9kX2FkZCAodywgIm1jX2NhbGM6ICByZW1vdmUgY3Vyc29y cyB1c2luZyBjYWNoZSIpOworI2VuZGlmCisgICAgICBmb3IgKHZsaXN0ID0gWENBUiAoWENEUiAo dy0+bWNfY2FjaGUpKTsKKyAgICAgICAgICAgQ09OU1AgKHZsaXN0KTsKKyAgICAgICAgICAgdmxp c3QgPSBYQ0RSICh2bGlzdCkpCisgICAgICAgIHsKKyAgICAgICAgICBjdXJzb3Jfc3BlY19saXN0 ID0gWENBUiAoWENBUiAodmxpc3QpKTsKKyAgICAgICAgICBwb3NpbnQgPSBYSU5UIChGbnRoICht YWtlX251bWJlciAoMCksIGN1cnNvcl9zcGVjX2xpc3QpKTsKKyAgICAgICAgICBjdXJzb3Jfc3Bl Y190eXBlID0gRm50aCAobWFrZV9udW1iZXIgKDEpLCBjdXJzb3Jfc3BlY19saXN0KTsKKyAgICAg ICAgICBpZiAoQ09OU1AgKGN1cnNvcl9zcGVjX3R5cGUpKQorICAgICAgICAgICAgY3Vyc29yX3R5 cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChjdXJzb3Jfc3BlY190eXBlKSk7Cisg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19j dXJzb3JfdHlwZSAoY3Vyc29yX3NwZWNfdHlwZSk7CisgICAgICAgICAgaWYgKENPTlNQIChjdXJz b3Jfc3BlY190eXBlKSkKKyAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IFhJTlQgKFhDQVIgKFhD RFIgKGN1cnNvcl9zcGVjX3R5cGUpKSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAg IGN1cnNvcl93aWR0aCA9IDE7CisgICAgICAgICAgaWYgKHBvc2ludAorICAgICAgICAgICAgICAm JiB3LT5tYy5zdGFydAorICAgICAgICAgICAgICAmJiB3LT5tYy5lbmQKKyAgICAgICAgICAgICAg JiYgcG9zaW50ID49IHctPm1jLnN0YXJ0CisgICAgICAgICAgICAgICYmIHBvc2ludCA8PSB3LT5t Yy5lbmQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHhfeV9ocG9zX3Zwb3MgPSBYQ0FS IChYQ0RSIChYQ0FSICh2bGlzdCkpKTsKKyAgICAgICAgICAgICAgeCA9IFhJTlQgKEZudGggKG1h a2VfbnVtYmVyICgwKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAgICB5ID0gWElOVCAo Rm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAgICAgIGhw b3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMiksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAg ICAgICAgICAgdnBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgzKSwgeF95X2hwb3NfdnBv cykpOworICAgICAgICAgICAgICBtY19lcmFzZSAodywgeCwgeSwgaHBvcywgdnBvcywgY3Vyc29y X3R5cGUsIGN1cnNvcl93aWR0aCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlm IChOSUxQIChCVkFSIChiLCBtY19saXN0KSkpCisgICAgICAgIHdzZXRfbWNfY2FjaGUgKHcsIFFu aWwpOworICAgIH0KKyAgaWYgKCFyZW1vdmUKKyAgICAgICYmIHcgPT0gc3cKKyAgICAgICYmIHct Pm1jLnN0YXJ0CisgICAgICAmJiB3LT5tYy5lbmQKKyAgICAgICYmIHctPm1jLnByZXZfc3RhcnQK KyAgICAgICYmIHctPm1jLnByZXZfZW5kCisgICAgICAmJiB3LT5tYy5zdGFydCA9PSB3LT5tYy5w cmV2X3N0YXJ0CisgICAgICAmJiB3LT5tYy5lbmQgPT0gdy0+bWMucHJldl9lbmQKKyAgICAgICYm ICFOSUxQIChCVkFSIChiLCBtY19saXN0KSkKKyAgICAgICYmIHctPm1jX2NhY2hlCisgICAgICAm JiAhTklMUCAoRmVxdWFsIChGbnRoIChtYWtlX251bWJlciAoMCksIHctPm1jX2NhY2hlKSwgQlZB UiAoYiwgbWNfbGlzdCkpKSkKKyAgICB7CisjaWZkZWYgR0xZUEhfREVCVUcKKyAgZGVidWdfbWV0 aG9kX2FkZCAodywgIm1jX2NhbGM6ICBkcmF3IGN1cnNvcnMgdXNpbmcgY2FjaGUiKTsKKyNlbmRp ZgorICAgICAgZm9yICh2bGlzdCA9IFhDQVIgKFhDRFIgKHctPm1jX2NhY2hlKSk7CisgICAgICAg ICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgICAgIHZsaXN0ID0gWENEUiAodmxpc3QpKQorICAg ICAgICB7CisgICAgICAgICAgY3Vyc29yX3NwZWNfbGlzdCA9IFhDQVIgKFhDQVIgKHZsaXN0KSk7 CisgICAgICAgICAgcG9zaW50ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCBjdXJzb3Jf c3BlY19saXN0KSk7CisgICAgICAgICAgY3Vyc29yX3NwZWNfdHlwZSA9IEZudGggKG1ha2VfbnVt YmVyICgxKSwgY3Vyc29yX3NwZWNfbGlzdCk7CisgICAgICAgICAgaWYgKENPTlNQIChjdXJzb3Jf c3BlY190eXBlKSkKKyAgICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3Jf dHlwZSAoWENBUiAoY3Vyc29yX3NwZWNfdHlwZSkpOworICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGN1cnNvcl9zcGVj X3R5cGUpOworICAgICAgICAgIGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlwZSkpCisgICAgICAg ICAgICBjdXJzb3Jfd2lkdGggPSBYSU5UIChYQ0FSIChYQ0RSIChjdXJzb3Jfc3BlY190eXBlKSkp OworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSAxOworICAg ICAgICAgIGN1cnNvcl9jb2xvcl92ZWN0b3IgPSBGbnRoIChtYWtlX251bWJlciAoMiksIGN1cnNv cl9zcGVjX2xpc3QpOworICAgICAgICAgIGlmIChTVFJJTkdQIChjdXJzb3JfY29sb3JfdmVjdG9y KSkKKyAgICAgICAgICAgIGN1cnNvcl9jb2xvcl92ZWN0b3IgPSBtY19jb2xvcl92ZWN0b3JfY2Fs Y3VsYXRlICh3LCBjdXJzb3JfY29sb3JfdmVjdG9yKTsKKyAgICAgICAgICByZWQgPSBYRkxPQVRf REFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMCkpOworICAgICAgICAgIGdyZWVuID0g WEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0b3IsIDEpKTsKKyAgICAgICAgICBi bHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0b3IsIDIpKTsKKyAgICAg ICAgICBpZiAocG9zaW50CisgICAgICAgICAgICAgICYmIHctPm1jLnN0YXJ0CisgICAgICAgICAg ICAgICYmIHctPm1jLmVuZAorICAgICAgICAgICAgICAmJiBwb3NpbnQgPj0gdy0+bWMuc3RhcnQK KyAgICAgICAgICAgICAgJiYgcG9zaW50IDw9IHctPm1jLmVuZCkKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgeF95X2hwb3NfdnBvcyA9IFhDQVIgKFhDRFIgKFhDQVIgKHZsaXN0KSkpOwor ICAgICAgICAgICAgICB4ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192 cG9zKSk7CisgICAgICAgICAgICAgIHkgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMSksIHhf eV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICAgICAgaHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVt YmVyICgyKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAgICB2cG9zID0gWElOVCAoRm50 aCAobWFrZV9udW1iZXIgKDMpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAgICAgIG1jX2Ry YXcgKHcsIHgsIHksIGhwb3MsIHZwb3MsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJlZCwg Z3JlZW4sIGJsdWUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBpZiAoIXJl bW92ZQorICAgICAgJiYgdyA9PSBzdworICAgICAgJiYgdy0+bWMuc3RhcnQKKyAgICAgICYmIHct Pm1jLmVuZAorICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIG1jX2xpc3QpKSkKKyAgICB7CisjaWZk ZWYgR0xZUEhfREVCVUcKKyAgZGVidWdfbWV0aG9kX2FkZCAodywgIm1jX2NhbGM6ICBkcmF3IGN1 cnNvcnMgYW5ldyIpOworI2VuZGlmCisgICAgICBmb3IgKHZsaXN0ID0gQlZBUiAoYiwgbWNfbGlz dCk7CisgICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgICAgIHZsaXN0ID0gWENEUiAo dmxpc3QpKQorICAgICAgICB7CisgICAgICAgICAg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SBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMSkpOworICAgICAg ICAgIGJsdWUgPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMikpOwor ICAgICAgICAgIHhfeV9ocG9zX3Zwb3MgPSBGbnRoIChtYWtlX251bWJlciAoMCksIG1jX3hfeV9o cG9zX3Zwb3MgKHcsIHBvc2ludCwgdy0+bWMuc3RhcnQsIHctPm1jLmVuZCkpOworICAgICAgICAg IHRlbXAgPSBGY29ucyAoY3Vyc29yX3NwZWNfbGlzdCwgRmNvbnMgKHhfeV9ocG9zX3Zwb3MsIFFu aWwpKTsKKyAgICAgICAgICByZXN1bHQgPSBGY29ucyAodGVtcCwgcmVzdWx0KTsKKyAgICAgICAg ICB4ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192cG9zKSk7CisgICAg ICAgICAgeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3NfdnBvcykpOwor ICAgICAgICAgIGhwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMiksIHhfeV9ocG9zX3Zw b3MpKTsKKyAgICAgICAgICB2cG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDMpLCB4X3lf aHBvc192cG9zKSk7CisgICAgICAgICAgaWYgKHctPm1jLnN0YXJ0CisgICAgICAgICAgICAgICYm IHctPm1jLmVuZAorICAgICAgICAgICAgICAmJiBwb3NpbnQgPj0gdy0+bWMuc3RhcnQKKyAgICAg ICAgICAgICAgJiYgcG9zaW50IDw9IHctPm1jLmVuZCkKKyAgICAgICAgICAgIG1jX2RyYXcgKHcs IHgsIHksIGhwb3MsIHZwb3MsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJlZCwgZ3JlZW4s IGJsdWUpOworICAgICAgICB9CisvKiBgdy0+bWNfY2FjaGUnIGlzIHNldC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zdCkpIHx8IHctPm1j X2NhY2hlKQorICAgICAgJiYgIU1JTklfV0lORE9XX1AgKHcpKQorICAgIHsKKyAgICAgIExpc3Bf T2JqZWN0IHhfeV9ocG9zX3Zwb3M7CisgICAgICBFTUFDU19JTlQgc3RhcnQgPSBDSEFSUE9TIChz dGFydHApOworICAgICAgRU1BQ1NfSU5UIGVuZCA9IEJVRl9aIChidWZmZXIpIC0gdy0+d2luZG93 X2VuZF9wb3M7CisgICAgICBpZiAody0+bWMuZHJhd19lcmFzZSkKKyAgICAgICAgeworICAgICAg ICAgIGlmICh3LT5tYy5zdGFydCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgdy0+bWMu cHJldl9zdGFydCA9IHctPm1jLnN0YXJ0OworICAgICAgICAgICAgICB4X3lfaHBvc192cG9zID0g Rm50aCAobWFrZV9udW1iZXIgKDApLCBtY194X3lfaHBvc192cG9zICh3LCB3LT5tYy5wcmV2X3N0 YXJ0LCBzdGFydCwgZW5kKSk7CisgICAgICAgICAgICAgIHctPm1jLnByZXZfc3RhcnRfeCA9IFhJ TlQgKEZudGggKG1ha2VfbnVtYmVyICgwKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAg ICB3LT5tYy5wcmV2X3N0YXJ0X3kgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMSksIHhfeV9o cG9zX3Zwb3MpKTsKKyAgICAgICAgICAgICAgdy0+bWMucHJldl9zdGFydF9ocG9zID0gWElOVCAo Rm50aCAobWFrZV9udW1iZXIgKDIpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAgICAgIHct Pm1jLnByZXZfc3RhcnRfdnBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgzKSwgeF95X2hw b3NfdnBvcykpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgdy0+bWMucHJldl9zdGFydCA9IC0xOworICAgICAgICAgICAg ICAgIHctPm1jLnByZXZfc3RhcnRfeCA9IC0xOworICAgICAgICAgICAgICAgIHctPm1jLnByZXZf c3RhcnRfeSA9IC0xOworICAgICAgICAgICAgICAgIHctPm1jLnByZXZfc3RhcnRfaHBvcyA9IC0x OworICAgICAgICAgICAgICAgIHctPm1jLnByZXZfc3RhcnRfdnBvcyA9IC0xOworICAgICAgICAg ICAgICB9CisgICAgICAgICAgaWYgKHctPm1jLmVuZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgdy0+bWMucHJldl9lbmQgPSB3LT5tYy5lbmQ7CisgICAgICAgICAgICAgIC8qIGVvYiBJ UyB2aXNpYmxlLgorICAgICAgICAgICAgICBFeGNsdWRlcyBhIHNpdHVhdGlvbiB3aGVuIGxhc3Qg dmlzaWJsZSBsaW5lIGF0IGJvdHRvbSBvZiB3aW5kb3cgY29udGFpbnMgZW9iLiAgKi8KKyAgICAg ICAgICAgICAgaWYgKHctPm1jLnByZXZfZW5kID09IGVuZCkKKyAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICB4X3lfaHBvc192cG9zID0gRm50aCAobWFrZV9udW1iZXIgKDApLCBt Y194X3lfaHBvc192cG9zICh3LCB3LT5tYy5wcmV2X2VuZCwgc3RhcnQsIGVuZCkpOworICAgICAg ICAgICAgICAgICAgdy0+bWMucHJldl9lbmRfeCA9IHctPm1jLmVuZF94OworICAgICAgICAgICAg ICAgICAgdy0+bWMucHJldl9lbmRfeSA9IHctPm1jLmVuZF95OworICAgICAgICAgICAgICAgICAg dy0+bWMucHJldl9lbmRfaHBvcyA9IHctPm1jLmVuZF9ocG9zOworICAgICAgICAgICAgICAgICAg dy0+bWMucHJldl9lbmRfdnBvcyA9IHctPm1jLmVuZF92cG9zOworICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgICAvKiBlb2IgaXMgTk9UIHZpc2libGUuCisgICAgICAgICAgICAgICAg RXhjbHVkZXMgYSBzaXR1YXRpb24gd2hlbiBsYXN0IHZpc2libGUgbGluZSBhdCBib3R0b20gb2Yg d2luZG93IGNvbnRhaW5zIGVvYi4gICoqLworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeF95X2hwb3NfdnBvcyA9IEZudGggKG1h a2VfbnVtYmVyICgwKSwgbWNfeF95X2hwb3NfdnBvcyAodywgdy0+bWMucHJldl9lbmQsIHN0YXJ0 LCBlbmQpKTsKKyAgICAgICAgICAgICAgICAgICAgdy0+bWMucHJldl9lbmRfeCA9IFhJTlQgKEZu dGggKG1ha2VfbnVtYmVyICgwKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAgICAgICAg ICB3LT5tYy5wcmV2X2VuZF95ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBv c192cG9zKSk7CisgICAgICAgICAgICAgICAgICAgIHctPm1jLnByZXZfZW5kX2hwb3MgPSBYSU5U IChGbnRoIChtYWtlX251bWJlciAoMiksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICAgICAg ICAgICAgdy0+bWMucHJldl9lbmRfdnBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgzKSwg eF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdy0+bWMucHJl dl9lbmQgPSAtMTsKKyAgICAgICAgICAgICAgICB3LT5tYy5wcmV2X2VuZF94ID0gLTE7CisgICAg ICAgICAgICAgICAgdy0+bWMucHJldl9lbmRfeSA9IC0xOworICAgICAgICAgICAgICAgIHctPm1j LnByZXZfZW5kX2hwb3MgPSAtMTsKKyAgICAgICAgICAgICAgICB3LT5tYy5wcmV2X2VuZF92cG9z ID0gLTE7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICBpZiAody0+bWMub3BvaW50KQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICB3LT5tYy5wcmV2X29wb2ludCA9IHctPm1jLm9wb2lu dDsKKyAgICAgICAgICAgICAgdy0+bWMucHJldl9vcG9pbnRfeCA9IHctPm1jLm9wb2ludF94Owor ICAgICAgICAgICAgICB3LT5tYy5wcmV2X29wb2ludF95ID0gdy0+bWMub3BvaW50X3k7CisgICAg ICAgICAgICAgIHctPm1jLnByZXZfb3BvaW50X2hwb3MgPSB3LT5tYy5vcG9pbnRfaHBvczsKKyAg ICAgICAgICAgICAgdy0+bWMucHJldl9vcG9pbnRfdnBvcyA9IHctPm1jLm9wb2ludF92cG9zOwor ICAgICAgICAgICAgfQorCisgICAgICAgICAgdy0+bWMub3BvaW50ID0gUFQ7CisgICAgICAgICAg eF95X2hwb3NfdnBvcyA9IEZudGggKG1ha2VfbnVtYmVyICgwKSwgbWNfeF95X2hwb3NfdnBvcyAo dywgdy0+bWMub3BvaW50LCBzdGFydCwgZW5kKSk7CisgICAgICAgICAgdy0+bWMub3BvaW50X3gg PSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAg ICB3LT5tYy5vcG9pbnRfeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3Nf dnBvcykpOworICAgICAgICAgIHctPm1jLm9wb2ludF9ocG9zID0gWElOVCAoRm50aCAobWFrZV9u dW1iZXIgKDIpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAgdy0+bWMub3BvaW50X3Zwb3Mg PSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMyksIHhfeV9ocG9zX3Zwb3MpKTsKKworICAgICAg ICAgIHctPm1jLnN0YXJ0ID0gc3RhcnQ7CisgICAgICAgICAgeF95X2hwb3NfdnBvcyA9IEZudGgg KG1ha2VfbnVtYmVyICgwKSwgbWNfeF95X2hwb3NfdnBvcyAodywgc3RhcnQsIHN0YXJ0LCBlbmQp KTsKKyAgICAgICAgICB3LT5tYy5zdGFydF94ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDAp LCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAgdy0+bWMuc3RhcnRfeSA9IFhJTlQgKEZudGgg KG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgIHctPm1jLnN0YXJ0 X2hwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMiksIHhfeV9ocG9zX3Zwb3MpKTsKKyAg ICAgICAgICB3LT5tYy5zdGFydF92cG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDMpLCB4 X3lfaHBvc192cG9zKSk7CisKKyAgICAgICAgICB3LT5tYy5lbmQgPSBlbmQ7CisgICAgICAgICAg eF95X2hwb3NfdnBvcyA9IEZudGggKG1ha2VfbnVtYmVyICgwKSwgbWNfeF95X2hwb3NfdnBvcyAo dywgZW5kLCBzdGFydCwgZW5kKSk7CisgICAgICAgICAgdy0+bWMuZW5kX3ggPSBYSU5UIChGbnRo IChtYWtlX251bWJlciAoMCksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICB3LT5tYy5lbmRf eSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3NfdnBvcykpOworICAgICAg ICAgIHctPm1jLmVuZF9ocG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDIpLCB4X3lfaHBv c192cG9zKSk7CisgICAgICAgICAgdy0+bWMuZW5kX3Zwb3MgPSBYSU5UIChGbnRoIChtYWtlX251 bWJlciAoMyksIHhfeV9ocG9zX3Zwb3MpKTsKKworICAgICAgICAgIC8qIFN0YXJ0IHJlbWFpbnMg dGhlIHNhbWUuICAqLworICAgICAgICAgIGlmICh3LT5tYy5wcmV2X3N0YXJ0X3Zwb3MgPT0gdy0+ bWMuc3RhcnRfdnBvcworICAgICAgICAgICAgICB8fCB3LT5tYy5wcmV2X2VuZCA8IHctPm1jLnN0 YXJ0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICB3LT5tYy55X2RpZmYgPSAwOworICAg ICAgICAgICAgICB3LT5tYy52cG9zX2RpZmYgPSAwOworICAgICAgICAgICAgfQorICAgICAgICAg ICAgLyogU2NyZWVuIG1vdmVkIOKWvCAtLSBlLmcuLCBgcHJldmlvdXMtbGluZScsIGBzY3JvbGwt ZG93bicuICAqLworICAgICAgICAgICAgZWxzZSBpZiAody0+bWMucHJldl9zdGFydF92cG9zID4g MCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHctPm1jLnlfZGlmZiA9ICh3LT5t Yy5wcmV2X3N0YXJ0X3kgLSB3LT5tYy5zdGFydF95KSAqIC0xOworICAgICAgICAgICAgICAgIHct Pm1jLnZwb3NfZGlmZiA9ICh3LT5tYy5wcmV2X3N0YXJ0X3Zwb3MgLSB3LT5tYy5zdGFydF92cG9z KSAqIC0xOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIC8qIFNjcmVlbiBtb3ZlZCDi lrIgKGVvYiBOT1QgdmlzaWJsZSkgLS0gZS5nLiwgYG5leHQtbGluZScsIGBzY3JvbGwtdXAnLiAg Ki8KKyAgICAgICAgICAgICAgZWxzZSBpZiAody0+bWMuZW5kX3Zwb3MgPiB3LT5tYy5wcmV2X2Vu ZF92cG9zICYmIHctPm1jLnByZXZfZW5kICE9IC0xKQorICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgIHctPm1jLnlfZGlmZiA9IHctPm1jLmVuZF95IC0gdy0+bWMucHJldl9lbmRf eTsKKyAgICAgICAgICAgICAgICAgIHctPm1jLnZwb3NfZGlmZiA9IHctPm1jLmVuZF92cG9zIC0g dy0+bWMucHJldl9lbmRfdnBvczsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAg LyogU2NyZWVuIG1vdmVkIOKWsiAoZW9iIElTIHZpc2libGUpIC0tIGUuZy4sIGBuZXh0LWxpbmUn LCBgc2Nyb2xsLXVwJy4gICovCisgICAgICAgICAgICAgICAgZWxzZSBpZiAody0+bWMuZW5kX3Zw b3MgPCB3LT5tYy5wcmV2X2VuZF92cG9zICYmIHctPm1jLnByZXZfZW5kICE9IC0xKQorICAgICAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB3LT5tYy55X2RpZmYgPSB3LT5tYy5w cmV2X2VuZF95IC0gdy0+bWMuZW5kX3k7CisgICAgICAgICAgICAgICAgICAgIHctPm1jLnZwb3Nf ZGlmZiA9IHctPm1jLnByZXZfZW5kX3Zwb3MgLSB3LT5tYy5lbmRfdnBvczsKKyAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIC8qIFNjcmVlbiBtb3ZlZCDilrIgKGVvYiBqdXN0 IGJlY2FtZSB2aXNpYmxlKSAtLSBlLmcuLCBgbmV4dC1saW5lJywgYHNjcm9sbC11cCcuCisgICAg ICAgICAgICAgICAgICBBYnNlbnQgc3VidHJhY3RpbmcgMSBmcm9tIHctPm1jLnByZXZfZW5kLCB0 aGF0IHBvaW50IGFuZCB0aGUgbmV3IHctPm1jLmVuZCBhcmUKKyAgICAgICAgICAgICAgICAgIG9u IHRoZSBzYW1lIGxpbmUgYW5kIGl0IGFwcGVhcnMgdGhhdCBub3RoaW5nIGhhcyBjaGFuZ2VkIC0t IHctPm1jLnByZXZfZW5kIGlzCisgICAgICAgICAgICAgICAgICBvbiB0aGUgZmFyIGxlZnQgb2Yg dGhlIGxpbmUgYW5kIHctPm1jLmVuZCBpcyBvbiB0aGUgZmFyIHJpZ2h0IG9mIHRoZSBsaW5lLiAg Ki8KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHctPm1jLmVuZF92cG9zID09IHctPm1jLnBy ZXZfZW5kX3Zwb3MpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAg ICB4X3lfaHBvc192cG9zID0gRm50aCAobWFrZV9udW1iZXIgKDApLCBtY194X3lfaHBvc192cG9z ICh3LCB3LT5tYy5wcmV2X2VuZCAtIDEsIHN0YXJ0LCBlbmQpKTsKKyAgICAgICAgICAgICAgICAg ICAgICB3LT5tYy5wcmV2X2VuZF94ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lf aHBvc192cG9zKSk7CisgICAgICAgICAgICAgICAgICAgICAgdy0+bWMucHJldl9lbmRfeSA9IFhJ TlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAg ICAgICAgICAgIHctPm1jLnByZXZfZW5kX2hwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAo MiksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICAgICAgICAgICAgICB3LT5tYy5wcmV2X2Vu ZF92cG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDMpLCB4X3lfaHBvc192cG9zKSk7Cisg ICAgICAgICAgICAgICAgICAgICAgdy0+bWMueV9kaWZmID0gdy0+bWMuZW5kX3kgLSB3LT5tYy5w cmV2X2VuZF95OworICAgICAgICAgICAgICAgICAgICAgIHctPm1jLnZwb3NfZGlmZiA9IHctPm1j LmVuZF92cG9zIC0gdy0+bWMucHJldl9lbmRfdnBvczsKKyAgICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICAgIC8qIGBtYy1saXN0YCBoYXMganVzdCBiZWVuIGluaXRpYWxpemVkIC0t IHByZXZpb3VzIHN0YXJ0L2VuZCBhcmUgc2V0IHRvIC0xLiAgKi8KKyAgICAgICAgICAgICAgICAg ICAgZWxzZSBpZiAody0+bWMucHJldl9lbmQgPT0gLTEpCisgICAgICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICAgICAgdy0+bWMueV9kaWZmID0gMDsKKyAgICAgICAgICAg ICAgICAgICAgICAgIHctPm1jLnZwb3NfZGlmZiA9IDA7CisgICAgICAgICAgICAgICAgICAgICAg fQorCisgICAgICAgICAgaWYgKHctPm1jLnlfZGlmZiA8IDApCisgICAgICAgICAgICB3LT5tYy55 X2RpZmYgPSBhYnMgKHctPm1jLnlfZGlmZik7CisgICAgICAgICAgICBlbHNlIGlmICh3LT5tYy55 X2RpZmYgPiAwKQorICAgICAgICAgICAgICB3LT5tYy55X2RpZmYgPSB3LT5tYy55X2RpZmYgKiAt MTsKKyAgICAgICAgICBpZiAody0+bWMudnBvc19kaWZmIDwgMCkKKyAgICAgICAgICAgIHctPm1j LnZwb3NfZGlmZiA9IGFicyAody0+bWMudnBvc19kaWZmKTsKKyAgICAgICAgICAgIGVsc2UgaWYg KHctPm1jLnZwb3NfZGlmZiA+IDApCisgICAgICAgICAgICB3LT5tYy52cG9zX2RpZmYgPSB3LT5t Yy52cG9zX2RpZmYgKiAtMTsKKworLyogI2lmZGVmIEdMWVBIX0RFQlVHCisgIGRlYnVnX21ldGhv ZF9hZGQgKHcsICJkaWZmOiAoJWQgJWQpIHwgcHJldl9zdGFydDogJWQgKCVkICVkICVkICVkKSB8 IHN0YXJ0OiAlZCAoJWQgJWQgJWQgJWQpIHwgcHJldl9lbmQ6ICVkICglZCAlZCAlZCAlZCkgfCBl bmQ6ICVkICglZCAlZCAlZCAlZCkiLAorICAgIHctPm1jLnlfZGlmZiwgdy0+bWMudnBvc19kaWZm LAorICAgIHctPm1jLnByZXZfc3RhcnQsIHctPm1jLnByZXZfc3RhcnRfeCwgdy0+bWMucHJldl9z dGFydF95LCB3LT5tYy5wcmV2X3N0YXJ0X2hwb3MsIHctPm1jLnByZXZfc3RhcnRfdnBvcywKKyAg ICB3LT5tYy5zdGFydCwgdy0+bWMuc3RhcnRfeCwgdy0+bWMuc3RhcnRfeSwgdy0+bWMuc3RhcnRf aHBvcywgdy0+bWMuc3RhcnRfdnBvcywKKyAgICB3LT5tYy5wcmV2X2VuZCwgdy0+bWMucHJldl9l bmRfeCwgdy0+bWMucHJldl9lbmRfeSwgdy0+bWMucHJldl9lbmRfaHBvcywgdy0+bWMucHJldl9l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A+PSAwKQorICAgICAgICAvKiBUZW1wb3JhcmlseSBo aWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAg ICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHhmbnMuYy4gICovCisgICAgICAg IHsKKyAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICBMaXNwX09iamVjdCB3aW5k b3cgPSAoc2VsZWN0ZWRfd2luZG93KTsKKyAgICAgICAgICBzdHJ1Y3Qgd2luZG93ICp3ID0gZGVj b2RlX2xpdmVfd2luZG93ICh3aW5kb3cpOworICAgICAgICAgIHN0cnVjdCBmcmFtZSAqZiA9IFhG UkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICAgICAgICAgc3RydWN0IHhfZGlzcGxheV9pbmZv ICpkcHlpbmZvID0gRlJBTUVfRElTUExBWV9JTkZPIChmKTsKKyAgICAgICAgICBpbnQgaW50X3Jl ZCA9IHJlZCAqIDY1NTM1OworICAgICAgICAgIGludCBpbnRfZ3JlZW4gPSBncmVlbiAqIDY1NTM1 OworICAgICAgICAgIGludCBpbnRfYmx1ZSA9IGJsdWUgKiA2NTUzNTsKKyAgICAgICAgICBYR0NW YWx1ZXMgZ2NfdmFsdWVzOworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgbWFzayA9IEdDRm9yZWdy b3VuZCB8IEdDQmFja2dyb3VuZCB8IEdDRmlsbFN0eWxlIHwgR0NMaW5lV2lkdGg7CisgICAgICAg ICAgdW5zaWduZWQgbG9uZyBvcmlnX3ZhbF9hID0gRlJBTUVfQkFDS0dST1VORF9QSVhFTCAoZik7 CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBvcmlnX3ZhbF9iID0gZi0+b3V0cHV0X2RhdGEueC0+ Y3Vyc29yX3BpeGVsOworICAgICAgICAgIGdjX3ZhbHVlcy5saW5lX3dpZHRoID0gMDsgIC8qIE1l YW5zID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WxsX3N0eWxlID0gRmlsbE9wYXF1ZVN0 aXBwbGVkOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYworICAgICAgICAg ICAgPSBYQ3JlYXRlR0MgKEZSQU1FX1hfRElTUExBWSAoZiksIEZSQU1FX1hfV0lORE9XIChmKSwg bWFzaywgJmdjX3ZhbHVlcyk7CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAg fQorICAgICAgICBlbHNlCisgICAgICAgICAgZHJhd19waHlzX2N1cnNvcl9nbHlwaCAodywgZ2x5 cGhfcm93LCBEUkFXX0NVUlNPUik7CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBCQVJf Q1VSU09SOgorICAgIHsKKyAgICAgIGlmIChyZWQgPj0gMCAmJiBibHVlID49IDAgJiYgZ3JlZW4g Pj0gMCkKKyAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5j dXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBmcmFtZSAqZiA9 IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICAgICAgICAgc3RydWN0IHhfZGlzcGxheV9p bmZvICpkcHlpbmZvID0gRlJBTUVfRElTUExBWV9JTkZPIChmKTsKKyAgICAgICAgICB1bnNpZ25l ZCBsb25nIG9yaWdfdmFsID0gZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsOworICAgICAg ICAgIGludCBpbnRfcmVkID0gcmVkICogNjU1MzU7CisgICAgICAgICAgaW50IGludF9ncmVlbiA9 IGdyZWVuICogNjU1MzU7CisgICAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDY1NTM1Owor ICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IHhfbWFrZV90cnVlY29s b3JfcGl4ZWwgKGRweWluZm8sIGludF9yZWQs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