// File: /workspace/github_c_makefile_star2_O2/nh13[P]ksw/src/ksw2/ksw2_extd.c
// Function: ksw_extd
void ksw_extd(void *km, int qlen, const uint8_t *query, int tlen, const uint8_t *target, int8_t m, const int8_t *mat,
			  int8_t gapo, int8_t gape, int8_t gapo2, int8_t gape2, int w, int zdrop, int flag, ksw_extz_t *ez)
{
	eh_t *eh;
	int8_t *qp; // query profile
	int32_t i, j, k, max_j = 0, gapoe = gapo + gape, gapoe2 = gapo2 + gape2, n_col, *off = 0, with_cigar = !(flag&KSW_EZ_SCORE_ONLY);
	uint8_t *z = 0; // backtrack matrix; in each cell: f<<4|e<<2|h; in principle, we can halve the memory, but backtrack will be more complex

	ksw_reset_extz(ez);

	// allocate memory
	if (w < 0) w = tlen > qlen? tlen : qlen;
	n_col = qlen < 2*w+1? qlen : 2*w+1; // maximum #columns of the backtrack matrix
	qp = (int8_t*)kmalloc(km, qlen * m);
	eh = (eh_t*)kcalloc(km, qlen + 1, sizeof(eh_t));
	if (with_cigar) {
		z = (uint8_t*)kmalloc(km, (size_t)n_col * tlen);
		off = (int32_t*)kcalloc(km, tlen, 4);
	}

	// generate the query profile
	for (k = i = 0; k < m; ++k) {
		const int8_t *p = &mat[k * m];
		for (j = 0; j < qlen; ++j) qp[i++] = p[query[j]];
	}

	// fill the first row
	eh[0].h = 0, eh[0].e = -gapoe - gapoe, eh[0].e2 = -gapoe2 - gapoe2;
	for (j = 1; j <= qlen && j <= w; ++j) {
		int tmp;
		eh[j].h = -(gapo + gape * j) > -(gapo2 + gape2 * j)? -(gapo + gape * j) : -(gapo2 + gape2 * j);
		tmp = -(gapoe + gape * j) > -(gapoe2 + gape2 * j)? -(gapoe + gape * j) : -(gapoe2 + gape2 * j);
		eh[j].e = tmp - gapoe;
		eh[j].e2 = tmp - gapoe2;
	}
	for (; j <= qlen; ++j) eh[j].h = eh[j].e = eh[j].e2 = KSW_NEG_INF; // everything is -inf outside the band

	// DP loop
	for (i = 0; i < tlen; ++i) { // target sequence is in the outer loop
		int32_t f, f2, h1, st, en, max = KSW_NEG_INF, tmp;
		int8_t *q = &qp[target[i] * qlen];
		st = i > w? i - w : 0;
		en = i + w < qlen - 1? i + w : qlen - 1;
		tmp = -(gapoe + gape * i) > -(gapoe2 + gape2 * i)? -(gapoe + gape * i) : -(gapoe2 + gape2 * i);
		h1 = st > 0? KSW_NEG_INF : tmp;
		f  = st > 0? KSW_NEG_INF : tmp - gapoe;
		f2 = st > 0? KSW_NEG_INF : tmp - gapoe2;
		if (!with_cigar) {
			for (j = st; j <= en; ++j) {
				eh_t *p = &eh[j];
				int32_t h = p->h, h2, e = p->e, e2 = p->e2;
				p->h = h1;
				h += q[j];
				h = h >= e?  h : e;
				h = h >= f?  h : f;
				h = h >= e2? h : e2;
				h = h >= f2? h : f2;
				h1 = h;
				max_j = max > h? max_j : j;
				max   = max > h? max   : h;
				h -= gapoe;
				e -= gape;
				e  = e > h? e : h;
				p->e = e;
				f -= gape;
				f  = f > h? f : h;
				h2 = h1 - gapoe2;
				e2-= gape2;
				e2 = e2 > h2? e2 : h2;
				p->e2 = e2;
				f2-= gape2;
				f2 = f2 > h2? f2 : h2;
			}
		} else if (!(flag&KSW_EZ_RIGHT)) {
			uint8_t *zi = &z[(long)i * n_col];
			off[i] = st;
			for (j = st; j <= en; ++j) {
				eh_t *p = &eh[j];
				int32_t h = p->h, h2, e = p->e, e2 = p->e2;
				uint8_t d; // direction
				p->h = h1;
				h += q[j];
				d = h >= e?  0 : 1;
				h = h >= e?  h : e;
				d = h >= f?  d : 2;
				h = h >= f?  h : f;
				d = h >= e2? d : 3;
				h = h >= e2? h : e2;
				d = h >= f2? d : 4;
				h = h >= f2? h : f2;
				h1 = h;
				max_j = max > h? max_j : j;
				max   = max > h? max   : h;
				h -= gapoe;
				e -= gape;
				d |= e > h? 1<<3 : 0;
				e  = e > h? e    : h;
				p->e = e;
				f -= gape;
				d |= f > h? 1<<4 : 0; // if we want to halve the memory, use one bit only, instead of two
				f  = f > h? f    : h;
				h2 = h1 - gapoe2;
				e2-= gape2;
				d |= e2 > h2? 1<<5 : 0;
				e2 = e2 > h2? e2 : h2;
				p->e2 = e2;
				f2-= gape2;
				d |= f2 > h2? 1<<6 : 0;
				f2 = f2 > h2? f2 : h2;
				zi[j - st] = d; // z[i,j] keeps h for the current cell and e/f for the next cell
			}
		} else {
			uint8_t *zi = &z[(long)i * n_col];
			off[i] = st;
			for (j = st; j <= en; ++j) {
				eh_t *p = &eh[j];
				int32_t h = p->h, h2, e = p->e, e2 = p->e2;
				uint8_t d; // direction
				p->h = h1;
				h += q[j];
				d = h > e?  0 : 1;
				h = h > e?  h : e;
				d = h > f?  d : 2;
				h = h > f?  h : f;
				d = h > e2? d : 3;
				h = h > e2? h : e2;
				d = h > f2? d : 4;
				h = h > f2? h : f2;
				h1 = h;
				max_j = max > h? max_j : j;
				max   = max > h? max   : h;
				h -= gapoe;
				e -= gape;
				d |= e >= h? 1<<3 : 0;
				e  = e >= h? e    : h;
				p->e = e;
				f -= gape;
				d |= f >= h? 1<<4 : 0; // if we want to halve the memory, use one bit only, instead of two
				f  = f >= h? f    : h;
				h2 = h1 - gapoe2;
				e2-= gape2;
				d |= e2 >= h2? 1<<5 : 0;
				e2 = e2 >= h2? e2 : h2;
				p->e2 = e2;
				f2-= gape2;
				d |= f2 >= h2? 1<<6 : 0;
				f2 = f2 >= h2? f2 : h2;
				zi[j - st] = d; // z[i,j] keeps h for the current cell and e/f for the next cell
			}
		}
		eh[j].h = h1, eh[j].e = KSW_NEG_INF;
		// update ez
		if (en == qlen - 1 && eh[qlen].h > ez->mqe)
			ez->mqe = eh[qlen].h, ez->mqe_t = i;
		if (i == tlen - 1)
			ez->mte = max, ez->mte_q = max_j;
		if (ksw_apply_zdrop(ez, 0, max, i, max_j, zdrop, gape2)) break;
		if (i == tlen - 1 && en == qlen - 1)
			ez->score = eh[qlen].h;
	}
	kfree(km, qp); kfree(km, eh);
	if (with_cigar) {
		int rev_cigar = !!(flag & KSW_EZ_REV_CIGAR);
		if (!ez->zdropped && !(flag&KSW_EZ_EXTZ_ONLY))
			ksw_backtrack(km, 0, rev_cigar, 0, z, off, 0, n_col, tlen-1, qlen-1, &ez->m_cigar, &ez->n_cigar, &ez->cigar);
		else if (ez->max_t >= 0 && ez->max_q >= 0)
			ksw_backtrack(km, 0, rev_cigar, 0, z, off, 0, n_col, ez->max_t, ez->max_q, &ez->m_cigar, &ez->n_cigar, &ez->cigar);
		kfree(km, z); kfree(km, off);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %r9d, %r15d
movq %r8, 0xd0(%rsp)
movq %rdx, %r12
movl %esi, %ebx
movq %rdi, %r14
movq 0x160(%rsp), %rsi
movl 0x158(%rsp), %eax
movl %eax, 0xc(%rsp)
movl 0x150(%rsp), %eax
movl %eax, 0x6c(%rsp)
movq 0x120(%rsp), %rax
movq %rax, 0x50(%rsp)
movl 0x148(%rsp), %eax
movsbl 0x138(%rsp), %edx
movq %rdx, 0x28(%rsp)
movsbl 0x140(%rsp), %edx
movq %rdx, (%rsp)
movsbl 0x128(%rsp), %edx
movq %rdx, 0x60(%rsp)
movsbl 0x130(%rsp), %r13d
movaps 0x3c9960(%rip), %xmm0   # 0x568150
movups %xmm0, 0x10(%rsi)
andl $0x0, 0x24(%rsi)
cmpl %ebx, %ecx
movl %ebx, %edx
movq %rcx, 0x18(%rsp)
cmovgl %ecx, %edx
testl %eax, %eax
cmovnsl %eax, %edx
movaps 0x3c9950(%rip), %xmm0   # 0x568160
movq %rdx, 0x70(%rsp)
leal 0x1(,%rdx,2), %ebp
cmpl %ebx, %ebp
cmovgel %ebx, %ebp
movq %rsi, 0x78(%rsp)
movups %xmm0, (%rsi)
movl %r9d, %eax
imull %ebx, %eax
movslq %eax, %rsi
callq 0x19e512
movq %rax, 0x88(%rsp)
movq %rbx, 0x48(%rsp)
leal 0x1(%rbx), %eax
movslq %eax, %rsi
pushq $0xc
popq %rdx
movq %r14, %rdi
callq 0x19e66e
movq %rax, 0x20(%rsp)
xorl %ebx, %ebx
testb $0x1, 0xc(%rsp)
movq %r14, 0xa8(%rsp)
movl %ebp, 0x68(%rsp)
jne 0x19e8aa
movslq %ebp, %rsi
movq 0x18(%rsp), %rbp
movslq %ebp, %rax
movq %rax, 0x10(%rsp)
imulq %rax, %rsi
movq %r14, %rdi
callq 0x19e512
movq %rax, 0x38(%rsp)
pushq $0x4
popq %rdx
movq %r14, %rdi
movq 0x10(%rsp), %rsi
callq 0x19e66e
movq %rax, 0x40(%rsp)
movq %rbp, %r10
jmp 0x19e8c1
movq $0x0, 0x38(%rsp)
movq $0x0, 0x40(%rsp)
movq 0x18(%rsp), %r10
movq 0x60(%rsp), %rax
addl %r13d, %eax
movq %rax, 0x10(%rsp)
movq (%rsp), %rax
movq 0x28(%rsp), %rbp
addl %ebp, %eax
movq %rax, 0x30(%rsp)
movq 0x78(%rsp), %r14
leaq 0x24(%r14), %rax
movq %rax, 0x90(%rsp)
movq 0x70(%rsp), %rax
addl %eax, %eax
movl %eax, 0x58(%rsp)
movq 0x48(%rsp), %rcx
testl %ecx, %ecx
movl $0x0, %eax
cmovgl %ecx, %eax
movsbq %r15b, %rsi
testl %r15d, %r15d
cmovlel %ebx, %r15d
xorl %ecx, %ecx
movq 0x88(%rsp), %r11
movq 0x50(%rsp), %rdx
cmpq %r15, %rbx
je 0x19e957
movq %rbx, %rdi
imulq %rsi, %rdi
addq %rdx, %rdi
movslq %ecx, %rcx
xorl %r8d, %r8d
cmpq %r8, %rax
je 0x19e952
movzbl (%r12,%r8), %r9d
movb (%rdi,%r9), %r9b
movb %r9b, (%r11,%rcx)
incq %rcx
incq %r8
jmp 0x19e938
incq %rbx
jmp 0x19e923
movq %r10, %r12
movq 0x20(%rsp), %rcx
andl $0x0, (%rcx)
movq 0x10(%rsp), %rdx
leal (%rdx,%rdx), %eax
negl %eax
movl %eax, 0x4(%rcx)
movq 0x30(%rsp), %r11
leal (%r11,%r11), %eax
negl %eax
movl %eax, 0x8(%rcx)
movq 0x48(%rsp), %rax
movq 0x70(%rsp), %rdi
cmpl %edi, %eax
cmovll %eax, %edi
xorl %r8d, %r8d
testl %edi, %edi
cmovlel %r8d, %edi
leal 0x1(%rdi), %esi
imulq $0xc, %rdi, %rax
movq 0x60(%rsp), %rcx
leal (%rcx,%r13,2), %r9d
movq (%rsp), %rcx
leal (%rbp,%rcx,2), %r10d
movl %edx, %ebx
movl 0xc(%rsp), %r15d
movq 0x20(%rsp), %rdx
cmpq %r8, %rax
je 0x19ea05
cmpl %ebx, %r11d
movl %ebx, %ecx
cmovll %r11d, %ecx
negl %ecx
cmpl %r9d, %r10d
movl %r9d, %ebp
cmovll %r10d, %ebp
movl %ecx, 0xc(%rdx,%r8)
negl %ebp
movl %ebp, %ecx
subl 0x10(%rsp), %ecx
movl %ecx, 0x10(%rdx,%r8)
subl 0x30(%rsp), %ebp
movl %ebp, 0x14(%rdx,%r8)
addq $0xc, %r8
addl %r13d, %r9d
addl %r13d, %ebx
movq (%rsp), %rcx
addl %ecx, %r10d
addl %ecx, %r11d
jmp 0x19e9ba
movslq 0x48(%rsp), %rax
movl %edi, %ecx
imulq $0xc, %rcx, %rcx
movq 0x20(%rsp), %rdi
addq %rdi, %rcx
addq $0x14, %rcx
movabsq $-0x3fffffff40000000, %rdi # imm = 0xC0000000C0000000
movq %r12, %r11
cmpq %rax, %rsi
jg 0x19ea41
movl $0xc0000000, (%rcx)     # imm = 0xC0000000
movq %rdi, -0x8(%rcx)
incq %rsi
addq $0xc, %rcx
jmp 0x19ea29
movq 0x48(%rsp), %rcx
leal -0x1(%rcx), %edx
imulq $0xc, %rax, %rsi
movq 0x20(%rsp), %rcx
addq %rcx, %rsi
movq %rsi, 0x98(%rsp)
leal -0x1(%r11), %esi
movq %rsi, 0x50(%rsp)
movq 0x70(%rsp), %rsi
movslq %esi, %rdi
movq %rdi, 0xc8(%rsp)
xorl %edi, %edi
testl %r11d, %r11d
cmovlel %edi, %r11d
addq $0x8, %rcx
movq %rcx, 0x80(%rsp)
movl %esi, %ecx
negl %ecx
movq %rcx, 0xc0(%rsp)
movslq 0x58(%rsp), %rcx
incq %rcx
cmpq %rax, %rcx
cmovgeq %rax, %rcx
movq %rcx, 0xb0(%rsp)
movq %rdx, 0xa0(%rsp)
movslq %edx, %r8
movq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
xorl %ebp, %ebp
xorl %r12d, %r12d
movq %r13, 0x60(%rsp)
movq %r11, 0x18(%rsp)
movq %r8, 0xb8(%rsp)
cmpl %ebp, %esi
movl %ebp, %ecx
cmovgl %esi, %ecx
cmpq %r11, %rbp
je 0x19ef64
movq 0xc0(%rsp), %rax
addl %ecx, %eax
cltq
imulq $0xc, %rax, %r11
subl %esi, %ecx
movq 0xd0(%rsp), %rax
movzbl (%rax,%rbp), %eax
imull 0x48(%rsp), %eax
movslq %eax, %rbx
addq 0x88(%rsp), %rbx
movl %ebp, %eax
subl %esi, %eax
movq 0xc8(%rsp), %rdx
cmpq %rdx, %rbp
movl $0x0, %esi
cmovlel %esi, %eax
leaq (%rdx,%rbp), %rsi
movq 0xa0(%rsp), %rdx
cmpl %edx, %esi
movl %edx, %edi
movq %rsi, 0xd8(%rsp)
cmovll %esi, %edi
movslq %ecx, %rsi
movl %ebp, %ecx
imull %r13d, %ecx
movq 0x10(%rsp), %r8
addl %r8d, %ecx
movl %ebp, %r10d
imull (%rsp), %r10d
movq 0x30(%rsp), %r9
addl %r9d, %r10d
cmpl %ecx, %r10d
cmovgel %ecx, %r10d
negl %r10d
movl %r10d, %edx
subl %r8d, %edx
movl %r10d, %r8d
subl %r9d, %r8d
testl %eax, %eax
movl $0xc0000000, %ecx       # imm = 0xC0000000
cmovgl %ecx, %r10d
cmovgl %ecx, %edx
cmovgl %ecx, %r8d
movslq %edi, %r9
testb $0x1, %r15b
movq %rbp, 0xe0(%rsp)
jne 0x19ecb9
movq 0x40(%rsp), %rcx
movl %eax, (%rcx,%rbp,4)
cltq
testb $0x2, %r15b
jne 0x19ed56
addq 0x80(%rsp), %r11
movq 0x28(%rsp), %rcx
subq %rax, %rcx
movq %rcx, 0x58(%rsp)
movl $0xc0000000, %r15d      # imm = 0xC0000000
cmpq %r9, %rsi
jg 0x19ee53
movl -0x8(%r11), %ecx
movl -0x4(%r11), %eax
movl (%r11), %ebp
movl %r10d, -0x8(%r11)
movsbl (%rbx,%rsi), %r10d
addl %ecx, %r10d
xorl %edi, %edi
cmpl %eax, %r10d
setl %dil
cmovlel %eax, %r10d
cmpl %edx, %r10d
cmovlel %edx, %r10d
pushq $0x2
popq %rcx
cmovll %ecx, %edi
cmpl %ebp, %r10d
cmovlel %ebp, %r10d
pushq $0x3
popq %rcx
cmovll %ecx, %edi
cmpl %r8d, %r10d
cmovlel %r8d, %r10d
pushq $0x4
popq %rcx
cmovll %ecx, %edi
cmpl %r10d, %r15d
cmovlel %esi, %r12d
cmovlel %r10d, %r15d
movl %r10d, %r14d
subl 0x10(%rsp), %r14d
subl %r13d, %eax
cmpl %r14d, %eax
setg %cl
cmovlel %r14d, %eax
shlb $0x3, %cl
orb %dil, %cl
subl %r13d, %edx
cmpl %r14d, %edx
cmovlel %r14d, %edx
setg %dil
shlb $0x4, %dil
movl %r10d, %r14d
subl 0x30(%rsp), %r14d
movq (%rsp), %r13
subl %r13d, %ebp
cmpl %r14d, %ebp
cmovlel %r14d, %ebp
movl %eax, -0x4(%r11)
movl %ebp, (%r11)
setg %al
shlb $0x5, %al
subl %r13d, %r8d
movq 0x60(%rsp), %r13
cmpl %r14d, %r8d
cmovlel %r14d, %r8d
setg %bpl
orb %dil, %al
orb %cl, %al
shlb $0x6, %bpl
orb %bpl, %al
movq 0x58(%rsp), %rcx
movb %al, (%rcx,%rsi)
incq %rsi
addq $0xc, %r11
jmp 0x19ebd7
addq 0x80(%rsp), %r11
movl $0xc0000000, %r15d      # imm = 0xC0000000
cmpq %r9, %rsi
jg 0x19ee58
movl -0x8(%r11), %edi
movl -0x4(%r11), %ecx
movl (%r11), %eax
movl %r10d, -0x8(%r11)
movsbl (%rbx,%rsi), %r10d
addl %edi, %r10d
cmpl %ecx, %r10d
cmovlel %ecx, %r10d
cmpl %edx, %r10d
jg 0x19ecf6
movl %edx, %r10d
cmpl %eax, %r10d
jg 0x19ecfe
movl %eax, %r10d
cmpl %r8d, %r10d
cmovlel %r8d, %r10d
cmpl %r10d, %r15d
cmovlel %esi, %r12d
cmovlel %r10d, %r15d
movl %r10d, %edi
subl 0x10(%rsp), %edi
subl %r13d, %ecx
cmpl %edi, %ecx
jg 0x19ed20
movl %edi, %ecx
movl %ecx, -0x4(%r11)
subl %r13d, %edx
cmpl %edi, %edx
cmovlel %edi, %edx
movl %r10d, %ecx
subl 0x30(%rsp), %ecx
subl (%rsp), %eax
cmpl %ecx, %eax
jg 0x19ed3c
movl %ecx, %eax
movl %eax, (%r11)
subl (%rsp), %r8d
cmpl %ecx, %r8d
cmovlel %ecx, %r8d
incq %rsi
addq $0xc, %r11
jmp 0x19ecc7
addq 0x80(%rsp), %r11
movq 0x28(%rsp), %rcx
subq %rax, %rcx
movq %rcx, 0x58(%rsp)
movl $0xc0000000, %r15d      # imm = 0xC0000000
cmpq %r9, %rsi
jg 0x19ee53
movl -0x8(%r11), %ecx
movl -0x4(%r11), %eax
movl (%r11), %ebp
movl %r10d, -0x8(%r11)
movsbl (%rbx,%rsi), %r10d
addl %ecx, %r10d
xorl %edi, %edi
cmpl %eax, %r10d
setle %dil
cmovlel %eax, %r10d
cmpl %edx, %r10d
cmovlel %edx, %r10d
pushq $0x2
popq %rcx
cmovlel %ecx, %edi
cmpl %ebp, %r10d
cmovlel %ebp, %r10d
pushq $0x3
popq %rcx
cmovlel %ecx, %edi
cmpl %r8d, %r10d
cmovlel %r8d, %r10d
pushq $0x4
popq %rcx
cmovlel %ecx, %edi
cmpl %r10d, %r15d
cmovlel %esi, %r12d
cmovlel %r10d, %r15d
movl %r10d, %r14d
subl 0x10(%rsp), %r14d
subl %r13d, %eax
cmpl %r14d, %eax
setge %cl
cmovlel %r14d, %eax
shlb $0x3, %cl
orb %dil, %cl
subl %r13d, %edx
cmpl %r14d, %edx
cmovlel %r14d, %edx
setge %dil
shlb $0x4, %dil
movl %r10d, %r14d
subl 0x30(%rsp), %r14d
movq (%rsp), %r13
subl %r13d, %ebp
cmpl %r14d, %ebp
cmovlel %r14d, %ebp
movl %eax, -0x4(%r11)
movl %ebp, (%r11)
setge %al
shlb $0x5, %al
subl %r13d, %r8d
movq 0x60(%rsp), %r13
cmpl %r14d, %r8d
cmovlel %r14d, %r8d
setge %bpl
orb %dil, %al
orb %cl, %al
shlb $0x6, %bpl
orb %bpl, %al
movq 0x58(%rsp), %rcx
movb %al, (%rcx,%rsi)
incq %rsi
addq $0xc, %r11
jmp 0x19ed71
movq 0x78(%rsp), %r14
movq 0x18(%rsp), %r11
movslq %esi, %rax
imulq $0xc, %rax, %rax
movq 0x20(%rsp), %rcx
movl %r10d, (%rcx,%rax)
movl $0xc0000000, 0x4(%rcx,%rax) # imm = 0xC0000000
movq 0xb8(%rsp), %r8
movq 0xd8(%rsp), %r10
cmpq %r8, %r10
movq 0xe0(%rsp), %rbp
jl 0x19eeaa
movq 0x98(%rsp), %rax
movl (%rax), %eax
cmpl 0xc(%r14), %eax
jle 0x19eeaa
movl %eax, 0xc(%r14)
movl %ebp, 0x10(%r14)
cmpq 0x50(%rsp), %rbp
jne 0x19eeb9
movl %r15d, 0x14(%r14)
movl %r12d, 0x18(%r14)
movl (%r14), %eax
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
subl %r15d, %ecx
jge 0x19eee3
andl $0x80000000, %eax       # imm = 0x80000000
orl %r15d, %eax
movl %eax, (%r14)
movl %ebp, 0x8(%r14)
movl %r12d, 0x4(%r14)
movl 0xc(%rsp), %r15d
jmp 0x19ef1d
movslq 0x8(%r14), %rdx
cmpq %rdx, %rbp
movl 0xc(%rsp), %r15d
jl 0x19ef1d
cmpl $0x0, 0x6c(%rsp)
js 0x19ef1d
movl 0x4(%r14), %esi
cmpl %r12d, %esi
jg 0x19ef1d
addl %r12d, %edx
movl %ebp, %edi
subl %edx, %edi
addl %esi, %edi
movl %edi, %edx
negl %edx
cmovsl %edi, %edx
imull (%rsp), %edx
addl 0x6c(%rsp), %edx
cmpl %edx, %ecx
jg 0x19ef5c
cmpq 0x50(%rsp), %rbp
setne %al
cmpq %r8, %r10
setl %cl
orb %al, %cl
jne 0x19ef3d
movq 0x98(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x1c(%r14)
incq %rbp
movq 0x28(%rsp), %rax
addq 0xb0(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x70(%rsp), %rsi
jmp 0x19eada
orl $0x80000000, %eax       # imm = 0x80000000
movl %eax, (%r14)
movq 0xa8(%rsp), %rbx
movq %rbx, %rdi
movq 0x88(%rsp), %rsi
callq 0x19e38c
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
callq 0x19e38c
testb $0x1, %r15b
jne 0x19efd6
movl %r15d, %esi
shrl $0x7, %esi
andl $0x1, %esi
testb $0x40, %r15b
jne 0x19efe8
cmpl $0x0, (%r14)
js 0x19efe8
leaq 0x20(%r14), %rax
addq $0x28, %r14
movq %rbx, %rdi
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rcx
movl 0x68(%rsp), %r8d
movq 0x50(%rsp), %r9
pushq %r14
pushq 0x98(%rsp)
pushq %rax
pushq 0xb8(%rsp)
jmp 0x19f01f
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x8(%r14), %r9d
testl %r9d, %r9d
movl 0x68(%rsp), %r8d
js 0x19f028
movl 0x4(%r14), %eax
testl %eax, %eax
js 0x19f028
leaq 0x20(%r14), %r10
addq $0x28, %r14
movq %rbx, %rdi
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rcx
pushq %r14
pushq 0x98(%rsp)
pushq %r10
pushq %rax
callq 0x19f053
addq $0x20, %rsp
movq %rbx, %rdi
movq 0x38(%rsp), %rsi
callq 0x19e38c
movq %rbx, %rdi
movq 0x40(%rsp), %rsi
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x19e38c