// File: /workspace/github_cpp_makefile_star2_O1/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 0xeb92
movq %r14, %rdi
movq %r15, %rsi
callq 0xd352
movq %r15, (%r12)
movq 0x30(%r14), %rax
movl $0x1, %ebp
cmpl $0x19, (%rax)
jne 0xc55a
movl $0x1, %ebx
movl $0x20, %edi
callq 0x5290
movq %rax, %r13
movq %rax, %rdi
callq 0xeb92
movq %r14, %rdi
callq 0xbde8
movq %r14, %rdi
movq %r13, %rsi
callq 0xd352
movq %r13, (%r12,%rbx,8)
incq %rbx
movq 0x30(%r14), %rax
cmpl $0x19, (%rax)
je 0xc520
movl %ebx, %ebp
movq %r15, 0x10(%rsp)
movq %r14, %rdi
movl $0x18, %esi
callq 0xbe68
movq %r14, %rdi
movl $0x4, %esi
callq 0xbe68
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 0xec0a
movq 0x19a2b(%rip), %rbx     # 0x25fd8
leaq 0xd63d(%rip), %rsi      # 0x19bf1
movl $0x1, %edx
movq %rbx, %rdi
callq 0x5300
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq %rbx, %rdi
callq 0x5300
movq %rax, %rbx
leaq 0xd618(%rip), %rsi      # 0x19bf3
movl $0xc, %edx
movq %rax, %rdi
callq 0x5300
movq %r13, %rdi
callq 0x110a0
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 %r15d, %r15d
movq (%r12,%r15,8), %rax
movq 0x8(%rax), %rsi
movq %r14, %rdi
callq 0xec82
movq %rax, %rbx
movq %r13, %rdi
callq 0x110a0
movq 0x18(%rax), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups %xmm0, (%rbx)
movups %xmm1, 0x10(%rbx)
movups %xmm2, 0x20(%rbx)
incq %r15
cmpq %r15, %rbp
jne 0xc656
movq %rbp, %r13
movq %r12, %rbp
xorl %r12d, %r12d
movl $0x6, %edx
movq 0x19930(%rip), %rbx     # 0x25fd8
movq %rbx, %rdi
leaq 0xd54e(%rip), %rsi      # 0x19c00
callq 0x5300
movq (%rbp,%r12,8), %r15
movq 0x8(%r15), %rdx
movq 0x10(%r15), %rsi
movl $0x1, %edi
callq 0x10fda
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 0xeaf0
incq %r12
cmpq %r12, %r13
jne 0xc69c
movq %r13, 0x20(%rsp)
movq %rbp, 0x18(%rsp)
movq 0x30(%r14), %rax
cmpl $0xc, (%rax)
jne 0xc8e8
movq %r14, %rdi
callq 0xbde8
leaq 0x8(%rsp), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xe1e2
movq 0x10(%rsp), %r15
movq 0x10(%r15), %rdi
callq 0x110a0
movq %rax, %r13
movq 0x10(%r15), %rdi
callq 0x8e19
movq %rax, %rbp
movq %rax, %rdi
movq %r13, %rsi
callq 0x8d7b
movq (%rbx), %rsi
movq %rbp, %rdi
callq 0x8ee0
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 0x10f84
movq %rbx, %rdi
movq %r13, %rsi
callq 0x8d7b
movq (%rsp), %rax
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x8d2c
movq 0x30(%r14), %rax
cmpl $0x19, (%rax)
jne 0xc8e8
movl $0x1, %r12d
movq %r14, %rdi
callq 0xbde8
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0xe1e2
cmpq %r12, 0x20(%rsp)
je 0xc8f7
movq 0x18(%rsp), %rax
movq (%rax,%r12,8), %r15
movq 0x10(%r15), %rdi
callq 0x110a0
movq %rax, %rbx
movq 0x10(%r15), %rdi
callq 0x8e19
movq %rax, %r13
movq %rax, %rdi
movq %rbx, %rsi
callq 0x8d7b
movq 0x8(%rsp), %rsi
movq %r13, %rdi
callq 0x8ee0
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 0x10f84
movq %rbp, %rdi
movq %r13, %rsi
callq 0x8d7b
movq (%rsp), %rax
movq (%rax), %rdi
movq %rbp, %rsi
callq 0x8d2c
incq %r12
movq 0x30(%r14), %rax
cmpl $0x19, (%rax)
je 0xc807
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x196da(%rip), %rdi     # 0x25fd8
leaq 0xd302(%rip), %rsi      # 0x19c07
callq 0x5270
movq %rax, %rdi
callq 0x5130
movl $0x1, %edi
callq 0x5340
movq %rax, %rbx
movl $0x20, %esi
movq %r15, %rdi
jmp 0xc940
jmp 0xc935
movq %rax, %rbx
movl $0x20, %esi
jmp 0xc93d
movq %rax, %rbx
movl $0x48, %esi
movq %r13, %rdi
callq 0x52a0
movq %rbx, %rdi
callq 0x5470
nop