LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/videolan[P]bitstream/examples/./bitstream/scte/35.h
// Function: scte35_insert_get_component
static inline uint8_t *scte35_insert_get_component(const uint8_t *p_scte35,
                                                   uint8_t n)
{
    uint16_t i_section_size = psi_get_length(p_scte35) + PSI_HEADER_SIZE
                               - PSI_CRC_SIZE;
    bool b_splice_immediate = scte35_insert_has_splice_immediate(p_scte35);
    uint8_t *p_scte35_n = scte35_get_command(p_scte35) +
        SCTE35_INSERT_HEADER_SIZE + SCTE35_INSERT_HEADER2_SIZE +
        SCTE35_INSERT_COMPONENT_COUNT_SIZE;
    if (p_scte35_n - p_scte35 > i_section_size)
        return NULL;

    while (n) {
        if (p_scte35_n + SCTE35_INSERT_COMPONENT_HEADER_SIZE - p_scte35 >
                i_section_size)
            return NULL;
        p_scte35_n += SCTE35_INSERT_COMPONENT_HEADER_SIZE +
            (b_splice_immediate ?
             scte35_splice_time_size(
                 scte35_insert_component_get_splice_time(p_scte35_n)) :
             0);
        n--;
    }
    if (p_scte35_n - p_scte35 >= i_section_size) return NULL;
    return p_scte35_n;
}

// Assembly:
movzbl 0x1(%rdi), %eax
andl $0xf, %eax
shll $0x8, %eax
movzbl 0x2(%rdi), %ecx
addl %ecx, %eax
decl %eax
movzwl %ax, %ecx
cmpl $0x15, %ecx
jae 0xd664
xorl %eax, %eax
retq
movb 0x13(%rdi), %r8b
leaq 0x15(%rdi), %rdx
xorl %eax, %eax
pushq $0x1
popq %r9
subb $0x1, %sil
jb 0xd6a8
leaq 0x1(%rdx), %r10
movq %r10, %r11
subq %rdi, %r11
cmpq %rcx, %r11
jg 0xd663
movq %r9, %r11
testb $0x10, %r8b
je 0xd6a3
movb (%r10), %r10b
shrb $0x7, %r10b
movzbl %r10b, %r10d
leaq 0x2(,%r10,4), %r11
addq %r11, %rdx
jmp 0xd672
movq %rdx, %rsi
subq %rdi, %rsi
xorl %eax, %eax
cmpq %rcx, %rsi
cmovlq %rdx, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/videolan[P]bitstream/examples/./bitstream/scte/35.h
// Function: scte35_splice_time_get_pts_time
static inline uint64_t scte35_splice_time_get_pts_time(const uint8_t *p_splice_time)
{
    return ((uint64_t)(p_splice_time[0] & 0x1) << 32) |
           ((uint64_t)p_splice_time[1] << 24) |
           ((uint64_t)p_splice_time[2] << 16) |
           ((uint64_t)p_splice_time[3] << 8) |
           (uint64_t)p_splice_time[4];
}

// Assembly:
movzbl (%rdi), %eax
andl $0x1, %eax
shlq $0x20, %rax
movzbl 0x1(%rdi), %ecx
shll $0x18, %ecx
orq %rax, %rcx
movzbl 0x2(%rdi), %eax
shll $0x10, %eax
orq %rcx, %rax
movzbl 0x3(%rdi), %ecx
shll $0x8, %ecx
orq %rax, %rcx
movzbl 0x4(%rdi), %eax
orq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/videolan[P]bitstream/examples/./bitstream/dvb/si/ait.h
// Function: ait_next_app
static inline uint8_t *ait_next_app(const uint8_t *p_ait, uint8_t *p_ait_n)
{
    uint16_t i_section_size =
        psi_get_length(p_ait) + PSI_HEADER_SIZE - PSI_CRC_SIZE;
    if (!p_ait_n)
        p_ait_n = (uint8_t *)p_ait + AIT_HEADER_SIZE +
            ait_get_desclength(p_ait);
    else {
        if (p_ait_n + AIT_APP_SIZE - p_ait > i_section_size) return NULL;
        p_ait_n += AIT_APP_SIZE + aitn_get_desclength(p_ait_n);
    }
    return (p_ait_n - p_ait < i_section_size) ? p_ait_n : NULL;
}

