// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: fill_truth_detection
void fill_truth_detection(char *path, int num_boxes, float *truth, int classes, int flip, float dx, float dy, float sx, float sy)
{
    char labelpath[4096];
    find_replace(path, "images", "labels", labelpath);
    find_replace(labelpath, "JPEGImages", "labels", labelpath);

    find_replace(labelpath, "raw", "labels", labelpath);
    find_replace(labelpath, ".jpg", ".txt", labelpath);
    find_replace(labelpath, ".png", ".txt", labelpath);
    find_replace(labelpath, ".JPG", ".txt", labelpath);
    find_replace(labelpath, ".JPEG", ".txt", labelpath);
    int count = 0;
    box_label *boxes = read_boxes(labelpath, &count);
    randomize_boxes(boxes, count);
    correct_boxes(boxes, count, dx, dy, sx, sy, flip);
    if(count > num_boxes) count = num_boxes;
    float x,y,w,h;
    int id;
    int i;
    int sub = 0;

    for (i = 0; i < count; ++i) {
        x =  boxes[i].x;
        y =  boxes[i].y;
        w =  boxes[i].w;
        h =  boxes[i].h;
        id = boxes[i].id;

        if ((w < .001 || h < .001)) {
            ++sub;
            continue;
        }

        truth[(i-sub)*5+0] = x;
        truth[(i-sub)*5+1] = y;
        truth[(i-sub)*5+2] = w;
        truth[(i-sub)*5+3] = h;
        truth[(i-sub)*5+4] = id;
    }
    free(boxes);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1020, %rsp           # imm = 0x1020
movss %xmm3, 0x18(%rsp)
movss %xmm2, 0x14(%rsp)
movss %xmm1, 0x10(%rsp)
movss %xmm0, 0xc(%rsp)
movl %r8d, %r15d
movq %rdx, %rbx
movl %esi, %ebp
leaq 0x2c2d1(%rip), %rsi     # 0x58a4f
leaq 0x2c2d1(%rip), %r12     # 0x58a56
leaq 0x20(%rsp), %r14
movq %r12, %rdx
movq %r14, %rcx
callq 0xf02d
leaq 0x2c2c1(%rip), %rsi     # 0x58a5d
movq %r14, %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0xf02d
leaq 0x2c2cd(%rip), %rsi     # 0x58a7e
movq %r14, %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0xf02d
leaq 0x2b066(%rip), %rsi     # 0x5782c
leaq 0x2e144(%rip), %r12     # 0x5a911
movq %r14, %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0xf02d
leaq 0x2af9c(%rip), %rsi     # 0x5777e
movq %r14, %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0xf02d
leaq 0x2c271(%rip), %rsi     # 0x58a68
movq %r14, %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0xf02d
leaq 0x2c261(%rip), %rsi     # 0x58a6d
movq %r14, %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0xf02d
leaq 0x1c(%rsp), %r12
movl $0x0, (%r12)
movq %r14, %rdi
movq %r12, %rsi
callq 0x2b377
movq %rax, %r14
movl (%r12), %r12d
movq %rax, %rdi
movl %r12d, %esi
callq 0x2b52a
movq %r14, %rdi
movl %r12d, %esi
movss 0xc(%rsp), %xmm0
movss 0x10(%rsp), %xmm1
movss 0x14(%rsp), %xmm2
movss 0x18(%rsp), %xmm3
movl %r15d, %edx
callq 0x2b5cd
cmpl %ebp, %r12d
cmovll %r12d, %ebp
testl %ebp, %ebp
jle 0x2c8e3
movl %ebp, %eax
leaq (%rax,%rax,4), %rax
xorl %ecx, %ecx
movsd 0x2bddb(%rip), %xmm0    # 0x58660
movq %r14, %rdx
xorl %esi, %esi
movsd 0xc(%rdx), %xmm1
xorps %xmm2, %xmm2
cvtss2sd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
ja 0x2c8d4
movaps %xmm1, %xmm2
shufps $0x55, %xmm1, %xmm2     # xmm2 = xmm2[1,1],xmm1[1,1]
cvtss2sd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
ja 0x2c8d4
leal (%rsi,%rsi,4), %edi
movl %ecx, %r8d
movsd 0x4(%rdx), %xmm2
movlhps %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0]
xorps %xmm1, %xmm1
cvtsi2ssl (%rdx), %xmm1
subl %edi, %r8d
movslq %r8d, %rdi
movups %xmm2, (%rbx,%rdi,4)
movss %xmm1, 0x10(%rbx,%rdi,4)
jmp 0x2c8d6
incl %esi
addq $0x5, %rcx
addq $0x24, %rdx
cmpq %rcx, %rax
jne 0x2c88a
movq %r14, %rdi
callq 0x3040
addq $0x1020, %rsp           # imm = 0x1020
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq