#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 */
char EOF;
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
char tolower(char);
void main() {
  static int tabla[('z' - 'a' + 1)][('z' - 'a' + 1)];
  char f, c;
  char car;
  char carant = ' ';
  printf("Introducir texto. Para finalizar introducir la marca EOF\n");
  while ((car = getchar()) != EOF) {
    car = tolower(car);
    if ((carant >= 'a' && carant <= 'z') && (car >= 'a' && car <= 'z'))
      tabla[carant - 'a'][car - 'a']++;
    carant = car;
  }
  printf(" ");
  for (c = 'a'; c <= 'z'; c++)
    printf("  %c", c);
  putchar('\n');
  for (f = 'a'; f <= 'z'; f++) {
    putchar(f);
    for (c = 'a'; c <= 'z'; c++)
      printf("%3d", tabla[f - 'a'][c - 'a']);
    putchar('\n');
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x20,-0x4(%rbp)
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x3(%rbp)
movsbl %al,%eax
mov    0x2e7a(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11ef <main+0xaf>
movsbl -0x3(%rbp),%edi
call   1060 <tolower@plt>
mov    %al,-0x3(%rbp)
movsbl -0x4(%rbp),%eax
cmp    $0x61,%eax
jl     11e4 <main+0xa4>
movsbl -0x4(%rbp),%eax
cmp    $0x7a,%eax
jg     11e4 <main+0xa4>
movsbl -0x3(%rbp),%eax
cmp    $0x61,%eax
jl     11e4 <main+0xa4>
movsbl -0x3(%rbp),%eax
cmp    $0x7a,%eax
jg     11e4 <main+0xa4>
movsbl -0x4(%rbp),%eax
sub    $0x61,%eax
movslq %eax,%rcx
lea    0x2e86(%rip),%rax
imul   $0x68,%rcx,%rcx
add    %rcx,%rax
movsbl -0x3(%rbp),%ecx
sub    $0x61,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x3(%rbp),%al
mov    %al,-0x4(%rbp)
jmp    115a <main+0x1a>
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movb   $0x61,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     122d <main+0xed>
movsbl -0x2(%rbp),%esi
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x2(%rbp),%al
add    $0x1,%al
mov    %al,-0x2(%rbp)
jmp    1201 <main+0xc1>
mov    $0xa,%edi
call   1030 <putchar@plt>
movb   $0x61,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     12b9 <main+0x179>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
movb   $0x61,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     12a2 <main+0x162>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
movslq %eax,%rcx
lea    0x2ddd(%rip),%rax
imul   $0x68,%rcx,%rcx
add    %rcx,%rax
movsbl -0x2(%rbp),%ecx
sub    $0x61,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xdb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x2(%rbp),%al
add    $0x1,%al
mov    %al,-0x2(%rbp)
jmp    1255 <main+0x115>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
jmp    123b <main+0xfb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xeab(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    0x2e77(%rip),%r14
cmp    (%r14),%al
jne    137a <main+0x22a>
mov    $0x20,%edi
call   1030 <putchar@plt>
lea    0xe75(%rip),%rbx
mov    %rbx,%rdi
mov    $0x61,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x62,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x63,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x65,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x66,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x67,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x68,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x69,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x6a,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x6b,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x6c,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x6d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x6e,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x6f,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x70,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x71,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x72,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x73,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x74,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x75,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x76,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x77,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x78,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x79,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x7a,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x61,%r14d
lea    0x2d38(%rip),%rbx
lea    0xcd6(%rip),%r15
nop
movsbl %r14b,%edi
call   1030 <putchar@plt>
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    (%rbx,%rbp,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    $0x1a,%rbp
jne    1340 <main+0x1f0>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14
add    $0x68,%rbx
cmp    $0x7b,%r14
jne    1330 <main+0x1e0>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x20,%bl
lea    0x2cdd(%rip),%r15
jmp    13a2 <main+0x252>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %ebp,%ebx
cmp    (%r14),%al
je     117a <main+0x2a>
movsbl %al,%edi
call   1070 <tolower@plt>
mov    %eax,%ebp
lea    -0x61(%rbx),%eax
cmp    $0x19,%al
ja     1390 <main+0x240>
cmp    $0x61,%bpl
jl     1390 <main+0x240>
cmp    $0x7a,%bpl
jg     1390 <main+0x240>
movzbl %bl,%eax
imul   $0x68,%rax,%rax
add    %r15,%rax
movzbl %bpl,%ecx
add    $0xffffff9f,%ecx
addl   $0x1,-0x2768(%rax,%rcx,4)
01
jmp    1390 <main+0x240>

LLVM IR (-O0):
@main.tabla = internal global [26 x [26 x i32]] zeroinitializer
@.str = [58 x i8] c"Introducir texto. Para finalizar introducir la marca EOF\0A\00"
@EOF = global i8 0
@.str.1 = [2 x i8] c" \00"
@.str.2 = [5 x i8] c" %c\00"
@.str.3 = [4 x i8] c"%3d\00"
define void @main() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 32, i8* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %43, %0
%7 = call signext i8 (...) @getchar()
store i8 %7, i8* %3
%8 = sext i8 %7 to i32
%9 = load i8, i8* @EOF
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %8, %10
br i1 %11, label %12, label %45
12: ; preds = %6
%13 = load i8, i8* %3
%14 = call signext i8 @tolower(i8 signext %13)
store i8 %14, i8* %3
%15 = load i8, i8* %4
%16 = sext i8 %15 to i32
%17 = icmp sge i32 %16, 97
br i1 %17, label %18, label %43
18: ; preds = %12
%19 = load i8, i8* %4
%20 = sext i8 %19 to i32
%21 = icmp sle i32 %20, 122
br i1 %21, label %22, label %43
22: ; preds = %18
%23 = load i8, i8* %3
%24 = sext i8 %23 to i32
%25 = icmp sge i32 %24, 97
br i1 %25, label %26, label %43
26: ; preds = %22
%27 = load i8, i8* %3
%28 = sext i8 %27 to i32
%29 = icmp sle i32 %28, 122
br i1 %29, label %30, label %43
30: ; preds = %26
%31 = load i8, i8* %4
%32 = sext i8 %31 to i32
%33 = sub nsw i32 %32, 97
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [26 x [26 x i32]], [26 x [26 x i32]]* @main.tabla, i64 0, i64 %34
%36 = load i8, i8* %3
%37 = sext i8 %36 to i32
%38 = sub nsw i32 %37, 97
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [26 x i32], [26 x i32]* %35, i64 0, i64 %39
%41 = load i32, i32* %40
%42 = add nsw i32 %41, 1
store i32 %42, i32* %40
br label %43
43: ; preds = %30, %26, %22, %18, %12
%44 = load i8, i8* %3
store i8 %44, i8* %4
br label %6
45: ; preds = %6
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8 97, i8* %2
br label %47
47: ; preds = %55, %45
%48 = load i8, i8* %2
%49 = sext i8 %48 to i32
%50 = icmp sle i32 %49, 122
br i1 %50, label %51, label %58
51: ; preds = %47
%52 = load i8, i8* %2
%53 = sext i8 %52 to i32
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %53)
br label %55
55: ; preds = %51
%56 = load i8, i8* %2
%57 = add i8 %56, 1
store i8 %57, i8* %2
br label %47
58: ; preds = %47
%59 = call i32 @putchar(i8 signext 10)
store i8 97, i8* %1
br label %60
60: ; preds = %89, %58
%61 = load i8, i8* %1
%62 = sext i8 %61 to i32
%63 = icmp sle i32 %62, 122
br i1 %63, label %64, label %92
64: ; preds = %60
%65 = load i8, i8* %1
%66 = call i32 @putchar(i8 signext %65)
store i8 97, i8* %2
br label %67
67: ; preds = %84, %64
%68 = load i8, i8* %2
%69 = sext i8 %68 to i32
%70 = icmp sle i32 %69, 122
br i1 %70, label %71, label %87
71: ; preds = %67
%72 = load i8, i8* %1
%73 = sext i8 %72 to i32
%74 = sub nsw i32 %73, 97
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [26 x [26 x i32]], [26 x [26 x i32]]* @main.tabla, i64 0, i64 %75
%77 = load i8, i8* %2
%78 = sext i8 %77 to i32
%79 = sub nsw i32 %78, 97
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [26 x i32], [26 x i32]* %76, i64 0, i64 %80
%82 = load i32, i32* %81
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %82)
br label %84
84: ; preds = %71
%85 = load i8, i8* %2
%86 = add i8 %85, 1
store i8 %86, i8* %2
br label %67
87: ; preds = %67
%88 = call i32 @putchar(i8 signext 10)
br label %89
89: ; preds = %87
%90 = load i8, i8* %1
%91 = add i8 %90, 1
store i8 %91, i8* %1
br label %60
92: ; preds = %60
ret void
}

LLVM IR (-O2):
@main.tabla = internal unnamed_addr global [26 x [26 x i32]] zeroinitializer
@EOF = global i8 0
@.str.2 = [5 x i8] c" %c\00"
@.str.3 = [4 x i8] c"%3d\00"
@str = [57 x i8] c"Introducir texto. Para finalizar introducir la marca EOF\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getchar()
%3 = load i8, i8* @EOF
%4 = icmp eq i8 %2, %3
br i1 %4, label %28, label %5
5: ; preds = %0, %24
%6 = phi i8 [ %25, %24 ], [ %2, %0 ]
%7 = phi i8 [ %8, %24 ], [ 32, %0 ]
%8 = tail call signext i8 @tolower(i8 signext %6)
%9 = add i8 %7, -97
%10 = icmp ult i8 %9, 26
%11 = icmp sgt i8 %8, 96
%12 = select i1 %10, i1 %11, i1 false
%13 = icmp slt i8 %8, 123
%14 = select i1 %12, i1 %13, i1 false
br i1 %14, label %15, label %24
15: ; preds = %5
%16 = zext i8 %8 to i64
%17 = zext i8 %7 to i64
%18 = add nsw i64 %17, -97
%19 = add nuw nsw i64 %16, 4294967199
%20 = and i64 %19, 4294967295
%21 = getelementptr inbounds [26 x [26 x i32]], [26 x [26 x i32]]* @main.tabla, i64 0, i64 %18, i64 %20
%22 = load i32, i32* %21
%23 = add nsw i32 %22, 1
store i32 %23, i32* %21
br label %24
24: ; preds = %15, %5
%25 = tail call signext i8 (...) @getchar()
%26 = load i8, i8* @EOF
%27 = icmp eq i8 %25, %26
br i1 %27, label %28, label %5
28: ; preds = %24, %0
%29 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 32)
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 97)
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 98)
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 99)
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 100)
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 101)
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 102)
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 103)
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 104)
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 105)
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 106)
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 107)
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 108)
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 109)
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 110)
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 111)
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 112)
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 113)
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 114)
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 115)
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 116)
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 117)
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 118)
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 119)
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 120)
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 121)
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 122)
%56 = tail call i32 @putchar(i8 signext 10)
br label %57
57: ; preds = %28, %70
%58 = phi i64 [ 97, %28 ], [ %72, %70 ]
%59 = trunc i64 %58 to i8
%60 = tail call i32 @putchar(i8 signext %59)
%61 = add nsw i64 %58, -97
br label %62
62: ; preds = %57, %62
%63 = phi i64 [ 97, %57 ], [ %68, %62 ]
%64 = add nsw i64 %63, -97
%65 = getelementptr inbounds [26 x [26 x i32]], [26 x [26 x i32]]* @main.tabla, i64 0, i64 %61, i64 %64
%66 = load i32, i32* %65
%67 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %66)
%68 = add nuw nsw i64 %63, 1
%69 = icmp eq i64 %68, 123
br i1 %69, label %70, label %62
70: ; preds = %62
%71 = tail call i32 @putchar(i8 signext 10)
%72 = add nuw nsw i64 %58, 1
%73 = icmp eq i64 %72, 123
br i1 %73, label %74, label %57
74: ; preds = %70
ret void
}