#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 _logsumexp_sort_kahan_inplace(double *, int);
extern double _bar_df(double *db_IJ, int L1, double *db_JI, int L2,
                      double *scratch) {
  int i;
  double ln_avg1;
  double ln_avg2;
  for (i = 0; i < L1; i++) {
    scratch[i] = db_IJ[i] > 0 ? 0 : db_IJ[i];
  }
  ln_avg1 = _logsumexp_sort_kahan_inplace(scratch, L1);
  for (i = 0; i < L1; i++) {
    scratch[i] = db_JI[i] > 0 ? 0 : db_JI[i];
  }
  ln_avg2 = _logsumexp_sort_kahan_inplace(scratch, L2);
  return ln_avg2 - ln_avg1;
}


x86 assembly (clang, -O0):
<_bar_df>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1196 <_bar_df+0x86>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1164 <_bar_df+0x54>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    1176 <_bar_df+0x66>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1131 <_bar_df+0x21>
mov    -0x28(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <_logsumexp_sort_kahan_inplace@plt>
movsd  %xmm0,-0x38(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1213 <_bar_df+0x103>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11e1 <_bar_df+0xd1>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    11f3 <_bar_df+0xe3>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11ae <_bar_df+0x9e>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <_logsumexp_sort_kahan_inplace@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_bar_df>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %r8,%rbx
mov    %ecx,%r14d
mov    %esi,%r15d
test   %esi,%esi
jle    11ec <_bar_df+0xdc>
mov    %rdx,%rbp
mov    %r15d,%r12d
cmp    $0x4,%r15d
jb     1153 <_bar_df+0x43>
lea    (%rdi,%r12,8),%rax
cmp    %rbx,%rax
jbe    1202 <_bar_df+0xf2>
lea    (%rbx,%r12,8),%rax
cmp    %rdi,%rax
jbe    1202 <_bar_df+0xf2>
xor    %eax,%eax
mov    %rax,%rcx
not    %rcx
add    %r12,%rcx
mov    %r12,%rdx
and    $0x3,%rdx
je     1188 <_bar_df+0x78>
nopw   0x0(%rax,%rax,1)
xorpd  %xmm0,%xmm0
minsd  (%rdi,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
add    $0x1,%rax
add    $0xffffffffffffffff,%rdx
jne    1170 <_bar_df+0x60>
cmp    $0x3,%rcx
jb     12bc <_bar_df+0x1ac>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xorpd  %xmm0,%xmm0
minsd  (%rdi,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
xorpd  %xmm0,%xmm0
minsd  0x8(%rdi,%rax,8),%xmm0
movsd  %xmm0,0x8(%rbx,%rax,8)
xorpd  %xmm0,%xmm0
minsd  0x10(%rdi,%rax,8),%xmm0
movsd  %xmm0,0x10(%rbx,%rax,8)
xorpd  %xmm0,%xmm0
minsd  0x18(%rdi,%rax,8),%xmm0
movsd  %xmm0,0x18(%rbx,%rax,8)
add    $0x4,%rax
cmp    %rax,%r12
jne    11a0 <_bar_df+0x90>
jmp    12bc <_bar_df+0x1ac>
mov    %rbx,%rdi
mov    %r15d,%esi
call   1030 <_logsumexp_sort_kahan_inplace@plt>
movsd  %xmm0,0x8(%rsp)
jmp    145e <_bar_df+0x34e>
mov    %r12d,%eax
and    $0xfffffffc,%eax
lea    -0x4(%rax),%rcx
mov    %rcx,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
test   %rcx,%rcx
je     147c <_bar_df+0x36c>
mov    %rdx,%rsi
and    $0xfffffffffffffffe,%rsi
xor    %ecx,%ecx
nopl   0x0(%rax)
movupd (%rdi,%rcx,8),%xmm0
movupd 0x10(%rdi,%rcx,8),%xmm1
xorpd  %xmm2,%xmm2
minpd  %xmm0,%xmm2
xorpd  %xmm0,%xmm0
minpd  %xmm1,%xmm0
movupd %xmm2,(%rbx,%rcx,8)
movupd %xmm0,0x10(%rbx,%rcx,8)
movupd 0x20(%rdi,%rcx,8),%xmm0
movupd 0x30(%rdi,%rcx,8),%xmm1
xorpd  %xmm2,%xmm2
minpd  %xmm0,%xmm2
xorpd  %xmm0,%xmm0
minpd  %xmm1,%xmm0
movupd %xmm2,0x20(%rbx,%rcx,8)
movupd %xmm0,0x30(%rbx,%rcx,8)
add    $0x8,%rcx
add    $0xfffffffffffffffe,%rsi
jne    1230 <_bar_df+0x120>
test   $0x1,%dl
je     12b3 <_bar_df+0x1a3>
movupd (%rdi,%rcx,8),%xmm0
movupd 0x10(%rdi,%rcx,8),%xmm1
xorpd  %xmm2,%xmm2
xorpd  %xmm3,%xmm3
minpd  %xmm0,%xmm3
minpd  %xmm1,%xmm2
movupd %xmm3,(%rbx,%rcx,8)
movupd %xmm2,0x10(%rbx,%rcx,8)
cmp    %r12,%rax
jne    1155 <_bar_df+0x45>
mov    %rbx,%rdi
mov    %r15d,%esi
call   1030 <_logsumexp_sort_kahan_inplace@plt>
test   %r15d,%r15d
movsd  %xmm0,0x8(%rsp)
jle    145e <_bar_df+0x34e>
cmp    $0x4,%r15d
jb     12fd <_bar_df+0x1ed>
lea    0x0(,%r12,8),%rax
add    %rbp,%rax
cmp    %rbx,%rax
jbe    139d <_bar_df+0x28d>
lea    (%rbx,%r12,8),%rax
cmp    %rbp,%rax
jbe    139d <_bar_df+0x28d>
xor    %eax,%eax
mov    %rax,%rcx
not    %rcx
add    %r12,%rcx
mov    %r12,%rdx
and    $0x3,%rdx
je     1339 <_bar_df+0x229>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xorpd  %xmm1,%xmm1
minsd  0x0(%rbp,%rax,8),%xmm1
movsd  %xmm1,(%rbx,%rax,8)
add    $0x1,%rax
add    $0xffffffffffffffff,%rdx
jne    1320 <_bar_df+0x210>
cmp    $0x3,%rcx
jb     145e <_bar_df+0x34e>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xorpd  %xmm0,%xmm0
minsd  0x0(%rbp,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
xorpd  %xmm0,%xmm0
minsd  0x8(%rbp,%rax,8),%xmm0
movsd  %xmm0,0x8(%rbx,%rax,8)
xorpd  %xmm0,%xmm0
minsd  0x10(%rbp,%rax,8),%xmm0
movsd  %xmm0,0x10(%rbx,%rax,8)
xorpd  %xmm0,%xmm0
minsd  0x18(%rbp,%rax,8),%xmm0
movsd  %xmm0,0x18(%rbx,%rax,8)
add    $0x4,%rax
cmp    %rax,%r12
jne    1350 <_bar_df+0x240>
jmp    145e <_bar_df+0x34e>
mov    %r12d,%eax
and    $0xfffffffc,%eax
lea    -0x4(%rax),%rcx
mov    %rcx,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
test   %rcx,%rcx
je     148c <_bar_df+0x37c>
mov    %rdx,%rsi
and    $0xfffffffffffffffe,%rsi
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movupd 0x0(%rbp,%rcx,8),%xmm3
movupd 0x10(%rbp,%rcx,8),%xmm1
xorpd  %xmm2,%xmm2
minpd  %xmm3,%xmm2
xorpd  %xmm3,%xmm3
minpd  %xmm1,%xmm3
movupd %xmm2,(%rbx,%rcx,8)
movupd %xmm3,0x10(%rbx,%rcx,8)
movupd 0x20(%rbp,%rcx,8),%xmm3
movupd 0x30(%rbp,%rcx,8),%xmm1
xorpd  %xmm2,%xmm2
minpd  %xmm3,%xmm2
xorpd  %xmm3,%xmm3
minpd  %xmm1,%xmm3
movupd %xmm2,0x20(%rbx,%rcx,8)
movupd %xmm3,0x30(%rbx,%rcx,8)
add    $0x8,%rcx
add    $0xfffffffffffffffe,%rsi
jne    13d0 <_bar_df+0x2c0>
test   $0x1,%dl
je     1455 <_bar_df+0x345>
movupd 0x0(%rbp,%rcx,8),%xmm4
movupd 0x10(%rbp,%rcx,8),%xmm1
xorpd  %xmm2,%xmm2
xorpd  %xmm3,%xmm3
minpd  %xmm4,%xmm3
minpd  %xmm1,%xmm2
movupd %xmm3,(%rbx,%rcx,8)
movupd %xmm2,0x10(%rbx,%rcx,8)
cmp    %r12,%rax
jne    12ff <_bar_df+0x1ef>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <_logsumexp_sort_kahan_inplace@plt>
subsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ecx,%ecx
test   $0x1,%dl
jne    128d <_bar_df+0x17d>
jmp    12b3 <_bar_df+0x1a3>
xor    %ecx,%ecx
test   $0x1,%dl
jne    142e <_bar_df+0x31e>
jmp    1455 <_bar_df+0x345>

LLVM IR (-O0):
define double @_bar_df(double* %0, i32 %1, double* %2, i32 %3, double* %4) {
%6 = alloca double*
%7 = alloca i32
%8 = alloca double*
%9 = alloca i32
%10 = alloca double*
%11 = alloca i32
%12 = alloca double
%13 = alloca double
store double* %0, double** %6
store i32 %1, i32* %7
store double* %2, double** %8
store i32 %3, i32* %9
store double* %4, double** %10
store i32 0, i32* %11
br label %14
14: ; preds = %38, %5
%15 = load i32, i32* %11
%16 = load i32, i32* %7
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %41
18: ; preds = %14
%19 = load double*, double** %6
%20 = load i32, i32* %11
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %19, i64 %21
%23 = load double, double* %22
%24 = fcmp ogt double %23, 0.000000e+00
br i1 %24, label %25, label %26
25: ; preds = %18
br label %32
26: ; preds = %18
%27 = load double*, double** %6
%28 = load i32, i32* %11
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %27, i64 %29
%31 = load double, double* %30
br label %32
32: ; preds = %26, %25
%33 = phi double [ 0.000000e+00, %25 ], [ %31, %26 ]
%34 = load double*, double** %10
%35 = load i32, i32* %11
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds double, double* %34, i64 %36
store double %33, double* %37
br label %38
38: ; preds = %32
%39 = load i32, i32* %11
%40 = add nsw i32 %39, 1
store i32 %40, i32* %11
br label %14
41: ; preds = %14
%42 = load double*, double** %10
%43 = load i32, i32* %7
%44 = call double @_logsumexp_sort_kahan_inplace(double* %42, i32 %43)
store double %44, double* %12
store i32 0, i32* %11
br label %45
45: ; preds = %69, %41
%46 = load i32, i32* %11
%47 = load i32, i32* %7
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %72
49: ; preds = %45
%50 = load double*, double** %8
%51 = load i32, i32* %11
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %50, i64 %52
%54 = load double, double* %53
%55 = fcmp ogt double %54, 0.000000e+00
br i1 %55, label %56, label %57
56: ; preds = %49
br label %63
57: ; preds = %49
%58 = load double*, double** %8
%59 = load i32, i32* %11
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds double, double* %58, i64 %60
%62 = load double, double* %61
br label %63
63: ; preds = %57, %56
%64 = phi double [ 0.000000e+00, %56 ], [ %62, %57 ]
%65 = load double*, double** %10
%66 = load i32, i32* %11
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double, double* %65, i64 %67
store double %64, double* %68
br label %69
69: ; preds = %63
%70 = load i32, i32* %11
%71 = add nsw i32 %70, 1
store i32 %71, i32* %11
br label %45
72: ; preds = %45
%73 = load double*, double** %10
%74 = load i32, i32* %9
%75 = call double @_logsumexp_sort_kahan_inplace(double* %73, i32 %74)
store double %75, double* %13
%76 = load double, double* %13
%77 = load double, double* %12
%78 = fsub double %76, %77
ret double %78
}

LLVM IR (-O2):
define double @_bar_df(double* nocapture %0, i32 %1, double* nocapture %2, i32 %3, double* %4) {
%6 = icmp sgt i32 %1, 0
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call double @_logsumexp_sort_kahan_inplace(double* %4, i32 %1)
br label %251
9: ; preds = %5
%10 = zext i32 %1 to i64
%11 = icmp ult i32 %1, 4
br i1 %11, label %82, label %12
12: ; preds = %9
%13 = getelementptr double, double* %4, i64 %10
%14 = getelementptr double, double* %0, i64 %10
%15 = icmp ugt double* %14, %4
%16 = icmp ugt double* %13, %0
%17 = and i1 %15, %16
br i1 %17, label %82, label %18
18: ; preds = %12
%19 = and i64 %10, 4294967292
%20 = add nsw i64 %19, -4
%21 = lshr exact i64 %20, 2
%22 = add nuw nsw i64 %21, 1
%23 = and i64 %22, 1
%24 = icmp eq i64 %20, 0
br i1 %24, label %62, label %25
25: ; preds = %18
%26 = and i64 %22, 9223372036854775806
br label %27
27: ; preds = %27, %25
%28 = phi i64 [ 0, %25 ], [ %59, %27 ]
%29 = phi i64 [ 0, %25 ], [ %60, %27 ]
%30 = getelementptr inbounds double, double* %0, i64 %28
%31 = bitcast double* %30 to <2 x double>*
%32 = load <2 x double>, <2 x double>* %31
%33 = getelementptr inbounds double, double* %30, i64 2
%34 = bitcast double* %33 to <2 x double>*
%35 = load <2 x double>, <2 x double>* %34
%36 = fcmp ogt <2 x double> %32, zeroinitializer
%37 = fcmp ogt <2 x double> %35, zeroinitializer
%38 = select <2 x i1> %36, <2 x double> zeroinitializer, <2 x double> %32
%39 = select <2 x i1> %37, <2 x double> zeroinitializer, <2 x double> %35
%40 = getelementptr inbounds double, double* %4, i64 %28
%41 = bitcast double* %40 to <2 x double>*
store <2 x double> %38, <2 x double>* %41
%42 = getelementptr inbounds double, double* %40, i64 2
%43 = bitcast double* %42 to <2 x double>*
store <2 x double> %39, <2 x double>* %43
%44 = or i64 %28, 4
%45 = getelementptr inbounds double, double* %0, i64 %44
%46 = bitcast double* %45 to <2 x double>*
%47 = load <2 x double>, <2 x double>* %46
%48 = getelementptr inbounds double, double* %45, i64 2
%49 = bitcast double* %48 to <2 x double>*
%50 = load <2 x double>, <2 x double>* %49
%51 = fcmp ogt <2 x double> %47, zeroinitializer
%52 = fcmp ogt <2 x double> %50, zeroinitializer
%53 = select <2 x i1> %51, <2 x double> zeroinitializer, <2 x double> %47
%54 = select <2 x i1> %52, <2 x double> zeroinitializer, <2 x double> %50
%55 = getelementptr inbounds double, double* %4, i64 %44
%56 = bitcast double* %55 to <2 x double>*
store <2 x double> %53, <2 x double>* %56
%57 = getelementptr inbounds double, double* %55, i64 2
%58 = bitcast double* %57 to <2 x double>*
store <2 x double> %54, <2 x double>* %58
%59 = add nuw i64 %28, 8
%60 = add i64 %29, 2
%61 = icmp eq i64 %60, %26
br i1 %61, label %62, label %27
62: ; preds = %27, %18
%63 = phi i64 [ 0, %18 ], [ %59, %27 ]
%64 = icmp eq i64 %23, 0
br i1 %64, label %80, label %65
65: ; preds = %62
%66 = getelementptr inbounds double, double* %0, i64 %63
%67 = bitcast double* %66 to <2 x double>*
%68 = load <2 x double>, <2 x double>* %67
%69 = getelementptr inbounds double, double* %66, i64 2
%70 = bitcast double* %69 to <2 x double>*
%71 = load <2 x double>, <2 x double>* %70
%72 = fcmp ogt <2 x double> %68, zeroinitializer
%73 = fcmp ogt <2 x double> %71, zeroinitializer
%74 = select <2 x i1> %72, <2 x double> zeroinitializer, <2 x double> %68
%75 = select <2 x i1> %73, <2 x double> zeroinitializer, <2 x double> %71
%76 = getelementptr inbounds double, double* %4, i64 %63
%77 = bitcast double* %76 to <2 x double>*
store <2 x double> %74, <2 x double>* %77
%78 = getelementptr inbounds double, double* %76, i64 2
%79 = bitcast double* %78 to <2 x double>*
store <2 x double> %75, <2 x double>* %79
br label %80
80: ; preds = %62, %65
%81 = icmp eq i64 %19, %10
br i1 %81, label %129, label %82
82: ; preds = %12, %9, %80
%83 = phi i64 [ 0, %12 ], [ 0, %9 ], [ %19, %80 ]
%84 = xor i64 %83, -1
%85 = add nsw i64 %84, %10
%86 = and i64 %10, 3
%87 = icmp eq i64 %86, 0
br i1 %87, label %99, label %88
88: ; preds = %82, %88
%89 = phi i64 [ %96, %88 ], [ %83, %82 ]
%90 = phi i64 [ %97, %88 ], [ 0, %82 ]
%91 = getelementptr inbounds double, double* %0, i64 %89
%92 = load double, double* %91
%93 = fcmp ogt double %92, 0.000000e+00
%94 = select i1 %93, double 0.000000e+00, double %92
%95 = getelementptr inbounds double, double* %4, i64 %89
store double %94, double* %95
%96 = add nuw nsw i64 %89, 1
%97 = add i64 %90, 1
%98 = icmp eq i64 %97, %86
br i1 %98, label %99, label %88
99: ; preds = %88, %82
%100 = phi i64 [ %83, %82 ], [ %96, %88 ]
%101 = icmp ult i64 %85, 3
br i1 %101, label %129, label %102
102: ; preds = %99, %102
%103 = phi i64 [ %127, %102 ], [ %100, %99 ]
%104 = getelementptr inbounds double, double* %0, i64 %103
%105 = load double, double* %104
%106 = fcmp ogt double %105, 0.000000e+00
%107 = select i1 %106, double 0.000000e+00, double %105
%108 = getelementptr inbounds double, double* %4, i64 %103
store double %107, double* %108
%109 = add nuw nsw i64 %103, 1
%110 = getelementptr inbounds double, double* %0, i64 %109
%111 = load double, double* %110
%112 = fcmp ogt double %111, 0.000000e+00
%113 = select i1 %112, double 0.000000e+00, double %111
%114 = getelementptr inbounds double, double* %4, i64 %109
store double %113, double* %114
%115 = add nuw nsw i64 %103, 2
%116 = getelementptr inbounds double, double* %0, i64 %115
%117 = load double, double* %116
%118 = fcmp ogt double %117, 0.000000e+00
%119 = select i1 %118, double 0.000000e+00, double %117
%120 = getelementptr inbounds double, double* %4, i64 %115
store double %119, double* %120
%121 = add nuw nsw i64 %103, 3
%122 = getelementptr inbounds double, double* %0, i64 %121
%123 = load double, double* %122
%124 = fcmp ogt double %123, 0.000000e+00
%125 = select i1 %124, double 0.000000e+00, double %123
%126 = getelementptr inbounds double, double* %4, i64 %121
store double %125, double* %126
%127 = add nuw nsw i64 %103, 4
%128 = icmp eq i64 %127, %10
br i1 %128, label %129, label %102
129: ; preds = %99, %102, %80
%130 = tail call double @_logsumexp_sort_kahan_inplace(double* %4, i32 %1)
br i1 %6, label %131, label %251
131: ; preds = %129
%132 = zext i32 %1 to i64
%133 = icmp ult i32 %1, 4
br i1 %133, label %204, label %134
134: ; preds = %131
%135 = getelementptr double, double* %4, i64 %10
%136 = getelementptr double, double* %2, i64 %10
%137 = icmp ugt double* %136, %4
%138 = icmp ugt double* %135, %2
%139 = and i1 %137, %138
br i1 %139, label %204, label %140
140: ; preds = %134
%141 = and i64 %10, 4294967292
%142 = add nsw i64 %141, -4
%143 = lshr exact i64 %142, 2
%144 = add nuw nsw i64 %143, 1
%145 = and i64 %144, 1
%146 = icmp eq i64 %142, 0
br i1 %146, label %184, label %147
147: ; preds = %140
%148 = and i64 %144, 9223372036854775806
br label %149
149: ; preds = %149, %147
%150 = phi i64 [ 0, %147 ], [ %181, %149 ]
%151 = phi i64 [ 0, %147 ], [ %182, %149 ]
%152 = getelementptr inbounds double, double* %2, i64 %150
%153 = bitcast double* %152 to <2 x double>*
%154 = load <2 x double>, <2 x double>* %153
%155 = getelementptr inbounds double, double* %152, i64 2
%156 = bitcast double* %155 to <2 x double>*
%157 = load <2 x double>, <2 x double>* %156
%158 = fcmp ogt <2 x double> %154, zeroinitializer
%159 = fcmp ogt <2 x double> %157, zeroinitializer
%160 = select <2 x i1> %158, <2 x double> zeroinitializer, <2 x double> %154
%161 = select <2 x i1> %159, <2 x double> zeroinitializer, <2 x double> %157
%162 = getelementptr inbounds double, double* %4, i64 %150
%163 = bitcast double* %162 to <2 x double>*
store <2 x double> %160, <2 x double>* %163
%164 = getelementptr inbounds double, double* %162, i64 2
%165 = bitcast double* %164 to <2 x double>*
store <2 x double> %161, <2 x double>* %165
%166 = or i64 %150, 4
%167 = getelementptr inbounds double, double* %2, i64 %166
%168 = bitcast double* %167 to <2 x double>*
%169 = load <2 x double>, <2 x double>* %168
%170 = getelementptr inbounds double, double* %167, i64 2
%171 = bitcast double* %170 to <2 x double>*
%172 = load <2 x double>, <2 x double>* %171
%173 = fcmp ogt <2 x double> %169, zeroinitializer
%174 = fcmp ogt <2 x double> %172, zeroinitializer
%175 = select <2 x i1> %173, <2 x double> zeroinitializer, <2 x double> %169
%176 = select <2 x i1> %174, <2 x double> zeroinitializer, <2 x double> %172
%177 = getelementptr inbounds double, double* %4, i64 %166
%178 = bitcast double* %177 to <2 x double>*
store <2 x double> %175, <2 x double>* %178
%179 = getelementptr inbounds double, double* %177, i64 2
%180 = bitcast double* %179 to <2 x double>*
store <2 x double> %176, <2 x double>* %180
%181 = add nuw i64 %150, 8
%182 = add i64 %151, 2
%183 = icmp eq i64 %182, %148
br i1 %183, label %184, label %149
184: ; preds = %149, %140
%185 = phi i64 [ 0, %140 ], [ %181, %149 ]
%186 = icmp eq i64 %145, 0
br i1 %186, label %202, label %187
187: ; preds = %184
%188 = getelementptr inbounds double, double* %2, i64 %185
%189 = bitcast double* %188 to <2 x double>*
%190 = load <2 x double>, <2 x double>* %189
%191 = getelementptr inbounds double, double* %188, i64 2
%192 = bitcast double* %191 to <2 x double>*
%193 = load <2 x double>, <2 x double>* %192
%194 = fcmp ogt <2 x double> %190, zeroinitializer
%195 = fcmp ogt <2 x double> %193, zeroinitializer
%196 = select <2 x i1> %194, <2 x double> zeroinitializer, <2 x double> %190
%197 = select <2 x i1> %195, <2 x double> zeroinitializer, <2 x double> %193
%198 = getelementptr inbounds double, double* %4, i64 %185
%199 = bitcast double* %198 to <2 x double>*
store <2 x double> %196, <2 x double>* %199
%200 = getelementptr inbounds double, double* %198, i64 2
%201 = bitcast double* %200 to <2 x double>*
store <2 x double> %197, <2 x double>* %201
br label %202
202: ; preds = %184, %187
%203 = icmp eq i64 %141, %10
br i1 %203, label %251, label %204
204: ; preds = %134, %131, %202
%205 = phi i64 [ 0, %134 ], [ 0, %131 ], [ %141, %202 ]
%206 = xor i64 %205, -1
%207 = add nsw i64 %206, %10
%208 = and i64 %10, 3
%209 = icmp eq i64 %208, 0
br i1 %209, label %221, label %210
210: ; preds = %204, %210
%211 = phi i64 [ %218, %210 ], [ %205, %204 ]
%212 = phi i64 [ %219, %210 ], [ 0, %204 ]
%213 = getelementptr inbounds double, double* %2, i64 %211
%214 = load double, double* %213
%215 = fcmp ogt double %214, 0.000000e+00
%216 = select i1 %215, double 0.000000e+00, double %214
%217 = getelementptr inbounds double, double* %4, i64 %211
store double %216, double* %217
%218 = add nuw nsw i64 %211, 1
%219 = add i64 %212, 1
%220 = icmp eq i64 %219, %208
br i1 %220, label %221, label %210
221: ; preds = %210, %204
%222 = phi i64 [ %205, %204 ], [ %218, %210 ]
%223 = icmp ult i64 %207, 3
br i1 %223, label %251, label %224
224: ; preds = %221, %224
%225 = phi i64 [ %249, %224 ], [ %222, %221 ]
%226 = getelementptr inbounds double, double* %2, i64 %225
%227 = load double, double* %226
%228 = fcmp ogt double %227, 0.000000e+00
%229 = select i1 %228, double 0.000000e+00, double %227
%230 = getelementptr inbounds double, double* %4, i64 %225
store double %229, double* %230
%231 = add nuw nsw i64 %225, 1
%232 = getelementptr inbounds double, double* %2, i64 %231
%233 = load double, double* %232
%234 = fcmp ogt double %233, 0.000000e+00
%235 = select i1 %234, double 0.000000e+00, double %233
%236 = getelementptr inbounds double, double* %4, i64 %231
store double %235, double* %236
%237 = add nuw nsw i64 %225, 2
%238 = getelementptr inbounds double, double* %2, i64 %237
%239 = load double, double* %238
%240 = fcmp ogt double %239, 0.000000e+00
%241 = select i1 %240, double 0.000000e+00, double %239
%242 = getelementptr inbounds double, double* %4, i64 %237
store double %241, double* %242
%243 = add nuw nsw i64 %225, 3
%244 = getelementptr inbounds double, double* %2, i64 %243
%245 = load double, double* %244
%246 = fcmp ogt double %245, 0.000000e+00
%247 = select i1 %246, double 0.000000e+00, double %245
%248 = getelementptr inbounds double, double* %4, i64 %243
store double %247, double* %248
%249 = add nuw nsw i64 %225, 4
%250 = icmp eq i64 %249, %132
br i1 %250, label %251, label %224
251: ; preds = %221, %224, %202, %7, %129
%252 = phi double [ %8, %7 ], [ %130, %129 ], [ %130, %202 ], [ %130, %224 ], [ %130, %221 ]
%253 = tail call double @_logsumexp_sort_kahan_inplace(double* %4, i32 %3)
%254 = fsub double %253, %252
ret double %254
}