#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 *, double *);
int main(int argc, char *argv[]) {
  double numero_horas_trabalhadas;
  double salarioMinimo;
  double numero_horas_extras;
  double valor_hora, valor_hora_extra, salarioBruto, salarioTotal;
  printf("Olá, vamos calcular o seu salário!");
  printf("\nDigite as horas trabalhadas: ");
  scanf("%lf", &numero_horas_trabalhadas);
  printf("\nDigite o valor do salario minimo: ");
  scanf("%lf", &salarioMinimo);
  printf("\nDigite o numero de horas extras trabalhadas: ");
  scanf("%lf", &numero_horas_extras);
  valor_hora = salarioMinimo / 8;
  valor_hora_extra = salarioMinimo / 4;
  salarioBruto = (numero_horas_trabalhadas * valor_hora);
  valor_hora_extra = (numero_horas_trabalhadas * valor_hora_extra);
  salarioTotal = salarioBruto + valor_hora_extra;
  printf("O valor do salario minimo e : %f", salarioTotal);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf02(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xef6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xefc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x20(%rbp),%xmm0
movsd  0xe64(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe46(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x40(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
lea    0xeaf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xee4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xefb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf0c(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xefc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xf05(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
unpcklpd %xmm0,%xmm0
mulpd  0xe63(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
unpcklpd %xmm1,%xmm1
mulpd  %xmm0,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
lea    0xeed(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Ol\C3\A1, vamos calcular o seu sal\C3\A1rio!\00"
@.str.1 = [31 x i8] c"\0ADigite as horas trabalhadas: \00"
@.str.2 = [4 x i8] c"%lf\00"
@.str.3 = [36 x i8] c"\0ADigite o valor do salario minimo: \00"
@.str.4 = [47 x i8] c"\0ADigite o numero de horas extras trabalhadas: \00"
@.str.5 = [33 x i8] c"O valor do salario minimo e : %f\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store i32 %0, i32* %3
store i8** %1, i8*** %4
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %5)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %6)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %7)
%19 = load double, double* %6
%20 = fdiv double %19, 8.000000e+00
store double %20, double* %8
%21 = load double, double* %6
%22 = fdiv double %21, 4.000000e+00
store double %22, double* %9
%23 = load double, double* %5
%24 = load double, double* %8
%25 = fmul double %23, %24
store double %25, double* %10
%26 = load double, double* %5
%27 = load double, double* %9
%28 = fmul double %26, %27
store double %28, double* %9
%29 = load double, double* %10
%30 = load double, double* %9
%31 = fadd double %29, %30
store double %31, double* %11
%32 = load double, double* %11
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), double %32)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"Ol\C3\A1, vamos calcular o seu sal\C3\A1rio!\00"
@.str.1 = [31 x i8] c"\0ADigite as horas trabalhadas: \00"
@.str.2 = [4 x i8] c"%lf\00"
@.str.3 = [36 x i8] c"\0ADigite o valor do salario minimo: \00"
@.str.4 = [47 x i8] c"\0ADigite o numero de horas extras trabalhadas: \00"
@.str.5 = [33 x i8] c"O valor do salario minimo e : %f\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = bitcast double* %3 to i8*
%7 = bitcast double* %4 to i8*
%8 = bitcast double* %5 to i8*
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %3)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %4)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %5)
%16 = load double, double* %4
%17 = insertelement <2 x double> poison, double %16, i64 0
%18 = shufflevector <2 x double> %17, <2 x double> poison, <2 x i32> zeroinitializer
%19 = fmul <2 x double> %18, <double 1.250000e-01, double 2.500000e-01>
%20 = load double, double* %3
%21 = insertelement <2 x double> poison, double %20, i64 0
%22 = shufflevector <2 x double> %21, <2 x double> poison, <2 x i32> zeroinitializer
%23 = fmul <2 x double> %22, %19
%24 = shufflevector <2 x double> %23, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%25 = fadd <2 x double> %23, %24
%26 = extractelement <2 x double> %25, i64 0
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), double %26)
ret i32 0
}