// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/memcache/handler.cpp
// Function: yrmcds::memcache::handler::make_repl_socket(int)
std::unique_ptr<cybozu::tcp_socket> handler::make_repl_socket(int s) {
    if( m_slaves.size() == MAX_SLAVES )
        return nullptr;
    std::unique_ptr<repl_socket> t(
        new repl_socket(s, g_config.repl_bufsize(), m_finder) );
    repl_socket* pt = t.get();
    m_slaves.push_back(pt);
    m_syncer.add_request(
        std::unique_ptr<sync_request>(
            new sync_request([this,pt]{ m_new_slaves.push_back(pt); })
            ));

    std::string addr = "unknown address";
    try {
        addr = cybozu::get_peer_ip_address(s).str();
    } catch (...) {
        // ignore errors
    }
    cybozu::logger::info() << "A new slave (" << addr << ") has joined.";

    // explicit move is required for C++11 (and gcc-4.8.x).
    // C++14 (and gcc-5.x) can implicitly move t.
    return std::move(t);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %r14
movq 0x80(%rsi), %rax
subq 0x78(%rsi), %rax
cmpq $0x28, %rax
jne 0x14c12
andq $0x0, (%r14)
jmp 0x14d4e
movl %edx, %ebp
movq %rsi, %r12
movl $0x148, %edi            # imm = 0x148
callq 0x7510
movq %rax, %rbx
leaq 0x26f95(%rip), %rax     # 0x3bbc0
movl 0xf0(%rax), %edx
leaq 0x8(%r12), %rcx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x152b6
leaq 0x78(%r12), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, (%rsi)
callq 0x15344
movq 0x30(%r12), %r13
pushq $0x28
popq %rdi
callq 0x7510
movq %rax, %r15
movq 0x10(%rsp), %rax
leaq 0x58(%rsp), %rsi
movq %r12, (%rsi)
movq %rax, 0x8(%rsi)
leaq 0x1ea(%rip), %rax       # 0x14e64
movq %rax, 0x18(%rsi)
leaq 0x1f3(%rip), %rax       # 0x14e78
movq %rax, 0x10(%rsi)
movq %r15, %rdi
callq 0xfc12
leaq 0x8(%rsp), %rsi
movq %r15, (%rsi)
movq %r13, %rdi
callq 0xfb88
leaq 0x8(%rsp), %rdi
callq 0x8c8e
leaq 0x58(%rsp), %rdi
callq 0x8d90
leaq 0x126be(%rip), %rsi     # 0x2737a
leaq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x84d8
leaq 0x78(%rsp), %rdi
movl %ebp, %esi
callq 0x10c2f
leaq 0x18(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x10ac8
leaq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %r15
movq %r15, %rsi
callq 0x75e0
movq %r15, %rdi
callq 0x71d0
leaq 0x18(%rsp), %rdi
callq 0xec96
leaq 0x12679(%rip), %rsi     # 0x2738a
leaq 0x18(%rsp), %rdi
callq 0x15362
leaq 0x38(%rsp), %rsi
movq %rax, %rdi
callq 0x869a
leaq 0x12669(%rip), %rsi     # 0x27398
movq %rax, %rdi
callq 0x15362
leaq 0x18(%rsp), %rdi
callq 0x86e4
movq %rbx, (%r14)
leaq 0x38(%rsp), %rdi
callq 0x71d0
movq %r14, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x14dd5
jmp 0x14dc3
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x8c8e
xorl %ebp, %ebp
jmp 0x14d81
movq %rax, %r14
movb $0x1, %bpl
leaq 0x58(%rsp), %rdi
callq 0x8d90
testb %bpl, %bpl
je 0x14ddf
pushq $0x28
popq %rsi
movq %r15, %rdi
callq 0x7520
jmp 0x14ddf
movq %rax, %r14
movl $0x148, %esi            # imm = 0x148
movq %rbx, %rdi
callq 0x7520
jmp 0x14de8
movq %rax, %rdi
callq 0x71a0
callq 0x78e0
jmp 0x14d00
jmp 0x14d63
movq %rax, %r14
jmp 0x14ddf
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x86e4
leaq 0x38(%rsp), %rdi
callq 0x71d0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movq %r14, %rdi
callq 0x7990