LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/cram_samtools.c
// Function: cram_header_to_bam
bam_hdr_t *cram_header_to_bam(SAM_hdr *h) {
    int i;
    bam_hdr_t *header = bam_hdr_init();

    header->l_text = ks_len(&h->text);
    header->text = malloc(header->l_text+1);
    memcpy(header->text, ks_str(&h->text), header->l_text);
    header->text[header->l_text] = 0;

    header->n_targets = h->nref;
    header->target_name = (char **)calloc(header->n_targets,
					  sizeof(char *));
    header->target_len = (uint32_t *)calloc(header->n_targets, 4);

    for (i = 0; i < h->nref; i++) {
	header->target_name[i] = strdup(h->ref[i].name);
	header->target_len[i] = h->ref[i].len;
    }

    return header;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x14084
movq %rax, %r14
movq (%rbx), %r12
movl %r12d, 0x8(%rax)
leal 0x1(%r12), %edi
callq 0x4700
movq %rax, %r15
movq %rax, 0x28(%r14)
movq 0x10(%rbx), %rsi
movl %r12d, %r12d
movq %rax, %rdi
movq %r12, %rdx
callq 0x4420
movb $0x0, (%r15,%r12)
movslq 0x38(%rbx), %r15
movl %r15d, (%r14)
movl $0x8, %esi
movq %r15, %rdi
callq 0x4360
movq %rax, 0x20(%r14)
movl $0x4, %esi
movq %r15, %rdi
callq 0x4360
movq %rax, 0x10(%r14)
testq %r15, %r15
jle 0x398ff
movq 0x40(%rbx), %rax
xorl %r15d, %r15d
xorl %r12d, %r12d
movq (%rax,%r15,8), %rdi
callq 0x49c0
movq 0x20(%r14), %rcx
movq %rax, (%rcx,%r15,2)
movq 0x40(%rbx), %rax
movl 0x8(%rax,%r15,8), %ecx
movq 0x10(%r14), %rdx
movl %ecx, (%rdx,%r15)
incq %r12
movslq 0x38(%rbx), %rcx
addq $0x4, %r15
cmpq %rcx, %r12
jl 0x398cd
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x39954
movl %ebp, %eax
incl (%rbx,%rax,4)
jmp 0x39acc
movq 0x1000(%rbx), %r14
testq %r14, %r14
jne 0x39979
movl $0x1, %edi
movl $0x28, %esi
callq 0x4360
movq %rax, %r14
movq %rax, 0x1000(%rbx)
movl 0x8(%r14), %eax
cmpl 0xc(%r14), %eax
jb 0x399a6
movl (%r14), %esi
movl 0x4(%r14), %eax
addl %eax, %eax
cmpl %eax, %esi
jbe 0x39994
decl %esi
jmp 0x39996
incl %esi
movq %r14, %rdi
callq 0x39e4f
testl %eax, %eax
js 0x39acc
movl (%r14), %esi
leal -0x1(%rsi), %r8d
movl %r8d, %edi
andl %ebp, %edi
movq 0x10(%r14), %rax
movl %edi, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %edx
leal (%rdi,%rdi), %ecx
shrl %cl, %edx
testb $0x2, %dl
je 0x399cc
movl %edi, %edx
jmp 0x39a48
movl $0x1, %r10d
movl %edi, %r9d
movl %esi, %edx
movl %r9d, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %r11d
leal (%r9,%r9), %ecx
andl $0x1e, %ecx
movl %r11d, %r15d
shrl %cl, %r15d
testb $0x2, %r15b
jne 0x39a28
testb $0x1, %r15b
jne 0x39a07
movq 0x18(%r14), %r15
movl %r9d, %r12d
cmpl %ebp, (%r15,%r12,4)
je 0x39a28
btl %ecx, %r11d
cmovbl %r9d, %edx
addl %r10d, %r9d
andl %r8d, %r9d
incl %r10d
cmpl %edi, %r9d
jne 0x399d7
movb $0x1, %cl
movl %esi, %r8d
cmpl %esi, %edx
je 0x39a38
jmp 0x39a48
shrl %cl, %r11d
testb $0x2, %r11b
sete %cl
movl %edx, %r8d
movl %r9d, %edi
cmpl %esi, %r8d
cmovel %edi, %r8d
testb %cl, %cl
cmovnel %edi, %r8d
movl %r8d, %edx
movl %edx, %esi
shrl $0x4, %esi
movl (%rax,%rsi,4), %edi
leal (%rdx,%rdx), %ecx
andl $0x1e, %ecx
shrl %cl, %edi
testb $0x2, %dil
jne 0x39a76
testb $0x1, %dil
jne 0x39aa1
movq 0x1000(%rbx), %rax
movq 0x20(%rax), %rax
movl %edx, %ecx
incl (%rax,%rcx,4)
jmp 0x39acc
movq 0x18(%r14), %rdi
movl %edx, %edx
movl %ebp, (%rdi,%rdx,4)
movl $0x3, %edi
shll %cl, %edi
notl %edi
andl %edi, (%rax,%rsi,4)
movq 0x4(%r14), %xmm0
pcmpeqd %xmm1, %xmm1
psubd %xmm1, %xmm0
movq %xmm0, 0x4(%r14)
jmp 0x39aba
movq 0x18(%r14), %rdi
movl %edx, %edx
movl %ebp, (%rdi,%rdx,4)
movl $0x3, %edi
shll %cl, %edi
notl %edi
andl %edi, (%rax,%rsi,4)
incl 0x4(%r14)
movq 0x1000(%rbx), %rax
movq 0x20(%rax), %rax
movl $0x1, (%rax,%rdx,4)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x39b1f
movl %esi, %eax
movl (%rdx,%rax,4), %ecx
leal -0x1(%rcx), %esi
movl %esi, (%rdx,%rax,4)
testl %ecx, %ecx
jg 0x39bf5
leaq 0x19979(%rip), %rdi     # 0x53480
leaq 0x19986(%rip), %rsi     # 0x53494
leaq 0x19991(%rip), %rcx     # 0x534a6
movl $0x52, %edx
callq 0x4350
movq 0x1000(%rdx), %rdi
addq $0x1008, %rdx           # imm = 0x1008
testq %rdi, %rdi
je 0x39beb
movl (%rdi), %r8d
testl %r8d, %r8d
je 0x39b9c
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 0x39b90
testb $0x1, %r14b
jne 0x39b82
movq 0x18(%rdi), %r14
movl %eax, %r15d
cmpl %esi, (%r14,%r15,4)
je 0x39b90
addl %ebx, %eax
andl %r9d, %eax
incl %ebx
cmpl %r10d, %eax
jne 0x39b54
jmp 0x39bdf
shrl %cl, %ebp
testb $0x3, %bpl
cmovnel %r8d, %eax
jmp 0x39b9e
xorl %eax, %eax
cmpl %r8d, %eax
je 0x39bdf
movq 0x20(%rdi), %rcx
movl %eax, %edx
decl (%rcx,%rdx,4)
jne 0x39bf5
cmpl %eax, (%rdi)
je 0x39bf5
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 0x39bf5
btsl %eax, %r8d
movl %r8d, (%rdx,%rsi,4)
decl 0x4(%rdi)
jmp 0x39bf5
movl %esi, %edi
movq %rdx, %rsi
callq 0x5911
jmp 0x39bf5
movl %esi, %edi
movq %rdx, %rsi
callq 0x5933
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x283fd(%rip), %rax     # 0x62570
testq %rax, %rax
je 0x3a179
retq
pushq %rax
movl $0x38, %edi
callq 0x4700
testq %rax, %rax
je 0x3a1c0
movabsq $0x300000000, %rcx      # imm = 0x300000000
movq %rcx, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movups %xmm0, 0x20(%rax)
movq $0x0, 0x30(%rax)
movq %rax, 0x283bf(%rip)     # 0x62570
movq 0x27e08(%rip), %rcx     # 0x61fc0
movq (%rcx), %rcx
movq %rcx, (%rax)
jmp 0x3a1cd
movq $0x0, 0x283a5(%rip) # 0x62570
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3a215
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)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2835c(%rip), %rax     # 0x62580
testq %rax, %rax
je 0x3a22a
retq
pushq %rax
movl $0x38, %edi
callq 0x4700
testq %rax, %rax
je 0x3a271
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movl $0x0, 0x18(%rax)
movups %xmm0, 0x20(%rax)
movq $0x0, 0x30(%rax)
movq %rax, 0x28325(%rip)     # 0x62580
movq 0x27d2e(%rip), %rcx     # 0x61f90
movq (%rcx), %rcx
movq %rcx, (%rax)
movl $0x2, 0x1c(%rax)
jmp 0x3a27e
movq $0x0, 0x28304(%rip) # 0x62580
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x28306(%rip), %rax     # 0x62590
testq %rax, %rax
je 0x3a290
retq
pushq %rax
movl $0x38, %edi
callq 0x4700
testq %rax, %rax
je 0x3a2d7
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movl $0x0, 0x18(%rax)
movups %xmm0, 0x20(%rax)
movq $0x0, 0x30(%rax)
movq %rax, 0x282cf(%rip)     # 0x62590
movq 0x27d00(%rip), %rcx     # 0x61fc8
movq (%rcx), %rcx
movq %rcx, (%rax)
movl $0x2, 0x1c(%rax)
jmp 0x3a2e4
movq $0x0, 0x282ae(%rip) # 0x62590
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3a303
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_O3/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 $0xa8, %rsp
movq %rdx, 0x10(%rsp)
movq %rdi, %r14
movb $0x1, %al
movl %eax, 0xc(%rsp)
movl $0x2000, %ebx           # imm = 0x2000
testq %rsi, %rsi
je 0x3a596
leaq 0x18(%rsp), %r15
movq %rsi, %rdi
movq %r15, %rsi
callq 0x44a0
movq 0x30(%r15), %r15
cmpl $-0x1, %eax
je 0x3a59b
movq %r15, %rdi
callq 0x4700
movq %rax, %r12
movslq %r15d, %rbx
movl $0x0, 0xc(%rsp)
movq %r15, %r13
jmp 0x3a5a1
xorl %r12d, %r12d
jmp 0x3a59e
xorl %r12d, %r12d
xorl %r13d, %r13d
xorl %ebp, %ebp
leaq (%rbx,%rbp), %rax
cmpq %r13, %rax
jbe 0x3a5bd
addq %rbx, %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x48d0
movq %rax, %r12
leaq (%r12,%rbp), %rdi
movq %r13, %rdx
subq %rbp, %rdx
movl $0x1, %esi
movq %r14, %rcx
callq 0x47d0
addq %rax, %rbp
movq %r14, %rdi
callq 0x4830
cmpq %r15, %rbp
setb %cl
testl %eax, %eax
jne 0x3a5ef
orb 0xc(%rsp), %cl
jne 0x3a5a3
movq 0x10(%rsp), %rax
movq %rbp, (%rax)
movq %r12, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3a778
movq %rdi, %rbx
cmpq %rdi, 0x27efa(%rip)     # 0x62580
je 0x3a691
cmpq %rbx, 0x27f01(%rip)     # 0x62590
jne 0x3a6df
movq 0x20(%rbx), %r14
movq 0x30(%rbx), %rdi
subq %rdi, %r14
jbe 0x3a6cd
addq 0x8(%rbx), %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x4a30
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq %r14, %rax
jb 0x3a77a
movq (%rbx), %rdi
callq 0x45f0
testl %eax, %eax
jne 0x3a77a
leaq 0x20(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movl 0x1c(%rbx), %edx
testb $0x2, %dl
je 0x3a778
movq 0x30(%rbx), %rax
movq (%rbx), %rcx
movq 0x20(%rbx), %r14
subq %rax, %r14
jbe 0x3a741
testb $0x20, %dl
jne 0x3a714
movq %rcx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x45b0
movq (%rbx), %rcx
movq 0x30(%rbx), %rax
addq 0x8(%rbx), %rax
movl $0x1, %esi
movq %rax, %rdi
movq %r14, %rdx
callq 0x4a30
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq %r14, %rax
jb 0x3a77a
movq (%rbx), %rdi
callq 0x45f0
testl %eax, %eax
jne 0x3a77a
movq (%rbx), %rcx
movq %rcx, %rdi
callq 0x4030
cmpq $-0x1, %rax
je 0x3a770
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 0x3a781
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 0x3a77a
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3a7ab
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x3a79f
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_O3/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 0x3a7e4
movq %rdi, %r14
callq 0x3a66c
testb $0x40, 0x1c(%r14)
jne 0x3a7e4
movq (%r14), %rdi
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x3a7e4
callq 0x4530
movq $0x0, (%r14)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3a816
movq %rdi, %r14
movq 0x8(%rdi), %rbx
testq %rsi, %rsi
je 0x3a80a
movq 0x20(%r14), %rax
movq %rax, (%rsi)
movq %r14, %rdi
callq 0x3a7b1
testl %eax, %eax
je 0x3a81a
xorl %ebx, %ebx
jmp 0x3a82a
movq $0x0, 0x8(%r14)
movq %r14, %rdi
callq 0x3a788
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3a85f
cmpl $0x1, %edx
je 0x3a859
testl %edx, %edx
je 0x3a863
pushq %rax
callq 0x4070
movl $0x16, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
retq
addq %rsi, 0x28(%rdi)
jmp 0x3a867
addq 0x20(%rdi), %rsi
movq %rsi, 0x28(%rdi)
movl $0x0, 0x18(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/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, 0x27cab(%rip)     # 0x62570
jne 0x3a8cc
callq 0x3a927
movq 0x20(%r14), %rbp
movq 0x28(%r14), %rsi
subq %rsi, %rbp
jbe 0x3a916
imulq %rbx, %r15
cmpq %rbp, %r15
movq %rbp, %r13
cmovbq %r15, %r13
testq %rbx, %rbx
je 0x3a916
addq 0x8(%r14), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x4420
addq %r13, 0x28(%r14)
cmpq %rbp, %r15
jbe 0x3a90c
movl $0x1, 0x18(%r14)
movq %r13, %rax
xorl %edx, %edx
divq %rbx
jmp 0x3a918
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_O3/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, 0x27c6a(%rip)     # 0x62598
jne 0x3a96a
pushq %rax
movq 0x27688(%rip), %rax     # 0x61fc0
movq (%rax), %rdi
movq 0x27c2e(%rip), %rdx     # 0x62570
addq $0x20, %rdx
xorl %esi, %esi
callq 0x3a539
movq 0x27c1c(%rip), %rcx     # 0x62570
movq %rax, 0x8(%rcx)
movl $0x1, 0x1c(%rcx)
movb $0x1, 0x27c32(%rip)     # 0x62598
addq $0x8, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3a984
xorl %ebx, %ebx
jmp 0x3aa18
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
testb $0x4, %al
jne 0x3a99a
movq 0x28(%r14), %rdi
jmp 0x3a9a2
movq 0x20(%r14), %rdi
movq %rdi, 0x28(%r14)
imulq %rbx, %r15
leaq (%rdi,%r15), %rax
movq 0x10(%r14), %r13
cmpq %r13, %rax
jbe 0x3a9ed
movq 0x8(%r14), %rax
movl $0x400, %ebp            # imm = 0x400
testq %r13, %r13
leaq (%r13,%r13), %r13
cmoveq %rbp, %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x48d0
testq %rax, %rax
je 0x3a97d
movq %r13, 0x10(%r14)
movq %rax, 0x8(%r14)
movq 0x28(%r14), %rdi
leaq (%rdi,%r15), %rcx
cmpq %r13, %rcx
ja 0x3a9bc
cmpq 0x30(%r14), %rdi
jae 0x3a9f7
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 0x3aa18
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_O3/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, 0x27b3b(%rip)     # 0x62570
jne 0x3aa3c
callq 0x3a927
movq 0x28(%rbx), %rax
cmpq 0x20(%rbx), %rax
jae 0x3aa58
movq 0x8(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x28(%rbx)
movzbl (%rcx,%rax), %eax
jmp 0x3aa64
movl $0x1, 0x18(%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/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, 0x27ace(%rip)     # 0x62570
jne 0x3aaa9
callq 0x3a927
movb $0x0, (%rbx)
cmpl $0x2, %ebp
movl $0x1, %eax
cmovgel %ebp, %eax
decl %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x3aaf0
movq 0x28(%r14), %rdx
cmpq 0x20(%r14), %rdx
jae 0x3aae6
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 0x3aabb
jmp 0x3aaee
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_O3/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 0x3ab6f
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 0x4188c
movslq %eax, %r13
movq 0x28(%rbx), %rax
addq %r13, %rax
movq 0x10(%rbx), %r15
cmpq %r15, %rax
jbe 0x3abe6
movq 0x8(%rbx), %rax
movl $0x400, %ebp            # imm = 0x400
testq %r15, %r15
leaq (%r15,%r15), %r15
cmoveq %rbp, %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x48d0
testq %rax, %rax
je 0x3ac58
movq %r15, 0x10(%rbx)
movq %rax, 0x8(%rbx)
movq 0x28(%rbx), %rcx
addq %r13, %rcx
cmpq %r15, %rcx
ja 0x3abb3
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 0x3ac30
movl %ebp, %eax
addq 0x28(%rbx), %rax
movq %rax, 0x28(%rbx)
cmpq %rax, 0x20(%rbx)
jae 0x3ac30
movq %rax, 0x20(%rbx)
movq (%rbx), %rax
movq 0x2738e(%rip), %rcx     # 0x61fc8
cmpq (%rcx), %rax
je 0x3ac43
movl %ebp, %eax
jmp 0x3ac5d
movq %rbx, %rdi
callq 0x3a66c
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x3ac5d
jmp 0x3ac3f
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_O3/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 0x3acad
movl $0x1, %ecx
movq 0x8(%rdi), %rdx
movb (%rdx,%rcx), %sil
cmpb $0xa, %sil
jne 0x3ac9d
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 0x3ac80
movq %rax, 0x20(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rdi)
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3af83
movq %rsp, %r13
movq %r13, %r15
cmpb $0x25, %al
jne 0x3af66
cmpb $0x73, 0x1(%rbx)
jne 0x3af66
incq %rbx
movq %r15, %rdi
movq %r14, %rsi
callq 0x44e0
movq %r15, %rdi
callq 0x4230
addq %rax, %r15
jmp 0x3af6c
movb %al, (%r15)
incq %r15
movb 0x1(%rbx), %al
testb %al, %al
je 0x3af86
incq %rbx
movq %r15, %rcx
subq %r13, %rcx
cmpq %r12, %rcx
jl 0x3af41
jmp 0x3af86
movq %rsp, %r15
movb $0x0, (%r15)
leaq 0x169b0(%rip), %rsi     # 0x51941
movq %rsp, %rdi
callq 0x477e9
testq %rax, %rax
je 0x3b045
movq %rax, %r14
xorl %r15d, %r15d
xorl %edi, %edi
xorl %esi, %esi
callq 0x3a1d2
testq %rax, %rax
je 0x3b048
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 0x3b016
movl $0x2000, %edx           # imm = 0x2000
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rcx
callq 0x4716b
movq %rax, %r12
testl %r12d, %r12d
jle 0x3b05d
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
movl $0x1, %edx
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rcx
callq 0x3a96b
testq %rax, %rax
jne 0x3afc0
movq %r14, %rdi
callq 0x474b5
movq %rbx, %rdi
callq 0x3a788
xorl %r15d, %r15d
movq %r15, %rax
addq $0x2008, %rsp           # imm = 0x2008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x4745b
testl %r12d, %r12d
jne 0x3b03d
testl %eax, %eax
js 0x3b03d
movq %rbx, %rdi
callq 0x3a876
movq %rbx, %r15
jmp 0x3b048
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3b30d
movq %rax, %rbx
movq %rax, %rdi
callq 0x3a0f0
testl %eax, %eax
je 0x3b1fd
leaq 0x183be(%rip), %rsi     # 0x535ae
movq %rbx, %rdi
callq 0x3a60c
movq %rax, %r14
jmp 0x3b200
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_O3/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, %rbx
testq %rsi, %rsi
jne 0x3b235
leaq 0x18374(%rip), %rdi     # 0x535a1
callq 0x4650
movq %rax, %rsi
movq %rsi, %rdi
callq 0x3acbc
testq %rax, %rax
je 0x3b2f8
movq %rax, %r14
movb (%rax), %al
testb %al, %al
je 0x3b2eb
leaq 0x1834f(%rip), %r15     # 0x535a9
leaq 0x18331(%rip), %r12     # 0x53592
movq %r14, %rbp
xorl %r13d, %r13d
cmpb $0x7c, %al
sete %r13b
addq %rbp, %r13
movl $0x4, %edx
movq %r13, %rdi
movq %r15, %rsi
callq 0x4280
testl %eax, %eax
je 0x3b2d2
movl $0x5, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x4280
testl %eax, %eax
je 0x3b2d2
movl $0x4, %edx
movq %r13, %rdi
leaq 0x182f5(%rip), %rsi     # 0x5359c
callq 0x4280
testl %eax, %eax
je 0x3b2d2
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3b30d
movq %rax, %r13
movq %rax, %rdi
callq 0x3a0f0
testl %eax, %eax
jne 0x3b2ee
movq %r13, %rdi
callq 0x4610
movq %rbp, %rdi
callq 0x4230
addq %rax, %rbp
incq %rbp
movb (%rbp), %al
testb %al, %al
jne 0x3b264
xorl %r13d, %r13d
movq %r14, %rdi
callq 0x4610
jmp 0x3b2fb
xorl %r13d, %r13d
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3f094
movb (%rdx), %dil
xorl %esi, %esi
movq %r8, %rax
movq 0x8(%r8), %r8
cmpb %dil, (%r8)
jne 0x3f087
movb 0x1(%r8), %r8b
cmpb 0x1(%rdx), %r8b
je 0x3f09e
movq (%rax), %r8
movq %rax, %rsi
testq %r8, %r8
jne 0x3f071
jmp 0x3f096
xorl %eax, %eax
movq %rax, %rsi
movl $0x0, %eax
testq %rcx, %rcx
je 0x3f0a6
movq %rsi, (%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rdi, %r14
leaq 0x20(%rsp), %rdi
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x3f10b
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 %rdi, 0x10(%rsp)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
addq $0x10, %rsi
movq %rsi, 0x18(%rsp)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl (%rsp), %eax
cmpq $0x28, %rax
ja 0x3f152
movq %rax, %rcx
addq 0x10(%rsp), %rcx
addl $0x8, %eax
movl %eax, (%rsp)
jmp 0x3f160
movq 0x8(%rsp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsp)
movq (%rcx), %r12
testq %r12, %r12
je 0x3f232
cmpl $0x28, %eax
ja 0x3f180
movl %eax, %ecx
addq 0x10(%rsp), %rcx
addl $0x8, %eax
movl %eax, (%rsp)
jmp 0x3f18e
movq 0x8(%rsp), %rcx
leaq 0x8(%rcx), %rax
movq %rax, 0x8(%rsp)
movq (%rcx), %r13
movq 0x18(%rsp), %rax
movq (%rax), %rcx
testq %rcx, %rcx
je 0x3f1c1
movb (%r12), %al
movq %rcx, %r15
movq 0x8(%rcx), %rcx
cmpb %al, (%rcx)
jne 0x3f1b7
movb 0x1(%rcx), %cl
cmpb 0x1(%r12), %cl
je 0x3f1e8
movq (%r15), %rcx
testq %rcx, %rcx
jne 0x3f1a2
jmp 0x3f1c4
xorl %r15d, %r15d
movq 0x30(%r14), %rdi
callq 0x4d08e
testq %rax, %rax
je 0x3f236
testq %r15, %r15
cmoveq 0x18(%rsp), %r15
movq %rax, (%r15)
movq $0x0, (%rax)
movq %rax, %r15
movq (%r14), %rbx
movq %r14, %rdi
leaq 0x1484a(%rip), %rsi     # 0x53a3f
movq %r12, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x41f38
testl %eax, %eax
js 0x3f23b
movq (%r14), %rax
movslq %ebx, %rsi
subq %rbx, %rax
movl %eax, 0x10(%r15)
movq 0x20(%r14), %rdi
addq 0x10(%r14), %rsi
movslq %eax, %rdx
callq 0x40f39
movq %rax, 0x8(%r15)
testq %rax, %rax
jne 0x3f139
jmp 0x3f23b
xorl %ebp, %ebp
jmp 0x3f23b
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl $0x1, %edi
movl $0x4a0, %esi            # imm = 0x4A0
callq 0x4360
testq %rax, %rax
je 0x3f908
movq %rax, %rbx
movl $0x1, %edi
movl $0x28, %esi
callq 0x4360
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x3f8f2
movq %rax, %r14
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x494(%rbx)
movl $0x1, %edi
movl $0x28, %esi
callq 0x4360
movq %rax, 0x48(%rbx)
testq %rax, %rax
je 0x3f8ab
movl $0x1, %edi
movl $0x28, %esi
callq 0x4360
movq %rax, 0x60(%rbx)
testq %rax, %rax
je 0x3f8ab
movl $0x1, %edi
movl $0x28, %esi
callq 0x4360
movq %rax, 0x80(%rbx)
testq %rax, %rax
je 0x3f8ab
movl $0x18, %edi
callq 0x4cfd0
movq %rax, 0x30(%rbx)
testq %rax, %rax
je 0x3f8ab
movq %rax, %r12
movl $0x20, %edi
callq 0x4cfd0
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x3f919
movq %rax, %r15
movl $0x2000, %edi           # imm = 0x2000
callq 0x40df4
movq %rax, 0x20(%rbx)
testq %rax, %rax
jne 0x3f90a
jmp 0x3f8b1
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x18(%r14), %rdi
callq 0x4610
movq 0x10(%r14), %rdi
callq 0x4610
movq 0x20(%r14), %rdi
callq 0x4610
movq %r14, %rdi
callq 0x4610
testq %r12, %r12
je 0x3f8e5
movq %r12, %rdi
callq 0x4d049
movq 0x28(%rbx), %r15
testq %r15, %r15
je 0x3f8f2
movq %r15, %rdi
callq 0x4d049
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x3f900
callq 0x40e23
movq %rbx, %rdi
callq 0x4610
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
xorl %r15d, %r15d
jmp 0x3f8b1
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3f7c8
testq %rax, %rax
je 0x3f9cf
movq %rax, %rbx
testq %r14, %r14
je 0x3fabc
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x3d282
cmpl $-0x1, %eax
je 0x3f9c7
movq 0x18(%rbx), %rax
movl (%rax), %edx
testl %edx, %edx
je 0x3f9e2
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 0x3f9d6
testb $0x1, %bpl
jne 0x3f9af
movq 0x18(%rax), %r14
movl %esi, %r15d
cmpl $0x4844, (%r14,%r15,4)  # imm = 0x4844
je 0x3f9d6
addl %r10d, %esi
andl %edi, %esi
incl %r10d
cmpl %r8d, %esi
jne 0x3f97e
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
jmp 0x3faad
movq %rbx, %rdi
callq 0x3face
xorl %ebx, %ebx
jmp 0x3fabc
shrl %cl, %r11d
testb $0x3, %r11b
cmovnel %edx, %esi
jmp 0x3f9e4
xorl %esi, %esi
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
cmpl %edx, %esi
je 0x3faad
movq 0x20(%rax), %rax
movl %esi, %ecx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %r12
testq %r12, %r12
je 0x3faad
leaq 0x14067(%rip), %r14     # 0x53a77
leaq 0x14069(%rip), %r15     # 0x53a80
movq 0x8(%r12), %rbp
cmpb $0x53, (%rbp)
jne 0x3faa0
cmpb $0x4f, 0x1(%rbp)
jne 0x3faa0
addq $0x3, %rbp
movq %rbp, %rdi
movq %r14, %rsi
callq 0x4750
testl %eax, %eax
je 0x3fa8d
movq %rbp, %rdi
movq %r15, %rsi
callq 0x4750
testl %eax, %eax
je 0x3fa92
movq %rbp, %rdi
leaq 0x14036(%rip), %rsi     # 0x53a8a
callq 0x4750
testl %eax, %eax
je 0x3fa9a
movq %rbp, %rdi
leaq 0x1464a(%rip), %rsi     # 0x540b1
callq 0x4750
testl %eax, %eax
je 0x3faa0
movq 0x22551(%rip), %rax     # 0x61fc8
movq (%rax), %rdi
leaq 0x14014(%rip), %rsi     # 0x53a95
movq %rbp, %rdx
xorl %eax, %eax
callq 0x4770
jmp 0x3faa0
xorl %r13d, %r13d
jmp 0x3faa0
movl $0x1, %r13d
jmp 0x3faa0
movl $0x2, %r13d
movq (%r12), %r12
testq %r12, %r12
jne 0x3fa17
movl %r13d, 0x90(%rbx)
movq %rbx, %rdi
callq 0x3fcc7
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_O3/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 0x4015e
movq %rsi, %r12
movq %rax, 0x10(%rsp)
leal -0x1(%rax), %r8d
movsbl (%rsi), %r13d
testl %r13d, %r13d
movq %rdi, 0x18(%rsp)
je 0x40166
movb 0x1(%r12), %al
testb %al, %al
je 0x40169
leaq 0x2(%r12), %rcx
movl %r13d, %edx
shll $0x5, %edx
subl %r13d, %edx
movsbl %al, %r13d
addl %edx, %r13d
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x40143
jmp 0x40169
xorl %r15d, %r15d
jmp 0x401ef
xorl %r13d, %r13d
andl %r8d, %r13d
movq (%rsp), %rax
movq 0x10(%rax), %rdx
movl $0x1, %r14d
movl %r13d, %r15d
movl %r8d, 0xc(%rsp)
movq %rdx, 0x20(%rsp)
movl %r15d, %eax
shrl $0x4, %eax
movl (%rdx,%rax,4), %ebx
leal (%r15,%r15), %ebp
andl $0x1e, %ebp
movl %ebx, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x401da
testb $0x1, %al
jne 0x401ca
movq (%rsp), %rax
movq 0x18(%rax), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rdi
movq %r12, %rsi
callq 0x4750
movq 0x20(%rsp), %rdx
movl 0xc(%rsp), %r8d
testl %eax, %eax
je 0x401da
addl %r14d, %r15d
andl %r8d, %r15d
incl %r14d
cmpl %r13d, %r15d
jne 0x40187
jmp 0x401f4
movl %ebp, %ecx
shrl %cl, %ebx
testb $0x3, %bl
movq 0x10(%rsp), %rax
cmovnel %eax, %r15d
movq 0x18(%rsp), %rdi
cmpl %eax, %r15d
jne 0x401f8
xorl %eax, %eax
jmp 0x4020f
movq (%rsp), %rax
movq 0x20(%rax), %rax
movl %r15d, %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
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_add_PG
int sam_hdr_add_PG(SAM_hdr *sh, const char *name, ...) {
    va_list args;

    if (sh->npg_end) {
	/* Copy ends array to avoid us looping while modifying it */
	int *end = malloc(sh->npg_end * sizeof(int));
	int i, nends = sh->npg_end;

	if (!end)
	    return -1;

	memcpy(end, sh->pg_end, nends * sizeof(*end));

	for (i = 0; i < nends; i++) {
	    va_start(args, name);
	    if (-1 == sam_hdr_vadd(sh, "PG", args,
				   "ID", sam_hdr_PG_ID(sh, name),
				   "PN", name,
				   "PP", sh->pg[end[i]].name,
				   NULL)) {
		free(end);
		return  -1;
	    }
	    va_end(args);
	}

	free(end);
    } else {
	va_start(args, name);
	if (-1 == sam_hdr_vadd(sh, "PG", args,
			       "ID", sam_hdr_PG_ID(sh, name),
			       "PN", name,
			       NULL))
	    return -1;
	va_end(args);
    }

    //sam_hdr_dump(sh);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x404c3
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)
movslq 0x6c(%rdi), %r13
testq %r13, %r13
je 0x405a3
leaq (,%r13,4), %r12
movq %r12, %rdi
callq 0x4700
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x40615
movq %rax, %r15
movq 0x88(%r14), %rsi
movq %rax, %rdi
movq %r12, %rdx
callq 0x4420
testl %r13d, %r13d
jle 0x40597
movq %rsp, %r12
xorl %ebp, %ebp
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4021e
movq 0x78(%r14), %r10
movslq (%r15,%rbp,4), %rcx
leaq (%rcx,%rcx,4), %r11
movq %r14, %rdi
leaq 0x13500(%rip), %rsi     # 0x53a57
movq %r12, %rdx
leaq 0x129e5(%rip), %rcx     # 0x52f46
movq %rax, %r8
leaq 0x134ef(%rip), %r9      # 0x53a5a
xorl %eax, %eax
pushq $0x0
pushq (%r10,%r11,8)
leaq 0x134e3(%rip), %r10     # 0x53a5d
pushq %r10
pushq %rbx
callq 0x3df39
addq $0x20, %rsp
cmpl $-0x1, %eax
je 0x40608
incq %rbp
cmpq %rbp, %r13
jne 0x40511
movq %r15, %rdi
callq 0x4610
xorl %ebp, %ebp
jmp 0x40615
leaq 0x20(%rsp), %rax
movq %rsp, %r15
movq %rax, 0x10(%r15)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%r15)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%r15)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4021e
leaq 0x1347d(%rip), %rsi     # 0x53a57
leaq 0x12965(%rip), %rcx     # 0x52f46
leaq 0x13472(%rip), %r9      # 0x53a5a
xorl %ebp, %ebp
movq %r14, %rdi
movq %r15, %rdx
movq %rax, %r8
xorl %eax, %eax
pushq $0x0
pushq %rbx
callq 0x3df39
addq $0x10, %rsp
cmpl $-0x1, %eax
jne 0x40615
jmp 0x40610
movq %r15, %rdi
callq 0x4610
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: stringify_argv
char *stringify_argv(int argc, char *argv[]) {
    char *str, *cp;
    size_t nbytes = 1;
    int i, j;

    /* Allocate */
    for (i = 0; i < argc; i++) {
	nbytes += strlen(argv[i]) + 1;
    }
    if (!(str = malloc(nbytes)))
	return NULL;

    /* Copy */
    cp = str;
    for (i = 0; i < argc; i++) {
	j = 0;
	while (argv[i][j]) {
	    if (argv[i][j] == '\t')
		*cp++ = ' ';
	    else
		*cp++ = argv[i][j];
	    j++;
	}
	*cp++ = ' ';
    }
    *cp++ = 0;

    return str;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testl %edi, %edi
jle 0x406b3
movq %rsi, %rbx
movl %edi, %ebp
movl %edi, %r15d
movl $0x1, %r14d
xorl %r12d, %r12d
movq (%rbx,%r12,8), %rdi
callq 0x4230
addq %rax, %r14
incq %r14
incq %r12
cmpq %r12, %r15
jne 0x40646
movq %r14, %rdi
callq 0x4700
testq %rax, %rax
je 0x406c5
testl %ebp, %ebp
jle 0x406c9
xorl %edx, %edx
movq %rax, %rdi
movq %rdi, %rcx
movl $0x1, %esi
movq (%rbx,%rdx,8), %rdi
movzbl -0x1(%rdi,%rsi), %edi
movb $0x20, %r8b
cmpl $0x9, %edi
je 0x40693
testl %edi, %edi
je 0x4069d
movl %edi, %r8d
movb %r8b, -0x1(%rcx,%rsi)
incq %rsi
jmp 0x4067b
leaq (%rcx,%rsi), %rdi
movb $0x20, -0x1(%rcx,%rsi)
incq %rdx
cmpq %r15, %rdx
jne 0x40673
addq %rsi, %rcx
jmp 0x406cc
movl $0x1, %edi
callq 0x4700
movq %rax, %rcx
testq %rax, %rax
jne 0x406cc
xorl %eax, %eax
jmp 0x406cf
movq %rax, %rcx
movb $0x0, (%rcx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq