// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/unittest/Test_MemAllocLinear.cpp
// Function: MemAllocLinearTest_Alignmenment_Test::TestBody()
TEST_F(MemAllocLinearTest, Alignmenment)
{
  // Allocate an int, check alignment.
  int* iptr = LinearAllocate<int>(&alloc);
  ASSERT_EQ(sizeof(int), alloc.m_Offset);
  ASSERT_EQ(0, uintptr_t(iptr) & 3);

  // Allocate a character.
  LinearAllocate<char>(&alloc);
  ASSERT_EQ(sizeof(int) + sizeof(char), alloc.m_Offset);

  // Allocate another int, check alignment.
  iptr = LinearAllocate<int>(&alloc);
  ASSERT_EQ(sizeof(int) * 3, alloc.m_Offset);
  ASSERT_EQ(0, uintptr_t(iptr) & 3);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x18(%rdi), %r14
movq %r14, %rdi
callq 0x2ead2
movq %rax, %r15
leaq 0x8(%rsp), %rcx
movq $0x4, (%rcx)
addq $0x30, %rbx
leaq 0x19033(%rip), %rsi     # 0x4752b
leaq 0x19010(%rip), %rdx     # 0x4750f
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %rbx, %r8
callq 0x2ec93
cmpb $0x0, (%r12)
je 0x2e64e
leaq 0x20(%rsp), %rdi
callq 0x2295e
leaq 0x10(%rsp), %rcx
andl $0x0, (%rcx)
andl $0x3, %r15d
leaq 0x8(%rsp), %r8
movq %r15, (%r8)
leaq 0x175c9(%rip), %rsi     # 0x45b08
leaq 0x18ff1(%rip), %rdx     # 0x47537
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x287b5
cmpb $0x0, (%r15)
je 0x2e667
leaq 0x20(%rsp), %rdi
callq 0x2295e
movq %r14, %rdi
callq 0x2eadd
leaq 0x8(%rsp), %rcx
movq $0x5, (%rcx)
leaq 0x18fc9(%rip), %rsi     # 0x4754b
leaq 0x18f86(%rip), %rdx     # 0x4750f
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %rbx, %r8
callq 0x2ec93
cmpb $0x0, (%r15)
je 0x2e6b2
leaq 0x20(%rsp), %rdi
callq 0x2295e
movq %r14, %rdi
callq 0x2ead2
movq %rax, %r14
leaq 0x8(%rsp), %rcx
movq $0xc, (%rcx)
leaq 0x18f9b(%rip), %rsi     # 0x47566
leaq 0x18f3d(%rip), %rdx     # 0x4750f
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %rbx, %r8
callq 0x2ec93
cmpb $0x0, (%r15)
je 0x2e6fa
leaq 0x20(%rsp), %rdi
callq 0x2295e
leaq 0x10(%rsp), %rcx
andl $0x0, (%rcx)
andl $0x3, %r14d
leaq 0x8(%rsp), %r8
movq %r14, (%r8)
leaq 0x174f7(%rip), %rsi     # 0x45b08
leaq 0x18f1f(%rip), %rdx     # 0x47537
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x287b5
cmpb $0x0, (%rbx)
jne 0x2e7dd
leaq 0x8(%rsp), %rdi
callq 0x11c8e
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x2e79c
movq (%rax), %r8
jmp 0x2e7a3
leaq 0x8(%rsp), %rdi
callq 0x11c8e
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x2e680
movq (%rax), %r8
jmp 0x2e687
leaq 0x8(%rsp), %rdi
callq 0x11c8e
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x2e6cb
movq (%rax), %r8
jmp 0x2e6d2
leaq 0x1b820(%rip), %r8      # 0x49ea7
leaq 0x18e60(%rip), %rdx     # 0x474ee
leaq 0x10(%rsp), %rdi
pushq $0x2
popq %rsi
pushq $0x25
popq %rcx
callq 0x104f8
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x10576
jmp 0x2e76f
leaq 0x8(%rsp), %rdi
callq 0x11c8e
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x2e713
movq (%rax), %r8
jmp 0x2e71a
leaq 0x1b7d5(%rip), %r8      # 0x49ea7
leaq 0x18e15(%rip), %rdx     # 0x474ee
leaq 0x10(%rsp), %rdi
pushq $0x2
popq %rsi
pushq $0x26
popq %rcx
callq 0x104f8
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x10576
jmp 0x2e76f
leaq 0x8(%rsp), %rdi
callq 0x11c8e
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x2e742
movq (%rax), %r8
jmp 0x2e749
leaq 0x1b78d(%rip), %r8      # 0x49ea7
leaq 0x18dcd(%rip), %rdx     # 0x474ee
leaq 0x10(%rsp), %rdi
pushq $0x2
popq %rsi
pushq $0x2a
popq %rcx
callq 0x104f8
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x10576
jmp 0x2e76f
leaq 0x1b75e(%rip), %r8      # 0x49ea7
leaq 0x18d9e(%rip), %rdx     # 0x474ee
leaq 0x10(%rsp), %rdi
pushq $0x2
popq %rsi
pushq $0x2e
popq %rcx
callq 0x104f8
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x10576
leaq 0x20(%rsp), %rbx
leaq 0x10(%rsp), %rdi
callq 0x10558
leaq 0x8(%rsp), %rdi
callq 0x1f8e0
movq %rbx, %rdi
callq 0x2295e
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1b704(%rip), %r8      # 0x49ea7
leaq 0x18d44(%rip), %rdx     # 0x474ee
leaq 0x10(%rsp), %rdi
pushq $0x2
popq %rsi
pushq $0x2f
popq %rcx
callq 0x104f8
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x10576
leaq 0x10(%rsp), %rdi
callq 0x10558
leaq 0x8(%rsp), %rdi
callq 0x1f8e0
leaq 0x20(%rsp), %rdi
jmp 0x2e78b
jmp 0x2e7fc
jmp 0x2e80b
jmp 0x2e81a
jmp 0x2e7fc
jmp 0x2e80b
jmp 0x2e81a
jmp 0x2e7fc
jmp 0x2e80b
jmp 0x2e81a
jmp 0x2e7fc
jmp 0x2e80b
jmp 0x2e81a
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x10558
jmp 0x2e80e
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1f8e0
jmp 0x2e81d
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x2295e
movq %rbx, %rdi
callq 0xdbf0
nop