// File: /workspace/github_c_makefile_star2_O3/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 0x6fd9(%rip), %r12      # 0xedde
leaq 0x6fd8(%rip), %r13      # 0xede4
testq %r14, %r14
je 0x7e2c
movl 0xc(%r14), %edx
movl 0x10(%r14), %ecx
movq %rbx, %rdi
leaq 0x6fc4(%rip), %rsi      # 0xede7
xorl %eax, %eax
callq 0x3140
jmp 0x7e37
movq %r12, %rdi
movq %rbx, %rsi
callq 0x30e0
testl %r15d, %r15d
jle 0x7e59
movl %r15d, %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x7e3f
testq %r14, %r14
je 0x84b2
movl (%r14), %eax
leaq 0xd844(%rip), %rcx      # 0x156b0
movq (%rcx,%rax,8), %rdi
movq %rbx, %rsi
callq 0x30e0
movl (%r14), %esi
cmpq $0x13, %rsi
ja 0x856c
leaq 0x6d84(%rip), %rcx      # 0xec10
movslq (%rcx,%rsi,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x40(%r14), %rdx
movq %rbx, %rdi
leaq 0x6f5c(%rip), %rsi      # 0xedff
xorl %eax, %eax
callq 0x3140
jmp 0x843f
movq 0x40(%r14), %rdx
movq %rbx, %rdi
leaq 0x6f3b(%rip), %rsi      # 0xedf8
xorl %eax, %eax
callq 0x3140
testl %r15d, %r15d
js 0x7ee7
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x7ecd
movq %rbx, %rdi
leaq 0x6f21(%rip), %rsi      # 0xee12
leaq 0x6ee6(%rip), %rdx      # 0xedde
xorl %eax, %eax
callq 0x3140
movq 0x48(%r14), %rsi
leal 0x2(%r15), %edx
movq %rbx, %rdi
movl %edx, -0x2c(%rbp)
callq 0x7de7
testl %r15d, %r15d
js 0x7f35
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x7f1b
movq %rbx, %rdi
leaq 0x6ee2(%rip), %rsi      # 0xee21
jmp 0x80c0
movq 0x38(%r14), %rdx
movq %rbx, %rdi
leaq 0x6ea6(%rip), %rsi      # 0xedf8
xorl %eax, %eax
callq 0x3140
movq 0x40(%r14), %r14
jmp 0x8021
movl $0x28, %edi
movq %rbx, %rsi
callq 0x3110
movl 0x4(%r14), %esi
movl 0x8(%r14), %edx
movq %rbx, %rdi
callq 0x8586
movl $0x3, %esi
movl $0x1, %edx
leaq 0x6ed1(%rip), %rdi      # 0xee61
jmp 0x8404
movq 0x40(%r14), %rdx
movq %rbx, %rdi
leaq 0x6e69(%rip), %rsi      # 0xee0c
xorl %eax, %eax
callq 0x3140
movl 0x4(%r14), %esi
movl 0x8(%r14), %edx
movq %rbx, %rdi
callq 0x8586
movl $0x2, %esi
movl $0x1, %edx
leaq 0x6dcb(%rip), %rdi      # 0xed96
movq %rbx, %rcx
callq 0x31d0
jmp 0x843f
movl 0x48(%r14), %eax
leaq 0xdb1d(%rip), %rcx      # 0x15b00
movq (%rcx,%rax,8), %rdx
movq %rbx, %rdi
leaq 0x6e07(%rip), %rsi      # 0xedf8
xorl %eax, %eax
callq 0x3140
jmp 0x81d9
movl 0x40(%r14), %eax
leaq 0xdaf8(%rip), %rcx      # 0x15b00
movq (%rcx,%rax,8), %rdx
movq %rbx, %rdi
leaq 0x6de2(%rip), %rsi      # 0xedf8
xorl %eax, %eax
callq 0x3140
movq 0x38(%r14), %r14
incl %r15d
leaq 0x6db3(%rip), %r12      # 0xedde
jmp 0x7e0c
movq 0x40(%r14), %rdx
movq %rbx, %rdi
leaq 0x6dba(%rip), %rsi      # 0xedf8
xorl %eax, %eax
callq 0x3140
testl %r15d, %r15d
js 0x8068
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x804e
movq %rbx, %rdi
leaq 0x6df3(%rip), %rsi      # 0xee65
leaq 0x6d65(%rip), %rdx      # 0xedde
xorl %eax, %eax
callq 0x3140
movq 0x48(%r14), %rsi
leal 0x2(%r15), %edx
movq %rbx, %rdi
movl %edx, -0x2c(%rbp)
callq 0x7de7
testl %r15d, %r15d
js 0x80b6
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x809c
movq %rbx, %rdi
leaq 0x6db5(%rip), %rsi      # 0xee75
leaq 0x6d17(%rip), %r12      # 0xedde
movq %r12, %rdx
xorl %eax, %eax
callq 0x3140
movq 0x50(%r14), %rsi
jmp 0x83d6
movq 0x50(%r14), %rdx
movq %rbx, %rdi
leaq 0x6d10(%rip), %rsi      # 0xedf8
xorl %eax, %eax
callq 0x3140
testl %r15d, %r15d
js 0x8112
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x80f8
movq %rbx, %rdi
leaq 0x6cf6(%rip), %rsi      # 0xee12
leaq 0x6cbb(%rip), %rdx      # 0xedde
xorl %eax, %eax
callq 0x3140
movq 0x38(%r14), %rsi
leal 0x2(%r15), %r12d
movq %rbx, %rdi
movl %r12d, %edx
callq 0x7de7
testl %r15d, %r15d
movl %r12d, -0x2c(%rbp)
js 0x8458
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
incl %r12d
cmpl %r12d, %r15d
jne 0x8150
movq %rbx, %rdi
leaq 0x6caa(%rip), %rsi      # 0xee21
leaq 0x6c60(%rip), %rdx      # 0xedde
xorl %eax, %eax
callq 0x3140
movq 0x40(%r14), %rsi
movq %rbx, %rdi
movl -0x2c(%rbp), %edx
callq 0x7de7
testl %r15d, %r15d
js 0x847f
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x81a1
jmp 0x847f
movl $0x2, %esi
movl $0x1, %edx
leaq 0x6c91(%rip), %rdi      # 0xee62
movq %rbx, %rcx
callq 0x31d0
movq 0x38(%r14), %rsi
incl %r15d
movq %rbx, %rdi
movl %r15d, %edx
callq 0x7de7
movq 0x40(%r14), %r14
leaq 0x6be8(%rip), %r12      # 0xedde
jmp 0x7e0c
movl $0x2, %esi
movl $0x1, %edx
leaq 0x6c56(%rip), %rdi      # 0xee62
movq %rbx, %rcx
callq 0x31d0
testl %r15d, %r15d
js 0x8237
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x821d
movq %rbx, %rdi
leaq 0x6c3e(%rip), %rsi      # 0xee7f
leaq 0x6b96(%rip), %rdx      # 0xedde
xorl %eax, %eax
callq 0x3140
movq 0x40(%r14), %rsi
leal 0x2(%r15), %edx
movq %rbx, %rdi
movl %edx, -0x2c(%rbp)
callq 0x7de7
testl %r15d, %r15d
js 0x8285
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x826b
movq %rbx, %rdi
leaq 0x6bf8(%rip), %rsi      # 0xee87
jmp 0x83c1
movl $0x2, %esi
movl $0x1, %edx
leaq 0x6bbd(%rip), %rdi      # 0xee62
movq %rbx, %rcx
callq 0x31d0
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 0x6b5f(%rip), %rsi      # 0xee39
leaq 0x6afd(%rip), %rdx      # 0xedde
xorl %eax, %eax
callq 0x3140
movq 0x40(%r14), %rsi
leal 0x2(%r15), %edx
movq %rbx, %rdi
movl %edx, -0x2c(%rbp)
callq 0x7de7
testl %r15d, %r15d
js 0x831e
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x8304
movq %rbx, %rdi
leaq 0x6b1c(%rip), %rsi      # 0xee44
jmp 0x83c1
movl $0x2, %esi
movl $0x1, %edx
leaq 0x6b24(%rip), %rdi      # 0xee62
movq %rbx, %rcx
callq 0x31d0
testl %r15d, %r15d
js 0x8369
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x834f
movq %rbx, %rdi
leaq 0x6ada(%rip), %rsi      # 0xee4d
leaq 0x6a64(%rip), %rdx      # 0xedde
xorl %eax, %eax
callq 0x3140
movq 0x40(%r14), %rsi
leal 0x2(%r15), %edx
movq %rbx, %rdi
movl %edx, -0x2c(%rbp)
callq 0x7de7
testl %r15d, %r15d
js 0x83b7
leal 0x1(%r15), %r12d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x31d0
decl %r12d
jne 0x839d
movq %rbx, %rdi
leaq 0x6a6f(%rip), %rsi      # 0xee30
leaq 0x6a16(%rip), %r12      # 0xedde
movq %r12, %rdx
xorl %eax, %eax
callq 0x3140
movq 0x48(%r14), %rsi
movq %rbx, %rdi
movl -0x2c(%rbp), %edx
callq 0x7de7
movq 0x38(%r14), %r14
testq %r14, %r14
jne 0x7e0c
jmp 0x84d9
movl $0x2, %esi
movl $0x1, %edx
leaq 0x6a5e(%rip), %rdi      # 0xee62
movq %rbx, %rcx
callq 0x31d0
movq 0x40(%r14), %rsi
jmp 0x8433
movq 0x48(%r14), %rdx
movl 0x40(%r14), %ecx
movl 0x44(%r14), %r8d
movq %rbx, %rdi
leaq 0x6a2e(%rip), %rsi      # 0xee56
xorl %eax, %eax
callq 0x3140
movq 0x60(%r14), %rsi
leal 0x1(%r15), %edx
movq %rbx, %rdi
callq 0x7de7
movq 0x38(%r14), %r14
testq %r14, %r14
leaq 0x6991(%rip), %r12      # 0xedde
jne 0x7e0c
jmp 0x84d9
movq %rbx, %rdi
leaq 0x69bf(%rip), %rsi      # 0xee21
leaq 0x6975(%rip), %rdx      # 0xedde
xorl %eax, %eax
callq 0x3140
movq 0x40(%r14), %rsi
movq %rbx, %rdi
movl %r12d, %edx
callq 0x7de7
movq %rbx, %rdi
leaq 0x69a7(%rip), %rsi      # 0xee30
leaq 0x694e(%rip), %r12      # 0xedde
movq %r12, %rdx
xorl %eax, %eax
callq 0x3140
movq 0x58(%r14), %rsi
movq %rbx, %rdi
movl -0x2c(%rbp), %edx
callq 0x7de7
movq 0x48(%r14), %r14
jmp 0x83e5
leaq 0x6939(%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
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5fb5(%rip), %rax      # 0xe4a4
cmpb $0x0, 0x38(%r14)
leaq 0x5fae(%rip), %rdx      # 0xe4a9
cmovneq %rax, %rdx
jmp 0x854d
movl 0x38(%r14), %edx
leaq 0x6887(%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 0x68d4(%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 0x68ab(%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 0x691e(%rip), %rdi      # 0xee91
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7a6c