// File: /workspace/github_cpp_makefile_star2_O3/martinferianc[P]CPUSimulator-EIE2/src/mips_cpu_execute.cpp
// Function: mips_execute_R_X(mips_cpu_impl*, unsigned int&, unsigned int&, 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_R_X(mips_cpu_h state, uint32_t& hi, uint32_t& lo, 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* source1 = new uint32_t;
	uint32_t* source2 = new uint32_t;
	uint32_t destination = instruction_data[3];
	uint32_t shift = instruction_data[4];

	err = mips_cpu_get_register(state, (unsigned)instruction_data[1], source1);
	if (err==mips_Success)
		err = mips_cpu_get_register(state, (unsigned)instruction_data[2], source2);
	if (err!=mips_Success)
		return mips_ExceptionAccessViolation;

	if (op.compare("ADDU")==0)
		err = mips_cpu_set_register(state, destination, *source1 + *source2);

	if (op.compare("SRL")==0)
		err = mips_cpu_set_register(state, destination, uint32_t(*source2) >> shift);

	if (op.compare("SRA")==0)
		err = mips_cpu_set_register(state, destination, int32_t(*source2) >> shift);

	if (op.compare("SRAV")==0)
		err = mips_cpu_set_register(state, destination, int32_t(*source2) >> (*source1 & 0x1F));

	if (op.compare("SRLV")==0)
		err = mips_cpu_set_register(state, destination, uint32_t(*source2) >> (*source1 & 0x1F));

	if (op.compare("SLL")==0)
		err = mips_cpu_set_register(state, destination, *source2 << shift);

	if (op.compare("SLLV")==0)
		err = mips_cpu_set_register(state, destination, *source2 << (*source1 & 0x1F));

	if (op.compare("SUBU")==0)
		err = mips_cpu_set_register(state, destination, *source1 - *source2);

	if (op.compare("SUB")==0){
		if (!subtraction_overflow(*source1,*source2))
			err = mips_cpu_set_register(state, destination, int32_t(*source1) - int32_t(*source2));
		else
			err = mips_ExceptionArithmeticOverflow;
	}

	if (op.compare("AND")==0)
		err = mips_cpu_set_register(state, destination, *source1 & *source2);

	if (op.compare("OR")==0)
		err = mips_cpu_set_register(state, destination, *source1 | *source2);

	if (op.compare("XOR")==0)
		err = mips_cpu_set_register(state, destination, uint32_t(*source1 ^ *source2));

	if(op.compare("SLT")==0)
		err = mips_cpu_set_register(state, destination, int((int32_t(*source1) < int32_t(*source2))));

	if (op.compare("SLTU")==0)
		err = mips_cpu_set_register(state, destination, int(*source1 < *source2));

	if (op.compare("ADD")==0){
		if (!addition_overflow(*source1 ,*source2))
			err = mips_cpu_set_register(state, destination, *source1 + *source2);
		else
			err = mips_ExceptionArithmeticOverflow;
	}
	if (op.compare("MFLO")==0)
		err = mips_cpu_set_register(state, destination, lo);

	if (op.compare("MTLO")==0){
		lo = *source1;
		err = mips_Success;
	}
	if (op.compare("MFHI")==0)
		err = mips_cpu_set_register(state, destination, hi);

	if (op.compare("MTHI")==0){
		hi = *source1;
		err = mips_Success;
	}
	if (op.compare("MULT")==0){
		int64_t result =  int64_t(*source1) * int64_t(*source2);
		lo = uint32_t(result & 0xFFFFFFFF);
		hi = int32_t((result & 0xFFFFFFFF00000000) >> 32);
		err = mips_Success;
	}
	if (op.compare("MULTU")==0){
		uint64_t result =  uint64_t(*source1) * uint64_t(*source2);
		lo = uint32_t(result & 0xFFFFFFFF);
		hi = (uint32_t(result >> 32 ) & 0xFFFFFFFF);
		err = mips_Success;
	}

	if (op.compare("DIV")==0){
		if (*source2!=0) {
			lo = (int32_t(*source1) / int32_t(*source2));
			hi = (int32_t(*source1) % int32_t(*source2));
			err = mips_Success;
		} else {
			err = mips_ExceptionInvalidInstruction;
		}
	}

	if (op.compare("DIVU")==0){
		if (*source2!=0){
			lo = (uint32_t(*source1) / uint32_t(*source2));
			hi = (uint32_t(*source1) % uint32_t(*source2));
			err = mips_Success;
		} else {
			err = mips_ExceptionInvalidInstruction;
		}
	}

	if (op.compare("JR")==0){
		pc = pcN;
		pcN = *source1;
		err = mips_ExceptionBreak;
	}

	if (op.compare("JALR")==0){
		mips_cpu_set_register(state, destination, pc + 8 );
		pc = pcN;
		pcN = *source1;
		err = mips_ExceptionBreak;
	}


	//COUT OUTPUT
	if ((err==mips_Success) || (err == mips_ExceptionBreak)) {
		if ((op.compare("MTHI")==0) || (op.compare("MTLO")==0) || (op.compare("JR")==0))
		ss <<op<<" R["<<instruction_data[1]<<"]";
		if (op.compare("JALR")==0)
		ss <<op<<" R["<<instruction_data[3]<<"] , R["<<instruction_data[1]<<"]";
		if ((op.compare("MFHI")==0) || (op.compare("MFLO")==0))
		ss <<op<<" R["<<instruction_data[3]<<"]";
		if ((op.compare("SLL")==0)  || (op.compare("SRL")==0) || (op.compare("SRA")==0))
		ss <<op<<" R["<<instruction_data[3]<<"] , R["<<instruction_data[2]<<"], #"<<instruction_data[4];
		if ((op.compare("SLLV")==0) || (op.compare("SRAV")==0) || (op.compare("SRLV")==0))
		ss <<op<<" R["<<instruction_data[3]<<"] , R["<<instruction_data[2]<<"] , R["<<instruction_data[1]<<"]";
		if ((op.compare("SLT")==0) || (op.compare("SLTU")==0))
		ss <<op<<" R["<<instruction_data[3]<<"] , R["<<instruction_data[1]<<"] , R["<<instruction_data[2]<<"]";
		if ((op.compare("MULT")==0) || (op.compare("MULTU")==0) || (op.compare("DIV")==0) || (op.compare("DIVU")==0))
		ss <<op<<" R["<<instruction_data[1]<<"] , R["<<instruction_data[2]<<"]";
		if (ss.str().empty())
		ss <<op<<" R["<<instruction_data[3]<<"] , R["<<instruction_data[1]<<"] , R["<<instruction_data[2]<<"]";
		instruction = ss.str();
	} else
		instruction = "Invalid instruction";


	delete source1; delete source2;
	return err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %r9, %rbx
