LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mhmt/mhmt-main.c
// Function: show_help
void show_help(void)
{
    printf("======== mhmt help ========\n");
    printf("parameters:\n");
    printf("-mlz, -hrm, -hst - use MegaLZ, hrum3.5 or hrust1.x format (default is MegaLZ)\n");
    printf("-g - greedy coding (default is optimal coding)\n");
    printf("-d - depacking instead of packing (default is packing)\n");
    printf("\n");
    printf("-zxh - use zx-specific header for hrum or hrust. DEFAULT is NO HEADER!\n");
    printf("       Not applicable for MegaLZ. If -zxh is specified, -16, NO -bend and\n");
    printf("       NO -mlz is forced.\n");
    printf("\n");
    printf("-8, -16 - bitstream is in bytes or words in packed file.\n");
    printf("          Default for MegaLZ is -8, for hrum and hrust is -16.\n");
    printf("\n");
    printf("-bend - if -16 specified, this makes words big-endian. Default is little-endian.\n");
    printf("\n");
    printf("-maxwinN - maximum lookback window. N is decimal number, which can only be\n");
    printf("           256,512,1024,2048,4096,8192,16384,32768. Default is format-specific\n");
    printf("           maximum window: MegaLZ is 4352, hrum is 4096, hrust is 65536.\n");
    printf("           For given format, window can't be greater than default value\n");
    printf("\n");
    printf("usage:\n");
    printf("mhmt [parameter list] <input filename> [<output filename>]\n");
    printf("\n");
    printf("if no output filename given, filename is appended with \".mlz\", \".hrm\" or \".hst\"\n");
    printf("in accordance with format chosen; for depacking \".dpk\" is appended\n");
    printf("====== mhmt help end ======\n");
    printf("\n");
}

// Assembly:
pushq %rax
leaq 0x3968(%rip), %rdi      # 0x67e3
callq 0x1120
leaq 0x3978(%rip), %rdi      # 0x67ff
callq 0x1120
leaq 0x3978(%rip), %rdi      # 0x680b
callq 0x1120
leaq 0x39ba(%rip), %rdi      # 0x6859
callq 0x1120
leaq 0x39dd(%rip), %rdi      # 0x6888
callq 0x1120
movl $0xa, %edi
callq 0x10f0
leaq 0x39fe(%rip), %rdi      # 0x68bf
callq 0x1120
leaq 0x3a39(%rip), %rdi      # 0x6906
callq 0x1120
leaq 0x3a77(%rip), %rdi      # 0x6950
callq 0x1120
movl $0xa, %edi
callq 0x10f0
leaq 0x3a7b(%rip), %rdi      # 0x696a
callq 0x1120
leaq 0x3aa8(%rip), %rdi      # 0x69a3
callq 0x1120
movl $0xa, %edi
callq 0x10f0
leaq 0x3ad1(%rip), %rdi      # 0x69e2
callq 0x1120
movl $0xa, %edi
callq 0x10f0
leaq 0x3b0c(%rip), %rdi      # 0x6a33
callq 0x1120
leaq 0x3b4b(%rip), %rdi      # 0x6a7e
callq 0x1120
leaq 0x3b8e(%rip), %rdi      # 0x6acd
callq 0x1120
leaq 0x3bcb(%rip), %rdi      # 0x6b16
callq 0x1120
movl $0xa, %edi
callq 0x10f0
leaq 0x3bfd(%rip), %rdi      # 0x6b5e
callq 0x1120
leaq 0x3bf8(%rip), %rdi      # 0x6b65
callq 0x1120
movl $0xa, %edi
callq 0x10f0
leaq 0x3c1d(%rip), %rdi      # 0x6ba0
callq 0x1120
leaq 0x3c61(%rip), %rdi      # 0x6bf0
callq 0x1120
leaq 0x3c98(%rip), %rdi      # 0x6c33
callq 0x1120
movl $0xa, %edi
popq %rax
jmp 0x10f0
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mhmt/mhmt-optimal.c
// Function: make_optch
struct optchain * make_optch(ULONG actual_len)
{
    struct optchain * optch;
    ULONG i;
    // we allocate length+1 because all codes at the end of input stream will point
    // to the length+1 place. Also we'll start reversing from length+1 position in optch array
    optch = (struct optchain *)malloc( (actual_len+1)*sizeof(struct optchain) );

    if( optch ) {
        optch[0].code.length = 1; // 1st byte is always copied 'as-is', however, this is just filler,
        optch[0].code.disp   = 0; // not accounted elsewhere
        // init prices to absolute maximum for optimal chain build-up
        optch[0].price = 0;
        optch[1].price = 8;

        for(i=2; i<(actual_len+1); i++)
            optch[i].price = 0xFFFFFFFF;
    }

