LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/hts.c
// Function: hts_idx_save
void hts_idx_save(const hts_idx_t *idx, const char *fn, int fmt)
{
	char *fnidx;
	fnidx = (char*)calloc(1, strlen(fn) + 5);
	strcpy(fnidx, fn);
	if (fmt == HTS_FMT_CSI) {
		BGZF *fp;
		uint32_t x[3];
		int is_be, i;
		is_be = ed_is_big();
		fp = bgzf_open(strcat(fnidx, ".csi"), "w");
		bgzf_write(fp, "CSI\1", 4);
		x[0] = idx->min_shift; x[1] = idx->n_lvls; x[2] = idx->l_meta;
		if (is_be) {
			for (i = 0; i < 3; ++i)
				bgzf_write(fp, ed_swap_4p(&x[i]), 4);
		} else bgzf_write(fp, &x, 12);
		if (idx->l_meta) bgzf_write(fp, idx->meta, idx->l_meta);
		hts_idx_save_core(idx, fp, HTS_FMT_CSI);
		bgzf_close(fp);
	} else if (fmt == HTS_FMT_TBI) {
		BGZF *fp;
		fp = bgzf_open(strcat(fnidx, ".tbi"), "w");
		bgzf_write(fp, "TBI\1", 4);
		hts_idx_save_core(idx, fp, HTS_FMT_TBI);
		bgzf_close(fp);
	} else if (fmt == HTS_FMT_BAI) {
		FILE *fp;
		fp = fopen(strcat(fnidx, ".bai"), "w");
		fwrite("BAI\1", 1, 4, fp);
		hts_idx_save_core(idx, fp, HTS_FMT_BAI);
		fclose(fp);
	} else abort();
	free(fnidx);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %rdi
callq 0x2150
leaq 0x5(%rax), %rsi
pushq $0x1
popq %rdi
callq 0x21f0
movq %rax, %rbx
movq %rax, %rdi
movq %r15, %rsi
callq 0x20a0
cmpl $0x2, %ebp
je 0x6562
cmpl $0x1, %ebp
je 0x650f
testl %ebp, %ebp
jne 0x65c3
movq %rbx, %rdi
callq 0x2150
movl $0x6973632e, (%rbx,%rax) # imm = 0x6973632E
movb $0x0, 0x4(%rbx,%rax)
leaq 0x5c75(%rip), %rsi      # 0xc127
movq %rbx, %rdi
callq 0x36d8
movq %rax, %r15
leaq 0x5ef4(%rip), %rsi      # 0xc3b8
pushq $0x4
popq %rdx
movq %rax, %rdi
callq 0x3eba
movq 0x4(%r14), %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movl 0x10(%r14), %eax
movl %eax, 0x8(%rsi)
pushq $0xc
popq %rdx
movq %r15, %rdi
callq 0x3eba
movl 0x10(%r14), %edx
testq %rdx, %rdx
je 0x6502
movq 0x38(%r14), %rsi
movq %r15, %rdi
callq 0x3eba
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
jmp 0x65a3
movq %rbx, %rdi
callq 0x2150
movl $0x6961622e, (%rbx,%rax) # imm = 0x6961622E
movb $0x0, 0x4(%rbx,%rax)
leaq 0x5bfd(%rip), %rsi      # 0xc127
movq %rbx, %rdi
callq 0x2360
movq %rax, %r15
leaq 0x5e90(%rip), %rdi      # 0xc3cc
pushq $0x1
popq %rsi
pushq $0x4
popq %rdx
movq %rax, %rcx
callq 0x23c0
pushq $0x1
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x65c8
movq %r15, %rdi
callq 0x2140
jmp 0x65b0
movq %rbx, %rdi
callq 0x2150
movl $0x6962742e, (%rbx,%rax) # imm = 0x6962742E
movb $0x0, 0x4(%rbx,%rax)
leaq 0x5baa(%rip), %rsi      # 0xc127
movq %rbx, %rdi
callq 0x36d8
movq %rax, %r15
leaq 0x5e33(%rip), %rsi      # 0xc3c2
pushq $0x4
popq %rdx
movq %rax, %rdi
callq 0x3eba
pushq $0x2
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x65c8
movq %r15, %rdi
callq 0x3fbb
movq %rbx, %rdi
callq 0x2050
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x2060
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/hts.c
// Function: hts_idx_set_meta
void hts_idx_set_meta(hts_idx_t *idx, int l_meta, uint8_t *meta, int is_copy)
{
	if (idx->meta) free(idx->meta);
	idx->l_meta = l_meta;
	if (is_copy) {
		idx->meta = (uint8_t*)malloc(l_meta);
		memcpy(idx->meta, meta, l_meta);
	} else idx->meta = meta;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %r15d
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movq 0x38(%rdi), %rdi
callq 0x2050
movl %ebp, 0x10(%r14)
testl %r15d, %r15d
je 0x6bc3
movslq %ebp, %r15
movq %r15, %rdi
callq 0x22a0
movq %rax, 0x38(%r14)
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2240
movq %rbx, 0x38(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/hts.c
// Function: hts_itr_querys
hts_itr_t *hts_itr_querys(const hts_idx_t *idx, const char *reg, hts_name2id_f getid, void *hdr)
{
	int tid, beg, end;
	char *q, *tmp;
	if (strcmp(reg, "*")) {
		q = (char*)hts_parse_reg(reg, &beg, &end);
		tmp = (char*)alloca(q - reg + 1);
		strncpy(tmp, reg, q - reg);
		tmp[q - reg] = 0;
		if ((tid = getid(hdr, tmp)) < 0)
			tid = getid(hdr, reg);
		if (tid < 0) return 0;
		return hts_itr_query(idx, tid, beg, end);
	} else return hts_itr_query(idx, HTS_IDX_NOCOOR, 0, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %r12
cmpb $0x2a, (%rsi)
jne 0x72b7
cmpb $0x0, 0x1(%r12)
je 0x7330
movq %rdi, -0x38(%rbp)
leaq -0x30(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
movq %r12, %rdi
callq 0x7100
movq %rax, %r13
subq %r12, %r13
leaq 0x10(%r13), %rax
andq $-0x10, %rax
movq %rsp, %rbx
subq %rax, %rbx
movq %rbx, %rsp
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x2080
movb $0x0, (%r13,%rbx)
movq %r15, %rdi
movq %rbx, %rsi
callq *%r14
testl %eax, %eax
jns 0x7310
movq %r15, %rdi
movq %r12, %rsi
callq *%r14
testl %eax, %eax
js 0x734a
movl -0x30(%rbp), %edx
movl -0x2c(%rbp), %ecx
movq -0x38(%rbp), %rdi
movl %eax, %esi
callq 0x6bdc
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x2
popq %rsi
xorl %edx, %edx
xorl %ecx, %ecx
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6bdc
xorl %eax, %eax
jmp 0x7321
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/hts.c
// Function: hts_itr_next
int hts_itr_next(BGZF *fp, hts_itr_t *iter, void *r, hts_readrec_f readrec, void *hdr)
{
	int ret, tid, beg, end;
	if (iter && iter->finished) return -1;
	if (iter->read_rest) {
		if (iter->curr_off) { // seek to the start
			bgzf_seek(fp, iter->curr_off, SEEK_SET);
			iter->curr_off = 0; // only seek once
		}
		ret = readrec(fp, hdr, r, &tid, &beg, &end);
		if (ret < 0) iter->finished = 1;
		return ret;
	}
	if (iter->off == 0) return -1;
	for (;;) {
		if (iter->curr_off == 0 || iter->curr_off >= iter->off[iter->i].v) { // then jump to the next chunk
			if (iter->i == iter->n_off - 1) { ret = -1; break; } // no more chunks
			if (iter->i < 0 || iter->off[iter->i].v != iter->off[iter->i+1].u) { // not adjacent chunks; then seek
				bgzf_seek(fp, iter->off[iter->i+1].u, SEEK_SET);
				iter->curr_off = bgzf_tell(fp);
			}
			++iter->i;
		}
		if ((ret = readrec(fp, hdr, r, &tid, &beg, &end)) >= 0) {
			iter->curr_off = bgzf_tell(fp);
			if (tid != iter->tid || beg >= iter->end) { // no need to proceed
				ret = -1; break;
			} else if (end > iter->beg && iter->end > beg) return ret;
		} else break; // end of file or error
	}
	iter->finished = 1;
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movl (%rsi), %ecx
pushq $-0x1
popq %rax
testb $0x2, %cl
jne 0x74a0
movq %r8, %r15
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r13
testb $0x1, %cl
jne 0x745e
cmpq $0x0, 0x20(%rbx)
je 0x74a0
movq 0x18(%rbx), %rcx
pushq $-0x1
popq %rbp
movl 0x14(%rbx), %eax
movslq %eax, %rdx
testq %rcx, %rcx
je 0x73b1
movq 0x20(%rbx), %rsi
movq %rdx, %rdi
shlq $0x4, %rdi
cmpq 0x8(%rsi,%rdi), %rcx
jb 0x740a
movl 0x10(%rbx), %ecx
decl %ecx
cmpl %ecx, %eax
je 0x749b
movq 0x20(%rbx), %rcx
testl %eax, %eax
js 0x73db
movq %rax, %rdx
shlq $0x4, %rdx
movq 0x10(%rcx,%rdx), %rsi
cmpq %rsi, 0x8(%rcx,%rdx)
jne 0x73e4
jmp 0x7405
shlq $0x4, %rdx
movq 0x10(%rcx,%rdx), %rsi
movq %r13, %rdi
xorl %edx, %edx
callq 0x41c7
movq 0x10(%r13), %rax
shlq $0x10, %rax
movzwl 0xc(%r13), %ecx
orq %rax, %rcx
movq %rcx, 0x18(%rbx)
movl 0x14(%rbx), %eax
incl %eax
movl %eax, 0x14(%rbx)
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
leaq 0x14(%rsp), %rcx
leaq 0x10(%rsp), %r8
leaq 0xc(%rsp), %r9
callq *%r14
testl %eax, %eax
js 0x7499
movq 0x10(%r13), %rdx
shlq $0x10, %rdx
movzwl 0xc(%r13), %ecx
orq %rdx, %rcx
movq %rcx, 0x18(%rbx)
movl 0x14(%rsp), %edx
cmpl 0x4(%rbx), %edx
jne 0x749b
movl 0x10(%rsp), %edx
cmpl 0xc(%rbx), %edx
jge 0x749b
movl 0xc(%rsp), %edx
cmpl 0x8(%rbx), %edx
jle 0x7394
jmp 0x74a0
movq 0x18(%rbx), %rsi
testq %rsi, %rsi
je 0x7476
movq %r13, %rdi
xorl %edx, %edx
callq 0x41c7
andq $0x0, 0x18(%rbx)
leaq 0x14(%rsp), %rcx
leaq 0x10(%rsp), %r8
leaq 0xc(%rsp), %r9
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *%r14
movl %eax, %ebp
testl %eax, %eax
jns 0x74a0
jmp 0x749b
movl %eax, %ebp
orb $0x2, (%rbx)
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/hts.c
// Function: hts_idx_getfn
char *hts_idx_getfn(const char *fn, const char *ext)
{
	int i, l_fn, l_ext;
	char *fnidx, *ret;
	l_fn = strlen(fn); l_ext = strlen(ext);
	fnidx = (char*)calloc(l_fn + l_ext + 1, 1);
	strcpy(fnidx, fn); strcpy(fnidx + l_fn, ext);
	if ((ret = test_and_fetch(fnidx)) == 0) {
		for (i = l_fn - 1; i >= 0; --i)
			if (fnidx[i] == '.') break;
		strcpy(fnidx + i, ext);
		ret = test_and_fetch(fnidx);
	}
	if (ret == 0) {
		free(fnidx);
		return 0;
	}
	l_fn = strlen(ret);
	memmove(fnidx, ret, l_fn + 1);
	return fnidx;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r12
callq 0x2150
movq %rax, %r15
movq %r14, %rdi
callq 0x2150
addl %r15d, %eax
incl %eax
movslq %eax, %rdi
pushq $0x1
popq %rsi
callq 0x21f0
movq %rax, %rbx
movq %rax, %rdi
movq %r12, %rsi
callq 0x20a0
movslq %r15d, %rdi
addq %rbx, %rdi
movq %r14, %rsi
callq 0x20a0
movq %rbx, %rdi
callq 0x759c
testq %rax, %rax
jne 0x754d
movl %r15d, %eax
movl %r15d, %ecx
sarl $0x1f, %ecx
andl %r15d, %ecx
decl %ecx
decq %rax
testl %r15d, %r15d
jle 0x752c
movl %eax, %edx
decl %r15d
decq %rax
cmpb $0x2e, (%rbx,%rdx)
jne 0x7517
jmp 0x752f
movl %ecx, %r15d
movslq %r15d, %rax
movq %rbx, %rdi
addq %rax, %rdi
movq %r14, %rsi
callq 0x20a0
movq %rbx, %rdi
callq 0x759c
testq %rax, %rax
je 0x7586
movq %rax, %r12
movabsq $0x100000000, %r14      # imm = 0x100000000
movq %rax, %rdi
callq 0x2150
shlq $0x20, %rax
addq %rax, %r14
sarq $0x20, %r14
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2320
movq %rbx, %rdi
callq 0x2050
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/hts.c
// Function: hts_idx_load
hts_idx_t *hts_idx_load(const char *fn, int fmt)
{
	char *fnidx;
	hts_idx_t *idx;
	fnidx = hts_idx_getfn(fn, ".csi");
	if (fnidx) fmt = HTS_FMT_CSI;
	else fnidx = hts_idx_getfn(fn, fmt == HTS_FMT_BAI? ".bai" : ".tbi");
	if (fnidx == 0) return 0;
	idx = hts_idx_load_direct(fnidx, fmt);
	free(fnidx);
	return idx;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r15
leaq 0x4d88(%rip), %rsi      # 0xc3b3
callq 0x74af
testq %rax, %rax
je 0x763c
movq %rax, %r14
xorl %ebx, %ebx
jmp 0x7661
cmpl $0x1, %ebx
leaq 0x4d81(%rip), %rax      # 0xc3c7
leaq 0x4d70(%rip), %rsi      # 0xc3bd
cmoveq %rax, %rsi
movq %r15, %rdi
callq 0x74af
movq %rax, %r14
testq %rax, %rax
je 0x767f
movq %r14, %rdi
movl %ebx, %esi
callq 0x67a6
movq %rax, %rbx
movq %r14, %rdi
callq 0x2050
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
xorl %eax, %eax
jmp 0x7679
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: bam_hdr_destroy
void bam_hdr_destroy(bam_hdr_t *h)
{
	int32_t i;
	if (h == 0) return;
	if (h->target_name) {
		for (i = 0; i < h->n_targets; ++i)
			free(h->target_name[i]);
		free(h->target_name);
		free(h->target_len);
	}
	free(h->text); free(h->cigar_tab);
	if (h->sdict) kh_destroy(s2i, (sdict_t*)h->sdict);
	free(h);
}

// Assembly:
testq %rdi, %rdi
je 0x7b50
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x20(%rdi)
je 0x7b21
xorl %r14d, %r14d
movslq (%rbx), %rax
movq 0x20(%rbx), %rdi
cmpq %rax, %r14
jge 0x7b13
movq (%rdi,%r14,8), %rdi
callq 0x2050
incq %r14
jmp 0x7af9
callq 0x2050
movq 0x10(%rbx), %rdi
callq 0x2050
movq 0x28(%rbx), %rdi
callq 0x2050
movq 0x18(%rbx), %rdi
callq 0x2050
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x7b41
callq 0x49cd
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2050
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: bam_hdr_write
int bam_hdr_write(BGZF *fp, const bam_hdr_t *h)
{
	char buf[4];
	int32_t i, name_len, x;
	// write "BAM1"
	strncpy(buf, "BAM\1", 4);
	bgzf_write(fp, buf, 4);
	// write plain text and the number of reference sequences
	if (fp->is_be) {
		x = ed_swap_4(h->l_text);
		bgzf_write(fp, &x, 4);
		if (h->l_text) bgzf_write(fp, h->text, h->l_text);
		x = ed_swap_4(h->n_targets);
		bgzf_write(fp, &x, 4);
	} else {
		bgzf_write(fp, &h->l_text, 4);
		if (h->l_text) bgzf_write(fp, h->text, h->l_text);
		bgzf_write(fp, &h->n_targets, 4);
	}
	// write sequence names and lengths
	for (i = 0; i != h->n_targets; ++i) {
		char *p = h->target_name[i];
		name_len = strlen(p) + 1;
		if (fp->is_be) {
			x = ed_swap_4(name_len);
			bgzf_write(fp, &x, 4);
		} else bgzf_write(fp, &name_len, 4);
		bgzf_write(fp, p, name_len);
		if (fp->is_be) {
			x = ed_swap_4(h->target_len[i]);
			bgzf_write(fp, &x, 4);
		} else bgzf_write(fp, &h->target_len[i], 4);
	}
	bgzf_flush(fp);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x14(%rsp), %rsi
movl $0x14d4142, (%rsi)      # imm = 0x14D4142
pushq $0x4
popq %rdx
callq 0x3eba
leaq 0x8(%r14), %r15
testb $0xc, 0x2(%rbx)
je 0x7dbb
movl (%r15), %eax
bswapl %eax
leaq 0xc(%rsp), %r12
movl %eax, (%r12)
pushq $0x4
popq %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3eba
movl (%r15), %edx
testq %rdx, %rdx
je 0x7db0
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0x3eba
movl (%r14), %eax
bswapl %eax
movl %eax, 0xc(%rsp)
jmp 0x7de3
pushq $0x4
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3eba
movl (%r15), %edx
movq %r14, %r12
testq %rdx, %rdx
je 0x7de3
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0x3eba
movq %r14, %r12
pushq $0x4
popq %r15
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x3eba
xorl %ebp, %ebp
xorl %r12d, %r12d
movl (%r14), %eax
cmpq %rax, %r12
je 0x7e7f
movq 0x20(%r14), %rax
movq (%rax,%rbp,2), %r13
movq %r13, %rdi
callq 0x2150
incl %eax
movl %eax, 0x10(%rsp)
testb $0xc, 0x2(%rbx)
leaq 0x10(%rsp), %rsi
je 0x7e2e
bswapl %eax
movl %eax, 0xc(%rsp)
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x3eba
movslq 0x10(%rsp), %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3eba
movq 0x10(%r14), %rsi
addq %rbp, %rsi
testb $0xc, 0x2(%rbx)
je 0x7e68
movl (%rsi), %eax
bswapl %eax
movl %eax, 0xc(%rsp)
movq %rbx, %rdi
leaq 0xc(%rsp), %rsi
jmp 0x7e6b
movq %rbx, %rdi
movq %r15, %rdx
callq 0x3eba
incq %r12
addq $0x4, %rbp
jmp 0x7dfa
movq %rbx, %rdi
callq 0x3cbd
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: bam_name2id
int bam_name2id(bam_hdr_t *h, const char *ref)
{
	sdict_t *d = (sdict_t*)h->sdict;
	khint_t k;
	if (h->sdict == 0) {
		int i, absent;
		d = kh_init(s2i);
		for (i = 0; i < h->n_targets; ++i) {
			k = kh_put(s2i, d, h->target_name[i], &absent);
			kh_val(d, k) = i;
		}
		h->sdict = d;
	}
	k = kh_get(s2i, d, ref);
	return k == kh_end(d)? -1 : kh_val(d, k);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq 0x30(%rdi), %r14
testq %r14, %r14
jne 0x7ef4
movq %rdi, %r15
xorl %r13d, %r13d
xorl %eax, %eax
callq 0x49c2
movq %rax, %r14
leaq 0xc(%rsp), %r12
movslq (%r15), %rax
cmpq %rax, %r13
jge 0x7ef0
movq 0x20(%r15), %rax
movq (%rax,%r13,8), %rsi
movq %r14, %rdi
movq %r12, %rdx
callq 0x4d79
movq 0x20(%r14), %rcx
movl %eax, %eax
movq %r13, (%rcx,%rax,8)
incq %r13
jmp 0x7ec6
movq %r14, 0x30(%r15)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4a31
cmpl (%r14), %eax
jne 0x7f09
pushq $-0x1
popq %rax
jmp 0x7f12
movq 0x20(%r14), %rcx
movl %eax, %eax
movl (%rcx,%rax,8), %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: bam_copy1
bam1_t *bam_copy1(bam1_t *bdst, const bam1_t *bsrc)
{
	uint8_t *data = bdst->data;
	int m_data = bdst->m_data;   // backup data and m_data
	if (m_data < bsrc->l_data) { // double the capacity
		m_data = bsrc->l_data; kroundup32(m_data);
		data = (uint8_t*)realloc(data, m_data);
	}
	memcpy(data, bsrc->data, bsrc->l_data); // copy var-len data
	*bdst = *bsrc; // copy the rest
	// restore the backup
	bdst->m_data = m_data;
	bdst->data = data;
	return bdst;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x28(%rdi), %r15
movl 0x24(%rdi), %ebp
movl 0x20(%rsi), %eax
cmpl %eax, %ebp
jge 0x7f9a
decl %eax
movl %eax, %ecx
sarl %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x2, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x4, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x8, %eax
orl %ecx, %eax
movl %eax, %ebp
sarl $0x10, %ebp
orl %eax, %ebp
incl %ebp
movslq %ebp, %rsi
movq %r15, %rdi
callq 0x22f0
movq %rax, %r15
movl 0x20(%r14), %eax
movq 0x28(%r14), %rsi
movslq %eax, %rdx
movq %r15, %rdi
callq 0x2240
movq 0x20(%r14), %rax
movq %rax, 0x20(%rbx)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm0, (%rbx)
movups %xmm1, 0x10(%rbx)
movl %ebp, 0x24(%rbx)
movq %r15, 0x28(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: bam_cigar2qlen
int bam_cigar2qlen(int n_cigar, const uint32_t *cigar)
{
	int k, l;
	for (k = l = 0; k < n_cigar; ++k)
		if (bam_cigar_type(bam_cigar_op(cigar[k]))&1)
			l += bam_cigar_oplen(cigar[k]);
	return l;
}

// Assembly:
xorl %ecx, %ecx
testl %edi, %edi
cmovlel %ecx, %edi
movl $0x3c1a7, %edx          # imm = 0x3C1A7
xorl %eax, %eax
cmpq %rcx, %rdi
je 0x8010
movl (%rsi,%rcx,4), %r8d
leal (%r8,%r8), %r9d
btl %r9d, %edx
movl $0x0, %r9d
sbbl %r9d, %r9d
shrl $0x4, %r8d
andl %r9d, %r8d
addl %eax, %r8d
incq %rcx
movl %r8d, %eax
jmp 0x7fe4
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: bam_cigar2rlen
int bam_cigar2rlen(int n_cigar, const uint32_t *cigar)
{
	int k, l;
	for (k = l = 0; k < n_cigar; ++k)
		if (bam_cigar_type(bam_cigar_op(cigar[k]))&2)
			l += bam_cigar_oplen(cigar[k]);
	return l;
}

// Assembly:
xorl %edx, %edx
testl %edi, %edi
cmovlel %edx, %edi
xorl %eax, %eax
cmpq %rdx, %rdi
je 0x804a
movl (%rsi,%rdx,4), %r8d
leal (%r8,%r8), %ecx
movl $0x3c1a7, %r9d          # imm = 0x3C1A7
shrl %cl, %r9d
shll $0x1e, %r9d
sarl $0x1f, %r9d
shrl $0x4, %r8d
andl %r9d, %r8d
addl %eax, %r8d
incq %rdx
movl %r8d, %eax
jmp 0x801a
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: bam_read1
int bam_read1(BGZF *fp, bam1_t *b)
{
	bam1_core_t *c = &b->core;
	int32_t block_len, ret, i;
	uint32_t x[8];

	if ((ret = bgzf_read(fp, &block_len, 4)) != 4) {
		if (ret == 0) return -1; // normal end-of-file
		else return -2; // truncated
	}
	if (bgzf_read(fp, x, 32) != 32) return -3;
	if (fp->is_be) {
		ed_swap_4p(&block_len);
		for (i = 0; i < 8; ++i) ed_swap_4p(x + i);
	}
	c->tid = x[0]; c->pos = x[1];
	c->bin = x[2]>>16; c->qual = x[2]>>8&0xff; c->l_qname = x[2]&0xff;
	c->flag = x[3]>>16; c->n_cigar = x[3]&0xffff;
	c->l_qseq = x[4];
	c->mtid = x[5]; c->mpos = x[6]; c->isize = x[7];
	b->l_data = block_len - 32;
	if (b->m_data < b->l_data) {
		b->m_data = b->l_data;
		kroundup32(b->m_data);
		b->data = (uint8_t*)realloc(b->data, b->m_data);
	}
	if (bgzf_read(fp, b->data, b->l_data) != b->l_data) return -4;
	//b->l_aux = b->l_data - c->n_cigar * 4 - c->l_qname - c->l_qseq - (c->l_qseq+1)/2;
	if (fp->is_be) swap_data(c, b->l_data, b->data);
	return 4 + block_len;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xc(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x3a53
testl %eax, %eax
je 0x80ac
cmpl $0x4, %eax
jne 0x80b3
leaq 0x10(%rsp), %rsi
pushq $0x20
popq %rdx
movq %r14, %rdi
callq 0x3a53
cmpq $0x20, %rax
jne 0x80ba
testb $0xc, 0x2(%r14)
movl 0xc(%rsp), %eax
je 0x80c1
bswapl %eax
movl %eax, 0xc(%rsp)
xorl %ecx, %ecx
cmpq $0x8, %rcx
je 0x80c1
movl 0x10(%rsp,%rcx,4), %edx
bswapl %edx
movl %edx, 0x10(%rsp,%rcx,4)
incq %rcx
jmp 0x8097
pushq $-0x1
jmp 0x818b
pushq $-0x2
jmp 0x818b
pushq $-0x3
jmp 0x818b
movq 0x10(%rsp), %rcx
movq %rcx, (%rbx)
movl 0x18(%rsp), %ecx
movl 0x1c(%rsp), %edx
movl %ecx, %esi
shrl $0x10, %esi
movl %ecx, %edi
shll $0x8, %edi
andl $0xff0000, %edi         # imm = 0xFF0000
shll $0x18, %ecx
orl %esi, %ecx
orl %edi, %ecx
movl %edx, %esi
shrl $0x10, %esi
shlq $0x20, %rsi
orq %rcx, %rsi
shlq $0x30, %rdx
orq %rsi, %rdx
movq %rdx, 0x8(%rbx)
movaps 0x20(%rsp), %xmm0
movups %xmm0, 0x10(%rbx)
leal -0x20(%rax), %ecx
movl %ecx, 0x20(%rbx)
cmpl %ecx, 0x24(%rbx)
jge 0x8155
addl $-0x21, %eax
movl %eax, %ecx
sarl %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x2, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x4, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x8, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x10, %ecx
orl %eax, %ecx
incl %ecx
movl %ecx, 0x24(%rbx)
movq 0x28(%rbx), %rdi
movslq %ecx, %rsi
callq 0x22f0
movq %rax, %rsi
movq %rax, 0x28(%rbx)
movl 0x20(%rbx), %ecx
jmp 0x8159
movq 0x28(%rbx), %rsi
movslq %ecx, %rdx
movq %r14, %rdi
callq 0x3a53
movslq 0x20(%rbx), %rsi
cmpq %rsi, %rax
jne 0x8189
testb $0xc, 0x2(%r14)
je 0x8180
movq 0x28(%rbx), %rdx
movq %rbx, %rdi
callq 0x8194
movl 0xc(%rsp), %eax
addl $0x4, %eax
jmp 0x818c
pushq $-0x4
popq %rax
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: bam_write1
int bam_write1(BGZF *fp, const bam1_t *b)
{
	const bam1_core_t *c = &b->core;
	uint32_t x[8], block_len = b->l_data + 32, y;
	int i;
	x[0] = c->tid;
	x[1] = c->pos;
	x[2] = (uint32_t)c->bin<<16 | c->qual<<8 | c->l_qname;
	x[3] = (uint32_t)c->flag<<16 | c->n_cigar;
	x[4] = c->l_qseq;
	x[5] = c->mtid;
	x[6] = c->mpos;
	x[7] = c->isize;
	bgzf_flush_try(fp, 4 + block_len);
	if (fp->is_be) {
		for (i = 0; i < 8; ++i) ed_swap_4p(x + i);
		y = block_len;
		bgzf_write(fp, ed_swap_4p(&y), 4);
		swap_data(c, b->l_data, b->data);
	} else bgzf_write(fp, &block_len, 4);
	bgzf_write(fp, x, 32);
	bgzf_write(fp, b->data, b->l_data);
	if (fp->is_be) swap_data(c, b->l_data, b->data);
	return 4 + block_len;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl 0x20(%rsi), %esi
leal 0x20(%rsi), %ebp
movl %ebp, 0x8(%rsp)
movq (%rbx), %rax
movq %rax, 0x10(%rsp)
movq 0x8(%rbx), %rax
movl %eax, %ecx
shll $0x10, %ecx
movl %eax, %edx
shrl $0x8, %edx
andl $0xff00, %edx           # imm = 0xFF00
orl %ecx, %edx
movl %eax, %ecx
shrl $0x18, %ecx
orl %edx, %ecx
movl %ecx, 0x18(%rsp)
movq %rax, %rcx
shrq $0x10, %rcx
andl $0xffff0000, %ecx       # imm = 0xFFFF0000
shrq $0x30, %rax
orl %ecx, %eax
movl %eax, 0x1c(%rsp)
movups 0x10(%rbx), %xmm0
movaps %xmm0, 0x20(%rsp)
addl $0x24, %esi
callq 0x3e61
testb $0xc, 0x2(%r14)
je 0x8406
xorl %eax, %eax
cmpq $0x8, %rax
je 0x83e1
movl 0x10(%rsp,%rax,4), %ecx
bswapl %ecx
movl %ecx, 0x10(%rsp,%rax,4)
incq %rax
jmp 0x83cc
bswapl %ebp
leaq 0xc(%rsp), %rsi
movl %ebp, (%rsi)
pushq $0x4
popq %rdx
movq %r14, %rdi
callq 0x3eba
movl 0x20(%rbx), %esi
movq 0x28(%rbx), %rdx
movq %rbx, %rdi
callq 0x8194
jmp 0x8416
leaq 0x8(%rsp), %rsi
pushq $0x4
popq %rdx
movq %r14, %rdi
callq 0x3eba
leaq 0x10(%rsp), %rsi
pushq $0x20
popq %rdx
movq %r14, %rdi
callq 0x3eba
movq 0x28(%rbx), %rsi
movslq 0x20(%rbx), %rdx
movq %r14, %rdi
callq 0x3eba
testb $0xc, 0x2(%r14)
je 0x844c
movl 0x20(%rbx), %esi
movq 0x28(%rbx), %rdx
movq %rbx, %rdi
callq 0x8194
movl 0x8(%rsp), %eax
addl $0x4, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: bam_index
hts_idx_t *bam_index(BGZF *fp, int min_shift)
{
	int n_lvls, i, fmt;
	bam1_t *b;
	hts_idx_t *idx;
	bam_hdr_t *h;
	h = bam_hdr_read(fp);
	if (min_shift > 0) {
		int64_t max_len = 0, s;
		for (i = 0; i < h->n_targets; ++i)
			if (max_len < h->target_len[i]) max_len = h->target_len[i];
		max_len += 256;
		for (n_lvls = 0, s = 1<<min_shift; max_len > s; ++n_lvls, s <<= 3);
		fmt = HTS_FMT_CSI;
	} else min_shift = 14, n_lvls = 5, fmt = HTS_FMT_BAI;
	idx = hts_idx_init(h->n_targets, fmt, bgzf_tell(fp), min_shift, n_lvls);
	bam_hdr_destroy(h);
	b = bam_init1();
	while (bam_read1(fp, b) >= 0) {
		int l, ret;
		l = bam_cigar2rlen(b->core.n_cigar, bam_get_cigar(b));
		if (l == 0) l = 1; // no zero-length records
		ret = hts_idx_push(idx, b->core.tid, b->core.pos, b->core.pos + l, bgzf_tell(fp), !(b->core.flag&BAM_FUNMAP));
		if (ret < 0) break; // unsorted
	}
	hts_idx_finish(idx, bgzf_tell(fp));
	bam_destroy1(b);
	return idx;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
callq 0x7b51
movq %rax, %r14
movl (%rax), %edi
testl %ebp, %ebp
jle 0x84c0
xorl %ecx, %ecx
testl %edi, %edi
movl $0x0, %edx
cmovgl %edi, %edx
xorl %eax, %eax
cmpq %rcx, %rdx
je 0x849d
movq 0x10(%r14), %rsi
movl (%rsi,%rcx,4), %esi
cmpq %rsi, %rax
cmovleq %rsi, %rax
incq %rcx
jmp 0x8485
pushq $0x1
popq %rdx
movl %ebp, %ecx
shll %cl, %edx
addq $0x100, %rax            # imm = 0x100
movslq %edx, %rcx
xorl %esi, %esi
xorl %r8d, %r8d
cmpq %rcx, %rax
jle 0x84ca
incl %r8d
shlq $0x3, %rcx
jmp 0x84b2
pushq $0xe
popq %rbp
pushq $0x5
popq %r8
pushq $0x1
popq %rsi
movq 0x10(%rbx), %rax
shlq $0x10, %rax
movzwl 0xc(%rbx), %edx
orq %rax, %rdx
movl %ebp, %ecx
callq 0x589f
movq %rax, %r15
movq %r14, %rdi
callq 0x7ae3
callq 0x7f20
movq %rax, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x804b
testl %eax, %eax
js 0x8554
movq 0x8(%r14), %r12
movq %r12, %rdi
shrq $0x30, %rdi
movl %r12d, %esi
shrl $0x18, %esi
addq 0x28(%r14), %rsi
callq 0x8011
cmpl $0x1, %eax
adcl $0x0, %eax
movl (%r14), %esi
movl 0x4(%r14), %edx
leal (%rax,%rdx), %ecx
movq 0x10(%rbx), %rax
shlq $0x10, %rax
movzwl 0xc(%rbx), %r8d
orq %rax, %r8
xorl %r9d, %r9d
btq $0x22, %r12
setae %r9b
movq %r15, %rdi
callq 0x5f71
testl %eax, %eax
jns 0x84f3
movq 0x10(%rbx), %rax
shlq $0x10, %rax
movzwl 0xc(%rbx), %esi
orq %rax, %rsi
movq %r15, %rdi
callq 0x5945
movq %r14, %rdi
callq 0x7f2b
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: bam_index_build
int bam_index_build(const char *fn, int min_shift)
{
	hts_idx_t *idx;
	BGZF *fp;
	if ((fp = bgzf_open(fn, "r")) == 0) return -1;
	idx = bam_index(fp, min_shift);
	bgzf_close(fp);
	hts_idx_save(idx, fn, min_shift > 0? HTS_FMT_CSI : HTS_FMT_BAI);
	hts_idx_destroy(idx);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x437c(%rip), %rsi      # 0xc90e
callq 0x36d8
testq %rax, %rax
je 0x85d2
movq %rax, %r14
movq %rax, %rdi
movl %ebp, %esi
callq 0x845c
movq %rax, %r15
movq %r14, %rdi
callq 0x3fbb
xorl %edx, %edx
testl %ebp, %ebp
setle %dl
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6449
movq %r15, %rdi
callq 0x6371
xorl %eax, %eax
jmp 0x85d5
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: bam_readrec
int bam_readrec(BGZF *fp, void *null, bam1_t *b, int *tid, int *beg, int *end)
{
	int ret;
	if ((ret = bam_read1(fp, b)) >= 0) {
		*tid = b->core.tid; *beg = b->core.pos;
		*end = b->core.pos + (b->core.n_cigar? bam_cigar2rlen(b->core.n_cigar, bam_get_cigar(b)) : 1);
	}
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r9, %rbx
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r14
movq %rdx, %rsi
callq 0x804b
movl %eax, %ebp
testl %eax, %eax
js 0x8633
movl (%r14), %eax
movl %eax, (%r12)
movl 0x4(%r14), %r12d
movl %r12d, (%r15)
movq 0x8(%r14), %rsi
movq %rsi, %rdi
shrq $0x30, %rdi
jne 0x8622
pushq $0x1
popq %rax
jmp 0x862e
shrl $0x18, %esi
addq 0x28(%r14), %rsi
callq 0x8011
addl %r12d, %eax
movl %eax, (%rbx)
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: sam_hdr_read
bam_hdr_t *sam_hdr_read(htsFile *fp)
{
	if (!fp->is_bin) {
		kstring_t str;
		bam_hdr_t *h;
		str.l = str.m = 0; str.s = 0;
		while (hts_getline(fp, KS_SEP_LINE, &fp->line) >= 0) {
			if (fp->line.s[0] != '@') break;
			kputsn(fp->line.s, fp->line.l, &str);
			kputc('\n', &str);
		}
		h = sam_hdr_parse(str.l, str.s);
		h->l_text = str.l; h->text = str.s;
		return h;
	} else return bam_hdr_read((BGZF*)fp->fp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
testb $0x1, (%rdi)
jne 0x88eb
leaq 0x10(%rbx), %r14
movq %rsp, %r15
andq $0x0, 0x10(%r15)
xorps %xmm0, %xmm0
movaps %xmm0, (%r15)
pushq $0x2
popq %rbp
pushq $0xa
popq %r12
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x51cd
testl %eax, %eax
js 0x88c7
movq 0x20(%rbx), %rdi
cmpb $0x40, (%rdi)
jne 0x88c7
movl (%r14), %esi
movq %r15, %rdx
callq 0x8900
movl %r12d, %edi
movq %r15, %rsi
callq 0x8994
jmp 0x8895
movl (%rsp), %ebp
movq 0x10(%rsp), %rbx
movq %rbx, %rsi
callq 0x863e
movl %ebp, 0x8(%rax)
movq %rbx, 0x28(%rax)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x38(%rbx), %rdi
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x7b51
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: sam_hdr_write
int sam_hdr_write(htsFile *fp, const bam_hdr_t *h)
{
	if (!fp->is_bin) {
		char *p;
		fputs(h->text, (FILE*)fp->fp);
		p = strstr(h->text, "@SQ\t"); // FIXME: we need a loop to make sure "@SQ\t" does not match something unwanted!!!
		if (p == 0) {
			int i;
			for (i = 0; i < h->n_targets; ++i) {
				fp->line.l = 0;
				kputsn("@SQ\tSN:", 7, &fp->line); kputs(h->target_name[i], &fp->line);
				kputsn("\tLN:", 4, &fp->line); kputw(h->target_len[i], &fp->line); kputc('\n', &fp->line);
				fwrite(fp->line.s, 1, fp->line.l, (FILE*)fp->fp);
			}
		}
		fflush((FILE*)fp->fp);
	} else bam_hdr_write((BGZF*)fp->fp, h);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
testb $0x1, (%rdi)
jne 0x8a5a
movq 0x28(%rbx), %rdi
movq 0x38(%r14), %rsi
callq 0x2190
movq 0x28(%rbx), %rdi
leaq 0x3b01(%rip), %rsi      # 0xc546
callq 0x2400
testq %rax, %rax
je 0x8a77
movq 0x38(%r14), %rdi
callq 0x22b0
jmp 0x8a66
movq 0x38(%r14), %rdi
movq %rbx, %rsi
callq 0x7d4f
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10(%r14), %r15
xorl %r12d, %r12d
pushq $0xa
popq %rbp
pushq $0x1
popq %r13
movslq (%rbx), %rax
cmpq %rax, %r12
jge 0x8a4f
andq $0x0, 0x10(%r14)
leaq 0x3ab2(%rip), %rdi      # 0xc54b
pushq $0x7
popq %rsi
movq %r15, %rdx
callq 0x8900
movq 0x20(%rbx), %rax
movq (%rax,%r12,8), %rdi
movq %r15, %rsi
callq 0x8af9
leaq 0x3a98(%rip), %rdi      # 0xc553
pushq $0x4
popq %rsi
movq %r15, %rdx
callq 0x8900
movq 0x10(%rbx), %rax
movl (%rax,%r12,4), %edi
movq %r15, %rsi
callq 0x8b1c
movl %ebp, %edi
movq %r15, %rsi
callq 0x8994
movq 0x10(%r14), %rdx
movq 0x20(%r14), %rdi
movq 0x38(%r14), %rcx
movq %r13, %rsi
callq 0x23c0
incq %r12
jmp 0x8a85
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: sam_read1
int sam_read1(htsFile *fp, bam_hdr_t *h, bam1_t *b)
{
	if (!fp->is_bin) {
		int ret;
err_recover:
		if (fp->line.l == 0) {
			ret = hts_getline(fp, KS_SEP_LINE, &fp->line);
			if (ret < 0) return -1;
		}
		ret = sam_parse1(&fp->line, h, b);
		fp->line.l = 0;
		if (ret < 0) {
			if (hts_verbose >= 1)
				fprintf(stderr, "[W::%s] parse error at line %lld\n", __func__, (long long)fp->lineno);
			if (h->ignore_sam_err) goto err_recover;
		}
		return ret;
	} else return bam_read1((BGZF*)fp->fp, b);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
testb $0x1, (%rdi)
jne 0x9a43
movq %rsi, %r15
leaq 0x10(%r14), %r12
leaq 0x7854(%rip), %rbp      # 0x11230
cmpq $0x0, (%r12)
jne 0x99f5
movq %r14, %rdi
pushq $0x2
popq %rsi
movq %r12, %rdx
callq 0x51cd
testl %eax, %eax
js 0x9a5d
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x8bfa
movl %eax, %r13d
andq $0x0, (%r12)
testl %eax, %eax
jns 0x9a61
cmpl $0x0, (%rbp)
jg 0x9a1e
cmpl $0x0, 0x4(%r15)
jne 0x99dc
jmp 0x9a61
movq 0x75d3(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
movq 0x8(%r14), %rcx
leaq 0x2d45(%rip), %rsi      # 0xc778
leaq 0x2d60(%rip), %rdx      # 0xc79a
xorl %eax, %eax
callq 0x2220
jmp 0x9a15
movq 0x38(%r14), %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x804b
pushq $-0x1
popq %r13
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/./kstring.h
// Function: kputuw
static inline int kputuw(unsigned c, kstring_t *s)
{
	char buf[16];
	int l, i;
	unsigned x;
	if (c == 0) return kputc('0', s);
	for (l = 0, x = c; x > 0; x /= 10) buf[l++] = x%10 + '0';
	if (s->l + l + 1 >= s->m) {
		s->m = s->l + l + 2;
		kroundup32(s->m);
		s->s = (char*)realloc(s->s, s->m);
	}
	for (i = l - 1; i >= 0; --i) s->s[s->l++] = buf[i];
	s->s[s->l] = 0;
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
testl %edi, %edi
je 0xa0d1
movl %edi, %eax
xorl %r14d, %r14d
pushq $0xa
popq %rcx
testl %eax, %eax
je 0xa04c
xorl %edx, %edx
divl %ecx
orb $0x30, %dl
movb %dl, (%rsp,%r14)
incq %r14
jmp 0xa038
leal 0x1(%r14), %eax
addq (%rbx), %rax
cmpq 0x8(%rbx), %rax
jb 0xa0b9
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
callq 0x22f0
movq %rax, 0x10(%rbx)
jmp 0xa0b9
movb -0x1(%rsp,%r14), %al
decq %r14
movq (%rbx), %rcx
movq 0x10(%rbx), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, (%rbx)
movb %al, (%rdx,%rcx)
testq %r14, %r14
jg 0xa0a0
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
movb $0x0, (%rcx,%rax)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
pushq $0x30
popq %rdi
movq %rbx, %rsi
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x8994
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: sam_write1
int sam_write1(htsFile *fp, const bam_hdr_t *h, const bam1_t *b)
{
	if (!fp->is_bin) {
		sam_format1(h, b, &fp->line);
		fwrite(fp->line.s, 1, fp->line.l, (FILE*)fp->fp);
		fputc('\n', (FILE*)fp->fp);
		return fp->line.l + 1;
	} else return bam_write1((BGZF*)fp->fp, b);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testb $0x1, (%rdi)
jne 0xa260
leaq 0x10(%rbx), %rax
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x9a73
movq 0x10(%rbx), %rdx
movq 0x20(%rbx), %rdi
movq 0x38(%rbx), %rcx
pushq $0x1
popq %rsi
callq 0x23c0
movq 0x38(%rbx), %rsi
pushq $0xa
popq %rdi
callq 0x21c0
movl 0x10(%rbx), %eax
incl %eax
popq %rbx
retq
movq 0x38(%rbx), %rdi
movq %rdx, %rsi
popq %rbx
jmp 0x835a
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: bam_aux_get
uint8_t *bam_aux_get(const bam1_t *b, const char tag[2])
{
	uint8_t *s;
	int y = tag[0]<<8 | tag[1];
	s = bam_get_aux(b);
	while (s < b->data + b->l_data) {
		int x = (int)s[0]<<8 | s[1];
		s += 2;
		if (x == y) return s;
		__skip_tag(s);
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movsbl (%rsi), %eax
shll $0x8, %eax
movsbl 0x1(%rsi), %ebp
orl %eax, %ebp
movq 0x8(%rdi), %rax
movq 0x28(%rdi), %rcx
movq %rax, %rdx
shrq $0x30, %rdx
leaq (%rcx,%rdx,4), %rdx
shrl $0x18, %eax
addq %rdx, %rax
movslq 0x10(%rdi), %rdx
leal 0x1(%rdx), %esi
sarl %esi
movslq %esi, %r15
addq %rax, %r15
addq %rdx, %r15
movslq 0x20(%rdi), %r14
addq %rcx, %r14
xorl %ebx, %ebx
cmpq %r14, %r15
jae 0xa42a
movzwl (%r15), %eax
rolw $0x8, %ax
movzwl %ax, %eax
cmpl %ebp, %eax
je 0xa423
callq 0x2030
movq (%rax), %rax
movzbl 0x2(%r15), %ecx
movl (%rax,%rcx,4), %edi
leaq 0x3(%r15), %r12
cmpl $0x42, %edi
je 0xa3f6
cmpl $0x5a, %edi
je 0xa3e5
cmpl $0x48, %edi
jne 0xa414
leaq 0x1(%r12), %r15
cmpb $0x0, (%r12)
movq %r15, %r12
jne 0xa3e5
jmp 0xa3ae
movzbl 0x3(%r15), %edi
callq 0xa26d
movslq 0x4(%r15), %rcx
cltq
imulq %rcx, %rax
leaq (%r12,%rax), %r15
addq $0x5, %r15
jmp 0xa3ae
callq 0xa26d
movl %eax, %eax
addq %rax, %r12
movq %r12, %r15
jmp 0xa3ae
addq $0x2, %r15
movq %r15, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: bam_aux_del
int bam_aux_del(bam1_t *b, uint8_t *s)
{
	uint8_t *p, *aux;
	int l_aux = bam_get_l_aux(b);
	aux = bam_get_aux(b);
	p = s - 2;
	__skip_tag(s);
	memmove(p, s, l_aux - (s - aux));
	b->l_data -= s - p;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl 0x20(%rdi), %eax
movl %eax, 0xc(%rsp)
movq 0x8(%rdi), %r12
movslq 0x10(%rdi), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rdi), %rbp
callq 0x2030
movq (%rax), %rax
movzbl (%rbx), %ecx
movl (%rax,%rcx,4), %edi
leaq 0x1(%rbx), %r15
cmpl $0x42, %edi
je 0xa492
cmpl $0x5a, %edi
je 0xa483
cmpl $0x48, %edi
jne 0xa4af
leaq 0x1(%r15), %r13
cmpb $0x0, (%r15)
movq %r13, %r15
jne 0xa483
jmp 0xa4bc
movzbl 0x1(%rbx), %edi
callq 0xa26d
movslq 0x2(%rbx), %rcx
cltq
imulq %rcx, %rax
leaq (%r15,%rax), %r13
addq $0x5, %r13
jmp 0xa4bc
callq 0xa26d
movl %eax, %eax
addq %rax, %r15
movq %r15, %r13
addq $-0x2, %rbx
movq %r12, %rax
shrq $0x2e, %rax
andl $-0x4, %eax
addq %rax, %rbp
shrl $0x18, %r12d
leaq (%r12,%rbp), %rcx
movq 0x10(%rsp), %rsi
leal 0x1(%rsi), %edx
sarl %edx
movslq %edx, %rdx
addq %rdx, %rcx
addq %rsi, %rcx
addl %esi, %r12d
addl %eax, %r12d
addl %r12d, %edx
movl 0xc(%rsp), %eax
subl %edx, %eax
movslq %eax, %rdx
addq %rcx, %rdx
subq %r13, %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2320
subl %r13d, %ebx
addl %ebx, 0x20(%r14)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: bam_aux2i
int32_t bam_aux2i(const uint8_t *s)
{
	int type;
	type = *s++;
	if (type == 'c') return (int32_t)*(int8_t*)s;
	else if (type == 'C') return (int32_t)*(uint8_t*)s;
	else if (type == 's') return (int32_t)*(int16_t*)s;
	else if (type == 'S') return (int32_t)*(uint16_t*)s;
	else if (type == 'i' || type == 'I') return *(int32_t*)s;
	else return 0;
}

// Assembly:
movb (%rdi), %cl
leal -0x43(%rcx), %eax
rolb $0x4, %al
cmpb $0x3, %al
ja 0xa556
movzbl %al, %eax
leaq 0x1f13(%rip), %rcx      # 0xc44c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzbl 0x1(%rdi), %eax
retq
movsbl 0x1(%rdi), %eax
retq
movswl 0x1(%rdi), %eax
retq
movzwl 0x1(%rdi), %eax
retq
andb $-0x21, %cl
xorl %eax, %eax
cmpb $0x49, %cl
jne 0xa563
movl 0x1(%rdi), %eax
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: bam_aux2f
double bam_aux2f(const uint8_t *s)
{
	int type;
	type = *s++;
	if (type == 'd') return *(double*)s;
	else if (type == 'f') return *(float*)s;
	else return 0.0;
}

// Assembly:
movzbl (%rdi), %eax
cmpl $0x66, %eax
je 0xa57a
xorps %xmm0, %xmm0
cmpl $0x64, %eax
jne 0xa57f
movsd 0x1(%rdi), %xmm0
retq
cvtss2sd 0x1(%rdi), %xmm0
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: bam_plp_init
bam_plp_t bam_plp_init(bam_plp_auto_f func, void *data)
{
	bam_plp_t iter;
	iter = (bam_plp_t)calloc(1, sizeof(struct __bam_plp_t));
	iter->mp = mp_init();
	iter->head = iter->tail = mp_alloc(iter->mp);
	iter->dummy = mp_alloc(iter->mp);
	iter->max_tid = iter->max_pos = -1;
	iter->flag_mask = BAM_PLP_MASK;
	iter->maxcnt = 8000;
	if (func) {
		iter->func = func;
		iter->data = data;
		iter->b = bam_init1();
	}
	return iter;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
pushq $0x1
popq %r12
pushq $0x68
popq %rsi
movq %r12, %rdi
callq 0x21f0
movq %rax, %r14
pushq $0x18
popq %rsi
movq %r12, %rdi
callq 0x21f0
movq %rax, %r12
movq %rax, (%r14)
movq %rax, %rdi
callq 0xa62a
movq %rax, 0x10(%r14)
movq %rax, 0x8(%r14)
movq %r12, %rdi
callq 0xa62a
movq %rax, 0x18(%r14)
orq $-0x1, 0x28(%r14)
movl $0x704, 0x34(%r14)      # imm = 0x704
movl $0x1f40, 0x40(%r14)     # imm = 0x1F40
testq %r15, %r15
je 0xa61b
movq %r15, 0x58(%r14)
movq %rbx, 0x60(%r14)
callq 0x7f20
movq %rax, 0x50(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: bam_plp_destroy
void bam_plp_destroy(bam_plp_t iter)
{
	mp_free(iter->mp, iter->dummy);
	mp_free(iter->mp, iter->head);
	if (iter->mp->cnt != 0)
		fprintf(stderr, "[bam_plp_destroy] memory leak: %d. Continue anyway.\n", iter->mp->cnt);
	mp_destroy(iter->mp);
	if (iter->b) bam_destroy1(iter->b);
	free(iter->plp);
	free(iter);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
movq 0x18(%rbx), %rsi
callq 0xa6f8
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
callq 0xa6f8
movq (%rbx), %r14
movl (%r14), %edx
testl %edx, %edx
jne 0xa6db
xorl %r15d, %r15d
movslq 0x4(%r14), %rax
movq 0x10(%r14), %rdi
cmpq %rax, %r15
jge 0xa6aa
movq (%rdi,%r15,8), %rax
movq 0x28(%rax), %rdi
callq 0x2050
movq 0x10(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x2050
incq %r15
jmp 0xa67e
callq 0x2050
movq %r14, %rdi
callq 0x2050
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0xa6c5
callq 0x7f2b
movq 0x48(%rbx), %rdi
callq 0x2050
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2050
movq 0x6916(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
leaq 0x20e6(%rip), %rsi      # 0xc7d2
xorl %eax, %eax
callq 0x2220
movq (%rbx), %r14
jmp 0xa67b
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: mp_free
static inline void mp_free(mempool_t *mp, lbnode_t *p)
{
	--mp->cnt; p->next = 0; // clear lbnode_t::next here
	if (mp->n == mp->max) {
		mp->max = mp->max? mp->max<<1 : 256;
		mp->buf = (lbnode_t**)realloc(mp->buf, sizeof(lbnode_t*) * mp->max);
	}
	mp->buf[mp->n++] = p;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
decl (%rdi)
movq %rsi, %r14
andq $0x0, 0x48(%rsi)
movl 0x4(%rdi), %ecx
cmpl 0x8(%rdi), %ecx
jne 0xa73a
leal (%rcx,%rcx), %eax
testl %ecx, %ecx
movl $0x100, %ecx            # imm = 0x100
cmovnel %eax, %ecx
movl %ecx, 0x8(%rbx)
movq 0x10(%rbx), %rdi
movslq %ecx, %rsi
shlq $0x3, %rsi
callq 0x22f0
movq %rax, 0x10(%rbx)
movl 0x4(%rbx), %ecx
jmp 0xa73e
movq 0x10(%rbx), %rax
leal 0x1(%rcx), %edx
movl %edx, 0x4(%rbx)
movslq %ecx, %rcx
movq %r14, (%rax,%rcx,8)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: bam_plp_push
int bam_plp_push(bam_plp_t iter, const bam1_t *b)
{
	if (iter->error) return -1;
	if (b) {
		if (b->core.tid < 0) return 0;
		if (b->core.flag & iter->flag_mask) return 0;
		if (iter->tid == b->core.tid && iter->pos == b->core.pos && iter->mp->cnt > iter->maxcnt) return 0;
		bam_copy1(&iter->tail->b, b);
		iter->tail->beg = b->core.pos;
		iter->tail->end = b->core.pos + bam_cigar2rlen(b->core.n_cigar, bam_get_cigar(b));
		iter->tail->s = g_cstate_null; iter->tail->s.end = iter->tail->end - 1; // initialize cstate_t
		if (b->core.tid < iter->max_tid) {
			fprintf(stderr, "[bam_pileup_core] the input is not sorted (chromosomes out of order)\n");
			iter->error = 1;
			return -1;
		}
		if ((b->core.tid == iter->max_tid) && (iter->tail->beg < iter->max_pos)) {
			fprintf(stderr, "[bam_pileup_core] the input is not sorted (reads out of order)\n");
			iter->error = 1;
			return -1;
		}
		iter->max_tid = b->core.tid; iter->max_pos = iter->tail->beg;
		if (iter->tail->end > iter->pos || iter->tail->b.core.tid > iter->tid) {
			iter->tail->next = mp_alloc(iter->mp);
			iter->tail = iter->tail->next;
		}
	} else iter->is_eof = 1;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
pushq $-0x1
popq %r15
cmpl $0x0, 0x3c(%rdi)
je 0xacb0
movl %r15d, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %r14
movq %rdi, %rbx
testq %rsi, %rsi
je 0xad7c
movl (%r14), %eax
xorl %ebp, %ebp
testl %eax, %eax
js 0xac9f
movl 0xc(%r14), %ecx
movl 0x34(%rbx), %edx
testw %cx, %dx
jne 0xac9f
cmpl %eax, 0x20(%rbx)
jne 0xacec
movl 0x24(%rbx), %eax
cmpl 0x4(%r14), %eax
jne 0xacec
movq (%rbx), %rax
movl (%rax), %eax
cmpl 0x40(%rbx), %eax
jg 0xac9f
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x7f47
movl 0x4(%r14), %r12d
movq 0x10(%rbx), %r13
movl %r12d, 0x30(%r13)
movq 0x8(%r14), %rsi
movq %rsi, %rdi
shrq $0x30, %rdi
shrl $0x18, %esi
addq 0x28(%r14), %rsi
callq 0x8011
addl %r12d, %eax
movl %eax, 0x34(%r13)
movups 0x1747(%rip), %xmm0     # 0xc470
movups %xmm0, 0x38(%r13)
movq 0x10(%rbx), %rax
movl 0x34(%rax), %ecx
leal -0x1(%rcx), %edx
movl %edx, 0x44(%rax)
movl (%r14), %edx
cmpl 0x28(%rbx), %edx
jl 0xad8a
movl 0x30(%rax), %esi
jne 0xad4d
cmpl 0x2c(%rbx), %esi
jl 0xad9f
movl %edx, 0x28(%rbx)
movl %esi, 0x2c(%rbx)
cmpl 0x24(%rbx), %ecx
jg 0xad63
movl (%rax), %eax
cmpl 0x20(%rbx), %eax
jle 0xac9f
movq (%rbx), %rdi
callq 0xa62a
movq 0x10(%rbx), %rcx
movq %rax, 0x48(%rcx)
movq %rax, 0x10(%rbx)
jmp 0xac9f
movl $0x1, 0x30(%rbx)
xorl %ebp, %ebp
jmp 0xac9f
movq 0x6267(%rip), %rax      # 0x10ff8
movq (%rax), %rcx
leaq 0x1a9e(%rip), %rdi      # 0xc839
pushq $0x45
jmp 0xadb2
movq 0x6252(%rip), %rax      # 0x10ff8
movq (%rax), %rcx
leaq 0x1acf(%rip), %rdi      # 0xc87f
pushq $0x3f
popq %rsi
pushq $0x1
popq %rdx
callq 0x23c0
movl $0x1, 0x3c(%rbx)
jmp 0xac9c
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: bam_plp_auto
const bam_pileup1_t *bam_plp_auto(bam_plp_t iter, int *_tid, int *_pos, int *_n_plp)
{
	const bam_pileup1_t *plp;
	if (iter->func == 0 || iter->error) { *_n_plp = -1; return 0; }
	if ((plp = bam_plp_next(iter, _tid, _pos, _n_plp)) != 0) return plp;
	else { // no pileup line can be obtained; read alignments
		*_n_plp = 0;
		if (iter->is_eof) return 0;
		while (iter->func(iter->data, iter->b) >= 0) {
			if (bam_plp_push(iter, iter->b) < 0) {
				*_n_plp = -1;
				return 0;
			}
			if ((plp = bam_plp_next(iter, _tid, _pos, _n_plp)) != 0) return plp;
			// otherwise no pileup line can be returned; read the next alignment.
		}
		bam_plp_push(iter, 0);
		if ((plp = bam_plp_next(iter, _tid, _pos, _n_plp)) != 0) return plp;
		return 0;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
cmpq $0x0, 0x58(%rdi)
je 0xade2
movq %rdi, %r12
cmpl $0x0, 0x3c(%rdi)
je 0xadf3
orl $-0x1, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rdx, %r14
movq %rsi, %r15
movq %r12, %rdi
movq %rbx, %rcx
callq 0xa753
testq %rax, %rax
jne 0xade7
andl $0x0, (%rbx)
cmpl $0x0, 0x30(%r12)
jne 0xade5
jmp 0xae3d
movq 0x50(%r12), %rsi
movq %r12, %rdi
callq 0xac87
testl %eax, %eax
js 0xade2
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xa753
testq %rax, %rax
jne 0xade7
movq 0x50(%r12), %rsi
movq 0x60(%r12), %rdi
callq *0x58(%r12)
testl %eax, %eax
jns 0xae16
cmpl $0x0, 0x3c(%r12)
jne 0xae61
movl $0x1, 0x30(%r12)
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xa753
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/sam.c
// Function: bam_plp_reset
void bam_plp_reset(bam_plp_t iter)
{
	lbnode_t *p, *q;
	iter->max_tid = iter->max_pos = -1;
	iter->tid = iter->pos = 0;
	iter->is_eof = 0;
	for (p = iter->head; p->next;) {
		q = p->next;
		mp_free(iter->mp, p);
		p = q;
	}
	iter->head = iter->tail;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movaps 0x15d5(%rip), %xmm0     # 0xc460
movups %xmm0, 0x20(%rdi)
andl $0x0, 0x30(%rdi)
movq 0x8(%rdi), %rsi
movq 0x48(%rsi), %r14
testq %r14, %r14
je 0xaead
movq (%rbx), %rdi
callq 0xa6f8
movq %r14, %rsi
jmp 0xae97
movq 0x10(%rbx), %rax
movq %rax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq