#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:");
  letra = getchar();
  if (letra >= 65 && letra <= 90) {
    printf("\nVocê digitou uma letra maiuscula.\n");
  } else if (letra >= 97 && letra <= 122) {
    printf("\nVocê digitou uma letra minuscula.\n");
  } else {
    printf("\nProvavelmente você digitou um simbolo.\n");
  }
  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    0xeb0(%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    0xeaa(%rip),%rdi
call   1030 <printf@plt>
jmp    11a7 <main+0x87>
lea    0xebe(%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
add    $0x9f,%al
cmp    $0x1a,%al
lea    0xeed(%rip),%rax
lea    0xebd(%rip),%rdx
cmovb  %rax,%rdx
cmp    $0x1a,%cl
lea    0xefc(%rip),%rdi
cmovae %rdx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"\0AEntre com uma letra:\00"
@.str.1 = [37 x i8] c"\0AVoc\C3\AA digitou uma letra maiuscula.\0A\00"
@.str.2 = [37 x i8] c"\0AVoc\C3\AA digitou uma letra minuscula.\0A\00"
@.str.3 = [42 x i8] c"\0AProvavelmente voc\C3\AA digitou um simbolo.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 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 ([37 x i8], [37 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 ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %26
24: ; preds = %18, %14
%25 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 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 = [22 x i8] c"\0AEntre com uma letra:\00"
@str = [41 x i8] c"\0AProvavelmente voc\C3\AA digitou um simbolo.\00"
@str.4 = [36 x i8] c"\0AVoc\C3\AA digitou uma letra minuscula.\00"
@str.5 = [36 x i8] c"\0AVoc\C3\AA digitou uma letra maiuscula.\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getchar()
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = add i8 %2, -97
%6 = icmp ult i8 %5, 26
%7 = select i1 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0)
%8 = select i1 %4, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @str.5, i64 0, i64 0), i8* %7
%9 = tail call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}