// File: /workspace/github_cpp_makefile_star2_O3/chinmayachaudhry[P]Branch-Predictor/yehpatt.cpp
// Function: yehpatt::display_table()
void yehpatt :: display_table()
{
	if(branch_buffer != NULL)
		branch_buffer->display();
	
	cout << endl << "Final History Table Contents:" << endl;
	for(it = history_table.begin(); it != history_table.end(); it++)
	{
		int index = distance(history_table.begin(), it); 
		cout << "table[" << index << "]: "; 
		if(history_table.at(index) != 0)
			cout << showbase << internal << setfill(' ') << hex << setw(6) << history_table.at(index) << dec << endl;	
		else
			cout << "0x " << history_table.at(index) << dec << endl;
		
	}
	
	cout << endl << "Final Prediction Table Contents:" << endl;
	for(it = predictor_table.begin(); it != predictor_table.end(); it++)
	{
		int index = distance(predictor_table.begin(), it); 
		cout << "table[" << index << "]: " << predictor_table.at(index) << endl;	
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x90(%rdi), %rdi
testq %rdi, %rdi
je 0x59bd
callq 0x391e
movq 0x4614(%rip), %r14      # 0x9fd8
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq %rax, %r15
leaq 0x1901(%rip), %rsi      # 0x72f6
movl $0x1d, %edx
movq %rax, %rdi
callq 0x2190
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq 0x70(%rbx), %rbp
movq %rbp, 0x88(%rbx)
cmpq 0x78(%rbx), %rbp
je 0x5bbd
leaq 0x18aa(%rip), %r15      # 0x72ef
leaq 0x16ee(%rip), %r12      # 0x713a
subq 0x70(%rbx), %rbp
shrq $0x2, %rbp
movl $0x6, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2190
movq %r14, %rdi
movl %ebp, %esi
callq 0x2250
movl $0x3, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2190
movslq %ebp, %rbp
movq 0x70(%rbx), %rcx
movq 0x78(%rbx), %rdx
movq %rdx, %rax
subq %rcx, %rax
sarq $0x2, %rax
cmpq %rbp, %rax
jbe 0x5d05
cmpl $0x0, (%rcx,%rbp,4)
je 0x5b2c
movq (%r14), %rax
movq -0x18(%rax), %rcx
orl $0x200, 0x18(%r14,%rcx) # imm = 0x200
movq -0x18(%rax), %rcx
movl 0x18(%r14,%rcx), %esi
movl $0xffffff4f, %edi       # imm = 0xFFFFFF4F
andl %edi, %esi
orl $0x10, %esi
movl %esi, 0x18(%r14,%rcx)
movq -0x18(%rax), %rcx
leaq (%r14,%rcx), %r13
cmpb $0x0, 0xe1(%r14,%rcx)
jne 0x5afd
movq %r13, %rdi
movl $0x20, %esi
callq 0x2150
movb $0x1, 0xe1(%r13)
movq (%r14), %rax
movq 0x78(%rbx), %rdx
movb $0x20, 0xe0(%r13)
movq -0x18(%rax), %rcx
movl 0x18(%r14,%rcx), %esi
andl $-0x4b, %esi
orl $0x8, %esi
movl %esi, 0x18(%r14,%rcx)
movq -0x18(%rax), %rax
movq $0x6, 0x10(%r14,%rax)
movq 0x70(%rbx), %rax
jmp 0x5b48
movl $0x3, %edx
movq %r14, %rdi
leaq 0x17d9(%rip), %rsi      # 0x7314
callq 0x2190
movq 0x70(%rbx), %rax
movq 0x78(%rbx), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rbp, %rdx
jbe 0x5cf9
movl (%rax,%rbp,4), %esi
movq %r14, %rdi
callq 0x2250
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rcx
movl 0x18(%r13,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%r13,%rcx)
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r13, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq 0x88(%rbx), %rbp
addq $0x4, %rbp
movq %rbp, 0x88(%rbx)
cmpq 0x78(%rbx), %rbp
jne 0x5a4c
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq %rax, %r14
leaq 0x172a(%rip), %rsi      # 0x7318
movl $0x20, %edx
movq %rax, %rdi
callq 0x2190
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq 0x58(%rbx), %r13
movq %r13, 0x88(%rbx)
cmpq 0x60(%rbx), %r13
je 0x5cea
movq 0x439a(%rip), %r14      # 0x9fd8
leaq 0x16aa(%rip), %r15      # 0x72ef
leaq 0x14ee(%rip), %r12      # 0x713a
subq 0x58(%rbx), %r13
shrq $0x2, %r13
movl $0x6, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2190
movq %r14, %rdi
movl %r13d, %esi
callq 0x2250
movq %rax, %rbp
movl $0x3, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2190
movslq %r13d, %rsi
movq 0x58(%rbx), %rax
movq 0x60(%rbx), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rsi, %rdx
jbe 0x5d14
movl (%rax,%rsi,4), %esi
movq %rbp, %rdi
callq 0x2250
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r13, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq 0x88(%rbx), %r13
addq $0x4, %r13
movq %r13, 0x88(%rbx)
cmpq 0x60(%rbx), %r13
jne 0x5c4c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x154e(%rip), %rdi      # 0x724e
movq %rbp, %rsi
jmp 0x5d1b
leaq 0x1542(%rip), %rdi      # 0x724e
movq %rbp, %rsi
movq %rax, %rdx
jmp 0x5d1b
leaq 0x1533(%rip), %rdi      # 0x724e
xorl %eax, %eax
callq 0x21f0