// File: /workspace/github_cpp_makefile_star2_O1/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, 0x60(%rsp)
movl %esi, %ebp
movq %rdi, %r15
leaq 0x20(%rdi), %rbx
movq %rbx, %rdi
callq 0x79d60
testl %eax, %eax
jne 0x7d504
movl %ebp, %eax
movq 0x48(%r15), %rsi
movq 0x50(%r15), %rdi
xorl %r9d, %r9d
xorl %edx, %edx
divq %rdi
movq (%rsi,%rdx,8), %rax
testq %rax, %rax
je 0x7d161
movq (%rax), %r8
movq %rax, %r9
cmpl %ebp, 0x8(%r8)
je 0x7d161
movq %rdx, %rcx
movq %r8, %r10
movq (%r8), %r8
testq %r8, %r8
je 0x7d15e
movl 0x8(%r8), %esi
movq %rsi, %rax
xorl %edx, %edx
divq %rdi
movl $0x0, %r9d
cmpq %rcx, %rdx
jne 0x7d161
movq %r10, %r9
cmpl %ebp, %esi
jne 0x7d133
jmp 0x7d161
xorl %r9d, %r9d
testq %r9, %r9
je 0x7d16b
movq (%r9), %r13
jmp 0x7d16e
xorl %r13d, %r13d
testq %r13, %r13
je 0x7d1a6
leaq 0x80(%r15), %rdi
leaq 0xc(%r13), %rcx
movl 0xc(%r13), %r8d
movq %r8, %rax
xorl %edx, %edx
divq 0x88(%r15)
movq %rdx, %rsi
movq %rcx, %rdx
movq %r8, %rcx
callq 0x79200
testq %rax, %rax
je 0x7d1a8
movq (%rax), %rax
jmp 0x7d1aa
jmp 0x7d200
xorl %eax, %eax
testq %rax, %rax
je 0x7d1e2
movq 0x10(%rax), %rsi
addq $0x8, %rsi
leaq 0x40(%rsp), %rdi
movl %ebp, %edx
callq 0x79250
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x7d1ea
movq (%rdi), %rax
movl $0x2cc77d66, %esi       # imm = 0x2CC77D66
movq 0x60(%rsp), %rdx
callq *0x20(%rax)
movl %eax, %r12d
jmp 0x7d1f0
movl $0x2, %r12d
jmp 0x7d200
movl $0x2, %r12d
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x7d200
movq (%rdi), %rax
callq *0x18(%rax)
testq %r13, %r13
je 0x7d225
movl %r12d, %r13d
movq %rbx, %rdi
callq 0x7a140
movl %r13d, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xc8(%r15), %rdi
testq %rdi, %rdi
je 0x7d44c
leaq 0x30(%rsp), %rdx
movq $0x0, (%rdx)
movq (%rdi), %rax
movl %ebp, %esi
callq *0x28(%rax)
movl %eax, %r13d
testl %eax, %eax
jne 0x7d4eb
movq $0x0, 0x28(%rsp)
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x7d277
movq (%rdi), %rax
leaq 0x28(%rsp), %rdx
movl $0xd893276e, %esi       # imm = 0xD893276E
callq *0x20(%rax)
movq 0x28(%rsp), %r14
testq %r14, %r14
je 0x7d457
leaq 0x50(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb $0x0, (%rcx)
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movq (%r14), %rax
movq %r14, %rdi
callq *0x38(%rax)
movl %eax, %r13d
movl %eax, 0x38(%rsp)
testl %eax, %eax
jne 0x7d344
movq 0x10(%rsp), %rdi
movq %rdi, 0x20(%rsp)
testq %rdi, %rdi
je 0x7d2cc
movq (%rdi), %rax
callq *0x10(%rax)
leaq 0x8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x784c0
leaq 0x68(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x7a3a0
leaq 0x40(%rsp), %rdi
leaq 0x68(%rsp), %r13
movq %r13, %rsi
callq 0x79ad0
movq (%r13), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x7d30f
callq 0x77e30
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x7d31f
movq (%rdi), %rax
callq *0x18(%rax)
movq $0x0, 0x8(%rsp)
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x7d338
movq (%rdi), %rax
callq *0x18(%rax)
movq $0x0, 0x20(%rsp)
movl %r12d, %r13d
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x7d354
movq (%rdi), %rax
callq *0x18(%rax)
cmpl $0x0, 0x38(%rsp)
jne 0x7d481
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %rsi
leaq 0x68(%rsp), %rdx
leaq 0x40(%rsp), %rcx
callq 0x79ce0
movq 0x10(%rsp), %rsi
addq $0x8, %rsi
leaq 0x8(%rsp), %rdi
movl %ebp, %edx
callq 0x79250
movq 0x10(%rsp), %rdi
addq $0x8, %rdi
callq 0x77770
movl %eax, %ebp
movq %r14, 0x38(%rsp)
movq 0x10(%rsp), %rsi
addq $0x8, %rsi
leaq 0x68(%rsp), %rdi
callq 0x7a460
movq 0x68(%rsp), %r12
movq 0x70(%rsp), %r14
cmpq %r14, %r12
je 0x7d3e6
leaq 0x48(%r15), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x78630
movl %ebp, (%rax)
addq $0x4, %r12
cmpq %r14, %r12
jne 0x7d3d0
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x7d3f5
callq 0x77e30
leaq 0x68(%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 0x795b0
movq 0x38(%rsp), %r14
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x7d42d
callq 0x790e0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x7d45c
movq (%rdi), %rax
movl $0x2cc77d66, %esi       # imm = 0x2CC77D66
movq 0x60(%rsp), %rdx
callq *0x20(%rax)
movl %eax, %r13d
jmp 0x7d462
movl $0x2, %r13d
jmp 0x7d208
movl %r12d, %r13d
jmp 0x7d495
movl $0x2, %r13d
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x7d472
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x7d481
callq 0x790e0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x7d495
callq 0x77e30
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x7d4a5
movq (%rdi), %rax
callq *0x18(%rax)
testq %r14, %r14
jne 0x7d4eb
movq $0x0, 0x40(%rsp)
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x7d4cd
movq (%rdi), %rax
leaq 0x40(%rsp), %rdx
movl $0x5d155638, %esi       # imm = 0x5D155638
callq *0x20(%rax)
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x7d4e5
movq (%rdi), %rax
movl $0x6, %r13d
callq *0x18(%rax)
jmp 0x7d4eb
movl $0x3, %r13d
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x7d208
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x7d208
movl %eax, %edi
callq 0x7a120
jmp 0x7d5c0
jmp 0x7d5c0
jmp 0x7d5c0
jmp 0x7d599
movq %rax, %r14
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x7d602
callq 0x790e0
jmp 0x7d602
jmp 0x7d5c0
jmp 0x7d5b8
jmp 0x7d590
movq %rax, %r14
jmp 0x7d61b
movq %rax, %r14
jmp 0x7d62a
movq %rax, %r14
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x7d563
movq (%rdi), %rax
callq *0x18(%rax)
movq $0x0, 0x8(%rsp)
jmp 0x7d573
jmp 0x7d5c0
movq %rax, %r14
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x7d583
movq (%rdi), %rax
callq *0x18(%rax)
movq $0x0, 0x20(%rsp)
jmp 0x7d59c
jmp 0x7d5c0
movq %rax, %r14
jmp 0x7d602
jmp 0x7d5c0
jmp 0x7d5c0
movq %rax, %r14
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x7d62a
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x7d62a
jmp 0x7d5c0
jmp 0x7d5b8
jmp 0x7d5c0
movq %rax, %r14
jmp 0x7d657
movq %rax, %rdi
callq 0x7e04b
movq %rax, %r14
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x7d5db
movq (%rdi), %rax
callq *0x18(%rax)
movq $0x0, 0x40(%rsp)
jmp 0x7d67b
jmp 0x7d5c0
jmp 0x7d678
movq %rax, %r14
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x7d602
callq 0x77e30
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x7d612
movq (%rdi), %rax
callq *0x18(%rax)
movq $0x0, 0x8(%rsp)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x7d62a
callq 0x790e0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x7d63e
callq 0x77e30
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x7d64e
movq (%rdi), %rax
callq *0x18(%rax)
movq $0x0, 0x28(%rsp)
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x7d67b
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x7d67b
jmp 0x7d5c0
jmp 0x7d5c0
jmp 0x7d5c0
movq %rax, %r14
movq %rbx, %rdi
callq 0x7a140
jmp 0x7d688
movq %rax, %r14
movq %r14, %rdi
callq 0x77460
callq 0x79080
movl $0x2, %r13d
jmp 0x7d210