// File: RuiDGPires[P]CrimLang/src/generator.cpp
// Function: gc_Tracker::declaration_func(crl::Node*)
void _gc_Tracker::declaration_func(crl::Node *node){
	ASSERT(node->get_child(0)->type == crl::Node::Type::LEAF, "Func declaration must have a type as first token");
	ASSERT(node->get_child(1)->type == crl::Node::Type::LEAF, "Func declaration must have a name as second token");
	std::string type = get_token(node->get_child(0)).str;
	std::string name = get_token(node->get_child(1)).str;
	this->current_func_name = name;
	u32 size = size_of(type);

	stream_funcs << name << ":\n"; 
	
	// RESULT SPACE ALLOCATION MUST BE DONE BY CALLER
	
	symb_tracker.frame_offset = size - 1;
	symb_tracker.sp = 0;

	this->stream_funcs << 
		";Function " << name << "\n" <<
		"MOV R7 RF\n" << // TMP STORE RF
		"MOV RF RS\n";

	symb_tracker.push("R7", stream_funcs);
	symb_tracker.push("RE", stream_funcs);


	// Arguents will be stored on the stack like this:
	// foo(a, b, c) -> [a b c]

	// TREAT ARGMENTS
	size_t s = symb_tracker.check();
	size_t args_size = 0;
	for(u32 i = 0; i < node->argc; i++){
		crl::Node *arg = node->get_child(2 + i);
		std::string type = get_token(arg->get_child(0)).str;
		std::string name = get_token(arg->get_child(1)).str;

		bool is_mut = arg->annotation == "mut";
		u32 arg_size = is_mut? 1: size_of(type);
		args_size += arg_size;
		
		symb_tracker.arg_create(name, arg_size, is_mut);
	}

	u32 rollback = symb_tracker.frame_offset;	
	this->stream_funcs <<
		"MVI R1 " << rollback << "\n" <<
		"ADD RF R1\n"; // Rollback frame

	crl::Node *block = node->get_child(2+node->argc);
	ASSERT(block->type == crl::Node::Type::BLOCK, "Funcs must have a block");
	

	this->block(block);
	symb_tracker.clean(s);

	this->stream_funcs << 
		"; End of function\n" <<
		name << "-end:\n" <<
		"MOV RS RF\n" <<
		"MVI R1 " << args_size + 1 + size << "\n" <<
		"SUB RS R1\n";
		
	symb_tracker.pop("RE", stream_funcs);
	symb_tracker.pop("RF", stream_funcs);

	this->stream_funcs <<
		"MVI R2 2\n"
		"SUB R1 R2\n" <<
		"ADD RS R1\n" <<
		"RET\n\n";
		// The rest is the result (on stack)
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4a0, %rsp            # imm = 0x4A0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x328(%rbp)
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x18(%rax)
cmpl $0x10, 0x8(%rax)
je 0xec43
movb $0x1, -0x45(%rbp)
movl $0x50, %edi
callq 0x4190
movq %rax, -0x338(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x330(%rbp)
callq 0x4590
movq -0x330(%rbp), %rdx
leaq 0x1c80f(%rip), %rsi     # 0x2b3c6
leaq -0x30(%rbp), %rdi
callq 0x52e0
jmp 0xebc2
movq -0x338(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq -0x30(%rbp), %rcx
movl %edx, %esi
callq 0x9140
jmp 0xebdb
movq -0x338(%rbp), %rdi
movb $0x0, -0x45(%rbp)
leaq 0x2b193(%rip), %rsi     # 0x39d80
leaq -0x58e4(%rip), %rdx     # 0x9310
callq 0x4550
jmp 0xf839
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xec21
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x41e0
leaq -0x31(%rbp), %rdi
callq 0x4360
testb $0x1, -0x45(%rbp)
jne 0xec32
jmp 0xec3e
movq -0x338(%rbp), %rdi
callq 0x4230
jmp 0xf830
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movl $0x1, %esi
callq *0x18(%rax)
cmpl $0x10, 0x8(%rax)
je 0xed1b
movb $0x1, -0x6a(%rbp)
movl $0x50, %edi
callq 0x4190
movq %rax, -0x348(%rbp)
leaq -0x69(%rbp), %rdi
movq %rdi, -0x340(%rbp)
callq 0x4590
movq -0x340(%rbp), %rdx
leaq 0x1c768(%rip), %rsi     # 0x2b3f7
leaq -0x68(%rbp), %rdi
callq 0x52e0
jmp 0xec9a
movq -0x348(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq -0x68(%rbp), %rcx
movl %edx, %esi
callq 0x9140
jmp 0xecb3
movq -0x348(%rbp), %rdi
movb $0x0, -0x6a(%rbp)
leaq 0x2b0bb(%rip), %rsi     # 0x39d80
leaq -0x59bc(%rip), %rdx     # 0x9310
callq 0x4550
jmp 0xf839
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xecf9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x41e0
leaq -0x69(%rbp), %rdi
callq 0x4360
testb $0x1, -0x6a(%rbp)
jne 0xed0a
jmp 0xed16
movq -0x348(%rbp), %rdi
callq 0x4230
jmp 0xf830
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
xorl %esi, %esi
callq *%rax
movq %rax, %rsi
leaq -0xc0(%rbp), %rdi
movq %rdi, -0x358(%rbp)
callq 0xa2e0
movq -0x358(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x41d0
movq -0x358(%rbp), %rdi
callq 0x285a0
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
movl $0x1, %esi
callq *%rax
movq %rax, -0x350(%rbp)
jmp 0xed7a
movq -0x350(%rbp), %rsi
leaq -0x110(%rbp), %rdi
callq 0xa2e0
jmp 0xed8f
leaq -0xe0(%rbp), %rdi
movq %rdi, -0x360(%rbp)
leaq -0x110(%rbp), %rsi
movq %rsi, -0x368(%rbp)
callq 0x41d0
movq -0x368(%rbp), %rdi
callq 0x285a0
movq -0x328(%rbp), %rdi
movq -0x360(%rbp), %rsi
addq $0x4a0, %rdi            # imm = 0x4A0
callq 0x4050
jmp 0xedd8
leaq -0x138(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x4150
jmp 0xeded
leaq -0x138(%rbp), %rdi
callq 0xdc30
movl %eax, -0x36c(%rbp)
jmp 0xee01
leaq -0x138(%rbp), %rdi
callq 0x41e0
movl -0x36c(%rbp), %eax
movq -0x328(%rbp), %rdi
movl %eax, -0x114(%rbp)
addq $0x328, %rdi            # imm = 0x328
leaq -0xe0(%rbp), %rsi
callq 0x42c0
movq %rax, -0x378(%rbp)
jmp 0xee3c
movq -0x378(%rbp), %rdi
leaq 0x1c65a(%rip), %rsi     # 0x2b4a4
callq 0x42e0
jmp 0xee51
movq -0x328(%rbp), %rdi
movl -0x114(%rbp), %eax
decl %eax
movl %eax, 0x5b0(%rdi)
movl $0x0, 0x5ac(%rdi)
addq $0x328, %rdi            # imm = 0x328
leaq 0x1c5ab(%rip), %rsi     # 0x2b429
callq 0x42e0
movq %rax, -0x380(%rbp)
jmp 0xee8c
movq -0x380(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x42c0
movq %rax, -0x388(%rbp)
jmp 0xeea8
movq -0x388(%rbp), %rdi
leaq 0x1c62d(%rip), %rsi     # 0x2b4e3
callq 0x42e0
movq %rax, -0x390(%rbp)
jmp 0xeec4
movq -0x390(%rbp), %rdi
leaq 0x1c562(%rip), %rsi     # 0x2b434
callq 0x42e0
movq %rax, -0x398(%rbp)
jmp 0xeee0
movq -0x398(%rbp), %rdi
leaq 0x1c551(%rip), %rsi     # 0x2b43f
callq 0x42e0
jmp 0xeef5
movq -0x328(%rbp), %rax
addq $0x530, %rax            # imm = 0x530
movq %rax, -0x3a8(%rbp)
leaq -0x159(%rbp), %rdi
movq %rdi, -0x3a0(%rbp)
callq 0x4590
movq -0x3a0(%rbp), %rdx
leaq 0x1c520(%rip), %rsi     # 0x2b44a
leaq -0x158(%rbp), %rdi
callq 0x52e0
jmp 0xef38
movq -0x3a8(%rbp), %rdi
movq -0x328(%rbp), %rdx
addq $0x318, %rdx            # imm = 0x318
leaq -0x158(%rbp), %rsi
callq 0x13330
jmp 0xef5b
leaq -0x158(%rbp), %rdi
callq 0x41e0
leaq -0x159(%rbp), %rdi
callq 0x4360
movq -0x328(%rbp), %rax
addq $0x530, %rax            # imm = 0x530
movq %rax, -0x3b8(%rbp)
leaq -0x181(%rbp), %rdi
movq %rdi, -0x3b0(%rbp)
callq 0x4590
movq -0x3b0(%rbp), %rdx
leaq 0x1c4a5(%rip), %rsi     # 0x2b44d
leaq -0x180(%rbp), %rdi
callq 0x52e0
jmp 0xefb6
movq -0x3b8(%rbp), %rdi
movq -0x328(%rbp), %rdx
addq $0x318, %rdx            # imm = 0x318
leaq -0x180(%rbp), %rsi
callq 0x13330
jmp 0xefd9
leaq -0x180(%rbp), %rdi
callq 0x41e0
leaq -0x181(%rbp), %rdi
callq 0x4360
movq -0x328(%rbp), %rdi
addq $0x530, %rdi            # imm = 0x530
callq 0x135a0
movq %rax, -0x3c0(%rbp)
jmp 0xf00d
movq -0x3c0(%rbp), %rax
movq %rax, -0x190(%rbp)
movq $0x0, -0x198(%rbp)
movl $0x0, -0x19c(%rbp)
movl -0x19c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x50(%rcx), %eax
jae 0xf399
movq -0x10(%rbp), %rdi
movl -0x19c(%rbp), %esi
addl $0x2, %esi
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
movq %rax, -0x3c8(%rbp)
jmp 0xf062
movq -0x3c8(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movq -0x1a8(%rbp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
xorl %esi, %esi
callq *%rax
movq %rax, -0x3d0(%rbp)
jmp 0xf08b
movq -0x3d0(%rbp), %rsi
leaq -0x1f8(%rbp), %rdi
callq 0xa2e0
jmp 0xf0a0
leaq -0x1c8(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
movq %rsi, -0x3e0(%rbp)
callq 0x41d0
movq -0x3e0(%rbp), %rdi
callq 0x285a0
movq -0x1a8(%rbp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
movl $0x1, %esi
callq *%rax
movq %rax, -0x3d8(%rbp)
jmp 0xf0e4
movq -0x3d8(%rbp), %rsi
leaq -0x248(%rbp), %rdi
callq 0xa2e0
jmp 0xf0f9
leaq -0x218(%rbp), %rdi
leaq -0x248(%rbp), %rsi
movq %rsi, -0x3f0(%rbp)
callq 0x41d0
movq -0x3f0(%rbp), %rdi
callq 0x285a0
movq -0x1a8(%rbp), %rdi
addq $0x30, %rdi
leaq 0x1c31f(%rip), %rsi     # 0x2b450
callq 0x66e0
movb %al, -0x3e1(%rbp)
jmp 0xf13e
movb -0x3e1(%rbp), %al
andb $0x1, %al
movb %al, -0x249(%rbp)
movb -0x249(%rbp), %al
movb $0x0, -0x271(%rbp)
testb $0x1, %al
je 0xf16a
movl $0x1, %eax
movl %eax, -0x3f4(%rbp)
jmp 0xf1a8
leaq -0x270(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x4150
jmp 0xf17f
movb $0x1, -0x271(%rbp)
leaq -0x270(%rbp), %rdi
callq 0xdc30
movl %eax, -0x3f8(%rbp)
jmp 0xf19a
movl -0x3f8(%rbp), %eax
movl %eax, -0x3f4(%rbp)
jmp 0xf1a8
movl -0x3f4(%rbp), %eax
movl %eax, -0x3fc(%rbp)
testb $0x1, -0x271(%rbp)
jne 0xf1bf
jmp 0xf1cb
leaq -0x270(%rbp), %rdi
callq 0x41e0
movq -0x328(%rbp), %rax
movl -0x3fc(%rbp), %ecx
movl %ecx, -0x250(%rbp)
movl -0x250(%rbp), %ecx
movl %ecx, %edx
movq -0x198(%rbp), %rcx
addq %rdx, %rcx
movq %rcx, -0x198(%rbp)
addq $0x530, %rax            # imm = 0x530
movq %rax, -0x408(%rbp)
leaq -0x298(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0x4150
jmp 0xf219
movq -0x408(%rbp), %rdi
movl -0x250(%rbp), %edx
movzbl -0x249(%rbp), %ecx
andl $0x1, %ecx
leaq -0x298(%rbp), %rsi
callq 0x133a0
jmp 0xf23e
leaq -0x298(%rbp), %rdi
callq 0x41e0
leaq -0x218(%rbp), %rdi
callq 0x41e0
leaq -0x1c8(%rbp), %rdi
callq 0x41e0
movl -0x19c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x19c(%rbp)
jmp 0xf030
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xf824
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xf818
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x41e0
jmp 0xf818
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xf2db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x41e0
leaq -0x159(%rbp), %rdi
callq 0x4360
jmp 0xf818
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xf312
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x41e0
leaq -0x181(%rbp), %rdi
callq 0x4360
jmp 0xf818
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xf388
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xf37c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
testb $0x1, -0x271(%rbp)
jne 0xf356
jmp 0xf362
leaq -0x270(%rbp), %rdi
callq 0x41e0
jmp 0xf37c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x298(%rbp), %rdi
callq 0x41e0
leaq -0x218(%rbp), %rdi
callq 0x41e0
leaq -0x1c8(%rbp), %rdi
callq 0x41e0
jmp 0xf818
movq -0x328(%rbp), %rdi
movl 0x5b0(%rdi), %eax
movl %eax, -0x29c(%rbp)
addq $0x328, %rdi            # imm = 0x328
leaq 0x1bfc3(%rip), %rsi     # 0x2b37d
callq 0x42e0
movq %rax, -0x410(%rbp)
jmp 0xf3c8
movq -0x410(%rbp), %rdi
movl -0x29c(%rbp), %esi
callq 0x4420
movq %rax, -0x418(%rbp)
jmp 0xf3e3
movq -0x418(%rbp), %rdi
leaq 0x1c0f2(%rip), %rsi     # 0x2b4e3
callq 0x42e0
movq %rax, -0x420(%rbp)
jmp 0xf3ff
movq -0x420(%rbp), %rdi
leaq 0x1c047(%rip), %rsi     # 0x2b454
callq 0x42e0
jmp 0xf414
movq -0x10(%rbp), %rdi
movl 0x50(%rdi), %esi
addl $0x2, %esi
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
movq %rax, -0x428(%rbp)
jmp 0xf430
movq -0x428(%rbp), %rax
movq %rax, -0x2a8(%rbp)
movq -0x2a8(%rbp), %rax
cmpl $0x5, 0x8(%rax)
je 0xf526
movb $0x1, -0x2ca(%rbp)
movl $0x50, %edi
callq 0x4190
movq %rax, -0x438(%rbp)
leaq -0x2c9(%rbp), %rdi
movq %rdi, -0x430(%rbp)
callq 0x4590
movq -0x430(%rbp), %rdx
leaq 0x1c05d(%rip), %rsi     # 0x2b4e5
leaq -0x2c8(%rbp), %rdi
callq 0x52e0
jmp 0xf496
movq -0x438(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq -0x2c8(%rbp), %rcx
movl %edx, %esi
callq 0x9140
jmp 0xf4b2
movq -0x438(%rbp), %rdi
movb $0x0, -0x2ca(%rbp)
leaq 0x2a8b9(%rip), %rsi     # 0x39d80
leaq -0x61be(%rip), %rdx     # 0x9310
callq 0x4550
jmp 0xf839
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xf4fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x2c8(%rbp), %rdi
callq 0x41e0
leaq -0x2c9(%rbp), %rdi
callq 0x4360
testb $0x1, -0x2ca(%rbp)
jne 0xf515
jmp 0xf521
movq -0x438(%rbp), %rdi
callq 0x4230
jmp 0xf818
movq -0x328(%rbp), %rdi
movq -0x2a8(%rbp), %rsi
callq 0xf840
jmp 0xf53b
movq -0x328(%rbp), %rdi
addq $0x530, %rdi            # imm = 0x530
movl -0x190(%rbp), %esi
callq 0x135c0
jmp 0xf556
movq -0x328(%rbp), %rdi
addq $0x328, %rdi            # imm = 0x328
leaq 0x1bf22(%rip), %rsi     # 0x2b48d
callq 0x42e0
movq %rax, -0x440(%rbp)
jmp 0xf579
movq -0x440(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x42c0
movq %rax, -0x448(%rbp)
jmp 0xf595
movq -0x448(%rbp), %rdi
leaq 0x1befd(%rip), %rsi     # 0x2b4a0
callq 0x42e0
movq %rax, -0x450(%rbp)
jmp 0xf5b1
movq -0x450(%rbp), %rdi
leaq 0x1bee8(%rip), %rsi     # 0x2b4a7
callq 0x42e0
movq %rax, -0x458(%rbp)
jmp 0xf5cd
movq -0x458(%rbp), %rdi
leaq 0x1bda2(%rip), %rsi     # 0x2b37d
callq 0x42e0
movq %rax, -0x460(%rbp)
jmp 0xf5e9
movq -0x460(%rbp), %rdi
movq -0x198(%rbp), %rax
movl -0x114(%rbp), %ecx
leaq 0x1(%rax,%rcx), %rsi
callq 0x40b0
movq %rax, -0x468(%rbp)
jmp 0xf610
movq -0x468(%rbp), %rdi
leaq 0x1bec5(%rip), %rsi     # 0x2b4e3
callq 0x42e0
movq %rax, -0x470(%rbp)
jmp 0xf62c
movq -0x470(%rbp), %rdi
leaq 0x1be78(%rip), %rsi     # 0x2b4b2
callq 0x42e0
jmp 0xf641
movq -0x328(%rbp), %rax
addq $0x530, %rax            # imm = 0x530
movq %rax, -0x480(%rbp)
leaq -0x2f1(%rbp), %rdi
movq %rdi, -0x478(%rbp)
callq 0x4590
movq -0x478(%rbp), %rdx
leaq 0x1bdd7(%rip), %rsi     # 0x2b44d
leaq -0x2f0(%rbp), %rdi
callq 0x52e0
jmp 0xf684
movq -0x480(%rbp), %rdi
movq -0x328(%rbp), %rdx
addq $0x318, %rdx            # imm = 0x318
leaq -0x2f0(%rbp), %rsi
callq 0x13530
jmp 0xf6a7
leaq -0x2f0(%rbp), %rdi
callq 0x41e0
leaq -0x2f1(%rbp), %rdi
callq 0x4360
movq -0x328(%rbp), %rax
addq $0x530, %rax            # imm = 0x530
movq %rax, -0x490(%rbp)
leaq -0x319(%rbp), %rdi
movq %rdi, -0x488(%rbp)
callq 0x4590
movq -0x488(%rbp), %rdx
leaq 0x1bdc9(%rip), %rsi     # 0x2b4bd
leaq -0x318(%rbp), %rdi
callq 0x52e0
jmp 0xf702
movq -0x490(%rbp), %rdi
movq -0x328(%rbp), %rdx
addq $0x318, %rdx            # imm = 0x318
leaq -0x318(%rbp), %rsi
callq 0x13530
jmp 0xf725
leaq -0x318(%rbp), %rdi
callq 0x41e0
leaq -0x319(%rbp), %rdi
callq 0x4360
movq -0x328(%rbp), %rdi
addq $0x328, %rdi            # imm = 0x328
leaq 0x1bd6e(%rip), %rsi     # 0x2b4c0
callq 0x42e0
movq %rax, -0x498(%rbp)
jmp 0xf760
movq -0x498(%rbp), %rdi
leaq 0x1bd66(%rip), %rsi     # 0x2b4d4
callq 0x42e0
movq %rax, -0x4a0(%rbp)
jmp 0xf77c
movq -0x4a0(%rbp), %rdi
leaq 0x1bd55(%rip), %rsi     # 0x2b4df
callq 0x42e0
jmp 0xf791
leaq -0xe0(%rbp), %rdi
callq 0x41e0
leaq -0x90(%rbp), %rdi
callq 0x41e0
addq $0x4a0, %rsp            # imm = 0x4A0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xf7d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x2f0(%rbp), %rdi
callq 0x41e0
leaq -0x2f1(%rbp), %rdi
callq 0x4360
jmp 0xf818
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xf80c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x318(%rbp), %rdi
callq 0x41e0
leaq -0x319(%rbp), %rdi
callq 0x4360
leaq -0xe0(%rbp), %rdi
callq 0x41e0
leaq -0x90(%rbp), %rdi
callq 0x41e0
movq -0x40(%rbp), %rdi
callq 0x4580
nopl (%rax)