LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 0x15c21
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 0x15b8c
movl 0x30(%rbx), %eax
cmpl 0x34(%rbx), %eax
jne 0x15b33
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 0x15b8c
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 0x15b63
movq (%rbx), %rsi
movl $0x42, %edi
callq 0x21f0
cmpl $0x0, 0xc(%rbx)
jle 0x15c0f
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 0x14e90
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 0x15ba2
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_O3/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 0x15c30
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
movb (%r14), %al
cmpb $0x53, %al
jne 0x15cab
cmpl $0x0, 0xc(%rbx)
jle 0x15c8e
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 0x15c65
movq (%rbx), %rcx
leaq 0x3(%rsp), %r14
movl $0x1, %esi
movl $0x1, %edx
movq %r14, %rdi
callq 0x20f0
movb (%r14), %al
cmpb $0x42, %al
jne 0x15d6a
cmpl $0x0, 0xc(%rbx)
jle 0x15d60
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 0x15d29
movl 0x8(%rbx), %edi
cmpl %edi, %esi
jge 0x15d29
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 0x1546c
jmp 0x15d50
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 0x1505a
incq %r12
movslq 0xc(%rbx), %rax
cmpq %rax, %r12
jl 0x15cc5
incq 0x58(%rbx)
movq 0x28(%rbx), %rax
jmp 0x15d6c
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x15d9b
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rax
subq 0x58(%rdi), %rax
jne 0x15da8
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jbe 0x15dc1
movb 0x10(%r14), %cl
movl $0x1, %edx
shll %cl, %edx
movslq %edx, %rcx
cmpq %rcx, %rax
jbe 0x15ee0
movq 0x38(%r14), %rax
testq %rax, %rax
je 0x15d9b
cmpq %rbx, 0x18(%r14)
jbe 0x15d9b
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 0x15ef3
cmpl $0x0, 0xc(%r14)
jle 0x15eab
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 0x15e9b
movl 0x8(%r14), %esi
cmpl %esi, %eax
jge 0x15e9b
movq 0x20(%r14), %rcx
movq 0x48(%r14), %rdx
movq (%rcx,%r15,8), %rcx
movq 0x10(%rcx), %r8
movq (%rdx,%r15,8), %rdi
movq 0x68(%r14), %rcx
movq 0x50(%r14), %rdx
xorl %r9d, %r9d
movslq (%r8,%r9,4), %r10
movl %r9d, (%rcx,%r10,4)
incq %r9
cmpq %r9, %rsi
jne 0x15e67
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 0x15e79
leaq (%rdi,%rax,8), %rsi
callq 0x1544a
incq %r15
movslq 0xc(%r14), %rax
cmpq %rax, %r15
jl 0x15e1a
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 0x15d9b
movq %r14, %rdi
callq 0x15c27
decl %ebx
jne 0x15ecf
jmp 0x15d9b
movq %r14, %rdi
callq 0x15c27
cmpq %rbx, 0x58(%r14)
jb 0x15ee0
jmp 0x15d99
leaq 0x98eb(%rip), %rdi      # 0x1f7e5
leaq 0x98ed(%rip), %rsi      # 0x1f7ee
leaq 0x98ed(%rip), %rcx      # 0x1f7f5
movl $0x16a, %edx            # imm = 0x16A
callq 0x21b0
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
testl %esi, %esi
jle 0x160a2
movq %rdx, %r14
testq %rdx, %rdx
je 0x160a2
cmpl %esi, 0x8(%rbx)
jle 0x160a2
movl %esi, 0x40(%rbx)
movq 0x50(%rbx), %rdi
movl %esi, %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 0x160a9
leaq (,%r12,8), %r14
leal 0x1(%r12), %r15d
andl $-0x2, %r15d
leaq -0x1(%r12), %rax
movq %rax, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
xorl %r13d, %r13d
pxor 0x8ed0(%rip), %xmm0     # 0x1ee70
movdqa %xmm0, (%rsp)
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), %rdi
xorl %eax, %eax
movdqa 0x8e91(%rip), %xmm0     # 0x1ee60
movdqa (%rsp), %xmm4
movdqa 0x8e94(%rip), %xmm5     # 0x1ee70
pcmpeqd %xmm6, %xmm6
movdqa 0x95e8(%rip), %xmm7     # 0x1f5d0
movdqa %xmm0, %xmm1
pxor %xmm5, %xmm1
movdqa %xmm1, %xmm2
pcmpgtd %xmm4, %xmm2
pcmpeqd %xmm4, %xmm1
pshufd $0xf5, %xmm1, %xmm3     # xmm3 = xmm1[1,1,3,3]
pand %xmm2, %xmm3
pshufd $0xf5, %xmm2, %xmm1     # xmm1 = xmm2[1,1,3,3]
por %xmm3, %xmm1
movd %xmm1, %ecx
notl %ecx
testb $0x1, %cl
je 0x1601d
movl %eax, 0x4(%rdi,%rax,8)
pxor %xmm6, %xmm1
pextrw $0x4, %xmm1, %ecx
testb $0x1, %cl
je 0x16032
leal 0x1(%rax), %ecx
movl %ecx, 0xc(%rdi,%rax,8)
addq $0x2, %rax
paddq %xmm7, %xmm0
cmpq %rax, %r15
jne 0x15fe8
movslq 0x8(%rbx), %rdx
movq 0x50(%rbx), %rax
movq 0x68(%rbx), %rcx
testq %rdx, %rdx
jle 0x1606f
movq 0x20(%rbx), %rsi
movq (%rsi,%r13,8), %rsi
movq 0x10(%rsi), %rsi
xorl %r8d, %r8d
movslq (%rsi,%r8,4), %r9
movl %r8d, (%rcx,%r9,4)
incq %r8
cmpq %r8, %rdx
jne 0x1605f
xorl %edx, %edx
movl 0x4(%rdi,%rdx,8), %esi
movslq (%rax,%rsi,4), %rsi
movl (%rcx,%rsi,4), %esi
movl %esi, (%rdi,%rdx,8)
incq %rdx
cmpq %rdx, %r12
jne 0x16071
leaq (%rdi,%r12,8), %rsi
callq 0x1544a
incq %r13
movslq 0xc(%rbx), %rax
cmpq %rax, %r13
jl 0x15fa5
jmp 0x160a9
movl $0x0, 0x40(%rbx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x16406
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
callq 0x2050
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x163d9
callq 0x7e44
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x163e7
callq 0xb980
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x163f5
callq 0xa152
movq (%rbx), %rdi
callq 0x2050
movq %rbx, %rdi
popq %rbx
jmp 0x2050
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x7f05(%rip), %rsi      # 0x1e34a
movq %rax, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x23f0
movq %r15, %rdi
callq 0x157ab
movq %rax, 0x8(%rbx)
movq (%r14), %rdx
leaq 0x7ef0(%rip), %rsi      # 0x1e358
movq %r15, %rdi
xorl %eax, %eax
callq 0x23f0
leaq 0x8be7(%rip), %rsi      # 0x1f060
movq %r15, %rdi
callq 0x43f4
movq %rax, %r12
movq %rax, 0x10(%rbx)
xorl %eax, %eax
callq 0xbb1a
movq %rax, 0x18(%rbx)
movq 0x18(%r14), %rsi
movq %r12, %rdi
xorl %edx, %edx
callq 0x115c0
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_O3/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 0xbb29
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 0x16504
callq 0xb980
movq 0x20(%rbx), %rdi
callq 0x921e
movq 0x8(%rbx), %rdi
callq 0x159c2
movq 0x10(%rbx), %rdi
callq 0x542d
movq %rbx, %rdi
popq %rbx
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O3/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 0x16779
movzbl (%r14), %ecx
cmpl $0x2c, %ecx
je 0x16709
cmpl $0x3a, %ecx
je 0x16709
cmpb $0x3f, %cl
je 0x16761
testl %eax, %eax
je 0x16761
leaq 0xc(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x6803
movq %rax, %r14
movl (%r15), %esi
movq %rbx, %rdi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x16528
movl %eax, %ebx
cmpl $0x0, (%r15)
jle 0x1674d
xorl %r15d, %r15d
movq (%r14,%r15,8), %rdi
callq 0x2050
incq %r15
movslq 0xc(%rsp), %rax
cmpq %rax, %r15
jl 0x16737
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 0x16528
// File: /workspace/github_c_makefile_star2_O3/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 0x167bf
callq 0x921e
movq (%rbx), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rax), %rdi
leaq -0x5e1c(%rip), %rdx     # 0x109b5
movq %r14, %rsi
callq 0x9445
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_O3/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 0x16bdf
leaq -0xaee9(%rip), %rcx     # 0xbcec
xorl %r8d, %r8d
callq 0x9505
jmp 0x16be7
movq %rdx, %rsi
callq 0xbb95
testl %eax, %eax
js 0x16c5f
movq 0x18(%rbx), %rax
movq 0x10(%rax), %rax
shrq $0x28, %rax
jne 0x16c85
movq (%rbx), %rax
movq 0x10(%rax), %rdi
leaq 0x7754(%rip), %rdx      # 0x1e35f
xorl %esi, %esi
callq 0x1088a
testl %eax, %eax
jle 0x16ca4
movl %eax, %ebp
movq 0x18(%rbx), %rdi
movl $0x4, %esi
callq 0xf116
movq 0x18(%rbx), %rcx
movzwl 0x10(%rcx), %eax
testq %rax, %rax
je 0x16c66
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 0x16c52
movl 0xc(%rcx,%rsi), %eax
addq $0x18, %rsi
cmpq %rsi, %rdx
jne 0x16c49
testl %eax, %eax
js 0x16c66
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x8bf0(%rip), %rdi      # 0x1f85d
leaq 0x8bc0(%rip), %rsi      # 0x1f834
leaq 0x8bbf(%rip), %rcx      # 0x1f83a
movl $0x11e, %edx            # imm = 0x11E
callq 0x21b0
leaq 0x8b91(%rip), %rdi      # 0x1f81d
leaq 0x8ba1(%rip), %rsi      # 0x1f834
leaq 0x8ba0(%rip), %rcx      # 0x1f83a
movl $0x115, %edx            # imm = 0x115
callq 0x21b0
leaq 0x8bab(%rip), %rdi      # 0x1f856
leaq 0x8b82(%rip), %rsi      # 0x1f834
leaq 0x8b81(%rip), %rcx      # 0x1f83a
movl $0x118, %edx            # imm = 0x118
callq 0x21b0
// File: /workspace/github_c_makefile_star2_O3/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 0x172c5
cmpq $0x0, 0x60(%rbx)
je 0x17333
movq %rbx, %rdi
callq 0x16bb7
movl %eax, %ebp
testl %eax, %eax
js 0x1732a
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x17310
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 0x141d1
cmpl $0x0, 0x30(%rbx)
setne %cl
testl %eax, %eax
setne %al
cmpb %cl, %al
je 0x172c5
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x1732a
movq 0x18(%rbx), %rdx
movq 0x58(%rbx), %rsi
callq 0x17341
testl %eax, %eax
je 0x172c5
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x16bb7
// File: /workspace/github_c_makefile_star2_O3/lh3[P]bgt/bgt.c
// Function: bgt_read_rec
int bgt_read_rec(bgt_t *bgt, bgt_rec_t *r)
{
	int row;
	const uint8_t **a;
	r->b0 = 0, r->a[0] = r->a[1] = 0;
	if (bgt->n_out == 0) return -1;
	if ((row = bgt_read_core(bgt)) < 0) return row;
	r->b0 = bgt->b0;
	pbf_seek(bgt->pb, row);
	a = pbf_read(bgt->pb);
	r->a[0] = (uint8_t*)a[0], r->a[1] = (uint8_t*)a[1];
	return row;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
cmpl $0x0, 0x34(%rdi)
je 0x17624
movq %rsi, %rbx
movq %rdi, %r14
callq 0x172b1
movl %eax, %ebp
testl %eax, %eax
js 0x17629
movq 0x18(%r14), %rax
movq %rax, (%rbx)
movq 0x8(%r14), %rdi
movl %ebp, %esi
callq 0x15d78
movq 0x8(%r14), %rdi
callq 0x15c27
movq (%rax), %rcx
movq %rcx, 0x8(%rbx)
movq 0x8(%rax), %rax
movq %rax, 0x10(%rbx)
jmp 0x17629
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]bgt/bgt.c
// Function: bgt_read
int bgt_read(bgt_t *bgt, bcf1_t *b)
{
	int ret;
	bgt_rec_t r;
	if (bgt->h_out == 0) bgt_prepare(bgt);
	if ((ret = bgt_read_rec(bgt, &r)) < 0) return ret;
	bcfcpy(b, r.b0);
	bgt_gen_gt(bgt->h_out, b, bgt->n_out, r.a, 0);
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
cmpq $0x0, 0x58(%rdi)
jne 0x1764f
movq %r14, %rdi
callq 0x16816
movq %rsp, %rsi
movq %r14, %rdi
callq 0x175cf
movl %eax, %ebp
testl %eax, %eax
js 0x17687
leaq 0x8(%rsp), %r15
movq -0x8(%r15), %rsi
movq %rbx, %rdi
callq 0x110c7
movq 0x58(%r14), %rdi
movl 0x34(%r14), %edx
movq %rbx, %rsi
movq %r15, %rcx
xorl %r8d, %r8d
callq 0x16cc3
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]bgt/bgt.c
// Function: bgtm_reader_init
bgtm_t *bgtm_reader_init(int n_files, bgt_file_t *const* bf)
{
	bgtm_t *bm;
	int i;
	bm = (bgtm_t*)calloc(1, sizeof(bgtm_t));
	bm->n_bgt = n_files;
	bm->bgt = (bgt_t**)calloc(bm->n_bgt, sizeof(void*));
	for (i = 0; i < bm->n_bgt; ++i)
		bm->bgt[i] = bgt_reader_init(bf[i]);
	bm->r = (bgt_rec_t*)calloc(bm->n_bgt, sizeof(bgt_rec_t));
	return bm;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebp
movl $0x1, %edi
movl $0xb8, %esi
callq 0x2220
movq %rax, %rbx
movl %ebp, (%rax)
movslq %ebp, %r15
movl $0x8, %esi
movq %r15, %rdi
callq 0x2220
movq %rax, 0x38(%rbx)
testl %r15d, %r15d
jle 0x176ee
movq %rax, %r12
movl %ebp, %r13d
xorl %ebp, %ebp
movq (%r14,%rbp,8), %rdi
callq 0x16407
movq %rax, (%r12,%rbp,8)
incq %rbp
cmpq %rbp, %r13
jne 0x176d9
movl $0x18, %esi
movq %r15, %rdi
callq 0x2220
movq %rax, 0x40(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]bgt/bgt.c
// Function: bgtm_reader_destroy
void bgtm_reader_destroy(bgtm_t *bm)
{
	int i;
	free(bm->hap);
	free(bm->alcnt);
	if (bm->site_flt) ke_destroy(bm->site_flt);
	free(bm->mgs);
	free(bm->group);
	free(bm->sample_idx);
	if (bm->h_out) bcf_hdr_destroy(bm->h_out);
	free(bm->a[0]); free(bm->a[1]);
	for (i = 0; i < bm->n_aal; ++i) free(bm->aal[i].chr.s);
	free(bm->aal);
	for (i = 0; i < bm->n_fields; ++i)
		ke_destroy(bm->fields[i]);
	free(bm->fields);
	free(bm->tbl_line.s);
	for (i = 0; i < bm->n_bgt; ++i)
		bgt_reader_destroy(bm->bgt[i]);
	if (bm->h_al) {
		khint_t k;
		khash_t(str) *h = (khash_t(str)*)bm->h_al;
		for (k = 0; k < kh_end(h); ++k)
			if (kh_exist(h, k)) free((char*)kh_key(h, k));
		kh_destroy(str, h);
	}
	free(bm->r); free(bm->bgt); free(bm);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xb0(%rdi), %rdi
callq 0x2050
movq 0xa8(%rbx), %rdi
callq 0x2050
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0x17742
callq 0x1d0fd
movq 0x28(%rbx), %rdi
callq 0x2050
movq 0x20(%rbx), %rdi
callq 0x2050
movq 0x18(%rbx), %rdi
callq 0x2050
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x1776b
callq 0xb980
movq 0x58(%rbx), %rdi
callq 0x2050
movq 0x60(%rbx), %rdi
callq 0x2050
cmpl $0x0, 0x90(%rbx)
jle 0x177b2
movl $0x10, %r14d
xorl %r15d, %r15d
movq 0x98(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x2050
incq %r15
movslq 0x90(%rbx), %rax
addq $0x30, %r14
cmpq %rax, %r15
jl 0x1778f
movq 0x98(%rbx), %rdi
callq 0x2050
cmpl $0x0, 0x68(%rbx)
jle 0x177e0
xorl %r14d, %r14d
movq 0x70(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x1d0fd
incq %r14
movslq 0x68(%rbx), %rax
cmpq %rax, %r14
jl 0x177c7
movq 0x70(%rbx), %rdi
callq 0x2050
movq 0x88(%rbx), %rdi
callq 0x2050
cmpl $0x0, (%rbx)
jle 0x17815
xorl %r14d, %r14d
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x164ce
incq %r14
movslq (%rbx), %rax
cmpq %rax, %r14
jl 0x177fd
movq 0xa0(%rbx), %r14
testq %r14, %r14
je 0x1788a
movl (%r14), %eax
testl %eax, %eax
je 0x17867
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x10(%r14), %rcx
movq %r12, %rdx
shrq $0x4, %rdx
movl (%rcx,%rdx,4), %edx
movl %r15d, %ecx
andb $0x1e, %cl
shrl %cl, %edx
testb $0x3, %dl
jne 0x17859
movq 0x18(%r14), %rax
movq (%rax,%r12,8), %rdi
callq 0x2050
movl (%r14), %eax
incq %r12
movl %eax, %ecx
addl $0x2, %r15d
cmpq %rcx, %r12
jb 0x1782e
movq 0x18(%r14), %rdi
callq 0x2050
movq 0x10(%r14), %rdi
callq 0x2050
movq 0x20(%r14), %rdi
callq 0x2050
movq %r14, %rdi
callq 0x2050
movq 0x40(%rbx), %rdi
callq 0x2050
movq 0x38(%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_O3/lh3[P]bgt/bgt.c
// Function: bgtm_add_group
int bgtm_add_group(bgtm_t *bm, const char *expr)
{
	int i, ret = 0, size = 0;
	for (i = 0; i < bm->n_bgt; ++i)
		if ((ret = bgt_add_group(bm->bgt[i], expr)) < 0) break;
		else size += ret;
	if (i == bm->n_bgt) ++bm->n_groups; // TODO: revert bm->bgt[i]->n_groups
	return i == bm->n_bgt? size : ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdi), %ecx
testl %ecx, %ecx
jle 0x178ec
movq %rsi, %r14
xorl %r15d, %r15d
xorl %ebp, %ebp
movq 0x38(%rbx), %rax
movq (%rax,%r15,8), %rdi
movq %r14, %rsi
callq 0x166db
movl (%rbx), %ecx
testl %eax, %eax
js 0x178f3
movslq %ecx, %rdx
addl %eax, %ebp
incq %r15
cmpq %rdx, %r15
jl 0x178c7
jmp 0x178f3
xorl %r15d, %r15d
xorl %ebp, %ebp
xorl %eax, %eax
cmpl %ecx, %r15d
jne 0x178fd
incl 0x8(%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]bgt/bgt.c
// Function: bgtm_set_region
int bgtm_set_region(bgtm_t *bm, const char *reg)
{
	int i, ret = 0;
	for (i = 0; i < bm->n_bgt; ++i)
		if ((ret = bgt_set_region(bm->bgt[i], reg)) < 0)
			break;
	return ret;
}

// Assembly:
cmpl $0x0, (%rdi)
jle 0x1793e
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movq 0x38(%r14), %rax
movq (%rax,%r15,8), %rdi
movq %rbx, %rsi
callq 0x167a7
testl %eax, %eax
js 0x17941
incq %r15
movslq (%r14), %rax
cmpq %rax, %r15
jl 0x1791b
xorl %eax, %eax
jmp 0x17946
xorl %eax, %eax
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]bgt/bgt.c
// Function: bgtm_set_start
int bgtm_set_start(bgtm_t *bm, int64_t n)
{
	int i;
	for (i = 0; i < bm->n_bgt; ++i)
		bgt_set_start(bm->bgt[i], n);
	return 0;
}

// Assembly:
cmpl $0x0, (%rdi)
jle 0x1798a
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movq 0x38(%r14), %rax
movq (%rax,%r15,8), %rax
movq (%rax), %rcx
movq 0x10(%rax), %rdi
movq 0x18(%rcx), %rsi
movq %rbx, %rdx
callq 0x115c0
incq %r15
movslq (%r14), %rax
cmpq %rax, %r15
jl 0x1795f
popq %rbx
popq %r14
popq %r15
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]bgt/bgt.c
// Function: bgtm_set_flt_site
int bgtm_set_flt_site(bgtm_t *bm, const char *expr)
{
	int err;
	if (bm->site_flt) ke_destroy(bm->site_flt);
	bm->site_flt = ke_parse(expr, &err);
	if (err != 0) {
		if (bm->site_flt) ke_destroy(bm->site_flt);
		bm->site_flt = 0;
		return err;
	}
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x48(%rdi), %rdi
testq %rdi, %rdi
je 0x179d1
callq 0x1d0fd
leaq 0xc(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x1bb84
movq %rax, %rdi
movq %rax, 0x48(%rbx)
movl (%r15), %eax
testl %eax, %eax
je 0x17a07
testq %rdi, %rdi
je 0x179fd
callq 0x1d0fd
movl 0xc(%rsp), %eax
movq $0x0, 0x48(%rbx)
jmp 0x17a09
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]bgt/bgt.c
// Function: bgtm_set_mgs
int bgtm_set_mgs(bgtm_t *bm, int mgs_def)
{
	int i;
	for (i = 0; i < bm->n_bgt; ++i) bm->bgt[i]->mgs_def = mgs_def;
	bm->mgs_def = mgs_def;
	return 0;
}

// Assembly:
movslq (%rdi), %rax
testq %rax, %rax
jle 0x17a31
movq 0x38(%rdi), %rcx
xorl %edx, %edx
movq (%rcx,%rdx,8), %r8
movl %esi, 0x3c(%r8)
incq %rdx
cmpq %rdx, %rax
jne 0x17a21
movl %esi, 0x30(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]bgt/bgt.c
// Function: bgt_parse_fields
kexpr_t **bgt_parse_fields(const char *str, int *_n)
{
	int m = 0, n = 0, n_par = 0, i;
	char **s = 0;
	const char *q, *p;
	kexpr_t **e = 0;
	*_n = 0;
	for (q = p = str;; ++p) {
		if (*p == '(') ++n_par;
		else if (*p == ')') --n_par;
		else if (*p == 0 || (*p == ',' && n_par == 0)) {
			if (m == n) {
				m = m? m<<1 : 16;
				s = (char**)realloc(s, m * sizeof(void*));
			}
			s[n] = (char*)calloc(p - q + 1, 1);
			strncpy(s[n++], q, p - q);
			q = p + 1;
			if (*p == 0) break;
		}
	}
	if (n_par == 0) {
		e = (kexpr_t**)calloc(n, sizeof(kexpr_t*));
		for (i = m = 0; i < n; ++i) {
			int err, j;
			e[i] = ke_parse(s[i], &err);
			if (err) {
				for (j = 0; j <= i; ++j)
					ke_destroy(e[j]);
				break;
			}
		}
		if (i < n) {
			free(e);
			e = 0, *_n = 0;
		} else *_n = n;
	}
	for (i = 0; i < n; ++i) free(s[i]);
	free(s);
	return e;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r15
movq %rsi, 0x20(%rsp)
movl $0x0, (%rsi)
leaq 0x1(%rdi), %r12
xorl %edx, %edx
xorl %ebp, %ebp
xorl %esi, %esi
movq $0x0, 0x8(%rsp)
movq %rdi, %rbx
movzbl -0x1(%r12), %eax
testl %eax, %eax
je 0x18a98
cmpl $0x29, %eax
je 0x18a7c
cmpl $0x28, %eax
jne 0x18a83
incl %esi
jmp 0x18b21
decl %esi
jmp 0x18b21
cmpb $0x2c, %al
sete %al
testl %esi, %esi
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x18b21
movl %esi, 0x10(%rsp)
cmpl %ebp, %edx
jne 0x18ad0
movq %rbp, %r13
leal (%rdx,%rdx), %ebp
testl %edx, %edx
movl $0x10, %eax
cmovel %eax, %ebp
movslq %ebp, %rsi
shlq $0x3, %rsi
movq 0x8(%rsp), %rdi
callq 0x2330
movq %rax, %r14
movl %ebp, %eax
movq %rax, 0x18(%rsp)
movq %r13, %rbp
jmp 0x18ada
movq %rdx, 0x18(%rsp)
movq 0x8(%rsp), %r14
movq %r15, %r13
subq %rbx, %r13
leaq 0x1(%r13), %rdi
movl $0x1, %esi
callq 0x2220
movslq %ebp, %rcx
movq %r14, 0x8(%rsp)
movq %rax, (%r14,%rcx,8)
movq %rbp, %r14
incl %ebp
movq %rax, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x2080
cmpb $0x0, -0x1(%r12)
je 0x18b2c
movq %r12, %rbx
movq 0x18(%rsp), %rdx
movl 0x10(%rsp), %esi
incq %r12
incq %r15
jmp 0x18a61
movq %r14, %r13
cmpl $0x0, 0x10(%rsp)
je 0x18b40
xorl %r15d, %r15d
movq 0x8(%rsp), %r12
jmp 0x18bb9
movslq %ebp, %rdi
movl $0x8, %esi
callq 0x2220
movq %rax, %r15
testl %r13d, %r13d
js 0x18b83
movl %ebp, %r14d
xorl %ebx, %ebx
leaq 0x14(%rsp), %r12
movq 0x8(%rsp), %rax
movq (%rax,%rbx,8), %rdi
movq %r12, %rsi
callq 0x1bb84
movq %rax, (%r15,%rbx,8)
cmpl $0x0, 0x14(%rsp)
jne 0x18b87
incq %rbx
cmpq %rbx, %r14
jne 0x18b5f
movl %ebp, %eax
jmp 0x18bad
movq $-0x1, %r14
movq 0x8(%r15,%r14,8), %rdi
callq 0x1d0fd
incq %r14
cmpq %r14, %rbx
jne 0x18b8e
movq %r15, %rdi
callq 0x2050
xorl %eax, %eax
xorl %r15d, %r15d
movq 0x8(%rsp), %r12
movq 0x20(%rsp), %rcx
movl %eax, (%rcx)
testl %r13d, %r13d
js 0x18bd4
movl %ebp, %ebx
xorl %r14d, %r14d
movq (%r12,%r14,8), %rdi
callq 0x2050
incq %r14
cmpq %r14, %rbx
jne 0x18bc3
movq %r12, %rdi
callq 0x2050
movq %r15, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]bgt/bgt.c
// Function: bgtm_test_mgs
int bgtm_test_mgs(const bgtm_t *bm)
{
	int i, cnt[BGT_MAX_GROUPS];
	memset(cnt, 0, BGT_MAX_GROUPS * sizeof(int));
	for (i = 0; i < bm->n_out; ++i)
		++cnt[bm->group[i]-1];
	for (i = 0; i < bm->n_out; ++i)
		if (bm->mgs[i] > cnt[bm->group[i]-1])
			return 0;
	return 1;
}

// Assembly:
pushq %rax
xorps %xmm0, %xmm0
movaps %xmm0, -0x10(%rsp)
movaps %xmm0, -0x20(%rsp)
movaps %xmm0, -0x30(%rsp)
movaps %xmm0, -0x40(%rsp)
movaps %xmm0, -0x50(%rsp)
movaps %xmm0, -0x60(%rsp)
movaps %xmm0, -0x70(%rsp)
movaps %xmm0, -0x80(%rsp)
movslq 0x4(%rdi), %rcx
movl $0x1, %eax
testq %rcx, %rcx
jle 0x199ec
movq 0x20(%rdi), %rdx
xorl %esi, %esi
movl (%rdx,%rsi,4), %r8d
decl %r8d
incl -0x80(%rsp,%r8,4)
incq %rsi
cmpq %rsi, %rcx
jne 0x199ac
testl %ecx, %ecx
jle 0x199ec
movq 0x20(%rdi), %rdx
movq 0x28(%rdi), %rsi
xorl %edi, %edi
movl (%rsi,%rdi,4), %r8d
movl (%rdx,%rdi,4), %r9d
decl %r9d
cmpl -0x80(%rsp,%r9,4), %r8d
jg 0x199ea
incq %rdi
cmpq %rdi, %rcx
jne 0x199ce
jmp 0x199ec
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]bgt/bgt.c
// Function: bgtm_assign_expr
void bgtm_assign_expr(kexpr_t *e, const bgt_info_t *ss)
{
	int i;
	char key[5];
	ke_set_int(e, "AN", ss->an);
	ke_set_int(e, "AC", ss->ac[0]);
	for (i = 0; i < ss->n_groups; ++i) {
		ke_set_int(e, gen_group_key(key, 'N', i), ss->gan[i]);
		ke_set_int(e, gen_group_key(key, 'C', i), ss->gac[i][0]);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x8(%rsi), %rdx
leaq 0x6274(%rip), %rsi      # 0x1fc7e
callq 0x1d157
movslq (%rbx), %rdx
leaq 0x6268(%rip), %rsi      # 0x1fc81
movq %r14, %rdi
callq 0x1d157
cmpl $0x0, 0xc(%rbx)
jle 0x19aec
xorl %r13d, %r13d
leaq 0x3(%rsp), %r15
movl $0xcccccccd, %r12d      # imm = 0xCCCCCCCD
movw $0x4e41, 0x3(%rsp)      # imm = 0x4E41
cmpq $0x8, %r13
ja 0x19a4e
leal 0x31(%r13), %ecx
xorl %eax, %eax
jmp 0x19a6e
leal 0x1(%r13), %eax
movq %rax, %rdx
imulq %r12, %rdx
shrq $0x23, %rdx
leal 0x30(%rdx), %ecx
addl %edx, %edx
leal (%rdx,%rdx,4), %edx
subl %edx, %eax
orb $0x30, %al
movb $0x0, 0x7(%rsp)
movb %cl, 0x5(%rsp)
movb %al, 0x6(%rsp)
movslq 0x10(%rbx,%r13,4), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x1d157
movw $0x4341, 0x3(%rsp)      # imm = 0x4341
cmpq $0x8, %r13
ja 0x19a9f
leal 0x31(%r13), %eax
leaq 0x1(%r13), %rbp
xorl %ecx, %ecx
jmp 0x19ac1
leaq 0x1(%r13), %rbp
movl %ebp, %ecx
imulq %r12, %rcx
shrq $0x23, %rcx
leal 0x30(%rcx), %eax
addl %ecx, %ecx
leal (%rcx,%rcx,4), %edx
movl %ebp, %ecx
subl %edx, %ecx
orb $0x30, %cl
movb $0x0, 0x7(%rsp)
movb %al, 0x5(%rsp)
movb %cl, 0x6(%rsp)
movslq 0x90(%rbx,%r13,8), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x1d157
movslq 0xc(%rbx), %rax
movq %rbp, %r13
cmpq %rax, %rbp
jl 0x19a39
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]bgt/bgt.c
// Function: bgtm_pass_site_flt
int bgtm_pass_site_flt(const bgt_info_t *ss, kexpr_t *flt)
{
	int is_true, err;
	if (flt == 0) return 1;
	bgtm_assign_expr(flt, ss);
	is_true = !!ke_eval_int(flt, &err);
	return err? 0 : is_true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
testq %rsi, %rsi
je 0x19b36
movq %rdi, %rsi
movq %rbx, %rdi
callq 0x199ee
leaq 0x4(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1d095
testq %rax, %rax
setne %al
cmpl $0x0, (%r14)
sete %cl
andb %al, %cl
movzbl %cl, %eax
jmp 0x19b3b
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]bgt/bgt.c
// Function: bgtm_fill_info
void bgtm_fill_info(const bcf_hdr_t *h, const bgt_info_t *ss, bcf1_t *b)
{
	bcf_append_info_ints(h, b, "AN", 1, &ss->an);
	bcf_append_info_ints(h, b, "AC", b->n_allele - 1, ss->ac);
	if (ss->n_groups > 1) {
		int i;
		char key[5];
		for (i = 0; i < ss->n_groups; ++i) {
			bcf_append_info_ints(h, b, gen_group_key(key, 'N', i), 1, &ss->gan[i]);
			bcf_append_info_ints(h, b, gen_group_key(key, 'C', i), b->n_allele - 1, ss->gac[i]);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8(%rsi), %r8
leaq 0x6119(%rip), %rdx      # 0x1fc7e
movq %rbx, %rsi
movl $0x1, %ecx
callq 0x1156b
movzwl 0x12(%rbx), %ecx
decl %ecx
leaq 0x6102(%rip), %rdx      # 0x1fc81
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %r8
callq 0x1156b
cmpl $0x2, 0xc(%r14)
jl 0x19c88
leaq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
leaq 0x90(%r14), %rax
movq %rax, 0x8(%rsp)
xorl %r13d, %r13d
leaq 0x3(%rsp), %r12
movw $0x4e41, 0x3(%rsp)      # imm = 0x4E41
cmpq $0x8, %r13
ja 0x19bca
leal 0x31(%r13), %ecx
xorl %eax, %eax
jmp 0x19bef
leal 0x1(%r13), %eax
movq %rax, %rdx
movl $0xcccccccd, %ecx       # imm = 0xCCCCCCCD
imulq %rcx, %rdx
shrq $0x23, %rdx
leal 0x30(%rdx), %ecx
addl %edx, %edx
leal (%rdx,%rdx,4), %edx
subl %edx, %eax
orb $0x30, %al
movb $0x0, 0x7(%rsp)
movb %cl, 0x5(%rsp)
movb %al, 0x6(%rsp)
movq 0x10(%rsp), %rax
leaq (%rax,%r13,4), %r8
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movl $0x1, %ecx
callq 0x1156b
movw $0x4341, 0x3(%rsp)      # imm = 0x4341
cmpq $0x8, %r13
ja 0x19c2c
leal 0x31(%r13), %eax
leaq 0x1(%r13), %rbp
xorl %ecx, %ecx
jmp 0x19c53
leaq 0x1(%r13), %rbp
movl %ebp, %ecx
movl $0xcccccccd, %eax       # imm = 0xCCCCCCCD
imulq %rax, %rcx
shrq $0x23, %rcx
leal 0x30(%rcx), %eax
addl %ecx, %ecx
leal (%rcx,%rcx,4), %edx
movl %ebp, %ecx
subl %edx, %ecx
orb $0x30, %cl
movb $0x0, 0x7(%rsp)
movb %al, 0x5(%rsp)
movb %cl, 0x6(%rsp)
movzwl 0x12(%rbx), %ecx
decl %ecx
movq 0x8(%rsp), %rax
leaq (%rax,%r13,8), %r8
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x1156b
movslq 0xc(%r14), %rax
movq %rbp, %r13
cmpq %rax, %rbp
jl 0x19bb5
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]bgt/bgt.c
// Function: bgtm_cal_info
void bgtm_cal_info(const bgtm_t *bm, bgt_info_t *ss)
{
	int32_t cnt[4], i;
	memset(cnt, 0, 4 * 4);
	ss->n_groups = bm->n_groups;
	if (bm->n_groups > 1) {
		int32_t j, gcnt[BGT_MAX_GROUPS][4];
		memset(gcnt, 0, 4 * BGT_MAX_GROUPS * 4);
		for (i = 0; i < bm->n_out<<1; ++i)
			++gcnt[bm->group[i>>1]-1][bm->a[1][i]<<1 | bm->a[0][i]];
		for (i = 0; i < bm->n_groups; ++i) {
			ss->gan[i] = gcnt[i][0] + gcnt[i][1] + gcnt[i][3];
			ss->gac[i][0] = gcnt[i][1];
			ss->gac[i][1] = gcnt[i][3];
			for (j = 0; j < 4; ++j) cnt[j] += gcnt[i][j];
		}
	} else {
		for (i = 0; i < bm->n_out<<1; ++i)
			++cnt[bm->a[1][i]<<1 | bm->a[0][i]];
	}
	ss->an = cnt[0] + cnt[1] + cnt[3];
	ss->ac[0] = cnt[1], ss->ac[1] = cnt[3];
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rsi, %rbx
movq %rdi, %r14
pxor %xmm0, %xmm0
movdqa %xmm0, (%rsp)
movl 0x8(%rdi), %eax
movl %eax, 0xc(%rsi)
cmpl $0x1, %eax
jle 0x19d73
leaq 0x10(%rsp), %rdi
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x21e0
movl 0x4(%r14), %esi
addl %esi, %esi
testl %esi, %esi
jle 0x19d23
movq 0x20(%r14), %rax
movq 0x58(%r14), %rcx
movq 0x60(%r14), %rdx
movl %esi, %esi
xorl %edi, %edi
movl %edi, %r8d
shrl %r8d
movl (%rax,%r8,4), %r8d
decl %r8d
movzbl (%rdx,%rdi), %r9d
movzbl (%rcx,%rdi), %r10d
shll $0x2, %r10d
shll $0x3, %r9d
orl %r10d, %r9d
shlq $0x4, %r8
addq %rsp, %r8
addq $0x10, %r8
incl (%r9,%r8)
incq %rdi
cmpq %rdi, %rsi
jne 0x19cea
movl $0x94, %eax
movdqa (%rsp), %xmm0
xorl %ecx, %ecx
movl -0x114(%rsp,%rax,2), %edx
movl -0x10c(%rsp,%rax,2), %esi
movl -0x118(%rsp,%rax,2), %edi
addl %edx, %edi
addl %esi, %edi
movl %edi, 0x10(%rbx,%rcx,4)
movl %edx, -0x4(%rbx,%rax)
movl %esi, (%rbx,%rax)
paddd -0x118(%rsp,%rax,2), %xmm0
incq %rcx
movslq 0x8(%r14), %rdx
addq $0x8, %rax
cmpq %rdx, %rcx
jl 0x19d2f
movdqa %xmm0, (%rsp)
jmp 0x19da7
movl 0x4(%r14), %edx
addl %edx, %edx
testl %edx, %edx
jle 0x19da7
movq 0x58(%r14), %rax
movq 0x60(%r14), %rcx
movl %edx, %edx
xorl %esi, %esi
movzbl (%rcx,%rsi), %edi
movzbl (%rax,%rsi), %r8d
shll $0x2, %r8d
shll $0x3, %edi
orl %r8d, %edi
incl (%rsp,%rdi)
incq %rsi
cmpq %rsi, %rdx
jne 0x19d89
movl 0x4(%rsp), %eax
movl 0xc(%rsp), %ecx
movl (%rsp), %edx
addl %eax, %edx
addl %ecx, %edx
movl %edx, 0x8(%rbx)
movl %eax, (%rbx)
movl %ecx, 0x4(%rbx)
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]bgt/bgt.c
// Function: bgtm_assign_by_bcf
void bgtm_assign_by_bcf(kexpr_t *e, const bcf_hdr_t *h, const bcf1_t *b)
{
	int l_ref, l_alt, max_l;
	char *ref, *alt, *tmp;
	ke_set_str(e, "CHROM", h->id[BCF_DT_CTG][b->rid].key);
	ke_set_int(e, "POS", b->pos + 1);
	ke_set_int(e, "END", b->pos + b->rlen);
	bcf_get_ref_alt1(b, &l_ref, &ref, &l_alt, &alt);
	max_l = l_ref > l_alt? l_ref : l_alt;
	tmp = (char*)alloca(max_l + 1);
	strncpy(tmp, ref, l_ref); tmp[l_ref] = 0;
	ke_set_str(e, "REF", tmp);
	strncpy(tmp, alt, l_alt); tmp[l_alt] = 0;
	ke_set_str(e, "ALT", tmp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r12
movq %rdi, %rbx
movq 0x20(%rsi), %rax
movslq (%rdx), %rcx
shlq $0x4, %rcx
movq (%rax,%rcx), %rdx
leaq 0x5e8e(%rip), %rsi      # 0x1fc84
callq 0x1d2ec
movslq 0x4(%r12), %rdx
incq %rdx
leaq 0x5e80(%rip), %rsi      # 0x1fc8a
movq %rbx, %rdi
callq 0x1d157
movslq 0x4(%r12), %rax
movslq 0x8(%r12), %rdx
addq %rax, %rdx
leaq 0x5600(%rip), %rsi      # 0x1f426
movq %rbx, %rdi
callq 0x1d157
leaq -0x38(%rbp), %r13
leaq -0x40(%rbp), %r15
leaq -0x34(%rbp), %r14
leaq -0x30(%rbp), %r8
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x1127d
movslq (%r13), %r13
movl (%r14), %eax
cmpl %eax, %r13d
cmovgl %r13d, %eax
cltq
addq $0x10, %rax
andq $-0x10, %rax
movq %rsp, %r12
subq %rax, %r12
movq %r12, %rsp
movq (%r15), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x2080
xorl %r15d, %r15d
movb %r15b, (%r13,%r12)
leaq 0x5e01(%rip), %rsi      # 0x1fc8e
movq %rbx, %rdi
movq %r12, %rdx
callq 0x1d2ec
leaq -0x30(%rbp), %rax
movq (%rax), %rsi
movslq (%r14), %r14
movq %r12, %rdi
movq %r14, %rdx
callq 0x2080
movb %r15b, (%r14,%r12)
leaq 0x5dda(%rip), %rsi      # 0x1fc92
movq %rbx, %rdi
movq %r12, %rdx
callq 0x1d2ec
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]bgt/bgt.c
// Function: bgtm_read
int bgtm_read(bgtm_t *bm, bcf1_t *b)
{
	int ret;
	if (bm->h_out == 0) bgtm_prepare(bm);
	while ((ret = bgtm_read_core(bm, b)) > 0);
	if ((bm->flag & BGT_F_NO_GT) == 0)
		bgt_gen_gt(bm->h_out, b, bm->n_out, (const uint8_t**)bm->a, bm->mgs);
	return ret;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
cmpq $0x0, 0x50(%rdi)
jne 0x1aae0
movq %rbx, %rdi
callq 0x18c11
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1a27a
testl %eax, %eax
jg 0x1aae0
movl %eax, %ebp
testb $0x2, 0xc(%rbx)
jne 0x1ab11
movq 0x50(%rbx), %rdi
movl 0x4(%rbx), %edx
movq 0x28(%rbx), %r8
addq $0x58, %rbx
movq %r14, %rsi
movq %rbx, %rcx
callq 0x16cc3
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]bgt/bgt.c
// Function: bgtm_alcnt_print
char *bgtm_alcnt_print(const bgtm_t *bm)
{
	int i;
	kstring_t s = {0,0,0};
	for (i = 0; i < bm->n_out; ++i) {
		if (bm->alcnt[i] == bm->n_aal) {
			bgt_t *bgt = bm->bgt[bm->sample_idx[i]>>32];
			if (bm->mgs[i] > 1) continue;
			ksprintf(&s, "SP\t%s\t%d\n", bgt->f->f->rows[(uint32_t)bm->sample_idx[i]].name, (int)(bm->sample_idx[i]>>32) + 1);
		}
	}
	return s.s;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movl 0x4(%rdi), %eax
testl %eax, %eax
jle 0x1ba1f
movq %rdi, %rbx
leaq 0x4352(%rip), %r14      # 0x1fd00
movq %rsp, %r15
xorl %r12d, %r12d
movq 0xa8(%rbx), %rcx
movl (%rcx,%r12,4), %ecx
cmpl 0x90(%rbx), %ecx
jne 0x1ba0d
movq 0x28(%rbx), %rcx
cmpl $0x1, (%rcx,%r12,4)
jg 0x1ba0d
movq 0x18(%rbx), %rax
movq 0x38(%rbx), %rdx
movq (%rax,%r12,8), %rcx
movl %ecx, %eax
shrq $0x20, %rcx
movq (%rdx,%rcx,8), %rdx
movq (%rdx), %rdx
movq 0x8(%rdx), %rdx
movq 0x28(%rdx), %rdx
leaq (%rax,%rax,2), %rax
movq (%rdx,%rax,8), %rdx
incl %ecx
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x19831
movl 0x4(%rbx), %eax
incq %r12
movslq %eax, %rcx
cmpq %rcx, %r12
jl 0x1b9b4
movq 0x10(%rsp), %rax
jmp 0x1ba21
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]bgt/kexpr.c
// Function: ke_destroy
void ke_destroy(kexpr_t *ke)
{
	int i;
	if (ke == 0) return;
	for (i = 0; i < ke->n; ++i) {
		free(ke->e[i].name);
		free(ke->e[i].s);
	}
	free(ke->e); free(ke);
}

// Assembly:
testq %rdi, %rdi
je 0x1d156
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, (%rdi)
jle 0x1d140
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x8(%rbx), %rax
movq 0x8(%rax,%r14), %rdi
callq 0x2050
movq 0x8(%rbx), %rax
movq 0x28(%rax,%r14), %rdi
callq 0x2050
incq %r15
movslq (%rbx), %rax
addq $0x30, %r14
cmpq %rax, %r15
jl 0x1d115
movq 0x8(%rbx), %rdi
callq 0x2050
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2050
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]bgt/kexpr.c
// Function: ke_set_int
int ke_set_int(kexpr_t *ke, const char *var, int64_t y)
{
	int i, n = 0;
	double yy = (double)y;
	for (i = 0; i < ke->n; ++i) {
		ke1_t *e = &ke->e[i];
		if (e->ttype == KET_VAL && e->name && strcmp(e->name, var) == 0)
			e->i = y, e->r = yy, e->vtype = KEV_INT, e->assigned = 1, ++n;
	}
	return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, 0x20(%rsp)
movl (%rdi), %ebx
testl %ebx, %ebx
jle 0x1d1ff
movq %rdi, %r15
movq %rdx, 0x18(%rsp)
cvtsi2sd %rdx, %xmm0
movsd %xmm0, 0x10(%rsp)
xorl %r12d, %r12d
xorl %r13d, %r13d
movl $0x0, 0xc(%rsp)
movq 0x8(%r15), %rbp
movq (%rbp,%r12), %r14
cmpw $0x1, %r14w
jne 0x1d1ee
movq 0x8(%rbp,%r12), %rdi
testq %rdi, %rdi
je 0x1d1ee
movq 0x20(%rsp), %rsi
callq 0x2230
testl %eax, %eax
jne 0x1d1ee
movq 0x18(%rsp), %rax
movq %rax, 0x20(%rbp,%r12)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x18(%rbp,%r12)
andq $-0x7ffffff, %r14       # imm = 0xF8000001
orq $0x4020000, %r14        # imm = 0x4020000
movq %r14, (%rbp,%r12)
incl 0xc(%rsp)
movl (%r15), %ebx
incq %r13
movslq %ebx, %rax
addq $0x30, %r12
cmpq %rax, %r13
jl 0x1d195
jmp 0x1d207
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]bgt/kexpr.c
// Function: ke_set_real
int ke_set_real(kexpr_t *ke, const char *var, double x)
{
	int i, n = 0;
	int64_t xx = (int64_t)(x + .5);
	for (i = 0; i < ke->n; ++i) {
		ke1_t *e = &ke->e[i];
		if (e->ttype == KET_VAL && e->name && strcmp(e->name, var) == 0)
			e->r = x, e->i = xx, e->vtype = KEV_REAL, e->assigned = 1, ++n;
	}
	return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, 0x20(%rsp)
movl (%rdi), %r13d
testl %r13d, %r13d
jle 0x1d2d1
movq %rdi, %r14
movapd %xmm0, %xmm1
movsd 0x1bf8(%rip), %xmm0     # 0x1ee40
movsd %xmm1, 0x18(%rsp)
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movq %rax, 0x10(%rsp)
xorl %r12d, %r12d
xorl %r15d, %r15d
movl $0x0, 0xc(%rsp)
movq 0x8(%r14), %rbx
movq (%rbx,%r12), %rbp
cmpw $0x1, %bp
jne 0x1d2c0
movq 0x8(%rbx,%r12), %rdi
testq %rdi, %rdi
je 0x1d2c0
movq 0x20(%rsp), %rsi
callq 0x2230
testl %eax, %eax
jne 0x1d2c0
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x18(%rbx,%r12)
movq 0x10(%rsp), %rax
movq %rax, 0x20(%rbx,%r12)
andq $-0x7ffffff, %rbp       # imm = 0xF8000001
orq $0x4010000, %rbp        # imm = 0x4010000
movq %rbp, (%rbx,%r12)
incl 0xc(%rsp)
movl (%r14), %r13d
incq %r15
movslq %r13d, %rax
addq $0x30, %r12
cmpq %rax, %r15
jl 0x1d26a
jmp 0x1d2d9
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]bgt/kexpr.c
// Function: ke_set_str
int ke_set_str(kexpr_t *ke, const char *var, const char *x)
{
	int i, n = 0;
	for (i = 0; i < ke->n; ++i) {
		ke1_t *e = &ke->e[i];
		if (e->ttype == KET_VAL && e->name && strcmp(e->name, var) == 0) {
			if (e->vtype == KEV_STR) free(e->s);
			e->s = strdup(x);
			e->i = 0, e->r = 0., e->assigned = 1;
			e->vtype = KEV_STR;
			++n;
		}
	}
	return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
movl (%rdi), %ebx
testl %ebx, %ebx
jle 0x1d3ac
movq %rdi, %r15
xorl %r12d, %r12d
xorl %r13d, %r13d
movl $0x0, 0x4(%rsp)
movq 0x8(%r15), %rbp
movq (%rbp,%r12), %r14
cmpw $0x1, %r14w
jne 0x1d397
movq 0x8(%rbp,%r12), %rdi
testq %rdi, %rdi
je 0x1d397
movq 0x10(%rsp), %rsi
callq 0x2230
testl %eax, %eax
jne 0x1d397
movl %r14d, %eax
andl $0x3ff0000, %eax        # imm = 0x3FF0000
cmpl $0x30000, %eax          # imm = 0x30000
jne 0x1d365
movq 0x28(%rbp,%r12), %rdi
callq 0x2050
movq (%rbp,%r12), %r14
movq 0x8(%rsp), %rdi
callq 0x2420
movq %rax, 0x28(%rbp,%r12)
andq $-0x7ff0001, %r14       # imm = 0xF800FFFF
orq $0x4030000, %r14        # imm = 0x4030000
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rbp,%r12)
movq %r14, (%rbp,%r12)
incl 0x4(%rsp)
movl (%r15), %ebx
incq %r13
movslq %ebx, %rax
addq $0x30, %r12
cmpq %rax, %r13
jl 0x1d31f
jmp 0x1d3b4
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq