LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: rilutham[P]gotojakarta/./stlastar.h
// Function: AStarSearch<PathSearchNode>::AddSuccessor(PathSearchNode&)
bool AddSuccessor( UserState &State )
	{
		Node *node = AllocateNode();

		if( node )
		{
			node->m_UserState = State;

			m_Successors.push_back( node );

			return true;
		}

		return false;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x28(%rbp)
callq 0x4760
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x315c
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, 0x1c(%rax)
addq $0x30, %rdi
leaq -0x20(%rbp), %rsi
callq 0x47d0
movb $0x1, -0x1(%rbp)
jmp 0x3160
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: rilutham[P]gotojakarta/./stlastar.h
// Function: AStarSearch<PathSearchNode>::SetStartAndGoalStates(PathSearchNode&, PathSearchNode&)
void SetStartAndGoalStates( UserState &Start, UserState &Goal )
	{
		m_CancelRequest = false;

		m_Start = AllocateNode();
		m_Goal = AllocateNode();

		assert((m_Start != NULL && m_Goal != NULL));
		
		m_Start->m_UserState = Start;
		m_Goal->m_UserState = Goal;

		m_State = SEARCH_STATE_SEARCHING;
		
		// Initialise the AStar specific parts of the Start Node
		// The user only needs fill out the state information

		m_Start->g = 0; 
		m_Start->h = m_Start->m_UserState.GoalDistanceEstimate( m_Goal->m_UserState );
		m_Start->f = m_Start->g + m_Start->h;
		m_Start->parent = 0;

		// Push the start node on the Open list

		m_OpenList.push_back( m_Start ); // heap now unsorted

		// Sort back element into heap
		push_heap( m_OpenList.begin(), m_OpenList.end(), HeapCompare_f() );

		// Initialise counter for search steps
		m_Steps = 0;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x38(%rbp)
movb $0x0, 0x9c(%rdi)
callq 0x4760
movq -0x38(%rbp), %rdi
movq %rax, 0x50(%rdi)
callq 0x4760
movq -0x38(%rbp), %rcx
movq %rax, 0x58(%rcx)
xorl %eax, %eax
cmpq $0x0, 0x50(%rcx)
movb %al, -0x2a(%rbp)
je 0x32b8
movq -0x38(%rbp), %rax
cmpq $0x0, 0x58(%rax)
setne %al
movb %al, -0x2a(%rbp)
movb -0x2a(%rbp), %al
testb $0x1, %al
jne 0x32c1
jmp 0x32c3
jmp 0x32e2
leaq 0x4079(%rip), %rdi      # 0x7343
leaq 0x4096(%rip), %rsi      # 0x7367
movl $0x9d, %edx
leaq 0x4097(%rip), %rcx      # 0x7374
callq 0x20b0
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rdx
movq 0x50(%rax), %rcx
movl (%rdx), %edx
movl %edx, 0x1c(%rcx)
movq -0x18(%rbp), %rdx
movq 0x58(%rax), %rcx
movl (%rdx), %edx
movl %edx, 0x1c(%rcx)
movl $0x1, 0x48(%rax)
movq 0x50(%rax), %rcx
xorps %xmm0, %xmm0
movss %xmm0, 0x10(%rcx)
movq 0x50(%rax), %rdi
addq $0x1c, %rdi
movq 0x58(%rax), %rsi
addq $0x1c, %rsi
callq 0x23c0
movq -0x38(%rbp), %rdi
movq 0x50(%rdi), %rax
movss %xmm0, 0x14(%rax)
movq 0x50(%rdi), %rax
movss 0x10(%rax), %xmm0
movq 0x50(%rdi), %rax
addss 0x14(%rax), %xmm0
movq 0x50(%rdi), %rax
movss %xmm0, 0x18(%rax)
movq 0x50(%rdi), %rax
movq $0x0, (%rax)
movq %rdi, %rsi
addq $0x50, %rsi
callq 0x47d0
movq -0x38(%rbp), %rdi
callq 0x4c70
movq -0x38(%rbp), %rdi
movq %rax, -0x20(%rbp)
callq 0x4b00
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x5210
movq -0x38(%rbp), %rax
movl $0x0, 0x4c(%rax)
addq $0x40, %rsp
popq %rbp
retq
nop
// File: rilutham[P]gotojakarta/./stlastar.h
// Function: AStarSearch<PathSearchNode>::GetSolutionStart()
UserState *GetSolutionStart()
	{
		m_CurrentSolutionNode = m_Start;
		if( m_Start )
		{
			return &m_Start->m_UserState;
		}
		else
		{
			return NULL;
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq 0x50(%rax), %rcx
movq %rcx, 0x60(%rax)
cmpq $0x0, 0x50(%rax)
je 0x3c91
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
addq $0x1c, %rax
movq %rax, -0x8(%rbp)
jmp 0x3c99
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nop
// File: rilutham[P]gotojakarta/./stlastar.h
// Function: AStarSearch<PathSearchNode>::GetSolutionNext()
UserState *GetSolutionNext()
	{
		if( m_CurrentSolutionNode )
		{
			if( m_CurrentSolutionNode->child )
			{

				Node *child = m_CurrentSolutionNode->child;

				m_CurrentSolutionNode = m_CurrentSolutionNode->child;

				return &child->m_UserState;
			}
		}

		return NULL;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, 0x60(%rax)
je 0x3cf2
movq -0x20(%rbp), %rax
movq 0x60(%rax), %rax
cmpq $0x0, 0x8(%rax)
je 0x3cf0
movq -0x20(%rbp), %rax
movq 0x60(%rax), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, -0x18(%rbp)
movq 0x60(%rax), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x60(%rax)
movq -0x18(%rbp), %rax
addq $0x1c, %rax
movq %rax, -0x8(%rbp)
jmp 0x3cfa
jmp 0x3cf2
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
// File: rilutham[P]gotojakarta/./stlastar.h
// Function: AStarSearch<PathSearchNode>::FreeSolutionNodes()
void FreeSolutionNodes()
	{
		Node *n = m_Start;

		if( m_Start->child )
		{
			do
			{
				Node *del = n;
				n = n->child;
				FreeNode( del );

				del = NULL;

			} while( n != m_Goal );

			FreeNode( n ); // Delete the goal

		}
		else
		{
			// if the start node is the solution we need to just delete the start and goal
			// nodes
			FreeNode( m_Start );
			FreeNode( m_Goal );
		}

	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq 0x50(%rax), %rcx
movq %rcx, -0x10(%rbp)
movq 0x50(%rax), %rax
cmpq $0x0, 0x8(%rax)
je 0x3d6f
jmp 0x3d29
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rsi
callq 0x56e0
movq $0x0, -0x18(%rbp)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
cmpq 0x58(%rcx), %rax
jne 0x3d29
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x56e0
jmp 0x3d89
movq -0x20(%rbp), %rdi
movq 0x50(%rdi), %rsi
callq 0x56e0
movq -0x20(%rbp), %rdi
movq 0x58(%rdi), %rsi
callq 0x56e0
addq $0x20, %rsp
popq %rbp
retq
nop
// File: rilutham[P]gotojakarta/./stlastar.h
// Function: AStarSearch<PathSearchNode>::AllocateNode()
Node *AllocateNode()
	{

#if !USE_FSA_MEMORY
		Node *p = new Node;
		return p;
#else
		Node *address = m_FixedSizeAllocator.alloc();

		if( !address )
		{
			return NULL;
		}
		m_AllocateNodeCount ++;
		Node *p = new (address) Node;
		return p;
#endif
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x28(%rbp)
addq $0x68, %rdi
callq 0x4840
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x4792
movq $0x0, -0x8(%rbp)
jmp 0x47c2
movq -0x28(%rbp), %rax
movl 0x98(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x98(%rax)
movq -0x18(%rbp), %rdi
movq %rdi, -0x30(%rbp)
callq 0x4900
movq -0x30(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: rilutham[P]gotojakarta/./fsa.h
// Function: FixedSizeAllocator<AStarSearch<PathSearchNode>::Node>::alloc()
USER_TYPE *alloc()
	{

		FSA_ELEMENT *pNewNode = NULL;

		if( !m_pFirstFree )
		{
			return NULL;
		}
		else
		{
			pNewNode = m_pFirstFree;
			m_pFirstFree = pNewNode->pNext;

			// if the new node points to another free node then
			// change that nodes prev free pointer...
			if( pNewNode->pNext )
			{
				pNewNode->pNext->pPrev = NULL;
			}

			// node is now on the used list

			pNewNode->pPrev = NULL; // the allocated node is always first in the list

			if( m_pFirstUsed == NULL )
			{
				pNewNode->pNext = NULL; // no other nodes
			}
			else
			{
				m_pFirstUsed->pPrev = pNewNode; // insert this at the head of the used list
				pNewNode->pNext = m_pFirstUsed;
			}

			m_pFirstUsed = pNewNode;
		}	
		
		return reinterpret_cast<USER_TYPE*>(pNewNode);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x0, (%rax)
jne 0x486b
movq $0x0, -0x8(%rbp)
jmp 0x48f1
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x18(%rbp)
movq -0x18(%rbp), %rcx
movq 0x28(%rcx), %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x489c
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq $0x0, 0x20(%rax)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
movq $0x0, 0x20(%rcx)
cmpq $0x0, 0x8(%rax)
jne 0x48c1
movq -0x18(%rbp), %rax
movq $0x0, 0x28(%rax)
jmp 0x48dd
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rdx
movq 0x8(%rax), %rcx
movq %rdx, 0x20(%rcx)
movq 0x8(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw (%rax,%rax)
// File: rilutham[P]gotojakarta/./fsa.h
// Function: FixedSizeAllocator<AStarSearch<PathSearchNode>::Node>::FixedSizeAllocator(unsigned int)
FixedSizeAllocator( unsigned int MaxElements = FSA_DEFAULT_SIZE ) :
	m_pFirstUsed( NULL ),
	m_MaxElements( MaxElements )
	{
		// Allocate enough memory for the maximum number of elements

		char *pMem = new char[ m_MaxElements * sizeof(FSA_ELEMENT) ];

		m_pMemory = (FSA_ELEMENT *) pMem; 

		// Set the free list first pointer
		m_pFirstFree = m_pMemory;

		// Clear the memory
		memset( m_pMemory, 0, sizeof( FSA_ELEMENT ) * m_MaxElements );

		// Point at first element
		FSA_ELEMENT *pElement = m_pFirstFree;

		// Set the double linked free list
		for( unsigned int i=0; i<m_MaxElements; i++ )
		{
			pElement->pPrev = pElement-1;
			pElement->pNext = pElement+1;

			pElement++;
		}

		// first element should have a null prev
		m_pFirstFree->pPrev = NULL;
		// last element should have a null next
		(pElement-1)->pNext = NULL;

	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq $0x0, 0x8(%rax)
movl -0xc(%rbp), %ecx
movl %ecx, 0x10(%rax)
movl 0x10(%rax), %eax
imulq $0x30, %rax, %rdi
callq 0x2030
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, -0x18(%rbp)
movq -0x18(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq 0x18(%rax), %rcx
movq %rcx, (%rax)
movq 0x18(%rax), %rdi
movl 0x10(%rax), %eax
imulq $0x30, %rax, %rdx
xorl %esi, %esi
callq 0x2090
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x30(%rbp), %rcx
movl -0x24(%rbp), %eax
cmpl 0x10(%rcx), %eax
jae 0x5112
movq -0x20(%rbp), %rcx
addq $-0x30, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x20(%rbp), %rcx
addq $0x30, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x20(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x50cf
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq $0x0, 0x20(%rax)
movq -0x20(%rbp), %rax
movq $0x0, -0x8(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: rilutham[P]gotojakarta/./stlastar.h
// Function: AStarSearch<PathSearchNode>::FreeAllNodes()
void FreeAllNodes()
	{
		// iterate open list and delete all nodes
		typename vector< Node * >::iterator iterOpen = m_OpenList.begin();

		while( iterOpen != m_OpenList.end() )
		{
			Node *n = (*iterOpen);
			FreeNode( n );

			iterOpen ++;
		}

		m_OpenList.clear();

		// iterate closed list and delete unused nodes
		typename vector< Node * >::iterator iterClosed;

		for( iterClosed = m_ClosedList.begin(); iterClosed != m_ClosedList.end(); iterClosed ++ )
		{
			Node *n = (*iterClosed);
			FreeNode( n );
		}

		m_ClosedList.clear();

		// delete the goal

		FreeNode(m_Goal);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x58(%rbp)
callq 0x4c70
movq %rax, -0x10(%rbp)
movq -0x58(%rbp), %rdi
callq 0x4b00
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x5870
testb $0x1, %al
jne 0x553d
jmp 0x556b
leaq -0x10(%rbp), %rdi
callq 0x52e0
movq -0x58(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rsi
callq 0x56e0
leaq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x58b0
movq %rax, -0x28(%rbp)
jmp 0x551d
movq -0x58(%rbp), %rdi
callq 0x5850
leaq -0x30(%rbp), %rdi
callq 0x5140
movq -0x58(%rbp), %rdi
addq $0x18, %rdi
callq 0x4c70
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x58(%rbp), %rdi
addq $0x18, %rdi
callq 0x4b00
movq %rax, -0x40(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x5870
testb $0x1, %al
jne 0x55ba
jmp 0x55e8
leaq -0x30(%rbp), %rdi
callq 0x52e0
movq -0x58(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rsi
callq 0x56e0
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x58b0
movq %rax, -0x50(%rbp)
jmp 0x5596
movq -0x58(%rbp), %rdi
addq $0x18, %rdi
callq 0x5850
movq -0x58(%rbp), %rdi
movq 0x58(%rdi), %rsi
callq 0x56e0
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: rilutham[P]gotojakarta/./stlastar.h
// Function: AStarSearch<PathSearchNode>::FreeUnusedNodes()
void FreeUnusedNodes()
	{
		// iterate open list and delete unused nodes
		typename vector< Node * >::iterator iterOpen = m_OpenList.begin();

		while( iterOpen != m_OpenList.end() )
		{
			Node *n = (*iterOpen);

			if( !n->child )
			{
				FreeNode( n );

				n = NULL;
			}

			iterOpen ++;
		}

		m_OpenList.clear();

		// iterate closed list and delete unused nodes
		typename vector< Node * >::iterator iterClosed;

		for( iterClosed = m_ClosedList.begin(); iterClosed != m_ClosedList.end(); iterClosed ++ )
		{
			Node *n = (*iterClosed);

			if( !n->child )
			{
				FreeNode( n );
				n = NULL;

			}
		}

		m_ClosedList.clear();

	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x58(%rbp)
callq 0x4c70
movq %rax, -0x10(%rbp)
movq -0x58(%rbp), %rdi
callq 0x4b00
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x5870
testb $0x1, %al
jne 0x575d
jmp 0x579e
leaq -0x10(%rbp), %rdi
callq 0x52e0
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x578d
movq -0x58(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x56e0
movq $0x0, -0x20(%rbp)
leaq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x58b0
movq %rax, -0x28(%rbp)
jmp 0x573d
movq -0x58(%rbp), %rdi
callq 0x5850
leaq -0x30(%rbp), %rdi
callq 0x5140
movq -0x58(%rbp), %rdi
addq $0x18, %rdi
callq 0x4c70
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x58(%rbp), %rdi
addq $0x18, %rdi
callq 0x4b00
movq %rax, -0x40(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x5870
testb $0x1, %al
jne 0x57ed
jmp 0x5830
leaq -0x30(%rbp), %rdi
callq 0x52e0
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x581d
movq -0x58(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x56e0
movq $0x0, -0x48(%rbp)
jmp 0x581f
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x58b0
movq %rax, -0x50(%rbp)
jmp 0x57c9
movq -0x58(%rbp), %rdi
addq $0x18, %rdi
callq 0x5850
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: rilutham[P]gotojakarta/./fsa.h
// Function: FixedSizeAllocator<AStarSearch<PathSearchNode>::Node>::free(AStarSearch<PathSearchNode>::Node*)
void free( USER_TYPE *user_data )
	{
		FSA_ELEMENT *pNode = reinterpret_cast<FSA_ELEMENT*>(user_data);

		// manage used list, remove this node from it
		if( pNode->pPrev )
		{
			pNode->pPrev->pNext = pNode->pNext;
		}
		else
		{
			// this handles the case that we delete the first node in the used list
			m_pFirstUsed = pNode->pNext;
		}

		if( pNode->pNext )
		{
			pNode->pNext->pPrev = pNode->pPrev;
		}

		// add to free list
		if( m_pFirstFree == NULL ) 
		{
			// free list was empty
			m_pFirstFree = pNode;
			pNode->pPrev = NULL;
			pNode->pNext = NULL;
		}
		else
		{
			// Add this node at the start of the free list
			m_pFirstFree->pPrev = pNode;
			pNode->pNext = m_pFirstFree;
			m_pFirstFree = pNode;
		}

	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x5e1d
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rcx, 0x28(%rax)
jmp 0x5e2d
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x28(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x5e4c
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rcx, 0x20(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x5e7b
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x28(%rax)
jmp 0x5e9c
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rdx
movq (%rax), %rcx
movq %rdx, 0x20(%rcx)
movq (%rax), %rdx
movq -0x18(%rbp), %rcx
movq %rdx, 0x28(%rcx)
movq -0x18(%rbp), %rcx
movq %rcx, (%rax)
popq %rbp
retq
nop
// File: tsfn[P]doc2txt/src/main.cpp
// Function: main
int main(int argc, char **argv) {
  if (argc != 4) {
    printf("usage: %s <doc file> <text file> <image directory>\n", argv[0]);
    return 1;
  }

  if (!parse_doc(argv[1], argv[2], argv[3])) {
    printf("error\n");
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x4, -0x8(%rbp)
je 0x131a
movq -0x10(%rbp), %rax
movq (%rax), %rsi
leaq 0x4cfa(%rip), %rdi      # 0x6004
movb $0x0, %al
callq 0x1040
movl $0x1, -0x4(%rbp)
jmp 0x1350
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdx
callq 0x2eb0
testb $0x1, %al
jne 0x1349
leaq 0x4cf6(%rip), %rdi      # 0x6038
movb $0x0, %al
callq 0x1040
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: tsfn[P]doc2txt/src/Storage.cpp
// Function: Storage::Storage()
Storage::Storage() {
  stream_num = 0U;
  stream_name = NULL;
  stream_table = NULL;
  stream_sizes = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
movq $0x0, 0x8(%rax)
movq $0x0, 0x10(%rax)
movq $0x0, 0x18(%rax)
popq %rbp
retq
nopl (%rax)
// File: tsfn[P]doc2txt/src/Storage.cpp
// Function: Storage::~Storage()
Storage::~Storage() {
  for (uint i = 0; i < stream_num; ++i) {
    if (stream_name != NULL && stream_name[i] != NULL) {
      free(stream_name[i]);
      stream_name[i] = NULL;
    }
    if (stream_table != NULL && stream_table[i] != NULL) {
      free(stream_table[i]);
      stream_table[i] = NULL;
    }
  }
  stream_num = 0;
  if (stream_name != NULL) {
    free(stream_name);
    stream_name = NULL;
  }
  if (stream_table != NULL) {
    free(stream_table);
    stream_table = NULL;
  }
  if (stream_sizes != NULL) {
    free(stream_sizes);
    stream_sizes = NULL;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x18(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl (%rcx), %eax
jae 0x1452
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x13fe
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl -0xc(%rbp), %ecx
cmpq $0x0, (%rax,%rcx,8)
je 0x13fe
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl -0xc(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
callq 0x1160
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl -0xc(%rbp), %ecx
movq $0x0, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x1442
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xc(%rbp), %ecx
cmpq $0x0, (%rax,%rcx,8)
je 0x1442
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xc(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
callq 0x1160
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xc(%rbp), %ecx
movq $0x0, (%rax,%rcx,8)
jmp 0x1444
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x13ab
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
cmpq $0x0, 0x8(%rax)
je 0x147c
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1160
movq -0x18(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x14a0
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1160
movq -0x18(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x14c4
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x1160
movq -0x18(%rbp), %rax
movq $0x0, 0x18(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: tsfn[P]doc2txt/src/Storage.cpp
// Function: read_buf(_IO_FILE*, unsigned char**, unsigned int*)
static bool read_buf(FILE *doc_file, uchar **buf, uint *buf_size) {
  fseek(doc_file, 0, SEEK_END);
  *buf_size = ftell(doc_file);
  if (*buf_size < 512) {
    return false;
  }
  *buf_size = ((*buf_size - 512) + 511) / 512 * 512 + 512;
  if ((*buf = (uchar *)malloc(*buf_size)) == NULL) {
    return false;
  }
  fseek(doc_file, 0, SEEK_SET);
  int ch, i = 0;
  while ((ch = fgetc(doc_file)) != EOF) {
    *(*buf + i++) = (uchar)ch;
  }
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x1130
movq -0x10(%rbp), %rdi
callq 0x1030
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
cmpl $0x200, (%rax)          # imm = 0x200
jae 0x18ec
movb $0x0, -0x1(%rbp)
jmp 0x197a
movq -0x20(%rbp), %rax
movl (%rax), %ecx
subl $0x200, %ecx            # imm = 0x200
addl $0x1ff, %ecx            # imm = 0x1FF
shrl $0x9, %ecx
shll $0x9, %ecx
addl $0x200, %ecx            # imm = 0x200
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, %edi
callq 0x1180
movq -0x18(%rbp), %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x1930
movb $0x0, -0x1(%rbp)
jmp 0x197a
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x1130
movl $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x11b0
movl %eax, -0x24(%rbp)
cmpl $-0x1, %eax
je 0x1976
movl -0x24(%rbp), %eax
movb %al, %dl
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl -0x28(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x28(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
jmp 0x1946
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: tsfn[P]doc2txt/src/Storage.cpp
// Function: read_sat(unsigned char*, unsigned int, unsigned char*, unsigned int, unsigned char**, unsigned int*)
static bool read_sat(uchar *buf, uint buf_size, uchar *msat, uint msat_size,
    uchar **sat, uint *sat_size) {
  *sat_size = 0;
  for (uint i = 0; i < msat_size / 4; ++i) {
    uint id = *(uint *)(msat + i * 4);
    if (id > buf_size / 512 - 1) break;
    *sat_size += 1;
  }
  *sat_size *= 512;
  if ((*sat = (uchar *)malloc(*sat_size)) == NULL) {
    return false;
  }
  for (uint i = 0; i < msat_size / 4; ++i) {
    uint id = *(uint *)(msat + i * 4);
    if (id > buf_size / 512 - 1) break;
    memcpy(*sat + i * 512, buf + 512 + id * 512, 512);
  }
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl $0x0, (%rax)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl -0x24(%rbp), %ecx
shrl $0x2, %ecx
cmpl %ecx, %eax
jae 0x1bf6
movq -0x20(%rbp), %rax
movl -0x3c(%rbp), %ecx
shll $0x2, %ecx
movl %ecx, %ecx
movl (%rax,%rcx), %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
movl -0x14(%rbp), %ecx
shrl $0x9, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jbe 0x1be0
jmp 0x1bf6
movq -0x38(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x1baf
movq -0x38(%rbp), %rax
movl (%rax), %ecx
shll $0x9, %ecx
movl %ecx, (%rax)
movq -0x38(%rbp), %rax
movl (%rax), %eax
movl %eax, %edi
callq 0x1180
movq -0x30(%rbp), %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x1c21
movb $0x0, -0x1(%rbp)
jmp 0x1c9a
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl -0x24(%rbp), %ecx
shrl $0x2, %ecx
cmpl %ecx, %eax
jae 0x1c96
movq -0x20(%rbp), %rax
movl -0x44(%rbp), %ecx
shll $0x2, %ecx
movl %ecx, %ecx
movl (%rax,%rcx), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
movl -0x14(%rbp), %ecx
shrl $0x9, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jbe 0x1c59
jmp 0x1c96
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movl -0x44(%rbp), %eax
shll $0x9, %eax
movl %eax, %eax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
addq $0x200, %rsi            # imm = 0x200
movl -0x48(%rbp), %eax
shll $0x9, %eax
movl %eax, %eax
addq %rax, %rsi
movl $0x200, %edx            # imm = 0x200
callq 0x10e0
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x1c28
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: tsfn[P]doc2txt/src/Storage.cpp
// Function: read_stream(unsigned int, unsigned int, unsigned char*, unsigned int, unsigned char*, unsigned int, unsigned char**, unsigned int*)
static bool read_stream(uint start, uint sec_sz, uchar *sat, uint sat_size,
    uchar *buf, uint buf_size, uchar **stream, uint *sz) {
  uint sec_num = 0;
  set<uint> vis;
  for (uint id = start; id < buf_size / sec_sz; id = *(uint *)(sat + id * 4)) {
    if (vis.count(id)) return false;
    vis.insert(id);
    ++sec_num;
  }
  *sz = sec_num * sec_sz;
  *stream = (uchar *)malloc(*sz);
  sec_num = 0;
  for (uint id = start; id < buf_size / sec_sz; id = *(uint *)(sat + id * 4)) {
    memcpy(*stream + sec_num++ * sec_sz, buf + id * sec_sz, sec_sz);
  }
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x1f60
movl -0x8(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
movl %eax, -0x90(%rbp)
movl -0x2c(%rbp), %eax
xorl %edx, %edx
divl -0xc(%rbp)
movl %eax, %ecx
movl -0x90(%rbp), %eax
cmpl %ecx, %eax
jae 0x1daf
leaq -0x60(%rbp), %rdi
leaq -0x64(%rbp), %rsi
callq 0x1f80
movq %rax, -0x98(%rbp)
jmp 0x1d25
movq -0x98(%rbp), %rax
cmpq $0x0, %rax
je 0x1d5c
movb $0x0, -0x1(%rbp)
movl $0x1, -0x78(%rbp)
jmp 0x1e60
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x2030
jmp 0x1e77
leaq -0x60(%rbp), %rdi
leaq -0x64(%rbp), %rsi
callq 0x1fe0
movb %dl, -0xa1(%rbp)
movq %rax, -0xa0(%rbp)
jmp 0x1d78
movb -0xa1(%rbp), %al
movq -0xa0(%rbp), %rcx
movq %rcx, -0x88(%rbp)
movb %al, -0x80(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movl -0x64(%rbp), %ecx
shll $0x2, %ecx
movl %ecx, %ecx
movl (%rax,%rcx), %eax
movl %eax, -0x64(%rbp)
jmp 0x1cee
movl -0x30(%rbp), %ecx
imull -0xc(%rbp), %ecx
movq 0x18(%rbp), %rax
movl %ecx, (%rax)
movq 0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, %edi
callq 0x1180
movq %rax, %rcx
movq 0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x30(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
movl %eax, -0xa8(%rbp)
movl -0x2c(%rbp), %eax
xorl %edx, %edx
divl -0xc(%rbp)
movl %eax, %ecx
movl -0xa8(%rbp), %eax
cmpl %ecx, %eax
jae 0x1e55
movq 0x10(%rbp), %rax
movq (%rax), %rdi
movl -0x30(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x30(%rbp)
imull -0xc(%rbp), %eax
movl %eax, %eax
addq %rax, %rdi
movq -0x28(%rbp), %rsi
movl -0x8c(%rbp), %eax
imull -0xc(%rbp), %eax
movl %eax, %eax
addq %rax, %rsi
movl -0xc(%rbp), %eax
movl %eax, %edx
callq 0x10e0
movq -0x18(%rbp), %rax
movl -0x8c(%rbp), %ecx
shll $0x2, %ecx
movl %ecx, %ecx
movl (%rax,%rcx), %eax
movl %eax, -0x8c(%rbp)
jmp 0x1de3
movb $0x1, -0x1(%rbp)
movl $0x1, -0x78(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x2030
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xb0, %rsp
popq %rbp
retq
movq -0x70(%rbp), %rdi
callq 0x11d0
// File: tsfn[P]doc2txt/src/Storage.cpp
// Function: Storage::stream(char const*, unsigned char const**, unsigned int*) const
bool Storage::stream(const char *name, const uchar **stream, uint *size) const {
  for (uint i = 0; i < stream_num; ++i) {
    bool match = true;
    for (uint j = 0; name[j] != '\0'; ++j) {
      if (name[j] != stream_name[i][j * 2]) {
        match = false;
        break;
      }
    }
    if (match) {
      *stream = stream_table[i];
      *size = stream_sizes[i];
      return true;
    }
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x40(%rbp), %rcx
movl -0x2c(%rbp), %eax
cmpl (%rcx), %eax
jae 0x1f4b
movb $0x1, -0x2d(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x18(%rbp), %rax
movl -0x34(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x1f09
movq -0x40(%rbp), %rcx
movq -0x18(%rbp), %rax
movl -0x34(%rbp), %edx
movsbl (%rax,%rdx), %eax
movq 0x8(%rcx), %rcx
movl -0x2c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
movl -0x34(%rbp), %edx
shll %edx
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
je 0x1efc
movb $0x0, -0x2d(%rbp)
jmp 0x1f09
jmp 0x1efe
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1ebd
testb $0x1, -0x2d(%rbp)
je 0x1f3b
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rcx
movl -0x2c(%rbp), %edx
movq (%rcx,%rdx,8), %rdx
movq -0x20(%rbp), %rcx
movq %rdx, (%rcx)
movq 0x18(%rax), %rax
movl -0x2c(%rbp), %ecx
movl (%rax,%rcx,4), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x1f4f
jmp 0x1f3d
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x1ea3
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: tsfn[P]doc2txt/src/parse_doc.cpp
// Function: parse_doc(char const*, char const*, char const*)
bool parse_doc(const char *doc_file_path, const char *text_file_path, const char *image_dir_path) {
  FILE *doc_file = fopen(doc_file_path, "rb");
  if (doc_file == NULL) {
    return false;
  }

  /* 初始化流 */
  Storage storage;
  if (!storage.init(doc_file)) {
    fclose(doc_file);
    return false;
  }
  fclose(doc_file);

  /* 提取文本 */
  FILE *text_file = fopen(text_file_path, "wb");
  if (text_file == NULL) {
    return false;
  }
  doc_text_file(storage, text_file);
  fclose(text_file);

  /* 提取图片 */
  doc_image(storage, image_dir_path);

  /* 分析格式 */
  doc_format(storage);

  /* 标题、作者等信息 */
  doc_property(storage);
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x316d(%rip), %rsi      # 0x603f
callq 0x1150
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x2eeb
movb $0x0, -0x1(%rbp)
jmp 0x2fd8
leaq -0x48(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0x1360
movq -0x70(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x14d0
movb %al, -0x61(%rbp)
jmp 0x2f0a
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x2f48
jmp 0x2f13
movq -0x28(%rbp), %rdi
callq 0x10f0
jmp 0x2f1e
movb $0x0, -0x1(%rbp)
movl $0x1, -0x58(%rbp)
jmp 0x2fcf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x1390
jmp 0x2fe6
movq -0x28(%rbp), %rdi
callq 0x10f0
jmp 0x2f53
movq -0x18(%rbp), %rdi
leaq 0x30e4(%rip), %rsi      # 0x6042
callq 0x1150
movq %rax, -0x78(%rbp)
jmp 0x2f69
movq -0x78(%rbp), %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x2f85
movb $0x0, -0x1(%rbp)
movl $0x1, -0x58(%rbp)
jmp 0x2fcf
movq -0x60(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x3480
jmp 0x2f94
movq -0x60(%rbp), %rdi
callq 0x10f0
jmp 0x2f9f
movq -0x20(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x36e0
jmp 0x2fae
leaq -0x48(%rbp), %rdi
callq 0x41f0
jmp 0x2fb9
leaq -0x48(%rbp), %rdi
callq 0x5f20
jmp 0x2fc4
movb $0x1, -0x1(%rbp)
movl $0x1, -0x58(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x1390
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x80, %rsp
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x11d0
nop
// File: tsfn[P]doc2txt/src/doc_text.cpp
// Function: get_piece_table(Storage const&)
static const uchar *get_piece_table(const Storage &storage) {
  const uchar *wds, *ts;
  uint wds_size, ts_size;
  if (!storage.stream("WordDocument", &wds, &wds_size)) {
    return NULL;
  }
  ushort flag1 = *(const ushort *)(wds + 0x0A);
  bool is1Table = (flag1 & 0x0200) == 0x0200;
  if (!storage.stream(is1Table ? "1Table" : "0Table", &ts, &ts_size)) {
    return NULL;
  }

  uint fcClx = *(const uint *)(wds + 0x01A2);
  uint lcbClx = *(const uint *)(wds + 0x01A6);
  const uchar *clx = ts + fcClx;
  for (uint pos = 0; clx + pos < ts + ts_size && pos < lcbClx;) {
    uchar type = clx[pos];
    if (type == 2) {
      return clx + pos;
    } else if (type == 1) {
      pos += 3 + *(const ushort *)(clx + pos + 1);
    } else {
      return NULL;
    }
  }
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x2d1e(%rip), %rsi      # 0x6045
leaq -0x18(%rbp), %rdx
leaq -0x24(%rbp), %rcx
callq 0x1e80
testb $0x1, %al
jne 0x3345
movq $0x0, -0x8(%rbp)
jmp 0x3476
movq -0x18(%rbp), %rax
movw 0xa(%rax), %ax
movw %ax, -0x2a(%rbp)
movzwl -0x2a(%rbp), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x200, %eax            # imm = 0x200
sete %al
andb $0x1, %al
movb %al, -0x2b(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
testb $0x1, -0x2b(%rbp)
je 0x3382
leaq 0x2cd6(%rip), %rax      # 0x6052
movq %rax, -0x58(%rbp)
jmp 0x338f
leaq 0x2cd0(%rip), %rax      # 0x6059
movq %rax, -0x58(%rbp)
jmp 0x338f
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
leaq -0x20(%rbp), %rdx
leaq -0x28(%rbp), %rcx
callq 0x1e80
testb $0x1, %al
jne 0x33b5
movq $0x0, -0x8(%rbp)
jmp 0x3476
movq -0x18(%rbp), %rax
movl 0x1a2(%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movl 0x1a6(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x40(%rbp), %rcx
movl -0x44(%rbp), %eax
addq %rax, %rcx
movq -0x20(%rbp), %rdx
movl -0x28(%rbp), %eax
addq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x59(%rbp)
jae 0x340e
movl -0x44(%rbp), %eax
cmpl -0x34(%rbp), %eax
setb %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
testb $0x1, %al
jne 0x3417
jmp 0x346e
movq -0x40(%rbp), %rax
movl -0x44(%rbp), %ecx
movb (%rax,%rcx), %al
movb %al, -0x45(%rbp)
movzbl -0x45(%rbp), %eax
cmpl $0x2, %eax
jne 0x343d
movq -0x40(%rbp), %rax
movl -0x44(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0x3476
movzbl -0x45(%rbp), %eax
cmpl $0x1, %eax
jne 0x345d
movq -0x40(%rbp), %rax
movl -0x44(%rbp), %ecx
movzwl 0x1(%rax,%rcx), %eax
addl $0x3, %eax
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
jmp 0x3467
movq $0x0, -0x8(%rbp)
jmp 0x3476
jmp 0x3469
jmp 0x33e4
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
// File: boczeratul[P]StarCraftGA/ga.cpp
// Function: initChromosomes(int, int)
int** initChromosomes (int size, int ell) {
    int ** chromosomes = new int *[size];

    for ( int i = 0; i < size; ++i )
    {
        chromosomes[i] = new int[MAX_LENGTH+1];
        chromosomes[i][0] = ell;
    }

    return chromosomes;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movslq -0x4(%rbp), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x1030
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x127b
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x1030
movq %rax, %rdx
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x8(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movl %ecx, (%rax)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x123e
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: boczeratul[P]StarCraftGA/ga.cpp
// Function: initializePopulation()
void initializePopulation () {
    int i, j;
    double p = 0.5;

    for (i = 0; i < nInitial; ++i)
        for (j = 1; j < ell+1; ++j)
            if (uniform () > p)
                population[i][j] = 1;
            else
                population[i][j] = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movsd 0x9b38(%rip), %xmm0     # 0xb008
movsd %xmm0, -0x10(%rbp)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl 0xcc0f(%rip), %eax      # 0xe0f4
jge 0x155a
movl $0x1, -0x8(%rbp)
movl -0x8(%rbp), %eax
movl 0xcbf9(%rip), %ecx      # 0xe0f0
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x154d
callq 0x2e30
ucomisd -0x10(%rbp), %xmm0
jbe 0x1526
movq 0xcc0f(%rip), %rax      # 0xe120
movslq -0x4(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x8(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
jmp 0x1540
movq 0xcbf3(%rip), %rax      # 0xe120
movslq -0x4(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x8(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x1542
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x14ee
jmp 0x154f
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x14dc
addq $0x10, %rsp
popq %rbp
retq
// File: boczeratul[P]StarCraftGA/ga.cpp
// Function: evaluateBuildOrder(int**, int*)
void evaluateBuildOrder( int** group,  int* fitnessArray) {
    for ( int i = 0; i < nCurrent; ++i )
    {
        //printChromosome(group[i]);
        //fflush(NULL);
        fitnessArray[i] = testBuildOrder(group[i]);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl 0xc928(%rip), %eax      # 0xe0f8
jge 0x17fb
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x8e70
movl %eax, %edx
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x17c7
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: boczeratul[P]StarCraftGA/ga.cpp
// Function: oneMax(int**, int*)
void oneMax( int** group,  int* fitnessArray ) {
    for ( int i = 0; i < nCurrent; ++i )
    {
        int totalOne = 0;
        for ( int j = 0; j < group[i][0]; ++j )
        {
            totalOne = totalOne + group[i][j+1];
        }

        fitnessArray[i] = totalOne;
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl 0xc8cc(%rip), %eax      # 0xe0f8
jge 0x1891
movl $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl (%rcx), %eax
jge 0x1878
movl -0x18(%rbp), %eax
movq -0x8(%rbp), %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl -0x1c(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
addl (%rcx,%rdx,4), %eax
movl %eax, -0x18(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x183c
movl -0x18(%rbp), %edx
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1823
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: boczeratul[P]StarCraftGA/ga.cpp
// Function: crossover()
void crossover () {
    int i;
    int nNextGeneration = nCurrent;
    if ((nNextGeneration & 0x1) == 0) 
    {
    	// nNextGeneration is even

        for (i = 0; i < nNextGeneration; i += 2)
            pairwiseXO (population[selectionIndex[i]], population[selectionIndex[i + 1]],
                offspring[i], offspring[i + 1]);

    }
    else 
    {
        for (i = 0; i < nNextGeneration - 1; i += 2)
        {
            pairwiseXO (population[selectionIndex[i]], population[selectionIndex[i + 1]],
                offspring[i], offspring[i + 1]);
        }
        copyChromosome ( offspring[nNextGeneration - 1] , population[selectionIndex[nNextGeneration - 1]] );
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl 0xc68a(%rip), %eax      # 0xe0f8
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x1b00
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x1afb
movq 0xc68a(%rip), %rax      # 0xe120
movq 0xc66b(%rip), %rcx      # 0xe108
movslq -0x4(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %rdi
movq 0xc670(%rip), %rax      # 0xe120
movq 0xc651(%rip), %rcx      # 0xe108
movl -0x4(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %rsi
movq 0xc659(%rip), %rax      # 0xe128
movslq -0x4(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0xc64a(%rip), %rax      # 0xe128
movl -0x4(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
callq 0x1bc0
movl -0x4(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x4(%rbp)
jmp 0x1a87
jmp 0x1bb8
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
movl -0x8(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x1b80
movq 0xc605(%rip), %rax      # 0xe120
movq 0xc5e6(%rip), %rcx      # 0xe108
movslq -0x4(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %rdi
movq 0xc5eb(%rip), %rax      # 0xe120
movq 0xc5cc(%rip), %rcx      # 0xe108
movl -0x4(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %rsi
movq 0xc5d4(%rip), %rax      # 0xe128
movslq -0x4(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0xc5c5(%rip), %rax      # 0xe128
movl -0x4(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
callq 0x1bc0
movl -0x4(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x4(%rbp)
jmp 0x1b07
movq 0xc5a1(%rip), %rax      # 0xe128
movl -0x8(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
movq 0xc585(%rip), %rax      # 0xe120
movq 0xc566(%rip), %rcx      # 0xe108
movl -0x8(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x1a30
addq $0x10, %rsp
popq %rbp
retq
nop
// File: boczeratul[P]StarCraftGA/ga.cpp
// Function: pairwiseXO(int*, int*, int*, int*)
void pairwiseXO (int* p1, int* p2, int* c1, int* c2) {
    if (uniform () < pc) 
    {
            onePointXO (p1, p2, c1, c2);
//      uniformXO (p1, p2, c1, c2, 0.5);
    }
    else 
    {
        copyChromosome( c1 , p1);
        copyChromosome( c2 , p2);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
callq 0x2e30
movaps %xmm0, %xmm1
movsd 0xc4b0(%rip), %xmm0     # 0xe098
ucomisd %xmm1, %xmm0
jbe 0x1c05
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x1c30
jmp 0x1c1f
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x1a30
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x1a30
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: boczeratul[P]StarCraftGA/ga.cpp
// Function: onePointXO(int*, int*, int*, int*)
void onePointXO (int* p1, int* p2, int* c1, int* c2) {
//    int i;
    int crossSite1, crossSite2;
    decideCrossSite(p1, p2, crossSite1, crossSite2);   // the crossSite-th gene will be changed
    
    if ( crossSite1 + p2[0] - crossSite2 > MAX_LENGTH  ) //c1[0]
    {
        generateChromosomeByRequest(c1);
    }
    else
    {
        memcpy(c1+1, p1+1, sizeof(int)*crossSite1 );
        memcpy(c1+1+crossSite1, p2+1+crossSite2, sizeof(int)*(p2[0]-crossSite2) );
        c1[0] = crossSite1 + p2[0] - crossSite2;
    }
    
    if ( crossSite2 + p1[0] - crossSite1 > MAX_LENGTH ) //c2[0]
    {
        generateChromosomeByRequest(c2);
    }
    else
    {
        memcpy(c2+1, p2+1, sizeof(int)*crossSite2 );
        memcpy(c2+1+crossSite2, p1+1+crossSite1, sizeof(int)*(p1[0]-crossSite1) );
        c2[0] = crossSite2 + p1[0] - crossSite1;
    }
    
    
    
    //memcpy(c1+1, p1+1, sizeof(int)*crossSite1 );
    //memcpy(c2+1, p2+1, sizeof(int)*crossSite2 );

    
    //memcpy(c1+1+crossSite1, p2+1+crossSite2, sizeof(int)*(p2[0]-crossSite2) );
    //memcpy(c2+1+crossSite2, p1+1+crossSite1, sizeof(int)*(p1[0]-crossSite1) );
    

    
    //c1[0] = crossSite1 + p2[0] - crossSite2;
    //c2[0] = crossSite2 + p1[0] - crossSite1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x24(%rbp), %rdx
leaq -0x28(%rbp), %rcx
callq 0x1d80
movl -0x24(%rbp), %eax
movq -0x10(%rbp), %rcx
addl (%rcx), %eax
subl -0x28(%rbp), %eax
cmpl $0xf9, %eax
jle 0x1c7b
movq -0x18(%rbp), %rdi
callq 0x1560
jmp 0x1ce5
movq -0x18(%rbp), %rdi
addq $0x4, %rdi
movq -0x8(%rbp), %rsi
addq $0x4, %rsi
movslq -0x24(%rbp), %rdx
shlq $0x2, %rdx
callq 0x1080
movq -0x18(%rbp), %rdi
addq $0x4, %rdi
movslq -0x24(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
addq $0x4, %rsi
movslq -0x28(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
movq -0x10(%rbp), %rax
movl (%rax), %eax
subl -0x28(%rbp), %eax
movslq %eax, %rdx
shlq $0x2, %rdx
callq 0x1080
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
addl (%rax), %ecx
subl -0x28(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl -0x28(%rbp), %eax
movq -0x8(%rbp), %rcx
addl (%rcx), %eax
subl -0x24(%rbp), %eax
cmpl $0xf9, %eax
jle 0x1d03
movq -0x20(%rbp), %rdi
callq 0x1560
jmp 0x1d6d
movq -0x20(%rbp), %rdi
addq $0x4, %rdi
movq -0x10(%rbp), %rsi
addq $0x4, %rsi
movslq -0x28(%rbp), %rdx
shlq $0x2, %rdx
callq 0x1080
movq -0x20(%rbp), %rdi
addq $0x4, %rdi
movslq -0x28(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
addq $0x4, %rsi
movslq -0x24(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
movq -0x8(%rbp), %rax
movl (%rax), %eax
subl -0x24(%rbp), %eax
movslq %eax, %rdx
shlq $0x2, %rdx
callq 0x1080
movl -0x28(%rbp), %ecx
movq -0x8(%rbp), %rax
addl (%rax), %ecx
subl -0x24(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: boczeratul[P]StarCraftGA/ga.cpp
// Function: decideCrossSite(int*, int*, int&, int&)
int decideCrossSite(int* p1, int* p2, int& crossSite1, int& crossSite2) {    
    int ratio = uniform();
    int length = p1[0];
    crossSite1 =  1 + length * ratio ;    
    length = p2[0];
    crossSite2 =  1 + length * ratio ;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
callq 0x2e30
cvttsd2si %xmm0, %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %ecx
imull -0x24(%rbp), %ecx
addl $0x1, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %ecx
imull -0x24(%rbp), %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: boczeratul[P]StarCraftGA/ga.cpp
// Function: getDistance(int*&, int*&)
int getDistance (int* & c1, int* & c2) {

    int distance = 0;

    for ( int i = 1; i < c1[0]+1; ++i )
        distance =  distance + abs(c1[i] - c2[i]);  // hamming distance

    return distance;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
movl (%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x20c3
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
movslq -0x18(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
movq -0x10(%rbp), %rdx
movq (%rdx), %rdx
movslq -0x18(%rbp), %rsi
subl (%rdx,%rsi,4), %ecx
movl %ecx, %edx
negl %edx
cmovnsl %edx, %ecx
addl %ecx, %eax
movl %eax, -0x14(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x207a
movl -0x14(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)