LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/antoniogarro[P]Hara/heuristics.cpp
// Function: Goban::last_atari_heuristic() const
int Goban::last_atari_heuristic() const
{
  if (Group *group = last_atari[!side]) {
    int move = group->get_liberty(0);
    if (is_legal(move, side) &&
        !is_self_atari(move, side) &&
        gains_liberties(move, group)) {
      return move;
    }
  }
  
  PointList<MAXSIZE2> save;
  if (last_atari[side]) {
    atari_escapes(last_atari[side], save);
    if (int move = random_choose(save, &Goban::heavy_policy)) {
      return move;
    }
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x5b8, %rsp            # imm = 0x5B8
movq %rdi, %rbx
movzbl (%rdi), %eax
movl %eax, %ecx
xorl $0x1, %ecx
movq 0xd63d0(%rdi,%rcx,8), %r14
testq %r14, %r14
je 0x8570
movl 0x5ac(%r14), %ebp
movzbl %al, %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x56e8
testb %al, %al
je 0x8570
movzbl (%rbx), %edx
movq %rbx, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x8ee4
cmpl $0x1, %eax
je 0x8570
movl 0x96c(%r14), %r15d
movzbl (%r14), %edx
movq %rbx, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
movl %r15d, %r8d
movq %r14, %r9
callq 0x8ee4
cmpl %r15d, %eax
jg 0x85c5
leaq 0x77d9(%rip), %rax      # 0xfd50
movq %rax, 0x8(%rsp)
xorl %eax, %eax
movl %eax, 0x5b4(%rsp)
movl %eax, 0x10(%rsp)
movzbl (%rbx), %eax
movq 0xd63d0(%rbx,%rax,8), %rsi
testq %rsi, %rsi
je 0x85c3
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x87b6
leaq -0x412(%rip), %rdx      # 0x819e
movq %rbx, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x8060
movl %eax, %ebp
testl %eax, %eax
jne 0x85c5
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x5b8, %rsp            # imm = 0x5B8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/antoniogarro[P]Hara/heuristics.cpp
// Function: Goban::save_heuristic(int, PList&) const
void Goban::save_heuristic(int point, PList &list) const
{
  if (points[point] && points[point]->get_nliberties() == 2) {
    for (int i = 0; i < 2; i++) {
      int lib = points[point]->get_liberty(i);
      if (gains_liberties(lib, points[point])) {
        list.add(lib);
      }
    }
  }
  GroupSet<4> neigh;
  int nneigh = neighbour_groups(point, neigh);
  for (int j = 0; j < nneigh; j++) {
    if (neigh[j]->get_color() == side && neigh[j]->get_nliberties() == 2) { // <2?
      atari_escapes(neigh[j], list);
    }
  }
/*TODO!!!
  for (int i = 0; i < 8; i++) {
    if (int v = vicinity[point][i]) {
      if (points[v] != 0 && points[v]->get_color() == side && points[v]->get_nliberties() == 1) {
        atari_escapes(points[v], list);
      }
    }
  }
*/
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movl %esi, 0xc(%rsp)
movslq %esi, %r13
movq 0x18(%rdi,%r13,8), %rax
testq %rax, %rax
je 0x8651
cmpl $0x2, 0x96c(%rax)
jne 0x8651
movb $0x1, %bpl
xorl %eax, %eax
movq 0x18(%r14,%r13,8), %r9
movl 0x5ac(%r9,%rax,4), %r15d
movl 0x96c(%r9), %r12d
movzbl (%r9), %edx
movq %r14, %rdi
movl %r15d, %esi
xorl %ecx, %ecx
movl %r12d, %r8d
callq 0x8ee4
cmpl %r12d, %eax
jle 0x8641
movq (%rbx), %rax
movq %rbx, %rdi
movl %r15d, %esi
callq *(%rax)
movl $0x1, %eax
testb $0x1, %bpl
movl $0x0, %ebp
jne 0x8609
leaq 0x10(%rsp), %rdx
movl $0x0, 0x30(%rdx)
movq $0x0, (%rdx)
movq %r14, %rdi
movl 0xc(%rsp), %esi
callq 0x533c
testl %eax, %eax
jle 0x86a2
movl %eax, %r15d
xorl %r12d, %r12d
movq 0x10(%rsp,%r12,8), %rsi
movb (%r14), %al
cmpb (%rsi), %al
jne 0x869a
cmpl $0x2, 0x96c(%rsi)
jne 0x869a
movq %r14, %rdi
movq %rbx, %rdx
callq 0x87b6
incq %r12
cmpq %r12, %r15
jne 0x867a
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/antoniogarro[P]Hara/heuristics.cpp
// Function: Goban::pattern_heuristic(int, PList&) const
void Goban::pattern_heuristic(int point, PList &list) const
{
  for (int i = 0; i < 8; i++) {
    if (int v = vicinity[point][i]) {
      if (points[v] == 0 && match_mogo_pattern(v, side)) {
        list.add(v);
      }
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movslq %esi, %rax
shlq $0x6, %rax
leaq (%rax,%rdi), %r12
addq $0xd9c78, %r12          # imm = 0xD9C78
xorl %r13d, %r13d
movslq (%r12,%r13,4), %r15
testq %r15, %r15
je 0x8705
cmpq $0x0, 0x18(%r14,%r15,8)
jne 0x8705
movzbl (%r14), %edx
movq %r14, %rdi
movl %r15d, %esi
callq 0x89a4
testb %al, %al
je 0x8705
movq (%rbx), %rax
movq %rbx, %rdi
movl %r15d, %esi
callq *(%rax)
incq %r13
cmpq $0x8, %r13
jne 0x86d6
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/antoniogarro[P]Hara/heuristics.cpp
// Function: Goban::capture_heuristic(int, PList&) const
void Goban::capture_heuristic(int point, PList &list) const
{
  for (int i = 0; i < 8; i++) {
    Group *group = points[vicinity[point][i]];
    if (group && group->get_color() != side && group->has_one_liberty()) {
      //atari_escapes(group, list);??
      int lib = group->get_liberty(0);
      if (gains_liberties(lib, group)) {
          list.add(lib);
      }
    }
}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movslq %esi, %rax
shlq $0x6, %rax
leaq (%rax,%rdi), %r15
addq $0xd9c78, %r15          # imm = 0xD9C78
xorl %r12d, %r12d
movslq (%r15,%r12,4), %rax
movq 0x18(%r14,%rax,8), %r9
testq %r9, %r9
je 0x8786
movb (%r9), %al
cmpb %al, (%r14)
je 0x8786
cmpl $0x1, 0x96c(%r9)
jne 0x8786
movl 0x5ac(%r9), %ebp
movzbl %al, %edx
movq %r14, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x8ee4
cmpl $0x2, %eax
jl 0x8786
movq (%rbx), %rax
movq %rbx, %rdi
movl %ebp, %esi
callq *(%rax)
incq %r12
cmpq $0x8, %r12
jne 0x873b
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/antoniogarro[P]Hara/heuristics.cpp
// Function: Goban::gains_liberties(int, Group const*) const
bool Goban::gains_liberties(int point, const Group *group) const
{
  int curr_liberties = 1;
  if (group) curr_liberties = group->get_nliberties();
  int nlibs = total_liberties(point, group->get_color(), 0, curr_liberties, group);
  return nlibs > curr_liberties;
}

// Assembly:
pushq %rbx
movq %rdx, %r9
movl 0x96c(%rdx), %ebx
movzbl (%rdx), %edx
xorl %ecx, %ecx
movl %ebx, %r8d
callq 0x8ee4
cmpl %ebx, %eax
setg %al
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/antoniogarro[P]Hara/heuristics.cpp
// Function: Goban::atari_escapes(Group const*, PList&) const
int Goban::atari_escapes(const Group *group, PList &escapes) const
{
  for (Group::LibertyIterator lib(group); lib; ++lib) {
    if (gains_liberties(*lib, group)) {
      escapes.add(*lib);
    }
  }
  GroupSet<MAXSIZE2/3> neighbours;
  int nneigh = neighbour_groups(group, !group->get_color(), group->get_nliberties(), neighbours);
  for (int i = 0; i < nneigh; i++) {
    for (Group::LibertyIterator lib(neighbours[i]); lib; ++lib) {
      if (gains_liberties(*lib, group)) {
        escapes.add(*lib);
      }
    }
  }
  return escapes.length();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x5b8, %rsp            # imm = 0x5B8
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl 0x5ac(%rsi), %esi
testl %esi, %esi
je 0x8819
leaq 0x5b0(%r14), %r12
movl 0x96c(%r14), %ebp
movzbl (%r14), %edx
movq %r15, %rdi
xorl %ecx, %ecx
movl %ebp, %r8d
movq %r14, %r9
callq 0x8ee4
cmpl %ebp, %eax
jle 0x880d
movl -0x4(%r12), %esi
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movl (%r12), %esi
addq $0x4, %r12
testl %esi, %esi
jne 0x87e1
leaq 0x10(%rsp), %r8
movl $0x0, 0x5a0(%r8)
movq $0x0, (%r8)
movzbl (%r14), %edx
movl 0x96c(%r14), %ecx
xorl $0x1, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x54ba
testl %eax, %eax
jle 0x88b1
movl %eax, %eax
movq %rax, 0x8(%rsp)
xorl %r13d, %r13d
movq 0x10(%rsp,%r13,8), %r12
movl 0x5ac(%r12), %esi
testl %esi, %esi
je 0x88a7
addq $0x5b0, %r12            # imm = 0x5B0
movl 0x96c(%r14), %ebp
movzbl (%r14), %edx
movq %r15, %rdi
xorl %ecx, %ecx
movl %ebp, %r8d
movq %r14, %r9
callq 0x8ee4
cmpl %ebp, %eax
jle 0x889b
movl -0x4(%r12), %esi
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movl (%r12), %esi
addq $0x4, %r12
testl %esi, %esi
jne 0x886f
incq %r13
cmpq 0x8(%rsp), %r13
jne 0x8857
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
addq $0x5b8, %rsp            # imm = 0x5B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/antoniogarro[P]Hara/heuristics.cpp
// Function: Goban::nakade_heuristic(int, PList&) const
void Goban::nakade_heuristic(int point, PList &list) const
{
  for (int i = 0; i < 8; i++) {
    if (int v = vicinity[point][i]) {
      if (points[v] == 0 && (creates_eyes(v, 0) > 1 || creates_eyes(v, 1) > 1)) {
        list.add(v);
      }
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movslq %esi, %rax
shlq $0x6, %rax
leaq (%rax,%rdi), %r12
addq $0xd9c78, %r12          # imm = 0xD9C78
xorl %r13d, %r13d
movslq (%r12,%r13,4), %r15
testq %r15, %r15
je 0x8933
cmpq $0x0, 0x18(%r14,%r15,8)
jne 0x8933
movq %r14, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x8946
cmpl $0x1, %eax
jg 0x8928
movq %r14, %rdi
movl %r15d, %esi
movl $0x1, %edx
callq 0x8946
cmpl $0x2, %eax
jl 0x8933
movq (%rbx), %rax
movq %rbx, %rdi
movl %r15d, %esi
callq *(%rax)
incq %r13
cmpq $0x8, %r13
jne 0x88f0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/antoniogarro[P]Hara/heuristics.cpp
// Function: Goban::creates_eyes(int, bool) const
int Goban::creates_eyes(int point, bool color) const
{
  int neyes = 0;
  for (int i = 0; adjacent[point][i]; i++) {
    if (is_true_eye(adjacent[point][i], color, point)) {
      neyes++;
    }
  }
#ifdef DEBUG_INFO
  if (neyes) {
    std::cerr << point << " creates " << neyes << " eyes\n";
  }
#endif
  return neyes;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movslq %esi, %rax
leaq (%rax,%rax,4), %rax
movl 0xd63e8(%rdi,%rax,4), %esi
testl %esi, %esi
je 0x8996
movq %rdi, %r14
leaq (%rdi,%rax,4), %r12
addq $0xd63ec, %r12          # imm = 0xD63EC
xorl %ebp, %ebp
movzbl %dl, %r15d
movq %r14, %rdi
movl %r15d, %edx
movl %ebx, %ecx
callq 0x55d6
movzbl %al, %eax
addl %eax, %ebp
movl (%r12), %esi
addq $0x4, %r12
testl %esi, %esi
jne 0x8976
jmp 0x8998
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/antoniogarro[P]Hara/heuristics.cpp
// Function: Goban::stones_around(int, int) const
bool Goban::stones_around(int point, int distance) const
{
  for (int i = 0; i < distance; i++) {
    for (int j = 0; j < 4*(i+1); j++) {
      int v =  within_manhattan[point][i][j];
      if (is_occupied(v)) return true;
    }
  }
  return false;
}

// Assembly:
testl %edx, %edx
jle 0x8edf
movslq %esi, %rax
movl %edx, %ecx
leaq (%rax,%rax,4), %rax
shlq $0x6, %rax
leaq (%rax,%rdi), %rdx
addq $0xdfca0, %rdx          # imm = 0xDFCA0
movb $0x1, %al
xorl %esi, %esi
incq %rsi
leal (,%rsi,4), %r8d
xorl %r9d, %r9d
movslq (%rdx,%r9,4), %r10
cmpq $0x0, 0x18(%rdi,%r10,8)
jne 0x8ee1
incq %r9
cmpq %r8, %r9
jb 0x8ebc
cmpq %rcx, %rsi
setb %al
addq $0x50, %rdx
cmpq %rcx, %rsi
jne 0x8eae
xorl %eax, %eax
andb $0x1, %al
retq
// File: /workspace/github_cpp_makefile_star2_O3/antoniogarro[P]Hara/heuristics.cpp
// Function: Goban::bad_self_atari(int, bool) const
bool Goban::bad_self_atari(int point, bool color) const
{
  int last_lib = atari_last_liberty(point, color);
  if (last_lib == -1) return false;
#ifdef DEBUG_INFO
  std::cerr << "self_atari at " << point << "\n";
#endif

  //Only handle throw-ins up to 2 stones:?
  //if (neighbours_size(point, color) < 2) {
    if (total_liberties(last_lib, !color, 0) < 2) {
#ifdef DEBUG_INFO
      std::cerr << "snapback\n";
#endif  
      return false;
    }
    if (creates_eyes(point, !color) && !creates_eyes(last_lib, !color)) {
#ifdef DEBUG_INFO
        std::cerr << "throw-in\n";
#endif
      return false;
    }
  //}
  if (nakade_shape(point, color)) {
#ifdef DEBUG_INFO
    std::cerr << "nakade\n";
#endif
    return false;
  }
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x5b8, %rsp            # imm = 0x5B8
movl %edx, %ebp
movl %esi, %ebx
movq %rdi, %r14
xorl %r15d, %r15d
leaq 0x8(%rsp), %r12
movl %r15d, 0x5ac(%r12)
movl %r15d, 0x8(%r12)
leaq 0x6a54(%rip), %rax      # 0xfcf0
movq %rax, (%r12)
movq %r12, %rcx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x8ee4
cmpl $0x1, %eax
setne %al
movl 0x8(%r12), %r12d
cmpl $-0x1, %r12d
sete %cl
orb %al, %cl
jne 0x932a
movl %ebp, %eax
xorb $0x1, %al
movzbl %al, %r13d
xorl %r15d, %r15d
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x8ee4
cmpl $0x2, %eax
jl 0x932a
movq %r14, %rdi
movl %ebx, %esi
movl %r13d, %edx
callq 0x8946
testl %eax, %eax
je 0x9310
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x8946
testl %eax, %eax
je 0x9327
movzbl %bpl, %edx
movq %r14, %rdi
movl %ebx, %esi
callq 0x9340
movl %eax, %r15d
xorb $0x1, %r15b
jmp 0x932a
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x5b8, %rsp            # imm = 0x5B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/antoniogarro[P]Hara/heuristics.cpp
// Function: Goban::nakade_shape(int, bool) const
bool Goban::nakade_shape(int point, bool color) const
{
  int bulk = neighbour_bulkiness(point, color);
      
  switch(neighbours_size(point, color)) {
    case 2:
      return true;
      break;
    case 3:
      if (bulk == 3) return true;
      break;
    case 4:
      if (bulk == 4 || bulk == 3) return true;    //TODO.  
      break;
    case 5:
      if (bulk == 4) return true;
      break;
    default:
      return false;
  }
  return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %r15
callq 0x941c
movl %eax, %ebx
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x5506
movl %eax, %ecx
addl $-0x2, %ecx
cmpl $0x3, %ecx
ja 0x938e
movb $0x1, %al
leaq 0x242e(%rip), %rdx      # 0xb7a4
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
cmpl $0x3, %ebx
jne 0x938e
jmp 0x9390
addl $-0x3, %ebx
cmpl $0x2, %ebx
jb 0x9390
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x4, %ebx
jne 0x938e
jmp 0x9390
// File: /workspace/github_cpp_makefile_star2_O3/antoniogarro[P]Hara/heuristics.cpp
// Function: Goban::neighbour_bulkiness(int, bool) const
int Goban::neighbour_bulkiness(int point, bool color) const
{
  GroupSet<4> neighbours;
  int nneigh = neighbour_groups(point, neighbours);
  int max_bulkiness = nneigh;
  for (int i = 0; i < nneigh; i++) {
    Group *neigh = neighbours[i];
    if (neigh->get_color() == color) {
      int bulk = bulkiness(neigh, point);
      if (bulk > max_bulkiness) max_bulkiness = bulk;
    }
  }
  return max_bulkiness;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movq %rsp, %rdx
movl $0x0, 0x30(%rdx)
movq $0x0, (%rdx)
callq 0x533c
movl %eax, %r15d
testl %eax, %eax
jle 0x9475
movl %r15d, %r12d
xorl %r13d, %r13d
movq (%rsp,%r13,8), %rsi
cmpb %bl, (%rsi)
jne 0x946d
movq %r14, %rdi
movl %ebp, %edx
callq 0x93a2
cmpl %r15d, %eax
cmovgl %eax, %r15d
incq %r13
cmpq %r13, %r12
jne 0x9454
movl %r15d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/antoniogarro[P]Hara/tree.cpp
// Function: Node::set_amaf(int, AmafBoard const&, bool, int)
void Node::set_amaf(int result, const AmafBoard &amaf, bool side, int depth)
{
  const double discount = 0.0; //0.0001;
  for (Node *next = child; next; next = next->sibling) {
    next->rave_results += result * amaf.value(next->move, depth, side, discount);
    next->rave_visits += amaf.value(next->move, depth, side, discount);
  }
}

// Assembly:
movq 0x38(%rdi), %rax
testq %rax, %rax
je 0x9bbc
cvtsi2sd %esi, %xmm0
movsd 0x1ce7(%rip), %xmm1     # 0xb840
movsd 0x14bf(%rip), %xmm2     # 0xb020
movslq (%rax), %rsi
testq %rsi, %rsi
je 0x9b93
movl (%rdx,%rsi,4), %esi
movl %esi, %edi
negl %edi
testb %cl, %cl
cmovel %esi, %edi
xorps %xmm4, %xmm4
cvtsi2sd %edi, %xmm4
mulsd %xmm1, %xmm4
addsd %xmm2, %xmm4
xorpd %xmm3, %xmm3
cmpl %r8d, %edi
jl 0x9b97
movapd %xmm4, %xmm3
jmp 0x9b97
xorpd %xmm3, %xmm3
movapd %xmm0, %xmm4
mulsd %xmm3, %xmm4
addsd 0x20(%rax), %xmm4
movsd %xmm4, 0x20(%rax)
addsd 0x18(%rax), %xmm3
movsd %xmm3, 0x18(%rax)
movq 0x40(%rax), %rax
testq %rax, %rax
jne 0x9b61
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/antoniogarro[P]Hara/tree.cpp
// Function: Node::get_value(double) const
double Node::get_value(double parent_visits) const
{
  const double BIAS = 1.0/3000, UCTK = 0.0;
  if (visits) {
    if (rave_visits) {
      double beta = rave_visits/(rave_visits + visits + rave_visits*visits*BIAS);
      return (1.0-beta)*results/visits + beta*rave_results/rave_visits;
    } else {
      return results/visits + UCTK*sqrt(log(parent_visits)/visits);
    }
  } else if (rave_visits) {
      return rave_results/rave_visits;
  }
  return 1.0;   //first player urgency.
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movsd 0x8(%rdi), %xmm1
movsd 0x18(%rdi), %xmm2
xorpd %xmm3, %xmm3
ucomisd %xmm3, %xmm1
jne 0x9bdc
jnp 0x9c38
ucomisd %xmm3, %xmm2
jne 0x9be4
jnp 0x9c4b
movapd %xmm1, %xmm0
addsd %xmm2, %xmm0
movapd %xmm1, %xmm3
mulsd %xmm2, %xmm3
mulsd 0x1c4c(%rip), %xmm3     # 0xb848
addsd %xmm0, %xmm3
unpcklpd %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0]
divsd %xmm3, %xmm2
movsd 0x1410(%rip), %xmm0     # 0xb020
subsd %xmm2, %xmm0
movupd 0x10(%rbx), %xmm3
unpcklpd %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0]
movhpd 0x20(%rbx), %xmm3       # xmm3 = xmm3[0],mem[0]
mulpd %xmm0, %xmm3
divpd %xmm1, %xmm3
movapd %xmm3, %xmm0
unpckhpd %xmm3, %xmm0            # xmm0 = xmm0[1],xmm3[1]
addsd %xmm3, %xmm0
jmp 0x9c91
ucomisd %xmm3, %xmm2
jne 0x9c40
jnp 0x9c74
movsd 0x20(%rbx), %xmm0
divsd %xmm2, %xmm0
jmp 0x9c91
movsd 0x10(%rbx), %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, 0x8(%rsp)
callq 0x3170
divsd 0x8(%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x9c7e
sqrtsd %xmm0, %xmm0
jmp 0x9c87
movsd 0x13a4(%rip), %xmm0     # 0xb020
jmp 0x9c91
callq 0x3160
xorpd %xmm1, %xmm1
mulsd %xmm1, %xmm0
addsd 0x8(%rsp), %xmm0
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/antoniogarro[P]Hara/tree.cpp
// Function: Node::select_child() const
Node *Node::select_child() const
{
  double best_value = -1;
  Node *RAVE_child = 0;
  for (Node *next = child; next; next = next->sibling) {
    if (next->get_value(visits) > best_value) {
      best_value = next->get_value(visits);
      RAVE_child = next;
    }
  }
  return RAVE_child;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq 0x38(%rdi), %r14
testq %r14, %r14
je 0x9cf4
movq %rdi, %rbx
movsd 0x1b9b(%rip), %xmm0     # 0xb850
movsd %xmm0, 0x8(%rsp)
xorl %r15d, %r15d
movsd 0x8(%rbx), %xmm0
movq %r14, %rdi
callq 0x9bbe
ucomisd 0x8(%rsp), %xmm0
jbe 0x9ce9
movsd 0x8(%rbx), %xmm0
movq %r14, %rdi
callq 0x9bbe
movsd %xmm0, 0x8(%rsp)
movq %r14, %r15
movq 0x40(%r14), %r14
testq %r14, %r14
jne 0x9cbe
jmp 0x9cf7
xorl %r15d, %r15d
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/antoniogarro[P]Hara/tree.cpp
// Function: Node::get_best_child() const
Node *Node::get_best_child() const
{
  //return select_child();
  Node *best_child = 0;
  double best_visits = 0;
  for (Node *next = child; next; next = next->sibling) {
    double curr_visits = next->visits + next->rave_visits;
    if (curr_visits > best_visits) {
      best_visits = curr_visits;
      best_child= next;
    }
  }
  return best_child;
}

// Assembly:
movq 0x38(%rdi), %rcx
testq %rcx, %rcx
je 0x9d37
xorpd %xmm0, %xmm0
xorl %eax, %eax
movsd 0x8(%rcx), %xmm1
addsd 0x18(%rcx), %xmm1
ucomisd %xmm0, %xmm1
cmovaq %rcx, %rax
maxsd %xmm0, %xmm1
movq 0x40(%rcx), %rcx
movapd %xmm1, %xmm0
testq %rcx, %rcx
jne 0x9d13
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/antoniogarro[P]Hara/tree.cpp
// Function: Tree::insert(Node*, int, Prior const&)
Node *Tree::insert(Node *parent, int move, const Prior &prior)
{
  if (size[active] < maxsize) {
    Node *child = root[active] + size[active]++;
    child->reset();
    parent->add_child(child);
    child->set_move(move, prior);
    return child;
  } else {
    std::cerr << "WARNING: Out of memory!\n";
    return 0;
  }
}

// Assembly:
pushq %rax
movslq 0x1c(%rdi), %rax
movslq 0x10(%rdi,%rax,4), %r8
cmpl 0x18(%rdi), %r8d
jge 0xa281
movq (%rdi,%rax,8), %r9
leal 0x1(%r8), %r10d
movl %r10d, 0x10(%rdi,%rax,4)
leaq (%r8,%r8,8), %rax
leaq (%r9,%rax,8), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
movups %xmm0, 0x8(%rax)
movups %xmm0, 0x38(%rax)
movq 0x38(%rsi), %rdi
testq %rdi, %rdi
je 0xa29d
movq %rdi, %rsi
movq 0x40(%rdi), %rdi
testq %rdi, %rdi
jne 0xa26f
addq $0x40, %rsi
jmp 0xa2a1
movq 0x5d68(%rip), %rdi      # 0xfff0
leaq 0x15e8(%rip), %rsi      # 0xb877
movl $0x18, %edx
callq 0x31f0
xorl %eax, %eax
jmp 0xa2b5
addq $0x38, %rsi
movq %rax, (%rsi)
movl %edx, (%rax)
movups (%rcx), %xmm0
movhps %xmm0, 0x18(%rax)
movlps %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
popq %rcx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/antoniogarro[P]Hara/tree.cpp
// Function: Tree::insert(Node*, Node const*)
Node *Tree::insert(Node *parent, const Node *orig)
{
  if (size[1-active] < maxsize) {
    Node *child = root[1-active] + size[1-active]++;
    child->copy_values(orig);
    parent->add_child(child);
    return child;
  } else {
    std::cerr << "WARNING: Out of memory!\n";
    return 0;
  }
}

// Assembly:
pushq %rax
movslq 0x1c(%rdi), %rcx
movl $0x1, %eax
subq %rcx, %rax
movslq 0x10(%rdi,%rax,4), %rcx
cmpl 0x18(%rdi), %ecx
jge 0xa322
movq (%rdi,%rax,8), %r8
leal 0x1(%rcx), %r9d
movl %r9d, 0x10(%rdi,%rax,4)
leaq (%rcx,%rcx,8), %rax
leaq (%r8,%rax,8), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rax)
movups 0x8(%rdx), %xmm0
movups %xmm0, 0x8(%rax)
movups 0x18(%rdx), %xmm0
movups %xmm0, 0x18(%rax)
movups 0x28(%rdx), %xmm0
movups %xmm0, 0x28(%rax)
movl (%rdx), %ecx
movl %ecx, (%rax)
movq 0x38(%rsi), %rcx
testq %rcx, %rcx
je 0xa33e
movq %rcx, %rsi
movq 0x40(%rcx), %rcx
testq %rcx, %rcx
jne 0xa310
addq $0x40, %rsi
jmp 0xa342
movq 0x5cc7(%rip), %rdi      # 0xfff0
leaq 0x1547(%rip), %rsi      # 0xb877
movl $0x18, %edx
callq 0x31f0
xorl %eax, %eax
jmp 0xa345
addq $0x38, %rsi
movq %rax, (%rsi)
popq %rcx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/antoniogarro[P]Hara/tree.cpp
// Function: Tree::promote(int)
int Tree::promote(int new_root)
{
  for (Node *n = root[active]->get_child(); n; n = n->get_sibling()) {
    if (n->get_move() == new_root) {
      root[1-active]->copy_values(n);
      copy_recursive(root[1-active], n);
      clear_active();
      active = 1-active;
      return active;
    }
  }
  clear();
  return active;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movslq 0x1c(%rdi), %rax
movq (%rdi,%rax,8), %rcx
movq 0x38(%rcx), %rdx
testq %rdx, %rdx
je 0xa3ab
cmpl %esi, (%rdx)
je 0xa3e9
movq 0x40(%rdx), %rdx
jmp 0xa39c
xorl %eax, %eax
movl %eax, 0x1c(%rbx)
movq (%rbx), %rcx
movl %eax, (%rcx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rcx)
movups %xmm0, 0x18(%rcx)
movups %xmm0, 0x38(%rcx)
movq 0x8(%rbx), %rcx
movl %eax, (%rcx)
movups %xmm0, 0x8(%rcx)
movups %xmm0, 0x18(%rcx)
movups %xmm0, 0x38(%rcx)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x10(%rbx)
movl 0x1c(%rbx), %eax
jmp 0xa460
movl $0x1, %ecx
movl $0x1, %esi
subq %rax, %rsi
movq (%rbx,%rsi,8), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rax)
movups 0x8(%rdx), %xmm0
movups %xmm0, 0x8(%rax)
movups 0x18(%rdx), %xmm0
movups %xmm0, 0x18(%rax)
movups 0x28(%rdx), %xmm0
movups %xmm0, 0x28(%rax)
movl (%rdx), %esi
movl %esi, (%rax)
movslq 0x1c(%rbx), %rax
subq %rax, %rcx
movq (%rbx,%rcx,8), %rsi
movq %rbx, %rdi
callq 0xa348
movslq 0x1c(%rbx), %rcx
movl $0x1, %eax
movl %eax, 0x10(%rbx,%rcx,4)
movslq 0x1c(%rbx), %rcx
movq (%rbx,%rcx,8), %rcx
movl $0x0, (%rcx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rcx)
movups %xmm0, 0x18(%rcx)
movups %xmm0, 0x38(%rcx)
subl 0x1c(%rbx), %eax
movl %eax, 0x1c(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/antoniogarro[P]Hara/tree.cpp
// Function: Tree::expand(Node*, int const*, int, Prior const*)
int Tree::expand(Node *parent, const int *moves, int nmovs, const Prior priors[])
{
  //if (parent->has_childs()) return 0; //No need to expand, but we check before calling.
  for (int i = 0; i < nmovs; i++) {
    if (insert(parent, moves[i], priors[moves[i]]) == 0) {  //Out of memory.
      return -1;
    }
  }
  return 0;
}

// Assembly:
testl %ecx, %ecx
jle 0xa4d1
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movslq (%rdx), %rdx
movq %rdx, %rcx
shlq $0x4, %rcx
addq %r8, %rcx
callq 0xa232
testq %rax, %rax
je 0xa4d4
movl %ebp, %r13d
movl $0x1, %ecx
movq %rcx, %rbp
cmpq %rcx, %r13
je 0xa4c8
movslq (%r14,%rbp,4), %rdx
movq %rdx, %rcx
shlq $0x4, %rcx
addq %rbx, %rcx
movq %r12, %rdi
movq %r15, %rsi
callq 0xa232
leaq 0x1(%rbp), %rcx
testq %rax, %rax
jne 0xa49e
xorl %eax, %eax
cmpq %r13, %rbp
sbbl %eax, %eax
jmp 0xa4d9
xorl %eax, %eax
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/antoniogarro[P]Hara/tree.cpp
// Function: Tree::print(Node*, int, int) const
void Tree::print(Node *node, int threshold, int depth) const
{
  for (int i = 0; i < depth; i++) std::cerr << "  ";
  std::cerr << "|->";
  node->print(goban->get_size());
  
  Node *childs[MAXSIZE2] = {0};
  int len = 0;
  for (Node *child = node->get_child(); child; child=child->get_sibling()) {
    if (child->get_visits() >= threshold) childs[len++] = child;
  }

  while (true) {
    int best = -1, visits = 0;
    for (int i = 0; i < len; i++) {
      if (childs[i] && childs[i]->get_visits() > visits) {
        best = i;
        visits = childs[best]->get_visits();
      }
    }
    if (best < 0) break;
    if (childs[best]->get_move()) print(childs[best], threshold, depth+1);
    childs[best] = 0;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb58, %rsp            # imm = 0xB58
movl %ecx, %ebp
movl %edx, 0xc(%rsp)
movq %rsi, %r15
movq %rdi, %r14
testl %ecx, %ecx
jle 0xa52d
movq 0x5ae0(%rip), %r12      # 0xfff0
leaq 0xfdd(%rip), %r13       # 0xb4f4
movl %ebp, %ebx
movl $0x2, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x31f0
decl %ebx
jne 0xa519
movq 0x5abc(%rip), %rdi      # 0xfff0
leaq 0x1355(%rip), %rsi      # 0xb890
movl $0x3, %edx
callq 0x31f0
movq 0x20(%r14), %rax
movl 0x8(%rax), %esi
movq %r15, %rdi
callq 0x9d3a
leaq 0x10(%rsp), %rdi
xorl %r12d, %r12d
movl $0xb48, %edx            # imm = 0xB48
xorl %esi, %esi
callq 0x30e0
movq 0x38(%r15), %rax
testq %rax, %rax
movl 0xc(%rsp), %ebx
je 0xa59b
cvtsi2sd %ebx, %xmm0
xorl %r12d, %r12d
movsd 0x8(%rax), %xmm1
ucomisd %xmm0, %xmm1
jb 0xa592
movslq %r12d, %rcx
incl %r12d
movq %rax, 0x10(%rsp,%rcx,8)
movq 0x40(%rax), %rax
testq %rax, %rax
jne 0xa57c
testl %r12d, %r12d
jle 0xa60f
incl %ebp
movl %r12d, %r15d
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %eax, %eax
xorl %edx, %edx
movq 0x10(%rsp,%rax,8), %rsi
testq %rsi, %rsi
je 0xa5d0
movsd 0x8(%rsi), %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %edx, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xa5d0
cvttsd2si %xmm0, %edx
movl %eax, %ecx
incq %rax
cmpq %r15, %rax
jne 0xa5ae
testl %ecx, %ecx
js 0xa60f
movl %ecx, %r12d
movq 0x10(%rsp,%r12,8), %rsi
cmpl $0x0, (%rsi)
je 0xa5f5
movq %r14, %rdi
movl %ebx, %edx
movl %ebp, %ecx
callq 0xa4e8
xorl %eax, %eax
movq $0x0, 0x10(%rsp,%r12,8)
movl $0x0, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testl %r15d, %r15d
jg 0xa5ae
addq $0xb58, %rsp            # imm = 0xB58
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/antoniogarro[P]Hara/zobrist.cpp
// Function: Zobrist::Zobrist()
Zobrist::Zobrist()
{
  zob_key = 0;
  zob_side = genrand64_int64();
  for(int i = 0; i < MAXSIZE2; i++){
    zob_points [0][i] = genrand64_int64();
    zob_points [1][i] = genrand64_int64();
    zob_ko[i] = genrand64_int64();
  }
  clear_history();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq $0x0, (%rdi)
callq 0xa940
movq %rax, 0x8(%rbx)
movq $-0x169, %r14           # imm = 0xFE97
callq 0xa940
movq %rax, 0xb58(%rbx,%r14,8)
callq 0xa940
movq %rax, 0x16a0(%rbx,%r14,8)
callq 0xa940
movq %rax, 0x21e8(%rbx,%r14,8)
incq %r14
jne 0xa8ea
xorps %xmm0, %xmm0
movups %xmm0, 0x2208(%rbx)
movups %xmm0, 0x21f8(%rbx)
movups %xmm0, 0x21e8(%rbx)
movl $0x0, 0x2218(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/zengfenfei[P]codility/src/FrogRiverOne.cpp
// Function: solution(int, std::vector<int, std::allocator<int>>&)
int solution(int X, vector<int> &A) {
	// write your code in C++11 (g++ 4.8.2)
	vector<bool> hasLeaves(X, false);
	int validLeaves = 0;
	for (unsigned int i = 0; i < A.size(); i++) {
		bool has = hasLeaves[A[i] - 1];
		if (!has) {
			hasLeaves[A[i] - 1] = true;
			validLeaves++;
			if (validLeaves == X) {
				return i;
			}
		}
	}
	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %rbx
movl %edi, %r14d
movslq %edi, %rsi
leaq -0x22(%rbp), %rdx
movb $0x0, (%rdx)
leaq -0x50(%rbp), %r15
leaq -0x21(%rbp), %rcx
movq %r15, %rdi
callq 0x13b8
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
movq (%r15), %rdi
subq %rax, %rdx
je 0x12f6
sarq $0x2, %rdx
xorl %ebx, %ebx
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
leaq 0x3f(%rsi), %r8
xorl %r9d, %r9d
movslq (%rax,%rbx,4), %rcx
decq %rcx
leal 0x3f(%rcx), %r15d
testl %ecx, %ecx
cmovnsl %ecx, %r15d
sarl $0x6, %r15d
movq %rcx, %r11
andq %r8, %r11
xorl %r10d, %r10d
cmpq %rsi, %r11
setbe %r10b
movl $0x1, %r11d
shlq %cl, %r11
movslq %r15d, %r15
leaq (%rdi,%r15,8), %r15
movq -0x8(%r15,%r10,8), %r12
btq %rcx, %r12
jb 0x12e8
leaq -0x8(,%r10,8), %rcx
orq %r12, %r11
movq %r11, (%r15,%rcx)
incl %r9d
cmpl %r14d, %r9d
je 0x1300
incl %ebx
cmpq %rbx, %rdx
ja 0x1291
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x1300
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x130c
movq -0x30(%rbp), %rsi
subq %rdi, %rsi
callq 0x10a0
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/zengfenfei[P]codility/src/FrogRiverOne.cpp
// Function: main
int main() {
	vector<int> A(8);
	A[0] = 1;
	A[1] = 3;
	A[2] = 1;
	A[3] = 4;
	A[4] = 2;
	A[5] = 3;
	A[6] = 5;
	A[7] = 4;
	cout << solution(5, A) << '\n';	// 6
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl $0x20, %edi
callq 0x1090
movq %rax, %rbx
leaq -0x30(%rbp), %rsi
movq %rax, (%rsi)
addq $0x20, %rax
movq %rax, 0x10(%rsi)
movq %rax, 0x8(%rsi)
movaps 0xcc3(%rip), %xmm0      # 0x2010
movups %xmm0, (%rbx)
movaps 0xcc9(%rip), %xmm0      # 0x2020
movups %xmm0, 0x10(%rbx)
movl $0x5, %edi
callq 0x123c
movq 0x2c6c(%rip), %rdi      # 0x3fd8
movl %eax, %esi
callq 0x10d0
leaq -0x11(%rbp), %rsi
movb $0xa, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x10b0
movl $0x20, %esi
movq %rbx, %rdi
callq 0x10a0
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movl $0x20, %esi
movq %rbx, %rdi
callq 0x10a0
movq %r14, %rdi
callq 0x10e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/kage08[P]RegexLibrary/Resource.cpp
// Function: NFA::NFA(std::vector<char, std::allocator<char>>&, char)
NFA::NFA(vector<char>& alph, char c){
      if(find(alph.begin(),alph.end(),c)==alph.end() && c!='@'){
        cerr<<"Invalid initialization of simple NFA\n";
        exit(0);
      }


      noStates=2;

      Trans=vector<set<pair<char,uLong> > >(noStates,set<pair<char,uLong> >());
      alphabet=alph;
      addTransition(0,1,c);
      acceptStates.insert(1);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r13
movq %rdi, %r15
leaq 0xe(%rsp), %rax
movb %dl, (%rax)
leaq 0x8(%rdi), %rbx
xorl %ecx, %ecx
movq %rcx, 0x18(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
leaq 0x20(%rdi), %r14
leaq 0x28(%rdi), %rdx
movl $0x0, 0x28(%rdi)
movq %rcx, 0x30(%rdi)
movq %rdx, 0x38(%rdi)
movq %rdx, 0x40(%rdi)
leaq 0x50(%rdi), %r12
movups %xmm0, 0x48(%rdi)
movups %xmm0, 0x58(%rdi)
movq (%rsi), %rdi
movq 0x8(%rsi), %rsi
movq %rax, %rdx
callq 0x5387
cmpq 0x8(%r13), %rax
jne 0x25d1
cmpb $0x40, 0xe(%rsp)
jne 0x26a9
movq $0x2, (%r15)
leaq 0x18(%rsp), %rax
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rdx
leaq 0xf(%rsp), %rcx
movl $0x2, %esi
callq 0x45ca
movq 0x18(%r15), %rax
leaq 0x40(%rsp), %rbp
movaps (%rbp), %xmm0
movq 0x10(%rbp), %rcx
movq %rcx, 0x18(%r15)
movups 0x8(%r15), %xmm1
movups %xmm0, 0x8(%r15)
leaq 0x60(%rsp), %rdi
movaps %xmm1, (%rdi)
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rbp)
movq $0x0, 0x10(%rbp)
callq 0x4664
movq %rbp, %rdi
callq 0x4664
leaq 0x10(%rsp), %rdi
callq 0x47aa
movq %r12, %rdi
movq %r13, %rsi
callq 0x46ac
movb 0xe(%rsp), %al
movq (%rbx), %rdi
leaq 0x10(%rsp), %rsi
movb %al, (%rsi)
movq $0x1, 0x8(%rsi)
callq 0x5530
leaq 0x10(%rsp), %rsi
movq $0x1, (%rsi)
movq %r14, %rdi
callq 0x541e
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x7940(%rip), %rdi      # 0x9ff0
leaq 0x49b9(%rip), %rsi      # 0x7070
callq 0x2160
xorl %edi, %edi
callq 0x21d0
jmp 0x26d6
movq %rax, %r13
leaq 0x10(%rsp), %rdi
callq 0x47aa
jmp 0x26d9
jmp 0x26d6
movq %rax, %r13
movq (%r12), %rdi
testq %rdi, %rdi
je 0x26ee
movq 0x60(%r15), %rsi
subq %rdi, %rsi
callq 0x2180
movq %r14, %rdi
callq 0x47fa
movq %rbx, %rdi
callq 0x4664
movq %r13, %rdi
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O3/kage08[P]RegexLibrary/Resource.cpp
// Function: NFA::step(std::set<unsigned long long, std::less<unsigned long long>, std::allocator<unsigned long long>>&, char)
set<uLong> NFA::step(set<uLong>& initS, char alpha){
  set<uLong> finalS;
  if(alpha=='@') finalS=initS;
  for(uLong u:initS){
    set<uLong> temp;
    for(auto pb:Trans[u]){
      if(pb.first==alpha){
        finalS.insert(pb.second);
        temp.insert(pb.second);
      }
    }
    while(!(temp.size()==0)){
      int v=(*(temp.begin()));
      temp.erase(temp.begin());
      for(auto pb:Trans[v]){
        if(pb.first=='@' && finalS.find(pb.second)==finalS.end()){
          temp.insert(pb.second);finalS.insert(pb.second);}
      }
    }
  }
  return finalS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %r13
movq %rsi, 0x20(%rsp)
movq %rdi, %rbx
leaq 0x8(%rdi), %r15
movl $0x0, 0x8(%rdi)
xorl %eax, %eax
movq %rax, 0x10(%rdi)
movq %r15, 0x18(%rdi)
movq %r15, 0x20(%rdi)
movq %rax, 0x28(%rdi)
movl %ecx, 0x1c(%rsp)
cmpb $0x40, %cl
jne 0x278c
movq %rbx, %rdi
movq %r13, %rsi
callq 0x484a
movq 0x18(%r13), %rax
addq $0x8, %r13
cmpq %r13, %rax
je 0x290a
leaq 0x8(%rsp), %r14
leaq 0x38(%rsp), %r12
movq %r13, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movq 0x20(%rax), %rax
movl $0x0, 0x40(%rsp)
xorl %edx, %edx
movq %rdx, 0x48(%rsp)
leaq 0x40(%rsp), %rcx
movq %rcx, 0x50(%rsp)
movq %rcx, 0x58(%rsp)
movq %rdx, 0x60(%rsp)
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rcx
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
leaq (%rcx,%rax), %rbp
addq $0x8, %rbp
movq 0x10(%rbp), %r13
cmpq %rbp, %r13
je 0x28ea
movups 0x20(%r13), %xmm0
movaps %xmm0, (%rsp)
movl 0x1c(%rsp), %eax
cmpb %al, (%rsp)
jne 0x282a
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x5672
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
callq 0x5672
movq %r13, %rdi
callq 0x21b0
movq %rax, %r13
cmpq %rbp, %rax
jne 0x27fe
jmp 0x28de
movq 0x50(%rsp), %rsi
movq 0x20(%rsi), %r13
movq %r12, %rdi
callq 0x571c
movslq %r13d, %rax
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rcx
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
leaq (%rcx,%rax), %rbp
addq $0x8, %rbp
movq 0x10(%rbp), %r13
cmpq %rbp, %r13
je 0x28de
movups 0x20(%r13), %xmm0
movaps %xmm0, (%rsp)
cmpb $0x40, (%rsp)
jne 0x28ce
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
je 0x28b8
movq 0x8(%rsp), %rax
movq %r15, %rdx
xorl %esi, %esi
cmpq %rax, 0x20(%rcx)
setb %sil
cmovaeq %rcx, %rdx
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0x2895
cmpq %r15, %rdx
je 0x28b8
cmpq 0x20(%rdx), %rax
jae 0x28ce
movq %r12, %rdi
movq %r14, %rsi
callq 0x5672
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5672
movq %r13, %rdi
callq 0x21b0
movq %rax, %r13
cmpq %rbp, %rax
jne 0x2875
cmpq $0x0, 0x60(%rsp)
jne 0x283f
movq %r12, %rdi
callq 0x47fa
movq 0x30(%rsp), %rdi
callq 0x21b0
movq 0x28(%rsp), %r13
cmpq %r13, %rax
jne 0x27ac
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x2932
jmp 0x2925
jmp 0x2925
movq %rax, %r14
leaq 0x38(%rsp), %rdi
callq 0x47fa
movq %rbx, %rdi
callq 0x47fa
movq %r14, %rdi
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O3/kage08[P]RegexLibrary/Resource.cpp
// Function: Kleeny(NFA&)
NFA Kleeny(NFA& A){
  NFA B=A;
  for(uLong f:B.acceptStates)
    B.addTransition(f,0,'@');
  B.acceptStates.insert(0);
  return B;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r12
movq %rdi, %rbx
movq (%rsi), %rax
movq %rax, (%rdi)
leaq 0x8(%rdi), %r14
addq $0x8, %rsi
movq %r14, %rdi
callq 0x4ad2
leaq 0x20(%rbx), %r15
leaq 0x20(%r12), %rsi
movq %r15, %rdi
callq 0x4dfe
leaq 0x50(%rbx), %rdi
addq $0x50, %r12
movq %r12, %rsi
callq 0x4b6e
movq 0x38(%rbx), %r12
leaq 0x28(%rbx), %rbp
cmpq %rbp, %r12
je 0x2c2a
leaq 0x8(%rsp), %r13
movq 0x20(%r12), %rax
leaq (%rax,%rax,2), %rdi
shlq $0x4, %rdi
addq (%r14), %rdi
movb $0x40, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq %r13, %rsi
callq 0x5530
movq %r12, %rdi
callq 0x21b0
movq %rax, %r12
cmpq %rbp, %rax
jne 0x2bf4
leaq 0x8(%rsp), %rsi
movq $0x0, (%rsi)
movq %r15, %rdi
callq 0x541e
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2c6c
movq %rax, %r12
movq %r15, %rdi
callq 0x47fa
jmp 0x2c62
movq %rax, %r12
movq %r14, %rdi
callq 0x4664
jmp 0x2c77
movq %rax, %r12
movq %rbx, %rdi
callq 0x4770
movq %r12, %rdi
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O3/kage08[P]RegexLibrary/Resource.cpp
// Function: concat(NFA&, NFA&)
NFA concat(NFA& A, NFA& B){
  NFA C(A.noStates+B.noStates,A.alphabet);
  for(uLong i=0;i<A.noStates;i++){
    for(auto pb: A.Trans[i])
      C.addTransition(i,pb.second,pb.first);
  }
  for(uLong i=0;i<B.noStates;i++){
    for(auto pb: B.Trans[i])
      C.addTransition(i+A.noStates,pb.second+A.noStates,pb.first);
  }
  for(uLong f:A.acceptStates)
    C.addTransition(f,A.noStates,'@');
  for(uLong f: B.acceptStates)
    C.acceptStates.insert(f+A.noStates);

  return C;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq %rdx, 0x18(%rsp)
movq (%rdx), %rsi
addq (%r15), %rsi
leaq 0x50(%r15), %rdx
callq 0x243c
movq (%r15), %rax
testq %rax, %rax
je 0x2d18
xorl %edx, %edx
leaq 0x8(%rsp), %r12
movq 0x8(%r15), %rcx
movq %rdx, 0x20(%rsp)
leaq (%rdx,%rdx,2), %r14
shlq $0x4, %r14
leaq (%rcx,%r14), %rbp
addq $0x8, %rbp
movq 0x10(%rbp), %r13
cmpq %rbp, %r13
je 0x2d0b
movb 0x20(%r13), %al
movq 0x28(%r13), %rcx
movq 0x8(%rbx), %rdi
addq %r14, %rdi
movb %al, 0x8(%rsp)
movq %rcx, 0x10(%rsp)
movq %r12, %rsi
callq 0x5530
movq %r13, %rdi
callq 0x21b0
movq %rax, %r13
cmpq %rbp, %rax
jne 0x2cd8
movq (%r15), %rax
movq 0x20(%rsp), %rdx
incq %rdx
cmpq %rax, %rdx
jb 0x2cb6
movq 0x18(%rsp), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x2dad
xorl %edx, %edx
leaq 0x8(%rsp), %r12
movq 0x18(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq %rdx, 0x20(%rsp)
leaq (%rdx,%rdx,2), %r14
shlq $0x4, %r14
leaq (%rcx,%r14), %rbp
addq $0x8, %rbp
movq 0x10(%rbp), %r13
cmpq %rbp, %r13
je 0x2da0
movb 0x20(%r13), %al
movq (%r15), %rcx
movq 0x28(%r13), %rdx
addq %rcx, %rdx
movq 0x8(%rbx), %rsi
addq %r14, %rsi
leaq (%rcx,%rcx,2), %rdi
shlq $0x4, %rdi
addq %rsi, %rdi
movb %al, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movq %r12, %rsi
callq 0x5530
movq %r13, %rdi
callq 0x21b0
movq %rax, %r13
cmpq %rbp, %rax
jne 0x2d57
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rdx
incq %rdx
cmpq %rax, %rdx
jb 0x2d30
movq 0x38(%r15), %r12
leaq 0x28(%r15), %r14
cmpq %r14, %r12
je 0x2df5
leaq 0x8(%rsp), %r13
movq 0x20(%r12), %rax
movq (%r15), %rcx
leaq (%rax,%rax,2), %rdi
shlq $0x4, %rdi
addq 0x8(%rbx), %rdi
movb $0x40, 0x8(%rsp)
movq %rcx, 0x10(%rsp)
movq %r13, %rsi
callq 0x5530
movq %r12, %rdi
callq 0x21b0
movq %rax, %r12
cmpq %r14, %rax
jne 0x2dbf
movq 0x18(%rsp), %rax
movq 0x38(%rax), %r12
addq $0x28, %rax
cmpq %rax, %r12
je 0x2e3b
movq %rax, %r14
leaq 0x20(%rbx), %r13
leaq 0x8(%rsp), %rbp
movq 0x20(%r12), %rax
addq (%r15), %rax
movq %rax, 0x8(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x541e
movq %r12, %rdi
callq 0x21b0
movq %rax, %r12
cmpq %r14, %rax
jne 0x2e13
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2e53
jmp 0x2e53
jmp 0x2e53
movq %rax, %r14
movq %rbx, %rdi
callq 0x4770
movq %r14, %rdi
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O3/kage08[P]RegexLibrary/Resource.cpp
// Function: printNFA(NFA&)
void printNFA(NFA& A){
  cout<<A.noStates<<endl;
  for(char c:A.alphabet)
    cout<<c<<" ";
  cout<<endl;
  for(uLong f: A.acceptStates)
    cout<<f<<" ";
  cout<<endl;
  for(uLong i=0;i<A.noStates;i++){
    for(auto pb: A.Trans[i])
      cout<<i<<" "<<pb.second<<" "<<pb.first<<endl;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r12
movq (%rdi), %rsi
movq 0x6bdb(%rip), %r14      # 0x9fc8
movq %r14, %rdi
callq 0x20f0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq 0x50(%r12), %rbx
movq %r12, 0x10(%rsp)
movq 0x58(%r12), %rbp
cmpq %rbp, %rbx
je 0x3474
movq 0x6b8e(%rip), %r15      # 0x9fc8
leaq 0xe(%rsp), %r12
leaq 0x3c50(%rip), %r13      # 0x7096
movb (%rbx), %al
movb %al, 0xe(%rsp)
movl $0x1, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x21a0
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x21a0
incq %rbx
cmpq %rbp, %rbx
jne 0x3446
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq 0x10(%rsp), %rax
movq 0x38(%rax), %r15
leaq 0x28(%rax), %rbx
cmpq %rbx, %r15
je 0x34e7
movq 0x6b14(%rip), %r12      # 0x9fc8
leaq 0x3bdb(%rip), %r13      # 0x7096
movq 0x20(%r15), %rsi
movq %r12, %rdi
callq 0x20f0
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x21a0
movq %r15, %rdi
callq 0x21b0
movq %rax, %r15
cmpq %rbx, %rax
jne 0x34bb
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq 0x10(%rsp), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x361a
xorl %esi, %esi
leaq 0x3b6e(%rip), %r15      # 0x7096
leaq 0xf(%rsp), %r13
movq 0x10(%rsp), %rcx
movq 0x8(%rcx), %rcx
leaq (%rsi,%rsi,2), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
addq $0x8, %rcx
movq 0x10(%rcx), %rbp
movq %rcx, 0x20(%rsp)
cmpq %rcx, %rbp
movq %rsi, 0x18(%rsp)
je 0x360e
movb 0x20(%rbp), %r12b
movq 0x28(%rbp), %rbx
movq 0x6a5d(%rip), %rdi      # 0x9fc8
movq 0x18(%rsp), %rsi
callq 0x20f0
movq %r15, %r14
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x21a0
movq %r15, %rdi
movq %r14, %r15
movq %rbx, %rsi
callq 0x20f0
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x21a0
movb %r12b, 0xf(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x21a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq %rbp, %rdi
callq 0x21b0
movq 0x18(%rsp), %rsi
movq %rax, %rbp
cmpq 0x20(%rsp), %rax
jne 0x355c
movq 0x10(%rsp), %rax
movq (%rax), %rax
incq %rsi
cmpq %rax, %rsi
jb 0x352d
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/kage08[P]RegexLibrary/Resource.cpp
// Function: NFA::acceptString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool NFA::acceptString(string st){
  set<uLong> currStates;
  currStates.insert(0);
  currStates=step(currStates,'@');
  for(char c:st){
    currStates=step(currStates,c);
  }
  for(uLong f: acceptStates)
    if(currStates.find(f)!=currStates.end()) return true;
  return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rsp), %r15
movl $0x0, (%r15)
xorl %eax, %eax
movq %rax, 0x8(%r15)
movq %r15, 0x10(%r15)
movq %r15, 0x18(%r15)
movq %rax, 0x20(%r15)
leaq 0x38(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x8(%rsp), %rdi
callq 0x541e
leaq 0x38(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %rbx, %rsi
movl $0x40, %ecx
callq 0x2742
leaq 0x8(%rsp), %rdi
callq 0x5116
movq 0x48(%rsp), %rax
testq %rax, %rax
je 0x36d1
leaq 0x40(%rsp), %rcx
movl (%rcx), %edx
movl %edx, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movups 0x10(%rcx), %xmm0
movups %xmm0, 0x20(%rsp)
movq %r15, 0x8(%rax)
movq 0x20(%rcx), %rax
movq %rax, 0x30(%rsp)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x38(%rsp), %rdi
callq 0x47fa
movq 0x8(%r14), %r13
testq %r13, %r13
je 0x3773
movq (%r14), %rbp
leaq 0x38(%rsp), %r14
leaq 0x8(%rsp), %r15
xorl %r12d, %r12d
movsbl (%rbp,%r12), %ecx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2742
movq %r15, %rdi
callq 0x5116
movq 0x48(%rsp), %rax
testq %rax, %rax
je 0x3763
movl 0x40(%rsp), %ecx
movl %ecx, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movups 0x50(%rsp), %xmm0
movups %xmm0, 0x20(%rsp)
leaq 0x10(%rsp), %rcx
movq %rcx, 0x8(%rax)
movq 0x60(%rsp), %rax
movq %rax, 0x30(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x48(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, 0x50(%rsp)
movq %rax, 0x58(%rsp)
movq %rcx, 0x60(%rsp)
movq %r14, %rdi
callq 0x47fa
incq %r12
cmpq %r12, %r13
jne 0x36f8
movq 0x38(%rbx), %rax
addq $0x28, %rbx
cmpq %rbx, %rax
je 0x37dd
movq 0x18(%rsp), %r14
leaq 0x10(%rsp), %r15
testq %r14, %r14
je 0x37d0
movq 0x20(%rax), %rcx
movq %r14, %r9
movq %r15, %r8
movq %r8, %rdx
movq %r9, %rsi
movq 0x20(%r9), %rdi
xorl %r9d, %r9d
cmpq %rcx, %rdi
setb %r9b
movq %rsi, %r8
cmovbq %rdx, %r8
movq 0x10(%rsi,%r9,8), %r9
testq %r9, %r9
jne 0x3799
cmpq %r15, %r8
je 0x37d0
cmpq %rcx, %rdi
cmovbq %rdx, %rsi
cmpq 0x20(%rsi), %rcx
jae 0x37fa
movq %rax, %rdi
callq 0x21b0
cmpq %rbx, %rax
jne 0x378a
xorl %ebx, %ebx
leaq 0x8(%rsp), %rdi
callq 0x47fa
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %bl
jmp 0x37df
jmp 0x3802
jmp 0x3802
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x47fa
movq %rbx, %rdi
callq 0x2270