LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 0x8bb1
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
je 0x8b82
cmpl $0x0, (%rbx)
jle 0x8b74
xorl %r14d, %r14d
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x2050
incq %r14
movslq (%rbx), %rax
cmpq %rax, %r14
jl 0x8b58
movq 0x20(%rbx), %rdi
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 0x8ba2
callq 0x4f83
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2050
retq
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x4, %edx
callq 0x43d3
leaq 0x8(%r14), %r12
testb $0xc, 0x2(%rbx)
je 0x8e05
movl (%r12), %eax
bswapl %eax
leaq 0xc(%rsp), %r15
movl %eax, (%r15)
movl $0x4, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x43d3
movl (%r12), %edx
testq %rdx, %rdx
je 0x8dfa
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0x43d3
movl (%r14), %eax
bswapl %eax
movl %eax, 0xc(%rsp)
jmp 0x8e30
movl $0x4, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x43d3
movl (%r12), %edx
movq %r14, %r15
testq %rdx, %rdx
je 0x8e30
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0x43d3
movq %r14, %r15
movl $0x4, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x43d3
cmpl $0x0, (%r14)
je 0x8edd
xorl %r13d, %r13d
leaq 0xc(%rsp), %r15
xorl %ebp, %ebp
movq 0x20(%r14), %rax
movq (%rax,%r13,2), %r12
movq %r12, %rdi
callq 0x2150
incl %eax
movl %eax, 0x10(%rsp)
testb $0xc, 0x2(%rbx)
leaq 0x10(%rsp), %rsi
je 0x8e7e
bswapl %eax
movl %eax, 0xc(%rsp)
movq %r15, %rsi
movl $0x4, %edx
movq %rbx, %rdi
callq 0x43d3
movslq 0x10(%rsp), %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x43d3
movq 0x10(%r14), %rsi
addq %r13, %rsi
testb $0xc, 0x2(%rbx)
je 0x8ebd
movl (%rsi), %eax
bswapl %eax
movl %eax, 0xc(%rsp)
movl $0x4, %edx
movq %rbx, %rdi
movq %r15, %rsi
jmp 0x8ec5
movl $0x4, %edx
movq %rbx, %rdi
callq 0x43d3
incq %rbp
movl (%r14), %eax
addq $0x4, %r13
cmpq %rax, %rbp
jne 0x8e54
movq %rbx, %rdi
callq 0x40e3
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_O3/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, %r14
movq 0x30(%rdi), %rbx
testq %rbx, %rbx
jne 0x8f56
movq %rdi, %r15
xorl %eax, %eax
callq 0x4f74
movq %rax, %rbx
cmpl $0x0, (%r15)
jle 0x8f52
xorl %r13d, %r13d
leaq 0xc(%rsp), %r12
movq 0x20(%r15), %rax
movq (%rax,%r13,8), %rsi
movq %rbx, %rdi
movq %r12, %rdx
callq 0x5340
movq 0x20(%rbx), %rcx
movl %eax, %eax
movq %r13, (%rcx,%rax,8)
incq %r13
movslq (%r15), %rax
cmpq %rax, %r13
jl 0x8f2a
movq %rbx, 0x30(%r15)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4fec
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl (%rbx), %ecx
je 0x8f75
movq 0x20(%rbx), %rax
movl %ecx, %ecx
movl (%rax,%rcx,8), %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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:
testl %edi, %edi
jle 0x9074
movl %edi, %ecx
xorl %edx, %edx
movl $0x3c1a7, %edi          # imm = 0x3C1A7
xorl %eax, %eax
movl (%rsi,%rdx,4), %r8d
leal (%r8,%r8), %r9d
btl %r9d, %edi
movl $0x0, %r9d
sbbl %r9d, %r9d
shrl $0x4, %r8d
andl %r9d, %r8d
addl %r8d, %eax
incq %rdx
cmpq %rdx, %rcx
jne 0x904c
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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:
testl %edi, %edi
jle 0x90ad
movl %edi, %edx
xorl %edi, %edi
xorl %eax, %eax
movl (%rsi,%rdi,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 %r8d, %eax
incq %rdi
cmpq %rdi, %rdx
jne 0x9081
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/DReichLab[P]adna/sam.c
// Function: swap_data
static void swap_data(const bam1_core_t *c, int l_data, uint8_t *data)
{
	uint8_t *s;
	uint32_t *cigar = (uint32_t*)(data + c->l_qname);
	int i;
	s = data + c->n_cigar*4 + c->l_qname + c->l_qseq + (c->l_qseq + 1)/2;
	for (i = 0; i < c->n_cigar; ++i) ed_swap_4p(&cigar[i]);
	while (s < data + l_data) {
		uint8_t type;
		s += 2; // skip key
		type = toupper(*s); ++s; // skip type
		if (type == 'C' || type == 'A') ++s;
		else if (type == 'S') { ed_swap_2p(s); s += 2; }
		else if (type == 'I' || type == 'F') { ed_swap_4p(s); s += 4; }
		else if (type == 'D') { ed_swap_8p(s); s += 8; }
		else if (type == 'Z' || type == 'H') { while (*s) ++s; ++s; }
		else if (type == 'B') {
			int32_t n, Bsize = aux_type2size(*s);
			memcpy(&n, s + 1, 4);
			if (Bsize == 2) {
				for (i = 0; i < n; i += 2)
					ed_swap_2p(s + 5 + i);
			} else if (Bsize == 4) {
				for (i = 0; i < n; i += 4)
					ed_swap_4p(s + 5 + i);
			}
			ed_swap_4p(s+1); 
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq 0x8(%rdi), %rcx
movl %ecx, %eax
shrl $0x18, %eax
addq %rdx, %rax
shrq $0x30, %rcx
leaq (%rax,%rcx,4), %rdx
movslq 0x10(%rdi), %r8
addq %r8, %rdx
leal 0x1(%r8), %r9d
shrl $0x1f, %r9d
addl %r9d, %r8d
incl %r8d
sarl %r8d
movslq %r8d, %r14
addq %rdx, %r14
testq %rcx, %rcx
je 0x928a
xorl %ecx, %ecx
movl (%rax,%rcx,4), %edx
bswapl %edx
movl %edx, (%rax,%rcx,4)
incq %rcx
movzwl 0xe(%rdi), %edx
cmpq %rdx, %rcx
jb 0x9276
movslq %esi, %rax
addq %rax, %rbx
cmpq %rbx, %r14
jae 0x93ec
callq 0x2030
movq (%rax), %rax
leaq 0x5194(%rip), %rcx      # 0xe43c
movabsq $0x120000001, %rdx      # imm = 0x120000001
movabsq $0x400000005, %rsi      # imm = 0x400000005
movzbl 0x2(%r14), %edi
movl (%rax,%rdi,4), %r8d
movl %r8d, %edi
andl $0xfd, %edi
cmpl $0x41, %edi
jne 0x92dc
addq $0x4, %r14
jmp 0x936d
leaq 0x3(%r14), %rdi
movzbl %r8b, %r9d
leal -0x42(%r9), %r8d
cmpl $0x7, %r8d
ja 0x9308
movslq (%rcx,%r8,4), %r8
addq %rcx, %r8
jmpq *%r8
movl 0x3(%r14), %edi
bswapl %edi
movl %edi, 0x3(%r14)
addq $0x7, %r14
jmp 0x936d
cmpl $0x53, %r9d
je 0x9363
movq %rdi, %r8
cmpl $0x5a, %r9d
je 0x9354
jmp 0x9370
movq 0x3(%r14), %rdi
bswapq %rdi
movq %rdi, 0x3(%r14)
addq $0xb, %r14
jmp 0x936d
movzbl (%rdi), %r8d
leal -0x41(%r8), %r9d
cmpl $0x22, %r9d
ja 0x937e
btq %r9, %rsi
jae 0x937e
movl 0x4(%r14), %r8d
addq $0x4, %r14
movq %r14, %r9
bswapl %r8d
movl %r8d, (%r9)
jmp 0x9370
movq %rdi, %r8
leaq 0x1(%r8), %rdi
cmpb $0x0, (%r8)
movq %rdi, %r8
jne 0x9354
jmp 0x9370
rolw $0x8, 0x3(%r14)
addq $0x5, %r14
movq %r14, %rdi
movq %rdi, %r14
cmpq %rbx, %rdi
jb 0x92bc
jmp 0x93ec
movl %r8d, %r9d
andb $-0x21, %r9b
cmpb $0x53, %r9b
jne 0x93ad
leaq 0x4(%r14), %r9
movslq 0x4(%r14), %r8
testq %r8, %r8
jle 0x9349
xorl %r10d, %r10d
rolw $0x8, 0x8(%r14,%r10)
addq $0x2, %r10
cmpq %r8, %r10
jb 0x939b
jmp 0x9349
addl $-0x49, %r8d
cmpl $0x20, %r8d
ja 0x933e
btq %r8, %rdx
jae 0x933e
leaq 0x4(%r14), %r9
movslq 0x4(%r14), %r8
testq %r8, %r8
jle 0x9349
xorl %r10d, %r10d
movl 0x8(%r14,%r10), %r11d
bswapl %r11d
movl %r11d, 0x8(%r14,%r10)
addq $0x4, %r10
cmpq %r8, %r10
jb 0x93d1
jmp 0x9349
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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)
movdqu 0x10(%rbx), %xmm0
movdqa %xmm0, 0x20(%rsp)
addl $0x24, %esi
callq 0x4378
testb $0xc, 0x2(%r14)
je 0x94cd
xorl %eax, %eax
pxor %xmm0, %xmm0
movdqa 0x10(%rsp,%rax,4), %xmm1
movdqa %xmm1, %xmm2
punpckhbw %xmm0, %xmm2    # xmm2 = xmm2[8],xmm0[8],xmm2[9],xmm0[9],xmm2[10],xmm0[10],xmm2[11],xmm0[11],xmm2[12],xmm0[12],xmm2[13],xmm0[13],xmm2[14],xmm0[14],xmm2[15],xmm0[15]
pshuflw $0x1b, %xmm2, %xmm2     # xmm2 = xmm2[3,2,1,0,4,5,6,7]
pshufhw $0x1b, %xmm2, %xmm2     # xmm2 = xmm2[0,1,2,3,7,6,5,4]
punpcklbw %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
pshuflw $0x1b, %xmm1, %xmm1     # xmm1 = xmm1[3,2,1,0,4,5,6,7]
pshufhw $0x1b, %xmm1, %xmm1     # xmm1 = xmm1[0,1,2,3,7,6,5,4]
packuswb %xmm2, %xmm1
movdqa %xmm1, 0x10(%rsp,%rax,4)
addq $0x4, %rax
cmpq $0x8, %rax
jne 0x946c
bswapl %ebp
leaq 0xc(%rsp), %rsi
movl %ebp, (%rsi)
movl $0x4, %edx
movq %r14, %rdi
callq 0x43d3
movl 0x20(%rbx), %esi
movq 0x28(%rbx), %rdx
movq %rbx, %rdi
callq 0x9236
jmp 0x94df
leaq 0x8(%rsp), %rsi
movl $0x4, %edx
movq %r14, %rdi
callq 0x43d3
leaq 0x10(%rsp), %rsi
movl $0x20, %edx
movq %r14, %rdi
callq 0x43d3
movq 0x28(%rbx), %rsi
movslq 0x20(%rbx), %rdx
movq %r14, %rdi
callq 0x43d3
testb $0xc, 0x2(%r14)
je 0x9517
movl 0x20(%rbx), %esi
movq 0x28(%rbx), %rdx
movq %rbx, %rdi
callq 0x9236
movl 0x8(%rsp), %eax
addl $0x4, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x8bb2
movq %rax, %r15
movl (%rax), %edi
testl %ebp, %ebp
jle 0x956a
testl %edi, %edi
jle 0x957c
movq 0x10(%r15), %rcx
xorl %edx, %edx
xorl %eax, %eax
movq %rax, %rsi
movl (%rcx,%rdx,4), %eax
cmpq %rax, %rsi
cmovgq %rsi, %rax
incq %rdx
cmpq %rdx, %rdi
jne 0x954d
addq $0x100, %rax            # imm = 0x100
jmp 0x9581
movl $0xe, %ebp
movl $0x5, %r8d
movl $0x1, %esi
jmp 0x95aa
movl $0x100, %eax            # imm = 0x100
movl $0x1, %edx
movl %ebp, %ecx
shll %cl, %edx
movslq %edx, %rcx
xorl %esi, %esi
cmpq %rcx, %rax
jle 0x95a7
xorl %esi, %esi
xorl %r8d, %r8d
incl %r8d
shlq $0x3, %rcx
cmpq %rcx, %rax
jg 0x9599
jmp 0x95aa
xorl %r8d, %r8d
movq 0x10(%rbx), %rax
shlq $0x10, %rax
movzwl 0xc(%rbx), %edx
orq %rax, %rdx
movl %ebp, %ecx
callq 0x5f20
movq %rax, %r14
movq %r15, %rdi
callq 0x8b3b
movl $0x1, %edi
movl $0x30, %esi
callq 0x21f0
movq %rax, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x90b0
testl %eax, %eax
js 0x9675
movq 0x8(%r15), %rdi
xorl %eax, %eax
movq %rdi, %rdx
shrq $0x30, %rdx
je 0x9638
movl %edi, %esi
shrl $0x18, %esi
addq 0x28(%r15), %rsi
xorl %r8d, %r8d
xorl %eax, %eax
movl (%rsi,%r8,4), %r9d
leal (%r9,%r9), %ecx
movl $0x3c1a7, %r10d         # imm = 0x3C1A7
shrl %cl, %r10d
shll $0x1e, %r10d
sarl $0x1f, %r10d
shrl $0x4, %r9d
andl %r10d, %r9d
addl %r9d, %eax
incq %r8
cmpq %r8, %rdx
jne 0x960d
cmpl $0x1, %eax
adcl $0x0, %eax
movl (%r15), %esi
movl 0x4(%r15), %edx
addl %edx, %eax
movq 0x10(%rbx), %rcx
shlq $0x10, %rcx
movzwl 0xc(%rbx), %r8d
orq %rcx, %r8
xorl %r9d, %r9d
btq $0x22, %rdi
setae %r9b
movq %r14, %rdi
movl %eax, %ecx
callq 0x68e8
testl %eax, %eax
jns 0x95dd
movq 0x10(%rbx), %rax
shlq $0x10, %rax
movzwl 0xc(%rbx), %esi
orq %rax, %rsi
movq %r14, %rdi
callq 0x5fd7
movq %r15, %rdi
callq 0x8f92
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x52d5(%rip), %rsi      # 0xe98a
callq 0x3ad0
testq %rax, %rax
je 0x96f5
movq %rax, %r14
movq %rax, %rdi
movl %ebp, %esi
callq 0x9527
movq %rax, %r15
movq %r14, %rdi
callq 0x44e0
xorl %edx, %edx
testl %ebp, %ebp
setle %dl
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6f95
movq %r15, %rdi
callq 0x6eab
xorl %eax, %eax
jmp 0x96fa
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r14
movq %rdx, %rsi
callq 0x90b0
testl %eax, %eax
js 0x9784
movl (%r14), %ecx
movl %ecx, (%r12)
movl 0x4(%r14), %edx
movl %edx, (%r15)
movq 0x8(%r14), %rsi
movq %rsi, %rdi
shrq $0x30, %rdi
movl $0x1, %r8d
je 0x977e
shrl $0x18, %esi
addq 0x28(%r14), %rsi
xorl %r9d, %r9d
xorl %r8d, %r8d
movl (%rsi,%r9,4), %r10d
leal (%r10,%r10), %ecx
movl $0x3c1a7, %r11d         # imm = 0x3C1A7
shrl %cl, %r11d
shll $0x1e, %r11d
sarl $0x1f, %r11d
shrl $0x4, %r10d
andl %r11d, %r10d
addl %r10d, %r8d
incq %r9
cmpq %r9, %rdi
jne 0x9753
addl %edx, %r8d
movl %r8d, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
testb $0x1, (%rdi)
jne 0x9af9
leaq 0x10(%rbx), %r13
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x5800
testl %eax, %eax
js 0x9b10
xorl %r14d, %r14d
xorl %r12d, %r12d
xorl %r15d, %r15d
movq %rbx, (%rsp)
movq 0x20(%rbx), %rbp
cmpb $0x40, (%rbp)
jne 0x9b16
movq %r13, %rbx
movslq (%r13), %r13
leaq (%r14,%r13), %rax
incq %rax
cmpq %r12, %rax
jb 0x9a6c
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, %r12
shrq $0x10, %r12
orq %rax, %r12
incq %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x22e0
movq %rax, %r15
leaq (%r15,%r14), %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x2240
leaq (%r14,%r13), %rbp
movb $0x0, (%r15,%rbp)
addq %r13, %r14
incq %r14
cmpq %r12, %r14
jb 0x9ad1
movq %r14, %rax
shrq %rax
orq %r14, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %r12
shrq $0x10, %r12
orq %rcx, %r12
incq %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x22e0
movq %rax, %r15
movq %rbx, %r13
movw $0xa, (%r15,%rbp)
movq (%rsp), %rbx
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
callq 0x5800
testl %eax, %eax
jns 0x9a09
jmp 0x9b16
movq 0x38(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8bb2
xorl %r15d, %r15d
xorl %r14d, %r14d
movq %r15, %rsi
callq 0x9790
movl %r14d, 0x8(%rax)
movq %r15, 0x28(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/DReichLab[P]adna/./kstring.h
// Function: kputw
static inline int kputw(int c, kstring_t *s)
{
	char buf[16];
	int l, x;
	if (c == 0) return kputc('0', s);
	for (l = 0, x = c < 0? -c : c; x > 0; x /= 10) buf[l++] = x%10 + '0';
	if (c < 0) buf[l++] = '-';
	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 (x = l - 1; x >= 0; --x) s->s[s->l++] = buf[x];
	s->s[s->l] = 0;
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
testl %edi, %edi
je 0x9e97
movl %edi, %eax
negl %eax
cmovsl %edi, %eax
xorl %r14d, %r14d
movl $0xcccccccd, %ecx       # imm = 0xCCCCCCCD
movl %eax, %edx
imulq %rcx, %rdx
shrq $0x23, %rdx
leal (%rdx,%rdx), %esi
leal (%rsi,%rsi,4), %esi
movl %eax, %r8d
subl %esi, %r8d
orb $0x30, %r8b
movb %r8b, (%rsp,%r14)
incq %r14
cmpl $0x9, %eax
movl %edx, %eax
ja 0x9dda
testl %edi, %edi
jns 0x9e10
movl %r14d, %eax
incl %r14d
movb $0x2d, (%rsp,%rax)
movq (%rbx), %rax
movslq %r14d, %rcx
addq %rcx, %rax
incq %rax
cmpq 0x8(%rbx), %rax
jb 0x9e67
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 0x22e0
movq %rax, 0x10(%rbx)
movl %r14d, %eax
incl %r14d
movq %rsp, %rcx
addq %rcx, %rax
decq %rax
movb (%rax), %cl
movq (%rbx), %rdx
movq 0x10(%rbx), %rsi
leaq 0x1(%rdx), %rdi
movq %rdi, (%rbx)
movb %cl, (%rsi,%rdx)
decl %r14d
decq %rax
cmpl $0x1, %r14d
jg 0x9e76
jmp 0x9efd
movq (%rbx), %rdx
leaq 0x1(%rdx), %rcx
cmpq 0x8(%rbx), %rcx
jae 0x9eaa
movq 0x10(%rbx), %rax
jmp 0x9ef6
movq %rcx, %rax
shrq %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rsi
shrq $0x10, %rsi
orq %rcx, %rsi
incq %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
callq 0x22e0
movq %rax, 0x10(%rbx)
movq (%rbx), %rdx
leaq 0x1(%rdx), %rcx
movq %rcx, (%rbx)
movb $0x30, (%rax,%rdx)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
movb $0x0, (%rcx,%rax)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/DReichLab[P]adna/./kstring.h
// Function: kputsn_
static inline void kputsn_(const void *p, int l, kstring_t *s)
{
	if (s->l + l > s->m) {
		s->m = s->l + l;
		kroundup32(s->m);
		s->s = (char*)realloc(s->s, s->m);
	}
	memcpy(s->s + s->l, p, l);
	s->l += l;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r15
movq (%rdx), %rdi
movslq %esi, %r14
leaq (%rdi,%r14), %rax
cmpq 0x8(%rdx), %rax
jbe 0xad62
decq %rax
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 0x22e0
movq %rax, 0x10(%rbx)
movq (%rbx), %rdi
jmp 0xad66
movq 0x10(%rbx), %rax
addq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2240
addq %r14, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/DReichLab[P]adna/./kstring.h
// Function: kputc_
static inline void kputc_(int c, kstring_t *s)
{
	if (s->l + 1 > s->m) {
		s->m = s->l + 1;
		kroundup32(s->m);
		s->s = (char*)realloc(s->s, s->m);
	}
	s->s[s->l++] = c;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebx
movq (%rsi), %rcx
leaq 0x1(%rcx), %rdx
cmpq 0x8(%rsi), %rdx
jbe 0xae35
movq %rcx, %rax
shrq %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rsi
shrq $0x10, %rsi
orq %rcx, %rsi
incq %rsi
movq %rsi, 0x8(%r14)
movq 0x10(%r14), %rdi
callq 0x22e0
movq %rax, 0x10(%r14)
movq (%r14), %rcx
leaq 0x1(%rcx), %rdx
jmp 0xae39
movq 0x10(%r14), %rax
movq %rdx, (%r14)
movb %bl, (%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xaec5
movq %rsi, %r15
leaq 0x10(%r14), %r12
leaq 0x8(%r14), %rax
movq %rax, (%rsp)
leaq 0x73ad(%rip), %r13      # 0x12220
cmpq $0x0, (%r12)
jne 0xae8e
movq %r14, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x5800
testl %eax, %eax
js 0xaedf
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x9f10
movl %eax, %ebp
movq $0x0, (%r12)
testl %eax, %eax
jns 0xaee4
cmpl $0x0, (%r13)
jg 0xaeba
cmpl $0x0, 0x4(%r15)
jne 0xae73
jmp 0xaee4
movq (%rsp), %rdi
callq 0x265c
jmp 0xaeb1
movq 0x38(%r14), %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x90b0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xc566
movl $0x1, %r14d
movl $0xcccccccd, %eax       # imm = 0xCCCCCCCD
movl %edi, %ecx
imulq %rax, %rcx
shrq $0x23, %rcx
leal (%rcx,%rcx), %edx
leal (%rdx,%rdx,4), %edx
movl %edi, %esi
subl %edx, %esi
orb $0x30, %sil
movb %sil, -0x1(%rsp,%r14)
incq %r14
cmpl $0x9, %edi
movl %ecx, %edi
ja 0xc4c5
movl %r14d, %eax
addq (%rbx), %rax
cmpq 0x8(%rbx), %rax
jb 0xc53d
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 0x22e0
movq %rax, 0x10(%rbx)
addq $-0x2, %r14
movl %r14d, %eax
movb (%rsp,%rax), %al
movq (%rbx), %rcx
movq 0x10(%rbx), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, (%rbx)
movb %al, (%rdx,%rcx)
decq %r14
leal 0x2(%r14), %eax
cmpl $0x1, %eax
jg 0xc541
jmp 0xc5cc
movq (%rbx), %rdx
leaq 0x1(%rdx), %rcx
cmpq 0x8(%rbx), %rcx
jae 0xc579
movq 0x10(%rbx), %rax
jmp 0xc5c5
movq %rcx, %rax
shrq %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rsi
shrq $0x10, %rsi
orq %rcx, %rsi
incq %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
callq 0x22e0
movq %rax, 0x10(%rbx)
movq (%rbx), %rdx
leaq 0x1(%rdx), %rcx
movq %rcx, (%rbx)
movb $0x30, (%rax,%rdx)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
movb $0x0, (%rcx,%rax)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xc760
leaq 0x10(%rbx), %rax
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0xaef5
movq 0x10(%rbx), %rdx
movq 0x20(%rbx), %rdi
movq 0x38(%rbx), %rcx
movl $0x1, %esi
callq 0x23b0
movq 0x38(%rbx), %rsi
movl $0xa, %edi
callq 0x21c0
movl 0x10(%rbx), %eax
incl %eax
popq %rbx
retq
movq 0x38(%rbx), %rdi
movq %rdx, %rsi
popq %rbx
jmp 0x93f4
// File: /workspace/github_c_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
pushq %rax
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), %r8d
sarl %r8d
movslq %r8d, %rbx
addq %rax, %rbx
addq %rdx, %rbx
movslq 0x20(%rdi), %r14
addq %rcx, %r14
cmpq %r14, %rbx
jae 0xc9ba
movsbl (%rsi), %eax
shll $0x8, %eax
movsbl 0x1(%rsi), %ebp
orl %eax, %ebp
movabsq $0x120000001, %r15      # imm = 0x120000001
leaq 0x1bcd(%rip), %r12      # 0xe49c
movabsq $0x400000005, %r13      # imm = 0x400000005
movzwl (%rbx), %eax
rolw $0x8, %ax
movzwl %ax, %eax
cmpl %ebp, %eax
je 0xc9be
callq 0x2030
movq (%rax), %rax
movzbl 0x2(%rbx), %ecx
movl (%rax,%rcx,4), %ecx
leaq 0x3(%rbx), %rax
movl $0x1, %edx
leal -0x41(%rcx), %esi
cmpl $0x7, %esi
ja 0xc93e
movslq (%r12,%rsi,4), %rsi
addq %r12, %rsi
jmpq *%rsi
movzbl (%rax), %ecx
leal -0x41(%rcx), %esi
cmpl $0x22, %esi
ja 0xc98b
movl $0x1, %edx
btq %rsi, %r13
jae 0xc98b
movslq 0x4(%rbx), %rcx
movl %edx, %edx
imulq %rcx, %rdx
leaq (%rax,%rdx), %rbx
addq $0x5, %rbx
jmp 0xc980
cmpl $0x63, %ecx
je 0xc97a
cmpl $0x5a, %ecx
jne 0xc956
leaq 0x1(%rax), %rbx
cmpb $0x0, (%rax)
movq %rbx, %rax
jne 0xc948
jmp 0xc980
movl %ecx, %esi
andl $-0x21, %esi
movl $0x2, %edx
cmpl $0x53, %esi
je 0xc97a
addl $-0x49, %ecx
cmpl $0x20, %ecx
ja 0xc978
movl $0x4, %edx
btq %rcx, %r15
jb 0xc97a
xorl %edx, %edx
addq %rdx, %rax
movq %rax, %rbx
cmpq %r14, %rbx
jb 0xc8d9
jmp 0xc9ba
movl %ecx, %esi
andb $-0x21, %sil
movl $0x2, %edx
cmpb $0x53, %sil
je 0xc92a
addl $-0x49, %ecx
cmpl $0x20, %ecx
ja 0xc9b3
movl $0x4, %edx
btq %rcx, %r15
jb 0xc92a
xorl %edx, %edx
jmp 0xc92a
xorl %ebx, %ebx
jmp 0xc9c2
addq $0x2, %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/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
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x20(%rdi), %r15d
movq 0x8(%rdi), %r12
movslq 0x10(%rdi), %r13
movq 0x28(%rdi), %rbp
callq 0x2030
movq (%rax), %rax
movzbl (%rbx), %ecx
movl (%rax,%rcx,4), %ecx
leaq 0x1(%rbx), %rax
movl $0x1, %edx
leal -0x41(%rcx), %esi
cmpl $0x7, %esi
ja 0xca63
leaq 0x1aa1(%rip), %rdi      # 0xe4bc
movslq (%rdi,%rsi,4), %rsi
addq %rdi, %rsi
movl %r15d, %r8d
jmpq *%rsi
movzbl (%rax), %ecx
leal -0x41(%rcx), %esi
cmpl $0x22, %esi
ja 0xcb12
movl $0x1, %edx
movabsq $0x400000005, %rdi      # imm = 0x400000005
btq %rsi, %rdi
jae 0xcb12
movslq 0x2(%rbx), %rcx
movl %edx, %edx
imulq %rcx, %rdx
leaq (%rax,%rdx), %r15
addq $0x5, %r15
jmp 0xcab2
cmpl $0x63, %ecx
movl %r15d, %r8d
je 0xcaac
cmpl $0x5a, %ecx
jne 0xca7e
leaq 0x1(%rax), %r15
cmpb $0x0, (%rax)
movq %r15, %rax
jne 0xca70
jmp 0xcab2
movl %ecx, %esi
andl $-0x21, %esi
movl $0x2, %edx
cmpl $0x53, %esi
je 0xcaac
addl $-0x49, %ecx
cmpl $0x20, %ecx
ja 0xcaaa
movl $0x4, %edx
movabsq $0x120000001, %rsi      # imm = 0x120000001
btq %rcx, %rsi
jb 0xcaac
xorl %edx, %edx
addq %rdx, %rax
movq %rax, %r15
addq $-0x2, %rbx
movq %r12, %rax
shrq $0x2e, %rax
andl $-0x4, %eax
addq %rax, %rbp
shrl $0x18, %r12d
leaq (%r12,%rbp), %rcx
leal 0x1(%r13), %edx
sarl %edx
movslq %edx, %rdx
addq %rdx, %rcx
addq %r13, %rcx
addl %r13d, %r12d
addl %eax, %r12d
addl %r12d, %edx
subl %edx, %r8d
movslq %r8d, %rdx
addq %rcx, %rdx
subq %r15, %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2310
subl %r15d, %ebx
addl %ebx, 0x20(%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ecx, %esi
andb $-0x21, %sil
movl $0x2, %edx
cmpb $0x53, %sil
je 0xca4f
addl $-0x49, %ecx
cmpl $0x20, %ecx
ja 0xcb48
movl $0x4, %edx
movabsq $0x120000001, %rsi      # imm = 0x120000001
btq %rcx, %rsi
jb 0xca4f
xorl %edx, %edx
jmp 0xca4f
// File: /workspace/github_c_makefile_star2_O3/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 0xcb82
movzbl %al, %eax
leaq 0x1977(%rip), %rcx      # 0xe4dc
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 0xcb8f
movl 0x1(%rdi), %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xcba6
xorps %xmm0, %xmm0
cmpl $0x64, %eax
jne 0xcbab
movsd 0x1(%rdi), %xmm0
retq
cvtss2sd 0x1(%rdi), %xmm0
retq
// File: /workspace/github_c_makefile_star2_O3/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, %r14
movq %rdi, %r15
movl $0x1, %edi
movl $0x68, %esi
callq 0x21f0
movq %rax, %rbx
movl $0x1, %edi
movl $0x18, %esi
callq 0x21f0
movq %rax, %r12
movq %rax, (%rbx)
movl $0x1, %edi
movl $0x50, %esi
callq 0x21f0
movq %rax, 0x10(%rbx)
movq %rax, 0x8(%rbx)
movl $0x2, (%r12)
movl $0x1, %edi
movl $0x50, %esi
callq 0x21f0
movq %rax, 0x18(%rbx)
movq $-0x1, 0x28(%rbx)
movl $0x704, 0x34(%rbx)      # imm = 0x704
movl $0x1f40, 0x40(%rbx)     # imm = 0x1F40
testq %r15, %r15
je 0xcc6c
movq %r15, 0x58(%rbx)
movq %r14, 0x60(%rbx)
movl $0x1, %edi
movl $0x30, %esi
callq 0x21f0
movq %rax, 0x50(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x0, 0x3c(%rdi)
je 0xd45f
retq
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
testq %rsi, %rsi
je 0xd578
movl (%r14), %ecx
xorl %eax, %eax
testl %ecx, %ecx
js 0xd581
movl 0xc(%r14), %edx
movl 0x34(%rbx), %esi
testw %dx, %si
jne 0xd581
cmpl %ecx, 0x20(%rbx)
jne 0xd4ac
movl 0x24(%rbx), %ecx
cmpl 0x4(%r14), %ecx
jne 0xd4ac
movq (%rbx), %rcx
movl (%rcx), %ecx
cmpl 0x40(%rbx), %ecx
jg 0xd581
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x8fae
movl 0x4(%r14), %edx
movq 0x10(%rbx), %rax
movl %edx, 0x30(%rax)
movq 0x8(%r14), %rsi
xorl %r8d, %r8d
movq %rsi, %rdi
shrq $0x30, %rdi
je 0xd50b
shrl $0x18, %esi
addq 0x28(%r14), %rsi
xorl %r9d, %r9d
xorl %r8d, %r8d
movl (%rsi,%r9,4), %r10d
leal (%r10,%r10), %ecx
movl $0x3c1a7, %r11d         # imm = 0x3C1A7
shrl %cl, %r11d
shll $0x1e, %r11d
sarl $0x1f, %r11d
shrl $0x4, %r10d
andl %r11d, %r10d
addl %r10d, %r8d
incq %r9
cmpq %r9, %rdi
jne 0xd4e0
leaq 0x3c(%rbx), %rdi
addl %edx, %r8d
movl %r8d, 0x34(%rax)
movups 0xfe3(%rip), %xmm0      # 0xe500
movups %xmm0, 0x38(%rax)
movq 0x10(%rbx), %r15
movl 0x34(%r15), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x44(%r15)
movl (%r14), %ecx
cmpl 0x28(%rbx), %ecx
jl 0xd5a0
movl 0x30(%r15), %edx
jne 0xd543
cmpl 0x2c(%rbx), %edx
jl 0xd5a7
movl %ecx, 0x28(%rbx)
movl %edx, 0x2c(%rbx)
cmpl 0x24(%rbx), %eax
jg 0xd558
movl (%r15), %ecx
xorl %eax, %eax
cmpl 0x20(%rbx), %ecx
jle 0xd581
movq (%rbx), %rax
incl (%rax)
movslq 0x4(%rax), %rcx
testq %rcx, %rcx
je 0xd587
movq 0x10(%rax), %rdx
leaq -0x1(%rcx), %rsi
movl %esi, 0x4(%rax)
movq -0x8(%rdx,%rcx,8), %rax
jmp 0xd596
movl $0x1, 0x30(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
movl $0x1, %edi
movl $0x50, %esi
callq 0x21f0
movq %rax, 0x48(%r15)
movq %rax, 0x10(%rbx)
jmp 0xd57f
callq 0x26a9
jmp 0xd5ac
callq 0x2681
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xd581
// File: /workspace/github_c_makefile_star2_O3/jech[P]dht/dht-example.c
// Function: set_nonblocking
static int
set_nonblocking(int fd, int nonblocking)
{
    int rc;
    rc = fcntl(fd, F_GETFL, 0);
    if(rc < 0)
        return -1;

    rc = fcntl(fd, F_SETFL,
               nonblocking ? (rc | O_NONBLOCK) : (rc & ~O_NONBLOCK));
    if(rc < 0)
        return -1;

    return 0;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
movl $0x3, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x20d0
testl %eax, %eax
js 0x2f64
orl $0x800, %eax            # imm = 0x800
movl %ebx, %edi
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x20d0
sarl $0x1f, %eax
jmp 0x2f69
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jech[P]dht/dht-example.c
// Function: callback
static void
callback(void *closure,
         int event,
         const unsigned char *info_hash,
         const void *data, size_t data_len)
{
    if(event == DHT_EVENT_SEARCH_DONE)
        printf("Search done.\n");
    else if(event == DHT_EVENT_SEARCH_DONE6)
        printf("IPv6 search done.\n");
    else if(event == DHT_EVENT_VALUES)
        printf("Received %d values.\n", (int)(data_len / 6));
    else if(event == DHT_EVENT_VALUES6)
        printf("Received %d IPv6 values.\n", (int)(data_len / 18));
    else
        printf("Unknown DHT event %d.\n", event);
}

// Assembly:
leal -0x1(%rsi), %eax
cmpl $0x3, %eax
ja 0x2fd7
leaq 0x6096(%rip), %rcx      # 0x9010
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
movq %r8, %rax
mulq %rcx
shrq $0x2, %rdx
leaq 0x61a3(%rip), %rdi      # 0x9141
jmp 0x2fd3
leaq 0x625c(%rip), %rdi      # 0x9203
jmp 0x20a0
leaq 0x623e(%rip), %rdi      # 0x91f1
jmp 0x20a0
movabsq $-0x1c71c71c71c71c71, %rcx # imm = 0xE38E38E38E38E38F
movq %r8, %rax
mulq %rcx
shrq $0x4, %rdx
leaq 0x6183(%rip), %rdi      # 0x9156
movl %edx, %esi
jmp 0x2fde
leaq 0x6192(%rip), %rdi      # 0x9170
xorl %eax, %eax
jmp 0x2100
// File: /workspace/github_c_makefile_star2_O3/jech[P]dht/dht-example.c
// Function: dht_hash
void
dht_hash(void *hash_return, int hash_size,
         const void *v1, int len1,
         const void *v2, int len2,
         const void *v3, int len3)
{
    const char *c1 = v1, *c2 = v2, *c3 = v3;
    char key[9];                /* crypt is limited to 8 characters */
    int i;

    memset(key, 0, 9);
#define CRYPT_HAPPY(c) ((c % 0x60) + 0x20)

    for(i = 0; i < 2 && i < len1; i++)
        key[i] = CRYPT_HAPPY(c1[i]);
    for(i = 0; i < 4 && i < len1; i++)
        key[2 + i] = CRYPT_HAPPY(c2[i]);
    for(i = 0; i < 2 && i < len1; i++)
        key[6 + i] = CRYPT_HAPPY(c3[i]);
    strncpy(hash_return, crypt(key, "jc"), hash_size);
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movb $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
testl %ecx, %ecx
jle 0x30fa
movq 0x30(%rsp), %rax
xorl %esi, %esi
cmpl $0x1, %ecx
setne %sil
incq %rsi
xorl %edi, %edi
movsbl (%rdx,%rdi), %r9d
imull $0x2b, %r9d, %r10d
movzwl %r10w, %r10d
movl %r10d, %r11d
shrl $0xf, %r11d
shrl $0xc, %r10d
addb %r11b, %r10b
movzbl %r10b, %r10d
shll $0x5, %r10d
leal (%r10,%r10,2), %r10d
subb %r10b, %r9b
addb $0x20, %r9b
movb %r9b, 0x8(%rsp,%rdi)
incq %rdi
cmpq %rdi, %rsi
jne 0x3024
testl %ecx, %ecx
jle 0x30fa
leal -0x1(%rcx), %esi
cmpl $0x3, %esi
movl $0x3, %edx
cmovbl %esi, %edx
incl %edx
xorl %esi, %esi
movsbl (%r8,%rsi), %edi
imull $0x2b, %edi, %r9d
movzwl %r9w, %r9d
movl %r9d, %r10d
shrl $0xf, %r10d
shrl $0xc, %r9d
addb %r10b, %r9b
movzbl %r9b, %r9d
shll $0x5, %r9d
leal (%r9,%r9,2), %r9d
subb %r9b, %dil
addb $0x20, %dil
movb %dil, 0xa(%rsp,%rsi)
incq %rsi
cmpq %rsi, %rdx
jne 0x3079
testl %ecx, %ecx
jle 0x30fa
xorl %edx, %edx
cmpl $0x1, %ecx
setne %dl
incq %rdx
xorl %ecx, %ecx
movsbl (%rax,%rcx), %esi
imull $0x2b, %esi, %edi
movzwl %di, %edi
movl %edi, %r8d
shrl $0xf, %r8d
shrl $0xc, %edi
addb %r8b, %dil
movzbl %dil, %edi
shll $0x5, %edi
leal (%rdi,%rdi,2), %edi
subb %dil, %sil
addb $0x20, %sil
movb %sil, 0xe(%rsp,%rcx)
incq %rcx
cmpq %rcx, %rdx
jne 0x30c5
leaq 0x603d(%rip), %rsi      # 0x913e
leaq 0x8(%rsp), %rdi
callq 0x2320
movslq %ebp, %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2090
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jech[P]dht/dht-example.c
// Function: dht_random_bytes
int
dht_random_bytes(void *buf, size_t size)
{
    int fd, rc, save;

    fd = open("/dev/urandom", O_RDONLY);
    if(fd < 0)
        return -1;

    rc = read(fd, buf, size);

    save = errno;
    close(fd);
    errno = save;

    return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x5f1c(%rip), %rdi      # 0x9050
xorl %esi, %esi
xorl %eax, %eax
callq 0x22a0
testl %eax, %eax
js 0x316a
movl %eax, %ebp
movl %eax, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2180
movq %rax, %rbx
callq 0x2060
movq %rax, %r14
movl (%rax), %r15d
movl %ebp, %edi
callq 0x2160
movl %r15d, (%r14)
jmp 0x316f
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jech[P]dht/dht.c
// Function: find_bucket
static struct bucket *
find_bucket(unsigned const char *id, int af)
{
    struct bucket *b = af == AF_INET ? buckets : buckets6;

    if(b == NULL)
        return NULL;

    while(1) {
        if(b->next == NULL)
            return b;
        if(id_cmp(id, b->next->first) < 0)
            return b;
        b = b->next;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpl $0x2, %esi
leaq 0xa6ae(%rip), %rax      # 0xdc50
leaq 0xa6af(%rip), %rcx      # 0xdc58
cmoveq %rax, %rcx
movq (%rcx), %r15
testq %r15, %r15
je 0x35de
movq %rdi, %rbx
movq %r15, %r14
movq 0xb8(%r15), %r15
testq %r15, %r15
je 0x35e1
leaq 0x4(%r15), %rsi
movl $0x14, %edx
movq %rbx, %rdi
callq 0x2190
testl %eax, %eax
jns 0x35b8
jmp 0x35e1
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jech[P]dht/dht.c
// Function: find_storage
static struct storage *
find_storage(const unsigned char *id)
{
    struct storage *st = storage;

    while(st) {
        if(id_cmp(id, st->id) == 0)
            break;
        st = st->next;
    }
    return st;
}

// Assembly:
movq 0xa66f(%rip), %rax      # 0xdc60
testq %rax, %rax
je 0x3629
movdqu (%rdi), %xmm0
movd 0x10(%rdi), %xmm1
movdqu (%rax), %xmm2
pcmpeqb %xmm0, %xmm2
movd 0x10(%rax), %xmm3
pcmpeqb %xmm1, %xmm3
pand %xmm2, %xmm3
pmovmskb %xmm3, %ecx
cmpl $0xffff, %ecx           # imm = 0xFFFF
je 0x362b
movq 0x28(%rax), %rax
testq %rax, %rax
jne 0x35ff
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/jech[P]dht/dht.c
// Function: debugf
__attribute__ ((format (printf, 1, 2)))
#endif
static void
debugf(const char *format, ...)
{
    va_list args;
    va_start(args, format);
    if(dht_debug)
        vfprintf(dht_debug, format, args);
    va_end(args);
    if(dht_debug)
        fflush(dht_debug);
}

// Assembly:
subq $0xd8, %rsp
movq %rdi, %r10
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x368a
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rdi, 0x10(%rsp)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rsp)
movq 0xa54f(%rip), %rdi      # 0xdc00
testq %rdi, %rdi
je 0x36c1
movq %rsp, %rdx
movq %r10, %rsi
callq 0x22d0
movq 0xa538(%rip), %rdi      # 0xdc00
testq %rdi, %rdi
je 0x36d2
callq 0x2240
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/jech[P]dht/dht.c
// Function: flush_search_node
static void
flush_search_node(struct search_node *n, struct search *sr)
{
    int i = n - sr->nodes, j;
    for(j = i; j < sr->numnodes - 1; j++)
        sr->nodes[j] = sr->nodes[j + 1];
    sr->numnodes--;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
subq %rsi, %rdi
addq $-0x30, %rdi
sarq $0x3, %rdi
movabsq $0x34f72c234f72c235, %rcx # imm = 0x34F72C234F72C235
imulq %rdi, %rcx
movl 0xce0(%rsi), %eax
decl %eax
cmpl %ecx, %eax
jle 0x3749
movslq %ecx, %r15
imulq $0xe8, %r15, %rax
leaq (%rax,%rbx), %r14
addq $0x118, %r14            # imm = 0x118
leaq -0xe8(%r14), %rdi
incq %r15
movl $0xe8, %edx
movq %r14, %rsi
callq 0x2200
movslq 0xce0(%rbx), %rax
decq %rax
addq $0xe8, %r14
cmpq %rax, %r15
jl 0x371c
movl %eax, 0xce0(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jech[P]dht/dht.c
// Function: dht_nodes
int
dht_nodes(int af, int *good_return, int *dubious_return, int *cached_return,
          int *incoming_return)
{
    int good = 0, dubious = 0, cached = 0, incoming = 0;
    struct bucket *b = af == AF_INET ? buckets : buckets6;

    while(b) {
        struct node *n = b->nodes;
        while(n) {
            if(node_good(n)) {
                good++;
                if(n->time > n->reply_time)
                    incoming++;
            } else {
                dubious++;
            }
            n = n->next;
        }
        if(b->cached.ss_family > 0)
            cached++;
        b = b->next;
    }
    if(good_return)
        *good_return = good;
    if(dubious_return)
        *dubious_return = dubious;
    if(cached_return)
        *cached_return = cached;
    if(incoming_return)
        *incoming_return = incoming;
    return good + dubious;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
cmpl $0x2, %edi
leaq 0xa0d3(%rip), %rax      # 0xdc50
leaq 0xa0d4(%rip), %rdi      # 0xdc58
cmoveq %rax, %rdi
movq (%rdi), %r11
testq %r11, %r11
je 0x3c0d
movq 0xa079(%rip), %rbx      # 0xdc10
leaq -0x1c20(%rbx), %r14
addq $-0x384, %rbx           # imm = 0xFC7C
xorl %r9d, %r9d
xorl %r10d, %r10d
xorl %eax, %eax
xorl %edi, %edi
movq 0x28(%r11), %r15
testq %r15, %r15
je 0x3bf5
cmpl $0x2, 0xb8(%r15)
jg 0x3bda
movq 0xa8(%r15), %r12
cmpq %r14, %r12
jl 0x3bda
movq 0xa0(%r15), %r13
cmpq %rbx, %r13
jge 0x3be5
incl %eax
movq 0xc0(%r15), %r15
jmp 0x3bb3
incl %edi
xorl %ebp, %ebp
cmpq %r12, %r13
setg %bpl
addl %ebp, %r9d
jmp 0x3bdc
cmpw $0x1, 0x30(%r11)
sbbl $-0x1, %r10d
movq 0xb8(%r11), %r11
testq %r11, %r11
jne 0x3baf
jmp 0x3c17
xorl %edi, %edi
xorl %eax, %eax
xorl %r10d, %r10d
xorl %r9d, %r9d
testq %rsi, %rsi
je 0x3c1e
movl %edi, (%rsi)
testq %rdx, %rdx
je 0x3c25
movl %eax, (%rdx)
testq %rcx, %rcx
je 0x3c2d
movl %r10d, (%rcx)
testq %r8, %r8
je 0x3c35
movl %r9d, (%r8)
addl %edi, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq