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

     string mainNode("scenes");
     string attrib("title");
     string childrenNode("descriptions");
     string childrenNode2("image");

     // getting element item
     pElem elem_Scenes = this->getGameElement(mainNode.c_str());	  	  
     pElem elem_Scene  = this->searchForElementId(elem_Scenes,scenId.c_str());

     if(elem_Scenes==NULL){
	  cout<<"Handle returned a Null at elem_Scenes"<<endl;
	  exit(0);
     }
	  
     if(elem_Scene==NULL){
	  cout<<"Handle returned a Null at elem_Scen"<<endl;
	  exit(0);
     }

     const string& scen_title = elem_Scene->Attribute(attrib.c_str());

     //cout<<"title scenary:"<<scen_title<<endl;
	  
     // handler
     TiXmlHandle itemHandle(elem_Scene);	  	  
     pElem scen_descrips=itemHandle.FirstChild(childrenNode.c_str()).ToElement();
	  
     if(scen_descrips==NULL){
	  // TODO: Add an asscertion
	  cout<<"Handle returned a Null value"<<endl;
	  exit(0);
     }
	  
     vector<string> descripts = getTextListFromNode(scen_descrips);

     pElem scen_image = itemHandle.FirstChild(childrenNode2.c_str()).ToElement();	  
     string pathText  = scen_image->GetText();

     const Entidad& ent = Entidad(scenId,scen_title,descripts[0]);
	  
     pScene scene = new Escenario(ent,descripts[1],pathText);
			 
     return scene;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x360, %rsp            # imm = 0x360
