// File: /workspace/github_cpp_makefile_star2_O2/tdv[P]boss/boss/src/class_factory/class_factory.cpp
// Function: Boss::ClassFactory::Clean()
void ClassFactory::Clean()
  {
    while (IsRunCleaner)
    {
      try
      {
        std::this_thread::sleep_for(std::chrono::seconds(CleanerTimeout));
        if (!IsRunCleaner)
          break;
        
        std::lock_guard<std::recursive_mutex> Lock(Mtx);
        std::set<ServiceId> ServicesForUnload;
        for (auto const & i : Modules)
        {
          try
          {
            if (!i.second->GetModule().GetRefCount())
              ServicesForUnload.insert(i.first);
          }
          catch (std::exception const &)
          {
            // TODO :
          }
        }
        std::vector<ClassId> ClassIdsForDelete;
        for (auto const &i : Services)
        {
          if (ServicesForUnload.find(i.second) != std::end(ServicesForUnload))
            ClassIdsForDelete.push_back(i.first);
        }
        for (auto const &i : ServicesForUnload)
          Modules.erase(i);
        for (auto const &i : ClassIdsForDelete)
          Services.erase(i);
      }
      catch (...)
      {
      }
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
leaq 0x20(%rdi), %rax
movq %rax, 0x8(%rsp)
leaq 0x50(%rsp), %rbx
leaq 0x80(%rdi), %r15
leaq 0x90(%rdi), %rax
movq %rax, 0x38(%rsp)
leaq 0x48(%rdi), %r12
movq %rdi, 0x40(%rsp)
leaq 0x58(%rdi), %rax
movq %rax, 0x30(%rsp)
leaq 0x48(%rsp), %r13
movq 0x40(%rsp), %r14
movb 0xb8(%r14), %al
cmpb $0x1, %al
jne 0x7fbbd
movl 0xbc(%r14), %eax
movq %rax, 0x48(%rsp)
movq %r13, %rdi
callq 0x7a3c0
cmpb $0x0, 0xb8(%r14)
je 0x7fbbd
movq 0x8(%rsp), %rdi
callq 0x7b4a0
andl $0x0, 0x50(%rsp)
andq $0x0, 0x58(%rsp)
movq %rbx, 0x60(%rsp)
movq %rbx, 0x68(%rsp)
andq $0x0, 0x70(%rsp)
movq 0x38(%rsp), %r14
movq (%r14), %r14
testq %r14, %r14
je 0x7fada
movq 0x10(%r14), %rdi
addq $0x8, %rdi
callq 0x7a830
testl %eax, %eax
jne 0x7fa98
leaq 0x8(%r14), %rsi
movq %r13, %rdi
callq 0x7bf60
jmp 0x7fa98
movq %rax, %rbp
cmpl $0x2, %edx
jne 0x7fb99
movq %rbp, %rdi
callq 0x79500
callq 0x7b420
jmp 0x7fa98
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
movq 0x30(%rsp), %r14
movq (%r14), %r14
testq %r14, %r14
je 0x7fb16
leaq 0xc(%r14), %rsi
movq %r13, %rdi
callq 0x7b930
cmpq %rbx, %rax
je 0x7faed
leaq 0x8(%r14), %rsi
leaq 0x10(%rsp), %rdi
callq 0x7ab20
jmp 0x7faed
movq 0x60(%rsp), %r14
cmpq %rbx, %r14
je 0x7fb39
leaq 0x20(%r14), %rsi
movq %r15, %rdi
callq 0x7af50
movq %r14, %rdi
callq 0x7b3a0
movq %rax, %r14
jmp 0x7fb1b
movq 0x10(%rsp), %r14
movq 0x18(%rsp), %rbp
cmpq %rbp, %r14
je 0x7fb59
movq %r12, %rdi
movq %r14, %rsi
callq 0x7bb20
addq $0x4, %r14
jmp 0x7fb43
leaq 0x10(%rsp), %rdi
callq 0x7ad40
movq %r13, %rdi
callq 0x792e0
movq 0x8(%rsp), %rdi
callq 0x7c6c0
jmp 0x7fa38
movq %rax, %rbp
jmp 0x7fb99
jmp 0x7fb81
movq %rax, %rbp
jmp 0x7fbab
jmp 0x7fb8c
jmp 0x7fb8c
jmp 0x7fb8c
movq %rax, %rbp
leaq 0x10(%rsp), %rdi
callq 0x7ad40
movq %r13, %rdi
callq 0x792e0
movq 0x8(%rsp), %rdi
callq 0x7c6c0
movq %rbp, %rdi
callq 0x79500
callq 0x7b420
jmp 0x7fa38
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq