// File: RuiDGPires[P]CrimLang/src/generator.cpp
// Function: gc_Tracker::factor(crl::Node*, std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char>>&)
u32 _gc_Tracker::factor(crl::Node *node, std::stringstream &stream){
	u32 reg;

//	ASSERT(node->type == crl::Node::Type::FACTOR, "Factor needs to be factor " + std::to_string(node->type));

	if (node->get_child(0)->type == crl::Node::Type::LEAF){
		reg = this->reg_tracker.alloc();
		std::string reg_name = reg_tracker.reg_name(reg);

		crl::Token t = get_token(node->get_child(0));
		switch (t.type){
			case crl::Token::Type::IDENT:
				if (this->symb_tracker.has_local(t.str)){
					std::pair<u32, bool> p = symb_tracker.get_local(t.str);
					stream <<
						"LOAD " << reg_name << " m[RF][-" << p.first << "]\n";
					if (p.second)
						stream <<
							"LOAD " << reg_name << " m[" << reg_name << "]\n";

				}else{
					stream <<
						"MVI " << reg_name << " " << symb_tracker.get_global(t.str) << "\n" <<
						"LOAD " << reg_name << " m[" << reg_name << "]\n";
				}
				break;
			case crl::Token::Type::INT:
				stream <<
					"MVI " << reg_name << " " << t.str << "\n";
				break;
			case crl::Token::Type::CHAR:
				stream <<
					"MVI " << reg_name << " '" << t.str << "'\n'";
				break;
			default:
				ASSERT(false, "Factor not implemented");
				break;
		}
		
	}else if (node->get_child(0)->type == crl::Node::Type::VECTOR){
		reg = this->reg_tracker.alloc();
		std::string reg_name = reg_tracker.reg_name(reg);

		crl::Token t = get_token(node->get_child(0)->get_child(0));
		u32 offset = atoi(get_token(node->get_child(0)->get_child(1)).str.c_str());
		if (this->symb_tracker.has_local(t.str)){
			std::pair<u32, bool> p = symb_tracker.get_local(t.str);
			if (p.second)
				stream <<
					"LOAD " << reg_name << " m[RF][-" << p.first << "]\n" << 
					"LOAD " << reg_name << " m[" << reg_name << "][-" << offset << "]\n";
			else
				stream <<
					"LOAD " << reg_name << " m[RF][-" << p.first + offset << "]\n";
		}else
			stream <<
				"MVI " << reg_name << " " << symb_tracker.get_global(t.str) << "\n" <<
				"LOAD " << reg_name << " m[" << reg_name << "][-" << offset << "]\n";

	}else if (node->get_child(0)->type == crl::Node::Type::EXPRESSION)
		reg =  this->expression_reg(node->get_child(0), stream);
	else if (node->get_child(0)->type == crl::Node::Type::CAST)
		if (node->get_child(0)->get_child(0)->type == crl::Node::Type::EXPRESSION)
			reg = this->expression_reg(node->get_child(0)->get_child(0), stream);
		else
			reg = this->factor(node->get_child(0), stream);
	else if (node->get_child(0)->type == crl::Node::Type::CALL){
		this->func_call(node->get_child(0), stream);
		reg = this->reg_tracker.alloc();	
		stream << "POP " << reg_tracker.reg_name(reg) << "\n"; // TODO Size larger than 1
	}else if (node->get_child(0)->type == crl::Node::Type::INC || node->get_child(0)->type == crl::Node::Type::DEC){
		reg = unary_reg(node->get_child(0)); 
	}else ASSERT(false, "Not implemented");
	
	return reg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4e0, %rsp            # imm = 0x4E0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x250(%rbp)
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x18(%rax)
cmpl $0x10, 0x8(%rax)
jne 0x99e1
movq -0x250(%rbp), %rdi
addq $0x500, %rdi            # imm = 0x500
movq %rdi, -0x260(%rbp)
callq 0x12ee0
movq -0x260(%rbp), %rsi
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %edx
leaq -0x40(%rbp), %rdi
callq 0x13040
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
xorl %esi, %esi
callq *%rax
movq %rax, -0x258(%rbp)
jmp 0x93e0
movq -0x258(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0xa2e0
jmp 0x93f2
movl -0x50(%rbp), %eax
movl %eax, -0x264(%rbp)
subl $0x1, %eax
je 0x9438
jmp 0x9402
movl -0x264(%rbp), %eax
subl $0x13, %eax
je 0x97d5
jmp 0x9413
movl -0x264(%rbp), %eax
subl $0x1b, %eax
je 0x985a
jmp 0x98df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x99d3
movq -0x250(%rbp), %rax
addq $0x530, %rax            # imm = 0x530
movq %rax, -0x270(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x4150
jmp 0x945e
movq -0x270(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x13160
movb %al, -0x271(%rbp)
jmp 0x9479
leaq -0xa0(%rbp), %rdi
callq 0x41e0
movb -0x271(%rbp), %al
testb $0x1, %al
jne 0x9494
jmp 0x965c
movq -0x250(%rbp), %rax
addq $0x530, %rax            # imm = 0x530
movq %rax, -0x280(%rbp)
leaq -0xc8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x4150
jmp 0x94ba
movq -0x280(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x131d0
movq %rax, -0x288(%rbp)
jmp 0x94d6
movq -0x288(%rbp), %rax
movl %eax, %ecx
movl %ecx, -0xa8(%rbp)
shrq $0x20, %rax
movb %al, -0xa4(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x41e0
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
leaq 0x21d36(%rip), %rsi     # 0x2b240
callq 0x42e0
movq %rax, -0x290(%rbp)
jmp 0x9518
movq -0x290(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x42c0
movq %rax, -0x298(%rbp)
jmp 0x9531
movq -0x298(%rbp), %rdi
leaq 0x220a1(%rip), %rsi     # 0x2b5e0
callq 0x42e0
movq %rax, -0x2a0(%rbp)
jmp 0x954d
movq -0x2a0(%rbp), %rdi
movl -0xa8(%rbp), %esi
callq 0x4420
movq %rax, -0x2a8(%rbp)
jmp 0x9568
movq -0x2a8(%rbp), %rdi
leaq 0x21cd0(%rip), %rsi     # 0x2b246
callq 0x42e0
jmp 0x957d
testb $0x1, -0xa4(%rbp)
je 0x9657
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
leaq 0x21ca7(%rip), %rsi     # 0x2b240
callq 0x42e0
movq %rax, -0x2b0(%rbp)
jmp 0x95a7
movq -0x2b0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x42c0
movq %rax, -0x2b8(%rbp)
jmp 0x95c0
movq -0x2b8(%rbp), %rdi
leaq 0x22006(%rip), %rsi     # 0x2b5d4
callq 0x42e0
movq %rax, -0x2c0(%rbp)
jmp 0x95dc
movq -0x2c0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x42c0
movq %rax, -0x2c8(%rbp)
jmp 0x95f5
movq -0x2c8(%rbp), %rdi
leaq 0x21c43(%rip), %rsi     # 0x2b246
callq 0x42e0
jmp 0x960a
jmp 0x9657
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x99ca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x41e0
jmp 0x99ca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x41e0
jmp 0x99ca
jmp 0x97d0
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
leaq 0x21bde(%rip), %rsi     # 0x2b249
callq 0x42e0
movq %rax, -0x2d0(%rbp)
jmp 0x9679
movq -0x2d0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x42c0
movq %rax, -0x2d8(%rbp)
jmp 0x9692
movq -0x2d8(%rbp), %rdi
leaq 0x21965(%rip), %rsi     # 0x2b005
callq 0x42e0
movq %rax, -0x2e0(%rbp)
jmp 0x96ae
movq -0x250(%rbp), %rax
addq $0x530, %rax            # imm = 0x530
movq %rax, -0x2e8(%rbp)
leaq -0xe8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x4150
jmp 0x96d4
movq -0x2e8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x13210
movl %eax, -0x2ec(%rbp)
jmp 0x96ef
movl -0x2ec(%rbp), %esi
movq -0x2e0(%rbp), %rdi
callq 0x4420
movq %rax, -0x2f8(%rbp)
jmp 0x970a
movq -0x2f8(%rbp), %rdi
leaq 0x21dcb(%rip), %rsi     # 0x2b4e3
callq 0x42e0
movq %rax, -0x300(%rbp)
jmp 0x9726
movq -0x300(%rbp), %rdi
leaq 0x21b0c(%rip), %rsi     # 0x2b240
callq 0x42e0
movq %rax, -0x308(%rbp)
jmp 0x9742
movq -0x308(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x42c0
movq %rax, -0x310(%rbp)
jmp 0x975b
movq -0x310(%rbp), %rdi
leaq 0x21e6b(%rip), %rsi     # 0x2b5d4
callq 0x42e0
movq %rax, -0x318(%rbp)
jmp 0x9777
movq -0x318(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x42c0
movq %rax, -0x320(%rbp)
jmp 0x9790
movq -0x320(%rbp), %rdi
leaq 0x21aa8(%rip), %rsi     # 0x2b246
callq 0x42e0
jmp 0x97a5
leaq -0xe8(%rbp), %rdi
callq 0x41e0
jmp 0x97d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x41e0
jmp 0x99ca
jmp 0x99b3
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
leaq 0x21a65(%rip), %rsi     # 0x2b249
callq 0x42e0
movq %rax, -0x328(%rbp)
jmp 0x97f2
movq -0x328(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x42c0
movq %rax, -0x330(%rbp)
jmp 0x980b
movq -0x330(%rbp), %rdi
leaq 0x217ec(%rip), %rsi     # 0x2b005
callq 0x42e0
movq %rax, -0x338(%rbp)
jmp 0x9827
movq -0x338(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x42c0
movq %rax, -0x340(%rbp)
jmp 0x9840
movq -0x340(%rbp), %rdi
leaq 0x21c95(%rip), %rsi     # 0x2b4e3
callq 0x42e0
jmp 0x9855
jmp 0x99b3
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
leaq 0x219e0(%rip), %rsi     # 0x2b249
callq 0x42e0
movq %rax, -0x348(%rbp)
jmp 0x9877
movq -0x348(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x42c0
movq %rax, -0x350(%rbp)
jmp 0x9890
movq -0x350(%rbp), %rdi
leaq 0x219b0(%rip), %rsi     # 0x2b24e
callq 0x42e0
movq %rax, -0x358(%rbp)
jmp 0x98ac
movq -0x358(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x42c0
movq %rax, -0x360(%rbp)
jmp 0x98c5
movq -0x360(%rbp), %rdi
leaq 0x2197e(%rip), %rsi     # 0x2b251
callq 0x42e0
jmp 0x98da
jmp 0x99b3
movb $0x1, -0x10a(%rbp)
movl $0x50, %edi
callq 0x4190
movq %rax, -0x370(%rbp)
leaq -0x109(%rbp), %rdi
movq %rdi, -0x368(%rbp)
callq 0x4590
movq -0x368(%rbp), %rdx
leaq 0x2193d(%rip), %rsi     # 0x2b255
leaq -0x108(%rbp), %rdi
callq 0x52e0
jmp 0x9926
movq -0x370(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq -0x108(%rbp), %rcx
movl %edx, %esi
callq 0x9140
jmp 0x9942
movq -0x370(%rbp), %rdi
movb $0x0, -0x10a(%rbp)
leaq 0x30429(%rip), %rsi     # 0x39d80
leaq -0x64e(%rip), %rdx      # 0x9310
callq 0x4550
jmp 0xa2d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x998e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x41e0
leaq -0x109(%rbp), %rdi
callq 0x4360
testb $0x1, -0x10a(%rbp)
jne 0x99a5
jmp 0x99b1
movq -0x370(%rbp), %rdi
callq 0x4230
jmp 0x99ca
leaq -0x70(%rbp), %rdi
callq 0x285a0
leaq -0x40(%rbp), %rdi
callq 0x41e0
jmp 0xa2c3
leaq -0x70(%rbp), %rdi
callq 0x285a0
leaq -0x40(%rbp), %rdi
callq 0x41e0
jmp 0xa2cf
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x18(%rax)
cmpl $0x19, 0x8(%rax)
jne 0x9ff7
movq -0x250(%rbp), %rdi
addq $0x500, %rdi            # imm = 0x500
movq %rdi, -0x380(%rbp)
callq 0x12ee0
movq -0x380(%rbp), %rsi
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %edx
leaq -0x130(%rbp), %rdi
callq 0x13040
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
xorl %esi, %esi
callq *%rax
movq %rax, -0x378(%rbp)
jmp 0x9a42
movq -0x378(%rbp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
xorl %esi, %esi
callq *%rax
movq %rax, -0x388(%rbp)
jmp 0x9a5d
movq -0x388(%rbp), %rsi
leaq -0x160(%rbp), %rdi
callq 0xa2e0
jmp 0x9a72
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
xorl %esi, %esi
callq *%rax
movq %rax, -0x390(%rbp)
jmp 0x9a8a
movq -0x390(%rbp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
movl $0x1, %esi
callq *%rax
movq %rax, -0x398(%rbp)
jmp 0x9aa8
movq -0x398(%rbp), %rsi
leaq -0x198(%rbp), %rdi
callq 0xa2e0
jmp 0x9abd
leaq -0x198(%rbp), %rdi
movq %rdi, -0x3b0(%rbp)
callq 0x4140
movq %rax, %rdi
callq 0x44b0
movq -0x3b0(%rbp), %rdi
movl %eax, -0x3a4(%rbp)
callq 0x285a0
movl -0x3a4(%rbp), %ecx
movq -0x250(%rbp), %rax
movl %ecx, -0x164(%rbp)
addq $0x530, %rax            # imm = 0x530
movq %rax, -0x3a0(%rbp)
leaq -0x1b8(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x4150
jmp 0x9b1f
movq -0x3a0(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x13160
movb %al, -0x3b1(%rbp)
jmp 0x9b3a
leaq -0x1b8(%rbp), %rdi
callq 0x41e0
movb -0x3b1(%rbp), %al
testb $0x1, %al
jne 0x9b55
jmp 0x9e09
movq -0x250(%rbp), %rax
addq $0x530, %rax            # imm = 0x530
movq %rax, -0x3c0(%rbp)
leaq -0x1e0(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x4150
jmp 0x9b7e
movq -0x3c0(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x131d0
movq %rax, -0x3c8(%rbp)
jmp 0x9b9a
movq -0x3c8(%rbp), %rax
movl %eax, %ecx
movl %ecx, -0x1c0(%rbp)
shrq $0x20, %rax
movb %al, -0x1bc(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x41e0
testb $0x1, -0x1bc(%rbp)
je 0x9d75
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
leaq 0x21665(%rip), %rsi     # 0x2b240
callq 0x42e0
movq %rax, -0x3d0(%rbp)
jmp 0x9be9
movq -0x3d0(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x42c0
movq %rax, -0x3d8(%rbp)
jmp 0x9c05
movq -0x3d8(%rbp), %rdi
leaq 0x219cd(%rip), %rsi     # 0x2b5e0
callq 0x42e0
movq %rax, -0x3e0(%rbp)
jmp 0x9c21
movq -0x3e0(%rbp), %rdi
movl -0x1c0(%rbp), %esi
callq 0x4420
movq %rax, -0x3e8(%rbp)
jmp 0x9c3c
movq -0x3e8(%rbp), %rdi
leaq 0x215fc(%rip), %rsi     # 0x2b246
callq 0x42e0
movq %rax, -0x3f0(%rbp)
jmp 0x9c58
movq -0x3f0(%rbp), %rdi
leaq 0x215da(%rip), %rsi     # 0x2b240
callq 0x42e0
movq %rax, -0x3f8(%rbp)
jmp 0x9c74
movq -0x3f8(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x42c0
movq %rax, -0x400(%rbp)
jmp 0x9c90
movq -0x400(%rbp), %rdi
leaq 0x21936(%rip), %rsi     # 0x2b5d4
callq 0x42e0
movq %rax, -0x408(%rbp)
jmp 0x9cac
movq -0x408(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x42c0
movq %rax, -0x410(%rbp)
jmp 0x9cc8
movq -0x410(%rbp), %rdi
leaq 0x2190f(%rip), %rsi     # 0x2b5e5
callq 0x42e0
movq %rax, -0x418(%rbp)
jmp 0x9ce4
movq -0x418(%rbp), %rdi
movl -0x164(%rbp), %esi
callq 0x4420
movq %rax, -0x420(%rbp)
jmp 0x9cff
movq -0x420(%rbp), %rdi
leaq 0x21539(%rip), %rsi     # 0x2b246
callq 0x42e0
jmp 0x9d14
jmp 0x9e04
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x9fe6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x9fda
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x41e0
jmp 0x9fda
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x41e0
jmp 0x9fda
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
leaq 0x214bc(%rip), %rsi     # 0x2b240
callq 0x42e0
movq %rax, -0x428(%rbp)
jmp 0x9d92
movq -0x428(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x42c0
movq %rax, -0x430(%rbp)
jmp 0x9dae
movq -0x430(%rbp), %rdi
leaq 0x21824(%rip), %rsi     # 0x2b5e0
callq 0x42e0
movq %rax, -0x438(%rbp)
jmp 0x9dca
movq -0x438(%rbp), %rdi
movl -0x1c0(%rbp), %esi
movl -0x164(%rbp), %eax
addl %eax, %esi
callq 0x4420
movq %rax, -0x440(%rbp)
jmp 0x9ded
movq -0x440(%rbp), %rdi
leaq 0x2144b(%rip), %rsi     # 0x2b246
callq 0x42e0
jmp 0x9e02
jmp 0x9e04
jmp 0x9fbd
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
leaq 0x21431(%rip), %rsi     # 0x2b249
callq 0x42e0
movq %rax, -0x448(%rbp)
jmp 0x9e26
movq -0x448(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x42c0
movq %rax, -0x450(%rbp)
jmp 0x9e42
movq -0x450(%rbp), %rdi
leaq 0x211b5(%rip), %rsi     # 0x2b005
callq 0x42e0
movq %rax, -0x458(%rbp)
jmp 0x9e5e
movq -0x250(%rbp), %rax
addq $0x530, %rax            # imm = 0x530
movq %rax, -0x460(%rbp)
leaq -0x200(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x4150
jmp 0x9e87
movq -0x460(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x13210
movl %eax, -0x464(%rbp)
jmp 0x9ea2
movl -0x464(%rbp), %esi
movq -0x458(%rbp), %rdi
callq 0x4420
movq %rax, -0x470(%rbp)
jmp 0x9ebd
movq -0x470(%rbp), %rdi
leaq 0x21618(%rip), %rsi     # 0x2b4e3
callq 0x42e0
movq %rax, -0x478(%rbp)
jmp 0x9ed9
movq -0x478(%rbp), %rdi
leaq 0x21359(%rip), %rsi     # 0x2b240
callq 0x42e0
movq %rax, -0x480(%rbp)
jmp 0x9ef5
movq -0x480(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x42c0
movq %rax, -0x488(%rbp)
jmp 0x9f11
movq -0x488(%rbp), %rdi
leaq 0x216b5(%rip), %rsi     # 0x2b5d4
callq 0x42e0
movq %rax, -0x490(%rbp)
jmp 0x9f2d
movq -0x490(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x42c0
movq %rax, -0x498(%rbp)
jmp 0x9f49
movq -0x498(%rbp), %rdi
leaq 0x2168e(%rip), %rsi     # 0x2b5e5
callq 0x42e0
movq %rax, -0x4a0(%rbp)
jmp 0x9f65
movq -0x4a0(%rbp), %rdi
movl -0x164(%rbp), %esi
callq 0x4420
movq %rax, -0x4a8(%rbp)
jmp 0x9f80
movq -0x4a8(%rbp), %rdi
leaq 0x212b8(%rip), %rsi     # 0x2b246
callq 0x42e0
jmp 0x9f95
leaq -0x200(%rbp), %rdi
callq 0x41e0
jmp 0x9fbd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x41e0
jmp 0x9fda
leaq -0x160(%rbp), %rdi
callq 0x285a0
leaq -0x130(%rbp), %rdi
callq 0x41e0
jmp 0xa2c1
leaq -0x160(%rbp), %rdi
callq 0x285a0
leaq -0x130(%rbp), %rdi
callq 0x41e0
jmp 0xa2cf
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x18(%rax)
cmpl $0xd, 0x8(%rax)
jne 0xa030
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x18(%rax)
movq -0x250(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rdx
callq 0xa310
movl %eax, -0x1c(%rbp)
jmp 0xa2bf
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x18(%rax)
cmpl $0x15, 0x8(%rax)
jne 0xa0b5
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x18(%rax)
movq %rax, %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x18(%rax)
cmpl $0xd, 0x8(%rax)
jne 0xa08e
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x18(%rax)
movq %rax, %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x18(%rax)
movq -0x250(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rdx
callq 0xa310
movl %eax, -0x1c(%rbp)
jmp 0xa0b0
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x18(%rax)
movq -0x250(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rdx
callq 0x9360
movl %eax, -0x1c(%rbp)
jmp 0xa2bd
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x18(%rax)
cmpl $0xc, 0x8(%rax)
jne 0xa1a1
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
xorl %esi, %esi
callq *%rax
movq -0x250(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rdx
callq 0xa650
movq -0x250(%rbp), %rdi
addq $0x500, %rdi            # imm = 0x500
movq %rdi, -0x4c8(%rbp)
callq 0x12ee0
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
leaq 0x21153(%rip), %rsi     # 0x2b26c
callq 0x42e0
movq -0x4c8(%rbp), %rsi
movq %rax, -0x4c0(%rbp)
movl -0x1c(%rbp), %edx
leaq -0x220(%rbp), %rdi
movq %rdi, -0x4b8(%rbp)
callq 0x13040
movq -0x4c0(%rbp), %rdi
movq -0x4b8(%rbp), %rsi
callq 0x42c0
movq %rax, -0x4b0(%rbp)
jmp 0xa15e
movq -0x4b0(%rbp), %rdi
leaq 0x21377(%rip), %rsi     # 0x2b4e3
callq 0x42e0
jmp 0xa173
leaq -0x220(%rbp), %rdi
callq 0x41e0
jmp 0xa2bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x41e0
jmp 0xa2cf
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x18(%rax)
cmpl $0x13, 0x8(%rax)
je 0xa1c5
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x18(%rax)
cmpl $0x14, 0x8(%rax)
jne 0xa1e8
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x18(%rax)
movq -0x250(%rbp), %rdi
movq %rax, %rsi
callq 0xacb0
movl %eax, -0x1c(%rbp)
jmp 0xa2b9
movb $0x1, -0x242(%rbp)
movl $0x50, %edi
callq 0x4190
movq %rax, -0x4d8(%rbp)
leaq -0x241(%rbp), %rdi
movq %rdi, -0x4d0(%rbp)
callq 0x4590
movq -0x4d0(%rbp), %rdx
leaq 0x21050(%rip), %rsi     # 0x2b271
leaq -0x240(%rbp), %rdi
callq 0x52e0
jmp 0xa22f
movq -0x4d8(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq -0x240(%rbp), %rcx
movl %edx, %esi
callq 0x9140
jmp 0xa24b
movq -0x4d8(%rbp), %rdi
movb $0x0, -0x242(%rbp)
leaq 0x2fb20(%rip), %rsi     # 0x39d80
leaq -0xf57(%rip), %rdx      # 0x9310
callq 0x4550
jmp 0xa2d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0xa294
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x41e0
leaq -0x241(%rbp), %rdi
callq 0x4360
testb $0x1, -0x242(%rbp)
jne 0xa2ab
jmp 0xa2b7
movq -0x4d8(%rbp), %rdi
callq 0x4230
jmp 0xa2cf
jmp 0xa2bb
jmp 0xa2bd
jmp 0xa2bf
jmp 0xa2c1
jmp 0xa2c3
movl -0x1c(%rbp), %eax
addq $0x4e0, %rsp            # imm = 0x4E0
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x4580
nopl (%rax,%rax)