#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 /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int a;
  printf("\t\tPrograma que valida un dato.\n\n");
  do {
    printf("Introduzca un valor entre %d y %d: ", 'A', 'Z');
    scanf(" %d", &a);
  } while (a < 'A' || a > 'Z');
  printf("La letra correspondiente al entero %d es:  %c\n", a, a);
  for (int i = a; i <= 'Z'; i++) {
    printf("%d - %c.\n", i, i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x41,%esi
mov    $0x5a,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x41,-0x14(%rbp)
mov    %al,-0x19(%rbp)
jl     1185 <main+0x65>
cmpl   $0x5a,-0x14(%rbp)
setg   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1144 <main+0x24>
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x5a,-0x18(%rbp)
jg     11d6 <main+0xb6>
mov    -0x18(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11aa <main+0x8a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xf21(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%r14
lea    0xed1(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0x41,%esi
mov    $0x5a,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edx
lea    -0x5b(%rdx),%eax
cmp    $0xffffffe6,%eax
jb     1160 <main+0x30>
lea    0xe96(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%ebx
cmp    $0x5a,%ebx
jg     11c6 <main+0x96>
lea    0xeac(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    $0x5b,%ebx
jne    11b0 <main+0x80>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [33 x i8] c"\09\09Programa que valida un dato.\0A\0A\00"
@.str.1 = [36 x i8] c"Introduzca un valor entre %d y %d: \00"
@.str.2 = [4 x i8] c" %d\00"
@.str.3 = [47 x i8] c"La letra correspondiente al entero %d es: %c\0A\00"
@.str.4 = [10 x i8] c"%d - %c.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %18, %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 65, i32 90)
%11 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32* %6)
br label %12
12: ; preds = %9
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 65
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load i32, i32* %6
%17 = icmp sgt i32 %16, 90
br label %18
18: ; preds = %15, %12
%19 = phi i1 [ true, %12 ], [ %17, %15 ]
br i1 %19, label %9, label %20
20: ; preds = %18
%21 = load i32, i32* %6
%22 = load i32, i32* %6
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), i32 %21, i32 %22)
%24 = load i32, i32* %6
store i32 %24, i32* %7
br label %25
25: ; preds = %32, %20
%26 = load i32, i32* %7
%27 = icmp sle i32 %26, 90
br i1 %27, label %28, label %35
28: ; preds = %25
%29 = load i32, i32* %7
%30 = load i32, i32* %7
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %29, i32 %30)
br label %32
32: ; preds = %28
%33 = load i32, i32* %7
%34 = add nsw i32 %33, 1
store i32 %34, i32* %7
br label %25
35: ; preds = %25
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [36 x i8] c"Introduzca un valor entre %d y %d: \00"
@.str.2 = [4 x i8] c" %d\00"
@.str.3 = [47 x i8] c"La letra correspondiente al entero %d es: %c\0A\00"
@.str.4 = [10 x i8] c"%d - %c.\0A\00"
@str = [32 x i8] c"\09\09Programa que valida un dato.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %6, %2
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 65, i32 90)
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
%10 = add i32 %9, -91
%11 = icmp ult i32 %10, -26
br i1 %11, label %6, label %12
12: ; preds = %6
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), i32 %9, i32 %9)
%14 = load i32, i32* %3
%15 = icmp slt i32 %14, 91
br i1 %15, label %17, label %16
16: ; preds = %17, %12
ret i32 0
17: ; preds = %12, %17
%18 = phi i32 [ %20, %17 ], [ %14, %12 ]
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %18, i32 %18)
%20 = add i32 %18, 1
%21 = icmp eq i32 %20, 91
br i1 %21, label %16, label %17
}