#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(void) {
  int dia;
  scanf("%i", &dia);
  if (dia == 1)
    printf("domingo\n");
  else if (dia == 2)
    printf("segunda-feira\n");
  else if (dia == 3)
    printf("terça-feira\n");
  else if (dia == 4)
    printf("quarta-feira\n");
  else if (dia == 5)
    printf("quinta-feira\n");
  else if (dia == 6)
    printf("sexta-feira\n");
  else if (dia == 7)
    printf("sábado\n");
  else
    printf("** ERRO: entrada inválida**\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>
cmpl   $0x1,-0x8(%rbp)
jne    115a <main+0x3a>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    1226 <main+0x106>
cmpl   $0x2,-0x8(%rbp)
jne    1175 <main+0x55>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
jmp    1221 <main+0x101>
cmpl   $0x3,-0x8(%rbp)
jne    1190 <main+0x70>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
jmp    121c <main+0xfc>
cmpl   $0x4,-0x8(%rbp)
jne    11ab <main+0x8b>
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
jmp    1217 <main+0xf7>
cmpl   $0x5,-0x8(%rbp)
jne    11c6 <main+0xa6>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
jmp    1212 <main+0xf2>
cmpl   $0x6,-0x8(%rbp)
jne    11e1 <main+0xc1>
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
jmp    120d <main+0xed>
cmpl   $0x7,-0x8(%rbp)
jne    11fc <main+0xdc>
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
jmp    1208 <main+0xe8>
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
jmp    120d <main+0xed>
jmp    1212 <main+0xf2>
jmp    1217 <main+0xf7>
jmp    121c <main+0xfc>
jmp    1221 <main+0x101>
jmp    1226 <main+0x106>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x6,%eax
ja     1150 <main+0x30>
cltq
lea    0xf2d(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1157 <main+0x37>
lea    0xeac(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
@.str.1 = [9 x i8] c"domingo\0A\00"
@.str.2 = [15 x i8] c"segunda-feira\0A\00"
@.str.3 = [14 x i8] c"ter\C3\A7a-feira\0A\00"
@.str.4 = [14 x i8] c"quarta-feira\0A\00"
@.str.5 = [14 x i8] c"quinta-feira\0A\00"
@.str.6 = [13 x i8] c"sexta-feira\0A\00"
@.str.7 = [9 x i8] c"s\C3\A1bado\0A\00"
@.str.8 = [30 x i8] c"** ERRO: entrada inv\C3\A1lida**\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %46
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 2
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %45
13: ; preds = %8
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 3
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %44
18: ; preds = %13
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 4
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %43
23: ; preds = %18
%24 = load i32, i32* %2
%25 = icmp eq i32 %24, 5
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
br label %42
28: ; preds = %23
%29 = load i32, i32* %2
%30 = icmp eq i32 %29, 6
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
br label %41
33: ; preds = %28
%34 = load i32, i32* %2
%35 = icmp eq i32 %34, 7
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
br label %40
38: ; preds = %33
%39 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0))
br label %40
40: ; preds = %38, %36
br label %41
41: ; preds = %40, %31
br label %42
42: ; preds = %41, %26
br label %43
43: ; preds = %42, %21
br label %44
44: ; preds = %43, %16
br label %45
45: ; preds = %44, %11
br label %46
46: ; preds = %45, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@str = [29 x i8] c"** ERRO: entrada inv\C3\A1lida**\00"
@str.9 = [8 x i8] c"s\C3\A1bado\00"
@str.10 = [12 x i8] c"sexta-feira\00"
@str.11 = [13 x i8] c"quinta-feira\00"
@str.12 = [13 x i8] c"quarta-feira\00"
@str.13 = [13 x i8] c"ter\C3\A7a-feira\00"
@str.14 = [14 x i8] c"segunda-feira\00"
@str.15 = [8 x i8] c"domingo\00"
@reltable.main = [7 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @str.15 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @str.14 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @str.13 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @str.12 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @str.11 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @str.10 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @str.9 to i64), i64 ptrtoint ([7 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 = add i32 %4, -1
%6 = icmp ult i32 %5, 7
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = sext i32 %5 to i64
%9 = shl i64 %8, 2
%10 = call i8* @llvm.load.relative.i64(i8* bitcast ([7 x i32]* @reltable.main to i8*), i64 %9)
br label %11
11: ; preds = %0, %7
%12 = phi i8* [ %10, %7 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0), %0 ]
%13 = call i32 @puts(i8* dereferenceable(1) %12)
ret i32 0
}