// File: /workspace/github_c_makefile_star2_O1/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 $0x48, %rsp
movl %r9d, %ebx
movl %r8d, 0xc(%rsp)
movl %ecx, %r12d
movq %rdx, 0x18(%rsp)
movq %rsi, %rbp
movq %rdi, %r15
movq %rsi, %rdi
movl $0x2f, %esi
callq 0x31a0
movq %rax, %r13
movq %rbp, %rdi
movl $0x5f, %esi
callq 0x31a0
testq %rax, %rax
cmovneq %rax, %r13
incq %r13
movq %r13, %rdi
callq 0x3410
testl %r12d, %r12d
jle 0x4e161
movl %eax, %ebp
cvtsi2ss %ebx, %xmm0
movss %xmm0, 0x14(%rsp)
xorps %xmm0, %xmm0
cvtsi2ssl 0x80(%rsp), %xmm0
movss %xmm0, 0x10(%rsp)
movl %r12d, %eax
movq %rax, 0x20(%rsp)
movl 0xc(%rsp), %ebx
shlq $0x2, %rbx
xorl %r13d, %r13d
cmpl $0x0, 0xc(%rsp)
jle 0x4e153
leaq (,%r13,2), %rax
addq %r13, %rax
shlq $0x4, %rax
movq 0x18(%rsp), %rcx
leaq (%rcx,%rax), %r14
xorps %xmm0, %xmm0
cvtss2sd 0xc(%rcx,%rax), %xmm0
movsd 0x50d9(%rip), %xmm4     # 0x53120
mulsd %xmm4, %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x4(%rcx,%rax), %xmm1
movapd %xmm0, %xmm2
addsd %xmm1, %xmm2
cvtsd2ss %xmm2, %xmm2
movss 0x10(%rsp), %xmm3
minss %xmm2, %xmm3
subsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
xorps %xmm1, %xmm1
maxss %xmm0, %xmm1
subss %xmm1, %xmm3
xorps %xmm0, %xmm0
cvtss2sd 0x8(%rcx,%rax), %xmm0
mulsd %xmm4, %xmm0
xorps %xmm2, %xmm2
cvtss2sd (%rcx,%rax), %xmm2
movapd %xmm0, %xmm4
addsd %xmm2, %xmm4
cvtsd2ss %xmm4, %xmm4
movss 0x14(%rsp), %xmm5
minss %xmm4, %xmm5
subsd %xmm0, %xmm2
xorps %xmm0, %xmm0
cvtsd2ss %xmm2, %xmm0
xorps %xmm2, %xmm2
maxss %xmm0, %xmm2
subss %xmm2, %xmm5
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
movsd %xmm0, 0x40(%rsp)
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
movsd %xmm0, 0x38(%rsp)
xorps %xmm0, %xmm0
cvtss2sd %xmm5, %xmm0
movsd %xmm0, 0x30(%rsp)
xorps %xmm0, %xmm0
cvtss2sd %xmm3, %xmm0
movsd %xmm0, 0x28(%rsp)
xorl %r12d, %r12d
movq 0x18(%r14), %rax
movss (%rax,%r12), %xmm0
ucomiss 0x4f6f(%rip), %xmm0     # 0x53078
jne 0x4e10d
jnp 0x4e14a
leaq 0xb0cc(%rip), %rax      # 0x591e0
movl (%r12,%rax), %ecx
xorps %xmm4, %xmm4
cvtss2sd %xmm0, %xmm4
movq %r15, %rdi
leaq 0xaef5(%rip), %rsi      # 0x5901e
movl %ebp, %edx
movsd 0x40(%rsp), %xmm0
movsd 0x38(%rsp), %xmm1
movsd 0x30(%rsp), %xmm2
movsd 0x28(%rsp), %xmm3
movb $0x5, %al
callq 0x3280
addq $0x4, %r12
cmpq %r12, %rbx
jne 0x4e0f8
incq %r13
cmpq 0x20(%rsp), %r13
jne 0x4e013
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq