LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/Albuso0[P]support/main_test.cpp
// Function: print_param(Support const&)
void print_param(const Support &support)
{
    printf("Parameters:\n");
    printf("Preset pmin value\t=%.2e\n", support.getPmin());
    printf("Degree of polynomial\t=%d\n", support.getDegree());
    printf("Approximation interval\t=[%.2e,%.2f/n]\n", support.getPmin(), support.getInterval());
    printf("\n");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x811(%rip), %rdi       # 0x419c
callq 0x2220
movsd 0x8(%rbx), %xmm0
leaq 0x74b(%rip), %rdi       # 0x40e7
movb $0x1, %al
callq 0x2030
movl 0x10(%rbx), %esi
leaq 0x753(%rip), %rdi       # 0x4100
xorl %eax, %eax
callq 0x2030
movsd 0x8(%rbx), %xmm0
movsd 0x18(%rbx), %xmm1
leaq 0x755(%rip), %rdi       # 0x411a
movb $0x2, %al
callq 0x2030
pushq $0xa
popq %rdi
popq %rbx
jmp 0x21e0
// File: /workspace/github_cpp_makefile_star2_O2/Albuso0[P]support/main_test.cpp
// Function: print_results(Support const&)
void print_results(const Support &support)
{
    printf("Results:\n");
    printf("Sample size\t=%d\n",support.getSampleSize());
    printf("Polynomial\t=%d \n",(int)support.estimate());
    printf("Plug-in\t\t=%d \n",(int)support.estimate_plug());
    printf("\n");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x7c8(%rip), %rdi       # 0x41a8
callq 0x2220
movl 0x20(%rbx), %esi
leaq 0x752(%rip), %rdi       # 0x4141
xorl %eax, %eax
callq 0x2030
movq %rbx, %rdi
callq 0x241c
cvttsd2si %xmm0, %esi
leaq 0x749(%rip), %rdi       # 0x4152
xorl %eax, %eax
callq 0x2030
movq %rbx, %rdi
callq 0x25ce
cvttsd2si %xmm0, %esi
leaq 0x740(%rip), %rdi       # 0x4163
xorl %eax, %eax
callq 0x2030
pushq $0xa
popq %rdi
popq %rbx
jmp 0x21e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/sid1607[P]avx2-merge-sort/merge_sort.cpp
// Function: merge_pass(int*, int*, int, int)
void merge_pass(int *in, int *out, int n, int merge_size) {
  for (int i=0; i < n-1; i+=2*merge_size) {
    auto mid = i + merge_size - 1;
    auto end = std::min(i+2*merge_size-1, n-1);
    // check if there are 2 sub-arrays to merge
    if (mid < end) {
      // merge two merge_size arrays per iteration
      merge_phase(in, out, i, mid, end);
    } else {
      // copy the leftover data to output
      std::memcpy(out+i, in+i, (n-i)*sizeof(int));
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, 0x8(%rsp)
movq %rdi, (%rsp)
leal -0x1(%rdx), %ebp
leal (%rcx,%rcx), %eax
cltq
movslq %ebp, %rsi
movq %rsi, 0x20(%rsp)
movslq %edx, %r15
movslq %ecx, %r14
shlq $0x2, %r15
movq %rax, %r13
leaq (,%rax,4), %rax
movq %rax, 0x18(%rsp)
leal -0x1(%r14), %eax
movq %rax, 0x10(%rsp)
leal -0x1(,%r14,2), %ebx
xorl %r12d, %r12d
cmpq 0x20(%rsp), %r12
jge 0x265f
leaq (%r14,%r12), %rax
leal (%rbx,%r12), %r8d
cmpl %r8d, %ebp
cmovll %ebp, %r8d
movslq %r8d, %rcx
cmpq %rcx, %rax
jle 0x263b
movq 0x8(%rsp), %rax
leaq (%rax,%r12,4), %rdi
movq (%rsp), %rax
leaq (%rax,%r12,4), %rsi
movq %r15, %rdx
callq 0x20d0
jmp 0x2655
movq 0x10(%rsp), %rax
leal (%rax,%r12), %ecx
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movl %r12d, %edx
callq 0x2361
addq %r13, %r12
subq 0x18(%rsp), %r15
jmp 0x2602
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sid1607[P]avx2-merge-sort/merge_sort.cpp
// Function: merge(int*, int*, unsigned long)
std::pair<int *, int *> merge(int *a, int *b, size_t len) {
  int i=0;
  /*
   * even iterations: a->b
   * odd iterations: b->a
   */
  // start from 16-16 merge
  for (size_t pass_size=SIMD_SIZE; pass_size<len; pass_size*=2, i++) {
    if (i%2 == 0) {
      merge_pass(a, b, len, pass_size);
    } else {
      merge_pass(b, a, len, pass_size);
    }
  }

  if (i%2 == 0)
    return std::make_pair(a,b);
  return std::make_pair(b,a);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x8
popq %r12
xorl %ebp, %ebp
cmpq %r15, %r12
jae 0x26b0
testb $0x1, %bpl
jne 0x2698
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x269e
movq %r14, %rdi
movq %rbx, %rsi
movl %r15d, %edx
movl %r12d, %ecx
callq 0x25ad
addq %r12, %r12
incl %ebp
jmp 0x2685
testb $0x1, %bpl
movq %r14, %rax
cmoveq %rbx, %rax
cmoveq %r14, %rbx
movq %rbx, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sid1607[P]avx2-merge-sort/merge_sort.cpp
// Function: merge_sort(int*, int*, unsigned long)
std::pair<int *, int *> merge_sort(int *a, int *b, size_t len) {
    __m256i rows[SIMD_SIZE];
  // if (len%64!=0) {
  //   // add padding
  //   auto i = a.size();
  //   auto end = ((i+64)/64)*64;
  //   while (i<end) {
  //     a.push_back(INT_MAX);
  //     i++;
  //   }
  //   // adjust b's size as well
  //   b.resize(a.size());
  // }

  assert(len%64 == 0);
  // assert(b.size() == a.size());

  for (size_t i=0; i < len; i+=SORT_SIZE) {
    for (int j=0; j<SORT_SIZE/SIMD_SIZE; j++) {
      rows[j] = load_reg256(&a[i+j*SIMD_SIZE]);
    }
    sort64(rows);
    for (int j=0; j<SORT_SIZE/SIMD_SIZE; j++) {
      store_reg256(&a[i+j*SIMD_SIZE], rows[j]);
    }
  }

  return merge(a, b, len);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
andq $-0x20, %rsp
subq $0x140, %rsp            # imm = 0x140
movq %rdx, %rbx
movq %rsi, 0x18(%rsp)
testb $0x3f, %bl
jne 0x2779
movq %rdi, %r14
xorl %r13d, %r13d
leaq 0x20(%rsp), %r12
movq %rdi, %r15
cmpq %rbx, %r13
jae 0x2757
xorl %eax, %eax
cmpq $0x100, %rax            # imm = 0x100
je 0x2723
vmovaps (%r15,%rax), %ymm0
vmovaps %ymm0, 0x20(%rsp,%rax)
addq $0x20, %rax
jmp 0x2709
movq %r12, %rdi
vzeroupper
callq 0x27c7
xorl %eax, %eax
cmpq $0x100, %rax            # imm = 0x100
je 0x274a
vmovaps 0x20(%rsp,%rax), %ymm0
vmovaps %ymm0, (%r15,%rax)
addq $0x20, %rax
jmp 0x2730
addq $0x40, %r13
addq $0x100, %r15            # imm = 0x100
jmp 0x2702
movq %r14, %rdi
movq 0x18(%rsp), %rsi
movq %rbx, %rdx
vzeroupper
callq 0x266e
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18e0(%rip), %rdi      # 0x4060
leaq 0x18e5(%rip), %rsi      # 0x406c
leaq 0x18ed(%rip), %rcx      # 0x407b
movl $0x128, %edx            # imm = 0x128
callq 0x20b0
// File: /workspace/github_cpp_makefile_star2_O2/sid1607[P]avx2-merge-sort/merge_sort.cpp
// Function: sort_columns(long long vector[4]&, long long vector[4]&, long long vector[4]&, long long vector[4]&, long long vector[4]&, long long vector[4]&, long long vector[4]&, long long vector[4]&)
inline void minmax(__m256i& a, __m256i& b){
  auto t = a;
  a = _mm256_min_epi32(a, b);
  b = _mm256_max_epi32(t, b);
  return;
}

// Assembly:
vmovdqa (%rdi), %ymm0
vpminsd (%rsi), %ymm0, %ymm1
vmovdqa %ymm1, (%rdi)
vpmaxsd (%rsi), %ymm0, %ymm0
vmovdqa %ymm0, (%rsi)
vmovdqa (%rdx), %ymm0
vpminsd (%rcx), %ymm0, %ymm1
movq 0x10(%rsp), %r10
vmovdqa %ymm1, (%rdx)
vpmaxsd (%rcx), %ymm0, %ymm0
vmovdqa %ymm0, (%rcx)
vmovdqa (%r8), %ymm0
vpminsd (%r9), %ymm0, %ymm1
movq 0x8(%rsp), %rax
vmovdqa %ymm1, (%r8)
vpmaxsd (%r9), %ymm0, %ymm0
vmovdqa %ymm0, (%r9)
vmovdqa (%rax), %ymm0
vpminsd (%r10), %ymm0, %ymm1
vmovdqa %ymm1, (%rax)
vpmaxsd (%r10), %ymm0, %ymm0
vmovdqa %ymm0, (%r10)
vmovdqa (%rdi), %ymm0
vpminsd (%rdx), %ymm0, %ymm1
vmovdqa %ymm1, (%rdi)
vpmaxsd (%rdx), %ymm0, %ymm0
vmovdqa %ymm0, (%rdx)
vmovdqa (%rsi), %ymm0
vpminsd (%rcx), %ymm0, %ymm1
vmovdqa %ymm1, (%rsi)
vpmaxsd (%rcx), %ymm0, %ymm0
vmovdqa %ymm0, (%rcx)
vmovdqa (%r8), %ymm0
vpminsd (%rax), %ymm0, %ymm1
vmovdqa %ymm1, (%r8)
vpmaxsd (%rax), %ymm0, %ymm0
vmovdqa %ymm0, (%rax)
vmovdqa (%r9), %ymm0
vpminsd (%r10), %ymm0, %ymm1
vmovdqa %ymm1, (%r9)
vpmaxsd (%r10), %ymm0, %ymm0
vmovdqa %ymm0, (%r10)
vmovdqa (%rsi), %ymm0
vpminsd (%rdx), %ymm0, %ymm1
vmovdqa %ymm1, (%rsi)
vpmaxsd (%rdx), %ymm0, %ymm0
vmovdqa %ymm0, (%rdx)
vmovdqa (%rdi), %ymm0
vpminsd (%r8), %ymm0, %ymm1
vmovdqa %ymm1, (%rdi)
vpmaxsd (%r8), %ymm0, %ymm0
vmovdqa %ymm0, (%r8)
vmovdqa (%r9), %ymm0
vpminsd (%rax), %ymm0, %ymm1
vmovdqa %ymm1, (%r9)
vpmaxsd (%rax), %ymm0, %ymm0
vmovdqa %ymm0, (%rax)
vmovdqa (%rcx), %ymm0
vpminsd (%r10), %ymm0, %ymm1
vmovdqa %ymm1, (%rcx)
vpmaxsd (%r10), %ymm0, %ymm0
vmovdqa %ymm0, (%r10)
vmovdqa (%rsi), %ymm0
vpminsd (%r9), %ymm0, %ymm1
vmovdqa %ymm1, (%rsi)
vpmaxsd (%r9), %ymm0, %ymm0
vmovdqa %ymm0, (%r9)
vmovdqa (%rdx), %ymm0
vpminsd (%rax), %ymm0, %ymm1
vmovdqa %ymm1, (%rdx)
vpmaxsd (%rax), %ymm0, %ymm0
vmovdqa %ymm0, (%rax)
vmovdqa (%rsi), %ymm0
vpminsd (%r8), %ymm0, %ymm1
vmovdqa %ymm1, (%rsi)
vpmaxsd (%r8), %ymm0, %ymm0
vmovdqa %ymm0, (%r8)
vmovdqa (%rcx), %ymm0
vpminsd (%rax), %ymm0, %ymm1
vmovdqa %ymm1, (%rcx)
vpmaxsd (%rax), %ymm0, %ymm0
vmovdqa %ymm0, (%rax)
vmovdqa (%rdx), %ymm0
vpminsd (%r8), %ymm0, %ymm1
vmovdqa %ymm1, (%rdx)
vpmaxsd (%r8), %ymm0, %ymm0
vmovdqa %ymm0, (%r8)
vmovdqa (%rcx), %ymm0
vpminsd (%r9), %ymm0, %ymm1
vmovdqa %ymm1, (%rcx)
vpmaxsd (%r9), %ymm0, %ymm0
vmovdqa %ymm0, (%r9)
vmovdqa (%rcx), %ymm0
vpminsd (%r8), %ymm0, %ymm1
vmovdqa %ymm1, (%rcx)
vpmaxsd (%r8), %ymm0, %ymm0
vmovdqa %ymm0, (%r8)
vzeroupper
retq
// File: /workspace/github_cpp_makefile_star2_O2/sid1607[P]avx2-merge-sort/test_sort.cpp
// Function: print_array(int*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)
void print_array(int *a, const std::string& msg, int size=8) {
  std::cout << msg << std::endl;
  for (int i=0; i<size; i++) {
    std::cout << a[i] <<  ",";
  }
  std::cout << std::endl;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rdi, %r14
movq 0x344b(%rip), %r15      # 0x5fd0
movq %r15, %rdi
callq 0x20f0
movq %rax, %rdi
callq 0x2070
xorl %r13d, %r13d
testl %ebx, %ebx
cmovlel %r13d, %ebx
leaq 0x151b(%rip), %r12      # 0x40c0
cmpq %r13, %rbx
je 0x2bc6
movl (%r14,%r13,4), %esi
movq %r15, %rdi
callq 0x21b0
movq %rax, %rdi
movq %r12, %rsi
callq 0x2130
incq %r13
jmp 0x2ba5
movq 0x3403(%rip), %rdi      # 0x5fd0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2070
// File: /workspace/github_cpp_makefile_star2_O2/sid1607[P]avx2-merge-sort/test_sort.cpp
// Function: print_register(long long vector[4], std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void print_register(__m256i a, const std::string& msg) {
  std::cout << msg << std::endl;
  for (int i=0; i<8; i++) {
    std::cout << ((int *) &a)[i] <<  ",";
  }
  std::cout << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
andq $-0x20, %rsp
subq $0x40, %rsp
movq %rdi, %rsi
vmovaps %ymm0, (%rsp)
movq 0x33d5(%rip), %rbx      # 0x5fd0
movq %rbx, %rdi
vzeroupper
callq 0x20f0
movq %rax, %rdi
callq 0x2070
xorl %r15d, %r15d
leaq 0x14a8(%rip), %r14      # 0x40c0
cmpq $0x8, %r15
je 0x2c3a
movl (%rsp,%r15,4), %esi
movq %rbx, %rdi
callq 0x21b0
movq %rax, %rdi
movq %r14, %rsi
callq 0x2130
incq %r15
jmp 0x2c18
movq 0x338f(%rip), %rdi      # 0x5fd0
callq 0x2070
leaq -0x18(%rbp), %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sid1607[P]avx2-merge-sort/test_sort.cpp
// Function: is_sorted_register(long long vector[4], int*)
bool is_sorted_register(__m256i a, int *prev) {
  for (int i=0; i<8; i++) {
    auto curr = ((int *) &a)[i];
    if (curr < *prev) return false;
    *prev = curr;
  }
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
andq $-0x20, %rsp
subq $0x40, %rsp
vmovaps %ymm0, (%rsp)
xorl %eax, %eax
cmpq $0x8, %rax
je 0x2d08
movl (%rsp,%rax,4), %ecx
cmpl (%rdi), %ecx
jl 0x2d08
movl %ecx, (%rdi)
incq %rax
jmp 0x2cf4
cmpq $0x8, %rax
setae %al
movq %rbp, %rsp
popq %rbp
vzeroupper
retq
// File: /workspace/github_cpp_makefile_star2_O2/sid1607[P]avx2-merge-sort/test_sort.cpp
// Function: is_sorted_array(int*, int)
bool is_sorted_array(int *out, int len) {
  int prev = out[0];
  for (int i=1; i<len; i++) {
    if (out[i] < prev)
      return false;
    prev = out[i];
  }
  return true;
}

// Assembly:
movl (%rdi), %ecx
movslq %esi, %rax
pushq $0x1
popq %rsi
movq %rsi, %rdx
cmpq %rax, %rsi
jge 0x2d37
movl (%rdi,%rdx,4), %r8d
leaq 0x1(%rdx), %rsi
cmpl %ecx, %r8d
movl %r8d, %ecx
jge 0x2d1f
cmpq %rax, %rdx
setge %al
retq
// File: /workspace/github_cpp_makefile_star2_O2/sid1607[P]avx2-merge-sort/test_sort.cpp
// Function: is_sorted_array(int*, int*, int)
bool is_sorted_array(int *out, int *ref, int len) {
  int prev = out[0];
  for (int i=0; i<len; i++) {
    if (out[i] < prev)
      return false;
    if (out[i] != ref[i])
      return false;
    prev = out[i];
  }
  return true;
}

// Assembly:
movl (%rdi), %ecx
xorl %r9d, %r9d
testl %edx, %edx
movl $0x0, %eax
cmovgl %edx, %eax
movq %r9, %r8
cmpq %r9, %rax
je 0x2d6b
movl (%rdi,%r8,4), %r10d
cmpl %ecx, %r10d
jl 0x2d6b
leaq 0x1(%r8), %r9
movl %r10d, %ecx
cmpl (%rsi,%r8,4), %r10d
je 0x2d4d
movslq %edx, %rax
cmpq %rax, %r8
setge %al
retq
// File: /workspace/github_cpp_makefile_star2_O2/sid1607[P]avx2-merge-sort/test_sort.cpp
// Function: main
int main(int argc, char *argv[]) {
  int num_iters = 1, pow_2 = 24;
  int start, end;
  srand(time(NULL));
  initialize();

  if (argc==2) {
    pow_2 = atoi(argv[1]);
  } else {
    pow_2 = 24;
  }

  start = 1 << pow_2;
  end = 1 << pow_2;

  for(int i=start; i<=end;i++) {
    for (int j=0; j<num_iters; j++) {
      if(!test_merge_sort(i))
        return 1;
    }
    std::cout << "Passed:(" << i << "," << num_iters << ")" << std::endl;
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
xorl %edi, %edi
callq 0x2100
movl %eax, %edi
callq 0x2120
callq 0x232c
cmpl $0x2, %ebp
jne 0x2fdb
movq 0x8(%rbx), %rdi
callq 0x2170
movl %eax, %ecx
jmp 0x2fde
pushq $0x18
popq %rcx
pushq $0x1
popq %r14
movl %r14d, %ebx
shll %cl, %ebx
leaq 0x10f3(%rip), %r15      # 0x40e1
leaq 0x10cb(%rip), %r12      # 0x40c0
leaq 0x111d(%rip), %r13      # 0x4119
movl %ebx, %ebp
cmpl %ebx, %ebp
jg 0x3053
movl %ebp, %edi
callq 0x2d8b
testb %al, %al
je 0x3056
movq 0x2fbc(%rip), %rdi      # 0x5fd0
movq %r15, %rsi
callq 0x2130
movq %rax, %rdi
movl %ebp, %esi
callq 0x21b0
movq %rax, %rdi
movq %r12, %rsi
callq 0x2130
movq %rax, %rdi
movl %r14d, %esi
callq 0x21b0
movq %rax, %rdi
movq %r13, %rsi
callq 0x2130
movq %rax, %rdi
callq 0x2070
incl %ebp
jmp 0x2ffe
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/board.cpp
// Function: Board::init()
void Board::init() {
    pieces = new Stone[arraySize*arraySize];
    // Initialize the board to empty
    for (int i = 0; i < arraySize*arraySize; i++)
        pieces[i] = EMPTY;

    // Initialize the edges to -1
    for (int i = 0; i < arraySize; i++) {
        pieces[index(0, i)] = -1;
        pieces[index(arraySize-1, i)] = -1;
        pieces[index(i, 0)] = -1;
        pieces[index(i, arraySize-1)] = -1;
    }

    blackCaptures = 0;
    whiteCaptures = 0;
    zobristKey = 0;
    nextID = 1;
    chainID = new int[arraySize*arraySize];
    for (int i = 0; i < arraySize*arraySize; i++)
        chainID[i] = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0x86a4(%rip), %r12      # 0xb174
movl %r12d, %r15d
imull %r15d, %r15d
leaq (,%r15,4), %r14
movq %r14, %rdi
callq 0x2030
movq %rax, (%rbx)
xorl %ecx, %ecx
cmpq %rcx, %r15
je 0x2afa
andl $0x0, (%rax,%rcx,4)
incq %rcx
jmp 0x2aec
leal -0x1(%r12), %edx
movslq %edx, %rcx
imull %r12d, %edx
movslq %edx, %rdx
xorl %esi, %esi
testl %r12d, %r12d
cmovgl %r12d, %esi
shlq $0x2, %r12
movq %rax, %rdi
subq $0x1, %rsi
jb 0x2b36
orl $-0x1, (%rax)
orl $-0x1, (%rax,%rcx,4)
orl $-0x1, (%rdi)
orl $-0x1, (%rdi,%rdx,4)
addq $0x4, %rdi
addq %r12, %rax
jmp 0x2b19
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movl $0x1, 0x18(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x20(%rbx)
xorl %ecx, %ecx
cmpq %rcx, %r15
je 0x2b60
andl $0x0, (%rax,%rcx,4)
incq %rcx
jmp 0x2b52
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/board.cpp
// Function: Board::Board(Board const&)
Board::Board(const Board &other) {
    pieces = new Stone[arraySize*arraySize];
    for (int i = 0; i < arraySize*arraySize; i++) {
        pieces[i] = other.pieces[i];
    }

    blackCaptures = other.blackCaptures;
    whiteCaptures = other.whiteCaptures;
    zobristKey = other.zobristKey;
    nextID = other.nextID;
    chainID = new int[arraySize*arraySize];
    for (int i = 0; i < arraySize*arraySize; i++)
        chainID[i] = other.chainID[i];

    unsigned int numChains = other.chainList.size();
    for (unsigned int i = 0; i < numChains; i++) {
        Chain *node = other.chainList.get(i);
        chainList.add(new Chain(*(node)));
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
andl $0x0, 0x1028(%rdi)
movq %rsi, %r14
movl 0x85e9(%rip), %r12d     # 0xb174
imull %r12d, %r12d
leaq (,%r12,4), %r15
movq %r15, %rdi
callq 0x2030
movq %rax, (%rbx)
movq (%r14), %rcx
xorl %edx, %edx
cmpq %rdx, %r12
je 0x2bb7
movl (%rcx,%rdx,4), %esi
movl %esi, (%rax,%rdx,4)
incq %rdx
jmp 0x2ba7
movq 0x8(%r14), %rax
movq %rax, 0x8(%rbx)
movq 0x10(%r14), %rax
movq %rax, 0x10(%rbx)
movl 0x18(%r14), %eax
movl %eax, 0x18(%rbx)
movq %r15, %rdi
callq 0x2030
movq %rax, 0x20(%rbx)
movq 0x20(%r14), %rcx
xorl %edx, %edx
cmpq %rdx, %r12
je 0x2bf0
movl (%rcx,%rdx,4), %esi
movl %esi, (%rax,%rdx,4)
incq %rdx
jmp 0x2be0
movl 0x1028(%r14), %ebp
xorl %r13d, %r13d
cmpl %r13d, %ebp
je 0x2c37
movslq %r13d, %rax
movq 0x28(%r14,%rax,8), %r12
movl $0x610, %edi            # imm = 0x610
callq 0x21a0
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
callq 0x5314
movl 0x1028(%rbx), %eax
movq %r15, 0x28(%rbx,%rax,8)
incl %eax
movl %eax, 0x1028(%rbx)
incl %r13d
jmp 0x2bfa
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x610, %esi            # imm = 0x610
movq %r15, %rdi
callq 0x21b0
movq %rbx, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/board.cpp
// Function: Board::deinit()
void Board::deinit() {
    delete[] pieces;
    delete[] chainID;

    for (unsigned int i = 0; i < chainList.size(); i++)
        delete chainList.get(i);
    chainList.clear();
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x2c78
callq 0x21d0
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x2c86
callq 0x21d0
xorl %ebp, %ebp
cmpl 0x1028(%rbx), %ebp
jae 0x2cb6
movslq %ebp, %rax
movq 0x28(%rbx,%rax,8), %r14
testq %r14, %r14
je 0x2ca5
movq %r14, %rdi
callq 0x5366
movl $0x610, %esi            # imm = 0x610
movq %r14, %rdi
callq 0x21b0
incl %ebp
jmp 0x2c88
andl $0x0, 0x1028(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/board.cpp
// Function: Board::updateLiberty(Chain*, int, int)
void Board::updateLiberty(Chain *node, int x, int y) {
    Stone east = pieces[index(x+1, y)];
    Stone west = pieces[index(x-1, y)];
    Stone north = pieces[index(x, y+1)];
    Stone south = pieces[index(x, y-1)];

    // If the square is empty and not already a liberty of the chain
    if (east == EMPTY && node->findLiberty(coordToMove(x+1, y)) == -1)
        node->addLiberty(coordToMove(x+1, y));
    if (west == EMPTY && node->findLiberty(coordToMove(x-1, y)) == -1)
        node->addLiberty(coordToMove(x-1, y));
    if (north == EMPTY && node->findLiberty(coordToMove(x, y+1)) == -1)
        node->addLiberty(coordToMove(x, y+1));
    if (south == EMPTY && node->findLiberty(coordToMove(x, y-1)) == -1)
        node->addLiberty(coordToMove(x, y-1));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r15d
movl %edx, %r14d
movq %rsi, %rbx
movq (%rdi), %rax
movl 0x7cac(%rip), %ecx      # 0xb174
movl %ecx, %edx
imull %r15d, %edx
leal (%rdx,%r14), %esi
incl %esi
movslq %esi, %rsi
leal -0x1(%rdx,%r14), %edx
movslq %edx, %rdx
movl (%rax,%rdx,4), %ebp
leal 0x1(%r15), %r13d
movl %ecx, %edx
imull %r13d, %edx
addl %r14d, %edx
movslq %edx, %rdx
movl (%rax,%rdx,4), %edx
movl %edx, 0x10(%rsp)
leal -0x1(%r15), %r12d
imull %r12d, %ecx
addl %r14d, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %ecx
movl %ecx, 0x14(%rsp)
cmpl $0x0, (%rax,%rsi,4)
jne 0x353e
leal 0x1(%r14), %eax
shll $0x8, %eax
orl %r15d, %eax
movzwl %ax, %esi
movq %rbx, %rdi
movl %esi, 0xc(%rsp)
callq 0x5378
cmpl $-0x1, %eax
jne 0x353e
movq %rbx, %rdi
movl 0xc(%rsp), %esi
callq 0x539c
testl %ebp, %ebp
jne 0x3568
leal -0x1(%r14), %eax
shll $0x8, %eax
orl %r15d, %eax
movzwl %ax, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x5378
cmpl $-0x1, %eax
jne 0x3568
movq %rbx, %rdi
movl %ebp, %esi
callq 0x539c
cmpl $0x0, 0x10(%rsp)
jne 0x3595
movl %r14d, %eax
shll $0x8, %eax
orl %eax, %r13d
movzwl %r13w, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x5378
cmpl $-0x1, %eax
jne 0x3595
movq %rbx, %rdi
movl %ebp, %esi
callq 0x539c
cmpl $0x0, 0x14(%rsp)
jne 0x35b6
shll $0x8, %r14d
orl %r14d, %r12d
movzwl %r12w, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x5378
cmpl $-0x1, %eax
je 0x35c5
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movl %ebp, %esi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x539c
nop
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/board.cpp
// Function: Board::mergeChains(Chain*, int, unsigned short)
void Board::mergeChains(Chain *node, int otherID, Move m) {
    // Find the chain to merge into the first chain
    Chain *temp = nullptr;
    int tempIndex = searchChainsByID(temp, otherID);

    // Update the chain id array when merging
    for (int i = 0; i < temp->size; i++) {
        Move idChange = temp->squares[i];
        chainID[index(getX(idChange), getY(idChange))] = node->id;

        node->add(idChange);
    }

    // Remove the move played from the other list of liberties
    temp->removeLiberty(temp->findLiberty(m));
    // And then merge the two lists
    for (int i = 0; i < temp->liberties; i++) {
        // If the liberty is not a repeat
        if (node->findLiberty(temp->libertyList[i]) == -1)
            node->addLiberty(temp->libertyList[i]);
    }

    // Delete the chain "temp" now since it has been fully merged in
    delete temp;
    chainList.removeFast(tempIndex);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %rsi
andq $0x0, (%rsi)
callq 0x5100
movl %eax, %ebp
xorl %r13d, %r13d
movq (%rsp), %r12
movslq 0x8(%r12), %rax
cmpq %rax, %r13
jge 0x3643
movzwl 0x10(%r12,%r13,2), %esi
movl (%r14), %eax
movq 0x20(%rbx), %rcx
movl %esi, %edx
movzbl %sil, %edi
imull 0x7b49(%rip), %edi      # 0xb174
shrl $0x8, %edx
addl %edx, %edi
movslq %edi, %rdx
movl %eax, (%rcx,%rdx,4)
movq %r14, %rdi
callq 0x5368
incq %r13
jmp 0x3603
movzwl %r15w, %esi
movq %r12, %rdi
callq 0x5378
movq %r12, %rdi
movl %eax, %esi
callq 0x53ae
xorl %r12d, %r12d
movq (%rsp), %r15
movslq 0xc(%r15), %rax
cmpq %rax, %r12
jge 0x3699
movzwl 0x410(%r15,%r12,2), %esi
movq %r14, %rdi
callq 0x5378
cmpl $-0x1, %eax
jne 0x3694
movq (%rsp), %rax
movzwl 0x410(%rax,%r12,2), %esi
movq %r14, %rdi
callq 0x539c
incq %r12
jmp 0x365c
movq %r15, %rdi
callq 0x5366
movl $0x610, %esi            # imm = 0x610
movq %r15, %rdi
callq 0x21b0
movl 0x1028(%rbx), %eax
decl %eax
movq 0x28(%rbx,%rax,8), %rcx
movslq %ebp, %rdx
movq %rcx, 0x28(%rbx,%rdx,8)
movl %eax, 0x1028(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/board.cpp
// Function: Board::isEye(int, unsigned short)
bool Board::isEye(Player p, Move m) {
    if (m == MOVE_PASS)
        return false;
    int x = getX(m);
    int y = getY(m);
    if ((pieces[index(x+1, y)] == p || pieces[index(x+1, y)] == -1)
     && (pieces[index(x-1, y)] == p || pieces[index(x-1, y)] == -1)
     && (pieces[index(x, y+1)] == p || pieces[index(x, y+1)] == -1)
     && (pieces[index(x, y-1)] == p || pieces[index(x, y-1)] == -1))
        return true;
    return false;
}

// Assembly:
cmpl $0x8000, %edx           # imm = 0x8000
je 0x3c7e
movzwl %dx, %eax
shrl $0x8, %eax
movzbl %dl, %r8d
movq (%rdi), %rcx
movl 0x757b(%rip), %edx      # 0xb174
movl %edx, %edi
imull %r8d, %edi
leal (%rdi,%rax), %r9d
incl %r9d
movslq %r9d, %r9
movl (%rcx,%r9,4), %r9d
cmpl %esi, %r9d
setne %r10b
cmpl $-0x1, %r9d
setne %r9b
testb %r9b, %r10b
jne 0x3c7e
addl %eax, %edi
decl %edi
movslq %edi, %rdi
movl (%rcx,%rdi,4), %edi
cmpl %esi, %edi
setne %r9b
cmpl $-0x1, %edi
setne %dil
testb %dil, %r9b
jne 0x3c7e
leal 0x1(%r8), %edi
imull %edx, %edi
addl %eax, %edi
movslq %edi, %rdi
movl (%rcx,%rdi,4), %edi
cmpl %esi, %edi
setne %r9b
cmpl $-0x1, %edi
setne %dil
testb %dil, %r9b
jne 0x3c7e
decl %r8d
imull %r8d, %edx
addl %eax, %edx
movslq %edx, %rax
movl (%rcx,%rax,4), %eax
cmpl %esi, %eax
sete %cl
cmpl $-0x1, %eax
sete %al
orb %cl, %al
movb $0x1, %al
jne 0x3c80
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/board.cpp
// Function: Board::getLegalMoves(int)
MoveList Board::getLegalMoves(Player p) {
    MoveList result;

    for (int j = 1; j <= boardSize; j++) {
        for (int i = 1; i <= boardSize; i++) {
            // All empty squares are legal moves
            if (pieces[index(i, j)] == EMPTY)
                result.add(coordToMove(i, j));
        }
    }

    return result;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rax
movl 0x74e1(%rip), %ecx      # 0xb170
movslq 0x74de(%rip), %rdx      # 0xb174
leal 0x1(%rcx), %r8d
xorl %edi, %edi
testl %ecx, %ecx
cmovlel %edi, %ecx
incl %ecx
shlq $0x2, %rdx
movq (%rsi), %rsi
addq %rdx, %rsi
movabsq $0x1, %r9
movq %r9, %r10
cmpq %rcx, %r10
je 0x3cf6
movw $0x100, %r11w           # imm = 0x100
movq %r9, %rbx
cmpq %rbx, %r8
je 0x3cee
cmpl $0x0, (%rsi,%rbx,4)
jne 0x3ce2
movl %r11d, %ebp
orl %r10d, %ebp
movl %edi, %r14d
movw %bp, (%rax,%r14,2)
incl %edi
incq %rbx
addl $0x100, %r11d           # imm = 0x100
jmp 0x3cc7
incq %r10
addq %rdx, %rsi
jmp 0x3cba
movl %edi, 0x400(%rax)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/board.cpp
// Function: Board::checkChains()
bool Board::checkChains() {
    bool result = false;
    int *temp = new int[arraySize*arraySize];
    int *tempPieces = new int[arraySize*arraySize];
    for (int i = 0; i < arraySize*arraySize; i++)
        temp[i] = chainID[i];
    for (int i = 0; i < arraySize*arraySize; i++)
        tempPieces[i] = pieces[i];

    for (unsigned int j = 0; j < chainList.size(); j++) {
        Chain *node = chainList.get(j);
        for (int i = 0; i < node->size; i++) {
            Move m = node->squares[i];

            if (temp[index(getX(m), getY(m))] == 0 || tempPieces[index(getX(m), getY(m))] == 0) {
                result = true;
                break;
            }

            temp[index(getX(m), getY(m))] = 0;
            tempPieces[index(getX(m), getY(m))] = 0;
        }
    }

    delete[] temp;
    delete[] tempPieces;
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl 0x7461(%rip), %ebp      # 0xb174
movl %ebp, %r12d
imull %r12d, %r12d
leaq (,%r12,4), %r15
movq %r15, %rdi
callq 0x2030
movq %rax, %r14
movq %r15, %rdi
callq 0x2030
movq %rax, %r15
movq 0x20(%rbx), %rax
xorl %ecx, %ecx
cmpq %rcx, %r12
je 0x3d4f
movl (%rax,%rcx,4), %edx
movl %edx, (%r14,%rcx,4)
incq %rcx
jmp 0x3d3e
movq (%rbx), %rax
xorl %ecx, %ecx
cmpq %rcx, %r12
je 0x3d65
movl (%rax,%rcx,4), %edx
movl %edx, (%r15,%rcx,4)
incq %rcx
jmp 0x3d54
movl 0x1028(%rbx), %eax
xorl %ecx, %ecx
xorl %r12d, %r12d
cmpl %eax, %ecx
je 0x3dc9
movslq %ecx, %rdx
movq 0x28(%rbx,%rdx,8), %rdx
movslq 0x8(%rdx), %rsi
xorl %edi, %edi
cmpq %rsi, %rdi
jge 0x3dbf
movzwl 0x10(%rdx,%rdi,2), %r8d
movzbl %r8b, %r9d
shrl $0x8, %r8d
imull %ebp, %r9d
addl %r8d, %r9d
movslq %r9d, %r9
movb $0x1, %r8b
cmpl $0x0, (%r14,%r9,4)
je 0x3dc2
cmpl $0x0, (%r15,%r9,4)
je 0x3dc2
andl $0x0, (%r14,%r9,4)
andl $0x0, (%r15,%r9,4)
incq %rdi
jmp 0x3d82
movl %r12d, %r8d
incl %ecx
movl %r8d, %r12d
jmp 0x3d70
movq %r14, %rdi
callq 0x21d0
movq %r15, %rdi
callq 0x21d0
andb $0x1, %r12b
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/board.cpp
// Function: Board::isInAtari(unsigned short)
bool Board::isInAtari(Move m) {
    if (m == MOVE_PASS)
        return false;
    int x = getX(m);
    int y = getY(m);
    assert(pieces[index(x, y)] != EMPTY);

    Chain *node = nullptr;
    searchChainsByID(node, chainID[index(x, y)]);
    if (node->liberties == 1)
        return true;

    return false;
}

// Assembly:
cmpl $0x8000, %esi           # imm = 0x8000
jne 0x4445
xorl %eax, %eax
retq
pushq %rbx
subq $0x10, %rsp
movzwl %si, %eax
leaq 0x8(%rsp), %rbx
andq $0x0, (%rbx)
shrl $0x8, %eax
movzbl %sil, %ecx
imull 0x6d10(%rip), %ecx      # 0xb174
movq 0x20(%rdi), %rdx
addl %eax, %ecx
movslq %ecx, %rax
movl (%rdx,%rax,4), %edx
movq %rbx, %rsi
callq 0x5100
movq (%rbx), %rax
cmpl $0x1, 0xc(%rax)
sete %al
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/board.cpp
// Function: Board::getPotentialCapture(unsigned short)
Move Board::getPotentialCapture(Move m) {
    if (m == MOVE_PASS)
        return MOVE_PASS;
    int x = getX(m);
    int y = getY(m);
    assert(pieces[index(x, y)] != EMPTY);

    Chain *node = nullptr;
    searchChainsByID(node, chainID[index(x, y)]);
    if (node->liberties == 1)
        return node->libertyList[0];

    return MOVE_PASS;
}

// Assembly:
movw $0x8000, %ax            # imm = 0x8000
cmpl $0x8000, %esi           # imm = 0x8000
je 0x44e0
pushq %rbx
subq $0x10, %rsp
movzwl %si, %eax
leaq 0x8(%rsp), %rbx
andq $0x0, (%rbx)
shrl $0x8, %eax
movzbl %sil, %ecx
imull 0x6cc1(%rip), %ecx      # 0xb174
movq 0x20(%rdi), %rdx
addl %eax, %ecx
movslq %ecx, %rax
movl (%rdx,%rax,4), %edx
movq %rbx, %rsi
callq 0x5100
movq (%rbx), %rcx
movw $0x8000, %ax            # imm = 0x8000
cmpl $0x1, 0xc(%rcx)
jne 0x44db
movzwl 0x410(%rcx), %eax
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/board.cpp
// Function: Board::prettyPrint()
void Board::prettyPrint() {
    // Since the y axis indexing is inverted
    for (int j = boardSize; j >= 1; j--) {
        if (j >= 10)
            std::cout << j << " ";
        else
            std::cout << " " << j << " ";

        for (int i = 1; i <= boardSize; i++) {
            if (pieces[index(i, j)] == EMPTY)
                std::cout << ". ";
            else if (pieces[index(i, j)] == BLACK)
                std::cout << "B ";
            else
                std::cout << "W ";
        }

        if (j >= 10)
            std::cout << j << " ";
        else
            std::cout << " " << j << " ";
        std::cout << std::endl;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x62ca(%rip), %ebp      # 0xb170
movq 0x610b(%rip), %r14      # 0xafb8
leaq 0x3275(%rip), %r12      # 0x8129
leaq 0x314c(%rip), %r13      # 0x8007
leaq 0x3142(%rip), %r15      # 0x8004
testl %ebp, %ebp
jle 0x4f7c
movq %r14, %rdi
cmpl $0x9, %ebp
ja 0x4ee0
movq %r14, %rdi
movq %r12, %rsi
callq 0x2190
movq %rax, %rdi
movl %ebp, %esi
callq 0x2280
movq %rax, %rdi
movq %r12, %rsi
callq 0x2190
movl %ebp, 0x4(%rsp)
movslq %ebp, %r12
pushq $0x1
popq %rbp
cmpl 0x626e(%rip), %ebp      # 0xb170
jg 0x4f3a
movq (%rbx), %rax
movslq 0x6266(%rip), %rcx      # 0xb174
imulq %r12, %rcx
addq %rbp, %rcx
movl (%rax,%rcx,4), %eax
movq %r13, %rsi
cmpl $0x1, %eax
je 0x4f27
leaq 0x30e3(%rip), %rsi      # 0x800a
testl %eax, %eax
cmoveq %r15, %rsi
movq %r14, %rdi
callq 0x2190
incq %rbp
jmp 0x4efc
movq %r14, %rdi
movl 0x4(%rsp), %ebp
cmpl $0x9, %ebp
leaq 0x31de(%rip), %r12      # 0x8129
ja 0x4f5b
movq %r14, %rdi
movq %r12, %rsi
callq 0x2190
movq %rax, %rdi
movl %ebp, %esi
callq 0x2280
movq %rax, %rdi
movq %r12, %rsi
callq 0x2190
movq %r14, %rdi
callq 0x20d0
decl %ebp
jmp 0x4ec2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/board.cpp
// Function: Board::errorPrint()
void Board::errorPrint() {
    // Since the y axis indexing is inverted
    for (int j = boardSize; j >= 1; j--) {
        if (j >= 10)
            std::cerr << j << " ";
        else
            std::cerr << " " << j << " ";

        for (int i = 1; i <= boardSize; i++) {
            if (pieces[index(i, j)] == EMPTY)
                std::cerr << ". ";
            else if (pieces[index(i, j)] == BLACK)
                std::cerr << "B ";
            else
                std::cerr << "W ";
        }

        if (j >= 10)
            std::cerr << j << " ";
        else
            std::cerr << " " << j << " ";
        std::cerr << std::endl;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x61d0(%rip), %ebp      # 0xb170
movq 0x6049(%rip), %r14      # 0xaff0
leaq 0x317b(%rip), %r12      # 0x8129
leaq 0x3052(%rip), %r13      # 0x8007
leaq 0x3048(%rip), %r15      # 0x8004
testl %ebp, %ebp
jle 0x5076
movq %r14, %rdi
cmpl $0x9, %ebp
ja 0x4fda
movq %r14, %rdi
movq %r12, %rsi
callq 0x2190
movq %rax, %rdi
movl %ebp, %esi
callq 0x2280
movq %rax, %rdi
movq %r12, %rsi
callq 0x2190
movl %ebp, 0x4(%rsp)
movslq %ebp, %r12
pushq $0x1
popq %rbp
cmpl 0x6174(%rip), %ebp      # 0xb170
jg 0x5034
movq (%rbx), %rax
movslq 0x616c(%rip), %rcx      # 0xb174
imulq %r12, %rcx
addq %rbp, %rcx
movl (%rax,%rcx,4), %eax
movq %r13, %rsi
cmpl $0x1, %eax
je 0x5021
leaq 0x2fe9(%rip), %rsi      # 0x800a
testl %eax, %eax
cmoveq %r15, %rsi
movq %r14, %rdi
callq 0x2190
incq %rbp
jmp 0x4ff6
movq %r14, %rdi
movl 0x4(%rsp), %ebp
cmpl $0x9, %ebp
leaq 0x30e4(%rip), %r12      # 0x8129
ja 0x5055
movq %r14, %rdi
movq %r12, %rsi
callq 0x2190
movq %rax, %rdi
movl %ebp, %esi
callq 0x2280
movq %rax, %rdi
movq %r12, %rsi
callq 0x2190
movq %r14, %rdi
callq 0x20d0
decl %ebp
jmp 0x4fbc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/board.cpp
// Function: Board::searchChainsByID(Chain*&, int)
inline int Board::searchChainsByID(Chain *&node, int id) {
    for (unsigned int i = 0; i < chainList.size(); i++) {
        if (chainList.get(i)->id == id) {
            node = chainList.get(i);
            return i;
        }
    }

    return -1;
}

// Assembly:
movl 0x1028(%rdi), %ecx
xorl %eax, %eax
pushq $-0x1
popq %r8
cmpl %eax, %ecx
je 0x5121
movslq %eax, %r9
movq 0x28(%rdi,%r9,8), %r9
cmpl %edx, (%r9)
je 0x5125
incl %eax
jmp 0x510c
movl %r8d, %eax
retq
movq %r9, (%rsi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/board.cpp
// Function: int Board::doCaptures<false>(int, unsigned short)
int Board::doCaptures(Player victim, Move seed) {
    if (pieces[index(getX(seed), getY(seed))] != victim)
        return 0;

    Stone *visited = new Stone[arraySize*arraySize];
    for (int i = 0; i < arraySize*arraySize; i++) {
        visited[i] = 0;
    }
    MoveList captured;

    if (isSurrounded(victim, EMPTY, getX(seed), getY(seed), visited, captured)) {
        if (updateBoard) {
            for (unsigned int i = 0; i < captured.size(); i++) {
                Move m = captured.get(i);
                pieces[index(getX(m), getY(m))] = EMPTY;
                zobristKey ^= zobristTable[zobristIndex(victim, getX(m), getY(m))];
            }

            // Record how many pieces were captured for scoring purposes
            if (victim == BLACK)
                whiteCaptures += captured.size();
            else
                blackCaptures += captured.size();
        }
    }

    delete[] visited;
    return captured.size();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movl %edx, %r15d
movq (%rdi), %rcx
movzbl %r15b, %ebp
shrl $0x8, %r15d
movl 0x6024(%rip), %r13d     # 0xb174
movl %r13d, %eax
imull %ebp, %eax
addl %r15d, %eax
movslq %eax, %rdx
xorl %eax, %eax
cmpl %esi, (%rcx,%rdx,4)
jne 0x51c2
movl %esi, %ebx
movq %rdi, %r14
imull %r13d, %r13d
leaq (,%r13,4), %rdi
callq 0x2030
movq %rax, %r12
xorl %eax, %eax
cmpq %rax, %r13
je 0x518d
andl $0x0, (%r12,%rax,4)
incq %rax
jmp 0x517e
leaq 0x14(%rsp), %r13
andl $0x0, 0x400(%r13)
movq %r13, (%rsp)
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
movl %r15d, %ecx
movl %ebp, %r8d
movq %r12, %r9
callq 0x3dea
movq %r12, %rdi
callq 0x21d0
movl 0x400(%r13), %eax
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/chain.cpp
// Function: Chain::Chain(Chain const&)
Chain::Chain(const Chain &other) {
	id = other.id;
	color = other.color;
	size = other.size;
	liberties = other.liberties;
	for (int i = 0; i < size; i++)
		squares[i] = other.squares[i];
	for (int i = 0; i < liberties; i++)
		libertyList[i] = other.libertyList[i];
}

// Assembly:
movdqu (%rsi), %xmm0
movl 0x8(%rsi), %eax
movdqu %xmm0, (%rdi)
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
cmpq %rcx, %rax
je 0x533a
movzwl 0x10(%rsi,%rcx,2), %edx
movw %dx, 0x10(%rdi,%rcx,2)
incq %rcx
jmp 0x5326
pshufd $0xff, %xmm0, %xmm0     # xmm0 = xmm0[3,3,3,3]
movd %xmm0, %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
cmpq %rcx, %rax
je 0x5364
movzwl 0x410(%rsi,%rcx,2), %edx
movw %dx, 0x410(%rdi,%rcx,2)
incq %rcx
jmp 0x534a
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/chain.cpp
// Function: Chain::findLiberty(unsigned short)
int Chain::findLiberty(Move m) {
	int index = -1;
	for (int i = 0; i < liberties; i++) {
		if (libertyList[i] == m) {
			index = i;
			break;
		}
	}
	return index;
}

// Assembly:
movl 0xc(%rdi), %edx
xorl %ecx, %ecx
testl %edx, %edx
cmovlel %ecx, %edx
pushq $-0x1
popq %rax
cmpq %rcx, %rdx
je 0x539b
cmpw %si, 0x410(%rdi,%rcx,2)
je 0x5399
incq %rcx
jmp 0x5385
movl %ecx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/mctree.cpp
// Function: MCTree::findLeaf(int&, Board&, int&)
MCNode *MCTree::findLeaf(Player &p, Board &b, int &depth) {
    MCNode *node = root;

    // Keep going until we either decide to split another child, or find a leaf
    while (node->size > 0) {
        std::uniform_int_distribution<int> distribution(0, b.getLegalMoves(p).size() / 2);
        // Create a new child for this node with some probability
        if (node != root && distribution(mc_rng) > node->size)
            break;

        // Otherwise, choose a child to follow
        double bestScore = 0.0;
        int bestIndex = 0;
        double logD = std::log(node->denominator);
        for (int i = 0; i < node->size; i++) {
            double score = (double) node->children[i]->numerator / (double) node->children[i]->denominator
                + std::sqrt(logD / (double) node->children[i]->denominator);
            if (score > bestScore) {
                bestScore = score;
                bestIndex = i;
            }
        }

        node = node->children[bestIndex];
        b.doMove(p, node->m);
        p = otherPlayer(p);
        depth++;
    }

    return node;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x448, %rsp            # imm = 0x448
movq %rcx, 0x8(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq (%rdi), %r13
cmpw $0x0, 0x12(%r13)
jle 0x5508
movl (%r15), %edx
leaq 0x44(%rsp), %rdi
movq %r14, %rsi
callq 0x3c82
movl 0x444(%rsp), %eax
andl $0x0, (%rsp)
shrl %eax
movl %eax, 0x4(%rsp)
cmpq (%r12), %r13
je 0x543d
movq %rsp, %rdi
leaq 0x8495(%rip), %rsi      # 0xd8c0
callq 0x5544
movswl 0x12(%r13), %ecx
cmpl %ecx, %eax
jg 0x5508
movl 0x4(%r13), %edi
callq 0x554c
movapd %xmm0, %xmm1
xorl %ebp, %ebp
xorpd %xmm2, %xmm2
xorl %ebx, %ebx
movsd %xmm0, 0x10(%rsp)
movswq 0x12(%r13), %rcx
movq 0x20(%r13), %rax
cmpq %rcx, %rbp
jge 0x54dc
movq (%rax,%rbp,8), %rax
cvtdq2pd (%rax), %xmm3
movapd %xmm3, %xmm4
unpckhpd %xmm3, %xmm4            # xmm4 = xmm4[1],xmm3[1]
movapd %xmm1, %xmm0
divsd %xmm4, %xmm0
ucomisd 0x2b8a(%rip), %xmm0     # 0x8010
jb 0x548e
sqrtsd %xmm0, %xmm0
jmp 0x54bd
movsd %xmm2, 0x18(%rsp)
movapd %xmm3, 0x30(%rsp)
movapd %xmm4, 0x20(%rsp)
callq 0x2130
movapd 0x20(%rsp), %xmm4
movapd 0x30(%rsp), %xmm3
movsd 0x18(%rsp), %xmm2
movsd 0x10(%rsp), %xmm1
divsd %xmm4, %xmm3
addsd %xmm0, %xmm3
ucomisd %xmm2, %xmm3
cmoval %ebp, %ebx
maxsd %xmm2, %xmm3
incq %rbp
movapd %xmm3, %xmm2
jmp 0x5458
movslq %ebx, %rcx
movq (%rax,%rcx,8), %r13
movl (%r15), %esi
movzwl 0x10(%r13), %edx
movq %r14, %rdi
callq 0x2cc2
pushq $0x3
popq %rax
subl (%r15), %eax
movl %eax, (%r15)
movq 0x8(%rsp), %rax
incl (%rax)
jmp 0x53ee
movq %r13, %rax
addq $0x448, %rsp            # imm = 0x448
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/search.cpp
// Function: scoreGame(int, Board&, float&, float&)
void scoreGame(Player p, Board &b, float &myScore, float &oppScore) {
    int whiteTerritory = 0, blackTerritory = 0;
    b.countTerritory(whiteTerritory, blackTerritory);

    myScore = b.getCapturedStones(p)
        + ((p == BLACK) ? blackTerritory : whiteTerritory);
    oppScore = b.getCapturedStones(otherPlayer(p))
        + ((p == BLACK) ? whiteTerritory : blackTerritory);

    if (p == WHITE)
        myScore += komi;
    else
        oppScore += komi;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movl %edi, %ebp
leaq 0x4(%rsp), %r13
andl $0x0, (%r13)
movq %rsp, %r15
andl $0x0, (%r15)
movq %rsi, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x3f8c
movq %r12, %rdi
movl %ebp, %esi
callq 0x4e60
cmpl $0x1, %ebp
movq %r13, %rcx
cmoveq %r15, %rcx
cmoveq %r13, %r15
addl (%rcx), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, (%r14)
pushq $0x3
popq %rsi
subl %ebp, %esi
movq %r12, %rdi
callq 0x4e60
addl (%r15), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, (%rbx)
cmpl $0x2, %ebp
jne 0x628c
movss (%r14), %xmm0
cmoveq %r14, %rbx
addss 0x4ee8(%rip), %xmm0     # 0xb180
movss %xmm0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/./mctree.h
// Function: MCNode::MCNode()
MCNode() {
        numerator = 0;
        denominator = 1;
        scoreDiff = 0;
        m = 0;
        size = 0;
        parent = NULL;
        children = new MCNode *[512];
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
andl $0x0, 0x10(%rdi)
andq $0x0, 0x18(%rdi)
movl $0x1000, %edi           # imm = 0x1000
callq 0x2030
movq %rax, 0x20(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/./types.h
// Function: GoArrayList<unsigned short>::find(unsigned short)
int find(T o) {
        int index = -1;
        for (unsigned int i = 0; i < length; i++) {
            if (arrayList[i] == o) {
                index = (int) i;
                break;
            }
        }
        return index;
    }

// Assembly:
movl 0x400(%rdi), %edx
xorl %ecx, %ecx
pushq $-0x1
popq %rax
cmpq %rdx, %rcx
jae 0x6365
cmpw %si, (%rdi,%rcx,2)
je 0x6363
incq %rcx
jmp 0x6353
movl %ecx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/search.cpp
// Function: HistoryTable::max()
int max() {
        int result = -(1 << 30);
        for (int i = 0; i < 23; i++)
            for (int j = 0; j < 23; j++)
                if (data[i][j] > result)
                    result = data[i][j];
        return result;
    }

// Assembly:
movl $0xc0000000, %eax       # imm = 0xC0000000
xorl %ecx, %ecx
cmpq $0x17, %rcx
je 0x63f5
xorl %edx, %edx
cmpq $0x17, %rdx
je 0x63ec
movl (%rdi,%rdx,4), %esi
cmpl %eax, %esi
cmovgl %esi, %eax
incq %rdx
jmp 0x63d9
incq %rcx
addq $0x5c, %rdi
jmp 0x63d1
retq
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/./mctree.h
// Function: MCNode::cleanup()
void cleanup() {
        for (int i = 0; i < size; i++) {
            children[i]->cleanup();
            delete children[i];
        }
        delete[] children;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r15d, %r15d
pushq $0x28
popq %r14
movswq 0x12(%rbx), %rax
movq 0x20(%rbx), %rdi
cmpq %rax, %r15
jge 0x64a3
movq (%rdi,%r15,8), %rdi
callq 0x6468
movq 0x20(%rbx), %rax
movq (%rax,%r15,8), %rdi
movq %r14, %rsi
callq 0x21b0
incq %r15
jmp 0x6477
testq %rdi, %rdi
je 0x64b2
popq %rbx
popq %r14
popq %r15
jmp 0x21d0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/gtp.cpp
// Function: split(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char)
vector<string> split(const string &s, char d) {
    vector<string> v;
    stringstream ss(s);
    string item;
    while (getline(ss, item, d)) {
        v.push_back(item);
    }
    return v;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movl %edx, %ebp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
leaq 0x20(%rsp), %rdi
pushq $0x18
popq %rdx
callq 0x2240
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movsbl %bpl, %ebp
leaq 0x20(%rsp), %r14
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x22b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x7559
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7720
jmp 0x7531
movq %rsp, %rdi
callq 0x22c8
leaq 0x20(%rsp), %rdi
callq 0x2110
movq %rbx, %rax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x7596
movq %rax, %r14
movq %rsp, %rdi
callq 0x22c8
leaq 0x20(%rsp), %rdi
callq 0x2110
movq %rbx, %rdi
callq 0x76fe
movq %r14, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O2/jeffreyan11[P]go-engine/gtp.cpp
// Function: stringToColor(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Player stringToColor(string colorString) {
    if (colorString == "black" || colorString == "b" || colorString == "B")
        return BLACK;
    else if (colorString == "white" || colorString == "w" || colorString == "W")
        return WHITE;
    else
        return EMPTY;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xc29(%rip), %rsi       # 0x81dc
callq 0x76a5
pushq $0x1
popq %rbp
testb %al, %al
jne 0x7622
leaq 0xc1c(%rip), %rsi       # 0x81e2
movq %rbx, %rdi
callq 0x76a5
testb %al, %al
jne 0x7622
leaq 0xb1b(%rip), %rsi       # 0x80f4
movq %rbx, %rdi
callq 0x76a5
testb %al, %al
jne 0x7622
leaq 0xbf8(%rip), %rsi       # 0x81e4
movq %rbx, %rdi
callq 0x76a5
pushq $0x2
popq %rbp
testb %al, %al
jne 0x7622
leaq 0xbe8(%rip), %rsi       # 0x81ea
movq %rbx, %rdi
callq 0x76a5
testb %al, %al
jne 0x7622
leaq 0xb05(%rip), %rsi       # 0x811a
movq %rbx, %rdi
callq 0x76a5
movzbl %al, %ebp
addl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop