#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 Finish_branch_length(int i, int j, int k, double **delta) {
  double length;
  length = 0.5 * (Distance(i, j, delta) + Distance(i, k, delta) -
                  Distance(j, k, delta));
  return (length);
}


x86 assembly (clang, -O0):
<Finish_branch_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <Distance@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <Distance@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <Distance@plt>
movsd  -0x28(%rbp),%xmm1
subsd  %xmm0,%xmm1
movsd  0xe87(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Finish_branch_length>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%ebp
mov    %rcx,%rdx
call   1030 <Distance@plt>
movsd  %xmm0,(%rsp)
mov    %ebp,%edi
mov    %r14d,%esi
mov    %rbx,%rdx
call   1030 <Distance@plt>
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
mov    %r15d,%edi
mov    %r14d,%esi
mov    %rbx,%rdx
call   1030 <Distance@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xe9b(%rip),%xmm1
movapd %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @Finish_branch_length(i32 %0, i32 %1, i32 %2, double** %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double**
%9 = alloca double
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store double** %3, double*** %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load double**, double*** %8
%13 = call double @Distance(i32 %10, i32 %11, double** %12)
%14 = load i32, i32* %5
%15 = load i32, i32* %7
%16 = load double**, double*** %8
%17 = call double @Distance(i32 %14, i32 %15, double** %16)
%18 = fadd double %13, %17
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = load double**, double*** %8
%22 = call double @Distance(i32 %19, i32 %20, double** %21)
%23 = fsub double %18, %22
%24 = fmul double 5.000000e-01, %23
store double %24, double* %9
%25 = load double, double* %9
ret double %25
}

LLVM IR (-O2):
define double @Finish_branch_length(i32 %0, i32 %1, i32 %2, double** %3) {
%5 = tail call double @Distance(i32 %0, i32 %1, double** %3)
%6 = tail call double @Distance(i32 %0, i32 %2, double** %3)
%7 = fadd double %5, %6
%8 = tail call double @Distance(i32 %1, i32 %2, double** %3)
%9 = fsub double %7, %8
%10 = fmul double %9, 5.000000e-01
ret double %10
}