#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 *, float);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float valorDiariaNormal;
  int diasFds = 8;
  scanf("%f", &valorDiariaNormal);
  float valorDiariaPromocao = valorDiariaNormal * 0.22f;
  float ocupacaoSemPromocao = 0.4f * 42;
  float valorMedioSemPromocao =
      diasFds * ocupacaoSemPromocao * valorDiariaNormal;
  float ocupacaoComPromocao = 0.7f * 42;
  float valorMedioComPromocao =
      diasFds * ocupacaoComPromocao * valorDiariaPromocao;
  float diferenca = valorMedioComPromocao - valorMedioSemPromocao;
  printf("O VALOR DA DIARIA NO PERIODO DA PROMOCAO = %.2f\n",
         valorDiariaPromocao);
  printf("O VALOR MEDIO ARRECADADO SEM A PROMOCAO = %.2f\n",
         valorMedioSemPromocao);
  printf("O VALOR MEDIO ARRECADADO COM A PROMOCAO = %.2f\n",
         valorMedioComPromocao);
  printf("LUCRO OU PREJUIZO = %.2f\n", diferenca);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x8,-0x8(%rbp)
lea    0xed6(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xec1(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xeab(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe86(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
movss  -0x20(%rbp),%xmm0
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee1(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x14(%rsp),%xmm2
movss  0xebd(%rip),%xmm0
mulss  %xmm2,%xmm0
mulss  0xeb5(%rip),%xmm2
movss  %xmm2,0x8(%rsp)
movss  0xeab(%rip),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
subss  %xmm2,%xmm1
movss  %xmm1,0x10(%rsp)
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
movss  0x8(%rsp),%xmm0
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
movss  0xc(%rsp),%xmm0
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
movss  0x10(%rsp),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [49 x i8] c"O VALOR DA DIARIA NO PERIODO DA PROMOCAO = %.2f\0A\00"
@.str.2 = [48 x i8] c"O VALOR MEDIO ARRECADADO SEM A PROMOCAO = %.2f\0A\00"
@.str.3 = [48 x i8] c"O VALOR MEDIO ARRECADADO COM A PROMOCAO = %.2f\0A\00"
@.str.4 = [26 x i8] c"LUCRO OU PREJUIZO = %.2f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store i32 8, i32* %2
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%10 = load float, float* %1
%11 = fmul float %10, 0x3FCC28F5C0000000
store float %11, float* %3
store float 0x4030CCCCE0000000, float* %4
%12 = load i32, i32* %2
%13 = sitofp i32 %12 to float
%14 = load float, float* %4
%15 = fmul float %13, %14
%16 = load float, float* %1
%17 = fmul float %15, %16
store float %17, float* %5
store float 0x403D666660000000, float* %6
%18 = load i32, i32* %2
%19 = sitofp i32 %18 to float
%20 = load float, float* %6
%21 = fmul float %19, %20
%22 = load float, float* %3
%23 = fmul float %21, %22
store float %23, float* %7
%24 = load float, float* %7
%25 = load float, float* %5
%26 = fsub float %24, %25
store float %26, float* %8
%27 = load float, float* %3
%28 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), float %27)
%29 = load float, float* %5
%30 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), float %29)
%31 = load float, float* %7
%32 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), float %31)
%33 = load float, float* %8
%34 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), float %33)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [49 x i8] c"O VALOR DA DIARIA NO PERIODO DA PROMOCAO = %.2f\0A\00"
@.str.2 = [48 x i8] c"O VALOR MEDIO ARRECADADO SEM A PROMOCAO = %.2f\0A\00"
@.str.3 = [48 x i8] c"O VALOR MEDIO ARRECADADO COM A PROMOCAO = %.2f\0A\00"
@.str.4 = [26 x i8] c"LUCRO OU PREJUIZO = %.2f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = fmul float %4, 0x3FCC28F5C0000000
%6 = fmul float %4, 0x4060CCCCE0000000
%7 = fmul float %5, 0x406D666660000000
%8 = fsub float %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), float %5)
%10 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), float %6)
%11 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), float %7)
%12 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), float %8)
ret i32 0
}