#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, double, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double currentSalary, increasedSalary, increaseRate;
  scanf("%lf", &currentSalary);
  if (currentSalary < 400.01)
    increaseRate = 0.15;
  else if (currentSalary < 800.01)
    increaseRate = 0.12;
  else if (currentSalary < 1200.01)
    increaseRate = 0.10;
  else if (currentSalary < 2000.01)
    increaseRate = 0.07;
  else
    increaseRate = 0.04;
  increasedSalary = currentSalary + currentSalary * increaseRate;
  printf(
      "Novo salario: %.2lf\nReajuste ganho: %.2lf\nEm percentual: %.0lf %%\n",
      increasedSalary, increasedSalary - currentSalary, increaseRate * 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf1a(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xeb9(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1164 <main+0x44>
movsd  0xee6(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11ef <main+0xcf>
movsd  0xe9c(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1189 <main+0x69>
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11ea <main+0xca>
movsd  0xe7f(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11ae <main+0x8e>
movsd  0xe8c(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11e5 <main+0xc5>
movsd  0xe62(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11d3 <main+0xb3>
movsd  0xe5f(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11e0 <main+0xc0>
movsd  0xe45(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11e5 <main+0xc5>
jmp    11ea <main+0xca>
jmp    11ef <main+0xcf>
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  0xe26(%rip),%xmm2
mulsd  -0x20(%rbp),%xmm2
lea    0xe26(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf28(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm3
movsd  0xecb(%rip),%xmm0
ucomisd %xmm3,%xmm0
jbe    114d <main+0x2d>
movsd  0xeb5(%rip),%xmm2
jmp    119a <main+0x7a>
movsd  0xec3(%rip),%xmm0
ucomisd %xmm3,%xmm0
jbe    1165 <main+0x45>
movsd  0xead(%rip),%xmm2
jmp    119a <main+0x7a>
movsd  0xebb(%rip),%xmm0
ucomisd %xmm3,%xmm0
jbe    117d <main+0x5d>
movsd  0xea5(%rip),%xmm2
jmp    119a <main+0x7a>
movsd  0xeab(%rip),%xmm0
xor    %eax,%eax
ucomisd %xmm3,%xmm0
seta   %al
lea    0xeab(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm2
movapd %xmm3,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
movapd %xmm0,%xmm1
subsd  %xmm3,%xmm1
mulsd  0xe82(%rip),%xmm2
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [67 x i8] c"Novo salario: %.2lf\0AReajuste ganho: %.2lf\0AEm percentual: %.0lf %%\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = fcmp olt double %6, 4.000100e+02
br i1 %7, label %8, label %9
8: ; preds = %0
store double 1.500000e-01, double* %4
br label %25
9: ; preds = %0
%10 = load double, double* %2
%11 = fcmp olt double %10, 0x408900147AE147AE
br i1 %11, label %12, label %13
12: ; preds = %9
store double 1.200000e-01, double* %4
br label %24
13: ; preds = %9
%14 = load double, double* %2
%15 = fcmp olt double %14, 1.200010e+03
br i1 %15, label %16, label %17
16: ; preds = %13
store double 1.000000e-01, double* %4
br label %23
17: ; preds = %13
%18 = load double, double* %2
%19 = fcmp olt double %18, 2.000010e+03
br i1 %19, label %20, label %21
20: ; preds = %17
store double 7.000000e-02, double* %4
br label %22
21: ; preds = %17
store double 4.000000e-02, double* %4
br label %22
22: ; preds = %21, %20
br label %23
23: ; preds = %22, %16
br label %24
24: ; preds = %23, %12
br label %25
25: ; preds = %24, %8
%26 = load double, double* %2
%27 = load double, double* %2
%28 = load double, double* %4
%29 = call double @llvm.fmuladd.f64(double %27, double %28, double %26)
store double %29, double* %3
%30 = load double, double* %3
%31 = load double, double* %3
%32 = load double, double* %2
%33 = fsub double %31, %32
%34 = load double, double* %4
%35 = fmul double %34, 1.000000e+02
%36 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0), double %30, double %33, double %35)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [67 x i8] c"Novo salario: %.2lf\0AReajuste ganho: %.2lf\0AEm percentual: %.0lf %%\0A\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 olt double %4, 4.000100e+02
br i1 %5, label %13, label %6
6: ; preds = %0
%7 = fcmp olt double %4, 0x408900147AE147AE
br i1 %7, label %13, label %8
8: ; preds = %6
%9 = fcmp olt double %4, 1.200010e+03
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = fcmp olt double %4, 2.000010e+03
%12 = select i1 %11, double 7.000000e-02, double 4.000000e-02
br label %13
13: ; preds = %10, %8, %6, %0
%14 = phi double [ 1.500000e-01, %0 ], [ 1.200000e-01, %6 ], [ 1.000000e-01, %8 ], [ %12, %10 ]
%15 = call double @llvm.fmuladd.f64(double %4, double %14, double %4)
%16 = fsub double %15, %4
%17 = fmul double %14, 1.000000e+02
%18 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0), double %15, double %16, double %17)
ret i32 0
}