LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: asm_put
uint32_t asm_put(asm_dict_t *d, const char *name, uint64_t len, uint64_t gap, uint32_t n, uint32_t s, uint32_t gn, 
        uint32_t *gs, uint32_t *gsize, uint32_t *gcomp, uint32_t *gtype, uint32_t *glink, uint32_t *gevid)
{
    if (!name) 
        return UINT32_MAX;
    sdhash_t *h;
    khint_t k;
    int absent;

    h = d->h;
    k = kh_put(sdict, h, name, &absent);
    if (absent) {
        sd_aseq_t *a;
        if (d->n == d->m) {
            d->m = d->m? d->m<<1 : 16;
            d->s = (sd_aseq_t *) realloc(d->s, d->m * sizeof(sd_aseq_t));
        }
        a = &d->s[d->n];
        a->len = len;
        a->gap = gap;
        a->n = n;
        a->s = s;
        a->gn = gn;
        a->gs = memcpy1(gs, sizeof(uint32_t) * gn);
        a->gsize = memcpy1(gsize, sizeof(uint32_t) * gn);
        a->gcomp = memcpy1(gcomp, sizeof(uint32_t) * gn);
        a->gtype = memcpy1(gtype, sizeof(uint32_t) * gn);
        a->glink = memcpy1(glink, sizeof(uint32_t) * gn);
        a->gevid = memcpy1(gevid, sizeof(uint32_t) * gn);
        kh_key(h, k) = a->name = strdup(name);
        kh_val(h, k) = d->n++;
    }
    return kh_val(h, k);
}

