#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 *);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float preco_antigo, preco_novo;
  printf("Digite o preço antigo do produto: ");
  scanf("%f", &preco_antigo);
  if (preco_antigo <= 50.00) {
    preco_novo = preco_antigo + preco_antigo * 0.05;
  } else if (preco_antigo > 50.00 && preco_antigo < 100.00) {
    preco_novo = preco_antigo + preco_antigo * 0.10;
  } else {
    preco_novo = preco_antigo + preco_antigo * 0.15;
  }
  if (preco_novo <= 80.00) {
    printf("Barato!");
  } else if (preco_novo > 80.00 && preco_novo <= 120.00) {
    printf("Normal!");
  } else if (preco_novo > 120.00 && preco_novo <= 200.00) {
    printf("Caro!");
  } else {
    printf("Muito caro!");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf0a(%rip),%rdi
call   1030 <printf@plt>
lea    0xf22(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea4(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1196 <main+0x76>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea0(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    122c <main+0x10c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe59(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11fc <main+0xdc>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe46(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11fc <main+0xdc>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe32(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1227 <main+0x107>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdfa(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    122c <main+0x10c>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdeb(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1258 <main+0x138>
lea    0xe19(%rip),%rdi
call   1030 <printf@plt>
jmp    12fc <main+0x1dc>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdbf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    129f <main+0x17f>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdac(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     129f <main+0x17f>
lea    0xdda(%rip),%rdi
call   1030 <printf@plt>
jmp    12f7 <main+0x1d7>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd80(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12e6 <main+0x1c6>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd6d(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     12e6 <main+0x1c6>
lea    0xd9b(%rip),%rdi
call   1030 <printf@plt>
jmp    12f2 <main+0x1d2>
lea    0xd90(%rip),%rdi
call   1030 <printf@plt>
jmp    12f7 <main+0x1d7>
jmp    12fc <main+0x1dc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf08(%rip),%rdi
call   1030 <printf@plt>
lea    0xf20(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm1
cvtss2sd %xmm1,%xmm0
movss  0xeb0(%rip),%xmm2
ucomiss %xmm1,%xmm2
jae    1175 <main+0x55>
ucomiss 0xea4(%rip),%xmm1
jbe    117f <main+0x5f>
movss  0xe9e(%rip),%xmm2
ucomiss %xmm1,%xmm2
jbe    117f <main+0x5f>
movsd  0xeb5(%rip),%xmm1
jmp    1187 <main+0x67>
movsd  0xe9b(%rip),%xmm1
jmp    1187 <main+0x67>
movsd  0xe99(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  0xe6a(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    11c2 <main+0xa2>
ucomiss 0xe5e(%rip),%xmm0
jbe    11cb <main+0xab>
movss  0xe58(%rip),%xmm1
ucomiss %xmm0,%xmm1
jb     11cb <main+0xab>
lea    0xe9f(%rip),%rdi
jmp    11f3 <main+0xd3>
lea    0xe8e(%rip),%rdi
jmp    11f3 <main+0xd3>
movss  0xe3d(%rip),%xmm1
ucomiss %xmm0,%xmm1
lea    0xe90(%rip),%rax
lea    0xe83(%rip),%rdi
cmovb  %rax,%rdi
ucomiss 0xe1d(%rip),%xmm0
cmovbe %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Digite o pre\C3\A7o antigo do produto: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [8 x i8] c"Barato!\00"
@.str.3 = [8 x i8] c"Normal!\00"
@.str.4 = [6 x i8] c"Caro!\00"
@.str.5 = [12 x i8] c"Muito caro!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%6 = load float, float* %2
%7 = fpext float %6 to double
%8 = fcmp ole double %7, 5.000000e+01
br i1 %8, label %9, label %16
9: ; preds = %0
%10 = load float, float* %2
%11 = fpext float %10 to double
%12 = load float, float* %2
%13 = fpext float %12 to double
%14 = call double @llvm.fmuladd.f64(double %13, double 5.000000e-02, double %11)
%15 = fptrunc double %14 to float
store float %15, float* %3
br label %39
16: ; preds = %0
%17 = load float, float* %2
%18 = fpext float %17 to double
%19 = fcmp ogt double %18, 5.000000e+01
br i1 %19, label %20, label %31
20: ; preds = %16
%21 = load float, float* %2
%22 = fpext float %21 to double
%23 = fcmp olt double %22, 1.000000e+02
br i1 %23, label %24, label %31
24: ; preds = %20
%25 = load float, float* %2
%26 = fpext float %25 to double
%27 = load float, float* %2
%28 = fpext float %27 to double
%29 = call double @llvm.fmuladd.f64(double %28, double 1.000000e-01, double %26)
%30 = fptrunc double %29 to float
store float %30, float* %3
br label %38
31: ; preds = %20, %16
%32 = load float, float* %2
%33 = fpext float %32 to double
%34 = load float, float* %2
%35 = fpext float %34 to double
%36 = call double @llvm.fmuladd.f64(double %35, double 1.500000e-01, double %33)
%37 = fptrunc double %36 to float
store float %37, float* %3
br label %38
38: ; preds = %31, %24
br label %39
39: ; preds = %38, %9
%40 = load float, float* %3
%41 = fpext float %40 to double
%42 = fcmp ole double %41, 8.000000e+01
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %69
45: ; preds = %39
%46 = load float, float* %3
%47 = fpext float %46 to double
%48 = fcmp ogt double %47, 8.000000e+01
br i1 %48, label %49, label %55
49: ; preds = %45
%50 = load float, float* %3
%51 = fpext float %50 to double
%52 = fcmp ole double %51, 1.200000e+02
br i1 %52, label %53, label %55
53: ; preds = %49
%54 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %68
55: ; preds = %49, %45
%56 = load float, float* %3
%57 = fpext float %56 to double
%58 = fcmp ogt double %57, 1.200000e+02
br i1 %58, label %59, label %65
59: ; preds = %55
%60 = load float, float* %3
%61 = fpext float %60 to double
%62 = fcmp ole double %61, 2.000000e+02
br i1 %62, label %63, label %65
63: ; preds = %59
%64 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %67
65: ; preds = %59, %55
%66 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
br label %67
67: ; preds = %65, %63
br label %68
68: ; preds = %67, %53
br label %69
69: ; preds = %68, %43
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"Digite o pre\C3\A7o antigo do produto: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [8 x i8] c"Barato!\00"
@.str.3 = [8 x i8] c"Normal!\00"
@.str.4 = [6 x i8] c"Caro!\00"
@.str.5 = [12 x i8] c"Muito caro!\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fcmp ugt float %5, 5.000000e+01
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = call double @llvm.fmuladd.f64(double %6, double 5.000000e-02, double %6)
br label %18
10: ; preds = %0
%11 = fcmp ogt float %5, 5.000000e+01
%12 = fcmp olt float %5, 1.000000e+02
%13 = and i1 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call double @llvm.fmuladd.f64(double %6, double 1.000000e-01, double %6)
br label %18
16: ; preds = %10
%17 = call double @llvm.fmuladd.f64(double %6, double 1.500000e-01, double %6)
br label %18
18: ; preds = %14, %16, %8
%19 = phi double [ %9, %8 ], [ %15, %14 ], [ %17, %16 ]
%20 = fptrunc double %19 to float
%21 = fcmp ugt float %20, 8.000000e+01
br i1 %21, label %22, label %31
22: ; preds = %18
%23 = fcmp ule float %20, 8.000000e+01
%24 = fcmp ugt float %20, 1.200000e+02
%25 = or i1 %23, %24
br i1 %25, label %26, label %31
26: ; preds = %22
%27 = fcmp ule float %20, 1.200000e+02
%28 = fcmp ugt float %20, 2.000000e+02
%29 = or i1 %27, %28
%30 = select i1 %29, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0)
br label %31
31: ; preds = %26, %22, %18
%32 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), %18 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %22 ], [ %30, %26 ]
%33 = call i32 @printf(i8* dereferenceable(1) %32)
ret i32 0
}