#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 *, char *);
scalar_t__ strcmp(char *, char *);
int main(void) {
  char h[10];
  printf(
      "Em qual horario você estuda? \nM-Matutino\nV-Vespertino\nN-Noturno\n:");
  scanf("%s", h);
  if (strcmp(h, "M") == 0) {
    printf("Bom dia\n");
  } else if (strcmp(h, "V") == 0) {
    printf("Boa tarde\n");
  } else if (strcmp(h, "N") == 0) {
    printf("Boa noite\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0xe(%rbp),%rsi
lea    0xeed(%rip),%rdi
call   1050 <scanf@plt>
lea    -0xe(%rbp),%rdi
lea    0xee0(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1186 <main+0x56>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
jmp    11e1 <main+0xb1>
lea    -0xe(%rbp),%rdi
lea    0xec0(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11b1 <main+0x81>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
jmp    11dc <main+0xac>
lea    -0xe(%rbp),%rdi
lea    0xea2(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11d7 <main+0xa7>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
jmp    11dc <main+0xac>
jmp    11e1 <main+0xb1>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
lea    0xeeb(%rip),%rdi
lea    0x6(%rsp),%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
lea    0xeda(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11ae <main+0x6e>
lea    0xec8(%rip),%rsi
lea    0x6(%rsp),%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11b7 <main+0x77>
lea    0xeb4(%rip),%rsi
lea    0x6(%rsp),%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    11c3 <main+0x83>
lea    0xea0(%rip),%rdi
jmp    11be <main+0x7e>
lea    0xeab(%rip),%rdi
jmp    11be <main+0x7e>
lea    0xe98(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [67 x i8] c"Em qual horario voc\C3\AA estuda? \0AM-Matutino\0AV-Vespertino\0AN-Noturno\0A:\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [2 x i8] c"M\00"
@.str.3 = [9 x i8] c"Bom dia\0A\00"
@.str.4 = [2 x i8] c"V\00"
@.str.5 = [11 x i8] c"Boa tarde\0A\00"
@.str.6 = [2 x i8] c"N\00"
@.str.7 = [11 x i8] c"Boa noite\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %25
11: ; preds = %0
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
br label %24
17: ; preds = %11
%18 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
br label %23
23: ; preds = %21, %17
br label %24
24: ; preds = %23, %15
br label %25
25: ; preds = %24, %9
ret i32 0
}

LLVM IR (-O2):
@.str = [67 x i8] c"Em qual horario voc\C3\AA estuda? \0AM-Matutino\0AV-Vespertino\0AN-Noturno\0A:\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [2 x i8] c"M\00"
@.str.4 = [2 x i8] c"V\00"
@.str.6 = [2 x i8] c"N\00"
@str = [10 x i8] c"Boa noite\00"
@str.8 = [10 x i8] c"Boa tarde\00"
@str.9 = [8 x i8] c"Bom dia\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 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), i8* %2)
%5 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %0
%8 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10, %7, %0
%14 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @str.9, i64 0, i64 0), %0 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @str.8, i64 0, i64 0), %7 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0), %10 ]
%15 = call i32 @puts(i8* dereferenceable(1) %14)
br label %16
16: ; preds = %13, %10
ret i32 0
}