; LLVM IR from yuikns/panther :: ann/src/kd_split.ll (Z14sl_midpt_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 }

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

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

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

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)) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z14sl_midpt_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 double, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  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
  %27 = load ptr, ptr %11, align 8, !tbaa !5
  %28 = getelementptr inbounds %class.ANNorthRect, ptr %27, i32 0, i32 1
  %29 = load ptr, ptr %28, align 8, !tbaa !11
  %30 = getelementptr inbounds double, ptr %29, i64 0
  %31 = load double, ptr %30, align 8, !tbaa !13
  %32 = load ptr, ptr %11, align 8, !tbaa !5
  %33 = getelementptr inbounds %class.ANNorthRect, ptr %32, i32 0, i32 0
  %34 = load ptr, ptr %33, align 8, !tbaa !15
  %35 = getelementptr inbounds double, ptr %34, i64 0
  %36 = load double, ptr %35, align 8, !tbaa !13
  %37 = fsub double %31, %36
  store double %37, ptr %18, align 8, !tbaa !13
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %38

38:                                               ; preds = %64, %8
  %39 = load i32, ptr %17, align 4, !tbaa !9
  %40 = load i32, ptr %13, align 4, !tbaa !9
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %42, label %67

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

61:                                               ; preds = %42
  %62 = load double, ptr %19, align 8, !tbaa !13
  store double %62, ptr %18, align 8, !tbaa !13
  br label %63

63:                                               ; preds = %61, %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  br label %64

64:                                               ; preds = %63
  %65 = load i32, ptr %17, align 4, !tbaa !9
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %17, align 4, !tbaa !9
  br label %38, !llvm.loop !16

67:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  store double -1.000000e+00, ptr %20, align 8, !tbaa !13
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %106, %67
  %69 = load i32, ptr %17, align 4, !tbaa !9
  %70 = load i32, ptr %13, align 4, !tbaa !9
  %71 = icmp slt i32 %69, %70
  br i1 %71, label %72, label %109

72:                                               ; preds = %68
  %73 = load ptr, ptr %11, align 8, !tbaa !5
  %74 = getelementptr inbounds %class.ANNorthRect, ptr %73, i32 0, i32 1
  %75 = load ptr, ptr %74, align 8, !tbaa !11
  %76 = load i32, ptr %17, align 4, !tbaa !9
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds double, ptr %75, i64 %77
  %79 = load double, ptr %78, align 8, !tbaa !13
  %80 = load ptr, ptr %11, align 8, !tbaa !5
  %81 = getelementptr inbounds %class.ANNorthRect, ptr %80, i32 0, i32 0
  %82 = load ptr, ptr %81, align 8, !tbaa !15
  %83 = load i32, ptr %17, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds double, ptr %82, i64 %84
  %86 = load double, ptr %85, align 8, !tbaa !13
  %87 = fsub double %79, %86
  %88 = load double, ptr %18, align 8, !tbaa !13
  %89 = fmul double 0x3FEFF7CED916872B, %88
  %90 = fcmp oge double %87, %89
  br i1 %90, label %91, label %105

91:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = load ptr, ptr %10, align 8, !tbaa !5
  %94 = load i32, ptr %12, align 4, !tbaa !9
  %95 = load i32, ptr %17, align 4, !tbaa !9
  %96 = call noundef double @_Z9annSpreadPPdPiii(ptr noundef %92, ptr noundef %93, i32 noundef %94, i32 noundef %95)
  store double %96, ptr %21, align 8, !tbaa !13
  %97 = load double, ptr %21, align 8, !tbaa !13
  %98 = load double, ptr %20, align 8, !tbaa !13
  %99 = fcmp ogt double %97, %98
  br i1 %99, label %100, label %104

100:                                              ; preds = %91
  %101 = load double, ptr %21, align 8, !tbaa !13
  store double %101, ptr %20, align 8, !tbaa !13
  %102 = load i32, ptr %17, align 4, !tbaa !9
  %103 = load ptr, ptr %14, align 8, !tbaa !5
  store i32 %102, ptr %103, align 4, !tbaa !9
  br label %104

104:                                              ; preds = %100, %91
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  br label %105

105:                                              ; preds = %104, %72
  br label %106

106:                                              ; preds = %105
  %107 = load i32, ptr %17, align 4, !tbaa !9
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %17, align 4, !tbaa !9
  br label %68, !llvm.loop !18

