#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*/ init_sprng(int, int /*<<< orphan*/);
int make_new_seed();
int /*<<< orphan*/ print_sprng();
int /*<<< orphan*/ printf(char *, ...);
double sprng();
main() {
  int i, seed;
  double rn;
  seed = make_new_seed();
  init_sprng(seed, 0);
  printf(" Printing information about new stream\n");
  print_sprng();
  printf(" Printing 3 random numbers in [0,1):\n");
  for (i = 0; i < 3; i++) {
    rn = sprng();
    printf("%f\n", rn);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <make_new_seed@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
xor    %esi,%esi
call   1070 <init_sprng@plt>
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <print_sprng@plt>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11d4 <main+0x84>
mov    $0x0,%al
call   1060 <sprng@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe8f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    119d <main+0x4d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <make_new_seed@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1080 <init_sprng@plt>
lea    0xe8c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <print_sprng@plt>
lea    0xea0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <sprng@plt>
lea    0xe62(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <sprng@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <sprng@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c" Printing information about new stream\0A\00"
@.str.1 = [38 x i8] c" Printing 3 random numbers in [0,1):\0A\00"
@.str.2 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 (...) @make_new_seed()
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @init_sprng(i32 %6, i32 0)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @print_sprng()
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
br label %11
11: ; preds = %18, %0
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 3
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = call double (...) @sprng()
store double %15, double* %4
%16 = load double, double* %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %16)
br label %18
18: ; preds = %14
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %11
21: ; preds = %11
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@.str.2 = [4 x i8] c"%f\0A\00"
@str = [39 x i8] c" Printing information about new stream\00"
@str.3 = [37 x i8] c" Printing 3 random numbers in [0,1):\00"
define i32 @main() {
%1 = tail call i32 (...) @make_new_seed()
%2 = tail call i32 @init_sprng(i32 %1, i32 0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @print_sprng()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.3, i64 0, i64 0))
%6 = tail call double (...) @sprng()
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %6)
%8 = tail call double (...) @sprng()
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %8)
%10 = tail call double (...) @sprng()
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %10)
ret i32 0
}