LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/lexer.c
// Function: get_token
void get_token(FILE* fp, Dfa* pdfa, Token* ptok, bool debug)
{
    while(true)
    {
        char ch = get_character(fp);
        if(ch == '\0')
        {
            ptok->line = pdfa->line;
            ptok->col = pdfa->col;
            ptok->lexeme[0] = '\0';
            ptok->size = 0;
            ptok->tid = T_EOF;
            break;
        }
        else if(tick_dfa(ch, pdfa, ptok, debug))
        {
            post_process(pdfa, ptok);
            break;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movzbl %cl, %r12d
movq %r15, %rdi
callq 0x5325
testb %al, %al
je 0x5a18
movsbl %al, %edi
movq %r14, %rsi
movq %rbx, %rdx
movl %r12d, %ecx
callq 0x5922
testb %al, %al
je 0x59e4
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x582b
movl 0x4(%r14), %eax
movl %eax, (%rbx)
movl 0x8(%r14), %eax
movl %eax, 0x4(%rbx)
movq 0x8(%rbx), %rax
movb $0x0, (%rax)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x14(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/lexer.c
// Function: print_token
void print_token(const Token* ptok, FILE* fp)
{
    fprintf(fp, "%2d %2d %s %s", ptok->line, ptok->col, TOK_STRS[ptok->tid], ptok->lexeme);
    if(ptok->tid == T_NUM)
        fprintf(fp, " %d\n", ptok->i);
    else if(ptok->tid == T_RNUM)
        fprintf(fp, " %lf\n", ptok->f);
    else
        fprintf(fp, "\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl (%rdi), %edx
movl 0x4(%rdi), %ecx
movslq 0x18(%rdi), %rax
leaq 0xf720(%rip), %rsi      # 0x15180
movq (%rsi,%rax,8), %r8
movq 0x8(%rdi), %r9
leaq 0x8c0d(%rip), %rsi      # 0xe67c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3140
movl 0x18(%r14), %eax
cmpl $0x4, %eax
je 0x5aa0
cmpl $0x3, %eax
jne 0x5abb
movl 0x1c(%r14), %edx
leaq 0x8c48(%rip), %rsi      # 0xe6da
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x3140
cvtss2sd 0x1c(%r14), %xmm0
leaq 0x9612(%rip), %rsi      # 0xf0bf
movq %rbx, %rdi
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
jmp 0x3140
movl $0xa, %edi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x3110
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/lexer.c
// Function: print_source_without_comments
void print_source_without_comments(FILE * ifp, FILE * ofp){
    int state = 0;
    char ch = get_character(ifp);
    int bch;
    int transition_mat[][4] = {{0,1},{0,2},{2,3},{2,0}};
    int action_mat[][4] = {{1,0},{2,0},{0,0},{0,0}};
    while(ch != '\0'){
        if(ch == '*') bch = 1;
        else bch = 0;
        if(action_mat[state][bch] == 0);
        else if(action_mat[state][bch] == 1) put_character(ofp, ch);
        else if(action_mat[state][bch] == 2){
            put_character(ofp, '*');
            put_character(ofp, ch);
        }
        state = transition_mat[state][bch];
        ch = get_character(ifp);
    }
    put_character(ofp,ch);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x5325
movl %eax, %r15d
xorps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
movaps %xmm0, -0x60(%rbp)
movaps %xmm0, -0x50(%rbp)
movaps %xmm0, -0x40(%rbp)
movl $0x1, %eax
movl %eax, -0x6c(%rbp)
movl $0x2, %ecx
movl %ecx, -0x5c(%rbp)
movabsq $0x300000002, %rdx      # imm = 0x300000002
movq %rdx, -0x50(%rbp)
movl %ecx, -0x40(%rbp)
movaps %xmm0, -0xb0(%rbp)
movaps %xmm0, -0xa0(%rbp)
movaps %xmm0, -0x80(%rbp)
movaps %xmm0, -0x90(%rbp)
movl %eax, -0xb0(%rbp)
movl %ecx, -0xa0(%rbp)
xorl %r13d, %r13d
movl $0x1, %r12d
cmpb $0x2a, %r15b
je 0x5c7b
movzbl %r15b, %eax
testl %eax, %eax
je 0x5cd0
xorl %r12d, %r12d
movslq %r13d, %r13
shlq $0x4, %r13
leaq -0xb0(,%r13), %rax
addq %rbp, %rax
movl (%rax,%r12,4), %eax
cmpl $0x1, %eax
je 0x5ca8
cmpl $0x2, %eax
jne 0x5cb4
movq %rbx, %rdi
movl $0x2a, %esi
callq 0x5385
movsbl %r15b, %esi
movq %rbx, %rdi
callq 0x5385
leaq -0x70(,%r13), %rax
addq %rbp, %rax
movl (%rax,%r12,4), %r13d
movq %r14, %rdi
callq 0x5325
movl %eax, %r15d
jmp 0x5c64
movq %rbx, %rdi
xorl %esi, %esi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5385
nop
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/parser.c
// Function: get_nt_id
int get_nt_id(gsymb_t s){
    if(s < 0)
        fprintf(stderr, "get_nt_id: got -ve input %d.\n", s);
    else if(s < (int)NUM_TOKENS)
        fprintf(stderr, "get_nt_id: got terminal input %d.\n", s);
    else if(s >= (int)NUM_GS)
        fprintf(stderr, "get_nt_id: got too big input %d.\n", s);
    else
        return s - NUM_TOKENS;
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, %eax
cmpl $0x39, %edi
jbe 0x5d1c
cmpl $0x70, %eax
jae 0x5d2f
addl $-0x3a, %eax
popq %rbp
retq
movq 0xf2d5(%rip), %rcx      # 0x14ff8
movq (%rcx), %rdi
leaq 0x8a03(%rip), %rsi      # 0xe730
jmp 0x5d40
movq 0xf2c2(%rip), %rcx      # 0x14ff8
movq (%rcx), %rdi
leaq 0x8a13(%rip), %rsi      # 0xe753
movl %eax, %edx
xorl %eax, %eax
callq 0x3140
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x5d1a
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/parser.c
// Function: copy_symbol
void copy_symbol(Symbol* symb, const Token* tok)
{
    symb->line = tok->line;
    symb->col = tok->col;
    symb->sid = tok->tid;
    symb->f = tok->f;
    symb->tree = symb->next = symb->driver = NULL;
    int sid = symb->sid;
    if(sid == T_ERR || sid == T_EOF) {
        symb->lexeme = NULL;
        fprintf(stderr, "copy_symbol: Bad token type assigned to a symbol\n");
    }
    else if(sid == T_ID) {
        pch_int_hmap_node* pnode = pch_int_hmap_insert(&intern_table, tok->lexeme, intern_counter);
        if(pnode->key == tok->lexeme) {
            // this means the lexeme wasn't already present in intern_table
            symb->lexeme = malloc(sizeof(char) * (tok->size + 1));
            strcpy(symb->lexeme, tok->lexeme);
            pnode->key = symb->lexeme;
            intern_counter++;
            //fprintf(stderr, "new insert %p(\"%s\"): %d\n", pnode->key, pnode->key, pnode->value);
        }
        else {
            symb->lexeme = (char*)pnode->key;
            //fprintf(stderr, "already present %p(\"%s\"): %d\n", pnode->key, pnode->key, pnode->value);
        }
    }
    else if(sid == T_NUM || sid == T_RNUM) {
        symb->lexeme = NULL;
    }
    else {
        symb->lexeme = TOK_STRS2[sid];
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl (%rsi), %eax
movl %eax, (%rdi)
movl 0x4(%rsi), %eax
movl %eax, 0x4(%rdi)
movslq 0x18(%rsi), %rax
movl %eax, 0x10(%rdi)
movss 0x1c(%rsi), %xmm0
movss %xmm0, 0x14(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movq $0x0, 0x30(%rdi)
cmpq $0x1, %rax
jbe 0x5e60
cmpl $0x2, %eax
jne 0x5e36
movq %rsi, %r14
movq 0x8(%rsi), %rsi
movl 0x10ea4(%rip), %edx     # 0x16c94
leaq 0x10ea1(%rip), %rdi     # 0x16c98
callq 0x3fbf
movq %rax, %r15
movq 0x8(%rax), %rax
movq 0x8(%r14), %r12
cmpq %r12, %rax
jne 0x5e53
movslq 0x14(%r14), %rdi
incq %rdi
callq 0x3150
movq %rax, %r14
movq %rax, 0x8(%rbx)
movq %rax, %rdi
movq %r12, %rsi
callq 0x3060
movq %r14, 0x8(%r15)
incl 0x10e60(%rip)           # 0x16c94
jmp 0x5e57
leal -0x3(%rax), %ecx
cmpl $0x1, %ecx
ja 0x5e48
movq $0x0, 0x8(%rbx)
jmp 0x5e57
leaq 0xf501(%rip), %rcx      # 0x15350
movq (%rcx,%rax,8), %rax
movq %rax, 0x8(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x368e
jmp 0x5e57
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/parser.c
// Function: get_gsymb_id
gsymb_t get_gsymb_id(const char* str)
{
    pch_int_hmap_node* hmap_n = pch_int_hmap_query(&gsymb_ht, str);
    if(hmap_n == NULL)
    {
        fprintf(stderr, "Unrecognized grammar symbol %s\n", str);
        return GS_LAST;
    }
    return hmap_n->value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x104da(%rip), %rdi     # 0x16cb0
movq %rbx, %rsi
callq 0x3f4c
testq %rax, %rax
je 0x67ed
movl 0x10(%rax), %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0xe804(%rip), %rax      # 0x14ff8
movq (%rax), %rdi
leaq 0x817b(%rip), %rsi      # 0xe979
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3140
movl $0x70, %eax
jmp 0x67e6
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/parser.c
// Function: init_parser
gsymb_t init_parser()
{
    init_lexer();

    parser_error_count = 0;

    init_gsymb_ht();
    pch_int_hmap_init(&intern_table, 50, true);
    char str[100];
    FILE* gfp = fopen("data/grammar.txt", "r");
    fscanf(gfp, "%s", str);
    gsymb_t start_symb = get_gsymb_id(str);
    //fprintf(stderr, "start_symbol = %s\n", GS_STRS[start_symb]);
    num_rules = read_grammar(gfp);
    fclose(gfp);

    int i;
    for(i=0; i < NUM_NONTERMS; ++i)
    {
        first[i] = unset_bitset;
        follow[i] = empty_bitset;
    }

    update_follow(start_symb);

    for(int i=0; i<NUM_NONTERMS; i++)
        for(int j=0; j<NUM_TOKENS; j++)
            pt[i][j] = -1;

    bool is_ll1 = make_parse_table();
    //char pt_fname[] = "data/parse_table.txt";
    //read_parse_table(pt_fname);

    if(!is_ll1)
        fprintf(stderr, "The grammar is not LL1\n");

    return start_symb;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x70, %rsp
xorl %eax, %eax
callq 0x529e
movl $0x0, 0x10e54(%rip)     # 0x178d0
callq 0x5ee7
leaq 0x10210(%rip), %rdi     # 0x16c98
movl $0x32, %esi
movl $0x1, %edx
callq 0x3e95
leaq 0x7f2b(%rip), %rdi      # 0xe9c9
leaq 0x7daa(%rip), %rsi      # 0xe84f
callq 0x3170
movq %rax, %r14
leaq 0x91a4(%rip), %rsi      # 0xfc58
leaq -0x80(%rbp), %rbx
movq %rax, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3070
movq %rbx, %rdi
callq 0x67c6
movl %eax, %ebx
movq %r14, %rdi
callq 0x683a
movl %eax, 0x10df7(%rip)     # 0x178d4
movq %r14, %rdi
callq 0x30a0
leaq 0x10df4(%rip), %rdi     # 0x178e0
movl $0x1b0, %edx            # imm = 0x1B0
movl $0xff, %esi
callq 0x30f0
leaq 0x10f8e(%rip), %rdi     # 0x17a90
movl $0x1b0, %edx            # imm = 0x1B0
xorl %esi, %esi
callq 0x30f0
movl %ebx, %edi
callq 0x6b46
leaq 0x11124(%rip), %rdi     # 0x17c40
movl $0x30f0, %edx           # imm = 0x30F0
movl $0xff, %esi
callq 0x30f0
callq 0x6fbd
testb %al, %al
je 0x6b3f
movl %ebx, %eax
addq $0x70, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x3728
jmp 0x6b34
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/parser.c
// Function: update_follow
void update_follow(gsymb_t start_symb)
{
    follow[get_nt_id(start_symb)] = bitset_singleton(T_EOF);
    follow_changed = true;
    while(follow_changed)
    {
        follow_changed = false;
        int i;
        for(i=0; i<num_rules; ++i)
            update_follow_helper(i);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x5d07
cltq
leaq 0x10f36(%rip), %rcx     # 0x17a90
movq $0x2, (%rcx,%rax,8)
movl 0x10d6c(%rip), %eax     # 0x178d4
movb $0x0, 0x10121(%rip)     # 0x16c90
testl %eax, %eax
jle 0x6b91
xorl %ebx, %ebx
movl %ebx, %edi
callq 0x6d47
incl %ebx
movl 0x10d50(%rip), %eax     # 0x178d4
cmpl %eax, %ebx
jl 0x6b75
testb $0x1, 0x10101(%rip)     # 0x16c90
jne 0x6b68
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/parser.c
// Function: destroy_rules
void destroy_rules()
{
    int i;
    for(i=0; i < NUM_RULES; ++i)
    {
        rules[i].tail = NULL;
        RuleNode *p = rules[i].head, *todel = NULL;
        rules[i].head = NULL;
        while(p != NULL)
        {
            todel = p;
            p = p->next;
            todel->next = NULL;
            free(todel);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
leaq 0x103c5(%rip), %r14     # 0x16f70
leaq (%rbx,%rbx,2), %rax
movq 0x8(%r14,%rax,8), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r14,%rax,8)
testq %rdi, %rdi
je 0x6bd2
movq (%rdi), %r15
callq 0x3030
movq %r15, %rdi
testq %r15, %r15
jne 0x6bc2
incq %rbx
cmpq $0x64, %rbx
jne 0x6bab
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/parser.c
// Function: destroy_parser
void destroy_parser(bool destroy_intern_table)
{
    destroy_lexer();
    pch_int_hmap_clear(&gsymb_ht);
    destroy_rules();
    if(destroy_intern_table) {
        pch_int_hmap_clear(&intern_table);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
xorl %eax, %eax
callq 0x52ef
leaq 0x100b4(%rip), %rdi     # 0x16cb0
callq 0x3ed7
callq 0x6b98
testl %ebx, %ebx
je 0x6c1c
leaq 0x10087(%rip), %rdi     # 0x16c98
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x3ed7
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/parser.c
// Function: get_first_symb
bitset_t get_first_symb(gsymb_t sid)
// get first set of a symbol
{
    if(sid < 0 || sid >= NUM_GS)
    {
        fprintf(stderr, "get_first_nt: Invalid sid %d\n", sid);
        return empty_bitset;
    }
    else if(sid < (int)NUM_TOKENS)
        return bitset_singleton(sid);
    else
    {
        int ntid = get_nt_id(sid);
        if(first[ntid] == unset_bitset)
        {
            int i;
            first[ntid] = empty_bitset;
            for(i=rule_begin[ntid]; i < rule_end[ntid]; ++i)
                first[ntid] |= get_first_str(rules[i].head);
        }
        return first[ntid];
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ecx
cmpl $0x70, %edi
jae 0x6ccc
cmpl $0x39, %ecx
ja 0x6c4e
movl $0x1, %ebx
shlq %cl, %rbx
jmp 0x6ce8
movl %ecx, %edi
callq 0x5d07
movslq %eax, %r14
leaq 0x10c81(%rip), %r15     # 0x178e0
movq (%r15,%r14,8), %rbx
cmpq $-0x1, %rbx
jne 0x6ce8
movq $0x0, (%r15,%r14,8)
leaq 0x10058(%rip), %rax     # 0x16cd0
movslq (%rax,%r14,4), %r12
leaq 0x1012d(%rip), %rdx     # 0x16db0
cmpl (%rdx,%r14,4), %r12d
jge 0x6cc8
leaq (%r12,%r12,2), %rax
leaq 0x102dc(%rip), %rcx     # 0x16f70
leaq (%rcx,%rax,8), %r13
addq $0x8, %r13
movq (%r13), %rdi
movq %rdx, %rbx
callq 0x6cfa
movq %rbx, %rdx
movq %rax, %rbx
orq (%r15,%r14,8), %rbx
movq %rbx, (%r15,%r14,8)
incq %r12
movslq (%rdx,%r14,4), %rax
addq $0x18, %r13
cmpq %rax, %r12
jl 0x6c9c
jmp 0x6ce8
xorl %ebx, %ebx
jmp 0x6ce8
movq 0xe325(%rip), %rax      # 0x14ff8
movq (%rax), %rdi
leaq 0x7d15(%rip), %rsi      # 0xe9f2
xorl %ebx, %ebx
movl %ecx, %edx
xorl %eax, %eax
callq 0x3140
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/parser.c
// Function: get_first_str
bitset_t get_first_str(RuleNode* node)
// get first set of a linked list string starting at node
{
    if(node == NULL)
        return bitset_singleton(T_EOF);

    if(node->first == unset_bitset)
    {
        int sid = node->value;
        bitset_t s = get_first_symb(sid);
        if(bitset_has(s, T_EOF))
            s = bitset_remove(s, T_EOF) | get_first_str(node->next);
        node->first = s;
    }
    return node->first;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x6d39
movq %rdi, %rbx
movq 0x10(%rdi), %r14
cmpq $-0x1, %r14
jne 0x6d3f
movl 0x8(%rbx), %edi
callq 0x6c23
movq %rax, %r14
testb $0x2, %r14b
je 0x6d33
andq $-0x3, %r14
movq (%rbx), %rdi
callq 0x6cfa
orq %rax, %r14
movq %r14, 0x10(%rbx)
jmp 0x6d3f
movl $0x2, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/parser.c
// Function: update_follow_helper
void update_follow_helper(int rule_no)
// update follow using rule number i
{
    RuleNode* n = rules[rule_no].head;
    for(; n != NULL; n = n->next)
    {
        gsymb_t sid = n->value;
        if(sid >= (int)NUM_TOKENS)
        {
            int ntid = get_nt_id(sid);
            bitset_t s = get_first_str(n->next);
            bitset_t new_follow = bitset_remove(s, T_EOF) | follow[ntid];
            if(follow[ntid] != new_follow)
            {
                follow_changed = true;
                follow[ntid] = new_follow;
            }
            if(bitset_has(s, T_EOF))
            {
                bitset_t s3 = follow[get_nt_id(rules[rule_no].lhs)];
                new_follow = s3 | follow[ntid];
                if(new_follow != follow[ntid])
                {
                    follow_changed = true;
                    follow[ntid] = new_follow;
                }
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movslq %edi, %rax
leaq (%rax,%rax,2), %rax
leaq 0x10210(%rip), %rcx     # 0x16f70
movq 0x8(%rcx,%rax,8), %r14
testq %r14, %r14
je 0x6ddf
leaq (%rcx,%rax,8), %r15
leaq 0x10d1b(%rip), %r12     # 0x17a90
movl 0x8(%r14), %edi
cmpl $0x3a, %edi
jb 0x6dd7
callq 0x5d07
movl %eax, %ebx
movq (%r14), %rdi
callq 0x6cfa
movq %rax, %rcx
andq $-0x3, %rcx
movslq %ebx, %rbx
movq (%r12,%rbx,8), %rdx
orq %rdx, %rcx
cmpq %rcx, %rdx
je 0x6dae
movb $0x1, 0xfee6(%rip)      # 0x16c90
movq %rcx, (%r12,%rbx,8)
testb $0x2, %al
je 0x6dd7
movl (%r15), %edi
callq 0x5d07
cltq
movq (%r12,%rbx,8), %rcx
movq (%r12,%rax,8), %rax
orq %rcx, %rax
cmpq %rcx, %rax
je 0x6dd7
movb $0x1, 0xfebd(%rip)      # 0x16c90
movq %rax, (%r12,%rbx,8)
movq (%r14), %r14
testq %r14, %r14
jne 0x6d75
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/parser.c
// Function: print_bitset
void print_bitset(bitset_t s, FILE* fp)
{
    if(s == unset_bitset)
        fprintf(fp, "{unset}\n");
    else
    {
        int i;
        fprintf(fp, "{");
        //fprintf(fp, "%llu {", s);
        bool first = true;
        for(i=0; i < NUM_TOKENS; ++i)
            if(bitset_has(s, i))
            {
                if(!first)
                    fprintf(fp, ", ");
                else
                    first = false;
                //fprintf(fp, "%s(%d)", GS_STRS[i], i);
                fprintf(fp, "%s", GS_STRS[i]);
            }
        fprintf(fp, "}\n");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
cmpq $-0x1, %rdi
je 0x6e67
movq %rdi, %r14
movl $0x7b, %edi
movq %rbx, %rsi
callq 0x3110
movb $0x1, %al
xorl %r12d, %r12d
leaq 0xe935(%rip), %r13      # 0x15750
leaq 0x7fed(%rip), %r15      # 0xee0f
btq %r12, %r14
jae 0x6e50
testb $0x1, %al
jne 0x6e41
movl $0x2, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x31d0
movq (%r13,%r12,8), %rdi
movq %rbx, %rsi
callq 0x30e0
xorl %eax, %eax
incq %r12
cmpq $0x3a, %r12
jne 0x6e22
leaq 0x7bb6(%rip), %rdi      # 0xea16
movl $0x2, %esi
jmp 0x6e73
leaq 0x7ba2(%rip), %rdi      # 0xea10
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31d0
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/parser.c
// Function: print_parse_table
void print_parse_table()
{
    for(int i=0; i<NUM_NONTERMS; i++)
        for(int j=0; j<NUM_TOKENS; j++)
            if(pt[i][j] != -1)
                printf("pt[%s][%s] = %d\n", GS_STRS[i+NUM_TOKENS], GS_STRS[j], pt[i][j]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x10cde(%rip), %r14     # 0x17c40
leaq 0xe7e7(%rip), %r15      # 0x15750
leaq 0x7aae(%rip), %rbx      # 0xea1e
xorl %r12d, %r12d
xorl %r13d, %r13d
movl (%r14,%r13,4), %ecx
cmpl $-0x1, %ecx
je 0x6f95
movq 0x1d0(%r15,%r12,8), %rsi
movq (%r15,%r13,8), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x30b0
incq %r13
cmpq $0x3a, %r13
jne 0x6f76
incq %r12
addq $0xe8, %r14
cmpq $0x36, %r12
jne 0x6f73
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/parser.c
// Function: make_parse_table
bool make_parse_table()
{
    int i;
    tok_t j;
    bool is_ll1 = true;
    for(i=0; i < num_rules; ++i)
    {
        int ntid = get_nt_id(rules[i].lhs);
        bitset_t fa = get_first_str(rules[i].head);
        bitset_t terms;
        if(bitset_has(fa, T_EOF))
            terms = follow[ntid] | bitset_remove(fa, T_EOF);
        else
            terms = fa;
        for(j=0; j < NUM_TOKENS; ++j)
            if(bitset_has(terms, j))
            {
                if(pt[ntid][j] != -1)
                    is_ll1 = false;
                pt[ntid][j] = i;
            }
    }
    return is_ll1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, 0x10902(%rip)     # 0x178d4
jle 0x7061
movb $0x1, %bl
xorl %r15d, %r15d
leaq 0x10c5c(%rip), %r13     # 0x17c40
leaq (%r15,%r15,2), %r12
leaq 0xff81(%rip), %rax      # 0x16f70
movl (%rax,%r12,8), %edi
callq 0x5d07
movl %eax, %r14d
leaq 0xff6e(%rip), %rax      # 0x16f70
movq 0x8(%rax,%r12,8), %rdi
callq 0x6cfa
movslq %r14d, %rcx
testb $0x2, %al
je 0x7022
andq $-0x3, %rax
leaq 0x10a72(%rip), %rdx     # 0x17a90
orq (%rdx,%rcx,8), %rax
imulq $0xe8, %rcx, %rcx
xorl %edx, %edx
btq %rdx, %rax
jae 0x7047
leaq (%rcx,%rdx,4), %rsi
cmpl $-0x1, (%r13,%rsi)
sete %dil
andb %dil, %bl
movl %r15d, (%r13,%rsi)
incq %rdx
cmpq $0x3a, %rdx
jne 0x702b
incq %r15
movslq 0x1087a(%rip), %rax     # 0x178d4
cmpq %rax, %r15
jl 0x6fe4
jmp 0x7063
movb $0x1, %bl
andb $0x1, %bl
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/parser.c
// Function: read_parse_table
void read_parse_table(const char* file_name){
    FILE * fp = fopen(file_name, "r");
    if(fp == NULL){
        fprintf(stderr, "File %s not found\n", file_name);
        return;
    }

    char nt_str[100];
    char t_str[100];
    int rule_no;
    while(fscanf(fp, "%s %s %d", nt_str, t_str, &rule_no) != EOF){
        int nt_id = get_nt_id(get_gsymb_id(nt_str));
        int t_id = get_gsymb_id(t_str);
        pt[nt_id][t_id] = rule_no;
    }
    fclose(fp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %r14
leaq 0x77ba(%rip), %rsi      # 0xe84f
callq 0x3170
testq %rax, %rax
je 0x714f
movq %rax, %rbx
leaq 0x7995(%rip), %rsi      # 0xea42
leaq -0x100(%rbp), %rdx
leaq -0x90(%rbp), %rcx
leaq -0x2c(%rbp), %r8
movq %rax, %rdi
xorl %eax, %eax
callq 0x3070
cmpl $-0x1, %eax
je 0x7135
leaq -0x100(%rbp), %r14
leaq -0x90(%rbp), %r15
leaq -0x2c(%rbp), %r13
movq %r14, %rdi
callq 0x67c6
movl %eax, %edi
callq 0x5d07
movl %eax, %r12d
movq %r15, %rdi
callq 0x67c6
movl -0x2c(%rbp), %ecx
movslq %r12d, %rdx
cltq
imulq $0xe8, %rdx, %rdx
leaq 0x10b30(%rip), %rsi     # 0x17c40
addq %rsi, %rdx
movl %ecx, (%rdx,%rax,4)
movq %rbx, %rdi
leaq 0x7922(%rip), %rsi      # 0xea42
movq %r14, %rdx
movq %r15, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0x3070
cmpl $-0x1, %eax
jne 0x70e0
movq %rbx, %rdi
callq 0x30a0
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xdea2(%rip), %rax      # 0x14ff8
movq (%rax), %rdi
leaq 0x78cf(%rip), %rsi      # 0xea2f
movq %r14, %rdx
xorl %eax, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3140
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/parser.c
// Function: handle_parse_error_1
parse_tree_node* handle_parse_error_1(const Token* ptok, int_stack* pst, parse_tree_node* tn)
// handle case where top of stack is a terminal and it doesn't match lookahead
{
    parser_error_count++;
    gsymb_t cur_st_top = int_stack_top(pst);
    static char err_msg[50];
    sprintf(err_msg, "Got %s instead of %s.", GS_STRS[ptok->tid], GS_STRS[cur_st_top]);
    print_error("parse", ERROR, 1, ptok->line, ptok->col, ptok->lexeme, NULL, err_msg);
    int_stack_pop(pst);
    return get_successor(tn);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
incl 0x10738(%rip)           # 0x178d0
movq %rsi, %rdi
callq 0x48f1
movslq 0x18(%r12), %rcx
leaq 0xe5a4(%rip), %rsi      # 0x15750
movq (%rsi,%rcx,8), %rdx
movl %eax, %eax
movq (%rsi,%rax,8), %rcx
leaq 0x13b73(%rip), %r13     # 0x1ad30
leaq 0x7887(%rip), %rsi      # 0xea4b
xorl %r15d, %r15d
movq %r13, %rdi
xorl %eax, %eax
callq 0x31b0
movl (%r12), %ecx
movl 0x4(%r12), %r8d
movq 0x8(%r12), %r9
leaq 0x787b(%rip), %rdi      # 0xea61
xorl %esi, %esi
movl $0x1, %edx
pushq %r13
pushq $0x0
callq 0x93bc
addq $0x10, %rsp
movq %r14, %rdi
callq 0x4908
testq %rbx, %rbx
je 0x721c
movq 0x20(%rbx), %r15
testq %r15, %r15
jne 0x721c
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
jne 0x7207
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/parser.c
// Function: handle_parse_error_2
parse_tree_node* handle_parse_error_2(const Token* ptok, int_stack* pst, parse_tree_node* tn)
// handle case where there is no entry in parse table
{
    parser_error_count++;
    static char err_msg[50];
    sprintf(err_msg, "Token \'%s\' isn't expected here.", GS_STRS[ptok->tid]);
    print_error("parse", ERROR, 2, ptok->line, ptok->col, ptok->lexeme, NULL, err_msg);
    int_stack_pop(pst);
    return get_first_child_or_successor(tn);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
incl 0x1068b(%rip)           # 0x178d0
movq %rdi, %r15
movslq 0x18(%rdi), %rax
leaq 0xe4fd(%rip), %rcx      # 0x15750
movq (%rcx,%rax,8), %rdx
leaq 0x13b12(%rip), %r12     # 0x1ad70
leaq 0x7802(%rip), %rsi      # 0xea67
movq %r12, %rdi
xorl %eax, %eax
callq 0x31b0
movl (%r15), %ecx
movl 0x4(%r15), %r8d
movq 0x8(%r15), %r9
leaq 0x77e0(%rip), %rdi      # 0xea61
xorl %esi, %esi
movl $0x2, %edx
pushq %r12
pushq $0x0
callq 0x93bc
addq $0x10, %rsp
movq %r14, %rdi
callq 0x4908
movq 0x10(%rbx), %rax
testq %rax, %rax
jne 0x72be
jmp 0x72b1
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
je 0x72bc
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x72a8
jmp 0x72be
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/parser.c
// Function: print_node_sub
void print_node_sub(const parse_tree_node* root, FILE* fp)
{
    /*
    if(root == NULL)
        fprintf(fp, "print_node: NULL\n");
    else
        fprintf(fp, "print_node: %p %s\n", root, GS_STRS[root->value->tid]);
    */
    Symbol* s = root->value;
    char empty[] = "----";
    char* lexeme = (s->lexeme == NULL ? empty : s->lexeme);
    if((int)(s->sid) < NUM_TOKENS)
        fprintf(fp, "%20s %2d %20s ", lexeme, s->line, GS_STRS[s->sid]);
    else
        fprintf(fp, "%20s %2s %20s ", empty, "--", empty);

    if(s->sid == T_NUM)
        fprintf(fp, "%20d ", s->i);
    else if(s->sid == T_RNUM)
        fprintf(fp, "%20lf ", s->f);
    else
        fprintf(fp, "%20s ", empty);

    if(root->parent == NULL)
        fprintf(fp, "%20s ", empty);
    else
        fprintf(fp, "%20s ", GS_STRS[root->parent->value->sid]);

    if(root->first_child == NULL)
        fprintf(fp, "yes ");
    else
        fprintf(fp, " no ");

    fprintf(fp, "%20s\n", GS_STRS[s->sid]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %r15
movb $0x0, -0x1c(%rbp)
movl $0x2d2d2d2d, -0x20(%rbp) # imm = 0x2D2D2D2D
movslq 0x10(%r15), %rax
cmpq $0x39, %rax
jg 0x756f
movq 0x8(%r15), %rcx
testq %rcx, %rcx
leaq -0x20(%rbp), %rdx
cmovneq %rcx, %rdx
movl (%r15), %ecx
leaq 0xe1f8(%rip), %rsi      # 0x15750
movq (%rsi,%rax,8), %r8
leaq 0x7565(%rip), %rsi      # 0xeac8
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3140
jmp 0x758e
leaq 0x7561(%rip), %rsi      # 0xead7
leaq 0x7548(%rip), %rcx      # 0xeac5
leaq -0x20(%rbp), %rdx
movq %rbx, %rdi
movq %rdx, %r8
xorl %eax, %eax
callq 0x3140
movl 0x10(%r15), %eax
cmpl $0x4, %eax
je 0x75b3
cmpl $0x3, %eax
jne 0x75cc
movl 0x14(%r15), %edx
leaq 0x753f(%rip), %rsi      # 0xeae6
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3140
jmp 0x75e1
cvtss2sd 0x14(%r15), %xmm0
leaq 0x752c(%rip), %rsi      # 0xeaec
movq %rbx, %rdi
movb $0x1, %al
callq 0x3140
jmp 0x75e1
leaq 0x74fe(%rip), %rsi      # 0xead1
leaq -0x20(%rbp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3140
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x7605
movq (%rax), %rax
movslq 0x10(%rax), %rax
leaq 0xe158(%rip), %rcx      # 0x15750
movq (%rcx,%rax,8), %rdx
leaq 0x74ce(%rip), %rsi      # 0xead1
jmp 0x7610
leaq 0x74c5(%rip), %rsi      # 0xead1
leaq -0x20(%rbp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3140
cmpq $0x0, 0x10(%r14)
leaq 0x74cd(%rip), %rax      # 0xeaf3
leaq 0x74cb(%rip), %rdi      # 0xeaf8
cmoveq %rax, %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x31d0
movslq 0x10(%r15), %rax
leaq 0xe102(%rip), %rcx      # 0x15750
movq (%rcx,%rax,8), %rdx
leaq 0x74a4(%rip), %rsi      # 0xeafd
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3140
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x76bc
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %r15
testq %r15, %r15
je 0x76c7
movq %r15, %rdi
movq %rbx, %rsi
callq 0x766e
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7517
movq 0x20(%r15), %r14
testq %r14, %r14
je 0x76bc
movq %r14, %rdi
movq %rbx, %rsi
callq 0x766e
movq 0x20(%r14), %r14
jmp 0x76a6
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x7517
// File: /workspace/github_c_makefile_star2_O3/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 0x775d
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rax
movslq 0x10(%rax), %rax
leaq 0xe054(%rip), %rcx      # 0x15750
movq (%rcx,%rax,8), %rdx
leaq 0x73fc(%rip), %rsi      # 0xeb03
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3140
movq (%r14), %rax
movl 0x18(%rax), %edx
testl %edx, %edx
js 0x772f
leaq 0x73e6(%rip), %rsi      # 0xeb08
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3140
movq (%r14), %rax
movq 0x8(%rax), %rdi
testq %rdi, %rdi
je 0x775e
movq %rbx, %rsi
callq 0x30e0
movq (%r14), %rax
movl (%rax), %edx
movl 0x4(%rax), %ecx
leaq 0x73c5(%rip), %rsi      # 0xeb14
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x3140
retq
movl 0x10(%rax), %ecx
cmpl $0x4, %ecx
je 0x7781
cmpl $0x3, %ecx
jne 0x7740
movl 0x14(%rax), %edx
leaq 0x72d3(%rip), %rsi      # 0xea48
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3140
jmp 0x7740
cvtss2sd 0x14(%rax), %xmm0
leaq 0x7383(%rip), %rsi      # 0xeb10
movq %rbx, %rdi
movb $0x1, %al
callq 0x3140
jmp 0x7740
// File: /workspace/github_c_makefile_star2_O3/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 0x7816
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
testl %edx, %edx
jle 0x77dc
leaq 0x7625(%rip), %r12      # 0xede4
movl %ebx, %r13d
movl $0x2, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %r14, %rcx
callq 0x31d0
decl %r13d
jne 0x77c2
movq %r15, %rdi
movq %r14, %rsi
callq 0x76dc
movq 0x10(%r15), %r15
testq %r15, %r15
je 0x7808
incl %ebx
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x7799
movq 0x20(%r15), %r15
testq %r15, %r15
jne 0x77f2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x6a60
movl %eax, %r12d
testl %r13d, %r13d
jle 0x7878
movq 0xd779(%rip), %r13      # 0x14fd0
movq (%r13), %rdi
callq 0x6e8e
movl $0xa, %edi
callq 0x3040
movq (%r13), %rdi
callq 0x6ee6
callq 0x6f4d
movq %r15, %rdi
movl %r12d, %esi
callq 0x72c7
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq *%rbx
movq %r15, %rdi
callq 0x7951
movl $0x1, %edi
callq 0x6be6
movl 0x1002a(%rip), %eax     # 0x178d0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x30, %edi
callq 0x3150
movq %rax, %rbx
testq %rax, %rax
je 0x790c
movq %r14, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movups %xmm0, 0x18(%rbx)
movq $0x0, 0x28(%rbx)
incl 0x134a0(%rip)           # 0x1ada4
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
callq 0x3794
jmp 0x78fe
// File: /workspace/github_c_makefile_star2_O3/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 0x78cc
movq %rbx, 0x8(%rax)
movq 0x18(%rbx), %rcx
movq 0x10(%rbx), %rdx
orq %rcx, %rdx
jne 0x793b
leaq 0x10(%rbx), %rcx
jmp 0x7943
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_O3/sharmaeklavya2[P]cerplag/./util/tree.gen.c
// Function: ST_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:
testq %rdi, %rdi
je 0x9d58
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rbx), %r12
movq (%rbx), %r14
movq 0x10(%rbx), %r15
movq %r14, %rdi
callq 0x97be
leaq 0x18(%r14), %rdi
callq 0xbe41
movq %r14, %rdi
callq 0x3030
movq %rbx, %rdi
callq 0x3030
movq %r15, %rdi
callq 0x9d01
movq %r12, %rbx
testq %r12, %r12
jne 0x9d14
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rdx, -0x30(%rbp)
testq %rdi, %rdi
je 0x7a23
movq %rcx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movq -0x30(%rbp), %rax
incl %eax
movl %eax, -0x34(%rbp)
leaq 0x741b(%rip), %r13      # 0xede4
cmpl $0x0, -0x30(%rbp)
jle 0x79f0
movq -0x30(%rbp), %rax
movl %eax, %r14d
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %r15, %rcx
callq 0x31d0
decl %r14d
jne 0x79d6
movq (%r12), %rdi
movq %r15, %rsi
callq *%rbx
movl $0xa, %edi
movq %r15, %rsi
callq 0x3110
movq 0x10(%r12), %rdi
movq %r15, %rsi
movl -0x34(%rbp), %edx
movq %rbx, %rcx
callq 0x7996
movq 0x20(%r12), %r12
testq %r12, %r12
jne 0x79c9
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x7a50
leaq -0x183(%rip), %rcx      # 0x78c2
movq %rax, %rsi
xorl %edx, %edx
popq %rbp
jmp 0x7996
leaq 0x70d9(%rip), %rdi      # 0xeb30
movl $0xa, %esi
movl $0x1, %edx
movq %rax, %rcx
popq %rbp
jmp 0x31d0
nop
// File: /workspace/github_c_makefile_star2_O3/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 0xd57b(%rip), %rax      # 0x14ff8
movq (%rax), %rdi
cmpl $0x14, %esi
jb 0x7a97
leaq 0x72d4(%rip), %rsi      # 0xed60
movl %r8d, %ecx
xorl %eax, %eax
popq %rbp
jmp 0x3140
movl %r8d, %eax
leaq 0xdc0f(%rip), %rcx      # 0x156b0
movq (%rcx,%rax,8), %rcx
leaq 0x72ce(%rip), %rsi      # 0xed7a
xorl %eax, %eax
popq %rbp
jmp 0x3140
// File: /workspace/github_c_makefile_star2_O3/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 0x7c2f
movl %esi, %eax
leaq 0x7070(%rip), %rcx      # 0xeb3c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x1, %edi
movl $0x50, %esi
callq 0x3120
jmp 0x7d00
movl $0x1, %edi
movl $0x48, %esi
callq 0x3120
movl $0x10, (%rax)
jmp 0x7ce2
movl $0x1, %edi
movl $0x48, %esi
callq 0x3120
movl $0xe, (%rax)
jmp 0x7ce2
movl $0x1, %edi
movl $0x50, %esi
callq 0x3120
movl $0xb, (%rax)
jmp 0x7d00
movl $0x1, %edi
movl $0x40, %esi
callq 0x3120
movl $0x4, (%rax)
jmp 0x7c8f
movl $0x1, %edi
movl $0x58, %esi
callq 0x3120
movl $0xc, (%rax)
jmp 0x7c23
movl $0x1, %edi
movl $0x68, %esi
callq 0x3120
movl $0x9, (%rax)
addl $0x68, 0x13225(%rip)    # 0x1adac
jmp 0x7d07
movl $0x1, %edi
movl $0x48, %esi
callq 0x3120
movl $0x2, (%rax)
jmp 0x7ce2
movl $0x1, %edi
movl $0x48, %esi
callq 0x3120
movl $0xf, (%rax)
jmp 0x7ce2
movl $0x1, %edi
movl $0x40, %esi
callq 0x3120
movl $0x3, (%rax)
jmp 0x7c8f
movl $0x1, %edi
movl $0x48, %esi
callq 0x3120
movl $0x7, (%rax)
jmp 0x7ce2
movl $0x1, %edi
movl $0x48, %esi
callq 0x3120
movl $0x1, (%rax)
jmp 0x7ce2
movl $0x1, %edi
movl $0x58, %esi
callq 0x3120
movl $0x11, (%rax)
addl $0x58, 0x13182(%rip)    # 0x1adac
jmp 0x7d07
leaq 0x7163(%rip), %rdi      # 0xed99
callq 0x7a6c
xorl %eax, %eax
jmp 0x7d07
movl $0x1, %edi
movl $0x40, %esi
callq 0x3120
movl $0x5, (%rax)
jmp 0x7c8f
movl $0x1, %edi
movl $0x70, %esi
callq 0x3120
movl $0xd, (%rax)
addl $0x70, 0x13137(%rip)    # 0x1adac
jmp 0x7d07
movl $0x1, %edi
movl $0x40, %esi
callq 0x3120
movl $0x6, (%rax)
addl $0x40, 0x13116(%rip)    # 0x1adac
jmp 0x7d07
movl $0x1, %edi
movl $0x60, %esi
callq 0x3120
movl $0x12, (%rax)
addl $0x60, 0x130f8(%rip)    # 0x1adac
jmp 0x7d07
movl $0x1, %edi
movl $0x50, %esi
callq 0x3120
movl $0xa, (%rax)
jmp 0x7d00
movl $0x1, %edi
movl $0x48, %esi
callq 0x3120
movl $0x8, (%rax)
addl $0x48, 0x130c3(%rip)    # 0x1adac
jmp 0x7d07
movl $0x1, %edi
movl $0x50, %esi
callq 0x3120
movl $0x13, (%rax)
addl $0x50, 0x130a5(%rip)    # 0x1adac
incl 0x1309b(%rip)           # 0x1ada8
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x7d33
leaq 0x6e6c(%rip), %rcx      # 0xeb8c
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 0x7068(%rip), %rdi      # 0xeda6
callq 0x7a6c
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x7d8e
movl (%rdi), %esi
leal -0x9(%rsi), %eax
cmpl $0x9, %eax
ja 0x7d82
leaq 0x6e5b(%rip), %rcx      # 0xebc0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x60(%rdi), %ebx
jmp 0x7d8e
movl 0x68(%rdi), %ebx
jmp 0x7d8e
movl 0x50(%rdi), %ebx
jmp 0x7d8e
movl 0x58(%rdi), %ebx
jmp 0x7d8e
leaq 0x702f(%rip), %rdi      # 0xedb8
callq 0x7a6c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x7dde
movl (%rdi), %esi
leal -0x9(%rsi), %eax
cmpl $0x9, %eax
ja 0x7dd2
leaq 0x6e33(%rip), %rcx      # 0xebe8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x64(%rdi), %ebx
jmp 0x7dde
movl 0x6c(%rdi), %ebx
jmp 0x7dde
movl 0x54(%rdi), %ebx
jmp 0x7dde
movl 0x5c(%rdi), %ebx
jmp 0x7dde
leaq 0x6ff2(%rip), %rdi      # 0xedcb
callq 0x7a6c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x8707
movq 0x10(%rsi), %rcx
testq %rcx, %rcx
je 0x870d
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
movq %rcx, (%rdi,%rax,8)
incq %rax
movq 0x20(%rcx), %rcx
testq %rcx, %rcx
jne 0x86f4
popq %rbp
jmp 0x870f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
xorl %eax, %eax
movl %eax, %ecx
movq $0x0, (%rdi,%rcx,8)
retq