// File: /workspace/github_c_makefile_star2_O0/ebb[P]chisa/printer.c
// Function: print
void print(long fi)
{
    long def, id, args, value, blocks;

    /*
     * Includes.
     */
    pr("#include \"runtime.h\"\n");

    /*
     * Enums for classes.
     */
    if (nrClasses(fi) > 0) {
        pr("\n");
        pr("enum {\n");
        {
            const char *initializer = " = USER_CLASS_MIN";

            forEach(fi, def) {
                if (match(def, CLASS_FiDefineCons, &id, &args)) {
                    pr("    CLASS_"), prId(id), pr(initializer), pr(",\n");
                    initializer = "";
                }
            }
        }
        pr("};\n");
    }

    /*
     * Declarations.
     */
    {
        int isVar;

        forEach(fi, def) {
            pr("\n");
            if (match(def, CLASS_FiDefineVar, &id, &value))
                isVar = 1;
            else if (match(def, CLASS_FiDefineFunc, &id, &args, &blocks))
                isVar = 0;
            else if (match(def, CLASS_FiDefineCons, &id, &args))
                isVar = 0;
            if (isVar)
                pr("long "), prId(id), pr(";\n");
            else
                prFuncSpec(idName(id), args), pr(";\n");
        }
    }

    /*
     * Definitions.
     */
    {
        forEach(fi, def) {
            if (match(def, CLASS_FiDefineFunc, &id, &args, &blocks)) {
                /*
                 * Func
                 */
                pr("\n");
                prFuncSpec(idName(id), args), pr("\n");
                pr("{\n");
                prVariables(blocks);
                prBlocks(blocks);
                pr("}\n");
            } else if (match(def, CLASS_FiDefineCons, &id, &args)) {
                /*
                 * Cons
                 */
                pr("\n");
                prFuncSpec(idName(id), args), pr("\n");
                pr("{\n");
                {
                    int len;

                    len = length(args);
                    arities[classCounter++] = length(args);
                    printf("    return runtime_makeTuple%d(CLASS_", len);
                    prId(id);
                    if (len > 0)
                        pr(", "), prIds(args), pr(");\n");
                    else
                        pr(");\n");
                }
                pr("}\n");
            }
        }
    }

    /*
     * compiler_init() (For setting globals)
     */
    {
        int i;

        pr("\n");
        pr("void compiler_init(void)\n");
        pr("{\n");
        for (i = USER_CLASS_MIN; i < classCounter; i++) {
            printf("    runtime_classArities[%d] = %d;\n",
                i, (int)arities[i]);
        }
        forEach(fi, def) {
            if (match(def, CLASS_FiDefineVar, &id, &value)) {
                pr("    "), prId(id), pr(" = ");
                if (match(value, CLASS_Fixnum))
                    pr("runtime_makeNumber("), prNum(value);
                else if (match(value, CLASS_String))
                    pr("runtime_makeString(\""), prStr(value), pr("\"");
                else
                    die("Unknown constant type.");
                pr(");\n");
            }
        }
        pr("}\n");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x22f5(%rip), %rdi      # 0x6588
callq 0x4750
movq -0x8(%rbp), %rdi
callq 0x4770
cmpl $0x0, %eax
jle 0x4352
leaq 0x22eb(%rip), %rdi      # 0x659c
callq 0x4750
leaq 0x22e1(%rip), %rdi      # 0x659e
callq 0x4750
leaq 0x22dd(%rip), %rax      # 0x65a6
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movl $0x3, %esi
leaq -0x10(%rbp), %rdx
leaq -0x40(%rbp), %rcx
movb $0x0, %al
callq 0x47e0
cmpl $0x0, %eax
je 0x4346
movq -0x10(%rbp), %rdi
movl $0x14, %esi
leaq -0x18(%rbp), %rdx
leaq -0x20(%rbp), %rcx
movb $0x0, %al
callq 0x47e0
cmpl $0x0, %eax
je 0x4344
leaq 0x22a2(%rip), %rdi      # 0x65b8
callq 0x4750
movq -0x18(%rbp), %rdi
callq 0x4970
movq -0x38(%rbp), %rdi
callq 0x4750
leaq 0x228f(%rip), %rdi      # 0x65c3
callq 0x4750
leaq 0x225d(%rip), %rax      # 0x659d
movq %rax, -0x38(%rbp)
jmp 0x42d5
leaq 0x2279(%rip), %rdi      # 0x65c6
callq 0x4750
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movl $0x3, %esi
leaq -0x10(%rbp), %rdx
leaq -0x50(%rbp), %rcx
movb $0x0, %al
callq 0x47e0
cmpl $0x0, %eax
je 0x444e
leaq 0x221a(%rip), %rdi      # 0x659c
callq 0x4750
movq -0x10(%rbp), %rdi
movl $0x12, %esi
leaq -0x18(%rbp), %rdx
leaq -0x28(%rbp), %rcx
movb $0x0, %al
callq 0x47e0
cmpl $0x0, %eax
je 0x43ad
movl $0x1, -0x44(%rbp)
jmp 0x43ff
movq -0x10(%rbp), %rdi
movl $0x13, %esi
leaq -0x18(%rbp), %rdx
leaq -0x20(%rbp), %rcx
leaq -0x30(%rbp), %r8
movb $0x0, %al
callq 0x47e0
cmpl $0x0, %eax
je 0x43d7
movl $0x0, -0x44(%rbp)
jmp 0x43fd
movq -0x10(%rbp), %rdi
movl $0x14, %esi
leaq -0x18(%rbp), %rdx
leaq -0x20(%rbp), %rcx
movb $0x0, %al
callq 0x47e0
cmpl $0x0, %eax
je 0x43fb
movl $0x0, -0x44(%rbp)
jmp 0x43fd
jmp 0x43ff
cmpl $0x0, -0x44(%rbp)
je 0x4428
leaq 0x2272(%rip), %rdi      # 0x667e
callq 0x4750
movq -0x18(%rbp), %rdi
callq 0x4970
leaq 0x236e(%rip), %rdi      # 0x678f
callq 0x4750
jmp 0x4449
movq -0x18(%rbp), %rdi
callq 0x4a10
movq %rax, %rdi
movq -0x20(%rbp), %rsi
callq 0x49a0
leaq 0x234b(%rip), %rdi      # 0x678f
callq 0x4750
jmp 0x435a
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
movl $0x3, %esi
leaq -0x10(%rbp), %rdx
leaq -0x58(%rbp), %rcx
movb $0x0, %al
callq 0x47e0
cmpl $0x0, %eax
je 0x45e5
movq -0x10(%rbp), %rdi
movl $0x13, %esi
leaq -0x18(%rbp), %rdx
leaq -0x20(%rbp), %rcx
leaq -0x30(%rbp), %r8
movb $0x0, %al
callq 0x47e0
cmpl $0x0, %eax
je 0x44f4
leaq 0x20fd(%rip), %rdi      # 0x659c
callq 0x4750
movq -0x18(%rbp), %rdi
callq 0x4a10
movq %rax, %rdi
movq -0x20(%rbp), %rsi
callq 0x49a0
leaq 0x20dc(%rip), %rdi      # 0x659c
callq 0x4750
leaq 0x2248(%rip), %rdi      # 0x6714
callq 0x4750
movq -0x30(%rbp), %rdi
callq 0x4a40
movq -0x30(%rbp), %rdi
callq 0x4bd0
leaq 0x22ac(%rip), %rdi      # 0x6796
callq 0x4750
jmp 0x45e0
movq -0x10(%rbp), %rdi
movl $0x14, %esi
leaq -0x18(%rbp), %rdx
leaq -0x20(%rbp), %rcx
movb $0x0, %al
callq 0x47e0
cmpl $0x0, %eax
je 0x45de
leaq 0x2080(%rip), %rdi      # 0x659c
callq 0x4750
movq -0x18(%rbp), %rdi
callq 0x4a10
movq %rax, %rdi
movq -0x20(%rbp), %rsi
callq 0x49a0
leaq 0x205f(%rip), %rdi      # 0x659c
callq 0x4750
leaq 0x21cb(%rip), %rdi      # 0x6714
callq 0x4750
movq -0x20(%rbp), %rdi
callq 0x4d10
movl %eax, -0x5c(%rbp)
movq -0x20(%rbp), %rdi
callq 0x4d10
movb %al, %dl
movl 0x4bf5(%rip), %eax      # 0x9160
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x4bea(%rip)      # 0x9160
movslq %eax, %rcx
leaq 0x14c80(%rip), %rax     # 0x19200
movb %dl, (%rax,%rcx)
movl -0x5c(%rbp), %esi
leaq 0x203d(%rip), %rdi      # 0x65ca
movb $0x0, %al
callq 0x1050
movq -0x18(%rbp), %rdi
callq 0x4970
cmpl $0x0, -0x5c(%rbp)
jle 0x45c6
leaq 0x2046(%rip), %rdi      # 0x65f0
callq 0x4750
movq -0x20(%rbp), %rdi
callq 0x4d60
leaq 0x21cf(%rip), %rdi      # 0x678e
callq 0x4750
jmp 0x45d2
leaq 0x21c1(%rip), %rdi      # 0x678e
callq 0x4750
leaq 0x21bd(%rip), %rdi      # 0x6796
callq 0x4750
jmp 0x45e0
jmp 0x4456
leaq 0x1fb0(%rip), %rdi      # 0x659c
callq 0x4750
leaq 0x1ffb(%rip), %rdi      # 0x65f3
callq 0x4750
leaq 0x2110(%rip), %rdi      # 0x6714
callq 0x4750
movl $0x1f, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl 0x4b47(%rip), %eax      # 0x9160
jge 0x4646
movl -0x60(%rbp), %esi
movslq -0x60(%rbp), %rcx
leaq 0x14bd7(%rip), %rax     # 0x19200
movzbl (%rax,%rcx), %edx
leaq 0x1fd9(%rip), %rdi      # 0x660d
movb $0x0, %al
callq 0x1050
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x4610
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
movl $0x3, %esi
leaq -0x10(%rbp), %rdx
leaq -0x68(%rbp), %rcx
movb $0x0, %al
callq 0x47e0
cmpl $0x0, %eax
je 0x4731
movq -0x10(%rbp), %rdi
movl $0x12, %esi
leaq -0x18(%rbp), %rdx
leaq -0x28(%rbp), %rcx
movb $0x0, %al
callq 0x47e0
cmpl $0x0, %eax
je 0x472c
leaq 0x205a(%rip), %rdi      # 0x66f1
callq 0x4750
movq -0x18(%rbp), %rdi
callq 0x4970
leaq 0x1f85(%rip), %rdi      # 0x6631
callq 0x4750
movq -0x28(%rbp), %rdi
xorl %esi, %esi
movb $0x0, %al
callq 0x47e0
cmpl $0x0, %eax
je 0x46da
leaq 0x1f6b(%rip), %rdi      # 0x6635
callq 0x4750
movq -0x28(%rbp), %rdi
callq 0x4dd0
jmp 0x4720
movq -0x28(%rbp), %rdi
movl $0x1, %esi
movb $0x0, %al
callq 0x47e0
cmpl $0x0, %eax
je 0x4712
leaq 0x1f53(%rip), %rdi      # 0x6649
callq 0x4750
movq -0x28(%rbp), %rdi
callq 0x4e00
leaq 0x1f51(%rip), %rdi      # 0x665c
callq 0x4750
jmp 0x471e
leaq 0x1f45(%rip), %rdi      # 0x665e
callq 0x5ed0
jmp 0x4720
leaq 0x2067(%rip), %rdi      # 0x678e
callq 0x4750
jmp 0x464e
leaq 0x205e(%rip), %rdi      # 0x6796
callq 0x4750
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)