// File: /workspace/github_c_makefile_star2_O2/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, 0x40(%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 0x221e3
movq %rax, 0x8(%r14)
movq %rdx, 0x38(%rsp)
movq %rdx, 0x10(%r14)
movl %ebx, %edi
movl $0x16b, %esi            # imm = 0x16B
callq 0x221e3
movq %rax, 0x18(%r14)
movq %r14, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rdx, 0x20(%r14)
xorl %ecx, %ecx
testl %ebx, %ebx
cmovlel %ecx, %ebx
movq %rbx, 0x48(%rsp)
cmpq 0x48(%rsp), %rcx
je 0x39c2e
movq 0x38(%rsp), %rax
movq (%rax,%rcx,8), %r15
movq 0x30(%rsp), %rax
movq %rcx, 0x50(%rsp)
movq (%rax,%rcx,8), %rbp
callq 0x34e0
cltd
idivl 0x24(%rsp)
movslq %edx, %rax
movq 0x40(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
movb (%rdi), %r14b
movb 0x1(%rdi), %bl
movsbq 0x2(%rdi), %r13
movsbq 0x3(%rdi), %r12
addq $0x4, %rdi
movq %r15, %rsi
callq 0x398fd
cmpb $0x31, %r14b
jl 0x39af2
xorl %eax, %eax
cmpq $0x169, %rax            # imm = 0x169
je 0x39af2
movl $0x3f800000, 0xb48(%r15,%rax,4) # imm = 0x3F800000
incq %rax
jmp 0x39ad9
movss 0x1250e(%rip), %xmm0    # 0x4c008
cmpb %bl, %r14b
je 0x39b02
xorps %xmm0, %xmm0
movss %xmm0, 0x5a8(%rbp)
cmpb $0x13, %r13b
setge %al
cmpb $0x13, %r12b
setge %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x39b2b
movl $0x3f800000, 0x5a4(%rbp) # imm = 0x3F800000
jmp 0x39b6e
imulq $0x13, %r13, %rax
addq %r12, %rax
movl $0x3f800000, (%rbp,%rax,4) # imm = 0x3F800000
movss (%r15,%rax,4), %xmm0
ucomiss 0x12531(%rip), %xmm0    # 0x4c078
jne 0x39b4b
jnp 0x39b59
leaq 0x17dbb(%rip), %rdi     # 0x5190d
callq 0x30b0
jmp 0x39b6e
movss 0x5a4(%r15,%rax,4), %xmm0
ucomiss 0x1250e(%rip), %xmm0    # 0x4c078
jne 0x39b4b
jp 0x39b4b
callq 0x34e0
movl %eax, %r13d
callq 0x34e0
cltd
pushq $0x4
popq %rcx
idivl %ecx
movl %edx, %r12d
leaq 0x70(%rsp), %rdi
pushq $0x13
popq %rbx
movl %ebx, %esi
movl %ebx, %edx
pushq $0x3
popq %rcx
movq %r15, %r8
callq 0xc3de
leaq 0x58(%rsp), %rdi
movl %ebx, %esi
movl %ebx, %edx
pushq $0x1
popq %rcx
movq %rbp, %r8
callq 0xc3de
testb $0x1, %r13b
je 0x39be8
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x70(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xcb93
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xcb93
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x70(%rsp), %xmm0
movups %xmm0, (%rsp)
movl %r12d, %edi
callq 0xc9b3
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
movl %r12d, %edi
callq 0xc9b3
movq 0x50(%rsp), %rcx
incq %rcx
jmp 0x39a7d
movq 0x28(%rsp), %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq