// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/detection_layer.c
// Function: forward_detection_layer
void forward_detection_layer(const detection_layer l, network net)
{
    int locations = l.side*l.side;
    int i,j;
    memcpy(l.output, net.input, l.outputs*l.batch*sizeof(float));
    //if(l.reorg) reorg(l.output, l.w*l.h, size*l.n, l.batch, 1);
    int b;
    if (l.softmax){
        for(b = 0; b < l.batch; ++b){
            int index = b*l.inputs;
            for (i = 0; i < locations; ++i) {
                int offset = i*l.classes;
                softmax(l.output + index + offset, l.classes, 1, 1,
                        l.output + index + offset);
            }
        }
    }
    if(net.train){
        float avg_iou = 0;
        float avg_cat = 0;
        float avg_allcat = 0;
        float avg_obj = 0;
        float avg_anyobj = 0;
        int count = 0;
        *(l.cost) = 0;
        int size = l.inputs * l.batch;
        memset(l.delta, 0, size * sizeof(float));
        for (b = 0; b < l.batch; ++b){
            int index = b*l.inputs;
            for (i = 0; i < locations; ++i) {
                int truth_index = (b*locations + i)*(1+l.coords+l.classes);
                int is_obj = net.truth[truth_index];
                for (j = 0; j < l.n; ++j) {
                    int p_index = index + locations*l.classes + i*l.n + j;
                    l.delta[p_index] = l.noobject_scale*(0 - l.output[p_index]);
                    *(l.cost) += l.noobject_scale*pow(l.output[p_index], 2);
                    avg_anyobj += l.output[p_index];
                }

                int best_index = -1;
                float best_iou = 0;
                float best_rmse = 20;

                if (!is_obj){
                    continue;
                }

                int class_index = index + i*l.classes;
                for(j = 0; j < l.classes; ++j) {
                    l.delta[class_index+j] = l.class_scale * (net.truth[truth_index+1+j] - l.output[class_index+j]);
                    *(l.cost) += l.class_scale * pow(net.truth[truth_index+1+j] - l.output[class_index+j], 2);
                    if(net.truth[truth_index + 1 + j]) avg_cat += l.output[class_index+j];
                    avg_allcat += l.output[class_index+j];
                }

                box truth = float_to_box(net.truth + truth_index + 1 + l.classes, 1);
                truth.x /= l.side;
                truth.y /= l.side;

                for(j = 0; j < l.n; ++j){
                    int box_index = index + locations*(l.classes + l.n) + (i*l.n + j) * l.coords;
                    box out = float_to_box(l.output + box_index, 1);
                    out.x /= l.side;
                    out.y /= l.side;

                    if (l.sqrt){
                        out.w = out.w*out.w;
                        out.h = out.h*out.h;
                    }

                    float iou  = box_iou(out, truth);
                    //iou = 0;
                    float rmse = box_rmse(out, truth);
                    if(best_iou > 0 || iou > 0){
                        if(iou > best_iou){
                            best_iou = iou;
                            best_index = j;
                        }
                    }else{
                        if(rmse < best_rmse){
                            best_rmse = rmse;
                            best_index = j;
                        }
                    }
                }

                if(l.forced){
                    if(truth.w*truth.h < .1){
                        best_index = 1;
                    }else{
                        best_index = 0;
                    }
                }
                if(l.random && *(net.seen) < 64000){
                    best_index = rand()%l.n;
                }

                int box_index = index + locations*(l.classes + l.n) + (i*l.n + best_index) * l.coords;
                int tbox_index = truth_index + 1 + l.classes;

                box out = float_to_box(l.output + box_index, 1);
                out.x /= l.side;
                out.y /= l.side;
                if (l.sqrt) {
                    out.w = out.w*out.w;
                    out.h = out.h*out.h;
                }
                float iou  = box_iou(out, truth);

                //printf("%d,", best_index);
                int p_index = index + locations*l.classes + i*l.n + best_index;
                *(l.cost) -= l.noobject_scale * pow(l.output[p_index], 2);
                *(l.cost) += l.object_scale * pow(1-l.output[p_index], 2);
                avg_obj += l.output[p_index];
                l.delta[p_index] = l.object_scale * (1.-l.output[p_index]);

                if(l.rescore){
                    l.delta[p_index] = l.object_scale * (iou - l.output[p_index]);
                }

                l.delta[box_index+0] = l.coord_scale*(net.truth[tbox_index + 0] - l.output[box_index + 0]);
                l.delta[box_index+1] = l.coord_scale*(net.truth[tbox_index + 1] - l.output[box_index + 1]);
                l.delta[box_index+2] = l.coord_scale*(net.truth[tbox_index + 2] - l.output[box_index + 2]);
                l.delta[box_index+3] = l.coord_scale*(net.truth[tbox_index + 3] - l.output[box_index + 3]);
                if(l.sqrt){
                    l.delta[box_index+2] = l.coord_scale*(sqrt(net.truth[tbox_index + 2]) - l.output[box_index + 2]);
                    l.delta[box_index+3] = l.coord_scale*(sqrt(net.truth[tbox_index + 3]) - l.output[box_index + 3]);
                }

                *(l.cost) += pow(1-iou, 2);
                avg_iou += iou;
                ++count;
            }
        }

        if(0){
            float *costs = calloc(l.batch*locations*l.n, sizeof(float));
            for (b = 0; b < l.batch; ++b) {
                int index = b*l.inputs;
                for (i = 0; i < locations; ++i) {
                    for (j = 0; j < l.n; ++j) {
                        int p_index = index + locations*l.classes + i*l.n + j;
                        costs[b*locations*l.n + i*l.n + j] = l.delta[p_index]*l.delta[p_index];
                    }
                }
            }
            int indexes[100];
            top_k(costs, l.batch*locations*l.n, 100, indexes);
            float cutoff = costs[indexes[99]];
            for (b = 0; b < l.batch; ++b) {
                int index = b*l.inputs;
                for (i = 0; i < locations; ++i) {
                    for (j = 0; j < l.n; ++j) {
                        int p_index = index + locations*l.classes + i*l.n + j;
                        if (l.delta[p_index]*l.delta[p_index] < cutoff) l.delta[p_index] = 0;
                    }
                }
            }
            free(costs);
        }


        *(l.cost) = pow(mag_array(l.delta, l.outputs * l.batch), 2);


        printf("Detection Avg IOU: %f, Pos Cat: %f, All Cat: %f, Pos Obj: %f, Any Obj: %f, count: %d\n", avg_iou/count, avg_cat/count, avg_allcat/(count*l.classes), avg_obj/count, avg_anyobj/(l.batch*locations*l.n), count);
        //if(l.reorg) reorg(l.delta, l.w*l.h, size*l.n, l.batch, 0);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
leaq 0x6f0(%rsp), %rcx
leaq 0x250(%rsp), %r15
movl 0x94(%r15), %eax
movl %eax, 0x48(%rsp)
imull %eax, %eax
movl %eax, 0x28(%rsp)
movq 0x268(%r15), %r14
movq 0xd8(%rcx), %rsi
movl 0x48(%r15), %ebx
movl 0x58(%r15), %ecx
movl %ebx, %eax
movl %ecx, 0xb4(%rsp)
imull %ecx, %eax
movslq %eax, %rdx
shlq $0x2, %rdx
movq %r14, %rdi
callq 0x32c0
cmpl $0x0, 0xf8(%r15)
setne %al
testl %ebx, %ebx
setg %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x35182
movl %ebx, %eax
movq %rax, 0x50(%rsp)
leaq 0x250(%rsp), %rax
movslq 0x54(%rax), %rcx
movslq 0xfc(%rax), %rbx
movl 0x28(%rsp), %eax
cmpl $0x1, %eax
adcl $0x0, %eax
movq %rax, 0xa8(%rsp)
shlq $0x2, %rcx
movq %rcx, 0x60(%rsp)
movq %rbx, %r15
shlq $0x2, %r15
xorl %r13d, %r13d
cmpl $0x0, 0x48(%rsp)
je 0x35173
movq 0xa8(%rsp), %rbp
movq %r14, %r12
movq %r12, %rdi
movl %ebx, %esi
movss 0x1deaa(%rip), %xmm0    # 0x53008
movl $0x1, %edx
movq %r12, %rcx
callq 0x28a75
addq %r15, %r12
decq %rbp
jne 0x35151
incq %r13
addq 0x60(%rsp), %r14
cmpq 0x50(%rsp), %r13
jne 0x3513f
leaq 0x6f0(%rsp), %r14
cmpl $0x0, 0xf8(%r14)
je 0x35bbf
leaq 0x250(%rsp), %rbx
movq 0x1d8(%rbx), %rax
movq %rax, 0x120(%rsp)
movl $0x0, (%rax)
movslq 0x54(%rbx), %rax
movslq 0x48(%rbx), %rdx
imulq %rax, %rdx
movq 0x260(%rbx), %rdi
shlq $0x2, %rdx
xorl %r15d, %r15d
movq %rdi, 0x118(%rsp)
xorl %esi, %esi
callq 0x31d0
movslq 0x48(%rbx), %rax
movq %rax, 0xd8(%rsp)
testq %rax, %rax
jle 0x35bd1
movslq 0x100(%rbx), %rdx
movl 0xfc(%rbx), %esi
leal (%rdx,%rsi), %eax
incl %eax
movq 0x8(%r14), %rcx
movq %rcx, 0x170(%rsp)
movq 0xe0(%r14), %rdi
movslq 0x84(%rbx), %r8
movl %esi, %r9d
movl 0x28(%rsp), %ecx
imull %ecx, %r9d
movss 0x148(%rbx), %xmm2
movq 0x268(%rbx), %r13
cvtss2sd %xmm2, %xmm3
movss 0x150(%rbx), %xmm4
cvtss2sd %xmm4, %xmm5
movslq %esi, %r10
xorps %xmm0, %xmm0
cvtsi2ssl 0x94(%rbx), %xmm0
movss %xmm0, 0x40(%rsp)
leal (%r10,%r8), %r11d
imull %ecx, %r11d
movaps 0x22504(%rip), %xmm0    # 0x57770
xorps %xmm3, %xmm0
movaps %xmm0, 0x1e0(%rsp)
movss 0x144(%rbx), %xmm0
movss %xmm0, 0xb8(%rsp)
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x178(%rsp)
movss 0x140(%rbx), %xmm0
movss %xmm0, 0xc8(%rsp)
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0xe8(%rsp)
cmpl $0x1, %ecx
movl %ecx, %r14d
adcl $0x0, %r14d
movq %r14, 0x1c0(%rsp)
movslq %eax, %r15
movq %r11, 0x130(%rsp)
movslq %r11d, %rax
movslq %ecx, %rcx
leaq (,%rax,4), %r11
addq %r13, %r11
movq %rcx, 0x128(%rsp)
imulq %r15, %rcx
shlq $0x2, %rcx
movq %rcx, 0x140(%rsp)
movq %r8, %rax
imulq %rdx, %rax
shlq $0x2, %rax
movq %rax, 0x1b0(%rsp)
movq %rdx, 0x190(%rsp)
shlq $0x2, %rdx
movq %rdx, 0x1d8(%rsp)
xorps %xmm8, %xmm8
movslq 0x54(%rbx), %rax
movq 0x260(%rbx), %rcx
movq 0x1d8(%rbx), %r14
movl 0x4c(%rbx), %edx
movl %edx, 0xc4(%rsp)
movl 0xac(%rbx), %edx
movl %edx, 0x3c(%rsp)
movl 0x158(%rbx), %edx
movl %edx, 0xc0(%rsp)
movl 0x108(%rbx), %edx
movl %edx, 0xbc(%rsp)
movq %r8, 0x180(%rsp)
movl %r8d, %r12d
movq %rcx, %r8
leaq 0x4(%rdi), %rbx
movq %r15, 0x1b8(%rsp)
leaq (,%r15,4), %rcx
movq %rcx, 0x1a8(%rsp)
movq %rax, 0xe0(%rsp)
leaq (,%rax,4), %rax
movq %rax, 0x138(%rsp)
movq %r10, 0xf0(%rsp)
leaq (,%r10,4), %rax
movq %rax, 0x1a0(%rsp)
xorl %ecx, %ecx
movq %r8, %rdx
movq %r13, %rbp
movl %r9d, 0xcc(%rsp)
movl %r9d, 0x2c(%rsp)
xorl %r15d, %r15d
xorps %xmm0, %xmm0
movss %xmm0, 0x18(%rsp)
xorps %xmm9, %xmm9
xorps %xmm7, %xmm7
movss %xmm0, 0x1c(%rsp)
xorps %xmm6, %xmm6
movq %rsi, 0x188(%rsp)
movq %rdi, 0x88(%rsp)
movss %xmm2, 0x34(%rsp)
movaps %xmm3, 0x100(%rsp)
movss %xmm4, 0x30(%rsp)
movsd %xmm5, 0x80(%rsp)
movq %r8, 0x78(%rsp)
movq %r12, 0xa0(%rsp)
cmpl $0x0, 0x48(%rsp)
movq %r11, 0x168(%rsp)
movq %rbx, 0x160(%rsp)
movq %rcx, 0x158(%rsp)
movq %rdx, 0x150(%rsp)
movq %rbp, 0x148(%rsp)
je 0x35b5c
movq %rcx, %r9
imulq 0xe0(%rsp), %r9
imulq 0x128(%rsp), %rcx
movq %rcx, 0x1c8(%rsp)
movq 0x130(%rsp), %rax
movq %r9, 0x198(%rsp)
addl %r9d, %eax
movl %eax, 0xd0(%rsp)
movq %r11, 0x98(%rsp)
movq %rdx, %r9
movl 0x2c(%rsp), %r10d
xorl %ecx, %ecx
movq 0x1c8(%rsp), %rax
movq %rcx, 0xf8(%rsp)
leaq (%rcx,%rax), %r11
imulq 0x1b8(%rsp), %r11
cvttss2si (%rdi,%r11,4), %eax
testl %r12d, %r12d
jle 0x3551f
movq %r12, %rcx
movl %r10d, %edx
movslq %edx, %rdx
xorps %xmm0, %xmm0
subss (%r13,%rdx,4), %xmm0
mulss %xmm2, %xmm0
movss %xmm0, (%r8,%rdx,4)
xorps %xmm0, %xmm0
cvtss2sd (%r13,%rdx,4), %xmm0
mulsd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtss2sd (%r14), %xmm1
mulsd %xmm3, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%r14)
addss (%r13,%rdx,4), %xmm6
incl %edx
decq %rcx
jne 0x354d3
testl %eax, %eax
je 0x35b12
testl %esi, %esi
jle 0x35593
xorl %eax, %eax
movss (%rbx,%rax,4), %xmm0
subss (%rbp,%rax,4), %xmm0
mulss %xmm4, %xmm0
movss %xmm0, (%r9,%rax,4)
movss (%rbx,%rax,4), %xmm0
subss (%rbp,%rax,4), %xmm0
cvtss2sd %xmm0, %xmm0
mulsd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtss2sd (%r14), %xmm1
mulsd %xmm5, %xmm0
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, (%r14)
movss (%rbx,%rax,4), %xmm0
ucomiss %xmm8, %xmm0
jne 0x3557e
jnp 0x35585
addss (%rbp,%rax,4), %xmm9
addss (%rbp,%rax,4), %xmm7
incq %rax
cmpq %rax, %rsi
jne 0x3552d
movl %r10d, 0x38(%rsp)
movq %r9, 0x90(%rsp)
movss %xmm9, 0xc(%rsp)
movss %xmm7, 0x10(%rsp)
movss %xmm6, 0x14(%rsp)
movl %r15d, 0xd4(%rsp)
movq %r11, 0x1d0(%rsp)
leaq (%rdi,%r11,4), %rax
movq 0xf0(%rsp), %rcx
leaq (%rax,%rcx,4), %rdi
addq $0x4, %rdi
movl $0x1, %esi
callq 0x36a46
movaps %xmm1, 0x50(%rsp)
movaps %xmm0, %xmm2
movss 0x40(%rsp), %xmm1
divss %xmm1, %xmm2
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
divss %xmm1, %xmm0
unpcklps %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
movaps %xmm2, 0x60(%rsp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %r12d, %r12d
jle 0x35718
movq %rax, 0x20(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x44(%rsp)
movq 0x98(%rsp), %r12
xorl %r15d, %r15d
movss 0x2213a(%rip), %xmm0    # 0x5776c
movss %xmm0, 0x4c(%rsp)
movq %r12, %rdi
movl $0x1, %esi
callq 0x36a46
cmpl $0x0, 0x3c(%rsp)
je 0x3564f
mulps %xmm1, %xmm1
movaps %xmm1, 0x1f0(%rsp)
movaps %xmm0, %xmm3
movss 0x40(%rsp), %xmm2
divss %xmm2, %xmm3
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
divss %xmm2, %xmm0
unpcklps %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1]
movaps %xmm3, 0x200(%rsp)
movaps %xmm3, %xmm0
movaps 0x60(%rsp), %xmm2
movaps 0x50(%rsp), %xmm3
callq 0x36754
movss %xmm0, 0xa8(%rsp)
movaps 0x200(%rsp), %xmm0
movaps 0x1f0(%rsp), %xmm1
movaps 0x60(%rsp), %xmm2
movaps 0x50(%rsp), %xmm3
callq 0x36d6b
xorps %xmm1, %xmm1
movss 0x44(%rsp), %xmm2
ucomiss %xmm1, %xmm2
movss 0xa8(%rsp), %xmm2
ja 0x356e8
ucomiss %xmm1, %xmm2
ja 0x356e8
movss 0x4c(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x356fd
movl %r15d, %eax
movq %rax, 0x20(%rsp)
movss %xmm0, 0x4c(%rsp)
jmp 0x356fd
ucomiss 0x44(%rsp), %xmm2
jbe 0x356fd
movl %r15d, %eax
movq %rax, 0x20(%rsp)
movss %xmm2, 0x44(%rsp)
incq %r15
addq 0x1d8(%rsp), %r12
cmpq %r15, 0xa0(%rsp)
jne 0x35638
jmp 0x3571d
movq %rax, 0x20(%rsp)
cmpl $0x0, 0xc4(%rsp)
je 0x35751
movaps 0x50(%rsp), %xmm1
movaps %xmm1, %xmm0
shufps $0x55, %xmm1, %xmm0     # xmm0 = xmm0[1,1],xmm1[1,1]
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
xorl %eax, %eax
movsd 0x20e6b(%rip), %xmm1    # 0x565b0
ucomisd %xmm0, %xmm1
seta %al
movq %rax, 0x20(%rsp)
cmpl $0x0, 0xc0(%rsp)
movq 0xa0(%rsp), %r15
movq 0xf8(%rsp), %r12
je 0x3578a
movq 0x170(%rsp), %rax
cmpq $0xf9ff, (%rax)         # imm = 0xF9FF
ja 0x3578a
callq 0x34f0
cltd
idivl %r15d
movq %rdx, 0x20(%rsp)
movq 0x180(%rsp), %r15
imull %r12d, %r15d
movq 0x20(%rsp), %rax
addl %r15d, %eax
imull 0x190(%rsp), %eax
addl 0xd0(%rsp), %eax
movslq %eax, %r12
leaq (,%r12,4), %rdi
addq %r13, %rdi
movl $0x1, %esi
callq 0x36a46
cmpl $0x0, 0x3c(%rsp)
je 0x357cf
mulps %xmm1, %xmm1
movaps %xmm0, %xmm2
movss 0x40(%rsp), %xmm3
divss %xmm3, %xmm2
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
divss %xmm3, %xmm0
unpcklps %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
movaps %xmm2, %xmm0
movaps 0x60(%rsp), %xmm2
movaps 0x50(%rsp), %xmm3
callq 0x36754
movaps %xmm0, %xmm10
movq 0x20(%rsp), %rax
addl 0x198(%rsp), %eax
addl 0xcc(%rsp), %eax
addl %r15d, %eax
cltq
xorps %xmm0, %xmm0
cvtss2sd (%r13,%rax,4), %xmm0
mulsd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtss2sd (%r14), %xmm1
mulsd 0x1e0(%rsp), %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%r14)
movss 0x1d7bf(%rip), %xmm1    # 0x53008
subss (%r13,%rax,4), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm1
cvtss2sd %xmm0, %xmm0
movsd 0x178(%rsp), %xmm2
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, (%r14)
movss (%r13,%rax,4), %xmm11
xorps %xmm0, %xmm0
cvtss2sd %xmm11, %xmm0
movsd 0x1d898(%rip), %xmm1    # 0x53128
subsd %xmm0, %xmm1
mulsd %xmm2, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movq 0x78(%rsp), %r8
movss %xmm0, (%r8,%rax,4)
cmpl $0x0, 0xbc(%rsp)
je 0x358d2
movss (%r13,%rax,4), %xmm0
movaps %xmm10, %xmm1
subss %xmm0, %xmm1
mulss 0xb8(%rsp), %xmm1
movss %xmm1, (%r8,%rax,4)
movq 0xf0(%rsp), %rax
movq 0x1d0(%rsp), %rcx
leaq (%rcx,%rax), %r15
incq %r15
movq 0x88(%rsp), %rdi
movss (%rdi,%r15,4), %xmm0
subss (%r13,%r12,4), %xmm0
movss 0xc8(%rsp), %xmm1
mulss %xmm1, %xmm0
movss %xmm0, (%r8,%r12,4)
movss 0x4(%rdi,%r15,4), %xmm0
subss 0x4(%r13,%r12,4), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0x4(%r8,%r12,4)
movss 0x8(%rdi,%r15,4), %xmm0
subss 0x8(%r13,%r12,4), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0x8(%r8,%r12,4)
movss 0xc(%rdi,%r15,4), %xmm0
subss 0xc(%r13,%r12,4), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0xc(%r8,%r12,4)
cmpl $0x0, 0x3c(%rsp)
movss 0x34(%rsp), %xmm2
movaps 0x100(%rsp), %xmm3
movss 0x30(%rsp), %xmm4
movsd 0x80(%rsp), %xmm5
movss 0x14(%rsp), %xmm6
movss 0x10(%rsp), %xmm7
xorps %xmm8, %xmm8
movss 0xc(%rsp), %xmm9
movq 0x90(%rsp), %r9
movl 0x38(%rsp), %r10d
je 0x35aa8
xorps %xmm0, %xmm0
cvtss2sd 0x8(%rdi,%r15,4), %xmm0
ucomisd 0x1fab6(%rip), %xmm0    # 0x55470
movss %xmm10, 0x50(%rsp)
movss %xmm11, 0x60(%rsp)
jb 0x359d0
sqrtsd %xmm0, %xmm0
jmp 0x359e2
callq 0x3470
movq 0x78(%rsp), %r8
movq 0x88(%rsp), %rdi
leaq 0x2(%r12), %rax
xorps %xmm1, %xmm1
cvtss2sd (%r13,%rax,4), %xmm1
subsd %xmm1, %xmm0
mulsd 0xe8(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%r8,%rax,4)
xorps %xmm0, %xmm0
cvtss2sd 0xc(%rdi,%r15,4), %xmm0
ucomisd 0x1fa56(%rip), %xmm0    # 0x55470
jb 0x35a22
sqrtsd %xmm0, %xmm0
jmp 0x35a34
callq 0x3470
movq 0x78(%rsp), %r8
movq 0x88(%rsp), %rdi
movss 0x34(%rsp), %xmm2
movaps 0x100(%rsp), %xmm3
movss 0x30(%rsp), %xmm4
movsd 0x80(%rsp), %xmm5
movss 0x14(%rsp), %xmm6
movss 0x10(%rsp), %xmm7
xorps %xmm8, %xmm8
movss 0xc(%rsp), %xmm9
movq 0x90(%rsp), %r9
movl 0x38(%rsp), %r10d
movss 0x50(%rsp), %xmm10
movss 0x60(%rsp), %xmm11
addq $0x3, %r12
xorps %xmm1, %xmm1
cvtss2sd (%r13,%r12,4), %xmm1
subsd %xmm1, %xmm0
mulsd 0xe8(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%r8,%r12,4)
movss 0x1d558(%rip), %xmm0    # 0x53008
subss %xmm10, %xmm0
cvtss2sd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtss2sd (%r14), %xmm1
mulsd %xmm0, %xmm0
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss 0x1c(%rsp), %xmm1
addss %xmm11, %xmm1
movss %xmm1, 0x1c(%rsp)
movss %xmm0, (%r14)
movss 0x18(%rsp), %xmm0
addss %xmm10, %xmm0
movss %xmm0, 0x18(%rsp)
movl 0xd4(%rsp), %r15d
incl %r15d
movq 0x188(%rsp), %rsi
movq 0xa0(%rsp), %r12
movq 0xf8(%rsp), %rcx
incq %rcx
addl %r12d, %r10d
addq 0x1a8(%rsp), %rbx
movq 0x1a0(%rsp), %rax
addq %rax, %rbp
addq %rax, %r9
movq 0x98(%rsp), %rax
addq 0x1b0(%rsp), %rax
movq %rax, 0x98(%rsp)
cmpq 0x1c0(%rsp), %rcx
jne 0x354a5
movq 0x158(%rsp), %rcx
incq %rcx
movl 0x2c(%rsp), %eax
addl 0xe0(%rsp), %eax
movl %eax, 0x2c(%rsp)
movq 0x160(%rsp), %rbx
addq 0x140(%rsp), %rbx
movq 0x138(%rsp), %rax
movq 0x148(%rsp), %rbp
addq %rax, %rbp
movq 0x150(%rsp), %rdx
addq %rax, %rdx
movq 0x168(%rsp), %r11
addq %rax, %r11
cmpq 0xd8(%rsp), %rcx
jne 0x35429
jmp 0x35bea
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorps %xmm6, %xmm6
xorps %xmm0, %xmm0
movss %xmm0, 0x1c(%rsp)
xorps %xmm7, %xmm7
xorps %xmm9, %xmm9
movss %xmm0, 0x18(%rsp)
movss %xmm9, 0xc(%rsp)
movss %xmm7, 0x10(%rsp)
movss %xmm6, 0x14(%rsp)
movl 0xb4(%rsp), %esi
movq 0xd8(%rsp), %rbx
imull %ebx, %esi
movq 0x118(%rsp), %rdi
callq 0xf121
cvtsi2ss %r15d, %xmm3
mulss %xmm0, %xmm0
movq 0x120(%rsp), %rax
movss %xmm0, (%rax)
movss 0x18(%rsp), %xmm0
divss %xmm3, %xmm0
cvtss2sd %xmm0, %xmm0
movss 0xc(%rsp), %xmm1
divss %xmm3, %xmm1
cvtss2sd %xmm1, %xmm1
leaq 0x250(%rsp), %rcx
movl 0xfc(%rcx), %eax
imull %r15d, %eax
cvtsi2ss %eax, %xmm2
movss 0x10(%rsp), %xmm4
divss %xmm2, %xmm4
xorps %xmm2, %xmm2
cvtss2sd %xmm4, %xmm2
movl 0x28(%rsp), %eax
imull %ebx, %eax
imull 0x84(%rcx), %eax
movss 0x1c(%rsp), %xmm5
divss %xmm3, %xmm5
xorps %xmm4, %xmm4
cvtsi2ss %eax, %xmm4
xorps %xmm3, %xmm3
cvtss2sd %xmm5, %xmm3
movss 0x14(%rsp), %xmm5
divss %xmm4, %xmm5
xorps %xmm4, %xmm4
cvtss2sd %xmm5, %xmm4
leaq 0x21b6e(%rip), %rdi     # 0x57820
movl %r15d, %esi
movb $0x5, %al
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3170