#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 mygetchar();
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  int lletres[95] = {0};
  int car, i;
  printf("Por favor, introduzca un texto (máximo 95 caracteres): ");
  while ((car = mygetchar()) != '.')
    lletres[car - 32] = lletres[car - 32] + 1;
  lletres['.' - 32] = 1;
  for (i = 0; i < 95; i++)
    if (lletres[i] != 0)
      printf("\nLetra en ASCII: %d \nNº veces encontradas en el texto: %d\n",
             i + 32, lletres[i]);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x190(%rbp),%rdi
xor    %esi,%esi
mov    $0x17c,%edx
call   1050 <memset@plt>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <mygetchar@plt>
mov    %eax,-0x194(%rbp)
cmp    $0x2e,%eax
je     11ac <main+0x7c>
mov    -0x194(%rbp),%eax
sub    $0x20,%eax
cltq
mov    -0x190(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    -0x194(%rbp),%eax
sub    $0x20,%eax
cltq
mov    %ecx,-0x190(%rbp,%rax,4)
jmp    116a <main+0x3a>
movl   $0x1,-0x158(%rbp)
movl   $0x0,-0x198(%rbp)
cmpl   $0x5f,-0x198(%rbp)
jge    1220 <main+0xf0>
movslq -0x198(%rbp),%rax
cmpl   $0x0,-0x190(%rbp,%rax,4)
je     1207 <main+0xd7>
mov    -0x198(%rbp),%esi
add    $0x20,%esi
movslq -0x198(%rbp),%rax
mov    -0x190(%rbp,%rax,4),%edx
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    120c <main+0xdc>
mov    -0x198(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x198(%rbp)
jmp    11c0 <main+0x90>
mov    0x2db9(%rip),%rax
mov    (%rax),%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x188,%rsp
mov    %rsp,%rdi
mov    $0x17c,%edx
xor    %esi,%esi
call   1050 <memset@plt>
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <mygetchar@plt>
cmp    $0x2e,%eax
je     1175 <main+0x45>
cltq
addl   $0x1,-0x80(%rsp,%rax,4)
jmp    1160 <main+0x30>
movl   $0x1,0x38(%rsp)
lea    0xeb5(%rip),%r14
xor    %ebx,%ebx
jmp    119a <main+0x6a>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    $0x5f,%rbx
je     11b0 <main+0x80>
mov    (%rsp,%rbx,4),%edx
test   %edx,%edx
je     1190 <main+0x60>
lea    0x20(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1190 <main+0x60>
mov    0x2e29(%rip),%rax
mov    (%rax),%eax
add    $0x188,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [57 x i8] c"Por favor, introduzca un texto (m\C3\A1ximo 95 caracteres): \00"
@.str.1 = [60 x i8] c"\0ALetra en ASCII: %d \0AN\C2\BA veces encontradas en el texto: %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [95 x i32]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [95 x i32]* %6 to i8*
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %14, %2
%12 = call i32 (...) @mygetchar()
store i32 %12, i32* %7
%13 = icmp ne i32 %12, 46
br i1 %13, label %14, label %25
14: ; preds = %11
%15 = load i32, i32* %7
%16 = sub nsw i32 %15, 32
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [95 x i32], [95 x i32]* %6, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = add nsw i32 %19, 1
%21 = load i32, i32* %7
%22 = sub nsw i32 %21, 32
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [95 x i32], [95 x i32]* %6, i64 0, i64 %23
store i32 %20, i32* %24
br label %11
25: ; preds = %11
%26 = getelementptr inbounds [95 x i32], [95 x i32]* %6, i64 0, i64 14
store i32 1, i32* %26
store i32 0, i32* %8
br label %27
27: ; preds = %45, %25
%28 = load i32, i32* %8
%29 = icmp slt i32 %28, 95
br i1 %29, label %30, label %48
30: ; preds = %27
%31 = load i32, i32* %8
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [95 x i32], [95 x i32]* %6, i64 0, i64 %32
%34 = load i32, i32* %33
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %44
36: ; preds = %30
%37 = load i32, i32* %8
%38 = add nsw i32 %37, 32
%39 = load i32, i32* %8
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [95 x i32], [95 x i32]* %6, i64 0, i64 %40
%42 = load i32, i32* %41
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0), i32 %38, i32 %42)
br label %44
44: ; preds = %36, %30
br label %45
45: ; preds = %44
%46 = load i32, i32* %8
%47 = add nsw i32 %46, 1
store i32 %47, i32* %8
br label %27
48: ; preds = %27
%49 = load i32, i32* @EXIT_SUCCESS
ret i32 %49
}

LLVM IR (-O2):
@.str = [57 x i8] c"Por favor, introduzca un texto (m\C3\A1ximo 95 caracteres): \00"
@.str.1 = [60 x i8] c"\0ALetra en ASCII: %d \0AN\C2\BA veces encontradas en el texto: %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [95 x i32]
%4 = bitcast [95 x i32]* %3 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @mygetchar()
%7 = icmp eq i32 %6, 46
br i1 %7, label %17, label %8
8: ; preds = %2, %8
%9 = phi i32 [ %15, %8 ], [ %6, %2 ]
%10 = add nsw i32 %9, -32
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [95 x i32], [95 x i32]* %3, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = add nsw i32 %13, 1
store i32 %14, i32* %12
%15 = tail call i32 (...) @mygetchar()
%16 = icmp eq i32 %15, 46
br i1 %16, label %17, label %8
17: ; preds = %8, %2
%18 = getelementptr inbounds [95 x i32], [95 x i32]* %3, i64 0, i64 14
store i32 1, i32* %18
br label %19
19: ; preds = %17, %28
%20 = phi i64 [ 0, %17 ], [ %29, %28 ]
%21 = getelementptr inbounds [95 x i32], [95 x i32]* %3, i64 0, i64 %20
%22 = load i32, i32* %21
%23 = icmp eq i32 %22, 0
br i1 %23, label %28, label %24
24: ; preds = %19
%25 = trunc i64 %20 to i32
%26 = add i32 %25, 32
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0), i32 %26, i32 %22)
br label %28
28: ; preds = %19, %24
%29 = add nuw nsw i64 %20, 1
%30 = icmp eq i64 %29, 95
br i1 %30, label %31, label %19
31: ; preds = %28
%32 = load i32, i32* @EXIT_SUCCESS
ret i32 %32
}