// File: /workspace/github_cpp_makefile_star2_O3/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 0xf22(%rip), %rdx       # 0x2020
callq 0x1040
testl %eax, %eax
js 0x1190
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 0x2ea4(%rip), %rbx      # 0x3fd0
leaq 0xeed(%rip), %r15       # 0x2020
cmpl $0x30, %eax
je 0x116f
cmpl $0x6b, %eax
je 0x1154
cmpl $0x78, %eax
je 0x1162
cmpl $0x6e, %eax
jne 0x117c
movq (%rbx), %rdi
callq 0x1080
movq %rax, %r14
jmp 0x117c
movq (%rbx), %rdi
callq 0x10a0
movl %eax, 0x4(%rsp)
jmp 0x117c
movq (%rbx), %rdi
callq 0x1080
movq %rax, %rbp
jmp 0x117c
movq (%rbx), %rdi
callq 0x1080
movq %rax, 0x18(%rsp)
movl %r13d, %edi
movq %r12, %rsi
movq %r15, %rdx
callq 0x1040
testl %eax, %eax
jns 0x1133
jmp 0x11aa
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 0x1050
movq 0x10(%r13), %rax
movq 0x18(%r13), %rcx
addq (%r13), %rax
cvtsi2sd %rax, %xmm0
addq 0x8(%r13), %rcx
cvtsi2sd %rcx, %xmm1
mulsd 0xe2a(%rip), %xmm1      # 0x2008
addsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
movl %ebp, %edi
movq 0x18(%rsp), %rbx
movl %ebx, %esi
callq 0x14bc
movq %rax, 0x8(%rsp)
leaq 0x38(%rsp), %r15
xorl %edi, %edi
movq %r15, %rsi
callq 0x1050
movq 0x10(%r15), %rax
movq 0x18(%r15), %rcx
addq (%r15), %rax
cvtsi2sd %rax, %xmm1
addq 0x8(%r15), %rcx
cvtsi2sd %rcx, %xmm0
mulsd 0xddd(%rip), %xmm0      # 0x2008
addsd %xmm1, %xmm0
subsd 0x10(%rsp), %xmm0
movq 0x2da4(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
leaq 0xde3(%rip), %rsi       # 0x2029
movsd %xmm0, 0x10(%rsp)
movq 0x8(%rsp), %rdx
movb $0x1, %al
callq 0x1090
leaq 0x38(%rsp), %r15
xorl %edi, %edi
movq %r15, %rsi
callq 0x1050
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 0x1050
movq 0x48(%rsp), %rax
movq 0x50(%rsp), %rcx
addq 0x38(%rsp), %rax
cvtsi2sd %rax, %xmm0
addq 0x40(%rsp), %rcx
cvtsi2sd %rcx, %xmm2
movsd 0xd47(%rip), %xmm1      # 0x2008
mulsd %xmm1, %xmm2
addsd %xmm0, %xmm2
movsd %xmm2, 0x8(%rsp)
movl %r14d, %edi
movl %ebx, %esi
callq 0x1533
movl %eax, %r15d
xorl %edi, %edi
movq %r13, %rsi
callq 0x1050
movq 0x48(%rsp), %rax
movq 0x50(%rsp), %rcx
addq 0x38(%rsp), %rax
cvtsi2sd %rax, %xmm0
addq 0x40(%rsp), %rcx
cvtsi2sd %rcx, %xmm1
mulsd 0xcfc(%rip), %xmm1      # 0x2008
addsd %xmm0, %xmm1
subsd 0x8(%rsp), %xmm1
movsd %xmm1, 0x8(%rsp)
xorl %edi, %edi
movq %r13, %rsi
callq 0x1050
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 0xca5(%rip), %xmm2      # 0x2010
movapd %xmm3, %xmm1
movsd 0xca1(%rip), %xmm0      # 0x2018
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
movl %r15d, %eax
cvtsi2sd %rax, %xmm0
divsd %xmm0, %xmm3
leaq 0xcc8(%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 0x1291
xorl %eax, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax,%rax)