// File: /workspace/github_c_makefile_star2_O0/DReichLab[P]adna/sam.c
// Function: bam_mplp_auto
int bam_mplp_auto(bam_mplp_t iter, int *_tid, int *_pos, int *n_plp, const bam_pileup1_t **plp)
{
	int i, ret = 0;
	uint64_t new_min = (uint64_t)-1;
	for (i = 0; i < iter->n; ++i) {
		if (iter->pos[i] == iter->min) {
			int tid, pos;
			iter->plp[i] = bam_plp_auto(iter->iter[i], &tid, &pos, &iter->n_plp[i]);
			iter->pos[i] = (uint64_t)tid<<32 | pos;
		}
		if (iter->plp[i] && iter->pos[i] < new_min) new_min = iter->pos[i];
	}
	iter->min = new_min;
	if (new_min == (uint64_t)-1) return 0;
	*_tid = new_min>>32; *_pos = (uint32_t)new_min;
	for (i = 0; i < iter->n; ++i) {
		if (iter->pos[i] == iter->min) { // FIXME: valgrind reports "uninitialised value(s) at this line"
			n_plp[i] = iter->n_plp[i], plp[i] = iter->plp[i];
			++ret;
		} else n_plp[i] = 0, plp[i] = 0;
	}
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl $0x0, -0x38(%rbp)
movq $-0x1, -0x40(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x1282a
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x127dd
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rcx
movslq -0x34(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rcx
leaq -0x44(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x122b0
movq %rax, %rdx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x34(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movslq -0x44(%rbp), %rdx
shlq $0x20, %rdx
movslq -0x48(%rbp), %rax
orq %rax, %rdx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x34(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x34(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x1281a
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq -0x40(%rbp), %rax
jae 0x1281a
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
jmp 0x1281c
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x12752
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
cmpq $-0x1, -0x40(%rbp)
jne 0x12849
movl $0x0, -0x4(%rbp)
jmp 0x1290b
movq -0x40(%rbp), %rax
shrq $0x20, %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x40(%rbp), %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x12905
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x128d6
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x128f5
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
jmp 0x128f7
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1286c
movl -0x38(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)