movq %rsi, -0x2a8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x2a0(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x298(%rbp)
callq 0x56d0
movq -0x298(%rbp), %rdx
leaq 0x1b6f4(%rip), %rsi     # 0x509f7
leaq -0x30(%rbp), %rdi
callq 0x299c0
jmp 0x3530e
leaq -0x31(%rbp), %rdi
callq 0x5420
leaq -0x69(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x56d0
movq -0x2b0(%rbp), %rdx
leaq 0x1b6c9(%rip), %rsi     # 0x509fe
leaq -0x68(%rbp), %rdi
callq 0x299c0
jmp 0x35340
leaq -0x69(%rbp), %rdi
callq 0x5420
leaq -0x91(%rbp), %rdi
movq %rdi, -0x2b8(%rbp)
callq 0x56d0
movq -0x2b8(%rbp), %rdx
leaq 0x1b62e(%rip), %rsi     # 0x50998
leaq -0x90(%rbp), %rdi
callq 0x299c0
jmp 0x35378
leaq -0x91(%rbp), %rdi
callq 0x5420
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x2c0(%rbp)
callq 0x56d0
movq -0x2c0(%rbp), %rdx
leaq 0x1b639(%rip), %rsi     # 0x509de
leaq -0xb8(%rbp), %rdi
callq 0x299c0
jmp 0x353b3
leaq -0xb9(%rbp), %rdi
callq 0x5420
leaq -0x30(%rbp), %rdi
callq 0x5170
movq %rax, -0x2d0(%rbp)
leaq -0xe9(%rbp), %rdi
movq %rdi, -0x2c8(%rbp)
callq 0x56d0
movq -0x2d0(%rbp), %rsi
movq -0x2c8(%rbp), %rdx
leaq -0xe8(%rbp), %rdi
callq 0x299c0
jmp 0x353fe
movq -0x2a0(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x36680
movq %rax, -0x2d8(%rbp)
jmp 0x3541a
leaq -0xe8(%rbp), %rdi
callq 0x5748
leaq -0xe9(%rbp), %rdi
callq 0x5420
movq -0x2d8(%rbp), %rax
movq -0x2a8(%rbp), %rdi
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0x2f0(%rbp)
callq 0x5170
movq %rax, -0x2e8(%rbp)
leaq -0x119(%rbp), %rdi
movq %rdi, -0x2e0(%rbp)
callq 0x56d0
movq -0x2e8(%rbp), %rsi
movq -0x2e0(%rbp), %rdx
leaq -0x118(%rbp), %rdi
callq 0x299c0
jmp 0x35490
movq -0x2f0(%rbp), %rsi
movq -0x2a0(%rbp), %rdi
leaq -0x118(%rbp), %rdx
callq 0x36730
movq %rax, -0x2f8(%rbp)
jmp 0x354b3
leaq -0x118(%rbp), %rdi
callq 0x5748
leaq -0x119(%rbp), %rdi
callq 0x5420
movq -0x2f8(%rbp), %rax
movq %rax, -0xf8(%rbp)
cmpq $0x0, -0xc8(%rbp)
jne 0x3560c
movq 0x3baca(%rip), %rdi     # 0x70fb8
leaq 0x1b50f(%rip), %rsi     # 0x50a04
callq 0x53a0
movq %rax, -0x300(%rbp)
jmp 0x35503
movq -0x300(%rbp), %rdi
movq 0x3ba7f(%rip), %rsi     # 0x70f90
callq 0x5400
jmp 0x35518
xorl %edi, %edi
callq 0x54a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x5420
jmp 0x35ace
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x69(%rbp), %rdi
callq 0x5420
jmp 0x35ac5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x91(%rbp), %rdi
callq 0x5420
jmp 0x35abc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xb9(%rbp), %rdi
callq 0x5420
jmp 0x35ab0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x355b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x5748
leaq -0xe9(%rbp), %rdi
callq 0x5420
jmp 0x35aa4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x355ea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x5748
leaq -0x119(%rbp), %rdi
callq 0x5420
jmp 0x35aa4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x35aa4
cmpq $0x0, -0xf8(%rbp)
jne 0x3564e
movq 0x3b99b(%rip), %rdi     # 0x70fb8
leaq 0x1b406(%rip), %rsi     # 0x50a2a
callq 0x53a0
movq %rax, -0x308(%rbp)
jmp 0x35632
movq -0x308(%rbp), %rdi
movq 0x3b950(%rip), %rsi     # 0x70f90
callq 0x5400
jmp 0x35647
xorl %edi, %edi
callq 0x54a0
movq -0xf8(%rbp), %rax
movq %rax, -0x318(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5170
movq -0x318(%rbp), %rdi
movq %rax, %rsi
callq 0x48430
movq %rax, -0x310(%rbp)
jmp 0x3567d
leaq -0x149(%rbp), %rdi
movq %rdi, -0x320(%rbp)
callq 0x56d0
movq -0x310(%rbp), %rsi
movq -0x320(%rbp), %rdx
leaq -0x148(%rbp), %rdi
callq 0x299c0
jmp 0x356ac
leaq -0x149(%rbp), %rdi
callq 0x5420
leaq -0x148(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0xf8(%rbp), %rsi
leaq -0x158(%rbp), %rdi
callq 0x29940
jmp 0x356db
leaq -0x90(%rbp), %rdi
callq 0x5170
movq %rax, %rdx
leaq -0x168(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x4a8e0
jmp 0x356ff
leaq -0x168(%rbp), %rdi
callq 0x29960
movq %rax, -0x328(%rbp)
jmp 0x35714
movq -0x328(%rbp), %rax
movq %rax, -0x160(%rbp)
cmpq $0x0, -0x160(%rbp)
jne 0x35792
movq 0x3b885(%rip), %rdi     # 0x70fb8
leaq 0x1b314(%rip), %rsi     # 0x50a4e
callq 0x53a0
movq %rax, -0x330(%rbp)
jmp 0x35748
movq -0x330(%rbp), %rdi
movq 0x3b83a(%rip), %rsi     # 0x70f90
callq 0x5400
jmp 0x3575d
xorl %edi, %edi
callq 0x54a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x149(%rbp), %rdi
callq 0x5420
jmp 0x35aa4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x35a98
movq -0x2a0(%rbp), %rsi
movq -0x160(%rbp), %rdx
leaq -0x180(%rbp), %rdi
callq 0x36530
jmp 0x357ae
leaq -0xb8(%rbp), %rdi
callq 0x5170
movq %rax, %rdx
leaq -0x190(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x4a8e0
jmp 0x357d2
leaq -0x190(%rbp), %rdi
callq 0x29960
movq %rax, -0x338(%rbp)
jmp 0x357e7
movq -0x338(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x188(%rbp), %rdi
callq 0x48ec0
movq %rax, -0x340(%rbp)
jmp 0x3580a
leaq -0x1b1(%rbp), %rdi
movq %rdi, -0x348(%rbp)
callq 0x56d0
movq -0x340(%rbp), %rsi
movq -0x348(%rbp), %rdx
leaq -0x1b0(%rbp), %rdi
callq 0x299c0
jmp 0x35839
leaq -0x1b1(%rbp), %rdi
callq 0x5420
movq -0x2a8(%rbp), %rsi
leaq -0x248(%rbp), %rdi
callq 0x5180
jmp 0x3585a
movq -0x128(%rbp), %rsi
leaq -0x268(%rbp), %rdi
callq 0x5180
jmp 0x3586f
xorl %eax, %eax
movl %eax, %esi
leaq -0x180(%rbp), %rdi
callq 0x36b30
movq %rax, %rsi
leaq -0x288(%rbp), %rdi
callq 0x5180
jmp 0x35890
leaq -0x228(%rbp), %rdi
leaq -0x248(%rbp), %rsi
leaq -0x268(%rbp), %rdx
leaq -0x288(%rbp), %rcx
callq 0x36b50
jmp 0x358b3
leaq -0x288(%rbp), %rdi
callq 0x5748
leaq -0x268(%rbp), %rdi
callq 0x5748
leaq -0x248(%rbp), %rdi
callq 0x5748
leaq -0x228(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movl $0x168, %edi            # imm = 0x168
callq 0x53c0
movq %rax, -0x350(%rbp)
jmp 0x358f8
movq -0x1c0(%rbp), %rax
movq %rax, -0x358(%rbp)
leaq -0x180(%rbp), %rdi
movl $0x1, %esi
callq 0x36b30
movq -0x350(%rbp), %rdi
movq -0x358(%rbp), %rsi
movq %rax, %rdx
leaq -0x1b0(%rbp), %rcx
callq 0x2c6a0
jmp 0x35936
movq -0x350(%rbp), %rax
movq %rax, -0x290(%rbp)
movq -0x290(%rbp), %rax
movq %rax, -0x360(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x2d510
leaq -0x1b0(%rbp), %rdi
callq 0x5748
leaq -0x180(%rbp), %rdi
callq 0x298b0
leaq -0x148(%rbp), %rdi
callq 0x5748
leaq -0xb8(%rbp), %rdi
callq 0x5748
leaq -0x90(%rbp), %rdi
callq 0x5748
leaq -0x68(%rbp), %rdi
callq 0x5748
leaq -0x30(%rbp), %rdi
callq 0x5748
movq -0x360(%rbp), %rax
addq $0x360, %rsp            # imm = 0x360
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x35a8c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1b1(%rbp), %rdi
callq 0x5420
jmp 0x35a8c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x35a80
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x35a3b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x35a2f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x288(%rbp), %rdi
callq 0x5748
leaq -0x268(%rbp), %rdi
callq 0x5748
leaq -0x248(%rbp), %rdi
callq 0x5748
jmp 0x35a80
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x35a74
movq -0x350(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x168, %esi            # imm = 0x168
callq 0x53d0
leaq -0x228(%rbp), %rdi
callq 0x2d510
leaq -0x1b0(%rbp), %rdi
callq 0x5748
leaq -0x180(%rbp), %rdi
callq 0x298b0
leaq -0x148(%rbp), %rdi
callq 0x5748
leaq -0xb8(%rbp), %rdi
callq 0x5748
leaq -0x90(%rbp), %rdi
callq 0x5748
leaq -0x68(%rbp), %rdi
callq 0x5748
leaq -0x30(%rbp), %rdi
callq 0x5748
movq -0x40(%rbp), %rdi
callq 0x56c0
nopw (%rax,%rax)