#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/, char *, int *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main() {
  int age;
  fprintf(stdout, "Enter age: ");
  fscanf(stdin, "%d", &age);
  switch (age) {
  case 0:
  case 1:
  case 2:
  case 3:
    fprintf(stdout, "Baby\n");
    break;
  case 4:
  case 5:
  case 6:
  case 7:
    fprintf(stdout, "Kindergarden\n");
    break;
  case 8:
  case 9:
  case 10:
  case 11:
  case 12:
  case 13:
  case 14:
  case 15:
  case 16:
  case 17:
  case 18:
    fprintf(stdout, "School\n");
    break;
  case 19:
  case 20:
  case 21:
  case 22:
  case 23:
  case 24:
  case 25:
    fprintf(stdout, "Uni\n");
    break;
  default:
    fprintf(stdout, "Work\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xf29(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xf20(%rip),%rsi
lea    -0x8(%rbp),%rdx
call   1030 <fscanf@plt>
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x19,%rax
ja     11ea <main+0xca>
mov    -0x10(%rbp),%rax
lea    0xe87(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2e4f(%rip),%rax
mov    (%rax),%edi
lea    0xee5(%rip),%rsi
call   1040 <fprintf@plt>
jmp    11ff <main+0xdf>
mov    0x2e35(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1040 <fprintf@plt>
jmp    11ff <main+0xdf>
mov    0x2e1b(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1040 <fprintf@plt>
jmp    11ff <main+0xdf>
mov    0x2e01(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
jmp    11ff <main+0xdf>
mov    0x2de7(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x2eac(%rip),%rbx
mov    (%rbx),%edi
lea    0xecb(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1030 <fscanf@plt>
movslq 0xc(%rsp),%rax
cmp    $0x19,%rax
ja     116f <main+0x4f>
lea    0xed2(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
jmp    1176 <main+0x56>
lea    0xeba(%rip),%rsi
mov    (%rbx),%edi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [12 x i8] c"Enter age: \00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [6 x i8] c"Baby\0A\00"
@.str.3 = [14 x i8] c"Kindergarden\0A\00"
@.str.4 = [8 x i8] c"School\0A\00"
@.str.5 = [5 x i8] c"Uni\0A\00"
@.str.6 = [6 x i8] c"Work\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stdin
%6 = call i32 @fscanf(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
switch i32 %7, label %20 [
i32 0, label %8
i32 1, label %8
i32 2, label %8
i32 3, label %8
i32 4, label %11
i32 5, label %11
i32 6, label %11
i32 7, label %11
i32 8, label %14
i32 9, label %14
i32 10, label %14
i32 11, label %14
i32 12, label %14
i32 13, label %14
i32 14, label %14
i32 15, label %14
i32 16, label %14
i32 17, label %14
i32 18, label %14
i32 19, label %17
i32 20, label %17
i32 21, label %17
i32 22, label %17
i32 23, label %17
i32 24, label %17
i32 25, label %17
]
8: ; preds = %0, %0, %0, %0
%9 = load i32, i32* @stdout
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %23
11: ; preds = %0, %0, %0, %0
%12 = load i32, i32* @stdout
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %23
14: ; preds = %0, %0, %0, %0, %0, %0, %0, %0, %0, %0, %0
%15 = load i32, i32* @stdout
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
br label %23
17: ; preds = %0, %0, %0, %0, %0, %0, %0
%18 = load i32, i32* @stdout
%19 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %23
20: ; preds = %0
%21 = load i32, i32* @stdout
%22 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %23
23: ; preds = %20, %17, %14, %11, %8
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [12 x i8] c"Enter age: \00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [6 x i8] c"Baby\0A\00"
@.str.3 = [14 x i8] c"Kindergarden\0A\00"
@.str.4 = [8 x i8] c"School\0A\00"
@.str.5 = [5 x i8] c"Uni\0A\00"
@.str.6 = [6 x i8] c"Work\0A\00"
@reltable.main = [26 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.2 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.2 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.2 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.2 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.3 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.3 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.3 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.3 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.4 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.4 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.4 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.4 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.4 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.4 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.4 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.4 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.4 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.4 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.4 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.5 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.5 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.5 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.5 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.5 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.5 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.5 to i64), i64 ptrtoint ([26 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stdin
%6 = call i32 @fscanf(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = icmp ult i32 %7, 26
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = sext i32 %7 to i64
%11 = shl i64 %10, 2
%12 = call i8* @llvm.load.relative.i64(i8* bitcast ([26 x i32]* @reltable.main to i8*), i64 %11)
br label %13
13: ; preds = %0, %9
%14 = phi i8* [ %12, %9 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), %0 ]
%15 = load i32, i32* @stdout
%16 = call i32 @fprintf(i32 %15, i8* %14)
ret i32 0
}