#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*/ getchar();
int ler_intervalo(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, float *);
float questiona_tempo() {
  float tempo;
  printf("Ha tres modos para a exibicao:\n");
  printf("\t1 - Exibicao direta;\n");
  printf("\t2 - Exibicao pausada por ENTER;\n");
  printf("\t3 - Exibicao pausada por tempo.\n");
  printf("\nSabendo das opcoes, digite a sua escolha:\n");
  switch (ler_intervalo(1, 3)) {
  case 1:
    printf("\nA exibicao direta foi selecionada\n");
    return -1;
  case 2:
    printf("\nA exibicao pausada por ENTER foi selecionada\n");
    return 0.0;
  case 3:
    printf("\nEntao, agora digite o tempo digitado ");
    printf("(lembrando que pode ser decimal\nseparado por ponto (.), "
           "recomendando valores acima de 1.0):\n");
    scanf("%f", &tempo);
    getchar();
  }
  return tempo;
}


x86 assembly (clang, -O0):
<questiona_tempo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
call   1040 <printf@plt>
lea    0xeea(%rip),%rdi
call   1040 <printf@plt>
lea    0xf00(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
mov    $0x3,%esi
call   1030 <ler_intervalo@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
sub    $0x1,%eax
je     11c8 <questiona_tempo+0x88>
jmp    11a6 <questiona_tempo+0x66>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     11e6 <questiona_tempo+0xa6>
jmp    11b7 <questiona_tempo+0x77>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     11ff <questiona_tempo+0xbf>
jmp    122e <questiona_tempo+0xee>
lea    0xedc(%rip),%rdi
call   1040 <printf@plt>
movss  0xe24(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1238 <questiona_tempo+0xf8>
lea    0xee2(%rip),%rdi
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1238 <questiona_tempo+0xf8>
lea    0xef8(%rip),%rdi
call   1040 <printf@plt>
lea    0xf13(%rip),%rdi
call   1040 <printf@plt>
lea    0xf64(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<questiona_tempo>:
push   %rax
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1d(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
mov    $0x3,%esi
call   1040 <ler_intervalo@plt>
cmp    $0x3,%eax
je     11c1 <questiona_tempo+0x71>
cmp    $0x2,%eax
je     11f9 <questiona_tempo+0xa9>
cmp    $0x1,%eax
jne    11f7 <questiona_tempo+0xa7>
lea    0xfa8(%rip),%rdi
call   1030 <puts@plt>
movss  0xe41(%rip),%xmm0
pop    %rax
ret
lea    0xe3c(%rip),%rdi
call   1050 <printf@plt>
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
lea    0xe4b(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret
lea    0xf2c(%rip),%rdi
call   1030 <puts@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Ha tres modos para a exibicao:\0A\00"
@.str.1 = [23 x i8] c"\091 - Exibicao direta;\0A\00"
@.str.2 = [34 x i8] c"\092 - Exibicao pausada por ENTER;\0A\00"
@.str.3 = [34 x i8] c"\093 - Exibicao pausada por tempo.\0A\00"
@.str.4 = [44 x i8] c"\0ASabendo das opcoes, digite a sua escolha:\0A\00"
@.str.5 = [36 x i8] c"\0AA exibicao direta foi selecionada\0A\00"
@.str.6 = [47 x i8] c"\0AA exibicao pausada por ENTER foi selecionada\0A\00"
@.str.7 = [39 x i8] c"\0AEntao, agora digite o tempo digitado \00"
@.str.8 = [93 x i8] c"(lembrando que pode ser decimal\0Aseparado por ponto (.), recomendando valores acima de 1.0):\0A\00"
@.str.9 = [3 x i8] c"%f\00"
define float @questiona_tempo() {
%1 = alloca float
%2 = alloca float
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 @ler_intervalo(i32 1, i32 3)
switch i32 %8, label %18 [
i32 1, label %9
i32 2, label %11
i32 3, label %13
]
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0))
store float -1.000000e+00, float* %1
br label %20
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0))
store float 0.000000e+00, float* %1
br label %20
13: ; preds = %0
%14 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.8, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), float* %2)
%17 = call i32 (...) @getchar()
br label %18
18: ; preds = %13, %0
%19 = load float, float* %2
store float %19, float* %1
br label %20
20: ; preds = %18, %11, %9
%21 = load float, float* %1
ret float %21
}

LLVM IR (-O2):
@.str.7 = [39 x i8] c"\0AEntao, agora digite o tempo digitado \00"
@.str.9 = [3 x i8] c"%f\00"
@str = [31 x i8] c"Ha tres modos para a exibicao:\00"
@str.10 = [22 x i8] c"\091 - Exibicao direta;\00"
@str.11 = [33 x i8] c"\092 - Exibicao pausada por ENTER;\00"
@str.12 = [33 x i8] c"\093 - Exibicao pausada por tempo.\00"
@str.13 = [43 x i8] c"\0ASabendo das opcoes, digite a sua escolha:\00"
@str.14 = [92 x i8] c"(lembrando que pode ser decimal\0Aseparado por ponto (.), recomendando valores acima de 1.0):\00"
@str.15 = [46 x i8] c"\0AA exibicao pausada por ENTER foi selecionada\00"
@str.16 = [35 x i8] c"\0AA exibicao direta foi selecionada\00"
define float @questiona_tempo() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.10, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.11, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.12, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.13, i64 0, i64 0))
%8 = tail call i32 @ler_intervalo(i32 1, i32 3)
switch i32 %8, label %19 [
i32 1, label %9
i32 2, label %11
i32 3, label %13
]
9: ; preds = %0
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.16, i64 0, i64 0))
br label %19
11: ; preds = %0
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.15, i64 0, i64 0))
br label %19
13: ; preds = %0
%14 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([92 x i8], [92 x i8]* @str.14, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), float* %1)
%17 = call i32 (...) @getchar()
%18 = load float, float* %1
br label %19
19: ; preds = %0, %13, %11, %9
%20 = phi float [ 0.000000e+00, %11 ], [ -1.000000e+00, %9 ], [ %18, %13 ], [ undef, %0 ]
ret float %20
}