LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/lexer.c
// Function: PrintLexing
void PrintLexing(L_TOKEN* lexing)
{
    int i;
    printf("NUMBER  STRING\n");
    printf("--------------\n");
    
    while (lexing)
    {
        printf("0x%.4X  ", lexing->token);
        if (lexing->token == gSymbolString)
            printf("\"");
        for (i = 0; i < lexing->length; i++)
            printf("%c", lexing->string[i]);
        if (lexing->token == gSymbolString)
            printf("\"");
        printf("\n");
        lexing = lexing->next;
    }
    
    printf("\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x3cbd(%rip), %rdi      # 0x8595
callq 0x2050
leaq 0x3cc0(%rip), %rdi      # 0x85a4
callq 0x2050
testq %rbx, %rbx
je 0x4960
leaq 0x3c5f(%rip), %r14      # 0x8554
leaq 0x77cc(%rip), %r15      # 0xc0c8
movl (%rbx), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x2090
movl (%rbx), %eax
cmpl (%r15), %eax
jne 0x4919
movl $0x22, %edi
callq 0x2040
cmpl $0x0, 0x10(%rbx)
jle 0x493c
xorl %r12d, %r12d
movq 0x8(%rbx), %rax
movsbl (%rax,%r12), %edi
callq 0x2040
incq %r12
movslq 0x10(%rbx), %rax
cmpq %rax, %r12
jl 0x4922
movl (%rbx), %eax
cmpl (%r15), %eax
jne 0x494d
movl $0x22, %edi
callq 0x2040
movl $0xa, %edi
callq 0x2040
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
jne 0x48fc
movl $0xa, %edi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2040
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/lexer.c
// Function: FreeLexing
void FreeLexing(L_TOKEN* lexing,
                char*    buffer)
{
    L_TOKEN* block;

    while (lexing)
    {
        block = lexing;
        lexing = lexing->next;
        if (block->string) {
            free(block->string);
        }
        free(block);
    }

    free(buffer);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
testq %rdi, %rdi
je 0x49a9
movq %rdi, %r14
movq 0x8(%r14), %rdi
movq 0x18(%r14), %r15
testq %rdi, %rdi
je 0x4999
callq 0x2030
movq %r14, %rdi
callq 0x2030
movq %r15, %r14
testq %r15, %r15
jne 0x4987
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2030
nop
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/main.c
// Function: FreeCompiler
void FreeCompiler()
{
    SOURCE* srcItr;

    // free compiler data structures
    FreeVariableList(&gPrgrmVariables);
    FreeFunctionList(&gPrgrmFunctions);

    for (srcItr = gPrgrmSources; srcItr; srcItr = srcItr->next)
    {
        if (srcItr->lexing != NULL)
        {
            FreeLexing(srcItr->lexing, srcItr->buffer);
        }
        if (srcItr->syntax != NULL)
        {
            FreeParseTree(srcItr->syntax);
        }
    }

    FreeSourceList(&gPrgrmSources);

    // zero the pointer handles
    gPrgrmVariables = NULL;
    gPrgrmFunctions = NULL;
    gPrgrmSources = NULL;

    // clear the function table
    if (gPrgrmFunctionTable) 
    {
        unsigned int i;
        for (i = 0; i < gPrgrmFunctionCount; i++)
        {
            FreeVariableList(&gPrgrmFunctionTable[i].locals);
        }

        free(gPrgrmFunctionTable);
        gPrgrmFunctionTable = NULL;
        gPrgrmFunctionTable = 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x146bf(%rip), %rbx     # 0x19370
movq %rbx, %rdi
callq 0x6379
leaq 0x146b8(%rip), %r14     # 0x19378
movq %r14, %rdi
callq 0x63ab
leaq 0x14699(%rip), %r15     # 0x19368
movq (%r15), %r12
testq %r12, %r12
je 0x4d01
movq 0x8(%r12), %rdi
testq %rdi, %rdi
je 0x4ceb
movq 0x20(%r12), %rsi
callq 0x4972
movq 0x10(%r12), %rdi
testq %rdi, %rdi
je 0x4cfa
callq 0x5001
movq 0x28(%r12), %r12
jmp 0x4cd2
movq %r15, %rdi
callq 0x6347
xorl %eax, %eax
movq %rax, (%rbx)
movq %rax, (%r14)
movq %rax, (%r15)
leaq 0x14645(%rip), %rbx     # 0x19360
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x4d62
leaq 0x1462e(%rip), %r14     # 0x19358
cmpl $0x0, (%r14)
je 0x4d56
movl $0x18, %r15d
xorl %r12d, %r12d
movq (%rbx), %rdi
addq %r15, %rdi
callq 0x6379
incq %r12
movl (%r14), %eax
addq $0x38, %r15
cmpq %rax, %r12
jb 0x4d39
movq (%rbx), %rdi
callq 0x2030
movq $0x0, (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/parser.c
// Function: ActionTable
ACTION ActionTable(LR_TABLE table, int state, int token)
{
    ACTION action;
    action.type = ACTION_ERROR;

    if (token & K_TOKEN)
        token = token ^ K_TOKEN;

    if (state >= 0 && state < table.numStates
        && token > 0 && token <= table.numTokens)
    {
        action = table.actionTable[state * table.numTokens + token - 1];
    }

    return action;
}

// Assembly:
xorl %eax, %eax
testl %edi, %edi
js 0x4db0
andl $0xffffdfff, %esi       # imm = 0xFFFFDFFF
jle 0x4db0
pushq %rbp
movq %rsp, %rbp
leaq 0x10(%rbp), %rdx
movl $0x0, %ecx
cmpl %edi, 0x8(%rdx)
jle 0x4dc9
movl (%rdx), %ecx
cmpl %ecx, %esi
jle 0x4db4
xorl %eax, %eax
xorl %ecx, %ecx
jmp 0x4dc9
xorl %ecx, %ecx
jmp 0x4dca
movq 0x10(%rdx), %rdx
imull %edi, %ecx
addl %esi, %ecx
movl -0x8(%rdx,%rcx,8), %eax
movl -0x4(%rdx,%rcx,8), %ecx
shlq $0x20, %rcx
popq %rbp
orq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/parser.c
// Function: GotoTable
int GotoTable(LR_TABLE table, int state, int symbol)
{
    int nextState = -1;

    if (symbol & K_SYMBOL)
        symbol = symbol ^ K_SYMBOL;

    if (state >= 0 && state < table.numStates
        && symbol > 0 && symbol <= table.numSymbols)
    {
        nextState = table.gotoTable[state * table.numSymbols + symbol - 1];
    }

    return nextState;
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %edi, %edi
js 0x4e01
andl $0xffffefff, %esi       # imm = 0xFFFFEFFF
jle 0x4e01
pushq %rbp
movq %rsp, %rbp
leaq 0x10(%rbp), %rdx
cmpl %edi, 0x8(%rdx)
jle 0x4e00
movl 0x4(%rdx), %ecx
cmpl %ecx, %esi
jg 0x4e00
movq 0x18(%rdx), %rax
imull %edi, %ecx
addl %esi, %ecx
movl -0x4(%rax,%rcx,4), %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/parser.c
// Function: StackPushState
void StackPushState(int state)
{
    if (gParseTop) {
        gParseTop->next = (PARSE_STACK*)malloc(sizeof(PARSE_STACK));
        gParseTop->next->prev = gParseTop;
        gParseTop = gParseTop->next;
    } else {
        gParseStack = gParseTop = (PARSE_STACK*)malloc(sizeof(PARSE_STACK));
        gParseTop->prev = NULL;
    }
    gParseTop->next = NULL;
    gParseTop->token = NULL;
    gParseTop->type = 0;
    gParseTop->state = state;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
movq 0x1453e(%rip), %r14     # 0x19350
movl $0x20, %edi
callq 0x2100
leaq 0x10(%r14), %rcx
testq %r14, %r14
leaq 0x1451e(%rip), %rdx     # 0x19348
cmovneq %rcx, %rdx
movq %rax, (%rdx)
movq %r14, 0x18(%rax)
movq %rax, 0x14514(%rip)     # 0x19350
xorl %ecx, %ecx
movq %rcx, 0x10(%rax)
movq %rcx, (%rax)
movl $0x0, 0x8(%rax)
movl %ebx, 0xc(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/parser.c
// Function: StackPushToken
void StackPushToken(L_TOKEN* token)
{
    if (gParseTop) {
        gParseTop->next = (PARSE_STACK*)malloc(sizeof(PARSE_STACK));
        gParseTop->next->prev = gParseTop;
        gParseTop = gParseTop->next;
    } else {
        gParseStack = gParseTop = (PARSE_STACK*)malloc(sizeof(PARSE_STACK));
        gParseTop->prev = NULL;
    }
    gParseTop->next = NULL;
    gParseTop->token = token;
    gParseTop->type = TOKEN_L_TOKEN;
    gParseTop->state = -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x144eb(%rip), %r14     # 0x19350
movl $0x20, %edi
callq 0x2100
leaq 0x10(%r14), %rcx
testq %r14, %r14
leaq 0x144cb(%rip), %rdx     # 0x19348
cmovneq %rcx, %rdx
movq %rax, (%rdx)
movq %r14, 0x18(%rax)
movq %rax, 0x144c1(%rip)     # 0x19350
movq $0x0, 0x10(%rax)
movq %rbx, (%rax)
movabsq $-0xffffffff, %rcx      # imm = 0xFFFFFFFF00000001
movq %rcx, 0x8(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/parser.c
// Function: StackPushTree
void StackPushTree(SYNTAX_TREE* tree)
{
    if (gParseTop) {
        gParseTop->next = (PARSE_STACK*)malloc(sizeof(PARSE_STACK));
        gParseTop->next->prev = gParseTop;
        gParseTop = gParseTop->next;
    } else {
        gParseStack = gParseTop = (PARSE_STACK*)malloc(sizeof(PARSE_STACK));
        gParseTop->prev = NULL;
    }
    gParseTop->next = NULL;
    gParseTop->token = tree;
    gParseTop->type = TOKEN_SYNTAX_TREE;
    gParseTop->state = -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x14492(%rip), %r14     # 0x19350
movl $0x20, %edi
callq 0x2100
leaq 0x10(%r14), %rcx
testq %r14, %r14
leaq 0x14472(%rip), %rdx     # 0x19348
cmovneq %rcx, %rdx
movq %rax, (%rdx)
movq %r14, 0x18(%rax)
movq %rax, 0x14468(%rip)     # 0x19350
movq $0x0, 0x10(%rax)
movq %rbx, (%rax)
movabsq $-0xfffffffe, %rcx      # imm = 0xFFFFFFFF00000002
movq %rcx, 0x8(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/parser.c
// Function: StackPeek
PARSE_STACK StackPeek()
{
    PARSE_STACK r;
    r.token = NULL;
    r.type = 0;
    r.state = -1;
    
    if (gParseTop) {
        r = *gParseTop;
        r.next = NULL;
        r.prev = NULL;
    }
    
    return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
movq $0x0, (%rdi)
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
movq %rcx, 0x8(%rdi)
movq 0x14427(%rip), %rcx     # 0x19350
testq %rcx, %rcx
je 0x4f3b
movups (%rcx), %xmm0
movups %xmm0, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/parser.c
// Function: StackPop
PARSE_STACK StackPop()
{
    PARSE_STACK r;
    r.token = NULL;
    r.type = 0;
    r.state = -1;
    
    if (gParseTop) {
        r = *gParseTop;
        r.next = NULL;
        r.prev = NULL;
        if (gParseTop->prev) {
            gParseTop = gParseTop->prev;
            free(gParseTop->next);
            gParseTop->next = NULL;
        } else {
            free(gParseTop);
            gParseTop = NULL;
            gParseStack = NULL;
        }
    }
    
    return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq $0x0, (%rdi)
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rax, 0x8(%rdi)
movq 0x143ee(%rip), %rdi     # 0x19350
testq %rdi, %rdi
je 0x4fb8
movups (%rdi), %xmm0
movups %xmm0, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movq 0x18(%rdi), %rax
testq %rax, %rax
je 0x4f9a
movq %rax, 0x143cc(%rip)     # 0x19350
movq 0x10(%rax), %rdi
callq 0x2030
movq 0x143bc(%rip), %rax     # 0x19350
addq $0x10, %rax
jmp 0x4fb1
callq 0x2030
movq $0x0, 0x143a6(%rip) # 0x19350
leaq 0x14397(%rip), %rax     # 0x19348
movq $0x0, (%rax)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/parser.c
// Function: FreeParseStack
void FreeParseStack()
{
    PARSE_STACK s;
    while (gParseStack)
    {
        s = StackPop();
        if (s.type == TOKEN_SYNTAX_TREE)
        {
            SYNTAX_TREE* astSection = (SYNTAX_TREE*)s.token;
            FreeParseTree(astSection);
        }
    }
}

// Assembly:
cmpq $0x0, 0x1437e(%rip)     # 0x19348
je 0x5000
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x28, %rsp
leaq -0x28(%rbp), %rbx
movq %rbx, %rdi
callq 0x4f3d
cmpl $0x2, -0x20(%rbp)
jne 0x4ff0
movq -0x28(%rbp), %rdi
callq 0x5001
cmpq $0x0, 0x14350(%rip)     # 0x19348
jne 0x4fd9
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/parser.c
// Function: FreeParseTree
void FreeParseTree(SYNTAX_TREE* ast)
{
    if (ast && ast->children)
    {
        int i;
        for (i = 0; i < ast->numChildren; i++)
        {
            FreeParseTree(ast->children[i]);
        }
        
        free(ast->children);
        free(ast);
    }
    else if (ast)
    {
        free(ast);
    }
}

// Assembly:
testq %rdi, %rdi
je 0x5050
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
testq %rdi, %rdi
je 0x5044
cmpl $0x0, 0x20(%rbx)
jle 0x503f
xorl %r14d, %r14d
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x5001
incq %r14
movslq 0x20(%rbx), %rax
cmpq %rax, %r14
jl 0x5022
movq 0x28(%rbx), %rdi
callq 0x2030
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2030
retq
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/parser.c
// Function: PrintErrorInput
void PrintErrorInput(L_TOKEN* input, GRAMMAR_TABLE g)
{
    int i;
    if (input)
    {
        printf("Syntax error on line %i: ", (input->line+1));
        if (input->string)
        {
            for (i = 0; i < input->length; i++)
            {
                printf("%c", input->string[i]);
            }
        }
        else
        {
            printf("%s", GetElement(input->token, g));
        }
        printf("\n");
    }
}

// Assembly:
testq %rdi, %rdi
je 0x50a3
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movl 0x14(%rdi), %esi
incl %esi
leaq 0x34b7(%rip), %rdi      # 0x8527
xorl %eax, %eax
callq 0x2090
cmpq $0x0, 0x8(%rbx)
je 0x50a4
cmpl $0x0, 0x10(%rbx)
jle 0x50d9
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
movsbl (%rax,%r14), %edi
callq 0x2040
incq %r14
movslq 0x10(%rbx), %rax
cmpq %rax, %r14
jl 0x5087
jmp 0x50d9
retq
leaq 0x10(%rbp), %rax
movl (%rbx), %edi
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x2db8
leaq 0x3581(%rip), %rdi      # 0x8650
movq %rax, %rsi
xorl %eax, %eax
callq 0x2090
movl $0xa, %edi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x2040
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/parser.c
// Function: PrintParseTreeNode
void PrintParseTreeNode(SYNTAX_TREE* ast, GRAMMAR_TABLE g)
{
    if (!ast) return;
    if (ast->string && ast->token != gSymbolEndLine)
    {
        int i;
        for (i = 0; i < ast->length; i++)
            printf("%c", ast->string[i]);
    }
    else
    {
        printf("%s", GetElement(ast->token, g));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
testq %rdi, %rdi
je 0x58cd
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
movl (%rdi), %edi
je 0x58d6
leaq 0x6816(%rip), %rax      # 0xc0bc
cmpl (%rax), %edi
je 0x58d6
cmpl $0x0, 0x10(%rbx)
jle 0x58cd
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
movsbl (%rax,%r14), %edi
callq 0x2040
incq %r14
movslq 0x10(%rbx), %rax
cmpq %rax, %r14
jl 0x58b3
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x10(%rbp), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x2db8
leaq 0x2d51(%rip), %rdi      # 0x8650
movq %rax, %rsi
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x2090
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/parser.c
// Function: PrintParseTreeRecurse
void PrintParseTreeRecurse(SYNTAX_TREE*  ast,
                           unsigned int  indent,
                           GRAMMAR_TABLE g)
{
    if (ast->children)
    {
		unsigned int u;
        int i;

        for (u = 0; u < indent*2; u++)
        {
            printf(" ");
        }
            
        PrintParseTreeNode(ast, g);
        
        printf(" ::= ");
        
        for (i = 0; i < ast->numChildren; i++)
        {
            PrintParseTreeNode(ast->children[i], g);
            printf(" ");
        }
        
        printf("\n");
        
        for (i = 0; i < ast->numChildren; i++)
        {
            PrintParseTreeRecurse(ast->children[i], indent+1, g);
        }
    }
}

// Assembly:
cmpq $0x0, 0x28(%rdi)
je 0x5a1f
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x10(%rbp), %r15
movl %esi, %r12d
addl %ebx, %r12d
je 0x594b
movl $0x20, %edi
callq 0x2040
decl %r12d
jne 0x593c
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r14, %rdi
callq 0x5883
leaq 0x2a16(%rip), %rdi      # 0x838c
xorl %eax, %eax
callq 0x2090
cmpl $0x0, 0x20(%r14)
jle 0x59c6
xorl %r12d, %r12d
movq 0x28(%r14), %rax
movq (%rax,%r12,8), %rdi
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x5883
movl $0x20, %edi
callq 0x2040
incq %r12
movslq 0x20(%r14), %rax
cmpq %rax, %r12
jl 0x5987
movl $0xa, %edi
callq 0x2040
cmpl $0x0, 0x20(%r14)
jle 0x5a13
incl %ebx
xorl %r12d, %r12d
movq 0x28(%r14), %rax
movq (%rax,%r12,8), %rdi
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movl %ebx, %esi
callq 0x5911
incq %r12
movslq 0x20(%r14), %rax
cmpq %rax, %r12
jl 0x59dc
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/parser.c
// Function: PrintParseTreeFormat
void PrintParseTreeFormat(SYNTAX_TREE*  ast,
                          GRAMMAR_TABLE grammar)
{
    if (ast->numChildren > 0) {
        int i;
        for (i = 0; i < ast->numChildren; i++)
            PrintParseTreeFormat(ast->children[i], grammar);
    } else {
        if (ast->string && ast->token != gSymbolEndLine)
        {
            int i;
            for (i = 0; i < ast->length; i++)
                printf("%c", ast->string[i]);
        }
        else
        {
            printf("%s", GetElement(ast->token, grammar));
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0x10(%rbp), %r14
cmpl $0x0, 0x20(%rdi)
jle 0x5aae
xorl %r15d, %r15d
movq 0x28(%rbx), %rax
movq (%rax,%r15,8), %rdi
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x5a51
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0x5a6e
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, 0x8(%rbx)
movl (%rbx), %edi
je 0x5ae7
leaq 0x65fe(%rip), %rax      # 0xc0bc
cmpl (%rax), %edi
je 0x5ae7
cmpl $0x0, 0x10(%rbx)
jle 0x5aa3
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
movsbl (%rax,%r14), %edi
callq 0x2040
incq %r14
movslq 0x10(%rbx), %rax
cmpq %rax, %r14
jl 0x5acb
jmp 0x5aa3
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x2db8
leaq 0x2b41(%rip), %rdi      # 0x8650
movq %rax, %rsi
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2090
nop
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/tables.c
// Function: AddSourceToList
int AddSourceToList(SOURCE** list, const char* filename, L_TOKEN* lexing, SYNTAX_TREE* syntax)
{
    SOURCE* iterator;
    unsigned int index = 0;

    iterator = *list;
    while (iterator)
    {
        if (strcmp(iterator->filename, filename) == 0)
        { 
            return 0;
        }

        index++;
        if (iterator->next == NULL) break;
        iterator = iterator->next;
    }

    if (iterator)
    {
        iterator->next = (SOURCE*)malloc(sizeof(SOURCE));
        iterator = iterator->next;
    } else {
        *list = (SOURCE*)malloc(sizeof(SOURCE));
        iterator = *list;
    }

    iterator->filename = filename;
    iterator->lexing = lexing;
    iterator->syntax = syntax;
    iterator->next = NULL;
    iterator->index = index;
    return (index + 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, -0x30(%rbp)
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movq (%rdi), %rax
xorl %ebx, %ebx
testq %rax, %rax
je 0x61f5
movq %rax, %r13
movq (%rax), %rdi
movq %r12, %rsi
callq 0x20c0
testl %eax, %eax
je 0x6220
incl %ebx
movq 0x28(%r13), %rax
testq %rax, %rax
jne 0x61cc
addq $0x28, %r13
movq %r13, %r14
movl $0x30, %edi
callq 0x2100
movq %rax, (%r14)
movq %r12, (%rax)
movq %r15, 0x8(%rax)
movq -0x30(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq $0x0, 0x28(%rax)
movl %ebx, 0x18(%rax)
incl %ebx
jmp 0x6222
xorl %ebx, %ebx
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/gregtour[P]minimal-compiler/tables.c
// Function: AddVariableToList
int AddVariableToList(VARLIST** list, TYPE type, const char* name)
{
    VARLIST* iterator;
    unsigned int index = 0;

    iterator = *list;
    while (iterator)
    {
        if (strcmp(iterator->identifier, name) == 0)
        { 
            return 0;
        }

        index++;
        if (iterator->next == NULL) break;
        iterator = iterator->next;
    }

    if (iterator)
    {
        iterator->next = (VARLIST*)malloc(sizeof(VARLIST));
        iterator = iterator->next;
    } else {
        *list = (VARLIST*)malloc(sizeof(VARLIST));
        iterator = *list;
    }

    iterator->identifier = name;
    iterator->type = type;
    iterator->next = NULL;
    iterator->index = index;
    return (index + 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r12
movq (%rdi), %rax
xorl %ebx, %ebx
testq %rax, %rax
je 0x6279
movq %rax, %r13
movq 0x8(%rax), %rdi
movq %r15, %rsi
callq 0x20c0
testl %eax, %eax
je 0x629d
incl %ebx
movq 0x18(%r13), %rax
testq %rax, %rax
jne 0x624f
addq $0x18, %r13
movq %r13, %r12
movl $0x20, %edi
callq 0x2100
movq %rax, (%r12)
movq %r15, 0x8(%rax)
movq %r14, (%rax)
movq $0x0, 0x18(%rax)
movl %ebx, 0x10(%rax)
incl %ebx
jmp 0x629f
xorl %ebx, %ebx
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/gregtour[P]minimal-compiler/tables.c
// Function: AddFunctionToList
int AddFunctionToList(FUNCTION** list, TYPE type, const char* name, VARLIST* params, SYNTAX_BLOCK* source)
{
    FUNCTION* iterator;
    unsigned int index = 0;

    iterator = *list;
    while (iterator)
    {
        if (strcmp(iterator->identifier, name) == 0)
        { 
            return 0;
        }

        index++;
        if (iterator->next == NULL) break;
        iterator = iterator->next;
    }

    if (iterator)
    {
        iterator->next = (FUNCTION*)malloc(sizeof(FUNCTION));
        iterator = iterator->next;
    } else {
        *list = (FUNCTION*)malloc(sizeof(FUNCTION));
        iterator = *list;
    }

    iterator->identifier = name;
    iterator->type = type;
    iterator->parameters = params;
    iterator->block = source;
    iterator->next = NULL;
    iterator->index = index;
    return (index + 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, -0x38(%rbp)
movq %rcx, -0x30(%rbp)
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %r15
movq (%rdi), %rax
xorl %ebx, %ebx
testq %rax, %rax
je 0x6301
movq %rax, %r14
movq 0x8(%rax), %rdi
movq %r13, %rsi
callq 0x20c0
testl %eax, %eax
je 0x6334
incl %ebx
movq 0x28(%r14), %rax
testq %rax, %rax
jne 0x62d7
addq $0x28, %r14
movq %r14, %r15
movl $0x30, %edi
callq 0x2100
movq %rax, (%r15)
movq %r13, 0x8(%rax)
movq %r12, (%rax)
movq -0x30(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq $0x0, 0x28(%rax)
movl %ebx, 0x20(%rax)
incl %ebx
jmp 0x6336
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/tables.c
// Function: FreeSourceList
int FreeSourceList(SOURCE** list)
{
    int count = 0;

    SOURCE* itr;
    itr = *list;
    while (itr)
    {
        *list = itr->next;
        free(itr);
        itr = *list;
    }

    *list = NULL;
    return count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x6369
movq 0x28(%rdi), %rax
movq %rax, (%rbx)
callq 0x2030
movq (%rbx), %rdi
jmp 0x6353
movq $0x0, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/tables.c
// Function: FreeVariableList
int FreeVariableList(VARLIST** list)
{
    int count = 0;
    VARLIST* itr;
    itr = *list;
    while (itr)
    {
        *list = itr->next;
        free(itr);
        itr = *list;
    }

    *list = NULL;
    return count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x639b
movq 0x18(%rdi), %rax
movq %rax, (%rbx)
callq 0x2030
movq (%rbx), %rdi
jmp 0x6385
movq $0x0, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/tables.c
// Function: FreeFunctionList
int FreeFunctionList(FUNCTION** list)
{
    int count = 0;
    FUNCTION* itr;
    itr = *list;
    while (itr)
    {
        *list = itr->next;
        if (itr->parameters != &lStringParam &&
            itr->parameters != &lIntegerParam)
        {
            FreeVariableList(&itr->parameters);
        }
        free(itr);
        itr = *list;
    }

    *list = NULL;
    return count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r14
testq %r14, %r14
je 0x6418
leaq 0x12f38(%rip), %r15     # 0x19300
leaq 0x12f51(%rip), %r12     # 0x19320
movq 0x28(%r14), %rax
movq %rax, (%rbx)
movq 0x10(%r14), %rdi
cmpq %r15, %rdi
sete %al
cmpq %r12, %rdi
sete %cl
orb %al, %cl
testq %rdi, %rdi
sete %al
orb %cl, %al
jne 0x6408
movq 0x18(%rdi), %rax
movq %rax, 0x10(%r14)
callq 0x2030
movq 0x10(%r14), %rdi
testq %rdi, %rdi
jne 0x63f2
movq %r14, %rdi
callq 0x2030
movq (%rbx), %r14
testq %r14, %r14
jne 0x63cf
movq $0x0, (%rbx)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/tables.c
// Function: SourceCount
unsigned int SourceCount(SOURCE* list)
{
    unsigned int count = 0;
    while (list)
    {
        count++;
        list = list->next;
    }
    return count;
}

// Assembly:
testq %rdi, %rdi
je 0x6442
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
incl %eax
movq 0x28(%rdi), %rdi
testq %rdi, %rdi
jne 0x6435
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/tables.c
// Function: VariableCount
unsigned int VariableCount(VARLIST* list)
{
    unsigned int count = 0;
    while (list)
    {
        count++;
        list = list->next;
    }
    return count;
}

// Assembly:
testq %rdi, %rdi
je 0x645d
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
incl %eax
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
jne 0x6450
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/tables.c
// Function: FunctionCount
unsigned int FunctionCount(FUNCTION* list)
{
    unsigned int count = 0;
    while (list)
    {
        count++;
        list = list->next;
    }
    return count;
}

// Assembly:
testq %rdi, %rdi
je 0x6478
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
incl %eax
movq 0x28(%rdi), %rdi
testq %rdi, %rdi
jne 0x646b
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/tables.c
// Function: GetVariableFromList
VARLIST*  GetVariableFromList(VARLIST* variableList, const char* identifier)
{
    while (variableList)
    {
        if (strcmp(variableList->identifier, identifier) == 0)
            return variableList;
        variableList = variableList->next;
    }

    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x64a6
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x20c0
testl %eax, %eax
je 0x64a8
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
jne 0x648d
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/tables.c
// Function: GetFunctionFromList
FUNCTION* GetFunctionFromList(FUNCTION* functionList, const char* identifier)
{
    while (functionList)
    {
        if (strcmp(functionList->identifier, identifier) == 0)
            return functionList;
        functionList = functionList->next;
    }

    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x64db
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x20c0
testl %eax, %eax
je 0x64dd
movq 0x28(%rbx), %rbx
testq %rbx, %rbx
jne 0x64c2
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/tables.c
// Function: GetSourceFromList
SOURCE* GetSourceFromList(SOURCE* sourceList, const char* identifier)
{
    while (sourceList)
    {
        if (strcmp(sourceList->filename, identifier) == 0)
            return sourceList;
        sourceList = sourceList->next;
    }

    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x650f
movq %rsi, %r14
movq %rdi, %rbx
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x20c0
testl %eax, %eax
je 0x6511
movq 0x28(%rbx), %rbx
testq %rbx, %rbx
jne 0x64f7
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/tables.c
// Function: DecompressGotoTable
void DecompressGotoTable(int* source_data, int* dest_data, unsigned int compressed_size, unsigned int total_size)
{
    unsigned int mode = 0;
    unsigned int index = 0;
    unsigned int read_index = 0;
    int lengthRep = 0;
    int copy_value = 0;

    while (/*read_index < compressed_size && */index < total_size)
    {
        if (mode == 0)
        {
            lengthRep = source_data[read_index];
            read_index++;
            while (lengthRep && /*read_index < compressed_size &&*/
                    index < total_size)
            {
                dest_data[index] = source_data[read_index];
                index++; read_index++;
                lengthRep--;
            }
            lengthRep = 0;
            mode = 1;
        } 
        else if (mode == 1) 
        {
            lengthRep = source_data[read_index];
            read_index++;
            copy_value = source_data[read_index];
            read_index++;
            while (lengthRep && index < total_size)
            {
                dest_data[index] = copy_value;
                index++;
                lengthRep--;
            }
            lengthRep = 0;
            mode = 0;
        }
    }
}

// Assembly:
testl %ecx, %ecx
je 0x6675
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %ecx, %eax
xorl %r8d, %r8d
xorl %edx, %edx
xorl %r9d, %r9d
leal 0x1(%r8), %r10d
movl %r8d, %r11d
movl (%rdi,%r11,4), %r11d
testl %r9d, %r9d
jne 0x6619
movl $0x1, %r9d
testl %r11d, %r11d
je 0x6666
cmpl %ecx, %edx
jae 0x6666
movl %edx, %ebx
incq %rbx
movl $0x1, %r14d
subl %r11d, %r14d
xorl %r11d, %r11d
movl %r10d, %r8d
movl %r11d, %r10d
movl %r8d, %r11d
movl (%rdi,%r11,4), %r11d
movl %r11d, -0x4(%rsi,%rbx,4)
incl %r8d
leal -0x1(%r10), %r11d
cmpl %r10d, %r14d
je 0x6614
leaq 0x1(%rbx), %r10
cmpq %rax, %rbx
movq %r10, %rbx
jb 0x65ed
subl %r11d, %edx
jmp 0x6669
addl $0x2, %r8d
xorl %r9d, %r9d
testl %r11d, %r11d
je 0x6669
cmpl %ecx, %edx
jae 0x6669
movl %r10d, %r9d
movl (%rdi,%r9,4), %r9d
movl %edx, %r10d
incq %r10
movl $0x1, %ebx
subl %r11d, %ebx
xorl %r11d, %r11d
movl %r11d, %r14d
movl %r9d, -0x4(%rsi,%r10,4)
leal -0x1(%r14), %r11d
cmpl %r14d, %ebx
je 0x665e
leaq 0x1(%r10), %r14
cmpq %rax, %r10
movq %r14, %r10
jb 0x6641
subl %r11d, %edx
xorl %r9d, %r9d
jmp 0x6669
movl %r10d, %r8d
cmpl %ecx, %edx
jb 0x65b2
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/tables.c
// Function: DecompressActionTable
void DecompressActionTable(int* source_data, ACTION* dest_data, unsigned int compressed_size, unsigned int total_size)
{
    unsigned int mode = 0;
    unsigned int index = 0;
    unsigned int read_index = 0;
    int lengthRep = 0;
    ACTION copy_value;
    copy_value.type = 0;
    copy_value.value = 0;

    while (/*read_index < compressed_size &&*/ index < total_size)
    {
        if (mode == 0)
        {
            lengthRep = source_data[read_index];
            read_index++;
            while (lengthRep && /*read_index < compressed_size &&*/
                    index < total_size)
            {
                dest_data[index].type = source_data[read_index];
                read_index++;
                dest_data[index].value = source_data[read_index];
                read_index++;
                index++;
                lengthRep--;
            }
            lengthRep = 0;
            mode = 1;
        } 
        else if (mode == 1) 
        {
            lengthRep = source_data[read_index];
            read_index++;
            copy_value.type = source_data[read_index];
            read_index++;
            copy_value.value = source_data[read_index];
            read_index++;
            while (lengthRep && index < total_size)
            {
                dest_data[index].type = copy_value.type;
                dest_data[index].value = copy_value.value;
                index++;
                lengthRep--;
            }
            lengthRep = 0;
            mode = 0;
        }
    }
}

// Assembly:
testl %ecx, %ecx
je 0x6772
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
movl %ecx, %eax
xorl %ebx, %ebx
xorl %edx, %edx
xorl %r9d, %r9d
leal 0x1(%rbx), %r10d
movl %ebx, %r8d
movl (%rdi,%r8,4), %r11d
testl %r9d, %r9d
jne 0x6705
movl $0x1, %r9d
testl %r11d, %r11d
je 0x675e
cmpl %ecx, %edx
jae 0x675e
movl %edx, %ebx
incq %rbx
movl $0x1, %r14d
subl %r11d, %r14d
xorl %r11d, %r11d
movl %r10d, %r8d
movl %r11d, %r10d
movl %r8d, %r11d
movl (%rdi,%r11,4), %r11d
movl %r11d, -0x8(%rsi,%rbx,8)
leal 0x1(%r8), %r11d
movl (%rdi,%r11,4), %r11d
movl %r11d, -0x4(%rsi,%rbx,8)
leal -0x1(%r10), %r11d
addl $0x2, %r8d
cmpl %r10d, %r14d
je 0x6700
leaq 0x1(%rbx), %r10
cmpq %rax, %rbx
movq %r10, %rbx
jb 0x66cb
subl %r11d, %edx
jmp 0x6761
leal 0x3(%rbx), %r8d
xorl %r9d, %r9d
testl %r11d, %r11d
je 0x6761
cmpl %ecx, %edx
jae 0x6761
movl %r10d, %r9d
movl (%rdi,%r9,4), %r9d
addl $0x2, %ebx
movl (%rdi,%rbx,4), %r10d
movl %edx, %ebx
incq %rbx
movl $0x1, %r14d
subl %r11d, %r14d
xorl %r11d, %r11d
movl %r11d, %r15d
movl %r9d, -0x8(%rsi,%rbx,8)
movl %r10d, -0x4(%rsi,%rbx,8)
leal -0x1(%r15), %r11d
cmpl %r15d, %r14d
je 0x6756
leaq 0x1(%rbx), %r15
cmpq %rax, %rbx
movq %r15, %rbx
jb 0x6734
subl %r11d, %edx
xorl %r9d, %r9d
jmp 0x6761
movl %r10d, %r8d
movl %r8d, %ebx
cmpl %ecx, %edx
jb 0x6690
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/typechecker.c
// Function: LinkVariableRoot
void LinkVariableRoot(TYPE type, const char* identifier)
{
    if (type.basic == TYPE_VOID)
    {
        CompilerError("Global variable defined as void.");
        return;
    }

    printf("Linking variable %s %s.\n", TypeString(type), identifier);
    if (AddVariableToList(&gPrgrmVariables, type, identifier) == 0)
    {
        CompilerError("Global variable redefined.");
    }
}

// Assembly:
movq %rdi, %rax
shrq $0x20, %rax
jne 0x68ef
leaq 0x213a(%rip), %rdi      # 0x8a18
leaq 0x2111(%rip), %rsi      # 0x89f6
movl $0x4a, %edx
jmp 0x4a64
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
decl %eax
cmpl $0x2, %eax
ja 0x6915
movl %eax, %eax
leaq 0x2020(%rip), %rcx      # 0x892c
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
jmp 0x691c
leaq 0x209f(%rip), %rsi      # 0x89bb
leaq 0x2116(%rip), %rdi      # 0x8a39
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2090
leaq 0x12a3c(%rip), %rdi     # 0x19370
movq %r14, %rsi
movq %rbx, %rdx
callq 0x6233
testl %eax, %eax
popq %rbx
popq %r14
popq %rbp
je 0x6948
retq
leaq 0x2103(%rip), %rdi      # 0x8a52
leaq 0x20a0(%rip), %rsi      # 0x89f6
movl $0x51, %edx
jmp 0x4a64
// File: /workspace/github_c_makefile_star2_O3/gregtour[P]minimal-compiler/typechecker.c
// Function: LinkSourceRoot
void LinkSourceRoot(const char* sourceFile, SYNTAX_TREE** tree)
{
    printf("Linking source file %s.\n", sourceFile);
    
    // allow for linking multiple source files in one project
    if (AddSourceToList(&gPrgrmSources, sourceFile, NULL, NULL) != 0)
    {
        SOURCE* source = GetSourceFromList(gPrgrmSources, sourceFile);

        source->lexing = LexSource(sourceFile, 
                                   &source->buffer, 
                                   CONTEXT_FREE_GRAMMAR);
        if (source->lexing == NULL) {
            printf("Error lexing source '%s'.\n", sourceFile);
            FreeLexing(source->lexing, source->buffer);
            return;
        }

        source->syntax = ParseSource(source->lexing,
                                     PARSE_TABLE,
                                     CONTEXT_FREE_GRAMMAR);
        if (source->syntax == NULL) {
            printf("Error parsing source '%s'.\n", sourceFile);
            FreeLexing(source->lexing, source->buffer);
            source->lexing = NULL;
            return;
        }

        PrePassReductions(&source->syntax);
        SourceReductions(&source->syntax);
        // add to intermediate framework
        FirstPassStaticAnalyzer(source->syntax);
    }
    
    // link standard library
    // if (IsLibraryDefinition(sourceFile))
    // {
    //    LinkLibrary(sourceFile);
    // }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
leaq 0x20f6(%rip), %rdi      # 0x8a6d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2090
leaq 0x129e0(%rip), %r14     # 0x19368
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x61ac
testl %eax, %eax
je 0x6a9e
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x64e5
movq %rax, %r14
leaq 0x20(%rax), %rsi
leaq 0x6068(%rip), %r15      # 0xca20
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x4061
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x6a50
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups %xmm2, 0x40(%rsp)
movups %xmm1, 0x30(%rsp)
movups %xmm0, 0x20(%rsp)
leaq 0x1283f(%rip), %rcx     # 0x19248
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rax, %rdi
callq 0x53ce
movq %rax, 0x10(%r14)
testq %rax, %rax
je 0x6a78
addq $0x10, %r14
movq %r14, %rdi
callq 0x5b24
movq %r14, %rdi
callq 0x5cf8
movq (%r14), %rdi
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5d17
leaq 0x202f(%rip), %rdi      # 0x8a86
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2090
movq 0x8(%r14), %rdi
movq 0x20(%r14), %rsi
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4972
leaq 0x2022(%rip), %rdi      # 0x8aa1
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2090
movq 0x8(%r14), %rdi
movq 0x20(%r14), %rsi
callq 0x4972
movq $0x0, 0x8(%r14)
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/htsfile.c
// Function: error
void HTS_FORMAT(HTS_PRINTF_FMT, 1, 2) error(const char *format, ...)
{
    int err = errno;
    va_list args;
    va_start(args, format);
    fflush(stdout);
    fprintf(stderr, "htsfile: ");
    vfprintf(stderr, format, args);
    if (err) fprintf(stderr, ": %s\n", strerror(err));
    else fprintf(stderr, "\n");
    fflush(stderr);
    va_end(args);
    status = EXIT_FAILURE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %r15
movq %rsi, 0x8(%r15)
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
testb %al, %al
je 0x4a84
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
callq 0x4050
movl (%rax), %ebp
movq %rsp, %r14
movq %r15, 0x10(%r14)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%r14)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%r14)
movq 0xc84fe(%rip), %rax     # 0xccfb0
movq (%rax), %rdi
callq 0x45c0
movq 0xc850f(%rip), %r15     # 0xccfd0
movq (%r15), %rcx
leaq 0xa2539(%rip), %rdi     # 0xa7004
pushq $0x9
popq %rsi
pushq $0x1
popq %rdx
callq 0x49f0
movq (%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x46d0
movq (%r15), %rbx
testl %ebp, %ebp
jne 0x4b16
pushq $0xa
popq %rdi
movq %rbx, %rsi
callq 0x4670
movq (%r15), %rdi
callq 0x45c0
movl $0x1, 0xc8a64(%rip)     # 0xcd56c
addq $0xd8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, %edi
callq 0x4150
leaq 0xab7eb(%rip), %rsi     # 0xb030f
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x4750
jmp 0x4af6
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/htsfile.c
// Function: view_raw
static void view_raw(hFILE *fp, const char *filename)
{
    int c, prev;
    for (prev = '\n'; (c = hgetc(fp)) != EOF; prev = c)
        if (isprint(c) || c == '\n' || c == '\t') putchar(c);
        else if (c == '\r') fputs("\\r", stdout);
        else if (c == '\0') fputs("\\0", stdout);
        else printf("\\x%02x", c);

    if (prev != '\n') putchar('\n');

    if (herrno(fp)) {
        errno = herrno(fp);
        error("reading \"%s\" failed", filename);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
movq %rdi, %r14
movl $0xa, %r15d
movq 0xc66fe(%rip), %rbx     # 0xccfb0
leaq 0xa0b09(%rip), %r12     # 0xa73c2
leaq 0xa0b08(%rip), %r13     # 0xa73c8
movq 0x8(%r14), %rax
cmpq %rax, 0x10(%r14)
jbe 0x68d7
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%r14)
movzbl (%rax), %ebp
jmp 0x68e6
movq %r14, %rdi
callq 0x6b73
movl %eax, %ebp
cmpl $-0x1, %eax
je 0x6949
callq 0x4520
leal -0x9(%rbp), %ecx
cmpl $0x2, %ecx
jb 0x6915
movq (%rax), %rax
movslq %ebp, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x4000, %eax           # imm = 0x4000
jne 0x6915
testl %ebp, %ebp
je 0x6921
cmpl $0xd, %ebp
jne 0x6935
movq (%rbx), %rsi
movq %r12, %rdi
jmp 0x692b
movl %ebp, %edi
callq 0x4700
movl %ebp, %r15d
jmp 0x68c0
movq (%rbx), %rsi
leaq 0xa0a9a(%rip), %rdi     # 0xa73c5
callq 0x4570
movl %ebp, %r15d
jmp 0x68c0
movq %r13, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x4060
movl %ebp, %r15d
jmp 0x68c0
cmpl $0xa, %r15d
je 0x6959
movl $0xa, %edi
callq 0x4700
movl 0x34(%r14), %ebx
testl %ebx, %ebx
jne 0x6970
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4050
movl %ebx, (%rax)
leaq 0xa0a30(%rip), %rdi     # 0xa73ae
movq (%rsp), %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4a20
nop
// File: /workspace/github_c_makefile_star2_O3/mcxiaoke[P]dsaac/ch3/list_simple/list.c
// Function: sort
List sort(List list)
{
    Node* tail = NULL;
    while(tail != list->next)
    {
        Node* pre = list;
        Node* cur = pre->next;
        while(cur != tail && cur->next != tail)
        {
            Node *tmp=cur->next;
            if( cur->value > tmp->value )
            {
                //swap current and next node
                pre->next = tmp;
                cur->next = tmp->next;
                pre->next->next = cur;
            }
            pre = pre->next;
            cur = pre->next;
        }
        tail = cur;
    }
    return list;
}

// Assembly:
movq %rdi, %rax
movq 0x8(%rdi), %rsi
testq %rsi, %rsi
je 0x143b
xorl %ecx, %ecx
movq %rsi, %rdx
movq %rax, %rsi
movq 0x8(%rdx), %rdi
cmpq %rcx, %rdi
je 0x142f
movl (%rdx), %r8d
cmpl (%rdi), %r8d
jle 0x141f
movq %rdi, 0x8(%rsi)
movq 0x8(%rdi), %rdi
movq %rdi, 0x8(%rdx)
movq 0x8(%rsi), %rdi
movq %rdx, 0x8(%rdi)
movq 0x8(%rsi), %rdx
movq 0x8(%rdx), %rdi
movq %rdx, %rsi
movq %rdi, %rdx
cmpq %rcx, %rdi
jne 0x13f2
movq %rcx, %rdx
jmp 0x1432
movq %rdx, %rcx
movq 0x8(%rax), %rsi
cmpq %rsi, %rdx
jne 0x13ec
retq
// File: /workspace/github_c_makefile_star2_O3/mcxiaoke[P]dsaac/ch3/list_simple/list.c
// Function: reverse
List reverse(List list)
{
    assert(list!=NULL);
    if(list->next==NULL)
    {
        return list;
    }
    Node* p;
    Node* q;
    Node* tmp;
    p=list->next;
    q=p->next;
    p->next=NULL;
    while(q!=NULL)
    {
        tmp=q->next;
        q->next=p;
        p=q;
        q=tmp;
    }
    list->next=p;
    return list;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x147d
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x1478
movq 0x8(%rax), %rcx
movq $0x0, 0x8(%rax)
testq %rcx, %rcx
je 0x1471
movq %rcx, %rdx
movq 0x8(%rcx), %rcx
movq %rax, 0x8(%rdx)
movq %rdx, %rax
testq %rcx, %rcx
jne 0x145c
jmp 0x1474
movq %rax, %rdx
movq %rdx, 0x8(%rdi)
movq %rdi, %rax
popq %rcx
retq
leaq 0xb95(%rip), %rdi       # 0x2019
leaq 0xb99(%rip), %rsi       # 0x2024
leaq 0xc38(%rip), %rcx       # 0x20ca
movl $0x94, %edx
callq 0x1060
// File: /workspace/github_c_makefile_star2_O3/mcxiaoke[P]dsaac/ch3/list_simple/list.c
// Function: main
int main(int argc, char **argv)
{
    List list=createList();
    int i;
    Node* lastNode=list;
    for(i=0; i<10; i++)
    {
        Node* node=(Node*)malloc(sizeof(Node));
        if(node==NULL)
        {
            fatal("memory allocate failed.");
        }
        Node* current=insert(rand()%100, lastNode, list);
        //Node* current=insert(i, lastNode, list);
        lastNode=current;
    }
    print(list);
    sort(list);
    print(list);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl $0xa, %ebp
callq 0x119c
movq %rax, %rbx
movq %rax, %r14
callq 0x1090
movslq %eax, %rdi
imulq $0x51eb851f, %rdi, %rax # imm = 0x51EB851F
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x25, %rax
addl %ecx, %eax
imull $0x64, %eax, %eax
subl %eax, %edi
movq %r14, %rsi
callq 0x1338
movq %rax, %r14
decl %ebp
jne 0x1580
movq %rbx, %rdi
callq 0x149c
movq %rbx, %rdi
callq 0x13de
movq %rbx, %rdi
callq 0x149c
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq