// File: gvaumour[P]cache-simulator/src/common.cc
// Function: buildHash[abi:cxx11](unsigned long, unsigned long)
string buildHash(uint64_t a, uint64_t p)
{
	stringstream ss;
	ss << std::hex << a;
   	string addr = ss.str();

	while(addr.size() < 8)
		addr = string(1,'0') + addr;
			
	stringstream ss1;
	ss1 << std::hex << p;
   	string pc = ss1.str();	

	while(pc.size() < 8)
		pc = string(1,'0') + pc;

	return addr + pc;
}

// Assembly:
subq $0x438, %rsp            # imm = 0x438
movq %rdi, 0x18(%rsp)
movq %rdi, %rax
movq %rax, 0x20(%rsp)
movq %rdi, 0x430(%rsp)
movq %rsi, 0x428(%rsp)
movq %rdx, 0x420(%rsp)
leaq 0x298(%rsp), %rdi
callq 0x52a0
leaq 0x2a8(%rsp), %rdi
leaq -0x56528(%rip), %rsi    # 0xf800
callq 0x5160
movq %rax, 0x28(%rsp)
jmp 0x65d34
movq 0x28(%rsp), %rdi
movq 0x428(%rsp), %rsi
callq 0x50f0
jmp 0x65d48
leaq 0x268(%rsp), %rdi
leaq 0x298(%rsp), %rsi
callq 0x5370
jmp 0x65d5f
jmp 0x65d61
leaq 0x268(%rsp), %rdi
callq 0x5290
cmpq $0x8, %rax
jae 0x65e6a
leaq 0x227(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x56a0
movq 0x10(%rsp), %rcx
leaq 0x228(%rsp), %rdi
movl $0x1, %esi
movl $0x30, %edx
callq 0x5270
jmp 0x65da8
leaq 0x248(%rsp), %rdi
leaq 0x228(%rsp), %rsi
leaq 0x268(%rsp), %rdx
callq 0x3da00
jmp 0x65dc7
leaq 0x268(%rsp), %rdi
leaq 0x248(%rsp), %rsi
callq 0x54a0
leaq 0x248(%rsp), %rdi
callq 0x5768
leaq 0x228(%rsp), %rdi
callq 0x5768
leaq 0x227(%rsp), %rdi
callq 0x53e0
jmp 0x65d61
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
jmp 0x66043
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
jmp 0x65e58
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
leaq 0x228(%rsp), %rdi
callq 0x5768
leaq 0x227(%rsp), %rdi
callq 0x53e0
jmp 0x66036
leaq 0x98(%rsp), %rdi
callq 0x52a0
jmp 0x65e79
leaq 0xa8(%rsp), %rdi
leaq -0x56688(%rip), %rsi    # 0xf800
callq 0x5160
movq %rax, 0x8(%rsp)
jmp 0x65e94
movq 0x8(%rsp), %rdi
movq 0x420(%rsp), %rsi
callq 0x50f0
jmp 0x65ea8
leaq 0x78(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x5370
jmp 0x65ebc
jmp 0x65ebe
leaq 0x78(%rsp), %rdi
callq 0x5290
cmpq $0x8, %rax
jae 0x65fb4
leaq 0x37(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x56a0
movq (%rsp), %rcx
leaq 0x38(%rsp), %rdi
movl $0x1, %esi
movl $0x30, %edx
callq 0x5270
jmp 0x65efa
leaq 0x58(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0x3da00
jmp 0x65f10
leaq 0x78(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x54a0
leaq 0x58(%rsp), %rdi
callq 0x5768
leaq 0x38(%rsp), %rdi
callq 0x5768
leaq 0x37(%rsp), %rdi
callq 0x53e0
jmp 0x65ebe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
jmp 0x66036
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
jmp 0x66029
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
jmp 0x65fa8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x5768
leaq 0x37(%rsp), %rdi
callq 0x53e0
jmp 0x6601f
movq 0x18(%rsp), %rdi
leaq 0x268(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0x67890
jmp 0x65fcd
leaq 0x78(%rsp), %rdi
callq 0x5768
leaq 0x98(%rsp), %rdi
callq 0x52c0
leaq 0x268(%rsp), %rdi
callq 0x5768
leaq 0x298(%rsp), %rdi
callq 0x52c0
movq 0x20(%rsp), %rax
addq $0x438, %rsp            # imm = 0x438
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x5768
leaq 0x98(%rsp), %rdi
callq 0x52c0
leaq 0x268(%rsp), %rdi
callq 0x5768
leaq 0x298(%rsp), %rdi
callq 0x52c0
movq 0x290(%rsp), %rdi
callq 0x5690
nopl (%rax)