// Assembly:
movzbl 0x1(%rdi), %eax
andl $0xf, %eax
shll $0x8, %eax
movzbl 0x2(%rdi), %ecx
addl %ecx, %eax
decl %eax
testq %rsi, %rsi
je 0xd743
movq %rsi, %rdx
subq %rdi, %rdx
addq $0x9, %rdx
movzwl %ax, %ecx
cmpq %rcx, %rdx
jle 0xd760
xorl %eax, %eax
retq
movzbl 0x8(%rdi), %ecx
andl $0xf, %ecx
shll $0x8, %ecx
movzbl 0x9(%rdi), %edx
orq %rcx, %rdx
addq %rdi, %rdx
addq $0xc, %rdx
movzwl %ax, %ecx
jmp 0xd778
movzbl 0x7(%rsi), %eax
andl $0xf, %eax
shll $0x8, %eax
movzbl 0x8(%rsi), %edx
orq %rax, %rdx
addq %rsi, %rdx
addq $0x9, %rdx
movq %rdx, %rsi
subq %rdi, %rsi
xorl %eax, %eax
cmpq %rcx, %rsi
cmovlq %rdx, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/mhmt/mhmt-emit.c
// Function: emit_file
ULONG emit_file(UBYTE * bytes, LONG length)
{
    static UBYTE buffer[EMIT_FILEBUF_SIZE];
    static ULONG position;

    if( length==EMIT_FILE_INIT ) {
        position = 0;
        return 1;

    } else if( length>0 ) {
        while( (position+length) >= EMIT_FILEBUF_SIZE ) { // if we have to flush buffer
            length -= (EMIT_FILEBUF_SIZE-position);

            while( position < EMIT_FILEBUF_SIZE ) { // fill buffer to the end, if possible
                buffer[position++] = *(bytes++);
            }

            if( EMIT_FILEBUF_SIZE!=fwrite(buffer, 1, EMIT_FILEBUF_SIZE, wrk.file_out) ) {
                printf("mhmt-emit.c:emit_file() can't write to file!\n");
                return 0;
            }

            position=0;
        }

        while( length-- ) { // if something left that does not need flushing
            buffer[position++] = *(bytes++);
        }

        return 1;

    } else if( length==EMIT_FILE_FINISH ) {
        if( position>0 ) { // do we have anything to flush?
            if( position!=fwrite(buffer, 1, position, wrk.file_out) ) {
                printf("mhmt-emit.c:emit_file() can't write to file!\n");
                return 0;
            }
        }

        return 1;

    } else {
        printf("mhmt-emit.c:emit_file() encountered invalid arguments!\n");
        return 0;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpl $-0x1, %esi
je 0x15f6
testl %esi, %esi
jle 0x1602
movq %rdi, %rbx
movl 0x8c75(%rip), %eax      # 0xa200
leaq 0x7c6e(%rip), %r14      # 0x9200
leaq 0x8d87(%rip), %r12      # 0xa320
pushq $0x1
popq %r15
leal (%rax,%rsi), %ebp
cmpl $0xfff, %ebp            # imm = 0xFFF
jbe 0x160d
movl %eax, %eax
cmpq $0xfff, %rax            # imm = 0xFFF
ja 0x15c6
movb (%rbx), %cl
incq %rbx
movb %cl, (%rax,%r14)
incq %rax
movl %eax, 0x8c3c(%rip)      # 0xa200
jmp 0x15aa
movq 0x38(%r12), %rcx
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
movq %r15, %rsi
callq 0x1120
cmpq $0x1000, %rax           # imm = 0x1000
jne 0x165f
andl $0x0, 0x8c16(%rip)      # 0xa200
addl $0xfffff000, %ebp       # imm = 0xFFFFF000
xorl %eax, %eax
movl %ebp, %esi
jmp 0x159d
andl $0x0, 0x8c03(%rip)      # 0xa200
pushq $0x1
popq %rbp
jmp 0x166d
je 0x162f
leaq 0x3b7f(%rip), %rdi      # 0x518a
jmp 0x1666
movl %esi, %ecx
xorl %edx, %edx
pushq $0x1
popq %rbp
cmpl %edx, %ecx
je 0x166d
movb (%rbx,%rdx), %sil
movl %eax, %edi
incl %eax
movl %eax, 0x8bda(%rip)      # 0xa200
movb %sil, (%rdi,%r14)
incq %rdx
jmp 0x1614
movl 0x8bcb(%rip), %ebx      # 0xa200
pushq $0x1
popq %rbp
testq %rbx, %rbx
je 0x166d
leaq 0x8cdc(%rip), %rax      # 0xa320
movq 0x38(%rax), %rcx
leaq 0x7bb1(%rip), %rdi      # 0x9200
pushq $0x1
popq %rsi
movq %rbx, %rdx
callq 0x1120
cmpq %rbx, %rax
je 0x166d
leaq 0x3b5b(%rip), %rdi      # 0x51c1
callq 0x1110
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/mhmt/mhmt-emit.c
// Function: emit_byte
ULONG emit_byte(UBYTE byte, ULONG operation)
{
    static UBYTE buffer[EMIT_BYTEBUF_SIZE];
    static ULONG in_pos, out_pos;
    ULONG success;

    switch( operation ) {
    case EMIT_BYTE_INIT:
        in_pos  = 0;
        out_pos = 0;
        return 1;

    case EMIT_BYTE_ADD:
#ifdef DBG
        printf("<%02x>",byte&0x00FF);
#endif
        buffer[in_pos] = byte;
        in_pos = (in_pos+1) & (EMIT_BYTEBUF_SIZE-1);

        if( in_pos==out_pos ) { // overflow!
            printf("mhmt-emit.c:emit_byte() buffer overflow!\n");
            return 0;
        }

        return 1;

    case EMIT_BYTE_FLUSH:
        if( in_pos==out_pos ) // nothing to do?
            return 1;

        else if( in_pos>out_pos ) { // no index wraparound
            success = emit_file( &buffer[out_pos], in_pos-out_pos );

        } else { // in_pos<out_pos - wraparound
            success = emit_file( &buffer[out_pos], EMIT_BYTEBUF_SIZE-out_pos );

            if( in_pos )
                success = success && emit_file( &buffer[0], in_pos );
        }

        out_pos=in_pos;
        return success;

    default:
        printf("mhmt-emit.c:emit_byte() encountered invalid arguments!\n");
        return 0;
    }
}

// Assembly:
pushq %rax
cmpl $0x2, %esi
je 0x16b9
cmpl $0x1, %esi
je 0x1697
testl %esi, %esi
jne 0x16eb
andl $0x0, 0x8c82(%rip)      # 0xa310
andl $0x0, 0x8c7f(%rip)      # 0xa314
jmp 0x16e6
movl 0x8c73(%rip), %esi      # 0xa310
movl 0x8c71(%rip), %eax      # 0xa314
cmpl %eax, %esi
je 0x16e6
leaq 0x8b62(%rip), %rdi      # 0xa210
addq %rax, %rdi
cmpl %eax, %esi
jbe 0x16fb
subl %eax, %esi
jmp 0x171c
movl 0x8c51(%rip), %eax      # 0xa310
leaq 0x8b4a(%rip), %rcx      # 0xa210
movb %dil, (%rax,%rcx)
incl %eax
movzbl %al, %eax
movl %eax, 0x8c3b(%rip)      # 0xa310
cmpl 0x8c39(%rip), %eax      # 0xa314
jne 0x16e6
leaq 0x3b0a(%rip), %rdi      # 0x51ee
jmp 0x16f2
pushq $0x1
popq %rax
jmp 0x172d
leaq 0x3b25(%rip), %rdi      # 0x5217
callq 0x1110
xorl %eax, %eax
jmp 0x172d
movl $0x100, %esi            # imm = 0x100
subl %eax, %esi
callq 0x156d
movl 0x8c03(%rip), %esi      # 0xa310
testl %esi, %esi
je 0x1721
testl %eax, %eax
je 0x172f
leaq 0x8af4(%rip), %rdi      # 0xa210
callq 0x156d
movl 0x8be9(%rip), %ecx      # 0xa310
movl %ecx, 0x8be7(%rip)      # 0xa314
popq %rcx
retq
xorl %eax, %eax
jmp 0x1721
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/mhmt/mhmt-emit.c
// Function: emit_bits_flush
ULONG emit_bits_flush(ULONG bits)
{
    UBYTE store_byte;
    ULONG success = 1;

    if( wrk.wordbit ) { // 16bits
        if( wrk.bigend ) { // big endian
            store_byte = 0x00FF & (bits >> 8);
            success = success && emit_file( &store_byte, 1);
            store_byte = 0x00FF & bits;
            success = success && emit_file( &store_byte, 1);

        } else { // little endian
            store_byte = 0x00FF & bits;
            success = success && emit_file( &store_byte, 1);
            store_byte = 0x00FF & (bits >> 8);
            success = success && emit_file( &store_byte, 1);
        }

    } else { // 8bits
        store_byte = 0x00FF & bits;
        success = success && emit_file( &store_byte, 1);
    }

    return success;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x8096(%rip), %rax      # 0xa320
cmpl $0x0, 0x10(%rax)
je 0x22af
cmpl $0x0, 0x14(%rax)
je 0x22b5
movb %bh, 0x7(%rsp)
leaq 0x7(%rsp), %r14
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x156d
movb %bl, (%r14)
jmp 0x22c8
movb %bl, 0x7(%rsp)
jmp 0x22cc
leaq 0x7(%rsp), %rdi
movb %bl, (%rdi)
pushq $0x1
popq %rsi
callq 0x156d
movb %bh, 0x7(%rsp)
testl %eax, %eax
je 0x22db
leaq 0x7(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x156d
jmp 0x22dd
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/mhmt/mhmt-globals.c
// Function: free_globals
void free_globals(void)
{
    if( wrk.indata ) free( wrk.indata );

    if( wrk.file_out ) fclose( wrk.file_out );

    if( wrk.file_in )  fclose( wrk.file_in );

    if( wrk.fname_out ) free( wrk.fname_out );

    if( wrk.fname_in )  free( wrk.fname_in );
}

// Assembly:
pushq %rax
movq 0x8034(%rip), %rdi      # 0xa360
callq 0x10b0
movq 0x8020(%rip), %rdi      # 0xa358
testq %rdi, %rdi
je 0x2342
callq 0x1070
movq 0x8007(%rip), %rdi      # 0xa350
testq %rdi, %rdi
je 0x2353
callq 0x1070
movq 0x7fee(%rip), %rdi      # 0xa348
callq 0x10b0
movq 0x7fda(%rip), %rdi      # 0xa340
popq %rax
jmp 0x10b0
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/mhmt/mhmt-hash.c
// Function: build_hash
UBYTE * build_hash(UBYTE * data, ULONG length)
{
    UBYTE * hash;
    ULONG i;
    UBYTE *src,*dst;
    UBYTE curr,prev,prev2;

    if( !length )
        return NULL;

    hash=(UBYTE *)malloc( length );

    if( !hash )
        return NULL;

    prev=curr=0;
    i=length;
    src = data;
    dst = hash;

    do {
        prev2 = (UBYTE)( (prev>>1) | (prev<<7) );
        prev  = (UBYTE)( (curr>>1) | (curr<<7) );
        curr  = *(src++);
        *(dst++) = curr^prev^prev2;
    } while( --i );

    return hash;
}

// Assembly:
testl %esi, %esi
je 0x23ae
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, %r14d
movq %r14, %rdi
callq 0x10d0
testq %rax, %rax
je 0x23b1
xorl %ecx, %ecx
xorl %edx, %edx
xorl %esi, %esi
movl %edx, %edi
rorb %dil
movb (%rbx,%rcx), %dl
rorb %sil
xorb %dil, %sil
xorb %dl, %sil
movb %sil, (%rax,%rcx)
incq %rcx
movl %edi, %esi
cmpl %ecx, %r14d
jne 0x238d
jmp 0x23b3
xorl %eax, %eax
retq
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/mhmt/mhmt-lz.c
// Function: get_lz_price_megalz
ULONG get_lz_price_megalz(ULONG position, struct lzcode * lzcode)
{
    ULONG varbits,varlen;
    LONG length,disp;
    length = lzcode->length;
    disp   = lzcode->disp;

    if( length==1 ) {
        if( disp==0 )
            return 9;

        else if( (-8)<=disp && disp<=(-1) )
            return 6;

        else
            goto INVALID_CODE_MEGALZ;

    } else if( length==2 ) {
        if( (-256)<=disp && disp<=(-1) )
            return 11;

        else
            goto INVALID_CODE_MEGALZ;

    } else if( length==3 ) {
        if( (-256)<=disp && disp<=(-1) )
            return 12;

        else if( (-4352)<=disp && disp<(-256) )
            return 16;

        else
            goto INVALID_CODE_MEGALZ;

    } else if( 4<=length && length<=255 ) {
        varlen = 0;
        varbits = (length-2)>>1;

        while( varbits ) {
            varbits >>= 1;
            varlen+=2;
        }

        if( (-256)<=disp && disp<=(-1) )
            varlen += 9;

        else if( (-4352)<=disp && disp<(-256) )
            varlen += 13;

        else
            goto INVALID_CODE_MEGALZ;

        return varlen+3;

    } else {
INVALID_CODE_MEGALZ:
        printf("mhmt-lz.c:get_lz_price_megalz(): Found invalid code length=%d, displacement=%d\n",length, disp);
        return 0;
    }
}

// Assembly:
pushq %rbx
movq %rsi, %rax
movl (%rsi), %esi
movl 0x4(%rax), %edx
cmpl $0x3, %esi
je 0x2722
cmpl $0x2, %esi
je 0x2716
cmpl $0x1, %esi
jne 0x272e
testl %edx, %edx
je 0x2767
cmpl $-0x9, %edx
jbe 0x2781
pushq $0x6
jmp 0x2769
cmpl $0xfffffeff, %edx       # imm = 0xFFFFFEFF
jbe 0x2781
pushq $0xb
jmp 0x2769
cmpl $0xfffffeff, %edx       # imm = 0xFFFFFEFF
jbe 0x274a
pushq $0xc
jmp 0x2769
leal -0x4(%rsi), %eax
cmpl $0xfb, %eax
ja 0x2781
leal -0x2(%rsi), %ecx
pushq $0x3
popq %rax
cmpl $0x2, %ecx
jb 0x275b
shrl %ecx
addl $0x2, %eax
jmp 0x273e
leal 0x1100(%rdx), %eax
cmpl $0x1000, %eax           # imm = 0x1000
jae 0x2781
pushq $0x10
jmp 0x2769
cmpl $0xfffffeff, %edx       # imm = 0xFFFFFEFF
jbe 0x276c
pushq $0x9
jmp 0x277c
pushq $0x9
popq %rbx
jmp 0x2791
leal 0x1100(%rdx), %ecx
cmpl $0xfff, %ecx            # imm = 0xFFF
ja 0x2781
pushq $0xd
popq %rbx
addl %eax, %ebx
jmp 0x2791
leaq 0x2c03(%rip), %rdi      # 0x538b
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1040
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/mhmt/mhmt-lz.c
// Function: get_lz_price_hrum
ULONG get_lz_price_hrum(ULONG position, struct lzcode * lzcode)
{
    ULONG varlen;
    LONG length,disp;
    length = lzcode->length;
    disp   = lzcode->disp;

    if( length==1 ) {
        if( disp==0 )
            return 9;

        else if( (-8)<=disp && disp<=(-1) )
            return 6;

        else
            goto INVALID_CODE_HRUM;

    } else if( length==2 ) {
        if( (-256)<=disp && disp<=(-1) )
            return 11;

        else
            goto INVALID_CODE_HRUM;

    } else if (3<=length && length<=255) {
        varlen = 3;

        if( 4<=length && length<=15 ) {
            varlen = 5;

            if( length>=6 ) varlen += 2;

            if( length>=9 ) varlen += 2;

            if( length>=12) varlen += 2;

        } else if( 15<length && length<=255 ) {
            varlen = 13;
        }

        if( (-256)<=disp && disp<=(-1) )
            varlen += 9;

        else if( (-4096)<=disp && disp<(-256) )
            varlen += 13;

        else
            goto INVALID_CODE_HRUM;

        return varlen;

    } else {
INVALID_CODE_HRUM:
        printf("mhmt-lz.c:get_lz_price_hrum(): Found invalid code length=%d, displacement=%d\n",length, disp);
        return 0;
    }
}

// Assembly:
pushq %rbx
movq %rsi, %rax
movl (%rsi), %esi
movl 0x4(%rax), %edx
cmpl $0x2, %esi
je 0x27b5
cmpl $0x1, %esi
jne 0x27c1
testl %edx, %edx
je 0x27f7
cmpl $-0x9, %edx
jbe 0x2827
pushq $0x6
jmp 0x27f9
cmpl $0xfffffeff, %edx       # imm = 0xFFFFFEFF
jbe 0x2827
pushq $0xb
jmp 0x27f9
leal -0x3(%rsi), %eax
cmpl $0xfc, %eax
ja 0x2827
leal -0x4(%rsi), %eax
cmpl $0xb, %eax
ja 0x27fc
xorl %eax, %eax
cmpl $0x6, %esi
setae %al
leal 0x5(,%rax,2), %ecx
cmpl $0x9, %esi
leal 0x7(%rax,%rax), %eax
cmovbl %ecx, %eax
leal 0x2(%rax), %ebx
cmpl $0xc, %esi
cmovbl %eax, %ebx
jmp 0x2808
pushq $0x9
popq %rbx
jmp 0x2837
cmpl $0x10, %esi
pushq $0xd
popq %rax
pushq $0x3
popq %rbx
cmovael %eax, %ebx
cmpl $0xffffff00, %edx       # imm = 0xFFFFFF00
jb 0x2815
addl $0x9, %ebx
jmp 0x2837
leal 0x1000(%rdx), %eax
cmpl $0xeff, %eax            # imm = 0xEFF
ja 0x2827
addl $0xd, %ebx
jmp 0x2837
leaq 0x2bad(%rip), %rdi      # 0x53db
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1040
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/mhmt/mhmt-main.c
// Function: main
int main( int argc, char* argv[] )
{
    int error=0;
    ULONG parse_result;
    init_globals();
    // printf short info
    printf("mhmt - MeHruMsT - MEgalz, HRUM and hruST (c) 2009 lvd^nedopc\n\n");
    // parse arguments
    parse_result = parse_args(argc, argv);

    if( parse_result&ARG_PARSER_SHOWHELP ) {
        if( parse_result&ARG_PARSER_ERROR )
            printf("\n");

        show_help();
    }

    if( parse_result&ARG_PARSER_ERROR ) {
        printf("There were errors in arguments.\n");
        error++;

    } else if( parse_result&ARG_PARSER_GO ) {
        if( do_files() ) {
            dump_config();

            if( wrk.mode ) {
                error += depack() ? 0 : 1;

            } else {
                error += pack() ? 0 : 1;
            }

        } else {
            error++;
        }
    }

    free_globals();
    return error;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
callq 0x22e8
leaq 0x2e1d(%rip), %rdi      # 0x5785
callq 0x1110
movl %ebp, %edi
movq %rbx, %rsi
callq 0x31a0
movl %eax, %ebx
testb $0x1, %bl
je 0x2991
btl $0x8, %ebx
jae 0x298c
pushq $0xa
popq %rdi
callq 0x10e0
callq 0x29ed
btl $0x8, %ebx
jb 0x29a0
testb $0x2, %bl
jne 0x29b0
xorl %eax, %eax
jmp 0x29dc
leaq 0x2e1c(%rip), %rdi      # 0x57c3
callq 0x1110
movb $0x1, %al
jmp 0x29dc
callq 0x2b13
testl %eax, %eax
je 0x29ac
callq 0x2d4a
leaq 0x795b(%rip), %rax      # 0xa320
cmpl $0x0, 0x8(%rax)
je 0x29d2
callq 0x3924
jmp 0x29d7
callq 0x3010
testl %eax, %eax
sete %al
movzbl %al, %ebx
callq 0x2324
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
leaq 0x2dee(%rip), %rdi      # 0x57e3
callq 0x1110
leaq 0x2dfe(%rip), %rdi      # 0x57ff
callq 0x1110
leaq 0x2dfe(%rip), %rdi      # 0x580b
callq 0x1110
leaq 0x2e40(%rip), %rdi      # 0x5859
callq 0x1110
leaq 0x2e63(%rip), %rdi      # 0x5888
callq 0x1110
pushq $0xa
popq %rbx
movl %ebx, %edi
callq 0x10e0
leaq 0x2e84(%rip), %rdi      # 0x58bf
callq 0x1110
leaq 0x2ebf(%rip), %rdi      # 0x5906
callq 0x1110
leaq 0x2efd(%rip), %rdi      # 0x5950
callq 0x1110
movl %ebx, %edi
callq 0x10e0
leaq 0x2f04(%rip), %rdi      # 0x596a
callq 0x1110
leaq 0x2f31(%rip), %rdi      # 0x59a3
callq 0x1110
movl %ebx, %edi
callq 0x10e0
leaq 0x2f5d(%rip), %rdi      # 0x59e2
callq 0x1110
movl %ebx, %edi
callq 0x10e0
leaq 0x2f9b(%rip), %rdi      # 0x5a33
callq 0x1110
leaq 0x2fda(%rip), %rdi      # 0x5a7e
callq 0x1110
leaq 0x301d(%rip), %rdi      # 0x5acd
callq 0x1110
leaq 0x305a(%rip), %rdi      # 0x5b16
callq 0x1110
movl %ebx, %edi
callq 0x10e0
leaq 0x308f(%rip), %rdi      # 0x5b5e
callq 0x1110
leaq 0x308a(%rip), %rdi      # 0x5b65
callq 0x1110
movl %ebx, %edi
callq 0x10e0
leaq 0x30b2(%rip), %rdi      # 0x5ba0
callq 0x1110
leaq 0x30f6(%rip), %rdi      # 0x5bf0
callq 0x1110
leaq 0x312d(%rip), %rdi      # 0x5c33
callq 0x1110
movl %ebx, %edi
popq %rbx
jmp 0x10e0
// File: /workspace/github_c_makefile_star2_O2/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 0x10d0
testq %rax, %rax
je 0x2f33
movq $0x1, (%rax)
andl $0x0, 0x8(%rax)
movl $0x8, 0x18(%rax)
movq %rax, %rcx
addq $0x28, %rcx
pushq $0x2
popq %rdx
cmpq %rbx, %rdx
jae 0x2f33
orl $-0x1, (%rcx)
incq %rdx
addq $0x10, %rcx
jmp 0x2f22
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rcx, %rbx
movq %rdx, 0x10(%rsp)
movq %rsi, %r15
movl %edi, %ebp
movl %edi, %eax
shlq $0x4, %rax
addq %rcx, %rax
addq $0x8, %rax
movq %rax, 0x8(%rsp)
xorl %r14d, %r14d
movl %r14d, %eax
movl (%r15,%rax,8), %r13d
testl %r13d, %r13d
je 0x2fb5
leaq (%r15,%rax,8), %r12
movl %ebp, %edi
movq %r12, %rsi
callq *0x10(%rsp)
testl %eax, %eax
je 0x2fc4
movl %r13d, %ecx
negl %ecx
cmovsl %r13d, %ecx
addl %ebp, %ecx
shlq $0x4, %rcx
movq 0x8(%rsp), %rdx
addl (%rdx), %eax
cmpl %eax, 0x8(%rbx,%rcx)
jbe 0x2fb0
addq %rbx, %rcx
movl %eax, 0x8(%rcx)
movq (%r12), %rax
movq %rax, (%rcx)
incl %r14d
jmp 0x2f6a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2dd9(%rip), %rdi      # 0x5da4
callq 0x1110
pushq $0x1
popq %rdi
callq 0x10c0
// File: /workspace/github_c_makefile_star2_O2/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:
movl %esi, %eax
shlq $0x4, %rax
movq (%rdi,%rax), %xmm0
cmpl $0x2, %esi
jb 0x300c
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
jmp 0x2fe3
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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 0x369c
testb %r10b, %r10b
je 0x369c
incq %r8
testl %eax, %eax
je 0x3638
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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
leaq 0x5a04(%rip), %rbx      # 0x90b0
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x36c6
movq %r14, %rsi
callq 0x362d
testl %eax, %eax
je 0x36c8
addq $0x10, %rbx
jmp 0x36ac
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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:
addl $-0x2, %esi
movslq %esi, %rax
testq %rax, %rax
js 0x3719
movq %rdi, %rdx
xorl %ecx, %ecx
cmpq %rax, %rcx
jg 0x3714
movl 0x8(%rdx), %r8d
leaq 0x10(%rdx), %rsi
cmpl 0x18(%rdx), %r8d
jbe 0x370c
movups (%rdx), %xmm0
movaps %xmm0, -0x18(%rsp)
movups (%rsi), %xmm0
movups %xmm0, (%rdx)
movaps -0x18(%rsp), %xmm0
movups %xmm0, (%rsi)
incq %rcx
movq %rsi, %rdx
jmp 0x36e3
decq %rax
jmp 0x36d9
retq
// File: /workspace/github_c_makefile_star2_O2/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:
andq $0x0, 0xe4a0(%rip)      # 0x11c10
andq $0x0, 0xe4a0(%rip)      # 0x11c18
xorl %eax, %eax
leaq 0xe49f(%rip), %rcx      # 0x11c20
cmpq $0x80000, %rax          # imm = 0x80000
je 0x3794
andq $0x0, (%rax,%rcx)
addq $0x8, %rax
jmp 0x3781
retq
// File: /workspace/github_c_makefile_star2_O2/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
movq 0xe47b(%rip), %rdi      # 0x11c18
testq %rdi, %rdi
je 0x37b3
movq (%rdi), %rax
movq %rax, 0xe46c(%rip)      # 0x11c18
callq 0x10b0
jmp 0x3796
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xe44e(%rip), %rax      # 0x11c10
movzwl %di, %r14d
testq %rax, %rax
jne 0x37fd
leaq 0x6b4e(%rip), %rax      # 0xa320
cmpl %ebx, 0x1c(%rax)
jae 0x37ed
movl %r14d, %edi
movl %ebx, %esi
callq 0x3846
movq 0xe428(%rip), %rax      # 0x11c10
testq %rax, %rax
jne 0x37fd
callq 0x38c5
testl %eax, %eax
je 0x382a
movq 0xe413(%rip), %rax      # 0x11c10
movq 0x8(%rax), %rcx
movq %rcx, 0xe408(%rip)      # 0x11c10
decl %ebx
movl %ebx, (%rax)
leaq 0xe40d(%rip), %rcx      # 0x11c20
movq (%rcx,%r14,8), %rdx
movq %rdx, 0x8(%rax)
movq %rax, (%rcx,%r14,8)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %eax, %eax
jmp 0x3822
// File: /workspace/github_c_makefile_star2_O2/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 0x10d0
testq %rax, %rax
je 0x3920
leaq 0x8(%rax), %rcx
movq %rax, %rdx
addq $0x18, %rdx
movl $0xfff, %esi            # imm = 0xFFF
subq $0x1, %rsi
jb 0x38f5
movq %rdx, -0x8(%rdx)
addq $0x10, %rdx
jmp 0x38e5
movq 0xe314(%rip), %rdx      # 0x11c10
movq %rdx, 0x10000(%rax)
movq %rcx, 0xe306(%rip)      # 0x11c10
movq 0xe307(%rip), %rcx      # 0x11c18
movq %rcx, (%rax)
movq %rax, 0xe2fd(%rip)      # 0x11c18
pushq $0x1
popq %rax
jmp 0x3922
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x69f1(%rip), %rax      # 0xa320
movl (%rax), %ecx
decl %ecx
cmpl $0x3, %ecx
jae 0x39ae
movl %ecx, %ecx
leaq 0x5467(%rip), %rdx      # 0x8da8
movq (%rdx,%rcx,8), %r14
movl 0x1c(%rax), %eax
cmpl $0x1100, %eax           # imm = 0x1100
movl $0x2000, %edi           # imm = 0x2000
cmovnel %eax, %edi
movl %edi, 0x8e2c5(%rip)     # 0x91c20
callq 0x10d0
movq %rax, 0x8e2c1(%rip)     # 0x91c28
testq %rax, %rax
je 0x39b7
andl $0x0, 0x8e2b1(%rip)     # 0x91c24
xorl %ebx, %ebx
pushq $-0x1
popq %rsi
xorl %edi, %edi
callq 0x156d
testl %eax, %eax
je 0x398d
callq *%r14
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
pushq $0x1
popq %rsi
xorl %edi, %edi
callq 0x477e
xorl %edi, %edi
xorl %esi, %esi
callq 0x156d
movq 0x8e281(%rip), %rdi     # 0x91c28
callq 0x10b0
jmp 0x39c5
leaq 0x2aea(%rip), %rdi      # 0x649f
jmp 0x39be
leaq 0x2b0e(%rip), %rdi      # 0x64cc
callq 0x1110
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x47b9
cmpl $0x2, %esi
jne 0x47cf
movq 0x8d499(%rip), %rax     # 0x91c28
movl 0x8d48f(%rip), %ecx     # 0x91c24
leal 0x1(%rcx), %edx
movl %edx, 0x8d486(%rip)     # 0x91c24
movb %dil, (%rax,%rcx)
movl 0x8d478(%rip), %esi     # 0x91c20
cmpl %esi, 0x8d476(%rip)     # 0x91c24
jb 0x47e3
andl $0x0, 0x8d46d(%rip)     # 0x91c24
jmp 0x47c3
movl 0x8d465(%rip), %esi     # 0x91c24
testl %esi, %esi
je 0x47e3
movq 0x8d45e(%rip), %rdi     # 0x91c28
jmp 0x156d
pushq %rax
leaq 0x1f68(%rip), %rdi      # 0x673f
callq 0x1110
xorl %eax, %eax
addq $0x8, %rsp
retq
pushq $0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
testl %esi, %esi
je 0x496f
testl %edi, %edi
js 0x4978
leaq 0x1f2e(%rip), %rdi      # 0x689b
jmp 0x498d
leaq 0x1eb1(%rip), %rdi      # 0x6827
jmp 0x498d
movl %edi, %eax
negl %eax
movl 0x8d29e(%rip), %ecx     # 0x91c20
cmpl %eax, %ecx
jae 0x4999
leaq 0x1ec7(%rip), %rdi      # 0x6854
callq 0x1110
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl %esi, %ebx
addl 0x8d283(%rip), %edi     # 0x91c24
leal -0x1(%rcx), %r14d
andl %edi, %r14d
pushq $0x1
popq %rax
pushq $0x2
popq %rbp
testl %eax, %eax
je 0x49d8
movq 0x8d26f(%rip), %rax     # 0x91c28
movl %r14d, %ecx
movzbl (%rax,%rcx), %edi
movl %ebp, %esi
callq 0x477e
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
setne %al
movl 0x8d24a(%rip), %ecx     # 0x91c20
jmp 0x49da
xorl %eax, %eax
incl %r14d
leal -0x1(%rcx), %edx
andl %edx, %r14d
decl %ebx
jne 0x49ae
jmp 0x4994
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %rbx
pushq %rax
leaq 0x592d(%rip), %rax      # 0xa320
cmpl $0x0, 0x10(%rax)
je 0x4a27
movl 0x14(%rax), %ebp
pushq $0x1
popq %rdi
callq 0x47e7
movl %eax, %ebx
testl %ebp, %ebp
je 0x4a3c
pushq $-0x1
popq %rbp
cmpl $-0x1, %ebx
je 0x4a5c
pushq $0x1
popq %rdi
callq 0x47e7
cmpl $-0x1, %eax
je 0x4a5c
movl %eax, %ecx
movl %ebx, %eax
movl %ecx, %ebx
jmp 0x4a51
pushq $0x1
popq %rdi
callq 0x47e7
movl %eax, %ebp
shll $0x18, %ebp
cmpl $-0x1, %eax
cmovel %eax, %ebp
jmp 0x4a5c
pushq $-0x1
popq %rbp
cmpl $-0x1, %ebx
je 0x4a5c
pushq $0x1
popq %rdi
callq 0x47e7
cmpl $-0x1, %eax
je 0x4a5c
shll $0x18, %eax
movzbl %bl, %ebp
shll $0x10, %ebp
orl %eax, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3ad5(%rip), %rdi      # 0x5381
movl $0x241, %esi            # imm = 0x241
movl $0x1ff, %edx            # imm = 0x1FF
xorl %eax, %eax
callq 0x10f0
testl %eax, %eax
js 0x1946
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 0x194f
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3e89(%rip), %rdi      # 0x57d6
jmp 0x1956
leaq 0x3e3a(%rip), %rdi      # 0x5790
callq 0x11d0
pushq $0x1
popq %rdi
callq 0x1170
// File: /workspace/github_c_makefile_star2_O2/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
subq $0x18, %rsp
movq %rdi, %rbx
callq 0x10a0
movq %rax, %r12
leaq 0x3(%rax), %rdx
movq %rsp, %r15
movq %r15, -0x30(%rbp)
leaq 0x12(%rax), %r14
andq $-0x10, %r14
subq %r14, %r15
movq %r15, %rsp
negq %r14
xorl %r13d, %r13d
movq %r15, %rdi
xorl %esi, %esi
movq %rdx, -0x38(%rbp)
callq 0x10c0
movq -0x30(%rbp), %rax
movw $0x2064, (%rax,%r14)    # imm = 0x2064
pushq $0x2
popq %rax
cmpq %r13, %r12
je 0x3b46
movb (%rbx,%r13), %cl
testb %cl, %cl
je 0x3b41
cltq
movb %cl, (%r15,%rax)
incl %eax
incq %r13
jmp 0x3b2c
leaq 0x183f(%rip), %rdi      # 0x538c
movq %r15, %rsi
movq -0x38(%rbp), %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1040
movq %r15, %rdi
callq 0x401a
movzbl (%rax), %ecx
cmpl $0x65, %ecx
je 0x3b8c
cmpl $0x78, %ecx
jne 0x3b92
cmpb $0x0, 0x1(%rax)
jne 0x3b92
leaq 0x1856(%rip), %rdi      # 0x53d6
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1040
jmp 0x3bbe
cmpb $0x0, 0x1(%rax)
je 0x3bb2
leaq 0x1838(%rip), %rdi      # 0x53d1
movq %rax, %rsi
xorl %eax, %eax
callq 0x1040
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2499(%rip), %rdi      # 0x6052
callq 0x11d0
pushq $0x1
popq %rdi
callq 0x1170
// File: /workspace/github_c_makefile_star2_O2/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
subq $0x18, %rsp
movq %rdi, %rbx
callq 0x10a0
movq %rax, %r12
leaq 0x3(%rax), %rdx
movq %rsp, %r15
movq %r15, -0x30(%rbp)
leaq 0x12(%rax), %r14
andq $-0x10, %r14
subq %r14, %r15
movq %r15, %rsp
negq %r14
xorl %r13d, %r13d
movq %r15, %rdi
xorl %esi, %esi
movq %rdx, -0x38(%rbp)
callq 0x10c0
movq -0x30(%rbp), %rax
movw $0x2076, (%rax,%r14)    # imm = 0x2076
pushq $0x2
popq %rax
cmpq %r13, %r12
je 0x3f96
movb (%rbx,%r13), %cl
testb %cl, %cl
je 0x3f91
cltq
movb %cl, (%r15,%rax)
incl %eax
incq %r13
jmp 0x3f7c
leaq 0x13ef(%rip), %rdi      # 0x538c
movq %r15, %rsi
movq -0x38(%rbp), %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1040
movq %r15, %rdi
callq 0x401a
movq %rax, %rbx
movzbl (%rax), %eax
cmpl $0x65, %eax
je 0x3fd5
cmpl $0x78, %eax
jne 0x3fdb
cmpb $0x0, 0x1(%rbx)
jne 0x3fdb
leaq 0x20cf(%rip), %rdi      # 0x60a2
jmp 0x400d
cmpb $0x0, 0x1(%rbx)
je 0x4006
leaq 0x202c(%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 0x2045(%rip), %rdi      # 0x6052
callq 0x11d0
pushq $0x1
popq %rdi
callq 0x1170