// File: /workspace/github_c_makefile_star2_O3/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, %r14
movq %rdi, 0x20(%rsp)
leaq 0x24840(%rip), %rsi     # 0x550d8
movq %r14, %rdi
callq 0x3390
movq %rax, %r15
movl $0x3350f3, %edi         # imm = 0x3350F3
movl $0x169, %esi            # imm = 0x169
callq 0x311ee
movq %rax, %rbp
movq %rdx, %r12
movq %rax, 0x8(%rsp)
shrq $0x20, %rbp
movl $0x3350f3, %edi         # imm = 0x3350F3
movl $0x169, %esi            # imm = 0x169
callq 0x311ee
movq %rax, (%rsp)
movq %rdx, %rbx
testq %r15, %r15
jne 0x308e4
movq %r14, %rdi
callq 0xe925
movq %r15, %rdi
callq 0xe948
testq %rax, %rax
movq %r15, 0x10(%rsp)
je 0x30a05
movq %rax, %r14
xorl %r13d, %r13d
movl 0x8(%rsp), %eax
cmpq %rax, %r13
jne 0x30950
shlq $0x20, %rbp
orq %r13, %rbp
leal (,%r13,2), %r15d
movq %rbp, %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x31046
movq %rax, %rbp
movq %rdx, %r12
movq %rax, 0x8(%rsp)
shrq $0x20, %rbp
movq (%rsp), %rdi
movq %rbx, %rsi
movl %r15d, %edx
movq 0x10(%rsp), %r15
callq 0x31046
movq %rax, (%rsp)
movq %rdx, %rbx
movq %r14, %rdi
leaq 0x29cfc(%rip), %rsi     # 0x5a656
leaq 0x1c(%rsp), %rdx
leaq 0x18(%rsp), %rcx
xorl %eax, %eax
callq 0x3320
movq %r15, %rdi
callq 0xe948
movq %rax, %r15
movslq 0x1c(%rsp), %rax
leaq (%rax,%rax,8), %rcx
leaq (%rax,%rcx,2), %rax
movslq 0x18(%rsp), %rcx
addq %rax, %rcx
movq (%rbx,%r13,8), %rax
movl $0x3f800000, (%rax,%rcx,4) # imm = 0x3F800000
movq (%r12,%r13,8), %rax
xorl %ecx, %ecx
movss 0x248f0(%rip), %xmm2    # 0x55294
movss 0x2465c(%rip), %xmm3    # 0x55008
movb (%r15,%rcx), %dl
movaps %xmm2, %xmm0
cmpb $0x32, %dl
je 0x309bb
xorps %xmm0, %xmm0
movaps %xmm3, %xmm1
cmpb $0x31, %dl
je 0x309c6
movaps %xmm0, %xmm1
movss %xmm1, (%rax,%rcx,4)
incq %rcx
cmpq $0x169, %rcx            # imm = 0x169
jne 0x309ac
incq %r13
movq %r14, %rdi
callq 0x3040
movq %r15, %rdi
callq 0x3040
movq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0xe948
movq %rax, %r14
testq %rax, %rax
jne 0x30900
jmp 0x30a08
xorl %r13d, %r13d
shlq $0x20, %rbp
movl 0x8(%rsp), %edi
orq %rbp, %rdi
movq %r12, %rsi
movl %r13d, %edx
callq 0x31046
movq %rax, %r12
movq %rdx, %r14
movq (%rsp), %rdi
movq %rbx, %rsi
movl %r13d, %edx
callq 0x31046
xorps %xmm0, %xmm0
movq 0x20(%rsp), %r15
movups %xmm0, (%r15)
movups %xmm0, 0x10(%r15)
movups %xmm0, 0x20(%r15)
movups %xmm0, 0x30(%r15)
movq %r12, 0x8(%r15)
movq %r14, 0x10(%r15)
movq %rax, 0x18(%r15)
movq %rdx, 0x20(%r15)
movq 0x10(%rsp), %rdi
callq 0x3130
movq %r15, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq