// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %r14d
movl %edi, %r15d
leaq 0x50(%rsp), %r12
movl $0x2, %edi
movl $0x40, %esi
callq 0x3260
movq %rax, %rbx
movslq 0x8(%r12), %rbp
movl %ebp, %eax
imull %r15d, %eax
cltd
idivl %r14d
movl %eax, %ecx
movl %eax, (%rsp)
incl %r15d
imull %ebp, %r15d
movl %r15d, %eax
cltd
idivl %r14d
movl %eax, 0x4(%rsp)
movl %eax, %r15d
subl %ecx, %r15d
movl %ebp, %ecx
subl %r15d, %ecx
movl 0xc(%r12), %eax
movl %eax, 0xc(%rsp)
movl 0x1c(%r12), %eax
movl %eax, 0x10(%rsp)
movl %ecx, 0x8(%rsp)
movslq %ecx, %r12
movl $0x8, %esi
movq %r12, %rdi
callq 0x3260
movq %rax, %r14
movl %r15d, 0x14(%rsp)
movslq %r15d, %r13
movl $0x8, %esi
movq %r13, %rdi
callq 0x3260
movq %rax, %r15
movl $0x8, %esi
movq %r12, %rdi
callq 0x3260
movq %rax, %r12
movl $0x8, %esi
movq %r13, %rdi
callq 0x3260
movl (%rsp), %r10d
leaq 0x50(%rsp), %r9
testl %r10d, %r10d
jle 0x2f139
movq 0x10(%r9), %rcx
movq 0x20(%r9), %rdx
movl %r10d, %esi
xorl %edi, %edi
movq (%rcx,%rdi,8), %r8
movq %r8, (%r14,%rdi,8)
movq (%rdx,%rdi,8), %r8
movq %r8, (%r12,%rdi,8)
incq %rdi
cmpq %rdi, %rsi
jne 0x2f121
movl 0x4(%rsp), %r11d
cmpl %r10d, %r11d
jle 0x2f179
movslq %r10d, %rdi
movslq %r11d, %rcx
leaq (,%rdi,8), %rdx
movq 0x10(%r9), %rsi
addq %rdx, %rsi
addq 0x20(%r9), %rdx
subq %rdi, %rcx
xorl %edi, %edi
movq (%rsi,%rdi,8), %r8
movq %r8, (%r15,%rdi,8)
movq (%rdx,%rdi,8), %r8
movq %r8, (%rax,%rdi,8)
incq %rdi
cmpq %rdi, %rcx
jne 0x2f161
cmpl %ebp, %r11d
jge 0x2f1bd
movslq %r11d, %r8
movslq %r10d, %rdx
leaq (%r14,%rdx,8), %rcx
leaq (%r12,%rdx,8), %rdx
leaq (,%r8,8), %rsi
movq 0x10(%r9), %rdi
addq %rsi, %rdi
addq 0x20(%r9), %rsi
subq %r8, %rbp
xorl %r8d, %r8d
movq (%rdi,%r8,8), %r9
movq %r9, (%rcx,%r8,8)
movq (%rsi,%r8,8), %r9
movq %r9, (%rdx,%r8,8)
incq %r8
cmpq %r8, %rbp
jne 0x2f1a5
movl 0x8(%rsp), %ecx
movl %ecx, 0x8(%rbx)
movl 0xc(%rsp), %edi
movl %edi, 0xc(%rbx)
movq %r14, 0x10(%rbx)
movl %ecx, 0x18(%rbx)
movl 0x10(%rsp), %esi
movl %esi, 0x1c(%rbx)
movq %r12, 0x20(%rbx)
movl $0x1, %ecx
movl %ecx, 0x28(%rbx)
movl 0x14(%rsp), %edx
movl %edx, 0x48(%rbx)
movl %edi, 0x4c(%rbx)
movq %r15, 0x50(%rbx)
movl %edx, 0x58(%rbx)
movl %esi, 0x5c(%rbx)
movq %rax, 0x60(%rbx)
movl %ecx, 0x68(%rbx)
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop