// File: /workspace/github_cpp_makefile_star2_O3/antoniogarro[P]Hara/goban.cpp
// Function: Goban::init_distance()
void Goban::init_distance()
{
  for (int p = 0; p <= size2; p++) {
    int d = (p-1)%size < (p-1)/size ? (p-1)%size : (p-1)/size;
    if (size - (p-1)%size - 1 < d) {
      d = size - (p-1)%size - 1;
    }
    if (size - (p-1)/size - 1 < d) {
      d = size - (p-1)/size - 1;
    }
    distance_to_edge[p] = d;
  }
}

// Assembly:
movslq 0xc(%rdi), %rcx
testq %rcx, %rcx
js 0x467f
pushq %rbx
movl 0x8(%rdi), %esi
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movd %esi, %xmm1
pshufd $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
shrl $0x2, %ecx
andl $0x1fffffff, %ecx       # imm = 0x1FFFFFFF
shlq $0x4, %rcx
addq $0x10, %rcx
movdqa 0x6c95(%rip), %xmm2     # 0xb0d0
movdqa 0x6c9d(%rip), %xmm3     # 0xb0e0
movdqa 0x6ca5(%rip), %xmm4     # 0xb0f0
xorl %r8d, %r8d
movdqa 0x6caa(%rip), %xmm5     # 0xb100
pxor %xmm5, %xmm0
pcmpeqd %xmm6, %xmm6
movdqa 0x6caa(%rip), %xmm7     # 0xb110
movdqa 0x6cb1(%rip), %xmm8     # 0xb120
movdqa %xmm3, %xmm9
pxor %xmm5, %xmm9
movdqa %xmm9, %xmm10
pcmpgtd %xmm0, %xmm10
pcmpeqd %xmm0, %xmm9
pshufd $0xf5, %xmm9, %xmm9     # xmm9 = xmm9[1,1,3,3]
pand %xmm10, %xmm9
pshufd $0xf5, %xmm10, %xmm12   # xmm12 = xmm10[1,1,3,3]
por %xmm9, %xmm12
movdqa %xmm4, %xmm11
paddd %xmm6, %xmm11
movd %xmm12, %r9d
notl %r9d
testb $0x1, %r9b
je 0x44c8
movd %xmm11, %eax
cltd
idivl %esi
movd %edx, %xmm10
movd %eax, %xmm9
pxor %xmm6, %xmm12
pextrw $0x4, %xmm12, %r10d
testb $0x1, %r10b
je 0x450d
pshufd $0x55, %xmm11, %xmm12   # xmm12 = xmm11[1,1,1,1]
movd %xmm12, %eax
cltd
idivl %esi
movd %edx, %xmm12
punpcklqdq %xmm10, %xmm12  # xmm12 = xmm12[0],xmm10[0]
shufps $0xe2, %xmm10, %xmm12   # xmm12 = xmm12[2,0],xmm10[2,3]
movd %eax, %xmm13
punpcklqdq %xmm9, %xmm13   # xmm13 = xmm13[0],xmm9[0]
shufps $0xe2, %xmm9, %xmm13    # xmm13 = xmm13[2,0],xmm9[2,3]
movaps %xmm12, %xmm10
movaps %xmm13, %xmm9
movdqa %xmm2, %xmm12
pxor %xmm5, %xmm12
movdqa %xmm12, %xmm13
pcmpgtd %xmm0, %xmm13
pcmpeqd %xmm0, %xmm12
pshufd $0xf5, %xmm12, %xmm14   # xmm14 = xmm12[1,1,3,3]
pand %xmm13, %xmm14
pshufd $0xf5, %xmm13, %xmm12   # xmm12 = xmm13[1,1,3,3]
por %xmm14, %xmm12
pxor %xmm6, %xmm12
pextrw $0x0, %xmm12, %r11d
testb $0x1, %r11b
je 0x4579
pshufd $0xee, %xmm11, %xmm13   # xmm13 = xmm11[2,3,2,3]
movd %xmm13, %eax
cltd
idivl %esi
movd %edx, %xmm13
shufps $0x30, %xmm10, %xmm13   # xmm13 = xmm13[0,0],xmm10[3,0]
shufps $0x84, %xmm13, %xmm10   # xmm10 = xmm10[0,1],xmm13[0,2]
movd %eax, %xmm13
shufps $0x30, %xmm9, %xmm13    # xmm13 = xmm13[0,0],xmm9[3,0]
shufps $0x84, %xmm13, %xmm9    # xmm9 = xmm9[0,1],xmm13[0,2]
pextrw $0x4, %xmm12, %ebx
testb $0x1, %bl
je 0x45b0
pshufd $0xff, %xmm11, %xmm11   # xmm11 = xmm11[3,3,3,3]
movd %xmm11, %eax
cltd
idivl %esi
movd %edx, %xmm11
shufps $0xe4, %xmm10, %xmm11   # xmm11 = xmm11[0,1],xmm10[2,3]
shufps $0x24, %xmm11, %xmm10   # xmm10 = xmm10[0,1],xmm11[2,0]
movd %eax, %xmm11
shufps $0xe4, %xmm9, %xmm11    # xmm11 = xmm11[0,1],xmm9[2,3]
shufps $0x24, %xmm11, %xmm9    # xmm9 = xmm9[0,1],xmm11[2,0]
movaps %xmm9, %xmm11
pcmpgtd %xmm10, %xmm11
movdqa %xmm10, %xmm12
pand %xmm11, %xmm12
pandn %xmm9, %xmm11
por %xmm12, %xmm11
pxor %xmm6, %xmm10
paddd %xmm1, %xmm10
movdqa %xmm11, %xmm12
pcmpgtd %xmm10, %xmm12
pand %xmm12, %xmm10
pandn %xmm11, %xmm12
por %xmm10, %xmm12
pxor %xmm6, %xmm9
paddd %xmm1, %xmm9
movdqa %xmm12, %xmm10
pcmpgtd %xmm9, %xmm10
pand %xmm10, %xmm9
pandn %xmm12, %xmm10
por %xmm9, %xmm10
testb $0x1, %r9b
je 0x4623
movd %xmm10, 0xdf6f8(%rdi,%r8)
testb $0x1, %r10b
je 0x4639
pshufd $0x55, %xmm10, %xmm9    # xmm9 = xmm10[1,1,1,1]
movd %xmm9, 0xdf6fc(%rdi,%r8)
testb $0x1, %r11b
je 0x464f
pshufd $0xee, %xmm10, %xmm9    # xmm9 = xmm10[2,3,2,3]
movd %xmm9, 0xdf700(%rdi,%r8)
testb $0x1, %bl
je 0x4664
pshufd $0xff, %xmm10, %xmm9    # xmm9 = xmm10[3,3,3,3]
movd %xmm9, 0xdf704(%rdi,%r8)
paddq %xmm7, %xmm3
paddq %xmm7, %xmm2
paddd %xmm8, %xmm4
addq $0x10, %r8
cmpq %r8, %rcx
jne 0x446f
popq %rbx
retq