// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/detector.c
// Function: print_imagenet_detections
void print_imagenet_detections(FILE *fp, int id, detection *dets, int total, int classes, int w, int h)
{
    int i, j;
    for(i = 0; i < total; ++i){
        float xmin = dets[i].bbox.x - dets[i].bbox.w/2.;
        float xmax = dets[i].bbox.x + dets[i].bbox.w/2.;
        float ymin = dets[i].bbox.y - dets[i].bbox.h/2.;
        float ymax = dets[i].bbox.y + dets[i].bbox.h/2.;

        if (xmin < 0) xmin = 0;
        if (ymin < 0) ymin = 0;
        if (xmax > w) xmax = w;
        if (ymax > h) ymax = h;

        for(j = 0; j < classes; ++j){
            int class = j;
            if (dets[i].prob[class]) fprintf(fp, "%d %d %f %f %f %f %f\n", id, j+1, dets[i].prob[class],
                    xmin, ymin, xmax, ymax);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x699da
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movss 0x8(%rax), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x787d(%rip), %xmm2     # 0x71058
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x30(%rbp)
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movss 0x8(%rax), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x7835(%rip), %xmm2     # 0x71058
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x34(%rbp)
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movss 0x4(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movss 0xc(%rax), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x77ec(%rip), %xmm2     # 0x71058
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x38(%rbp)
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movss 0x4(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movss 0xc(%rax), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x77a3(%rip), %xmm2     # 0x71058
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x3c(%rbp)
xorps %xmm0, %xmm0
ucomiss -0x30(%rbp), %xmm0
jbe 0x698d7
xorps %xmm0, %xmm0
movss %xmm0, -0x30(%rbp)
xorps %xmm0, %xmm0
ucomiss -0x38(%rbp), %xmm0
jbe 0x698e8
xorps %xmm0, %xmm0
movss %xmm0, -0x38(%rbp)
movss -0x34(%rbp), %xmm0
cvtsi2ssl -0x24(%rbp), %xmm1
ucomiss %xmm1, %xmm0
jbe 0x69901
cvtsi2ssl -0x24(%rbp), %xmm0
movss %xmm0, -0x34(%rbp)
movss -0x3c(%rbp), %xmm0
cvtsi2ssl 0x10(%rbp), %xmm1
ucomiss %xmm1, %xmm0
jbe 0x6991a
cvtsi2ssl 0x10(%rbp), %xmm0
movss %xmm0, -0x3c(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x699ca
movl -0x2c(%rbp), %eax
movl %eax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movslq -0x40(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x6995b
jp 0x6995b
jmp 0x699ba
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %edx
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rsi
imulq $0x30, %rsi, %rsi
addq %rsi, %rax
movq 0x18(%rax), %rax
movslq -0x40(%rbp), %rsi
movss (%rax,%rsi,4), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x30(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movss -0x38(%rbp), %xmm2
cvtss2sd %xmm2, %xmm2
movss -0x34(%rbp), %xmm3
cvtss2sd %xmm3, %xmm3
movss -0x3c(%rbp), %xmm4
cvtss2sd %xmm4, %xmm4
leaq 0xd027(%rip), %rsi      # 0x769da
movb $0x5, %al
callq 0x3240
jmp 0x699bc
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x69921
jmp 0x699cc
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x69798
addq $0x40, %rsp
popq %rbp
retq