// File: /workspace/github_c_makefile_star2_O2/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, %r14d
movq %rdx, %rbx
movl %esi, %ebp
leaq 0x31bc8(%rip), %rsi     # 0x4f99f
leaq 0x31bc8(%rip), %r12     # 0x4f9a6
leaq 0x20(%rsp), %r15
movq %r12, %rdx
movq %r15, %rcx
callq 0x42ea
leaq 0x31bb8(%rip), %rsi     # 0x4f9ad
movq %r15, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq 0x42ea
leaq 0x31bc4(%rip), %rsi     # 0x4f9ce
movq %r15, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq 0x42ea
leaq 0x3092d(%rip), %rsi     # 0x4e74c
leaq 0x339a3(%rip), %r12     # 0x517c9
movq %r15, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq 0x42ea
leaq 0x30863(%rip), %rsi     # 0x4e69e
movq %r15, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq 0x42ea
leaq 0x31b68(%rip), %rsi     # 0x4f9b8
movq %r15, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq 0x42ea
leaq 0x31b58(%rip), %rsi     # 0x4f9bd
movq %r15, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq 0x42ea
leaq 0x1c(%rsp), %r12
andl $0x0, (%r12)
movq %r15, %rdi
movq %r12, %rsi
callq 0x1cd0d
movq %rax, %r15
movl (%r12), %r12d
movq %rax, %rdi
movl %r12d, %esi
callq 0x1ce7c
movq %r15, %rdi
movl %r12d, %esi
movss 0xc(%rsp), %xmm0
movss 0x10(%rsp), %xmm1
movss 0x14(%rsp), %xmm2
movss 0x18(%rsp), %xmm3
movl %r14d, %edx
callq 0x1cf1d
cmpl %ebp, %r12d
cmovll %r12d, %ebp
movslq %ebp, %rax
xorl %ecx, %ecx
movsd 0x316dc(%rip), %xmm0    # 0x4f5b0
movq %r15, %rdx
xorl %esi, %esi
xorl %edi, %edi
cmpq %rax, %rsi
jge 0x1df32
movsd 0xc(%rdx), %xmm1
cvtss2sd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
ja 0x1df24
movaps %xmm1, %xmm2
shufps $0x55, %xmm1, %xmm2     # xmm2 = xmm2[1,1],xmm1[1,1]
cvtss2sd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
ja 0x1df24
imull $-0x5, %edi, %r8d
movsd 0x4(%rdx), %xmm2
movlhps %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0]
cvtsi2ssl (%rdx), %xmm1
addl %ecx, %r8d
movslq %r8d, %r8
movups %xmm2, (%rbx,%r8,4)
movss %xmm1, 0x10(%rbx,%r8,4)
jmp 0x1df26
incl %edi
incq %rsi
addq $0x24, %rdx
addl $0x5, %ecx
jmp 0x1dedb
movq %r15, %rdi
callq 0x3040
addq $0x1020, %rsp           # imm = 0x1020
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq