#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 main() {
  int c, i, j, k, nwhite, nother;
  int ndigit[10], nchars[26];
  nwhite = nother = 0;
  for (i = 0; i < 10; i++)
    ndigit[i] = 0;
  for (i = 0; i < 26; i++)
    nchars[i] = 0;
  printf("Enter some lines of text, I will tally the results. Enter $ to "
         "break. \n\n");
  while ((c = getchar()) != EOF)
    if (c == '$')
      break;
    else if (c >= '0' && c <= '9')
      ++ndigit[c - '0'];
    else if (c >= 'a' && c <= 'z')
      ++nchars[c - 'a'];
    else if (c == ' ' || c == '\n' || c == '\t')
      ++nwhite;
    else
      ++nother;
  printf("digits = ");
  for (i = 0; i < 10; i++)
    printf(" %d", ndigit[i]);
  printf(", white space = %d, other = %d\n", nwhite, nother);
  printf("\n\n and now here is a histogram of it...\n\n");
  for (i = 0; i < 10; i++) {
    printf("%d = ", i);
    for (j = 0; j < ndigit[i]; j++)
      printf("-");
    if (i % 2 == 0) {
      for (k = 0; k < 50 - ndigit[i]; k++)
        printf(" ");
    } else
      printf("\n");
  }
  printf("\n\n");
  for (i = 0; i < 26; i++) {
    printf("%c = ", i + 'a');
    for (j = 0; j < nchars[i]; j++)
      printf("-");
    if (i % 2 == 0) {
      for (k = 0; k < 50 - nchars[i]; k++)
        printf(" ");
    } else
      printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    116b <main+0x4b>
movslq -0xc(%rbp),%rax
movl   $0x0,-0x50(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <main+0x27>
movl   $0x0,-0xc(%rbp)
cmpl   $0x1a,-0xc(%rbp)
jge    1199 <main+0x79>
movslq -0xc(%rbp),%rax
movl   $0x0,-0xc0(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1172 <main+0x52>
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e30(%rip),%rcx
cmp    (%rcx),%eax
je     1276 <main+0x156>
cmpl   $0x24,-0x8(%rbp)
jne    11cf <main+0xaf>
jmp    1276 <main+0x156>
cmpl   $0x30,-0x8(%rbp)
jl     11fb <main+0xdb>
cmpl   $0x39,-0x8(%rbp)
jg     11fb <main+0xdb>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
cltq
mov    -0x50(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x50(%rbp,%rax,4)
jmp    126c <main+0x14c>
cmpl   $0x61,-0x8(%rbp)
jl     122d <main+0x10d>
cmpl   $0x7a,-0x8(%rbp)
jg     122d <main+0x10d>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
cltq
mov    -0xc0(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc0(%rbp,%rax,4)
jmp    1267 <main+0x147>
cmpl   $0x20,-0x8(%rbp)
je     124b <main+0x12b>
cmpl   $0xa,-0x8(%rbp)
je     124b <main+0x12b>
cmpl   $0x9,-0x8(%rbp)
jne    1259 <main+0x139>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1262 <main+0x142>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1267 <main+0x147>
jmp    126c <main+0x14c>
jmp    1271 <main+0x151>
jmp    11a7 <main+0x87>
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    12b9 <main+0x199>
movslq -0xc(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%esi
lea    0xdaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    128b <main+0x16b>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xd91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    13a6 <main+0x286>
mov    -0xc(%rbp),%esi
lea    0xdab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
movslq -0xc(%rbp),%rcx
cmp    -0x50(%rbp,%rcx,4),%eax
jge    1331 <main+0x211>
lea    0xd8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1304 <main+0x1e4>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1385 <main+0x265>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
movslq -0xc(%rbp),%rdx
mov    $0x32,%ecx
sub    -0x50(%rbp,%rdx,4),%ecx
cmp    %ecx,%eax
jge    1380 <main+0x260>
lea    0xd42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    134c <main+0x22c>
jmp    1393 <main+0x273>
lea    0xcbb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1398 <main+0x278>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    12e2 <main+0x1c2>
lea    0xc99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x1a,-0xc(%rbp)
jge    1488 <main+0x368>
mov    -0xc(%rbp),%esi
add    $0x61,%esi
lea    0xcd7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
movslq -0xc(%rbp),%rcx
cmp    -0xc0(%rbp,%rcx,4),%eax
jge    1410 <main+0x2f0>
lea    0xcac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    13e0 <main+0x2c0>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1467 <main+0x347>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
movslq -0xc(%rbp),%rdx
mov    $0x32,%ecx
sub    -0xc0(%rbp,%rdx,4),%ecx
cmp    %ecx,%eax
jge    1462 <main+0x342>
lea    0xc60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    142b <main+0x30b>
jmp    1475 <main+0x355>
lea    0xbd9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    147a <main+0x35a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    13bb <main+0x29b>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movq   $0x0,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0xa0(%rsp)
movq   $0x0,0xb0(%rsp)
lea    0xe99(%rip),%rdi
call   1040 <puts@plt>
xor    %r14d,%r14d
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0x24,%eax
je     12c6 <main+0x186>
mov    0x2e28(%rip),%rbp
mov    $0x0,%r8d
mov    $0x0,%r9d
mov    $0x0,%esi
mov    $0x0,%edi
mov    $0x0,%r10d
mov    $0x0,%r12d
mov    $0x0,%r11d
mov    $0x0,%r15d
mov    $0x0,%r13d
mov    $0x0,%ebx
mov    $0x0,%ecx
cmp    0x0(%rbp),%eax
je     12e3 <main+0x1a3>
movabs $0x100000600,%r14
xor    %r15d,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
lea    -0x30(%rax),%ecx
cmp    $0x9,%ecx
ja     1240 <main+0x100>
mov    %ecx,%eax
addl   $0x1,0x20(%rsp,%rax,4)
jmp    1280 <main+0x140>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x61(%rax),%ecx
cmp    $0x19,%ecx
ja     1260 <main+0x120>
mov    %ecx,%eax
addl   $0x1,0x50(%rsp,%rax,4)
jmp    1280 <main+0x140>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    $0x20,%eax
ja     1272 <main+0x132>
mov    %eax,%eax
bt     %rax,%r14
jae    1272 <main+0x132>
add    $0x1,%ebx
jmp    1280 <main+0x140>
add    $0x1,%r15d
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0x24,%eax
je     1291 <main+0x151>
cmp    0x0(%rbp),%eax
jne    1220 <main+0xe0>
mov    %r15d,%ecx
mov    0x20(%rsp),%r13d
mov    0x24(%rsp),%r15d
mov    0x28(%rsp),%r11d
mov    0x2c(%rsp),%r12d
mov    0x30(%rsp),%r10d
mov    0x34(%rsp),%edi
mov    0x38(%rsp),%esi
mov    0x3c(%rsp),%r9d
mov    0x40(%rsp),%r8d
mov    0x44(%rsp),%r14d
jmp    12e3 <main+0x1a3>
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %esi,%esi
xor    %edi,%edi
xor    %r10d,%r10d
xor    %r12d,%r12d
xor    %r11d,%r11d
xor    %r15d,%r15d
xor    %r13d,%r13d
xor    %ebx,%ebx
xor    %ecx,%ecx
mov    %r10d,0x4(%rsp)
mov    %edi,0x8(%rsp)
mov    %esi,0xc(%rsp)
mov    %r9d,0x10(%rsp)
mov    %r8d,0x14(%rsp)
mov    %r14d,0x18(%rsp)
mov    %ecx,0x1c(%rsp)
lea    0xcf6(%rip),%rdi
xor    %eax,%eax
mov    %r11d,%ebp
call   1050 <printf@plt>
lea    0xcef(%rip),%r14
mov    %r14,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    0x4(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    0x8(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    0xc(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    0x10(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    0x14(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    0x18(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc65(%rip),%rdi
mov    %ebx,%esi
mov    0x1c(%rsp),%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xcc5(%rip),%rdi
call   1040 <puts@plt>
lea    0xc65(%rip),%r15
mov    $0x1,%r14d
xor    %ebp,%ebp
jmp    13f4 <main+0x2b4>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    $0xa,%rbp
je     1451 <main+0x311>
mov    %r15,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x20(%rsp,%rbp,4),%r12d
test   %r12d,%r12d
jle    141f <main+0x2df>
mov    %r12d,%ebx
nopl   (%rax)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1410 <main+0x2d0>
test   $0x1,%bpl
jne    13e0 <main+0x2a0>
cmp    $0x31,%r12d
jg     13ea <main+0x2aa>
mov    $0x32,%ebx
sub    %r12d,%ebx
cmp    $0x2,%ebx
cmovl  %r14d,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1440 <main+0x300>
jmp    13ea <main+0x2aa>
lea    0xc28(%rip),%rdi
call   1040 <puts@plt>
lea    0xbd0(%rip),%r15
mov    $0x1,%r14d
xor    %ebp,%ebp
jmp    1484 <main+0x344>
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    $0x1a,%rbp
je     14e1 <main+0x3a1>
lea    0x61(%rbp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x50(%rsp,%rbp,4),%r12d
test   %r12d,%r12d
jle    14af <main+0x36f>
mov    %r12d,%ebx
xchg   %ax,%ax
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    14a0 <main+0x360>
test   $0x1,%bpl
jne    1470 <main+0x330>
cmp    $0x31,%r12d
jg     147a <main+0x33a>
mov    $0x32,%ebx
sub    %r12d,%ebx
cmp    $0x2,%ebx
cmovl  %r14d,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    14d0 <main+0x390>
jmp    147a <main+0x33a>
xor    %eax,%eax
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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