LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/mFILE.c
// Function: mfgets
char *mfgets(char *s, int size, mFILE *mf) {
    int i;

    if (mf == m_channel[0]) init_mstdin();
    *s = 0;
    for (i = 0; i < size-1;) {
        if (mf->offset < mf->size) {
            s[i] = mf->data[mf->offset++];
            if (s[i++] == '\n')
                break;
        } else {
            mf->eof = 1;
            break;
        }
    }

    s[i] = 0;
    return i ? s : NULL;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
cmpq %rdx, 0x56a60(%rip)     # 0x9f0d0
jne 0x48677
callq 0x48505
movb $0x0, (%rbx)
cmpl $0x2, %ebp
pushq $0x1
popq %rax
cmovgel %ebp, %eax
decl %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x486bc
movq 0x28(%r14), %rdx
cmpq 0x20(%r14), %rdx
jae 0x486b2
movq 0x8(%r14), %rsi
leaq 0x1(%rdx), %rdi
movq %rdi, 0x28(%r14)
movb (%rsi,%rdx), %dl
movb %dl, (%rbx,%rcx)
incq %rcx
cmpb $0xa, %dl
jne 0x48687
jmp 0x486ba
movl $0x1, 0x18(%r14)
movl %ecx, %eax
movslq %eax, %rcx
movb $0x0, (%rbx,%rcx)
xorl %eax, %eax
testl %ecx, %ecx
cmovneq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/mFILE.c
// Function: mfascii
void mfascii(mFILE *mf) {
    size_t p1, p2;

    for (p1 = p2 = 1; p1 < mf->size; p1++, p2++) {
        if (mf->data[p1] == '\n' && mf->data[p1-1] == '\r') {
            p2--; /* delete the \r */
        }
        mf->data[p2] = mf->data[p1];
    }
    mf->size = p2;

    mf->offset = mf->flush_pos = 0;
}

// Assembly:
pushq $0x1
popq %rax
movq %rax, %rcx
cmpq 0x20(%rdi), %rax
jae 0x48705
movq 0x8(%rdi), %rdx
movb (%rdx,%rax), %sil
cmpb $0xa, %sil
jne 0x486f9
xorl %r8d, %r8d
cmpb $0xd, -0x1(%rdx,%rax)
sete %r8b
subq %r8, %rcx
movb %sil, (%rdx,%rcx)
incq %rax
incq %rcx
jmp 0x486d6
movq %rcx, 0x20(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rdi)
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/open_trace_file.c
// Function: find_file_url
mFILE *find_file_url(const char *file, char *url) {
    char *path = NULL, buf[8192];
    mFILE *mf = NULL;
    ssize_t len;
    hFILE *hf = NULL;

    /* Expand %s for the trace name.  Only one digit is allowed between
       The % and s to avoid ambiguity with percent-encoded URLs */

    path = expand_path(file, url, 1);
    if (!path)
        return NULL;

    if (!(hf = hopen(path, "r"))) {
        if (errno != ENOENT)
            hts_log_warning("Failed to open reference \"%s\": %s", path, strerror(errno));
        goto fail;
    }

    if (NULL == (mf = mfcreate(NULL, 0)))
        goto fail;
    while ((len = hread(hf, buf, sizeof(buf))) > 0) {
        if (mfwrite(buf, len, 1, mf) <= 0) {
            hclose_abruptly(hf);
            goto fail;
        }
    }
    if (hclose(hf) < 0 || len < 0) {
        hts_log_warning("Failed to read reference \"%s\": %s", path, strerror(errno));
        goto fail;
    }

    free(path);
    mrewind(mf);
    return mf;

 fail:
    mfdestroy(mf);
    free(path);
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2018, %rsp           # imm = 0x2018
pushq $0x1
popq %rdx
callq 0x48b4a
testq %rax, %rax
je 0x48b32
movq %rax, %rbx
leaq 0x31b45(%rip), %rsi     # 0x7a526
movq %rax, %rdi
xorl %eax, %eax
callq 0xe19b
testq %rax, %rax
je 0x48aa2
movq %rax, %r15
xorl %r14d, %r14d
xorl %edi, %edi
xorl %esi, %esi
callq 0x47e51
testq %rax, %rax
je 0x48b22
movq %rbx, 0x8(%rsp)
movq %rax, %r14
leaq 0x10(%rsp), %r12
movq 0x8(%r15), %r13
movq 0x10(%r15), %rbp
subq %r13, %rbp
movl $0x2000, %eax           # imm = 0x2000
cmpq %rax, %rbp
movl $0x2000, %ebx           # imm = 0x2000
cmovbq %rbp, %rbx
movq %r12, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x43c0
addq %rbx, %r13
movq %r13, 0x8(%r15)
movl $0x2000, %esi           # imm = 0x2000
cmpq $0x1fff, %rbp           # imm = 0x1FFF
ja 0x48a7d
testb $0x2, 0x30(%r15)
je 0x48a75
movl $0x2000, %edx           # imm = 0x2000
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rcx
callq 0xd55e
movq %rax, %rbp
testq %rbp, %rbp
jle 0x48ace
movq %rbp, %rsi
movq %r12, %rdi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x48549
testq %rax, %rax
jne 0x48a19
movq %r15, %rdi
callq 0xd94c
movq 0x8(%rsp), %rbx
jmp 0x48b22
callq 0x4050
movl (%rax), %edi
cmpl $0x2, %edi
jne 0x48ab3
xorl %r14d, %r14d
jmp 0x48b22
callq 0x4150
leaq 0x34cd3(%rip), %rsi     # 0x7d792
leaq 0x34cda(%rip), %rdx     # 0x7d7a0
xorl %r14d, %r14d
pushq $0x3
popq %rdi
jmp 0x48b15
movq %r15, %rdi
callq 0xd8ee
testq %rbp, %rbp
jne 0x48af3
testl %eax, %eax
js 0x48af3
movq 0x8(%rsp), %rdi
callq 0x45c0
movq %r14, %rdi
callq 0x4845a
jmp 0x48b35
callq 0x4050
movl (%rax), %edi
callq 0x4150
leaq 0x34c8c(%rip), %rsi     # 0x7d792
leaq 0x34cb5(%rip), %rdx     # 0x7d7c2
pushq $0x3
popq %rdi
movq 0x8(%rsp), %rbx
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x110c6
movq %r14, %rdi
callq 0x48380
movq %rbx, %rdi
callq 0x45c0
xorl %r14d, %r14d
movq %r14, %rax
addq $0x2018, %rsp           # imm = 0x2018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/open_trace_file.c
// Function: find_file_dir
static mFILE *find_file_dir(const char *file, char *dirname) {
    char *path;
    mFILE *mf = NULL;

    path = expand_path(file, dirname, INT_MAX);
    if (!path)
        return NULL;

    if (is_file(path))
        mf = mfopen(path, "rbm");

    free(path);
    return mf;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
callq 0x48b4a
testq %rax, %rax
je 0x48f4b
movq %rax, %rbx
movq %rax, %rdi
callq 0x4907c
testl %eax, %eax
je 0x48f50
leaq 0x348bf(%rip), %rsi     # 0x7d7fd
movq %rbx, %rdi
callq 0x48211
movq %rax, %r14
jmp 0x48f53
xorl %r14d, %r14d
jmp 0x48f5b
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x45c0
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/open_trace_file.c
// Function: find_path
char *find_path(const char *file, const char *path) {
    char *newsearch;
    char *ele;
    char *outpath = NULL;

    /* Use path first */
    if (!path)
        path = getenv("RAWDATA");
    if (NULL == (newsearch = tokenise_search_path(path)))
        return NULL;

    for (ele = newsearch; *ele; ele += strlen(ele)+1) {
        char *ele2 = (*ele == '|') ? ele+1 : ele;

        if (!strncmp(ele2, "URL=", 4) ||
            !strncmp(ele2, "http:", 5) ||
            !strncmp(ele2, "https:", 6) ||
            !strncmp(ele2, "ftp:", 4)) {
            continue;
        } else {
            outpath = expand_path(file, ele2, INT_MAX);
            if (is_file(outpath)) {
                free(newsearch);
                return outpath;
            } else {
                free(outpath);
            }
        }
    }

    free(newsearch);

    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
testq %rsi, %rsi
jne 0x48f8d
leaq 0x3485f(%rip), %rdi     # 0x7d7e4
callq 0x4600
movq %rax, %rsi
movq %rsi, %rdi
callq 0x48714
testq %rax, %rax
je 0x49068
leaq 0x34847(%rip), %r15     # 0x7d7ec
pushq $0x4
popq %r12
leaq 0x347c8(%rip), %r13     # 0x7d778
pushq $0x5
popq %rbp
movq %rax, 0x8(%rsp)
movq %rax, %r14
movb (%r14), %al
xorl %ebx, %ebx
testb %al, %al
je 0x4905c
cmpb $0x7c, %al
sete %bl
addq %r14, %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x4210
testl %eax, %eax
je 0x49049
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x4210
testl %eax, %eax
je 0x49049
movq %rbx, %rdi
leaq 0x34784(%rip), %rsi     # 0x7d782
pushq $0x6
popq %rdx
callq 0x4210
testl %eax, %eax
je 0x49049
movq %rbx, %rdi
leaq 0x34779(%rip), %rsi     # 0x7d78d
movq %r12, %rdx
callq 0x4210
testl %eax, %eax
je 0x49049
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
callq 0x48b4a
movq %rax, %rbx
movq %rax, %rdi
callq 0x4907c
testl %eax, %eax
jne 0x4905c
movq %rbx, %rdi
callq 0x45c0
movq %r14, %rdi
callq 0x41d0
addq %rax, %r14
incq %r14
jmp 0x48fbb
movq 0x8(%rsp), %rdi
callq 0x45c0
jmp 0x4906a
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/pooled_alloc.c
// Function: pool_create
pool_alloc_t *pool_create(size_t dsize) {
    pool_alloc_t *p;

    if (NULL == (p = (pool_alloc_t *)malloc(sizeof(*p))))
        return NULL;

    /* Minimum size is a pointer, for free list */
    dsize = (dsize + sizeof(void *) - 1) & ~(sizeof(void *)-1);
    if (dsize < sizeof(void *))
        dsize = sizeof(void *);
    p->dsize = dsize;
    p->psize = MIN(PSIZE, next_power_2(p->dsize*1024));

    p->npools = 0;
    p->pools = NULL;
    p->free  = NULL;

    return p;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
pushq $0x28
popq %rdi
callq 0x4680
movq %rax, %rbx
testq %rax, %rax
je 0x49105
addq $0x7, %r14
movq %r14, %rax
andq $-0x8, %rax
cmpq $0x8, %r14
pushq $0x8
popq %rdi
cmovaeq %rax, %rdi
movq %rdi, (%rbx)
shll $0xa, %edi
callq 0x49110
movl $0x100000, %ecx         # imm = 0x100000
cmpl %ecx, %eax
cmovll %eax, %ecx
movslq %ecx, %rax
movq %rax, 0x8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
andq $0x0, 0x20(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/pooled_alloc.c
// Function: next_power_2
static int next_power_2(unsigned int v) {
    v--;
    v |= v >> 1;
    v |= v >> 2;
    v |= v >> 4;
    v |= v >> 8;
    v |= v >> 16;
    v++;

    return v;
}

// Assembly:
leal -0x1(%rdi), %eax
movl %eax, %ecx
shrl %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x2, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x4, %ecx
orl %eax, %ecx
movl %ecx, %edx
shrl $0x8, %edx
orl %ecx, %edx
movl %edx, %eax
shrl $0x10, %eax
orl %edx, %eax
incl %eax
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/pooled_alloc.c
// Function: pool_destroy
void pool_destroy(pool_alloc_t *p) {
    size_t i;

    for (i = 0; i < p->npools; i++) {
        free(p->pools[i].pool);
    }
    free(p->pools);
    free(p);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x18(%rbx), %rdi
cmpq 0x10(%rbx), %r15
jae 0x49162
movq (%rdi,%r14), %rdi
callq 0x45c0
incq %r15
addq $0x10, %r14
jmp 0x49146
callq 0x45c0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x45c0
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/pooled_alloc.c
// Function: pool_alloc
void *pool_alloc(pool_alloc_t *p) {
    pool_t *pool;
    void *ret;

    /* Look on free list */
    if (NULL != p->free) {
        ret = p->free;
        p->free = *((void **)p->free);
        return ret;
    }

    /* Look for space in the last pool */
    if (p->npools) {
        pool = &p->pools[p->npools - 1];
        if (pool->used + p->dsize < p->psize) {
            ret = ((char *) pool->pool) + pool->used;
            pool->used += p->dsize;
            return ret;
        }
    }

    /* Need a new pool */
    pool = new_pool(p);
    if (NULL == pool) return NULL;

    pool->used = p->dsize;
    return pool->pool;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %r14
testq %r14, %r14
je 0x491a4
movq (%r14), %rax
movq %rax, 0x20(%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rbx), %rsi
testq %rsi, %rsi
je 0x491da
movq 0x18(%rbx), %rdi
movq %rsi, %rax
shlq $0x4, %rax
movq -0x8(%rdi,%rax), %r14
movq (%rbx), %r13
movq 0x8(%rbx), %r12
leaq (%r14,%r13), %rcx
cmpq %r12, %rcx
jae 0x491e5
addq %rax, %rdi
addq -0x10(%rdi), %r14
movq %rcx, -0x8(%rdi)
jmp 0x49192
movq (%rbx), %r13
movq 0x8(%rbx), %r12
movq 0x18(%rbx), %rdi
shlq $0x4, %rsi
addq $0x10, %rsi
callq 0x4840
testq %rax, %rax
je 0x49246
movq %rax, %r15
xorl %r14d, %r14d
movq %r12, %rax
xorl %edx, %edx
divq %r13
movq %r15, 0x18(%rbx)
movq (%rbx), %r12
movq 0x10(%rbx), %r13
movq %r13, %rbp
shlq $0x4, %rbp
imulq %r12, %rax
movq %rax, %rdi
callq 0x4680
movq %rax, (%r15,%rbp)
testq %rax, %rax
je 0x49192
addq %rbp, %r15
incq %r13
movq %r13, 0x10(%rbx)
movq %r12, 0x8(%r15)
movq %rax, %r14
jmp 0x49192
xorl %r14d, %r14d
jmp 0x49192
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/string_alloc.c
// Function: string_pool_create
string_alloc_t *string_pool_create(size_t max_length) {
    string_alloc_t *a_str;

    if (NULL == (a_str = (string_alloc_t *)malloc(sizeof(*a_str)))) {
        return NULL;
    }

    if (max_length < MIN_STR_SIZE) max_length = MIN_STR_SIZE;

    a_str->nstrings    = 0;
    a_str->max_strings = 0;
    a_str->max_length  = max_length;
    a_str->strings     = NULL;

    return a_str;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x20
popq %rdi
callq 0x4680
testq %rax, %rax
je 0x4928c
cmpq $0x401, %rbx            # imm = 0x401
movl $0x400, %ecx            # imm = 0x400
cmovaeq %rbx, %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq %rcx, (%rax)
andq $0x0, 0x18(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/string_alloc.c
// Function: string_pool_destroy
void string_pool_destroy(string_alloc_t *a_str) {
    size_t i;

    for (i = 0; i < a_str->nstrings; i++) {
        free(a_str->strings[i].str);
    }

    free(a_str->strings);
    free(a_str);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x18(%rbx), %rdi
cmpq 0x8(%rbx), %r15
jae 0x492b8
movq (%rdi,%r14), %rdi
callq 0x45c0
incq %r15
addq $0x10, %r14
jmp 0x4929c
callq 0x45c0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x45c0
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/string_alloc.c
// Function: string_alloc
char *string_alloc(string_alloc_t *a_str, size_t length) {
    string_t *str;
    char *ret;

    if (length <= 0) return NULL;

    // add to last string pool if we have space
    if (a_str->nstrings) {
        str = &a_str->strings[a_str->nstrings - 1];

        if (str->used + length < a_str->max_length) {
            ret = str->str + str->used;
            str->used += length;
            return ret;
        }
    }

    // increase the max length if needs be
    if (length > a_str->max_length) a_str->max_length = length;

    // need a new string pool
    str = new_string_pool(a_str);

    if (NULL == str) return NULL;

    str->used = length;
    return str->str;
}

// Assembly:
testq %rsi, %rsi
je 0x4935b
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
movq 0x8(%r14), %r12
testq %r12, %r12
je 0x49314
movq 0x18(%r14), %rcx
movq %r12, %rsi
shlq $0x4, %rsi
movq -0x8(%rcx,%rsi), %rax
leaq (%rax,%rbx), %rdx
cmpq %rdi, %rdx
jae 0x49314
addq %rsi, %rcx
addq -0x10(%rcx), %rax
movq %rdx, -0x8(%rcx)
jmp 0x49389
cmpq %rbx, %rdi
jae 0x4931f
movq %rbx, (%r14)
movq %rbx, %rdi
cmpq 0x10(%r14), %r12
jne 0x4935e
movq %r12, %r13
shrq $0x2, %r13
orq %r12, %r13
incq %r13
movq 0x18(%r14), %rdi
movq %r13, %rsi
shlq $0x4, %rsi
callq 0x4840
testq %rax, %rax
je 0x49387
movq %rax, %r15
movq %rax, 0x18(%r14)
movq %r13, 0x10(%r14)
movq (%r14), %rdi
movq 0x8(%r14), %r12
jmp 0x49362
xorl %eax, %eax
retq
movq 0x18(%r14), %r15
movq %r12, %r13
shlq $0x4, %r13
callq 0x4680
movq %rax, (%r15,%r13)
testq %rax, %rax
je 0x49387
addq %r13, %r15
incq %r12
movq %r12, 0x8(%r14)
movq %rbx, 0x8(%r15)
jmp 0x49389
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/string_alloc.c
// Function: string_ndup
char *string_ndup(string_alloc_t *a_str, const char *instr, size_t len) {
    char *str = string_alloc(a_str, len + 1);

    if (NULL == str) return NULL;

    memcpy(str, instr, len);
    str[len] = 0;

    return str;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x1(%rdx), %rsi
callq 0x492ca
movq %rax, %r15
testq %rax, %rax
je 0x493e9
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x43c0
movb $0x0, (%r15,%rbx)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/htscodecs/htscodecs/arith_dynamic.c
// Function: arith_compress_bound
unsigned int arith_compress_bound(unsigned int size, int order) {
    int N = (order>>8) & 0xff;
    if (!N) N=4;
    return (order == 0
        ? 1.05*size + 257*3 + 4
        : 1.05*size + 257*257*3 + 4 + 257*3+4) + 5 +
        ((order & X_PACK) ? 1 : 0) +
        ((order & X_RLE) ? 1 + 257*3+4: 0) +
        ((order & X_STRIPE) ? 7 + 5*N: 0);
}

// Assembly:
movl %esi, %eax
movl %edi, %ecx
cvtsi2sd %rcx, %xmm0
mulsd 0x337a3(%rip), %xmm0    # 0x7cba8
testl %esi, %esi
je 0x49419
addsd 0x343f7(%rip), %xmm0    # 0x7d808
addsd 0x33757(%rip), %xmm0    # 0x7cb70
addsd 0x343ef(%rip), %xmm0    # 0x7d810
addsd 0x33747(%rip), %xmm0    # 0x7cb70
movzbl %ah, %ecx
movl %eax, %edx
shrl $0x7, %edx
andl $0x1, %edx
movl %eax, %esi
shll $0x19, %esi
sarl $0x1f, %esi
andl $0x308, %esi            # imm = 0x308
shll $0x1c, %eax
sarl $0x1f, %eax
addsd 0x343c8(%rip), %xmm0    # 0x7d818
cvtsi2sd %edx, %xmm1
testl %ecx, %ecx
addsd %xmm0, %xmm1
cvtsi2sd %esi, %xmm0
leal 0x7(%rcx,%rcx,4), %ecx
pushq $0x1b
popq %rdx
cmovnel %ecx, %edx
addsd %xmm1, %xmm0
andl %eax, %edx
cvtsi2sd %edx, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/htscodecs/htscodecs/arith_dynamic.c
// Function: arith_compress_O0
static
unsigned char *arith_compress_O0(unsigned char *in, unsigned int in_size,
                                 unsigned char *out, unsigned int *out_size) {
    int i, bound = arith_compress_bound(in_size,0)-5; // -5 for order/size
    unsigned char *out_free = NULL;

    if (!out) {
        *out_size = bound;
        out_free = out = malloc(*out_size);
    }
    if (!out || bound > *out_size)
        return NULL;

    unsigned int m = 0;
    for (i = 0; i < in_size; i++)
        if (m < in[i])
            m = in[i];
    m++;
    *out = m;

    SIMPLE_MODEL(256,_) byte_model;
    SIMPLE_MODEL(256,_init)(&byte_model, m);

    RangeCoder rc;
    RC_SetOutput(&rc, (char *)out+1);
    RC_SetOutputEnd(&rc, (char *)out + *out_size);
    RC_StartEncode(&rc);

    for (i = 0; i < in_size; i++)
        SIMPLE_MODEL(256, _encodeSymbol)(&byte_model, &rc, in[i]);

    if (RC_FinishEncode(&rc) < 0) {
        free(out_free);
        return NULL;
    }

    // Finalise block size and return it
    *out_size = RC_OutSize(&rc)+1;

    return out;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x468, %rsp            # imm = 0x468
movq %rcx, %r12
movq %rdi, %r15
movl %esi, %ebx
cvtsi2sd %rbx, %xmm0
mulsd 0x32908(%rip), %xmm0    # 0x7cba8
addsd 0x33568(%rip), %xmm0    # 0x7d810
addsd 0x328c0(%rip), %xmm0    # 0x7cb70
addsd 0x33560(%rip), %xmm0    # 0x7d818
cvttsd2si %xmm0, %rcx
addl $-0x5, %ecx
testq %rdx, %rdx
je 0x4a2d5
movq %rdx, %r14
xorl %eax, %eax
cmpl (%r12), %ecx
jbe 0x4a2ec
jmp 0x4a3a2
movl %ecx, (%r12)
movl %ecx, %edi
callq 0x4680
movq %rax, %r14
testq %rax, %rax
je 0x4a3a0
xorl %edx, %edx
xorl %esi, %esi
cmpq %rdx, %rbx
je 0x4a304
movzbl (%r15,%rdx), %ecx
cmpl %ecx, %esi
cmovbel %ecx, %esi
incq %rdx
jmp 0x4a2f0
movq %rax, (%rsp)
incl %esi
movb %sil, (%r14)
leaq 0x58(%rsp), %r13
movq %r13, %rdi
callq 0x4b089
leaq 0x1(%r14), %rax
leaq 0x10(%rsp), %rbp
movq %rax, 0x20(%rbp)
movq %rax, 0x18(%rbp)
movq %r12, 0x8(%rsp)
movl (%r12), %eax
addq %r14, %rax
movq %rax, 0x30(%rbp)
andq $0x0, 0x10(%rbp)
movapd 0x2d388(%rip), %xmm0    # 0x776d0
movapd %xmm0, (%rbp)
andl $0x0, 0x38(%rbp)
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0x4a36e
movzbl (%r15,%r12), %edx
movq %r13, %rdi
movq %rbp, %rsi
callq 0x4b130
incq %r12
jmp 0x4a354
leaq 0x10(%rsp), %rdi
callq 0x4b226
testl %eax, %eax
js 0x4a38f
movl 0x30(%rsp), %eax
subl 0x28(%rsp), %eax
incl %eax
movq 0x8(%rsp), %rcx
movl %eax, (%rcx)
jmp 0x4a39b
movq (%rsp), %rdi
callq 0x45c0
xorl %r14d, %r14d
movq %r14, %rax
jmp 0x4a3a2
xorl %eax, %eax
addq $0x468, %rsp            # imm = 0x468
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/htscodecs/htscodecs/arith_dynamic.c
// Function: arith_uncompress_O0
static
unsigned char *arith_uncompress_O0(unsigned char *in, unsigned int in_size,
                                   unsigned char *out, unsigned int out_sz) {
    RangeCoder rc;
    int i;
    unsigned int m = in[0] ? in[0] : 256;

    SIMPLE_MODEL(256,_) byte_model;
    SIMPLE_MODEL(256,_init)(&byte_model, m);

    unsigned char *out_free = NULL;
    if (!out)
        out_free = out = malloc(out_sz);
    if (!out)
        return NULL;

    RC_SetInput(&rc, (char *)in+1, (char *)in+in_size);
    RC_StartDecode(&rc);

    for (i = 0; i < out_sz; i++)
        out[i] = SIMPLE_MODEL(256, _decodeSymbol)(&byte_model, &rc);

    if (RC_FinishDecode(&rc) < 0) {
        free(out_free);
        return NULL;
    }
    
    return out;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x458, %rsp            # imm = 0x458
movl %ecx, %ebp
movq %rdx, %rbx
movl %esi, %r15d
movq %rdi, %r12
movzbl (%rdi), %eax
testl %eax, %eax
movl $0x100, %esi            # imm = 0x100
cmovnel %eax, %esi
leaq 0x48(%rsp), %r14
movq %r14, %rdi
callq 0x4b089
leaq 0x1(%r12), %rax
movl %r15d, %ecx
addq %r12, %rcx
leaq 0x8(%rsp), %r15
movq %rax, 0x18(%r15)
movq %rax, 0x20(%r15)
movq %rcx, 0x28(%r15)
movq %r15, %rdi
callq 0x4b357
movl %ebp, %r12d
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x4b05f
movq %r14, %rdi
movq %r15, %rsi
callq 0x4b3a2
movb %al, (%rbx,%r13)
incq %r13
jmp 0x4b046
xorl %eax, %eax
cmpl $0x0, 0x40(%rsp)
cmovsq %rax, %rbx
movq %rbx, %rax
addq $0x458, %rsp            # imm = 0x458
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/htscodecs/htscodecs/c_range_coder.h
// Function: RC_Encode
static inline void RC_Encode (RangeCoder *rc, uint32_t cumFreq, uint32_t freq, uint32_t totFreq) 
{
    uint32_t tmp = rc->low;
    rc->low  += cumFreq * (rc->range/= totFreq);
    rc->range*= freq;

    rc->Carry += rc->low<tmp; // Overflow

    while (rc->range < TOP) {
        rc->range <<= 8;
        RC_ShiftLowCheck(rc);
    }
}

// Assembly:
pushq %rbx
movl %edx, %r8d
movq %rdi, %rbx
movl 0x8(%rdi), %eax
xorl %edx, %edx
divl %ecx
imull %eax, %esi
imull %eax, %r8d
addl %esi, (%rdi)
movl %r8d, 0x8(%rdi)
adcl $0x0, 0x14(%rdi)
cmpl $0xffffff, %r8d         # imm = 0xFFFFFF
ja 0x4b286
shll $0x8, %r8d
movl %r8d, 0x8(%rbx)
movq %rbx, %rdi
callq 0x4b2b1
movl 0x8(%rbx), %r8d
jmp 0x4b267
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/htscodecs/htscodecs/c_range_coder.h
// Function: RC_ShiftLowCheck
static inline void RC_ShiftLowCheck(RangeCoder *rc) {
    if (rc->low < Thres || rc->Carry) {
        if (rc->out_end && rc->FFNum >= rc->out_end - rc->out_buf) {
            rc->err = -1;
            return;
        }

        *rc->out_buf++ = rc->Cache + rc->Carry;

        // Flush any stored FFs
        while (rc->FFNum) {
            *rc->out_buf++ = rc->Carry-1; // (Carry-1)&255;
            rc->FFNum--;
        }

        // Take copy of top byte ready for next flush
        rc->Cache = rc->low >> 24;
        rc->Carry = 0;
    } else {
        // Low if FFxx xxxx.  Bump FF count and shift in as before
        rc->FFNum++;
    }
    rc->low = rc->low<<8;
}

// Assembly:
movl (%rdi), %eax
cmpl $0xff000000, %eax       # imm = 0xFF000000
jb 0x4b2c0
cmpl $0x0, 0x14(%rdi)
je 0x4b325
movq 0x30(%rdi), %rcx
testq %rcx, %rcx
je 0x4b2dd
movl 0xc(%rdi), %edx
movq 0x20(%rdi), %rax
subq %rax, %rcx
cmpq %rdx, %rcx
jg 0x4b2e1
orl $-0x1, 0x38(%rdi)
retq
movq 0x20(%rdi), %rax
movl 0x14(%rdi), %ecx
addl 0x10(%rdi), %ecx
leaq 0x1(%rax), %rdx
movq %rdx, 0x20(%rdi)
movb %cl, (%rax)
movl 0xc(%rdi), %eax
testl %eax, %eax
je 0x4b315
movb 0x14(%rdi), %al
decb %al
movq 0x20(%rdi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x20(%rdi)
movb %al, (%rcx)
movl 0xc(%rdi), %eax
decl %eax
movl %eax, 0xc(%rdi)
jmp 0x4b2f4
movl (%rdi), %eax
movl %eax, %ecx
shrl $0x18, %ecx
movl %ecx, 0x10(%rdi)
andl $0x0, 0x14(%rdi)
jmp 0x4b328
incl 0xc(%rdi)
shll $0x8, %eax
movl %eax, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/htscodecs/htscodecs/c_range_coder.h
// Function: RC_StartDecode
static inline void RC_StartDecode(RangeCoder *rc)
{ 
    rc->range = 0xFFFFFFFF;
    rc->low   = 0;
    rc->FFNum = 0;
    rc->Carry = 0;
    rc->Cache = 0;
    rc->code  = 0;
    rc->err   = 0;
    if (rc->in_buf+5 > rc->in_end) {
        rc->in_buf = rc->in_end; // prevent decode
        return;
    }
    DO(5) rc->code = (rc->code<<8) | *rc->in_buf++;
}

// Assembly:
andq $0x0, 0x10(%rdi)
movaps 0x2c36d(%rip), %xmm0    # 0x776d0
movups %xmm0, (%rdi)
andl $0x0, 0x38(%rdi)
movq 0x18(%rdi), %rax
movq 0x28(%rdi), %rcx
leaq 0x5(%rax), %rdx
cmpq %rcx, %rdx
jbe 0x4b380
movq %rcx, 0x18(%rdi)
retq
incq %rax
xorl %ecx, %ecx
pushq $0x5
popq %rdx
subl $0x1, %edx
jb 0x4b37f
shll $0x8, %ecx
movq %rax, 0x18(%rdi)
movzbl -0x1(%rax), %esi
orl %esi, %ecx
movl %ecx, 0x4(%rdi)
incq %rax
jmp 0x4b388
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/htscodecs/htscodecs/c_range_coder.h
// Function: RC_Decode
static inline void RC_Decode (RangeCoder *rc, uint32_t cumFreq, uint32_t freq, uint32_t totFreq) 
{
    rc->code -= cumFreq * rc->range;
    rc->range *= freq;
    while (rc->range < TOP) {
        if (rc->in_buf >= rc->in_end) {
            rc->err = -1;
            return;
        }
        rc->code = (rc->code<<8) + *rc->in_buf++;
        rc->range <<= 8;
    }
}

// Assembly:
movl 0x4(%rdi), %eax
movl 0x8(%rdi), %ecx
imull %ecx, %esi
subl %esi, %eax
movl %eax, 0x4(%rdi)
imull %ecx, %edx
movl %edx, 0x8(%rdi)
cmpl $0xffffff, %edx         # imm = 0xFFFFFF
ja 0x4b54c
movq 0x18(%rdi), %rcx
cmpq 0x28(%rdi), %rcx
jae 0x4b548
shll $0x8, %eax
leaq 0x1(%rcx), %rsi
movq %rsi, 0x18(%rdi)
movzbl (%rcx), %ecx
orl %ecx, %eax
movl %eax, 0x4(%rdi)
shll $0x8, %edx
jmp 0x4b51b
orl $-0x1, 0x38(%rdi)
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/htscodecs/htscodecs/fqzcomp_qual.c
// Function: fqz_create_models
static int fqz_create_models(fqz_model *m, fqz_gparams *gp) {
    int i;

    if (!(m->qual = htscodecs_tls_alloc(sizeof(*m->qual) * CTX_SIZE)))
        return -1;

    for (i = 0; i < CTX_SIZE; i++)
        SIMPLE_MODEL(QMAX,_init)(&m->qual[i], gp->max_sym+1);

    for (i = 0; i < 4; i++)
        SIMPLE_MODEL(256,_init)(&m->len[i],256);

    SIMPLE_MODEL(2,_init)(&m->revcomp,2);
    SIMPLE_MODEL(2,_init)(&m->dup,2);
    if (gp->max_sel > 0)
        SIMPLE_MODEL(256,_init)(&m->sel, gp->max_sel+1);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x4100000, %edi        # imm = 0x4100000
callq 0x6412c
movq %rax, (%rbx)
testq %rax, %rax
je 0x4deab
xorl %r15d, %r15d
cmpq $0x4100000, %r15        # imm = 0x4100000
je 0x4de52
movq (%rbx), %rdi
addq %r15, %rdi
movl 0x410(%r14), %esi
incl %esi
callq 0x4e0b4
addq $0x410, %r15            # imm = 0x410
jmp 0x4de2c
pushq $0x8
popq %r15
cmpq $0x1048, %r15           # imm = 0x1048
je 0x4de76
leaq (%rbx,%r15), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x4e0b4
addq $0x410, %r15            # imm = 0x410
jmp 0x4de56
leaq 0x1048(%rbx), %rdi
callq 0x4e105
leaq 0x1470(%rbx), %rdi
callq 0x4e105
movl 0xc(%r14), %esi
xorl %ebp, %ebp
testl %esi, %esi
jle 0x4deae
addq $0x1060, %rbx           # imm = 0x1060
incl %esi
movq %rbx, %rdi
callq 0x4e0b4
jmp 0x4deae
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/htscodecs/htscodecs/fqzcomp_qual.c
// Function: store_array
static int store_array(unsigned char *out, unsigned int *array, int size) {
    unsigned char tmp[2048];

    int i, j, k;
    for (i = j = k = 0; i < size; j++) {
        int run_len = i;
        while (i < size && array[i] == j)
            i++;
        run_len = i-run_len;

        int r;
        do {
            r = MIN(255, run_len);
            tmp[k++] = r;
            run_len -= r;
        } while (r == 255);
    }
    while (i < size)
        tmp[k++] = 0, j++;

    // RLE on out.
    //    1 2 3 3 3 3 3 4 4    5
    // => 1 2 3 3 +3... 4 4 +0 5
    int last = -1;
    for (i = j = 0; j < k; i++) {
        out[i] = tmp[j++];
        if (out[i] == last) {
            int n = j;
            while (j < k && tmp[j] == last)
                j++;
            out[++i] = j-n;
        } else {
            last = out[i];
        }
    }
    k = i;

//    fprintf(stderr, "Store_array %d => %d {", size, k);
//    for (i = 0; i < k; i++)
//      fprintf(stderr, "%d,", out[i]);
//    fprintf(stderr, "}\n");
    return k;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x788, %rsp            # imm = 0x788
movslq %edx, %rax
xorl %ecx, %ecx
movl $0xff, %r9d
xorl %r10d, %r10d
xorl %ebx, %ebx
movslq %ecx, %r8
cmpl %edx, %ebx
jge 0x4e048
movslq %ebx, %r11
movq %rax, %r14
subq %r11, %r14
leaq (%rsi,%r11,4), %r15
xorl %r11d, %r11d
cmpq %r11, %r14
je 0x4e008
cmpl %r10d, (%r15,%r11,4)
jne 0x4e00d
incq %r11
jmp 0x4dff8
movl %edx, %r11d
jmp 0x4e010
addl %ebx, %r11d
movl %r11d, %ebp
subl %ebx, %ebp
addq %rsp, %r8
addq $-0x80, %r8
movl %ebp, %ebx
cmpl %r9d, %ebp
movl $0xff, %r14d
cmovll %ebp, %r14d
movb %r14b, (%r8)
subl %r14d, %ebx
incq %r8
incl %ecx
cmpl $0xfe, %ebp
movl %ebx, %ebp
jg 0x4e01e
incl %r10d
movl %r11d, %ebx
jmp 0x4dfe1
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %esi, %esi
xorl %eax, %eax
cmpl %ecx, %esi
jge 0x4e0a6
leal 0x1(%rsi), %r9d
movslq %esi, %r11
movzbl -0x80(%rsp,%r11), %ebx
movslq %eax, %r10
movb %bl, (%rdi,%r10)
cmpl %ebx, %edx
jne 0x4e086
incq %r11
cmpq %r8, %r11
jge 0x4e08a
movzbl -0x80(%rsp,%r11), %eax
incl %esi
incq %r11
cmpl %eax, %edx
je 0x4e070
jmp 0x4e08c
movl %ebx, %edx
jmp 0x4e09f
movl %ecx, %esi
movl %esi, %eax
subl %r9d, %eax
movb %al, 0x1(%rdi,%r10)
incq %r10
movl %esi, %r9d
movl %r10d, %eax
incl %eax
movl %r9d, %esi
jmp 0x4e051
addq $0x788, %rsp            # imm = 0x788
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/htscodecs/htscodecs/fqzcomp_qual.c
// Function: read_array
static int read_array(unsigned char *in, size_t in_size, unsigned int *array, int size) {
    unsigned char R[1024];
    int i, j, z, last = -1, nb = 0;

    size = MIN(1024, size);

    // Remove level one of run-len encoding
    for (i = j = z = 0; z < size && i < in_size; i++) {
        int run = in[i];
        R[j++] = run;
        z += run;
        if (run == last) {
            if (i+1 >= in_size)
                return -1;
            int copy = in[++i];
            z += run * copy;
            while (copy-- && z <= size && j < 1024)
                R[j++] = run;
        }
        if (j >= 1024)
            return -1;
        last = run;
    }
    nb = i;

    // Now expand inner level of run-length encoding
    int R_max = j;
    for (i = j = z = 0; j < size; i++) {
        int run_len = 0;
        int run_part;
        if (z >= R_max)
            return -1;
        do {
            run_part = R[z++];
            run_len += run_part;
        } while (run_part == 255 && z < R_max);
        if (run_part == 255)
            return -1;

        while (run_len && j < size)
            run_len--, array[j++] = i;
    }

    return nb;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x388, %rsp            # imm = 0x388
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
xorl %r14d, %r14d
movl %r8d, %r11d
xorl %eax, %eax
movslq %r9d, %r10
cmpl %ecx, %r14d
jge 0x4e424
movslq %eax, %rbx
cmpq %rsi, %rbx
jae 0x4e424
movb (%rdi,%rbx), %r15b
movzbl %r15b, %ebp
incl %r9d
movb %bpl, -0x80(%rsp,%r10)
addl %ebp, %r14d
cmpl %ebp, %r11d
jne 0x4e3f1
incq %rbx
cmpq %rsi, %rbx
jae 0x4e40f
movzbl (%rdi,%rbx), %eax
imull %eax, %r11d
addl %r14d, %r11d
movslq %r9d, %r10
negl %eax
xorl %r14d, %r14d
cmpl %r14d, %eax
je 0x4e3f5
cmpl %ecx, %r11d
jg 0x4e3f5
cmpq $0x3ff, %r10            # imm = 0x3FF
jg 0x4e3f5
movb %r15b, -0x80(%rsp,%r10)
incq %r10
decl %r14d
jmp 0x4e3d1
movl %eax, %ebx
jmp 0x4e3fb
subl %r14d, %r9d
movl %r11d, %r14d
incl %ebx
movl %ebp, %r11d
movl %ebx, %eax
cmpl $0x400, %r9d            # imm = 0x400
jl 0x4e386
movl %r8d, %eax
addq $0x388, %rsp            # imm = 0x388
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movslq %ecx, %rsi
xorl %edi, %edi
xorl %r11d, %r11d
xorl %ebx, %ebx
cmpl %ecx, %edi
jge 0x4e412
cmpl %r9d, %r11d
jge 0x4e40f
movslq %r11d, %r15
incq %r15
xorl %ebp, %ebp
movl %ebp, %r14d
movzbl -0x81(%rsp,%r15), %r12d
incl %r11d
cmpl $0xff, %r12d
jne 0x4e467
leal (%r14,%r12), %ebp
leaq 0x1(%r15), %r13
cmpq %r10, %r15
movq %r13, %r15
jl 0x4e43f
cmpl $0xff, %r12d
je 0x4e40f
movslq %edi, %r15
addl %r12d, %r14d
negl %r14d
xorl %ebp, %ebp
cmpl %ebp, %r14d
je 0x4e490
cmpq %rsi, %r15
jge 0x4e490
movl %ebx, (%rdx,%r15,4)
incq %r15
decl %ebp
jmp 0x4e47b
subl %ebp, %edi
incl %ebx
jmp 0x4e42e
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/htscodecs/htscodecs/pack.c
// Function: hts_unpack_meta
uint8_t hts_unpack_meta(uint8_t *data, uint32_t data_len,
                        uint64_t udata_len, uint8_t *map, int *nsym) {
    if (data_len == 0)
        return 0;

    // Number of symbols used
    unsigned int n = data[0];
    if (n == 0)
        n = 256;

    // Symbols per byte
    if (n <= 1)
        *nsym = 0;
    else if (n <= 2)
        *nsym = 8;
    else if (n <= 4)
        *nsym = 4;
    else if (n <= 16)
        *nsym = 2;
    else {
        *nsym = 1; // no packing
        return 1;
    }

    if (data_len <= 1)
        return 0;

    int j = 1, c = 0;
    do {
        map[c++] = data[j++];
    } while (c < n && j < data_len);

    return c < n ? 0 : j;
}

// Assembly:
xorl %eax, %eax
testl %esi, %esi
je 0x4e929
movzbl (%rdi), %r9d
testl %r9d, %r9d
movl $0x100, %edx            # imm = 0x100
cmovnel %r9d, %edx
cmpl $0x2, %edx
jb 0x4e91f
jne 0x4e90e
pushq $0x8
jmp 0x4e91e
cmpl $0x5, %edx
jae 0x4e917
pushq $0x4
jmp 0x4e91e
cmpl $0x11, %edx
jae 0x4e953
pushq $0x2
popq %rax
movl %eax, (%r8)
cmpl $0x1, %esi
jne 0x4e92a
xorl %eax, %eax
retq
movl %esi, %eax
movl %edx, %edx
pushq $0x1
popq %rsi
movq %rsi, %r8
incq %rsi
movb (%rdi,%r8), %r9b
movb %r9b, -0x1(%rcx,%r8)
cmpq %rdx, %r8
jae 0x4e94a
cmpq %rax, %rsi
jb 0x4e931
xorl %eax, %eax
cmpq %rdx, %r8
cmovael %esi, %eax
retq
movl $0x1, (%r8)
movb $0x1, %al
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/htscodecs/htscodecs/pack.c
// Function: hts_unpack_
uint8_t *hts_unpack_(uint8_t *data, int64_t len, uint8_t *out, uint64_t out_len, int nsym, uint8_t *p) {
    //uint8_t *out;
    uint8_t c = 0;
    int64_t i, j = 0, olen;

    if (nsym == 1) {
        // raw data; FIXME: shortcut the need for malloc & memcpy here
        memcpy(out, data, len);
        return out;
    }

    switch(nsym) {
    case 2: {
        uint16_t map[256], x, y;
        for (x = 0; x < 16; x++)
            for (y = 0; y < 16; y++)
                map[x*16+y] = p[x]*256+p[y];

        if ((out_len+1)/2 > len)
            return NULL;
        olen = out_len & ~1;

        uint16_t *o16 = (uint16_t *)out;
        for (i = 0; i+4 < olen/2; i+=4) {
            int k;
            for (k = 0; k < 4; k++)
                o16[i+k] = map[data[i+k]];
        }
        j = i; i *= 2;

        for (; i < olen; i+=2) {
            uint16_t w1 = map[data[j++]];
            *(uint16_t *)&out[i] = w1;
        }

        if (out_len != olen) {
            c = data[j++];
            out[i+0] = p[c&15];
        }
        break;
    }

    default:
        return NULL;
    }

    return out;
}

// Assembly:
movq %rsi, %rax
movq %rdi, %rsi
cmpl $0x2, %r8d
je 0x4ecdf
cmpl $0x1, %r8d
jne 0x4ed32
movq %rdx, %rdi
movq %rax, %rdx
jmp 0x43c0
pushq %rbx
subq $0x180, %rsp            # imm = 0x180
leaq -0x80(%rsp), %rdi
xorl %r8d, %r8d
cmpq $0x10, %r8
je 0x4ed22
movzbl (%r9,%r8), %r10d
shll $0x8, %r10d
xorl %r11d, %r11d
cmpq $0x10, %r11
je 0x4ed19
movzbl (%r9,%r11), %ebx
orl %r10d, %ebx
movw %bx, (%rdi,%r11,2)
incq %r11
jmp 0x4ed01
incq %r8
addq $0x20, %rdi
jmp 0x4ecef
leaq 0x1(%rcx), %rdi
shrq %rdi
cmpq %rax, %rdi
jbe 0x4ed36
xorl %edx, %edx
jmp 0x4edad
xorl %edx, %edx
jmp 0x4edb5
movq %rcx, %rdi
sarq %rdi
xorl %eax, %eax
movq %rdx, %r8
leaq 0x4(%rax), %r10
cmpq %rdi, %r10
jge 0x4ed74
xorl %eax, %eax
cmpq $0x4, %rax
je 0x4ed67
movzbl (%rsi,%rax), %r11d
movzwl -0x80(%rsp,%r11,2), %r11d
movw %r11w, (%r8,%rax,2)
incq %rax
jmp 0x4ed4c
addq $0x4, %rsi
addq $0x8, %r8
movq %r10, %rax
jmp 0x4ed41
movq %rcx, %rdi
andq $-0x2, %rdi
addq %rax, %rax
cmpq %rdi, %rax
jge 0x4ed9b
movzbl (%rsi), %r8d
movzwl -0x80(%rsp,%r8,2), %r8d
movw %r8w, (%rdx,%rax)
addq $0x2, %rax
incq %rsi
jmp 0x4ed7e
cmpq %rcx, %rdi
je 0x4edad
movzbl (%rsi), %ecx
andl $0xf, %ecx
movb (%r9,%rcx), %cl
movb %cl, (%rdx,%rax)
addq $0x180, %rsp            # imm = 0x180
popq %rbx
movq %rdx, %rax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/htscodecs/htscodecs/rANS_static4x16pr.c
// Function: rans_compress_bound_4x16
unsigned int rans_compress_bound_4x16(unsigned int size, int order) {
    int N = (order>>8) & 0xff;
    if (!N) N=4;

    order &= 0xff;
    unsigned int sz = (order == 0
        ? 1.05*size + 257*3 + 4
        : 1.05*size + 257*257*3 + 4 + 257*3+4) +
        ((order & RANS_ORDER_PACK) ? 1 : 0) +
        ((order & RANS_ORDER_RLE) ? 1 + 257*3+4: 0) + 20 +
        ((order & RANS_ORDER_X32) ? (32-4)*4 : 0) +
        ((order & RANS_ORDER_STRIPE) ? 7 + 5*N: 0);
    return sz + (sz&1) + 2; // make this even so buffers are word aligned
}

// Assembly:
movl %esi, %eax
movl %edi, %ecx
cvtsi2sd %rcx, %xmm0
mulsd 0x2dddb(%rip), %xmm0    # 0x7cba8
testb %al, %al
je 0x4ede1
addsd 0x2ea2f(%rip), %xmm0    # 0x7d808
addsd 0x2dd8f(%rip), %xmm0    # 0x7cb70
addsd 0x2ea27(%rip), %xmm0    # 0x7d810
addsd 0x2dd7f(%rip), %xmm0    # 0x7cb70
movzbl %ah, %ecx
movl %eax, %edx
shrl $0x7, %edx
andl $0x1, %edx
movl %eax, %esi
shll $0x19, %esi
sarl $0x1f, %esi
andl $0x308, %esi            # imm = 0x308
movl %eax, %edi
shll $0x1d, %edi
sarl $0x1f, %edi
andl $0x70, %edi
shll $0x1c, %eax
sarl $0x1f, %eax
testl %ecx, %ecx
cvtsi2sd %edx, %xmm1
addsd %xmm0, %xmm1
cvtsi2sd %esi, %xmm0
addsd %xmm1, %xmm0
addsd 0x2ed13(%rip), %xmm0    # 0x7db48
cvtsi2sd %edi, %xmm1
leal 0x7(%rcx,%rcx,4), %ecx
pushq $0x1b
popq %rdx
cmovnel %ecx, %edx
andl %eax, %edx
cvtsi2sd %edx, %xmm2
addsd %xmm0, %xmm1
addsd %xmm1, %xmm2
cvttsd2si %xmm2, %rax
movl %eax, %ecx
andl $0x1, %ecx
addl %ecx, %eax
addl $0x2, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/htscodecs/htscodecs/rANS_static16_int.h
// Function: normalise_freq
static inline int normalise_freq(uint32_t *F, int size, uint32_t tot) {
    int m, M, j, loop = 0;
    uint64_t tr;
    if (!size)
        return 0;

 again:
    tr = ((uint64_t)tot<<31)/size + (1<<30)/size;

    for (size = m = M = j = 0; j < 256; j++) {
        if (!F[j])
            continue;

        if (m < F[j])
            m = F[j], M = j;

        if ((F[j] = (F[j]*tr)>>31) == 0)
            F[j] = 1;
        size += F[j];
//      if (F[j] == tot)
//          F[j]--;
    }

    int adjust = tot - size;
    if (adjust > 0) {
        F[M] += adjust;
    } else if (adjust < 0) {
        if (F[M] > -adjust && (loop == 1 || F[M]/2 >= -adjust)) {
            F[M] += adjust;
        } else {
            if (loop < 1) {
                loop++;
                goto again;
            }
            adjust += F[M]-1;
            F[M] = 1;
            for (j = 0; adjust && j < 256; j++) {
                if (F[j] < 2) continue;

                int d = F[j] > -adjust;
                int m = d ? adjust : 1-F[j];
                F[j]   += m;
                adjust -= m;
            }
        }
    }

    //printf("F[%d]=%d\n", M, F[M]);
    return F[M]>0 ? 0 : -1;
}

// Assembly:
testl %esi, %esi
je 0x4f4d4
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ecx
movl %edx, %r8d
shlq $0x1f, %r8
movb $0x1, %r10b
movl $0x1, %r9d
movslq %esi, %rbx
xorl %r11d, %r11d
movq %r8, %rax
xorl %edx, %edx
divq %rbx
movq %rax, %rsi
movl $0x40000000, %eax       # imm = 0x40000000
xorl %edx, %edx
idivl %ebx
movslq %eax, %rdx
addq %rsi, %rdx
xorl %eax, %eax
xorl %ebx, %ebx
xorl %esi, %esi
cmpq $0x100, %r11            # imm = 0x100
je 0x4f452
movl (%rdi,%r11,4), %r14d
testq %r14, %r14
je 0x4f44d
cmpl %r14d, %ebx
cmovbl %r11d, %eax
cmovbel %r14d, %ebx
imulq %rdx, %r14
shrq $0x1f, %r14
cmpl $0x2, %r14d
cmovbl %r9d, %r14d
movl %r14d, (%rdi,%r11,4)
addl %esi, %r14d
movl %r14d, %esi
incq %r11
jmp 0x4f416
movl %ecx, %r11d
subl %esi, %r11d
movslq %eax, %rdx
testl %r11d, %r11d
jg 0x4f4d7
jns 0x4f4e8
movl (%rdi,%rdx,4), %eax
movl %r11d, %ebx
negl %ebx
cmpl %ebx, %eax
jbe 0x4f480
movl %eax, %ebp
shrl %ebp
cmpl %ebx, %ebp
setb %bl
testb %bl, %r10b
je 0x4f4df
testb $0x1, %r10b
movl $0x0, %r10d
jne 0x4f3f0
addl %r11d, %eax
decl %eax
movl $0x1, (%rdi,%rdx,4)
xorl %ecx, %ecx
testl %eax, %eax
je 0x4f4e8
cmpq $0xff, %rcx
ja 0x4f4e8
movl (%rdi,%rcx,4), %esi
cmpl $0x2, %esi
jb 0x4f4cf
movl %eax, %r8d
negl %r8d
movl %r9d, %r10d
subl %esi, %r10d
cmpl %r8d, %esi
cmoval %eax, %r10d
addl %r10d, %esi
movl %esi, (%rdi,%rcx,4)
subl %r10d, %eax
incq %rcx
jmp 0x4f49e
xorl %eax, %eax
retq
leaq (%rdi,%rdx,4), %rcx
movl (%rcx), %eax
jmp 0x4f4e3
leaq (%rdi,%rdx,4), %rcx
addl %r11d, %eax
movl %eax, (%rcx)
xorl %eax, %eax
cmpl $0x1, (%rdi,%rdx,4)
sbbl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/htscodecs/htscodecs/rANS_static16_int.h
// Function: normalise_freq_shift
static inline void normalise_freq_shift(uint32_t *F, uint32_t size,
                                        uint32_t max_tot) {
    if (size == 0 || size == max_tot)
        return;

    int shift = 0, i;
    while (size < max_tot)
        size*=2, shift++;

    for (i = 0; i < 256; i++)
        F[i] <<= shift;
}

// Assembly:
testl %esi, %esi
sete %al
cmpl %edx, %esi
sete %cl
orb %al, %cl
je 0x4f9fb
retq
xorl %ecx, %ecx
cmpl %edx, %esi
jae 0x4fa07
addl %esi, %esi
incl %ecx
jmp 0x4f9fd
xorl %eax, %eax
cmpq $0x100, %rax            # imm = 0x100
je 0x4f9fa
shll %cl, (%rdi,%rax,4)
incq %rax
jmp 0x4fa09
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/htscodecs/htscodecs/rANS_static16_int.h
// Function: encode_alphabet
static inline int encode_alphabet(uint8_t *cp, uint32_t *F) {
    uint8_t *op = cp;
    int rle, j;

    for (rle = j = 0; j < 256; j++) {
        if (F[j]) {
            // j
            if (rle) {
                rle--;
            } else {
                *cp++ = j;
                if (!rle && j && F[j-1])  {
                    for(rle=j+1; rle<256 && F[rle]; rle++)
                        ;
                    rle -= j+1;
                    *cp++ = rle;
                }
                //fprintf(stderr, "%d: %d %d\n", j, rle, N[j]);
            }
        }
    }
    *cp++ = 0;
    
    return cp - op;
}

// Assembly:
xorl %ecx, %ecx
pushq $0x1
popq %rdx
movq %rdi, %rax
xorl %r8d, %r8d
cmpq $0x100, %rcx            # imm = 0x100
je 0x51468
cmpl $0x0, (%rsi,%rcx,4)
je 0x51414
testl %r8d, %r8d
je 0x51422
decl %r8d
movq %rax, %r9
incq %rcx
incq %rdx
movq %r9, %rax
jmp 0x513fd
leaq 0x1(%rax), %r9
movb %cl, (%rax)
xorl %r8d, %r8d
testq %rcx, %rcx
je 0x51417
cmpl $0x0, -0x4(%rsi,%rcx,4)
je 0x51417
movq %rdx, %r9
cmpq $0x100, %r9             # imm = 0x100
je 0x5144f
cmpl $0x0, (%rsi,%r9,4)
je 0x51455
incq %r9
jmp 0x5143a
movl $0x100, %r9d            # imm = 0x100
movl %ecx, %r8d
notl %r8d
addl %r9d, %r8d
movb %r8b, 0x1(%rax)
addq $0x2, %rax
jmp 0x51414
movb $0x0, (%rax)
subl %edi, %eax
incl %eax
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/htscodecs/htscodecs/rANS_static16_int.h
// Function: decode_alphabet
static inline int decode_alphabet(uint8_t *cp, uint8_t *cp_end, uint32_t *F) {
    if (cp == cp_end)
        return 0;

    uint8_t *op = cp;
    int rle = 0;
    int j = *cp++;
    if (cp+2 >= cp_end)
        goto carefully;

    do {
        F[j] = 1;
        if (!rle && j+1 == *cp) {
            j = *cp++;
            rle = *cp++;
        } else if (rle) {
            rle--;
            j++;
            if (j > 255)
                return 0;
        } else {
            j = *cp++;
        }
    } while(j && cp+2 < cp_end);

 carefully:
    if (j) {
        do {
            F[j] = 1;
            if(cp >= cp_end) return 0;
            if (!rle && j+1 == *cp) {
                if (cp+1 >= cp_end) return 0;
                j = *cp++;
                rle = *cp++;
            } else if (rle) {
                rle--;
                j++;
                if (j > 255)
                    return 0;
            } else {
                if (cp >= cp_end) return 0;
                j = *cp++;
            }
        } while(j && cp < cp_end);
    }

    return cp - op;
}

// Assembly:
cmpq %rsi, %rdi
je 0x51544
leaq 0x1(%rdi), %rcx
movzbl (%rdi), %r8d
leaq 0x3(%rdi), %rax
xorl %r9d, %r9d
cmpq %rsi, %rax
jae 0x514e1
xorl %r9d, %r9d
movl %r8d, %eax
movl $0x1, (%rdx,%rax,4)
testl %r9d, %r9d
je 0x514b4
cmpl $0xfe, %r8d
jg 0x51544
decl %r9d
incl %r8d
jmp 0x514d3
incl %r8d
movzbl (%rcx), %eax
cmpl %eax, %r8d
jne 0x514ca
movzbl 0x1(%rcx), %r9d
addq $0x2, %rcx
jmp 0x514d3
incq %rcx
xorl %r9d, %r9d
movl %eax, %r8d
testl %r8d, %r8d
je 0x514e1
leaq 0x2(%rcx), %rax
cmpq %rsi, %rax
jb 0x51490
testl %r8d, %r8d
je 0x5153f
movl %r8d, %eax
movl $0x1, (%rdx,%rax,4)
xorl %eax, %eax
cmpq %rsi, %rcx
jae 0x51546
testl %r9d, %r9d
je 0x5150d
cmpl $0xfe, %r8d
jg 0x51546
decl %r9d
incl %r8d
jmp 0x51535
incl %r8d
movzbl (%rcx), %eax
leaq 0x1(%rcx), %r10
xorl %r9d, %r9d
cmpl %eax, %r8d
jne 0x5152f
cmpq %rsi, %r10
jae 0x51544
movzbl 0x1(%rcx), %r9d
addq $0x2, %rcx
jmp 0x51535
movq %r10, %rcx
movl %eax, %r8d
testl %r8d, %r8d
je 0x5153f
cmpq %rsi, %rcx
jb 0x514e6
subl %edi, %ecx
movl %ecx, %eax
retq
xorl %eax, %eax
retq