#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 asc;
  printf("Digite uma letra:\n");
  asc = getchar();
  if (asc >= 65 && asc <= 90) {
    printf("A letra digitada foi MAIUSCULA\n");
  } else if (asc >= 97 && asc <= 122) {
    printf("A letra digitada foi minuscula\n");
  } else {
    printf("Você digitou um caracter inválido.\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    0xead(%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    0xea2(%rip),%rdi
call   1030 <printf@plt>
jmp    11a7 <main+0x87>
lea    0xeb1(%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    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
lea    -0x41(%rax),%ecx
add    $0x9f,%al
cmp    $0x1a,%al
lea    0xef5(%rip),%rax
lea    0xec9(%rip),%rdx
cmovb  %rax,%rdx
cmp    $0x1a,%cl
lea    0xeff(%rip),%rdi
cmovae %rdx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Digite uma letra:\0A\00"
@.str.1 = [32 x i8] c"A letra digitada foi MAIUSCULA\0A\00"
@.str.2 = [32 x i8] c"A letra digitada foi minuscula\0A\00"
@.str.3 = [38 x i8] c"Voc\C3\AA digitou um caracter inv\C3\A1lido.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 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 ([32 x i8], [32 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 ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
br label %26
24: ; preds = %18, %14
%25 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 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 = [18 x i8] c"Digite uma letra:\00"
@str.4 = [37 x i8] c"Voc\C3\AA digitou um caracter inv\C3\A1lido.\00"
@str.5 = [31 x i8] c"A letra digitada foi minuscula\00"
@str.6 = [31 x i8] c"A letra digitada foi MAIUSCULA\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 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 ([31 x i8], [31 x i8]* @str.5, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @str.4, i64 0, i64 0)
%8 = select i1 %4, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @str.6, i64 0, i64 0), i8* %7
%9 = tail call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}