#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*/ ch;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
main() {
  char ch[15];
  char temp;
  int index, n;
  n = sizeof(ch) / sizeof ch[0];
  srand(time(0));
  for (index = 0; index < n; index++) {
    temp = rand() % 128;
    if ((temp >= 'A' && temp <= 'Z') || (temp >= 'a' && temp <= 'z'))
      ch[index] = temp;
    else
      index--;
  }
  printf("Supplied: ");
  for (index = 0; index < n; index++)
    printf("%c ", ch[index]);
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xf,-0x1c(%rbp)
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11eb <main+0xab>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x80,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x14(%rbp)
movsbl -0x14(%rbp),%eax
cmp    $0x41,%eax
jl     11a5 <main+0x65>
movsbl -0x14(%rbp),%eax
cmp    $0x5a,%eax
jle    11bf <main+0x7f>
movsbl -0x14(%rbp),%eax
cmp    $0x61,%eax
jl     11cf <main+0x8f>
movsbl -0x14(%rbp),%eax
cmp    $0x7a,%eax
jg     11cf <main+0x8f>
mov    -0x14(%rbp),%cl
movslq -0x18(%rbp),%rax
mov    %cl,-0x13(%rbp,%rax,1)
jmp    11d8 <main+0x98>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    11dd <main+0x9d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    116b <main+0x2b>
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1231 <main+0xf1>
movslq -0x18(%rbp),%rax
movsbl -0x13(%rbp,%rax,1),%esi
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1200 <main+0xc0>
lea    0xdd7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
xor    %ebx,%ebx
jmp    1181 <main+0x31>
nopw   0x0(%rax,%rax,1)
movslq %ebx,%rax
mov    %cl,0x1(%rsp,%rax,1)
lea    0x1(%rbx),%eax
cmp    $0xe,%ebx
mov    %eax,%ebx
jge    11b0 <main+0x60>
xor    %eax,%eax
call   1070 <rand@plt>
lea    0x7f(%rax),%edx
test   %eax,%eax
cmovns %eax,%edx
and    $0xffffff80,%edx
mov    %eax,%ecx
sub    %edx,%ecx
lea    -0x41(%rcx),%esi
cmp    $0x1a,%esi
jb     1170 <main+0x20>
neg    %edx
add    %edx,%eax
add    $0xffffff9f,%eax
cmp    $0x19,%eax
jbe    1170 <main+0x20>
add    $0xffffffff,%ebx
jmp    1177 <main+0x27>
lea    0xe49(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x1(%rsp),%esi
lea    0xe41(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x2(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x3(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x5(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x6(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x7(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x9(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xa(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xb(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xd(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xe(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Supplied: \00"
@.str.1 = [4 x i8] c"%c \00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i8]
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 15, i32* %5
%6 = call i32 @time(i32 0)
%7 = call i32 @srand(i32 %6)
store i32 0, i32* %4
br label %8
8: ; preds = %40, %0
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %43
12: ; preds = %8
%13 = call i32 (...) @rand()
%14 = srem i32 %13, 128
%15 = trunc i32 %14 to i8
store i8 %15, i8* %3
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sge i32 %17, 65
br i1 %18, label %19, label %23
19: ; preds = %12
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sle i32 %21, 90
br i1 %22, label %31, label %23
23: ; preds = %19, %12
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp sge i32 %25, 97
br i1 %26, label %27, label %36
27: ; preds = %23
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = icmp sle i32 %29, 122
br i1 %30, label %31, label %36
31: ; preds = %27, %19
%32 = load i8, i8* %3
%33 = load i32, i32* %4
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 %34
store i8 %32, i8* %35
br label %39
36: ; preds = %27, %23
%37 = load i32, i32* %4
%38 = add nsw i32 %37, -1
store i32 %38, i32* %4
br label %39
39: ; preds = %36, %31
br label %40
40: ; preds = %39
%41 = load i32, i32* %4
%42 = add nsw i32 %41, 1
store i32 %42, i32* %4
br label %8
43: ; preds = %8
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %45
45: ; preds = %56, %43
%46 = load i32, i32* %4
%47 = load i32, i32* %5
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %59
49: ; preds = %45
%50 = load i32, i32* %4
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 %51
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %54)
br label %56
56: ; preds = %49
%57 = load i32, i32* %4
%58 = add nsw i32 %57, 1
store i32 %58, i32* %4
br label %45
59: ; preds = %45
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%61 = load i32, i32* %1
ret i32 %61
}

LLVM IR (-O2):
@.str = [11 x i8] c"Supplied: \00"
@.str.1 = [4 x i8] c"%c \00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 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 = %0, %20
%6 = phi i32 [ 0, %0 ], [ %22, %20 ]
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, 128
%9 = add nsw i32 %8, -65
%10 = icmp ult i32 %9, 26
%11 = add nsw i32 %8, -97
%12 = icmp ult i32 %11, 26
%13 = select i1 %10, i1 true, i1 %12
br i1 %13, label %14, label %18
14: ; preds = %5
%15 = trunc i32 %8 to i8
%16 = sext i32 %6 to i64
%17 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 %16
store i8 %15, i8* %17
br label %20
18: ; preds = %5
%19 = add nsw i32 %6, -1
br label %20
20: ; preds = %14, %18
%21 = phi i32 [ %6, %14 ], [ %19, %18 ]
%22 = add nsw i32 %21, 1
%23 = icmp slt i32 %21, 14
br i1 %23, label %5, label %24
24: ; preds = %20
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%26 = load i8, i8* %2
%27 = sext i8 %26 to i32
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%29 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 1
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %31)
%33 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 2
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %35)
%37 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 3
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %39)
%41 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 4
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %43)
%45 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 5
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %47)
%49 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 6
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %51)
%53 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 7
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %55)
%57 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 8
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %59)
%61 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 9
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %63)
%65 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 10
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
%68 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %67)
%69 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 11
%70 = load i8, i8* %69
%71 = sext i8 %70 to i32
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %71)
%73 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 12
%74 = load i8, i8* %73
%75 = sext i8 %74 to i32
%76 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %75)
%77 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 13
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %79)
%81 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 14
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %83)
%85 = tail call i32 @putchar(i32 10)
ret i32 0
}