LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/assembler.c
// Function: match_cfg
int match_cfg(token_t token) {
    if(cfg_assembler->lookahead == token) {
        cfg_assembler->lineno = cfg_assembler->tokenizer->lineno;
        cfg_assembler->colno = cfg_assembler->tokenizer->colno;
        cfg_assembler->lookahead = get_next_token(cfg_assembler->tokenizer);
    } 
    else {
        report_cfg("Expected %s on line %ld, col %ld", get_token_str(token), cfg_assembler->lineno, cfg_assembler->colno);
        return 0;
    }
    return 1;
}

// Assembly:
pushq %rbx
movq 0x8a8f(%rip), %rax      # 0xc5b8
cmpl %edi, 0x40(%rax)
jne 0x3b52
movq (%rax), %rdi
movups 0x38(%rdi), %xmm0
movups %xmm0, 0x98(%rax)
callq 0x6bfa
movq 0x8a70(%rip), %rcx      # 0xc5b8
movl %eax, 0x40(%rcx)
movl $0x1, %ebx
jmp 0x3b7f
callq 0x6d36
movq 0x8a5a(%rip), %rcx      # 0xc5b8
movq 0x98(%rcx), %rdx
movq 0xa0(%rcx), %rcx
leaq 0x3810(%rip), %rdi      # 0x7383
xorl %ebx, %ebx
movq %rax, %rsi
xorl %eax, %eax
callq 0x365c
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/assembler.c
// Function: end_line_cfg
void end_line_cfg() {
    switch(cfg_assembler->lookahead) {
        case TOK_EOL:
            match_cfg(TOK_EOL);
            break;
        case TOK_NULL:
            cfg_assembler->lineno++;
            break;
        default:
            report_cfg("Unexpected %s on line %ld, col %ld", get_token_str(cfg_assembler->lookahead), cfg_assembler->lineno, cfg_assembler->colno);
    }
}

// Assembly:
movq 0x8a2e(%rip), %rax      # 0xc5b8
movl 0x40(%rax), %edi
testl %edi, %edi
je 0x3ba0
cmpl $0x7, %edi
jne 0x3ba8
movl $0x7, %edi
jmp 0x3b21
incq 0x98(%rax)
retq
pushq %rax
callq 0x6d36
movq 0x8a03(%rip), %rcx      # 0xc5b8
movq 0x98(%rcx), %rdx
movq 0xa0(%rcx), %rcx
leaq 0x37da(%rip), %rdi      # 0x73a4
movq %rax, %rsi
xorl %eax, %eax
popq %r8
jmp 0x365c
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/assembler.c
// Function: operand_list_cfg
struct operand_node *operand_list_cfg() {
    struct operand_node *root = NULL;
    struct operand_node *current_operand = NULL;

    while(1) {
        switch(cfg_assembler->lookahead) {
            case TOK_REGISTER:
            case TOK_IDENTIFIER:
            case TOK_INTEGER:
            case TOK_STRING:
            case TOK_LPAREN:
                if(current_operand == NULL) {
                    current_operand = operand_cfg();
                    if(root == NULL) root = current_operand;
                }
                else {
                    current_operand->next = operand_cfg();
                    current_operand = current_operand->next;
                }
                if(cfg_assembler->lookahead == TOK_COMMA) {
                    match_cfg(TOK_COMMA);
                    continue;
                }
                else if (cfg_assembler->lookahead == TOK_REGISTER || cfg_assembler->lookahead == TOK_IDENTIFIER 
                            || cfg_assembler->lookahead == TOK_STRING || cfg_assembler->lookahead == TOK_LPAREN
                            || cfg_assembler->lookahead == TOK_INTEGER) continue;
                return root;
            case TOK_EOL:
            case TOK_NULL:
                report_cfg("Expected operand after line %ld, col %ld", cfg_assembler->lineno, cfg_assembler->colno);
                return root;
            default:
                report_cfg("Invalid operand '%s' on line %ld, col %ld", cfg_assembler->tokenizer->lexbuf, cfg_assembler->lineno, cfg_assembler->colno);
                return root;
        }
    }

