#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 valorDolar, taxaCambio, icms, percentualLucro;
  scanf("%f", &valorDolar);
  scanf("%f", &taxaCambio);
  scanf("%f", &icms);
  scanf("%f", &percentualLucro);
  float valorCompra = valorDolar * taxaCambio;
  icms = icms / 100;
  float valorIcms = valorCompra * icms;
  percentualLucro = percentualLucro / 100;
  float valorLucro = valorCompra * percentualLucro;
  valorCompra = valorCompra + valorIcms + valorLucro;
  printf("O VALOR PAGO EM REAIS = %.2f\n", valorCompra);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed5(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb5(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xea5(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xe7c(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x14(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
movss  0xe57(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x14(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
lea    0xe26(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm1
mulss  0x8(%rsp),%xmm1
movss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm2
unpcklps %xmm0,%xmm2
divps  0xe81(%rip),%xmm2
movss  %xmm2,0x4(%rsp)
movaps %xmm1,%xmm0
shufps $0x0,%xmm1,%xmm0
mulps  %xmm2,%xmm0
shufps $0x55,%xmm2,%xmm2
movss  %xmm2,(%rsp)
addss  %xmm0,%xmm1
shufps $0x55,%xmm0,%xmm0
addss  %xmm1,%xmm0
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [30 x i8] c"O VALOR PAGO EM REAIS = %.2f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %4)
%12 = load float, float* %1
%13 = load float, float* %2
%14 = fmul float %12, %13
store float %14, float* %5
%15 = load float, float* %3
%16 = fdiv float %15, 1.000000e+02
store float %16, float* %3
%17 = load float, float* %5
%18 = load float, float* %3
%19 = fmul float %17, %18
store float %19, float* %6
%20 = load float, float* %4
%21 = fdiv float %20, 1.000000e+02
store float %21, float* %4
%22 = load float, float* %5
%23 = load float, float* %4
%24 = fmul float %22, %23
store float %24, float* %7
%25 = load float, float* %5
%26 = load float, float* %6
%27 = fadd float %25, %26
%28 = load float, float* %7
%29 = fadd float %27, %28
store float %29, float* %5
%30 = load float, float* %5
%31 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), float %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [30 x i8] c"O VALOR PAGO EM REAIS = %.2f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = bitcast float* %1 to i8*
%6 = bitcast float* %2 to i8*
%7 = bitcast float* %3 to i8*
%8 = bitcast float* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %4)
%13 = load float, float* %1
%14 = load float, float* %2
%15 = fmul float %13, %14
%16 = load float, float* %3
%17 = load float, float* %4
%18 = insertelement <2 x float> poison, float %16, i64 0
%19 = insertelement <2 x float> %18, float %17, i64 1
%20 = fdiv <2 x float> %19, <float 1.000000e+02, float 1.000000e+02>
%21 = extractelement <2 x float> %20, i64 0
store float %21, float* %3
%22 = extractelement <2 x float> %20, i64 1
store float %22, float* %4
%23 = insertelement <2 x float> poison, float %15, i64 0
%24 = shufflevector <2 x float> %23, <2 x float> poison, <2 x i32> zeroinitializer
%25 = fmul <2 x float> %24, %20
%26 = extractelement <2 x float> %25, i64 0
%27 = fadd float %15, %26
%28 = extractelement <2 x float> %25, i64 1
%29 = fadd float %27, %28
%30 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), float %29)
ret i32 0
}