#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 WeightMVR(int, int, int, double **, double);
double mu(int, int, double **, int);
double Finish_branch_length_MVR(int i, int j, int k, double **delta, int n) {
  double length, Wi, Dxu, u;
  u = mu(i, j, delta, n);
  Wi = WeightMVR(i, j, k, delta, u);
  Dxu = Wi *
        (Distance(i, j, delta) + Distance(i, k, delta) - Distance(j, k, delta));
  length = Dxu / (2 * Wi);
  return (length);
}


x86 assembly (clang, -O0):
<Finish_branch_length_MVR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1050 <mu@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
movsd  -0x40(%rbp),%xmm0
call   1030 <WeightMVR@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <Distance@plt>
movsd  %xmm0,-0x58(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <Distance@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <Distance@plt>
movsd  -0x50(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xe10(%rip),%xmm1
mulsd  -0x30(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Finish_branch_length_MVR>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%rbx
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%ebp
mov    %rcx,%rdx
mov    %r8d,%ecx
call   1050 <mu@plt>
mov    %ebp,%edi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %rbx,%rcx
call   1030 <WeightMVR@plt>
movsd  %xmm0,0x10(%rsp)
mov    %ebp,%edi
mov    %r15d,%esi
mov    %rbx,%rdx
call   1040 <Distance@plt>
movsd  %xmm0,0x8(%rsp)
mov    %ebp,%edi
mov    %r14d,%esi
mov    %rbx,%rdx
call   1040 <Distance@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r15d,%edi
mov    %r14d,%esi
mov    %rbx,%rdx
call   1040 <Distance@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm1
addsd  %xmm0,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @Finish_branch_length_MVR(i32 %0, i32 %1, i32 %2, double** %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double**
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store double** %3, double*** %9
store i32 %4, i32* %10
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = load double**, double*** %9
%18 = load i32, i32* %10
%19 = call double @mu(i32 %15, i32 %16, double** %17, i32 %18)
store double %19, double* %14
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = load i32, i32* %8
%23 = load double**, double*** %9
%24 = load double, double* %14
%25 = call double @WeightMVR(i32 %20, i32 %21, i32 %22, double** %23, double %24)
store double %25, double* %12
%26 = load double, double* %12
%27 = load i32, i32* %6
%28 = load i32, i32* %7
%29 = load double**, double*** %9
%30 = call double @Distance(i32 %27, i32 %28, double** %29)
%31 = load i32, i32* %6
%32 = load i32, i32* %8
%33 = load double**, double*** %9
%34 = call double @Distance(i32 %31, i32 %32, double** %33)
%35 = fadd double %30, %34
%36 = load i32, i32* %7
%37 = load i32, i32* %8
%38 = load double**, double*** %9
%39 = call double @Distance(i32 %36, i32 %37, double** %38)
%40 = fsub double %35, %39
%41 = fmul double %26, %40
store double %41, double* %13
%42 = load double, double* %13
%43 = load double, double* %12
%44 = fmul double 2.000000e+00, %43
%45 = fdiv double %42, %44
store double %45, double* %11
%46 = load double, double* %11
ret double %46
}

LLVM IR (-O2):
define double @Finish_branch_length_MVR(i32 %0, i32 %1, i32 %2, double** %3, i32 %4) {
%6 = tail call double @mu(i32 %0, i32 %1, double** %3, i32 %4)
%7 = tail call double @WeightMVR(i32 %0, i32 %1, i32 %2, double** %3, double %6)
%8 = tail call double @Distance(i32 %0, i32 %1, double** %3)
%9 = tail call double @Distance(i32 %0, i32 %2, double** %3)
%10 = fadd double %8, %9
%11 = tail call double @Distance(i32 %1, i32 %2, double** %3)
%12 = fsub double %10, %11
%13 = fmul double %7, %12
%14 = fmul double %7, 2.000000e+00
%15 = fdiv double %13, %14
ret double %15
}