#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 /*<<< orphan*/ system(char *);
main() {
  int numero_empregado;
  float horas_trabalhadas, valor_hora_extras, valor_hora, horas_extras,
      adicional = 0.5, limite_hora = 40, valor_regular_liquido, salario_liquido;
  printf("Qual o numero do empregado? ");
  scanf("%d", &numero_empregado);
  printf("Qual o numero de horas trabalhadas? ");
  scanf("%f", &horas_trabalhadas);
  printf("Qual o salario/hora (R$)? ");
  scanf("%f", &valor_hora);
  horas_extras = horas_trabalhadas - limite_hora;
  if (horas_extras >= 1) {
    valor_hora_extras = (valor_hora + (valor_hora * adicional)) * horas_extras;
  }
  valor_regular_liquido = (limite_hora * valor_hora);
  salario_liquido = valor_regular_liquido + valor_hora_extras;
  printf("---\n");
  printf("Total de horas trabalhadas: %g\n", horas_trabalhadas);
  printf("---\n");
  printf("Total de horas regulares: %g (R$ %g)\n", limite_hora,
         valor_regular_liquido);
  printf("Total de horas extras: %g (R$ %g)\n", horas_extras,
         valor_hora_extras);
  printf("---\n");
  printf("Salario liquido mensal: R$ %g\n", salario_liquido);
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xec1(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xeb0(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea3(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movss  -0xc(%rbp),%xmm0
subss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  0xe2b(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     11ff <main+0xcf>
movss  -0x14(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x20(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe39(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x24(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe2b(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe31(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe2f(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe40(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xedb(%rip),%rdi
lea    0x1c(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xee2(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xecf(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
movss  0x4(%rsp),%xmm0
addss  0xe4b(%rip),%xmm0
movss  %xmm0,0x10(%rsp)
movss  0x18(%rsp),%xmm2
movss  0xe3b(%rip),%xmm1
mulss  %xmm2,%xmm1
addss  %xmm2,%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
mulss  0xe25(%rip),%xmm2
movss  %xmm2,0x8(%rsp)
movaps %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,0x14(%rsp)
lea    0xf0c(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe65(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
movss  0x8(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
lea    0xe62(%rip),%rdi
movsd  0xdcf(%rip),%xmm0
mov    $0x2,%al
call   1050 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0xc(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe5e(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe61(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xe72(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Qual o numero do empregado? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [37 x i8] c"Qual o numero de horas trabalhadas? \00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [27 x i8] c"Qual o salario/hora (R$)? \00"
@.str.5 = [5 x i8] c"---\0A\00"
@.str.6 = [32 x i8] c"Total de horas trabalhadas: %g\0A\00"
@.str.7 = [38 x i8] c"Total de horas regulares: %g (R$ %g)\0A\00"
@.str.8 = [35 x i8] c"Total de horas extras: %g (R$ %g)\0A\00"
@.str.9 = [31 x i8] c"Salario liquido mensal: R$ %g\0A\00"
@.str.10 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store i32 0, i32* %1
store float 5.000000e-01, float* %7
store float 4.000000e+01, float* %8
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %3)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %5)
%17 = load float, float* %3
%18 = load float, float* %8
%19 = fsub float %17, %18
store float %19, float* %6
%20 = load float, float* %6
%21 = fcmp oge float %20, 1.000000e+00
br i1 %21, label %22, label %29
22: ; preds = %0
%23 = load float, float* %5
%24 = load float, float* %5
%25 = load float, float* %7
%26 = call float @llvm.fmuladd.f32(float %24, float %25, float %23)
%27 = load float, float* %6
%28 = fmul float %26, %27
store float %28, float* %4
br label %29
29: ; preds = %22, %0
%30 = load float, float* %8
%31 = load float, float* %5
%32 = fmul float %30, %31
store float %32, float* %9
%33 = load float, float* %9
%34 = load float, float* %4
%35 = fadd float %33, %34
store float %35, float* %10
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%37 = load float, float* %3
%38 = fpext float %37 to double
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), double %38)
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%41 = load float, float* %8
%42 = fpext float %41 to double
%43 = load float, float* %9
%44 = fpext float %43 to double
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0), double %42, double %44)
%46 = load float, float* %6
%47 = fpext float %46 to double
%48 = load float, float* %4
%49 = fpext float %48 to double
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), double %47, double %49)
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%52 = load float, float* %10
%53 = fpext float %52 to double
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0), double %53)
%55 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%56 = load i32, i32* %1
ret i32 %56
}

LLVM IR (-O2):
@.str = [29 x i8] c"Qual o numero do empregado? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [37 x i8] c"Qual o numero de horas trabalhadas? \00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [27 x i8] c"Qual o salario/hora (R$)? \00"
@.str.6 = [32 x i8] c"Total de horas trabalhadas: %g\0A\00"
@.str.7 = [38 x i8] c"Total de horas regulares: %g (R$ %g)\0A\00"
@.str.8 = [35 x i8] c"Total de horas extras: %g (R$ %g)\0A\00"
@.str.9 = [31 x i8] c"Salario liquido mensal: R$ %g\0A\00"
@.str.10 = [6 x i8] c"pause\00"
@str.12 = [4 x i8] c"---\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = bitcast i32* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 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), i32* %1)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 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), float* %2)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %3)
%13 = load float, float* %2
%14 = fadd float %13, -4.000000e+01
%15 = fcmp ult float %14, 1.000000e+00
%16 = load float, float* %3
%17 = call float @llvm.fmuladd.f32(float %16, float 5.000000e-01, float %16)
%18 = fmul float %14, %17
%19 = select i1 %15, float undef, float %18
%20 = fmul float %16, 4.000000e+01
%21 = fadd float %20, %19
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.12, i64 0, i64 0))
%23 = load float, float* %2
%24 = fpext float %23 to double
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), double %24)
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.12, i64 0, i64 0))
%27 = fpext float %20 to double
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0), double 4.000000e+01, double %27)
%29 = fpext float %14 to double
%30 = fpext float %19 to double
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), double %29, double %30)
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.12, i64 0, i64 0))
%33 = fpext float %21 to double
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0), double %33)
%35 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
ret i32 0
}