#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 EOF;
int getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int main() {
  int c, i, j, wl, nw, state, max;
  int nword[20];
  for (i = 0; i < 20; ++i)
    nword[i] = 0;
  state = 0;
  wl = nw = 0;
  while ((c = getchar()) != EOF) {
    if (c == ' ' || c == '\n' || c == '\t') {
      if (wl > 20) {
        printf("\n***ERROR*** TOO MANY CHARS: %d\n", wl);
      } else if (wl > 0) {
        nword[wl - 1] = nword[wl - 1] + 1;
      }
      wl = 0;
      state = 0;
    } else if (state == 0) {
      state = 1;
      ++wl;
      ++nw;
    } else {
      ++wl;
    }
  }
  if (state == 1)
    nword[wl - 1]++;
  printf("Horizontal histogram of %d word lengths::\n", nw);
  for (i = 0; i < 20; ++i) {
    printf("WORD[%d]: ", i + 1);
    for (j = 0; j < nword[i]; ++j)
      putchar('.');
    putchar('\n');
  }
  printf("\n\nVeritcal histogram of %d word lengths::\n", nw);
  for (i = 0, max = 0; i < 20; ++i)
    if (nword[i] > max)
      max = nword[i];
  for (i = max; i > 0; --i) {
    for (j = 0; j < 20; ++j) {
      putchar(' ');
      putchar(' ');
      if (nword[j] >= i)
        putchar('.');
      else
        putchar(' ');
    }
    putchar('\n');
  }
  for (i = 0; i < 20; ++i)
    printf("===");
  putchar('\n');
  for (i = 0; i < 20; ++i)
    printf("%3d", i + 1);
  putchar('\n');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    116a <main+0x3a>
movslq -0xc(%rbp),%rax
movl   $0x0,-0x70(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <main+0x16>
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e58(%rip),%rcx
cmp    (%rcx),%eax
je     124e <main+0x11e>
cmpl   $0x20,-0x8(%rbp)
je     11b6 <main+0x86>
cmpl   $0xa,-0x8(%rbp)
je     11b6 <main+0x86>
cmpl   $0x9,-0x8(%rbp)
jne    1213 <main+0xe3>
cmpl   $0x14,-0x14(%rbp)
jle    11d6 <main+0xa6>
mov    -0x14(%rbp),%esi
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1200 <main+0xd0>
cmpl   $0x0,-0x14(%rbp)
jle    11fb <main+0xcb>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x70(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
cltq
mov    %ecx,-0x70(%rbp,%rax,4)
jmp    1200 <main+0xd0>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
jmp    1249 <main+0x119>
cmpl   $0x0,-0x1c(%rbp)
jne    123b <main+0x10b>
movl   $0x1,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1244 <main+0x114>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1249 <main+0x119>
jmp    117f <main+0x4f>
cmpl   $0x1,-0x1c(%rbp)
jne    126b <main+0x13b>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x70(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x70(%rbp,%rax,4)
mov    -0x18(%rbp),%esi
lea    0xdac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    12e9 <main+0x1b9>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xdb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
movslq -0xc(%rbp),%rcx
cmp    -0x70(%rbp,%rcx,4),%eax
jge    12d1 <main+0x1a1>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    12a8 <main+0x178>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1283 <main+0x153>
mov    -0x18(%rbp),%esi
lea    0xd64(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    1341 <main+0x211>
movslq -0xc(%rbp),%rax
mov    -0x70(%rbp,%rax,4),%eax
cmp    -0x20(%rbp),%eax
jle    132e <main+0x1fe>
movslq -0xc(%rbp),%rax
mov    -0x70(%rbp,%rax,4),%eax
mov    %eax,-0x20(%rbp)
jmp    1333 <main+0x203>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1308 <main+0x1d8>
mov    -0x20(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    13cb <main+0x29b>
movl   $0x0,-0x10(%rbp)
cmpl   $0x14,-0x10(%rbp)
jge    13b3 <main+0x283>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movslq -0x10(%rbp),%rax
mov    -0x70(%rbp,%rax,4),%eax
cmp    -0xc(%rbp),%eax
jl     1396 <main+0x266>
mov    $0x2e,%edi
call   1030 <putchar@plt>
jmp    13a0 <main+0x270>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    13a5 <main+0x275>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1358 <main+0x228>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1347 <main+0x217>
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    13f8 <main+0x2c8>
lea    0xc9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    13d2 <main+0x2a2>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    1435 <main+0x305>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xc66(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1409 <main+0x2d9>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
xor    %r15d,%r15d
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e7e(%rip),%r13
cmp    0x0(%r13),%eax
je     1204 <main+0xd4>
movabs $0x100000600,%r12
xor    %r14d,%r14d
xor    %r15d,%r15d
xor    %ebx,%ebx
jmp    11b1 <main+0x81>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0x1,%r14d
adc    $0x0,%r15d
mov    $0x1,%r14d
mov    $0x1,%bpl
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    0x0(%r13),%eax
je     11f7 <main+0xc7>
cmp    $0x20,%eax
ja     1190 <main+0x60>
mov    %eax,%eax
bt     %rax,%r12
jae    1190 <main+0x60>
xor    %ebp,%ebp
cmp    $0x15,%ebx
jge    11e0 <main+0xb0>
test   %ebx,%ebx
jle    11f0 <main+0xc0>
add    $0xffffffff,%ebx
addl   $0x1,(%rsp,%rbx,4)
xor    %ebx,%ebx
xor    %ebp,%ebp
jmp    11f2 <main+0xc2>
cs nopw 0x0(%rax,%rax,1)
lea    0xe19(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %ebx,%ebx
xor    %r14d,%r14d
jmp    11a4 <main+0x74>
test   %bpl,%bpl
je     1204 <main+0xd4>
movslq %ebx,%rax
addl   $0x1,-0x4(%rsp,%rax,4)
lea    0xe16(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe30(%rip),%r14
xor    %ebp,%ebp
jmp    1230 <main+0x100>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x14,%rbp
je     1261 <main+0x131>
mov    %rbp,%rbx
add    $0x1,%rbp
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp,%rbx,4),%ebx
test   %ebx,%ebx
jle    1220 <main+0xf0>
nopw   0x0(%rax,%rax,1)
mov    $0x2e,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1250 <main+0x120>
jmp    1220 <main+0xf0>
lea    0xdef(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%eax
mov    0xc(%rsp),%ebx
movdqa 0x30(%rsp),%xmm0
movdqa 0x10(%rsp),%xmm1
movdqa 0x40(%rsp),%xmm2
movdqa 0x20(%rsp),%xmm3
movdqa %xmm3,%xmm4
pcmpgtd %xmm2,%xmm4
pand   %xmm4,%xmm3
pandn  %xmm2,%xmm4
por    %xmm3,%xmm4
movdqa %xmm1,%xmm2
pcmpgtd %xmm0,%xmm2
pand   %xmm2,%xmm1
pandn  %xmm0,%xmm2
por    %xmm1,%xmm2
movdqa %xmm2,%xmm0
pcmpgtd %xmm4,%xmm0
pand   %xmm0,%xmm2
pandn  %xmm4,%xmm0
por    %xmm2,%xmm0
pshufd $0xee,%xmm0,%xmm1
movdqa %xmm0,%xmm2
pcmpgtd %xmm1,%xmm2
pand   %xmm2,%xmm0
pandn  %xmm1,%xmm2
por    %xmm0,%xmm2
pshufd $0x55,%xmm2,%xmm0
movdqa %xmm2,%xmm1
pcmpgtd %xmm0,%xmm1
pand   %xmm1,%xmm2
pandn  %xmm0,%xmm1
por    %xmm2,%xmm1
movd   %xmm1,%ecx
cmp    %ebx,%ecx
cmovg  %ecx,%ebx
mov    0x8(%rsp),%ecx
cmp    %ecx,%ebx
cmovle %ecx,%ebx
mov    0x4(%rsp),%ecx
cmp    %ecx,%ebx
cmovle %ecx,%ebx
cmp    %eax,%ebx
cmovle %eax,%ebx
test   %ebx,%ebx
jle    1383 <main+0x253>
mov    $0x20,%r14d
nopl   0x0(%rax)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
cmp    %ebx,(%rsp,%rbp,4)
mov    $0x2e,%edi
cmovl  %r14d,%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    $0x14,%rbp
jne    1340 <main+0x210>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
jg     1330 <main+0x200>
lea    0xcf8(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xc23(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xe,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x11,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x12,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [33 x i8] c"\0A***ERROR*** TOO MANY CHARS: %d\0A\00"
@.str.1 = [43 x i8] c"Horizontal histogram of %d word lengths::\0A\00"
@.str.2 = [11 x i8] c"WORD[%d]: \00"
@.str.3 = [43 x i8] c"\0A\0AVeritcal histogram of %d word lengths::\0A\00"
@.str.4 = [4 x i8] c"===\00"
@.str.5 = [4 x i8] c"%3d\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 [20 x i32]
store i32 0, i32* %1
store i32 0, i32* %3
br label %10
10: ; preds = %17, %0
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 20
br i1 %12, label %13, label %20
13: ; preds = %10
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 %15
store i32 0, i32* %16
br label %17
17: ; preds = %13
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %10
20: ; preds = %10
store i32 0, i32* %7
store i32 0, i32* %6
store i32 0, i32* %5
br label %21
21: ; preds = %68, %20
%22 = call i32 (...) @getchar()
store i32 %22, i32* %2
%23 = load i32, i32* @EOF
%24 = icmp ne i32 %22, %23
br i1 %24, label %25, label %69
25: ; preds = %21
%26 = load i32, i32* %2
%27 = icmp eq i32 %26, 32
br i1 %27, label %34, label %28
28: ; preds = %25
%29 = load i32, i32* %2
%30 = icmp eq i32 %29, 10
br i1 %30, label %34, label %31
31: ; preds = %28
%32 = load i32, i32* %2
%33 = icmp eq i32 %32, 9
br i1 %33, label %34, label %56
34: ; preds = %31, %28, %25
%35 = load i32, i32* %5
%36 = icmp sgt i32 %35, 20
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = load i32, i32* %5
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %38)
br label %55
40: ; preds = %34
%41 = load i32, i32* %5
%42 = icmp sgt i32 %41, 0
br i1 %42, label %43, label %54
43: ; preds = %40
%44 = load i32, i32* %5
%45 = sub nsw i32 %44, 1
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 %46
%48 = load i32, i32* %47
%49 = add nsw i32 %48, 1
%50 = load i32, i32* %5
%51 = sub nsw i32 %50, 1
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 %52
store i32 %49, i32* %53
br label %54
54: ; preds = %43, %40
br label %55
55: ; preds = %54, %37
store i32 0, i32* %5
store i32 0, i32* %7
br label %68
56: ; preds = %31
%57 = load i32, i32* %7
%58 = icmp eq i32 %57, 0
br i1 %58, label %59, label %64
59: ; preds = %56
store i32 1, i32* %7
%60 = load i32, i32* %5
%61 = add nsw i32 %60, 1
store i32 %61, i32* %5
%62 = load i32, i32* %6
%63 = add nsw i32 %62, 1
store i32 %63, i32* %6
br label %67
64: ; preds = %56
%65 = load i32, i32* %5
%66 = add nsw i32 %65, 1
store i32 %66, i32* %5
br label %67
67: ; preds = %64, %59
br label %68
68: ; preds = %67, %55
br label %21
69: ; preds = %21
%70 = load i32, i32* %7
%71 = icmp eq i32 %70, 1
br i1 %71, label %72, label %79
72: ; preds = %69
%73 = load i32, i32* %5
%74 = sub nsw i32 %73, 1
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 %75
%77 = load i32, i32* %76
%78 = add nsw i32 %77, 1
store i32 %78, i32* %76
br label %79
79: ; preds = %72, %69
%80 = load i32, i32* %6
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %80)
store i32 0, i32* %3
br label %82
82: ; preds = %103, %79
%83 = load i32, i32* %3
%84 = icmp slt i32 %83, 20
br i1 %84, label %85, label %106
85: ; preds = %82
%86 = load i32, i32* %3
%87 = add nsw i32 %86, 1
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %87)
store i32 0, i32* %4
br label %89
89: ; preds = %98, %85
%90 = load i32, i32* %4
%91 = load i32, i32* %3
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 %92
%94 = load i32, i32* %93
%95 = icmp slt i32 %90, %94
br i1 %95, label %96, label %101
96: ; preds = %89
%97 = call i32 @putchar(i8 signext 46)
br label %98
98: ; preds = %96
%99 = load i32, i32* %4
%100 = add nsw i32 %99, 1
store i32 %100, i32* %4
br label %89
101: ; preds = %89
%102 = call i32 @putchar(i8 signext 10)
br label %103
103: ; preds = %101
%104 = load i32, i32* %3
%105 = add nsw i32 %104, 1
store i32 %105, i32* %3
br label %82
106: ; preds = %82
%107 = load i32, i32* %6
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 %107)
store i32 0, i32* %3
store i32 0, i32* %8
br label %109
109: ; preds = %125, %106
%110 = load i32, i32* %3
%111 = icmp slt i32 %110, 20
br i1 %111, label %112, label %128
112: ; preds = %109
%113 = load i32, i32* %3
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 %114
%116 = load i32, i32* %115
%117 = load i32, i32* %8
%118 = icmp sgt i32 %116, %117
br i1 %118, label %119, label %124
119: ; preds = %112
%120 = load i32, i32* %3
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 %121
%123 = load i32, i32* %122
store i32 %123, i32* %8
br label %124
124: ; preds = %119, %112
br label %125
125: ; preds = %124
%126 = load i32, i32* %3
%127 = add nsw i32 %126, 1
store i32 %127, i32* %3
br label %109
128: ; preds = %109
%129 = load i32, i32* %8
store i32 %129, i32* %3
br label %130
130: ; preds = %156, %128
%131 = load i32, i32* %3
%132 = icmp sgt i32 %131, 0
br i1 %132, label %133, label %159
133: ; preds = %130
store i32 0, i32* %4
br label %134
134: ; preds = %151, %133
%135 = load i32, i32* %4
%136 = icmp slt i32 %135, 20
br i1 %136, label %137, label %154
137: ; preds = %134
%138 = call i32 @putchar(i8 signext 32)
%139 = call i32 @putchar(i8 signext 32)
%140 = load i32, i32* %4
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 %141
%143 = load i32, i32* %142
%144 = load i32, i32* %3
%145 = icmp sge i32 %143, %144
br i1 %145, label %146, label %148
146: ; preds = %137
%147 = call i32 @putchar(i8 signext 46)
br label %150
148: ; preds = %137
%149 = call i32 @putchar(i8 signext 32)
br label %150
150: ; preds = %148, %146
br label %151
151: ; preds = %150
%152 = load i32, i32* %4
%153 = add nsw i32 %152, 1
store i32 %153, i32* %4
br label %134
154: ; preds = %134
%155 = call i32 @putchar(i8 signext 10)
br label %156
156: ; preds = %154
%157 = load i32, i32* %3
%158 = add nsw i32 %157, -1
store i32 %158, i32* %3
br label %130
159: ; preds = %130
store i32 0, i32* %3
br label %160
160: ; preds = %165, %159
%161 = load i32, i32* %3
%162 = icmp slt i32 %161, 20
br i1 %162, label %163, label %168
163: ; preds = %160
%164 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %165
165: ; preds = %163
%166 = load i32, i32* %3
%167 = add nsw i32 %166, 1
store i32 %167, i32* %3
br label %160
168: ; preds = %160
%169 = call i32 @putchar(i8 signext 10)
store i32 0, i32* %3
br label %170
170: ; preds = %177, %168
%171 = load i32, i32* %3
%172 = icmp slt i32 %171, 20
br i1 %172, label %173, label %180
173: ; preds = %170
%174 = load i32, i32* %3
%175 = add nsw i32 %174, 1
%176 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %175)
br label %177
177: ; preds = %173
%178 = load i32, i32* %3
%179 = add nsw i32 %178, 1
store i32 %179, i32* %3
br label %170
180: ; preds = %170
%181 = call i32 @putchar(i8 signext 10)
%182 = load i32, i32* %1
ret i32 %182
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [33 x i8] c"\0A***ERROR*** TOO MANY CHARS: %d\0A\00"
@.str.1 = [43 x i8] c"Horizontal histogram of %d word lengths::\0A\00"
@.str.2 = [11 x i8] c"WORD[%d]: \00"
@.str.3 = [43 x i8] c"\0A\0AVeritcal histogram of %d word lengths::\0A\00"
@.str.4 = [4 x i8] c"===\00"
@.str.5 = [4 x i8] c"%3d\00"
define i32 @main() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to i8*
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %43, label %6
6: ; preds = %0, %28
%7 = phi i32 [ %33, %28 ], [ %3, %0 ]
%8 = phi i32 [ %32, %28 ], [ 0, %0 ]
%9 = phi i32 [ %30, %28 ], [ 0, %0 ]
%10 = phi i32 [ %29, %28 ], [ 0, %0 ]
switch i32 %7, label %23 [
i32 32, label %11
i32 10, label %11
i32 9, label %11
]
11: ; preds = %6, %6, %6
%12 = icmp sgt i32 %10, 20
br i1 %12, label %13, label %15
13: ; preds = %11
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %28
15: ; preds = %11
%16 = icmp sgt i32 %10, 0
br i1 %16, label %17, label %28
17: ; preds = %15
%18 = add nsw i32 %10, -1
%19 = zext i32 %18 to i64
%20 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = add nsw i32 %21, 1
store i32 %22, i32* %20
br label %28
23: ; preds = %6
%24 = icmp eq i32 %8, 0
%25 = add nsw i32 %10, 1
%26 = zext i1 %24 to i32
%27 = add nsw i32 %9, %26
br label %28
28: ; preds = %23, %13, %17, %15
%29 = phi i32 [ 0, %15 ], [ 0, %17 ], [ 0, %13 ], [ %25, %23 ]
%30 = phi i32 [ %9, %15 ], [ %9, %17 ], [ %9, %13 ], [ %27, %23 ]
%31 = phi i1 [ false, %15 ], [ false, %17 ], [ false, %13 ], [ true, %23 ]
%32 = phi i32 [ 0, %15 ], [ 0, %17 ], [ 0, %13 ], [ 1, %23 ]
%33 = tail call i32 (...) @getchar()
%34 = load i32, i32* @EOF
%35 = icmp eq i32 %33, %34
br i1 %35, label %36, label %6
36: ; preds = %28
br i1 %31, label %37, label %43
37: ; preds = %36
%38 = add nsw i32 %29, -1
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 %39
%41 = load i32, i32* %40
%42 = add nsw i32 %41, 1
store i32 %42, i32* %40
br label %43
43: ; preds = %0, %37, %36
%44 = phi i32 [ %30, %37 ], [ %30, %36 ], [ 0, %0 ]
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %44)
br label %46
46: ; preds = %43, %59
%47 = phi i64 [ 0, %43 ], [ %48, %59 ]
%48 = add nuw nsw i64 %47, 1
%49 = trunc i64 %48 to i32
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %49)
%51 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 %47
%52 = load i32, i32* %51
%53 = icmp sgt i32 %52, 0
br i1 %53, label %54, label %59
54: ; preds = %46, %54
%55 = phi i32 [ %57, %54 ], [ 0, %46 ]
%56 = tail call i32 @putchar(i8 signext 46)
%57 = add nuw nsw i32 %55, 1
%58 = icmp eq i32 %57, %52
br i1 %58, label %59, label %54
59: ; preds = %54, %46
%60 = tail call i32 @putchar(i8 signext 10)
%61 = icmp eq i64 %48, 20
br i1 %61, label %62, label %46
62: ; preds = %59
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 %44)
%64 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%65 = load i32, i32* %64
%66 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 1
%67 = load i32, i32* %66
%68 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 2
%69 = load i32, i32* %68
%70 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 3
%71 = load i32, i32* %70
%72 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 4
%73 = bitcast i32* %72 to <16 x i32>*
%74 = load <16 x i32>, <16 x i32>* %73
%75 = call i32 @llvm.vector.reduce.smax.v16i32(<16 x i32> %74)
%76 = icmp sgt i32 %75, %71
%77 = select i1 %76, i32 %75, i32 %71
%78 = icmp sgt i32 %77, %69
%79 = select i1 %78, i32 %77, i32 %69
%80 = icmp sgt i32 %79, %67
%81 = select i1 %80, i32 %79, i32 %67
%82 = icmp sgt i32 %81, %65
%83 = select i1 %82, i32 %81, i32 %65
%84 = icmp slt i32 %83, 1
br i1 %84, label %87, label %85
85: ; preds = %62, %141
%86 = phi i32 [ %143, %141 ], [ %83, %62 ]
br label %130
87: ; preds = %141, %62
%88 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%89 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%90 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%91 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%92 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%93 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%94 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%95 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%96 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%97 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%98 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%99 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%100 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%101 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%102 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%103 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%104 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%105 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%106 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%107 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%108 = tail call i32 @putchar(i8 signext 10)
%109 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 1)
%110 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 2)
%111 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 3)
%112 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 4)
%113 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 5)
%114 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 6)
%115 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 7)
%116 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 8)
%117 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 9)
%118 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 10)
%119 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 11)
%120 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 12)
%121 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 13)
%122 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 14)
%123 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 15)
%124 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 16)
%125 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 17)
%126 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 18)
%127 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 19)
%128 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 20)
%129 = tail call i32 @putchar(i8 signext 10)
ret i32 0
130: ; preds = %85, %130
%131 = phi i64 [ 0, %85 ], [ %139, %130 ]
%132 = tail call i32 @putchar(i8 signext 32)
%133 = tail call i32 @putchar(i8 signext 32)
%134 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 %131
%135 = load i32, i32* %134
%136 = icmp slt i32 %135, %86
%137 = select i1 %136, i8 32, i8 46
%138 = tail call i32 @putchar(i8 signext %137)
%139 = add nuw nsw i64 %131, 1
%140 = icmp eq i64 %139, 20
br i1 %140, label %141, label %130
141: ; preds = %130
%142 = tail call i32 @putchar(i8 signext 10)
%143 = add nsw i32 %86, -1
%144 = icmp sgt i32 %86, 1
br i1 %144, label %85, label %87
}