// File: /workspace/github_c_makefile_star2_O2/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 0x2a793(%rip), %rsi     # 0x4c0b0
movq %rbx, %rdi
callq 0x3390
movq %rax, %r14
movl $0x3350f3, %edi         # imm = 0x3350F3
movl $0x169, %esi            # imm = 0x169
callq 0x221e3
movq %rax, %rbp
movq %rdx, %r13
movq %rax, 0x18(%rsp)
shrq $0x20, %rbp
movl $0x3350f3, %edi         # imm = 0x3350F3
movl $0x169, %esi            # imm = 0x169
callq 0x221e3
movq %rax, (%rsp)
movq %rdx, %r12
movq %r14, 0x8(%rsp)
testq %r14, %r14
jne 0x2196e
movq %rbx, %rdi
callq 0x3d0f
xorl %ebx, %ebx
movq 0x8(%rsp), %rdi
callq 0x3d32
movl 0x18(%rsp), %edi
testq %rax, %rax
je 0x21a6d
movq %rax, %r14
cmpq %rdi, %rbx
jne 0x219cd
shlq $0x20, %rbp
orq %rbx, %rbp
leal (%rbx,%rbx), %r15d
movq %rbp, %rdi
movq %r13, %rsi
movl %r15d, %edx
callq 0x22023
movq %rax, %rbp
movq %rdx, %r13
movq %rax, 0x18(%rsp)
shrq $0x20, %rbp
movq (%rsp), %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x22023
movq %rax, (%rsp)
movq %rdx, %r12
movq %r14, %rdi
leaq 0x2fb37(%rip), %rsi     # 0x5150e
leaq 0x14(%rsp), %rdx
leaq 0x10(%rsp), %rcx
xorl %eax, %eax
callq 0x3320
movq 0x8(%rsp), %rdi
callq 0x3d32
movq %rax, %r15
movslq 0x14(%rsp), %rax
imulq $0x13, %rax, %rax
movslq 0x10(%rsp), %rcx
addq %rax, %rcx
movq (%r12,%rbx,8), %rax
movl $0x3f800000, (%rax,%rcx,4) # imm = 0x3F800000
movq (%r13,%rbx,8), %rax
xorl %ecx, %ecx
movss 0x2a844(%rip), %xmm2    # 0x4c264
movss 0x2a5e0(%rip), %xmm3    # 0x4c008
cmpq $0x169, %rcx            # imm = 0x169
je 0x21a55
movb (%r15,%rcx), %dl
movaps %xmm2, %xmm0
cmpb $0x32, %dl
je 0x21a40
xorps %xmm0, %xmm0
movaps %xmm3, %xmm1
cmpb $0x31, %dl
je 0x21a4b
movaps %xmm0, %xmm1
movss %xmm1, (%rax,%rcx,4)
incq %rcx
jmp 0x21a28
incq %rbx
movq %r14, %rdi
callq 0x3040
movq %r15, %rdi
callq 0x3040
jmp 0x21970
shlq $0x20, %rbp
orq %rbp, %rdi
movq %r13, %rsi
movl %ebx, %edx
callq 0x22023
movq %rax, %r14
movq %rdx, %r15
movq (%rsp), %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0x22023
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 %r15, 0x10(%rbx)
movq %rax, 0x18(%rbx)
movq %rdx, 0x20(%rbx)
movq 0x8(%rsp), %rdi
callq 0x3130
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq