// File: cybozu[P]yrmcds/src/memcache/memcache.cpp
// Function: yrmcds::memcache::text_response::value(cybozu::hash_key const&, unsigned int, cybozu::dynbuf const&, unsigned long)
void text_response::value(const cybozu::hash_key& key, std::uint32_t flags,
                          const cybozu::dynbuf& data, std::uint64_t cas) {
    if( key.length() > MAX_KEY_LENGTH )
        throw std::logic_error("MAX_KEY_LENGTH over bug");
    m_iov[0] = {VALUE, sizeof(VALUE) - 1};
    m_iov[1] = {key.data(), key.length()};
    char buf[MAX_KEY_LENGTH + 100];
    static_assert( sizeof(unsigned int) >= sizeof(std::uint32_t),
                   "unsigned int is smaller than std::uint32_t" );
    int length = snprintf(buf, sizeof(buf), " %u %llu %llu\x0d\x0a",
                          (unsigned int)flags,
                          (long long unsigned int)data.size(),
                          (long long unsigned int)cas);
    m_iov[2] = {buf, (std::size_t)length};
    m_iov[3] = {data.data(), data.size()};
    m_iov[4] = {CRLF, sizeof(CRLF) - 1};
    m_socket.sendv(m_iov, 5, false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x220, %rsp            # imm = 0x220
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x200(%rbp)
movq -0x10(%rbp), %rdi
callq 0x355c0
cmpq $0xfa, %rax
jbe 0x63366
movl $0x10, %edi
callq 0x82f0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x208(%rbp)
leaq 0x19fa6(%rip), %rsi     # 0x7d2ce
callq 0x89a0
jmp 0x6332f
movq -0x208(%rbp), %rdi
movq 0x4bc83(%rip), %rsi     # 0xaefc0
movq 0x4bc3c(%rip), %rdx     # 0xaef80
callq 0x8b70
movq -0x208(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x8490
jmp 0x634d4
movq -0x200(%rbp), %rax
leaq 0x19ea0(%rip), %rcx     # 0x7d214
movq %rcx, -0x48(%rbp)
movq $0x6, -0x40(%rbp)
movq -0x48(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rdi
callq 0x355a0
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
callq 0x355c0
movq %rax, %rcx
movq -0x200(%rbp), %rax
movq %rcx, -0x50(%rbp)
movq -0x58(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq -0x50(%rbp), %rcx
movq %rcx, 0x20(%rax)
leaq -0x1c0(%rbp), %rax
movq %rax, -0x218(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x20c(%rbp)
movq -0x20(%rbp), %rdi
callq 0x33df0
movq -0x218(%rbp), %rdi
movl -0x20c(%rbp), %ecx
movq %rax, %r8
movq -0x28(%rbp), %r9
movl $0x15e, %esi            # imm = 0x15E
leaq 0x19eed(%rip), %rdx     # 0x7d2f1
movb $0x0, %al
callq 0x8aa0
movl %eax, %ecx
movq -0x200(%rbp), %rax
movl %ecx, -0x1c4(%rbp)
leaq -0x1c0(%rbp), %rcx
movq %rcx, -0x1d8(%rbp)
movslq -0x1c4(%rbp), %rcx
movq %rcx, -0x1d0(%rbp)
movq -0x1d8(%rbp), %rcx
movq %rcx, 0x28(%rax)
movq -0x1d0(%rbp), %rcx
movq %rcx, 0x30(%rax)
movq -0x20(%rbp), %rdi
callq 0x33dd0
movq %rax, -0x1e8(%rbp)
movq -0x20(%rbp), %rdi
callq 0x33df0
movq -0x200(%rbp), %rsi
movq %rax, -0x1e0(%rbp)
movq -0x1e8(%rbp), %rax
movq %rax, 0x38(%rsi)
movq -0x1e0(%rbp), %rax
movq %rax, 0x40(%rsi)
leaq 0x19d8b(%rip), %rax     # 0x7d21b
movq %rax, -0x1f8(%rbp)
movq $0x2, -0x1f0(%rbp)
movq -0x1f8(%rbp), %rax
movq %rax, 0x48(%rsi)
movq -0x1f0(%rbp), %rax
movq %rax, 0x50(%rsi)
movq (%rsi), %rdi
addq $0x8, %rsi
movl $0x5, %edx
xorl %ecx, %ecx
callq 0x5d4a0
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x8bc0
nopl (%rax)