// File: /workspace/github_c_makefile_star2_O1/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, 0x1c(%rsp)
movss %xmm2, 0x18(%rsp)
movss %xmm1, 0x14(%rsp)
movss %xmm0, 0x10(%rsp)
movl %r8d, %r15d
movq %rdx, %rbx
movl %esi, %ebp
leaq 0x2bb6f(%rip), %rsi     # 0x5694f
leaq 0x2bb6f(%rip), %r12     # 0x56956
leaq 0x20(%rsp), %r14
movq %r12, %rdx
movq %r14, %rcx
callq 0xe842
leaq 0x2bb5f(%rip), %rsi     # 0x5695d
movq %r14, %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0xe842
leaq 0x2bb6b(%rip), %rsi     # 0x5697e
movq %r14, %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0xe842
leaq 0x2a92c(%rip), %rsi     # 0x55754
leaq 0x2d98a(%rip), %r12     # 0x587b9
movq %r14, %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0xe842
leaq 0x2a862(%rip), %rsi     # 0x556a6
movq %r14, %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0xe842
leaq 0x2bb0f(%rip), %rsi     # 0x56968
movq %r14, %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0xe842
leaq 0x2baff(%rip), %rsi     # 0x5696d
movq %r14, %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0xe842
leaq 0xc(%rsp), %r12
movl $0x0, (%r12)
movq %r14, %rdi
movq %r12, %rsi
callq 0x29b2e
movq %rax, %r14
movl (%r12), %r12d
movq %rax, %rdi
movl %r12d, %esi
callq 0x29ce7
movq %r14, %rdi
movl %r12d, %esi
movss 0x10(%rsp), %xmm0
movss 0x14(%rsp), %xmm1
movss 0x18(%rsp), %xmm2
movss 0x1c(%rsp), %xmm3
movl %r15d, %edx
callq 0x29d8a
cmpl %ebp, %r12d
jle 0x2aed5
movl %ebp, 0xc(%rsp)
movslq 0xc(%rsp), %rcx
testq %rcx, %rcx
jle 0x2af5c
movq %r14, %rax
addq $0x10, %rax
leaq (%rcx,%rcx,4), %rcx
xorl %edx, %edx
movsd 0x2b69c(%rip), %xmm0    # 0x56590
xorl %esi, %esi
movss -0x4(%rax), %xmm1
xorps %xmm2, %xmm2
cvtss2sd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
ja 0x2af4d
movss (%rax), %xmm2
xorps %xmm3, %xmm3
cvtss2sd %xmm2, %xmm3
ucomisd %xmm3, %xmm0
ja 0x2af4d
movq -0xc(%rax), %rdi
leal (%rsi,%rsi,4), %r8d
movl %edx, %r9d
subl %r8d, %r9d
movslq %r9d, %r8
xorps %xmm3, %xmm3
cvtsi2ssl -0x10(%rax), %xmm3
movq %rdi, (%rbx,%r8,4)
movss %xmm1, 0x8(%rbx,%r8,4)
movss %xmm2, 0xc(%rbx,%r8,4)
movss %xmm3, 0x10(%rbx,%r8,4)
jmp 0x2af4f
incl %esi
addq $0x5, %rdx
addq $0x24, %rax
cmpq %rdx, %rcx
jne 0x2aef6
movq %r14, %rdi
callq 0x3040
addq $0x1020, %rsp           # imm = 0x1020
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq