// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/unittest/Test_Buffer.cpp
// Function: BufferTest_Append_Test::TestBody()
TEST_F(BufferTest, Append)
{
  Buffer<int> b;

  BufferInit(&b);
  int* ptr = BufferAlloc(&b, &heap, 3);

  ASSERT_EQ(3, b.m_Size);

  ptr[0] = 1;
  ptr[1] = 2;
  ptr[2] = 3;

  BufferDestroy(&b, &heap);

  ASSERT_EQ(nullptr, b.m_Storage);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x28(%rsp), %r14
movaps %xmm0, -0x8(%r14)
movq $0x0, 0x8(%r14)
addq $0x10, %rbx
movq (%r14), %r13
movq %r13, %r12
addq $0x3, %r12
je 0x3254e
cmpq $0x9, %r12
movl $0x8, %ebp
cmovaeq %r12, %rbp
leaq (,%rbp,4), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x42dae
movq %rax, %r15
movq %rax, 0x20(%rsp)
movq %rbp, 0x30(%rsp)
jmp 0x32551
xorl %r15d, %r15d
movq %r12, 0x28(%rsp)
movq %rsp, %rcx
movl $0x3, (%rcx)
leaq 0x23fd3(%rip), %rsi     # 0x56539
leaq 0x22e82(%rip), %rdx     # 0x553ef
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r14, %r8
callq 0x3352d
cmpb $0x0, (%r12)
je 0x32627
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x2c81c
movabsq $0x200000001, %rax      # imm = 0x200000001
movq %rax, (%r15,%r13,4)
movl $0x3, 0x8(%r15,%r13,4)
movq 0x20(%rsp), %rsi
testq %rsi, %rsi
je 0x325ce
movq %rbx, %rdi
callq 0x42da6
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x20(%rsp), %rax
movq %rsp, %r8
movq %rax, (%r8)
leaq 0x8(%rsp), %rcx
movq $0x0, (%rcx)
leaq 0x22def(%rip), %rsi     # 0x553db
leaq 0x22df0(%rip), %rdx     # 0x553e3
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x33386
cmpb $0x0, (%rbx)
jne 0x32716
movq %rsp, %rdi
callq 0x12eee
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x326b1
movq (%rax), %r8
jmp 0x326b8
movq %rsp, %rdi
callq 0x12eee
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x3263e
movq (%rax), %r8
jmp 0x32645
leaq 0x2680e(%rip), %r8      # 0x58e53
leaq 0x22d76(%rip), %rdx     # 0x553c2
leaq 0x8(%rsp), %rdi
movl $0x2, %esi
movl $0x2c, %ecx
callq 0x10bb8
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x10c56
leaq 0x8(%rsp), %rdi
callq 0x10c24
cmpq $0x0, (%rsp)
je 0x326a3
movl $0x1, %edi
callq 0x10bb4
testb %al, %al
je 0x3269b
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x3269b
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, (%rsp)
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x2c81c
jmp 0x32722
leaq 0x2679b(%rip), %r8      # 0x58e53
leaq 0x22d03(%rip), %rdx     # 0x553c2
leaq 0x8(%rsp), %rdi
movl $0x2, %esi
movl $0x34, %ecx
callq 0x10bb8
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x10c56
leaq 0x8(%rsp), %rdi
callq 0x10c24
cmpq $0x0, (%rsp)
je 0x32716
movl $0x1, %edi
callq 0x10bb4
testb %al, %al
je 0x3270e
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x3270e
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, (%rsp)
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x2c81c
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x32770
jmp 0x3273f
jmp 0x3274e
jmp 0x3275b
jmp 0x32770
jmp 0x32770
jmp 0x32770
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x10c24
jmp 0x32751
movq %rax, %rbx
movq %rsp, %rdi
callq 0x31faa
jmp 0x3275e
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x31fbc
movq %rbx, %rdi
callq 0xcbb0
movq %rax, %rdi
callq 0x28baf