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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x37410
leaq 0x78c9e(%rip), %rdi     # 0xafd00
callq 0x2c650
movq %rax, %rdi
callq 0x2c670
testb $0x1, %al
jne 0x37078
jmp 0x37164
movq -0xf8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x108(%rbp)
leaq 0x78c6f(%rip), %rdi     # 0xafd00
callq 0x39ce0
movw %ax, -0xfa(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x2c7b0
jmp 0x370ac
movw -0xfa(%rbp), %ax
movzwl %ax, %edx
xorl %r8d, %r8d
movl %r8d, %esi
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rcx
callq 0x2c6b0
jmp 0x370cb
leaq -0x38(%rbp), %rdi
movq %rdi, -0x110(%rbp)
leaq -0x40(%rbp), %rsi
callq 0x2c860
movq -0x108(%rbp), %rdi
movq -0x110(%rbp), %rsi
movl $0x1, %edx
callq 0xea00
jmp 0x370f9
leaq -0x38(%rbp), %rdi
callq 0x11290
leaq -0x40(%rbp), %rdi
callq 0x2c8b0
leaq -0x60(%rbp), %rdi
callq 0x2c910
jmp 0x373e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x373fa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x37156
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x11290
leaq -0x40(%rbp), %rdi
callq 0x2c8b0
leaq -0x60(%rbp), %rdi
callq 0x2c910
jmp 0x373fa
movq -0xf8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x130(%rbp)
leaq 0x78b83(%rip), %rdi     # 0xafd00
movq %rdi, -0x128(%rbp)
callq 0x22f30
movq -0x128(%rbp), %rdi
movq %rax, -0x120(%rbp)
callq 0x39ce0
movw %ax, -0x112(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x2c7b0
jmp 0x371b5
movq -0x120(%rbp), %rsi
movw -0x112(%rbp), %ax
movzwl %ax, %edx
leaq -0x80(%rbp), %rdi
leaq -0xa0(%rbp), %rcx
movl $0x1, %r8d
callq 0x2c930
jmp 0x371de
leaq -0x78(%rbp), %rdi
movq %rdi, -0x138(%rbp)
leaq -0x80(%rbp), %rsi
callq 0x2c860
movq -0x130(%rbp), %rdi
movq -0x138(%rbp), %rsi
movl $0x1, %edx
callq 0xea00
jmp 0x3720c
leaq -0x78(%rbp), %rdi
callq 0x11290
leaq -0x80(%rbp), %rdi
callq 0x2c8b0
leaq -0xa0(%rbp), %rdi
callq 0x2c910
leaq 0x78acf(%rip), %rdi     # 0xafd00
callq 0x2c650
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rdi
callq 0x2ca30
movq %rax, -0xb0(%rbp)
movq -0xa8(%rbp), %rdi
callq 0x2ca60
movq %rax, -0xb8(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x2ca90
testb $0x1, %al
jne 0x3727f
jmp 0x373e6
leaq -0xb0(%rbp), %rdi
callq 0x2cad0
movq %rax, %rcx
movq -0xf8(%rbp), %rax
movq %rcx, -0xc0(%rbp)
movq 0x28(%rax), %rax
movq %rax, -0x150(%rbp)
movq -0xc0(%rbp), %rax
movq %rax, -0x148(%rbp)
leaq 0x78a44(%rip), %rdi     # 0xafd00
callq 0x39ce0
movw %ax, -0x13a(%rbp)
leaq -0xf0(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x2c7b0
jmp 0x372da
movq -0x148(%rbp), %rsi
movw -0x13a(%rbp), %ax
movzwl %ax, %edx
leaq -0xd0(%rbp), %rdi
leaq -0xf0(%rbp), %rcx
xorl %r8d, %r8d
callq 0x2c930
jmp 0x37303
leaq -0xc8(%rbp), %rdi
movq %rdi, -0x158(%rbp)
leaq -0xd0(%rbp), %rsi
callq 0x2c860
movq -0x150(%rbp), %rdi
movq -0x158(%rbp), %rsi
movl $0x1, %edx
callq 0xea00
jmp 0x37337
leaq -0xc8(%rbp), %rdi
callq 0x11290
leaq -0xd0(%rbp), %rdi
callq 0x2c8b0
leaq -0xf0(%rbp), %rdi
callq 0x2c910
leaq -0xb0(%rbp), %rdi
callq 0x2caf0
jmp 0x37263
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x37398
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x11290
leaq -0x80(%rbp), %rdi
callq 0x2c8b0
leaq -0xa0(%rbp), %rdi
callq 0x2c910
jmp 0x373fa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x373d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x11290
leaq -0xd0(%rbp), %rdi
callq 0x2c8b0
leaq -0xf0(%rbp), %rdi
callq 0x2c910
jmp 0x373fa
jmp 0x373e8
leaq -0x28(%rbp), %rdi
callq 0x2c910
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x2c910
movq -0x68(%rbp), %rdi
callq 0x8bc0
nopl (%rax)