#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(void) {
  float salario, aumt, antSalario, perc;
  printf("Insira seu salario: \n");
  scanf("%f", &salario);
  if (salario <= 280) {
    perc = 20;
  } else if (salario > 281 && salario < 700) {
    perc = 15;
  } else if (salario > 700 && salario < 1500) {
    perc = 10;
  } else if (salario > 1500) {
    perc = 5;
  }
  antSalario = salario;
  aumt = (salario * perc) / 100;
  salario += aumt;
  printf("Seu salario era %.2f\n", antSalario);
  printf("A porcentagem de aumento foi %.2f\n", perc);
  printf("O valor do aumento %.2f\n", aumt);
  printf("Seu novo salario é %.2f\n", salario);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xeab(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1171 <main+0x51>
movss  0xeb5(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1217 <main+0xf7>
movss  -0x8(%rbp),%xmm0
movss  0xe86(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11ab <main+0x8b>
movss  0xe79(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    11ab <main+0x8b>
movss  0xe77(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1212 <main+0xf2>
movss  -0x8(%rbp),%xmm0
movss  0xe50(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11e5 <main+0xc5>
movss  0xe43(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    11e5 <main+0xc5>
movss  0xe39(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    120d <main+0xed>
movss  -0x8(%rbp),%xmm0
movss  0xe1a(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1208 <main+0xe8>
movss  0xe0d(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    120d <main+0xed>
jmp    1212 <main+0xf2>
jmp    1217 <main+0xf7>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  0xded(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xde2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xde1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xded(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdef(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xf5c(%rip),%rdi
call   1030 <puts@plt>
lea    0xee1(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x8(%rsp),%xmm1
movss  0xea5(%rip),%xmm0
ucomiss %xmm1,%xmm0
jae    1184 <main+0x54>
ucomiss 0xe9d(%rip),%xmm1
jbe    118e <main+0x5e>
movss  0xe9b(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    118e <main+0x5e>
movss  0xe8a(%rip),%xmm3
jmp    11c8 <main+0x98>
movss  0xe74(%rip),%xmm3
jmp    11c8 <main+0x98>
movss  0xe7e(%rip),%xmm0
xor    %eax,%eax
ucomiss %xmm1,%xmm0
seta   %al
lea    0xe7b(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
movss  0xe5e(%rip),%xmm3
cmpltss %xmm1,%xmm3
andps  %xmm3,%xmm0
movss  0xe56(%rip),%xmm2
andnps %xmm2,%xmm3
orps   %xmm0,%xmm3
movaps %xmm3,0x10(%rsp)
movaps %xmm1,%xmm2
mulss  %xmm3,%xmm2
divss  0xe40(%rip),%xmm2
movss  %xmm2,0xc(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
addss  %xmm2,%xmm1
movss  %xmm1,0x8(%rsp)
lea    0xe31(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movaps 0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe30(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe3b(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe3c(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Insira seu salario: \0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [22 x i8] c"Seu salario era %.2f\0A\00"
@.str.3 = [35 x i8] c"A porcentagem de aumento foi %.2f\0A\00"
@.str.4 = [25 x i8] c"O valor do aumento %.2f\0A\00"
@.str.5 = [26 x i8] c"Seu novo salario \C3\A9 %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%8 = load float, float* %2
%9 = fcmp ole float %8, 2.800000e+02
br i1 %9, label %10, label %11
10: ; preds = %0
store float 2.000000e+01, float* %5
br label %32
11: ; preds = %0
%12 = load float, float* %2
%13 = fcmp ogt float %12, 2.810000e+02
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load float, float* %2
%16 = fcmp olt float %15, 7.000000e+02
br i1 %16, label %17, label %18
17: ; preds = %14
store float 1.500000e+01, float* %5
br label %31
18: ; preds = %14, %11
%19 = load float, float* %2
%20 = fcmp ogt float %19, 7.000000e+02
br i1 %20, label %21, label %25
21: ; preds = %18
%22 = load float, float* %2
%23 = fcmp olt float %22, 1.500000e+03
br i1 %23, label %24, label %25
24: ; preds = %21
store float 1.000000e+01, float* %5
br label %30
25: ; preds = %21, %18
%26 = load float, float* %2
%27 = fcmp ogt float %26, 1.500000e+03
br i1 %27, label %28, label %29
28: ; preds = %25
store float 5.000000e+00, float* %5
br label %29
29: ; preds = %28, %25
br label %30
30: ; preds = %29, %24
br label %31
31: ; preds = %30, %17
br label %32
32: ; preds = %31, %10
%33 = load float, float* %2
store float %33, float* %4
%34 = load float, float* %2
%35 = load float, float* %5
%36 = fmul float %34, %35
%37 = fdiv float %36, 1.000000e+02
store float %37, float* %3
%38 = load float, float* %3
%39 = load float, float* %2
%40 = fadd float %39, %38
store float %40, float* %2
%41 = load float, float* %4
%42 = fpext float %41 to double
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), double %42)
%44 = load float, float* %5
%45 = fpext float %44 to double
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), double %45)
%47 = load float, float* %3
%48 = fpext float %47 to double
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), double %48)
%50 = load float, float* %2
%51 = fpext float %50 to double
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), double %51)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [22 x i8] c"Seu salario era %.2f\0A\00"
@.str.3 = [35 x i8] c"A porcentagem de aumento foi %.2f\0A\00"
@.str.4 = [25 x i8] c"O valor do aumento %.2f\0A\00"
@.str.5 = [26 x i8] c"Seu novo salario \C3\A9 %.2f\0A\00"
@str = [21 x i8] c"Insira seu salario: \00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 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, 2.800000e+02
br i1 %6, label %7, label %16
7: ; preds = %0
%8 = fcmp ogt float %5, 2.810000e+02
%9 = fcmp olt float %5, 7.000000e+02
%10 = and i1 %8, %9
br i1 %10, label %16, label %11
11: ; preds = %7
%12 = fcmp ogt float %5, 7.000000e+02
%13 = fcmp olt float %5, 1.500000e+03
%14 = and i1 %12, %13
%15 = select i1 %14, float 1.000000e+01, float 5.000000e+00
br label %16
16: ; preds = %11, %7, %0
%17 = phi float [ 2.000000e+01, %0 ], [ 1.500000e+01, %7 ], [ %15, %11 ]
%18 = fmul float %5, %17
%19 = fdiv float %18, 1.000000e+02
%20 = fadd float %5, %19
store float %20, float* %1
%21 = fpext float %5 to double
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), double %21)
%23 = fpext float %17 to double
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), double %23)
%25 = fpext float %19 to double
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), double %25)
%27 = load float, float* %1
%28 = fpext float %27 to double
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), double %28)
ret i32 0
}