#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("------ Categoria de Natação ------\n");
  printf("Digite a idade: ");
  scanf("%d", &idade);
  if (idade < 5) {
    printf("Não tem categoria para esta idade!");
  } else 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 {
    printf("Categoria: Sênior");
  }
  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    0xee4(%rip),%rdi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x5,-0x8(%rbp)
jge    1172 <main+0x52>
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
jmp    1226 <main+0x106>
cmpl   $0x5,-0x8(%rbp)
jl     1197 <main+0x77>
cmpl   $0x7,-0x8(%rbp)
jg     1197 <main+0x77>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
jmp    1221 <main+0x101>
cmpl   $0x8,-0x8(%rbp)
jl     11bc <main+0x9c>
cmpl   $0xa,-0x8(%rbp)
jg     11bc <main+0x9c>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
jmp    121c <main+0xfc>
cmpl   $0xb,-0x8(%rbp)
jl     11e1 <main+0xc1>
cmpl   $0xd,-0x8(%rbp)
jg     11e1 <main+0xc1>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    1217 <main+0xf7>
cmpl   $0xe,-0x8(%rbp)
jl     1206 <main+0xe6>
cmpl   $0x11,-0x8(%rbp)
jg     1206 <main+0xe6>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
jmp    1212 <main+0xf2>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    1217 <main+0xf7>
jmp    121c <main+0xfc>
jmp    1221 <main+0x101>
jmp    1226 <main+0x106>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf69(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x5,%eax
jge    116c <main+0x3c>
lea    0xeaa(%rip),%rdi
jmp    11ab <main+0x7b>
cmp    $0x8,%eax
jae    117a <main+0x4a>
lea    0xec0(%rip),%rdi
jmp    11ab <main+0x7b>
cmp    $0xb,%eax
jae    1188 <main+0x58>
lea    0xec8(%rip),%rdi
jmp    11ab <main+0x7b>
cmp    $0xe,%eax
jae    1196 <main+0x66>
lea    0xed0(%rip),%rdi
jmp    11ab <main+0x7b>
cmp    $0x12,%eax
lea    0xed9(%rip),%rax
lea    0xee7(%rip),%rdi
cmovb  %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"------ Categoria de Nata\C3\A7\C3\A3o ------\0A\00"
@.str.1 = [17 x i8] c"Digite a idade: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [36 x i8] c"N\C3\A3o tem categoria para esta idade!\00"
@.str.4 = [22 x i8] c"Categoria: Infantil A\00"
@.str.5 = [22 x i8] c"Categoria: Infantil B\00"
@.str.6 = [21 x i8] c"Categoria: Juvenil A\00"
@.str.7 = [21 x i8] c"Categoria: Juvenil B\00"
@.str.8 = [19 x i8] c"Categoria: S\C3\AAnior\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 5
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
br label %48
10: ; preds = %0
%11 = load i32, i32* %2
%12 = icmp sge i32 %11, 5
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i32, i32* %2
%15 = icmp sle i32 %14, 7
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %47
18: ; preds = %13, %10
%19 = load i32, i32* %2
%20 = icmp sge i32 %19, 8
br i1 %20, label %21, label %26
21: ; preds = %18
%22 = load i32, i32* %2
%23 = icmp sle i32 %22, 10
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
br label %46
26: ; preds = %21, %18
%27 = load i32, i32* %2
%28 = icmp sge i32 %27, 11
br i1 %28, label %29, label %34
29: ; preds = %26
%30 = load i32, i32* %2
%31 = icmp sle i32 %30, 13
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
br label %45
34: ; preds = %29, %26
%35 = load i32, i32* %2
%36 = icmp sge i32 %35, 14
br i1 %36, label %37, label %42
37: ; preds = %34
%38 = load i32, i32* %2
%39 = icmp sle i32 %38, 17
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
br label %44
42: ; preds = %37, %34
%43 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
br label %44
44: ; preds = %42, %40
br label %45
45: ; preds = %44, %32
br label %46
46: ; preds = %45, %24
br label %47
47: ; preds = %46, %16
br label %48
48: ; preds = %47, %8
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c"Digite a idade: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [36 x i8] c"N\C3\A3o tem categoria para esta idade!\00"
@.str.4 = [22 x i8] c"Categoria: Infantil A\00"
@.str.5 = [22 x i8] c"Categoria: Infantil B\00"
@.str.6 = [21 x i8] c"Categoria: Juvenil A\00"
@.str.7 = [21 x i8] c"Categoria: Juvenil B\00"
@.str.8 = [19 x i8] c"Categoria: S\C3\AAnior\00"
@str = [37 x i8] c"------ Categoria de Nata\C3\A7\C3\A3o ------\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 5
br i1 %7, label %17, label %8
8: ; preds = %0
%9 = icmp ult i32 %6, 8
br i1 %9, label %17, label %10
10: ; preds = %8
%11 = icmp ult i32 %6, 11
br i1 %11, label %17, label %12
12: ; preds = %10
%13 = icmp ult i32 %6, 14
br i1 %13, label %17, label %14
14: ; preds = %12
%15 = icmp ult i32 %6, 18
%16 = select i1 %15, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0)
br label %17
17: ; preds = %14, %12, %10, %8, %0
%18 = phi i8* [ getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), %0 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), %8 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), %10 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), %12 ], [ %16, %14 ]
%19 = call i32 @printf(i8* dereferenceable(1) %18)
ret i32 0
}