// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: load_data_detection
data load_data_detection(int n, char **paths, int m, int w, int h, int boxes, int classes, float jitter, float hue, float saturation, float exposure)
{
    char **random_paths = get_random_paths(paths, n, m);
    int i;
    data d = {0};
    d.shallow = 0;

    d.X.rows = n;
    d.X.vals = calloc(d.X.rows, sizeof(float*));
    d.X.cols = h*w*3;

    d.y = make_matrix(n, 5*boxes);
    for(i = 0; i < n; ++i){
        image orig = load_image_color(random_paths[i], 0, 0);
        image sized = make_image(w, h, orig.c);
        fill_image(sized, .5);

        float dw = jitter * orig.w;
        float dh = jitter * orig.h;

        float new_ar = (orig.w + rand_uniform(-dw, dw)) / (orig.h + rand_uniform(-dh, dh));
        //float scale = rand_uniform(.25, 2);
        float scale = 1;

        float nw, nh;

        if(new_ar < 1){
            nh = scale * h;
            nw = nh * new_ar;
        } else {
            nw = scale * w;
            nh = nw / new_ar;
        }

        float dx = rand_uniform(0, w - nw);
        float dy = rand_uniform(0, h - nh);

        place_image(orig, nw, nh, dx, dy, sized);

        random_distort_image(sized, hue, saturation, exposure);

        int flip = rand()%2;
        if(flip) flip_image(sized);
        d.X.vals[i] = sized.data;


        fill_truth_detection(random_paths[i], boxes, d.y.vals[i], classes, flip, -dx/w, -dy/h, nw/w, nh/h);

        free_image(orig);
    }
    free(random_paths);
    return d;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0xb0(%rbp)
movq %rdi, -0xb8(%rbp)
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movl %esi, -0x4(%rbp)
movq %rdx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
movl %r9d, -0x1c(%rbp)
movss %xmm0, -0x20(%rbp)
movss %xmm1, -0x24(%rbp)
movss %xmm2, -0x28(%rbp)
movss %xmm3, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x4(%rbp), %esi
movl -0x14(%rbp), %edx
callq 0x314c0
movq -0xb0(%rbp), %rdi
movq %rax, -0x38(%rbp)
xorl %esi, %esi
movl $0x40, %edx
callq 0x3190
movq -0xb0(%rbp), %rdi
movl $0x0, 0x28(%rdi)
movl -0x4(%rbp), %eax
movl %eax, 0x8(%rdi)
movslq 0x8(%rdi), %rdi
movl $0x8, %esi
callq 0x3220
movq -0xb0(%rbp), %rdi
movq %rax, 0x10(%rdi)
movl -0x1c(%rbp), %eax
imull -0x18(%rbp), %eax
imull $0x3, %eax, %eax
movl %eax, 0xc(%rdi)
movl -0x4(%rbp), %edi
imull $0x5, 0x10(%rbp), %esi
callq 0x39450
movq -0xb0(%rbp), %rdi
movq %rax, -0x50(%rbp)
movq %rdx, -0x48(%rbp)
movq -0x50(%rbp), %rax
movq %rax, 0x18(%rdi)
movq -0x48(%rbp), %rax
movq %rax, 0x20(%rdi)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x364f9
movq -0x38(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x68(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0xf510
movl -0x18(%rbp), %esi
movl -0x1c(%rbp), %edx
movl -0x60(%rbp), %ecx
leaq -0x80(%rbp), %rdi
callq 0xe3e0
leaq -0x80(%rbp), %rax
movss 0x3b032(%rip), %xmm0    # 0x711ec
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x12370
movss -0x20(%rbp), %xmm0
cvtsi2ssl -0x68(%rbp), %xmm1
mulss %xmm1, %xmm0
movss %xmm0, -0x84(%rbp)
movss -0x20(%rbp), %xmm0
cvtsi2ssl -0x64(%rbp), %xmm1
mulss %xmm1, %xmm0
movss %xmm0, -0x88(%rbp)
cvtsi2ssl -0x68(%rbp), %xmm0
movss %xmm0, -0xc4(%rbp)
movss -0x84(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss -0x84(%rbp), %xmm1
callq 0x5b30
movaps %xmm0, %xmm1
movss -0xc4(%rbp), %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0xbc(%rbp)
cvtsi2ssl -0x64(%rbp), %xmm0
movss %xmm0, -0xc0(%rbp)
movss -0x88(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss -0x88(%rbp), %xmm1
callq 0x5b30
movss -0xc0(%rbp), %xmm1
movaps %xmm0, %xmm2
movss -0xbc(%rbp), %xmm0
addss %xmm2, %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x8c(%rbp)
movss 0x3ad68(%rip), %xmm0    # 0x7100c
movss %xmm0, -0x90(%rbp)
movss 0x3ad58(%rip), %xmm0    # 0x7100c
ucomiss -0x8c(%rbp), %xmm0
jbe 0x362f0
movss -0x90(%rbp), %xmm0
cvtsi2ssl -0x1c(%rbp), %xmm1
mulss %xmm1, %xmm0
movss %xmm0, -0x98(%rbp)
movss -0x98(%rbp), %xmm0
mulss -0x8c(%rbp), %xmm0
movss %xmm0, -0x94(%rbp)
jmp 0x36321
movss -0x90(%rbp), %xmm0
cvtsi2ssl -0x18(%rbp), %xmm1
mulss %xmm1, %xmm0
movss %xmm0, -0x94(%rbp)
movss -0x94(%rbp), %xmm0
divss -0x8c(%rbp), %xmm0
movss %xmm0, -0x98(%rbp)
cvtsi2ssl -0x18(%rbp), %xmm1
subss -0x94(%rbp), %xmm1
xorps %xmm0, %xmm0
callq 0x5b30
movss %xmm0, -0x9c(%rbp)
cvtsi2ssl -0x1c(%rbp), %xmm1
subss -0x98(%rbp), %xmm1
xorps %xmm0, %xmm0
callq 0x5b30
movss %xmm0, -0xa0(%rbp)
cvttss2si -0x94(%rbp), %edi
cvttss2si -0x98(%rbp), %esi
cvttss2si -0x9c(%rbp), %edx
cvttss2si -0xa0(%rbp), %ecx
leaq -0x68(%rbp), %r8
leaq -0x80(%rbp), %rax
movq (%r8), %r9
movq %r9, (%rsp)
movq 0x8(%r8), %r9
movq %r9, 0x8(%rsp)
movq 0x10(%r8), %r8
movq %r8, 0x10(%rsp)
movq (%rax), %r8
movq %r8, 0x18(%rsp)
movq 0x8(%rax), %r8
movq %r8, 0x20(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x28(%rsp)
callq 0x11880
movss -0x24(%rbp), %xmm0
movss -0x28(%rbp), %xmm1
movss -0x2c(%rbp), %xmm2
leaq -0x80(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x14aa0
callq 0x34b0
movl $0x2, %ecx
cltd
idivl %ecx
movl %edx, -0xa4(%rbp)
cmpl $0x0, -0xa4(%rbp)
je 0x3642a
leaq -0x80(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x104c0
movq -0xb0(%rbp), %rax
movq -0x70(%rbp), %rsi
movq 0x10(%rax), %rcx
movslq -0x3c(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movq -0x38(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
movq (%rcx,%rdx,8), %rdi
movl 0x10(%rbp), %esi
movq 0x20(%rax), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movl 0x18(%rbp), %ecx
movl -0xa4(%rbp), %r8d
movss -0x9c(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
cvtsi2ssl -0x18(%rbp), %xmm1
divss %xmm1, %xmm0
movss -0xa0(%rbp), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
cvtsi2ssl -0x1c(%rbp), %xmm2
divss %xmm2, %xmm1
movss -0x94(%rbp), %xmm2
cvtsi2ssl -0x18(%rbp), %xmm3
divss %xmm3, %xmm2
movss -0x98(%rbp), %xmm3
cvtsi2ssl -0x1c(%rbp), %xmm4
divss %xmm4, %xmm3
callq 0x33600
leaq -0x68(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xedb0
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x36177
movq -0x38(%rbp), %rdi
callq 0x3030
movq -0xb8(%rbp), %rax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopw %cs:(%rax,%rax)