#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;
  int n_char_x[3];
  for (i = 0; i < 3; ++i)
    n_char_x[i] = 0;
  while ((c = getchar()) != EOF && c != '\n') {
    if (c == 'a')
      ++n_char_x[0];
    else if (c == 'b')
      ++n_char_x[1];
    else if (c == 'c')
      ++n_char_x[2];
  }
  printf("Los caracteres a, b y c estan respectivamente presentes:");
  for (i = 0; i < 3; ++i)
    printf(" %d", n_char_x[i]);
  printf(" veces.");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    115a <main+0x3a>
movslq -0xc(%rbp),%rax
movl   $0x0,-0x18(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
jmp    115f <main+0x3f>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
xor    %eax,%eax
mov    0x2e74(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x19(%rbp)
je     1189 <main+0x69>
cmpl   $0xa,-0x8(%rbp)
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1199 <main+0x79>
jmp    11eb <main+0xcb>
cmpl   $0x61,-0x8(%rbp)
jne    11b1 <main+0x91>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11e6 <main+0xc6>
cmpl   $0x62,-0x8(%rbp)
jne    11c9 <main+0xa9>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11e1 <main+0xc1>
cmpl   $0x63,-0x8(%rbp)
jne    11dc <main+0xbc>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11e1 <main+0xc1>
jmp    11e6 <main+0xc6>
jmp    115f <main+0x3f>
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    122e <main+0x10e>
movslq -0xc(%rbp),%rax
mov    -0x18(%rbp,%rax,4),%esi
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1200 <main+0xe0>
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %r14d,%r14d
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     11a6 <main+0x86>
mov    0x2eaa(%rip),%rbp
mov    $0x0,%ebx
mov    $0x0,%r12d
cmp    0x0(%rbp),%eax
je     11ab <main+0x8b>
xor    %r14d,%r14d
xor    %ebx,%ebx
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
cmp    $0x63,%eax
je     1180 <main+0x60>
cmp    $0x62,%eax
je     1190 <main+0x70>
cmp    $0x61,%eax
jne    1193 <main+0x73>
add    $0x1,%r14d
jmp    1193 <main+0x73>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%r12d
jmp    1193 <main+0x73>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     11ab <main+0x8b>
cmp    0x0(%rbp),%eax
jne    1160 <main+0x40>
jmp    11ab <main+0x8b>
xor    %ebx,%ebx
xor    %r12d,%r12d
lea    0xe4e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe79(%rip),%r15
mov    %r15,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe50(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [57 x i8] c"Los caracteres a, b y c estan respectivamente presentes:\00"
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [8 x i8] c" veces.\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp ne i32 %1, %2
%4 = icmp ne i32 %1, 10
%5 = and i1 %4, %3
br i1 %5, label %6, label %26
6: ; preds = %0, %17
%7 = phi i32 [ %18, %17 ], [ 0, %0 ]
%8 = phi i32 [ %19, %17 ], [ 0, %0 ]
%9 = phi i32 [ %20, %17 ], [ 0, %0 ]
%10 = phi i32 [ %21, %17 ], [ %1, %0 ]
switch i32 %10, label %17 [
i32 97, label %11
i32 98, label %13
i32 99, label %15
]
11: ; preds = %6
%12 = add nsw i32 %7, 1
br label %17
13: ; preds = %6
%14 = add nsw i32 %8, 1
br label %17
15: ; preds = %6
%16 = add nsw i32 %9, 1
br label %17
17: ; preds = %6, %13, %15, %11
%18 = phi i32 [ %7, %6 ], [ %7, %13 ], [ %7, %15 ], [ %12, %11 ]
%19 = phi i32 [ %8, %6 ], [ %14, %13 ], [ %8, %15 ], [ %8, %11 ]
%20 = phi i32 [ %9, %6 ], [ %9, %13 ], [ %16, %15 ], [ %9, %11 ]
%21 = tail call i32 (...) @getchar()
%22 = load i32, i32* @EOF
%23 = icmp ne i32 %21, %22
%24 = icmp ne i32 %21, 10
%25 = and i1 %24, %23
br i1 %25, label %6, label %26
26: ; preds = %17, %0
%27 = phi i32 [ 0, %0 ], [ %18, %17 ]
%28 = phi i32 [ 0, %0 ], [ %19, %17 ]
%29 = phi i32 [ 0, %0 ], [ %20, %17 ]
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %28)
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}