// File: /workspace/github_c_makefile_star2_O3/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 $0x98, %rsp
movl %ecx, %ebx
movl %edx, 0x24(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdi, %r14
pxor %xmm0, %xmm0
movdqu %xmm0, 0x30(%rdi)
movdqu %xmm0, 0x20(%rdi)
movdqu %xmm0, 0x10(%rdi)
movdqu %xmm0, (%rdi)
movl %ecx, %edi
movl $0x43b, %esi            # imm = 0x43B
callq 0x311ee
movq %rax, 0x8(%r14)
movq %rdx, 0x40(%rsp)
movq %rdx, 0x10(%r14)
movl %ebx, %edi
movl $0x16b, %esi            # imm = 0x16B
callq 0x311ee
movq %rax, 0x18(%r14)
movq %r14, 0x28(%rsp)
movq %rdx, 0x38(%rsp)
movq %rdx, 0x20(%r14)
testl %ebx, %ebx
jle 0x45842
movl %ebx, %eax
movq %rax, 0x30(%rsp)
xorl %r12d, %r12d
pshufd $0xf5, 0x14e78(%rip), %xmm0 # xmm0 = mem[1,1,3,3]
movdqa %xmm0, 0x80(%rsp)
movq 0x40(%rsp), %rax
movq (%rax,%r12,8), %r14
movq 0x38(%rsp), %rax
movq (%rax,%r12,8), %rbp
callq 0x34e0
cltd
idivl 0x24(%rsp)
movslq %edx, %rax
movq 0x48(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
movb (%rdi), %r13b
movb 0x1(%rdi), %al
movb %al, 0x23(%rsp)
movsbq 0x2(%rdi), %r15
movsbq 0x3(%rdi), %rbx
addq $0x4, %rdi
movq %r14, %rsi
callq 0x4541c
cmpb $0x31, %r13b
movdqa 0xfa7b(%rip), %xmm4     # 0x55090
movdqa 0x14e13(%rip), %xmm5    # 0x5a430
movdqa 0x80(%rsp), %xmm6
movdqa 0xfb52(%rip), %xmm7     # 0x55180
jl 0x456ef
xorl %eax, %eax
movdqa 0xfa42(%rip), %xmm0     # 0x55080
movdqa 0xfb2a(%rip), %xmm1     # 0x55170
movdqa %xmm0, %xmm2
pxor %xmm4, %xmm2
movdqa %xmm5, %xmm3
pcmpgtd %xmm2, %xmm3
pshufd $0xf5, %xmm2, %xmm2     # xmm2 = xmm2[1,1,3,3]
pcmpeqd %xmm6, %xmm2
pand %xmm3, %xmm2
movd %xmm2, %ecx
testb $0x1, %cl
je 0x45678
movl $0x3f800000, 0xb48(%r14,%rax,4) # imm = 0x3F800000
pextrw $0x4, %xmm2, %ecx
testb $0x1, %cl
je 0x4568e
movl $0x3f800000, 0xb4c(%r14,%rax,4) # imm = 0x3F800000
movdqa %xmm1, %xmm2
pxor %xmm4, %xmm2
movdqa %xmm5, %xmm3
pcmpgtd %xmm2, %xmm3
pshufd $0xf5, %xmm2, %xmm2     # xmm2 = xmm2[1,1,3,3]
pcmpeqd %xmm6, %xmm2
pand %xmm3, %xmm2
pextrw $0x0, %xmm2, %ecx
testb $0x1, %cl
je 0x456c1
movl $0x3f800000, 0xb50(%r14,%rax,4) # imm = 0x3F800000
pextrw $0x4, %xmm2, %ecx
testb $0x1, %cl
je 0x456d7
movl $0x3f800000, 0xb54(%r14,%rax,4) # imm = 0x3F800000
addq $0x4, %rax
paddq %xmm7, %xmm0
paddq %xmm7, %xmm1
cmpq $0x16c, %rax            # imm = 0x16C
jne 0x45646
movss 0xf911(%rip), %xmm0     # 0x55008
cmpb 0x23(%rsp), %r13b
je 0x45701
xorps %xmm0, %xmm0
movss %xmm0, 0x5a8(%rbp)
cmpb $0x13, %r15b
setge %al
cmpb $0x13, %bl
setge %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x45729
movl $0x3f800000, 0x5a4(%rbp) # imm = 0x3F800000
jmp 0x45770
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 0xf957(%rip), %xmm0     # 0x550a0
jne 0x4574d
jnp 0x4575b
leaq 0x15301(%rip), %rdi     # 0x5aa55
callq 0x30b0
jmp 0x45770
movss 0x5a4(%r14,%rax,4), %xmm0
ucomiss 0xf934(%rip), %xmm0     # 0x550a0
jne 0x4574d
jp 0x4574d
callq 0x34e0
movl %eax, %r15d
callq 0x34e0
movl %eax, %ebx
leal 0x3(%rbx), %r13d
testl %eax, %eax
cmovnsl %eax, %r13d
leaq 0x68(%rsp), %rdi
movl $0x13, %esi
movl $0x13, %edx
movl $0x3, %ecx
movq %r14, %r8
callq 0x170ea
leaq 0x50(%rsp), %rdi
movl $0x13, %esi
movl $0x13, %edx
movl $0x1, %ecx
movq %rbp, %r8
callq 0x170ea
testb $0x1, %r15b
je 0x457f7
movq 0x78(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x68(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x1786a
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x1786a
andl $-0x4, %r13d
subl %r13d, %ebx
movq 0x78(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x68(%rsp), %xmm0
movups %xmm0, (%rsp)
movl %ebx, %edi
callq 0x1766f
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movdqu 0x50(%rsp), %xmm0
movdqu %xmm0, (%rsp)
movl %ebx, %edi
callq 0x1766f
incq %r12
cmpq 0x30(%rsp), %r12
jne 0x455c1
movq 0x28(%rsp), %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq