// File: /workspace/github_cpp_makefile_star2_O3/chinmayachaudhry[P]Branch-Predictor/gshare.cpp
// Function: gshare::display_table()
void gshare :: display_table()
{
	if(branch_buffer != NULL)
		branch_buffer->display();
	
	cout << endl << "Final GShare 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;	
	}

	cout << showbase << internal << setfill(' ');
	cout << endl << "Final GHR Contents: " << hex << setw(10) << ghr_register << dec << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x80(%rdi), %rdi
testq %rdi, %rdi
je 0x4829
callq 0x391e
movq 0x57a8(%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, %r14
leaq 0x2a37(%rip), %rsi      # 0x7298
movl $0x1c, %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 0x60(%rbx), %rbp
movq %rbp, 0x78(%rbx)
cmpq 0x68(%rbx), %rbp
je 0x4957
movq 0x572a(%rip), %r15      # 0x9fd8
leaq 0x2a3a(%rip), %r12      # 0x72ef
leaq 0x287e(%rip), %r13      # 0x713a
subq 0x60(%rbx), %rbp
shrq $0x2, %rbp
movl $0x6, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2190
movq %r15, %rdi
movl %ebp, %esi
callq 0x2250
movq %rax, %r14
movl $0x3, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2190
movslq %ebp, %rsi
movq 0x60(%rbx), %rax
movq 0x68(%rbx), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rsi, %rdx
jbe 0x4a6c
movl (%rax,%rsi,4), %esi
movq %r14, %rdi
callq 0x2250
movq %rax, %r14
movq (%rax), %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 0x78(%rbx), %rbp
addq $0x4, %rbp
movq %rbp, 0x78(%rbx)
cmpq 0x68(%rbx), %rbp
jne 0x48bc
movq 0x567a(%rip), %r15      # 0x9fd8
movq (%r15), %rax
movq -0x18(%rax), %rcx
orl $0x200, 0x18(%r15,%rcx) # imm = 0x200
movq -0x18(%rax), %rcx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl 0x18(%r15,%rcx), %edx
orl $0x10, %edx
movl %edx, 0x18(%r15,%rcx)
movq -0x18(%rax), %rcx
leaq (%r15,%rcx), %r14
cmpb $0x0, 0xe1(%r15,%rcx)
jne 0x49af
movq %r14, %rdi
movl $0x20, %esi
callq 0x2150
movb $0x1, 0xe1(%r14)
movq (%r15), %rax
movb $0x20, 0xe0(%r14)
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 %rax, %r14
leaq 0x28d0(%rip), %rsi      # 0x72b5
movl $0x14, %edx
movq %rax, %rdi
callq 0x2190
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 $0xa, 0x10(%r14,%rax)
movq 0x38(%rbx), %rsi
movq %r14, %rdi
callq 0x2090
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rcx
movl 0x18(%rbx,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rbx,%rcx)
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20e0
leaq 0x27db(%rip), %rdi      # 0x724e
xorl %eax, %eax
callq 0x21f0