// File: /workspace/github_cpp_makefile_star2_O3/amadvance[P]tommyds/check.c
// Function: test_arrayblkof
void test_arrayblkof(void)
{
	tommy_arrayblkof arrayblkof;
	unsigned i;
	const unsigned size = 50 * TOMMY_SIZE;

	tommy_arrayblkof_init(&arrayblkof, sizeof(unsigned));

	/* no op */
	tommy_arrayblkof_grow(&arrayblkof, 0);

	START("arrayblkof init");
	for(i=0;i<size;++i) {
		tommy_arrayblkof_grow(&arrayblkof, i + 1);
		unsigned* ref = tommy_arrayblkof_ref(&arrayblkof, i);
		if (*ref != 0)
			/* LCOV_EXCL_START */
			abort();
			/* LCOV_EXCL_STOP */
	}
	STOP();

	START("arrayblkof set");
	for(i=0;i<size;++i) {
		unsigned* ref = tommy_arrayblkof_ref(&arrayblkof, i);
		*ref = i;
	}
	STOP();

	START("arrayblkof get");
	for(i=0;i<size;++i) {
		unsigned* ref = tommy_arrayblkof_ref(&arrayblkof, i);
		if (*ref != i)
			/* LCOV_EXCL_START */
			abort();
			/* LCOV_EXCL_STOP */
	}
	STOP();

	if (tommy_arrayblkof_memory_usage(&arrayblkof) < size * sizeof(unsigned))
		/* LCOV_EXCL_START */
		abort();
		/* LCOV_EXCL_STOP */

	tommy_arrayblkof_done(&arrayblkof);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rsp, %rbx
movl $0x4, %esi
movq %rbx, %rdi
callq 0x465c
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4763
movq $-0x20, %rax
leaq 0x9441(%rip), %r15      # 0xbe10
incb 0x20(%rax,%r15)
addq $0x20, %rax
cmpq $0xffffe0, %rax         # imm = 0xFFFFE0
jb 0x29cf
movl $0x0, 0x9416(%rip)      # 0xbe00
leaq 0x4884(%rip), %rax      # 0x7275
movq %rax, 0x1009418(%rip)   # 0x100be10
callq 0x12e3
movq %rax, 0x1009414(%rip)   # 0x100be18
xorl %r12d, %r12d
movq %rsp, %rbx
cmpq $0x2faf080, %r12        # imm = 0x2FAF080
je 0x2a7b
leaq 0x1(%r12), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4763
cmpq %r12, 0x220(%rsp)
jbe 0x2c02
movq %r12, %rax
shrq $0xc, %rax
cmpq %rax, 0x208(%rsp)
jbe 0x2c21
movq %rax, %rcx
orq $0x1, %rcx
bsrq %rcx, %rcx
shll $0x3, %ecx
movq (%rsp,%rcx), %rcx
andl $0xfff, %r12d           # imm = 0xFFF
imulq 0x218(%rsp), %r12
movq (%rcx,%rax,8), %rax
cmpl $0x0, (%rax,%r12)
movq %r14, %r12
je 0x2a0a
callq 0x1040
callq 0x1312
movq $-0x20, %rax
incb 0x20(%rax,%r15)
addq $0x20, %rax
cmpq $0xffffe0, %rax         # imm = 0xFFFFE0
jb 0x2a87
movl $0x0, 0x935e(%rip)      # 0xbe00
leaq 0x47dc(%rip), %rax      # 0x7285
movq %rax, 0x1009360(%rip)   # 0x100be10
callq 0x12e3
movq %rax, 0x100935c(%rip)   # 0x100be18
movq 0x220(%rsp), %rax
movq 0x208(%rsp), %rcx
movq 0x218(%rsp), %rdx
xorl %esi, %esi
cmpq %rsi, %rax
je 0x2c02
movq %rsi, %rdi
shrq $0xc, %rdi
cmpq %rdi, %rcx
jbe 0x2c21
movq %rdi, %r8
orq $0x1, %r8
bsrq %r8, %r8
shll $0x3, %r8d
movq (%rsp,%r8), %r8
movq (%r8,%rdi,8), %rdi
movl %esi, %r8d
andl $0xfff, %r8d            # imm = 0xFFF
imulq %rdx, %r8
movl %esi, (%rdi,%r8)
incq %rsi
cmpq $0x2faf080, %rsi        # imm = 0x2FAF080
jne 0x2ad6
callq 0x1312
movq $-0x20, %rax
incb 0x20(%rax,%r15)
addq $0x20, %rax
cmpq $0xffffe0, %rax         # imm = 0xFFFFE0
jb 0x2b30
movl $0x0, 0x92b5(%rip)      # 0xbe00
leaq 0x4742(%rip), %rax      # 0x7294
movq %rax, 0x10092b7(%rip)   # 0x100be10
callq 0x12e3
movq %rax, 0x10092b3(%rip)   # 0x100be18
movq 0x220(%rsp), %rax
movq 0x208(%rsp), %rcx
movq 0x218(%rsp), %rdx
xorl %esi, %esi
cmpq %rsi, %rax
je 0x2c02
movq %rsi, %rdi
shrq $0xc, %rdi
cmpq %rdi, %rcx
jbe 0x2c21
movq %rdi, %r8
orq $0x1, %r8
bsrq %r8, %r8
shll $0x3, %r8d
movq (%rsp,%r8), %r8
movq (%r8,%rdi,8), %rdi
movl %esi, %r8d
andl $0xfff, %r8d            # imm = 0xFFF
imulq %rdx, %r8
movl (%rdi,%r8), %edi
cmpq %rdi, %rsi
jne 0x2a76
incq %rsi
cmpq $0x2faf080, %rsi        # imm = 0x2FAF080
jne 0x2b7f
callq 0x1312
movq %rsp, %rdi
callq 0x480b
cmpq $0xbebc1ff, %rax        # imm = 0xBEBC1FF
jbe 0x2a76
movq %rsp, %rdi
callq 0x4719
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x4704(%rip), %rdi      # 0x730d
leaq 0x47ff(%rip), %rsi      # 0x740f
leaq 0x4814(%rip), %rcx      # 0x742b
movl $0x5d, %edx
callq 0x1090
leaq 0x46e5(%rip), %rdi      # 0x730d
leaq 0x46f1(%rip), %rsi      # 0x7320
leaq 0x4701(%rip), %rcx      # 0x7337
movl $0x5c, %edx
callq 0x1090