LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/martinferianc[P]CPUSimulator-EIE2/src/mips_cpu.cpp
// Function: mips_cpu_step
mips_error mips_cpu_step(mips_cpu_h state){
	if(state==0)
		return mips_ErrorInvalidHandle;

	uint32_t* instruction_data = new uint32_t[8];
	string instruction;
	mips_error err;
	uint32_t mem_value;
	uint8_t dataOut[4];

	//FETCH
	if (state->pc % 4 == 0){
		err = mips_mem_read(state->mem, state->pc, 4, dataOut);
		mem_value = dataOut[0] | (uint32_t(dataOut[1]) << 8) | (uint32_t(dataOut[2]) << 16) | (uint32_t(dataOut[3]) << 24);
	} else {
		err = mips_ExceptionInvalidAlignment;
	}

	//DECODE
	if (err == mips_Success)
		err = mips_decode(mem_value, instruction_data);

	//EXECUTE
	if (err == mips_Success)
		err = mips_execute(state, state->mem, state->hi, state->lo, instruction_data, instruction, state->pcN, state->pc);

	//IF SUCCESS increase PC to new value and not JUMP or BRANCH
	if (err == mips_Success){
		state->pc = state->pcN;
		state->pcN = state->pcN + 4;
	}
	//IF JUMP/BRANCH - PC, PCN adjusted in execution
	if (err == mips_ExceptionBreak)
		err = mips_Success;

	//DEBUG
	switch(state->level){
		case 1:
			debug_level_1(state, instruction);
		break;

		case 2:
			debug_level_2(state, instruction);
		break;

		case 3:
			debug_level_3(state, instruction, state->dest);
		break;

		default:
		break;
	}

	delete [] instruction_data;
	return err;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, (%rsp)
testq %rdi, %rdi
je 0x499c
movq %rdi, %r14
pushq $0x20
popq %rdi
callq 0x3030
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl (%r14), %esi
movl $0x2003, %ebp           # imm = 0x2003
testb $0x3, %sil
jne 0x4977
movq 0xa0(%r14), %rdi
pushq $0x4
popq %rdx
leaq 0x8(%rsp), %rcx
callq 0x473f
movl 0x8(%rsp), %ecx
movl %ecx, 0xc(%rsp)
testl %eax, %eax
jne 0x496d
leaq 0xc(%rsp), %rdi
movq %rbx, %rsi
callq 0x4ca0
testl %eax, %eax
jne 0x496d
movq 0xa0(%r14), %rsi
leaq 0x4(%r14), %rdx
leaq 0x8(%r14), %rcx
leaq 0xc(%r14), %rax
leaq 0x10(%rsp), %r9
movq %r14, %rdi
movq %rbx, %r8
pushq %r14
pushq %rax
callq 0x4dcc
popq %rcx
popq %rdx
testl %eax, %eax
je 0x49e3
xorl %ebp, %ebp
cmpl $0x2000, %eax           # imm = 0x2000
cmovnel %eax, %ebp
movl 0x90(%r14), %eax
cmpl $0x3, %eax
je 0x49b2
cmpl $0x2, %eax
je 0x49a3
cmpl $0x1, %eax
jne 0x49c6
movq %rsp, %rdi
leaq 0x10(%rsp), %rsi
callq 0x4a0a
jmp 0x49c6
movl $0x1002, %ebp           # imm = 0x1002
jmp 0x49d8
movq %rsp, %rdi
leaq 0x10(%rsp), %rsi
callq 0x4a6f
jmp 0x49c6
movq 0x98(%r14), %rdx
movq %rsp, %rdi
leaq 0x10(%rsp), %rsi
callq 0x4bb8
movq %rbx, %rdi
callq 0x3270
leaq 0x10(%rsp), %rdi
callq 0x30d0
movl %ebp, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl 0xc(%r14), %eax
movl %eax, (%r14)
addl $0x4, %eax
movl %eax, 0xc(%r14)
xorl %ebp, %ebp
jmp 0x4977
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x30d0
movq %rbx, %rdi
callq 0x3330
// File: /workspace/github_cpp_makefile_star2_O2/martinferianc[P]CPUSimulator-EIE2/src/mips_cpu.cpp
// Function: debug_level_2(mips_cpu_impl* const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void debug_level_2(const mips_cpu_h& state, const string& instruction){
	cout<<endl<<"Executed instruction: "<<instruction<<endl;
	cout<<"Next PC:="<<state->pc<<endl;
	cout<<"HI: "<<state->hi<<" LO: "<<state->lo<<endl;
	for (int i = 0; i < 32; ++i){
		if (i % 4 == 0)
			cout<<endl;
		cout<<"R["<<i<<"]"<<":= "<<state->regs[i]<<"\t";
	}
	cout<<endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x9549(%rip), %r15      # 0xdfd0
movq %r15, %rdi
callq 0x30e0
leaq 0x502a(%rip), %rsi      # 0x9ac0
movq %rax, %rdi
callq 0x31c0
movq %rax, %rdi
movq %r14, %rsi
callq 0x31b0
movq %rax, %rdi
callq 0x30e0
leaq 0x501f(%rip), %rsi      # 0x9ad7
movq %r15, %rdi
callq 0x31c0
movq (%rbx), %rcx
movl (%rcx), %esi
movq %rax, %rdi
callq 0x3120
movq %rax, %rdi
callq 0x30e0
leaq 0x5005(%rip), %rsi      # 0x9ae1
movq %r15, %rdi
callq 0x31c0
movq (%rbx), %rcx
movl 0x4(%rcx), %esi
movq %rax, %rdi
callq 0x3120
leaq 0x4fed(%rip), %rsi      # 0x9ae6
movq %rax, %rdi
callq 0x31c0
movq (%rbx), %rcx
movl 0x8(%rcx), %esi
movq %rax, %rdi
callq 0x3120
movq %rax, %rdi
callq 0x30e0
xorl %r15d, %r15d
leaq 0x51af(%rip), %r12      # 0x9cd0
leaq 0x4fc4(%rip), %r13      # 0x9aec
leaq 0x4fbf(%rip), %rbp      # 0x9aee
leaq 0x5002(%rip), %r14      # 0x9b38
cmpq $0x20, %r15
je 0x4b9e
testb $0x3, %r15b
jne 0x4b4e
movq 0x9487(%rip), %rdi      # 0xdfd0
callq 0x30e0
movq 0x947b(%rip), %rdi      # 0xdfd0
movq %r12, %rsi
callq 0x31c0
movq %rax, %rdi
movl %r15d, %esi
callq 0x3310
movq %rax, %rdi
movq %r13, %rsi
callq 0x31c0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x31c0
movq (%rbx), %rcx
movl 0x10(%rcx,%r15,4), %esi
movq %rax, %rdi
callq 0x3120
movq %rax, %rdi
movq %r14, %rsi
callq 0x31c0
incq %r15
jmp 0x4b36
movq 0x942b(%rip), %rdi      # 0xdfd0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x30e0
// File: /workspace/github_cpp_makefile_star2_O2/martinferianc[P]CPUSimulator-EIE2/src/mips_cpu.cpp
// Function: debug_level_3(mips_cpu_impl* const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, _IO_FILE*)
void debug_level_3(const mips_cpu_h& state, const string& instruction, FILE* file){
	if (file == NULL) perror ("Error opening file");
	fprintf(state->dest,"Executed instruction: %s", instruction.c_str());
	fprintf(state->dest,"Next PC:= %i \n", state->pc);
	for (int i = 0; i < 32; ++i){
		if (i % 4 == 0)
			fprintf(state->dest,"\n");
		fprintf(state->dest,"R[%i]:= %i \t",i, state->regs[i]);
	}
	cout<<endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
testq %rdx, %rdx
je 0x4c64
movq (%rbx), %rax
movq 0x98(%rax), %rdi
movq (%r14), %rdx
leaq 0x4f23(%rip), %rsi      # 0x9b05
xorl %eax, %eax
callq 0x32b0
movq (%rbx), %rax
movq 0x98(%rax), %rdi
movl (%rax), %edx
leaq 0x4f22(%rip), %rsi      # 0x9b1e
xorl %eax, %eax
callq 0x32b0
pushq $0xa
popq %rbp
leaq 0x4f20(%rip), %r14      # 0x9b2d
xorl %r15d, %r15d
cmpq $0x20, %r15
je 0x4c4e
testb $0x3, %r15b
jne 0x4c2d
movq (%rbx), %rax
movq 0x98(%rax), %rsi
movl %ebp, %edi
callq 0x3250
movq (%rbx), %rax
movq 0x98(%rax), %rdi
movl 0x10(%rax,%r15,4), %ecx
movq %r14, %rsi
movl %r15d, %edx
xorl %eax, %eax
callq 0x32b0
incq %r15
jmp 0x4c10
movq 0x937b(%rip), %rdi      # 0xdfd0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x30e0
leaq 0x4e87(%rip), %rdi      # 0x9af2
callq 0x3190
jmp 0x4bce
// File: /workspace/github_cpp_makefile_star2_O2/martinferianc[P]CPUSimulator-EIE2/src/mips_cpu_decode.cpp
// Function: mips_decode(unsigned int const&, unsigned int*)
mips_error mips_decode(const uint32_t& instruction, uint32_t* instruction_data){
	uint32_t opcode = (instruction >> 2 ) & 0x3F;
	if (opcode==0)
		return mips_decode_R(instruction, instruction_data);
	if ((opcode==2) || (opcode==3) || (opcode==26))
		return mips_decode_J(instruction, instruction_data);
	return mips_decode_I(instruction, instruction_data);
}

// Assembly:
pushq %rax
movl (%rdi), %ecx
movl %ecx, %eax
shrl $0x2, %eax
andl $0x3f, %eax
je 0x4cca
andl $0xf8, %ecx
cmpl $0x8, %ecx
setne %cl
cmpl $0x1a, %eax
setne %al
testb %al, %cl
jne 0x4cd1
callq 0x4d34
jmp 0x4cd6
callq 0x4cda
jmp 0x4cd6
callq 0x4d81
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O2/martinferianc[P]CPUSimulator-EIE2/src/mips_cpu_decode.cpp
// Function: mips_decode_I(unsigned int const&, unsigned int*)
mips_error mips_decode_I(const uint32_t& instruction, uint32_t* instruction_data){
	instruction_data[0] = (uint32_t)(instruction >> 2) & 0x3F; 																		  //OPcode
	instruction_data[1] = (uint32_t)(((instruction << 3) & 0x18) | ((instruction >> 13) & 0x7)) ;   //Source 1
	instruction_data[2] = (uint32_t)(instruction >> 8) & 0x1F; 																			//Destination
	instruction_data[3] = (uint32_t)(((instruction >> 24) & 0xFF) | ((instruction >> 8) & 0xFF00)); //Immediate Constant
	instruction_data[4] = 0; 																																				//Leave Blank
	instruction_data[5] = 0; 																																				//Leave Blank
	instruction_data[6] = 4; 																																				//Relevant data size: 4
	instruction_data[7] = 1; 																																				//I-type
	return mips_Success;
}

// Assembly:
movl (%rdi), %eax
shrl $0x2, %eax
andl $0x3f, %eax
movl %eax, (%rsi)
movl (%rdi), %eax
movl %eax, %ecx
andl $0x3, %ecx
shrl $0xd, %eax
andl $0x7, %eax
leal (%rax,%rcx,8), %eax
movl %eax, 0x4(%rsi)
movl (%rdi), %eax
shrl $0x8, %eax
andl $0x1f, %eax
movl %eax, 0x8(%rsi)
movl (%rdi), %eax
movl %eax, %ecx
shrl $0x18, %ecx
shrl $0x8, %eax
andl $0xff00, %eax           # imm = 0xFF00
orl %ecx, %eax
movl %eax, 0xc(%rsi)
movaps 0x4d7c(%rip), %xmm0     # 0x9b40
movups %xmm0, 0x10(%rsi)
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/martinferianc[P]CPUSimulator-EIE2/src/mips_cpu_execute.cpp
// Function: mips_execute(mips_cpu_impl*, mips_mem_provider*, unsigned int&, unsigned int&, unsigned int const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, unsigned int&, unsigned int&)
mips_error mips_execute(mips_cpu_h state, mips_mem_h mem, uint32_t& hi, uint32_t& lo, const uint32_t* instruction_data, string& instruction, uint32_t& pcN, uint32_t& pc){
	uint32_t type = instruction_data[7];
	switch (type) {
		case 0: return mips_execute_R(state, hi, lo, instruction_data, instruction, pcN, pc);
		case 1: return mips_execute_I(state, mem, instruction_data, instruction, pcN, pc);
		case 2: return mips_execute_J(state, instruction_data, instruction, pcN, pc);
	}
	return mips_InternalError;
}

// Assembly:
pushq %rax
movq 0x18(%rsp), %r10
movq 0x10(%rsp), %rax
movl 0x1c(%r8), %r11d
cmpl $0x2, %r11d
je 0x4e18
cmpl $0x1, %r11d
je 0x4e06
testl %r11d, %r11d
jne 0x4e2a
movq %r10, (%rsp)
movq %rdx, %rsi
movq %rcx, %rdx
movq %r8, %rcx
movq %r9, %r8
movq %rax, %r9
callq 0x4e31
jmp 0x4e2f
movq %r8, %rdx
movq %r9, %rcx
movq %rax, %r8
movq %r10, %r9
popq %rax
jmp 0x55c4
movq %r8, %rsi
movq %r9, %rdx
movq %rax, %rcx
movq %r10, %r8
popq %rax
jmp 0x5c9b
movl $0x3000, %eax           # imm = 0x3000
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O2/martinferianc[P]CPUSimulator-EIE2/src/mips_cpu_execute.cpp
// Function: mips_execute_J(mips_cpu_impl*, unsigned int const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, unsigned int&, unsigned int&)
mips_error mips_execute_J(mips_cpu_h state, const uint32_t* instruction_data, string& instruction, uint32_t& pcN, uint32_t& pc){

	switch(instruction_data[0]){
		case 0b000010:
			return mips_execute_J_X(state, instruction_data, "JUMP", instruction, pcN, pc);
		case 0b000011:
			return mips_execute_J_X(state, instruction_data, "JAL", instruction, pcN, pc);
		default:
		break;
	}

	instruction = "Invalid instruction format";
	return mips_ExceptionInvalidInstruction;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r13
movl (%rsi), %eax
cmpl $0x3, %eax
je 0x5cf4
cmpl $0x2, %eax
jne 0x5d31
leaq 0x3ffd(%rip), %rsi      # 0x9cc7
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x3bee
leaq 0x10(%rsp), %rdx
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rcx
movq %r15, %r8
movq %rbx, %r9
callq 0x72d2
jmp 0x5d23
leaq 0x3a2e(%rip), %rsi      # 0x9729
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x3bee
leaq 0x10(%rsp), %rdx
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rcx
movq %r15, %r8
movq %rbx, %r9
callq 0x72d2
movl %eax, %ebx
leaq 0x10(%rsp), %rdi
callq 0x30d0
jmp 0x5d45
leaq 0x3f74(%rip), %rsi      # 0x9cac
movq %r14, %rdi
callq 0x3360
movl $0x2005, %ebx           # imm = 0x2005
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x5d57
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x30d0
jmp 0x5d6b
jmp 0x5d68
movq %rax, %rbx
movq %rbx, %rdi
callq 0x3330
// File: /workspace/github_cpp_makefile_star2_O2/martinferianc[P]CPUSimulator-EIE2/src/mips_cpu_execute.cpp
// Function: mips_execute_J_X(mips_cpu_impl*, unsigned int const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, unsigned int&, unsigned int&)
mips_error mips_execute_J_X(mips_cpu_h state, const uint32_t* instruction_data, const string& op, string& instruction, uint32_t& pcN, uint32_t& pc){

	stringstream ss;
	mips_error err = mips_ExceptionInvalidInstruction;
	uint32_t imm_unsigned = uint32_t(instruction_data[1]);

	if (op.compare("JUMP")==0){
		pc = pcN;
		pcN = (pc & 0xF0000000) | (imm_unsigned << 2);
		err = mips_ExceptionBreak;
	}

	if (op.compare("JAL")==0){
		mips_cpu_set_register(state, 31, pc + 8);
		pc = pcN;
		pcN = (pc & 0xF0000000) | (imm_unsigned << 2);
		err = mips_ExceptionBreak;
	}

	ss <<op<<" "<<"#"<<instruction_data[1];

	instruction = ss.str();
	return err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
movq %r9, %r13
movq %r8, %r12
movq %rcx, 0x8(%rsp)
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, (%rsp)
leaq 0x30(%rsp), %rdi
callq 0x3140
movl 0x4(%r14), %ebx
leaq 0x29ba(%rip), %rsi      # 0x9cc7
movq %r15, %rdi
callq 0x3090
movl $0x2005, %ebp           # imm = 0x2005
testl %eax, %eax
jne 0x733d
movl (%r12), %eax
movl %eax, (%r13)
andl $0xf0000000, %eax       # imm = 0xF0000000
leal (,%rbx,4), %ecx
orl %eax, %ecx
movl %ecx, (%r12)
movl $0x2000, %ebp           # imm = 0x2000
leaq 0x23e5(%rip), %rsi      # 0x9729
movq %r15, %rdi
callq 0x3090
testl %eax, %eax
jne 0x737e
movl (%r13), %edx
addl $0x8, %edx
pushq $0x1f
popq %rsi
movq (%rsp), %rdi
callq 0x4884
movl (%r12), %eax
movl %eax, (%r13)
andl $0xf0000000, %eax       # imm = 0xF0000000
shll $0x2, %ebx
orl %eax, %ebx
movl %ebx, (%r12)
movl $0x2000, %ebp           # imm = 0x2000
leaq 0x40(%rsp), %rdi
movq %r15, %rsi
callq 0x31b0
leaq 0x2962(%rip), %rsi      # 0x9cf4
movq %rax, %rdi
callq 0x31c0
leaq 0x2935(%rip), %rsi      # 0x9cd6
movq %rax, %rdi
callq 0x31c0
movl 0x4(%r14), %esi
movq %rax, %rdi
callq 0x3120
leaq 0x48(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x32f0
leaq 0x10(%rsp), %rbx
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x3240
movq %rbx, %rdi
callq 0x30d0
leaq 0x30(%rsp), %rdi
callq 0x3160
movl %ebp, %eax
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x73fe
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x3160
movq %rbx, %rdi
callq 0x3330
nop
// File: /workspace/github_cpp_makefile_star2_O2/martinferianc[P]CPUSimulator-EIE2/src/mips_cpu_execute_help.cpp
// Function: highestOneBitPosition(unsigned int)
size_t highestOneBitPosition(uint32_t a) {
    size_t bits=0;
    while (a!=0) {
        ++bits;
        a>>=1;
    };
    return bits;
}

// Assembly:
xorl %eax, %eax
testl %edi, %edi
je 0x7421
incq %rax
shrl %edi
jmp 0x7416
retq
// File: /workspace/github_cpp_makefile_star2_O2/martinferianc[P]CPUSimulator-EIE2/src/mips_cpu_execute_help.cpp
// Function: subtraction_overflow(unsigned int, unsigned int)
bool subtraction_overflow(uint32_t a, uint32_t b){
  if (highestOneBitPosition(a)!=highestOneBitPosition(b)) {
    int32_t temp = int32_t(a) - int32_t(b);
    if (highestOneBitPosition(temp)!=highestOneBitPosition(a))
      return true;
    else
      return false;
  } else
      return false;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movl %edi, %ebx
callq 0x7414
movq %rax, %r14
movl %ebp, %edi
callq 0x7414
cmpq %rax, %r14
jne 0x7442
xorl %eax, %eax
jmp 0x7451
subl %ebp, %ebx
movl %ebx, %edi
callq 0x7414
cmpq %r14, %rax
setne %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/martinferianc[P]CPUSimulator-EIE2/src/test_mips.cpp
// Function: load_memory(mips_mem_provider*&, std::vector<test, std::allocator<test>>)
mips_error load_memory(mips_mem_h& mem, const vector<test> instructions){
  mips_error err = mips_Success;
  for (int i = 0; i < (int)instructions.size(); ++i){
    err = mips_mem_write(mem, 0+(4*i),4, (uint8_t*)&instructions[i].instruction_code);
    if (err!=mips_Success)
    return err;
  }
  return err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
pushq $-0x1
popq %r12
pushq $0x38
popq %r13
xorl %ebx, %ebx
xorl %esi, %esi
movq (%r14), %rcx
movq 0x8(%r14), %rax
subq %rcx, %rax
cqto
idivq %r13
cltq
incq %r12
cmpq %rax, %r12
jge 0x777d
leal 0x4(%rsi), %ebp
movq (%r15), %rdi
addq %rbx, %rcx
addq $0x38, %rbx
pushq $0x4
popq %rdx
callq 0x47d2
movl %ebp, %esi
testl %eax, %eax
je 0x7747
jmp 0x777f
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/martinferianc[P]CPUSimulator-EIE2/src/test_mips.cpp
// Function: print_registers(unsigned int const*)
void print_registers(const uint32_t *array){
  for (size_t i = 0; i < 32; i++) {
    if (i % 4 == 0)
    cout<<endl;
    cout<<"R["<<i<<"]"<<":= "<<array[i]<<"\t";
  }
  cout<<endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x682a(%rip), %r15      # 0xdfd0
leaq 0x233f(%rip), %r13      # 0x9aec
leaq 0x233a(%rip), %rbp      # 0x9aee
leaq 0x237d(%rip), %r12      # 0x9b38
cmpq $0x20, %r14
je 0x781b
testb $0x3, %r14b
jne 0x77cf
movq %r15, %rdi
callq 0x30e0
movq %r15, %rdi
leaq 0x24f7(%rip), %rsi      # 0x9cd0
callq 0x31c0
movq %rax, %rdi
movq %r14, %rsi
callq 0x3120
movq %rax, %rdi
movq %r13, %rsi
callq 0x31c0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x31c0
movl (%rbx,%r14,4), %esi
movq %rax, %rdi
callq 0x3120
movq %rax, %rdi
movq %r12, %rsi
callq 0x31c0
incq %r14
jmp 0x77bb
movq 0x67ae(%rip), %rdi      # 0xdfd0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x30e0
// File: /workspace/github_cpp_makefile_star2_O2/martinferianc[P]CPUSimulator-EIE2/src/test_mips.cpp
// Function: load_registers(unsigned int*, mips_cpu_impl*)
void load_registers(uint32_t* array, mips_cpu_h cpu){
  for (size_t i = 0; i < 32; i++) {
    uint32_t* reg = new uint32_t;
    mips_cpu_get_register(cpu, i, reg);
    array[i] = uint32_t(*reg);
    delete reg;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
pushq $0x4
popq %r12
cmpq $0x20, %r15
je 0x7882
movq %r12, %rdi
callq 0x31d0
movq %rax, %r13
movq %rbx, %rdi
movl %r15d, %esi
movq %rax, %rdx
callq 0x4864
movl (%r13), %eax
movl %eax, (%r14,%r15,4)
movq %r13, %rdi
movq %r12, %rsi
callq 0x31e0
incq %r15
jmp 0x784b
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/martinferianc[P]CPUSimulator-EIE2/src/test_mips.cpp
// Function: test::str[abi:cxx11]()
string str(){
    stringstream ss;
    ss<<std::hex<<instruction_code<<" "
    <<instruction_name<<" "
    <<" R2: "<<instruction_r1
    <<" R3: "<<instruction_r2
    <<" Ex. Result: "<<instruction_result;
    return ss.str();
  }

// Assembly:
pushq %r14
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %rdi
callq 0x3140
leaq 0x10(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
movl 0x28(%rsp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x28(%rsp,%rax)
movl (%r14), %esi
callq 0x3120
leaq 0x1a91(%rip), %rsi      # 0x9cf4
movq %rax, %rdi
callq 0x31c0
leaq 0x8(%r14), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x1a76(%rip), %rsi      # 0x9cf4
movq %rax, %rdi
callq 0x31c0
leaq 0x1d14(%rip), %rsi      # 0x9fa1
movq %rax, %rdi
callq 0x31c0
movl 0x2c(%r14), %esi
movq %rax, %rdi
callq 0x3120
leaq 0x1cff(%rip), %rsi      # 0x9fa7
movq %rax, %rdi
callq 0x31c0
movl 0x30(%r14), %esi
movq %rax, %rdi
callq 0x3120
leaq 0x1cea(%rip), %rsi      # 0x9fad
movq %rax, %rdi
callq 0x31c0
movl 0x28(%r14), %esi
movq %rax, %rdi
callq 0x3120
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x32f0
movq %rsp, %rdi
callq 0x3160
movq %rbx, %rax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3160
movq %rbx, %rdi
callq 0x3330
nop
// File: /workspace/github_cpp_makefile_star2_O2/coduin[P]epiphany-bin-info/epiphany-bin-info.cpp
// Function: operator<<(std::ostream&, addr const&)
ostream& operator<<(ostream& stream, const addr& addr) {
    if (isExtmem(addr.val)) {
        outputSetWhite();
        stream << ashex(addr.val);
        outputReset();
    } else {
        stream << ashex(addr.val);
    }
    return stream;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rsi), %eax
cmpl $0x100000, %eax         # imm = 0x100000
jb 0x252c
movq %rsi, %r14
callq 0x2446
movl (%r14), %eax
leaq 0x4(%rsp), %rsi
movl %eax, (%rsi)
movq %rbx, %rdi
callq 0x249d
callq 0x2480
jmp 0x2539
movq %rsp, %rsi
movl %eax, (%rsi)
movq %rbx, %rdi
callq 0x249d
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/coduin[P]epiphany-bin-info/epiphany-bin-info.cpp
// Function: demangle(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string demangle(const string& name) {
    string ret;
    int status;
    char* realname = 0;

    realname = abi::__cxa_demangle(name.c_str(), 0, 0, &status);

    if (status == 0)
        ret = realname;
    else
        ret = name;

    if (realname)
        free(realname);
    return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movq %rsi, %r15
movb $0x0, 0x10(%rdi)
movq (%rsi), %rdi
leaq 0xc(%rsp), %rcx
xorl %esi, %esi
xorl %edx, %edx
callq 0x2140
movq %rax, %r14
cmpl $0x0, 0xc(%rsp)
je 0x258b
movq %rbx, %rdi
movq %r15, %rsi
callq 0x20f0
jmp 0x2596
movq %rbx, %rdi
movq %r14, %rsi
callq 0x22d0
movq %r14, %rdi
callq 0x21c0
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x20c0
movq %r14, %rdi
callq 0x22a0
// File: /workspace/github_cpp_makefile_star2_O2/coduin[P]epiphany-bin-info/epiphany-bin-info.cpp
// Function: isEpiphanyElf(Elf32_Ehdr*)
bool isEpiphanyElf(Elf32_Ehdr* ehdr) {
    return ehdr && memcmp(ehdr->e_ident, ELFMAG, SELFMAG) == 0 &&
           ehdr->e_ident[EI_CLASS] == ELFCLASS32 && ehdr->e_type == ET_EXEC &&
           ehdr->e_version == EV_CURRENT &&
           ehdr->e_machine == EM_ADAPTEVA_EPIPHANY;
}

// Assembly:
testq %rdi, %rdi
je 0x25e8
cmpl $0x464c457f, (%rdi)     # imm = 0x464C457F
jne 0x25e8
cmpb $0x1, 0x4(%rdi)
jne 0x25e8
cmpw $0x2, 0x10(%rdi)
jne 0x25e8
cmpl $0x1, 0x14(%rdi)
jne 0x25e8
cmpw $0x1223, 0x12(%rdi)     # imm = 0x1223
sete %al
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/coduin[P]epiphany-bin-info/epiphany-bin-info.cpp
// Function: parseSections(Elf32_Shdr*, unsigned long, char const*, unsigned long)
void parseSections(Elf32_Shdr* shdr, size_t count, const char* strtab,
                   size_t strsize) {
    if (showSections) {
        cout << "\nSection table (linker info):\n";
        cout << "ADDR        SIZE        NAME\n";
        for (size_t i = 0; i < count; i++) {
            if (shdr[i].sh_flags & SHF_ALLOC) {
                cout << addr(shdr[i].sh_addr);
            } else {
                cout << "          ";
            }
            cout << "  " << ashex(shdr[i].sh_size);
            if (shdr[i].sh_name != SHN_UNDEF && shdr[i].sh_name < strsize)
                cout << "  " << (&strtab[shdr[i].sh_name]);
            cout << endl;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x10(%rsp)
cmpb $0x1, 0x4987(%rip)      # 0x719b
jne 0x28ed
movq %rcx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movq 0x47a6(%rip), %r13      # 0x6fd0
leaq 0x1882(%rip), %rsi      # 0x40b3
movq %r13, %rdi
callq 0x2170
leaq 0x1892(%rip), %rsi      # 0x40d2
movq %r13, %rdi
callq 0x2170
leaq 0x18a9(%rip), %rbp      # 0x40f8
leaq 0x8(%rsp), %r14
subq $0x1, %r15
jb 0x28ed
testb $0x2, 0x8(%r12)
jne 0x2877
movq %r13, %rdi
leaq 0x1880(%rip), %rsi      # 0x40f0
callq 0x2170
jmp 0x288d
movl 0xc(%r12), %eax
movl %eax, 0xc(%rsp)
movq %r13, %rdi
leaq 0xc(%rsp), %rsi
callq 0x24fb
movq %r13, %rdi
movq %rbp, %rsi
callq 0x2170
movl 0x14(%r12), %ecx
movl %ecx, 0x8(%rsp)
movq %rax, %rdi
movq %r14, %rsi
callq 0x249d
movl (%r12), %eax
testq %rax, %rax
sete %cl
cmpq %rbx, %rax
setae %al
orb %cl, %al
jne 0x28dc
movq %r13, %rdi
movq %rbp, %rsi
callq 0x2170
movl (%r12), %esi
addq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x2170
movq %r13, %rdi
callq 0x20d0
addq $0x28, %r12
jmp 0x2854
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/coduin[P]epiphany-bin-info/epiphany-bin-info.cpp
// Function: getCmdOption(char**, char**, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
char* getCmdOption(char** begin, char** end, const std::string& option) {
    char** itr = std::find(begin, end, option);
    if (itr != end && ++itr != end) {
        return *itr;
    }
    return 0;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
callq 0x3d10
cmpq %rbx, %rax
je 0x2db9
addq $0x8, %rax
cmpq %rbx, %rax
je 0x2db9
movq (%rax), %rax
jmp 0x2dbb
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/coduin[P]epiphany-bin-info/epiphany-bin-info.cpp
// Function: showHelp(char*)
void showHelp(char* cmd) {
    cout << "Usage: " << cmd
         << " [-h] [-p] [-sec] [-s] [-a] [--nodemangle] file\n";
    cout << "Options:\n";
    cout << "    -h             Show this help.\n";
    cout << "    -p             Show program headers (runtime information).\n";
    cout << "    -sec           Show section headers (linking information).\n";
    cout << "                   Sections stored in external memory are "
            "highlighted.\n";
    cout << "    -s             Show symbols (function names).\n";
    cout << "                   Symbols are sorted by address.\n";
    cout << "    -a             Show all.\n";
    cout << "    --nodemangle   Do not demangle C++ symbol names.\n";
    cout << "  By default, only the total program size in local and external "
            "memory is shown."
         << endl;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x41f4(%rip), %rbx      # 0x6fd0
leaq 0x1412(%rip), %rsi      # 0x41f5
movq %rbx, %rdi
callq 0x2170
movq %rax, %rdi
movq %r14, %rsi
callq 0x2170
leaq 0x1400(%rip), %rsi      # 0x41fd
movq %rax, %rdi
callq 0x2170
leaq 0x1422(%rip), %rsi      # 0x422e
movq %rbx, %rdi
callq 0x2170
leaq 0x141d(%rip), %rsi      # 0x4238
movq %rbx, %rdi
callq 0x2170
leaq 0x1432(%rip), %rsi      # 0x425c
movq %rbx, %rdi
callq 0x2170
leaq 0x1463(%rip), %rsi      # 0x429c
movq %rbx, %rdi
callq 0x2170
leaq 0x1494(%rip), %rsi      # 0x42dc
movq %rbx, %rdi
callq 0x2170
leaq 0x14cd(%rip), %rsi      # 0x4324
movq %rbx, %rdi
callq 0x2170
leaq 0x14f1(%rip), %rsi      # 0x4357
movq %rbx, %rdi
callq 0x2170
leaq 0x1515(%rip), %rsi      # 0x438a
movq %rbx, %rdi
callq 0x2170
leaq 0x1524(%rip), %rsi      # 0x43a8
movq %rbx, %rdi
callq 0x2170
leaq 0x154b(%rip), %rsi      # 0x43de
movq %rbx, %rdi
callq 0x2170
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x20d0
// File: /workspace/github_cpp_makefile_star2_O2/coduin[P]epiphany-bin-info/epiphany-bin-info.cpp
// Function: Symbol::operator<(Symbol const&) const
bool operator<(const Symbol& rhs) const {
        // if this is an absolute value
        // instead of an address, show it AFTER
        // the addresses.
        if ((section != SHN_ABS) && (rhs.section == SHN_ABS)) {
            return true;
        } else if ((section == SHN_ABS) && (rhs.section != SHN_ABS)) {
            return false;
        }
        return value < rhs.value;
    }

// Assembly:
movl 0x14(%rdi), %ecx
movl $0xfff1, %edx           # imm = 0xFFF1
cmpl %edx, %ecx
setne %r9b
movl 0x14(%rsi), %r8d
cmpl %edx, %r8d
sete %r10b
movb $0x1, %al
testb %r10b, %r9b
jne 0x3a8b
cmpl %edx, %r8d
sete %al
cmpl %edx, %ecx
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x3a8c
movl 0x4(%rdi), %eax
cmpl 0x4(%rsi), %eax
setb %al
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/permui[P]CastleAdventure/src/games.cpp
// Function: games::add_game(Player&, Grid&, std::map<Position, Grid, std::less<Position>, std::allocator<std::pair<Position const, Grid>>>&)
void add_game(Player &player, Grid&, Map&) {
		random_device r;
		default_random_engine eng(r());
		uniform_int_distribution<int> dis(add_range.first, add_range.second);
		int x = dis(eng), y = dis(eng), z = x + y;
		cout << "Answer the following question in " << add_time << " seconds" << endl;
		cout << x << " + " << y << " = ";
		pair<int, double> get = GetAin<int>();
		if (get.second > add_time) {
			cout << "Out of time! You took " << fixed << setprecision(2) << get.second << " seconds!" << endl;
			return;
		}
		if (get.first != z) {
			cout << "Wrong Answer!" << endl;
			return;
		}
		cout << "Right answer! " << add_award << " BTC to your pocket." << endl;
		player.btc += add_award;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x13a8, %rsp           # imm = 0x13A8
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x3424
movq %r14, %rdi
callq 0x2230
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %edx, %edx
divl %ecx
cmpl $0x1, %edx
adcl $0x0, %edx
leaq 0x10(%rsp), %rsi
movq %rdx, (%rsi)
movabsq $0x6300000000, %rax     # imm = 0x6300000000
leaq 0x18(%rsp), %rdi
movq %rax, (%rdi)
callq 0x347a
movl %eax, %ebp
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x347a
movl %eax, %r14d
movq 0xa172(%rip), %rdi      # 0xcfd0
leaq 0x527b(%rip), %rsi      # 0x80e0
callq 0x21c0
pushq $0x7
popq %rsi
movq %rax, %rdi
callq 0x22b0
leaq 0x5286(%rip), %rsi      # 0x8102
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
movq 0xa13d(%rip), %r15      # 0xcfd0
movq %r15, %rdi
movl %ebp, %esi
callq 0x22b0
leaq 0x5267(%rip), %rsi      # 0x810b
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
movl %r14d, %esi
callq 0x22b0
leaq 0x5251(%rip), %rsi      # 0x810f
movq %rax, %rdi
callq 0x21c0
callq 0x3482
movsd %xmm0, 0x8(%rsp)
ucomisd 0x51c7(%rip), %xmm0     # 0x80a0
jbe 0x2f2c
movq 0xa0ee(%rip), %rdi      # 0xcfd0
leaq 0x522a(%rip), %rsi      # 0x8113
callq 0x21c0
movsd 0x8(%rsp), %xmm0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movl $0xfffffefb, %esi       # imm = 0xFFFFFEFB
andl 0x18(%rax,%rdx), %esi
orl $0x4, %esi
movl %esi, 0x18(%rax,%rdx)
movq -0x18(%rcx), %rcx
movq $0x2, 0x8(%rax,%rcx)
movq %rax, %rdi
callq 0x2270
movq %rax, %r15
leaq 0x5200(%rip), %rsi      # 0x812a
jmp 0x2f76
addl %ebp, %r14d
cmpl %r14d, %eax
jne 0x2f6f
movq 0xa095(%rip), %rdi      # 0xcfd0
leaq 0x5200(%rip), %rsi      # 0x8142
callq 0x21c0
pushq $0x2
popq %rsi
movq %rax, %rdi
callq 0x22b0
leaq 0x51f8(%rip), %rsi      # 0x8151
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
addl $0x2, 0x10(%rbx)
jmp 0x2f86
leaq 0x51be(%rip), %rsi      # 0x8134
movq %r15, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
leaq 0x20(%rsp), %rdi
callq 0x34b2
addq $0x13a8, %rsp           # imm = 0x13A8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2fa6
jmp 0x2fa6
jmp 0x2fa6
jmp 0x2fa6
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x34b2
movq %rbx, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O2/permui[P]CastleAdventure/src/games.cpp
// Function: games::mul_game(Player&, Grid&, std::map<Position, Grid, std::less<Position>, std::allocator<std::pair<Position const, Grid>>>&)
void mul_game(Player &player, Grid&, Map&) {
		random_device r;
		default_random_engine eng(r());
		uniform_int_distribution<int> dis(mul_range.first, mul_range.second);
		int x = dis(eng), y = dis(eng), z = x * y;
		cout << "Answer the following question in " << mul_time << " seconds" << endl;
		cout << x << " * " << y << " = ";
		pair<int, double> get = GetAin<int>();
		if (get.second > mul_time) {
			cout << "Out of time! You took " << fixed << setprecision(2) << get.second << " seconds!" << endl;
			return;
		}
		if (get.first != z) {
			cout << "Wrong Answer!" << endl;
			return;
		}
		cout << "Right answer! " << mul_award << " BTC to your pocket." << endl;
		player.btc += mul_award;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x13a8, %rsp           # imm = 0x13A8
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x3424
movq %r14, %rdi
callq 0x2230
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %edx, %edx
divl %ecx
cmpl $0x1, %edx
adcl $0x0, %edx
leaq 0x10(%rsp), %rsi
movq %rdx, (%rsi)
movabsq $0x1300000001, %rax     # imm = 0x1300000001
leaq 0x18(%rsp), %rdi
movq %rax, (%rdi)
callq 0x347a
movl %eax, %ebp
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x347a
movl %eax, %r14d
movq 0x9fa7(%rip), %rdi      # 0xcfd0
leaq 0x50b0(%rip), %rsi      # 0x80e0
callq 0x21c0
pushq $0xa
popq %rsi
movq %rax, %rdi
callq 0x22b0
leaq 0x50bb(%rip), %rsi      # 0x8102
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
movq 0x9f72(%rip), %r15      # 0xcfd0
movq %r15, %rdi
movl %ebp, %esi
callq 0x22b0
leaq 0x50f7(%rip), %rsi      # 0x8166
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
movl %r14d, %esi
callq 0x22b0
leaq 0x5086(%rip), %rsi      # 0x810f
movq %rax, %rdi
callq 0x21c0
callq 0x3482
movsd %xmm0, 0x8(%rsp)
ucomisd 0x500c(%rip), %xmm0     # 0x80b0
jbe 0x30f7
movq 0x9f23(%rip), %rdi      # 0xcfd0
leaq 0x505f(%rip), %rsi      # 0x8113
callq 0x21c0
movsd 0x8(%rsp), %xmm0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movl $0xfffffefb, %esi       # imm = 0xFFFFFEFB
andl 0x18(%rax,%rdx), %esi
orl $0x4, %esi
movl %esi, 0x18(%rax,%rdx)
movq -0x18(%rcx), %rcx
movq $0x2, 0x8(%rax,%rcx)
movq %rax, %rdi
callq 0x2270
movq %rax, %r15
leaq 0x5035(%rip), %rsi      # 0x812a
jmp 0x3142
imull %ebp, %r14d
cmpl %r14d, %eax
jne 0x313b
movq 0x9ec9(%rip), %rdi      # 0xcfd0
leaq 0x5034(%rip), %rsi      # 0x8142
callq 0x21c0
pushq $0x4
popq %rsi
movq %rax, %rdi
callq 0x22b0
leaq 0x502c(%rip), %rsi      # 0x8151
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
addl $0x4, 0x10(%rbx)
jmp 0x3152
leaq 0x4ff2(%rip), %rsi      # 0x8134
movq %r15, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
leaq 0x20(%rsp), %rdi
callq 0x34b2
addq $0x13a8, %rsp           # imm = 0x13A8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3172
jmp 0x3172
jmp 0x3172
jmp 0x3172
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x34b2
movq %rbx, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O2/permui[P]CastleAdventure/src/command.hpp
// Function: std::pair<int, double> GetAin<int>()
std::pair<T, double> GetAin() {
	auto t1 = std::chrono::high_resolution_clock::now();
	T ret = GetA<T>();
	auto t2 = std::chrono::high_resolution_clock::now();
	std::chrono::duration<double> sec = t2 - t1;
	return {ret, sec.count()};
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
callq 0x2040
movq %rax, %rbx
callq 0x3608
movl %eax, %ebp
callq 0x2040
subq %rbx, %rax
cvtsi2sd %rax, %xmm0
divsd 0x4bff(%rip), %xmm0     # 0x80a8
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/permui[P]CastleAdventure/src/command.hpp
// Function: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> GetA<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>()
T GetA() {
	T ret;
	while (true) {
		if (std::cin >> ret) {
			std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
			break;
		}
		std::cout << "invalid input!" << std::endl;
		std::cin.clear();
		std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
	}
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
movq 0x608d(%rip), %r14      # 0xcfe0
movq 0x6076(%rip), %r15      # 0xcfd0
leaq 0x1273(%rip), %r12      # 0x81d4
movabsq $0x7fffffffffffffff, %r13 # imm = 0x7FFFFFFFFFFFFFFF
pushq $0xa
popq %rbp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2210
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0x6fba
movq %r15, %rdi
movq %r12, %rsi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
xorl %esi, %esi
callq 0x22a0
movq %r14, %rdi
movq %r13, %rsi
movl %ebp, %edx
callq 0x2110
jmp 0x6f6e
movq 0x601f(%rip), %rdi      # 0xcfe0
movabsq $0x7fffffffffffffff, %rsi # imm = 0x7FFFFFFFFFFFFFFF
pushq $0xa
popq %rdx
callq 0x2110
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6fe7
movq %rax, %r14
movq %rbx, %rdi
callq 0x20c0
movq %r14, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O2/permui[P]CastleAdventure/src/base.cpp
// Function: Player::show_state(Grid const&) const
void Player::show_state(const Grid &grid) const {
	std::cout << "You are at (floor " << pos.floor << ", section " << pos.section << ") [" << grid.name << "]" << std::endl;
	std::cout << "shield: " << shield << " | sword: " << sword << " | ";
	std::cout << "BitCoin: " << btc;
	if (with_princess) std::cout << " | with princess";
	std::cout << std::endl;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq 0x9822(%rip), %r14      # 0xcfd0
leaq 0x4a2e(%rip), %rsi      # 0x81e3
movq %r14, %rdi
callq 0x21c0
movl (%rbx), %esi
movq %rax, %rdi
callq 0x22b0
leaq 0x4a28(%rip), %rsi      # 0x81f6
movq %rax, %rdi
callq 0x21c0
movl 0x4(%rbx), %esi
movq %rax, %rdi
callq 0x22b0
leaq 0x4a19(%rip), %rsi      # 0x8201
movq %rax, %rdi
callq 0x21c0
addq $0x10, %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x21a0
leaq 0x49ff(%rip), %rsi      # 0x8205
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
leaq 0x49ea(%rip), %rsi      # 0x8207
movq %r14, %rdi
callq 0x21c0
movl 0x8(%rbx), %esi
movq %rax, %rdi
callq 0x22b0
leaq 0x49d9(%rip), %rsi      # 0x8210
movq %rax, %rdi
callq 0x21c0
movl 0xc(%rbx), %esi
movq %rax, %rdi
callq 0x22b0
leaq 0x49ca(%rip), %rsi      # 0x821b
movq %rax, %rdi
callq 0x21c0
leaq 0x49bf(%rip), %rsi      # 0x821f
movq %r14, %rdi
callq 0x21c0
movl 0x10(%rbx), %esi
movq %rax, %rdi
callq 0x22b0
cmpb $0x1, 0x14(%rbx)
jne 0x388c
movq 0x9750(%rip), %rdi      # 0xcfd0
leaq 0x49a2(%rip), %rsi      # 0x8229
callq 0x21c0
movq 0x973d(%rip), %rdi      # 0xcfd0
popq %rbx
popq %r14
popq %r15
jmp 0x20d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/permui[P]CastleAdventure/src/genmap.cpp
// Function: GenMap()
map<Position, Grid> GenMap() {
	vector<Grid> vec = GenGrids();
	map<Position, Grid> mp;
	for (const Grid &g: vec) mp.emplace(g.pos, g);
	return mp;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x3be8
leaq 0x8(%rbx), %rax
andl $0x0, 0x8(%rbx)
andq $0x0, 0x10(%rbx)
movq %rax, 0x18(%rbx)
movq %rax, 0x20(%rbx)
andq $0x0, 0x28(%rbx)
movq (%r15), %r14
movq 0x8(%r15), %r15
cmpq %r15, %r14
je 0x5d9c
movq %rbx, %rdi
movq %r14, %rsi
movq %r14, %rdx
callq 0x68ee
subq $-0x80, %r14
jmp 0x5d83
leaq 0x8(%rsp), %rdi
callq 0x62d0
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x2914
leaq 0x8(%rsp), %rdi
callq 0x62d0
movq %r14, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O2/permui[P]CastleAdventure/src/command.cpp
// Function: Command(Player&, Grid&, std::map<Position, Grid, std::less<Position>, std::allocator<std::pair<Position const, Grid>>>&)
void Command(Player &player, Grid &grid, map<Position, Grid> &mp) {
	switch (grid.info.t) {
		case GT::Monster: {
			EncounterMonster(player, grid);
			if (player.pos == FAIL_POS || player.pos == QUIT_POS) return;
			break;
		}
		case GT::Princess: {
			EncounterPrincess(player, grid);
			break;
		}
		default:
			break;
	}
	cout << "Commands:";
	if (grid.commands.empty()) {
		// if the design is right, this is impossible
		cout << " no commands availible" << endl;
		return;
	}
	for (const auto &pr: grid.commands) cout << ' ' << pr.first;
	cout << endl;
	map<string, Action>::iterator it;
	while (true) {
		string com = GetA<string>();
		it = grid.commands.find(com);
		if (it != grid.commands.end()) break;
		cout << "given command not available, see the command list" << endl;
	}
	it->second(player, grid, mp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movl 0x8(%rsi), %eax
testl %eax, %eax
movq %rsi, (%rsp)
je 0x6b8b
cmpl $0x1, %eax
jne 0x6b93
movq %r14, %rdi
movq (%rsp), %rsi
callq 0x6cc6
leaq 0x1e79(%rip), %rsi      # 0x89dc
movq %r14, %rdi
callq 0x376a
testb %al, %al
jne 0x6c77
leaq 0x1e6a(%rip), %rsi      # 0x89e4
movq %r14, %rdi
callq 0x376a
testb %al, %al
je 0x6b93
jmp 0x6c77
movq %r14, %rdi
callq 0x6e7a
movq 0x6436(%rip), %rdi      # 0xcfd0
leaq 0x1e4b(%rip), %rsi      # 0x89ec
callq 0x21c0
movq (%rsp), %rax
cmpq $0x0, 0x78(%rax)
je 0x6c86
movq %r14, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
leaq 0x50(%rax), %r12
movq 0x68(%rax), %r13
leaq 0x58(%rax), %r14
movq 0x63fe(%rip), %rbx      # 0xcfd0
pushq $0x20
popq %rbp
cmpq %r14, %r13
je 0x6c00
leaq 0x20(%r13), %r15
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2200
movq %rax, %rdi
movq %r15, %rsi
callq 0x21a0
movq %r13, %rdi
callq 0x2140
movq %rax, %r13
jmp 0x6bd5
movq 0x63c9(%rip), %r13      # 0xcfd0
movq %r13, %rdi
callq 0x20d0
leaq 0x18(%rsp), %rbp
leaq 0x1df2(%rip), %rbx      # 0x8a0d
movq %rbp, %rdi
callq 0x6f2e
movq %r12, %rdi
movq %rbp, %rsi
callq 0x701a
movq %rax, %r15
cmpq %r14, %rax
jne 0x6c53
movq %r13, %rdi
movq %rbx, %rsi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
movq %rbp, %rdi
callq 0x20c0
jmp 0x6c1b
leaq 0x18(%rsp), %rdi
callq 0x20c0
addq $0x40, %r15
movq %r15, %rdi
movq 0x8(%rsp), %rsi
movq (%rsp), %rdx
movq 0x10(%rsp), %rcx
callq 0x6ffa
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x6343(%rip), %rdi      # 0xcfd0
leaq 0x1d62(%rip), %rsi      # 0x89f6
callq 0x21c0
movq %rax, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20d0
jmp 0x6cb1
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O2/permui[P]CastleAdventure/src/command.cpp
// Function: EncounterMonster(Player&, Grid&)
void EncounterMonster(Player &player, Grid &grid) {
	cout << "Encounter Monster!" << endl;
	cout << "A shield (" << shield_price << " BTC) can defend against one time of monster attact, but cannot kill the monster." << endl;
	cout << "A sword (" << sword_price << " BTC) can kill the monster." << endl;
	cout << "Commands: use_shield use_sword give_up" << endl;
	while (true) {
		string com = GetA<string>();
		if (com == "use_shield") {
			if (player.shield > 0) {
				--player.shield;
				cout << "You defend the monster!" << endl;
				break;
			}
			cout << "not enough shield, choose an alternative" << endl;
		} else if (com == "use_sword") {
			if (player.sword > 0) {
				--player.sword;
				grid.info.t = GT::None;
				cout << "You kill the monster!" << endl;
				break;
			}
			cout << "not enogh sword, choose an alternative" << endl;
		} else if (com == "give_up") {
			player.pos = FAIL_POS;
			break;
		} else {
			cout << "given command not available, see the command list" << endl;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, (%rsp)
movq %rdi, %rbx
movq 0x62ee(%rip), %r15      # 0xcfd0
leaq 0x1d56(%rip), %rsi      # 0x8a3f
movq %r15, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
leaq 0x1d52(%rip), %rsi      # 0x8a52
movq %r15, %rdi
callq 0x21c0
pushq $0xa
popq %rsi
movq %rax, %rdi
callq 0x22b0
leaq 0x1d43(%rip), %rsi      # 0x8a5d
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
leaq 0x1d7e(%rip), %rsi      # 0x8aaf
movq %r15, %rdi
callq 0x21c0
pushq $0xf
popq %rsi
movq %rax, %rdi
callq 0x22b0
leaq 0x1d6e(%rip), %rsi      # 0x8ab9
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
leaq 0x1d73(%rip), %rsi      # 0x8ad5
movq %r15, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
leaq 0x8(%rsp), %r12
leaq 0x1d7e(%rip), %r13      # 0x8afc
leaq 0x1d9a(%rip), %r14      # 0x8b1f
leaq 0x1dbc(%rip), %rbp      # 0x8b48
movq %r12, %rdi
callq 0x6f2e
movq %r12, %rdi
movq %r13, %rsi
callq 0x700d
testb %al, %al
je 0x6daf
movl 0x8(%rbx), %eax
movq %r14, %rsi
testl %eax, %eax
jle 0x6de8
jmp 0x6e02
movq %r12, %rdi
movq %rbp, %rsi
callq 0x700d
testb %al, %al
je 0x6dce
movl 0xc(%rbx), %eax
leaq 0x1da0(%rip), %rsi      # 0x8b68
testl %eax, %eax
jle 0x6de8
jmp 0x6e1f
movq %r12, %rdi
leaq 0x1d1c(%rip), %rsi      # 0x8af4
callq 0x700d
leaq 0x1c29(%rip), %rsi      # 0x8a0d
testb %al, %al
jne 0x6e10
movq %r15, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
movq %r12, %rdi
callq 0x20c0
jmp 0x6d8c
decl %eax
movl %eax, 0x8(%rbx)
leaq 0x1cf9(%rip), %rsi      # 0x8b07
jmp 0x6e36
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rax, (%rbx)
jmp 0x6e4a
decl %eax
movl %eax, 0xc(%rbx)
movq (%rsp), %rax
movl $0x3, 0x8(%rax)
leaq 0x1d1c(%rip), %rsi      # 0x8b52
movq 0x6193(%rip), %rdi      # 0xcfd0
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
leaq 0x8(%rsp), %rdi
callq 0x20c0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6e65
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O2/permui[P]CastleAdventure/src/command.cpp
// Function: EncounterPrincess(Player&, Grid&)
void EncounterPrincess(Player &player, Grid &grid) {
	cout << "Lovely Princess Here!" << endl;
	cout << "Commands: pick_her leave_her_alone" << endl;
	while (true) {
		string com = GetA<string>();
		if (com == "pick_her") {
			grid.info.t = GT::None;
			player.with_princess = true;
			break;
		} else if (com == "leave_her_alone") {
			break;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x613b(%rip), %r15      # 0xcfd0
leaq 0x1cf3(%rip), %rsi      # 0x8b8f
movq %r15, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
leaq 0x1cf2(%rip), %rsi      # 0x8ba5
movq %r15, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
leaq 0x8(%rsp), %r15
leaq 0x1cf9(%rip), %r12      # 0x8bc8
leaq 0x1ce2(%rip), %r13      # 0x8bb8
movq %r15, %rdi
callq 0x6f2e
movq %r15, %rdi
movq %r12, %rsi
callq 0x700d
testb %al, %al
jne 0x6f09
movq %r15, %rdi
movq %r13, %rsi
callq 0x700d
movl %eax, %ebp
movq %r15, %rdi
callq 0x20c0
testb %bpl, %bpl
je 0x6ed6
jmp 0x6f1f
movl $0x3, 0x8(%r14)
movb $0x1, 0x14(%rbx)
leaq 0x8(%rsp), %rdi
callq 0x20c0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/point.cpp
// Function: Point::print()
void Point::print()
{
    /*!
     * @brief Enables to print d-dimensional points on the console
     * 
     */

    for (int i = 0; i < d; i ++) {
        std::cout << coords[i] << std::endl;
    }
    std::cout << "\n" << std::endl;
    return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r15d, %r15d
movq 0x136e0(%rip), %r14     # 0x16fb0
movslq 0x139d1(%rip), %rax     # 0x172a8
cmpq %rax, %r15
jge 0x38fa
movq (%rbx), %rax
movsd (%rax,%r15,8), %xmm0
movq %r14, %rdi
callq 0x3430
movq %rax, %rdi
callq 0x3130
incq %r15
jmp 0x38d0
movq 0x136af(%rip), %rdi     # 0x16fb0
leaq 0xb90e(%rip), %rsi      # 0xf216
callq 0x32a0
movq %rax, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3130
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/point.cpp
// Function: Point::distance(Point*)
double Point::distance(Point* other)
{
    /*!
     * @brief Evaluates the distance between two instances of the class Point
     * 
     * @param other Another Point to evaluate the distance with 
     * 
     * @return The distance between this point and the \p other 
     */

    double dist = 0.0;
    for (int i = 0; i < d; i ++) {
        dist += std::pow(coords[i] - other->coords[i], 2);
    }
    dist = std::sqrt(dist);

    return dist;
}

// Assembly:
movl 0x13988(%rip), %eax     # 0x172a8
movq (%rdi), %rcx
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
xorpd %xmm0, %xmm0
cmpq %rdx, %rax
je 0x394d
movsd (%rcx,%rdx,8), %xmm1
movq (%rsi), %rdi
subsd (%rdi,%rdx,8), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
incq %rdx
jmp 0x392e
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x3240
sqrtsd %xmm0, %xmm0
retq