#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 Variance(int, int, double **);
double Reduction10(int a, int b, int i, double lamda, double vab,
                   double **delta) {
  double Vci;
  Vci = lamda * Variance(a, i, delta) + (1 - lamda) * Variance(b, i, delta) -
        lamda * (1 - lamda) * vab;
  return (Vci);
}


x86 assembly (clang, -O0):
<Reduction10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   1030 <Variance@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xea7(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   1030 <Variance@plt>
movsd  -0x48(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
cvtsi2sd %eax,%xmm3
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  0xe62(%rip),%xmm2
subsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
movsd  -0x20(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Reduction10>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rcx,%rbx
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,(%rsp)
mov    %edx,%ebp
mov    %esi,%r14d
mov    %edx,%esi
mov    %rcx,%rdx
call   1030 <Variance@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xeb6(%rip),%xmm0
subsd  (%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r14d,%edi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1030 <Variance@plt>
cvtsi2sd %eax,%xmm2
movsd  0x8(%rsp),%xmm3
mulsd  %xmm3,%xmm2
movsd  (%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm3
mulsd  0x18(%rsp),%xmm3
subsd  %xmm3,%xmm0
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define double @Reduction10(i32 %0, i32 %1, i32 %2, double %3, double %4, double** %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
%11 = alloca double
%12 = alloca double**
%13 = alloca double
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store double %3, double* %10
store double %4, double* %11
store double** %5, double*** %12
%14 = load double, double* %10
%15 = load i32, i32* %7
%16 = load i32, i32* %9
%17 = load double**, double*** %12
%18 = call i32 @Variance(i32 %15, i32 %16, double** %17)
%19 = sitofp i32 %18 to double
%20 = load double, double* %10
%21 = fsub double 1.000000e+00, %20
%22 = load i32, i32* %8
%23 = load i32, i32* %9
%24 = load double**, double*** %12
%25 = call i32 @Variance(i32 %22, i32 %23, double** %24)
%26 = sitofp i32 %25 to double
%27 = fmul double %21, %26
%28 = call double @llvm.fmuladd.f64(double %14, double %19, double %27)
%29 = load double, double* %10
%30 = load double, double* %10
%31 = fsub double 1.000000e+00, %30
%32 = fmul double %29, %31
%33 = load double, double* %11
%34 = fneg double %32
%35 = call double @llvm.fmuladd.f64(double %34, double %33, double %28)
store double %35, double* %13
%36 = load double, double* %13
ret double %36
}

LLVM IR (-O2):
define double @Reduction10(i32 %0, i32 %1, i32 %2, double %3, double %4, double** %5) {
%7 = tail call i32 @Variance(i32 %0, i32 %2, double** %5)
%8 = sitofp i32 %7 to double
%9 = fsub double 1.000000e+00, %3
%10 = tail call i32 @Variance(i32 %1, i32 %2, double** %5)
%11 = sitofp i32 %10 to double
%12 = fmul double %9, %11
%13 = tail call double @llvm.fmuladd.f64(double %3, double %8, double %12)
%14 = fneg double %9
%15 = fmul double %14, %3
%16 = tail call double @llvm.fmuladd.f64(double %15, double %4, double %13)
ret double %16
}