#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 */
unsigned int getText(char **);
int /*<<< orphan*/ letterAnalysis(char **, unsigned int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ testWordLengthAnalysis(char **, unsigned int, int);
int /*<<< orphan*/ wordAnalysis(char **, unsigned int);
int main(void) {
  char *bufferPtr[10];
  unsigned int numOfLines = 0;
  numOfLines = getText(bufferPtr);
  if (numOfLines > 0) {
    letterAnalysis(bufferPtr, numOfLines);
    puts("");
    testWordLengthAnalysis(bufferPtr, numOfLines, 1);
    testWordLengthAnalysis(bufferPtr, numOfLines, 2);
    testWordLengthAnalysis(bufferPtr, numOfLines, 3);
    testWordLengthAnalysis(bufferPtr, numOfLines, 4);
    testWordLengthAnalysis(bufferPtr, numOfLines, 6);
    testWordLengthAnalysis(bufferPtr, numOfLines, 7);
    testWordLengthAnalysis(bufferPtr, numOfLines, 8);
    testWordLengthAnalysis(bufferPtr, numOfLines, 9);
    testWordLengthAnalysis(bufferPtr, numOfLines, 10);
    wordAnalysis(bufferPtr, numOfLines);
    void cleanUp(char **bufferPtr, int numOfLines);
    cleanUp(bufferPtr, numOfLines);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x64(%rbp)
lea    -0x60(%rbp),%rdi
call   1070 <getText@plt>
mov    %eax,-0x64(%rbp)
cmpl   $0x0,-0x64(%rbp)
jbe    1255 <main+0xf5>
lea    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%esi
call   1030 <letterAnalysis@plt>
lea    0xe61(%rip),%rdi
call   1040 <puts@plt>
lea    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%esi
mov    $0x1,%edx
call   1050 <testWordLengthAnalysis@plt>
lea    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%esi
mov    $0x2,%edx
call   1050 <testWordLengthAnalysis@plt>
lea    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%esi
mov    $0x3,%edx
call   1050 <testWordLengthAnalysis@plt>
lea    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%esi
mov    $0x4,%edx
call   1050 <testWordLengthAnalysis@plt>
lea    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%esi
mov    $0x6,%edx
call   1050 <testWordLengthAnalysis@plt>
lea    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%esi
mov    $0x7,%edx
call   1050 <testWordLengthAnalysis@plt>
lea    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%esi
mov    $0x8,%edx
call   1050 <testWordLengthAnalysis@plt>
lea    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%esi
mov    $0x9,%edx
call   1050 <testWordLengthAnalysis@plt>
lea    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%esi
mov    $0xa,%edx
call   1050 <testWordLengthAnalysis@plt>
lea    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%esi
call   1080 <wordAnalysis@plt>
lea    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%esi
call   1060 <cleanUp@plt>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %rsp,%rdi
call   1070 <getText@plt>
test   %eax,%eax
je     122b <main+0xcb>
mov    %eax,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <letterAnalysis@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
call   1050 <testWordLengthAnalysis@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x2,%edx
call   1050 <testWordLengthAnalysis@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x3,%edx
call   1050 <testWordLengthAnalysis@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x4,%edx
call   1050 <testWordLengthAnalysis@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x6,%edx
call   1050 <testWordLengthAnalysis@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x7,%edx
call   1050 <testWordLengthAnalysis@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x8,%edx
call   1050 <testWordLengthAnalysis@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x9,%edx
call   1050 <testWordLengthAnalysis@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0xa,%edx
call   1050 <testWordLengthAnalysis@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1080 <wordAnalysis@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1060 <cleanUp@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8*]
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%4 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 0
%5 = call i32 @getText(i8** %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ugt i32 %6, 0
br i1 %7, label %8, label %45
8: ; preds = %0
%9 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 0
%10 = load i32, i32* %3
%11 = call i32 @letterAnalysis(i8** %9, i32 %10)
%12 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%13 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 0
%14 = load i32, i32* %3
%15 = call i32 @testWordLengthAnalysis(i8** %13, i32 %14, i32 1)
%16 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 0
%17 = load i32, i32* %3
%18 = call i32 @testWordLengthAnalysis(i8** %16, i32 %17, i32 2)
%19 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 0
%20 = load i32, i32* %3
%21 = call i32 @testWordLengthAnalysis(i8** %19, i32 %20, i32 3)
%22 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 0
%23 = load i32, i32* %3
%24 = call i32 @testWordLengthAnalysis(i8** %22, i32 %23, i32 4)
%25 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 0
%26 = load i32, i32* %3
%27 = call i32 @testWordLengthAnalysis(i8** %25, i32 %26, i32 6)
%28 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 0
%29 = load i32, i32* %3
%30 = call i32 @testWordLengthAnalysis(i8** %28, i32 %29, i32 7)
%31 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 0
%32 = load i32, i32* %3
%33 = call i32 @testWordLengthAnalysis(i8** %31, i32 %32, i32 8)
%34 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 0
%35 = load i32, i32* %3
%36 = call i32 @testWordLengthAnalysis(i8** %34, i32 %35, i32 9)
%37 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 0
%38 = load i32, i32* %3
%39 = call i32 @testWordLengthAnalysis(i8** %37, i32 %38, i32 10)
%40 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 0
%41 = load i32, i32* %3
%42 = call i32 @wordAnalysis(i8** %40, i32 %41)
%43 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 0
%44 = load i32, i32* %3
br label %45
45: ; preds = %8, %0
%46 = load i32, i32* %1
ret i32 %46
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i8*]
%2 = bitcast [10 x i8*]* %1 to i8*
%3 = getelementptr inbounds [10 x i8*], [10 x i8*]* %1, i64 0, i64 0
%4 = call i32 @getText(i8** %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %19, label %6
6: ; preds = %0
%7 = call i32 @letterAnalysis(i8** %3, i32 %4)
%8 = call i32 @putchar(i32 10)
%9 = call i32 @testWordLengthAnalysis(i8** %3, i32 %4, i32 1)
%10 = call i32 @testWordLengthAnalysis(i8** %3, i32 %4, i32 2)
%11 = call i32 @testWordLengthAnalysis(i8** %3, i32 %4, i32 3)
%12 = call i32 @testWordLengthAnalysis(i8** %3, i32 %4, i32 4)
%13 = call i32 @testWordLengthAnalysis(i8** %3, i32 %4, i32 6)
%14 = call i32 @testWordLengthAnalysis(i8** %3, i32 %4, i32 7)
%15 = call i32 @testWordLengthAnalysis(i8** %3, i32 %4, i32 8)
%16 = call i32 @testWordLengthAnalysis(i8** %3, i32 %4, i32 9)
%17 = call i32 @testWordLengthAnalysis(i8** %3, i32 %4, i32 10)
%18 = call i32 @wordAnalysis(i8** %3, i32 %4)
br label %19
19: ; preds = %6, %0
ret i32 0
}