#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 *, int *, int *);
int main() {
  int a, b, c, d;
  scanf("%d %d %d %d", &a, &b, &c, &d);
  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    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1040 <scanf@plt>
cmpl   $0x1,-0x14(%rbp)
je     115f <main+0x3f>
cmpl   $0x2,-0x14(%rbp)
jne    116b <main+0x4b>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x3,-0x14(%rbp)
je     117f <main+0x5f>
cmpl   $0x4,-0x14(%rbp)
jne    118b <main+0x6b>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x5,-0x14(%rbp)
je     119f <main+0x7f>
cmpl   $0x6,-0x14(%rbp)
jne    11ab <main+0x8b>
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x7,-0x14(%rbp)
je     11bf <main+0x9f>
cmpl   $0x8,-0x14(%rbp)
jne    11cb <main+0xab>
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x9,-0x14(%rbp)
je     11df <main+0xbf>
cmpl   $0x0,-0x14(%rbp)
jne    11eb <main+0xcb>
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
lea    -0x1(%rax),%ecx
cmp    $0x1,%ecx
ja     1160 <main+0x40>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%eax
lea    -0x3(%rax),%ecx
cmp    $0x1,%ecx
ja     1178 <main+0x58>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%eax
lea    -0x5(%rax),%ecx
cmp    $0x1,%ecx
ja     1190 <main+0x70>
lea    0xe9e(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%eax
lea    -0x7(%rax),%ecx
cmp    $0x1,%ecx
ja     11a8 <main+0x88>
lea    0xe79(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%eax
cmp    $0x9,%eax
je     11b1 <main+0x91>
test   %eax,%eax
jne    11bd <main+0x9d>
lea    0xe54(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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