#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 *, double);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int consumo1, consumo2;
  double var, valori, valorf;
  scanf("%d %d", &consumo1, &consumo2);
  valori = 17.34;
  if ((consumo2 > 10) && (consumo2 <= 20)) {
    valori = valori + (consumo2 - 10) * 2.41;
  }
  if ((consumo2 > 20) && (consumo2 <= 50)) {
    valori = valori + 10 * 2.41;
    valori = valori + (consumo2 - 20) * 3.70;
  }
  if (consumo2 > 50) {
    valori = valori + 10 * 2.41 + 30 * 3.70;
    valori = valori + (consumo2 - 50) * 4.43;
  }
  var = (double)consumo2 / consumo1;
  var = (var - 1) * 100;
  if ((var > -10) && (var <= 0))
    valorf = valori;
  else if ((var <= -10) && (var > -15))
    valorf = valori * 0.9;
  else if ((var <= -15) && (var > -20))
    valorf = valori * 0.8;
  else if (var <= -20)
    valorf = valori * 0.7;
  else if (var < 20)
    valorf = valori * 1.4;
  else if (var >= 20)
    valorf = valori * 2;
  printf("Valor original = %.2lf\n", valori);
  printf("Valor final = %.2lf\n", valorf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf52(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
movsd  0xeb5(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
cmpl   $0xa,-0xc(%rbp)
jle    1188 <main+0x68>
cmpl   $0x14,-0xc(%rbp)
jg     1188 <main+0x68>
movsd  -0x20(%rbp),%xmm1
mov    -0xc(%rbp),%eax
sub    $0xa,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe8d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cmpl   $0x14,-0xc(%rbp)
jle    11d2 <main+0xb2>
cmpl   $0x32,-0xc(%rbp)
jg     11d2 <main+0xb2>
movsd  0xe74(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
mov    -0xc(%rbp),%eax
sub    $0x14,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe4b(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cmpl   $0x32,-0xc(%rbp)
jle    121e <main+0xfe>
movsd  0xe34(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  0xe37(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
mov    -0xc(%rbp),%eax
sub    $0x32,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe0f(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe02(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xdee(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xdd0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1287 <main+0x167>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1287 <main+0x167>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    139f <main+0x27f>
movsd  0xda1(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     12c8 <main+0x1a8>
movsd  -0x18(%rbp),%xmm0
movsd  0xda1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12c8 <main+0x1a8>
movsd  0xdc7(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    139a <main+0x27a>
movsd  0xd78(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1309 <main+0x1e9>
movsd  -0x18(%rbp),%xmm0
movsd  0xd68(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1309 <main+0x1e9>
movsd  0xd7e(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1395 <main+0x275>
movsd  0xd3f(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1333 <main+0x213>
movsd  0xd4c(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1390 <main+0x270>
movsd  0xd1d(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    135d <main+0x23d>
movsd  0xd1a(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    138b <main+0x26b>
movsd  -0x18(%rbp),%xmm0
movsd  0xcee(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1386 <main+0x266>
movsd  0xce4(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    138b <main+0x26b>
jmp    1390 <main+0x270>
jmp    1395 <main+0x275>
jmp    139a <main+0x27a>
jmp    139f <main+0x27f>
movsd  -0x20(%rbp),%xmm0
lea    0xce3(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xcea(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xf55(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
lea    -0xb(%rax),%ecx
movsd  0xebf(%rip),%xmm0
cmp    $0xa,%ecx
jae    1161 <main+0x41>
lea    -0xa(%rax),%ecx
cvtsi2sd %ecx,%xmm1
mulsd  0xea3(%rip),%xmm1
addsd  %xmm1,%xmm0
lea    -0x15(%rax),%ecx
cmp    $0x1d,%ecx
ja     1185 <main+0x65>
addsd  0xe9f(%rip),%xmm0
lea    -0x14(%rax),%ecx
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
mulsd  0xea5(%rip),%xmm1
jmp    11ac <main+0x8c>
cmp    $0x33,%eax
jl     11b0 <main+0x90>
addsd  0xe7e(%rip),%xmm0
addsd  0xe7e(%rip),%xmm0
lea    -0x32(%rax),%ecx
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
mulsd  0xe74(%rip),%xmm1
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
cvtsi2sdl 0xc(%rsp),%xmm2
divsd  %xmm2,%xmm1
addsd  0xe67(%rip),%xmm1
mulsd  0xe67(%rip),%xmm1
ucomisd 0xe67(%rip),%xmm1
jbe    11ed <main+0xcd>
xorpd  %xmm2,%xmm2
ucomisd %xmm1,%xmm2
movapd %xmm0,%xmm2
jae    1283 <main+0x163>
movsd  0xe4b(%rip),%xmm2
ucomisd %xmm1,%xmm2
jb     1213 <main+0xf3>
ucomisd 0xe45(%rip),%xmm1
jbe    1213 <main+0xf3>
movsd  0xe6b(%rip),%xmm2
mulsd  %xmm0,%xmm2
jmp    1283 <main+0x163>
movsd  0xe2d(%rip),%xmm2
ucomisd %xmm1,%xmm2
jb     1239 <main+0x119>
ucomisd 0xe27(%rip),%xmm1
jbe    1239 <main+0x119>
movsd  0xe3d(%rip),%xmm2
mulsd  %xmm0,%xmm2
jmp    1283 <main+0x163>
movsd  0xe0f(%rip),%xmm2
ucomisd %xmm1,%xmm2
jae    1263 <main+0x143>
movsd  0xe11(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    1271 <main+0x151>
movsd  0xe0b(%rip),%xmm2
mulsd  %xmm0,%xmm2
jmp    1283 <main+0x163>
movsd  0xded(%rip),%xmm2
mulsd  %xmm0,%xmm2
jmp    1283 <main+0x163>
ucomisd 0xde7(%rip),%xmm1
jb     1283 <main+0x163>
movapd %xmm0,%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,0x10(%rsp)
lea    0xdf6(%rip),%rdi
call   1030 <printf@plt>
lea    0xe02(%rip),%rdi
movsd  0x10(%rsp),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [24 x i8] c"Valor original = %.2lf\0A\00"
@.str.2 = [21 x i8] c"Valor final = %.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
store double 1.734000e+01, double* %5
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 10
br i1 %9, label %10, label %19
10: ; preds = %0
%11 = load i32, i32* %3
%12 = icmp sle i32 %11, 20
br i1 %12, label %13, label %19
13: ; preds = %10
%14 = load double, double* %5
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 10
%17 = sitofp i32 %16 to double
%18 = call double @llvm.fmuladd.f64(double %17, double 2.410000e+00, double %14)
store double %18, double* %5
br label %19
19: ; preds = %13, %10, %0
%20 = load i32, i32* %3
%21 = icmp sgt i32 %20, 20
br i1 %21, label %22, label %33
22: ; preds = %19
%23 = load i32, i32* %3
%24 = icmp sle i32 %23, 50
br i1 %24, label %25, label %33
25: ; preds = %22
%26 = load double, double* %5
%27 = fadd double %26, 2.410000e+01
store double %27, double* %5
%28 = load double, double* %5
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 20
%31 = sitofp i32 %30 to double
%32 = call double @llvm.fmuladd.f64(double %31, double 3.700000e+00, double %28)
store double %32, double* %5
br label %33
33: ; preds = %25, %22, %19
%34 = load i32, i32* %3
%35 = icmp sgt i32 %34, 50
br i1 %35, label %36, label %45
36: ; preds = %33
%37 = load double, double* %5
%38 = fadd double %37, 2.410000e+01
%39 = fadd double %38, 1.110000e+02
store double %39, double* %5
%40 = load double, double* %5
%41 = load i32, i32* %3
%42 = sub nsw i32 %41, 50
%43 = sitofp i32 %42 to double
%44 = call double @llvm.fmuladd.f64(double %43, double 4.430000e+00, double %40)
store double %44, double* %5
br label %45
45: ; preds = %36, %33
%46 = load i32, i32* %3
%47 = sitofp i32 %46 to double
%48 = load i32, i32* %2
%49 = sitofp i32 %48 to double
%50 = fdiv double %47, %49
store double %50, double* %4
%51 = load double, double* %4
%52 = fsub double %51, 1.000000e+00
%53 = fmul double %52, 1.000000e+02
store double %53, double* %4
%54 = load double, double* %4
%55 = fcmp ogt double %54, -1.000000e+01
br i1 %55, label %56, label %61
56: ; preds = %45
%57 = load double, double* %4
%58 = fcmp ole double %57, 0.000000e+00
br i1 %58, label %59, label %61
59: ; preds = %56
%60 = load double, double* %5
store double %60, double* %6
br label %102
61: ; preds = %56, %45
%62 = load double, double* %4
%63 = fcmp ole double %62, -1.000000e+01
br i1 %63, label %64, label %70
64: ; preds = %61
%65 = load double, double* %4
%66 = fcmp ogt double %65, -1.500000e+01
br i1 %66, label %67, label %70
67: ; preds = %64
%68 = load double, double* %5
%69 = fmul double %68, 9.000000e-01
store double %69, double* %6
br label %101
70: ; preds = %64, %61
%71 = load double, double* %4
%72 = fcmp ole double %71, -1.500000e+01
br i1 %72, label %73, label %79
73: ; preds = %70
%74 = load double, double* %4
%75 = fcmp ogt double %74, -2.000000e+01
br i1 %75, label %76, label %79
76: ; preds = %73
%77 = load double, double* %5
%78 = fmul double %77, 8.000000e-01
store double %78, double* %6
br label %100
79: ; preds = %73, %70
%80 = load double, double* %4
%81 = fcmp ole double %80, -2.000000e+01
br i1 %81, label %82, label %85
82: ; preds = %79
%83 = load double, double* %5
%84 = fmul double %83, 0x3FE6666666666666
store double %84, double* %6
br label %99
85: ; preds = %79
%86 = load double, double* %4
%87 = fcmp olt double %86, 2.000000e+01
br i1 %87, label %88, label %91
88: ; preds = %85
%89 = load double, double* %5
%90 = fmul double %89, 1.400000e+00
store double %90, double* %6
br label %98
91: ; preds = %85
%92 = load double, double* %4
%93 = fcmp oge double %92, 2.000000e+01
br i1 %93, label %94, label %97
94: ; preds = %91
%95 = load double, double* %5
%96 = fmul double %95, 2.000000e+00
store double %96, double* %6
br label %97
97: ; preds = %94, %91
br label %98
98: ; preds = %97, %88
br label %99
99: ; preds = %98, %82
br label %100
100: ; preds = %99, %76
br label %101
101: ; preds = %100, %67
br label %102
102: ; preds = %101, %59
%103 = load double, double* %5
%104 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), double %103)
%105 = load double, double* %6
%106 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), double %105)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [24 x i8] c"Valor original = %.2lf\0A\00"
@.str.2 = [21 x i8] c"Valor final = %.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %2
%7 = add i32 %6, -11
%8 = icmp ult i32 %7, 10
%9 = add nsw i32 %6, -10
%10 = sitofp i32 %9 to double
%11 = call double @llvm.fmuladd.f64(double %10, double 2.410000e+00, double 1.734000e+01)
%12 = select i1 %8, double %11, double 1.734000e+01
%13 = add i32 %6, -21
%14 = icmp ult i32 %13, 30
br i1 %14, label %15, label %20
15: ; preds = %0
%16 = fadd double %12, 2.410000e+01
%17 = add nsw i32 %6, -20
%18 = sitofp i32 %17 to double
%19 = call double @llvm.fmuladd.f64(double %18, double 3.700000e+00, double %16)
br label %28
20: ; preds = %0
%21 = icmp sgt i32 %6, 50
br i1 %21, label %22, label %28
22: ; preds = %20
%23 = fadd double %12, 2.410000e+01
%24 = fadd double %23, 1.110000e+02
%25 = add nsw i32 %6, -50
%26 = sitofp i32 %25 to double
%27 = call double @llvm.fmuladd.f64(double %26, double 4.430000e+00, double %24)
br label %28
28: ; preds = %15, %22, %20
%29 = phi double [ %27, %22 ], [ %12, %20 ], [ %19, %15 ]
%30 = sitofp i32 %6 to double
%31 = load i32, i32* %1
%32 = sitofp i32 %31 to double
%33 = fdiv double %30, %32
%34 = fadd double %33, -1.000000e+00
%35 = fmul double %34, 1.000000e+02
%36 = fcmp ogt double %35, -1.000000e+01
%37 = fcmp ole double %35, 0.000000e+00
%38 = and i1 %36, %37
br i1 %38, label %63, label %39
39: ; preds = %28
%40 = fcmp ole double %35, -1.000000e+01
%41 = fcmp ogt double %35, -1.500000e+01
%42 = and i1 %40, %41
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = fmul double %29, 9.000000e-01
br label %63
45: ; preds = %39
%46 = fcmp ole double %35, -1.500000e+01
%47 = fcmp ogt double %35, -2.000000e+01
%48 = and i1 %46, %47
br i1 %48, label %49, label %51
49: ; preds = %45
%50 = fmul double %29, 8.000000e-01
br label %63
51: ; preds = %45
%52 = fcmp ugt double %35, -2.000000e+01
br i1 %52, label %55, label %53
53: ; preds = %51
%54 = fmul double %29, 0x3FE6666666666666
br label %63
55: ; preds = %51
%56 = fcmp olt double %35, 2.000000e+01
br i1 %56, label %57, label %59
57: ; preds = %55
%58 = fmul double %29, 1.400000e+00
br label %63
59: ; preds = %55
%60 = fcmp ult double %35, 2.000000e+01
br i1 %60, label %63, label %61
61: ; preds = %59
%62 = fmul double %29, 2.000000e+00
br label %63
63: ; preds = %28, %43, %53, %59, %61, %57, %49
%64 = phi double [ %44, %43 ], [ %50, %49 ], [ %54, %53 ], [ %58, %57 ], [ %62, %61 ], [ undef, %59 ], [ %29, %28 ]
%65 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), double %29)
%66 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), double %64)
ret i32 0
}