// File: /workspace/github_c_makefile_star2_O2/lh3[P]minigraph/miniwfa.c
// Function: wf_stripe_shrink
static void wf_stripe_shrink(wf_stripe_t *wf, int32_t tl, int32_t ql)
{
	int32_t j, d;
	for (d = wf->lo; d <= wf->hi; ++d) {
		for (j = 0; j < wf->n; ++j) {
			wf_slice_t *p = &wf->a[(wf->top + 1 + j) % wf->n];
			if (d < p->lo || d > p->hi) continue;
			if (good_diag(d, p->H[d], tl, ql)) break;
			if (good_diag(d, p->E1[d], tl, ql) || good_diag(d, p->F1[d], tl, ql)) break;
			if (good_diag(d, p->E2[d], tl, ql) || good_diag(d, p->F2[d], tl, ql)) break;
		}
		if (j < wf->n) break; // stop when we see a "good diagonal" in the stripe
	}
	assert(d <= wf->hi); // should never happen
	wf->lo = d;
	for (d = wf->hi; d >= wf->lo; --d) {
		for (j = 0; j < wf->n; ++j) {
			wf_slice_t *p = &wf->a[(wf->top + 1 + j) % wf->n];
			if (d < p->lo || d > p->hi) continue;
			if (good_diag(d, p->H[d], tl, ql)) break;
			if (good_diag(d, p->E1[d], tl, ql) || good_diag(d, p->F1[d], tl, ql)) break;
			if (good_diag(d, p->E2[d], tl, ql) || good_diag(d, p->F2[d], tl, ql)) break;
		}
		if (j < wf->n) break;
	}
	assert(d >= wf->lo);
	wf->hi = d;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ecx
movslq 0x10(%rdi), %r10
movslq 0x14(%rdi), %r9
pushq $0x1
popq %r8
cmpq %r9, %r10
jg 0x1081f
movl 0x8(%rdi), %r11d
testl %r11d, %r11d
movl $0x0, %r15d
cmovgl %r11d, %r15d
negl %r15d
movl %r8d, %r12d
leal (%r15,%r12), %eax
cmpl $0x1, %eax
je 0x106b5
movq 0x18(%rdi), %rbx
movl 0x4(%rdi), %r14d
leal (%r12,%r14), %eax
cltd
idivl %r11d
movslq %edx, %rax
imulq $0x38, %rax, %rax
movslq (%rbx,%rax), %rdx
cmpq %rdx, %r10
jl 0x106ad
addq %rbx, %rax
movslq 0x4(%rax), %rdx
cmpq %rdx, %r10
jg 0x106ad
movq 0x10(%rax), %rdx
movl (%rdx,%r10,4), %edx
cmpl $-0x1, %edx
setl %bpl
cmpl %esi, %edx
setge %r13b
orb %bpl, %r13b
jne 0x105f4
addl %r10d, %edx
cmpl $-0x1, %edx
setge %bpl
cmpl %ecx, %edx
setl %dl
testb %dl, %bpl
jne 0x106bd
movq 0x18(%rax), %rdx
movl (%rdx,%r10,4), %edx
cmpl $-0x1, %edx
setl %bpl
cmpl %esi, %edx
setge %r13b
orb %bpl, %r13b
jne 0x10626
addl %r10d, %edx
cmpl $-0x1, %edx
setge %bpl
cmpl %ecx, %edx
setl %dl
testb %dl, %bpl
jne 0x106bd
movq 0x28(%rax), %rdx
movl (%rdx,%r10,4), %edx
cmpl $-0x1, %edx
setl %bpl
cmpl %esi, %edx
setge %r13b
orb %bpl, %r13b
jne 0x10654
addl %r10d, %edx
cmpl $-0x1, %edx
setge %bpl
cmpl %ecx, %edx
setl %dl
testb %dl, %bpl
jne 0x106bd
movq 0x20(%rax), %rdx
movl (%rdx,%r10,4), %edx
cmpl $-0x1, %edx
setl %bpl
cmpl %esi, %edx
setge %r13b
orb %bpl, %r13b
jne 0x10682
addl %r10d, %edx
cmpl $-0x1, %edx
setge %bpl
cmpl %ecx, %edx
setl %dl
testb %dl, %bpl
jne 0x106bd
movq 0x30(%rax), %rax
movl (%rax,%r10,4), %eax
cmpl $-0x1, %eax
setge %dl
cmpl %esi, %eax
setl %bpl
testb %bpl, %dl
je 0x106ad
addl %r10d, %eax
cmpl $-0x1, %eax
setge %dl
cmpl %ecx, %eax
setl %al
testb %al, %dl
jne 0x106bd
incl %r12d
jmp 0x10581
incq %r10
jmp 0x10561
movl %r10d, 0x10(%rdi)
xorl %ebp, %ebp
testl %r11d, %r11d
cmovgl %r11d, %ebp
incl %r14d
cmpq %r10, %r9
jl 0x1083e
movl %r14d, %r8d
movl %ebp, %r15d
subl $0x1, %r15d
jb 0x10804
movl %r8d, %eax
cltd
idivl %r11d
movslq %edx, %rax
imulq $0x38, %rax, %rax
movslq (%rbx,%rax), %rdx
cmpq %rdx, %r9
jl 0x107fc
addq %rbx, %rax
movslq 0x4(%rax), %rdx
cmpq %rdx, %r9
jg 0x107fc
movq 0x10(%rax), %rdx
movl (%rdx,%r9,4), %edx
cmpl $-0x1, %edx
setl %r12b
cmpl %esi, %edx
setge %r13b
orb %r12b, %r13b
jne 0x10743
addl %r9d, %edx
cmpl $-0x1, %edx
setge %r12b
cmpl %ecx, %edx
setl %dl
testb %dl, %r12b
jne 0x1080c
movq 0x18(%rax), %rdx
movl (%rdx,%r9,4), %edx
cmpl $-0x1, %edx
setl %r12b
cmpl %esi, %edx
setge %r13b
orb %r12b, %r13b
jne 0x10775
addl %r9d, %edx
cmpl $-0x1, %edx
setge %r12b
cmpl %ecx, %edx
setl %dl
testb %dl, %r12b
jne 0x1080c
movq 0x28(%rax), %rdx
movl (%rdx,%r9,4), %edx
cmpl $-0x1, %edx
setl %r12b
cmpl %esi, %edx
setge %r13b
orb %r12b, %r13b
jne 0x107a3
addl %r9d, %edx
cmpl $-0x1, %edx
setge %r12b
cmpl %ecx, %edx
setl %dl
testb %dl, %r12b
jne 0x1080c
movq 0x20(%rax), %rdx
movl (%rdx,%r9,4), %edx
cmpl $-0x1, %edx
setl %r12b
cmpl %esi, %edx
setge %r13b
orb %r12b, %r13b
jne 0x107d1
addl %r9d, %edx
cmpl $-0x1, %edx
setge %r12b
cmpl %ecx, %edx
setl %dl
testb %dl, %r12b
jne 0x1080c
movq 0x30(%rax), %rax
movl (%rax,%r9,4), %eax
cmpl $-0x1, %eax
setge %dl
cmpl %esi, %eax
setl %r12b
testb %r12b, %dl
je 0x107fc
addl %r9d, %eax
cmpl $-0x1, %eax
setge %dl
cmpl %ecx, %eax
setl %al
testb %al, %dl
jne 0x1080c
incl %r8d
jmp 0x106dc
decq %r9
jmp 0x106cd
movl %r9d, 0x14(%rdi)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x13744(%rip), %rdi     # 0x23f6a
leaq 0x13547(%rip), %rsi     # 0x23d74
leaq 0x135f5(%rip), %rcx     # 0x23e29
movl $0x9d, %edx
callq 0x2160
leaq 0x1361b(%rip), %rdi     # 0x23e60
leaq 0x13528(%rip), %rsi     # 0x23d74
leaq 0x135d6(%rip), %rcx     # 0x23e29
movl $0xa9, %edx
callq 0x2160