#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 */
char EOF;
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
main() {
  int wordcount[26];
  int i, j;
  for (i = 0; i < 26; i++) {
    wordcount[i] = 0;
  }
  int length, max;
  max = 0;
  length = 0;
  char c;
  while ((c = getchar()) != EOF) {
    if (c >= 'a' && c <= 'z') {
      wordcount[c - 'a'] = wordcount[c - 'a'] + 1;
    }
    if (c >= 'A' && c <= 'Z') {
      wordcount[c - 'A'] = wordcount[c - 'A'] + 1;
    }
  }
  for (i = 0; i < 26; i++) {
    if (max < wordcount[i]) {
      max = wordcount[i];
    }
  }
  putchar('\n');
  printf("histogram with the bars horizontal:\n");
  for (i = 'A'; i < 'Z' + 1; i++) {
    printf("%c | ", i);
    for (j = 0; j < wordcount[i - 'A']; j++) {
      putchar('*');
    }
    putchar('\n');
  }
  putchar('\n');
  printf("histogram with the bars vertical:\n");
  for (i = max; i > 0; i--) {
    for (j = 'A'; j < 'Z' + 1; j++) {
      putchar(' ');
      if (i <= wordcount[j - 'A']) {
        putchar('*');
      } else {
        putchar(' ');
      }
    }
    putchar('\n');
  }
  for (i = 'A'; i < 'Z' + 1; i++) {
    printf("%2c", i);
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x74(%rbp)
cmpl   $0x1a,-0x74(%rbp)
jge    116d <main+0x3d>
movslq -0x74(%rbp),%rax
movl   $0x0,-0x70(%rbp,%rax,4)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1149 <main+0x19>
movl   $0x0,-0x80(%rbp)
movl   $0x0,-0x7c(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x81(%rbp)
movsbl %al,%eax
mov    0x2e56(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1228 <main+0xf8>
movsbl -0x81(%rbp),%eax
cmp    $0x61,%eax
jl     11e0 <main+0xb0>
movsbl -0x81(%rbp),%eax
cmp    $0x7a,%eax
jg     11e0 <main+0xb0>
movsbl -0x81(%rbp),%eax
sub    $0x61,%eax
cltq
mov    -0x70(%rbp,%rax,4),%ecx
add    $0x1,%ecx
movsbl -0x81(%rbp),%eax
sub    $0x61,%eax
cltq
mov    %ecx,-0x70(%rbp,%rax,4)
movsbl -0x81(%rbp),%eax
cmp    $0x41,%eax
jl     1223 <main+0xf3>
movsbl -0x81(%rbp),%eax
cmp    $0x5a,%eax
jg     1223 <main+0xf3>
movsbl -0x81(%rbp),%eax
sub    $0x41,%eax
cltq
mov    -0x70(%rbp,%rax,4),%ecx
add    $0x1,%ecx
movsbl -0x81(%rbp),%eax
sub    $0x41,%eax
cltq
mov    %ecx,-0x70(%rbp,%rax,4)
jmp    117b <main+0x4b>
movl   $0x0,-0x74(%rbp)
cmpl   $0x1a,-0x74(%rbp)
jge    1268 <main+0x138>
mov    -0x80(%rbp),%eax
movslq -0x74(%rbp),%rcx
cmp    -0x70(%rbp,%rcx,4),%eax
jge    1255 <main+0x125>
movslq -0x74(%rbp),%rax
mov    -0x70(%rbp,%rax,4),%eax
mov    %eax,-0x80(%rbp)
jmp    125a <main+0x12a>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    122f <main+0xff>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x41,-0x74(%rbp)
cmpl   $0x5b,-0x74(%rbp)
jge    12ef <main+0x1bf>
mov    -0x74(%rbp),%esi
lea    0xd8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x78(%rbp)
mov    -0x78(%rbp),%eax
mov    -0x74(%rbp),%ecx
sub    $0x41,%ecx
movslq %ecx,%rcx
cmp    -0x70(%rbp,%rcx,4),%eax
jge    12d7 <main+0x1a7>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    12a9 <main+0x179>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1287 <main+0x157>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd2b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x80(%rbp),%eax
mov    %eax,-0x74(%rbp)
cmpl   $0x0,-0x74(%rbp)
jle    138c <main+0x25c>
movl   $0x41,-0x78(%rbp)
cmpl   $0x5b,-0x78(%rbp)
jge    1374 <main+0x244>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x74(%rbp),%eax
mov    -0x78(%rbp),%ecx
sub    $0x41,%ecx
movslq %ecx,%rcx
cmp    -0x70(%rbp,%rcx,4),%eax
jg     1357 <main+0x227>
mov    $0x2a,%edi
call   1030 <putchar@plt>
jmp    1361 <main+0x231>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1366 <main+0x236>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    131e <main+0x1ee>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x74(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x74(%rbp)
jmp    130d <main+0x1dd>
movl   $0x41,-0x74(%rbp)
cmpl   $0x5b,-0x74(%rbp)
jge    13bc <main+0x28c>
mov    -0x74(%rbp),%esi
lea    0xca7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1393 <main+0x263>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x70,%rsp
pxor   %xmm0,%xmm0
movdqa %xmm0,0x50(%rsp)
movdqa %xmm0,0x40(%rsp)
movdqa %xmm0,0x30(%rsp)
movdqa %xmm0,0x20(%rsp)
movdqa %xmm0,0x10(%rsp)
movdqa %xmm0,(%rsp)
movq   $0x0,0x60(%rsp)
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <getchar@plt>
mov    0x2e5c(%rip),%rbp
cmp    0x0(%rbp),%al
jne    11b9 <main+0x79>
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %edx,%edx
xor    %edi,%edi
xor    %eax,%eax
xor    %ecx,%ecx
xor    %r15d,%r15d
xor    %esi,%esi
pxor   %xmm0,%xmm0
pxor   %xmm2,%xmm2
pxor   %xmm1,%xmm1
pxor   %xmm4,%xmm4
jmp    1245 <main+0x105>
mov    $0xffffff9f,%ecx
lea    0x20(%rcx),%rbx
jmp    11e6 <main+0xa6>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbq %al,%rax
add    %eax,%ecx
addl   $0x1,(%rsp,%rcx,4)
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    0x0(%rbp),%al
je     1200 <main+0xc0>
lea    -0x61(%rax),%edx
mov    $0xffffff9f,%ecx
cmp    $0x1a,%dl
jb     11d0 <main+0x90>
lea    -0x41(%rax),%edx
mov    %rbx,%rcx
cmp    $0x19,%dl
jbe    11d0 <main+0x90>
jmp    11da <main+0x9a>
mov    (%rsp),%ebp
mov    0x4(%rsp),%ebx
mov    0x8(%rsp),%r8d
mov    0xc(%rsp),%r9d
mov    0x10(%rsp),%edx
mov    0x14(%rsp),%edi
mov    0x18(%rsp),%eax
mov    0x1c(%rsp),%ecx
mov    0x20(%rsp),%r15d
movdqu 0x54(%rsp),%xmm1
movdqu 0x44(%rsp),%xmm2
movdqu 0x34(%rsp),%xmm0
movdqu 0x24(%rsp),%xmm4
xor    %esi,%esi
test   %ebp,%ebp
cmovns %ebp,%esi
movdqa %xmm4,%xmm3
pcmpgtd %xmm2,%xmm3
pand   %xmm3,%xmm4
pandn  %xmm2,%xmm3
por    %xmm4,%xmm3
movdqa %xmm0,%xmm2
pcmpgtd %xmm1,%xmm2
pand   %xmm2,%xmm0
pandn  %xmm1,%xmm2
por    %xmm0,%xmm2
movdqa %xmm3,%xmm0
pcmpgtd %xmm2,%xmm0
pand   %xmm0,%xmm3
pandn  %xmm2,%xmm0
por    %xmm3,%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,%ebp
cmp    %r15d,%ebp
cmovg  %ebp,%r15d
cmp    %ecx,%r15d
cmovle %ecx,%r15d
cmp    %eax,%r15d
cmovle %eax,%r15d
cmp    %edi,%r15d
cmovle %edi,%r15d
cmp    %edx,%r15d
cmovle %edx,%r15d
cmp    %r9d,%r15d
cmovle %r9d,%r15d
cmp    %r8d,%r15d
cmovle %r8d,%r15d
cmp    %ebx,%r15d
cmovle %ebx,%r15d
cmp    %esi,%r15d
cmovle %esi,%r15d
mov    0x64(%rsp),%r12d
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xcfe(%rip),%rdi
call   1040 <puts@plt>
mov    $0x41,%ebx
lea    0xce3(%rip),%r14
jmp    1334 <main+0x1f4>
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0x5b,%rbx
je     1361 <main+0x221>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x104(%rsp,%rbx,4),%ebp
test   %ebp,%ebp
jle    1320 <main+0x1e0>
nopl   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1350 <main+0x210>
jmp    1320 <main+0x1e0>
cmp    %r12d,%r15d
cmovl  %r12d,%r15d
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xcb5(%rip),%rdi
call   1040 <puts@plt>
test   %r15d,%r15d
jle    13dc <main+0x29c>
mov    $0x20,%ebx
nopl   0x0(%rax,%rax,1)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
cmp    (%rsp,%rbp,4),%r15d
mov    $0x2a,%edi
cmovg  %ebx,%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    $0x1a,%rbp
jne    13a0 <main+0x260>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    -0x1(%r15),%eax
cmp    $0x1,%r15d
mov    %eax,%r15d
jg     1390 <main+0x250>
lea    0xc23(%rip),%rbx
mov    %rbx,%rdi
mov    $0x41,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x42,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x43,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x44,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x45,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x46,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x47,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x48,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x49,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x4a,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x4b,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x4c,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x4d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x4e,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x4f,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x50,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x51,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x52,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x53,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x54,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x55,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x56,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x57,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x58,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x59,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x5a,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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