109:                                              ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  %110 = load ptr, ptr %11, align 8, !tbaa !5
  %111 = getelementptr inbounds %class.ANNorthRect, ptr %110, i32 0, i32 0
  %112 = load ptr, ptr %111, align 8, !tbaa !15
  %113 = load ptr, ptr %14, align 8, !tbaa !5
  %114 = load i32, ptr %113, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds double, ptr %112, i64 %115
  %117 = load double, ptr %116, align 8, !tbaa !13
  %118 = load ptr, ptr %11, align 8, !tbaa !5
  %119 = getelementptr inbounds %class.ANNorthRect, ptr %118, i32 0, i32 1
  %120 = load ptr, ptr %119, align 8, !tbaa !11
  %121 = load ptr, ptr %14, align 8, !tbaa !5
  %122 = load i32, ptr %121, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds double, ptr %120, i64 %123
  %125 = load double, ptr %124, align 8, !tbaa !13
  %126 = fadd double %117, %125
  %127 = fdiv double %126, 2.000000e+00
  store double %127, ptr %22, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  %128 = load ptr, ptr %9, align 8, !tbaa !5
  %129 = load ptr, ptr %10, align 8, !tbaa !5
  %130 = load i32, ptr %12, align 4, !tbaa !9
  %131 = load ptr, ptr %14, align 8, !tbaa !5
  %132 = load i32, ptr %131, align 4, !tbaa !9
  call void @_Z9annMinMaxPPdPiiiRdS2_(ptr noundef %128, ptr noundef %129, i32 noundef %130, i32 noundef %132, ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(8) %24)
  %133 = load double, ptr %22, align 8, !tbaa !13
  %134 = load double, ptr %23, align 8, !tbaa !13
  %135 = fcmp olt double %133, %134
  br i1 %135, label %136, label %139

136:                                              ; preds = %109
  %137 = load double, ptr %23, align 8, !tbaa !13
  %138 = load ptr, ptr %15, align 8, !tbaa !5
  store double %137, ptr %138, align 8, !tbaa !13
  br label %150

139:                                              ; preds = %109
  %140 = load double, ptr %22, align 8, !tbaa !13
  %141 = load double, ptr %24, align 8, !tbaa !13
  %142 = fcmp ogt double %140, %141
  br i1 %142, label %143, label %146

143:                                              ; preds = %139
  %144 = load double, ptr %24, align 8, !tbaa !13
  %145 = load ptr, ptr %15, align 8, !tbaa !5
  store double %144, ptr %145, align 8, !tbaa !13
  br label %149

146:                                              ; preds = %139
  %147 = load double, ptr %22, align 8, !tbaa !13
  %148 = load ptr, ptr %15, align 8, !tbaa !5
  store double %147, ptr %148, align 8, !tbaa !13
  br label %149

149:                                              ; preds = %146, %143
  br label %150

150:                                              ; preds = %149, %136
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #3
  %151 = load ptr, ptr %9, align 8, !tbaa !5
  %152 = load ptr, ptr %10, align 8, !tbaa !5
  %153 = load i32, ptr %12, align 4, !tbaa !9
  %154 = load ptr, ptr %14, align 8, !tbaa !5
  %155 = load i32, ptr %154, align 4, !tbaa !9
  %156 = load ptr, ptr %15, align 8, !tbaa !5
  %157 = load double, ptr %156, align 8, !tbaa !13
  call void @_Z13annPlaneSplitPPdPiiidRiS2_(ptr noundef %151, ptr noundef %152, i32 noundef %153, i32 noundef %155, double noundef %157, ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 4 dereferenceable(4) %26)
  %158 = load double, ptr %22, align 8, !tbaa !13
  %159 = load double, ptr %23, align 8, !tbaa !13
  %160 = fcmp olt double %158, %159
  br i1 %160, label %161, label %163

161:                                              ; preds = %150
  %162 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 1, ptr %162, align 4, !tbaa !9
  br label %194

163:                                              ; preds = %150
  %164 = load double, ptr %22, align 8, !tbaa !13
  %165 = load double, ptr %24, align 8, !tbaa !13
  %166 = fcmp ogt double %164, %165
  br i1 %166, label %167, label %171

