#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 getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  printf("\n ** Calculo da diaria, valor medio, lucro e prejuizo da promoção "
         "no Hotel **\n\n");
  float vdn, vdp, vmasp, vmacp, lpm;
  printf("Informe o valor, em reais, da diaria normal do Hotel: ");
  scanf("%f", &vdn);
  vdp = 0.78 * vdn;
  vmasp = vdn * 18.0 * 30.0;
  vmacp = vdp * 29.0 * 30.0;
  lpm = vmacp - vmasp;
  printf("\nO valor da diaria no periodo da promoção é, em Reais: %.2f;\n",
         vdp);
  printf("O valor medio arrecadado sem a promoção durante 1 mês é, em Reais: "
         "%.2f;\n",
         vmasp);
  printf("O valor medio arrecadado com a promoção durante 1 mês é, em Reais: "
         "%.2f;\n",
         vmacp);
  printf("O lucro, se positivo, ou prejuizo, se negativo, com a promoção é, em "
         "Reais: %.2f.\n",
         lpm);
  printf("\n\n<<Marco Tulio>>\n");
  getchar(), getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf4e(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea3(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe7d(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe61(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe4b(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe37(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xee1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xf18(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xf4f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xf97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
lea    0x1052(%rip),%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf02(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe7f(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
movaps %xmm0,%xmm2
movlhps %xmm1,%xmm2
mulpd  0xe75(%rip),%xmm2
mulpd  0xe7d(%rip),%xmm2
cvtpd2ps %xmm2,%xmm1
movapd %xmm1,0x20(%rsp)
movapd %xmm1,%xmm2
shufps $0x55,%xmm1,%xmm2
movaps %xmm2,0x10(%rsp)
subss  %xmm2,%xmm1
movaps %xmm1,0x30(%rsp)
lea    0xea0(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movaps 0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeca(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movaps 0x20(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xf01(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movaps 0x30(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xf38(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xfd1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@.str = [82 x i8] c"\0A ** Calculo da diaria, valor medio, lucro e prejuizo da promo\C3\A7\C3\A3o no Hotel **\0A\0A\00"
@.str.1 = [55 x i8] c"Informe o valor, em reais, da diaria normal do Hotel: \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [65 x i8] c"\0AO valor da diaria no periodo da promo\C3\A7\C3\A3o \C3\A9, em Reais: %.2f;\0A\00"
@.str.4 = [78 x i8] c"O valor medio arrecadado sem a promo\C3\A7\C3\A3o durante 1 m\C3\AAs \C3\A9, em Reais: %.2f;\0A\00"
@.str.5 = [78 x i8] c"O valor medio arrecadado com a promo\C3\A7\C3\A3o durante 1 m\C3\AAs \C3\A9, em Reais: %.2f;\0A\00"
@.str.6 = [86 x i8] c"O lucro, se positivo, ou prejuizo, se negativo, com a promo\C3\A7\C3\A3o \C3\A9, em Reais: %.2f.\0A\00"
@.str.7 = [19 x i8] c"\0A\0A<<Marco Tulio>>\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%9 = load float, float* %1
%10 = fpext float %9 to double
%11 = fmul double 7.800000e-01, %10
%12 = fptrunc double %11 to float
store float %12, float* %2
%13 = load float, float* %1
%14 = fpext float %13 to double
%15 = fmul double %14, 1.800000e+01
%16 = fmul double %15, 3.000000e+01
%17 = fptrunc double %16 to float
store float %17, float* %3
%18 = load float, float* %2
%19 = fpext float %18 to double
%20 = fmul double %19, 2.900000e+01
%21 = fmul double %20, 3.000000e+01
%22 = fptrunc double %21 to float
store float %22, float* %4
%23 = load float, float* %4
%24 = load float, float* %3
%25 = fsub float %23, %24
store float %25, float* %5
%26 = load float, float* %2
%27 = fpext float %26 to double
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.3, i64 0, i64 0), double %27)
%29 = load float, float* %3
%30 = fpext float %29 to double
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.4, i64 0, i64 0), double %30)
%32 = load float, float* %4
%33 = fpext float %32 to double
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.5, i64 0, i64 0), double %33)
%35 = load float, float* %5
%36 = fpext float %35 to double
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.6, i64 0, i64 0), double %36)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
%39 = call i32 (...) @getchar()
%40 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [55 x i8] c"Informe o valor, em reais, da diaria normal do Hotel: \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [65 x i8] c"\0AO valor da diaria no periodo da promo\C3\A7\C3\A3o \C3\A9, em Reais: %.2f;\0A\00"
@.str.4 = [78 x i8] c"O valor medio arrecadado sem a promo\C3\A7\C3\A3o durante 1 m\C3\AAs \C3\A9, em Reais: %.2f;\0A\00"
@.str.5 = [78 x i8] c"O valor medio arrecadado com a promo\C3\A7\C3\A3o durante 1 m\C3\AAs \C3\A9, em Reais: %.2f;\0A\00"
@.str.6 = [86 x i8] c"O lucro, se positivo, ou prejuizo, se negativo, com a promo\C3\A7\C3\A3o \C3\A9, em Reais: %.2f.\0A\00"
@str = [81 x i8] c"\0A ** Calculo da diaria, valor medio, lucro e prejuizo da promo\C3\A7\C3\A3o no Hotel **\0A\00"
@str.8 = [18 x i8] c"\0A\0A<<Marco Tulio>>\00"
define i32 @main() {
%1 = alloca float
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str, i64 0, i64 0))
%3 = bitcast float* %1 to i8*
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%6 = load float, float* %1
%7 = fpext float %6 to double
%8 = fmul double %7, 7.800000e-01
%9 = fptrunc double %8 to float
%10 = fpext float %9 to double
%11 = insertelement <2 x double> poison, double %10, i64 0
%12 = insertelement <2 x double> %11, double %7, i64 1
%13 = fmul <2 x double> %12, <double 2.900000e+01, double 1.800000e+01>
%14 = fmul <2 x double> %13, <double 3.000000e+01, double 3.000000e+01>
%15 = fptrunc <2 x double> %14 to <2 x float>
%16 = extractelement <2 x float> %15, i64 0
%17 = extractelement <2 x float> %15, i64 1
%18 = fsub float %16, %17
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.3, i64 0, i64 0), double %10)
%20 = fpext float %17 to double
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @.str.4, i64 0, i64 0), double %20)
%22 = fpext float %16 to double
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @.str.5, i64 0, i64 0), double %22)
%24 = fpext float %18 to double
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @.str.6, i64 0, i64 0), double %24)
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.8, i64 0, i64 0))
%27 = call i32 (...) @getchar()
%28 = call i32 (...) @getchar()
ret i32 0
}