#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 /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
int main() {
  int i, j;
  int ast;
  int hist[25];
  int HIST[25];
  char lettera;
  char str[256];
  for (i = 0; i < 25; i++)
    hist[i] = HIST[i] = 0;
  printf("str = ");
  gets(str);
  printf("\n");
  for (i = 0; i < strlen(str); i++) {
    if (str[i] > 'a' && str[i] < 'z')
      hist[str[i] - 'a']++;
    if (str[i] > 'A' && str[i] < 'Z')
      HIST[str[i] - 'A']++;
  }
  for (i = 0; i < 25 * 2; i++) {
    if (i < 25) {
      ast = hist[i];
      lettera = 'a' + i;
    } else {
      ast = HIST[i - 25];
      lettera = 'A' + i - 25;
    }
    printf("%c | ", lettera);
    for (j = 0; j < ast; j++)
      printf("*");
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x19,-0x8(%rbp)
jge    117c <main+0x4c>
movslq -0x8(%rbp),%rax
movl   $0x0,-0xf0(%rbp,%rax,4)
movslq -0x8(%rbp),%rax
movl   $0x0,-0x80(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1149 <main+0x19>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x200(%rbp),%rdi
call   1050 <gets@plt>
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x204(%rbp)
lea    -0x200(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x204(%rbp),%eax
cmp    %ecx,%eax
jge    1275 <main+0x145>
movslq -0x8(%rbp),%rax
movsbl -0x200(%rbp,%rax,1),%eax
ff
cmp    $0x61,%eax
jle    1216 <main+0xe6>
movslq -0x8(%rbp),%rax
movsbl -0x200(%rbp,%rax,1),%eax
ff
cmp    $0x7a,%eax
jge    1216 <main+0xe6>
movslq -0x8(%rbp),%rax
movsbl -0x200(%rbp,%rax,1),%eax
ff
sub    $0x61,%eax
cltq
mov    -0x80(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x80(%rbp,%rax,4)
movslq -0x8(%rbp),%rax
movsbl -0x200(%rbp,%rax,1),%eax
ff
cmp    $0x41,%eax
jle    1262 <main+0x132>
movslq -0x8(%rbp),%rax
movsbl -0x200(%rbp,%rax,1),%eax
ff
cmp    $0x5a,%eax
jge    1262 <main+0x132>
movslq -0x8(%rbp),%rax
movsbl -0x200(%rbp,%rax,1),%eax
ff
sub    $0x41,%eax
cltq
mov    -0xf0(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0xf0(%rbp,%rax,4)
jmp    1267 <main+0x137>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11ab <main+0x7b>
movl   $0x0,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jge    132d <main+0x1fd>
cmpl   $0x19,-0x8(%rbp)
jge    12ac <main+0x17c>
movslq -0x8(%rbp),%rax
mov    -0x80(%rbp,%rax,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x61,%eax
mov    %al,-0xf1(%rbp)
jmp    12cd <main+0x19d>
mov    -0x8(%rbp),%eax
sub    $0x19,%eax
cltq
mov    -0xf0(%rbp,%rax,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x41,%eax
sub    $0x19,%eax
mov    %al,-0xf1(%rbp)
movsbl -0xf1(%rbp),%esi
lea    0xd2e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1311 <main+0x1e1>
lea    0xd13(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    12e9 <main+0x1b9>
lea    0xcef(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    127c <main+0x14c>
mov    -0x4(%rbp),%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1e8,%rsp
mov    $0xffffff9f,%r14d
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
movl   $0x0,0x60(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xc0(%rsp)
movl   $0x0,0xd0(%rsp)
lea    0xe42(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe0(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    1254 <main+0x114>
xor    %ebx,%ebx
lea    0x70(%rsp),%r12
lea    0xe0(%rsp),%r15
lea    0x20(%r14),%r13
mov    %rsp,%rbp
jmp    1229 <main+0xe9>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    %eax,%ecx
addl   $0x1,(%rdx,%rcx,4)
add    $0x1,%rbx
mov    %r15,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jge    1254 <main+0x114>
movsbq 0xe0(%rsp,%rbx,1),%rax
lea    -0x62(%rax),%esi
mov    $0xffffff9f,%ecx
mov    %r12,%rdx
cmp    $0x18,%sil
jb     1210 <main+0xd0>
lea    -0x42(%rax),%esi
mov    %r13,%rcx
mov    %rbp,%rdx
cmp    $0x17,%sil
jbe    1210 <main+0xd0>
jmp    1216 <main+0xd6>
lea    0xdac(%rip),%r15
xor    %ebx,%ebx
jmp    1274 <main+0x134>
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0x32,%rbx
je     12c1 <main+0x181>
lea    0x28(%rbx),%eax
cmp    $0x19,%rbx
lea    0x70(%rsp,%rbx,4),%rcx
lea    0x48(%r14,%rbx,1),%edx
lea    (%rsp,%rdx,4),%rdx
cmovb  %rcx,%rdx
lea    0x61(%rbx),%esi
cmovae %eax,%esi
mov    (%rdx),%ebp
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebp,%ebp
jle    1260 <main+0x120>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    12b0 <main+0x170>
jmp    1260 <main+0x120>
xor    %eax,%eax
add    $0x1e8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"str = \00"
@.str.2 = [6 x i8] c"%c | \00"
define i32 @main() {
%1 = alloca [25 x i32]
%2 = bitcast [25 x i32]* %1 to i8*
%3 = alloca [25 x i32]
%4 = bitcast [25 x i32]* %3 to i8*
%5 = alloca [256 x i8]
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @gets(i8* %6)
%9 = call i32 @putchar(i32 10)
%10 = call i32 @strlen(i8* %6)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %35
12: ; preds = %0, %30
%13 = phi i64 [ %31, %30 ], [ 0, %0 ]
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i64
%17 = add i8 %15, -98
%18 = icmp ult i8 %17, 24
br i1 %18, label %22, label %19
19: ; preds = %12
%20 = add i8 %15, -66
%21 = icmp ult i8 %20, 24
br i1 %21, label %22, label %30
22: ; preds = %19, %12
%23 = phi i64 [ 4294967199, %12 ], [ 4294967231, %19 ]
%24 = phi [25 x i32]* [ %1, %12 ], [ %3, %19 ]
%25 = add nsw i64 %23, %16
%26 = and i64 %25, 4294967295
%27 = getelementptr inbounds [25 x i32], [25 x i32]* %24, i64 0, i64 %26
%28 = load i32, i32* %27
%29 = add nsw i32 %28, 1
store i32 %29, i32* %27
br label %30
30: ; preds = %22, %19
%31 = add nuw nsw i64 %13, 1
%32 = call i32 @strlen(i8* %6)
%33 = sext i32 %32 to i64
%34 = icmp slt i64 %31, %33
br i1 %34, label %12, label %35
35: ; preds = %30, %0
br label %36
36: ; preds = %35, %55
%37 = phi i64 [ %57, %55 ], [ 0, %35 ]
%38 = icmp ult i64 %37, 25
%39 = getelementptr inbounds [25 x i32], [25 x i32]* %1, i64 0, i64 %37
%40 = add nuw i64 %37, 4294967271
%41 = and i64 %40, 4294967295
%42 = getelementptr inbounds [25 x i32], [25 x i32]* %3, i64 0, i64 %41
%43 = select i1 %38, i32* %39, i32* %42
%44 = select i1 %38, i32 97, i32 40
%45 = trunc i64 %37 to i32
%46 = add nuw nsw i32 %44, %45
%47 = load i32, i32* %43
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %46)
%49 = icmp sgt i32 %47, 0
br i1 %49, label %50, label %55
50: ; preds = %36, %50
%51 = phi i32 [ %53, %50 ], [ 0, %36 ]
%52 = call i32 @putchar(i32 42)
%53 = add nuw nsw i32 %51, 1
%54 = icmp eq i32 %53, %47
br i1 %54, label %55, label %50
55: ; preds = %50, %36
%56 = call i32 @putchar(i32 10)
%57 = add nuw nsw i64 %37, 1
%58 = icmp eq i64 %57, 50
br i1 %58, label %59, label %36
59: ; preds = %55
ret i32 0
}