#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 *, ...);
main() {
  int c, i, j;
  int nchar[10];
  for (i = 0; i < 10; ++i)
    nchar[i] = 0;
  i = 0;
  while ((c = getchar()) != EOF) {
    if (c != ' ' && c != '\t' && c != '\n')
      i++;
    else {
      if (i < 10)
        nchar[i]++;
      i = 0;
    }
  }
  for (i = 1; i < 10; ++i) {
    printf("%d: ", i);
    for (j = 0; j < nchar[i]; ++j)
      printf("-");
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    115a <main+0x3a>
movslq -0xc(%rbp),%rax
movl   $0x0,-0x40(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e76(%rip),%rcx
cmp    (%rcx),%eax
je     11cb <main+0xab>
cmpl   $0x20,-0x8(%rbp)
je     11a6 <main+0x86>
cmpl   $0x9,-0x8(%rbp)
je     11a6 <main+0x86>
cmpl   $0xa,-0x8(%rbp)
je     11a6 <main+0x86>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11c6 <main+0xa6>
cmpl   $0xa,-0xc(%rbp)
jge    11bf <main+0x9f>
movslq -0xc(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x40(%rbp,%rax,4)
movl   $0x0,-0xc(%rbp)
jmp    1161 <main+0x41>
movl   $0x1,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    123d <main+0x11d>
mov    -0xc(%rbp),%esi
lea    0xe1a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
movslq -0xc(%rbp),%rcx
cmp    -0x40(%rbp,%rcx,4),%eax
jge    1221 <main+0x101>
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11f4 <main+0xd4>
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11d2 <main+0xb2>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x20(%rsp)
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e8d(%rip),%rbx
cmp    (%rbx),%eax
jne    1174 <main+0x44>
lea    0xe9a(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11ef <main+0xbf>
movabs $0x100000600,%r14
xor    %ecx,%ecx
jmp    11a2 <main+0x72>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ecx
mov    %ecx,%ebp
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %ebp,%ecx
cmp    (%rbx),%eax
je     11bf <main+0x8f>
cmp    $0x20,%eax
ja     1190 <main+0x60>
mov    %eax,%eax
bt     %rax,%r14
jae    1190 <main+0x60>
xor    %ebp,%ebp
cmp    $0x9,%ecx
jg     1195 <main+0x65>
movslq %ecx,%rax
addl   $0x1,(%rsp,%rax,4)
jmp    1195 <main+0x65>
mov    0x4(%rsp),%ebx
lea    0xe36(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebx,%ebx
jle    11ef <main+0xbf>
nopw   0x0(%rax,%rax,1)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    11e0 <main+0xb0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe00(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%ebx
test   %ebx,%ebx
jle    122f <main+0xff>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1220 <main+0xf0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdc0(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%ebx
test   %ebx,%ebx
jle    126f <main+0x13f>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1260 <main+0x130>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd80(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%ebx
test   %ebx,%ebx
jle    12af <main+0x17f>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    12a0 <main+0x170>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd40(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%ebx
test   %ebx,%ebx
jle    12ef <main+0x1bf>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    12e0 <main+0x1b0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd00(%rip),%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%ebx
test   %ebx,%ebx
jle    132f <main+0x1ff>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1320 <main+0x1f0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xcc0(%rip),%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rsp),%ebx
test   %ebx,%ebx
jle    136f <main+0x23f>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1360 <main+0x230>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xc80(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rsp),%ebx
test   %ebx,%ebx
jle    13af <main+0x27f>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    13a0 <main+0x270>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xc40(%rip),%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rsp),%ebx
test   %ebx,%ebx
jle    13ef <main+0x2bf>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    13e0 <main+0x2b0>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [5 x i8] c"%d: \00"
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [10 x i32]
store i32 0, i32* %1
store i32 0, i32* %3
br label %6
6: ; preds = %13, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 %11
store i32 0, i32* %12
br label %13
13: ; preds = %9
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %6
16: ; preds = %6
store i32 0, i32* %3
br label %17
17: ; preds = %43, %16
%18 = call i32 (...) @getchar()
store i32 %18, i32* %2
%19 = load i32, i32* @EOF
%20 = icmp ne i32 %18, %19
br i1 %20, label %21, label %44
21: ; preds = %17
%22 = load i32, i32* %2
%23 = icmp ne i32 %22, 32
br i1 %23, label %24, label %33
24: ; preds = %21
%25 = load i32, i32* %2
%26 = icmp ne i32 %25, 9
br i1 %26, label %27, label %33
27: ; preds = %24
%28 = load i32, i32* %2
%29 = icmp ne i32 %28, 10
br i1 %29, label %30, label %33
30: ; preds = %27
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %43
33: ; preds = %27, %24, %21
%34 = load i32, i32* %3
%35 = icmp slt i32 %34, 10
br i1 %35, label %36, label %42
36: ; preds = %33
%37 = load i32, i32* %3
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 %38
%40 = load i32, i32* %39
%41 = add nsw i32 %40, 1
store i32 %41, i32* %39
br label %42
42: ; preds = %36, %33
store i32 0, i32* %3
br label %43
43: ; preds = %42, %30
br label %17
44: ; preds = %17
store i32 1, i32* %3
br label %45
45: ; preds = %65, %44
%46 = load i32, i32* %3
%47 = icmp slt i32 %46, 10
br i1 %47, label %48, label %68
48: ; preds = %45
%49 = load i32, i32* %3
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %49)
store i32 0, i32* %4
br label %51
51: ; preds = %60, %48
%52 = load i32, i32* %4
%53 = load i32, i32* %3
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = icmp slt i32 %52, %56
br i1 %57, label %58, label %63
58: ; preds = %51
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %60
60: ; preds = %58
%61 = load i32, i32* %4
%62 = add nsw i32 %61, 1
store i32 %62, i32* %4
br label %51
63: ; preds = %51
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %65
65: ; preds = %63
%66 = load i32, i32* %3
%67 = add nsw i32 %66, 1
store i32 %67, i32* %3
br label %45
68: ; preds = %45
%69 = load i32, i32* %1
ret i32 %69
}

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