LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/alexwarth[P]nothing/main.cpp
// Function: growOT()
void growOT(void) {
  size_t  newOTSize    = OTSize > 0 ? OTSize * 2 : OrigOTSize;
  dPrintf2("growOT, new size is %d\n", newOTSize);
  OTEntry *newOT       = allocate(newOTSize, OTEntry);
  byte_t  *newMarked   = allocate(newOTSize, byte_t);
  memcpy(newOT, OT, sizeof(OTEntry) * OTSize);
  for (int i = OTSize; i < newOTSize; i++) {
    newOT[i].numSlots = Int(-1);
    newOT[i].ptr.next = i + 1 < newOTSize ? &newOT[i + 1] : NULL;
  }
  if (OTSize > 0) {
    free(OT);
    free(marked);
  }
  freeList = &newOT[OTSize];
  OTSize   = newOTSize;
  OT       = newOT;
  marked   = newMarked;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x10cb1(%rip), %rax     # 0x135a8
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %ebx
cmovneq %rcx, %rbx
leaq 0x96fe(%rip), %rdi      # 0xc00c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x279f
movl $0x18, %esi
movq %rbx, %rdi
callq 0x2070
movq %rax, %r14
movl $0x1, %esi
movq %rbx, %rdi
callq 0x2070
movq %rax, %r15
movq 0x10c71(%rip), %r12     # 0x135b0
movq 0x10c62(%rip), %r13     # 0x135a8
leaq (,%r13,8), %rax
leaq (%rax,%rax,2), %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x2080
movslq %r13d, %rax
cmpq %rax, %rbx
jbe 0x2991
leaq (%rax,%rax,2), %rcx
leaq (%r14,%rcx,8), %rcx
addq $0x18, %rcx
incq %rax
movl $0x0, %edx
cmpq %rax, %rbx
cmovaq %rcx, %rdx
movl $0xffffffff, -0x18(%rcx) # imm = 0xFFFFFFFF
movq %rdx, -0x8(%rcx)
leaq 0x18(%rcx), %rcx
ja 0x2971
testq %r13, %r13
je 0x29b3
movq %r12, %rdi
callq 0x2090
movq 0x10c1b(%rip), %rdi     # 0x135c0
callq 0x2090
movq 0x10bf7(%rip), %rax     # 0x135a8
jmp 0x29b5
xorl %eax, %eax
leaq (%rax,%rax,2), %rax
leaq (%r14,%rax,8), %rax
movq %rax, 0x10bf4(%rip)     # 0x135b8
movq %rbx, 0x10bdd(%rip)     # 0x135a8
movq %r14, 0x10bde(%rip)     # 0x135b0
movq %r15, 0x10be7(%rip)     # 0x135c0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/alexwarth[P]nothing/main.cpp
// Function: asClass(int)
classSlots *asClass(value_t oop)        { dAssert(isOop(oop));
                                          // TODO: replace the following assert with an instanceof (or at least class) check
                                          dAssert(numSlots(oop) == Int(sizeof(classSlots) / sizeof(value_t)));
                                          return (classSlots *)slots(oop); }

// Assembly:
pushq %rbx
movl %edi, %ebx
movl 0x10a5e(%rip), %eax     # 0x13540
testl %eax, %eax
sete %cl
testb $0x1, %bl
sete %dl
orb %cl, %dl
je 0x2b09
testl %eax, %eax
je 0x2b01
movl %ebx, %edi
callq 0x29e3
cmpl $0xf, %eax
jne 0x2b28
movl %ebx, %edi
popq %rbx
jmp 0x2a26
leaq 0x9514(%rip), %rdi      # 0xc024
leaq 0x9520(%rip), %rsi      # 0xc037
leaq 0x958c(%rip), %rcx      # 0xc0aa
movl $0x76, %edx
callq 0x2060
leaq 0x9598(%rip), %rdi      # 0xc0c7
leaq 0x9501(%rip), %rsi      # 0xc037
leaq 0x956d(%rip), %rcx      # 0xc0aa
movl $0x78, %edx
callq 0x2060
// File: /workspace/github_cpp_makefile_star2_O3/alexwarth[P]nothing/main.cpp
// Function: asContext(int)
contextSlots *asContext(value_t oop)    { dAssert(isOop(oop));
                                          // TODO: replace the following assert with an instanceof (or at least class) check
                                          dAssert(numSlots(oop) > Int(sizeof(contextSlots) / sizeof(value_t)));
                                          return (contextSlots *)slots(oop); }

// Assembly:
pushq %rbx
movl %edi, %ebx
movl 0x109f0(%rip), %eax     # 0x13540
testl %eax, %eax
sete %cl
testb $0x1, %bl
sete %dl
orb %cl, %dl
je 0x2b77
testl %eax, %eax
je 0x2b6f
movl %ebx, %edi
callq 0x29e3
cmpl $0xb, %eax
jbe 0x2b96
movl %ebx, %edi
popq %rbx
jmp 0x2a26
leaq 0x94a6(%rip), %rdi      # 0xc024
leaq 0x94b2(%rip), %rsi      # 0xc037
leaq 0x9580(%rip), %rcx      # 0xc10c
movl $0x7b, %edx
callq 0x2060
leaq 0x9590(%rip), %rdi      # 0xc12d
leaq 0x9493(%rip), %rsi      # 0xc037
leaq 0x9561(%rip), %rcx      # 0xc10c
movl $0x7d, %edx
callq 0x2060
// File: /workspace/github_cpp_makefile_star2_O3/alexwarth[P]nothing/main.cpp
// Function: mk(unsigned long)
value_t mk(size_t numSlots) {
  if (freeList == NULL || debug) {
    gc();
    if (freeList == NULL)
      growOT();
  }
  OTEntry *newGuy = freeList;
  freeList = freeList->ptr.next;
  newGuy->numSlots  = Int(numSlots);
  newGuy->cls       = Obj;
  newGuy->ptr.slots = allocate(numSlots, value_t);
  newGuy->isBinary  = 0;
  return Oop(newGuy - OT);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10899(%rip), %r14     # 0x135b8
testq %r14, %r14
je 0x2d2d
cmpl $0x0, 0x10815(%rip)     # 0x13540
je 0x2d4a
callq 0x2e4f
movq 0x1087f(%rip), %r14     # 0x135b8
testq %r14, %r14
jne 0x2d4a
callq 0x28e7
movq 0x1086e(%rip), %r14     # 0x135b8
movq 0x10(%r14), %rax
movq %rax, 0x10863(%rip)     # 0x135b8
leal 0x1(,%rbx,2), %eax
movl %eax, (%r14)
movl 0x10807(%rip), %eax     # 0x1356c
movl %eax, 0x4(%r14)
movl $0x4, %esi
movq %rbx, %rdi
callq 0x2070
movq %rax, 0x10(%r14)
movl $0x0, 0x8(%r14)
subq 0x10827(%rip), %r14     # 0x135b0
shrq $0x3, %r14
imull $0x55555556, %r14d, %eax # imm = 0x55555556
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/alexwarth[P]nothing/main.cpp
// Function: mark(int)
int mark(value_t oop) {
  if (!isOop(oop))
    return 0;
  int otIdx = OopValue(oop);
  if (marked[otIdx])
    return 0;
  marked[otIdx] = 1;
  if (OT[otIdx].isBinary)
    return 1;
  size_t r = 1;
  OTEntry e = OT[otIdx];
  value_t *slot = e.ptr.slots;
  for (int i = 0; i < IntValue(e.numSlots); i++)
    r += mark(*slot++);
  return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %ebx, %ebx
testb $0x1, %dil
jne 0x2dd9
sarl %edi
movq 0x1080b(%rip), %rax     # 0x135c0
movslq %edi, %rcx
cmpb $0x0, (%rax,%rcx)
jne 0x2dd9
movb $0x1, (%rax,%rcx)
movq 0x107e7(%rip), %rax     # 0x135b0
leaq (%rcx,%rcx,2), %rcx
movl $0x1, %ebx
cmpl $0x0, 0x8(%rax,%rcx,8)
je 0x2de4
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl (%rax,%rcx,8), %r14d
movl %r14d, %ebp
andl $0x1, %ebp
cmpl $0x0, 0x1074b(%rip)     # 0x13540
je 0x2dfb
testl %ebp, %ebp
je 0x2e30
leaq (%rax,%rcx,8), %rax
movq 0x10(%rax), %r15
sarl %r14d
xorl %r12d, %r12d
testl %r14d, %r14d
cmovlel %r12d, %r14d
cmpl %r12d, %r14d
je 0x2dd9
movl (%r15,%r12,4), %edi
callq 0x2d9c
addl %eax, %ebx
incq %r12
cmpl $0x0, 0x10716(%rip)     # 0x13540
je 0x2e10
testl %ebp, %ebp
jne 0x2e10
leaq 0x9357(%rip), %rdi      # 0xc18e
leaq 0x91f9(%rip), %rsi      # 0xc037
leaq 0x94ef(%rip), %rcx      # 0xc334
movl $0x90, %edx
callq 0x2060
// File: /workspace/github_cpp_makefile_star2_O3/alexwarth[P]nothing/main.cpp
// Function: gc()
size_t gc(void) {
  memset(marked, 0, OTSize);
  int numMarked = mark(globals);
  for (int i = 0; i < OTSize; i++) {
    if (marked[i] || OT[i].numSlots == Int(-1))
      continue;
    free(OT[i].ptr.slots);
    OT[i].numSlots = Int(-1);
    OT[i].cls      = nil;
    OT[i].ptr.next = freeList;
    freeList       = &OT[i];
  }
  dPrintf2("GC reclaimed %d OTEntries\n", OTSize - numMarked);
  return OTSize - numMarked;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x10765(%rip), %rdi     # 0x135c0
movq 0x10746(%rip), %rdx     # 0x135a8
xorl %esi, %esi
callq 0x2050
movl 0x106f1(%rip), %edi     # 0x13560
callq 0x2d9c
movl %eax, %ebx
movq 0x1072b(%rip), %rsi     # 0x135a8
testq %rsi, %rsi
je 0x2f01
movq 0x10737(%rip), %rax     # 0x135c0
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpb $0x0, (%rax,%r15)
jne 0x2ef3
movq 0x10713(%rip), %rcx     # 0x135b0
cmpl $-0x1, (%rcx,%r14)
je 0x2ef3
movq 0x10(%rcx,%r14), %rdi
callq 0x2090
movq 0x106fb(%rip), %rax     # 0x135b0
movl $0xffffffff, (%rax,%r14) # imm = 0xFFFFFFFF
movl 0x10685(%rip), %ecx     # 0x13548
movl %ecx, 0x4(%rax,%r14)
movq 0x106e9(%rip), %rcx     # 0x135b8
movq %rcx, 0x10(%rax,%r14)
movq 0x106d5(%rip), %rax     # 0x135b0
addq %r14, %rax
movq %rax, 0x106d3(%rip)     # 0x135b8
movq 0x106d4(%rip), %rax     # 0x135c0
movq 0x106b5(%rip), %rsi     # 0x135a8
incq %r15
addq $0x18, %r14
cmpq %r15, %rsi
ja 0x2e8f
jmp 0x2f03
xorl %esi, %esi
movslq %ebx, %rbx
subq %rbx, %rsi
leaq 0x9436(%rip), %rdi      # 0xc346
xorl %eax, %eax
callq 0x279f
movq 0x1068a(%rip), %rax     # 0x135a8
subq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/alexwarth[P]nothing/main.cpp
// Function: addPrim(char const*, int (*)(int))
value_t addPrim(const char *n, value_t (*f)(value_t)) { assert(numPrims < MaxNumPrims);
                                                        prims[numPrims]     = f;
                                                        primNames[numPrims] = (void *)n;
                                                        return Int(numPrims++); }

// Assembly:
movq 0x104fe(%rip), %rax     # 0x13480
cmpq $0x40, %rax
jae 0x2fb1
leaq 0x100f1(%rip), %rcx     # 0x13080
movq %rsi, (%rcx,%rax,8)
leaq 0x102e6(%rip), %rcx     # 0x13280
movq %rdi, (%rcx,%rax,8)
leaq 0x1(%rax), %rcx
movq %rcx, 0x104d7(%rip)     # 0x13480
leal 0x1(,%rax,2), %eax
retq
pushq %rax
leaq 0x93c1(%rip), %rdi      # 0xc37a
leaq 0x9077(%rip), %rsi      # 0xc037
leaq 0x93ca(%rip), %rcx      # 0xc391
movl $0xbf, %edx
callq 0x2060
// File: /workspace/github_cpp_makefile_star2_O3/alexwarth[P]nothing/main.cpp
// Function: stringify(char const*)
value_t stringify(const char *s) {
  value_t r = _p1(Push, _p2(MkObj, Str, Int(strlen(s))));
  for (int idx = 0; *s != 0; idx++, s++)
    slotAtPut(r, Int(idx), Int(*s));
  _p(Pop);
  return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl 0xbbc1(%rip), %eax      # 0x13488
cmpl $0x0, 0xbc72(%rip)      # 0x13540
setne %cl
testb $0x1, %al
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
je 0x7a10
movq %rdi, %rbx
sarl %eax
cltq
leaq 0xb791(%rip), %r14      # 0x13080
movq (%r14,%rax,8), %r15
callq 0x2040
leal 0x1(,%rax,2), %edi
callq *%r15
movl 0xbbdc(%rip), %eax      # 0x134e4
cmpl $0x0, 0xbc31(%rip)      # 0x13540
setne %cl
testb $0x1, %al
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
je 0x7a10
sarl %eax
cltq
movl 0xbc4c(%rip), %edi      # 0x13578
callq *(%r14,%rax,8)
movl %eax, %edi
callq *%r15
movl %eax, %ebp
movb (%rbx), %al
testb %al, %al
je 0x79ab
movl %ebp, %ecx
sarl %ecx
movq 0xbc68(%rip), %rdx      # 0x135b0
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rdx,%rcx,8), %rcx
incq %rbx
xorl %edx, %edx
testb $0x1, %bpl
sete %sil
movl 0xbbda(%rip), %edi      # 0x13540
testl %edi, %edi
sete %r8b
orb %sil, %r8b
je 0x79e8
movl %edx, %esi
sarl %esi
testl %edi, %edi
je 0x798b
testl %esi, %esi
js 0x79df
movl (%rcx), %edi
testb $0x1, %dil
je 0x79f1
sarl %edi
cmpl %edi, %esi
jge 0x79df
movsbl %al, %eax
leal 0x1(,%rax,2), %eax
movq 0x10(%rcx), %rdi
movslq %esi, %rsi
movl %eax, (%rdi,%rsi,4)
movb (%rbx), %al
incq %rbx
addl $0x2, %edx
testb %al, %al
jne 0x7958
movl 0xbadb(%rip), %eax      # 0x1348c
cmpl $0x0, 0xbb88(%rip)      # 0x13540
setne %cl
testb $0x1, %al
sete %dl
testb %dl, %cl
jne 0x7a2f
sarl %eax
cltq
movl 0xbb7a(%rip), %edi      # 0x13548
callq *(%r14,%rax,8)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7e55(%rip), %rdi      # 0xf83b
jmp 0x79f8
leaq 0x466b(%rip), %rdi      # 0xc05a
jmp 0x79f8
leaq 0x4796(%rip), %rdi      # 0xc18e
leaq 0x4638(%rip), %rsi      # 0xc037
leaq 0x7e15(%rip), %rcx      # 0xf81b
movl $0x1f9, %edx            # imm = 0x1F9
callq 0x2060
leaq 0x4777(%rip), %rdi      # 0xc18e
leaq 0x4619(%rip), %rsi      # 0xc037
leaq 0x7df6(%rip), %rcx      # 0xf81b
movl $0x1f7, %edx            # imm = 0x1F7
callq 0x2060
leaq 0x4758(%rip), %rdi      # 0xc18e
leaq 0x45fa(%rip), %rsi      # 0xc037
leaq 0x7dd7(%rip), %rcx      # 0xf81b
movl $0x1fa, %edx            # imm = 0x1FA
callq 0x2060
// File: /workspace/github_cpp_makefile_star2_O3/tyhsu[P]Ewn/play.cpp
// Function: Play::two_players_mode()
void Play::two_players_mode()
{
    this->game.print_board();
    while (1) {
        //update: 0(game continues), 1(A wins), 2(B wins)
        int dice = this->game.roll_dice();
        cout << "dice: " << dice+1 << endl;
        int game_status = this->game.update_game_status(player_move(dice));
        this->game.print_board();
        if (game_status != 0) {
            cout << "====================================" << endl;
            if (game_status == 1) cout << "A is the winner!!!" << endl;
            else cout << "B is the winner!!!" << endl;
            cout << "====================================" << endl;
            return;
        }
        this->game.switch_player();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
callq 0x7be2
movq 0xa4d6(%rip), %rbx      # 0xcfc8
leaq -0x2c(%rbp), %r12
leaq -0x38(%rbp), %r13
movq %r14, %rdi
callq 0x7e2a
movl %eax, -0x2c(%rbp)
movl $0x6, %edx
movq %rbx, %rdi
leaq 0x6621(%rip), %rsi      # 0x9135
callq 0x2170
movl -0x2c(%rbp), %esi
incl %esi
movq %rbx, %rdi
callq 0x21f0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq %r14, %rdi
movq %r12, %rsi
callq 0x28ac
movq %rax, -0x38(%rbp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x7fea
movl %eax, %r15d
movq %r14, %rdi
callq 0x7be2
testl %r15d, %r15d
jne 0x2b87
movq %r14, %rdi
callq 0x8150
jmp 0x2afa
leaq 0x69a1(%rip), %r14      # 0x952f
movl $0x24, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2170
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
cmpl $0x1, %r15d
leaq 0x656c(%rip), %rax      # 0x913c
leaq 0x6578(%rip), %rsi      # 0x914f
cmoveq %rax, %rsi
movl $0x12, %edx
movq %rbx, %rdi
callq 0x2170
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movl $0x24, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2170
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tyhsu[P]Ewn/ewnAi.cpp
// Function: EwnAI::AI_move(Game, int)
Movement EwnAI::AI_move(Game cur_game, int dice)
{
    switch (this->ai_mode) {
        case 0:
            return this->minimax.AI_move(cur_game, dice);
        case 1:
            return this->minimax1.AI_move(cur_game, dice);
        case 2:
            return this->minimax2.AI_move(cur_game, dice);
        case 3:
            return this->minimax3.AI_move(cur_game, dice);
        case 4:
            return this->minimax4.AI_move(cur_game, dice);
        case 5:
            return this->mcts.AI_move(cur_game, dice);
        case 6:
            return this->randomAi.AI_move(cur_game, dice);
        default:
            return this->minimax.AI_move(cur_game, dice);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl (%rdi), %eax
cmpq $0x6, %rax
ja 0x54bc
leaq 0x41f1(%rip), %rcx      # 0x96a4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq $0x8, %rdi
jmp 0x54e4
addq $0x208, %rdi            # imm = 0x208
jmp 0x54e4
addq $0x108, %rdi            # imm = 0x108
jmp 0x54e4
addq $0x188, %rdi            # imm = 0x188
jmp 0x54e4
addq $0x88, %rdi
popq %rbp
jmp 0x6c3e
addq $0x288, %rdi            # imm = 0x288
popq %rbp
jmp 0x5fb4
addq $0x298, %rdi            # imm = 0x298
popq %rbp
jmp 0x5e6a
// File: /workspace/github_cpp_makefile_star2_O3/tyhsu[P]Ewn/randomAi.cpp
// Function: RandomAi::AI_move(Game&, int)
Movement RandomAi::AI_move(Game& cur_game, int dice)
{
    //cerr << "calculating..." ;
    //cerr.flush();
    // cout << "read to random" << endl;
    clock_t init_time = clock();
    this->ai_side = cur_game.get_is_switch();
    this->ai_symbol = this->ai_side? 'A': '1';

    Movement available_mvmt_list[6]; // random
    int available_mvmt_cnt = 0;

    int best_val = -1e9, child_val;
    int win = this->ai_side? 2: 1;
    int next_move_cnt = cur_game.count_movable_chs(dice);
    for (int i=0; i<next_move_cnt; i++) {
        int chs_index = cur_game.get_movable_chs(i).symbol - this->ai_symbol;
        for (int direct = 0; direct < 3; direct++) {
            Movement mvmt(chs_index, direct);
            if (cur_game.check_in_board(mvmt)) {
                available_mvmt_list[available_mvmt_cnt] = mvmt;
                available_mvmt_cnt ++;
            }
        }
    }

    // randomly pick a move.
    Movement next_mvmt = available_mvmt_list[rand() % available_mvmt_cnt];

    double timeCost = (double)(clock() - init_time) / CLOCKS_PER_SEC;

    return next_mvmt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x44(%rbp), %r15
movl %edx, (%r15)
callq 0x20b0
movq %rbx, %rdi
callq 0x855c
movb %al, (%r14)
shlb $0x4, %al
addb $0x31, %al
movq %r14, -0x40(%rbp)
movb %al, 0x1(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
movaps %xmm0, -0x70(%rbp)
movaps %xmm0, -0x80(%rbp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7e52
movl $0x0, -0x2c(%rbp)
movl %eax, -0x30(%rbp)
xorl %r12d, %r12d
testl %eax, %eax
jle 0x5f2e
leaq -0x38(%rbp), %r13
movq %rbx, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x84f8
movsbl %al, %r14d
movq -0x40(%rbp), %rax
movsbl 0x1(%rax), %eax
subl %eax, %r14d
xorl %r15d, %r15d
movl %r14d, -0x38(%rbp)
movl %r15d, -0x34(%rbp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x7f74
testb %al, %al
je 0x5f18
movslq %r12d, %r12
movq -0x38(%rbp), %rax
movq %rax, -0x80(%rbp,%r12,8)
incl %r12d
incl %r15d
cmpl $0x3, %r15d
jne 0x5ef2
movl -0x2c(%rbp), %eax
incl %eax
movl %eax, -0x2c(%rbp)
cmpl -0x30(%rbp), %eax
jl 0x5ed4
callq 0x2060
cltd
idivl %r12d
movslq %edx, %rax
movq -0x80(%rbp,%rax,8), %rbx
callq 0x20b0
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tyhsu[P]Ewn/mcts.cpp
// Function: MCTS::run(Game const&)
int MCTS::run(const Game& cur_game) {
	// initialize root Tree_node with current state
	Tree_node* root_node_ptr = new Tree_node(cur_game);

	int iteration = 0;  // nodes
	while(iteration++ < this->max_iterations) {
		// 1. select
		// Start from the root, digging down until finding an unvistied node
		Tree_node* node_ptr = root_node_ptr;
		int best_child_index;
		// The root has been visited
		if (root_node_ptr->is_visit()) {
			while(!node_ptr->is_terminate()) {
				best_child_index = this->selection_ptr->select_children_list_index(node_ptr);
				node_ptr = node_ptr->get_child_ptr(best_child_index);
				// The next child pointer hasn't been visited
				if(!node_ptr->is_visit()) {
					break;
				}
			}
		}

		int win_reward;
		if (node_ptr->is_terminate()) {
			win_reward = node_ptr->get_game_status() == (this->ai_side? 2: 1);
		}
		else {
			// 2. expand by adding a single child (if not terminal or not fully expanded)
			node_ptr->new_child_nodes();
			
			// 3. simulate
			win_reward = this->simulation(node_ptr->game);
		}

		// 4. back propagation
		while(true) {
			node_ptr->update(win_reward);
			if(node_ptr->get_parent_ptr() == NULL) break;
			node_ptr = node_ptr->get_parent_ptr();
		}
	}

	int result = root_node_ptr->get_win_count();
	this->recursive_delete_tree_node(root_node_ptr);
	return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
movl $0x190, %edi            # imm = 0x190
callq 0x2140
movq %rax, %rbx
movq %rax, %rdi
movq %r15, %rsi
callq 0x6634
cmpl $0x0, 0x4(%r14)
jle 0x6240
movl $0x1, %r13d
leaq -0x30(%rbp), %r15
movq %rbx, %rdi
callq 0x68ca
movq %rbx, %r12
testb %al, %al
je 0x61c2
movq %rbx, %r12
movq %r12, %rdi
callq 0x68bc
testb %al, %al
jne 0x61c2
movq 0x8(%r14), %rdi
movq (%rdi), %rax
movq %r12, %rsi
callq *(%rax)
movl %eax, -0x30(%rbp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x6926
movq %rax, %r12
movq %rax, %rdi
callq 0x68ca
testb %al, %al
jne 0x618d
movq %r12, %rdi
callq 0x68bc
movq %r12, %rdi
testb %al, %al
je 0x61e7
callq 0x690e
movl %eax, %ecx
movzbl (%r14), %edx
incl %edx
xorl %eax, %eax
cmpl %edx, %ecx
sete %al
jmp 0x61f9
callq 0x6682
leaq 0x10(%r12), %rsi
movq %r14, %rdi
callq 0x6280
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movq %r12, %rdi
movss %xmm0, -0x2c(%rbp)
callq 0x68e4
movq %r12, %rdi
callq 0x6918
testq %rax, %rax
je 0x622f
movq %r12, %rdi
callq 0x6918
movq %rax, %r12
movq %rax, %rdi
movss -0x2c(%rbp), %xmm0
jmp 0x6208
leal 0x1(%r13), %eax
cmpl 0x4(%r14), %r13d
movl %eax, %r13d
jl 0x617b
movq %rbx, %rdi
callq 0x68fc
movl %eax, %r15d
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6384
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
callq 0x2150
movq %r14, %rdi
callq 0x2200
// File: /workspace/github_cpp_makefile_star2_O3/tyhsu[P]Ewn/mcts.cpp
// Function: MCTS::simulation(Game const&)
int MCTS::simulation(const Game& cur_game) {
    Game simu_game = cur_game;
	char cur_symbol;
	int game_status = 0, ai_win = this->ai_side ? 2 : 1;
	if (simu_game.get_is_switch() == this->ai_side)
		cur_symbol = this->ai_symbol;
	else
		cur_symbol = this->ai_side? '1' : 'A';

	while (game_status == 0) {
		Movement available_mvmt_list[18];
		int available_mvmt_cnt = 0;
		// find all avaible move (6 dice indices, 3 directions)
		for(int chs_index = 0; chs_index < 6; chs_index++) {
			Chess cur_chs = simu_game.get_cur_chs_list(chs_index);
			if (cur_chs.exist) {
				for (int direct = 0; direct < 3; direct++) {
					Movement tmp_mvmt(chs_index, direct);
					if (simu_game.check_in_board(tmp_mvmt)) {
						available_mvmt_list[available_mvmt_cnt] = tmp_mvmt;
						available_mvmt_cnt ++;
					}
				}
			}
		}
		// randomly pick a move.
		Movement next_mvmt = available_mvmt_list[rand() % available_mvmt_cnt];
		game_status = simu_game.update_game_status(next_mvmt);

		// check game status => if the game keep going, switch the player.
		if(game_status == 0) simu_game.switch_player();
		else break;
	}
	return (game_status == ai_win? 1: 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rdi, %r14
leaq -0x1b8(%rbp), %rbx
movq %rbx, %rdi
callq 0x78e2
movb (%r14), %al
movb %al, -0x29(%rbp)
movq %rbx, %rdi
callq 0x855c
leaq -0x30(%rbp), %r15
leaq -0x38(%rbp), %r12
xorl %r13d, %r13d
movl $0x90, %edx
leaq -0xd0(%rbp), %rdi
xorl %esi, %esi
callq 0x2090
movl $0x0, -0x30(%rbp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x850e
btl $0x8, %eax
jae 0x6321
xorl %r14d, %r14d
movl -0x30(%rbp), %eax
movl %eax, -0x38(%rbp)
movl %r14d, -0x34(%rbp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x7f74
testb %al, %al
je 0x6318
movslq %r13d, %r13
movq -0x38(%rbp), %rax
movq %rax, -0xd0(%rbp,%r13,8)
incl %r13d
incl %r14d
cmpl $0x3, %r14d
jne 0x62ed
movl -0x30(%rbp), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x30(%rbp)
cmpl $0x5, %eax
jl 0x62d9
callq 0x2060
cltd
idivl %r13d
movslq %edx, %rax
movq -0xd0(%rbp,%rax,8), %rax
movq %rax, -0x38(%rbp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x7fea
testl %eax, %eax
jne 0x6363
movq %rbx, %rdi
callq 0x8150
jmp 0x62bc
movzbl -0x29(%rbp), %edx
incl %edx
xorl %ecx, %ecx
cmpl %edx, %eax
sete %cl
movl %ecx, %eax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tyhsu[P]Ewn/mcts.cpp
// Function: MCTS::recursive_delete_tree_node(Tree_node*)
void MCTS::recursive_delete_tree_node(Tree_node* node_ptr) {
	for (int i = 0; i < 18; i++) {
		if (node_ptr->get_child_ptr(i)) {
			recursive_delete_tree_node(node_ptr->get_child_ptr(i));
		}
	}
	delete node_ptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x1c(%rbp), %r15
movl $0x0, (%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6926
testq %rax, %rax
je 0x63c5
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6926
movq %r14, %rdi
movq %rax, %rsi
callq 0x6384
movl -0x1c(%rbp), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x1c(%rbp)
cmpl $0x11, %eax
jl 0x639f
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
callq 0x2150
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tyhsu[P]Ewn/tree_node.cpp
// Function: Tree_node::Tree_node()
Tree_node::Tree_node() {
	this->win_count = 0;
	this->visit_count = 0;
	this->game_status = 0;
	this->parent_ptr = NULL;
	for (int i = 0; i < 18; i++)
		this->children_ptr_list[i] = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x10, %rdi
callq 0x770a
movq $0x0, (%rbx)
movl $0x0, 0x8(%rbx)
addq $0xf8, %rbx
movl $0x98, %edx
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2090
// File: /workspace/github_cpp_makefile_star2_O3/tyhsu[P]Ewn/tree_node.cpp
// Function: Tree_node::Tree_node(Game const&)
Tree_node::Tree_node(const Game& game_) {
	this->win_count = 0;
	this->visit_count = 0;
	this->game_status = 0;
	this->game = game_;
	this->parent_ptr = NULL;
	new_child_nodes();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rdi), %r15
movq %r15, %rdi
callq 0x770a
xorl %r12d, %r12d
movq %r12, (%r14)
movl $0x0, 0x8(%r14)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x79c2
movq %r12, 0xf8(%r14)
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6682
nop
// File: /workspace/github_cpp_makefile_star2_O3/tyhsu[P]Ewn/tree_node.cpp
// Function: Tree_node::new_child_nodes()
void Tree_node::new_child_nodes() {
	int legal_child_num = 0;
	// new the legal nodes for children_ptr
	for (int i = 0; i < 18; i++) {
		// check if the movement is legal
		int chs_index = i / 3, direction = i % 3;
		if (!this->game.get_cur_chs_list(chs_index).exist) continue;
		Movement movement(chs_index, direction);
		if (!this->game.check_in_board(movement)) continue;

		// new legal child nodes
		this->children_ptr_list[legal_child_num] = new Tree_node();
		Tree_node* node_ptr = this->children_ptr_list[legal_child_num];
		legal_child_num++;

		// reset the values of the members
		node_ptr->game = this->game;
		node_ptr->game_status = node_ptr->game.update_game_status(movement);
		node_ptr->game.switch_player();
		node_ptr->parent_ptr = this;
	}
	// reset the rest of the children_ptr to NULL
	for (int i = legal_child_num; i < 18; i++)
		this->children_ptr_list[i] = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x10(%rdi), %r14
movq %rdi, -0x50(%rbp)
leaq 0x100(%rdi), %rax
movq %rax, -0x48(%rbp)
movq $0x0, -0x38(%rbp)
movl $0xaaaaaaab, %r15d      # imm = 0xAAAAAAAB
leaq -0x2c(%rbp), %r12
xorl %ebx, %ebx
movzbl %bl, %eax
imull $0xab, %eax, %eax
shrl $0x9, %eax
movl %eax, -0x2c(%rbp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x850e
btl $0x8, %eax
jae 0x6797
movl %ebx, %eax
imulq %r15, %rax
shrq $0x21, %rax
leal (%rax,%rax,2), %eax
negl %eax
addl %ebx, %eax
movl -0x2c(%rbp), %ecx
movl %ecx, -0x40(%rbp)
movl %eax, -0x3c(%rbp)
movq %r14, %rdi
leaq -0x40(%rbp), %rsi
callq 0x7f74
testb %al, %al
je 0x6797
movl $0x190, %edi            # imm = 0x190
callq 0x2140
movq %rax, %r13
leaq 0x10(%rax), %r12
movq %r12, %rdi
callq 0x770a
movq $0x0, (%r13)
movl $0x0, 0x8(%r13)
movq %r13, %rdi
addq $0xf8, %rdi
movl $0x98, %edx
xorl %esi, %esi
callq 0x2090
movq -0x38(%rbp), %rax
cltq
movq -0x50(%rbp), %r15
movq %r13, 0x100(%r15,%rax,8)
incl %eax
movq %rax, -0x38(%rbp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x79c2
movq %r12, %rdi
leaq -0x40(%rbp), %rsi
callq 0x7fea
movl %eax, 0x8(%r13)
movq %r12, %rdi
callq 0x8150
movq %r15, 0xf8(%r13)
movl $0xaaaaaaab, %r15d      # imm = 0xAAAAAAAB
leaq -0x2c(%rbp), %r12
incl %ebx
cmpl $0x12, %ebx
jne 0x66ba
movq -0x38(%rbp), %rdx
cmpl $0x11, %edx
jg 0x67cc
movslq %edx, %rax
movq -0x48(%rbp), %rcx
leaq (%rcx,%rax,8), %rdi
movl $0x11, %eax
subl %edx, %eax
leaq 0x8(,%rax,8), %rdx
xorl %esi, %esi
callq 0x2090
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x190, %esi            # imm = 0x190
movq %r13, %rdi
callq 0x2150
movq %rbx, %rdi
callq 0x2200
nop
// File: /workspace/github_cpp_makefile_star2_O3/tyhsu[P]Ewn/tree_node.cpp
// Function: Tree_node::Tree_node(Tree_node*)
Tree_node::Tree_node(Tree_node* node) {
	this->win_count = node->win_count;
	this->visit_count = node->visit_count;
	this->game_status = node->game_status;
	this->game = node->game;
	this->parent_ptr = node->parent_ptr;
	for (int i = 0; i < 18; i++) {
		this->children_ptr_list[i] = node->children_ptr_list[i];
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rdi), %r15
movq %r15, %rdi
callq 0x770a
movl (%rbx), %eax
movl %eax, (%r14)
movl 0x4(%rbx), %eax
movl %eax, 0x4(%r14)
movl 0x8(%rbx), %eax
movl %eax, 0x8(%r14)
leaq 0x10(%rbx), %rsi
movq %r15, %rdi
callq 0x79c2
movq 0xf8(%rbx), %rax
movq %rax, 0xf8(%r14)
xorl %eax, %eax
movq 0x100(%rbx,%rax,8), %rcx
movq %rcx, 0x100(%r14,%rax,8)
incq %rax
cmpq $0x12, %rax
jne 0x683f
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tyhsu[P]Ewn/tree_node.cpp
// Function: Tree_node::operator=(Tree_node const&)
void Tree_node::operator=(const Tree_node& node) {
	this->win_count = node.win_count;
	this->visit_count = node.visit_count;
	this->game_status = node.game_status;
	this->game = node.game;
	this->parent_ptr = node.parent_ptr;
	for (int i = 0; i < 18; i++) {
		this->children_ptr_list[i] = node.children_ptr_list[i];
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl (%rsi), %eax
movl %eax, (%rdi)
movl 0x4(%rsi), %eax
movl %eax, 0x4(%rdi)
movl 0x8(%rsi), %eax
movl %eax, 0x8(%rdi)
addq $0x10, %rsi
addq $0x10, %rdi
callq 0x79c2
movq 0xf8(%rbx), %rax
movq %rax, 0xf8(%r14)
xorl %eax, %eax
movq 0x100(%rbx,%rax,8), %rcx
movq %rcx, 0x100(%r14,%rax,8)
incq %rax
cmpq $0x12, %rax
jne 0x689e
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tyhsu[P]Ewn/tree_node.cpp
// Function: Tree_node::node_status()
void Tree_node::node_status() {
	cout << "vvvvvvvvvvvvvvv NODE_STATUS vvvvvvvvvvvvvvv" << endl;
	cout << "node : " << this << endl;
	this->game.print_board();
	this->game.print_status();
	printf("win_count: %d, visit: %d, status: %d\n", this->win_count, this->visit_count, this->game_status);

	printf("check in board                  :");
	for(int i = 0; i < 18; i ++ )
		printf("%c ", this->game.check_in_board(Movement(i/3, i%3)) ? 'T' : 'F'); printf("\n");

	printf("is exist                        :");
	for(int i = 0; i < 18; i ++ )
		printf("%c ", this->game.get_cur_chs_list(i/3).exist ? 'T' : 'F'); printf("\n");
	cout << "^^^^^^^^^^^^^^^ NODE_STATUS ^^^^^^^^^^^^^^^" << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r15
movq 0x6675(%rip), %rbx      # 0xcfc8
leaq 0x2dbe(%rip), %rsi      # 0x9718
movl $0x2b, %edx
movq %rbx, %rdi
callq 0x2170
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
leaq 0x2daf(%rip), %rsi      # 0x9744
movl $0x7, %edx
movq %rbx, %rdi
callq 0x2170
movq %rbx, %rdi
movq %r15, %rsi
callq 0x20e0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
leaq 0x10(%r15), %r14
movq %r14, %rdi
callq 0x7be2
movq %r14, %rdi
callq 0x818e
movl (%r15), %esi
movl 0x4(%r15), %edx
movl 0x8(%r15), %ecx
leaq 0x2d4f(%rip), %rdi      # 0x974c
xorl %eax, %eax
callq 0x2040
leaq 0x2d67(%rip), %rdi      # 0x9772
xorl %eax, %eax
callq 0x2040
leaq -0x34(%rbp), %r15
movl $0x54, %ebx
leaq 0x2d72(%rip), %r12      # 0x9794
xorl %r13d, %r13d
movl %r13d, %eax
movl $0xaaaaaaab, %ecx       # imm = 0xAAAAAAAB
imulq %rcx, %rax
shrq $0x21, %rax
leal (%rax,%rax,2), %eax
movzbl %r13b, %ecx
imull $0xab, %ecx, %ecx
shrl $0x9, %ecx
movl %r13d, %edx
subl %eax, %edx
movl %ecx, -0x34(%rbp)
movl %edx, -0x30(%rbp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x7f74
testb %al, %al
movl $0x46, %esi
cmovnel %ebx, %esi
movq %r12, %rdi
xorl %eax, %eax
callq 0x2040
incl %r13d
cmpl $0x12, %r13d
jne 0x6a25
movl $0xa, %edi
callq 0x2190
leaq 0x2d0f(%rip), %rdi      # 0x9798
xorl %eax, %eax
callq 0x2040
leaq -0x2c(%rbp), %r15
leaq 0x2cf9(%rip), %r12      # 0x9794
xorl %ebx, %ebx
movzbl %bl, %eax
imull $0xab, %eax, %eax
shrl $0x9, %eax
movl %eax, -0x2c(%rbp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x850e
btl $0x8, %eax
movl $0x46, %esi
jae 0x6ac7
movl $0x54, %esi
movq %r12, %rdi
xorl %eax, %eax
callq 0x2040
incl %ebx
cmpl $0x12, %ebx
jne 0x6a9d
movl $0xa, %edi
callq 0x2190
leaq 0x2cd1(%rip), %rsi      # 0x97ba
movl $0x2b, %edx
movq 0x64d3(%rip), %rbx      # 0xcfc8
movq %rbx, %rdi
callq 0x2170
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tyhsu[P]Ewn/minimax.cpp
// Function: Minimax::Minimax()
Minimax::Minimax() {
	HEIGHT = 5;
	SIMU_TIMES = 100;

	// pos: a <int,int> , <x,y> coord;
	for (int i = 0; i < 5; i++) {
		for (int j = 0;j < 5; j++) {
			// insert to map => feature_map_A;
			// get the smaller of (x,y)
			int k = (i > j ? j : i);
			k = (k+1) * (k+1) * 3;
			Pos chs_pos;
			chs_pos.first = i;
			chs_pos.second = j;
			this->feature_map_A.insert(make_pair(chs_pos, k));

			// insert to map => feature_map_B;
			// get the bigger of (x,y)
			k = (i > j ? i : j);
			k = (5-k) * (5-k) * 3;
			chs_pos.first = i;
			chs_pos.second = j;
			this->feature_map_B.insert(make_pair(chs_pos, k));
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x623c(%rip), %rax      # 0xcd88
movq %rax, (%rdi)
leaq 0x18(%rdi), %rax
movq %rax, -0x40(%rbp)
leaq 0x20(%rdi), %rax
xorl %r13d, %r13d
movl %r13d, 0x20(%rdi)
movq %r13, 0x28(%rdi)
movq %rax, 0x30(%rdi)
movq %rax, 0x38(%rdi)
movq %r13, 0x40(%rdi)
leaq 0x48(%rdi), %r14
leaq 0x50(%rdi), %rax
movl %r13d, 0x50(%rdi)
movq %r13, 0x58(%rdi)
movq %rax, 0x60(%rdi)
movq %rax, 0x68(%rdi)
movq %r13, 0x70(%rdi)
movabsq $0x6400000005, %rax     # imm = 0x6400000005
movq %rax, 0x8(%rdi)
leaq -0x38(%rbp), %r15
movq %r13, %r12
xorl %ebx, %ebx
cmpl %ebx, %r13d
movl %ebx, %eax
cmovbl %r13d, %eax
incl %eax
imull %eax, %eax
leal (%rax,%rax,2), %eax
movq %r12, -0x38(%rbp)
movl %eax, -0x30(%rbp)
movq -0x40(%rbp), %rdi
movq %r15, %rsi
callq 0x73b0
cmpl %ebx, %r13d
movl %ebx, %eax
cmoval %r13d, %eax
movl $0x5, %ecx
subl %eax, %ecx
imull %ecx, %ecx
leal (%rcx,%rcx,2), %eax
movq %r12, -0x38(%rbp)
movl %eax, -0x30(%rbp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x73b0
incq %rbx
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r12
cmpq $0x5, %rbx
jne 0x6ba5
incq %r13
cmpq $0x5, %r13
jne 0x6ba0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6c21
movq %rax, %r15
movq %r14, %rdi
callq 0x4e0e
movq -0x40(%rbp), %rdi
callq 0x4e0e
movq %r15, %rdi
callq 0x2200
nop
// File: /workspace/github_cpp_makefile_star2_O3/tyhsu[P]Ewn/minimax.cpp
// Function: Minimax::evaluate_simulation(Game const&)
int Minimax::evaluate_simulation(const Game& cur_game) {
	float win_times = 0;
	for (int game_cnt = 0; game_cnt < SIMU_TIMES; game_cnt++) {
		win_times += simulation(cur_game);
	}
	return (int)(win_times / SIMU_TIMES * 20);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xf0, %rsp
movl 0xc(%rdi), %eax
testl %eax, %eax
jle 0x7203
movq %rsi, %rbx
movq %rdi, %r14
xorps %xmm1, %xmm1
xorl %r12d, %r12d
leaq -0x110(%rbp), %r15
movss %xmm1, -0x24(%rbp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x78e2
movq %r14, %rdi
movq %r15, %rsi
callq 0x722e
movss -0x24(%rbp), %xmm1
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
addss %xmm0, %xmm1
incl %r12d
movl 0xc(%r14), %eax
cmpl %eax, %r12d
jl 0x71ca
jmp 0x7206
xorps %xmm1, %xmm1
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss %xmm0, %xmm1
mulss 0x25d7(%rip), %xmm1     # 0x97f0
cvttss2si %xmm1, %eax
addq $0xf0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tyhsu[P]Ewn/minimax.cpp
// Function: Minimax::simulation(Game)
int Minimax::simulation(Game simu_game) {
	char cur_symbol;
	int game_status = 0, ai_win = this->ai_side ? 2 : 1;
	if (simu_game.get_is_switch() == this->ai_side)
		cur_symbol = this->ai_symbol;
	else
		cur_symbol = this->ai_side? '1' : 'A';

	while (game_status == 0) {
		Movement available_mvmt_list[18];
		int available_mvmt_cnt = 0;

		// find all avaible move (6 dice indices, 3 directions)
		for(int chs_index = 0; chs_index < 6; chs_index++) {
			Chess cur_chs = simu_game.get_cur_chs_list(chs_index);
			if (cur_chs.exist) {
				for (int direct = 0; direct < 3; direct++) {
					Movement tmp_mvmt(chs_index, direct);
					if (simu_game.check_in_board(tmp_mvmt)) {
						available_mvmt_list[available_mvmt_cnt] = tmp_mvmt;
						available_mvmt_cnt ++;
					}
				}
			}
		}
		// randomly pick a move.
		Movement next_mvmt = available_mvmt_list[rand() % available_mvmt_cnt];
		game_status = simu_game.update_game_status(next_mvmt);

		// check game status => if the game keep going, switch the player.
		if(game_status == 0) simu_game.switch_player();
		else break;
	}
	// return the result of game.
	return (game_status == ai_win? 1 : 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %rbx
movb 0x10(%rdi), %al
movb %al, -0x29(%rbp)
movq %rsi, %rdi
callq 0x855c
leaq -0x30(%rbp), %r15
leaq -0x38(%rbp), %r12
xorl %r13d, %r13d
movl $0x90, %edx
leaq -0xd0(%rbp), %rdi
xorl %esi, %esi
callq 0x2090
movl $0x0, -0x30(%rbp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x850e
btl $0x8, %eax
jae 0x72c0
xorl %r14d, %r14d
movl -0x30(%rbp), %eax
movl %eax, -0x38(%rbp)
movl %r14d, -0x34(%rbp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x7f74
testb %al, %al
je 0x72b7
movslq %r13d, %r13
movq -0x38(%rbp), %rax
movq %rax, -0xd0(%rbp,%r13,8)
incl %r13d
incl %r14d
cmpl $0x3, %r14d
jne 0x728c
movl -0x30(%rbp), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x30(%rbp)
cmpl $0x5, %eax
jl 0x7278
callq 0x2060
cltd
idivl %r13d
movslq %edx, %rax
movq -0xd0(%rbp,%rax,8), %rax
movq %rax, -0x38(%rbp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x7fea
testl %eax, %eax
jne 0x7302
movq %rbx, %rdi
callq 0x8150
jmp 0x725b
movzbl -0x29(%rbp), %edx
incl %edx
xorl %ecx, %ecx
cmpl %edx, %eax
sete %cl
movl %ecx, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tyhsu[P]Ewn/game.cpp
// Function: Game::Game(Game const&)
Game::Game(const Game& game)
{
	for(int i=0; i<5; i++) {
		for(int j=0; j<5; j++) {
			this->board[i][j] = game.board[i][j];
		}
	}
	for(int i=0; i<2; i++) {
		this->movable_chs_list[i] = game.movable_chs_list[i];
	}
	for(int i=0; i<6; i++) {
		this->chs_list_A[i] = game.chs_list_A[i];
		this->chs_list_B[i] = game.chs_list_B[i];
	}
	this->exist_bitwise_A = game.exist_bitwise_A;
	this->exist_bitwise_B = game.exist_bitwise_B;
	this->is_switch = game.is_switch;
	this->cur_chs_list_ptr = (this->is_switch == false) ? this->chs_list_A :  this->chs_list_B;
	this->cur_exist_bitwise_ptr = (this->is_switch == false) ? this->exist_bitwise_A :  this->exist_bitwise_B;
	this->exist_chs_num_A = game.exist_chs_num_A;
	this->exist_chs_num_B = game.exist_chs_num_B;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
movq %rdi, %rcx
movq %rsi, %rdx
xorl %r8d, %r8d
movb (%rdx,%r8), %r9b
movb %r9b, (%rcx,%r8)
incq %r8
cmpq $0x5, %r8
jne 0x78f1
incq %rax
addq $0x5, %rdx
addq $0x5, %rcx
cmpq $0x5, %rax
jne 0x78ee
movl 0x24(%rsi), %eax
movl %eax, 0x24(%rdi)
movq 0x1c(%rsi), %rax
movq %rax, 0x1c(%rdi)
movq 0x28(%rsi), %rax
movq %rax, 0x28(%rdi)
movl 0x30(%rsi), %eax
movl %eax, 0x30(%rdi)
movl $0x84, %eax
leaq (%rsi,%rax), %rcx
addq %rdi, %rax
movq $-0x48, %rdx
movl 0x8(%rcx,%rdx), %r8d
movl %r8d, 0x8(%rax,%rdx)
movq (%rcx,%rdx), %r8
movq %r8, (%rax,%rdx)
movq 0x48(%rcx,%rdx), %r8
movq %r8, 0x48(%rax,%rdx)
movl 0x50(%rcx,%rdx), %r8d
movl %r8d, 0x50(%rax,%rdx)
addq $0xc, %rdx
jne 0x7942
movl 0xd8(%rsi), %eax
movl %eax, 0xd8(%rdi)
movl 0xdc(%rsi), %ecx
movl %ecx, 0xdc(%rdi)
movb 0xe4(%rsi), %dl
movb %dl, 0xe4(%rdi)
leaq 0x84(%rdi), %r8
leaq 0x3c(%rdi), %r9
testb %dl, %dl
cmoveq %r9, %r8
movq %r8, 0xd0(%rdi)
cmovel %eax, %ecx
movl %ecx, 0xe0(%rdi)
movl 0x34(%rsi), %eax
movl %eax, 0x34(%rdi)
movl 0x38(%rsi), %eax
movl %eax, 0x38(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tyhsu[P]Ewn/game.cpp
// Function: Game::operator=(Game const&)
void Game::operator=(const Game& game)
{
	for(int i=0; i<5; i++) {
		for(int j=0; j<5; j++) {
			this->board[i][j] = game.board[i][j];
		}
	}
	for(int i=0; i<2; i++) {
		this->movable_chs_list[i] = game.movable_chs_list[i];
	}
	for(int i=0; i<6; i++) {
		this->chs_list_A[i] = game.chs_list_A[i];
		this->chs_list_B[i] = game.chs_list_B[i];
	}
	this->exist_bitwise_A = game.exist_bitwise_A;
	this->exist_bitwise_B = game.exist_bitwise_B;
	this->is_switch = game.is_switch;
	this->cur_chs_list_ptr = (game.is_switch) ? this->chs_list_B : this->chs_list_A;
	this->exist_chs_num_A = game.exist_chs_num_A;
	this->exist_chs_num_B = game.exist_chs_num_B;
//	cout << "calling copy : "  << this->is_switch << " " << this->cur_chs_list_ptr << "  " << this->chs_list_A << "  " << this->chs_list_B << "  " << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
movq %rdi, %rcx
movq %rsi, %rdx
xorl %r8d, %r8d
movb (%rdx,%r8), %r9b
movb %r9b, (%rcx,%r8)
incq %r8
cmpq $0x5, %r8
jne 0x79d1
incq %rax
addq $0x5, %rdx
addq $0x5, %rcx
cmpq $0x5, %rax
jne 0x79ce
movl 0x24(%rsi), %eax
movl %eax, 0x24(%rdi)
movq 0x1c(%rsi), %rax
movq %rax, 0x1c(%rdi)
movq 0x28(%rsi), %rax
movq %rax, 0x28(%rdi)
movl 0x30(%rsi), %eax
movl %eax, 0x30(%rdi)
movl $0x84, %eax
leaq (%rsi,%rax), %rcx
addq %rdi, %rax
movq $-0x48, %rdx
movl 0x8(%rcx,%rdx), %r8d
movl %r8d, 0x8(%rax,%rdx)
movq (%rcx,%rdx), %r8
movq %r8, (%rax,%rdx)
movq 0x48(%rcx,%rdx), %r8
movq %r8, 0x48(%rax,%rdx)
movl 0x50(%rcx,%rdx), %r8d
movl %r8d, 0x50(%rax,%rdx)
addq $0xc, %rdx
jne 0x7a22
movl 0xd8(%rsi), %eax
movl %eax, 0xd8(%rdi)
movl 0xdc(%rsi), %eax
movl %eax, 0xdc(%rdi)
movb 0xe4(%rsi), %al
movb %al, 0xe4(%rdi)
leaq 0x3c(%rdi), %rcx
leaq 0x84(%rdi), %rdx
testb %al, %al
cmovneq %rdx, %rcx
movq %rcx, 0xd0(%rdi)
movl 0x34(%rsi), %eax
movl %eax, 0x34(%rdi)
movl 0x38(%rsi), %eax
movl %eax, 0x38(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tyhsu[P]Ewn/game.cpp
// Function: Game::set_board(char (*) [5], int)
void Game::set_board(char board_[5][5], int is_switch_)
{
	int chs_num_A_ = 0, chs_num_B_ = 0;
	int exist_bitwise_A_ = 0, exist_bitwise_B_ = 0;
	for (int i=0; i<6; i++) {
		this->chs_list_A[i].assign(0, false, 0, 0);
		this->chs_list_B[i].assign(0, false, 4, 4);
	}

	for (int i=0; i<5; i++) {
		for (int j=0; j<5; j++) {
			char c = board_[j][i];

			//Set the board
			this->board[i][j] = c;

			//Update other information
			if (c>='1' && c<='6') {
				chs_num_A_++;
				this->chs_list_A[c-'1'].assign(c, true, i, j);
				exist_bitwise_A_ |= 1 << (c-'1');
			}
			else if (c>='A' && c<='f') {
				chs_num_B_++;
				this->chs_list_B[c-'A'].assign(c, true, i, j);
				exist_bitwise_B_ |= 1 << (c-'A');
			}
		}
	}
	this->exist_chs_num_A = chs_num_A_;
	this->exist_chs_num_B = chs_num_B_;
	this->exist_bitwise_A = exist_bitwise_A_;
	this->exist_bitwise_B = exist_bitwise_B_;

	if (is_switch_) {
		this->cur_chs_list_ptr = this->chs_list_B;
		this->cur_exist_bitwise_ptr = this->exist_bitwise_B;
		this->is_switch = true;
	}
	else {
		this->cur_chs_list_ptr = this->chs_list_A;
		this->cur_exist_bitwise_ptr = this->exist_bitwise_A;
		this->is_switch = false;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edx, -0x2c(%rbp)
leaq 0x3c(%rdi), %rax
leaq 0x84(%rdi), %rcx
movq $-0x48, %rdx
xorl %r8d, %r8d
movabsq $0x400000004, %r9       # imm = 0x400000004
movw %r8w, 0x84(%rdi,%rdx)
movq $0x0, 0x88(%rdi,%rdx)
movw %r8w, 0xcc(%rdi,%rdx)
movq %r9, 0xd0(%rdi,%rdx)
addq $0xc, %rdx
jne 0x7ac7
xorl %r10d, %r10d
movq %rdi, -0x38(%rbp)
movq %rdi, %r11
xorl %edi, %edi
xorl %r8d, %r8d
xorl %ebx, %ebx
xorl %r14d, %r14d
movq %rsi, %r15
xorl %r12d, %r12d
movb (%r15), %r9b
movb %r9b, (%r11,%r12)
movsbl %r9b, %r13d
leal -0x31(%r13), %edx
cmpb $0x5, %dl
ja 0x7b4c
incl %r14d
addl $-0x31, %r13d
leaq (,%r13,2), %rdx
addq %r13, %rdx
movb %r9b, (%rax,%rdx,4)
movb $0x1, 0x1(%rax,%rdx,4)
movl %r10d, 0x4(%rax,%rdx,4)
movl %r12d, 0x8(%rax,%rdx,4)
btsl %r13d, %r8d
jmp 0x7b7d
leal -0x41(%r9), %edx
cmpb $0x25, %dl
ja 0x7b7d
incl %ebx
addl $-0x41, %r13d
leaq (,%r13,2), %rdx
addq %r13, %rdx
movb %r9b, (%rcx,%rdx,4)
movb $0x1, 0x1(%rcx,%rdx,4)
movl %r10d, 0x4(%rcx,%rdx,4)
movl %r12d, 0x8(%rcx,%rdx,4)
btsl %r13d, %edi
incq %r12
addq $0x5, %r15
cmpq $0x5, %r12
jne 0x7b0d
incq %r10
addq $0x5, %r11
incq %rsi
cmpq $0x5, %r10
jne 0x7b07
movq -0x38(%rbp), %rdx
movl %r14d, 0x34(%rdx)
movl %ebx, 0x38(%rdx)
movl %r8d, 0xd8(%rdx)
cmpl $0x0, -0x2c(%rbp)
cmovneq %rcx, %rax
movl %edi, 0xdc(%rdx)
cmovnel %edi, %r8d
movq %rax, 0xd0(%rdx)
movl %r8d, 0xe0(%rdx)
setne 0xe4(%rdx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tyhsu[P]Ewn/game.cpp
// Function: Game::count_movable_chs(int const&)
int Game::count_movable_chs(const int& dice)
{
	for(int i = 0; i < 2; i++)
		this->movable_chs_list[i].assign(0, false, 0, 0);

	if (this->cur_chs_list_ptr[dice].exist == true) {
		// this piece is alive!
		for(int i = 0; i < 2; i++)
			this->movable_chs_list[i] = this->cur_chs_list_ptr[dice];
		return 1;
	}
	else {
		int movable_chs_cnt = 2;

		// search for maybe other two.
		for (int i = dice-1; i >= 0; i--) {
			if (this->cur_chs_list_ptr[i].exist){
				this->movable_chs_list[0] = this->cur_chs_list_ptr[i];
				break;
			}
		}
		for (int i = dice+1; i < 6; i++) {
			if (this->cur_chs_list_ptr[i].exist){
				this->movable_chs_list[1] = this->cur_chs_list_ptr[i];
				break;
			}
		}

		// if one of movable_chs_list doesn't value, let this Chs = the other one (with value).
		for (int i = 0; i < 2; i++) {
			if (this->movable_chs_list[i].symbol == 0) {
				this->movable_chs_list[i] = this->movable_chs_list[1-i];
				movable_chs_cnt--;
			}
		}
		return movable_chs_cnt;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x1c(%rdi), %rcx
xorl %eax, %eax
movw %ax, 0x1c(%rdi)
movq %rax, 0x20(%rdi)
movw %ax, 0x28(%rdi)
movq %rax, 0x2c(%rdi)
movq 0xd0(%rdi), %rax
movl (%rsi), %r8d
movslq %r8d, %rdx
leaq (%rdx,%rdx,2), %r9
cmpb $0x0, 0x1(%rax,%r9,4)
je 0x7ec3
movq 0xd0(%rdi), %rax
movslq (%rsi), %rdx
leaq (%rdx,%rdx,2), %rdx
movl 0x8(%rax,%rdx,4), %r8d
movl %r8d, 0x8(%rcx)
movq (%rax,%rdx,4), %rdx
movq %rdx, (%rcx)
movslq (%rsi), %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx,4), %rdx
movq %rdx, 0x28(%rdi)
movl 0x8(%rax,%rcx,4), %eax
movl %eax, 0x30(%rdi)
movl $0x1, %eax
jmp 0x7f72
leal 0x1(%r8), %r9d
leaq (%r8,%r8,2), %r10
leaq (%rax,%r10,4), %r10
decl %r9d
testl %r9d, %r9d
jle 0x7ef8
leaq -0xc(%r10), %r11
cmpb $0x1, -0xb(%r10)
movq %r11, %r10
jne 0x7ecf
movl 0x8(%r11), %edx
movl %edx, 0x8(%rcx)
movq (%r11), %rdx
movq %rdx, (%rcx)
movl (%rsi), %r8d
movslq %r8d, %rdx
cmpl $0x6, %r8d
movl $0x5, %esi
cmovgel %r8d, %esi
subq %rdx, %rsi
incq %rsi
leaq (%rdx,%rdx,2), %rdx
leaq (%rax,%rdx,4), %rax
decq %rsi
je 0x7f32
leaq 0xc(%rax), %rdx
cmpb $0x1, 0xd(%rax)
movq %rdx, %rax
jne 0x7f13
movl 0x8(%rdx), %eax
movl %eax, 0x30(%rdi)
movq (%rdx), %rax
movq %rax, 0x28(%rdi)
movl $0x2, %eax
movb $0x1, %dl
xorl %esi, %esi
leaq (%rsi,%rsi,2), %rdi
cmpb $0x0, (%rcx,%rdi,4)
jne 0x7f63
leaq (%rcx,%rdi,4), %rdi
xorq $0x1, %rsi
leaq (%rsi,%rsi,2), %rsi
movl 0x8(%rcx,%rsi,4), %r8d
movl %r8d, 0x8(%rdi)
movq (%rcx,%rsi,4), %rsi
movq %rsi, (%rdi)
decl %eax
movl $0x1, %esi
testb $0x1, %dl
movl $0x0, %edx
jne 0x7f3b
popq %rbp
retq