// File: gvaumour[P]cache-simulator/src/Cerebron.cc
// Function: CerebronPredictor::load_callee_file()
void 
CerebronPredictor::load_callee_file()
{

	string mem_trace = simu_parameters.memory_traces[0];
	string dir_name = splitFilename(mem_trace);
	string callee_filename = dir_name + "/callee_recap.txt"; 
	
	ifstream file(callee_filename);
	
	assert(file && "Callee file not found\n");
	string line;
	
	while( getline(file, line))
	{		
		m_callee_map.insert(pair<uint64_t,int>( hexToInt(line) , 0));		
	};
		
	file.close();	
}

// Assembly:
subq $0x358, %rsp            # imm = 0x358
movq %rdi, 0x350(%rsp)
movq 0x350(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x8c87d(%rip), %rdi     # 0x93ff0
addq $0x50, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xfd00
movq %rax, %rsi
leaq 0x330(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x51b0
movq 0x40(%rsp), %rsi
leaq 0x2f0(%rsp), %rdi
callq 0x51b0
jmp 0x77a9
leaq 0x310(%rsp), %rdi
leaq 0x2f0(%rsp), %rsi
callq 0x65900
jmp 0x77c0
leaq 0x2f0(%rsp), %rdi
callq 0x5768
leaq 0x69f2d(%rip), %rdx     # 0x71701
leaq 0x2c0(%rsp), %rdi
leaq 0x310(%rsp), %rsi
callq 0xfd20
jmp 0x77eb
leaq 0xb8(%rsp), %rdi
leaq 0x2c0(%rsp), %rsi
movl $0x8, %edx
callq 0x5600
jmp 0x7807
movq 0xb8(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0xb8(%rsp,%rax), %rdi
callq 0x54e0
movb %al, 0x37(%rsp)
jmp 0x7826
movb 0x37(%rsp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x36(%rsp)
jne 0x7837
jmp 0x783f
movb $0x1, %al
movb %al, 0x36(%rsp)
jmp 0x783f
movb 0x36(%rsp), %al
testb $0x1, %al
jne 0x7849
jmp 0x784e
jmp 0x78f7
leaq 0x69ed5(%rip), %rdi     # 0x7172a
leaq 0x69833(%rip), %rsi     # 0x7108f
movl $0x36b, %edx            # imm = 0x36B
leaq 0x69ee4(%rip), %rcx     # 0x7174c
callq 0x5260
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
jmp 0x7aad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
leaq 0x2f0(%rsp), %rdi
callq 0x5768
jmp 0x7aad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
jmp 0x7aa0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
jmp 0x7a93
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
jmp 0x7a86
leaq 0x98(%rsp), %rdi
callq 0x5540
leaq 0xb8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x50c0
movq %rax, 0x28(%rsp)
jmp 0x7920
movq 0x28(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x54e0
movb %al, 0x27(%rsp)
jmp 0x793a
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0x7947
jmp 0x7a21
movq 0x38(%rsp), %rax
addq $0x308, %rax            # imm = 0x308
movq %rax, 0x18(%rsp)
leaq 0x60(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x51b0
jmp 0x796b
leaq 0x60(%rsp), %rdi
callq 0x656a0
movq %rax, 0x10(%rsp)
jmp 0x797c
movq 0x10(%rsp), %rax
movq %rax, 0x80(%rsp)
movl $0x0, 0x5c(%rsp)
leaq 0x88(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x5c(%rsp), %rdx
callq 0xfe00
jmp 0x79ad
movq 0x18(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0xfdb0
movb %dl, 0x7(%rsp)
movq %rax, 0x8(%rsp)
jmp 0x79ca
movb 0x7(%rsp), %al
movq 0x8(%rsp), %rcx
movq %rcx, 0x48(%rsp)
movb %al, 0x50(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x5768
jmp 0x7904
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
jmp 0x7a79
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x5768
jmp 0x7a79
leaq 0xb8(%rsp), %rdi
callq 0x50d0
jmp 0x7a30
leaq 0x98(%rsp), %rdi
callq 0x5768
leaq 0xb8(%rsp), %rdi
callq 0x5110
leaq 0x2c0(%rsp), %rdi
callq 0x5768
leaq 0x310(%rsp), %rdi
callq 0x5768
leaq 0x330(%rsp), %rdi
callq 0x5768
addq $0x358, %rsp            # imm = 0x358
retq
leaq 0x98(%rsp), %rdi
callq 0x5768
leaq 0xb8(%rsp), %rdi
callq 0x5110
leaq 0x2c0(%rsp), %rdi
callq 0x5768
leaq 0x310(%rsp), %rdi
callq 0x5768
leaq 0x330(%rsp), %rdi
callq 0x5768
movq 0x2e8(%rsp), %rdi
callq 0x5690
nopw (%rax,%rax)