#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*/ pesquisar_ciclo_refrigeracao();
int /*<<< orphan*/ pesquisar_pressao_saturado();
int /*<<< orphan*/ pesquisar_superarquecido();
int /*<<< orphan*/ pesquisar_temperatura_saturado();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int opcao;
  int sair = 1;
  while (sair) {
    printf("\n\n\n\n\n\n\nMenu de opcoes\n");
    printf("\t\t-__-__-__-__-__-__-__-__-__-__-__-___-___-___-___-_\n");
    printf("\t\t\t1 = Pesquisa saturado com entrada temperatura\n");
    printf("\t\t\t2 = Pesquisa saturado com entrada pressao\n");
    printf("\t\t\t3 = Pesquisa super-aquecido\n");
    printf("\t\t\t4 = Pesquisa liquido comprimido\n");
    printf("\t\t\t5 = Pesquisa ciclo refrigeracao\n");
    printf("\t\t\t0 = Sair do programa\n");
    printf("\t\t_-__-__-__-__-__-__-__-__-__-__-__-___-___-___-___-_\n");
    printf("Opcao: ");
    scanf("%d", &opcao);
    if (opcao == 1) {
      printf("\n\t%s", "Pesquisa saturado com entrada temperatura");
      pesquisar_temperatura_saturado();
    } else if (opcao == 2) {
      printf("\n\t%s", "Pesquisa saturado com entrada pressao");
      pesquisar_pressao_saturado();
    } else if (opcao == 3) {
      printf("\n\t%s", "Pesquisa super-aquecido");
      pesquisar_superarquecido();
    } else if (opcao == 4) {
      printf("\n\t%s", "Pesquisa liquido comprimido");
      pesquisar_temperatura_saturado();
    } else if (opcao == 5) {
      printf("\n\t%s", "Pesquisa ciclo refrigeracao");
      pesquisar_ciclo_refrigeracao();
    } else {
      sair = 0;
    }
  }
  printf("\n\n\tFIM\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1313 <main+0x1b3>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf5c(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1247 <main+0xe7>
lea    0xf45(%rip),%rdi
lea    0xf43(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <pesquisar_temperatura_saturado@plt>
jmp    130e <main+0x1ae>
cmpl   $0x2,-0x8(%rbp)
jne    1272 <main+0x112>
lea    0xf1a(%rip),%rdi
lea    0xf42(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1080 <pesquisar_pressao_saturado@plt>
jmp    1309 <main+0x1a9>
cmpl   $0x3,-0x8(%rbp)
jne    129d <main+0x13d>
lea    0xeef(%rip),%rdi
lea    0xf3d(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <pesquisar_superarquecido@plt>
jmp    1304 <main+0x1a4>
cmpl   $0x4,-0x8(%rbp)
jne    12c8 <main+0x168>
lea    0xec4(%rip),%rdi
lea    0xf2a(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <pesquisar_temperatura_saturado@plt>
jmp    12ff <main+0x19f>
cmpl   $0x5,-0x8(%rbp)
jne    12f3 <main+0x193>
lea    0xe99(%rip),%rdi
lea    0xf1b(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <pesquisar_ciclo_refrigeracao@plt>
jmp    12fa <main+0x19a>
movl   $0x0,-0xc(%rbp)
jmp    12ff <main+0x19f>
jmp    1304 <main+0x1a4>
jmp    1309 <main+0x1a9>
jmp    130e <main+0x1ae>
jmp    1176 <main+0x16>
lea    0xefd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xfd1(%rip),%r12
lea    0xe8b(%rip),%r13
lea    0xe8c(%rip),%rbx
lea    0x4(%rsp),%rbp
lea    0xe64(%rip),%r15
lea    0xe7c(%rip),%r14
jmp    11bd <main+0x4d>
mov    %r14,%rdi
lea    0xed0(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <pesquisar_temperatura_saturado@plt>
lea    0xe68(%rip),%rdi
call   1030 <puts@plt>
lea    0xe72(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9c(%rip),%rdi
call   1030 <puts@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf23(%rip),%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1080 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x4,%eax
ja     12b5 <main+0x145>
movslq (%r15,%rax,4),%rax
add    %r15,%rax
jmp    *%rax
mov    %r14,%rdi
lea    0xe57(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1090 <pesquisar_pressao_saturado@plt>
jmp    11bd <main+0x4d>
mov    %r14,%rdi
lea    0xe67(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <pesquisar_superarquecido@plt>
jmp    11bd <main+0x4d>
mov    %r14,%rdi
lea    0xe69(%rip),%rsi
jmp    11af <main+0x3f>
mov    %r14,%rdi
lea    0xe7d(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <pesquisar_ciclo_refrigeracao@plt>
jmp    11bd <main+0x4d>
lea    0xd68(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\0A\0A\0A\0A\0A\0A\0AMenu de opcoes\0A\00"
@.str.1 = [55 x i8] c"\09\09-__-__-__-__-__-__-__-__-__-__-__-___-___-___-___-_\0A\00"
@.str.2 = [50 x i8] c"\09\09\091 = Pesquisa saturado com entrada temperatura\0A\00"
@.str.3 = [46 x i8] c"\09\09\092 = Pesquisa saturado com entrada pressao\0A\00"
@.str.4 = [32 x i8] c"\09\09\093 = Pesquisa super-aquecido\0A\00"
@.str.5 = [36 x i8] c"\09\09\094 = Pesquisa liquido comprimido\0A\00"
@.str.6 = [36 x i8] c"\09\09\095 = Pesquisa ciclo refrigeracao\0A\00"
@.str.7 = [25 x i8] c"\09\09\090 = Sair do programa\0A\00"
@.str.8 = [56 x i8] c"\09\09_-__-__-__-__-__-__-__-__-__-__-__-___-___-___-___-_\0A\00"
@.str.9 = [8 x i8] c"Opcao: \00"
@.str.10 = [3 x i8] c"%d\00"
@.str.11 = [5 x i8] c"\0A\09%s\00"
@.str.12 = [42 x i8] c"Pesquisa saturado com entrada temperatura\00"
@.str.13 = [38 x i8] c"Pesquisa saturado com entrada pressao\00"
@.str.14 = [24 x i8] c"Pesquisa super-aquecido\00"
@.str.15 = [28 x i8] c"Pesquisa liquido comprimido\00"
@.str.16 = [28 x i8] c"Pesquisa ciclo refrigeracao\00"
@.str.17 = [9 x i8] c"\0A\0A\09FIM\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
br label %4
4: ; preds = %53, %0
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %54
7: ; preds = %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.6, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.8, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32* %2)
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %24
21: ; preds = %7
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.12, i64 0, i64 0))
%23 = call i32 (...) @pesquisar_temperatura_saturado()
br label %53
24: ; preds = %7
%25 = load i32, i32* %2
%26 = icmp eq i32 %25, 2
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.13, i64 0, i64 0))
%29 = call i32 (...) @pesquisar_pressao_saturado()
br label %52
30: ; preds = %24
%31 = load i32, i32* %2
%32 = icmp eq i32 %31, 3
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.14, i64 0, i64 0))
%35 = call i32 (...) @pesquisar_superarquecido()
br label %51
36: ; preds = %30
%37 = load i32, i32* %2
%38 = icmp eq i32 %37, 4
br i1 %38, label %39, label %42
39: ; preds = %36
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.15, i64 0, i64 0))
%41 = call i32 (...) @pesquisar_temperatura_saturado()
br label %50
42: ; preds = %36
%43 = load i32, i32* %2
%44 = icmp eq i32 %43, 5
br i1 %44, label %45, label %48
45: ; preds = %42
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.16, i64 0, i64 0))
%47 = call i32 (...) @pesquisar_ciclo_refrigeracao()
br label %49
48: ; preds = %42
store i32 0, i32* %3
br label %49
49: ; preds = %48, %45
br label %50
50: ; preds = %49, %39
br label %51
51: ; preds = %50, %33
br label %52
52: ; preds = %51, %27
br label %53
53: ; preds = %52, %21
br label %4
54: ; preds = %4
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.9 = [8 x i8] c"Opcao: \00"
@.str.10 = [3 x i8] c"%d\00"
@.str.11 = [5 x i8] c"\0A\09%s\00"
@.str.12 = [42 x i8] c"Pesquisa saturado com entrada temperatura\00"
@.str.13 = [38 x i8] c"Pesquisa saturado com entrada pressao\00"
@.str.14 = [24 x i8] c"Pesquisa super-aquecido\00"
@.str.15 = [28 x i8] c"Pesquisa liquido comprimido\00"
@.str.16 = [28 x i8] c"Pesquisa ciclo refrigeracao\00"
@str = [8 x i8] c"\0A\0A\09FIM\0A\00"
@str.18 = [22 x i8] c"\0A\0A\0A\0A\0A\0A\0AMenu de opcoes\00"
@str.19 = [54 x i8] c"\09\09-__-__-__-__-__-__-__-__-__-__-__-___-___-___-___-_\00"
@str.20 = [49 x i8] c"\09\09\091 = Pesquisa saturado com entrada temperatura\00"
@str.21 = [45 x i8] c"\09\09\092 = Pesquisa saturado com entrada pressao\00"
@str.22 = [31 x i8] c"\09\09\093 = Pesquisa super-aquecido\00"
@str.23 = [35 x i8] c"\09\09\094 = Pesquisa liquido comprimido\00"
@str.24 = [35 x i8] c"\09\09\095 = Pesquisa ciclo refrigeracao\00"
@str.25 = [24 x i8] c"\09\09\090 = Sair do programa\00"
@str.26 = [55 x i8] c"\09\09_-__-__-__-__-__-__-__-__-__-__-__-___-___-___-___-_\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %22, %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.18, i64 0, i64 0))
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.19, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.20, i64 0, i64 0))
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.21, i64 0, i64 0))
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.22, i64 0, i64 0))
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.23, i64 0, i64 0))
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.24, i64 0, i64 0))
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.25, i64 0, i64 0))
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.26, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32* %1)
%15 = load i32, i32* %1
switch i32 %15, label %32 [
i32 1, label %16
i32 2, label %19
i32 3, label %23
i32 4, label %26
i32 5, label %29
]
16: ; preds = %3
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.12, i64 0, i64 0))
%18 = call i32 (...) @pesquisar_temperatura_saturado()
br label %22
19: ; preds = %3
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.13, i64 0, i64 0))
%21 = call i32 (...) @pesquisar_pressao_saturado()
br label %22
22: ; preds = %19, %26, %29, %23, %16
br label %3
23: ; preds = %3
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.14, i64 0, i64 0))
%25 = call i32 (...) @pesquisar_superarquecido()
br label %22
26: ; preds = %3
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.15, i64 0, i64 0))
%28 = call i32 (...) @pesquisar_temperatura_saturado()
br label %22
29: ; preds = %3
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.16, i64 0, i64 0))
%31 = call i32 (...) @pesquisar_ciclo_refrigeracao()
br label %22
32: ; preds = %3
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}