#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;
  if (d == 1 || d == 2)
    printf("Segunda-feira\n");
  if (d == 3 || d == 4)
    printf("Terca-feira\n");
  if (d == 5 || d == 6)
    printf("Quarta-feira\n");
  if (d == 7 || d == 8)
    printf("Quinta-feira\n");
  if (d == 9 || d == 0)
    printf("Sexta-feira\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     1161 <main+0x41>
cmpl   $0x2,-0xc(%rbp)
jne    116d <main+0x4d>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x3,-0xc(%rbp)
je     1181 <main+0x61>
cmpl   $0x4,-0xc(%rbp)
jne    118d <main+0x6d>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x5,-0xc(%rbp)
je     11a1 <main+0x81>
cmpl   $0x6,-0xc(%rbp)
jne    11ad <main+0x8d>
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x7,-0xc(%rbp)
je     11c1 <main+0xa1>
cmpl   $0x8,-0xc(%rbp)
jne    11cd <main+0xad>
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x9,-0xc(%rbp)
je     11e1 <main+0xc1>
cmpl   $0x0,-0xc(%rbp)
jne    11ed <main+0xcd>
lea    0xe53(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rbx
imul   $0x66666667,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
lea    -0x1(%rbx),%eax
cmp    $0x2,%eax
jae    1167 <main+0x47>
lea    0xed0(%rip),%rdi
jmp    1198 <main+0x78>
lea    -0x3(%rbx),%eax
cmp    $0x2,%eax
jae    1178 <main+0x58>
lea    0xeb3(%rip),%rdi
jmp    1198 <main+0x78>
lea    -0x5(%rbx),%eax
cmp    $0x2,%eax
jae    1189 <main+0x69>
lea    0xe95(%rip),%rdi
jmp    1198 <main+0x78>
lea    -0x7(%rbx),%eax
cmp    $0x1,%eax
ja     119d <main+0x7d>
lea    0xe77(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x9,%ebx
je     11a6 <main+0x86>
test   %ebx,%ebx
jne    11b2 <main+0x92>
lea    0xe56(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [15 x i8] c"Segunda-feira\0A\00"
@.str.2 = [13 x i8] c"Terca-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
%8 = icmp eq i32 %7, 1
br i1 %8, label %12, label %9
9: ; preds = %0
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %14
12: ; preds = %9, %0
%13 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %3
%16 = icmp eq i32 %15, 3
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 4
br i1 %19, label %20, label %22
20: ; preds = %17, %14
%21 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %22
22: ; preds = %20, %17
%23 = load i32, i32* %3
%24 = icmp eq i32 %23, 5
br i1 %24, label %28, label %25
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp eq i32 %26, 6
br i1 %27, label %28, label %30
28: ; preds = %25, %22
%29 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %30
30: ; preds = %28, %25
%31 = load i32, i32* %3
%32 = icmp eq i32 %31, 7
br i1 %32, label %36, label %33
33: ; preds = %30
%34 = load i32, i32* %3
%35 = icmp eq i32 %34, 8
br i1 %35, label %36, label %38
36: ; preds = %33, %30
%37 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %38
38: ; preds = %36, %33
%39 = load i32, i32* %3
%40 = icmp eq i32 %39, 9
br i1 %40, label %44, label %41
41: ; preds = %38
%42 = load i32, i32* %3
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %41, %38
%45 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %46
46: ; preds = %44, %41
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [12 x i8] c"Sexta-feira\00"
@str.6 = [13 x i8] c"Quinta-feira\00"
@str.7 = [13 x i8] c"Quarta-feira\00"
@str.8 = [12 x i8] c"Terca-feira\00"
@str.9 = [14 x i8] c"Segunda-feira\00"
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 = add nsw i32 %5, -1
%7 = icmp ult i32 %6, 2
br i1 %7, label %17, label %8
8: ; preds = %0
%9 = add nsw i32 %5, -3
%10 = icmp ult i32 %9, 2
br i1 %10, label %17, label %11
11: ; preds = %8
%12 = add nsw i32 %5, -5
%13 = icmp ult i32 %12, 2
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = add nsw i32 %5, -7
%16 = icmp ult i32 %15, 2
br i1 %16, label %17, label %20
17: ; preds = %14, %11, %8, %0
%18 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @str.9, i64 0, i64 0), %0 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.8, i64 0, i64 0), %8 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @str.7, i64 0, i64 0), %11 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @str.6, i64 0, i64 0), %14 ]
%19 = call i32 @puts(i8* dereferenceable(1) %18)
br label %20
20: ; preds = %17, %14
switch i32 %5, label %23 [
i32 9, label %21
i32 0, label %21
]
21: ; preds = %20, %20
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %23
23: ; preds = %20, %21
ret i32 0
}