// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::SegTimeoutThdEntry()
void DS_MultiVolume_Impl::SegTimeoutThdEntry() {
    __DEBUG("Segment Timeout thread start!!");
    std::unique_lock<std::mutex> lck_seg_map(segMapMtx_, std::defer_lock);

    while (!segTimeoutT_stop_) {
        for ( int i = 0; i < shardsNum_; i++) {
            std::mutex *mtx = segMtxVec_[i];
            std::unique_lock<std::mutex> l(*mtx);

            lck_seg_map.lock();
            SegForReq *seg = segMap_[i];
            lck_seg_map.unlock();

            if (seg->IsExpired()) {
                seg->Completion();

                segWteWQ_->Add_task(seg);
                int vol_id = pickVol();
                seg = new SegForReq(volMap_[vol_id], idxMgr_, options_.expired_time);

                lck_seg_map.lock();
                std::map<int, SegForReq*>::iterator iter = segMap_.find(i);
                segMap_.erase(iter);
                segMap_.insert( make_pair(i, seg) );
                lck_seg_map.unlock();
            }

        }

        usleep(options_.expired_time);
    } __DEBUG("Segment Timeout thread stop!!");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0x60(%rdi), %rax
leaq 0x38(%rsp), %r14
movq %rax, (%r14)
movb $0x0, 0x8(%r14)
leaq 0x88(%rdi), %r15
leaq 0x28(%rdi), %rax
movq %rax, 0x20(%rsp)
leaq 0x90(%rdi), %rbp
leaq 0x10(%rsp), %r13
movb 0x168(%rbx), %al
testb $0x1, %al
jne 0xcbae
movl $0x0, 0x8(%rsp)
cmpl $0x0, 0x58(%rbx)
jle 0xcb9d
xorl %eax, %eax
cltq
movq 0xb8(%rbx), %rcx
movq (%rcx,%rax,8), %rax
movq %rax, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movq %r13, %rdi
callq 0xe58e
movb $0x1, 0x18(%rsp)
movq %r14, %rdi
callq 0xe58e
movq %r15, %rdi
leaq 0x8(%rsp), %rsi
callq 0xe528
movq (%rax), %r12
movq %r14, %rdi
callq 0xe5ca
movq %r12, %rdi
callq 0x1c874
testb %al, %al
je 0xcb82
movq %r12, %rdi
callq 0x1c6fe
movq 0x158(%rbx), %rdi
movq %r12, %rsi
callq 0xe5f2
movq %rbx, %rdi
callq 0xc756
movl %eax, 0xc(%rsp)
movl $0xd8, %edi
callq 0x6410
movq %rax, %r12
movq 0x20(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0xe0a8
movq (%rax), %rsi
movq 0x8(%rbx), %rax
movq 0x20(%rbx), %rdx
movl 0x10(%rax), %ecx
movq %r12, %rdi
callq 0x1c58e
movq %r14, %rdi
callq 0xe58e
movq 0x98(%rbx), %rdx
movq %rbp, %rsi
testq %rdx, %rdx
je 0xcb58
movl 0x8(%rsp), %ecx
movq %rbp, %rax
xorl %esi, %esi
cmpl %ecx, 0x20(%rdx)
setl %sil
cmovgeq %rdx, %rax
movq 0x10(%rdx,%rsi,8), %rdx
testq %rdx, %rdx
jne 0xcb2f
movq %rbp, %rsi
cmpq %rbp, %rax
je 0xcb58
cmpl 0x20(%rax), %ecx
cmovlq %rbp, %rax
movq %rax, %rsi
movq %r15, %rdi
callq 0x10024
movl 0x8(%rsp), %eax
movl %eax, 0x28(%rsp)
movq %r12, 0x30(%rsp)
movq %r15, %rdi
leaq 0x28(%rsp), %rsi
callq 0xed58
movq %r14, %rdi
callq 0xe5ca
movq %r13, %rdi
callq 0xe10e
movl 0x8(%rsp), %eax
incl %eax
movl %eax, 0x8(%rsp)
cmpl 0x58(%rbx), %eax
jl 0xca68
movq 0x8(%rbx), %rax
movl 0x10(%rax), %edi
callq 0x6550
jmp 0xca46
leaq 0x38(%rsp), %rdi
callq 0xe10e
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xcbda
jmp 0xcbe3
movq %rax, %rbx
movq %r12, %rdi
callq 0x63f0
jmp 0xcbe6
jmp 0xcbe3
movq %rax, %rbx
jmp 0xcbf0
jmp 0xcbe3
jmp 0xcbe3
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xe10e
leaq 0x38(%rsp), %rdi
callq 0xe10e
movq %rbx, %rdi
callq 0x6670