#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 isprng();
int /*<<< orphan*/ print_sprng();
int /*<<< orphan*/ printf(char *, ...);
double sprng();
main() {
  int seed, i, irn;
  double rn;
  init_sprng(985456376, 0);
  printf(" Print 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);
  }
  printf(" Printing 3 random integers in [0,2^31):\n");
  for (i = 0; i < 3; i++) {
    irn = isprng();
    printf("%16d\n", irn);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3abcdef8,%edi
xor    %esi,%esi
call   1070 <init_sprng@plt>
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <print_sprng@plt>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    11cc <main+0x7c>
mov    $0x0,%al
call   1060 <sprng@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe95(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1195 <main+0x45>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1214 <main+0xc4>
mov    $0x0,%al
call   1030 <isprng@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11e1 <main+0x91>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3abcdef8,%edi
xor    %esi,%esi
call   1080 <init_sprng@plt>
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <print_sprng@plt>
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <sprng@plt>
lea    0xe66(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <sprng@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <sprng@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xe87(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <isprng@plt>
lea    0xe24(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <isprng@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <isprng@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c" Print 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"
@.str.3 = [42 x i8] c" Printing 3 random integers in [0,2^31):\0A\00"
@.str.4 = [6 x i8] c"%16d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 0, i32* %1
%6 = call i32 @init_sprng(i32 985456376, i32 0)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @print_sprng()
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %10
10: ; preds = %17, %0
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 3
br i1 %12, label %13, label %20
13: ; preds = %10
%14 = call double (...) @sprng()
store double %14, double* %5
%15 = load double, double* %5
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %15)
br label %17
17: ; preds = %13
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %10
20: ; preds = %10
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %3
br label %22
22: ; preds = %29, %20
%23 = load i32, i32* %3
%24 = icmp slt i32 %23, 3
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = call i32 (...) @isprng()
store i32 %26, i32* %4
%27 = load i32, i32* %4
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %27)
br label %29
29: ; preds = %25
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %22
32: ; preds = %22
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
@.str.2 = [4 x i8] c"%f\0A\00"
@.str.4 = [6 x i8] c"%16d\0A\00"
@str = [37 x i8] c" Print information about new stream:\00"
@str.5 = [37 x i8] c" Printing 3 random numbers in [0,1):\00"
@str.6 = [41 x i8] c" Printing 3 random integers in [0,2^31):\00"
define i32 @main() {
%1 = tail call i32 @init_sprng(i32 985456376, i32 0)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @print_sprng()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.5, i64 0, i64 0))
%5 = tail call double (...) @sprng()
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %5)
%7 = tail call double (...) @sprng()
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %7)
%9 = tail call double (...) @sprng()
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %9)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.6, i64 0, i64 0))
%12 = tail call i32 (...) @isprng()
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %12)
%14 = tail call i32 (...) @isprng()
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %14)
%16 = tail call i32 (...) @isprng()
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %16)
ret i32 0
}