// File: /workspace/github_cpp_makefile_star2_O2/estwings57[P]CasHMC/sources/CasHMCWrapper.cpp
// Function: CasHMC::CasHMCWrapper::CasHMCWrapper(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
CasHMCWrapper::CasHMCWrapper(string simCfg, string dramCfg)
{
	//Loading configure parameters
	ReadIniFile(simCfg);
	ReadIniFile(dramCfg);
	PushStatisPerLink();
	
	//
	//Class variable initialization
	//
	currentClockCycle = 0;
	dramTuner = 1;
	downLinkTuner = 1;
	downLinkClock = 1;
	upLinkTuner = 1;
	upLinkClock = 1;
	linkPeriod = (1/LINK_SPEED);
	
	//Make class objects
	downstreamLinks.reserve(NUM_LINKS);
	upstreamLinks.reserve(NUM_LINKS);
	for(int l=0; l<NUM_LINKS; l++) {
		downstreamLinks.push_back(new Link(debugOut, stateOut, l, true, this));
		upstreamLinks.push_back(new Link(debugOut, stateOut, l, false, this));
	}
	hmcCont = new HMCController(debugOut, stateOut);
	hmc = new HMC(debugOut, stateOut);
	
	//Link master, Link, and Link slave are linked each other by respective lanes
	for(int l=0; l<NUM_LINKS; l++) {
		//Downstream
		hmcCont->downLinkMasters[l]->linkP = downstreamLinks[l];
		hmcCont->downLinkMasters[l]->localLinkSlave = hmcCont->upLinkSlaves[l];
		downstreamLinks[l]->linkMasterP = hmcCont->downLinkMasters[l];
		downstreamLinks[l]->linkSlaveP = hmc->downLinkSlaves[l];
		hmc->downLinkSlaves[l]->downBufferDest = hmc->crossbarSwitch;
		hmc->downLinkSlaves[l]->localLinkMaster = hmc->upLinkMasters[l];
		//Upstream
		hmc->crossbarSwitch->upBufferDest[l] = hmc->upLinkMasters[l];
		hmc->upLinkMasters[l]->linkP = upstreamLinks[l];
		hmc->upLinkMasters[l]->localLinkSlave = hmc->downLinkSlaves[l];
		upstreamLinks[l]->linkMasterP = hmc->upLinkMasters[l];
		upstreamLinks[l]->linkSlaveP = hmcCont->upLinkSlaves[l];
		hmcCont->upLinkSlaves[l]->upBufferDest = hmcCont;
		hmcCont->upLinkSlaves[l]->localLinkMaster = hmcCont->downLinkMasters[l];
	}

	//Check CPU clock cycle and link speed
	if(CPU_CLK_PERIOD < linkPeriod) {	//Check CPU clock cycle and link speed
		ERROR(" == Error - WRONG CPU clock cycle or link speed (CPU_CLK_PERIOD should be bigger than (1/LINK_SPEED))");
		ERROR(" == Error - CPU_CLK_PERIOD : "<<CPU_CLK_PERIOD<<"  1/LINK_SPEED : "<<linkPeriod);
		exit(0);
	}
	
	//
	// Log files generation
	//
	int status_rst = 1;
	int status_grp = 1;
	status_rst = mkdir("result", S_IRWXU | S_IRWXG | S_IROTH | S_IWOTH | S_IXOTH);
	status_grp = mkdir("graph", S_IRWXU | S_IRWXG | S_IROTH | S_IWOTH | S_IXOTH);
	
	time_t now;
    struct tm t;
    time(&now);
    t = *localtime(&now);
	
	cout<<endl<<"****************************************************************"<<endl;
	cout<<"*                      CasHMC version 1.3                      *"<<endl;
	cout<<"*            Date : "<<t.tm_year + 1900<<"/"<<setw(2)<<setfill('0')<<t.tm_mon+1<<"/"<<setw(2)<<setfill('0')<<t.tm_mday
			<<"      Time : "<<setw(2)<<setfill('0')<<t.tm_hour<<":"<<setw(2)<<setfill('0')<<t.tm_min<<":"<<setw(2)<<setfill('0')<<t.tm_sec
			<<"            *"<<endl;
#ifndef DEBUG_LOG		
	cout<<"*                                                              *"<<endl;
	cout<<"*  Module abbreviation info.                                   *"<<endl;
	cout<<"*  [HC]   : HMC Controller                                     *"<<endl;
	cout<<"*  [LM_U/Di] : ith Up/Downstream Link Master                   *"<<endl;
	cout<<"*  [LK_U/Di] : ith Up/Downstream Link                          *"<<endl;
	cout<<"*  [LS_U/Di] : ith Up/Downstream Link Slave                    *"<<endl;
	cout<<"*  [CS]   : Crossbar Switch                                    *"<<endl;
	cout<<"*  [VC_j] : jth Vault Controller                               *"<<endl;
	cout<<"*  [CQ_k] : k-bank Command Queue                               *"<<endl;
	cout<<"*  [DR_j] : jth DRAM                                           *"<<endl;
#endif		
	cout<<"****************************************************************"<<endl<<endl;
	cout.setf(ios::left); 
	cout<<" = Log folder generating information"<<endl;
	if(status_rst == 0) {
		cout<<"   Making result folder success (./result/)"<<endl;
	}
	else {
		if(errno == EEXIST) {
			cout<<"   Result folder already exists (./result/)"<<endl;
			status_rst = 0;
		}
		else {
			cout<<"   Making result folder fail"<<endl;
			cout<<"   Debug and result files will be generated in CasHMC folder (./)"<<endl<<endl;
		}
	}
	if(status_grp == 0) {
		cout<<"   Making graph folder success (./graph/)"<<endl;
	}
	else {
		if(errno == EEXIST) {
			cout<<"   Graph folder already exists (./graph/)"<<endl;
			status_grp = 0;
		}
		else {
			cout<<"   Making graph folder fail"<<endl;
			cout<<"   graph files will be generated in CasHMC folder (./)"<<endl<<endl;
		}
	}
	
	if(status_rst == 0)
		logName = "result/CasHMC";
	else
		logName = "CasHMC";
	
	string plotName;
	if(status_grp == 0)
		plotName = "graph/CasHMC_plot_no";
	else
		plotName = "CasHMC_plot_no";

	unsigned int ver_num = 0;
	stringstream temp_vn;
	while(1) { 
		logName += "_no";
		temp_vn << ver_num;
		logName += temp_vn.str();
		logName += "_setting.log";
		
		if(access(logName.c_str(), 0) == -1)	break;
		else {
			logName.erase(logName.find("_no"));
			temp_vn.str( string() );
			temp_vn.clear();
			ver_num++;
		}
	}
	cout.setf(ios::left);
	cout<<endl<<"   === Simulation start === "<<endl;
	
	if(BANDWIDTH_PLOT) {
		hmcTransmitSizeTemp = 0;
		downLinkDataSizeTemp = vector<uint64_t>(NUM_LINKS, 0);
		upLinkDataSizeTemp = vector<uint64_t>(NUM_LINKS, 0);
		
		//Plot data file initialization
		plotName += temp_vn.str();
		plotName += ".dat";
		plotDataOut.open(plotName.c_str());
		plotDataOut.setf(ios::left);
		cout<<"  [ "<<plotName<<" ] is generated"<<endl;
		
		plotDataOut<<setw(8)<<setfill(' ')<<"#Epoch";
		for(int i=0; i<NUM_LINKS; i++) {
			stringstream linkNum;
			linkNum << i;
			string plotLink = "Link[" + linkNum.str() + ']';
			plotDataOut<<setw(10)<<setfill(' ')<<plotLink;
		}
		plotDataOut<<setw(10)<<setfill(' ')<<"HMC bandwidth"<<endl;
		
		//Plot script file initialization
		plotName.erase(plotName.find(".dat"));
		plotName += ".gnuplot";
		plotScriptOut.open(plotName.c_str());
		cout<<"  [ "<<plotName<<" ] is generated"<<endl;
		
		plotName = "CasHMC_plot_no";
		plotName += temp_vn.str();
		plotName += ".png";
		
		plotScriptOut<<"set term png size 800, 500 font \"Times-Roman,\""<<endl;
		plotScriptOut<<"set output '"<<plotName<<"'"<<endl;
		plotScriptOut<<"set title \"CasHMC bandwidth graph\" font \",18\""<<endl;
		plotScriptOut<<"set autoscale"<<endl;
		plotScriptOut<<"set grid"<<endl;
		plotScriptOut<<"set xlabel \"Simulation plot epoch\""<<endl;
		plotScriptOut<<"set ylabel \"Bandwidth [GB/s]\""<<endl;
		plotScriptOut<<"set key left box"<<endl;
		plotScriptOut<<"plot  \"CasHMC_plot_no"<<ver_num<<".dat\" using 1:"<<NUM_LINKS+2<<" title 'HMC' with lines lw 2 , \\"<<endl;
		for(int i=0; i<NUM_LINKS; i++) {
			plotScriptOut<<"      \"CasHMC_plot_no"<<ver_num<<".dat\" using 1:"<<i+2<<" title 'Link["<<i<<"]' with lines lw 1 , \\"<<endl;
		}
	}
	
	settingOut.open(logName.c_str());
	PrintSetting(t);
	cout<<"  [ "<<logName<<" ] is generated"<<endl;
	
	logName.erase(logName.find("_s"));
	logNum = 0;
	PrintEpochHeader();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4e8, %rsp            # imm = 0x4E8
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0xd010
leaq 0x2ac92(%rip), %rax     # 0x30918
movq %rax, (%r15)
leaq 0x338(%r15), %rax
movq %rax, 0x80(%rsp)
leaq 0x350(%r15), %rax
movq %rax, 0x78(%rsp)
leaq 0x3b8(%r15), %rax
xorpd %xmm0, %xmm0
movupd %xmm0, 0x338(%r15)
movupd %xmm0, 0x348(%r15)
movupd %xmm0, 0x358(%r15)
movq %rax, 0x3a8(%r15)
andq $0x0, 0x3b0(%r15)
leaq 0x3a8(%r15), %rax
movq %rax, 0x48(%rsp)
movb $0x0, 0x3b8(%r15)
leaq 0x3e8(%r15), %rax
movq %rax, 0xb0(%rsp)
leaq 0x400(%r15), %rax
movq %rax, 0xa8(%rsp)
leaq 0x418(%r15), %rdi
movupd %xmm0, 0x3e8(%r15)
movupd %xmm0, 0x3f8(%r15)
movupd %xmm0, 0x408(%r15)
movq %rdi, 0xb8(%rsp)
movq %r15, 0x38(%rsp)
callq 0x44e0
leaq 0x618(%r15), %rdi
movq %rdi, 0x60(%rsp)
callq 0x44e0
leaq 0x818(%r15), %rdi
movq %rdi, 0x58(%rsp)
callq 0x44e0
leaq 0xa18(%r15), %rdi
movq %rdi, 0x50(%rsp)
callq 0x44e0
leaq 0xc18(%r15), %rdi
movq %rdi, 0x40(%rsp)
callq 0x44e0
leaq 0xe18(%r15), %rdi
movq %rdi, 0xd0(%rsp)
callq 0x44e0
leaq 0x198(%rsp), %rdi
movq %r14, %rsi
callq 0x43e0
leaq 0x198(%rsp), %rdi
callq 0x118d4
leaq 0x198(%rsp), %rdi
callq 0x4598
leaq 0x178(%rsp), %rdi
movq %rbx, %rsi
callq 0x43e0
leaq 0x178(%rsp), %rdi
callq 0x118d4
leaq 0x178(%rsp), %rdi
callq 0x4598
movq 0x38(%rsp), %rdi
callq 0xd890
movq 0x38(%rsp), %rcx
andq $0x0, 0x370(%rcx)
pushq $0x1
popq %rax
movq %rax, 0x378(%rcx)
movq %rax, 0x380(%rcx)
movq %rax, 0x388(%rcx)
movq %rax, 0x390(%rcx)
movq %rax, 0x398(%rcx)
leaq 0x2b681(%rip), %rax     # 0x314b0
movsd 0x1e279(%rip), %xmm0    # 0x240b0
divsd (%rax), %xmm0
movsd %xmm0, 0x3a0(%rcx)
leaq 0x2b65e(%rip), %r12     # 0x314a8
movslq (%r12), %rsi
movq 0x80(%rsp), %rdi
callq 0xdb9c
movslq (%r12), %rsi
movq 0x78(%rsp), %rdi
callq 0xdb9c
xorl %ebx, %ebx
pushq $0x1
popq %rbp
leaq 0x360(%rsp), %r14
cmpl (%r12), %ebx
jge 0x5f06
movl $0x200, %edi            # imm = 0x200
callq 0x4310
movq %rax, %r15
movq %rax, %rdi
movq 0x60(%rsp), %rsi
movq 0x58(%rsp), %rdx
movl %ebx, %ecx
movl %ebp, %r8d
movq 0x38(%rsp), %r9
callq 0x195bc
movq %r15, 0x360(%rsp)
movq 0x80(%rsp), %rdi
movq %r14, %rsi
callq 0xe85e
movl $0x200, %edi            # imm = 0x200
callq 0x4310
movq %rax, %r15
movq %rax, %rdi
movq 0x60(%rsp), %rsi
movq 0x58(%rsp), %rdx
movl %ebx, %ecx
xorl %r8d, %r8d
movq 0x38(%rsp), %r9
callq 0x195bc
movq %r15, 0x360(%rsp)
movq 0x78(%rsp), %rdi
movq %r14, %rsi
callq 0xe85e
incl %ebx
jmp 0x5e76
movl $0x360, %edi            # imm = 0x360
callq 0x4310
movq %rax, %rbx
movq %rax, %rdi
movq 0x60(%rsp), %rsi
movq 0x58(%rsp), %rdx
callq 0x165e0
movq 0x38(%rsp), %rax
movq %rbx, 0x330(%rax)
movl $0x238, %edi            # imm = 0x238
callq 0x4310
movq %rax, %rbx
movq %rax, %rdi
movq 0x60(%rsp), %rsi
movq 0x58(%rsp), %rdx
callq 0x15730
movq 0x38(%rsp), %rax
movq %rbx, 0x368(%rax)
movl (%r12), %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
movq 0x38(%rsp), %r10
cmpq %rcx, %rax
je 0x608e
movq 0x330(%r10), %rdx
movq 0x338(%r10), %rsi
movq (%rsi,%rcx,8), %rdi
movq 0x208(%rdx), %r8
movq (%r8,%rcx,8), %r9
movq %rdi, 0x210(%r9)
movq 0x220(%rdx), %rdx
movq (%rdx,%rcx,8), %rdx
movq (%r8,%rcx,8), %rdi
movq %rdx, 0x218(%rdi)
movq (%r8,%rcx,8), %rdx
movq (%rsi,%rcx,8), %rdi
movq %rdx, 0x1d8(%rdi)
movq 0x1d0(%rbx), %rdx
movq (%rdx,%rcx,8), %rdi
movq (%rsi,%rcx,8), %rsi
movq %rdi, 0x1e8(%rsi)
movq 0x200(%rbx), %rsi
movq %rsi, 0x208(%rdi)
movq 0x1e8(%rbx), %rdi
movq (%rdi,%rcx,8), %rdi
movq (%rdx,%rcx,8), %rdx
movq %rdi, 0x218(%rdx)
movq 0x220(%rsi), %rdx
movq %rdi, (%rdx,%rcx,8)
movq 0x350(%r10), %rdx
movq 0x368(%r10), %rbx
movq (%rdx,%rcx,8), %rsi
movq 0x1e8(%rbx), %rdi
movq (%rdi,%rcx,8), %r8
movq %rsi, 0x210(%r8)
movq 0x1d0(%rbx), %rsi
movq (%rsi,%rcx,8), %rsi
movq (%rdi,%rcx,8), %r8
movq %rsi, 0x218(%r8)
movq (%rdi,%rcx,8), %rsi
movq (%rdx,%rcx,8), %rdi
movq %rsi, 0x1d8(%rdi)
movq 0x330(%r10), %rsi
movq 0x220(%rsi), %rdi
movq (%rdi,%rcx,8), %r8
movq (%rdx,%rcx,8), %rdx
movq %r8, 0x1e8(%rdx)
movq %rsi, 0x210(%r8)
movq 0x208(%rsi), %rdx
movq (%rdx,%rcx,8), %rdx
movq (%rdi,%rcx,8), %rsi
movq %rdx, 0x218(%rsi)
incq %rcx
jmp 0x5f6c
leaq 0x2b403(%rip), %rbx     # 0x31498
movq 0x38(%rsp), %rax
movsd 0x3a0(%rax), %xmm0
ucomisd (%rbx), %xmm0
ja 0x6d1c
leaq 0x1e183(%rip), %rdi     # 0x24236
movl $0x1ff, %esi            # imm = 0x1FF
callq 0x4160
movl %eax, %r15d
leaq 0x1e176(%rip), %rdi     # 0x2423d
movl $0x1ff, %esi            # imm = 0x1FF
callq 0x4160
movl %eax, %r14d
leaq 0x170(%rsp), %rbx
movq %rbx, %rdi
callq 0x42c0
movq %rbx, %rdi
callq 0x4250
movl (%rax), %ecx
movl %ecx, 0x68(%rsp)
movl 0x4(%rax), %ecx
movl %ecx, 0x6c(%rsp)
movl 0x8(%rax), %ecx
movl %ecx, 0x70(%rsp)
movl 0xc(%rax), %ecx
movl %ecx, 0x74(%rsp)
movl 0x10(%rax), %ecx
movq %rcx, 0xc0(%rsp)
movl 0x14(%rax), %ecx
movq %rcx, 0xc8(%rsp)
movups 0x28(%rax), %xmm0
movaps %xmm0, 0x120(%rsp)
movupd 0x18(%rax), %xmm0
movapd %xmm0, 0x110(%rsp)
movq 0x2ae92(%rip), %rdi     # 0x30fd0
callq 0x4180
leaq 0x1e0f9(%rip), %rsi     # 0x24243
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq 0x2ae6f(%rip), %rdi     # 0x30fd0
leaq 0x1e11c(%rip), %rsi     # 0x24284
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq 0x2ae54(%rip), %rdi     # 0x30fd0
leaq 0x1e142(%rip), %rsi     # 0x242c5
callq 0x4300
movq 0xc8(%rsp), %rcx
leal 0x76c(%rcx), %esi
movq %rax, %rdi
callq 0x44f0
leaq 0x1e135(%rip), %rsi     # 0x242da
movq %rax, %rdi
callq 0x4300
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0x2, 0x10(%rax,%rcx)
pushq $0x30
popq %rsi
movq %rax, %rdi
callq 0x4440
movq 0xc0(%rsp), %rcx
leal 0x1(%rcx), %esi
movq %rax, %rdi
callq 0x44f0
leaq 0x1e0f8(%rip), %rsi     # 0x242da
movq %rax, %rdi
callq 0x4300
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0x2, 0x10(%rax,%rcx)
pushq $0x30
popq %rsi
movq %rax, %rdi
callq 0x4440
movq %rax, %rdi
movl 0x74(%rsp), %esi
callq 0x44f0
leaq 0x1e0c4(%rip), %rsi     # 0x242dc
movq %rax, %rdi
callq 0x4300
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0x2, 0x10(%rax,%rcx)
pushq $0x30
popq %rsi
movq %rax, %rdi
callq 0x4440
movq %rax, %rdi
movl 0x70(%rsp), %esi
callq 0x44f0
leaq 0x1e629(%rip), %rsi     # 0x24877
movq %rax, %rdi
callq 0x4300
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0x2, 0x10(%rax,%rcx)
pushq $0x30
popq %rsi
movq %rax, %rdi
callq 0x4440
movq %rax, %rdi
movl 0x6c(%rsp), %esi
callq 0x44f0
leaq 0x1e5f3(%rip), %rsi     # 0x24877
movq %rax, %rdi
callq 0x4300
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0x2, 0x10(%rax,%rcx)
pushq $0x30
popq %rsi
movq %rax, %rdi
callq 0x4440
movq %rax, %rdi
movl 0x68(%rsp), %esi
callq 0x44f0
leaq 0x1e063(%rip), %rsi     # 0x2431d
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq 0x2acff(%rip), %rdi     # 0x30fd0
leaq 0x1e012(%rip), %rsi     # 0x242ea
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq 0x2ace4(%rip), %rdi     # 0x30fd0
leaq 0x1e038(%rip), %rsi     # 0x2432b
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq 0x2acc9(%rip), %rdi     # 0x30fd0
leaq 0x1e05e(%rip), %rsi     # 0x2436c
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq 0x2acae(%rip), %rdi     # 0x30fd0
leaq 0x1e084(%rip), %rsi     # 0x243ad
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq 0x2ac93(%rip), %rdi     # 0x30fd0
leaq 0x1e0aa(%rip), %rsi     # 0x243ee
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq 0x2ac78(%rip), %rdi     # 0x30fd0
leaq 0x1e0d0(%rip), %rsi     # 0x2442f
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq 0x2ac5d(%rip), %rdi     # 0x30fd0
leaq 0x1e0f6(%rip), %rsi     # 0x24470
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq 0x2ac42(%rip), %rdi     # 0x30fd0
leaq 0x1e11c(%rip), %rsi     # 0x244b1
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq 0x2ac27(%rip), %rdi     # 0x30fd0
leaq 0x1e142(%rip), %rsi     # 0x244f2
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq 0x2ac0c(%rip), %rdi     # 0x30fd0
leaq 0x1e168(%rip), %rsi     # 0x24533
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq 0x2abf1(%rip), %rbx     # 0x30fd0
leaq 0x1de5d(%rip), %rsi     # 0x24243
movq %rbx, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq %rax, %rdi
callq 0x4180
movq (%rbx), %rax
movq -0x18(%rax), %rax
orl $0x20, 0x18(%rbx,%rax)
leaq 0x1e163(%rip), %rsi     # 0x24574
movq %rbx, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
testl %r15d, %r15d
je 0x6439
callq 0x4050
cmpl $0x11, (%rax)
jne 0x645d
leaq 0x1e18e(%rip), %rsi     # 0x245c5
jmp 0x6440
leaq 0x1e159(%rip), %rsi     # 0x24599
movq 0x2ab89(%rip), %rdi     # 0x30fd0
callq 0x4300
movq %rax, %rdi
callq 0x4180
leaq 0x1e29c(%rip), %rbx     # 0x246f7
jmp 0x64a2
movq 0x2ab6c(%rip), %rdi     # 0x30fd0
leaq 0x1e186(%rip), %rsi     # 0x245f1
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq 0x2ab51(%rip), %rdi     # 0x30fd0
leaq 0x1e188(%rip), %rsi     # 0x2460e
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq %rax, %rdi
callq 0x4180
leaq 0x1e25c(%rip), %rbx     # 0x246fe
testl %r14d, %r14d
je 0x64ba
callq 0x4050
cmpl $0x11, (%rax)
jne 0x64de
leaq 0x1e1c2(%rip), %rsi     # 0x2467a
jmp 0x64c1
leaq 0x1e18f(%rip), %rsi     # 0x24650
movq 0x2ab08(%rip), %rdi     # 0x30fd0
callq 0x4300
movq %rax, %rdi
callq 0x4180
leaq 0x1e229(%rip), %r14     # 0x24705
jmp 0x6523
movq 0x2aaeb(%rip), %rdi     # 0x30fd0
leaq 0x1e1b8(%rip), %rsi     # 0x246a4
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq 0x2aad0(%rip), %rdi     # 0x30fd0
leaq 0x1e1b9(%rip), %rsi     # 0x246c0
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq %rax, %rdi
callq 0x4180
leaq 0x1e37e(%rip), %r14     # 0x248a1
movq 0x48(%rsp), %rdi
movq %rbx, %rsi
callq 0x4560
leaq 0x98(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x88(%rsp), %rdi
movq %r14, %rsi
callq 0x4560
leaq 0x360(%rsp), %rdi
callq 0x4230
xorl %r13d, %r13d
leaq 0x1e341(%rip), %r15     # 0x248ac
leaq 0x1d8(%rsp), %r12
leaq 0x1e1a0(%rip), %rbx     # 0x2471a
movq 0x48(%rsp), %rdi
movq %r15, %rsi
callq 0x4550
movl %r13d, %r14d
leaq 0x370(%rsp), %rdi
movq %r14, %rsi
callq 0x4210
movq %r12, %rdi
leaq 0x378(%rsp), %rsi
callq 0x4450
movq 0x48(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
callq 0x4570
movq %r12, %rdi
callq 0x4598
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x4550
movq 0x48(%rsp), %rbp
movq (%rbp), %rdi
xorl %esi, %esi
callq 0x44b0
cmpl $-0x1, %eax
je 0x665c
movq %rbp, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x4580
movq %rbp, %rdi
movq %rax, %rsi
pushq $-0x1
popq %rdx
callq 0x40b0
leaq 0x1e8(%rsp), %rax
movq %rax, 0x1d8(%rsp)
andq $0x0, 0x1e0(%rsp)
movb $0x0, 0x1e8(%rsp)
leaq 0x378(%rsp), %rdi
movq %r12, %rsi
callq 0x4420
movq %r12, %rdi
callq 0x4598
movq 0x360(%rsp), %rax
movq -0x18(%rax), %rdi
leaq 0x360(%rsp), %rax
addq %rax, %rdi
xorl %esi, %esi
callq 0x44d0
incl %r13d
jmp 0x657a
movq 0x2a96d(%rip), %rdi     # 0x30fd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
orl $0x20, 0x18(%rdi,%rax)
callq 0x4180
leaq 0x1e0ac(%rip), %rsi     # 0x24727
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
leaq 0x2adfe(%rip), %rax     # 0x31490
cmpb $0x1, (%rax)
jne 0x6bc3
movq 0x38(%rsp), %rax
andq $0x0, 0x3e0(%rax)
leaq 0x2adf9(%rip), %r15     # 0x314a8
movslq (%r15), %rsi
leaq 0x150(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x1d8(%rsp), %rdi
leaq 0x130(%rsp), %rcx
callq 0xdc32
leaq 0x1d8(%rsp), %rbx
movq 0xb0(%rsp), %rdi
movq %rbx, %rsi
callq 0xe706
movq %rbx, %rdi
callq 0xe66e
movslq (%r15), %rsi
leaq 0x150(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x1d8(%rsp), %rdi
leaq 0x130(%rsp), %rcx
callq 0xdc32
leaq 0x1d8(%rsp), %rbx
movq 0xa8(%rsp), %rdi
movq %rbx, %rsi
callq 0xe706
movq %rbx, %rdi
callq 0xe66e
leaq 0x1d8(%rsp), %rdi
leaq 0x378(%rsp), %rsi
callq 0x4450
leaq 0x88(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
callq 0x4570
leaq 0x1d8(%rsp), %rdi
callq 0x4598
leaq 0x1dfcf(%rip), %rsi     # 0x24744
leaq 0x88(%rsp), %rdi
callq 0x4550
movq 0x88(%rsp), %rsi
pushq $0x10
popq %rdx
movq 0x50(%rsp), %rdi
callq 0x4060
movq 0x50(%rsp), %rcx
movq (%rcx), %rax
movq -0x18(%rax), %rax
orl $0x20, 0x18(%rcx,%rax)
movq 0x2a821(%rip), %rdi     # 0x30fd0
leaq 0x1df93(%rip), %rsi     # 0x24749
callq 0x4300
leaq 0x88(%rsp), %rsi
movq %rax, %rdi
callq 0x42b0
leaq 0x1df7c(%rip), %rsi     # 0x2474e
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq 0x50(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x8, 0x10(%rdi,%rax)
pushq $0x20
popq %rsi
callq 0x4440
leaq 0x1df58(%rip), %rsi     # 0x2475e
movq %rax, %rdi
callq 0x4300
xorl %ebp, %ebp
leaq 0x1d8(%rsp), %r12
leaq 0x1b8(%rsp), %r13
leaq 0x130(%rsp), %r15
leaq 0x150(%rsp), %rbx
leaq 0x2ac71(%rip), %rax     # 0x314a8
cmpl (%rax), %ebp
jge 0x68e1
movq %r12, %rdi
callq 0x4230
leaq 0x1e8(%rsp), %rdi
movl %ebp, %esi
callq 0x44f0
movq %r13, %rdi
leaq 0x1f0(%rsp), %rsi
callq 0x4450
movq %r15, %rdi
leaq 0x1e048(%rip), %rsi     # 0x248b8
movq %r13, %rdx
callq 0xdcaa
movq %rbx, %rdi
movq %r15, %rsi
pushq $0x5d
popq %rdx
callq 0xdc88
movq %r15, %rdi
callq 0x4598
movq %r13, %rdi
callq 0x4598
movq 0x38(%rsp), %rcx
movq 0xa18(%rcx), %rax
movq -0x18(%rax), %rax
movq $0xa, 0xa28(%rcx,%rax)
movq 0x50(%rsp), %rdi
pushq $0x20
popq %rsi
callq 0x4440
movq %rax, %rdi
movq %rbx, %rsi
callq 0x42b0
movq %rbx, %rdi
callq 0x4598
movq %r12, %rdi
callq 0x4260
incl %ebp
jmp 0x6830
movq 0x50(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0xa, 0x10(%rdi,%rax)
pushq $0x20
popq %rsi
callq 0x4440
leaq 0x1de60(%rip), %rsi     # 0x24765
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
leaq 0x1de28(%rip), %rsi     # 0x24744
leaq 0x88(%rsp), %rbx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x4580
pushq $-0x1
popq %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x40b0
leaq 0x1de30(%rip), %rsi     # 0x24773
leaq 0x88(%rsp), %rdi
callq 0x4550
movq 0x88(%rsp), %rsi
pushq $0x10
popq %rdx
movq 0x40(%rsp), %rdi
callq 0x4060
movq 0x2a664(%rip), %rdi     # 0x30fd0
leaq 0x1ddd6(%rip), %rsi     # 0x24749
callq 0x4300
leaq 0x88(%rsp), %rsi
movq %rax, %rdi
callq 0x42b0
leaq 0x1ddbf(%rip), %rsi     # 0x2474e
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
leaq 0x1defb(%rip), %rsi     # 0x248a1
leaq 0x88(%rsp), %rdi
callq 0x4560
leaq 0x1d8(%rsp), %rdi
leaq 0x378(%rsp), %rsi
callq 0x4450
leaq 0x88(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
callq 0x4570
leaq 0x1d8(%rsp), %rdi
callq 0x4598
leaq 0x1dd8b(%rip), %rsi     # 0x2477c
leaq 0x88(%rsp), %rdi
callq 0x4550
leaq 0x1dd7c(%rip), %rsi     # 0x24781
movq 0x40(%rsp), %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
leaq 0x1dd92(%rip), %rsi     # 0x247b0
movq 0x40(%rsp), %rdi
callq 0x4300
leaq 0x88(%rsp), %rsi
movq %rax, %rdi
callq 0x42b0
leaq 0x1dd7c(%rip), %rsi     # 0x247bb
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
leaq 0x1dd67(%rip), %rsi     # 0x247bd
movq 0x40(%rsp), %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
leaq 0x1dd7c(%rip), %rsi     # 0x247eb
movq 0x40(%rsp), %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
leaq 0x1dd71(%rip), %rsi     # 0x247f9
movq 0x40(%rsp), %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
leaq 0x1dd61(%rip), %rsi     # 0x24802
movq 0x40(%rsp), %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
leaq 0x1dd6b(%rip), %rsi     # 0x24825
movq 0x40(%rsp), %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
leaq 0x1dd70(%rip), %rsi     # 0x24843
movq 0x40(%rsp), %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
leaq 0x1dd68(%rip), %rsi     # 0x24854
movq 0x40(%rsp), %rdi
callq 0x4300
movq %rax, %rdi
movq %r14, %rsi
callq 0x4210
leaq 0x1dd62(%rip), %rsi     # 0x2486a
movq %rax, %rdi
callq 0x4300
leaq 0x2a991(%rip), %rcx     # 0x314a8
movl (%rcx), %esi
addl $0x2, %esi
movq %rax, %rdi
callq 0x44f0
leaq 0x1dd4e(%rip), %rsi     # 0x24879
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
xorl %ebx, %ebx
leaq 0x1dd56(%rip), %r15     # 0x2489a
leaq 0x1dd1f(%rip), %r12     # 0x2486a
leaq 0x1dd5e(%rip), %r13     # 0x248b0
leaq 0x1dd65(%rip), %rbp     # 0x248be
leaq 0x2a948(%rip), %rax     # 0x314a8
cmpl (%rax), %ebx
jge 0x6bc3
movq 0x40(%rsp), %rdi
movq %r15, %rsi
callq 0x4300
movq %rax, %rdi
movq %r14, %rsi
callq 0x4210
movq %rax, %rdi
movq %r12, %rsi
callq 0x4300
addl $0x2, %ebx
movq %rax, %rdi
movl %ebx, %esi
callq 0x44f0
movq %rax, %rdi
movq %r13, %rsi
callq 0x4300
addl $-0x2, %ebx
movq %rax, %rdi
movl %ebx, %esi
callq 0x44f0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x4300
movq %rax, %rdi
callq 0x4180
incl %ebx
jmp 0x6b59
movq 0x48(%rsp), %rax
movq (%rax), %rsi
pushq $0x10
popq %rdx
movq 0xb8(%rsp), %rdi
callq 0x4060
movl 0x68(%rsp), %eax
movl %eax, 0xd8(%rsp)
movl 0x6c(%rsp), %eax
movl %eax, 0xdc(%rsp)
movl 0x70(%rsp), %eax
movl %eax, 0xe0(%rsp)
movl 0x74(%rsp), %eax
movl %eax, 0xe4(%rsp)
movq 0xc0(%rsp), %rax
movl %eax, 0xe8(%rsp)
movq 0xc8(%rsp), %rax
movl %eax, 0xec(%rsp)
movaps 0x110(%rsp), %xmm0
movaps 0x120(%rsp), %xmm1
movups %xmm0, 0xf0(%rsp)
movups %xmm1, 0x100(%rsp)
movq 0x108(%rsp), %rax
movq %rax, 0x30(%rsp)
movupd 0xd8(%rsp), %xmm0
movups 0xe8(%rsp), %xmm1
movups 0xf8(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movupd %xmm0, (%rsp)
movq 0x38(%rsp), %rdi
callq 0x6fd6
movq 0x2a345(%rip), %rdi     # 0x30fd0
leaq 0x1dab7(%rip), %rsi     # 0x24749
callq 0x4300
movq %rax, %rdi
movq 0x48(%rsp), %rsi
callq 0x42b0
leaq 0x1daa3(%rip), %rsi     # 0x2474e
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
leaq 0x1dc13(%rip), %rsi     # 0x248d5
movq 0x48(%rsp), %rbx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x4580
pushq $-0x1
popq %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x40b0
movq 0x38(%rsp), %rdi
andl $0x0, 0x3c8(%rdi)
callq 0x8026
leaq 0x360(%rsp), %rdi
callq 0x4260
leaq 0x88(%rsp), %rdi
callq 0x4598
addq $0x4e8, %rsp            # imm = 0x4E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2a2cd(%rip), %rdi     # 0x30ff0
leaq 0x1d2f8(%rip), %rsi     # 0x24022
callq 0x4300
leaq 0x1d450(%rip), %rsi     # 0x24186
movq %rax, %rdi
callq 0x4300
leaq 0x1db32(%rip), %rsi     # 0x24877
movq %rax, %rdi
callq 0x4300
pushq $0x4a
popq %rsi
movq %rax, %rdi
callq 0x44f0
leaq 0x1d2e2(%rip), %rsi     # 0x24041
movq %rax, %rdi
callq 0x4300
leaq 0x1d432(%rip), %rsi     # 0x241a0
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq 0x2a26b(%rip), %rdi     # 0x30ff0
leaq 0x1d296(%rip), %rsi     # 0x24022
callq 0x4300
leaq 0x1d3ee(%rip), %rsi     # 0x24186
movq %rax, %rdi
callq 0x4300
leaq 0x1dad0(%rip), %rsi     # 0x24877
movq %rax, %rdi
callq 0x4300
pushq $0x4b
popq %rsi
movq %rax, %rdi
callq 0x44f0
leaq 0x1d280(%rip), %rsi     # 0x24041
movq %rax, %rdi
callq 0x4300
leaq 0x1d436(%rip), %rsi     # 0x24206
movq %rax, %rdi
callq 0x4300
movsd (%rbx), %xmm0
movq %rax, %rdi
callq 0x4470
leaq 0x1d439(%rip), %rsi     # 0x24224
movq %rax, %rdi
callq 0x4300
movq 0x38(%rsp), %rcx
movsd 0x3a0(%rcx), %xmm0
movq %rax, %rdi
callq 0x4470
movq %rax, %rdi
callq 0x4180
xorl %edi, %edi
callq 0x4370
jmp 0x6f0a
jmp 0x6f29
jmp 0x6f0a
jmp 0x6f29
jmp 0x6f29
jmp 0x6f29
jmp 0x6e37
movq %rax, %r14
jmp 0x6f39
movq %rax, %r14
movl $0x238, %esi            # imm = 0x238
jmp 0x6e51
movq %rax, %r14
movl $0x360, %esi            # imm = 0x360
movq %rbx, %rdi
jmp 0x6f01
movq %rax, %r14
leaq 0x178(%rsp), %rdi
jmp 0x6f41
movq %rax, %r14
leaq 0x198(%rsp), %rdi
jmp 0x6f41
movq %rax, %r14
jmp 0x6f53
movq %rax, %r14
jmp 0x6f5d
movq %rax, %r14
jmp 0x6f67
movq %rax, %r14
jmp 0x6f71
movq %rax, %r14
jmp 0x6f7b
movq %rax, %r14
jmp 0x6f88
jmp 0x6f22
jmp 0x6f29
jmp 0x6ece
movq %rax, %r14
jmp 0x6ec4
movq %rax, %r14
leaq 0x130(%rsp), %rdi
callq 0x4598
leaq 0x1b8(%rsp), %rdi
jmp 0x6ede
movq %rax, %r14
jmp 0x6ee3
movq %rax, %r14
leaq 0x150(%rsp), %rdi
callq 0x4598
leaq 0x1d8(%rsp), %rdi
callq 0x4260
jmp 0x6f2c
jmp 0x6f0a
jmp 0x6ef6
movq %rax, %r14
movl $0x200, %esi            # imm = 0x200
movq %r15, %rdi
callq 0x4320
jmp 0x6f46
jmp 0x6f29
movq %rax, %r14
leaq 0x1d8(%rsp), %rdi
callq 0x4598
jmp 0x6f2c
jmp 0x6f29
jmp 0x6f22
jmp 0x6f22
movq %rax, %r14
jmp 0x6f46
jmp 0x6f29
movq %rax, %r14
leaq 0x360(%rsp), %rdi
callq 0x4260
leaq 0x88(%rsp), %rdi
callq 0x4598
movq 0xd0(%rsp), %rdi
callq 0x4410
movq 0x40(%rsp), %rdi
callq 0x4410
movq 0x50(%rsp), %rdi
callq 0x4410
movq 0x58(%rsp), %rdi
callq 0x4410
movq 0x60(%rsp), %rdi
callq 0x4410
movq 0xb8(%rsp), %rdi
callq 0x4410
movq 0xa8(%rsp), %rdi
callq 0xe66e
movq 0xb0(%rsp), %rdi
callq 0xe66e
movq 0x48(%rsp), %rdi
callq 0x4598
movq 0x78(%rsp), %rdi
callq 0xe7ee
movq 0x80(%rsp), %rdi
callq 0xe7ee
movq 0x38(%rsp), %rdi
callq 0xdf60
movq %r14, %rdi
callq 0x4520
nop