// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: split_data
data *split_data(data d, int part, int total)
{
    data *split = calloc(2, sizeof(data));
    int i;
    int start = part*d.X.rows/total;
    int end = (part+1)*d.X.rows/total;
    data train;
    data test;
    train.shallow = test.shallow = 1;

    test.X.rows = test.y.rows = end-start;
    train.X.rows = train.y.rows = d.X.rows - (end-start);
    train.X.cols = test.X.cols = d.X.cols;
    train.y.cols = test.y.cols = d.y.cols;

    train.X.vals = calloc(train.X.rows, sizeof(float*));
    test.X.vals = calloc(test.X.rows, sizeof(float*));
    train.y.vals = calloc(train.y.rows, sizeof(float*));
    test.y.vals = calloc(test.y.rows, sizeof(float*));

    for(i = 0; i < start; ++i){
        train.X.vals[i] = d.X.vals[i];
        train.y.vals[i] = d.y.vals[i];
    }
    for(i = start; i < end; ++i){
        test.X.vals[i-start] = d.X.vals[i];
        test.y.vals[i-start] = d.y.vals[i];
    }
    for(i = end; i < d.X.rows; ++i){
        train.X.vals[i-(end-start)] = d.X.vals[i];
        train.y.vals[i-(end-start)] = d.y.vals[i];
    }
    split[0] = train;
    split[1] = test;
    return split;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl $0x2, %edi
movl $0x40, %esi
callq 0x3220
movq -0xa8(%rbp), %rcx
movq %rax, -0x10(%rbp)
movl -0x4(%rbp), %eax
imull 0x8(%rcx), %eax
cltd
idivl -0x8(%rbp)
movl %eax, -0x18(%rbp)
movl -0x4(%rbp), %eax
addl $0x1, %eax
imull 0x8(%rcx), %eax
cltd
idivl -0x8(%rbp)
movl %eax, %ecx
movq -0xa8(%rbp), %rax
movl %ecx, -0x1c(%rbp)
movl $0x1, -0x78(%rbp)
movl $0x1, -0x38(%rbp)
movl -0x1c(%rbp), %ecx
subl -0x18(%rbp), %ecx
movl %ecx, -0x88(%rbp)
movl %ecx, -0x98(%rbp)
movl 0x8(%rax), %ecx
movl -0x1c(%rbp), %edx
subl -0x18(%rbp), %edx
subl %edx, %ecx
movl %ecx, -0x48(%rbp)
movl %ecx, -0x58(%rbp)
movl 0xc(%rax), %ecx
movl %ecx, -0x94(%rbp)
movl %ecx, -0x54(%rbp)
movl 0x1c(%rax), %eax
movl %eax, -0x84(%rbp)
movl %eax, -0x44(%rbp)
movslq -0x58(%rbp), %rdi
movl $0x8, %esi
callq 0x3220
movq %rax, -0x50(%rbp)
movslq -0x98(%rbp), %rdi
movl $0x8, %esi
callq 0x3220
movq %rax, -0x90(%rbp)
movslq -0x48(%rbp), %rdi
movl $0x8, %esi
callq 0x3220
movq %rax, -0x40(%rbp)
movslq -0x88(%rbp), %rdi
movl $0x8, %esi
callq 0x3220
movq %rax, -0x80(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x38f29
movq -0xa8(%rbp), %rax
movq 0x10(%rax), %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rsi
movq -0x50(%rbp), %rcx
movslq -0x14(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movq 0x20(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x40(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x38edf
movl -0x18(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x38f86
movq -0xa8(%rbp), %rax
movq 0x10(%rax), %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rsi
movq -0x90(%rbp), %rcx
movl -0x14(%rbp), %edx
subl -0x18(%rbp), %edx
movslq %edx, %rdx
movq %rsi, (%rcx,%rdx,8)
movq 0x20(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x80(%rbp), %rax
movl -0x14(%rbp), %ecx
subl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x38f2f
movl -0x1c(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0xa8(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x8(%rcx), %eax
jge 0x38ff1
movq -0xa8(%rbp), %rax
movq 0x10(%rax), %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rsi
movq -0x50(%rbp), %rcx
movl -0x14(%rbp), %edx
movl -0x1c(%rbp), %edi
subl -0x18(%rbp), %edi
subl %edi, %edx
movslq %edx, %rdx
movq %rsi, (%rcx,%rdx,8)
movq 0x20(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x40(%rbp), %rax
movl -0x14(%rbp), %ecx
movl -0x1c(%rbp), %esi
subl -0x18(%rbp), %esi
subl %esi, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x38f8c
movq -0x10(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x40, %edx
callq 0x3280
movq -0x10(%rbp), %rdi
addq $0x40, %rdi
leaq -0xa0(%rbp), %rsi
movl $0x40, %edx
callq 0x3280
movq -0x10(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax)