// File: Davidc2525[P]Leaf/parser/Parser.cpp
// Function: Parser::Factor(LEAF::AST::NODEU*&)
void Parser::Factor(ASTU&f_node) {
		Obj* obj = new Obj(); string * ns=new string(""); string * buff = new string(""); 
		switch (la->kind) {
		case _t_pointer: case _name: {
			Designator(f_node);
			break;
		}
		case 47 /* "true" */: {
			Get();
			*obj=*new Obj(0,new string(""),symbol_table::boolType);  f_node = const_int_node(1); set_obj(f_node,obj);
			break;
		}
		case 48 /* "false" */: {
			Get();
			*obj=*new Obj(0,new string(""),symbol_table::boolType);  f_node = const_int_node(0); set_obj(f_node,obj);
			break;
		}
		case _t_r_pointer: {
			Get();
			Factor(f_node);
			cout<<"; referenciar "<<*get_obj(f_node)->name<<endl;  
			make_ref(get_obj(f_node));  /*dump(obj->type,2);*/ 
			f_node = (f_node);
			
			break;
		}
		case _floatLit: {
			Get();
			LexString(buff);
			*obj=*symbol_table::insert(1,new string(""),symbol_table::floatType);
			//*obj=*new Obj(0,new string(""),symbol_table::floatType); 
			//obj->val = stof(buff->c_str());
			f_node = const_float_node(stof(buff->c_str()));
			//cout<<"float "<<stof(buff->c_str())<<endl;
			set_obj(f_node,obj);
			
			//string * resr = new string("dq fc_ ");
			//resr->append(buff->c_str());
			//data_section->add(new DInstruccion(resr->c_str()));
			//visitor_generator->assembly->get_program()->section(Sections::data);
			
			break;
		}
		case _stringConst: {
			Get();
			LexString(buff);
			//*obj=*symbol_table::insert(0,new string(""),symbol_table::stringType);
			*obj=*new Obj(0,new string(""),symbol_table::stringType); 
			//make_ref(obj);
			//string * key = sl->add(buff);
			
			//obj->val = stof(buff->c_str());
			//f_node = const_string_node(key);
			//cout<<"float "<<stof(buff->c_str())<<endl;
			//set_obj(f_node,obj);
			
			break;
		}
		case _number: {
			Get();
			LexString(buff);  
			*obj=*new Obj(0,new string(""),symbol_table::intType); 
			
			obj->val = atoi(buff->c_str());
			f_node = const_int_node(obj->val);
			set_obj(f_node,obj);
			
			break;
		}
		case 15 /* "(" */: {
			Get();
			Expr(f_node);
			Expect(16 /* ")" */);
			break;
		}
		case 28 /* "extern" */: case 29 /* "fun" */: {
			FuncDecl(f_node);
			break;
		}
		default: SynErr(64); break;
		}
		while (la->kind == 15 /* "(" */) {
			ActParams(f_node,true);
			cout << " ;call "<<*get_obj(f_node)->name<<endl; 
		}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movl $0x48, %edi
callq 0x62e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x80(%rbp)
callq 0x17930
jmp 0x15209
movq -0x80(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x20, %edi
callq 0x62e0
movq %rax, -0x98(%rbp)
movq %rax, -0xa0(%rbp)
movb $0x1, -0x32(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x6500
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rdx
leaq 0x2091b(%rip), %rsi     # 0x35b6d
callq 0xada0
jmp 0x15259
movb $0x0, -0x32(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x6340
movq -0xa0(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x20, %edi
callq 0x62e0
movq %rax, -0xb0(%rbp)
movq %rax, -0xb8(%rbp)
movb $0x1, -0x42(%rbp)
leaq -0x41(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0x6500
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %rdx
leaq 0x208bb(%rip), %rsi     # 0x35b6d
callq 0xada0
jmp 0x152b9
movb $0x0, -0x42(%rbp)
leaq -0x41(%rbp), %rdi
callq 0x6340
movq -0xb8(%rbp), %rcx
movq -0x88(%rbp), %rax
movq %rcx, -0x40(%rbp)
movq 0x30(%rax), %rax
movl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0xc0(%rbp)
subl $0x2f, %eax
ja 0x15b0d
movq -0xc0(%rbp), %rax
leaq 0x1f5cc(%rip), %rcx     # 0x348cc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x80(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x48, %esi
callq 0x62f0
jmp 0x15b95
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x6340
testb $0x1, -0x32(%rbp)
jne 0x15345
jmp 0x15356
movq -0xa0(%rbp), %rdi
movl $0x20, %esi
callq 0x62f0
jmp 0x15b95
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x41(%rbp), %rdi
callq 0x6340
testb $0x1, -0x42(%rbp)
jne 0x15378
jmp 0x15389
movq -0xb8(%rbp), %rdi
movl $0x20, %esi
callq 0x62f0
jmp 0x15b95
movq -0x88(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x14340
jmp 0x15b1e
movq -0x88(%rbp), %rdi
callq 0x132b0
movl $0x48, %edi
callq 0x62e0
movq %rax, -0xd0(%rbp)
movb $0x1, -0x45(%rbp)
movl $0x20, %edi
callq 0x62e0
movq %rax, -0xc8(%rbp)
jmp 0x153d7
movb $0x1, -0x44(%rbp)
leaq -0x43(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x6500
movq -0xc8(%rbp), %rdi
movq -0xd8(%rbp), %rdx
leaq 0x2076d(%rip), %rsi     # 0x35b6d
callq 0xada0
jmp 0x15407
movq -0xc8(%rbp), %rdx
movq -0xd0(%rbp), %rdi
movb $0x0, -0x44(%rbp)
leaq 0x35c20(%rip), %rax     # 0x4b040
movq (%rax), %rcx
xorl %esi, %esi
callq 0x1fe10
jmp 0x1542c
movq -0xd0(%rbp), %rsi
movb $0x0, -0x45(%rbp)
movq -0x18(%rbp), %rdi
movl $0x48, %edx
callq 0x6230
leaq -0x43(%rbp), %rdi
callq 0x6340
movl $0x1, %edi
callq 0xe450
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xe300
jmp 0x15b1e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x154b5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x43(%rbp), %rdi
callq 0x6340
testb $0x1, -0x44(%rbp)
jne 0x154a2
jmp 0x154b3
movq -0xc8(%rbp), %rdi
movl $0x20, %esi
callq 0x62f0
jmp 0x154b5
testb $0x1, -0x45(%rbp)
jne 0x154bd
jmp 0x154ce
movq -0xd0(%rbp), %rdi
movl $0x48, %esi
callq 0x62f0
jmp 0x15b95
movq -0x88(%rbp), %rdi
callq 0x132b0
movl $0x48, %edi
callq 0x62e0
movq %rax, -0xe8(%rbp)
movb $0x1, -0x48(%rbp)
movl $0x20, %edi
callq 0x62e0
movq %rax, -0xe0(%rbp)
jmp 0x15507
movb $0x1, -0x47(%rbp)
leaq -0x46(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x6500
movq -0xe0(%rbp), %rdi
movq -0xf0(%rbp), %rdx
leaq 0x2063d(%rip), %rsi     # 0x35b6d
callq 0xada0
jmp 0x15537
movq -0xe0(%rbp), %rdx
movq -0xe8(%rbp), %rdi
movb $0x0, -0x47(%rbp)
leaq 0x35af0(%rip), %rax     # 0x4b040
movq (%rax), %rcx
xorl %esi, %esi
callq 0x1fe10
jmp 0x1555c
movq -0xe8(%rbp), %rsi
movb $0x0, -0x48(%rbp)
movq -0x18(%rbp), %rdi
movl $0x48, %edx
callq 0x6230
leaq -0x46(%rbp), %rdi
callq 0x6340
xorl %edi, %edi
callq 0xe450
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xe300
jmp 0x15b1e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x155e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x46(%rbp), %rdi
callq 0x6340
testb $0x1, -0x47(%rbp)
jne 0x155cf
jmp 0x155e0
movq -0xe0(%rbp), %rdi
movl $0x20, %esi
callq 0x62f0
jmp 0x155e2
testb $0x1, -0x48(%rbp)
jne 0x155ea
jmp 0x155fb
movq -0xe8(%rbp), %rdi
movl $0x48, %esi
callq 0x62f0
jmp 0x15b95
movq -0x88(%rbp), %rdi
callq 0x132b0
movq -0x88(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x151d0
movq 0x349ad(%rip), %rdi     # 0x49fd0
leaq 0x1f4b3(%rip), %rsi     # 0x34add
callq 0x62c0
movq %rax, -0xf8(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xe2e0
movq -0xf8(%rbp), %rdi
movq 0x8(%rax), %rsi
callq 0x6280
movq %rax, %rdi
movq 0x34954(%rip), %rsi     # 0x49fb0
callq 0x6320
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xe2e0
movq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x17d40
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
jmp 0x15b1e
movq -0x88(%rbp), %rdi
callq 0x132b0
movq -0x88(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x17810
movl $0x20, %edi
callq 0x62e0
movq %rax, -0x108(%rbp)
movq %rax, -0x110(%rbp)
movb $0x1, -0x4a(%rbp)
leaq -0x49(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x6500
movq -0x108(%rbp), %rdi
movq -0x100(%rbp), %rdx
leaq 0x20481(%rip), %rsi     # 0x35b6d
callq 0xada0
jmp 0x156f3
movq -0x110(%rbp), %rsi
movb $0x0, -0x4a(%rbp)
leaq 0x3595b(%rip), %rax     # 0x4b060
movq (%rax), %rdx
movl $0x1, %edi
callq 0x1fed0
movq %rax, -0x118(%rbp)
jmp 0x1571b
movq -0x118(%rbp), %rcx
movq -0x18(%rbp), %rax
movq 0x40(%rcx), %rdx
movq %rdx, 0x40(%rax)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups 0x30(%rcx), %xmm3
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
leaq -0x49(%rbp), %rdi
callq 0x6340
movq -0x40(%rbp), %rdi
callq 0x6120
movq %rax, -0x128(%rbp)
leaq -0x71(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x6500
movq -0x128(%rbp), %rsi
movq -0x120(%rbp), %rdx
leaq -0x70(%rbp), %rdi
callq 0xada0
jmp 0x1578e
xorl %eax, %eax
movl %eax, %esi
leaq -0x70(%rbp), %rdi
callq 0x17e40
movss %xmm0, -0x12c(%rbp)
jmp 0x157a5
movss -0x12c(%rbp), %xmm0
callq 0xe4b0
movq %rax, -0x138(%rbp)
jmp 0x157bb
movq -0x138(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
leaq -0x70(%rbp), %rdi
callq 0x6588
leaq -0x71(%rbp), %rdi
callq 0x6340
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xe300
jmp 0x15b1e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x49(%rbp), %rdi
callq 0x6340
testb $0x1, -0x4a(%rbp)
jne 0x1580d
jmp 0x1581e
movq -0x110(%rbp), %rdi
movl $0x20, %esi
callq 0x62f0
jmp 0x15b95
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x15846
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6588
leaq -0x71(%rbp), %rdi
callq 0x6340
jmp 0x15b95
movq -0x88(%rbp), %rdi
callq 0x132b0
movq -0x88(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x17810
movl $0x48, %edi
callq 0x62e0
movq %rax, -0x148(%rbp)
movb $0x1, -0x74(%rbp)
movl $0x20, %edi
callq 0x62e0
movq %rax, -0x140(%rbp)
jmp 0x15898
movb $0x1, -0x73(%rbp)
leaq -0x72(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x6500
movq -0x140(%rbp), %rdi
movq -0x150(%rbp), %rdx
leaq 0x202ac(%rip), %rsi     # 0x35b6d
callq 0xada0
jmp 0x158c8
movq -0x140(%rbp), %rdx
movq -0x148(%rbp), %rdi
movb $0x0, -0x73(%rbp)
leaq 0x3578f(%rip), %rax     # 0x4b070
movq (%rax), %rcx
xorl %esi, %esi
callq 0x1fe10
jmp 0x158ed
movq -0x148(%rbp), %rsi
movb $0x0, -0x74(%rbp)
movq -0x18(%rbp), %rdi
movl $0x48, %edx
callq 0x6230
leaq -0x72(%rbp), %rdi
callq 0x6340
jmp 0x15b1e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x15952
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x72(%rbp), %rdi
callq 0x6340
testb $0x1, -0x73(%rbp)
jne 0x1593f
jmp 0x15950
movq -0x140(%rbp), %rdi
movl $0x20, %esi
callq 0x62f0
jmp 0x15952
testb $0x1, -0x74(%rbp)
jne 0x1595a
jmp 0x1596b
movq -0x148(%rbp), %rdi
movl $0x48, %esi
callq 0x62f0
jmp 0x15b95
movq -0x88(%rbp), %rdi
callq 0x132b0
movq -0x88(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x17810
movl $0x48, %edi
callq 0x62e0
movq %rax, -0x160(%rbp)
movb $0x1, -0x77(%rbp)
movl $0x20, %edi
callq 0x62e0
movq %rax, -0x158(%rbp)
jmp 0x159b4
movb $0x1, -0x76(%rbp)
leaq -0x75(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x6500
movq -0x158(%rbp), %rdi
movq -0x168(%rbp), %rdx
leaq 0x20190(%rip), %rsi     # 0x35b6d
callq 0xada0
jmp 0x159e4
movq -0x158(%rbp), %rdx
movq -0x160(%rbp), %rdi
movb $0x0, -0x76(%rbp)
leaq 0x35653(%rip), %rax     # 0x4b050
movq (%rax), %rcx
xorl %esi, %esi
callq 0x1fe10
jmp 0x15a09
movq -0x160(%rbp), %rsi
movb $0x0, -0x77(%rbp)
movq -0x18(%rbp), %rdi
movl $0x48, %edx
callq 0x6230
leaq -0x75(%rbp), %rdi
callq 0x6340
movq -0x40(%rbp), %rdi
callq 0x6120
movq %rax, %rdi
callq 0x64a0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x2c(%rax)
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %edi
callq 0xe450
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xe300
jmp 0x15b1e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x15aae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x75(%rbp), %rdi
callq 0x6340
testb $0x1, -0x76(%rbp)
jne 0x15a9b
jmp 0x15aac
movq -0x158(%rbp), %rdi
movl $0x20, %esi
callq 0x62f0
jmp 0x15aae
testb $0x1, -0x77(%rbp)
jne 0x15ab6
jmp 0x15ac7
movq -0x160(%rbp), %rdi
movl $0x48, %esi
callq 0x62f0
jmp 0x15b95
movq -0x88(%rbp), %rdi
callq 0x132b0
movq -0x88(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x146d0
movq -0x88(%rbp), %rdi
movl $0x10, %esi
callq 0x133a0
jmp 0x15b1e
movq -0x88(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x14870
jmp 0x15b1e
movq -0x88(%rbp), %rdi
movl $0x40, %esi
callq 0x12be0
jmp 0x15b20
movq -0x88(%rbp), %rax
movq 0x30(%rax), %rax
cmpl $0xf, (%rax)
jne 0x15b8c
movq -0x88(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %edx
callq 0x14700
movq 0x34484(%rip), %rdi     # 0x49fd0
leaq 0x1ef99(%rip), %rsi     # 0x34aec
callq 0x62c0
movq %rax, -0x170(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xe2e0
movq -0x170(%rbp), %rdi
movq 0x8(%rax), %rsi
callq 0x6280
movq %rax, %rdi
movq 0x3442b(%rip), %rsi     # 0x49fb0
callq 0x6320
jmp 0x15b20
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x64f0
nop