// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: load_data_iseg
data load_data_iseg(int n, char **paths, int m, int w, int h, int classes, int boxes, int div, int min, int max, float angle, float aspect, 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, (((w/div)*(h/div))+1)*boxes);

    for(i = 0; i < n; ++i){
        image orig = load_image_color(random_paths[i], 0, 0);
        augment_args a = random_augment_args(orig, angle, aspect, min, max, w, h);
        image sized = rotate_crop_image(orig, a.rad, a.scale, a.w, a.h, a.dx, a.dy, a.aspect);

        int flip = rand()%2;
        if(flip) flip_image(sized);
        random_distort_image(sized, hue, saturation, exposure);
        d.X.vals[i] = sized.data;
        //show_image(sized, "image");

        fill_truth_iseg(random_paths[i], boxes, d.y.vals[i], classes, orig.w, orig.h, a, flip, w/div, h/div);

        free_image(orig);

        /*
           image rgb = mask_to_rgb(sized_m, classes);
           show_image(rgb, "part");
           show_image(sized, "orig");
           cvWaitKey(0);
           free_image(rgb);
         */
    }
    free(random_paths);
    return d;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0xc0(%rbp)
movq %rdi, -0xc8(%rbp)
movl 0x30(%rbp), %eax
movl 0x28(%rbp), %eax
movl 0x20(%rbp), %eax
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movss %xmm0, -0x30(%rbp)
movss %xmm1, -0x34(%rbp)
movss %xmm2, -0x38(%rbp)
movss %xmm3, -0x3c(%rbp)
movss %xmm4, -0x40(%rbp)
movq -0x20(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x24(%rbp), %edx
callq 0x314c0
movq -0xc0(%rbp), %rdi
movq %rax, -0x48(%rbp)
xorl %esi, %esi
movl $0x40, %edx
callq 0x3190
movq -0xc0(%rbp), %rdi
movl $0x0, 0x28(%rdi)
movl -0x14(%rbp), %eax
movl %eax, 0x8(%rdi)
movslq 0x8(%rdi), %rdi
movl $0x8, %esi
callq 0x3220
movq -0xc0(%rbp), %rdi
movq %rax, 0x10(%rdi)
movl -0x2c(%rbp), %eax
imull -0x28(%rbp), %eax
imull $0x3, %eax, %eax
movl %eax, 0xc(%rdi)
movl -0x14(%rbp), %edi
movl -0x28(%rbp), %eax
cltd
idivl 0x20(%rbp)
movl %eax, %esi
movl -0x2c(%rbp), %eax
cltd
idivl 0x20(%rbp)
imull %eax, %esi
addl $0x1, %esi
imull 0x18(%rbp), %esi
callq 0x39450
movq -0xc0(%rbp), %rdi
movq %rax, -0x60(%rbp)
movq %rdx, -0x58(%rbp)
movq -0x60(%rbp), %rax
movq %rax, 0x18(%rdi)
movq -0x58(%rbp), %rax
movq %rax, 0x20(%rdi)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x35042
movq -0x48(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x78(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0xf510
movss -0x30(%rbp), %xmm0
movss -0x34(%rbp), %xmm1
movl 0x28(%rbp), %esi
movl 0x30(%rbp), %edx
movl -0x28(%rbp), %ecx
movl -0x2c(%rbp), %r8d
leaq -0x98(%rbp), %rdi
leaq -0x78(%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 0x13010
movss -0x8c(%rbp), %xmm0
movss -0x90(%rbp), %xmm1
movl -0x98(%rbp), %esi
movl -0x94(%rbp), %edx
movss -0x88(%rbp), %xmm2
movss -0x84(%rbp), %xmm3
movss -0x80(%rbp), %xmm4
leaq -0xb0(%rbp), %rdi
leaq -0x78(%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 0x11e00
callq 0x34b0
movl $0x2, %ecx
cltd
idivl %ecx
movl %edx, -0xb4(%rbp)
cmpl $0x0, -0xb4(%rbp)
je 0x34f3e
leaq -0xb0(%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 -0x38(%rbp), %xmm0
movss -0x3c(%rbp), %xmm1
movss -0x40(%rbp), %xmm2
leaq -0xb0(%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 -0xc0(%rbp), %rax
movq -0xa0(%rbp), %rsi
movq 0x10(%rax), %rcx
movslq -0x4c(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movq -0x48(%rbp), %rcx
movslq -0x4c(%rbp), %rdx
movq (%rcx,%rdx,8), %rdi
movl 0x18(%rbp), %esi
movq 0x20(%rax), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xd0(%rbp)
movl 0x10(%rbp), %ecx
movl -0x78(%rbp), %r8d
movl -0x74(%rbp), %r9d
movl -0xb4(%rbp), %r11d
movl -0x28(%rbp), %eax
cltd
idivl 0x20(%rbp)
movl %eax, %r10d
movl -0x2c(%rbp), %eax
cltd
idivl 0x20(%rbp)
movq -0xd0(%rbp), %rdx
leaq -0x98(%rbp), %rbx
movq (%rbx), %r14
movq %r14, (%rsp)
movq 0x8(%rbx), %r14
movq %r14, 0x8(%rsp)
movq 0x10(%rbx), %r14
movq %r14, 0x10(%rsp)
movl 0x18(%rbx), %ebx
movl %ebx, 0x18(%rsp)
movl %r11d, 0x20(%rsp)
movl %r10d, 0x28(%rsp)
movl %eax, 0x30(%rsp)
callq 0x32c60
leaq -0x78(%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 -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x34e3e
movq -0x48(%rbp), %rdi
callq 0x3030
movq -0xc8(%rbp), %rax
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %rbp
retq
nop