#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*/ ApagarCarroPorChassi();
int /*<<< orphan*/ ApagarVagaPorId();
int /*<<< orphan*/ Cria_lista();
int /*<<< orphan*/ EstacionarCarro();
int /*<<< orphan*/ ImprimirFilaDeCarros();
int /*<<< orphan*/ ImprimirVagasLivres();
int /*<<< orphan*/ ImprimirVagasOcupadas();
int /*<<< orphan*/ InserirCarro(char *);
int /*<<< orphan*/ InserirVaga(char *);
int /*<<< orphan*/ ListarCarros();
int Menu();
int /*<<< orphan*/ SalvarCarros(char *);
int /*<<< orphan*/ SalvarVagas(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  int escolha;
  Cria_lista();
  for (;;) {
    escolha = Menu();
    switch (escolha) {
    case 1:
      InserirCarro("veiculos.txt");
      break;
    case 2:
      InserirVaga("vagas.txt");
      break;
    case 3:
      ApagarCarroPorChassi();
      break;
    case 4:
      ApagarVagaPorId();
      break;
    case 5:
      ImprimirVagasOcupadas();
      break;
    case 6:
      ImprimirVagasLivres();
      break;
    case 7:
      ImprimirFilaDeCarros();
      break;
    case 8:
      SalvarVagas("VagasSalvas.txt");
      break;
    case 9:
      SalvarCarros("CarrosSalvos.txt");
      break;
    case 10:
      EstacionarCarro();
      break;
    case 11:
      ListarCarros();
      break;
    case 0:
      exit(0);
      break;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <Cria_lista@plt>
xor    %eax,%eax
call   1070 <Menu@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0xb,%rax
ja     12c4 <main+0xe4>
mov    -0x10(%rbp),%rax
lea    0xde4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe04(%rip),%rdi
call   1040 <InserirCarro@plt>
jmp    12c4 <main+0xe4>
lea    0xe00(%rip),%rdi
call   1100 <InserirVaga@plt>
jmp    12c4 <main+0xe4>
mov    $0x0,%al
call   1030 <ApagarCarroPorChassi@plt>
jmp    12c4 <main+0xe4>
mov    $0x0,%al
call   10b0 <ApagarVagaPorId@plt>
jmp    12c4 <main+0xe4>
mov    $0x0,%al
call   1050 <ImprimirVagasOcupadas@plt>
jmp    12c4 <main+0xe4>
mov    $0x0,%al
call   10e0 <ImprimirVagasLivres@plt>
jmp    12c4 <main+0xe4>
mov    $0x0,%al
call   1090 <ImprimirFilaDeCarros@plt>
jmp    12c4 <main+0xe4>
lea    0xdbd(%rip),%rdi
call   10c0 <SalvarVagas@plt>
jmp    12c4 <main+0xe4>
lea    0xdbc(%rip),%rdi
call   1080 <SalvarCarros@plt>
jmp    12c4 <main+0xe4>
mov    $0x0,%al
call   10d0 <EstacionarCarro@plt>
jmp    12c4 <main+0xe4>
mov    $0x0,%al
call   10a0 <ListarCarros@plt>
jmp    12c4 <main+0xe4>
xor    %edi,%edi
call   10f0 <exit@plt>
jmp    11f6 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
xor    %eax,%eax
call   1060 <Cria_lista@plt>
lea    0xe09(%rip),%rbx
lea    0xe32(%rip),%r14
lea    0xe38(%rip),%r15
lea    0xe3b(%rip),%r12
lea    0xe44(%rip),%r13
jmp    1220 <main+0x40>
xor    %eax,%eax
call   10a0 <ListarCarros@plt>
nopl   0x0(%rax)
xor    %eax,%eax
call   1070 <Menu@plt>
cmp    $0xb,%eax
ja     1220 <main+0x40>
mov    %eax,%eax
movslq (%rbx,%rax,4),%rax
add    %rbx,%rax
jmp    *%rax
mov    %r14,%rdi
call   1040 <InserirCarro@plt>
jmp    1220 <main+0x40>
mov    %r15,%rdi
call   1100 <InserirVaga@plt>
jmp    1220 <main+0x40>
xor    %eax,%eax
call   1030 <ApagarCarroPorChassi@plt>
jmp    1220 <main+0x40>
xor    %eax,%eax
call   10b0 <ApagarVagaPorId@plt>
jmp    1220 <main+0x40>
xor    %eax,%eax
call   1050 <ImprimirVagasOcupadas@plt>
jmp    1220 <main+0x40>
xor    %eax,%eax
call   10e0 <ImprimirVagasLivres@plt>
jmp    1220 <main+0x40>
xor    %eax,%eax
call   1090 <ImprimirFilaDeCarros@plt>
jmp    1220 <main+0x40>
mov    %r12,%rdi
call   10c0 <SalvarVagas@plt>
jmp    1220 <main+0x40>
mov    %r13,%rdi
call   1080 <SalvarCarros@plt>
jmp    1220 <main+0x40>
xor    %eax,%eax
call   10d0 <EstacionarCarro@plt>
jmp    1220 <main+0x40>
xor    %edi,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"veiculos.txt\00"
@.str.1 = [10 x i8] c"vagas.txt\00"
@.str.2 = [16 x i8] c"VagasSalvas.txt\00"
@.str.3 = [17 x i8] c"CarrosSalvos.txt\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @Cria_lista()
br label %4
4: ; preds = %31, %0
%5 = call i32 (...) @Menu()
store i32 %5, i32* %2
%6 = load i32, i32* %2
switch i32 %6, label %31 [
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
i32 5, label %15
i32 6, label %17
i32 7, label %19
i32 8, label %21
i32 9, label %23
i32 10, label %25
i32 11, label %27
i32 0, label %29
]
7: ; preds = %4
%8 = call i32 @InserirCarro(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %31
9: ; preds = %4
%10 = call i32 @InserirVaga(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %31
11: ; preds = %4
%12 = call i32 (...) @ApagarCarroPorChassi()
br label %31
13: ; preds = %4
%14 = call i32 (...) @ApagarVagaPorId()
br label %31
15: ; preds = %4
%16 = call i32 (...) @ImprimirVagasOcupadas()
br label %31
17: ; preds = %4
%18 = call i32 (...) @ImprimirVagasLivres()
br label %31
19: ; preds = %4
%20 = call i32 (...) @ImprimirFilaDeCarros()
br label %31
21: ; preds = %4
%22 = call i32 @SalvarVagas(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %31
23: ; preds = %4
%24 = call i32 @SalvarCarros(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %31
25: ; preds = %4
%26 = call i32 (...) @EstacionarCarro()
br label %31
27: ; preds = %4
%28 = call i32 (...) @ListarCarros()
br label %31
29: ; preds = %4
%30 = call i32 @exit(i32 0)
unreachable
31: ; preds = %4, %27, %25, %23, %21, %19, %17, %15, %13, %11, %9, %7
br label %4
}

LLVM IR (-O2):
@.str = [13 x i8] c"veiculos.txt\00"
@.str.1 = [10 x i8] c"vagas.txt\00"
@.str.2 = [16 x i8] c"VagasSalvas.txt\00"
@.str.3 = [17 x i8] c"CarrosSalvos.txt\00"
define i32 @main() {
%1 = tail call i32 (...) @Cria_lista()
br label %2
2: ; preds = %4, %0
%3 = tail call i32 (...) @Menu()
switch i32 %3, label %4 [
i32 1, label %5
i32 2, label %7
i32 3, label %9
i32 4, label %11
i32 5, label %13
i32 6, label %15
i32 7, label %17
i32 8, label %19
i32 9, label %21
i32 10, label %23
i32 11, label %25
i32 0, label %27
]
4: ; preds = %2, %25, %23, %21, %19, %17, %15, %13, %11, %9, %7, %5
br label %2
5: ; preds = %2
%6 = tail call i32 @InserirCarro(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %4
7: ; preds = %2
%8 = tail call i32 @InserirVaga(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %4
9: ; preds = %2
%10 = tail call i32 (...) @ApagarCarroPorChassi()
br label %4
11: ; preds = %2
%12 = tail call i32 (...) @ApagarVagaPorId()
br label %4
13: ; preds = %2
%14 = tail call i32 (...) @ImprimirVagasOcupadas()
br label %4
15: ; preds = %2
%16 = tail call i32 (...) @ImprimirVagasLivres()
br label %4
17: ; preds = %2
%18 = tail call i32 (...) @ImprimirFilaDeCarros()
br label %4
19: ; preds = %2
%20 = tail call i32 @SalvarVagas(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %4
21: ; preds = %2
%22 = tail call i32 @SalvarCarros(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %4
23: ; preds = %2
%24 = tail call i32 (...) @EstacionarCarro()
br label %4
25: ; preds = %2
%26 = tail call i32 (...) @ListarCarros()
br label %4
27: ; preds = %2
%28 = tail call i32 @exit(i32 0)
unreachable
}