// File: /workspace/github_cpp_makefile_star2_O3/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 $0x68, %rsp
movq %rdi, %r14
leaq 0x151ac(%rip), %rax     # 0x18b20
movq %rax, (%rdi)
addq $0x10, %rdi
leaq 0x28(%r14), %r15
movq $0x0, 0x1d8(%r14)
xorl %ebp, %ebp
movl $0x184, %edx            # imm = 0x184
movq %rdi, 0x10(%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)
movabsq $0x300000002, %rax      # imm = 0x300000002
movq %rax, 0x1e0(%r14)
movaps 0xf638(%rip), %xmm0     # 0x13010
movups %xmm0, 0x1ec(%r14)
movl %ebp, 0x1fc(%r14)
leaq 0x158c2(%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 0x157b0(%rip), %r13     # 0x191d4
cmpl $0x0, (%r13)
je 0x3bfb
movq 0x15592(%rip), %rdi     # 0x18fc8
leaq 0xf71b(%rip), %rsi      # 0x13158
movl $0x1a, %edx
callq 0x3200
movq (%rbx), %rsi
movq 0x15577(%rip), %rdi     # 0x18fc8
callq 0x3120
movq %rax, %rbx
leaq 0xf713(%rip), %rsi      # 0x13173
movl $0x16, %edx
movq %rax, %rdi
callq 0x3200
movl %r12d, %esi
movq %rbx, %rdi
callq 0x3120
movq %rax, %rbx
leaq 0xf708(%rip), %rsi      # 0x1318a
movl $0x14, %edx
movq %rax, %rdi
callq 0x3200
movl 0x1e8(%r14), %esi
movq %rbx, %rdi
callq 0x3120
movq %rax, %r12
leaq 0xfb87(%rip), %rsi      # 0x1362f
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 0x3bfb
movq 0x154d9(%rip), %rdi     # 0x18fc8
leaq 0xf6a9(%rip), %rsi      # 0x1319f
movl $0x7, %edx
callq 0x3200
movl 0x1f0(%r14), %esi
movq 0x154ba(%rip), %rdi     # 0x18fc8
callq 0x3120
movq %rax, %rbx
leaq 0xf68a(%rip), %rsi      # 0x131a7
movl $0x5, %edx
movq %rax, %rdi
callq 0x3200
movl 0x1ec(%r14), %esi
movq %rbx, %rdi
callq 0x3120
movq %rax, %rbx
leaq 0xf66a(%rip), %rsi      # 0x131ad
movl $0x5, %edx
movq %rax, %rdi
callq 0x3200
movl 0x1e8(%r14), %esi
movq %rbx, %rdi
callq 0x3120
movq %rax, %rbx
leaq 0xf64a(%rip), %rsi      # 0x131b3
movl $0x6, %edx
movq %rax, %rdi
callq 0x3200
movl 0x1e0(%r14), %esi
movq %rbx, %rdi
callq 0x3120
movq %rax, %rbx
leaq 0xf62b(%rip), %rsi      # 0x131ba
movl $0x6, %edx
movq %rax, %rdi
callq 0x3200
movl 0x1e4(%r14), %esi
movq %rbx, %rdi
callq 0x3120
movq %rax, %rbx
leaq 0xf60c(%rip), %rsi      # 0x131c1
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, 0x1568b(%rip)     # 0x19298
movq 0x153b4(%rip), %rdi     # 0x18fc8
leaq 0xf5c3(%rip), %rsi      # 0x131de
movl $0x17, %edx
callq 0x3200
movl 0x1566d(%rip), %esi     # 0x19298
movq 0x15396(%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, 0x15631(%rip)     # 0x1929c
movq 0x15356(%rip), %rdi     # 0x18fc8
leaq 0xf57d(%rip), %rsi      # 0x131f6
movl $0x14, %edx
callq 0x3200
movl 0x15613(%rip), %esi     # 0x1929c
movq 0x15338(%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, 0x155d7(%rip)     # 0x192a0
movq 0x152f8(%rip), %rdi     # 0x18fc8
leaq 0xf534(%rip), %rsi      # 0x1320b
movl $0x1a, %edx
callq 0x3200
movl 0x155b9(%rip), %esi     # 0x192a0
movq 0x152da(%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 0x154ac(%rip), %rax     # 0x191d0
cmpl $0x0, (%rax)
movq 0x10(%rsp), %r13
je 0x3d85
xorl %ebp, %ebp
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movl %ebp, %esi
callq 0xec9a
movq %r13, %rdi
movq %r12, %rsi
callq 0x6ff2
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x3d61
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x3d78
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x31f0
incl %ebp
leaq 0x1544f(%rip), %rax     # 0x191d0
cmpl (%rax), %ebp
jb 0x3d35
movl $0x10, %edi
callq 0x31d0
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq 0xe8(%r14), %rdi
movq 0xf8(%r14), %rsi
movq %rax, 0xe8(%r14)
movq %rcx, 0xf0(%r14)
movq %rcx, 0xf8(%r14)
testq %rdi, %rdi
je 0x3dcc
subq %rdi, %rsi
callq 0x31f0
movl $0x10, %edi
callq 0x31d0
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq 0x148(%r14), %rdi
movq 0x158(%r14), %rsi
movq %rax, 0x148(%r14)
movq %rcx, 0x150(%r14)
movq %rcx, 0x158(%r14)
testq %rdi, %rdi
je 0x3e13
subq %rdi, %rsi
callq 0x31f0
movl $0x20, %edi
callq 0x31d0
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %rax, %rcx
addq $0x20, %rcx
movq 0xd0(%r14), %rdi
movq 0xe0(%r14), %rsi
movq %rax, 0xd0(%r14)
movq %rcx, 0xd8(%r14)
movq %rcx, 0xe0(%r14)
testq %rdi, %rdi
je 0x3e5e
subq %rdi, %rsi
callq 0x31f0
movl $0x20, %edi
callq 0x31d0
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %rax, %rcx
addq $0x20, %rcx
movq 0x130(%r14), %rdi
movq 0x140(%r14), %rsi
movq %rax, 0x130(%r14)
movq %rcx, 0x138(%r14)
movq %rcx, 0x140(%r14)
testq %rdi, %rdi
je 0x3ea9
subq %rdi, %rsi
callq 0x31f0
movl $0x20, %edi
callq 0x31d0
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %rax, %rcx
addq $0x20, %rcx
movq 0xb8(%r14), %rdi
movq 0xc8(%r14), %rsi
movq %rax, 0xb8(%r14)
movq %rcx, 0xc0(%r14)
movq %rcx, 0xc8(%r14)
testq %rdi, %rdi
je 0x3ef4
subq %rdi, %rsi
callq 0x31f0
movl $0x20, %edi
callq 0x31d0
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %rax, %rcx
addq $0x20, %rcx
movq 0x118(%r14), %rdi
movq 0x128(%r14), %rsi
movq %rax, 0x118(%r14)
movq %rcx, 0x120(%r14)
movq %rcx, 0x128(%r14)
testq %rdi, %rdi
je 0x3f3f
subq %rdi, %rsi
callq 0x31f0
movl $0x10, %edi
callq 0x31d0
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq 0x178(%r14), %rdi
movq 0x188(%r14), %rsi
movq %rax, 0x178(%r14)
movq %rcx, 0x180(%r14)
movq %rcx, 0x188(%r14)
testq %rdi, %rdi
je 0x3f86
subq %rdi, %rsi
callq 0x31f0
movl $0x20, %edi
callq 0x31d0
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %rax, %rcx
addq $0x20, %rcx
movq 0x40(%r14), %rdi
movq 0x50(%r14), %rsi
movq %rax, 0x40(%r14)
movq %rcx, 0x48(%r14)
movq %rcx, 0x50(%r14)
testq %rdi, %rdi
je 0x3fc2
subq %rdi, %rsi
callq 0x31f0
movl $0x40, %edi
callq 0x31d0
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %rax, %rcx
addq $0x40, %rcx
movq 0x58(%r14), %rdi
movq 0x68(%r14), %rsi
movq %rax, 0x58(%r14)
movq %rcx, 0x60(%r14)
movq %rcx, 0x68(%r14)
testq %rdi, %rdi
je 0x4006
subq %rdi, %rsi
callq 0x31f0
leaq 0x151c3(%rip), %rax     # 0x191d0
movl (%rax), %esi
leaq 0x1c(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x20(%rsp), %rdi
leaq 0xf(%rsp), %rcx
callq 0x6d56
movq 0x88(%r14), %rdi
movq 0x98(%r14), %rsi
movaps 0x20(%rsp), %xmm0
movups %xmm0, 0x88(%r14)
movq 0x30(%rsp), %rax
movq %rax, 0x98(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
testq %rdi, %rdi
je 0x4085
subq %rdi, %rsi
callq 0x31f0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x4085
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x31f0
leaq 0x15144(%rip), %rax     # 0x191d0
movl (%rax), %esi
leaq 0x1c(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x20(%rsp), %rdi
leaq 0xf(%rsp), %rcx
callq 0x6d56
movq 0xa0(%r14), %rdi
movq 0xb0(%r14), %rsi
movaps 0x20(%rsp), %xmm0
movups %xmm0, 0xa0(%r14)
movq 0x30(%rsp), %rax
movq %rax, 0xb0(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
testq %rdi, %rdi
je 0x4104
subq %rdi, %rsi
callq 0x31f0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x4104
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x31f0
movl $0x10, %edi
callq 0x31d0
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq 0x100(%r14), %rdi
movq 0x110(%r14), %rsi
movq %rax, 0x100(%r14)
movq %rcx, 0x108(%r14)
movq %rcx, 0x110(%r14)
testq %rdi, %rdi
je 0x414b
subq %rdi, %rsi
callq 0x31f0
movl $0x10, %edi
callq 0x31d0
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq 0x160(%r14), %rdi
movq 0x170(%r14), %rsi
movq %rax, 0x160(%r14)
movq %rcx, 0x168(%r14)
movq %rcx, 0x170(%r14)
testq %rdi, %rdi
je 0x4192
subq %rdi, %rsi
callq 0x31f0
movl $0x20, %edi
callq 0x31d0
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %rax, %rcx
addq $0x20, %rcx
movq 0x1b0(%r14), %rdi
movq 0x1c0(%r14), %rsi
movq %rax, 0x1b0(%r14)
movq %rcx, 0x1b8(%r14)
movq %rcx, 0x1c0(%r14)
testq %rdi, %rdi
je 0x41dd
subq %rdi, %rsi
callq 0x31f0
movl $0x20, %edi
callq 0x31d0
movq %rax, %r12
leaq 0x1496f(%rip), %rax     # 0x18b60
movq %rax, (%r12)
movq %r14, 0x8(%r12)
leaq 0x2f9(%rip), %rax       # 0x44fa
movq %rax, 0x10(%r12)
movq $0x0, 0x18(%r12)
movl $0x8, %esi
movq %r15, %rdi
callq 0x6ed2
xorl %ebp, %ebp
leaq 0x20(%rsp), %r13
movl $0x280, %edi            # imm = 0x280
callq 0x31d0
movq %rax, %rbx
movq %rax, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0xcb16
movq %rbx, 0x20(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x7314
incl %ebp
cmpl $0x8, %ebp
jne 0x4223
leaq 0x14f75(%rip), %rax     # 0x191d0
movl (%rax), %esi
leaq 0x1c(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x20(%rsp), %rdi
leaq 0xf(%rsp), %rcx
callq 0x6d56
movq 0x198(%r14), %rdi
movq 0x1a8(%r14), %rsi
movaps 0x20(%rsp), %xmm0
movups %xmm0, 0x198(%r14)
movq 0x30(%rsp), %rax
movq %rax, 0x1a8(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
testq %rdi, %rdi
je 0x42d3
subq %rdi, %rsi
callq 0x31f0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x42d3
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x31f0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x432a
jmp 0x4302
jmp 0x4302
jmp 0x4302
jmp 0x4302
jmp 0x4302
jmp 0x4302
jmp 0x4302
jmp 0x4302
jmp 0x4302
jmp 0x4302
jmp 0x4302
jmp 0x4302
jmp 0x4302
jmp 0x4302
jmp 0x432a
movq %rax, %r12
jmp 0x4332
movq %rax, %r12
leaq 0x20(%rsp), %rdi
callq 0x6d24
jmp 0x4332
jmp 0x432a
movq %rax, %r12
movl $0x280, %esi            # imm = 0x280
movq %rbx, %rdi
callq 0x31f0
jmp 0x432d
movq %rax, %r12
movq 0x10(%rsp), %r13
leaq 0x198(%r14), %rbx
movq 0x1b0(%r14), %rdi
testq %rdi, %rdi
je 0x4354
movq 0x1c0(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x436b
movq 0x1a8(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0x178(%r14), %rdi
testq %rdi, %rdi
je 0x4386
movq 0x188(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0x160(%r14), %rdi
testq %rdi, %rdi
je 0x43a1
movq 0x170(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0x148(%r14), %rdi
testq %rdi, %rdi
je 0x43bc
movq 0x158(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0x130(%r14), %rdi
testq %rdi, %rdi
je 0x43d7
movq 0x140(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0x118(%r14), %rdi
testq %rdi, %rdi
je 0x43f2
movq 0x128(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0x100(%r14), %rdi
testq %rdi, %rdi
je 0x440d
movq 0x110(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0xe8(%r14), %rdi
testq %rdi, %rdi
je 0x4428
movq 0xf8(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0xd0(%r14), %rdi
testq %rdi, %rdi
je 0x4443
movq 0xe0(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0xb8(%r14), %rdi
testq %rdi, %rdi
je 0x445e
movq 0xc8(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0xa0(%r14), %rdi
testq %rdi, %rdi
je 0x4479
movq 0xb0(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0x88(%r14), %rdi
testq %rdi, %rdi
je 0x4494
movq 0x98(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0x70(%r14), %rdi
testq %rdi, %rdi
je 0x44ac
movq 0x80(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0x58(%r14), %rdi
testq %rdi, %rdi
je 0x44c1
movq 0x68(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq 0x40(%r14), %rdi
testq %rdi, %rdi
je 0x44d6
movq 0x50(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq (%r15), %rdi
testq %rdi, %rdi
je 0x44ea
movq 0x38(%r14), %rsi
subq %rdi, %rsi
callq 0x31f0
movq %r13, %rdi
callq 0x6f6e
movq %r12, %rdi
callq 0x3340