// File: /workspace/github_cpp_makefile_star2_O3/cybozu[P]yrmcds/src/memcache/handler.cpp
// Function: yrmcds::memcache::handler::on_master_interval()
void handler::on_master_interval() {
    for( auto it = m_slaves.begin(); it != m_slaves.end(); ) {
        repl_socket* slave = *it;
        if( ! slave->valid() ) {
            it = m_slaves.erase(it);
            continue;
        }
        if( slave->timed_out() ) {
            cybozu::logger::info()
                << "No heartbeats from a slave ("
                << slave->peer_ip()
                << "). Close the replication socket.";
            // close the socket and release resources
            if( ! slave->invalidate() )
                m_reactor.remove_resource(*slave);
            it = m_slaves.erase(it);
            continue;
        }
        ++it;
    }

    if( gc_ready(g_current_time.load(relaxed)) ) {
        m_gc_thread = std::unique_ptr<gc_thread>(
            new gc_thread(m_hash, m_slaves, m_new_slaves));
        m_new_slaves.clear();
        m_gc_thread->start();
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq 0x78(%rdi), %r14
cmpq 0x80(%rdi), %r14
je 0x16510
leaq 0x30ab9(%rip), %r15     # 0x46e80
leaq 0x307f2(%rip), %rbp     # 0x46bc0
leaq 0x8(%rsp), %r12
movq (%r14), %r13
movb 0x10(%r13), %al
testb $0x1, %al
je 0x164d7
movq (%r15), %rax
movl 0x10c(%rbp), %ecx
addq 0x140(%r13), %rcx
cmpq %rax, %rcx
jle 0x16407
addq $0x8, %r14
movq 0x80(%rbx), %rdx
jmp 0x16507
leaq 0x3067a(%rip), %rax     # 0x46a88
movl (%rax), %eax
xorl %esi, %esi
cmpl $0x2, %eax
setge %sil
movq %r12, %rdi
leaq 0x1e63a(%rip), %rdx     # 0x34a5d
callq 0x96e6
cmpb $0x1, 0x8(%rsp)
jne 0x16445
movq 0x10(%rsp), %rdi
movl $0x1c, %edx
leaq 0x1eeed(%rip), %rsi     # 0x3532d
callq 0x7570
leaq 0x18(%rsp), %rdi
movq %r13, %rsi
callq 0x17142
movb 0x8(%rsp), %al
cmpb $0x1, %al
jne 0x16472
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0x7570
movb 0x8(%rsp), %al
testb $0x1, %al
je 0x1648c
movq 0x10(%rsp), %rdi
movl $0x20, %edx
leaq 0x1eec3(%rip), %rsi     # 0x3534a
callq 0x7570
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x164a8
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x7500
movq %r12, %rdi
callq 0x8f4e
movb $0x1, %al
xorl %ecx, %ecx
lock
cmpxchgb %cl, 0x10(%r13)
jne 0x164d7
movl 0x50(%r13), %esi
movq (%r13), %rax
movq %r13, %rdi
callq *0x10(%rax)
movq 0x28(%rbx), %rdi
movl 0x50(%r13), %esi
callq 0xa6fe
movq %r14, %rsi
addq $0x8, %rsi
movq 0x80(%rbx), %rdx
cmpq %rdx, %rsi
je 0x164fc
subq %rsi, %rdx
movq %r14, %rdi
callq 0x78d0
movq 0x80(%rbx), %rdx
addq $-0x8, %rdx
movq %rdx, 0x80(%rbx)
cmpq %rdx, %r14
jne 0x163d3
leaq 0x30969(%rip), %rax     # 0x46e80
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x15b14
testb %al, %al
je 0x16590
leaq 0x78(%rbx), %r15
movl $0xb0, %edi
callq 0x74f0
movq %rax, %r14
leaq 0x40(%rbx), %rsi
leaq 0x90(%rbx), %rcx
movq %rax, %rdi
movq %r15, %rdx
callq 0x171b6
leaq 0x68(%rbx), %r15
leaq 0x18(%rsp), %r12
movq $0x0, (%r12)
movq %r15, %rdi
movq %r14, %rsi
callq 0x179c6
movq %r12, %rdi
callq 0x1710e
movq 0x90(%rbx), %rax
cmpq %rax, 0x98(%rbx)
je 0x16588
movq %rax, 0x98(%rbx)
movq (%r15), %rdi
callq 0x1730c
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0xb0, %esi
movq %r14, %rdi
callq 0x7500
jmp 0x165e1
jmp 0x165d4
movq %rax, %rbx
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x165d7
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x7500
jmp 0x165d7
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x8f4e
movq %rbx, %rdi
callq 0x79a0
nop