// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x10b72(%rip), %rsi     # 0x2e9df
leaq 0x10b71(%rip), %rdx     # 0x2e9e5
leaq 0x10(%rsp), %rdi
callq 0x1a08c
leaq 0x108(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x10b55(%rip), %rsi     # 0x2e9e6
leaq 0x10b53(%rip), %rdx     # 0x2e9eb
leaq 0xf8(%rsp), %rdi
callq 0x1a08c
leaq 0xe8(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x10ac8(%rip), %rsi     # 0x2e980
leaq 0x10acd(%rip), %rdx     # 0x2e98c
leaq 0xd8(%rsp), %rdi
callq 0x1a08c
leaq 0xc8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x10ae6(%rip), %rsi     # 0x2e9c6
leaq 0x10ae4(%rip), %rdx     # 0x2e9cb
leaq 0xb8(%rsp), %rdi
callq 0x1a08c
movq 0x10(%rsp), %rsi
leaq 0x170(%rsp), %rdi
leaq 0x190(%rsp), %rdx
callq 0x1a044
leaq 0x170(%rsp), %rsi
movq %r14, %rdi
callq 0x1eec6
movq %rax, %r14
leaq 0x180(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1df42
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x5340
movq (%rbx), %rsi
leaq 0x150(%rsp), %rdi
leaq 0x190(%rsp), %rdx
callq 0x1a044
leaq 0x150(%rsp), %rdx
movq %r14, %rsi
callq 0x1ef5a
movq %rax, %r15
leaq 0x160(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1df8e
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x5340
testq %r14, %r14
je 0x1e2b8
testq %r15, %r15
je 0x1e2de
movq 0xf8(%rsp), %rsi
movq %r15, %rdi
callq 0x28b34
leaq 0x98(%rsp), %rdi
leaq 0x190(%rsp), %rdx
movq %rax, %rsi
callq 0x1a044
leaq 0x30(%rsp), %rsi
movq %r15, (%rsi)
movq 0xd8(%rsp), %rdx
leaq 0x190(%rsp), %rdi
callq 0x2a974
movq 0x190(%rsp), %rdi
testq %rdi, %rdi
je 0x1e010
movq (%rdi), %rax
callq *0x58(%rax)
testq %rax, %rax
je 0x1e010
movq 0x190(%rsp), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
movq %rax, %rdx
jmp 0x1e012
xorl %edx, %edx
testq %rdx, %rdx
je 0x1e304
leaq 0x118(%rsp), %rdi
callq 0x1edf4
movq 0xb8(%rsp), %rdx
leaq 0x190(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x2a974
movq 0x190(%rsp), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
movq 0x190(%rsp), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
movq %rax, %rdi
callq 0x293d2
leaq 0x130(%rsp), %rdi
leaq 0x190(%rsp), %rdx
movq %rax, %rsi
callq 0x1a044
leaq 0x88(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x78(%rsp), %rdi
callq 0x1a300
leaq 0x68(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x98(%rsp), %rsi
movq 0xa0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %rdi
callq 0x1a300
movq 0x118(%rsp), %rax
leaq 0x48(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x38(%rsp), %rdi
callq 0x1a300
leaq 0x190(%rsp), %rdi
leaq 0x78(%rsp), %rsi
leaq 0x58(%rsp), %rdx
leaq 0x38(%rsp), %rcx
callq 0x1f1aa
movq 0x38(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1e11c
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
je 0x1e133
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x78(%rsp), %rdi
cmpq %r14, %rdi
je 0x1e14d
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5340
movl $0x168, %edi            # imm = 0x168
callq 0x5330
movq %rax, %r14
movq 0x118(%rsp), %rdx
addq $0x20, %rdx
leaq 0x190(%rsp), %rsi
leaq 0x130(%rsp), %rcx
movq %rax, %rdi
callq 0x1adbe
leaq 0x1e8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e19f
movq 0x1e8(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x1c8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e1c0
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x1a0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e1e1
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x140(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e202
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x118(%rsp), %rdi
callq 0x19fe8
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e230
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0xb8(%rsp), %rdi
cmpq %r12, %rdi
je 0x1e24d
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0xd8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1e26a
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0xf8(%rsp), %rdi
cmpq %r13, %rdi
je 0x1e287
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1e2a3
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5340
movq %r14, %rax
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1cd01(%rip), %rdi     # 0x3afc0
leaq 0x10726(%rip), %rsi     # 0x2e9ec
movl $0x25, %edx
callq 0x53a0
movq 0x1cce9(%rip), %rdi     # 0x3afc0
callq 0x51a0
jmp 0x1e328
movq 0x1ccdb(%rip), %rdi     # 0x3afc0
leaq 0x10726(%rip), %rsi     # 0x2ea12
movl $0x23, %edx
callq 0x53a0
movq 0x1ccc3(%rip), %rdi     # 0x3afc0
callq 0x51a0
jmp 0x1e328
movq 0x1ccb5(%rip), %rdi     # 0x3afc0
leaq 0x10724(%rip), %rsi     # 0x2ea36
movl $0x1c, %edx
callq 0x53a0
movq 0x1cc9d(%rip), %rdi     # 0x3afc0
callq 0x51a0
xorl %edi, %edi
callq 0x53e0
jmp 0x1e45c
movq %rax, 0x8(%rsp)
movl $0x168, %esi            # imm = 0x168
movq %r14, %rdi
callq 0x5340
jmp 0x1e34d
movq %rax, 0x8(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x1b88a
jmp 0x1e3be
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1e37f
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x1e37f
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
je 0x1e39d
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x1e39d
movq %rax, 0x8(%rsp)
movq 0x78(%rsp), %rdi
cmpq %r14, %rdi
je 0x1e3be
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x1e3be
movq %rax, 0x8(%rsp)
leaq 0x140(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e468
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x1e468
jmp 0x1e463
jmp 0x1e463
jmp 0x1e45c
jmp 0x1e455
jmp 0x1e455
movq %rax, 0x8(%rsp)
leaq 0x160(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e496
movq 0x160(%rsp), %rsi
jmp 0x1e48e
jmp 0x1e455
movq %rax, 0x8(%rsp)
leaq 0x180(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e496
movq 0x180(%rsp), %rsi
jmp 0x1e48e
jmp 0x1e455
movq %rax, 0x8(%rsp)
jmp 0x1e4b3
movq %rax, 0x8(%rsp)
jmp 0x1e4d0
movq %rax, 0x8(%rsp)
jmp 0x1e4ed
movq %rax, 0x8(%rsp)
jmp 0x1e496
movq %rax, 0x8(%rsp)
jmp 0x1e475
movq %rax, 0x8(%rsp)
leaq 0x118(%rsp), %rdi
callq 0x19fe8
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e496
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0xb8(%rsp), %rdi
cmpq %r12, %rdi
je 0x1e4b3
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0xd8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1e4d0
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0xf8(%rsp), %rdi
cmpq %r13, %rdi
je 0x1e4ed
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1e509
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x8(%rsp), %rdi
callq 0x55c0
nop