#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*/ LC_ALL;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, float *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
main() {
  setlocale(LC_ALL, "");
  float salario;
  printf("\n[ ----------- Calcula salário ----------- ]\n");
  printf("\nPor favor, digite o seu salário: ");
  scanf("%f", &salario);
  if (salario <= 0) {
    printf("\n Erro: por favor, digite um salário válido. \n");
  } else if (salario <= 1000) {
    printf("\n 30 porcento de aumento \n");
  } else if (salario <= 2000) {
    printf("\n 25 porcento de aumento \n");
  } else if (salario <= 3000) {
    printf("\n 20 porcento de aumento \n");
  } else if (salario <= 4000) {
    printf("\n 15 porcento de aumento \n");
  } else {
    printf("\n 10 de aumento \n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xf47(%rip),%rsi
call   1040 <setlocale@plt>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     119a <main+0x6a>
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
jmp    1246 <main+0x116>
movss  0xe5e(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     11bd <main+0x8d>
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
jmp    1241 <main+0x111>
movss  0xe3f(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     11e0 <main+0xb0>
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
jmp    123c <main+0x10c>
movss  0xe20(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1203 <main+0xd3>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
jmp    1237 <main+0x107>
movss  0xe01(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1226 <main+0xf6>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
jmp    1232 <main+0x102>
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
jmp    1237 <main+0x107>
jmp    123c <main+0x10c>
jmp    1241 <main+0x111>
jmp    1246 <main+0x116>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
lea    0xfbc(%rip),%rsi
call   1050 <setlocale@plt>
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
movss  0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jae    11d3 <main+0x93>
movss  0xe6b(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    11dc <main+0x9c>
movss  0xe62(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    11e5 <main+0xa5>
movss  0xe59(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    11ee <main+0xae>
movss  0xe50(%rip),%xmm1
ucomiss %xmm0,%xmm1
lea    0xe9f(%rip),%rax
lea    0xea9(%rip),%rdi
cmovb  %rax,%rdi
jmp    11f5 <main+0xb5>
lea    0xf04(%rip),%rdi
jmp    11f5 <main+0xb5>
lea    0xee1(%rip),%rdi
jmp    11f5 <main+0xb5>
lea    0xebe(%rip),%rdi
jmp    11f5 <main+0xb5>
lea    0xe9b(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [47 x i8] c"\0A[ ----------- Calcula sal\C3\A1rio ----------- ]\0A\00"
@.str.2 = [36 x i8] c"\0APor favor, digite o seu sal\C3\A1rio: \00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [49 x i8] c"\0A Erro: por favor, digite um sal\C3\A1rio v\C3\A1lido. \0A\00"
@.str.5 = [27 x i8] c"\0A 30 porcento de aumento \0A\00"
@.str.6 = [27 x i8] c"\0A 25 porcento de aumento \0A\00"
@.str.7 = [27 x i8] c"\0A 20 porcento de aumento \0A\00"
@.str.8 = [27 x i8] c"\0A 15 porcento de aumento \0A\00"
@.str.9 = [18 x i8] c"\0A 10 de aumento \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = load i32, i32* @LC_ALL
%4 = call i32 @setlocale(i32 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %2)
%8 = load float, float* %2
%9 = fcmp ole float %8, 0.000000e+00
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0))
br label %38
12: ; preds = %0
%13 = load float, float* %2
%14 = fcmp ole float %13, 1.000000e+03
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
br label %37
17: ; preds = %12
%18 = load float, float* %2
%19 = fcmp ole float %18, 2.000000e+03
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
br label %36
22: ; preds = %17
%23 = load float, float* %2
%24 = fcmp ole float %23, 3.000000e+03
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
br label %35
27: ; preds = %22
%28 = load float, float* %2
%29 = fcmp ole float %28, 4.000000e+03
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
br label %34
32: ; preds = %27
%33 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
br label %34
34: ; preds = %32, %30
br label %35
35: ; preds = %34, %25
br label %36
36: ; preds = %35, %20
br label %37
37: ; preds = %36, %15
br label %38
38: ; preds = %37, %10
%39 = load i32, i32* %1
ret i32 %39
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.2 = [36 x i8] c"\0APor favor, digite o seu sal\C3\A1rio: \00"
@.str.3 = [3 x i8] c"%f\00"
@str = [46 x i8] c"\0A[ ----------- Calcula sal\C3\A1rio ----------- ]\00"
@str.10 = [17 x i8] c"\0A 10 de aumento \00"
@str.11 = [26 x i8] c"\0A 15 porcento de aumento \00"
@str.12 = [26 x i8] c"\0A 20 porcento de aumento \00"
@str.13 = [26 x i8] c"\0A 25 porcento de aumento \00"
@str.14 = [26 x i8] c"\0A 30 porcento de aumento \00"
@str.15 = [48 x i8] c"\0A Erro: por favor, digite um sal\C3\A1rio v\C3\A1lido. \00"
define i32 @main() {
%1 = alloca float
%2 = load i32, i32* @LC_ALL
%3 = tail call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = bitcast float* %1 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %1)
%8 = load float, float* %1
%9 = fcmp ugt float %8, 0.000000e+00
br i1 %9, label %10, label %19
10: ; preds = %0
%11 = fcmp ugt float %8, 1.000000e+03
br i1 %11, label %12, label %19
12: ; preds = %10
%13 = fcmp ugt float %8, 2.000000e+03
br i1 %13, label %14, label %19
14: ; preds = %12
%15 = fcmp ugt float %8, 3.000000e+03
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = fcmp ugt float %8, 4.000000e+03
%18 = select i1 %17, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.10, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @str.11, i64 0, i64 0)
br label %19
19: ; preds = %16, %14, %12, %10, %0
%20 = phi i8* [ getelementptr inbounds ([48 x i8], [48 x i8]* @str.15, i64 0, i64 0), %0 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @str.14, i64 0, i64 0), %10 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @str.13, i64 0, i64 0), %12 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @str.12, i64 0, i64 0), %14 ], [ %18, %16 ]
%21 = call i32 @puts(i8* dereferenceable(1) %20)
ret i32 0
}