#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 */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double func(double x, double y, double z) {
  return (x * z + x * x + y * y + z * z) - .2 -
         ((double)rand() / (double)RAND_MAX) * .1;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe99(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  -0x20(%rbp),%xmm1
cvtsi2sd %rax,%xmm0
mov    0x2e58(%rip),%rax
cvtsi2sdq (%rax),%xmm2
divsd  %xmm2,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe48(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
movapd %xmm0,%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm2
addsd  %xmm2,%xmm0
addsd  0xec7(%rip),%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0x2e94(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
mulsd  0xea0(%rip),%xmm0
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @func(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = load double, double* %4
%10 = load double, double* %4
%11 = fmul double %9, %10
%12 = call double @llvm.fmuladd.f64(double %7, double %8, double %11)
%13 = load double, double* %5
%14 = load double, double* %5
%15 = call double @llvm.fmuladd.f64(double %13, double %14, double %12)
%16 = load double, double* %6
%17 = load double, double* %6
%18 = call double @llvm.fmuladd.f64(double %16, double %17, double %15)
%19 = fsub double %18, 2.000000e-01
%20 = call i64 (...) @rand()
%21 = sitofp i64 %20 to double
%22 = load i64, i64* @RAND_MAX
%23 = sitofp i64 %22 to double
%24 = fdiv double %21, %23
%25 = fneg double %24
%26 = call double @llvm.fmuladd.f64(double %25, double 1.000000e-01, double %19)
ret double %26
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @func(double %0, double %1, double %2) {
%4 = fmul double %0, %0
%5 = tail call double @llvm.fmuladd.f64(double %0, double %2, double %4)
%6 = tail call double @llvm.fmuladd.f64(double %1, double %1, double %5)
%7 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %6)
%8 = fadd double %7, -2.000000e-01
%9 = tail call i64 (...) @rand()
%10 = sitofp i64 %9 to double
%11 = load i64, i64* @RAND_MAX
%12 = sitofp i64 %11 to double
%13 = fneg double %10
%14 = fdiv double %13, %12
%15 = tail call double @llvm.fmuladd.f64(double %14, double 1.000000e-01, double %8)
ret double %15
}