// File: /workspace/github_cpp_makefile_star2_O1/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 0xca12
movl $0x0, 0x8(%rsp)
cmpl $0x0, 0x58(%rbx)
jle 0xca01
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 0xe40a
movb $0x1, 0x18(%rsp)
movq %r14, %rdi
callq 0xe40a
movq %r15, %rdi
leaq 0x8(%rsp), %rsi
callq 0xe3a6
movq (%rax), %r12
movq %r14, %rdi
callq 0xe446
movq %r12, %rdi
callq 0x1c852
testb %al, %al
je 0xc9e6
movq %r12, %rdi
callq 0x1c6dc
movq 0x158(%rbx), %rdi
movq %r12, %rsi
callq 0xe46e
movq %rbx, %rdi
callq 0xc5b6
movl %eax, 0xc(%rsp)
movl $0xd8, %edi
callq 0x6420
movq %rax, %r12
movq 0x20(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0xdf22
movq (%rax), %rsi
movq 0x8(%rbx), %rax
movq 0x20(%rbx), %rdx
movl 0x10(%rax), %ecx
movq %r12, %rdi
callq 0x1c56c
movq %r14, %rdi
callq 0xe40a
movq 0x98(%rbx), %rcx
movq %rbp, %rax
testq %rcx, %rcx
je 0xc9a6
movl 0x8(%rsp), %edx
movq %rbp, %rax
xorl %esi, %esi
cmpl %edx, 0x20(%rcx)
setl %sil
cmovgeq %rcx, %rax
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0xc98f
movq %rbp, %rsi
cmpq %rbp, %rax
je 0xc9bc
movl 0x8(%rsp), %ecx
cmpl 0x20(%rax), %ecx
cmovlq %rbp, %rax
movq %rax, %rsi
movq %r15, %rdi
callq 0xfe9e
movl 0x8(%rsp), %eax
movl %eax, 0x28(%rsp)
movq %r12, 0x30(%rsp)
movq %r15, %rdi
leaq 0x28(%rsp), %rsi
callq 0xebc0
movq %r14, %rdi
callq 0xe446
movq %r13, %rdi
callq 0xdf86
movl 0x8(%rsp), %eax
incl %eax
movl %eax, 0x8(%rsp)
cmpl 0x58(%rbx), %eax
jl 0xc8c8
movq 0x8(%rbx), %rax
movl 0x10(%rax), %edi
callq 0x6560
jmp 0xc8a6
leaq 0x38(%rsp), %rdi
callq 0xdf86
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xca3e
jmp 0xca47
movq %rax, %rbx
movq %r12, %rdi
callq 0x6400
jmp 0xca4a
jmp 0xca47
movq %rax, %rbx
jmp 0xca54
jmp 0xca47
jmp 0xca47
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xdf86
leaq 0x38(%rsp), %rdi
callq 0xdf86
movq %rbx, %rdi
callq 0x6680