// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/src/memcache/object.cpp
// Function: yrmcds::memcache::object::prepend(char const*, unsigned long)
void object::prepend(const char* p, std::size_t len) {
    ++ m_cas;
    m_gc_old = 0;
    if( len == 0 ) return;

    std::size_t new_size = m_length + len;
    if( new_size > g_config.heap_data_limit() ) {
        if( m_file.get() == nullptr ) {
            m_file = std::unique_ptr<tempfile>(new tempfile);
            m_file->write(p, len);
            if( m_length > 0 )
                m_file->write(m_data.data(), m_length);
            m_data.reset();
        } else {
            cybozu::dynbuf buf(new_size);
            buf.append(p, len);
            m_file->read_contents(buf);
            m_file->clear();
            m_file->write(buf.data(), new_size);
        }
    } else {
        cybozu::dynbuf buf(new_size);
        buf.append(p, len);
        buf.append(m_data.data(), m_length);
        m_data.swap(buf);
    }
    m_length = new_size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
incq 0x48(%rdi)
movl $0x0, 0x50(%rdi)
testq %rdx, %rdx
je 0x188d5
movq %rdi, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq (%rdi), %r14
addq %rdx, %r14
leaq 0x2e470(%rip), %rbp     # 0x46bc0
cmpq 0xe0(%rbp), %r14
jbe 0x187c5
leaq 0x30(%rbx), %r13
cmpq $0x0, 0x30(%rbx)
je 0x187db
movq %r14, %rdi
callq 0x104a0
leaq 0x10(%rsp), %rdi
movq %rax, (%rdi)
movq %r14, 0x8(%rdi)
movq %r14, 0x10(%rdi)
movb $0x0, 0x18(%rdi)
movq $0x0, 0x20(%rdi)
movq %r12, %rsi
movq %r15, %rdx
callq 0x14fa6
movq (%r13), %rdi
leaq 0x10(%rsp), %rsi
callq 0x1ff6c
movq (%r13), %rdi
callq 0x1ff18
movq (%r13), %rdi
movq 0x10(%rsp), %rsi
movq %r14, %rdx
callq 0x1fecc
leaq 0x10(%rsp), %rdi
jmp 0x188cd
testq %r14, %r14
je 0x18860
movq %r14, %rdi
callq 0x104a0
jmp 0x18862
movl $0x10, %edi
callq 0x7500
movq %rax, 0x8(%rsp)
addq $0x48, %rbp
movq %rbp, %rdi
callq 0x18c56
movq 0x8(%rsp), %rcx
movl %eax, (%rcx)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rax, 0x10(%rsp)
movq (%r13), %rsi
movq %rcx, (%r13)
testq %rsi, %rsi
je 0x1881d
movq %r13, %rdi
callq 0x18286
movq 0x10(%rsp), %rsi
testq %rsi, %rsi
je 0x18831
leaq 0x10(%rsp), %rdi
callq 0x18286
movq 0x30(%rbx), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x1fecc
movq (%rbx), %rdx
testq %rdx, %rdx
je 0x18855
movq 0x8(%rbx), %rsi
movq 0x30(%rbx), %rdi
callq 0x1fecc
leaq 0x8(%rbx), %rdi
callq 0x10f0c
jmp 0x188d2
xorl %eax, %eax
leaq 0x10(%rsp), %rdi
movq %rax, (%rdi)
movq %r14, 0x8(%rdi)
movq %r14, 0x10(%rdi)
movb $0x0, 0x18(%rdi)
movq $0x0, 0x20(%rdi)
movq %r12, %rsi
movq %r15, %rdx
callq 0x14fa6
movq (%rbx), %rdx
movq 0x8(%rbx), %rsi
leaq 0x10(%rsp), %rdi
callq 0x14fa6
movq 0x8(%rbx), %rax
leaq 0x10(%rsp), %rdi
movq (%rdi), %rcx
movq %rcx, 0x8(%rbx)
movq %rax, (%rdi)
movq 0x18(%rbx), %rax
movq 0x10(%rdi), %rcx
movq %rcx, 0x18(%rbx)
movq %rax, 0x10(%rdi)
movq 0x28(%rbx), %rax
movq 0x20(%rdi), %rcx
movq %rcx, 0x28(%rbx)
movq %rax, 0x20(%rdi)
callq 0x96e2
movq %r14, (%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x10, %esi
movq 0x8(%rsp), %rdi
callq 0x7510
jmp 0x18907
jmp 0x188fa
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x96e2
movq %rbx, %rdi
callq 0x79b0
nop