// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/go.c
// Function: random_go_moves
data random_go_moves(moves m, int n)
{
    data d = {0};
    d.X = make_matrix(n, 19*19*3);
    d.y = make_matrix(n, 19*19+2);
    int i, j;
    for(i = 0; i < n; ++i){
        float *board = d.X.vals[i];
        float *label = d.y.vals[i];
        char *b = m.data[rand()%m.n];
        int player = b[0] - '0';
        int result = b[1] - '0';
        int row = b[2];
        int col = b[3];
        string_to_board(b+4, board);
        if(player > 0) for(j = 0; j < 19*19; ++j) board[19*19*2 + j] = 1;
        label[19*19+1] = (player==result);
        if(row >= 19 || col >= 19){
            label[19*19] = 1;
        } else {
            label[col + 19*row] = 1;
            if(occupied(board, col + 19*row)) printf("hey\n");
        }

        int flip = rand()%2;
        int rotate = rand()%4;
        image in = float_to_image(19, 19, 3, board);
        image out = float_to_image(19, 19, 1, label);
        if(flip){
            flip_image(in);
            flip_image(out);
        }
        rotate_image_cw(in, rotate);
        rotate_image_cw(out, rotate);
    }
    return d;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0xa8(%rbp)
movq %rdi, %rax
movq %rax, -0xb0(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x8(%rbp)
movl %ecx, -0x14(%rbp)
xorl %esi, %esi
movl $0x40, %edx
callq 0x3190
movl -0x14(%rbp), %edi
movl $0x43b, %esi            # imm = 0x43B
callq 0x39450
movq -0xa8(%rbp), %rdi
movq %rax, -0x28(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x28(%rbp), %rax
movq %rax, 0x8(%rdi)
movq -0x20(%rbp), %rax
movq %rax, 0x10(%rdi)
movl -0x14(%rbp), %edi
movl $0x16b, %esi            # imm = 0x16B
callq 0x39450
movq -0xa8(%rbp), %rdi
movq %rax, -0x38(%rbp)
movq %rdx, -0x30(%rbp)
movq -0x38(%rbp), %rax
movq %rax, 0x18(%rdi)
movq -0x30(%rbp), %rax
movq %rax, 0x20(%rdi)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x58d46
movq -0xa8(%rbp), %rax
movq 0x10(%rax), %rcx
movslq -0x3c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq %rcx, -0x48(%rbp)
movq 0x20(%rax), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
callq 0x34b0
cltd
idivl -0x8(%rbp)
movq -0xb8(%rbp), %rax
movslq %edx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
movl %eax, -0x5c(%rbp)
movq -0x58(%rbp), %rax
movsbl 0x1(%rax), %eax
subl $0x30, %eax
movl %eax, -0x60(%rbp)
movq -0x58(%rbp), %rax
movsbl 0x2(%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x58(%rbp), %rax
movsbl 0x3(%rax), %eax
movl %eax, -0x68(%rbp)
movq -0x58(%rbp), %rdi
addq $0x4, %rdi
movq -0x48(%rbp), %rsi
callq 0x58810
cmpl $0x0, -0x5c(%rbp)
jle 0x58bbc
movl $0x0, -0x40(%rbp)
cmpl $0x169, -0x40(%rbp)     # imm = 0x169
jge 0x58bba
movq -0x48(%rbp), %rax
movl -0x40(%rbp), %ecx
addl $0x2d2, %ecx            # imm = 0x2D2
movslq %ecx, %rcx
movss 0x18462(%rip), %xmm0    # 0x7100c
movss %xmm0, (%rax,%rcx,4)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x58b89
jmp 0x58bbc
movl -0x5c(%rbp), %eax
cmpl -0x60(%rbp), %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
cvtsi2ss %eax, %xmm0
movq -0x50(%rbp), %rax
movss %xmm0, 0x5a8(%rax)
cmpl $0x13, -0x64(%rbp)
jge 0x58be6
cmpl $0x13, -0x68(%rbp)
jl 0x58bfc
movq -0x50(%rbp), %rax
movss 0x1841a(%rip), %xmm0    # 0x7100c
movss %xmm0, 0x5a4(%rax)
jmp 0x58c40
movq -0x50(%rbp), %rax
movl -0x68(%rbp), %ecx
imull $0x13, -0x64(%rbp), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movss 0x183f8(%rip), %xmm0    # 0x7100c
movss %xmm0, (%rax,%rcx,4)
movq -0x48(%rbp), %rdi
movl -0x68(%rbp), %esi
imull $0x13, -0x64(%rbp), %eax
addl %eax, %esi
callq 0x58d60
cmpl $0x0, %eax
je 0x58c3e
leaq 0x1cfa9(%rip), %rdi     # 0x75be0
movb $0x0, %al
callq 0x3130
jmp 0x58c40
callq 0x34b0
movl $0x2, %ecx
cltd
idivl %ecx
movl %edx, -0x6c(%rbp)
callq 0x34b0
movl $0x4, %ecx
cltd
idivl %ecx
movl %edx, -0x70(%rbp)
movq -0x48(%rbp), %r8
leaq -0x88(%rbp), %rdi
movl $0x13, %edx
movl $0x3, %ecx
movl %edx, %esi
callq 0xfbb0
movq -0x50(%rbp), %r8
leaq -0xa0(%rbp), %rdi
movl $0x13, %edx
movl $0x1, %ecx
movl %edx, %esi
callq 0xfbb0
cmpl $0x0, -0x6c(%rbp)
je 0x58ce8
leaq -0x88(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x104c0
leaq -0xa0(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x104c0
movl -0x70(%rbp), %edi
leaq -0x88(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x10240
movl -0x70(%rbp), %edi
leaq -0xa0(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x10240
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x58ae1
movq -0xb0(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)