#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 */
scalar_t__ EOF;
int /*<<< orphan*/ isalnum(char);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ scanf(char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
int strlen(char *);
char tolower(char);
int main() {
  int cnt = 0, i, j;
  int caps = 0, sentence = 0, c_word = 0, s_word = 0, m_word = 0, l_word = 0;
  char str[64];
  printf("CSE 1030 Program Three - Ahmad Rashed - arashed31@gmail.com - CSP03 "
         "\n\n");
  while (scanf("%s", str) != EOF) {
    for (i = 0; i < strlen(str); i++) {
      if (str[i] > 64 && str[i] < 91) {
        caps++;
        str[i] = tolower(str[i]);
      }
      if (str[i] == '!' || str[i] == '?' || str[i] == '.') {
        sentence++;
        str[i + 1] = '\0';
      }
      if (!isalnum(str[i])) {
        for (j = i; j < strlen(str); j++) {
          str[j] = str[j + 1];
        }
        i--;
      }
    }
    if (strlen(str) < 6)
      s_word++;
    if (strlen(str) > 5 && strlen(str) < 12)
      m_word++;
    if (strlen(str) > 11)
      l_word++;
    if (!strcmp(str, "a"))
      c_word++;
    if (!strcmp(str, "is"))
      c_word++;
    if (!strcmp(str, "of"))
      c_word++;
    if (!strcmp(str, "the"))
      c_word++;
    if (!strcmp(str, "are"))
      c_word++;
    if (!strcmp(str, "that"))
      c_word++;
  }
  printf("%d short length words \n", s_word);
  printf("%d medium length words \n", m_word);
  printf("%d long length words \n", l_word);
  printf("%d capitalized words \n", caps);
  printf("%d common words \n", c_word);
  printf("%d sentences \n", sentence);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xe8b(%rip),%rdi
call   1080 <scanf@plt>
mov    0x2e20(%rip),%rcx
cmp    (%rcx),%rax
je     1430 <main+0x2d0>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x74(%rbp)
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x74(%rbp),%eax
cmp    %ecx,%eax
jge    12fc <main+0x19c>
movslq -0xc(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x40,%eax
jle    1239 <main+0xd9>
movslq -0xc(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x5b,%eax
jge    1239 <main+0xd9>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movslq -0xc(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%edi
call   1070 <tolower@plt>
mov    %al,%cl
movslq -0xc(%rbp),%rax
mov    %cl,-0x70(%rbp,%rax,1)
movslq -0xc(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x21,%eax
je     126f <main+0x10f>
movslq -0xc(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x3f,%eax
je     126f <main+0x10f>
movslq -0xc(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x2e,%eax
jne    1285 <main+0x125>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
movb   $0x0,-0x70(%rbp,%rax,1)
movslq -0xc(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%edi
call   1050 <isalnum@plt>
cmp    $0x0,%eax
jne    12e9 <main+0x189>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x78(%rbp)
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x78(%rbp),%eax
cmp    %ecx,%eax
jge    12e0 <main+0x180>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x70(%rbp,%rax,1),%cl
movslq -0x10(%rbp),%rax
mov    %cl,-0x70(%rbp,%rax,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    12a2 <main+0x142>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    12ee <main+0x18e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11d8 <main+0x78>
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x6,%eax
jge    1317 <main+0x1b7>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x5,%eax
jle    1344 <main+0x1e4>
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0xc,%eax
jge    1344 <main+0x1e4>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0xb,%eax
jle    135f <main+0x1ff>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xce0(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1381 <main+0x221>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xcc0(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    13a3 <main+0x243>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xca1(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    13c5 <main+0x265>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xc82(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    13e7 <main+0x287>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xc64(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1409 <main+0x2a9>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xc46(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    142b <main+0x2cb>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11b1 <main+0x51>
mov    -0x20(%rbp),%esi
lea    0xc25(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xc2c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xc34(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xc3a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xc40(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xc41(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
lea    0xf19(%rip),%rdi
call   1030 <puts@plt>
lea    0xe7f(%rip),%rdi
lea    0x20(%rsp),%rbp
mov    %rbp,%rsi
call   1080 <scanf@plt>
mov    0x2e53(%rip),%rcx
xor    %r14d,%r14d
mov    $0x0,%r15d
mov    $0x0,%r13d
mov    $0x0,%r12d
movl   $0x0,0xc(%rsp)
mov    $0x0,%ebx
cmp    (%rcx),%rax
jne    1233 <main+0xd3>
lea    0xe4b(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe52(%rip),%rdi
mov    0xc(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe59(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe60(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe66(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe67(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ebx,%ebx
movl   $0x0,0xc(%rsp)
xor    %r12d,%r12d
xor    %r13d,%r13d
xor    %r15d,%r15d
xor    %r14d,%r14d
jmp    1301 <main+0x1a1>
xchg   %ax,%ax
mov    %r13b,%r14b
mov    0x18(%rsp),%r12d
add    %r14d,%r12d
mov    %rbp,%rdi
call   1040 <strlen@plt>
xor    %ecx,%ecx
cmp    $0xc,%eax
setge  %cl
mov    0x1c(%rsp),%ebx
add    %ecx,%ebx
mov    0x20(%rsp),%eax
xor    %ecx,%ecx
cmp    $0x61,%ax
sete   %cl
mov    0x14(%rsp),%edi
add    %ecx,%edi
mov    %eax,%ecx
xor    $0x7369,%ecx
movzbl 0x22(%rsp),%edx
xor    %esi,%esi
or     %dx,%cx
sete   %sil
add    %edi,%esi
mov    %eax,%ecx
xor    $0x666f,%ecx
xor    %edi,%edi
or     %dx,%cx
sete   %dil
add    %esi,%edi
xor    %ecx,%ecx
cmp    $0x656874,%eax
sete   %cl
add    %edi,%ecx
xor    %edx,%edx
cmp    $0x657261,%eax
sete   %dl
add    %ecx,%edx
xor    $0x74616874,%eax
movzbl 0x24(%rsp),%ecx
xor    %r13d,%r13d
or     %eax,%ecx
sete   %r13b
add    %edx,%r13d
lea    0xd1c(%rip),%rdi
mov    %rbp,%rsi
call   1080 <scanf@plt>
mov    0x2cf5(%rip),%rcx
cmp    (%rcx),%rax
mov    0x10(%rsp),%r14d
je     11bc <main+0x5c>
mov    %rbp,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
mov    %ebx,0x1c(%rsp)
mov    %r12d,0x18(%rsp)
mov    %r13d,0x14(%rsp)
jle    13e0 <main+0x280>
xor    %r13d,%r13d
movabs $0x8000400200000000,%rbx
jmp    1356 <main+0x1f6>
xchg   %ax,%ax
add    $0xffffffff,%r13d
mov    %ebx,%r14d
movabs $0x8000400200000000,%rbx
add    $0x1,%r13d
mov    %rbp,%rdi
call   1040 <strlen@plt>
cmp    %eax,%r13d
jge    13e0 <main+0x280>
movslq %r13d,%r12
mov    0x20(%rsp,%r12,1),%al
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1377 <main+0x217>
add    $0x1,%r14d
movsbl %al,%edi
call   1070 <tolower@plt>
mov    %al,0x20(%rsp,%r12,1)
cmp    $0x3f,%al
ja     1390 <main+0x230>
movzbl %al,%ecx
bt     %rcx,%rbx
jae    1390 <main+0x230>
add    $0x1,%r15d
movslq %r13d,%rcx
movb   $0x0,0x1(%rcx,%rbp,1)
movsbl %al,%edi
call   1060 <isalnum@plt>
test   %eax,%eax
jne    1341 <main+0x1e1>
mov    %r14d,%ebx
mov    %rbp,%rdi
call   1040 <strlen@plt>
cmp    %eax,%r13d
jge    1330 <main+0x1d0>
nopl   0x0(%rax)
lea    0x1(%r12),%r14
movzbl 0x21(%rsp,%r12,1),%eax
mov    %al,0x20(%rsp,%r12,1)
mov    %rbp,%rdi
call   1040 <strlen@plt>
cltq
mov    %r14,%r12
cmp    %rax,%r14
jl     13b0 <main+0x250>
jmp    1330 <main+0x1d0>
nopw   0x0(%rax,%rax,1)
mov    %r14d,0x10(%rsp)
mov    %rbp,%rdi
call   1040 <strlen@plt>
xor    %r14d,%r14d
cmp    $0x6,%eax
setl   %r13b
mov    %rbp,%rdi
call   1040 <strlen@plt>
cmp    $0x6,%eax
jl     1250 <main+0xf0>
mov    %rbp,%rdi
call   1040 <strlen@plt>
xor    %ecx,%ecx
cmp    $0xc,%eax
setl   %cl
add    %ecx,0xc(%rsp)
jmp    1250 <main+0xf0>

LLVM IR (-O0):
@.str = [71 x i8] c"CSE 1030 Program Three - Ahmad Rashed - arashed31@gmail.com - CSP03 \0A\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.2 = [2 x i8] c"a\00"
@.str.3 = [3 x i8] c"is\00"
@.str.4 = [3 x i8] c"of\00"
@.str.5 = [4 x i8] c"the\00"
@.str.6 = [4 x i8] c"are\00"
@.str.7 = [5 x i8] c"that\00"
@.str.8 = [24 x i8] c"%d short length words \0A\00"
@.str.9 = [25 x i8] c"%d medium length words \0A\00"
@.str.10 = [23 x i8] c"%d long length words \0A\00"
@.str.11 = [23 x i8] c"%d capitalized words \0A\00"
@.str.12 = [18 x i8] c"%d common words \0A\00"
@.str.13 = [15 x i8] c"%d sentences \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [64 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %177, %0
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%15 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = load i64, i64* @EOF
%17 = icmp ne i64 %15, %16
br i1 %17, label %18, label %178
18: ; preds = %13
store i32 0, i32* %3
br label %19
19: ; preds = %107, %18
%20 = load i32, i32* %3
%21 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%22 = call i32 @strlen(i8* %21)
%23 = icmp slt i32 %20, %22
br i1 %23, label %24, label %110
24: ; preds = %19
%25 = load i32, i32* %3
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 %26
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp sgt i32 %29, 64
br i1 %30, label %31, label %49
31: ; preds = %24
%32 = load i32, i32* %3
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 %33
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp slt i32 %36, 91
br i1 %37, label %38, label %49
38: ; preds = %31
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
store i32 %40, i32* %5
%41 = load i32, i32* %3
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 %42
%44 = load i8, i8* %43
%45 = call signext i8 @tolower(i8 signext %44)
%46 = load i32, i32* %3
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 %47
store i8 %45, i8* %48
br label %49
49: ; preds = %38, %31, %24
%50 = load i32, i32* %3
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 %51
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = icmp eq i32 %54, 33
br i1 %55, label %70, label %56
56: ; preds = %49
%57 = load i32, i32* %3
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 %58
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = icmp eq i32 %61, 63
br i1 %62, label %70, label %63
63: ; preds = %56
%64 = load i32, i32* %3
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 %65
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
%69 = icmp eq i32 %68, 46
br i1 %69, label %70, label %77
70: ; preds = %63, %56, %49
%71 = load i32, i32* %6
%72 = add nsw i32 %71, 1
store i32 %72, i32* %6
%73 = load i32, i32* %3
%74 = add nsw i32 %73, 1
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 %75
store i8 0, i8* %76
br label %77
77: ; preds = %70, %63
%78 = load i32, i32* %3
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 %79
%81 = load i8, i8* %80
%82 = call i32 @isalnum(i8 signext %81)
%83 = icmp ne i32 %82, 0
br i1 %83, label %106, label %84
84: ; preds = %77
%85 = load i32, i32* %3
store i32 %85, i32* %4
br label %86
86: ; preds = %100, %84
%87 = load i32, i32* %4
%88 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%89 = call i32 @strlen(i8* %88)
%90 = icmp slt i32 %87, %89
br i1 %90, label %91, label %103
91: ; preds = %86
%92 = load i32, i32* %4
%93 = add nsw i32 %92, 1
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 %94
%96 = load i8, i8* %95
%97 = load i32, i32* %4
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 %98
store i8 %96, i8* %99
br label %100
100: ; preds = %91
%101 = load i32, i32* %4
%102 = add nsw i32 %101, 1
store i32 %102, i32* %4
br label %86
103: ; preds = %86
%104 = load i32, i32* %3
%105 = add nsw i32 %104, -1
store i32 %105, i32* %3
br label %106
106: ; preds = %103, %77
br label %107
107: ; preds = %106
%108 = load i32, i32* %3
%109 = add nsw i32 %108, 1
store i32 %109, i32* %3
br label %19
110: ; preds = %19
%111 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%112 = call i32 @strlen(i8* %111)
%113 = icmp slt i32 %112, 6
br i1 %113, label %114, label %117
114: ; preds = %110
%115 = load i32, i32* %8
%116 = add nsw i32 %115, 1
store i32 %116, i32* %8
br label %117
117: ; preds = %114, %110
%118 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%119 = call i32 @strlen(i8* %118)
%120 = icmp sgt i32 %119, 5
br i1 %120, label %121, label %128
121: ; preds = %117
%122 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%123 = call i32 @strlen(i8* %122)
%124 = icmp slt i32 %123, 12
br i1 %124, label %125, label %128
125: ; preds = %121
%126 = load i32, i32* %9
%127 = add nsw i32 %126, 1
store i32 %127, i32* %9
br label %128
128: ; preds = %125, %121, %117
%129 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%130 = call i32 @strlen(i8* %129)
%131 = icmp sgt i32 %130, 11
br i1 %131, label %132, label %135
132: ; preds = %128
%133 = load i32, i32* %10
%134 = add nsw i32 %133, 1
store i32 %134, i32* %10
br label %135
135: ; preds = %132, %128
%136 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%137 = call i32 @strcmp(i8* %136, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%138 = icmp ne i32 %137, 0
br i1 %138, label %142, label %139
139: ; preds = %135
%140 = load i32, i32* %7
%141 = add nsw i32 %140, 1
store i32 %141, i32* %7
br label %142
142: ; preds = %139, %135
%143 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%144 = call i32 @strcmp(i8* %143, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%145 = icmp ne i32 %144, 0
br i1 %145, label %149, label %146
146: ; preds = %142
%147 = load i32, i32* %7
%148 = add nsw i32 %147, 1
store i32 %148, i32* %7
br label %149
149: ; preds = %146, %142
%150 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%151 = call i32 @strcmp(i8* %150, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%152 = icmp ne i32 %151, 0
br i1 %152, label %156, label %153
153: ; preds = %149
%154 = load i32, i32* %7
%155 = add nsw i32 %154, 1
store i32 %155, i32* %7
br label %156
156: ; preds = %153, %149
%157 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%158 = call i32 @strcmp(i8* %157, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%159 = icmp ne i32 %158, 0
br i1 %159, label %163, label %160
160: ; preds = %156
%161 = load i32, i32* %7
%162 = add nsw i32 %161, 1
store i32 %162, i32* %7
br label %163
163: ; preds = %160, %156
%164 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%165 = call i32 @strcmp(i8* %164, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%166 = icmp ne i32 %165, 0
br i1 %166, label %170, label %167
167: ; preds = %163
%168 = load i32, i32* %7
%169 = add nsw i32 %168, 1
store i32 %169, i32* %7
br label %170
170: ; preds = %167, %163
%171 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%172 = call i32 @strcmp(i8* %171, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%173 = icmp ne i32 %172, 0
br i1 %173, label %177, label %174
174: ; preds = %170
%175 = load i32, i32* %7
%176 = add nsw i32 %175, 1
store i32 %176, i32* %7
br label %177
177: ; preds = %174, %170
br label %13
178: ; preds = %13
%179 = load i32, i32* %8
%180 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i32 %179)
%181 = load i32, i32* %9
%182 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0), i32 %181)
%183 = load i32, i32* %10
%184 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0), i32 %183)
%185 = load i32, i32* %5
%186 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0), i32 %185)
%187 = load i32, i32* %7
%188 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0), i32 %187)
%189 = load i32, i32* %6
%190 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i32 %189)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.3 = [3 x i8] c"is\00"
@.str.4 = [3 x i8] c"of\00"
@.str.7 = [5 x i8] c"that\00"
@.str.8 = [24 x i8] c"%d short length words \0A\00"
@.str.9 = [25 x i8] c"%d medium length words \0A\00"
@.str.10 = [23 x i8] c"%d long length words \0A\00"
@.str.11 = [23 x i8] c"%d capitalized words \0A\00"
@.str.12 = [18 x i8] c"%d common words \0A\00"
@.str.13 = [15 x i8] c"%d sentences \0A\00"
@str = [70 x i8] c"CSE 1030 Program Three - Ahmad Rashed - arashed31@gmail.com - CSP03 \0A\00"
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 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str, i64 0, i64 0))
%4 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
br i1 %6, label %108, label %7
7: ; preds = %0
%8 = bitcast [64 x i8]* %1 to i16*
%9 = bitcast [64 x i8]* %1 to i32*
br label %10
10: ; preds = %7, %76
%11 = phi i32 [ 0, %7 ], [ %81, %76 ]
%12 = phi i32 [ 0, %7 ], [ %77, %76 ]
%13 = phi i32 [ 0, %7 ], [ %68, %76 ]
%14 = phi i32 [ 0, %7 ], [ %104, %76 ]
%15 = phi i32 [ 0, %7 ], [ %64, %76 ]
%16 = phi i32 [ 0, %7 ], [ %63, %76 ]
%17 = call i32 @strlen(i8* %2)
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %62
19: ; preds = %10, %57
%20 = phi i32 [ %40, %57 ], [ %15, %10 ]
%21 = phi i32 [ %33, %57 ], [ %16, %10 ]
%22 = phi i32 [ %59, %57 ], [ 0, %10 ]
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = add i8 %25, -65
%27 = icmp ult i8 %26, 26
br i1 %27, label %28, label %31
28: ; preds = %19
%29 = add nsw i32 %21, 1
%30 = call signext i8 @tolower(i8 signext %25)
store i8 %30, i8* %24
br label %31
31: ; preds = %28, %19
%32 = phi i8 [ %30, %28 ], [ %25, %19 ]
%33 = phi i32 [ %29, %28 ], [ %21, %19 ]
switch i8 %32, label %39 [
i8 33, label %34
i8 63, label %34
i8 46, label %34
]
34: ; preds = %31, %31, %31
%35 = add nsw i32 %20, 1
%36 = add nsw i32 %22, 1
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 %37
store i8 0, i8* %38
br label %39
39: ; preds = %31, %34
%40 = phi i32 [ %35, %34 ], [ %20, %31 ]
%41 = call i32 @isalnum(i8 signext %32)
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %57
43: ; preds = %39
%44 = call i32 @strlen(i8* %2)
%45 = icmp slt i32 %22, %44
br i1 %45, label %46, label %55
46: ; preds = %43, %46
%47 = phi i64 [ %48, %46 ], [ %23, %43 ]
%48 = add nsw i64 %47, 1
%49 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 %48
%50 = load i8, i8* %49
%51 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 %47
store i8 %50, i8* %51
%52 = call i32 @strlen(i8* %2)
%53 = sext i32 %52 to i64
%54 = icmp slt i64 %48, %53
br i1 %54, label %46, label %55
55: ; preds = %46, %43
%56 = add nsw i32 %22, -1
br label %57
57: ; preds = %39, %55
%58 = phi i32 [ %22, %39 ], [ %56, %55 ]
%59 = add nsw i32 %58, 1
%60 = call i32 @strlen(i8* %2)
%61 = icmp slt i32 %59, %60
br i1 %61, label %19, label %62
62: ; preds = %57, %10
%63 = phi i32 [ %16, %10 ], [ %33, %57 ]
%64 = phi i32 [ %15, %10 ], [ %40, %57 ]
%65 = call i32 @strlen(i8* %2)
%66 = icmp slt i32 %65, 6
%67 = zext i1 %66 to i32
%68 = add nuw nsw i32 %13, %67
%69 = call i32 @strlen(i8* %2)
%70 = icmp sgt i32 %69, 5
br i1 %70, label %71, label %76
71: ; preds = %62
%72 = call i32 @strlen(i8* %2)
%73 = icmp slt i32 %72, 12
%74 = zext i1 %73 to i32
%75 = add nsw i32 %12, %74
br label %76
76: ; preds = %71, %62
%77 = phi i32 [ %12, %62 ], [ %75, %71 ]
%78 = call i32 @strlen(i8* %2)
%79 = icmp sgt i32 %78, 11
%80 = zext i1 %79 to i32
%81 = add nuw nsw i32 %11, %80
%82 = load i16, i16* %8
%83 = icmp eq i16 %82, 97
%84 = zext i1 %83 to i32
%85 = add nsw i32 %14, %84
%86 = call i32 @bcmp(i8* dereferenceable(3) %2, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i64 3)
%87 = icmp eq i32 %86, 0
%88 = zext i1 %87 to i32
%89 = add nsw i32 %85, %88
%90 = call i32 @bcmp(i8* dereferenceable(3) %2, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i64 3)
%91 = icmp eq i32 %90, 0
%92 = zext i1 %91 to i32
%93 = add nsw i32 %89, %92
%94 = load i32, i32* %9
%95 = icmp eq i32 %94, 6645876
%96 = zext i1 %95 to i32
%97 = add nsw i32 %93, %96
%98 = icmp eq i32 %94, 6648417
%99 = zext i1 %98 to i32
%100 = add nsw i32 %97, %99
%101 = call i32 @bcmp(i8* dereferenceable(5) %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i64 5)
%102 = icmp eq i32 %101, 0
%103 = zext i1 %102 to i32
%104 = add nsw i32 %100, %103
%105 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%106 = load i64, i64* @EOF
%107 = icmp eq i64 %105, %106
br i1 %107, label %108, label %10
108: ; preds = %76, %0
%109 = phi i32 [ 0, %0 ], [ %63, %76 ]
%110 = phi i32 [ 0, %0 ], [ %64, %76 ]
%111 = phi i32 [ 0, %0 ], [ %104, %76 ]
%112 = phi i32 [ 0, %0 ], [ %68, %76 ]
%113 = phi i32 [ 0, %0 ], [ %77, %76 ]
%114 = phi i32 [ 0, %0 ], [ %81, %76 ]
%115 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i32 %112)
%116 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0), i32 %113)
%117 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0), i32 %114)
%118 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0), i32 %109)
%119 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0), i32 %111)
%120 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i32 %110)
ret i32 0
}