#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(int);
double prem_vs_voigt(double vsh, double vsv, double vph, double vpv,
                     double eta) {
  double v;
  v = sqrt((1. / 15.) * ((1.0 - 2.0 * eta) * vph * vph + vpv * vpv +
                         5.0 * vsh * vsh + (6.0 + 4.0 * eta) * vsv * vsv));
  return v;
}


x86 assembly (clang, -O0):
<prem_vs_voigt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xede(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xeae(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  0xe7f(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe7b(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe4d(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prem_vs_voigt>:
movapd %xmm4,%xmm5
addsd  %xmm4,%xmm5
movsd  0xee0(%rip),%xmm6
subsd  %xmm5,%xmm6
mulsd  %xmm2,%xmm6
mulsd  %xmm3,%xmm3
mulsd  %xmm2,%xmm6
addsd  %xmm3,%xmm6
movsd  0xecc(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  0xec4(%rip),%xmm4
addsd  0xec4(%rip),%xmm4
addsd  %xmm6,%xmm2
mulsd  %xmm1,%xmm4
mulsd  %xmm1,%xmm4
addsd  %xmm2,%xmm4
mulsd  0xeb4(%rip),%xmm4
cvttsd2si %xmm4,%edi
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @prem_vs_voigt(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%12 = load double, double* %10
%13 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %12, double 1.000000e+00)
%14 = load double, double* %8
%15 = fmul double %13, %14
%16 = load double, double* %8
%17 = load double, double* %9
%18 = load double, double* %9
%19 = fmul double %17, %18
%20 = call double @llvm.fmuladd.f64(double %15, double %16, double %19)
%21 = load double, double* %6
%22 = fmul double 5.000000e+00, %21
%23 = load double, double* %6
%24 = call double @llvm.fmuladd.f64(double %22, double %23, double %20)
%25 = load double, double* %10
%26 = call double @llvm.fmuladd.f64(double 4.000000e+00, double %25, double 6.000000e+00)
%27 = load double, double* %7
%28 = fmul double %26, %27
%29 = load double, double* %7
%30 = call double @llvm.fmuladd.f64(double %28, double %29, double %24)
%31 = fmul double 0x3FB1111111111111, %30
%32 = fptosi double %31 to i32
%33 = call double @sqrt(i32 %32)
store double %33, double* %11
%34 = load double, double* %11
ret double %34
}

LLVM IR (-O2):
define double @prem_vs_voigt(double %0, double %1, double %2, double %3, double %4) {
%6 = tail call double @llvm.fmuladd.f64(double %4, double -2.000000e+00, double 1.000000e+00)
%7 = fmul double %6, %2
%8 = fmul double %3, %3
%9 = tail call double @llvm.fmuladd.f64(double %7, double %2, double %8)
%10 = fmul double %0, 5.000000e+00
%11 = tail call double @llvm.fmuladd.f64(double %10, double %0, double %9)
%12 = tail call double @llvm.fmuladd.f64(double %4, double 4.000000e+00, double 6.000000e+00)
%13 = fmul double %12, %1
%14 = tail call double @llvm.fmuladd.f64(double %13, double %1, double %11)
%15 = fmul double %14, 0x3FB1111111111111
%16 = fptosi double %15 to i32
%17 = tail call double @sqrt(i32 %16)
ret double %17
}