// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: simple_g_chain_dp(kv_ul_ov_t*, ul_ov_t*, ul_idx_t const*, ug_opt_t const*, long, double, long, long, unsigned long*, unsigned long*, unsigned long*)
int64_t simple_g_chain_dp(kv_ul_ov_t *in, ul_ov_t *buf, const ul_idx_t *uref, const ug_opt_t *uopt, int64_t bw, 
double diff_ec_ul, int64_t qlen, int64_t max_skip, uint64_t *srt, uint64_t *idx, uint64_t *track)
{
	if(in->n == 0) return 0;
	uint32_t ai_v, aj_v, rev_n; ma_ug_t *ug = uref->ug;
    int64_t mm_ovlp, x, i, j, k, sc, csc, mm_sc, mm_idx, qo, share, in_n = in->n;
	int64_t iqs, iqe, its, ite, i_end, j_end;
    ul_ov_t *ai, *aj, *e_ai, *e_aj, rev_t;
	for (i = 0; i < in_n; i++) {
		gen_end_coord(&(in->a[i]), qlen, ug->u.a[in->a[i].tn].len, NULL, &iqe, NULL, NULL);
		srt[i] = iqe; srt[i] <<= 32; srt[i] |= (uint64_t)i;
	}
	radix_sort_gfa64(srt, srt+in_n); 
	for (i = 0; i < in_n; i++) buf[i] = in->a[(uint32_t)srt[i]];
	memcpy(in->a, buf, in_n *sizeof((*buf)));///all alignments have been sorted by the real end-qe

	for (i = 0; i < in_n; ++i) {
		ai = &(in->a[i]); ai_v = (ai->tn<<1)|ai->rev; e_ai = &(buf[i]); i_end = 0;
		gen_end_coord(ai, qlen, ug->u.a[ai->tn].len, &iqs, &iqe, &its, &ite);
		e_ai->qs = iqs; e_ai->qe = iqe; e_ai->ts = its; e_ai->te = ite;
		mm_ovlp = max_ovlp(uref->ug->g, ai_v^1);
		x = (e_ai->qs + mm_ovlp)*diff_ec_ul; 
        if(x < bw) x = bw; 
        x += e_ai->qs + mm_ovlp;
        if (x > qlen+1) x = qlen+1;
		x = find_ul_ov_max(i, buf, x+G_CHAIN_INDEL); 
		i_end = is_end_check(ai_v^1, ai, uref->ug->g);
		csc = mm_sc = e_ai->sec; mm_idx = -1; 
		for (j = x; j >= 0; --j) { // collect potential destination vertices
            aj = &(in->a[j]); aj_v = (aj->tn<<1)|aj->rev; e_aj = &(buf[i]); j_end = 0;
			if(e_aj->qe+G_CHAIN_INDEL <= e_ai->qs) break;//even this pair has a overlap, its length will be very small; just ignore
            if(e_aj->qs >= e_ai->qs+G_CHAIN_INDEL) continue; // lj is contained in li on the query coordinate; 128 for indel offset
			qo = infer_rovlp(e_ai, e_aj, NULL, NULL, NULL, ug); ///overlap length in query (UL read)
			if(ai_v != aj_v && get_ecov_adv(uref, uopt, ai_v^1, aj_v^1, bw, diff_ec_ul, qo, 0, &share)) {
				sc = csc + pop_sc(track[j]); j_end = is_end_check(aj_v, aj, uref->ug->g);
				if(i_end && j_end) sc -= (share>=csc?csc:share);
				if(sc > mm_sc) mm_sc = sc, mm_idx = j;
			}
		}
		track[i] = push_sc_pre(mm_sc, mm_idx);
        srt[i] = track[i]>>32; srt[i] <<= 32; srt[i] |= i;
	}

	int64_t n_v, n_u, n_v0; 
    radix_sort_gfa64(srt, srt+in_n); 
	for (k = in_n-1, n_v = n_u = 0; k >= 0; --k) {
		n_v0 = n_v;
		for (i = (uint32_t)srt[k]; i >= 0 && (track[i]&((uint64_t)0x80000000)) == 0;){
			buf[n_v] = in->a[i]; 
			gen_end_coord(&(buf[n_v]), qlen, ug->u.a[buf[n_v].tn].len, &iqs, &iqe, &its, &ite);
			buf[n_v].qs = iqs; buf[n_v].qe = iqe; buf[n_v].ts = its; buf[n_v].te = ite;

			track[i] |= ((uint64_t)0x80000000);
            i = pop_pre(track[i]);
			n_v++;
		}
		if(n_v0 == n_v) continue;
		sc = (i<0?(pop_sc(srt[k])):(pop_sc(srt[k])-pop_sc(track[i])));
		idx[n_u++] = ((uint64_t)sc<<32)|(n_v-n_v0); 
	}

	for (k = 0, n_v = n_v0 = 0; k < n_u; k++) {
        n_v0 = n_v; n_v += (uint32_t)idx[k];
        in->a[k].qn = idx[k]>>32;//score
        in->a[k].ts = n_v0; in->a[k].te = n_v;///idx
        
        rev_n = ((uint32_t)idx[k])>>1; 
        ///we need to consider contained reads; so determining qs is not such easy
        in->a[k].qs = (uint32_t)-1; in->a[k].qe = buf[n_v0].qe;
        for (i = 0; i < rev_n; i++) {
            rev_t = buf[n_v0+i]; buf[n_v0+i] = buf[n_v-i-1]; buf[n_v-i-1] = rev_t;
            
            if(in->a[k].qs > buf[n_v0+i].qs) in->a[k].qs = buf[n_v0+i].qs;
            if(in->a[k].qs > buf[n_v-i-1].qs) in->a[k].qs = buf[n_v-i-1].qs;
        }
        if(((uint32_t)idx[k])&1) {
            if(in->a[k].qs > buf[n_v0+i].qs) in->a[k].qs = buf[n_v0+i].qs;
        }
        // fprintf(stderr, "[M::%s] k:%ld, qs:%u, qe:%u, chain_occ:%u, chain_score:%u\n", __func__, k, 
        //                  res->a[k].qs, res->a[k].qe, res->a[k].te - res->a[k].ts, res->a[k].qn);
    }

	in->n = n_u;
    radix_sort_ul_ov_srt_qn(in->a, in->a + in->n);//sort by score
	return n_v;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movsd %xmm0, 0x88(%rsp)
movq %r8, 0x80(%rsp)
movq %rcx, 0xa8(%rsp)
movq %rdx, 0x28(%rsp)
movq 0x8(%rdi), %r12
testq %r12, %r12
je 0x1d0295
movq %rsi, %rbx
movq %rdi, %r13
movq 0x128(%rsp), %r14
jle 0x1d029a
movq %r9, %r15
movq 0x28(%rsp), %rax
movq (%rax), %rcx
movq (%r13), %rax
movq %rcx, 0x50(%rsp)
movq 0x10(%rcx), %rcx
addq $0x18, %rax
xorl %edx, %edx
movl -0x10(%rax), %edi
movl -0xc(%rax), %esi
leaq (%rsi,%rsi,4), %rsi
movl (%rcx,%rsi,8), %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movl -0x8(%rax), %r8d
movl -0x4(%rax), %r9d
movq %rsi, %r10
subq %r8, %r10
cmpl $0x0, (%rax)
cmovnsq %r9, %r10
movq %r15, %r8
subq %rdi, %r8
subq %r10, %rsi
cmpq %rsi, %r8
jg 0x1cfa86
movq %r15, %rsi
jmp 0x1cfa89
addq %rdi, %rsi
movq %rsi, 0x58(%rsp)
shlq $0x20, %rsi
orq %rdx, %rsi
movq %rsi, (%r14,%rdx,8)
incq %rdx
addq $0x1c, %rax
cmpq %rdx, %r12
jne 0x1cfa4b
leaq (%r14,%r12,8), %rbp
movq %r14, %rdi
movq %rbp, %rsi
callq 0x19dd99
testq %r12, %r12
jle 0x1d02a9
xorl %eax, %eax
movq %rbx, %rcx
movq (%r13), %rdx
movl (%r14,%rax,8), %esi
leaq (%rsi,%rsi,8), %rdi
leaq (%rdi,%rdi,2), %rdi
addq %rsi, %rdi
movupd (%rdx,%rdi), %xmm0
movups 0xc(%rdx,%rdi), %xmm1
movups %xmm1, 0xc(%rcx)
movupd %xmm0, (%rcx)
incq %rax
addq $0x1c, %rcx
cmpq %rax, %r12
jne 0x1cfac2
movq (%r13), %rdi
leaq (%r12,%r12,8), %rax
leaq (%rax,%rax,2), %rdx
addq %r12, %rdx
movq %rbx, %rsi
callq 0x2160
testq %r12, %r12
jle 0x1d02c0
movq %rbp, 0x98(%rsp)
leaq 0x1(%r15), %rax
movq %rax, 0xa0(%rsp)
xorl %edx, %edx
movq %r13, 0x20(%rsp)
movq %rbx, 0x40(%rsp)
movq %r15, 0x90(%rsp)
movq %r12, 0x30(%rsp)
movq (%r13), %rax
leaq (%rdx,%rdx,8), %rcx
leaq (%rcx,%rcx,2), %rbp
movq %rdx, 0x78(%rsp)
addq %rdx, %rbp
leaq (%rax,%rbp), %rdi
movl 0xc(%rax,%rbp), %ecx
movl 0x18(%rax,%rbp), %r8d
shrdl $0x1f, %ecx, %r8d
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rax
leaq (%rcx,%rcx,4), %rcx
movl (%rax,%rcx,8), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
leaq 0x60(%rsp), %rax
movq %rax, (%rsp)
movq %rdi, 0x10(%rsp)
movq %r15, %rsi
movl %r8d, %r15d
leaq 0x70(%rsp), %rcx
leaq 0x58(%rsp), %r8
leaq 0x68(%rsp), %r9
callq 0x1cf904
movq 0x70(%rsp), %rax
movl %eax, 0x4(%rbx,%rbp)
movl 0x58(%rsp), %ecx
movl %ecx, 0x8(%rbx,%rbp)
movl 0x68(%rsp), %ecx
movl %ecx, 0x10(%rbx,%rbp)
movl 0x60(%rsp), %ecx
movl %ecx, 0x14(%rbx,%rbp)
movq 0x28(%rsp), %rcx
movq (%rcx), %rcx
movq 0x18(%rcx), %rcx
movl %r15d, %esi
xorl $0x1, %esi
movq 0x28(%rcx), %rdx
movq %rsi, 0xb0(%rsp)
movq (%rdx,%rsi,8), %rdx
movq %rdx, %rsi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
andq %rdi, %rsi
je 0x1cfc39
movq 0x8(%rcx), %rdi
shrq $0x20, %rdx
shlq $0x3, %rsi
leaq (%rsi,%rsi,2), %rcx
leaq (%rdx,%rdx,2), %rdx
leaq (%rdi,%rdx,8), %rdx
addq $0xc, %rdx
xorl %esi, %esi
xorl %edi, %edi
movl %edi, %r8d
movl (%rdx,%rsi), %r9d
cmpl %r9d, %edi
movl %r9d, %edi
cmoval %r8d, %edi
testl %r9d, %r9d
cmovsl %r8d, %edi
addq $0x18, %rsi
cmpq %rsi, %rcx
jne 0x1cfc14
movl %edi, %ecx
jmp 0x1cfc3b
xorl %ecx, %ecx
movl %eax, %eax
addq %rcx, %rax
cvtsi2sd %rax, %xmm0
mulsd 0x88(%rsp), %xmm0
cvttsd2si %xmm0, %rdx
movq 0x80(%rsp), %rcx
cmpq %rcx, %rdx
cmovleq %rcx, %rdx
addq %rax, %rdx
movq 0xa0(%rsp), %rax
cmpq %rax, %rdx
cmovgeq %rax, %rdx
subl $-0x80, %edx
movq 0x78(%rsp), %rdi
movq %rbx, %rsi
callq 0x1a83b5
testb $0x1, %r15b
movl %r15d, 0x38(%rsp)
jne 0x1cfcaa
movq 0x10(%rsp), %rcx
cmpl $0x0, 0x10(%rcx)
movq 0x138(%rsp), %rsi
jne 0x1cfce1
movb $0x1, %cl
movl %ecx, 0x1c(%rsp)
jmp 0x1cfce9
movq 0x28(%rsp), %rcx
movq (%rcx), %rcx
movq 0x18(%rcx), %rcx
movq 0x20(%rcx), %rcx
movl %r15d, %edx
shrl %edx
movl (%rcx,%rdx,8), %ecx
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl %edx, %ecx
movb $0x1, %dl
movl %edx, 0x1c(%rsp)
movq 0x10(%rsp), %rdx
cmpl %ecx, 0x14(%rdx)
movq 0x138(%rsp), %rsi
je 0x1cfce9
movl $0x0, 0x1c(%rsp)
addq %rbx, %rbp
movl 0x18(%rbp), %r15d
andl $0x3fffffff, %r15d      # imm = 0x3FFFFFFF
testl %eax, %eax
js 0x1cfeb1
movslq %eax, %r12
leaq (%r12,%r12,8), %rax
leaq (%rax,%rax,2), %rax
leaq (%r12,%rax), %rbx
addq $0x18, %rbx
movq $-0x1, 0x10(%rsp)
movq %r15, 0x48(%rsp)
movl 0x4(%rbp), %eax
movl 0x8(%rbp), %ecx
subl $-0x80, %ecx
cmpl %eax, %ecx
jbe 0x1cfe87
cmpl $0xffffff7f, %eax       # imm = 0xFFFFFF7F
ja 0x1cfe72
movq (%r13), %r14
movl -0xc(%r14,%rbx), %eax
movl (%r14,%rbx), %r13d
shrdl $0x1f, %eax, %r13d
movq %rbp, %rdi
movq %rbp, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq 0x50(%rsp), %r9
callq 0x6ea22
cmpl %r13d, 0x38(%rsp)
je 0x1cfe1e
movl %r13d, %ecx
xorl $0x1, %ecx
leaq 0xb8(%rsp), %rdx
movq %rdx, 0x8(%rsp)
movq $0x0, (%rsp)
movq 0x28(%rsp), %rdi
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %rdx
movq 0x80(%rsp), %r8
movsd 0x88(%rsp), %xmm0
movq %rax, %r9
callq 0x1ab640
testq %rax, %rax
je 0x1cfe1e
movq 0x138(%rsp), %rsi
movq (%rsi,%r12,8), %rcx
movq %rcx, %rax
shrq $0x20, %rax
leaq -0x80000000(%rax), %rdx
negq %rax
testq %rcx, %rcx
cmovsq %rdx, %rax
addq %r15, %rax
testb $0x1, %r13b
jne 0x1cfe2d
movq 0x28(%rsp), %rcx
movq (%rcx), %rcx
movq 0x18(%rcx), %rcx
movq 0x20(%rcx), %rcx
shrl %r13d
movl (%rcx,%r13,8), %ecx
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl %edx, %ecx
cmpl %ecx, -0x4(%r14,%rbx)
setne %cl
movl 0x1c(%rsp), %edx
xorb $0x1, %dl
orb %cl, %dl
je 0x1cfe3c
jmp 0x1cfe4e
movq 0x20(%rsp), %r13
movq 0x138(%rsp), %rsi
jmp 0x1cfe72
cmpl $0x0, -0x8(%r14,%rbx)
sete %cl
testb %cl, 0x1c(%rsp)
je 0x1cfe4e
movq 0xb8(%rsp), %rcx
cmpq %r15, %rcx
cmovgeq %r15, %rcx
subq %rcx, %rax
movq 0x20(%rsp), %r13
movq 0x48(%rsp), %rcx
cmpq %rcx, %rax
cmovgq %rax, %rcx
movq %rcx, 0x48(%rsp)
movq 0x10(%rsp), %rax
cmovgq %r12, %rax
movq %rax, 0x10(%rsp)
leaq -0x1(%r12), %rax
addq $-0x1c, %rbx
testq %r12, %r12
movq %rax, %r12
jg 0x1cfd20
movq 0x10(%rsp), %rcx
testq %rcx, %rcx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmovsq %rax, %rcx
movq 0x48(%rsp), %r15
movq 0x40(%rsp), %rbx
movq 0x128(%rsp), %r14
movq 0x30(%rsp), %r12
jmp 0x1cfeb6
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
shlq $0x20, %r15
orq %rcx, %r15
btsq $0x3f, %r15
movq 0x78(%rsp), %rdx
movq %r15, (%rsi,%rdx,8)
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
andq %rax, %r15
orq %rdx, %r15
movq %r15, (%r14,%rdx,8)
incq %rdx
cmpq %r12, %rdx
movq 0x90(%rsp), %r15
jne 0x1cfb40
movq %r14, %rdi
movq 0x98(%rsp), %rsi
callq 0x19dd99
testq %r12, %r12
jle 0x1d02cb
movq $0x0, 0x10(%rsp)
movl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
leaq 0x58(%rsp), %r15
leaq 0x68(%rsp), %rbp
xorl %ecx, %ecx
movq 0x138(%rsp), %r8
leaq -0x1(%r12), %rax
movq %rax, 0x30(%rsp)
movq %r12, 0x28(%rsp)
movl -0x8(%r14,%r12,8), %r14d
leaq (%rcx,%rcx,8), %rax
leaq (%rax,%rax,2), %r12
movq %rcx, 0x38(%rsp)
addq %rbx, %r12
addq %rcx, %r12
xorl %ebx, %ebx
movq (%r8,%r14,8), %rdx
testl %edx, %edx
js 0x1d005a
movq 0x20(%rsp), %rax
movq (%rax), %rax
leaq (%r14,%r14,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %r14, %rcx
movupd (%rax,%rcx), %xmm0
movups 0xc(%rax,%rcx), %xmm1
movups %xmm1, 0xc(%r12)
movupd %xmm0, (%r12)
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rax
movl 0xc(%r12), %ecx
leaq (%rcx,%rcx,4), %rcx
movl (%rax,%rcx,8), %edx
andq %r13, %rdx
leaq 0x60(%rsp), %rax
movq %rax, (%rsp)
movq %r12, %rdi
movq 0x90(%rsp), %rsi
leaq 0x70(%rsp), %rcx
movq %r15, %r8
movq %rbp, %r9
callq 0x1cf904
movq 0x138(%rsp), %r8
movl 0x70(%rsp), %eax
movl %eax, 0x4(%r12)
movl 0x58(%rsp), %eax
movl %eax, 0x8(%r12)
movl 0x68(%rsp), %eax
movl %eax, 0x10(%r12)
movl 0x60(%rsp), %eax
movl %eax, 0x14(%r12)
movq (%r8,%r14,8), %rax
movq %rax, %rcx
btsq $0x1f, %rcx
movq %rcx, (%r8,%r14,8)
andq %r13, %rax
decq %rbx
addq $0x1c, %r12
movq %rax, %r14
cmpq %r13, %rax
jne 0x1cff58
testq %rbx, %rbx
je 0x1d00e3
movq 0x38(%rsp), %r10
movq %r10, %rax
subq %rbx, %rax
movq 0x128(%rsp), %r14
movq 0x30(%rsp), %r12
movq (%r14,%r12,8), %rdx
movq %rdx, %rcx
shrq $0x20, %rcx
leaq -0x80000000(%rcx), %rsi
negq %rcx
testq %rdx, %rdx
cmovsq %rsi, %rcx
jmp 0x1d00b3
testq %rbx, %rbx
je 0x1d00e3
movq 0x38(%rsp), %r10
movq %r10, %rax
subq %rbx, %rax
movq 0x128(%rsp), %r14
movq 0x30(%rsp), %r12
movq (%r14,%r12,8), %rsi
movq %rsi, %rcx
shrq $0x20, %rcx
movq $-0x80000000, %r9       # imm = 0x80000000
leaq (%rcx,%r9), %rdi
negq %rcx
testq %rsi, %rsi
cmovsq %rdi, %rcx
movq %rdx, %rsi
shrq $0x20, %rsi
leaq (%rsi,%r9), %rdi
negq %rsi
testq %rdx, %rdx
cmovsq %rdi, %rsi
subq %rsi, %rcx
shlq $0x20, %rcx
movq %rax, %rdx
subq %r10, %rdx
orq %rcx, %rdx
movq 0x130(%rsp), %rcx
movq 0x10(%rsp), %rsi
movq %rdx, (%rcx,%rsi,8)
incq %rsi
movq %rsi, 0x10(%rsp)
movq %rax, %rcx
movq 0x40(%rsp), %rbx
jmp 0x1d00fa
movq 0x40(%rsp), %rbx
movq 0x128(%rsp), %r14
movq 0x30(%rsp), %r12
movq 0x38(%rsp), %rcx
cmpq $0x1, 0x28(%rsp)
jg 0x1cff2f
movq 0x20(%rsp), %r13
movq (%r13), %rdi
movq 0x10(%rsp), %r15
testq %r15, %r15
jle 0x1d02d2
leaq 0x4(%rbx), %rax
movq %rax, 0x50(%rsp)
leaq -0x1c(%rbx), %rcx
xorl %r14d, %r14d
xorl %edx, %edx
movq %r14, %rsi
movq 0x130(%rsp), %rax
movq (%rax,%rdx,8), %r11
movl %r11d, %r14d
addq %rsi, %r14
movq %r11, %rax
shrq $0x20, %rax
leaq (%rdx,%rdx,8), %r8
leaq (%r8,%r8,2), %r8
addq %rdx, %r8
movl %eax, (%rdi,%r8)
movl %esi, 0x10(%rdi,%r8)
movl %r14d, 0x14(%rdi,%r8)
movl %r11d, %r9d
shrl %r9d
movl $0xffffffff, 0x4(%rdi,%r8) # imm = 0xFFFFFFFF
leaq (%rsi,%rsi,8), %rax
leaq (%rax,%rax,2), %r10
leaq (%r10,%rsi), %rax
movl 0x8(%rbx,%rax), %eax
movl %eax, 0x8(%rdi,%r8)
testl %r9d, %r9d
je 0x1d025b
leaq (%r9,%r9,8), %rax
leaq (%rax,%rax,2), %r11
addq %r9, %r11
movq 0x50(%rsp), %rax
leaq (%rax,%rsi), %rbx
addq %r10, %rbx
leaq (%r14,%r14,8), %rax
leaq (%rax,%rax,2), %r15
addq %rcx, %r15
addq %r14, %r15
xorl %r12d, %r12d
movups -0x4(%rbx,%r12), %xmm0
movups 0x8(%rbx,%r12), %xmm1
movups %xmm1, 0xcc(%rsp)
movaps %xmm0, 0xc0(%rsp)
movups (%r15), %xmm0
movups 0xc(%r15), %xmm1
movups %xmm1, 0x8(%rbx,%r12)
movups %xmm0, -0x4(%rbx,%r12)
movups 0xcc(%rsp), %xmm0
movups %xmm0, 0xc(%r15)
movapd 0xc0(%rsp), %xmm0
movupd %xmm0, (%r15)
movq (%r13), %rdi
leaq (%rdi,%r8), %r13
addq $0x4, %r13
movl (%r13), %ebp
movl (%rbx,%r12), %eax
cmpl %eax, %ebp
jbe 0x1d0223
movl %eax, (%r13)
movl %eax, %ebp
movl 0x4(%r15), %eax
cmpl %eax, %ebp
jbe 0x1d022f
movl %eax, (%r13)
addq $0x1c, %r12
addq $-0x1c, %r15
cmpq %r12, %r11
movq 0x20(%rsp), %r13
jne 0x1d01b9
movq 0x130(%rsp), %rax
movq (%rax,%rdx,8), %r11
movq 0x40(%rsp), %rbx
movq 0x10(%rsp), %r15
testb $0x1, %r11b
je 0x1d0287
addq %rbx, %rsi
addq %r10, %rsi
leaq (%r9,%r9,8), %rax
leaq (%rax,%rax,2), %rax
addq %r9, %rax
movl 0x4(%rsi,%rax), %eax
cmpl %eax, 0x4(%rdi,%r8)
jbe 0x1d0287
leaq (%rdi,%r8), %rsi
addq $0x4, %rsi
movl %eax, (%rsi)
incq %rdx
cmpq %r15, %rdx
jne 0x1d012f
jmp 0x1d02d5
xorl %r14d, %r14d
jmp 0x1d02ec
leaq (%r14,%r12,8), %rbp
movq %r14, %rdi
movq %rbp, %rsi
callq 0x19dd99
movq (%r13), %rdi
leaq (%r12,%r12,8), %rax
leaq (%rax,%rax,2), %rdx
addq %r12, %rdx
movq %rbx, %rsi
callq 0x2160
movq %r14, %rdi
movq %rbp, %rsi
callq 0x19dd99
movq (%r13), %rdi
xorl %r15d, %r15d
xorl %r14d, %r14d
movq %r15, 0x8(%r13)
leaq (%r15,%r15,8), %rax
leaq (%rax,%rax,2), %rsi
addq %r15, %rsi
addq %rdi, %rsi
callq 0x19ead4
movq %r14, %rax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq