// File: /workspace/github_cpp_makefile_star2_O3/Davidc2525[P]Leaf/parser/Parser.cpp
// Function: Parser::FuncDecl(LEAF::AST::NODEU*&)
void Parser::FuncDecl(ASTU&f_node) {
		int np=0; 
		bool extern_s = false;
		Obj *obj = new Obj();
		MetaData *fd = new MetaData();
		string * FName = new string("anonima_"); 
		FName->append(to_string(++cout_annon_func).c_str()); 
		string * Tipe = new string(""); 
		int anon = 1;
		if (la->kind == 28 /* "extern" */) {
			Get();
			extern_s = true;
		}
		Expect(29 /* "fun" */);
		cout << "; fun "; 
		if (la->kind == _name) {
			Get();
			anon=0; FName = new string(""); LexString(FName);  
		}
		if(anon==1){
		cout<<" anonima retorna "<<*Tipe<<" " ;
		}else{
		cout<<*FName<<" retorna "; 
		} 
		
		obj = symbol_table::insert(4,FName,new Struct()); 
		
		
		symbol_table::pushCurrMethod(obj); 
		symbol_table::openScope(); 
		
		
		if (la->kind == 15 /* "(" */) {
			Get();
			if (StartOf(4)) {
				VarDecl();
				np++;
				while (la->kind == 25 /* "," */) {
					Get();
					VarDecl();
					np++;
				}
			}
			Expect(16 /* ")" */);
		}
		if (StartOf(5)) {
			FuncDcl(fd);
		}
		Expect(24 /* ":" */);
		Expect(_name);
		Tipe = new string(""); LexString(Tipe); *last(fd->type) = *symbol_table::find(Tipe)->type; cout<<";"<< *Tipe << endl; 
		funcion(fd->type); dump(fd->type,1); 
		
		obj->type = fd->type;
		(*obj).nPars = np;
		if(extern_s){
			obj->_extern = true;
			//ss->add(obj->name);
		}
		
		f_node = func_decl(FName);
		set_obj(f_node,obj);
		
		
		
		cout<<";nPars "<<np<<endl;
		
		obj->nPars=np;;
		cout<<";nPars "<<obj->nPars<<endl;
		
		if (!extern_s) {
			StatementBLock(f_node);
		} else if (la->kind == 11 /* ";" */) {
			Get();
		} else SynErr(57);
		symbol_table::currMethod()->locals = symbol_table::curScope->locals;
		symbol_table::currMethod()->type->size = symbol_table::curScope->offset-8;
		
		symbol_table::popCurrMethod(); 
		symbol_table::closeScope(); 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movl $0x20, %edi
callq 0x5290
movq %rax, 0x8(%rsp)
movq %rax, %rdi
callq 0xee24
movl $0x20, %edi
callq 0x5290
movq %rax, %r12
addq $0x10, %rax
movq %rax, (%r12)
movabsq $0x5f616d696e6f6e61, %rax # imm = 0x5F616D696E6F6E61
movq %rax, 0x10(%r12)
movq $0x8, 0x8(%r12)
movb $0x0, 0x18(%r12)
movl 0x40(%rbx), %r13d
incl %r13d
movl %r13d, 0x40(%rbx)
movl %r13d, %ebp
negl %ebp
cmovsl %r13d, %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0xcd9a
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0xcd91
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0xcd97
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0xcd9a
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0xcd5e
addl $-0x3, %r14d
jmp 0xcd9a
addl $-0x2, %r14d
jmp 0xcd9a
decl %r14d
movq %r15, 0x18(%rsp)
shrl $0x1f, %r13d
leal (%r14,%r13), %esi
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movl $0x2d, %edx
callq 0x5310
addq (%r15), %r13
movq %r13, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x7d64
movq (%r15), %rsi
movq %r12, %rdi
callq 0x54b0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xcdf9
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x52a0
movl $0x20, %edi
callq 0x5290
movq %rax, %r14
addq $0x10, %rax
movq %rax, (%r14)
movq $0x0, 0x8(%r14)
movb $0x0, 0x10(%r14)
movq 0x30(%rbx), %rax
movl (%rax), %r13d
cmpl $0x1c, %r13d
jne 0xce2f
movq %rbx, %rdi
callq 0xbdc0
movq %rbx, %rdi
movl $0x1d, %esi
callq 0xbe34
movq 0x19195(%rip), %rdi     # 0x25fd8
leaq 0xce6f(%rip), %rsi      # 0x19cb9
movl $0x6, %edx
callq 0x5300
movq 0x30(%rbx), %rax
cmpl $0x4, (%rax)
jne 0xceb7
movq %rbx, %rdi
callq 0xbdc0
movl $0x20, %edi
callq 0x5290
movq %rax, %r12
addq $0x10, %rax
movq %rax, (%r12)
movq $0x0, 0x8(%r12)
movb $0x0, 0x10(%r12)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xee9c
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq 0x19134(%rip), %rdi     # 0x25fd8
callq 0x5300
leaq 0xce18(%rip), %rsi      # 0x19cc8
movl $0x9, %edx
jmp 0xceed
movq 0x1911a(%rip), %r15     # 0x25fd8
leaq 0xcdfb(%rip), %rsi      # 0x19cc0
movl $0x11, %edx
movq %r15, %rdi
callq 0x5300
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x5300
leaq 0xcd59(%rip), %rsi      # 0x19c41
movl $0x1, %edx
movq %rax, %rdi
callq 0x5300
movl $0x30, %edi
callq 0x5290
xorl %ebp, %ebp
movq %rbp, (%rax)
movq %rbp, 0xc(%rax)
movq %rbp, 0x18(%rax)
movq %rbp, 0x28(%rax)
movl $0x4, %edi
movq %r12, %rsi
movq %rax, %rdx
callq 0x10fba
movq %rax, 0x40(%rsp)
movq %rax, %rdi
callq 0x11732
callq 0x1120e
movq 0x30(%rbx), %rax
movl (%rax), %eax
cmpl $0xf, %eax
jne 0xcfcb
movq %rbx, %rdi
callq 0xbdc0
movq 0x30(%rbx), %rax
movslq (%rax), %rax
leaq 0xca59(%rip), %rcx      # 0x199b0
xorl %ebp, %ebp
cmpb $0x1, 0xd0(%rax,%rcx)
jne 0xcfb8
callq 0x8cb8
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
movq %rbx, %rdi
callq 0xc476
movq 0x30(%rbx), %rax
movl $0x1, %ebp
cmpl $0x19, (%rax)
jne 0xcfb8
movl $0x1, %ebp
leaq 0x20(%rsp), %r14
movq %rbx, %rdi
callq 0xbdc0
callq 0x8cb8
movq %rax, 0x20(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc476
incl %ebp
movq 0x30(%rbx), %rax
cmpl $0x19, (%rax)
je 0xcf90
movq %rbx, %rdi
movl $0x10, %esi
callq 0xbe34
movq 0x30(%rbx), %rax
movl (%rax), %eax
cltq
leaq 0xc9dc(%rip), %rcx      # 0x199b0
cmpb $0x1, 0x104(%rax,%rcx)
jne 0xcfeb
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
callq 0xda1a
movl %r13d, 0x14(%rsp)
movq %rbx, %rdi
movl $0x18, %esi
callq 0xbe34
movq %rbx, %rdi
movl $0x4, %esi
callq 0xbe34
movl $0x20, %edi
callq 0x5290
movq %rax, %r14
addq $0x10, %rax
movq %rax, (%r14)
movq $0x0, 0x8(%r14)
movb $0x0, 0x10(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xee9c
movq %r14, %rdi
callq 0x1107a
movq 0x18(%rax), %rax
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rdx
movq %rdx, %rcx
movq 0x18(%rdx), %rdx
testq %rdx, %rdx
jne 0xd04b
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups %xmm2, 0x20(%rcx)
movups %xmm1, 0x10(%rcx)
movups %xmm0, (%rcx)
movq 0x18f64(%rip), %r15     # 0x25fd8
leaq 0xcc57(%rip), %rsi      # 0x19cd2
movl $0x1, %edx
movq %r15, %rdi
callq 0x5300
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x5300
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x5260
movsbl %al, %esi
movq %r14, %rdi
callq 0x5050
movq %rax, %rdi
callq 0x51a0
movq 0x8(%rsp), %r13
movq 0x8(%r13), %r14
movl $0x30, %edi
callq 0x5290
movq %rax, %r15
xorl %eax, %eax
movq %rax, (%r15)
movabsq $0x900000000, %rcx      # imm = 0x900000000
movq %rcx, 0xc(%r15)
movq %rax, 0x28(%r15)
movl $0x30, %edi
callq 0x5290
movq %rax, 0x18(%r15)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
movups (%r15), %xmm0
movq 0x10(%r15), %rax
movq 0x18(%r15), %rcx
movups 0x20(%r15), %xmm1
movups %xmm0, (%r14)
movq %rax, 0x10(%r14)
movq %rcx, 0x18(%r14)
movups %xmm1, 0x20(%r14)
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0xed84
movq 0x8(%r13), %rax
movq 0x40(%rsp), %r14
movq %rax, 0x18(%r14)
movl %ebp, 0x38(%r14)
movl 0x14(%rsp), %r13d
cmpl $0x1c, %r13d
jne 0xd168
movb $0x1, 0x28(%r14)
movq %r12, %rdi
callq 0x8d1f
movq 0x18(%rsp), %rcx
movq %rax, (%rcx)
movq %rax, %rdi
movq %r14, %rsi
callq 0x8d67
movq 0x18e4e(%rip), %r15     # 0x25fd8
leaq 0xcb43(%rip), %rsi      # 0x19cd4
movl $0x7, %edx
movq %r15, %rdi
callq 0x5300
movq %r15, %rdi
movl %ebp, %esi
callq 0x5460
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x5260
movsbl %al, %esi
movq %r12, %rdi
callq 0x5050
movq %rax, %rdi
callq 0x51a0
movl %ebp, 0x38(%r14)
movl $0x7, %edx
movq %r15, %rdi
leaq 0xcaef(%rip), %rsi      # 0x19cd4
callq 0x5300
movl 0x38(%r14), %esi
movq %r15, %rdi
callq 0x5460
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x5260
movsbl %al, %esi
movq %r14, %rdi
callq 0x5050
movq %rax, %rdi
callq 0x51a0
cmpl $0x1c, %r13d
jne 0xd239
movq 0x30(%rbx), %rax
cmpl $0xb, (%rax)
jne 0xd248
movq %rbx, %rdi
callq 0xbdc0
jmp 0xd255
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
callq 0xd2d0
jmp 0xd255
movq %rbx, %rdi
movl $0x39, %esi
callq 0xba20
leaq 0x19b2c(%rip), %rbx     # 0x26d88
movq (%rbx), %rax
movq 0x8(%rax), %r14
callq 0x1171e
movq %r14, 0x40(%rax)
movq (%rbx), %rax
movl 0x10(%rax), %ebx
addl $-0x8, %ebx
callq 0x1171e
movq 0x18(%rax), %rax
movl %ebx, 0xc(%rax)
callq 0x1174e
callq 0x1124e
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xd2c8
movq 0x30(%rsp), %rsi
incq %rsi
jmp 0xd2c3
movq %rax, %rbx
movl $0x20, %esi
movq 0x8(%rsp), %rdi
callq 0x52a0
movq %rbx, %rdi
callq 0x5470