// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/yolo_layer.c
// Function: get_yolo_detections
int get_yolo_detections(layer l, int w, int h, int netw, int neth, float thresh, int *map, int relative, detection *dets)
{
    int i,j,n;
    float *predictions = l.output;
    if (l.batch == 2) avg_flipped_yolo(l);
    int count = 0;
    for (i = 0; i < l.w*l.h; ++i){
        int row = i / l.w;
        int col = i % l.w;
        for(n = 0; n < l.n; ++n){
            int obj_index  = entry_index(l, 0, n*l.w*l.h + i, 4);
            float objectness = predictions[obj_index];
            if(objectness <= thresh) continue;
            int box_index  = entry_index(l, 0, n*l.w*l.h + i, 0);
            dets[count].bbox = get_yolo_box(predictions, l.biases, l.mask[n], box_index, col, row, l.w, l.h, netw, neth, l.w*l.h);
            dets[count].objectness = objectness;
            dets[count].classes = l.classes;
            for(j = 0; j < l.classes; ++j){
                int class_index = entry_index(l, 0, n*l.w*l.h + i, 4 + 1 + j);
                float prob = objectness*predictions[class_index];
                dets[count].prob[j] = (prob > thresh) ? prob : 0;
            }
            ++count;
        }
    }
    correct_yolo_boxes(dets, count, w, h, netw, neth, relative);
    return count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x538, %rsp            # imm = 0x538
movq 0x4b0(%rbp), %rax
leaq 0x10(%rbp), %rax
movq %rax, -0x88(%rbp)
movl %edi, -0x1c(%rbp)
movl %esi, -0x20(%rbp)
movl %edx, -0x24(%rbp)
movl %ecx, -0x28(%rbp)
movss %xmm0, -0x2c(%rbp)
movq %r8, -0x38(%rbp)
movl %r9d, -0x3c(%rbp)
movq 0x268(%rax), %rcx
movq %rcx, -0x50(%rbp)
cmpl $0x2, 0x48(%rax)
jne 0x53583
movq -0x88(%rbp), %rsi
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
callq 0x532e0
movl $0x0, -0x54(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x88(%rbp), %rdx
movl -0x40(%rbp), %eax
movl 0x70(%rdx), %ecx
imull 0x6c(%rdx), %ecx
cmpl %ecx, %eax
jge 0x53850
movq -0x88(%rbp), %rcx
movl -0x40(%rbp), %eax
cltd
idivl 0x70(%rcx)
movl %eax, -0x58(%rbp)
movl -0x40(%rbp), %eax
cltd
idivl 0x70(%rcx)
movl %edx, -0x5c(%rbp)
movl $0x0, -0x48(%rbp)
movq -0x88(%rbp), %rcx
movl -0x48(%rbp), %eax
cmpl 0x84(%rcx), %eax
jge 0x53840
movq -0x88(%rbp), %rsi
movl -0x48(%rbp), %eax
imull 0x70(%rsi), %eax
imull 0x6c(%rsi), %eax
addl -0x40(%rbp), %eax
movl %eax, -0x8c(%rbp)
xorl %eax, %eax
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
movl -0x8c(%rbp), %esi
xorl %edi, %edi
movl $0x4, %edx
callq 0x52fa0
movl %eax, -0x60(%rbp)
movq -0x50(%rbp), %rax
movslq -0x60(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, -0x64(%rbp)
movss -0x64(%rbp), %xmm1
movss -0x2c(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jb 0x53645
jmp 0x53832
movq -0x88(%rbp), %rsi
movl -0x48(%rbp), %eax
movl 0x6c(%rsi), %ecx
movl 0x70(%rsi), %edx
imull %edx, %eax
imull %ecx, %eax
movl -0x40(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x9c(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
movl -0x9c(%rbp), %esi
xorl %edx, %edx
movl %edx, %edi
callq 0x52fa0
movl %eax, %ecx
movq -0x88(%rbp), %rax
movl %ecx, -0x68(%rbp)
movq 0x4b0(%rbp), %rcx
movslq -0x54(%rbp), %rdx
leaq (%rdx,%rdx,2), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq %rcx, -0x98(%rbp)
movq -0x50(%rbp), %rdi
movq 0x230(%rax), %rsi
movq 0x128(%rax), %rcx
movslq -0x48(%rbp), %rdx
movl (%rcx,%rdx,4), %edx
movl -0x68(%rbp), %ecx
movl -0x5c(%rbp), %r8d
movl -0x58(%rbp), %r9d
movl 0x6c(%rax), %r11d
movl 0x70(%rax), %r10d
movl -0x24(%rbp), %ebx
movl -0x28(%rbp), %r14d
movl %r10d, %r15d
imull %r11d, %r15d
movq %rsp, %rax
movl %r15d, 0x20(%rax)
movl %r14d, 0x18(%rax)
movl %ebx, 0x10(%rax)
movl %r11d, 0x8(%rax)
movl %r10d, (%rax)
callq 0x52ac0
movq -0x98(%rbp), %rcx
movq -0x88(%rbp), %rax
movlpd %xmm0, -0x78(%rbp)
movlpd %xmm1, -0x70(%rbp)
movq -0x78(%rbp), %rdx
movq %rdx, (%rcx)
movq -0x70(%rbp), %rdx
movq %rdx, 0x8(%rcx)
movss -0x64(%rbp), %xmm0
movq 0x4b0(%rbp), %rcx
movslq -0x54(%rbp), %rdx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
movss %xmm0, 0x28(%rcx)
movl 0xfc(%rax), %ecx
movq 0x4b0(%rbp), %rax
movslq -0x54(%rbp), %rdx
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
movl $0x0, -0x44(%rbp)
movq -0x88(%rbp), %rcx
movl -0x44(%rbp), %eax
cmpl 0xfc(%rcx), %eax
jge 0x53829
movq -0x88(%rbp), %rsi
movl -0x48(%rbp), %eax
imull 0x70(%rsi), %eax
imull 0x6c(%rsi), %eax
addl -0x40(%rbp), %eax
movl %eax, -0xa0(%rbp)
movl -0x44(%rbp), %edx
addl $0x5, %edx
xorl %eax, %eax
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
movl -0xa0(%rbp), %esi
xorl %edi, %edi
callq 0x52fa0
movl %eax, -0x7c(%rbp)
movss -0x64(%rbp), %xmm0
movq -0x50(%rbp), %rax
movslq -0x7c(%rbp), %rcx
mulss (%rax,%rcx,4), %xmm0
movss %xmm0, -0x80(%rbp)
movss -0x80(%rbp), %xmm0
ucomiss -0x2c(%rbp), %xmm0
jbe 0x537e7
movss -0x80(%rbp), %xmm0
movss %xmm0, -0xa4(%rbp)
jmp 0x537f4
xorps %xmm0, %xmm0
movss %xmm0, -0xa4(%rbp)
jmp 0x537f4
movss -0xa4(%rbp), %xmm0
movq 0x4b0(%rbp), %rax
movslq -0x54(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movslq -0x44(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x53762
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x535cc
jmp 0x53842
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x53591
movq 0x4b0(%rbp), %rdi
movl -0x54(%rbp), %esi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movl -0x24(%rbp), %r8d
movl -0x28(%rbp), %r9d
movl -0x3c(%rbp), %eax
movl %eax, (%rsp)
callq 0x53020
movl -0x54(%rbp), %eax
addq $0x538, %rsp            # imm = 0x538
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop