// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movss %xmm4, 0x5c(%rsp)
movss %xmm3, 0x58(%rsp)
movss %xmm2, 0x54(%rsp)
movss %xmm1, 0x50(%rsp)
movss %xmm0, 0x4c(%rsp)
movl %r9d, %r14d
movl %r8d, %r13d
movl %esi, %ebx
movq %rdi, %r12
movl 0x110(%rsp), %ebp
movq %rdx, %rdi
movl %ecx, %edx
callq 0x1c922
movq %rax, 0x60(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
movups %xmm0, 0x10(%r12)
movups %xmm0, 0x20(%r12)
movups %xmm0, 0x30(%r12)
movl %ebx, 0x8(%r12)
movslq %ebx, %r15
pushq $0x8
popq %rsi
movq %r15, %rdi
callq 0x3250
movq %rax, 0xa8(%rsp)
movq %rax, 0x10(%r12)
movl %r13d, %eax
imull %r14d, %eax
leal (%rax,%rax,2), %eax
movl %eax, 0xc(%r12)
movl %r13d, 0x44(%rsp)
movl %r13d, %eax
cltd
idivl %ebp
movl %eax, %esi
movl %r14d, 0x48(%rsp)
movl %r14d, %eax
cltd
idivl %ebp
movl %eax, %ebp
movl %esi, 0x40(%rsp)
imull %eax, %esi
incl %esi
imull 0x108(%rsp), %esi
movl %r15d, %edi
callq 0x221e3
movq %rdx, %r14
movq %rax, 0x18(%r12)
movq %r12, 0xa0(%rsp)
movq %rdx, 0x20(%r12)
xorl %r13d, %r13d
testl %r15d, %r15d
cmovlel %r13d, %r15d
cmpq %r13, %r15
je 0x1f027
movq 0x60(%rsp), %rax
movq (%rax,%r13,8), %rbx
leaq 0x68(%rsp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xbf36
movq 0x78(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x68(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x80(%rsp), %rdi
movss 0x4c(%rsp), %xmm0
movss 0x50(%rsp), %xmm1
movl 0x118(%rsp), %esi
movl 0x120(%rsp), %edx
movl 0x44(%rsp), %ecx
movl 0x48(%rsp), %r8d
callq 0xea45
movss 0x8c(%rsp), %xmm0
movss 0x88(%rsp), %xmm1
movl 0x80(%rsp), %esi
movl 0x84(%rsp), %edx
movss 0x90(%rsp), %xmm2
movss 0x94(%rsp), %xmm3
movss 0x98(%rsp), %xmm4
movq 0x78(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x68(%rsp), %xmm5
movups %xmm5, (%rsp)
leaq 0xb0(%rsp), %rdi
callq 0xdccf
callq 0x34e0
cltd
pushq $0x2
popq %rcx
idivl %ecx
movl %edx, %r12d
testl %edx, %edx
je 0x1ef7c
movq 0xc0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0xb0(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xcb93
movq 0xc0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0xb0(%rsp), %xmm0
movups %xmm0, (%rsp)
movss 0x54(%rsp), %xmm0
movss 0x58(%rsp), %xmm1
movss 0x5c(%rsp), %xmm2
callq 0xfd21
movq 0xc0(%rsp), %rax
movq 0xa8(%rsp), %rcx
movq %rax, (%rcx,%r13,8)
movq (%r14,%r13,8), %rdx
movl 0x68(%rsp), %r8d
movl 0x6c(%rsp), %r9d
movups 0x80(%rsp), %xmm0
movups 0x8c(%rsp), %xmm1
movups %xmm1, 0xc(%rsp)
movups %xmm0, (%rsp)
movl %ebp, 0x30(%rsp)
movl 0x40(%rsp), %eax
movl %eax, 0x28(%rsp)
movl %r12d, 0x20(%rsp)
movq %rbx, %rdi
movl 0x108(%rsp), %esi
callq 0x1d653
movq 0x78(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x68(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xba88
incq %r13
jmp 0x1ee8b
movq 0x60(%rsp), %rdi
callq 0x3040
movq 0xa0(%rsp), %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq