#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("Digite a sua idade: ");
  scanf("%d", &idade);
  if ((idade >= 5) && (idade <= 7)) {
    printf("Categoria Infantil A");
  } else if ((idade >= 8) && (idade <= 10)) {
    printf("Categoria Infantil B");
  } else if ((idade >= 11) && (idade <= 13)) {
    printf("Categoria Juvenil A");
  } else if ((idade >= 14) && (idade <= 17)) {
    printf("Categoria Juvenil B");
  } else if ((idade >= 18)) {
    printf("Categoria Adulto");
  } else {
    printf("Você é muito novo para fazer natação");
  }
  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    0xed3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x5,-0x8(%rbp)
jl     1170 <main+0x50>
cmpl   $0x7,-0x8(%rbp)
jg     1170 <main+0x50>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    121a <main+0xfa>
cmpl   $0x8,-0x8(%rbp)
jl     1195 <main+0x75>
cmpl   $0xa,-0x8(%rbp)
jg     1195 <main+0x75>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
jmp    1215 <main+0xf5>
cmpl   $0xb,-0x8(%rbp)
jl     11ba <main+0x9a>
cmpl   $0xd,-0x8(%rbp)
jg     11ba <main+0x9a>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
jmp    1210 <main+0xf0>
cmpl   $0xe,-0x8(%rbp)
jl     11df <main+0xbf>
cmpl   $0x11,-0x8(%rbp)
jg     11df <main+0xbf>
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
jmp    120b <main+0xeb>
cmpl   $0x12,-0x8(%rbp)
jl     11fa <main+0xda>
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
jmp    1206 <main+0xe6>
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
jmp    120b <main+0xeb>
jmp    1210 <main+0xf0>
jmp    1215 <main+0xf5>
jmp    121a <main+0xfa>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
lea    -0x5(%rax),%ecx
cmp    $0x3,%ecx
jae    1153 <main+0x33>
lea    0xec7(%rip),%rdi
jmp    119b <main+0x7b>
lea    -0x8(%rax),%ecx
cmp    $0x3,%ecx
jae    1164 <main+0x44>
lea    0xecb(%rip),%rdi
jmp    119b <main+0x7b>
lea    -0xb(%rax),%ecx
cmp    $0x3,%ecx
jae    1175 <main+0x55>
lea    0xecf(%rip),%rdi
jmp    119b <main+0x7b>
lea    -0xe(%rax),%ecx
cmp    $0x4,%ecx
jae    1186 <main+0x66>
lea    0xed2(%rip),%rdi
jmp    119b <main+0x7b>
cmp    $0x12,%eax
lea    0xeda(%rip),%rax
lea    0xee4(%rip),%rdi
cmovge %rax,%rdi
call   1030 <printf@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 = [21 x i8] c"Categoria Infantil A\00"
@.str.3 = [21 x i8] c"Categoria Infantil B\00"
@.str.4 = [20 x i8] c"Categoria Juvenil A\00"
@.str.5 = [20 x i8] c"Categoria Juvenil B\00"
@.str.6 = [17 x i8] c"Categoria Adulto\00"
@.str.7 = [41 x i8] c"Voc\C3\AA \C3\A9 muito novo para fazer nata\C3\A7\C3\A3o\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 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 sge i32 %5, 5
br i1 %6, label %7, label %12
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp sle i32 %8, 7
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %47
12: ; preds = %7, %0
%13 = load i32, i32* %2
%14 = icmp sge i32 %13, 8
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp sle i32 %16, 10
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %46
20: ; preds = %15, %12
%21 = load i32, i32* %2
%22 = icmp sge i32 %21, 11
br i1 %22, label %23, label %28
23: ; preds = %20
%24 = load i32, i32* %2
%25 = icmp sle i32 %24, 13
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
br label %45
28: ; preds = %23, %20
%29 = load i32, i32* %2
%30 = icmp sge i32 %29, 14
br i1 %30, label %31, label %36
31: ; preds = %28
%32 = load i32, i32* %2
%33 = icmp sle i32 %32, 17
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
br label %44
36: ; preds = %31, %28
%37 = load i32, i32* %2
%38 = icmp sge i32 %37, 18
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
br label %43
41: ; preds = %36
%42 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0))
br label %43
43: ; preds = %41, %39
br label %44
44: ; preds = %43, %34
br label %45
45: ; preds = %44, %26
br label %46
46: ; preds = %45, %18
br label %47
47: ; preds = %46, %10
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 = [21 x i8] c"Categoria Infantil A\00"
@.str.3 = [21 x i8] c"Categoria Infantil B\00"
@.str.4 = [20 x i8] c"Categoria Juvenil A\00"
@.str.5 = [20 x i8] c"Categoria Juvenil B\00"
@.str.6 = [17 x i8] c"Categoria Adulto\00"
@.str.7 = [41 x i8] c"Voc\C3\AA \C3\A9 muito novo para fazer nata\C3\A7\C3\A3o\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 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 = add i32 %5, -5
%7 = icmp ult i32 %6, 3
br i1 %7, label %20, label %8
8: ; preds = %0
%9 = add i32 %5, -8
%10 = icmp ult i32 %9, 3
br i1 %10, label %20, label %11
11: ; preds = %8
%12 = add i32 %5, -11
%13 = icmp ult i32 %12, 3
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = add i32 %5, -14
%16 = icmp ult i32 %15, 4
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = icmp sgt i32 %5, 17
%19 = select i1 %18, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0)
br label %20
20: ; preds = %17, %14, %11, %8, %0
%21 = phi i8* [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), %0 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), %8 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), %11 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), %14 ], [ %19, %17 ]
%22 = call i32 @printf(i8* dereferenceable(1) %21)
ret i32 0
}