#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 /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  int idade;
  printf("Digite a sua idade: ");
  scanf("%d", &idade);
  printf("Idade: %d", idade);
  if (idade < 18) {
    printf("\nMenor de idade\n");
  }
  if (idade >= 18) {
    printf("\nMaior de idade\n");
  }
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x12,-0x14(%rbp)
jge    118d <main+0x5d>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x12,-0x14(%rbp)
jl     11a5 <main+0x75>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe95(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x11,0x4(%rsp)
jg     118c <main+0x4c>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x12,0x4(%rsp)
jl     1198 <main+0x58>
lea    0xe92(%rip),%rdi
call   1030 <puts@plt>
lea    0xe80(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Digite a sua idade: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"Idade: %d\00"
@.str.3 = [17 x i8] c"\0AMenor de idade\0A\00"
@.str.4 = [17 x i8] c"\0AMaior de idade\0A\00"
@.str.5 = [6 x i8] c"pause\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 18
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
%16 = load i32, i32* %6
%17 = icmp sge i32 %16, 18
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
br label %20
20: ; preds = %18, %15
%21 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Digite a sua idade: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"Idade: %d\00"
@.str.5 = [6 x i8] c"pause\00"
@str = [16 x i8] c"\0AMaior de idade\00"
@str.6 = [16 x i8] c"\0AMenor de idade\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 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 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 18
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.6, i64 0, i64 0))
%13 = load i32, i32* %3
%14 = icmp sgt i32 %13, 17
br i1 %14, label %15, label %17
15: ; preds = %2, %11
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %17
17: ; preds = %15, %11
%18 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}