// File: /workspace/github_c_makefile_star2_O2/lh3[P]minigraph/miniwfa.c
// Function: wf_stripe_add
void wf_stripe_add(void *km, wf_stripe_t *wf, int32_t lo, int32_t hi)
{
	int32_t i, n, m1 = wf->max_pen + 1, m2 = m1 * 2;
	wf_slice_t *f;
	++wf->s;
	++wf->top;
	if (wf->top == wf->n) wf->top = 0;
	f = &wf->a[wf->top];
	f->lo = lo, f->hi = hi;
	n = hi - lo + 1;
	kfree(km, f->mem);
	f->mem = Kmalloc(km, int32_t, 5 * (n + m2));
	f->H = f->mem + m1;
	f->E1 = f->H  + n + m2;
	f->F1 = f->E1 + n + m2;
	f->E2 = f->F1 + n + m2;
	f->F2 = f->E2 + n + m2;
	for (i = -m1; i < 0; ++i)
		f->H[i] = f->E1[i] = f->E2[i] = f->F1[i] = f->F2[i] = WF_NEG_INF;
	for (i = n; i < n + m1; ++i)
		f->H[i] = f->E1[i] = f->E2[i] = f->F1[i] = f->F2[i] = WF_NEG_INF;
	f->H -= lo, f->E1 -= lo, f->E2 -= lo, f->F1 -= lo, f->F2 -= lo; // such that f->H[lo] points to 0
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, %r13d
movq %rdi, %r14
movslq 0xc(%rsi), %r15
leal 0x1(%r15), %eax
movl %eax, 0x8(%rsp)
leal 0x2(,%r15,2), %eax
movl %eax, 0x10(%rsp)
incl (%rsi)
movl 0x4(%rsi), %eax
incl %eax
xorl %ebp, %ebp
cmpl 0x8(%rsi), %eax
cmovel %ebp, %eax
movl %eax, 0x4(%rsi)
movq 0x18(%rsi), %rbx
cltq
imulq $0x38, %rax, %r12
leaq (%rbx,%r12), %rax
movq %rax, 0x40(%rsp)
movl %edx, (%rbx,%r12)
movl %ecx, 0x4(%rbx,%r12)
movl %edx, 0x1c(%rsp)
subl %edx, %r13d
leal 0x1(%r13), %eax
movl %eax, (%rsp)
movq 0x8(%rbx,%r12), %rsi
callq 0x2577
leal 0x3(%r13,%r15,2), %eax
leal (%rax,%rax,4), %eax
movslq %eax, %rsi
shlq $0x2, %rsi
movq %r14, %rdi
callq 0x266c
movq %rax, 0x8(%rbx,%r12)
movslq 0x8(%rsp), %r14
leaq (%rax,%r14,4), %rcx
movslq (%rsp), %rdi
movq %rcx, 0x8(%rsp)
leaq (%rcx,%rdi,4), %r8
movslq 0x10(%rsp), %r13
leaq (%r8,%r13,4), %rcx
movq %rcx, (%rsp)
leaq (%rcx,%rdi,4), %r9
leaq (%r9,%r13,4), %rcx
movq %rcx, 0x10(%rsp)
leaq (%rcx,%rdi,4), %r10
notq %r15
leaq (%rdi,%r13), %rcx
imulq $0xc, %rcx, %rdx
shlq $0x4, %rcx
leaq (,%r15,4), %rbx
leaq (,%r14,4), %rsi
leaq (%rsi,%r15,4), %rsi
addq %rsi, %rcx
addq %rax, %rcx
leaq (,%r13,8), %r11
leaq (%r11,%rdi,8), %r11
addq %rsi, %r11
addq %rax, %r11
addq %rax, %rsi
addq %rsi, %rdx
leaq (%rbx,%rdi,4), %rbx
leaq (%rbx,%r13,4), %rbx
movq %r14, 0x30(%rsp)
leaq (%rbx,%r14,4), %rbx
addq %rax, %rbx
leaq (%r10,%r13,4), %r14
movq %r14, 0x20(%rsp)
leaq (%r14,%rdi,4), %r12
movq %r13, 0x28(%rsp)
leaq (%r12,%r13,4), %r14
movq %r14, 0x38(%rsp)
movl $0xc0000000, %r14d      # imm = 0xC0000000
movq %r15, %r13
addq %rbp, %r13
jns 0xf9f0
movl %r14d, (%rcx,%rbp,4)
movl %r14d, (%r11,%rbp,4)
movl %r14d, (%rdx,%rbp,4)
movl %r14d, (%rbx,%rbp,4)
movl %r14d, (%rsi,%rbp,4)
incq %rbp
jmp 0xf9cf
movq 0x30(%rsp), %rsi
leal (%rdi,%rsi), %ecx
movslq %ecx, %rcx
imulq $0x14, %rdi, %rdx
movq 0x28(%rsp), %r11
shlq $0x4, %r11
addq %rdx, %r11
leaq (%r11,%rsi,4), %rdx
addq %rdx, %rax
xorl %edx, %edx
movl $0xc0000000, %esi       # imm = 0xC0000000
leaq (%rdi,%rdx), %r11
cmpq %rcx, %r11
jge 0xfa3a
movl %esi, (%rax,%rdx,4)
movl %esi, (%r10,%rdx,4)
movl %esi, (%r12,%rdx,4)
movl %esi, (%r9,%rdx,4)
movl %esi, (%r8,%rdx,4)
incq %rdx
jmp 0xfa19
movslq 0x1c(%rsp), %rax
shlq $0x2, %rax
movq 0x8(%rsp), %rdx
subq %rax, %rdx
movq 0x40(%rsp), %rcx
movq %rdx, 0x10(%rcx)
movq (%rsp), %rdx
subq %rax, %rdx
movq %rdx, 0x18(%rcx)
movq 0x20(%rsp), %rdx
subq %rax, %rdx
movq %rdx, 0x20(%rcx)
movq 0x10(%rsp), %rdx
subq %rax, %rdx
movq %rdx, 0x28(%rcx)
movq 0x38(%rsp), %rdx
subq %rax, %rdx
movq %rdx, 0x30(%rcx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq