// File: /workspace/github_cpp_makefile_star2_O1/RuiDGPires[P]CrimLang/src/semantic_analiser.cpp
// Function: sc_Tracker::var_declaration(crl::Node*)
void _sc_Tracker::var_declaration(crl::Node *node){
	Context::Item item;
	item.type = Context::Item::Type::VAR;
	if (node->get_child(0)->type == crl::Node::Type::VECTOR){
		item.subtype = ((crl::Leaf *) node->get_child(0)->get_child(0))->token.str;
		item._is_vector = true;
		item.vec_size = atoi(((crl::Leaf *) node->get_child(0)->get_child(1))->token.str.c_str());
	}else
		item.subtype = ((crl::Leaf *) node->get_child(0))->token.str;
	item.name = ((crl::Leaf *) node->get_child(1))->token.str;

	if (node->annotation == "mut")
		item._mutable = true;


	if (node->children.size() == 3){
		ASSERT(node->get_child(2)->type == crl::Node::Type::ASSIGN, "Must be assign if children size is 3");
		ASSERT(node->get_child(2)->get_child(0)->type == crl::Node::Type::EXPRESSION, "Must assign an expression");
		this->expression(node->get_child(2)->get_child(0), item.subtype);
	}
	this->add(item);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x140, %rsp            # imm = 0x140
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x98(%rbp), %rax
movq %rax, -0x10(%rax)
xorl %ecx, %ecx
movq %rcx, -0x8(%rax)
movb %cl, (%rax)
leaq -0x78(%rbp), %rax
movq %rax, -0x10(%rax)
movq %rcx, -0x8(%rax)
movb %cl, (%rax)
movb %cl, 0x10(%rax)
movl $0x0, 0x14(%rax)
movb %cl, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movq %rcx, 0x30(%rax)
movl $0x3, -0x38(%rax)
movq (%rsi), %rax
movq %rsi, %rdi
xorl %esi, %esi
callq *0x18(%rax)
leaq -0x88(%rbp), %r15
cmpl $0x19, 0x8(%rax)
movq (%r14), %rax
movq 0x18(%rax), %rax
jne 0x14985
movq %r14, %rdi
xorl %esi, %esi
callq *%rax
movq (%rax), %rcx
movq %rax, %rdi
xorl %esi, %esi
callq *0x18(%rcx)
addq $0x58, %rax
movq %r15, %rdi
movq %rax, %rsi
callq 0x3150
movb $0x1, -0x68(%rbp)
movq (%r14), %rax
movq %r14, %rdi
xorl %esi, %esi
callq *0x18(%rax)
movq (%rax), %rcx
movq %rax, %rdi
movl $0x1, %esi
callq *0x18(%rcx)
movq 0x58(%rax), %rdi
callq 0x3350
movl %eax, -0x64(%rbp)
jmp 0x1499b
movq %r14, %rdi
xorl %esi, %esi
callq *%rax
addq $0x58, %rax
movq %r15, %rdi
movq %rax, %rsi
callq 0x3150
movq (%r14), %rax
movq %r14, %rdi
movl $0x1, %esi
callq *0x18(%rax)
leaq -0xa8(%rbp), %rdi
addq $0x58, %rax
movq %rax, %rsi
callq 0x3150
leaq 0x30(%r14), %rdi
leaq 0x6a89(%rip), %rsi      # 0x1b450
callq 0x30a0
testl %eax, %eax
jne 0x149d4
movb $0x1, -0x60(%rbp)
movq 0x18(%r14), %rax
subq 0x10(%r14), %rax
cmpq $0x18, %rax
jne 0x14a80
movq (%r14), %rax
movq %r14, %rdi
movl $0x2, %esi
callq *0x18(%rax)
cmpl $0x6, 0x8(%rax)
jne 0x14b2e
movq (%r14), %rax
movq %r14, %rdi
movl $0x2, %esi
callq *0x18(%rax)
movq (%rax), %rcx
movq %rax, %rdi
xorl %esi, %esi
callq *0x18(%rcx)
cmpl $0xd, 0x8(%rax)
jne 0x14b98
movq (%r14), %rax
movq %r14, %rdi
movl $0x2, %esi
callq *0x18(%rax)
movq (%rax), %rcx
movq %rax, %rdi
xorl %esi, %esi
callq *0x18(%rcx)
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
addq %rsi, %rdx
leaq -0x40(%rbp), %rdi
callq 0x4d4a
leaq -0x40(%rbp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x14cca
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x14a80
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x3230
movl -0xb0(%rbp), %eax
leaq -0x158(%rbp), %rdi
movl %eax, -0x8(%rdi)
leaq -0x148(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
addq %rsi, %rdx
callq 0x4d4a
leaq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
addq %rsi, %rdx
callq 0x4d4a
leaq -0x68(%rbp), %rax
leaq -0x58(%rbp), %rsi
movb 0x8(%rax), %cl
leaq -0x108(%rbp), %rdi
movb %cl, -0x8(%rdi)
movq (%rax), %rax
movq %rax, -0x10(%rdi)
callq 0x4ad0
leaq -0x160(%rbp), %rsi
movq %rbx, %rdi
callq 0x13bf4
leaq -0x160(%rbp), %rdi
callq 0x4816
leaq -0xb0(%rbp), %rdi
callq 0x4816
addq $0x140, %rsp            # imm = 0x140
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x50, %edi
callq 0x3120
movq %rax, %r14
leaq -0xe0(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x6de5(%rip), %rsi      # 0x1b933
leaq 0x6e02(%rip), %rdx      # 0x1b957
leaq -0xf0(%rbp), %rdi
callq 0x433a
movb $0x1, %r15b
leaq -0xf0(%rbp), %rcx
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x5470
xorl %r15d, %r15d
leaq 0xe1f1(%rip), %rsi      # 0x22d78
leaq -0xf5a8(%rip), %rdx     # 0x55e6
movq %r14, %rdi
callq 0x33d0
jmp 0x14c00
movl $0x50, %edi
callq 0x3120
movq %rax, %r14
leaq -0xc0(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x6da0(%rip), %rsi      # 0x1b958
leaq 0x6db2(%rip), %rdx      # 0x1b971
leaq -0xd0(%rbp), %rdi
callq 0x433a
movb $0x1, %r15b
leaq -0xd0(%rbp), %rcx
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x5470
xorl %r15d, %r15d
leaq 0xe187(%rip), %rsi      # 0x22d78
leaq -0xf612(%rip), %rdx     # 0x55e6
movq %r14, %rdi
callq 0x33d0
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
cmpq %r12, %rdi
je 0x14c40
movq -0xc0(%rbp), %rsi
jmp 0x14c30
jmp 0x14c3a
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
cmpq %r12, %rdi
je 0x14c40
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x3230
jmp 0x14c40
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0x14cb5
movq %r14, %rdi
callq 0x31a0
jmp 0x14cb5
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x14cb5
movq -0x30(%rbp), %rsi
jmp 0x14ca8
movq %rax, %rbx
leaq -0x160(%rbp), %rdi
callq 0x4816
jmp 0x14cb5
movq %rax, %rbx
movq -0x138(%rbp), %rdi
cmpq %r15, %rdi
je 0x14c95
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x3230
jmp 0x14c95
movq %rax, %rbx
movq -0x158(%rbp), %rdi
cmpq %r14, %rdi
je 0x14cb5
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x3230
jmp 0x14cb5
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x4816
movq %rbx, %rdi
callq 0x33f0
nop