#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() {
  char caracter, ok, status_das_salas;
  int filaLetra, sala, numero_da_poltrona, opcao, posicao_anterior = 'x';
  printf("\n                                   Seja Bem Vindo\n");
  printf("#");
  printf("\n|Salas existentes -> 1 a 3|\n|Letras das fileiras existentes -> A "
         "a U|\n|Número de poltronas existentes -> Fileira A até E: 1 a 8 de F "
         "até U: 1 a 20|\n");
  printf("#\n");
  printf("Opções de Navegação\n");
  while (1) {
    printf("\n0) Sair\n");
    printf("1) Efetuar compra\n");
    printf("2) Situação das salas\n");
    while (1) {
      printf(": ");
      scanf("%d", &opcao);
      if (opcao < 4)
        break;
      else
        printf("\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x78,-0x1c(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xf6e(%rip),%rdi
call   1030 <printf@plt>
lea    0xf65(%rip),%rdi
call   1030 <printf@plt>
lea    0xf72(%rip),%rdi
call   1030 <printf@plt>
lea    0xf70(%rip),%rdi
call   1030 <printf@plt>
lea    0xf77(%rip),%rdi
call   1030 <printf@plt>
lea    0xf84(%rip),%rdi
call   1030 <printf@plt>
lea    0xf7b(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x4,-0x18(%rbp)
jge    11c1 <main+0xa1>
jmp    11d2 <main+0xb2>
lea    0xf08(%rip),%rdi
call   1030 <printf@plt>
jmp    1196 <main+0x76>
jmp    1172 <main+0x52>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xeb4(%rip),%rdi
call   1040 <puts@plt>
mov    $0x23,%edi
call   1030 <putchar@plt>
lea    0xed1(%rip),%rdi
call   1040 <puts@plt>
lea    0xf5d(%rip),%rdi
call   1040 <puts@plt>
lea    0xf53(%rip),%rdi
call   1040 <puts@plt>
lea    0xf5f(%rip),%r14
lea    0xf61(%rip),%r15
lea    0xf6c(%rip),%r12
lea    0xe5f(%rip),%r13
lea    0xe5b(%rip),%rbx
lea    0x4(%rsp),%rbp
nopl   (%rax)
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1060 <scanf@plt>
cmpl   $0x4,0x4(%rsp)
jl     11b0 <main+0x70>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r13,%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1060 <scanf@plt>
cmpl   $0x4,0x4(%rsp)
jge    11f0 <main+0xb0>
jmp    11b0 <main+0x70>

LLVM IR (-O0):
@.str = [52 x i8] c"\0A Seja Bem Vindo\0A\00"
@.str.1 = [2 x i8] c"#\00"
@.str.2 = [153 x i8] c"\0A|Salas existentes -> 1 a 3|\0A|Letras das fileiras existentes -> A a U|\0A|N\C3\BAmero de poltronas existentes -> Fileira A at\C3\A9 E: 1 a 8 de F at\C3\A9 U: 1 a 20|\0A\00"
@.str.3 = [3 x i8] c"#\0A\00"
@.str.4 = [25 x i8] c"Op\C3\A7\C3\B5es de Navega\C3\A7\C3\A3o\0A\00"
@.str.5 = [10 x i8] c"\0A0) Sair\0A\00"
@.str.6 = [19 x i8] c"1) Efetuar compra\0A\00"
@.str.7 = [25 x i8] c"2) Situa\C3\A7\C3\A3o das salas\0A\00"
@.str.8 = [3 x i8] c": \00"
@.str.9 = [3 x i8] c"%d\00"
@.str.10 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
store i32 120, i32* %9
%10 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
br label %15
15: ; preds = %0, %28
%16 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
br label %19
19: ; preds = %15, %27
%20 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %8)
%22 = load i32, i32* %8
%23 = icmp slt i32 %22, 4
br i1 %23, label %24, label %25
24: ; preds = %19
br label %28
25: ; preds = %19
%26 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %27
27: ; preds = %25
br label %19
28: ; preds = %24
br label %15
}

LLVM IR (-O2):
@.str.8 = [3 x i8] c": \00"
@.str.9 = [3 x i8] c"%d\00"
@str = [51 x i8] c"\0A Seja Bem Vindo\00"
@str.11 = [152 x i8] c"\0A|Salas existentes -> 1 a 3|\0A|Letras das fileiras existentes -> A a U|\0A|N\C3\BAmero de poltronas existentes -> Fileira A at\C3\A9 E: 1 a 8 de F at\C3\A9 U: 1 a 20|\00"
@str.12 = [2 x i8] c"#\00"
@str.13 = [24 x i8] c"Op\C3\A7\C3\B5es de Navega\C3\A7\C3\A3o\00"
@str.14 = [9 x i8] c"\0A0) Sair\00"
@str.15 = [18 x i8] c"1) Efetuar compra\00"
@str.16 = [24 x i8] c"2) Situa\C3\A7\C3\A3o das salas\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 35)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([152 x i8], [152 x i8]* @str.11, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.12, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.13, i64 0, i64 0))
br label %8
8: ; preds = %16, %0
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.14, i64 0, i64 0))
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.15, i64 0, i64 0))
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.16, i64 0, i64 0))
%12 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %1)
%14 = load i32, i32* %1
%15 = icmp slt i32 %14, 4
br i1 %15, label %16, label %17
16: ; preds = %17, %8
br label %8
17: ; preds = %8, %17
%18 = call i32 @putchar(i32 10)
%19 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %1)
%21 = load i32, i32* %1
%22 = icmp slt i32 %21, 4
br i1 %22, label %16, label %17
}