#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, float **);
float Finish_branch_length(int i, int j, int k, float **delta) {
  float 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
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%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
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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