#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char opcao = ' ';
  while (1 == 1) {
    printf("\nMenu:\n");
    printf("-----\n");
    printf("0: Sair\n");
    printf("Resposta: ");
    scanf("%c", &opcao);
    getchar();
    if (opcao == '0')
      exit(0);
  }
  printf("Continuação do programa...");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x20,-0x5(%rbp)
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
lea    0xe99(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jne    11ae <main+0x6e>
xor    %edi,%edi
call   1060 <exit@plt>
jmp    1153 <main+0x13>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movb   $0x20,0x7(%rsp)
lea    0xea7(%rip),%r14
lea    0xea7(%rip),%r15
lea    0xea6(%rip),%r12
lea    0xe84(%rip),%r13
lea    0xe88(%rip),%rbx
lea    0x7(%rsp),%rbp
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1060 <scanf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmpb   $0x30,0x7(%rsp)
jne    1190 <main+0x40>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\0AMenu:\0A\00"
@.str.1 = [7 x i8] c"-----\0A\00"
@.str.2 = [9 x i8] c"0: Sair\0A\00"
@.str.3 = [11 x i8] c"Resposta: \00"
@.str.4 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 32, i8* %2
br label %3
3: ; preds = %0, %15
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %2)
%9 = call i32 (...) @getchar()
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 48
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %3
br label %3
}

LLVM IR (-O2):
@.str.3 = [11 x i8] c"Resposta: \00"
@.str.4 = [3 x i8] c"%c\00"
@str = [7 x i8] c"\0AMenu:\00"
@str.5 = [6 x i8] c"-----\00"
@str.6 = [8 x i8] c"0: Sair\00"
define i32 @main() {
%1 = alloca i8
store i8 32, i8* %1
br label %2
2: ; preds = %2, %0
%3 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.5, i64 0, i64 0))
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.6, i64 0, i64 0))
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %1)
%8 = call i32 (...) @getchar()
%9 = load i8, i8* %1
%10 = icmp eq i8 %9, 48
br i1 %10, label %11, label %2
11: ; preds = %2
%12 = call i32 @exit(i32 0)
unreachable
}