167:                                              ; preds = %163
  %168 = load i32, ptr %12, align 4, !tbaa !9
  %169 = sub nsw i32 %168, 1
  %170 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 %169, ptr %170, align 4, !tbaa !9
  br label %193

171:                                              ; preds = %163
  %172 = load i32, ptr %25, align 4, !tbaa !9
  %173 = load i32, ptr %12, align 4, !tbaa !9
  %174 = sdiv i32 %173, 2
  %175 = icmp sgt i32 %172, %174
  br i1 %175, label %176, label %179

176:                                              ; preds = %171
  %177 = load i32, ptr %25, align 4, !tbaa !9
  %178 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 %177, ptr %178, align 4, !tbaa !9
  br label %192

179:                                              ; preds = %171
  %180 = load i32, ptr %26, align 4, !tbaa !9
  %181 = load i32, ptr %12, align 4, !tbaa !9
  %182 = sdiv i32 %181, 2
  %183 = icmp slt i32 %180, %182
  br i1 %183, label %184, label %187

184:                                              ; preds = %179
  %185 = load i32, ptr %26, align 4, !tbaa !9
  %186 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 %185, ptr %186, align 4, !tbaa !9
  br label %191

187:                                              ; preds = %179
  %188 = load i32, ptr %12, align 4, !tbaa !9
  %189 = sdiv i32 %188, 2
  %190 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 %189, ptr %190, align 4, !tbaa !9
  br label %191

191:                                              ; preds = %187, %184
  br label %192

192:                                              ; preds = %191, %176
  br label %193

193:                                              ; preds = %192, %167
  br label %194

194:                                              ; preds = %193, %161
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #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
}

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)) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 #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}


; 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"

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

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

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

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 #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z14sl_midpt_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 nocapture noundef nonnull writeonly 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
  %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 %.preheader

.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 %.preheader.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

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

.lr.ph.epil:                                      ; preds = %.preheader.loopexit.unr-lcssa
  %22 = getelementptr inbounds double, ptr %14, i64 %indvars.iv.unr
  %23 = load double, ptr %22, align 8, !tbaa !10
  %24 = getelementptr inbounds double, ptr %16, i64 %indvars.iv.unr
  %25 = load double, ptr %24, align 8, !tbaa !10
  %26 = fsub double %23, %25
  %27 = fcmp ogt double %26, %.05872.unr
  %.159.epil = select i1 %27, double %26, double %.05872.unr
  br label %.preheader

.preheader:                                       ; preds = %.lr.ph.epil, %.preheader.loopexit.unr-lcssa, %8
  %.058.lcssa = phi double [ %18, %8 ], [ %.159.lcssa.ph, %.preheader.loopexit.unr-lcssa ], [ %.159.epil, %.lr.ph.epil ]
  %28 = icmp sgt i32 %4, 0
  br i1 %28, label %.lr.ph76, label %._crit_edge

.lr.ph76:                                         ; preds = %.preheader
  %29 = fmul double %.058.lcssa, 0x3FEFF7CED916872B
  %wide.trip.count81 = zext nneg i32 %4 to i64
  br label %42

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %.lr.ph ]
  %.05872 = phi double [ %18, %.lr.ph.preheader.new ], [ %.159.1, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %30 = getelementptr inbounds double, ptr %14, i64 %indvars.iv
  %31 = load double, ptr %30, align 8, !tbaa !10
  %32 = getelementptr inbounds double, ptr %16, i64 %indvars.iv
  %33 = load double, ptr %32, align 8, !tbaa !10
  %34 = fsub double %31, %33
  %35 = fcmp ogt double %34, %.05872
  %.159 = select i1 %35, double %34, double %.05872
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %36 = getelementptr inbounds double, ptr %14, i64 %indvars.iv.next
  %37 = load double, ptr %36, align 8, !tbaa !10
  %38 = getelementptr inbounds double, ptr %16, i64 %indvars.iv.next
  %39 = load double, ptr %38, align 8, !tbaa !10
  %40 = fsub double %37, %39
  %41 = fcmp ogt double %40, %.159
  %.159.1 = select i1 %41, double %40, double %.159
  %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 %.preheader.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !13

42:                                               ; preds = %.lr.ph76, %56
  %indvars.iv78 = phi i64 [ 0, %.lr.ph76 ], [ %indvars.iv.next79, %56 ]
  %.06074 = phi double [ -1.000000e+00, %.lr.ph76 ], [ %.2, %56 ]
  %43 = load ptr, ptr %13, align 8, !tbaa !5
  %44 = getelementptr inbounds double, ptr %43, i64 %indvars.iv78
  %45 = load double, ptr %44, align 8, !tbaa !10
  %46 = load ptr, ptr %2, align 8, !tbaa !12
  %47 = getelementptr inbounds double, ptr %46, i64 %indvars.iv78
  %48 = load double, ptr %47, align 8, !tbaa !10
  %49 = fsub double %45, %48
  %50 = fcmp ult double %49, %29
  br i1 %50, label %56, label %51

51:                                               ; preds = %42
  %52 = trunc nuw nsw i64 %indvars.iv78 to i32
  %53 = tail call noundef double @_Z9annSpreadPPdPiii(ptr noundef %0, ptr noundef %1, i32 noundef %3, i32 noundef %52)
  %54 = fcmp ogt double %53, %.06074
  br i1 %54, label %55, label %56

55:                                               ; preds = %51
  store i32 %52, ptr %5, align 4, !tbaa !15
  br label %56

56:                                               ; preds = %51, %55, %42
  %.2 = phi double [ %.06074, %42 ], [ %53, %55 ], [ %.06074, %51 ]
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %exitcond82.not = icmp eq i64 %indvars.iv.next79, %wide.trip.count81
  br i1 %exitcond82.not, label %._crit_edge.loopexit, label %42, !llvm.loop !17

._crit_edge.loopexit:                             ; preds = %56
  %.pre = load ptr, ptr %2, align 8, !tbaa !12
  %.pre83 = load ptr, ptr %13, align 8, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %57 = phi ptr [ %.pre83, %._crit_edge.loopexit ], [ %14, %.preheader ]
  %58 = phi ptr [ %.pre, %._crit_edge.loopexit ], [ %16, %.preheader ]
  %59 = load i32, ptr %5, align 4, !tbaa !15
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds double, ptr %58, i64 %60
  %62 = load double, ptr %61, align 8, !tbaa !10
  %63 = getelementptr inbounds double, ptr %57, i64 %60
  %64 = load double, ptr %63, align 8, !tbaa !10
  %65 = fadd double %62, %64
  %66 = fmul double %65, 5.000000e-01
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  call void @_Z9annMinMaxPPdPiiiRdS2_(ptr noundef %0, ptr noundef %1, i32 noundef %3, i32 noundef %59, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %67 = load double, ptr %9, align 8, !tbaa !10
  %68 = fcmp olt double %66, %67
  br i1 %68, label %72, label %69

69:                                               ; preds = %._crit_edge
  %70 = load double, ptr %10, align 8, !tbaa !10
  %71 = fcmp ogt double %66, %70
  %. = select i1 %71, double %70, double %66
  br label %72

72:                                               ; preds = %69, %._crit_edge
  %.sink = phi double [ %67, %._crit_edge ], [ %., %69 ]
  store double %.sink, ptr %6, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #4
  %73 = load i32, ptr %5, align 4, !tbaa !15
  call void @_Z13annPlaneSplitPPdPiiidRiS2_(ptr noundef %0, ptr noundef %1, i32 noundef %3, i32 noundef %73, double noundef %.sink, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %74 = load double, ptr %9, align 8, !tbaa !10
  %75 = fcmp olt double %66, %74
  br i1 %75, label %87, label %76

76:                                               ; preds = %72
  %77 = load double, ptr %10, align 8, !tbaa !10
  %78 = fcmp ogt double %66, %77
  br i1 %78, label %79, label %81

79:                                               ; preds = %76
  %80 = add nsw i32 %3, -1
  br label %87

81:                                               ; preds = %76
  %82 = load i32, ptr %11, align 4, !tbaa !15
  %83 = sdiv i32 %3, 2
  %84 = icmp sgt i32 %82, %83
  br i1 %84, label %87, label %85

85:                                               ; preds = %81
  %86 = load i32, ptr %12, align 4, !tbaa !15
  %.85 = call i32 @llvm.smin.i32(i32 %86, i32 %83)
  br label %87

87:                                               ; preds = %85, %81, %72, %79
  %.sink84 = phi i32 [ %80, %79 ], [ 1, %72 ], [ %82, %81 ], [ %.85, %85 ]
  store i32 %.sink84, ptr %7, align 4, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  ret void
}

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 #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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}


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