#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']++;
  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)
movl   $0x0,-0x414(%rbp)
cmpl   $0x100,-0x414(%rbp)
jge    11c3 <main+0xb3>
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    1185 <main+0x75>
lea    0xe36(%rip),%rdi
lea    0xe38(%rip),%rsi
lea    0xe3a(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x414(%rbp)
cmpl   $0x100,-0x414(%rbp)
jge    1256 <main+0x146>
movslq -0x414(%rbp),%rax
cmpl   $0x0,-0x410(%rbp,%rax,4)
je     123d <main+0x12d>
mov    -0x414(%rbp),%esi
mov    -0x414(%rbp),%edx
mov    -0x414(%rbp),%ecx
movslq -0x414(%rbp),%rax
mov    -0x410(%rbp,%rax,4),%r8d
ff
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1242 <main+0x132>
mov    -0x414(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x414(%rbp)
jmp    11e9 <main+0xd9>
mov    -0x418(%rbp),%edx
lea    0xdc4(%rip),%rdi
lea    0xdc7(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2d68(%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>
movl   $0x1,0x124(%rsp)
pxor   %xmm0,%xmm0
pxor   %xmm1,%xmm1
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    1150 <main+0x30>
lea    0xe66(%rip),%rdi
lea    0xe68(%rip),%rsi
lea    0xe6a(%rip),%rdx
xor    %eax,%eax
movdqa %xmm0,0x10(%rsp)
movdqa %xmm1,(%rsp)
call   1030 <printf@plt>
movdqa (%rsp),%xmm1
movdqa 0x10(%rsp),%xmm0
lea    0xe4c(%rip),%r14
xor    %ebx,%ebx
jmp    11dd <main+0xbd>
add    $0x1,%rbx
cmp    $0x100,%rbx
je     1204 <main+0xe4>
mov    0x20(%rsp,%rbx,4),%r8d
test   %r8d,%r8d
je     11d0 <main+0xb0>
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    11d0 <main+0xb0>
paddd  %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%edx
lea    0xe02(%rip),%rdi
lea    0xe05(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2da6(%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 = [10 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
store i32 0, i32* %3
br label %19
19: ; preds = %29, %15
%20 = load i32, i32* %3
%21 = icmp slt i32 %20, 256
br i1 %21, label %22, label %32
22: ; preds = %19
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [256 x i32], [256 x i32]* %2, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = load i32, i32* %4
%28 = add nsw i32 %27, %26
store i32 %28, i32* %4
br label %29
29: ; preds = %22
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %19
32: ; preds = %19
%33 = 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 %34
34: ; preds = %53, %32
%35 = load i32, i32* %3
%36 = icmp slt i32 %35, 256
br i1 %36, label %37, label %56
37: ; preds = %34
%38 = load i32, i32* %3
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [256 x i32], [256 x i32]* %2, i64 0, i64 %39
%41 = load i32, i32* %40
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %52
43: ; preds = %37
%44 = load i32, i32* %3
%45 = load i32, i32* %3
%46 = load i32, i32* %3
%47 = load i32, i32* %3
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [256 x i32], [256 x i32]* %2, i64 0, i64 %48
%50 = load i32, i32* %49
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %44, i32 %45, i32 %46, i32 %50)
br label %52
52: ; preds = %43, %37
br label %53
53: ; preds = %52
%54 = load i32, i32* %3
%55 = add nsw i32 %54, 1
store i32 %55, i32* %3
br label %34
56: ; preds = %34
%57 = load i32, i32* %4
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %57)
%59 = load i32, i32* @EXIT_SUCCESS
ret i32 %59
}

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