#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 *, ...);
int main() {
  int tempoServico;
  float salarioAtual, salarioFinal;
  printf("Digite o Salário do Funcionário: ");
  scanf("%f", &salarioAtual);
  printf("Favor entrar com o Tempo de Servico do Funcionario: ");
  scanf("%d", &tempoServico);
  if (salarioAtual <= 500) {
    salarioFinal = salarioAtual * 1.25;
  } else {
    if (salarioAtual > 500 && salarioAtual <= 1000) {
      salarioFinal = salarioAtual * 1.2;
    } else {
      if (salarioAtual > 1000 && salarioAtual <= 1500) {
        salarioFinal = salarioAtual * 1.15;
      } else {
        if (salarioAtual > 1500 && salarioAtual <= 2000) {
          salarioFinal = salarioAtual * 1.1;
        } else {
          salarioFinal = salarioAtual;
        }
      }
    }
  }
  switch (tempoServico) {
  case 0:
  case 1:
    salarioFinal += 0;
    break;
  case 2:
  case 3:
    salarioFinal += 100.0;
    break;
  case 4:
  case 5:
  case 6:
    salarioFinal += 200.0;
    break;
  case 7:
  case 8:
  case 9:
  case 10:
    salarioFinal += 300.0;
    break;
  default:
    salarioFinal += 500.0;
    break;
  }
  printf("O Salário Final: R$ %.2f", salarioFinal);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf5c(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xf4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf74(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  0xe89(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     11a4 <main+0x84>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe96(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    129e <main+0x17e>
movss  -0xc(%rbp),%xmm0
movss  0xe4f(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11ef <main+0xcf>
movss  0xe42(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     11ef <main+0xcf>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe43(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1299 <main+0x179>
movss  -0xc(%rbp),%xmm0
movss  0xe08(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    123a <main+0x11a>
movss  0xdfb(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     123a <main+0x11a>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdf0(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1294 <main+0x174>
movss  -0xc(%rbp),%xmm0
movss  0xdc1(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1285 <main+0x165>
movss  0xdb4(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     1285 <main+0x165>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd9d(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    128f <main+0x16f>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1294 <main+0x174>
jmp    1299 <main+0x179>
jmp    129e <main+0x17e>
mov    -0x8(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0xa,%rax
ja     133e <main+0x21e>
mov    -0x18(%rbp),%rax
lea    0xd96(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xorps  %xmm0,%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    135c <main+0x23c>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd5a(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    135c <main+0x23c>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd2f(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    135c <main+0x23c>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd04(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    135c <main+0x23c>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcf9(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd6f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf08(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf1e(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xf10(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf37(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movss  (%rsp),%xmm1
movss  0xe92(%rip),%xmm0
ucomiss %xmm1,%xmm0
jae    1197 <main+0x77>
ucomiss 0xe86(%rip),%xmm1
jbe    11a1 <main+0x81>
movss  0xe84(%rip),%xmm2
ucomiss %xmm1,%xmm2
jb     11a1 <main+0x81>
cvtss2sd %xmm1,%xmm1
mulsd  0xe93(%rip),%xmm1
jmp    11e7 <main+0xc7>
mulss  0xe65(%rip),%xmm1
jmp    11eb <main+0xcb>
ucomiss 0xe60(%rip),%xmm1
jbe    11c5 <main+0xa5>
movss  0xe5a(%rip),%xmm2
ucomiss %xmm1,%xmm2
jb     11c5 <main+0xa5>
cvtss2sd %xmm1,%xmm1
mulsd  0xe5d(%rip),%xmm1
jmp    11e7 <main+0xc7>
ucomiss 0xe40(%rip),%xmm1
jbe    11eb <main+0xcb>
movss  0xe3a(%rip),%xmm2
ucomiss %xmm1,%xmm2
jb     11eb <main+0xcb>
cvtss2sd %xmm1,%xmm1
mulsd  0xe31(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
movslq 0x4(%rsp),%rax
cmp    $0xa,%rax
ja     1202 <main+0xe2>
lea    0xeaf(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
addss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xe7b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Digite o Sal\C3\A1rio do Funcion\C3\A1rio: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [53 x i8] c"Favor entrar com o Tempo de Servico do Funcionario: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [26 x i8] c"O Sal\C3\A1rio Final: R$ %.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%9 = load float, float* %3
%10 = fcmp ole float %9, 5.000000e+02
br i1 %10, label %11, label %16
11: ; preds = %0
%12 = load float, float* %3
%13 = fpext float %12 to double
%14 = fmul double %13, 1.250000e+00
%15 = fptrunc double %14 to float
store float %15, float* %4
br label %54
16: ; preds = %0
%17 = load float, float* %3
%18 = fcmp ogt float %17, 5.000000e+02
br i1 %18, label %19, label %27
19: ; preds = %16
%20 = load float, float* %3
%21 = fcmp ole float %20, 1.000000e+03
br i1 %21, label %22, label %27
22: ; preds = %19
%23 = load float, float* %3
%24 = fpext float %23 to double
%25 = fmul double %24, 1.200000e+00
%26 = fptrunc double %25 to float
store float %26, float* %4
br label %53
27: ; preds = %19, %16
%28 = load float, float* %3
%29 = fcmp ogt float %28, 1.000000e+03
br i1 %29, label %30, label %38
30: ; preds = %27
%31 = load float, float* %3
%32 = fcmp ole float %31, 1.500000e+03
br i1 %32, label %33, label %38
33: ; preds = %30
%34 = load float, float* %3
%35 = fpext float %34 to double
%36 = fmul double %35, 1.150000e+00
%37 = fptrunc double %36 to float
store float %37, float* %4
br label %52
38: ; preds = %30, %27
%39 = load float, float* %3
%40 = fcmp ogt float %39, 1.500000e+03
br i1 %40, label %41, label %49
41: ; preds = %38
%42 = load float, float* %3
%43 = fcmp ole float %42, 2.000000e+03
br i1 %43, label %44, label %49
44: ; preds = %41
%45 = load float, float* %3
%46 = fpext float %45 to double
%47 = fmul double %46, 1.100000e+00
%48 = fptrunc double %47 to float
store float %48, float* %4
br label %51
49: ; preds = %41, %38
%50 = load float, float* %3
store float %50, float* %4
br label %51
51: ; preds = %49, %44
br label %52
52: ; preds = %51, %33
br label %53
53: ; preds = %52, %22
br label %54
54: ; preds = %53, %11
%55 = load i32, i32* %2
switch i32 %55, label %74 [
i32 0, label %56
i32 1, label %56
i32 2, label %59
i32 3, label %59
i32 4, label %64
i32 5, label %64
i32 6, label %64
i32 7, label %69
i32 8, label %69
i32 9, label %69
i32 10, label %69
]
56: ; preds = %54, %54
%57 = load float, float* %4
%58 = fadd float %57, 0.000000e+00
store float %58, float* %4
br label %79
59: ; preds = %54, %54
%60 = load float, float* %4
%61 = fpext float %60 to double
%62 = fadd double %61, 1.000000e+02
%63 = fptrunc double %62 to float
store float %63, float* %4
br label %79
64: ; preds = %54, %54, %54
%65 = load float, float* %4
%66 = fpext float %65 to double
%67 = fadd double %66, 2.000000e+02
%68 = fptrunc double %67 to float
store float %68, float* %4
br label %79
69: ; preds = %54, %54, %54, %54
%70 = load float, float* %4
%71 = fpext float %70 to double
%72 = fadd double %71, 3.000000e+02
%73 = fptrunc double %72 to float
store float %73, float* %4
br label %79
74: ; preds = %54
%75 = load float, float* %4
%76 = fpext float %75 to double
%77 = fadd double %76, 5.000000e+02
%78 = fptrunc double %77 to float
store float %78, float* %4
br label %79
79: ; preds = %74, %69, %64, %59, %56
%80 = load float, float* %4
%81 = fpext float %80 to double
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), double %81)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"Digite o Sal\C3\A1rio do Funcion\C3\A1rio: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [53 x i8] c"Favor entrar com o Tempo de Servico do Funcionario: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [26 x i8] c"O Sal\C3\A1rio Final: R$ %.2f\00"
@switch.table.main = [11 x float] [float 0.000000e+00, float 0.000000e+00, float 1.000000e+02, float 1.000000e+02, float 2.000000e+02, float 2.000000e+02, float 2.000000e+02, float 3.000000e+02, float 3.000000e+02, float 3.000000e+02, float 3.000000e+02]
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = bitcast i32* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%9 = load float, float* %2
%10 = fcmp ugt float %9, 5.000000e+02
br i1 %10, label %13, label %11
11: ; preds = %0
%12 = fmul float %9, 1.250000e+00
br label %37
13: ; preds = %0
%14 = fcmp ogt float %9, 5.000000e+02
%15 = fcmp ole float %9, 1.000000e+03
%16 = and i1 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = fpext float %9 to double
%19 = fmul double %18, 1.200000e+00
%20 = fptrunc double %19 to float
br label %37
21: ; preds = %13
%22 = fcmp ogt float %9, 1.000000e+03
%23 = fcmp ole float %9, 1.500000e+03
%24 = and i1 %22, %23
br i1 %24, label %25, label %29
25: ; preds = %21
%26 = fpext float %9 to double
%27 = fmul double %26, 1.150000e+00
%28 = fptrunc double %27 to float
br label %37
29: ; preds = %21
%30 = fcmp ogt float %9, 1.500000e+03
%31 = fcmp ole float %9, 2.000000e+03
%32 = and i1 %30, %31
br i1 %32, label %33, label %37
33: ; preds = %29
%34 = fpext float %9 to double
%35 = fmul double %34, 1.100000e+00
%36 = fptrunc double %35 to float
br label %37
37: ; preds = %29, %17, %33, %25, %11
%38 = phi float [ %12, %11 ], [ %20, %17 ], [ %28, %25 ], [ %36, %33 ], [ %9, %29 ]
%39 = load i32, i32* %1
%40 = icmp ult i32 %39, 11
br i1 %40, label %41, label %45
41: ; preds = %37
%42 = sext i32 %39 to i64
%43 = getelementptr inbounds [11 x float], [11 x float]* @switch.table.main, i64 0, i64 %42
%44 = load float, float* %43
br label %45
45: ; preds = %37, %41
%46 = phi float [ %44, %41 ], [ 5.000000e+02, %37 ]
%47 = fadd float %38, %46
%48 = fpext float %47 to double
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), double %48)
ret i32 0
}