// File: /workspace/github_cpp_makefile_star2_O3/UBOdin[P]jitd-cpp/include/jitd.hpp
// Function: JITD<Record, PureLocalPolicy<Record>>::insert(std::shared_ptr<std::vector<Record, std::allocator<Record>>>)
void insert(Buffer<Tuple> records)
    {
      // Create a template for the new root structure
      ConcatCog<Tuple> *newRootCog = new ConcatCog<Tuple>(
        nullptr,
        CogHandle<Tuple>(new CogHandleBase<Tuple>(CogPtr<Tuple>(
          new ArrayCog<Tuple>(records))))
      );
      // newRootCog->lhs is a placeholder for the current root object
      
      // Define a new root handle to swap in
      CogHandle<Tuple> newRoot = 
        CogHandle<Tuple>(new CogHandleBase<Tuple>(CogPtr<Tuple>(newRootCog)));
      
      // As one atomic operation, perform:
      //   newRootCog->lhs = root
      //   root = newRoot
      swapInNewRoot(newRoot, newRootCog->lhs);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r15
movq %rdi, %r14
movl $0x30, %edi
callq 0x4270
movq %rax, %r13
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
movl $0x10, %edi
callq 0x4270
movq %rax, %r12
movl $0x30, %edi
callq 0x4270
movq (%r15), %rcx
movq 0x8(%r15), %r15
testq %r15, %r15
je 0xb9f9
movq 0xc5eb(%rip), %rdx      # 0x17fc0
cmpb $0x0, (%rdx)
je 0xba18
incl 0x8(%r15)
movl $0x3, 0x8(%rax)
leaq 0xbcc4(%rip), %rdx      # 0x176b0
movq %rdx, (%rax)
movq %rcx, 0x10(%rax)
movq %r15, 0x18(%rax)
jmp 0xba3f
movl $0x3, 0x8(%rax)
leaq 0xbca9(%rip), %rdx      # 0x176b0
movq %rdx, (%rax)
movq %rcx, 0x10(%rax)
movq $0x0, 0x18(%rax)
jmp 0xba43
lock
incl 0x8(%r15)
cmpb $0x0, (%rdx)
movl $0x3, 0x8(%rax)
leaq 0xbc82(%rip), %rdx      # 0x176b0
movq %rdx, (%rax)
movq %rcx, 0x10(%rax)
movq %r15, 0x18(%rax)
je 0xbbe3
incl 0x8(%r15)
movq (%rcx), %rdx
movq %rdx, 0x20(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x28(%rax)
leaq -0x40(%rbp), %rdi
movq %rax, -0x8(%rdi)
movq %rax, %rsi
callq 0x6eb0
movq -0x48(%rbp), %rax
movq %rax, (%r12)
movq -0x40(%rbp), %rax
movq %rax, 0x8(%r12)
testq %rax, %rax
je 0xba8d
movq 0xc541(%rip), %rcx      # 0x17fc0
cmpb $0x0, (%rcx)
je 0xba89
incl 0x8(%rax)
jmp 0xba8d
lock
incl 0x8(%rax)
leaq -0x88(%rbp), %rdi
movq %r12, -0x8(%rdi)
movq %r12, %rsi
callq 0x6f94
leaq -0x60(%rbp), %rsi
leaq -0x90(%rbp), %rbx
movq %r13, %rdi
movq %rbx, %rdx
callq 0x64e6
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0xbac4
callq 0x65c2
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0xbad2
callq 0x65c2
testq %r15, %r15
je 0xbadf
movq %r15, %rdi
callq 0x65c2
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0xbaed
callq 0x65c2
movl $0x10, %edi
callq 0x4270
movq %rax, %r15
leaq -0x30(%rbp), %rdi
movq %r13, %rsi
movq %r13, -0x8(%rdi)
callq 0x84b4
movq -0x38(%rbp), %rax
movq %rax, (%r15)
movq -0x30(%rbp), %rax
movq %rax, 0x8(%r15)
testq %rax, %rax
je 0xbb33
movq 0xc49b(%rip), %rcx      # 0x17fc0
cmpb $0x0, (%rcx)
je 0xbb2f
incl 0x8(%rax)
jmp 0xbb33
lock
incl 0x8(%rax)
leaq -0x68(%rbp), %rdi
movq %r15, -0x8(%rdi)
movq %r15, %rsi
callq 0x6f94
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0xbb51
callq 0x65c2
leaq 0x10(%r13), %r15
addq $0x18, %r13
leaq 0x8(%r14), %r12
movq (%r14), %rax
movq %rax, (%r15)
movq %r13, %rdi
movq %r12, %rsi
callq 0xce1a
movq -0x70(%rbp), %rax
movq -0x68(%rbp), %rcx
testq %rcx, %rcx
je 0xbb90
movq 0xc43e(%rip), %rdx      # 0x17fc0
cmpb $0x0, (%rdx)
je 0xbb8c
incl 0x8(%rcx)
jmp 0xbb90
lock
incl 0x8(%rcx)
movq %rax, -0x80(%rbp)
movq %rcx, -0x78(%rbp)
movq %r14, %rdi
movq %r15, %rsi
leaq -0x80(%rbp), %rdx
movl $0x5, %ecx
movl $0x5, %r8d
callq 0xce63
movl %eax, %ebx
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0xbbc2
callq 0x65c2
testb %bl, %bl
je 0xbb5d
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0xbbd4
callq 0x65c2
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
lock
incl 0x8(%r15)
jmp 0xba43
movq %rax, %r14
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0xbc6f
callq 0x65c2
jmp 0xbc6f
movq %rax, %r14
movl $0x10, %esi
movq %r15, %rdi
jmp 0xbc6a
movq %rax, %r14
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0xbc1e
callq 0x65c2
testq %r15, %r15
je 0xbc54
movq %r15, %rdi
callq 0x65c2
jmp 0xbc54
movq %rax, %r14
testq %r15, %r15
je 0xbc42
movq %r15, %rdi
callq 0x65c2
jmp 0xbc42
movq %rax, %r14
movl $0x10, %esi
movq %r12, %rdi
callq 0x4280
jmp 0xbc54
movq %rax, %r14
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0xbc62
callq 0x65c2
movl $0x30, %esi
movq %r13, %rdi
callq 0x4280
movq %r14, %rdi
callq 0x4400
nop