#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() {
  int n, d;
  scanf("%d", &n);
  d = n % 10;
  switch (d) {
  case 1:
    printf("Segunda-feira\n");
    break;
  case 2:
    printf("Segunda-feira\n");
    break;
  case 3:
    printf("Terça-feira\n");
    break;
  case 4:
    printf("Terça-feira\n");
    break;
  case 5:
    printf("Quarta-feira\n");
    break;
  case 6:
    printf("Quarta-feira\n");
    break;
  case 7:
    printf("Quinta-feira\n");
    break;
  case 8:
    printf("Quinta-feira\n");
    break;
  case 9:
    printf("Sexta-feira\n");
    break;
  case 0:
    printf("Sexta-feira\n");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xef2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movslq -0x8(%rbp),%rcx
mov    %ecx,%eax
imul   $0x66666667,%rcx,%rdx
mov    %rdx,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rdx
add    %ecx,%edx
add    %edx,%edx
mov    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x9,%rax
ja     122f <main+0x10f>
mov    -0x18(%rbp),%rax
lea    0xe7f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
jmp    122f <main+0x10f>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
jmp    122f <main+0x10f>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
jmp    122f <main+0x10f>
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
jmp    122f <main+0x10f>
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
jmp    122f <main+0x10f>
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
jmp    122f <main+0x10f>
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
jmp    122f <main+0x10f>
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
jmp    122f <main+0x10f>
lea    0xe4b(%rip),%rdi
call   1030 <printf@plt>
jmp    122f <main+0x10f>
lea    0xe3a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
cmp    $0x9,%eax
ja     116c <main+0x4c>
cltq
lea    0xee4(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [15 x i8] c"Segunda-feira\0A\00"
@.str.2 = [14 x i8] c"Ter\C3\A7a-feira\0A\00"
@.str.3 = [14 x i8] c"Quarta-feira\0A\00"
@.str.4 = [14 x i8] c"Quinta-feira\0A\00"
@.str.5 = [13 x i8] c"Sexta-feira\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = srem i32 %5, 10
store i32 %6, i32* %3
%7 = load i32, i32* %3
switch i32 %7, label %28 [
i32 1, label %8
i32 2, label %10
i32 3, label %12
i32 4, label %14
i32 5, label %16
i32 6, label %18
i32 7, label %20
i32 8, label %22
i32 9, label %24
i32 0, label %26
]
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %28
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %28
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %28
14: ; preds = %0
%15 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %28
16: ; preds = %0
%17 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %28
18: ; preds = %0
%19 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %28
20: ; preds = %0
%21 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %28
22: ; preds = %0
%23 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %28
24: ; preds = %0
%25 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %28
26: ; preds = %0
%27 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %28
28: ; preds = %0, %26, %24, %22, %20, %18, %16, %14, %12, %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str.6 = [12 x i8] c"Sexta-feira\00"
@str.8 = [13 x i8] c"Quinta-feira\00"
@str.10 = [13 x i8] c"Quarta-feira\00"
@str.12 = [13 x i8] c"Ter\C3\A7a-feira\00"
@str.14 = [14 x i8] c"Segunda-feira\00"
@reltable.main = [10 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @str.6 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @str.14 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @str.14 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @str.12 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @str.12 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @str.10 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @str.10 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @str.8 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @str.8 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @str.6 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = srem i32 %4, 10
%6 = icmp ult i32 %5, 10
br i1 %6, label %7, label %12
7: ; preds = %0
%8 = sext i32 %5 to i64
%9 = shl i64 %8, 2
%10 = call i8* @llvm.load.relative.i64(i8* bitcast ([10 x i32]* @reltable.main to i8*), i64 %9)
%11 = call i32 @puts(i8* dereferenceable(1) %10)
br label %12
12: ; preds = %0, %7
ret i32 0
}