LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/htscodecs/htscodecs/tokenise_name3.c
// Function: decode_token_int1
static int decode_token_int1(name_context *ctx, int ntok,
                             enum name_type type, uint32_t *val) {
    int id = (ntok<<4) | type;

    if (ctx->desc[id].buf_l  >= ctx->desc[id].buf_a)
        return -1;
    *val = ctx->desc[id].buf[ctx->desc[id].buf_l++];

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl -0x14(%rbp), %eax
shll $0x4, %eax
orl -0x18(%rbp), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
addq $0x20, %rax
movslq -0x24(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
addq $0x20, %rcx
movslq -0x24(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
jb 0xcdfe7
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xce030
movq -0x10(%rbp), %rax
addq $0x20, %rax
movslq -0x24(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x10(%rbp), %rdx
addq $0x20, %rdx
movslq -0x24(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rdx
movq 0x10(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x10(%rdx)
movzbl (%rax,%rcx), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/htscodecs/htscodecs/utils.c
// Function: htscodecs_tls_calloc
void *htscodecs_tls_calloc(size_t nmemb, size_t size) {
#ifdef TLS_DEBUG
    fprintf(stderr, "htscodecs_tls_calloc(%ld)\n", nmemb*size);
#endif
    void *ptr = htscodecs_tls_alloc(nmemb * size);
    if (ptr)
        memset(ptr, 0, nmemb * size);
    return ptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
imulq -0x10(%rbp), %rdi
callq 0xce6a0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xce8dd
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rdx
imulq -0x10(%rbp), %rdx
xorl %esi, %esi
callq 0x4250
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/htscodecs/htscodecs/utils.c
// Function: htscodecs_tls_free
void htscodecs_tls_free(void *ptr) {
    if (!ptr)
        return;

    tls_pool *tls = pthread_getspecific(rans_key);

    int i;
    for (i = 0; i < MAX_TLS_BUFS; i++) {
        if (tls->bufs[i] == ptr)
            break;
    }
#ifdef TLS_DEBUG
    fprintf(stderr, "Fake free %d size %ld ptr %p\n",
            i, tls->sizes[i], tls->bufs[i]);
#endif
    if (i == MAX_TLS_BUFS) {
        fprintf(stderr, "Attempt to htscodecs_tls_free a buffer not allocated"
                " with htscodecs_tls_alloc\n");
        return;
    }
    if (!tls->used[i]) {
        fprintf(stderr, "Attempt to htscodecs_tls_free a buffer twice\n");
        return;
    }
    tls->used[i] = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0xce908
jmp 0xce9a4
movl 0x43f9e(%rip), %edi     # 0x1128ac
callq 0x4790
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0xa, -0x14(%rbp)
jge 0xce945
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq -0x8(%rbp), %rax
jne 0xce938
jmp 0xce945
jmp 0xce93a
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xce91e
cmpl $0xa, -0x14(%rbp)
jne 0xce965
movq 0x3e68e(%rip), %rax     # 0x10cfe0
movq (%rax), %rdi
leaq 0x289e7(%rip), %rsi     # 0xf7343
movb $0x0, %al
callq 0x46d0
jmp 0xce9a4
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
cmpl $0x0, 0xa0(%rax,%rcx,4)
jne 0xce991
movq 0x3e662(%rip), %rax     # 0x10cfe0
movq (%rax), %rdi
leaq 0x28a0a(%rip), %rsi     # 0xf7392
movb $0x0, %al
callq 0x46d0
jmp 0xce9a4
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl $0x0, 0xa0(%rax,%rcx,4)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/htscodecs/htscodecs/utils.c
// Function: htscodecs_tls_free_all
static void htscodecs_tls_free_all(void *ptr) {
    tls_pool *tls = (tls_pool *)ptr;
    if (!tls)
        return;

    int i;
    for (i = 0; i < MAX_TLS_BUFS; i++) {
#ifdef TLS_DEBUG
        if (tls->bufs[i])
            fprintf(stderr, "Free %ld = %p\n", tls->sizes[i], tls->bufs[i]);
#endif
        if (tls->used[i]) {
            fprintf(stderr, "Closing thread while TLS data is in use\n");
        }
        free(tls->bufs[i]);
    }

    free(tls);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0xce9cd
jmp 0xcea29
movl $0x0, -0x14(%rbp)
cmpl $0xa, -0x14(%rbp)
jge 0xcea20
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
cmpl $0x0, 0xa0(%rax,%rcx,4)
je 0xcea04
movq 0x3e5ed(%rip), %rax     # 0x10cfe0
movq (%rax), %rdi
leaq 0x289c3(%rip), %rsi     # 0xf73c0
movb $0x0, %al
callq 0x46d0
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x45a0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xce9d4
movq -0x10(%rbp), %rdi
callq 0x45a0
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hfile_libcurl.c
// Function: vhopen_libcurl
static hFILE *vhopen_libcurl(const char *url, const char *modes, va_list args)
{
    hFILE *fp = NULL;
    http_headers headers = { .fail_on_error = 1 };

    if (parse_va_list(&headers, args) == 0) {
        fp = libcurl_open(url, modes, &headers);
    }

    if (!fp) {
        free_headers(&headers.fixed, 1);
    }
    return fp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
leaq -0x80(%rbp), %rdi
xorl %esi, %esi
movl $0x60, %edx
callq 0x4250
movl $0x1, -0x28(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0xd3050
cmpl $0x0, %eax
jne 0xced2d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0xcf0d0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0xced42
leaq -0x80(%rbp), %rdi
movl $0x1, %esi
callq 0xd0d20
movq -0x20(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hfile_libcurl.c
// Function: libcurl_exit
static void libcurl_exit(void)
{
    if (curl_share_cleanup(curl.share) == CURLSHE_OK)
        curl.share = NULL;

    free(curl.useragent.s);
    curl.useragent.l = curl.useragent.m = 0; curl.useragent.s = NULL;

    free(curl.auth_path);
    curl.auth_path = NULL;

    if (curl.auth_map) {
        khiter_t i;
        for (i = kh_begin(curl.auth_map); i != kh_end(curl.auth_map); ++i) {
            if (kh_exist(curl.auth_map, i)) {
                free_auth(kh_value(curl.auth_map, i));
                kh_key(curl.auth_map, i) = NULL;
                kh_value(curl.auth_map, i) = NULL;
            }
        }
        kh_destroy(auth_map, curl.auth_map);
        curl.auth_map = NULL;
    }

    curl_global_cleanup();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq 0x43919(%rip), %rdi     # 0x1128c8
callq 0x4900
cmpl $0x0, %eax
jne 0xcefc4
movq $0x0, 0x43904(%rip) # 0x1128c8
movq 0x438f5(%rip), %rdi     # 0x1128c0
callq 0x45a0
movq $0x0, 0x438dd(%rip) # 0x1128b8
movq $0x0, 0x438ca(%rip) # 0x1128b0
movq $0x0, 0x438cf(%rip) # 0x1128c0
movq 0x438d8(%rip), %rdi     # 0x1128d0
callq 0x45a0
movq $0x0, 0x438c8(%rip) # 0x1128d0
cmpq $0x0, 0x438c8(%rip)     # 0x1128d8
je 0xcf0bd
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
movq 0x438b1(%rip), %rcx     # 0x1128d8
cmpl (%rcx), %eax
je 0xcf0a6
movq 0x438a6(%rip), %rax     # 0x1128d8
movq 0x10(%rax), %rax
movl -0x4(%rbp), %ecx
shrl $0x4, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl -0x4(%rbp), %ecx
andl $0xf, %ecx
shll %ecx
shrl %cl, %eax
andl $0x3, %eax
cmpl $0x0, %eax
jne 0xcf096
movq 0x4387e(%rip), %rax     # 0x1128d8
movq 0x20(%rax), %rax
movl -0x4(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
callq 0xd13e0
movq 0x43867(%rip), %rax     # 0x1128d8
movq 0x18(%rax), %rax
movl -0x4(%rbp), %ecx
movq $0x0, (%rax,%rcx,8)
movq 0x43851(%rip), %rax     # 0x1128d8
movq 0x20(%rax), %rax
movl -0x4(%rbp), %ecx
movq $0x0, (%rax,%rcx,8)
jmp 0xcf098
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xcf01d
movq 0x4382b(%rip), %rdi     # 0x1128d8
callq 0xcef50
movq $0x0, 0x4381b(%rip) # 0x1128d8
callq 0x4180
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hfile_libcurl.c
// Function: recv_callback
static size_t recv_callback(char *ptr, size_t size, size_t nmemb, void *fpv)
{
    hFILE_libcurl *fp = (hFILE_libcurl *) fpv;
    size_t n = size * nmemb;

    if (n > fp->buffer.len) {
        fp->paused = 1;
        return CURL_WRITEFUNC_PAUSE;
    }
    else if (n == 0) return 0;

    memcpy(fp->buffer.ptr.rd, ptr, n);
    fp->buffer.ptr.rd += n;
    fp->buffer.len -= n;
    return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
imulq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpq 0x58(%rcx), %rax
jbe 0xcfb25
movq -0x30(%rbp), %rax
movb 0x64(%rax), %cl
andb $-0x2, %cl
orb $0x1, %cl
movb %cl, 0x64(%rax)
movq $0x10000001, -0x8(%rbp) # imm = 0x10000001
jmp 0xcfb78
cmpq $0x0, -0x38(%rbp)
jne 0xcfb36
movq $0x0, -0x8(%rbp)
jmp 0xcfb78
jmp 0xcfb38
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x43b0
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
addq 0x50(%rax), %rcx
movq %rcx, 0x50(%rax)
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rax
movq 0x58(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x58(%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hfile_libcurl.c
// Function: send_callback
static size_t send_callback(char *ptr, size_t size, size_t nmemb, void *fpv)
{
    hFILE_libcurl *fp = (hFILE_libcurl *) fpv;
    size_t n = size * nmemb;

    if (fp->buffer.len == 0) {
        // Send buffer is empty; normally pause, or signal EOF if we're closing
        if (fp->closing) return 0;
        else { fp->paused = 1; return CURL_READFUNC_PAUSE; }
    }

    if (n > fp->buffer.len) n = fp->buffer.len;
    memcpy(ptr, fp->buffer.ptr.wr, n);
    fp->buffer.ptr.wr += n;
    fp->buffer.len -= n;
    return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
imulq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x58(%rax)
jne 0xcfbff
movq -0x30(%rbp), %rax
movb 0x64(%rax), %al
shrb %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0xcfbe5
movq $0x0, -0x8(%rbp)
jmp 0xcfc59
movq -0x30(%rbp), %rax
movb 0x64(%rax), %cl
andb $-0x2, %cl
orb $0x1, %cl
movb %cl, 0x64(%rax)
movq $0x10000001, -0x8(%rbp) # imm = 0x10000001
jmp 0xcfc59
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpq 0x58(%rcx), %rax
jbe 0xcfc19
movq -0x30(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rsi
movq -0x38(%rbp), %rdx
callq 0x43b0
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
addq 0x50(%rax), %rcx
movq %rcx, 0x50(%rax)
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rax
movq 0x58(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x58(%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hfile_libcurl.c
// Function: get_header_list
static struct curl_slist * get_header_list(hFILE_libcurl *fp) {
    if (fp->headers.fixed.num > 0)
        return &fp->headers.fixed.list[0];
    if (fp->headers.extra.num > 0)
        return &fp->headers.extra.list[0];
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x78(%rax)
jbe 0xd0340
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0xd0366
movq -0x10(%rbp), %rax
cmpl $0x0, 0x88(%rax)
jbe 0xd035e
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0xd0366
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hfile_libcurl.c
// Function: header_callback
static size_t header_callback(void *contents, size_t size, size_t nmemb,
                              void *userp)
{
    size_t realsize = size * nmemb;
    kstring_t *resp = (kstring_t *)userp;

    if (kputsn((const char *)contents, realsize, resp) == EOF) {
        return 0;
    }

    return realsize;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rax
imulq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0xd1820
cmpl $-0x1, %eax
jne 0xd03bd
movq $0x0, -0x8(%rbp)
jmp 0xd03c5
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hfile_libcurl.c
// Function: multi_errno
static int multi_errno(CURLMcode errm)
{
    switch (errm) {
    case CURLM_CALL_MULTI_PERFORM:
    case CURLM_OK:
        return 0;

    case CURLM_BAD_HANDLE:
    case CURLM_BAD_EASY_HANDLE:
    case CURLM_BAD_SOCKET:
        return EBADF;

    case CURLM_OUT_OF_MEMORY:
        return ENOMEM;

    default:
        hts_log_error("Libcurl reported error %d (%s)", (int) errm,
                      curl_multi_strerror(errm));
        return EIO;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0xc(%rbp)
incl %eax
subl $0x2, %eax
jb 0xd040a
jmp 0xd03ea
movl -0xc(%rbp), %eax
decl %eax
subl $0x2, %eax
jb 0xd0413
jmp 0xd03f6
movl -0xc(%rbp), %eax
subl $0x3, %eax
je 0xd041c
jmp 0xd0400
movl -0xc(%rbp), %eax
subl $0x5, %eax
je 0xd0413
jmp 0xd0425
movl $0x0, -0x4(%rbp)
jmp 0xd045a
movl $0x9, -0x4(%rbp)
jmp 0xd045a
movl $0xc, -0x4(%rbp)
jmp 0xd045a
movl -0x8(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x8(%rbp), %edi
callq 0x4940
movl -0x10(%rbp), %ecx
movq %rax, %r8
movl $0x1, %edi
leaq 0x271e5(%rip), %rsi     # 0xf762a
leaq 0x271ea(%rip), %rdx     # 0xf7636
movb $0x0, %al
callq 0x1b030
movl $0x5, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hfile_libcurl.c
// Function: free_headers
static void free_headers(hdrlist *hdrs, int completely) {
    unsigned int i;
    for (i = 0; i < hdrs->num; i++) {
        free(hdrs->list[i].data);
        hdrs->list[i].data = NULL;
        hdrs->list[i].next = NULL;
    }
    hdrs->num = 0;
    if (completely) {
        free(hdrs->list);
        hdrs->size = 0;
        hdrs->list = NULL;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jae 0xd0d97
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x10(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x45a0
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x10(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq $0x0, (%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x10(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq $0x0, 0x8(%rax)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xd0d36
movq -0x8(%rbp), %rax
movl $0x0, 0x8(%rax)
cmpl $0x0, -0xc(%rbp)
je 0xd0dca
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x45a0
movq -0x8(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hfile_libcurl.c
// Function: free_auth
static void free_auth(auth_token *tok) {
    if (!tok) return;
    if (pthread_mutex_destroy(&tok->lock)) abort();
    free(tok->path);
    free(tok->token);
    free(tok);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0xd13f5
jmp 0xd142e
movq -0x8(%rbp), %rdi
addq $0x20, %rdi
callq 0x4570
cmpl $0x0, %eax
je 0xd140c
callq 0x4260
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x45a0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x45a0
movq -0x8(%rbp), %rdi
callq 0x45a0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hfile_libcurl.c
// Function: renew_auth_token
static int renew_auth_token(auth_token *tok, int *changed) {
    hFILE *auth_fp = NULL;
    char buffer[16];
    ssize_t len;

    *changed = 0;
    if (tok->expiry == 0 || time(NULL) + AUTH_REFRESH_EARLY_SECS < tok->expiry)
        return 0; // Still valid

    if (tok->failed)
        return -1;

    *changed = 1;
    auth_fp = hopen(tok->path, "rR");
    if (!auth_fp) {
        // Not worried about missing files; other errors are bad.
        if (errno != ENOENT)
            goto fail;

        tok->expiry = 0; // Prevent retry
        free(tok->token); // Just in case it was set
        return 0;
    }

    len = hpeek(auth_fp, buffer, sizeof(buffer));
    if (len < 0)
        goto fail;

    if (memchr(buffer, '{', len) != NULL) {
        if (read_auth_json(tok, auth_fp) != 'v')
            goto fail;
    } else {
        if (read_auth_plain(tok, auth_fp) < 0)
            goto fail;
    }

    return hclose(auth_fp) < 0 ? -1 : 0;

 fail:
    tok->failed = 1;
    if (auth_fp) hclose_abruptly(auth_fp);
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0xd1e74
xorl %eax, %eax
movl %eax, %edi
callq 0x4440
addq $0x3c, %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jge 0xd1e80
movl $0x0, -0x4(%rbp)
jmp 0xd1f96
movq -0x10(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0xd1e96
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd1f96
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0x25738(%rip), %rsi     # 0xf75e6
movb $0x0, %al
callq 0x158b0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0xd1ef4
callq 0x4050
cmpl $0x2, (%rax)
je 0xd1ecf
jmp 0xd1f74
movq -0x10(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x45a0
movl $0x0, -0x4(%rbp)
jmp 0xd1f96
movq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x10, %edx
callq 0x140b0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jge 0xd1f13
jmp 0xd1f74
leaq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rdx
movl $0x7b, %esi
callq 0x4530
cmpq $0x0, %rax
je 0xd1f41
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xd1fa0
cmpl $0x76, %eax
je 0xd1f3f
jmp 0xd1f74
jmp 0xd1f57
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xd2290
cmpl $0x0, %eax
jge 0xd1f55
jmp 0xd1f74
jmp 0xd1f57
movq -0x20(%rbp), %rdi
callq 0x14920
movl %eax, %edx
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl $0x0, %edx
cmovll %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0xd1f96
movq -0x10(%rbp), %rax
movl $0x1, 0x18(%rax)
cmpq $0x0, -0x20(%rbp)
je 0xd1f8f
movq -0x20(%rbp), %rdi
callq 0x149d0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hfile_libcurl.c
// Function: read_auth_plain
static int read_auth_plain(auth_token *tok, hFILE *auth_fp) {
    kstring_t line = {0, 0, NULL};
    kstring_t token = {0, 0, NULL};
    const char *start, *end;

    if (kgetline(&line, (char * (*)(char *, int, void *)) hgets, auth_fp) < 0) goto error;
    if (kputc('\0', &line) < 0) goto error;

    for (start = line.s; *start && isspace_c(*start); start++) {}
    for (end = start; *end && !isspace_c(*end); end++) {}

    if (end > start) {
        if (kputs("Authorization: Bearer ", &token) < 0) goto error;
        if (kputsn(start, end - start, &token) < 0) goto error;
    }

    free(tok->token);
    tok->token = ks_release(&token);
    tok->expiry = 0;
    free(line.s);
    return 0;

 error:
    free(line.s);
    free(token.s);
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x4250
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x4250
movq -0x18(%rbp), %rdx
leaq -0x30(%rbp), %rdi
leaq -0xbe2cf(%rip), %rsi    # 0x14000
callq 0xb600
cmpl $0x0, %eax
jge 0xd22de
jmp 0xd2404
xorl %edi, %edi
leaq -0x30(%rbp), %rsi
callq 0xd2430
cmpl $0x0, %eax
jge 0xd22f3
jmp 0xd2404
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x59(%rbp)
je 0xd2321
movq -0x50(%rbp), %rax
movsbl (%rax), %edi
callq 0xd24b0
cmpl $0x0, %eax
setne %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
testb $0x1, %al
jne 0xd232a
jmp 0xd233a
jmp 0xd232c
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0xd22fb
movq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x5a(%rbp)
je 0xd236a
movq -0x58(%rbp), %rax
movsbl (%rax), %edi
callq 0xd24b0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x5a(%rbp)
movb -0x5a(%rbp), %al
testb $0x1, %al
jne 0xd2373
jmp 0xd2383
jmp 0xd2375
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0xd2342
movq -0x58(%rbp), %rax
cmpq -0x50(%rbp), %rax
jbe 0xd23c5
leaq 0x2527f(%rip), %rdi     # 0xf7613
leaq -0x48(%rbp), %rsi
callq 0xd0ed0
cmpl $0x0, %eax
jge 0xd23a4
jmp 0xd2404
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rax
subq %rax, %rsi
leaq -0x48(%rbp), %rdx
callq 0xd1820
cmpl $0x0, %eax
jge 0xd23c3
jmp 0xd2404
jmp 0xd23c5
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x45a0
leaq -0x48(%rbp), %rdi
callq 0xd0750
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x20(%rbp), %rdi
callq 0x45a0
movl $0x0, -0x4(%rbp)
jmp 0xd241d
movq -0x20(%rbp), %rdi
callq 0x45a0
movq -0x38(%rbp), %rdi
callq 0x45a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hfile_libcurl.c
// Function: process_messages
static void process_messages(hFILE_libcurl *fp)
{
    CURLMsg *msg;
    int remaining;

    while ((msg = curl_multi_info_read(fp->multi, &remaining)) != NULL) {
        switch (msg->msg) {
        case CURLMSG_DONE:
            fp->finished = 1;
            fp->final_result = msg->data.result;
            break;

        default:
            break;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
leaq -0x14(%rbp), %rsi
callq 0x4890
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0xd2538
movq -0x10(%rbp), %rax
movl (%rax), %eax
subl $0x1, %eax
jne 0xd2534
jmp 0xd2514
movq -0x8(%rbp), %rax
movb 0x64(%rax), %cl
andb $-0x5, %cl
orb $0x4, %cl
movb %cl, 0x64(%rax)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x60(%rax)
jmp 0xd2536
jmp 0xd2536
jmp 0xd24ec
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hfile_libcurl.c
// Function: libcurl_write
static ssize_t libcurl_write(hFILE *fpv, const void *bufferv, size_t nbytes)
{
    hFILE_libcurl *fp = (hFILE_libcurl *) fpv;
    const char *buffer = (const char *) bufferv;
    CURLcode err;

    fp->buffer.ptr.wr = buffer;
    fp->buffer.len = nbytes;
    fp->paused = 0;
    err = curl_easy_pause(fp->easy, CURLPAUSE_CONT);
    if (err != CURLE_OK) { errno = easy_errno(fp->easy, err); return -1; }

    while (! fp->paused && ! fp->finished)
        if (wait_perform(fp) < 0) return -1;

    nbytes = fp->buffer.ptr.wr - buffer;
    fp->buffer.ptr.wr = NULL;
    fp->buffer.len = 0;

    if (fp->finished && fp->final_result != CURLE_OK) {
        errno = easy_errno(fp->easy, fp->final_result);
        return -1;
    }

    return nbytes;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x28(%rbp), %rax
movb 0x64(%rax), %cl
andb $-0x2, %cl
orb $0x0, %cl
movb %cl, 0x64(%rax)
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rdi
xorl %esi, %esi
callq 0x4970
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0xd2a0e
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rdi
movl -0x34(%rbp), %esi
callq 0xced50
movl %eax, -0x38(%rbp)
callq 0x4050
movl -0x38(%rbp), %ecx
movl %ecx, (%rax)
movq $-0x1, -0x8(%rbp)
jmp 0xd2adf
jmp 0xd2a10
movq -0x28(%rbp), %rax
movb 0x64(%rax), %al
andb $0x1, %al
movzbl %al, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x39(%rbp)
jne 0xd2a40
movq -0x28(%rbp), %rax
movb 0x64(%rax), %al
shrb $0x2, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
testb $0x1, %al
jne 0xd2a49
jmp 0xd2a63
movq -0x28(%rbp), %rdi
callq 0xd0470
cmpl $0x0, %eax
jge 0xd2a61
movq $-0x1, -0x8(%rbp)
jmp 0xd2adf
jmp 0xd2a10
movq -0x28(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rax
movq $0x0, 0x50(%rax)
movq -0x28(%rbp), %rax
movq $0x0, 0x58(%rax)
movq -0x28(%rbp), %rax
movb 0x64(%rax), %al
shrb $0x2, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0xd2ad7
movq -0x28(%rbp), %rax
cmpl $0x0, 0x60(%rax)
je 0xd2ad7
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x28(%rbp), %rax
movl 0x60(%rax), %esi
callq 0xced50
movl %eax, -0x40(%rbp)
callq 0x4050
movl -0x40(%rbp), %ecx
movl %ecx, (%rax)
movq $-0x1, -0x8(%rbp)
jmp 0xd2adf
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hfile_libcurl.c
// Function: preserve_buffer_content
static void preserve_buffer_content(hFILE_libcurl *fp)
{
    if (fp->base.begin == fp->base.end) {
        fp->preserved_bytes = 0;
        return;
    }
    if (!fp->preserved
        || fp->preserved_size < fp->base.limit - fp->base.buffer) {
        fp->preserved = malloc(fp->base.limit - fp->base.buffer);
        if (!fp->preserved) return;
        fp->preserved_size = fp->base.limit - fp->base.buffer;
    }

    assert(fp->base.end - fp->base.begin <= fp->preserved_size);

    memcpy(fp->preserved, fp->base.begin, fp->base.end - fp->base.begin);
    fp->preserved_bytes = fp->base.end - fp->base.begin;
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0xd2f32
movq -0x8(%rbp), %rax
movq $0x0, 0xe8(%rax)
jmp 0xd3041
movq -0x8(%rbp), %rax
cmpq $0x0, 0xe0(%rax)
je 0xd2f62
movq -0x8(%rbp), %rax
movq 0xf0(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0x8(%rbp), %rdx
movq (%rdx), %rdx
subq %rdx, %rcx
cmpq %rcx, %rax
jae 0xd2fb7
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rax
subq %rax, %rdi
callq 0x4650
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xe0(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0xe0(%rax)
jne 0xd2f9a
jmp 0xd3041
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x8(%rbp), %rax
movq (%rax), %rax
subq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xf0(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
subq %rcx, %rax
movq -0x8(%rbp), %rcx
cmpq 0xf0(%rcx), %rax
ja 0xd2fd9
jmp 0xd2ff8
leaq 0x246d7(%rip), %rdi     # 0xf76b7
leaq 0x24692(%rip), %rsi     # 0xf7679
movl $0x398, %edx            # imm = 0x398
leaq 0x246f8(%rip), %rcx     # 0xf76eb
callq 0x42e0
movq -0x8(%rbp), %rax
movq 0xe0(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
subq %rax, %rdx
callq 0x43b0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
subq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xe8(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hfile_libcurl.c
// Function: http_status_errno
static int http_status_errno(int status)
{
    if (status >= 500)
        switch (status) {
        case 501: return ENOSYS;
        case 503: return EBUSY;
        case 504: return ETIMEDOUT;
        default:  return EIO;
        }
    else if (status >= 400)
        switch (status) {
        case 401: return EPERM;
        case 403: return EACCES;
        case 404: return ENOENT;
        case 405: return EROFS;
        case 407: return EPERM;
        case 408: return ETIMEDOUT;
        case 410: return ENOENT;
        default:  return EINVAL;
        }
    else return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
cmpl $0x1f4, -0x8(%rbp)      # imm = 0x1F4
jl 0xd3814
movl -0x8(%rbp), %eax
movl %eax, -0xc(%rbp)
subl $0x1f5, %eax            # imm = 0x1F5
je 0xd37e7
jmp 0xd37cf
movl -0xc(%rbp), %eax
subl $0x1f7, %eax            # imm = 0x1F7
je 0xd37f3
jmp 0xd37db
movl -0xc(%rbp), %eax
subl $0x1f8, %eax            # imm = 0x1F8
je 0xd37ff
jmp 0xd380b
movl $0x26, -0x4(%rbp)
jmp 0xd3893
movl $0x10, -0x4(%rbp)
jmp 0xd3893
movl $0x6e, -0x4(%rbp)
jmp 0xd3893
movl $0x5, -0x4(%rbp)
jmp 0xd3893
cmpl $0x190, -0x8(%rbp)      # imm = 0x190
jl 0xd388c
movl -0x8(%rbp), %eax
addl $0xfffffe6f, %eax       # imm = 0xFFFFFE6F
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x9, %eax
ja 0xd3883
movq -0x18(%rbp), %rax
leaq 0x23cd9(%rip), %rcx     # 0xf7514
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x1, -0x4(%rbp)
jmp 0xd3893
movl $0xd, -0x4(%rbp)
jmp 0xd3893
movl $0x2, -0x4(%rbp)
jmp 0xd3893
movl $0x1e, -0x4(%rbp)
jmp 0xd3893
movl $0x1, -0x4(%rbp)
jmp 0xd3893
movl $0x6e, -0x4(%rbp)
jmp 0xd3893
movl $0x2, -0x4(%rbp)
jmp 0xd3893
movl $0x16, -0x4(%rbp)
jmp 0xd3893
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/faidx.c
// Function: fai_destroy
void fai_destroy(faidx_t *fai)
{
    int i;
    if (!fai) return;
    for (i = 0; i < fai->n; ++i) free(fai->name[i]);
    free(fai->name);
    kh_destroy(s, fai->hash);
    if (fai->bgzf) bgzf_close(fai->bgzf);
    free(fai);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0xd38b5
jmp 0xd3921
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0xd38e8
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x45a0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xd38bc
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x45a0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xd3930
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0xd3918
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x103d0
movq -0x8(%rbp), %rdi
callq 0x45a0
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/faidx.c
// Function: fai_get_val
static int fai_get_val(const faidx_t *fai, const char *str,
                       hts_pos_t *len, faidx1_t *val, hts_pos_t *fbeg, hts_pos_t *fend) {
    khiter_t iter;
    khash_t(s) *h;
    int id;
    hts_pos_t beg, end;

    if (!fai_parse_region(fai, str, &id, &beg, &end, 0)) {
        hts_log_warning("Reference %s not found in FASTA file, returning empty sequence", str);
        *len = -2;
        return 1;
    }

    h = fai->hash;
    iter = kh_get(s, h, faidx_iseq(fai, id));
    if (iter >= kh_end(h)) {
        // should have already been caught above
        abort();
    }
    *val = kh_value(h, iter);

    if (beg >= val->len) beg = val->len;
    if (end >= val->len) end = val->len;
    if (beg > end) beg = end;

    *fbeg = beg;
    *fend = end;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x4c(%rbp), %rdx
leaq -0x58(%rbp), %rcx
leaq -0x60(%rbp), %r8
xorl %r9d, %r9d
callq 0xd5270
cmpq $0x0, %rax
jne 0xd4547
movq -0x18(%rbp), %rcx
movl $0x3, %edi
leaq 0x23989(%rip), %rsi     # 0xf7eab
leaq 0x2398e(%rip), %rdx     # 0xf7eb7
movb $0x0, %al
callq 0x1b030
movq -0x20(%rbp), %rax
movq $-0x2, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0xd4609
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rdi
movl -0x4c(%rbp), %esi
callq 0xd4b80
movq -0x68(%rbp), %rdi
movq %rax, %rsi
callq 0xd4c10
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl (%rcx), %eax
jb 0xd4586
callq 0x4260
movq -0x28(%rbp), %rdi
movq -0x48(%rbp), %rax
movq 0x20(%rax), %rsi
movl -0x3c(%rbp), %eax
imulq $0x28, %rax, %rax
addq %rax, %rsi
movl $0x28, %edx
callq 0x43b0
movq -0x58(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jb 0xd45c0
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x60(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jb 0xd45da
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x60(%rbp), %rax
jle 0xd45ec
movq -0x60(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x60(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/faidx.c
// Function: fai_fetch
char *fai_fetch(const faidx_t *fai, const char *str, int *len)
{
    hts_pos_t len64;
    char *ret = fai_fetch64(fai, str, &len64);
    *len = len64 < INT_MAX ? len64 : INT_MAX; // trunc
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0xd4620
movq %rax, -0x28(%rbp)
cmpq $0x7fffffff, -0x20(%rbp) # imm = 0x7FFFFFFF
jge 0xd4a4d
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0xd4a58
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, -0x30(%rbp)
jmp 0xd4a58
movq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/faidx.c
// Function: fai_fetchqual64
char *fai_fetchqual64(const faidx_t *fai, const char *str, hts_pos_t *len) {
    faidx1_t val;
    int64_t beg, end;

    if (fai_get_val(fai, str, len, &val, &beg, &end)) {
        return NULL;
    }

    // now retrieve the sequence
    return fai_retrieve(fai, &val, val.qual_offset, beg, end, len);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x48(%rbp), %rcx
leaq -0x50(%rbp), %r8
leaq -0x58(%rbp), %r9
callq 0xd44d0
cmpl $0x0, %eax
je 0xd4ab0
movq $0x0, -0x8(%rbp)
jmp 0xd4ad1
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rdx
movq -0x50(%rbp), %rcx
movq -0x58(%rbp), %r8
movq -0x20(%rbp), %r9
leaq -0x48(%rbp), %rsi
callq 0xd4690
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/faidx.c
// Function: fai_fetchqual
char *fai_fetchqual(const faidx_t *fai, const char *str, int *len) {
    hts_pos_t len64;
    char *ret = fai_fetchqual64(fai, str, &len64);
    *len = len64 < INT_MAX ? len64 : INT_MAX; // trunc
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0xd4a70
movq %rax, -0x28(%rbp)
cmpq $0x7fffffff, -0x20(%rbp) # imm = 0x7FFFFFFF
jge 0xd4b1d
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0xd4b28
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, -0x30(%rbp)
jmp 0xd4b28
movq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/faidx.c
// Function: fai_adjust_region
int fai_adjust_region(const faidx_t *fai, int tid,
                      hts_pos_t *beg, hts_pos_t *end)
{
    hts_pos_t orig_beg, orig_end;

    if (!fai || !beg || !end || tid < 0 || tid >= fai->n)
        return -1;

    orig_beg = *beg;
    orig_end = *end;
    if (faidx_adjust_position(fai, 0, NULL, fai->name[tid], beg, end, NULL) != 0) {
        hts_log_error("Inconsistent faidx internal state - couldn't find \"%s\"",
                      fai->name[tid]);
        return -1;
    }

    return ((orig_beg != *beg ? 1 : 0) |
            (orig_end != *end && orig_end < HTS_POS_MAX ? 2 : 0));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xd4dee
cmpq $0x0, -0x20(%rbp)
je 0xd4dee
cmpq $0x0, -0x28(%rbp)
je 0xd4dee
cmpl $0x0, -0x14(%rbp)
jl 0xd4dee
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jl 0xd4dfa
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd4ed2
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x20(%rbp), %r8
movq -0x28(%rbp), %r9
xorl %esi, %esi
xorl %eax, %eax
movl %eax, %edx
movq $0x0, (%rsp)
callq 0xd4ee0
cmpl $0x0, %eax
je 0xd4e77
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movl $0x1, %edi
leaq 0x22964(%rip), %rsi     # 0xf77c4
leaq 0x2296f(%rip), %rdx     # 0xf77d6
movb $0x0, %al
callq 0x1b030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd4ed2
movq -0x30(%rbp), %rdx
movq -0x20(%rbp), %rax
movq (%rax), %rsi
xorl %eax, %eax
movl $0x1, %ecx
cmpq %rsi, %rdx
cmovnel %ecx, %eax
movl %eax, -0x40(%rbp)
movq -0x38(%rbp), %rcx
movq -0x28(%rbp), %rdx
xorl %eax, %eax
cmpq (%rdx), %rcx
movb %al, -0x39(%rbp)
je 0xd4eb8
movabsq $0x7fffffff7fffffff, %rax # imm = 0x7FFFFFFF7FFFFFFF
cmpq %rax, -0x38(%rbp)
setl %al
movb %al, -0x39(%rbp)
movl -0x40(%rbp), %eax
movb -0x39(%rbp), %sil
xorl %ecx, %ecx
movl $0x2, %edx
testb $0x1, %sil
cmovnel %edx, %ecx
orl %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/faidx.c
// Function: faidx_adjust_position
static int faidx_adjust_position(const faidx_t *fai, int end_adjust,
                                 faidx1_t *val_out, const char *c_name,
                                 hts_pos_t *p_beg_i, hts_pos_t *p_end_i,
                                 hts_pos_t *len) {
    khiter_t iter;
    faidx1_t *val;

    // Adjust position
    iter = kh_get(s, fai->hash, c_name);

    if (iter == kh_end(fai->hash)) {
        if (len)
            *len = -2;
        hts_log_error("The sequence \"%s\" was not found", c_name);
        return 1;
    }

    val = &kh_value(fai->hash, iter);

    if (val_out)
        *val_out = *val;

    if(*p_end_i < *p_beg_i)
        *p_beg_i = *p_end_i;

    if(*p_beg_i < 0)
        *p_beg_i = 0;
    else if(val->len <= *p_beg_i)
        *p_beg_i = val->len;

    if(*p_end_i < 0)
        *p_end_i = 0;
    else if(val->len <= *p_end_i)
        *p_end_i = val->len - end_adjust;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0xd4c10
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpl (%rcx), %eax
jne 0xd4f62
cmpq $0x0, 0x10(%rbp)
je 0xd4f38
movq 0x10(%rbp), %rax
movq $-0x2, (%rax)
movq -0x28(%rbp), %rcx
movl $0x1, %edi
leaq 0x23085(%rip), %rsi     # 0xf7fcd
leaq 0x23094(%rip), %rdx     # 0xf7fe3
movb $0x0, %al
callq 0x1b030
movl $0x1, -0x4(%rbp)
jmp 0xd5033
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movl -0x3c(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xd4f95
movq -0x20(%rbp), %rdi
movq -0x48(%rbp), %rsi
movl $0x28, %edx
callq 0x43b0
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
cmpq (%rcx), %rax
jge 0xd4fb3
movq -0x38(%rbp), %rax
movq (%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
jge 0xd4fca
movq -0x30(%rbp), %rax
movq $0x0, (%rax)
jmp 0xd4fec
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
cmpq (%rcx), %rax
ja 0xd4fea
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
jmp 0xd4fec
movq -0x38(%rbp), %rax
cmpq $0x0, (%rax)
jge 0xd5003
movq -0x38(%rbp), %rax
movq $0x0, (%rax)
jmp 0xd502c
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
ja 0xd502a
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rcx
movslq -0x14(%rbp), %rax
subq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
jmp 0xd502c
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/faidx.c
// Function: faidx_fetch_seq
char *faidx_fetch_seq(const faidx_t *fai, const char *c_name, int p_beg_i, int p_end_i, int *len)
{
    hts_pos_t len64;
    char *ret = faidx_fetch_seq64(fai, c_name, p_beg_i, p_end_i, &len64);
    *len = len64 < INT_MAX ? len64 : INT_MAX;  // trunc
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rdx
movslq -0x18(%rbp), %rcx
leaq -0x28(%rbp), %r8
callq 0xd5040
movq %rax, -0x30(%rbp)
cmpq $0x7fffffff, -0x28(%rbp) # imm = 0x7FFFFFFF
jge 0xd510b
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0xd5116
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, -0x38(%rbp)
jmp 0xd5116
movq -0x38(%rbp), %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/faidx.c
// Function: faidx_fetch_qual
char *faidx_fetch_qual(const faidx_t *fai, const char *c_name, int p_beg_i, int p_end_i, int *len)
{
    hts_pos_t len64;
    char *ret = faidx_fetch_qual64(fai, c_name, p_beg_i, p_end_i, &len64);
    *len = len64 < INT_MAX ? len64 : INT_MAX;  // trunc
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rdx
movslq -0x18(%rbp), %rcx
leaq -0x28(%rbp), %r8
callq 0xd5130
movq %rax, -0x30(%rbp)
cmpq $0x7fffffff, -0x28(%rbp) # imm = 0x7FFFFFFF
jge 0xd51fb
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0xd5206
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, -0x38(%rbp)
jmp 0xd5206
movq -0x38(%rbp), %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/faidx.c
// Function: fai_path
char *fai_path(const char *fa) {
    char *fai = NULL;
    if (!fa) {
        hts_log_error("No reference file specified");
    } else {
        char *fai_tmp = strstr(fa, HTS_IDX_DELIM);
        if (fai_tmp) {
            fai_tmp += strlen(HTS_IDX_DELIM);
            fai = strdup(fai_tmp);
            if (!fai)
                hts_log_error("Failed to allocate memory");
        } else {
            if (hisremote(fa)) {
                fai = hts_idx_locatefn(fa, ".fai");       // get the remote fai file name, if any, but do not download the file
                if (!fai)
                    hts_log_error("Failed to locate index file for remote reference file '%s'", fa);
            } else{
                if (hts_idx_check_local(fa, HTS_FMT_FAI, &fai) == 0 && fai) {
                    if (fai_build3(fa, fai, NULL) == -1) {      // create local fai file by indexing local fasta
                        hts_log_error("Failed to build index file for reference file '%s'", fa);
                        free(fai);
                        fai = NULL;
                    }
                }
            }
        }
    }

    return fai;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0xd53ca
movl $0x1, %edi
leaq 0x22456(%rip), %rsi     # 0xf780d
leaq 0x22458(%rip), %rdx     # 0xf7816
movb $0x0, %al
callq 0x1b030
jmp 0xd54d8
movq -0x8(%rbp), %rdi
leaq 0x1ad43(%rip), %rsi     # 0xf0118
callq 0x40c0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xd5424
movq -0x18(%rbp), %rax
addq $0x7, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x4920
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0xd541f
movl $0x1, %edi
leaq 0x223fc(%rip), %rsi     # 0xf780d
leaq 0x2241a(%rip), %rdx     # 0xf7832
movb $0x0, %al
callq 0x1b030
jmp 0xd54d6
movq -0x8(%rbp), %rdi
callq 0x15cf0
cmpl $0x0, %eax
je 0xd546d
movq -0x8(%rbp), %rdi
leaq 0x20953(%rip), %rsi     # 0xf5d90
callq 0x25a80
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0xd546b
movq -0x8(%rbp), %rcx
movl $0x1, %edi
leaq 0x223b0(%rip), %rsi     # 0xf780d
leaq 0x223e8(%rip), %rdx     # 0xf784c
movb $0x0, %al
callq 0x1b030
jmp 0xd54d4
movq -0x8(%rbp), %rdi
movl $0x4, %esi
leaq -0x10(%rbp), %rdx
callq 0x25370
cmpl $0x0, %eax
jne 0xd54d2
cmpq $0x0, -0x10(%rbp)
je 0xd54d2
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xd3980
cmpl $-0x1, %eax
jne 0xd54d0
movq -0x8(%rbp), %rcx
movl $0x1, %edi
leaq 0x2235c(%rip), %rsi     # 0xf780d
leaq 0x223cf(%rip), %rdx     # 0xf7887
movb $0x0, %al
callq 0x1b030
movq -0x10(%rbp), %rdi
callq 0x45a0
movq $0x0, -0x10(%rbp)
jmp 0xd54d2
jmp 0xd54d4
jmp 0xd54d6
jmp 0xd54d8
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)