LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mhmt/mhmt-parsearg.c
// Function: sort_args
void sort_args( struct argtbl * args, ULONG argsize )
{
    struct argtbl temp;
    LONG i,j;

    // simple bubble sort since there are not too many arguments
    for( i=(argsize-2); i>=0; i-- ) {
        for( j=0; j<=i; j++ ) {
            if( args[j].type > args[j+1].type ) {
                temp      = args[j];
                args[j]   = args[j+1];
                args[j+1] = temp;
            }
        }
    }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movl -0xc(%rsp), %eax
subl $0x2, %eax
movl %eax, -0x24(%rsp)
cmpl $0x0, -0x24(%rsp)
jl 0x6126
movl $0x0, -0x28(%rsp)
movl -0x28(%rsp), %eax
cmpl -0x24(%rsp), %eax
jg 0x6114
movq -0x8(%rsp), %rax
movslq -0x28(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq -0x8(%rsp), %rcx
movl -0x28(%rsp), %edx
addl $0x1, %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpl 0x8(%rcx), %eax
jbe 0x6102
movq -0x8(%rsp), %rax
movslq -0x28(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x20(%rsp)
movq 0x8(%rax), %rax
movq %rax, -0x18(%rsp)
movq -0x8(%rsp), %rax
movslq -0x28(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq -0x8(%rsp), %rcx
movl -0x28(%rsp), %edx
addl $0x1, %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x8(%rsp), %rax
movl -0x28(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq -0x20(%rsp), %rcx
movq %rcx, (%rax)
movq -0x18(%rsp), %rcx
movq %rcx, 0x8(%rax)
jmp 0x6104
movl -0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rsp)
jmp 0x6047
jmp 0x6116
movl -0x24(%rsp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rsp)
jmp 0x6034
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mhmt/mhmt-tb.c
// Function: init_tb
void init_tb(void)
{
    ULONG i;
    tb_free=NULL;    // init linked list of free tb_chain elements
    tb_bunches=NULL; // no bunches already allocated

    for(i=0; i<65536; i++) { // init array of 2-byte match pointers
        tb_entry[i]=NULL;
    }
}

// Assembly:
movq $0x0, 0xfad5(%rip) # 0x15c90
movq $0x0, 0xfad2(%rip) # 0x15c98
movl $0x0, -0x4(%rsp)
cmpl $0x10000, -0x4(%rsp)    # imm = 0x10000
jae 0x61fa
movl -0x4(%rsp), %eax
movl %eax, %ecx
leaq 0xfabb(%rip), %rax      # 0x15ca0
movq $0x0, (%rax,%rcx,8)
movl -0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rsp)
jmp 0x61ce
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mhmt/mhmt-tb.c
// Function: free_tb
void free_tb(void)
{
    // free all allocated bunches
    struct tb_bunch * tbtmp;

    while( tb_bunches ) {
        tbtmp=tb_bunches;
        tb_bunches=tb_bunches->next;
        free( tbtmp );
    }
}

// Assembly:
pushq %rax
cmpq $0x0, 0xfa8f(%rip)      # 0x15c98
je 0x6232
movq 0xfa86(%rip), %rax      # 0x15c98
movq %rax, (%rsp)
movq 0xfa7b(%rip), %rax      # 0x15c98
movq (%rax), %rax
movq %rax, 0xfa71(%rip)      # 0x15c98
movq (%rsp), %rdi
callq 0x10b0
jmp 0x6201
popq %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mhmt/mhmt-tb.c
// Function: add_tb
ULONG add_tb(UWORD index, ULONG position)
{
    struct tb_chain * newtb;
    newtb=get_free_tb();

    if( !newtb ) {
        // no free elements
        if( position > wrk.maxwin ) { // if there could be enough tbs to try to flush
            // try to flush current chain
            cutoff_tb_chain(index,position);
        }

        newtb=get_free_tb();

        if( !newtb ) {
            // nothing free - allocate new bunch
            if( !add_bunch_of_tb() ) {
                return 0;
            }

            newtb=get_free_tb(); // here is no chance to fail!... hopefully...
        }
    }

    newtb->pos=position-1; // points to the first byte of given two bytes
    newtb->next=tb_entry[index];
    tb_entry[index]=newtb;
    return 1;
}

// Assembly:
subq $0x18, %rsp
movw %di, %ax
movw %ax, 0x12(%rsp)
movl %esi, 0xc(%rsp)
callq 0x6300
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
jne 0x62b0
movl 0xc(%rsp), %eax
leaq 0x8135(%rip), %rcx      # 0xe3a0
cmpl 0x1c(%rcx), %eax
jbe 0x6281
movw 0x12(%rsp), %ax
movl 0xc(%rsp), %esi
movzwl %ax, %edi
callq 0x6350
callq 0x6300
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
jne 0x62ae
callq 0x6490
cmpl $0x0, %eax
jne 0x62a5
movl $0x0, 0x14(%rsp)
jmp 0x62f5
callq 0x6300
movq %rax, (%rsp)
jmp 0x62b0
movl 0xc(%rsp), %ecx
subl $0x1, %ecx
movq (%rsp), %rax
movl %ecx, (%rax)
movzwl 0x12(%rsp), %eax
movl %eax, %ecx
leaq 0xf9d5(%rip), %rax      # 0x15ca0
movq (%rax,%rcx,8), %rcx
movq (%rsp), %rax
movq %rcx, 0x8(%rax)
movq (%rsp), %rdx
movzwl 0x12(%rsp), %eax
movl %eax, %ecx
leaq 0xf9b7(%rip), %rax      # 0x15ca0
movq %rdx, (%rax,%rcx,8)
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mhmt/mhmt-tb.c
// Function: get_free_tb
struct tb_chain * get_free_tb(void)
{
    struct tb_chain * newtb;

    if( tb_free ) {
        newtb=tb_free;
        tb_free=tb_free->next;
        return newtb;

    } else {
        return NULL;
    }
}

// Assembly:
cmpq $0x0, 0xf988(%rip)      # 0x15c90
je 0x6334
movq 0xf97f(%rip), %rax      # 0x15c90
movq %rax, -0x10(%rsp)
movq 0xf973(%rip), %rax      # 0x15c90
movq 0x8(%rax), %rax
movq %rax, 0xf968(%rip)      # 0x15c90
movq -0x10(%rsp), %rax
movq %rax, -0x8(%rsp)
jmp 0x633d
movq $0x0, -0x8(%rsp)
movq -0x8(%rsp), %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mhmt/mhmt-tb.c
// Function: cutoff_tb_chain
void cutoff_tb_chain(UWORD index,ULONG position)
{
    struct tb_chain * curr, * prev;
    curr=tb_entry[index];

    if( !curr ) return; // if nothing to remove

    // see if we should delete some elements after first element in the given chain
    prev=curr;
    curr=curr->next;

    while( curr ) {
        if( (position-(curr->pos)) > wrk.maxwin ) { // found some old element: delete rest of chain along with it
            // find end of chain
            while( curr->next ) {
                curr = curr->next;
            }

            // now curr - last chain element, prev->next - beginning of orphaned chain
            // add orphaned chain to free list
            curr->next = tb_free;
            tb_free = prev->next;
            prev->next = NULL; // cut off chain
            break;

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

    // delete first (entry) element in chain if needed (in this case, all subsequent els are already deleted)
    curr=tb_entry[index];

    if( (position-(curr->pos)) > wrk.maxwin ) {
        tb_entry[index] = NULL;
        curr->next=tb_free; // element goes to free list
        tb_free=curr;
    }
}

// Assembly:
movw %di, %ax
movw %ax, -0x2(%rsp)
movl %esi, -0x8(%rsp)
movzwl -0x2(%rsp), %eax
movl %eax, %ecx
leaq 0xf936(%rip), %rax      # 0x15ca0
movq (%rax,%rcx,8), %rax
movq %rax, -0x10(%rsp)
cmpq $0x0, -0x10(%rsp)
jne 0x6380
jmp 0x6485
movq -0x10(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rsp)
cmpq $0x0, -0x10(%rsp)
je 0x6425
movl -0x8(%rsp), %eax
movq -0x10(%rsp), %rcx
subl (%rcx), %eax
leaq 0x7fea(%rip), %rcx      # 0xe3a0
cmpl 0x1c(%rcx), %eax
jbe 0x6408
jmp 0x63bd
movq -0x10(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x63d9
movq -0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rsp)
jmp 0x63bd
movq 0xf8b0(%rip), %rcx      # 0x15c90
movq -0x10(%rsp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0xf897(%rip)      # 0x15c90
movq -0x18(%rsp), %rax
movq $0x0, 0x8(%rax)
jmp 0x6425
movq -0x10(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rsp)
jmp 0x6398
movzwl -0x2(%rsp), %eax
movl %eax, %ecx
leaq 0xf86d(%rip), %rax      # 0x15ca0
movq (%rax,%rcx,8), %rax
movq %rax, -0x10(%rsp)
movl -0x8(%rsp), %eax
movq -0x10(%rsp), %rcx
subl (%rcx), %eax
leaq 0x7f52(%rip), %rcx      # 0xe3a0
cmpl 0x1c(%rcx), %eax
jbe 0x6485
movzwl -0x2(%rsp), %eax
movl %eax, %ecx
leaq 0xf83f(%rip), %rax      # 0x15ca0
movq $0x0, (%rax,%rcx,8)
movq 0xf820(%rip), %rcx      # 0x15c90
movq -0x10(%rsp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rsp), %rax
movq %rax, 0xf80b(%rip)      # 0x15c90
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mhmt/mhmt-tb.c
// Function: add_bunch_of_tb
ULONG add_bunch_of_tb(void)
{
    ULONG i;
    struct tb_bunch * newbunch;
    // alloc new bunch
    newbunch=(struct tb_bunch *)malloc( sizeof(struct tb_bunch) );

    if( !newbunch ) return 0;

    // link every twobyter into one list
    for(i=0; i<(BUNCHSIZE-1); i++) {
        newbunch->bunch[i].next=&(newbunch->bunch[i+1]);
    }

    // add this list to the free list
    newbunch->bunch[BUNCHSIZE-1].next=tb_free;
    tb_free=&(newbunch->bunch[0]);
    // add bunch to bunches list
    newbunch->next=tb_bunches;
    tb_bunches=newbunch;
    return 1;
}

// Assembly:
subq $0x18, %rsp
movl $0x10008, %edi          # imm = 0x10008
callq 0x10d0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x64b8
movl $0x0, 0x14(%rsp)
jmp 0x654e
movl $0x0, 0x10(%rsp)
cmpl $0xfff, 0x10(%rsp)      # imm = 0xFFF
jae 0x6508
movq 0x8(%rsp), %rcx
addq $0x8, %rcx
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
shlq $0x4, %rax
addq %rax, %rcx
movq 0x8(%rsp), %rax
addq $0x8, %rax
movl 0x10(%rsp), %edx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x64c0
movq 0xf781(%rip), %rcx      # 0x15c90
movq 0x8(%rsp), %rax
movq %rcx, 0x10000(%rax)
movq 0x8(%rsp), %rax
addq $0x8, %rax
movq %rax, 0xf765(%rip)      # 0x15c90
movq 0xf766(%rip), %rcx      # 0x15c98
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
movq 0x8(%rsp), %rax
movq %rax, 0xf752(%rip)      # 0x15c98
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mhmt/mhmt-depack.c
// Function: depack_outbyte
ULONG depack_outbyte(UBYTE byte, ULONG operation)
{
    if( operation==DEPACK_OUTBYTE_ADD ) {
        buffer[buf_ptr++] = byte;

        if( buf_ptr>0x51d ) {
//			printf("����\n");
        }

        if( buf_ptr >= buf_size ) {
            buf_ptr=0;
            return emit_file( buffer, buf_size );
        }

        return 1;

    } else if( operation==DEPACK_OUTBYTE_FLUSH ) {
        if( buf_ptr ) return emit_file( buffer, buf_ptr );

        return 1;

    } else {
        printf("mhmt-depack.c:depack_outbyte() - bad operation requested\n");
        return 0;
    }
}

// Assembly:
subq $0x18, %rsp
movb %dil, %al
movb %al, 0x13(%rsp)
movl %esi, 0xc(%rsp)
cmpl $0x2, 0xc(%rsp)
jne 0x866f
movb 0x13(%rsp), %dl
movq 0x8d697(%rip), %rax     # 0x95ca8
movl 0x8d68d(%rip), %ecx     # 0x95ca4
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x8d682(%rip)     # 0x95ca4
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
cmpl $0x51d, 0x8d673(%rip)   # imm = 0x51D
jbe 0x8635
jmp 0x8635
movl 0x8d669(%rip), %eax     # 0x95ca4
cmpl 0x8d65f(%rip), %eax     # 0x95ca0
jb 0x8665
movl $0x0, 0x8d657(%rip)     # 0x95ca4
movq 0x8d654(%rip), %rdi     # 0x95ca8
movl 0x8d646(%rip), %esi     # 0x95ca0
callq 0x1950
movl %eax, 0x14(%rsp)
jmp 0x86b7
movl $0x1, 0x14(%rsp)
jmp 0x86b7
cmpl $0x1, 0xc(%rsp)
jne 0x86a1
cmpl $0x0, 0x8d627(%rip)     # 0x95ca4
je 0x8697
movq 0x8d622(%rip), %rdi     # 0x95ca8
movl 0x8d618(%rip), %esi     # 0x95ca4
callq 0x1950
movl %eax, 0x14(%rsp)
jmp 0x86b7
movl $0x1, 0x14(%rsp)
jmp 0x86b7
leaq 0x21b6(%rip), %rdi      # 0xa85e
movb $0x0, %al
callq 0x1040
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mhmt/mhmt-depack.c
// Function: depack_getbyte
ULONG depack_getbyte(ULONG operation)
{
    static ULONG position;

    if( operation==DEPACK_GETBYTE_REWIND ) {
        position=0;
        return 0;

    } else if( operation==DEPACK_GETBYTE_NEXT ) {
        if( position < wrk.inlen ) {
//#ifdef DBG
//			printf("<%02x>", wrk.indata[position]);
//#endif
            return (ULONG)wrk.indata[position++];
        }

    } else // should never happen in a correct program
        printf("mhmt-depack.c:depack_get() - wrong operation code\n");

    return 0xFFFFFFFF;
}

// Assembly:
pushq %rax
movl %edi, (%rsp)
cmpl $0x0, (%rsp)
jne 0x86de
movl $0x0, 0x8d5dc(%rip)     # 0x95cb0
movl $0x0, 0x4(%rsp)
jmp 0x8738
cmpl $0x1, (%rsp)
jne 0x8720
movl 0x8d5c6(%rip), %eax     # 0x95cb0
leaq 0x5caf(%rip), %rcx      # 0xe3a0
cmpl 0x48(%rcx), %eax
jae 0x871e
leaq 0x5ca3(%rip), %rax      # 0xe3a0
movq 0x40(%rax), %rax
movl 0x8d5a9(%rip), %ecx     # 0x95cb0
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x8d59e(%rip)     # 0x95cb0
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl %eax, 0x4(%rsp)
jmp 0x8738
jmp 0x872e
leaq 0x2085(%rip), %rdi      # 0xa7ac
movb $0x0, %al
callq 0x1040
jmp 0x8730
movl $0xffffffff, 0x4(%rsp)  # imm = 0xFFFFFFFF
movl 0x4(%rsp), %eax
popq %rcx
retq
nop
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mhmt/mhmt-depack.c
// Function: depack_repeat
ULONG depack_repeat(LONG disp, ULONG length)
{
    ULONG back_ptr;
    ULONG success=1;

//#ifdef DBG
//	printf("\n");
//#endif
    // in a self-consistent system, these three errors should never appear, since there is input stream check before actual depacking
    if( !length ) {
        printf("mhmt-depack.c:depack_repeat() - zero length!\n");
        return 0;

    } else if( disp>=0 ) {
        printf("mhmt-depack.c:depack_repeat() - non-negative displacement!\n");
        return 0;

    } else if( (ULONG)(-disp)>buf_size ) {
        printf("mhmt-depack.c:depack_repeat() - displacement greater than buffer size!\n");
        return 0;

    } else {
        back_ptr = (disp+buf_ptr) & (buf_size-1); // buf_size MUST BE 2^N!

        do {
            success = success && depack_outbyte( buffer[back_ptr], DEPACK_OUTBYTE_ADD ); // also increases buf_ptr
            back_ptr = (back_ptr+1) & (buf_size-1); // buf_size MUST BE 2^N!
        } while( --length );
    }

    return success;
}

// Assembly:
subq $0x18, %rsp
movl %edi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movl $0x1, 0x4(%rsp)
cmpl $0x0, 0xc(%rsp)
jne 0x8936
leaq 0x1f76(%rip), %rdi      # 0xa898
movb $0x0, %al
callq 0x1040
movl $0x0, 0x14(%rsp)
jmp 0x8a0b
cmpl $0x0, 0x10(%rsp)
jl 0x8958
leaq 0x1f82(%rip), %rdi      # 0xa8c6
movb $0x0, %al
callq 0x1040
movl $0x0, 0x14(%rsp)
jmp 0x8a0b
xorl %eax, %eax
subl 0x10(%rsp), %eax
cmpl 0x8d33c(%rip), %eax     # 0x95ca0
jbe 0x8981
leaq 0x1f95(%rip), %rdi      # 0xa902
movb $0x0, %al
callq 0x1040
movl $0x0, 0x14(%rsp)
jmp 0x8a0b
movl 0x10(%rsp), %eax
addl 0x8d319(%rip), %eax     # 0x95ca4
movl 0x8d30f(%rip), %ecx     # 0x95ca0
subl $0x1, %ecx
andl %ecx, %eax
movl %eax, 0x8(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x4(%rsp)
movb %al, 0x3(%rsp)
je 0x89ca
movq 0x8d2fa(%rip), %rax     # 0x95ca8
movl 0x8(%rsp), %ecx
movl $0x2, %esi
movzbl (%rax,%rcx), %edi
callq 0x85f0
cmpl $0x0, %eax
setne %al
movb %al, 0x3(%rsp)
movb 0x3(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x4(%rsp)
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl 0x8d2bc(%rip), %ecx     # 0x95ca0
subl $0x1, %ecx
andl %ecx, %eax
movl %eax, 0x8(%rsp)
movl 0xc(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0xc(%rsp)
cmpl $0x0, %eax
jne 0x899a
jmp 0x89ff
jmp 0x8a01
jmp 0x8a03
movl 0x4(%rsp), %eax
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mhmt/mhmt-depack.c
// Function: depack_getbits_word
ULONG depack_getbits_word(void)
{
    ULONG bits,bits2;

    if( wrk.wordbit ) { // 16bits
        if( wrk.bigend ) {
            bits  = depack_getbyte(DEPACK_GETBYTE_NEXT);

            if( bits  == 0xFFFFFFFF ) return 0xFFFFFFFF;

            bits2 = depack_getbyte(DEPACK_GETBYTE_NEXT);

            if( bits2 == 0xFFFFFFFF ) return 0xFFFFFFFF;

        } else {
            bits2 = depack_getbyte(DEPACK_GETBYTE_NEXT);

            if( bits2 == 0xFFFFFFFF ) return 0xFFFFFFFF;

            bits  = depack_getbyte(DEPACK_GETBYTE_NEXT);

            if( bits  == 0xFFFFFFFF ) return 0xFFFFFFFF;
        }

        bits = (bits<<24) | ( 0x00FF0000&(bits2<<16) );

    } else { // 8bits
        bits=depack_getbyte(DEPACK_GETBYTE_NEXT);

        if( bits!=0xFFFFFFFF)
            bits <<= 24;
    }

    return bits;
}

// Assembly:
subq $0x18, %rsp
leaq 0x5975(%rip), %rax      # 0xe3a0
cmpl $0x0, 0x10(%rax)
je 0x8ae4
leaq 0x5964(%rip), %rax      # 0xe3a0
cmpl $0x0, 0x14(%rax)
je 0x8a88
movl $0x1, %edi
callq 0x86c0
movl %eax, 0x10(%rsp)
cmpl $-0x1, 0x10(%rsp)
jne 0x8a64
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
jmp 0x8b0e
movl $0x1, %edi
callq 0x86c0
movl %eax, 0xc(%rsp)
cmpl $-0x1, 0xc(%rsp)
jne 0x8a86
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
jmp 0x8b0e
jmp 0x8ac8
movl $0x1, %edi
callq 0x86c0
movl %eax, 0xc(%rsp)
cmpl $-0x1, 0xc(%rsp)
jne 0x8aa7
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
jmp 0x8b0e
movl $0x1, %edi
callq 0x86c0
movl %eax, 0x10(%rsp)
cmpl $-0x1, 0x10(%rsp)
jne 0x8ac6
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
jmp 0x8b0e
jmp 0x8ac8
movl 0x10(%rsp), %eax
shll $0x18, %eax
movl 0xc(%rsp), %ecx
shll $0x10, %ecx
andl $0xff0000, %ecx         # imm = 0xFF0000
orl %ecx, %eax
movl %eax, 0x10(%rsp)
jmp 0x8b06
movl $0x1, %edi
callq 0x86c0
movl %eax, 0x10(%rsp)
cmpl $-0x1, 0x10(%rsp)
je 0x8b04
movl 0x10(%rsp), %eax
shll $0x18, %eax
movl %eax, 0x10(%rsp)
jmp 0x8b06
movl 0x10(%rsp), %eax
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O0/evanwire[P]GitClone/client.c
// Function: configure
void configure(char* host, char* port){
  int configure_fd = open(".configure", O_WRONLY | O_TRUNC | O_CREAT, 0777);

  if(configure_fd < 0){
    printf("\nError: Was unable to open/create the .configure file. Please try again.\n");
    exit(1);
  }
  int initial_size = strlen(host) + strlen(port) + 1;
  char to_be_written[initial_size];
  memset(to_be_written, 0, sizeof to_be_written);
  strcat(to_be_written, host);
  strcat(to_be_written, " ");
  strcat(to_be_written, port);
  int write_size = write(configure_fd, to_be_written, initial_size);
  if(write_size < 0){
    printf("\nError: Was unable to write to the .configure file. Please try again.\n");
    exit(1);
  }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x581f(%rip), %rdi      # 0x7446
movl $0x241, %esi            # imm = 0x241
movl $0x1ff, %edx            # imm = 0x1FF
movb $0x0, %al
callq 0x10f0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0x1c59
leaq 0x5809(%rip), %rdi      # 0x7451
movb $0x0, %al
callq 0x1040
movl $0x1, %edi
callq 0x1170
movq -0x8(%rbp), %rdi
callq 0x10b0
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10b0
movq %rax, %rcx
movq -0x40(%rbp), %rax
movl %ecx, %edx
movl %eax, %ecx
movl %ecx, %eax
movl %edx, %ecx
leal 0x1(%rax,%rcx), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl %eax, %edx
movq %rsp, %rax
movq %rax, -0x20(%rbp)
movq %rdx, %rax
addq $0xf, %rax
andq $-0x10, %rax
movq %rsp, %rdi
subq %rax, %rdi
movq %rdi, -0x38(%rbp)
movq %rdi, %rsp
movq %rdx, -0x28(%rbp)
xorl %esi, %esi
callq 0x10d0
movq -0x38(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x1200
movq -0x38(%rbp), %rdi
leaq 0x637f(%rip), %rsi      # 0x804b
callq 0x1200
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x1200
movq -0x38(%rbp), %rsi
movl -0x14(%rbp), %edi
movslq -0x18(%rbp), %rdx
callq 0x1090
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jge 0x1d0f
leaq 0x579d(%rip), %rdi      # 0x749b
movb $0x0, %al
callq 0x1040
movl $0x1, %edi
callq 0x1170
movq -0x20(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/evanwire[P]GitClone/client.c
// Function: readFile
char* readFile(char* fileName){
  //Finding file's size
  struct stat st;
  stat(fileName, &st);
  int size = st.st_size;

  char* file_contents = malloc(size * sizeof(char));
  if(!file_contents){
    printf("\nError: was unable to use malloc(). Please try again.\n");
    exit(1);
  }
  memset(file_contents, 0, size);

  int file_fd = open(fileName, O_RDONLY);
  if(file_fd < 0){
    printf("\nError: Ran into trouble reading file %s.", fileName);
    return "Error";
  }

  int bytes_read = read(file_fd, file_contents, size);
  file_contents[bytes_read] = '\0';
  close(file_fd);
  return file_contents;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x1130
movq -0x70(%rbp), %rax
movl %eax, -0xa4(%rbp)
movslq -0xa4(%rbp), %rdi
shlq $0x0, %rdi
callq 0x1180
movq %rax, -0xb0(%rbp)
cmpq $0x0, -0xb0(%rbp)
jne 0x5eb2
leaq 0x1d7e(%rip), %rdi      # 0x7c1f
movb $0x0, %al
callq 0x1040
movl $0x1, %edi
callq 0x1170
movq -0xb0(%rbp), %rdi
movslq -0xa4(%rbp), %rdx
xorl %esi, %esi
callq 0x10d0
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movb $0x0, %al
callq 0x10f0
movl %eax, -0xb4(%rbp)
cmpl $0x0, -0xb4(%rbp)
jge 0x5f02
movq -0x10(%rbp), %rsi
leaq 0x1d68(%rip), %rdi      # 0x7c56
movb $0x0, %al
callq 0x1040
leaq 0x1d84(%rip), %rax      # 0x7c80
movq %rax, -0x8(%rbp)
jmp 0x5f49
movl -0xb4(%rbp), %edi
movq -0xb0(%rbp), %rsi
movslq -0xa4(%rbp), %rdx
callq 0x11a0
movl %eax, -0xb8(%rbp)
movq -0xb0(%rbp), %rax
movslq -0xb8(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl -0xb4(%rbp), %edi
callq 0x1220
movq -0xb0(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/evanwire[P]GitClone/client.c
// Function: hashIt
char* hashIt(char* input){
  unsigned char digest[MD5_DIGEST_LENGTH];
  MD5(input, strlen(input), digest);
  int i;
  char * result=(char*)malloc(34*sizeof(char));
  memset(result,'\0',34);
  for(i = 0; i < MD5_DIGEST_LENGTH; i++){
     sprintf(result+2*i, "%02x", digest[i]);
  }

  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0x10b0
movq -0x38(%rbp), %rdi
movq %rax, %rsi
leaq -0x20(%rbp), %rdx
callq 0x11c0
movl $0x22, %edi
callq 0x1180
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x22, %edx
callq 0x10d0
movl $0x0, -0x24(%rbp)
cmpl $0x10, -0x24(%rbp)
jge 0x5fe8
movq -0x30(%rbp), %rdi
movl -0x24(%rbp), %eax
shll %eax
cltq
addq %rax, %rdi
movslq -0x24(%rbp), %rax
movzbl -0x20(%rbp,%rax), %edx
leaq 0x1c01(%rip), %rsi      # 0x7bd7
movb $0x0, %al
callq 0x1060
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x5fb2
movq -0x30(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/evanwire[P]GitClone/client.c
// Function: copyFile
void copyFile(char* from_file_name, int to_fd){
  char* from_file_contents = readFile(from_file_name);

  int bytes_written = write(to_fd, from_file_contents, strlen(from_file_contents));
  if(bytes_written < 0){
    printf("\nError: unable to execute the write() function. Please try again.\n");
    exit(1);
  }

  free(from_file_contents);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x5e50
movq %rax, -0x18(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x10b0
movl -0x2c(%rbp), %edi
movq -0x28(%rbp), %rsi
movq %rax, %rdx
callq 0x1090
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jge 0x6063
leaq 0x1b8a(%rip), %rdi      # 0x7bdc
movb $0x0, %al
callq 0x1040
movl $0x1, %edi
callq 0x1170
movq -0x18(%rbp), %rdi
callq 0x1160
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/evanwire[P]GitClone/client.c
// Function: read_line
char* read_line(int fd){
  //Creating a buffer to hold the entire file
  int file_storage_size = 10;
  int file_idx = 0;
  char* file_contents = malloc(file_storage_size * sizeof(char));
  if(!file_contents){
    printf("\nError: was unable to use malloc(). Please try again.\n");
    exit(1);
  }

  //buffer to read character of the file to
  char buffer[1];


  //Copy from file to buffer until \n is reached
  while((read(fd, buffer, 1)) == 1){
    if(buffer[0] == '\n' || buffer[0] == 0 || buffer[0] == EOF){
      break;
    }else{
      file_contents[file_idx] = buffer[0];
      file_idx++;
       if(file_idx == file_storage_size){
        char* larger_file = realloc(file_contents, 2 * file_storage_size * sizeof(char));

        if(!larger_file){
          printf("\nError: was unable to use realloc(). Please try again.\n");
          exit(1);
        }

        file_contents = larger_file;
      }

    }


  }
  //Eliminate any unwanted characters from the realloc
  char* fixed_file_contents = malloc(file_idx * sizeof(char));
  strcpy(fixed_file_contents, file_contents);
  fixed_file_contents[file_idx] = '\0';

  //free the original file_contents
  free(file_contents);

  return fixed_file_contents;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl $0xa, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movslq -0x8(%rbp), %rdi
shlq $0x0, %rdi
callq 0x1180
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x60c9
leaq 0x1b67(%rip), %rdi      # 0x7c1f
movb $0x0, %al
callq 0x1040
movl $0x1, %edi
callq 0x1170
jmp 0x60cb
movl -0x4(%rbp), %edi
leaq -0x19(%rbp), %rsi
movl $0x1, %edx
callq 0x11a0
cmpq $0x1, %rax
jne 0x6169
movsbl -0x19(%rbp), %eax
cmpl $0xa, %eax
je 0x6101
movsbl -0x19(%rbp), %eax
cmpl $0x0, %eax
je 0x6101
movsbl -0x19(%rbp), %eax
cmpl $-0x1, %eax
jne 0x6103
jmp 0x6169
movb -0x19(%rbp), %dl
movq -0x18(%rbp), %rax
movslq -0xc(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x8(%rbp), %eax
jne 0x6162
movq -0x18(%rbp), %rdi
movl -0x8(%rbp), %eax
shll %eax
movslq %eax, %rsi
shlq $0x0, %rsi
callq 0x11f0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x615a
leaq 0x1b3d(%rip), %rdi      # 0x7c86
movb $0x0, %al
callq 0x1040
movl $0x1, %edi
callq 0x1170
movq -0x28(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x6164
jmp 0x60cb
movslq -0xc(%rbp), %rdi
shlq $0x0, %rdi
callq 0x1180
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1140
movq -0x30(%rbp), %rax
movslq -0xc(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rdi
callq 0x1160
movq -0x30(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/ramirezsebas[P]TP-LISTINGS/./src/capitulo_5/5.4/semaphoreImplementation.c
// Function: main
int main (void)
{
  key_t key=123;
  int semid= binary_semaphore_allocation (key, IPC_CREAT | 0600);
  id= semid;
  pthread_t t1, t2;
  binary_semaphore_initialize(id);
  printf ("Contador antes de entrar al semaforo : %d \n", contador);
  pthread_create (&t1, NULL, *t1_function, NULL);
  pthread_create (&t2, NULL, *t2_function, NULL);

  pthread_join(t1, NULL);
  pthread_join(t2, NULL);

  //El contador vuelve a ser cero, ya que el semaforo
  //Es el que permite que la variable no sea alterada por ambos a la vez

  printf ("Valor final del contador: %d \n", contador);
  binary_semaphore_deallocate (id);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0x4(%rbp)
movl $0x7b, -0x8(%rbp)
movl -0x8(%rbp), %edi
movl $0x380, %esi            # imm = 0x380
callq 0x1310
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, 0x2e9d(%rip)      # 0x405c
movl 0x2e97(%rip), %edi      # 0x405c
callq 0x1370
movl 0x2e90(%rip), %esi      # 0x4060
leaq 0xe2d(%rip), %rdi       # 0x2004
movb $0x0, %al
callq 0x1040
leaq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %ecx
leaq 0x63(%rip), %rdx        # 0x1250
movq %rcx, %rsi
callq 0x1050
leaq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %ecx
leaq 0xac(%rip), %rdx        # 0x12b0
movq %rcx, %rsi
callq 0x1050
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1080
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1080
movl 0x2e34(%rip), %esi      # 0x4060
leaq 0xdfd(%rip), %rdi       # 0x2030
movb $0x0, %al
callq 0x1040
movl 0x2e1c(%rip), %edi      # 0x405c
callq 0x1340
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/ramirezsebas[P]TP-LISTINGS/./src/capitulo_5/5.4/semaphoreImplementation.c
// Function: t1_function
static void *t1_function (void* arg)
{
  for (int i = 0; i< LOOP ; i++){
    binary_semaphore_wait (id);
    contador +=1;
    binary_semaphore_post (id);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x1388, -0x14(%rbp)    # imm = 0x1388
jge 0x129c
movl 0x2dea(%rip), %edi      # 0x405c
callq 0x13b0
movl 0x2de3(%rip), %eax      # 0x4060
addl $0x1, %eax
movl %eax, 0x2dda(%rip)      # 0x4060
movl 0x2dd0(%rip), %edi      # 0x405c
callq 0x13f0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1263
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ramirezsebas[P]TP-LISTINGS/./src/capitulo_5/5.4/semaphoreImplementation.c
// Function: t2_function
static void *t2_function (void* arg)
{
  for (int i = 0; i< LOOP ; i++){
    binary_semaphore_wait (id);
    contador -=1;
    binary_semaphore_post (id);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x1388, -0x14(%rbp)    # imm = 0x1388
jge 0x12fc
movl 0x2d8a(%rip), %edi      # 0x405c
callq 0x13b0
movl 0x2d83(%rip), %eax      # 0x4060
subl $0x1, %eax
movl %eax, 0x2d7a(%rip)      # 0x4060
movl 0x2d70(%rip), %edi      # 0x405c
callq 0x13f0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x12c3
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ramirezsebas[P]TP-LISTINGS/./src/capitulo_5/5.4/sem_pv.c
// Function: binary_semaphore_wait
int binary_semaphore_wait (int semid)
{
	struct sembuf operations[1];
	/* Use the first (and only) semaphore.*/
	operations[0].sem_num = 0;
	/* Decrement by 1. */
	operations[0].sem_op = -1;
	/* Permit undo’ing. */
	operations[0].sem_flg = SEM_UNDO;

	return semop (semid, operations, 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movw $0x0, -0xa(%rbp)
movw $0xffff, -0x8(%rbp)     # imm = 0xFFFF
movw $0x1000, -0x6(%rbp)     # imm = 0x1000
movl -0x4(%rbp), %edi
leaq -0xa(%rbp), %rsi
movl $0x1, %edx
callq 0x1070
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ramirezsebas[P]TP-LISTINGS/./src/capitulo_5/5.4/sem_pv.c
// Function: binary_semaphore_post
int binary_semaphore_post (int semid)
{
	struct sembuf operations[1];
	/* Use the first (and only) semaphore. */
	operations[0].sem_num = 0;
	/* Increment by 1. */
	operations[0].sem_op = 1;
	/* Permit undo’ing. */
	operations[0].sem_flg = SEM_UNDO;

	return semop (semid, operations, 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movw $0x0, -0xa(%rbp)
movw $0x1, -0x8(%rbp)
movw $0x1000, -0x6(%rbp)     # imm = 0x1000
movl -0x4(%rbp), %edi
leaq -0xa(%rbp), %rsi
movl $0x1, %edx
callq 0x1070
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/moefh[P]hed/src/main.c
// Function: print_version
static void print_version(void)
{
  printf("hed, a tiny hex editor\n");
  printf("Version " HED_VERSION " compiled on " __DATE__ "\n");
  printf("Copyright (C) 2017 Ricardo R. Massaro\n");
  printf("Source code: https://github.com/ricardo-massaro/hed\n");
}

// Assembly:
pushq %rax
leaq 0x8959(%rip), %rdi      # 0xb051
movb $0x0, %al
callq 0x20e0
leaq 0x8963(%rip), %rdi      # 0xb069
movb $0x0, %al
callq 0x20e0
leaq 0x897a(%rip), %rdi      # 0xb08e
movb $0x0, %al
callq 0x20e0
leaq 0x8993(%rip), %rdi      # 0xb0b5
movb $0x0, %al
callq 0x20e0
popq %rax
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/moefh[P]hed/src/main.c
// Function: read_stdin
static uint8_t *read_stdin(size_t *ret_len)
{
  uint8_t *data = NULL;
  size_t len = 0;
  size_t cap = 0;

  while (true) {
    char buf[4096];
    size_t n = fread(buf, 1, sizeof(buf), stdin);
    if (n == 0)
      break;
    if (len + n > cap) {
      while (len + n > cap)
        cap = (cap == 0) ? 16*1024 : cap * 2;
      data = realloc(data, cap);
      if (! data) {
        fprintf(stderr, "ERROR: out of memory\n");
        return NULL;
      }
    }
    memcpy(data + len, buf, n);
    len += n;
  }
  *ret_len = len;
  return data;
}

// Assembly:
subq $0x1038, %rsp           # imm = 0x1038
movq %rdi, 0x1028(%rsp)
movq $0x0, 0x1020(%rsp)
movq $0x0, 0x1018(%rsp)
movq $0x0, 0x1010(%rsp)
leaq 0x10(%rsp), %rdi
movq 0xb839(%rip), %rax      # 0xdfd8
movq (%rax), %rcx
movl $0x1, %esi
movl $0x1000, %edx           # imm = 0x1000
callq 0x2080
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x27c3
jmp 0x28b3
movq 0x1018(%rsp), %rax
addq 0x8(%rsp), %rax
cmpq 0x1010(%rsp), %rax
jbe 0x287a
jmp 0x27e0
movq 0x1018(%rsp), %rax
addq 0x8(%rsp), %rax
cmpq 0x1010(%rsp), %rax
jbe 0x282a
cmpq $0x0, 0x1010(%rsp)
jne 0x280d
movl $0x4000, %eax           # imm = 0x4000
movq %rax, (%rsp)
jmp 0x281c
movq 0x1010(%rsp), %rax
shlq %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq %rax, 0x1010(%rsp)
jmp 0x27e0
movq 0x1020(%rsp), %rdi
movq 0x1010(%rsp), %rsi
callq 0x21e0
movq %rax, 0x1020(%rsp)
cmpq $0x0, 0x1020(%rsp)
jne 0x2878
movq 0xb79f(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x89bf(%rip), %rsi      # 0xb222
movb $0x0, %al
callq 0x2160
movq $0x0, 0x1030(%rsp)
jmp 0x28d6
jmp 0x287a
movq 0x1020(%rsp), %rdi
addq 0x1018(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
callq 0x21a0
movq 0x8(%rsp), %rax
addq 0x1018(%rsp), %rax
movq %rax, 0x1018(%rsp)
jmp 0x2793
movq 0x1018(%rsp), %rcx
movq 0x1028(%rsp), %rax
movq %rcx, (%rax)
movq 0x1020(%rsp), %rax
movq %rax, 0x1030(%rsp)
movq 0x1030(%rsp), %rax
addq $0x1038, %rsp           # imm = 0x1038
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/moefh[P]hed/src/term.c
// Function: term_setup_raw
int term_setup_raw(int use_term_fd)
{
  struct termios term;

  term_fd = use_term_fd;
  if (! isatty(term_fd))
    return -1;
  if (tcgetattr(term_fd, &old_term) < 0)
    return -1;
  restored_old_term = 0;
  
  term = old_term;
  term.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON);
  term.c_oflag &= ~OPOST;
  term.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
  term.c_cflag &= ~(CSIZE | PARENB);
  term.c_cflag |= CS8;
  term.c_cc[VMIN] = 0;
  term.c_cc[VTIME] = 1;
  if (tcsetattr(term_fd, TCSAFLUSH, &term) < 0 || atexit(term_restore) != 0)
    return -1;
  return 0;
}

// Assembly:
subq $0x48, %rsp
movl %edi, 0x40(%rsp)
movl 0x40(%rsp), %eax
movl %eax, 0xb976(%rip)      # 0xe2a8
movl 0xb970(%rip), %edi      # 0xe2a8
callq 0x2070
cmpl $0x0, %eax
jne 0x294f
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x2a17
movl 0xb953(%rip), %edi      # 0xe2a8
leaq 0xb950(%rip), %rsi      # 0xe2ac
callq 0x2200
cmpl $0x0, %eax
jge 0x2973
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x2a17
movl $0x0, 0xb927(%rip)      # 0xe2a4
leaq 0x4(%rsp), %rdi
leaq 0xb923(%rip), %rsi      # 0xe2ac
movl $0x3c, %edx
callq 0x21a0
movl 0x4(%rsp), %eax
andl $0xfffffa14, %eax       # imm = 0xFFFFFA14
movl %eax, 0x4(%rsp)
movl 0x8(%rsp), %eax
andl $-0x2, %eax
movl %eax, 0x8(%rsp)
movl 0x10(%rsp), %eax
andl $0xffff7fb4, %eax       # imm = 0xFFFF7FB4
movl %eax, 0x10(%rsp)
movl 0xc(%rsp), %eax
andl $0xfffffecf, %eax       # imm = 0xFFFFFECF
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %eax
orl $0x30, %eax
movl %eax, 0xc(%rsp)
movb $0x0, 0x1b(%rsp)
movb $0x1, 0x1a(%rsp)
movl 0xb8c8(%rip), %edi      # 0xe2a8
movl $0x2, %esi
leaq 0x4(%rsp), %rdx
callq 0x2210
cmpl $0x0, %eax
jl 0x2a05
leaq -0x10b(%rip), %rdi      # 0x28f0
callq 0xa160
cmpl $0x0, %eax
je 0x2a0f
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x2a17
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
// File: /workspace/github_c_makefile_star2_O0/moefh[P]hed/src/term.c
// Function: term_get_window_size
int term_get_window_size(int *width, int *height)
{
  struct winsize term_size;

  if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &term_size) < 0)
    return -1;
  *width = term_size.ws_col;
  *height = term_size.ws_row;
  return 0;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movl $0x1, %edi
movl $0x5413, %esi           # imm = 0x5413
leaq 0x8(%rsp), %rdx
movb $0x0, %al
callq 0x2100
cmpl $0x0, %eax
jge 0x2a53
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
jmp 0x2a73
movzwl 0xa(%rsp), %ecx
movq 0x18(%rsp), %rax
movl %ecx, (%rax)
movzwl 0x8(%rsp), %ecx
movq 0x10(%rsp), %rax
movl %ecx, (%rax)
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/moefh[P]hed/src/screen.c
// Function: hed_init_screen
int hed_init_screen(struct hed_screen *scr)
{
  signal(SIGWINCH, SIG_DFL);
  screen = scr;

  screen->term_fd = (isatty(STDIN_FILENO)) ? STDIN_FILENO : STDOUT_FILENO;
  if (term_setup_raw(screen->term_fd) < 0)
    return -1;
  
  term_get_window_size(&screen->w, &screen->h);
  screen->window_changed = true;
  screen->redraw_needed = true;
  screen->utf8_box_draw = true;
  screen->vt100_box_draw = true;
  screen->msg_was_set = false;
  screen->cur_msg[0] = '\0';
  screen->out_buf_len = 0;
  
  signal(SIGWINCH, handle_sigwinch);
  return 0;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movl $0x1c, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x2150
movq 0x8(%rsp), %rax
movq %rax, 0xae1d(%rip)      # 0xe2f0
xorl %edi, %edi
callq 0x2070
movl %eax, %edx
movl $0x1, %ecx
xorl %eax, %eax
cmpl $0x0, %edx
cmovnel %eax, %ecx
movq 0xae00(%rip), %rax      # 0xe2f0
movl %ecx, (%rax)
movq 0xadf7(%rip), %rax      # 0xe2f0
movl (%rax), %edi
callq 0x2920
cmpl $0x0, %eax
jge 0x3512
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
jmp 0x359a
movq 0xadd7(%rip), %rdi      # 0xe2f0
addq $0x4, %rdi
movq 0xadcc(%rip), %rsi      # 0xe2f0
addq $0x8, %rsi
callq 0x2a20
movq 0xadbc(%rip), %rax      # 0xe2f0
movb $0x1, 0xc(%rax)
movq 0xadb1(%rip), %rax      # 0xe2f0
movb $0x1, 0xd(%rax)
movq 0xada6(%rip), %rax      # 0xe2f0
movb $0x1, 0xe(%rax)
movq 0xad9b(%rip), %rax      # 0xe2f0
movb $0x1, 0xf(%rax)
movq 0xad90(%rip), %rax      # 0xe2f0
movb $0x0, 0x10(%rax)
movq 0xad85(%rip), %rax      # 0xe2f0
movb $0x0, 0x11(%rax)
movq 0xad7a(%rip), %rax      # 0xe2f0
movq $0x0, 0x518(%rax)
movl $0x1c, %edi
leaq 0x23(%rip), %rsi        # 0x35b0
callq 0x2150
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/moefh[P]hed/src/screen.c
// Function: handle_sigwinch
static void handle_sigwinch(int signum)
{
  if (screen) {
    term_get_window_size(&screen->w, &screen->h);
    screen->window_changed = true;
    screen->redraw_needed = true;
  }
  signal(signum, handle_sigwinch);
}

// Assembly:
pushq %rax
movl %edi, 0x4(%rsp)
cmpq $0x0, 0xad33(%rip)      # 0xe2f0
je 0x35f0
movq 0xad2a(%rip), %rdi      # 0xe2f0
addq $0x4, %rdi
movq 0xad1f(%rip), %rsi      # 0xe2f0
addq $0x8, %rsi
callq 0x2a20
movq 0xad0f(%rip), %rax      # 0xe2f0
movb $0x1, 0xc(%rax)
movq 0xad04(%rip), %rax      # 0xe2f0
movb $0x1, 0xd(%rax)
movl 0x4(%rsp), %edi
leaq -0x4b(%rip), %rsi       # 0x35b0
callq 0x2150
popq %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/moefh[P]hed/src/screen.c
// Function: hed_scr_show_msg
int hed_scr_show_msg(const char *fmt, ...)
{
  va_list ap;
  va_start(ap, fmt);
  if (screen)
    vsnprintf(screen->cur_msg, sizeof(screen->cur_msg), fmt, ap);
  else {
    vfprintf(stderr, fmt, ap);
    fprintf(stderr, "\n");
  }
  va_end(ap);
  
  if (screen) {
    screen->redraw_needed = true;
    screen->msg_was_set = true;
  }
  return -1;
}

// Assembly:
subq $0xd8, %rsp
testb %al, %al
je 0x364c
movaps %xmm0, 0x30(%rsp)
movaps %xmm1, 0x40(%rsp)
movaps %xmm2, 0x50(%rsp)
movaps %xmm3, 0x60(%rsp)
movaps %xmm4, 0x70(%rsp)
movaps %xmm5, 0x80(%rsp)
movaps %xmm6, 0x90(%rsp)
movaps %xmm7, 0xa0(%rsp)
movq %r9, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq %rdi, 0xd0(%rsp)
leaq 0xb0(%rsp), %rax
movq %rsp, %rcx
movq %rcx, 0x10(%rax)
leaq 0xe0(%rsp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x8, (%rax)
cmpq $0x0, 0xac53(%rip)      # 0xe2f0
je 0x36c6
movq 0xac4a(%rip), %rdi      # 0xe2f0
addq $0x11, %rdi
movq 0xd0(%rsp), %rdx
leaq 0xb0(%rsp), %rcx
movl $0x100, %esi            # imm = 0x100
callq 0x2090
jmp 0x36fd
movq 0xa92b(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq 0xd0(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
callq 0x2230
movq 0xa90c(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x7ee4(%rip), %rsi      # 0xb5da
movb $0x0, %al
callq 0x2160
leaq 0xb0(%rsp), %rax
cmpq $0x0, 0xabe3(%rip)      # 0xe2f0
je 0x3725
movq 0xabda(%rip), %rax      # 0xe2f0
movb $0x1, 0xd(%rax)
movq 0xabcf(%rip), %rax      # 0xe2f0
movb $0x1, 0x10(%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0xd8, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/moefh[P]hed/src/screen.c
// Function: hed_scr_clear_msg
int hed_scr_clear_msg(void)
{
  screen->cur_msg[0] = '\0';
  screen->redraw_needed = true;
  screen->msg_was_set = true;
  return -1;
}

// Assembly:
movq 0xaba9(%rip), %rax      # 0xe2f0
movb $0x0, 0x11(%rax)
movq 0xab9e(%rip), %rax      # 0xe2f0
movb $0x1, 0xd(%rax)
movq 0xab93(%rip), %rax      # 0xe2f0
movb $0x1, 0x10(%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/moefh[P]hed/src/screen.c
// Function: hed_scr_flush
void hed_scr_flush(void)
{
  if (screen->out_buf_len > 0) {
    size_t pos = 0;
    while (pos < screen->out_buf_len) {
      ssize_t n = write(screen->term_fd, screen->out_buf + pos, screen->out_buf_len - pos);
      if (n < 0) {
        if (errno != EINTR)
          break;
      } else if (n == 0)
        break;
      pos += n;
    }
    screen->out_buf_len = 0;
  }
}

// Assembly:
subq $0x18, %rsp
movq 0xab55(%rip), %rax      # 0xe2f0
cmpq $0x0, 0x518(%rax)
jbe 0x3848
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0xab32(%rip), %rcx      # 0xe2f0
cmpq 0x518(%rcx), %rax
jae 0x3836
movq 0xab22(%rip), %rax      # 0xe2f0
movl (%rax), %edi
movq 0xab19(%rip), %rsi      # 0xe2f0
addq $0x111, %rsi            # imm = 0x111
addq 0x10(%rsp), %rsi
movq 0xab06(%rip), %rax      # 0xe2f0
movq 0x518(%rax), %rdx
subq 0x10(%rsp), %rdx
callq 0x20a0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jge 0x3816
callq 0x2040
cmpl $0x4, (%rax)
je 0x3814
jmp 0x3836
jmp 0x3822
cmpq $0x0, 0x8(%rsp)
jne 0x3820
jmp 0x3836
jmp 0x3822
movq 0x8(%rsp), %rax
addq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x37b2
movq 0xaab3(%rip), %rax      # 0xe2f0
movq $0x0, 0x518(%rax)
addq $0x18, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/moefh[P]hed/src/screen.c
// Function: hed_scr_out
void hed_scr_out(const char *fmt, ...)
{
  static char buf[1024];

  va_list ap;
  va_start(ap, fmt);
  vsnprintf(buf, sizeof(buf), fmt, ap);
  va_end(ap);

  size_t len = strlen(buf);
  if (screen->out_buf_len + len > sizeof(screen->out_buf))
    hed_scr_flush();
  memcpy(screen->out_buf + screen->out_buf_len, buf, len);
  screen->out_buf_len += len;
}

// Assembly:
subq $0xe8, %rsp
testb %al, %al
je 0x388c
movaps %xmm0, 0x30(%rsp)
movaps %xmm1, 0x40(%rsp)
movaps %xmm2, 0x50(%rsp)
movaps %xmm3, 0x60(%rsp)
movaps %xmm4, 0x70(%rsp)
movaps %xmm5, 0x80(%rsp)
movaps %xmm6, 0x90(%rsp)
movaps %xmm7, 0xa0(%rsp)
movq %r9, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq %rdi, 0xe0(%rsp)
leaq 0xc0(%rsp), %rax
movq %rsp, %rcx
movq %rcx, 0x10(%rax)
leaq 0xf0(%rsp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x8, (%rax)
movq 0xe0(%rsp), %rdx
leaq 0xc0(%rsp), %rcx
leaq 0xaa14(%rip), %rdi      # 0xe300
movl $0x400, %esi            # imm = 0x400
callq 0x2090
leaq 0xc0(%rsp), %rax
leaq 0xa9fb(%rip), %rdi      # 0xe300
callq 0x20d0
movq %rax, 0xb8(%rsp)
movq 0xa9d7(%rip), %rax      # 0xe2f0
movq 0x518(%rax), %rax
addq 0xb8(%rsp), %rax
cmpq $0x400, %rax            # imm = 0x400
jbe 0x3935
callq 0x3790
movq 0xa9b4(%rip), %rax      # 0xe2f0
movq 0x518(%rax), %rcx
leaq 0x111(%rax,%rcx), %rdi
movq 0xb8(%rsp), %rdx
leaq 0xa9a6(%rip), %rsi      # 0xe300
callq 0x21a0
movq 0xb8(%rsp), %rdx
movq 0xa982(%rip), %rax      # 0xe2f0
movq 0x518(%rax), %rcx
addq %rdx, %rcx
movq %rcx, 0x518(%rax)
addq $0xe8, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/moefh[P]hed/src/screen.c
// Function: hed_scr_set_color
void hed_scr_set_color(int c1, int c2)
{
  if (c1 >= 0)
    hed_scr_out("\x1b[%dm", c1);
  if (c2 >= 0)
    hed_scr_out("\x1b[%dm", c2);
}

// Assembly:
pushq %rax
movl %edi, 0x4(%rsp)
movl %esi, (%rsp)
cmpl $0x0, 0x4(%rsp)
jl 0x3ca1
movl 0x4(%rsp), %esi
leaq 0x7699(%rip), %rdi      # 0xb333
movb $0x0, %al
callq 0x3850
cmpl $0x0, (%rsp)
jl 0x3cb8
movl (%rsp), %esi
leaq 0x7682(%rip), %rdi      # 0xb333
movb $0x0, %al
callq 0x3850
popq %rax
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/moefh[P]hed/src/screen.c
// Function: hed_scr_move_cursor
void hed_scr_move_cursor(int x, int y)
{
  if (x < 1) x = 1;
  if (y < 1) y = 1;
  if (x > screen->w) x = screen->w;
  if (y > screen->h) y = screen->h;
  hed_scr_out("\x1b[%d;%dH", y, x);
}

// Assembly:
pushq %rax
movl %edi, 0x4(%rsp)
movl %esi, (%rsp)
cmpl $0x1, 0x4(%rsp)
jge 0x3d97
movl $0x1, 0x4(%rsp)
cmpl $0x1, (%rsp)
jge 0x3da4
movl $0x1, (%rsp)
movl 0x4(%rsp), %eax
movq 0xa541(%rip), %rcx      # 0xe2f0
cmpl 0x4(%rcx), %eax
jle 0x3dc2
movq 0xa535(%rip), %rax      # 0xe2f0
movl 0x4(%rax), %eax
movl %eax, 0x4(%rsp)
movl (%rsp), %eax
movq 0xa524(%rip), %rcx      # 0xe2f0
cmpl 0x8(%rcx), %eax
jle 0x3dde
movq 0xa518(%rip), %rax      # 0xe2f0
movl 0x8(%rax), %eax
movl %eax, (%rsp)
movl (%rsp), %esi
movl 0x4(%rsp), %edx
leaq 0x756c(%rip), %rdi      # 0xb358
movb $0x0, %al
callq 0x3850
popq %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/moefh[P]hed/src/file.c
// Function: hed_new_file_from_data
struct hed_file *hed_new_file_from_data(uint8_t *data, size_t data_len)
{
  struct hed_file *file = new_file();
  if (! file)
    return NULL;
  
  file->data = data;
  file->data_len = data_len;
  file->modified = (data != NULL);
  return file;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
callq 0x3ed0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x3e8b
movq $0x0, 0x20(%rsp)
jmp 0x3ec5
movq 0x18(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
cmpq $0x0, 0x18(%rsp)
setne %cl
movq 0x8(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x28(%rax)
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/moefh[P]hed/src/file.c
// Function: new_file
static struct hed_file *new_file(void)
{
  struct hed_file *file = malloc(sizeof(struct hed_file));
  file->next = NULL;
  file->prev = NULL;
  file->filename = NULL;
  file->data = NULL;
  file->data_len = 0;
  file->modified = false;
  file->show_data = false;
  file->pane = HED_PANE_HEX;
  file->top_line = 0;
  file->cursor_pos = 0;
  return file;
}

// Assembly:
pushq %rax
movl $0x48, %edi
callq 0x21c0
movq %rax, (%rsp)
movq (%rsp), %rax
movq $0x0, (%rax)
movq (%rsp), %rax
movq $0x0, 0x8(%rax)
movq (%rsp), %rax
movq $0x0, 0x20(%rax)
movq (%rsp), %rax
movq $0x0, 0x10(%rax)
movq (%rsp), %rax
movq $0x0, 0x18(%rax)
movq (%rsp), %rax
movb $0x0, 0x28(%rax)
movq (%rsp), %rax
movb $0x0, 0x29(%rax)
movq (%rsp), %rax
movl $0x0, 0x34(%rax)
movq (%rsp), %rax
movq $0x0, 0x40(%rax)
movq (%rsp), %rax
movq $0x0, 0x38(%rax)
movq (%rsp), %rax
popq %rcx
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/moefh[P]hed/src/file.c
// Function: hed_free_file
void hed_free_file(struct hed_file *file)
{
  if (file->filename)
    free(file->filename);
  if (file->data)
    free(file->data);
  free(file);
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
movq (%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x3f7d
movq (%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x2030
movq (%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x3f95
movq (%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x2030
movq (%rsp), %rdi
callq 0x2030
popq %rax
retq