#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 *, double, double, double);
int main(void) {
  float f1 = 3.14f, f2, f3;
  double d1 = 2.71, d2, d3;
  f2 = f1 - (d1 - 4.2f);
  d2 = f2 + f1 + 3.63123;
  f3 = f2 / (d1 / 0.44f);
  d3 = d2 * f1 * 3.1;
  printf("f1 = %f, f2 = %f, f3 = %f\n", f1, f2, f3);
  printf("d1 = %f, d2 = %f, d3 = %f\n", d1, d2, d3);
  return f1 * d1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xf01(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
subsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe9a(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe73(%rip),%xmm2
divsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movsd  -0x20(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe40(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe41(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
lea    0xe41(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf18(%rip),%rdi
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
movsd  0xee0(%rip),%xmm2
call   1030 <printf@plt>
lea    0xf0f(%rip),%rdi
movsd  0xed4(%rip),%xmm0
movsd  0xed4(%rip),%xmm1
movsd  0xed4(%rip),%xmm2
call   1030 <printf@plt>
mov    $0x8,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"f1 = %f, f2 = %f, f3 = %f\0A\00"
@.str.1 = [27 x i8] c"d1 = %f, d2 = %f, d3 = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca double
%6 = alloca double
%7 = alloca double
store i32 0, i32* %1
store float 0x40091EB860000000, float* %2
store double 2.710000e+00, double* %5
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = load double, double* %5
%11 = fsub double %10, 0x4010CCCCC0000000
%12 = fsub double %9, %11
%13 = fptrunc double %12 to float
store float %13, float* %3
%14 = load float, float* %3
%15 = load float, float* %2
%16 = fadd float %14, %15
%17 = fpext float %16 to double
%18 = fadd double %17, 3.631230e+00
store double %18, double* %6
%19 = load float, float* %3
%20 = fpext float %19 to double
%21 = load double, double* %5
%22 = fdiv double %21, 0x3FDC28F5C0000000
%23 = fdiv double %20, %22
%24 = fptrunc double %23 to float
store float %24, float* %4
%25 = load double, double* %6
%26 = load float, float* %2
%27 = fpext float %26 to double
%28 = fmul double %25, %27
%29 = fmul double %28, 3.100000e+00
store double %29, double* %7
%30 = load float, float* %2
%31 = fpext float %30 to double
%32 = load float, float* %3
%33 = fpext float %32 to double
%34 = load float, float* %4
%35 = fpext float %34 to double
%36 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double %31, double %33, double %35)
%37 = load double, double* %5
%38 = load double, double* %6
%39 = load double, double* %7
%40 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), double %37, double %38, double %39)
%41 = load float, float* %2
%42 = fpext float %41 to double
%43 = load double, double* %5
%44 = fmul double %42, %43
%45 = fptosi double %44 to i32
ret i32 %45
}

LLVM IR (-O2):
@.str = [27 x i8] c"f1 = %f, f2 = %f, f3 = %f\0A\00"
@.str.1 = [27 x i8] c"d1 = %f, d2 = %f, d3 = %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double 0x40091EB860000000, double 0x4012851EC0000000, double 0x3FE80E3520000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), double 2.710000e+00, double 0x4026CD6E141C8217, double 0x405BBEB174701210)
ret i32 8
}