// File: /workspace/github_c_makefile_star2_O1/sharmaeklavya2[P]cerplag/ast.c
// Function: print_ast
void print_ast(FILE* fp, pAstNode p, int indent) {
    int i;
    const char INDENT_STR[] = "  ";
    const char* INITIAL_INDENT = "        ";
    if(p != NULL)
        fprintf(fp, "(%2d:%2d) ", p->base.line, p->base.col);
    else
        fprintf(fp, "%s", INITIAL_INDENT);
    for(i=0; i<indent; ++i)
        fprintf(fp, INDENT_STR);
    if(p == NULL) {
        fprintf(fp, "NULL\n");
        return;
    }
    fprintf(fp, "%s", ASTN_STRS[p->base.node_type]);
    switch(p->base.node_type) {
        case ASTN_BOp:
            fprintf(fp, "(%s):\n", OP_STRS[((BOpNode*)p)->op]);
            print_ast(fp, ((BOpNode*)p)->arg1, indent+1);
            print_ast(fp, ((BOpNode*)p)->arg2, indent+1);
            break;
        case ASTN_UOp:
            fprintf(fp, "(%s):\n", OP_STRS[((UOpNode*)p)->op]);
            print_ast(fp, ((UOpNode*)p)->arg, indent+1);
            break;
        case ASTN_Deref:
            fprintf(fp, "(%s):\n", ((DerefNode*)p)->varname);
            print_ast(fp, ((DerefNode*)p)->index, indent+1);
            break;

        case ASTN_Var:
            fprintf(fp, "(%s)\n", ((VarNode*)p)->varname);
            break;
        case ASTN_Num:
            fprintf(fp, "(%d)\n", ((NumNode*)p)->val);
            break;
        case ASTN_RNum:
            fprintf(fp, "(%lf)\n", ((RNumNode*)p)->val);
            break;
        case ASTN_Bool:
            fprintf(fp, "(%s)\n", (((BoolNode*)p)->val)?"true":"false");
            break;

        case ASTN_IDList:
            fprintf(fp, "(%s)\n", ((IDListNode*)p)->varname);
            if(((IDListNode*)p)->next != NULL)
                print_ast(fp, ((IDListNode*)p)->next, indent);
            break;
        case ASTN_IDTypeList:
            fprintf(fp, "(%s, ", ((IDTypeListNode*)p)->varname);
            print_type(fp, ((IDTypeListNode*)p)->base.type, ((IDTypeListNode*)p)->base.size);
            fprintf(fp, ")\n");
            if(((IDTypeListNode*)p)->next != NULL)
                print_ast(fp, ((IDTypeListNode*)p)->next, indent);
            break;

        case ASTN_Module:
            fprintf(fp, "(%s):\n", ((ModuleNode*)p)->name);

            for(i=-1; i<indent; ++i) fprintf(fp, INDENT_STR);
            fprintf(fp, "%siParamList=\n", INITIAL_INDENT);
            print_ast(fp, ((ModuleNode*)p)->iParamList, indent+2);

            for(i=-1; i<indent; ++i) fprintf(fp, INDENT_STR);
            fprintf(fp, "%soParamList=\n", INITIAL_INDENT);
            print_ast(fp, ((ModuleNode*)p)->oParamList, indent+2);

            for(i=-1; i<indent; ++i) fprintf(fp, INDENT_STR);
            fprintf(fp, "%sbody=\n", INITIAL_INDENT);
            print_ast(fp, ((ModuleNode*)p)->body, indent+2);

            if(((ModuleNode*)p)->next != NULL)
                print_ast(fp, ((ModuleNode*)p)->next, indent);
            break;
        case ASTN_Program:
            fprintf(fp, ":\n");
            print_ast(fp, ((ProgramNode*)p)->decls, indent+1);
            print_ast(fp, ((ProgramNode*)p)->modules, indent+1);
            break;

        case ASTN_Assn:
            fprintf(fp, ":\n");

            for(i=-1; i<indent; ++i) fprintf(fp, INDENT_STR);
            fprintf(fp, "%starget=\n", INITIAL_INDENT);
            print_ast(fp, ((AssnNode*)p)->target, indent+2);

            for(i=-1; i<indent; ++i) fprintf(fp, INDENT_STR);
            fprintf(fp, "%sexpr=\n", INITIAL_INDENT);
            print_ast(fp, ((AssnNode*)p)->expr, indent+2);

            if(((AssnNode*)p)->next != NULL)
                print_ast(fp, ((AssnNode*)p)->next, indent);
            break;

        case ASTN_While:
            fprintf(fp, ":\n");

            for(i=-1; i<indent; ++i) fprintf(fp, INDENT_STR);
            fprintf(fp, "%scond=\n", INITIAL_INDENT);
            print_ast(fp, ((WhileNode*)p)->cond, indent+2);

            for(i=-1; i<indent; ++i) fprintf(fp, INDENT_STR);
            fprintf(fp, "%sbody=\n", INITIAL_INDENT);
            print_ast(fp, ((WhileNode*)p)->body, indent+2);

            if(((WhileNode*)p)->next != NULL)
                print_ast(fp, ((WhileNode*)p)->next, indent);
            break;

        case ASTN_For:
            fprintf(fp, "(%s, %d, %d):\n", ((ForNode*)p)->varname, ((ForNode*)p)->beg, ((ForNode*)p)->end);
            print_ast(fp, ((ForNode*)p)->body, indent+1);
            if(((ForNode*)p)->next != NULL)
                print_ast(fp, ((ForNode*)p)->next, indent);
            break;

        case ASTN_Decl:
            fprintf(fp, "(");
            print_type(fp, ((DeclNode*)p)->base.type, ((DeclNode*)p)->base.size);
            fprintf(fp, "):\n");
            print_ast(fp, ((DeclNode*)p)->idList, indent+1);
            if(((DeclNode*)p)->next != NULL)
                print_ast(fp, ((DeclNode*)p)->next, indent);
            break;

        case ASTN_Input:
            fprintf(fp, "(%s)\n", ((InputNode*)p)->varname);
            if(((InputNode*)p)->next != NULL)
                print_ast(fp, ((InputNode*)p)->next, indent);
            break;

        case ASTN_Output:
            fprintf(fp, ":\n");
            print_ast(fp, ((OutputNode*)p)->var, indent+1);
            if(((OutputNode*)p)->next != NULL)
                print_ast(fp, ((OutputNode*)p)->next, indent);
            break;

        case ASTN_FCall:
            fprintf(fp, "(%s):\n", ((FCallNode*)p)->name);

            for(i=-1; i<indent; ++i) fprintf(fp, INDENT_STR);
            fprintf(fp, "%siParamList=\n", INITIAL_INDENT);
            print_ast(fp, ((FCallNode*)p)->iParamList, indent+2);

            for(i=-1; i<indent; ++i) fprintf(fp, INDENT_STR);
            fprintf(fp, "%soParamList=\n", INITIAL_INDENT);
            print_ast(fp, ((FCallNode*)p)->oParamList, indent+2);

            if(((FCallNode*)p)->next != NULL)
                print_ast(fp, ((FCallNode*)p)->next, indent);
            break;

        case ASTN_Switch:
            fprintf(fp, "(%s):\n", ((SwitchNode*)p)->varname);

            for(i=-1; i<indent; ++i) fprintf(fp, INDENT_STR);
            fprintf(fp, "%sdefaultcase=\n", INITIAL_INDENT);
            print_ast(fp, ((SwitchNode*)p)->defaultcase, indent+2);

            for(i=-1; i<indent; ++i) fprintf(fp, INDENT_STR);
            fprintf(fp, "%scases=\n", INITIAL_INDENT);
            print_ast(fp, ((SwitchNode*)p)->cases, indent+2);

            if(((SwitchNode*)p)->next != NULL)
                print_ast(fp, ((SwitchNode*)p)->next, indent);
            break;

        case ASTN_Case:
            fprintf(fp, ":\n");

            for(i=-1; i<indent; ++i) fprintf(fp, INDENT_STR);
            fprintf(fp, "%sval=\n", INITIAL_INDENT);
            print_ast(fp, ((CaseNode*)p)->val, indent+2);

            for(i=-1; i<indent; ++i) fprintf(fp, INDENT_STR);
            fprintf(fp, "%sstmts=\n", INITIAL_INDENT);
            print_ast(fp, ((CaseNode*)p)->stmts, indent+2);

            if(((CaseNode*)p)->next != NULL)
                print_ast(fp, ((CaseNode*)p)->next, indent);
            break;
        default:
            complain_ast_node_type(__func__, p->base.node_type);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x6e65(%rip), %r13      # 0xede4
testq %r14, %r14
je 0x7f9f
movl 0xc(%r14), %edx
movl 0x10(%r14), %ecx
movq %rbx, %rdi
leaq 0x6e51(%rip), %rsi      # 0xede7
xorl %eax, %eax
callq 0x3140
jmp 0x7fae
leaq 0x6e38(%rip), %rdi      # 0xedde
movq %rbx, %rsi
callq 0x30e0
testl %r15d, %r15d
jle 0x7fd0
movl %r15d, %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x7fb6
testq %r14, %r14
je 0x85c6
movl (%r14), %eax
leaq 0xd6cd(%rip), %rcx      # 0x156b0
movq (%rcx,%rax,8), %rdi
movq %rbx, %rsi
callq 0x30e0
movl (%r14), %esi
cmpq $0x13, %rsi
ja 0x8671
leaq 0x6c0d(%rip), %rcx      # 0xec10
movslq (%rcx,%rsi,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x40(%r14), %rdx
movq %rbx, %rdi
leaq 0x6de5(%rip), %rsi      # 0xedff
xorl %eax, %eax
callq 0x3140
jmp 0x85aa
movq 0x40(%r14), %rdx
movq %rbx, %rdi
leaq 0x6dc4(%rip), %rsi      # 0xedf8
xorl %eax, %eax
callq 0x3140
testl %r15d, %r15d
js 0x805e
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x8044
movq %rbx, %rdi
leaq 0x6daa(%rip), %rsi      # 0xee12
leaq 0x6d6f(%rip), %rdx      # 0xedde
xorl %eax, %eax
callq 0x3140
movq 0x48(%r14), %rsi
leal 0x2(%r15), %edx
movq %rbx, %rdi
movl %edx, -0x2c(%rbp)
callq 0x7f61
testl %r15d, %r15d
js 0x80ac
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x8092
movq %rbx, %rdi
leaq 0x6d6b(%rip), %rsi      # 0xee21
jmp 0x8233
movq 0x38(%r14), %rdx
movq %rbx, %rdi
leaq 0x6d2f(%rip), %rsi      # 0xedf8
xorl %eax, %eax
callq 0x3140
movq 0x40(%r14), %r14
incl %r15d
jmp 0x7f7f
movl $0x28, %edi
movq %rbx, %rsi
callq 0x3110
movl 0x4(%r14), %esi
movl 0x8(%r14), %edx
movq %rbx, %rdi
callq 0x868b
movl $0x3, %esi
movl $0x1, %edx
leaq 0x6d57(%rip), %rdi      # 0xee61
jmp 0x856f
movq 0x40(%r14), %rdx
movq %rbx, %rdi
leaq 0x6cef(%rip), %rsi      # 0xee0c
xorl %eax, %eax
callq 0x3140
movl 0x4(%r14), %esi
movl 0x8(%r14), %edx
movq %rbx, %rdi
callq 0x868b
movl $0x2, %esi
movl $0x1, %edx
leaq 0x6c51(%rip), %rdi      # 0xed96
movq %rbx, %rcx
callq 0x31d0
jmp 0x85aa
movl 0x48(%r14), %eax
leaq 0xd9a3(%rip), %rcx      # 0x15b00
movq (%rcx,%rax,8), %rdx
movq %rbx, %rdi
leaq 0x6c8d(%rip), %rsi      # 0xedf8
xorl %eax, %eax
callq 0x3140
jmp 0x8363
movl 0x40(%r14), %eax
leaq 0xd97e(%rip), %rcx      # 0x15b00
movq (%rcx,%rax,8), %rdx
movq %rbx, %rdi
leaq 0x6c68(%rip), %rsi      # 0xedf8
xorl %eax, %eax
callq 0x3140
movq 0x38(%r14), %r14
incl %r15d
jmp 0x7f7f
movq 0x40(%r14), %rdx
movq %rbx, %rdi
leaq 0x6c47(%rip), %rsi      # 0xedf8
xorl %eax, %eax
callq 0x3140
testl %r15d, %r15d
js 0x81db
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x81c1
movq %rbx, %rdi
leaq 0x6c80(%rip), %rsi      # 0xee65
leaq 0x6bf2(%rip), %rdx      # 0xedde
xorl %eax, %eax
callq 0x3140
movq 0x48(%r14), %rsi
leal 0x2(%r15), %edx
movq %rbx, %rdi
movl %edx, -0x2c(%rbp)
callq 0x7f61
testl %r15d, %r15d
js 0x8229
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x820f
movq %rbx, %rdi
leaq 0x6c42(%rip), %rsi      # 0xee75
leaq 0x6ba4(%rip), %rdx      # 0xedde
xorl %eax, %eax
callq 0x3140
movq 0x50(%r14), %rsi
jmp 0x8556
movq 0x50(%r14), %rdx
movq %rbx, %rdi
leaq 0x6ba0(%rip), %rsi      # 0xedf8
xorl %eax, %eax
callq 0x3140
testl %r15d, %r15d
js 0x8282
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x8268
movq %rbx, %rdi
leaq 0x6b86(%rip), %rsi      # 0xee12
leaq 0x6b4b(%rip), %rdx      # 0xedde
xorl %eax, %eax
callq 0x3140
movq 0x38(%r14), %rsi
leal 0x2(%r15), %edx
movq %rbx, %rdi
movl %edx, -0x2c(%rbp)
callq 0x7f61
testl %r15d, %r15d
js 0x82d0
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x82b6
movq %rbx, %rdi
leaq 0x6b47(%rip), %rsi      # 0xee21
leaq 0x6afd(%rip), %rdx      # 0xedde
xorl %eax, %eax
callq 0x3140
movq 0x40(%r14), %rsi
movq %rbx, %rdi
movl -0x2c(%rbp), %edx
callq 0x7f61
testl %r15d, %r15d
js 0x831a
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x8300
movq %rbx, %rdi
leaq 0x6b0c(%rip), %rsi      # 0xee30
leaq 0x6ab3(%rip), %rdx      # 0xedde
xorl %eax, %eax
callq 0x3140
movq 0x58(%r14), %rsi
movq %rbx, %rdi
movl -0x2c(%rbp), %edx
callq 0x7f61
movq 0x48(%r14), %r14
jmp 0x85ae
movl $0x2, %esi
movl $0x1, %edx
leaq 0x6b07(%rip), %rdi      # 0xee62
movq %rbx, %rcx
callq 0x31d0
movq 0x38(%r14), %rsi
incl %r15d
movq %rbx, %rdi
movl %r15d, %edx
callq 0x7f61
movq 0x40(%r14), %r14
jmp 0x7f7f
movl $0x2, %esi
movl $0x1, %edx
leaq 0x6ad3(%rip), %rdi      # 0xee62
movq %rbx, %rcx
callq 0x31d0
testl %r15d, %r15d
js 0x83ba
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x83a0
movq %rbx, %rdi
leaq 0x6abb(%rip), %rsi      # 0xee7f
leaq 0x6a13(%rip), %rdx      # 0xedde
xorl %eax, %eax
callq 0x3140
movq 0x40(%r14), %rsi
leal 0x2(%r15), %edx
movq %rbx, %rdi
movl %edx, -0x2c(%rbp)
callq 0x7f61
testl %r15d, %r15d
js 0x8408
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x83ee
movq %rbx, %rdi
leaq 0x6a75(%rip), %rsi      # 0xee87
jmp 0x8544
movl $0x2, %esi
movl $0x1, %edx
leaq 0x6a3a(%rip), %rdi      # 0xee62
movq %rbx, %rcx
callq 0x31d0
testl %r15d, %r15d
js 0x8453
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x8439
movq %rbx, %rdi
leaq 0x69dc(%rip), %rsi      # 0xee39
leaq 0x697a(%rip), %rdx      # 0xedde
xorl %eax, %eax
callq 0x3140
movq 0x40(%r14), %rsi
leal 0x2(%r15), %edx
movq %rbx, %rdi
movl %edx, -0x2c(%rbp)
callq 0x7f61
testl %r15d, %r15d
js 0x84a1
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x8487
movq %rbx, %rdi
leaq 0x6999(%rip), %rsi      # 0xee44
jmp 0x8544
movl $0x2, %esi
movl $0x1, %edx
leaq 0x69a1(%rip), %rdi      # 0xee62
movq %rbx, %rcx
callq 0x31d0
testl %r15d, %r15d
js 0x84ec
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x84d2
movq %rbx, %rdi
leaq 0x6957(%rip), %rsi      # 0xee4d
leaq 0x68e1(%rip), %rdx      # 0xedde
xorl %eax, %eax
callq 0x3140
movq 0x40(%r14), %rsi
leal 0x2(%r15), %edx
movq %rbx, %rdi
movl %edx, -0x2c(%rbp)
callq 0x7f61
testl %r15d, %r15d
js 0x853a
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x8520
movq %rbx, %rdi
leaq 0x68ec(%rip), %rsi      # 0xee30
leaq 0x6893(%rip), %rdx      # 0xedde
xorl %eax, %eax
callq 0x3140
movq 0x48(%r14), %rsi
movq %rbx, %rdi
movl -0x2c(%rbp), %edx
jmp 0x85a5
movl $0x2, %esi
movl $0x1, %edx
leaq 0x68f3(%rip), %rdi      # 0xee62
movq %rbx, %rcx
callq 0x31d0
movq 0x40(%r14), %rsi
jmp 0x859e
movq 0x48(%r14), %rdx
movl 0x40(%r14), %ecx
movl 0x44(%r14), %r8d
movq %rbx, %rdi
leaq 0x68c3(%rip), %rsi      # 0xee56
xorl %eax, %eax
callq 0x3140
movq 0x60(%r14), %rsi
leal 0x1(%r15), %edx
movq %rbx, %rdi
callq 0x7f61
movq 0x38(%r14), %r14
testq %r14, %r14
jne 0x7f7f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6825(%rip), %rdi      # 0xedf2
movl $0x5, %esi
movl $0x1, %edx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31d0
leaq 0x5eb0(%rip), %rax      # 0xe4a4
cmpb $0x0, 0x38(%r14)
leaq 0x5ea9(%rip), %rdx      # 0xe4a9
cmovneq %rax, %rdx
jmp 0x8652
movl 0x38(%r14), %edx
leaq 0x6782(%rip), %rsi      # 0xed93
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3140
movsd 0x38(%r14), %xmm0
leaq 0x67cf(%rip), %rsi      # 0xee05
movq %rbx, %rdi
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3140
movq 0x38(%r14), %rdx
leaq 0x67a6(%rip), %rsi      # 0xedff
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3140
leaq 0x6819(%rip), %rdi      # 0xee91
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7a58