// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/detector.c
// Function: print_cocos
static void print_cocos(FILE *fp, char *image_path, detection *dets, int num_boxes, int classes, int w, int h)
{
    int i, j;
    int image_id = get_coco_image_id(image_path);
    for(i = 0; i < num_boxes; ++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;

        float bx = xmin;
        float by = ymin;
        float bw = xmax - xmin;
        float bh = ymax - ymin;

        for(j = 0; j < classes; ++j){
            if (dets[i].prob[j]) fprintf(fp, "{\"image_id\":%d, \"category_id\":%d, \"bbox\":[%f, %f, %f, %f], \"score\":%f},\n", image_id, coco_ids[j], bx, by, bw, bh, dets[i].prob[j]);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %r9d, %ebx
movl %r8d, 0xc(%rsp)
movl %ecx, %r12d
movq %rdx, 0x10(%rsp)
movq %rsi, %rbp
movq %rdi, %r15
movq %rsi, %rdi
movl $0x2f, %esi
callq 0x3190
movq %rax, %r13
movq %rbp, %rdi
movl $0x5f, %esi
callq 0x3190
testq %rax, %rax
cmovneq %rax, %r13
incq %r13
movq %r13, %rdi
callq 0x3400
testl %r12d, %r12d
jle 0x503e1
movl %eax, %ebp
movd 0xa0(%rsp), %xmm0
movd %ebx, %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
cvtdq2ps %xmm1, %xmm0
movaps %xmm0, 0x40(%rsp)
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movaps %xmm0, 0x50(%rsp)
movl %r12d, %eax
movq %rax, 0x18(%rsp)
movl 0xc(%rsp), %ebx
shlq $0x2, %rbx
xorl %r13d, %r13d
cmpl $0x0, 0xc(%rsp)
jle 0x503d3
leaq (,%r13,2), %r14
addq %r13, %r14
shlq $0x4, %r14
movq 0x10(%rsp), %rax
cvtps2pd 0x8(%rax,%r14), %xmm2
mulpd 0x5003(%rip), %xmm2     # 0x552e0
cvtps2pd (%rax,%r14), %xmm1
movapd %xmm2, %xmm0
addpd %xmm1, %xmm0
cvtpd2ps %xmm0, %xmm4
movaps 0x40(%rsp), %xmm0
cmpltps %xmm4, %xmm0
unpcklps %xmm0, %xmm0            # xmm0 = xmm0[0,0,1,1]
movmskpd %xmm0, %eax
movaps 0x50(%rsp), %xmm0
testb $0x2, %al
jne 0x5030e
movaps %xmm4, %xmm0
shufps $0x55, %xmm4, %xmm0     # xmm0 = xmm0[1,1],xmm4[1,1]
movaps 0x40(%rsp), %xmm3
testb $0x1, %al
jne 0x5031a
movaps %xmm4, %xmm3
subpd %xmm2, %xmm1
xorps %xmm2, %xmm2
cvtsd2ss %xmm1, %xmm2
movhlps %xmm1, %xmm1            # xmm1 = xmm1[1,1]
cvtsd2ss %xmm1, %xmm1
addq 0x10(%rsp), %r14
xorps %xmm4, %xmm4
maxss %xmm1, %xmm4
subss %xmm4, %xmm0
xorps %xmm1, %xmm1
maxss %xmm2, %xmm1
subss %xmm1, %xmm3
cvtss2sd %xmm1, %xmm1
movsd %xmm1, 0x38(%rsp)
xorps %xmm1, %xmm1
cvtss2sd %xmm4, %xmm1
movsd %xmm1, 0x30(%rsp)
xorps %xmm1, %xmm1
cvtss2sd %xmm3, %xmm1
movsd %xmm1, 0x28(%rsp)
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x20(%rsp)
xorl %r12d, %r12d
movq 0x18(%r14), %rax
movss (%rax,%r12), %xmm0
ucomiss 0x4d17(%rip), %xmm0     # 0x550a0
jne 0x5038d
jnp 0x503ca
leaq 0xafac(%rip), %rax      # 0x5b340
movl (%r12,%rax), %ecx
xorps %xmm4, %xmm4
cvtss2sd %xmm0, %xmm4
movq %r15, %rdi
leaq 0xadcd(%rip), %rsi      # 0x5b176
movl %ebp, %edx
movsd 0x38(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
movsd 0x28(%rsp), %xmm2
movsd 0x20(%rsp), %xmm3
movb $0x5, %al
callq 0x3270
addq $0x4, %r12
cmpq %r12, %rbx
jne 0x50378
incq %r13
cmpq 0x18(%rsp), %r13
jne 0x502b0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq