// File: /workspace/github_cpp_makefile_star2_O2/tdv[P]boss/boss/src/service_registry/service_registry.cpp
// Function: Boss::ServiceRegistry::Load(Boss::IIStream*)
RetCode BOSS_CALL ServiceRegistry::Load(IIStream *stream)
  {
    if (!stream)
      return Status::InvalidArgument;
    std::lock_guard<std::recursive_mutex> Lock(Mtx);
    try
    {
      auto Registry = PropertyBagType::Create(RegistryTag);
      RetCode Code = Registry->Load(stream);
      if (Code != Status::Ok)
        return Code;
      RefObjPtr<IBase> ServiceEnumProp;
      if ((Code = Registry->GetProperty(ServicesTag, ServiceEnumProp.GetPPtr())) != Status::Ok)
        return Code;
      EnumHelper<IPropertyBag> ServiceEnum(ServiceEnumProp);
      ServicePool NewServices;
      for (auto i =ServiceEnum.First() ; i.Get() ; i = ServiceEnum.Next())
      {
        RefObjPtr<IBase> EntId;
        if ((Code = i->GetProperty(ServiceIdTag, EntId.GetPPtr())) != Status::Ok)
          return Code;
        RefObjQIPtr<IEntityId> EntSrvId(EntId);
        if (!EntSrvId.Get())
          return Status::Fail;
        ServiceId SrvId = 0;
        if ((Code = EntSrvId->GetId(&SrvId)) != Status::Ok)
          return Code;
        RefObjPtr<IBase> ClassIdsEnumProp;
        if ((Code = i->GetProperty(ClassIdsTag, ClassIdsEnumProp.GetPPtr())) != Status::Ok)
          return Code;
        RefObjQIPtr<IEnum> ClassIdsEnum(ClassIdsEnumProp);
        if (!ClassIdsEnum.Get())
          return Status::Fail;
        RefObjPtr<IBase> ModulePathProp;
        RefObjPtr<IServiceInfo> ServiceInfo;
        if (i->GetProperty(ModulePathTag, ModulePathProp.GetPPtr()) == Status::Ok)
        {
          RefObjQIPtr<IString> ModulePath(ModulePathProp);
          if (!ModulePath.Get())
            return Status::Fail;
          auto LocalSrvInfo = Base<LocalServiceInfo>::Create();
          LocalSrvInfo->SetServiceId(SrvId);
          LocalSrvInfo->AddCoClassIds(ClassIdsEnum);
          LocalSrvInfo->SetModulePath(ModulePath);
          ServiceInfo = LocalSrvInfo;
        }
        else
        {
          auto RemoteSrvInfo = Base<RemoteServiceInfo>::Create();
          RemoteSrvInfo->SetServiceId(SrvId);
          RemoteSrvInfo->AddCoClassIds(ClassIdsEnum);
          {
            RefObjPtr<IBase> EntId;
            if (i->GetProperty(SerializerIdTag, EntId.GetPPtr()) == Status::Ok)
            {
              RefObjQIPtr<IEntityId> SerializerId(EntId);
              if (!SerializerId.Get())
                return Status::Fail;
              ClassId Id;
              if (SerializerId->GetId(&Id) != Status::Ok)
                return Status::Fail;
              RemoteSrvInfo->SetSerializerId(Id);
            }
            return Status::Fail;
          }
          {
            RefObjPtr<IBase> EntId;
            if (i->GetProperty(RemotingIdTag, EntId.GetPPtr()) == Status::Ok)
            {
              RefObjQIPtr<IEntityId> RemotingId(EntId);
              if (!RemotingId.Get())
                return Status::Fail;
              ClassId Id;
              if (RemotingId->GetId(&Id) != Status::Ok)
                return Status::Fail;
              RemoteSrvInfo->SetRemotingId(Id);
            }
            return Status::Fail;
          }
          {
            RefObjPtr<IBase> EntId;
            if (i->GetProperty(TransportIdTag, EntId.GetPPtr()) == Status::Ok)
            {
              RefObjQIPtr<IEntityId> TransportId(EntId);
              if (!TransportId.Get())
                return Status::Fail;
              ClassId Id;
              if (TransportId->GetId(&Id) != Status::Ok)
                return Status::Fail;
              RemoteSrvInfo->SetTransportId(Id);
            }
            return Status::Fail;
          }
          RefObjPtr<IBase> TransportPropertiesProp;
          if (i->GetProperty(TransportPropertiesTag, TransportPropertiesProp.GetPPtr()) == Status::Ok)
          {
            RefObjQIPtr<IPropertyBag> TransportProperties(TransportPropertiesProp);
            if (!TransportProperties.Get())
              return Status::Fail;
            RemoteSrvInfo->SetProps(TransportProperties);
            ServiceInfo = RemoteSrvInfo;
          }
          else
            return Status::Fail;
        }
        EnumHelper<IEntityId> ClassIdsEnumHelper(ClassIdsEnum);
        for (auto j = ClassIdsEnumHelper.First() ; j.Get() ; j = ClassIdsEnumHelper.Next())
        {
          ClassId Id = 0;
          if ((Code = j->GetId(&Id)) != Status::Ok)
            return Code;
          NewServices[Id] = ServiceInfo;
        }
      }
      std::swap(Services, NewServices);
      return Status::Ok;
    }
    catch (...)
    {
      return Status::Fail;
    }
    return Status::Ok;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
testq %rsi, %rsi
je 0x1cc6a
movq %rsi, %r15
movq %rdi, %r14
leaq 0x28(%rdi), %rbx
movq %rbx, %rdi
callq 0x1e168
leaq 0xba887(%rip), %rsi     # 0xd7040
leaq 0x68(%rsp), %rdi
callq 0x1d75c
movq 0x68(%rsp), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *0x48(%rax)
movl %eax, %r15d
testl %eax, %eax
jne 0x1ccbf
leaq 0x80(%rsp), %rdx
andq $0x0, (%rdx)
movq 0x68(%rsp), %rdi
movq (%rdi), %rax
leaq 0xba8b8(%rip), %rsi     # 0xd70af
callq *0x30(%rax)
movl %eax, %r15d
testl %eax, %eax
jne 0x1ccb2
leaq 0x78(%rsp), %rdi
leaq 0x80(%rsp), %rsi
movq %rbx, 0x30(%rsp)
callq 0x1d7e0
leaq 0x60(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x1d7fa
leaq 0x78(%rsp), %rdi
callq 0x1d5ae
leaq 0xe0(%rsp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
leaq 0x20(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x1d870
leaq 0xba7e0(%rip), %rbp     # 0xd7051
leaq 0x40(%rsp), %r12
movq 0x20(%rsp), %r13
testq %r13, %r13
je 0x1cc70
andq $0x0, 0x40(%rsp)
movq (%r13), %rax
movq %r13, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq *0x28(%rax)
testl %eax, %eax
je 0x1c8a8
xorl %ebx, %ebx
movl %eax, %r15d
jmp 0x1cc24
leaq 0x70(%rsp), %rdi
movq %r12, %rsi
callq 0x1d8b6
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1c8dc
andl $0x0, 0x2c(%rsp)
movq (%rdi), %rax
leaq 0x2c(%rsp), %rsi
callq *0x28(%rax)
movl %eax, %ebp
testl %eax, %eax
je 0x1c8e6
xorl %ebx, %ebx
jmp 0x1cc10
xorl %ebx, %ebx
pushq $0x2
popq %rbp
jmp 0x1cc10
andq $0x0, 0x58(%rsp)
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
leaq 0xba760(%rip), %rsi     # 0xd705b
leaq 0x58(%rsp), %rdx
callq *0x28(%rax)
movl %eax, %ebp
testl %eax, %eax
je 0x1c910
xorl %ebx, %ebx
jmp 0x1cc06
leaq 0x38(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x1d7e0
cmpq $0x0, 0x38(%rsp)
leaq 0x10(%rsp), %rbx
je 0x1ca10
andq $0x0, 0x50(%rsp)
andq $0x0, 0x48(%rsp)
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
leaq 0xba759(%rip), %rsi     # 0xd70a4
leaq 0x50(%rsp), %rdx
callq *0x28(%rax)
testl %eax, %eax
je 0x1ca1a
movq %rbx, %rdi
callq 0x1db38
movq 0x10(%rsp), %rbp
movl 0x2c(%rsp), %eax
movl %eax, 0x1c(%rbp)
leaq 0xa8(%rsp), %rbx
movq %rbx, %rdi
leaq 0x38(%rsp), %rsi
callq 0x1da5a
addq $0x8, %rbp
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x1dbb6
movq %rbx, %rdi
callq 0x1d73c
andq $0x0, 0x8(%rsp)
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
leaq 0xba6b4(%rip), %rsi     # 0xd7064
leaq 0x8(%rsp), %rdx
callq *0x28(%rax)
testl %eax, %eax
jne 0x1cbcf
leaq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1d8b6
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1cbbc
movq (%rdi), %rax
leaq 0x8c(%rsp), %rsi
callq *0x28(%rax)
pushq $0x2
popq %rbp
testl %eax, %eax
sete %bl
jne 0x1cbc1
movq 0x10(%rsp), %rax
movl 0x8c(%rsp), %ecx
movl %ecx, 0x38(%rax)
movl %r15d, %ebp
jmp 0x1cbc1
xorl %ebx, %ebx
pushq $0x2
popq %rbp
jmp 0x1cbfc
movq %rbx, %rdi
leaq 0x50(%rsp), %rsi
callq 0x1d8d0
movq 0x10(%rsp), %rbx
pushq $0x2
popq %rbp
testq %rbx, %rbx
je 0x1cad1
leaq 0x8(%rsp), %rdi
callq 0x1d8ea
movq 0x8(%rsp), %rbp
movl 0x2c(%rsp), %eax
movl %eax, 0x1c(%rbp)
leaq 0xa0(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x1da5a
addq $0x8, %rbp
movq %rbp, %rdi
leaq 0xa0(%rsp), %rbp
movq %rbp, %rsi
callq 0x1d968
movq %rbp, %rdi
callq 0x1d73c
movq 0x8(%rsp), %rbp
leaq 0x98(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x1da8c
addq $0x30, %rbp
movq %rbp, %rdi
leaq 0x98(%rsp), %rbp
movq %rbp, %rsi
callq 0x1e104
movq %rbp, %rdi
callq 0x1dabe
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1dace
leaq 0x8(%rsp), %rdi
callq 0x1db18
movl %r15d, %ebp
leaq 0x10(%rsp), %rdi
callq 0x1db28
testq %rbx, %rbx
je 0x1cbe6
movq 0x38(%rsp), %rdi
movq %rdi, 0x90(%rsp)
testq %rdi, %rdi
je 0x1cafc
movq (%rdi), %rax
callq *0x10(%rax)
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
leaq 0x90(%rsp), %r15
movq %r15, %rsi
callq 0x1d538
movq %r15, %rdi
callq 0x1d5ae
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x1d5be
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
sete %bl
je 0x1cba6
andl $0x0, 0x18(%rsp)
movq (%rdi), %rax
leaq 0x18(%rsp), %rsi
callq *0x28(%rax)
testl %eax, %eax
jne 0x1cba4
leaq 0xb0(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x1eb5a
movq %rax, %rdi
leaq 0x48(%rsp), %rsi
callq 0x1d708
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x1d622
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1cb88
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
andq $0x0, 0x18(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x1d6f8
jmp 0x1cb29
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
callq 0x1d6f8
leaq 0x10(%rsp), %rdi
callq 0x1d5ae
jmp 0x1cbe8
xorl %ebx, %ebx
pushq $0x2
popq %rbp
leaq 0x18(%rsp), %rdi
callq 0x1dca8
testb %bl, %bl
je 0x1cbd2
pushq $0x2
popq %rbp
leaq 0x8(%rsp), %rdi
callq 0x1dcb8
leaq 0x10(%rsp), %rdi
callq 0x1dcc8
xorl %ebx, %ebx
leaq 0x48(%rsp), %rdi
callq 0x1d74c
leaq 0x50(%rsp), %rdi
callq 0x1dcb8
leaq 0x38(%rsp), %rdi
callq 0x1d5ae
leaq 0x58(%rsp), %rdi
callq 0x1dcb8
leaq 0x70(%rsp), %rdi
callq 0x1dca8
movl %ebp, %r15d
leaq 0xba42d(%rip), %rbp     # 0xd7051
movq %r12, %rdi
callq 0x1dcb8
testb %bl, %bl
je 0x1cc70
movq %r12, %rdi
leaq 0x60(%rsp), %rsi
callq 0x1dcd8
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1cc4d
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x40(%rsp), %rax
movq %rax, 0x20(%rsp)
andq $0x0, 0x40(%rsp)
movq %r12, %rdi
callq 0x1ddae
jmp 0x1c876
pushq $0x5
popq %r15
jmp 0x1ccd1
leaq 0x20(%rsp), %rdi
callq 0x1ddae
testq %r13, %r13
jne 0x1cc96
addq $0x50, %r14
leaq 0xb0(%rsp), %rsi
movq %r14, %rdi
callq 0x25e60
xorl %r15d, %r15d
leaq 0xb0(%rsp), %rdi
callq 0x1e050
leaq 0x60(%rsp), %rdi
callq 0x1d5ae
movq 0x30(%rsp), %rbx
leaq 0x80(%rsp), %rdi
callq 0x1dcb8
leaq 0x68(%rsp), %rdi
callq 0x1ddbe
movq %rbx, %rdi
callq 0x19680
movl %r15d, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1cd8a
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x1dca8
jmp 0x1cd42
movq %rax, %r14
jmp 0x1cdd8
movq %rax, %r14
leaq 0x90(%rsp), %rdi
jmp 0x1cddd
movq %rax, %r14
leaq 0x98(%rsp), %rdi
callq 0x1dabe
jmp 0x1cd74
movq %rax, %r14
leaq 0xa0(%rsp), %rdi
callq 0x1d73c
jmp 0x1cd74
movq %rax, %r14
jmp 0x1cd7e
jmp 0x1cd3f
jmp 0x1cd8a
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x1dcb8
jmp 0x1cd63
movq %rax, %r14
leaq 0xa8(%rsp), %rdi
callq 0x1d73c
jmp 0x1cd63
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x1dcc8
jmp 0x1cde2
jmp 0x1cd8a
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x1db18
leaq 0x10(%rsp), %rdi
callq 0x1db28
jmp 0x1cde2
movq %rax, %r14
jmp 0x1cde2
jmp 0x1cdb9
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x1d6f8
jmp 0x1cdce
movq %rax, %r14
jmp 0x1ce5c
movq %rax, %r14
leaq 0x78(%rsp), %rdi
jmp 0x1ce6e
jmp 0x1cdc3
jmp 0x1cdcb
movq %rax, %r14
jmp 0x1ce00
movq %rbx, 0x30(%rsp)
movq %rax, %r14
jmp 0x1ce73
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x1d6f8
leaq 0x10(%rsp), %rdi
callq 0x1d5ae
leaq 0x48(%rsp), %rdi
callq 0x1d74c
leaq 0x50(%rsp), %rdi
callq 0x1dcb8
leaq 0x38(%rsp), %rdi
callq 0x1d5ae
leaq 0x58(%rsp), %rdi
callq 0x1dcb8
jmp 0x1ce0f
movq %rax, %r14
leaq 0x70(%rsp), %rdi
callq 0x1dca8
jmp 0x1ce48
jmp 0x1ce45
movq %rbx, 0x30(%rsp)
movq %rax, %r14
jmp 0x1ce80
movq %rbx, 0x30(%rsp)
movq %rax, %r14
jmp 0x1ce8a
movq %rax, %r14
leaq 0x40(%rsp), %rdi
callq 0x1ddae
jmp 0x1ce52
movq %rax, %r14
jmp 0x1ce52
movq %rax, %r14
leaq 0x40(%rsp), %rdi
callq 0x1dcb8
leaq 0x20(%rsp), %rdi
callq 0x1ddae
leaq 0xb0(%rsp), %rdi
callq 0x1e050
leaq 0x60(%rsp), %rdi
callq 0x1d5ae
leaq 0x80(%rsp), %rdi
callq 0x1dcb8
leaq 0x68(%rsp), %rdi
callq 0x1ddbe
movq %r14, %rdi
callq 0x28cb0
callq 0x28d20
pushq $0x2
popq %r15
movq 0x30(%rsp), %rbx
jmp 0x1ccc9
movq %rax, %r14
movq 0x30(%rsp), %rdi
callq 0x19680
movq %r14, %rdi
callq 0xd3bc0