// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/detection_layer.c
// Function: get_detection_detections
void get_detection_detections(layer l, int w, int h, float thresh, detection *dets)
{
    int i,j,n;
    float *predictions = l.output;
    //int per_cell = 5*num+classes;
    for (i = 0; i < l.side*l.side; ++i){
        int row = i / l.side;
        int col = i % l.side;
        for(n = 0; n < l.n; ++n){
            int index = i*l.n + n;
            int p_index = l.side*l.side*l.classes + i*l.n + n;
            float scale = predictions[p_index];
            int box_index = l.side*l.side*(l.classes + l.n) + (i*l.n + n)*4;
            box b;
            b.x = (predictions[box_index + 0] + col) / l.side * w;
            b.y = (predictions[box_index + 1] + row) / l.side * h;
            b.w = pow(predictions[box_index + 2], (l.sqrt?2:1)) * w;
            b.h = pow(predictions[box_index + 3], (l.sqrt?2:1)) * h;
            dets[index].bbox = b;
            dets[index].objectness = scale;
            for(j = 0; j < l.classes; ++j){
                int class_index = i*l.classes;
                float prob = scale*predictions[class_index+j];
                dets[index].prob[j] = (prob > thresh) ? prob : 0;
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq 0x268(%rax), %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x68(%rbp), %rdx
movl -0x1c(%rbp), %eax
movl 0x94(%rdx), %ecx
imull 0x94(%rdx), %ecx
cmpl %ecx, %eax
jge 0x43f38
movq -0x68(%rbp), %rcx
movl -0x1c(%rbp), %eax
cltd
idivl 0x94(%rcx)
movl %eax, -0x34(%rbp)
movl -0x1c(%rbp), %eax
cltd
idivl 0x94(%rcx)
movl %edx, -0x38(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x68(%rbp), %rcx
movl -0x24(%rbp), %eax
cmpl 0x84(%rcx), %eax
jge 0x43f28
movq -0x68(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull 0x84(%rax), %ecx
addl -0x24(%rbp), %ecx
movl %ecx, -0x3c(%rbp)
movl 0x94(%rax), %ecx
imull 0x94(%rax), %ecx
imull 0xfc(%rax), %ecx
movl -0x1c(%rbp), %edx
imull 0x84(%rax), %edx
addl %edx, %ecx
addl -0x24(%rbp), %ecx
movl %ecx, -0x40(%rbp)
movq -0x30(%rbp), %rcx
movslq -0x40(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
movss %xmm0, -0x44(%rbp)
movl 0x94(%rax), %ecx
imull 0x94(%rax), %ecx
movl 0xfc(%rax), %edx
addl 0x84(%rax), %edx
imull %edx, %ecx
movl -0x1c(%rbp), %edx
imull 0x84(%rax), %edx
addl -0x24(%rbp), %edx
shll $0x2, %edx
addl %edx, %ecx
movl %ecx, -0x48(%rbp)
movq -0x30(%rbp), %rcx
movl -0x48(%rbp), %edx
addl $0x0, %edx
movslq %edx, %rdx
movss (%rcx,%rdx,4), %xmm0
cvtsi2ssl -0x38(%rbp), %xmm1
addss %xmm1, %xmm0
cvtsi2ssl 0x94(%rax), %xmm1
divss %xmm1, %xmm0
cvtsi2ssl -0x4(%rbp), %xmm1
mulss %xmm1, %xmm0
movss %xmm0, -0x58(%rbp)
movq -0x30(%rbp), %rcx
movl -0x48(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movss (%rcx,%rdx,4), %xmm0
cvtsi2ssl -0x34(%rbp), %xmm1
addss %xmm1, %xmm0
cvtsi2ssl 0x94(%rax), %xmm1
divss %xmm1, %xmm0
cvtsi2ssl -0x8(%rbp), %xmm1
mulss %xmm1, %xmm0
movss %xmm0, -0x54(%rbp)
movq -0x30(%rbp), %rcx
movl -0x48(%rbp), %edx
addl $0x2, %edx
movslq %edx, %rdx
movss (%rcx,%rdx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movl 0xac(%rax), %edx
movl $0x1, %eax
movl $0x2, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
cvtsi2sd %eax, %xmm1
callq 0x30e0
movq -0x68(%rbp), %rax
cvtsi2sdl -0x4(%rbp), %xmm1
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x50(%rbp)
movq -0x30(%rbp), %rcx
movl -0x48(%rbp), %edx
addl $0x3, %edx
movslq %edx, %rdx
movss (%rcx,%rdx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movl 0xac(%rax), %edx
movl $0x1, %eax
movl $0x2, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
cvtsi2sd %eax, %xmm1
callq 0x30e0
cvtsi2sdl -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x4c(%rbp)
movq -0x18(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq -0x58(%rbp), %rcx
movq %rcx, (%rax)
movq -0x50(%rbp), %rcx
movq %rcx, 0x8(%rax)
movss -0x44(%rbp), %xmm0
movq -0x18(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movss %xmm0, 0x28(%rax)
movl $0x0, -0x20(%rbp)
movq -0x68(%rbp), %rcx
movl -0x20(%rbp), %eax
cmpl 0xfc(%rcx), %eax
jge 0x43f18
movq -0x68(%rbp), %rcx
movl -0x1c(%rbp), %eax
imull 0xfc(%rcx), %eax
movl %eax, -0x5c(%rbp)
movss -0x44(%rbp), %xmm0
movq -0x30(%rbp), %rax
movl -0x5c(%rbp), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
mulss (%rax,%rcx,4), %xmm0
movss %xmm0, -0x60(%rbp)
movss -0x60(%rbp), %xmm0
ucomiss -0xc(%rbp), %xmm0
jbe 0x43edf
movss -0x60(%rbp), %xmm0
movss %xmm0, -0x6c(%rbp)
jmp 0x43ee9
xorps %xmm0, %xmm0
movss %xmm0, -0x6c(%rbp)
jmp 0x43ee9
movss -0x6c(%rbp), %xmm0
movq -0x18(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movslq -0x20(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x43e8c
jmp 0x43f1a
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x43cc2
jmp 0x43f2a
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x43c81
addq $0x70, %rsp
popq %rbp
retq
nop