#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 *);
void whichDay(int d) {
  if (d == 0)
    printf(" Sunday ");
  else if (d == 1)
    printf(" Monday ");
  else if (d == 2)
    printf(" Tuesday ");
  else if (d == 3)
    printf(" Wednesday ");
  else if (d == 4)
    printf(" Thrusday ");
  else if (d == 5)
    printf(" Friday ");
  else if (d == 6)
    printf(" Saturday ");
}


x86 assembly (clang, -O0):
<whichDay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1136 <whichDay+0x26>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
jmp    11f1 <whichDay+0xe1>
cmpl   $0x1,-0x4(%rbp)
jne    1151 <whichDay+0x41>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
jmp    11ec <whichDay+0xdc>
cmpl   $0x2,-0x4(%rbp)
jne    116c <whichDay+0x5c>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
jmp    11e7 <whichDay+0xd7>
cmpl   $0x3,-0x4(%rbp)
jne    1187 <whichDay+0x77>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    11e2 <whichDay+0xd2>
cmpl   $0x4,-0x4(%rbp)
jne    11a2 <whichDay+0x92>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
jmp    11dd <whichDay+0xcd>
cmpl   $0x5,-0x4(%rbp)
jne    11bd <whichDay+0xad>
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
jmp    11d8 <whichDay+0xc8>
cmpl   $0x6,-0x4(%rbp)
jne    11d3 <whichDay+0xc3>
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
jmp    11d8 <whichDay+0xc8>
jmp    11dd <whichDay+0xcd>
jmp    11e2 <whichDay+0xd2>
jmp    11e7 <whichDay+0xd7>
jmp    11ec <whichDay+0xdc>
jmp    11f1 <whichDay+0xe1>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<whichDay>:
cmp    $0x6,%edi
ja     112b <whichDay+0x1b>
movslq %edi,%rax
lea    0xf29(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1030 <printf@plt>
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c" Sunday \00"
@.str.1 = [9 x i8] c" Monday \00"
@.str.2 = [10 x i8] c" Tuesday \00"
@.str.3 = [12 x i8] c" Wednesday \00"
@.str.4 = [11 x i8] c" Thrusday \00"
@.str.5 = [9 x i8] c" Friday \00"
@.str.6 = [11 x i8] c" Saturday \00"
@reltable.whichDay = [7 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str to i64), i64 ptrtoint ([7 x i32]* @reltable.whichDay to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.1 to i64), i64 ptrtoint ([7 x i32]* @reltable.whichDay to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.2 to i64), i64 ptrtoint ([7 x i32]* @reltable.whichDay to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.3 to i64), i64 ptrtoint ([7 x i32]* @reltable.whichDay to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.4 to i64), i64 ptrtoint ([7 x i32]* @reltable.whichDay to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.5 to i64), i64 ptrtoint ([7 x i32]* @reltable.whichDay to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.6 to i64), i64 ptrtoint ([7 x i32]* @reltable.whichDay to i64)) to i32)]
define void @whichDay(i32 %0) {
%2 = icmp ult i32 %0, 7
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([7 x i32]* @reltable.whichDay to i8*), i64 %5)
%7 = tail call i32 @printf(i8* dereferenceable(1) %6)
br label %8
8: ; preds = %1, %3
ret void
}