// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: gen_cns_chain_linear(ul_ov_t*, long, asg_t const*, R_to_U*, long, long, double, Chain_Data*, long, long, long, unsigned long, unsigned long, unsigned long)
uint64_t gen_cns_chain_linear(ul_ov_t *a, int64_t a_n, /**ul_ov_t *ab,**/ const asg_t *rg, R_to_U *ri, int64_t qlen, int64_t bw, double diff_thre, Chain_Data* dp, 
int64_t max_skip, int64_t max_iter, int64_t max_dis, uint64_t mqs, uint64_t mqe, uint64_t ulid)
{
	if(a_n == 0) return 0;
	uint32_t li_v, lj_v; int32_t *f, *c_n, *len; int64_t *p, *t, st, max_ii, max, qo, cL, sn, ln, csn, mm_sn, cln, mm_ln; 
	int64_t mm_ovlp, x, i, j, sc, csc, mm_sc, mm_idx, n_skip, end_j, ch_sc, cn_sn, ch_ln, ch_i; ul_ov_t *li, *lj; 
	resize_Chain_Data(dp, a_n, NULL); 
	t = dp->tmp; f = dp->score; p = dp->pre; c_n = dp->occ; len = dp->indels;
        
	radix_sort_ul_ov_srt_qe(a, a + a_n);
    for (i = 1, j = 0; i <= a_n; i++) {
        if (i == a_n || a[i].qe != a[j].qe) {
            if(i - j > 1) radix_sort_ul_ov_srt_qs(a+j, a+i);
            j = i;
        }
    }

	memset(t, 0, (a_n*sizeof((*t)))); 
	ch_sc = ch_i = cn_sn = INT32_MIN; ch_ln = INT32_MAX;
	for (i = st = 0, max_ii = -1; i < a_n; ++i) {
        li = &(a[i]); 
        mm_ovlp = max_ovlp(rg, ((li->tn<<1)|li->rev)^1);        
        x = (li->qs + mm_ovlp)*diff_thre; 
        if(x < bw) x = bw; 
        x += li->qs + mm_ovlp;
        if (x > qlen+1) x = qlen+1;
        x = find_ul_ov_max(i, a, x+G_CHAIN_INDEL); 

		csc = 0; csn = 1; cln = 0; 
		if(is_contain_r((*ri), li->tn)) {csc = -1; csn = 0; cln = rg->seq[li->tn].len;}
        mm_sc = INT32_MIN+1; mm_sn = INT32_MIN+1; mm_ln = INT32_MAX; 
		mm_idx = -1; n_skip = 0; end_j = -1; 

		li_v = (li->tn<<1)|li->rev; li_v ^= 1;
        if ((x-st) > max_iter) st = x-max_iter;
		for (j = x; j >= st; --j) { // collect potential destination vertices
			lj = &(a[j]); 
			if(lj->qe+G_CHAIN_INDEL <= li->qs) break;//even this pair has a overlap, its length will be very small; just ignore
			if(f[j] == INT32_MIN) continue;///could not reach the left end
			sc = sn = ln = INT32_MIN;
			if(lj->qs <= li->qs && lj->qe <= li->qe) {///not contained
				lj_v = (lj->tn<<1)|lj->rev; lj_v ^= 1;
				qo = infer_rovlp(li, lj, NULL, NULL, NULL, NULL);
				if(gconnect_test(rg, li_v, lj_v, bw, diff_thre, qo)) {
					sc = f[j] + csc; sn = c_n[j] + csn; ln = len[j] + cln;
				}
			}
			if(sc == INT32_MIN) continue;
			if((sc > mm_sc) || ((sc == mm_sc) && (sn > mm_sn)) || 
				((sc == mm_sc) && (sn == mm_sn) && (ln < mm_ln))) {
				mm_sc = sc, mm_idx = j, mm_sn = sn, mm_ln = ln;
				if (n_skip > 0) --n_skip;
			} else if (t[j] == i) {
				if (++n_skip > max_skip) break;
			}
			if (p[j] >= 0) t[p[j]] = i;
		}
        
        end_j = j;
        if (max_ii < 0 || (a[i].qe > (a[max_ii].qe+max_dis))) {//too long
            max = INT32_MIN; max_ii = -1;
            for (j = i - 1; (j >= st) && (a[i].qe<=(max_dis+a[j].qe)); --j) {
                if (max < f[j]) {
                    max = f[j], max_ii = j;
                }
            }
        }
                
        if (max_ii >= 0 && max_ii < end_j) {///just have a try with a[i]<->a[max_ii]
			lj = &(a[max_ii]); 
			if(((lj->qe+G_CHAIN_INDEL)>li->qs) && (lj->qs<=li->qs) && (lj->qe<=li->qe) && (f[max_ii]!=INT32_MIN)) {
				lj_v = (lj->tn<<1)|lj->rev; lj_v ^= 1; sc = sn = ln = INT32_MIN;
				qo = infer_rovlp(li, lj, NULL, NULL, NULL, NULL);
				if(gconnect_test(rg, li_v, lj_v, bw, diff_thre, qo)) {
					sc = f[max_ii] + csc; sn = c_n[max_ii] + csn; ln = len[max_ii] + cln;
				}
				if(sc != INT32_MIN) {
					if((sc > mm_sc) || ((sc == mm_sc) && (sn > mm_sn)) || 
						((sc == mm_sc) && (sn == mm_sn) && (ln < mm_ln))) {
						mm_sc = sc, mm_idx = max_ii, mm_sn = sn, mm_ln = ln;
					}
				}
			}
		}

		if((mm_idx == -1) && (((int64_t)li->qs) > ((int64_t)(mqs+bw)))) {
			mm_sc = mm_idx = mm_sn = INT32_MIN; mm_ln = INT32_MAX;
		}
		if((mm_sc==(INT32_MIN+1))) {
			mm_sc = csc; mm_sn = csn; mm_ln = cln;
		}

        
        f[i] = mm_sc; p[i] = mm_idx; c_n[i] = mm_sn; len[i] = mm_ln;
        if ((max_ii < 0) || ((a[i].qe<=max_dis+a[max_ii].qe) && (f[max_ii]<f[i]))) {
            max_ii = i;
        }

		if((mm_sc!=INT32_MIN) && (((int64_t)(a[i].qe+bw))>=((int64_t)(mqe)))) {
			if((mm_sc > ch_sc) || ((mm_sc == ch_sc) && (mm_sn > cn_sn)) || 
				((mm_sc == ch_sc) && (mm_sn == cn_sn) && (mm_ln < ch_ln))) {
				ch_sc = mm_sc; ch_i = i; cn_sn = mm_sn; ch_ln = mm_ln;
			}
		}
		// if(ulid == 442462) {
		// 	fprintf(stderr, "[M::%s::id->%u::%.*s] i::%ld, q::[%u, %u), t::[%u, %u), is_cr::%u, mm_idx::%ld, end::%u\n", 
		// 	__func__, li->tn, (int)Get_NAME_LENGTH(R_INF, li->tn), Get_NAME(R_INF, li->tn), i, 
		// 	li->qs, li->qe, li->ts, li->te, !!(is_contain_r((*ri), li->tn)), mm_idx, !!(((int64_t)(a[i].qe+bw))>=((int64_t)(mqe))));
		// }
    }
	// if(ulid == 442462) {
	// 	fprintf(stderr, "[M::%s::] ch_i::%ld, mqs::%lu, mqe::%lu\n", 
	// 	__func__, ch_i, mqs, mqe);
	// }
	if(ch_i == INT32_MIN) return 0;

	i = ch_i; cL = 0;
    while (i >= 0) {t[cL++] = i; i = p[i];}
	for (i = 0; i < cL; i++) a[i] = a[t[cL-i-1]];
	return cL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movsd %xmm0, 0xa0(%rsp)
movq %r9, 0x38(%rsp)
movq %r8, 0xb8(%rsp)
testq %rsi, %rsi
je 0x1d2500
movq %rcx, %r13
movq %rsi, %rbp
movq %rdi, %r12
movq %rdx, 0x98(%rsp)
movq 0x120(%rsp), %r14
movq %r14, %rdi
xorl %edx, %edx
callq 0x3f828
movq 0x28(%r14), %rax
movq %rax, 0x18(%rsp)
movq (%r14), %rax
movq %rax, 0x20(%rsp)
movq 0x8(%r14), %rax
movq %rax, 0x28(%rsp)
movq 0x20(%r14), %rax
movq %rax, 0x90(%rsp)
movq 0x10(%r14), %rax
movq %rax, 0x88(%rsp)
leaq (,%rbp,8), %rax
addq %rbp, %rax
leaq (%rax,%rax,2), %rsi
addq %r12, %rsi
addq %rbp, %rsi
movq %r12, %rdi
callq 0x195511
testq %rbp, %rbp
jle 0x1d1d18
movq %rbp, %rbx
negq %rbx
leaq 0x1c(%r12), %r14
movl $0x1, %r15d
xorl %edi, %edi
movq %rbx, %rax
addq %r15, %rax
je 0x1d1cd9
movl 0x8(%r14), %eax
leaq (%rdi,%rdi,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %rdi, %rcx
cmpl 0x8(%r12,%rcx), %eax
jne 0x1d1cd9
movq %rdi, %rax
jmp 0x1d1d01
movq %r15, %rcx
subq %rdi, %rcx
movq %r15, %rax
cmpq $0x2, %rcx
jl 0x1d1d01
leaq (%rdi,%rdi,8), %rax
leaq (%rax,%rax,2), %rax
addq %r12, %rdi
addq %rax, %rdi
movq %r14, %rsi
callq 0x1957bd
movq %r15, %rax
leaq (%rbx,%r15), %rcx
incq %rcx
incq %r15
addq $0x1c, %r14
movq %rax, %rdi
cmpq $0x1, %rcx
jne 0x1d1cb6
leaq (,%rbp,8), %rdx
movq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x20e0
testq %rbp, %rbp
jle 0x1d24df
incq 0xb8(%rsp)
movq 0x140(%rsp), %rax
addq 0x38(%rsp), %rax
movq %rax, 0xd0(%rsp)
leaq -0x14(%r12), %rax
movq %rax, 0xc8(%rsp)
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, 0xa8(%rsp)
movq $-0x80000000, 0x70(%rsp) # imm = 0x80000000
movq $-0x1, 0xc0(%rsp)
movq $-0x80000000, 0x78(%rsp) # imm = 0x80000000
movq $-0x80000000, 0x80(%rsp) # imm = 0x80000000
xorl %r14d, %r14d
movq $-0x1, %rsi
movq $0x0, 0x48(%rsp)
movq %r12, 0xe0(%rsp)
movq 0x98(%rsp), %r15
movq %r13, 0xd8(%rsp)
movq %rbp, 0xb0(%rsp)
movq %rsi, (%rsp)
movq 0x48(%rsp), %rbx
leaq (%r14,%r14,8), %rax
leaq (%rax,%rax,2), %rsi
addq %r14, %rsi
movl 0xc(%r12,%rsi), %eax
movl 0x18(%r12,%rsi), %ecx
shrdl $0x1f, %eax, %ecx
xorl $0x1, %ecx
movq 0x28(%r15), %rax
movq (%rax,%rcx,8), %rcx
movq %rcx, %rax
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
andq %rdx, %rax
je 0x1d1e4b
movq %rsi, %r9
movq 0x8(%r15), %rdx
shrq $0x20, %rcx
shlq $0x3, %rax
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rcx,2), %rcx
leaq (%rdx,%rcx,8), %rcx
addq $0xc, %rcx
xorl %edx, %edx
xorl %esi, %esi
movl %esi, %edi
movl (%rcx,%rdx), %r8d
cmpl %r8d, %esi
movl %r8d, %esi
cmoval %edi, %esi
testl %r8d, %r8d
cmovsl %edi, %esi
addq $0x18, %rdx
cmpq %rdx, %rax
jne 0x1d1e26
movl %esi, %eax
movq %r9, %rsi
jmp 0x1d1e4d
xorl %eax, %eax
addq %r12, %rsi
movq %rsi, 0x10(%rsp)
movl 0x4(%rsi), %ecx
addq %rax, %rcx
cvtsi2sd %rcx, %xmm0
mulsd 0xa0(%rsp), %xmm0
cvttsd2si %xmm0, %rdx
movq 0x38(%rsp), %rax
cmpq %rax, %rdx
cmovleq %rax, %rdx
addq %rcx, %rdx
movq 0xb8(%rsp), %rax
cmpq %rax, %rdx
cmovgeq %rax, %rdx
subl $-0x80, %edx
movl %r14d, %edi
movq %r12, %rsi
callq 0x19f679
movq 0x10(%rsp), %rdi
movl 0xc(%rdi), %ecx
movl $0x1, %edx
movq %rdx, 0x58(%rsp)
cmpq %rcx, (%r13)
jbe 0x1d1ef6
movq 0x8(%r13), %rdx
cmpl $0x0, (%rdx,%rcx,4)
movq 0x18(%rsp), %r9
movq 0x28(%rsp), %r10
movq 0x20(%rsp), %r11
movl $0x0, %esi
js 0x1d1f1b
movq 0x20(%r15), %rdx
movl (%rdx,%rcx,8), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq %rdx, 0x40(%rsp)
movq $-0x1, 0x30(%rsp)
movq $0x0, 0x58(%rsp)
jmp 0x1d1f2d
movq $0x0, 0x40(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x18(%rsp), %r9
movq 0x28(%rsp), %r10
movq 0x20(%rsp), %r11
xorl %esi, %esi
jmp 0x1d1f2d
movq $0x0, 0x40(%rsp)
movq $0x0, 0x30(%rsp)
movq %r14, 0x68(%rsp)
cltq
movl 0x18(%rdi), %edx
shrdl $0x1f, %ecx, %edx
xorl $0x1, %edx
movl %edx, 0x54(%rsp)
movq %rax, %rcx
subq %rbx, %rcx
movq %rax, %r8
movq 0x130(%rsp), %rdx
subq %rdx, %r8
cmpq %rdx, %rcx
cmovleq %rbx, %r8
movq %r8, 0x48(%rsp)
cmpq %rax, %r8
jle 0x1d1f89
movq $-0x1, 0x60(%rsp)
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movq $-0x7fffffff, %rdx      # imm = 0x80000001
movq $-0x7fffffff, %r14      # imm = 0x80000001
jmp 0x1d2171
leaq (%rax,%rax,8), %rcx
leaq (%rcx,%rcx,2), %rbp
addq %r12, %rbp
addq %rax, %rbp
movl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
movq $-0x7fffffff, %rbx      # imm = 0x80000001
movq $-0x1, 0x60(%rsp)
movq $0x0, 0x8(%rsp)
movq %rax, %r12
movq $-0x7fffffff, %r13      # imm = 0x80000001
movl 0x8(%rbp), %eax
leal 0x80(%rax), %edx
movl 0x4(%rdi), %ecx
cmpl %ecx, %edx
jbe 0x1d2165
cmpl (%r11,%r12,4), %esi
jo 0x1d2006
movq $-0x80000000, %rdx      # imm = 0x80000000
cmpl %ecx, 0x4(%rbp)
ja 0x1d1fef
cmpl 0x8(%rdi), %eax
jbe 0x1d2085
movq $-0x80000000, %r8       # imm = 0x80000000
movq $-0x80000000, %r14      # imm = 0x80000000
cmpq $-0x80000000, %r14      # imm = 0x80000000
jne 0x1d2030
movq %r13, %rdx
movq %r15, %r8
movq %rbx, %r14
leaq -0x1(%r12), %rax
addq $-0x1c, %rbp
movq %r14, %rbx
movq %r8, %r15
movq %rdx, %r13
cmpq 0x48(%rsp), %r12
movq %rax, %r12
jg 0x1d1fc0
jmp 0x1d2171
cmpq %rbx, %r14
jg 0x1d2057
jne 0x1d203c
cmpq %r13, %rdx
jg 0x1d2057
cmpq %rbx, %r14
jne 0x1d2135
cmpq %r13, %rdx
jne 0x1d2135
cmpq %r15, %r8
jge 0x1d2135
xorl %eax, %eax
movq 0x8(%rsp), %rcx
testq %rcx, %rcx
setg %al
subq %rax, %rcx
movq %rcx, 0x8(%rsp)
movq %r12, 0x60(%rsp)
movq (%r10,%r12,8), %rax
testq %rax, %rax
js 0x1d200f
movq 0x68(%rsp), %rcx
movq %rcx, (%r9,%rax,8)
jmp 0x1d200f
movl 0xc(%rbp), %eax
movl 0x18(%rbp), %r14d
shrdl $0x1f, %eax, %r14d
xorl $0x1, %r14d
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x6f050
movq 0x98(%rsp), %rdi
movl 0x54(%rsp), %esi
movl %r14d, %edx
movq 0x38(%rsp), %rcx
movsd 0xa0(%rsp), %xmm0
movq %rax, %r8
callq 0x1d1b71
movq $-0x80000000, %rdx      # imm = 0x80000000
movq 0x10(%rsp), %rdi
xorl %esi, %esi
movq 0x20(%rsp), %r11
movq 0x28(%rsp), %r10
movq 0x18(%rsp), %r9
movq $-0x80000000, %r8       # imm = 0x80000000
movq $-0x80000000, %r14      # imm = 0x80000000
testq %rax, %rax
je 0x1d1ffd
movslq (%r11,%r12,4), %r14
addq 0x30(%rsp), %r14
movq 0x90(%rsp), %rax
movslq (%rax,%r12,4), %rdx
addq 0x58(%rsp), %rdx
movq 0x88(%rsp), %rax
movslq (%rax,%r12,4), %r8
addq 0x40(%rsp), %r8
jmp 0x1d1ffd
movq 0x68(%rsp), %rax
cmpq %rax, (%r9,%r12,8)
jne 0x1d2157
movq 0x8(%rsp), %rax
cmpq 0x128(%rsp), %rax
jge 0x1d2165
incq %rax
movq %rax, 0x8(%rsp)
movq %r13, %rdx
movq %r15, %r8
movq %rbx, %r14
jmp 0x1d2071
movq %r13, %rdx
movq %r15, %r8
movq %r12, %rax
movq %rbx, %r14
movq %rdx, 0x8(%rsp)
movq %r8, %r15
cmpq $0x0, (%rsp)
movq 0xe0(%rsp), %r12
movq 0x98(%rsp), %r13
movq 0xb0(%rsp), %rbp
js 0x1d21c1
movq 0x10(%rsp), %rcx
movl 0x8(%rcx), %ecx
movq (%rsp), %rsi
leaq (%rsi,%rsi,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rsi, %rdx
movl 0x8(%r12,%rdx), %edx
addq 0x138(%rsp), %rdx
cmpq %rcx, %rdx
jge 0x1d2235
movq $-0x1, (%rsp)
movq 0x48(%rsp), %rcx
cmpq %rcx, 0x68(%rsp)
jle 0x1d2235
movq 0x10(%rsp), %rcx
movl 0x8(%rcx), %ecx
movq $-0x1, (%rsp)
movq $-0x80000000, %rdx      # imm = 0x80000000
movq 0xc8(%rsp), %rsi
movq 0xc0(%rsp), %rdi
movl (%rsi), %r8d
addq 0x138(%rsp), %r8
cmpq %rcx, %r8
jl 0x1d2235
movslq (%r11,%rdi,4), %r8
cmpq %r8, %rdx
movq (%rsp), %rbx
cmovlq %rdi, %rbx
movq %rbx, (%rsp)
cmovleq %r8, %rdx
leaq -0x1(%rdi), %r8
addq $-0x1c, %rsi
cmpq 0x48(%rsp), %rdi
movq %r8, %rdi
jg 0x1d21fc
movq (%rsp), %rsi
testq %rsi, %rsi
js 0x1d2293
cmpq %rax, %rsi
movq 0x10(%rsp), %rdi
movq 0x30(%rsp), %rbx
movq %r15, %r8
jge 0x1d22a0
leaq (%rsi,%rsi,8), %rax
movq %rsi, %rcx
leaq (%rax,%rax,2), %rsi
addq %rcx, %rsi
movl 0x8(%r12,%rsi), %eax
leal 0x80(%rax), %edx
movl 0x4(%rdi), %ecx
cmpl %ecx, %edx
jbe 0x1d228d
addq %r12, %rsi
cmpl %ecx, 0x4(%rsi)
ja 0x1d228d
cmpl 0x8(%rdi), %eax
ja 0x1d228d
movq (%rsp), %rax
xorl %ecx, %ecx
cmpl (%r11,%rax,4), %ecx
jno 0x1d23e4
movq (%rsp), %rsi
jmp 0x1d22a0
movq 0x10(%rsp), %rdi
movq 0x30(%rsp), %rbx
movq %r15, %r8
movq %r13, %r15
movq 0x60(%rsp), %rcx
cmpq $-0x1, %rcx
je 0x1d22b5
movq 0x8(%rsp), %r13
jmp 0x1d22e9
movl 0x4(%rdi), %eax
movq $-0x1, %rcx
cmpq %rax, 0xd0(%rsp)
movq 0x8(%rsp), %r13
jge 0x1d22e9
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movq $-0x80000000, %r13      # imm = 0x80000000
movq $-0x80000000, %r14      # imm = 0x80000000
movq $-0x80000000, %rcx      # imm = 0x80000000
cmpq $-0x7fffffff, %r14      # imm = 0x80000001
cmoveq 0x58(%rsp), %r13
cmoveq 0x40(%rsp), %r8
cmovneq %r14, %rbx
movq 0x68(%rsp), %r14
movl %ebx, (%r11,%r14,4)
movq %rcx, (%r10,%r14,8)
movq 0x90(%rsp), %rax
movl %r13d, (%rax,%r14,4)
movq 0x88(%rsp), %rax
movl %r8d, (%rax,%r14,4)
testq %rsi, %rsi
js 0x1d2354
movl 0x8(%rdi), %eax
leaq (%rsi,%rsi,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %rsi, %rcx
movl 0x8(%r12,%rcx), %ecx
addq 0x138(%rsp), %rcx
cmpq %rax, %rcx
jl 0x1d2357
movl (%r11,%rsi,4), %eax
cmpl (%r11,%r14,4), %eax
jge 0x1d2357
movq %r14, %rsi
cmpq $-0x80000000, %rbx      # imm = 0x80000000
je 0x1d23ba
movl 0x8(%rdi), %eax
addq 0x38(%rsp), %rax
cmpq 0x148(%rsp), %rax
jl 0x1d23ba
cmpq 0x80(%rsp), %rbx
jg 0x1d23a0
jne 0x1d2385
cmpq 0x78(%rsp), %r13
jg 0x1d23a0
cmpq 0x80(%rsp), %rbx
jne 0x1d23ba
cmpq 0x78(%rsp), %r13
jne 0x1d23ba
cmpq 0xa8(%rsp), %r8
jge 0x1d23ba
movq %rbx, 0x80(%rsp)
movq %r13, 0x78(%rsp)
movq %r8, 0xa8(%rsp)
movq %r14, 0x70(%rsp)
incq %r14
incq 0xc0(%rsp)
addq $0x1c, 0xc8(%rsp)
cmpq %rbp, %r14
movq 0xd8(%rsp), %r13
jne 0x1d1dc9
jmp 0x1d24f2
movl 0xc(%rsi), %eax
movl 0x18(%rsi), %ebp
shrdl $0x1f, %eax, %ebp
xorl $0x1, %ebp
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x6f050
movq %r13, %rdi
movl 0x54(%rsp), %esi
movl %ebp, %edx
movq 0x38(%rsp), %rcx
movsd 0xa0(%rsp), %xmm0
movq %rax, %r8
callq 0x1d1b71
testq %rax, %rax
je 0x1d2458
movq 0x20(%rsp), %r11
movq (%rsp), %rsi
movslq (%r11,%rsi,4), %rax
addq %rbx, %rax
movq 0x90(%rsp), %rcx
movslq (%rcx,%rsi,4), %rcx
addq 0x58(%rsp), %rcx
movq 0x88(%rsp), %rdx
movslq (%rdx,%rsi,4), %rdx
addq 0x40(%rsp), %rdx
jmp 0x1d2476
movq $-0x80000000, %rcx      # imm = 0x80000000
movq $-0x80000000, %rdx      # imm = 0x80000000
movq $-0x80000000, %rax      # imm = 0x80000000
movq 0x20(%rsp), %r11
movq (%rsp), %rsi
cmpq $-0x80000000, %rax      # imm = 0x80000000
movq 0x18(%rsp), %r9
movq 0x28(%rsp), %r10
movq 0xb0(%rsp), %rbp
movq 0x10(%rsp), %rdi
movq %r15, %r8
je 0x1d22a0
cmpq %r14, %rax
movq %r13, %r15
jg 0x1d24ca
jne 0x1d24ad
cmpq 0x8(%rsp), %rcx
jg 0x1d24ca
cmpq %r14, %rax
jne 0x1d22a3
cmpq 0x8(%rsp), %rcx
jne 0x1d22a3
cmpq %r8, %rdx
jge 0x1d22a3
movq %rcx, 0x8(%rsp)
movq %rdx, %r8
movq %rax, %r14
movq %rsi, 0x60(%rsp)
jmp 0x1d22a3
movq $-0x80000000, 0x70(%rsp) # imm = 0x80000000
movq 0x18(%rsp), %r9
movq 0x28(%rsp), %r10
movq 0x70(%rsp), %rcx
cmpq $-0x80000000, %rcx      # imm = 0x80000000
jne 0x1d2504
xorl %eax, %eax
jmp 0x1d2550
xorl %eax, %eax
testq %rcx, %rcx
js 0x1d2518
movq %rcx, (%r9,%rax,8)
incq %rax
movq (%r10,%rcx,8), %rcx
jmp 0x1d2506
testq %rax, %rax
je 0x1d2550
movq %r12, %rcx
movq %rax, %rdx
movq -0x8(%r9,%rdx,8), %rsi
leaq (%rsi,%rsi,8), %rdi
leaq (%rdi,%rdi,2), %rdi
addq %rsi, %rdi
movupd (%r12,%rdi), %xmm0
movups 0xc(%r12,%rdi), %xmm1
movups %xmm1, 0xc(%rcx)
movupd %xmm0, (%rcx)
addq $0x1c, %rcx
decq %rdx
jne 0x1d2523
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq