#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*/ mersenne_twister_real();
int /*<<< orphan*/ mersenne_twister_seed(int);
int /*<<< orphan*/ print(char *, ...);
int main() {
  int j;
  mersenne_twister_seed(4357);
  for (j = 0; j < 1000; ++j) {
    print("%5f ", mersenne_twister_real());
    if (j % 8 == 7)
      print("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1105,%edi
call   1050 <mersenne_twister_seed@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    11a9 <main+0x79>
mov    $0x0,%al
call   1040 <mersenne_twister_real@plt>
mov    %eax,%esi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <print@plt>
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x7,%edx
jne    1196 <main+0x66>
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <print@plt>
jmp    119b <main+0x6b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1150 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1105,%edi
call   1050 <mersenne_twister_seed@plt>
lea    0xebb(%rip),%rbx
lea    0xeb9(%rip),%r14
xor    %ebp,%ebp
jmp    115b <main+0x2b>
add    $0x1,%ebp
cmp    $0x3e8,%ebp
je     1182 <main+0x52>
xor    %eax,%eax
call   1040 <mersenne_twister_real@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <print@plt>
mov    %ebp,%eax
not    %eax
test   $0x7,%al
jne    1150 <main+0x20>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <print@plt>
jmp    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%5f \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @mersenne_twister_seed(i32 4357)
store i32 0, i32* %2
br label %4
4: ; preds = %16, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 1000
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = call i32 (...) @mersenne_twister_real()
%9 = call i32 (i8*, ...) @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %2
%11 = srem i32 %10, 8
%12 = icmp eq i32 %11, 7
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = call i32 (i8*, ...) @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %7
br label %16
16: ; preds = %15
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %4
19: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%5f \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = tail call i32 @mersenne_twister_seed(i32 4357)
br label %2
2: ; preds = %0, %10
%3 = phi i32 [ 0, %0 ], [ %11, %10 ]
%4 = tail call i32 (...) @mersenne_twister_real()
%5 = tail call i32 (i8*, ...) @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = and i32 %3, 7
%7 = icmp eq i32 %6, 7
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, ...) @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %2, %8
%11 = add nuw nsw i32 %3, 1
%12 = icmp eq i32 %11, 1000
br i1 %12, label %13, label %2
13: ; preds = %10
ret i32 0
}