// File: /workspace/github_c_makefile_star2_O2/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), %rax
leaq 0x260(%rsp), %r15
movl 0x94(%r15), %ebx
movl %ebx, 0x150(%rsp)
imull %ebx, %ebx
movq 0x268(%r15), %r14
movq 0xd8(%rax), %rsi
movslq 0x58(%r15), %rcx
movslq 0x48(%r15), %rax
movq %rax, 0x58(%rsp)
imulq %rax, %rcx
movq %rcx, 0x170(%rsp)
leaq (,%rcx,4), %rdx
movq %r14, %rdi
callq 0x32b0
cmpl $0x0, 0xf8(%r15)
movl %ebx, 0x34(%rsp)
movl %ebx, %eax
movq %rax, 0x110(%rsp)
je 0x29b87
leaq 0x260(%rsp), %rax
movslq 0x54(%rax), %rcx
movslq 0xfc(%rax), %r13
xorl %edx, %edx
movq 0x58(%rsp), %rax
testl %eax, %eax
movl $0x0, %esi
cmovgl %eax, %esi
movq %rsi, 0xa8(%rsp)
shlq $0x2, %rcx
movq %rcx, 0x160(%rsp)
movq %r13, %rbx
shlq $0x2, %rbx
pushq $0x1
popq %rbp
movq %r14, %r15
cmpq 0xa8(%rsp), %rdx
je 0x29b87
movq %rdx, 0x40(%rsp)
movq %r15, 0x60(%rsp)
movq 0x110(%rsp), %r12
subq $0x1, %r12
jb 0x29b70
movq %r15, %rdi
movl %r13d, %esi
movss 0x224a7(%rip), %xmm0    # 0x4c008
movl %ebp, %edx
movq %r15, %rcx
callq 0x1b87c
addq %rbx, %r15
jmp 0x29b4d
movq 0x40(%rsp), %rdx
incq %rdx
movq 0x60(%rsp), %r15
addq 0x160(%rsp), %r15
jmp 0x29b31
leaq 0x700(%rsp), %r13
cmpl $0x0, 0xf8(%r13)
je 0x2a5f2
leaq 0x260(%rsp), %rbx
movq 0x1d8(%rbx), %rbp
andl $0x0, (%rbp)
movslq 0x54(%rbx), %r12
movq 0x58(%rsp), %rdx
imulq %r12, %rdx
movq 0x260(%rbx), %r15
shlq $0x2, %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x31c0
movq %r15, %rdi
xorl %esi, %esi
movslq 0x100(%rbx), %r8
movslq 0xfc(%rbx), %rdx
leal (%r8,%rdx), %eax
incl %eax
movq 0x8(%r13), %rcx
movq %rcx, 0x1c0(%rsp)
movq 0xe0(%r13), %r9
movslq 0x84(%rbx), %r13
movl %edx, %r10d
movl 0x34(%rsp), %ecx
imull %ecx, %r10d
movss 0x148(%rbx), %xmm3
cvtss2sd %xmm3, %xmm4
cvtsi2ssl 0x150(%rsp), %xmm0
movss 0x150(%rbx), %xmm5
cvtss2sd %xmm5, %xmm6
leal (%rdx,%r13), %r11d
imull %ecx, %r11d
movl 0x4c(%rbx), %r15d
movl %r15d, 0xc0(%rsp)
movl 0xac(%rbx), %r15d
movl %r15d, 0x20(%rsp)
movl 0x158(%rbx), %r15d
movl %r15d, 0xbc(%rsp)
movaps 0x26b59(%rip), %xmm1    # 0x507c0
xorps %xmm4, %xmm1
movaps %xmm1, 0x210(%rsp)
movss 0x144(%rbx), %xmm1
movss %xmm1, 0xb0(%rsp)
cvtss2sd %xmm1, %xmm1
movsd %xmm1, 0x1c8(%rsp)
movl 0x108(%rbx), %r15d
movl %r15d, 0xb8(%rsp)
movss 0x140(%rbx), %xmm1
movss %xmm1, 0xb4(%rsp)
cvtss2sd %xmm1, %xmm1
movsd %xmm1, 0x100(%rsp)
testl %r13d, %r13d
movl $0x0, %r15d
cmovgl %r13d, %r15d
movq %r15, 0x128(%rsp)
testl %edx, %edx
movl $0x0, %r15d
cmovgl %edx, %r15d
movq %r15, 0xf8(%rsp)
movslq %eax, %r15
movq 0x58(%rsp), %rbx
testl %ebx, %ebx
movl $0x0, %eax
cmovgl %ebx, %eax
movq %rax, 0x1a0(%rsp)
shufps $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movaps %xmm0, 0x140(%rsp)
movslq %ecx, %rax
movq %rax, 0x188(%rsp)
imulq %r15, %rax
shlq $0x2, %rax
movq %rax, 0x180(%rsp)
movq %r11, 0x190(%rsp)
movslq %r11d, %rax
leaq (%r14,%rax,4), %rcx
movq %r13, %rax
imulq %r8, %rax
shlq $0x2, %rax
movq %rax, 0x1f0(%rsp)
movq %r8, 0x1d0(%rsp)
shlq $0x2, %r8
movq %r8, 0x208(%rsp)
xorps %xmm9, %xmm9
leaq 0x4(%r9), %rax
movq %r15, 0x1f8(%rsp)
leaq (,%r15,4), %r8
movq %r8, 0x1e8(%rsp)
movq %rax, %r15
leaq (,%r12,4), %rax
movq %rax, 0x178(%rsp)
movq %rdx, 0x88(%rsp)
leaq (,%rdx,4), %rax
movq %rax, 0x1e0(%rsp)
movq %rdi, 0xf0(%rsp)
movq %r14, 0xe8(%rsp)
movl %r10d, 0xc4(%rsp)
movl %r10d, 0x38(%rsp)
xorl %ebx, %ebx
xorps %xmm7, %xmm7
xorps %xmm0, %xmm0
movss %xmm0, 0x18(%rsp)
xorps %xmm8, %xmm8
xorps %xmm10, %xmm10
movss %xmm0, 0x14(%rsp)
movq %r13, 0x108(%rsp)
movq %rdi, 0x80(%rsp)
movq %r12, 0x198(%rsp)
movq %r9, 0x78(%rsp)
movss %xmm3, 0x10(%rsp)
movaps %xmm4, 0x130(%rsp)
movss %xmm5, 0xc(%rsp)
movsd %xmm6, 0x70(%rsp)
cmpq 0x1a0(%rsp), %rsi
je 0x2a538
movl %esi, %edx
imull %r12d, %edx
movq %rsi, 0x1b8(%rsp)
imulq 0x188(%rsp), %rsi
movq %rsi, 0x200(%rsp)
movq 0x190(%rsp), %rax
movq %rdx, 0x1d8(%rsp)
addl %edx, %eax
movl %eax, 0xc8(%rsp)
movq %rcx, 0x1b0(%rsp)
movq %rcx, 0xa0(%rsp)
movq 0xf0(%rsp), %r8
movq 0xe8(%rsp), %r12
movq %r15, 0x1a8(%rsp)
movl 0x38(%rsp), %r10d
xorl %r11d, %r11d
movq 0xf8(%rsp), %rsi
cmpq 0x110(%rsp), %r11
je 0x2a4e8
movq 0x200(%rsp), %rax
addq %r11, %rax
imulq 0x1f8(%rsp), %rax
movq %rax, 0x120(%rsp)
leaq (%r9,%rax,4), %rax
movss (%rax), %xmm0
movq %r11, %rcx
imulq %r13, %rcx
movq %rcx, 0x118(%rsp)
movl %r10d, %ecx
movq 0x128(%rsp), %rdx
subq $0x1, %rdx
jb 0x29f27
movslq %ecx, %rcx
xorps %xmm1, %xmm1
subss (%r14,%rcx,4), %xmm1
mulss %xmm3, %xmm1
movss %xmm1, (%rdi,%rcx,4)
cvtss2sd (%r14,%rcx,4), %xmm1
mulsd %xmm1, %xmm1
cvtss2sd (%rbp), %xmm2
mulsd %xmm4, %xmm1
addsd %xmm2, %xmm1
cvtsd2ss %xmm1, %xmm1
movss %xmm1, (%rbp)
addss (%r14,%rcx,4), %xmm7
incl %ecx
jmp 0x29ee2
cvttss2si %xmm0, %ecx
testl %ecx, %ecx
je 0x2a4af
incq 0x120(%rsp)
xorl %ecx, %ecx
cmpq %rcx, %rsi
je 0x29fb2
movss (%r15,%rcx,4), %xmm0
subss (%r12,%rcx,4), %xmm0
mulss %xmm5, %xmm0
movss %xmm0, (%r8,%rcx,4)
movss (%r15,%rcx,4), %xmm0
subss (%r12,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
mulsd %xmm0, %xmm0
cvtss2sd (%rbp), %xmm1
mulsd %xmm6, %xmm0
addsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm0
movss %xmm0, (%rbp)
movss (%r12,%rcx,4), %xmm0
movss (%r15,%rcx,4), %xmm1
cmpneqss %xmm9, %xmm1
movaps %xmm1, %xmm2
andnps %xmm10, %xmm2
addss %xmm0, %xmm10
andps %xmm1, %xmm10
orps %xmm2, %xmm10
addss %xmm0, %xmm8
incq %rcx
jmp 0x29f3d
movq %r11, 0x90(%rsp)
movl %r10d, 0x1c(%rsp)
movq %r8, 0x98(%rsp)
movaps %xmm10, 0xd0(%rsp)
movss %xmm8, 0x4(%rsp)
movss %xmm7, 0x8(%rsp)
movl %ebx, 0xcc(%rsp)
movq 0x88(%rsp), %rcx
leaq 0x4(%rax,%rcx,4), %rdi
pushq $0x1
popq %rsi
callq 0x2b3f1
movaps %xmm1, 0x40(%rsp)
divps 0x140(%rsp), %xmm0
movaps %xmm0, 0x60(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x24(%rsp)
movq 0xa0(%rsp), %rbx
xorl %r13d, %r13d
pushq $-0x1
popq %rax
movq %rax, 0x28(%rsp)
movss 0x2678d(%rip), %xmm0    # 0x507bc
movss %xmm0, 0x3c(%rsp)
cmpq %r13, 0x128(%rsp)
je 0x2a103
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0x2b3f1
cmpl $0x0, 0x20(%rsp)
je 0x2a058
mulps %xmm1, %xmm1
divps 0x140(%rsp), %xmm0
movaps %xmm0, 0x160(%rsp)
movaps %xmm1, 0x150(%rsp)
movaps 0x60(%rsp), %xmm2
movaps 0x40(%rsp), %xmm3
callq 0x2b1cb
movss %xmm0, 0xa8(%rsp)
movaps 0x160(%rsp), %xmm0
movaps 0x150(%rsp), %xmm1
movaps 0x60(%rsp), %xmm2
movaps 0x40(%rsp), %xmm3
callq 0x2b67e
xorps %xmm1, %xmm1
movss 0x24(%rsp), %xmm2
ucomiss %xmm1, %xmm2
movss 0xa8(%rsp), %xmm2
ja 0x2a0de
ucomiss %xmm1, %xmm2
ja 0x2a0de
movss 0x3c(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2a0f3
movl %r13d, %eax
movq %rax, 0x28(%rsp)
movss %xmm0, 0x3c(%rsp)
jmp 0x2a0f3
ucomiss 0x24(%rsp), %xmm2
jbe 0x2a0f3
movl %r13d, %eax
movq %rax, 0x28(%rsp)
movss %xmm2, 0x24(%rsp)
incq %r13
addq 0x208(%rsp), %rbx
jmp 0x2a035
cmpl $0x0, 0xc0(%rsp)
je 0x2a137
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 0x254a5(%rip), %xmm1    # 0x4f5d0
ucomisd %xmm0, %xmm1
seta %al
movq %rax, 0x28(%rsp)
cmpl $0x0, 0xbc(%rsp)
movq 0x108(%rsp), %r13
je 0x2a168
movq 0x1c0(%rsp), %rax
cmpq $0xf9ff, (%rax)         # imm = 0xF9FF
ja 0x2a168
callq 0x34e0
cltd
idivl %r13d
movq %rdx, 0x28(%rsp)
movq 0x118(%rsp), %rax
movq 0x28(%rsp), %rcx
addl %ecx, %eax
imull 0x1d0(%rsp), %eax
addl 0xc8(%rsp), %eax
movslq %eax, %rbx
leaq (%r14,%rbx,4), %rdi
pushq $0x1
popq %rsi
callq 0x2b3f1
cmpl $0x0, 0x20(%rsp)
je 0x2a19f
mulps %xmm1, %xmm1
divps 0x140(%rsp), %xmm0
movaps 0x60(%rsp), %xmm2
movaps 0x40(%rsp), %xmm3
callq 0x2b1cb
movaps %xmm0, %xmm11
movq 0x28(%rsp), %rax
addl 0x1d8(%rsp), %eax
addl 0xc4(%rsp), %eax
addl 0x118(%rsp), %eax
cltq
cvtss2sd (%r14,%rax,4), %xmm0
mulsd %xmm0, %xmm0
cvtss2sd (%rbp), %xmm1
mulsd 0x210(%rsp), %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rbp)
movss 0x21e05(%rip), %xmm1    # 0x4c008
subss (%r14,%rax,4), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm1
cvtss2sd %xmm0, %xmm0
movsd 0x1c8(%rsp), %xmm2
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm0
movss %xmm0, (%rbp)
movss (%r14,%rax,4), %xmm12
cvtss2sd %xmm12, %xmm0
movsd 0x21ee6(%rip), %xmm1    # 0x4c128
subsd %xmm0, %xmm1
mulsd %xmm2, %xmm1
cvtsd2ss %xmm1, %xmm0
movq 0x80(%rsp), %rdi
movss %xmm0, (%rdi,%rax,4)
cmpl $0x0, 0xb8(%rsp)
je 0x2a281
movss (%r14,%rax,4), %xmm0
movaps %xmm11, %xmm1
subss %xmm0, %xmm1
mulss 0xb0(%rsp), %xmm1
movss %xmm1, (%rdi,%rax,4)
movq 0x120(%rsp), %rcx
addq 0x88(%rsp), %rcx
movq 0x78(%rsp), %r9
movss (%r9,%rcx,4), %xmm0
subss (%r14,%rbx,4), %xmm0
movss 0xb4(%rsp), %xmm1
mulss %xmm1, %xmm0
movss %xmm0, (%rdi,%rbx,4)
movss 0x4(%r9,%rcx,4), %xmm0
subss 0x4(%r14,%rbx,4), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0x4(%rdi,%rbx,4)
movss 0x8(%r9,%rcx,4), %xmm0
subss 0x8(%r14,%rbx,4), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0x8(%rdi,%rbx,4)
movss 0xc(%r9,%rcx,4), %xmm0
subss 0xc(%r14,%rbx,4), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0xc(%rdi,%rbx,4)
cmpl $0x0, 0x20(%rsp)
movss 0x10(%rsp), %xmm3
movaps 0x130(%rsp), %xmm4
movss 0xc(%rsp), %xmm5
movsd 0x70(%rsp), %xmm6
movss 0x8(%rsp), %xmm7
movss 0x4(%rsp), %xmm8
xorps %xmm9, %xmm9
movaps 0xd0(%rsp), %xmm10
movq 0x98(%rsp), %r8
movl 0x1c(%rsp), %r10d
movq 0x90(%rsp), %r11
je 0x2a455
cvtss2sd 0x8(%r9,%rcx,4), %xmm0
ucomisd 0x26471(%rip), %xmm0    # 0x507d0
movss %xmm11, 0x40(%rsp)
movss %xmm12, 0x60(%rsp)
jb 0x2a375
sqrtsd %xmm0, %xmm0
jmp 0x2a395
movq %rcx, %r13
callq 0x3460
movq %r13, %rcx
movq 0x108(%rsp), %r13
movq 0x78(%rsp), %r9
movq 0x80(%rsp), %rdi
leaq 0x2(%rbx), %rax
cvtss2sd (%r14,%rax,4), %xmm1
subsd %xmm1, %xmm0
mulsd 0x100(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rdi,%rax,4)
cvtss2sd 0xc(%r9,%rcx,4), %xmm0
ucomisd 0x2640c(%rip), %xmm0    # 0x507d0
jb 0x2a3cc
sqrtsd %xmm0, %xmm0
jmp 0x2a3de
callq 0x3460
movq 0x78(%rsp), %r9
movq 0x80(%rsp), %rdi
movss 0x10(%rsp), %xmm3
movaps 0x130(%rsp), %xmm4
movss 0xc(%rsp), %xmm5
movsd 0x70(%rsp), %xmm6
movss 0x8(%rsp), %xmm7
movss 0x4(%rsp), %xmm8
xorps %xmm9, %xmm9
movaps 0xd0(%rsp), %xmm10
movq 0x98(%rsp), %r8
movl 0x1c(%rsp), %r10d
movq 0x90(%rsp), %r11
movss 0x40(%rsp), %xmm11
movss 0x60(%rsp), %xmm12
addq $0x3, %rbx
cvtss2sd (%r14,%rbx,4), %xmm1
subsd %xmm1, %xmm0
mulsd 0x100(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rdi,%rbx,4)
movss 0x21bab(%rip), %xmm0    # 0x4c008
subss %xmm11, %xmm0
cvtss2sd %xmm0, %xmm0
cvtss2sd (%rbp), %xmm1
mulsd %xmm0, %xmm0
addsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm0
movss 0x18(%rsp), %xmm1
addss %xmm12, %xmm1
movss %xmm1, 0x18(%rsp)
movss %xmm0, (%rbp)
movss 0x14(%rsp), %xmm0
addss %xmm11, %xmm0
movss %xmm0, 0x14(%rsp)
movl 0xcc(%rsp), %ebx
incl %ebx
movq 0xf8(%rsp), %rsi
incq %r11
addl %r13d, %r10d
addq 0x1e8(%rsp), %r15
movq 0x1e0(%rsp), %rax
addq %rax, %r12
addq %rax, %r8
movq 0xa0(%rsp), %rax
addq 0x1f0(%rsp), %rax
movq %rax, 0xa0(%rsp)
jmp 0x29e96
movq 0x1b8(%rsp), %rsi
incq %rsi
movq 0x198(%rsp), %r12
addl %r12d, 0x38(%rsp)
movq 0x1a8(%rsp), %r15
addq 0x180(%rsp), %r15
movq 0x178(%rsp), %rax
addq %rax, 0xe8(%rsp)
addq %rax, 0xf0(%rsp)
movq 0x1b0(%rsp), %rcx
addq %rax, %rcx
jmp 0x29e18
movq 0x170(%rsp), %rsi
movss %xmm7, 0x8(%rsp)
movss %xmm8, 0x4(%rsp)
movaps %xmm10, 0xd0(%rsp)
callq 0x4b4c
mulss %xmm0, %xmm0
movss %xmm0, (%rbp)
cvtsi2ss %ebx, %xmm3
movss 0x14(%rsp), %xmm0
divss %xmm3, %xmm0
cvtss2sd %xmm0, %xmm0
movaps 0xd0(%rsp), %xmm1
divss %xmm3, %xmm1
cvtss2sd %xmm1, %xmm1
movq 0x88(%rsp), %rax
imull %ebx, %eax
cvtsi2ss %eax, %xmm2
movss 0x4(%rsp), %xmm4
divss %xmm2, %xmm4
cvtss2sd %xmm4, %xmm2
movss 0x18(%rsp), %xmm5
divss %xmm3, %xmm5
movq 0x58(%rsp), %rax
imull 0x34(%rsp), %eax
imull %r13d, %eax
cvtsi2ss %eax, %xmm4
cvtss2sd %xmm5, %xmm3
movss 0x8(%rsp), %xmm5
divss %xmm4, %xmm5
cvtss2sd %xmm5, %xmm4
leaq 0x262a0(%rip), %rdi     # 0x50878
movl %ebx, %esi
movb $0x5, %al
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3160
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq