// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: gl_chain_linear(ul_idx_t const*, ma_ug_t const*, vec_mg_lchain_t*, vec_mg_lchain_t*, long, ug_opt_t const*, long, double, st_mt_t*, long, long, long, int*, long*, long*, long, unsigned long)
int64_t gl_chain_linear(const ul_idx_t *uref, const ma_ug_t *ug, vec_mg_lchain_t *lc, 
vec_mg_lchain_t *sw, int64_t qlen, const ug_opt_t *uopt, int64_t bw, double ng_diff_thre, 
st_mt_t *bf, int64_t max_skip, int64_t max_iter, int64_t max_dis, int32_t *p, int64_t *f, 
int64_t *t, int64_t n_ext, uint64_t id)
{
	int64_t i, j, lc_n = lc->n, mm_ovlp, x, m_idx, m_sc, qo, n_skip, k, k0, n_u, n_v, ni;
    int64_t max_f, st, max_ii, sc, csc, mm_sc, mm_idx, end_j, max, n_v0;
    mg_lchain_t *li, *lj; asg_t *g = ug->g; uint64_t *u, ff; ul_ov_t ui, uj;

	memset(t, 0, (n_ext*sizeof((*t))));
	for (i = st = 0, max_ii = -1; i < n_ext; ++i) { // core loop
        li = &lc->a[i]; set_ul_ov_t_by_mg_lchain_t(&ui, li);
        mm_ovlp = max_ovlp(g, li->v^1);
        x = (li->qs + mm_ovlp)*ng_diff_thre; if(x < bw) x = bw; 
        x += li->qs + mm_ovlp;
        if (x > qlen+1) x = qlen+1;
        x = find_mg_lchain_max(i, lc->a, x+G_CHAIN_INDEL);
		csc = li->score;
		mm_sc = csc; mm_idx = -1; 
		n_skip = 0; end_j = -1;
		if ((x-st) > max_iter) st = x-max_iter;
		// if(id == 123/** || id == 192**/) {
		// 	fprintf(stderr, "[M::id->%lu::i->%ld::utg%.6d%c] q::[%u, %u); t::[%u, %u); st->%ld; x->%ld\n", id, i, (li->v>>1)+1, "lc"[ug->u.a[li->v>>1].circ], li->qs, li->qe, li->rs, li->re, st, x);
		// }
		for (j = x; j >= st; --j) { // collect potential destination vertices
			lj = &lc->a[j];
			if(lj->qe+G_CHAIN_INDEL <= li->qs) break;
			if(lj->qs >= li->qs) continue;
			set_ul_ov_t_by_mg_lchain_t(&uj, lj);
			qo = infer_rovlp(&ui, &uj, NULL, NULL, NULL, (ma_ug_t *)ug); ///overlap length in query (UL read)
			// if(id == 123/** || id == 192**/) {
			// 	fprintf(stderr, "[M::id->%lu::j->%ld] qo->%ld\n", id, j, qo);
			// }
			if(/**li->v!=lj->v &&**/get_ecov_adv(uref, uopt, li->v^1, lj->v^1, bw, ng_diff_thre, qo, 0, NULL)) {
				sc = csc + f[j];
                if(sc > mm_sc) {
					mm_sc = sc, mm_idx = j;
					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 || (lc->a[i].qe>(lc->a[max_ii].qe+max_dis))) {//too long
			max = INT32_MIN; max_ii = -1;
            for (j = i - 1; (j >= st) && (lc->a[i].qe<=(max_dis+lc->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 = &(lc->a[max_ii]); 
			if(lj->qe+G_CHAIN_INDEL > li->qs && lj->qs < li->qs) {
				set_ul_ov_t_by_mg_lchain_t(&uj, lj);
				qo = infer_rovlp(&ui, &uj, NULL, NULL, NULL, (ma_ug_t *)ug);///overlap length in query (UL read)
				if(/**li->v!=lj->v &&**/get_ecov_adv(uref, uopt, li->v^1, lj->v^1, bw, ng_diff_thre, qo, 0, NULL)) {
					sc = csc + f[max_ii];
					if(sc > mm_sc) {
						mm_sc = sc; mm_idx = max_ii;
					}
				}
			}
		}

		f[i] = mm_sc; p[i] = mm_idx;
        if ((max_ii < 0) || ((lc->a[i].qe<=max_dis+lc->a[max_ii].qe) && (f[max_ii]<f[i]))) {
            max_ii = i;
        }

		li->dist_pre = mm_idx<0?-1:g_adjacent_dis(g, li->v^1, lc->a[mm_idx].v^1); li->inner_pre = 0;
		li->hash_pre = mm_idx<0?0:(__ac_Wang_hash((li->v^1))+__ac_Wang_hash((lc->a[mm_idx].v^1))); 
    }

	for (; i < lc_n; i++) {
		li = &lc->a[i];
		max_f = li->score; f[i] = max_f; p[i] = -1;
        ///same time for gchain
        li->dist_pre = -1;
        li->hash_pre = 0;
        li->inner_pre = 0;
	}
	
	for (i = 0; i < lc_n; ++i) {///all sc are positive
		t[i] = f[i]<<32; t[i] += (i<<1);
	}

	sw->n = 0; kv_resize(mg_lchain_t, *sw, (uint64_t)lc_n);
	kv_resize(uint64_t, *bf, (uint64_t)lc_n); u = bf->a;
	n_u = n_v = 0; radix_sort_gfa64i(t, t + lc_n); 
	for (k = lc_n-1, n_v = n_u = 0; k >= 0; --k) {
        n_v0 = n_v;
        for (i = ((uint32_t)t[k])>>1; i >= 0 && (t[i]&1) == 0; ) {
            sw->a[n_v++] = lc->a[i]; t[i] |= 1; i = p[i];
        }
        if(n_v0 == n_v) continue;
        sc = (i<0?(t[k]>>32):((t[k]>>32)-f[i]));
		if(sc >= 0) {
			ff = ((uint64_t)(0x8000000000000000));
		} else {
			ff = 0; sc = -sc;
		}
		u[n_u++] = (((uint64_t)sc)<<32)|((uint64_t)(n_v-n_v0))|ff;
    }
	
	m_idx = m_sc = -1; 
	for (i = 0, k = 0; i < n_u; ++i) {
		if((u[i]&((uint64_t)(0x8000000000000000)))) {
			u[i] -= ((uint64_t)(0x8000000000000000)); sc = u[i]>>32;
		} else {
			sc = u[i]>>32; sc = -sc; 
		}
		u[i] <<= 32; u[i] >>= 32; u[i] |= (((uint64_t)sc)<<32);

        k0 = k, ni = (uint32_t)u[i];
        for (j = 0; j < ni; ++j) {
            lc->a[k++] = sw->a[k0 + (ni - j - 1)];
        }
        if(m_idx < 0 || m_sc < ((int64_t)(u[i]>>32))) {
            m_idx = i; m_sc = ((int64_t)(u[i]>>32));
        }
    }
    assert(k == n_v); bf->n = n_u;
	return m_idx;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movsd %xmm0, 0x60(%rsp)
movq %r9, 0xa0(%rsp)
movq %r8, %rbx
movq %rcx, 0x58(%rsp)
movq %rdx, %r14
movq %rdi, 0x90(%rsp)
movq 0x158(%rsp), %r15
movq 0x150(%rsp), %rbp
movq 0x148(%rsp), %r13
movq 0x160(%rsp), %r12
movq 0x8(%rdx), %rax
movq %rax, 0x20(%rsp)
movq %rsi, 0x98(%rsp)
movq 0x18(%rsi), %rax
movq %rax, 0x70(%rsp)
leaq (,%r12,8), %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x20e0
xorl %r8d, %r8d
movq 0x20(%rsp), %rdi
incq %rbx
movq %rbx, 0xa8(%rsp)
testq %r12, %r12
cmovleq %r8, %r12
pushq $-0x1
popq %rax
pushq $-0x2
popq %rcx
movq %rcx, 0x80(%rsp)
movq %rax, 0x78(%rsp)
movq %rax, %rcx
xorl %eax, %eax
movq %r14, 0x38(%rsp)
movq %r12, 0x68(%rsp)
cmpq %r12, %rax
je 0x16c7ec
movq (%r14), %r15
imulq $0x28, %rax, %rbp
leaq (%r15,%rbp), %r13
leaq 0xb0(%rsp), %rdi
movq %r13, %rsi
movq %r8, %rbx
movq %rax, %r12
movq %rcx, 0x28(%rsp)
callq 0x16bf75
movl 0x8(%r15,%rbp), %esi
xorl $0x1, %esi
movq 0x70(%rsp), %rdi
callq 0x15d450
movslq 0x14(%r15,%rbp), %rcx
addq %rax, %rcx
cvtsi2sd %rcx, %xmm0
mulsd 0x60(%rsp), %xmm0
cvttsd2si %xmm0, %rdx
movq 0x120(%rsp), %rax
cmpq %rax, %rdx
cmovleq %rax, %rdx
addq %rcx, %rdx
movq 0xa8(%rsp), %rax
cmpq %rax, %rdx
cmovgeq %rax, %rdx
subl $-0x80, %edx
movq %r12, 0x18(%rsp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x16bfa0
movq 0x28(%rsp), %r10
movq %r13, %r9
movq %rbx, %r8
movq %rax, %r12
subq %rbx, %rax
imulq $0x28, %r12, %r13
movq %r12, %rcx
movq 0x138(%rsp), %rdx
subq %rdx, %rcx
cmpq %rdx, %rax
cmovgq %rcx, %r8
movq %rbp, 0x48(%rsp)
movslq 0x1c(%r15,%rbp), %rbx
movq $0x0, 0x50(%rsp)
movq %rbx, 0x88(%rsp)
pushq $-0x1
popq %rax
movq %rax, 0x30(%rsp)
movq %r8, 0x40(%rsp)
cmpq %r8, %r12
jl 0x16c513
movq (%r14), %rbp
movl 0x18(%rbp,%r13), %ecx
subl $-0x80, %ecx
movl 0x14(%r9), %eax
cmpl %eax, %ecx
jle 0x16c513
cmpl %eax, 0x14(%rbp,%r13)
jge 0x16c48a
movq %rbp, %rsi
addq %r13, %rsi
leaq 0xcc(%rsp), %r15
movq %r15, %rdi
movq %r9, %r14
callq 0x16bf75
leaq 0xb0(%rsp), %rdi
movq %r15, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq 0x98(%rsp), %r9
callq 0x3d261
movq %r14, %r15
movl 0x8(%r14), %edx
xorl $0x1, %edx
movl 0x8(%rbp,%r13), %ecx
xorl $0x1, %ecx
xorpd %xmm0, %xmm0
movupd %xmm0, (%rsp)
movq 0x90(%rsp), %rdi
movq 0xa0(%rsp), %rsi
movq 0x120(%rsp), %r8
movsd 0x60(%rsp), %xmm0
movq %rax, %r9
callq 0x1631f5
testq %rax, %rax
je 0x16c48f
movq 0x150(%rsp), %rax
movq (%rax,%r12,8), %rax
addq 0x88(%rsp), %rax
cmpq %rbx, %rax
jle 0x16c4a6
xorl %ecx, %ecx
movq 0x50(%rsp), %rdx
testq %rdx, %rdx
setg %cl
subq %rcx, %rdx
movq %rdx, 0x50(%rsp)
movq %r12, 0x30(%rsp)
movq 0x40(%rsp), %r8
movq 0x38(%rsp), %r14
movq %r15, %r9
movq 0x28(%rsp), %r10
jmp 0x16c4e2
movq %rbx, %rax
jmp 0x16c504
movq %rbx, %rax
movq 0x40(%rsp), %r8
movq 0x38(%rsp), %r14
movq %r15, %r9
movq 0x28(%rsp), %r10
jmp 0x16c504
movq 0x158(%rsp), %rax
movq 0x18(%rsp), %rcx
cmpq %rcx, (%rax,%r12,8)
movq 0x40(%rsp), %r8
movq 0x38(%rsp), %r14
movq %r15, %r9
movq 0x28(%rsp), %r10
jne 0x16c4df
movq 0x50(%rsp), %rax
cmpq 0x130(%rsp), %rax
jge 0x16c513
incq 0x50(%rsp)
movq %rbx, %rax
movq 0x148(%rsp), %rcx
movslq (%rcx,%r12,4), %rcx
testq %rcx, %rcx
js 0x16c504
movq 0x158(%rsp), %rdx
movq 0x18(%rsp), %rsi
movq %rsi, (%rdx,%rcx,8)
decq %r12
addq $-0x28, %r13
movq %rax, %rbx
jmp 0x16c39a
testq %r10, %r10
movq 0x150(%rsp), %rbp
movq 0x148(%rsp), %r13
js 0x16c54b
movq (%r14), %rax
movq 0x48(%rsp), %rcx
movslq 0x18(%rax,%rcx), %rcx
imulq $0x28, %r10, %rdx
movslq 0x18(%rax,%rdx), %rax
addq 0x140(%rsp), %rax
cmpq %rcx, %rax
jge 0x16c5a3
movq $-0x80000000, %rax      # imm = 0x80000000
movq 0x80(%rsp), %rcx
movq 0x78(%rsp), %rdx
pushq $-0x1
popq %r10
leaq 0x1(%rdx), %rsi
cmpq %r8, %rsi
jle 0x16c5a3
movq (%r14), %rsi
movq 0x48(%rsp), %rdi
movslq 0x18(%rsi,%rdi), %rdi
movslq (%rsi,%rcx,8), %rsi
addq 0x140(%rsp), %rsi
cmpq %rdi, %rsi
jl 0x16c5a3
movq (%rbp,%rdx,8), %rsi
cmpq %rsi, %rax
cmovlq %rdx, %r10
cmovleq %rsi, %rax
decq %rdx
addq $-0x5, %rcx
jmp 0x16c563
testq %r10, %r10
js 0x16c6a6
cmpq %r12, %r10
jge 0x16c6a6
movq (%r14), %r12
imulq $0x28, %r10, %rax
movl 0x18(%r12,%rax), %edx
subl $-0x80, %edx
movl 0x14(%r9), %ecx
cmpl %ecx, %edx
jle 0x16c6c4
addq %rax, %r12
cmpl %ecx, 0x14(%r12)
jge 0x16c6c4
movq %rbx, 0x28(%rsp)
movq %r10, %rbx
leaq 0xcc(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movq %r9, %r15
callq 0x16bf75
leaq 0xb0(%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq 0x98(%rsp), %r9
callq 0x3d261
movq %r15, %r14
movl 0x8(%r15), %edx
xorl $0x1, %edx
movl 0x8(%r12), %ecx
xorl $0x1, %ecx
xorpd %xmm0, %xmm0
movupd %xmm0, (%rsp)
movq 0x90(%rsp), %rdi
movq 0xa0(%rsp), %rsi
movq 0x120(%rsp), %r8
movsd 0x60(%rsp), %xmm0
movq %rax, %r9
callq 0x1631f5
testq %rax, %rax
je 0x16c7ca
movq %rbx, %r10
movq 0x88(%rsp), %rax
addq (%rbp,%rbx,8), %rax
movq 0x28(%rsp), %rbx
cmpq %rbx, %rax
cmovgq %rax, %rbx
movq 0x30(%rsp), %rax
cmovgq %r10, %rax
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %r8
movq 0x38(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %r14, %r9
movq %rcx, %r14
jmp 0x16c6c9
movq 0x18(%rsp), %rax
movq %rbx, (%rbp,%rax,8)
movq 0x30(%rsp), %rsi
movl %esi, (%r13,%rax,4)
movq %rax, %rdx
testq %r10, %r10
jns 0x16c6d8
jmp 0x16c709
movq 0x18(%rsp), %rax
movq %rbx, (%rbp,%rax,8)
movq 0x30(%rsp), %rsi
movl %esi, (%r13,%rax,4)
movq (%r14), %rax
movq 0x48(%rsp), %rcx
movslq 0x18(%rax,%rcx), %rcx
imulq $0x28, %r10, %rdx
movslq 0x18(%rax,%rdx), %rax
addq 0x140(%rsp), %rax
cmpq %rcx, %rax
jl 0x16c706
cmpq %rbx, (%rbp,%r10,8)
cmovlq 0x18(%rsp), %r10
movq %r10, %rdx
testq %rsi, %rsi
js 0x16c77d
movl 0x8(%r9), %r12d
xorl $0x1, %r12d
movq (%r14), %rax
imulq $0x28, %rsi, %rbx
movq %rdx, 0x48(%rsp)
movl 0x8(%rax,%rbx), %edx
xorl $0x1, %edx
movq 0x70(%rsp), %rdi
movl %r12d, %esi
movq %r8, %r13
movq %r14, %rbp
movq %r9, %r14
callq 0x1664de
movq %rax, %r15
andb $0x7f, 0x7(%r14)
movl %r12d, %edi
callq 0x15cdd5
movl %eax, %r12d
movq (%rbp), %rax
movl 0x8(%rax,%rbx), %edi
xorl $0x1, %edi
callq 0x15cdd5
movq 0x48(%rsp), %rdx
movq %r14, %r9
movq %rbp, %r14
movq 0x150(%rsp), %rbp
movq %r13, %r8
addl %r12d, %eax
jmp 0x16c78a
andb $0x7f, 0x7(%r9)
xorl %eax, %eax
pushq $-0x1
popq %rcx
movl %ecx, %r15d
movq 0x20(%rsp), %rdi
movq 0x68(%rsp), %r12
movl %r15d, 0x20(%r9)
movl %eax, 0x24(%r9)
movq 0x18(%rsp), %rax
incq %rax
incq 0x78(%rsp)
addq $0x5, 0x80(%rsp)
movq %rdx, %rcx
movq 0x158(%rsp), %r15
movq 0x148(%rsp), %r13
jmp 0x16c2bb
movq 0x40(%rsp), %r8
movq 0x38(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %r14, %r9
movq %rcx, %r14
movq %rbx, %r10
movq 0x28(%rsp), %rbx
jmp 0x16c6c9
imulq $0xa, %r12, %rax
addq $0x9, %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rdi, %r12
jge 0x16c824
movq (%r14), %rdx
movslq -0x8(%rdx,%rax,4), %rsi
movq %rsi, (%rbp,%r12,8)
orl $-0x1, (%r13,%r12,4)
movq %rcx, -0x4(%rdx,%rax,4)
andb $0x7f, -0x1d(%rdx,%rax,4)
incq %r12
addq $0xa, %rax
jmp 0x16c7f9
xorl %eax, %eax
testq %rdi, %rdi
movl $0x0, %ecx
cmovgq %rdi, %rcx
subq $0x1, %rcx
jb 0x16c84e
movq (%rbp,%rax,4), %rdx
shlq $0x20, %rdx
addq %rax, %rdx
movq %rdx, (%r15,%rax,4)
addq $0x2, %rax
jmp 0x16c832
movq 0x58(%rsp), %rax
andq $0x0, 0x8(%rax)
cmpq %rdi, 0x10(%rax)
jae 0x16c8b3
leaq -0x1(%rdi), %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
incq %rcx
movq 0x58(%rsp), %rbx
movq %rcx, 0x10(%rbx)
movq (%rbx), %rdi
imulq $0x28, %rcx, %rsi
callq 0x2370
movq 0x20(%rsp), %rdi
movq %rax, (%rbx)
movq 0x128(%rsp), %rbx
cmpq %rdi, 0x8(%rbx)
jae 0x16c91d
leaq -0x1(%rdi), %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x1(%rcx), %rax
movq %rax, 0x8(%rbx)
movq 0x10(%rbx), %rdi
leaq 0x8(,%rcx,8), %rsi
callq 0x2370
movq 0x20(%rsp), %rdi
movq %rax, %r12
movq %rax, 0x10(%rbx)
jmp 0x16c921
movq 0x10(%rbx), %r12
leaq (%r15,%rdi,8), %rsi
movq %r15, %rdi
callq 0x156cf6
xorl %ecx, %ecx
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
xorl %r8d, %r8d
movq %r8, %rdx
movq 0x20(%rsp), %rsi
testq %rsi, %rsi
jle 0x16c9ff
decq %rsi
movq %rsi, 0x20(%rsp)
movl (%r15,%rsi,8), %edi
shrl %edi
imulq $0x28, %rdx, %r8
xorl %esi, %esi
testq %rdi, %rdi
js 0x16c9b1
testb $0x1, (%r15,%rdi,8)
jne 0x16c9b1
movq (%r14), %r9
imulq $0x28, %rdi, %r10
movq 0x58(%rsp), %r11
movq (%r11), %r11
movq 0x20(%r9,%r10), %rbx
movq %rbx, 0x20(%r11,%r8)
movupd (%r9,%r10), %xmm0
movups 0x10(%r9,%r10), %xmm1
movups %xmm1, 0x10(%r11,%r8)
movupd %xmm0, (%r11,%r8)
orb $0x1, (%r15,%rdi,8)
movslq (%r13,%rdi,4), %rdi
decq %rsi
addq $0x28, %r8
jmp 0x16c961
movq %rdx, %r8
subq %rsi, %r8
testq %rsi, %rsi
je 0x16c93c
movq 0x20(%rsp), %r8
movslq 0x4(%r15,%r8,8), %r8
testq %rdi, %rdi
js 0x16c9d0
subq (%rbp,%rdi,8), %r8
subq %rsi, %rdx
movq %r8, %rdi
negq %rdi
cmovsq %r8, %rdi
notq %r8
andq %rax, %r8
shlq $0x20, %rdi
negq %rsi
orq %r8, %rsi
orq %rdi, %rsi
movq %rsi, (%r12,%rcx,8)
incq %rcx
movq %rdx, %r8
jmp 0x16c93c
pushq $-0x1
popq %rdi
xorl %esi, %esi
movq %rdi, %rax
xorl %r8d, %r8d
cmpq %rcx, %r8
je 0x16cab7
movq (%r12,%r8,8), %r9
movq %r9, %r11
shrq $0x20, %r11
movl %r11d, %ebx
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
negl %r11d
testq %r9, %r9
movl %r9d, %r10d
cmovsl %ebx, %r11d
movl %r11d, 0x4(%r12,%r8,8)
imulq $0x28, %rsi, %r11
imulq $0x28, %r10, %rbx
negq %r10
addq %r11, %rbx
xorl %r9d, %r9d
cmpq %r9, %r10
je 0x16ca8b
movq 0x58(%rsp), %r15
movq (%r15), %r15
movq (%r14), %r13
movq -0x8(%rbx,%r15), %rbp
movq %rbp, 0x20(%r13,%r11)
movupd -0x28(%rbx,%r15), %xmm0
movups -0x18(%rbx,%r15), %xmm1
movups %xmm1, 0x10(%r13,%r11)
movupd %xmm0, (%r13,%r11)
decq %r9
addq $0x28, %r11
addq $-0x28, %rbx
jmp 0x16ca4a
movl 0x4(%r12,%r8,8), %r10d
cmpq %r10, %rdi
cmovleq %r10, %rdi
movq %rax, %r11
cmovlq %r8, %r11
testq %rax, %rax
cmovsq %r10, %rdi
cmovsq %r8, %r11
incq %r8
subq %r9, %rsi
movq %r11, %rax
jmp 0x16ca0a
cmpq %rdx, %rsi
jne 0x16cad9
movq 0x128(%rsp), %rdx
movq %rcx, (%rdx)
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x85259(%rip), %rdi     # 0x1f1d39
leaq 0x8503c(%rip), %rsi     # 0x1f1b23
leaq 0x86672(%rip), %rcx     # 0x1f3160
movl $0x1695, %edx           # imm = 0x1695
callq 0x2110