// File: /workspace/github_c_makefile_star2_O1/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, %r12d
movl %edi, %ebp
imull %edi, %edi
movl $0x40, %esi
movq %rdi, %r14
callq 0x3260
movq %rax, 0x48(%rsp)
movl %ebp, 0x20(%rsp)
testl %ebp, %ebp
je 0x2e3e4
leaq 0x100(%rsp), %r9
movl (%r9), %esi
movl 0x4(%r9), %r10d
movl %esi, %eax
cltd
movl 0x20(%rsp), %edi
idivl %edi
movl %eax, %ecx
movl %eax, %r8d
imull %r12d, %r8d
movl %r10d, %eax
cltd
idivl %edi
imull %eax, %r12d
movl 0x8(%r9), %edi
movl %r8d, %edx
imull %r12d, %edx
leal (%rdx,%rdx,2), %edx
movl %edx, 0x44(%rsp)
movslq %edi, %rdx
movq %rdx, 0x78(%rsp)
movq 0x18(%r9), %rdx
movq %rdx, 0x70(%rsp)
movq 0x20(%r9), %rdx
movq %rdx, 0x68(%rsp)
movl %r8d, %edx
subl %ecx, %edx
movl %edx, %ecx
shrl $0x1f, %ecx
addl %edx, %ecx
sarl %ecx
negl %ecx
movl %ecx, 0x40(%rsp)
movl %r12d, %ecx
subl %eax, %ecx
movl %ecx, %eax
shrl $0x1f, %eax
addl %ecx, %eax
sarl %eax
negl %eax
movl %eax, 0x3c(%rsp)
cmpl $0x1, %r14d
adcl $0x0, %r14d
movq %r14, 0x80(%rsp)
movq 0x10(%r9), %rax
movq %rax, 0x60(%rsp)
movq $0x0, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movq %rdi, 0x50(%rsp)
movl %r8d, 0x28(%rsp)
movl %r10d, 0x24(%rsp)
movq 0x60(%rsp), %r13
movl $0x8, %esi
movq 0x78(%rsp), %r14
movq %r14, %rdi
callq 0x3260
movq %rax, 0x58(%rsp)
movq 0x70(%rsp), %rdi
movq 0x68(%rsp), %rsi
callq 0x2f4a1
movl 0x24(%rsp), %r10d
movl 0x2c(%rsp), %esi
movq %rax, 0x90(%rsp)
movq %rdx, 0x88(%rsp)
testl %r14d, %r14d
leaq 0x98(%rsp), %r15
jle 0x2e371
movq 0x30(%rsp), %rax
cltd
movl 0x20(%rsp), %r8d
idivl %r8d
movl %eax, %ecx
movl %edx, %eax
imull %esi, %eax
cltd
idivl %r8d
movl %eax, %ebp
addl 0x40(%rsp), %ebp
imull %r10d, %ecx
movl %ecx, %eax
cltd
idivl %r8d
movl %eax, %ebx
addl 0x3c(%rsp), %ebx
xorl %r14d, %r14d
movq (%r13,%r14,8), %r8
movq %r15, %rdi
movl %r10d, %edx
movl $0x3, %ecx
callq 0x1675b
movq 0xa8(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x98(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0xb0(%rsp), %rdi
movl %ebp, %esi
movl %ebx, %edx
movl 0x28(%rsp), %ecx
movl %r12d, %r8d
callq 0x181f7
movl 0x24(%rsp), %r10d
movl 0x2c(%rsp), %esi
movq 0xc0(%rsp), %rax
movq 0x58(%rsp), %rcx
movq %rax, (%rcx,%r14,8)
incq %r14
cmpq %r14, 0x50(%rsp)
jne 0x2e307
movq 0x30(%rsp), %rdi
movq %rdi, %rax
shlq $0x6, %rax
movq 0x48(%rsp), %rcx
movl 0x28(%rsp), %r8d
movl %r8d, (%rcx,%rax)
movl %r12d, 0x4(%rcx,%rax)
movq 0x50(%rsp), %r9
movl %r9d, 0x8(%rcx,%rax)
movl 0x44(%rsp), %edx
movl %edx, 0xc(%rcx,%rax)
movq 0x58(%rsp), %rdx
movq %rdx, 0x10(%rcx,%rax)
movq 0x90(%rsp), %rdx
movq %rdx, 0x18(%rcx,%rax)
movq 0x88(%rsp), %rdx
movq %rdx, 0x20(%rcx,%rax)
movl $0x0, 0x28(%rcx,%rax)
incq %rdi
movq %rdi, 0x30(%rsp)
cmpq 0x80(%rsp), %rdi
jne 0x2e285
movq 0x48(%rsp), %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq