; LLVM IR from yuikns/panther :: ann/src/kd_split.ll (Z13sl_fair_splitPPdPiRK11ANNorthRectiiRiRdS5_)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.ANNorthRect = type { ptr, ptr }

declare void @_Z14annMedianSplitPPdPiiiRdi(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

declare noundef double @_Z9annSpreadPPdPiii(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #0

declare void @_Z13annPlaneSplitPPdPiiidRiS2_(ptr noundef, ptr noundef, i32 noundef, i32 noundef, double noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

declare void @_Z9annMinMaxPPdPiiiRdS2_(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #0

declare noundef i32 @_Z15annSplitBalancePPdPiiid(ptr noundef, ptr noundef, i32 noundef, i32 noundef, double noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z13sl_fair_splitPPdPiRK11ANNorthRectiiRiRdS5_(ptr noundef %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %7) #2 {
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca double, align 8
  %28 = alloca double, align 8
  %29 = alloca double, align 8
  %30 = alloca double, align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store i32 %3, ptr %12, align 4, !tbaa !9
  store i32 %4, ptr %13, align 4, !tbaa !9
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  store ptr %7, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  %31 = load ptr, ptr %11, align 8, !tbaa !5
  %32 = getelementptr inbounds %class.ANNorthRect, ptr %31, i32 0, i32 1
  %33 = load ptr, ptr %32, align 8, !tbaa !11
  %34 = getelementptr inbounds double, ptr %33, i64 0
  %35 = load double, ptr %34, align 8, !tbaa !13
  %36 = load ptr, ptr %11, align 8, !tbaa !5
  %37 = getelementptr inbounds %class.ANNorthRect, ptr %36, i32 0, i32 0
  %38 = load ptr, ptr %37, align 8, !tbaa !15
  %39 = getelementptr inbounds double, ptr %38, i64 0
  %40 = load double, ptr %39, align 8, !tbaa !13
  %41 = fsub double %35, %40
  store double %41, ptr %22, align 8, !tbaa !13
  %42 = load ptr, ptr %14, align 8, !tbaa !5
  store i32 0, ptr %42, align 4, !tbaa !9
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %43

43:                                               ; preds = %71, %8
  %44 = load i32, ptr %17, align 4, !tbaa !9
  %45 = load i32, ptr %13, align 4, !tbaa !9
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %47, label %74

47:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  %49 = getelementptr inbounds %class.ANNorthRect, ptr %48, i32 0, i32 1
  %50 = load ptr, ptr %49, align 8, !tbaa !11
  %51 = load i32, ptr %17, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds double, ptr %50, i64 %52
  %54 = load double, ptr %53, align 8, !tbaa !13
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  %56 = getelementptr inbounds %class.ANNorthRect, ptr %55, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8, !tbaa !15
  %58 = load i32, ptr %17, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds double, ptr %57, i64 %59
  %61 = load double, ptr %60, align 8, !tbaa !13
  %62 = fsub double %54, %61
  store double %62, ptr %23, align 8, !tbaa !13
  %63 = load double, ptr %23, align 8, !tbaa !13
  %64 = load double, ptr %22, align 8, !tbaa !13
  %65 = fcmp ogt double %63, %64
  br i1 %65, label %66, label %70

66:                                               ; preds = %47
  %67 = load double, ptr %23, align 8, !tbaa !13
  store double %67, ptr %22, align 8, !tbaa !13
  %68 = load i32, ptr %17, align 4, !tbaa !9
  %69 = load ptr, ptr %14, align 8, !tbaa !5
  store i32 %68, ptr %69, align 4, !tbaa !9
  br label %70

70:                                               ; preds = %66, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  br label %71

71:                                               ; preds = %70
  %72 = load i32, ptr %17, align 4, !tbaa !9
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %17, align 4, !tbaa !9
  br label %43, !llvm.loop !16

74:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  store double 0.000000e+00, ptr %24, align 8, !tbaa !13
  %75 = load ptr, ptr %14, align 8, !tbaa !5
  store i32 0, ptr %75, align 4, !tbaa !9
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %76

76:                                               ; preds = %116, %74
  %77 = load i32, ptr %17, align 4, !tbaa !9
  %78 = load i32, ptr %13, align 4, !tbaa !9
  %79 = icmp slt i32 %77, %78
  br i1 %79, label %80, label %119

80:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #3
  %81 = load ptr, ptr %11, align 8, !tbaa !5
  %82 = getelementptr inbounds %class.ANNorthRect, ptr %81, i32 0, i32 1
  %83 = load ptr, ptr %82, align 8, !tbaa !11
  %84 = load i32, ptr %17, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds double, ptr %83, i64 %85
  %87 = load double, ptr %86, align 8, !tbaa !13
  %88 = load ptr, ptr %11, align 8, !tbaa !5
  %89 = getelementptr inbounds %class.ANNorthRect, ptr %88, i32 0, i32 0
  %90 = load ptr, ptr %89, align 8, !tbaa !15
  %91 = load i32, ptr %17, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds double, ptr %90, i64 %92
  %94 = load double, ptr %93, align 8, !tbaa !13
  %95 = fsub double %87, %94
  store double %95, ptr %25, align 8, !tbaa !13
  %96 = load double, ptr %22, align 8, !tbaa !13
  %97 = fmul double %96, 2.000000e+00
  %98 = load double, ptr %25, align 8, !tbaa !13
  %99 = fdiv double %97, %98
  %100 = fcmp ole double %99, 3.000000e+00
  br i1 %100, label %101, label %115

101:                                              ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #3
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = load ptr, ptr %10, align 8, !tbaa !5
  %104 = load i32, ptr %12, align 4, !tbaa !9
  %105 = load i32, ptr %17, align 4, !tbaa !9
  %106 = call noundef double @_Z9annSpreadPPdPiii(ptr noundef %102, ptr noundef %103, i32 noundef %104, i32 noundef %105)
  store double %106, ptr %26, align 8, !tbaa !13
  %107 = load double, ptr %26, align 8, !tbaa !13
  %108 = load double, ptr %24, align 8, !tbaa !13
  %109 = fcmp ogt double %107, %108
  br i1 %109, label %110, label %114

110:                                              ; preds = %101
  %111 = load double, ptr %26, align 8, !tbaa !13
  store double %111, ptr %24, align 8, !tbaa !13
  %112 = load i32, ptr %17, align 4, !tbaa !9
  %113 = load ptr, ptr %14, align 8, !tbaa !5
  store i32 %112, ptr %113, align 4, !tbaa !9
  br label %114

114:                                              ; preds = %110, %101
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #3
  br label %115

115:                                              ; preds = %114, %80
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #3
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %17, align 4, !tbaa !9
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %17, align 4, !tbaa !9
  br label %76, !llvm.loop !18

119:                                              ; preds = %76
  store double 0.000000e+00, ptr %22, align 8, !tbaa !13
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %120

120:                                              ; preds = %151, %119
  %121 = load i32, ptr %17, align 4, !tbaa !9
  %122 = load i32, ptr %13, align 4, !tbaa !9
  %123 = icmp slt i32 %121, %122
  br i1 %123, label %124, label %154

124:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #3
  %125 = load ptr, ptr %11, align 8, !tbaa !5
  %126 = getelementptr inbounds %class.ANNorthRect, ptr %125, i32 0, i32 1
  %127 = load ptr, ptr %126, align 8, !tbaa !11
  %128 = load i32, ptr %17, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds double, ptr %127, i64 %129
  %131 = load double, ptr %130, align 8, !tbaa !13
  %132 = load ptr, ptr %11, align 8, !tbaa !5
  %133 = getelementptr inbounds %class.ANNorthRect, ptr %132, i32 0, i32 0
  %134 = load ptr, ptr %133, align 8, !tbaa !15
  %135 = load i32, ptr %17, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds double, ptr %134, i64 %136
  %138 = load double, ptr %137, align 8, !tbaa !13
  %139 = fsub double %131, %138
  store double %139, ptr %27, align 8, !tbaa !13
  %140 = load i32, ptr %17, align 4, !tbaa !9
  %141 = load ptr, ptr %14, align 8, !tbaa !5
  %142 = load i32, ptr %141, align 4, !tbaa !9
  %143 = icmp ne i32 %140, %142
  br i1 %143, label %144, label %150

144:                                              ; preds = %124
  %145 = load double, ptr %27, align 8, !tbaa !13
  %146 = load double, ptr %22, align 8, !tbaa !13
  %147 = fcmp ogt double %145, %146
  br i1 %147, label %148, label %150

148:                                              ; preds = %144
  %149 = load double, ptr %27, align 8, !tbaa !13
  store double %149, ptr %22, align 8, !tbaa !13
  br label %150

150:                                              ; preds = %148, %144, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #3
  br label %151

151:                                              ; preds = %150
  %152 = load i32, ptr %17, align 4, !tbaa !9
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %17, align 4, !tbaa !9
  br label %120, !llvm.loop !19

154:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #3
  %155 = load double, ptr %22, align 8, !tbaa !13
  %156 = fdiv double %155, 3.000000e+00
  store double %156, ptr %28, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #3
  %157 = load ptr, ptr %11, align 8, !tbaa !5
  %158 = getelementptr inbounds %class.ANNorthRect, ptr %157, i32 0, i32 0
  %159 = load ptr, ptr %158, align 8, !tbaa !15
  %160 = load ptr, ptr %14, align 8, !tbaa !5
  %161 = load i32, ptr %160, align 4, !tbaa !9
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds double, ptr %159, i64 %162
  %164 = load double, ptr %163, align 8, !tbaa !13
  %165 = load double, ptr %28, align 8, !tbaa !13
  %166 = fadd double %164, %165
  store double %166, ptr %29, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #3
  %167 = load ptr, ptr %11, align 8, !tbaa !5
  %168 = getelementptr inbounds %class.ANNorthRect, ptr %167, i32 0, i32 1
  %169 = load ptr, ptr %168, align 8, !tbaa !11
  %170 = load ptr, ptr %14, align 8, !tbaa !5
  %171 = load i32, ptr %170, align 4, !tbaa !9
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds double, ptr %169, i64 %172
  %174 = load double, ptr %173, align 8, !tbaa !13
  %175 = load double, ptr %28, align 8, !tbaa !13
  %176 = fsub double %174, %175
  store double %176, ptr %30, align 8, !tbaa !13
  %177 = load ptr, ptr %9, align 8, !tbaa !5
  %178 = load ptr, ptr %10, align 8, !tbaa !5
  %179 = load i32, ptr %12, align 4, !tbaa !9
  %180 = load ptr, ptr %14, align 8, !tbaa !5
  %181 = load i32, ptr %180, align 4, !tbaa !9
  call void @_Z9annMinMaxPPdPiiiRdS2_(ptr noundef %177, ptr noundef %178, i32 noundef %179, i32 noundef %181, ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19)
  %182 = load ptr, ptr %9, align 8, !tbaa !5
  %183 = load ptr, ptr %10, align 8, !tbaa !5
  %184 = load i32, ptr %12, align 4, !tbaa !9
  %185 = load ptr, ptr %14, align 8, !tbaa !5
  %186 = load i32, ptr %185, align 4, !tbaa !9
  %187 = load double, ptr %29, align 8, !tbaa !13
  %188 = call noundef i32 @_Z15annSplitBalancePPdPiiid(ptr noundef %182, ptr noundef %183, i32 noundef %184, i32 noundef %186, double noundef %187)
  %189 = icmp sge i32 %188, 0
  br i1 %189, label %190, label %220

190:                                              ; preds = %154
  %191 = load double, ptr %19, align 8, !tbaa !13
  %192 = load double, ptr %29, align 8, !tbaa !13
  %193 = fcmp ogt double %191, %192
  br i1 %193, label %194, label %206

194:                                              ; preds = %190
  %195 = load double, ptr %29, align 8, !tbaa !13
  %196 = load ptr, ptr %15, align 8, !tbaa !5
  store double %195, ptr %196, align 8, !tbaa !13
  %197 = load ptr, ptr %9, align 8, !tbaa !5
  %198 = load ptr, ptr %10, align 8, !tbaa !5
  %199 = load i32, ptr %12, align 4, !tbaa !9
  %200 = load ptr, ptr %14, align 8, !tbaa !5
  %201 = load i32, ptr %200, align 4, !tbaa !9
  %202 = load ptr, ptr %15, align 8, !tbaa !5
  %203 = load double, ptr %202, align 8, !tbaa !13
  call void @_Z13annPlaneSplitPPdPiiidRiS2_(ptr noundef %197, ptr noundef %198, i32 noundef %199, i32 noundef %201, double noundef %203, ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %21)
  %204 = load i32, ptr %20, align 4, !tbaa !9
  %205 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 %204, ptr %205, align 4, !tbaa !9
  br label %219

206:                                              ; preds = %190
  %207 = load double, ptr %19, align 8, !tbaa !13
  %208 = load ptr, ptr %15, align 8, !tbaa !5
  store double %207, ptr %208, align 8, !tbaa !13
  %209 = load ptr, ptr %9, align 8, !tbaa !5
  %210 = load ptr, ptr %10, align 8, !tbaa !5
  %211 = load i32, ptr %12, align 4, !tbaa !9
  %212 = load ptr, ptr %14, align 8, !tbaa !5
  %213 = load i32, ptr %212, align 4, !tbaa !9
  %214 = load ptr, ptr %15, align 8, !tbaa !5
  %215 = load double, ptr %214, align 8, !tbaa !13
  call void @_Z13annPlaneSplitPPdPiiidRiS2_(ptr noundef %209, ptr noundef %210, i32 noundef %211, i32 noundef %213, double noundef %215, ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %21)
  %216 = load i32, ptr %12, align 4, !tbaa !9
  %217 = sub nsw i32 %216, 1
  %218 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 %217, ptr %218, align 4, !tbaa !9
  br label %219

219:                                              ; preds = %206, %194
  br label %270

220:                                              ; preds = %154
  %221 = load ptr, ptr %9, align 8, !tbaa !5
  %222 = load ptr, ptr %10, align 8, !tbaa !5
  %223 = load i32, ptr %12, align 4, !tbaa !9
  %224 = load ptr, ptr %14, align 8, !tbaa !5
  %225 = load i32, ptr %224, align 4, !tbaa !9
  %226 = load double, ptr %30, align 8, !tbaa !13
  %227 = call noundef i32 @_Z15annSplitBalancePPdPiiid(ptr noundef %221, ptr noundef %222, i32 noundef %223, i32 noundef %225, double noundef %226)
  %228 = icmp sle i32 %227, 0
  br i1 %228, label %229, label %257

229:                                              ; preds = %220
  %230 = load double, ptr %18, align 8, !tbaa !13
  %231 = load double, ptr %30, align 8, !tbaa !13
  %232 = fcmp olt double %230, %231
  br i1 %232, label %233, label %245

233:                                              ; preds = %229
  %234 = load double, ptr %30, align 8, !tbaa !13
  %235 = load ptr, ptr %15, align 8, !tbaa !5
  store double %234, ptr %235, align 8, !tbaa !13
  %236 = load ptr, ptr %9, align 8, !tbaa !5
  %237 = load ptr, ptr %10, align 8, !tbaa !5
  %238 = load i32, ptr %12, align 4, !tbaa !9
  %239 = load ptr, ptr %14, align 8, !tbaa !5
  %240 = load i32, ptr %239, align 4, !tbaa !9
  %241 = load ptr, ptr %15, align 8, !tbaa !5
  %242 = load double, ptr %241, align 8, !tbaa !13
  call void @_Z13annPlaneSplitPPdPiiidRiS2_(ptr noundef %236, ptr noundef %237, i32 noundef %238, i32 noundef %240, double noundef %242, ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %21)
  %243 = load i32, ptr %21, align 4, !tbaa !9
  %244 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 %243, ptr %244, align 4, !tbaa !9
  br label %256

245:                                              ; preds = %229
  %246 = load double, ptr %18, align 8, !tbaa !13
  %247 = load ptr, ptr %15, align 8, !tbaa !5
  store double %246, ptr %247, align 8, !tbaa !13
  %248 = load ptr, ptr %9, align 8, !tbaa !5
  %249 = load ptr, ptr %10, align 8, !tbaa !5
  %250 = load i32, ptr %12, align 4, !tbaa !9
  %251 = load ptr, ptr %14, align 8, !tbaa !5
  %252 = load i32, ptr %251, align 4, !tbaa !9
  %253 = load ptr, ptr %15, align 8, !tbaa !5
  %254 = load double, ptr %253, align 8, !tbaa !13
  call void @_Z13annPlaneSplitPPdPiiidRiS2_(ptr noundef %248, ptr noundef %249, i32 noundef %250, i32 noundef %252, double noundef %254, ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %21)
  %255 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 1, ptr %255, align 4, !tbaa !9
  br label %256

256:                                              ; preds = %245, %233
  br label %269

257:                                              ; preds = %220
  %258 = load i32, ptr %12, align 4, !tbaa !9
  %259 = sdiv i32 %258, 2
  %260 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 %259, ptr %260, align 4, !tbaa !9
  %261 = load ptr, ptr %9, align 8, !tbaa !5
  %262 = load ptr, ptr %10, align 8, !tbaa !5
  %263 = load i32, ptr %12, align 4, !tbaa !9
  %264 = load ptr, ptr %14, align 8, !tbaa !5
  %265 = load i32, ptr %264, align 4, !tbaa !9
  %266 = load ptr, ptr %15, align 8, !tbaa !5
  %267 = load ptr, ptr %16, align 8, !tbaa !5
  %268 = load i32, ptr %267, align 4, !tbaa !9
  call void @_Z14annMedianSplitPPdPiiiRdi(ptr noundef %261, ptr noundef %262, i32 noundef %263, i32 noundef %265, ptr noundef nonnull align 8 dereferenceable(8) %266, i32 noundef %268)
  br label %269

269:                                              ; preds = %257, %256
  br label %270

270:                                              ; preds = %269, %219
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  ret void
}

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"_ZTS11ANNorthRect", !6, i64 0, !6, i64 8}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!12, !6, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = distinct !{!19, !17}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

declare void @_Z14annMedianSplitPPdPiiiRdi(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

declare noundef double @_Z9annSpreadPPdPiii(ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

declare void @_Z13annPlaneSplitPPdPiiidRiS2_(ptr noundef, ptr noundef, i32 noundef, i32 noundef, double noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

declare void @_Z9annMinMaxPPdPiiiRdS2_(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0

declare noundef i32 @_Z15annSplitBalancePPdPiiid(ptr noundef, ptr noundef, i32 noundef, i32 noundef, double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z13sl_fair_splitPPdPiRK11ANNorthRectiiRiRdS5_(ptr noundef %0, ptr noundef %1, ptr nocapture noundef nonnull readonly align 8 dereferenceable(16) %2, i32 noundef %3, i32 noundef %4, ptr nocapture noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr nocapture noundef nonnull writeonly align 4 dereferenceable(4) %7) local_unnamed_addr #2 {
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #3
  %13 = getelementptr inbounds i8, ptr %2, i64 8
  %14 = load ptr, ptr %13, align 8, !tbaa !5
  %15 = load double, ptr %14, align 8, !tbaa !10
  %16 = load ptr, ptr %2, align 8, !tbaa !12
  %17 = load double, ptr %16, align 8, !tbaa !10
  %18 = fsub double %15, %17
  %19 = icmp sgt i32 %4, 1
  br i1 %19, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %8
  %wide.trip.count = zext nneg i32 %4 to i64
  %20 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %20, 1
  %21 = icmp eq i32 %4, 2
  br i1 %21, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %20, -2
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %.lr.ph ]
  %.0107121 = phi double [ %18, %.lr.ph.preheader.new ], [ %.1108.1, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %22 = getelementptr inbounds double, ptr %14, i64 %indvars.iv
  %23 = load double, ptr %22, align 8, !tbaa !10
  %24 = getelementptr inbounds double, ptr %16, i64 %indvars.iv
  %25 = load double, ptr %24, align 8, !tbaa !10
  %26 = fsub double %23, %25
  %27 = fcmp ogt double %26, %.0107121
  %.1108 = select i1 %27, double %26, double %.0107121
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %28 = getelementptr inbounds double, ptr %14, i64 %indvars.iv.next
  %29 = load double, ptr %28, align 8, !tbaa !10
  %30 = getelementptr inbounds double, ptr %16, i64 %indvars.iv.next
  %31 = load double, ptr %30, align 8, !tbaa !10
  %32 = fsub double %29, %31
  %33 = fcmp ogt double %32, %.1108
  %.1108.1 = select i1 %33, double %32, double %.1108
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !13

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph, %.lr.ph.preheader
  %.1108.lcssa.ph = phi double [ poison, %.lr.ph.preheader ], [ %.1108.1, %.lr.ph ]
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next.1, %.lr.ph ]
  %.0107121.unr = phi double [ %18, %.lr.ph.preheader ], [ %.1108.1, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.loopexit.unr-lcssa
  %34 = getelementptr inbounds double, ptr %14, i64 %indvars.iv.unr
  %35 = load double, ptr %34, align 8, !tbaa !10
  %36 = getelementptr inbounds double, ptr %16, i64 %indvars.iv.unr
  %37 = load double, ptr %36, align 8, !tbaa !10
  %38 = fsub double %35, %37
  %39 = fcmp ogt double %38, %.0107121.unr
  %.1108.epil = select i1 %39, double %38, double %.0107121.unr
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.epil, %._crit_edge.loopexit.unr-lcssa, %8
  %.0107.lcssa = phi double [ %18, %8 ], [ %.1108.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %.1108.epil, %.lr.ph.epil ]
  store i32 0, ptr %5, align 4, !tbaa !15
  %40 = icmp sgt i32 %4, 0
  br i1 %40, label %.lr.ph126, label %._crit_edge130

.lr.ph126:                                        ; preds = %._crit_edge
  %41 = fmul double %.0107.lcssa, 2.000000e+00
  %wide.trip.count136 = zext nneg i32 %4 to i64
  br label %44

.preheader:                                       ; preds = %59
  %.pre.pre = load ptr, ptr %2, align 8, !tbaa !12
  %.pre143.pre = load i32, ptr %5, align 4, !tbaa !15
  %.pre144.pre = load ptr, ptr %13, align 8, !tbaa !5
  br i1 %40, label %.lr.ph129, label %._crit_edge130

.lr.ph129:                                        ; preds = %.preheader
  %42 = zext i32 %.pre143.pre to i64
  %wide.trip.count141 = zext nneg i32 %4 to i64
  %xtraiter155 = and i64 %wide.trip.count141, 1
  %43 = icmp eq i32 %4, 1
  br i1 %43, label %._crit_edge130.loopexit.unr-lcssa, label %.lr.ph129.new

.lr.ph129.new:                                    ; preds = %.lr.ph129
  %unroll_iter158 = and i64 %wide.trip.count141, 2147483646
  br label %60

44:                                               ; preds = %.lr.ph126, %59
  %indvars.iv133 = phi i64 [ 0, %.lr.ph126 ], [ %indvars.iv.next134, %59 ]
  %.0110123 = phi double [ 0.000000e+00, %.lr.ph126 ], [ %.2112, %59 ]
  %45 = load ptr, ptr %13, align 8, !tbaa !5
  %46 = getelementptr inbounds double, ptr %45, i64 %indvars.iv133
  %47 = load double, ptr %46, align 8, !tbaa !10
  %48 = load ptr, ptr %2, align 8, !tbaa !12
  %49 = getelementptr inbounds double, ptr %48, i64 %indvars.iv133
  %50 = load double, ptr %49, align 8, !tbaa !10
  %51 = fsub double %47, %50
  %52 = fdiv double %41, %51
  %53 = fcmp ugt double %52, 3.000000e+00
  br i1 %53, label %59, label %54

54:                                               ; preds = %44
  %55 = trunc nuw nsw i64 %indvars.iv133 to i32
  %56 = tail call noundef double @_Z9annSpreadPPdPiii(ptr noundef %0, ptr noundef %1, i32 noundef %3, i32 noundef %55)
  %57 = fcmp ogt double %56, %.0110123
  br i1 %57, label %58, label %59

58:                                               ; preds = %54
  store i32 %55, ptr %5, align 4, !tbaa !15
  br label %59

59:                                               ; preds = %54, %58, %44
  %.2112 = phi double [ %.0110123, %44 ], [ %56, %58 ], [ %.0110123, %54 ]
  %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
  %exitcond137.not = icmp eq i64 %indvars.iv.next134, %wide.trip.count136
  br i1 %exitcond137.not, label %.preheader, label %44, !llvm.loop !17

60:                                               ; preds = %60, %.lr.ph129.new
  %indvars.iv138 = phi i64 [ 0, %.lr.ph129.new ], [ %indvars.iv.next139.1, %60 ]
  %.2109127 = phi double [ 0.000000e+00, %.lr.ph129.new ], [ %.3.1, %60 ]
  %niter159 = phi i64 [ 0, %.lr.ph129.new ], [ %niter159.next.1, %60 ]
  %61 = getelementptr inbounds double, ptr %.pre144.pre, i64 %indvars.iv138
  %62 = load double, ptr %61, align 8, !tbaa !10
  %63 = getelementptr inbounds double, ptr %.pre.pre, i64 %indvars.iv138
  %64 = load double, ptr %63, align 8, !tbaa !10
  %65 = fsub double %62, %64
  %.not = icmp ne i64 %indvars.iv138, %42
  %66 = fcmp ogt double %65, %.2109127
  %or.cond = select i1 %.not, i1 %66, i1 false
  %.3 = select i1 %or.cond, double %65, double %.2109127
  %indvars.iv.next139 = or disjoint i64 %indvars.iv138, 1
  %67 = getelementptr inbounds double, ptr %.pre144.pre, i64 %indvars.iv.next139
  %68 = load double, ptr %67, align 8, !tbaa !10
  %69 = getelementptr inbounds double, ptr %.pre.pre, i64 %indvars.iv.next139
  %70 = load double, ptr %69, align 8, !tbaa !10
  %71 = fsub double %68, %70
  %.not.1 = icmp ne i64 %indvars.iv.next139, %42
  %72 = fcmp ogt double %71, %.3
  %or.cond.1 = select i1 %.not.1, i1 %72, i1 false
  %.3.1 = select i1 %or.cond.1, double %71, double %.3
  %indvars.iv.next139.1 = add nuw nsw i64 %indvars.iv138, 2
  %niter159.next.1 = add i64 %niter159, 2
  %niter159.ncmp.1 = icmp eq i64 %niter159.next.1, %unroll_iter158
  br i1 %niter159.ncmp.1, label %._crit_edge130.loopexit.unr-lcssa, label %60, !llvm.loop !18

._crit_edge130.loopexit.unr-lcssa:                ; preds = %60, %.lr.ph129
  %.3.lcssa.ph = phi double [ poison, %.lr.ph129 ], [ %.3.1, %60 ]
  %indvars.iv138.unr = phi i64 [ 0, %.lr.ph129 ], [ %indvars.iv.next139.1, %60 ]
  %.2109127.unr = phi double [ 0.000000e+00, %.lr.ph129 ], [ %.3.1, %60 ]
  %lcmp.mod156.not = icmp eq i64 %xtraiter155, 0
  br i1 %lcmp.mod156.not, label %._crit_edge130, label %._crit_edge130.loopexit.epilog-lcssa

._crit_edge130.loopexit.epilog-lcssa:             ; preds = %._crit_edge130.loopexit.unr-lcssa
  %73 = getelementptr inbounds double, ptr %.pre144.pre, i64 %indvars.iv138.unr
  %74 = load double, ptr %73, align 8, !tbaa !10
  %75 = getelementptr inbounds double, ptr %.pre.pre, i64 %indvars.iv138.unr
  %76 = load double, ptr %75, align 8, !tbaa !10
  %77 = fsub double %74, %76
  %.not.epil = icmp ne i64 %indvars.iv138.unr, %42
  %78 = fcmp ogt double %77, %.2109127.unr
  %or.cond.epil = select i1 %.not.epil, i1 %78, i1 false
  %.3.epil = select i1 %or.cond.epil, double %77, double %.2109127.unr
  br label %._crit_edge130

._crit_edge130:                                   ; preds = %._crit_edge130.loopexit.epilog-lcssa, %._crit_edge130.loopexit.unr-lcssa, %._crit_edge, %.preheader
  %.pre153 = phi ptr [ %.pre.pre, %.preheader ], [ %16, %._crit_edge ], [ %.pre.pre, %._crit_edge130.loopexit.unr-lcssa ], [ %.pre.pre, %._crit_edge130.loopexit.epilog-lcssa ]
  %.pre143152 = phi i32 [ %.pre143.pre, %.preheader ], [ 0, %._crit_edge ], [ %.pre143.pre, %._crit_edge130.loopexit.unr-lcssa ], [ %.pre143.pre, %._crit_edge130.loopexit.epilog-lcssa ]
  %.pre144151 = phi ptr [ %.pre144.pre, %.preheader ], [ %14, %._crit_edge ], [ %.pre144.pre, %._crit_edge130.loopexit.unr-lcssa ], [ %.pre144.pre, %._crit_edge130.loopexit.epilog-lcssa ]
  %.2109.lcssa = phi double [ 0.000000e+00, %.preheader ], [ 0.000000e+00, %._crit_edge ], [ %.3.lcssa.ph, %._crit_edge130.loopexit.unr-lcssa ], [ %.3.epil, %._crit_edge130.loopexit.epilog-lcssa ]
  %79 = fdiv double %.2109.lcssa, 3.000000e+00
  %80 = sext i32 %.pre143152 to i64
  %81 = getelementptr inbounds double, ptr %.pre153, i64 %80
  %82 = load double, ptr %81, align 8, !tbaa !10
  %83 = fadd double %79, %82
  %84 = getelementptr inbounds double, ptr %.pre144151, i64 %80
  %85 = load double, ptr %84, align 8, !tbaa !10
  %86 = fsub double %85, %79
  call void @_Z9annMinMaxPPdPiiiRdS2_(ptr noundef %0, ptr noundef %1, i32 noundef %3, i32 noundef %.pre143152, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %87 = load i32, ptr %5, align 4, !tbaa !15
  %88 = call noundef i32 @_Z15annSplitBalancePPdPiiid(ptr noundef %0, ptr noundef %1, i32 noundef %3, i32 noundef %87, double noundef %83)
  %89 = icmp sgt i32 %88, -1
  br i1 %89, label %90, label %99

90:                                               ; preds = %._crit_edge130
  %91 = load double, ptr %10, align 8, !tbaa !10
  %92 = fcmp ogt double %91, %83
  br i1 %92, label %93, label %96

93:                                               ; preds = %90
  store double %83, ptr %6, align 8, !tbaa !10
  %94 = load i32, ptr %5, align 4, !tbaa !15
  call void @_Z13annPlaneSplitPPdPiiidRiS2_(ptr noundef %0, ptr noundef %1, i32 noundef %3, i32 noundef %94, double noundef %83, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %95 = load i32, ptr %11, align 4, !tbaa !15
  store i32 %95, ptr %7, align 4, !tbaa !15
  br label %114

96:                                               ; preds = %90
  store double %91, ptr %6, align 8, !tbaa !10
  %97 = load i32, ptr %5, align 4, !tbaa !15
  call void @_Z13annPlaneSplitPPdPiiidRiS2_(ptr noundef %0, ptr noundef %1, i32 noundef %3, i32 noundef %97, double noundef %91, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %98 = add nsw i32 %3, -1
  store i32 %98, ptr %7, align 4, !tbaa !15
  br label %114

99:                                               ; preds = %._crit_edge130
  %100 = load i32, ptr %5, align 4, !tbaa !15
  %101 = call noundef i32 @_Z15annSplitBalancePPdPiiid(ptr noundef %0, ptr noundef %1, i32 noundef %3, i32 noundef %100, double noundef %86)
  %102 = icmp slt i32 %101, 1
  br i1 %102, label %103, label %111

103:                                              ; preds = %99
  %104 = load double, ptr %9, align 8, !tbaa !10
  %105 = fcmp olt double %104, %86
  br i1 %105, label %106, label %109

106:                                              ; preds = %103
  store double %86, ptr %6, align 8, !tbaa !10
  %107 = load i32, ptr %5, align 4, !tbaa !15
  call void @_Z13annPlaneSplitPPdPiiidRiS2_(ptr noundef %0, ptr noundef %1, i32 noundef %3, i32 noundef %107, double noundef %86, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %108 = load i32, ptr %12, align 4, !tbaa !15
  store i32 %108, ptr %7, align 4, !tbaa !15
  br label %114

109:                                              ; preds = %103
  store double %104, ptr %6, align 8, !tbaa !10
  %110 = load i32, ptr %5, align 4, !tbaa !15
  call void @_Z13annPlaneSplitPPdPiiidRiS2_(ptr noundef %0, ptr noundef %1, i32 noundef %3, i32 noundef %110, double noundef %104, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  store i32 1, ptr %7, align 4, !tbaa !15
  br label %114

111:                                              ; preds = %99
  %112 = sdiv i32 %3, 2
  store i32 %112, ptr %7, align 4, !tbaa !15
  %113 = load i32, ptr %5, align 4, !tbaa !15
  call void @_Z14annMedianSplitPPdPiiiRdi(ptr noundef %0, ptr noundef %1, i32 noundef %3, i32 noundef %113, ptr noundef nonnull align 8 dereferenceable(8) %6, i32 noundef %112)
  br label %114

114:                                              ; preds = %111, %109, %106, %93, %96
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  ret void
}

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 8}
!6 = !{!"_ZTS11ANNorthRect", !7, i64 0, !7, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = !{!6, !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !8, i64 0}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass