// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: tile_data
data *tile_data(data orig, int divs, int size)
{
    data *ds = calloc(divs*divs, sizeof(data));
    int i, j;
#pragma omp parallel for
    for(i = 0; i < divs*divs; ++i){
        data d;
        d.shallow = 0;
        d.w = orig.w/divs * size;
        d.h = orig.h/divs * size;
        d.X.rows = orig.X.rows;
        d.X.cols = d.w*d.h*3;
        d.X.vals = calloc(d.X.rows, sizeof(float*));

        d.y = copy_matrix(orig.y);
#pragma omp parallel for
        for(j = 0; j < orig.X.rows; ++j){
            int x = (i%divs) * orig.w / divs - (d.w - orig.w/divs)/2;
            int y = (i/divs) * orig.h / divs - (d.h - orig.h/divs)/2;
            image im = float_to_image(orig.w, orig.h, 3, orig.X.vals[j]);
            d.X.vals[j] = crop_image(im, x, y, d.w, d.h).data;
        }
        ds[i] = d;
    }
    return ds;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movl %esi, 0x30(%rsp)
movl %edi, %ebp
imull %edi, %edi
pushq $0x40
popq %rsi
movq %rdi, 0x68(%rsp)
callq 0x3250
movq %rax, 0x38(%rsp)
movl 0x100(%rsp), %eax
movl %eax, 0x18(%rsp)
movl 0x104(%rsp), %r13d
movl 0x108(%rsp), %eax
movslq %eax, %rcx
movq 0x118(%rsp), %rdx
movq %rdx, 0x58(%rsp)
movq 0x120(%rsp), %rdx
movq %rdx, 0x50(%rsp)
movq 0x110(%rsp), %rdx
movq %rdx, 0x80(%rsp)
xorl %ebx, %ebx
movq %rcx, 0x60(%rsp)
testl %ecx, %ecx
movl $0x0, %ecx
movl %eax, 0x2c(%rsp)
cmovgl %eax, %ecx
movq %rcx, 0x90(%rsp)
cmpq 0x68(%rsp), %rbx
je 0x211b6
movl 0x18(%rsp), %eax
cltd
idivl %ebp
movl %eax, %r14d
movl %eax, %r12d
movl 0x30(%rsp), %ecx
imull %ecx, %r12d
movl %r13d, %eax
cltd
idivl %ebp
movl %eax, %r15d
movl %eax, 0x20(%rsp)
imull %ecx, %r15d
leal (%r12,%r12,2), %eax
movl %eax, 0x34(%rsp)
movq 0x60(%rsp), %rdi
pushq $0x8
popq %rsi
callq 0x3250
movq %rax, 0x40(%rsp)
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x22155
movq %rax, 0x70(%rsp)
movq %rdx, 0x78(%rsp)
movq %r12, 0x48(%rsp)
movl %r12d, %eax
subl %r14d, %eax
cltd
pushq $-0x2
popq %rcx
idivl %ecx
movq %rax, 0x88(%rsp)
movl %r15d, 0x1c(%rsp)
subl 0x20(%rsp), %r15d
movl %r15d, %eax
cltd
idivl %ecx
movq %rax, 0x20(%rsp)
xorl %r15d, %r15d
cmpq %r15, 0x90(%rsp)
je 0x2115c
movl %ebx, %eax
cltd
idivl %ebp
movl %eax, %ecx
movl %edx, %eax
movl 0x18(%rsp), %esi
imull %esi, %eax
cltd
idivl %ebp
movq %rbx, %r12
movq 0x88(%rsp), %rdx
leal (%rax,%rdx), %ebx
imull %r13d, %ecx
movl %ecx, %eax
cltd
idivl %ebp
movq 0x20(%rsp), %rcx
leal (%rax,%rcx), %r14d
movq 0x80(%rsp), %rax
movq (%rax,%r15,8), %r8
leaq 0x98(%rsp), %rdi
movl %r13d, %edx
pushq $0x3
popq %rcx
callq 0xc3de
movq 0xa8(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x98(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0xb0(%rsp), %rdi
movl %ebx, %esi
movq %r12, %rbx
movl %r14d, %edx
movq 0x48(%rsp), %rcx
movl 0x1c(%rsp), %r8d
callq 0xdba7
movq 0xc0(%rsp), %rax
movq 0x40(%rsp), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
jmp 0x210ab
movl 0x1c(%rsp), %esi
movl 0x34(%rsp), %edi
imull %esi, %edi
movq %rbx, %rax
shlq $0x6, %rax
movq 0x38(%rsp), %rcx
movq 0x48(%rsp), %rdx
movl %edx, (%rcx,%rax)
movl %esi, 0x4(%rcx,%rax)
movl 0x2c(%rsp), %edx
movl %edx, 0x8(%rcx,%rax)
movl %edi, 0xc(%rcx,%rax)
movq 0x40(%rsp), %rdx
movq %rdx, 0x10(%rcx,%rax)
movq 0x70(%rsp), %rdx
movq %rdx, 0x18(%rcx,%rax)
movq 0x78(%rsp), %rdx
movq %rdx, 0x20(%rcx,%rax)
andl $0x0, 0x28(%rcx,%rax)
incq %rbx
jmp 0x21016
movq 0x38(%rsp), %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq