// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %ecx, %ebx
movl %edx, 0x24(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdi, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
movl %ecx, %edi
movl $0x43b, %esi            # imm = 0x43B
callq 0x2f52e
movq %rax, 0x8(%r14)
movq %rdx, 0x40(%rsp)
movq %rdx, 0x10(%r14)
movl %ebx, %edi
movl $0x16b, %esi            # imm = 0x16B
callq 0x2f52e
movq %rax, 0x18(%r14)
movq %r14, 0x28(%rsp)
movq %rdx, 0x38(%rsp)
movq %rdx, 0x20(%r14)
testl %ebx, %ebx
jle 0x43585
movl %ebx, %eax
movq %rax, 0x30(%rsp)
xorl %r12d, %r12d
movq 0x40(%rsp), %rax
movq (%rax,%r12,8), %r14
movq 0x38(%rsp), %rax
movq (%rax,%r12,8), %rax
movq %rax, 0x50(%rsp)
callq 0x34f0
cltd
idivl 0x24(%rsp)
movslq %edx, %rax
movq 0x48(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
movb (%rdi), %r13b
movb 0x1(%rdi), %bpl
movsbq 0x2(%rdi), %r15
movsbq 0x3(%rdi), %rbx
addq $0x4, %rdi
movq %r14, %rsi
callq 0x43234
cmpb $0x31, %r13b
jl 0x4342b
xorl %eax, %eax
movl $0x3f800000, 0xb48(%r14,%rax,4) # imm = 0x3F800000
incq %rax
cmpq $0x169, %rax            # imm = 0x169
jne 0x43414
movss 0xfbd5(%rip), %xmm0     # 0x53008
cmpb %bpl, %r13b
je 0x4343b
xorps %xmm0, %xmm0
movq 0x50(%rsp), %rbp
movss %xmm0, 0x5a8(%rbp)
cmpb $0x13, %r15b
setge %al
cmpb $0x13, %bl
setge %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x43468
movl $0x3f800000, 0x5a4(%rbp) # imm = 0x3F800000
jmp 0x434af
leaq (%r15,%r15,8), %rax
leaq (%r15,%rax,2), %rax
addq %rbx, %rax
movl $0x3f800000, (%rbp,%rax,4) # imm = 0x3F800000
movss (%r14,%rax,4), %xmm0
ucomiss 0xfbf0(%rip), %xmm0     # 0x53078
jne 0x4348c
jnp 0x4349a
leaq 0x1546a(%rip), %rdi     # 0x588fd
callq 0x30c0
jmp 0x434af
movss 0x5a4(%r14,%rax,4), %xmm0
ucomiss 0xfbcd(%rip), %xmm0     # 0x53078
jne 0x4348c
jp 0x4348c
callq 0x34f0
movl %eax, %r15d
callq 0x34f0
movl %eax, %ebx
leal 0x3(%rbx), %r13d
testl %eax, %eax
cmovnsl %eax, %r13d
leaq 0x70(%rsp), %rdi
movl $0x13, %esi
movl $0x13, %edx
movl $0x3, %ecx
movq %r14, %r8
callq 0x1675b
leaq 0x58(%rsp), %rdi
movl $0x13, %esi
movl $0x13, %edx
movl $0x1, %ecx
movq %rbp, %r8
callq 0x1675b
testb $0x1, %r15b
je 0x43539
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x70(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x16f91
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x16f91
andl $-0x4, %r13d
subl %r13d, %ebx
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x70(%rsp), %xmm0
movups %xmm0, (%rsp)
movl %ebx, %edi
callq 0x16d91
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
movl %ebx, %edi
callq 0x16d91
incq %r12
cmpq 0x30(%rsp), %r12
jne 0x433c2
movq 0x28(%rsp), %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq