#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 *, int *);
int main(void) {
  char cor[37] = "0PVPPVPVVVPPVPVVVVPVPPVPVPPVPVPVPPVPV";
  int entrada;
  printf("Qual é o número? ");
  scanf("%i", &entrada);
  if (entrada < 0 || entrada > 36) {
    printf("Valor inválido");
    return 0;
  }
  printf("\nO número é %d, é %s", entrada,
         cor[entrada] == 'V'   ? "vermelho"
         : cor[entrada] == 'P' ? "preto"
                               : "verde");
  printf(", %s", entrada > 18 ? "grande" : "pequeno");
  printf(", %s", entrada % 2 == 0 ? "par" : "ímpar");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x25,%edx
call   1040 <memcpy@plt>
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    -0x34(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x34(%rbp)
jl     1186 <main+0x56>
cmpl   $0x24,-0x34(%rbp)
jle    11a0 <main+0x70>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1253 <main+0x123>
mov    -0x34(%rbp),%eax
mov    %eax,-0x38(%rbp)
movslq -0x34(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%eax
cmp    $0x56,%eax
jne    11c8 <main+0x98>
lea    0xea5(%rip),%rax
mov    %rax,-0x40(%rbp)
jmp    11ea <main+0xba>
movslq -0x34(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%edx
lea    0xe9b(%rip),%rax
lea    0xe8e(%rip),%rcx
cmp    $0x50,%edx
cmove  %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%esi
mov    -0x40(%rbp),%rdx
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%ecx
lea    0xe7c(%rip),%rsi
lea    0xe6e(%rip),%rax
cmp    $0x12,%ecx
cmovg  %rax,%rsi
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
lea    0xe56(%rip),%rsi
lea    0xe52(%rip),%rax
cmp    $0x0,%edx
cmove  %rax,%rsi
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
cmp    $0x25,%rsi
jb     1161 <main+0x41>
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11f1 <main+0xd1>
movabs $0xb56b42c5a,%rax
bt     %rsi,%rax
lea    0xed8(%rip),%rax
lea    0xecb(%rip),%rcx
cmovae %rax,%rcx
movabs $0x14a94bd3a4,%rax
bt     %rsi,%rax
lea    0xea9(%rip),%rdx
cmovae %rcx,%rdx
lea    0xe86(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x13,0xc(%rsp)
lea    0xea5(%rip),%rax
lea    0xea5(%rip),%rsi
cmovge %rax,%rsi
lea    0xe8e(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
testb  $0x1,0xc(%rsp)
lea    0xe8f(%rip),%rax
lea    0xe85(%rip),%rsi
cmove  %rax,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.cor = [37 x i8] c"0PVPPVPVVVPPVPVVVVPVPPVPVPPVPVPVPPVPV"
@.str = [20 x i8] c"Qual \C3\A9 o n\C3\BAmero? \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [16 x i8] c"Valor inv\C3\A1lido\00"
@.str.3 = [24 x i8] c"\0AO n\C3\BAmero \C3\A9 %d, \C3\A9 %s\00"
@.str.4 = [9 x i8] c"vermelho\00"
@.str.5 = [6 x i8] c"preto\00"
@.str.6 = [6 x i8] c"verde\00"
@.str.7 = [5 x i8] c", %s\00"
@.str.8 = [7 x i8] c"grande\00"
@.str.9 = [8 x i8] c"pequeno\00"
@.str.10 = [4 x i8] c"par\00"
@.str.11 = [7 x i8] c"\C3\ADmpar\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [37 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [37 x i8]* %2 to i8*
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %0
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 36
br i1 %11, label %12, label %14
12: ; preds = %9, %0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
br label %46
14: ; preds = %9
%15 = load i32, i32* %3
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [37 x i8], [37 x i8]* %2, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 86
br i1 %21, label %22, label %23
22: ; preds = %14
br label %32
23: ; preds = %14
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [37 x i8], [37 x i8]* %2, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 80
%30 = zext i1 %29 to i64
%31 = select i1 %29, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0)
br label %32
32: ; preds = %23, %22
%33 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), %22 ], [ %31, %23 ]
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %15, i8* %33)
%35 = load i32, i32* %3
%36 = icmp sgt i32 %35, 18
%37 = zext i1 %36 to i64
%38 = select i1 %36, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0)
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %38)
%40 = load i32, i32* %3
%41 = srem i32 %40, 2
%42 = icmp eq i32 %41, 0
%43 = zext i1 %42 to i64
%44 = select i1 %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0)
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %44)
br label %46
46: ; preds = %32, %12
%47 = load i32, i32* %1
ret i32 %47
}

LLVM IR (-O2):
@.str = [20 x i8] c"Qual \C3\A9 o n\C3\BAmero? \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [16 x i8] c"Valor inv\C3\A1lido\00"
@.str.3 = [24 x i8] c"\0AO n\C3\BAmero \C3\A9 %d, \C3\A9 %s\00"
@.str.4 = [9 x i8] c"vermelho\00"
@.str.5 = [6 x i8] c"preto\00"
@.str.6 = [6 x i8] c"verde\00"
@.str.7 = [5 x i8] c", %s\00"
@.str.8 = [7 x i8] c"grande\00"
@.str.9 = [8 x i8] c"pequeno\00"
@.str.10 = [4 x i8] c"par\00"
@.str.11 = [7 x i8] c"\C3\ADmpar\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 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), i32* %1)
%5 = load i32, i32* %1
%6 = icmp ugt i32 %5, 36
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %29
9: ; preds = %0
%10 = zext i32 %5 to i64
%11 = lshr i64 88739664804, %10
%12 = and i64 %11, 1
%13 = icmp eq i64 %12, 0
%14 = lshr i64 48699288666, %10
%15 = and i64 %14, 1
%16 = icmp eq i64 %15, 0
%17 = select i1 %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0)
%18 = select i1 %13, i8* %17, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %5, i8* %18)
%20 = load i32, i32* %1
%21 = icmp sgt i32 %20, 18
%22 = select i1 %21, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %22)
%24 = load i32, i32* %1
%25 = and i32 %24, 1
%26 = icmp eq i32 %25, 0
%27 = select i1 %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0)
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %27)
br label %29
29: ; preds = %9, %7
ret i32 0
}