#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 *);
void main() {
  int a;
  printf("Input a number:");
  scanf("%d", &a);
  if (a == 1) {
    printf("Monday\n");
  } else if (a == 2) {
    printf("Tuesday\n");
  } else if (a == 3) {
    printf("Wednesday\n");
  } else if (a == 4) {
    printf("Thusday\n");
  } else if (a == 5) {
    printf("Friday\n");
  } else if (a == 6) {
    printf("Saturday\n");
  } else if (a == 7) {
    printf("Sunday\n");
  } else
    printf("Error\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x4(%rbp)
jne    115f <main+0x3f>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
jmp    122b <main+0x10b>
cmpl   $0x2,-0x4(%rbp)
jne    117a <main+0x5a>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    1226 <main+0x106>
cmpl   $0x3,-0x4(%rbp)
jne    1195 <main+0x75>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    1221 <main+0x101>
cmpl   $0x4,-0x4(%rbp)
jne    11b0 <main+0x90>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
jmp    121c <main+0xfc>
cmpl   $0x5,-0x4(%rbp)
jne    11cb <main+0xab>
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
jmp    1217 <main+0xf7>
cmpl   $0x6,-0x4(%rbp)
jne    11e6 <main+0xc6>
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
jmp    1212 <main+0xf2>
cmpl   $0x7,-0x4(%rbp)
jne    1201 <main+0xe1>
lea    0xe53(%rip),%rdi
call   1030 <printf@plt>
jmp    120d <main+0xed>
lea    0xe4a(%rip),%rdi
call   1030 <printf@plt>
jmp    1212 <main+0xf2>
jmp    1217 <main+0xf7>
jmp    121c <main+0xfc>
jmp    1221 <main+0x101>
jmp    1226 <main+0x106>
jmp    122b <main+0x10b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x6,%eax
ja     116c <main+0x3c>
cltq
lea    0xef1(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1173 <main+0x43>
lea    0xea0(%rip),%rdi
call   1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Input a number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c"Monday\0A\00"
@.str.3 = [9 x i8] c"Tuesday\0A\00"
@.str.4 = [11 x i8] c"Wednesday\0A\00"
@.str.5 = [9 x i8] c"Thusday\0A\00"
@.str.6 = [8 x i8] c"Friday\0A\00"
@.str.7 = [10 x i8] c"Saturday\0A\00"
@.str.8 = [8 x i8] c"Sunday\0A\00"
@.str.9 = [7 x i8] c"Error\0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %46
8: ; preds = %0
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, 2
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %45
13: ; preds = %8
%14 = load i32, i32* %1
%15 = icmp eq i32 %14, 3
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
br label %44
18: ; preds = %13
%19 = load i32, i32* %1
%20 = icmp eq i32 %19, 4
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
br label %43
23: ; preds = %18
%24 = load i32, i32* %1
%25 = icmp eq i32 %24, 5
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
br label %42
28: ; preds = %23
%29 = load i32, i32* %1
%30 = icmp eq i32 %29, 6
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
br label %41
33: ; preds = %28
%34 = load i32, i32* %1
%35 = icmp eq i32 %34, 7
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
br label %40
38: ; preds = %33
%39 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
br label %40
40: ; preds = %38, %36
br label %41
41: ; preds = %40, %31
br label %42
42: ; preds = %41, %26
br label %43
43: ; preds = %42, %21
br label %44
44: ; preds = %43, %16
br label %45
45: ; preds = %44, %11
br label %46
46: ; preds = %45, %6
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Input a number:\00"
@.str.1 = [3 x i8] c"%d\00"
@str = [6 x i8] c"Error\00"
@str.10 = [7 x i8] c"Sunday\00"
@str.11 = [9 x i8] c"Saturday\00"
@str.12 = [7 x i8] c"Friday\00"
@str.13 = [8 x i8] c"Thusday\00"
@str.14 = [10 x i8] c"Wednesday\00"
@str.15 = [8 x i8] c"Tuesday\00"
@str.16 = [7 x i8] c"Monday\00"
@reltable.main = [7 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @str.16 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @str.15 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @str.14 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @str.13 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @str.12 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @str.11 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @str.10 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32)]
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 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, -1
%7 = icmp ult i32 %6, 7
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = sext i32 %6 to i64
%10 = shl i64 %9, 2
%11 = call i8* @llvm.load.relative.i64(i8* bitcast ([7 x i32]* @reltable.main to i8*), i64 %10)
br label %12
12: ; preds = %0, %8
%13 = phi i8* [ %11, %8 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), %0 ]
%14 = call i32 @puts(i8* dereferenceable(1) %13)
ret void
}