// File: /workspace/github_cpp_makefile_star2_O3/kobanium[P]Ray/src/board/GoBoard.cpp
// Function: InitializeConst()
void
InitializeConst( void )
{
  int i;

  komi[0] = default_komi;
  komi[S_BLACK] = default_komi + 1.0;
  komi[S_WHITE] = default_komi - 1.0;

  i = 0;
  for (int y = board_start; y <= board_end; y++) {
    for (int x = board_start; x <= board_end; x++) {
      onboard_pos[i++] = POS(x, y);
      board_x[POS(x, y)] = x;
      board_y[POS(x, y)] = y;
    }
  }

  for (int y = board_start; y <= board_end; y++) {
    for (int x = board_start; x <= (board_start + pure_board_size / 2); x++) {
      border_dis_x[POS(x, y)] = x - (OB_SIZE - 1);
      border_dis_x[POS(board_end + OB_SIZE - x, y)] = x - (OB_SIZE - 1);
      border_dis_y[POS(y, x)] = x - (OB_SIZE - 1);
      border_dis_y[POS(y, board_end + OB_SIZE - x)] = x - (OB_SIZE - 1);
    }
  }

  for (int y = 0; y < pure_board_size; y++) {
    for (int x = 0; x < pure_board_size; x++) {
      move_dis[x][y] = x + y + ((x > y) ? x : y);
      if (move_dis[x][y] >= MOVE_DISTANCE_MAX) move_dis[x][y] = MOVE_DISTANCE_MAX - 1;
    }
  }

  std::fill_n(board_pos_id, BOARD_MAX, 0);
  i = 1;
  for (int y = board_start; y <= (board_start + pure_board_size / 2); y++) {
    for (int x = board_start; x <= y; x++) {
      board_pos_id[POS(x, y)] = i;
      board_pos_id[POS(board_end + OB_SIZE - x, y)] = i;
      board_pos_id[POS(y, x)] = i;
      board_pos_id[POS(y, board_end + OB_SIZE - x)] = i;
      board_pos_id[POS(x, board_end + OB_SIZE - y)] = i;
      board_pos_id[POS(board_end + OB_SIZE - x, board_end + OB_SIZE - y)] = i;
      board_pos_id[POS(board_end + OB_SIZE - y, x)] = i;
      board_pos_id[POS(board_end + OB_SIZE - y, board_end + OB_SIZE - x)] = i;
      i++;
    }
  }

  first_move_candidates = 0;
  for (int y = board_start; y <= (board_start + board_end) / 2; y++) {
    for (int x = board_end + board_start - y; x <= board_end; x++) {
      first_move_candidate[first_move_candidates++] = POS(x, y);
    }
  }

  cross[0] = - board_size - 1;
  cross[1] = - board_size + 1;
  cross[2] = board_size - 1;
  cross[3] = board_size + 1;

  corner[0] = POS(board_start, board_start);
  corner[1] = POS(board_start, board_end);
  corner[2] = POS(board_end, board_start);
  corner[3] = POS(board_end, board_end);

  corner_neighbor[0][0] =  EAST(POS(board_start, board_start));
  corner_neighbor[0][1] = SOUTH(POS(board_start, board_start));
  corner_neighbor[1][0] = NORTH(POS(board_start, board_end));
  corner_neighbor[1][1] =  EAST(POS(board_start, board_end));
  corner_neighbor[2][0] =  WEST(POS(board_end, board_start));
  corner_neighbor[2][1] = SOUTH(POS(board_end, board_start));
  corner_neighbor[3][0] = NORTH(POS(board_end, board_end));
  corner_neighbor[3][1] =  WEST(POS(board_end, board_end));

  InitializeNeighbor();
  InitializeEye();
  InitializeTerritory();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movsd 0x21d3f(%rip), %xmm0    # 0x768c8
movsd %xmm0, 0x1aab837f(%rip) # 0x1ab0cf10
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
addpd 0xc2d3(%rip), %xmm0     # 0x60e70
movupd %xmm0, 0x1aab8373(%rip) # 0x1ab0cf18
movl 0x21d14(%rip), %r13d    # 0x768c0
movslq %r13d, %rbx
movl 0x21d0f(%rip), %eax     # 0x768c4
cmpl %eax, %ebx
movq %rax, 0x50(%rsp)
movq %r13, 0x48(%rsp)
movq %rbx, 0x28(%rsp)
jle 0x54bd4
movl 0x21ce5(%rip), %r15d    # 0x768b4
jmp 0x54d55
movl 0x21ce2(%rip), %ecx     # 0x768bc
leal 0x1(%rax), %edx
movl %edx, 0x8(%rsp)
movslq %ecx, %rdx
leaq 0x1(%rdx), %r8
imulq %rbx, %r8
leaq 0x1aab908d(%rip), %rsi  # 0x1ab0dc80
leaq (%rsi,%r8,4), %rsi
leaq (,%rdx,4), %rdi
leaq 0x1aab9daa(%rip), %r9   # 0x1ab0e9b0
leaq (%r9,%r8,4), %r8
incl %edx
imull %r13d, %edx
movl %eax, %r9d
notl %r9d
addq %r13, %r9
xorl %r10d, %r10d
leaq 0x1ab0cacd(%rip), %r11  # 0x1ab616f0
movslq %r10d, %r10
leaq (,%r10,4), %r15
xorl %r14d, %r14d
leal (%rdx,%r14), %ebp
leaq (%r15,%r14,4), %r12
movl %ebp, (%r11,%r12)
leal (%r14,%r13), %ebp
movl %ebp, (%rsi,%r14,4)
movl %ebx, (%r8,%r14,4)
incq %r14
movl %r9d, %ebp
addl %r14d, %ebp
jne 0x54c31
incq %rbx
addq %r14, %r10
addq %rdi, %rsi
addq %rdi, %r8
addq %rcx, %rdx
cmpl %ebx, 0x8(%rsp)
jne 0x54c23
movl 0x21c44(%rip), %r15d    # 0x768b4
cmpl %eax, %r13d
jg 0x54d55
movl %r15d, %ecx
shrl $0x1f, %ecx
addl %r15d, %ecx
sarl %ecx
addl %r13d, %ecx
cmpl %ecx, %r13d
cmovgl %r13d, %ecx
movslq 0x21c27(%rip), %rdx     # 0x768bc
leal -0x4(%r13), %esi
movl %esi, 0x30(%rsp)
subl %r13d, %eax
addl $0x5, %eax
movl %edx, %esi
movl %eax, 0x20(%rsp)
imull %eax, %esi
movl %esi, 0x18(%rsp)
leaq 0x1(%rdx), %rsi
movq 0x28(%rsp), %r12
imulq %r12, %rsi
leaq 0x1ab0b74c(%rip), %r9   # 0x1ab60410
leaq (%r9,%rsi,4), %r10
leaq (,%rdx,4), %r11
leaq 0x1ab0aa09(%rip), %rbx  # 0x1ab5f6e0
leaq (%rbx,%rsi,4), %rsi
negl %ecx
movq %r15, 0x38(%rsp)
cmpl $-0x1, %r15d
jl 0x54d3f
movq %r12, %rbp
imulq %rdx, %rbp
movq %rsi, %r14
movq %r10, %r15
movl 0x18(%rsp), %eax
movl %eax, %r8d
movl 0x20(%rsp), %eax
movl %eax, %r13d
movl 0x30(%rsp), %eax
movl %eax, %edi
movl %edi, (%r14)
movslq %r13d, %r13
movq %rbp, %rax
addq %r13, %rax
movl %edi, (%rbx,%rax,4)
movl %edi, (%r15)
movslq %r8d, %r8
leaq (%r12,%r8), %rax
movl %edi, (%r9,%rax,4)
decl %r13d
subl %edx, %r8d
addq %r11, %r15
addq $0x4, %r14
leal (%rcx,%rdi), %eax
incl %eax
incl %edi
cmpl $-0x3, %eax
jne 0x54d09
incq %r12
addq $0x4, %r10
addq %r11, %rsi
cmpl %r12d, 0x8(%rsp)
movq 0x38(%rsp), %r15
jne 0x54ce2
testl %r15d, %r15d
jle 0x54ed7
movl %r15d, %eax
leal 0x1(%r15), %ecx
andl $-0x2, %ecx
leaq -0x1(%rax), %rdx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
leaq 0x1ab0c3c3(%rip), %rdx  # 0x1ab61140
xorl %esi, %esi
movdqa 0xab09(%rip), %xmm2     # 0x5f890
movdqa 0xab11(%rip), %xmm3     # 0x5f8a0
pxor %xmm3, %xmm0
movdqa 0xc0a5(%rip), %xmm4     # 0x60e40
pcmpeqd %xmm5, %xmm5
movdqa 0xc0a9(%rip), %xmm6     # 0x60e50
movdqa 0xc0b1(%rip), %xmm7     # 0x60e60
movd %esi, %xmm8
pshufd $0x50, %xmm8, %xmm8     # xmm8 = xmm8[0,0,1,1]
movq %rsi, %xmm9
pshufd $0x44, %xmm9, %xmm9     # xmm9 = xmm9[0,1,0,1]
movdqa %xmm8, %xmm10
pxor %xmm3, %xmm10
movq %rdx, %rdi
xorl %r8d, %r8d
movdqa %xmm2, %xmm11
movq 0xb1ad(%rip), %xmm12    # 0x5ff90
movdqa %xmm11, %xmm13
pxor %xmm3, %xmm13
movdqa %xmm13, %xmm14
pcmpgtd %xmm0, %xmm14
pcmpeqd %xmm0, %xmm13
pshufd $0xf5, %xmm13, %xmm15   # xmm15 = xmm13[1,1,3,3]
pand %xmm14, %xmm15
pshufd $0xf5, %xmm14, %xmm13   # xmm13 = xmm14[1,1,3,3]
por %xmm15, %xmm13
movdqa %xmm12, %xmm14
pxor %xmm3, %xmm14
pcmpgtd %xmm10, %xmm14
movdqa %xmm12, %xmm15
pand %xmm14, %xmm15
pandn %xmm8, %xmm14
por %xmm15, %xmm14
movq %r8, %xmm15
incq %r8
movq %r8, %xmm1
punpcklqdq %xmm1, %xmm15   # xmm15 = xmm15[0],xmm1[0]
paddq %xmm9, %xmm15
pshufd $0xe8, %xmm15, %xmm1    # xmm1 = xmm15[0,2,2,3]
paddd %xmm14, %xmm1
movdqa %xmm1, %xmm14
pxor %xmm3, %xmm14
pcmpgtd %xmm4, %xmm14
movdqa %xmm14, %xmm15
pandn %xmm1, %xmm15
psrld $0x1c, %xmm14
por %xmm15, %xmm14
movd %xmm13, %r9d
notl %r9d
testb $0x1, %r9b
je 0x54e8e
movd %xmm14, (%rdi)
pxor %xmm5, %xmm13
pextrw $0x4, %xmm13, %r9d
testb $0x1, %r9b
je 0x54eaa
pshufd $0x55, %xmm14, %xmm1    # xmm1 = xmm14[1,1,1,1]
movd %xmm1, 0x4c(%rdi)
paddq %xmm6, %xmm11
paddd %xmm7, %xmm12
addq $0x98, %rdi
incq %r8
cmpq %rcx, %r8
jne 0x54de3
incq %rsi
addq $0x4, %rdx
cmpq %rax, %rsi
jne 0x54daf
leaq 0x1aab8072(%rip), %rbx  # 0x1ab0cf50
movl $0xd24, %edx            # imm = 0xD24
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6200
movslq 0x219c8(%rip), %rax     # 0x768bc
movq %rax, 0x10(%rsp)
cmpl $-0x1, %r15d
jl 0x550b3
movl %r15d, %r9d
shrl $0x1f, %r9d
addl %r15d, %r9d
sarl %r9d
movq 0x48(%rsp), %rcx
addl %ecx, %r9d
movq 0x50(%rsp), %rax
addl $0x5, %eax
movslq %eax, %rdx
cmpl %r9d, %ecx
cmovgl %ecx, %r9d
incl %r9d
movq %rdx, %rax
movq 0x28(%rsp), %r14
subq %r14, %rax
movq 0x10(%rsp), %rcx
imulq %rcx, %rax
leaq (,%r14,4), %rsi
leaq (%rsi,%rax,4), %r11
addq %rbx, %r11
leaq (,%rcx,4), %rdi
movq %rdi, %r10
negq %r10
leaq -0x1(%rcx), %r8
imulq %r14, %r8
leaq (%rbx,%r8,4), %r12
leaq 0x1(%rcx), %r8
imulq %r14, %r8
leaq (%rbx,%r8,4), %rcx
leaq (%rax,%rdx), %r8
shlq $0x2, %rdx
subq %r14, %r8
leaq (%rbx,%r8,4), %r15
movq %rdx, %r8
leaq (%rdx,%rax,4), %rax
subq %rsi, %rax
addq %rbx, %rax
movq %rax, %rbx
movl $0x1, %eax
movl $0x1, %ebp
movq %rcx, %rsi
movq %r12, %r13
movq %r11, %rdx
movl %r9d, 0x40(%rsp)
movq %r10, 0x58(%rsp)
movq %r14, 0x30(%rsp)
cmpq 0x28(%rsp), %r14
jl 0x55083
movl %eax, 0x44(%rsp)
movq %rdx, 0x8(%rsp)
movl %eax, %eax
movq %rax, 0x38(%rsp)
movq %r12, 0x20(%rsp)
movq %r11, %r10
xorl %r11d, %r11d
movq %r15, 0x18(%rsp)
movq %r15, %r9
movq %rsi, 0x68(%rsp)
movq %rsi, %r15
movq %r13, 0x60(%rsp)
movq %r13, %rax
xorl %r14d, %r14d
movq %rcx, %r13
movq 0x10(%rsp), %rcx
movq %rbp, %rsi
movq %rbx, %rbp
movq 0x38(%rsp), %rdx
leal (%rdx,%r14), %ebx
movl %ebx, (%r13,%r14,4)
movl %ebx, (%r12,%r8)
movl %ebx, (%r15)
movl %ebx, (%r10,%r11,4)
movq 0x8(%rsp), %rdx
movl %ebx, (%rdx,%r14,4)
movl %ebx, (%r9)
movl %ebx, (%rax,%r8)
movl %ebx, (%rbp,%r11,4)
movq %rbp, %rbx
movq %rsi, %rbp
incq %r14
addq %rdi, %rax
addq %rdi, %r15
addq $-0x4, %r9
subq %rcx, %r11
addq $-0x4, %r12
cmpl %r14d, %ebp
jne 0x55000
movl 0x44(%rsp), %eax
addl %r14d, %eax
movl 0x40(%rsp), %r9d
movq %r10, %r11
movq 0x58(%rsp), %r10
movq 0x20(%rsp), %r12
movq %r13, %rcx
movq 0x18(%rsp), %r15
movq 0x68(%rsp), %rsi
movq 0x60(%rsp), %r13
movq 0x8(%rsp), %rdx
movq 0x30(%rsp), %r14
incq %r14
addq %r10, %rdx
addq $-0x4, %r13
addq $0x4, %rsi
addq %r10, %r15
addq $-0x4, %rbx
addq $0x4, %r11
addq %rdi, %r12
addq %rdi, %rcx
incq %rbp
cmpl %r14d, %r9d
jne 0x54fb2
movl $0x0, 0x1aab7e43(%rip)  # 0x1ab0cf00
movq 0x50(%rsp), %r15
movq 0x48(%rsp), %r12
leal (%r15,%r12), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
cmpl %edx, %r12d
movq 0x10(%rsp), %r13
jg 0x55141
movl %r12d, %esi
imull %r13d, %esi
addl %r15d, %esi
leal -0x1(%r13), %edi
xorl %r8d, %r8d
movl $0x1, %r9d
leaq 0x1ab0cba4(%rip), %r10  # 0x1ab61ca0
movl %r12d, %r11d
movl %ecx, %eax
subl %r11d, %eax
cmpl %r15d, %eax
jg 0x5512f
movslq %r8d, %rax
shlq $0x2, %rax
xorl %ebx, %ebx
leal (%rsi,%rbx), %ebp
leaq (%rax,%rbx,4), %r14
movl %ebp, (%r10,%r14)
incq %rbx
cmpl %ebx, %r9d
jne 0x55112
addl %ebx, %r8d
movl %r8d, 0x1aab7dd1(%rip)  # 0x1ab0cf00
leal 0x1(%r11), %eax
incq %r9
addq %rdi, %rsi
cmpl %edx, %r11d
movl %eax, %r11d
jne 0x550ff
movl %r13d, %eax
notl %eax
movl %eax, 0x1ab0d104(%rip)  # 0x1ab62250
movl $0x1, %eax
subl %r13d, %eax
movl %eax, 0x1ab0d0fa(%rip)  # 0x1ab62254
leal -0x1(%r13), %eax
movl %eax, 0x1ab0d0f4(%rip)  # 0x1ab62258
leal 0x1(%r13), %ecx
movl %ecx, 0x1ab0d0ee(%rip)  # 0x1ab6225c
movl %ecx, %eax
imull %r12d, %eax
movl %eax, 0x1ab0d0f6(%rip)  # 0x1ab62270
movl %r13d, %edx
imull %r15d, %edx
leal (%rdx,%r12), %esi
movl %esi, 0x1ab0d0e9(%rip)  # 0x1ab62274
movl %r13d, %edi
imull %r12d, %edi
leal (%rdi,%r15), %r8d
movl %r8d, 0x1ab0d0db(%rip)  # 0x1ab62278
imull %r15d, %ecx
movl %ecx, 0x1ab0d0d5(%rip)  # 0x1ab6227c
leal 0x1(%rax), %r9d
movl %r9d, 0x1ab0d0ce(%rip)  # 0x1ab62280
addl %r13d, %eax
movl %eax, 0x1ab0d0c9(%rip)  # 0x1ab62284
subl %r13d, %esi
movl %esi, 0x1ab0d0c4(%rip)  # 0x1ab62288
leal (%rdx,%r12), %eax
incl %eax
movl %eax, 0x1ab0d0bc(%rip)  # 0x1ab6228c
leal (%rdi,%r15), %eax
decl %eax
movl %eax, 0x1ab0d0b4(%rip)  # 0x1ab62290
addl %r13d, %r8d
movl %r8d, 0x1ab0d0ae(%rip)  # 0x1ab62294
movl %ecx, %eax
subl %r13d, %eax
movl %eax, 0x1ab0d0a7(%rip)  # 0x1ab62298
decl %ecx
movl %ecx, 0x1ab0d0a3(%rip)  # 0x1ab6229c
callq 0x545ea
callq 0x547ce
movdqa 0xbc75(%rip), %xmm0     # 0x60e80
movdqa 0xbc7d(%rip), %xmm1     # 0x60e90
movdqa 0xbc85(%rip), %xmm2     # 0x60ea0
movdqa 0xbc8d(%rip), %xmm3     # 0x60eb0
xorl %eax, %eax
movdqa 0xbd13(%rip), %xmm4     # 0x60f40
movdqa 0xbd1b(%rip), %xmm5     # 0x60f50
movdqa 0xbcb3(%rip), %xmm6     # 0x60ef0
leaq 0x1aada49c(%rip), %rcx  # 0x1ab2f6e0
movdqa 0xbcd4(%rip), %xmm7     # 0x60f20
movdqa %xmm0, %xmm8
pand %xmm4, %xmm8
movdqa %xmm1, %xmm9
pand %xmm4, %xmm9
movdqa %xmm2, %xmm11
pand %xmm4, %xmm11
movdqa %xmm3, %xmm10
pand %xmm4, %xmm10
pcmpeqd %xmm4, %xmm10
pcmpeqd %xmm4, %xmm11
packssdw %xmm11, %xmm10
pcmpeqd %xmm4, %xmm9
pcmpeqd %xmm4, %xmm8
packssdw %xmm8, %xmm9
packsswb %xmm9, %xmm10
movdqa %xmm0, %xmm9
pand %xmm5, %xmm9
movdqa %xmm1, %xmm11
pand %xmm5, %xmm11
movdqa %xmm2, %xmm12
pand %xmm5, %xmm12
movdqa %xmm3, %xmm8
pand %xmm5, %xmm8
pcmpeqd %xmm5, %xmm8
pcmpeqd %xmm5, %xmm12
packssdw %xmm12, %xmm8
pcmpeqd %xmm5, %xmm11
pcmpeqd %xmm5, %xmm9
packssdw %xmm9, %xmm11
packsswb %xmm11, %xmm8
movdqa %xmm10, %xmm11
pandn %xmm8, %xmm11
movdqa %xmm6, %xmm9
psubb %xmm11, %xmm9
por %xmm10, %xmm8
movdqa %xmm8, 0x70(%rsp)
testb $0x1, 0x70(%rsp)
je 0x55311
movd %xmm9, %edx
movb %dl, (%rax,%rcx)
movd %xmm8, %edx
movl %edx, %esi
shrl $0x8, %esi
testb $0x1, %sil
je 0x5532a
movd %xmm9, %ebx
movb %bh, 0x1(%rax,%rcx)
movl %edx, %esi
shrl $0x10, %esi
testb $0x1, %sil
je 0x55342
movd %xmm9, %esi
shrl $0x10, %esi
movb %sil, 0x2(%rax,%rcx)
shrl $0x18, %edx
testb $0x1, %dl
je 0x55356
movd %xmm9, %edx
shrl $0x18, %edx
movb %dl, 0x3(%rax,%rcx)
pextrw $0x2, %xmm8, %edx
testb $0x1, %dl
je 0x5536c
pextrw $0x2, %xmm9, %esi
movb %sil, 0x4(%rax,%rcx)
shrl $0x8, %edx
testb $0x1, %dl
je 0x5537e
pextrw $0x2, %xmm9, %edx
movb %dh, 0x5(%rax,%rcx)
pextrw $0x3, %xmm8, %edx
testb $0x1, %dl
je 0x55394
pextrw $0x3, %xmm9, %esi
movb %sil, 0x6(%rax,%rcx)
shrl $0x8, %edx
testb $0x1, %dl
je 0x553a6
pextrw $0x3, %xmm9, %edx
movb %dh, 0x7(%rax,%rcx)
pextrw $0x4, %xmm8, %edx
testb $0x1, %dl
je 0x553bc
pextrw $0x4, %xmm9, %esi
movb %sil, 0x8(%rax,%rcx)
shrl $0x8, %edx
testb $0x1, %dl
je 0x553ce
pextrw $0x4, %xmm9, %edx
movb %dh, 0x9(%rax,%rcx)
pextrw $0x5, %xmm8, %edx
testb $0x1, %dl
je 0x553e4
pextrw $0x5, %xmm9, %esi
movb %sil, 0xa(%rax,%rcx)
shrl $0x8, %edx
testb $0x1, %dl
je 0x553f6
pextrw $0x5, %xmm9, %edx
movb %dh, 0xb(%rax,%rcx)
pextrw $0x6, %xmm8, %edx
testb $0x1, %dl
je 0x5540c
pextrw $0x6, %xmm9, %esi
movb %sil, 0xc(%rax,%rcx)
shrl $0x8, %edx
testb $0x1, %dl
je 0x5541e
pextrw $0x6, %xmm9, %edx
movb %dh, 0xd(%rax,%rcx)
pextrw $0x7, %xmm8, %edx
testb $0x1, %dl
je 0x55434
pextrw $0x7, %xmm9, %esi
movb %sil, 0xe(%rax,%rcx)
shrl $0x8, %edx
testb $0x1, %dl
je 0x55446
pextrw $0x7, %xmm9, %edx
movb %dh, 0xf(%rax,%rcx)
addq $0x10, %rax
paddd %xmm7, %xmm3
paddd %xmm7, %xmm2
paddd %xmm7, %xmm1
paddd %xmm7, %xmm0
cmpq $0x10000, %rax          # imm = 0x10000
jne 0x5524c
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq