// File: /workspace/github_c_makefile_star2_O3/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 $0x228, %rsp            # imm = 0x228
leaq 0x700(%rsp), %rdx
leaq 0x260(%rsp), %r15
movl 0x48(%r15), %eax
movl 0x94(%r15), %ecx
movl %ecx, 0x20(%rsp)
imull %ecx, %ecx
movl %ecx, 0x1c(%rsp)
movq 0x268(%r15), %r14
movq 0xd8(%rdx), %rsi
movslq 0x58(%r15), %rdx
movl %eax, %ecx
movq %rcx, 0x58(%rsp)
movslq %eax, %rbx
imulq %rbx, %rdx
movq %rdx, 0x138(%rsp)
leaq (,%rdx,4), %rdx
movq %r14, %rdi
callq 0x32b0
cmpl $0x0, 0xf8(%r15)
setne %al
testl %ebx, %ebx
setg %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x373b3
leaq 0x260(%rsp), %rax
movslq 0x54(%rax), %rcx
movslq 0xfc(%rax), %r13
movl 0x1c(%rsp), %eax
cmpl $0x1, %eax
adcl $0x0, %eax
movq %rax, 0xa8(%rsp)
shlq $0x2, %rcx
movq %rcx, 0x60(%rsp)
movq %r13, %r15
shlq $0x2, %r15
xorl %eax, %eax
movq %r14, %rbx
movq %rax, 0x40(%rsp)
cmpl $0x0, 0x20(%rsp)
je 0x3739f
movq 0xa8(%rsp), %rbp
movq %rbx, %r12
movq %r12, %rdi
movl %r13d, %esi
movss 0x1dc7e(%rip), %xmm0    # 0x55008
movl $0x1, %edx
movq %r12, %rcx
callq 0x2a2b3
addq %r15, %r12
decq %rbp
jne 0x3737c
movq 0x40(%rsp), %rax
incq %rax
addq 0x60(%rsp), %rbx
cmpq 0x58(%rsp), %rax
jne 0x37365
leaq 0x700(%rsp), %rax
cmpl $0x0, 0xf8(%rax)
je 0x37da1
leaq 0x260(%rsp), %r12
movq 0x1d8(%r12), %rbx
movl $0x0, (%rbx)
movslq 0x54(%r12), %rbp
movq 0x58(%rsp), %r15
movslq %r15d, %rdx
imulq %rbp, %rdx
movq 0x260(%r12), %r13
shlq $0x2, %rdx
movq %r13, %rdi
xorl %esi, %esi
callq 0x31c0
testl %r15d, %r15d
jle 0x37db3
movslq 0x100(%r12), %rsi
movl 0xfc(%r12), %edx
leal (%rsi,%rdx), %eax
incl %eax
leaq 0x700(%rsp), %rdi
movq 0x8(%rdi), %rcx
movq %rcx, 0x188(%rsp)
movq 0xe0(%rdi), %r8
movq %r12, %r11
movslq 0x84(%r12), %r12
movl %edx, %edi
movl 0x1c(%rsp), %ecx
imull %ecx, %edi
movss 0x148(%r11), %xmm2
cvtss2sd %xmm2, %xmm3
movss 0x150(%r11), %xmm0
cvtsi2ssl 0x20(%rsp), %xmm1
movss %xmm0, 0xb4(%rsp)
cvtss2sd %xmm0, %xmm4
leal (%rdx,%r12), %r9d
imull %ecx, %r9d
movl 0x4c(%r11), %r10d
movl %r10d, 0xc4(%rsp)
movl 0xac(%r11), %r10d
movl %r10d, 0x30(%rsp)
movl 0x158(%r11), %r10d
movl %r10d, 0xc0(%rsp)
movaps 0x223bf(%rip), %xmm0    # 0x59870
xorps %xmm3, %xmm0
movaps %xmm0, 0x1f0(%rsp)
movss 0x144(%r11), %xmm0
movss %xmm0, 0xb0(%rsp)
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x190(%rsp)
movl 0x108(%r11), %r10d
movl %r10d, 0xbc(%rsp)
movss 0x140(%r11), %xmm0
movss %xmm0, 0xb8(%rsp)
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0xe8(%rsp)
movslq %eax, %r10
cmpl $0x1, %ecx
movl %ecx, %eax
adcl $0x0, %eax
movq %rax, 0x1c8(%rsp)
movslq %ecx, %rax
shufps $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
movaps %xmm1, 0x120(%rsp)
movq %rax, 0x140(%rsp)
imulq %r10, %rax
shlq $0x2, %rax
movq %rax, 0x158(%rsp)
movq %r9, 0x148(%rsp)
movslq %r9d, %rax
leaq (%r14,%rax,4), %rcx
movq %r12, %rax
imulq %rsi, %rax
shlq $0x2, %rax
movq %rax, 0x1c0(%rsp)
movq %rsi, 0x198(%rsp)
shlq $0x2, %rsi
movq %rsi, 0x1e8(%rsp)
xorps %xmm7, %xmm7
movslq %edx, %rax
movl %r12d, %esi
movq %rsi, 0x108(%rsp)
leaq 0x4(%r8), %rsi
movq %rsi, 0x78(%rsp)
movq %r10, 0x1d0(%rsp)
leaq (,%r10,4), %rsi
movq %rsi, 0x1b8(%rsp)
leaq (,%rbp,4), %rsi
movq %rsi, 0x150(%rsp)
movq %rax, 0xf0(%rsp)
leaq (,%rax,4), %rax
movq %rax, 0x1b0(%rsp)
xorl %esi, %esi
movq %r13, %r9
movq %r14, %r15
movl %edi, 0xc8(%rsp)
movl %edi, 0x38(%rsp)
movl $0x0, 0x24(%rsp)
xorps %xmm6, %xmm6
xorps %xmm0, %xmm0
movss %xmm0, 0x4(%rsp)
xorps %xmm1, %xmm1
xorps %xmm5, %xmm5
movq %r13, %rdi
movq %rdx, %r13
movq %rdi, 0x90(%rsp)
movq %rbp, 0x160(%rsp)
movaps %xmm3, 0x110(%rsp)
movq %r12, 0xf8(%rsp)
movq %rdx, 0x1a0(%rsp)
movq %r8, 0x88(%rsp)
movss %xmm2, 0x28(%rsp)
movsd %xmm4, 0x80(%rsp)
cmpl $0x0, 0x20(%rsp)
movq %rcx, 0x180(%rsp)
movq %rsi, 0x178(%rsp)
movq %r9, 0x170(%rsp)
movq %r15, 0x168(%rsp)
je 0x37d29
movq %rsi, %rdx
imulq %rbp, %rdx
imulq 0x140(%rsp), %rsi
movq %rsi, 0x1d8(%rsp)
movq 0x148(%rsp), %rax
movq %rdx, 0x1a8(%rsp)
addl %edx, %eax
movl %eax, 0xcc(%rsp)
movq %rcx, 0xa0(%rsp)
movq 0x78(%rsp), %rbp
movl 0x38(%rsp), %esi
xorl %ecx, %ecx
movss %xmm0, 0x8(%rsp)
movss %xmm1, 0xc(%rsp)
movq 0x1d8(%rsp), %rax
movq %rcx, 0x100(%rsp)
leaq (%rcx,%rax), %r10
imulq 0x1d0(%rsp), %r10
cvttss2si (%r8,%r10,4), %eax
testl %r12d, %r12d
jle 0x37738
movq 0x108(%rsp), %rcx
movl %esi, %edx
movslq %edx, %rdx
xorps %xmm0, %xmm0
subss (%r14,%rdx,4), %xmm0
mulss %xmm2, %xmm0
movss %xmm0, (%rdi,%rdx,4)
xorps %xmm0, %xmm0
cvtss2sd (%r14,%rdx,4), %xmm0
mulsd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtss2sd (%rbx), %xmm1
mulsd %xmm3, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rbx)
addss (%r14,%rdx,4), %xmm5
incl %edx
decq %rcx
jne 0x376f2
testl %eax, %eax
je 0x377d6
testl %r13d, %r13d
movss %xmm5, (%rsp)
movl %esi, 0x2c(%rsp)
jle 0x377e7
xorl %eax, %eax
movss 0xb4(%rsp), %xmm3
movss 0x4(%rsp), %xmm5
movss (%rbp,%rax,4), %xmm0
subss (%r15,%rax,4), %xmm0
mulss %xmm3, %xmm0
movss %xmm0, (%r9,%rax,4)
movss (%rbp,%rax,4), %xmm0
subss (%r15,%rax,4), %xmm0
cvtss2sd %xmm0, %xmm0
mulsd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtss2sd (%rbx), %xmm1
mulsd %xmm4, %xmm0
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, (%rbx)
movss (%r15,%rax,4), %xmm0
movss (%rbp,%rax,4), %xmm1
cmpneqss %xmm7, %xmm1
movaps %xmm1, %xmm2
andnps %xmm6, %xmm2
addss %xmm0, %xmm6
andps %xmm1, %xmm6
orps %xmm2, %xmm6
addss %xmm0, %xmm5
incq %rax
cmpq %rax, %r13
jne 0x37763
jmp 0x377ed
movss 0xc(%rsp), %xmm1
movss 0x8(%rsp), %xmm0
jmp 0x37cdf
movss 0x4(%rsp), %xmm5
movq %r9, 0x98(%rsp)
movaps %xmm6, 0xd0(%rsp)
movss %xmm5, 0x4(%rsp)
movq %r10, 0x1e0(%rsp)
leaq (%r8,%r10,4), %rax
movq 0xf0(%rsp), %rcx
leaq (%rax,%rcx,4), %rdi
addq $0x4, %rdi
movl $0x1, %esi
callq 0x38d7b
movaps %xmm1, 0x40(%rsp)
divps 0x120(%rsp), %xmm0
movaps %xmm0, 0x60(%rsp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %r12d, %r12d
jle 0x3793d
movq %rax, 0x10(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x34(%rsp)
movq 0xa0(%rsp), %r13
xorl %r12d, %r12d
movss 0x22002(%rip), %xmm0    # 0x5986c
movss %xmm0, 0x3c(%rsp)
movq %r13, %rdi
movl $0x1, %esi
callq 0x38d7b
cmpl $0x0, 0x30(%rsp)
je 0x37887
mulps %xmm1, %xmm1
divps 0x120(%rsp), %xmm0
movaps %xmm0, 0x210(%rsp)
movaps %xmm1, 0x200(%rsp)
movaps 0x60(%rsp), %xmm2
movaps 0x40(%rsp), %xmm3
callq 0x389b3
movss %xmm0, 0xa8(%rsp)
movaps 0x210(%rsp), %xmm0
movaps 0x200(%rsp), %xmm1
movaps 0x60(%rsp), %xmm2
movaps 0x40(%rsp), %xmm3
callq 0x39013
xorps %xmm1, %xmm1
movss 0x34(%rsp), %xmm2
ucomiss %xmm1, %xmm2
movss 0xa8(%rsp), %xmm2
ja 0x3790d
ucomiss %xmm1, %xmm2
ja 0x3790d
movss 0x3c(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x37922
movl %r12d, %eax
movq %rax, 0x10(%rsp)
movss %xmm0, 0x3c(%rsp)
jmp 0x37922
ucomiss 0x34(%rsp), %xmm2
jbe 0x37922
movl %r12d, %eax
movq %rax, 0x10(%rsp)
movss %xmm2, 0x34(%rsp)
incq %r12
addq 0x1e8(%rsp), %r13
cmpq %r12, 0x108(%rsp)
jne 0x37870
jmp 0x37942
movq %rax, 0x10(%rsp)
cmpl $0x0, 0xc4(%rsp)
je 0x37976
movaps 0x40(%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 0x20d16(%rip), %xmm1    # 0x58680
ucomisd %xmm0, %xmm1
seta %al
movq %rax, 0x10(%rsp)
cmpl $0x0, 0xc0(%rsp)
movq 0xf8(%rsp), %r12
movq 0x100(%rsp), %r13
je 0x379af
movq 0x188(%rsp), %rax
cmpq $0xf9ff, (%rax)         # imm = 0xF9FF
ja 0x379af
callq 0x34e0
cltd
idivl %r12d
movq %rdx, 0x10(%rsp)
imull %r13d, %r12d
movq 0x10(%rsp), %rax
addl %r12d, %eax
imull 0x198(%rsp), %eax
addl 0xcc(%rsp), %eax
movslq %eax, %r13
leaq (%r14,%r13,4), %rdi
movl $0x1, %esi
callq 0x38d7b
cmpl $0x0, 0x30(%rsp)
je 0x379e5
mulps %xmm1, %xmm1
divps 0x120(%rsp), %xmm0
movaps 0x60(%rsp), %xmm2
movaps 0x40(%rsp), %xmm3
callq 0x389b3
movaps %xmm0, %xmm8
movq 0x10(%rsp), %rax
addl 0x1a8(%rsp), %eax
addl 0xc8(%rsp), %eax
addl %r12d, %eax
cltq
xorps %xmm0, %xmm0
cvtss2sd (%r14,%rax,4), %xmm0
mulsd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtss2sd (%rbx), %xmm1
mulsd 0x1f0(%rsp), %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rbx)
movss 0x1d5bf(%rip), %xmm1    # 0x55008
subss (%r14,%rax,4), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm1
cvtss2sd %xmm0, %xmm0
movsd 0x190(%rsp), %xmm2
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, (%rbx)
movss (%r14,%rax,4), %xmm9
xorps %xmm0, %xmm0
cvtss2sd %xmm9, %xmm0
movsd 0x1d6c3(%rip), %xmm1    # 0x55150
subsd %xmm0, %xmm1
mulsd %xmm2, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movq 0x90(%rsp), %rdi
movss %xmm0, (%rdi,%rax,4)
cmpl $0x0, 0xbc(%rsp)
je 0x37acf
movss (%r14,%rax,4), %xmm0
movaps %xmm8, %xmm1
subss %xmm0, %xmm1
mulss 0xb0(%rsp), %xmm1
movss %xmm1, (%rdi,%rax,4)
movq 0xf0(%rsp), %rax
movq 0x1e0(%rsp), %rcx
leaq (%rcx,%rax), %r12
incq %r12
movq 0x88(%rsp), %r8
movss (%r8,%r12,4), %xmm0
subss (%r14,%r13,4), %xmm0
movss 0xb8(%rsp), %xmm1
mulss %xmm1, %xmm0
movss %xmm0, (%rdi,%r13,4)
movss 0x4(%r8,%r12,4), %xmm0
subss 0x4(%r14,%r13,4), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0x4(%rdi,%r13,4)
movss 0x8(%r8,%r12,4), %xmm0
subss 0x8(%r14,%r13,4), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0x8(%rdi,%r13,4)
movss 0xc(%r8,%r12,4), %xmm0
subss 0xc(%r14,%r13,4), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0xc(%rdi,%r13,4)
cmpl $0x0, 0x30(%rsp)
movss 0x28(%rsp), %xmm2
movaps 0x110(%rsp), %xmm3
movsd 0x80(%rsp), %xmm4
movss (%rsp), %xmm5
movaps 0xd0(%rsp), %xmm6
xorps %xmm7, %xmm7
movq 0x98(%rsp), %r9
movl 0x2c(%rsp), %esi
je 0x37c8a
xorps %xmm0, %xmm0
cvtss2sd 0x8(%r8,%r12,4), %xmm0
ucomisd 0x21cd8(%rip), %xmm0    # 0x59880
movss %xmm8, 0x40(%rsp)
movss %xmm9, 0x60(%rsp)
jb 0x37bbe
sqrtsd %xmm0, %xmm0
jmp 0x37bd3
callq 0x3460
movq 0x88(%rsp), %r8
movq 0x90(%rsp), %rdi
leaq 0x2(%r13), %rax
xorps %xmm1, %xmm1
cvtss2sd (%r14,%rax,4), %xmm1
subsd %xmm1, %xmm0
mulsd 0xe8(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rdi,%rax,4)
xorps %xmm0, %xmm0
cvtss2sd 0xc(%r8,%r12,4), %xmm0
ucomisd 0x21c78(%rip), %xmm0    # 0x59880
jb 0x37c10
sqrtsd %xmm0, %xmm0
jmp 0x37c25
callq 0x3460
movq 0x88(%rsp), %r8
movq 0x90(%rsp), %rdi
movss 0x28(%rsp), %xmm2
movaps 0x110(%rsp), %xmm3
movsd 0x80(%rsp), %xmm4
movss (%rsp), %xmm5
movaps 0xd0(%rsp), %xmm6
xorps %xmm7, %xmm7
movq 0x98(%rsp), %r9
movl 0x2c(%rsp), %esi
movss 0x40(%rsp), %xmm8
movss 0x60(%rsp), %xmm9
addq $0x3, %r13
xorps %xmm1, %xmm1
cvtss2sd (%r14,%r13,4), %xmm1
subsd %xmm1, %xmm0
mulsd 0xe8(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rdi,%r13,4)
movss 0x1d376(%rip), %xmm0    # 0x55008
subss %xmm8, %xmm0
cvtss2sd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtss2sd (%rbx), %xmm1
mulsd %xmm0, %xmm0
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss 0xc(%rsp), %xmm1
addss %xmm9, %xmm1
movss %xmm0, (%rbx)
movss 0x8(%rsp), %xmm0
addss %xmm8, %xmm0
incl 0x24(%rsp)
movq 0xf8(%rsp), %r12
movq 0x1a0(%rsp), %r13
movq 0x100(%rsp), %rcx
incq %rcx
addl %r12d, %esi
addq 0x1b8(%rsp), %rbp
movq 0x1b0(%rsp), %rax
addq %rax, %r15
addq %rax, %r9
movq 0xa0(%rsp), %rax
addq 0x1c0(%rsp), %rax
movq %rax, 0xa0(%rsp)
cmpq 0x1c8(%rsp), %rcx
jne 0x376b4
movq 0x178(%rsp), %rsi
incq %rsi
movq 0x160(%rsp), %rbp
addl %ebp, 0x38(%rsp)
movq 0x78(%rsp), %rax
addq 0x158(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x150(%rsp), %rax
movq 0x168(%rsp), %r15
addq %rax, %r15
movq 0x170(%rsp), %r9
addq %rax, %r9
movq 0x180(%rsp), %rcx
addq %rax, %rcx
cmpq 0x58(%rsp), %rsi
jne 0x37645
movss %xmm5, (%rsp)
movss %xmm1, 0xc(%rsp)
movaps %xmm6, 0xd0(%rsp)
movss %xmm0, 0x8(%rsp)
jmp 0x37df4
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x0, 0x24(%rsp)
movq %r12, %rax
movl 0x84(%r12), %r12d
movl 0xfc(%rax), %eax
xorps %xmm0, %xmm0
movss %xmm0, (%rsp)
movss %xmm0, 0xc(%rsp)
movss %xmm0, 0x4(%rsp)
movaps %xmm0, 0xd0(%rsp)
movss %xmm0, 0x8(%rsp)
movq %r13, %rdi
movq %rax, %r13
movq 0x138(%rsp), %rsi
callq 0xf92d
mulss %xmm0, %xmm0
movss %xmm0, (%rbx)
movl 0x24(%rsp), %esi
xorps %xmm3, %xmm3
cvtsi2ss %esi, %xmm3
movss 0x8(%rsp), %xmm0
divss %xmm3, %xmm0
cvtss2sd %xmm0, %xmm0
movaps 0xd0(%rsp), %xmm1
divss %xmm3, %xmm1
cvtss2sd %xmm1, %xmm1
imull %esi, %r13d
cvtsi2ss %r13d, %xmm2
movss 0x4(%rsp), %xmm4
divss %xmm2, %xmm4
xorps %xmm2, %xmm2
cvtss2sd %xmm4, %xmm2
movss 0xc(%rsp), %xmm5
divss %xmm3, %xmm5
movl 0x1c(%rsp), %eax
imull 0x58(%rsp), %eax
imull %r12d, %eax
xorps %xmm4, %xmm4
cvtsi2ss %eax, %xmm4
xorps %xmm3, %xmm3
cvtss2sd %xmm5, %xmm3
movss (%rsp), %xmm5
divss %xmm4, %xmm5
xorps %xmm4, %xmm4
cvtss2sd %xmm5, %xmm4
leaq 0x21aa0(%rip), %rdi     # 0x59928
movb $0x5, %al
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3160