// File: /workspace/github_cpp_makefile_star2_O1/tdv[P]boss/boss/src/service_registry/service_registry.cpp
// Function: Boss::ServiceRegistry::Save(Boss::IOStream*)
RetCode BOSS_CALL ServiceRegistry::Save(IOStream *stream)
  {
    if (!stream)
      return Status::InvalidArgument;
    try
    {
      std::list<IServiceInfoPtr> ServiceInfoSet;
      {
        std::lock_guard<std::recursive_mutex> Lock(Mtx);
        for (auto const &service : Services)
        {
          bool Continue = false;
          for (auto Info : ServiceInfoSet)
          {
            if (Info.Get() == service.second.Get())
            {
              Continue = true;
              break;
            }
          }
          if (Continue)
            continue;
          ServiceInfoSet.push_back(service.second);
        }
      }
      auto ServiceEnum = Base<Enum>::Create();
      for (auto const &service : ServiceInfoSet)
      {
        RetCode Code = Status::Ok;
        auto ServiceItem = PropertyBagType::Create(ServiceTag);
        ServiceEnum->AddItem(ServiceItem);
        {
          ServiceId SrvId = 0;
          Code = service->GetServiceId(&SrvId);
          if (Code != Status::Ok)
            return Code;
          if ((Code = ServiceItem->SetProperty(ServiceIdTag, Base<EntityId>::Create(SrvId).Get())) != Status::Ok)
            return Code;
        }
        {
          RefObjPtr<IEnum> ClassIds;
          if ((service->GetClassIds(ClassIds.GetPPtr())) != Status::Ok)
            return Code;
          if ((Code = ServiceItem->SetProperty(ClassIdsTag, ClassIds.Get())) != Status::Ok)
            return Code;
        }
        {
          RefObjQIPtr<IRemoteServiceInfo> RemoteService(service);
          if (RemoteService.Get())
          {
            {
              ClassId SerializerId = 0;
              if ((Code = RemoteService->GetSerializerId(&SerializerId)) != Status::Ok ||
                  (Code = ServiceItem->SetProperty(SerializerIdTag, Base<EntityId>::Create(SerializerId).Get())) != Status::Ok)
              {
                return Code;
              }
            }
            {
              ClassId RemotingId = 0;
              if ((Code = RemoteService->GetRemotingId(&RemotingId)) != Status::Ok ||
                  (Code = ServiceItem->SetProperty(RemotingIdTag, Base<EntityId>::Create(RemotingId).Get())) != Status::Ok)
              {
                return Code;
              }
            }
            {
              ClassId TransportId = 0;
              if ((Code = RemoteService->GetTransportId(&TransportId)) != Status::Ok ||
                  (Code = ServiceItem->SetProperty(TransportIdTag, Base<EntityId>::Create(TransportId).Get())) != Status::Ok)
              {
                return Code;
              }
            }
            RefObjPtr<IPropertyBag> TransportProps;
            if ((Code = RemoteService->GetTransportProperties(TransportProps.GetPPtr())) != Status::Ok ||
                (Code = ServiceItem->SetProperty(TransportPropertiesTag, TransportProps.Get())) != Status::Ok)
            {
              return Code;
            }
            continue;
          }
        }
        {
          RefObjQIPtr<ILocalServiceInfo> LocalService(service);
          if (LocalService.Get())
          {
            RefObjPtr<IString> ModulePath;
            if ((Code = LocalService->GetModulePath(ModulePath.GetPPtr())) != Status::Ok ||
                (Code = ServiceItem->SetProperty(ModulePathTag, ModulePath.Get())) != Status::Ok)
            {
              return Code;
            }
            continue;
          }
        }
      }
      auto Registry = PropertyBagType::Create(RegistryTag);
      RetCode Code = Registry->SetProperty(ServicesTag, ServiceEnum.Get());
      if (Code != Status::Ok)
        return Code;
      RefObjQIPtr<ISerializable> Serializable(Registry);
      if (!Serializable.Get())
        return Status::Fail;
      if ((Code = Serializable->Save(stream)) != Status::Ok)
        return Code;
    }
    catch (std::exception const &)
    {
      return Status::Fail;
    }
    return Status::Ok;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
testq %rsi, %rsi
je 0x1fa5a
movq %rdi, %r14
movq %rsi, 0x48(%rsp)
leaq 0x50(%rsp), %r15
movq %r15, 0x8(%r15)
movq %r15, (%r15)
movq $0x0, 0x10(%r15)
addq $0x28, %rdi
movq %rdi, 0x18(%rsp)
callq 0x1b620
testl %eax, %eax
jne 0x1fb61
movq 0x60(%r14), %r12
testq %r12, %r12
je 0x1f601
xorl %r13d, %r13d
movq %r15, %rbx
movq (%rbx), %rbx
cmpq %r15, %rbx
je 0x1f5d8
movq 0x10(%rbx), %r14
testq %r14, %r14
je 0x1f5b0
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
movq 0x10(%r12), %rbp
cmpq %rbp, %r14
movzbl %r13b, %r13d
movl $0x1, %eax
cmovel %eax, %r13d
testq %r14, %r14
je 0x1f5d3
movq (%r14), %rax
movq %r14, %rdi
callq *0x18(%rax)
cmpq %rbp, %r14
jne 0x1f596
testb $0x1, %r13b
jne 0x1f5fb
leaq 0x10(%r12), %rsi
movq %r15, %rdi
callq 0x29860
movq %rax, %rdi
movq %r15, %rsi
callq 0x2fa20
incq 0x60(%rsp)
movq (%r12), %r12
jmp 0x1f58b
movq 0x18(%rsp), %rdi
callq 0x1b680
leaq 0x28(%rsp), %rdi
callq 0x205f6
leaq 0x50(%rsp), %rax
movq (%rax), %rbx
movl $0x6, 0x18(%rsp)
cmpq %rax, %rbx
je 0x1fa6a
leaq 0x10(%rsp), %rdi
leaq 0xbaa0f(%rip), %rsi     # 0xda049
callq 0x20660
movq 0x28(%rsp), %r15
movq 0x10(%rsp), %rdi
movq %rdi, 0x20(%rsp)
testq %rdi, %rdi
je 0x1f659
movq (%rdi), %rax
callq *0x18(%rax)
movq %r15, %rdi
leaq 0x20(%rsp), %rsi
callq 0x206ce
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1f676
movq (%rdi), %rax
callq *0x20(%rax)
movq $0x0, 0x20(%rsp)
movl $0x0, 0x8(%rsp)
movq 0x10(%rbx), %rdi
movq (%rdi), %rax
leaq 0x8(%rsp), %rsi
callq *0x28(%rax)
movl %eax, %ebp
testl %eax, %eax
je 0x1f6a4
xorl %r13d, %r13d
movl %ebp, %r14d
jmp 0x1f6fa
movq 0x10(%rsp), %r15
movq %rsp, %rdi
leaq 0x8(%rsp), %rsi
callq 0x20766
movq (%rsp), %rax
leaq 0x8(%rax), %rdx
testq %rax, %rax
cmoveq %rax, %rdx
movq (%r15), %rax
movq %r15, %rdi
leaq 0xba97f(%rip), %rsi     # 0xda051
callq *0x38(%rax)
movl %eax, %r15d
testl %eax, %eax
sete %r13b
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1f6ed
movq (%rdi), %rax
callq *0x20(%rax)
testl %r15d, %r15d
movl %r14d, %ebp
cmovnel %r15d, %ebp
movl %r15d, %r14d
movl $0x1, %r12d
testb %r13b, %r13b
je 0x1f723
movq $0x0, (%rsp)
movq 0x10(%rbx), %rdi
movq (%rdi), %rax
movq %rsp, %rsi
callq *0x30(%rax)
testl %eax, %eax
je 0x1f72b
xorl %r15d, %r15d
jmp 0x1f74d
movl %ebp, %r14d
jmp 0x1fa32
movq 0x10(%rsp), %rdi
movq (%rsp), %rdx
movq (%rdi), %rax
leaq 0xba91d(%rip), %rsi     # 0xda05b
callq *0x38(%rax)
testl %eax, %eax
sete %r15b
cmovnel %eax, %ebp
movl %ebp, %r14d
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1f75c
movq (%rdi), %rax
callq *0x18(%rax)
testb %r15b, %r15b
je 0x1fa32
movq $0x0, (%rsp)
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x1f784
movq (%rdi), %rax
movl $0x5d155638, %esi       # imm = 0x5D155638
movq %rsp, %rdx
callq *0x20(%rax)
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1f7ae
movl $0x0, 0x8(%rsp)
movq (%rdi), %rax
leaq 0x8(%rsp), %rsi
callq *0x38(%rax)
movl %eax, %ebp
testl %eax, %eax
je 0x1f7b6
movb $0x1, %r13b
movl %ebp, %r15d
jmp 0x1f7f3
xorl %r12d, %r12d
jmp 0x1f97f
movq 0x10(%rsp), %r15
leaq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x20766
movq 0x40(%rsp), %rax
leaq 0x8(%rax), %rdx
testq %rax, %rax
cmoveq %rax, %rdx
movq (%r15), %rax
movq %r15, %rdi
leaq 0xba87d(%rip), %rsi     # 0xda064
callq *0x38(%rax)
movl %eax, %r15d
testl %eax, %eax
setne %r13b
testl %ebp, %ebp
jne 0x1f807
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1f807
movq (%rdi), %rax
callq *0x20(%rax)
movl $0x1, %r12d
testb %r13b, %r13b
cmovnel %r15d, %r14d
jne 0x1f97f
movl $0x0, 0x8(%rsp)
movq (%rsp), %rdi
movq (%rdi), %rax
leaq 0x8(%rsp), %rsi
callq *0x40(%rax)
movl %eax, %ebp
testl %eax, %eax
je 0x1f83f
movb $0x1, %r13b
movl %ebp, %r15d
jmp 0x1f87c
movq 0x10(%rsp), %r15
leaq 0x38(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x20766
movq 0x38(%rsp), %rax
leaq 0x8(%rax), %rdx
testq %rax, %rax
cmoveq %rax, %rdx
movq (%r15), %rax
movq %r15, %rdi
leaq 0xba801(%rip), %rsi     # 0xda071
callq *0x38(%rax)
movl %eax, %r15d
testl %eax, %eax
setne %r13b
testl %ebp, %ebp
jne 0x1f890
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x1f890
movq (%rdi), %rax
callq *0x20(%rax)
testb %r13b, %r13b
cmovnel %r15d, %r14d
jne 0x1f97f
movl $0x0, 0x8(%rsp)
movq (%rsp), %rdi
movq (%rdi), %rax
leaq 0x8(%rsp), %rsi
callq *0x48(%rax)
movl %eax, %ebp
testl %eax, %eax
je 0x1f8c2
movb $0x1, %r13b
movl %ebp, %r15d
jmp 0x1f8ff
movq 0x10(%rsp), %r15
leaq 0x30(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x20766
movq 0x30(%rsp), %rax
leaq 0x8(%rax), %rdx
testq %rax, %rax
cmoveq %rax, %rdx
movq (%r15), %rax
movq %r15, %rdi
leaq 0xba789(%rip), %rsi     # 0xda07c
callq *0x38(%rax)
movl %eax, %r15d
testl %eax, %eax
setne %r13b
testl %ebp, %ebp
jne 0x1f913
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1f913
movq (%rdi), %rax
callq *0x20(%rax)
testb %r13b, %r13b
cmovnel %r15d, %r14d
jne 0x1f97f
movq $0x0, 0x8(%rsp)
movq (%rsp), %rdi
movq (%rdi), %rax
leaq 0x8(%rsp), %rsi
callq *0x50(%rax)
testl %eax, %eax
je 0x1f943
movl $0x1, %r12d
movl %eax, %r14d
jmp 0x1f96f
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rdx
movq (%rdi), %rax
leaq 0xba739(%rip), %rsi     # 0xda090
callq *0x38(%rax)
testl %eax, %eax
movl $0x1, %r12d
movl $0x7, %ecx
cmovel %ecx, %r12d
cmovnel %eax, %r14d
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1f97f
movq (%rdi), %rax
callq *0x18(%rax)
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1f98e
movq (%rdi), %rax
callq *0x18(%rax)
testl %r12d, %r12d
jne 0x1fa32
movq $0x0, (%rsp)
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x1f9b6
movq (%rdi), %rax
movl $0xd893276e, %esi       # imm = 0xD893276E
movq %rsp, %rdx
callq *0x20(%rax)
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1f9e2
movq $0x0, 0x8(%rsp)
movq (%rdi), %rax
leaq 0x8(%rsp), %rsi
callq *0x38(%rax)
testl %eax, %eax
je 0x1f9e7
movl $0x1, %r12d
movl %eax, %r14d
jmp 0x1fa13
xorl %r12d, %r12d
jmp 0x1fa23
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rdx
movq (%rdi), %rax
leaq 0xba6a9(%rip), %rsi     # 0xda0a4
callq *0x38(%rax)
testl %eax, %eax
movl $0x1, %r12d
movl $0x7, %ecx
cmovel %ecx, %r12d
cmovnel %eax, %r14d
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1fa23
movq (%rdi), %rax
callq *0x18(%rax)
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1fa32
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1fa42
movq (%rdi), %rax
callq *0x20(%rax)
cmpl $0x7, %r12d
je 0x1fa4d
testl %r12d, %r12d
jne 0x1fa65
movq (%rbx), %rbx
leaq 0x50(%rsp), %rax
jmp 0x1f625
movl $0x5, %r14d
jmp 0x1fb4f
movl %r12d, 0x18(%rsp)
cmpl $0x6, 0x18(%rsp)
jne 0x1fb2b
leaq 0xba5c4(%rip), %rsi     # 0xda040
leaq 0x10(%rsp), %rdi
callq 0x20038
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rax
leaq 0x8(%rax), %rdx
testq %rax, %rax
cmoveq %rax, %rdx
movq (%rdi), %rax
leaq 0xba60a(%rip), %rsi     # 0xda0af
callq *0x38(%rax)
testl %eax, %eax
je 0x1fab9
movl $0x1, 0x18(%rsp)
movl %eax, %r14d
jmp 0x1fb1b
movq $0x0, (%rsp)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1fad9
movq (%rdi), %rax
movq %rsp, %rdx
movl $0x28c07f90, %esi       # imm = 0x28C07F90
callq *0x28(%rax)
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1fafe
movq (%rdi), %rax
movq 0x48(%rsp), %rsi
callq *0x30(%rax)
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
movl %ecx, 0x18(%rsp)
cmovnel %eax, %r14d
jmp 0x1fb0c
movl $0x2, %r14d
movl $0x1, 0x18(%rsp)
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1fb1b
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1fb2b
movq (%rdi), %rax
callq *0x20(%rax)
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x1fb3b
movq (%rdi), %rax
callq *0x20(%rax)
leaq 0x50(%rsp), %rdi
callq 0x208ee
movl 0x18(%rsp), %eax
testl %eax, %eax
cmovel %eax, %r14d
movl %r14d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x1d32d
jmp 0x1fdbf
movq %rdx, %rbx
movq %rax, %r14
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1fb82
movq (%rdi), %rax
callq *0x18(%rax)
movq $0x0, (%rsp)
jmp 0x1fc3d
jmp 0x1fdbf
jmp 0x1fc37
jmp 0x1fdbf
jmp 0x1fdbf
movq %rdx, %rbx
movq %rax, %r14
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1fbb9
movq (%rdi), %rax
callq *0x20(%rax)
movq $0x0, 0x30(%rsp)
jmp 0x1fce4
jmp 0x1fdbf
jmp 0x1fcde
jmp 0x1fdbf
jmp 0x1fdbf
movq %rdx, %rbx
movq %rax, %r14
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1fce4
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x1fce4
jmp 0x1fdbf
movq %rdx, %rbx
movq %rax, %r14
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x1fc15
movq (%rdi), %rax
callq *0x20(%rax)
movq $0x0, 0x38(%rsp)
jmp 0x1fce4
jmp 0x1fdbf
jmp 0x1fcde
jmp 0x1fdbf
jmp 0x1fdbf
movq %rdx, %rbx
movq %rax, %r14
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1fd97
movq (%rdi), %rax
callq *0x20(%rax)
jmp 0x1fd97
jmp 0x1fdbf
jmp 0x1fd56
jmp 0x1fcde
jmp 0x1fdbf
jmp 0x1fdbf
jmp 0x1fd81
movq %rdx, %rbx
movq %rax, %r14
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1fc87
movq (%rdi), %rax
callq *0x20(%rax)
movq $0x0, 0x40(%rsp)
jmp 0x1fce4
jmp 0x1fdbf
jmp 0x1fcde
jmp 0x1fc9b
movq %rdx, %rbx
movq %rax, %r14
jmp 0x1fdd7
jmp 0x1fcde
movq %rdx, %rbx
movq %rax, %r14
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1fcbe
movq (%rdi), %rax
callq *0x18(%rax)
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1fd1e
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x1fd1e
jmp 0x1fdbf
jmp 0x1fdbf
jmp 0x1fdbf
movq %rdx, %rbx
movq %rax, %r14
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1fd1e
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x1fd1e
jmp 0x1fdbf
jmp 0x1fd81
jmp 0x1fdbf
jmp 0x1fdbf
movq %rdx, %rbx
movq %rax, %r14
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1fd1e
movq (%rdi), %rax
callq *0x20(%rax)
movq $0x0, (%rsp)
jmp 0x1fd87
jmp 0x1fdbf
jmp 0x1fd81
jmp 0x1fdbf
jmp 0x1fd81
jmp 0x1fdbf
movq %rdx, %rbx
movq %rax, %r14
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1fd87
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x1fd87
jmp 0x1fdbf
jmp 0x1fdc7
movq %rdx, %rbx
movq %rax, %r14
jmp 0x1fda0
movq %rdx, %rbx
movq %rax, %r14
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1fd74
movq (%rdi), %rax
callq *0x20(%rax)
movq $0x0, 0x20(%rsp)
jmp 0x1fd87
jmp 0x1fdbf
movq %rdx, %rbx
movq %rax, %r14
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1fd97
movq (%rdi), %rax
callq *0x20(%rax)
movq $0x0, 0x10(%rsp)
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x1fdb0
movq (%rdi), %rax
callq *0x20(%rax)
movq $0x0, 0x28(%rsp)
jmp 0x1fdd7
jmp 0x1fdbf
jmp 0x1fdbf
movq %rax, %rdi
callq 0x2087b
movq %rdx, %rbx
movq %rax, %r14
movq 0x18(%rsp), %rdi
callq 0x1b680
leaq 0x50(%rsp), %rdi
callq 0x208ee
movq %r14, %rdi
cmpl $0x1, %ebx
jne 0x1fdfe
callq 0x2ccc0
callq 0x2cd30
movl $0x2, %r14d
jmp 0x1fb4f
callq 0xd7070
nop