// File: /workspace/github_cpp_makefile_star2_O1/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 0x59cb
callq 0x3926
movq 0x4606(%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 0x18f3(%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 0x5bc7
leaq 0x189c(%rip), %r15      # 0x72ef
leaq 0x16e0(%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), %rax
movq 0x78(%rbx), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rbp, %rdx
jbe 0x5d03
cmpl $0x0, (%rax,%rbp,4)
je 0x5b36
movq (%r14), %rax
movq -0x18(%rax), %rcx
orl $0x200, 0x18(%r14,%rcx) # imm = 0x200
movq -0x18(%rax), %rcx
movl 0x18(%r14,%rcx), %edx
movl $0xffffff4f, %esi       # imm = 0xFFFFFF4F
andl %esi, %edx
orl $0x10, %edx
movl %edx, 0x18(%r14,%rcx)
movq -0x18(%rax), %rax
leaq (%r14,%rax), %r13
cmpb $0x0, 0xe1(%r14,%rax)
jne 0x5b08
movq %r13, %rdi
movl $0x20, %esi
callq 0x2150
movb %al, 0xe0(%r13)
movb $0x1, 0xe1(%r13)
movb $0x20, 0xe0(%r13)
movq (%r14), %rax
movq -0x18(%rax), %rcx
movl 0x18(%r14,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%r14,%rcx)
movq -0x18(%rax), %rax
movq $0x6, 0x10(%r14,%rax)
jmp 0x5b4a
movl $0x3, %edx
movq %r14, %rdi
leaq 0x17cf(%rip), %rsi      # 0x7314
callq 0x2190
movq 0x70(%rbx), %rax
movq 0x78(%rbx), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rbp, %rdx
jbe 0x5d03
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 0x5a5a
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 0x1720(%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 0x5cf4
movq 0x4390(%rip), %r14      # 0x9fd8
leaq 0x16a0(%rip), %r15      # 0x72ef
leaq 0x14e4(%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 0x5d0f
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 0x5c56
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1544(%rip), %rdi      # 0x724e
movq %rbp, %rsi
jmp 0x5d16
leaq 0x1538(%rip), %rdi      # 0x724e
xorl %eax, %eax
callq 0x21f0
nop