// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Hash_Table.cpp
// Function: lchain_qdp_fix(k_mer_hit*, long, Chain_Data*, long, long, long, double, double, double, long, long, long, long, long)
uint64_t lchain_qdp_fix(k_mer_hit* a, int64_t a_n, Chain_Data* dp, int64_t max_skip, 
                int64_t max_iter, int64_t max_dis, double chn_pen_gap, double chn_pen_skip, 
                double bw_rate, int64_t xl, int64_t yl, int64_t quick_check, 
                int64_t left_fix, int64_t right_fix)
{
    int64_t *p, *t, max_f, n_skip, st, max_j, end_j, sc, msc, msc_i, bw, max_ii, ovl, movl; 
    int32_t *f, max, tmp; int64_t i, j, ret, cL = 0, must_p = 1, is_reorder = 0; k_mer_hit z;
    resize_Chain_Data(dp, a_n, NULL);
    t = dp->tmp; f = dp->score; p = dp->pre;
    bw = ((xl < yl)?xl:yl); bw *= bw_rate;
    msc = msc_i = -1; movl = INT32_MAX;

    if(quick_check) {
        ret = lchain_qcheck(a, a_n, dp, bw_rate);
        if (ret > 0) {
            a_n = ret; msc_i = a_n-1; msc = f[msc_i];
            goto skip_ldp;
        }
    }

    memset(t, 0, (a_n*sizeof((*t))));
    if((right_fix) && (!left_fix)) {
        // fprintf(stderr, "\n[M::%s::] a_n::%ld\n", __func__, a_n);
        // for (i = 0; i < a_n; ++i) {
        //     fprintf(stderr, "+[M::%s::] x::[%u, %u), y::[%u, %u)\n", __func__, 
        //     a[i].self_offset+1-(a[i].cnt&((uint32_t)(0xffu))), a[i].self_offset+1,
        //     a[i].offset+1-(a[i].cnt&((uint32_t)(0xffu))), a[i].offset+1);
        // }
        n_skip = a_n>>1;
        for (i=0; i<n_skip; ++i) {
            z = a[i]; a[i] = a[a_n-i-1]; a[a_n-i-1] = z; 
            rev_khit(a[i], xl, yl); rev_khit(a[a_n-i-1], xl, yl);
        }
        if(a_n&1) rev_khit(a[i], xl, yl);
        // for (i = 0; i < a_n; ++i) {
        //     fprintf(stderr, "-[M::%s::] x::[%u, %u), y::[%u, %u)\n", __func__, 
        //     a[i].self_offset+1-(a[i].cnt&((uint32_t)(0xffu))), a[i].self_offset+1,
        //     a[i].offset+1-(a[i].cnt&((uint32_t)(0xffu))), a[i].offset+1);
        // }
        is_reorder = 1;
    } 

    if((!right_fix) && (!left_fix)) must_p = 0;

    for (i = st = 0, max_ii = -1; i < a_n; ++i) {
        max_f = a[i].cnt&(0xffu); if(must_p) max_f = INT32_MIN;
        n_skip = 0; max_j = end_j = -1;
        if ((i-st) > max_iter) st = i-max_iter;
        // if(a[0].self_offset == 171728) {
        //     fprintf(stderr, "i::%ld[M::%s::] x::[%u, %u), y::[%u, %u)\n", i, __func__, 
        //         a[i].self_offset+1-(a[i].cnt&((uint32_t)(0xffu))), a[i].self_offset+1,
        //         a[i].offset+1-(a[i].cnt&((uint32_t)(0xffu))), a[i].offset+1);
        // }
        for (j = i - 1; j >= 0; --j) {
            sc = comput_sc_ff(&a[i], &a[j], bw_rate, chn_pen_gap, chn_pen_skip, xl, yl);
            // if(a[0].self_offset == 171728) {
            //     fprintf(stderr, "j::%ld[M::%s::sc->%ld] x::[%u, %u), y::[%u, %u)\n", j, __func__, sc,
            //     a[j].self_offset+1-(a[j].cnt&((uint32_t)(0xffu))), a[j].self_offset+1,
            //     a[j].offset+1-(a[j].cnt&((uint32_t)(0xffu))), a[j].offset+1);
            // }
            if (sc == INT32_MIN) continue;
            sc += f[j];
            if (sc > max_f) {
                max_f = sc, max_j = j;
                if (n_skip > 0) --n_skip;
            } else if (t[j] == (int32_t)i) {
                if ((++n_skip) > max_skip) {
                    if((max_j != -1) || (must_p == 0)) break;
                } 
            }
            if (p[j] >= 0) t[p[j]] = i;
            ///put it here will allow at least one prefix no matter max_dis
            ///this is special for gap filling, not for chaining
            if (a[i].self_offset > (max_dis + a[j].self_offset)) {
                if((max_j != -1)) break;
            }
            if (j < st) {
                if((max_j != -1) || (must_p == 0)) break;
            }
        }
        end_j = j;

        if (max_ii < 0 || ((int64_t)a[i].self_offset) - ((int64_t)a[max_ii].self_offset) > max_dis) {
            max = INT32_MIN; max_ii = -1;
            for (j = i - 1; (j >= st) && ((((int64_t)a[i].self_offset)-((int64_t)a[j].self_offset))<=max_dis); --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]
            tmp = comput_sc_ff(&a[i], &a[max_ii], bw_rate, chn_pen_gap, chn_pen_skip, xl, yl);
            if (tmp != INT32_MIN && max_f < tmp + f[max_ii])
                max_f = tmp + f[max_ii], max_j = max_ii;
        }
        if(max_j == -1) {
            f[i] = 0; p[i] = max_j;
        } else {
            f[i] = max_f; p[i] = max_j;
        }
        
        if ((max_ii < 0) || (((((int64_t)a[i].self_offset)-((int64_t)a[max_ii].self_offset))<=max_dis) && (f[max_ii]<f[i]))) {
            max_ii = i;
        }
        // if(a[0].self_offset == 171728) {
        //     fprintf(stderr, "i::%ld[M::%s::] f::%d, p::%ld\n", i, __func__, f[i], p[i]);
        // }
        if(f[i] >= msc) {
            ovl = get_chainLen(a[i].self_offset, a[i].self_offset, xl, a[i].offset, a[i].offset, yl);
            if(f[i] > msc || ovl < movl) {
                msc = f[i]; msc_i = i; movl = ovl;
            }
        }
    }
    
    skip_ldp:
    if(right_fix && left_fix) msc_i = a_n-1;
    ///a[] has been sorted by self_offset
    i = msc_i; cL = 0; 
    while (i >= 0) {
        t[cL++] = i; msc_i = i; i = p[i];
    }
    // if((right_fix) && (!left_fix)) {
    //     fprintf(stderr, "[M::%s::] cL::%ld\n", __func__, cL);
    // }

    if(is_reorder) {
        n_skip = a_n>>1;
        for (i=0; i<n_skip; ++i) {
            z = a[i]; a[i] = a[a_n-i-1]; a[a_n-i-1] = z; 
            rev_khit(a[i], xl, yl); rev_khit(a[a_n-i-1], xl, yl);
        }
        if(a_n&1) rev_khit(a[i], xl, yl);
        for (i = 0; i < cL; i++) {
            t[i] = a_n - t[i] - 1;
            // fprintf(stderr, ">[M::%s::] t[%ld]::%ld\n", __func__, i, t[i]);
        }
        // for (i = 0; i < a_n; ++i) {
        //     fprintf(stderr, ">[M::%s::] x::[%u, %u), y::[%u, %u)\n", __func__, 
        //     a[i].self_offset+1-(a[i].cnt&((uint32_t)(0xffu))), a[i].self_offset+1,
        //     a[i].offset+1-(a[i].cnt&((uint32_t)(0xffu))), a[i].offset+1);
        // }
    } else {
        n_skip = cL>>1;
        for (i = 0; i < n_skip; i++) {
            msc_i = t[i]; t[i] = t[cL-i-1]; t[cL-i-1] = msc_i;
        }
    } 
    // if(cL != a_n) {
    //     fprintf(stderr, "\n[M::%s::] a_n::%ld, left_fix::%ld, right_fix::%ld\n", __func__, a_n, left_fix, right_fix);
    //     for (i = 0; i < a_n; ++i) {
    //         fprintf(stderr, "+[M::%s::] x::[%u, %u), y::[%u, %u)\n", __func__, 
    //         a[i].self_offset+1-(a[i].cnt&((uint32_t)(0xffu))), a[i].self_offset+1,
    //         a[i].offset+1-(a[i].cnt&((uint32_t)(0xffu))), a[i].offset+1);
    //     }
    //     for (i = 0; i < cL; i++) {
    //         fprintf(stderr, ">[M::%s::] t[%ld]::%ld\n", __func__, i, t[i]);
    //     }
    // }
    return cL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movsd %xmm2, 0x10(%rsp)
movsd %xmm1, 0x28(%rsp)
movsd %xmm0, 0x8(%rsp)
movq %r9, %r13
movq %r8, 0x98(%rsp)
movq %rcx, 0x90(%rsp)
movq %rdx, %rbp
movq %rsi, %r14
movq %rdi, %r15
movq %rdx, %rdi
xorl %edx, %edx
callq 0x3ecb0
movq 0x28(%rbp), %rdi
movq (%rbp), %rax
movq %rax, 0x40(%rsp)
movq 0x8(%rbp), %r12
cmpq $0x0, 0x100(%rsp)
movq %rdi, (%rsp)
je 0x430c3
movq %r15, %rdi
movl %r14d, %esi
movq %rbp, %rdx
movsd 0x10(%rsp), %xmm0
callq 0x3f795
movq (%rsp), %rdi
testl %eax, %eax
jle 0x430c3
movl %eax, %r14d
leaq -0x1(%r14), %rcx
xorl %edx, %edx
jmp 0x4371d
leaq (,%r14,8), %rdx
movq $0x0, 0x48(%rsp)
xorl %esi, %esi
callq 0x20e0
cmpq $0x0, 0x110(%rsp)
sete %al
cmpq $0x0, 0x108(%rsp)
setne %cl
orb %al, %cl
je 0x43112
movq (%rsp), %rdi
movsd 0x10(%rsp), %xmm4
movsd 0x28(%rsp), %xmm5
movsd 0x8(%rsp), %xmm6
jmp 0x43225
movq %r14, %rax
sarq %rax
testq %rax, %rax
movsd 0x10(%rsp), %xmm4
movsd 0x28(%rsp), %xmm5
movsd 0x8(%rsp), %xmm6
jle 0x431d0
movq 0xf0(%rsp), %rcx
decl %ecx
movq 0xf8(%rsp), %rdx
decl %edx
movq %r14, %rsi
shlq $0x4, %rsi
addq %r15, %rsi
addq $-0x10, %rsi
movq %r15, %rdi
movq %rax, %r8
movups (%rdi), %xmm0
movaps %xmm0, 0x70(%rsp)
movups (%rsi), %xmm0
movups %xmm0, (%rdi)
movapd 0x70(%rsp), %xmm0
movupd %xmm0, (%rsi)
movl 0x4(%rdi), %r9d
movl 0x8(%rdi), %r10d
notl %r10d
movzbl 0xc(%rdi), %r11d
addl %ecx, %r10d
addl %r11d, %r10d
movl %r10d, 0x8(%rdi)
notl %r9d
addl %edx, %r11d
addl %r9d, %r11d
movl %r11d, 0x4(%rdi)
movl 0x4(%rsi), %r9d
movl 0x8(%rsi), %r10d
notl %r10d
movzbl 0xc(%rsi), %r11d
addl %ecx, %r10d
addl %r11d, %r10d
movl %r10d, 0x8(%rsi)
notl %r9d
addl %edx, %r11d
addl %r9d, %r11d
movl %r11d, 0x4(%rsi)
addq $0x10, %rdi
addq $-0x10, %rsi
decq %r8
jne 0x4315b
jmp 0x431d2
xorl %eax, %eax
movl $0x1, %ecx
movq %rcx, 0x48(%rsp)
testb $0x1, %r14b
movq (%rsp), %rdi
je 0x43225
shlq $0x4, %rax
movl 0x4(%r15,%rax), %ecx
movl 0x8(%r15,%rax), %edx
movzbl 0xc(%r15,%rax), %esi
subl %esi, %edx
incl %edx
notl %edx
movq 0xf0(%rsp), %r8
addl %r8d, %edx
movl %edx, 0x8(%r15,%rax)
subl %esi, %ecx
incl %ecx
notl %ecx
movq 0xf8(%rsp), %rdx
addl %edx, %ecx
movl %ecx, 0x4(%r15,%rax)
testq %r14, %r14
jle 0x43711
movq 0x110(%rsp), %rax
orq 0x108(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0xf0(%rsp), %rax
decq %rax
movq %rax, 0x88(%rsp)
leaq -0x8(%r15), %rax
movq %rax, 0x50(%rsp)
movq $-0x1, %r8
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, 0x68(%rsp)
xorl %edx, %edx
movq $0x0, 0x10(%rsp)
movq $-0x1, 0x60(%rsp)
movq $-0x1, %rbx
movq %r14, 0x38(%rsp)
movq %r15, 0x30(%rsp)
movq %r12, 0x20(%rsp)
movq %r13, 0x18(%rsp)
movq %rbx, 0xa8(%rsp)
movq 0x10(%rsp), %rax
movq %rdx, %rcx
shlq $0x4, %rcx
leaq (%r15,%rcx), %r11
cmpq $0x0, 0x58(%rsp)
movl 0xc(%r15,%rcx), %r10d
movzbl %r10b, %esi
movq %rsi, %rdi
movq $-0x80000000, %rcx      # imm = 0x80000000
cmovneq %rcx, %rdi
movq %rdi, 0x28(%rsp)
movq %rdx, %rcx
subq %rax, %rcx
movq %rdx, %r9
movq 0x98(%rsp), %rdi
subq %rdi, %r9
cmpq %rdi, %rcx
cmovleq %rax, %r9
movq %r9, 0x10(%rsp)
movq %rdx, %rbp
subq $0x1, %rbp
movq %r11, 0x8(%rsp)
movq %r10, 0xa0(%rsp)
jae 0x43322
movq $-0x1, %rcx
movq $-0x1, %r9
jmp 0x434df
movl 0x8(%r11), %r13d
movl %r10d, %ebx
shrl $0x8, %ebx
movslq %edx, %rax
movq %rax, 0xb0(%rsp)
movq $-0x1, %r9
movq 0x50(%rsp), %rdi
movq %rbp, %rcx
xorl %r14d, %r14d
movl (%rdi), %r12d
movl %r13d, %r15d
subl %r12d, %r15d
js 0x43409
movl 0x4(%r11), %eax
subl -0x4(%rdi), %eax
js 0x43409
movl %eax, %r10d
subl %r15d, %r10d
movl %r15d, %r11d
cmovbl %eax, %r11d
subl %eax, %r15d
cmovbl %r10d, %r15d
cmpl %r11d, %esi
movl %r11d, %r10d
cmovbl %esi, %r10d
movl $0x1, %eax
cmpl %ebx, %r10d
jb 0x43396
movzbl %r10b, %eax
divb %bl
movzbl %al, %eax
cmpl %r11d, %esi
jb 0x433a0
testl %r15d, %r15d
je 0x433dc
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
movapd %xmm0, %xmm1
cvtsi2sd %eax, %xmm2
mulsd %xmm6, %xmm1
xorps %xmm3, %xmm3
cvtsi2sd %r11d, %xmm3
divsd %xmm3, %xmm0
divsd %xmm4, %xmm0
mulsd %xmm2, %xmm0
minsd %xmm1, %xmm0
mulsd %xmm5, %xmm3
addsd %xmm0, %xmm3
cvttsd2si %xmm3, %r10d
subl %r10d, %eax
cltq
movq 0x40(%rsp), %r10
movslq (%r10,%rcx,4), %r10
addq %rax, %r10
cmpq 0x28(%rsp), %r10
jle 0x43411
xorl %eax, %eax
testq %r14, %r14
setg %al
subq %rax, %r14
movq %rcx, %r15
movq %r14, %rax
movq %r10, 0x28(%rsp)
jmp 0x43457
movq %r14, %rax
jmp 0x434a8
movq (%rsp), %rax
movq 0xb0(%rsp), %r10
cmpq %r10, (%rax,%rcx,8)
jne 0x43436
leaq 0x1(%r14), %rax
cmpq 0x90(%rsp), %r14
jge 0x4343e
movq %r9, %r15
jmp 0x43457
movq %r9, %r15
movq %r14, %rax
jmp 0x43457
cmpq $0x0, 0x58(%rsp)
je 0x434cb
movq $-0x1, %r15
cmpq $-0x1, %r9
jne 0x434cb
movq 0x20(%rsp), %r9
movq (%r9,%rcx,8), %r9
testq %r9, %r9
js 0x4346d
movq (%rsp), %r10
movq %rdx, (%r10,%r9,8)
addq 0x18(%rsp), %r12
cmpq %r13, %r12
jge 0x4347d
cmpq $-0x1, %r15
jne 0x434c8
cmpq 0x10(%rsp), %rcx
jge 0x434a0
cmpq $0x0, 0x58(%rsp)
movq 0x8(%rsp), %r11
je 0x434c8
movq $-0x1, %r9
cmpq $-0x1, %r15
je 0x434a8
jmp 0x434c8
movq %r15, %r9
movq 0x8(%rsp), %r11
leaq -0x1(%rcx), %r10
addq $-0x10, %rdi
movq %rax, %r14
testq %rcx, %rcx
movq %r10, %rcx
jg 0x43349
movq $-0x1, %rcx
jmp 0x434cb
movq %r15, %r9
movq 0x38(%rsp), %r14
movq 0x30(%rsp), %r15
movq 0x20(%rsp), %r12
movq 0x18(%rsp), %r13
testq %r8, %r8
js 0x43500
movq 0x8(%rsp), %rax
movl 0x8(%rax), %eax
movq %r8, %rdi
shlq $0x4, %rdi
movl 0x8(%r15,%rdi), %edi
subq %rdi, %rax
cmpq %r13, %rax
jle 0x43559
movq $-0x1, %r8
cmpq 0x10(%rsp), %rdx
movq 0x8(%rsp), %r11
jle 0x4362a
movl 0x8(%r11), %eax
movl $0x80000000, %edi       # imm = 0x80000000
movq 0x50(%rsp), %r10
movl (%r10), %r11d
movq %rax, %rbx
subq %r11, %rbx
cmpq %r13, %rbx
jg 0x43559
movq 0x40(%rsp), %r11
movl (%r11,%rbp,4), %r11d
cmpl %r11d, %edi
cmovlq %rbp, %r8
cmovlel %r11d, %edi
leaq -0x1(%rbp), %r11
addq $-0x10, %r10
cmpq 0x10(%rsp), %rbp
movq %r11, %rbp
jg 0x43525
testq %r8, %r8
sets %al
cmpq %rcx, %r8
setge %cl
orb %al, %cl
jne 0x43625
movq %r8, %rax
shlq $0x4, %rax
movq 0x8(%rsp), %r11
movl 0x8(%r11), %ecx
subl 0x8(%r15,%rax), %ecx
js 0x4362a
addq %r15, %rax
movl 0x4(%r11), %r10d
subl 0x4(%rax), %r10d
js 0x4362a
movl %r10d, %eax
subl %ecx, %eax
movl %ecx, %edi
cmovbl %r10d, %edi
subl %r10d, %ecx
cmovbl %eax, %ecx
cmpl %edi, %esi
movl %edi, %r10d
cmovbl %esi, %r10d
movq 0xa0(%rsp), %rbx
shrl $0x8, %ebx
movl $0x1, %eax
cmpl %ebx, %r10d
jb 0x435d1
movzbl %r10b, %eax
divb %bl
movzbl %al, %eax
cmpl %edi, %esi
jb 0x435d9
testl %ecx, %ecx
je 0x4360b
cvtsi2sd %ecx, %xmm0
movapd %xmm0, %xmm1
cvtsi2sd %eax, %xmm2
mulsd %xmm6, %xmm1
cvtsi2sd %edi, %xmm3
divsd %xmm3, %xmm0
divsd %xmm4, %xmm0
mulsd %xmm2, %xmm0
minsd %xmm1, %xmm0
mulsd %xmm5, %xmm3
addsd %xmm0, %xmm3
cvttsd2si %xmm3, %ecx
subl %ecx, %eax
movq 0x40(%rsp), %rcx
movslq (%rcx,%r8,4), %rcx
cltq
addq %rcx, %rax
movq %r8, %rcx
cmpq %rax, 0x28(%rsp)
jge 0x4362a
jmp 0x43643
movq 0x8(%rsp), %r11
cmpq $-0x1, %r9
je 0x4363a
movq 0x28(%rsp), %rax
movq %r9, %rcx
jmp 0x43643
movq $-0x1, %rcx
xorl %eax, %eax
movq 0x40(%rsp), %rsi
movl %eax, (%rsi,%rdx,4)
movq %rcx, (%r12,%rdx,8)
testq %r8, %r8
movq 0xa8(%rsp), %rbx
js 0x4367f
movl 0x8(%r11), %ecx
movq %r8, %rsi
shlq $0x4, %rsi
movl 0x8(%r15,%rsi), %esi
subq %rsi, %rcx
cmpq %r13, %rcx
jg 0x43682
movq 0x40(%rsp), %rcx
cmpl %eax, (%rcx,%r8,4)
jge 0x43682
movq %rdx, %r8
cltq
cmpq %rax, %rbx
jg 0x436ef
movl 0x4(%r11), %esi
movl 0x8(%r11), %edi
movq %rsi, %rcx
subq %rdi, %rcx
incq %rcx
movq %rdi, %r9
notq %r9
addq 0xf0(%rsp), %r9
movq %rsi, %r10
notq %r10
addq 0xf8(%rsp), %r10
movq %rdi, %r11
addq %r10, %r11
cmpq %r10, %r9
cmovleq 0x88(%rsp), %r11
cmpl %esi, %edi
movl $0x1, %esi
cmovbeq %rsi, %rcx
addq %r11, %rcx
cmpq %rax, %rbx
jl 0x436e2
cmpq 0x68(%rsp), %rcx
jge 0x436ef
movq %rax, %rbx
movq %rdx, 0x60(%rsp)
movq %rcx, 0x68(%rsp)
incq %rdx
addq $0x10, 0x50(%rsp)
cmpq %r14, %rdx
jne 0x4329f
movq (%rsp), %rdi
movq 0x48(%rsp), %rdx
movq 0x60(%rsp), %rcx
jmp 0x4371d
movq $-0x1, %rcx
movq 0x48(%rsp), %rdx
leaq -0x1(%r14), %rax
cmpq $0x0, 0x110(%rsp)
cmoveq %rcx, %rax
cmpq $0x0, 0x108(%rsp)
cmoveq %rcx, %rax
xorl %ecx, %ecx
testq %rax, %rax
js 0x4379e
movq %rax, (%rdi,%rcx,8)
incq %rcx
movq (%r12,%rax,8), %rax
testq %rax, %rax
jns 0x43742
testq %rdx, %rdx
jne 0x437ac
movl $0x1, %eax
cmpq $0x1, %rcx
je 0x438c3
leaq -0x1(%rcx), %rax
movq %rcx, %rdx
shrq %rdx
xorl %esi, %esi
movq (%rdi,%rsi,8), %r9
movq (%rsp), %rdi
movq (%rdi,%rax,8), %r8
movq (%rsp), %rdi
movq %r8, (%rdi,%rsi,8)
movq (%rsp), %rdi
movq %r9, (%rdi,%rax,8)
incq %rsi
decq %rax
cmpq %rsi, %rdx
jne 0x43772
jmp 0x438c0
movl $0x0, %eax
testq %rdx, %rdx
je 0x438c3
movq %r14, %rax
sarq %rax
testq %rax, %rax
jle 0x4385a
movq 0xf0(%rsp), %rdx
decl %edx
movq 0xf8(%rsp), %rsi
decl %esi
movq %r14, %rdi
shlq $0x4, %rdi
addq %r15, %rdi
addq $-0x10, %rdi
movq %r15, %r8
movq %rax, %r9
movups (%r8), %xmm0
movaps %xmm0, 0x70(%rsp)
movups (%rdi), %xmm0
movups %xmm0, (%r8)
movapd 0x70(%rsp), %xmm0
movupd %xmm0, (%rdi)
movl 0x4(%r8), %r10d
movl 0x8(%r8), %r11d
notl %r11d
movzbl 0xc(%r8), %ebx
addl %edx, %r11d
addl %ebx, %r11d
movl %r11d, 0x8(%r8)
notl %r10d
addl %esi, %ebx
addl %r10d, %ebx
movl %ebx, 0x4(%r8)
movl 0x4(%rdi), %r10d
movl 0x8(%rdi), %r11d
notl %r11d
movzbl 0xc(%rdi), %ebx
addl %edx, %r11d
addl %ebx, %r11d
movl %r11d, 0x8(%rdi)
notl %r10d
addl %esi, %ebx
addl %r10d, %ebx
movl %ebx, 0x4(%rdi)
addq $0x10, %r8
addq $-0x10, %rdi
decq %r9
jne 0x437e3
movq (%rsp), %rdi
jmp 0x4385c
xorl %eax, %eax
testb $0x1, %r14b
je 0x438a3
shlq $0x4, %rax
movl 0x4(%r15,%rax), %edx
movl 0x8(%r15,%rax), %esi
movzbl 0xc(%r15,%rax), %r8d
subl %r8d, %esi
incl %esi
notl %esi
movq 0xf0(%rsp), %r9
addl %esi, %r9d
movl %r9d, 0x8(%r15,%rax)
subl %r8d, %edx
incl %edx
notl %edx
movq 0xf8(%rsp), %rsi
addl %edx, %esi
movl %esi, 0x4(%r15,%rax)
xorl %eax, %eax
testq %rcx, %rcx
je 0x438c3
movq (%rdi,%rax,8), %rdx
notq %rdx
addq %r14, %rdx
movq %rdx, (%rdi,%rax,8)
incq %rax
cmpq %rax, %rcx
jne 0x438aa
movq %rcx, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq