// File: /workspace/github_cpp_makefile_star2_O3/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 0x7c89c
leaq 0x20(%rdi), %rax
movq %rax, 0x8(%rsp)
leaq 0x30(%rsp), %r13
leaq 0x80(%rdi), %r15
leaq 0x48(%rdi), %r12
leaq 0x58(%rsp), %rbp
movq %rdi, (%rsp)
movl 0xbc(%rdi), %eax
testq %rax, %rax
je 0x7c6ab
movq %rax, 0x58(%rsp)
movq $0x0, 0x60(%rsp)
movq %rbp, %rdi
movq %rbp, %rsi
callq 0x78680
cmpl $-0x1, %eax
jne 0x7c6ab
callq 0x782a0
cmpl $0x4, (%rax)
je 0x7c691
movq (%rsp), %rax
cmpb $0x0, 0xb8(%rax)
je 0x7c89c
movq 0x8(%rsp), %rdi
callq 0x78d60
testl %eax, %eax
jne 0x7c84e
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), %r14
testq %r14, %r14
je 0x7c73b
movq 0x10(%r14), %rdi
addq $0x8, %rdi
callq 0x775d0
testl %eax, %eax
jne 0x7c71b
leaq 0x8(%r14), %rsi
leaq 0x28(%rsp), %rdi
callq 0x78a90
movq (%r14), %r14
jmp 0x7c6f7
movq %rax, %rbx
cmpl $0x2, %edx
jne 0x7c879
movq %rbx, %rdi
callq 0x76470
callq 0x78090
jmp 0x7c71b
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq (%rsp), %rax
movq 0x58(%rax), %r14
testq %r14, %r14
je 0x7c7cc
movq 0x38(%rsp), %r8
testq %r8, %r8
je 0x7c7c7
leaq 0x8(%r14), %rdx
movl 0xc(%r14), %eax
movq %r13, %r9
movq %r9, %rcx
movq %r8, %rsi
movl 0x20(%r8), %edi
xorl %r8d, %r8d
cmpl %eax, %edi
setb %r8b
movq %rsi, %r9
cmovbq %rcx, %r9
movq 0x10(%rsi,%r8,8), %r8
testq %r8, %r8
jne 0x7c76e
cmpq %r13, %r9
je 0x7c7c7
cmpl %eax, %edi
cmovbq %rcx, %rsi
cmpl 0x20(%rsi), %eax
jb 0x7c7c7
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x7c7bd
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x7c7c7
leaq 0x10(%rsp), %rdi
callq 0x768c0
movq (%r14), %r14
jmp 0x7c754
movq 0x40(%rsp), %r14
cmpq %r13, %r14
je 0x7c7f2
leaq 0x20(%r14), %rsi
movq %r15, %rdi
callq 0x77c50
movq %r14, %rdi
callq 0x78010
movq %rax, %r14
cmpq %r13, %rax
jne 0x7c7d6
movq 0x10(%rsp), %r14
movq 0x18(%rsp), %rbx
cmpq %rbx, %r14
je 0x7c81a
movq %r12, %rdi
movq %r14, %rsi
callq 0x786e0
addq $0x4, %r14
cmpq %rbx, %r14
jne 0x7c801
movq 0x10(%rsp), %r14
testq %r14, %r14
je 0x7c827
movq %r14, %rdi
callq 0x76e40
leaq 0x28(%rsp), %rdi
callq 0x76290
movq 0x8(%rsp), %rdi
callq 0x79140
movq (%rsp), %rdi
cmpb $0x0, 0xb8(%rdi)
jne 0x7c678
jmp 0x7c89c
movl %eax, %edi
callq 0x79120
jmp 0x7c8ab
movq %rax, %rbx
jmp 0x7c879
jmp 0x7c860
jmp 0x7c867
movq %rax, %rbx
jmp 0x7c88d
jmp 0x7c867
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x7c879
callq 0x76e40
leaq 0x28(%rsp), %rdi
callq 0x76290
movq 0x8(%rsp), %rdi
callq 0x79140
movq %rbx, %rdi
callq 0x76470
callq 0x78090
jmp 0x7c83b
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop