LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_hdr_set_idx
static int bcf_hdr_set_idx(bcf_hdr_t *hdr, int dict_type, const char *tag, bcf_idinfo_t *idinfo)
{
    size_t new_n;

    // If available, preserve existing IDX
    if ( idinfo->id==-1 )
        idinfo->id = hdr->n[dict_type];
    else if ( idinfo->id < hdr->n[dict_type] && hdr->id[dict_type][idinfo->id].key )
    {
        hts_log_error("Conflicting IDX=%d lines in the header dictionary, the new tag is %s",
            idinfo->id, tag);
        errno = EINVAL;
        return -1;
    }

    new_n = idinfo->id >= hdr->n[dict_type] ? idinfo->id+1 : hdr->n[dict_type];
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    // hts_resize() can attempt to allocate up to 2 * requested items
    if (new_n > FUZZ_ALLOC_LIMIT/(2 * sizeof(bcf_idpair_t)))
        return -1;
#endif
    if (hts_resize(bcf_idpair_t, new_n, &hdr->m[dict_type],
                   &hdr->id[dict_type], HTS_RESIZE_CLEAR)) {
        return -1;
    }
    hdr->n[dict_type] = new_n;

    // NB: the next kh_put call can invalidate the idinfo pointer, therefore
    // we leave it unassigned here. It must be set explicitly in bcf_hdr_sync.
    hdr->id[dict_type][idinfo->id].key = tag;

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movq %rdi, %r15
movslq 0x30(%rcx), %rcx
movl %esi, %r12d
movl (%rdi,%r12,4), %eax
cmpq $-0x1, %rcx
je 0x42467
cmpl %eax, %ecx
jge 0x4246b
movq 0x10(%r15,%r12,8), %rax
movq %rcx, %rdx
shlq $0x4, %rdx
cmpq $0x0, (%rax,%rdx)
je 0x4246b
leaq 0x6d2ad(%rip), %rsi     # 0xaf6ec
leaq 0x6d2b6(%rip), %rdx     # 0xaf6fc
movl $0x1, %edi
movq %rbx, %r8
xorl %eax, %eax
callq 0x9774
callq 0x4050
movl $0x16, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x424da
movl %eax, 0x30(%r14)
movl 0x30(%r14), %eax
movl (%r15,%r12,4), %ecx
leal 0x1(%rax), %ebp
cmpl %ecx, %eax
cmovll %ecx, %ebp
cmpl 0x98(%r15,%r12,4), %ebp
jbe 0x424c3
leaq (%r15,%r12,4), %rcx
addq $0x98, %rcx
movslq %ebp, %rsi
leaq 0x10(%r15,%r12,8), %r8
leaq 0x6d24d(%rip), %rax     # 0xaf6ec
movq %rax, (%rsp)
movl $0x10, %edi
movl $0x4, %edx
movl $0x1, %r9d
callq 0xb422
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x424da
movl %ebp, (%r15,%r12,4)
movq 0x10(%r15,%r12,8), %rax
movslq 0x30(%r14), %rcx
shlq $0x4, %rcx
movq %rbx, (%rax,%rcx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_dec_size_safe
static int bcf_dec_size_safe(uint8_t *p, uint8_t *end, uint8_t **q,
                             int *num, int *type) {
    int r;
    if (p >= end) return -1;
    *type = *p & 0xf;
    if (*p>>4 != 15) {
        *q = p + 1;
        *num = *p >> 4;
        return 0;
    }
    r = bcf_dec_typed_int1_safe(p + 1, end, q, num);
    if (r) return r;
    return *num >= 0 ? 0 : -1;
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rsi, %rdi
jae 0x4252b
pushq %rbx
movq %rcx, %rbx
movzbl (%rdi), %eax
andl $0xf, %eax
movl %eax, (%r8)
leaq 0x1(%rdi), %rax
cmpb $-0x11, (%rdi)
jbe 0x4251d
movq %rax, %rdi
movq %rbx, %rcx
callq 0x4252c
testl %eax, %eax
jne 0x4252a
movl (%rbx), %eax
sarl $0x1f, %eax
jmp 0x4252a
movq %rax, (%rdx)
movzbl (%rdi), %eax
shrl $0x4, %eax
movl %eax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_dec_typed_int1_safe
static int bcf_dec_typed_int1_safe(uint8_t *p, uint8_t *end, uint8_t **q,
                                   int32_t *val) {
    uint32_t t;
    if (end - p < 2) return -1;
    t = *p++ & 0xf;
    /* Use if .. else if ... else instead of switch to force order.  Assumption
       is that small integers are more frequent than big ones. */
    if (t == BCF_BT_INT8) {
        *val = *(int8_t *) p++;
    } else {
        if (end - p < (1<<bcf_type_shift[t])) return -1;
        if (t == BCF_BT_INT16) {
            *val = le_to_i16(p);
            p += 2;
        } else if (t == BCF_BT_INT32) {
            *val = le_to_i32(p);
            p += 4;
#ifdef VCF_ALLOW_INT64
        } else if (t == BCF_BT_INT64) {
            // This case should never happen because there should be no
            // 64-bit BCFs at all, definitely not coming from htslib
            *val = le_to_i64(p);
            p += 8;
#endif
        } else {
            return -1;
        }
    }
    *q = p;
    return 0;
}

// Assembly:
movq %rcx, %r8
movq %rsi, %rcx
subq %rdi, %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x2, %rcx
jl 0x4259f
movzbl (%rdi), %r9d
andl $0xf, %r9d
cmpq $0x1, %r9
jne 0x42560
movsbl 0x1(%rdi), %eax
addq $0x2, %rdi
movl %eax, (%r8)
movq %rdi, (%rdx)
xorl %eax, %eax
jmp 0x4259f
leaq 0x8cfb9(%rip), %rcx     # 0xcf520
movb (%r9,%rcx), %cl
movl $0x1, %r10d
shll %cl, %r10d
leaq 0x1(%rdi), %rcx
subq %rcx, %rsi
movslq %r10d, %rcx
cmpq %rcx, %rsi
jl 0x4259f
cmpb $0x3, %r9b
je 0x425a0
movzbl %r9b, %ecx
cmpl $0x2, %ecx
jne 0x4259f
movswl 0x1(%rdi), %eax
movl %eax, (%r8)
addq $0x3, %rdi
jmp 0x42559
retq
movl 0x1(%rdi), %eax
movl %eax, (%r8)
addq $0x5, %rdi
jmp 0x42559
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_record_check_err
static void bcf_record_check_err(const bcf_hdr_t *hdr, bcf1_t *rec,
                                 char *type, uint32_t *reports, int i) {
    if (*reports == 0 || hts_verbose >= HTS_LOG_DEBUG)
        hts_log_warning("Bad BCF record at %s:%"PRIhts_pos
                        ": Invalid FORMAT %s %d",
                        bcf_seqname_safe(hdr,rec), rec->pos+1, type, i);
    (*reports)++;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdx, %r9
cmpl $0x0, (%rcx)
je 0x425c8
leaq 0x8cf3d(%rip), %rax     # 0xcf500
cmpl $0x5, (%rax)
jl 0x42632
testq %rsi, %rsi
je 0x425d2
movl 0x10(%rsi), %eax
jmp 0x425d7
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rdi, %rdi
sete %cl
testl %eax, %eax
sets %dl
orb %cl, %dl
jne 0x425fb
cmpl %eax, 0x4(%rdi)
jle 0x425fb
movq 0x18(%rdi), %rcx
movl %eax, %eax
shlq $0x4, %rax
movq (%rcx,%rax), %rax
jmp 0x425fd
xorl %eax, %eax
testq %rax, %rax
leaq 0x6d358(%rip), %rcx     # 0xaf95f
cmovneq %rax, %rcx
movq (%rsi), %rax
incq %rax
movl %r8d, (%rsp)
leaq 0x6d2ff(%rip), %rsi     # 0xaf91b
leaq 0x6d30d(%rip), %rdx     # 0xaf930
movl $0x3, %edi
movq %rax, %r8
xorl %eax, %eax
callq 0x9774
incl (%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/tbx.c
// Function: tbx_destroy
void tbx_destroy(tbx_t *tbx)
{
    khash_t(s2i) *d = (khash_t(s2i)*)tbx->dict;
    if (d != NULL)
    {
        khint_t k;
        for (k = kh_begin(d); k != kh_end(d); ++k)
            if (kh_exist(d, k)) free((char*)kh_key(d, k));
    }
    hts_idx_destroy(tbx->idx);
    kh_destroy(s2i, d);
    free(tbx);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %r14
testq %r14, %r14
je 0x9e27b
cmpl $0x0, (%r14)
je 0x9e27b
xorl %ebp, %ebp
xorl %r15d, %r15d
movq 0x10(%r14), %rax
movl %r15d, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %eax
movl %ebp, %ecx
andb $0x1e, %cl
shrl %cl, %eax
testb $0x3, %al
jne 0x9e270
movq 0x18(%r14), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rdi
callq 0x45c0
incl %r15d
addl $0x2, %ebp
cmpl (%r14), %r15d
jne 0x9e248
movq 0x18(%rbx), %rdi
callq 0xac5a
movq %r14, %rdi
callq 0x6407
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x45c0
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/tbx.c
// Function: tbx_index_build3
int tbx_index_build3(const char *fn, const char *fnidx, int min_shift, int n_threads, const tbx_conf_t *conf)
{
    tbx_t *tbx;
    BGZF *fp;
    int ret;
    if ((fp = bgzf_open(fn, "r")) == 0) return -1;
    if ( n_threads ) bgzf_mt(fp, n_threads, 256);
    if ( bgzf_compression(fp) != bgzf ) { bgzf_close(fp); return -2; }
    tbx = tbx_index(fp, min_shift, conf);
    bgzf_close(fp);
    if ( !tbx ) return -1;
    ret = hts_idx_save_as(tbx->idx, fn, fnidx, min_shift > 0? HTS_FMT_CSI : HTS_FMT_TBI);
    tbx_destroy(tbx);
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r12
movl %ecx, %ebx
movl %edx, %ebp
movq %rsi, (%rsp)
movq %rdi, %r14
leaq 0xef71(%rip), %rsi      # 0xad22f
callq 0x8bf2d
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x9e344
movq %rax, %r13
testl %ebx, %ebx
je 0x9e2e4
movq %r13, %rdi
movl %ebx, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x8e651
movq %r13, %rdi
callq 0x8f623
cmpl $0x2, %eax
jne 0x9e336
movq %r13, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x9dd80
movq %rax, %r12
movq %r13, %rdi
callq 0x8ef2c
testq %r12, %r12
je 0x9e344
movq 0x18(%r12), %rdi
xorl %ecx, %ecx
testl %ebp, %ebp
setle %cl
addl %ecx, %ecx
movq %r14, %rsi
movq (%rsp), %rdx
callq 0xc8c3
movl %eax, %ebx
movq %r12, %rdi
callq 0x9e22a
movl %ebx, %eax
jmp 0x9e347
movq %r13, %rdi
callq 0x8ef2c
movl $0xfffffffe, %r15d      # imm = 0xFFFFFFFE
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/tbx.c
// Function: tbx_seqnames
const char **tbx_seqnames(tbx_t *tbx, int *n)
{
    khash_t(s2i) *d = (khash_t(s2i)*)tbx->dict;
    if (d == NULL)
    {
        *n = 0;
        return calloc(1, sizeof(char *));
    }
    int tid, m = kh_size(d);
    const char **names = (const char**) calloc(m,sizeof(const char*));
    khint_t k;
    if (!names) {
        *n = 0;
        return NULL;
    }
    for (k=kh_begin(d); k<kh_end(d); k++)
    {
        if ( !kh_exist(d,k) ) continue;
        tid = kh_val(d,k);
        assert( tid<m );
        names[tid] = kh_key(d,k);
    }
    // sanity check: there should be no gaps
    for (tid=0; tid<m; tid++)
        assert(names[tid]);
    *n = m;
    return names;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq 0x20(%rdi), %r15
testq %r15, %r15
je 0x9e620
movl 0x4(%r15), %r14d
movslq %r14d, %rdi
movl $0x8, %esi
callq 0x42f0
testq %rax, %rax
je 0x9e63a
movl (%r15), %edx
testq %rdx, %rdx
je 0x9e608
movq 0x10(%r15), %rsi
xorl %edi, %edi
xorl %r8d, %r8d
movl %r8d, %ecx
shrl $0x4, %ecx
movl (%rsi,%rcx,4), %r9d
movl %edi, %ecx
andb $0x1e, %cl
shrl %cl, %r9d
testb $0x3, %r9b
jne 0x9e5fd
movq 0x20(%r15), %rcx
movq (%rcx,%r8,8), %rcx
cmpl %ecx, %r14d
jle 0x9e667
movq 0x18(%r15), %r9
movq (%r9,%r8,8), %r9
movslq %ecx, %rcx
movq %r9, (%rax,%rcx,8)
incq %r8
addl $0x2, %edi
cmpq %r8, %rdx
jne 0x9e5c9
testl %r14d, %r14d
jle 0x9e63f
xorl %ecx, %ecx
cmpq $0x0, (%rax,%rcx,8)
je 0x9e648
incq %rcx
cmpq %rcx, %r14
jne 0x9e60f
jmp 0x9e63f
movl $0x0, (%rbx)
movl $0x1, %edi
movl $0x8, %esi
popq %rbx
popq %r14
popq %r15
jmp 0x42f0
xorl %r14d, %r14d
xorl %eax, %eax
movl %r14d, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1b798(%rip), %rdi     # 0xb9de7
leaq 0x1b761(%rip), %rsi     # 0xb9db7
leaq 0x1b760(%rip), %rcx     # 0xb9dbd
movl $0x276, %edx            # imm = 0x276
callq 0x42e0
leaq 0x1b743(%rip), %rdi     # 0xb9db1
leaq 0x1b742(%rip), %rsi     # 0xb9db7
leaq 0x1b741(%rip), %rcx     # 0xb9dbd
movl $0x271, %edx            # imm = 0x271
callq 0x42e0
nop
// File: /workspace/github_c_makefile_star2_O1/OhYee[P]computer_application_programming_experiment/utils/thread/test/test_thread.c
// Function: task
void *task(void *args) {
    thread_pool *tp = args;

    for (;;) {
        tp_lock(tp, 0);
        int number = generator();
        tp_unlock(tp, 0);

        tp_lock(tp, 1);
        write(number);
        tp_unlock(tp, 1);

        if (number == -1) {
            return NULL;
        }
    }
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x27b7(%rip), %r14      # 0x40c0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x159e
movl 0x2797(%rip), %eax      # 0x40b0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x13, %eax
jg 0x192e
leal 0x1(%rax), %ecx
movl %ecx, 0x2784(%rip)      # 0x40b0
movl %eax, %ebp
movq %rbx, %rdi
xorl %esi, %esi
callq 0x15bc
movq %rbx, %rdi
movl $0x1, %esi
callq 0x159e
movslq 0x283c(%rip), %rax      # 0x4188
leal 0x1(%rax), %ecx
movl %ecx, 0x2833(%rip)      # 0x4188
movl %ebp, (%r14,%rax,4)
movq %rbx, %rdi
movl $0x1, %esi
callq 0x15bc
cmpl $-0x1, %ebp
jne 0x1909
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/OhYee[P]computer_application_programming_experiment/utils/thread/test/test_thread.c
// Function: main
int main() {
    boolean pass = T;
    mp_init(1 << 16, mp_exit);
    thread_pool *tp = tp_new(3, 2, task);
    tp_wait(tp);

    int got = generator(tp);
    if (got != -1) {
        print_err("generator should be -1, but got %d\n", got);
        pass = F;
    }
    for (int i = 0; i < 20; ++i) {
        if (i != res[i]) {
            print_err("res[%d] excepted %d, got %d\n", i, i, res[i]);
            pass = F;
        }
    }
    if (pass) {
        print_ok("All test case passed!\n");
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq -0x3a4(%rip), %rsi      # 0x15dc
movl $0x10000, %edi          # imm = 0x10000
callq 0x15e7
leaq -0x96(%rip), %rdx       # 0x18fb
movl $0x3, %edi
movl $0x2, %esi
callq 0x14a4
movq %rax, %rdi
callq 0x1562
movl 0x2702(%rip), %eax      # 0x40b0
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
cmpl $0x13, %eax
jg 0x19c3
leal 0x1(%rax), %ecx
movl %ecx, 0x26ef(%rip)      # 0x40b0
movl %eax, %esi
cmpl $-0x1, %esi
je 0x19df
leaq 0x7e6(%rip), %rdi       # 0x21b5
xorl %eax, %eax
callq 0x10f0
leaq 0x62b(%rip), %rax       # 0x2008
jmp 0x19e6
leaq 0x61e(%rip), %rax       # 0x2004
movl (%rax), %eax
leaq 0x619(%rip), %rcx       # 0x2008
movl (%rcx), %ebp
leaq 0x26c8(%rip), %r15      # 0x40c0
leaq 0x7da(%rip), %rbx       # 0x21d9
xorl %r14d, %r14d
movl (%r15), %ecx
cmpq %rcx, %r14
je 0x1a1c
movq %rbx, %rdi
movl %r14d, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x10f0
movl %ebp, %eax
incq %r14
addq $0x4, %r15
cmpq $0x14, %r14
jne 0x1a02
testl %eax, %eax
je 0x1a3b
leaq 0x7c2(%rip), %rdi       # 0x21f6
xorl %eax, %eax
callq 0x13e1
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_3/exercise_3_03/expand.c
// Function: main
int main(void)
{
  char str[MAXLEN];
  char expanded_str[MAXLEN];

  get_str(str, MAXLEN);
  expand(str, expanded_str);
  printf("%s", expanded_str);

  return 0;
}

// Assembly:
pushq %rbx
subq $0x4e20, %rsp           # imm = 0x4E20
xorl %ebx, %ebx
callq 0x1040
cmpl $-0x1, %eax
je 0x1184
movb %al, (%rsp,%rbx)
incq %rbx
cmpq $0x270f, %rbx           # imm = 0x270F
jne 0x1166
movl $0x270f, %ebx           # imm = 0x270F
movl %ebx, %eax
movb $0x0, (%rsp,%rax)
movq %rsp, %rdi
leaq 0x2710(%rsp), %rbx
movq %rbx, %rsi
callq 0x1203
leaq 0xe60(%rip), %rdi       # 0x2004
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1030
xorl %eax, %eax
addq $0x4e20, %rsp           # imm = 0x4E20
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_3/exercise_3_03/expand.c
// Function: expand
void expand(char src[], char dest[])
{
  /**
   * a-z
   * a-b-c
   * a-c-h-v
   * a-c-b-v
   * 0-9
   * 1-5
   * a-zA-Z
   * 0-9a-zA-Z
   * -a-z
   * a-z-
   * -a-z-
   */
  int i, j = 0;
  for (i = 0; i < MAXLEN - 1 && j < MAXLEN - 1 && src[i] != EOF; ++i)
  {
    if (isalnum(src[i]) && src[i + 1] == '-' && src[i] < src[i + 2])
    {
      do
      {
        int k;
        for (k = 0; k <= (src[i + 2] - src[i]); ++k)
        {
          int temp = src[i] + k;
          if (dest[j - 1] != temp && (isdigit(temp) || isalpha(temp)))
          {
            dest[j++] = temp;
          }
        }

        i += 2;
      } while (isalnum(src[i]) && src[i + 1] == '-' && src[i] < src[i + 2]);
    }
    else
    {
      dest[j++] = src[i];
    }
  }
  dest[j] = '\0';
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
xorl %ebp, %ebp
movslq %r12d, %r15
movsbq (%r14,%r15), %r13
cmpq $-0x1, %r13
je 0x12ed
callq 0x1050
movq (%rax), %rcx
testb $0x8, (%rcx,%r13,2)
je 0x12cc
cmpb $0x2d, 0x1(%r14,%r15)
jne 0x12cc
cmpb 0x2(%r14,%r15), %r13b
jge 0x12cc
movb 0x2(%r14,%r15), %sil
movsbl (%r14,%r15), %edx
cmpb %dl, %sil
jl 0x12a7
xorl %ecx, %ecx
leal (%rcx,%rdx), %edi
movslq %ebp, %rsi
movsbl -0x1(%rbx,%rsi), %r8d
cmpl %r8d, %edi
je 0x128c
movq (%rax), %rdi
movslq %edx, %r8
addq %rcx, %r8
testb $0xc, 0x1(%rdi,%r8,2)
je 0x128c
addl %ecx, %edx
leal 0x1(%rsi), %ebp
movb %dl, (%rbx,%rsi)
movsbl 0x2(%r14,%r15), %esi
movsbl (%r14,%r15), %edx
movl %esi, %edi
subl %edx, %edi
incq %rcx
leal -0x1(%rcx), %r8d
cmpl %edi, %r8d
jl 0x1262
leaq 0x2(%r15), %r12
movq (%rax), %rcx
movsbq %sil, %rdx
testb $0x8, (%rcx,%rdx,2)
je 0x12d5
cmpb $0x2d, 0x3(%r14,%r15)
jne 0x12d5
cmpb 0x4(%r14,%r15), %sil
movq %r12, %r15
jl 0x1251
jmp 0x12d5
movslq %ebp, %rax
incl %ebp
movb %r13b, (%rbx,%rax)
cmpl $0x270d, %r12d          # imm = 0x270D
jg 0x12ed
incl %r12d
cmpl $0x270f, %ebp           # imm = 0x270F
jl 0x1219
movslq %ebp, %rax
movb $0x0, (%rbx,%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mikebdp2[P]AtomDis/main.c
// Function: op_destsrc
int op_destsrc (uint8_t *d, char *out) {
    const optab_t *op = &optable[d[0]];
    uint8_t *t    = d+1;
    int      attr = *t++;
    out += sprintf  (out, "%-5s  ", op->name);
    t   += sub_dest (t, out, op->desttype, attr >> 6, size_align[(attr & 0x38)>>3], op->destindex);
    out += strlen   (out);
    out += sprintf  (out, "  <-  ");
    t   += sub_src  (t, out, attr & 0x07, (attr & 0x38) >> 3, size_align[(attr & 0x38)>>3], op->srcindex);
    return t - d;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movzbl (%rdi), %r12d
shll $0x5, %r12d
leaq 0x35924(%rip), %rax     # 0x39dd0
leaq 0x2(%rdi), %r13
movzbl 0x1(%rdi), %ebp
movq 0x8(%r12,%rax), %rdx
leaq 0x1deb6(%rip), %rsi     # 0x22376
movq %r14, %rdi
xorl %eax, %eax
callq 0x41d0
movslq %eax, %r15
addq %r14, %r15
leaq 0x358f9(%rip), %rsi     # 0x39dd0
movl 0x10(%r12,%rsi), %edx
movl %ebp, %ecx
shrl $0x6, %ecx
movl %ebp, %r14d
shrl $0x3, %r14d
andl $0x7, %r14d
leaq 0x1db4d(%rip), %rax     # 0x22040
movl (%rax,%r14,4), %r8d
movl %r8d, 0x4(%rsp)
movl 0x18(%r12,%rsi), %r9d
movq %r13, %rdi
movq %r15, %rsi
callq 0x4e0c
movl %eax, %eax
leaq (%rbx,%rax), %r13
addq $0x2, %r13
movq %r15, %rdi
callq 0x4090
leaq (%rax,%r15), %rsi
addq $0x6, %rsi
movl $0x2d3c2020, -0x6(%rsi) # imm = 0x2D3C2020
movl $0x20202d, -0x3(%rsi)   # imm = 0x20202D
andl $0x7, %ebp
leaq 0x35892(%rip), %rax     # 0x39dd0
movl 0x14(%r12,%rax), %r9d
movq %r13, %rdi
movl %ebp, %edx
movl %r14d, %ecx
movl 0x4(%rsp), %r8d
callq 0x4f97
addl %r13d, %eax
subl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mikebdp2[P]AtomDis/main.c
// Function: op_shift
int op_shift (uint8_t *d, char *out) {
    const optab_t *op = &optable[d[0]];
    uint8_t *t    = d+1;
    int      attr = *t++;
    out += sprintf  (out, "%-5s  ", op->name);
    t   += sub_src (t, out, op->desttype, (attr & 0x38) >> 3, size_align[(attr & 0x38)>>3], op->destindex);
    out += strlen   (out);
    out += sprintf  (out, "  by  %02x", *t++);
    return t - d;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movzbl (%rdi), %ebp
shll $0x5, %ebp
leaq 0x35849(%rip), %r12     # 0x39dd0
leaq 0x2(%rdi), %rax
movq %rax, (%rsp)
movzbl 0x1(%rdi), %r13d
movq 0x8(%rbp,%r12), %rdx
leaq 0x1ddd6(%rip), %rsi     # 0x22376
movq %r15, %rdi
xorl %eax, %eax
callq 0x41d0
movslq %eax, %r14
addq %r15, %r14
movl 0x10(%rbp,%r12), %edx
shrl $0x3, %r13d
andl $0x7, %r13d
leaq 0x1da7c(%rip), %rax     # 0x22040
movl (%rax,%r13,4), %r8d
movl 0x18(%rbp,%r12), %r9d
movq (%rsp), %rdi
movq %r14, %rsi
movl %r13d, %ecx
callq 0x4f97
cltq
leaq (%rbx,%rax), %r15
addq $0x2, %r15
movq %r14, %rdi
callq 0x4090
addq %rax, %r14
movzbl (%r15), %edx
leaq 0x1dd54(%rip), %rsi     # 0x22350
movq %r14, %rdi
xorl %eax, %eax
callq 0x41d0
subl %ebx, %r15d
incl %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mikebdp2[P]AtomDis/main.c
// Function: op_setpt1
int op_setpt1 (uint8_t *d, char *out) {
    const optab_t *op = &optable[d[0]];
    last_reg_index = op->srcindex + *(uint16_t *) &d[1];
    if (last_reg_index == INDEX_REG_MM && opt_reg_addresses)
	addrtypes_shift[D_REG] = 2;
    else
	addrtypes_shift[D_REG] = 0;
    return op_1x16 (d, out);
}

// Assembly:
pushq %rax
movzbl (%rdi), %eax
shll $0x5, %eax
leaq 0x357a4(%rip), %rcx     # 0x39dd0
movzwl 0x1(%rdi), %edx
addl 0x14(%rax,%rcx), %edx
cmpl $0x5, %edx
sete %al
andb 0x38b1c(%rip), %al      # 0x3d15c
movl %edx, 0x38b0e(%rip)     # 0x3d154
movzbl %al, %eax
addl %eax, %eax
movl %eax, 0x38aaf(%rip)     # 0x3d100
callq 0x48fb
movl $0x3, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/mikebdp2[P]AtomDis/main.c
// Function: op_setpt0
int op_setpt0 (uint8_t *d, char *out) {
    const optab_t *op = &optable[d[0]];
    last_reg_index = op->srcindex;
    /* is never INDEX_REG_MM */
    addrtypes_shift[D_REG] = 0;
    return op_0x (d, out);
}

// Assembly:
pushq %rax
movq %rsi, %rax
movzbl (%rdi), %ecx
shll $0x5, %ecx
leaq 0x35762(%rip), %rdx     # 0x39dd0
movl 0x14(%rcx,%rdx), %ecx
movl %ecx, 0x38adc(%rip)     # 0x3d154
movl $0x0, 0x38a7e(%rip)     # 0x3d100
movzbl (%rdi), %ecx
shll $0x5, %ecx
movq 0x8(%rcx,%rdx), %rsi
movq %rax, %rdi
callq 0x4050
movl $0x1, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/mikebdp2[P]AtomDis/main.c
// Function: op_src
int op_src (uint8_t *d, char *out) {
    const optab_t *op = &optable[d[0]];
    uint8_t       *t    = d+1;
    int            attr = *t++;
    out += sprintf (out, "%-5s  ", op->name);
    t   += sub_src (t, out, attr & 0x07, (attr & 0x38) >> 3, size_align[(attr & 0x38)>>3], op->srcindex);
    return t - d;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movzbl (%rdi), %r13d
shll $0x5, %r13d
leaq 0x356ec(%rip), %rbp     # 0x39dd0
leaq 0x2(%rdi), %r14
movzbl 0x1(%rdi), %r12d
movq 0x8(%r13,%rbp), %rdx
leaq 0x1dc7d(%rip), %rsi     # 0x22376
movq %r15, %rdi
xorl %eax, %eax
callq 0x41d0
movslq %eax, %rsi
addq %r15, %rsi
movl %r12d, %edx
andl $0x7, %edx
shrl $0x3, %r12d
andl $0x7, %r12d
leaq 0x1d922(%rip), %rax     # 0x22040
movl (%rax,%r12,4), %r8d
movl 0x14(%r13,%rbp), %r9d
movq %r14, %rdi
movl %r12d, %ecx
callq 0x4f97
addl %r14d, %eax
subl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mikebdp2[P]AtomDis/main.c
// Function: op_1x16
int op_1x16 (uint8_t *d, char *out) {
    const optab_t *op = &optable[d[0]];
    const char    *ind;
    out += sprintf (out, "%-5s  ", op->name);
    out += sprintf (out, addrtypes [op->desttype],
		    (*(uint16_t *) &d[1]) << addrtypes_shift [op->desttype]);
    if ( (ind = get_index (op->destindex, d[1])) )
	out += sprintf (out, "  (%s)", ind);
    return 3;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
movzbl (%rdi), %r12d
shll $0x5, %r12d
leaq 0x354b5(%rip), %r13     # 0x39dd0
movq 0x8(%r12,%r13), %rdx
leaq 0x1da4f(%rip), %rsi     # 0x22376
movq %r15, %rdi
xorl %eax, %eax
callq 0x41d0
movslq %eax, %rbx
addq %r15, %rbx
movslq 0x10(%r12,%r13), %rax
leaq 0x3783d(%rip), %rcx     # 0x3c180
movq (%rcx,%rax,8), %rsi
movzwl 0x1(%r14), %edx
leaq 0x387ad(%rip), %rcx     # 0x3d100
movb (%rcx,%rax,4), %cl
shll %cl, %edx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x41d0
movl %eax, %ebp
movl 0x18(%r12,%r13), %edi
movzbl 0x1(%r14), %esi
callq 0x214ec
testq %rax, %rax
je 0x4992
movslq %ebp, %rcx
addq %rcx, %rbx
leaq 0x1db81(%rip), %rsi     # 0x22506
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x41d0
movl $0x3, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mikebdp2[P]AtomDis/main.c
// Function: op_1x8
int op_1x8 (uint8_t *d, char *out) {
    const optab_t *op = &optable[d[0]];
    const char    *ind;
    out += sprintf (out, "%-5s  ", op->name);
    out += sprintf (out, addrtypes [op->desttype],
		    d[1] << addrtypes_shift [op->desttype]);
    if ( (ind = get_index (op->destindex, d[1])) )
	out += sprintf (out, "  (%s)", ind);
    return 2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
movzbl (%rdi), %r12d
shll $0x5, %r12d
leaq 0x3540a(%rip), %r13     # 0x39dd0
movq 0x8(%r12,%r13), %rdx
leaq 0x1d9a4(%rip), %rsi     # 0x22376
movq %r15, %rdi
xorl %eax, %eax
callq 0x41d0
movslq %eax, %rbx
addq %r15, %rbx
movslq 0x10(%r12,%r13), %rax
leaq 0x37792(%rip), %rcx     # 0x3c180
movq (%rcx,%rax,8), %rsi
movzbl 0x1(%r14), %edx
leaq 0x38702(%rip), %rcx     # 0x3d100
movb (%rcx,%rax,4), %cl
shll %cl, %edx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x41d0
movl %eax, %ebp
movl 0x18(%r12,%r13), %edi
movzbl 0x1(%r14), %esi
callq 0x214ec
testq %rax, %rax
je 0x4a3d
movslq %ebp, %rcx
addq %rcx, %rbx
leaq 0x1dad6(%rip), %rsi     # 0x22506
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x41d0
movl $0x2, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mikebdp2[P]AtomDis/main.c
// Function: op_dest
int op_dest (uint8_t *d, char *out) {
    const optab_t *op = &optable[d[0]];
    uint8_t *t    = d+1;
    int      attr = *t++;
    out += sprintf  (out, "%-5s  ", op->name);
    t   += sub_src (t, out, op->desttype, (attr & 0x38) >> 3, size_align[(attr & 0x38)>>3], op->destindex);
    return t - d;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movzbl (%rdi), %r13d
shll $0x5, %r13d
leaq 0x3535f(%rip), %rbp     # 0x39dd0
leaq 0x2(%rdi), %r14
movzbl 0x1(%rdi), %r12d
movq 0x8(%r13,%rbp), %rdx
leaq 0x1d8f0(%rip), %rsi     # 0x22376
movq %r15, %rdi
xorl %eax, %eax
callq 0x41d0
movslq %eax, %rsi
addq %r15, %rsi
movl 0x10(%r13,%rbp), %edx
shrl $0x3, %r12d
andl $0x7, %r12d
leaq 0x1d596(%rip), %rax     # 0x22040
movl (%rax,%r12,4), %r8d
movl 0x18(%r13,%rbp), %r9d
movq %r14, %rdi
movl %r12d, %ecx
callq 0x4f97
addl %r14d, %eax
subl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mikebdp2[P]AtomDis/main.c
// Function: op_sdb
int op_sdb (uint8_t *d, char *out) {
    const optab_t *op = &optable[d[0]];
    const char    *ind;
    out += sprintf (out, "%-5s  ", op->name);
    out += sprintf (out, addrtypes [op->desttype],
		    d[1] << addrtypes_shift [op->desttype]);
    if (d[1] == 0xff)
	out += sprintf (out, "  (this table)");
    else if ( (ind = get_index (op->destindex, d[1])) )
	out += sprintf (out, "  (%s)", ind);
    return 2;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movzbl (%rdi), %r12d
shll $0x5, %r12d
leaq 0x35192(%rip), %r13     # 0x39dd0
movq 0x8(%r12,%r13), %rdx
leaq 0x1d72c(%rip), %rsi     # 0x22376
movq %r14, %rdi
xorl %eax, %eax
callq 0x41d0
movslq %eax, %r15
addq %r14, %r15
movslq 0x10(%r12,%r13), %rax
leaq 0x3751a(%rip), %rcx     # 0x3c180
movq (%rcx,%rax,8), %rsi
movzbl 0x1(%rbx), %edx
leaq 0x3848b(%rip), %rcx     # 0x3d100
movb (%rcx,%rax,4), %cl
shll %cl, %edx
movq %r15, %rdi
xorl %eax, %eax
callq 0x41d0
movslq %eax, %r14
addq %r15, %r14
movzbl 0x1(%rbx), %esi
cmpl $0xff, %esi
je 0x4cbd
addq %r12, %r13
movl 0x18(%r13), %edi
callq 0x214ec
testq %rax, %rax
je 0x4cd8
leaq 0x1d858(%rip), %rsi     # 0x22506
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x41d0
jmp 0x4cd8
movabsq $0x29656c62617420, %rax # imm = 0x29656C62617420
movq %rax, 0x7(%r14)
movabsq $0x2073696874282020, %rax # imm = 0x2073696874282020
movq %rax, (%r14)
movl $0x2, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/mikebdp2[P]AtomDis/main.c
// Function: op_ds
int op_ds (uint8_t *d, char *out) {
    const optab_t *op = &optable[d[0]];
    uint16_t size = *(uint16_t *) &d[1];
    /* Multiline, because even the hexdump typically needs lots of space */
    out += sprintf (out, "\n                          %-5s  %d bytes", op->name, size);
    return size + 3;
}

// Assembly:
pushq %rbx
movq %rsi, %rax
movzbl (%rdi), %ecx
movzwl 0x1(%rdi), %ebx
shll $0x5, %ecx
leaq 0x350d4(%rip), %rdx     # 0x39dd0
movq 0x8(%rcx,%rdx), %rdx
leaq 0x1d608(%rip), %rsi     # 0x22310
movq %rax, %rdi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x41d0
addl $0x3, %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/mikebdp2[P]AtomDis/main.c
// Function: get_pointers
bios_tables_t *get_pointers (uint8_t *data)
{
    static bios_tables_t tabs;		/* FIXME: */

    tabs.base = data;
    tabs.AtomRomHeader = (ATOM_ROM_HEADER *) (data + *(uint16_t *) (data + OFFSET_TO_POINTER_TO_ATOM_ROM_HEADER));
    if (strcmp ((char *) tabs.AtomRomHeader->uaFirmWareSignature, "ATOM") != 0) {
	fprintf (stderr, "No AtomBIOS\n");
	exit (1);
    }
    tabs.MasterCommandTables = (uint16_t *)
	& ((ATOM_MASTER_COMMAND_TABLE *)
	   (data + tabs.AtomRomHeader->usMasterCommandTableOffset))
	->ListOfCommandTables;
    tabs.MasterDataTables    = (uint16_t *)
	& ((ATOM_MASTER_DATA_TABLE *)
	   (data + tabs.AtomRomHeader->usMasterDataTableOffset))
	->ListOfDataTables;
    
    return &tabs;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rdi, 0x38407(%rip)     # 0x3d130
movzwl 0x48(%rdi), %eax
leaq (%rdi,%rax), %r14
movq %r14, 0x38400(%rip)     # 0x3d138
addq %rax, %rdi
addq $0x4, %rdi
leaq 0x1d591(%rip), %rsi     # 0x222d7
callq 0x4130
testl %eax, %eax
jne 0x4d84
movzwl 0x1e(%r14), %eax
addq %rbx, %rax
addq $0x4, %rax
movq %rax, 0x383de(%rip)     # 0x3d140
leaq 0x383c7(%rip), %rax     # 0x3d130
movzwl 0x20(%r14), %ecx
addq %rbx, %rcx
addq $0x4, %rcx
movq %rcx, 0x383cc(%rip)     # 0x3d148
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x4230
// File: /workspace/github_c_makefile_star2_O1/mikebdp2[P]AtomDis/main.c
// Function: get_table_offset
int get_table_offset(uint16_t *table, int idx) {
    int i, last = 0, offset = 0;
    static int wrapwarning = 0;

    if (! table || ! table[idx])
	return 0;

    for (i = 0; i <= idx; i++) {
	int off = table[i];
	if (off) {
	    if (off < last)
		offset += 0x10000;
	    last = off - 0x8000;
	}
    }

    if (offset && ! wrapwarning++)
	printf ("*** Wrap around of table offset - assuming offset\n");
    return table[idx] + offset;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
xorl %ebp, %ebp
testq %rdi, %rdi
je 0x4e05
movq %rdi, %rbx
movslq %esi, %r14
cmpw $0x0, (%rdi,%r14,2)
je 0x4e05
testl %esi, %esi
js 0x4dd9
incl %esi
xorl %eax, %eax
xorl %edx, %edx
xorl %ecx, %ecx
movzwl (%rbx,%rax,2), %edi
leal 0x10000(%rdx), %ebp
cmpl %edi, %ecx
cmovlel %edx, %ebp
leal -0x8000(%rdi), %r8d
testl %edi, %edi
cmovnel %r8d, %ecx
cmovel %edx, %ebp
incq %rax
movl %ebp, %edx
cmpq %rax, %rsi
jne 0x4dae
jmp 0x4ddb
xorl %ebp, %ebp
testl %ebp, %ebp
je 0x4dfe
movl 0x3836b(%rip), %eax     # 0x3d150
leal 0x1(%rax), %ecx
movl %ecx, 0x38362(%rip)     # 0x3d150
testl %eax, %eax
jne 0x4dfe
leaq 0x1dca2(%rip), %rdi     # 0x22a9b
callq 0x4060
movzwl (%rbx,%r14,2), %eax
addl %eax, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mikebdp2[P]AtomDis/main.c
// Function: sub_dest
int sub_dest (uint8_t *d, char *out, int type, int align, int size, int index) {
    uint32_t    val;
    int         r;
    const char *ind;
    switch (type) {
    case D_REG:
	val  = *((uint16_t *) d);
	r    = 2;
	break;
    case D_ID:  case D_IM:
	out += sprintf (out, "<internal - illegal addrtype %s>", addrnames [type]);
	val  = 0;
	r    = 0;
	break;
    default:
	val = *d;
	r   = 1;
    }
    if (type == D_WS && (ind = get_index (INDEX_WORK_REG, val)) )
	out += sprintf (out, "%s", ind);
    else if (r)
	out += sprintf (out, addrtypes [type], val << addrtypes_shift[type]);
    switch (size) {
    case 1:
	out += sprintf (out, " [%s]", align_byte[align]);
	break;
    case 2:
	out += sprintf (out, " [%s]", align_word[align]);
	break;
    case 4:
	out += sprintf (out, " [%s]", align_long[align]);
	break;
    }
    if (type == D_REG && (ind = get_index (last_reg_index, val+last_reg_offset)) )
	out += sprintf (out, "  (%s)", ind);
    if (r && (ind = get_index (index, val)) )
	out += sprintf (out, "  (%s)", ind);
    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, 0x4(%rsp)
movl %r8d, %ebp
movl %ecx, %r13d
movl %edx, %r12d
movq %rsi, %rbx
leal -0x4(%r12), %eax
cmpl $0x2, %eax
jae 0x4e65
movslq %r12d, %rax
leaq 0x372e4(%rip), %rcx     # 0x3c120
movq (%rcx,%rax,8), %rdx
leaq 0x1d4a2(%rip), %rsi     # 0x222e9
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x41d0
cltq
addq %rax, %rbx
movb $0x1, %r14b
movl $0x0, (%rsp)
jmp 0x4e85
testl %r12d, %r12d
jne 0x4e77
movzwl (%rdi), %r15d
movl $0x2, (%rsp)
jmp 0x4e82
movzbl (%rdi), %r15d
movl $0x1, (%rsp)
xorl %r14d, %r14d
cmpl $0x2, %r12d
jne 0x4eae
movl $0x4, %edi
movl %r15d, %esi
callq 0x214ec
testq %rax, %rax
je 0x4eae
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4080
subl %ebx, %eax
cltq
jmp 0x4edc
testb %r14b, %r14b
jne 0x4edf
movslq %r12d, %rax
leaq 0x372c3(%rip), %rcx     # 0x3c180
movq (%rcx,%rax,8), %rsi
leaq 0x38238(%rip), %rcx     # 0x3d100
movb (%rcx,%rax,4), %cl
movl %r15d, %edx
shll %cl, %edx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x41d0
cltq
addq %rax, %rbx
cmpl $0x1, %ebp
je 0x4f00
cmpl $0x4, %ebp
je 0x4ef7
cmpl $0x2, %ebp
jne 0x4f24
leaq 0x3737b(%rip), %rax     # 0x3c270
jmp 0x4f07
leaq 0x37392(%rip), %rax     # 0x3c290
jmp 0x4f07
leaq 0x37349(%rip), %rax     # 0x3c250
movslq %r13d, %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x1d3f5(%rip), %rsi     # 0x2230a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x41d0
cltq
addq %rax, %rbx
testl %r12d, %r12d
jne 0x4f5b
movl 0x38225(%rip), %edi     # 0x3d154
movl 0x38223(%rip), %esi     # 0x3d158
addl %r15d, %esi
callq 0x214ec
testq %rax, %rax
je 0x4f5b
leaq 0x1d5bd(%rip), %rsi     # 0x22506
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x41d0
cltq
addq %rax, %rbx
testb %r14b, %r14b
jne 0x4f85
movl 0x4(%rsp), %edi
movl %r15d, %esi
callq 0x214ec
testq %rax, %rax
je 0x4f85
leaq 0x1d58e(%rip), %rsi     # 0x22506
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x41d0
movl (%rsp), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mikebdp2[P]AtomDis/main.c
// Function: sub_src
int sub_src (uint8_t *d, char *out, int type, int align, int size, int index) {
    uint32_t    val;
    int         r;
    const char *ind;
    switch (type) {
    case D_IM:
	r = size;
	break;
    case D_PS:  case D_WS:  case D_FB:  case D_PLL:  case D_MC:
	r = 1;
	break;
    case D_REG:  case D_ID:
	r = 2;
    }
    switch (r) {
    case 1:
	val = *d;
	break;
    case 2:
	val = *(uint16_t *)d;
	break;
    case 4:
	val = *(uint32_t *)d;
	break;
    }
    if (type == D_IM) {
	out += sprintf (out, addrtypes_im [size], val);
    } else if (type == D_WS && (ind = get_index (INDEX_WORK_REG, val)) ) {
	out += sprintf (out, "%s", ind);
	out += sprintf (out, " [%s]", align_source[align]);
    } else {
	out += sprintf (out, addrtypes [type], val << addrtypes_shift [type]);
	out += sprintf (out, " [%s]", align_source[align]);
    }
    if (type == D_REG && (ind = get_index (last_reg_index, val+last_reg_offset)) )
	out += sprintf (out, "  (%s)", ind);
    if ( (ind = get_index (index, val)) )
	out += sprintf (out, "  (%s)", ind);
    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebp
movl %ecx, %r13d
movl %edx, %r15d
movq %rsi, %r12
movl %r8d, %ebx
cmpl $0x7, %edx
ja 0x4fd1
movl $0xdf, %eax
btl %r15d, %eax
movl %r8d, %ebx
jae 0x4fd1
movl %r15d, %eax
leaq 0x1db02(%rip), %rcx     # 0x22ad0
movl (%rcx,%rax,4), %ebx
cmpl $0x4, %ebx
je 0x4fec
cmpl $0x2, %ebx
je 0x4fe6
cmpl $0x1, %ebx
jne 0x4fef
movzbl (%rdi), %r14d
jmp 0x4fef
movzwl (%rdi), %r14d
jmp 0x4fef
movl (%rdi), %r14d
cmpl $0x2, %r15d
je 0x5018
cmpl $0x5, %r15d
jne 0x503c
movslq %r8d, %rax
leaq 0x371db(%rip), %rcx     # 0x3c1e0
movq (%rcx,%rax,8), %rsi
movq %r12, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x41d0
jmp 0x5087
movl $0x4, %edi
movl %r14d, %esi
callq 0x214ec
testq %rax, %rax
je 0x503c
movq %r12, %rdi
movq %rax, %rsi
callq 0x4080
subl %r12d, %eax
cltq
jmp 0x5065
movslq %r15d, %rax
leaq 0x3713a(%rip), %rcx     # 0x3c180
movq (%rcx,%rax,8), %rsi
leaq 0x380af(%rip), %rcx     # 0x3d100
movb (%rcx,%rax,4), %cl
movl %r14d, %edx
shll %cl, %edx
movq %r12, %rdi
xorl %eax, %eax
callq 0x41d0
cltq
addq %rax, %r12
movslq %r13d, %rax
leaq 0x3719e(%rip), %rcx     # 0x3c210
movq (%rcx,%rax,8), %rdx
leaq 0x1d28d(%rip), %rsi     # 0x2230a
movq %r12, %rdi
xorl %eax, %eax
callq 0x41d0
movslq %eax, %r13
addq %r12, %r13
testl %r15d, %r15d
jne 0x50c4
movl 0x380bc(%rip), %edi     # 0x3d154
movl 0x380ba(%rip), %esi     # 0x3d158
addl %r14d, %esi
callq 0x214ec
testq %rax, %rax
je 0x50c4
leaq 0x1d454(%rip), %rsi     # 0x22506
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x41d0
cltq
addq %rax, %r13
movl %ebp, %edi
movl %r14d, %esi
callq 0x214ec
testq %rax, %rax
je 0x50e7
leaq 0x1d42c(%rip), %rsi     # 0x22506
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x41d0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mikebdp2[P]AtomDis/main.c
// Function: do_info
void do_info (bios_tables_t *tabs)
{
    fprintf (stdout,
	     "Table Format Rev.   %02x\n"
	     "Table Content Rev.  %02x\n"
	     "BIOS Boot Message:  '%s'\n"
	     "Subsystem Vendor ID %04x\n"
	     "Subsystem ID        %04x\n\n",
	     tabs->AtomRomHeader->sHeader.ucTableFormatRevision,
	     tabs->AtomRomHeader->sHeader.ucTableContentRevision,
	     (char *) (tabs->base + tabs->AtomRomHeader->usBIOS_BootupMessageOffset),
	     tabs->AtomRomHeader->usSubsystemVendorID,
	     tabs->AtomRomHeader->usSubsystemID);
}

// Assembly:
pushq %rax
movq 0x36ec0(%rip), %rax     # 0x3bfc0
movq (%rax), %rax
movq 0x8(%rdi), %rsi
movzbl 0x2(%rsi), %edx
movzbl 0x3(%rsi), %ecx
movzwl 0x10(%rsi), %r8d
addq (%rdi), %r8
movzwl 0x18(%rsi), %r9d
movzwl 0x1a(%rsi), %esi
movl %esi, (%rsp)
leaq 0x1d298(%rip), %rsi     # 0x223c2
movq %rax, %rdi
xorl %eax, %eax
callq 0x4150
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/mikebdp2[P]AtomDis/main.c
// Function: do_tableinfo
int do_tableinfo (uint8_t *data, int off, int type, int nr)
{
    int size, frev, crev;
    const char *ind;

    if (! data)
	return 0;

    size = * (uint16_t *) (data+off);
    frev = *              (data+off+2);
    crev = *              (data+off+3);
    ind  = get_index (type, nr);

    fprintf (stdout, "%s  %08x", index_tables[type].name, off);
    if (nr >= 0)
	fprintf (stdout, "  #%02x  (%s)", nr, ind ? ind:"<unknown>");
    fputs (":\n\n", stdout);

    if (off)
	fprintf (stdout, "  Size         %04x\n", size);
    
    if (off && size)
	fprintf (stdout,
		 "  Format Rev.  %02x\n"
		 "  Param Rev.   %02x\n"
		 "  Content Rev. %02x\n",
		 frev & 0x0f, frev >> 4, crev);

    if (type == INDEX_COMMAND_TABLE && size) {
	int attr = * (uint16_t *) (data+off+4);
	fprintf (stdout,
		 "  Attributes:  Work space size        %02x longs\n"
		 "               Parameter space size   %02x longs\n"
		 "               Table update indicator %x\n",
		 (attr & 0xff) >> 2, (attr & 0x7f00) >> (8+2), attr >> 15);
    }
    putc ('\n', stdout);
    
    return size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rdi, %rdi
je 0x545b
movl %ecx, %r13d
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %r14
movslq %esi, %r15
movzwl (%rdi,%r15), %eax
movl %eax, 0x14(%rsp)
movzbl 0x2(%rdi,%r15), %eax
movl %eax, 0xc(%rsp)
movzbl 0x3(%rdi,%r15), %eax
movl %eax, 0x10(%rsp)
movl %edx, %edi
movl %ecx, %esi
callq 0x214ec
movq %rax, %rbx
movq 0x36c62(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
movslq %ebp, %rax
leaq (%rax,%rax,2), %rax
leaq 0x37c71(%rip), %rcx     # 0x3cfe0
movq (%rcx,%rax,8), %rdx
leaq 0x1d17c(%rip), %rsi     # 0x224f6
movl %r15d, %ecx
xorl %eax, %eax
callq 0x4150
testl %r13d, %r13d
js 0x53b2
movq 0x36c30(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
testq %rbx, %rbx
leaq 0x1d170(%rip), %rcx     # 0x2250d
cmovneq %rbx, %rcx
leaq 0x1d157(%rip), %rsi     # 0x224ff
movl %r13d, %edx
xorl %eax, %eax
callq 0x4150
movq 0x36c07(%rip), %r13     # 0x3bfc0
movq (%r13), %rsi
leaq 0x1d6d3(%rip), %rdi     # 0x22a97
callq 0x40c0
testl %r12d, %r12d
movl 0x14(%rsp), %ebx
je 0x53e6
movq (%r13), %rdi
leaq 0x1d13a(%rip), %rsi     # 0x22517
movl %ebx, %edx
xorl %eax, %eax
callq 0x4150
testl %r12d, %r12d
je 0x5413
testw %bx, %bx
je 0x5413
movq (%r13), %rdi
movl 0xc(%rsp), %ecx
movl %ecx, %edx
andl $0xf, %edx
shrl $0x4, %ecx
leaq 0x1d125(%rip), %rsi     # 0x2252c
movl 0x10(%rsp), %r8d
xorl %eax, %eax
callq 0x4150
cmpl $0x1, %ebp
jne 0x544b
testw %bx, %bx
je 0x544b
movzwl 0x4(%r14,%r15), %r8d
movq (%r13), %rdi
movl %r8d, %edx
shrl $0x2, %edx
andl $0x3f, %edx
movl %r8d, %ecx
shrl $0xa, %ecx
andl $0x1f, %ecx
shrl $0xf, %r8d
leaq 0x1d125(%rip), %rsi     # 0x22569
xorl %eax, %eax
callq 0x4150
movq (%r13), %rsi
movl $0xa, %edi
callq 0x4140
jmp 0x545d
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mikebdp2[P]AtomDis/main.c
// Function: do_dump
void do_dump (uint8_t *data, int start, int end)
{
    int i, j;

    for (i = start & -16; i < end; i += 16) {
	fprintf (stdout, "  %08x: ", i);
	for (j = i; j < i+16; j++) {
	    if (j >= start && j < end)
		fprintf (stdout, "%02x", data[j]);
	    else
		fputs ("  ", stdout);
	    if ((j & 1) == 1)
		putc (' ', stdout);
	    if ((j & 3) == 3)
		putc (' ', stdout);
	}
	fputs ("  ", stdout);
	for (j = i; j < i+16; j++) {
	    if (j >= start && j < end) {
		if (isprint (data[j]))
		    putc (data[j], stdout);
		else
		    putc ('.', stdout);
	    } else
		putc (' ', stdout);
	}
	putc ('\n', stdout);
    }
    putc ('\n', stdout);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, (%rsp)
movl %esi, %eax
andl $-0x10, %eax
cmpl %edx, %eax
jge 0x558d
movslq %eax, %r13
movslq %edx, %rbp
movslq %esi, %r14
movq 0x36b26(%rip), %r15     # 0x3bfc0
movq (%r15), %rdi
leaq 0x1d151(%rip), %rsi     # 0x225f5
movl %r13d, %edx
xorl %eax, %eax
callq 0x4150
leaq 0x10(%r13), %rbx
movq %r13, %r12
cmpq %r14, %r12
setl %al
cmpq %rbp, %r12
setge %cl
movq (%r15), %rsi
orb %al, %cl
jne 0x54e4
movq (%rsp), %rax
movzbl (%rax,%r12), %edx
movq %rsi, %rdi
leaq 0x1ce7b(%rip), %rsi     # 0x22356
xorl %eax, %eax
callq 0x4150
jmp 0x54f0
leaq 0x1ceb0(%rip), %rdi     # 0x2239b
callq 0x40c0
testb $0x1, %r12b
je 0x5503
movq (%r15), %rsi
movl $0x20, %edi
callq 0x4140
movl %r12d, %eax
notl %eax
testb $0x3, %al
jne 0x5519
movq (%r15), %rsi
movl $0x20, %edi
callq 0x4140
incq %r12
cmpq %rbx, %r12
jl 0x54b5
movq (%r15), %rsi
leaq 0x1ce70(%rip), %rdi     # 0x2239b
callq 0x40c0
cmpq %r14, %r13
setl %al
cmpq %rbp, %r13
setge %cl
movl $0x20, %edi
orb %al, %cl
jne 0x5564
callq 0x4210
movq (%rax), %rcx
movq (%rsp), %rax
movzbl (%rax,%r13), %eax
testb $0x40, 0x1(%rcx,%rax,2)
movl $0x2e, %edi
je 0x5564
movl %eax, %edi
movq (%r15), %rsi
callq 0x4140
incq %r13
cmpq %rbx, %r13
jl 0x5530
movq (%r15), %rsi
movl $0xa, %edi
callq 0x4140
movq %rbx, %r13
cmpq %rbp, %rbx
jl 0x549a
movq 0x36a2c(%rip), %rax     # 0x3bfc0
movq (%rax), %rsi
movl $0xa, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4140
// File: /workspace/github_c_makefile_star2_O1/mikebdp2[P]AtomDis/main.c
// Function: do_data
void do_data (uint8_t *data, int off, int nr)
{
    int len;
    const char *comment = NULL;
    int frev = data[off+2];
    int crev = data[off+3];
    data_dumper_t *dt = get_data_dumper (nr, &frev, &crev, &comment);

    if (! dt)
	return;
    if (frev == 0)
	fprintf (stdout, "  NOTE: General revisionless dumper only.\n");
    else if (frev != data[off+2] || crev != data[off+3])
	fprintf (stdout, "  NOTE: Dumper revision differs.   "
		 "Used:   Format Rev. %02x  Content Rev. %02x\n", frev, crev);
    if (comment)
	fprintf (stdout, "  NOTE: %s\n", comment);
    if (frev == 0 || frev != data[off+2] || crev != data[off+3] || comment)
	fputs ("\n", stdout);
    len = (*dt) (data+off, data+off, 1);
    fprintf (stdout, "\n  Total data structure size:  %04x\n\n", len);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %eax
movq %rdi, %rbx
leaq 0x8(%rsp), %rcx
movq $0x0, (%rcx)
movslq %esi, %r15
movzbl 0x2(%rdi,%r15), %edx
leaq 0x4(%rsp), %rsi
movl %edx, (%rsi)
movzbl 0x3(%rdi,%r15), %edi
movq %rsp, %rdx
movl %edi, (%rdx)
movl %eax, %edi
callq 0x21471
testq %rax, %rax
je 0x56d1
movq %rax, %r14
addq %r15, %rbx
movl 0x4(%rsp), %edx
testl %edx, %edx
je 0x5630
movzbl 0x2(%rbx), %eax
cmpl %eax, %edx
jne 0x5613
movzbl 0x3(%rbx), %eax
cmpl %eax, (%rsp)
je 0x5650
movq 0x369a6(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
movl (%rsp), %ecx
leaq 0x1d002(%rip), %rsi     # 0x22629
xorl %eax, %eax
callq 0x4150
jmp 0x5650
movq 0x36989(%rip), %rax     # 0x3bfc0
movq (%rax), %rcx
leaq 0x1cfbd(%rip), %rdi     # 0x225fe
movl $0x2a, %esi
movl $0x1, %edx
callq 0x41f0
movq 0x8(%rsp), %rdx
testq %rdx, %rdx
je 0x5672
movq 0x3695f(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
leaq 0x1d00e(%rip), %rsi     # 0x22679
xorl %eax, %eax
callq 0x4150
movl 0x4(%rsp), %eax
testl %eax, %eax
je 0x5693
movzbl 0x2(%rbx), %ecx
cmpl %ecx, %eax
jne 0x5693
movzbl 0x3(%rbx), %eax
cmpl %eax, (%rsp)
jne 0x5693
cmpq $0x0, 0x8(%rsp)
je 0x56a9
movq 0x36926(%rip), %rax     # 0x3bfc0
movq (%rax), %rsi
leaq 0x1d3f5(%rip), %rdi     # 0x22a99
callq 0x40c0
movq %rbx, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq *%r14
movq 0x36902(%rip), %rcx     # 0x3bfc0
movq (%rcx), %rdi
leaq 0x1cfbd(%rip), %rsi     # 0x22685
movl %eax, %edx
xorl %eax, %eax
callq 0x4150
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq