#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 */
double sqrt(double);
double trans(double *, int, double);
double f(double x, double y, double z) {
  double fp[5] = {1.0, 0.7, -0.3, 0.0, 0.0};
  double v;
  v = trans(fp, 5, (x + y + z) / 3.0);
  v *= 3.0 * sqrt(3.0);
  return v;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xea4(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe8f(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    -0x40(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xe67(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0x5,%esi
call   1030 <trans@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  0xe4c(%rip),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xe3c(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sub    $0x28,%rsp
xorps  %xmm3,%xmm3
movaps %xmm3,0x10(%rsp)
movq   $0x0,0x20(%rsp)
movaps 0xed4(%rip),%xmm3
movaps %xmm3,(%rsp)
movabs $0xbfd3333333333333,%rax
33 d3 bf
mov    %rax,0x10(%rsp)
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
divsd  0xec1(%rip),%xmm0
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <trans@plt>
mulsd  0xeb4(%rip),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @f(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca [5 x double]
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = bitcast [5 x double]* %7 to i8*
%10 = bitcast i8* %9 to [5 x double]*
%11 = getelementptr inbounds [5 x double], [5 x double]* %10, i32 0, i32 0
store double 1.000000e+00, double* %11
%12 = getelementptr inbounds [5 x double], [5 x double]* %10, i32 0, i32 1
store double 0x3FE6666666666666, double* %12
%13 = getelementptr inbounds [5 x double], [5 x double]* %10, i32 0, i32 2
store double -3.000000e-01, double* %13
%14 = getelementptr inbounds [5 x double], [5 x double]* %7, i64 0, i64 0
%15 = load double, double* %4
%16 = load double, double* %5
%17 = fadd double %15, %16
%18 = load double, double* %6
%19 = fadd double %17, %18
%20 = fdiv double %19, 3.000000e+00
%21 = call double @trans(double* %14, i32 5, double %20)
store double %21, double* %8
%22 = call double @sqrt(double 3.000000e+00)
%23 = fmul double 3.000000e+00, %22
%24 = load double, double* %8
%25 = fmul double %24, %23
store double %25, double* %8
%26 = load double, double* %8
ret double %26
}

LLVM IR (-O2):
define double @f(double %0, double %1, double %2) {
%4 = alloca [5 x double]
%5 = bitcast [5 x double]* %4 to i8*
%6 = getelementptr inbounds [5 x double], [5 x double]* %4, i64 0, i64 2
%7 = bitcast double* %6 to i8*
%8 = getelementptr inbounds [5 x double], [5 x double]* %4, i64 0, i64 0
%9 = bitcast [5 x double]* %4 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 0x3FE6666666666666>, <2 x double>* %9
%10 = getelementptr inbounds [5 x double], [5 x double]* %4, i64 0, i64 2
store double -3.000000e-01, double* %10
%11 = fadd double %0, %1
%12 = fadd double %11, %2
%13 = fdiv double %12, 3.000000e+00
%14 = call double @trans(double* %8, i32 5, double %13)
%15 = fmul double %14, 0x4014C8DC2E423980
ret double %15
}