// File: 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
subq $0xd0, %rsp
movq %rsi, -0xb8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movl $0x30, %edi
callq 0x4290
movq %rax, -0xa8(%rbp)
movb $0x1, -0x6b(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
callq 0x140a0
movl $0x10, %edi
callq 0x4290
movq %rax, -0xa0(%rbp)
jmp 0x126aa
movb $0x1, -0x6a(%rbp)
movl $0x30, %edi
callq 0x4290
movq %rax, -0xc0(%rbp)
jmp 0x126c1
movq -0xb8(%rbp), %rsi
movb $0x1, -0x69(%rbp)
leaq -0x68(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x73a0
movq -0xc0(%rbp), %rdi
movq -0xc8(%rbp), %rsi
callq 0x140c0
jmp 0x126f1
movq -0xc0(%rbp), %rsi
movb $0x0, -0x69(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x74e0
jmp 0x12707
movq -0xa0(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x7510
jmp 0x12719
movq -0xa0(%rbp), %rsi
movb $0x0, -0x6a(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x7530
jmp 0x1272f
movq -0xa8(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x77e0
jmp 0x12745
movb $0x0, -0x6b(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x7750
leaq -0x58(%rbp), %rdi
callq 0x7560
leaq -0x68(%rbp), %rdi
callq 0x72b0
leaq -0x28(%rbp), %rdi
callq 0x7750
movq -0xa8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x10, %edi
callq 0x4290
movq %rax, -0xd0(%rbp)
movb $0x1, -0x91(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x7850
jmp 0x127a2
movq -0xd0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x7510
jmp 0x127b7
movq -0xd0(%rbp), %rsi
movb $0x0, -0x91(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x7530
jmp 0x127d0
leaq -0x90(%rbp), %rdi
callq 0x7560
movq -0xb0(%rbp), %rdi
movq -0x18(%rbp), %rdx
addq $0x10, %rdx
leaq -0x80(%rbp), %rsi
callq 0x14170
jmp 0x127f6
leaq -0x80(%rbp), %rdi
callq 0x7750
addq $0xd0, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x128a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x12885
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x12861
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x12858
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x7750
leaq -0x58(%rbp), %rdi
callq 0x7560
leaq -0x68(%rbp), %rdi
callq 0x72b0
testb $0x1, -0x69(%rbp)
jne 0x12872
jmp 0x12883
movq -0xc0(%rbp), %rdi
movl $0x30, %esi
callq 0x42a0
jmp 0x12885
testb $0x1, -0x6a(%rbp)
jne 0x1288d
jmp 0x1289e
movq -0xa0(%rbp), %rdi
movl $0x10, %esi
callq 0x42a0
jmp 0x128a0
leaq -0x28(%rbp), %rdi
callq 0x7750
testb $0x1, -0x6b(%rbp)
jne 0x128b1
jmp 0x128c2
movq -0xa8(%rbp), %rdi
movl $0x30, %esi
callq 0x42a0
jmp 0x1291d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x128ea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x7560
testb $0x1, -0x91(%rbp)
jne 0x128f5
jmp 0x12906
movq -0xd0(%rbp), %rdi
movl $0x10, %esi
callq 0x42a0
jmp 0x1291d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x7750
movq -0x40(%rbp), %rdi
callq 0x4420
nopw %cs:(%rax,%rax)