// File: /workspace/github_cpp_makefile_star2_O2/rcolomina[P]the_charmed_house/src/item_creator.cpp
// Function: ItemGameCreator::createById(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Entidad* ItemGameCreator::createById(std::string itemId){

    // getting element item
    pElem elem_Items=this->searchForGame(string("items"));
    assert(elem_Items!=NULL);
	  
    pElem elem_Item=this->searchForId(elem_Items,itemId);
    assert(elem_Item!=NULL);
	  
    // handler
    TiXmlHandle itemHandle(elem_Item);
	  
    pElem elem_names=itemHandle.FirstChild("names").ToElement();
    assert(elem_names!=NULL);
    vector<std::string> names=getInfoList(elem_names,Name);
	  			 
    pElem elem_descriptions=itemHandle.FirstChild("descriptions").ToElement();
    assert(elem_descriptions!=NULL);
    vector<string> descrip=getInfoList(elem_descriptions,Text);	  

    pElem elem_properties=itemHandle.FirstChild("properties").ToElement();
    assert(elem_properties!=NULL);
	  
    vector<string> prop=getInfoList(elem_properties,Text);	  
    vector<string> propN=getInfoList(elem_properties,Name);

    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++)
    {
/*			 cout<<"it1:"<<*it1<<" it2:"<<*it2<<endl;		 
			 bool boolvalue=false;
			 if(*it2==string("true"))
                         boolvalue=true;
*/					
//			 pair<string,bool> pa(*it1,boolvalue);
//			 props.push_back(pa);
        pair<string,string> pa(*it1,*it2);
        props.push_back(pa);			 
    }

    const Entidad& ent=Entidad(itemId,names[0],descrip[0]);

    string pathFileText; //TODO: connect with XML
    pItem item=new Item(ent,names,descrip,props,pathFileText);
	
    return item;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e0, %rsp            # imm = 0x1E0
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xa478(%rip), %rsi      # 0x21931
leaq 0x98(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x12230
leaq 0x98(%rsp), %rsi
movq %r14, %rdi
callq 0x120a4
movq %rax, %r15
leaq 0x98(%rsp), %rdi
callq 0x5638
movq %r15, 0x30(%rsp)
testq %r15, %r15
je 0x17841
leaq 0x30(%rsp), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x1211e
testq %rax, %rax
je 0x1785a
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
leaq 0xa460(%rip), %rdx      # 0x21981
leaq 0x98(%rsp), %r15
movq %r15, %rdi
callq 0x1edb8
movq %r15, %rdi
callq 0x1220a
testq %rax, %rax
je 0x17873
leaq 0x98(%rsp), %rdx
movq %rax, (%rdx)
leaq 0x10(%rsp), %rcx
andl $0x0, (%rcx)
leaq 0x80(%rsp), %rdi
movq %r14, %rsi
callq 0x11fcc
leaq 0xa42c(%rip), %rdx      # 0x21998
leaq 0x98(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1edb8
leaq 0x98(%rsp), %rdi
callq 0x1220a
testq %rax, %rax
je 0x1788c
leaq 0x98(%rsp), %rdx
movq %rax, (%rdx)
leaq 0x10(%rsp), %rcx
movl $0x1, (%rcx)
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
callq 0x11fcc
leaq 0xa3ff(%rip), %rdx      # 0x219bd
leaq 0x98(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1edb8
leaq 0x98(%rsp), %rdi
callq 0x1220a
movq %rax, %r15
testq %rax, %rax
je 0x178a5
leaq 0x98(%rsp), %rdx
movq %r15, (%rdx)
leaq 0x10(%rsp), %rcx
movl $0x1, (%rcx)
leaq 0x50(%rsp), %rdi
movq %r14, %rsi
callq 0x11fcc
leaq 0x98(%rsp), %rdx
movq %r15, (%rdx)
leaq 0x10(%rsp), %rcx
andl $0x0, (%rcx)
leaq 0x38(%rsp), %rdi
movq %r14, %rsi
callq 0x11fcc
xorps %xmm0, %xmm0
leaq 0x100(%rsp), %r14
andq $0x0, 0x10(%r14)
movaps %xmm0, (%r14)
movq 0x38(%rsp), %r15
movq 0x50(%rsp), %r12
leaq 0x98(%rsp), %r13
cmpq 0x40(%rsp), %r15
jae 0x1768b
cmpq 0x58(%rsp), %r12
jae 0x1768b
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x1644e
movq %r14, %rdi
movq %r13, %rsi
callq 0x16484
movq %r13, %rdi
callq 0x164b0
addq $0x20, %r15
addq $0x20, %r12
jmp 0x17652
leaq 0x1c0(%rsp), %rdi
movq %rbx, %rsi
callq 0x5430
movq 0x80(%rsp), %rsi
leaq 0x1a0(%rsp), %rdi
callq 0x5430
movq 0x68(%rsp), %rsi
leaq 0x180(%rsp), %rdi
callq 0x5430
leaq 0x98(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
leaq 0x1a0(%rsp), %rdx
leaq 0x180(%rsp), %rcx
callq 0x164c6
leaq 0x180(%rsp), %rdi
callq 0x5638
leaq 0x1a0(%rsp), %rdi
callq 0x5638
leaq 0x1c0(%rsp), %rdi
callq 0x5638
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl $0x270, %edi            # imm = 0x270
callq 0x5330
movq %rax, %r14
leaq 0x148(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x1652a
leaq 0x130(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x1652a
leaq 0x118(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x1657e
leaq 0x160(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x5430
leaq 0x98(%rsp), %rsi
leaq 0x148(%rsp), %rdx
leaq 0x130(%rsp), %rcx
leaq 0x118(%rsp), %r8
leaq 0x160(%rsp), %r9
movq %r14, %rdi
callq 0x19d84
leaq 0x160(%rsp), %rdi
callq 0x5638
leaq 0x118(%rsp), %rdi
callq 0x165d2
leaq 0x130(%rsp), %rdi
callq 0x121e8
leaq 0x148(%rsp), %rdi
callq 0x121e8
leaq 0x10(%rsp), %rdi
callq 0x5638
leaq 0x98(%rsp), %rdi
callq 0x13630
leaq 0x100(%rsp), %rdi
callq 0x165d2
leaq 0x38(%rsp), %rdi
callq 0x121e8
leaq 0x50(%rsp), %rdi
callq 0x121e8
leaq 0x68(%rsp), %rdi
callq 0x121e8
leaq 0x80(%rsp), %rdi
callq 0x121e8
movq %r14, %rax
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0xa0ef(%rip), %rdi      # 0x21937
leaq 0xa2a7(%rip), %rsi      # 0x21af6
leaq 0xa2b5(%rip), %rcx      # 0x21b0b
pushq $0x12
jmp 0x178bc
leaq 0xa110(%rip), %rdi      # 0x21971
leaq 0xa28e(%rip), %rsi      # 0x21af6
leaq 0xa29c(%rip), %rcx      # 0x21b0b
pushq $0x15
jmp 0x178bc
leaq 0xa10d(%rip), %rdi      # 0x21987
leaq 0xa275(%rip), %rsi      # 0x21af6
leaq 0xa283(%rip), %rcx      # 0x21b0b
pushq $0x1b
jmp 0x178bc
leaq 0xa112(%rip), %rdi      # 0x219a5
leaq 0xa25c(%rip), %rsi      # 0x21af6
leaq 0xa26a(%rip), %rcx      # 0x21b0b
pushq $0x1f
jmp 0x178bc
leaq 0xa11c(%rip), %rdi      # 0x219c8
leaq 0xa243(%rip), %rsi      # 0x21af6
leaq 0xa251(%rip), %rcx      # 0x21b0b
pushq $0x23
popq %rdx
callq 0x5210
movq %rax, %rbx
leaq 0x160(%rsp), %rdi
callq 0x5638
jmp 0x178d7
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x165d2
jmp 0x178e9
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
callq 0x121e8
jmp 0x178fb
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
callq 0x121e8
jmp 0x1790d
movq %rax, %rbx
movl $0x270, %esi            # imm = 0x270
movq %r14, %rdi
callq 0x5340
leaq 0x10(%rsp), %rdi
callq 0x5638
leaq 0x98(%rsp), %rdi
callq 0x13630
jmp 0x179af
movq %rax, %rbx
jmp 0x1791a
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0x5638
jmp 0x1794d
movq %rax, %rbx
leaq 0x1a0(%rsp), %rdi
callq 0x5638
jmp 0x1795f
movq %rax, %rbx
leaq 0x1c0(%rsp), %rdi
callq 0x5638
jmp 0x179af
jmp 0x179ac
movq %rax, %rbx
jmp 0x179c6
jmp 0x17990
jmp 0x17995
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x5638
jmp 0x179e7
movq %rax, %rbx
jmp 0x179e7
movq %rax, %rbx
jmp 0x179d0
movq %rax, %rbx
jmp 0x179da
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x164b0
jmp 0x179af
movq %rax, %rbx
leaq 0x100(%rsp), %rdi
callq 0x165d2
leaq 0x38(%rsp), %rdi
callq 0x121e8
leaq 0x50(%rsp), %rdi
callq 0x121e8
leaq 0x68(%rsp), %rdi
callq 0x121e8
leaq 0x80(%rsp), %rdi
callq 0x121e8
movq %rbx, %rdi
callq 0x55a0
nop