#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() {
  printf("This program needs 1 initial digit(s) to assign a weekday to it\n\n");
  int z;
  printf("Enter week day number:");
  scanf("%d", &z);
  switch (z) {
  case 1:
    printf("This is the Resualt: %s\n", "Shanbe");
    break;
  case 2:
    printf("This is the Resualt: %s\n", "1Shanbe");
    break;
  case 3:
    printf("This is the Resualt: %s\n", "2Shanbe");
    break;
  case 4:
    printf("This is the Resualt: %s\n", "3Shanbe");
    break;
  case 5:
    printf("This is the Resualt: %s\n", "4Shanbe");
    break;
  case 6:
    printf("This is the Resualt: %s\n", "5Shanbe");
    break;
  case 7:
    printf("This is the Resualt: %s\n", "Jome");
    break;
  default:
    printf("Not Valued\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee6(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x11(%rbp)
call   1030 <printf@plt>
mov    -0x11(%rbp),%al
lea    0xf14(%rip),%rdi
call   1030 <printf@plt>
lea    0xf1f(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x6,%eax
ja     123e <main+0x11e>
mov    -0x10(%rbp),%rax
lea    0xe81(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xee9(%rip),%rdi
lea    0xefc(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124c <main+0x12c>
lea    0xecf(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124c <main+0x12c>
lea    0xeb5(%rip),%rdi
lea    0xecf(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124c <main+0x12c>
lea    0xe9b(%rip),%rdi
lea    0xebd(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124c <main+0x12c>
lea    0xe81(%rip),%rdi
lea    0xeab(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124c <main+0x12c>
lea    0xe67(%rip),%rdi
lea    0xe99(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124c <main+0x12c>
lea    0xe4d(%rip),%rdi
lea    0xe87(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124c <main+0x12c>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf44(%rip),%rdi
call   1030 <puts@plt>
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x6,%eax
ja     1188 <main+0x58>
lea    0xe91(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xeb7(%rip),%rdi
lea    0xeca(%rip),%rsi
jmp    11f4 <main+0xc4>
lea    0xf2e(%rip),%rdi
call   1030 <puts@plt>
jmp    11fb <main+0xcb>
lea    0xe99(%rip),%rdi
lea    0xeab(%rip),%rsi
jmp    11f4 <main+0xc4>
lea    0xe89(%rip),%rdi
lea    0xea3(%rip),%rsi
jmp    11f4 <main+0xc4>
lea    0xe79(%rip),%rdi
lea    0xe9b(%rip),%rsi
jmp    11f4 <main+0xc4>
lea    0xe69(%rip),%rdi
lea    0xe93(%rip),%rsi
jmp    11f4 <main+0xc4>
lea    0xe59(%rip),%rdi
lea    0xe8b(%rip),%rsi
jmp    11f4 <main+0xc4>
lea    0xe49(%rip),%rdi
lea    0xe83(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [66 x i8] c"This program needs 1 initial digit(s) to assign a weekday to it\0A\0A\00"
@.str.1 = [23 x i8] c"Enter week day number:\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [25 x i8] c"This is the Resualt: %s\0A\00"
@.str.4 = [7 x i8] c"Shanbe\00"
@.str.5 = [8 x i8] c"1Shanbe\00"
@.str.6 = [8 x i8] c"2Shanbe\00"
@.str.7 = [8 x i8] c"3Shanbe\00"
@.str.8 = [8 x i8] c"4Shanbe\00"
@.str.9 = [8 x i8] c"5Shanbe\00"
@.str.10 = [5 x i8] c"Jome\00"
@.str.11 = [12 x i8] c"Not Valued\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
switch i32 %6, label %21 [
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
i32 5, label %15
i32 6, label %17
i32 7, label %19
]
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %23
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
br label %23
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
br label %23
13: ; preds = %0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
br label %23
15: ; preds = %0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
br label %23
17: ; preds = %0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
br label %23
19: ; preds = %0
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
br label %23
21: ; preds = %0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0))
br label %23
23: ; preds = %21, %19, %17, %15, %13, %11, %9, %7
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c"Enter week day number:\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [25 x i8] c"This is the Resualt: %s\0A\00"
@.str.4 = [7 x i8] c"Shanbe\00"
@.str.5 = [8 x i8] c"1Shanbe\00"
@.str.6 = [8 x i8] c"2Shanbe\00"
@.str.7 = [8 x i8] c"3Shanbe\00"
@.str.8 = [8 x i8] c"4Shanbe\00"
@.str.9 = [8 x i8] c"5Shanbe\00"
@.str.10 = [5 x i8] c"Jome\00"
@str = [65 x i8] c"This program needs 1 initial digit(s) to assign a weekday to it\0A\00"
@str.12 = [11 x i8] c"Not Valued\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str, i64 0, i64 0))
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
switch i32 %6, label %21 [
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
i32 5, label %15
i32 6, label %17
i32 7, label %19
]
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %23
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
br label %23
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
br label %23
13: ; preds = %0
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
br label %23
15: ; preds = %0
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
br label %23
17: ; preds = %0
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
br label %23
19: ; preds = %0
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
br label %23
21: ; preds = %0
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.12, i64 0, i64 0))
br label %23
23: ; preds = %21, %19, %17, %15, %13, %11, %9, %7
ret i32 0
}