// File: /workspace/github_cpp_makefile_star2_O1/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 $0x68, %rsp
movb 0xb8(%rdi), %al
cmpb $0x1, %al
jne 0x7d979
leaq 0x20(%rdi), %rax
movq %rax, 0x8(%rsp)
leaq 0x30(%rsp), %r13
leaq 0x80(%rdi), %r15
leaq 0x48(%rdi), %r12
leaq 0x58(%rsp), %r14
movq %rdi, (%rsp)
movl 0xbc(%rdi), %eax
testq %rax, %rax
je 0x7d78d
movq %rax, 0x58(%rsp)
movq $0x0, 0x60(%rsp)
movq %r14, %rdi
movq %r14, %rsi
callq 0x79680
cmpl $-0x1, %eax
jne 0x7d78d
callq 0x792a0
cmpl $0x4, (%rax)
je 0x7d773
movq (%rsp), %rax
cmpb $0x0, 0xb8(%rax)
je 0x7d979
movq 0x8(%rsp), %rdi
callq 0x79d60
testl %eax, %eax
jne 0x7d92b
movl $0x0, 0x30(%rsp)
xorl %eax, %eax
movq %rax, 0x38(%rsp)
movq %r13, 0x40(%rsp)
movq %r13, 0x48(%rsp)
movq %rax, 0x50(%rsp)
movq (%rsp), %rax
movq 0x90(%rax), %rbp
testq %rbp, %rbp
je 0x7d81e
movq 0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x785c0
testl %eax, %eax
jne 0x7d7fd
leaq 0x8(%rbp), %rsi
leaq 0x28(%rsp), %rdi
callq 0x79a90
movq (%rbp), %rbp
jmp 0x7d7d9
movq %rax, %rbx
cmpl $0x2, %edx
jne 0x7d956
movq %rbx, %rdi
callq 0x77460
callq 0x79080
jmp 0x7d7fd
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq (%rsp), %rax
movq 0x58(%rax), %rbp
testq %rbp, %rbp
je 0x7d8af
movq 0x38(%rsp), %rcx
movq %r13, %rax
testq %rcx, %rcx
je 0x7d866
movl 0xc(%rbp), %edx
movq %r13, %rax
xorl %esi, %esi
cmpl %edx, 0x20(%rcx)
setb %sil
cmovaeq %rcx, %rax
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0x7d84f
movq %r13, %rcx
cmpq %r13, %rax
je 0x7d87b
movl 0xc(%rbp), %ecx
cmpl 0x20(%rax), %ecx
cmovbq %r13, %rax
movq %rax, %rcx
cmpq %r13, %rcx
je 0x7d8a9
leaq 0x8(%rbp), %rdx
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x7d89f
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x7d8a9
leaq 0x10(%rsp), %rdi
callq 0x778b0
movq (%rbp), %rbp
jmp 0x7d837
movq 0x40(%rsp), %rbp
cmpq %r13, %rbp
je 0x7d8d5
leaq 0x20(%rbp), %rsi
movq %r15, %rdi
callq 0x78c30
movq %rbp, %rdi
callq 0x79000
movq %rax, %rbp
cmpq %r13, %rax
jne 0x7d8b9
movq 0x10(%rsp), %rbp
movq 0x18(%rsp), %rbx
cmpq %rbx, %rbp
je 0x7d8f5
movq %r12, %rdi
movq %rbp, %rsi
callq 0x796e0
addq $0x4, %rbp
jmp 0x7d8df
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x7d904
callq 0x77e30
leaq 0x28(%rsp), %rdi
callq 0x77280
movq 0x8(%rsp), %rdi
callq 0x7a140
movq (%rsp), %rdi
cmpb $0x0, 0xb8(%rdi)
jne 0x7d75a
jmp 0x7d979
movl %eax, %edi
callq 0x7a120
jmp 0x7d988
movq %rax, %rbx
jmp 0x7d956
jmp 0x7d93d
jmp 0x7d944
movq %rax, %rbx
jmp 0x7d96a
jmp 0x7d944
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x7d956
callq 0x77e30
leaq 0x28(%rsp), %rdi
callq 0x77280
movq 0x8(%rsp), %rdi
callq 0x7a140
movq %rbx, %rdi
callq 0x77460
callq 0x79080
jmp 0x7d918
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq