#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 */
double obterPercentualDeReajuste(double);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main(void) {
  double salario, percentualDeReajuste, reajuste;
  scanf("%lf", &salario);
  percentualDeReajuste = obterPercentualDeReajuste(salario);
  reajuste = salario * percentualDeReajuste;
  printf("Novo salario: %.2f\n", salario + reajuste);
  printf("Reajuste ganho: %.2f\n", reajuste);
  printf("Em percentual: %.0f %%\n", percentualDeReajuste * 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
call   1030 <obterPercentualDeReajuste@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
movsd  0xe64(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xecd(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
call   1030 <obterPercentualDeReajuste@plt>
movapd %xmm0,%xmm1
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
addsd  %xmm1,%xmm0
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
lea    0xea3(%rip),%rdi
movsd  0x8(%rsp),%xmm0
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0xe6a(%rip),%xmm0
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [20 x i8] c"Novo salario: %.2f\0A\00"
@.str.2 = [22 x i8] c"Reajuste ganho: %.2f\0A\00"
@.str.3 = [24 x i8] c"Em percentual: %.0f %%\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @obterPercentualDeReajuste(double %6)
store double %7, double* %3
%8 = load double, double* %2
%9 = load double, double* %3
%10 = fmul double %8, %9
store double %10, double* %4
%11 = load double, double* %2
%12 = load double, double* %4
%13 = fadd double %11, %12
%14 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double %13)
%15 = load double, double* %4
%16 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), double %15)
%17 = load double, double* %3
%18 = fmul double %17, 1.000000e+02
%19 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), double %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [20 x i8] c"Novo salario: %.2f\0A\00"
@.str.2 = [22 x i8] c"Reajuste ganho: %.2f\0A\00"
@.str.3 = [24 x i8] c"Em percentual: %.0f %%\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = call double @obterPercentualDeReajuste(double %4)
%6 = load double, double* %1
%7 = fmul double %5, %6
%8 = fadd double %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), double %7)
%11 = fmul double %5, 1.000000e+02
%12 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), double %11)
ret i32 0
}