#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 Distance(int, int, double **);
double Reduction4(int a, double la, int b, double lb, int i, double lamda,
                  double **delta) {
  double Dui;
  Dui = lamda * (Distance(a, i, delta) - la) +
        (1 - lamda) * (Distance(b, i, delta) - lb);
  return (Dui);
}


x86 assembly (clang, -O0):
<Reduction4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %edx,-0x24(%rbp)
movsd  %xmm2,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x38(%rbp),%rdx
call   1030 <Distance@plt>
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xea1(%rip),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x38(%rbp),%rdx
call   1030 <Distance@plt>
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x48(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @Reduction4(i32 %0, double %1, i32 %2, double %3, i32 %4, double %5, double** %6) {
%8 = tail call double @Distance(i32 %0, i32 %4, double** %6)
%9 = fsub double %8, %1
%10 = fsub double 1.000000e+00, %5
%11 = tail call double @Distance(i32 %2, i32 %4, double** %6)
%12 = fsub double %11, %3
%13 = fmul double %10, %12
%14 = tail call double @llvm.fmuladd.f64(double %5, double %9, double %13)
ret double %14
}