movq %r8, %r13
movq %rcx, %r12
movq %rdx, 0x18(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdi, %r15
leaq 0x50(%rsp), %rdi
callq 0x3150
movl $0x4, %edi
callq 0x31d0
movq %rax, 0x8(%rsp)
movq %rbx, 0x20(%rsp)
movl $0x4, %edi
callq 0x31d0
movq %rax, 0x10(%rsp)
movl 0x4(%r12), %esi
movl 0xc(%r12), %r14d
movl 0x10(%r12), %ebx
movq %r15, %rdi
movq 0x8(%rsp), %rdx
callq 0x4c31
movl $0x2004, %ebp           # imm = 0x2004
testl %eax, %eax
jne 0x7174
movl 0x8(%r12), %esi
movq %r15, %rdi
movq 0x10(%rsp), %rdx
callq 0x4c31
testl %eax, %eax
jne 0x7174
leaq 0x3ea9(%rip), %rsi      # 0xa594
movq %r13, %rdi
callq 0x30a0
xorl %ebp, %ebp
testl %eax, %eax
jne 0x6714
movq 0x10(%rsp), %rax
movl (%rax), %edx
movq 0x8(%rsp), %rax
addl (%rax), %edx
movq %r15, %rdi
movl %r14d, %esi
callq 0x4c51
movl %eax, %ebp
leaq 0x429f(%rip), %rsi      # 0xa9ba
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x673f
movq 0x10(%rsp), %rax
movl (%rax), %edx
movl %ebx, %ecx
shrl %cl, %edx
movq %r15, %rdi
movl %r14d, %esi
callq 0x4c51
movl %eax, %ebp
leaq 0x4234(%rip), %rsi      # 0xa97a
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x676a
movq 0x10(%rsp), %rax
movl (%rax), %edx
movl %ebx, %ecx
sarl %cl, %edx
movq %r15, %rdi
movl %r14d, %esi
callq 0x4c51
movl %eax, %ebp
leaq 0x4224(%rip), %rsi      # 0xa995
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x679a
movq 0x10(%rsp), %rax
movl (%rax), %edx
movq 0x8(%rsp), %rax
movb (%rax), %cl
sarl %cl, %edx
movq %r15, %rdi
movl %r14d, %esi
callq 0x4c51
movl %eax, %ebp
leaq 0x4231(%rip), %rsi      # 0xa9d2
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x67ca
movq 0x10(%rsp), %rax
movl (%rax), %edx
movq 0x8(%rsp), %rax
movb (%rax), %cl
shrl %cl, %edx
movq %r15, %rdi
movl %r14d, %esi
callq 0x4c51
movl %eax, %ebp
leaq 0x40e1(%rip), %rsi      # 0xa8b2
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x67f5
movq 0x10(%rsp), %rax
movl (%rax), %edx
movl %ebx, %ecx
shll %cl, %edx
movq %r15, %rdi
movl %r14d, %esi
callq 0x4c51
movl %eax, %ebp
leaq 0x40cd(%rip), %rsi      # 0xa8c9
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x6825
movq 0x10(%rsp), %rax
movl (%rax), %edx
movq 0x8(%rsp), %rax
movb (%rax), %cl
shll %cl, %edx
movq %r15, %rdi
movl %r14d, %esi
callq 0x4c51
movl %eax, %ebp
leaq 0x41d5(%rip), %rsi      # 0xaa01
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x6853
movq 0x8(%rsp), %rax
movl (%rax), %edx
movq 0x10(%rsp), %rax
subl (%rax), %edx
movq %r15, %rdi
movl %r14d, %esi
callq 0x4c51
movl %eax, %ebp
leaq 0x419a(%rip), %rsi      # 0xa9f4
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x689d
movq 0x8(%rsp), %rax
movl (%rax), %edi
movq 0x10(%rsp), %rax
movl (%rax), %esi
callq 0x801b
movl $0x2006, %ebp           # imm = 0x2006
testb %al, %al
jne 0x689d
movq 0x8(%rsp), %rax
movl (%rax), %edx
movq 0x10(%rsp), %rax
subl (%rax), %edx
movq %r15, %rdi
movl %r14d, %esi
callq 0x4c51
movl %eax, %ebp
leaq 0x3d10(%rip), %rsi      # 0xa5b4
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x68cb
movq 0x10(%rsp), %rax
movl (%rax), %edx
movq 0x8(%rsp), %rax
andl (%rax), %edx
movq %r15, %rdi
movl %r14d, %esi
callq 0x4c51
movl %eax, %ebp
leaq 0x4155(%rip), %rsi      # 0xaa27
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x68f9
movq 0x10(%rsp), %rax
movl (%rax), %edx
movq 0x8(%rsp), %rax
orl (%rax), %edx
movq %r15, %rdi
movl %r14d, %esi
callq 0x4c51
movl %eax, %ebp
leaq 0x4126(%rip), %rsi      # 0xaa26
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x6927
movq 0x10(%rsp), %rax
movl (%rax), %edx
movq 0x8(%rsp), %rax
xorl (%rax), %edx
movq %r15, %rdi
movl %r14d, %esi
callq 0x4c51
movl %eax, %ebp
leaq 0x3fbc(%rip), %rsi      # 0xa8ea
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x695a
movq 0x8(%rsp), %rax
movl (%rax), %eax
xorl %edx, %edx
movq 0x10(%rsp), %rcx
cmpl (%rcx), %eax
setl %dl
movq %r15, %rdi
movl %r14d, %esi
callq 0x4c51
movl %eax, %ebp
leaq 0x3ffa(%rip), %rsi      # 0xa95b
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x698d
movq 0x8(%rsp), %rax
movl (%rax), %eax
xorl %edx, %edx
movq 0x10(%rsp), %rcx
cmpl (%rcx), %eax
setb %dl
movq %r15, %rdi
movl %r14d, %esi
callq 0x4c51
movl %eax, %ebp
leaq 0x3b9a(%rip), %rsi      # 0xa52e
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x69d7
movq 0x8(%rsp), %rax
movl (%rax), %edi
movq 0x10(%rsp), %rax
movl (%rax), %esi
callq 0x8064
movl $0x2006, %ebp           # imm = 0x2006
testb %al, %al
jne 0x69d7
movq 0x10(%rsp), %rax
movl (%rax), %edx
movq 0x8(%rsp), %rax
addl (%rax), %edx
movq %r15, %rdi
movl %r14d, %esi
callq 0x4c51
movl %eax, %ebp
leaq 0x3e3b(%rip), %rsi      # 0xa819
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x69fe
movq 0x18(%rsp), %rax
movl (%rax), %edx
movq %r15, %rdi
movl %r14d, %esi
callq 0x4c51
movl %eax, %ebp
leaq 0x3e36(%rip), %rsi      # 0xa83b
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x6a21
movq 0x8(%rsp), %rax
movl (%rax), %eax
movq 0x18(%rsp), %rcx
movl %eax, (%rcx)
xorl %ebp, %ebp
leaq 0x3ddf(%rip), %rsi      # 0xa807
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
movq 0x28(%rsp), %rbx
jne 0x6a4d
movl (%rbx), %edx
movq %r15, %rdi
movl %r14d, %esi
callq 0x4c51
movl %eax, %ebp
movq 0x28(%rsp), %rbx
leaq 0x3dd7(%rip), %rsi      # 0xa82b
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x6a6b
movq 0x8(%rsp), %rax
movl (%rax), %eax
movl %eax, (%rbx)
xorl %ebp, %ebp
leaq 0x3dd9(%rip), %rsi      # 0xa84b
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x6a9f
movq 0x8(%rsp), %rax
movl (%rax), %eax
movq 0x10(%rsp), %rcx
movl (%rcx), %ecx
imulq %rax, %rcx
movq 0x18(%rsp), %rax
movl %ecx, (%rax)
shrq $0x20, %rcx
movl %ecx, (%rbx)
xorl %ebp, %ebp
leaq 0x3db3(%rip), %rsi      # 0xa859
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x6ad3
movq 0x8(%rsp), %rax
movl (%rax), %eax
movq 0x10(%rsp), %rcx
movl (%rcx), %ecx
imulq %rax, %rcx
movq 0x18(%rsp), %rax
movl %ecx, (%rax)
shrq $0x20, %rcx
movl %ecx, (%rbx)
xorl %ebp, %ebp
leaq 0x3c28(%rip), %rsi      # 0xa702
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x6b0d
movq 0x10(%rsp), %rax
movl (%rax), %ecx
testl %ecx, %ecx
je 0x6b08
movq 0x8(%rsp), %rax
movl (%rax), %eax
cltd
idivl %ecx
movq 0x18(%rsp), %rcx
movl %eax, (%rcx)
movl %edx, (%rbx)
xorl %ebp, %ebp
jmp 0x6b0d
movl $0x2005, %ebp           # imm = 0x2005
leaq 0x3bf9(%rip), %rsi      # 0xa70d
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x6b48
movq 0x10(%rsp), %rax
movl (%rax), %ecx
testl %ecx, %ecx
je 0x6b43
movq 0x8(%rsp), %rax
movl (%rax), %eax
xorl %edx, %edx
divl %ecx
xorl %ebp, %ebp
movq 0x18(%rsp), %rcx
movl %eax, (%rcx)
movl %edx, (%rbx)
jmp 0x6b48
movl $0x2005, %ebp           # imm = 0x2005
movq 0x210(%rsp), %rbx
leaq 0x3c00(%rip), %rsi      # 0xa757
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x6b7d
movl (%rbx), %eax
movq 0x218(%rsp), %rcx
movl %eax, (%rcx)
movq 0x8(%rsp), %rax
movl (%rax), %eax
movl %eax, (%rbx)
movl $0x2000, %ebp           # imm = 0x2000
leaq 0x3bb7(%rip), %rsi      # 0xa73b
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
je 0x6bba
testl $0xffffdfff, %ebp       # imm = 0xFFFFDFFF
je 0x6be6
movq 0x20(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x4130(%rip), %rcx      # 0xacd8
movl $0x13, %r8d
xorl %esi, %esi
callq 0x32d0
jmp 0x7156
movq 0x218(%rsp), %rbp
movl (%rbp), %edx
addl $0x8, %edx
movq %r15, %rdi
movl %r14d, %esi
callq 0x4c51
movl (%rbx), %eax
movl %eax, (%rbp)
movq 0x8(%rsp), %rax
movl (%rax), %eax
movl %eax, (%rbx)
movl $0x2000, %ebp           # imm = 0x2000
leaq 0x3c3e(%rip), %rsi      # 0xa82b
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
je 0x6c1f
leaq 0x3c3b(%rip), %rsi      # 0xa83b
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
je 0x6c1f
leaq 0x3b44(%rip), %rsi      # 0xa757
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x6c69
leaq 0x60(%rsp), %rdi
movq (%r13), %rsi
movq 0x8(%r13), %rdx
callq 0x3210
movq %rax, %rbx
leaq 0x4094(%rip), %rsi      # 0xaccf
movl $0x3, %edx
movq %rax, %rdi
callq 0x3210
movl 0x4(%r12), %esi
movq %rbx, %rdi
callq 0x3120
leaq 0x3e90(%rip), %rsi      # 0xaaec
movl $0x1, %edx
movq %rax, %rdi
callq 0x3210
leaq 0x3acb(%rip), %rsi      # 0xa73b
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x6cea
leaq 0x60(%rsp), %rdi
movq (%r13), %rsi
movq 0x8(%r13), %rdx
callq 0x3210
movq %rax, %rbx
leaq 0x4037(%rip), %rsi      # 0xaccf
movl $0x3, %edx
movq %rax, %rdi
callq 0x3210
movl 0xc(%r12), %esi
movq %rbx, %rdi
callq 0x3120
movq %rax, %rbx
leaq 0x4010(%rip), %rsi      # 0xaccc
movl $0x6, %edx
movq %rax, %rdi
callq 0x3210
movl 0x4(%r12), %esi
movq %rbx, %rdi
callq 0x3120
leaq 0x3e0f(%rip), %rsi      # 0xaaec
movl $0x1, %edx
movq %rax, %rdi
callq 0x3210
leaq 0x3b16(%rip), %rsi      # 0xa807
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
je 0x6d10
leaq 0x3b15(%rip), %rsi      # 0xa819
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x6d5a
leaq 0x60(%rsp), %rdi
movq (%r13), %rsi
movq 0x8(%r13), %rdx
callq 0x3210
movq %rax, %rbx
leaq 0x3fa3(%rip), %rsi      # 0xaccf
movl $0x3, %edx
movq %rax, %rdi
callq 0x3210
movl 0xc(%r12), %esi
movq %rbx, %rdi
callq 0x3120
leaq 0x3d9f(%rip), %rsi      # 0xaaec
movl $0x1, %edx
movq %rax, %rdi
callq 0x3210
leaq 0x3b51(%rip), %rsi      # 0xa8b2
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
je 0x6d93
leaq 0x3c46(%rip), %rsi      # 0xa9ba
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
je 0x6d93
leaq 0x3bf3(%rip), %rsi      # 0xa97a
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x6e11
leaq 0x60(%rsp), %rdi
movq (%r13), %rsi
movq 0x8(%r13), %rdx
callq 0x3210
movq %rax, %rbx
leaq 0x3f20(%rip), %rsi      # 0xaccf
movl $0x3, %edx
movq %rax, %rdi
callq 0x3210
movl 0xc(%r12), %esi
movq %rbx, %rdi
callq 0x3120
movq %rax, %rbx
leaq 0x3ef9(%rip), %rsi      # 0xaccc
movl $0x6, %edx
movq %rax, %rdi
callq 0x3210
movl 0x8(%r12), %esi
movq %rbx, %rdi
callq 0x3120
movq %rax, %rbx
leaq 0x3edc(%rip), %rsi      # 0xacd3
movl $0x4, %edx
movq %rax, %rdi
callq 0x3210
movl 0x10(%r12), %esi
movq %rbx, %rdi
callq 0x3120
leaq 0x3ab1(%rip), %rsi      # 0xa8c9
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
je 0x6e4e
leaq 0x3b6a(%rip), %rsi      # 0xa995
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
je 0x6e4e
leaq 0x3b94(%rip), %rsi      # 0xa9d2
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x6ee0
leaq 0x60(%rsp), %rdi
movq (%r13), %rsi
movq 0x8(%r13), %rdx
callq 0x3210
movq %rax, %rbx
leaq 0x3e65(%rip), %rsi      # 0xaccf
movl $0x3, %edx
movq %rax, %rdi
callq 0x3210
movl 0xc(%r12), %esi
movq %rbx, %rdi
callq 0x3120
movq %rax, %rbx
leaq 0x3e3e(%rip), %rsi      # 0xaccc
movl $0x6, %edx
movq %rax, %rdi
callq 0x3210
movl 0x8(%r12), %esi
movq %rbx, %rdi
callq 0x3120
movq %rax, %rbx
leaq 0x3e1a(%rip), %rsi      # 0xaccc
movl $0x6, %edx
movq %rax, %rdi
callq 0x3210
movl 0x4(%r12), %esi
movq %rbx, %rdi
callq 0x3120
leaq 0x3c19(%rip), %rsi      # 0xaaec
movl $0x1, %edx
movq %rax, %rdi
callq 0x3210
leaq 0x3a03(%rip), %rsi      # 0xa8ea
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
je 0x6f0a
leaq 0x3a61(%rip), %rsi      # 0xa95b
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x6f9c
leaq 0x60(%rsp), %rdi
movq (%r13), %rsi
movq 0x8(%r13), %rdx
callq 0x3210
movq %rax, %rbx
leaq 0x3da9(%rip), %rsi      # 0xaccf
movl $0x3, %edx
movq %rax, %rdi
callq 0x3210
movl 0xc(%r12), %esi
movq %rbx, %rdi
callq 0x3120
movq %rax, %rbx
leaq 0x3d82(%rip), %rsi      # 0xaccc
movl $0x6, %edx
movq %rax, %rdi
callq 0x3210
movl 0x4(%r12), %esi
movq %rbx, %rdi
callq 0x3120
movq %rax, %rbx
leaq 0x3d5e(%rip), %rsi      # 0xaccc
movl $0x6, %edx
movq %rax, %rdi
callq 0x3210
movl 0x8(%r12), %esi
movq %rbx, %rdi
callq 0x3120
leaq 0x3b5d(%rip), %rsi      # 0xaaec
movl $0x1, %edx
movq %rax, %rdi
callq 0x3210
leaq 0x38a8(%rip), %rsi      # 0xa84b
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
je 0x6fe8
leaq 0x38a3(%rip), %rsi      # 0xa859
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
je 0x6fe8
leaq 0x3739(%rip), %rsi      # 0xa702
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
je 0x6fe8
leaq 0x3731(%rip), %rsi      # 0xa70d
movq %r13, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x7056
leaq 0x60(%rsp), %rdi
movq (%r13), %rsi
movq 0x8(%r13), %rdx
callq 0x3210
movq %rax, %rbx
leaq 0x3ccb(%rip), %rsi      # 0xaccf
movl $0x3, %edx
movq %rax, %rdi
callq 0x3210
movl 0x4(%r12), %esi
movq %rbx, %rdi
callq 0x3120
movq %rax, %rbx
leaq 0x3ca4(%rip), %rsi      # 0xaccc
movl $0x6, %edx
movq %rax, %rdi
callq 0x3210
movl 0x8(%r12), %esi
movq %rbx, %rdi
callq 0x3120
leaq 0x3aa3(%rip), %rsi      # 0xaaec
movl $0x1, %edx
movq %rax, %rdi
callq 0x3210
leaq 0x68(%rsp), %rbx
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x32f0
leaq 0x40(%rsp), %r15
movq -0x10(%r15), %rdi
movq -0x8(%r15), %r14
cmpq %r15, %rdi
je 0x7087
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x31e0
testq %r14, %r14
jne 0x7122
leaq 0x60(%rsp), %rdi
movq (%r13), %rsi
movq 0x8(%r13), %rdx
callq 0x3210
movq %rax, %r14
leaq 0x3c23(%rip), %rsi      # 0xaccf
movl $0x3, %edx
movq %rax, %rdi
callq 0x3210
movl 0xc(%r12), %esi
movq %r14, %rdi
callq 0x3120
movq %rax, %r14
leaq 0x3bfc(%rip), %rsi      # 0xaccc
movl $0x6, %edx
movq %rax, %rdi
callq 0x3210
movl 0x4(%r12), %esi
movq %r14, %rdi
callq 0x3120
movq %rax, %r14
leaq 0x3bd8(%rip), %rsi      # 0xaccc
movl $0x6, %edx
movq %rax, %rdi
callq 0x3210
movl 0x8(%r12), %esi
movq %r14, %rdi
callq 0x3120
leaq 0x39d7(%rip), %rsi      # 0xaaec
movl $0x1, %edx
movq %rax, %rdi
callq 0x3210
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x32f0
leaq 0x30(%rsp), %rbx
movq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x3250
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x7156
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x31e0
movl $0x4, %esi
movq 0x8(%rsp), %rdi
callq 0x31e0
movl $0x4, %esi
movq 0x10(%rsp), %rdi
callq 0x31e0
movq 0x7e35(%rip), %rsi      # 0xefb0
leaq 0x50(%rsp), %rdi
callq 0x3170
leaq 0xd0(%rsp), %rdi
callq 0x30b0
movl %ebp, %eax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x71ae
jmp 0x71ae
jmp 0x71ae
jmp 0x71ae
movq %rax, %rbx
movq 0x7df8(%rip), %rsi      # 0xefb0
leaq 0x50(%rsp), %rdi
callq 0x3170
leaq 0xd0(%rsp), %rdi
callq 0x30b0
movq %rbx, %rdi
callq 0x3330