// File: /workspace/github_cpp_makefile_star2_O3/tdv[P]boss/boss/src/class_factory/class_factory.cpp
// Function: Boss::ClassFactory::CreateObject(unsigned int, Boss::IBase**)
RetCode BOSS_CALL ClassFactory::CreateObject(ClassId clsId, IBase **inst)
  {
    try
    {
      std::lock_guard<std::recursive_mutex> Lock(Mtx);
      {
        auto const ServiceIter = Services.find(clsId);
        if (ServiceIter != std::end(Services))
        {
          auto ModuleIter = Modules.find(ServiceIter->second);
          if (ModuleIter == std::end(Modules))
            return Status::Fail;
          return ModuleIter->second->GetModule().CreateObject(clsId).QueryInterface(inst);
        }
      }
      if (!Registry.Get())
        return Status::Fail;
      RefObjPtr<IServiceInfo> SrvInfo;
      RetCode Code = Registry->GetServiceInfo(clsId, SrvInfo.GetPPtr());
      if (Code != Status::Ok)
        return Code;
      {
        RefObjQIPtr<ILocalServiceInfo> LocalSrvInfo(SrvInfo);
        if (LocalSrvInfo.Get())
        {
          std::string Path;
          {
            RefObjPtr<IString> ModulePath;
            if ((Code = LocalSrvInfo->GetModulePath(ModulePath.GetPPtr())) != Status::Ok)
              return Code;
            Path = std::move(StringHelper(ModulePath).GetString<IString::AnsiString>());
          }
          auto Module = std::make_shared<ModuleHolderEx>(Path);
          auto NewInst = Module->GetModule().CreateObject(clsId);
          auto SrvId = Module->GetModule().GetServiceId();
          for (auto const &i : Module->GetModule().GetClassIds())
            Services[i] = SrvId;
          Modules.insert(std::make_pair(SrvId, std::move(Module)));
          return NewInst.QueryInterface(inst);
        }
      }
      {
        RefObjQIPtr<IRemoteServiceInfo> RemoteSrvInfo(SrvInfo);
        if (RemoteSrvInfo.Get())
        {
          return Status::NotImplemented;
        }
      }
    }
    catch (...)
    {
      return Status::Fail;
    }
    return Status::NotFound;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, %r14
movq %rdi, %r15
movl %esi, 0xc(%rsp)
leaq 0x20(%rdi), %rbx
movq %rbx, %rdi
callq 0x78d60
testl %eax, %eax
jne 0x7c448
leaq 0x48(%r15), %r12
leaq 0xc(%rsp), %rsi
movq %r12, %rdi
callq 0x76250
testq %rax, %rax
je 0x7c15d
subq $-0x80, %r15
addq $0xc, %rax
movq %r15, %rdi
movq %rax, %rsi
callq 0x777b0
testq %rax, %rax
je 0x7c197
movq 0x10(%rax), %rsi
addq $0x8, %rsi
movl 0xc(%rsp), %edx
leaq 0x40(%rsp), %rdi
callq 0x78250
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x7c197
movq (%rdi), %rax
movl $0x2cc77d66, %esi       # imm = 0x2CC77D66
movq %r14, %rdx
callq *0x20(%rax)
movl %eax, %ebp
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x7c19c
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x7c19c
movq 0xc8(%r15), %rdi
testq %rdi, %rdi
je 0x7c197
leaq 0x38(%rsp), %rdx
movq $0x0, (%rdx)
movl 0xc(%rsp), %esi
movq (%rdi), %rax
callq *0x28(%rax)
movl %eax, %ebp
testl %eax, %eax
je 0x7c1b8
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x7c19c
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x7c19c
movl $0x2, %ebp
movq %rbx, %rdi
callq 0x79140
movl %ebp, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $0x0, 0x30(%rsp)
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x7c3b8
movq (%rdi), %rax
leaq 0x30(%rsp), %rdx
movl $0xd893276e, %esi       # imm = 0xD893276E
callq *0x20(%rax)
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x7c3c2
movq %r14, 0x80(%rsp)
leaq 0x50(%rsp), %r14
movq %r14, -0x10(%r14)
xorl %eax, %eax
movq %rax, -0x8(%r14)
movb $0x0, (%r14)
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movq (%rdi), %rax
callq *0x38(%rax)
movl %eax, %ebp
testl %eax, %eax
jne 0x7c2a9
movq 0x10(%rsp), %rdi
movq %rdi, 0x28(%rsp)
testq %rdi, %rdi
je 0x7c235
movq (%rdi), %rax
callq *0x10(%rax)
movq %rsp, %rdi
leaq 0x28(%rsp), %rsi
callq 0x774d0
leaq 0x60(%rsp), %rdi
movq %rsp, %rsi
callq 0x793a0
leaq 0x40(%rsp), %rdi
leaq 0x60(%rsp), %r13
movq %r13, %rsi
callq 0x78ad0
movq (%r13), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x7c274
callq 0x76e40
movq (%rsp), %rdi
testq %rdi, %rdi
leaq 0x50(%rsp), %r14
je 0x7c288
movq (%rdi), %rax
callq *0x18(%rax)
movq $0x0, (%rsp)
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x7c2a0
movq (%rdi), %rax
callq *0x18(%rax)
movq $0x0, 0x28(%rsp)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x7c2b9
movq (%rdi), %rax
callq *0x18(%rax)
testl %ebp, %ebp
jne 0x7c420
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %rsi
leaq 0x60(%rsp), %rdx
leaq 0x40(%rsp), %rcx
callq 0x78ce0
movq 0x10(%rsp), %rsi
addq $0x8, %rsi
movl 0xc(%rsp), %edx
movq %rsp, %rdi
callq 0x78250
movq 0x10(%rsp), %rdi
addq $0x8, %rdi
callq 0x76780
movl %eax, %ebp
movq 0x10(%rsp), %rsi
addq $0x8, %rsi
leaq 0x60(%rsp), %rdi
callq 0x79460
movq 0x60(%rsp), %r13
movq 0x68(%rsp), %r14
cmpq %r14, %r13
je 0x7c344
movq %r12, %rdi
movq %r13, %rsi
callq 0x77640
movl %ebp, (%rax)
addq $0x4, %r13
cmpq %r14, %r13
jne 0x7c329
movq 0x60(%rsp), %r13
testq %r13, %r13
je 0x7c351
movq %r13, %rdi
callq 0x76e40
leaq 0x60(%rsp), %rsi
movl %ebp, (%rsi)
movaps 0x10(%rsp), %xmm0
movups %xmm0, 0x8(%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
subq $-0x80, %r15
movq %r15, %rdi
callq 0x785b0
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
leaq 0x50(%rsp), %r14
je 0x7c389
callq 0x780f0
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x7c40c
movq (%rdi), %rax
movl $0x2cc77d66, %esi       # imm = 0x2CC77D66
movq 0x80(%rsp), %rdx
callq *0x20(%rax)
movl %eax, %ebp
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x7c411
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x7c411
movl $0x3, %ebp
jmp 0x7c185
movq 0x38(%rsp), %rdi
movq $0x0, 0x40(%rsp)
movl $0x3, %ebp
testq %rdi, %rdi
je 0x7c185
movq (%rdi), %rax
leaq 0x40(%rsp), %rdx
movl $0x5d155638, %esi       # imm = 0x5D155638
callq *0x20(%rax)
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x7c185
movq (%rdi), %rax
movl $0x6, %ebp
callq *0x18(%rax)
jmp 0x7c185
movl $0x2, %ebp
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x7c420
callq 0x780f0
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x7c42f
callq 0x76e40
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x7c185
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x7c185
movl %eax, %edi
callq 0x79120
jmp 0x7c4f6
jmp 0x7c4f6
jmp 0x7c4f6
jmp 0x7c4f6
jmp 0x7c4db
movq %rax, %r14
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x7c530
callq 0x780f0
jmp 0x7c530
jmp 0x7c4d2
movq %rax, %r14
jmp 0x7c53f
movq %rax, %r14
jmp 0x7c54e
movq %rax, %r14
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x7c4a4
movq (%rdi), %rax
callq *0x18(%rax)
movq $0x0, (%rsp)
jmp 0x7c4b3
jmp 0x7c4f6
movq %rax, %r14
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x7c4c3
movq (%rdi), %rax
callq *0x18(%rax)
movq $0x0, 0x28(%rsp)
jmp 0x7c4de
jmp 0x7c4f6
jmp 0x7c4fe
movq %rax, %r14
jmp 0x7c530
jmp 0x7c4f6
jmp 0x7c4f6
movq %rax, %r14
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x7c54e
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x7c54e
jmp 0x7c4f6
jmp 0x7c4fe
jmp 0x7c4f6
movq %rax, %rdi
callq 0x7cf68
movq %rax, %r14
jmp 0x7c572
movq %rax, %r14
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x7c59a
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x7c59a
jmp 0x7c4f6
movq %rax, %r14
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x7c530
callq 0x76e40
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x7c53f
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x7c54e
callq 0x780f0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x7c562
callq 0x76e40
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x7c572
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x7c59a
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x7c59a
jmp 0x7c4f6
jmp 0x7c4f6
jmp 0x7c4f6
jmp 0x7c597
jmp 0x7c597
movq %rax, %r14
movq %rbx, %rdi
callq 0x79140
jmp 0x7c5a7
movq %rax, %r14
movq %r14, %rdi
callq 0x76470
callq 0x78090
movl $0x2, %ebp
jmp 0x7c1a4