LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/openflightmaps[P]ofm2xplane/main.cpp
// Function: my_stod(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
double my_stod(string s, int d)
{
    if(s.length()==0)
        return 0.0;
    double out=0.0;
    double add=1.0;
    int l1;
    int l2;
    size_t p1=s.find_first_of("1234567890.");
    s=s.substr(p1);
    p1=s.find_first_not_of("1234567890.");
    s=s.substr(0,p1);
    
    l1=s.find(".");
    if(l1==s.npos)
        l1=s.length();
    l2=s.length();
    
    for(int i=l1-1;i>=0;i--)
    {
        out+=add*(int(s.at(i))-48);
        add=add*10;
    }
    int j=0;
    add=0.1;
    for(int i=l1+1;i<l2;i++)
    {
        out+=add*(int(s.at(i))-48);
        add=add*0.1;
        j++;
/*         cout << "add: " << add << endl;
        cout << "out: " << out << endl << endl;
        system("pause"); */
        if(j==d)
            break;
    }
    return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
cmpq $0x0, 0x8(%rdi)
je 0x5bb4
movl %esi, %ebx
movq %rdi, %r14
leaq 0x5a6c(%rip), %rsi      # 0xb515
movl $0xb, %ecx
xorl %edx, %edx
callq 0x2260
leaq -0x40(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
movq $-0x1, %rcx
callq 0x21c0
movq %r14, %rdi
movq %r15, %rsi
callq 0x21f0
movq (%r15), %rdi
leaq -0x30(%rbp), %r12
cmpq %r12, %rdi
je 0x5af1
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x21b0
leaq 0x5a1d(%rip), %rsi      # 0xb515
movl $0xb, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x22e0
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x21c0
movq %r14, %rdi
movq %r15, %rsi
callq 0x21f0
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x5b36
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x21b0
leaq 0x5557(%rip), %rsi      # 0xb094
movl $0x1, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x2330
cmpl $-0x1, %eax
jne 0x5b55
movq 0x8(%r14), %rax
movq 0x8(%r14), %rdx
testl %eax, %eax
jle 0x5bba
movl %eax, %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
decq %rsi
movsd 0x54b8(%rip), %xmm1     # 0xb028
xorpd %xmm0, %xmm0
movsd 0x54b4(%rip), %xmm2     # 0xb030
cmpq %rsi, %rdx
jbe 0x5c19
movq (%r14), %rcx
movsbl (%rcx,%rsi), %ecx
addl $-0x30, %ecx
xorps %xmm3, %xmm3
cvtsi2sd %ecx, %xmm3
mulsd %xmm1, %xmm3
addsd %xmm3, %xmm0
mulsd %xmm2, %xmm1
leaq -0x1(%rsi), %rcx
incq %rsi
cmpq $0x1, %rsi
movq %rcx, %rsi
jg 0x5b7c
jmp 0x5bbe
xorpd %xmm0, %xmm0
jmp 0x5c0c
xorpd %xmm0, %xmm0
leal 0x1(%rax), %ecx
cmpl %edx, %ecx
jge 0x5c0c
movslq %ecx, %rsi
movl %edx, %ecx
subl %eax, %ecx
movsd 0x544c(%rip), %xmm1     # 0xb020
movl $0x1, %eax
movapd %xmm1, %xmm2
cmpq %rsi, %rdx
jbe 0x5c19
movq (%r14), %rdi
movsbl (%rdi,%rsi), %edi
addl $-0x30, %edi
xorps %xmm3, %xmm3
cvtsi2sd %edi, %xmm3
mulsd %xmm2, %xmm3
addsd %xmm3, %xmm0
cmpl %eax, %ebx
je 0x5c0c
mulsd %xmm1, %xmm2
incq %rsi
incl %eax
cmpl %eax, %ecx
jne 0x5bdd
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5c30(%rip), %rdi      # 0xb850
xorl %eax, %eax
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O1/openflightmaps[P]ofm2xplane/main.cpp
// Function: search_all_nodes(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, rapidxml::xml_node<char>*, std::basic_ofstream<char, std::char_traits<char>>&)
void search_all_nodes(string target, xml_node<> *start, ofstream &out)
{
    xml_node<> * current=start;
	int ebene=0;
	out << current->name() << endl << endl;
	while(true)
	{
	    if(current->first_node()!=NULL && current->first_node()->name()[0] != '\0')
		{
			ebene++;
			current=current->first_node();
			goto check;
		}
		sibparent:
		if(current->next_sibling()!=NULL)
		{
			current=current->next_sibling();
			goto check;
		}
		if(current->parent()!=NULL && ebene > 0)
		{
			ebene--;
			current=current->parent();
			goto sibparent;
		}
		break;
		
		check:
		string s(current->name());
		if(s.compare(target)==0)
			out << current->value() << endl;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, -0x38(%rbp)
movq (%rsi), %r12
testq %r12, %r12
leaq 0x749a(%rip), %r14      # 0xf1f0
cmoveq %r14, %r12
movq %r12, %rdi
callq 0x20e0
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x21d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r12, %rdi
movq %r14, %r12
callq 0x2040
movq %rax, %rdi
callq 0x2140
xorl %r14d, %r14d
movq 0x30(%r15), %rax
testq %rax, %rax
je 0x7df6
movq (%rax), %rcx
testq %rcx, %rcx
cmoveq %r12, %rcx
cmpb $0x0, (%rcx)
je 0x7df6
incl %r14d
movq %rax, %r15
jmp 0x7e0f
testl %r14d, %r14d
jle 0x7ea3
movq %rax, %r15
decl %r14d
movq 0x20(%r15), %rax
testq %rax, %rax
je 0x7eb2
movq 0x58(%r15), %rcx
testq %rcx, %rcx
je 0x7de7
movq %rcx, %r15
movq (%r15), %rsi
testq %rsi, %rsi
cmoveq %r12, %rsi
leaq -0x58(%rbp), %r13
movq %r13, %rdi
leaq -0x29(%rbp), %rdx
callq 0x8a4c
movq %r13, %rdi
movq -0x38(%rbp), %rsi
callq 0x2050
testl %eax, %eax
jne 0x7e81
movq 0x8(%r15), %r13
testq %r13, %r13
cmoveq %r12, %r13
movq %r13, %rdi
callq 0x20e0
movq %rbx, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x21d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x7dc7
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x21b0
jmp 0x7dc7
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3926(%rip), %rdi      # 0xb7df
leaq 0x370a(%rip), %rsi      # 0xb5ca
leaq 0x3927(%rip), %rcx      # 0xb7ee
movl $0x3ee, %edx            # imm = 0x3EE
callq 0x2130
movq %rax, %rbx
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x7eed
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x21b0
movq %rbx, %rdi
callq 0x2340
// File: /workspace/github_cpp_makefile_star2_O1/openflightmaps[P]ofm2xplane/main.cpp
// Function: return_ID(rapidxml::xml_node<char>*)
int return_ID(xml_node<> *node)
{
    for(int i=0;i<4;i++)
    {
        if(node->first_attribute("mid")==NULL)
        {
            if(node->first_node()==NULL)
                return -1;
            else
            {
                node=node->first_node();
                continue;
            }
        }else
            return my_stoi(string(node->first_attribute("mid")->value()));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0x302c(%rip), %rsi      # 0xb25e
xorl %edx, %edx
movl $0x1, %ecx
callq 0x894c
testq %rax, %rax
jne 0x826a
leaq 0x3014(%rip), %r14      # 0xb25e
movq 0x30(%rbx), %rbx
testq %rbx, %rbx
je 0x82c7
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x894c
testq %rax, %rax
je 0x824a
leaq 0x2fed(%rip), %rsi      # 0xb25e
movq %rbx, %rdi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x894c
movq 0x8(%rax), %rax
testq %rax, %rax
leaq 0x6f62(%rip), %rsi      # 0xf1f0
cmovneq %rax, %rsi
leaq -0x38(%rbp), %rbx
leaq -0x11(%rbp), %rdx
movq %rbx, %rdi
callq 0x8a4c
movq %rbx, %rdi
callq 0x5490
movl %eax, %ebx
leaq -0x28(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x82cc
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x21b0
jmp 0x82cc
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x28(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x82f3
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x21b0
movq %rbx, %rdi
callq 0x2340
// File: /workspace/github_cpp_makefile_star2_O1/openflightmaps[P]ofm2xplane/./rapidxml.hpp
// Function: rapidxml::xml_node<char>::next_sibling(char const*, unsigned long, bool) const
xml_node<Ch> *next_sibling(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
        {
            assert(this->m_parent);     // Cannot query for siblings if node has no parent
            if (name)
            {
                if (name_size == 0)
                    name_size = internal::measure(name);
                for (xml_node<Ch> *sibling = m_next_sibling; sibling; sibling = sibling->m_next_sibling)
                    if (internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive))
                        return sibling;
                return 0;
            }
            else
                return m_next_sibling;
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpq $0x0, 0x20(%rdi)
je 0x892d
testq %rsi, %rsi
je 0x8920
testq %rdx, %rdx
jne 0x885b
movq $-0x1, %rax
leaq 0x1(%rax), %rdx
cmpb $0x0, 0x1(%rsi,%rax)
movq %rdx, %rax
jne 0x884d
movq 0x58(%rdi), %rax
testq %rax, %rax
je 0x8924
leaq 0x1(%rsi), %rdi
leaq 0x697d(%rip), %r8       # 0xf1f0
leaq 0x3736(%rip), %r9       # 0xbfb0
movq (%rax), %r14
testq %r14, %r14
je 0x888b
movq %r14, %r10
movq 0x10(%rax), %r14
jmp 0x888e
movq %r8, %r10
cmpq %rdx, %r14
jne 0x8911
leaq (%r10,%r14), %r11
testq %r14, %r14
setg %bl
testb %cl, %cl
je 0x88d0
testq %r14, %r14
jle 0x8924
movb (%r10), %r14b
cmpb (%rsi), %r14b
jne 0x890d
incq %r10
movq %rdi, %r14
cmpq %r11, %r10
setb %bl
jae 0x8924
movb (%r10), %r15b
leaq 0x1(%r14), %r12
incq %r10
cmpb (%r14), %r15b
movq %r12, %r14
je 0x88b4
jmp 0x890d
testq %r14, %r14
jle 0x8924
movzbl (%r10), %r14d
movb (%r14,%r9), %r14b
movzbl (%rsi), %r15d
cmpb (%r15,%r9), %r14b
jne 0x890d
incq %r10
movq %rdi, %r14
cmpq %r11, %r10
setb %bl
jae 0x8924
movzbl (%r10), %r15d
movb (%r15,%r9), %r15b
movzbl (%r14), %r12d
incq %r14
incq %r10
cmpb (%r12,%r9), %r15b
je 0x88ed
testb %bl, %bl
je 0x8924
movq 0x58(%rax), %rax
testq %rax, %rax
jne 0x887a
jmp 0x8924
movq 0x58(%rdi), %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2eab(%rip), %rdi      # 0xb7df
leaq 0x2c8f(%rip), %rsi      # 0xb5ca
leaq 0x2eac(%rip), %rcx      # 0xb7ee
movl $0x3ee, %edx            # imm = 0x3EE
callq 0x2130
// File: /workspace/github_cpp_makefile_star2_O1/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 0x10c96(%rip), %rax     # 0x135a8
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %ebx
cmovneq %rcx, %rbx
leaq 0x96e3(%rip), %rdi      # 0xc00c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x27ba
movl $0x18, %esi
movq %rbx, %rdi
callq 0x2070
movq %rax, %r14
movl $0x1, %esi
movq %rbx, %rdi
callq 0x2070
movq %rax, %r15
movq 0x10c56(%rip), %r12     # 0x135b0
movq 0x10c47(%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 0x29ac
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 0x298c
testq %r13, %r13
je 0x29c5
movq %r12, %rdi
callq 0x2090
movq 0x10c00(%rip), %rdi     # 0x135c0
callq 0x2090
movq 0x10bdc(%rip), %rax     # 0x135a8
leaq (%rax,%rax,2), %rax
leaq (%r14,%rax,8), %rax
movq %rax, 0x10bdd(%rip)     # 0x135b8
movq %rbx, 0x10bc6(%rip)     # 0x135a8
movq %r14, 0x10bc7(%rip)     # 0x135b0
movq %r15, 0x10bd0(%rip)     # 0x135c0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x10a47(%rip), %eax     # 0x13540
testl %eax, %eax
sete %cl
testb $0x1, %bl
sete %dl
orb %cl, %dl
je 0x2b20
testl %eax, %eax
je 0x2b18
movl %ebx, %edi
callq 0x29fa
cmpl $0xf, %eax
jne 0x2b3f
movl %ebx, %edi
popq %rbx
jmp 0x2a3d
leaq 0x94fd(%rip), %rdi      # 0xc024
leaq 0x9509(%rip), %rsi      # 0xc037
leaq 0x9575(%rip), %rcx      # 0xc0aa
movl $0x76, %edx
callq 0x2060
leaq 0x9581(%rip), %rdi      # 0xc0c7
leaq 0x94ea(%rip), %rsi      # 0xc037
leaq 0x9556(%rip), %rcx      # 0xc0aa
movl $0x78, %edx
callq 0x2060
// File: /workspace/github_cpp_makefile_star2_O1/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 0x109d9(%rip), %eax     # 0x13540
testl %eax, %eax
sete %cl
testb $0x1, %bl
sete %dl
orb %cl, %dl
je 0x2b8e
testl %eax, %eax
je 0x2b86
movl %ebx, %edi
callq 0x29fa
cmpl $0xb, %eax
jbe 0x2bad
movl %ebx, %edi
popq %rbx
jmp 0x2a3d
leaq 0x948f(%rip), %rdi      # 0xc024
leaq 0x949b(%rip), %rsi      # 0xc037
leaq 0x9569(%rip), %rcx      # 0xc10c
movl $0x7b, %edx
callq 0x2060
leaq 0x9579(%rip), %rdi      # 0xc12d
leaq 0x947c(%rip), %rsi      # 0xc037
leaq 0x954a(%rip), %rcx      # 0xc10c
movl $0x7d, %edx
callq 0x2060
// File: /workspace/github_cpp_makefile_star2_O1/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
cmpq $0x0, 0x10874(%rip)     # 0x135b8
je 0x2d4f
cmpl $0x0, 0x107f3(%rip)     # 0x13540
je 0x2d63
callq 0x2e77
cmpq $0x0, 0x1085c(%rip)     # 0x135b8
jne 0x2d63
callq 0x2902
movq 0x1084e(%rip), %r14     # 0x135b8
movq 0x10(%r14), %rax
movq %rax, 0x10843(%rip)     # 0x135b8
leal 0x1(,%rbx,2), %eax
movl %eax, (%r14)
movl 0x107e7(%rip), %eax     # 0x1356c
movl %eax, 0x4(%r14)
movl $0x4, %esi
movq %rbx, %rdi
callq 0x2070
movq %rax, 0x10(%r14)
movl $0x0, 0x8(%r14)
subq 0x10807(%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_O1/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 0x2df9
sarl %edi
movq 0x107eb(%rip), %rax     # 0x135c0
movslq %edi, %rcx
cmpb $0x0, (%rax,%rcx)
jne 0x2df9
movb $0x1, (%rax,%rcx)
movq 0x107c7(%rip), %rax     # 0x135b0
leaq (%rcx,%rcx,2), %rcx
movl $0x1, %ebx
cmpl $0x0, 0x8(%rax,%rcx,8)
je 0x2e04
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, 0x1072b(%rip)     # 0x13540
je 0x2e1b
testl %ebp, %ebp
je 0x2e58
leaq (%rax,%rcx,8), %rax
movq 0x10(%rax), %r15
sarl %r14d
xorl %r12d, %r12d
testl %r14d, %r14d
cmovlel %r12d, %r14d
movl $0x1, %ebx
cmpl %r12d, %r14d
je 0x2df9
movl (%r15,%r12,4), %edi
callq 0x2dbc
movl %eax, %eax
addq %rax, %rbx
incq %r12
cmpl $0x0, 0x106ee(%rip)     # 0x13540
je 0x2e35
testl %ebp, %ebp
jne 0x2e35
leaq 0x932f(%rip), %rdi      # 0xc18e
leaq 0x91d1(%rip), %rsi      # 0xc037
leaq 0x94c7(%rip), %rcx      # 0xc334
movl $0x90, %edx
callq 0x2060
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1073d(%rip), %rdi     # 0x135c0
movq 0x1071e(%rip), %rdx     # 0x135a8
xorl %esi, %esi
callq 0x2050
movl 0x106c9(%rip), %edi     # 0x13560
callq 0x2dbc
movl %eax, %ebx
movq 0x10703(%rip), %rsi     # 0x135a8
testq %rsi, %rsi
je 0x2f20
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x10709(%rip), %rax     # 0x135c0
cmpb $0x0, (%rax,%r15)
jne 0x2f0d
movq 0x106eb(%rip), %rax     # 0x135b0
cmpl $-0x1, (%rax,%r14)
je 0x2f0d
movq 0x10(%rax,%r14), %rdi
callq 0x2090
movq 0x106d3(%rip), %rax     # 0x135b0
movl $0xffffffff, (%rax,%r14) # imm = 0xFFFFFFFF
movl 0x1065d(%rip), %ecx     # 0x13548
movl %ecx, 0x4(%rax,%r14)
movq 0x106c1(%rip), %rcx     # 0x135b8
movq %rcx, 0x10(%rax,%r14)
movq 0x106ad(%rip), %rax     # 0x135b0
addq %r14, %rax
movq %rax, 0x106ab(%rip)     # 0x135b8
incq %r15
movq 0x10691(%rip), %rsi     # 0x135a8
addq $0x18, %r14
cmpq %r15, %rsi
ja 0x2eb0
movslq %ebx, %rbx
subq %rbx, %rsi
leaq 0x9419(%rip), %rdi      # 0xc346
xorl %eax, %eax
callq 0x27ba
movq 0x1066d(%rip), %rax     # 0x135a8
subq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x104e1(%rip), %rax     # 0x13480
cmpq $0x40, %rax
jae 0x2fce
leaq 0x100d4(%rip), %rcx     # 0x13080
movq %rsi, (%rcx,%rax,8)
leaq 0x102c9(%rip), %rcx     # 0x13280
movq %rdi, (%rcx,%rax,8)
leaq 0x1(%rax), %rcx
movq %rcx, 0x104ba(%rip)     # 0x13480
leal 0x1(,%rax,2), %eax
retq
pushq %rax
leaq 0x93a4(%rip), %rdi      # 0xc37a
leaq 0x905a(%rip), %rsi      # 0xc037
leaq 0x93ad(%rip), %rcx      # 0xc391
movl $0xbf, %edx
callq 0x2060
// File: /workspace/github_cpp_makefile_star2_O1/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 0xba1d(%rip), %eax      # 0x13488
cmpl $0x0, 0xbace(%rip)      # 0x13540
setne %cl
testb $0x1, %al
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
je 0x7bb4
movq %rdi, %rbx
sarl %eax
cltq
leaq 0xb5ed(%rip), %r14      # 0x13080
movq (%r14,%rax,8), %r15
callq 0x2040
leal 0x1(,%rax,2), %edi
callq *%r15
movl 0xba38(%rip), %eax      # 0x134e4
cmpl $0x0, 0xba8d(%rip)      # 0x13540
setne %cl
testb $0x1, %al
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
je 0x7bb4
sarl %eax
cltq
movl 0xbaa8(%rip), %edi      # 0x13578
callq *(%r14,%rax,8)
movl %eax, %edi
callq *%r15
movl %eax, %ebp
movb (%rbx), %al
testb %al, %al
je 0x7b4f
movl %ebp, %ecx
sarl %ecx
movq 0xbac4(%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 0xba36(%rip), %edi      # 0x13540
testl %edi, %edi
sete %r8b
orb %sil, %r8b
je 0x7b8c
movl %edx, %esi
sarl %esi
testl %edi, %edi
je 0x7b2f
testl %esi, %esi
js 0x7b83
movl (%rcx), %edi
testb $0x1, %dil
je 0x7b95
sarl %edi
cmpl %edi, %esi
jge 0x7b83
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 0x7afc
movl 0xb937(%rip), %eax      # 0x1348c
cmpl $0x0, 0xb9e4(%rip)      # 0x13540
setne %cl
testb $0x1, %al
sete %dl
testb %dl, %cl
jne 0x7bd3
sarl %eax
cltq
movl 0xb9d6(%rip), %edi      # 0x13548
callq *(%r14,%rax,8)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7cb1(%rip), %rdi      # 0xf83b
jmp 0x7b9c
leaq 0x44c7(%rip), %rdi      # 0xc05a
jmp 0x7b9c
leaq 0x45f2(%rip), %rdi      # 0xc18e
leaq 0x4494(%rip), %rsi      # 0xc037
leaq 0x7c71(%rip), %rcx      # 0xf81b
movl $0x1f9, %edx            # imm = 0x1F9
callq 0x2060
leaq 0x45d3(%rip), %rdi      # 0xc18e
leaq 0x4475(%rip), %rsi      # 0xc037
leaq 0x7c52(%rip), %rcx      # 0xf81b
movl $0x1f7, %edx            # imm = 0x1F7
callq 0x2060
leaq 0x45b4(%rip), %rdi      # 0xc18e
leaq 0x4456(%rip), %rsi      # 0xc037
leaq 0x7c33(%rip), %rcx      # 0xf81b
movl $0x1fa, %edx            # imm = 0x1FA
callq 0x2060
// File: /workspace/github_cpp_makefile_star2_O1/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, %rbx
callq 0x7d9c
movq 0xa4d6(%rip), %r14      # 0xcfc8
leaq -0x38(%rbp), %r13
leaq 0x6a32(%rip), %r15      # 0x952f
movq %rbx, %rdi
callq 0x7fe4
movl %eax, -0x2c(%rbp)
movl $0x6, %edx
movq %r14, %rdi
leaq 0x661e(%rip), %rsi      # 0x9135
callq 0x2170
movl -0x2c(%rbp), %esi
incl %esi
movq %r14, %rdi
callq 0x21f0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq %rbx, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x28ac
movq %rax, -0x38(%rbp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x818e
movl %eax, %r12d
movq %rbx, %rdi
callq 0x7d9c
testl %r12d, %r12d
je 0x2c3a
movl $0x24, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2170
movq (%r14), %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 0x657c(%rip), %rsi      # 0x913c
cmpl $0x1, %r12d
je 0x2bcd
leaq 0x6582(%rip), %rsi      # 0x914f
movl $0x12, %edx
movq %r14, %rdi
callq 0x2170
movq (%r14), %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
movl $0x24, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2170
movq (%r14), %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
jmp 0x2c42
movq %rbx, %rdi
callq 0x8316
testl %r12d, %r12d
je 0x2afd
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x5494
leaq 0x4219(%rip), %rcx      # 0x96a4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq $0x8, %rdi
jmp 0x54bc
addq $0x208, %rdi            # imm = 0x208
jmp 0x54bc
addq $0x108, %rdi            # imm = 0x108
jmp 0x54bc
addq $0x188, %rdi            # imm = 0x188
jmp 0x54bc
addq $0x88, %rdi
popq %rbp
jmp 0x6d2a
addq $0x288, %rdi            # imm = 0x288
popq %rbp
jmp 0x60aa
addq $0x298, %rdi            # imm = 0x298
popq %rbp
jmp 0x5f5a
// File: /workspace/github_cpp_makefile_star2_O1/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 0x872e
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 0x800c
movl $0x0, -0x2c(%rbp)
movl %eax, -0x30(%rbp)
xorl %r12d, %r12d
testl %eax, %eax
jle 0x601e
leaq -0x38(%rbp), %r13
movq %rbx, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x86ca
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 0x8118
testb %al, %al
je 0x6008
movslq %r12d, %r12
movq -0x38(%rbp), %rax
movq %rax, -0x80(%rbp,%r12,8)
incl %r12d
incl %r15d
cmpl $0x3, %r15d
jne 0x5fe2
movl -0x2c(%rbp), %eax
incl %eax
movl %eax, -0x2c(%rbp)
cmpl -0x30(%rbp), %eax
jl 0x5fc4
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_O1/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 0x6738
cmpl $0x0, 0x4(%r14)
jle 0x6344
movl $0x1, %r13d
leaq -0x30(%rbp), %r15
movq %rbx, %rdi
callq 0x69c0
movq %rbx, %r12
testb %al, %al
je 0x62c6
movq %rbx, %r12
movq %r12, %rdi
callq 0x69b2
testb %al, %al
jne 0x62c6
movq 0x8(%r14), %rdi
movq (%rdi), %rax
movq %r12, %rsi
callq *(%rax)
movl %eax, -0x30(%rbp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x6a1c
movq %rax, %r12
movq %rax, %rdi
callq 0x69c0
testb %al, %al
jne 0x6291
movq %r12, %rdi
callq 0x69b2
movq %r12, %rdi
testb %al, %al
je 0x62eb
callq 0x6a04
movl %eax, %ecx
movzbl (%r14), %edx
incl %edx
xorl %eax, %eax
cmpl %edx, %ecx
sete %al
jmp 0x62fd
callq 0x6786
leaq 0x10(%r12), %rsi
movq %r14, %rdi
callq 0x6384
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movq %r12, %rdi
movss %xmm0, -0x2c(%rbp)
callq 0x69da
movq %r12, %rdi
callq 0x6a0e
testq %rax, %rax
je 0x6333
movq %r12, %rdi
callq 0x6a0e
movq %rax, %r12
movq %rax, %rdi
movss -0x2c(%rbp), %xmm0
jmp 0x630c
leal 0x1(%r13), %eax
cmpl 0x4(%r14), %r13d
movl %eax, %r13d
jl 0x627f
movq %rbx, %rdi
callq 0x69f2
movl %eax, %r15d
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6488
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_O1/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 0x7a74
movb (%r14), %al
movb %al, -0x29(%rbp)
movq %rbx, %rdi
callq 0x872e
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 0x86e0
btl $0x8, %eax
jae 0x6425
xorl %r14d, %r14d
movl -0x30(%rbp), %eax
movl %eax, -0x38(%rbp)
movl %r14d, -0x34(%rbp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x8118
testb %al, %al
je 0x641c
movslq %r13d, %r13
movq -0x38(%rbp), %rax
movq %rax, -0xd0(%rbp,%r13,8)
incl %r13d
incl %r14d
cmpl $0x3, %r14d
jne 0x63f1
movl -0x30(%rbp), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x30(%rbp)
cmpl $0x5, %eax
jl 0x63dd
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 0x818e
testl %eax, %eax
jne 0x6467
movq %rbx, %rdi
callq 0x8316
jmp 0x63c0
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_O1/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 0x6a1c
testq %rax, %rax
je 0x64c9
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6a1c
movq %r14, %rdi
movq %rax, %rsi
callq 0x6488
movl -0x1c(%rbp), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x1c(%rbp)
cmpl $0x11, %eax
jl 0x64a3
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_O1/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 0x788a
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_O1/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 0x788a
xorl %r12d, %r12d
movq %r12, (%r14)
movl $0x0, 0x8(%r14)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x7b6e
movq %r12, 0xf8(%r14)
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6786
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
movq %rdi, -0x48(%rbp)
leaq 0x10(%rdi), %r14
movq $0x0, -0x38(%rbp)
movl $0xaaaaaaab, %r15d      # imm = 0xAAAAAAAB
leaq -0x2c(%rbp), %r13
xorl %ebx, %ebx
movl %ebx, %r12d
imulq %r15, %r12
shrq $0x21, %r12
movl %r12d, -0x2c(%rbp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x86e0
btl $0x8, %eax
jae 0x6887
leal (%r12,%r12,2), %eax
movl %ebx, %ecx
subl %eax, %ecx
movl -0x2c(%rbp), %eax
movl %eax, -0x40(%rbp)
movl %ecx, -0x3c(%rbp)
movq %r14, %rdi
leaq -0x40(%rbp), %rsi
callq 0x8118
testb %al, %al
je 0x6887
movl $0x190, %edi            # imm = 0x190
callq 0x2140
movq %rax, %r13
leaq 0x10(%rax), %r12
movq %r12, %rdi
callq 0x788a
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 -0x48(%rbp), %r15
movq %r13, 0x100(%r15,%rax,8)
incl %eax
movq %rax, -0x38(%rbp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x7b6e
movq %r12, %rdi
leaq -0x40(%rbp), %rsi
callq 0x818e
movl %eax, 0x8(%r13)
movq %r12, %rdi
callq 0x8316
movq %r15, 0xf8(%r13)
movl $0xaaaaaaab, %r15d      # imm = 0xAAAAAAAB
leaq -0x2c(%rbp), %r13
incl %ebx
cmpl $0x12, %ebx
jne 0x67b3
movq -0x38(%rbp), %rdx
cmpl $0x11, %edx
jg 0x68c3
movslq %edx, %rax
movq -0x48(%rbp), %rcx
leaq (%rcx,%rax,8), %rdi
addq $0x100, %rdi            # imm = 0x100
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
// File: /workspace/github_cpp_makefile_star2_O1/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 0x788a
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 0x7b6e
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 0x6935
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x7b6e
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 0x6994
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x657f(%rip), %rbx      # 0xcfc8
leaq 0x2cc8(%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 0x2cb9(%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 0x7d9c
movq %r14, %rdi
callq 0x8360
movl (%r15), %esi
movl 0x4(%r15), %edx
movl 0x8(%r15), %ecx
leaq 0x2c59(%rip), %rdi      # 0x974c
xorl %eax, %eax
callq 0x2040
leaq 0x2c71(%rip), %rdi      # 0x9772
xorl %eax, %eax
callq 0x2040
leaq -0x34(%rbp), %r15
movl $0x54, %ebx
leaq 0x2c7c(%rip), %r12      # 0x9794
xorl %r13d, %r13d
movl %r13d, %eax
movl $0xaaaaaaab, %ecx       # imm = 0xAAAAAAAB
imulq %rcx, %rax
shrq $0x21, %rax
leal (%rax,%rax,2), %ecx
movl %r13d, %edx
subl %ecx, %edx
movl %eax, -0x34(%rbp)
movl %edx, -0x30(%rbp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x8118
testb %al, %al
movl $0x46, %esi
cmovnel %ebx, %esi
movq %r12, %rdi
xorl %eax, %eax
callq 0x2040
incl %r13d
cmpl $0x12, %r13d
jne 0x6b1b
movl $0xa, %edi
callq 0x2190
leaq 0x2c26(%rip), %rdi      # 0x9798
xorl %eax, %eax
callq 0x2040
movl $0xaaaaaaab, %r13d      # imm = 0xAAAAAAAB
leaq -0x2c(%rbp), %r15
leaq 0x2c0a(%rip), %r12      # 0x9794
xorl %ebx, %ebx
movl %ebx, %eax
imulq %r13, %rax
shrq $0x21, %rax
movl %eax, -0x2c(%rbp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x86e0
btl $0x8, %eax
movl $0x46, %esi
jae 0x6bb4
movl $0x54, %esi
movq %r12, %rdi
xorl %eax, %eax
callq 0x2040
incl %ebx
cmpl $0x12, %ebx
jne 0x6b8c
movl $0xa, %edi
callq 0x2190
leaq 0x2be4(%rip), %rsi      # 0x97ba
movl $0x2b, %edx
movq 0x63e6(%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
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6150(%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 0x750a
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 0x750a
incq %rbx
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r12
cmpq $0x5, %rbx
jne 0x6c91
incq %r13
cmpq $0x5, %r13
jne 0x6c8c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6d0d
movq %rax, %r15
movq %r14, %rdi
callq 0x4de6
movq -0x40(%rbp), %rdi
callq 0x4de6
movq %r15, %rdi
callq 0x2200
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x7359
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 0x7a74
movq %r14, %rdi
movq %r15, %rsi
callq 0x7384
movss -0x24(%rbp), %xmm1
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
addss %xmm0, %xmm1
incl %r12d
movl 0xc(%r14), %eax
cmpl %eax, %r12d
jl 0x7320
jmp 0x735c
xorps %xmm1, %xmm1
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss %xmm0, %xmm1
mulss 0x2481(%rip), %xmm1     # 0x97f0
cvttss2si %xmm1, %eax
addq $0xf0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop