#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int s[256];
  int j;
  int total = 0;
  for (j = 0; j < 256; j++) {
    s[j] = 0;
  }
  s['A']++;
  s['B']++;
  s['A']++;
  for (j = 0; j < 256; j++) {
    total += s[j];
  }
  printf("%8s%13s\n", "Elemento", "Valor");
  for (j = 0; j < 256; j++) {
    if (s[j] != 0)
      printf("%8d%4c%5x%13d\n", j, j, j, s[j]);
  }
  printf("%8s%13d\n", "Total", total);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x418(%rbp)
movl   $0x0,-0x414(%rbp)
cmpl   $0x100,-0x414(%rbp)
jge    116c <main+0x5c>
movslq -0x414(%rbp),%rax
movl   $0x0,-0x410(%rbp,%rax,4)
mov    -0x414(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x414(%rbp)
jmp    1136 <main+0x26>
mov    -0x30c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30c(%rbp)
mov    -0x308(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x308(%rbp)
mov    -0x30c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30c(%rbp)
movl   $0x0,-0x414(%rbp)
cmpl   $0x100,-0x414(%rbp)
jge    11e1 <main+0xd1>
movslq -0x414(%rbp),%rax
mov    -0x410(%rbp,%rax,4),%eax
add    -0x418(%rbp),%eax
mov    %eax,-0x418(%rbp)
mov    -0x414(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x414(%rbp)
jmp    11a3 <main+0x93>
lea    0xe18(%rip),%rdi
lea    0xe1a(%rip),%rsi
lea    0xe1c(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x414(%rbp)
cmpl   $0x100,-0x414(%rbp)
jge    1274 <main+0x164>
movslq -0x414(%rbp),%rax
cmpl   $0x0,-0x410(%rbp,%rax,4)
je     125b <main+0x14b>
mov    -0x414(%rbp),%esi
mov    -0x414(%rbp),%edx
mov    -0x414(%rbp),%ecx
movslq -0x414(%rbp),%rax
mov    -0x410(%rbp,%rax,4),%r8d
ff
lea    0xdc4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1260 <main+0x150>
mov    -0x414(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x414(%rbp)
jmp    1207 <main+0xf7>
mov    -0x418(%rbp),%edx
lea    0xda6(%rip),%rdi
lea    0xda8(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2d4a(%rip),%rax
mov    (%rax),%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x428,%rsp
lea    0x20(%rsp),%rdi
xor    %ebx,%ebx
mov    $0x400,%edx
xor    %esi,%esi
call   1040 <memset@plt>
movabs $0x100000002,%rax
mov    %rax,0x124(%rsp)
pxor   %xmm0,%xmm0
pxor   %xmm1,%xmm1
nopw   0x0(%rax,%rax,1)
paddd  0x20(%rsp,%rbx,4),%xmm0
paddd  0x30(%rsp,%rbx,4),%xmm1
paddd  0x40(%rsp,%rbx,4),%xmm0
paddd  0x50(%rsp,%rbx,4),%xmm1
paddd  0x60(%rsp,%rbx,4),%xmm0
paddd  0x70(%rsp,%rbx,4),%xmm1
paddd  0x80(%rsp,%rbx,4),%xmm0
paddd  0x90(%rsp,%rbx,4),%xmm1
add    $0x20,%rbx
cmp    $0x100,%rbx
jne    1160 <main+0x40>
lea    0xe56(%rip),%rdi
lea    0xe58(%rip),%rsi
lea    0xe5a(%rip),%rdx
xor    %eax,%eax
movdqa %xmm0,0x10(%rsp)
movdqa %xmm1,(%rsp)
call   1030 <printf@plt>
movdqa (%rsp),%xmm1
movdqa 0x10(%rsp),%xmm0
lea    0xe3c(%rip),%r14
xor    %ebx,%ebx
jmp    11ed <main+0xcd>
add    $0x1,%rbx
cmp    $0x100,%rbx
je     1214 <main+0xf4>
mov    0x20(%rsp,%rbx,4),%r8d
test   %r8d,%r8d
je     11e0 <main+0xc0>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
movdqa (%rsp),%xmm1
movdqa 0x10(%rsp),%xmm0
jmp    11e0 <main+0xc0>
paddd  %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%edx
lea    0xdf2(%rip),%rdi
lea    0xdf4(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2d96(%rip),%rax
mov    (%rax),%eax
add    $0x428,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%8s%13s\0A\00"
@.str.1 = [9 x i8] c"Elemento\00"
@.str.2 = [6 x i8] c"Valor\00"
@.str.3 = [15 x i8] c"%8d%4c%5x%13d\0A\00"
@.str.4 = [9 x i8] c"%8s%13d\0A\00"
@.str.5 = [6 x i8] c"Total\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [256 x i32]
%2 = bitcast [256 x i32]* %1 to i8*
%3 = getelementptr inbounds [256 x i32], [256 x i32]* %1, i64 0, i64 65
%4 = getelementptr inbounds [256 x i32], [256 x i32]* %1, i64 0, i64 66
store i32 1, i32* %4
store i32 2, i32* %3
br label %5
5: ; preds = %5, %0
%6 = phi i64 [ 0, %0 ], [ %44, %5 ]
%7 = phi <4 x i32> [ zeroinitializer, %0 ], [ %42, %5 ]
%8 = phi <4 x i32> [ zeroinitializer, %0 ], [ %43, %5 ]
%9 = getelementptr inbounds [256 x i32], [256 x i32]* %1, i64 0, i64 %6
%10 = bitcast i32* %9 to <4 x i32>*
%11 = load <4 x i32>, <4 x i32>* %10
%12 = getelementptr inbounds i32, i32* %9, i64 4
%13 = bitcast i32* %12 to <4 x i32>*
%14 = load <4 x i32>, <4 x i32>* %13
%15 = add <4 x i32> %11, %7
%16 = add <4 x i32> %14, %8
%17 = or i64 %6, 8
%18 = getelementptr inbounds [256 x i32], [256 x i32]* %1, i64 0, i64 %17
%19 = bitcast i32* %18 to <4 x i32>*
%20 = load <4 x i32>, <4 x i32>* %19
%21 = getelementptr inbounds i32, i32* %18, i64 4
%22 = bitcast i32* %21 to <4 x i32>*
%23 = load <4 x i32>, <4 x i32>* %22
%24 = add <4 x i32> %20, %15
%25 = add <4 x i32> %23, %16
%26 = or i64 %6, 16
%27 = getelementptr inbounds [256 x i32], [256 x i32]* %1, i64 0, i64 %26
%28 = bitcast i32* %27 to <4 x i32>*
%29 = load <4 x i32>, <4 x i32>* %28
%30 = getelementptr inbounds i32, i32* %27, i64 4
%31 = bitcast i32* %30 to <4 x i32>*
%32 = load <4 x i32>, <4 x i32>* %31
%33 = add <4 x i32> %29, %24
%34 = add <4 x i32> %32, %25
%35 = or i64 %6, 24
%36 = getelementptr inbounds [256 x i32], [256 x i32]* %1, i64 0, i64 %35
%37 = bitcast i32* %36 to <4 x i32>*
%38 = load <4 x i32>, <4 x i32>* %37
%39 = getelementptr inbounds i32, i32* %36, i64 4
%40 = bitcast i32* %39 to <4 x i32>*
%41 = load <4 x i32>, <4 x i32>* %40
%42 = add <4 x i32> %38, %33
%43 = add <4 x i32> %41, %34
%44 = add nuw nsw i64 %6, 32
%45 = icmp eq i64 %44, 256
br i1 %45, label %46, label %5
46: ; preds = %5
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %48
48: ; preds = %46, %56
%49 = phi i64 [ 0, %46 ], [ %57, %56 ]
%50 = getelementptr inbounds [256 x i32], [256 x i32]* %1, i64 0, i64 %49
%51 = load i32, i32* %50
%52 = icmp eq i32 %51, 0
br i1 %52, label %56, label %53
53: ; preds = %48
%54 = trunc i64 %49 to i32
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %54, i32 %54, i32 %54, i32 %51)
br label %56
56: ; preds = %48, %53
%57 = add nuw nsw i64 %49, 1
%58 = icmp eq i64 %57, 256
br i1 %58, label %59, label %48
59: ; preds = %56
%60 = add <4 x i32> %43, %42
%61 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %60)
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %61)
%63 = load i32, i32* @EXIT_SUCCESS
ret i32 %63
}