// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: load_data_swag
data load_data_swag(char **paths, int n, int classes, float jitter)
{
    int index = rand()%n;
    char *random_path = paths[index];

    image orig = load_image_color(random_path, 0, 0);
    int h = orig.h;
    int w = orig.w;

    data d = {0};
    d.shallow = 0;
    d.w = w;
    d.h = h;

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

    int k = (4+classes)*90;
    d.y = make_matrix(1, k);

    int dw = w*jitter;
    int dh = h*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 =  w - pleft - pright;
    int sheight = h - ptop - pbot;

    float sx = (float)swidth  / w;
    float sy = (float)sheight / h;

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

    float dx = ((float)pleft/w)/sx;
    float dy = ((float)ptop /h)/sy;

    image sized = resize_image(cropped, w, h);
    if(flip) flip_image(sized);
    d.X.vals[0] = sized.data;

    fill_truth_swag(random_path, d.y.vals[0], classes, flip, dx, dy, 1./sx, 1./sy);

    free_image(orig);
    free_image(cropped);

    return d;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0xc8(%rbp)
movq %rdi, -0xd0(%rbp)
movq %rsi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
movss %xmm0, -0x14(%rbp)
callq 0x34b0
cltd
idivl -0xc(%rbp)
movl %edx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rsi
leaq -0x38(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0xf510
movq -0xc8(%rbp), %rdi
movl -0x34(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x40(%rbp)
xorl %esi, %esi
movl $0x40, %edx
callq 0x3190
movq -0xc8(%rbp), %rdi
movl $0x0, 0x28(%rdi)
movl -0x40(%rbp), %eax
movl %eax, (%rdi)
movl -0x3c(%rbp), %eax
movl %eax, 0x4(%rdi)
movl $0x1, 0x8(%rdi)
movslq 0x8(%rdi), %rdi
movl $0x8, %esi
callq 0x3220
movq -0xc8(%rbp), %rdi
movq %rax, 0x10(%rdi)
movl -0x3c(%rbp), %eax
imull -0x40(%rbp), %eax
imull $0x3, %eax, %eax
movl %eax, 0xc(%rdi)
movl -0x10(%rbp), %eax
addl $0x4, %eax
imull $0x5a, %eax, %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %esi
movl $0x1, %edi
callq 0x39450
movq -0xc8(%rbp), %rdi
movq %rax, -0x58(%rbp)
movq %rdx, -0x50(%rbp)
movq -0x58(%rbp), %rax
movq %rax, 0x18(%rdi)
movq -0x50(%rbp), %rax
movq %rax, 0x20(%rdi)
cvtsi2ssl -0x40(%rbp), %xmm0
mulss -0x14(%rbp), %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x5c(%rbp)
cvtsi2ssl -0x3c(%rbp), %xmm0
mulss -0x14(%rbp), %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x60(%rbp)
xorl %eax, %eax
subl -0x5c(%rbp), %eax
cvtsi2ss %eax, %xmm0
cvtsi2ssl -0x5c(%rbp), %xmm1
callq 0x5b30
cvttss2si %xmm0, %eax
movl %eax, -0x64(%rbp)
xorl %eax, %eax
subl -0x5c(%rbp), %eax
cvtsi2ss %eax, %xmm0
cvtsi2ssl -0x5c(%rbp), %xmm1
callq 0x5b30
cvttss2si %xmm0, %eax
movl %eax, -0x68(%rbp)
xorl %eax, %eax
subl -0x60(%rbp), %eax
cvtsi2ss %eax, %xmm0
cvtsi2ssl -0x60(%rbp), %xmm1
callq 0x5b30
cvttss2si %xmm0, %eax
movl %eax, -0x6c(%rbp)
xorl %eax, %eax
subl -0x60(%rbp), %eax
cvtsi2ss %eax, %xmm0
cvtsi2ssl -0x60(%rbp), %xmm1
callq 0x5b30
cvttss2si %xmm0, %eax
movl %eax, -0x70(%rbp)
movl -0x40(%rbp), %eax
subl -0x64(%rbp), %eax
subl -0x68(%rbp), %eax
movl %eax, -0x74(%rbp)
movl -0x3c(%rbp), %eax
subl -0x6c(%rbp), %eax
subl -0x70(%rbp), %eax
movl %eax, -0x78(%rbp)
cvtsi2ssl -0x74(%rbp), %xmm0
cvtsi2ssl -0x40(%rbp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x7c(%rbp)
cvtsi2ssl -0x78(%rbp), %xmm0
cvtsi2ssl -0x3c(%rbp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x80(%rbp)
callq 0x34b0
movl $0x2, %ecx
cltd
idivl %ecx
movl %edx, -0x84(%rbp)
movl -0x64(%rbp), %esi
movl -0x6c(%rbp), %edx
movl -0x74(%rbp), %ecx
movl -0x78(%rbp), %r8d
leaq -0xa0(%rbp), %rdi
leaq -0x38(%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 -0x64(%rbp), %xmm0
cvtsi2ssl -0x40(%rbp), %xmm1
divss %xmm1, %xmm0
divss -0x7c(%rbp), %xmm0
movss %xmm0, -0xa4(%rbp)
cvtsi2ssl -0x6c(%rbp), %xmm0
cvtsi2ssl -0x3c(%rbp), %xmm1
divss %xmm1, %xmm0
divss -0x80(%rbp), %xmm0
movss %xmm0, -0xa8(%rbp)
movl -0x40(%rbp), %esi
movl -0x3c(%rbp), %edx
leaq -0xc0(%rbp), %rdi
leaq -0xa0(%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, -0x84(%rbp)
je 0x35fd9
leaq -0xc0(%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 -0xc8(%rbp), %rax
movq -0xb0(%rbp), %rdx
movq 0x10(%rax), %rcx
movq %rdx, (%rcx)
movq -0x20(%rbp), %rdi
movq 0x20(%rax), %rax
movq (%rax), %rsi
movl -0x10(%rbp), %edx
movl -0x84(%rbp), %ecx
movss -0xa4(%rbp), %xmm0
movss -0xa8(%rbp), %xmm1
movss -0x7c(%rbp), %xmm2
cvtss2sd %xmm2, %xmm3
movsd 0x3b03d(%rip), %xmm2    # 0x71060
divsd %xmm3, %xmm2
cvtsd2ss %xmm2, %xmm2
movss -0x80(%rbp), %xmm3
cvtss2sd %xmm3, %xmm4
movsd 0x3b024(%rip), %xmm3    # 0x71060
divsd %xmm4, %xmm3
cvtsd2ss %xmm3, %xmm3
callq 0x32160
leaq -0x38(%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 -0xa0(%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
movq -0xd0(%rbp), %rax
addq $0xf0, %rsp
popq %rbp
retq