// File: /workspace/github_cpp_makefile_star2_O1/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 0x458d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4639
movq $-0x20, %rax
leaq 0x840b(%rip), %r15      # 0xae10
incb 0x20(%rax,%r15)
addq $0x20, %rax
cmpq $0xffffe0, %rax         # imm = 0xFFFFE0
jb 0x2a05
movl $0x0, 0x83e0(%rip)      # 0xae00
leaq 0x484e(%rip), %rax      # 0x7275
movq %rax, 0x10083e2(%rip)   # 0x100ae10
callq 0x12e3
movq %rax, 0x10083de(%rip)   # 0x100ae18
xorl %r12d, %r12d
movq %rsp, %rbx
cmpq $0x2faf080, %r12        # imm = 0x2FAF080
je 0x2ab1
leaq 0x1(%r12), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4639
cmpq %r12, 0x220(%rsp)
jbe 0x2c38
movq %r12, %rax
shrq $0xc, %rax
cmpq %rax, 0x208(%rsp)
jbe 0x2c57
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 0x2a40
callq 0x1040
callq 0x1312
movq $-0x20, %rax
incb 0x20(%rax,%r15)
addq $0x20, %rax
cmpq $0xffffe0, %rax         # imm = 0xFFFFE0
jb 0x2abd
movl $0x0, 0x8328(%rip)      # 0xae00
leaq 0x47a6(%rip), %rax      # 0x7285
movq %rax, 0x100832a(%rip)   # 0x100ae10
callq 0x12e3
movq %rax, 0x1008326(%rip)   # 0x100ae18
movq 0x220(%rsp), %rax
movq 0x208(%rsp), %rcx
movq 0x218(%rsp), %rdx
xorl %esi, %esi
cmpq %rsi, %rax
je 0x2c38
movq %rsi, %rdi
shrq $0xc, %rdi
cmpq %rdi, %rcx
jbe 0x2c57
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 0x2b0c
callq 0x1312
movq $-0x20, %rax
incb 0x20(%rax,%r15)
addq $0x20, %rax
cmpq $0xffffe0, %rax         # imm = 0xFFFFE0
jb 0x2b66
movl $0x0, 0x827f(%rip)      # 0xae00
leaq 0x470c(%rip), %rax      # 0x7294
movq %rax, 0x1008281(%rip)   # 0x100ae10
callq 0x12e3
movq %rax, 0x100827d(%rip)   # 0x100ae18
movq 0x220(%rsp), %rax
movq 0x208(%rsp), %rcx
movq 0x218(%rsp), %rdx
xorl %esi, %esi
cmpq %rsi, %rax
je 0x2c38
movq %rsi, %rdi
shrq $0xc, %rdi
cmpq %rdi, %rcx
jbe 0x2c57
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 0x2aac
incq %rsi
cmpq $0x2faf080, %rsi        # imm = 0x2FAF080
jne 0x2bb5
callq 0x1312
movq %rsp, %rdi
callq 0x46e1
cmpq $0xbebc1ff, %rax        # imm = 0xBEBC1FF
jbe 0x2aac
movq %rsp, %rdi
callq 0x45ef
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x46ce(%rip), %rdi      # 0x730d
leaq 0x47c9(%rip), %rsi      # 0x740f
leaq 0x47de(%rip), %rcx      # 0x742b
movl $0x5d, %edx
callq 0x1090
leaq 0x46af(%rip), %rdi      # 0x730d
leaq 0x46bb(%rip), %rsi      # 0x7320
leaq 0x46cb(%rip), %rcx      # 0x7337
movl $0x5c, %edx
callq 0x1090