#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*/ puts(char *);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
main() {
  auto j;
  char s[64];
  srand(time(0));
  while (1) {
    auto n = rand() % 64;
    for (j = 0; j < n; j++)
      s[j] = rand() % 26 + 'a';
    s[j] = 0;
    puts(s);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %edx,-0x54(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x54(%rbp),%eax
jge    11ac <main+0x6c>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x61,%edx
mov    %dl,%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0x50(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1176 <main+0x36>
movslq -0x8(%rbp),%rax
movb   $0x0,-0x50(%rbp,%rax,1)
lea    -0x50(%rbp),%rdi
call   1030 <puts@plt>
jmp    115d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x48,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    %rsp,%r14
jmp    1171 <main+0x31>
xchg   %ax,%ax
mov    %r15d,%eax
mov    %eax,%eax
movb   $0x0,(%rsp,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <rand@plt>
mov    %eax,%r15d
lea    0x3f(%r15),%eax
test   %r15d,%r15d
cmovns %r15d,%eax
and    $0xffffffc0,%eax
sub    %eax,%r15d
mov    $0x0,%eax
test   %r15d,%r15d
jle    1163 <main+0x23>
mov    %r15d,%r12d
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
add    $0x61,%al
mov    %al,(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    11a0 <main+0x60>
jmp    1160 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [64 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @time(i32 0)
%6 = call i32 @srand(i32 %5)
br label %7
7: ; preds = %0, %25
%8 = call i32 (...) @rand()
%9 = srem i32 %8, 64
store i32 %9, i32* %4
store i32 0, i32* %2
br label %10
10: ; preds = %22, %7
%11 = load i32, i32* %2
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %25
14: ; preds = %10
%15 = call i32 (...) @rand()
%16 = srem i32 %15, 26
%17 = add nsw i32 %16, 97
%18 = trunc i32 %17 to i8
%19 = load i32, i32* %2
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 %20
store i8 %18, i8* %21
br label %22
22: ; preds = %14
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %10
25: ; preds = %10
%26 = load i32, i32* %2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 %27
store i8 0, i8* %28
%29 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%30 = call i32 @puts(i8* %29)
br label %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @time(i32 0)
%4 = tail call i32 @srand(i32 %3)
br label %5
5: ; preds = %20, %0
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, 64
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %20
9: ; preds = %5
%10 = zext i32 %7 to i64
br label %11
11: ; preds = %9, %11
%12 = phi i64 [ 0, %9 ], [ %18, %11 ]
%13 = tail call i32 (...) @rand()
%14 = srem i32 %13, 26
%15 = trunc i32 %14 to i8
%16 = add nsw i8 %15, 97
%17 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 %12
store i8 %16, i8* %17
%18 = add nuw nsw i64 %12, 1
%19 = icmp eq i64 %18, %10
br i1 %19, label %20, label %11
20: ; preds = %11, %5
%21 = phi i32 [ 0, %5 ], [ %7, %11 ]
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 %22
store i8 0, i8* %23
%24 = call i32 @puts(i8* %2)
br label %5
}