LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cinstruction.cpp
// Function: JUMPC::Execute()
void JUMPC::Execute()
{
	if ( m_cpu->flags.carry )
		m_cpu->pc->Set( address ) ;
	else
		m_cpu->pc->Next() ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
movq 0x8(%rdi), %rcx
movq 0x18(%rcx), %rdi
cmpb $0x1, 0x11(%rcx)
jne 0x409ff5
movzwl 0x1a(%rax), %esi
popq %rbp
jmp 0x40b69e
popq %rbp
jmp 0x40b68a
nop
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cinstruction.cpp
// Function: JUMPNC::Execute()
void JUMPNC::Execute()
{
	if ( !m_cpu->flags.carry )
		m_cpu->pc->Set( address ) ;
	else
		m_cpu->pc->Next() ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
movq 0x8(%rdi), %rcx
movq 0x18(%rcx), %rdi
cmpb $0x0, 0x11(%rcx)
je 0x40a04d
popq %rbp
jmp 0x40b68a
movzwl 0x1a(%rax), %esi
popq %rbp
jmp 0x40b69e
nop
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cinstruction.cpp
// Function: JUMPNZ::Execute()
void JUMPNZ::Execute()
{
	if ( !m_cpu->flags.zero )
		m_cpu->pc->Set( address ) ;
	else
		m_cpu->pc->Next() ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
movq 0x8(%rdi), %rcx
movq 0x18(%rcx), %rdi
cmpb $0x0, 0x10(%rcx)
je 0x40a0a9
popq %rbp
jmp 0x40b68a
movzwl 0x1a(%rax), %esi
popq %rbp
jmp 0x40b69e
nop
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cinstruction.cpp
// Function: JUMPZ::Execute()
void JUMPZ::Execute()
{
	if ( m_cpu->flags.zero )
		m_cpu->pc->Set( address ) ;
	else
		m_cpu->pc->Next() ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
movq 0x8(%rdi), %rcx
movq 0x18(%rcx), %rdi
cmpb $0x1, 0x10(%rcx)
jne 0x40a109
movzwl 0x1a(%rax), %esi
popq %rbp
jmp 0x40b69e
popq %rbp
jmp 0x40b68a
nop
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cinstruction.cpp
// Function: RETURNC::Execute()
void RETURNC::Execute()
{
	if ( m_cpu->flags.carry )
		m_cpu->pc->Set( m_cpu->stack->Pop() ) ;
	else
		m_cpu->pc->Next() ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rax
movq 0x18(%rax), %rbx
cmpb $0x1, 0x11(%rax)
jne 0x40a5b2
movq 0x28(%rax), %rdi
callq 0x40b786
movzwl %ax, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x40b69e
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x40b68a
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cinstruction.cpp
// Function: RETURNNC::Execute()
void RETURNNC::Execute()
{
	if ( !m_cpu->flags.carry )
		m_cpu->pc->Set( m_cpu->stack->Pop() ) ;
	else
		m_cpu->pc->Next() ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rax
movq 0x18(%rax), %rbx
cmpb $0x0, 0x11(%rax)
je 0x40a600
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x40b68a
movq 0x28(%rax), %rdi
callq 0x40b786
movzwl %ax, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x40b69e
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cinstruction.cpp
// Function: RETURNNZ::Execute()
void RETURNNZ::Execute()
{
	if ( !m_cpu->flags.zero )
		m_cpu->pc->Set( m_cpu->stack->Pop() ) ;
	else
		m_cpu->pc->Next() ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rax
movq 0x18(%rax), %rbx
cmpb $0x0, 0x10(%rax)
je 0x40a65a
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x40b68a
movq 0x28(%rax), %rdi
callq 0x40b786
movzwl %ax, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x40b69e
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cinstruction.cpp
// Function: RETURNZ::Execute()
void RETURNZ::Execute()
{
	if ( m_cpu->flags.zero )
		m_cpu->pc->Set( m_cpu->stack->Pop() ) ;
	else
		m_cpu->pc->Next() ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rax
movq 0x18(%rax), %rbx
cmpb $0x1, 0x10(%rax)
jne 0x40a6c0
movq 0x28(%rax), %rdi
callq 0x40b786
movzwl %ax, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x40b69e
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x40b68a
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cinstruction.cpp
// Function: RETURNI_DISABLE::Execute()
void RETURNI_DISABLE::Execute()
{
	m_cpu->pc->Set( m_cpu->stack->Pop() ) ;
	m_cpu->flags.carry = m_cpu->flags.preserved_carry ;
	m_cpu->flags.zero = m_cpu->flags.preserved_zero ;
	m_cpu->flags.interrupt_enable = false ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq 0x18(%rax), %r14
movq 0x28(%rax), %rdi
callq 0x40b786
movzwl %ax, %esi
movq %r14, %rdi
callq 0x40b69e
movq 0x8(%rbx), %rax
movzwl 0x13(%rax), %ecx
movw %cx, 0x10(%rax)
movb $0x0, 0x12(%rax)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cinstruction.cpp
// Function: SLX_SX::Execute()
void SLX_SX::Execute()
{
	m_cpu->flags.carry = ( m_cpu->s[ sX ] & 0x80 ) != 0 ;

	m_cpu->s[ sX ] <<= 1 ;
	if ( m_cpu->s[ sX ] & 0x02 )
		m_cpu->s[ sX ] |= 1 ;
	
	m_cpu->flags.zero = m_cpu->s[ sX ] == 0 ;
	m_cpu->pc->Next() ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %rax
movzwl 0x10(%rdi), %ecx
movb (%rax,%rcx), %dl
shrb $0x7, %dl
movb %dl, 0x11(%rax)
shlb (%rax,%rcx)
movq 0x8(%rdi), %rax
movzwl 0x10(%rdi), %edx
movb (%rax,%rdx), %cl
testb $0x2, %cl
je 0x40aa29
orb $0x1, %cl
movb %cl, (%rax,%rdx)
movq 0x8(%rdi), %rax
movzwl 0x10(%rdi), %ecx
movb (%rax,%rcx), %cl
testb %cl, %cl
sete 0x10(%rax)
movq 0x18(%rax), %rdi
popq %rbp
jmp 0x40b68a
nop
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cinstruction.cpp
// Function: SRA_SX::Execute()
void SRA_SX::Execute()
{
	bool c = m_cpu->flags.carry ;
	m_cpu->flags.carry = m_cpu->s[ sX ] & 0x01 ;
	m_cpu->s[ sX ] >>= 1 ;
	if ( c )
		m_cpu->s[ sX ] |= 0x80 ;
	m_cpu->flags.zero = m_cpu->s[ sX ] == 0 ;
	m_cpu->pc->Next() ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %rax
movb 0x11(%rax), %cl
movzwl 0x10(%rdi), %edx
movb (%rax,%rdx), %sil
andb $0x1, %sil
movb %sil, 0x11(%rax)
shrb (%rax,%rdx)
cmpb $0x1, %cl
jne 0x40ab7b
movq 0x8(%rdi), %rax
movzwl 0x10(%rdi), %ecx
orb $-0x80, (%rax,%rcx)
movq 0x8(%rdi), %rax
movzwl 0x10(%rdi), %ecx
cmpb $0x0, (%rax,%rcx)
sete 0x10(%rax)
movq 0x18(%rax), %rdi
popq %rbp
jmp 0x40b68a
nop
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cinstruction.cpp
// Function: TEST_SX_KK::Execute()
void TEST_SX_KK::Execute()
{
	uint8_t and_test = ( m_cpu->s[ sX ] & kk ) ;
	m_cpu->flags.zero = and_test == 0 ;

	int i ;

	uint8_t xor_test = 0, b ;

	for ( i = 0 ; i < 8 ; i++ ) {
		b = ( and_test & ( 1 << i ) ) != 0 ; 
		xor_test = b ^ xor_test ;	
	}

	m_cpu->flags.carry = xor_test != 0 ;
	m_cpu->pc->Next() ;
}

// Assembly:
movq 0x8(%rdi), %rax
movzwl 0x10(%rdi), %ecx
movzbl (%rax,%rcx), %edx
movzbl 0x18(%rdi), %ecx
andl %edx, %ecx
sete 0x10(%rax)
xorl %edx, %edx
xorl %r8d, %r8d
movl %r8d, %esi
btl %edx, %ecx
setb %dil
movl %edi, %r8d
xorb %sil, %r8b
incl %edx
cmpl $0x8, %edx
jne 0x40afc1
pushq %rbp
movq %rsp, %rbp
cmpb %sil, %dil
setne 0x11(%rax)
movq 0x18(%rax), %rdi
popq %rbp
jmp 0x40b68a
nop
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cinstruction.cpp
// Function: TEST_SX_SY::Execute()
void TEST_SX_SY::Execute()
{
	uint8_t and_test = ( m_cpu->s[ sX ] & m_cpu->s[ sY ] ) ;
	m_cpu->flags.zero = and_test == 0 ;

	int i ;

	uint8_t xor_test = 0, b ;

	for ( i = 0 ; i < 8 ; i++ ) {
		b = ( and_test & ( 1 << i ) ) != 0 ; 
		xor_test = b ^ xor_test ;	
	}

	m_cpu->flags.carry = xor_test != 0 ;
	m_cpu->pc->Next() ;
}

// Assembly:
movq 0x8(%rdi), %rax
movzwl 0x10(%rdi), %ecx
movzbl (%rax,%rcx), %edx
movzwl 0x12(%rdi), %ecx
movzbl (%rax,%rcx), %ecx
andl %edx, %ecx
sete 0x10(%rax)
xorl %edx, %edx
xorl %r8d, %r8d
movl %r8d, %esi
btl %edx, %ecx
setb %dil
movl %edi, %r8d
xorb %sil, %r8b
incl %edx
cmpl $0x8, %edx
jne 0x40b065
pushq %rbp
movq %rsp, %rbp
cmpb %sil, %dil
setne 0x11(%rax)
movq 0x18(%rax), %rdi
popq %rbp
jmp 0x40b68a
nop
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cinstruction.cpp
// Function: RESET_EVENT::Execute()
void RESET_EVENT::Execute() 
{
	m_cpu->pc->Set( 0 ) ;
	m_cpu->flags.interrupt_enable = false ;
	m_cpu->flags.zero = false ;
	m_cpu->flags.carry = false ;
	m_cpu->stack->Reset() ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq 0x18(%rax), %rdi
xorl %esi, %esi
callq 0x40b69e
movq 0x8(%rbx), %rax
movb $0x0, 0x12(%rax)
movw $0x0, 0x10(%rax)
movq 0x28(%rax), %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x40b80c
nop
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cinstruction.cpp
// Function: INTERRUPT_EVENT::Execute()
void INTERRUPT_EVENT::Execute()
{
	if ( m_cpu->flags.interrupt_enable ) {
		m_cpu->flags.interrupt_enable = false ;
		m_cpu->stack->Push( m_cpu->pc->Get() ) ;
		m_cpu->flags.preserved_carry = m_cpu->flags.carry ;
		m_cpu->flags.preserved_zero = m_cpu->flags.zero ;
		m_cpu->pc->Set( 0x3FF ) ;	
	}
}

// Assembly:
movq 0x8(%rdi), %rax
cmpb $0x1, 0x12(%rax)
jne 0x40b2a0
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movb $0x0, 0x12(%rax)
movq 0x18(%rax), %rdi
movq 0x28(%rax), %r14
callq 0x40b6ae
movzwl %ax, %esi
movq %r14, %rdi
callq 0x40b6f4
movq 0x8(%rbx), %rax
movzwl 0x10(%rax), %ecx
movw %cx, 0x13(%rax)
movq 0x18(%rax), %rdi
movl $0x3ff, %esi            # imm = 0x3FF
popq %rbx
popq %r14
popq %rbp
jmp 0x40b69e
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cpicoblaze.cpp
// Function: CStack::Push(unsigned short)
void CStack::Push( uint16_t data )
{	
	data &= 0x3FF ;
	if ( ptr == STACK_DEPTH - 1 )
	  cout << ">>>>Stack overflow!<<<<" << endl ;
		
	stack[ ptr ] = data ;
	ptr = ( ptr + 1 ) % STACK_DEPTH ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movb 0x3e(%rdi), %al
cmpb $0x1e, %al
jne 0x40b750
movq $0x5f4580, %r15         # imm = 0x5F4580
leaq 0x176693(%rip), %rsi    # 0x581dac
movl $0x17, %edx
movq %r15, %rdi
callq 0x476110
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x457260
movsbl %al, %esi
movq %r15, %rdi
callq 0x475c10
movq %rax, %rdi
callq 0x4751e0
movb 0x3e(%rbx), %al
andl $0x3ff, %r14d           # imm = 0x3FF
movzbl %al, %eax
movw %r14w, (%rbx,%rax,2)
movl %eax, %ecx
incl %ecx
imull $0x843, %ecx, %ecx      # imm = 0x843
shrl $0x10, %ecx
movl %ecx, %edx
shll $0x5, %edx
subl %edx, %ecx
addl %ecx, %eax
incl %eax
movb %al, 0x3e(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cpicoblaze.cpp
// Function: CStack::Pop()
uint16_t CStack::Pop()
{
	if ( ptr == 0 )
	  cout << ">>>>Stack underflow!<<<<" << endl ;
		
	ptr = ( ptr - 1 ) % STACK_DEPTH ;
	return stack[ ptr ] ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movb 0x3e(%rdi), %al
testb %al, %al
jne 0x40b7dc
movq $0x5f4580, %r14         # imm = 0x5F4580
leaq 0x17661f(%rip), %rsi    # 0x581dc4
movl $0x18, %edx
movq %r14, %rdi
callq 0x476110
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x457260
movsbl %al, %esi
movq %r14, %rdi
callq 0x475c10
movq %rax, %rdi
callq 0x4751e0
movb 0x3e(%rbx), %al
movzbl %al, %eax
leal -0x1(%rax), %ecx
imull $0x4211, %ecx, %ecx     # imm = 0x4211
movl %ecx, %edx
shrl $0x1f, %edx
sarl $0x13, %ecx
addl %edx, %ecx
movl %ecx, %edx
shll $0x5, %edx
subl %edx, %ecx
addl %ecx, %eax
decl %eax
movb %al, 0x3e(%rbx)
movzbl %al, %eax
movzwl (%rbx,%rax,2), %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cpicoblaze.cpp
// Function: CPort::PortIn()
uint8_t CPort::PortIn()
{
	// find appropiate port 
	list<CIOPort*>::iterator i ;
	
	for ( i = portList.begin() ; i != portList.end() ; i++ ) 
		if ( (*i)->getID() == portid && (*i)->isReadable() )
			return (*i)->In() ;
	
	
	// Nothing found return zero
	return 0 ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8(%rdi), %rax
movq 0x8(%rdi), %rcx
cmpq %rax, %rcx
je 0x40b907
movzwl (%rdi), %edx
movq 0x10(%rcx), %rdi
movzbl 0x8(%rdi), %esi
cmpw %si, %dx
jne 0x40b8ff
testb $0x1, 0xc(%rdi)
jne 0x40b90b
movq (%rcx), %rcx
cmpq %rax, %rcx
jne 0x40b8ec
xorl %eax, %eax
popq %rbp
retq
movq (%rdi), %rax
popq %rbp
jmpq *0x8(%rax)
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cpicoblaze.cpp
// Function: CPort::PortOut(unsigned char)
void CPort::PortOut( uint8_t data )
{
	// find appropiate port 
	list<CIOPort*>::iterator i ;
	
	for ( i = portList.begin() ; i != portList.end() ; i++ ) 
		if ( (*i)->getID() == portid && (*i)->isWriteable() )
			(*i)->Out( data ) ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x8(%rdi), %r15
movq 0x8(%rdi), %r12
cmpq %r15, %r12
je 0x40b956
movq %rdi, %rbx
movzbl %sil, %r14d
movq 0x10(%r12), %rdi
movzbl 0x8(%rdi), %eax
cmpw %ax, (%rbx)
jne 0x40b94d
testb $0x2, 0xc(%rdi)
je 0x40b94d
movq (%rdi), %rax
movl %r14d, %esi
callq *(%rax)
movq (%r12), %r12
cmpq %r15, %r12
jne 0x40b931
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cpicoblaze.cpp
// Function: CCode::ClearCode()
void CCode::ClearCode() {	
	int i ;
	for ( i = 0 ; i < MAX_ADDRESS ; i++ )
		if ( CodeMap[ i ] != NULL ) {
			delete CodeMap[ i ] ;
			CodeMap[ i ] = NULL ;
		}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x8(%rbx,%r14,8), %rdi
testq %rdi, %rdi
je 0x40b9d6
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x8(%rbx,%r14,8)
incq %r14
cmpq $0x400, %r14            # imm = 0x400
jne 0x40b9bd
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cpicoblaze.cpp
// Function: CCode::setInstruction(unsigned short, unsigned int, unsigned int)
bool CCode::setInstruction( uint16_t address, uint32_t code, unsigned int sourceLine )
{
	CInstruction *instr = Disassemble( code ) ;
	if ( instr == NULL ) {
	  cout << ">>>>Unknown code at address " << address << "<<<<" << endl ;
		return FALSE ;
	}
	
	if ( address >= MAX_ADDRESS ) {
	  cout << ">>>>Invalid address" << address << "<<<<" << endl ;
		delete instr ;
		return FALSE ;
	}
	
	
	if ( CodeMap[ address ] != NULL ) {
	  cout << ">>>>Code is placed at same address (" << address << ")<<<<" << endl ;
		delete instr ;
		return FALSE ;
	}
	
	instr->setSourceLine( sourceLine ) ;
	CodeMap[ address ] = instr ;
	
	return TRUE ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r15d
movl %esi, %r13d
movq %rdi, %r12
movl %edx, %esi
callq 0x40b9e8
movl %r13d, %r14d
testq %rax, %rax
je 0x40c4c2
movq %rax, %rbx
movzwl %r13w, %eax
cmpl $0x400, %eax            # imm = 0x400
jb 0x40c528
movq $0x5f4580, %r15         # imm = 0x5F4580
leaq 0x175973(%rip), %rsi    # 0x581e09
movl $0x13, %edx
movq %r15, %rdi
callq 0x476110
movq %r15, %rdi
movq %r14, %rsi
callq 0x476a10
movq %rax, %r14
leaq 0x175920(%rip), %rsi    # 0x581dd8
movl $0x4, %edx
jmp 0x40c565
movq $0x5f4580, %rbx         # imm = 0x5F4580
leaq 0x17591c(%rip), %rsi    # 0x581dec
movl $0x1c, %edx
movq %rbx, %rdi
callq 0x476110
movq %rbx, %rdi
movq %r14, %rsi
callq 0x476a10
movq %rax, %rbx
leaq 0x1758e6(%rip), %rsi    # 0x581dd8
movl $0x4, %edx
movq %rax, %rdi
callq 0x476110
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x457260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x475c10
movq %rax, %rdi
callq 0x4751e0
jmp 0x40c59d
cmpq $0x0, 0x8(%r12,%r14,8)
je 0x40c5ae
movq $0x5f4580, %r15         # imm = 0x5F4580
leaq 0x1758df(%rip), %rsi    # 0x581e1d
movl $0x24, %edx
movq %r15, %rdi
callq 0x476110
movq %r15, %rdi
movq %r14, %rsi
callq 0x476a10
movq %rax, %r14
leaq 0x1758e2(%rip), %rsi    # 0x581e42
movl $0x5, %edx
movq %rax, %rdi
callq 0x476110
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x457260
movsbl %al, %esi
movq %r14, %rdi
callq 0x475c10
movq %rax, %rdi
callq 0x4751e0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r15d, 0x20(%rbx)
movq %rbx, 0x8(%r12,%r14,8)
movb $0x1, %al
jmp 0x40c59f
nop
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cpicoblaze.cpp
// Function: CCode::Print()
void CCode::Print()
{
	int i ;
	
	cout << "----listing----" << endl ;
	for ( i = 0 ; i < MAX_ADDRESS ;  i++ ) {
		if ( CodeMap[ i ] != NULL ) {
			cout << i << "  : " ;
			CodeMap[ i ]->Print() ;
			cout << endl ;
		}
	}
	cout << "----end listing----" << endl ;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movq $0x5f4580, %rbx         # imm = 0x5F4580
leaq 0x175856(%rip), %rsi    # 0x581e48
movl $0xf, %edx
movq %rbx, %rdi
callq 0x476110
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x457260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x475c10
movq %rax, %rdi
callq 0x4751e0
xorl %r15d, %r15d
leaq 0x175828(%rip), %r12    # 0x581e58
cmpq $0x0, 0x8(%r14,%r15,8)
je 0x40c685
movq %rbx, %rdi
movl %r15d, %esi
callq 0x4769e0
movl $0x4, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x476110
movq 0x8(%r14,%r15,8), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x457260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x475c10
movq %rax, %rdi
callq 0x4751e0
incq %r15
cmpq $0x400, %r15            # imm = 0x400
jne 0x40c630
leaq 0x1757c5(%rip), %rsi    # 0x581e5d
movl $0x13, %edx
movq %rbx, %rdi
callq 0x476110
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x457260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x475c10
movq %rax, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4751e0
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cpicoblaze.cpp
// Function: CPicoBlaze::CPicoBlaze()
CPicoBlaze::CPicoBlaze()
{
	flags.zero = false ;
	flags.carry = false ;
	flags.interrupt_enable = false ;

	scratch = new CScratchPad ;
	pc = new CProgramCounter ;
	stack = new CStack ;
	port = new CPort ;
	code = new CCode( this ) ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
movw %r14w, 0x10(%rdi)
movb $0x0, 0x12(%rdi)
movl $0x40, %edi
callq 0x40dec0
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movq %rax, 0x20(%rbx)
movl $0x2, %edi
callq 0x40dec0
movw %r14w, (%rax)
movq %rax, 0x18(%rbx)
movl $0x40, %edi
callq 0x40dec0
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x2f(%rax)
movq %rax, 0x28(%rbx)
movl $0x20, %edi
callq 0x40dec0
leaq 0x8(%rax), %rcx
movq %rcx, 0x10(%rax)
movq %rcx, 0x8(%rax)
movq $0x0, 0x18(%rax)
movq %rax, 0x30(%rbx)
movl $0x2008, %edi           # imm = 0x2008
callq 0x40dec0
movq %rax, %r14
movq %rbx, (%rax)
leaq 0x8(%rax), %rdi
movl $0x2000, %edx           # imm = 0x2000
xorl %esi, %esi
callq 0x401090
movq %r14, 0x38(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cpicoblaze.cpp
// Function: CPicoBlaze::~CPicoBlaze()
CPicoBlaze::~CPicoBlaze()
{
	delete scratch ;
	delete pc ;
	delete stack ;
	delete port ;
	delete code ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
movl $0x40, %esi
callq 0x40d020
movq 0x18(%rbx), %rdi
movl $0x2, %esi
callq 0x40d020
movq 0x28(%rbx), %rdi
movl $0x40, %esi
callq 0x40d020
movq 0x30(%rbx), %r14
testq %r14, %r14
je 0x40c7eb
leaq 0x8(%r14), %r15
movq 0x8(%r14), %rdi
cmpq %r15, %rdi
je 0x40c7eb
movq (%rdi), %r12
movl $0x18, %esi
callq 0x40d020
movq %r12, %rdi
cmpq %r15, %r12
jne 0x40c7d6
movl $0x20, %esi
movq %r14, %rdi
callq 0x40d020
movq 0x38(%rbx), %rbx
testq %rbx, %rbx
je 0x40c829
xorl %r14d, %r14d
movq 0x8(%rbx,%r14,8), %rdi
testq %rdi, %rdi
je 0x40c81d
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x8(%rbx,%r14,8)
incq %r14
cmpq $0x400, %r14            # imm = 0x400
jne 0x40c804
movl $0x2008, %esi           # imm = 0x2008
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x40d020
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cpicoblaze.cpp
// Function: CPicoBlaze::Print()
void CPicoBlaze::Print()
{
	int i ;
	
	cout << "----CPU----" << endl ;
	cout << "regs|" ;
	for ( i = 0 ; i < 15 ; i++ ) 
		cout << "s" << i << "=" << (int) s[ i ]  << "|" ;
	cout << endl ;
	
	cout << "flags|";
	cout << "c=" << flags.carry ;
	cout << "|z=" << flags.zero ;
	cout << "|ie=" << flags.interrupt_enable << "|" << endl ;
	cout << "----end CPU----" << endl ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, -0x30(%rbp)
movq $0x5f4580, %rbx         # imm = 0x5F4580
leaq 0x1754fb(%rip), %rsi    # 0x581e71
movl $0xb, %edx
movq %rbx, %rdi
callq 0x476110
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x457260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x475c10
movq %rax, %rdi
callq 0x4751e0
leaq 0x1754cc(%rip), %rsi    # 0x581e7d
movl $0x5, %edx
movq %rbx, %rdi
callq 0x476110
xorl %r15d, %r15d
leaq 0x174eae(%rip), %r12    # 0x581876
leaq 0x179204(%rip), %r13    # 0x585bd3
leaq 0x1754b2(%rip), %rbx    # 0x581e88
movl $0x1, %edx
movq $0x5f4580, %r14         # imm = 0x5F4580
movq %r14, %rdi
movq %r12, %rsi
callq 0x476110
movq %r14, %rdi
movl %r15d, %esi
callq 0x4769e0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x476110
movq -0x30(%rbp), %rax
movzbl (%rax,%r15), %esi
movq %r14, %rdi
callq 0x4769e0
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x476110
incq %r15
cmpq $0xf, %r15
jne 0x40c9d6
movq $0x5f4580, %r14         # imm = 0x5F4580
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x457260
movsbl %al, %esi
movq %r14, %rdi
callq 0x475c10
movq %rax, %rdi
callq 0x4751e0
leaq 0x175419(%rip), %rsi    # 0x581e83
movl $0x6, %edx
movq %r14, %rdi
callq 0x476110
leaq 0x17540c(%rip), %rsi    # 0x581e8a
movl $0x2, %edx
movq %r14, %rdi
callq 0x476110
movq -0x30(%rbp), %rbx
movzbl 0x11(%rbx), %esi
movq %r14, %rdi
callq 0x476c80
leaq 0x1753eb(%rip), %rsi    # 0x581e8d
movl $0x3, %edx
movq %r14, %rdi
callq 0x476110
movzbl 0x10(%rbx), %esi
movq %r14, %rdi
callq 0x476c80
leaq 0x1753cf(%rip), %rsi    # 0x581e91
movl $0x4, %edx
movq %r14, %rdi
callq 0x476110
movzbl 0x12(%rbx), %esi
movq %r14, %rdi
callq 0x476c80
movq %rax, %rbx
leaq 0x1753a3(%rip), %rsi    # 0x581e88
movl $0x1, %edx
movq %rax, %rdi
callq 0x476110
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x457260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x475c10
movq %rax, %rdi
callq 0x4751e0
leaq 0x175376(%rip), %rsi    # 0x581e96
movl $0xf, %edx
movq %r14, %rdi
callq 0x476110
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x457260
movsbl %al, %esi
movq %r14, %rdi
callq 0x475c10
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4751e0
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cpicoblaze.cpp
// Function: CPicoBlaze::GetNextSourceLine()
unsigned int CPicoBlaze::GetNextSourceLine()
{
	CInstruction *instr = code->getInstruction( pc->Get() ) ;
	if ( instr == NULL ) {
	  cout << ">>>>Error in simulation (No code found at " << pc->Get() << ")<<<<" << endl ;
		return FALSE ;
	}

	return instr->getSourceLine() ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rax
movzwl (%rax), %eax
cmpq $0x3ff, %rax            # imm = 0x3FF
ja 0x40cb8e
movq 0x38(%rbx), %rcx
movq 0x8(%rcx,%rax,8), %rax
testq %rax, %rax
je 0x40cb8e
movl 0x20(%rax), %eax
jmp 0x40cbf8
movq $0x5f4580, %r14         # imm = 0x5F4580
leaq 0x17530a(%rip), %rsi    # 0x581ea6
movl $0x2a, %edx
movq %r14, %rdi
callq 0x476110
movq 0x18(%rbx), %rax
movzwl (%rax), %esi
movq %r14, %rdi
callq 0x476a10
movq %rax, %rbx
leaq 0x175280(%rip), %rsi    # 0x581e42
movl $0x5, %edx
movq %rax, %rdi
callq 0x476110
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x457260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x475c10
movq %rax, %rdi
callq 0x4751e0
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/stacksmith[P]picoasm/cpicoblaze.cpp
// Function: CPicoBlaze::Next()
bool CPicoBlaze::Next()
{
	CInstruction *instr = code->getInstruction( pc->Get() ) ;
	if ( instr == NULL ) {
	  cout << ">>>>Error in simulation (No code found at " << pc->Get() << ")<<<<" << endl ;
		return FALSE ;
	}

	instr->Execute() ;
		
	return TRUE ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rax
movzwl (%rax), %eax
cmpq $0x3ff, %rax            # imm = 0x3FF
ja 0x40cc2f
movq 0x38(%rbx), %rcx
movq 0x8(%rcx,%rax,8), %rdi
testq %rdi, %rdi
je 0x40cc2f
movq (%rdi), %rax
callq *0x10(%rax)
movb $0x1, %al
jmp 0x40cc99
movq $0x5f4580, %r14         # imm = 0x5F4580
leaq 0x175269(%rip), %rsi    # 0x581ea6
movl $0x2a, %edx
movq %r14, %rdi
callq 0x476110
movq 0x18(%rbx), %rax
movzwl (%rax), %esi
movq %r14, %rdi
callq 0x476a10
movq %rax, %rbx
leaq 0x1751df(%rip), %rsi    # 0x581e42
movl $0x5, %edx
movq %rax, %rdi
callq 0x476110
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x457260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x475c10
movq %rax, %rdi
callq 0x4751e0
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/wangyufei95[P]watchdog_linux/watchdog.cpp
// Function: PidTracker::collectAll()
std::vector<int> PidTracker::collectAll() 
{
	  std::vector<int> result;

	  char path[80];
	  snprintf(path, sizeof(path), "/sys/fs/cgroup/cpu/%d.supervisor/tasks",
			   getpid());

	  std::ifstream tasksFile(path);
	  std::string line;

	  while (std::getline(tasksFile, line)) 
	  {
		result.push_back(stoi(line));
	  }

	  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movq %rdi, %rbx
xorl %r12d, %r12d
movq %r12, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
callq 0x3550
leaq 0x2ced(%rip), %rdx      # 0x81c9
leaq -0xb0(%rbp), %r15
movl $0x50, %esi
movq %r15, %rdi
movl %eax, %ecx
xorl %eax, %eax
callq 0x35c0
leaq -0x2b8(%rbp), %r14
movq %r14, %rdi
movq %r15, %rsi
movl $0x8, %edx
callq 0x3670
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
movq %r12, -0x8(%rax)
movb $0x0, (%rax)
movq -0x2b8(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3380
movsbl %al, %edx
movq %r14, %rdi
leaq -0x58(%rbp), %rsi
callq 0x36a0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x55c1
movq -0x58(%rbp), %r12
callq 0x3040
movq %rax, %r13
movl (%rax), %r15d
movl $0x0, (%rax)
movq %r12, %rdi
leaq -0x38(%rbp), %rsi
movl $0xa, %edx
callq 0x34d0
cmpq %r12, -0x38(%rbp)
je 0x55f4
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x5600
movl (%r13), %ecx
cmpl $0x22, %ecx
je 0x5600
testl %ecx, %ecx
jne 0x5594
movl %r15d, (%r13)
movl %eax, -0x2c(%rbp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x55b0
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x551a
movq %rbx, %rdi
leaq -0x2c(%rbp), %rdx
callq 0x6fde
jmp 0x551a
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x55d3
callq 0x3370
leaq -0x2b8(%rbp), %rdi
callq 0x3090
movq %rbx, %rax
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2eda(%rip), %rdi      # 0x84d5
callq 0x31f0
leaq 0x2ece(%rip), %rdi      # 0x84d5
callq 0x3530
jmp 0x561e
movq %rax, %r14
cmpl $0x0, (%r13)
jne 0x5621
movl %r15d, (%r13)
jmp 0x5621
movq %rax, %r14
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x5633
callq 0x3370
leaq -0x2b8(%rbp), %rdi
callq 0x3090
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x564c
callq 0x3370
movq %r14, %rdi
callq 0x3630
// File: /workspace/github_cpp_makefile_star2_O3/wangyufei95[P]watchdog_linux/watchdog.cpp
// Function: Program::spawn()
bool Program::spawn() 
	{
	  logger_->info("starting program (%s)...", exe_.c_str());

	  pid_t pid = fork();

	  if (pid < 0) 
	  {
		logger_->error("fork failed. %s", strerror(errno));
		return false;
	  } 
	  else if (pid > 0) 
	  {  // parent
		pid_ = pid;
		pidTracker_.add(pid);
		logger_->info("child pid is %d", pid);
		return true;
	  } 
	  else 
	  {  // child
		std::vector<char*> argv;

		for (const std::string& arg : argv_) 
		{
		  argv.push_back(const_cast<char*>(arg.c_str()));
		}
		argv.push_back(nullptr);

		execvp(exe_.c_str(), argv.data());
		logger_->error("execvp failed. %s", strerror(errno));
		abort();
	  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq (%rdi), %rdi
movq 0x8(%rbx), %rdx
leaq 0x2708(%rip), %rsi      # 0x8220
callq 0x6764
callq 0x30a0
movl %eax, %r14d
testl %eax, %eax
js 0x5b4b
je 0x5b81
movl %r14d, 0x60(%rbx)
movl %r14d, %esi
callq 0x5422
movq (%rbx), %rdi
leaq 0x2708(%rip), %rsi      # 0x8249
movl %r14d, %edx
callq 0x6690
jmp 0x5b6c
movq (%rbx), %rbx
callq 0x3040
movl (%rax), %edi
callq 0x30e0
leaq 0x26d8(%rip), %rsi      # 0x8239
movq %rbx, %rdi
movq %rax, %rdx
callq 0x6838
testl %r14d, %r14d
setns %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
movq 0x28(%rbx), %r12
movq 0x30(%rbx), %r13
cmpq %r13, %r12
je 0x5bd5
leaq -0x40(%rbp), %r14
leaq -0x48(%rbp), %r15
movq (%r12), %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rsi
cmpq -0x30(%rbp), %rsi
je 0x5bc1
movq %rax, (%rsi)
addq $0x8, -0x38(%rbp)
jmp 0x5bcc
movq %r14, %rdi
movq %r15, %rdx
callq 0x72b6
addq $0x20, %r12
cmpq %r13, %r12
jne 0x5ba5
leaq -0x48(%rbp), %rsi
movq $0x0, (%rsi)
leaq -0x40(%rbp), %rdi
callq 0x68d2
movq 0x8(%rbx), %rdi
movq -0x40(%rbp), %rsi
callq 0x3280
movq (%rbx), %rbx
callq 0x3040
movl (%rax), %edi
callq 0x30e0
leaq 0x264d(%rip), %rsi      # 0x8259
movq %rbx, %rdi
movq %rax, %rdx
callq 0x6838
callq 0x31e0
jmp 0x5c20
jmp 0x5c20
movq %rax, %rbx
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x5c31
callq 0x3370
movq %rbx, %rdi
callq 0x3630
nop
// File: /workspace/github_cpp_makefile_star2_O3/wangyufei95[P]watchdog_linux/watchdog.cpp
// Function: Program::resume()
bool Program::resume() 
	{
		  pidTracker_.dump("resume");

		  if (pid_t pid = pidTracker_.findMainPID(mainPidfile_)) 
		  {
			logger_->info("new main pid: %d", pid);
			pid_ = pid;
			return true;
		  }

		  const auto pids = pidTracker_.collectAll();
		  if (!pids.empty()) 
		  {
			pid_ = pids[0];
			return true;
		  }

		  return false;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
addq $0x68, %rdi
leaq 0x40(%rbx), %rsi
callq 0x5654
testl %eax, %eax
je 0x5c76
movl %eax, %r14d
movq (%rbx), %rdi
leaq 0x25a9(%rip), %rsi      # 0x820f
movl %eax, %edx
callq 0x6690
movl %r14d, 0x60(%rbx)
movb $0x1, %r14b
jmp 0x5ca0
leaq -0x28(%rbp), %r14
movq %r14, %rdi
callq 0x54ac
movq (%r14), %rdi
cmpq 0x8(%r14), %rdi
setne %r14b
je 0x5c96
movl (%rdi), %eax
movl %eax, 0x60(%rbx)
jmp 0x5c9b
testq %rdi, %rdi
je 0x5ca0
callq 0x3370
movl %r14d, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/wangyufei95[P]watchdog_linux/watchdog.cpp
// Function: Supervisor::sighandler(int)
void Supervisor::sighandler(int signum) 
{
  if (self()->program_->pid()) 
  {
    self()->logger()->info(
        "Signal '%s' (%d) received. Forwarding to child PID %d.",
        strsignal(signum), signum, self()->program_->pid());

    // forward to child process
    self()->program_->signal(signum);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq 0x52a8(%rip), %r14      # 0xb3d8
movq 0x28(%r14), %rax
cmpl $0x0, 0x60(%rax)
je 0x617d
movl %edi, %ebx
callq 0x3640
movq 0x5290(%rip), %rcx      # 0xb3d8
movq 0x28(%rcx), %rcx
movl 0x60(%rcx), %r8d
leaq 0x2347(%rip), %rsi      # 0x849e
movq %r14, %rdi
movq %rax, %rdx
movl %ebx, %ecx
callq 0x6c5c
movq 0x526d(%rip), %rax      # 0xb3d8
movq 0x28(%rax), %rax
movl 0x60(%rax), %edi
movl %ebx, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x34f0
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/wangyufei95[P]watchdog_linux/watchdog.cpp
// Function: Supervisor::restart()
bool Supervisor::restart() 
{
  if (restartDelay_) 
  {
    logger()->info("restart is sleeping for %d seconds\n", restartDelay_);
    sleep(restartDelay_);

    // exponential backoff for the next restart
    restartDelay_ = std::min(restartDelay_ << 1, restartDelayLimit_);
  } 
  else 
  {
    restartDelay_ = 1;
	cout<<endl;
  }

  restartCount_++;
  if(restartCount_%3==0)
  {
	  run_mail();
  }
  return program_->restart();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x74(%rdi), %edx
testl %edx, %edx
je 0x64ac
leaq 0x1ff0(%rip), %rsi      # 0x847a
movq %rbx, %rdi
callq 0x6690
movl 0x74(%rbx), %edi
callq 0x3260
movl 0x74(%rbx), %eax
movl 0x78(%rbx), %ecx
addl %eax, %eax
cmpl %eax, %ecx
cmovll %ecx, %eax
movl %eax, 0x74(%rbx)
jmp 0x64e1
movl $0x1, 0x74(%rbx)
movq 0x4afe(%rip), %r14      # 0xafb8
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3380
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3220
movl 0x70(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x70(%rbx)
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
addl $0xd5555555, %eax       # imm = 0xD5555555
cmpl $0x55555554, %eax       # imm = 0x55555554
ja 0x6501
callq 0x52ad
movq 0x28(%rbx), %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x5af6
// File: /workspace/github_cpp_makefile_star2_O3/wangyufei95[P]watchdog_linux/watchdog.cpp
// Function: void Logger::info<int>(char const*, int)
void info(const char* fmt, Args... args) 
	{
		if (logLevel_ >= 2) 
		{
		  std::string fmt2("%s[%d]: ");
		  fmt2 += fmt;
		  fmt2 += "\n";
		  fprintf(stdout, fmt2.c_str(), basename_.c_str(), getpid(), args...);
		  fflush(stdout);
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpl $0x2, 0x20(%rdi)
jl 0x6737
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1e83(%rip), %rsi      # 0x8545
leaq 0x1e84(%rip), %rdx      # 0x854d
leaq -0x48(%rbp), %r12
movq %r12, %rdi
callq 0x6d44
movq %r12, %rdi
movq %r15, %rsi
callq 0x36c0
leaq 0x1a96(%rip), %rsi      # 0x817d
leaq -0x48(%rbp), %rdi
callq 0x36c0
movq 0x4899(%rip), %r13      # 0xaf90
movq (%r13), %r15
movq -0x48(%rbp), %r12
movq (%r14), %r14
callq 0x3550
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movl %eax, %ecx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x3520
movq (%r13), %rdi
callq 0x3430
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x6737
callq 0x3370
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x675b
callq 0x3370
movq %rbx, %rdi
callq 0x3630
nop
// File: /workspace/github_cpp_makefile_star2_O3/wangyufei95[P]watchdog_linux/watchdog.cpp
// Function: void Logger::error<char*>(char const*, char*)
void error(const char* fmt, Args... args) 
	{
    	if (logLevel_ >= 1) 
		{
		  std::string fmt2("%s[%d]: ");
		  fmt2 += fmt;
		  fmt2 += "\n";
		  fprintf(stderr, fmt2.c_str(), basename_.c_str(), getpid(), args...);
		  fflush(stderr);
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpl $0x0, 0x20(%rdi)
jg 0x685e
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r15
leaq -0x38(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1ccf(%rip), %rsi      # 0x8545
leaq 0x1cd0(%rip), %rdx      # 0x854d
leaq -0x48(%rbp), %r13
movq %r13, %rdi
callq 0x6d44
movq %r13, %rdi
movq %r12, %rsi
callq 0x36c0
leaq 0x18e2(%rip), %rsi      # 0x817d
leaq -0x48(%rbp), %rdi
callq 0x36c0
leaq -0x48(%rbp), %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x3710
jmp 0x684f
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x68c9
callq 0x3370
movq %rbx, %rdi
callq 0x3630
nop
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/blockmem.cpp
// Function: FreeBlock(void*)
bool            FreeBlock(void* pointer)
{
    if (!pointer)
    {
        Warning("Freeing a null pointer");
    }
    free(pointer);
    return true;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
jne 0x4968
leaq 0x176c2(%rip), %rdi     # 0x1c023
xorl %eax, %eax
callq 0xa4d6
movq %rbx, %rdi
callq 0x4390
movb $0x1, %al
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: CompressVis(unsigned char const*, unsigned int, unsigned char*, unsigned int)
int             CompressVis(const byte* const src, const unsigned int src_length, byte* dest, unsigned int dest_length)
{
    unsigned int    j;
    byte*           dest_p = dest;
    unsigned int    current_length = 0;

    for (j = 0; j < src_length; j++)
    {
        current_length++;
        hlassume(current_length <= dest_length, assume_COMPRESSVIS_OVERFLOW);

        *dest_p = src[j];
        dest_p++;

        if (src[j])
        {
            continue;
        }

        unsigned char   rep = 1;

        for (j++; j < src_length; j++)
        {
            if (src[j] || rep == 255)
            {
                break;
            }
            else
            {
                rep++;
            }
        }
        current_length++;
        hlassume(current_length <= dest_length, assume_COMPRESSVIS_OVERFLOW);

        *dest_p = rep;
        dest_p++;
        j--;
    }

    return dest_p - dest;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r12
movq %rdi, 0x20(%rsp)
movq %rdx, 0x10(%rsp)
testl %esi, %esi
je 0x4a90
movl %ecx, %ebp
movl %esi, %r14d
leal -0x1(%r14), %eax
movl %eax, 0xc(%rsp)
movl $0x2, %eax
subl %esi, %eax
movq %rax, 0x18(%rsp)
xorl %ebx, %ebx
movq 0x10(%rsp), %r12
xorl %r13d, %r13d
leal 0x1(%rbx), %r15d
xorl %edi, %edi
cmpl %ebp, %r15d
setbe %dil
movl $0x33, %esi
callq 0xa91d
movl %r13d, %eax
movq 0x20(%rsp), %rdx
movb (%rdx,%rax), %cl
movb %cl, (%r12)
testb %cl, %cl
je 0x4a11
incq %r12
jmp 0x4a81
leaq 0x1(%rax), %rcx
movb $0x1, %r15b
cmpl %r14d, %ecx
jae 0x4a60
cmpb $0x0, (%rdx,%rcx)
jne 0x4a60
movl %r14d, %r15d
subb %r13b, %r15b
leal 0x2(%r13), %ecx
addq %rdx, %rcx
addq 0x18(%rsp), %rax
xorl %esi, %esi
movl %eax, %edx
addl %esi, %edx
je 0x4a59
leaq 0x1(%rsi), %rdx
cmpb $0x0, (%rcx,%rsi)
jne 0x4a50
cmpb $-0x3, %sil
movq %rdx, %rsi
jne 0x4a37
leal 0x1(%rdx), %r15d
addl %edx, %r13d
jmp 0x4a60
movl 0xc(%rsp), %eax
movl %eax, %r13d
addl $0x2, %ebx
xorl %edi, %edi
cmpl %ebp, %ebx
setbe %dil
movl $0x33, %esi
callq 0xa91d
movb %r15b, 0x1(%r12)
addq $0x2, %r12
movl %ebx, %r15d
incl %r13d
movl %r15d, %ebx
cmpl %r14d, %r13d
jb 0x49e2
subl 0x10(%rsp), %r12d
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: DecompressVis(unsigned char const*, unsigned char*, unsigned int)
void            DecompressVis(const byte* src, byte* const dest, const unsigned int dest_length)
{
    unsigned int    current_length = 0;
    int             c;
    byte*           out;
    int             row;

#ifdef ZHLT_DecompressVis_FIX
	row = (g_dmodels[0].visleafs + 7) >> 3; // same as the length used by VIS program in CompressVis
	// The wrong size will cause DecompressVis to spend extremely long time once the source pointer runs into the invalid area in g_dvisdata (for example, in BuildFaceLights, some faces could hang for a few seconds), and sometimes to crash.
#else
    row = (g_numleafs + 7) >> 3;
#endif
    out = dest;

    do
    {
#ifdef ZHLT_DecompressVis_FIX
		hlassume (src - g_dvisdata < g_visdatasize, assume_DECOMPRESSVIS_OVERFLOW);
#endif
        if (*src)
        {
            current_length++;
            hlassume(current_length <= dest_length, assume_DECOMPRESSVIS_OVERFLOW);

            *out = *src;
            out++;
            src++;
            continue;
        }
		
#ifdef ZHLT_DecompressVis_FIX
		hlassume (&src[1] - g_dvisdata < g_visdatasize, assume_DECOMPRESSVIS_OVERFLOW);
#endif
        c = src[1];
        src += 2;
        while (c)
        {
            current_length++;
            hlassume(current_length <= dest_length, assume_DECOMPRESSVIS_OVERFLOW);

            *out = 0;
            out++;
            c--;

            if (out - dest >= row)
            {
                return;
            }
        }
    }
    while (out - dest < row);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
movl 0x249ff(%rip), %eax     # 0x294c4
addl $0x7, %eax
sarl $0x3, %eax
movslq %eax, %r12
movq %rsi, %rax
negq %rax
movq %rax, 0x18(%rsp)
xorl %ebp, %ebp
leaq 0x2c9be(%rip), %rax     # 0x314a0
negq %rax
movq %rax, 0x10(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x8(%rsp), %r15
movq %r15, %rax
leaq 0x2c9a2(%rip), %rcx     # 0x314a0
subq %rcx, %rax
movslq 0x2c98c(%rip), %rcx     # 0x31494
xorl %edi, %edi
cmpq %rcx, %rax
setl %dil
movl $0x34, %esi
callq 0xa91d
cmpb $0x0, (%r15)
je 0x4b55
incl %ebp
xorl %edi, %edi
cmpl %ebx, %ebp
setbe %dil
movl $0x34, %esi
callq 0xa91d
movb (%r15), %al
movb %al, (%r14)
incq %r14
incq %r15
movq %r15, 0x8(%rsp)
movq %r14, %rax
subq 0x20(%rsp), %rax
cmpq %r12, %rax
jl 0x4aef
jmp 0x4bba
movq 0x10(%rsp), %rax
addq %r15, %rax
incq %rax
movslq 0x2c92d(%rip), %rcx     # 0x31494
xorl %edi, %edi
cmpq %rcx, %rax
setl %dil
movl $0x34, %esi
callq 0xa91d
movzbl 0x1(%r15), %r13d
addq $0x2, %r15
movq %r15, 0x8(%rsp)
movq 0x18(%rsp), %rax
leaq (%rax,%r14), %r15
subl $0x1, %r13d
jb 0x4b46
incl %ebp
xorl %edi, %edi
cmpl %ebx, %ebp
setbe %dil
movl $0x34, %esi
callq 0xa91d
movb $0x0, (%r14)
incq %r14
incq %r15
cmpq %r12, %r15
jl 0x4b91
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: CalcFaceExtents_test()
bool CalcFaceExtents_test ()
{
	const int numtestcases = 6;
	volatile float testcases[numtestcases][8] = {
		{1, 1, 1, 1, 0.375 * DBL_EPSILON, 0.375 * DBL_EPSILON, -1, 0},
		{1, 1, 1, 0.375 * DBL_EPSILON, 0.375 * DBL_EPSILON, 1, -1, DBL_EPSILON},
		{DBL_EPSILON, DBL_EPSILON, 1, 0.375, 0.375, 1, -1, DBL_EPSILON},
		{1, 1, 1, 1, 1, 0.375 * FLT_EPSILON, -2, 0.375 * FLT_EPSILON},
		{1, 1, 1, 1, 0.375 * FLT_EPSILON, 1, -2, 0.375 * FLT_EPSILON},
		{1, 1, 1, 0.375 * FLT_EPSILON, 1, 1, -2, 0.375 * FLT_EPSILON}};
	bool ok;

	// If the test failed, please check:
	//   1. whether the calculation is performed on FPU
	//   2. whether the register precision is too low
		
	CorrectFPUPrecision ();

	ok = true;
	for (int i = 0; i < 6; i++)
	{
		float val = CalculatePointVecsProduct (&testcases[i][0], &testcases[i][3]);
		if (val != testcases[i][7])
		{
			Warning ("internal error: CalcFaceExtents_test failed on case %d (%.20f != %.20f).", i, val, testcases[i][7]);
			ok = false;
		}
	}
	return ok;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
leaq 0x16c2a(%rip), %rsi     # 0x1c820
movq %rsp, %rbx
movl $0xc0, %edx
movq %rbx, %rdi
callq 0x4260
movb $0x1, %bpl
xorl %r14d, %r14d
leaq 0x16547(%rip), %r15     # 0x1c15a
leaq 0xc(%rbx), %rsi
movq %rbx, %rdi
callq 0x5b56
ucomiss 0x1c(%rbx), %xmm0
jne 0x5c27
jnp 0x5c42
cvtss2sd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x1c(%rbx), %xmm1
movq %r15, %rdi
movl %r14d, %esi
movb $0x2, %al
callq 0xa4d6
xorl %ebp, %ebp
incq %r14
addq $0x20, %rbx
cmpq $0x6, %r14
jne 0x5c13
andb $0x1, %bpl
movl %ebp, %eax
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: WriteExtentFile(char const*)
void WriteExtentFile (const char *const filename)
{
	FILE *f;
	f = fopen (filename, "w");
	if (!f)
	{
		Error ("Error opening %s: %s", filename, strerror(errno));
	}
	fprintf (f, "%i\n", g_numfaces);
	for (int i = 0; i < g_numfaces; i++)
	{
		int mins[2];
		int maxs[2];
		GetFaceExtents (i, mins, maxs);
		fprintf (f, "%i %i %i %i\n", mins[0], mins[1], maxs[0], maxs[1]);
	}
	fclose (f);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
leaq 0x1b8d0(%rip), %rsi     # 0x21751
callq 0x4380
movq %rax, %rbx
testq %rax, %rax
jne 0x5eae
callq 0x4060
movl (%rax), %edi
callq 0x4130
leaq 0x16302(%rip), %rdi     # 0x1c1a3
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xa164
movl 0x1b8b560(%rip), %edx   # 0x1b91414
leaq 0x1920d(%rip), %rsi     # 0x1f0c8
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4460
cmpl $0x0, 0x1b8b548(%rip)   # 0x1b91414
jle 0x5f14
leaq 0x8(%rsp), %r14
movq %rsp, %r15
leaq 0x162db(%rip), %r12     # 0x1c1b8
xorl %ebp, %ebp
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x5c63
movl 0x8(%rsp), %edx
movl 0xc(%rsp), %ecx
movl (%rsp), %r8d
movl 0x4(%rsp), %r9d
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x4460
incl %ebp
cmpl 0x1b8b502(%rip), %ebp   # 0x1b91414
jl 0x5edf
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x42f0
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: NoWadTextures()
bool NoWadTextures ()
{
	// copied from loadtextures.cpp
	int numtextures = g_texdatasize? ((dmiptexlump_t *)g_dtexdata)->nummiptex: 0;
	for (int i = 0; i < numtextures; i++)
	{
		int offset = ((dmiptexlump_t *)g_dtexdata)->dataofs[i];
		int size = g_texdatasize - offset;
		if (offset < 0 || size < (int)sizeof (miptex_t))
		{
			// missing textures have ofs -1
			continue;
		}
		miptex_t *mt = (miptex_t *)&g_dtexdata[offset];
		if (!mt->offsets[0])
		{
			return false;
		}
	}
	return true;
}

// Assembly:
movl 0x82b0f0(%rip), %ecx    # 0x8314b4
movb $0x1, %al
testl %ecx, %ecx
je 0x642d
movq 0x82b0e7(%rip), %rdx    # 0x8314b8
movslq (%rdx), %rdx
testq %rdx, %rdx
jle 0x642d
movq 0x82b0d8(%rip), %rsi    # 0x8314b8
movq %rdx, %rdi
negq %rdi
movl $0x1, %r8d
xorl %eax, %eax
movl (%rsi,%r8,4), %r9d
movl %ecx, %r10d
subl %r9d, %r10d
testl %r9d, %r9d
sets %r11b
cmpl $0x28, %r10d
setl %r10b
orb %r11b, %r10b
jne 0x6417
movl %r9d, %r9d
cmpl $0x0, 0x18(%rsi,%r9)
je 0x642d
cmpq %rdx, %r8
setae %al
leaq (%rdi,%r8), %r9
incq %r9
incq %r8
cmpq $0x1, %r9
jne 0x63ee
andb $0x1, %al
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: GlobUsage(char const*, int, int)
static int      GlobUsage(const char* const szItem, const int itemstorage, const int maxstorage)
{
    float           percentage = maxstorage ? itemstorage * 100.0 / maxstorage : 0.0;

#ifdef ZHLT_MAX_MAP_LEAFS
    Log("%-13s    [variable]   %8i/%-8i (%4.1f%%)\n", szItem, itemstorage, maxstorage, percentage);
#else
    Log("%-12s     [variable]    %7i/%-7i  (%4.1f%%)\n", szItem, itemstorage, maxstorage, percentage);
#endif

    return itemstorage;
}

// Assembly:
pushq %rbx
movl %edx, %ecx
movl %esi, %ebx
movq %rdi, %rsi
testl %edx, %edx
je 0x6c42
cvtsi2sd %ebx, %xmm0
mulsd 0x15488(%rip), %xmm0    # 0x1c0b8
cvtsi2sd %ecx, %xmm1
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
jmp 0x6c45
xorps %xmm0, %xmm0
leaq 0x15ba8(%rip), %rdi     # 0x1c7f4
movl %ebx, %edx
movb $0x1, %al
callq 0x9e76
movl %ebx, %eax
popq %rbx
retq