// File: /workspace/github_cpp_makefile_star2_O1/estwings57[P]CasHMC/sources/HMCController.cpp
// Function: CasHMC::HMCController::Update()
void HMCController::Update()
{
	//Link wakes up from low power mode
	LinkPowerExitManager();
	
	//accumulate the allocated MSHR size
	accuMSHR += alloMSHR;
	
	//Downstream buffer state
	if(bufPopDelay==0 && downBuffers.size() > 0) {
		//Check packet dependency
		int link = -1;
		for(int l=0; l<NUM_LINKS; l++) {
			for(int i=0; i<downLinkMasters[l]->Buffers.size(); i++) {
				if(downLinkMasters[l]->Buffers[i] != NULL) {
					unsigned maxBlockBit = _log2(ADDRESS_MAPPING);
					if((downLinkMasters[l]->Buffers[i]->ADRS >> maxBlockBit) == (downBuffers[0]->address >> maxBlockBit)) {
						link = l;
						DEBUG(ALI(18)<<header<<ALI(15)<<*downBuffers[0]<<"Down) This transaction has a DEPENDENCY with "<<*downLinkMasters[l]->Buffers[i]);
						break;
					}
				}
			}
		}
		
		if(link == -1) {
			for(int l=0; l<NUM_LINKS; l++) {
				link = FindAvailableLink(inServiceLink, downLinkMasters);
				if(link == -1) {
					//DEBUG(ALI(18)<<header<<ALI(15)<<*downBuffers[0]<<"Down) all link buffer FULL");
				}
				else if(downLinkMasters[link]->currentState != ACTIVE
				&& downLinkMasters[link]->currentState != LINK_RETRY) {
					continue;
					//DEBUG(ALI(18)<<header<<ALI(15)<<*downBuffers[0]<<"Down) link "<<l<<" is not ACTIVE mode ["<<downLinkMasters[link]->powerMode<<"]");
				}
				else {
					Packet *packet = ConvTranIntoPacket(downBuffers[0]);
					if(downLinkMasters[link]->Receive(packet)) {
						DE_CR(ALI(18)<<header<<ALI(15)<<*packet<<"Down) SENDING packet to link mater "<<link<<" (LM_D"<<link<<")");
						if(!((packet->CMD >= P_WR16 && packet->CMD <= P_WR128)
						|| packet->CMD == P_WR256 || packet->CMD == P_2ADD8
						|| packet->CMD == P_ADD16 || packet->CMD == P_INC8
						|| packet->CMD == P_BWR)) {
							returnTransCnt++;
						}
						//Call callback function if posted write packet is tranmitted
						if((packet->CMD >= P_WR16 && packet->CMD <= P_WR128) || packet->CMD == P_WR256) {
							if(writeDone != NULL) {
								(*writeDone)(packet->ADRS, currentClockCycle);
							}
						}
						requestAccLNG += packet->LNG;
						delete downBuffers[0];
						downBuffers.erase(downBuffers.begin());
						break;
					}
					else {
						packet->ReductGlobalTAG();
						delete packet;
						//DEBUG(ALI(18)<<header<<ALI(15)<<*packet<<"Down) Link "<<link<<" buffer FULL");	
					}
				}
			}
		}
		else {
			Packet *packet = ConvTranIntoPacket(downBuffers[0]);
			if(downLinkMasters[link]->Receive(packet)) {
				DE_CR(ALI(18)<<header<<ALI(15)<<*packet<<"Down) SENDING packet to link mater "<<link<<" (LM_D"<<link<<")");
				delete downBuffers[0];
				downBuffers.erase(downBuffers.begin());
			}
			else {
				packet->ReductGlobalTAG();
				delete packet;
				//DEBUG(ALI(18)<<header<<ALI(15)<<*packet<<"Down) Link "<<link<<" buffer FULL");	
			}
		}
	}
	
	//Upstream buffer state
	if(upBuffers.size() > 0) {
		//Make sure that buffer[0] is not virtual tail packet.
		if(upBuffers[0] == NULL) {
			ERROR(header<<"  == Error - HMC controller up buffer[0] is NULL (It could be one of virtual tail packet occupying packet length  (CurrentClock : "<<currentClockCycle<<")");
			exit(0);
		}
		else {
			DE_CR(ALI(18)<<header<<ALI(15)<<*upBuffers[0]<<"Up)   RETURNING transaction to system bus");
			upBuffers[0]->trace->tranFullLat = currentClockCycle - upBuffers[0]->trace->tranTransmitTime;
			if(upBuffers[0]->CMD == RD_RS) {
				upBuffers[0]->trace->statis->hmcTransmitSize += (upBuffers[0]->LNG - 1)*16;
			}
			returnTransCnt--;
			//Call callback function if it is registered
			if(upBuffers[0]->CMD == WR_RS) {
				if(writeDone != NULL) {
					(*writeDone)(upBuffers[0]->ADRS, currentClockCycle);
				}
			}
			else if(upBuffers[0]->CMD == RD_RS) {
				if(readDone != NULL) {
					(*readDone)(upBuffers[0]->ADRS, currentClockCycle);
				}
			}
			int packetLNG = upBuffers[0]->LNG;
			responseAccLNG += packetLNG;
			delete upBuffers[0]->trace;
			delete upBuffers[0];
			upBuffers.erase(upBuffers.begin(), upBuffers.begin()+packetLNG);
		}
	}
	
	//Link state manager
	LinkPowerStateManager();
	//Link goes to low power mode
	LinkPowerEntryManager();
	
	LinkStatistic();
	Step();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0x1f604
movl 0x25c(%rbx), %eax
addq %rax, 0x260(%rbx)
movq %rbx, 0x8(%rsp)
cmpl $0x0, 0x200(%rbx)
je 0x1ee02
movq 0x8(%rsp), %r12
movq 0x1e8(%r12), %rax
cmpq %rax, 0x1f0(%r12)
je 0x1edbc
cmpq $0x0, (%rax)
je 0x1f570
leaq 0x1d8d1(%rip), %rax     # 0x3c488
cmpb $0x1, (%rax)
jne 0x1ecbe
movq 0x1d409(%rip), %rax     # 0x3bfd0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0x12, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %r14
cmpb $0x0, 0xe1(%rax,%rcx)
jne 0x1ec05
movq %r14, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r14)
movb $0x1, 0xe1(%r14)
movb $0x20, 0xe0(%r14)
movq 0x20(%r12), %rsi
movq 0x28(%r12), %rdx
movq 0x1d3b2(%rip), %rdi     # 0x3bfd0
callq 0x4340
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rcx
movq $0xf, 0x10(%r14,%rcx)
movq -0x18(%rax), %rax
leaq (%r14,%rax), %r15
cmpb $0x0, 0xe1(%r14,%rax)
jne 0x1ec65
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x1e8(%r12), %rax
movq (%rax), %rsi
movq %r14, %rdi
callq 0x28bbe
movq %rax, %r14
leaq 0x147b2(%rip), %rsi     # 0x3343c
movl $0x29, %edx
movq %rax, %rdi
callq 0x4340
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq 0x8(%r12), %rdx
movq 0x1e8(%r12), %rax
movq (%rax), %rax
movq 0x8(%rax), %rsi
movl 0x8(%rsi), %ecx
movl %edx, %edi
subl %ecx, %edi
movl %edi, 0xc(%rsi)
movl 0x434(%rax), %ecx
cmpl $0x38, %ecx
jne 0x1ecfd
movl 0x430(%rax), %edi
shll $0x4, %edi
addl $-0x10, %edi
movq (%rsi), %rsi
addq %rdi, 0x128(%rsi)
decl 0x268(%r12)
cmpl $0x39, %ecx
jne 0x1f072
movq 0x358(%r12), %rdi
testq %rdi, %rdi
je 0x1ed28
movq 0x450(%rax), %rsi
movq (%rdi), %rax
callq *0x10(%rax)
movq 0x1e8(%r12), %rax
movq (%rax), %rax
movslq 0x430(%rax), %rbx
addq %rbx, 0x250(%r12)
movq 0x8(%rax), %r14
testq %r14, %r14
je 0x1ed60
movq %r14, %rdi
callq 0x139fc
movl $0x20, %esi
movq %r14, %rdi
callq 0x4300
movq 0x1e8(%r12), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x1ed76
movq (%rdi), %rax
callq *0x8(%rax)
testl %ebx, %ebx
je 0x1edbc
movq 0x1e8(%r12), %r14
leaq (%r14,%rbx,8), %r15
movq 0x1f0(%r12), %rdx
subq %r15, %rdx
je 0x1ed9e
movq %r14, %rdi
movq %r15, %rsi
callq 0x4480
movq 0x1f0(%r12), %rax
movq %rax, %rcx
subq %r15, %rcx
addq %rcx, %r14
cmpq %r14, %rax
je 0x1edbc
movq %r14, 0x1f0(%r12)
movq %r12, %rdi
callq 0x20446
movq %r12, %rdi
callq 0x20c68
movq %r12, %rdi
callq 0x218f8
incq 0x8(%r12)
movl 0x200(%r12), %eax
leal -0x1(%rax), %ecx
xorl %edx, %edx
testl %eax, %eax
cmovgl %ecx, %edx
movl %edx, 0x200(%r12)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rcx
movq 0x1d8(%rcx), %rax
cmpq 0x1d0(%rcx), %rax
je 0x1eb8b
leaq 0x1d686(%rip), %rax     # 0x3c4a8
cmpl $0x0, (%rax)
jle 0x1f095
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
xorl %r8d, %r8d
leaq 0x1d751(%rip), %r9      # 0x3c58c
leaq 0x1d646(%rip), %r10     # 0x3c488
leaq 0x1d640(%rip), %r11     # 0x3c489
xorl %r15d, %r15d
movq 0x8(%rsp), %r12
movq 0x208(%r12), %rax
movq (%rax,%r15,8), %rcx
movq 0x1d0(%rcx), %rax
cmpq %rax, 0x1d8(%rcx)
je 0x1f05a
xorl %r14d, %r14d
movq (%rax,%r14,8), %rdx
testq %rdx, %rdx
je 0x1f02d
movl (%r9), %esi
bsrl %esi, %ecx
cmpl $0x2, %esi
cmovbl %r8d, %ecx
movl $0x1, %edi
shll %cl, %edi
xorl %eax, %eax
cmpl %esi, %edi
setb %al
addl %ecx, %eax
movq 0x450(%rdx), %rbp
movl %eax, %ecx
shrq %cl, %rbp
movq 0x1d0(%r12), %rcx
movq (%rcx), %rcx
movq 0x18(%rcx), %rbx
movl %eax, %ecx
shrq %cl, %rbx
cmpq %rbx, %rbp
jne 0x1f028
cmpb $0x1, (%r10)
movl %r15d, %r13d
jne 0x1f028
cmpb $0x0, (%r11)
movl %r15d, %r13d
jne 0x1f028
movq 0x1d0e8(%rip), %rdx     # 0x3bfd0
movq (%rdx), %rax
movq -0x18(%rax), %rcx
movq $0x12, 0x10(%rdx,%rcx)
movq -0x18(%rax), %rax
leaq (%rdx,%rax), %r12
cmpb $0x0, 0xe1(%rdx,%rax)
jne 0x1ef28
movq %r12, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r12)
movb $0x1, 0xe1(%r12)
movb $0x20, 0xe0(%r12)
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
movq 0x1d08b(%rip), %rdi     # 0x3bfd0
callq 0x4340
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rcx
movq $0xf, 0x10(%r12,%rcx)
movq -0x18(%rax), %rax
leaq (%r12,%rax), %r13
cmpb $0x0, 0xe1(%r12,%rax)
jne 0x1ef8c
movq %r13, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r13)
movb $0x1, 0xe1(%r13)
movb $0x20, 0xe0(%r13)
movq 0x8(%rsp), %r13
movq 0x1d0(%r13), %rax
movq (%rax), %rsi
movq %r12, %rdi
callq 0x2c070
movq %rax, %r12
movl $0x2d, %edx
movq %rax, %rdi
leaq 0x14390(%rip), %rsi     # 0x3334d
callq 0x4340
movq 0x208(%r13), %rax
movq (%rax,%r15,8), %rax
movq 0x1d0(%rax), %rax
movq (%rax,%r14,8), %rsi
movq %r12, %rdi
callq 0x28bbe
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %r12, %rdi
movq %r13, %r12
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movl %r15d, %r13d
xorl %r8d, %r8d
leaq 0x1d572(%rip), %r9      # 0x3c58c
leaq 0x1d467(%rip), %r10     # 0x3c488
leaq 0x1d461(%rip), %r11     # 0x3c489
cmpq %rbx, %rbp
je 0x1f05a
incq %r14
movq 0x208(%r12), %rax
movq (%rax,%r15,8), %rcx
movq 0x1d0(%rcx), %rax
movq 0x1d8(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r14, %rcx
ja 0x1ee74
incq %r15
leaq 0x1d444(%rip), %rax     # 0x3c4a8
movslq (%rax), %rax
cmpq %rax, %r15
jl 0x1ee51
jmp 0x1f0a0
cmpl $0x38, %ecx
setne %cl
movq 0x350(%r12), %rdi
testq %rdi, %rdi
sete %sil
orb %cl, %sil
je 0x1ed1b
jmp 0x1ed28
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movq 0x8(%rsp), %r12
cmpl $-0x1, %r13d
je 0x1f276
movq 0x1d0(%r12), %rax
movq (%rax), %rsi
movq %r12, %rdi
callq 0x1fffc
movq %rax, %r14
movslq %r13d, %rax
movq 0x208(%r12), %rcx
movq (%rcx,%rax,8), %rdi
movq %r14, %rsi
callq 0x1a9a6
testb %al, %al
je 0x1f55a
leaq 0x1d3a2(%rip), %rax     # 0x3c488
cmpb $0x1, (%rax)
jne 0x1f231
movq 0x1ceda(%rip), %rax     # 0x3bfd0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0x12, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %r15
cmpb $0x0, 0xe1(%rax,%rcx)
jne 0x1f134
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x20(%r12), %rsi
movq 0x28(%r12), %rdx
movq 0x1ce83(%rip), %rdi     # 0x3bfd0
callq 0x4340
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rcx
movq $0xf, 0x10(%r15,%rcx)
movq -0x18(%rax), %rax
leaq (%r15,%rax), %r12
cmpb $0x0, 0xe1(%r15,%rax)
jne 0x1f196
movq %r12, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r12)
movb $0x1, 0xe1(%r12)
movb $0x20, 0xe0(%r12)
movq %r15, %rdi
movq %r14, %rsi
callq 0x28bbe
movq %rax, %r14
leaq 0x141c7(%rip), %rsi     # 0x3337b
movl $0x23, %edx
movq %rax, %rdi
callq 0x4340
movq %r14, %rdi
movl %r13d, %esi
callq 0x4500
movq %rax, %r14
leaq 0x1436c(%rip), %rsi     # 0x33542
movl $0x6, %edx
movq %rax, %rdi
callq 0x4340
movq %r14, %rdi
movl %r13d, %esi
callq 0x4500
movq %rax, %r14
leaq 0x15269(%rip), %rsi     # 0x34461
movl $0x1, %edx
movq %rax, %rdi
callq 0x4340
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq 0x8(%rsp), %r12
movq 0x1d0(%r12), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x1f247
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x1d0(%r12), %rdi
movq 0x1d8(%r12), %rdx
leaq 0x8(%rdi), %rsi
cmpq %rdx, %rsi
je 0x1f268
subq %rsi, %rdx
callq 0x4480
addq $-0x8, 0x1d8(%r12)
jmp 0x1eb8b
leaq 0x1d22b(%rip), %rax     # 0x3c4a8
cmpl $0x0, (%rax)
jle 0x1eb8b
movq 0x8(%rsp), %rax
leaq 0x238(%rax), %rbp
leaq 0x208(%rax), %r14
xorl %r15d, %r15d
movq %r14, 0x10(%rsp)
movq %rbp, %rdi
movq %r14, %rsi
callq 0x26342
cmpl $-0x1, %eax
je 0x1f537
movl %eax, %r12d
movslq %eax, %rbx
movq (%r14), %rax
movq (%rax,%rbx,8), %rax
movl 0x200(%rax), %eax
cmpl $0xb, %eax
je 0x1f2d5
testl %eax, %eax
jne 0x1f537
movq 0x8(%rsp), %r14
movq 0x1d0(%r14), %rax
movq (%rax), %rsi
movq %r14, %rdi
callq 0x1fffc
movq %rax, %r13
movq 0x208(%r14), %rax
movq (%rax,%rbx,8), %rdi
movq %r13, %rsi
callq 0x1a9a6
movl %eax, %ebx
testb %al, %al
je 0x1f518
movb %bl, 0x7(%rsp)
leaq 0x1d171(%rip), %rax     # 0x3c488
cmpb $0x1, (%rax)
jne 0x1f460
movq %rbp, %rbx
movq 0x1cca6(%rip), %rdx     # 0x3bfd0
movq (%rdx), %rax
movq -0x18(%rax), %rcx
movq $0x12, 0x10(%rdx,%rcx)
movq -0x18(%rax), %rax
leaq (%rdx,%rax), %r14
cmpb $0x0, 0xe1(%rdx,%rax)
jne 0x1f368
movq %r14, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r14)
movb $0x1, 0xe1(%r14)
movb $0x20, 0xe0(%r14)
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
movq 0x1cc4c(%rip), %rdi     # 0x3bfd0
callq 0x4340
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rcx
movq $0xf, 0x10(%r14,%rcx)
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rbp
cmpb $0x0, 0xe1(%r14,%rax)
jne 0x1f3c9
movq %rbp, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%rbp)
movb $0x1, 0xe1(%rbp)
movb $0x20, 0xe0(%rbp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x28bbe
movq %rax, %r14
movl $0x23, %edx
movq %rax, %rdi
leaq 0x13f8e(%rip), %rsi     # 0x3337b
callq 0x4340
movq %r14, %rdi
movl %r12d, %esi
callq 0x4500
movq %rax, %r14
movl $0x6, %edx
movq %rax, %rdi
leaq 0x14133(%rip), %rsi     # 0x33542
callq 0x4340
movq %r14, %rdi
movl %r12d, %esi
callq 0x4500
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x15030(%rip), %rsi     # 0x34461
callq 0x4340
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq %rbx, %rbp
movl 0x434(%r13), %eax
movl %eax, %ecx
andl $-0x8, %ecx
cmpl $0x18, %ecx
movq 0x8(%rsp), %rbx
movq 0x10(%rsp), %r14
je 0x1f4ab
leal -0x21(%rax), %edx
cmpl $0x3e, %edx
ja 0x1f54f
movabsq $0x4008000000000007, %rsi # imm = 0x4008000000000007
btq %rdx, %rsi
jae 0x1f54f
cmpl $0x18, %ecx
setne %cl
cmpl $0x5f, %eax
setne %al
testb %cl, %al
jne 0x1f4c8
movq 0x358(%rbx), %rdi
testq %rdi, %rdi
je 0x1f4c8
movq 0x450(%r13), %rsi
movq 0x8(%rbx), %rdx
movq (%rdi), %rax
callq *0x10(%rax)
movl 0x430(%r13), %eax
addq %rax, 0x248(%rbx)
movq 0x1d0(%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x1f4eb
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x1d0(%rbx), %rdi
movq 0x1d8(%rbx), %rdx
leaq 0x8(%rdi), %rsi
cmpq %rdx, %rsi
je 0x1f50a
subq %rsi, %rdx
callq 0x4480
addq $-0x8, 0x1d8(%rbx)
movb 0x7(%rsp), %bl
jmp 0x1f52f
movq %r13, %rdi
callq 0x28bb4
movq (%r13), %rax
movq %r13, %rdi
callq *0x8(%rax)
movq 0x10(%rsp), %r14
testb %bl, %bl
jne 0x1eb8b
incl %r15d
leaq 0x1cf67(%rip), %rax     # 0x3c4a8
cmpl (%rax), %r15d
jl 0x1f2a1
jmp 0x1eb8b
incl 0x268(%rbx)
jmp 0x1f49b
movq %r14, %rdi
callq 0x28bb4
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
jmp 0x1eb8b
movq 0x1ca79(%rip), %rdi     # 0x3bff0
leaq 0x11aa4(%rip), %rsi     # 0x31022
callq 0x42e0
leaq 0x13e15(%rip), %rsi     # 0x3339f
movq %rax, %rdi
callq 0x42e0
leaq 0x1229e(%rip), %rsi     # 0x31837
movq %rax, %rdi
callq 0x42e0
movq %rax, %rdi
movl $0xc9, %esi
callq 0x4500
leaq 0x11a8c(%rip), %rsi     # 0x31041
movq %rax, %rdi
callq 0x42e0
leaq 0x20(%r12), %rsi
movq %rax, %rdi
callq 0x4290
leaq 0x13de8(%rip), %rsi     # 0x333b9
movq %rax, %rdi
callq 0x42e0
movq 0x8(%r12), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x14e74(%rip), %rsi     # 0x34461
movq %rax, %rdi
callq 0x42e0
movq %rax, %rdi
callq 0x4170
xorl %edi, %edi
callq 0x4360