// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: load_go
data load_go(char *filename)
{
    FILE *fp = fopen(filename, "rb");
    matrix X = make_matrix(3363059, 361);
    matrix y = make_matrix(3363059, 361);
    int row, col;

    if(!fp) file_error(filename);
    char *label;
    int count = 0;
    while((label = fgetl(fp))){
        int i;
        if(count == X.rows){
            X = resize_matrix(X, count*2);
            y = resize_matrix(y, count*2);
        }
        sscanf(label, "%d %d", &row, &col);
        char *board = fgetl(fp);

        int index = row*19 + col;
        y.vals[count][index] = 1;

        for(i = 0; i < 19*19; ++i){
            float val = 0;
            if(board[i] == '1') val = 1;
            else if(board[i] == '2') val = -1;
            X.vals[count][i] = val;
        }
        ++count;
        free(label);
        free(board);
    }
    X = resize_matrix(X, count);
    y = resize_matrix(y, count);

    data d = {0};
    d.shallow = 0;
    d.X = X;
    d.y = y;


    fclose(fp);

    return d;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, 0x20(%rsp)
leaq 0x24502(%rip), %rsi     # 0x530b0
movq %rbx, %rdi
callq 0x33a0
movq %rax, %r14
movl $0x3350f3, %edi         # imm = 0x3350F3
movl $0x169, %esi            # imm = 0x169
callq 0x2f52e
movq %rax, %rbp
movq %rdx, %r12
movq %rax, 0x8(%rsp)
shrq $0x20, %rbp
movl $0x3350f3, %edi         # imm = 0x3350F3
movl $0x169, %esi            # imm = 0x169
callq 0x2f52e
movq %rax, (%rsp)
movq %rdx, %r15
testq %r14, %r14
jne 0x2ebfa
movq %rbx, %rdi
callq 0xe142
movq %r14, %rdi
callq 0xe165
testq %rax, %rax
movq %r14, 0x10(%rsp)
je 0x2ed13
movq %rax, %r13
xorl %ebx, %ebx
movl 0x8(%rsp), %edi
cmpq %rdi, %rbx
jne 0x2ec5e
shlq $0x20, %rbp
orq %rbp, %rdi
leal (%rbx,%rbx), %r14d
movq %r12, %rsi
movl %r14d, %edx
callq 0x2f389
movq %rax, %rbp
movq %rdx, %r12
movq %rax, 0x8(%rsp)
shrq $0x20, %rbp
movq (%rsp), %rdi
movq %r15, %rsi
movl %r14d, %edx
movq 0x10(%rsp), %r14
callq 0x2f389
movq %rax, (%rsp)
movq %rdx, %r15
movq %r13, %rdi
leaq 0x29896(%rip), %rsi     # 0x584fe
leaq 0x1c(%rsp), %rdx
leaq 0x18(%rsp), %rcx
xorl %eax, %eax
callq 0x3330
movq %r14, %rdi
callq 0xe165
movq %rax, %r14
movslq 0x1c(%rsp), %rax
leaq (%rax,%rax,8), %rcx
leaq (%rax,%rcx,2), %rax
movslq 0x18(%rsp), %rcx
addq %rax, %rcx
movq (%r15,%rbx,8), %rax
movl $0x3f800000, (%rax,%rcx,4) # imm = 0x3F800000
movq (%r12,%rbx,8), %rax
xorl %ecx, %ecx
movss 0x245b6(%rip), %xmm2    # 0x53268
movss 0x2434e(%rip), %xmm3    # 0x53008
movb (%r14,%rcx), %dl
movaps %xmm2, %xmm0
cmpb $0x32, %dl
je 0x2ecc9
xorps %xmm0, %xmm0
movaps %xmm3, %xmm1
cmpb $0x31, %dl
je 0x2ecd4
movaps %xmm0, %xmm1
movss %xmm1, (%rax,%rcx,4)
incq %rcx
cmpq $0x169, %rcx            # imm = 0x169
jne 0x2ecba
incq %rbx
movq %r13, %rdi
callq 0x3040
movq %r14, %rdi
callq 0x3040
movq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0xe165
movq %rax, %r13
testq %rax, %rax
jne 0x2ec15
jmp 0x2ed15
xorl %ebx, %ebx
shlq $0x20, %rbp
movl 0x8(%rsp), %edi
orq %rbp, %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0x2f389
movq %rax, %r14
movq %rdx, %r12
movq (%rsp), %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x2f389
xorps %xmm0, %xmm0
movq 0x20(%rsp), %rbx
movups %xmm0, (%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x30(%rbx)
movq %r14, 0x8(%rbx)
movq %r12, 0x10(%rbx)
movq %rax, 0x18(%rbx)
movq %rdx, 0x20(%rbx)
movq 0x10(%rsp), %rdi
callq 0x3140
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq