// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/memcache/handler.cpp
// Function: yrmcds::memcache::handler::on_master_start()
void handler::on_master_start() {
    m_is_slave = false;
    cybozu::tcp_server_socket::wrapper w =
        [this](int s, const cybozu::ip_address&) {
        return make_repl_socket(s);
    };
    if( g_config.bind_ip().empty() ) {
        m_reactor.add_resource(
            make_server_socket(nullptr, g_config.repl_port(), w),
            cybozu::reactor::EVENT_IN);
    } else {
        m_reactor.add_resource(
            make_server_socket(g_config.vip(), g_config.repl_port(), w, true),
            cybozu::reactor::EVENT_IN);
        for( auto& s: g_config.bind_ip() ) {
            m_reactor.add_resource(
                make_server_socket(s, g_config.repl_port(), w),
                cybozu::reactor::EVENT_IN);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movb $0x0, 0x38(%rdi)
andq $0x0, 0x30(%rsp)
movq %rdi, 0x28(%rsp)
leaq 0xba5(%rip), %rax       # 0x14e2a
movq %rax, 0x40(%rsp)
leaq 0xbad(%rip), %rax       # 0x14e3e
movq %rax, 0x38(%rsp)
leaq 0x27923(%rip), %rax     # 0x3bbc0
movq 0x28(%rax), %rcx
movq 0x28(%rdi), %r15
cmpq 0x30(%rax), %rcx
je 0x143ea
movq %rdi, %rbx
movzwl 0x22(%rax), %ebp
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x117ae
movzwl %bp, %edx
leaq 0x278f1(%rip), %rsi     # 0x3bbc0
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rcx
pushq $0x1
popq %r8
callq 0x117f4
movq 0x8(%rsp), %rax
andq $0x0, 0x8(%rsp)
leaq 0x18(%rsp), %rsi
movq %rax, (%rsi)
pushq $0x1
popq %rdx
movq %r15, %rdi
callq 0x98ce
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x14310
movq (%rdi), %rax
callq *0x8(%rax)
andq $0x0, 0x18(%rsp)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x14326
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x8(%rsp), %rax
andq $0x0, (%rax)
leaq 0x48(%rsp), %rdi
callq 0x8d90
leaq 0x27880(%rip), %rax     # 0x3bbc0
movq 0x28(%rax), %r12
movq 0x30(%rax), %r14
leaq 0x88(%rsp), %r13
cmpq %r14, %r12
je 0x14468
movq 0x28(%rbx), %rbp
leaq 0x2785c(%rip), %rax     # 0x3bbc0
movzwl 0x22(%rax), %r15d
movq %r13, %rdi
leaq 0x28(%rsp), %rsi
callq 0x117ae
movzwl %r15w, %edx
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rcx
xorl %r8d, %r8d
callq 0x117f4
movq 0x8(%rsp), %rax
andq $0x0, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movq %rbp, %rdi
leaq 0x10(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x98ce
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x143bd
movq (%rdi), %rax
callq *0x8(%rax)
andq $0x0, 0x10(%rsp)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x143d3
movq (%rdi), %rax
callq *0x8(%rax)
andq $0x0, 0x8(%rsp)
movq %r13, %rdi
callq 0x8d90
addq $0x20, %r12
jmp 0x14350
movzwl 0x22(%rax), %ebx
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x117ae
movzwl %bx, %edx
leaq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %rcx
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x1171d
movq 0x8(%rsp), %rax
andq $0x0, 0x8(%rsp)
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
pushq $0x1
popq %rdx
movq %r15, %rdi
callq 0x98ce
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x14442
movq (%rdi), %rax
callq *0x8(%rax)
andq $0x0, 0x20(%rsp)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x14458
movq (%rdi), %rax
callq *0x8(%rax)
andq $0x0, 0x8(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x8d90
leaq 0x28(%rsp), %rdi
callq 0x8d90
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x14497
movq (%rdi), %rax
callq *0x8(%rax)
andq $0x0, 0x20(%rsp)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x144ad
movq (%rdi), %rax
callq *0x8(%rax)
andq $0x0, 0x8(%rsp)
jmp 0x144b8
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
jmp 0x14542
jmp 0x14501
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x144d7
movq (%rdi), %rax
callq *0x8(%rax)
andq $0x0, 0x18(%rsp)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x144ed
movq (%rdi), %rax
callq *0x8(%rax)
andq $0x0, 0x8(%rsp)
jmp 0x144f8
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
jmp 0x14542
jmp 0x14501
movq %rax, %rbx
jmp 0x14547
movq %rax, %rbx
jmp 0x1453a
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1451e
movq (%rdi), %rax
callq *0x8(%rax)
andq $0x0, 0x10(%rsp)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x14534
movq (%rdi), %rax
callq *0x8(%rax)
andq $0x0, 0x8(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x8d90
leaq 0x28(%rsp), %rdi
callq 0x8d90
movq %rbx, %rdi
callq 0x7990
nop