// File: /workspace/github_c_makefile_star2_O0/lh3[P]minimap2/pe.c
// Function: mm_set_pe_thru
void mm_set_pe_thru(const int *qlens, int *n_regs, mm_reg1_t **regs)
{
	int s, i, n_pri[2], pri[2];
	n_pri[0] = n_pri[1] = 0;
	pri[0] = pri[1] = -1;
	for (s = 0; s < 2; ++s)
		for (i = 0; i < n_regs[s]; ++i)
			if (regs[s][i].id == regs[s][i].parent)
				++n_pri[s], pri[s] = i;
	if (n_pri[0] == 1 && n_pri[1] == 1) {
		mm_reg1_t *p = &regs[0][pri[0]];
		mm_reg1_t *q = &regs[1][pri[1]];
		if (p->rid == q->rid && p->rev == q->rev && abs(p->rs - q->rs) < 3 && abs(p->re - q->re) < 3
			&& ((p->qs == 0 && qlens[1] - q->qe == 0) || (q->qs == 0 && qlens[0] - p->qe == 0)))
		{
			p->pe_thru = q->pe_thru = 1;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x30(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x1c(%rbp)
cmpl $0x2, -0x1c(%rbp)
jge 0x183b0
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x10(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x183a0
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x18(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x20(%rbp), %rdx
imulq $0x50, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x20(%rcx), %eax
jne 0x18393
movslq -0x1c(%rbp), %rax
movl -0x28(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0x28(%rbp,%rax,4)
movl -0x20(%rbp), %ecx
movslq -0x1c(%rbp), %rax
movl %ecx, -0x30(%rbp,%rax,4)
jmp 0x18395
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x18334
jmp 0x183a2
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x18323
cmpl $0x1, -0x28(%rbp)
jne 0x184c2
cmpl $0x1, -0x24(%rbp)
jne 0x184c2
movq -0x18(%rbp), %rax
movq (%rax), %rax
movslq -0x30(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x40(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x184c0
movq -0x38(%rbp), %rax
movl 0x3c(%rax), %eax
shrl $0xa, %eax
andl $0x1, %eax
movq -0x40(%rbp), %rcx
movl 0x3c(%rcx), %ecx
shrl $0xa, %ecx
andl $0x1, %ecx
cmpl %ecx, %eax
jne 0x184c0
movq -0x38(%rbp), %rax
movl 0x18(%rax), %eax
movq -0x40(%rbp), %rcx
subl 0x18(%rcx), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
cmpl $0x3, %eax
jge 0x184c0
movq -0x38(%rbp), %rax
movl 0x1c(%rax), %eax
movq -0x40(%rbp), %rcx
subl 0x1c(%rcx), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
cmpl $0x3, %eax
jge 0x184c0
movq -0x38(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x18478
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x40(%rbp), %rcx
subl 0x14(%rcx), %eax
cmpl $0x0, %eax
je 0x18494
movq -0x40(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x184c0
movq -0x8(%rbp), %rax
movl (%rax), %eax
movq -0x38(%rbp), %rcx
subl 0x14(%rcx), %eax
cmpl $0x0, %eax
jne 0x184c0
movq -0x40(%rbp), %rax
movl 0x3c(%rax), %ecx
andl $0xffffbfff, %ecx       # imm = 0xFFFFBFFF
orl $0x4000, %ecx           # imm = 0x4000
movl %ecx, 0x3c(%rax)
movq -0x38(%rbp), %rax
movl 0x3c(%rax), %ecx
andl $0xffffbfff, %ecx       # imm = 0xFFFFBFFF
orl $0x4000, %ecx           # imm = 0x4000
movl %ecx, 0x3c(%rax)
jmp 0x184c2
popq %rbp
retq
nopw %cs:(%rax,%rax)