#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*/ limparTela();
int /*<<< orphan*/ marca();
int /*<<< orphan*/ menuCategoria();
int /*<<< orphan*/ menuEstoque();
int /*<<< orphan*/ menuFornecedor();
int /*<<< orphan*/ perfil();
int /*<<< orphan*/ printf(char *);
void opcao(int escolha) {
  limparTela();
  switch (escolha) {
  case 0:
    limparTela();
    marca();
    printf("\n\t\tObrigado por usar nosso programa!");
    exit(0);
  case 1:
    perfil();
    break;
  case 2:
    menuFornecedor();
    break;
  case 3:
    menuEstoque();
    break;
  case 4:
    menuCategoria();
  }
}


x86 assembly (clang, -O0):
<opcao>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
call   10a0 <limparTela@plt>
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x4,%rax
ja     1203 <opcao+0x83>
mov    -0x10(%rbp),%rax
lea    0xe52(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   10a0 <limparTela@plt>
mov    $0x0,%al
call   1030 <marca@plt>
lea    0xe48(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1090 <exit@plt>
mov    $0x0,%al
call   1060 <perfil@plt>
jmp    1203 <opcao+0x83>
mov    $0x0,%al
call   1080 <menuFornecedor@plt>
jmp    1203 <opcao+0x83>
mov    $0x0,%al
call   1050 <menuEstoque@plt>
jmp    1203 <opcao+0x83>
mov    $0x0,%al
call   1070 <menuCategoria@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opcao>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   10a0 <limparTela@plt>
cmp    $0x4,%ebx
ja     11a9 <opcao+0x29>
mov    %ebx,%eax
lea    0xe68(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
pop    %rbx
jmp    1060 <perfil@plt>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
jmp    1080 <menuFornecedor@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <menuEstoque@plt>
xor    %eax,%eax
pop    %rbx
jmp    1070 <menuCategoria@plt>
xor    %eax,%eax
call   10a0 <limparTela@plt>
xor    %eax,%eax
call   1030 <marca@plt>
lea    0xe3c(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"\0A\09\09Obrigado por usar nosso programa!\00"
define void @opcao(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @limparTela()
%4 = load i32, i32* %2
switch i32 %4, label %18 [
i32 0, label %5
i32 1, label %10
i32 2, label %12
i32 3, label %14
i32 4, label %16
]
5: ; preds = %1
%6 = call i32 (...) @limparTela()
%7 = call i32 (...) @marca()
%8 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %1
%11 = call i32 (...) @perfil()
br label %18
12: ; preds = %1
%13 = call i32 (...) @menuFornecedor()
br label %18
14: ; preds = %1
%15 = call i32 (...) @menuEstoque()
br label %18
16: ; preds = %1
%17 = call i32 (...) @menuCategoria()
br label %18
18: ; preds = %16, %1, %14, %12, %10
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"\0A\09\09Obrigado por usar nosso programa!\00"
define void @opcao(i32 %0) {
%2 = tail call i32 (...) @limparTela()
switch i32 %0, label %16 [
i32 0, label %3
i32 1, label %8
i32 2, label %10
i32 3, label %12
i32 4, label %14
]
3: ; preds = %1
%4 = tail call i32 (...) @limparTela()
%5 = tail call i32 (...) @marca()
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %1
%9 = tail call i32 (...) @perfil()
br label %16
10: ; preds = %1
%11 = tail call i32 (...) @menuFornecedor()
br label %16
12: ; preds = %1
%13 = tail call i32 (...) @menuEstoque()
br label %16
14: ; preds = %1
%15 = tail call i32 (...) @menuCategoria()
br label %16
16: ; preds = %14, %1, %12, %10, %8
ret void
}