#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
char rand();
int /*<<< orphan*/ stdout;
int main(void) {
  FILE *f;
  f = freopen("input", "w", stdout);
  int i, k = 0;
  char c;
  for (i = 0; i < 100; i++) {
    if (k > 20) {
      printf("\n");
      k = 0;
    }
    c = rand();
    if (c % 67 == 0) {
      printf(" ");
    }
    printf("%c", 'a' + c % ('z' - 'a'));
    k++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
lea    0xeb1(%rip),%rdi
lea    0xeb0(%rip),%rsi
call   1040 <freopen@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    11f9 <main+0xc9>
cmpl   $0x14,-0x18(%rbp)
jle    1196 <main+0x66>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
mov    $0x43,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11c3 <main+0x93>
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x19(%rbp),%eax
mov    $0x19,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x61,%esi
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116d <main+0x3d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
lea    0xebc(%rip),%rdi
lea    0xebb(%rip),%rsi
call   1040 <freopen@plt>
mov    $0x64,%r14d
xor    %ebp,%ebp
jmp    11a8 <main+0x78>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <rand@plt>
mov    %eax,%ebx
movzbl %al,%eax
imul   $0x6b,%eax,%eax
add    $0x1,%al
cmp    $0x2,%al
jbe    11c0 <main+0x90>
movsbl %bl,%eax
lea    (%rax,%rax,4),%ecx
lea    (%rax,%rcx,8),%eax
movzwl %ax,%ecx
shr    $0xa,%eax
shr    $0xf,%ecx
add    %al,%cl
movzbl %cl,%eax
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,4),%eax
sub    %al,%bl
add    $0x61,%bl
movzbl %bl,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
add    $0xffffffff,%r14d
je     11cc <main+0x9c>
cmp    $0x15,%ebp
jl     1160 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %ebp,%ebp
jmp    1160 <main+0x30>
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1175 <main+0x45>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"input\00"
@.str.1 = [2 x i8] c"w\00"
@stdout = global i32 0
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [2 x i8] c" \00"
@.str.4 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 0, i32* %1
%6 = load i32, i32* @stdout
%7 = call i32* @freopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %6)
store i32* %7, i32** %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %8
8: ; preds = %32, %0
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 100
br i1 %10, label %11, label %35
11: ; preds = %8
%12 = load i32, i32* %4
%13 = icmp sgt i32 %12, 20
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %4
br label %16
16: ; preds = %14, %11
%17 = call signext i8 (...) @rand()
store i8 %17, i8* %5
%18 = load i8, i8* %5
%19 = sext i8 %18 to i32
%20 = srem i32 %19, 67
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %16
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %24
24: ; preds = %22, %16
%25 = load i8, i8* %5
%26 = sext i8 %25 to i32
%27 = srem i32 %26, 25
%28 = add nsw i32 97, %27
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %28)
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 1
store i32 %31, i32* %4
br label %32
32: ; preds = %24
%33 = load i32, i32* %3
%34 = add nsw i32 %33, 1
store i32 %34, i32* %3
br label %8
35: ; preds = %8
%36 = load i32, i32* %1
ret i32 %36
}

LLVM IR (-O2):
@.str = [6 x i8] c"input\00"
@.str.1 = [2 x i8] c"w\00"
@stdout = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32* @freopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %1)
br label %3
3: ; preds = %0, %16
%4 = phi i32 [ 0, %0 ], [ %22, %16 ]
%5 = phi i32 [ 0, %0 ], [ %21, %16 ]
%6 = icmp sgt i32 %5, 20
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @putchar(i32 10)
br label %9
9: ; preds = %7, %3
%10 = phi i32 [ 0, %7 ], [ %5, %3 ]
%11 = tail call signext i8 (...) @rand()
%12 = srem i8 %11, 67
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = tail call i32 @putchar(i32 32)
br label %16
16: ; preds = %14, %9
%17 = srem i8 %11, 25
%18 = add nsw i8 %17, 97
%19 = zext i8 %18 to i32
%20 = tail call i32 @putchar(i32 %19)
%21 = add nsw i32 %10, 1
%22 = add nuw nsw i32 %4, 1
%23 = icmp eq i32 %22, 100
br i1 %23, label %24, label %3
24: ; preds = %16
ret i32 0
}