// File: /workspace/github_cpp_makefile_star2_O2/lluchs[P]sparsearray/main.cpp
// Function: main
int main(int argc, char **argv)
{
	const size_t list_size = 10000;

	int opt;
	while ((opt = getopt(argc, argv, "l:i:s:a:")) != -1)
	{
		switch (opt)
		{
		// No error handling. Don't pass invalid values.
		case 'i': iterations = std::atoi(optarg); break;
		case 's': seed = std::strtoull(optarg, nullptr, 10); break;
		case 'a': addmod = std::atoi(optarg); break;
		default: std::cerr << "Invalid option " << (char) opt << std::endl;
		}
	}
	std::cout << "iterations = " << std::to_string(iterations) << std::endl;
	std::cout << "seed = " << std::to_string(seed) << std::endl;
	std::cout << "addmod = " << std::to_string(addmod) << std::endl;
	std::cout << "data size = " << sizeof(C4PXS[list_size]) << " byte" << std::endl << std::endl;

	run_benchmark<BitmapSA<C4PXS, list_size>>("BitmapSA");
	run_benchmark<ChunkSA<C4PXS, list_size>>("ChunkSA");
	run_benchmark<StaticChunkSA<C4PXS, list_size>>("StaticChunkSA");
	run_benchmark<LinkedListSA<C4PXS, list_size>>("LinkedListSA");
	run_benchmark<LinkedListBitmapSA<C4PXS, list_size>>("LinkedListBitmapSA");
	run_benchmark<DoubleLinkedListSA<C4PXS, list_size>>("DoubleLinkedListSA");
	run_benchmark<UnorderedLinkedListSA<C4PXS, list_size>>("UnorderedLinkedListSA");
	run_benchmark<ReorderingSA<C4PXS, list_size>>("ReorderingSA");

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x2d52(%rip), %r14      # 0x4018
movq 0x5cf3(%rip), %r12      # 0x6fc0
leaq 0x2d4d(%rip), %r13      # 0x4021
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1050
cmpl $0x61, %eax
je 0x1330
movl %eax, %r15d
cmpl $0x69, %eax
je 0x131f
cmpl $0x73, %r15d
je 0x1341
cmpl $-0x1, %r15d
je 0x135b
movq 0x5cef(%rip), %rdi      # 0x6ff0
movq %r13, %rsi
callq 0x10e0
movsbl %r15b, %esi
movq %rax, %rdi
callq 0x1100
movq %rax, %rdi
callq 0x1070
jmp 0x12d4
movq (%r12), %rdi
callq 0x1150
movl %eax, 0x5da2(%rip)      # 0x70d0
jmp 0x12d4
movq (%r12), %rdi
callq 0x1150
movl %eax, 0x5da1(%rip)      # 0x70e0
jmp 0x12d4
movq (%r12), %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x1120
movq %rax, 0x5d82(%rip)      # 0x70d8
jmp 0x12d4
movq 0x5c6e(%rip), %rdi      # 0x6fd0
leaq 0x2cc8(%rip), %rsi      # 0x4031
callq 0x10e0
movq %rax, %rbx
movl 0x5d59(%rip), %esi      # 0x70d0
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x1db5
movq %rbx, %rdi
movq %r14, %rsi
callq 0x10c0
movq %rax, %rdi
callq 0x1070
leaq 0x8(%rsp), %rdi
callq 0x1060
movq 0x5c28(%rip), %rdi      # 0x6fd0
leaq 0x2c90(%rip), %rsi      # 0x403f
callq 0x10e0
movq %rax, %rbx
movq 0x5d1a(%rip), %rsi      # 0x70d8
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x1e0e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x10c0
movq %rax, %rdi
callq 0x1070
leaq 0x8(%rsp), %rdi
callq 0x1060
movq 0x5be1(%rip), %rdi      # 0x6fd0
leaq 0x2c51(%rip), %rsi      # 0x4047
callq 0x10e0
movq %rax, %rbx
movl 0x5cdc(%rip), %esi      # 0x70e0
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x1db5
movq %rbx, %rdi
movq %r14, %rsi
callq 0x10c0
movq %rax, %rdi
callq 0x1070
leaq 0x8(%rsp), %rdi
callq 0x1060
movq 0x5b9b(%rip), %rbx      # 0x6fd0
leaq 0x2c15(%rip), %rsi      # 0x4051
movq %rbx, %rdi
callq 0x10e0
movl $0x30d40, %esi          # imm = 0x30D40
movq %rax, %rdi
callq 0x10a0
leaq 0x2c06(%rip), %r14      # 0x405e
movq %rax, %rdi
movq %r14, %rsi
callq 0x10e0
movq %rax, %rdi
callq 0x1070
movq %rax, %rdi
callq 0x1070
leaq 0x2c41(%rip), %rsi      # 0x40bb
movq %rbx, %rdi
movq %rsi, %rbp
callq 0x10e0
leaq 0x2bf0(%rip), %rsi      # 0x407c
movq %rax, %rdi
callq 0x10e0
movq %rax, %rdi
callq 0x1070
callq 0x1040
movq %rax, %r15
movl 0x5c26(%rip), %edi      # 0x70d0
movq 0x5c27(%rip), %rsi      # 0x70d8
movl 0x5c29(%rip), %edx      # 0x70e0
callq 0x1f86
movq %rax, %r12
movq %rax, %r13
shrq $0x20, %r13
callq 0x1040
subq %r15, %rax
cvtsi2sd %rax, %xmm0
divsd 0x2b2d(%rip), %xmm0     # 0x4008
movsd %xmm0, (%rsp)
leaq 0x2bdb(%rip), %rsi      # 0x40c2
movq %rbx, %rdi
callq 0x10e0
movsd (%rsp), %xmm0
mulsd 0x2b14(%rip), %xmm0     # 0x4010
cvttsd2si %xmm0, %rsi
movq %rax, %rdi
callq 0x10d0
leaq 0x2bb9(%rip), %rsi      # 0x40c9
movq %rax, %rdi
callq 0x10e0
movq %rax, %rdi
callq 0x1070
leaq 0x2ba7(%rip), %rsi      # 0x40ce
movq %rbx, %rdi
callq 0x10e0
movl $0x31228, %esi          # imm = 0x31228
movq %rax, %rdi
callq 0x10a0
movq %rax, %rdi
movq %r14, %rsi
callq 0x10e0
movq %rax, %rdi
callq 0x1070
leaq 0x2b87(%rip), %rsi      # 0x40dd
movq %rbx, %rdi
callq 0x10e0
movq %rax, %rdi
movl %r12d, %esi
callq 0x1160
movq %rax, %rdi
callq 0x1070
leaq 0x2b6e(%rip), %rsi      # 0x40e6
movq %rbx, %rdi
callq 0x10e0
movq %rax, %rdi
movl %r13d, %esi
callq 0x1160
movq %rax, %rdi
callq 0x1070
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
movq %rbp, %r15
movq %rbp, %rsi
callq 0x10e0
leaq 0x2aba(%rip), %rsi      # 0x406a
movq %rax, %rdi
callq 0x10e0
movq %rax, %rdi
callq 0x1070
callq 0x1040
movq %rax, %r14
movl 0x5b02(%rip), %edi      # 0x70d0
movq 0x5b03(%rip), %rsi      # 0x70d8
movl 0x5b05(%rip), %edx      # 0x70e0
callq 0x22dd
movq %rax, %rbp
movq %rax, %r13
shrq $0x20, %r13
callq 0x1040
subq %r14, %rax
cvtsi2sd %rax, %xmm0
divsd 0x2a09(%rip), %xmm0     # 0x4008
movsd %xmm0, (%rsp)
movq %rbx, %rdi
leaq 0x2ab4(%rip), %r12      # 0x40c2
movq %r12, %rsi
callq 0x10e0
movsd (%rsp), %xmm0
mulsd 0x29ed(%rip), %xmm0     # 0x4010
cvttsd2si %xmm0, %rsi
movq %rax, %rdi
callq 0x10d0
movq %rax, %rdi
leaq 0x2a8f(%rip), %rsi      # 0x40c9
callq 0x10e0
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
leaq 0x2a7d(%rip), %rsi      # 0x40ce
callq 0x10e0
movl $0x628, %esi            # imm = 0x628
movq %rax, %rdi
callq 0x10a0
movq %rax, %rdi
leaq 0x29f1(%rip), %rsi      # 0x405e
callq 0x10e0
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
leaq 0x2a59(%rip), %rsi      # 0x40dd
callq 0x10e0
movq %rax, %rdi
movl %ebp, %esi
callq 0x1160
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
leaq 0x2a41(%rip), %rsi      # 0x40e6
callq 0x10e0
movq %rax, %rdi
movl %r13d, %esi
callq 0x1160
movq %rax, %rdi
callq 0x1070
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
movq %r15, %rsi
callq 0x10e0
leaq 0x298d(%rip), %rsi      # 0x4064
movq %rax, %rdi
callq 0x10e0
movq %rax, %rdi
callq 0x1070
callq 0x1040
movq %rax, %r14
movl 0x59db(%rip), %edi      # 0x70d0
movq 0x59dc(%rip), %rsi      # 0x70d8
movl 0x59de(%rip), %edx      # 0x70e0
callq 0x281d
movq %rax, %rbp
movq %rax, %r13
shrq $0x20, %r13
callq 0x1040
subq %r14, %rax
cvtsi2sd %rax, %xmm0
divsd 0x28e2(%rip), %xmm0     # 0x4008
movsd %xmm0, (%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x10e0
movsd (%rsp), %xmm0
mulsd 0x28cd(%rip), %xmm0     # 0x4010
cvttsd2si %xmm0, %rsi
movq %rax, %rdi
callq 0x10d0
movq %rax, %rdi
leaq 0x296f(%rip), %rsi      # 0x40c9
callq 0x10e0
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
leaq 0x295d(%rip), %rsi      # 0x40ce
callq 0x10e0
movl $0x312c8, %esi          # imm = 0x312C8
movq %rax, %rdi
callq 0x10a0
movq %rax, %rdi
leaq 0x28d1(%rip), %rsi      # 0x405e
callq 0x10e0
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
leaq 0x2939(%rip), %rsi      # 0x40dd
callq 0x10e0
movq %rax, %rdi
movl %ebp, %esi
callq 0x1160
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
leaq 0x2921(%rip), %rsi      # 0x40e6
callq 0x10e0
movq %rax, %rdi
movl %r13d, %esi
callq 0x1160
movq %rax, %rdi
callq 0x1070
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
movq %r15, %rsi
callq 0x10e0
leaq 0x28aa(%rip), %rsi      # 0x40a1
movq %rax, %rdi
callq 0x10e0
movq %rax, %rdi
callq 0x1070
callq 0x1040
movq %rax, %r14
movl 0x58bb(%rip), %edi      # 0x70d0
movq 0x58bc(%rip), %rsi      # 0x70d8
movl 0x58be(%rip), %edx      # 0x70e0
callq 0x2c16
movq %rax, %rbp
movq %rax, %r13
shrq $0x20, %r13
callq 0x1040
subq %r14, %rax
cvtsi2sd %rax, %xmm0
divsd 0x27c2(%rip), %xmm0     # 0x4008
movsd %xmm0, (%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x10e0
movsd (%rsp), %xmm0
mulsd 0x27ad(%rip), %xmm0     # 0x4010
cvttsd2si %xmm0, %rsi
movq %rax, %rdi
callq 0x10d0
movq %rax, %rdi
leaq 0x284f(%rip), %rsi      # 0x40c9
callq 0x10e0
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
leaq 0x283d(%rip), %rsi      # 0x40ce
callq 0x10e0
movl $0x61a90, %esi          # imm = 0x61A90
movq %rax, %rdi
callq 0x10a0
movq %rax, %rdi
leaq 0x27b1(%rip), %rsi      # 0x405e
movq %rsi, %r15
callq 0x10e0
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
leaq 0x2816(%rip), %rsi      # 0x40dd
movq %rsi, %r12
callq 0x10e0
movq %rax, %rdi
movl %ebp, %esi
callq 0x1160
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
leaq 0x27fb(%rip), %rsi      # 0x40e6
callq 0x10e0
movq %rax, %rdi
movl %r13d, %esi
callq 0x1160
movq %rax, %rdi
callq 0x1070
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
leaq 0x27a6(%rip), %rsi      # 0x40bb
callq 0x10e0
leaq 0x2751(%rip), %rsi      # 0x4072
movq %rax, %rdi
callq 0x10e0
movq %rax, %rdi
callq 0x1070
callq 0x1040
movq %rax, %r14
movl 0x5791(%rip), %edi      # 0x70d0
movq 0x5792(%rip), %rsi      # 0x70d8
movl 0x5794(%rip), %edx      # 0x70e0
callq 0x2f36
movq %rax, %rbp
movq %rax, %r13
shrq $0x20, %r13
callq 0x1040
subq %r14, %rax
cvtsi2sd %rax, %xmm0
divsd 0x2698(%rip), %xmm0     # 0x4008
movsd %xmm0, (%rsp)
movq %rbx, %rdi
leaq 0x2743(%rip), %rsi      # 0x40c2
callq 0x10e0
movsd (%rsp), %xmm0
mulsd 0x267f(%rip), %xmm0     # 0x4010
cvttsd2si %xmm0, %rsi
movq %rax, %rdi
callq 0x10d0
movq %rax, %rdi
leaq 0x2721(%rip), %rsi      # 0x40c9
callq 0x10e0
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
leaq 0x270f(%rip), %rsi      # 0x40ce
callq 0x10e0
movl $0x4e6f8, %esi          # imm = 0x4E6F8
movq %rax, %rdi
callq 0x10a0
movq %rax, %rdi
movq %r15, %rsi
callq 0x10e0
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
movq %r12, %rsi
callq 0x10e0
movq %rax, %rdi
movl %ebp, %esi
callq 0x1160
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
leaq 0x26db(%rip), %rsi      # 0x40e6
callq 0x10e0
movq %rax, %rdi
movl %r13d, %esi
callq 0x1160
movq %rax, %rdi
callq 0x1070
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
leaq 0x2686(%rip), %rsi      # 0x40bb
callq 0x10e0
leaq 0x2644(%rip), %rsi      # 0x4085
movq %rax, %rdi
callq 0x10e0
movq %rax, %rdi
callq 0x1070
callq 0x1040
movq %rax, %r14
movl 0x5671(%rip), %edi      # 0x70d0
movq 0x5672(%rip), %rsi      # 0x70d8
movl 0x5674(%rip), %edx      # 0x70e0
callq 0x3322
movq %rax, %rbp
movq %rax, %r13
shrq $0x20, %r13
callq 0x1040
subq %r14, %rax
cvtsi2sd %rax, %xmm0
divsd 0x2578(%rip), %xmm0     # 0x4008
movsd %xmm0, (%rsp)
movq %rbx, %rdi
leaq 0x2623(%rip), %rsi      # 0x40c2
callq 0x10e0
movsd (%rsp), %xmm0
mulsd 0x255f(%rip), %xmm0     # 0x4010
cvttsd2si %xmm0, %rsi
movq %rax, %rdi
callq 0x10d0
movq %rax, %rdi
leaq 0x2601(%rip), %rsi      # 0x40c9
callq 0x10e0
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
leaq 0x25ef(%rip), %rsi      # 0x40ce
callq 0x10e0
movl $0x75310, %esi          # imm = 0x75310
movq %rax, %rdi
callq 0x10a0
movq %rax, %rdi
movq %r15, %rsi
callq 0x10e0
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
movq %r12, %rsi
callq 0x10e0
movq %rax, %rdi
movl %ebp, %esi
callq 0x1160
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
leaq 0x25bb(%rip), %rsi      # 0x40e6
callq 0x10e0
movq %rax, %rdi
movl %r13d, %esi
callq 0x1160
movq %rax, %rdi
callq 0x1070
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
leaq 0x2566(%rip), %rsi      # 0x40bb
callq 0x10e0
leaq 0x2537(%rip), %rsi      # 0x4098
movq %rax, %rdi
callq 0x10e0
movq %rax, %rdi
callq 0x1070
callq 0x1040
movq %rax, %r14
movl 0x5551(%rip), %edi      # 0x70d0
movq 0x5552(%rip), %rsi      # 0x70d8
movl 0x5554(%rip), %edx      # 0x70e0
callq 0x3633
movq %rax, %rbp
movq %rax, %r13
shrq $0x20, %r13
callq 0x1040
subq %r14, %rax
cvtsi2sd %rax, %xmm0
divsd 0x2458(%rip), %xmm0     # 0x4008
movsd %xmm0, (%rsp)
movq %rbx, %rdi
leaq 0x2503(%rip), %rsi      # 0x40c2
callq 0x10e0
movsd (%rsp), %xmm0
mulsd 0x243f(%rip), %xmm0     # 0x4010
cvttsd2si %xmm0, %rsi
movq %rax, %rdi
callq 0x10d0
movq %rax, %rdi
leaq 0x24e1(%rip), %rsi      # 0x40c9
callq 0x10e0
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
leaq 0x24cf(%rip), %rsi      # 0x40ce
callq 0x10e0
movl $0x61a90, %esi          # imm = 0x61A90
movq %rax, %rdi
callq 0x10a0
movq %rax, %rdi
movq %r15, %rsi
callq 0x10e0
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
movq %r12, %rsi
callq 0x10e0
movq %rax, %rdi
movl %ebp, %esi
callq 0x1160
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
leaq 0x249b(%rip), %rsi      # 0x40e6
callq 0x10e0
movq %rax, %rdi
movl %r13d, %esi
callq 0x1160
movq %rax, %rdi
callq 0x1070
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
leaq 0x2446(%rip), %rsi      # 0x40bb
callq 0x10e0
leaq 0x242d(%rip), %rsi      # 0x40ae
movq %rax, %rdi
callq 0x10e0
movq %rax, %rdi
callq 0x1070
callq 0x1040
movq %rax, %r14
movl 0x5431(%rip), %edi      # 0x70d0
movq 0x5432(%rip), %rsi      # 0x70d8
movl 0x5434(%rip), %edx      # 0x70e0
callq 0x38c0
movq %rax, %rbp
movq %rax, %r13
shrq $0x20, %r13
callq 0x1040
subq %r14, %rax
cvtsi2sd %rax, %xmm0
divsd 0x2338(%rip), %xmm0     # 0x4008
movsd %xmm0, (%rsp)
movq %rbx, %rdi
leaq 0x23e3(%rip), %rsi      # 0x40c2
callq 0x10e0
movsd (%rsp), %xmm0
mulsd 0x231f(%rip), %xmm0     # 0x4010
cvttsd2si %xmm0, %rsi
movq %rax, %rdi
callq 0x10d0
movq %rax, %rdi
leaq 0x23c1(%rip), %rsi      # 0x40c9
callq 0x10e0
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
leaq 0x23af(%rip), %rsi      # 0x40ce
callq 0x10e0
movl $0x30d48, %esi          # imm = 0x30D48
movq %rax, %rdi
callq 0x10a0
movq %rax, %rdi
movq %r15, %rsi
callq 0x10e0
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
movq %r12, %rsi
callq 0x10e0
movq %rax, %rdi
movl %ebp, %esi
callq 0x1160
movq %rax, %rdi
callq 0x1070
movq %rbx, %rdi
leaq 0x237b(%rip), %rsi      # 0x40e6
callq 0x10e0
movq %rax, %rdi
movl %r13d, %esi
callq 0x1160
movq %rax, %rdi
callq 0x1070
movq %rax, %rdi
callq 0x1070
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1da0
jmp 0x1da0
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1060
movq %rbx, %rdi
callq 0x1170