LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/parser.c
// Function: print_tree_sub
void print_tree_sub(const parse_tree_node* root, FILE* fp)
{
    if(root != NULL)
    {
        parse_tree_node* n = root->first_child;
        if(n != NULL)
            print_tree_sub(n, fp);
        print_node_sub(root, fp);
        if(n != NULL)
            for(n = n->next_sibling; n != NULL; n = n->next_sibling)
                print_tree_sub(n, fp);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x6afb
movq %rsi, %rbx
movq %rdi, %r15
movq 0x10(%rdi), %r14
testq %r14, %r14
je 0x6b06
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6ab1
movq %r15, %rdi
movq %rbx, %rsi
callq 0x695e
movq 0x20(%r14), %r14
testq %r14, %r14
je 0x6afb
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6ab1
jmp 0x6ae5
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x695e
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/parser.c
// Function: print_node
void print_node(const parse_tree_node* root, FILE* fp)
{
    if(root != NULL)
    {
        fprintf(fp, "%s  ", GS_STRS[root->value->sid]);
        if(root->value->rule_num >= 0)
            fprintf(fp, "(%2d)  ", root->value->rule_num);
        if(root->value->lexeme != NULL)
            fprintf(fp, "%s", root->value->lexeme);
        else if(root->value->sid == T_NUM)
            fprintf(fp, "%d", root->value->i);
        else if(root->value->sid == T_RNUM)
            fprintf(fp, "%lf", root->value->f);
        fprintf(fp, " (%d:%d)\n", root->value->line, root->value->col);
    }
}

// Assembly:
testq %rdi, %rdi
je 0x6b9c
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rax
movslq 0x10(%rax), %rax
leaq 0xdc15(%rip), %rcx      # 0x14750
movq (%rcx,%rax,8), %rdx
leaq 0x6fbd(%rip), %rsi      # 0xdb03
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3130
movq (%r14), %rax
movl 0x18(%rax), %edx
testl %edx, %edx
js 0x6b6e
leaq 0x6fa7(%rip), %rsi      # 0xdb08
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3130
movq (%r14), %rax
movq 0x8(%rax), %rdi
testq %rdi, %rdi
je 0x6b9d
movq %rbx, %rsi
callq 0x30e0
movq (%r14), %rax
movl (%rax), %edx
movl 0x4(%rax), %ecx
leaq 0x6f86(%rip), %rsi      # 0xdb14
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x3130
retq
movl 0x10(%rax), %ecx
cmpl $0x4, %ecx
je 0x6bc0
cmpl $0x3, %ecx
jne 0x6b7f
movl 0x14(%rax), %edx
leaq 0x6e94(%rip), %rsi      # 0xda48
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3130
jmp 0x6b7f
cvtss2sd 0x14(%rax), %xmm0
leaq 0x6f44(%rip), %rsi      # 0xdb10
movq %rbx, %rdi
movb $0x1, %al
callq 0x3130
jmp 0x6b7f
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/parser.c
// Function: print_tree_helper
void print_tree_helper(const parse_tree_node* root, FILE* fp, int indent)
{
    if(root != NULL)
    {
        for(int i=0; i<indent; ++i)
            fprintf(fp, "  ");
        print_node(root, fp);
        parse_tree_node* p = root->first_child;
        for(; p != NULL; p = p->next_sibling)
            print_tree_helper(p, fp, indent + 1);
    }
}

// Assembly:
testq %rdi, %rdi
je 0x6c57
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
xorl %r13d, %r13d
testl %edx, %edx
cmovgl %edx, %r13d
pushq $0x1
popq %r12
subl $0x1, %r13d
jb 0x6c1d
leaq 0x71d7(%rip), %rdi      # 0xdde4
pushq $0x2
popq %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x31c0
jmp 0x6c00
movq %r15, %rdi
movq %r14, %rsi
callq 0x6b1b
addq $0x10, %r15
incl %ebx
movq (%r15), %r15
testq %r15, %r15
je 0x6c49
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x6bd8
addq $0x20, %r15
jmp 0x6c2e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/parser.c
// Function: parser_main
int parser_main(FILE* ifp, FILE* ofp, int verbosity, parse_tree_printer tp)
{
    gsymb_t start_symb = init_parser();

    if(verbosity > 0)
    {
        print_firsts(stdout);
        printf("\n");
        print_follows(stdout);
        print_parse_table();
    }

    parse_tree_node* root = build_parse_tree(ifp, start_symb);
    tp(root, ofp);
    parse_tree_destroy(root);

    destroy_parser(true);
    return parser_error_count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %r13d
movq %rsi, %r14
movq %rdi, %r15
callq 0x5f58
movl %eax, %r12d
testl %r13d, %r13d
jle 0x6cb7
movq 0xd338(%rip), %r13      # 0x13fd0
movq (%r13), %rdi
callq 0x6393
pushq $0xa
popq %rdi
callq 0x3040
movq (%r13), %rdi
callq 0x63f0
callq 0x6459
movq %r15, %rdi
movl %r12d, %esi
callq 0x675c
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq *%rbx
movq %r15, %rdi
callq 0x6d9f
pushq $0x1
popq %rdi
callq 0x6109
movl 0xfbed(%rip), %eax      # 0x168d0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/./util/tree.gen.c
// Function: parse_tree_get_node
TYPED(tree_node)* TYPED(tree_get_node)(TYPE value)
{
    TYPED(tree_node)* new_node = malloc(sizeof(TYPED(tree_node)));
    if(new_node == NULL){
        fprintf(stderr, "tree: No memory!\n");
    }else{
        new_node->value         = value;
        new_node->parent        = NULL;
        new_node->first_child   = NULL;
        new_node->next_sibling  = NULL;
        new_node->prev_sibling  = NULL;
        new_node->last_child    = NULL;
    }
    TYPED(tree_node_count)++;
    return new_node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
pushq $0x30
popq %rdi
callq 0x3140
movq %rax, %rbx
testq %rax, %rax
je 0x6d43
movq %r14, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movups %xmm0, 0x18(%rbx)
andq $0x0, 0x28(%rbx)
incl 0x13069(%rip)           # 0x19da4
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
movq 0xd2ae(%rip), %rax      # 0x13ff8
movq (%rax), %rcx
leaq 0x6dca(%rip), %rdi      # 0xdb1e
pushq $0x11
popq %rsi
pushq $0x1
popq %rdx
callq 0x31c0
jmp 0x6d35
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/./util/tree.gen.c
// Function: parse_tree_insert
TYPED(tree_node)* TYPED(tree_insert)(TYPED(tree_node)* parent, TYPE value){
    TYPED(tree_node)* new_node = TYPED(tree_get_node)(value);
    new_node->parent = parent;
    if(parent->first_child == NULL && parent->last_child == NULL){
        parent->first_child = new_node;
    }else{
        new_node->prev_sibling = parent->last_child;
        parent->last_child->next_sibling = new_node;
    }
    parent->last_child = new_node;
    return new_node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x6d08
movq %rbx, 0x8(%rax)
movq 0x18(%rbx), %rcx
movq 0x10(%rbx), %rdx
orq %rcx, %rdx
jne 0x6d89
leaq 0x10(%rbx), %rcx
jmp 0x6d91
movq %rcx, 0x28(%rax)
addq $0x20, %rcx
movq %rax, (%rcx)
movq %rax, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/./util/tree.gen.c
// Function: parse_tree_destroy
void TYPED(tree_destroy)(TYPED(tree_node)* root)
{
    if(root != NULL)
    {
        TYPED(tree_node)* sibling = root->next_sibling;
        TYPED(tree_node)* child = root->first_child;
        TYPED(destroy)(root->value);
        free(root);
        TYPED(tree_destroy)(child);
        TYPED(tree_destroy)(sibling);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rbx, %rbx
je 0x6dd6
movq 0x20(%rbx), %r15
movq (%rbx), %rdi
movq 0x10(%rbx), %r14
callq 0x3030
movq %rbx, %rdi
callq 0x3030
movq %r14, %rdi
callq 0x6d9f
movq %r15, %rbx
jmp 0x6dac
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/./util/tree.gen.c
// Function: parse_tree_print_helper
void TYPED(tree_print_helper)(TYPED(tree_node)* root, FILE* fp, int indent, void printer(TYPE, FILE*)) {
    if(root != NULL) {
        int i;
        for(i=0; i<indent; ++i)
            fprintf(fp, "  ");
        printer(root->value, fp);
        fprintf(fp, "\n");
        TYPED(tree_print_helper)(root->first_child, fp, indent+1, printer);
        TYPED(tree_print_helper)(root->next_sibling, fp, indent, printer);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, -0x38(%rbp)
movq %rsi, %r14
movq %rdi, %r15
leal 0x1(%rdx), %eax
movl %eax, -0x30(%rbp)
xorl %eax, %eax
testl %edx, %edx
cmovgl %edx, %eax
movl %eax, -0x2c(%rbp)
leaq 0x6fd1(%rip), %r13      # 0xdde4
pushq $0x2
popq %r12
pushq $0x1
popq %rbx
testq %r15, %r15
je 0x6e71
movq %r15, -0x40(%rbp)
movl -0x2c(%rbp), %r15d
subl $0x1, %r15d
jb 0x6e40
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x31c0
jmp 0x6e27
movq -0x40(%rbp), %r15
movq (%r15), %rdi
movq %r14, %rsi
callq *-0x38(%rbp)
pushq $0xa
popq %rdi
movq %r14, %rsi
callq 0x3100
movq 0x10(%r15), %rdi
movq %r14, %rsi
movl -0x30(%rbp), %edx
movq -0x38(%rbp), %rcx
callq 0x6de1
movq 0x20(%r15), %r15
jmp 0x6e1a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/./util/tree.gen.c
// Function: parse_tree_print
void TYPED(tree_print)(TYPED(tree_node)* root, FILE* fp) {
    if(root == NULL)
        fprintf(fp, "null_tree\n");
    else
        TYPED(tree_print_helper)(root, fp, 0, TYPED(print));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rsi, %rax
testq %rdi, %rdi
je 0x6e9e
leaq -0x195(%rip), %rcx      # 0x6cfe
movq %rax, %rsi
xorl %edx, %edx
popq %rbp
jmp 0x6de1
leaq 0x6c8b(%rip), %rdi      # 0xdb30
movabsq $0xa, %rsi
movabsq $0x1, %rdx
movq %rax, %rcx
popq %rbp
jmp 0x31c0
nop
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/ast.c
// Function: complain_ast_node_type
void complain_ast_node_type(const char* funcname, astn_t node_type) {
    if(node_type >= NUM_ASTN)
        fprintf(stderr, "%s: invalid node_type %d\n", funcname, node_type);
    else
        fprintf(stderr, "%s: invalid node_type %s (%d)\n", funcname, ASTN_STRS[node_type], node_type);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %esi, %r8d
movq %rdi, %rdx
movq 0xd123(%rip), %rax      # 0x13ff8
movq (%rax), %rdi
cmpl $0x14, %esi
jb 0x6eef
leaq 0x6e7c(%rip), %rsi      # 0xdd60
movl %r8d, %ecx
xorl %eax, %eax
popq %rbp
jmp 0x3130
movl %r8d, %eax
leaq 0xd7b7(%rip), %rcx      # 0x146b0
movq (%rcx,%rax,8), %rcx
leaq 0x6e76(%rip), %rsi      # 0xdd7a
xorl %eax, %eax
popq %rbp
jmp 0x3130
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/ast.c
// Function: get_ast_node
pAstNode get_ast_node(astn_t node_type) {
    pAstNode p = NULL;
    switch(node_type) {
#define X(a, b) case ASTN_##a: p = malloc(sizeof(a##Node)); \
    memset(p, 0, sizeof(a##Node)); p->base.node_type = node_type; \
    ast_mem_allocd += sizeof(a##Node); break;
#include "data/ast_nodes.xmac"
#undef X
        default:
            complain_ast_node_type(__func__, node_type);
    }
    ast_node_count++;
    return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, %esi
cmpl $0x13, %edi
ja 0x7053
movl %esi, %eax
leaq 0x6c18(%rip), %rcx      # 0xdb3c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $0x1
popq %rdi
pushq $0x50
popq %rsi
callq 0x3110
jmp 0x7105
pushq $0x1
popq %rdi
pushq $0x48
popq %rsi
callq 0x3110
movl $0x10, (%rax)
jmp 0x70eb
pushq $0x1
popq %rdi
pushq $0x48
popq %rsi
callq 0x3110
movl $0xe, (%rax)
jmp 0x70eb
pushq $0x1
popq %rdi
pushq $0x50
popq %rsi
callq 0x3110
movl $0xb, (%rax)
jmp 0x7105
pushq $0x1
popq %rdi
pushq $0x40
popq %rsi
callq 0x3110
movl $0x4, (%rax)
jmp 0x70a4
pushq $0x1
popq %rdi
pushq $0x58
popq %rsi
callq 0x3110
movl $0xc, (%rax)
jmp 0x7047
pushq $0x1
popq %rdi
pushq $0x68
popq %rsi
callq 0x3110
movl $0x9, (%rax)
addl $0x68, 0x12de9(%rip)    # 0x19dac
jmp 0x710c
pushq $0x1
popq %rdi
pushq $0x48
popq %rsi
callq 0x3110
movl $0x2, (%rax)
jmp 0x70eb
pushq $0x1
popq %rdi
pushq $0x48
popq %rsi
callq 0x3110
movl $0xf, (%rax)
jmp 0x70eb
pushq $0x1
popq %rdi
pushq $0x40
popq %rsi
callq 0x3110
movl $0x3, (%rax)
jmp 0x70a4
pushq $0x1
popq %rdi
pushq $0x48
popq %rsi
callq 0x3110
movl $0x7, (%rax)
jmp 0x70eb
pushq $0x1
popq %rdi
pushq $0x48
popq %rsi
callq 0x3110
movl $0x1, (%rax)
jmp 0x70eb
pushq $0x1
popq %rdi
pushq $0x58
popq %rsi
callq 0x3110
movl $0x11, (%rax)
addl $0x58, 0x12d5e(%rip)    # 0x19dac
jmp 0x710c
leaq 0x6d3f(%rip), %rdi      # 0xdd99
callq 0x6ec4
xorl %eax, %eax
jmp 0x710c
pushq $0x1
popq %rdi
pushq $0x40
popq %rsi
callq 0x3110
movl $0x5, (%rax)
jmp 0x70a4
pushq $0x1
popq %rdi
pushq $0x70
popq %rsi
callq 0x3110
movl $0xd, (%rax)
addl $0x70, 0x12d1b(%rip)    # 0x19dac
jmp 0x710c
pushq $0x1
popq %rdi
pushq $0x40
popq %rsi
callq 0x3110
movl $0x6, (%rax)
addl $0x40, 0x12d01(%rip)    # 0x19dac
jmp 0x710c
pushq $0x1
popq %rdi
pushq $0x60
popq %rsi
callq 0x3110
movl $0x12, (%rax)
addl $0x60, 0x12ce7(%rip)    # 0x19dac
jmp 0x710c
pushq $0x1
popq %rdi
pushq $0x50
popq %rsi
callq 0x3110
movl $0xa, (%rax)
jmp 0x7105
pushq $0x1
popq %rdi
pushq $0x48
popq %rsi
callq 0x3110
movl $0x8, (%rax)
addl $0x48, 0x12cba(%rip)    # 0x19dac
jmp 0x710c
pushq $0x1
popq %rdi
pushq $0x50
popq %rsi
callq 0x3110
movl $0x13, (%rax)
addl $0x50, 0x12ca0(%rip)    # 0x19dac
incl 0x12c96(%rip)           # 0x19da8
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/ast.c
// Function: get_next_ast_node
pAstNode get_next_ast_node(pAstNode p) {
    switch(p->base.node_type) {
        case ASTN_IDList: return ((IDListNode*)p)->next;
        case ASTN_IDTypeList: return ((IDTypeListNode*)p)->next;
        case ASTN_Module: return ((ModuleNode*)p)->next;
        case ASTN_Assn: return ((AssnNode*)p)->next;
        case ASTN_While: return ((WhileNode*)p)->next;
        case ASTN_For: return ((ForNode*)p)->next;
        case ASTN_Decl: return ((DeclNode*)p)->next;
        case ASTN_Input: return ((InputNode*)p)->next;
        case ASTN_Output: return ((OutputNode*)p)->next;
        case ASTN_FCall: return ((FCallNode*)p)->next;
        case ASTN_Switch: return ((SwitchNode*)p)->next;
        case ASTN_Case: return ((CaseNode*)p)->next;
        default:
            complain_ast_node_type(__func__, p->base.node_type);
            return NULL;
    }
}

// Assembly:
movl (%rdi), %esi
leal -0x7(%rsi), %eax
cmpl $0xc, %eax
ja 0x7138
leaq 0x6a67(%rip), %rcx      # 0xdb8c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x38(%rdi), %rax
retq
movq 0x48(%rdi), %rax
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x6c63(%rip), %rdi      # 0xdda6
callq 0x6ec4
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/ast.c
// Function: get_scope_beg_line
int get_scope_beg_line(pAstNode p) {
    if(p == NULL) {
        return 0;
    }
    switch(p->base.node_type) {
        case ASTN_Module: return ((ModuleNode*)p)->scope_beg_line;
        case ASTN_For: return ((ForNode*)p)->scope_beg_line;
        case ASTN_While: return ((WhileNode*)p)->scope_beg_line;
        case ASTN_Switch: return ((SwitchNode*)p)->scope_beg_line;
        default:
            complain_ast_node_type(__func__, p->base.node_type);
            return 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x7193
movl (%rdi), %esi
leal -0x9(%rsi), %eax
cmpl $0x9, %eax
ja 0x7187
leaq 0x6a56(%rip), %rcx      # 0xdbc0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x60(%rdi), %ebx
jmp 0x7193
movl 0x68(%rdi), %ebx
jmp 0x7193
movl 0x50(%rdi), %ebx
jmp 0x7193
movl 0x58(%rdi), %ebx
jmp 0x7193
leaq 0x6c2a(%rip), %rdi      # 0xddb8
callq 0x6ec4
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/ast.c
// Function: get_scope_end_line
int get_scope_end_line(pAstNode p) {
    if(p == NULL) {
        return 0;
    }
    switch(p->base.node_type) {
        case ASTN_Module: return ((ModuleNode*)p)->scope_end_line;
        case ASTN_For: return ((ForNode*)p)->scope_end_line;
        case ASTN_While: return ((WhileNode*)p)->scope_end_line;
        case ASTN_Switch: return ((SwitchNode*)p)->scope_end_line;
        default:
            complain_ast_node_type(__func__, p->base.node_type);
            return 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x71e3
movl (%rdi), %esi
leal -0x9(%rsi), %eax
cmpl $0x9, %eax
ja 0x71d7
leaq 0x6a2e(%rip), %rcx      # 0xdbe8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x64(%rdi), %ebx
jmp 0x71e3
movl 0x6c(%rdi), %ebx
jmp 0x71e3
movl 0x54(%rdi), %ebx
jmp 0x71e3
movl 0x5c(%rdi), %ebx
jmp 0x71e3
leaq 0x6bed(%rip), %rdi      # 0xddcb
callq 0x6ec4
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/ast_gen.c
// Function: read_children
int read_children(parse_tree_node** nodes, parse_tree_node* root) {
    //for(i=0; i<n; ++i) nodes[i] = NULL;
    if(root == NULL) return -1;
    root = root->first_child;
    int n;
    for(n=0; root != NULL; ++n) {
        nodes[n] = root;
        root = root->next_sibling;
    }
    nodes[n] = NULL;
    return n;
}

// Assembly:
testq %rsi, %rsi
je 0x7af5
pushq %rbp
movq %rsp, %rbp
addq $0x10, %rsi
xorl %eax, %eax
movq (%rsi), %rsi
testq %rsi, %rsi
je 0x7aec
movq %rsi, (%rdi,%rax,8)
addq $0x20, %rsi
incq %rax
jmp 0x7ad7
movl %eax, %ecx
andq $0x0, (%rdi,%rcx,8)
popq %rbp
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/ast_gen.c
// Function: ast_gen_main
int ast_gen_main(FILE* ifp, FILE* ofp, FILE* statsfp, int verbosity)
{
    gsymb_t start_symb = init_parser();

    parse_tree_node* proot = build_parse_tree(ifp, start_symb);
    int parse_tree_size = parse_tree_node_count * (sizeof(parse_tree_node) + sizeof(Symbol));
    if(verbosity > 0 && statsfp != NULL) {
        fprintf(statsfp, "Parse tree: %d nodes = %d bytes.\n", parse_tree_node_count, parse_tree_size);
    }
    pAstNode ast = NULL;
    int parse_errors = error_count;
    if(parse_errors == 0) {
        build_ast(proot);
        ast = proot->value->tree;
        if(verbosity >= 1 && statsfp != NULL) {
            fprintf(statsfp, "AST: %d nodes = %d bytes.\n", ast_node_count, ast_mem_allocd);
            fprintf(statsfp, "Compression percent: %lf\n",
                100 * ((float)parse_tree_size - ast_mem_allocd) / (parse_tree_size));
        }
    }
    parse_tree_destroy(proot);
    destroy_parser(false);

    if(parse_errors == 0 && ofp != NULL) {
        print_ast(ofp, ast, 0);
    }

    destroy_ast(ast);
    pch_int_hmap_clear(&intern_table);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r12d
movq %rdx, %r15
movq %rsi, -0x38(%rbp)
movq %rdi, %r14
xorl %eax, %eax
callq 0x5f58
movq %r14, %rdi
movl %eax, %esi
callq 0x675c
movq %rax, %r14
leaq 0x11769(%rip), %rax     # 0x19da4
movl (%rax), %edx
imull $0x70, %edx, %ebx
testl %r12d, %r12d
setg %al
testq %r15, %r15
setne %r13b
andb %al, %r13b
cmpb $0x1, %r13b
jne 0x8669
leaq 0x5a11(%rip), %rsi      # 0xe06e
movq %r15, %rdi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x3130
movl %ebx, -0x2c(%rbp)
leaq 0x11745(%rip), %rax     # 0x19db8
movl (%rax), %ebx
testl %ebx, %ebx
je 0x867e
xorl %r12d, %r12d
jmp 0x86ea
movq %r14, %rdi
callq 0x7afb
movq (%r14), %rax
movq 0x20(%rax), %r12
testb %r13b, %r13b
je 0x86ea
leaq 0x1170f(%rip), %rax     # 0x19da8
movl (%rax), %edx
leaq 0x1170a(%rip), %r13     # 0x19dac
movl (%r13), %ecx
leaq 0x59e3(%rip), %rsi      # 0xe090
movq %r15, %rdi
xorl %eax, %eax
callq 0x3130
cvtsi2ssl -0x2c(%rbp), %xmm0
cvtsi2ssl (%r13), %xmm1
movaps %xmm0, %xmm2
subss %xmm1, %xmm2
mulss 0x596f(%rip), %xmm2     # 0xe040
divss %xmm0, %xmm2
cvtss2sd %xmm2, %xmm0
leaq 0x59cb(%rip), %rsi      # 0xe0ab
movq %r15, %rdi
movb $0x1, %al
callq 0x3130
testl %ebx, %ebx
setne %bl
movq %r14, %rdi
callq 0x6d9f
xorl %edi, %edi
callq 0x6109
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
sete %al
orb %bl, %al
jne 0x8716
movq %r12, %rsi
xorl %edx, %edx
callq 0x71ec
movq %r12, %rdi
callq 0x79c0
leaq 0xd573(%rip), %rdi      # 0x15c98
callq 0x338a
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/symbol_table.c
// Function: pSTEntry_print
void pSTEntry_print(pSTEntry p, FILE* fp)
{
    fprintf(fp, "STEntry(%s: %s", p->lexeme, TYPE_STRS[p->addr->type]);
    if(p->addr->size > 0)
        fprintf(fp, "[%d]", p->addr->size);
    fprintf(fp, ", %d:%d, %d)", p->addr->line, p->addr->col, p->addr->offset);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdx
movq 0x28(%rdi), %rax
movl 0x18(%rax), %eax
leaq 0xc294(%rip), %rcx      # 0x14bc0
movq (%rcx,%rax,8), %rcx
leaq 0x57b6(%rip), %rsi      # 0xe0ed
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3130
movq 0x28(%r14), %rax
movl 0x1c(%rax), %edx
testl %edx, %edx
jle 0x8961
leaq 0x57b8(%rip), %rsi      # 0xe10b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3130
movq 0x28(%r14), %rax
movl 0x20(%rax), %edx
movl 0x24(%rax), %ecx
movl 0x28(%rax), %r8d
leaq 0x578a(%rip), %rsi      # 0xe0fc
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x3130
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/symbol_table.c
// Function: pSTEntry_print_sub
void pSTEntry_print_sub(pSTEntry p, FILE* fp) {
    char type_str[10] = "";
    if(p->addr->size == 0)
        sprintf(type_str, "%s", TYPE_STRS[p->addr->type]);
    else
        sprintf(type_str, "%s[%d]", TYPE_STRS[p->addr->type], p->addr->size);
    int beg_line = p->addr->symbol_table->scope_beg_line;
    int end_line = p->addr->symbol_table->scope_end_line;
    const char* func_name = p->func_name == NULL ? "driver" : p->func_name;
    fprintf(fp, "%-10s %-12s %-10s %3d to %3d %6d %6d %7d\n", p->lexeme, type_str, func_name, beg_line, end_line,
        p->addr->symbol_table->level, get_type_width(p->addr->type, p->addr->size), p->addr->offset);
    //pSTEntry_print(p, fp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
andw $0x0, -0x30(%rbp)
andq $0x0, -0x38(%rbp)
movq %rsi, -0x50(%rbp)
movq %rdi, %r14
movq 0x28(%rdi), %rbx
movl 0x18(%rbx), %r15d
movl 0x1c(%rbx), %ecx
leaq 0xc20c(%rip), %rax      # 0x14bc0
movq (%rax,%r15,8), %rdx
testl %ecx, %ecx
je 0x89db
leaq 0x5746(%rip), %rsi      # 0xe109
leaq -0x38(%rbp), %rdi
xorl %eax, %eax
callq 0x31a0
movq 0x28(%r14), %rbx
movl 0x18(%rbx), %r15d
movl 0x1c(%rbx), %esi
jmp 0x89e9
leaq -0x38(%rbp), %rdi
movq %rdx, %rsi
callq 0x3060
xorl %esi, %esi
movq 0x8(%rbx), %rax
movl 0x38(%rax), %ecx
movq %rcx, -0x48(%rbp)
movl 0x3c(%rax), %r12d
movl 0x40(%rax), %eax
movq %rax, -0x40(%rbp)
movq (%r14), %r13
movq 0x8(%r14), %rax
testq %rax, %rax
leaq 0x4a61(%rip), %rbx      # 0xd471
cmovneq %rax, %rbx
movl %r15d, %edi
callq 0xb07c
movl %eax, %r10d
movq 0x28(%r14), %rax
movl 0x28(%rax), %r11d
leaq 0x56e2(%rip), %rsi      # 0xe110
leaq -0x38(%rbp), %rcx
movq -0x50(%rbp), %rdi
movq %r13, %rdx
movq %rbx, %r8
movl %r12d, %r9d
xorl %eax, %eax
pushq %r11
pushq %r10
pushq -0x48(%rbp)
pushq -0x40(%rbp)
callq 0x3130
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/symbol_table.c
// Function: ST_init
void ST_init(pST pst, struct AstNode* scope, int level) {
    ST_hmap_init(&(pst->vmap), 10, false);
    AddrList_init(&(pst->addrs));
    pst->scope = scope;
    pst->scope_beg_line = get_scope_beg_line(scope);
    pst->scope_end_line = get_scope_end_line(scope);
    pst->beg_offset = pst->end_offset = pst->max_offset = 0;
    pst->level = level;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
pushq $0xa
popq %rsi
xorl %edx, %edx
callq 0x8ae0
leaq 0x18(%r15), %rdi
callq 0xaf36
movq %r14, 0x30(%r15)
movq %r14, %rdi
callq 0x714c
movl %eax, 0x3c(%r15)
movq %r14, %rdi
callq 0x719c
movl %eax, 0x40(%r15)
andl $0x0, 0x4c(%r15)
andq $0x0, 0x44(%r15)
movl %ebx, 0x38(%r15)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/symbol_table.c
// Function: ST_print
void ST_print(pST p, FILE* fp)
{
    fprintf(fp, "SymbolTable(off=%d:%d, maxoff=%d):\n", p->beg_offset, p->end_offset, p->max_offset);
    ST_hmap_print(&(p->vmap), fp);
    fprintf(fp, "AddrList:\n");
    AddrList_print(&(p->addrs), fp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0x44(%rdi), %edx
movl 0x48(%rdi), %ecx
movl 0x4c(%rdi), %r8d
leaq 0x523a(%rip), %rsi      # 0xe13a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3130
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8db5
leaq 0x5242(%rip), %rdi      # 0xe15e
pushq $0xa
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x31c0
addq $0x18, %r14
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0xb03a
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/symbol_table.c
// Function: ST_clear
void ST_clear(pST p)
{
    ST_hmap_clear(&(p->vmap));
    AddrList_clear(&(p->addrs));
    p->scope = NULL;
    p->level = 0;
    p->beg_offset = p->end_offset = p->max_offset = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x8b1d
leaq 0x18(%rbx), %rdi
callq 0xaf46
andq $0x0, 0x30(%rbx)
andl $0x0, 0x38(%rbx)
andl $0x0, 0x4c(%rbx)
andq $0x0, 0x44(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/symbol_table.c
// Function: SD_init
void SD_init(pSD psd) {
    psd->level = 0;
    psd->offset = 0;
#ifdef LOG_MEM
    fprintf(stderr, "Called %s(%p)\n", __func__, (void*)psd);
#endif

    pST pst = malloc(sizeof(ST));
#ifdef LOG_MEM
    fprintf(stderr, "%s: Allocated ST %p\n", __func__, (void*)pst);
#endif
    ST_init(pst, NULL, 0);
    psd->root = psd->active = ST_tree_get_node(pst);
    psd->first_entry = psd->last_entry = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
andq $0x0, 0x10(%rdi)
pushq $0x50
popq %rdi
callq 0x3140
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x8e88
movq %r14, %rdi
callq 0x8f89
movq %rax, 0x8(%rbx)
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/symbol_table.c
// Function: SD_add_entry
bool SD_add_entry(pSD psd, pSTEntry pentry, int line, int col) {
    // pentry->addr is not yet initialized
    if(psd->active == NULL) {
        fprintf(stderr, "%s: No SymbolTable present in stack.\n", __func__);
        return false;
    }
    pST pst = psd->active->value;

    int old_size = pst->vmap.size;
    ST_hmap_node* node = ST_hmap_insert(&(pst->vmap), pentry->lexeme, pentry);
    if(pst->vmap.size == old_size) {
        char msg[80];
        sprintf(msg, "Variable has already been declared at line %d col %d.", node->value->addr->line, node->value->addr->col);
        print_error("semantic", ERROR, -1, line, col, pentry->lexeme, "ALREADY_DECL", msg);
        return false;
    }

    if(psd->first_entry == NULL) {
        psd->first_entry = psd->last_entry = pentry;
    }
    else {
        psd->last_entry->next = pentry;
        psd->last_entry = pentry;
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x924f
movq %rsi, %r14
movq %rdi, %r12
movl %edx, %r15d
movl %ecx, -0x2c(%rbp)
movq (%rax), %r13
movl 0xc(%r13), %ebx
movq (%rsi), %rsi
movq %r13, %rdi
movq %r14, %rdx
callq 0x8c24
cmpl %ebx, 0xc(%r13)
jne 0x9218
movq 0x10(%rax), %rax
movq 0x28(%rax), %rax
movl 0x20(%rax), %edx
movl 0x24(%rax), %ecx
leaq 0x4fbe(%rip), %rsi      # 0xe19c
xorl %r12d, %r12d
leaq -0x80(%rbp), %r13
movq %r13, %rdi
xorl %eax, %eax
callq 0x31a0
movq (%r14), %r9
leaq 0x4fe2(%rip), %rax      # 0xe1db
leaq 0x4fd2(%rip), %rdi      # 0xe1d2
pushq $-0x1
popq %rdx
xorl %esi, %esi
movl %r15d, %ecx
movl -0x2c(%rbp), %r8d
pushq %r13
pushq %rax
callq 0x873c
popq %rax
popq %rcx
jmp 0x923d
cmpq $0x0, 0x18(%r12)
je 0x9230
movq 0x20(%r12), %rax
movq %r14, 0x20(%rax)
movq %r14, 0x20(%r12)
jmp 0x923a
movq %r14, 0x20(%r12)
movq %r14, 0x18(%r12)
movb $0x1, %r12b
movl %r12d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xada2(%rip), %rax      # 0x13ff8
movq (%rax), %rdi
leaq 0x4f09(%rip), %rsi      # 0xe169
leaq 0x4f28(%rip), %rdx      # 0xe18f
xorl %r12d, %r12d
xorl %eax, %eax
callq 0x3130
jmp 0x923d
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/symbol_table.c
// Function: SD_add_addr
bool SD_add_addr(pSD psd, AddrNode* an) {
    if(psd->active == NULL) {
        fprintf(stderr, "%s: No SymbolTable present in stack.\n", __func__);
        return false;
    }
    pST pst = psd->active->value;

    if(pst->addrs.last == NULL) {
        an->id = 0;
    }
    else {
        an->id = pst->addrs.last->id + 1;
    }

    AddrList_add(&(pst->addrs), an);

    if(an->addr_type != ADDR_CONST) {
        an->offset = get_aligned_offset(psd->offset, an->type);
        psd->offset = an->offset + get_type_width(an->type, an->size);
        if((psd->offset) > (pst->max_offset)) {
            pst->max_offset = psd->offset;
        }
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x8(%rdi), %r12
testq %r12, %r12
je 0x9302
movq %rsi, %r14
movq %rdi, %rbx
movq (%r12), %r13
leaq 0x18(%r13), %rdi
movq 0x20(%r13), %rax
testq %rax, %rax
je 0x92a8
movl 0x10(%rax), %eax
incl %eax
jmp 0x92aa
xorl %eax, %eax
movl %eax, 0x10(%r14)
movq %r14, %rsi
callq 0xaf74
cmpl $0x2, 0x14(%r14)
je 0x92ed
movl 0x14(%rbx), %edi
movl 0x18(%r14), %esi
callq 0xb097
movl %eax, %r15d
movl %eax, 0x28(%r14)
movl 0x18(%r14), %edi
movl 0x1c(%r14), %esi
callq 0xb07c
addl %r15d, %eax
movl %eax, 0x14(%rbx)
cmpl 0x4c(%r13), %eax
jle 0x92ed
movl %eax, 0x4c(%r13)
testq %r12, %r12
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xacef(%rip), %rax      # 0x13ff8
movq (%rax), %rdi
leaq 0x4e56(%rip), %rsi      # 0xe169
leaq 0x4ece(%rip), %rdx      # 0xe1e8
xorl %eax, %eax
callq 0x3130
jmp 0x92ed
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/symbol_table.c
// Function: SD_get_entry
pSTEntry SD_get_entry(pSD psd, const char* lexeme) {
    ST_tree_node* n = psd->active;
    ST_hmap_node* res = NULL;
    while(n != NULL && res == NULL) {
        res = ST_hmap_query(&(n->value->vmap), lexeme);
        n = n->parent;
    }
    if(res == NULL)
        return NULL;
    else
        return res->value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %eax, %eax
movq 0x8(%r14), %r14
testq %r14, %r14
je 0x934d
testq %rax, %rax
jne 0x934d
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x8b82
jmp 0x9332
testq %rax, %rax
je 0x9358
movq 0x10(%rax), %rax
jmp 0x935a
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/symbol_table.c
// Function: SD_add_scope
void SD_add_scope(pSD psd, pAstNode scope) {
    pST pst = malloc(sizeof(ST));
#ifdef LOG_MEM
    fprintf(stderr, "%s: Allocated ST %p\n", __func__, (void*)pst);
#endif
    ST_init(pst, scope, ++(psd->level));
    ST_tree_insert(psd->active, pst);
    psd->active = psd->active->last_child;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x50
popq %rdi
callq 0x3140
movq %rax, %r15
movl 0x10(%r14), %edx
incl %edx
movl %edx, 0x10(%r14)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x8e88
movq 0x8(%r14), %rdi
movq %r15, %rsi
callq 0x8fe2
movq 0x8(%r14), %rax
movq 0x18(%rax), %rax
movq %rax, 0x8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/symbol_table.c
// Function: SD_remove_scope
void SD_remove_scope(pSD psd) {
    ST_tree_node* parent = psd->active->parent;
    if(parent != NULL) {
        int pmo = parent->value->max_offset;
        int mo = psd->active->value->max_offset;
        if(mo > pmo) {pmo = mo;}
        parent->value->max_offset = pmo;
    }
    psd->active = parent;
    psd->level--;
    if(parent->parent == NULL) {   // if now root is active
        psd->offset = 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %rcx
movq 0x8(%rcx), %rax
testq %rax, %rax
je 0x93e7
movq (%rax), %rdx
movl 0x4c(%rdx), %esi
movq (%rcx), %rcx
movl 0x4c(%rcx), %ecx
cmpl %esi, %ecx
cmovgl %ecx, %esi
movl %esi, 0x4c(%rdx)
movq %rax, 0x8(%rdi)
decl 0x10(%rdi)
cmpq $0x0, 0x8(%rax)
jne 0x93f9
andl $0x0, 0x14(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/symbol_table.c
// Function: SD_print_sub
void SD_print_sub(pSD psd, FILE* fp) {
    fprintf(stderr, "%-10s %-12s %-10s %-10s %6s %6s %7s\n",
        "lexeme", "type", "scope", "lines", "level", "width", "offset");
    for(pSTEntry node = psd->first_entry; node != NULL; node = node->next) {
        pSTEntry_print_sub(node, stderr);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xabb5(%rip), %r14      # 0x13ff8
movq (%r14), %rdi
subq $0x8, %rsp
leaq 0x4de7(%rip), %r10      # 0xe238
leaq 0x4dda(%rip), %r11      # 0xe232
leaq 0x4dcd(%rip), %r15      # 0xe22c
leaq 0x4d8e(%rip), %rsi      # 0xe1f4
leaq 0x4dac(%rip), %rdx      # 0xe219
leaq 0x43d4(%rip), %rcx      # 0xd848
leaq 0x4da5(%rip), %r8       # 0xe220
leaq 0x4da4(%rip), %r9       # 0xe226
xorl %eax, %eax
pushq %r10
pushq %r11
pushq %r15
callq 0x3130
addq $0x20, %rsp
addq $0x18, %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x94b0
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x8980
addq $0x20, %rbx
jmp 0x9497
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/compiler.c
// Function: get_composite_type
valtype_t get_composite_type(op_t op, valtype_t type1, valtype_t type2, int line, int col) {
    if(type1 == TYPE_ERROR || type2 == TYPE_ERROR)
        return TYPE_ERROR;
    if(type1 != type2) {
        print_type_error(op, type1, type2, line, col);
        return TYPE_ERROR;
    }
    switch(op) {
        case OP_PLUS:
        case OP_MINUS:
        case OP_MUL:
        case OP_DIV:
            if(type1 == TYPE_INTEGER || type1 == TYPE_REAL)
                return type1;
            else
                print_type_error(op, type1, type2, line, col);
            break;
        /*
        case OP_DIV:
            if(type1 == TYPE_INTEGER || type1 == TYPE_REAL)
                return TYPE_REAL;
            else
                print_type_error(op, type1, type2, line, col);
            break;
        */
        case OP_GT:
        case OP_LT:
        case OP_GE:
        case OP_LE:
        case OP_EQ:
        case OP_NE:
            if(type1 == TYPE_INTEGER || type1 == TYPE_REAL)
                return TYPE_BOOLEAN;
            else
                print_type_error(op, type1, type2, line, col);
            break;
        case OP_AND:
        case OP_OR:
            if(type1 == TYPE_BOOLEAN)
                return TYPE_BOOLEAN;
            else
                print_type_error(op, type1, type2, line, col);
            break;
        default:
            fprintf(stderr, "Invalid operand %d\n", op);
    }
    return TYPE_ERROR;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %eax
testl %esi, %esi
sete %dil
testl %edx, %edx
sete %r9b
xorl %ebx, %ebx
orb %dil, %r9b
jne 0x99ec
cmpl %edx, %esi
jne 0x99bf
cmpl $0xb, %eax
ja 0x99f5
movl $0xfc, %edx
btl %eax, %edx
jae 0x99c3
leal -0x1(%rsi), %edx
cmpl $0x2, %edx
jb 0x99de
jmp 0x99e3
movl %eax, %edi
jmp 0x99e7
movl $0x303, %edx            # imm = 0x303
btl %eax, %edx
jae 0x99d9
leal -0x1(%rsi), %edx
cmpl $0x2, %edx
jae 0x99e3
movl %esi, %ebx
jmp 0x99ec
cmpl $0x3, %esi
jne 0x99e3
pushq $0x3
popq %rbx
jmp 0x99ec
movl %eax, %edi
movl %esi, %edx
callq 0x98d9
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0xa5fc(%rip), %rcx      # 0x13ff8
movq (%rcx), %rdi
leaq 0x4914(%rip), %rsi      # 0xe31a
xorl %ebx, %ebx
movl %eax, %edx
xorl %eax, %eax
callq 0x3130
jmp 0x99ec
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/compiler.c
// Function: add_node_addr_to_SD
AddrNode* add_node_addr_to_SD(pAstNode node, pSD psd, addr_type_t addr_type) {
    AddrNode* anode = malloc(sizeof(AddrNode));
#ifdef LOG_MEM
    fprintf(stderr, "%s: Allocated AddrNode %p\n", __func__, (void*)anode);
#endif
    anode->next = NULL;
    anode->symbol_table = (psd->active)->value;
    anode->id = 0;
    anode->addr_type = addr_type;
    anode->type = node->base.type;
    anode->size = node->base.size;
    anode->line = node->base.line;
    anode->col = node->base.col;
    anode->offset = 0;
    SD_add_addr(psd, anode);
    return anode;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
pushq $0x40
popq %rdi
callq 0x3140
movq %rax, %r12
andq $0x0, (%rax)
movq 0x8(%r14), %rax
movq (%rax), %rax
movq %rax, 0x8(%r12)
andl $0x0, 0x10(%r12)
movl %ebx, 0x14(%r12)
movl 0x4(%r15), %eax
movl %eax, 0x18(%r12)
movl 0x8(%r15), %eax
movl %eax, 0x1c(%r12)
movl 0xc(%r15), %eax
movl %eax, 0x20(%r12)
movl 0x10(%r15), %eax
movl %eax, 0x24(%r12)
andl $0x0, 0x28(%r12)
movq %r14, %rdi
movq %r12, %rsi
callq 0x9273
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/compiler.c
// Function: add_node_var_to_SD
void add_node_var_to_SD(pAstNode node, pSD psd, const char* func_name) {
    pSTEntry entry = malloc(sizeof(STEntry));
#ifdef LOG_MEM
    fprintf(stderr, "%s: Allocated STEntry %p\n", __func__, (void*)entry);
#endif
    entry->func_name = func_name;
    entry->use_line = 0;
    entry->use_col = 0;
    entry->readonly = false;
    entry->next = NULL;
    entry->addr = NULL;
    if(node->base.node_type == ASTN_IDList) {
        entry->lexeme = ((IDListNode*)node)->varname;
    }
    else if(node->base.node_type == ASTN_IDTypeList) {
        entry->lexeme = ((IDTypeListNode*)node)->varname;
    }
    else {
        entry->lexeme = NULL;
    }
    int line = node->base.line, col = node->base.col;
    if(!SD_add_entry(psd, entry, line, col)) {
        free(entry);
#ifdef LOG_MEM
        fprintf(stderr, "%s: Freed STEntry %p\n", __func__, (void*)entry);
#endif
    }
    else {
        entry->addr = add_node_addr_to_SD(node, psd, ADDR_VAR);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r15
pushq $0x30
popq %rdi
callq 0x3140
movq %rax, %r14
movq %r12, 0x8(%rax)
andq $0x0, 0x10(%rax)
movb $0x0, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movl (%r15), %eax
addl $-0x7, %eax
cmpl $0x1, %eax
ja 0xa812
movq 0x40(%r15), %rax
jmp 0xa814
xorl %eax, %eax
movq %rax, (%r14)
movl 0xc(%r15), %edx
movl 0x10(%r15), %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9184
testb %al, %al
je 0xa848
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0xa754
movq %rax, 0x28(%r14)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3030
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/compiler.c
// Function: log_var_set
void log_var_set(pSTEntry entry, int line, int col) {
    if(entry->readonly == true) {
        sprintf(msg, "Cannot modify read-only variable '%s' (declared at line %d, col %d).",
            entry->lexeme, entry->addr->line, entry->addr->col);
        print_error("type", ERROR, -1, line, col, entry->lexeme, "RDONLY_MOD", msg);
    }
    entry->use_line = line;
    entry->use_col = col;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movl %esi, %r15d
movq %rdi, %r14
cmpb $0x1, 0x18(%rdi)
jne 0xa8bd
movq (%r14), %rdx
movq 0x28(%r14), %rax
movl 0x20(%rax), %ecx
movl 0x24(%rax), %r8d
leaq 0xf54a(%rip), %r12      # 0x19dd0
leaq 0x3aa1(%rip), %rsi      # 0xe32e
movq %r12, %rdi
xorl %eax, %eax
callq 0x31a0
movq (%r14), %r9
leaq 0x3ad2(%rip), %rax      # 0xe373
leaq 0x2fa0(%rip), %rdi      # 0xd848
pushq $-0x1
popq %rdx
xorl %esi, %esi
movl %r15d, %ecx
movl %ebx, %r8d
pushq %r12
pushq %rax
callq 0x873c
popq %rax
popq %rcx
movl %r15d, 0x10(%r14)
movl %ebx, 0x14(%r14)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/addr.c
// Function: AddrList_clear
void AddrList_clear(AddrList* al) {
    AddrNode* an = al->first;
    AddrNode* tn2 = NULL;
    for(; an != NULL; an = tn2) {
        tn2 = an->next;
        AddrNode_destroy(an);
    }
    al->first = al->last = NULL;
    al->size = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0xaf65
movq (%rdi), %r14
callq 0x3030
movq %r14, %rdi
jmp 0xaf53
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
andl $0x0, 0x10(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/addr.c
// Function: AddrList_add
void AddrList_add(AddrList* al, AddrNode* an) {
    if(an != NULL) {
        (al->size)++;
        if(al->first == NULL) {
            al->first = an;
        }
        else {
            al->last->next = an;
        }
        al->last = an;
    }
}

// Assembly:
testq %rsi, %rsi
je 0xaf95
incl 0x10(%rdi)
cmpq $0x0, (%rdi)
movq %rdi, %rax
je 0xaf89
movq 0x8(%rdi), %rax
pushq %rbp
movq %rsp, %rbp
movq %rsi, (%rax)
movq %rsi, 0x8(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/addr.c
// Function: AddrNode_print
void AddrNode_print(const AddrNode* an, FILE* fp) {
    if(an == NULL) {
        fprintf(fp, "null");
    }
    else {
        fprintf(fp, "AddrNode(%d, %d:%d, %s %s", an->id, an->line, an->col, ADDR_TYPE_STRS[an->addr_type],
            TYPE_STRS[an->type]);
        if(an->size > 0) {
            fprintf(fp, "[%d]", an->size);
        }
        fprintf(fp, ", %d)", an->offset);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
testq %rdi, %rdi
je 0xb01d
movq %rdi, %r14
movl 0x20(%rdi), %ecx
movl 0x24(%rdi), %r8d
movl 0x10(%rdi), %edx
movl 0x14(%rdi), %eax
leaq 0x9b20(%rip), %rsi      # 0x14ae0
movq (%rsi,%rax,8), %r9
movl 0x18(%rdi), %eax
leaq 0x9bf2(%rip), %rsi      # 0x14bc0
movq (%rsi,%rax,8), %rax
movq %rax, (%rsp)
leaq 0x3b0d(%rip), %rsi      # 0xeaea
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3130
movl 0x1c(%r14), %edx
testl %edx, %edx
jle 0xb000
leaq 0x3115(%rip), %rsi      # 0xe10b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3130
movl 0x28(%r14), %edx
leaq 0x30f8(%rip), %rsi      # 0xe103
movq %rbx, %rdi
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x3130
leaq 0x3ac1(%rip), %rdi      # 0xeae5
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x31c0
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/addr.c
// Function: AddrList_print
void AddrList_print(const AddrList* al, FILE* fp) {
    AddrNode* an = al->first;
    for(; an != NULL; an = an->next) {
        AddrNode_print(an, fp);
        fprintf(fp, "\n");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0xa
popq %r15
movq (%r14), %r14
testq %r14, %r14
je 0xb06e
movq %r14, %rdi
movq %rbx, %rsi
callq 0xaf96
movl %r15d, %edi
movq %rbx, %rsi
callq 0x3100
jmp 0xb04e
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/type.c
// Function: get_aligned_offset
int get_aligned_offset(int offset, valtype_t type) {
    int align_size = TYPE_ALIGNS[type];
    int t = offset % align_size;
    if(t != 0)
        offset += (align_size - t);
    return offset;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %esi, %eax
leaq 0x9b4c(%rip), %rcx      # 0x14bf0
movl (%rcx,%rax,4), %ecx
movl %edi, %eax
cltd
idivl %ecx
subl %edx, %ecx
testl %edx, %edx
cmovel %edx, %ecx
addl %edi, %ecx
movl %ecx, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/type.c
// Function: get_type_str
void get_type_str(char* str, valtype_t type, int size) {
    if(size == 0)
        sprintf(str, "%s", TYPE_STRS[type]);
    else
        sprintf(str, "%s[%d]", TYPE_STRS[type], size);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edx, %ecx
movl %esi, %eax
leaq 0x9af8(%rip), %rdx      # 0x14bc0
movq (%rdx,%rax,8), %rdx
testl %ecx, %ecx
je 0xb0df
leaq 0x3032(%rip), %rsi      # 0xe109
xorl %eax, %eax
popq %rbp
jmp 0x31a0
movq %rdx, %rsi
popq %rbp
jmp 0x3060
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/ircode.c
// Function: irinstr_init2
void irinstr_init2(IRInstr* instr, op_t op, AddrNode* res, AddrNode* arg1, AddrNode* arg2) {
    irinstr_init(instr, op);
    instr->arg1 = arg1;
    instr->arg2 = arg2;
    instr->res = res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %esi, (%rdi)
xorps %xmm0, %xmm0
andl $0x0, 0x30(%rdi)
movups %xmm0, 0x20(%rdi)
movq %rcx, 0x8(%rdi)
movq %r8, 0x10(%rdi)
movq %rdx, 0x18(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/ircode.c
// Function: irinstr_new
IRInstr* irinstr_new(op_t op) {
    IRInstr* p = malloc(sizeof(IRInstr));
#ifdef LOG_MEM
    fprintf(stderr, "%s: Allocated IRInstr %p\n", __func__, (void*)p);
#endif
    irinstr_init(p, op);
    return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
pushq $0x38
popq %rdi
callq 0x3140
movl %ebx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movups %xmm0, 0x18(%rax)
movups %xmm0, 0x24(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/ircode.c
// Function: irinstr_new2
IRInstr* irinstr_new2(op_t op, AddrNode* res, AddrNode* arg1, AddrNode* arg2) {
    IRInstr* p = malloc(sizeof(IRInstr));
#ifdef LOG_MEM
    fprintf(stderr, "%s: Allocated IRInstr %p\n", __func__, (void*)p);
#endif
    irinstr_init2(p, op, res, arg1, arg2);
    return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %r12d
pushq $0x38
popq %rdi
callq 0x3140
movl %r12d, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
andl $0x0, 0x30(%rax)
movq %r14, 0x8(%rax)
movq %rbx, 0x10(%rax)
movq %r15, 0x18(%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sharmaeklavya2[P]cerplag/ircode.c
// Function: irinstr_new3
IRInstr* irinstr_new3(op_t op, int label) {
    IRInstr* p = malloc(sizeof(IRInstr));
#ifdef LOG_MEM
    fprintf(stderr, "%s: Allocated IRInstr %p\n", __func__, (void*)p);
#endif
    irinstr_init3(p, op, label);
    return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movl %edi, %r14d
pushq $0x38
popq %rdi
callq 0x3140
movl %r14d, (%rax)
xorps %xmm0, %xmm0
andq $0x0, 0x28(%rax)
movups %xmm0, 0x8(%rax)
movups %xmm0, 0x18(%rax)
movl %ebx, 0x30(%rax)
popq %rbx
popq %r14
popq %rbp
retq