// File: /workspace/github_cpp_makefile_star2_O1/dramninjasUMD[P]BOBSim/BOB.cpp
// Function: BOBSim::BOB::BOB()
BOB::BOB() : priorityPort(0),
	readCounter(0),
	writeCounter(0),
	committedWrites(0),
	clockCycleAdjustmentCounter(0),
	writeIssuedCB(NULL),
	rankBitWidth(log2(NUM_RANKS)),
	bankBitWidth(log2(NUM_BANKS)),
	rowBitWidth(log2(NUM_ROWS)),
	colBitWidth(log2(NUM_COLS)),
	busOffsetBitWidth(log2(BUS_ALIGNMENT_SIZE)),
	channelBitWidth(log2(NUM_CHANNELS)),
	cacheOffset(log2(CACHE_LINE_SIZE))
{
	/*
	  HACK!!! - QEMU does not support the huge memory sizes BOB can simulate.
	  Removing bits from the row address will have the least impact on function
	*/
	uint qemuMemoryBitWidth = log2_64(QEMU_MEMORY_SIZE);
	uint bitDifference = (busOffsetBitWidth + colBitWidth + rowBitWidth + channelBitWidth + rankBitWidth + bankBitWidth) - qemuMemoryBitWidth;
	rowBitWidth = rowBitWidth - bitDifference;
	//end hack


#ifdef LOG_OUTPUT
	string output_filename("BOBsim");
	if (getenv("SIM_DESC"))
		output_filename += getenv("SIM_DESC");
	output_filename += VARIANT_SUFFIX;
	output_filename += ".log";
	logOutput.open(output_filename.c_str());
#endif
	DEBUG("!!!!!!! QEMU_MEMORY_SIZE :"<<QEMU_MEMORY_SIZE<<" qemuMemoryBitWidth : "<<qemuMemoryBitWidth<<"   newRowBitWidth : "<<rowBitWidth<<"\n");
	DEBUG("busoff:"<<busOffsetBitWidth<<" col:"<<colBitWidth<<" row:"<<rowBitWidth<<" rank:"<<rankBitWidth<<" bank:"<<bankBitWidth<<" chan:"<<channelBitWidth);

	currentClockCycle = 0;

	//Compute ratios of various clock frequencies 
	if(fmod(CPU_CLK_PERIOD,LINK_BUS_CLK_PERIOD)>0.00001)
	{		
		ERROR("== ERROR - Link bus clock period ("<<LINK_BUS_CLK_PERIOD<<") must be a factor of CPU clock period ("<<CPU_CLK_PERIOD<<")");
		ERROR("==         fmod="<<fmod(CPU_CLK_PERIOD,LINK_BUS_CLK_PERIOD));
		abort(); 
	}

	LINK_CPU_CLK_RATIO = (CPU_CLK_PERIOD / LINK_BUS_CLK_PERIOD);
	cout<<"Channel to CPU ratio : "<<LINK_CPU_CLK_RATIO<<endl;
	DRAM_CPU_CLK_RATIO = tCK / CPU_CLK_PERIOD;
	cout<<"DRAM to CPU ratio : "<<DRAM_CPU_CLK_RATIO<<endl;
	DRAM_CPU_CLK_ADJUSTMENT = tCK / fmod(tCK,CPU_CLK_PERIOD);
	cout<<"DRAM_CPU_CLK_ADJUSTMENT : "<<DRAM_CPU_CLK_ADJUSTMENT<<endl;

	//Ensure that parameters have been set correclty
	if(NUM_CHANNELS / CHANNELS_PER_LINK_BUS != NUM_LINK_BUSES)
	{
		ERROR("== ERROR - Mismatch in NUM_CHANNELS and NUM_LINK_BUSES");
		exit(0);
	}

	if(DEBUG_BOB) DEBUG("== Channel-CPU clk ratio : "<<LINK_CPU_CLK_RATIO<<"  DRAM-CPU clk ratio : "<<DRAM_CPU_CLK_RATIO);

	//Make port objects
	for(unsigned i=0; i<NUM_PORTS; i++)
	{
		ports.push_back(Port(i));
	}

	//Initialize fields for bookkeeping
	inFlightRequestLinkCountdowns = vector<unsigned>(NUM_LINK_BUSES,0);
	inFlightResponseLinkCountdowns = vector<unsigned>(NUM_LINK_BUSES,0);

	inFlightRequestLink = vector<Transaction *> (NUM_LINK_BUSES, (Transaction*)(NULL));
	inFlightResponseLink = vector<Transaction *> (NUM_LINK_BUSES, (Transaction*)NULL);

	serDesBufferRequest = vector<Transaction *> (NUM_LINK_BUSES, (Transaction*)NULL);
	serDesBufferResponse = vector<Transaction *> (NUM_LINK_BUSES, (Transaction*)NULL);

	responseLinkRoundRobin = vector<unsigned> (NUM_LINK_BUSES,0);

	channelCounters = vector<unsigned>(NUM_CHANNELS,0);
	channelCountersLifetime = vector<uint64_t>(NUM_CHANNELS,0);

	portInputBufferAvg = vector<uint> (NUM_PORTS, 0);
	portOutputBufferAvg = vector<uint> (NUM_PORTS, 0);

	requestLinkIdle = vector<unsigned> (NUM_LINK_BUSES,0);
	responseLinkIdle = vector<unsigned> (NUM_LINK_BUSES,0);

	cmdQFull = vector<uint>(NUM_CHANNELS,0);

	//Define callback function
	Callback<BOB, void, BusPacket*, unsigned> *reportCallback = new Callback<BOB, void, BusPacket*, unsigned>(this, &BOB::ReportCallback);

	//Create channels
	channels.reserve(NUM_CHANNELS);
	for(unsigned i=0; i<NUM_CHANNELS; i++)
	{
		channels.push_back(new DRAMChannel(i,reportCallback));
	}

	//Used for round-robin
	priorityLinkBus = vector<unsigned>(NUM_PORTS,0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %r14
leaq 0x15191(%rip), %rax     # 0x18b08
movq %rax, (%rdi)
leaq 0x10(%rdi), %rdi
leaq 0x28(%r14), %r15
leaq 0x40(%r14), %rax
movq %rax, 0x98(%rsp)
leaq 0x58(%r14), %rax
movq %rax, 0x90(%rsp)
leaq 0x88(%r14), %rax
movq %rax, 0x88(%rsp)
leaq 0xa0(%r14), %rax
movq %rax, 0x80(%rsp)
leaq 0xb8(%r14), %rax
movq %rax, 0xb0(%rsp)
leaq 0xd0(%r14), %rax
movq %rax, 0xc0(%rsp)
leaq 0xe8(%r14), %rax
movq %rax, 0xd0(%rsp)
leaq 0x100(%r14), %rax
movq %rax, 0x78(%rsp)
leaq 0x118(%r14), %rax
movq %rax, 0xa8(%rsp)
leaq 0x130(%r14), %rax
movq %rax, 0xb8(%rsp)
leaq 0x148(%r14), %rax
movq %rax, 0xc8(%rsp)
leaq 0x160(%r14), %rax
movq %rax, 0x70(%rsp)
movq $0x0, 0x1d8(%r14)
leaq 0x178(%r14), %rax
movq %rax, 0xa0(%rsp)
leaq 0x198(%r14), %rax
movq %rax, 0x60(%rsp)
leaq 0x1b0(%r14), %rax
movq %rax, 0x68(%rsp)
xorl %ebp, %ebp
movl $0x184, %edx            # imm = 0x184
movq %rdi, 0x50(%rsp)
xorl %esi, %esi
callq 0x30f0
xorps %xmm0, %xmm0
movups %xmm0, 0x198(%r14)
movups %xmm0, 0x1a8(%r14)
movups %xmm0, 0x1b8(%r14)
movups %xmm0, 0x1c4(%r14)
movaps 0xf577(%rip), %xmm0     # 0x13010
movups %xmm0, 0x1e0(%r14)
movaps 0xf578(%rip), %xmm0     # 0x13020
movups %xmm0, 0x1f0(%r14)
leaq 0x157f9(%rip), %rbx     # 0x192b0
movq (%rbx), %rax
bsrq %rax, %r12
cmpq $0x2, %rax
cmovbl %ebp, %r12d
movl $0x1, %edx
movl %r12d, %ecx
shll %cl, %edx
movslq %edx, %rcx
cmpq %rax, %rcx
adcl $0x0, %r12d
leal -0x16(%r12), %eax
movl %eax, 0x1e8(%r14)
leaq 0x156e7(%rip), %r13     # 0x191d4
cmpl $0x0, (%r13)
je 0x3ba6
movq 0x154c9(%rip), %rdi     # 0x18fc8
leaq 0xf602(%rip), %rsi      # 0x13108
movl $0x1a, %edx
callq 0x3200
movq (%rbx), %rsi
movq 0x154ae(%rip), %rdi     # 0x18fc8
callq 0x3120
movq %rax, %rbx
leaq 0xf5fa(%rip), %rsi      # 0x13123
movl $0x16, %edx
movq %rax, %rdi
callq 0x3200
movl %r12d, %esi
movq %rbx, %rdi
callq 0x3120
movq %rax, %rbx
leaq 0xf5ef(%rip), %rsi      # 0x1313a
movl $0x14, %edx
movq %rax, %rdi
callq 0x3200
movl 0x1e8(%r14), %esi
movq %rbx, %rdi
callq 0x3120
movq %rax, %r12
leaq 0xfa6e(%rip), %rsi      # 0x135df
movl $0x1, %edx
movq %rax, %rdi
callq 0x3200
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31b0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
cmpl $0x0, (%r13)
je 0x3cc4
movq 0x15410(%rip), %rdi     # 0x18fc8
leaq 0xf590(%rip), %rsi      # 0x1314f
movl $0x7, %edx
callq 0x3200
movl 0x1f0(%r14), %esi
movq 0x153f1(%rip), %rdi     # 0x18fc8
callq 0x3120
movq %rax, %rbx
leaq 0xf571(%rip), %rsi      # 0x13157
movl $0x5, %edx
movq %rax, %rdi
callq 0x3200
movl 0x1ec(%r14), %esi
movq %rbx, %rdi
callq 0x3120
movq %rax, %rbx
leaq 0xf551(%rip), %rsi      # 0x1315d
movl $0x5, %edx
movq %rax, %rdi
callq 0x3200
movl 0x1e8(%r14), %esi
movq %rbx, %rdi
callq 0x3120
movq %rax, %rbx
leaq 0xf531(%rip), %rsi      # 0x13163
movl $0x6, %edx
movq %rax, %rdi
callq 0x3200
movl 0x1e0(%r14), %esi
movq %rbx, %rdi
callq 0x3120
movq %rax, %rbx
leaq 0xf512(%rip), %rsi      # 0x1316a
movl $0x6, %edx
movq %rax, %rdi
callq 0x3200
movl 0x1e4(%r14), %esi
movq %rbx, %rdi
callq 0x3120
movq %rax, %rbx
leaq 0xf4f3(%rip), %rsi      # 0x13171
movl $0x6, %edx
movq %rax, %rdi
callq 0x3200
movl 0x1f4(%r14), %esi
movq %rbx, %rdi
callq 0x3120
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x31b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq $0x0, 0x8(%r14)
movl $0x1, 0x155c2(%rip)     # 0x19298
movq 0x152eb(%rip), %rdi     # 0x18fc8
leaq 0xf4aa(%rip), %rsi      # 0x1318e
movl $0x17, %edx
callq 0x3200
movl 0x155a4(%rip), %esi     # 0x19298
movq 0x152cd(%rip), %rdi     # 0x18fc8
callq 0x3120
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x31b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movl $0x4, 0x15568(%rip)     # 0x1929c
movq 0x1528d(%rip), %rdi     # 0x18fc8
leaq 0xf464(%rip), %rsi      # 0x131a6
movl $0x14, %edx
callq 0x3200
movl 0x1554a(%rip), %esi     # 0x1929c
movq 0x1526f(%rip), %rdi     # 0x18fc8
callq 0x3120
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x31b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movl $0x6, 0x1550e(%rip)     # 0x192a0
movq 0x1522f(%rip), %rdi     # 0x18fc8
leaq 0xf41b(%rip), %rsi      # 0x131bb
movl $0x1a, %edx
callq 0x3200
movl 0x154f0(%rip), %esi     # 0x192a0
movq 0x15211(%rip), %rdi     # 0x18fc8
callq 0x3120
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x31b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
leaq 0x153e3(%rip), %rax     # 0x191d0
cmpl $0x0, (%rax)
movq 0x50(%rsp), %rbp
je 0x3e52
xorl %r12d, %r12d
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movl %r12d, %esi
callq 0xeea2
movq %rbp, %rdi
movq %r13, %rsi
callq 0x7134
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x3e2c
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x3e43
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x31f0
incl %r12d
leaq 0x15383(%rip), %rax     # 0x191d0
cmpl (%rax), %r12d
jb 0x3dff
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x10, %edi
callq 0x31d0
leaq 0x10(%rsp), %rbx
movq %rax, (%rbx)
movq %rax, 0x8(%rbx)
movq %rax, %rcx
addq $0x10, %rcx
movq %rcx, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rcx, 0x8(%rbx)
movq 0xd0(%rsp), %rdi
movq %rbx, %rsi
callq 0x7422
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3eb3
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x31f0
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x10, %edi
callq 0x31d0
leaq 0x10(%rsp), %rbx
movq %rax, (%rbx)
movq %rax, 0x8(%rbx)
movq %rax, %rcx
addq $0x10, %rcx
movq %rcx, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rcx, 0x8(%rbx)
movq 0xc8(%rsp), %rdi
movq %rbx, %rsi
callq 0x7422
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3f14
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x31f0
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x20, %edi
callq 0x31d0
leaq 0x10(%rsp), %rbx
movq %rax, (%rbx)
movq %rax, 0x8(%rbx)
movq %rax, %rcx
addq $0x20, %rcx
movq %rcx, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %rcx, 0x8(%rbx)
movq 0xc0(%rsp), %rdi
movq %rbx, %rsi
callq 0x747e
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3f79
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x31f0
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x20, %edi
callq 0x31d0
leaq 0x10(%rsp), %rbx
movq %rax, (%rbx)
movq %rax, 0x8(%rbx)
movq %rax, %rcx
addq $0x20, %rcx
movq %rcx, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %rcx, 0x8(%rbx)
movq 0xb8(%rsp), %rdi
movq %rbx, %rsi
callq 0x747e
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3fde
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x31f0
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x20, %edi
callq 0x31d0
leaq 0x10(%rsp), %rbx
movq %rax, (%rbx)
movq %rax, 0x8(%rbx)
movq %rax, %rcx
addq $0x20, %rcx
movq %rcx, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %rcx, 0x8(%rbx)
movq 0xb0(%rsp), %rdi
movq %rbx, %rsi
callq 0x747e
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x4043
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x31f0
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x20, %edi
callq 0x31d0
leaq 0x10(%rsp), %rbx
movq %rax, (%rbx)
movq %rax, 0x8(%rbx)
movq %rax, %rcx
addq $0x20, %rcx
movq %rcx, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %rcx, 0x8(%rbx)
movq 0xa8(%rsp), %rdi
movq %rbx, %rsi
callq 0x747e
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x40a8
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x31f0
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x10, %edi
callq 0x31d0
leaq 0x10(%rsp), %rbx
movq %rax, (%rbx)
movq %rax, 0x8(%rbx)
movq %rax, %rcx
addq $0x10, %rcx
movq %rcx, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rcx, 0x8(%rbx)
movq 0xa0(%rsp), %rdi
movq %rbx, %rsi
callq 0x7422
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x4109
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x31f0
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x20, %edi
callq 0x31d0
leaq 0x10(%rsp), %rbx
movq %rax, (%rbx)
movq %rax, 0x8(%rbx)
movq %rax, %rcx
addq $0x20, %rcx
movq %rcx, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %rcx, 0x8(%rbx)
movq 0x98(%rsp), %rdi
movq %rbx, %rsi
callq 0x7422
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x416e
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x31f0
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x40, %edi
callq 0x31d0
leaq 0x10(%rsp), %rbx
movq %rax, (%rbx)
movq %rax, 0x8(%rbx)
movq %rax, %rcx
addq $0x40, %rcx
movq %rcx, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %rcx, 0x8(%rbx)
movq 0x90(%rsp), %rdi
movq %rbx, %rsi
callq 0x74be
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x41db
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x31f0
leaq 0x14fee(%rip), %rax     # 0x191d0
movl (%rax), %esi
leaq 0x5c(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rcx
callq 0x6f9c
leaq 0x10(%rsp), %rbx
movq 0x88(%rsp), %rdi
movq %rbx, %rsi
callq 0x7422
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x4228
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x31f0
leaq 0x14fa1(%rip), %rax     # 0x191d0
movl (%rax), %esi
leaq 0x5c(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rcx
callq 0x6f9c
leaq 0x10(%rsp), %rbx
movq 0x80(%rsp), %rdi
movq %rbx, %rsi
callq 0x7422
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x4275
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x31f0
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x10, %edi
callq 0x31d0
leaq 0x10(%rsp), %rbx
movq %rax, (%rbx)
movq %rax, 0x8(%rbx)
movq %rax, %rcx
addq $0x10, %rcx
movq %rcx, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rcx, 0x8(%rbx)
movq 0x78(%rsp), %rdi
movq %rbx, %rsi
callq 0x7422
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x42d3
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x31f0
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x10, %edi
callq 0x31d0
leaq 0x10(%rsp), %rbx
movq %rax, (%rbx)
movq %rax, 0x8(%rbx)
movq %rax, %rcx
addq $0x10, %rcx
movq %rcx, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rcx, 0x8(%rbx)
movq 0x70(%rsp), %rdi
movq %rbx, %rsi
callq 0x7422
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x4331
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x31f0
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x20, %edi
callq 0x31d0
leaq 0x10(%rsp), %rbx
movq %rax, (%rbx)
movq %rax, 0x8(%rbx)
movq %rax, %rcx
addq $0x20, %rcx
movq %rcx, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %rcx, 0x8(%rbx)
movq 0x68(%rsp), %rdi
movq %rbx, %rsi
callq 0x7422
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x4393
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x31f0
movl $0x20, %edi
callq 0x31d0
movq %rax, %r12
leaq 0x147a1(%rip), %rax     # 0x18b48
movq %rax, (%r12)
movq %r14, 0x8(%r12)
leaq 0x2ff(%rip), %rax       # 0x46b6
movq %rax, 0x10(%r12)
movq $0x0, 0x18(%r12)
movl $0x8, %esi
movq %r15, %rdi
callq 0x701a
xorl %r13d, %r13d
leaq 0x10(%rsp), %rbp
movl $0x280, %edi            # imm = 0x280
callq 0x31d0
movq %rax, %rbx
movq %rax, %rdi
movl %r13d, %esi
movq %r12, %rdx
callq 0xcd02
movq %rbx, 0x10(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
callq 0x7544
incl %r13d
cmpl $0x8, %r13d
jne 0x43da
leaq 0x14dbb(%rip), %rax     # 0x191d0
movl (%rax), %esi
leaq 0x5c(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rcx
callq 0x6f9c
leaq 0x10(%rsp), %rbx
movq 0x60(%rsp), %rdi
movq %rbx, %rsi
callq 0x7422
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x4458
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x31f0
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x44b2
jmp 0x448a
jmp 0x448a
jmp 0x448a
jmp 0x448a
jmp 0x448a
jmp 0x448a
jmp 0x448a
jmp 0x448a
jmp 0x448a
jmp 0x448a
jmp 0x448a
jmp 0x448a
jmp 0x448a
jmp 0x448a
jmp 0x44b2
movq %rax, %r12
jmp 0x44ba
movq %rax, %r12
leaq 0x10(%rsp), %rdi
callq 0x6f6a
jmp 0x44ba
jmp 0x44b2
movq %rax, %r12
movl $0x280, %esi            # imm = 0x280
movq %rbx, %rdi
callq 0x31f0
jmp 0x44b5
movq %rax, %r12
movq 0x50(%rsp), %rbp
movq 0x68(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x44d6
movq 0x1c0(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0x60(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x44f2
movq 0x1a8(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0xa0(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x4511
movq 0x188(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0x70(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x452d
movq 0x170(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0xc8(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x454c
movq 0x158(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0xb8(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x456b
movq 0x140(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0xa8(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x458a
movq 0x128(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0x78(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x45a6
movq 0x110(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0xd0(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x45c5
movq 0xf8(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0xc0(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x45e4
movq 0xe0(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0xb0(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x4603
movq 0xc8(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0x80(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x4622
movq 0xb0(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0x88(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x4641
movq 0x98(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0x70(%r14), %rdi
testq %rdi, %rdi
je 0x4659
movq 0x80(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0x90(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x4675
movq 0x68(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0x98(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x4691
movq 0x50(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq (%r15), %rdi
testq %rdi, %rdi
je 0x46a5
movq 0x38(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq %rbp, %rdi
callq 0x70b0
movq %r12, %rdi
callq 0x3340
nop