// File: /workspace/github_c_makefile_star2_O1/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
subq $0x28, %rsp
movl 0x10(%rdi), %r11d
movq %rdi, 0x18(%rsp)
movl 0x14(%rdi), %eax
movq %rax, 0x10(%rsp)
cmpl %eax, %r11d
setg %dil
jg 0x130d3
movl %edx, %ecx
movslq %r11d, %r10
movq 0x10(%rsp), %rdx
movslq %edx, %r9
movq 0x18(%rsp), %rax
movl 0x8(%rax), %ebp
testl %ebp, %ebp
setg 0xf(%rsp)
leal 0x1(%rdx), %eax
movl %eax, 0x24(%rsp)
movl %ebp, %r12d
negl %r12d
movb %dil, 0xe(%rsp)
testl %ebp, %ebp
jle 0x130b8
movq 0x18(%rsp), %rax
movq 0x18(%rax), %r13
movl 0x4(%rax), %r14d
movl $0x1, %ebx
movb 0xf(%rsp), %r15b
leal (%r14,%rbx), %eax
cltd
idivl %ebp
movslq %edx, %rax
imulq $0x38, %rax, %rax
movslq (%r13,%rax), %rdx
cmpq %rdx, %r10
jl 0x13095
addq %r13, %rax
movslq 0x4(%rax), %rdx
cmpq %rdx, %r10
jg 0x13095
movq 0x10(%rax), %rdx
movl (%rdx,%r10,4), %edx
cmpl $-0x1, %edx
setl %dil
cmpl %esi, %edx
setge %r8b
orb %dil, %r8b
jne 0x12fdc
addl %r11d, %edx
cmpl $-0x1, %edx
setge %dil
cmpl %ecx, %edx
setl %dl
testb %dl, %dil
jne 0x130b2
movq 0x18(%rax), %rdx
movl (%rdx,%r10,4), %edx
cmpl $-0x1, %edx
setl %dil
cmpl %esi, %edx
setge %r8b
orb %dil, %r8b
jne 0x1300e
addl %r11d, %edx
cmpl $-0x1, %edx
setge %dil
cmpl %ecx, %edx
setl %dl
testb %dl, %dil
jne 0x130b2
movq 0x28(%rax), %rdx
movl (%rdx,%r10,4), %edx
cmpl $-0x1, %edx
setl %dil
cmpl %esi, %edx
setge %r8b
orb %dil, %r8b
jne 0x1303c
addl %r11d, %edx
cmpl $-0x1, %edx
setge %dil
cmpl %ecx, %edx
setl %dl
testb %dl, %dil
jne 0x130b2
movq 0x20(%rax), %rdx
movl (%rdx,%r10,4), %edx
cmpl $-0x1, %edx
setl %dil
cmpl %esi, %edx
setge %r8b
orb %dil, %r8b
jne 0x1306a
addl %r11d, %edx
cmpl $-0x1, %edx
setge %dil
cmpl %ecx, %edx
setl %dl
testb %dl, %dil
jne 0x130b2
movq 0x30(%rax), %rax
movl (%rax,%r10,4), %eax
cmpl $-0x1, %eax
setl %dl
cmpl %esi, %eax
setge %dil
orb %dl, %dil
jne 0x13095
addl %r11d, %eax
cmpl $-0x1, %eax
setge %dl
cmpl %ecx, %eax
setl %al
testb %al, %dl
jne 0x130b2
cmpl %ebp, %ebx
setl %r15b
leal (%r12,%rbx), %eax
incl %eax
movl %ebx, %edx
incl %edx
movl %edx, %ebx
cmpl $0x1, %eax
jne 0x12f7e
jmp 0x130b8
testb $0x1, %r15b
jne 0x130f2
incl %r11d
cmpq %r9, %r10
leaq 0x1(%r10), %rax
setge %dil
movq %rax, %r10
cmpl %eax, 0x24(%rsp)
jne 0x12f5a
leaq 0x15e30(%rip), %rdi     # 0x28f0a
leaq 0x15c33(%rip), %rsi     # 0x28d14
leaq 0x15ce1(%rip), %rcx     # 0x28dc9
movl $0x9d, %edx
callq 0x2160
testb $0x1, 0xe(%rsp)
jne 0x130d3
movq 0x18(%rsp), %rax
movl %r10d, 0x10(%rax)
cmpl %r10d, 0x10(%rsp)
setl %bl
jl 0x132a9
movq 0x18(%rsp), %rax
movl 0x8(%rax), %r11d
testl %r11d, %r11d
setg 0xe(%rsp)
movslq %r10d, %r10
movl %r11d, %r14d
negl %r14d
testl %r11d, %r11d
jle 0x1328a
movq 0x18(%rsp), %rax
movq 0x18(%rax), %r15
movl 0x4(%rax), %r12d
movl $0x1, %edi
movb 0xe(%rsp), %r13b
leal (%r12,%rdi), %eax
cltd
idivl %r11d
movslq %edx, %rax
imulq $0x38, %rax, %rax
movslq (%r15,%rax), %rdx
cmpq %rdx, %r9
jl 0x13266
addq %r15, %rax
movslq 0x4(%rax), %rdx
cmpq %rdx, %r9
jg 0x13266
movq 0x10(%rax), %rdx
movl (%rdx,%r9,4), %edx
cmpl $-0x1, %edx
setl %r8b
cmpl %esi, %edx
setge %bpl
orb %r8b, %bpl
jne 0x131a9
addl 0x10(%rsp), %edx
cmpl $-0x1, %edx
setge %r8b
cmpl %ecx, %edx
setl %dl
testb %dl, %r8b
jne 0x13284
movq 0x18(%rax), %rdx
movl (%rdx,%r9,4), %edx
cmpl $-0x1, %edx
setl %r8b
cmpl %esi, %edx
setge %bpl
orb %r8b, %bpl
jne 0x131dc
addl 0x10(%rsp), %edx
cmpl $-0x1, %edx
setge %r8b
cmpl %ecx, %edx
setl %dl
testb %dl, %r8b
jne 0x13284
movq 0x28(%rax), %rdx
movl (%rdx,%r9,4), %edx
cmpl $-0x1, %edx
setl %r8b
cmpl %esi, %edx
setge %bpl
orb %r8b, %bpl
jne 0x1320b
addl 0x10(%rsp), %edx
cmpl $-0x1, %edx
setge %r8b
cmpl %ecx, %edx
setl %dl
testb %dl, %r8b
jne 0x13284
movq 0x20(%rax), %rdx
movl (%rdx,%r9,4), %edx
cmpl $-0x1, %edx
setl %r8b
cmpl %esi, %edx
setge %bpl
orb %r8b, %bpl
jne 0x1323a
addl 0x10(%rsp), %edx
cmpl $-0x1, %edx
setge %r8b
cmpl %ecx, %edx
setl %dl
testb %dl, %r8b
jne 0x13284
movq 0x30(%rax), %rax
movl (%rax,%r9,4), %eax
cmpl $-0x1, %eax
setl %dl
cmpl %esi, %eax
setge %r8b
orb %dl, %r8b
jne 0x13266
addl 0x10(%rsp), %eax
cmpl $-0x1, %eax
setge %dl
cmpl %ecx, %eax
setl %al
testb %al, %dl
jne 0x13284
cmpl %r11d, %edi
setl %r13b
leal (%r14,%rdi), %eax
incl %eax
movl %edi, %edx
incl %edx
movl %edx, %edi
cmpl $0x1, %eax
jne 0x1314a
jmp 0x1328a
testb $0x1, %r13b
jne 0x132c8
leaq -0x1(%r9), %rax
movq 0x10(%rsp), %rdx
decl %edx
movq %rdx, 0x10(%rsp)
cmpq %r10, %r9
setle %bl
movq %rax, %r9
jg 0x1312a
leaq 0x15b50(%rip), %rdi     # 0x28e00
leaq 0x15a5d(%rip), %rsi     # 0x28d14
leaq 0x15b0b(%rip), %rcx     # 0x28dc9
movl $0xa9, %edx
callq 0x2160
testb $0x1, %bl
jne 0x132a9
movq 0x18(%rsp), %rax
movl %r9d, 0x14(%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq