// File: /workspace/github_c_makefile_star2_O2/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, 0x8(%rsp)
movl %r8d, %ebx
movl %ecx, %r14d
movq %rdx, %r15
movq %rsi, %rbp
movq %rdi, %r12
pushq $0x2f
popq %rsi
movq %rbp, %rdi
callq 0x3190
movq %rax, %r13
pushq $0x5f
popq %rsi
movq %rbp, %rdi
callq 0x3190
testq %rax, %rax
cmovneq %rax, %r13
incq %r13
movq %r13, %rdi
callq 0x3400
movl %eax, %ebp
movss 0x8(%rsp), %xmm0
movss 0xa0(%rsp), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
cvtdq2ps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movaps %xmm0, 0x40(%rsp)
xorl %eax, %eax
testl %ebx, %ebx
cmovlel %eax, %ebx
testl %r14d, %r14d
cmovlel %eax, %r14d
movq %r14, 0x18(%rsp)
xorl %eax, %eax
shlq $0x2, %rbx
leaq 0xb4cc(%rip), %r13      # 0x52036
movq %r15, 0x10(%rsp)
cmpq 0x18(%rsp), %rax
je 0x46c8a
movq %rax, 0x20(%rsp)
imulq $0x30, %rax, %r14
cvtps2pd (%r15,%r14), %xmm0
cvtps2pd 0x8(%r15,%r14), %xmm2
mulpd 0x570a(%rip), %xmm2     # 0x4c2a0
movapd %xmm2, %xmm1
addpd %xmm0, %xmm1
cvtpd2ps %xmm1, %xmm4
movaps 0x50(%rsp), %xmm3
movaps %xmm3, %xmm1
cmpltps %xmm4, %xmm1
unpcklps %xmm1, %xmm1            # xmm1 = xmm1[0,0,1,1]
movmskpd %xmm1, %eax
movaps %xmm3, %xmm1
testb $0x1, %al
jne 0x46bbf
movaps %xmm4, %xmm1
movaps 0x40(%rsp), %xmm3
testb $0x2, %al
jne 0x46bcf
shufps $0x55, %xmm4, %xmm4     # xmm4 = xmm4[1,1,1,1]
movaps %xmm4, %xmm3
subpd %xmm2, %xmm0
cvtsd2ss %xmm0, %xmm2
movhlps %xmm0, %xmm0            # xmm0 = xmm0[1,1]
cvtsd2ss %xmm0, %xmm0
addq %r15, %r14
xorps %xmm4, %xmm4
maxss %xmm2, %xmm4
xorps %xmm2, %xmm2
maxss %xmm0, %xmm2
subss %xmm4, %xmm1
subss %xmm2, %xmm3
cvtss2sd %xmm4, %xmm0
movsd %xmm0, 0x8(%rsp)
cvtss2sd %xmm2, %xmm0
movsd %xmm0, 0x38(%rsp)
cvtss2sd %xmm1, %xmm0
movsd %xmm0, 0x30(%rsp)
cvtss2sd %xmm3, %xmm0
movsd %xmm0, 0x28(%rsp)
xorl %r15d, %r15d
cmpq %r15, %rbx
je 0x46c78
movq 0x18(%r14), %rax
movss (%rax,%r15), %xmm0
ucomiss 0x5440(%rip), %xmm0     # 0x4c078
jne 0x46c3c
jnp 0x46c72
leaq 0xb5bd(%rip), %rax      # 0x52200
movl (%r15,%rax), %ecx
cvtss2sd %xmm0, %xmm4
movq %r12, %rdi
movq %r13, %rsi
movl %ebp, %edx
movsd 0x8(%rsp), %xmm0
movsd 0x38(%rsp), %xmm1
movsd 0x30(%rsp), %xmm2
movsd 0x28(%rsp), %xmm3
movb $0x5, %al
callq 0x3270
addq $0x4, %r15
jmp 0x46c22
movq 0x20(%rsp), %rax
incq %rax
movq 0x10(%rsp), %r15
jmp 0x46b6f
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq