#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*/ getch();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int idade;
  printf("A qual classe eleitoral voce pertence?\nDigite sua idade para "
         "descobrir!\n\n");
  scanf("%d", &idade);
  if (idade < 16) {
    printf("Voce e NAO VOTANTE\n");
    idade = 0;
  }
  if ((idade >= 18) && (idade <= 65)) {
    printf("Voce e ELEITOR OBRIGATORIO\n");
    idade = 0;
  }
  if (((idade >= 16) && (idade < 18)) || (idade > 65)) {
    printf("Voce e ELEITOR OPCIONAL\n");
    idade = 0;
  }
  getch();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x10,-0x8(%rbp)
jge    1178 <main+0x48>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x12,-0x8(%rbp)
jl     119f <main+0x6f>
cmpl   $0x41,-0x8(%rbp)
jg     119f <main+0x6f>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jl     11b3 <main+0x83>
cmpl   $0x12,-0x8(%rbp)
jl     11bd <main+0x8d>
cmpl   $0x41,-0x8(%rbp)
jle    11d0 <main+0xa0>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getch@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0xf,%eax
jg     1160 <main+0x30>
lea    0xf21(%rip),%rdi
jmp    116f <main+0x3f>
lea    -0x12(%rax),%ecx
cmp    $0x2f,%ecx
ja     117e <main+0x4e>
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,0x4(%rsp)
xor    %eax,%eax
cmp    $0x41,%eax
ja     118b <main+0x5b>
and    $0xfffffffe,%eax
cmp    $0x10,%eax
jne    119f <main+0x6f>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,0x4(%rsp)
xor    %eax,%eax
call   1050 <getch@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [74 x i8] c"A qual classe eleitoral voce pertence?\0ADigite sua idade para descobrir!\0A\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"Voce e NAO VOTANTE\0A\00"
@.str.3 = [28 x i8] c"Voce e ELEITOR OBRIGATORIO\0A\00"
@.str.4 = [25 x i8] c"Voce e ELEITOR OPCIONAL\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 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* %2)
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 16
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %2
br label %9
9: ; preds = %7, %0
%10 = load i32, i32* %2
%11 = icmp sge i32 %10, 18
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i32, i32* %2
%14 = icmp sle i32 %13, 65
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %2
br label %17
17: ; preds = %15, %12, %9
%18 = load i32, i32* %2
%19 = icmp sge i32 %18, 16
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i32, i32* %2
%22 = icmp slt i32 %21, 18
br i1 %22, label %26, label %23
23: ; preds = %20, %17
%24 = load i32, i32* %2
%25 = icmp sgt i32 %24, 65
br i1 %25, label %26, label %28
26: ; preds = %23, %20
%27 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %2
br label %28
28: ; preds = %26, %23
%29 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [73 x i8] c"A qual classe eleitoral voce pertence?\0ADigite sua idade para descobrir!\0A\00"
@str.5 = [24 x i8] c"Voce e ELEITOR OPCIONAL\00"
@str.6 = [27 x i8] c"Voce e ELEITOR OBRIGATORIO\00"
@str.7 = [19 x i8] c"Voce e NAO VOTANTE\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 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 slt i32 %5, 16
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.7, i64 0, i64 0))
store i32 0, i32* %1
br label %14
9: ; preds = %0
%10 = add nsw i32 %5, -18
%11 = icmp ult i32 %10, 48
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
store i32 0, i32* %1
br label %14
14: ; preds = %7, %12, %9
%15 = phi i32 [ 0, %12 ], [ %5, %9 ], [ 0, %7 ]
%16 = and i32 %15, -2
%17 = icmp eq i32 %16, 16
%18 = icmp ugt i32 %15, 65
%19 = or i1 %18, %17
br i1 %19, label %20, label %22
20: ; preds = %14
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.5, i64 0, i64 0))
store i32 0, i32* %1
br label %22
22: ; preds = %14, %20
%23 = call i32 (...) @getch()
ret i32 0
}