LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/servCrunx.c
// Function: makeTempName
static void _makeTempName(struct tempName *tn, char *base, char *suffix)
/* Figure out a temp name, and how CGI and HTML will access it. */
{
char *tname;
char *tempDirCgi = __trashDir;
char *tempDirHtml = "/trash";
int tlcLen = strlen(tempDirCgi);
int tlhLen = strlen(tempDirHtml);

tname = rTempName(tempDirCgi, base, suffix);
strcpy(tn->forCgi, tname);
memcpy(tn->forHtml, tempDirHtml, tlhLen);
strcpy(tn->forHtml+tlhLen, tn->forCgi+tlcLen);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x4c050(%rip), %rdi     # 0x98083
callq 0x34c1b
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6680
movl $0x6172742f, 0x1000(%rbx) # imm = 0x6172742F
movw $0x6873, 0x1004(%rbx)   # imm = 0x6873
leaq 0x1006(%rbx), %rdi
addq $0x16, %rbx
movq %rbx, %rsi
popq %rbx
jmp 0x6680
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/servcl.c
// Function: trashDir
static char *_trashDir()
/* Return the path for temporary files: default is "." but env var JKTRASH can override. */
{
static char *__trashDir = NULL;
if (__trashDir == NULL)
    {
    char *jktrashDir = getenv("JKTRASH");
    __trashDir = jktrashDir ? jktrashDir : ".";
    }
return __trashDir;
}

// Assembly:
cmpq $0x0, 0x885a4(%rip)     # 0xd46c0
jne 0x4c144
pushq %rax
leaq 0x4bf86(%rip), %rdi     # 0x980ac
callq 0x68f0
testq %rax, %rax
leaq 0x44753(%rip), %rcx     # 0x90888
cmovneq %rax, %rcx
movq %rcx, 0x88580(%rip)     # 0xd46c0
addq $0x8, %rsp
movq 0x88575(%rip), %rax     # 0xd46c0
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/hts.c
// Function: parse_version
static void
parse_version(htsFormat *fmt, const unsigned char *u, const unsigned char *ulim)
{
    const char *str  = (const char *) u;
    const char *slim = (const char *) ulim;
    const char *s;

    fmt->version.major = fmt->version.minor = -1;

    for (s = str; s < slim; s++) if (!isdigit(*s)) break;
    if (s < slim) {
        fmt->version.major = atoi(str);
        if (*s == '.') {
            str = &s[1];
            for (s = str; s < slim; s++) if (!isdigit(*s)) break;
            if (s < slim)
                fmt->version.minor = atoi(str);
        }
        else
            fmt->version.minor = 0;
    }
}

// Assembly:
movl $0xffffffff, 0x8(%rdi)  # imm = 0xFFFFFFFF
cmpq %rdx, %rsi
jae 0x4d013
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
callq 0x6790
movq (%rax), %r13
movq %r12, %r15
movsbq (%r15), %rax
testb $0x8, 0x1(%r13,%rax,2)
je 0x4cfc7
incq %r15
cmpq %r14, %r15
jne 0x4cfb1
jmp 0x4d00a
movq %r12, %rdi
callq 0x6bd0
movw %ax, 0x8(%rbx)
cmpb $0x2e, (%r15)
jne 0x4cffa
incq %r15
cmpq %r14, %r15
jae 0x4d00a
movq %r15, %rax
movsbq (%rax), %rcx
testb $0x8, 0x1(%r13,%rcx,2)
je 0x4cffe
incq %rax
cmpq %r14, %rax
jb 0x4cfe4
jmp 0x4d00a
xorl %eax, %eax
jmp 0x4d006
movq %r15, %rdi
callq 0x6bd0
movw %ax, 0xa(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/hts.c
// Function: hts_open_format
htsFile *hts_open_format(const char *fn, const char *mode, const htsFormat *fmt)
{
    char smode[102], *cp, *cp2, *mode_c;
    htsFile *fp = NULL;
    hFILE *hfile;
    char fmt_code = '\0';

    strncpy(smode, mode, 100);
    smode[100]=0;
    if ((cp = strchr(smode, ',')))
        *cp = '\0';

    // Migrate format code (b or c) to the end of the smode buffer.
    for (cp2 = cp = smode; *cp; cp++) {
        if (*cp == 'b')
            fmt_code = 'b';
        else if (*cp == 'c')
            fmt_code = 'c';
        else
            *cp2++ = *cp;
    }
    mode_c = cp2;
    *cp2++ = fmt_code;
    *cp2++ = 0;
    *cp2++ = 0;

    // Set or reset the format code if opts->format is used
    if (fmt && fmt->format != unknown_format)
        *mode_c = "\0g\0\0b\0c\0\0b\0g\0\0"[fmt->format];

    hfile = hopen(fn, smode);
    if (hfile == NULL) goto error;

    fp = hts_hopen(hfile, fn, smode);
    if (fp == NULL) goto error;

    if (fmt && fmt->specific)
        if (hts_opt_apply(fp, fmt->specific) != 0)
            goto error;

    return fp;

error:
    if (hts_verbose >= 2)
        fprintf(stderr, "[E::%s] fail to open file '%s'\n", __func__, fn);

    if (hfile)
        hclose_abruptly(hfile);

    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %r14
movq %rdi, %rbx
movq %rsp, %r15
movl $0x64, %edx
movq %r15, %rdi
callq 0x6380
movb $0x0, 0x64(%r15)
movq %r15, %rdi
movl $0x2c, %esi
callq 0x6270
testq %rax, %rax
je 0x4d9a9
movb $0x0, (%rax)
xorl %ecx, %ecx
movq %r15, %rax
movb (%r15), %dl
movzbl %dl, %esi
leal -0x62(%rsi), %edi
cmpl $0x2, %edi
jae 0x4d9c0
movl %edx, %ecx
jmp 0x4d9c9
testl %esi, %esi
je 0x4d9ce
movb %dl, (%rax)
incq %rax
incq %r15
jmp 0x4d9ae
movb %cl, (%rax)
movw $0x0, 0x1(%rax)
testq %r14, %r14
je 0x4d9f0
movl 0x4(%r14), %ecx
testq %rcx, %rcx
je 0x4d9f0
leaq 0x4a905(%rip), %rdx     # 0x982f0
movb (%rcx,%rdx), %cl
movb %cl, (%rax)
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x6b707
movq %rax, %r15
testq %rax, %rax
je 0x4da4a
movq %rsp, %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4da96
testq %rax, %rax
je 0x4da4a
movq %rax, %r12
testq %r14, %r14
je 0x4da63
movq 0x18(%r14), %r14
testq %r14, %r14
je 0x4da63
movl 0x8(%r14), %esi
movq 0x10(%r14), %rdx
movq %r12, %rdi
xorl %eax, %eax
callq 0x4e279
testl %eax, %eax
jne 0x4da4a
movq 0x18(%r14), %r14
testq %r14, %r14
jne 0x4da27
testl %eax, %eax
je 0x4da63
cmpl $0x2, 0x73377(%rip)     # 0xc0dc8
jge 0x4da72
testq %r15, %r15
je 0x4da60
movq %r15, %rdi
callq 0x6b3d8
xorl %r12d, %r12d
movq %r12, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x7155f(%rip), %rax     # 0xbefd8
movq (%rax), %rdi
leaq 0x4a98d(%rip), %rsi     # 0x98410
leaq 0x4a9a6(%rip), %rdx     # 0x98430
movq %rbx, %rcx
xorl %eax, %eax
callq 0x6a90
jmp 0x4da53
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/hts.c
// Function: hts_set_opt
int hts_set_opt(htsFile *fp, enum hts_fmt_option opt, ...) {
    int r;
    va_list args;

    if (opt == HTS_OPT_NTHREADS) {
        va_start(args, opt);
        int nthreads = va_arg(args, int);
        va_end(args);
        return hts_set_threads(fp, nthreads);
    }

    if (fp->format.format != cram)
        return 0;

    va_start(args, opt);
    r = cram_set_voption(fp->fp.cram, opt, args);
    va_end(args);

    return r;
}

// Assembly:
subq $0xd8, %rsp
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x4e2cf
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
cmpl $0x65, %esi
jne 0x4e316
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
movl $0x10, %ecx
cmpq $0x28, %rcx
ja 0x4e34e
movl $0x10, %eax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x4e35c
xorl %eax, %eax
cmpl $0x6, 0x44(%rdi)
jne 0x4e363
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
movq 0x38(%rdi), %rdi
callq 0x5cccf
jmp 0x4e363
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movl (%rax), %esi
callq 0x4e673
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/hts.c
// Function: hts_parse_format
int hts_parse_format(htsFormat *format, const char *str) {
    const char *cp;

    if (!(cp = strchr(str, ',')))
        cp = str+strlen(str);

    format->version.minor = 0; // unknown
    format->version.major = 0; // unknown

    if (strncmp(str, "sam", cp-str) == 0) {
        format->category          = sequence_data;
        format->format            = sam;
        format->compression       = no_compression;;
        format->compression_level = 0;
    } else if (strncmp(str, "bam", cp-str) == 0) {
        format->category          = sequence_data;
        format->format            = bam;
        format->compression       = bgzf;
        format->compression_level = -1;
    } else if (strncmp(str, "cram", cp-str) == 0) {
        format->category          = sequence_data;
        format->format            = cram;
        format->compression       = custom;
        format->compression_level = -1;
    } else if (strncmp(str, "vcf", cp-str) == 0) {
        format->category          = variant_data;
        format->format            = vcf;
        format->compression       = no_compression;;
        format->compression_level = 0;
    } else if (strncmp(str, "bcf", cp-str) == 0) {
        format->category          = variant_data;
        format->format            = bcf;
        format->compression       = bgzf;
        format->compression_level = -1;
    } else {
        return -1;
    }

    return hts_parse_opt_list(format, cp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
movl $0x2c, %esi
callq 0x6270
movq %rax, %r14
testq %rax, %rax
jne 0x4e46e
movq %r15, %rdi
callq 0x62d0
movq %rax, %r14
addq %r15, %r14
movl $0x0, 0x8(%rbx)
movq %r14, %r12
subq %r15, %r12
leaq 0x4a129(%rip), %rsi     # 0x985ab
movq %r15, %rdi
movq %r12, %rdx
callq 0x6330
movl $0x1, %r13d
testl %eax, %eax
je 0x4e507
leaq 0x4a111(%rip), %rsi     # 0x985af
movq %r15, %rdi
movq %r12, %rdx
callq 0x6330
movw $0xffff, %bp            # imm = 0xFFFF
testl %eax, %eax
je 0x4e512
leaq 0x4a0fb(%rip), %rsi     # 0x985b3
movq %r15, %rdi
movq %r12, %rdx
callq 0x6330
testl %eax, %eax
je 0x4e51e
leaq 0x4a14b(%rip), %rsi     # 0x98619
movq %r15, %rdi
movq %r12, %rdx
callq 0x6330
testl %eax, %eax
je 0x4e52a
leaq 0x4a13a(%rip), %rsi     # 0x9861e
movq %r15, %rdi
movq %r12, %rdx
callq 0x6330
testl %eax, %eax
je 0x4e539
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
movl $0x3, %ecx
xorl %ebp, %ebp
jmp 0x4e549
movl $0x2, %eax
movl $0x4, %ecx
jmp 0x4e549
movl $0x3, %eax
movl $0x6, %ecx
jmp 0x4e549
xorl %eax, %eax
movl $0x8, %ecx
movl $0x2, %r13d
jmp 0x4e50e
movl $0x9, %ecx
movl $0x2, %r13d
movl $0x2, %eax
movl %r13d, (%rbx)
movl %ecx, 0x4(%rbx)
movl %eax, 0xc(%rbx)
movw %bp, 0x10(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4e39b
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/hts.c
// Function: hts_close
int hts_close(htsFile *fp)
{
    int ret, save;

    switch (fp->format.format) {
    case binary_format:
    case bam:
    case bcf:
        ret = bgzf_close(fp->fp.bgzf);
        break;

    case cram:
        if (!fp->is_write) {
            switch (cram_eof(fp->fp.cram)) {
            case 2:
                fprintf(stderr, "[W::%s] EOF marker is absent. The input is probably truncated.\n", __func__);
                break;
            case 0:  /* not at EOF, but may not have wanted all seqs */
            default: /* case 1, expected EOF */
                break;
            }
        }
        ret = cram_close(fp->fp.cram);
        break;

    case text_format:
    case sam:
    case vcf:
        if (!fp->is_write) {
        #if KS_BGZF
            BGZF *gzfp = ((kstream_t*)fp->fp.voidp)->f;
            ret = bgzf_close(gzfp);
        #else
            gzFile gzfp = ((kstream_t*)fp->fp.voidp)->f;
            ret = gzclose(gzfp);
        #endif
            ks_destroy((kstream_t*)fp->fp.voidp);
        }
        else if (fp->format.compression != no_compression)
            ret = bgzf_close(fp->fp.bgzf);
        else
            ret = hclose(fp->fp.hfile);
        break;

    default:
        ret = -1;
        break;
    }

    save = errno;
    free(fp->fn);
    free(fp->fn_aux);
    free(fp->line.s);
    free(fp);
    errno = save;
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x44(%rdi), %eax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x9, %eax
ja 0x4e5f3
movl $0x10c, %ecx            # imm = 0x10C
btl %eax, %ecx
jb 0x4e5a0
movl $0x212, %ecx            # imm = 0x212
btl %eax, %ecx
jae 0x4e5bf
movq 0x38(%rbx), %rdi
jmp 0x4e5ec
testb $0x2, (%rbx)
jne 0x4e5e2
movq 0x38(%rbx), %rax
movq 0x18(%rax), %rdi
callq 0x68168
movl %eax, %ebp
movq 0x38(%rbx), %rdi
callq 0x4c2b9
jmp 0x4e5f3
cmpl $0x6, %eax
jne 0x4e5f3
testb $0x2, (%rbx)
jne 0x4e5d7
movq 0x38(%rbx), %rdi
callq 0x5cc44
cmpl $0x2, %eax
je 0x4e638
movq 0x38(%rbx), %rdi
callq 0x5c9be
jmp 0x4e5f1
cmpl $0x0, 0x4c(%rbx)
movq 0x38(%rbx), %rdi
je 0x4e631
callq 0x68168
movl %eax, %ebp
callq 0x6060
movq %rax, %r14
movl (%rax), %r15d
movq 0x28(%rbx), %rdi
callq 0x68a0
movq 0x30(%rbx), %rdi
callq 0x68a0
movq 0x20(%rbx), %rdi
callq 0x68a0
movq %rbx, %rdi
callq 0x68a0
movl %r15d, (%r14)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x6b37e
jmp 0x4e5f1
callq 0x7627
jmp 0x4e5d7
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/hts.c
// Function: hts_set_threads
int hts_set_threads(htsFile *fp, int n)
{
    if (fp->format.compression == bgzf) {
        return bgzf_mt(fp->fp.bgzf, n, 256);
    } else if (fp->format.format == cram) {
        return hts_set_opt(fp, CRAM_OPT_NTHREADS, n);
    }
    else return 0;
}

// Assembly:
movl %esi, %edx
cmpl $0x2, 0x4c(%rdi)
jne 0x4e68b
movq 0x38(%rdi), %rdi
movl %edx, %esi
movl $0x100, %edx            # imm = 0x100
jmp 0x67ad3
cmpl $0x6, 0x44(%rdi)
jne 0x4e69d
movl $0xe, %esi
xorl %eax, %eax
jmp 0x4e279
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/hts.c
// Function: hts_useek
int hts_useek(htsFile *fp, long uoffset, int where)
{
    if ( fp->is_bin )
        return bgzf_useek(fp->fp.bgzf, uoffset, where);
    else
    {
        ks_rewind((kstream_t*)fp->fp.voidp);
        ((kstream_t*)fp->fp.voidp)->seek_pos = uoffset;
        return bgzf_useek(((kstream_t*)fp->fp.voidp)->f, uoffset, where);
    }
}

// Assembly:
movq 0x38(%rdi), %rax
testb $0x1, (%rdi)
jne 0x4e747
xorl %ecx, %ecx
movl %ecx, 0x4(%rax)
movq 0x38(%rdi), %rax
movl %ecx, (%rax)
movq 0x38(%rdi), %rax
andl $-0x4, 0x8(%rax)
movq 0x38(%rdi), %rax
movq %rsi, 0x10(%rax)
movq 0x38(%rdi), %rax
movq 0x18(%rax), %rax
movq %rax, %rdi
jmp 0x68da5
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/hts.c
// Function: hts_getline
int hts_getline(htsFile *fp, int delimiter, kstring_t *str)
{
    int ret, dret;
    ret = ks_getuntil((kstream_t*)fp->fp.voidp, delimiter, str, &dret);
    ++fp->lineno;
    return ret;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x38(%rdi), %rdi
leaq 0xc(%rsp), %rcx
xorl %r8d, %r8d
callq 0x4c2d5
incq 0x8(%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/hts.c
// Function: hts_idx_save
int hts_idx_save(const hts_idx_t *idx, const char *fn, int fmt)
{
    int ret, save;
    char *fnidx = (char*)calloc(1, strlen(fn) + 5);
    if (fnidx == NULL) return -1;

    strcpy(fnidx, fn);
    switch (fmt) {
    case HTS_FMT_BAI: strcat(fnidx, ".bai"); break;
    case HTS_FMT_CSI: strcat(fnidx, ".csi"); break;
    case HTS_FMT_TBI: strcat(fnidx, ".tbi"); break;
    default: abort();
    }

    ret = hts_idx_save_as(idx, fn, fnidx, fmt);
    save = errno;
    free(fnidx);
    errno = save;
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r12
movq %rsi, %rdi
callq 0x62d0
leaq 0x5(%rax), %rsi
movl $0x1, %edi
callq 0x6470
testq %rax, %rax
je 0x505e9
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x6680
testl %ebx, %ebx
je 0x50602
cmpl $0x2, %ebx
je 0x505f0
cmpl $0x1, %ebx
jne 0x5064a
movq %r15, %rdi
callq 0x62d0
movl $0x6961622e, (%r15,%rax) # imm = 0x6961622E
jmp 0x50612
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x50641
movq %r15, %rdi
callq 0x62d0
movl $0x6962742e, (%r15,%rax) # imm = 0x6962742E
jmp 0x50612
movq %r15, %rdi
callq 0x62d0
movl $0x6973632e, (%r15,%rax) # imm = 0x6973632E
movb $0x0, 0x4(%r15,%rax)
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
movl %ebx, %ecx
callq 0x5064f
movl %eax, %ebx
callq 0x6060
movq %rax, %r14
movl (%rax), %ebp
movq %r15, %rdi
callq 0x68a0
movl %ebp, (%r14)
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x63c0
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/hts.c
// Function: hts_idx_save_as
int hts_idx_save_as(const hts_idx_t *idx, const char *fn, const char *fnidx, int fmt)
{
    if (fnidx == NULL) return hts_idx_save(idx, fn, fmt);

    if (fmt == HTS_FMT_CSI) {
        BGZF *fp;
        uint32_t x[3];
        int is_be, i;
        is_be = ed_is_big();
        fp = bgzf_open(fnidx, "w");
        if (fp == NULL) return -1;
        bgzf_write(fp, "CSI\1", 4);
        x[0] = idx->min_shift; x[1] = idx->n_lvls; x[2] = idx->l_meta;
        if (is_be) {
            for (i = 0; i < 3; ++i)
                bgzf_write(fp, ed_swap_4p(&x[i]), 4);
        } else bgzf_write(fp, &x, 12);
        if (idx->l_meta) bgzf_write(fp, idx->meta, idx->l_meta);
        hts_idx_save_core(idx, fp, HTS_FMT_CSI);
        bgzf_close(fp);
    } else if (fmt == HTS_FMT_TBI) {
        BGZF *fp = bgzf_open(fnidx, "w");
        if (fp == NULL) return -1;
        bgzf_write(fp, "TBI\1", 4);
        hts_idx_save_core(idx, fp, HTS_FMT_TBI);
        bgzf_close(fp);
    } else if (fmt == HTS_FMT_BAI) {
        FILE *fp = fopen(fnidx, "w");
        if (fp == NULL) return -1;
        fwrite("BAI\1", 1, 4, fp);
        hts_idx_save_core(idx, fp, HTS_FMT_BAI);
        fclose(fp);
    } else abort();

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
testq %rdx, %rdx
je 0x50705
cmpl $0x2, %ecx
je 0x50760
cmpl $0x1, %ecx
je 0x50716
testl %ecx, %ecx
jne 0x507b4
leaq 0x3e606(%rip), %rsi     # 0x8ec89
movq %rdx, %rdi
callq 0x66a24
testq %rax, %rax
je 0x507a7
movq %rax, %r14
leaq 0x47cc3(%rip), %rsi     # 0x98361
movl $0x4, %edx
movq %rax, %rdi
callq 0x68002
movl 0x4(%rbx), %eax
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
movl 0x8(%rbx), %eax
movl %eax, 0x4(%rsi)
movl 0x10(%rbx), %eax
movl %eax, 0x8(%rsi)
movl $0xc, %edx
movq %r14, %rdi
callq 0x68002
movl 0x10(%rbx), %edx
testq %rdx, %rdx
je 0x506e2
movq 0x38(%rbx), %rsi
movq %r14, %rdi
callq 0x68002
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x507b9
movq %r14, %rdi
callq 0x68168
testq %r14, %r14
jne 0x507a3
jmp 0x507a7
movq %rbx, %rdi
movl %ecx, %edx
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x50590
leaq 0x3e56c(%rip), %rsi     # 0x8ec89
movq %rdx, %rdi
callq 0x6880
testq %rax, %rax
je 0x507a7
movq %rax, %r14
leaq 0x47c28(%rip), %rdi     # 0x9835c
movl $0x1, %esi
movl $0x4, %edx
movq %rax, %rcx
callq 0x6e70
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x507b9
movq %r14, %rdi
callq 0x66e0
jmp 0x507a3
leaq 0x3e522(%rip), %rsi     # 0x8ec89
movq %rdx, %rdi
callq 0x66a24
testq %rax, %rax
je 0x507a7
movq %rax, %r14
leaq 0x47be8(%rip), %rsi     # 0x98366
movl $0x4, %edx
movq %rax, %rdi
callq 0x68002
movq %rbx, %rdi
movq %r14, %rsi
movl $0x2, %edx
callq 0x507b9
movq %r14, %rdi
callq 0x68168
xorl %eax, %eax
jmp 0x507ac
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r14
retq
callq 0x63c0
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/hts.c
// Function: hts_parse_reg
const char *hts_parse_reg(const char *s, int *beg, int *end)
{
    char *hyphen;
    const char *colon = strrchr(s, ':');
    if (colon == NULL) {
        *beg = 0; *end = INT_MAX;
        return s + strlen(s);
    }

    *beg = hts_parse_decimal(colon+1, &hyphen, HTS_PARSE_THOUSANDS_SEP) - 1;
    if (*beg < 0) *beg = 0;

    if (*hyphen == '\0') *end = INT_MAX;
    else if (*hyphen == '-') *end = hts_parse_decimal(hyphen+1, NULL, HTS_PARSE_THOUSANDS_SEP);
    else return NULL;

    if (*beg >= *end) return NULL;
    return colon;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r12
movl $0x3a, %esi
callq 0x67c0
testq %rax, %rax
je 0x5176e
movq %rax, %r15
leaq 0x1(%rax), %rdi
movq %rsp, %r12
movq %r12, %rsi
movl $0x1, %edx
callq 0x514c3
movq %rax, %rcx
decl %ecx
xorl %eax, %eax
testl %ecx, %ecx
cmovlel %eax, %ecx
movl %ecx, (%rbx)
movq (%r12), %rdi
movzbl (%rdi), %ecx
testl %ecx, %ecx
je 0x51788
cmpl $0x2d, %ecx
jne 0x51798
incq %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x514c3
movq %rax, %rcx
jmp 0x5178d
movl $0x0, (%rbx)
movl $0x7fffffff, (%r14)     # imm = 0x7FFFFFFF
movq %r12, %rdi
callq 0x62d0
addq %r12, %rax
jmp 0x51798
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, (%r14)
xorl %eax, %eax
cmpl %ecx, (%rbx)
cmovlq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/hts.c
// Function: hts_itr_querys
hts_itr_t *hts_itr_querys(const hts_idx_t *idx, const char *reg, hts_name2id_f getid, void *hdr, hts_itr_query_func *itr_query, hts_readrec_func *readrec)
{
    int tid, beg, end;
    const char *q;

    if (strcmp(reg, ".") == 0)
        return itr_query(idx, HTS_IDX_START, 0, 0, readrec);
    else if (strcmp(reg, "*") == 0)
        return itr_query(idx, HTS_IDX_NOCOOR, 0, 0, readrec);

    q = hts_parse_reg(reg, &beg, &end);
    if (q) {
        char *tmp = (char*)alloca(q - reg + 1);
        strncpy(tmp, reg, q - reg);
        tmp[q - reg] = 0;
        tid = getid(hdr, tmp);
    }
    else {
        // not parsable as a region, but possibly a sequence named "foo:a"
        tid = getid(hdr, reg);
        beg = 0; end = INT_MAX;
    }

    if (tid < 0) return NULL;
    return itr_query(idx, tid, beg, end, readrec);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r15
movq %r8, %r12
movq %rcx, -0x48(%rbp)
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r14
leaq 0x3f0b9(%rip), %rsi     # 0x90888
movq %r13, %rdi
callq 0x6a50
testl %eax, %eax
je 0x51849
movq %r12, -0x40(%rbp)
leaq 0x48f95(%rip), %rsi     # 0x9a77b
movq %r13, %rdi
callq 0x6a50
testl %eax, %eax
je 0x5185d
movq %rbx, -0x38(%rbp)
leaq -0x30(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
movq %r13, %rdi
callq 0x51705
testq %rax, %rax
je 0x51880
movq %rax, %rbx
subq %r13, %rbx
leaq 0x10(%rbx), %rax
andq $-0x10, %rax
movq %r15, -0x50(%rbp)
movq %rsp, %r15
subq %rax, %r15
movq %r15, %rsp
movq %r15, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x6380
movb $0x0, (%rbx,%r15)
movq -0x48(%rbp), %rdi
movq %r15, %rsi
movq -0x50(%rbp), %r15
callq *-0x38(%rbp)
jmp 0x51898
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
xorl %edx, %edx
xorl %ecx, %ecx
movq %r15, %r8
movq %r12, %rax
jmp 0x51870
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
xorl %edx, %edx
xorl %ecx, %ecx
movq %r15, %r8
movq -0x40(%rbp), %rax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
movq -0x48(%rbp), %rdi
movq %r13, %rsi
callq *-0x38(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x7fffffff, -0x2c(%rbp) # imm = 0x7FFFFFFF
testl %eax, %eax
movq -0x40(%rbp), %r9
js 0x518b3
movl -0x30(%rbp), %edx
movl -0x2c(%rbp), %ecx
movq %r14, %rdi
movl %eax, %esi
movq %r15, %r8
callq *%r9
jmp 0x518b5
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/hts.c
// Function: hts_idx_getfn
char *hts_idx_getfn(const char *fn, const char *ext)
{
    int i, l_fn, l_ext;
    char *fnidx;
    const char *ret;
    l_fn = strlen(fn); l_ext = strlen(ext);
    fnidx = (char*)calloc(l_fn + l_ext + 1, 1);
    strcpy(fnidx, fn); strcpy(fnidx + l_fn, ext);
    if ((ret = test_and_fetch(fnidx)) == 0) {
        for (i = l_fn - 1; i > 0; --i)
            if (fnidx[i] == '.') break;
        strcpy(fnidx + i, ext);
        ret = test_and_fetch(fnidx);
    }
    if (ret == 0) {
        free(fnidx);
        return 0;
    }
    l_fn = strlen(ret);
    memmove(fnidx, ret, l_fn + 1);
    return fnidx;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r12
callq 0x62d0
movq %rax, %r15
movq %r14, %rdi
callq 0x62d0
addl %r15d, %eax
incl %eax
movslq %eax, %rdi
movl $0x1, %esi
callq 0x6470
movq %rax, %rbx
movq %rax, %rdi
movq %r12, %rsi
callq 0x6680
movslq %r15d, %rdi
addq %rbx, %rdi
movq %r14, %rsi
callq 0x6680
movq %rbx, %rdi
callq 0x51b56
movq %rax, %r12
testq %rax, %rax
jne 0x51b05
movl %r15d, %eax
testl %r15d, %r15d
movl $0x1, %ecx
cmovlel %r15d, %ecx
decl %ecx
decq %rax
cmpl $0x2, %r15d
jl 0x51ae6
movl %eax, %edx
decl %r15d
decq %rax
cmpb $0x2e, (%rbx,%rdx)
jne 0x51ad0
jmp 0x51ae9
movl %ecx, %r15d
movslq %r15d, %rax
movq %rbx, %rdi
addq %rax, %rdi
movq %r14, %rsi
callq 0x6680
movq %rbx, %rdi
callq 0x51b56
movq %rax, %r12
testq %r12, %r12
je 0x51b40
movabsq $0x100000000, %r14      # imm = 0x100000000
movq %r12, %rdi
callq 0x62d0
shlq $0x20, %rax
addq %rax, %r14
sarq $0x20, %r14
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6c60
movq %rbx, %rdi
callq 0x68a0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/hts.c
// Function: hts_idx_load
hts_idx_t *hts_idx_load(const char *fn, int fmt)
{
    char *fnidx;
    hts_idx_t *idx;
    fnidx = hts_idx_getfn(fn, ".csi");
    if (! fnidx) fnidx = hts_idx_getfn(fn, fmt == HTS_FMT_BAI? ".bai" : ".tbi");
    if (fnidx == 0) return 0;

    idx = hts_idx_load2(fn, fnidx);
    free(fnidx);
    return idx;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x46adc(%rip), %rsi     # 0x986b8
callq 0x51a60
movq %rax, %r14
testq %rax, %rax
jne 0x51c09
cmpl $0x1, %ebp
leaq 0x46ac0(%rip), %rax     # 0x986b3
leaq 0x3f2bf(%rip), %rsi     # 0x90eb9
cmoveq %rax, %rsi
movq %rbx, %rdi
callq 0x51a60
movq %rax, %r14
testq %r14, %r14
je 0x51c29
movq %rbx, %rdi
movq %r14, %rsi
callq 0x51c30
movq %rax, %rbx
movq %r14, %rdi
callq 0x68a0
movq %rbx, %rax
jmp 0x51c2b
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/tbx.c
// Function: tbx_readrec
int tbx_readrec(BGZF *fp, void *tbxv, void *sv, int *tid, int *beg, int *end)
{
    tbx_t *tbx = (tbx_t *) tbxv;
    kstring_t *s = (kstring_t *) sv;
    int ret;
    if ((ret = bgzf_getline(fp, '\n', s)) >= 0) {
        tbx_intv_t intv;
        get_intv(tbx, s, &intv, 0);
        *tid = intv.tid; *beg = intv.beg; *end = intv.end;
    }
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movl $0xa, %esi
callq 0x686c1
movl %eax, %ebp
testl %eax, %eax
js 0x52a0d
movq %rbx, 0x8(%rsp)
leaq 0x10(%rsp), %rbx
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x52a1e
movl 0x20(%rbx), %eax
movl %eax, (%r15)
movl (%rbx), %eax
movl %eax, (%r14)
movl 0x8(%rbx), %eax
movq 0x8(%rsp), %rcx
movl %eax, (%rcx)
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/tbx.c
// Function: get_intv
static inline int get_intv(tbx_t *tbx, kstring_t *str, tbx_intv_t *intv, int is_add)
{
    if (tbx_parse1(&tbx->conf, str->l, str->s, intv) == 0) {
        int c = *intv->se;
        *intv->se = '\0'; intv->tid = get_tid(tbx, intv->ss, is_add); *intv->se = c;
        return (intv->tid >= 0 && intv->beg >= 0 && intv->end >= 0)? 0 : -1;
    } else {
        char *type = NULL;
        switch (tbx->conf.preset&0xffff)
        {
            case TBX_SAM: type = "TBX_SAM"; break;
            case TBX_VCF: type = "TBX_VCF"; break;
            case TBX_UCSC: type = "TBX_UCSC"; break;
            default: type = "TBX_GENERIC"; break;
        }
        if ((str->l > 0) && (*str->s != tbx->conf.meta_char))
            fprintf(stderr, "[E::%s] failed to parse %s, was wrong -p [type] used?\nThe offending line was: \"%s\"\n", __func__, type, str->s);
        return -1;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movl (%rsi), %esi
movq 0x10(%r15), %rdx
movq %rbx, %rcx
callq 0x526de
testl %eax, %eax
je 0x52ab8
movzwl (%r14), %eax
cmpw $0x2, %ax
leaq 0x45db5(%rip), %rcx     # 0x9880a
leaq 0x45db6(%rip), %rdx     # 0x98812
cmoveq %rcx, %rdx
cmpw $0x1, %ax
leaq 0x45d97(%rip), %rcx     # 0x98802
cmovneq %rdx, %rcx
cmpq $0x0, (%r15)
je 0x52b46
movq 0x10(%r15), %r8
movsbl (%r8), %eax
cmpl %eax, 0x10(%r14)
je 0x52b46
movq 0x6c546(%rip), %rax     # 0xbefd8
movq (%rax), %rdi
leaq 0x45d82(%rip), %rsi     # 0x9881e
leaq 0x45dcf(%rip), %rdx     # 0x98872
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6a90
movq 0x18(%rbx), %rax
movb (%rax), %r13b
movb $0x0, (%rax)
movq 0x10(%rbx), %r15
cmpq $0x0, 0x20(%r14)
jne 0x52ad6
callq 0x4c5a1
movq %rax, 0x20(%r14)
movq 0x20(%r14), %r14
testl %ebp, %ebp
je 0x52b1c
leaq 0x4(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x4c9d7
movl %eax, %ebp
cmpl $0x0, (%r12)
je 0x52b29
movq %r15, %rdi
callq 0x6dd0
movq 0x18(%r14), %rcx
movl %ebp, %edx
movq %rax, (%rcx,%rdx,8)
movl 0x4(%r14), %eax
decl %eax
movq 0x20(%r14), %rcx
movq %rax, (%rcx,%rdx,8)
jmp 0x52b29
movq %r14, %rdi
movq %r15, %rsi
callq 0x4c619
movl %eax, %ebp
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl (%r14), %ebp
je 0x52b3c
movq 0x20(%r14), %rax
movl %ebp, %ecx
movl (%rax,%rcx,8), %eax
movl %eax, 0x20(%rbx)
movq 0x18(%rbx), %rax
movb %r13b, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/tbx.c
// Function: tbx_set_meta
void tbx_set_meta(tbx_t *tbx)
{
    int i, l = 0, l_nm;
    uint32_t x[7];
    char **name;
    uint8_t *meta;
    khint_t k;
    khash_t(s2i) *d = (khash_t(s2i)*)tbx->dict;

    memcpy(x, &tbx->conf, 24);
    name = (char**)malloc(sizeof(char*) * kh_size(d));
    for (k = kh_begin(d), l = 0; k != kh_end(d); ++k) {
        if (!kh_exist(d, k)) continue;
        name[kh_val(d, k)] = (char*)kh_key(d, k);
        l += strlen(kh_key(d, k)) + 1; // +1 to include '\0'
    }
    l_nm = x[6] = l;
    meta = (uint8_t*)malloc(l_nm + 28);
    if (ed_is_big())
        for (i = 0; i < 7; ++i)
            x[i] = ed_swap_4(x[i]);
    memcpy(meta, x, 28);
    for (l = 28, i = 0; i < (int)kh_size(d); ++i) {
        int x = strlen(name[i]) + 1;
        memcpy(meta + l, name[i], x);
        l += x;
    }
    free(name);
    hts_idx_set_meta(tbx->idx, l, meta, 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x20(%rdi), %rbx
movl 0x4(%rbx), %edi
shlq $0x3, %rdi
callq 0x69d0
movq %rax, 0x8(%rsp)
movl (%rbx), %r15d
testq %r15, %r15
je 0x52bd8
movq 0x10(%rbx), %r13
xorl %ebp, %ebp
xorl %r14d, %r14d
xorl %r12d, %r12d
movl %r14d, %eax
shrl $0x4, %eax
movl (%r13,%rax,4), %eax
movl %ebp, %ecx
andb $0x1e, %cl
shrl %cl, %eax
testb $0x3, %al
jne 0x52bcb
movq 0x18(%rbx), %rax
movq 0x20(%rbx), %rcx
movq (%rax,%r14,8), %rdi
movq (%rcx,%r14,8), %rax
movq 0x8(%rsp), %rcx
movq %rdi, (%rcx,%rax,8)
callq 0x62d0
addl %eax, %r12d
incl %r12d
incq %r14
addl $0x2, %ebp
cmpq %r14, %r15
jne 0x52b91
jmp 0x52bdb
xorl %r12d, %r12d
leal 0x1c(%r12), %eax
movslq %eax, %rdi
callq 0x69d0
movq %rax, %r15
movq 0x10(%rsp), %rax
movups (%rax), %xmm0
movups %xmm0, (%r15)
movq 0x10(%rax), %rax
movq %rax, 0x10(%r15)
movl %r12d, 0x18(%r15)
cmpl $0x0, 0x4(%rbx)
jle 0x52c51
movl $0x1c, %ebp
xorl %r14d, %r14d
movq 0x8(%rsp), %rdi
movq (%rdi,%r14,8), %r12
movq %r12, %rdi
callq 0x62d0
movq %rax, %r13
incl %eax
movslq %ebp, %rbp
leaq (%r15,%rbp), %rdi
movslq %eax, %rdx
movq %r12, %rsi
callq 0x6570
addl %r13d, %ebp
incl %ebp
incq %r14
movslq 0x4(%rbx), %rax
cmpq %rax, %r14
movq 0x8(%rsp), %rdi
jl 0x52c16
jmp 0x52c5b
movl $0x1c, %ebp
movq 0x8(%rsp), %rdi
callq 0x68a0
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdi
movl %ebp, %esi
movq %r15, %rdx
xorl %ecx, %ecx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x50a90
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/tbx.c
// Function: tbx_index_build2
int tbx_index_build2(const char *fn, const char *fnidx, int min_shift, const tbx_conf_t *conf)
{
    tbx_t *tbx;
    BGZF *fp;
    int ret;
    if ( bgzf_is_bgzf(fn)!=1 ) { fprintf(stderr,"Not a BGZF file: %s\n", fn); return -1; }
    if ((fp = bgzf_open(fn, "r")) == 0) return -1;
    if ( !fp->is_compressed ) { bgzf_close(fp); return -1; }
    tbx = tbx_index(fp, min_shift, conf);
    bgzf_close(fp);
    if ( !tbx ) return -1;
    ret = hts_idx_save_as(tbx->idx, fn, fnidx, min_shift > 0? HTS_FMT_CSI : HTS_FMT_TBI);
    tbx_destroy(tbx);
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r15
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x685b4
cmpl $0x1, %eax
jne 0x52f75
leaq 0x42f17(%rip), %rsi     # 0x95e29
movq %rbx, %rdi
callq 0x66a24
testq %rax, %rax
je 0x52f90
movq %rax, %r12
testb $0x60, 0x3(%rax)
je 0x52f6b
movq %r12, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x52c83
movq %rax, %r15
movq %r12, %rdi
callq 0x68168
testq %r15, %r15
je 0x52f90
movq 0x18(%r15), %rdi
xorl %ecx, %ecx
testl %ebp, %ebp
setle %cl
addl %ecx, %ecx
movq %rbx, %rsi
movq %r14, %rdx
callq 0x5064f
movl %eax, %ebx
movq %r15, %rdi
callq 0x52e7a
movl %ebx, %eax
jmp 0x52f95
movq %r12, %rdi
callq 0x68168
jmp 0x52f90
movq 0x6c05c(%rip), %rax     # 0xbefd8
movq (%rax), %rdi
leaq 0x45826(%rip), %rsi     # 0x987ac
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6a90
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/tbx.c
// Function: tbx_index_load2
tbx_t *tbx_index_load2(const char *fn, const char *fnidx)
{
    tbx_t *tbx;
    uint8_t *meta;
    char *nm, *p;
    uint32_t x[7];
    int l_meta, l_nm;
    tbx = (tbx_t*)calloc(1, sizeof(tbx_t));
    tbx->idx = fnidx? hts_idx_load2(fn, fnidx) : hts_idx_load(fn, HTS_FMT_TBI);
    if ( !tbx->idx )
    {
        free(tbx);
        return NULL;
    }
    meta = hts_idx_get_meta(tbx->idx, &l_meta);
    if ( !meta )
    {
        free(tbx);
        return NULL;
    }
    memcpy(x, meta, 28);
    memcpy(&tbx->conf, x, 24);
    p = nm = (char*)meta + 28;
    l_nm = x[6];
    for (; p - nm < l_nm; p += strlen(p) + 1) get_tid(tbx, p, 1);
    return tbx;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %r14
movl $0x1, %edi
movl $0x28, %esi
callq 0x6470
movq %rax, %r12
movq %r14, %rdi
testq %r15, %r15
je 0x52fe2
movq %r15, %rsi
callq 0x51c30
jmp 0x52fec
movl $0x2, %esi
callq 0x51bcc
movq %rax, 0x18(%r12)
testq %rax, %rax
je 0x530b6
leaq 0x14(%rsp), %rsi
movq %rax, %rdi
callq 0x50aef
testq %rax, %rax
je 0x530b6
movq %rax, %r14
movslq 0x18(%rax), %rbx
movq 0x10(%rax), %rax
movq %rax, 0x10(%r12)
movups (%r14), %xmm0
movups %xmm0, (%r12)
testq %rbx, %rbx
jle 0x530c1
addq $0x1c, %r14
movq %r12, 0x8(%rsp)
movq 0x20(%r12), %r12
leaq 0x4(%rsp), %r15
movq %r14, %r13
testq %r12, %r12
jne 0x53055
callq 0x4c5a1
movq %rax, %r12
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x4c9d7
cmpl $0x0, 0x4(%rsp)
je 0x5308f
movl %eax, %ebp
movq %r13, %rdi
callq 0x6dd0
movq 0x18(%r12), %rcx
movl %ebp, %edx
movq %rax, (%rcx,%rdx,8)
movl 0x4(%r12), %eax
decl %eax
movq 0x20(%r12), %rcx
movq %rax, (%rcx,%rdx,8)
movq %r13, %rdi
callq 0x62d0
addq %rax, %r13
incq %r13
movq %r13, %rax
subq %r14, %rax
cmpq %rbx, %rax
jl 0x53048
movq 0x8(%rsp), %rax
movq %r12, 0x20(%rax)
movq %rax, %r12
jmp 0x530c1
movq %r12, %rdi
callq 0x68a0
xorl %r12d, %r12d
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/./htslib/kstring.h
// Function: kputsn
static inline int kputsn(const char *p, int l, kstring_t *s)
{
	if (s->l + l + 1 >= s->m) {
		char *tmp;
		s->m = s->l + l + 2;
		kroundup32(s->m);
		if ((tmp = (char*)realloc(s->s, s->m)))
			s->s = tmp;
		else
			return EOF;
	}
	memcpy(s->s + s->l, p, l);
	s->l += l;
	s->s[s->l] = 0;
	return l;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r15
movq (%rdx), %rax
movslq %esi, %r14
addq %r14, %rax
incq %rax
cmpq 0x8(%rdx), %rax
jb 0x5388b
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
callq 0x6c80
testq %rax, %rax
je 0x538ac
movq %rax, 0x10(%rbx)
movq 0x10(%rbx), %rdi
addq (%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x6570
addq (%rbx), %r14
movq %r14, (%rbx)
movq 0x10(%rbx), %rax
movb $0x0, (%rax,%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/cram/cram_index.c
// Function: kget_int32
static int kget_int32(kstring_t *k, size_t *pos, int32_t *val_p) {
    int sign = 1;
    int32_t val = 0;
    size_t p = *pos;

    while (p < k->l && (k->s[p] == ' ' || k->s[p] == '\t'))
	   p++;

    if (p < k->l && k->s[p] == '-')
	sign = -1, p++;

    if (p >= k->l || !(k->s[p] >= '0' && k->s[p] <= '9'))
	return -1;

    while (p < k->l && k->s[p] >= '0' && k->s[p] <= '9')
	val = val*10 + k->s[p++]-'0';
    
    *pos = p;
    *val_p = sign*val;

    return 0;
}

// Assembly:
pushq %rbx
movq (%rsi), %rcx
movq (%rdi), %r8
movl $0x1, %r9d
cmpq %r8, %rcx
setb %r10b
jae 0x5390d
movq 0x10(%rdi), %rax
movzbl (%rax,%rcx), %r11d
cmpl $0x20, %r11d
je 0x538dd
cmpl $0x9, %r11d
jne 0x538ee
incq %rcx
cmpq %r8, %rcx
setb %r10b
jne 0x538cc
movq %r8, %rcx
jmp 0x5390d
testb $0x1, %r10b
je 0x5390d
movq 0x10(%rdi), %rax
xorl %r9d, %r9d
cmpb $0x2d, (%rax,%rcx)
sete %r9b
addq %r9, %rcx
negl %r9d
orl $0x1, %r9d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %r8, %rcx
jae 0x53962
movq 0x10(%rdi), %rdi
movb (%rdi,%rcx), %r10b
addb $-0x30, %r10b
cmpb $0x9, %r10b
ja 0x53962
xorl %eax, %eax
xorl %r10d, %r10d
cmpq %r8, %rcx
jae 0x53958
movzbl (%rdi,%rcx), %r11d
leal -0x30(%r11), %ebx
cmpb $0x9, %bl
ja 0x53958
leal (%r10,%r10,4), %r10d
incq %rcx
leal (%r11,%r10,2), %r10d
addl $-0x30, %r10d
cmpq %rcx, %r8
jne 0x53933
movq %r8, %rcx
imull %r9d, %r10d
movq %rcx, (%rsi)
movl %r10d, (%rdx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/cram/cram_index.c
// Function: cram_index_query
cram_index *cram_index_query(cram_fd *fd, int refid, int pos, 
			     cram_index *from) {
    int i, j, k;
    cram_index *e;

    if (refid+1 < 0 || refid+1 >= fd->index_sz)
	return NULL;

    if (!from)
	from = &fd->index[refid+1];

    // Ref with nothing aligned against it.
    if (!from->e)
	return NULL;

    // This sequence is covered by the index, so binary search to find
    // the optimal starting block.
    i = 0, j = fd->index[refid+1].nslice-1;
    for (k = j/2; k != i; k = (j-i)/2 + i) {
	if (from->e[k].refid > refid) {
	    j = k;
	    continue;
	}

	if (from->e[k].refid < refid) {
	    i = k;
	    continue;
	}

	if (from->e[k].start >= pos) {
	    j = k;
	    continue;
	}

	if (from->e[k].start < pos) {
	    i = k;
	    continue;
	}
    }
    // i==j or i==j-1. Check if j is better.
    if (j >= 0 && from->e[j].start < pos && from->e[j].refid == refid)
	i = j;

    /* The above found *a* bin overlapping, but not necessarily the first */
    while (i > 0 && from->e[i-1].end >= pos)
	i--;

    /* We may be one bin before the optimum, so check */
    while (i+1 < from->nslice &&
	   (from->e[i].refid < refid ||
	    from->e[i].end < pos))
	i++;

    e = &from->e[i];

    return e;
}

// Assembly:
cmpl $-0x1, %esi
jl 0x53b4a
leal 0x1(%rsi), %eax
cmpl 0x8834(%rdi), %eax
jge 0x53b4a
movl %eax, %r9d
testq %rcx, %rcx
jne 0x53a37
leaq (%r9,%r9,2), %rcx
shlq $0x4, %rcx
addq 0x8838(%rdi), %rcx
movq 0x8(%rcx), %rax
xorl %r8d, %r8d
testq %rax, %rax
je 0x53b4a
movq 0x8838(%rdi), %rdi
leaq (%r9,%r9,2), %r9
shlq $0x4, %r9
movl (%rdi,%r9), %r9d
leal -0x1(%r9), %edi
cmpl $0x3, %r9d
jb 0x53aba
movl %edi, %r9d
shrl $0x1f, %r9d
addl %edi, %r9d
sarl %r9d
xorl %r8d, %r8d
movslq %r9d, %r10
leaq (%r10,%r10,2), %r11
shlq $0x4, %r11
leaq (%rax,%r11), %r10
cmpl %esi, 0x10(%rax,%r11)
jg 0x53a98
jl 0x53a92
cmpl %edx, 0x14(%r10)
jge 0x53a98
movl %r9d, %r8d
movl %edi, %r9d
movl %r9d, %edi
movl %r9d, %r10d
subl %r8d, %r10d
movl %r10d, %r9d
shrl $0x1f, %r9d
addl %r10d, %r9d
sarl %r9d
addl %r8d, %r9d
incl %r10d
cmpl $0x2, %r10d
ja 0x53a74
testl %edi, %edi
js 0x53adb
movl %edi, %r9d
leaq (%r9,%r9,2), %r9
shlq $0x4, %r9
cmpl %edx, 0x14(%rax,%r9)
jge 0x53adb
addq %rax, %r9
cmpl %esi, 0x10(%r9)
cmovel %edi, %r8d
testl %r8d, %r8d
jle 0x53b05
leaq -0x18(%rax), %rdi
movl %r8d, %r9d
leaq (%r9,%r9,2), %r9
shlq $0x4, %r9
cmpl %edx, (%rdi,%r9)
jl 0x53b05
leal -0x1(%r8), %r9d
cmpl $0x1, %r8d
movl %r9d, %r8d
jg 0x53ae4
xorl %r8d, %r8d
movl (%rcx), %ecx
leal 0x1(%r8), %edi
cmpl %ecx, %edi
jge 0x53b3b
movslq %r8d, %rdi
decl %ecx
leaq (%rdi,%rdi,2), %rdi
shlq $0x4, %rdi
addq %rax, %rdi
addq $0x18, %rdi
cmpl %esi, -0x8(%rdi)
jl 0x53b2c
cmpl %edx, (%rdi)
jge 0x53b3b
incl %r8d
addq $0x30, %rdi
cmpl %r8d, %ecx
jne 0x53b23
movl %ecx, %r8d
movslq %r8d, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/cram/cram_index.c
// Function: cram_seek_to_refpos
int cram_seek_to_refpos(cram_fd *fd, cram_range *r) {
    cram_index *e;

    // Ideally use an index, so see if we have one.
    if ((e = cram_index_query(fd, r->refid, r->start, NULL))) {
	if (0 != cram_seek(fd, e->offset, SEEK_SET))
	    if (0 != cram_seek(fd, e->offset - fd->first_container, SEEK_CUR))
		return -1;
    } else {
	// Absent from index, but this most likely means it simply has no data.
	return -2;
    }

    if (fd->ctr) {
	cram_free_container(fd->ctr);
	fd->ctr = NULL;
	fd->ooc = 0;
    }

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rsi), %eax
movl 0x4(%rsi), %edx
movl %eax, %esi
xorl %ecx, %ecx
callq 0x53a08
testq %rax, %rax
je 0x53bc3
movq %rax, %r14
movq 0x28(%rax), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x5c89c
testl %eax, %eax
je 0x53b9f
movq 0x28(%r14), %rsi
subq 0x8840(%rbx), %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x5c89c
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x53bc8
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x53bbf
callq 0x593d4
movq $0x0, 0x38(%rbx)
movl $0x0, 0x88f8(%rbx)
xorl %eax, %eax
jmp 0x53bc8
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/cram/cram_io.c
// Function: itf8_put_blk
int itf8_put_blk(cram_block *blk, int val) {
    char buf[5];
    int sz;

    sz = itf8_put(buf, val);
    BLOCK_APPEND(blk, buf, sz);
    return sz;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %eax
movq %rdi, %rbx
cmpl $0x7f, %esi
ja 0x5599b
movb %al, 0xb(%rsp)
movl $0x1, %eax
jmp 0x55a32
movl %eax, %ecx
cmpl $0x3fff, %eax           # imm = 0x3FFF
ja 0x559b9
shrl $0x8, %ecx
orb $-0x80, %cl
movb %cl, 0xb(%rsp)
movb %al, 0xc(%rsp)
movl $0x2, %eax
jmp 0x55a32
cmpl $0x1fffff, %eax         # imm = 0x1FFFFF
ja 0x559d9
shrl $0x10, %ecx
orb $-0x40, %cl
movb %cl, 0xb(%rsp)
movb %ah, 0xc(%rsp)
movb %al, 0xd(%rsp)
movl $0x3, %eax
jmp 0x55a32
cmpl $0xfffffff, %eax        # imm = 0xFFFFFFF
ja 0x55a02
shrl $0x18, %ecx
orb $-0x20, %cl
movb %cl, 0xb(%rsp)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0xc(%rsp)
movb %ah, 0xd(%rsp)
movb %al, 0xe(%rsp)
movl $0x4, %eax
jmp 0x55a32
shrl $0x1c, %ecx
orb $-0x10, %cl
movb %cl, 0xb(%rsp)
movl %eax, %ecx
shrl $0x14, %ecx
movb %cl, 0xc(%rsp)
movl %eax, %ecx
shrl $0xc, %ecx
movb %cl, 0xd(%rsp)
movl %eax, %ecx
shrl $0x4, %ecx
movb %cl, 0xe(%rsp)
andb $0xf, %al
movb %al, 0xf(%rsp)
movl $0x5, %eax
movl %eax, %r14d
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rdi
leaq (%rdi,%r14), %rcx
cmpq %rcx, %rax
ja 0x55abd
movl $0x400, %r15d           # imm = 0x400
movq %rax, %xmm0
punpckldq 0x365b7(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x365bf(%rip), %xmm0    # 0x8c020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x3ad83(%rip), %xmm1    # 0x907f8
cvttsd2si %xmm1, %rcx
movq %rcx, %rdx
subsd 0x42693(%rip), %xmm1    # 0x98118
cvttsd2si %xmm1, %rsi
sarq $0x3f, %rdx
andq %rdx, %rsi
orq %rcx, %rsi
testq %rax, %rax
cmoveq %r15, %rsi
movq %rsi, 0x28(%rbx)
movq 0x20(%rbx), %rdi
callq 0x6c80
movq %rax, 0x20(%rbx)
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rdi
leaq (%rdi,%r14), %rcx
cmpq %rcx, %rax
jbe 0x55a4c
addq 0x20(%rbx), %rdi
leaq 0xb(%rsp), %rsi
movq %r14, %rdx
callq 0x6570
addq %r14, 0x30(%rbx)
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/./htslib/hfile.h
// Function: hread
static inline ssize_t HTS_RESULT_USED
hread(hFILE *fp, void *buffer, size_t nbytes)
{
    extern ssize_t hread2(hFILE *, void *, size_t, size_t);

    size_t n = fp->end - fp->begin;
    if (n > nbytes) n = nbytes;
    memcpy(buffer, fp->begin, n);
    fp->begin += n;
    return (n == nbytes)? (ssize_t) n : hread2(fp, buffer, nbytes, n);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %r13
subq %rsi, %r13
cmpq %rdx, %r13
movq %rdx, %r12
cmovbq %r13, %r12
movq %r14, %rdi
movq %r12, %rdx
callq 0x6570
addq %r12, 0x8(%r15)
cmpq %rbx, %r13
jae 0x55bb9
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r12, %rcx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x6b053
movq %r12, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/cram/cram_io.c
// Function: int32_encode
int int32_encode(cram_fd *fd, int32_t val) {
    val = le_int4(val);
    if (4 != hwrite(fd->fp, &val, 4))
	return -1;

    return 4;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0xc(%rsp), %rax
movl %esi, (%rax)
movq (%rdi), %r14
movq 0x8(%r14), %rdi
movq 0x18(%r14), %r15
subq %rdi, %r15
cmpq $0x4, %r15
movl $0x4, %ebx
cmovbq %r15, %rbx
movq %rax, %rsi
movq %rbx, %rdx
callq 0x6570
addq %rbx, 0x8(%r14)
cmpq $0x3, %r15
ja 0x55c1e
leaq 0xc(%rsp), %rsi
movl $0x4, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x6b222
movq %rax, %rbx
xorl %eax, %eax
cmpq $0x4, %rbx
sete %al
leal (%rax,%rax,4), %eax
decl %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/cram/cram_io.c
// Function: int32_get_blk
int int32_get_blk(cram_block *b, int32_t *val) {
    if (b->uncomp_size - BLOCK_SIZE(b) < 4)
	return -1;

    *val =
	 b->data[b->byte  ]        |
	(b->data[b->byte+1] <<  8) |
	(b->data[b->byte+2] << 16) |
	(b->data[b->byte+3] << 24);
    BLOCK_SIZE(b) += 4;
    return 4;
}

// Assembly:
movslq 0x14(%rdi), %rdx
movq 0x30(%rdi), %rcx
subq %rcx, %rdx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x4, %rdx
jb 0x55c62
movq 0x20(%rdi), %rax
movl (%rax,%rcx), %eax
movl %eax, (%rsi)
addq $0x4, %rcx
movq %rcx, 0x30(%rdi)
movl $0x4, %eax
retq