#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 getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
int toupper(int);
count_4(void) {
  int x, c, nr_maxim, state, lit, nre, words;
  nr_maxim = lit = nre = words = 0;
  int litere[27] = {0};
  state = 0;
  while ((c = getchar()) != '~') {
    if (c >= 'A' && c <= 'z') {
      c = toupper(c);
      litere[c - 'A']++;
      lit++;
      state = 1;
    } else if (c >= '0' && c <= '9') {
      nre++;
      state = 1;
    } else if (c == ' ' || c == '\t' || c == '\n')
      state = 0;
    if (state == 0) {
      words++;
      state = 1;
    }
  }
  printf("So you had %d words with %d letters and %d numbers\n\n\n", words, lit,
         nre);
  for (x = 0; x < 26; x++) {
    if (nr_maxim < litere[x]) {
      nr_maxim = litere[x];
    }
  }
  for (x = nr_maxim; x >= 0; x--) {
    while (x <= nr_maxim) {
      printf("Times x %d|", x + 1);
      break;
    }
    for (c = 0; c < 26; c++) {
      if (litere[c] >= x)
        printf(" * ");
      else
        printf(" - ");
    }
    putchar('\n');
    puts("---------------------------------------------------------------------"
         "-------------------");
  }
  printf("  Letter |");
  for (x = 65; x < 91; x++)
    printf(" %c ", x);
}


