LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/vcf.c
// Function: bcf_is_filtered
int bcf_is_filtered(bcf1_t *b)
{
	bcf_unpack(b, BCF_UN_FLT);
	if (b->d.n_flt == 0) return 0;
	if (b->d.n_flt == 1 && b->d.flt[0] == 0) return 0;
	return 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x2, %esi
callq 0xf0a4
movl 0x5c(%rbx), %eax
testl %eax, %eax
je 0x10f2e
cmpl $0x1, %eax
jne 0x10f29
movq 0x70(%rbx), %rax
cmpl $0x0, (%rax)
je 0x10f30
movl $0x1, %eax
popq %rbx
retq
xorl %eax, %eax
jmp 0x10f2e
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/vcf.c
// Function: bcfcpy
void bcfcpy(bcf1_t *dst, const bcf1_t *src)
{
	kstring_t ts = dst->shared, ti = dst->indiv;
	free(dst->d.id); free(dst->d.allele); free(dst->d.flt); free(dst->d.info); free(dst->d.fmt);
	*dst = *src;
	memset(&dst->d, 0, sizeof(bcf_dec_t));
	dst->unpacked = 0;
	dst->unpack_ptr = 0;
	ts.l = ti.l = 0;
	dst->shared = ts; dst->indiv = ti;
	kputsn(src->shared.s, src->shared.l, &dst->shared);
	kputsn(src->indiv.s, src->indiv.l, &dst->indiv);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movups 0x20(%rdi), %xmm0
movaps %xmm0, 0x10(%rsp)
movups 0x38(%rdi), %xmm0
movaps %xmm0, (%rsp)
movq 0x60(%rdi), %rdi
callq 0x2050
movq 0x68(%rbx), %rdi
callq 0x2050
movq 0x70(%rbx), %rdi
callq 0x2050
movq 0x78(%rbx), %rdi
callq 0x2050
movq 0x80(%rbx), %rdi
callq 0x2050
movl $0x98, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2280
xorl %eax, %eax
movq %rax, 0x90(%rbx)
movq %rax, 0x18(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%rbx)
movups %xmm0, 0x58(%rbx)
movups %xmm0, 0x68(%rbx)
movups %xmm0, 0x78(%rbx)
movl $0x0, 0x88(%rbx)
movaps 0x10(%rsp), %xmm0
movups %xmm0, 0x20(%rbx)
movq %rax, 0x30(%rbx)
movaps (%rsp), %xmm0
movups %xmm0, 0x38(%rbx)
movq 0x28(%r14), %r12
movslq 0x18(%r14), %r15
leaq 0x1(%r15), %rax
cmpq 0x20(%rbx), %rax
jb 0x1102c
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x20(%rbx)
movq 0x28(%rbx), %rdi
callq 0x2330
movq %rax, 0x28(%rbx)
movq 0x28(%rbx), %rdi
addq 0x18(%rbx), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x2280
addq 0x18(%rbx), %r15
movq %r15, 0x18(%rbx)
movq 0x28(%rbx), %rax
movb $0x0, (%rax,%r15)
movq 0x40(%r14), %r15
movslq 0x30(%r14), %r14
movq 0x30(%rbx), %rax
addq %r14, %rax
incq %rax
cmpq 0x38(%rbx), %rax
jb 0x110ad
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x38(%rbx)
movq 0x40(%rbx), %rdi
callq 0x2330
movq %rax, 0x40(%rbx)
movq 0x40(%rbx), %rdi
addq 0x30(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2280
addq 0x30(%rbx), %r14
movq %r14, 0x30(%rbx)
movq 0x40(%rbx), %rax
movb $0x0, (%rax,%r14)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/vcf.c
// Function: bcf_get_ref_alt1
void bcf_get_ref_alt1(const bcf1_t *b, int *l_ref, char **ref, int *l_alt, char **alt)
{
	int x, type;
	uint8_t *ptr;
	*ref = *alt = 0; *l_ref = *l_alt = 0;
	ptr = (uint8_t*)b->shared.s;
	x = bcf_dec_size(ptr, &ptr, &type); // size of ID
	ptr += x << bcf_type_shift[type]; // skip ID
	x = bcf_dec_size(ptr, &ptr, &type); // size of REF
	*l_ref = x, *ref = (char*)ptr;
	ptr += x << bcf_type_shift[type]; // skip REF
	*l_alt = bcf_dec_size(ptr, &ptr, &type); // size of ALT1
	*alt = (char*)ptr;
}

// Assembly:
movq %rcx, %rax
xorl %ecx, %ecx
movq %rcx, (%r8)
movq %rcx, (%rdx)
movl %ecx, (%rax)
movl %ecx, (%rsi)
movq 0x28(%rdi), %rdi
movzbl (%rdi), %r10d
movl %r10d, %ecx
andl $0xf, %ecx
cmpb $-0x11, %r10b
jbe 0x11120
movzbl 0x1(%rdi), %r9d
andl $0xf, %r9d
cmpl $0x2, %r9d
je 0x11129
cmpl $0x1, %r9d
jne 0x11134
movsbl 0x2(%rdi), %r10d
addq $0x3, %rdi
jmp 0x1113c
incq %rdi
shrl $0x4, %r10d
jmp 0x1113c
movswl 0x2(%rdi), %r10d
addq $0x4, %rdi
jmp 0x1113c
movl 0x2(%rdi), %r10d
addq $0x6, %rdi
leaq 0x1524d(%rip), %r9      # 0x26390
movb (%rcx,%r9), %cl
shll %cl, %r10d
movslq %r10d, %r11
movzbl (%rdi,%r11), %r10d
movl %r10d, %ecx
andl $0xf, %ecx
cmpb $-0x11, %r10b
jbe 0x11181
addq %r11, %rdi
movzbl 0x1(%rdi), %r10d
andl $0xf, %r10d
cmpl $0x2, %r10d
je 0x1118d
cmpl $0x1, %r10d
jne 0x11198
movsbl 0x2(%rdi), %r10d
addq $0x3, %rdi
jmp 0x111a0
addq %r11, %rdi
incq %rdi
shrl $0x4, %r10d
jmp 0x111a0
movswl 0x2(%rdi), %r10d
addq $0x4, %rdi
jmp 0x111a0
movl 0x2(%rdi), %r10d
addq $0x6, %rdi
movl %r10d, (%rsi)
movq %rdi, (%rdx)
movb (%rcx,%r9), %cl
shll %cl, %r10d
movslq %r10d, %rdx
movzbl (%rdi,%rdx), %ecx
cmpl $0xef, %ecx
jbe 0x111da
addq %rdx, %rdi
movzbl 0x1(%rdi), %ecx
andl $0xf, %ecx
cmpl $0x2, %ecx
je 0x111e5
cmpl $0x1, %ecx
jne 0x111ef
movsbl 0x2(%rdi), %ecx
addq $0x3, %rdi
jmp 0x111f6
addq %rdx, %rdi
incq %rdi
shrl $0x4, %ecx
jmp 0x111f6
movswl 0x2(%rdi), %ecx
addq $0x4, %rdi
jmp 0x111f6
movl 0x2(%rdi), %ecx
addq $0x6, %rdi
movl %ecx, (%rax)
movq %rdi, (%r8)
retq
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/vcf.c
// Function: bcfcmp
int bcfcmp(const bcf1_t *a, const bcf1_t *b) // FIXME: segfault when a or b is empty; also, what happens when there are not ALT alleles?
{
	int ret, l[2];
	char *ptr[2];
	if (a->rid != b->rid) return a->rid - b->rid;
	if (a->pos != b->pos) return a->pos - b->pos;
	if (a->rlen!=b->rlen) return a->rlen-b->rlen;
	ptr[0] = bcf_get_alt1(a, &l[0]);
	ptr[1] = bcf_get_alt1(b, &l[1]);
	ret = strncmp(ptr[0], ptr[1], l[0] < l[1]? l[0] : l[1]);
	if (ret != 0) return ret;
	return l[0] - l[1];
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl (%rdi), %ebx
subl (%rsi), %ebx
jne 0x112aa
movq %rsi, %r14
movl 0x4(%rdi), %ebx
subl 0x4(%rsi), %ebx
jne 0x112aa
movl 0x8(%rdi), %ebx
subl 0x8(%r14), %ebx
jne 0x112aa
leaq 0xc(%rsp), %rsi
leaq 0x18(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x10(%rsp), %rbx
movq %rbx, %r8
callq 0x110dd
movq (%rbx), %r15
leaq 0x24(%rsp), %rbx
leaq 0xc(%rsp), %rsi
leaq 0x18(%rsp), %rdx
leaq 0x10(%rsp), %r12
movq %r14, %rdi
movq %rbx, %rcx
movq %r12, %r8
callq 0x110dd
movq (%r12), %rsi
movl -0x4(%rbx), %eax
movl (%rbx), %ecx
movl %eax, %ebx
subl %ecx, %ebx
cmovll %eax, %ecx
movslq %ecx, %rdx
movq %r15, %rdi
callq 0x2090
testl %eax, %eax
cmovnel %eax, %ebx
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/vcf.c
// Function: bcfcpy_min
int bcfcpy_min(bcf1_t *b, const bcf1_t *b0, const char *alt2)
{
	int l_ref, l_alt;
	char *ref, *alt;
	bcf_get_ref_alt1(b0, &l_ref, &ref, &l_alt, &alt);
	b->rid = b0->rid, b->pos = b0->pos, b->rlen = b0->rlen;
	b->qual = 0, b->n_info = b->n_fmt = b->n_sample = 0;
	b->n_allele = alt2? 3 : 2;
	b->shared.l = b->indiv.l = 0;
	bcf_enc_size(&b->shared, 0, BCF_BT_CHAR); // empty ID
	bcf_enc_vchar(&b->shared, l_ref, ref); // copy REF
	bcf_enc_vchar(&b->shared, l_alt, alt); // copy the first ALT
	if (alt2) bcf_enc_vchar(&b->shared, strlen(alt2), alt2); // add <M> if requested
	bcf_enc_vint(&b->shared, 0, 0, -1); // empty FILTER
	b->unpacked = 0;
	return l_ref;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x4(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rsp, %rcx
leaq 0x8(%rsp), %r8
movq %r15, %rdi
callq 0x110dd
movl (%r15), %eax
movl %eax, (%rbx)
movl 0x4(%r15), %eax
movl %eax, 0x4(%rbx)
movl 0x8(%r15), %eax
movl %eax, 0x8(%rbx)
movl $0x0, 0xc(%rbx)
xorl %eax, %eax
testq %r14, %r14
setne %al
shll $0x10, %eax
orq $0x20000, %rax          # imm = 0x20000
movq %rax, 0x10(%rbx)
xorl %eax, %eax
movq %rax, 0x30(%rbx)
leaq 0x18(%rbx), %r15
movq %rax, 0x18(%rbx)
cmpq $0x1, 0x20(%rbx)
ja 0x11343
movq $0x2, 0x20(%rbx)
movq 0x28(%rbx), %rdi
movl $0x2, %esi
callq 0x2330
movq %rax, 0x28(%rbx)
movq 0x18(%rbx), %rax
movq 0x28(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x18(%rbx)
movb $0x7, (%rcx,%rax)
movq 0x18(%rbx), %rax
movq 0x28(%rbx), %rcx
movb $0x0, (%rcx,%rax)
movl 0x4(%rsp), %ebp
movq 0x10(%rsp), %rdx
movq %r15, %rdi
movl %ebp, %esi
callq 0xce10
movl (%rsp), %esi
movq 0x8(%rsp), %rdx
movq %r15, %rdi
callq 0xce10
testq %r14, %r14
je 0x113a0
movq %r14, %rdi
callq 0x2170
movq %r15, %rdi
movl %eax, %esi
movq %r14, %rdx
callq 0xce10
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0xc356
movl $0x0, 0x88(%rbx)
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/vcf.c
// Function: bcf_append_info_ints
int bcf_append_info_ints(const bcf_hdr_t *h, bcf1_t *b, const char *key, int n, const int32_t *vals)
{
	int id;
	id = bcf_id2int(h, BCF_DT_ID, key);
	if (id < 0) return -1;
	++b->n_info;
	bcf_enc_int1(&b->shared, id);
	bcf_enc_vint(&b->shared, n, vals, -1);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %r8, %r14
movl %ecx, %ebp
movq %rsi, %r15
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x106de
testl %eax, %eax
js 0x1140b
incw 0x10(%r15)
addq $0x18, %r15
movq %r15, %rdi
movl %eax, %esi
callq 0xc9cd
movq %r15, %rdi
movl %ebp, %esi
movq %r14, %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0xc356
jmp 0x11410
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/vcf.c
// Function: bcf_seekn
int bcf_seekn(BGZF *fp, const hts_idx_t *idx, int64_t r)
{
	int skip, ret = 0;
	skip = hts_idx_seekn_aux(fp, idx, r);
	if (skip > 0) {
		bcf1_t *b;
		b = bcf_init1();
		do {
			ret = bcf_read1(fp, b);
			--skip;
		} while (skip > 0 && ret >= 0);
		bcf_destroy1(b);
	}
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x93d8
testl %eax, %eax
jle 0x11468
movl %eax, %ebp
movl $0x1, %edi
movl $0x98, %esi
callq 0x2220
movq %rax, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xba58
movl %eax, %r15d
cmpl $0x2, %ebp
jl 0x1145e
decl %ebp
testl %r15d, %r15d
jns 0x11444
movq %r14, %rdi
callq 0xb9ea
jmp 0x1146b
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/atomic.c
// Function: bcf_atombuf_init
bcf_atombuf_t *bcf_atombuf_init(htsFile *in, int keep_flt)
{
	bcf_atombuf_t *buf;
	buf = (bcf_atombuf_t*)calloc(1, sizeof(bcf_atombuf_t));
	buf->keep_flt = !!keep_flt;
	buf->in = in;
	buf->h = vcf_hdr_read(buf->in);
	buf->b = bcf_init1();
	if (flt_read1(buf->in, buf->h, buf->b, buf->keep_flt) >= 0) {
		bcf_atomize(buf->h, buf->b, &buf->a);
		if (flt_read1(buf->in, buf->h, buf->b, buf->keep_flt) < 0)
			buf->no_vcf = 1;
	} else buf->no_vcf = 1;
	return buf;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %r14
movl $0x1, %edi
movl $0x30, %esi
callq 0x2220
movq %rax, %r13
xorl %ebx, %ebx
testl %ebp, %ebp
setne %bl
movw %bx, 0x26(%rax)
shll $0x10, %ebx
movq %r14, (%rax)
movq %r14, %rdi
callq 0xbc85
movq %rax, %r15
movq %rax, 0x28(%r13)
xorl %eax, %eax
callq 0xb9db
movq %rax, %r12
movq %r13, (%rsp)
movq %rax, 0x18(%r13)
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xee67
movl %eax, %r13d
testl %ebp, %ebp
jne 0x12fdc
testl %r13d, %r13d
js 0x12fdc
movq %r12, %rdi
callq 0x10f06
testl %eax, %eax
jne 0x12fb6
testl %r13d, %r13d
movq (%rsp), %r13
js 0x13039
movq %r13, %rdx
addq $0x8, %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x1204e
movq (%r13), %r14
movq 0x18(%r13), %r15
movq 0x28(%r13), %r12
movl 0x24(%r13), %ebx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0xee67
movl %eax, %ebp
cmpl $0xffff, %ebx           # imm = 0xFFFF
ja 0x1302f
testl %ebp, %ebp
js 0x1302f
movq %r15, %rdi
callq 0x10f06
testl %eax, %eax
jne 0x13007
testl %ebp, %ebp
jns 0x13040
andl $0xffff0000, %ebx       # imm = 0xFFFF0000
orl $0x1, %ebx
movl %ebx, 0x24(%r13)
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/atomic.c
// Function: bcf_atombuf_destroy
void bcf_atombuf_destroy(bcf_atombuf_t *buf)
{
	int i;
	for (i = 0; i < buf->a.m; ++i) {
		free(buf->a.a[i].ref.s);
		free(buf->a.a[i].gt);
	}
	free(buf->a.a);
	bcf_destroy1(buf->b);
	bcf_hdr_destroy(buf->h);
	free(buf);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0xc(%rdi)
jle 0x13092
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movq 0x10(%rax,%r14), %rdi
callq 0x2050
movq 0x10(%rbx), %rax
movq 0x38(%rax,%r14), %rdi
callq 0x2050
incq %r15
movslq 0xc(%rbx), %rax
addq $0x40, %r14
cmpq %rax, %r15
jl 0x13066
movq 0x10(%rbx), %rdi
callq 0x2050
movq 0x18(%rbx), %rdi
callq 0xb9ea
movq 0x28(%rbx), %rdi
callq 0xb84a
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/bedidx.c
// Function: bed_index_core
int *bed_index_core(int n, uint64_t *a, int *n_idx)
{
	int i, j, m, *idx;
	m = *n_idx = 0; idx = 0;
	for (i = 0; i < n; ++i) {
		int beg, end;
		beg = a[i]>>32 >> LIDX_SHIFT; end = ((uint32_t)a[i]) >> LIDX_SHIFT;
		if (m < end + 1) {
			int oldm = m;
			m = end + 1;
			kroundup32(m);
			idx = (int*)realloc(idx, m * sizeof(int));
			for (j = oldm; j < m; ++j) idx[j] = -1;
		}
		if (beg == end) {
			if (idx[beg] < 0) idx[beg] = i;
		} else {
			for (j = beg; j <= end; ++j)
				if (idx[j] < 0) idx[j] = i;
		}
		*n_idx = end + 1;
	}
	return idx;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl $0x0, (%rdx)
xorl %r8d, %r8d
testl %edi, %edi
jle 0x13c9b
movl %edi, %ecx
xorl %r13d, %r13d
xorl %r15d, %r15d
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq %rcx, (%rsp)
movq (%rsi,%r13,8), %r14
movl %r14d, %r12d
shrl $0xd, %r12d
cmpl %r12d, %r8d
jg 0x13c5b
movl %r14d, %eax
shrl $0xe, %eax
orl %r12d, %eax
movl %eax, %ecx
shrl $0x2, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x4, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x8, %ecx
orl %eax, %ecx
movl %ecx, %ebp
shrl $0x10, %ebp
orl %ecx, %ebp
leal 0x1(%rbp), %ebx
leaq 0x4(,%rbp,4), %rsi
movq %r15, %rdi
movq %r8, %r15
callq 0x2330
movq %r15, %rcx
movq %rax, %r15
subl %ecx, %ebp
jl 0x13c4a
movl %ecx, %eax
leaq (%r15,%rax,4), %rdi
leaq 0x4(,%rbp,4), %rdx
movl $0xff, %esi
callq 0x21e0
movl %ebx, %r8d
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rsi
movq (%rsp), %rcx
shrq $0x2d, %r14
leal 0x1(%r12), %eax
cmpl %r14d, %r12d
jne 0x13c76
cmpl $0x0, (%r15,%r14,4)
jns 0x13c8b
movl %r13d, (%r15,%r14,4)
jmp 0x13c8b
jb 0x13c8b
cmpl $0x0, (%r15,%r14,4)
jns 0x13c83
movl %r13d, (%r15,%r14,4)
incq %r14
cmpq %r14, %rax
jne 0x13c78
movl %eax, (%rdx)
incq %r13
cmpq %rcx, %r13
jne 0x13bdd
jmp 0x13c9e
xorl %r15d, %r15d
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/bedidx.c
// Function: bed_index
void bed_index(void *_h)
{
	reghash_t *h = (reghash_t*)_h;
	khint_t k;
	for (k = 0; k < kh_end(h); ++k) {
		if (kh_exist(h, k)) {
			bed_reglist_t *p = &kh_val(h, k);
			if (p->idx) free(p->idx);
			ks_introsort(uint64_t, p->n, p->a);
			p->idx = bed_index_core(p->n, p->a, &p->m);
		}
	}
}

// Assembly:
cmpl $0x0, (%rdi)
je 0x13d3f
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl $0x10, %r15d
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x10(%rbx), %rax
movl %r13d, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %eax
movl %r12d, %ecx
andb $0x1e, %cl
shrl %cl, %eax
testb $0x3, %al
jne 0x13d24
movq 0x20(%rbx), %r14
movq (%r14,%r15), %rdi
testq %rdi, %rdi
je 0x13cfc
callq 0x2050
addq %r15, %r14
addq $-0xc, %r14
movslq -0x4(%r14), %rdi
movq 0x4(%r14), %rsi
callq 0x13999
movl -0x4(%r14), %edi
movq 0x4(%r14), %rsi
movq %r14, %rdx
callq 0x13ba8
movq %rax, 0xc(%r14)
incq %r13
movl (%rbx), %eax
addq $0x18, %r15
addl $0x2, %r12d
cmpq %rax, %r13
jb 0x13cd1
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/bedidx.c
// Function: bed_overlap_core
int bed_overlap_core(const bed_reglist_t *p, int beg, int end)
{
	int i, min_off;
	if (p->n == 0) return 0;
	min_off = (beg>>LIDX_SHIFT >= p->n)? p->idx[p->n-1] : p->idx[beg>>LIDX_SHIFT];
	if (min_off < 0) { // TODO: this block can be improved, but speed should not matter too much here
		int n = beg>>LIDX_SHIFT;
		if (n > p->n) n = p->n;
		for (i = n - 1; i >= 0; --i)
			if (p->idx[i] >= 0) break;
		min_off = i >= 0? p->idx[i] : 0;
	}
	for (i = min_off; i < p->n; ++i) {
		if ((int)(p->a[i]>>32) >= end) break; // out of range; no need to proceed
		if ((int32_t)p->a[i] > beg && (int32_t)(p->a[i]>>32) < end)
			return 1; // find the overlap; return
	}
	return 0;
}

// Assembly:
movslq (%rdi), %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0x13dc1
movl %esi, %r9d
sarl $0xd, %r9d
cmpl %ecx, %r9d
movq 0x10(%rdi), %r8
leaq -0x4(%r8,%rcx,4), %r10
movslq %r9d, %r11
leaq (%r8,%r11,4), %r8
cmovgeq %r10, %r8
movl (%r8), %r8d
testl %r8d, %r8d
jns 0x13d92
cmpl %ecx, %r9d
cmovgel %ecx, %r9d
testl %r9d, %r9d
jle 0x13d8f
movq 0x10(%rdi), %r8
movl -0x4(%r8,%r9,4), %r8d
decq %r9
testl %r8d, %r8d
js 0x13d77
jmp 0x13d92
xorl %r8d, %r8d
cmpl %ecx, %r8d
jge 0x13dc1
movl %r8d, %r9d
shlq $0x3, %r9
addq 0x8(%rdi), %r9
movq (%r9), %rdi
movq %rdi, %r10
shrq $0x20, %r10
cmpl %edx, %r10d
jge 0x13dc1
cmpl %esi, %edi
jg 0x13dc2
addq $0x8, %r9
incl %r8d
cmpl %r8d, %ecx
jg 0x13da2
retq
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/bedidx.c
// Function: bed_overlap
int bed_overlap(const void *_h, const char *chr, int beg, int end)
{
	const reghash_t *h = (const reghash_t*)_h;
	khint_t k;
	if (!h) return 0;
	k = kh_get(reg, h, chr);
	if (k == kh_end(h)) return 0;
	return bed_overlap_core(&kh_val(h, k), beg, end);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %rdi, %rdi
je 0x13ed5
movq %rdi, %r14
movl (%rdi), %eax
testl %eax, %eax
je 0x13e21
movq %rax, 0x10(%rsp)
leal -0x1(%rax), %edi
movsbl (%rsi), %ebp
testl %ebp, %ebp
movl %ecx, 0x8(%rsp)
movl %edx, 0x4(%rsp)
je 0x13e29
movb 0x1(%rsi), %al
testb %al, %al
je 0x13e2b
leaq 0x2(%rsi), %rcx
movl %ebp, %edx
shll $0x5, %edx
subl %ebp, %edx
movsbl %al, %ebp
addl %edx, %ebp
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x13e0a
jmp 0x13e2b
xorl %r13d, %r13d
jmp 0x13ed0
xorl %ebp, %ebp
movl %ebp, %r15d
andl %edi, %r15d
movl %ebp, %eax
shrl $0x3, %eax
shll $0x3, %ebp
xorl %eax, %ebp
orl $0x1, %ebp
andl %edi, %ebp
movq 0x10(%r14), %r8
movl %r15d, %r13d
movl %edi, 0xc(%rsp)
movq %r14, 0x20(%rsp)
movq %r8, 0x18(%rsp)
movl %r13d, %eax
shrl $0x4, %eax
movl (%r8,%rax,4), %ebx
leal (,%r13,2), %r12d
andl $0x1e, %r12d
movl %ebx, %eax
movl %r12d, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x13eb7
testb $0x1, %al
jne 0x13ea2
movq 0x18(%r14), %rax
movl %r13d, %ecx
movq (%rax,%rcx,8), %rdi
movq %rsi, %r14
callq 0x2230
movq 0x18(%rsp), %r8
movl 0xc(%rsp), %edi
movq %r14, %rsi
movq 0x20(%rsp), %r14
testl %eax, %eax
je 0x13eb7
addl %ebp, %r13d
andl %edi, %r13d
cmpl %r15d, %r13d
jne 0x13e55
movq 0x10(%rsp), %rax
movl %eax, %r13d
jmp 0x13ec8
movl %r12d, %ecx
shrl %cl, %ebx
testb $0x3, %bl
movq 0x10(%rsp), %rax
cmovnel %eax, %r13d
movl 0x8(%rsp), %ecx
movl 0x4(%rsp), %edx
cmpl %eax, %r13d
jne 0x13ee6
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r13d, %eax
leaq (%rax,%rax,2), %rdi
shlq $0x3, %rdi
addq 0x20(%r14), %rdi
movl %edx, %esi
movl %ecx, %edx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x13d40
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/bedidx.c
// Function: bed_destroy
void bed_destroy(void *_h)
{
	reghash_t *h = (reghash_t*)_h;
	khint_t k;
	for (k = 0; k < kh_end(h); ++k) {
		if (kh_exist(h, k)) {
			free(kh_val(h, k).a);
			free(kh_val(h, k).idx);
			free((char*)kh_key(h, k));
		}
	}
	kh_destroy(reg, h);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, (%rdi)
je 0x1472a
xorl %r14d, %r14d
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x10(%rbx), %rax
movl %r12d, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %eax
movl %r14d, %ecx
andb $0x1e, %cl
shrl %cl, %eax
testb $0x3, %al
jne 0x14718
movq 0x20(%rbx), %rax
movq 0x8(%rax,%r15), %rdi
callq 0x2050
movq 0x20(%rbx), %rax
movq 0x10(%rax,%r15), %rdi
callq 0x2050
movq 0x18(%rbx), %rax
movq (%rax,%r12,8), %rdi
callq 0x2050
incq %r12
movl (%rbx), %eax
addq $0x18, %r15
addl $0x2, %r14d
cmpq %rax, %r12
jb 0x146d6
movq 0x18(%rbx), %rdi
callq 0x2050
movq 0x10(%rbx), %rdi
callq 0x2050
movq 0x20(%rbx), %rdi
callq 0x2050
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/pbwt.c
// Function: pbc_enc_core
int pbc_enc_core(int m, const int32_t *S0, const uint8_t *a, int32_t *S, uint8_t *u)
{
	int32_t *p[2], j, n1;
	for (j = n1 = 0; j < m; ++j) // count the number of 1 bits
		n1 += (u[j] = !!a[S0[j]]);
	p[0] = S, p[1] = p[0] + (m - n1);
	for (j = 0; j < m; ++j)
		*p[u[j]]++ = S0[j];
	return pbr_enc(m, u, u);
}

// Assembly:
pushq %rbp
pushq %rbx
movl %edi, %eax
testl %edi, %edi
jle 0x14a4e
xorl %r10d, %r10d
xorl %r9d, %r9d
movslq (%rsi,%r10,4), %r11
xorl %ebx, %ebx
cmpb $0x0, (%rdx,%r11)
setne (%r8,%r10)
setne %bl
addl %ebx, %r9d
incq %r10
cmpq %r10, %rax
jne 0x14a2e
jmp 0x14a51
xorl %r9d, %r9d
movq %rcx, -0x18(%rsp)
movl %edi, %edx
subl %r9d, %edx
movslq %edx, %rdx
leaq (%rcx,%rdx,4), %rcx
movq %rcx, -0x10(%rsp)
testl %edi, %edi
jle 0x14a8e
xorl %ecx, %ecx
movl (%rsi,%rcx,4), %edx
movzbl (%r8,%rcx), %r9d
movq -0x18(%rsp,%r9,8), %r10
leaq 0x4(%r10), %r11
movq %r11, -0x18(%rsp,%r9,8)
movl %edx, (%r10)
incq %rcx
cmpq %rcx, %rax
jne 0x14a6d
movb (%r8), %sil
movl $0x1, %r9d
cmpl $0x2, %edi
jl 0x14b23
movl $0x1, %edi
movq %r8, %rdx
cmpb %sil, (%r8,%rdi)
jne 0x14ab3
incl %r9d
jmp 0x14b19
cmpl $0x10, %r9d
jl 0x14afe
movl $0xf0000000, %ebx       # imm = 0xF0000000
movl $0x1c, %ecx
movl $0xe0, %r11d
movq %rdx, %r10
movl %ebx, %ebp
andl %r9d, %ebp
je 0x14ae3
shrl %cl, %ebp
addl %ebp, %ebp
orl %r11d, %ebp
orb %sil, %bpl
movb %bpl, (%r10)
incq %r10
movl %ebx, %ebp
shrl $0x4, %ebp
addl $-0x4, %ecx
addl $-0x20, %r11d
cmpl $0xf, %ebx
movl %ebp, %ebx
ja 0x14acc
subl %edx, %r10d
movslq %r10d, %rcx
jmp 0x14b0c
addb %r9b, %r9b
orb %sil, %r9b
movb %r9b, (%rdx)
movl $0x1, %ecx
addq %rcx, %rdx
movb (%r8,%rdi), %sil
movl $0x1, %r9d
incq %rdi
cmpq %rax, %rdi
jne 0x14aa8
jmp 0x14b26
movq %r8, %rdx
cmpl $0x10, %r9d
jl 0x14b76
movl $0xf0000000, %r10d      # imm = 0xF0000000
movl $0x1c, %ecx
movl $0xe0, %edi
movq %rdx, %rax
movl %r10d, %r11d
andl %r9d, %r11d
je 0x14b59
shrl %cl, %r11d
addl %r11d, %r11d
orl %edi, %r11d
orb %sil, %r11b
movb %r11b, (%rax)
incq %rax
movl %r10d, %r11d
shrl $0x4, %r11d
addl $-0x4, %ecx
addl $-0x20, %edi
cmpl $0xf, %r10d
movl %r11d, %r10d
ja 0x14b3f
subl %edx, %eax
movslq %eax, %rcx
jmp 0x14b84
addb %r9b, %r9b
orb %sil, %r9b
movb %r9b, (%rdx)
movl $0x1, %ecx
leaq (%rdx,%rcx), %rax
movb $0x0, (%rdx,%rcx)
subl %r8d, %eax
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/pbwt.c
// Function: pbc_dec_core
void pbc_dec_core(int m, const int32_t *S0, const uint8_t *u, int32_t *S, uint8_t *a)
{
	const uint8_t *q;
	int32_t *p[2], n1, s;
	for (q = u, n1 = 0; *q; ++q) // count the number of 1 bits
		if (*q&1) n1 += pbr_tbl[*q>>1];
	if (n1 == 0 || n1 == m) {
		memcpy(S, S0, m * 4);
		memset(a, (n1 == m), m);
	} else {
		p[0] = S, p[1] = p[0] + (m - n1);
		memset(a, 0, m);
		for (q = u, s = 0; *q; ++q) {
			int i, l = pbr_tbl[*q>>1], b = *q&1; // $l is the run length
			const int32_t *t = &S0[s];
			if (b) for (i = 0; i < l; ++i) a[t[i]] = b;
			memcpy(p[b], t, l * 4);
			p[b] += l;
			s += l;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %rbx
movq %rdx, %r14
movq %rsi, 0x8(%rsp)
movl %edi, %r12d
movb (%rdx), %dil
testb %dil, %dil
je 0x14be0
leaq 0x1(%r14), %rdx
xorl %eax, %eax
leaq 0xa9fd(%rip), %rsi      # 0x1f5c0
testb $0x1, %dil
je 0x14bd3
movzbl %dil, %edi
andl $-0x2, %edi
addl (%rsi,%rdi,2), %eax
movb (%rdx), %dil
incq %rdx
testb %dil, %dil
jne 0x14bc3
jmp 0x14be2
xorl %eax, %eax
testl %eax, %eax
setne %sil
movl %r12d, %edx
subl %eax, %edx
setne %dil
testb %dil, %sil
jne 0x14c32
xorl %ebp, %ebp
cmpl %eax, %r12d
sete %bpl
leal (,%r12,4), %eax
movslq %eax, %rdx
movq %rcx, %rdi
movq 0x8(%rsp), %rsi
callq 0x2280
movslq %r12d, %rdx
movq %rbx, %rdi
movl %ebp, %esi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21e0
movq %rcx, 0x10(%rsp)
movslq %edx, %rax
leaq (%rcx,%rax,4), %rax
movq %rax, 0x18(%rsp)
movslq %r12d, %rdx
xorl %r13d, %r13d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x21e0
movb (%r14), %al
testb %al, %al
je 0x14cd3
movq %r14, 0x20(%rsp)
movzbl %al, %ecx
movl %ecx, %eax
andl $-0x2, %eax
leaq 0xa952(%rip), %rdx      # 0x1f5c0
movl (%rdx,%rax,2), %ebp
movl %ebp, %eax
movslq %r13d, %rdx
movq 0x8(%rsp), %rsi
leaq (%rsi,%rdx,4), %rsi
testl %ebp, %ebp
setg %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x14c9d
xorl %edx, %edx
movslq (%rsi,%rdx,4), %rdi
movb $0x1, (%rbx,%rdi)
incq %rdx
cmpq %rdx, %rax
jne 0x14c8d
movslq %ebp, %r14
andl $0x1, %ecx
movl %ecx, %r15d
movq 0x10(%rsp,%r15,8), %r12
shll $0x2, %eax
movslq %eax, %rdx
movq %r12, %rdi
callq 0x2280
leaq (%r12,%r14,4), %rax
movq %rax, 0x10(%rsp,%r15,8)
addl %ebp, %r13d
movq 0x20(%rsp), %r14
movb 0x1(%r14), %al
incq %r14
jmp 0x14c56
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/pbwt.c
// Function: pbc_init
pbc_t *pbc_init(int m)
{
	int j;
	uint8_t *p;
	pbc_t *pb;
	p = (uint8_t*)calloc(sizeof(pbc_t) + 2 * m * 4 + (m + 1), 1);
	pb = (pbc_t*)p; p += sizeof(pbc_t);
	pb->S0 = (int32_t*)p; p += m * 4;
	pb->S  = (int32_t*)p; p += m * 4;
	pb->u = p; p += m + 1;
	pb->m = m;
	for (j = 0; j < pb->m; ++j) pb->S[j] = j;
	return pb;
}

// Assembly:
pushq %rbx
leal (,%rdi,8), %eax
cltq
movslq %edi, %rbx
leaq (%rbx,%rax), %rdi
addq $0x21, %rdi
movl $0x1, %esi
callq 0x2220
leaq 0x20(%rax), %rcx
movq %rcx, 0x8(%rax)
leal (,%rbx,4), %ecx
movslq %ecx, %rdx
leaq (%rax,%rdx), %rcx
addq $0x20, %rcx
movq %rcx, 0x10(%rax)
addq %rcx, %rdx
movq %rdx, 0x18(%rax)
movl %ebx, (%rax)
testl %ebx, %ebx
jle 0x14d3c
xorl %edx, %edx
movl %edx, (%rcx,%rdx,4)
incq %rdx
movslq (%rax), %rsi
cmpq %rsi, %rdx
jl 0x14d2e
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/pbwt.c
// Function: pbf_open_w
pbf_t *pbf_open_w(const char *fn, int m, int g, int shift)
{
	FILE *fp;
	pbf_t *pb;
	int32_t i, v[3];
	if (fn && strcmp(fn, "-") != 0) {
		if ((fp = fopen(fn, "wb")) == NULL)
			return 0;
	} else fp = stdout;
	pb = (pbf_t*)calloc(1, sizeof(pbf_t));
	pb->fp = fp;
	pb->m = m, pb->g = g, pb->shift = shift;
	pb->pb = (pbc_t**)calloc(g, sizeof(void*));
	for (i = 0; i < g; ++i)
		pb->pb[i] = pbc_init(m);
	v[0] = pb->m, v[1] = pb->g, v[2] = pb->shift;
	fwrite("PBF\1", 1, 4, fp);
	fwrite(v, 4, 3, fp);
	pb->is_writing = 1;
	return pb;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebx
movl %edx, %ebp
movl %esi, %r14d
testq %rdi, %rdi
je 0x15224
movq %rdi, %r15
leaq 0x92b8(%rip), %rsi      # 0x1e4b4
callq 0x2230
testl %eax, %eax
je 0x15224
leaq 0x913b(%rip), %rsi      # 0x1e347
movq %r15, %rdi
callq 0x23b0
movq %rax, %r15
testq %rax, %rax
jne 0x1522e
xorl %r12d, %r12d
jmp 0x152d9
movq 0x10d55(%rip), %rax     # 0x25f80
movq (%rax), %r15
movl $0x1, %edi
movl $0x70, %esi
callq 0x2220
movq %rax, %r12
movq %r15, (%rax)
movl %r14d, 0x8(%rax)
movl %ebp, 0xc(%rax)
movl %ebx, 0x8(%rsp)
movl %ebx, 0x10(%rax)
movl %ebp, 0x4(%rsp)
movslq %ebp, %rbx
movl $0x8, %esi
movq %rbx, %rdi
callq 0x2220
movq %rax, 0x20(%r12)
testl %ebx, %ebx
jle 0x1528c
movq %rax, %r13
movl 0x4(%rsp), %ebx
xorl %ebp, %ebp
movl %r14d, %edi
callq 0x14ce2
movq %rax, (%r13,%rbp,8)
incq %rbp
cmpq %rbp, %rbx
jne 0x15277
leaq 0xc(%rsp), %rbx
movl %r14d, (%rbx)
movl 0x4(%rsp), %eax
movl %eax, 0x4(%rbx)
movl 0x8(%rsp), %eax
movl %eax, 0x8(%rbx)
leaq 0xa517(%rip), %rdi      # 0x1f7c0
movl $0x1, %esi
movl $0x4, %edx
movq %r15, %rcx
callq 0x2400
movl $0x4, %esi
movl $0x3, %edx
movq %rbx, %rdi
movq %r15, %rcx
callq 0x2400
movl $0x1, 0x14(%r12)
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/pbwt.c
// Function: pbf_close
int pbf_close(pbf_t *pb)
{
	int g;
	if (pb == 0) return 0;
	if (pb->is_writing) { // write the index
		uint64_t off;
		off = ftell(pb->fp);
		fputc('I', pb->fp);
		fwrite(&pb->n, 8, 1, pb->fp);
		fwrite(&pb->n_idx, 4, 1, pb->fp);
		fwrite(pb->idx, 8, pb->n_idx, pb->fp);
		fwrite(&off, 8, 1, pb->fp);
	}
	free(pb->idx); free(pb->ret); free(pb->invS); free(pb->buf); free(pb->sub_list);
	for (g = 0; g < pb->g; ++g) {
		free(pb->pb[g]);
		if (pb->sub) free(pb->sub[g]);
	}
	free(pb->sub); free(pb->pb);
	fclose(pb->fp);
	free(pb);
	return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x15626
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x14(%rdi)
je 0x1559c
movq (%rbx), %rdi
callq 0x2260
movq %rsp, %r14
movq %rax, (%r14)
movq (%rbx), %rsi
movl $0x49, %edi
callq 0x21f0
leaq 0x18(%rbx), %rdi
movq (%rbx), %rcx
movl $0x8, %esi
movl $0x1, %edx
callq 0x2400
leaq 0x30(%rbx), %rdi
movq (%rbx), %rcx
movl $0x4, %esi
movl $0x1, %edx
callq 0x2400
movq (%rbx), %rcx
movq 0x38(%rbx), %rdi
movslq 0x30(%rbx), %rdx
movl $0x8, %esi
callq 0x2400
movq (%rbx), %rcx
movl $0x8, %esi
movl $0x1, %edx
movq %r14, %rdi
callq 0x2400
movq 0x38(%rbx), %rdi
callq 0x2050
movq 0x28(%rbx), %rdi
callq 0x2050
movq 0x68(%rbx), %rdi
callq 0x2050
movq 0x60(%rbx), %rdi
callq 0x2050
movq 0x50(%rbx), %rdi
callq 0x2050
cmpl $0x0, 0xc(%rbx)
jle 0x155fd
xorl %r14d, %r14d
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x2050
movq 0x48(%rbx), %rax
testq %rax, %rax
je 0x155f1
movq (%rax,%r14,8), %rdi
callq 0x2050
incq %r14
movslq 0xc(%rbx), %rax
cmpq %rax, %r14
jl 0x155d2
movq 0x48(%rbx), %rdi
callq 0x2050
movq 0x20(%rbx), %rdi
callq 0x2050
movq (%rbx), %rdi
callq 0x2160
movq %rbx, %rdi
callq 0x2050
addq $0x8, %rsp
popq %rbx
popq %r14
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/pbwt.c
// Function: pbf_write
int pbf_write(pbf_t *pb, uint8_t *const*a)
{
	int g;
	if (!pb->is_writing) return -1;
	if ((pb->n & ((1ULL<<pb->shift) - 1)) == 0) {
		if (pb->n_idx == pb->m_idx) {
			pb->m_idx = pb->m_idx? pb->m_idx<<1 : 8;
			pb->idx = (uint64_t*)realloc(pb->idx, pb->m_idx * 8);
		}
		pb->idx[pb->n_idx++] = ftell(pb->fp); // save the index offset
		fputc('S', pb->fp);
		for (g = 0; g < pb->g; ++g) // write S[]
			fwrite(pb->pb[g]->S, 4, pb->m, pb->fp);
	}
	fputc('B', pb->fp);
	for (g = 0; g < pb->g; ++g) {
		pbc_t *pbc = pb->pb[g];
		pbc_enc(pbc, a[g]);
		fwrite(&pbc->l, 4, 1, pb->fp);
		fwrite(pbc->u, 1, pbc->l, pb->fp);
	}
	++pb->n;
	return 0;
}

// Assembly:
cmpl $0x0, 0x14(%rdi)
je 0x15774
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movb 0x10(%rdi), %cl
movq $-0x1, %rax
shlq %cl, %rax
notq %rax
testq %rax, 0x18(%rdi)
jne 0x156df
movl 0x34(%rbx), %eax
cmpl %eax, 0x30(%rbx)
jne 0x15686
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x8, %eax
cmovnel %ecx, %eax
movl %eax, 0x34(%rbx)
movq 0x38(%rbx), %rdi
shll $0x3, %eax
movslq %eax, %rsi
callq 0x2330
movq %rax, 0x38(%rbx)
movq (%rbx), %rdi
callq 0x2260
movq 0x38(%rbx), %rcx
movslq 0x30(%rbx), %rdx
leal 0x1(%rdx), %esi
movl %esi, 0x30(%rbx)
movq %rax, (%rcx,%rdx,8)
movq (%rbx), %rsi
movl $0x53, %edi
callq 0x21f0
cmpl $0x0, 0xc(%rbx)
jle 0x156df
xorl %r15d, %r15d
movq (%rbx), %rcx
movq 0x20(%rbx), %rax
movq (%rax,%r15,8), %rax
movq 0x10(%rax), %rdi
movslq 0x8(%rbx), %rdx
movl $0x4, %esi
callq 0x2400
incq %r15
movslq 0xc(%rbx), %rax
cmpq %rax, %r15
jl 0x156b6
movq (%rbx), %rsi
movl $0x42, %edi
callq 0x21f0
cmpl $0x0, 0xc(%rbx)
jle 0x15762
xorl %r15d, %r15d
movq 0x20(%rbx), %rax
movq (%rax,%r15,8), %r12
movq (%r14,%r15,8), %rdx
movq 0x10(%r12), %rsi
movq 0x8(%r12), %rcx
movq %rcx, 0x10(%r12)
movq %rsi, 0x8(%r12)
movl (%r12), %edi
movq 0x18(%r12), %r8
callq 0x14a20
leaq 0x4(%r12), %rdi
movl %eax, 0x4(%r12)
movq (%rbx), %rcx
movl $0x4, %esi
movl $0x1, %edx
callq 0x2400
movq 0x18(%r12), %rdi
movslq 0x4(%r12), %rdx
movq (%rbx), %rcx
movl $0x1, %esi
callq 0x2400
incq %r15
movslq 0xc(%rbx), %rax
cmpq %rax, %r15
jl 0x156f5
incq 0x18(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/pbwt.c
// Function: pbf_read
const uint8_t **pbf_read(pbf_t *pb)
{
	int g;
	uint8_t t;
	if (pb->is_writing) return 0;
	fread(&t, 1, 1, pb->fp);
	if (t == 'S') {
		for (g = 0; g < pb->g; ++g)
			fread(pb->pb[g]->S, 4, pb->m, pb->fp);
		fread(&t, 1, 1, pb->fp);
	}
	if (t == 'B') {
		for (g = 0; g < pb->g; ++g) {
			int32_t l;
			fread(&l, 4, 1, pb->fp);
			fread(pb->buf, 1, l, pb->fp);
			pb->buf[l] = 0;
			if (pb->n_sub > 0 && pb->n_sub < pb->m) // subset decoding
				pbs_dec(pb->m, pb->n_sub, pb->sub[g], pb->buf, pb->pb[g]->u);
			else pbc_dec(pb->pb[g], pb->buf); // full decoding
		}
		++pb->k;
	} else return 0;
	return pb->ret;
}

// Assembly:
cmpl $0x0, 0x14(%rdi)
je 0x15783
xorl %eax, %eax
retq
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rcx
leaq 0x3(%rsp), %r14
movl $0x1, %esi
movl $0x1, %edx
movq %r14, %rdi
callq 0x20f0
cmpb $0x53, (%r14)
jne 0x157f7
cmpl $0x0, 0xc(%rbx)
jle 0x157e0
xorl %r14d, %r14d
movq (%rbx), %rcx
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rax
movq 0x10(%rax), %rdi
movslq 0x8(%rbx), %rdx
movl $0x4, %esi
callq 0x20f0
incq %r14
movslq 0xc(%rbx), %rax
cmpq %rax, %r14
jl 0x157b7
movq (%rbx), %rcx
leaq 0x3(%rsp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x20f0
cmpb $0x42, 0x3(%rsp)
jne 0x158b9
cmpl $0x0, 0xc(%rbx)
jle 0x158af
xorl %r12d, %r12d
leaq 0x4(%rsp), %r14
movq (%rbx), %rcx
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rdi
callq 0x20f0
movq (%rbx), %rcx
movq 0x60(%rbx), %rdi
movslq 0x4(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x20f0
movq 0x60(%rbx), %rax
movb $0x0, (%rax,%r15)
movl 0x40(%rbx), %esi
testl %esi, %esi
jle 0x15878
movl 0x8(%rbx), %edi
cmpl %edi, %esi
jge 0x15878
movq 0x20(%rbx), %rax
movq 0x48(%rbx), %rcx
movq (%rcx,%r12,8), %rdx
movq 0x60(%rbx), %rcx
movq (%rax,%r12,8), %rax
movq 0x18(%rax), %r8
callq 0x14f99
jmp 0x1589f
movq 0x20(%rbx), %rax
movq 0x60(%rbx), %rdx
movq (%rax,%r12,8), %rax
movq 0x10(%rax), %rsi
movq 0x8(%rax), %rcx
movq %rcx, 0x10(%rax)
movq %rsi, 0x8(%rax)
movl (%rax), %edi
movq 0x18(%rax), %r8
callq 0x14b92
incq %r12
movslq 0xc(%rbx), %rax
cmpq %rax, %r12
jl 0x15814
incq 0x58(%rbx)
movq 0x28(%rbx), %rax
jmp 0x158bb
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/pbwt.c
// Function: pbf_seek
int pbf_seek(pbf_t *pb, uint64_t k)
{
	int x, i, g;
	uint8_t t;
	if (pb->is_writing) return -1;
	if (k == pb->k) return 0;
	if (k > pb->k && k - pb->k <= 1<<pb->shift) {
		while (pb->k < k) pbf_read(pb);
		return 0;
	}
	if (pb->idx == 0 || k >= pb->n) return -1;
	fseek(pb->fp, pb->idx[k>>pb->shift], SEEK_SET);
	fread(&t, 1, 1, pb->fp);
	assert(t == 'S'); // a bug or corrupted file if it is not an "S" line
	for (g = 0; g < pb->g; ++g) {
		fread(pb->pb[g]->S, 4, pb->m, pb->fp);
		if (pb->n_sub > 0 && pb->n_sub < pb->m) // update pb->sub if needed
			pbf_fill_sub(pb->m, pb->pb[g]->S, pb->n_sub, pb->sub[g], pb->invS, pb->sub_list);
	}
	pb->k = k >> pb->shift << pb->shift;
	x = k & ((1<<pb->shift) - 1);
	for (i = 0; i < x; ++i) pbf_read(pb);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x0, 0x14(%rdi)
jne 0x158ea
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rax
subq 0x58(%rdi), %rax
jne 0x158f7
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jbe 0x15910
movb 0x10(%r14), %cl
movl $0x1, %edx
shll %cl, %edx
movslq %edx, %rcx
cmpq %rcx, %rax
jbe 0x15a33
movq 0x38(%r14), %rax
testq %rax, %rax
je 0x158ea
cmpq %rbx, 0x18(%r14)
jbe 0x158ea
movq (%r14), %rdi
movb 0x10(%r14), %cl
movq %rbx, %rdx
shrq %cl, %rdx
movq (%rax,%rdx,8), %rsi
xorl %edx, %edx
callq 0x2310
movq (%r14), %rcx
leaq 0x7(%rsp), %r15
movl $0x1, %esi
movl $0x1, %edx
movq %r15, %rdi
callq 0x20f0
cmpb $0x53, (%r15)
jne 0x15a47
cmpl $0x0, 0xc(%r14)
jle 0x159fe
xorl %r15d, %r15d
movq (%r14), %rcx
movq 0x20(%r14), %rax
movq (%rax,%r15,8), %rax
movq 0x10(%rax), %rdi
movslq 0x8(%r14), %rdx
movl $0x4, %esi
callq 0x20f0
movslq 0x40(%r14), %rax
testq %rax, %rax
jle 0x159ee
movl 0x8(%r14), %esi
cmpl %esi, %eax
jge 0x159ee
movq 0x48(%r14), %rcx
movq (%rcx,%r15,8), %rdi
movq 0x68(%r14), %rcx
movq 0x50(%r14), %rdx
testl %esi, %esi
jle 0x159ca
movq 0x20(%r14), %r8
movq (%r8,%r15,8), %r8
movq 0x10(%r8), %r8
xorl %r9d, %r9d
movslq (%r8,%r9,4), %r10
movl %r9d, (%rcx,%r10,4)
incq %r9
cmpq %r9, %rsi
jne 0x159ba
xorl %esi, %esi
movl 0x4(%rdi,%rsi,8), %r8d
movslq (%rdx,%r8,4), %r8
movl (%rcx,%r8,4), %r8d
movl %r8d, (%rdi,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0x159cc
leaq (%rdi,%rax,8), %rsi
callq 0x14f77
incq %r15
movslq 0xc(%r14), %rax
cmpq %rax, %r15
jl 0x15969
movb 0x10(%r14), %cl
movq %rbx, %rax
shrq %cl, %rax
shlq %cl, %rax
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
shll %cl, %edx
movq %rax, 0x58(%r14)
notl %edx
xorl %ebp, %ebp
andl %edx, %ebx
je 0x158ea
movq %r14, %rdi
callq 0x1577a
decl %ebx
jne 0x15a22
jmp 0x158ea
cmpq %rbx, 0x58(%r14)
jae 0x158e8
movq %r14, %rdi
callq 0x1577a
jmp 0x15a33
leaq 0x9d77(%rip), %rdi      # 0x1f7c5
leaq 0x9d79(%rip), %rsi      # 0x1f7ce
leaq 0x9d79(%rip), %rcx      # 0x1f7d5
movl $0x16a, %edx            # imm = 0x16A
callq 0x21b0
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/pbwt.c
// Function: pbf_subset
int pbf_subset(pbf_t *pb, int n_sub, int *sub)
{
	int i, g;
	if (n_sub <= 0 || n_sub >= pb->m || sub == 0) n_sub = 0;
	if ((pb->n_sub = n_sub) != 0) {
		pb->sub_list = (int*)realloc(pb->sub_list, n_sub * sizeof(int));
		memcpy(pb->sub_list, sub, n_sub * sizeof(int));
		for (g = 0; g < pb->g; ++g) {
			pb->sub[g] = (pbs_dat_t*)realloc(pb->sub[g], n_sub * sizeof(pbs_dat_t));
			for (i = 0; i < n_sub; ++i) pb->sub[g][i].i = i;
			pbf_fill_sub(pb->m, pb->pb[g]->S, n_sub, pb->sub[g], pb->invS, pb->sub_list);
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
testl %esi, %esi
jle 0x15a87
testq %r14, %r14
je 0x15a87
movl %esi, %ebp
cmpl %esi, 0x8(%rbx)
jg 0x15a89
xorl %ebp, %ebp
movl %ebp, 0x40(%rbx)
testl %ebp, %ebp
je 0x15b76
movq 0x50(%rbx), %rdi
movl %ebp, %r12d
leaq (,%r12,4), %r15
movq %r15, %rsi
callq 0x2330
movq %rax, 0x50(%rbx)
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2280
cmpl $0x0, 0xc(%rbx)
jle 0x15b76
leaq (,%r12,8), %r14
cmpl $0x2, %ebp
movl $0x1, %r15d
cmovgel %ebp, %r15d
xorl %r13d, %r13d
movq 0x48(%rbx), %rax
movq (%rax,%r13,8), %rdi
movq %r14, %rsi
callq 0x2330
movq 0x48(%rbx), %rcx
movq %rax, (%rcx,%r13,8)
movq 0x48(%rbx), %rax
movq (%rax,%r13,8), %rax
xorl %ecx, %ecx
movl %ecx, 0x4(%rax,%rcx,8)
incq %rcx
cmpq %rcx, %r15
jne 0x15b01
movslq 0x8(%rbx), %rdx
movq 0x48(%rbx), %rax
movq (%rax,%r13,8), %rdi
movq 0x68(%rbx), %rax
movq 0x50(%rbx), %rcx
testq %rdx, %rdx
jle 0x15b45
movq 0x20(%rbx), %rsi
movq (%rsi,%r13,8), %rsi
movq 0x10(%rsi), %rsi
xorl %r8d, %r8d
movslq (%rsi,%r8,4), %r9
movl %r8d, (%rax,%r9,4)
incq %r8
cmpq %r8, %rdx
jne 0x15b35
xorl %edx, %edx
movl 0x4(%rdi,%rdx,8), %esi
movslq (%rcx,%rsi,4), %rsi
movl (%rax,%rsi,4), %esi
movl %esi, (%rdi,%rdx,8)
incq %rdx
cmpq %rdx, %r12
jne 0x15b47
leaq (%rdi,%r12,8), %rsi
callq 0x14f77
incq %r13
movslq 0xc(%rbx), %rax
cmpq %rax, %r13
jl 0x15adf
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/bgt.c
// Function: bgt_close
void bgt_close(bgt_file_t *bf)
{
	if (bf == 0) return;
	free(bf->mgs);
	if (bf->idx) hts_idx_destroy(bf->idx);
	if (bf->h0) bcf_hdr_destroy(bf->h0);
	if (bf->f) fmf_destroy(bf->f);
	free(bf->prefix);
	free(bf);
}

// Assembly:
testq %rdi, %rdi
je 0x15dd3
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
callq 0x2050
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x15da6
callq 0x7b9b
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x15db4
callq 0xb84a
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x15dc2
callq 0x9ebe
movq (%rbx), %rdi
callq 0x2050
movq %rbx, %rdi
popq %rbx
jmp 0x2050
retq
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/bgt.c
// Function: bgt_reader_init
bgt_t *bgt_reader_init(const bgt_file_t *bf)
{
	char *fn;
	bgt_t *bgt;
	assert(BGT_MAX_GROUPS <= 32);
	bgt = (bgt_t*)calloc(1, sizeof(bgt_t));
	bgt->f = bf;
	fn = (char*)malloc(strlen(bf->prefix) + 9);
	sprintf(fn, "%s.pbf", bf->prefix);
	bgt->pb = pbf_open_r(fn); // FIXME: check if .pbf is present
	sprintf(fn, "%s.bcf", bf->prefix);
	bgt->bcf = bgzf_open(fn, "rb");
	bgt->b0 = bcf_init1();
	bcf_seekn(bgt->bcf, bgt->f->idx, 0);
	bgt->gtag = (uint32_t*)calloc(bgt->f->f->n_rows, 4);
	free(fn);
	return bgt;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x1, %edi
movl $0x68, %esi
callq 0x2220
movq %rax, %rbx
movq %r14, (%rax)
movq (%r14), %r12
movq %r12, %rdi
callq 0x2170
leaq 0x9(%rax), %rdi
callq 0x22e0
movq %rax, %r15
leaq 0x8538(%rip), %rsi      # 0x1e34a
movq %rax, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x23f0
movq %r15, %rdi
callq 0x152eb
movq %rax, 0x8(%rbx)
movq (%r14), %rdx
leaq 0x8523(%rip), %rsi      # 0x1e358
movq %r15, %rdi
xorl %eax, %eax
callq 0x23f0
leaq 0x91da(%rip), %rsi      # 0x1f020
movq %r15, %rdi
callq 0x434c
movq %rax, %r12
movq %rax, 0x10(%rbx)
xorl %eax, %eax
callq 0xb9db
movq %rax, 0x18(%rbx)
movq 0x18(%r14), %rsi
movq %r12, %rdi
xorl %edx, %edx
callq 0x1141d
movq 0x8(%r14), %rax
movslq 0x20(%rax), %rdi
movl $0x4, %esi
callq 0x2220
movq %rax, 0x50(%rbx)
movq %r15, %rdi
callq 0x2050
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/bgt.c
// Function: bgt_reader_destroy
void bgt_reader_destroy(bgt_t *bgt)
{
	bcf_destroy1(bgt->b0);
	free(bgt->gtag); free(bgt->group); free(bgt->out);
	if (bgt->h_out) bcf_hdr_destroy(bgt->h_out);
	hts_itr_destroy(bgt->itr);
	pbf_close(bgt->pb);
	bgzf_close(bgt->bcf);
	free(bgt);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0xb9ea
movq 0x50(%rbx), %rdi
callq 0x2050
movq 0x48(%rbx), %rdi
callq 0x2050
movq 0x40(%rbx), %rdi
callq 0x2050
movq 0x58(%rbx), %rdi
testq %rdi, %rdi
je 0x15ed1
callq 0xb84a
movq 0x20(%rbx), %rdi
callq 0x8f8f
movq 0x8(%rbx), %rdi
callq 0x15515
movq 0x10(%rbx), %rdi
callq 0x5040
movq %rbx, %rdi
popq %rbx
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/bgt.c
// Function: bgt_add_group
int bgt_add_group(bgt_t *bgt, const char *expr)
{
	int is_file, ret = 0;
	is_file = bgt_is_file(expr);
	if (*expr == ':' || *expr == ',' || (*expr != '?' && is_file)) {
		int i, n;
		char **samples;
		samples = hts_readlines(expr, &n);
		ret = bgt_add_group_core(bgt, n, samples, 0);
		for (i = 0; i < n; ++i) free(samples[i]);
		free(samples);
	} else ret = bgt_add_group_core(bgt, 0, 0, expr);
	return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x16143
movzbl (%r14), %ecx
cmpl $0x2c, %ecx
je 0x160d3
cmpl $0x3a, %ecx
je 0x160d3
cmpb $0x3f, %cl
je 0x1612b
testl %eax, %eax
je 0x1612b
leaq 0xc(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x6694
movq %rax, %r14
movl (%r15), %esi
movq %rbx, %rdi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x15ef5
movl %eax, %ebx
cmpl $0x0, (%r15)
jle 0x16117
xorl %r15d, %r15d
movq (%r14,%r15,8), %rdi
callq 0x2050
incq %r15
movslq 0xc(%rsp), %rax
cmpq %rax, %r15
jl 0x16101
movq %r14, %rdi
callq 0x2050
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
movq %r14, %rcx
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x15ef5
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/bgt.c
// Function: bgt_set_region
int bgt_set_region(bgt_t *bgt, const char *reg)
{
	if (bgt->itr) bcf_itr_destroy(bgt->itr);
	bgt->itr = bcf_itr_querys(bgt->f->idx, bgt->f->h0, reg);
	bgt->b0->shared.l = 0; // mark b0 unread
	return bgt->itr? 0 : -1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
je 0x16189
callq 0x8f8f
movq (%rbx), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rax), %rdi
leaq -0x598f(%rip), %rdx     # 0x1080c
movq %r14, %rsi
callq 0x9193
movq %rax, 0x20(%rbx)
movq 0x18(%rbx), %rcx
movq $0x0, 0x18(%rcx)
xorl %ecx, %ecx
cmpq $0x1, %rax
sbbl %ecx, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/bgt.c
// Function: bgt_read_core0
int bgt_read_core0(bgt_t *bgt)
{
	int i, id, row;
	row = bgt->itr? bcf_itr_next(bgt->bcf, bgt->itr, bgt->b0) : bcf_read1(bgt->bcf, bgt->b0);
	if (row < 0) return row;
	assert(bgt->b0->n_sample == 0); // there shouldn't be any sample fields
	row = -1;
	id = bcf_id2int(bgt->f->h0, BCF_DT_ID, "_row");
	assert(id > 0);
	bcf_unpack(bgt->b0, BCF_UN_INFO);
	for (i = 0; i < bgt->b0->n_info; ++i) {
		bcf_info_t *p = &bgt->b0->d.info[i];
		if (p->key == id) row = p->v1.i;
	}
	assert(row >= 0);
	return row;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rsi
movq 0x10(%rdi), %rdi
movq 0x18(%rbx), %rdx
testq %rsi, %rsi
je 0x16598
leaq -0xa9c5(%rip), %rcx     # 0xbbc9
xorl %r8d, %r8d
callq 0x925f
jmp 0x165a0
movq %rdx, %rsi
callq 0xba56
testl %eax, %eax
js 0x16617
movq 0x18(%rbx), %rax
movq 0x10(%rax), %rax
shrq $0x28, %rax
jne 0x1661e
movq (%rbx), %rax
movq 0x10(%rax), %rdi
leaq 0x7d9f(%rip), %rdx      # 0x1e35f
xorl %esi, %esi
callq 0x106de
testl %eax, %eax
jle 0x1663d
movl %eax, %ebp
movq 0x18(%rbx), %rdi
movl $0x4, %esi
callq 0xf0a4
movq 0x18(%rbx), %rcx
movzwl 0x10(%rcx), %eax
testq %rax, %rax
je 0x1660e
movq 0x78(%rcx), %rcx
shll $0x3, %eax
leaq (%rax,%rax,2), %rdx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %esi, %esi
cmpl %ebp, (%rcx,%rsi)
jne 0x16603
movl 0xc(%rcx,%rsi), %eax
addq $0x18, %rsi
cmpq %rsi, %rdx
jne 0x165fa
jmp 0x16613
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x1665c
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x91d8(%rip), %rdi      # 0x1f7fd
leaq 0x91e8(%rip), %rsi      # 0x1f814
leaq 0x91e7(%rip), %rcx      # 0x1f81a
movl $0x115, %edx            # imm = 0x115
callq 0x21b0
leaq 0x91f2(%rip), %rdi      # 0x1f836
leaq 0x91c9(%rip), %rsi      # 0x1f814
leaq 0x91c8(%rip), %rcx      # 0x1f81a
movl $0x118, %edx            # imm = 0x118
callq 0x21b0
leaq 0x91da(%rip), %rdi      # 0x1f83d
leaq 0x91aa(%rip), %rsi      # 0x1f814
leaq 0x91a9(%rip), %rcx      # 0x1f81a
movl $0x11e, %edx            # imm = 0x11E
callq 0x21b0
// File: /workspace/github_c_makefile_star2_O1/lh3[P]bgt/bgt.c
// Function: bgt_read_core
int bgt_read_core(bgt_t *bgt)
{
	if (bgt->bed || bgt->h_al) {
		int ret;
		while ((ret = bgt_read_core0(bgt)) >= 0) {
			if (bgt->bed) {
				int r;
				r = bed_overlap(bgt->bed, bgt->h_out->id[BCF_DT_CTG][bgt->b0->rid].key, bgt->b0->pos, bgt->b0->pos + bgt->b0->rlen);
				if (bgt->bed_excl && r) continue;
				if (!bgt->bed_excl && !r) continue;
			}
			if (bgt->h_al && !al_present((khash_t(str)*)bgt->h_al, bgt->h_out, bgt->b0)) continue;
			break;
		}
		return ret;
	} else return bgt_read_core0(bgt);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x28(%rdi)
jne 0x16c4d
cmpq $0x0, 0x60(%rbx)
je 0x16cbb
movq %rbx, %rdi
callq 0x16570
movl %eax, %ebp
testl %eax, %eax
js 0x16cb2
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x16c98
movq 0x18(%rbx), %rax
movq 0x58(%rbx), %rcx
movq 0x20(%rcx), %rcx
movslq (%rax), %rdx
shlq $0x4, %rdx
movq (%rcx,%rdx), %rsi
movl 0x4(%rax), %edx
movl 0x8(%rax), %ecx
addl %edx, %ecx
callq 0x13dc8
cmpl $0x0, 0x30(%rbx)
setne %cl
testl %eax, %eax
setne %al
cmpb %cl, %al
je 0x16c4d
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x16cb2
movq 0x18(%rbx), %rdx
movq 0x58(%rbx), %rsi
callq 0x16cc9
testl %eax, %eax
je 0x16c4d
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x16570