#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 ano, idade;
  printf("Informe o seu Ano de Nascimento:\n");
  scanf("%d", &ano);
  if (ano < 11) {
    idade = 15 - ano;
    printf("\nSua idade é %d", idade);
  } else if (ano < 100) {
    idade = 115 - ano;
    printf("\nSua idade é %d", idade);
  } else {
    idade = 2015 - ano;
    printf("\nSua idade é %d", idade);
  }
  return 0;
}


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    0xeec(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xb,-0x8(%rbp)
jge    1178 <main+0x58>
mov    $0xf,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c4 <main+0xa4>
cmpl   $0x64,-0x8(%rbp)
jge    11a3 <main+0x83>
mov    $0x73,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11bf <main+0x9f>
mov    $0x7df,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c4 <main+0xa4>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
lea    0xeca(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x64,%eax
mov    $0x73,%ecx
mov    $0x7df,%edx
cmovb  %ecx,%edx
cmp    $0xb,%eax
mov    $0xf,%esi
cmovge %edx,%esi
sub    %eax,%esi
lea    0xe8a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Informe o seu Ano de Nascimento:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"\0ASua idade \C3\A9 %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 11
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = load i32, i32* %2
%10 = sub nsw i32 15, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %11)
br label %27
13: ; preds = %0
%14 = load i32, i32* %2
%15 = icmp slt i32 %14, 100
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load i32, i32* %2
%18 = sub nsw i32 115, %17
store i32 %18, i32* %3
%19 = load i32, i32* %3
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %19)
br label %26
21: ; preds = %13
%22 = load i32, i32* %2
%23 = sub nsw i32 2015, %22
store i32 %23, i32* %3
%24 = load i32, i32* %3
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %21, %16
br label %27
27: ; preds = %26, %8
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"\0ASua idade \C3\A9 %d\00"
@str = [33 x i8] c"Informe o seu Ano de Nascimento:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 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, 11
%7 = icmp ult i32 %5, 100
%8 = select i1 %7, i32 115, i32 2015
%9 = select i1 %6, i32 15, i32 %8
%10 = sub nsw i32 %9, %5
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}