    return optch;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
incl %ebx
movq %rbx, %rdi
shlq $0x4, %rdi
callq 0x10e0
testq %rax, %rax
je 0x34df
movq $0x1, (%rax)
movl $0x0, 0x8(%rax)
movl $0x8, 0x18(%rax)
cmpl $0x3, %ebx
jb 0x34df
movl %ebx, %edx
leaq 0x1(%rdx), %rcx
andq $-0x4, %rcx
addq $-0x3, %rdx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movq %rax, %rdx
addq $0x58, %rdx
xorl %esi, %esi
movdqa 0x39a7(%rip), %xmm1     # 0x6db0
movdqa 0x39af(%rip), %xmm2     # 0x6dc0
movdqa 0x39b7(%rip), %xmm3     # 0x6dd0
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movq %rsi, %xmm5
pshufd $0x44, %xmm5, %xmm5     # xmm5 = xmm5[0,1,0,1]
movdqa %xmm5, %xmm6
por %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %edi
notl %edi
testb $0x1, %dil
je 0x346b
movl $0xffffffff, -0x30(%rdx) # imm = 0xFFFFFFFF
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %edi
testb $0x1, %dil
je 0x3481
movl $0xffffffff, -0x20(%rdx) # imm = 0xFFFFFFFF
por %xmm1, %xmm5
pxor %xmm3, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
pxor %xmm4, %xmm5
pextrw $0x0, %xmm5, %edi
testb $0x1, %dil
je 0x34bd
movl $0xffffffff, -0x10(%rdx) # imm = 0xFFFFFFFF
pextrw $0x4, %xmm5, %edi
testb $0x1, %dil
je 0x34ce
movl $0xffffffff, (%rdx)     # imm = 0xFFFFFFFF
addq $0x4, %rsi
addq $0x40, %rdx
cmpq %rsi, %rcx
jne 0x3421
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mhmt/mhmt-optimal.c
// Function: update_optch
void update_optch(ULONG position, struct lzcode * codes, ULONG (*get_lz_price)(ULONG position, struct lzcode * lzcode), struct optchain * optch)
{
    ULONG codepos;
    ULONG bitlen;
    ULONG newpos;
    LONG len;

    for( codepos = 0; len=codes[codepos].length; codepos++ ) { // loop through all existing lz codes
        bitlen = (*get_lz_price)(position, &codes[codepos]); // get bit length of given lz code

        if( !bitlen ) {
            printf("mhmt-optimal.c: update_optch() found zero bitlength of lz code. Fatal error.\n");
            exit(1);

        } else {
            if( len<0 ) len=(-len); // deal with negative lengths (special markers)

            newpos = position + len; // look where current lz code points to and take from there old price reaching that location

            if( optch[newpos].price > bitlen + optch[position].price ) { // if oldprice is worse than with current lz code
                optch[newpos].price = bitlen + optch[position].price;
                optch[newpos].code  = codes[codepos];
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movl (%rsi), %r15d
testl %r15d, %r15d
je 0x3574
movq %rcx, %rbx
movl %edi, %ebp
movl %edi, %eax
shlq $0x4, %rax
leaq (%rcx,%rax), %r13
addq $0x8, %r13
movl $0x1, %r14d
movq 0x8(%rsp), %r12
movl %ebp, %edi
movq %r12, %rsi
callq *0x10(%rsp)
testl %eax, %eax
je 0x3583
movl %r15d, %ecx
negl %ecx
cmovsl %r15d, %ecx
addl %ebp, %ecx
shlq $0x4, %rcx
addl (%r13), %eax
cmpl %eax, 0x8(%rbx,%rcx)
jbe 0x355c
addq %rbx, %rcx
movl %eax, 0x8(%rcx)
movq (%r12), %rax
movq %rax, (%rcx)
movl %r14d, %eax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,8), %r12
movl (%r12), %r15d
incl %r14d
testl %r15d, %r15d
jne 0x3529
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3856(%rip), %rdi      # 0x6de0
callq 0x1120
movl $0x1, %edi
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mhmt/mhmt-optimal.c
// Function: reverse_optch
void reverse_optch(struct optchain * optch, ULONG actual_len)
{
    struct lzcode curr, temp;
    ULONG position;
    LONG len;
    position = actual_len;
    temp = optch[position].code;

    while(position>1) {
        len = temp.length;

        if( len<0 ) len=(-len);

        position -= len;
        curr = temp;
        temp = optch[position].code;
        optch[position].code = curr;
    }
}

// Assembly:
cmpl $0x2, %esi
jb 0x35d0
movl %esi, %eax
shlq $0x4, %rax
movq (%rdi,%rax), %xmm0
movd %xmm0, %eax
movl %eax, %ecx
negl %ecx
cmovnsl %eax, %ecx
addl %ecx, %esi
movq %rsi, %rax
shlq $0x4, %rax
movq (%rdi,%rax), %xmm1
movq %xmm0, (%rdi,%rax)
movdqa %xmm1, %xmm0
cmpl $0x1, %esi
ja 0x35a9
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mhmt/mhmt-parsearg.c
// Function: cmp_str_nocase
LONG cmp_str_nocase(char * left, char * right)
{
    LONG order=0;
    UBYTE leftchar,rightchar;
    UBYTE leftadd,rightadd;

    do {
        leftchar  = (UBYTE)*left;
        rightchar = (UBYTE)*right;
        leftadd  = 0;
        rightadd = 0;
        left++;
        right++;

        if( leftchar  >= (UBYTE)'a' ) leftadd  = (UBYTE)('A'-'a');

        if( rightchar >= (UBYTE)'a' ) rightadd = (UBYTE)('A'-'a');

        if( leftchar  > (UBYTE)'z' ) leftadd  = 0;

        if( rightchar > (UBYTE)'z' ) rightadd = 0;

        leftchar  += leftadd;
        rightchar += rightadd;

        if( leftchar<rightchar ) order = (-1);

        if( leftchar>rightchar ) order = (+1);
    } while( (!order) && leftchar && rightchar );

    return order;
}

// Assembly:
pushq %rbx
xorl %ecx, %ecx
movl $0x1, %edx
xorl %r8d, %r8d
movb (%rdi,%r8), %al
movb (%rsi,%r8), %r9b
cmpb $0x61, %al
setb %r10b
shlb $0x5, %r10b
addb $-0x20, %r10b
cmpb $0x61, %r9b
setb %r11b
shlb $0x5, %r11b
addb $-0x20, %r11b
cmpb $0x7b, %al
movzbl %r10b, %r10d
cmovael %ecx, %r10d
cmpb $0x7b, %r9b
movzbl %r11b, %r11d
cmovael %ecx, %r11d
addb %al, %r10b
leal (%r11,%r9), %ebx
cmpb %bl, %r10b
movl $0x0, %eax
sbbl %eax, %eax
cmpb %bl, %r10b
cmoval %edx, %eax
addb %r9b, %r11b
je 0x3d44
testb %r10b, %r10b
je 0x3d44
incq %r8
testl %eax, %eax
je 0x3ce0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mhmt/mhmt-parsearg.c
// Function: match_arg
struct argtbl * match_arg(char * argument)
{
    struct argtbl * test_arg = default_arg_table;

    while( test_arg->name && cmp_str_nocase(test_arg->name,argument) )
        test_arg++;

    return (test_arg->name)?test_arg:NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x635c(%rip), %rdi      # 0xa0b0
testq %rdi, %rdi
je 0x3d79
leaq 0x6350(%rip), %rbx      # 0xa0b0
movq %r14, %rsi
callq 0x3cd5
testl %eax, %eax
je 0x3d7b
movq 0x10(%rbx), %rdi
addq $0x10, %rbx
testq %rdi, %rdi
jne 0x3d60
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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:
movl %esi, %eax
addl $-0x2, %eax
js 0x3dd1
decl %esi
movq %rdi, %rdx
xorl %ecx, %ecx
movl 0x8(%rdx), %r9d
leaq 0x10(%rdx), %r8
cmpl 0x18(%rdx), %r9d
jbe 0x3dba
movups (%rdx), %xmm0
movaps %xmm0, -0x18(%rsp)
movups (%r8), %xmm0
movups %xmm0, (%rdx)
movaps -0x18(%rsp), %xmm0
movups %xmm0, (%r8)
incq %rcx
movq %r8, %rdx
cmpq %rcx, %rsi
jne 0x3d94
leal -0x1(%rax), %ecx
decq %rsi
testl %eax, %eax
movl %ecx, %eax
jg 0x3d8f
retq
// File: /workspace/github_c_makefile_star2_O1/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:
movq 0xedd6(%rip), %rdi      # 0x12c18
testq %rdi, %rdi
je 0x3e67
pushq %rax
movq (%rdi), %rax
movq %rax, 0xedc6(%rip)      # 0x12c18
callq 0x10c0
movq 0xedba(%rip), %rdi      # 0x12c18
testq %rdi, %rdi
jne 0x3e48
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/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:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq 0xed9b(%rip), %rax      # 0x12c10
testq %rax, %rax
je 0x3e87
movq 0x8(%rax), %rcx
movq %rcx, 0xed8b(%rip)      # 0x12c10
jmp 0x3e89
xorl %eax, %eax
movzwl %di, %r14d
testq %rax, %rax
jne 0x3ee3
leaq 0x7487(%rip), %rax      # 0xb320
cmpl %ebx, 0x1c(%rax)
jae 0x3ea8
movl %r14d, %edi
movl %ebx, %esi
callq 0x3f26
movq 0xed61(%rip), %rax      # 0x12c10
testq %rax, %rax
je 0x3ec1
movq 0x8(%rax), %rcx
movq %rcx, 0xed51(%rip)      # 0x12c10
jmp 0x3ec3
xorl %eax, %eax
testq %rax, %rax
jne 0x3ee3
callq 0x3faa
testl %eax, %eax
je 0x3f07
movq 0xed38(%rip), %rax      # 0x12c10
movq 0x8(%rax), %rcx
movq %rcx, 0xed2d(%rip)      # 0x12c10
decl %ebx
movl %ebx, (%rax)
leaq 0xed32(%rip), %rcx      # 0x12c20
movq (%rcx,%r14,8), %rdx
movq %rdx, 0x8(%rax)
movq %rax, (%rcx,%r14,8)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %eax, %eax
jmp 0x3eff
// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rax
movl $0x10008, %edi          # imm = 0x10008
callq 0x10e0
testq %rax, %rax
je 0x4094
movq %rax, %rcx
addq $0x8, %rcx
movdqa 0x2df3(%rip), %xmm0     # 0x6dc0
movl $0x20, %edx
movdqa 0x2df6(%rip), %xmm1     # 0x6dd0
movdqa 0x338e(%rip), %xmm2     # 0x7370
pshufd $0xf5, %xmm2, %xmm3     # xmm3 = xmm2[1,1,3,3]
pcmpeqd %xmm4, %xmm4
movdqa 0x338d(%rip), %xmm5     # 0x7380
movdqa %xmm0, %xmm6
pxor %xmm1, %xmm6
movdqa %xmm2, %xmm8
pcmpgtd %xmm6, %xmm8
pshufd $0xf5, %xmm6, %xmm7     # xmm7 = xmm6[1,1,3,3]
pcmpeqd %xmm3, %xmm7
pand %xmm8, %xmm7
movdqa %xmm0, %xmm6
psubq %xmm4, %xmm6
movd %xmm7, %esi
testb $0x1, %sil
je 0x4036
movq %xmm6, %rsi
shlq $0x4, %rsi
addq %rcx, %rsi
movq %rsi, -0x10(%rax,%rdx)
pextrw $0x4, %xmm7, %esi
testb $0x1, %sil
je 0x4056
pshufd $0xee, %xmm6, %xmm6     # xmm6 = xmm6[2,3,2,3]
movq %xmm6, %rsi
shlq $0x4, %rsi
addq %rcx, %rsi
movq %rsi, (%rax,%rdx)
paddq %xmm5, %xmm0
addq $0x20, %rdx
cmpq $0x10020, %rdx          # imm = 0x10020
jne 0x3ff3
movq 0xeba2(%rip), %rdx      # 0x12c10
movq %rdx, 0x10000(%rax)
movq %rcx, 0xeb94(%rip)      # 0x12c10
movq 0xeb95(%rip), %rcx      # 0x12c18
movq %rcx, (%rax)
movq %rax, 0xeb8b(%rip)      # 0x12c18
movl $0x1, %eax
jmp 0x4096
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mhmt/mhmt-depack.c
// Function: depack
ULONG depack(void)
{
    ULONG (*checker) (void) = NULL;
    ULONG (*depacker)(void) = NULL;
    ULONG success=1;

    // some preparations
    //
    if( wrk.packtype==PK_MLZ ) {
        checker  = &checker_megalz;
        depacker = &depacker_megalz;

    } else if( wrk.packtype==PK_HRM ) {
        checker  = &checker_hrum;
        depacker = &depacker_hrum;

    } else if( wrk.packtype==PK_HST ) {
//		checker  = &checker_hrust;
        depacker = &depacker_hrust;

    } else {
        printf("mhmt-depack.c:depack() - format unsupported!\n");
        return 0;
    }

    // allocate buffer used for depacking
    //
    buf_size = ( wrk.maxwin==4352 ) ? 8192 : wrk.maxwin; // provided there are no other non-2^n sizes
    buffer=(UBYTE*)malloc(buf_size);

    if( !buffer ) {
        printf("mhmt-depack.c:depack() cannot allocate memory for depack buffer!\n");
        return 0;
    }

    buf_ptr=0;
    success = success && emit_file(NULL,EMIT_FILE_INIT);
//	success = success && (*checker) ();
//#ifdef DBG
//	printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
//#endif
    success = success && (*depacker)();
    /*success = success && */depack_outbyte( 0, DEPACK_OUTBYTE_FLUSH );
    /*success = success && */emit_file(NULL,EMIT_FILE_FINISH);

    if( buffer )
        free(buffer);

    return success;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x727d(%rip), %rax      # 0xb320
movl (%rax), %ecx
decl %ecx
cmpl $0x3, %ecx
jae 0x413c
movl %ecx, %ecx
leaq 0x5cef(%rip), %rdx      # 0x9da8
movq (%rdx,%rcx,8), %r14
movl 0x1c(%rax), %eax
cmpl $0x1100, %eax           # imm = 0x1100
movl $0x2000, %edi           # imm = 0x2000
cmovnel %eax, %edi
movl %edi, 0x8eb4d(%rip)     # 0x92c20
callq 0x10e0
movq %rax, 0x8eb49(%rip)     # 0x92c28
testq %rax, %rax
je 0x4145
movl $0x0, 0x8eb36(%rip)     # 0x92c24
xorl %ebx, %ebx
xorl %edi, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15fc
testl %eax, %eax
je 0x410a
callq *%r14
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
movl 0x8eb14(%rip), %esi     # 0x92c24
testl %esi, %esi
je 0x4120
movq 0x8eb0d(%rip), %rdi     # 0x92c28
callq 0x15fc
xorl %edi, %edi
xorl %esi, %esi
callq 0x15fc
movq 0x8eaf8(%rip), %rdi     # 0x92c28
testq %rdi, %rdi
je 0x4153
callq 0x10c0
jmp 0x4153
leaq 0x33c0(%rip), %rdi      # 0x7503
jmp 0x414c
leaq 0x33e4(%rip), %rdi      # 0x7530
callq 0x1120
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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:
cmpl $0x1, %esi
je 0x54cc
cmpl $0x2, %esi
jne 0x54e2
movq 0x8d78e(%rip), %rax     # 0x92c28
movl 0x8d784(%rip), %ecx     # 0x92c24
leal 0x1(%rcx), %edx
movl %edx, 0x8d77b(%rip)     # 0x92c24
movb %dil, (%rax,%rcx)
movl 0x8d76d(%rip), %esi     # 0x92c20
movl $0x1, %eax
cmpl %esi, 0x8d766(%rip)     # 0x92c24
jb 0x54f5
movl $0x0, 0x8d75a(%rip)     # 0x92c24
jmp 0x54d6
movl 0x8d752(%rip), %esi     # 0x92c24
testl %esi, %esi
je 0x54f6
movq 0x8d74b(%rip), %rdi     # 0x92c28
jmp 0x15fc
pushq %rax
leaq 0x22b9(%rip), %rdi      # 0x77a3
callq 0x1120
xorl %eax, %eax
addq $0x8, %rsp
retq
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbp
pushq %rbx
pushq %rax
testl %esi, %esi
je 0x5686
testl %edi, %edi
js 0x568f
leaq 0x227b(%rip), %rdi      # 0x78ff
jmp 0x56a4
leaq 0x21fe(%rip), %rdi      # 0x788b
jmp 0x56a4
movl %edi, %eax
negl %eax
movl 0x8d587(%rip), %ebp     # 0x92c20
cmpl %eax, %ebp
jae 0x56b2
leaq 0x2214(%rip), %rdi      # 0x78b8
callq 0x1120
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl %esi, %ebx
addl 0x8d56a(%rip), %edi     # 0x92c24
decl %ebp
andl %edi, %ebp
movl $0x1, %eax
testl %eax, %eax
je 0x56e9
movq 0x8d55a(%rip), %rax     # 0x92c28
movl %ebp, %ecx
movzbl (%rax,%rcx), %edi
movl $0x2, %esi
callq 0x5489
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
setne %al
jmp 0x56eb
xorl %eax, %eax
incl %ebp
movl 0x8d52d(%rip), %ecx     # 0x92c20
decl %ecx
andl %ecx, %ebp
decl %ebx
jne 0x56c3
jmp 0x56ab
// File: /workspace/github_c_makefile_star2_O1/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:
leaq 0x5c1c(%rip), %rcx      # 0xb320
cmpl $0x0, 0x10(%rcx)
je 0x576c
cmpl $0x0, 0x14(%rcx)
movl 0x8d51b(%rip), %r8d     # 0x92c30
movl 0x48(%rcx), %esi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
je 0x5799
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpl %esi, %r8d
jae 0x573d
movq 0x40(%rcx), %rdx
movl %r8d, %edi
incl %edi
movl %edi, 0x8d4f8(%rip)     # 0x92c30
movzbl (%rdx,%r8), %edx
cmpl $-0x1, %edx
je 0x576b
movl 0x8d4e7(%rip), %r8d     # 0x92c30
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
cmpl %esi, %r8d
jae 0x5766
movq 0x40(%rcx), %rcx
leal 0x1(%r8), %esi
movl %esi, 0x8d4cf(%rip)     # 0x92c30
movzbl (%rcx,%r8), %edi
cmpl $-0x1, %edi
jne 0x57e4
retq
movl 0x8d4be(%rip), %eax     # 0x92c30
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpl 0x48(%rcx), %eax
jae 0x578d
movq 0x40(%rcx), %rcx
leal 0x1(%rax), %edx
movl %edx, 0x8d4a7(%rip)     # 0x92c30
movzbl (%rcx,%rax), %edx
movl %edx, %eax
shll $0x18, %eax
cmpl $-0x1, %edx
cmovel %edx, %eax
retq
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
cmpl %esi, %r8d
jae 0x57b6
movq 0x40(%rcx), %rdx
leal 0x1(%r8), %edi
movl %edi, 0x8d47f(%rip)     # 0x92c30
movzbl (%rdx,%r8), %edi
cmpl $-0x1, %edi
je 0x576b
movl 0x8d46e(%rip), %r8d     # 0x92c30
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpl %esi, %r8d
jae 0x57df
movq 0x40(%rcx), %rcx
leal 0x1(%r8), %edx
movl %edx, 0x8d456(%rip)     # 0x92c30
movzbl (%rcx,%r8), %edx
cmpl $-0x1, %edx
je 0x576b
shll $0x18, %edx
movzbl %dil, %eax
shll $0x10, %eax
orl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x3aa7(%rip), %rdi      # 0x5381
movl $0x241, %esi            # imm = 0x241
movl $0x1ff, %edx            # imm = 0x1FF
xorl %eax, %eax
callq 0x10e0
testl %eax, %eax
js 0x1974
movl %eax, %r14d
movq %r15, %rdi
callq 0x10a0
movq %rax, %r12
movq %rbx, %rdi
callq 0x10a0
addl %eax, %r12d
incl %r12d
leaq 0xf(%r12), %rax
andq $-0x10, %rax
movq %rsp, %r13
subq %rax, %r13
movq %r13, %rsp
movq %r13, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x10c0
movq %r13, %rdi
movq %r15, %rsi
callq 0x1220
movq %r13, %rdi
callq 0x10a0
movw $0x20, (%rax,%r13)
movq %r13, %rdi
movq %rbx, %rsi
callq 0x1220
movslq %r12d, %rdx
movl %r14d, %edi
movq %r13, %rsi
callq 0x1080
testl %eax, %eax
js 0x197d
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3e5b(%rip), %rdi      # 0x57d6
jmp 0x1984
leaq 0x3e0c(%rip), %rdi      # 0x5790
callq 0x11d0
movl $0x1, %edi
callq 0x1170
// File: /workspace/github_c_makefile_star2_O1/evanwire[P]GitClone/client.c
// Function: destroy
void destroy(char* projectName){
  //Prepare message to server
  int i;
  char to_be_written[strlen(projectName) + 3];
  memset(to_be_written, 0, sizeof(to_be_written));
  to_be_written[0] = 'd';
  to_be_written[1] = ' ';
  int message_idx = 2;
  for(i = 0; i < strlen(projectName); i++){
    if(projectName[i]){
      to_be_written[message_idx] = projectName[i];
      message_idx++;
    }
  }
  printf("\nWritten to server: -%s- Size: %d passed in: -%s-\n", to_be_written, sizeof(to_be_written), projectName);

  //Connect to server, store the response
  char* response = connect_to_WTFserver(to_be_written);

  //Report if server responded with an error
  /*
    TODO: Make a method for receiving and alerting user of errors
      -Basically, if the server response begins with a certain character or some indicator of an error, it will send the server response to that method which will print
        the error message out to the user, without including the indicator we decide to use.
  */
  if(strcmp(response, "x") == 0){
    printf("\nError: The project %s does not exist on the server.\n", projectName);
    exit(1);
  }else if(strcmp(response, "e") == 0){
    printf("\nError: The server ran into an error processing your request. Please try again.\n");
    exit(1);
  }else{
    printf("\n%s\n", response);
  }
  return;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x10a0
movq %rax, %r12
leaq 0x3(%rax), %rdx
movq %rsp, %r13
leaq 0x12(%rax), %r14
andq $-0x10, %r14
movq %r13, %r15
subq %r14, %r15
movq %r15, %rsp
negq %r14
movq %r15, %rdi
xorl %esi, %esi
movq %rdx, -0x30(%rbp)
callq 0x10c0
movw $0x2064, (%r13,%r14)    # imm = 0x2064
testq %r12, %r12
je 0x3cf3
movl $0x2, %eax
xorl %ecx, %ecx
movb (%rbx,%rcx), %dl
testb %dl, %dl
je 0x3ceb
cltq
movb %dl, (%r15,%rax)
incl %eax
incq %rcx
cmpq %rcx, %r12
jne 0x3cdc
leaq 0x1692(%rip), %rdi      # 0x538c
movq %r15, %rsi
movq -0x30(%rbp), %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1040
movq %r15, %rdi
callq 0x4202
movq %rax, %r14
leaq 0x18a5(%rip), %rsi      # 0x55c2
movq %rax, %rdi
callq 0x11a0
testl %eax, %eax
je 0x3d5c
leaq 0x1345(%rip), %rsi      # 0x5075
movq %r14, %rdi
callq 0x11a0
testl %eax, %eax
je 0x3d6f
leaq 0x168e(%rip), %rdi      # 0x53d1
movq %r14, %rsi
xorl %eax, %eax
callq 0x1040
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1673(%rip), %rdi      # 0x53d6
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1040
jmp 0x3d7b
leaq 0x22dc(%rip), %rdi      # 0x6052
callq 0x11d0
movl $0x1, %edi
callq 0x1170
// File: /workspace/github_c_makefile_star2_O1/evanwire[P]GitClone/client.c
// Function: currentVersion
void currentVersion(char* projectName){
  //Prepare message to server
  int i;
  char to_be_written[strlen(projectName) + 3];
  memset(to_be_written, 0, sizeof(to_be_written));
  to_be_written[0] = 'v';
  to_be_written[1] = ' ';
  int message_idx = 2;
  for(i = 0; i < strlen(projectName); i++){
    if(projectName[i]){
      to_be_written[message_idx] = projectName[i];
      message_idx++;
    }
  }
  printf("\nWritten to server: -%s- Size: %d passed in: -%s-\n", to_be_written, sizeof(to_be_written), projectName);

  //Connect to server, store the response
  char* response = connect_to_WTFserver(to_be_written);

  //Report if server responded with an error
  /*
    TODO: Make a method for receiving and alerting user of errors
      -Basically, if the server response begins with a certain character or some indicator of an error, it will send the server response to that method which will print
        the error message out to the user, without including the indicator we decide to use.
  */
  if(strcmp(response, "x") == 0){
    printf("\nError: The specified project does not exist on the server. Please check the project name and try again.\n");
    exit(1);
  }else if(strcmp(response, "e") == 0){
    printf("\nError: The server ran into an error processing your request. Please try again.\n");
    exit(1);
  }

  printf("Here is the current version of the project and its contained files:\n");
  printf("%s\n",response);
  free(response);

  return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x10a0
movq %rax, %r12
leaq 0x3(%rax), %rdx
movq %rsp, %r13
leaq 0x12(%rax), %r14
andq $-0x10, %r14
movq %r13, %r15
subq %r14, %r15
movq %r15, %rsp
negq %r14
movq %r15, %rdi
xorl %esi, %esi
movq %rdx, -0x30(%rbp)
callq 0x10c0
movw $0x2076, (%r13,%r14)    # imm = 0x2076
testq %r12, %r12
je 0x416f
movl $0x2, %eax
xorl %ecx, %ecx
movb (%rbx,%rcx), %dl
testb %dl, %dl
je 0x4167
cltq
movb %dl, (%r15,%rax)
incl %eax
incq %rcx
cmpq %rcx, %r12
jne 0x4158
leaq 0x1216(%rip), %rdi      # 0x538c
movq %r15, %rsi
movq -0x30(%rbp), %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1040
movq %r15, %rdi
callq 0x4202
movq %rax, %rbx
leaq 0x1429(%rip), %rsi      # 0x55c2
movq %rax, %rdi
callq 0x11a0
testl %eax, %eax
je 0x41e3
leaq 0xec9(%rip), %rsi       # 0x5075
movq %rbx, %rdi
callq 0x11a0
testl %eax, %eax
je 0x41ec
leaq 0x1e4f(%rip), %rdi      # 0x600e
callq 0x11d0
movq %rbx, %rdi
callq 0x11d0
movq %rbx, %rdi
callq 0x1160
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1eb8(%rip), %rdi      # 0x60a2
jmp 0x41f3
leaq 0x1e5f(%rip), %rdi      # 0x6052
callq 0x11d0
movl $0x1, %edi
callq 0x1170
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x90, %rsp
movq %rdi, %r14
leaq -0xb0(%rbp), %rbx
movq %rbx, %rsi
callq 0x1130
movslq 0x30(%rbx), %r15
movq %r15, %rdi
callq 0x1180
testq %rax, %rax
je 0x4460
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x10c0
movq %r14, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x10e0
testl %eax, %eax
js 0x4435
movl %eax, %r12d
movl %eax, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x11b0
cltq
movb $0x0, (%rbx,%rax)
movl %r12d, %edi
callq 0x1240
jmp 0x444d
leaq 0x1188(%rip), %rdi      # 0x55c4
movq %r14, %rsi
xorl %eax, %eax
callq 0x1040
leaq 0x11a1(%rip), %rbx      # 0x55ee
movq %rbx, %rax
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1ddd(%rip), %rdi      # 0x6244
callq 0x11d0
movl $0x1, %edi
callq 0x1170
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x10a0
leaq -0x30(%rbp), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x11e0
movl $0x22, %edi
callq 0x1180
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movw $0x0, 0x20(%rax)
leaq 0x10ff(%rip), %r14      # 0x55bf
movq %rax, %r15
xorl %r12d, %r12d
movzbl -0x30(%rbp,%r12), %edx
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1050
incq %r12
addq $0x2, %r15
cmpq $0x10, %r12
jne 0x44c6
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r14
pushq %rbx
movl %esi, %r14d
callq 0x43c0
movq %rax, %rbx
movq %rax, %rdi
callq 0x10a0
movl %r14d, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x1080
testl %eax, %eax
js 0x452e
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x1160
leaq 0x1ccd(%rip), %rdi      # 0x6202
callq 0x11d0
movl $0x1, %edi
callq 0x1170
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edi, %r14d
movl $0xa, %edi
callq 0x1180
testq %rax, %rax
je 0x461a
movq %rax, %rbx
leaq -0x21(%rbp), %rsi
movl $0x1, %edx
movl %r14d, %edi
callq 0x11b0
cmpq $0x1, %rax
jne 0x45db
xorl %r12d, %r12d
leaq -0x21(%rbp), %r15
movzbl -0x21(%rbp), %eax
testl %eax, %eax
je 0x45d6
cmpl $0xa, %eax
je 0x45d6
cmpl $0xff, %eax
je 0x45d6
movb %al, (%rbx,%r12)
cmpq $0x9, %r12
jne 0x45bd
movl $0x14, %esi
movq %rbx, %rdi
callq 0x1210
movq %rax, %rbx
testq %rax, %rax
je 0x4611
movl $0x1, %edx
movl %r14d, %edi
movq %r15, %rsi
callq 0x11b0
incq %r12
cmpq $0x1, %rax
je 0x458a
movl %r12d, %r14d
jmp 0x45de
xorl %r14d, %r14d
movq %r14, %rdi
callq 0x1180
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1140
movb $0x0, (%r15,%r14)
movq %rbx, %rdi
callq 0x1160
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1c62(%rip), %rdi      # 0x627a
jmp 0x4621
leaq 0x1c23(%rip), %rdi      # 0x6244
callq 0x11d0
movl $0x1, %edi
callq 0x1170
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl $0x7b, %edi
movl $0x380, %esi            # imm = 0x380
callq 0x1298
movl %eax, 0x2eb0(%rip)      # 0x405c
movl %eax, %edi
callq 0x12bc
movl 0x2ea7(%rip), %esi      # 0x4060
leaq 0xe44(%rip), %rdi       # 0x2004
xorl %eax, %eax
callq 0x1040
leaq 0x65(%rip), %rdx        # 0x1233
leaq -0x20(%rbp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x1050
leaq 0x80(%rip), %rdx        # 0x1265
leaq -0x18(%rbp), %r14
movq %r14, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x1050
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x1080
movq (%r14), %rdi
xorl %esi, %esi
callq 0x1080
movl 0x2e51(%rip), %esi      # 0x4060
leaq 0xe1a(%rip), %rdi       # 0x2030
xorl %eax, %eax
callq 0x1040
movl 0x2e39(%rip), %edi      # 0x405c
callq 0x12a9
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %rbx
pushq %rax
movl $0x1388, %ebx           # imm = 0x1388
movl 0x2e18(%rip), %edi      # 0x405c
callq 0x12e4
incl 0x2e11(%rip)            # 0x4060
movl 0x2e07(%rip), %edi      # 0x405c
callq 0x130c
decl %ebx
jne 0x123e
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %rbx
pushq %rax
movl $0x1388, %ebx           # imm = 0x1388
movl 0x2de6(%rip), %edi      # 0x405c
callq 0x12e4
decl 0x2ddf(%rip)            # 0x4060
movl 0x2dd5(%rip), %edi      # 0x405c
callq 0x130c
decl %ebx
jne 0x1270
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0x497c(%rip), %rdi      # 0x7086
callq 0x2060
leaq 0x4987(%rip), %rdi      # 0x709d
callq 0x2060
leaq 0x499f(%rip), %rdi      # 0x70c1
callq 0x2060
leaq 0x49b9(%rip), %rdi      # 0x70e7
popq %rax
jmp 0x2060
// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbx
subq $0x40, %rsp
movl %edi, 0x79ec(%rip)      # 0xa178
callq 0x2080
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
je 0x2838
movl 0x79d4(%rip), %edi      # 0xa178
leaq 0x79d1(%rip), %rsi      # 0xa17c
callq 0x2220
testl %eax, %eax
js 0x2838
movups 0x79bd(%rip), %xmm0     # 0xa17c
movq %rsp, %rdx
movaps %xmm0, (%rdx)
movups 0x79c0(%rip), %xmm0     # 0xa18c
movaps %xmm0, 0x10(%rdx)
movups 0x79c5(%rip), %xmm0     # 0xa19c
movaps %xmm0, 0x20(%rdx)
movups 0x79c6(%rip), %xmm0     # 0xa1a8
andl $0xfffffa14, (%rdx)     # imm = 0xFFFFFA14
movups %xmm0, 0x2c(%rdx)
andb $-0x2, 0x4(%rdx)
andl $0xffff7fb4, 0xc(%rdx)  # imm = 0xFFFF7FB4
movb $0x0, 0x7976(%rip)      # 0xa174
movl $0xfffffecf, %eax       # imm = 0xFFFFFECF
andl 0x8(%rdx), %eax
orl $0x30, %eax
movl %eax, 0x8(%rdx)
movw $0x1, 0x16(%rdx)
movl 0x7960(%rip), %edi      # 0xa178
movl $0x2, %esi
callq 0x2230
testl %eax, %eax
js 0x2838
leaq -0xd9(%rip), %rdi       # 0x2754
callq 0x6590
xorl %ebx, %ebx
negl %eax
sbbl %ebx, %ebx
movl %ebx, %eax
addq $0x40, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/moefh[P]hed/src/input.c
// Function: read_key
int read_key(int fd, char *seq, size_t max_seq_len)
{
  int nread;
  unsigned char c;
  while ((nread = read(fd, &c, 1)) != 1) {
    if (nread == -1 && errno != EAGAIN && errno != EINTR)
      return KEY_READ_ERROR;
    if (nread == -1 && errno == EINTR)
      return KEY_REDRAW;
  }

#define NEXT()        do { if (read(fd, &seq[len], 1) != 1) return read_key_seq(seq, len); len++; } while (0)
#define CUR           seq[len-1]
  
  size_t len = 0;
  if (c == '\x1b') {
    if (read(fd, &seq[len++], 1) != 1)
      return c;
    
    while (len < max_seq_len-3) {
      NEXT();
      if (CUR == '~' || CUR == '^' || IS_LETTER(CUR))
        return read_key_seq(seq, len);
      if (CUR == ';') {
        NEXT();
        continue;
      }
      //if (! IS_DIGIT(CUR)) return read_key_seq(seq, len);
    }
    return read_key_seq(seq, len);
  }
  //if (c >= 32) return -1;
  return c;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x7(%rsp), %r15
movl $0x1, %edx
movl %ebp, %edi
movq %r15, %rsi
callq 0x2140
cmpl $-0x1, %eax
je 0x28c3
cmpl $0x1, %eax
jne 0x28a8
jmp 0x28e3
callq 0x2040
movl (%rax), %eax
cmpl $0xb, %eax
je 0x28a8
cmpl $0x4, %eax
jne 0x2998
movl $0x110002, %r12d        # imm = 0x110002
jmp 0x299e
movzbl 0x7(%rsp), %r12d
cmpl $0x1b, %r12d
jne 0x299e
movl $0x1, %r15d
movl $0x1, %edx
movl %ebp, %edi
movq %rbx, %rsi
callq 0x2140
cmpq $0x1, %rax
jne 0x299e
addq $-0x3, %r14
cmpq $0x2, %r14
jb 0x2982
movl $0x1, %r12d
leaq (%rbx,%r12), %r13
movl $0x1, %edx
movl %ebp, %edi
movq %r13, %rsi
callq 0x2140
cmpq $0x1, %rax
jne 0x29b0
leaq 0x1(%r12), %r15
movzbl (%r13), %eax
movl %eax, %ecx
orl $0x20, %ecx
cmpl $0x7e, %ecx
je 0x2982
leal -0x41(%rax), %ecx
cmpb $0x19, %cl
jbe 0x2982
cmpb $0x3b, %al
jne 0x297a
leaq (%rbx,%r15), %rsi
movl $0x1, %edx
movl %ebp, %edi
callq 0x2140
cmpq $0x1, %rax
jne 0x2982
addq $0x2, %r12
movq %r12, %r15
jmp 0x297d
movq %r15, %r12
cmpq %r14, %r15
jb 0x2922
movq %rbx, %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x29b8
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %r12, %rsi
jmp 0x2988
// File: /workspace/github_c_makefile_star2_O1/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:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
xorl %ebx, %ebx
movl $0x1c, %edi
xorl %esi, %esi
callq 0x2160
movq %r14, 0x7528(%rip)      # 0xa1c0
xorl %edi, %edi
callq 0x2080
xorl %edi, %edi
testl %eax, %eax
sete %dil
movq 0x7512(%rip), %rax      # 0xa1c0
movl %edi, (%rax)
callq 0x2781
testl %eax, %eax
js 0x2cff
movq 0x7500(%rip), %rsi      # 0xa1c0
leaq 0x4(%rsi), %rdi
addq $0x8, %rsi
callq 0x2840
movq 0x74ec(%rip), %rax      # 0xa1c0
movl $0x1010101, 0xc(%rax)   # imm = 0x1010101
movw $0x0, 0x10(%rax)
movq $0x0, 0x518(%rax)
leaq 0x1b(%rip), %rsi        # 0x2d0e
movl $0x1c, %edi
callq 0x2160
jmp 0x2d04
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
movl %edi, %ebx
movq 0x74a8(%rip), %rsi      # 0xa1c0
testq %rsi, %rsi
je 0x2d37
leaq 0x4(%rsi), %rdi
addq $0x8, %rsi
callq 0x2840
movq 0x748f(%rip), %rax      # 0xa1c0
movw $0x101, 0xc(%rax)       # imm = 0x101
leaq -0x30(%rip), %rsi       # 0x2d0e
movl %ebx, %edi
popq %rbx
jmp 0x2160
// File: /workspace/github_c_makefile_star2_O1/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
movq %rdi, %r10
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x2da4
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rdi, 0x10(%rsp)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rsp)
movq 0x73f5(%rip), %rdi      # 0xa1c0
testq %rdi, %rdi
je 0x2e05
addq $0x11, %rdi
movq %rsp, %rcx
movl $0x100, %esi            # imm = 0x100
movq %r10, %rdx
callq 0x20a0
movq 0x73d5(%rip), %rax      # 0xa1c0
testq %rax, %rax
je 0x2df8
movb $0x1, %cl
movb %cl, 0xd(%rax)
movb %cl, 0x10(%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0xd8, %rsp
retq
movq %rsp, %rsi
movq %r10, %rdi
callq 0x2361
jmp 0x2de4