// File: /workspace/github_cpp_makefile_star2_O1/attractivechaos[P]udb2/khashlpp/./../common.c
// Function: main
int main(int argc, char *argv[])
{
	uint32_t test_int(uint32_t n, uint32_t x0);
	int c;
	double t, t0;
	uint32_t i, m = 5, max = 50000000, n = 10000000, x0 = 1, step;
	uint64_t sum;
	long m0;

	while ((c = getopt(argc, argv, "n:x:0:k:")) >= 0) {
		if (c == 'n') n = atol(optarg);
		else if (c == 'x') max = atol(optarg);
		else if (c == '0') x0 = atol(optarg);
		else if (c == 'k') m = atoi(optarg);
	}

	t = cputime();
	sum = traverse_rng(max, x0);
	t0 = cputime() - t;
	fprintf(stderr, "CPU time spent on RNG: %.3f sec; total sum: %lu\n", t0, (unsigned long)sum);
	m0 = peakrss();

	step = (max - n) / m;
	for (i = 0; i <= m; ++i, n += step) {
		double t, mem, tpm;
		uint32_t size;
		t = cputime();
		size = test_int(n, x0);
		t = cputime() - t;
		mem = peakrss() - m0;
		tpm = (t - t0 * n / max) / n * 1e6;
		printf("%d\t%d\t%.3f\t%.3f\t%.4f\t%.4f\n", i, n, t, mem/1024./1024., tpm, mem / size);
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r12
movl %edi, %r13d
leaq 0xf12(%rip), %rdx       # 0x2020
callq 0x1040
testl %eax, %eax
js 0x11a0
pushq $0x1
popq %rcx
movq %rcx, 0x18(%rsp)
movl $0x989680, %r14d        # imm = 0x989680
movl $0x2faf080, %ebp        # imm = 0x2FAF080
pushq $0x5
popq %rcx
movl %ecx, 0x4(%rsp)
movq 0x2e94(%rip), %rbx      # 0x3fd0
leaq 0xedd(%rip), %r15       # 0x2020
cmpl $0x30, %eax
je 0x117f
cmpl $0x6b, %eax
je 0x1164
cmpl $0x78, %eax
je 0x1172
cmpl $0x6e, %eax
jne 0x118c
movq (%rbx), %rdi
callq 0x1080
movq %rax, %r14
jmp 0x118c
movq (%rbx), %rdi
callq 0x10b0
movl %eax, 0x4(%rsp)
jmp 0x118c
movq (%rbx), %rdi
callq 0x1080
movq %rax, %rbp
jmp 0x118c
movq (%rbx), %rdi
callq 0x1080
movq %rax, 0x18(%rsp)
movl %r13d, %edi
movq %r12, %rsi
movq %r15, %rdx
callq 0x1040
testl %eax, %eax
jns 0x1143
jmp 0x11ba
pushq $0x5
popq %rax
movl %eax, 0x4(%rsp)
movl $0x2faf080, %ebp        # imm = 0x2FAF080
movl $0x989680, %r14d        # imm = 0x989680
pushq $0x1
popq %rax
movq %rax, 0x18(%rsp)
xorl %r12d, %r12d
leaq 0x38(%rsp), %r13
xorl %edi, %edi
movq %r13, %rsi
callq 0x1060
movq 0x10(%r13), %rax
movq 0x18(%r13), %rcx
addq (%r13), %rax
cvtsi2sd %rax, %xmm0
addq 0x8(%r13), %rcx
cvtsi2sd %rcx, %xmm1
mulsd 0xe1a(%rip), %xmm1      # 0x2008
addsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
movl %ebp, %edi
movq 0x18(%rsp), %rbx
movl %ebx, %esi
callq 0x152c
movq %rax, 0x8(%rsp)
leaq 0x38(%rsp), %r15
xorl %edi, %edi
movq %r15, %rsi
callq 0x1060
movq 0x10(%r15), %rax
movq 0x18(%r15), %rcx
addq (%r15), %rax
cvtsi2sd %rax, %xmm1
addq 0x8(%r15), %rcx
cvtsi2sd %rcx, %xmm0
mulsd 0xdcd(%rip), %xmm0      # 0x2008
addsd %xmm1, %xmm0
subsd 0x10(%rsp), %xmm0
movq 0x2d94(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
leaq 0xdd3(%rip), %rsi       # 0x2029
movsd %xmm0, 0x10(%rsp)
movq 0x8(%rsp), %rdx
movb $0x1, %al
callq 0x10a0
leaq 0x38(%rsp), %r15
xorl %edi, %edi
movq %r15, %rsi
callq 0x1060
movq 0x20(%r15), %rax
movq %rax, 0x30(%rsp)
movq %rbp, %rcx
movl %ebp, %eax
subl %r14d, %eax
xorl %edx, %edx
movl 0x4(%rsp), %ebp
divl %ebp
movl %eax, 0x24(%rsp)
movl %ecx, %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x28(%rsp)
xorl %edi, %edi
movq %r13, %rsi
callq 0x1060
movq 0x48(%rsp), %rax
movq 0x50(%rsp), %rcx
addq 0x38(%rsp), %rax
cvtsi2sd %rax, %xmm0
addq 0x40(%rsp), %rcx
cvtsi2sd %rcx, %xmm2
movsd 0xd37(%rip), %xmm1      # 0x2008
mulsd %xmm1, %xmm2
addsd %xmm0, %xmm2
movsd %xmm2, 0x8(%rsp)
movl %r14d, %edi
movl %ebx, %esi
callq 0x15a3
movl %eax, %r15d
xorl %edi, %edi
movq %r13, %rsi
callq 0x1060
movq 0x48(%rsp), %rax
movq 0x50(%rsp), %rcx
addq 0x38(%rsp), %rax
cvtsi2sd %rax, %xmm0
addq 0x40(%rsp), %rcx
cvtsi2sd %rcx, %xmm1
mulsd 0xcec(%rip), %xmm1      # 0x2008
addsd %xmm0, %xmm1
subsd 0x8(%rsp), %xmm1
movsd %xmm1, 0x8(%rsp)
xorl %edi, %edi
movq %r13, %rsi
callq 0x1060
movq 0x58(%rsp), %rax
subq 0x30(%rsp), %rax
shlq $0xa, %rax
cvtsi2sd %rax, %xmm3
movl %r14d, %eax
cvtsi2sd %rax, %xmm0
movsd 0x10(%rsp), %xmm1
mulsd %xmm0, %xmm1
divsd 0x28(%rsp), %xmm1
movsd 0x8(%rsp), %xmm4
movapd %xmm4, %xmm2
subsd %xmm1, %xmm2
divsd %xmm0, %xmm2
mulsd 0xc95(%rip), %xmm2      # 0x2010
movapd %xmm3, %xmm1
movsd 0xc91(%rip), %xmm0      # 0x2018
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
movl %r15d, %eax
cvtsi2sd %rax, %xmm0
divsd %xmm0, %xmm3
leaq 0xcb8(%rip), %rdi       # 0x205a
movl %r12d, %esi
movl %r14d, %edx
movapd %xmm4, %xmm0
movb $0x4, %al
callq 0x1030
incl %r12d
addl 0x24(%rsp), %r14d
cmpl %ebp, %r12d
jbe 0x12a1
xorl %eax, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq