#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 decisao(float km, float liters_consumed) {
  float consume_math = km / liters_consumed;
  printf("Km/l: %f\n", consume_math);
  if (consume_math < 8) {
    printf("Venda o carro!\n");
    return -1;
  } else if (consume_math > 8 && consume_math < 12) {
    printf("Econômico!\n");
    return 0;
  } else if (consume_math >= 12) {
    printf("Super econômico!\n");
    return 1;
  }
  return -2;
}


x86 assembly (clang, -O0):
<decisao>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xed3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0xeb0(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    117a <decisao+0x6a>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  0xea0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    120a <decisao+0xfa>
movss  -0x10(%rbp),%xmm0
movss  0xe79(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11bd <decisao+0xad>
movss  0xe6c(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    11bd <decisao+0xad>
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    120a <decisao+0xfa>
movss  -0x10(%rbp),%xmm0
movss  0xe3a(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     11f3 <decisao+0xe3>
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  0xe23(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    120a <decisao+0xfa>
jmp    11f8 <decisao+0xe8>
jmp    11fd <decisao+0xed>
movss  0xe03(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decisao>:
push   %rax
divss  %xmm1,%xmm0
movss  %xmm0,0x4(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xede(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm1
movss  0xeb9(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    1167 <decisao+0x47>
movss  0xea8(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
lea    0xed7(%rip),%rdi
jmp    11b7 <decisao+0x97>
ucomiss 0xe96(%rip),%xmm1
jbe    118f <decisao+0x6f>
movss  0xe90(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    118f <decisao+0x6f>
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
lea    0xea3(%rip),%rdi
jmp    11b7 <decisao+0x97>
ucomiss 0xe72(%rip),%xmm1
jae    11a2 <decisao+0x82>
movss  0xe70(%rip),%xmm0
pop    %rax
ret
movss  0xe62(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
lea    0xe67(%rip),%rdi
call   1030 <puts@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Km/l: %f\0A\00"
@.str.1 = [16 x i8] c"Venda o carro!\0A\00"
@.str.2 = [13 x i8] c"Econ\C3\B4mico!\0A\00"
@.str.3 = [19 x i8] c"Super econ\C3\B4mico!\0A\00"
define float @decisao(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fdiv float %7, %8
store float %9, float* %6
%10 = load float, float* %6
%11 = fpext float %10 to double
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %11)
%13 = load float, float* %6
%14 = fcmp olt float %13, 8.000000e+00
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
store float -1.000000e+00, float* %3
br label %33
17: ; preds = %2
%18 = load float, float* %6
%19 = fcmp ogt float %18, 8.000000e+00
br i1 %19, label %20, label %25
20: ; preds = %17
%21 = load float, float* %6
%22 = fcmp olt float %21, 1.200000e+01
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
store float 0.000000e+00, float* %3
br label %33
25: ; preds = %20, %17
%26 = load float, float* %6
%27 = fcmp oge float %26, 1.200000e+01
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
store float 1.000000e+00, float* %3
br label %33
30: ; preds = %25
br label %31
31: ; preds = %30
br label %32
32: ; preds = %31
store float -2.000000e+00, float* %3
br label %33
33: ; preds = %32, %28, %23, %15
%34 = load float, float* %3
ret float %34
}

LLVM IR (-O2):
@.str = [10 x i8] c"Km/l: %f\0A\00"
@str = [18 x i8] c"Super econ\C3\B4mico!\00"
@str.4 = [12 x i8] c"Econ\C3\B4mico!\00"
@str.5 = [15 x i8] c"Venda o carro!\00"
define float @decisao(float %0, float %1) {
%3 = fdiv float %0, %1
%4 = fpext float %3 to double
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %4)
%6 = fcmp olt float %3, 8.000000e+00
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = fcmp ogt float %3, 8.000000e+00
%9 = fcmp olt float %3, 1.200000e+01
%10 = and i1 %8, %9
br i1 %10, label %13, label %11
11: ; preds = %7
%12 = fcmp ult float %3, 1.200000e+01
br i1 %12, label %17, label %13
13: ; preds = %11, %7, %2
%14 = phi i8* [ getelementptr inbounds ([15 x i8], [15 x i8]* @str.5, i64 0, i64 0), %2 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.4, i64 0, i64 0), %7 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0), %11 ]
%15 = phi float [ -1.000000e+00, %2 ], [ 0.000000e+00, %7 ], [ 1.000000e+00, %11 ]
%16 = tail call i32 @puts(i8* dereferenceable(1) %14)
br label %17
17: ; preds = %13, %11
%18 = phi float [ -2.000000e+00, %11 ], [ %15, %13 ]
ret float %18
}