LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/./bitstream/scte/35.h
// Function: scte35_get_desclength
static inline uint16_t scte35_get_desclength(const uint8_t *p_scte35)
{
    uint16_t i_command_length = scte35_get_command_length(p_scte35);
    if (i_command_length == 0xfff)
        return 0;
    const uint8_t *pi_desclength = scte35_get_command(p_scte35) +
                                   i_command_length;
    return (pi_desclength[0] << 8) | pi_desclength[1];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x20710
movw %ax, -0x12(%rbp)
movzwl -0x12(%rbp), %eax
cmpl $0xfff, %eax            # imm = 0xFFF
jne 0x2076c
movw $0x0, -0x2(%rbp)
jmp 0x2079b
movq -0x10(%rbp), %rdi
callq 0x20ae0
movzwl -0x12(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
shll $0x8, %eax
movq -0x20(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
orl %ecx, %eax
movw %ax, -0x2(%rbp)
movw -0x2(%rbp), %ax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/./bitstream/scte/35_print.h
// Function: scte35_null_print
static inline void scte35_null_print(const uint8_t *p_scte35,
        f_print pf_print, void *print_opaque, print_type_t i_print_type)
{
    uint64_t i_pts_adjustment = scte35_get_pts_adjustment(p_scte35);

    switch (i_print_type) {
    case PRINT_XML:
        pf_print(print_opaque,
                 "<SCTE35 command=\"%" PRIu8 "\" command_str=\"null\" pts_adjustment=\"%" PRIu64 "\">",
                 SCTE35_NULL_COMMAND, i_pts_adjustment);
        break;
    default:
        pf_print(print_opaque,
                 "new SCTE35 command=%" PRIu8 " command_str=null pts_adjustment=%" PRIu64,
                 SCTE35_NULL_COMMAND, i_pts_adjustment);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x21450
movq %rax, -0x28(%rbp)
movl -0x1c(%rbp), %eax
subl $0x1, %eax
jne 0x20e5a
jmp 0x20e3e
movq -0x10(%rbp), %r8
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rcx
leaq 0xae41(%rip), %rsi      # 0x2bc92
xorl %edx, %edx
movb $0x0, %al
callq *%r8
jmp 0x20e74
movq -0x10(%rbp), %r8
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rcx
leaq 0xae63(%rip), %rsi      # 0x2bcd0
xorl %edx, %edx
movb $0x0, %al
callq *%r8
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/./bitstream/scte/35_print.h
// Function: scte35_private_print
static inline void scte35_private_print(const uint8_t *p_scte35,
        f_print pf_print, void *print_opaque, print_type_t i_print_type)
{
    uint64_t i_pts_adjustment = scte35_get_pts_adjustment(p_scte35);
    uint32_t i_identifier = scte35_private_get_identifier(p_scte35);

    switch (i_print_type) {
    case PRINT_XML:
        pf_print(print_opaque,
                 "<SCTE35 command=\"%" PRIu8 "\" command_str=\"private\" pts_adjustment=\"%" PRIu64 "\" identifier=\"%" PRIu32 "\" />",
                 SCTE35_PRIVATE_COMMAND, i_pts_adjustment, i_identifier);
        break;
    default:
        pf_print(print_opaque,
                 "new SCTE35 command=%" PRIu8 " command_str=private pts_adjustment=%" PRIu64 " identifier=%" PRIu32,
                 SCTE35_PRIVATE_COMMAND, i_pts_adjustment, i_identifier);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x21450
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x21820
movl %eax, -0x2c(%rbp)
movl -0x1c(%rbp), %eax
subl $0x1, %eax
jne 0x2141d
jmp 0x213fa
movq -0x10(%rbp), %r9
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rcx
movl -0x2c(%rbp), %r8d
leaq 0xacd0(%rip), %rsi      # 0x2c0e1
movl $0xff, %edx
movb $0x0, %al
callq *%r9
jmp 0x2143e
movq -0x10(%rbp), %r9
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rcx
movl -0x2c(%rbp), %r8d
leaq 0xad00(%rip), %rsi      # 0x2c134
movl $0xff, %edx
movb $0x0, %al
callq *%r9
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/./bitstream/scte/35_print.h
// Function: scte35_get_command_type_txt
static inline const char *scte35_get_command_type_txt(uint8_t i_type) {
    switch (i_type) {
        case SCTE35_NULL_COMMAND: return "null";
        case SCTE35_SCHEDULE_COMMAND: return "schedule";
        case SCTE35_INSERT_COMMAND: return "insert";
        case SCTE35_TIME_SIGNAL_COMMAND: return "time_signal";
        case SCTE35_BANDWIDTH_RESERVATION_COMMAND: return "bandwidth_reservation";
        case SCTE35_PRIVATE_COMMAND: return "private";
        default: return "reserved";
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %dil, %al
movb %al, -0x9(%rbp)
movzbl -0x9(%rbp), %eax
movl %eax, -0x10(%rbp)
testl %eax, %eax
je 0x214fb
jmp 0x214c7
movl -0x10(%rbp), %eax
subl $0x4, %eax
je 0x21508
jmp 0x214d1
movl -0x10(%rbp), %eax
subl $0x5, %eax
je 0x21515
jmp 0x214db
movl -0x10(%rbp), %eax
subl $0x6, %eax
je 0x21522
jmp 0x214e5
movl -0x10(%rbp), %eax
subl $0x7, %eax
je 0x2152f
jmp 0x214ef
movl -0x10(%rbp), %eax
subl $0xff, %eax
je 0x2153c
jmp 0x21549
leaq 0xac7d(%rip), %rax      # 0x2c17f
movq %rax, -0x8(%rbp)
jmp 0x21554
leaq 0xa477(%rip), %rax      # 0x2b986
movq %rax, -0x8(%rbp)
jmp 0x21554
leaq 0xac68(%rip), %rax      # 0x2c184
movq %rax, -0x8(%rbp)
jmp 0x21554
leaq 0xac62(%rip), %rax      # 0x2c18b
movq %rax, -0x8(%rbp)
jmp 0x21554
leaq 0xac61(%rip), %rax      # 0x2c197
movq %rax, -0x8(%rbp)
jmp 0x21554
leaq 0xac6a(%rip), %rax      # 0x2c1ad
movq %rax, -0x8(%rbp)
jmp 0x21554
leaq 0x2f83(%rip), %rax      # 0x244d3
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/./bitstream/scte/35.h
// Function: scte35_break_duration_get_duration
static inline uint64_t scte35_break_duration_get_duration(const uint8_t *p_break_duration)
{
    return ((uint64_t)(p_break_duration[0] & 0x1) << 32) |
           ((uint64_t)p_break_duration[1] << 24) |
           ((uint64_t)p_break_duration[2] << 16) |
           ((uint64_t)p_break_duration[3] << 8) |
           (uint64_t)p_break_duration[4];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
andl $0x1, %eax
cltq
shlq $0x20, %rax
movq -0x8(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
shlq $0x18, %rcx
orq %rcx, %rax
movq -0x8(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
shlq $0x10, %rcx
orq %rcx, %rax
movq -0x8(%rbp), %rcx
movzbl 0x3(%rcx), %ecx
shlq $0x8, %rcx
orq %rcx, %rax
movq -0x8(%rbp), %rcx
movzbl 0x4(%rcx), %ecx
orq %rcx, %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/./bitstream/dvb/si/ait.h
// Function: ait_validate
static inline bool ait_validate(const uint8_t *p_ait)
{
    uint16_t i_section_size =
        psi_get_length(p_ait) + PSI_HEADER_SIZE - PSI_CRC_SIZE;

    if (!psi_get_syntax(p_ait) || psi_get_tableid(p_ait) != AIT_TABLE_ID)
        return false;

    if (i_section_size < AIT_HEADER_SIZE
         || i_section_size < AIT_HEADER_SIZE + ait_get_desclength(p_ait))
        return false;

    if (!descs_validate(p_ait + 8))
        return false;

    ait_each_app(p_ait, p_app) {
        if (!descs_validate(p_app + 7))
            return false;
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3500
movzwl %ax, %eax
addl $0x3, %eax
subl $0x4, %eax
movw %ax, -0x12(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4360
testb $0x1, %al
jne 0x218a1
jmp 0x218b2
movq -0x10(%rbp), %rdi
callq 0x3530
movzbl %al, %eax
cmpl $0x74, %eax
je 0x218bb
movb $0x0, -0x1(%rbp)
jmp 0x21949
movzwl -0x12(%rbp), %eax
cmpl $0xc, %eax
jl 0x218e4
movzwl -0x12(%rbp), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rdi
callq 0x21a60
movw %ax, %cx
movl -0x24(%rbp), %eax
movzwl %cx, %ecx
addl $0xc, %ecx
cmpl %ecx, %eax
jge 0x218ea
movb $0x0, -0x1(%rbp)
jmp 0x21949
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x1ce60
testb $0x1, %al
jne 0x21901
movb $0x0, -0x1(%rbp)
jmp 0x21949
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x21a90
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x21945
movq -0x20(%rbp), %rdi
addq $0x7, %rdi
callq 0x1ce60
testb $0x1, %al
jne 0x21930
movb $0x0, -0x1(%rbp)
jmp 0x21949
jmp 0x21932
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x21a90
movq %rax, -0x20(%rbp)
jmp 0x21912
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/dvb_print_si.c
// Function: handle_ait
static void handle_ait(void)
{
    if (psi_table_validate(pp_current_ait_sections) &&
        psi_table_compare(pp_current_ait_sections, pp_next_ait_sections)) {
        /* Same version AIT. Shortcut. */
        psi_table_free(pp_next_ait_sections);
        psi_table_init(pp_next_ait_sections);
        return;
    }

    if (!ait_table_validate(pp_next_ait_sections)) {
        switch (i_print_type) {
        case PRINT_XML:
            printf("<ERROR type=\"invalid_ait\"/>\n");
            break;
        default:
            printf("invalid AIT received\n");
        }
        psi_table_free(pp_next_ait_sections);
        psi_table_init(pp_next_ait_sections);
        return;
    }

    /* Switch tables. */
    psi_table_free(pp_current_ait_sections);
    psi_table_copy(pp_current_ait_sections, pp_next_ait_sections);
    psi_table_init(pp_next_ait_sections);

    if (pb_print_table[TABLE_AIT])
        ait_table_print(pp_current_ait_sections, print_wrapper, NULL,
                        iconv_wrapper, NULL, i_print_type);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x4c1c5(%rip), %rdi     # 0x6db30
callq 0x4bb0
testb $0x1, %al
jne 0x21976
jmp 0x219ac
leaq 0x4c1b3(%rip), %rdi     # 0x6db30
leaq 0x4b9ac(%rip), %rsi     # 0x6d330
callq 0x4bd0
testb $0x1, %al
jne 0x2198f
jmp 0x219ac
leaq 0x4b99a(%rip), %rdi     # 0x6d330
callq 0x2de0
leaq 0x4b98e(%rip), %rdi     # 0x6d330
callq 0x2bb0
jmp 0x21a5e
leaq 0x4b97d(%rip), %rdi     # 0x6d330
callq 0x21b90
testb $0x1, %al
jne 0x21a01
movl 0x1692e(%rip), %eax     # 0x382f0
subl $0x1, %eax
jne 0x219d9
jmp 0x219c9
leaq 0xa83d(%rip), %rdi      # 0x2c20d
movb $0x0, %al
callq 0x20b0
jmp 0x219e7
leaq 0xa84a(%rip), %rdi      # 0x2c22a
movb $0x0, %al
callq 0x20b0
leaq 0x4b942(%rip), %rdi     # 0x6d330
callq 0x2de0
leaq 0x4b936(%rip), %rdi     # 0x6d330
callq 0x2bb0
jmp 0x21a5e
leaq 0x4c128(%rip), %rdi     # 0x6db30
callq 0x2de0
leaq 0x4c11c(%rip), %rdi     # 0x6db30
leaq 0x4b915(%rip), %rsi     # 0x6d330
callq 0x4d70
leaq 0x4b909(%rip), %rdi     # 0x6d330
callq 0x2bb0
testb $0x1, 0x4b8db(%rip)     # 0x6d30e
je 0x21a5e
movl 0x168b4(%rip), %r9d     # 0x382f0
leaq 0x4c0ed(%rip), %rdi     # 0x6db30
leaq -0x1c76a(%rip), %rsi    # 0x52e0
xorl %eax, %eax
movl %eax, %r8d
leaq -0x4db6(%rip), %rcx     # 0x1cca0
movq %r8, %rdx
callq 0x21c00
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3500
movzwl %ax, %eax
addl $0x3, %eax
subl $0x4, %eax
movw %ax, -0x1a(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x21ae8
movq -0x10(%rbp), %rax
addq $0xc, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x21a60
movw %ax, %cx
movq -0x28(%rbp), %rax
movzwl %cx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
jmp 0x21b27
movq -0x18(%rbp), %rax
addq $0x9, %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
movzwl -0x1a(%rbp), %ecx
cmpq %rcx, %rax
jle 0x21b0a
movq $0x0, -0x8(%rbp)
jmp 0x21b55
movq -0x18(%rbp), %rdi
callq 0x21b60
movzwl %ax, %ecx
addl $0x9, %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
movzwl -0x1a(%rbp), %ecx
cmpq %rcx, %rax
jge 0x21b45
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x21b4d
xorl %eax, %eax
movq %rax, -0x30(%rbp)
jmp 0x21b4d
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/./bitstream/dvb/si/ait.h
// Function: ait_table_validate
static inline bool ait_table_validate(uint8_t **pp_sections)
{
    uint8_t i_last_section = psi_table_get_lastsection(pp_sections);
    uint8_t i;

    for (i = 0; i <= i_last_section; i++) {
        uint8_t *p_section = psi_table_get_section(pp_sections, i);

        if (!psi_check_crc(p_section))
            return false;
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x4b50
movb %al, -0x11(%rbp)
movb $0x0, -0x12(%rbp)
movzbl -0x12(%rbp), %eax
movzbl -0x11(%rbp), %ecx
cmpl %ecx, %eax
jg 0x21beb
movq -0x10(%rbp), %rdi
movzbl -0x12(%rbp), %esi
callq 0x4da0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x5480
testb $0x1, %al
jne 0x21bdf
movb $0x0, -0x1(%rbp)
jmp 0x21bef
jmp 0x21be1
movb -0x12(%rbp), %al
addb $0x1, %al
movb %al, -0x12(%rbp)
jmp 0x21baf
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/./bitstream/dvb/si/ait.h
// Function: aitn_control_code_txt
static inline const char *aitn_control_code_txt(uint8_t i_control_code)
{
    switch (i_control_code) {
        case AITN_CONTROL_CODE_AUTOSTART: return "autostart";
        case AITN_CONTROL_CODE_PRESENT: return "present";
        case AITN_CONTROL_CODE_DESTROY: return "destroy";
        case AITN_CONTROL_CODE_KILL: return "kill";
        case AITN_CONTROL_CODE_PREFETCH: return "prefetch";
        case AITN_CONTROL_CODE_REMOTE: return "remote";
        case AITN_CONTROL_CODE_DISABLED: return "disabled";
        case AITN_CONTROL_CODE_PLAYBACK_AUTOSTART: return "playback autostart";
        default:
            return "Reserved";
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %dil, %al
movb %al, -0x9(%rbp)
movzbl -0x9(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x7, %eax
ja 0x221a7
movq -0x18(%rbp), %rax
leaq 0x178a(%rip), %rcx      # 0x238c0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xa1cb(%rip), %rax      # 0x2c311
movq %rax, -0x8(%rbp)
jmp 0x221b2
leaq 0x4633(%rip), %rax      # 0x26786
movq %rax, -0x8(%rbp)
jmp 0x221b2
leaq 0xa182(%rip), %rax      # 0x2c2e2
movq %rax, -0x8(%rbp)
jmp 0x221b2
leaq 0xa17d(%rip), %rax      # 0x2c2ea
movq %rax, -0x8(%rbp)
jmp 0x221b2
leaq 0xa175(%rip), %rax      # 0x2c2ef
movq %rax, -0x8(%rbp)
jmp 0x221b2
leaq 0xa171(%rip), %rax      # 0x2c2f8
movq %rax, -0x8(%rbp)
jmp 0x221b2
leaq 0xa16b(%rip), %rax      # 0x2c2ff
movq %rax, -0x8(%rbp)
jmp 0x221b2
leaq 0xa167(%rip), %rax      # 0x2c308
movq %rax, -0x8(%rbp)
jmp 0x221b2
leaq 0x235f(%rip), %rax      # 0x2450d
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/./bitstream/dvb/si/ait.h
// Function: ait_desc_app_validate
static inline bool ait_desc_app_validate(const uint8_t *p_desc)
{
    uint8_t tag = desc_get_tag(p_desc);
    uint8_t length = desc_get_length(p_desc);

    if (tag != AIT_DESC_APP || length < AIT_DESC_APP_SIZE)
        return false;

    uint8_t profilelength = ait_desc_app_get_profilelength(p_desc);
    if (length < AIT_DESC_APP + profilelength)
        return false;
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5700
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5820
movb %al, -0x12(%rbp)
movzbl -0x11(%rbp), %eax
cmpl $0x0, %eax
jne 0x22236
movzbl -0x12(%rbp), %eax
cmpl $0x3, %eax
jge 0x2223c
movb $0x0, -0x1(%rbp)
jmp 0x22261
movq -0x10(%rbp), %rdi
callq 0x228a0
movb %al, -0x13(%rbp)
movzbl -0x12(%rbp), %eax
movzbl -0x13(%rbp), %ecx
addl $0x0, %ecx
cmpl %ecx, %eax
jge 0x2225d
movb $0x0, -0x1(%rbp)
jmp 0x22261
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/./bitstream/dvb/si/ait_print.h
// Function: ait_desc_app_name_print
static inline void ait_desc_app_name_print(const uint8_t *p_desc,
                                           f_print pf_print, void *print_opaque,
                                           f_iconv pf_iconv, void *iconv_opaque,
                                           print_type_t i_print_type)
{
    switch (i_print_type) {
        case PRINT_XML:
            pf_print(print_opaque, "<APP_NAME>");
            break;
        default:
            pf_print(print_opaque, "    - app_name");
    }

    ait_desc_app_name_each_name(p_desc, p_name) {
        uint8_t *code = ait_desc_app_name_get_code(p_name);
        uint8_t text_len;
        const uint8_t *text = ait_desc_app_name_get_text(p_name, &text_len);
        char *psz_text = dvb_string_get(text, text_len, pf_iconv, iconv_opaque);

        switch (i_print_type) {
            case PRINT_XML:
                pf_print(print_opaque, "<NAME language=\"%3.3s\" test=\"%s\"/>",
                         (char *)code, psz_text);
                break;

            default:
                pf_print(print_opaque, "      - language=%3.3s test=\"%s\"",
                         (char *)code, psz_text);
        }

        free(psz_text);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
subl $0x1, %eax
jne 0x225af
jmp 0x2259a
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rdi
leaq 0x9e7b(%rip), %rsi      # 0x2c424
movb $0x0, %al
callq *%rcx
jmp 0x225c2
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rdi
leaq 0x9e71(%rip), %rsi      # 0x2c42f
movb $0x0, %al
callq *%rcx
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x22b20
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x2267a
movq -0x38(%rbp), %rdi
callq 0x22bc0
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
leaq -0x41(%rbp), %rsi
callq 0x22bd0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movzbl -0x41(%rbp), %eax
movl %eax, %esi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x16a70
movq %rax, -0x58(%rbp)
movl -0x2c(%rbp), %eax
subl $0x1, %eax
jne 0x2263f
jmp 0x22621
movq -0x10(%rbp), %r8
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rdx
movq -0x58(%rbp), %rcx
leaq 0x9e06(%rip), %rsi      # 0x2c43e
movb $0x0, %al
callq *%r8
jmp 0x2265b
movq -0x10(%rbp), %r8
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rdx
movq -0x58(%rbp), %rcx
leaq 0x9e0b(%rip), %rsi      # 0x2c461
movb $0x0, %al
callq *%r8
movq -0x58(%rbp), %rdi
callq 0x2030
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x22b20
movq %rax, -0x38(%rbp)
jmp 0x225d3
addq $0x60, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/./bitstream/dvb/si/ait.h
// Function: ait_desc_transport_proto_validate
static inline bool ait_desc_transport_proto_validate(const uint8_t *p_desc)
{
    uint8_t tag = desc_get_tag(p_desc);
    uint8_t length = desc_get_length(p_desc);

    return tag == AIT_DESC_TRANSPORT_PROTO &&
        length >= AIT_DESC_TRANSPORT_PROTO_SIZE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x5700
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rdi
callq 0x5820
movb %al, -0xa(%rbp)
movzbl -0x9(%rbp), %ecx
xorl %eax, %eax
cmpl $0x2, %ecx
movb %al, -0xb(%rbp)
jne 0x226bf
movzbl -0xa(%rbp), %eax
cmpl $0x3, %eax
setge %al
movb %al, -0xb(%rbp)
movb -0xb(%rbp), %al
andb $0x1, %al
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/./bitstream/dvb/si/ait_print.h
// Function: ait_desc_transport_proto_print
static inline void ait_desc_transport_proto_print(const uint8_t *p_desc,
                                                  f_print pf_print,
                                                  void *print_opaque,
                                                  f_iconv pf_iconv,
                                                  void *iconv_opaque,
                                                  print_type_t i_print_type)
{
    switch (i_print_type) {
        case PRINT_XML:
            pf_print(print_opaque, "<TRANSPORT_PROTOCOL id=\"%u\" label=\"%u\""
                     ">",
                     ait_desc_transport_proto_get_id(p_desc),
                     ait_desc_transport_proto_get_label(p_desc));
            break;
        default:
            pf_print(print_opaque, "    - transport_protocol id=%u label=%u",
                     ait_desc_transport_proto_get_id(p_desc),
                     ait_desc_transport_proto_get_label(p_desc));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
subl $0x1, %eax
jne 0x2273e
jmp 0x226fa
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
callq 0x22c20
movzwl %ax, %eax
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x22c40
movq -0x48(%rbp), %rdi
movl -0x3c(%rbp), %edx
movq -0x38(%rbp), %r8
movzbl %al, %ecx
leaq 0x9d4b(%rip), %rsi      # 0x2c482
movb $0x0, %al
callq *%r8
jmp 0x22780
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
callq 0x22c20
movzwl %ax, %eax
movl %eax, -0x54(%rbp)
movq -0x8(%rbp), %rdi
callq 0x22c40
movq -0x60(%rbp), %rdi
movl -0x54(%rbp), %edx
movq -0x50(%rbp), %r8
movzbl %al, %ecx
leaq 0x9d2f(%rip), %rsi      # 0x2c4aa
movb $0x0, %al
callq *%r8
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/./bitstream/dvb/si/ait_print.h
// Function: ait_desc_app_location_print
static inline void ait_desc_app_location_print(const uint8_t *p_desc,
                                               f_print pf_print,
                                               void *print_opaque,
                                               f_iconv pf_iconv,
                                               void *iconv_opaque,
                                               print_type_t i_print_type)
{
    uint8_t initial_path_len;
    uint8_t *initial_path =
        ait_desc_app_location_get_initial_path(p_desc, &initial_path_len);
    switch (i_print_type) {
        case PRINT_XML:
            pf_print(print_opaque, "<TRANSPORT_PROTOCOL id=\"%u\" label=\"%u\""
                     "initial_path=\"%.*s\"/>",
                     ait_desc_transport_proto_get_id(p_desc),
                     ait_desc_transport_proto_get_label(p_desc),
                     (int)initial_path_len, (char *)initial_path);
            break;
        default:
            pf_print(print_opaque, "    - transport_protocol id=%u label=%u "
                     "initial_path=\"%.*s\"",
                     ait_desc_transport_proto_get_id(p_desc),
                     ait_desc_transport_proto_get_label(p_desc),
                     (int)initial_path_len, (char *)initial_path);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x2d(%rbp), %rsi
callq 0x22c60
movq %rax, -0x38(%rbp)
movl -0x2c(%rbp), %eax
subl $0x1, %eax
jne 0x22848
jmp 0x227fb
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
callq 0x22c20
movzwl %ax, %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rdi
callq 0x22c40
movq -0x50(%rbp), %rdi
movl -0x44(%rbp), %edx
movq -0x40(%rbp), %r10
movzbl %al, %ecx
movzbl -0x2d(%rbp), %r8d
movq -0x38(%rbp), %r9
leaq 0x9c91(%rip), %rsi      # 0x2c4d2
movb $0x0, %al
callq *%r10
jmp 0x22893
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rdi
callq 0x22c20
movzwl %ax, %eax
movl %eax, -0x5c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x22c40
movq -0x68(%rbp), %rdi
movl -0x5c(%rbp), %edx
movq -0x58(%rbp), %r10
movzbl %al, %ecx
movzbl -0x2d(%rbp), %r8d
movq -0x38(%rbp), %r9
leaq 0x9c80(%rip), %rsi      # 0x2c50e
movb $0x0, %al
callq *%r10
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/./bitstream/dvb/si/ait.h
// Function: ait_desc_app_next_profile
static inline uint8_t *ait_desc_app_next_profile(const uint8_t *p_desc,
                                                 uint8_t *p_profile)
{
    uint8_t profilelength = ait_desc_app_get_profilelength(p_desc);

    if (!p_profile)
        p_profile = (uint8_t *)p_desc + 3;
    else
        p_profile += AIT_DESC_APP_PROFILE_SIZE;
    return p_profile - p_desc - 3 + AIT_DESC_APP_PROFILE_SIZE > profilelength ?
        NULL : p_profile;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x228a0
movb %al, -0x11(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x229b1
movq -0x8(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x10(%rbp)
jmp 0x229bd
movq -0x10(%rbp), %rax
addq $0x5, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
subq %rcx, %rax
subq $0x3, %rax
addq $0x5, %rax
movzbl -0x11(%rbp), %ecx
cmpq %rcx, %rax
jle 0x229e1
xorl %eax, %eax
movq %rax, -0x20(%rbp)
jmp 0x229e9
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/./bitstream/dvb/si/ait.h
// Function: ait_desc_app_next_transport_proto
static inline uint8_t *ait_desc_app_next_transport_proto(const uint8_t *p_desc,
                                                         uint8_t *p_proto)
{
    const uint8_t *p_end = p_desc + DESC_HEADER_SIZE + desc_get_length(p_desc);
    uint8_t profilelength = ait_desc_app_get_profilelength(p_desc);
    if (!p_proto)
        p_proto = (uint8_t *)p_desc + 5 + profilelength;
    else
        p_proto++;
    return p_proto >= p_end ? NULL : p_proto;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x5820
movb %al, %cl
movq -0x28(%rbp), %rax
movzbl %cl, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x228a0
movb %al, -0x19(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x22ae3
movq -0x8(%rbp), %rax
addq $0x5, %rax
movzbl -0x19(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
jmp 0x22aef
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x18(%rbp), %rax
jb 0x22b01
xorl %eax, %eax
movq %rax, -0x30(%rbp)
jmp 0x22b09
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/./bitstream/dvb/si/ait.h
// Function: ait_desc_app_name_next_name
static inline uint8_t *ait_desc_app_name_next_name(const uint8_t *p_desc,
                                                   uint8_t *p_name)
{
    const uint8_t *p_end = p_desc + DESC_HEADER_SIZE + desc_get_length(p_desc);
    if (!p_name)
        p_name = (uint8_t *)p_desc + DESC_HEADER_SIZE;
    else
        p_name += 3 + ait_desc_app_name_get_textlength(p_name);
    return p_name + 3 > p_end ? NULL : p_name;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x5820
movb %al, %cl
movq -0x20(%rbp), %rax
movzbl %cl, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x22b6d
movq -0x8(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x10(%rbp)
jmp 0x22b8a
movq -0x10(%rbp), %rdi
callq 0x22c00
movzbl %al, %ecx
addl $0x3, %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $0x3, %rax
cmpq -0x18(%rbp), %rax
jbe 0x22ba0
xorl %eax, %eax
movq %rax, -0x28(%rbp)
jmp 0x22ba8
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movl %edi, 0x14(%rsp)
movl $0x1, 0xc(%rsp)
leaq 0xabc9(%rip), %rax      # 0xe3a0
cmpl $0x0, 0x10(%rax)
je 0x38ff
leaq 0xabb8(%rip), %rax      # 0xe3a0
cmpl $0x0, 0x14(%rax)
je 0x387a
movl 0x14(%rsp), %eax
shrl $0x8, %eax
andl $0xff, %eax
movb %al, 0x13(%rsp)
xorl %eax, %eax
cmpl $0x0, 0xc(%rsp)
movb %al, 0xb(%rsp)
je 0x3828
leaq 0x13(%rsp), %rdi
movl $0x1, %esi
callq 0x1950
cmpl $0x0, %eax
setne %al
movb %al, 0xb(%rsp)
movb 0xb(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0xc(%rsp)
movl 0x14(%rsp), %eax
andl $0xff, %eax
movb %al, 0x13(%rsp)
xorl %eax, %eax
cmpl $0x0, 0xc(%rsp)
movb %al, 0xa(%rsp)
je 0x3868
leaq 0x13(%rsp), %rdi
movl $0x1, %esi
callq 0x1950
cmpl $0x0, %eax
setne %al
movb %al, 0xa(%rsp)
movb 0xa(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0xc(%rsp)
jmp 0x38fd
movl 0x14(%rsp), %eax
andl $0xff, %eax
movb %al, 0x13(%rsp)
xorl %eax, %eax
cmpl $0x0, 0xc(%rsp)
movb %al, 0x9(%rsp)
je 0x38ad
leaq 0x13(%rsp), %rdi
movl $0x1, %esi
callq 0x1950
cmpl $0x0, %eax
setne %al
movb %al, 0x9(%rsp)
movb 0x9(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0xc(%rsp)
movl 0x14(%rsp), %eax
shrl $0x8, %eax
andl $0xff, %eax
movb %al, 0x13(%rsp)
xorl %eax, %eax
cmpl $0x0, 0xc(%rsp)
movb %al, 0x8(%rsp)
je 0x38f0
leaq 0x13(%rsp), %rdi
movl $0x1, %esi
callq 0x1950
cmpl $0x0, %eax
setne %al
movb %al, 0x8(%rsp)
movb 0x8(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0xc(%rsp)
jmp 0x393f
movl 0x14(%rsp), %eax
andl $0xff, %eax
movb %al, 0x13(%rsp)
xorl %eax, %eax
cmpl $0x0, 0xc(%rsp)
movb %al, 0x7(%rsp)
je 0x3932
leaq 0x13(%rsp), %rdi
movl $0x1, %esi
callq 0x1950
cmpl $0x0, %eax
setne %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %eax
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mhmt/mhmt-globals.c
// Function: init_globals
void init_globals(void)
{
    wrk.packtype = PK_MLZ;
    wrk.greedy   = 0;
    wrk.mode     = 0;
    wrk.zxheader = 0;
    wrk.wordbit  = 0;
    wrk.bigend   = 0;
    wrk.fullbits = 0;
    wrk.maxwin   = 4352;
    wrk.fname_in  = NULL;
    wrk.fname_out = NULL;
    wrk.file_in  = NULL;
    wrk.file_out = NULL;
    wrk.indata = NULL;
    wrk.inlen = 0;
}

// Assembly:
movl $0x1, 0xaa46(%rip)      # 0xe3a0
movl $0x0, 0xaa40(%rip)      # 0xe3a4
movl $0x0, 0xaa3a(%rip)      # 0xe3a8
movl $0x0, 0xaa34(%rip)      # 0xe3ac
movl $0x0, 0xaa2e(%rip)      # 0xe3b0
movl $0x0, 0xaa28(%rip)      # 0xe3b4
movl $0x0, 0xaa22(%rip)      # 0xe3b8
movl $0x1100, 0xaa1c(%rip)   # imm = 0x1100
movq $0x0, 0xaa15(%rip) # 0xe3c0
movq $0x0, 0xaa12(%rip) # 0xe3c8
movq $0x0, 0xaa0f(%rip) # 0xe3d0
movq $0x0, 0xaa0c(%rip) # 0xe3d8
movq $0x0, 0xaa09(%rip) # 0xe3e0
movl $0x0, 0xaa07(%rip)      # 0xe3e8
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
cmpq $0x0, 0xa9e7(%rip)      # 0xe3e0
je 0x3a07
movq 0xa9de(%rip), %rdi      # 0xe3e0
callq 0x10b0
cmpq $0x0, 0xa9c9(%rip)      # 0xe3d8
je 0x3a1d
movq 0xa9c0(%rip), %rdi      # 0xe3d8
callq 0x1080
cmpq $0x0, 0xa9ab(%rip)      # 0xe3d0
je 0x3a33
movq 0xa9a2(%rip), %rdi      # 0xe3d0
callq 0x1080
cmpq $0x0, 0xa98d(%rip)      # 0xe3c8
je 0x3a49
movq 0xa984(%rip), %rdi      # 0xe3c8
callq 0x10b0
cmpq $0x0, 0xa96f(%rip)      # 0xe3c0
je 0x3a5f
movq 0xa966(%rip), %rdi      # 0xe3c0
callq 0x10b0
popq %rax
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movl %esi, 0x34(%rsp)
cmpl $0x0, 0x34(%rsp)
jne 0x3a92
movq $0x0, 0x40(%rsp)
jmp 0x3b61
movl 0x34(%rsp), %eax
movl %eax, %edi
callq 0x10d0
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x3ab8
movq $0x0, 0x40(%rsp)
jmp 0x3b61
movb $0x0, 0xf(%rsp)
movb $0x0, 0xe(%rsp)
movl 0x34(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movzbl 0xe(%rsp), %eax
sarl %eax
movzbl 0xe(%rsp), %ecx
shll $0x7, %ecx
orl %ecx, %eax
movb %al, 0xd(%rsp)
movzbl 0xf(%rsp), %eax
sarl %eax
movzbl 0xf(%rsp), %ecx
shll $0x7, %ecx
orl %ecx, %eax
movb %al, 0xe(%rsp)
movq 0x18(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rsp)
movb (%rax), %al
movb %al, 0xf(%rsp)
movzbl 0xf(%rsp), %eax
movzbl 0xe(%rsp), %ecx
xorl %ecx, %eax
movzbl 0xd(%rsp), %ecx
xorl %ecx, %eax
movb %al, %cl
movq 0x10(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x10(%rsp)
movb %cl, (%rax)
movl 0x24(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x24(%rsp)
cmpl $0x0, %eax
jne 0x3ade
movq 0x28(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movl $0x0, 0x14(%rsp)
movl %edi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
callq 0x3950
leaq 0x4d07(%rip), %rdi      # 0x9510
movb $0x0, %al
callq 0x1040
movl 0x10(%rsp), %edi
movq 0x8(%rsp), %rsi
callq 0x56d0
movl %eax, (%rsp)
movl (%rsp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x484c
movl (%rsp), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x4847
leaq 0x537b(%rip), %rdi      # 0x9bbb
movb $0x0, %al
callq 0x1040
callq 0x4900
movl (%rsp), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x4874
leaq 0x4cef(%rip), %rdi      # 0x954f
movb $0x0, %al
callq 0x1040
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x48e6
movl (%rsp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x48e4
callq 0x4a80
cmpl $0x0, %eax
je 0x48d7
callq 0x4eb0
leaq 0x9b0b(%rip), %rax      # 0xe3a0
cmpl $0x0, 0x8(%rax)
je 0x48b9
callq 0x6560
movl %eax, %edx
movl $0x1, %eax
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
addl 0x4(%rsp), %eax
movl %eax, 0x4(%rsp)
jmp 0x48d5
callq 0x53d0
movl %eax, %edx
movl $0x1, %eax
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
addl 0x4(%rsp), %eax
movl %eax, 0x4(%rsp)
jmp 0x48e2
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x48e4
jmp 0x48e6
callq 0x39f0
movl 0x4(%rsp), %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movl %edi, 0x14(%rsp)
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
shlq $0x4, %rdi
callq 0x10d0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x51d5
movq 0x8(%rsp), %rax
movl $0x1, (%rax)
movq 0x8(%rsp), %rax
movl $0x0, 0x4(%rax)
movq 0x8(%rsp), %rax
movl $0x0, 0x8(%rax)
movq 0x8(%rsp), %rax
movl $0x8, 0x18(%rax)
movl $0x2, 0x4(%rsp)
movl 0x4(%rsp), %eax
movl 0x14(%rsp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jae 0x51d3
movq 0x8(%rsp), %rax
movl 0x4(%rsp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x51a0
jmp 0x51d5
movq 0x8(%rsp), %rax
addq $0x18, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movl %edi, 0x34(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movl $0x0, 0x14(%rsp)
movq 0x28(%rsp), %rax
movl 0x14(%rsp), %ecx
movl (%rax,%rcx,8), %eax
movl %eax, 0x8(%rsp)
cmpl $0x0, %eax
je 0x531f
movq 0x20(%rsp), %rax
movl 0x34(%rsp), %edi
movq 0x28(%rsp), %rsi
movl 0x14(%rsp), %ecx
shlq $0x3, %rcx
addq %rcx, %rsi
callq *%rax
movl %eax, 0x10(%rsp)
cmpl $0x0, 0x10(%rsp)
jne 0x5276
leaq 0x4b30(%rip), %rdi      # 0x9d95
movb $0x0, %al
callq 0x1040
movl $0x1, %edi
callq 0x10c0
cmpl $0x0, 0x8(%rsp)
jge 0x5287
xorl %eax, %eax
subl 0x8(%rsp), %eax
movl %eax, 0x8(%rsp)
movl 0x34(%rsp), %eax
addl 0x8(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rax
movl 0xc(%rsp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl 0x10(%rsp), %ecx
movq 0x18(%rsp), %rdx
movl 0x34(%rsp), %esi
shlq $0x4, %rsi
addq %rsi, %rdx
addl 0x8(%rdx), %ecx
cmpl %ecx, %eax
jbe 0x530b
movl 0x10(%rsp), %ecx
movq 0x18(%rsp), %rax
movl 0x34(%rsp), %edx
shlq $0x4, %rdx
addq %rdx, %rax
addl 0x8(%rax), %ecx
movq 0x18(%rsp), %rax
movl 0xc(%rsp), %edx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq 0x18(%rsp), %rax
movl 0xc(%rsp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x28(%rsp), %rcx
movl 0x14(%rsp), %edx
movq (%rcx,%rdx,8), %rcx
movq %rcx, (%rax)
jmp 0x530d
jmp 0x530f
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x521f
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movl -0xc(%rsp), %eax
movl %eax, -0x20(%rsp)
movq -0x8(%rsp), %rax
movl -0x20(%rsp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x1c(%rsp)
cmpl $0x1, -0x20(%rsp)
jbe 0x53c3
movl -0x1c(%rsp), %eax
movl %eax, -0x24(%rsp)
cmpl $0x0, -0x24(%rsp)
jge 0x5379
xorl %eax, %eax
subl -0x24(%rsp), %eax
movl %eax, -0x24(%rsp)
movl -0x24(%rsp), %ecx
movl -0x20(%rsp), %eax
subl %ecx, %eax
movl %eax, -0x20(%rsp)
movq -0x1c(%rsp), %rax
movq %rax, -0x14(%rsp)
movq -0x8(%rsp), %rax
movl -0x20(%rsp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x1c(%rsp)
movq -0x8(%rsp), %rax
movl -0x20(%rsp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq -0x14(%rsp), %rcx
movq %rcx, (%rax)
jmp 0x5359
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/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:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movl $0x0, -0x14(%rsp)
movq -0x8(%rsp), %rax
movb (%rax), %al
movb %al, -0x15(%rsp)
movq -0x10(%rsp), %rax
movb (%rax), %al
movb %al, -0x16(%rsp)
movb $0x0, -0x17(%rsp)
movb $0x0, -0x18(%rsp)
movq -0x8(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rsp)
movq -0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rsp)
movzbl -0x15(%rsp), %eax
cmpl $0x61, %eax
jl 0x5ecd
movb $-0x20, -0x17(%rsp)
movzbl -0x16(%rsp), %eax
cmpl $0x61, %eax
jl 0x5edc
movb $-0x20, -0x18(%rsp)
movzbl -0x15(%rsp), %eax
cmpl $0x7a, %eax
jle 0x5eeb
movb $0x0, -0x17(%rsp)
movzbl -0x16(%rsp), %eax
cmpl $0x7a, %eax
jle 0x5efa
movb $0x0, -0x18(%rsp)
movzbl -0x17(%rsp), %ecx
movzbl -0x15(%rsp), %eax
addl %ecx, %eax
movb %al, -0x15(%rsp)
movzbl -0x18(%rsp), %ecx
movzbl -0x16(%rsp), %eax
addl %ecx, %eax
movb %al, -0x16(%rsp)
movzbl -0x15(%rsp), %eax
movzbl -0x16(%rsp), %ecx
cmpl %ecx, %eax
jge 0x5f30
movl $0xffffffff, -0x14(%rsp) # imm = 0xFFFFFFFF
movzbl -0x15(%rsp), %eax
movzbl -0x16(%rsp), %ecx
cmpl %ecx, %eax
jle 0x5f46
movl $0x1, -0x14(%rsp)
jmp 0x5f48
xorl %eax, %eax
cmpl $0x0, -0x14(%rsp)
movb %al, -0x19(%rsp)
jne 0x5f74
movzbl -0x15(%rsp), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x19(%rsp)
je 0x5f74
movzbl -0x16(%rsp), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x19(%rsp)
movb -0x19(%rsp), %al
testb $0x1, %al
jne 0x5e82
movl -0x14(%rsp), %eax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
leaq 0x7100(%rip), %rax      # 0xd0a0
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rcx
xorl %eax, %eax
cmpq $0x0, (%rcx)
movb %al, 0x17(%rsp)
je 0x5fd2
movq 0x18(%rsp), %rax
movq (%rax), %rdi
movq 0x20(%rsp), %rsi
callq 0x5e70
cmpl $0x0, %eax
setne %al
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x5fdc
jmp 0x5fec
movq 0x18(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x18(%rsp)
jmp 0x5fa5
movq 0x18(%rsp), %rax
cmpq $0x0, (%rax)
je 0x6003
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x600c
xorl %eax, %eax
movq %rax, 0x8(%rsp)
jmp 0x600c
movq 0x8(%rsp), %rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)