// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/RunSim.cpp
// Function: main
int main(int argc, char **argv)
{
	//
	//parse command-line options setting
	//
	numSimCycles = 100000;
	memUtil = 0.1;
	rwRatio = 80;
	traceType = "";
	traceFileName = "";
	
	int opt;
	string pwdString = "";
	ifstream traceFile;
	string line;
	bool pendingTran = false;
	while(1) {
		static struct option long_options[] = {
			{"pwd", required_argument, 0, 'p'},
			{"cycle",  required_argument, 0, 'c'},
			{"trace",  required_argument, 0, 't'},
			{"util",  required_argument, 0, 'u'},
			{"rwratio",  required_argument, 0, 'r'},
			{"file",  required_argument, 0, 'f'},
			{"help", no_argument, 0, 'h'},
			{0, 0, 0, 0}
		};
		int option_index=0;
		opt = getopt_long (argc, argv, "p:c:t:u:r:f:h", long_options, &option_index);
		if(opt == -1) {
			break;
		}
		switch(opt) {
			case 0:
				if (long_options[option_index].flag != 0) {
					cout<<"setting flag"<<endl;
					break;
				}
				cout<<"option "<<long_options[option_index].name<<endl;
				if (optarg) {
					cout<<" with arg"<<optarg<<endl;
				}
				cout<<""<<endl;
				break;
			case 'p':
				pwdString = string(optarg);
				break;
			case 'c':
				numSimCycles = atol(optarg);
				break;
			case 't':
				traceType = string(optarg);
				if(traceType != "random" && traceType != "file") {
					cout<<endl<<" == -t (--trace) ERROR ==";
					cout<<endl<<"  This option must be selected by one of 'random' and 'file'"<<endl<<endl;
					exit(0);
				}
				break;
			case 'u':
				memUtil = atof(optarg);
				if(memUtil < 0 || memUtil > 1) {
					cout<<endl<<" == -u (--util) ERROR ==";
					cout<<endl<<"  This value must be in the between '0' and '1'"<<endl<<endl;
					exit(0);
				}
				break;
			case 'r':
				rwRatio = atof(optarg);
				if(rwRatio < 0 || rwRatio > 100) {
					cout<<endl<<" == -r (--rwratio) ERROR ==";
					cout<<endl<<"  This value is the percentage of reads in request stream"<<endl<<endl;
					exit(0);
				}
				break;
			case 'f':
				traceFileName = string(optarg);
				if(access(traceFileName.c_str(), 0) == -1) {
					cout<<endl<<" == -f (--file) ERROR ==";
					cout<<endl<<"  There is no trace file ["<<traceFileName<<"]"<<endl<<endl;
					exit(0);
				}
				break;
			case 'h':
			case '?':
				Help();
				exit(0);
				break;
		}
	}
	
	srand((unsigned)time(NULL));
	casHMCWrapper = new CasHMCWrapper("ConfigSim.ini", "ConfigDRAM.ini");
	
#ifdef CALLBACKTRANS
	//Register callback function (ReadComplete, WriteComplete)
	CallbackTrans callbackTrans;
	TransCompCB* read_cb = new Callback<CallbackTrans, void, uint64_t, uint64_t>(&callbackTrans, &CallbackTrans::ReadComplete);
    TransCompCB* write_cb = new Callback<CallbackTrans, void, uint64_t, uint64_t>(&callbackTrans, &CallbackTrans::WriteComplete);
	casHMCWrapper->RegisterCallbacks(read_cb, write_cb);
#endif
	
	if(traceType == "random") {
		for(uint64_t cpuCycle=0; cpuCycle<numSimCycles; cpuCycle++) {
			MakeRandomTransaction();
			if(!transactionBuffers.empty()) {
				if(casHMCWrapper->ReceiveTran(transactionBuffers[0])) {
					transactionBuffers.erase(transactionBuffers.begin());
				}
			}
			casHMCWrapper->Update();
		}
	}
	else if(traceType == "file") {
		uint64_t issueClock = 0;
		traceFile.open(traceFileName.c_str());
		if(!traceFile.is_open()) {
			ERROR(" == Error - Could not open trace file ["<<traceFileName<<"]");
			exit(0);
		}
		for(uint64_t cpuCycle=0; cpuCycle<numSimCycles; cpuCycle++) {
			if(!pendingTran) {
				if(!traceFile.eof()) {
					getline(traceFile, line);
					if(line.size() > 0) {
						uint64_t addr;
						TransactionType tranType;
						unsigned dataSize;
						ParseTraceFileLine(line, issueClock, addr, tranType, dataSize);
						Transaction *newTran = new Transaction(tranType, addr, dataSize, casHMCWrapper);
						
						if(cpuCycle >= issueClock) {
							if(!casHMCWrapper->ReceiveTran(newTran)) {
								pendingTran = true;
								transactionBuffers.push_back(newTran);
							}
						}
						else {
							pendingTran = true;
							transactionBuffers.push_back(newTran);
						}
					}
					else {
						cout<<" ## WARNING ## Skipping line ("<<lineNumber<<") in tracefile  (CurrentClock : "<<cpuCycle<<")"<<endl;
					}
					lineNumber++;
				}
			}
			else {
				if(cpuCycle >= issueClock) {
					if(casHMCWrapper->ReceiveTran(transactionBuffers[0])) {
						pendingTran = false;
						transactionBuffers.erase(transactionBuffers.begin());
					}
				}					
			}
			casHMCWrapper->Update();
		}
	}

	transactionBuffers.clear();
	delete casHMCWrapper;
	casHMCWrapper = NULL;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2c8, %rsp            # imm = 0x2C8
movq %rsi, %r14
movl %edi, %ebp
leaq 0x109b9(%rip), %rax     # 0x3b410
movq $0x186a0, (%rax)        # imm = 0x186A0
leaq 0x109b3(%rip), %rcx     # 0x3b418
movabsq $0x3fb999999999999a, %rax # imm = 0x3FB999999999999A
movq %rax, (%rcx)
leaq 0x109a7(%rip), %rcx     # 0x3b420
movabsq $0x4054000000000000, %rax # imm = 0x4054000000000000
movq %rax, (%rcx)
leaq 0x1099b(%rip), %rdi     # 0x3b428
movq 0x8(%rdi), %rdx
leaq 0x7055(%rip), %rbx      # 0x31aed
xorl %esi, %esi
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x4440
leaq 0x1099c(%rip), %rdi     # 0x3b448
movq 0x8(%rdi), %rdx
xorl %esi, %esi
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x4440
leaq 0x70(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x60(%rsp), %rdi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x17994
leaq 0xc0(%rsp), %rdi
callq 0x4330
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x30(%rsp), %r12
leaq 0x107fd(%rip), %r13     # 0x3b300
movq 0x104c6(%rip), %rbx     # 0x3afd0
movl $0x0, 0x10(%rsp)
movl %ebp, %edi
movq %r14, %rsi
leaq 0x8bc4(%rip), %rdx      # 0x336e2
movq %r13, %rcx
leaq 0x10(%rsp), %r8
callq 0x44a0
cmpl $0x65, %eax
jle 0x2ab91
leal -0x70(%rax), %ecx
cmpl $0x5, %ecx
ja 0x2ac31
leaq 0x891d(%rip), %rdx      # 0x33460
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x1045d(%rip), %rax     # 0x3afb0
movq (%rax), %rsi
leaq 0x20(%rsp), %r15
movq %r15, %rdi
leaq 0x8(%rsp), %rdx
callq 0x2b690
leaq 0x60(%rsp), %rdi
movq %r15, %rsi
callq 0x4370
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x2ab0a
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4300
jmp 0x2ab0a
cmpl $0x3e, %eax
jg 0x2ac0a
testl %eax, %eax
jne 0x2ad8e
movslq 0x10(%rsp), %rax
shlq $0x5, %rax
movl $0xc, %edx
cmpq $0x0, 0x10(%rax,%r13)
leaq 0x8b37(%rip), %rsi      # 0x336f0
jne 0x2ae8e
movl $0x7, %edx
movq %rbx, %rdi
leaq 0x8b2f(%rip), %rsi      # 0x336fd
callq 0x4340
movq %r12, %r15
movslq 0x10(%rsp), %rax
shlq $0x5, %rax
movq (%rax,%r13), %r12
testq %r12, %r12
je 0x2adb8
movq %r12, %rdi
callq 0x4150
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x4340
movq %r15, %r12
jmp 0x2add2
cmpl $0x63, %eax
jne 0x2ad9c
movq 0x10396(%rip), %rax     # 0x3afb0
movq (%rax), %rdi
callq 0x4350
leaq 0x107e7(%rip), %rcx     # 0x3b410
movq %rax, (%rcx)
jmp 0x2ab0a
cmpl $0x66, %eax
jne 0x2adaa
movq 0x1036f(%rip), %rax     # 0x3afb0
movq (%rax), %rsi
leaq 0x20(%rsp), %r15
movq %r15, %rdi
leaq 0x8(%rsp), %rdx
callq 0x2b690
leaq 0x107eb(%rip), %rdi     # 0x3b448
movq %r15, %rsi
callq 0x4370
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x2ac7c
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0x107c5(%rip), %rax     # 0x3b448
movq (%rax), %rdi
xorl %esi, %esi
callq 0x44b0
cmpl $-0x1, %eax
jne 0x2ab0a
jmp 0x2b410
movq 0x1030e(%rip), %rax     # 0x3afb0
movq (%rax), %rsi
leaq 0x20(%rsp), %r15
movq %r15, %rdi
leaq 0x8(%rsp), %rdx
callq 0x2b690
leaq 0x1076a(%rip), %rdi     # 0x3b428
movq %r15, %rsi
callq 0x4370
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x2acdd
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0x10744(%rip), %rdi     # 0x3b428
leaq 0x5d96(%rip), %rsi      # 0x30a81
callq 0x4100
testl %eax, %eax
je 0x2ab0a
leaq 0x10729(%rip), %rdi     # 0x3b428
leaq 0x70c2(%rip), %rsi      # 0x31dc8
callq 0x4100
testl %eax, %eax
je 0x2ab0a
jmp 0x2b495
movq 0x10291(%rip), %rax     # 0x3afb0
movq (%rax), %rdi
callq 0x4380
leaq 0x106ea(%rip), %rax     # 0x3b418
movsd %xmm0, (%rax)
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
ja 0x2b3b8
ucomisd 0x5368(%rip), %xmm0     # 0x300b0
jbe 0x2ab0a
jmp 0x2b3b8
movq 0x10256(%rip), %rax     # 0x3afb0
movq (%rax), %rdi
callq 0x4380
leaq 0x106b7(%rip), %rax     # 0x3b420
movsd %xmm0, (%rax)
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
ja 0x2b363
ucomisd 0x5345(%rip), %xmm0     # 0x300c8
jbe 0x2ab0a
jmp 0x2b363
cmpl $-0x1, %eax
jne 0x2ab0a
jmp 0x2aec2
cmpl $0x3f, %eax
jne 0x2ab0a
jmp 0x2b357
cmpl $0x68, %eax
jne 0x2ab0a
jmp 0x2b357
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x44e0
movq %r15, %r12
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq 0x101b0(%rip), %rax     # 0x3afb0
cmpq $0x0, (%rax)
je 0x2ae85
movl $0x9, %edx
movq %rbx, %rdi
leaq 0x88f0(%rip), %rsi      # 0x33705
callq 0x4340
movq 0x1018f(%rip), %rax     # 0x3afb0
movq (%rax), %r12
testq %r12, %r12
je 0x2ae44
movq %r12, %rdi
callq 0x4150
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x4340
movq %r15, %r12
jmp 0x2ae5e
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x44e0
movq %r15, %r12
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
leaq 0x6c61(%rip), %rsi      # 0x31aed
xorl %edx, %edx
movq %rbx, %rdi
callq 0x4340
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
jmp 0x2ab0a
xorl %edi, %edi
callq 0x42a0
movl %eax, %edi
callq 0x42c0
movl $0x1018, %edi           # imm = 0x1018
callq 0x42f0
movq %rax, %r14
leaq 0xb0(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x8949(%rip), %rsi      # 0x33839
leaq 0x894f(%rip), %rdx      # 0x33846
leaq 0xa0(%rsp), %rdi
callq 0x17994
leaq 0x90(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x892f(%rip), %rsi      # 0x33847
leaq 0x8936(%rip), %rdx      # 0x33855
leaq 0x80(%rsp), %rdi
callq 0x17994
leaq 0xa0(%rsp), %rsi
leaq 0x80(%rsp), %rdx
movq %r14, %rdi
callq 0x64d8
movq %r14, 0x11485(%rip)     # 0x3c3d0
movq 0x80(%rsp), %rdi
cmpq %r12, %rdi
je 0x2af68
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0xa0(%rsp), %rdi
cmpq %r15, %rdi
je 0x2af85
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0x1049c(%rip), %rdi     # 0x3b428
leaq 0x5aee(%rip), %rsi      # 0x30a81
callq 0x4100
testl %eax, %eax
je 0x2b247
leaq 0x10481(%rip), %rdi     # 0x3b428
leaq 0x6e1a(%rip), %rsi      # 0x31dc8
callq 0x4100
testl %eax, %eax
jne 0x2b2ca
movq $0x0, 0x20(%rsp)
leaq 0x1047d(%rip), %rax     # 0x3b448
movq (%rax), %rsi
leaq 0xc0(%rsp), %rdi
movl $0x8, %edx
callq 0x41c0
leaq 0x138(%rsp), %rdi
callq 0x40b0
testb %al, %al
je 0x2b4ed
leaq 0x10414(%rip), %rax     # 0x3b410
cmpq $0x0, (%rax)
je 0x2b2ca
xorl %ebx, %ebx
leaq 0xc0(%rsp), %r14
leaq 0x40(%rsp), %r15
movq 0xffb4(%rip), %r12      # 0x3afd0
leaq 0x18(%rsp), %r13
xorl %ebp, %ebp
testb $0x1, %bpl
je 0x2b08b
movb $0x1, %bpl
cmpq 0x20(%rsp), %rbx
jb 0x2b223
movq 0x11392(%rip), %rdi     # 0x3c3d0
movq 0x11373(%rip), %rax     # 0x3c3b8
movq (%rax), %rsi
callq 0x11346
testb %al, %al
je 0x2b223
movq 0x1135c(%rip), %rdi     # 0x3c3b8
leaq 0x8(%rdi), %rsi
movq 0x11359(%rip), %rdx     # 0x3c3c0
cmpq %rdx, %rsi
je 0x2b07b
subq %rsi, %rdx
callq 0x4480
movq 0x11345(%rip), %rdx     # 0x3c3c0
addq $-0x8, %rdx
movq %rdx, 0x1133a(%rip)     # 0x3c3c0
jmp 0x2b13f
movq 0xc0(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x2, 0xe0(%rsp,%rax)
jne 0x2b13f
leaq (%rsp,%rax), %rdi
addq $0xc0, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x4560
cmpq $0x0, 0x48(%rsp)
je 0x2b146
movq %r15, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x1c(%rsp), %rcx
movq %r13, %r8
callq 0x29fb7
movl $0x30, %edi
callq 0x42f0
movq %rax, %rbp
movl 0x1c(%rsp), %esi
movq 0x10(%rsp), %rdx
movl 0x18(%rsp), %ecx
movq 0x112c5(%rip), %r8      # 0x3c3d0
movq %rax, %rdi
callq 0x2b6d0
movq %rbp, 0x8(%rsp)
cmpq 0x20(%rsp), %rbx
jae 0x2b1cc
movq 0x11296(%rip), %rsi     # 0x3c3c0
cmpq 0x11297(%rip), %rsi     # 0x3c3c8
je 0x2b208
movq %rbp, (%rsi)
jmp 0x2b1fb
xorl %ebp, %ebp
jmp 0x2b223
movl $0x1e, %edx
movq %r12, %rdi
leaq 0x8729(%rip), %rsi      # 0x3387e
callq 0x4340
movq 0x1018f(%rip), %rsi     # 0x3b2f0
movq %r12, %rdi
callq 0x41e0
movq %rax, %rbp
movl $0x20, %edx
movq %rax, %rdi
leaq 0x8722(%rip), %rsi      # 0x3389d
callq 0x4340
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x41e0
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
leaq 0x8344(%rip), %rsi      # 0x334e1
callq 0x4340
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %rbp, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
jmp 0x2b1df
movq 0x111fd(%rip), %rdi     # 0x3c3d0
movq %rbp, %rsi
callq 0x11346
testb %al, %al
je 0x2b1e3
xorl %ebp, %ebp
jmp 0x2b21c
movq 0x111d6(%rip), %rsi     # 0x3c3c0
cmpq 0x111d7(%rip), %rsi     # 0x3c3c8
je 0x2b208
movq 0x8(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x111bd(%rip)     # 0x3c3c0
movb $0x1, %bpl
jmp 0x2b21c
movb $0x1, %bpl
leaq 0x111a6(%rip), %rdi     # 0x3c3b8
leaq 0x8(%rsp), %rdx
callq 0x140c6
incq 0x100cd(%rip)           # 0x3b2f0
movq 0x111a6(%rip), %rdi     # 0x3c3d0
callq 0x1148a
incq %rbx
leaq 0x101d7(%rip), %rax     # 0x3b410
cmpq (%rax), %rbx
jb 0x2b023
jmp 0x2b2ca
leaq 0x101c2(%rip), %rax     # 0x3b410
cmpq $0x0, (%rax)
je 0x2b2ca
xorl %ebx, %ebx
callq 0x29e88
movq 0x11156(%rip), %rax     # 0x3c3b8
cmpq 0x11157(%rip), %rax     # 0x3c3c0
je 0x2b2af
movq 0x1115e(%rip), %rdi     # 0x3c3d0
movq (%rax), %rsi
callq 0x11346
testb %al, %al
je 0x2b2af
movq 0x11133(%rip), %rdi     # 0x3c3b8
leaq 0x8(%rdi), %rsi
movq 0x11130(%rip), %rdx     # 0x3c3c0
cmpq %rdx, %rsi
je 0x2b2a4
subq %rsi, %rdx
callq 0x4480
movq 0x1111c(%rip), %rdx     # 0x3c3c0
addq $-0x8, %rdx
movq %rdx, 0x11111(%rip)     # 0x3c3c0
movq 0x1111a(%rip), %rdi     # 0x3c3d0
callq 0x1148a
incq %rbx
leaq 0x1014b(%rip), %rax     # 0x3b410
cmpq (%rax), %rbx
jb 0x2b256
movq 0x110e7(%rip), %rax     # 0x3c3b8
cmpq %rax, 0x110e8(%rip)     # 0x3c3c0
je 0x2b2e1
movq %rax, 0x110df(%rip)     # 0x3c3c0
movq 0x110e8(%rip), %rdi     # 0x3c3d0
testq %rdi, %rdi
je 0x2b2f3
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x110d2(%rip) # 0x3c3d0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x2b31a
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0xc0(%rsp), %rdi
callq 0x40d0
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x2b343
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4300
xorl %eax, %eax
addq $0x2c8, %rsp            # imm = 0x2C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x29cc0
xorl %edi, %edi
callq 0x4360
movq 0xfc66(%rip), %rdi      # 0x3afd0
callq 0x4170
leaq 0x8439(%rip), %rsi      # 0x337af
movl $0x1b, %edx
movq %rax, %rdi
callq 0x4340
movq 0xfc46(%rip), %rdi      # 0x3afd0
callq 0x4170
movq %rax, %rbx
leaq 0x8432(%rip), %rsi      # 0x337cb
movl $0x39, %edx
movq %rax, %rdi
callq 0x4340
movq %rbx, %rdi
callq 0x4170
movq %rax, %rdi
callq 0x4170
jmp 0x2b35c
movq 0xfc11(%rip), %rdi      # 0x3afd0
callq 0x4170
leaq 0x839b(%rip), %rsi      # 0x33766
movl $0x18, %edx
movq %rax, %rdi
callq 0x4340
movq 0xfbf1(%rip), %rdi      # 0x3afd0
callq 0x4170
movq %rax, %rbx
leaq 0x8391(%rip), %rsi      # 0x3377f
movl $0x2f, %edx
movq %rax, %rdi
callq 0x4340
movq %rbx, %rdi
callq 0x4170
movq %rax, %rdi
callq 0x4170
jmp 0x2b35c
movq 0xfbb9(%rip), %rdi      # 0x3afd0
callq 0x4170
leaq 0x83e2(%rip), %rsi      # 0x33805
movl $0x18, %edx
movq %rax, %rdi
callq 0x4340
movq 0xfb99(%rip), %rdi      # 0x3afd0
callq 0x4170
movq %rax, %rbx
leaq 0x83d8(%rip), %rsi      # 0x3381e
movl $0x1a, %edx
movq %rax, %rdi
callq 0x4340
leaq 0xffee(%rip), %rax      # 0x3b448
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbx, %rdi
callq 0x4340
movq %rax, %rbx
leaq 0x667f(%rip), %rsi      # 0x31af2
movl $0x1, %edx
movq %rax, %rdi
callq 0x4340
movq %rbx, %rdi
callq 0x4170
movq %rax, %rdi
callq 0x4170
jmp 0x2b35c
movq 0xfb34(%rip), %rdi      # 0x3afd0
callq 0x4170
leaq 0x8267(%rip), %rsi      # 0x3370f
movl $0x19, %edx
movq %rax, %rdi
callq 0x4340
movq 0xfb14(%rip), %rdi      # 0x3afd0
callq 0x4170
movq %rax, %rbx
leaq 0x825e(%rip), %rsi      # 0x33729
movl $0x3c, %edx
movq %rax, %rdi
callq 0x4340
movq %rbx, %rdi
callq 0x4170
movq %rax, %rdi
callq 0x4170
jmp 0x2b35c
movq 0xfafc(%rip), %rdi      # 0x3aff0
leaq 0x4b27(%rip), %rsi      # 0x30022
movl $0x8, %edx
callq 0x4340
movq 0xfae4(%rip), %rdi      # 0x3aff0
leaq 0x80c2(%rip), %rsi      # 0x335d5
movl $0x12, %edx
callq 0x4340
movq 0xfacc(%rip), %rdi      # 0x3aff0
leaq 0x536c(%rip), %rsi      # 0x30897
movl $0x1, %edx
callq 0x4340
movq 0xfab4(%rip), %rdi      # 0x3aff0
movl $0x105, %esi            # imm = 0x105
callq 0x4500
movq %rax, %rbx
leaq 0x4af1(%rip), %rsi      # 0x30041
movl $0x4, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x82f2(%rip), %rsi      # 0x33856
movl $0x27, %edx
movq %rbx, %rdi
callq 0x4340
leaq 0xfed0(%rip), %rax      # 0x3b448
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbx, %rdi
callq 0x4340
movq %rax, %rbx
leaq 0x6561(%rip), %rsi      # 0x31af2
movl $0x1, %edx
movq %rax, %rdi
callq 0x4340
movq %rbx, %rdi
callq 0x4170
jmp 0x2b35c
jmp 0x2b627
movq %rax, %rbx
movl $0x30, %esi
movq %rbp, %rdi
jmp 0x2b60b
jmp 0x2b627
movq %rax, %rbx
movq 0x80(%rsp), %rdi
cmpq %r12, %rdi
je 0x2b5e1
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x4300
jmp 0x2b5e1
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r15, %rdi
je 0x2b603
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x4300
jmp 0x2b603
movq %rax, %rbx
movl $0x1018, %esi           # imm = 0x1018
movq %r14, %rdi
callq 0x4300
jmp 0x2b62a
jmp 0x2b627
movq %rax, %rbx
jmp 0x2b653
jmp 0x2b627
jmp 0x2b627
jmp 0x2b627
jmp 0x2b627
jmp 0x2b627
jmp 0x2b627
jmp 0x2b627
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x2b646
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0xc0(%rsp), %rdi
callq 0x40d0
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x2b66f
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4300
movq %rbx, %rdi
callq 0x4540
nop