    return root;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x867c(%rip), %rax      # 0xc5b8
xorl %ebx, %ebx
movl $0x638, %ebp            # imm = 0x638
xorl %r15d, %r15d
movl 0x40(%rax), %ecx
cmpl $0xa, %ecx
ja 0x3fc7
btl %ecx, %ebp
jae 0x3f9f
callq 0x3d0d
movq %rax, %r14
testq %r15, %r15
je 0x3f66
movq %r14, 0x10(%r15)
jmp 0x3f6d
testq %rbx, %rbx
cmoveq %r14, %rbx
movq 0x8644(%rip), %rax      # 0xc5b8
movl 0x40(%rax), %ecx
cmpl $0xa, %ecx
ja 0x3fea
btl %ecx, %ebp
movq %r14, %r15
jb 0x3f46
cmpl $0x2, %ecx
jne 0x3fea
movl $0x2, %edi
callq 0x3b21
movq 0x861e(%rip), %rax      # 0xc5b8
movq %r14, %r15
jmp 0x3f46
movl $0x81, %edx
btl %ecx, %edx
jae 0x3fc7
movq 0x98(%rax), %rsi
movq 0xa0(%rax), %rdx
leaq 0x34ae(%rip), %rdi      # 0x746c
xorl %eax, %eax
callq 0x365c
jmp 0x3fea
movq (%rax), %rcx
movq 0x98(%rax), %rdx
movq 0x10(%rcx), %rsi
movq 0xa0(%rax), %rcx
leaq 0x34b2(%rip), %rdi      # 0x7495
xorl %eax, %eax
callq 0x365c
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/assembler.c
// Function: destroy_instruction
void destroy_instruction(struct instruction_node *instr) {
    /* Free operands */
    struct operand_node *op_node = instr->operand_list;
    while(op_node != NULL) {
        struct operand_node *next_op = op_node->next;
        if(op_node->operand == OPERAND_LABEL || op_node->operand == OPERAND_STRING) free(op_node->identifier);
        free(op_node);
        op_node = next_op;
    }
    free(instr);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %r14
testq %r14, %r14
je 0x41c3
movq 0x10(%r14), %r15
movzbl (%r14), %eax
cmpl $0x10, %eax
je 0x41aa
cmpl $0x1, %eax
jne 0x41b3
movq 0x8(%r14), %rdi
callq 0x3030
movq %r14, %rdi
callq 0x3030
movq %r15, %r14
testq %r15, %r15
jne 0x4198
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3030
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/assembler.c
// Function: assemble_instruction
int assemble_instruction(struct instruction_node *instr) {
    if(instr == NULL || instr->mnemonic == NULL) return 0;

    if(!verify_operand_list(instr->mnemonic, instr->operand_list)) {
        destroy_instruction(instr);
        return 0;
    }

    int assemble_status;

    /* TO-DO: Assemble (?) instruction */
    if(cfg_assembler->segment == SEGMENT_DATA) {
        fprintf(stderr, "Cannot define instructions in .data segment on line %ld\n", cfg_assembler->lineno);
        cfg_assembler->status = ASSEMBLER_STATUS_FAIL;
        destroy_instruction(instr);
        return 0;
    }

    struct opcode_entry *entry = (struct opcode_entry *)instr->mnemonic->attrptr;

    if(entry->type == OPTYPE_PSUEDO) {
        assemble_status = assemble_psuedo_instruction(instr);
    }
    else if(entry->opcode == 0x00) {
        assemble_status = assemble_funct_instruction(instr);     
    }
    else {
        assemble_status = assemble_opcode_instruction(instr); 
    }

    return assemble_status;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x5093
movq %rdi, %r14
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x5093
movq 0x8(%r14), %rsi
callq 0x3ff8
testl %eax, %eax
je 0x505e
movq 0x7583(%rip), %rdi      # 0xc5b8
cmpb $0x1, 0x45(%rdi)
je 0x508b
movq (%r14), %rax
movq 0x10(%rax), %rax
movzwl 0x6(%rax), %ecx
andl $0x3, %ecx
cmpw $0x1, %cx
jne 0x5068
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x41d0
movq %r14, %rdi
callq 0x4187
jmp 0x5093
cmpb $0x0, (%rax)
je 0x507c
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4c23
movq %r14, %rdi
callq 0x4b06
movl $0x1, %ebx
jmp 0x5093
movq %r14, %rsi
callq 0x323b
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/assembler.c
// Function: instruction_list_cfg
void instruction_list_cfg() {  
    while(1) {  
        while(cfg_assembler->lookahead == TOK_NULL) {
            /* Free current tokenizer */
            destroy_tokenizer(&cfg_assembler->tokenizer);
            remove_front(cfg_assembler->tokenizer_list, LN_VSTATIC);

            /* No more files to process */
            if(cfg_assembler->tokenizer_list->front == NULL) return;  
            
            /* Setup tokenizer */
            cfg_assembler->tokenizer = (struct tokenizer *)cfg_assembler->tokenizer_list->front->value;

            /* Setup lookahead */
            cfg_assembler->lookahead = get_next_token(cfg_assembler->tokenizer);
        }
    
        if(cfg_assembler->lookahead != TOK_NULL) {
            instruction_cfg();
        }
    }
}

// Assembly:
pushq %rax
movq 0x6f93(%rip), %rdi      # 0xc5b8
cmpl $0x0, 0x40(%rdi)
jne 0x5679
callq 0x6ced
movq 0x6f81(%rip), %rax      # 0xc5b8
movq 0x8(%rax), %rdi
xorl %esi, %esi
callq 0x59e4
movq 0x6f6f(%rip), %rax      # 0xc5b8
movq 0x8(%rax), %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x5680
movq 0x8(%rcx), %rcx
movq %rcx, (%rax)
movq 0x6f55(%rip), %rax      # 0xc5b8
movq (%rax), %rdi
callq 0x6bfa
movq 0x6f46(%rip), %rdi      # 0xc5b8
movl %eax, 0x40(%rdi)
testl %eax, %eax
je 0x562b
callq 0x547e
jmp 0x561e
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/assembler.c
// Function: program_cfg
void program_cfg(struct assembler *assembler) {
    cfg_assembler = assembler;

    instruction_list_cfg();
    
    /* Verify undefined symbol table */
    for(struct list_node *head = assembler->decl_symlist->front; head != NULL; head = head->next) {
        struct symbol_table_entry *sym_entry = (struct symbol_table_entry *)head->value;
        symstat_t status = sym_entry->status;
        if(status == SYMBOL_UNDEFINED) {
            /* Symbol is still undefined, program cannot be assembled */
            fprintf(stderr, "Symbol Error: Undefined symbol '%s'\n", ((struct symbol_table_entry *)head->value)->key);
            struct list_node *instr_ref = sym_entry->instr_list->front;
            while(instr_ref != NULL) {
                destroy_instruction((struct instruction_node *)instr_ref->value);
                instr_ref = instr_ref->next;
            }
            assembler->status = ASSEMBLER_STATUS_FAIL;
        } else {
            struct list_node *instr_ref = sym_entry->instr_list->front;
            while(instr_ref != NULL) {
                if(((struct instruction_node *)instr_ref->value)->mnemonic->token == TOK_MNEMONIC) {
                    assembler->segment = ((struct instruction_node *)instr_ref->value)->segment;
                    assembler->segment_offset[assembler->segment] = ((struct instruction_node *)instr_ref->value)->offset;
                    assemble_instruction((struct instruction_node *)instr_ref->value); 
                    destroy_instruction((struct instruction_node *)instr_ref->value);
                }
                else if(((struct instruction_node *)instr_ref->value)->mnemonic->token == TOK_DIRECTIVE) {
                    assembler->segment = ((struct instruction_node *)instr_ref->value)->segment;
                    assembler->segment_offset[assembler->segment] = ((struct instruction_node *)instr_ref->value)->offset;
                    check_directive((struct instruction_node *)instr_ref->value); 
                    destroy_instruction((struct instruction_node *)instr_ref->value);
                }
                instr_ref = instr_ref->next;
            }
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rdi, 0x6f24(%rip)      # 0xc5b8
callq 0x561d
movq 0x18(%rbx), %rax
movq (%rax), %r15
testq %r15, %r15
je 0x571c
leaq 0x44(%rbx), %r14
movq 0x8(%r15), %rdi
cmpb $0x0, 0x8(%rdi)
je 0x570c
movq 0x18(%rdi), %rax
movq (%rax), %r12
testq %r12, %r12
je 0x5714
movq 0x8(%r12), %rdi
movq (%rdi), %rax
movl 0x8(%rax), %eax
cmpl $0xc, %eax
je 0x56e9
cmpl $0x8, %eax
jne 0x5706
movzbl 0x14(%rdi), %eax
movb %al, 0x45(%rbx)
movl 0x10(%rdi), %ecx
movl %ecx, 0x48(%rbx,%rax,4)
callq 0x500b
jmp 0x56fc
movzbl 0x14(%rdi), %eax
movb %al, 0x45(%rbx)
movl 0x10(%rdi), %ecx
movl %ecx, 0x48(%rbx,%rax,4)
callq 0x509d
movq 0x8(%r12), %rdi
callq 0x4187
movq (%r12), %r12
jmp 0x56ba
movq %r14, %rsi
callq 0x3365
movq (%r15), %r15
testq %r15, %r15
jne 0x56a9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/assembler.c
// Function: destroy_tokenizer_list
void destroy_tokenizer_list(struct assembler *assembler) {
    struct list_node *node = assembler->tokenizer_list->front;
    while(node != NULL) {
        destroy_tokenizer((struct tokenizer **)&node->value);
        node = node->next;
    }
    delete_linked_list(&(assembler->tokenizer_list), LN_VSTATIC);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rax
addq $0x8, %rbx
movq (%rax), %r14
testq %r14, %r14
je 0x574d
leaq 0x8(%r14), %rdi
callq 0x6ced
movq (%r14), %r14
jmp 0x573a
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5a59
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/assembler.c
// Function: destroy_assembler
void destroy_assembler(struct assembler **assembler) {
    /* Free all segment memory */
    for(segment_t segment = 0; segment < MAX_SEGMENTS; ++segment) {
        free((*assembler)->segment_memory[segment]);
    }

    /* Simple free the data */
    free(*assembler);

    /* Set assembler to NULL */
    *assembler = NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq (%rbx), %rax
movq 0x20(%rax,%r14,8), %rdi
callq 0x3030
incq %r14
cmpq $0x4, %r14
jne 0x591b
movq (%rbx), %rdi
callq 0x3030
movq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/linkedlist.c
// Function: insert_front
void insert_front(struct linked_list *list, void *value)
{
	struct list_node *node = (struct list_node *)malloc(sizeof(struct list_node));
	
	if(node == NULL) { 
        perror("CRITICAL ERROR: Failed to allocate memory for linked list node: ");
        exit(EXIT_FAILURE);
    }
	
	node->next = list->front;
	node->value = value;

	list->front = node;
	
	if(list->rear == NULL)
	{
		list->rear = node;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x10, %edi
callq 0x30f0
testq %rax, %rax
je 0x599c
movq (%rbx), %rcx
movq %rcx, (%rax)
movq %r14, 0x8(%rax)
movq %rax, (%rbx)
cmpq $0x0, 0x8(%rbx)
jne 0x5994
movq %rax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x33af
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/linkedlist.c
// Function: insert_rear
void insert_rear(struct linked_list *list, void *value)
{
	struct list_node *node = (struct list_node *)malloc(sizeof(struct list_node));

	if(node == NULL) { 
        perror("CRITICAL ERROR: Failed to allocate memory for linked list node: ");
        exit(EXIT_FAILURE);
    }

	node->value = value;
	node->next = NULL;

	if(list->rear != NULL)
	{
		list->rear->next = node;
		list->rear = node;
	}
	else
	{
		list->rear = list->front = node;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x10, %edi
callq 0x30f0
testq %rax, %rax
je 0x59df
movq %r14, 0x8(%rax)
movq $0x0, (%rax)
movq 0x8(%rbx), %rcx
testq %rcx, %rcx
cmoveq %rbx, %rcx
movq %rax, (%rcx)
movq %rax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x33c4
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/linkedlist.c
// Function: remove_front
void remove_front(struct linked_list *list, short mode) {
	struct list_node *front = list->front;
	
	if(list->front == NULL) return;

	if(list->front == list->rear)
		list->front = list->rear = front->next;
	else 
		list->front = list->front->next;
	
	if(mode == LN_VDYNAMIC)
		free(front->value);
	
	free(front);
}

// Assembly:
pushq %rbx
movq (%rdi), %rbx
testq %rbx, %rbx
je 0x5a15
movq (%rbx), %rax
cmpq 0x8(%rdi), %rbx
jne 0x59fa
movq %rax, 0x8(%rdi)
movq %rax, (%rdi)
cmpw $0x1, %si
jne 0x5a0c
movq 0x8(%rbx), %rdi
callq 0x3030
movq %rbx, %rdi
popq %rbx
jmp 0x3030
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/linkedlist.c
// Function: remove_from_list
void remove_from_list(struct linked_list *list, void *value)
{
    struct list_node *curr = list->front;
    struct list_node *prev = NULL;

    while(curr != NULL)
    {
        if(curr->value == value)
        {
            if(prev != NULL)
                prev->next = curr->next;

            if(curr == list->front) list->front = curr->next;
            if(curr == list->rear)  list->rear = prev;
			
			free(curr);

            break;
        }

        prev = curr;
        curr = curr->next;
    }
}

// Assembly:
xorl %edx, %edx
movq %rdi, %rax
movq (%rax), %rax
testq %rax, %rax
je 0x5a58
movq %rdx, %rcx
movq %rax, %rdx
cmpq %rsi, 0x8(%rax)
jne 0x5a1c
testq %rcx, %rcx
je 0x5a3b
movq (%rax), %rdx
movq %rdx, (%rcx)
cmpq (%rdi), %rax
jne 0x5a46
movq (%rax), %rdx
movq %rdx, (%rdi)
cmpq 0x8(%rdi), %rax
jne 0x5a50
movq %rcx, 0x8(%rdi)
movq %rax, %rdi
jmp 0x3030
retq
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/linkedlist.c
// Function: delete_linked_list
void delete_linked_list(struct linked_list **lp, short mode)
{
	if(*lp == NULL) return;
    
	delete_list((*lp)->front, mode);
	free(*lp);
	
	*lp = NULL;
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x5a80
pushq %rbx
movq %rdi, %rbx
movq (%rax), %rdi
movswl %si, %esi
callq 0x5a81
movq (%rbx), %rdi
callq 0x3030
movq $0x0, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/linkedlist.c
// Function: delete_list
void delete_list(struct list_node *listnode, short mode)
{
	struct list_node *node = listnode;
	struct list_node *temp;
	
	while(node != NULL)
	{
		if(mode == LN_VDYNAMIC)
			free(node->value);
	
		temp = node;
		node = node->next;
		free(temp);
	}
}

// Assembly:
testq %rdi, %rdi
je 0x5ab7
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
cmpw $0x1, %bx
jne 0x5a9f
movq 0x8(%r14), %rdi
callq 0x3030
movq (%r14), %r15
movq %r14, %rdi
callq 0x3030
movq %r15, %r14
testq %r15, %r15
jne 0x5a90
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/main.c
// Function: display_help_msg
void display_help_msg(char *program) {
    printf("Usage: %s [-a] [-h] [-t output] [-d output] [-o output] file...\n", program);
    printf("A MIPS assembler written in C\n\n");
    printf("The following options may be used:\n");
    printf("  %-20s Only assembles program, does not create object code file\n", "-a");
    printf("  %-20s * Note: This does not disable segment dumps\n", "");
    printf("  %-20s Stores data segment in <output>\n", "-d <output>");
    printf("  %-20s Displays this message\n", "-h");
    printf("  %-20s Stores text segment in <output>\n", "-t <output>");
    printf("  %-20s Stores object code in <output>\n", "-o <output>");
    printf("  %-20s * Note: If this option is not specified, <output> defaults to a.obj\n\n", "");
    printf("Refer to the repository at <https://github.com/tstword/MIPSAssemblerC>\n");
    exit(EXIT_SUCCESS);
}

// Assembly:
pushq %rbx
movq %rdi, %rsi
leaq 0x1c35(%rip), %rdi      # 0x76f8
xorl %eax, %eax
callq 0x3070
leaq 0x1e5a(%rip), %rdi      # 0x792b
callq 0x3040
leaq 0x1e6d(%rip), %rdi      # 0x794a
callq 0x3040
leaq 0x1c50(%rip), %rdi      # 0x7739
leaq 0x1c8b(%rip), %rsi      # 0x777b
xorl %eax, %eax
callq 0x3070
leaq 0x1c80(%rip), %rdi      # 0x777e
leaq 0x1dbb(%rip), %rbx      # 0x78c0
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3070
leaq 0x1c9d(%rip), %rdi      # 0x77b3
leaq 0x1cbf(%rip), %rsi      # 0x77dc
xorl %eax, %eax
callq 0x3070
leaq 0x1cbd(%rip), %rdi      # 0x77e8
leaq 0x1cd5(%rip), %rsi      # 0x7807
xorl %eax, %eax
callq 0x3070
leaq 0x1cca(%rip), %rdi      # 0x780a
leaq 0x1cec(%rip), %rsi      # 0x7833
xorl %eax, %eax
callq 0x3070
leaq 0x1cea(%rip), %rdi      # 0x783f
leaq 0x1d0b(%rip), %rsi      # 0x7867
xorl %eax, %eax
callq 0x3070
leaq 0x1d09(%rip), %rdi      # 0x7873
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3070
leaq 0x1df2(%rip), %rdi      # 0x796d
callq 0x3040
xorl %edi, %edi
callq 0x3150
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/mipsfhdr.c
// Function: dump_segment
void dump_segment(struct assembler *assembler, segment_t segment, const char *file) {
    FILE *fp;
    if((fp = fopen_wrap(file, "wb+")) == NULL) {
        fprintf(stderr, "Failed to open output file '%s': Error: ", file);
        perror(NULL);
        destroy_assembler(&assembler);
        exit(EXIT_FAILURE);
    }

    size_t nbytes = fwrite(assembler->segment_memory[segment], 0x1, assembler->segment_memory_offset[segment], fp);
    if(nbytes != assembler->segment_memory_offset[segment]) {
        perror("Segment Dump Error: Failed to write segment to file: ");
        destroy_assembler(&assembler);
        exit(EXIT_FAILURE);
    }

    fclose(fp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %rbx
movq %rdi, (%rsp)
leaq 0x1b2e(%rip), %rsi      # 0x79b4
movq %rdx, %rdi
callq 0x5948
testq %rax, %rax
je 0x5eca
movq %rax, %r14
movzbl %bpl, %r15d
movq 0x20(%rbx,%r15,8), %rdi
movq 0x58(%rbx,%r15,8), %rdx
movl $0x1, %esi
movq %rax, %rcx
callq 0x3160
cmpq 0x58(%rbx,%r15,8), %rax
jne 0x5ed5
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3060
movq %rsp, %rsi
movq %r15, %rdi
callq 0x3506
movq %rsp, %rdi
callq 0x34e6
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/symtable.c
// Function: djb2hash
size_t djb2hash(const char *str) {
    const unsigned char *key = (const unsigned char *)str;
    size_t hash = 5381;
    int c;

    while ((c = *key++))
        hash = ((hash << 5) + hash) + c; /* hash * 33 + c */

    return hash;
}

// Assembly:
movb (%rdi), %cl
testb %cl, %cl
je 0x5f08
incq %rdi
movl $0x1505, %eax           # imm = 0x1505
movq %rax, %rdx
shlq $0x5, %rdx
addq %rax, %rdx
movzbl %cl, %eax
addq %rdx, %rax
movb (%rdi), %cl
incq %rdi
testb %cl, %cl
jne 0x5eee
retq
movl $0x1505, %eax           # imm = 0x1505
retq
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/symtable.c
// Function: create_symbol_table
struct symbol_table *create_symbol_table() {
    struct symbol_table *symtab = (struct symbol_table *)malloc(sizeof(struct symbol_table));
    
    symtab->buckets = (struct symbol_table_entry **)calloc(32, sizeof(struct symbol_table_entry));
    symtab->bucket_size = 32;
    symtab->length = 0;

    return symtab;
}

// Assembly:
pushq %rbx
movl $0x18, %edi
callq 0x30f0
movq %rax, %rbx
movl $0x20, %edi
movl $0x28, %esi
callq 0x30a0
movq %rax, (%rbx)
movq $0x20, 0x8(%rbx)
movq $0x0, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/symtable.c
// Function: insert_at_index_st
void insert_at_index_st(struct symbol_table *symtab, size_t index, struct symbol_table_entry *entry) {
    struct symbol_table_entry *head = symtab->buckets[index];
    ++symtab->length;
    if(head == NULL) {
        symtab->buckets[index] = entry;
        return;
    }
    while(head->next != NULL) head = head->next;
    head->next = entry;
}

// Assembly:
movq (%rdi), %rax
movq (%rax,%rsi,8), %rcx
incq 0x10(%rdi)
testq %rcx, %rcx
je 0x5f65
movq %rcx, %rax
movq 0x20(%rcx), %rcx
testq %rcx, %rcx
jne 0x5f53
addq $0x20, %rax
jmp 0x5f69
leaq (%rax,%rsi,8), %rax
movq %rdx, (%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/symtable.c
// Function: percolate_symbol_table
void percolate_symbol_table(struct symbol_table *symtab) {
    float symtab_load = ((float)symtab->length) / symtab->bucket_size;
    
    if(symtab_load >= 0.7f) {
        struct symbol_table_entry **prev_buckets = symtab->buckets;
        size_t prev_size = symtab->bucket_size;
        
        symtab->bucket_size <<= 1;
        symtab->length = 0;
        symtab->buckets = (struct symbol_table_entry **)calloc(symtab->bucket_size, 
                                                        sizeof(struct symbol_table_entry));

        for(size_t i = 0; i < prev_size; ++i) {
            struct symbol_table_entry *head = prev_buckets[i], *next_head;
            size_t index;

            while(head != NULL) {
                next_head = head->next;
                head->next = NULL;
                
                index = djb2hash(head->key) % symtab->bucket_size;
                insert_at_index_st(symtab, index, head);
                
                head = next_head;
            }
        }

		free(prev_buckets);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %r12
movq 0x10(%rdi), %rax
testq %rax, %rax
js 0x5f8c
cvtsi2ss %rax, %xmm0
jmp 0x5fa1
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
testq %r12, %r12
js 0x5fad
cvtsi2ss %r12, %xmm1
jmp 0x5fc5
movq %r12, %rax
shrq %rax
movl %r12d, %ecx
andl $0x1, %ecx
orq %rax, %rcx
cvtsi2ss %rcx, %xmm1
addss %xmm1, %xmm1
divss %xmm1, %xmm0
ucomiss 0x1b20(%rip), %xmm0     # 0x7af0
jae 0x5fde
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq (%rbx), %r14
leaq (%r12,%r12), %r15
movq %r15, 0x8(%rbx)
movq $0x0, 0x10(%rbx)
movl $0x28, %esi
movq %r15, %rdi
callq 0x30a0
movq %rax, (%rbx)
testq %r12, %r12
je 0x609e
xorl %ecx, %ecx
xorl %esi, %esi
movq (%r14,%rsi,8), %rdi
testq %rdi, %rdi
je 0x6092
movq (%rdi), %rdx
movq 0x20(%rdi), %r8
movq $0x0, 0x20(%rdi)
movb (%rdx), %r9b
testb %r9b, %r9b
je 0x6054
incq %rdx
movl $0x1505, %eax           # imm = 0x1505
movq %rax, %r10
shlq $0x5, %r10
addq %rax, %r10
movzbl %r9b, %eax
addq %r10, %rax
movb (%rdx), %r9b
incq %rdx
testb %r9b, %r9b
jne 0x6036
jmp 0x6059
movl $0x1505, %eax           # imm = 0x1505
xorl %edx, %edx
divq %r15
movq (%rbx), %rax
movq (%rax,%rdx,8), %r9
incq %rcx
movq %rcx, 0x10(%rbx)
testq %r9, %r9
je 0x6083
movq %r9, %rax
movq 0x20(%r9), %r9
testq %r9, %r9
jne 0x6071
addq $0x20, %rax
jmp 0x6087
leaq (%rax,%rdx,8), %rax
movq %rdi, (%rax)
movq %r8, %rdi
testq %r8, %r8
jne 0x6017
incq %rsi
cmpq %r12, %rsi
jne 0x600e
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3030
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/symtable.c
// Function: insert_symbol_table
struct symbol_table_entry *insert_symbol_table(struct symbol_table *symtab, const char *key) {
    struct symbol_table_entry *item = (struct symbol_table_entry *)malloc(sizeof(struct symbol_table_entry));
    
    item->key = strdup_wrap(key);
    item->status = SYMBOL_UNDEFINED;
    item->offset = 0x00;
    item->segment = SEGMENT_TEXT; /* Default is SEGMENT_TEXT */
    item->datasize = 0x00;
    item->instr_list = create_list();
    item->next = NULL;

    size_t index = djb2hash(key) % symtab->bucket_size;

    insert_at_index_st(symtab, index, item);
    
    /* Check symbol table load */
    percolate_symbol_table(symtab);

    return item;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movl $0x28, %edi
callq 0x30f0
movq %rax, %r14
movq %r15, %rdi
callq 0x594d
movq %rax, (%r14)
movb $0x0, 0x8(%r14)
movl $0x0, 0xc(%r14)
movw $0x0, 0x10(%r14)
xorl %eax, %eax
callq 0x5954
movq %rax, 0x18(%r14)
movq $0x0, 0x20(%r14)
movb (%r15), %cl
testb %cl, %cl
je 0x6126
incq %r15
movl $0x1505, %eax           # imm = 0x1505
movq %rax, %rdx
shlq $0x5, %rdx
addq %rax, %rdx
movzbl %cl, %eax
addq %rdx, %rax
movb (%r15), %cl
incq %r15
testb %cl, %cl
jne 0x610a
jmp 0x612b
movl $0x1505, %eax           # imm = 0x1505
xorl %edx, %edx
divq 0x8(%rbx)
movq (%rbx), %rax
movq (%rax,%rdx,8), %rcx
incq 0x10(%rbx)
testq %rcx, %rcx
je 0x6153
movq %rcx, %rax
movq 0x20(%rcx), %rcx
testq %rcx, %rcx
jne 0x6141
addq $0x20, %rax
jmp 0x6157
leaq (%rax,%rdx,8), %rax
movq %r14, (%rax)
movq %rbx, %rdi
callq 0x5f6d
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/symtable.c
// Function: get_symbol_table
struct symbol_table_entry *get_symbol_table(struct symbol_table *symtab, const char *key) {
    size_t index = djb2hash(key) % symtab->bucket_size;
    struct symbol_table_entry *head = symtab->buckets[index];

    while(head != NULL) {
        if(strcmp(key, head->key) == 0) return head;
        head = head->next;
    }

    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movb (%rsi), %dl
testb %dl, %dl
je 0x619d
leaq 0x1(%rbx), %rcx
movl $0x1505, %eax           # imm = 0x1505
movq %rax, %rsi
shlq $0x5, %rsi
addq %rax, %rsi
movzbl %dl, %eax
addq %rsi, %rax
movb (%rcx), %dl
incq %rcx
testb %dl, %dl
jne 0x6182
jmp 0x61a2
movl $0x1505, %eax           # imm = 0x1505
xorl %r14d, %r14d
xorl %edx, %edx
divq 0x8(%rdi)
movq (%rdi), %rax
movq (%rax,%rdx,8), %r15
testq %r15, %r15
je 0x61d7
xorl %r14d, %r14d
movq (%r15), %rsi
movq %rbx, %rdi
callq 0x30b0
testl %eax, %eax
je 0x61d4
movq 0x20(%r15), %r15
testq %r15, %r15
jne 0x61ba
jmp 0x61d7
movq %r15, %r14
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/symtable.c
// Function: destroy_symbol_table
void destroy_symbol_table(struct symbol_table **symtabp) {
    struct symbol_table *symtab = *symtabp;

    /* Destory all pairs in the hashtable */
    for(size_t i = 0; i < (symtab)->bucket_size; ++i) {
        struct symbol_table_entry *head = symtab->buckets[i];
        while(head != NULL) {
            struct symbol_table_entry *next_item = head->next;
            delete_linked_list(&head->instr_list, LN_VSTATIC);
            free(head->key);
            free(head);
            head = next_item;
        }
    }

	/* Destroy buckets */
	free(symtab->buckets);

    /* Destory hash table */
    free(symtab);

    /* Set to NULL */
    *symtabp = NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r14
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x623a
xorl %r12d, %r12d
movq (%r14), %rcx
movq (%rcx,%r12,8), %r15
testq %r15, %r15
je 0x6232
movq 0x20(%r15), %r13
leaq 0x18(%r15), %rdi
xorl %esi, %esi
callq 0x5a59
movq (%r15), %rdi
callq 0x3030
movq %r15, %rdi
callq 0x3030
movq %r13, %r15
testq %r13, %r13
jne 0x6207
movq 0x8(%r14), %rax
incq %r12
cmpq %rax, %r12
jb 0x61fb
movq (%r14), %rdi
callq 0x3030
movq %r14, %rdi
callq 0x3030
movq $0x0, (%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/tokenizer.c
// Function: get_reserved_table
struct reserved_entry* get_reserved_table(const char *key) {
    ssize_t left = 0, right = reserved_table_size - 1;
    ssize_t mid;
    int cmp_result;
    
    while(left <= right) {
        mid = left + ((right - left) / 2);
        cmp_result = strcmp(reserved_table[mid].id, key);
        
        if(cmp_result == 0) return reserved_table + mid;
        if(cmp_result < 0) left = mid + 1;
        if(cmp_result > 0) right = mid - 1;
    }

    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x90, %r15d
xorl %r12d, %r12d
leaq 0x5116(%rip), %rbx      # 0xb390
movq %r15, %rax
subq %r12, %rax
movq %rax, %r13
shrq $0x3f, %r13
addq %rax, %r13
sarq %r13
addq %r12, %r13
movq %r13, %rbp
shlq $0x5, %rbp
movq (%rbp,%rbx), %rdi
movq %r14, %rsi
callq 0x30b0
testl %eax, %eax
je 0x62c2
leaq 0x1(%r13), %rcx
decq %r13
testl %eax, %eax
cmovsq %rcx, %r12
cmovgq %r13, %r15
cmpq %r15, %r12
jle 0x627a
xorl %ebx, %ebx
jmp 0x62c5
addq %rbp, %rbx
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/tstword[P]MIPSAssemblerC/src/tokenizer.c
// Function: tgetc
int tgetc(struct tokenizer *tokenizer) {
    int ch = fgetc(tokenizer->fstream);

    /* Adjust tokenizer buffer if necessary */
    if(tokenizer->bufpos >= tokenizer->bufsize) {
        char *realloc_ptr = (char *)realloc(tokenizer->lexbuf, tokenizer->bufsize << 1);
        
        if(realloc_ptr == NULL) {
            perror("CRITICAL ERROR: Failed to allocated more memory for tokenizer lexical buffer: ");
            exit(EXIT_FAILURE);
        }
        
        tokenizer->bufsize <<= 1;
        tokenizer->lexbuf = realloc_ptr;
    }

    tokenizer->lexbuf[tokenizer->bufpos++] = ch;
    tokenizer->colno++;

    return ch;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x3090
movl %eax, %ebp
movq 0x10(%rbx), %rax
movq 0x28(%rbx), %rcx
movq 0x30(%rbx), %rsi
cmpq %rsi, %rcx
jb 0x6315
addq %rsi, %rsi
movq %rax, %rdi
callq 0x3110
testq %rax, %rax
je 0x632e
shlq 0x30(%rbx)
movq %rax, 0x10(%rbx)
movq 0x28(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x28(%rbx)
movb %bpl, (%rax,%rcx)
incq 0x40(%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
callq 0x353c
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/tokenizer.c
// Function: report_fsm
void report_fsm(struct tokenizer *tokenizer, const char *fmt, ...) {
    va_list vargs;
    size_t bufsize = 0;

    va_start(vargs, fmt);
    bufsize = vsnprintf(NULL, 0, fmt, vargs) + 1;
    va_end(vargs);

    if(bufsize > tokenizer->errsize) {
        char *realloc_ptr = (char *)realloc(tokenizer->errmsg, bufsize);

        if(realloc_ptr == NULL) {
            perror("CRITICAL ERROR: Failed to allocated more memory for tokenizer error buffer: ");
            exit(EXIT_FAILURE);
        }

        tokenizer->errsize = bufsize;
        tokenizer->errmsg = realloc_ptr;
    }

    va_start(vargs, fmt);
    vsnprintf(tokenizer->errmsg, bufsize, fmt, vargs);
    va_end(vargs);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rsp), %r12
movq %rdx, 0x10(%r12)
movq %rcx, 0x18(%r12)
movq %r8, 0x20(%r12)
movq %r9, 0x28(%r12)
testb %al, %al
je 0x63da
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)
movq %rsp, %rcx
movq %r12, 0x10(%rcx)
leaq 0x110(%rsp), %r13
movq %r13, 0x8(%rcx)
movabsq $0x3000000010, %rbp     # imm = 0x3000000010
movq %rbp, (%rcx)
xorl %edi, %edi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x3050
incl %eax
movslq %eax, %r15
cmpq %r15, 0x48(%r14)
jae 0x642a
movq 0x18(%r14), %rdi
movq %r15, %rsi
callq 0x3110
testq %rax, %rax
je 0x6459
movq %r15, 0x48(%r14)
movq %rax, 0x18(%r14)
movq %rsp, %rcx
movq %r12, 0x10(%rcx)
movq %r13, 0x8(%rcx)
movq %rbp, (%rcx)
movq 0x18(%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x3050
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3551
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/tokenizer.c
// Function: integer_fsm
state_fsm integer_fsm(struct tokenizer *tokenizer) {
    int ch = tgetc(tokenizer);

    switch(ch) {
        /* To comply with Microsoft's C++ compiler... */
        case '0': case '1': case '2': case '3':
        case '4': case '5': case '6': case '7':
        case '8': case '9':
            return integer_state;

        default:
            tungetc(ch, tokenizer);
            return integer_accept;
    }

    return invalid_state;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x62d7
leal -0x30(%rax), %edx
movl $0x7, %ecx
cmpl $0xa, %edx
jb 0x65d5
movq 0x8(%rbx), %rsi
movl %eax, %edi
callq 0x3100
decq 0x40(%rbx)
decq 0x28(%rbx)
movl $0x8, %ecx
movl %ecx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/tokenizer.c
// Function: zero_fsm
state_fsm zero_fsm(struct tokenizer *tokenizer) {
    int ch = tgetc(tokenizer);

    switch(ch) {
        case 'x':
        case 'X':
            // Check if next character is digit
            if(isxdigit(tpeekc(tokenizer))) return hex_state;
            tungetc(ch, tokenizer);
            return integer_accept;

        /* To comply with Microsoft's C++ compiler... */
        case '0': case '1': case '2': case '3':
        case '4': case '5': case '6': case '7':
        case '8': case '9':
            return integer_state;

        default:
            tungetc(ch, tokenizer);
            return integer_accept;
    }

    return invalid_state;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x62d7
movl %eax, %r14d
movl $0x7, %eax
leal -0x30(%r14), %ecx
cmpl $0xa, %ecx
jae 0x6604
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x78, %r14d
je 0x6610
cmpl $0x58, %r14d
jne 0x663e
callq 0x3180
movq (%rax), %r15
movq 0x8(%rbx), %rdi
callq 0x3090
movl %eax, %ebp
movq 0x8(%rbx), %rsi
movl %eax, %edi
callq 0x3100
movslq %ebp, %rcx
movl $0x9, %eax
testb $0x10, 0x1(%r15,%rcx,2)
jne 0x65f9
movq 0x8(%rbx), %rsi
movl %r14d, %edi
callq 0x3100
decq 0x40(%rbx)
decq 0x28(%rbx)
movl $0x8, %eax
jmp 0x65f9
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/tokenizer.c
// Function: comment_fsm
state_fsm comment_fsm(struct tokenizer *tokenizer) {
    int ch = tgetc(tokenizer);

    switch(ch) {
        case EOF:
            tungetc(ch, tokenizer);
            return comment_accept;
        case '\n':
            tungetc(ch, tokenizer);
            return comment_accept;
        default:
            return comment_state;
    }

    return invalid_state;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x62d7
cmpl $0xa, %eax
je 0x66b3
movl $0xe, %ecx
cmpl $-0x1, %eax
jne 0x66cb
movq 0x8(%rbx), %rsi
movl %eax, %edi
callq 0x3100
decq 0x40(%rbx)
decq 0x28(%rbx)
movl $0xf, %ecx
movl %ecx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/tokenizer.c
// Function: negative_fsm
state_fsm negative_fsm(struct tokenizer *tokenizer) {
    int ch = tgetc(tokenizer);

    switch(ch) {
        case '0':
            return zero_state;
        /* To comply with Microsoft's C++ compiler... */
        case '1': case '2': case '3':
        case '4': case '5': case '6': case '7':
        case '8': case '9':
            return integer_state;
        default:
            tungetc(ch, tokenizer);
            report_fsm(tokenizer, "Expected integer value to be specified on line %ld, col %ld", tokenizer->lineno, tokenizer->colno);
            return invalid_state;
    }

    return invalid_state;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x62d7
leal -0x30(%rax), %ecx
cmpl $0xa, %ecx
jae 0x66ee
movl %ecx, %eax
leaq 0x17bf(%rip), %rcx      # 0x7ea8
movl (%rcx,%rax,4), %eax
jmp 0x6722
movq 0x8(%rbx), %rsi
movl %eax, %edi
callq 0x3100
movq 0x38(%rbx), %rdx
movq 0x40(%rbx), %rcx
decq %rcx
movq %rcx, 0x40(%rbx)
decq 0x28(%rbx)
leaq 0x1b2a(%rip), %rsi      # 0x823d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x636f
movl $0x16, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/tokenizer.c
// Function: string_fsm
state_fsm string_fsm(struct tokenizer *tokenizer) {
    int ch = tgetc(tokenizer);

    switch(ch) {
        case '"':
            /* Ignore " character */
            --tokenizer->bufpos;
            return string_accept;
        case '\\':
            return string_escape;
        case EOF:
        case '\n':
            tungetc(ch, tokenizer);
            report_fsm(tokenizer, "Non-terminated string, expected '\"' on line %ld, col %ld", tokenizer->lineno, tokenizer->colno);
            return invalid_state;
        default:
            return string_state;
    }

    return invalid_state;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x62d7
cmpl $0x21, %eax
jg 0x6772
cmpl $-0x1, %eax
je 0x673c
cmpl $0xa, %eax
jne 0x6787
movq 0x8(%rbx), %rsi
movl %eax, %edi
callq 0x3100
movq 0x38(%rbx), %rdx
movq 0x40(%rbx), %rcx
decq %rcx
movq %rcx, 0x40(%rbx)
decq 0x28(%rbx)
leaq 0x1b18(%rip), %rsi      # 0x8279
movq %rbx, %rdi
xorl %eax, %eax
callq 0x636f
movl $0x16, %eax
jmp 0x6793
cmpl $0x5c, %eax
je 0x678e
cmpl $0x22, %eax
jne 0x6787
decq 0x28(%rbx)
movl $0x12, %eax
jmp 0x6793
movl $0x11, %eax
jmp 0x6793
movl $0x17, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/tokenizer.c
// Function: character_fsm
state_fsm character_fsm(struct tokenizer *tokenizer) {
    int ch = tgetc(tokenizer);

    switch(ch) {
        case '\\':
            return escape_state;
        default:
            if(isprint(ch)) return quote_state;
            tungetc(ch, tokenizer);
            report_fsm(tokenizer, "Expected C-style character on line %ld, col %ld", tokenizer->lineno, tokenizer->colno);
            return invalid_state;
    }

    return invalid_state;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x62d7
movl %eax, %ebp
movl $0x14, %eax
cmpl $0x5c, %ebp
je 0x67f7
callq 0x3180
movq (%rax), %rcx
movslq %ebp, %rdx
movl $0x13, %eax
testb $0x40, 0x1(%rcx,%rdx,2)
jne 0x67f7
movq 0x8(%rbx), %rsi
movl %ebp, %edi
callq 0x3100
movq 0x38(%rbx), %rdx
movq 0x40(%rbx), %rcx
decq %rcx
movq %rcx, 0x40(%rbx)
decq 0x28(%rbx)
leaq 0x1aca(%rip), %rsi      # 0x82b2
movq %rbx, %rdi
xorl %eax, %eax
callq 0x636f
movl $0x16, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/tokenizer.c
// Function: string_escape_fsm
state_fsm string_escape_fsm(struct tokenizer *tokenizer) {
    int ch = tgetc(tokenizer);

    switch(ch) {
        case 't':
        case 'b':
        case 'n':
        case 'r':
        case '0':
        case 'a':
        case 'f':
        case 'v':
        case '\'':
        case '"':
        case '?':
        case '\\':
            return string_state;
        default:
            tungetc(ch, tokenizer);
            report_fsm(tokenizer, "Unrecognized escape character on line %ld, col %ld", tokenizer->lineno, tokenizer->colno);
            return invalid_state;
    }

    return string_state;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x62d7
movl %eax, %edi
movl $0x11, %eax
leal -0x61(%rdi), %ecx
cmpl $0x15, %ecx
ja 0x6820
movl $0x2a2023, %edx         # imm = 0x2A2023
btl %ecx, %edx
jb 0x6838
leal -0x22(%rdi), %ecx
cmpl $0x3a, %ecx
ja 0x683a
movabsq $0x400000020004021, %rdx # imm = 0x400000020004021
btq %rcx, %rdx
jae 0x683a
popq %rbx
retq
movq 0x8(%rbx), %rsi
callq 0x3100
movq 0x38(%rbx), %rdx
movq 0x40(%rbx), %rcx
decq %rcx
movq %rcx, 0x40(%rbx)
decq 0x28(%rbx)
leaq 0x1a85(%rip), %rsi      # 0x82e2
movq %rbx, %rdi
xorl %eax, %eax
callq 0x636f
movl $0x16, %eax
jmp 0x6838
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/tokenizer.c
// Function: quote_fsm
state_fsm quote_fsm(struct tokenizer *tokenizer) {
    int ch = tgetc(tokenizer);

    switch(ch) {
        case '\'':
            return character_accept;
        default:
            tungetc(ch, tokenizer);
            report_fsm(tokenizer, "Expected end single quote on line %ld, col %ld", tokenizer->lineno, tokenizer->colno);
            return invalid_state;
    }

    return invalid_state;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x62d7
movl $0xc, %ecx
cmpl $0x27, %eax
je 0x6925
movq 0x8(%rbx), %rsi
movl %eax, %edi
callq 0x3100
movq 0x38(%rbx), %rdx
movq 0x40(%rbx), %rcx
decq %rcx
movq %rcx, 0x40(%rbx)
decq 0x28(%rbx)
leaq 0x19ff(%rip), %rsi      # 0x8315
movq %rbx, %rdi
xorl %eax, %eax
callq 0x636f
movl $0x16, %ecx
movl %ecx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/tokenizer.c
// Function: destroy_tokenizer
void destroy_tokenizer(struct tokenizer **tokenizer) {
    if(*tokenizer == NULL) return;

    /* Close reading file stream */
    fclose((*tokenizer)->fstream);
    free((*tokenizer)->filename);

    /* Destory dynamically allocated data */
    free((*tokenizer)->lexbuf);
    free((*tokenizer)->errmsg);
    free(*tokenizer);

    /* Redirect pointer to NULL */
    *tokenizer = NULL;
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x6d35
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rax), %rdi
callq 0x3060
movq (%rbx), %rax
movq (%rax), %rdi
callq 0x3030
movq (%rbx), %rax
movq 0x10(%rax), %rdi
callq 0x3030
movq (%rbx), %rax
movq 0x18(%rax), %rdi
callq 0x3030
movq (%rbx), %rdi
callq 0x3030
movq $0x0, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/JavieW[P]CSCC69_Ext2_File-System/utilities.c
// Function: searchFileInDir
int searchFileInDir(struct ext2_inode *parentInode, char *childFileName) {
    /**
     * return inode num if childFile is found, o/w 0
     */
    struct ext2_dir_entry_2 *cur_dir_entry = NULL;
    struct ext2_dir_entry_2 *pre_dir_entry = getPreDirent(parentInode, childFileName);
    if (strcmp(childFileName, ".") == 0) {
        return ((struct ext2_dir_entry_2 *)getBlock(parentInode->i_block[0]))->inode;
    }
    else if (pre_dir_entry != NULL) {
        cur_dir_entry = (void *)pre_dir_entry + pre_dir_entry->rec_len;
        return cur_dir_entry->inode;
    } 
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
callq 0x1b30
cmpb $0x2e, (%r14)
jne 0x1b05
cmpb $0x0, 0x1(%r14)
je 0x1b17
testq %rax, %rax
je 0x1b13
movzwl 0x4(%rax), %ecx
addq %rax, %rcx
jmp 0x1b29
xorl %eax, %eax
jmp 0x1b2b
movslq 0x28(%rbx), %rcx
leaq 0x358e(%rip), %rax      # 0x50b0
shlq $0xa, %rcx
addq (%rax), %rcx
movl (%rcx), %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/JavieW[P]CSCC69_Ext2_File-System/utilities.c
// Function: getPreDirent
struct ext2_dir_entry_2 *getPreDirent(struct ext2_inode *parentInode, char *childFileName) {
    struct ext2_dir_entry_2 * pre_dir_entry;
    struct ext2_dir_entry_2 * cur_dir_entry;
    int total_rec_len;

    // search in direct block
    for (int i=0; i<12; i++) {
        if (parentInode->i_block[i] == 0) {
            continue;
        } else {
            pre_dir_entry = (struct ext2_dir_entry_2 *)getBlock(parentInode->i_block[i]);
            total_rec_len = pre_dir_entry->rec_len;
            cur_dir_entry = (void *) pre_dir_entry + pre_dir_entry->rec_len;
        }

        // for each dir entry in the block
        while (total_rec_len < EXT2_BLOCK_SIZE) {
            if(strcmp(cur_dir_entry->name, childFileName)==0) {
                return pre_dir_entry;
            }
            total_rec_len = total_rec_len + cur_dir_entry->rec_len;
            pre_dir_entry = cur_dir_entry;
            cur_dir_entry = (void *) cur_dir_entry + cur_dir_entry->rec_len;
        }
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, -0x38(%rbp)
leaq 0x3561(%rip), %rax      # 0x50b0
movq (%rax), %rax
movq %rax, -0x30(%rbp)
xorl %r13d, %r13d
movq -0x38(%rbp), %rax
movslq 0x28(%rax,%r13,4), %r14
testq %r14, %r14
je 0x1bc6
shlq $0xa, %r14
movq -0x30(%rbp), %rax
movzwl 0x4(%rax,%r14), %r12d
cmpq $0x3ff, %r12            # imm = 0x3FF
ja 0x1bc6
addq -0x30(%rbp), %r14
leaq (%r14,%r12), %rdi
addq $0x8, %rdi
movq %rbx, %rsi
callq 0x10c0
testl %eax, %eax
je 0x1bd4
addq %r12, %r14
movzwl 0x4(%r14), %eax
addl %eax, %r12d
cmpl $0x400, %r12d           # imm = 0x400
jae 0x1bc6
movq %r14, %r15
addq %rax, %r14
leaq (%r15,%rax), %rdi
addq $0x8, %rdi
movq %rbx, %rsi
callq 0x10c0
testl %eax, %eax
jne 0x1b99
jmp 0x1bd7
incq %r13
cmpq $0xc, %r13
jne 0x1b59
xorl %r15d, %r15d
jmp 0x1bd7
movq %r14, %r15
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq