#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
unsigned long xorshf96();
int main(void) {
  unsigned i, quantity = 100e6;
  float f;
  for (i = quantity / 2; i; i--) {
    xorshf96();
    xorshf96();
  }
  for (i = 0; i < 20; i++) {
    printf("%21.018lf\n", xorshf96() / ((~0UL >> 1) * 1.0) - 1.0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5f5e100,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1165 <main+0x45>
mov    $0x0,%al
call   1030 <xorshf96@plt>
mov    $0x0,%al
call   1030 <xorshf96@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    113f <main+0x1f>
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jae    11f4 <main+0xd4>
xor    %eax,%eax
call   1030 <xorshf96@plt>
movq   %rax,%xmm0
movaps 0xe77(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0xe7b(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe74(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe70(%rip),%xmm2
addsd  %xmm2,%xmm0
movaps %xmm0,%xmm2
cvttsd2si %xmm2,%rsi
mov    %rsi,%rcx
sar    $0x3f,%rcx
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
and    %rcx,%rax
or     %rax,%rsi
lea    0xe4f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116c <main+0x4c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0xfd050f80,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <xorshf96@plt>
xor    %eax,%eax
call   1030 <xorshf96@plt>
inc    %ebx
jne    1130 <main+0x10>
mov    $0x14,%ebp
lea    0xeea(%rip),%rbx
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <xorshf96@plt>
movq   %rax,%xmm0
punpckldq 0xe9c(%rip),%xmm0
subpd  0xea4(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
mulsd  0xea0(%rip),%xmm1
addsd  0xea0(%rip),%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,%rcx
sar    $0x3f,%rcx
subsd  0xe94(%rip),%xmm1
cvttsd2si %xmm1,%rsi
and    %rcx,%rsi
or     %rax,%rsi
mov    %rbx,%rdi
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%21.018lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
store i32 0, i32* %1
store i32 100000000, i32* %3
%5 = load i32, i32* %3
%6 = udiv i32 %5, 2
store i32 %6, i32* %2
br label %7
7: ; preds = %13, %0
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = call i64 (...) @xorshf96()
%12 = call i64 (...) @xorshf96()
br label %13
13: ; preds = %10
%14 = load i32, i32* %2
%15 = add i32 %14, -1
store i32 %15, i32* %2
br label %7
16: ; preds = %7
store i32 0, i32* %2
br label %17
17: ; preds = %27, %16
%18 = load i32, i32* %2
%19 = icmp ult i32 %18, 20
br i1 %19, label %20, label %30
20: ; preds = %17
%21 = call i64 (...) @xorshf96()
%22 = uitofp i64 %21 to double
%23 = fdiv double %22, 0x43E0000000000000
%24 = fsub double %23, 1.000000e+00
%25 = fptoui double %24 to i64
%26 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %25)
br label %27
27: ; preds = %20
%28 = load i32, i32* %2
%29 = add i32 %28, 1
store i32 %29, i32* %2
br label %17
30: ; preds = %17
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%21.018lf\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 50000000, %0 ], [ %5, %1 ]
%3 = tail call i64 (...) @xorshf96()
%4 = tail call i64 (...) @xorshf96()
%5 = add nsw i32 %2, -1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %1
7: ; preds = %1, %7
%8 = phi i32 [ %15, %7 ], [ 0, %1 ]
%9 = tail call i64 (...) @xorshf96()
%10 = uitofp i64 %9 to double
%11 = fmul double %10, 0x3C00000000000000
%12 = fadd double %11, -1.000000e+00
%13 = fptoui double %12 to i64
%14 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %13)
%15 = add nuw nsw i32 %8, 1
%16 = icmp eq i32 %15, 20
br i1 %16, label %17, label %7
17: ; preds = %7
ret i32 0
}