#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*/ printf(char *, ...);
int randomInteger(char, char);
int /*<<< orphan*/ randomize();
void randomWord(int times) {
  int letterLenght;
  randomize();
  for (int i = 0; i < times; i++) {
    letterLenght = randomInteger(2, 8);
    for (int j = 0; j < letterLenght; j++) {
      printf("%c", randomInteger('A', 'Z'));
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<randomWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <randomize@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11c3 <randomWord+0x93>
mov    $0x2,%edi
mov    $0x8,%esi
call   1040 <randomInteger@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11a7 <randomWord+0x77>
mov    $0x41,%edi
mov    $0x5a,%esi
call   1040 <randomInteger@plt>
mov    %eax,%esi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    116e <randomWord+0x3e>
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1149 <randomWord+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomWord>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <randomize@plt>
test   %r14d,%r14d
jg     1162 <randomWord+0x32>
pop    %rbx
pop    %r14
pop    %rbp
ret
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    %r14d,%ebx
je     1145 <randomWord+0x15>
mov    $0x2,%edi
mov    $0x8,%esi
call   1040 <randomInteger@plt>
mov    %eax,%ebp
test   %eax,%eax
jle    1150 <randomWord+0x20>
nopw   0x0(%rax,%rax,1)
mov    $0x41,%edi
mov    $0x5a,%esi
call   1040 <randomInteger@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1180 <randomWord+0x50>
jmp    1150 <randomWord+0x20>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @randomWord(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = call i32 (...) @randomize()
store i32 0, i32* %4
br label %7
7: ; preds = %25, %1
%8 = load i32, i32* %4
%9 = load i32, i32* %2
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %28
11: ; preds = %7
%12 = call i32 @randomInteger(i8 signext 2, i8 signext 8)
store i32 %12, i32* %3
store i32 0, i32* %5
br label %13
13: ; preds = %20, %11
%14 = load i32, i32* %5
%15 = load i32, i32* %3
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %23
17: ; preds = %13
%18 = call i32 @randomInteger(i8 signext 65, i8 signext 90)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %17
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %13
23: ; preds = %13
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %25
25: ; preds = %23
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %7
28: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @randomWord(i32 %0) {
%2 = tail call i32 (...) @randomize()
%3 = icmp sgt i32 %0, 0
br i1 %3, label %5, label %4
4: ; preds = %9, %1
ret void
5: ; preds = %1, %9
%6 = phi i32 [ %11, %9 ], [ 0, %1 ]
%7 = tail call i32 @randomInteger(i8 signext 2, i8 signext 8)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %13, %5
%10 = tail call i32 @putchar(i32 10)
%11 = add nuw nsw i32 %6, 1
%12 = icmp eq i32 %11, %0
br i1 %12, label %4, label %5
13: ; preds = %5, %13
%14 = phi i32 [ %17, %13 ], [ 0, %5 ]
%15 = tail call i32 @randomInteger(i8 signext 65, i8 signext 90)
%16 = tail call i32 @putchar(i32 %15)
%17 = add nuw nsw i32 %14, 1
%18 = icmp eq i32 %17, %7
br i1 %18, label %9, label %13
}