// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: load_data_seg
data load_data_seg(int n, char **paths, int m, int w, int h, int classes, int min, int max, float angle, float aspect, float hue, float saturation, float exposure, int div)
{
    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.rows = n;
    d.y.cols = h*w*classes/div/div;
    d.y.vals = calloc(d.X.rows, sizeof(float*));

    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;

        image mask = get_segmentation_image(random_paths[i], orig.w, orig.h, classes);
        //image mask = make_image(orig.w, orig.h, classes+1);
        image sized_m = rotate_crop_image(mask, a.rad, a.scale/div, a.w/div, a.h/div, a.dx/div, a.dy/div, a.aspect);

        if(flip) flip_image(sized_m);
        d.y.vals[i] = sized_m.data;

        free_image(orig);
        free_image(mask);

        /*
           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
subq $0xf0, %rsp
movq %rdi, -0xd0(%rbp)
movq %rdi, -0xd8(%rbp)
movl 0x28(%rbp), %eax
movl 0x20(%rbp), %eax
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)
movss %xmm4, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movl -0x4(%rbp), %esi
movl -0x14(%rbp), %edx
callq 0x314c0
movq -0xd0(%rbp), %rdi
movq %rax, -0x38(%rbp)
xorl %esi, %esi
movl $0x40, %edx
callq 0x3190
movq -0xd0(%rbp), %rdi
movl $0x0, 0x28(%rdi)
movl -0x4(%rbp), %eax
movl %eax, 0x8(%rdi)
movslq 0x8(%rdi), %rdi
movl $0x8, %esi
callq 0x3220
movq -0xd0(%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), %eax
movl %eax, 0x18(%rdi)
movl -0x1c(%rbp), %eax
imull -0x18(%rbp), %eax
imull 0x10(%rbp), %eax
cltd
idivl 0x28(%rbp)
cltd
idivl 0x28(%rbp)
movl %eax, 0x1c(%rdi)
movslq 0x8(%rdi), %rdi
movl $0x8, %esi
callq 0x3220
movq -0xd0(%rbp), %rdi
movq %rax, 0x20(%rdi)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x34d23
movq -0x38(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x58(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0xf510
movss -0x20(%rbp), %xmm0
movss -0x24(%rbp), %xmm1
movl 0x18(%rbp), %esi
movl 0x20(%rbp), %edx
movl -0x18(%rbp), %ecx
movl -0x1c(%rbp), %r8d
leaq -0x74(%rbp), %rdi
leaq -0x58(%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 -0x68(%rbp), %xmm0
movss -0x6c(%rbp), %xmm1
movl -0x74(%rbp), %esi
movl -0x70(%rbp), %edx
movss -0x64(%rbp), %xmm2
movss -0x60(%rbp), %xmm3
movss -0x5c(%rbp), %xmm4
leaq -0x90(%rbp), %rdi
leaq -0x58(%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, -0x94(%rbp)
cmpl $0x0, -0x94(%rbp)
je 0x34ba7
leaq -0x90(%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 -0x28(%rbp), %xmm0
movss -0x2c(%rbp), %xmm1
movss -0x30(%rbp), %xmm2
leaq -0x90(%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 -0xd0(%rbp), %rax
movq -0x80(%rbp), %rdx
movq 0x10(%rax), %rax
movslq -0x3c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movl -0x58(%rbp), %edx
movl -0x54(%rbp), %ecx
movl 0x10(%rbp), %r8d
leaq -0xb0(%rbp), %rdi
callq 0x34460
movss -0x68(%rbp), %xmm0
movss -0x6c(%rbp), %xmm1
cvtsi2ssl 0x28(%rbp), %xmm2
divss %xmm2, %xmm1
movl -0x74(%rbp), %eax
cltd
idivl 0x28(%rbp)
movl %eax, %esi
movl -0x70(%rbp), %eax
cltd
idivl 0x28(%rbp)
movl %eax, %edx
movss -0x64(%rbp), %xmm2
cvtsi2ssl 0x28(%rbp), %xmm3
divss %xmm3, %xmm2
movss -0x60(%rbp), %xmm3
cvtsi2ssl 0x28(%rbp), %xmm4
divss %xmm4, %xmm3
movss -0x5c(%rbp), %xmm4
leaq -0xc8(%rbp), %rdi
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 0x11e00
cmpl $0x0, -0x94(%rbp)
je 0x34cb4
leaq -0xc8(%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 -0xd0(%rbp), %rax
movq -0xb8(%rbp), %rdx
movq 0x20(%rax), %rax
movslq -0x3c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
leaq -0x58(%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 -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 0xedb0
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x34abc
movq -0x38(%rbp), %rdi
callq 0x3030
movq -0xd8(%rbp), %rax
addq $0xf0, %rsp
popq %rbp
retq
nopl (%rax)