#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() {
  float valor_hora, salario_bruto, salario_liq, imposto;
  int numero_horas;
  printf("Qual o valor de sua hora de trabalho?\n");
  scanf("%f", &valor_hora);
  printf("Quantas hrs voce ja trabalhou?\n");
  scanf("%d", &numero_horas);
  salario_bruto = valor_hora * numero_horas;
  if (salario_bruto > 0 && salario_bruto < 2000) {
    imposto = salario_bruto * 10 / 100;
    salario_liq = salario_bruto + imposto;
    printf("\nSeu salario bruto e %.2f,\nvc pagara 10%% de desconto que dara "
           "%.2f\ne dara liquido neste mes e %.2f\n",
           salario_bruto, imposto, salario_liq);
  } else {
    imposto = salario_bruto * 15 / 100;
    salario_liq = salario_bruto + imposto;
    printf("\nSeu salario bruto e %.2f,\nvc pagara 15%% de desconto que dara "
           "%.2f\ne dara liquido neste mes e %.2f\n",
           salario_bruto, imposto, salario_liq);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0x18(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1200 <main+0xe0>
movss  0xe65(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1200 <main+0xe0>
movss  0xe5f(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  0xe4a(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe69(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
jmp    1256 <main+0x136>
movss  0xe00(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  0xdef(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe73(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xfa8(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xfaf(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb0(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cvtsi2ssl (%rsp),%xmm2
mulss  0x4(%rsp),%xmm2
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm2
seta   %al
movss  0xe77(%rip),%xmm0
ucomiss %xmm2,%xmm0
seta   %cl
test   %cl,%al
jne    119d <main+0x6d>
movss  0xe6d(%rip),%xmm1
jmp    11a5 <main+0x75>
movss  0xe5f(%rip),%xmm1
lea    0xe6a(%rip),%rax
lea    0xec8(%rip),%rdi
cmovne %rax,%rdi
mulss  %xmm2,%xmm1
divss  0xe49(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
addss  %xmm1,%xmm2
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Qual o valor de sua hora de trabalho?\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [32 x i8] c"Quantas hrs voce ja trabalhou?\0A\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [101 x i8] c"\0ASeu salario bruto e %.2f,\0Avc pagara 10%% de desconto que dara %.2f\0Ae dara liquido neste mes e %.2f\0A\00"
@.str.5 = [101 x i8] c"\0ASeu salario bruto e %.2f,\0Avc pagara 15%% de desconto que dara %.2f\0Ae dara liquido neste mes e %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %6)
%11 = load float, float* %2
%12 = load i32, i32* %6
%13 = sitofp i32 %12 to float
%14 = fmul float %11, %13
store float %14, float* %3
%15 = load float, float* %3
%16 = fcmp ogt float %15, 0.000000e+00
br i1 %16, label %17, label %34
17: ; preds = %0
%18 = load float, float* %3
%19 = fcmp olt float %18, 2.000000e+03
br i1 %19, label %20, label %34
20: ; preds = %17
%21 = load float, float* %3
%22 = fmul float %21, 1.000000e+01
%23 = fdiv float %22, 1.000000e+02
store float %23, float* %5
%24 = load float, float* %3
%25 = load float, float* %5
%26 = fadd float %24, %25
store float %26, float* %4
%27 = load float, float* %3
%28 = fpext float %27 to double
%29 = load float, float* %5
%30 = fpext float %29 to double
%31 = load float, float* %4
%32 = fpext float %31 to double
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str.4, i64 0, i64 0), double %28, double %30, double %32)
br label %48
34: ; preds = %17, %0
%35 = load float, float* %3
%36 = fmul float %35, 1.500000e+01
%37 = fdiv float %36, 1.000000e+02
store float %37, float* %5
%38 = load float, float* %3
%39 = load float, float* %5
%40 = fadd float %38, %39
store float %40, float* %4
%41 = load float, float* %3
%42 = fpext float %41 to double
%43 = load float, float* %5
%44 = fpext float %43 to double
%45 = load float, float* %4
%46 = fpext float %45 to double
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str.5, i64 0, i64 0), double %42, double %44, double %46)
br label %48
48: ; preds = %34, %20
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [101 x i8] c"\0ASeu salario bruto e %.2f,\0Avc pagara 10%% de desconto que dara %.2f\0Ae dara liquido neste mes e %.2f\0A\00"
@.str.5 = [101 x i8] c"\0ASeu salario bruto e %.2f,\0Avc pagara 15%% de desconto que dara %.2f\0Ae dara liquido neste mes e %.2f\0A\00"
@str = [38 x i8] c"Qual o valor de sua hora de trabalho?\00"
@str.6 = [31 x i8] c"Quantas hrs voce ja trabalhou?\00"
define i32 @main() {
%1 = alloca float
%2 = alloca i32
%3 = bitcast float* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 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* %1)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.6, 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* %1
%10 = load i32, i32* %2
%11 = sitofp i32 %10 to float
%12 = fmul float %9, %11
%13 = fcmp ogt float %12, 0.000000e+00
%14 = fcmp olt float %12, 2.000000e+03
%15 = and i1 %13, %14
%16 = select i1 %15, float 1.000000e+01, float 1.500000e+01
%17 = select i1 %15, i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str.5, i64 0, i64 0)
%18 = fmul float %12, %16
%19 = fdiv float %18, 1.000000e+02
%20 = fadd float %12, %19
%21 = fpext float %12 to double
%22 = fpext float %19 to double
%23 = fpext float %20 to double
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %17, double %21, double %22, double %23)
ret i32 0
}