// File: cybozu[P]yrmcds/src/memcache/object.cpp
// Function: yrmcds::memcache::object::object(char const*, unsigned long, unsigned int, long)
object::object(const char* p, std::size_t len,
               std::uint32_t flags_, std::time_t exptime)
    : m_length(len), m_data(0, g_config.secure_erase()), m_file(nullptr),
      m_flags(flags_), m_exptime(exptime) {
    if( len > g_config.heap_data_limit() ) {
        m_file = std::unique_ptr<tempfile>(new tempfile);
        m_file->write(p, len);
    } else {
        if( len > 0 )
            m_data.append(p, len);
    }
    g_stats.total_objects.fetch_add(1, std::memory_order_relaxed);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdx, -0x40(%rbp)
movl %ecx, -0x44(%rbp)
movq %r8, -0x50(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x40(%rbp), %rcx
movq %rcx, (%rax)
addq $0x8, %rax
movq %rax, -0x88(%rbp)
leaq 0x703a1(%rip), %rdi     # 0xafd00
callq 0xaf80
movq -0x88(%rbp), %rdi
xorl %ecx, %ecx
movzbl %al, %edx
andl $0x1, %edx
xorl %eax, %eax
movl %eax, %esi
callq 0x22f90
movq -0x78(%rbp), %rdi
addq $0x30, %rdi
movq %rdi, -0x80(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x40880
movq -0x78(%rbp), %rdi
movl -0x44(%rbp), %eax
movl %eax, 0x38(%rdi)
movq -0x50(%rbp), %rax
movq %rax, 0x40(%rdi)
movq $0x1, 0x48(%rdi)
movl $0x0, 0x50(%rdi)
movl $0xffffffff, 0x54(%rdi) # imm = 0xFFFFFFFF
addq $0x58, %rdi
callq 0xc6b0
movq -0x40(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq 0x7032f(%rip), %rdi     # 0xafd00
callq 0xafc0
movq %rax, %rcx
movq -0x70(%rbp), %rax
cmpq %rcx, %rax
jbe 0x3fa98
movl $0x10, %edi
callq 0x8640
movq %rax, -0x90(%rbp)
jmp 0x3f9f9
movq -0x90(%rbp), %rdi
callq 0x408c0
jmp 0x3fa07
movq -0x90(%rbp), %rsi
leaq -0x58(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x40900
movq -0x78(%rbp), %rdi
movq -0xa0(%rbp), %rsi
addq $0x30, %rdi
movq %rdi, -0x98(%rbp)
callq 0x40930
movq -0xa0(%rbp), %rdi
callq 0x3f180
movq -0x98(%rbp), %rdi
callq 0x40960
movq %rax, %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x54f90
jmp 0x3fa63
jmp 0x3faba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x3fb8a
movq -0x90(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
movl $0x10, %esi
callq 0x8650
jmp 0x3fb8a
cmpq $0x0, -0x40(%rbp)
jbe 0x3fab8
movq -0x78(%rbp), %rdi
addq $0x8, %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x33d60
jmp 0x3fab6
jmp 0x3fab8
jmp 0x3faba
leaq 0x7053f(%rip), %rax     # 0xb0000
subq $-0x80, %rax
movq %rax, -0x8(%rbp)
movq $0x1, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
movq %rcx, -0x20(%rbp)
decl %eax
movl %eax, %ecx
movq %rcx, -0xa8(%rbp)
subl $0x4, %eax
ja 0x3fb15
movq -0xa8(%rbp), %rax
leaq 0x3bc40(%rip), %rcx     # 0x7b74c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0xb0(%rbp), %rcx
movq -0x20(%rbp), %rax
lock
xaddq %rax, (%rcx)
movq %rax, -0x28(%rbp)
jmp 0x3fb81
movq -0xb0(%rbp), %rcx
movq -0x20(%rbp), %rax
lock
xaddq %rax, (%rcx)
movq %rax, -0x28(%rbp)
jmp 0x3fb81
movq -0xb0(%rbp), %rcx
movq -0x20(%rbp), %rax
lock
xaddq %rax, (%rcx)
movq %rax, -0x28(%rbp)
jmp 0x3fb81
movq -0xb0(%rbp), %rcx
movq -0x20(%rbp), %rax
lock
xaddq %rax, (%rcx)
movq %rax, -0x28(%rbp)
jmp 0x3fb81
movq -0xb0(%rbp), %rcx
movq -0x20(%rbp), %rax
lock
xaddq %rax, (%rcx)
movq %rax, -0x28(%rbp)
addq $0xb0, %rsp
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0x3f180
movq -0x88(%rbp), %rdi
callq 0xc580
movq -0x60(%rbp), %rdi
callq 0x8bc0
nopl (%rax,%rax)