#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 getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  char letra;
  printf("\nEntre com uma letra qualquer:");
  letra = getchar();
  if (letra >= 65 && letra <= 90) {
    printf("\nEsta letra eh MAIUSCULA\n");
  } else if (letra >= 97 && letra <= 122) {
    printf("\n Esta letra eh minuscula\n");
  } else {
    printf("\nProvavelmente voce digitou um simbolo");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1170 <main+0x50>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1170 <main+0x50>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
jmp    11ac <main+0x8c>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     119b <main+0x7b>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     119b <main+0x7b>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    11a7 <main+0x87>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    11ac <main+0x8c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     115a <main+0x2a>
lea    0xf0d(%rip),%rdi
call   1030 <puts@plt>
jmp    117a <main+0x4a>
add    $0x9f,%al
cmp    $0x19,%al
ja     116e <main+0x3e>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
jmp    117a <main+0x4a>
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"\0AEntre com uma letra qualquer:\00"
@.str.1 = [26 x i8] c"\0AEsta letra eh MAIUSCULA\0A\00"
@.str.2 = [27 x i8] c"\0A Esta letra eh minuscula\0A\00"
@.str.3 = [39 x i8] c"\0AProvavelmente voce digitou um simbolo\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 65
br i1 %7, label %8, label %14
8: ; preds = %0
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 90
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %27
14: ; preds = %8, %0
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sge i32 %16, 97
br i1 %17, label %18, label %24
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sle i32 %20, 122
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %26
24: ; preds = %18, %14
%25 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
br label %26
26: ; preds = %24, %22
br label %27
27: ; preds = %26, %12
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"\0AEntre com uma letra qualquer:\00"
@.str.3 = [39 x i8] c"\0AProvavelmente voce digitou um simbolo\00"
@str = [26 x i8] c"\0A Esta letra eh minuscula\00"
@str.4 = [25 x i8] c"\0AEsta letra eh MAIUSCULA\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getchar()
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.4, i64 0, i64 0))
br label %14
7: ; preds = %0
%8 = add i8 %2, -97
%9 = icmp ult i8 %8, 26
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %14
12: ; preds = %7
%13 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
br label %14
14: ; preds = %10, %12, %5
ret i32 0
}