// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: load_data_region
data load_data_region(int n, char **paths, int m, int w, int h, int size, 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;


    int k = size*size*(5+classes);
    d.y = make_matrix(n, k);
    for(i = 0; i < n; ++i){
        image orig = load_image_color(random_paths[i], 0, 0);

        int oh = orig.h;
        int ow = orig.w;

        int dw = (ow*jitter);
        int dh = (oh*jitter);

        int pleft  = rand_uniform(-dw, dw);
        int pright = rand_uniform(-dw, dw);
        int ptop   = rand_uniform(-dh, dh);
        int pbot   = rand_uniform(-dh, dh);

        int swidth =  ow - pleft - pright;
        int sheight = oh - ptop - pbot;

        float sx = (float)swidth  / ow;
        float sy = (float)sheight / oh;

        int flip = rand()%2;
        image cropped = crop_image(orig, pleft, ptop, swidth, sheight);

        float dx = ((float)pleft/ow)/sx;
        float dy = ((float)ptop /oh)/sy;

        image sized = resize_image(cropped, w, h);
        if(flip) flip_image(sized);
        random_distort_image(sized, hue, saturation, exposure);
        d.X.vals[i] = sized.data;

        fill_truth_region(random_paths[i], d.y.vals[i], classes, size, flip, dx, dy, 1./sx, 1./sy);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0xe0(%rbp)
movq %rdi, -0xe8(%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 -0xe0(%rbp), %rdi
movq %rax, -0x38(%rbp)
xorl %esi, %esi
movl $0x40, %edx
callq 0x3190
movq -0xe0(%rbp), %rdi
movl $0x0, 0x28(%rdi)
movl -0x4(%rbp), %eax
movl %eax, 0x8(%rdi)
movslq 0x8(%rdi), %rdi
movl $0x8, %esi
callq 0x3220
movq -0xe0(%rbp), %rdi
movq %rax, 0x10(%rdi)
movl -0x1c(%rbp), %eax
imull -0x18(%rbp), %eax
imull $0x3, %eax, %eax
movl %eax, 0xc(%rdi)
movl 0x10(%rbp), %eax
imull 0x10(%rbp), %eax
movl 0x18(%rbp), %ecx
addl $0x5, %ecx
imull %ecx, %eax
movl %eax, -0x40(%rbp)
movl -0x4(%rbp), %edi
movl -0x40(%rbp), %esi
callq 0x39450
movq -0xe0(%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 0x35756
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 -0x64(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x68(%rbp), %eax
movl %eax, -0x70(%rbp)
cvtsi2ssl -0x70(%rbp), %xmm0
mulss -0x20(%rbp), %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x74(%rbp)
cvtsi2ssl -0x6c(%rbp), %xmm0
mulss -0x20(%rbp), %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x78(%rbp)
xorl %eax, %eax
subl -0x74(%rbp), %eax
cvtsi2ss %eax, %xmm0
cvtsi2ssl -0x74(%rbp), %xmm1
callq 0x5b30
cvttss2si %xmm0, %eax
movl %eax, -0x7c(%rbp)
xorl %eax, %eax
subl -0x74(%rbp), %eax
cvtsi2ss %eax, %xmm0
cvtsi2ssl -0x74(%rbp), %xmm1
callq 0x5b30
cvttss2si %xmm0, %eax
movl %eax, -0x80(%rbp)
xorl %eax, %eax
subl -0x78(%rbp), %eax
cvtsi2ss %eax, %xmm0
cvtsi2ssl -0x78(%rbp), %xmm1
callq 0x5b30
cvttss2si %xmm0, %eax
movl %eax, -0x84(%rbp)
xorl %eax, %eax
subl -0x78(%rbp), %eax
cvtsi2ss %eax, %xmm0
cvtsi2ssl -0x78(%rbp), %xmm1
callq 0x5b30
cvttss2si %xmm0, %eax
movl %eax, -0x88(%rbp)
movl -0x70(%rbp), %eax
subl -0x7c(%rbp), %eax
subl -0x80(%rbp), %eax
movl %eax, -0x8c(%rbp)
movl -0x6c(%rbp), %eax
subl -0x84(%rbp), %eax
subl -0x88(%rbp), %eax
movl %eax, -0x90(%rbp)
cvtsi2ssl -0x8c(%rbp), %xmm0
cvtsi2ssl -0x70(%rbp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x94(%rbp)
cvtsi2ssl -0x90(%rbp), %xmm0
cvtsi2ssl -0x6c(%rbp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x98(%rbp)
callq 0x34b0
movl $0x2, %ecx
cltd
idivl %ecx
movl %edx, -0x9c(%rbp)
movl -0x7c(%rbp), %esi
movl -0x84(%rbp), %edx
movl -0x8c(%rbp), %ecx
movl -0x90(%rbp), %r8d
leaq -0xb8(%rbp), %rdi
leaq -0x68(%rbp), %rax
movq (%rax), %r9
movq %r9, (%rsp)
movq 0x8(%rax), %r9
movq %r9, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x11ca0
cvtsi2ssl -0x7c(%rbp), %xmm0
cvtsi2ssl -0x70(%rbp), %xmm1
divss %xmm1, %xmm0
divss -0x94(%rbp), %xmm0
movss %xmm0, -0xbc(%rbp)
cvtsi2ssl -0x84(%rbp), %xmm0
cvtsi2ssl -0x6c(%rbp), %xmm1
divss %xmm1, %xmm0
divss -0x98(%rbp), %xmm0
movss %xmm0, -0xc0(%rbp)
movl -0x18(%rbp), %esi
movl -0x1c(%rbp), %edx
leaq -0xd8(%rbp), %rdi
leaq -0xb8(%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 0xfc00
cmpl $0x0, -0x9c(%rbp)
je 0x35641
leaq -0xd8(%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
movss -0x24(%rbp), %xmm0
movss -0x28(%rbp), %xmm1
movss -0x2c(%rbp), %xmm2
leaq -0xd8(%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
movq -0xe0(%rbp), %rax
movq -0xc8(%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
movq 0x20(%rax), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movl 0x18(%rbp), %edx
movl 0x10(%rbp), %ecx
movl -0x9c(%rbp), %r8d
movss -0xbc(%rbp), %xmm0
movss -0xc0(%rbp), %xmm1
movss -0x94(%rbp), %xmm2
cvtss2sd %xmm2, %xmm3
movsd 0x3b988(%rip), %xmm2    # 0x71060
divsd %xmm3, %xmm2
cvtsd2ss %xmm2, %xmm2
movss -0x98(%rbp), %xmm3
cvtss2sd %xmm3, %xmm4
movsd 0x3b96c(%rip), %xmm3    # 0x71060
divsd %xmm4, %xmm3
cvtsd2ss %xmm3, %xmm3
callq 0x324a0
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
leaq -0xb8(%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 0x35439
movq -0x38(%rbp), %rdi
callq 0x3030
movq -0xe8(%rbp), %rax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nop