LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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:
movq 0x82bd7(%rip), %rax     # 0xc86e0
testq %rax, %rax
je 0x45b0f
retq
pushq %rax
leaq 0x41551(%rip), %rdi     # 0x87068
callq 0x68f0
movq %rax, %rcx
testq %rax, %rax
leaq 0x39d4f(%rip), %rax     # 0x7f878
cmovneq %rcx, %rax
movq %rax, 0x82bac(%rip)     # 0xc86e0
addq $0x8, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
orl $-0x1, 0x8(%rdi)
movq %rsi, %r15
cmpq %r14, %r15
jae 0x4692c
callq 0x6790
movq (%rax), %r13
movsbq (%r15), %rax
testb $0x8, 0x1(%r13,%rax,2)
je 0x468f0
incq %r15
jmp 0x468d2
movq %r12, %rdi
callq 0x6bd0
movw %ax, 0x8(%rbx)
cmpb $0x2e, (%r15)
jne 0x46926
incq %r15
movq %r15, %rax
cmpq %r14, %rax
jae 0x4692c
movsbq (%rax), %rcx
incq %rax
testb $0x8, 0x1(%r13,%rcx,2)
jne 0x46908
movq %r15, %rdi
callq 0x6bd0
jmp 0x46928
xorl %eax, %eax
movw %ax, 0xa(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/htslib/./htslib/kstring.h
// Function: kputw
static inline int kputw(int c, kstring_t *s)
{
	char buf[16];
	int i, l = 0;
	unsigned int x = c;
	if (c < 0) x = -x;
	do { buf[l++] = x%10 + '0'; x /= 10; } while (x > 0);
	if (c < 0) buf[l++] = '-';
	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;
	}
	for (i = l - 1; i >= 0; --i) s->s[s->l++] = buf[i];
	s->s[s->l] = 0;
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movl %edi, %ecx
negl %ecx
cmovsl %edi, %ecx
xorl %r14d, %r14d
pushq $0xa
popq %rsi
movl %ecx, %eax
xorl %edx, %edx
divl %esi
orb $0x30, %dl
movb %dl, (%rsp,%r14)
incq %r14
cmpl $0x9, %ecx
movl %eax, %ecx
ja 0x46be4
testl %edi, %edi
jns 0x46c09
movl %r14d, %eax
incl %r14d
movb $0x2d, (%rsp,%rax)
movq (%rbx), %rax
movslq %r14d, %rcx
addq %rcx, %rax
incq %rax
cmpq 0x8(%rbx), %rax
jb 0x46c65
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 0x46c91
movq %rax, 0x10(%rbx)
movl %r14d, %eax
testl %eax, %eax
jle 0x46c86
movb -0x1(%rsp,%rax), %cl
decq %rax
movq (%rbx), %rdx
movq 0x10(%rbx), %rsi
leaq 0x1(%rdx), %rdi
movq %rdi, (%rbx)
movb %cl, (%rsi,%rdx)
jmp 0x46c68
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
movb $0x0, (%rcx,%rax)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x64
popq %rdx
movq %r15, %rdi
callq 0x6380
movb $0x0, 0x64(%r15)
pushq $0x2c
popq %rsi
movq %r15, %rdi
callq 0x6270
testq %rax, %rax
je 0x46cd0
movb $0x0, (%rax)
xorl %ecx, %ecx
movq %r15, %rax
movb (%r15), %dl
movzbl %dl, %esi
leal -0x62(%rsi), %edi
cmpl $0x2, %edi
jae 0x46ce7
movl %edx, %ecx
jmp 0x46cf0
testl %esi, %esi
je 0x46cf5
movb %dl, (%rax)
incq %rax
incq %r15
jmp 0x46cd5
movb %cl, (%rax)
andw $0x0, 0x1(%rax)
testq %r14, %r14
je 0x46d16
movl 0x4(%r14), %ecx
testq %rcx, %rcx
je 0x46d16
leaq 0x405ef(%rip), %rdx     # 0x87300
movb (%rcx,%rdx), %cl
movb %cl, (%rax)
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x5fdb8
movq %rax, %r15
testq %rax, %rax
je 0x46d59
movq %rsp, %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x46da5
testq %rax, %rax
je 0x46d59
movq %rax, %r12
testq %r14, %r14
je 0x46d72
movq 0x18(%r14), %rsi
testq %rsi, %rsi
je 0x46d72
movq %r12, %rdi
callq 0x470ca
testl %eax, %eax
je 0x46d72
cmpl $0x2, 0x6e088(%rip)     # 0xb4de8
jge 0x46d81
testq %r15, %r15
je 0x46d6f
movq %r15, %rdi
callq 0x5faaa
xorl %r12d, %r12d
movq %r12, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x6c250(%rip), %rax     # 0xb2fd8
movq (%rax), %rdi
leaq 0x406a0(%rip), %rsi     # 0x87432
leaq 0x406b9(%rip), %rdx     # 0x87452
movq %rbx, %rcx
xorl %eax, %eax
callq 0x6a90
jmp 0x46d62
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/htslib/hts.c
// Function: hts_opt_apply
int hts_opt_apply(htsFile *fp, hts_opt *opts) {
    hts_opt *last = NULL;

    for (; opts;  opts = (last=opts)->next)
        if (hts_set_opt(fp,  opts->opt,  opts->val) != 0)
            return -1;

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
xorl %ebx, %ebx
pushq $-0x1
popq %rbp
testq %r14, %r14
je 0x470ff
movl 0x8(%r14), %esi
movq 0x10(%r14), %rdx
movq %r15, %rdi
xorl %eax, %eax
callq 0x47524
testl %eax, %eax
jne 0x470fd
movq 0x18(%r14), %r14
jmp 0x470dc
movl %ebp, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x4757a
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 0x475bd
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
pushq $0x10
popq %rcx
cmpq $0x28, %rcx
ja 0x475f5
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x47603
xorl %eax, %eax
cmpl $0x6, 0x44(%rdi)
jne 0x4760a
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 0x53cc0
jmp 0x4760a
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movl (%rax), %esi
callq 0x47929
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x2c
popq %rsi
movq %r15, %rdi
callq 0x6270
movq %rax, %r14
testq %rax, %rax
jne 0x4771c
movq %r15, %rdi
callq 0x62d0
movq %rax, %r14
addq %r15, %r14
andl $0x0, 0x8(%rbx)
movq %r14, %r12
subq %r15, %r12
leaq 0x3fea0(%rip), %rsi     # 0x875cd
movq %r15, %rdi
movq %r12, %rdx
callq 0x6330
testl %eax, %eax
je 0x477ae
leaq 0x3fe8e(%rip), %rsi     # 0x875d1
movq %r15, %rdi
movq %r12, %rdx
callq 0x6330
movw $0xffff, %r13w          # imm = 0xFFFF
pushq $0x2
popq %rbp
testl %eax, %eax
je 0x477bd
leaq 0x3fe74(%rip), %rsi     # 0x875d5
movq %r15, %rdi
movq %r12, %rdx
callq 0x6330
testl %eax, %eax
je 0x477c7
leaq 0x3fec4(%rip), %rsi     # 0x8763b
movq %r15, %rdi
movq %r12, %rdx
callq 0x6330
testl %eax, %eax
je 0x477d4
leaq 0x3feb3(%rip), %rsi     # 0x87640
movq %r15, %rdi
movq %r12, %rdx
callq 0x6330
testl %eax, %eax
je 0x477de
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsd 0x3f94a(%rip), %xmm0    # 0x87100
xorl %ebp, %ebp
xorl %r13d, %r13d
jmp 0x477e6
movsd 0x3f94b(%rip), %xmm0    # 0x87110
jmp 0x477e6
movsd 0x3f951(%rip), %xmm0    # 0x87120
pushq $0x3
popq %rbp
jmp 0x477e6
movsd 0x3f954(%rip), %xmm0    # 0x87130
jmp 0x477b6
movsd 0x3f95a(%rip), %xmm0    # 0x87140
movlps %xmm0, (%rbx)
movl %ebp, 0xc(%rbx)
movw %r13w, 0x10(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4763f
// File: /workspace/github_c_makefile_star2_O2/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
pushq $-0x1
popq %rbp
cmpl $0x9, %eax
ja 0x4788c
movl $0x10c, %ecx            # imm = 0x10C
btl %eax, %ecx
jb 0x47839
movl $0x212, %ecx            # imm = 0x212
btl %eax, %ecx
jae 0x47858
movq 0x38(%rbx), %rdi
jmp 0x47885
testb $0x2, (%rbx)
jne 0x4787b
movq 0x38(%rbx), %rax
movq 0x18(%rax), %rdi
callq 0x5d0b0
movl %eax, %ebp
movq 0x38(%rbx), %rdi
callq 0x45c9d
jmp 0x4788c
cmpl $0x6, %eax
jne 0x4788c
testb $0x2, (%rbx)
jne 0x47870
movq 0x38(%rbx), %rdi
callq 0x53c35
cmpl $0x2, %eax
je 0x478d1
movq 0x38(%rbx), %rdi
callq 0x53a33
jmp 0x4788a
cmpl $0x0, 0x4c(%rbx)
movq 0x38(%rbx), %rdi
je 0x478ca
callq 0x5d0b0
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 0x5fa52
jmp 0x4788a
movq 0x6b700(%rip), %rax     # 0xb2fd8
movq (%rax), %rdi
leaq 0x3fd02(%rip), %rsi     # 0x875e4
leaq 0x3fd3b(%rip), %rdx     # 0x87624
xorl %eax, %eax
callq 0x6a90
jmp 0x47870
// File: /workspace/github_c_makefile_star2_O2/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 0x47941
movq 0x38(%rdi), %rdi
movl %edx, %esi
movl $0x100, %edx            # imm = 0x100
jmp 0x5cb3d
cmpl $0x6, 0x44(%rdi)
jne 0x47951
pushq $0xe
popq %rsi
xorl %eax, %eax
jmp 0x47524
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x479f0
andl $0x0, 0x4(%rax)
movq 0x38(%rdi), %rax
andl $0x0, (%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 0x5db46
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/htslib/hts.c
// Function: insert_to_b
static inline void insert_to_b(bidx_t *b, int bin, uint64_t beg, uint64_t end)
{
    khint_t k;
    bins_t *l;
    int absent;
    k = kh_put(bin, b, bin, &absent);
    l = &kh_value(b, k);
    if (absent) {
        l->m = 1; l->n = 0;
        l->list = (hts_pair64_t*)calloc(l->m, sizeof(hts_pair64_t));
    }
    if (l->n == l->m) {
        l->m <<= 1;
        l->list = (hts_pair64_t*)realloc(l->list, l->m * sizeof(hts_pair64_t));
    }
    l->list[l->n].u = beg;
    l->list[l->n++].v = end;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
leaq 0xc(%rsp), %r12
movq %r12, %rdx
callq 0x4a806
movl %eax, %eax
imulq $0x18, %rax, %r13
addq 0x20(%r15), %r13
cmpl $0x0, (%r12)
je 0x48d03
movq $0x1, (%r13)
leaq 0x4(%r13), %r15
pushq $0x1
popq %rdi
pushq $0x10
popq %rsi
callq 0x6470
movq %rax, 0x10(%r13)
xorl %ecx, %ecx
jmp 0x48d33
leaq 0x4(%r13), %r15
movl (%r13), %eax
movl 0x4(%r13), %ecx
cmpl %eax, %ecx
jne 0x48d33
addl %eax, %eax
movl %eax, (%r13)
movq 0x10(%r13), %rdi
movslq %eax, %rsi
shlq $0x4, %rsi
callq 0x6c80
movq %rax, 0x10(%r13)
movl 0x4(%r13), %ecx
jmp 0x48d37
movq 0x10(%r13), %rax
movslq %ecx, %rcx
movq %rcx, %rdx
shlq $0x4, %rdx
movq %r14, (%rax,%rdx)
incl %ecx
movl %ecx, (%r15)
movq %rbx, 0x8(%rax,%rdx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rdi
callq 0x6470
testq %rax, %rax
je 0x49419
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x6680
testl %ebx, %ebx
je 0x49430
cmpl $0x2, %ebx
je 0x4941e
cmpl $0x1, %ebx
jne 0x49478
movq %r15, %rdi
callq 0x62d0
movl $0x6961622e, (%r15,%rax) # imm = 0x6961622E
jmp 0x49440
pushq $-0x1
popq %rax
jmp 0x4946f
movq %r15, %rdi
callq 0x62d0
movl $0x6962742e, (%r15,%rax) # imm = 0x6962742E
jmp 0x49440
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 0x4947d
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_O2/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 %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
testq %rdx, %rdx
je 0x49523
cmpl $0x2, %ecx
je 0x49579
cmpl $0x1, %ecx
je 0x49535
testl %ecx, %ecx
jne 0x495ca
leaq 0x347c7(%rip), %rsi     # 0x7dc79
movq %rdx, %rdi
callq 0x5bd04
testq %rax, %rax
je 0x495bc
movq %rax, %r14
leaq 0x3deb1(%rip), %rsi     # 0x8737e
pushq $0x4
popq %rdx
movq %rax, %rdi
callq 0x5cfd3
movq 0x4(%rbx), %rax
movq %rsp, %rsi
movq %rax, (%rsi)
movl 0x10(%rbx), %eax
movl %eax, 0x8(%rsi)
pushq $0xc
popq %rdx
movq %r14, %rdi
callq 0x5cfd3
movl 0x10(%rbx), %edx
testq %rdx, %rdx
je 0x49507
movq 0x38(%rbx), %rsi
movq %r14, %rdi
callq 0x5cfd3
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x495cf
movq %r14, %rdi
callq 0x5d0b0
jmp 0x495bf
movq %rbx, %rdi
movl %ecx, %edx
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x493c2
leaq 0x3473d(%rip), %rsi     # 0x7dc79
movq %rdx, %rdi
callq 0x6880
testq %rax, %rax
je 0x495bc
movq %rax, %r14
leaq 0x3de26(%rip), %rdi     # 0x87379
pushq $0x1
popq %rsi
pushq $0x4
popq %rdx
movq %rax, %rcx
callq 0x6e70
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x495cf
movq %r14, %rdi
callq 0x66e0
jmp 0x495b8
leaq 0x346f9(%rip), %rsi     # 0x7dc79
movq %rdx, %rdi
callq 0x5bd04
testq %rax, %rax
je 0x495bc
movq %rax, %r14
leaq 0x3ddec(%rip), %rsi     # 0x87383
pushq $0x4
popq %rdx
movq %rax, %rdi
callq 0x5cfd3
pushq $0x2
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x495cf
movq %r14, %rdi
callq 0x5d0b0
xorl %ebp, %ebp
jmp 0x495bf
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x63c0
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x3a
popq %rsi
callq 0x67c0
testq %rax, %rax
je 0x4a0c1
movq %rax, %r15
leaq 0x1(%rax), %rdi
movq %rsp, %r12
pushq $0x1
popq %rdx
movq %r12, %rsi
callq 0x49e8c
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 0x4a0d8
cmpl $0x2d, %ecx
jne 0x4a0e8
incq %rdi
pushq $0x1
popq %rdx
xorl %esi, %esi
callq 0x49e8c
movq %rax, %rcx
jmp 0x4a0dd
andl $0x0, (%rbx)
movl $0x7fffffff, (%r14)     # imm = 0x7FFFFFFF
movq %r12, %rdi
callq 0x62d0
addq %r12, %rax
jmp 0x4a0e8
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_O2/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, %r14
movq %r8, %r9
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r15
movzbl (%rsi), %eax
cmpl $0x2a, %eax
je 0x4a12f
cmpl $0x2e, %eax
jne 0x4a13a
cmpb $0x0, 0x1(%r13)
jne 0x4a13a
pushq $-0x3
jmp 0x4a1e0
cmpb $0x0, 0x1(%r13)
je 0x4a1de
movq %rcx, -0x38(%rbp)
movq %r9, -0x48(%rbp)
leaq -0x30(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
movq %r13, %rdi
callq 0x4a05e
testq %rax, %rax
je 0x4a19d
movq %rax, %rbx
subq %r13, %rbx
leaq 0x10(%rbx), %rax
andq $-0x10, %rax
movq %r12, -0x40(%rbp)
movq %r15, %r12
movq %r14, %r15
movq %rsp, %r14
subq %rax, %r14
movq %r14, %rsp
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x6380
movb $0x0, (%rbx,%r14)
movq -0x38(%rbp), %rdi
movq %r14, %rsi
movq %r15, %r14
movq %r12, %r15
callq *-0x40(%rbp)
jmp 0x4a1b2
movq -0x38(%rbp), %rdi
movq %r13, %rsi
callq *%r12
andl $0x0, -0x30(%rbp)
movl $0x7fffffff, -0x2c(%rbp) # imm = 0x7FFFFFFF
testl %eax, %eax
movq -0x48(%rbp), %r9
js 0x4a1cd
movl -0x30(%rbp), %edx
movl -0x2c(%rbp), %ecx
movq %r15, %rdi
movl %eax, %esi
movq %r14, %r8
callq *%r9
jmp 0x4a1cf
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x2
popq %rsi
movq %r15, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r14, %r8
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%r9
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rsi
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 0x4a46d
testq %rax, %rax
jne 0x4a41e
movl %r15d, %eax
decl %r15d
movslq %r15d, %rdx
movq %rbx, %rcx
addq %rdx, %rcx
movq %rcx, %rdi
cmpl $0x2, %eax
jl 0x4a409
decq %rax
movl %eax, %edx
leaq -0x1(%rdi), %rcx
cmpb $0x2e, (%rbx,%rdx)
jne 0x4a3f2
movq %r14, %rsi
callq 0x6680
movq %rbx, %rdi
callq 0x4a46d
testq %rax, %rax
je 0x4a457
movq %rax, %r12
movabsq $0x100000000, %r14      # imm = 0x100000000
movq %rax, %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_O2/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 0x3d1e7(%rip), %rsi     # 0x876da
callq 0x4a38c
testq %rax, %rax
jne 0x4a51f
cmpl $0x1, %ebp
leaq 0x3d1ce(%rip), %rax     # 0x876d5
leaq 0x3599b(%rip), %rsi     # 0x7fea9
cmoveq %rax, %rsi
movq %rbx, %rdi
callq 0x4a38c
testq %rax, %rax
je 0x4a540
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4a544
movq %rax, %rbx
movq %r14, %rdi
callq 0x68a0
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
xorl %eax, %eax
jmp 0x4a53b
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/htslib/tbx.c
// Function: get_tid
static inline int get_tid(tbx_t *tbx, const char *ss, int is_add)
{
    khint_t k;
    khash_t(s2i) *d;
    if (tbx->dict == 0) tbx->dict = kh_init(s2i);
    d = (khash_t(s2i)*)tbx->dict;
    if (is_add) {
        int absent;
        k = kh_put(s2i, d, ss, &absent);
        if (absent) {
            kh_key(d, k) = strdup(ss);
            kh_val(d, k) = kh_size(d) - 1;
        }
    } else k = kh_get(s2i, d, ss);
    return k == kh_end(d)? -1 : kh_val(d, k);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq 0x20(%rdi), %rbx
testq %rbx, %rbx
jne 0x4aed8
movq %rdi, %r15
callq 0x45f7d
movq %rax, %rbx
movq %rax, 0x20(%r15)
testl %ebp, %ebp
je 0x4af18
leaq 0x4(%rsp), %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x46345
movl %eax, %ebp
cmpl $0x0, (%r15)
je 0x4af25
movq %r14, %rdi
callq 0x6dd0
movq 0x18(%rbx), %rcx
movl %ebp, %edx
movq %rax, (%rcx,%rdx,8)
movl 0x4(%rbx), %eax
decl %eax
movq 0x20(%rbx), %rcx
movq %rax, (%rcx,%rdx,8)
jmp 0x4af25
movq %rbx, %rdi
movq %r14, %rsi
callq 0x45fec
movl %eax, %ebp
cmpl (%rbx), %ebp
jne 0x4af2e
pushq $-0x1
popq %rax
jmp 0x4af37
movq 0x20(%rbx), %rax
movl %ebp, %ecx
movl (%rax,%rcx,8), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0xa
popq %rsi
callq 0x5d4e1
movl %eax, %ebp
testl %eax, %eax
js 0x4b259
movq %rbx, 0x8(%rsp)
leaq 0x10(%rsp), %rbx
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x4b26a
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_O2/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 %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movl (%rsi), %esi
movq 0x10(%r14), %rdx
movq %r15, %rcx
callq 0x4af42
testl %eax, %eax
je 0x4b2f2
movzwl (%rbx), %eax
cmpw $0x2, %ax
leaq 0x3c590(%rip), %rcx     # 0x8782c
leaq 0x3c591(%rip), %rdx     # 0x87834
cmoveq %rcx, %rdx
cmpw $0x1, %ax
leaq 0x3c572(%rip), %rcx     # 0x87824
cmovneq %rdx, %rcx
cmpq $0x0, (%r14)
je 0x4b315
movq 0x10(%r14), %r8
movsbl (%r8), %eax
cmpl %eax, 0x10(%rbx)
je 0x4b315
movq 0x67d08(%rip), %rax     # 0xb2fd8
movq (%rax), %rdi
leaq 0x3c566(%rip), %rsi     # 0x87840
leaq 0x3c5b3(%rip), %rdx     # 0x87894
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x6a90
movq 0x18(%r15), %rax
movb (%rax), %r14b
movb $0x0, (%rax)
movq 0x10(%r15), %rsi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x4aeb4
movl %eax, 0x20(%r15)
movq 0x18(%r15), %rax
movb %r14b, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, 0x8(%rsp)
movq 0x20(%rdi), %r15
movl 0x4(%r15), %edi
movslq %edi, %rax
movq %rax, 0x10(%rsp)
shlq $0x3, %rdi
callq 0x69d0
movq %rax, %r14
movl (%r15), %r13d
xorl %ebp, %ebp
xorl %ebx, %ebx
xorl %r12d, %r12d
cmpq %rbx, %r13
je 0x4b39c
movq 0x10(%r15), %rax
movl %ebx, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %eax
movl %ebp, %ecx
andb $0x1e, %cl
shrl %cl, %eax
testb $0x3, %al
jne 0x4b394
movq 0x18(%r15), %rax
movq 0x20(%r15), %rcx
movq (%rax,%rbx,8), %rdi
movq (%rcx,%rbx,8), %rax
movq %rdi, (%r14,%rax,8)
callq 0x62d0
addl %eax, %r12d
incl %r12d
incq %rbx
addl $0x2, %ebp
jmp 0x4b359
leal 0x1c(%r12), %eax
movslq %eax, %rdi
callq 0x69d0
movq %rax, %r15
movq 0x8(%rsp), %rax
movups (%rax), %xmm0
movups %xmm0, (%r15)
movq 0x10(%rax), %rax
movq %rax, 0x10(%r15)
movl %r12d, 0x18(%r15)
pushq $0x1c
popq %r12
xorl %ebx, %ebx
cmpq 0x10(%rsp), %rbx
jge 0x4b3fe
movq (%r14,%rbx,8), %r13
movq %r13, %rdi
callq 0x62d0
movq %rax, %rbp
incl %eax
movslq %r12d, %rdi
addq %r15, %rdi
movslq %eax, %rdx
movq %r13, %rsi
callq 0x6570
addl %ebp, %r12d
incl %r12d
incq %rbx
jmp 0x4b3ca
movq %r14, %rdi
callq 0x68a0
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
movl %r12d, %esi
movq %r15, %rdx
xorl %ecx, %ecx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x497ad
// File: /workspace/github_c_makefile_star2_O2/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 0x5d412
cmpl $0x1, %eax
jne 0x4b6f0
leaq 0x3977c(%rip), %rsi     # 0x84e09
movq %rbx, %rdi
callq 0x5bd04
testq %rax, %rax
je 0x4b70b
movq %rax, %r12
testb $0x60, 0x3(%rax)
je 0x4b6e6
movq %r12, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x4b42a
movq %rax, %r15
movq %r12, %rdi
callq 0x5d0b0
testq %r15, %r15
je 0x4b70b
movq 0x18(%r15), %rdi
xorl %ecx, %ecx
testl %ebp, %ebp
setle %cl
addl %ecx, %ecx
movq %rbx, %rsi
movq %r14, %rdx
callq 0x4947d
movl %eax, %ebx
movq %r15, %rdi
callq 0x4b5f9
movl %ebx, %eax
jmp 0x4b70e
movq %r12, %rdi
callq 0x5d0b0
jmp 0x4b70b
movq 0x678e1(%rip), %rax     # 0xb2fd8
movq (%rax), %rdi
leaq 0x3c0cd(%rip), %rsi     # 0x877ce
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6a90
pushq $-0x1
popq %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movq %rdi, %r14
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x6470
movq %rax, %rbx
testq %r15, %r15
je 0x4b755
movq %r14, %rdi
movq %r15, %rsi
callq 0x4a544
jmp 0x4b760
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x4a4e3
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x4b7c3
leaq 0xc(%rsp), %rsi
movq %rax, %rdi
callq 0x49807
testq %rax, %rax
je 0x4b7c3
movq %rax, %r14
movslq 0x18(%rax), %r12
movq 0x10(%rax), %rax
movq %rax, 0x10(%rbx)
movups (%r14), %xmm0
movups %xmm0, (%rbx)
addq $0x1c, %r14
pushq $0x1
popq %rbp
movq %r14, %r15
movq %r15, %rax
subq %r14, %rax
cmpq %r12, %rax
jge 0x4b7cd
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x4aeb4
movq %r15, %rdi
callq 0x62d0
addq %rax, %r15
incq %r15
jmp 0x4b79b
movq %rbx, %rdi
callq 0x68a0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebx
movq %rdi, %r12
movq (%rdx), %rdi
movslq %esi, %r15
leaq (%r15,%rdi), %rax
incq %rax
cmpq 0x8(%rdx), %rax
jae 0x58112
movq 0x10(%r14), %rax
jmp 0x5815f
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(%r14)
movq 0x10(%r14), %rdi
callq 0x6c80
testq %rax, %rax
je 0x5818a
movq %rax, 0x10(%r14)
movq (%r14), %rdi
addq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x6570
addq (%r14), %r15
movq %r15, (%r14)
movq 0x10(%r14), %rax
movb $0x0, (%rax,%r15)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
pushq $-0x1
popq %rbx
jmp 0x5817c
// File: /workspace/github_c_makefile_star2_O2/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:
movq (%rsi), %r10
movq (%rdi), %rcx
pushq $-0x1
popq %rax
cmpq %rcx, %r10
jae 0x4bfcb
movq 0x10(%rdi), %r8
movzbl (%r8,%r10), %r8d
cmpl $0x20, %r8d
je 0x4bf64
cmpl $0x9, %r8d
jne 0x4bf69
incq %r10
jmp 0x4bf4a
xorl %r11d, %r11d
cmpb $0x2d, %r8b
sete %r11b
leaq (%r11,%r10), %r9
cmpq %rcx, %r9
jae 0x4bfcb
movq 0x10(%rdi), %rdi
addq %rdi, %r11
movb (%r10,%r11), %r10b
addb $-0x30, %r10b
cmpb $0x9, %r10b
ja 0x4bfcb
xorl %eax, %eax
cmpq %rcx, %r9
jae 0x4bfb9
movzbl (%rdi,%r9), %r10d
leal -0x30(%r10), %r11d
cmpb $0x9, %r11b
ja 0x4bfb6
imull $0xa, %eax, %eax
incq %r9
addl %r10d, %eax
addl $-0x30, %eax
jmp 0x4bf94
movq %r9, %rcx
movl %eax, %edi
negl %edi
cmpb $0x2d, %r8b
movq %rcx, (%rsi)
cmovnel %eax, %edi
movl %edi, (%rdx)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x4c0e6
leal 0x1(%rsi), %eax
cmpl 0x8834(%rdi), %eax
jge 0x4c0e6
movl %edx, %r8d
movl %eax, %eax
testq %rcx, %rcx
jne 0x4c081
imulq $0x30, %rax, %rcx
addq 0x8838(%rdi), %rcx
movq 0x8(%rcx), %r10
xorl %r11d, %r11d
testq %r10, %r10
je 0x4c0e6
pushq %rbx
movq 0x8838(%rdi), %rdx
imulq $0x30, %rax, %rax
movl (%rdx,%rax), %r9d
decl %r9d
movl $0x2, %edi
movl %r9d, %eax
cltd
idivl %edi
cmpl %r11d, %eax
je 0x4c0ed
movslq %eax, %rdx
imulq $0x30, %rdx, %rbx
leaq (%r10,%rbx), %rdx
cmpl %esi, 0x10(%r10,%rbx)
jg 0x4c0d8
jge 0x4c0cc
movl %eax, %r11d
movl %r9d, %eax
jmp 0x4c0d8
cmpl %r8d, 0x14(%rdx)
cmovll %eax, %r11d
cmovll %r9d, %eax
movl %eax, %r9d
subl %r11d, %eax
cltd
idivl %edi
addl %r11d, %eax
jmp 0x4c0ab
xorl %r10d, %r10d
movq %r10, %rax
retq
testl %r9d, %r9d
js 0x4c10a
movl %r9d, %eax
imulq $0x30, %rax, %rax
cmpl %r8d, 0x14(%r10,%rax)
jge 0x4c10a
addq %r10, %rax
cmpl %esi, 0x10(%rax)
cmovel %r9d, %r11d
leaq -0x18(%r10), %rdx
movl %r11d, %eax
sarl $0x1f, %eax
andl %r11d, %eax
testl %r11d, %r11d
jle 0x4c131
movl %r11d, %edi
imulq $0x30, %rdi, %rdi
cmpl %r8d, (%rdx,%rdi)
jl 0x4c12e
decl %r11d
jmp 0x4c117
movl %r11d, %eax
movslq (%rcx), %rcx
movslq %eax, %rdx
movq %rdx, %rax
shlq $0x20, %rax
imulq $0x30, %rdx, %rdi
addq %r10, %rdi
addq $0x18, %rdi
incq %rdx
movabsq $0x100000000, %r9       # imm = 0x100000000
cmpq %rcx, %rdx
jge 0x4c171
cmpl %esi, -0x8(%rdi)
jl 0x4c165
cmpl %r8d, (%rdi)
jge 0x4c171
addq %r9, %rax
addq $0x30, %rdi
incq %rdx
jmp 0x4c156
sarq $0x20, %rax
imulq $0x30, %rax, %rax
addq %rax, %r10
popq %rbx
jmp 0x4c0e9
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl (%rsi), %eax
movl 0x4(%rsi), %edx
movl %eax, %esi
xorl %ecx, %ecx
callq 0x4c058
testq %rax, %rax
je 0x4c1ed
movq %rax, %r14
movq 0x28(%rax), %rsi
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %edx, %edx
callq 0x5396e
testl %eax, %eax
je 0x4c1d1
movq 0x28(%r14), %rsi
subq 0x8840(%rbx), %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x5396e
testl %eax, %eax
je 0x4c1d1
pushq $-0x1
jmp 0x4c1ef
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x4c1f0
callq 0x5093a
andq $0x0, 0x38(%rbx)
andl $0x0, 0x88f8(%rbx)
jmp 0x4c1f0
pushq $-0x2
popq %rbp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/htslib/./htslib/hfile.h
// Function: hwrite
static inline ssize_t HTS_RESULT_USED
hwrite(hFILE *fp, const void *buffer, size_t nbytes)
{
    extern ssize_t hwrite2(hFILE *, const void *, size_t, size_t);

    size_t n = fp->limit - fp->begin;
    if (n > nbytes) n = nbytes;
    memcpy(fp->begin, buffer, n);
    fp->begin += n;
    return (n==nbytes)? (ssize_t) n : hwrite2(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), %rdi
movq 0x18(%r15), %r13
subq %rdi, %r13
cmpq %rdx, %r13
movq %rdx, %r12
cmovbq %r13, %r12
movq %r12, %rdx
callq 0x6570
addq %r12, 0x8(%r15)
cmpq %rbx, %r13
jae 0x4c9d9
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r12, %rcx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x5f906
movq %r12, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x4d70a
movb %al, 0xb(%rsp)
pushq $0x1
jmp 0x4d795
movl %eax, %ecx
cmpl $0x3fff, %eax           # imm = 0x3FFF
ja 0x4d725
shrl $0x8, %ecx
orb $-0x80, %cl
movb %cl, 0xb(%rsp)
movb %al, 0xc(%rsp)
pushq $0x2
jmp 0x4d795
cmpl $0x1fffff, %eax         # imm = 0x1FFFFF
ja 0x4d742
shrl $0x10, %ecx
orb $-0x40, %cl
movb %cl, 0xb(%rsp)
movb %ah, 0xc(%rsp)
movb %al, 0xd(%rsp)
pushq $0x3
jmp 0x4d795
cmpl $0xfffffff, %eax        # imm = 0xFFFFFFF
ja 0x4d768
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)
pushq $0x4
jmp 0x4d795
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)
pushq $0x5
popq %rax
movl %eax, %r14d
movl $0x400, %r15d           # imm = 0x400
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rdi
leaq (%rdi,%r14), %rcx
cmpq %rcx, %rax
ja 0x4d812
movq %rax, %xmm0
punpckldq 0x2d853(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x2d85b(%rip), %xmm0    # 0x7b020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x3200f(%rip), %xmm1    # 0x7f7e8
cvttsd2si %xmm1, %rcx
movq %rcx, %rdx
subsd 0x398e7(%rip), %xmm1    # 0x870d0
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)
jmp 0x4d79f
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_O2/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 %rax
leaq 0x4(%rsp), %rax
movl %esi, (%rax)
movq (%rdi), %rdi
pushq $0x4
popq %rdx
movq %rax, %rsi
callq 0x4c987
xorl %ecx, %ecx
cmpq $0x4, %rax
sete %cl
leal (%rcx,%rcx,4), %eax
decl %eax
popq %rcx
retq