#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;
  printf("\nDigite do número do dia da semana, 0 para sair: ");
  scanf("%d", &dia);
  if (dia == 1) {
    printf("\nDomingo\n");
  } else if (dia == 2) {
    printf("\nSegunda-Feira\n");
  } else if (dia == 3) {
    printf("\nTerça-Feira\n");
  } else if (dia == 4) {
    printf("\nQuarta-Feira\n");
  } else if (dia == 5) {
    printf("\nQuinta-Feira\n");
  } else if (dia == 6) {
    printf("\nSexta-Feira\n");
  } else if (dia == 7) {
    printf("\nSábado\n");
  } else if (dia == 0) {
    printf("\n****FIM****\n");
  } else {
    printf("\nValor Inválido\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1166 <main+0x46>
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
jmp    1252 <main+0x132>
cmpl   $0x2,-0x8(%rbp)
jne    1181 <main+0x61>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
jmp    124d <main+0x12d>
cmpl   $0x3,-0x8(%rbp)
jne    119c <main+0x7c>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
jmp    1248 <main+0x128>
cmpl   $0x4,-0x8(%rbp)
jne    11b7 <main+0x97>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    1243 <main+0x123>
cmpl   $0x5,-0x8(%rbp)
jne    11d2 <main+0xb2>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
jmp    123e <main+0x11e>
cmpl   $0x6,-0x8(%rbp)
jne    11ed <main+0xcd>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
jmp    1239 <main+0x119>
cmpl   $0x7,-0x8(%rbp)
jne    1208 <main+0xe8>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
jmp    1234 <main+0x114>
cmpl   $0x0,-0x8(%rbp)
jne    1223 <main+0x103>
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
jmp    122f <main+0x10f>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
jmp    1234 <main+0x114>
jmp    1239 <main+0x119>
jmp    123e <main+0x11e>
jmp    1243 <main+0x123>
jmp    1248 <main+0x128>
jmp    124d <main+0x12d>
jmp    1252 <main+0x132>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xeef(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movslq 0x4(%rsp),%rax
cmp    $0x7,%rax
ja     1169 <main+0x39>
lea    0xf4c(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1170 <main+0x40>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [51 x i8] c"\0ADigite do n\C3\BAmero do dia da semana, 0 para sair: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"\0ADomingo\0A\00"
@.str.3 = [16 x i8] c"\0ASegunda-Feira\0A\00"
@.str.4 = [15 x i8] c"\0ATer\C3\A7a-Feira\0A\00"
@.str.5 = [15 x i8] c"\0AQuarta-Feira\0A\00"
@.str.6 = [15 x i8] c"\0AQuinta-Feira\0A\00"
@.str.7 = [14 x i8] c"\0ASexta-Feira\0A\00"
@.str.8 = [10 x i8] c"\0AS\C3\A1bado\0A\00"
@.str.9 = [14 x i8] c"\0A****FIM****\0A\00"
@.str.10 = [18 x i8] c"\0AValor Inv\C3\A1lido\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %53
9: ; preds = %0
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
br label %52
14: ; preds = %9
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 3
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
br label %51
19: ; preds = %14
%20 = load i32, i32* %2
%21 = icmp eq i32 %20, 4
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
br label %50
24: ; preds = %19
%25 = load i32, i32* %2
%26 = icmp eq i32 %25, 5
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
br label %49
29: ; preds = %24
%30 = load i32, i32* %2
%31 = icmp eq i32 %30, 6
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
br label %48
34: ; preds = %29
%35 = load i32, i32* %2
%36 = icmp eq i32 %35, 7
br i1 %36, label %37, label %39
37: ; preds = %34
%38 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
br label %47
39: ; preds = %34
%40 = load i32, i32* %2
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %44
42: ; preds = %39
%43 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
br label %46
44: ; preds = %39
%45 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0))
br label %46
46: ; preds = %44, %42
br label %47
47: ; preds = %46, %37
br label %48
48: ; preds = %47, %32
br label %49
49: ; preds = %48, %27
br label %50
50: ; preds = %49, %22
br label %51
51: ; preds = %50, %17
br label %52
52: ; preds = %51, %12
br label %53
53: ; preds = %52, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [51 x i8] c"\0ADigite do n\C3\BAmero do dia da semana, 0 para sair: \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [17 x i8] c"\0AValor Inv\C3\A1lido\00"
@str.11 = [13 x i8] c"\0A****FIM****\00"
@str.12 = [9 x i8] c"\0AS\C3\A1bado\00"
@str.13 = [13 x i8] c"\0ASexta-Feira\00"
@str.14 = [14 x i8] c"\0AQuinta-Feira\00"
@str.15 = [14 x i8] c"\0AQuarta-Feira\00"
@str.16 = [14 x i8] c"\0ATer\C3\A7a-Feira\00"
@str.17 = [15 x i8] c"\0ASegunda-Feira\00"
@str.18 = [9 x i8] c"\0ADomingo\00"
@reltable.main = [8 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @str.11 to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @str.18 to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @str.17 to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @str.16 to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @str.15 to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @str.14 to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @str.13 to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @str.12 to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp ult i32 %5, 8
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 ([8 x i32]* @reltable.main to i8*), i64 %9)
br label %11
11: ; preds = %0, %7
%12 = phi i8* [ %10, %7 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0), %0 ]
%13 = call i32 @puts(i8* dereferenceable(1) %12)
ret i32 0
}