#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);
main() {
  int c;
  int count[10 + 1];
  int maxlen = 0;
  int maxcount = 0;
  int nc = 0;
  int cc = 0;
  int done = 0;
  int i, j;
  for (i = 0; i <= 10; ++i) {
    count[i] = 0;
  }
  while (done == 0) {
    c = getchar();
    if (done == 0) {
      if (c == ' ' || c == '\t' || c == '\n' || c == EOF) {
        if (nc <= 10) {
          if (nc > 0) {
            cc = ++count[nc - 1];
          }
        } else {
          cc = ++count[10];
        }
        if (nc > maxlen) {
          maxlen = nc;
        }
        if (cc > maxcount) {
          maxcount = cc;
        }
        nc = 0;
      } else {
        ++nc;
      }
    }
    if (c == EOF) {
      done = 1;
    }
  }
  printf("\n\nHORIZONTAL HISTOGRAM\n\n");
  printf("      +");
  for (i = 0; i <= maxcount; ++i) {
    putchar('-');
  }
  putchar('\n');
  for (i = 0; i <= 10; ++i) {
    if (i == 10) {
      printf(">%3d  | ", 10);
    } else {
      printf("%4d  | ", i + 1);
    }
    for (j = 0; j < maxcount; ++j) {
      if (count[i] > j) {
        putchar('*');
      }
    }
    putchar('\n');
  }
  printf("\n\nVERTIVAL HISTOGRAM\n\n");
  for (i = maxcount; i > 0; --i) {
    printf("%4d  | ", i);
    for (j = 0; j <= 10; ++j) {
      if (count[j] >= i) {
        printf("*  ");
      } else {
        printf("   ");
      }
    }
    putchar('\n');
  }
  printf("      +");
  for (i = 0; i <= 10; ++i) {
    printf("---");
  }
  printf("\n       ");
  for (i = 0; i < 10; ++i) {
    printf("%2d ", i + 1);
  }
  printf(">%d\n", 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
cmpl   $0xa,-0x58(%rbp)
jg     118d <main+0x5d>
movslq -0x58(%rbp),%rax
movl   $0x0,-0x40(%rbp,%rax,4)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    1169 <main+0x39>
jmp    1192 <main+0x62>
cmpl   $0x0,-0x54(%rbp)
jne    1278 <main+0x148>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x54(%rbp)
jne    125a <main+0x12a>
cmpl   $0x20,-0x8(%rbp)
je     11e0 <main+0xb0>
cmpl   $0x9,-0x8(%rbp)
je     11e0 <main+0xb0>
cmpl   $0xa,-0x8(%rbp)
je     11e0 <main+0xb0>
mov    -0x8(%rbp),%eax
mov    0x2e10(%rip),%rcx
cmp    (%rcx),%eax
jne    124c <main+0x11c>
cmpl   $0xa,-0x4c(%rbp)
jg     1210 <main+0xe0>
cmpl   $0x0,-0x4c(%rbp)
jle    120b <main+0xdb>
mov    -0x4c(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
mov    -0x40(%rbp,%rcx,4),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp,%rcx,4)
mov    %eax,-0x50(%rbp)
jmp    121c <main+0xec>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    %eax,-0x50(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x44(%rbp),%eax
jle    122e <main+0xfe>
mov    -0x4c(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x48(%rbp),%eax
jle    1240 <main+0x110>
mov    -0x50(%rbp),%eax
mov    %eax,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
jmp    1255 <main+0x125>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    125a <main+0x12a>
mov    -0x8(%rbp),%eax
mov    0x2d84(%rip),%rcx
cmp    (%rcx),%eax
jne    1273 <main+0x143>
movl   $0x1,-0x54(%rbp)
jmp    1192 <main+0x62>
lea    0xd81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd8c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x48(%rbp),%eax
jg     12bf <main+0x18f>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    129b <main+0x16b>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x58(%rbp)
cmpl   $0xa,-0x58(%rbp)
jg     1369 <main+0x239>
cmpl   $0xa,-0x58(%rbp)
jne    12fc <main+0x1cc>
lea    0xd36(%rip),%rdi
mov    $0xa,%esi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1310 <main+0x1e0>
mov    -0x58(%rbp),%esi
add    $0x1,%esi
lea    0xd21(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x48(%rbp),%eax
jge    1351 <main+0x221>
movslq -0x58(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
cmp    -0x5c(%rbp),%eax
jle    133e <main+0x20e>
mov    $0x2a,%edi
call   1030 <putchar@plt>
jmp    1343 <main+0x213>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1317 <main+0x1e7>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    12d0 <main+0x1a0>
lea    0xcc2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x48(%rbp),%eax
mov    %eax,-0x58(%rbp)
cmpl   $0x0,-0x58(%rbp)
jle    1406 <main+0x2d6>
mov    -0x58(%rbp),%esi
lea    0xc99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x5c(%rbp)
cmpl   $0xa,-0x5c(%rbp)
jg     13ee <main+0x2be>
movslq -0x5c(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
cmp    -0x58(%rbp),%eax
jl     13cd <main+0x29d>
lea    0xc88(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13db <main+0x2ab>
lea    0xc82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13e0 <main+0x2b0>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    139f <main+0x26f>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x58(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x58(%rbp)
jmp    137d <main+0x24d>
lea    0xc0c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x58(%rbp)
cmpl   $0xa,-0x58(%rbp)
jg     1441 <main+0x311>
lea    0xc21(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    141b <main+0x2eb>
lea    0xc09(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x58(%rbp)
cmpl   $0xa,-0x58(%rbp)
jge    1482 <main+0x352>
mov    -0x58(%rbp),%esi
add    $0x1,%esi
lea    0xbed(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    1456 <main+0x326>
lea    0xbd6(%rip),%rdi
mov    $0xa,%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
pxor   %xmm0,%xmm0
movdqu %xmm0,0x2c(%rsp)
movdqa %xmm0,0x20(%rsp)
movdqa %xmm0,0x10(%rsp)
mov    0x2e7d(%rip),%r15
movabs $0x100000600,%r14
xor    %ebp,%ebp
xor    %r12d,%r12d
xor    %r13d,%r13d
jmp    1199 <main+0x59>
nop
mov    0x38(%rsp),%ebp
add    $0x1,%ebp
mov    %ebp,0x38(%rsp)
cmp    %r13d,%ebp
cmovg  %ebp,%r13d
xor    %r12d,%r12d
cmp    %ecx,%eax
je     11da <main+0x9a>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    (%r15),%ecx
cmp    %ecx,%eax
je     11b4 <main+0x74>
cmp    $0x20,%eax
ja     11d2 <main+0x92>
mov    %eax,%edx
bt     %rdx,%r14
jae    11d2 <main+0x92>
cmp    $0xa,%r12d
jg     1180 <main+0x40>
test   %r12d,%r12d
jle    118b <main+0x4b>
add    $0xffffffff,%r12d
mov    0x10(%rsp,%r12,4),%ebp
add    $0x1,%ebp
mov    %ebp,0x10(%rsp,%r12,4)
jmp    118b <main+0x4b>
add    $0x1,%r12d
cmp    %ecx,%eax
jne    1199 <main+0x59>
lea    0xe53(%rip),%rdi
call   1040 <puts@plt>
lea    0xe13(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r13d,%r13d
js     120f <main+0xcf>
lea    0x1(%r13),%ebx
nopl   (%rax)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1200 <main+0xc0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xde8(%rip),%r14
lea    0xdea(%rip),%r15
xor    %r12d,%r12d
jmp    1244 <main+0x104>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12
cmp    $0xb,%r12
je     1298 <main+0x158>
cmp    $0xa,%r12
jne    1260 <main+0x120>
mov    %r14,%rdi
mov    $0xa,%esi
jmp    1268 <main+0x128>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0x1(%r12),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r13d,%r13d
jle    1230 <main+0xf0>
mov    0x10(%rsp,%r12,4),%ebx
xor    %ebp,%ebp
jmp    1288 <main+0x148>
nopl   (%rax)
add    $0x1,%ebp
cmp    %ebp,%r13d
je     1230 <main+0xf0>
cmp    %ebp,%ebx
jle    1280 <main+0x140>
mov    $0x2a,%edi
call   1030 <putchar@plt>
jmp    1280 <main+0x140>
lea    0xdad(%rip),%rdi
call   1040 <puts@plt>
test   %r13d,%r13d
jle    1408 <main+0x2c8>
mov    0x10(%rsp),%eax
mov    %eax,0xc(%rsp)
mov    0x14(%rsp),%r12d
mov    0x18(%rsp),%ebx
movups 0x2c(%rsp),%xmm0
movaps %xmm0,0x50(%rsp)
movdqu 0x1c(%rsp),%xmm0
movdqa %xmm0,0x40(%rsp)
lea    0xd4b(%rip),%rbp
lea    0xd37(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0xd1a(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %r13d,0xc(%rsp)
mov    %r14,%rdi
cmovl  %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %r13d,%r12d
mov    %r14,%rdi
cmovl  %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %r13d,%ebx
mov    %r14,%rdi
cmovl  %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movd   %r13d,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa %xmm0,%xmm1
pcmpgtd 0x50(%rsp),%xmm1
pcmpgtd 0x40(%rsp),%xmm0
packssdw %xmm1,%xmm0
packsswb %xmm0,%xmm0
pmovmskb %xmm0,%r15d
test   $0x1,%r15b
mov    %r14,%rdi
cmovne %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   $0x2,%r15b
mov    %r14,%rdi
cmovne %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   $0x4,%r15b
mov    %r14,%rdi
cmovne %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   $0x8,%r15b
mov    %r14,%rdi
cmovne %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   $0x10,%r15b
mov    %r14,%rdi
cmovne %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   $0x20,%r15b
mov    %r14,%rdi
cmovne %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   $0x40,%r15b
mov    %r14,%rdi
cmovne %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   $0x80,%r15b
mov    %r14,%rdi
cmovne %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    -0x1(%r13),%eax
cmp    $0x1,%r13d
mov    %eax,%r13d
jg     12f0 <main+0x1b0>
lea    0xbf1(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc00(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xb8f(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xb8a(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xaf2(%rip),%rdi
mov    $0xa,%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

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

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