#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 *);
main() {
  float salario;
  printf("Informe salario: ");
  scanf("%f", &salario);
  if (salario <= 1000) {
    salario += salario * 0.3;
  } else if (salario <= 2000) {
    salario += salario * 0.25;
  } else if (salario <= 3000) {
    salario += salario * 0.2;
  } else if (salario <= 4000) {
    salario += salario * 0.15;
  } else if (salario > 4000) {
    salario += salario * 0.1;
  }
  printf("\n novo salario %.2f\n", salario);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf02(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf06(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xeab(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     118f <main+0x6f>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xeb7(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    12aa <main+0x18a>
movss  0xe6d(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     11d1 <main+0xb1>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe6d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    12a5 <main+0x185>
movss  0xe2f(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1213 <main+0xf3>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe23(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    12a0 <main+0x180>
movss  0xdf1(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1255 <main+0x135>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xdd9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    129b <main+0x17b>
movss  -0x8(%rbp),%xmm0
movss  0xdaa(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1296 <main+0x176>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xd8b(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    129b <main+0x17b>
jmp    12a0 <main+0x180>
jmp    12a5 <main+0x185>
jmp    12aa <main+0x18a>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd93(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf10(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf14(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
movss  0xeb2(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    1191 <main+0x71>
movss  0xea9(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    119f <main+0x7f>
movss  0xea0(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    11ad <main+0x8d>
movss  0xe97(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    11bb <main+0x9b>
ucomiss 0xe8b(%rip),%xmm0
jbe    11dc <main+0xbc>
cvtss2sd %xmm0,%xmm0
movsd  0xea1(%rip),%xmm1
jmp    11c7 <main+0xa7>
cvtss2sd %xmm0,%xmm0
movsd  0xe73(%rip),%xmm1
jmp    11c7 <main+0xa7>
cvtss2sd %xmm0,%xmm0
movsd  0xe6d(%rip),%xmm1
jmp    11c7 <main+0xa7>
cvtss2sd %xmm0,%xmm0
movsd  0xe67(%rip),%xmm1
jmp    11c7 <main+0xa7>
cvtss2sd %xmm0,%xmm0
movsd  0xe61(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,0x4(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xe66(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Informe salario: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [21 x i8] c"\0A novo salario %.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 ([18 x i8], [18 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.000000e+03
br i1 %6, label %7, label %14
7: ; preds = %0
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = load float, float* %2
%11 = fpext float %10 to double
%12 = call double @llvm.fmuladd.f64(double %9, double 3.000000e-01, double %11)
%13 = fptrunc double %12 to float
store float %13, float* %2
br label %58
14: ; preds = %0
%15 = load float, float* %2
%16 = fcmp ole float %15, 2.000000e+03
br i1 %16, label %17, label %24
17: ; preds = %14
%18 = load float, float* %2
%19 = fpext float %18 to double
%20 = load float, float* %2
%21 = fpext float %20 to double
%22 = call double @llvm.fmuladd.f64(double %19, double 2.500000e-01, double %21)
%23 = fptrunc double %22 to float
store float %23, float* %2
br label %57
24: ; preds = %14
%25 = load float, float* %2
%26 = fcmp ole float %25, 3.000000e+03
br i1 %26, label %27, label %34
27: ; preds = %24
%28 = load float, float* %2
%29 = fpext float %28 to double
%30 = load float, float* %2
%31 = fpext float %30 to double
%32 = call double @llvm.fmuladd.f64(double %29, double 2.000000e-01, double %31)
%33 = fptrunc double %32 to float
store float %33, float* %2
br label %56
34: ; preds = %24
%35 = load float, float* %2
%36 = fcmp ole float %35, 4.000000e+03
br i1 %36, label %37, label %44
37: ; preds = %34
%38 = load float, float* %2
%39 = fpext float %38 to double
%40 = load float, float* %2
%41 = fpext float %40 to double
%42 = call double @llvm.fmuladd.f64(double %39, double 1.500000e-01, double %41)
%43 = fptrunc double %42 to float
store float %43, float* %2
br label %55
44: ; preds = %34
%45 = load float, float* %2
%46 = fcmp ogt float %45, 4.000000e+03
br i1 %46, label %47, label %54
47: ; preds = %44
%48 = load float, float* %2
%49 = fpext float %48 to double
%50 = load float, float* %2
%51 = fpext float %50 to double
%52 = call double @llvm.fmuladd.f64(double %49, double 1.000000e-01, double %51)
%53 = fptrunc double %52 to float
store float %53, float* %2
br label %54
54: ; preds = %47, %44
br label %55
55: ; preds = %54, %37
br label %56
56: ; preds = %55, %27
br label %57
57: ; preds = %56, %17
br label %58
58: ; preds = %57, %7
%59 = load float, float* %2
%60 = fpext float %59 to double
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), double %60)
%62 = load i32, i32* %1
ret i32 %62
}

LLVM IR (-O2):
@.str = [18 x i8] c"Informe salario: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [21 x i8] c"\0A novo salario %.2f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 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.000000e+03
br i1 %6, label %11, label %7
7: ; preds = %0
%8 = fpext float %5 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 3.000000e-01, double %8)
%10 = fptrunc double %9 to float
store float %10, float* %1
br label %35
11: ; preds = %0
%12 = fcmp ugt float %5, 2.000000e+03
br i1 %12, label %17, label %13
13: ; preds = %11
%14 = fpext float %5 to double
%15 = call double @llvm.fmuladd.f64(double %14, double 2.500000e-01, double %14)
%16 = fptrunc double %15 to float
store float %16, float* %1
br label %35
17: ; preds = %11
%18 = fcmp ugt float %5, 3.000000e+03
br i1 %18, label %23, label %19
19: ; preds = %17
%20 = fpext float %5 to double
%21 = call double @llvm.fmuladd.f64(double %20, double 2.000000e-01, double %20)
%22 = fptrunc double %21 to float
store float %22, float* %1
br label %35
23: ; preds = %17
%24 = fcmp ugt float %5, 4.000000e+03
br i1 %24, label %29, label %25
25: ; preds = %23
%26 = fpext float %5 to double
%27 = call double @llvm.fmuladd.f64(double %26, double 1.500000e-01, double %26)
%28 = fptrunc double %27 to float
store float %28, float* %1
br label %35
29: ; preds = %23
%30 = fcmp ogt float %5, 4.000000e+03
br i1 %30, label %31, label %35
31: ; preds = %29
%32 = fpext float %5 to double
%33 = call double @llvm.fmuladd.f64(double %32, double 1.000000e-01, double %32)
%34 = fptrunc double %33 to float
store float %34, float* %1
br label %35
35: ; preds = %13, %25, %31, %29, %19, %7
%36 = phi float [ %16, %13 ], [ %28, %25 ], [ %34, %31 ], [ %5, %29 ], [ %22, %19 ], [ %10, %7 ]
%37 = fpext float %36 to double
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), double %37)
ret i32 0
}