// File: /workspace/github_cpp_makefile_star2_O1/chinmayachaudhry[P]Branch-Predictor/main.cpp
// Function: main
int main(int argc, char *argv[])
{
	string trace_file;
	ll predictor_index_bits, ghr_bits, btb_index_bits, btb_assoc;
	ll chooser_table_index_bits, bimodal_index_bits, gshare_index_bits, history_index_bits;

	ll address;
	int predictor_type;
	char actual_branch;		
	char *fname = (char *)malloc(100);

	if(strcmp(argv[1], "bimodal") == 0)
		predictor_type = 0;
	else if(strcmp(argv[1], "gshare") == 0)
		predictor_type = 1;
	else if(strcmp(argv[1], "hybrid") == 0)
		predictor_type = 2;
	else if(strcmp(argv[1], "yehpatt") == 0)
		predictor_type = 3;
	ifstream fin;

	bimodal *b;
	gshare *g;
	hybrid *h;
	yehpatt *y;
	btb *branch_buffer;
	switch(predictor_type)
	{
		case 0:
			predictor_index_bits = atol(argv[2]);
			btb_index_bits = atol(argv[3]);
			btb_assoc = atol(argv[4]);
			//cout << "index: " << btb_index_bits << " assoc: " << btb_assoc << endl;
			strcpy(fname, argv[5]);
			if(btb_index_bits == 0)
				branch_buffer = NULL;
			else
				branch_buffer = new btb(btb_index_bits, btb_assoc);
			b = new bimodal(predictor_index_bits, branch_buffer);
			break;
//			b->display_table();
//			cout << "BIMODAL";
	
		case 1:
			predictor_index_bits = atol(argv[2]);
			ghr_bits = atol(argv[3]);
			btb_index_bits = atol(argv[4]);
			btb_assoc = atol(argv[5]);
			//cout << "index: " << btb_index_bits << " assoc: " << btb_assoc << endl;
			strcpy(fname, argv[6]);
			if(btb_index_bits == 0)
				branch_buffer = NULL;
			else
				branch_buffer = new btb(btb_index_bits, btb_assoc);
			g = new gshare(predictor_index_bits, ghr_bits, branch_buffer);
			break;
//			b->display_table();
//			cout << "BIMODAL";
		
		case 2:
			chooser_table_index_bits = atol(argv[2]);
			gshare_index_bits = atol(argv[3]);
			ghr_bits = atol(argv[4]);
			bimodal_index_bits = atol(argv[5]);
			btb_index_bits = atol(argv[6]);
			btb_assoc = atol(argv[7]);
			//cout << "index: " << btb_index_bits << " assoc: " << btb_assoc << endl;
			strcpy(fname, argv[8]);
			if(btb_index_bits == 0)
				branch_buffer = NULL;
			else
				branch_buffer = new btb(btb_index_bits, btb_assoc);
			h = new hybrid(bimodal_index_bits, gshare_index_bits, ghr_bits, chooser_table_index_bits, branch_buffer);
			break;
//			b->display_table();
//			cout << "BIMODAL";
		
		case 3:
			history_index_bits = atol(argv[2]);
			predictor_index_bits = atol(argv[3]);
			btb_index_bits = atol(argv[4]);
			btb_assoc = atol(argv[5]);
			//cout << "index: " << btb_index_bits << " assoc: " << btb_assoc << endl;
			strcpy(fname, argv[6]);
			if(btb_index_bits == 0)
				branch_buffer = NULL;
			else
				branch_buffer = new btb(btb_index_bits, btb_assoc);
			y = new yehpatt(history_index_bits, predictor_index_bits, branch_buffer);
			break;

	}

	fin.open(fname);
	static int branches = 0;
	switch(predictor_type)
	{
		case 0:
			while(fin >> hex >> address >> actual_branch)
			{
				branches++;
				if(btb_index_bits != 0 && btb_assoc != 0)
				{
					branch_buffer->access(address, actual_branch);
					if(branch_buffer->get_btb_Hit() == true)		
						b->access(address, actual_branch);	
				}	
				else
					b->access(address, actual_branch);	
			}
			fin.close();
			break;

		case 1:
			while(fin >> hex >> address >> actual_branch)
			{
				branches++;
				if(btb_index_bits != 0 && btb_assoc != 0)
				{
					branch_buffer->access(address, actual_branch);
					if(branch_buffer->get_btb_Hit() == true)		
						g->access(address, actual_branch);	
				}	
				else
					g->access(address, actual_branch);	
			}
			fin.close();
			break;

		case 2:
			while(fin >> hex >> address >> actual_branch)
			{
				branches++;
				if(btb_index_bits != 0 && btb_assoc != 0)
				{
					branch_buffer->access(address, actual_branch);
					if(branch_buffer->get_btb_Hit() == true)		
						h->access(address, actual_branch);	
				}	
				else
					h->access(address, actual_branch);	
			}
			fin.close();
			break;
		
		case 3:
			while(fin >> hex >> address >> actual_branch)
			{
				branches++;
				if(btb_index_bits != 0 && btb_assoc != 0)
				{
					branch_buffer->access(address, actual_branch);
					if(branch_buffer->get_btb_Hit() == true)		
						y->access(address, actual_branch);	
				}	
				else
					y->access(address, actual_branch);	
			}
			fin.close();
			break;
	}

	
	cout << "Command Line:" << endl;
	switch(predictor_type)
	{
		case 0:	
			cout << "./sim_bp bimodal " << argv[2] << " " << argv[3] << " " << argv[4] << " " << argv[5] << endl;
			b->display_table();
			b->print_stats();
			break;

		case 1:	
			cout << "./sim_bp gshare " << argv[2] << " " << argv[3] << " " << argv[4] << " " << argv[5] << " " << argv[6] << endl;
			g->display_table();
			g->print_stats();
			break;	
		
		case 2:	
			cout << "./sim_bp hybrid " << argv[2] << " " << argv[3] << " " << argv[4] << " " << argv[5] << " " << argv[6] << " " << argv[7] << " " << argv[8] << endl;
			h->display_table();
			h->print_stats();
			break;	
		
		case 3:	
			cout << "./sim_bp yehpatt " << argv[2] << " " << argv[3] << " " << argv[4] << " " << argv[5] << " " << argv[6] << endl;
			y->display_table();
			y->print_stats();
			break;	
	}
	
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movq %rsi, %rbx
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl $0x64, %edi
callq 0x21c0
movq %rax, 0x20(%rsp)
movq %rbx, 0x8(%rsp)
movq 0x8(%rbx), %rbx
leaq 0x4af1(%rip), %rsi      # 0x7034
movq %rbx, %rdi
callq 0x21e0
testl %eax, %eax
je 0x257e
leaq 0x4ae6(%rip), %rsi      # 0x703c
movq %rbx, %rdi
callq 0x21e0
testl %eax, %eax
je 0x2582
leaq 0x4ada(%rip), %rsi      # 0x7043
movq %rbx, %rdi
callq 0x21e0
cmpl $0x1, %eax
movl $0x3, %ebx
sbbl $0x0, %ebx
jmp 0x2587
xorl %ebx, %ebx
jmp 0x2587
movl $0x1, %ebx
leaq 0x60(%rsp), %rdi
callq 0x2180
movl %ebx, %ecx
leaq 0x4a6a(%rip), %rax      # 0x7004
movq %rcx, 0x38(%rsp)
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x8(%rsp), %r12
movq 0x10(%r12), %rdi
callq 0x21a0
movq %rax, %r15
movq 0x18(%r12), %rdi
callq 0x21a0
movq %rax, %rbx
movq 0x20(%r12), %rdi
callq 0x21a0
movq %rax, %r14
movq 0x28(%r12), %rsi
movq 0x20(%rsp), %rdi
callq 0x2140
testq %rbx, %rbx
je 0x27c0
movl $0x40, %edi
callq 0x2160
movq %rax, %rbp
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x34f8
jmp 0x27c2
movq 0x8(%rsp), %rbp
movq 0x10(%rbp), %rdi
callq 0x21a0
movq %rax, 0x18(%rsp)
movq 0x18(%rbp), %rdi
callq 0x21a0
movq %rax, %r12
movq 0x20(%rbp), %rdi
callq 0x21a0
movq %rax, %r13
movq 0x28(%rbp), %rdi
callq 0x21a0
movq %rax, %r15
movq 0x30(%rbp), %rdi
callq 0x21a0
movq %rax, %rbx
movq 0x38(%rbp), %rdi
callq 0x21a0
movq %rax, %r14
movq 0x40(%rbp), %rsi
movq 0x20(%rsp), %rdi
callq 0x2140
testq %rbx, %rbx
je 0x276c
movl $0x40, %edi
callq 0x2160
movq %rax, %rbp
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x34f8
jmp 0x276e
movq 0x8(%rsp), %r12
movq 0x10(%r12), %rdi
callq 0x21a0
movq %rax, %r15
movq 0x18(%r12), %rdi
callq 0x21a0
movq %rax, %r13
movq 0x20(%r12), %rdi
callq 0x21a0
movq %rax, %rbx
movq 0x28(%r12), %rdi
callq 0x21a0
movq %rax, %r14
movq 0x30(%r12), %rsi
movq 0x20(%rsp), %rdi
callq 0x2140
testq %rbx, %rbx
je 0x279a
movl $0x40, %edi
callq 0x2160
movq %rax, %rbp
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x34f8
jmp 0x279c
movq 0x8(%rsp), %r13
movq 0x10(%r13), %rdi
callq 0x21a0
movq %rax, %r15
movq 0x18(%r13), %rdi
callq 0x21a0
movq %rax, %r12
movq 0x20(%r13), %rdi
callq 0x21a0
movq %rax, %rbx
movq 0x28(%r13), %rdi
callq 0x21a0
movq %rax, %r14
movq 0x30(%r13), %rsi
movq 0x20(%rsp), %rdi
callq 0x2140
testq %rbx, %rbx
je 0x27df
movl $0x40, %edi
callq 0x2160
movq %rax, %rbp
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x34f8
jmp 0x27e1
xorl %ebp, %ebp
movl $0x78, %edi
callq 0x2160
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
movq 0x18(%rsp), %r8
movq %rbp, %r9
callq 0x4e76
jmp 0x2803
xorl %ebp, %ebp
movl $0x98, %edi
callq 0x2160
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0x56be
jmp 0x2803
xorl %ebp, %ebp
movl $0x60, %edi
callq 0x2160
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x3da6
jmp 0x2803
xorl %ebp, %ebp
movl $0x88, %edi
callq 0x2160
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbp, %rcx
callq 0x45e2
leaq 0x60(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x8, %edx
callq 0x20d0
leaq 0x47f6(%rip), %rax      # 0x7014
movq 0x38(%rsp), %rcx
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
testq %rbx, %rbx
setne %al
testq %r14, %r14
setne %r12b
andb %al, %r12b
leaq 0x60(%rsp), %rbx
leaq 0x10(%rsp), %r14
leaq 0x7(%rsp), %r15
movq 0x60(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x78(%rsp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x78(%rsp,%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21d0
movq %rax, %rdi
movq %r15, %rsi
callq 0x21b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2a92
incl 0x78d8(%rip)            # 0xa168
movq 0x10(%rsp), %rsi
movb 0x7(%rsp), %al
testb %r12b, %r12b
je 0x28b8
movsbl %al, %edx
movq %rbp, %rdi
callq 0x3628
cmpb $0x1, 0x38(%rbp)
jne 0x284b
movq 0x10(%rsp), %rsi
movb 0x7(%rsp), %al
movsbl %al, %edx
movq %r13, %rdi
callq 0x3f34
jmp 0x284b
testq %rbx, %rbx
setne %al
testq %r14, %r14
setne %r12b
andb %al, %r12b
leaq 0x60(%rsp), %rbx
leaq 0x10(%rsp), %r14
leaq 0x7(%rsp), %r15
movq 0x60(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x78(%rsp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x78(%rsp,%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21d0
movq %rax, %rdi
movq %r15, %rsi
callq 0x21b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2a92
incl 0x783f(%rip)            # 0xa168
movq 0x10(%rsp), %rsi
movb 0x7(%rsp), %al
testb %r12b, %r12b
je 0x2951
movsbl %al, %edx
movq %rbp, %rdi
callq 0x3628
cmpb $0x1, 0x38(%rbp)
jne 0x28e4
movq 0x10(%rsp), %rsi
movb 0x7(%rsp), %al
movsbl %al, %edx
movq 0x28(%rsp), %rdi
callq 0x50d2
jmp 0x28e4
testq %rbx, %rbx
setne %al
testq %r14, %r14
setne %r12b
andb %al, %r12b
leaq 0x60(%rsp), %rbx
leaq 0x10(%rsp), %r14
leaq 0x7(%rsp), %r15
movq 0x60(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x78(%rsp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x78(%rsp,%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21d0
movq %rax, %rdi
movq %r15, %rsi
callq 0x21b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2a92
incl 0x77a4(%rip)            # 0xa168
movq 0x10(%rsp), %rsi
movb 0x7(%rsp), %al
testb %r12b, %r12b
je 0x29ec
movsbl %al, %edx
movq %rbp, %rdi
callq 0x3628
cmpb $0x1, 0x38(%rbp)
jne 0x297f
movq 0x10(%rsp), %rsi
movb 0x7(%rsp), %al
movsbl %al, %edx
movq 0x30(%rsp), %rdi
callq 0x5982
jmp 0x297f
testq %rbx, %rbx
setne %al
testq %r14, %r14
setne %r12b
andb %al, %r12b
leaq 0x60(%rsp), %rbx
leaq 0x10(%rsp), %r14
leaq 0x7(%rsp), %r15
movq 0x60(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x78(%rsp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x78(%rsp,%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21d0
movq %rax, %rdi
movq %r15, %rsi
callq 0x21b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2a92
incl 0x770d(%rip)            # 0xa168
movq 0x10(%rsp), %rsi
movb 0x7(%rsp), %al
testb %r12b, %r12b
je 0x2a83
movsbl %al, %edx
movq %rbp, %rdi
callq 0x3628
cmpb $0x1, 0x38(%rbp)
jne 0x2a1a
movq 0x10(%rsp), %rsi
movb 0x7(%rsp), %al
movsbl %al, %edx
movq 0x18(%rsp), %rdi
callq 0x47ea
jmp 0x2a1a
leaq 0x60(%rsp), %rdi
callq 0x2050
movq 0x7535(%rip), %rbx      # 0x9fd8
leaq 0x45a0(%rip), %rsi      # 0x704a
movl $0xd, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq 0x7503(%rip), %rdi      # 0x9fd8
callq 0x2040
movq %rax, %rdi
callq 0x20e0
leaq 0x453b(%rip), %rax      # 0x7024
movq 0x38(%rsp), %rcx
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x74da(%rip), %rbx      # 0x9fd8
leaq 0x4553(%rip), %rsi      # 0x7058
movl $0x11, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x8(%rsp), %rax
movq 0x10(%rax), %r14
testq %r14, %r14
je 0x2ced
movq %r14, %rdi
callq 0x20a0
movq 0x74a5(%rip), %rdi      # 0x9fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x2190
jmp 0x2d04
movq 0x748e(%rip), %rbx      # 0x9fd8
leaq 0x452a(%rip), %rsi      # 0x707b
movl $0x10, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x8(%rsp), %rax
movq 0x10(%rax), %r14
testq %r14, %r14
je 0x2c27
movq %r14, %rdi
callq 0x20a0
movq 0x7459(%rip), %rdi      # 0x9fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x2190
jmp 0x2c3e
movq 0x7442(%rip), %rbx      # 0x9fd8
leaq 0x44ef(%rip), %rsi      # 0x708c
movl $0x11, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x8(%rsp), %rax
movq 0x10(%rax), %r14
testq %r14, %r14
je 0x2c8a
movq %r14, %rdi
callq 0x20a0
movq 0x740d(%rip), %rdi      # 0x9fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x2190
jmp 0x2ca1
movq 0x73f6(%rip), %rbx      # 0x9fd8
leaq 0x4481(%rip), %rsi      # 0x706a
movl $0x10, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x8(%rsp), %rax
movq 0x10(%rax), %r14
testq %r14, %r14
je 0x2d50
movq %r14, %rdi
callq 0x20a0
movq 0x73c1(%rip), %rdi      # 0x9fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x2190
jmp 0x2d67
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2240
movq 0x7393(%rip), %rbx      # 0x9fd8
leaq 0x4492(%rip), %rsi      # 0x70de
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x8(%rsp), %rax
movq 0x18(%rax), %r14
testq %r14, %r14
je 0x2db3
movq %r14, %rdi
callq 0x20a0
movq 0x735e(%rip), %rdi      # 0x9fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x2190
jmp 0x2dca
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2240
movq 0x7330(%rip), %rbx      # 0x9fd8
leaq 0x442f(%rip), %rsi      # 0x70de
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x8(%rsp), %rax
movq 0x18(%rax), %r14
testq %r14, %r14
je 0x2e16
movq %r14, %rdi
callq 0x20a0
movq 0x72fb(%rip), %rdi      # 0x9fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x2190
jmp 0x2e2d
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2240
movq 0x72cd(%rip), %rbx      # 0x9fd8
leaq 0x43cc(%rip), %rsi      # 0x70de
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x8(%rsp), %rax
movq 0x18(%rax), %r14
testq %r14, %r14
je 0x2e79
movq %r14, %rdi
callq 0x20a0
movq 0x7298(%rip), %rdi      # 0x9fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x2190
jmp 0x2e90
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2240
movq 0x726a(%rip), %rbx      # 0x9fd8
leaq 0x4369(%rip), %rsi      # 0x70de
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x8(%rsp), %rax
movq 0x18(%rax), %r14
testq %r14, %r14
je 0x2edc
movq %r14, %rdi
callq 0x20a0
movq 0x7235(%rip), %rdi      # 0x9fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x2190
jmp 0x2ef3
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2240
movq 0x7207(%rip), %rbx      # 0x9fd8
leaq 0x4306(%rip), %rsi      # 0x70de
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x8(%rsp), %rax
movq 0x20(%rax), %r14
testq %r14, %r14
je 0x2f3f
movq %r14, %rdi
callq 0x20a0
movq 0x71d2(%rip), %rdi      # 0x9fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x2190
jmp 0x2f56
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2240
movq 0x71a4(%rip), %rbx      # 0x9fd8
leaq 0x42a3(%rip), %rsi      # 0x70de
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x8(%rsp), %rax
movq 0x20(%rax), %r14
testq %r14, %r14
je 0x2fa2
movq %r14, %rdi
callq 0x20a0
movq 0x716f(%rip), %rdi      # 0x9fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x2190
jmp 0x2fb9
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2240
movq 0x7141(%rip), %rbx      # 0x9fd8
leaq 0x4240(%rip), %rsi      # 0x70de
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x8(%rsp), %rax
movq 0x20(%rax), %r14
testq %r14, %r14
je 0x3005
movq %r14, %rdi
callq 0x20a0
movq 0x710c(%rip), %rdi      # 0x9fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x2190
jmp 0x301c
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2240
movq 0x70de(%rip), %rbx      # 0x9fd8
leaq 0x41dd(%rip), %rsi      # 0x70de
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x8(%rsp), %rax
movq 0x20(%rax), %r14
testq %r14, %r14
je 0x3068
movq %r14, %rdi
callq 0x20a0
movq 0x70a9(%rip), %rdi      # 0x9fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x2190
jmp 0x307f
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2240
movq 0x707b(%rip), %rbx      # 0x9fd8
leaq 0x417a(%rip), %rsi      # 0x70de
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x8(%rsp), %rax
movq 0x28(%rax), %r14
testq %r14, %r14
je 0x30cb
movq %r14, %rdi
callq 0x20a0
movq 0x7046(%rip), %rdi      # 0x9fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x2190
jmp 0x30e2
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2240
movq 0x7018(%rip), %rbx      # 0x9fd8
leaq 0x4117(%rip), %rsi      # 0x70de
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x8(%rsp), %rax
movq 0x28(%rax), %r14
testq %r14, %r14
je 0x312e
movq %r14, %rdi
callq 0x20a0
movq 0x6fe3(%rip), %rdi      # 0x9fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x2190
jmp 0x3145
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2240
movq 0x6fb5(%rip), %rbx      # 0x9fd8
leaq 0x40b4(%rip), %rsi      # 0x70de
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x8(%rsp), %rax
movq 0x28(%rax), %r14
testq %r14, %r14
je 0x3191
movq %r14, %rdi
callq 0x20a0
movq 0x6f80(%rip), %rdi      # 0x9fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x2190
jmp 0x31a8
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2240
movq 0x6f52(%rip), %rbx      # 0x9fd8
leaq 0x4051(%rip), %rsi      # 0x70de
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x8(%rsp), %rax
movq 0x28(%rax), %r14
testq %r14, %r14
je 0x31e8
movq %r14, %rdi
callq 0x20a0
movq 0x6f1d(%rip), %rdi      # 0x9fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x2190
jmp 0x31ff
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2240
movq 0x6eef(%rip), %rbx      # 0x9fd8
leaq 0x3fee(%rip), %rsi      # 0x70de
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x8(%rsp), %rax
movq 0x30(%rax), %r14
testq %r14, %r14
je 0x324b
movq %r14, %rdi
callq 0x20a0
movq 0x6eba(%rip), %rdi      # 0x9fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x2190
jmp 0x3262
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2240
movq 0x6e8c(%rip), %rbx      # 0x9fd8
leaq 0x3f8b(%rip), %rsi      # 0x70de
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x8(%rsp), %rax
movq 0x30(%rax), %r14
testq %r14, %r14
je 0x32ae
movq %r14, %rdi
callq 0x20a0
movq 0x6e57(%rip), %rdi      # 0x9fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x2190
jmp 0x32c5
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2240
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq 0x6e12(%rip), %rdi      # 0x9fd8
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq %r13, %rdi
callq 0x3f64
movq %r13, %rdi
callq 0x40c8
jmp 0x3416
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2240
movq 0x6dd2(%rip), %rbx      # 0x9fd8
leaq 0x3ed1(%rip), %rsi      # 0x70de
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x8(%rsp), %rax
movq 0x30(%rax), %r14
testq %r14, %r14
je 0x3309
movq %r14, %rdi
callq 0x20a0
movq 0x6d9d(%rip), %rdi      # 0x9fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x2190
jmp 0x3320
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2240
movq 0x6d6f(%rip), %rbx      # 0x9fd8
leaq 0x3e6e(%rip), %rsi      # 0x70de
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x8(%rsp), %rax
movq 0x38(%rax), %r14
testq %r14, %r14
je 0x3364
movq %r14, %rdi
callq 0x20a0
movq 0x6d3a(%rip), %rdi      # 0x9fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x2190
jmp 0x337b
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2240
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq 0x6cf5(%rip), %rdi      # 0x9fd8
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq 0x30(%rsp), %rdi
callq 0x59ac
movq 0x30(%rsp), %rdi
callq 0x5d1e
jmp 0x3416
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2240
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq 0x6c9a(%rip), %rdi      # 0x9fd8
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq 0x18(%rsp), %rdi
callq 0x4814
movq 0x18(%rsp), %rdi
callq 0x4a8c
jmp 0x3416
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2240
movq 0x6c56(%rip), %rbx      # 0x9fd8
leaq 0x3d55(%rip), %rsi      # 0x70de
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x8(%rsp), %rax
movq 0x40(%rax), %r14
testq %r14, %r14
je 0x33c0
movq %r14, %rdi
callq 0x20a0
movq 0x6c25(%rip), %rdi      # 0x9fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x2190
jmp 0x33d7
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2240
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq 0x6be3(%rip), %rdi      # 0x9fd8
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq 0x28(%rsp), %rdi
callq 0x516a
movq 0x28(%rsp), %rdi
callq 0x52e0
leaq 0x60(%rsp), %rdi
callq 0x2060
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x343c
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2170
movl $0x1, %eax
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3459
jmp 0x3459
jmp 0x3459
movq %rax, %rbx
movl $0x40, %esi
movq %rbp, %rdi
jmp 0x349e
movq %rax, %rbx
movl $0x88, %esi
movq 0x18(%rsp), %rdi
jmp 0x349e
movq %rax, %rbx
movl $0x60, %esi
movq %r13, %rdi
jmp 0x349e
movq %rax, %rbx
movl $0x98, %esi
movq 0x30(%rsp), %rdi
jmp 0x349e
movq %rax, %rbx
movl $0x78, %esi
movq 0x28(%rsp), %rdi
callq 0x2170
jmp 0x34b5
movq %rax, %rbx
jmp 0x34bf
jmp 0x34b2
jmp 0x34b2
jmp 0x34b2
jmp 0x34b2
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x2060
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x34db
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2170
movq %rbx, %rdi
callq 0x2260
nop