LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/gitluin[P]sara/src/sarasock.c
// Function: main
int
main(int argc, char* argv[]){
	int i, sfd, left = MAXBUFF;
	char msg[MAXBUFF];
	struct sockaddr saddress = {AF_UNIX, INPUTSOCK};

	if (argc < 2)
		die("please provide at least one argument!");

	for (i=1;i < argc && left > 0;i++){
		if (i != 1){
			strncat(msg, " ", 2);
			left--;
		}

		strncat(msg, argv[i], slen(argv[i]) > left ? left : slen(argv[i]) );
		left -= slen(argv[i]);
	}

	msg[MAXBUFF-1] = '\0';

	if ( (sfd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
		die("failed to create socket!");
	if (connect(sfd, &saddress, sizeof(saddress)) < 0)
		die("failed to connect to socket!");
	if (send(sfd, msg, MAXBUFF, 0) < 0)
		die("failed to send to socket!");

	close(sfd);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x12, -0x1c(%rbp)
movq 0xe40(%rip), %rax       # 0x2004
movq %rax, -0x40(%rbp)
movq 0xe3d(%rip), %rax       # 0x200c
movq %rax, -0x38(%rbp)
cmpl $0x2, -0x8(%rbp)
jge 0x11e7
leaq 0xe34(%rip), %rdi       # 0x2014
movb $0x0, %al
callq 0x1340
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %ecx
xorl %eax, %eax
cmpl -0x8(%rbp), %ecx
movb %al, -0x41(%rbp)
jge 0x1205
cmpl $0x0, -0x1c(%rbp)
setg %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
testb $0x1, %al
jne 0x1211
jmp 0x12bb
cmpl $0x1, -0x14(%rbp)
je 0x1235
leaq -0x30(%rbp), %rdi
leaq 0xe18(%rip), %rsi       # 0x203a
movl $0x2, %edx
callq 0x1040
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
leaq -0x30(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1380
cmpl -0x1c(%rbp), %eax
jle 0x126b
movl -0x1c(%rbp), %eax
movl %eax, -0x5c(%rbp)
jmp 0x127f
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1380
movl %eax, -0x5c(%rbp)
movq -0x50(%rbp), %rsi
movq -0x58(%rbp), %rdi
movl -0x5c(%rbp), %eax
movslq %eax, %rdx
callq 0x1040
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1380
movl %eax, %ecx
movl -0x1c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x1c(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x11ee
movb $0x0, -0x1f(%rbp)
movl $0x1, %esi
xorl %edx, %edx
movl %esi, %edi
callq 0x1070
movl %eax, -0x18(%rbp)
cmpl $0x0, %eax
jge 0x12e3
leaq 0xd60(%rip), %rdi       # 0x203c
movb $0x0, %al
callq 0x1340
movl -0x18(%rbp), %edi
leaq -0x40(%rbp), %rsi
movl $0x10, %edx
callq 0x1060
cmpl $0x0, %eax
jge 0x1307
leaq 0xd55(%rip), %rdi       # 0x2055
movb $0x0, %al
callq 0x1340
movl -0x18(%rbp), %edi
leaq -0x30(%rbp), %rsi
movl $0x12, %edx
xorl %ecx, %ecx
callq 0x1080
cmpq $0x0, %rax
jge 0x132e
leaq 0xd4b(%rip), %rdi       # 0x2072
movb $0x0, %al
callq 0x1340
movl -0x18(%rbp), %edi
callq 0x1030
xorl %eax, %eax
addq $0x60, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/MAGI003769[P]EE450-Socket-Project/serverA.c
// Function: split_args2
void split_args2(char *args[], char *message) {
    char *p = strtok (message, " ");
    int i = 0;
    while (p != NULL)
    {
        args[i++] = p;
        p = strtok (NULL, " ");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xd29(%rip), %rsi       # 0x2004
callq 0x1100
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x1322
movq -0x18(%rbp), %rdx
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
xorl %eax, %eax
movl %eax, %edi
leaq 0xced(%rip), %rsi       # 0x2004
callq 0x1100
movq %rax, -0x18(%rbp)
jmp 0x12eb
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/MAGI003769[P]EE450-Socket-Project/serverA.c
// Function: search_map
void search_map(char *map_id, char *map_data) {
    // open corresponding txt file
    FILE *file = fopen(MAPDIR, "r");
    if(file == NULL) {
        printf("File %s not found", MAPDIR);
        return;
    }

    char* line = NULL;
    size_t len = 0;
    ssize_t read;

    read = getline(&line, &len, file);
    strcpy(map_data, line);
    //strcat(data, "\n");
    
    if(map_id[0] != line[0]) {
        while ((read = getline(&line, &len, file)) != -1) {
            //printf("Retrieved line of length %zu:\n", read);
            if(map_id[0] == line[0]) {
                break;
            }
        }
    }

    if(map_id[0] != line[0]) {
        strcpy(map_data, MAPNOTFOUND);
        return;
    } else {
        strcpy(map_data, line);
        while ((read = getline(&line, &len, file)) != -1) {
            if(isalpha(line[0]) != 0) {
                break;
            }
            strcat(map_data, line);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0xcbf(%rip), %rdi       # 0x2006
leaq 0xcc8(%rip), %rsi       # 0x2016
callq 0x10e0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x1378
leaq 0xcb3(%rip), %rdi       # 0x2018
leaq 0xc9a(%rip), %rsi       # 0x2006
movb $0x0, %al
callq 0x1050
jmp 0x1470
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rdx
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1110
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x1030
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
movq -0x20(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x13f1
jmp 0x13be
movq -0x18(%rbp), %rdx
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1110
movq %rax, -0x30(%rbp)
cmpq $-0x1, %rax
je 0x13ef
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
movq -0x20(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x13ed
jmp 0x13ef
jmp 0x13be
jmp 0x13f1
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
movq -0x20(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x1415
movq -0x10(%rbp), %rdi
leaq 0xc1c(%rip), %rsi       # 0x202a
callq 0x1030
jmp 0x1470
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x1030
movq -0x18(%rbp), %rdx
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1110
movq %rax, -0x30(%rbp)
cmpq $-0x1, %rax
je 0x146e
callq 0x1150
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x145f
jmp 0x146e
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x1120
jmp 0x1422
jmp 0x1470
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/openshmem-org[P]openshmem-examples/c/amo-set.c
// Function: main
int
main()
{
    int me;

    shmem_init();
    me = shmem_my_pe();

    dst = 123;
    shmem_barrier_all();

    if (me == 0) {
        shmem_int_atomic_set(&dst, 999, 1);
    }
    else if (me != 1) {
        dst++;
    }

    shmem_barrier_all();

    printf("%d: dst = %d\n", me, dst);

    shmem_finalize();

    return 0;
}

// Assembly:
pushq %rax
movl $0x0, 0x4(%rsp)
callq 0x1070
callq 0x1050
movl %eax, (%rsp)
movl $0x7b, 0x2eac(%rip)     # 0x405c
callq 0x1060
cmpl $0x0, (%rsp)
jne 0x11d3
leaq 0x2e9a(%rip), %rdi      # 0x405c
movl $0x3e7, %esi            # imm = 0x3E7
movl $0x1, %edx
callq 0x1080
jmp 0x11ea
cmpl $0x1, (%rsp)
je 0x11e8
movl 0x2e7d(%rip), %eax      # 0x405c
addl $0x1, %eax
movl %eax, 0x2e74(%rip)      # 0x405c
jmp 0x11ea
callq 0x1060
movl (%rsp), %esi
movl 0x2e64(%rip), %edx      # 0x405c
leaq 0xe05(%rip), %rdi       # 0x2004
movb $0x0, %al
callq 0x1030
callq 0x1040
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O0/tstword[P]MIPSAssemblerC/src/assembler.c
// Function: incr_segment_offset
void incr_segment_offset(offset_t offset) {
    offset_t next_offset = cfg_assembler->segment_offset[cfg_assembler->segment] + offset;
    
    if(next_offset > SEGMENT_OFFSET_LIMIT[cfg_assembler->segment]) {
        fprintf(stderr, "Memory Error: Segment '%s' exceeded limit. Base: 0x%08X, Offset: 0x%08X, Limit: 0x%08X\n", 
                segment_string[cfg_assembler->segment], SEGMENT_OFFSET_BASE[cfg_assembler->segment], 
                next_offset, SEGMENT_OFFSET_LIMIT[cfg_assembler->segment]);
        
        cfg_assembler->status = ASSEMBLER_STATUS_FAIL;
    }
    
    cfg_assembler->segment_offset[cfg_assembler->segment] += offset;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movq 0xc106(%rip), %rax      # 0xf5a8
movq 0xc0ff(%rip), %rcx      # 0xf5a8
movzbl 0x45(%rcx), %ecx
movl 0x48(%rax,%rcx,4), %eax
addl -0x4(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movq 0xc0e7(%rip), %rcx      # 0xf5a8
movzbl 0x45(%rcx), %ecx
movl %ecx, %edx
leaq 0x6fa2(%rip), %rcx      # 0xa470
cmpl (%rcx,%rdx,4), %eax
jbe 0x3541
movq 0xab1e(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq 0xc0c4(%rip), %rax      # 0xf5a8
movzbl 0x45(%rax), %eax
movl %eax, %ecx
leaq 0xae6f(%rip), %rax      # 0xe360
movq (%rax,%rcx,8), %rdx
movq 0xc0ac(%rip), %rax      # 0xf5a8
movzbl 0x45(%rax), %eax
movl %eax, %ecx
leaq 0x6f57(%rip), %rax      # 0xa460
movl (%rax,%rcx,4), %ecx
movl -0x8(%rbp), %r8d
movq 0xc091(%rip), %rax      # 0xf5a8
movzbl 0x45(%rax), %eax
movl %eax, %esi
leaq 0x6f4c(%rip), %rax      # 0xa470
movl (%rax,%rsi,4), %r9d
leaq 0x6fa2(%rip), %rsi      # 0xa4d1
movb $0x0, %al
callq 0x30c0
movq 0xc06b(%rip), %rax      # 0xf5a8
movb $0x2, 0x44(%rax)
movl -0x4(%rbp), %edx
movq 0xc05d(%rip), %rax      # 0xf5a8
movq 0xc056(%rip), %rcx      # 0xf5a8
movzbl 0x45(%rcx), %ecx
addl 0x48(%rax,%rcx,4), %edx
movl %edx, 0x48(%rax,%rcx,4)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/tstword[P]MIPSAssemblerC/src/assembler.c
// Function: align_segment_offset
void align_segment_offset(uint32_t n) {
    /* Check bounds for sll */
    if(n >= 31) return;

    uint32_t dividend = 1 << n;
    uint32_t remainder = cfg_assembler->segment_offset[cfg_assembler->segment] & (dividend - 1);

    if(remainder != 0) {
        cfg_assembler->segment_offset[cfg_assembler->segment] += dividend - remainder;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
cmpl $0x1f, -0x4(%rbp)
jb 0x357f
jmp 0x35d3
movl -0x4(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x8(%rbp)
movq 0xc015(%rip), %rax      # 0xf5a8
movq 0xc00e(%rip), %rcx      # 0xf5a8
movzbl 0x45(%rcx), %ecx
movl 0x48(%rax,%rcx,4), %eax
movl -0x8(%rbp), %ecx
subl $0x1, %ecx
andl %ecx, %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x35d3
movl -0x8(%rbp), %edx
subl -0xc(%rbp), %edx
movq 0xbfe8(%rip), %rax      # 0xf5a8
movq 0xbfe1(%rip), %rcx      # 0xf5a8
movzbl 0x45(%rcx), %ecx
addl 0x48(%rax,%rcx,4), %edx
movl %edx, 0x48(%rax,%rcx,4)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/tstword[P]MIPSAssemblerC/src/assembler.c
// Function: write_segment_memory
void write_segment_memory(void *buf, size_t size) {
    segment_t segment = cfg_assembler->segment;
    offset_t buf_offset = cfg_assembler->segment_offset[segment] - SEGMENT_OFFSET_BASE[segment];
    
    alloc_segment_memory(size);
    memcpy((char *)cfg_assembler->segment_memory[segment] + buf_offset, buf, size);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0xbe51(%rip), %rax      # 0xf5a8
movb 0x45(%rax), %al
movb %al, -0x11(%rbp)
movq 0xbe44(%rip), %rax      # 0xf5a8
movzbl -0x11(%rbp), %ecx
movl 0x48(%rax,%rcx,4), %eax
movzbl -0x11(%rbp), %ecx
movl %ecx, %edx
leaq 0x6ce7(%rip), %rcx      # 0xa460
subl (%rcx,%rdx,4), %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x35e0
movq 0xbe19(%rip), %rax      # 0xf5a8
movzbl -0x11(%rbp), %ecx
movq 0x20(%rax,%rcx,8), %rdi
movl -0x18(%rbp), %eax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x30d0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/tstword[P]MIPSAssemblerC/src/assembler.c
// Function: write_escaped_string
void write_escaped_string(char *string) {
    char ch;
    while((ch = *string++) != '\0') {
        if(ch == '\\') {
            switch(*string++) {
                case 'a':
                    ch = '\a';
                    break;
                case 'b':
                    ch = '\b';
                    break;
                case 'f':
                    ch = '\f';
                    break;
                case 'n':
                    ch = '\n';
                    break;
                case 'r':
                    ch = '\r';
                    break;
                case 't':
                    ch = '\t';
                    break;
                case 'v':
                    ch = '\v';
                    break;
                case '\\':
                    ch = '\\';
                    break;
                case '\'':
                    ch = '\'';
                    break;
                case '"':
                    ch = '\"';
                    break;
                case '?':
                    ch = '\?';
                    break;
                case '0':
                    ch = '\0';
                    break;  
            }
        }
        write_segment_memory((void *)&ch, 0x1);
        incr_segment_offset(0x1);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x8(%rbp)
movb (%rax), %al
movb %al, -0x9(%rbp)
movsbl %al, %eax
cmpl $0x0, %eax
je 0x38bd
movsbl -0x9(%rbp), %eax
cmpl $0x5c, %eax
jne 0x38a0
movq -0x8(%rbp), %rax
movq %rax, %rcx
incq %rcx
movq %rcx, -0x8(%rbp)
movsbl (%rax), %eax
addl $-0x22, %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x54, %eax
ja 0x389e
movq -0x18(%rbp), %rax
leaq 0x67c1(%rip), %rcx      # 0xa010
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x7, -0x9(%rbp)
jmp 0x389e
movb $0x8, -0x9(%rbp)
jmp 0x389e
movb $0xc, -0x9(%rbp)
jmp 0x389e
movb $0xa, -0x9(%rbp)
jmp 0x389e
movb $0xd, -0x9(%rbp)
jmp 0x389e
movb $0x9, -0x9(%rbp)
jmp 0x389e
movb $0xb, -0x9(%rbp)
jmp 0x389e
movb $0x5c, -0x9(%rbp)
jmp 0x389e
movb $0x27, -0x9(%rbp)
jmp 0x389e
movb $0x22, -0x9(%rbp)
jmp 0x389e
movb $0x3f, -0x9(%rbp)
jmp 0x389e
movb $0x0, -0x9(%rbp)
jmp 0x38a0
leaq -0x9(%rbp), %rdi
movl $0x1, %esi
callq 0x3740
movl $0x1, %edi
callq 0x3490
jmp 0x37fc
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
movq 0xbc96(%rip), %rax      # 0xf5a8
movl 0x40(%rax), %eax
cmpl -0x8(%rbp), %eax
jne 0x396f
movq 0xbc87(%rip), %rax      # 0xf5a8
movq (%rax), %rax
movq 0x38(%rax), %rcx
movq 0xbc79(%rip), %rax      # 0xf5a8
movq %rcx, 0x98(%rax)
movq 0xbc6b(%rip), %rax      # 0xf5a8
movq (%rax), %rax
movq 0x40(%rax), %rcx
movq 0xbc5d(%rip), %rax      # 0xf5a8
movq %rcx, 0xa0(%rax)
movq 0xbc4f(%rip), %rax      # 0xf5a8
movq (%rax), %rdi
callq 0x8f90
movl %eax, %ecx
movq 0xbc3e(%rip), %rax      # 0xf5a8
movl %ecx, 0x40(%rax)
jmp 0x39ad
movl -0x8(%rbp), %edi
callq 0x9200
movq %rax, %rsi
movq 0xbc27(%rip), %rax      # 0xf5a8
movq 0x98(%rax), %rdx
movq 0xbc19(%rip), %rax      # 0xf5a8
movq 0xa0(%rax), %rcx
leaq 0x6bc6(%rip), %rdi      # 0xa563
movb $0x0, %al
callq 0x3280
movl $0x0, -0x4(%rbp)
jmp 0x39b4
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq 0xbbd9(%rip), %rax      # 0xf5a8
movl 0x40(%rax), %eax
movl %eax, -0x4(%rbp)
testl %eax, %eax
je 0x39f1
jmp 0x39db
movl -0x4(%rbp), %eax
subl $0x7, %eax
jne 0x3a0c
jmp 0x39e5
movl $0x7, %edi
callq 0x3900
jmp 0x3a48
movq 0xbbb0(%rip), %rax      # 0xf5a8
movq 0x98(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x98(%rax)
jmp 0x3a48
movq 0xbb95(%rip), %rax      # 0xf5a8
movl 0x40(%rax), %edi
callq 0x9200
movq %rax, %rsi
movq 0xbb83(%rip), %rax      # 0xf5a8
movq 0x98(%rax), %rdx
movq 0xbb75(%rip), %rax      # 0xf5a8
movq 0xa0(%rax), %rcx
leaq 0x6b43(%rip), %rdi      # 0xa584
movb $0x0, %al
callq 0x3280
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x4533
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
je 0x4513
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x10, %eax
jne 0x4520
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3030
movq -0x10(%rbp), %rdi
callq 0x3030
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x44e8
movq -0x8(%rbp), %rdi
callq 0x3030
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x634d
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x6359
movl $0x0, -0x4(%rbp)
jmp 0x6439
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x4140
cmpl $0x0, %eax
jne 0x6387
movq -0x10(%rbp), %rdi
callq 0x44d0
movl $0x0, -0x4(%rbp)
jmp 0x6439
movq 0x921a(%rip), %rax      # 0xf5a8
movzbl 0x45(%rax), %eax
cmpl $0x1, %eax
jne 0x63da
movq 0x7c5a(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq 0x9200(%rip), %rax      # 0xf5a8
movq 0x98(%rax), %rdx
leaq 0x4365(%rip), %rsi      # 0xa71b
movb $0x0, %al
callq 0x30c0
movq 0x91e4(%rip), %rax      # 0xf5a8
movb $0x2, 0x44(%rax)
movq -0x10(%rbp), %rdi
callq 0x44d0
movl $0x0, -0x4(%rbp)
jmp 0x6439
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movw 0x6(%rax), %ax
andw $0x3, %ax
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x640b
movq -0x10(%rbp), %rdi
callq 0x4550
movl %eax, -0x14(%rbp)
jmp 0x6433
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x6425
movq -0x10(%rbp), %rdi
callq 0x5970
movl %eax, -0x14(%rbp)
jmp 0x6431
movq -0x10(%rbp), %rdi
callq 0x5ba0
movl %eax, -0x14(%rbp)
jmp 0x6433
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
jmp 0x6b56
jmp 0x6b58
movq 0x8a49(%rip), %rax      # 0xf5a8
cmpl $0x0, 0x40(%rax)
jne 0x6bcf
movq 0x8a3c(%rip), %rdi      # 0xf5a8
callq 0x9180
movq 0x8a30(%rip), %rax      # 0xf5a8
movq 0x8(%rax), %rdi
xorl %esi, %esi
callq 0x7330
movq 0x8a1e(%rip), %rax      # 0xf5a8
movq 0x8(%rax), %rax
cmpq $0x0, (%rax)
jne 0x6b96
popq %rbp
retq
movq 0x8a0b(%rip), %rax      # 0xf5a8
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x8(%rax), %rcx
movq 0x89f9(%rip), %rax      # 0xf5a8
movq %rcx, (%rax)
movq 0x89ef(%rip), %rax      # 0xf5a8
movq (%rax), %rdi
callq 0x8f90
movl %eax, %ecx
movq 0x89de(%rip), %rax      # 0xf5a8
movl %ecx, 0x40(%rax)
jmp 0x6b58
movq 0x89d2(%rip), %rax      # 0xf5a8
cmpl $0x0, 0x40(%rax)
je 0x6be1
callq 0x68b0
jmp 0x6b56
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x6ddc
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x9180
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x6dbb
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
xorl %esi, %esi
callq 0x7470
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/tstword[P]MIPSAssemblerC/src/assembler.c
// Function: create_assembler
struct assembler *create_assembler() {
    struct assembler *assembler = (struct assembler *)malloc(sizeof(struct assembler));

    if(assembler == NULL) return NULL;

    assembler->tokenizer = NULL;
    assembler->tokenizer_list = NULL;

    assembler->lookahead = TOK_NULL;
    assembler->decl_symlist = NULL;
    assembler->status = ASSEMBLER_STATUS_NULL;
    assembler->lineno = 1;
    assembler->colno = 1;

    assembler->segment = SEGMENT_TEXT;
    
    for(segment_t segment = 0; segment < MAX_SEGMENTS; ++segment) {
        assembler->segment_offset[segment] = SEGMENT_OFFSET_BASE[segment];
        assembler->segment_memory[segment] = NULL;
        assembler->segment_memory_offset[segment] = 0;
        assembler->segment_memory_size[segment] = 0;
    }

    assembler->auto_align = 1;
    
    return assembler;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0xa8, %edi
callq 0x30e0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x6e2a
movq $0x0, -0x8(%rbp)
jmp 0x6efc
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x40(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x44(%rax)
movq -0x10(%rbp), %rax
movq $0x1, 0x98(%rax)
movq -0x10(%rbp), %rax
movq $0x1, 0xa0(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x45(%rax)
movb $0x0, -0x11(%rbp)
movzbl -0x11(%rbp), %eax
cmpl $0x4, %eax
jge 0x6eec
movzbl -0x11(%rbp), %eax
movl %eax, %ecx
leaq 0x35c0(%rip), %rax      # 0xa460
movl (%rax,%rcx,4), %edx
movq -0x10(%rbp), %rax
movzbl -0x11(%rbp), %ecx
movl %edx, 0x48(%rax,%rcx,4)
movq -0x10(%rbp), %rax
movzbl -0x11(%rbp), %ecx
movq $0x0, 0x20(%rax,%rcx,8)
movq -0x10(%rbp), %rax
movzbl -0x11(%rbp), %ecx
movq $0x0, 0x58(%rax,%rcx,8)
movq -0x10(%rbp), %rax
movzbl -0x11(%rbp), %ecx
movq $0x0, 0x78(%rax,%rcx,8)
movb -0x11(%rbp), %al
addb $0x1, %al
movb %al, -0x11(%rbp)
jmp 0x6e8a
movq -0x10(%rbp), %rax
movb $0x1, 0x46(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movb $0x0, -0x9(%rbp)
movzbl -0x9(%rbp), %eax
cmpl $0x4, %eax
jge 0x7148
movq -0x8(%rbp), %rax
movq (%rax), %rax
movzbl -0x9(%rbp), %ecx
movq 0x20(%rax,%rcx,8), %rdi
callq 0x3030
movb -0x9(%rbp), %al
addb $0x1, %al
movb %al, -0x9(%rbp)
jmp 0x7120
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x3030
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/tstword[P]MIPSAssemblerC/src/linkedlist.c
// Function: create_list
struct linked_list *create_list()
{
	struct linked_list *list = (struct linked_list *)malloc(sizeof(struct linked_list));
	if(list == NULL) return NULL;
	list->front = list->rear = NULL;
	return list;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x10, %edi
callq 0x30e0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x71e7
movq $0x0, -0x8(%rbp)
jmp 0x7206
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x10, %edi
callq 0x30e0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x724b
leaq 0x365b(%rip), %rdi      # 0xa897
callq 0x3120
movl $0x1, %edi
callq 0x3140
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x7287
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x10, %edi
callq 0x30e0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x72cb
leaq 0x35db(%rip), %rdi      # 0xa897
callq 0x3120
movl $0x1, %edi
callq 0x3140
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x730a
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x731d
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x735a
jmp 0x73b3
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x7383
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
jmp 0x7394
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movswl -0xa(%rbp), %eax
cmpl $0x1, %eax
jne 0x73aa
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3030
movq -0x18(%rbp), %rdi
callq 0x3030
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x7462
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
cmpq -0x10(%rbp), %rax
jne 0x744d
cmpq $0x0, -0x20(%rbp)
je 0x740d
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
jne 0x7428
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x7442
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rdi
callq 0x3030
jmp 0x7462
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x73e3
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x748f
jmp 0x74b9
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rdi
movswl -0xa(%rbp), %esi
callq 0x74c0
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x3030
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x7516
movswl -0xa(%rbp), %eax
cmpl $0x1, %eax
jne 0x74f8
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3030
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rdi
callq 0x3030
jmp 0x74db
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
leaq 0x33f1(%rip), %rdi      # 0xa928
movb $0x0, %al
callq 0x3060
leaq 0x3424(%rip), %rdi      # 0xa969
movb $0x0, %al
callq 0x3060
leaq 0x3436(%rip), %rdi      # 0xa989
movb $0x0, %al
callq 0x3060
leaq 0x344c(%rip), %rdi      # 0xa9ad
leaq 0x3487(%rip), %rsi      # 0xa9ef
movb $0x0, %al
callq 0x3060
leaq 0x347c(%rip), %rdi      # 0xa9f2
leaq 0x340b(%rip), %rsi      # 0xa988
movb $0x0, %al
callq 0x3060
leaq 0x349c(%rip), %rdi      # 0xaa27
leaq 0x34be(%rip), %rsi      # 0xaa50
movb $0x0, %al
callq 0x3060
leaq 0x34bc(%rip), %rdi      # 0xaa5c
leaq 0x34d4(%rip), %rsi      # 0xaa7b
movb $0x0, %al
callq 0x3060
leaq 0x34c9(%rip), %rdi      # 0xaa7e
leaq 0x34eb(%rip), %rsi      # 0xaaa7
movb $0x0, %al
callq 0x3060
leaq 0x34e9(%rip), %rdi      # 0xaab3
leaq 0x350a(%rip), %rsi      # 0xaadb
movb $0x0, %al
callq 0x3060
leaq 0x3508(%rip), %rdi      # 0xaae7
leaq 0x33a2(%rip), %rsi      # 0xa988
movb $0x0, %al
callq 0x3060
leaq 0x3541(%rip), %rdi      # 0xab35
movb $0x0, %al
callq 0x3060
xorl %edi, %edi
callq 0x3140
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x3146(%rip), %rsi      # 0xabe7
callq 0x7170
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x7ae8
movq 0x6541(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
leaq 0x31f6(%rip), %rsi      # 0xacbb
movb $0x0, %al
callq 0x30c0
xorl %eax, %eax
movl %eax, %edi
callq 0x3120
leaq -0x8(%rbp), %rdi
callq 0x7110
movl $0x1, %edi
callq 0x3140
movq -0x8(%rbp), %rax
movzbl -0x9(%rbp), %ecx
movq 0x20(%rax,%rcx,8), %rdi
movq -0x8(%rbp), %rax
movzbl -0x9(%rbp), %ecx
movq 0x58(%rax,%rcx,8), %rdx
movq -0x20(%rbp), %rcx
movl $0x1, %esi
callq 0x3150
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
movzbl -0x9(%rbp), %edx
cmpq 0x58(%rcx,%rdx,8), %rax
je 0x7b46
leaq 0x31b6(%rip), %rdi      # 0xace4
callq 0x3120
leaq -0x8(%rbp), %rdi
callq 0x7110
movl $0x1, %edi
callq 0x3140
movq -0x20(%rbp), %rdi
callq 0x3050
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq $0x1505, -0x18(%rbp)    # imm = 0x1505
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movzbl (%rax), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
je 0x7bab
movq -0x18(%rbp), %rax
shlq $0x5, %rax
addq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
jmp 0x7b78
movq -0x18(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x18, %edi
callq 0x30e0
movq %rax, -0x8(%rbp)
movl $0x20, %edi
movl $0x28, %esi
callq 0x3090
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq $0x20, 0x8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
cmpq $0x0, -0x20(%rbp)
jne 0x7c6f
movq -0x18(%rbp), %rdx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x7c96
jmp 0x7c71
movq -0x20(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x7c8a
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x7c71
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x20(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x28, %edi
callq 0x30e0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x71a0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movb $0x0, 0x8(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x18(%rbp), %rax
movb $0x0, 0x10(%rax)
movq -0x18(%rbp), %rax
movb $0x0, 0x11(%rax)
movb $0x0, %al
callq 0x71c0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x10(%rbp), %rdi
callq 0x7b60
movq -0x8(%rbp), %rcx
xorl %edx, %edx
divq 0x8(%rcx)
movq %rdx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x7c20
movq -0x8(%rbp), %rdi
callq 0x7ca0
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x7b60
movq -0x10(%rbp), %rcx
xorl %edx, %edx
divq 0x8(%rcx)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x7f5e
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
callq 0x30a0
cmpl $0x0, %eax
jne 0x7f50
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x7f66
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x7f2a
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x8001
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x7ff1
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
addq $0x18, %rdi
xorl %esi, %esi
callq 0x7470
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x3030
movq -0x20(%rbp), %rdi
callq 0x3030
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x7fb0
jmp 0x7ff3
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x7f8f
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x3030
movq -0x10(%rbp), %rdi
callq 0x3030
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x90, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jg 0x80ea
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
subq -0x18(%rbp), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x38(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rcx
leaq 0x62f3(%rip), %rax      # 0xe380
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x30a0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0x80c1
movq -0x28(%rbp), %rcx
leaq 0x62cc(%rip), %rax      # 0xe380
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0x80f2
cmpl $0x0, -0x2c(%rbp)
jge 0x80d3
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
cmpl $0x0, -0x2c(%rbp)
jle 0x80e5
movq -0x28(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x804c
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3080
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x30(%rcx), %rax
jb 0x8182
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rsi
shlq %rsi
callq 0x3100
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x8167
leaq 0x35fb(%rip), %rdi      # 0xb753
callq 0x3120
movl $0x1, %edi
callq 0x3140
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rcx
shlq %rcx
movq %rcx, 0x30(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0xc(%rbp), %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rsi
movq 0x28(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x28(%rsi)
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x40(%rax)
movl -0xc(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop