#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char caracter;
  printf("Digite um caracter: ");
  scanf("%c", &caracter);
  if (caracter >= '0' && caracter <= '9') {
    printf("%c é um número\n", caracter);
  } else if (caracter >= 'A' && caracter <= 'Z') {
    printf("%c é uma letra maiuscula\n", caracter);
  } else if (caracter >= 'a' && caracter <= 'z') {
    printf("%c é uma letra minúscula\n", caracter);
  } else {
    printf("%c é um símbolo\n", caracter);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     117e <main+0x5e>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     117e <main+0x5e>
movsbl -0x5(%rbp),%esi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fc <main+0xdc>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     11af <main+0x8f>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     11af <main+0x8f>
movsbl -0x5(%rbp),%esi
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f7 <main+0xd7>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     11e0 <main+0xc0>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     11e0 <main+0xc0>
movsbl -0x5(%rbp),%esi
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f2 <main+0xd2>
movsbl -0x5(%rbp),%esi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f7 <main+0xd7>
jmp    11fc <main+0xdc>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
movsbl 0x7(%rsp),%esi
lea    -0x30(%rsi),%eax
cmp    $0xa,%al
jae    1155 <main+0x35>
lea    0xec5(%rip),%rdi
jmp    117c <main+0x5c>
lea    -0x41(%rsi),%eax
cmp    $0x1a,%al
jae    1165 <main+0x45>
lea    0xec7(%rip),%rdi
jmp    117c <main+0x5c>
lea    -0x61(%rsi),%eax
cmp    $0x1a,%al
lea    0xed4(%rip),%rax
lea    0xee9(%rip),%rdi
cmovb  %rax,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"Digite um caracter: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [18 x i8] c"%c \C3\A9 um n\C3\BAmero\0A\00"
@.str.3 = [27 x i8] c"%c \C3\A9 uma letra maiuscula\0A\00"
@.str.4 = [28 x i8] c"%c \C3\A9 uma letra min\C3\BAscula\0A\00"
@.str.5 = [19 x i8] c"%c \C3\A9 um s\C3\ADmbolo\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = add i8 %4, -48
%6 = icmp ult i8 %5, 10
br i1 %6, label %14, label %7
7: ; preds = %0
%8 = add i8 %4, -65
%9 = icmp ult i8 %8, 26
br i1 %9, label %14, label %10
10: ; preds = %7
%11 = add i8 %4, -97
%12 = icmp ult i8 %11, 26
%13 = select i1 %12, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0)
br label %14
14: ; preds = %10, %7, %0
%15 = phi i8* [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), %0 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), %7 ], [ %13, %10 ]
%16 = sext i8 %4 to i32
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %15, i32 %16)
ret i32 0
}