// File: RuiDGPires[P]CrimLang/src/semantic_analiser.cpp
// Function: sc_Tracker::program(crl::Node*)
void _sc_Tracker::program(crl::Node *node){
	size_t size = node->children.size();

	for (size_t i = 0; i < size; i++){
		crl::Node *child = node->get_child(i);
		ASSERT(child->type == crl::Node::Type::VAR_DECLARATION || child->type == crl::Node::Type::FUNC_DECLARATION || child->type == crl::Node::Type::CAS, "Program must only have declarations or cas instructions");
		if (child->type == crl::Node::Type::FUNC_DECLARATION)
			this->func_declaration(child);
		else if (child->type == crl::Node::Type::VAR_DECLARATION)
			this->var_declaration(child);
		else if (child->type == crl::Node::Type::CAS)
			this->cas(child);
		else
			ASSERT(false, "???");
	}	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
callq 0x51d0
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x258fe
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %esi
movq (%rdi), %rax
callq *0x18(%rax)
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x2, 0x8(%rax)
je 0x257c2
movq -0x28(%rbp), %rax
cmpl $0x3, 0x8(%rax)
je 0x257c2
movq -0x28(%rbp), %rax
cmpl $0x11, 0x8(%rax)
je 0x257c2
movb $0x1, -0x5d(%rbp)
movl $0x50, %edi
callq 0x4190
movq %rax, -0xa0(%rbp)
leaq -0x49(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x4590
movq -0x98(%rbp), %rdx
leaq 0x65db(%rip), %rsi      # 0x2bd11
leaq -0x48(%rbp), %rdi
callq 0x52e0
jmp 0x25741
movq -0xa0(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq -0x48(%rbp), %rcx
movl %edx, %esi
callq 0x9140
jmp 0x2575a
movq -0xa0(%rbp), %rdi
movb $0x0, -0x5d(%rbp)
leaq 0x14614(%rip), %rsi     # 0x39d80
leaq -0x1c463(%rip), %rdx    # 0x9310
callq 0x4550
jmp 0x25910
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x257a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x41e0
leaq -0x49(%rbp), %rdi
callq 0x4360
testb $0x1, -0x5d(%rbp)
jne 0x257b1
jmp 0x257bd
movq -0xa0(%rbp), %rdi
callq 0x4230
jmp 0x25907
movq -0x28(%rbp), %rax
cmpl $0x3, 0x8(%rax)
jne 0x257e1
movq -0x90(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x205a0
jmp 0x258eb
movq -0x28(%rbp), %rax
cmpl $0x2, 0x8(%rax)
jne 0x25800
movq -0x90(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x20d50
jmp 0x258e9
movq -0x28(%rbp), %rax
cmpl $0x11, 0x8(%rax)
jne 0x2581f
movq -0x90(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x20300
jmp 0x258e7
movb $0x1, -0x82(%rbp)
movl $0x50, %edi
callq 0x4190
movq %rax, -0xb0(%rbp)
leaq -0x81(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0x4590
movq -0xa8(%rbp), %rdx
leaq 0x64f1(%rip), %rsi      # 0x2bd49
leaq -0x80(%rbp), %rdi
callq 0x52e0
jmp 0x25863
movq -0xb0(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq -0x80(%rbp), %rcx
movl %edx, %esi
callq 0x9140
jmp 0x2587c
movq -0xb0(%rbp), %rdi
movb $0x0, -0x82(%rbp)
leaq 0x144ef(%rip), %rsi     # 0x39d80
leaq -0x1c588(%rip), %rdx    # 0x9310
callq 0x4550
jmp 0x25910
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x258c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x41e0
leaq -0x81(%rbp), %rdi
callq 0x4360
testb $0x1, -0x82(%rbp)
jne 0x258d9
jmp 0x258e5
movq -0xb0(%rbp), %rdi
callq 0x4230
jmp 0x25907
jmp 0x258e9
jmp 0x258eb
jmp 0x258ed
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x256b7
addq $0xb0, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x4580