// File: rcolomina[P]the_charmed_house/src/factory.cpp
// Function: FactoryGame::buildItemById(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
pItem FactoryGame::buildItemById(string itemId){

     // getting element item
     pElem elem_Items=this->getGameElement(string("items"));
     assert(elem_Items!=NULL);
	  
     pElem elem_Item=this->searchForElementId(elem_Items,itemId);
     assert(elem_Item!=NULL);
	  
     // handler over xml
     TiXmlHandle itemHandle(elem_Item);
	  
     pElem elem_names=itemHandle.FirstChild("names").ToElement();
     assert(elem_names!=NULL);
     vector<string> names=getTextListFromNode(elem_names);
	  			 
     pElem elem_descriptions=itemHandle.FirstChild("descriptions").ToElement();
     assert(elem_descriptions!=NULL);
     vector<string> descrip=getTextListFromNode(elem_descriptions);	  

     pElem elem_properties=itemHandle.FirstChild("properties").ToElement();
     assert(elem_properties!=NULL);
	  
     // Getting the properties
     vector<string> prop=getTextListFromNode(elem_properties);	  
     vector<string> propN=getNameListFromNode(elem_properties);
     vector<pair<string,string> > props;	  
     vector<string>::iterator it1;
     vector<string>::iterator it2;
     for(it1 = propN.begin(),it2 = prop.begin();
	 it1 < propN.end() && it2 < prop.end();
	 it1++,it2++)
     {			 					
	  pair<string,string> pa(*it1,*it2);
	  props.push_back(pa);			 
     }

     // Getting path file to image
     // pElem elem_image = itemHandle.FirstChild("images").ToElement();

     TiXmlHandle itemHandle2(elem_Item);	  	  
     pElem elem_image=itemHandle.FirstChild("image").ToElement();	  
     assert(elem_image != NULL);
     string pathFileText = elem_image->GetText();
					
     // vector<string> v_pathFileText = getTextListFromNode(elem_image);	  
     // string pathFileText=v_pathFileText[0];
	  
     const Entidad& ent =  Entidad(itemId,names[0],descrip[0]);	  	  
     pItem item=new Item(ent,names,descrip,props,pathFileText);
	
     return item;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3c0, %rsp            # imm = 0x3C0
movq %rsi, -0x348(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x340(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0x338(%rbp)
callq 0x56d0
movq -0x338(%rbp), %rdx
leaq 0x1ae0e(%rip), %rsi     # 0x50931
leaq -0x38(%rbp), %rdi
callq 0x299c0
jmp 0x35b2e
movq -0x340(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x36680
movq %rax, -0x350(%rbp)
jmp 0x35b47
leaq -0x38(%rbp), %rdi
callq 0x5748
leaq -0x39(%rbp), %rdi
callq 0x5420
movq -0x350(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x35b6d
jmp 0x35bbd
leaq 0x1adc3(%rip), %rdi     # 0x50937
leaq 0x1ad7c(%rip), %rsi     # 0x508f7
movl $0xaf, %edx
leaq 0x1adc1(%rip), %rcx     # 0x50948
callq 0x5250
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x35baf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x5748
leaq -0x39(%rbp), %rdi
callq 0x5420
jmp 0x36405
movq -0x348(%rbp), %rsi
movq -0x18(%rbp), %rax
movq %rax, -0x368(%rbp)
leaq -0x78(%rbp), %rdi
movq %rdi, -0x360(%rbp)
callq 0x5180
movq -0x340(%rbp), %rdi
movq -0x368(%rbp), %rsi
movq -0x360(%rbp), %rdx
callq 0x36730
movq %rax, -0x358(%rbp)
jmp 0x35c02
leaq -0x78(%rbp), %rdi
callq 0x5748
movq -0x358(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x35c1f
jmp 0x35c58
leaq 0x1ad4b(%rip), %rdi     # 0x50971
leaq 0x1acca(%rip), %rsi     # 0x508f7
movl $0xb2, %edx
leaq 0x1ad0f(%rip), %rcx     # 0x50948
callq 0x5250
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x5748
jmp 0x36405
movq -0x58(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x29940
leaq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rsi
leaq 0x1ad0a(%rip), %rdx     # 0x50981
callq 0x4a8e0
leaq -0x90(%rbp), %rdi
callq 0x29960
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0x35c9b
jmp 0x35cba
leaq 0x1ace5(%rip), %rdi     # 0x50987
leaq 0x1ac4e(%rip), %rsi     # 0x508f7
movl $0xb8, %edx
leaq 0x1ac93(%rip), %rcx     # 0x50948
callq 0x5250
movq -0x340(%rbp), %rsi
movq -0x88(%rbp), %rdx
leaq -0xa8(%rbp), %rdi
callq 0x36530
leaq 0x1acbd(%rip), %rdx     # 0x50998
leaq -0xb8(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x4a8e0
jmp 0x35ced
leaq -0xb8(%rbp), %rdi
callq 0x29960
movq %rax, -0x370(%rbp)
jmp 0x35d02
movq -0x370(%rbp), %rax
movq %rax, -0xb0(%rbp)
cmpq $0x0, -0xb0(%rbp)
je 0x35d1c
jmp 0x35d4c
leaq 0x1ac82(%rip), %rdi     # 0x509a5
leaq 0x1abcd(%rip), %rsi     # 0x508f7
movl $0xbc, %edx
leaq 0x1ac12(%rip), %rcx     # 0x50948
callq 0x5250
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x363f9
movq -0x340(%rbp), %rsi
movq -0xb0(%rbp), %rdx
leaq -0xd0(%rbp), %rdi
callq 0x36530
jmp 0x35d68
leaq 0x1ac4e(%rip), %rdx     # 0x509bd
leaq -0xe0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x4a8e0
jmp 0x35d81
leaq -0xe0(%rbp), %rdi
callq 0x29960
movq %rax, -0x378(%rbp)
jmp 0x35d96
movq -0x378(%rbp), %rax
movq %rax, -0xd8(%rbp)
cmpq $0x0, -0xd8(%rbp)
je 0x35db0
jmp 0x35de0
leaq 0x1ac11(%rip), %rdi     # 0x509c8
leaq 0x1ab39(%rip), %rsi     # 0x508f7
movl $0xc0, %edx
leaq 0x1ab7e(%rip), %rcx     # 0x50948
callq 0x5250
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x363ed
movq -0x340(%rbp), %rsi
movq -0xd8(%rbp), %rdx
leaq -0xf8(%rbp), %rdi
callq 0x36530
jmp 0x35dfc
movq -0x340(%rbp), %rsi
movq -0xd8(%rbp), %rdx
leaq -0x110(%rbp), %rdi
callq 0x36410
jmp 0x35e18
leaq -0x128(%rbp), %rdi
callq 0x36950
leaq -0x130(%rbp), %rdi
callq 0x36970
leaq -0x138(%rbp), %rdi
callq 0x36970
leaq -0x110(%rbp), %rdi
callq 0x2a3d0
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rax
movq %rax, -0x130(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x2a3d0
movq %rax, -0x148(%rbp)
movq -0x148(%rbp), %rax
movq %rax, -0x138(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x2a250
movq %rax, -0x150(%rbp)
leaq -0x130(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x36990
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x379(%rbp)
jne 0x35eb5
jmp 0x35ee1
leaq -0xf8(%rbp), %rdi
callq 0x2a250
movq %rax, -0x158(%rbp)
leaq -0x138(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x36990
movb %al, -0x379(%rbp)
movb -0x379(%rbp), %al
testb $0x1, %al
jne 0x35ef0
jmp 0x35fb6
leaq -0x130(%rbp), %rdi
callq 0x369d0
movq %rax, -0x388(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x369d0
movq -0x388(%rbp), %rsi
movq %rax, %rdx
leaq -0x198(%rbp), %rdi
callq 0x369f0
jmp 0x35f27
leaq -0x128(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x36a50
jmp 0x35f3c
leaq -0x198(%rbp), %rdi
callq 0x36ac0
leaq -0x130(%rbp), %rdi
xorl %esi, %esi
callq 0x36af0
movq %rax, -0x1a0(%rbp)
leaq -0x138(%rbp), %rdi
xorl %esi, %esi
callq 0x36af0
movq %rax, -0x1a8(%rbp)
jmp 0x35e7e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x363e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x363c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x36ac0
jmp 0x363c9
movq -0x58(%rbp), %rsi
leaq -0x1b0(%rbp), %rdi
callq 0x29940
jmp 0x35fc8
leaq 0x1aa0f(%rip), %rdx     # 0x509de
leaq -0x1c0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x4a8e0
jmp 0x35fe1
leaq -0x1c0(%rbp), %rdi
callq 0x29960
movq %rax, -0x390(%rbp)
jmp 0x35ff6
movq -0x390(%rbp), %rax
movq %rax, -0x1b8(%rbp)
cmpq $0x0, -0x1b8(%rbp)
je 0x36010
jmp 0x3602f
leaq 0x1a9cd(%rip), %rdi     # 0x509e4
leaq 0x1a8d9(%rip), %rsi     # 0x508f7
movl $0xd5, %edx
leaq 0x1a91e(%rip), %rcx     # 0x50948
callq 0x5250
movq -0x1b8(%rbp), %rdi
callq 0x48ec0
movq %rax, -0x398(%rbp)
jmp 0x36044
leaq -0x1e1(%rbp), %rdi
movq %rdi, -0x3a0(%rbp)
callq 0x56d0
movq -0x398(%rbp), %rsi
movq -0x3a0(%rbp), %rdx
leaq -0x1e0(%rbp), %rdi
callq 0x299c0
jmp 0x36073
leaq -0x1e1(%rbp), %rdi
callq 0x5420
movq -0x348(%rbp), %rsi
leaq -0x278(%rbp), %rdi
callq 0x5180
jmp 0x36094
xorl %eax, %eax
movl %eax, %esi
leaq -0xa8(%rbp), %rdi
callq 0x36b30
movq %rax, %rsi
leaq -0x298(%rbp), %rdi
callq 0x5180
jmp 0x360b5
xorl %eax, %eax
movl %eax, %esi
leaq -0xd0(%rbp), %rdi
callq 0x36b30
movq %rax, %rsi
leaq -0x2b8(%rbp), %rdi
callq 0x5180
jmp 0x360d6
leaq -0x258(%rbp), %rdi
leaq -0x278(%rbp), %rsi
leaq -0x298(%rbp), %rdx
leaq -0x2b8(%rbp), %rcx
callq 0x36b50
jmp 0x360f9
leaq -0x2b8(%rbp), %rdi
callq 0x5748
leaq -0x298(%rbp), %rdi
callq 0x5748
leaq -0x278(%rbp), %rdi
callq 0x5748
leaq -0x258(%rbp), %rax
movq %rax, -0x1f0(%rbp)
movl $0x270, %edi            # imm = 0x270
callq 0x53c0
movq %rax, -0x3a8(%rbp)
jmp 0x3613e
movb $0x1, -0x329(%rbp)
movq -0x1f0(%rbp), %rax
movq %rax, -0x3b0(%rbp)
leaq -0x2d8(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x36bf0
jmp 0x36168
leaq -0x2f0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x36bf0
jmp 0x3617d
leaq -0x308(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x36ce0
jmp 0x36192
leaq -0x328(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x5180
jmp 0x361a7
movq -0x3b0(%rbp), %rsi
movq -0x3a8(%rbp), %rdi
leaq -0x2d8(%rbp), %rdx
leaq -0x2f0(%rbp), %rcx
leaq -0x308(%rbp), %r8
leaq -0x328(%rbp), %r9
callq 0x402a0
jmp 0x361d8
movb $0x0, -0x329(%rbp)
leaq -0x328(%rbp), %rdi
callq 0x5748
leaq -0x308(%rbp), %rdi
callq 0x36dd0
leaq -0x2f0(%rbp), %rdi
callq 0x298b0
leaq -0x2d8(%rbp), %rdi
callq 0x298b0
movq -0x3a8(%rbp), %rax
movq %rax, -0x2c0(%rbp)
movq -0x2c0(%rbp), %rax
movq %rax, -0x3b8(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x2d510
leaq -0x1e0(%rbp), %rdi
callq 0x5748
leaq -0x128(%rbp), %rdi
callq 0x36dd0
leaq -0x110(%rbp), %rdi
callq 0x298b0
leaq -0xf8(%rbp), %rdi
callq 0x298b0
leaq -0xd0(%rbp), %rdi
callq 0x298b0
leaq -0xa8(%rbp), %rdi
callq 0x298b0
movq -0x3b8(%rbp), %rax
addq $0x3c0, %rsp            # imm = 0x3C0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x1e1(%rbp), %rdi
callq 0x5420
jmp 0x363c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x363bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x362fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x362f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x2b8(%rbp), %rdi
callq 0x5748
leaq -0x298(%rbp), %rdi
callq 0x5748
leaq -0x278(%rbp), %rdi
callq 0x5748
jmp 0x363bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x363b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x36393
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x36387
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3637b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3636f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x328(%rbp), %rdi
callq 0x5748
leaq -0x308(%rbp), %rdi
callq 0x36dd0
leaq -0x2f0(%rbp), %rdi
callq 0x298b0
leaq -0x2d8(%rbp), %rdi
callq 0x298b0
testb $0x1, -0x329(%rbp)
jne 0x3639e
jmp 0x363af
movq -0x3a8(%rbp), %rdi
movl $0x270, %esi            # imm = 0x270
callq 0x53d0
jmp 0x363b1
leaq -0x258(%rbp), %rdi
callq 0x2d510
leaq -0x1e0(%rbp), %rdi
callq 0x5748
leaq -0x128(%rbp), %rdi
callq 0x36dd0
leaq -0x110(%rbp), %rdi
callq 0x298b0
leaq -0xf8(%rbp), %rdi
callq 0x298b0
leaq -0xd0(%rbp), %rdi
callq 0x298b0
leaq -0xa8(%rbp), %rdi
callq 0x298b0
movq -0x48(%rbp), %rdi
callq 0x56c0
nop