#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 *);
int /*<<< orphan*/ system(char *);
int main() {
  char menuSwitch = 'm';
  char pedeTempo;
  while (menuSwitch != 'q') {
    system("clear");
    printf("tecle q para sair\n");
    printf("tecle b pra selecionar baskara\n");
    scanf(" %c", &menuSwitch);
    switch (menuSwitch) {
    case 'q':
      printf("Tchau\n");
      break;
    case 'b':
      printf("Baskara ainda não implementado\n");
      printf("qualquer letra para voltar\n");
      scanf(" %c", &pedeTempo);
      break;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x6d,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x71,%eax
je     11e8 <main+0xb8>
lea    0xea9(%rip),%rdi
call   1030 <system@plt>
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x62,%eax
je     11bb <main+0x8b>
jmp    1199 <main+0x69>
mov    -0xc(%rbp),%eax
sub    $0x71,%eax
jne    11e3 <main+0xb3>
jmp    11aa <main+0x7a>
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
jmp    11e3 <main+0xb3>
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
lea    0xe5f(%rip),%rdi
lea    -0x6(%rbp),%rsi
call   1050 <scanf@plt>
jmp    1143 <main+0x13>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movb   $0x6d,0x6(%rsp)
lea    0xeb9(%rip),%r14
lea    0xebc(%rip),%r15
lea    0xec7(%rip),%r12
lea    0xeaa(%rip),%rbx
lea    0x6(%rsp),%r13
lea    0xf0e(%rip),%rbp
jmp    119e <main+0x6e>
nopw   0x0(%rax,%rax,1)
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
movzbl 0x6(%rsp),%eax
cmp    $0x71,%al
je     11dd <main+0xad>
mov    %r14,%rdi
call   1040 <system@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <scanf@plt>
movzbl 0x6(%rsp),%eax
movsbl %al,%ecx
cmp    $0x62,%ecx
je     1170 <main+0x40>
cmp    $0x71,%ecx
jne    119a <main+0x6a>
mov    %rbp,%rdi
call   1030 <puts@plt>
jmp    1195 <main+0x65>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [19 x i8] c"tecle q para sair\0A\00"
@.str.2 = [32 x i8] c"tecle b pra selecionar baskara\0A\00"
@.str.3 = [4 x i8] c" %c\00"
@.str.4 = [7 x i8] c"Tchau\0A\00"
@.str.5 = [33 x i8] c"Baskara ainda n\C3\A3o implementado\0A\00"
@.str.6 = [28 x i8] c"qualquer letra para voltar\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
store i8 109, i8* %2
br label %4
4: ; preds = %21, %0
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 113
br i1 %7, label %8, label %22
8: ; preds = %4
%9 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %2)
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
switch i32 %14, label %21 [
i32 113, label %15
i32 98, label %17
]
15: ; preds = %8
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %21
17: ; preds = %8
%18 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %3)
br label %21
21: ; preds = %8, %17, %15
br label %4
22: ; preds = %4
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.3 = [4 x i8] c" %c\00"
@str = [18 x i8] c"tecle q para sair\00"
@str.7 = [31 x i8] c"tecle b pra selecionar baskara\00"
@str.8 = [32 x i8] c"Baskara ainda n\C3\A3o implementado\00"
@str.9 = [27 x i8] c"qualquer letra para voltar\00"
@str.10 = [6 x i8] c"Tchau\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
store i8 109, i8* %1
br label %3
3: ; preds = %0, %18
%4 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.7, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%8 = load i8, i8* %1
%9 = sext i8 %8 to i32
switch i32 %9, label %18 [
i32 113, label %10
i32 98, label %12
]
10: ; preds = %3
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.10, i64 0, i64 0))
br label %16
12: ; preds = %3
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.8, i64 0, i64 0))
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.9, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %2)
br label %16
16: ; preds = %10, %12
%17 = load i8, i8* %1
br label %18
18: ; preds = %16, %3
%19 = phi i8 [ %17, %16 ], [ %8, %3 ]
%20 = icmp eq i8 %19, 113
br i1 %20, label %21, label %3
21: ; preds = %18
ret i32 0
}