#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*/ puts(char *);
int /*<<< orphan*/ system(char *);
void saida(int controle, int saida) {
  switch (controle) {
  case 1:
    printf("\nImpossivel abrir o arquivo.\n\n");
    break;
  case 2:
    printf("Informe o codigo do contato: ");
    break;
  case 3:
    system("/usr/bin/clear");
    break;
  case 4:
    printf("---------------------------------------------------------\n");
    break;
  case 5:
    puts("Digite o codigo do contato a ser modificado:");
    break;
  case 6:
    puts("Informe o nome do contato:");
    break;
  case 7:
    puts("Informe o endereco do contato:");
    break;
  case 8:
    printf("Digite o codigo do usuario a ser apagado no arquivo: ");
    break;
  case 9:
    printf("Operacao invalida.\n");
    break;
  case 10:
    printf("\nInforme a operação que deseja realizar:\n 1 - Criar agenda por "
           "arquivo\n 2 - Listar contatos\n 3 - Editar contatos\n 4 - Apagar "
           "contatos\n 5 - Pesquisar contato\n 6 - Limpa agenda\n 9 - "
           "Sair\n\nOperação: ");
    break;
  }
}


x86 assembly (clang, -O0):
<saida>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x9,%eax
ja     120c <saida+0xdc>
mov    -0x10(%rbp),%rax
lea    0xea2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xeba(%rip),%rdi
call   1050 <printf@plt>
jmp    120c <saida+0xdc>
lea    0xec8(%rip),%rdi
call   1050 <printf@plt>
jmp    120c <saida+0xdc>
lea    0xed5(%rip),%rdi
call   1040 <system@plt>
jmp    120c <saida+0xdc>
lea    0xed3(%rip),%rdi
call   1050 <printf@plt>
jmp    120c <saida+0xdc>
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
jmp    120c <saida+0xdc>
lea    0xf19(%rip),%rdi
call   1030 <puts@plt>
jmp    120c <saida+0xdc>
lea    0xf23(%rip),%rdi
call   1030 <puts@plt>
jmp    120c <saida+0xdc>
lea    0xf31(%rip),%rdi
call   1050 <printf@plt>
jmp    120c <saida+0xdc>
lea    0xf56(%rip),%rdi
call   1050 <printf@plt>
jmp    120c <saida+0xdc>
lea    0xf59(%rip),%rdi
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saida>:
add    $0xffffffff,%edi
cmp    $0x9,%edi
ja     1154 <saida+0x24>
lea    0xec1(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0x10b9(%rip),%rdi
jmp    1030 <puts@plt>
ret
lea    0xecc(%rip),%rdi
jmp    1050 <printf@plt>
lea    0xede(%rip),%rdi
jmp    1040 <system@plt>
lea    0x105a(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xed5(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xef6(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xf05(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xf18(%rip),%rdi
jmp    1050 <printf@plt>
lea    0xf42(%rip),%rdi
jmp    1050 <printf@plt>
lea    0xfff(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"\0AImpossivel abrir o arquivo.\0A\0A\00"
@.str.1 = [30 x i8] c"Informe o codigo do contato: \00"
@.str.2 = [15 x i8] c"/usr/bin/clear\00"
@.str.3 = [59 x i8] c"---------------------------------------------------------\0A\00"
@.str.4 = [45 x i8] c"Digite o codigo do contato a ser modificado:\00"
@.str.5 = [27 x i8] c"Informe o nome do contato:\00"
@.str.6 = [31 x i8] c"Informe o endereco do contato:\00"
@.str.7 = [54 x i8] c"Digite o codigo do usuario a ser apagado no arquivo: \00"
@.str.8 = [20 x i8] c"Operacao invalida.\0A\00"
@.str.9 = [201 x i8] c"\0AInforme a opera\C3\A7\C3\A3o que deseja realizar:\0A 1 - Criar agenda por arquivo\0A 2 - Listar contatos\0A 3 - Editar contatos\0A 4 - Apagar contatos\0A 5 - Pesquisar contato\0A 6 - Limpa agenda\0A 9 - Sair\0A\0AOpera\C3\A7\C3\A3o: \00"
define void @saida(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
switch i32 %5, label %26 [
i32 1, label %6
i32 2, label %8
i32 3, label %10
i32 4, label %12
i32 5, label %14
i32 6, label %16
i32 7, label %18
i32 8, label %20
i32 9, label %22
i32 10, label %24
]
6: ; preds = %2
%7 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %26
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
br label %26
10: ; preds = %2
%11 = call i32 @system(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %26
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.3, i64 0, i64 0))
br label %26
14: ; preds = %2
%15 = call i32 @puts(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0))
br label %26
16: ; preds = %2
%17 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
br label %26
18: ; preds = %2
%19 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
br label %26
20: ; preds = %2
%21 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0))
br label %26
22: ; preds = %2
%23 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0))
br label %26
24: ; preds = %2
%25 = call i32 @printf(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str.9, i64 0, i64 0))
br label %26
26: ; preds = %2, %24, %22, %20, %18, %16, %14, %12, %10, %8, %6
ret void
}

LLVM IR (-O2):
@.str.1 = [30 x i8] c"Informe o codigo do contato: \00"
@.str.2 = [15 x i8] c"/usr/bin/clear\00"
@.str.4 = [45 x i8] c"Digite o codigo do contato a ser modificado:\00"
@.str.5 = [27 x i8] c"Informe o nome do contato:\00"
@.str.6 = [31 x i8] c"Informe o endereco do contato:\00"
@.str.7 = [54 x i8] c"Digite o codigo do usuario a ser apagado no arquivo: \00"
@.str.9 = [201 x i8] c"\0AInforme a opera\C3\A7\C3\A3o que deseja realizar:\0A 1 - Criar agenda por arquivo\0A 2 - Listar contatos\0A 3 - Editar contatos\0A 4 - Apagar contatos\0A 5 - Pesquisar contato\0A 6 - Limpa agenda\0A 9 - Sair\0A\0AOpera\C3\A7\C3\A3o: \00"
@str = [19 x i8] c"Operacao invalida.\00"
@str.10 = [58 x i8] c"---------------------------------------------------------\00"
@str.11 = [30 x i8] c"\0AImpossivel abrir o arquivo.\0A\00"
define void @saida(i32 %0, i32 %1) {
switch i32 %0, label %23 [
i32 1, label %3
i32 2, label %5
i32 3, label %7
i32 4, label %9
i32 5, label %11
i32 6, label %13
i32 7, label %15
i32 8, label %17
i32 9, label %19
i32 10, label %21
]
3: ; preds = %2
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.11, i64 0, i64 0))
br label %23
5: ; preds = %2
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
br label %23
7: ; preds = %2
%8 = tail call i32 @system(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %23
9: ; preds = %2
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.10, i64 0, i64 0))
br label %23
11: ; preds = %2
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0))
br label %23
13: ; preds = %2
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
br label %23
15: ; preds = %2
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
br label %23
17: ; preds = %2
%18 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0))
br label %23
19: ; preds = %2
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %23
21: ; preds = %2
%22 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([201 x i8], [201 x i8]* @.str.9, i64 0, i64 0))
br label %23
23: ; preds = %2, %21, %19, %17, %15, %13, %11, %9, %7, %5, %3
ret void
}