#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*/ chamarArvore();
int /*<<< orphan*/ chamarAvl();
int /*<<< orphan*/ exibirMenu();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int escolha;
  do {
    exibirMenu();
    scanf("%i", &escolha);
    getchar();
    switch (escolha) {
    case 1:
      chamarArvore();
      break;
    case 2:
      chamarAvl();
      break;
    }
  } while (escolha != 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %al,-0xd(%rbp)
call   1030 <exibirMenu@plt>
lea    0xe90(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0xd(%rbp),%al
call   1060 <getchar@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     11a6 <main+0x56>
jmp    1195 <main+0x45>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     11b2 <main+0x62>
jmp    11b9 <main+0x69>
mov    $0x0,%al
call   1050 <chamarArvore@plt>
jmp    11b9 <main+0x69>
mov    $0x0,%al
call   1040 <chamarAvl@plt>
jmp    11be <main+0x6e>
cmpl   $0x0,-0x8(%rbp)
jne    115f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xea5(%rip),%r14
lea    0x4(%rsp),%rbx
jmp    117f <main+0x2f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <chamarAvl@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
je     11af <main+0x5f>
xor    %eax,%eax
call   1030 <exibirMenu@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
je     1170 <main+0x20>
cmp    $0x1,%eax
jne    117b <main+0x2b>
xor    %eax,%eax
call   1050 <chamarArvore@plt>
jmp    1177 <main+0x27>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %13, %0
%4 = call i32 (...) @exibirMenu()
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = call i32 (...) @getchar()
%7 = load i32, i32* %2
switch i32 %7, label %12 [
i32 1, label %8
i32 2, label %10
]
8: ; preds = %3
%9 = call i32 (...) @chamarArvore()
br label %12
10: ; preds = %3
%11 = call i32 (...) @chamarAvl()
br label %12
12: ; preds = %3, %10, %8
br label %13
13: ; preds = %12
%14 = load i32, i32* %2
%15 = icmp ne i32 %14, 0
br i1 %15, label %3, label %16
16: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %14, %0
%4 = call i32 (...) @exibirMenu()
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 (...) @getchar()
%7 = load i32, i32* %1
switch i32 %7, label %14 [
i32 1, label %8
i32 2, label %10
]
8: ; preds = %3
%9 = call i32 (...) @chamarArvore()
br label %12
10: ; preds = %3
%11 = call i32 (...) @chamarAvl()
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %1
br label %14
14: ; preds = %12, %3
%15 = phi i32 [ %13, %12 ], [ %7, %3 ]
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %3
17: ; preds = %14
ret i32 0
}