// File: /workspace/github_cpp_makefile_star2_O3/Davidc2525[P]Leaf/parser/Parser.cpp
// Function: Parser::VarDeclDef(LEAF::AST::NODEU*&)
void Parser::VarDeclDef(ASTU&s) {
		int c_declaraciones = 0;
		MetaData ** declaraciones = (MetaData**)malloc(sizeof(MetaData*)*100);
		string * Tipe = new string(""); 
		MetaData * md = new MetaData();
		VarDcl(md);
		declaraciones[c_declaraciones++]=md;
		while (la->kind == 25 /* "," */) {
			md = new MetaData();
			Get();
			VarDcl(md);
			declaraciones[c_declaraciones++]=md;
		}
		Expect(24 /* ":" */);
		Expect(_name);
		Tipe = new string(""); LexString(Tipe);
		
		cout << " " << *Tipe <<" type kind: "<<symbol_table::find(Tipe)->type->kind<<endl<<endl; 
		
		for (int i = 0; i < c_declaraciones; i++)
		{							
		Struct * tmp = last(declaraciones[i]->type);
		*tmp = *symbol_table::find(Tipe)->type;								
		}
		
		for (int i = 0; i < c_declaraciones; i++)
		{
		
		cout<<";adr: "<<symbol_table::insert(
			Obj::Var,
			declaraciones[i]->tmpName,
			declaraciones[i]->type
		)->adr<<endl;;
		
		dump(declaraciones[i]->type,0);
		//cout<<"id type: "<<symbol_table::get_id(symbol_table::find(declaraciones[i]->tmpName)->type,0)<<endl;
		}
		
		
		
		if (la->kind == 12 /* "=" */) {
			ASTU e; 
			ASTU stat;
			ASTU tmp_ident;
			int inline_assign = 0;
			
			Get();
			Expr(e);
			if(inline_assign >= c_declaraciones){
			cout<<"mas expreciones q variables"<<endl;
			exit(1);
			}
			Obj*o = symbol_table::find(declaraciones[inline_assign]->tmpName);
			tmp_ident = ident(declaraciones[inline_assign]->tmpName);
			set_obj(tmp_ident,o);
			
			stat = assign(tmp_ident,e);
			Obj*o2 = new Obj(1,new string(),new Struct()); 
			set_obj(stat,o2);
			block_add(s,stat);
			inline_assign++; 
			while (la->kind == 25 /* "," */) {
				Get();
				Expr(e);
				if(inline_assign >= c_declaraciones){
				cout<<"mas expreciones q variables"<<endl;
				exit(1);
				}
				Obj*o = symbol_table::find(declaraciones[inline_assign]->tmpName);
				tmp_ident = ident(declaraciones[inline_assign]->tmpName);
				set_obj(tmp_ident,o);
				
				stat = assign(tmp_ident,e);
				Obj*o2 = new Obj(1,new string(),new Struct()); 
				set_obj(stat,o2);
				block_add(s,stat);
				inline_assign++; 
			}
		}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, (%rsp)
movq %rdi, %r14
movl $0x320, %edi            # imm = 0x320
callq 0x5370
movq %rax, %r12
movl $0x20, %edi
callq 0x5290
leaq 0x10(%rax), %rcx
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl $0x20, %edi
callq 0x5290
movq %rax, %r15
movq %rax, %rdi
callq 0xee24
movq %r14, %rdi
movq %r15, %rsi
callq 0xd386
movq %r15, (%r12)
movq 0x30(%r14), %rax
movl $0x1, %ebp
cmpl $0x19, (%rax)
jne 0xc526
movl $0x1, %ebx
movl $0x20, %edi
callq 0x5290
movq %rax, %r13
movq %rax, %rdi
callq 0xee24
movq %r14, %rdi
callq 0xbdc0
movq %r14, %rdi
movq %r13, %rsi
callq 0xd386
movq %r13, (%r12,%rbx,8)
incq %rbx
movq 0x30(%r14), %rax
cmpl $0x19, (%rax)
je 0xc4ec
movl %ebx, %ebp
movq %r15, 0x10(%rsp)
movq %r14, %rdi
movl $0x18, %esi
callq 0xbe34
movq %r14, %rdi
movl $0x4, %esi
callq 0xbe34
movl $0x20, %edi
callq 0x5290
movq %rax, %r13
addq $0x10, %rax
movq %rax, (%r13)
movq $0x0, 0x8(%r13)
movb $0x0, 0x10(%r13)
movq %r14, %rdi
movq %r13, %rsi
callq 0xee9c
movq 0x19a5f(%rip), %rbx     # 0x25fd8
leaq 0xd6c1(%rip), %rsi      # 0x19c41
movl $0x1, %edx
movq %rbx, %rdi
callq 0x5300
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq %rbx, %rdi
callq 0x5300
movq %rax, %rbx
leaq 0xd69c(%rip), %rsi      # 0x19c43
movl $0xc, %edx
movq %rax, %rdi
callq 0x5300
movq %r13, %rdi
callq 0x1107a
movq 0x18(%rax), %rax
movl 0x10(%rax), %esi
movq %rbx, %rdi
callq 0x5460
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5050
movq %rax, %rdi
callq 0x51a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5050
movq %rax, %rdi
callq 0x51a0
xorl %ebx, %ebx
movq (%r12,%rbx,8), %rax
movq 0x8(%rax), %rax
movq %rax, %r15
movq 0x18(%rax), %rax
testq %rax, %rax
jne 0xc629
movq %r13, %rdi
callq 0x1107a
movq 0x18(%rax), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups %xmm0, (%r15)
movups %xmm1, 0x10(%r15)
movups %xmm2, 0x20(%r15)
incq %rbx
cmpq %rbp, %rbx
jne 0xc621
movq %rbp, %r13
movq %r12, %rbp
xorl %r12d, %r12d
movl $0x6, %edx
movq 0x19961(%rip), %rbx     # 0x25fd8
movq %rbx, %rdi
leaq 0xd5cf(%rip), %rsi      # 0x19c50
callq 0x5300
movq (%rbp,%r12,8), %r15
movq 0x8(%r15), %rdx
movq 0x10(%r15), %rsi
movl $0x1, %edi
callq 0x10fba
movl 0x30(%rax), %esi
movq %rbx, %rdi
callq 0x5460
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5050
movq %rax, %rdi
callq 0x51a0
movq 0x8(%r15), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0xed84
incq %r12
cmpq %r12, %r13
jne 0xc66b
movq %r13, 0x20(%rsp)
movq %rbp, 0x18(%rsp)
movq 0x30(%r14), %rax
cmpl $0xc, (%rax)
jne 0xc8b7
movq %r14, %rdi
callq 0xbdc0
leaq 0x8(%rsp), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xe47c
movq 0x10(%rsp), %r15
movq 0x10(%r15), %rdi
callq 0x1107a
movq %rax, %r13
movq 0x10(%r15), %rdi
callq 0x8e05
movq %rax, %rbp
movq %rax, %rdi
movq %r13, %rsi
callq 0x8d67
movq (%rbx), %rsi
movq %rbp, %rdi
callq 0x8ecc
movq %rax, %rbx
movl $0x48, %edi
callq 0x5290
movq %rax, %r13
movl $0x20, %edi
callq 0x5290
movq %rax, %rbp
addq $0x10, %rax
movq %rax, (%rbp)
movq $0x0, 0x8(%rbp)
movb $0x0, 0x10(%rbp)
movl $0x30, %edi
callq 0x5290
xorl %ecx, %ecx
movq %rcx, (%rax)
movq %rcx, 0xc(%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x28(%rax)
movq %r13, %rdi
movl $0x1, %esi
movq %rbp, %rdx
movq %rax, %rcx
callq 0x10f64
movq %rbx, %rdi
movq %r13, %rsi
callq 0x8d67
movq (%rsp), %rax
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x8d18
movq 0x30(%r14), %rax
cmpl $0x19, (%rax)
jne 0xc8b7
movl $0x1, %r12d
movq %r14, %rdi
callq 0xbdc0
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0xe47c
cmpq %r12, 0x20(%rsp)
je 0xc8c6
movq 0x18(%rsp), %rax
movq (%rax,%r12,8), %r15
movq 0x10(%r15), %rdi
callq 0x1107a
movq %rax, %rbx
movq 0x10(%r15), %rdi
callq 0x8e05
movq %rax, %r13
movq %rax, %rdi
movq %rbx, %rsi
callq 0x8d67
movq 0x8(%rsp), %rsi
movq %r13, %rdi
callq 0x8ecc
movq %rax, %rbp
movl $0x48, %edi
callq 0x5290
movq %rax, %r13
movl $0x20, %edi
callq 0x5290
movq %rax, %rbx
addq $0x10, %rax
movq %rax, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movl $0x30, %edi
callq 0x5290
xorl %ecx, %ecx
movq %rcx, (%rax)
movq %rcx, 0xc(%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x28(%rax)
movq %r13, %rdi
movl $0x1, %esi
movq %rbx, %rdx
movq %rax, %rcx
callq 0x10f64
movq %rbp, %rdi
movq %r13, %rsi
callq 0x8d67
movq (%rsp), %rax
movq (%rax), %rdi
movq %rbp, %rsi
callq 0x8d18
incq %r12
movq 0x30(%r14), %rax
cmpl $0x19, (%rax)
je 0xc7d6
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1970b(%rip), %rdi     # 0x25fd8
leaq 0xd383(%rip), %rsi      # 0x19c57
callq 0x5270
movq %rax, %rdi
callq 0x5130
movl $0x1, %edi
callq 0x5340
movq %rax, %rbx
movl $0x20, %esi
movq %r15, %rdi
jmp 0xc90f
jmp 0xc904
movq %rax, %rbx
movl $0x20, %esi
jmp 0xc90c
movq %rax, %rbx
movl $0x48, %esi
movq %r13, %rdi
callq 0x52a0
movq %rbx, %rdi
callq 0x5470