#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() {
  int idade;
  printf("Qual a sua idade?");
  scanf("%d", &idade);
  if (idade <= 15) {
    printf("\nVocê não pode votar.\n");
  }
  if (idade >= 18 && idade <= 70) {
    printf("\n Você pode votar \n");
  }
  if (idade >= 16 && idade <= 17 || idade > 70) {
    printf("\n O voto é facultativo \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>
lea    0xed0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xf,-0x8(%rbp)
jg     1161 <main+0x41>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x12,-0x8(%rbp)
jl     1181 <main+0x61>
cmpl   $0x46,-0x8(%rbp)
jg     1181 <main+0x61>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x10,-0x8(%rbp)
jl     1195 <main+0x75>
cmpl   $0x11,-0x8(%rbp)
jle    119f <main+0x7f>
cmpl   $0x46,-0x8(%rbp)
jle    11ab <main+0x8b>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0xf,%eax
jg     1167 <main+0x37>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%eax
lea    -0x12(%rax),%ecx
cmp    $0x34,%ecx
ja     117f <main+0x4f>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%eax
cmp    $0x46,%eax
jg     118c <main+0x5c>
and    $0xfffffffe,%eax
cmp    $0x10,%eax
jne    1198 <main+0x68>
lea    0xe82(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Qual a sua idade?\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"\0AVoc\C3\AA n\C3\A3o pode votar.\0A\00"
@.str.3 = [21 x i8] c"\0A Voc\C3\AA pode votar \0A\00"
@.str.4 = [26 x i8] c"\0A O voto \C3\A9 facultativo \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 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 sle i32 %5, 15
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
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, 70
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
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 sle i32 %21, 17
br i1 %22, label %26, label %23
23: ; preds = %20, %17
%24 = load i32, i32* %2
%25 = icmp sgt i32 %24, 70
br i1 %25, label %26, label %28
26: ; preds = %23, %20
%27 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
br label %28
28: ; preds = %26, %23
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Qual a sua idade?\00"
@.str.1 = [3 x i8] c"%d\00"
@str = [25 x i8] c"\0A O voto \C3\A9 facultativo \00"
@str.5 = [20 x i8] c"\0A Voc\C3\AA pode votar \00"
@str.6 = [24 x i8] c"\0AVoc\C3\AA n\C3\A3o pode votar.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 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 %10
7: ; preds = %0
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.6, i64 0, i64 0))
%9 = load i32, i32* %1
br label %10
10: ; preds = %7, %0
%11 = phi i32 [ %9, %7 ], [ %5, %0 ]
%12 = add i32 %11, -18
%13 = icmp ult i32 %12, 53
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.5, i64 0, i64 0))
%16 = load i32, i32* %1
br label %17
17: ; preds = %14, %10
%18 = phi i32 [ %16, %14 ], [ %11, %10 ]
%19 = and i32 %18, -2
%20 = icmp eq i32 %19, 16
%21 = icmp sgt i32 %18, 70
%22 = or i1 %21, %20
br i1 %22, label %23, label %25
23: ; preds = %17
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %25
25: ; preds = %17, %23
ret i32 0
}