// File: /workspace/github_cpp_makefile_star2_O3/MingYueRuYa[P]cprimeprimecode/memory_manager.cpp
// Function: custom_allocator::test_custom_allocator()
void test_custom_allocator()
{
	cout << "Foo size:" << sizeof(Foo) << endl;

	Foo  *fooarray[100];
	for (int i=0; i<13; ++i) {
		fooarray[i] = new Foo();
	}

	cout << "Goo size:" << sizeof(Foo) << endl;
	Goo  *gooarray[100];
	for (int i=0; i<13; ++i) {
		gooarray[i] = new Goo();
	}

	cout << "Hoo size:" << sizeof(Foo) << endl;
	Hoo  *hooarray[100];
	for (int i=0; i<13; ++i) {
		hooarray[i] = new Hoo();
	}

//result:
	//	Foo size:4
	//	address:0x1b17008
	//	address:0x1b1700c
	//	address:0x1b17010
	//	address:0x1b17014
	//	address:0x1b17018
	//	address:0x1b17020
	//	address:0x1b17024
	//	address:0x1b17028
	//	address:0x1b1702c
	//	address:0x1b17030
	//	address:0x1b17038
	//	address:0x1b1703c
	//	address:0x1b17040
	//	Goo size:4
	//	address:0x1b17050
	//	address:0x1b17054
	//	address:0x1b17058
	//	address:0x1b1705c
	//	address:0x1b17060
	//	address:0x1b17068
	//	address:0x1b1706c
	//	address:0x1b17070
	//	address:0x1b17074
	//	address:0x1b17078
	//	address:0x1b17080
	//	address:0x1b17084
	//	address:0x1b17088
	//	Hoo size:4
	//	address:0x1b17098
	//	address:0x1b1709c
	//	address:0x1b170a0
	//	address:0x1b170a4
	//	address:0x1b170a8
	//	address:0x1b170b0
	//	address:0x1b170b4
	//	address:0x1b170b8
	//	address:0x1b170bc
	//	address:0x1b170c0
	//	address:0x1b170c8
	//	address:0x1b170cc
	//	address:0x1b170d0
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x4804(%rip), %rbx      # 0x7fd0
leaq 0x1aeb(%rip), %rsi      # 0x52be
movl $0x9, %edx
movq %rbx, %rdi
callq 0x21a0
movl $0x4, %esi
movq %rbx, %rdi
callq 0x20c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20d0
movl $0xd, %r15d
leaq 0x4954(%rip), %rbx      # 0x8178
movl $0x4, %esi
movq %rbx, %rdi
callq 0x46d4
movq %rax, %r14
movq %rax, %rdi
callq 0x431c
decl %r15d
jne 0x3824
movq 0x4788(%rip), %rbx      # 0x7fd0
leaq 0x1a79(%rip), %rsi      # 0x52c8
movl $0x9, %edx
movq %rbx, %rdi
callq 0x21a0
movl $0x4, %esi
movq %rbx, %rdi
callq 0x20c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20d0
movl $0xd, %r15d
leaq 0x48e8(%rip), %rbx      # 0x8188
movl $0x4, %esi
movq %rbx, %rdi
callq 0x46d4
movq %rax, %r14
movq %rax, %rdi
callq 0x4380
decl %r15d
jne 0x38a0
movq 0x470c(%rip), %rbx      # 0x7fd0
leaq 0x1a07(%rip), %rsi      # 0x52d2
movl $0x9, %edx
movq %rbx, %rdi
callq 0x21a0
movl $0x4, %esi
movq %rbx, %rdi
callq 0x20c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20d0
movl $0xd, %r15d
leaq 0x487c(%rip), %rbx      # 0x8198
movl $0x4, %esi
movq %rbx, %rdi
callq 0x46d4
movq %rax, %r14
movq %rax, %rdi
callq 0x43e4
decl %r15d
jne 0x391c
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x4855(%rip), %rcx      # 0x81a0
movq %rcx, (%r14)
movq %r14, 0x484b(%rip)      # 0x81a0
jmp 0x397b
movq 0x4832(%rip), %rcx      # 0x8190
movq %rcx, (%r14)
movq %r14, 0x4828(%rip)      # 0x8190
jmp 0x397b
movq 0x480f(%rip), %rcx      # 0x8180
movq %rcx, (%r14)
movq %r14, 0x4805(%rip)      # 0x8180
movq %rax, %rdi
callq 0x2250