// File: 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
movq %rsp, %rbp
subq $0x50, %rsp
movsd 0x4b0f8(%rip), %xmm0    # 0xe7a58
movsd %xmm0, 0x1aae1728(%rip) # 0x1ab7e090
movsd 0xf698(%rip), %xmm0     # 0xac008
addsd 0x4b0e0(%rip), %xmm0    # 0xe7a58
movsd %xmm0, 0x1aae1718(%rip) # 0x1ab7e098
movsd 0x4b0d0(%rip), %xmm0    # 0xe7a58
movsd 0xf678(%rip), %xmm1     # 0xac008
subsd %xmm1, %xmm0
movsd %xmm0, 0x1aae1704(%rip) # 0x1ab7e0a0
movl $0x0, -0x4(%rbp)
movl 0x4b0a7(%rip), %eax     # 0xe7a50
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl 0x4b09f(%rip), %eax     # 0xe7a54
jg 0x9ca4f
movl 0x4b08f(%rip), %eax     # 0xe7a50
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl 0x4b087(%rip), %eax     # 0xe7a54
jg 0x9ca3f
movl -0xc(%rbp), %edx
movl -0x8(%rbp), %eax
imull 0x4b070(%rip), %eax     # 0xe7a4c
addl %eax, %edx
movl -0x4(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x4(%rbp)
movslq %eax, %rcx
leaq 0x1ab35e7d(%rip), %rax  # 0x1abd2870
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %edx
movl -0xc(%rbp), %eax
movl -0x8(%rbp), %ecx
imull 0x4b046(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
movslq %eax, %rcx
leaq 0x1aae23ee(%rip), %rax  # 0x1ab7ee00
movl %edx, (%rax,%rcx,4)
movl -0x8(%rbp), %edx
movl -0xc(%rbp), %eax
movl -0x8(%rbp), %ecx
imull 0x4b027(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
movslq %eax, %rcx
leaq 0x1aae30ff(%rip), %rax  # 0x1ab7fb30
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x9c9c4
jmp 0x9ca41
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x9c9ac
movl 0x4affb(%rip), %eax     # 0xe7a50
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl 0x4aff3(%rip), %eax     # 0xe7a54
jg 0x9cb51
movl 0x4afe3(%rip), %eax     # 0xe7a50
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x34(%rbp)
movl 0x4afd4(%rip), %ecx     # 0xe7a50
movl 0x4afc2(%rip), %eax     # 0xe7a44
movl $0x2, %esi
cltd
idivl %esi
movl %eax, %edx
movl -0x34(%rbp), %eax
addl %edx, %ecx
cmpl %ecx, %eax
jg 0x9cb41
movl -0x14(%rbp), %edx
subl $0x4, %edx
movl -0x14(%rbp), %eax
movl -0x10(%rbp), %ecx
imull 0x4afa0(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
movslq %eax, %rcx
leaq 0x1ab33da8(%rip), %rax  # 0x1abd0860
movl %edx, (%rax,%rcx,4)
movl -0x14(%rbp), %edx
subl $0x4, %edx
movl 0x4af8d(%rip), %eax     # 0xe7a54
addl $0x5, %eax
subl -0x14(%rbp), %eax
movl -0x10(%rbp), %ecx
imull 0x4af75(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
movslq %eax, %rcx
leaq 0x1ab33d7d(%rip), %rax  # 0x1abd0860
movl %edx, (%rax,%rcx,4)
movl -0x14(%rbp), %edx
subl $0x4, %edx
movl -0x10(%rbp), %eax
movl -0x14(%rbp), %ecx
imull 0x4af53(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
movslq %eax, %rcx
leaq 0x1ab34a8b(%rip), %rax  # 0x1abd1590
movl %edx, (%rax,%rcx,4)
movl -0x14(%rbp), %edx
subl $0x4, %edx
movl -0x10(%rbp), %eax
movl 0x4af3d(%rip), %ecx     # 0xe7a54
addl $0x5, %ecx
subl -0x14(%rbp), %ecx
imull 0x4af28(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
movslq %eax, %rcx
leaq 0x1ab34a60(%rip), %rax  # 0x1abd1590
movl %edx, (%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x9ca70
jmp 0x9cb43
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x9ca58
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl 0x4aee3(%rip), %eax     # 0xe7a44
jge 0x9cc16
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl 0x4aecd(%rip), %eax     # 0xe7a44
jge 0x9cc06
movl -0x1c(%rbp), %eax
addl -0x18(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x18(%rbp), %eax
jle 0x9cb96
movl -0x1c(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0x9cb9c
movl -0x18(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x38(%rbp), %edx
movl -0x3c(%rbp), %eax
addl %eax, %edx
movslq -0x1c(%rbp), %rcx
leaq 0x1ab35711(%rip), %rax  # 0x1abd22c0
imulq $0x4c, %rcx, %rcx
addq %rcx, %rax
movslq -0x18(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movslq -0x1c(%rbp), %rcx
leaq 0x1ab356f8(%rip), %rax  # 0x1abd22c0
imulq $0x4c, %rcx, %rcx
addq %rcx, %rax
movslq -0x18(%rbp), %rcx
cmpl $0x10, (%rax,%rcx,4)
jl 0x9cbf6
movslq -0x1c(%rbp), %rcx
leaq 0x1ab356dc(%rip), %rax  # 0x1abd22c0
imulq $0x4c, %rcx, %rcx
addq %rcx, %rax
movslq -0x18(%rbp), %rcx
movl $0xf, (%rax,%rcx,4)
jmp 0x9cbf8
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x9cb6e
jmp 0x9cc08
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x9cb58
movl $0x0, -0x20(%rbp)
leaq 0x1aae14ac(%rip), %rdi  # 0x1ab7e0d0
movl $0x349, %esi            # imm = 0x349
leaq -0x20(%rbp), %rdx
callq 0x80790
movl $0x1, -0x4(%rbp)
movl 0x4ae11(%rip), %eax     # 0xe7a50
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x40(%rbp)
movl 0x4ae02(%rip), %ecx     # 0xe7a50
movl 0x4adf0(%rip), %eax     # 0xe7a44
movl $0x2, %esi
cltd
idivl %esi
movl %eax, %edx
movl -0x40(%rbp), %eax
addl %edx, %ecx
cmpl %ecx, %eax
jg 0x9cde7
movl 0x4addf(%rip), %eax     # 0xe7a50
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jg 0x9cdd7
movl -0x4(%rbp), %edx
movl -0x28(%rbp), %eax
movl -0x24(%rbp), %ecx
imull 0x4adbc(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
movslq %eax, %rcx
leaq 0x1aae1434(%rip), %rax  # 0x1ab7e0d0
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %edx
movl 0x4adac(%rip), %eax     # 0xe7a54
addl $0x5, %eax
subl -0x28(%rbp), %eax
movl -0x24(%rbp), %ecx
imull 0x4ad94(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
movslq %eax, %rcx
leaq 0x1aae140c(%rip), %rax  # 0x1ab7e0d0
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %edx
movl -0x24(%rbp), %eax
movl -0x28(%rbp), %ecx
imull 0x4ad75(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
movslq %eax, %rcx
leaq 0x1aae13ed(%rip), %rax  # 0x1ab7e0d0
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %edx
movl -0x24(%rbp), %eax
movl 0x4ad62(%rip), %ecx     # 0xe7a54
addl $0x5, %ecx
subl -0x28(%rbp), %ecx
imull 0x4ad4d(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
movslq %eax, %rcx
leaq 0x1aae13c5(%rip), %rax  # 0x1ab7e0d0
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %edx
movl -0x28(%rbp), %eax
movl 0x4ad3a(%rip), %ecx     # 0xe7a54
addl $0x5, %ecx
subl -0x24(%rbp), %ecx
imull 0x4ad25(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
movslq %eax, %rcx
leaq 0x1aae139d(%rip), %rax  # 0x1ab7e0d0
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %edx
movl 0x4ad15(%rip), %eax     # 0xe7a54
addl $0x5, %eax
subl -0x28(%rbp), %eax
movl 0x4ad09(%rip), %ecx     # 0xe7a54
addl $0x5, %ecx
subl -0x24(%rbp), %ecx
imull 0x4acf4(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
movslq %eax, %rcx
leaq 0x1aae136c(%rip), %rax  # 0x1ab7e0d0
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %edx
movl 0x4ace4(%rip), %eax     # 0xe7a54
addl $0x5, %eax
subl -0x24(%rbp), %eax
movl -0x28(%rbp), %ecx
imull 0x4accc(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
movslq %eax, %rcx
leaq 0x1aae1344(%rip), %rax  # 0x1ab7e0d0
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %edx
movl 0x4acbc(%rip), %eax     # 0xe7a54
addl $0x5, %eax
subl -0x24(%rbp), %eax
movl 0x4acb0(%rip), %ecx     # 0xe7a54
addl $0x5, %ecx
subl -0x28(%rbp), %ecx
imull 0x4ac9b(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
movslq %eax, %rcx
leaq 0x1aae1313(%rip), %rax  # 0x1ab7e0d0
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x9cc74
jmp 0x9cdd9
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x9cc42
movl $0x0, 0x1aae128f(%rip)  # 0x1ab7e080
movl 0x4ac59(%rip), %eax     # 0xe7a50
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x44(%rbp)
movl 0x4ac4a(%rip), %eax     # 0xe7a50
addl 0x4ac48(%rip), %eax     # 0xe7a54
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x44(%rbp), %eax
cmpl %ecx, %eax
jg 0x9ce82
movl 0x4ac31(%rip), %eax     # 0xe7a54
addl 0x4ac27(%rip), %eax     # 0xe7a50
subl -0x2c(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl 0x4ac1c(%rip), %eax     # 0xe7a54
jg 0x9ce72
movl -0x30(%rbp), %edx
movl -0x2c(%rbp), %eax
imull 0x4ac05(%rip), %eax     # 0xe7a4c
addl %eax, %edx
movl 0x1aae1231(%rip), %eax  # 0x1ab7e080
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x1aae1226(%rip)  # 0x1ab7e080
movslq %eax, %rcx
leaq 0x1ab35fbc(%rip), %rax  # 0x1abd2e20
movl %edx, (%rax,%rcx,4)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x9ce2f
jmp 0x9ce74
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x9cdfa
xorl %eax, %eax
subl 0x4abc2(%rip), %eax     # 0xe7a4c
subl $0x1, %eax
movl %eax, 0x1ab3653d(%rip)  # 0x1abd33d0
xorl %eax, %eax
subl 0x4abb1(%rip), %eax     # 0xe7a4c
addl $0x1, %eax
movl %eax, 0x1ab36530(%rip)  # 0x1abd33d4
movl 0x4aba2(%rip), %eax     # 0xe7a4c
subl $0x1, %eax
movl %eax, 0x1ab36525(%rip)  # 0x1abd33d8
movl 0x4ab93(%rip), %eax     # 0xe7a4c
addl $0x1, %eax
movl %eax, 0x1ab3651a(%rip)  # 0x1abd33dc
movl 0x4ab88(%rip), %eax     # 0xe7a50
movl 0x4ab82(%rip), %ecx     # 0xe7a50
imull 0x4ab77(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
movl %eax, 0x1ab36513(%rip)  # 0x1abd33f0
movl 0x4ab6d(%rip), %eax     # 0xe7a50
movl 0x4ab6b(%rip), %ecx     # 0xe7a54
imull 0x4ab5c(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
movl %eax, 0x1ab364fc(%rip)  # 0x1abd33f4
movl 0x4ab56(%rip), %eax     # 0xe7a54
movl 0x4ab4c(%rip), %ecx     # 0xe7a50
imull 0x4ab41(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
movl %eax, 0x1ab364e5(%rip)  # 0x1abd33f8
movl 0x4ab3b(%rip), %eax     # 0xe7a54
movl 0x4ab35(%rip), %ecx     # 0xe7a54
imull 0x4ab26(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
movl %eax, 0x1ab364ce(%rip)  # 0x1abd33fc
movl 0x4ab1c(%rip), %eax     # 0xe7a50
movl 0x4ab16(%rip), %ecx     # 0xe7a50
imull 0x4ab0b(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
addl $0x1, %eax
movl %eax, 0x1ab364b4(%rip)  # 0x1abd3400
movl 0x4aafe(%rip), %eax     # 0xe7a50
movl 0x4aaf8(%rip), %ecx     # 0xe7a50
imull 0x4aaed(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
addl 0x4aae5(%rip), %eax     # 0xe7a4c
movl %eax, 0x1ab36497(%rip)  # 0x1abd3404
movl 0x4aadd(%rip), %eax     # 0xe7a50
movl 0x4aadb(%rip), %ecx     # 0xe7a54
imull 0x4aacc(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
subl 0x4aac4(%rip), %eax     # 0xe7a4c
movl %eax, 0x1ab3647a(%rip)  # 0x1abd3408
movl 0x4aabc(%rip), %eax     # 0xe7a50
movl 0x4aaba(%rip), %ecx     # 0xe7a54
imull 0x4aaab(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
addl $0x1, %eax
movl %eax, 0x1ab36460(%rip)  # 0x1abd340c
movl 0x4aaa2(%rip), %eax     # 0xe7a54
movl 0x4aa98(%rip), %ecx     # 0xe7a50
imull 0x4aa8d(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
subl $0x1, %eax
movl %eax, 0x1ab36446(%rip)  # 0x1abd3410
movl 0x4aa84(%rip), %eax     # 0xe7a54
movl 0x4aa7a(%rip), %ecx     # 0xe7a50
imull 0x4aa6f(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
addl 0x4aa67(%rip), %eax     # 0xe7a4c
movl %eax, 0x1ab36429(%rip)  # 0x1abd3414
movl 0x4aa63(%rip), %eax     # 0xe7a54
movl 0x4aa5d(%rip), %ecx     # 0xe7a54
imull 0x4aa4e(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
subl 0x4aa46(%rip), %eax     # 0xe7a4c
movl %eax, 0x1ab3640c(%rip)  # 0x1abd3418
movl 0x4aa42(%rip), %eax     # 0xe7a54
movl 0x4aa3c(%rip), %ecx     # 0xe7a54
imull 0x4aa2d(%rip), %ecx     # 0xe7a4c
addl %ecx, %eax
subl $0x1, %eax
movl %eax, 0x1ab363f2(%rip)  # 0x1abd341c
callq 0x9c0e0
callq 0x9c180
callq 0x9d040
addq $0x50, %rsp
popq %rbp
retq
nop