LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_stats.c
// Function: cram_stats_add
void cram_stats_add(cram_stats *st, int32_t val) {
    st->nsamp++;

    //assert(val >= 0);

    if (val < MAX_STAT_VAL && val >= 0) {
	st->freqs[val]++;
    } else {
	khint_t k;
	int r;

	if (!st->h) {
	    st->h = kh_init(m_i2i);
	}

	k = kh_put(m_i2i, st->h, val, &r);
	if (r == 0)
	    kh_val(st->h, k)++;
	else if (r != -1)
	    kh_val(st->h, k) = 1;
	else
	    ; // FIXME: handle error
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
incl 0x1008(%rdi)
cmpl $0x3ff, %esi            # imm = 0x3FF
ja 0x3a5e0
movl %ebp, %eax
incl (%rbx,%rax,4)
jmp 0x3a773
cmpq $0x0, 0x1000(%rbx)
jne 0x3a600
movl $0x1, %edi
movl $0x28, %esi
callq 0x4360
movq %rax, 0x1000(%rbx)
movq 0x1000(%rbx), %r14
movl 0x8(%r14), %eax
cmpl 0xc(%r14), %eax
jb 0x3a630
movl (%r14), %esi
movl 0x4(%r14), %eax
addl %eax, %eax
cmpl %eax, %esi
jbe 0x3a622
decl %esi
jmp 0x3a624
incl %esi
movq %r14, %rdi
callq 0x3ab16
testl %eax, %eax
js 0x3a6ac
movl (%r14), %esi
leal -0x1(%rsi), %r9d
movl %r9d, %eax
andl %ebp, %eax
movq 0x10(%r14), %rdx
movl %eax, %ecx
shrl $0x4, %ecx
movl (%rdx,%rcx,4), %edi
leal (%rax,%rax), %ecx
shrl %cl, %edi
testb $0x2, %dil
jne 0x3a6de
movl $0x1, %r10d
movl %eax, %r8d
movl %esi, %edi
movl %r8d, %ecx
shrl $0x4, %ecx
movl (%rdx,%rcx,4), %r11d
leal (%r8,%r8), %ecx
andl $0x1e, %ecx
movl %r11d, %r15d
shrl %cl, %r15d
testb $0x2, %r15b
jne 0x3a6b9
testb $0x1, %r15b
jne 0x3a692
movq 0x18(%r14), %r15
movl %r8d, %r12d
cmpl %ebp, (%r15,%r12,4)
je 0x3a6b9
btl %ecx, %r11d
cmovbl %r8d, %edi
addl %r10d, %r8d
andl %r9d, %r8d
incl %r10d
movl %edi, %ecx
cmpl %eax, %r8d
jne 0x3a662
jmp 0x3a6bb
movl (%r14), %eax
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
jmp 0x3a744
movl %esi, %ecx
movl %ecx, %eax
cmpl %esi, %ecx
jne 0x3a6de
movl %r8d, %eax
shrl $0x4, %eax
movl (%rdx,%rax,4), %eax
leal (%r8,%r8), %ecx
shrl %cl, %eax
cmpl %esi, %edi
cmovel %r8d, %edi
testb $0x2, %al
cmovel %r8d, %edi
movl %edi, %eax
movl %eax, %esi
shrl $0x4, %esi
movl (%rdx,%rsi,4), %r8d
leal (%rax,%rax), %ecx
andl $0x1e, %ecx
shrl %cl, %r8d
testb $0x2, %r8b
jne 0x3a720
xorl %edi, %edi
testb $0x1, %r8b
je 0x3a744
movq 0x18(%r14), %rdi
movl %eax, %r8d
movl %ebp, (%rdi,%r8,4)
movl $0x3, %edi
shll %cl, %edi
notl %edi
andl %edi, (%rdx,%rsi,4)
incl 0x4(%r14)
movl $0x2, %edi
jmp 0x3a744
movq 0x18(%r14), %rdi
movl %eax, %r8d
movl %ebp, (%rdi,%r8,4)
movl $0x3, %edi
shll %cl, %edi
notl %edi
andl %edi, (%rdx,%rsi,4)
incl 0x4(%r14)
incl 0x8(%r14)
movl $0x1, %edi
cmpl $-0x1, %edi
je 0x3a773
testl %edi, %edi
jne 0x3a75f
movq 0x1000(%rbx), %rcx
movq 0x20(%rcx), %rcx
movl %eax, %eax
incl (%rcx,%rax,4)
jmp 0x3a773
movq 0x1000(%rbx), %rcx
movq 0x20(%rcx), %rcx
movl %eax, %eax
movl $0x1, (%rcx,%rax,4)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_stats.c
// Function: cram_stats_del
void cram_stats_del(cram_stats *st, int32_t val) {
    st->nsamp--;

    //assert(val >= 0);

    if (val < MAX_STAT_VAL && val >= 0) {
	st->freqs[val]--;
	assert(st->freqs[val] >= 0);
    } else if (st->h) {
	khint_t k = kh_get(m_i2i, st->h, val);

	if (k != kh_end(st->h)) {
	    if (--kh_val(st->h, k) == 0)
		kh_del(m_i2i, st->h, k);
	} else {
	    fprintf(stderr, "Failed to remove val %d from cram_stats\n", val);
	    st->nsamp++;
	}
    } else {
	fprintf(stderr, "Failed to remove val %d from cram_stats\n", val);
	st->nsamp++;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rdx
decl 0x1008(%rdi)
cmpl $0x3ff, %esi            # imm = 0x3FF
ja 0x3a7c6
movl %esi, %eax
movl (%rdx,%rax,4), %ecx
leal -0x1(%rcx), %esi
movl %esi, (%rdx,%rax,4)
testl %ecx, %ecx
jg 0x3a89f
leaq 0x1aa22(%rip), %rdi     # 0x551d0
leaq 0x1aa2f(%rip), %rsi     # 0x551e4
leaq 0x1aa3a(%rip), %rcx     # 0x551f6
movl $0x52, %edx
callq 0x4350
movq 0x1000(%rdx), %rdi
addq $0x1008, %rdx           # imm = 0x1008
testq %rdi, %rdi
je 0x3a889
movl (%rdi), %r8d
testl %r8d, %r8d
je 0x3a846
leal -0x1(%r8), %r9d
movl %r9d, %r10d
andl %esi, %r10d
movq 0x10(%rdi), %r11
movl $0x1, %ebx
movl %r10d, %eax
movl %eax, %ecx
shrl $0x4, %ecx
movl (%r11,%rcx,4), %ebp
leal (%rax,%rax), %ecx
andl $0x1e, %ecx
movl %ebp, %r14d
shrl %cl, %r14d
testb $0x2, %r14b
jne 0x3a83a
testb $0x1, %r14b
jne 0x3a829
movq 0x18(%rdi), %r14
movl %eax, %r15d
cmpl %esi, (%r14,%r15,4)
je 0x3a83a
addl %ebx, %eax
andl %r9d, %eax
incl %ebx
cmpl %r10d, %eax
jne 0x3a7fb
movl %r8d, %eax
jmp 0x3a848
shrl %cl, %ebp
testb $0x3, %bpl
cmovnel %r8d, %eax
jmp 0x3a848
xorl %eax, %eax
cmpl %r8d, %eax
je 0x3a895
movq 0x20(%rdi), %rcx
movl %eax, %edx
decl (%rcx,%rdx,4)
jne 0x3a89f
cmpl %eax, (%rdi)
je 0x3a89f
movq 0x10(%rdi), %rdx
movl %eax, %esi
shrl $0x4, %esi
movl (%rdx,%rsi,4), %r8d
addl %eax, %eax
andl $0x1e, %eax
movl %r8d, %r9d
movl %eax, %ecx
shrl %cl, %r9d
testb $0x3, %r9b
jne 0x3a89f
btsl %eax, %r8d
movl %r8d, (%rdx,%rsi,4)
decl 0x4(%rdi)
jmp 0x3a89f
movl %esi, %edi
movq %rdx, %rsi
callq 0x59ea
jmp 0x3a89f
movl %esi, %edi
movq %rdx, %rsi
callq 0x59c8
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mstdin
mFILE *mstdin(void) {
    if (m_channel[0])
	return m_channel[0];

    m_channel[0] = mfcreate(NULL, 0);
    if (NULL == m_channel[0]) return NULL;
    m_channel[0]->fp = stdin;
    return m_channel[0];
}

// Assembly:
movq 0x296f9(%rip), %rax     # 0x64570
testq %rax, %rax
je 0x3ae7d
retq
pushq %rax
movl $0x38, %edi
callq 0x4700
testq %rax, %rax
je 0x3aeac
xorps %xmm0, %xmm0
movups %xmm0, 0xc(%rax)
movups %xmm0, (%rax)
movups %xmm0, 0x20(%rax)
movq $0x0, 0x30(%rax)
movl $0x3, 0x1c(%rax)
jmp 0x3aeae
xorl %eax, %eax
movq %rax, 0x296bb(%rip)     # 0x64570
testq %rax, %rax
je 0x3aec9
movq 0x290ff(%rip), %rcx     # 0x63fc0
movq (%rcx), %rcx
movq %rcx, (%rax)
jmp 0x3aecb
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfcreate
mFILE *mfcreate(char *data, int size) {
    mFILE *mf = (mFILE *)malloc(sizeof(*mf));
    if (NULL == mf) return NULL;
    mf->fp = NULL;
    mf->data = data;
    mf->alloced = size;
    mf->size = size;
    mf->eof = 0;
    mf->offset = 0;
    mf->flush_pos = 0;
    mf->mode = MF_READ | MF_WRITE;
    return mf;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl $0x38, %edi
callq 0x4700
testq %rax, %rax
je 0x3af15
movq $0x0, (%rax)
movq %r14, 0x8(%rax)
movslq %ebx, %rcx
movq %rcx, 0x10(%rax)
movq %rcx, 0x20(%rax)
movabsq $0x300000000, %rcx      # imm = 0x300000000
movq %rcx, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rax)
jmp 0x3af17
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mstdout
mFILE *mstdout(void) {
    if (m_channel[1])
	return m_channel[1];

    m_channel[1] = mfcreate(NULL, 0);
    if (NULL == m_channel[1]) return NULL;
    m_channel[1]->fp = stdout;
    m_channel[1]->mode = MF_WRITE;
    return m_channel[1];
}

// Assembly:
movq 0x2965a(%rip), %rax     # 0x64580
testq %rax, %rax
je 0x3af2c
retq
pushq %rax
movl $0x38, %edi
callq 0x4700
testq %rax, %rax
je 0x3af5b
xorps %xmm0, %xmm0
movups %xmm0, 0xc(%rax)
movups %xmm0, (%rax)
movups %xmm0, 0x20(%rax)
movq $0x0, 0x30(%rax)
movl $0x3, 0x1c(%rax)
jmp 0x3af5d
xorl %eax, %eax
movq %rax, 0x2961c(%rip)     # 0x64580
testq %rax, %rax
je 0x3af7f
movq 0x29020(%rip), %rcx     # 0x63f90
movq (%rcx), %rcx
movq %rcx, (%rax)
movl $0x2, 0x1c(%rax)
jmp 0x3af81
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mstderr
mFILE *mstderr(void) {
    if (m_channel[2])
	return m_channel[2];

    m_channel[2] = mfcreate(NULL, 0);
    if (NULL == m_channel[2]) return NULL;
    m_channel[2]->fp = stderr;
    m_channel[2]->mode = MF_WRITE;
    return m_channel[2];
}

// Assembly:
movq 0x29603(%rip), %rax     # 0x64590
testq %rax, %rax
je 0x3af93
retq
pushq %rax
movl $0x38, %edi
callq 0x4700
testq %rax, %rax
je 0x3afc2
xorps %xmm0, %xmm0
movups %xmm0, 0xc(%rax)
movups %xmm0, (%rax)
movups %xmm0, 0x20(%rax)
movq $0x0, 0x30(%rax)
movl $0x3, 0x1c(%rax)
jmp 0x3afc4
xorl %eax, %eax
movq %rax, 0x295c5(%rip)     # 0x64590
testq %rax, %rax
je 0x3afe6
movq 0x28ff1(%rip), %rcx     # 0x63fc8
movq (%rcx), %rcx
movq %rcx, (%rax)
movl $0x2, 0x1c(%rax)
jmp 0x3afe8
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfrecreate
void mfrecreate(mFILE *mf, char *data, int size) {
    if (mf->data)
	free(mf->data);
    mf->data = data;
    mf->size = size;
    mf->alloced = size;
    mf->eof = 0;
    mf->offset = 0;
    mf->flush_pos = 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x3b007
callq 0x4610
movq %r14, 0x8(%rbx)
movslq %ebp, %rax
movq %rax, 0x20(%rbx)
movq %rax, 0x10(%rbx)
movl $0x0, 0x18(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfload
static char *mfload(FILE *fp, const char *fn, size_t *size, int binary) {
    struct stat sb;
    char *data = NULL;
    size_t allocated = 0, used = 0;
    int bufsize = 8192;

#ifdef _WIN32
    if (binary)
	_setmode(_fileno(fp), _O_BINARY);
    else 
	_setmode(_fileno(fp), _O_TEXT);
#endif

    if (fn && -1 != stat(fn, &sb)) {
	data = malloc(allocated = sb.st_size);
	bufsize = sb.st_size;
    } else {
	fn = NULL;
    }

    do {
	size_t len;
	if (used + bufsize > allocated) {
	    allocated += bufsize;
	    data = realloc(data, allocated);
	}
	len = fread(data + used, 1, allocated - used, fp);
	if (len > 0)
	    used += len;
    } while (!feof(fp) && (fn == NULL || used < sb.st_size));

    *size = used;

    return data;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, (%rsp)
movq %rdi, %r14
movb $0x1, %bpl
movl $0x2000, %r13d          # imm = 0x2000
testq %rsi, %rsi
je 0x3b27b
leaq 0x8(%rsp), %rax
movq %rsi, %rdi
movq %rax, %rsi
callq 0x44a0
cmpl $-0x1, %eax
je 0x3b27b
movq 0x38(%rsp), %r12
movq %r12, %rdi
callq 0x4700
movq %rax, %r15
movslq %r12d, %r13
xorl %ebp, %ebp
jmp 0x3b281
xorl %r15d, %r15d
xorl %r12d, %r12d
xorl %ebx, %ebx
leaq (%rbx,%r13), %rax
cmpq %r12, %rax
jbe 0x3b29d
addq %r13, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x48d0
movq %rax, %r15
leaq (%r15,%rbx), %rdi
movq %r12, %rdx
subq %rbx, %rdx
movl $0x1, %esi
movq %r14, %rcx
callq 0x47d0
addq %rax, %rbx
movq %r14, %rdi
callq 0x4830
testl %eax, %eax
jne 0x3b2d0
cmpq 0x38(%rsp), %rbx
setb %al
orb %bpl, %al
jne 0x3b283
movq (%rsp), %rax
movq %rbx, (%rax)
movq %r15, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfflush
int mfflush(mFILE *mf) {
    if (!mf->fp)
	return 0;

    /* FIXME: only do this when opened in write mode */
    if (mf == m_channel[1] || mf == m_channel[2]) {
	if (mf->flush_pos < mf->size) {
	    size_t bytes = mf->size - mf->flush_pos;
	    if (fwrite(mf->data + mf->flush_pos, 1, bytes, mf->fp) < bytes)
		return -1;
	    if (0 != fflush(mf->fp))
		return -1;
	}

	/* Stdout & stderr are non-seekable streams so throw away the data */
	mf->offset = mf->size = mf->flush_pos = 0;
    }

    /* only flush when opened in write mode */
    if (mf->mode & MF_WRITE) {
	if (mf->flush_pos < mf->size) {
	    size_t bytes = mf->size - mf->flush_pos;
	    if (!(mf->mode & MF_MODEX)) {
		fseek(mf->fp, mf->flush_pos, SEEK_SET);
	    }
	    if (fwrite(mf->data + mf->flush_pos, 1, bytes, mf->fp) < bytes)
		return -1;
	    if (0 != fflush(mf->fp))
		return -1;
	}
	if (ftell(mf->fp) != -1 &&
	    ftruncate(fileno(mf->fp), ftell(mf->fp)) == -1)
		return -1;
	mf->flush_pos = mf->size;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x3b44a
movq %rdi, %rbx
cmpq %rdi, 0x2921a(%rip)     # 0x64580
je 0x3b371
cmpq %rbx, 0x29221(%rip)     # 0x64590
jne 0x3b3bf
movq 0x20(%rbx), %r14
movq 0x30(%rbx), %rdi
subq %rdi, %r14
jbe 0x3b3ad
addq 0x8(%rbx), %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x4a30
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq %r14, %rax
jb 0x3b44c
movq (%rbx), %rdi
callq 0x45f0
testl %eax, %eax
jne 0x3b44c
leaq 0x20(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movl 0x1c(%rbx), %eax
testb $0x2, %al
je 0x3b44a
movq 0x20(%rbx), %r14
movq 0x30(%rbx), %rsi
subq %rsi, %r14
jbe 0x3b413
testb $0x20, %al
jne 0x3b3e5
movq (%rbx), %rdi
xorl %edx, %edx
callq 0x45b0
movq (%rbx), %rcx
movq 0x8(%rbx), %rdi
addq 0x30(%rbx), %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x4a30
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq %r14, %rax
jb 0x3b44c
movq (%rbx), %rdi
callq 0x45f0
testl %eax, %eax
jne 0x3b44c
movq (%rbx), %rdi
callq 0x4030
cmpq $-0x1, %rax
je 0x3b442
movq (%rbx), %rdi
callq 0x4570
movl %eax, %ebp
movq (%rbx), %rdi
callq 0x4030
movl %ebp, %edi
movq %rax, %rsi
callq 0x4720
cmpl $-0x1, %eax
je 0x3b453
movq 0x20(%rbx), %rax
movq %rax, 0x30(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x3b44c
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfdestroy
int mfdestroy(mFILE *mf) {
    if (!mf)
	return -1;

    if (mf->data)
	free(mf->data);
    free(mf);

    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x3b47d
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x3b471
callq 0x4610
movq %rbx, %rdi
callq 0x4610
xorl %eax, %eax
popq %rbx
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfdetach
int mfdetach(mFILE *mf) {
    if (!mf)
	return -1;

    mfflush(mf);
    if (mf->mode & MF_MMAP)
	return -1;

    if (mf->fp) {
	fclose(mf->fp);
	mf->fp = NULL;
    }

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x3b4b6
movq %rdi, %r14
callq 0x3b34c
testb $0x40, 0x1c(%r14)
jne 0x3b4b6
movq (%r14), %rdi
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x3b4b6
callq 0x4530
movq $0x0, (%r14)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfsteal
void *mfsteal(mFILE *mf, size_t *size_out) {
    void *data;

    if (!mf) return NULL;

    data = mf->data;
    
    if (NULL != size_out) *size_out = mf->size;

    if (mfdetach(mf) != 0)
	return NULL;

    mf->data = NULL;
    mfdestroy(mf);

    return data;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x3b4e8
movq %rdi, %r14
movq 0x8(%rdi), %rbx
testq %rsi, %rsi
je 0x3b4dc
movq 0x20(%r14), %rax
movq %rax, (%rsi)
movq %r14, %rdi
callq 0x3b483
testl %eax, %eax
je 0x3b4ec
xorl %ebx, %ebx
jmp 0x3b4fc
movq $0x0, 0x8(%r14)
movq %r14, %rdi
callq 0x3b45a
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfseek
int mfseek(mFILE *mf, long offset, int whence) {
    switch (whence) {
    case SEEK_SET:
	mf->offset = offset;
	break;
    case SEEK_CUR:
	mf->offset += offset;
	break;
    case SEEK_END:
	mf->offset = mf->size + offset;
	break;
    default:
	errno = EINVAL;
	return -1;
    }

    mf->eof = 0;
    return 0;
}

// Assembly:
cmpl $0x2, %edx
je 0x3b531
cmpl $0x1, %edx
je 0x3b52b
testl %edx, %edx
je 0x3b535
pushq %rax
callq 0x4070
movl $0x16, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
retq
addq %rsi, 0x28(%rdi)
jmp 0x3b539
addq 0x20(%rdi), %rsi
movq %rsi, 0x28(%rdi)
movl $0x0, 0x18(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfread
size_t mfread(void *ptr, size_t size, size_t nmemb, mFILE *mf) {
    size_t len;
    char *cptr = (char *)ptr;
    
    if (mf == m_channel[0]) init_mstdin();

    if (mf->size <= mf->offset)
	return 0;

    len = size * nmemb <= mf->size - mf->offset
	? size * nmemb
	: mf->size - mf->offset;
    if (!size)
	return 0;

    memcpy(cptr, &mf->data[mf->offset], len);
    mf->offset += len;
    
    if (len != size * nmemb) {
	mf->eof = 1;
    }

    return len / size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r12
cmpq %rcx, 0x28fdd(%rip)     # 0x64570
jne 0x3b59a
callq 0x3b5f5
movq 0x20(%r14), %rbp
movq 0x28(%r14), %rsi
subq %rsi, %rbp
jbe 0x3b5e4
imulq %rbx, %r15
cmpq %rbp, %r15
movq %rbp, %r13
cmovbq %r15, %r13
testq %rbx, %rbx
je 0x3b5e4
addq 0x8(%r14), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x4420
addq %r13, 0x28(%r14)
cmpq %rbp, %r15
jbe 0x3b5da
movl $0x1, 0x18(%r14)
movq %r13, %rax
xorl %edx, %edx
divq %rbx
jmp 0x3b5e6
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: init_mstdin
static void init_mstdin(void) {
    static int done_stdin = 0;
    if (done_stdin)
	return;

    m_channel[0]->data = mfload(stdin, NULL, &m_channel[0]->size, 1);
    m_channel[0]->mode = MF_READ;
    done_stdin = 1;
}

// Assembly:
cmpb $0x0, 0x28f9c(%rip)     # 0x64598
jne 0x3b638
pushq %rax
movq 0x289ba(%rip), %rax     # 0x63fc0
movq (%rax), %rdi
movq 0x28f60(%rip), %rdx     # 0x64570
addq $0x20, %rdx
xorl %esi, %esi
callq 0x3b229
movq 0x28f4e(%rip), %rcx     # 0x64570
movq %rax, 0x8(%rcx)
movl $0x1, 0x1c(%rcx)
movb $0x1, 0x28f64(%rip)     # 0x64598
addq $0x8, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfwrite
size_t mfwrite(void *ptr, size_t size, size_t nmemb, mFILE *mf) {
    if (!(mf->mode & MF_WRITE))
	return 0;

    /* Append mode => forced all writes to end of file */
    if (mf->mode & MF_APPEND)
	mf->offset = mf->size;

    /* Make sure we have enough room */
    while (size * nmemb + mf->offset > mf->alloced) {
	size_t new_alloced = mf->alloced ? mf->alloced * 2 : 1024;
	void * new_data = realloc(mf->data, new_alloced);
	if (NULL == new_data) return 0;
	mf->alloced = new_alloced;
	mf->data    = new_data;
    }

    /* Record where we need to reflush from */
    if (mf->offset < mf->flush_pos)
	mf->flush_pos = mf->offset;

    /* Copy the data over */
    memcpy(&mf->data[mf->offset], ptr, size * nmemb);
    mf->offset += size * nmemb;
    if (mf->size < mf->offset)
	mf->size = mf->offset;

    return nmemb;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x1c(%rcx), %eax
testb $0x2, %al
jne 0x3b652
xorl %ebx, %ebx
jmp 0x3b6e1
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
testb $0x4, %al
je 0x3b66a
movq 0x20(%r14), %rax
movq %rax, 0x28(%r14)
imulq %rbx, %r15
movq 0x10(%r14), %r13
movq 0x28(%r14), %rdi
leaq (%rdi,%r15), %rax
cmpq %r13, %rax
jbe 0x3b6b6
movl $0x400, %ebp            # imm = 0x400
testq %r13, %r13
leaq (%r13,%r13), %r13
cmoveq %rbp, %r13
movq 0x8(%r14), %rdi
movq %r13, %rsi
callq 0x48d0
testq %rax, %rax
je 0x3b64b
movq %r13, 0x10(%r14)
movq %rax, 0x8(%r14)
movq 0x28(%r14), %rdi
leaq (%rdi,%r15), %rax
cmpq %r13, %rax
ja 0x3b684
cmpq 0x30(%r14), %rdi
jae 0x3b6c0
movq %rdi, 0x30(%r14)
addq 0x8(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x4420
addq 0x28(%r14), %r15
movq %r15, 0x28(%r14)
cmpq %r15, 0x20(%r14)
jae 0x3b6e1
movq %r15, 0x20(%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfgetc
int mfgetc(mFILE *mf) {
    if (mf == m_channel[0]) init_mstdin();
    if (mf->offset < mf->size) {
	return (unsigned char)mf->data[mf->offset++];
    }

    mf->eof = 1;
    return -1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpq %rdi, 0x28e72(%rip)     # 0x64570
jne 0x3b705
callq 0x3b5f5
movq 0x28(%rbx), %rax
cmpq 0x20(%rbx), %rax
jae 0x3b721
movq 0x8(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x28(%rbx)
movzbl (%rcx,%rax), %eax
jmp 0x3b72d
movl $0x1, 0x18(%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfgets
char *mfgets(char *s, int size, mFILE *mf) {
    int i;

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

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
cmpq %rdx, 0x28e05(%rip)     # 0x64570
jne 0x3b772
callq 0x3b5f5
movb $0x0, (%rbx)
cmpl $0x2, %ebp
movl $0x1, %eax
cmovgel %ebp, %eax
decl %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x3b7b9
movq 0x28(%r14), %rdx
cmpq 0x20(%r14), %rdx
jae 0x3b7af
movq 0x8(%r14), %rsi
leaq 0x1(%rdx), %rdi
movq %rdi, 0x28(%r14)
movb (%rsi,%rdx), %dl
movb %dl, (%rbx,%rcx)
incq %rcx
cmpb $0xa, %dl
jne 0x3b784
jmp 0x3b7b7
movl $0x1, 0x18(%r14)
movl %ecx, %eax
movslq %eax, %rcx
movb $0x0, (%rbx,%rcx)
xorl %eax, %eax
testl %ecx, %ecx
cmovneq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfprintf
int mfprintf(mFILE *mf, char *fmt, ...) {
    int ret;
    size_t est_length;
    va_list args;

    va_start(args, fmt);
    est_length = vflen(fmt, args);
    va_end(args);
    while (est_length + mf->offset > mf->alloced) {
	size_t new_alloced = mf->alloced ? mf->alloced * 2 : 1024;
	void * new_data    = realloc(mf->data, new_alloced);
	if (NULL == new_data) return -1;
	mf->alloced = new_alloced;
	mf->data    = new_data;
    }

    va_start(args, fmt);
    ret = vsprintf(&mf->data[mf->offset], fmt, args);
    va_end(args);

    if (ret > 0) {
	mf->offset += ret;
	if (mf->size < mf->offset)
	    mf->size = mf->offset;
    }

    if (mf->fp == stderr) {
	/* Auto-flush for stderr */
	if (0 != mfflush(mf)) return -1;
    }

    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rsp), %r12
movq %rdx, 0x10(%r12)
movq %rcx, 0x18(%r12)
movq %r8, 0x20(%r12)
movq %r9, 0x28(%r12)
testb %al, %al
je 0x3b838
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)
movq %rsp, %rsi
movq %r12, 0x10(%rsi)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rsi)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsi)
movq %r14, %rdi
callq 0x428bc
movslq %eax, %r13
movq 0x28(%rbx), %rax
addq %r13, %rax
movq 0x10(%rbx), %r15
cmpq %r15, %rax
jbe 0x3b8ac
movl $0x400, %ebp            # imm = 0x400
testq %r15, %r15
leaq (%r15,%r15), %r15
cmoveq %rbp, %r15
movq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x48d0
testq %rax, %rax
je 0x3b91e
movq %r15, 0x10(%rbx)
movq %rax, 0x8(%rbx)
movq 0x28(%rbx), %rax
addq %r13, %rax
cmpq %r15, %rax
ja 0x3b878
movq %rsp, %rdx
movq %r12, 0x10(%rdx)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
movq 0x8(%rbx), %rdi
addq 0x28(%rbx), %rdi
movq %r14, %rsi
callq 0x4250
movl %eax, %ebp
testl %eax, %eax
jle 0x3b8f6
movl %ebp, %eax
addq 0x28(%rbx), %rax
movq %rax, 0x28(%rbx)
cmpq %rax, 0x20(%rbx)
jae 0x3b8f6
movq %rax, 0x20(%rbx)
movq (%rbx), %rax
movq 0x286c8(%rip), %rcx     # 0x63fc8
cmpq (%rcx), %rax
je 0x3b909
movl %ebp, %eax
jmp 0x3b923
movq %rbx, %rdi
callq 0x3b34c
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x3b923
jmp 0x3b905
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfascii
void mfascii(mFILE *mf) {
    size_t p1, p2;

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

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

// Assembly:
movl $0x1, %eax
cmpq $0x2, 0x20(%rdi)
jb 0x3b973
movl $0x1, %ecx
movq 0x8(%rdi), %rdx
movb (%rdx,%rcx), %sil
cmpb $0xa, %sil
jne 0x3b963
xorl %r8d, %r8d
cmpb $0xd, -0x1(%rdx,%rcx)
sete %r8b
subq %r8, %rax
movb %sil, (%rdx,%rax)
incq %rcx
incq %rax
cmpq 0x20(%rdi), %rcx
jb 0x3b946
movq %rax, 0x20(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/open_trace_file.c
// Function: find_file_url
mFILE *find_file_url(char *file, char *url) {
    char buf[8192], *cp;
    mFILE *mf = NULL;
    int maxlen = 8190 - strlen(file), len;
    hFILE *hf;

    /* Expand %s for the trace name */
    for (cp = buf; *url && cp - buf < maxlen; url++) {
	if (*url == '%' && *(url+1) == 's') {
	    url++;
	    cp += strlen(strcpy(cp, file));
	} else {
	    *cp++ = *url;
	}
    }
    *cp++ = 0;

    if (!(hf = hopen(buf, "r")))
	return NULL;

    if (NULL == (mf = mfcreate(NULL, 0)))
	return NULL;
    while ((len = hread(hf, buf, 8192)) > 0) {
	if (mfwrite(buf, len, 1, mf) <= 0) {
	    hclose_abruptly(hf);
	    mfdestroy(mf);
	    return NULL;
	}
    }
    if (hclose(hf) < 0 || len < 0) {
	mfdestroy(mf);
	return NULL;
    }

    mrewind(mf);
    return mf;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2008, %rsp           # imm = 0x2008
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4230
movl $0x1ffe, %ecx           # imm = 0x1FFE
subl %eax, %ecx
movslq %ecx, %r12
movb (%rbx), %al
testb %al, %al
setne %cl
testq %r12, %r12
setg %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x3bc57
movq %rsp, %r13
movq %r13, %r15
cmpb $0x25, %al
jne 0x3bc3a
cmpb $0x73, 0x1(%rbx)
jne 0x3bc3a
incq %rbx
movq %r15, %rdi
movq %r14, %rsi
callq 0x44e0
movq %r15, %rdi
callq 0x4230
addq %rax, %r15
jmp 0x3bc40
movb %al, (%r15)
incq %r15
movb 0x1(%rbx), %al
testb %al, %al
je 0x3bc5a
incq %rbx
movq %r15, %rcx
subq %r13, %rcx
cmpq %r12, %rcx
jl 0x3bc15
jmp 0x3bc5a
movq %rsp, %r15
movb $0x0, (%r15)
leaq 0x17cb4(%rip), %rsi     # 0x53919
movq %rsp, %rdi
callq 0x4883b
testq %rax, %rax
je 0x3bd39
movq %rax, %r14
xorl %r15d, %r15d
xorl %edi, %edi
xorl %esi, %esi
callq 0x3aed0
testq %rax, %rax
je 0x3bd3c
movq %rax, %rbx
movq %rsp, %r15
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rbp
subq %rsi, %rbp
movl $0x2000, %eax           # imm = 0x2000
cmpq %rax, %rbp
movl $0x2000, %r13d          # imm = 0x2000
cmovbq %rbp, %r13
movq %r15, %rdi
movq %r13, %rdx
callq 0x4420
addq %r13, 0x8(%r14)
movl $0x2000, %r12d          # imm = 0x2000
cmpq $0x1fff, %rbp           # imm = 0x1FFF
ja 0x3bce5
movl $0x2000, %edx           # imm = 0x2000
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rcx
callq 0x48187
movq %rax, %r12
testl %r12d, %r12d
jle 0x3bd13
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
movl $0x1, %edx
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rcx
callq 0x3b639
testq %rax, %rax
jne 0x3bc94
movq %r14, %rdi
callq 0x4850c
jmp 0x3bd31
movq %r14, %rdi
callq 0x484b2
testl %r12d, %r12d
jne 0x3bd31
testl %eax, %eax
js 0x3bd31
movq %rbx, %rdi
callq 0x3b548
movq %rbx, %r15
jmp 0x3bd3c
movq %rbx, %rdi
callq 0x3b45a
xorl %r15d, %r15d
movq %r15, %rax
addq $0x2008, %rsp           # imm = 0x2008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/open_trace_file.c
// Function: find_file_dir
static mFILE *find_file_dir(char *file, char *dirname) {
    char *path;
    mFILE *mf = NULL;

    path = expand_path(file, dirname);

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

    free(path);
    return mf;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
callq 0x3bff4
movq %rax, %rbx
movq %rax, %rdi
callq 0x3adf4
testl %eax, %eax
je 0x3bed3
leaq 0x19438(%rip), %rsi     # 0x552fe
movq %rbx, %rdi
callq 0x3b2ec
movq %rax, %r14
jmp 0x3bed6
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x4610
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/open_trace_file.c
// Function: find_path
char *find_path(char *file, char *path) {
    char *newsearch;
    char *ele;
    char *outpath = NULL;

    /* Use path first */
    if (!path)
	path = getenv("RAWDATA");
    if (NULL == (newsearch = tokenise_search_path(path)))
	return NULL;
    
    for (ele = newsearch; *ele; ele += strlen(ele)+1) {
	char *ele2 = (*ele == '|') ? ele+1 : ele;

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

    free(newsearch);

    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, (%rsp)
testq %rsi, %rsi
jne 0x3bf0c
leaq 0x193ed(%rip), %rdi     # 0x552f1
callq 0x4650
movq %rax, %rsi
movq %rsi, %rdi
callq 0x3b980
testq %rax, %rax
je 0x3bfdf
movq %rax, %rbp
movb (%rax), %al
testb %al, %al
je 0x3bfd7
leaq 0x193c8(%rip), %r12     # 0x552f9
movq %rbp, %r14
xorl %ebx, %ebx
cmpb $0x7c, %al
sete %bl
addq %r14, %rbx
movl $0x4, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4280
movl $0x4, %r13d
testl %eax, %eax
je 0x3bfb8
movl $0x5, %edx
movq %rbx, %rdi
leaq 0x1937b(%rip), %rsi     # 0x552e2
callq 0x4280
testl %eax, %eax
je 0x3bfb8
movl $0x4, %edx
movq %rbx, %rdi
leaq 0x1936d(%rip), %rsi     # 0x552ec
callq 0x4280
testl %eax, %eax
je 0x3bfb8
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0x3bff4
movq %rax, %rbx
movq %rax, %rdi
callq 0x3adf4
xorl %r13d, %r13d
testl %eax, %eax
setne %r13b
movq %rbx, %rdi
cmovneq %rbp, %rdi
cmovneq %rbx, %r15
callq 0x4610
testb $0x3, %r13b
jne 0x3bfe2
movq %r14, %rdi
callq 0x4230
addq %rax, %r14
incq %r14
movb (%r14), %al
testb %al, %al
jne 0x3bf34
movq %rbp, %rdi
callq 0x4610
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_dump
void sam_hdr_dump(SAM_hdr *hdr) {
    khint_t k;
    int i;

    printf("===DUMP===\n");
    for (k = kh_begin(hdr->h); k != kh_end(hdr->h); k++) {
	SAM_hdr_type *t1, *t2;
	char c[2];

	if (!kh_exist(hdr->h, k))
	    continue;

	t1 = t2 = kh_val(hdr->h, k);
	c[0] = kh_key(hdr->h, k)>>8;
	c[1] = kh_key(hdr->h, k)&0xff;
	printf("Type %.2s, count %d\n", c, t1->prev->order+1);

	do {
	    SAM_hdr_tag *tag;
	    printf(">>>%d ", t1->order);
	    for (tag = t1->tag; tag; tag=tag->next) {
		printf("\"%.2s\":\"%.*s\"\t",
		       tag->str, tag->len-3, tag->str+3);
	    }
	    putchar('\n');
	    t1 = t1->next;
	} while (t1 != t2);
    }

    /* Dump out PG chains */
    printf("\n@PG chains:\n");
    for (i = 0; i < hdr->npg_end; i++) {
	int j;
	printf("  %d:", i);
	for (j = hdr->pg_end[i]; j != -1; j = hdr->pg[j].prev_id) {
	    printf("%s%d(%.*s)", 
		   j == hdr->pg_end[i] ? " " : "->",
		   j, hdr->pg[j].name_len, hdr->pg[j].name);
	}
	printf("\n");
    }

    puts("===END DUMP===");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x178a1(%rip), %rdi     # 0x557f2
callq 0x4810
movq 0x18(%rbx), %rax
cmpl $0x0, (%rax)
je 0x3e020
leaq 0x176d1(%rip), %r13     # 0x5563b
xorl %ebp, %ebp
movq 0x10(%rax), %rcx
movl %ebp, %edx
shrl $0x4, %edx
movl (%rcx,%rdx,4), %edx
leal (,%rbp,2), %ecx
shrl %cl, %edx
testb $0x3, %dl
jne 0x3e012
movq 0x18(%rax), %rcx
movq 0x20(%rax), %rax
movl %ebp, %edx
movq (%rax,%rdx,8), %r15
movzwl (%rcx,%rdx,4), %eax
rolw $0x8, %ax
movw %ax, 0x6(%rsp)
movq 0x8(%r15), %rax
movl 0x18(%rax), %edx
incl %edx
leaq 0x1766a(%rip), %rdi     # 0x5561f
leaq 0x6(%rsp), %rsi
xorl %eax, %eax
callq 0x4080
movq %r15, %r14
movl 0x18(%r14), %esi
leaq 0x17665(%rip), %rdi     # 0x55634
xorl %eax, %eax
callq 0x4080
movq 0x10(%r14), %r12
testq %r12, %r12
je 0x3e000
movq 0x8(%r12), %rsi
movl 0x10(%r12), %edx
addl $-0x3, %edx
leaq 0x3(%rsi), %rcx
movq %r13, %rdi
xorl %eax, %eax
callq 0x4080
movq (%r12), %r12
jmp 0x3dfda
movl $0xa, %edi
callq 0x4740
movq (%r14), %r14
cmpq %r15, %r14
jne 0x3dfc4
incl %ebp
movq 0x18(%rbx), %rax
cmpl (%rax), %ebp
jne 0x3df6c
leaq 0x177d6(%rip), %rdi     # 0x557fd
callq 0x4810
cmpl $0x0, 0x6c(%rbx)
jle 0x3e0c8
leaq 0x13c1c(%rip), %r13     # 0x51c59
leaq 0x17617(%rip), %rbp     # 0x5565b
leaq 0x17605(%rip), %r15     # 0x55650
xorl %r12d, %r12d
leaq 0x175f5(%rip), %rdi     # 0x5564a
movl %r12d, %esi
xorl %eax, %eax
callq 0x4080
movq 0x88(%rbx), %rax
movl (%rax,%r12,4), %eax
cmpl $-0x1, %eax
je 0x3e0b2
movq 0x78(%rbx), %rdi
movq 0x88(%rbx), %rcx
cmpl (%rcx,%r12,4), %eax
movq %rbp, %rsi
cmoveq %r13, %rsi
movslq %eax, %rdx
leaq (,%rdx,8), %rax
leaq (%rax,%rax,4), %r14
movl 0x18(%rdi,%r14), %ecx
movq (%rdi,%r14), %r8
movq %r15, %rdi
xorl %eax, %eax
callq 0x4080
movq 0x78(%rbx), %rax
movl 0x20(%rax,%r14), %eax
jmp 0x3e06a
movl $0xa, %edi
callq 0x4740
incq %r12
movslq 0x6c(%rbx), %rax
cmpq %rax, %r12
jl 0x3e04e
leaq 0x1758f(%rip), %rdi     # 0x5565e
callq 0x4810
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_find_key
SAM_hdr_tag *sam_hdr_find_key(SAM_hdr *sh,
			      SAM_hdr_type *type,
			      char *key,
			      SAM_hdr_tag **prev) {
    SAM_hdr_tag *tag, *p = NULL;

    for (tag = type->tag; tag; p = tag, tag = tag->next) {
	if (tag->str[0] == key[0] && tag->str[1] == key[1]) {
	    if (prev)
		*prev = p;
	    return tag;
	}
    }

    if (prev)
	*prev = p;

    return NULL;
}

// Assembly:
movq 0x10(%rsi), %r8
testq %r8, %r8
je 0x3ff55
movb (%rdx), %dil
xorl %esi, %esi
movq %r8, %rax
movq 0x8(%r8), %r8
cmpb %dil, (%r8)
jne 0x3ff48
movb 0x1(%r8), %r8b
cmpb 0x1(%rdx), %r8b
je 0x3ff5f
movq (%rax), %r8
movq %rax, %rsi
testq %r8, %r8
jne 0x3ff32
jmp 0x3ff57
xorl %eax, %eax
movq %rax, %rsi
movl $0x0, %eax
testq %rcx, %rcx
je 0x3ff67
movq %rsi, (%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_update
int sam_hdr_update(SAM_hdr *hdr, SAM_hdr_type *type, ...) {
    va_list ap;

    va_start(ap, type);
    
    for (;;) {
	char *k, *v;
	int idx;
	SAM_hdr_tag *tag, *prev;

	if (!(k = (char *)va_arg(ap, char *)))
	    break;
	v = va_arg(ap, char *);

	tag = sam_hdr_find_key(hdr, type, k, &prev);
	if (!tag) {
	    if (!(tag = pool_alloc(hdr->tag_pool)))
		return -1;
	    if (prev)
		prev->next = tag;
	    else
		type->tag = tag;

	    tag->next = NULL;
	}

	idx = ks_len(&hdr->text);
	if (ksprintf(&hdr->text, "%2.2s:%s", k, v) < 0)
	    return -1;
	tag->len = ks_len(&hdr->text) - idx;
	tag->str = string_ndup(hdr->str_pool,
			       ks_str(&hdr->text) + idx,
			       tag->len);
	if (!tag->str)
	    return -1;
    }

    va_end(ap);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x3ffcf
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)
movq %rsi, 0x10(%rsp)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
addq $0x10, %rbx
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x4000c
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x4001a
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %r12
testq %r12, %r12
je 0x4003b
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x40045
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x40053
movl $0x2, %ecx
jmp 0x40106
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %rbp
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x4008a
movb (%r12), %al
xorl %r13d, %r13d
movq %rcx, %r15
movq 0x8(%rcx), %rcx
cmpb %al, (%rcx)
jne 0x4007a
movb 0x1(%rcx), %cl
cmpb 0x1(%r12), %cl
je 0x40090
movq (%r15), %rcx
movq %r15, %r13
testq %rcx, %rcx
jne 0x40065
movq %r15, %r13
jmp 0x4008d
xorl %r13d, %r13d
xorl %r15d, %r15d
testq %r15, %r15
jne 0x400b8
movq 0x30(%r14), %rdi
callq 0x4e186
testq %rax, %rax
je 0x40101
movq %rax, %r15
testq %r13, %r13
cmoveq %rbx, %r13
movq %rax, (%r13)
movq $0x0, (%rax)
movq (%r14), %r13
movq %r14, %rdi
leaq 0x156b9(%rip), %rsi     # 0x5577e
movq %r12, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x42f92
testl %eax, %eax
js 0x40101
movq (%r14), %rax
movslq %r13d, %rsi
subq %r13, %rax
movl %eax, 0x10(%r15)
movq 0x20(%r14), %rdi
addq 0x10(%r14), %rsi
movslq %eax, %rdx
callq 0x41f57
movq %rax, 0x8(%r15)
xorl %ecx, %ecx
testq %rax, %rax
sete %cl
jmp 0x40106
movl $0x1, %ecx
testl %ecx, %ecx
je 0x3fff3
cmpl $0x2, %ecx
jne 0x40117
xorl %eax, %eax
jmp 0x4011c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_new
SAM_hdr *sam_hdr_new() {
    SAM_hdr *sh = calloc(1, sizeof(*sh));

    if (!sh)
	return NULL;
    
    sh->h = kh_init(sam_hdr);
    if (!sh->h)
	goto err;

    sh->ID_cnt = 1;
    sh->ref_count = 1;

    sh->nref = 0;
    sh->ref  = NULL;
    if (!(sh->ref_hash = kh_init(m_s2i)))
	goto err;

    sh->nrg = 0;
    sh->rg  = NULL;
    if (!(sh->rg_hash = kh_init(m_s2i)))
	goto err;

    sh->npg = 0;
    sh->pg  = NULL;
    sh->npg_end = sh->npg_end_alloc = 0;
    sh->pg_end = NULL;
    if (!(sh->pg_hash = kh_init(m_s2i)))
	goto err;

    KS_INIT(&sh->text);

    if (!(sh->tag_pool = pool_create(sizeof(SAM_hdr_tag))))
	goto err;

    if (!(sh->type_pool = pool_create(sizeof(SAM_hdr_type))))
	goto err;

    if (!(sh->str_pool = string_pool_create(8192)))
	goto err;

    return sh;

 err:
    if (sh->h)
	kh_destroy(sam_hdr, sh->h);

    if (sh->tag_pool)
	pool_destroy(sh->tag_pool);

    if (sh->type_pool)
	pool_destroy(sh->type_pool);

    if (sh->str_pool)
	string_pool_destroy(sh->str_pool);

    free(sh);

    return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0x1, %edi
movl $0x4a0, %esi            # imm = 0x4A0
callq 0x4360
testq %rax, %rax
je 0x40950
movq %rax, %rbx
movl $0x1, %edi
movl $0x28, %esi
callq 0x4360
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x408f2
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x494(%rbx)
movl $0x0, 0x38(%rbx)
movq $0x0, 0x40(%rbx)
movl $0x1, %edi
movl $0x28, %esi
callq 0x4360
movq %rax, 0x48(%rbx)
testq %rax, %rax
je 0x408f2
movl $0x0, 0x50(%rbx)
movq $0x0, 0x58(%rbx)
movl $0x1, %edi
movl $0x28, %esi
callq 0x4360
movq %rax, 0x60(%rbx)
testq %rax, %rax
je 0x408f2
xorl %eax, %eax
movq %rax, 0x68(%rbx)
movq %rax, 0x78(%rbx)
movl $0x0, 0x70(%rbx)
movq %rax, 0x88(%rbx)
movl $0x1, %edi
movl $0x28, %esi
callq 0x4360
movq %rax, 0x80(%rbx)
testq %rax, %rax
je 0x408f2
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movl $0x18, %edi
callq 0x4e0c4
movq %rax, 0x30(%rbx)
testq %rax, %rax
je 0x408f2
movl $0x20, %edi
callq 0x4e0c4
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x408f2
movl $0x2000, %edi           # imm = 0x2000
callq 0x41dfc
movq %rax, 0x20(%rbx)
testq %rax, %rax
jne 0x40952
movq 0x18(%rbx), %r14
testq %r14, %r14
je 0x4091e
movq 0x18(%r14), %rdi
callq 0x4610
movq 0x10(%r14), %rdi
callq 0x4610
movq 0x20(%r14), %rdi
callq 0x4610
movq %r14, %rdi
callq 0x4610
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x4092c
callq 0x4e141
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x4093a
callq 0x4e141
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x40948
callq 0x41e2f
movq %rbx, %rdi
callq 0x4610
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_parse_
SAM_hdr *sam_hdr_parse_(const char *hdr, int len) {
    /* Make an empty SAM_hdr */
    SAM_hdr *sh;
    
    sh = sam_hdr_new();
    if (NULL == sh) return NULL;

    if (NULL == hdr) return sh; // empty header is permitted

    /* Parse the header, line by line */
    if (-1 == sam_hdr_add_lines(sh, hdr, len)) {
	sam_hdr_free(sh);
	return NULL;
    }

    /* Obtain sort order */
    sh->sort_order = sam_hdr_parse_sort_order(sh);

    //sam_hdr_dump(sh);
    //sam_hdr_add(sh, "RG", "ID", "foo", "SM", "bar", NULL);
    //sam_hdr_rebuild(sh);
    //printf(">>%s<<", ks_str(sh->text));

    //parse_references(sh);
    //parse_read_groups(sh);

    sam_hdr_link_pg(sh);
    //sam_hdr_dump(sh);

    return sh;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %r14
callq 0x407da
testq %rax, %rax
je 0x40a07
movq %rax, %rbx
testq %r14, %r14
je 0x40af4
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x3e0e3
cmpl $-0x1, %eax
je 0x409ff
movq 0x18(%rbx), %rax
movl (%rax), %edx
testl %edx, %edx
je 0x40a1a
leal -0x1(%rdx), %edi
movl %edi, %r8d
andl $0x4844, %r8d           # imm = 0x4844
movq 0x10(%rax), %r9
movl $0x1, %r10d
movl %r8d, %esi
movl %esi, %ecx
shrl $0x4, %ecx
movl (%r9,%rcx,4), %r11d
leal (%rsi,%rsi), %ecx
andl $0x1e, %ecx
movl %r11d, %ebp
shrl %cl, %ebp
testb $0x2, %bpl
jne 0x40a0e
testb $0x1, %bpl
jne 0x409ee
movq 0x18(%rax), %r14
movl %esi, %r15d
cmpl $0x4844, (%r14,%r15,4)  # imm = 0x4844
je 0x40a0e
addl %r10d, %esi
andl %edi, %esi
incl %r10d
cmpl %r8d, %esi
jne 0x409bd
movl %edx, %esi
jmp 0x40a1c
movq %rbx, %rdi
callq 0x40b06
xorl %ebx, %ebx
jmp 0x40af4
shrl %cl, %r11d
testb $0x3, %r11b
cmovnel %edx, %esi
jmp 0x40a1c
xorl %esi, %esi
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
cmpl %edx, %esi
je 0x40ae5
movq 0x20(%rax), %rax
movl %esi, %ecx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %r12
testq %r12, %r12
je 0x40ae5
leaq 0x14d6e(%rip), %r14     # 0x557b6
leaq 0x14d70(%rip), %r15     # 0x557bf
movq 0x8(%r12), %rbp
cmpb $0x53, (%rbp)
jne 0x40ad8
cmpb $0x4f, 0x1(%rbp)
jne 0x40ad8
addq $0x3, %rbp
movq %rbp, %rdi
movq %r14, %rsi
callq 0x4750
testl %eax, %eax
je 0x40ac5
movq %rbp, %rdi
movq %r15, %rsi
callq 0x4750
testl %eax, %eax
je 0x40aca
movq %rbp, %rdi
leaq 0x14d3d(%rip), %rsi     # 0x557c9
callq 0x4750
testl %eax, %eax
je 0x40ad2
movq %rbp, %rdi
leaq 0x15352(%rip), %rsi     # 0x55df1
callq 0x4750
testl %eax, %eax
je 0x40ad8
movq 0x23519(%rip), %rax     # 0x63fc8
movq (%rax), %rdi
leaq 0x14d1b(%rip), %rsi     # 0x557d4
movq %rbp, %rdx
xorl %eax, %eax
callq 0x4770
jmp 0x40ad8
xorl %r13d, %r13d
jmp 0x40ad8
movl $0x1, %r13d
jmp 0x40ad8
movl $0x2, %r13d
movq (%r12), %r12
testq %r12, %r12
jne 0x40a4f
movl %r13d, 0x90(%rbx)
movq %rbx, %rdi
callq 0x40cf0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_find_rg
SAM_RG *sam_hdr_find_rg(SAM_hdr *hdr, const char *rg) {
    khint_t k = kh_get(m_s2i, hdr->rg_hash, rg);
    return k == kh_end(hdr->rg_hash)
	? NULL
	: &hdr->rg[kh_val(hdr->rg_hash, k)];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x60(%rdi), %rax
movq %rax, (%rsp)
movl (%rax), %eax
testl %eax, %eax
je 0x41107
movq %rsi, %r15
movq %rdi, 0x18(%rsp)
movq %rax, 0x10(%rsp)
leal -0x1(%rax), %edi
movsbl (%rsi), %ebx
testl %ebx, %ebx
je 0x4110f
movb 0x1(%r15), %al
testb %al, %al
je 0x41111
leaq 0x2(%r15), %rcx
movl %ebx, %edx
shll $0x5, %edx
subl %ebx, %edx
movsbl %al, %ebx
addl %edx, %ebx
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x410f0
jmp 0x41111
xorl %r12d, %r12d
jmp 0x411a0
xorl %ebx, %ebx
andl %edi, %ebx
movq (%rsp), %rax
movq 0x10(%rax), %rdx
movl $0x1, %r14d
movl %ebx, %r12d
movl %edi, 0xc(%rsp)
movq %rdx, 0x20(%rsp)
movl %r12d, %eax
shrl $0x4, %eax
movl (%rdx,%rax,4), %r13d
leal (%r12,%r12), %ebp
andl $0x1e, %ebp
movl %r13d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x41189
testb $0x1, %al
jne 0x41171
movq (%rsp), %rax
movq 0x18(%rax), %rax
movl %r12d, %ecx
movq (%rax,%rcx,8), %rdi
movq %r15, %rsi
callq 0x4750
movq 0x20(%rsp), %rdx
movl 0xc(%rsp), %edi
testl %eax, %eax
je 0x41189
addl %r14d, %r12d
andl %edi, %r12d
incl %r14d
cmpl %ebx, %r12d
jne 0x4112d
movq 0x10(%rsp), %rax
movl %eax, %r12d
jmp 0x4119b
movl %ebp, %ecx
shrl %cl, %r13d
testb $0x3, %r13b
movq 0x10(%rsp), %rax
cmovnel %eax, %r12d
movq 0x18(%rsp), %rdi
cmpl %eax, %r12d
jne 0x411a9
xorl %eax, %eax
jmp 0x411c0
movq (%rsp), %rax
movq 0x20(%rax), %rax
movl %r12d, %ecx
movslq (%rax,%rcx,4), %rax
shlq $0x5, %rax
addq 0x58(%rdi), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq