#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 *);
main() {
  int idade;
  printf("Insira a idade do morador: ");
  scanf("%d", &idade);
  if (idade >= 5 && idade <= 7) {
    printf("Infantil A");
  } else {
    if (idade >= 8 && idade <= 10) {
      printf("Infantil B");
    } else {
      if (idade >= 11 && idade <= 13) {
        printf("Infantil C");
      } else {
        if (idade >= 14 && idade <= 17) {
          printf("Infantil D");
        } else {
          printf("Adulto");
        }
      }
    }
  }
}


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    0xeda(%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    0xeb9(%rip),%rdi
call   1030 <printf@plt>
jmp    11fa <main+0xda>
cmpl   $0x8,-0x8(%rbp)
jl     1195 <main+0x75>
cmpl   $0xa,-0x8(%rbp)
jg     1195 <main+0x75>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    11f5 <main+0xd5>
cmpl   $0xb,-0x8(%rbp)
jl     11ba <main+0x9a>
cmpl   $0xd,-0x8(%rbp)
jg     11ba <main+0x9a>
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
jmp    11f0 <main+0xd0>
cmpl   $0xe,-0x8(%rbp)
jl     11df <main+0xbf>
cmpl   $0x11,-0x8(%rbp)
jg     11df <main+0xbf>
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
jmp    11eb <main+0xcb>
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
jmp    11f0 <main+0xd0>
jmp    11f5 <main+0xd5>
jmp    11fa <main+0xda>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee8(%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    0xece(%rip),%rdi
jmp    118d <main+0x6d>
lea    -0x8(%rax),%ecx
cmp    $0x3,%ecx
jae    1164 <main+0x44>
lea    0xec8(%rip),%rdi
jmp    118d <main+0x6d>
lea    -0xb(%rax),%ecx
cmp    $0x3,%ecx
jae    1175 <main+0x55>
lea    0xec2(%rip),%rdi
jmp    118d <main+0x6d>
add    $0xfffffff2,%eax
cmp    $0x4,%eax
lea    0xebe(%rip),%rax
lea    0xec2(%rip),%rdi
cmovb  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Insira a idade do morador: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [11 x i8] c"Infantil A\00"
@.str.3 = [11 x i8] c"Infantil B\00"
@.str.4 = [11 x i8] c"Infantil C\00"
@.str.5 = [11 x i8] c"Infantil D\00"
@.str.6 = [7 x i8] c"Adulto\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 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 ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %41
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 ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %40
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 ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
br label %39
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 ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
br label %38
36: ; preds = %31, %28
%37 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %38
38: ; preds = %36, %34
br label %39
39: ; preds = %38, %26
br label %40
40: ; preds = %39, %18
br label %41
41: ; preds = %40, %10
%42 = load i32, i32* %1
ret i32 %42
}

LLVM IR (-O2):
@.str = [28 x i8] c"Insira a idade do morador: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [11 x i8] c"Infantil A\00"
@.str.3 = [11 x i8] c"Infantil B\00"
@.str.4 = [11 x i8] c"Infantil C\00"
@.str.5 = [11 x i8] c"Infantil D\00"
@.str.6 = [7 x i8] c"Adulto\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 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 %18, label %8
8: ; preds = %0
%9 = add i32 %5, -8
%10 = icmp ult i32 %9, 3
br i1 %10, label %18, label %11
11: ; preds = %8
%12 = add i32 %5, -11
%13 = icmp ult i32 %12, 3
br i1 %13, label %18, label %14
14: ; preds = %11
%15 = add i32 %5, -14
%16 = icmp ult i32 %15, 4
%17 = select i1 %16, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0)
br label %18
18: ; preds = %14, %11, %8, %0
%19 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), %0 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), %8 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), %11 ], [ %17, %14 ]
%20 = call i32 @printf(i8* dereferenceable(1) %19)
ret i32 0
}