// Assembly:
testq %rsi, %rsi
je 0x48a6
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r12
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %rbx
movl %r8d, 0xc(%rsp)
movl %r9d, 0x10(%rsp)
movq 0x10(%rdi), %r14
leaq 0x24(%rsp), %r13
movq %r14, %rdi
movq %r13, %rdx
callq 0x3f3b
cmpl $0x0, (%r13)
je 0x48aa
movl %eax, 0x14(%rsp)
movq 0x68(%rsp), %rdi
movl 0x60(%rsp), %esi
movl (%rbx), %eax
cmpl 0x4(%rbx), %eax
movq %r14, 0x18(%rsp)
jne 0x48b8
leal (%rax,%rax), %ecx
testl %eax, %eax
pushq $0x10
popq %rax
cmovnel %ecx, %eax
movl %eax, 0x4(%rbx)
movq %rdi, %r14
movq 0x8(%rbx), %rdi
movl %esi, %r13d
imulq $0x58, %rax, %rsi
callq 0x2290
movl %r13d, %esi
movq %r14, %rdi
movq %rax, %r13
movq %rax, 0x8(%rbx)
movl (%rbx), %eax
jmp 0x48bc
pushq $-0x1
popq %rax
retq
movq 0x20(%r14), %rdx
movl %eax, %ecx
movl (%rdx,%rcx,4), %eax
jmp 0x4986
movq 0x8(%rbx), %r13
movl 0x10(%rsp), %ecx
movl 0xc(%rsp), %edx
movl %eax, %eax
imulq $0x58, %rax, %r14
movq %rbp, 0x8(%r13,%r14)
movq %r12, 0x10(%r13,%r14)
movl %edx, 0x18(%r13,%r14)
movl %ecx, 0x1c(%r13,%r14)
movl %esi, 0x20(%r13,%r14)
movl %esi, %r12d
shlq $0x2, %r12
movq %r12, %rsi
callq 0x4995
movq %rax, 0x28(%r13,%r14)
movq 0x70(%rsp), %rdi
movq %r12, %rsi
callq 0x4995
movq %rax, 0x30(%r13,%r14)
movq 0x78(%rsp), %rdi
movq %r12, %rsi
callq 0x4995
movq %rax, 0x38(%r13,%r14)
movq 0x80(%rsp), %rdi
movq %r12, %rsi
callq 0x4995
movq %rax, 0x40(%r13,%r14)
movq 0x88(%rsp), %rdi
movq %r12, %rsi
callq 0x4995
movq %rax, 0x48(%r13,%r14)
movq 0x90(%rsp), %rdi
movq %r12, %rsi
callq 0x4995
movq %rax, 0x50(%r13,%r14)
movq %r15, %rdi
callq 0x23b0
movq %rax, (%r13,%r14)
movq 0x18(%rsp), %rsi
movq 0x18(%rsi), %rcx
movl 0x14(%rsp), %edx
movq %rax, (%rcx,%rdx,8)
movl (%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, (%rbx)
movq 0x20(%rsi), %rcx
movl %eax, (%rcx,%rdx,4)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: seg_put
void seg_put(asm_dict_t *d, uint32_t s, uint32_t k, uint64_t a, uint64_t b,
        uint32_t c, uint32_t x, uint32_t y, uint32_t t, uint32_t r)
{
    if (d->u == d->v) {
        d->v = d->v? d->v<<1 : 16;
        d->seg = (sd_seg_t *) realloc(d->seg, d->v * sizeof(sd_seg_t));
    }
    sd_seg_t seg = {s, k, a, b, c, x, y, t, r};
    d->seg[d->u++] = seg;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebx
movq %r8, %r14
movq %rcx, %r15
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %r13
movl 0x58(%rsp), %esi
movl 0x50(%rsp), %edi
movl 0x48(%rsp), %r8d
movl 0x40(%rsp), %r9d
movl 0x18(%r13), %ecx
cmpl 0x1c(%r13), %ecx
jne 0x4a55
leal (%rcx,%rcx), %eax
testl %ecx, %ecx
pushq $0x10
popq %rcx
cmovnel %eax, %ecx
movl %ecx, 0x1c(%r13)
movq 0x20(%r13), %rdi
imulq $0x30, %rcx, %rsi
callq 0x2290
movl 0x40(%rsp), %r9d
movl 0x48(%rsp), %r8d
movl 0x50(%rsp), %edi
movl 0x58(%rsp), %esi
movq %rax, 0x20(%r13)
movl 0x18(%r13), %ecx
jmp 0x4a59
movq 0x20(%r13), %rax
leal 0x1(%rcx), %edx
movl %edx, 0x18(%r13)
movl %ecx, %ecx
imulq $0x30, %rcx, %rcx
movl %r12d, (%rax,%rcx)
movl %ebp, 0x4(%rax,%rcx)
movq %r15, 0x8(%rax,%rcx)
movq %r14, 0x10(%rax,%rcx)
movl %ebx, 0x18(%rax,%rcx)
movl %r9d, 0x1c(%rax,%rcx)
movl %r8d, 0x20(%rax,%rcx)
movl %edi, 0x24(%rax,%rcx)
movl %esi, 0x28(%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: make_asm_dict_from_sdict
asm_dict_t *make_asm_dict_from_sdict(sdict_t *sdict)
{
    uint32_t i;
    asm_dict_t *d;
    d = asm_init(sdict);
    d->index = (uint64_t *) calloc(sdict->n, sizeof(uint64_t));
    uint64_t *a = d->a;
    for (i = 0; i < sdict->n; ++i) {
        asm_put(d, sdict->s[i].name, sdict->s[i].len, 0, 1, i, 0, 0, 0, 0, 0, 0, 0);
        seg_put(d, i, 0, 0, 0, i<<1, 0, sdict->s[i].len, DEFAULT_AGP_SEQ_COMPONENT_TYPE, AGP_OT_PLUS);
        a[i] = (uint64_t) i << 32 | 1;
        d->index[i] = (uint64_t) sdict->s[i].len << 32 | i;
    }
    return d;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0x3ca3
movq %rax, %r14
movl (%rbx), %ebp
pushq $0x8
popq %r15
movq %rbp, %rdi
movq %r15, %rsi
callq 0x21d0
movq %rax, 0x30(%r14)
movq %r14, 0x8(%rsp)
movq 0x28(%r14), %rax
movq %rax, 0x10(%rsp)
pushq $0x1
popq %r14
xorl %r12d, %r12d
xorl %r13d, %r13d
movl %ebp, %eax
cmpq %rax, %r13
jae 0x4ba0
movq 0x8(%rbx), %rax
movq -0x10(%rax,%r15,2), %rsi
movl (%rax,%r15,2), %edx
subq $0x40, %rsp
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rsp)
movups %xmm0, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
andl $0x0, (%rsp)
movq 0x48(%rsp), %rbp
movq %rbp, %rdi
xorl %ecx, %ecx
pushq $0x1
popq %r8
movl %r13d, %r9d
callq 0x4813
addq $0x40, %rsp
movq 0x8(%rbx), %rax
movl (%rax,%r15,2), %eax
movl 0x86e2(%rip), %r10d     # 0xd220
movq %rbp, %rdi
movl %r13d, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movl %r12d, %r9d
pushq $0x2b5d0                # imm = 0x2B5D0
pushq %r10
pushq %rax
pushq $0x0
callq 0x49e5
addq $0x20, %rsp
movq 0x10(%rsp), %rax
movq %r14, (%rax,%r13,8)
movq 0x8(%rbx), %rax
movl (%rax,%r15,2), %eax
shlq $0x20, %rax
addq %r13, %rax
movq 0x30(%rbp), %rcx
movq %rax, (%rcx,%r13,8)
incq %r13
movl (%rbx), %ebp
addq $0xc, %r15
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r14
addl $0x2, %r12d
jmp 0x4ae3
movq 0x8(%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: asm_index
void asm_index(asm_dict_t *d)
{
    int32_t i, s, c;
    uint64_t *a, last;
    sd_seg_t seg;

    s = d->u;
    if (s == 0) return;

    c_pair_t *c_pairs;
    c_pairs = (c_pair_t *) malloc(s * sizeof(c_pair_t));
    for(i = 0; i < s; ++i) {
        seg = d->seg[i];
        c_pairs[i].x = (uint64_t) seg.c >> 1 << 32 | (seg.x + seg.y);
        c_pairs[i].y = (uint64_t) (seg.x + seg.y) << 32 | i;
    }

    radix_sort_pair(c_pairs, c_pairs + s);
    
    if (d->index)
        free(d->index);
    d->index = (uint64_t *) malloc(s * sizeof(uint64_t));
    a = d->a;
    memset(a, 0, sizeof(uint64_t) * d->sdict->n);
    d->index[0] = c_pairs[0].y;
    c = c_pairs[0].x >> 32;
    for (i = 1, last = 0; i < s; ++i) {
        d->index[i] = c_pairs[i].y;
        if (c != c_pairs[i].x >> 32) {
            a[c] = last << 32 | (i - last);
            last = i;
            c = c_pairs[i].x >> 32;
        }
    }
    a[c] = last << 32 | (i - last);

    free(c_pairs);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movslq 0x18(%rdi), %r12
testq %r12, %r12
je 0x4ef6
movq %rdi, %r14
movq %r12, %r15
shlq $0x4, %r15
movq %r15, %rdi
callq 0x2250
movq %rax, %rbx
xorl %eax, %eax
testl %r12d, %r12d
movl $0x0, %ecx
cmovgl %r12d, %ecx
leaq 0x8(%rbx), %rdx
pushq $0x20
popq %rsi
cmpq %rax, %rcx
je 0x4e43
movq 0x20(%r14), %rdi
movl -0x8(%rdi,%rsi), %r8d
movl (%rdi,%rsi), %r9d
shrl %r8d
shlq $0x20, %r8
addl -0x4(%rdi,%rsi), %r9d
orq %r9, %r8
movq %r8, -0x8(%rdx)
shlq $0x20, %r9
addq %rax, %r9
movq %r9, (%rdx)
incq %rax
addq $0x10, %rdx
addq $0x30, %rsi
jmp 0x4e07
addq %rbx, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4da9
movq 0x30(%r14), %rdi
callq 0x2050
leaq (,%r12,8), %rdi
callq 0x2250
movq %rax, 0x30(%r14)
movq 0x28(%r14), %r15
movq 0x38(%r14), %rax
movl (%rax), %edx
shlq $0x3, %rdx
xorl %r13d, %r13d
movq %r15, %rdi
xorl %esi, %esi
callq 0x2160
movq 0x8(%rbx), %rax
movq 0x30(%r14), %rcx
movq %rax, (%rcx)
movl 0x4(%rbx), %esi
movq %rbx, %rdx
addq $0x10, %rdx
pushq $0x1
popq %rax
movslq %esi, %rdi
cmpq %r12, %rax
jge 0x4ed7
movq 0x8(%rdx), %r8
movq %r8, (%rcx,%rax,8)
movl 0x4(%rdx), %r8d
cmpq %rdi, %r8
je 0x4ece
movq %rax, %rsi
subq %r13, %rsi
shlq $0x20, %r13
orq %rsi, %r13
movq %r13, (%r15,%rdi,8)
movl 0x4(%rdx), %esi
movq %rax, %r13
incq %rax
addq $0x10, %rdx
jmp 0x4e9e
subq %r13, %rax
shlq $0x20, %r13
orq %rax, %r13
movq %r13, (%r15,%rdi,8)
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2050
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: add_unplaced_short_seqs
void add_unplaced_short_seqs(asm_dict_t *d, uint32_t min_len)
{
    uint32_t i;
    sdict_t *sdict;
    
    sdict = d->sdict;
    for (i = 0; i < sdict->n; ++i) {
        if (sdict->s[i].len >= min_len)
            continue;
        seg_put(d, d->n, 0, 0, 0, i<<1, 0, sdict->s[i].len, DEFAULT_AGP_SEQ_COMPONENT_TYPE, AGP_OT_PLUS);
        asm_put(d, sdict->s[i].name, sdict->s[i].len, 0, 1, d->u - 1, 0, 0, 0, 0, 0, 0, 0);
    }
    asm_index(d);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq 0x38(%rdi), %r12
pushq $0x8
popq %r13
xorl %r14d, %r14d
xorl %r15d, %r15d
movl (%r12), %eax
cmpq %rax, %r15
jae 0x5bb4
movq 0x8(%r12), %rax
movl (%rax,%r13,2), %eax
cmpl %ebp, %eax
jae 0x5ba4
movl (%rbx), %esi
movl 0x76dd(%rip), %r10d     # 0xd220
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movl %r14d, %r9d
pushq $0x2b5d0                # imm = 0x2B5D0
pushq %r10
pushq %rax
pushq $0x0
callq 0x49e5
addq $0x20, %rsp
movq 0x8(%r12), %rax
movq -0x10(%rax,%r13,2), %rsi
movl (%rax,%r13,2), %edx
movl 0x18(%rbx), %r9d
decl %r9d
subq $0x40, %rsp
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rsp)
movups %xmm0, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
andl $0x0, (%rsp)
movq %rbx, %rdi
xorl %ecx, %ecx
pushq $0x1
popq %r8
callq 0x4813
addq $0x40, %rsp
incq %r15
addq $0xc, %r13
addl $0x2, %r14d
jmp 0x5b20
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4dc7
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: sd_coordinate_conversion
int sd_coordinate_conversion(asm_dict_t *d, uint32_t id, uint32_t pos, uint32_t *s, uint64_t *p, int count_gap)
{
    *s = UINT32_MAX;
    *p = UINT64_MAX;

    if (id >= d->sdict->n)
        return SEQ_NOT_FOUND;

    uint32_t i, n;
    uint64_t *index = d->index;
    i = (uint32_t) (d->a[id] >> 32);
    n = (uint32_t) (d->a[id]) + i;

    while (i < n && index[i]>>32 <= pos)
        ++i;
    if (i == n)
        return POS_NOT_IN_RANGE;

    sd_seg_t *seg = &d->seg[(uint32_t) index[i]];
    if (pos < seg->x || pos >= seg->x + seg->y)
        return POS_NOT_IN_RANGE;

    uint64_t offset = count_gap? seg->b : seg->a;
    *s = seg->s;
    *p = seg->c & 1? offset + seg->x + seg->y - 1 - pos : offset + pos - seg->x;

    return CC_SUCCESS;
}

// Assembly:
pushq %rbx
orl $-0x1, (%rcx)
orq $-0x1, (%r8)
movq 0x38(%rdi), %rax
cmpl %esi, (%rax)
jbe 0x5c0e
movq 0x28(%rdi), %rax
movq 0x30(%rdi), %r10
movl %esi, %esi
movq (%rax,%rsi,8), %r11
movq %r11, %rax
shrq $0x20, %rax
addl %eax, %r11d
movl %edx, %esi
cmpl %eax, %r11d
movl %r11d, %ebx
cmovbel %eax, %ebx
cmpq %r11, %rax
jae 0x5c17
cmpl %esi, 0x4(%r10,%rax,8)
ja 0x5c15
incq %rax
jmp 0x5bfd
movl $0x1, %eax
jmp 0x5c7f
movl %eax, %ebx
movl $0x2, %eax
cmpl %r11d, %ebx
je 0x5c7f
movq 0x20(%rdi), %rdi
movl %ebx, %r11d
movl (%r10,%r11,8), %r10d
imulq $0x30, %r10, %r11
movl 0x1c(%rdi,%r11), %r10d
cmpl %edx, %r10d
ja 0x5c7f
addq %r11, %rdi
addl 0x20(%rdi), %r10d
cmpl %edx, %r10d
jbe 0x5c7f
xorl %eax, %eax
testl %r9d, %r9d
setne %al
movq 0x8(%rdi,%rax,8), %rax
movl (%rdi), %edx
movl %edx, (%rcx)
testb $0x1, 0x18(%rdi)
jne 0x5c68
addq %rsi, %rax
movl 0x1c(%rdi), %ecx
subq %rcx, %rax
jmp 0x5c7a
movl 0x1c(%rdi), %ecx
movl 0x20(%rdi), %edx
addq %rcx, %rdx
notq %rsi
addq %rsi, %rax
addq %rdx, %rax
movq %rax, (%r8)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: sd_coordinate_rev_conversion
int sd_coordinate_rev_conversion(asm_dict_t *d, uint32_t id, uint64_t pos, uint32_t *s, uint32_t *p, int count_gap)
{
    *s = UINT32_MAX;
    *p = UINT32_MAX;

    if (id >= d->n)
        return SEQ_NOT_FOUND;

    sd_seg_t *seg = d->seg + d->s[id].s;
    uint32_t i = 0, n = d->s[id].n;
    uint64_t offset = 0;

    if (count_gap) {
        while (i < n && pos >= seg[i].b)
            ++i;
        seg = &seg[i-1];
        offset = pos - seg->b;
    } else {
        while (i < n && pos >= seg[i].a)
            ++i;
        seg = &seg[i-1];
        offset = pos - seg->a;
    }
    
    // check if in gap or exceeds seq length
    if (offset >= seg->y)
        return POS_NOT_IN_RANGE;

    *s = seg->c >> 1;
    *p = seg->c & 1? seg->y - 1 - offset : seg->x + offset;

    return CC_SUCCESS;
}

// Assembly:
orl $-0x1, (%rcx)
orl $-0x1, (%r8)
cmpl %esi, (%rdi)
jbe 0x5ccc
movq 0x8(%rdi), %rax
movq 0x20(%rdi), %r10
movl %esi, %esi
imulq $0x58, %rsi, %rsi
movl 0x18(%rax,%rsi), %edi
movl 0x1c(%rax,%rsi), %eax
imulq $0x30, %rax, %rsi
leaq (%r10,%rsi), %rax
testl %r9d, %r9d
je 0x5cd0
leaq (%rsi,%r10), %r9
addq $0x10, %r9
xorl %esi, %esi
cmpq %rsi, %rdi
je 0x5ced
cmpq %rdx, (%r9)
ja 0x5cf1
incq %rsi
addq $0x30, %r9
jmp 0x5cb9
pushq $0x1
jmp 0x5d32
leaq (%rsi,%r10), %r9
addq $0x8, %r9
xorl %esi, %esi
cmpq %rsi, %rdi
je 0x5cf5
cmpq %rdx, (%r9)
ja 0x5cfd
incq %rsi
addq $0x30, %r9
jmp 0x5cda
pushq $0x10
jmp 0x5cf7
pushq $0x10
jmp 0x5cff
pushq $0x8
popq %r9
movl %edi, %esi
jmp 0x5d01
pushq $0x8
popq %r9
decl %esi
imulq $0x30, %rsi, %rdi
leaq (%rax,%rdi), %rsi
subq (%r9,%rsi), %rdx
movl 0x20(%rax,%rdi), %eax
cmpq %rax, %rdx
jae 0x5d30
movl 0x18(%rsi), %eax
shrl %eax
movl %eax, (%rcx)
testb $0x1, 0x18(%rsi)
jne 0x5d34
movl 0x1c(%rsi), %eax
addq %rax, %rdx
movq %rdx, %rax
jmp 0x5d3c
pushq $0x2
popq %rax
retq
movl 0x20(%rsi), %eax
decl %eax
subq %rdx, %rax
movl %eax, (%r8)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: sd_stats
void sd_stats(sdict_t *d, uint64_t *n_stats, uint32_t *l_stats)
{
    // n_stats and l_stats are of at least size 10
    uint32_t i, n;
    uint64_t *s;

    n = d->n;
    s = (uint64_t *) calloc(n, sizeof(uint64_t));
    for (i = 0; i < n; ++i)
        s[i] = d->s[i].len;
    nl_stats(s, n, n_stats, l_stats);
    
    free(s);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movl (%rdi), %r15d
pushq $0x8
popq %rsi
movq %r15, %rdi
callq 0x21d0
movq %rax, %r13
leaq (%r15,%r15,2), %rax
xorl %ecx, %ecx
movq %r13, %rdx
cmpq %rcx, %rax
je 0x5d9a
movq 0x8(%r12), %rsi
movl 0x10(%rsi,%rcx,8), %esi
movq %rsi, (%rdx)
addq $0x3, %rcx
addq $0x8, %rdx
jmp 0x5d7f
movq %r13, %rdi
movl %r15d, %esi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x5dbc
movq %r13, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: nl_stats
static void nl_stats(uint64_t *s, uint32_t n, uint64_t *n_stats, uint32_t *l_stats)
{
    uint32_t i, j;
    double b, a, bs;
    
    bs = 0;
    for (i = 0; i < n; ++i)
        bs += s[i];

    qsort(s, n, sizeof(uint64_t), cmp_uint64_d);

    b = 0;
    j = 0;
    a = .1 * (++j) * bs;
    for (i = 0; i < n; ++i) {
        b += s[i];
        while (b >= a) {
            l_stats[j - 1] = i + 1;
            n_stats[j - 1] = s[i];
            a = .1 * (++j) * bs;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
movl %esi, %r12d
xorpd %xmm2, %xmm2
xorl %eax, %eax
cmpq %rax, %r12
je 0x5e05
movsd (%r15,%rax,8), %xmm0
unpcklps 0x3518(%rip), %xmm0     # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x3520(%rip), %xmm0     # 0x9310
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
addsd %xmm1, %xmm2
incq %rax
jmp 0x5dd6
leaq -0xca(%rip), %rcx       # 0x5d42
pushq $0x8
popq %rdx
movq %r15, %rdi
movq %r12, %rsi
movsd %xmm2, (%rsp)
callq 0x20b0
movapd 0x34e9(%rip), %xmm7     # 0x9310
movq 0x34d1(%rip), %xmm6     # 0x9300
movsd (%rsp), %xmm5
movsd 0x34e4(%rip), %xmm2     # 0x9320
mulsd %xmm5, %xmm2
xorpd %xmm0, %xmm0
pushq $0x1
popq %rax
xorl %ecx, %ecx
movsd 0x34cf(%rip), %xmm1     # 0x9320
cmpq %r12, %rcx
je 0x5e9b
movq (%r15,%rcx,8), %rdx
movq %rdx, %xmm3
punpckldq %xmm6, %xmm3    # xmm3 = xmm3[0],xmm6[0],xmm3[1],xmm6[1]
subpd %xmm7, %xmm3
movapd %xmm3, %xmm4
unpckhpd %xmm3, %xmm4            # xmm4 = xmm4[1],xmm3[1]
addsd %xmm3, %xmm4
addsd %xmm4, %xmm0
incq %rcx
ucomisd %xmm2, %xmm0
jb 0x5e51
leal -0x1(%rax), %esi
movl %ecx, (%rbx,%rsi,4)
movq %rdx, (%r14,%rsi,8)
incl %eax
cvtsi2sd %rax, %xmm2
mulsd %xmm1, %xmm2
mulsd %xmm5, %xmm2
jmp 0x5e7a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: write_sorted_agp
void write_sorted_agp(asm_dict_t *dict, FILE *fo)
{
    int i, j;
    uint32_t s;
    char s_name[32];
    c_pair_t *c_pairs;

    c_pairs = (c_pair_t *) malloc(dict->n * sizeof(c_pair_t));
    for(i = 0; i < dict->n; ++i) {
        c_pair_t pair = {dict->s[i].len, i};
        c_pairs[i] = pair;
    }
    radix_sort_pair(c_pairs, c_pairs + dict->n);
    s = 0;
    for (i = dict->n - 1; i >= 0; --i) {
        j = c_pairs[i].y;
        sprintf(s_name, "scaffold_%u", ++s);
        write_segs_to_agp(dict->seg + dict->s[j].s, dict->s[j].n, &dict->s[j], dict->sdict, s_name, fo);
    }
    free(c_pairs);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, 0x8(%rsp)
movq %rdi, %r14
movl (%rdi), %r13d
movq %r13, %r12
shlq $0x4, %r12
movq %r12, %rdi
callq 0x2250
movq %rax, %r15
addq $0x8, %rax
pushq $0x8
popq %rcx
xorl %edx, %edx
cmpq %rdx, %r13
je 0x6c5d
movq 0x8(%r14), %rsi
movq (%rsi,%rcx), %rsi
movq %rsi, -0x8(%rax)
movq %rdx, (%rax)
incq %rdx
addq $0x10, %rax
addq $0x58, %rcx
jmp 0x6c3c
movq %r15, %rsi
addq %r12, %rsi
movq %r15, %rdi
callq 0x4da9
movl (%r14), %r12d
decq %r12
pushq $0x1
popq %rbp
leaq 0x10(%rsp), %r13
testl %r12d, %r12d
js 0x6cd6
movl %r12d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
shlq $0x4, %rax
movslq 0x8(%r15,%rax), %rbx
movq %r13, %rdi
leaq 0x2b2c(%rip), %rsi      # 0x97c5
movl %ebp, %edx
xorl %eax, %eax
callq 0x2350
imulq $0x58, %rbx, %rax
movq 0x8(%r14), %rdi
movq 0x38(%r14), %rcx
leaq (%rdi,%rax), %rdx
movl 0x18(%rdi,%rax), %esi
movl 0x1c(%rdi,%rax), %eax
imulq $0x30, %rax, %rdi
addq 0x20(%r14), %rdi
movq %r13, %r8
movq 0x8(%rsp), %r9
callq 0x6423
decq %r12
incl %ebp
jmp 0x6c79
movq %r15, %rdi
callq 0x2050
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: write_sdict_to_agp
void write_sdict_to_agp(sdict_t *sdict, FILE *fo)
{
    int i;
    for (i = 0; i < sdict->n; ++i)
        fprintf(fo, "scaffold_%u\t1\t%u\t1\t%s\t%s\t1\t%u\t+\n", i + 1, sdict->s[i].len, 
                agp_component_type_val(DEFAULT_AGP_SEQ_COMPONENT_TYPE), sdict->s[i].name, sdict->s[i].len);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x10
popq %r13
leaq 0x2ac8(%rip), %r15      # 0x97d1
xorl %r12d, %r12d
movl (%r14), %eax
cmpq %rax, %r12
jae 0x6d55
incq %r12
movq 0x8(%r14), %rax
movl (%rax,%r13), %ebp
movl 0x64fb(%rip), %edi      # 0xd220
callq 0x6d64
movq 0x8(%r14), %rcx
movq -0x10(%rcx,%r13), %r9
movl (%rcx,%r13), %ecx
movl %ecx, (%rsp)
movq %rbx, %rdi
movq %r15, %rsi
movl %r12d, %edx
movl %ebp, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0x2200
addq $0x18, %r13
jmp 0x6d0c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/./agp-spec.h
// Function: agp_component_type_val
static inline const char *agp_component_type_val(uint32_t key)
{
    switch ((AGP_CT_t) key) {
        case AGP_CT_A: return "A";
        case AGP_CT_D: return "D";
        case AGP_CT_F: return "F";
        case AGP_CT_G: return "G";
        case AGP_CT_O: return "O";
        case AGP_CT_P: return "P";
        case AGP_CT_W: return "W";
        case AGP_CT_N: return "N";
        case AGP_CT_U: return "U";
        default:       AGPSpec_die("[E::%s] AGP component type KEY error: %u\n", __func__, key);
    }
    return 0;
}

// Assembly:
movl %edi, %edx
leal -0x2b609(%rdx), %eax
cmpl $0x13, %eax
ja 0x6d89
leaq 0x2534(%rip), %rcx      # 0x92ac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x2af5(%rip), %rax      # 0x987d
retq
cmpl $0x2b606, %edx          # imm = 0x2B606
jne 0x6dd1
leaq 0x2ae3(%rip), %rax      # 0x987b
retq
leaq 0x2ae7(%rip), %rax      # 0x9887
retq
leaq 0x2885(%rip), %rax      # 0x962d
retq
leaq 0x2acf(%rip), %rax      # 0x987f
retq
leaq 0x2873(%rip), %rax      # 0x962b
retq
leaq 0x2ac5(%rip), %rax      # 0x9885
retq
leaq 0x2abb(%rip), %rax      # 0x9883
retq
leaq 0x2ab1(%rip), %rax      # 0x9881
retq
pushq %rax
leaq 0x2ee9(%rip), %rdi      # 0x9cc2
leaq 0x2f0c(%rip), %rsi      # 0x9cec
xorl %eax, %eax
callq 0x7c5b
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: write_asm_dict_to_fasta
uint64_t write_asm_dict_to_fasta(asm_dict_t *dict, int line_wd, FILE *fo)
{
    uint32_t i;
    uint64_t len = 0;
    for (i = 0; i < dict->n; ++i)
        len += write_segs_to_fasta(dict->seg + dict->s[i].s, dict->s[i].n, 
                &dict->s[i], dict->sdict, 0, line_wd, fo);
    return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
xorl %r12d, %r12d
xorl %r13d, %r13d
xorl %r15d, %r15d
movl (%r14), %eax
cmpq %rax, %r13
jae 0x72a2
movq 0x8(%r14), %rax
movq 0x38(%r14), %rcx
leaq (%rax,%r12), %rdx
movl 0x18(%rax,%r12), %esi
movl 0x1c(%rax,%r12), %eax
imulq $0x30, %rax, %rdi
addq 0x20(%r14), %rdi
movq %rbx, (%rsp)
xorl %r8d, %r8d
movl %ebp, %r9d
callq 0x6de7
addq %rax, %r15
incq %r13
addq $0x58, %r12
jmp 0x7261
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: write_fasta_file_from_agp
void write_fasta_file_from_agp(const char *fa, const char *agp, FILE *fo, int line_wd, int allow_unknown_oris)
{
    sdict_t *sdict = make_sdict_from_fa(fa, 0);
    asm_dict_t *dict = make_asm_dict_from_agp(sdict, agp, allow_unknown_oris);
    uint64_t len = write_asm_dict_to_fasta(dict, line_wd, fo);
    fprintf(stderr, "[I::%s] Number sequences: %u\n", __func__, dict->n);
    fprintf(stderr, "[I::%s] Number bases: %lu\n", __func__, len);
    asm_destroy(dict);
    sd_destroy(sdict);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movl %ecx, %r15d
movq %rdx, %r12
movq %rsi, %r14
xorl %esi, %esi
callq 0x429e
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x4f00
movq %rax, %r14
movq %rax, %rdi
movl %r15d, %esi
movq %r12, %rdx
callq 0x7245
movq %rax, %r15
movq 0x5cf3(%rip), %r13      # 0xcff0
movq (%r13), %rdi
movl (%r14), %ecx
leaq 0x251d(%rip), %rsi      # 0x9828
leaq 0x2534(%rip), %r12      # 0x9846
movq %r12, %rdx
xorl %eax, %eax
callq 0x2200
movq (%r13), %rdi
leaq 0x2539(%rip), %rsi      # 0x9860
movq %r12, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x2200
movq %r14, %rdi
callq 0x3d98
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3d02
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: write_sequence_dictionary
uint64_t write_sequence_dictionary(FILE *fo, sdict_t *dict)
{
    uint32_t i;
    uint64_t l;
    // write number of sequences
    fwrite(&dict->n, sizeof(uint32_t), 1, fo);
    // write sequence lengths
    for (i = 0; i < dict->n; ++i)
        fwrite(&dict->s[i].len, sizeof(uint32_t), 1, fo);
    l = dict->n;
    for (i = 0; i < dict->n; ++i)
        l += strlen(dict->s[i].name);
    // write total length of sequence names
    fwrite(&l, sizeof(uint64_t), 1, fo);
    // write sequence name with a appending white space
    const unsigned char space = ' ';
    for (i = 0; i < dict->n; ++i) {
        fwrite(dict->s[i].name, 1, strlen(dict->s[i].name), fo);
        fwrite(&space, 1, 1, fo);
    }

    return sizeof(uint32_t) * (dict->n + 3) + l;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x4
popq %rsi
pushq $0x1
popq %r12
movq %rbx, %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0x2380
pushq $0x10
popq %rbp
xorl %r15d, %r15d
movl (%rbx), %r13d
cmpq %r13, %r15
jae 0x73a4
movq 0x8(%rbx), %rdi
addq %rbp, %rdi
pushq $0x4
popq %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x2380
incq %r15
addq $0x18, %rbp
jmp 0x737e
imulq $0x18, %r13, %r15
xorl %r12d, %r12d
cmpq %r12, %r15
je 0x73c6
movq 0x8(%rbx), %rax
movq (%rax,%r12), %rdi
callq 0x2110
addq %rax, %r13
addq $0x18, %r12
jmp 0x73ab
movq %rsp, %rdi
movq %r13, (%rdi)
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x2380
xorl %r13d, %r13d
pushq $0x20
popq %rbp
xorl %r15d, %r15d
movl (%rbx), %eax
cmpq %rax, %r15
jae 0x741e
movq 0x8(%rbx), %rax
movq (%rax,%r13), %r12
movq %r12, %rdi
callq 0x2110
movq %r12, %rdi
pushq $0x1
popq %rsi
movq %rax, %rdx
movq %r14, %rcx
callq 0x2380
movl %ebp, %edi
movq %r14, %rsi
callq 0x21a0
incq %r15
addq $0x18, %r13
jmp 0x73e3
addl $0x3, %eax
shlq $0x2, %rax
addq (%rsp), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: file_seek_skip_sdict
void file_seek_skip_sdict(FILE *fp)
{
    uint32_t n;
    uint64_t l, m;
    m = fread(&n, sizeof(uint32_t), 1, fp);
    if (m != 1) bin_fread_error();
    fseek(fp, sizeof(uint32_t) * n, SEEK_CUR);
    m = fread(&l, sizeof(uint64_t), 1, fp);
    if (m != 1) bin_fread_error();
    fseek(fp, l, SEEK_CUR);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x4(%rsp), %rdi
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x20c0
cmpq $0x1, %rax
je 0x7460
xorl %eax, %eax
callq 0x27f6
movl 0x4(%rsp), %esi
shlq $0x2, %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x2270
leaq 0x8(%rsp), %rdi
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x20c0
cmpq $0x1, %rax
je 0x7493
xorl %eax, %eax
callq 0x27f6
movq 0x8(%rsp), %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
jmp 0x2270
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/./agp-spec.h
// Function: DJB_hash
static inline uint32_t DJB_hash(const char *str)
{
    uint32_t c, hash = 5381;
    while ((c = tolower(*str++)))
        hash = ((hash << 5) + hash) + c;
    return hash;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x23d0
movq (%rax), %rcx
movl $0x1505, %eax           # imm = 0x1505
movsbq (%rbx), %rdx
movl (%rcx,%rdx,4), %edx
testl %edx, %edx
je 0x7c1b
incq %rbx
imull $0x21, %eax, %eax
addl %eax, %edx
movl %edx, %eax
jmp 0x7c04
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/agp_to_fasta.c
// Function: print_help
static void print_help(FILE *fp_help)
{
    fprintf(fp_help, "Usage: agp_to_fasta [options] <scaffolds.agp> <contigs.fa>\n");
    fprintf(fp_help, "Options:\n");
    fprintf(fp_help, "    -l INT            line width [60]\n");
    fprintf(fp_help, "    -u                allow sequence components with unknown orientations\n");
    fprintf(fp_help, "    -o STR            output to file [stdout]\n");
    fprintf(fp_help, "    --version         show version number\n");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1a76(%rip), %rdi      # 0x9e22
pushq $0x3b
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
movq %rbx, %rcx
callq 0x2380
leaq 0x1a99(%rip), %rdi      # 0x9e5e
pushq $0x9
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x2380
leaq 0x1a8e(%rip), %rdi      # 0x9e68
pushq $0x26
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x2380
leaq 0x1aa0(%rip), %rdi      # 0x9e8f
pushq $0x4a
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x2380
leaq 0x1ad6(%rip), %rdi      # 0x9eda
pushq $0x2e
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x2380
leaq 0x1af0(%rip), %rdi      # 0x9f09
pushq $0x2a
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2380
// File: /workspace/github_c_makefile_star2_O2/giometti[P]mastering_UNIX_programming/chapter_09/scdu_modlut.c
// Function: mod_crypt
void mod_crypt(char *text, size_t n)
{
        int i;

	for (i = 0; i < n; i++) {
                if ((text[i] >= 'a') && (text[i] <= 'z'))
                        text[i] = lut[text[i] - 'a' + 26];
                else if ((text[i] >= 'A') && (text[i] <= 'Z'))
                        text[i] = lut[text[i] - 'A'];
                else
                        continue;
        }
}

// Assembly:
xorl %eax, %eax
movq 0x2fcf(%rip), %rcx      # 0x3ff8
cmpq %rax, %rsi
je 0x1059
movb (%rdi,%rax), %dl
leal -0x61(%rdx), %r8d
cmpb $0x19, %r8b
ja 0x1043
addb $0x39, %dl
andb $0x3f, %dl
jmp 0x104b
addb $-0x41, %dl
cmpb $0x19, %dl
ja 0x1054
movzbl %dl, %edx
movb (%rcx,%rdx), %dl
movb %dl, (%rdi,%rax)
incq %rax
jmp 0x1029
retq
// File: /workspace/github_c_makefile_star2_O2/giometti[P]mastering_UNIX_programming/chapter_09/scdu_modlut.c
// Function: mod_decrypt
void mod_decrypt(char *text, size_t n)
{
        int i;
	char *ptr;
	int base;

        for (i = 0; i < n; i++) {
		ptr = strchr(lut, text[i]);
		if (!ptr)
			continue;

        	base = ptr - lut;
		if (base < 26)
			text[i] = base + 'A';
		else if (base >= 26)
			text[i] = base - 26 + 'a';
        }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
movq 0x2f83(%rip), %r15      # 0x3ff8
pushq $0x41
popq %r13
pushq $0x47
popq %rbp
cmpq %r12, %rbx
je 0x10ad
movsbl (%r14,%r12), %esi
movq %r15, %rdi
callq 0x1010
testq %rax, %rax
je 0x10a8
subl 0x2f5f(%rip), %eax      # 0x3ff8
cmpl $0x1a, %eax
movl %ebp, %ecx
cmovll %r13d, %ecx
addb %al, %cl
movb %cl, (%r14,%r12)
incq %r12
jmp 0x107c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Joy-Division[P]tools-zoe/kojimasound/kojimasound.c
// Function: vagPrepareHeader
void vagPrepareHeader( vagHeader *header, uint32_t size, uint32_t samplerate ) {
	header->version[3] = 0x20;
	memset( header->name, 0, 0x10 );
	header->size[0] = (size >> 24) & 0xFF; header->size[1] = (size >> 16) & 0xFF; header->size[2] = (size >> 8) & 0xFF; header->size[3] = size & 0xFF;
	header->samplerate[0] = 0; header->samplerate[1] = 0; header->samplerate[2] = (samplerate >> 8) & 0xFF; header->samplerate[3] = samplerate & 0xFF;
	memset( header->reserved1, 0, 4 );
	memset( header->reserved2, 0, 12 );
	strncpy( header->magic, "VAGp", 4 );
	return;
}

// Assembly:
movl %esi, %eax
movb $0x20, 0x7(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movl %esi, %ecx
shrl $0x18, %ecx
movb %cl, 0xc(%rdi)
movl %esi, %ecx
shrl $0x10, %ecx
movb %cl, 0xd(%rdi)
movb %ah, 0xe(%rdi)
movb %al, 0xf(%rdi)
andw $0x0, 0x10(%rdi)
movb %dh, 0x12(%rdi)
movb %dl, 0x13(%rdi)
andl $0x0, 0x8(%rdi)
andq $0x0, 0x14(%rdi)
andl $0x0, 0x1c(%rdi)
movl $0x70474156, (%rdi)     # imm = 0x70474156
retq
// File: /workspace/github_c_makefile_star2_O2/Joy-Division[P]tools-zoe/wvx-extract.c
// Function: main
int main( int argc, char **argv ) {
	
	char dirname[512] = {0};
	unsigned char temp[4];
	unsigned int numSamples, tableSize, game;
	FILE *f;
	
	if( argc < 3 ) {
		printf("Not enough args!\nUse: %s WVX-file game\n", argv[0]);
		printf("supported games are:\n%d (MGS1)\n%d (ZoE1 and MGS2HD)\n", mgs1, zoe1);
		return 1;
	}
	
	game = strtoul(argv[2], NULL, 10);
	if(!(game<NUMWVXGAMES)) {
		printf("Unsupported game %d!\nRun without args to see supported types.\n", game);
		return 1;
	}
	
	if( !(f = fopen( argv[1], "rb" ))) {
		printf("Couldnt open file %s\n", argv[1]);
		return 1;
	}
	
	sprintf( dirname, "%s-Samples", argv[1] );
	createDirectory(dirname);
	fseek( f, 4, SEEK_SET );
	fread( temp, 4, 1, f );
	tableSize = temp[0] << 24 | temp[1] << 16 | temp[2] << 8 | temp[3];
	numSamples = tableSize/0x10;
	printf( "%d samples in sample table\n", numSamples );
	
	
	processWvx(f, 0, dirname, numSamples, game);
	
	printf("Done.\n");
	fclose(f);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x10(%rsp), %rdi
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x1080
cmpl $0x2, %ebp
jg 0x14f3
movq (%rbx), %rsi
leaq 0xbaa(%rip), %rdi       # 0x207c
xorl %eax, %eax
callq 0x1070
leaq 0xbc4(%rip), %rdi       # 0x20a4
pushq $0x1
popq %rbx
xorl %esi, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x1070
jmp 0x15e1
movq 0x10(%rbx), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x10b0
movq %rax, %r14
cmpl $0x2, %r14d
jae 0x15ba
movq 0x8(%rbx), %rdi
leaq 0xbff(%rip), %rsi       # 0x2118
callq 0x10a0
movq 0x8(%rbx), %rdx
testq %rax, %rax
je 0x15cd
movq %rax, %r15
leaq 0xbe6(%rip), %rsi       # 0x211b
xorl %ebx, %ebx
leaq 0x10(%rsp), %r12
movq %r12, %rdi
xorl %eax, %eax
callq 0x10c0
movq %r12, %rdi
movl $0x1ff, %esi            # imm = 0x1FF
callq 0x1030
pushq $0x4
popq %r13
movq %r15, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x1090
leaq 0xc(%rsp), %rbp
pushq $0x1
popq %rdx
movq %rbp, %rdi
movq %r13, %rsi
movq %r15, %rcx
callq 0x1050
movl (%rbp), %ebp
bswapl %ebp
shrl $0x4, %ebp
leaq 0xb9d(%rip), %rdi       # 0x2126
movl %ebp, %esi
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
movl %ebp, %ecx
movl %r14d, %r8d
callq 0x121e
leaq 0xb97(%rip), %rdi       # 0x2142
callq 0x1040
movq %r15, %rdi
callq 0x1060
jmp 0x15e1
leaq 0xb18(%rip), %rdi       # 0x20d9
movl %r14d, %esi
xorl %eax, %eax
callq 0x1070
jmp 0x15de
leaq 0xa70(%rip), %rdi       # 0x2044
movq %rdx, %rsi
xorl %eax, %eax
callq 0x1070
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/zpole[P]IICV/src/aib.c
// Function: main
int main()
{
    vl_uint32 nrows = 10;
    vl_uint32 ncols = 3;
    double Pic[3*10] = {
    0.6813,    0.3028,    0.8216,
    0.3795,    0.5417,    0.6449,
    0.8318,    0.1509,    0.8180,
    0.5028,    0.6979,    0.6602,
    0.7095,    0.3784,    0.3420,
    0.4289,    0.8600,    0.2897,
    0.3046,    0.8537,    0.3412,
    0.1897,    0.5936,    0.5341,
    0.1934,    0.4966,    0.7271,
    0.6822,    0.8998,    0.3093,
    };

    vl_uint32 r,c;
    VlAIB * aib;
    vl_uint * parents;

    printf("Pic = [");
    for(r=0; r<nrows; r++)
    {
        for(c=0; c<ncols; c++)
            printf("%f ", Pic[r*ncols+c]);
        printf("; ...\n");
    }
    printf("];\n");

    printf("AIB starting\n");
    {
      aib = vl_aib_new(Pic, nrows, ncols);
      vl_aib_process(aib);

      /*  parents always has size 2*nrows-1 */
      parents = vl_aib_get_parents(aib);
      for(r=0; r<2*nrows-1; r++)
        printf("%d => %d\n", r, parents[r]);

      vl_aib_delete(aib);
    }
    /* free(Pic); */

    printf("IB done\n");
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf0, %rsp
leaq 0xe6d(%rip), %rsi       # 0x2010
movq %rsp, %rbx
movl $0xf0, %edx
movq %rbx, %rdi
callq 0x1080
leaq 0xf46(%rip), %rdi       # 0x2100
xorl %r12d, %r12d
xorl %eax, %eax
callq 0x1050
leaq 0xf63(%rip), %r14       # 0x212e
leaq 0xf36(%rip), %r15       # 0x2108
cmpq $0xa, %r12
je 0x1207
xorl %r13d, %r13d
cmpq $0x3, %r13
je 0x11f6
movsd (%rbx,%r13,8), %xmm0
movq %r15, %rdi
movb $0x1, %al
callq 0x1050
incq %r13
jmp 0x11db
movq %r14, %rdi
callq 0x1040
incq %r12
addq $0x18, %rbx
jmp 0x11d2
leaq 0xf08(%rip), %rdi       # 0x2116
callq 0x1040
leaq 0xeff(%rip), %rdi       # 0x2119
callq 0x1040
movq %rsp, %rdi
pushq $0xa
popq %rsi
pushq $0x3
popq %rdx
callq 0x1060
movq %rax, %rbx
movq %rax, %rdi
callq 0x1030
movq 0x50(%rbx), %r12
leaq 0xec9(%rip), %r14       # 0x210c
xorl %r15d, %r15d
cmpq $0x13, %r15
je 0x1262
movl (%r12,%r15,4), %edx
movq %r14, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x1050
incq %r15
jmp 0x1246
movq %rbx, %rdi
callq 0x1070
leaq 0xeb5(%rip), %rdi       # 0x2126
callq 0x1040
xorl %eax, %eax
addq $0xf0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/hikalium[P]compilium/analyzer.c
// Function: Analyze
struct SymbolEntry *Analyze(struct Node *ast) {
  // Returns root context of symbols (including global vars)
  struct SymbolEntry *root_ctx = NULL;
  in_function = NULL;
  AnalyzeNode(ast, &root_ctx);
  return root_ctx;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0x8(%rsp), %rbx
andq $0x0, (%rbx)
andq $0x0, 0xefde(%rip)      # 0x112c0
movq %rbx, %rsi
callq 0x22f3
movq (%rbx), %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/hikalium[P]compilium/analyzer.c
// Function: AllocReg
static void AllocReg(struct Node *n) {
  assert(n);
  for (int i = 1; i <= NUM_OF_SCRATCH_REGS; i++) {
    if (!reg_used_table[i]) {
      reg_used_table[i] = 1;
      reg_node_table[i] = n;
      n->reg = i;
      return;
    }
  }
  fprintf(stderr, "\n**** Allocated regs ****\n");
  for (int i = 1; i <= NUM_OF_SCRATCH_REGS; i++) {
    fprintf(stderr, "reg[%d]:\n", i);
    if (reg_node_table[i]->op) {
      PrintTokenLine(reg_node_table[i]->op);
    } else {
      fprintf(stderr, "Op info not found\n");
    }
  }
  fprintf(stderr, "\n**** Tried to allocate reg for ****\n");
  PrintASTNode(n);
  ErrorWithToken(n->op, "No free registers found");
}

// Assembly:
pushq $0x1
popq %rax
leaq 0xe2a5(%rip), %rcx      # 0x112d0
cmpq $0xb, %rax
je 0x3052
cmpl $0x0, (%rcx,%rax,4)
je 0x303c
incq %rax
jmp 0x302b
movl $0x1, (%rcx,%rax,4)
leaq 0xe2b6(%rip), %rcx      # 0x11300
movq %rdi, (%rcx,%rax,8)
movl %eax, 0x4(%rdi)
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, (%rsp)
movq 0xdf90(%rip), %rbx      # 0x10ff8
movq (%rbx), %rcx
leaq 0x81e5(%rip), %rdi      # 0xb257
pushq $0x1a
popq %rsi
pushq $0x1
popq %rbp
movq %rbp, %rdx
callq 0x21b0
leaq 0x81eb(%rip), %r15      # 0xb272
leaq 0xe272(%rip), %r14      # 0x11300
pushq $0x12
popq %r13
movq %rbp, %r12
movq (%rbx), %rcx
cmpq $0xb, %rbp
je 0x30db
movq %rcx, %rdi
movq %r15, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x2110
movq (%r14,%rbp,8), %rax
movq 0x10(%rax), %rdi
testq %rdi, %rdi
jne 0x30d1
movq (%rbx), %rcx
leaq 0x81b8(%rip), %rdi      # 0xb27c
movq %r13, %rsi
movq %r12, %rdx
callq 0x21b0
jmp 0x30d6
callq 0x3cdb
incq %rbp
jmp 0x3095
leaq 0x81ad(%rip), %rdi      # 0xb28f
pushq $0x25
popq %rsi
pushq $0x1
popq %rdx
callq 0x21b0
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0x3598
movq 0x10(%rbx), %rdi
leaq 0x81b1(%rip), %rsi      # 0xb2b5
xorl %eax, %eax
callq 0x3de9
// File: /workspace/github_c_makefile_star2_O2/hikalium[P]compilium/ast.c
// Function: CreateASTBinOp
struct Node *CreateASTBinOp(struct Node *t, struct Node *left,
                            struct Node *right) {
  if (!right) ErrorWithToken(t, "Expected expression after binary operator");
  struct Node *op = AllocNode(kASTExpr);
  op->op = t;
  op->left = left;
  op->right = right;
  return op;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
testq %rdx, %rdx
je 0x31de
movq %rdx, %r14
movq %rsi, %r15
pushq $0x4
popq %rdi
callq 0x319d
movq %rbx, 0x10(%rax)
movq %r15, 0x18(%rax)
movq %r14, 0x20(%rax)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x8173(%rip), %rsi      # 0xb358
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3de9
// File: /workspace/github_c_makefile_star2_O2/hikalium[P]compilium/ast.c
// Function: CreateASTUnaryPrefixOp
struct Node *CreateASTUnaryPrefixOp(struct Node *t, struct Node *right) {
  if (!right) ErrorWithToken(t, "Expected expression after prefix operator");
  struct Node *op = AllocNode(kASTExpr);
  op->op = t;
  op->right = right;
  return op;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rsi, %rsi
je 0x3216
movq %rsi, %r14
pushq $0x4
popq %rdi
callq 0x319d
movq %rbx, 0x10(%rax)
movq %r14, 0x20(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x8165(%rip), %rsi      # 0xb382
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3de9
// File: /workspace/github_c_makefile_star2_O2/hikalium[P]compilium/ast.c
// Function: CreateASTUnaryPostfixOp
struct Node *CreateASTUnaryPostfixOp(struct Node *left, struct Node *t) {
  assert(IsToken(t));
  if (!left) ErrorWithToken(t, "Expected expression before prefix operator");
  struct Node *op = AllocNode(kASTExpr);
  op->op = t;
  op->left = left;
  return op;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x86a8
testb %al, %al
je 0x325a
testq %r14, %r14
je 0x3270
pushq $0x4
popq %rdi
callq 0x319d
movq %rbx, 0x10(%rax)
movq %r14, 0x18(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x814b(%rip), %rdi      # 0xb3ac
leaq 0x814f(%rip), %rsi      # 0xb3b7
pushq $0x27
popq %rdx
callq 0x3cc4
leaq 0x8146(%rip), %rsi      # 0xb3bd
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3de9
// File: /workspace/github_c_makefile_star2_O2/hikalium[P]compilium/ast.c
// Function: CreateASTExprStmt
struct Node *CreateASTExprStmt(struct Node *t, struct Node *left) {
  struct Node *op = AllocNode(kASTExprStmt);
  op->op = t;
  op->left = left;
  return op;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x7
popq %rdi
callq 0x319d
movq %r14, 0x10(%rax)
movq %rbx, 0x18(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/hikalium[P]compilium/ast.c
// Function: CreateASTFuncDef
struct Node *CreateASTFuncDef(struct Node *func_decl, struct Node *func_body) {
  assert(func_decl && func_decl->type == kASTDecl);
  assert(IsASTList(func_body));
  struct Node *n = AllocNode(kASTFuncDef);
  n->func_body = func_body;
  struct Node *type = CreateTypeFromDecl(func_decl);
  assert(type);
  n->func_name_token = type->left;
  assert(IsToken(n->func_name_token));
  n->func_type = GetTypeWithoutAttr(type);
  assert(n->func_type && n->func_type->type == kTypeFunction);
  return n;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x331b
movq %rdi, %r14
cmpl $0xd, (%rdi)
jne 0x331b
movq %rsi, %r15
testq %rsi, %rsi
je 0x332d
cmpl $0x6, (%r15)
jne 0x332d
pushq $0x10
popq %rdi
callq 0x319d
movq %rax, %rbx
movq %r15, 0xd0(%rax)
movq %r14, %rdi
callq 0x9aa3
testq %rax, %rax
je 0x3351
movq %rax, %r14
movq 0x18(%rax), %rdi
movq %rdi, 0xe0(%rbx)
callq 0x86a8
testb %al, %al
je 0x3363
movq %r14, %rdi
callq 0x9554
movq %rax, 0xd8(%rbx)
testq %rax, %rax
je 0x333f
cmpl $0x17, (%rax)
jne 0x333f
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x80c6(%rip), %rdi      # 0xb3e8
leaq 0x808e(%rip), %rsi      # 0xb3b7
pushq $0x37
jmp 0x3373
leaq 0x80dd(%rip), %rdi      # 0xb411
leaq 0x807c(%rip), %rsi      # 0xb3b7
pushq $0x38
jmp 0x3373
leaq 0x80fc(%rip), %rdi      # 0xb442
leaq 0x806a(%rip), %rsi      # 0xb3b7
pushq $0x40
jmp 0x3373
leaq 0x7cfe(%rip), %rdi      # 0xb056
leaq 0x8058(%rip), %rsi      # 0xb3b7
pushq $0x3c
jmp 0x3373
leaq 0x80bc(%rip), %rdi      # 0xb426
leaq 0x8046(%rip), %rsi      # 0xb3b7
pushq $0x3e
popq %rdx
callq 0x3cc4
// File: /workspace/github_c_makefile_star2_O2/hikalium[P]compilium/ast.c
// Function: CreateASTKeyValue
struct Node *CreateASTKeyValue(const char *key, struct Node *value) {
  struct Node *n = AllocNode(kASTKeyValue);
  n->key = key;
  n->value = value;
  return n;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x11
popq %rdi
callq 0x319d
movq %r14, 0x98(%rax)
movq %rbx, 0xa0(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/hikalium[P]compilium/ast.c
// Function: CreateASTLocalVar
struct Node *CreateASTLocalVar(int byte_offset, struct Node *var_type) {
  struct Node *n = AllocNode(kASTLocalVar);
  n->byte_offset = byte_offset;
  n->expr_type = var_type;
  return n;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
pushq $0x12
popq %rdi
callq 0x319d
movl %ebp, 0xa8(%rax)
movq %rbx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/hikalium[P]compilium/ast.c
// Function: CreateTypeFunction
struct Node *CreateTypeFunction(struct Node *return_type,
                                struct Node *arg_type_list) {
  assert(IsASTList(arg_type_list));
  struct Node *n = AllocNode(kTypeFunction);
  n->left = return_type;
  n->right = arg_type_list;
  return n;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x3424
movq %rsi, %rbx
cmpl $0x6, (%rsi)
jne 0x3424
movq %rdi, %r14
pushq $0x17
popq %rdi
callq 0x319d
movq %r14, 0x18(%rax)
movq %rbx, 0x20(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x804b(%rip), %rdi      # 0xb476
leaq 0x7f85(%rip), %rsi      # 0xb3b7
pushq $0x66
popq %rdx
callq 0x3cc4
// File: /workspace/github_c_makefile_star2_O2/hikalium[P]compilium/ast.c
// Function: CreateTypeStruct
struct Node *CreateTypeStruct(struct Node *tag_token,
                              struct Node *struct_spec) {
  assert(IsToken(tag_token));
  struct Node *n = AllocNode(kTypeStruct);
  n->tag = tag_token;
  n->type_struct_spec = struct_spec;
  return n;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x86a8
testb %al, %al
je 0x34b7
pushq $0x19
popq %rdi
callq 0x319d
movq %r14, 0xe8(%rax)
movq %rbx, 0xf0(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x7fff(%rip), %rdi      # 0xb4bd
leaq 0x7ef2(%rip), %rsi      # 0xb3b7
pushq $0x79
popq %rdx
callq 0x3cc4
// File: /workspace/github_c_makefile_star2_O2/hikalium[P]compilium/ast.c
// Function: CreateTypeAttrIdent
struct Node *CreateTypeAttrIdent(struct Node *ident_token, struct Node *type) {
  assert(ident_token && IsToken(ident_token));
  struct Node *n = AllocNode(kTypeAttrIdent);
  n->left = ident_token;
  n->right = type;
  return n;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x34fd
movq %rsi, %rbx
movq %rdi, %r14
callq 0x86a8
testb %al, %al
je 0x34fd
pushq $0x18
popq %rdi
callq 0x319d
movq %r14, 0x18(%rax)
movq %rbx, 0x20(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x7fcc(%rip), %rdi      # 0xb4d0
leaq 0x7eac(%rip), %rsi      # 0xb3b7
movl $0x81, %edx
callq 0x3cc4
// File: /workspace/github_c_makefile_star2_O2/hikalium[P]compilium/ast.c
// Function: CreateASTIdent
struct Node *CreateASTIdent(struct Node *ident) {
  assert(IsToken(ident));
  struct Node *n = AllocNode(kASTIdent);
  n->op = ident;
  return n;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x86a8
testb %al, %al
je 0x3530
pushq $0xa
popq %rdi
callq 0x319d
movq %rbx, 0x10(%rax)
popq %rbx
retq
leaq 0x7fbd(%rip), %rdi      # 0xb4f4
leaq 0x7e79(%rip), %rsi      # 0xb3b7
movl $0x89, %edx
callq 0x3cc4
// File: /workspace/github_c_makefile_star2_O2/hikalium[P]compilium/ast.c
// Function: CreateTypeArray
struct Node *CreateTypeArray(struct Node *type_of, struct Node *index_decl) {
  struct Node *n = AllocNode(kTypeArray);
  n->type_array_type_of = type_of;
  n->type_array_index_decl = index_decl;
  return n;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x1a
popq %rdi
callq 0x319d
movq %r14, 0xf8(%rax)
movq %rbx, 0x100(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq