#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*/ imprimir(int);
int leer();
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int dato;
  printf("\t\tPrograma que Valida un Dato.\n\n");
  do {
    printf("Introduce un dato válido en el rango %d-%d: ", 'A', 'Z');
    dato = leer();
  } while (dato < 'A' || dato > 'Z');
  for (int i = dato; i <= 'Z'; i++) {
    imprimir(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    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
mov    $0x41,%esi
mov    $0x5a,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <leer@plt>
mov    %eax,-0x14(%rbp)
mov    $0x1,%al
cmpl   $0x41,-0x14(%rbp)
mov    %al,-0x19(%rbp)
jl     118f <main+0x5f>
cmpl   $0x5a,-0x14(%rbp)
setg   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1154 <main+0x24>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x5a,-0x18(%rbp)
jg     11c0 <main+0x90>
mov    -0x18(%rbp),%edi
call   1040 <imprimir@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11a0 <main+0x70>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xea9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0x41,%esi
mov    $0x5a,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <leer@plt>
mov    %eax,%ebx
lea    -0x5b(%rbx),%eax
cmp    $0xffffffe6,%eax
jb     1160 <main+0x20>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1050 <imprimir@plt>
add    $0x1,%ebx
cmp    $0x5b,%ebx
jne    1190 <main+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [33 x i8] c"\09\09Programa que Valida un Dato.\0A\0A\00"
@.str.1 = [46 x i8] c"Introduce un dato v\C3\A1lido en el rango %d-%d: \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 ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 65, i32 90)
%11 = call i32 (...) @leer()
store i32 %11, 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
store i32 %21, i32* %7
br label %22
22: ; preds = %28, %20
%23 = load i32, i32* %7
%24 = icmp sle i32 %23, 90
br i1 %24, label %25, label %31
25: ; preds = %22
%26 = load i32, i32* %7
%27 = call i32 @imprimir(i32 %26)
br label %28
28: ; preds = %25
%29 = load i32, i32* %7
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
br label %22
31: ; preds = %22
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [46 x i8] c"Introduce un dato v\C3\A1lido en el rango %d-%d: \00"
@str = [32 x i8] c"\09\09Programa que Valida un Dato.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
br label %4
4: ; preds = %4, %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 65, i32 90)
%6 = tail call i32 (...) @leer()
%7 = add i32 %6, -91
%8 = icmp ult i32 %7, -26
br i1 %8, label %4, label %10
9: ; preds = %10
ret i32 0
10: ; preds = %4, %10
%11 = phi i32 [ %13, %10 ], [ %6, %4 ]
%12 = tail call i32 @imprimir(i32 %11)
%13 = add i32 %11, 1
%14 = icmp eq i32 %13, 91
br i1 %14, label %9, label %10
}