x86 assembly (clang, -O0):
<count_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x6c,%edx
call   1070 <memset@plt>
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1080 <getchar@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x7e,%eax
je     1278 <count_4+0x118>
cmpl   $0x41,-0xc(%rbp)
jl     1201 <count_4+0xa1>
cmpl   $0x7a,-0xc(%rbp)
jg     1201 <count_4+0xa1>
mov    -0xc(%rbp),%edi
call   1040 <toupper@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x41,%eax
cltq
mov    -0x90(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x90(%rbp,%rax,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
jmp    1259 <count_4+0xf9>
cmpl   $0x30,-0xc(%rbp)
jl     122a <count_4+0xca>
cmpl   $0x39,-0xc(%rbp)
jg     122a <count_4+0xca>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x1,-0x14(%rbp)
jmp    1254 <count_4+0xf4>
cmpl   $0x20,-0xc(%rbp)
je     1248 <count_4+0xe8>
cmpl   $0x9,-0xc(%rbp)
je     1248 <count_4+0xe8>
cmpl   $0xa,-0xc(%rbp)
jne    124f <count_4+0xef>
movl   $0x0,-0x14(%rbp)
jmp    1254 <count_4+0xf4>
jmp    1259 <count_4+0xf9>
cmpl   $0x0,-0x14(%rbp)
jne    1273 <count_4+0x113>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
movl   $0x1,-0x14(%rbp)
jmp    11a1 <count_4+0x41>
mov    -0x20(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xd78(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x1a,-0x8(%rbp)
jge    12d5 <count_4+0x175>
mov    -0x10(%rbp),%eax
movslq -0x8(%rbp),%rcx
cmp    -0x90(%rbp,%rcx,4),%eax
jge    12c2 <count_4+0x162>
movslq -0x8(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%eax
mov    %eax,-0x10(%rbp)
jmp    12c7 <count_4+0x167>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1296 <count_4+0x136>
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1387 <count_4+0x227>
jmp    12ea <count_4+0x18a>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     130a <count_4+0x1aa>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
lea    0xd33(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x1a,-0xc(%rbp)
jge    1363 <count_4+0x203>
movslq -0xc(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%eax
cmp    -0x8(%rbp),%eax
jl     1342 <count_4+0x1e2>
lea    0xd0c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1350 <count_4+0x1f0>
lea    0xcfd(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1355 <count_4+0x1f5>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1311 <count_4+0x1b1>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xcd6(%rip),%rdi
call   1050 <puts@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    12db <count_4+0x17b>
lea    0xd15(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x41,-0x8(%rbp)
cmpl   $0x5b,-0x8(%rbp)
jge    13c5 <count_4+0x265>
mov    -0x8(%rbp),%esi
lea    0xcfe(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    139c <count_4+0x23c>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_4>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x6c(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
xor    %r14d,%r14d
xor    %eax,%eax
call   1070 <getchar@plt>
cmp    $0x7e,%eax
jne    11d0 <count_4+0x80>
lea    0xe63(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1060 <printf@plt>
xor    %r8d,%r8d
xor    %esi,%esi
xor    %edi,%edi
xor    %ebx,%ebx
xor    %r15d,%r15d
xor    %r13d,%r13d
xor    %ecx,%ecx
pxor   %xmm2,%xmm2
pxor   %xmm1,%xmm1
pxor   %xmm3,%xmm3
pxor   %xmm4,%xmm4
jmp    12d8 <count_4+0x188>
lea    -0x41(%rax),%ecx
cmp    $0x3a,%ecx
jae    11f6 <count_4+0xa6>
mov    %eax,%edi
call   1040 <toupper@plt>
cltq
addl   $0x1,-0xf4(%rsp,%rax,4)
01
mov    $0x1,%ebx
xor    %r12d,%r12d
xor    %r14d,%r14d
jmp    120c <count_4+0xbc>
add    $0xffffffd0,%eax
xor    %r14d,%r14d
xor    %r12d,%r12d
cmp    $0xa,%eax
setae  %r14b
setb   %r12b
xor    %ebx,%ebx
xor    %eax,%eax
call   1070 <getchar@plt>
cmp    $0x7e,%eax
jne    15cc <count_4+0x47c>
mov    0x10(%rsp),%ebp
mov    0x14(%rsp),%eax
mov    0x18(%rsp),%ecx
mov    %ecx,0xc(%rsp)
mov    0x1c(%rsp),%ecx
mov    %ecx,0x8(%rsp)
mov    0x20(%rsp),%ecx
mov    %ecx,0x4(%rsp)
mov    0x24(%rsp),%ecx
mov    %ecx,(%rsp)
mov    0x28(%rsp),%r15d
mov    0x2c(%rsp),%r13d
movaps 0x60(%rsp),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0x50(%rsp),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0x40(%rsp),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0x30(%rsp),%xmm0
movaps %xmm0,0x80(%rsp)
lea    0xd78(%rip),%rdi
mov    %r14d,%esi
mov    %ebx,%edx
mov    %eax,%r14d
mov    %r12d,%ecx
xor    %eax,%eax
call   1060 <printf@plt>
movdqa 0x80(%rsp),%xmm4
movdqa 0xa0(%rsp),%xmm1
movdqa 0xb0(%rsp),%xmm3
movdqa 0x90(%rsp),%xmm2
mov    (%rsp),%ebx
mov    0x4(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%r8d
test   %ebp,%ebp
mov    $0x0,%ecx
cmovns %ebp,%ecx
movdqa %xmm4,%xmm0
pcmpgtd %xmm1,%xmm0
pand   %xmm0,%xmm4
pandn  %xmm1,%xmm0
por    %xmm4,%xmm0
movdqa %xmm2,%xmm1
pcmpgtd %xmm3,%xmm1
pand   %xmm1,%xmm2
pandn  %xmm3,%xmm1
por    %xmm2,%xmm1
movdqa %xmm0,%xmm2
pcmpgtd %xmm1,%xmm2
pand   %xmm2,%xmm0
pandn  %xmm1,%xmm2
por    %xmm0,%xmm2
pshufd $0xee,%xmm2,%xmm0
movdqa %xmm2,%xmm1
pcmpgtd %xmm0,%xmm1
pand   %xmm1,%xmm2
pandn  %xmm0,%xmm1
por    %xmm2,%xmm1
pshufd $0x55,%xmm1,%xmm0
movdqa %xmm1,%xmm2
pcmpgtd %xmm0,%xmm2
pand   %xmm2,%xmm1
pandn  %xmm0,%xmm2
por    %xmm1,%xmm2
movd   %xmm2,%eax
cmp    %r13d,%eax
cmovg  %eax,%r13d
cmp    %r15d,%r13d
cmovle %r15d,%r13d
cmp    %ebx,%r13d
cmovle %ebx,%r13d
cmp    %edi,%r13d
cmovle %edi,%r13d
cmp    %esi,%r13d
cmovle %esi,%r13d
cmp    %r8d,%r13d
cmovle %r8d,%r13d
cmp    %r14d,%r13d
cmovle %r14d,%r13d
cmp    %ecx,%r13d
cmovle %ecx,%r13d
mov    0x70(%rsp),%eax
cmp    %eax,%r13d
cmovl  %eax,%r13d
mov    0x74(%rsp),%eax
cmp    %eax,%r13d
cmovl  %eax,%r13d
lea    0xca7(%rip),%rbx
lea    0xc9c(%rip),%r12
lea    0xc9d(%rip),%r15
mov    %r13d,%ebp
jmp    13db <count_4+0x28b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
call   1050 <puts@plt>
lea    -0x1(%rbp),%eax
test   %ebp,%ebp
mov    %eax,%ebp
jle    1420 <count_4+0x2d0>
cmp    %r13d,%ebp
jg     13f1 <count_4+0x2a1>
lea    0x1(%rbp),%esi
lea    0xc4c(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %r14d,%r14d
jmp    1411 <count_4+0x2c1>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%r14
cmp    $0x1a,%r14
je     13c0 <count_4+0x270>
mov    %rbx,%rdi
cmp    %ebp,0x10(%rsp,%r14,4)
jl     1400 <count_4+0x2b0>
mov    %r12,%rdi
jmp    1400 <count_4+0x2b0>
lea    0xc7c(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xc79(%rip),%rbx
mov    %rbx,%rdi
mov    $0x41,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x42,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x43,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x44,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x45,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x46,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x47,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x48,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x49,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x4a,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x4b,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x4c,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x4d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x4e,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x4f,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x50,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x51,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x52,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x53,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x54,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x55,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x56,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x57,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x58,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x59,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x5a,%esi
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <printf@plt>
movabs $0x100000600,%rbp
jmp    1604 <count_4+0x4b4>
nopl   0x0(%rax,%rax,1)
mov    %eax,%edi
call   1040 <toupper@plt>
cltq
addl   $0x1,-0xf4(%rsp,%rax,4)
01
add    $0x1,%ebx
xor    %eax,%eax
call   1070 <getchar@plt>
cmp    $0x7e,%eax
je     121c <count_4+0xcc>
lea    -0x41(%rax),%ecx
cmp    $0x39,%ecx
jbe    15e0 <count_4+0x490>
lea    -0x30(%rax),%ecx
cmp    $0x9,%ecx
ja     1620 <count_4+0x4d0>
add    $0x1,%r12d
jmp    15f4 <count_4+0x4a4>
nopw   0x0(%rax,%rax,1)
cmp    $0x20,%eax
ja     15f4 <count_4+0x4a4>
mov    %eax,%eax
bt     %rax,%rbp
jae    15f4 <count_4+0x4a4>
add    $0x1,%r14d
jmp    15f4 <count_4+0x4a4>

LLVM IR (-O0):
@.str = [54 x i8] c"So you had %d words with %d letters and %d numbers\0A\0A\0A\00"
@.str.1 = [12 x i8] c"Times x %d|\00"
@.str.2 = [4 x i8] c" * \00"
@.str.3 = [4 x i8] c" - \00"
@.str.4 = [89 x i8] c"----------------------------------------------------------------------------------------\00"
@.str.5 = [11 x i8] c" Letter |\00"
@.str.6 = [5 x i8] c" %c \00"
define i32 @count_4() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [27 x i32]
store i32 0, i32* %8
store i32 0, i32* %7
store i32 0, i32* %6
store i32 0, i32* %4
%10 = bitcast [27 x i32]* %9 to i8*
store i32 0, i32* %5
br label %11
11: ; preds = %58, %0
%12 = call i32 (...) @getchar()
store i32 %12, i32* %3
%13 = icmp ne i32 %12, 126
br i1 %13, label %14, label %59
14: ; preds = %11
%15 = load i32, i32* %3
%16 = icmp sge i32 %15, 65
br i1 %16, label %17, label %31
17: ; preds = %14
%18 = load i32, i32* %3
%19 = icmp sle i32 %18, 122
br i1 %19, label %20, label %31
20: ; preds = %17
%21 = load i32, i32* %3
%22 = call i32 @toupper(i32 %21)
store i32 %22, i32* %3
%23 = load i32, i32* %3
%24 = sub nsw i32 %23, 65
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [27 x i32], [27 x i32]* %9, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = add nsw i32 %27, 1
store i32 %28, i32* %26
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
store i32 1, i32* %5
br label %52
31: ; preds = %17, %14
%32 = load i32, i32* %3
%33 = icmp sge i32 %32, 48
br i1 %33, label %34, label %40
34: ; preds = %31
%35 = load i32, i32* %3
%36 = icmp sle i32 %35, 57
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = load i32, i32* %7
%39 = add nsw i32 %38, 1
store i32 %39, i32* %7
store i32 1, i32* %5
br label %51
40: ; preds = %34, %31
%41 = load i32, i32* %3
%42 = icmp eq i32 %41, 32
br i1 %42, label %49, label %43
43: ; preds = %40
%44 = load i32, i32* %3
%45 = icmp eq i32 %44, 9
br i1 %45, label %49, label %46
46: ; preds = %43
%47 = load i32, i32* %3
%48 = icmp eq i32 %47, 10
br i1 %48, label %49, label %50
49: ; preds = %46, %43, %40
store i32 0, i32* %5
br label %50
50: ; preds = %49, %46
br label %51
51: ; preds = %50, %37
br label %52
52: ; preds = %51, %20
%53 = load i32, i32* %5
%54 = icmp eq i32 %53, 0
br i1 %54, label %55, label %58
55: ; preds = %52
%56 = load i32, i32* %8
%57 = add nsw i32 %56, 1
store i32 %57, i32* %8
store i32 1, i32* %5
br label %58
58: ; preds = %55, %52
br label %11
59: ; preds = %11
%60 = load i32, i32* %8
%61 = load i32, i32* %6
%62 = load i32, i32* %7
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %60, i32 %61, i32 %62)
store i32 0, i32* %2
br label %64
64: ; preds = %80, %59
%65 = load i32, i32* %2
%66 = icmp slt i32 %65, 26
br i1 %66, label %67, label %83
67: ; preds = %64
%68 = load i32, i32* %4
%69 = load i32, i32* %2
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [27 x i32], [27 x i32]* %9, i64 0, i64 %70
%72 = load i32, i32* %71
%73 = icmp slt i32 %68, %72
br i1 %73, label %74, label %79
74: ; preds = %67
%75 = load i32, i32* %2
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [27 x i32], [27 x i32]* %9, i64 0, i64 %76
%78 = load i32, i32* %77
store i32 %78, i32* %4
br label %79
79: ; preds = %74, %67
br label %80
80: ; preds = %79
%81 = load i32, i32* %2
%82 = add nsw i32 %81, 1
store i32 %82, i32* %2
br label %64
83: ; preds = %64
%84 = load i32, i32* %4
store i32 %84, i32* %2
br label %85
85: ; preds = %119, %83
%86 = load i32, i32* %2
%87 = icmp sge i32 %86, 0
br i1 %87, label %88, label %122
88: ; preds = %85
br label %89
89: ; preds = %88
%90 = load i32, i32* %2
%91 = load i32, i32* %4
%92 = icmp sle i32 %90, %91
br i1 %92, label %93, label %97
93: ; preds = %89
%94 = load i32, i32* %2
%95 = add nsw i32 %94, 1
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %95)
br label %97
97: ; preds = %93, %89
store i32 0, i32* %3
br label %98
98: ; preds = %113, %97
%99 = load i32, i32* %3
%100 = icmp slt i32 %99, 26
br i1 %100, label %101, label %116
101: ; preds = %98
%102 = load i32, i32* %3
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [27 x i32], [27 x i32]* %9, i64 0, i64 %103
%105 = load i32, i32* %104
%106 = load i32, i32* %2
%107 = icmp sge i32 %105, %106
br i1 %107, label %108, label %110
108: ; preds = %101
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %112
110: ; preds = %101
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %112
112: ; preds = %110, %108
br label %113
113: ; preds = %112
%114 = load i32, i32* %3
%115 = add nsw i32 %114, 1
store i32 %115, i32* %3
br label %98
116: ; preds = %98
%117 = call i32 @putchar(i8 signext 10)
%118 = call i32 @puts(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.4, i64 0, i64 0))
br label %119
119: ; preds = %116
%120 = load i32, i32* %2
%121 = add nsw i32 %120, -1
store i32 %121, i32* %2
br label %85
122: ; preds = %85
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
store i32 65, i32* %2
br label %124
124: ; preds = %130, %122
%125 = load i32, i32* %2
%126 = icmp slt i32 %125, 91
br i1 %126, label %127, label %133
127: ; preds = %124
%128 = load i32, i32* %2
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %128)
br label %130
130: ; preds = %127
%131 = load i32, i32* %2
%132 = add nsw i32 %131, 1
store i32 %132, i32* %2
br label %124
133: ; preds = %124
%134 = load i32, i32* %1
ret i32 %134
}

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