From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Noah Lavine Newsgroups: gmane.lisp.guile.devel Subject: Introducing Jitgen Date: Sun, 28 Nov 2010 14:52:49 -0500 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=0016363ba544d855090496224c64 X-Trace: dough.gmane.org 1290974005 17641 80.91.229.12 (28 Nov 2010 19:53:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 28 Nov 2010 19:53:25 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Nov 28 20:53:21 2010 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PMnJ1-0005kd-53 for guile-devel@m.gmane.org; Sun, 28 Nov 2010 20:53:20 +0100 Original-Received: from localhost ([127.0.0.1]:37427 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PMnJ0-0004j5-IK for guile-devel@m.gmane.org; Sun, 28 Nov 2010 14:53:02 -0500 Original-Received: from [140.186.70.92] (port=49212 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PMnIr-0004hq-2J for guile-devel@gnu.org; Sun, 28 Nov 2010 14:52:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PMnIp-0002wE-NB for guile-devel@gnu.org; Sun, 28 Nov 2010 14:52:52 -0500 Original-Received: from mail-wy0-f169.google.com ([74.125.82.169]:41097) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PMnIo-0002w7-UG for guile-devel@gnu.org; Sun, 28 Nov 2010 14:52:51 -0500 Original-Received: by wyb42 with SMTP id 42so11747818wyb.0 for ; Sun, 28 Nov 2010 11:52:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=gMjD5RATgxUUFDaYnKa2RPRx8A+bHmJ+aZVcunzv7OI=; b=Lbz8jEibh3u2x+C24AN8OfKdfwVDyBL6/717mPf8zLbmU0pH2AN40er+aeeQZ46+GR Y+H7YFopg+W0h00jDjL0760DX8XSKnzb/AEXkMqo+0t2w86elf3JAh4YQu5whMKUkr0V SL48r5uXl13sF20U1PTwLzVSVvQRREmET5/3M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=dMAuQda61yAhr1Y1fFVhTrwD8PKaD1+EYusjdW6LYU0wA1BXqKBOlgsWtGnR/AtUbu TyE0jvHh6I4OVP7+bwwLi3OZDpxgNmXEd7Hppw2iEW7xxT8mE0XjYCal072XePUq8mda rTg5jjTPBbh+IOgMQec5W5aqVNkti51TGFNoo= Original-Received: by 10.216.166.66 with SMTP id f44mr2354650wel.37.1290973969142; Sun, 28 Nov 2010 11:52:49 -0800 (PST) Original-Received: by 10.216.237.34 with HTTP; Sun, 28 Nov 2010 11:52:49 -0800 (PST) X-Google-Sender-Auth: _4NKpVp5JLIOaO5Gpazl2R3HAlM X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:11211 Archived-At: --0016363ba544d855090496224c64 Content-Type: text/plain; charset=ISO-8859-1 Hello all, Attached is the first version of Jitgen, a system for writing virtual machines and matching JIT compilers without so much duplicated code. It's pretty rough, but I wanted to see what you thought of this version and ask for comments. The problem it's trying to solve is that if I made a JIT compiler the normal way, I would have to basically write the virtual machine over again. This is because each VM opcode would have a compiler method which would implement exactly the same algorithm as the already-existing C implementation, but with slightly different function calls. For example, here's the C implementation of scm_op_assert_nargs_ee_locals (with a few macros expanded): { scm_t_ptrdiff n; SCM *old_sp; /* nargs = n & 0x7, nlocs = nargs + (n >> 3) */ n = (*ip++); if (sp - (fp - 1) != (n & 0x7)) goto vm_error_wrong_num_args; old_sp = sp; sp += (n >> 3); while (old_sp < sp) *++old_sp = SCM_UNDEFINED; NEXT; } And here's the JIT implementation: { jit_value_t tmp1, tmp2, tmp3, val_scm_undefined; jit_label_t good_path = jit_label_undefined; int n_val, count; objcodep++; ip = jit_insn_add (function, ip, ipup); n_val = *objcodep; tmp1 = jit_insn_sub (function, fp, spup); tmp2 = jit_insn_sub (function, sp, tmp1); tmp3 = jit_insn_eq (function, tmp2, jit_value_create_nint_constant (function, jit_type_void_ptr, n_val&0x7)); jit_insn_branch_if (function, tmp3, &good_path); /** goto vm_error_wrong_num_args **/ /* restore the ip, sp and fp pointers, and return. */ jit_insn_store_relative (function, ipp, 0, ip); jit_insn_store_relative (function, spp, 0, sp); jit_insn_store_relative (function, fpp, 0, fp); jit_insn_return (function, jit_value_create_nint_constant (function, jit_type_int, jit_return_wrong_num_args)); jit_insn_label (function, &good_path); val_scm_undefined = jit_value_create_nint_constant (function, jit_type_void_ptr, (jit_nint)SCM_UNDEFINED); for (count = 0; count < (n_val >> 3); count++) { sp = jit_insn_add (function, sp, spup); jit_insn_store_relative (function, sp, 0, val_scm_undefined); } break; } The goal of Jitgen is to generate both of these from the following instructions: '((ip <- ip + ipup) (tmp1 <- fp - spup) (tmp2 <- sp - tmp1) (tmp3 <- tmp2 == (n_val & 0x7)) (branch-if tmp3 good_path) (store-relative ipp 0 ip) (store-relative spp 0 sp) (store-relative fpp 0 fp) (return jit_return_wrong_num_args) (label good_path) (sp <- sp + spup) (store-relative sp 0 SCM_UNDEFINED) ) (Actually these instructions will only generate part of that, but I did say it was rough. :-) ) The attached file jitgen.scm has two functions, instructions->c and instructions->libjit, which implement this. The rest of that file is supporting functions for those two. The file test.scm has a few tests for these, but they're pretty primitive. There's also a file called expand.scm, which is my idea for eventually using these. It's a Guile script that takes a file and copies it to an output file, except that in between occurrences of `%%` it expects to find Scheme code, and it evaluates the code and pastes the output into its output file. I'm thinking that we could use this to generate vm-i-system.c and vm-jit.c from templates, using a common set of definitions for the VM operations. (As a side note, something similar is already done for foreign.c and gsubr.c, but with Elisp to generate the code.) My biggest question is, is this something that you would be interested in having in Guile? If so, then also what do you think of the code style and interfaces, and do you have any other feedback? Thanks, Noah --0016363ba544d855090496224c64 Content-Type: application/octet-stream; name="jitgen.scm" Content-Disposition: attachment; filename="jitgen.scm" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gh2c4d7w0 IyEvdXNyL2Jpbi9ndWlsZQohIwoKKGRlZmluZS1tb2R1bGUgKGppdGdlbikKICAjOmV4cG9ydCAo aW5zdHJ1Y3Rpb25zLT5jIGluc3RydWN0aW9ucy0+bGliaml0KSkKCih1c2UtbW9kdWxlcyAoaWNl LTkgbWF0Y2gpCiAgICAgICAgICAgICAoc3JmaSBzcmZpLTEpCiAgICAgICAgICAgICAoc3JmaSBz cmZpLTIpKQoKOyB0aGlzIG5leHQgYml0IGlzIHN1cHBvc2VkIHRvIGJlIGluIChybnJzIGJhc2Up LCBidXQgaXQncyBub3QuCihkZWZpbmUgKGFzc2VydCBjb25kKQogIChpZiAobm90IGNvbmQpCiAg ICAgIChlcnJvciAiQXNzZXJ0aW9uIGZhaWxlZC4iKSkpCgo7IGppdGdlbiBpcyBhIHN5c3RlbSB0 aGF0IGNhbiB0YWtlIGEgZGVzY3JpcHRpb24gb2YgYW4gYWxnb3JpdGhtIGFzIGEKOyBzZXJpZXMg b2YgaW5zdHJ1Y3Rpb25zIGZvciBhIHJlZ2lzdGVyIG1hY2hpbmUgYW5kIGRvIGFueSBvZ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gICAgICAgICAgPT4gKGxhbWJkYSAobmV3LWVudHJ5KSAoY29ucyBuZXctZW50cnkgbmV3LWVu dikpKQogICAgICAgICAgIChlbHNlIG5ldy1lbnYpKSkKICAgJygpCiAgIGluc25zKSkKCihkZWZp bmUgKG5ldy1uYW1lLWFuZC10eXBlIGluc24gZW52LWEgZW52LWIpCiAgKGFuZC1sZXQqICgobmFt ZS1hbmQtdHlwZSAodGFyZ2V0LW5hbWUtYW5kLXR5cGUgaW5zbiBlbnYtYSBlbnYtYikpCiAgICAg ICAgICAgICAoKG5vdCAobG9va3VwLWluLWVpdGhlciAoY2FyIG5hbWUtYW5kLXR5cGUpIGVudi1h IGVudi1iKSkpKQogICAgbmFtZS1hbmQtdHlwZSkpCgooZGVmaW5lIChsb29rdXAtaW4tZWl0aGVy IG5hbWUgZW52LWEgZW52LWIpCiAgKG9yIChhc3NxIG5hbWUgZW52LWEpIChhc3NxIG5hbWUgZW52 LWIpKSkKCihkZWZpbmUgKHRhcmdldC1uYW1lLWFuZC10eXBlIGluc24gZW52LWEgZW52LWIpCiAg KG1hdGNoIGluc24KICAgICAoKHRhcmdldCAnPC0gLiByZXN0KSAoY29uZCAoKGV4cHJlc3Npb24t dHlwZSByZXN0IGVudi1hIGVudi1iKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9 PiAobGFtYmRhICh0KSAoY29ucyB0YXJnZXQgdCkpKQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIChlbHNlICNmKSkpCiAgICAgKF8gI2YpKSkKCjsgcmV0dXJuIHRoZSB0eXBlIG9mIHRo ZSBleHByZXNzaW9uLCB3aGVyZSBlbnYtYSBhbmQgZW52LWIgY29udGFpbgo7IGFjdGl2ZSB2YXJp YWJsZXMsIG9yICNmIGlmIHRoZSBleHByZXNzaW9uIGhhcyBubyB0eXBlLgooZGVmaW5lIChleHBy ZXNzaW9uLXR5cGUgZXhwciBlbnYtYSBlbnYtYikKICAobWF0Y2ggZXhwcgogICAgICgoYSAob3Ig JysgJy0gJyogJy8gJyYpIGIpIChhcml0aG1ldGljLXR5cGUgYSBiIGVudi1hIGVudi1iKSkKICAg ICAoKGEgJz09IGIpICdpbnQpIDsgcmlnaHQ/CiAgICAgKF8gI2YpKSkKCjsgYSBsaXN0IG9mIGJh c2ljIEMgdHlwZXMuIFR5cGVzIGVhcmxpZXIgaW4gdGhlIGxpc3QgZGVnZW5lcmF0ZSBpbnRvCjsg dHlwZXMgbGF0ZXIgaW4gdGhlIGxpc3QuCihkZWZpbmUgbnVtZXJpY2FsLXR5cGVzLXRvd2VyCiAg JyhpbnQgZmxvYXQgZG91YmxlKSkKCihkZWZpbmUgKHR5cGUtZnJvbS1laXRoZXIgc3ltIGVudi1h IGVudi1iKQogIChhbmQtbGV0KiAoKGVudHJ5IChsb29rdXAtaW4tZWl0aGVyIHN5bSBlbnYtYSBl bnYtYikpKQogICAgKGNkciBlbnRyeSkpKQoKKGRlZmluZSAoYXJpdGhtZXRpYy10eXBlIGEgYiBl bnYtYSBlbnYtYikKICAoYW5kLWxldCogKChhLXR5cGUgKGlmIChzeW1ib2w/IGEpCiAgICAgICAg ICAgICAgICAgICAgICAgICAodHlwZS1mcm9tLWVpdGhlciBhIGVudi1hIGVudi1iKQogICAgICAg ICAgICAgICAgICAgICAgICAgKGV4cHJlc3Npb24tdHlwZSBhIGVudi1hIGVudi1iKSkpCiAgICAg ICAgICAgICAoYi10eXBlIChpZiAoc3ltYm9sPyBiKQogICAgICAgICAgICAgICAgICAgICAgICAg KHR5cGUtZnJvbS1laXRoZXIgYiBlbnYtYSBlbnYtYikKICAgICAgICAgICAgICAgICAgICAgICAg IChleHByZXNzaW9uLXR5cGUgYiBlbnYtYSBlbnYtYikpKSkKICAgIChsZXQgaXRlciAoKHR5cCBu dW1lcmljYWwtdHlwZXMtdG93ZXIpKQogICAgICAoY29uZCAoKG51bGw/IHR5cCkgI2YpCiAgICAg ICAgICAgICgoZXE/IChjYXIgdHlwKSBhLXR5cGUpIGItd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cmVmaXggaW5kZW50KQogICAgICAgICAgICAg ICAgICAgIChleHByZXNzaW9uLT5jIGIgbGluZS1wcmVmaXggaW5kZW50KSkpCiAgICAoKGEgJy0g YikKICAgICAoc2ltcGxlLWZvcm1hdCAjZiAiKH5BIC0gfkEpIgogICAgICAgICAgICAgICAgICAg IChleHByZXNzaW9uLT5jIGEgbGluZS1wcmVmaXggaW5kZW50KQogICAgICAgICAgICAgICAgICAg IChleHByZXNzaW9uLT5jIGIgbGluZS1wcmVmaXggaW5kZW50KSkpCiAgICAoKGEgJyogYikKICAg ICAoc2ltcGxlLWZvcm1hdCAjZiAiKH5BICogfkEpIgogICAgICAgICAgICAgICAgICAgIChleHBy ZXNzaW9uLT5jIGEgbGluZS1wcmVmaXggaW5kZW50KQogICAgICAgICAgICAgICAgICAgIChleHBy ZXNzaW9uLT5jIGIgbGluZS1wcmVmaXggaW5kZW50KSkpCiAgICAoKGEgJy8gYikKICAgICAoc2lt cGxlLWZvcm1hdCAjZiAiKH5BIC8gfkEpIgogICAgICAgICAgICAgICAgICAgIChleHByZXNzaW9u LT5jIGEgbGluZS1wcmVmaXggaW5kZW50KQogICAgICAgICAgICAgICAgICAgIChleHByZXNzaW9u LT5jIGIgbGluZS1wcmVmaXggaW5kZW50KSkpCiAgICAoKGEgJyYgYikKICAgICAoc2ltcGxlLWZv cm1hdCAjZiAiKH5BICYgfkEpIgogICAgICAgICAgICAgICAgICAgIChleHByZXNzaW9uLT5jIGEg bGluZS1wcmVmaXggaW5kZW50KQogICAgICAgICAgICAgICAgICAgIChleHByZXNzaW9uLT5jIGIg bGluZS1wcmVmaXggaW5kZW50KSkpCiAgICAoKGEgJz09IGIpCiAgICAgKHNpbXBsZS1mb3JtYXQg I2YgIih+QSA9PSB+QSkiCiAgICAgICAgICAgICAgICAgICAgKGV4cHJlc3Npb24tPmMgYSBsaW5l LXByZWZpeCBpbmRlbnQpCiAgICAgICAgICAgICAgICAgICAgKGV4cHJlc3Npb24tPmMgYiBsaW5l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IpCiAgICAgKHNpbXBsZS1mb3JtYXQgI2YgImppdF9pbnNuX2FkZCAoZnVuY3Rpb24sIH5B LCB+QSkiCiAgICAgICAgICAgICAgICAgICAgKGV4cHJlc3Npb24tPmMgYSBsaW5lLXByZWZpeCBp bmRlbnQpCiAgICAgICAgICAgICAgICAgICAgKGV4cHJlc3Npb24tPmMgYiBsaW5lLXByZWZpeCBp bmRlbnQpKSkKICAgICgoYSAnLSBiKQogICAgIChzaW1wbGUtZm9ybWF0ICNmICJqaXRfaW5zbl9z dWIgKGZ1bmN0aW9uLCB+QSwgfkEpIgogICAgICAgICAgICAgICAgICAgIChleHByZXNzaW9uLT5j IGEgbGluZS1wcmVmaXggaW5kZW50KQogICAgICAgICAgICAgICAgICAgIChleHByZXNzaW9uLT5j IGIgbGluZS1wcmVmaXggaW5kZW50KSkpCiAgICAoKGEgJyogYikKICAgICAoc2ltcGxlLWZvcm1h dCAjZiAiaml0X2luc25fbXVsIChmdW5jdGlvbiwgfkEsIH5BKSIKICAgICAgICAgICAgICAgICAg ICAoZXhwcmVzc2lvbi0+YyBhIGxpbmUtcHJlZml4IGluZGVudCkKICAgICAgICAgICAgICAgICAg ICAoZXhwcmVzc2lvbi0+YyBiIGxpbmUtcHJlZml4IGluZGVudCkpKQogICAgKChhICcvIGIpCiAg ICAgKHNpbXBsZS1mb3JtYXQgI2YgImppdF9pbnNuX2RpdiAoZnVuY3Rpb24sIH5BLCB+QSkiCiAg ICAgICAgICAgICAgICAgICAgKGV4cHJlc3Npb24tPmMgYSBsaW5lLXByZWZpeCBpbmRlbnQpCiAg ICAgICAgICAgICAgICAgICAgKGV4cHJlc3Npb24tPmMgYiBsaW5lLXByZWZpeCBpbmRlbnQpKSkK ICAgICgoYSAnJiBiKQogICAgIChzaW1wbGUtZm9ybWF0ICNmICJqaXRfaW5zbl9hbmQgKGZ1bmN0 aW9uLCB+QSwgfkEpIgogICAgICAgICAgICAgICAgICAgIChleHByZXNzaW9uLT5jIGEgbGluZS1w cmVmaXggaW5kZW50KQogICAgICAgICAgICAgICAgICAgIChleHByZXNzaW9uLT5jIGIgbGluZS1w cmVmaXggaW5kZW50KSkpCiAgICAoKGEgJz09IGIpCiAgICAgKHNpbXBsZS1mb3JtYXQgI2YgImpp dF9pbnNuX2VxIChmdW5jdGlvbiwgfkEsIH5BKSIKICAgICAgICAgICAgICAgICAgICAoZXhwcmVz c2lvbi0+YyBhIGxpbmUtcHJlZml4IGluZGVudCkKICAgICAgICAgICAgICAgICAgICAoZXhwcmVz c2lvbi0+YyBiIGxpbmUtcHJlZml4IGluZGVudCkpKQogICAgKGEgOyBpZGVhbGx5IHRoaXMgc2hv dWxkIHJlc3RyaWN0IHRvIHN5bWJvbHMsIG51bWJlcnMgYW5kCiAgICAgICA7IHN0cmluZ3MuIG9o LCB3ZWxsLi4uCiAgICAgKHNpbXBsZS1mb3JtYXQgI2YgIn5TIiBhKSkKICAgIChfIChlcnJvciAi VW5yZWNvZ25pemVkIGV4cHJlc3Npb24iIGV4cHIgImluIGV4cHJlc3Npb24tPmMiKSkpKQo= --0016363ba544d855090496224c64 Content-Type: application/octet-stream; name="expand.scm" Content-Disposition: attachment; filename="expand.scm" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gh2c4gl61 IyEvdXNyL2Jpbi9ndWlsZSAtcwohIwoKKHVzZS1tb2R1bGVzIChybnJzIGNvbnRyb2wpKQoKOyB0 aGlzIHByb2dyYW0gdGFrZXMgYSBmaWxlLCBnaXZlbiBhcyBpdHMgZmlyc3QgY29tbWFuZC1saW5l IGFyZ3VtZW50LAo7IGFuZCBleHBhbmRzIHRoZSBTY2hlbWUgZXhwcmVzc2lvbnMgd2hpY2ggYXJl IHByZWNlZGVkIGJ5ICUlLgoKOyBoZXJlIGlzIHRoZSBwcm9jZWR1cmU6IGNvcHkgdGhlIGlucHV0 IGZpbGUgdG8gdGhlIG91dHB1dCBmaWxlIHVudGlsCjsgd2UgcmVhY2ggYSBgJSVgLiBXZSBleHBl Y3QgdGh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iAgICAgICAgICAgICAgKGxh bWJkYSAoKSAoc2V0LWN1cnJlbnQtb3V0cHV0LXBvcnQgb3V0ZmlsZSkpCiAgICAgICAgICAgICAg KGxhbWJkYSAoKSAobGV0ICgodmFsIChldmFsIGV4cHIgKGludGVyYWN0aW9uLWVudmlyb25tZW50 KSkpKQogICAgICAgICAgICAgICAgICAgICAgKHdoZW4gKG5vdCAoZXE/IHZhbCAqdW5zcGVjaWZp ZWQqKSkKICAgICAgICAgICAgICAgICAgICAgICAgKGRpc3BsYXkgdmFsKSkpKQogICAgICAgICAg ICAgIChsYW1iZGEgKCkgKHNldC1jdXJyZW50LW91dHB1dC1wb3J0IGN1cnJlbnQtb3V0cHV0KSkp CiAgICAgICAgICAocmVwbCkpKSkKCihsZXQgbG9vcCAoKQogIChsZXQgKChuZXh0LWNoYXIgKHJl YWQtY2hhciBpbmZpbGUpKSkKICAgIChjb25kICgoZW9mLW9iamVjdD8gbmV4dC1jaGFyKSkgOyBz dWNjZXNzIQogICAgICAgICAgKChub3QgKGNoYXI9PyBuZXh0LWNoYXIgI1wlKSkKICAgICAgICAg ICAod3JpdGUtY2hhciBuZXh0LWNoYXIgb3V0ZmlsZSkKICAgICAgICAgICAobG9vcCkpCiAgICAg ICAgICAoZWxzZQogICAgICAgICAgIChsZXQgKChzZWNvbmQtY2hhciAocmVhZC1jaGFyIGluZmls ZSkpKQogICAgICAgICAgICAgKGNvbmQgKChlb2Ytb2JqZWN0PyBzZWNvbmQtY2hhcikKICAgICAg ICAgICAgICAgICAgICAod3JpdGUtY2hhciBuZXh0LWNoYXIgb3V0ZmlsZSkpCiAgICAgICAgICAg ICAgICAgICAoKG5vdCAoY2hhcj0/IHNlY29uZC1jaGFyICNcJSkpCiAgICAgICAgICAgICAgICAg ICAgKHdyaXRlLWNoYXIgbmV4dC1jaGFyIG91dGZpbGUpCiAgICAgICAgICAgICAgICAgICAgKHdy aXRlLWNoYXIgc2Vjb25kLWNoYXIgb3V0ZmlsZSkKICAgICAgICAgICAgICAgICAgICAobG9vcCkp CiAgICAgICAgICAgICAgICAgICAoZWxzZQogICAgICAgICAgICAgICAgICAgIChyZXBsKQogICAg ICAgICAgICAgICAgICAgIChsb29wKSkpKSkpKSkK --0016363ba544d855090496224c64 Content-Type: application/octet-stream; name="test.scm" Content-Disposition: attachment; filename="test.scm" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gh2c4jrp2 IyFndWlsZQohIwoKKGxvYWQgImppdGdlbi5zY20iKQoKKHVzZS1tb2R1bGVzIChqaXRnZW4pKQoK KGRpc3BsYXkKIChpbnN0cnVjdGlvbnMtPmMKICAnKCh4IDwtIHkgKyB6KSkKICAnKCkpKQoKOyB0 aGlzIGlzIGEgdHJhbnNsYXRpb24gb2YgdGhlIGppdCBjb2RlIGZvciBzY21fb3BfYXNzZXJ0X25h cmdzX2VlX2xvY2FscwooZGlzcGxheQogKGluc3RydWN0aW9ucy0+YwogICcoKGlwIDwtIGlwICsg aXB1cCkKICAgICh0bXAxIDwtIGZwIC0gc3B1cCkKICAgICh0bXAyIDwtIHNwIC0gdG1wMSkKICAg ICh0bXAzIDwtIHRtcDIgPT0gKG5fdmFsICYgMHg3KSkKICAgIChicmFuY2gtaWYgdG1wMyBnb29k X3BhdGgpCiAgICAoc3RvcmUtcmVsYXRpdmUgaXBwIDAgaXApCiAgICAoc3RvcmUtcmVsYXRpdmUg c3BwIDAgc3ApCiAgICAoc3RvcmUtcmVsYXRpdmUgZnBwIDAgZnApCiAgICAocmV0dXJuIGppdF9y ZXR1cm5fd3JvbmdfbnVtX2FyZ3MpCiAgICAobGFiZWwgZ29vZF9wYXRoKQogICAgKHNwIDwtIHNw ICsgc3B1cCkKICAgIChzdG9yZS1yZWxhdGl2ZSBzcCAwIFNDTV9VTkRFRklORUQpCiAgICApCiAg JygoaXAgLiBpbnQpIChpcHVwIC4gaW50KSAoc3AgLiBpbnQpIChzcHVwIC4gaW50KSAoZnAgLiBp bnQpKSkpCgo7IHRoaXMgc2hvdWxkI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