// File: /workspace/github_cpp_makefile_star2_O2/RuiDGPires[P]CrimLang/src/parser.cpp
// Function: ps_Tracker::declaration()
void _ps_Tracker::declaration(){
	// aux will be used to stor tokens until it's know if this is a declaration of a function or a variable
	std::vector<crl::Token> aux;
	bool is_cas = false;
	bool is_void = false;

	if (accept(crl::Token::Type::VOID))
		is_void = true;
	else		
		expect TYPE_SPEC();

		
	if (this->current.type == crl::Token::Type::LSBR){
		this->enter(crl::Node::Type::VECTOR);
		aux.push_back(this->previous());
		this->expect(crl::Token::Type::LSBR);
		this->expect(crl::Token::Type::INT);
		aux.push_back(this->previous());
		this->expect(crl::Token::Type::RSBR);
		this->leave();
	}else
		aux.push_back(this->previous());

	if (accept(crl::Token::Type::CAS)) 
		is_cas=true;


	bool _mutable = accept(crl::Token::Type::MUT);
	
	expect(crl::Token::Type::IDENT);
	aux.push_back(this->previous());

	size_t size = aux.size();
	if (_mutable)
		goto var_;
	// Function declaration
	if (accept(crl::Token::Type::LPAREN)){
		if (!is_cas)
			this->enter(crl::Node::Type::FUNC_DECLARATION);
		else
			this->enter(crl::Node::Type::CAS);

		// Dump stored tokens
		for (size_t i = 0; i < size; i++)
			this->add(aux[i]);

		if (accept TYPE_SPEC()){
			this->enter(crl::Node::Type::ARG);
			if (this->current.type == crl::Token::Type::LSBR){
				this->enter(crl::Node::Type::VECTOR);
				this->add(this->previous());
				this->expect(crl::Token::Type::LSBR);
				EXP_AND_ADD(crl::Token::Type::INT);
				this->expect(crl::Token::Type::RSBR);
				this->leave();
			}else
				this->add(this->previous());

			if (accept(crl::Token::Type::MUT))
				this->annotate("mut");

			EXP_AND_ADD(crl::Token::Type::IDENT);

			this->leave();
			while(accept(crl::Token::Type::COMMA)){
				this->enter(crl::Node::Type::ARG);
				this->expect TYPE_SPEC();

				if (this->current.type == crl::Token::Type::LSBR){
					this->enter(crl::Node::Type::VECTOR);
					this->add(this->previous());
					this->expect(crl::Token::Type::LSBR);
					EXP_AND_ADD(crl::Token::Type::INT);
					this->expect(crl::Token::Type::RSBR);
					this->leave();
				}else
					this->add(this->previous());

				if (accept(crl::Token::Type::MUT))
					this->annotate("mut");

				EXP_AND_ADD(crl::Token::Type::IDENT);
				this->leave();
			}
		}
		expect(crl::Token::Type::RPAREN);
		expect(crl::Token::Type::LBRACK);
		if (!is_cas)	
			this->block(crl::Token::Type::RBRACK);
		else{
			this->enter(crl::Node::Type::BLOCK);
			while(accept(crl::Token::Type::STRING)){
				this->add(this->previous());
				this->expect(crl::Token::Type::SEMICLN);
			}
			this->expect(crl::Token::Type::RBRACK);
			this->leave();
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2b8, %rsp            # imm = 0x2B8
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
andq $0x0, -0x40(%rbp)
pushq $0x5
popq %rsi
callq 0xc450
movl %eax, %r14d
testb %al, %al
jne 0xd1de
subq $0x8, %rsp
pushq $0x5
popq %rdx
pushq $0x6
popq %rcx
pushq $0x7
popq %rsi
pushq $0x9
popq %r9
movq %rbx, %rdi
movl %esi, %r8d
xorl %eax, %eax
pushq $0xb
pushq $0xa
pushq $0x8
callq 0xc580
addq $0x20, %rsp
cmpl $0x22, 0x58(%rbx)
jne 0xd250
pushq $0x19
popq %rsi
movq %rbx, %rdi
callq 0xc678
movq (%rbx), %rax
imulq $0x30, 0x28(%rbx), %rcx
leaq (%rax,%rcx), %rsi
addq $-0x30, %rsi
leaq -0x50(%rbp), %rdi
callq 0xe3f4
pushq $0x22
popq %rsi
movq %rbx, %rdi
callq 0xc522
pushq $0x13
popq %rsi
movq %rbx, %rdi
callq 0xc522
movq (%rbx), %rax
imulq $0x30, 0x28(%rbx), %rcx
leaq (%rax,%rcx), %rsi
addq $-0x30, %rsi
leaq -0x50(%rbp), %rdi
callq 0xe3f4
pushq $0x23
popq %rsi
movq %rbx, %rdi
callq 0xc522
movq 0x18(%rbx), %rax
movq 0x28(%rax), %rax
movq %rax, 0x18(%rbx)
jmp 0xd269
movq (%rbx), %rax
imulq $0x30, 0x28(%rbx), %rcx
leaq (%rax,%rcx), %rsi
addq $-0x30, %rsi
leaq -0x50(%rbp), %rdi
callq 0xe3f4
pushq $0x11
popq %r13
movq %rbx, %rdi
movl %r13d, %esi
callq 0xc450
movb %al, -0x2a(%rbp)
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0xc450
movl %eax, %r12d
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xc522
movq (%rbx), %rax
imulq $0x30, 0x28(%rbx), %rcx
leaq (%rax,%rcx), %rsi
addq $-0x30, %rsi
leaq -0x50(%rbp), %rdi
callq 0xe3f4
movq -0x48(%rbp), %rax
subq -0x50(%rbp), %rax
pushq $0x30
popq %rcx
cqto
idivq %rcx
movq %rax, %r15
testb %r12b, %r12b
jne 0xd323
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq 0xc450
testb %al, %al
je 0xd323
cmpb $0x0, -0x2a(%rbp)
pushq $0x3
popq %rsi
cmovnel %r13d, %esi
movq %rbx, %rdi
callq 0xc678
xorl %r12d, %r12d
leaq -0x2e0(%rbp), %r14
subq $0x1, %r15
jb 0xd40a
movq -0x50(%rbp), %rsi
addq %r12, %rsi
movq %r14, %rdi
callq 0xb24a
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc776
movq %r14, %rdi
callq 0x135f8
addq $0x30, %r12
jmp 0xd2f1
testb %r14b, %r14b
jne 0xd810
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0xc678
xorl %r13d, %r13d
leaq -0x220(%rbp), %r14
subq $0x1, %r15
jb 0xd36f
movq -0x50(%rbp), %rsi
addq %r13, %rsi
movq %r14, %rdi
callq 0xb24a
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc776
movq %r14, %rdi
callq 0x135f8
addq $0x30, %r13
jmp 0xd341
testb %r12b, %r12b
je 0xd3ae
leaq 0x80d5(%rip), %rsi      # 0x15450
leaq -0x70(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x3be4
leaq -0x70(%rbp), %rsi
movq %rbx, %rdi
callq 0xc764
leaq -0x70(%rbp), %rdi
callq 0x3110
pushq $0x2a
popq %rsi
movq %rbx, %rdi
callq 0xc450
testb %al, %al
jne 0xd3b9
jmp 0xd3d8
pushq $0x2a
popq %rsi
movq %rbx, %rdi
callq 0xc522
pushq $0x6
popq %rsi
movq %rbx, %rdi
callq 0xc678
movq %rbx, %rdi
callq 0xc986
movq 0x18(%rbx), %rax
movq 0x28(%rax), %rax
movq %rax, 0x18(%rbx)
pushq $0x28
popq %rsi
movq %rbx, %rdi
callq 0xc522
movq 0x18(%rbx), %rax
movq 0x28(%rax), %rax
movq %rax, 0x18(%rbx)
leaq -0x50(%rbp), %rdi
callq 0xc25a
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
subq $0x8, %rsp
pushq $0x5
popq %rdx
pushq $0x6
popq %rcx
pushq $0x7
popq %rsi
pushq $0x9
popq %r9
movq %rbx, %rdi
movl %esi, %r8d
xorl %eax, %eax
pushq $0xb
pushq $0xa
pushq $0x8
callq 0xc472
addq $0x20, %rsp
testb %al, %al
je 0xd767
pushq $0x12
popq %rsi
movq %rbx, %rdi
callq 0xc678
cmpl $0x22, 0x58(%rbx)
jne 0xd4f7
pushq $0x19
popq %rsi
movq %rbx, %rdi
callq 0xc678
movq (%rbx), %rax
imulq $0x30, 0x28(%rbx), %rcx
leaq (%rax,%rcx), %rsi
addq $-0x30, %rsi
leaq -0x170(%rbp), %rdi
callq 0xb24a
leaq -0x170(%rbp), %rsi
movq %rbx, %rdi
callq 0xc776
leaq -0x170(%rbp), %rdi
callq 0x135f8
pushq $0x22
popq %rsi
movq %rbx, %rdi
callq 0xc522
pushq $0x13
popq %rsi
movq %rbx, %rdi
callq 0xc522
movq (%rbx), %rax
imulq $0x30, 0x28(%rbx), %rcx
leaq (%rax,%rcx), %rsi
addq $-0x30, %rsi
leaq -0x140(%rbp), %rdi
callq 0xb24a
leaq -0x140(%rbp), %rsi
movq %rbx, %rdi
callq 0xc776
leaq -0x140(%rbp), %rdi
callq 0x135f8
pushq $0x23
popq %rsi
movq %rbx, %rdi
callq 0xc522
movq 0x18(%rbx), %rax
movq 0x28(%rax), %rax
movq %rax, 0x18(%rbx)
jmp 0xd52e
movq (%rbx), %rax
imulq $0x30, 0x28(%rbx), %rcx
leaq (%rax,%rcx), %rsi
addq $-0x30, %rsi
leaq -0x110(%rbp), %rdi
callq 0xb24a
leaq -0x110(%rbp), %rsi
movq %rbx, %rdi
callq 0xc776
leaq -0x110(%rbp), %rdi
callq 0x135f8
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0xc450
testb %al, %al
je 0xd56f
leaq 0x7f0c(%rip), %rsi      # 0x15450
leaq -0x90(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x3be4
leaq -0x90(%rbp), %rsi
movq %rbx, %rdi
callq 0xc764
leaq -0x90(%rbp), %rdi
callq 0x3110
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xc522
movq (%rbx), %rax
imulq $0x30, 0x28(%rbx), %rcx
leaq (%rax,%rcx), %rsi
addq $-0x30, %rsi
leaq -0xe0(%rbp), %rdi
callq 0xb24a
leaq -0xe0(%rbp), %rsi
movq %rbx, %rdi
callq 0xc776
leaq -0xe0(%rbp), %rdi
callq 0x135f8
pushq $0x7
popq %r12
leaq -0x280(%rbp), %r14
leaq -0x2b0(%rbp), %r13
movq 0x18(%rbx), %rax
movq 0x28(%rax), %rax
movq %rax, 0x18(%rbx)
movq %rbx, %rdi
pushq $0x29
popq %rsi
callq 0xc450
testb %al, %al
je 0xd767
movq %rbx, %rdi
pushq $0x12
popq %rsi
callq 0xc678
subq $0x8, %rsp
movq %rbx, %rdi
movl %r12d, %esi
pushq $0x5
popq %rdx
pushq $0x6
popq %rcx
movl %r12d, %r8d
pushq $0x9
popq %r9
xorl %eax, %eax
pushq $0xb
pushq $0xa
pushq $0x8
callq 0xc580
addq $0x20, %rsp
cmpl $0x22, 0x58(%rbx)
jne 0xd6c5
movq %rbx, %rdi
pushq $0x19
popq %rsi
callq 0xc678
movq (%rbx), %rax
imulq $0x30, 0x28(%rbx), %rcx
leaq (%rax,%rcx), %rsi
addq $-0x30, %rsi
leaq -0x1f0(%rbp), %rdi
callq 0xb24a
movq %rbx, %rdi
leaq -0x1f0(%rbp), %r15
movq %r15, %rsi
callq 0xc776
movq %r15, %rdi
callq 0x135f8
movq %rbx, %rdi
pushq $0x22
popq %rsi
callq 0xc522
movq %rbx, %rdi
pushq $0x13
popq %rsi
callq 0xc522
movq (%rbx), %rax
imulq $0x30, 0x28(%rbx), %rcx
leaq (%rax,%rcx), %rsi
addq $-0x30, %rsi
leaq -0x1c0(%rbp), %rdi
callq 0xb24a
movq %rbx, %rdi
leaq -0x1c0(%rbp), %r15
movq %r15, %rsi
callq 0xc776
movq %r15, %rdi
callq 0x135f8
movq %rbx, %rdi
pushq $0x23
popq %rsi
callq 0xc522
movq 0x18(%rbx), %rax
movq 0x28(%rax), %rax
movq %rax, 0x18(%rbx)
jmp 0xd6f0
movq (%rbx), %rax
imulq $0x30, 0x28(%rbx), %rcx
leaq (%rax,%rcx), %rsi
addq $-0x30, %rsi
movq %r13, %rdi
callq 0xb24a
movq %rbx, %rdi
movq %r13, %rsi
callq 0xc776
movq %r13, %rdi
callq 0x135f8
movq %rbx, %rdi
pushq $0x4
popq %rsi
callq 0xc450
testb %al, %al
je 0xd72c
leaq -0x190(%rbp), %r15
movq %r15, %rdi
leaq 0x7d40(%rip), %rsi      # 0x15450
leaq -0x29(%rbp), %rdx
callq 0x3be4
movq %rbx, %rdi
movq %r15, %rsi
callq 0xc764
movq %r15, %rdi
callq 0x3110
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xc522
movq (%rbx), %rax
imulq $0x30, 0x28(%rbx), %rcx
leaq (%rax,%rcx), %rsi
addq $-0x30, %rsi
movq %r14, %rdi
callq 0xb24a
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc776
movq %r14, %rdi
callq 0x135f8
jmp 0xd5c3
pushq $0x21
popq %rsi
movq %rbx, %rdi
callq 0xc522
pushq $0x24
popq %rsi
movq %rbx, %rdi
callq 0xc522
cmpb $0x0, -0x2a(%rbp)
je 0xd7e4
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0xc678
pushq $0x1c
popq %r14
leaq -0x250(%rbp), %r15
pushq $0x28
popq %r12
movq %rbx, %rdi
movl %r14d, %esi
callq 0xc450
testb %al, %al
je 0xd7f4
movq (%rbx), %rax
imulq $0x30, 0x28(%rbx), %rcx
leaq (%rax,%rcx), %rsi
addq $-0x30, %rsi
movq %r15, %rdi
callq 0xb24a
movq %rbx, %rdi
movq %r15, %rsi
callq 0xc776
movq %r15, %rdi
callq 0x135f8
movq %rbx, %rdi
movl %r12d, %esi
callq 0xc522
jmp 0xd79d
pushq $0x25
popq %rsi
movq %rbx, %rdi
callq 0xd97a
jmp 0xd3e3
pushq $0x25
popq %rsi
movq %rbx, %rdi
callq 0xc522
movq 0x18(%rbx), %rax
movq 0x28(%rax), %rax
movq %rax, 0x18(%rbx)
jmp 0xd3e3
pushq $0x50
popq %rdi
callq 0x3140
movq %rax, %r14
movl 0x5c(%rbx), %r15d
movl 0x60(%rbx), %ebx
leaq 0x7f07(%rip), %rsi      # 0x15730
leaq -0xb0(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x3be4
movb $0x1, %r12b
leaq -0xb0(%rbp), %rcx
movq %r14, %rdi
movl %r15d, %esi
movl %ebx, %edx
callq 0x4e38
xorl %r12d, %r12d
leaq 0x1051e(%rip), %rsi     # 0x1dd78
leaq -0x8929(%rip), %rdx     # 0x4f38
movq %r14, %rdi
callq 0x33f0
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
jmp 0xd8f9
jmp 0xd965
movq %rax, %rbx
leaq -0x140(%rbp), %rdi
jmp 0xd95e
movq %rax, %rbx
leaq -0x170(%rbp), %rdi
jmp 0xd95e
movq %rax, %rbx
leaq -0x110(%rbp), %rdi
jmp 0xd95e
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
jmp 0xd95e
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
jmp 0xd8f9
jmp 0xd965
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x3110
testb %r12b, %r12b
jne 0xd8e3
jmp 0xd968
movq %rax, %rbx
movq %r14, %rdi
callq 0x31b0
jmp 0xd968
jmp 0xd965
movq %rax, %rbx
leaq -0x190(%rbp), %rdi
callq 0x3110
jmp 0xd968
movq %rax, %rbx
leaq -0x1c0(%rbp), %rdi
jmp 0xd95e
movq %rax, %rbx
leaq -0x2b0(%rbp), %rdi
jmp 0xd95e
movq %rax, %rbx
leaq -0x1f0(%rbp), %rdi
jmp 0xd95e
jmp 0xd965
movq %rax, %rbx
leaq -0x280(%rbp), %rdi
jmp 0xd95e
movq %rax, %rbx
leaq -0x250(%rbp), %rdi
jmp 0xd95e
jmp 0xd965
jmp 0xd965
jmp 0xd965
movq %rax, %rbx
leaq -0x2e0(%rbp), %rdi
jmp 0xd95e
jmp 0xd965
jmp 0xd965
movq %rax, %rbx
leaq -0x220(%rbp), %rdi
callq 0x135f8
jmp 0xd968
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0xc25a
movq %rbx, %rdi
callq 0x3410
nop