#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(void) {
  int age;
  printf("Enter your age: ");
  scanf("%d", &age);
  if (age >= 0 && age <= 12)
    printf("\nYou are child.");
  else if (age >= 13 && age <= 19)
    printf("\nYou are Teenager");
  else if (age >= 20 && age <= 30)
    printf("\nYou are an Adult");
  else if (age >= 31 && age <= 50)
    printf("\nYou are Matured");
  else
    printf("\nYou are an Old");
  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    0xecf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jl     1170 <main+0x50>
cmpl   $0xc,-0x8(%rbp)
jg     1170 <main+0x50>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    11fa <main+0xda>
cmpl   $0xd,-0x8(%rbp)
jl     1195 <main+0x75>
cmpl   $0x13,-0x8(%rbp)
jg     1195 <main+0x75>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    11f5 <main+0xd5>
cmpl   $0x14,-0x8(%rbp)
jl     11ba <main+0x9a>
cmpl   $0x1e,-0x8(%rbp)
jg     11ba <main+0x9a>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
jmp    11f0 <main+0xd0>
cmpl   $0x1f,-0x8(%rbp)
jl     11df <main+0xbf>
cmpl   $0x32,-0x8(%rbp)
jg     11df <main+0xbf>
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
jmp    11eb <main+0xcb>
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
jmp    11f0 <main+0xd0>
jmp    11f5 <main+0xd5>
jmp    11fa <main+0xda>
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    0xedd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0xd,%eax
jae    1150 <main+0x30>
lea    0xec6(%rip),%rdi
jmp    118a <main+0x6a>
lea    -0xd(%rax),%ecx
cmp    $0x7,%ecx
jae    1161 <main+0x41>
lea    0xec5(%rip),%rdi
jmp    118a <main+0x6a>
lea    -0x14(%rax),%ecx
cmp    $0xb,%ecx
jae    1172 <main+0x52>
lea    0xec6(%rip),%rdi
jmp    118a <main+0x6a>
add    $0xffffffe1,%eax
cmp    $0x14,%eax
lea    0xec9(%rip),%rax
lea    0xed3(%rip),%rdi
cmovb  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter your age: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"\0AYou are child.\00"
@.str.3 = [18 x i8] c"\0AYou are Teenager\00"
@.str.4 = [18 x i8] c"\0AYou are an Adult\00"
@.str.5 = [17 x i8] c"\0AYou are Matured\00"
@.str.6 = [16 x i8] c"\0AYou are an Old\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 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, 0
br i1 %6, label %7, label %12
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp sle i32 %8, 12
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 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, 13
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp sle i32 %16, 19
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 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, 20
br i1 %22, label %23, label %28
23: ; preds = %20
%24 = load i32, i32* %2
%25 = icmp sle i32 %24, 30
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 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, 31
br i1 %30, label %31, label %36
31: ; preds = %28
%32 = load i32, i32* %2
%33 = icmp sle i32 %32, 50
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
br label %38
36: ; preds = %31, %28
%37 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 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
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter your age: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"\0AYou are child.\00"
@.str.3 = [18 x i8] c"\0AYou are Teenager\00"
@.str.4 = [18 x i8] c"\0AYou are an Adult\00"
@.str.5 = [17 x i8] c"\0AYou are Matured\00"
@.str.6 = [16 x i8] c"\0AYou are an Old\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 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 ult i32 %5, 13
br i1 %6, label %17, label %7
7: ; preds = %0
%8 = add i32 %5, -13
%9 = icmp ult i32 %8, 7
br i1 %9, label %17, label %10
10: ; preds = %7
%11 = add i32 %5, -20
%12 = icmp ult i32 %11, 11
br i1 %12, label %17, label %13
13: ; preds = %10
%14 = add i32 %5, -31
%15 = icmp ult i32 %14, 20
%16 = select i1 %15, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0)
br label %17
17: ; preds = %13, %10, %7, %0
%18 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), %0 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), %7 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), %10 ], [ %16, %13 ]
%19 = call i32 @printf(i8* dereferenceable(1) %18)
ret i32 0
}