#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 *, double *);
int main() {
  double salary;
  double taxes;
  scanf("%lf", &salary);
  double taxFloor, taxRate, taxesAval;
  const double TAX_FLOOR[3] = {4500.01, 3000.01, 2000.01};
  const double TAX_RATE[3] = {0.28, 0.18, 0.08};
  taxes = 0;
  int i;
  for (i = 0; i < 3; i++) {
    if (salary > TAX_FLOOR[i]) {
      taxes += (salary - TAX_FLOOR[i]) * TAX_RATE[i];
      salary -= salary - TAX_FLOOR[i];
    }
  }
  if (taxes)
    printf("R$ %.2f\n", taxes);
  else
    printf("Isento\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    0xed7(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xed6(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x74(%rbp)
cmpl   $0x3,-0x74(%rbp)
jge    120d <main+0xed>
movsd  -0x10(%rbp),%xmm0
movslq -0x74(%rbp),%rax
ucomisd -0x50(%rbp,%rax,8),%xmm0
jbe    11fa <main+0xda>
movsd  -0x10(%rbp),%xmm0
movslq -0x74(%rbp),%rax
subsd  -0x50(%rbp,%rax,8),%xmm0
movslq -0x74(%rbp),%rax
movsd  -0x70(%rbp,%rax,8),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movslq -0x74(%rbp),%rax
subsd  -0x50(%rbp,%rax,8),%xmm1
movsd  -0x10(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    11ff <main+0xdf>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1193 <main+0x73>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    122a <main+0x10a>
jp     122a <main+0x10a>
jmp    1242 <main+0x122>
movsd  -0x18(%rbp),%xmm0
lea    0xdce(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1250 <main+0x130>
lea    0xdc4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf10(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm1
xorpd  %xmm0,%xmm0
ucomisd 0xeaf(%rip),%xmm1
ja     11a4 <main+0x74>
ucomisd 0xebd(%rip),%xmm1
ja     11d3 <main+0xa3>
ucomisd 0xecb(%rip),%xmm1
jbe    1188 <main+0x58>
movsd  0xec9(%rip),%xmm2
addsd  %xmm1,%xmm2
subsd  %xmm2,%xmm1
mulsd  0xec1(%rip),%xmm2
addsd  %xmm2,%xmm0
movsd  %xmm1,(%rsp)
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1194 <main+0x64>
jnp    1204 <main+0xd4>
lea    0xeb1(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1210 <main+0xe0>
movsd  0xe5c(%rip),%xmm2
addsd  %xmm1,%xmm2
subsd  %xmm2,%xmm1
mulsd  0xe54(%rip),%xmm2
xorpd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm1,(%rsp)
ucomisd 0xe47(%rip),%xmm1
jbe    115d <main+0x2d>
movsd  0xe45(%rip),%xmm2
addsd  %xmm1,%xmm2
subsd  %xmm2,%xmm1
mulsd  0xe3d(%rip),%xmm2
addsd  %xmm2,%xmm0
movsd  %xmm1,(%rsp)
ucomisd 0xe34(%rip),%xmm1
ja     1167 <main+0x37>
jmp    1188 <main+0x58>
lea    0xe4a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@__const.main.TAX_FLOOR = [3 x double] [double 4.500010e+03, double 3.000010e+03, double 2.000010e+03]
@__const.main.TAX_RATE = [3 x double] [double 2.800000e-01, double 1.800000e-01, double 8.000000e-02]
@.str.1 = [9 x i8] c"R$ %.2f\0A\00"
@.str.2 = [8 x i8] c"Isento\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca [3 x double]
%8 = alloca [3 x double]
%9 = alloca i32
store i32 0, i32* %1
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%11 = bitcast [3 x double]* %7 to i8*
%12 = bitcast [3 x double]* %8 to i8*
store double 0.000000e+00, double* %3
store i32 0, i32* %9
br label %13
13: ; preds = %45, %0
%14 = load i32, i32* %9
%15 = icmp slt i32 %14, 3
br i1 %15, label %16, label %48
16: ; preds = %13
%17 = load double, double* %2
%18 = load i32, i32* %9
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 %19
%21 = load double, double* %20
%22 = fcmp ogt double %17, %21
br i1 %22, label %23, label %44
23: ; preds = %16
%24 = load double, double* %2
%25 = load i32, i32* %9
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 %26
%28 = load double, double* %27
%29 = fsub double %24, %28
%30 = load i32, i32* %9
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 %31
%33 = load double, double* %32
%34 = load double, double* %3
%35 = call double @llvm.fmuladd.f64(double %29, double %33, double %34)
store double %35, double* %3
%36 = load double, double* %2
%37 = load i32, i32* %9
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 %38
%40 = load double, double* %39
%41 = fsub double %36, %40
%42 = load double, double* %2
%43 = fsub double %42, %41
store double %43, double* %2
br label %44
44: ; preds = %23, %16
br label %45
45: ; preds = %44
%46 = load i32, i32* %9
%47 = add nsw i32 %46, 1
store i32 %47, i32* %9
br label %13
48: ; preds = %13
%49 = load double, double* %3
%50 = fcmp une double %49, 0.000000e+00
br i1 %50, label %51, label %54
51: ; preds = %48
%52 = load double, double* %3
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %52)
br label %56
54: ; preds = %48
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %56
56: ; preds = %54, %51
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [9 x i8] c"R$ %.2f\0A\00"
@str = [7 x i8] c"Isento\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fcmp ogt double %4, 4.500010e+03
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = fadd double %4, -4.500010e+03
%8 = call double @llvm.fmuladd.f64(double %7, double 2.800000e-01, double 0.000000e+00)
%9 = fsub double %4, %7
store double %9, double* %1
br label %10
10: ; preds = %0, %6
%11 = phi double [ %9, %6 ], [ %4, %0 ]
%12 = phi double [ %8, %6 ], [ 0.000000e+00, %0 ]
%13 = fcmp ogt double %11, 3.000010e+03
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = fadd double %11, -3.000010e+03
%16 = call double @llvm.fmuladd.f64(double %15, double 1.800000e-01, double %12)
%17 = fsub double %11, %15
store double %17, double* %1
br label %18
18: ; preds = %14, %10
%19 = phi double [ %17, %14 ], [ %11, %10 ]
%20 = phi double [ %16, %14 ], [ %12, %10 ]
%21 = fcmp ogt double %19, 2.000010e+03
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = fadd double %19, -2.000010e+03
%24 = call double @llvm.fmuladd.f64(double %23, double 8.000000e-02, double %20)
%25 = fsub double %19, %23
store double %25, double* %1
br label %26
26: ; preds = %22, %18
%27 = phi double [ %24, %22 ], [ %20, %18 ]
%28 = fcmp une double %27, 0.000000e+00
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %27)
br label %33
31: ; preds = %26
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
br label %33
33: ; preds = %31, %29
ret i32 0
}