#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 *, float *);
int main() {
  float valor;
  printf("Valor(R$): ");
  scanf("%f", &valor);
  printf("Total a pagar com desconto de 10%%: R$ %.2f\n", valor - valor * 0.10);
  printf("Parcelamento 3x s/juros: \n 1o Parcela: R$ %.2f \n 2o Parcela: R$ "
         "%.2f \n 3o Parcela: R$ %.2f \n",
         valor / 3, valor / 3, valor / 3);
  printf("Comissão do(a) Vendedor(a) - venda a vista: R$ %.2f\n",
         (valor - valor * 0.10) * 0.05);
  printf("Comissão do(a) Vendedor(a) - venda parcelada: R$ %.2f\n",
         valor * 0.05);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe8a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
lea    0xe96(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xe6f(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xe5a(%rip),%xmm2
divss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x8(%rbp),%xmm2
movss  0xe45(%rip),%xmm3
divss  %xmm3,%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe76(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xdf6(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xdde(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xe80(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdbb(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xe93(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movaps %xmm0,%xmm1
mulsd  0xeab(%rip),%xmm1
subsd  %xmm1,%xmm0
lea    0xec3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
divss  0xe9b(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xed0(%rip),%rdi
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
mov    $0x3,%al
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe61(%rip),%xmm1
mulsd  %xmm0,%xmm1
subsd  %xmm1,%xmm0
mulsd  0xe59(%rip),%xmm0
lea    0xef7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe39(%rip),%xmm0
lea    0xf0d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Valor(R$): \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [45 x i8] c"Total a pagar com desconto de 10%%: R$ %.2f\0A\00"
@.str.3 = [93 x i8] c"Parcelamento 3x s/juros: \0A 1o Parcela: R$ %.2f \0A 2o Parcela: R$ %.2f \0A 3o Parcela: R$ %.2f \0A\00"
@.str.4 = [54 x i8] c"Comiss\C3\A3o do(a) Vendedor(a) - venda a vista: R$ %.2f\0A\00"
@.str.5 = [56 x i8] c"Comiss\C3\A3o do(a) Vendedor(a) - venda parcelada: R$ %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fneg double %8
%10 = call double @llvm.fmuladd.f64(double %9, double 1.000000e-01, double %6)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), double %10)
%12 = load float, float* %2
%13 = fdiv float %12, 3.000000e+00
%14 = fpext float %13 to double
%15 = load float, float* %2
%16 = fdiv float %15, 3.000000e+00
%17 = fpext float %16 to double
%18 = load float, float* %2
%19 = fdiv float %18, 3.000000e+00
%20 = fpext float %19 to double
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.3, i64 0, i64 0), double %14, double %17, double %20)
%22 = load float, float* %2
%23 = fpext float %22 to double
%24 = load float, float* %2
%25 = fpext float %24 to double
%26 = fneg double %25
%27 = call double @llvm.fmuladd.f64(double %26, double 1.000000e-01, double %23)
%28 = fmul double %27, 5.000000e-02
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0), double %28)
%30 = load float, float* %2
%31 = fpext float %30 to double
%32 = fmul double %31, 5.000000e-02
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.5, i64 0, i64 0), double %32)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Valor(R$): \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [45 x i8] c"Total a pagar com desconto de 10%%: R$ %.2f\0A\00"
@.str.3 = [93 x i8] c"Parcelamento 3x s/juros: \0A 1o Parcela: R$ %.2f \0A 2o Parcela: R$ %.2f \0A 3o Parcela: R$ %.2f \0A\00"
@.str.4 = [54 x i8] c"Comiss\C3\A3o do(a) Vendedor(a) - venda a vista: R$ %.2f\0A\00"
@.str.5 = [56 x i8] c"Comiss\C3\A3o do(a) Vendedor(a) - venda parcelada: R$ %.2f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fneg double %6
%8 = call double @llvm.fmuladd.f64(double %7, double 1.000000e-01, double %6)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), double %8)
%10 = load float, float* %1
%11 = fdiv float %10, 3.000000e+00
%12 = fpext float %11 to double
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([93 x i8], [93 x i8]* @.str.3, i64 0, i64 0), double %12, double %12, double %12)
%14 = load float, float* %1
%15 = fpext float %14 to double
%16 = fneg double %15
%17 = call double @llvm.fmuladd.f64(double %16, double 1.000000e-01, double %15)
%18 = fmul double %17, 5.000000e-02
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0), double %18)
%20 = load float, float* %1
%21 = fpext float %20 to double
%22 = fmul double %21, 5.000000e-02
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.5, i64 0, i64 0), double %22)
ret i32 0
}