#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 custo;
  printf("Custo de Fábrica: R$ ");
  scanf("%f", &custo);
  if (custo <= 12000) {
    printf("Distribuidor 5%%: %.2f\n", custo * 0.05);
    printf("Imposto: Isento\n");
    printf("Preço Final ao Consumidor: %.2f\n", custo * 1.05);
  } else {
    if (custo > 12000 && custo <= 25000) {
      printf("Distribuidor 10%%: %.2f\n", custo * 0.1);
      printf("Imposto 15%%: %.2f\n", custo * 0.15);
      printf("Preço Final ao Consumidor: %.2f\n",
             custo + custo * 0.1 + custo * 0.15);
    } else {
      printf("Distribuidor 15%%: %.2f\n", custo * 0.15);
      printf("Impostos 20%%: %.2f\n", custo * 0.2);
      printf("Preço Final ao Consumidor: %.2f\n",
             custo + custo * 0.15 + custo * 0.2);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xeab(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     11b8 <main+0x98>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb8(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xecf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe7f(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xec7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1308 <main+0x1e8>
movss  -0x8(%rbp),%xmm0
movss  0xe3b(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1274 <main+0x154>
movss  0xe2e(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1274 <main+0x154>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe27(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xe99(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdfc(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xe8f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xdd8(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdb7(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
lea    0xe0b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1303 <main+0x1e3>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd8b(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xe32(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd60(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xe28(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xd3c(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd1b(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
lea    0xd77(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1308 <main+0x1e8>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf01(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm1
movss  0xea2(%rip),%xmm0
ucomiss %xmm1,%xmm0
jae    11e9 <main+0xb9>
ucomiss 0xe92(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
jbe    1226 <main+0xf6>
movss  0xe81(%rip),%xmm2
ucomiss %xmm1,%xmm2
jb     1226 <main+0xf6>
mulsd  0xe94(%rip),%xmm0
lea    0xee9(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe64(%rip),%xmm0
lea    0xee2(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe54(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm0,%xmm1
mulsd  0xe34(%rip),%xmm0
jmp    127e <main+0x14e>
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  0xe10(%rip),%xmm0
lea    0xe4b(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xdec(%rip),%xmm0
jmp    1282 <main+0x152>
mulsd  0xdea(%rip),%xmm0
lea    0xe7c(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xdd2(%rip),%xmm0
lea    0xe75(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdaa(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm0,%xmm1
mulsd  0xda2(%rip),%xmm0
addsd  %xmm1,%xmm0
lea    0xdd9(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Custo de F\C3\A1brica: R$ \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [24 x i8] c"Distribuidor 5%%: %.2f\0A\00"
@.str.3 = [17 x i8] c"Imposto: Isento\0A\00"
@.str.4 = [34 x i8] c"Pre\C3\A7o Final ao Consumidor: %.2f\0A\00"
@.str.5 = [25 x i8] c"Distribuidor 10%%: %.2f\0A\00"
@.str.6 = [20 x i8] c"Imposto 15%%: %.2f\0A\00"
@.str.7 = [25 x i8] c"Distribuidor 15%%: %.2f\0A\00"
@.str.8 = [21 x i8] c"Impostos 20%%: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 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* %2)
%5 = load float, float* %2
%6 = fcmp ole float %5, 1.200000e+04
br i1 %6, label %7, label %17
7: ; preds = %0
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = fmul double %9, 5.000000e-02
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), double %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%13 = load float, float* %2
%14 = fpext float %13 to double
%15 = fmul double %14, 1.050000e+00
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), double %15)
br label %60
17: ; preds = %0
%18 = load float, float* %2
%19 = fcmp ogt float %18, 1.200000e+04
br i1 %19, label %20, label %41
20: ; preds = %17
%21 = load float, float* %2
%22 = fcmp ole float %21, 2.500000e+04
br i1 %22, label %23, label %41
23: ; preds = %20
%24 = load float, float* %2
%25 = fpext float %24 to double
%26 = fmul double %25, 1.000000e-01
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), double %26)
%28 = load float, float* %2
%29 = fpext float %28 to double
%30 = fmul double %29, 1.500000e-01
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), double %30)
%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.000000e-01, double %33)
%37 = load float, float* %2
%38 = fpext float %37 to double
%39 = call double @llvm.fmuladd.f64(double %38, double 1.500000e-01, double %36)
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), double %39)
br label %59
41: ; preds = %20, %17
%42 = load float, float* %2
%43 = fpext float %42 to double
%44 = fmul double %43, 1.500000e-01
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), double %44)
%46 = load float, float* %2
%47 = fpext float %46 to double
%48 = fmul double %47, 2.000000e-01
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), double %48)
%50 = load float, float* %2
%51 = fpext float %50 to double
%52 = load float, float* %2
%53 = fpext float %52 to double
%54 = call double @llvm.fmuladd.f64(double %53, double 1.500000e-01, double %51)
%55 = load float, float* %2
%56 = fpext float %55 to double
%57 = call double @llvm.fmuladd.f64(double %56, double 2.000000e-01, double %54)
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), double %57)
br label %59
59: ; preds = %41, %23
br label %60
60: ; preds = %59, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Custo de F\C3\A1brica: R$ \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [24 x i8] c"Distribuidor 5%%: %.2f\0A\00"
@.str.4 = [34 x i8] c"Pre\C3\A7o Final ao Consumidor: %.2f\0A\00"
@.str.5 = [25 x i8] c"Distribuidor 10%%: %.2f\0A\00"
@.str.6 = [20 x i8] c"Imposto 15%%: %.2f\0A\00"
@.str.7 = [25 x i8] c"Distribuidor 15%%: %.2f\0A\00"
@.str.8 = [21 x i8] c"Impostos 20%%: %.2f\0A\00"
@str = [16 x i8] c"Imposto: Isento\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 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 = fcmp ugt float %5, 1.200000e+04
br i1 %6, label %15, label %7
7: ; preds = %0
%8 = fpext float %5 to double
%9 = fmul double %8, 5.000000e-02
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), double %9)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%12 = load float, float* %1
%13 = fpext float %12 to double
%14 = fmul double %13, 1.050000e+00
br label %42
15: ; preds = %0
%16 = fcmp ogt float %5, 1.200000e+04
%17 = fcmp ole float %5, 2.500000e+04
%18 = and i1 %16, %17
%19 = fpext float %5 to double
br i1 %18, label %20, label %31
20: ; preds = %15
%21 = fmul double %19, 1.000000e-01
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), double %21)
%23 = load float, float* %1
%24 = fpext float %23 to double
%25 = fmul double %24, 1.500000e-01
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), double %25)
%27 = load float, float* %1
%28 = fpext float %27 to double
%29 = call double @llvm.fmuladd.f64(double %28, double 1.000000e-01, double %28)
%30 = call double @llvm.fmuladd.f64(double %28, double 1.500000e-01, double %29)
br label %42
31: ; preds = %15
%32 = fmul double %19, 1.500000e-01
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), double %32)
%34 = load float, float* %1
%35 = fpext float %34 to double
%36 = fmul double %35, 2.000000e-01
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), double %36)
%38 = load float, float* %1
%39 = fpext float %38 to double
%40 = call double @llvm.fmuladd.f64(double %39, double 1.500000e-01, double %39)
%41 = call double @llvm.fmuladd.f64(double %39, double 2.000000e-01, double %40)
br label %42
42: ; preds = %20, %31, %7
%43 = phi double [ %30, %20 ], [ %41, %31 ], [ %14, %7 ]
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), double %43)
ret i32 0
}