// File: /workspace/github_cpp_makefile_star2_O1/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 0x165f9
leaq 0x309c1(%rip), %r15     # 0x46e80
leaq 0x306fa(%rip), %rbp     # 0x46bc0
leaq 0x8(%rsp), %r12
movq (%r14), %r13
movb 0x10(%r13), %al
testb $0x1, %al
je 0x165c6
movq (%r15), %rax
movl 0x10c(%rbp), %ecx
addq 0x140(%r13), %rcx
cmpq %rax, %rcx
jle 0x164f8
addq $0x8, %r14
jmp 0x165ec
leaq 0x30599(%rip), %rax     # 0x46a98
movl (%rax), %eax
xorl %esi, %esi
cmpl $0x2, %eax
setge %sil
movq %r12, %rdi
leaq 0x1e505(%rip), %rdx     # 0x34a19
callq 0x9718
cmpb $0x1, 0x8(%rsp)
jne 0x16536
movq 0x10(%rsp), %rdi
movl $0x1c, %edx
leaq 0x1edb8(%rip), %rsi     # 0x352e9
callq 0x7580
leaq 0x18(%rsp), %rdi
movq %r13, %rsi
callq 0x17212
cmpb $0x1, 0x8(%rsp)
jne 0x1655e
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0x7580
cmpb $0x1, 0x8(%rsp)
jne 0x1657b
movq 0x10(%rsp), %rdi
movl $0x20, %edx
leaq 0x1ed90(%rip), %rsi     # 0x35306
callq 0x7580
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x16597
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x7510
movq %r12, %rdi
callq 0x8f94
movb $0x1, %al
xorl %ecx, %ecx
lock
cmpxchgb %cl, 0x10(%r13)
jne 0x165c6
movl 0x50(%r13), %esi
movq (%r13), %rax
movq %r13, %rdi
callq *0x10(%rax)
movq 0x28(%rbx), %rdi
movl 0x50(%r13), %esi
callq 0xa718
movq %r14, %rsi
addq $0x8, %rsi
movq 0x80(%rbx), %rdx
cmpq %rdx, %rsi
je 0x165e4
subq %rsi, %rdx
movq %r14, %rdi
callq 0x78e0
addq $-0x8, 0x80(%rbx)
cmpq 0x80(%rbx), %r14
jne 0x164cb
leaq 0x30880(%rip), %rax     # 0x46e80
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x15bdc
testb %al, %al
je 0x16679
leaq 0x78(%rbx), %r15
movl $0xb0, %edi
callq 0x7500
movq %rax, %r14
leaq 0x40(%rbx), %rsi
leaq 0x90(%rbx), %rcx
movq %rax, %rdi
movq %r15, %rdx
callq 0x17286
leaq 0x68(%rbx), %r15
leaq 0x18(%rsp), %r12
movq $0x0, (%r12)
movq %r15, %rdi
movq %r14, %rsi
callq 0x17a7c
movq %r12, %rdi
callq 0x171de
movq 0x90(%rbx), %rax
cmpq %rax, 0x98(%rbx)
je 0x16671
movq %rax, 0x98(%rbx)
movq (%r15), %rdi
callq 0x173dc
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 0x7510
jmp 0x166ca
jmp 0x166bd
movq %rax, %rbx
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x166c0
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x7510
jmp 0x166c0
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x8f94
movq %rbx, %rdi
callq 0x79b0