// File: /workspace/github_cpp_makefile_star2_O2/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, 0x8(%rsp)
movq %rdi, %r14
movl $0x320, %edi            # imm = 0x320
callq 0x5330
movq %rax, %r15
pushq $0x20
popq %rdi
callq 0x5260
movq %rax, %rbx
leaq 0xccde(%rip), %rsi      # 0x17da3
leaq 0x7(%rsp), %rdx
movq %rax, %rdi
callq 0x70ae
pushq $0x20
popq %rdi
callq 0x5260
movq %rax, %rbx
movq %rax, %rdi
callq 0xd10a
movq %r14, %rdi
movq %rbx, %rsi
callq 0xbc62
movq %rbx, 0x18(%rsp)
movq %rbx, (%r15)
pushq $0x1
popq %rbp
pushq $0x20
popq %rbx
movq 0x30(%r14), %rax
cmpl $0x19, (%rax)
jne 0xb136
movq %rbx, %rdi
callq 0x5260
movq %rax, %r13
movq %rax, %rdi
callq 0xd10a
movq %r14, %rdi
callq 0xaa2e
movq %r14, %rdi
movq %r13, %rsi
callq 0xbc62
movq %r13, (%r15,%rbp,8)
incq %rbp
jmp 0xb0fe
pushq $0x18
popq %rsi
movq %r14, %rdi
callq 0xaa9a
pushq $0x4
popq %rsi
movq %r14, %rdi
callq 0xaa9a
pushq $0x20
popq %rdi
callq 0x5260
movq %rax, %rbx
leaq 0xcc45(%rip), %rsi      # 0x17da3
leaq 0x6(%rsp), %rdx
movq %rax, %rdi
callq 0x70ae
leaq -0x1(%rbp), %rax
movq %rax, 0x20(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0xd178
movq 0x19e4a(%rip), %rdi     # 0x24fd0
leaq 0xbac4(%rip), %rsi      # 0x16c51
callq 0x5240
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5200
leaq 0xbaaf(%rip), %rsi      # 0x16c53
movq %rax, %rdi
callq 0x5240
movq %rax, %r13
movq %rbx, %rdi
callq 0xf34e
movq 0x18(%rax), %rax
movl 0x10(%rax), %esi
movq %r13, %rdi
callq 0x5410
movq %rax, %rdi
callq 0x5120
movq %rax, %rdi
callq 0x5120
xorl %r12d, %r12d
cmpq %r12, %rbp
je 0xb21d
movq (%r15,%r12,8), %rax
movq 0x8(%rax), %rax
movq %rax, %r13
movq 0x18(%rax), %rax
testq %rax, %rax
jne 0xb1e6
movq %rbx, %rdi
callq 0xf34e
movq 0x18(%rax), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups %xmm0, (%r13)
movups %xmm1, 0x10(%r13)
movups %xmm2, 0x20(%r13)
incq %r12
jmp 0xb1d9
xorl %r13d, %r13d
cmpq %r13, %rbp
je 0xb275
movq 0x19da4(%rip), %rdi     # 0x24fd0
leaq 0xba2d(%rip), %rsi      # 0x16c60
callq 0x5240
movq %rax, %r12
movq (%r15,%r13,8), %rbx
movq 0x8(%rbx), %rdx
movq 0x10(%rbx), %rsi
pushq $0x1
popq %rdi
callq 0xf292
movl 0x30(%rax), %esi
movq %r12, %rdi
callq 0x5410
movq %rax, %rdi
callq 0x5120
movq 0x8(%rbx), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0xd092
incq %r13
jmp 0xb220
movq 0x30(%r14), %rax
cmpl $0xc, (%rax)
jne 0xb423
movq %r14, %rdi
callq 0xaa2e
leaq 0x10(%rsp), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xc8fa
movq 0x18(%rsp), %r13
movq 0x10(%r13), %rdi
callq 0xf34e
movq %rax, %r12
movq 0x10(%r13), %rdi
callq 0x8175
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
callq 0x80df
movq (%rbx), %rsi
movq %r13, %rdi
callq 0x8230
movq %rax, %rbx
pushq $0x48
popq %rdi
callq 0x5260
movq %rax, %r13
pushq $0x20
popq %rdi
callq 0x5260
movq %rax, %r12
addq $0x10, %rax
movq %rax, (%r12)
andq $0x0, 0x8(%r12)
movb $0x0, 0x10(%r12)
pushq $0x30
popq %rdi
callq 0x5260
andq $0x0, (%rax)
andq $0x0, 0xc(%rax)
andq $0x0, 0x18(%rax)
andq $0x0, 0x28(%rax)
pushq $0x1
popq %rsi
movq %r13, %rdi
movq %r12, %rdx
movq %rax, %rcx
callq 0xf244
movq %rbx, %rdi
movq %r13, %rsi
callq 0x80df
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x8094
addq $0x8, %r15
pushq $0x1
popq %r12
movq 0x30(%r14), %rax
cmpl $0x19, (%rax)
jne 0xb423
movq %r14, %rdi
callq 0xaa2e
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0xc8fa
subq $0x1, 0x20(%rsp)
jb 0xb432
movq (%r15), %r13
movq 0x10(%r13), %rdi
callq 0xf34e
movq %rax, %rbx
movq 0x10(%r13), %rdi
callq 0x8175
movq %rax, %r13
movq %rax, %rdi
movq %rbx, %rsi
callq 0x80df
movq 0x10(%rsp), %rsi
movq %r13, %rdi
callq 0x8230
movq %rax, %rbp
pushq $0x48
popq %rdi
callq 0x5260
movq %rax, %r13
pushq $0x20
popq %rdi
callq 0x5260
movq %rax, %rbx
addq $0x10, %rax
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
pushq $0x30
popq %rdi
callq 0x5260
andq $0x0, (%rax)
andq $0x0, 0xc(%rax)
andq $0x0, 0x18(%rax)
andq $0x0, 0x28(%rax)
movq %r13, %rdi
movl %r12d, %esi
movq %rbx, %rdx
movq %rax, %rcx
callq 0xf244
movq %rbp, %rdi
movq %r13, %rsi
callq 0x80df
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq %rbp, %rsi
callq 0x8094
addq $0x8, %r15
jmp 0xb349
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x19b97(%rip), %rdi     # 0x24fd0
leaq 0xb827(%rip), %rsi      # 0x16c67
callq 0x5240
movq %rax, %rdi
callq 0x5120
pushq $0x1
popq %rdi
callq 0x5300
jmp 0xb459
jmp 0xb459
movq %rax, %r14
pushq $0x20
popq %rsi
movq %rbx, %rdi
jmp 0xb476
jmp 0xb46d
movq %rax, %r14
pushq $0x20
jmp 0xb472
movq %rax, %r14
pushq $0x48
popq %rsi
movq %r13, %rdi
callq 0x5270
movq %r14, %rdi
callq 0x5420
nop