#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 *, ...);
float proximaApolice(float, int, int);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int idade, n_acidentes;
  float apolice, apolice_futura;
  printf("Idade: ");
  scanf("%d", &idade);
  printf("N de acidentes: ");
  scanf("%d", &n_acidentes);
  printf("Apolice: ");
  scanf("%f", &apolice);
  apolice_futura = proximaApolice(apolice, idade, n_acidentes);
  if (apolice_futura >= 0.01)
    printf("\nA sua próxima apólice é: %.2f\n", apolice_futura);
  else
    printf("\nA sua apolice foi recusada\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9c(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9a(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <proximaApolice@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe3b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11eb <main+0xbb>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe52(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11f9 <main+0xc9>
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb6(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xea3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe97(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe93(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1060 <proximaApolice@plt>
cvtss2sd %xmm0,%xmm0
ucomisd 0xe3a(%rip),%xmm0
jae    11d6 <main+0x96>
lea    0xe85(%rip),%rdi
call   1030 <puts@plt>
jmp    11e4 <main+0xa4>
lea    0xe54(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Idade: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"N de acidentes: \00"
@.str.3 = [10 x i8] c"Apolice: \00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [35 x i8] c"\0AA sua pr\C3\B3xima ap\C3\B3lice \C3\A9: %.2f\0A\00"
@.str.6 = [29 x i8] c"\0AA sua apolice foi recusada\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %4)
%12 = load float, float* %4
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call float @proximaApolice(float %12, i32 %13, i32 %14)
store float %15, float* %5
%16 = load float, float* %5
%17 = fpext float %16 to double
%18 = fcmp oge double %17, 1.000000e-02
br i1 %18, label %19, label %23
19: ; preds = %0
%20 = load float, float* %5
%21 = fpext float %20 to double
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), double %21)
br label %25
23: ; preds = %0
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0))
br label %25
25: ; preds = %23, %19
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"Idade: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"N de acidentes: \00"
@.str.3 = [10 x i8] c"Apolice: \00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [35 x i8] c"\0AA sua pr\C3\B3xima ap\C3\B3lice \C3\A9: %.2f\0A\00"
@str = [28 x i8] c"\0AA sua apolice foi recusada\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %3)
%13 = load float, float* %3
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = call float @proximaApolice(float %13, i32 %14, i32 %15)
%17 = fpext float %16 to double
%18 = fcmp ult double %17, 1.000000e-02
br i1 %18, label %21, label %19
19: ; preds = %0
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), double %17)
br label %23
21: ; preds = %0
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
br label %23
23: ; preds = %21, %19
ret i32 0
}