// File: /workspace/github_c_makefile_star2_O0/sszllzss[P]webSocket_Libevent_ThreadPool/evbase_threadpool.cpp
// Function: manager_thread(void*)
void *manager_thread(void *evbase_threadpool)
{
    evbase_threadpool_t *evb_thpool = (evbase_threadpool_t*)evbase_threadpool; 
    while(!evb_thpool->shutdown)
    {
        usleep(BASE_MANAGER_TIMER*1000);        
        pthread_mutex_lock(&evb_thpool->evbase_thread_list.lock);
        for(evbase_thread_vector::iterator i = evb_thpool->evbase_thread_list.list->begin();
            i != evb_thpool->evbase_thread_list.list->end(); )
        {
            pthread_mutex_lock(&(*i)->monitor_num_locl);    
            if((*i)->monitor_num == 0 && evb_thpool->evbase_thread_list.list->size() > 1){
                if(!event_base_loopbreak((*i)->base))
                {
                    event_base_dispatch((*i)->base);
                    pthread_mutex_destroy(&(*i)->monitor_num_locl);
                    evb_thpool->evbase_thread_list.list->erase(i);
                    free(*i);
                }
                else
                {
                    pthread_mutex_unlock(&(*i)->monitor_num_locl);    
                    i++;
                }
            }
            else
            {
                pthread_mutex_unlock(&(*i)->monitor_num_locl);    
                i++;
            }
        }
        pthread_mutex_unlock(&evb_thpool->evbase_thread_list.lock);
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x40(%rax)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xda7a
jmp 0xdbe5
leaq 0xfa3b(%rip), %rax      # 0x1d4bc
imull $0x3e8, (%rax), %edi    # imm = 0x3E8
callq 0x46d0
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x4720
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xe200
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xe270
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xe230
testb $0x1, %al
jne 0xdad1
jmp 0xdbd3
leaq -0x18(%rbp), %rdi
callq 0xe2a0
movq (%rax), %rdi
callq 0x4720
leaq -0x18(%rbp), %rdi
callq 0xe2a0
movq (%rax), %rax
cmpl $0x0, 0x30(%rax)
jne 0xdbae
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xe3c0
cmpq $0x1, %rax
jbe 0xdbae
leaq -0x18(%rbp), %rdi
callq 0xe2a0
movq (%rax), %rax
movq 0x28(%rax), %rdi
callq 0x4690
cmpl $0x0, %eax
jne 0xdb8c
leaq -0x18(%rbp), %rdi
callq 0xe2a0
movq (%rax), %rax
movq 0x28(%rax), %rdi
callq 0x4740
leaq -0x18(%rbp), %rdi
callq 0xe2a0
movq (%rax), %rdi
callq 0x45d0
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x48(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xe450
movq -0x48(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xe3e0
movq %rax, -0x30(%rbp)
leaq -0x18(%rbp), %rdi
callq 0xe2a0
movq (%rax), %rdi
callq 0x45f0
jmp 0xdbac
leaq -0x18(%rbp), %rdi
callq 0xe2a0
movq (%rax), %rdi
callq 0x4390
leaq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0xe2c0
movq %rax, -0x38(%rbp)
jmp 0xdbce
leaq -0x18(%rbp), %rdi
callq 0xe2a0
movq (%rax), %rdi
callq 0x4390
leaq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0xe2c0
movq %rax, -0x40(%rbp)
jmp 0xdaaa
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x4390
jmp 0xda64
xorl %eax, %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)