#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*/ LC_ALL;
int /*<<< orphan*/ getch();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
main() {
  setlocale(LC_ALL, "Portuguese");
  char num;
  printf("digite um letra ou número: ");
  scanf("%c", &num);
  printf("\n");
  if (num >= 'a' && num <= 'z') {
    printf(" %c é uma letra minuscula!!!", num);
  } else if (num >= 'A' && num <= 'Z') {
    printf(" %c é uma letra maiuscula !!!", num);
  } else if (num >= '0' && num < '9') {
    printf(" %c é um número !!!", num);
  } else {
    printf("%c é um caracter:");
  }
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
lea    0xea1(%rip),%rsi
call   1040 <setlocale@plt>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     11c1 <main+0x81>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     11c1 <main+0x81>
movsbl -0x5(%rbp),%esi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123b <main+0xfb>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     11f2 <main+0xb2>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     11f2 <main+0xb2>
movsbl -0x5(%rbp),%esi
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1236 <main+0xf6>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1223 <main+0xe3>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jge    1223 <main+0xe3>
movsbl -0x5(%rbp),%esi
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1231 <main+0xf1>
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1236 <main+0xf6>
jmp    123b <main+0xfb>
mov    $0x0,%al
call   1060 <getch@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
call   1050 <setlocale@plt>
lea    0xe9e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xead(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1060 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movsbl 0x7(%rsp),%esi
lea    -0x61(%rsi),%eax
cmp    $0x19,%al
ja     11a4 <main+0x54>
lea    0xe89(%rip),%rdi
jmp    11c2 <main+0x72>
lea    -0x41(%rsi),%eax
cmp    $0x19,%al
ja     11b4 <main+0x64>
lea    0xe97(%rip),%rdi
jmp    11c2 <main+0x72>
lea    -0x30(%rsi),%eax
cmp    $0x8,%al
ja     11d4 <main+0x84>
lea    0xea6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <getch@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xea3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11c9 <main+0x79>

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [11 x i8] c"Portuguese\00"
@.str.1 = [29 x i8] c"digite um letra ou n\C3\BAmero: \00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [30 x i8] c" %c \C3\A9 uma letra minuscula!!!\00"
@.str.5 = [31 x i8] c" %c \C3\A9 uma letra maiuscula !!!\00"
@.str.6 = [22 x i8] c" %c \C3\A9 um n\C3\BAmero !!!\00"
@.str.7 = [19 x i8] c"%c \C3\A9 um caracter:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = load i32, i32* @LC_ALL
%4 = call i32 @setlocale(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %19
11: ; preds = %0
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp sle i32 %13, 122
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i32 %17)
br label %47
19: ; preds = %11, %0
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = icmp sge i32 %21, 65
br i1 %22, label %23, label %31
23: ; preds = %19
%24 = load i8, i8* %2
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %25, 90
br i1 %26, label %27, label %31
27: ; preds = %23
%28 = load i8, i8* %2
%29 = sext i8 %28 to i32
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i32 %29)
br label %46
31: ; preds = %23, %19
%32 = load i8, i8* %2
%33 = sext i8 %32 to i32
%34 = icmp sge i32 %33, 48
br i1 %34, label %35, label %43
35: ; preds = %31
%36 = load i8, i8* %2
%37 = sext i8 %36 to i32
%38 = icmp slt i32 %37, 57
br i1 %38, label %39, label %43
39: ; preds = %35
%40 = load i8, i8* %2
%41 = sext i8 %40 to i32
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i32 %41)
br label %45
43: ; preds = %35, %31
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
br label %45
45: ; preds = %43, %39
br label %46
46: ; preds = %45, %27
br label %47
47: ; preds = %46, %15
%48 = call i32 (...) @getch()
%49 = load i32, i32* %1
ret i32 %49
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [11 x i8] c"Portuguese\00"
@.str.1 = [29 x i8] c"digite um letra ou n\C3\BAmero: \00"
@.str.2 = [3 x i8] c"%c\00"
@.str.4 = [30 x i8] c" %c \C3\A9 uma letra minuscula!!!\00"
@.str.5 = [31 x i8] c" %c \C3\A9 uma letra maiuscula !!!\00"
@.str.6 = [22 x i8] c" %c \C3\A9 um n\C3\BAmero !!!\00"
@.str.7 = [19 x i8] c"%c \C3\A9 um caracter:\00"
define i32 @main() {
%1 = alloca i8
%2 = load i32, i32* @LC_ALL
%3 = tail call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%6 = call i32 @putchar(i32 10)
%7 = load i8, i8* %1
%8 = sext i8 %7 to i32
%9 = add i8 %7, -97
%10 = icmp ult i8 %9, 26
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i32 %8)
br label %25
13: ; preds = %0
%14 = add i8 %7, -65
%15 = icmp ult i8 %14, 26
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i32 %8)
br label %25
18: ; preds = %13
%19 = add i8 %7, -48
%20 = icmp ult i8 %19, 9
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i32 %8)
br label %25
23: ; preds = %18
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
br label %25
25: ; preds = %16, %23, %21, %11
%26 = call i32 (...) @getch()
ret i32 0
}