// File: tdv[P]boss/boss/include/plugin/factory_tools.h
// Function: Boss::RefObjPtr<MyNs::ISum> Boss::CreateObject<MyNs::ISum>(unsigned int)
inline RefObjPtr<T> CreateObject(ClassId clsId)
  {
    auto Locator = Private::GetServiceLocator();
    if (!Locator.Get())
      throw FactoryToolsException("Failed to get ServiceLocator.");
    RefObjPtr<IBase> FactoryInst;
    if (Locator->GetService(Service::Locator::Id::ClassFactoryService, FactoryInst.GetPPtr()) != Status::Ok)
      throw FactoryToolsException("ClassFactory not found.");
    RefObjQIPtr<IClassFactory> Factory(FactoryInst);
    if (!Factory.Get())
      throw FactoryToolsException("Interface IClassFactory not found.");
    RefObjPtr<IBase> Inst;
    if (Factory->CreateObject(clsId, Inst.GetPPtr()) != Status::Ok)
      throw FactoryToolsException("Failed to create object.");
    RefObjQIPtr<T> Ret(Inst);
    if (!Ret.Get())
      throw FactoryToolsException("Interface not found.");
    return std::move(Ret);
  }

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0x50(%rsp)
movq %rdi, %rax
movq %rax, 0x58(%rsp)
movq %rdi, 0xa0(%rsp)
movl %esi, 0x9c(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x18270
leaq 0x90(%rsp), %rdi
callq 0x19c20
cmpq $0x0, %rax
jne 0x18ccf
movl $0x10, %edi
callq 0x23610
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x48(%rsp)
leaq 0xae996(%rip), %rsi     # 0xc7605
callq 0x22c50
jmp 0x18c76
movq 0x48(%rsp), %rdi
leaq 0xe9416(%rip), %rsi     # 0x102098
leaq 0xa007(%rip), %rdx      # 0x22c90
callq 0x24660
jmp 0x19044
movq 0x48(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x88(%rsp)
movl %eax, 0x84(%rsp)
callq 0x23670
jmp 0x1902a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x88(%rsp)
movl %eax, 0x84(%rsp)
jmp 0x1902a
xorl %eax, %eax
movl %eax, %esi
leaq 0x78(%rsp), %rdi
callq 0x1c370
jmp 0x18cdf
leaq 0x90(%rsp), %rdi
callq 0x19b40
movq %rax, 0x38(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x1dad0
movq 0x38(%rsp), %rdi
movq %rax, %rdx
movq (%rdi), %rax
movq 0x28(%rax), %rax
movl $0x16d1a76d, %esi       # imm = 0x16D1A76D
callq *%rax
movl %eax, 0x44(%rsp)
jmp 0x18d17
movl 0x44(%rsp), %eax
cmpl $0x0, %eax
je 0x18d9c
movl $0x10, %edi
callq 0x23610
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x30(%rsp)
leaq 0xae8f2(%rip), %rsi     # 0xc762e
callq 0x22ca0
jmp 0x18d43
movq 0x30(%rsp), %rdi
leaq 0xe9349(%rip), %rsi     # 0x102098
leaq 0x9f3a(%rip), %rdx      # 0x22c90
callq 0x24660
jmp 0x19044
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x88(%rsp)
movl %eax, 0x84(%rsp)
jmp 0x19020
movq 0x30(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x88(%rsp)
movl %eax, 0x84(%rsp)
callq 0x23670
jmp 0x19020
leaq 0x70(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x22ce0
jmp 0x18dad
leaq 0x70(%rsp), %rdi
callq 0x22610
cmpq $0x0, %rax
jne 0x18e39
movl $0x10, %edi
callq 0x23610
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x28(%rsp)
leaq 0xae84a(%rip), %rsi     # 0xc7623
callq 0x22d30
jmp 0x18de0
movq 0x28(%rsp), %rdi
leaq 0xe92ac(%rip), %rsi     # 0x102098
leaq 0x9e9d(%rip), %rdx      # 0x22c90
callq 0x24660
jmp 0x19044
movq 0x28(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x88(%rsp)
movl %eax, 0x84(%rsp)
callq 0x23670
jmp 0x19016
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x88(%rsp)
movl %eax, 0x84(%rsp)
jmp 0x19016
xorl %eax, %eax
movl %eax, %esi
leaq 0x68(%rsp), %rdi
callq 0x1c370
jmp 0x18e49
leaq 0x70(%rsp), %rdi
callq 0x22d70
movq %rax, 0x20(%rsp)
jmp 0x18e5a
movl 0x9c(%rsp), %eax
movl %eax, 0x18(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x1dad0
movq 0x20(%rsp), %rdi
movl 0x18(%rsp), %esi
movq %rax, %rdx
movq (%rdi), %rax
movq 0x28(%rax), %rax
callq *%rax
movl %eax, 0x1c(%rsp)
jmp 0x18e8a
movl 0x1c(%rsp), %eax
cmpl $0x0, %eax
je 0x18f0f
movl $0x10, %edi
callq 0x23610
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x10(%rsp)
leaq 0xae3d9(%rip), %rsi     # 0xc7288
callq 0x22d80
jmp 0x18eb6
movq 0x10(%rsp), %rdi
leaq 0xe91d6(%rip), %rsi     # 0x102098
leaq 0x9dc7(%rip), %rdx      # 0x22c90
callq 0x24660
jmp 0x19044
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x88(%rsp)
movl %eax, 0x84(%rsp)
jmp 0x1900c
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x88(%rsp)
movl %eax, 0x84(%rsp)
callq 0x23670
jmp 0x1900c
leaq 0x60(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x22dc0
jmp 0x18f20
leaq 0x60(%rsp), %rdi
callq 0x22e10
movq %rax, 0x8(%rsp)
jmp 0x18f31
movq 0x8(%rsp), %rax
cmpq $0x0, %rax
jne 0x18faf
movl $0x10, %edi
callq 0x23610
movq %rax, %rdi
movq %rdi, %rax
movq %rax, (%rsp)
leaq 0xae30b(%rip), %rsi     # 0xc7262
callq 0x22e20
jmp 0x18f5e
movq (%rsp), %rdi
leaq 0xe912f(%rip), %rsi     # 0x102098
leaq 0x9d20(%rip), %rdx      # 0x22c90
callq 0x24660
jmp 0x19044
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x88(%rsp)
movl %eax, 0x84(%rsp)
jmp 0x19002
movq (%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x88(%rsp)
movl %eax, 0x84(%rsp)
callq 0x23670
jmp 0x19002
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x22e60
jmp 0x18fc0
leaq 0x60(%rsp), %rdi
callq 0x22ee0
leaq 0x68(%rsp), %rdi
callq 0x1ae80
leaq 0x70(%rsp), %rdi
callq 0x225a0
leaq 0x78(%rsp), %rdi
callq 0x1ae80
leaq 0x90(%rsp), %rdi
callq 0x19160
movq 0x58(%rsp), %rax
addq $0xa8, %rsp
retq
leaq 0x60(%rsp), %rdi
callq 0x22ee0
leaq 0x68(%rsp), %rdi
callq 0x1ae80
leaq 0x70(%rsp), %rdi
callq 0x225a0
leaq 0x78(%rsp), %rdi
callq 0x1ae80
leaq 0x90(%rsp), %rdi
callq 0x19160
movq 0x88(%rsp), %rdi
callq 0xc40a0
nopw %cs:(%rax,%rax)
nop