#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 */
double genrand();
int /*<<< orphan*/ printf(char *, ...);
main() {
  int j;
  for (j = 0; j < 100000; j++) {
    printf("%5f ", genrand());
    if (j % 8 == 7)
      printf("\n");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x186a0,-0x8(%rbp)
jge    118d <main+0x6d>
mov    $0x0,%al
call   1030 <genrand@plt>
lea    0xeaf(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x7,%edx
jne    117a <main+0x5a>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    117f <main+0x5f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rbx
xor    %ebp,%ebp
jmp    114b <main+0x1b>
xchg   %ax,%ax
add    $0x1,%ebp
cmp    $0x186a0,%ebp
je     1170 <main+0x40>
xor    %eax,%eax
call   1030 <genrand@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %ebp,%eax
not    %eax
test   $0x7,%al
jne    1140 <main+0x10>
mov    $0xa,%edi
call   1040 <putchar@plt>
jmp    1140 <main+0x10>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
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
store i32 0, i32* %2
br label %3
3: ; preds = %15, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 100000
br i1 %5, label %6, label %18
6: ; preds = %3
%7 = call double (...) @genrand()
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %7)
%9 = load i32, i32* %2
%10 = srem i32 %9, 8
%11 = icmp eq i32 %10, 7
br i1 %11, label %12, label %14
12: ; preds = %6
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %6
br label %15
15: ; preds = %14
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %3
18: ; preds = %3
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%20 = load i32, i32* %1
ret i32 %20
}

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