; LLVM IR from Lodour/ACM-CheatSheet :: src/6_计算几何/6_经典题/1_平面最近点对.ll (Z5solveii)

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

%struct.Point = type { double, double }

@p = external dso_local global [100100 x %struct.Point], align 16
@tmp = external dso_local global [100100 x %struct.Point], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4cmpy5PointS_(double, double, double, double) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z3dis5PointS_(double, double, double, double) #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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_Z5solveii(i32 noundef %0, i32 noundef %1) #2 {
  %3 = alloca double, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca double, align 8
  %7 = alloca i32, align 4
  %8 = alloca %struct.Point, align 8
  %9 = alloca %struct.Point, align 8
  %10 = alloca i32, align 4
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca double, align 8
  %18 = alloca %struct.Point, align 8
  %19 = alloca %struct.Point, align 8
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store double 1.000000e+20, ptr %6, align 8, !tbaa !9
  %20 = load i32, ptr %4, align 4, !tbaa !5
  %21 = load i32, ptr %5, align 4, !tbaa !5
  %22 = icmp eq i32 %20, %21
  br i1 %22, label %23, label %25

23:                                               ; preds = %2
  %24 = load double, ptr %6, align 8, !tbaa !9
  store double %24, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %153

25:                                               ; preds = %2
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  %28 = load i32, ptr %5, align 4, !tbaa !5
  %29 = icmp eq i32 %27, %28
  br i1 %29, label %30, label %46

30:                                               ; preds = %25
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [100100 x %struct.Point], ptr @p, i64 0, i64 %32
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 16 %33, i64 16, i1 false), !tbaa.struct !11
  %34 = load i32, ptr %5, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100100 x %struct.Point], ptr @p, i64 0, i64 %35
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 16 %36, i64 16, i1 false), !tbaa.struct !11
  %37 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 0
  %38 = load double, ptr %37, align 8
  %39 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 1
  %40 = load double, ptr %39, align 8
  %41 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 0
  %42 = load double, ptr %41, align 8
  %43 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 1
  %44 = load double, ptr %43, align 8
  %45 = call noundef double @_Z3dis5PointS_(double %38, double %40, double %42, double %44)
  store double %45, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %153

46:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %47 = load i32, ptr %4, align 4, !tbaa !5
  %48 = load i32, ptr %5, align 4, !tbaa !5
  %49 = add nsw i32 %47, %48
  %50 = ashr i32 %49, 1
  store i32 %50, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = load i32, ptr %10, align 4, !tbaa !5
  %53 = call noundef double @_Z5solveii(i32 noundef %51, i32 noundef %52)
  store double %53, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %54 = load i32, ptr %10, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  %56 = load i32, ptr %5, align 4, !tbaa !5
  %57 = call noundef double @_Z5solveii(i32 noundef %55, i32 noundef %56)
  store double %57, ptr %12, align 8, !tbaa !9
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %59 = load double, ptr %58, align 8, !tbaa !9
  store double %59, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %60 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %60, ptr %14, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %90, %46
  %62 = load i32, ptr %14, align 4, !tbaa !5
  %63 = load i32, ptr %5, align 4, !tbaa !5
  %64 = icmp sle i32 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %93

66:                                               ; preds = %61
  %67 = load i32, ptr %14, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [100100 x %struct.Point], ptr @p, i64 0, i64 %68
  %70 = getelementptr inbounds %struct.Point, ptr %69, i32 0, i32 0
  %71 = load double, ptr %70, align 16, !tbaa !12
  %72 = load i32, ptr %10, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [100100 x %struct.Point], ptr @p, i64 0, i64 %73
  %75 = getelementptr inbounds %struct.Point, ptr %74, i32 0, i32 0
  %76 = load double, ptr %75, align 16, !tbaa !12
  %77 = fsub double %71, %76
  %78 = call double @llvm.fabs.f64(double %77)
  %79 = load double, ptr %6, align 8, !tbaa !9
  %80 = fcmp ole double %78, %79
  br i1 %80, label %81, label %89

81:                                               ; preds = %66
  %82 = load i32, ptr %14, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [100100 x %struct.Point], ptr @p, i64 0, i64 %83
  %85 = load i32, ptr %13, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %13, align 4, !tbaa !5
  %87 = sext i32 %85 to i64
  %88 = getelementptr inbounds [100100 x %struct.Point], ptr @tmp, i64 0, i64 %87
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %88, ptr align 16 %84, i64 16, i1 false), !tbaa.struct !11
  br label %89

89:                                               ; preds = %81, %66
  br label %90

90:                                               ; preds = %89
  %91 = load i32, ptr %14, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %14, align 4, !tbaa !5
  br label %61, !llvm.loop !14

93:                                               ; preds = %65
  %94 = load i32, ptr %13, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds %struct.Point, ptr @tmp, i64 %95
  call void @_ZSt4sortIP5PointPFbS0_S0_EEvT_S4_T0_(ptr noundef @tmp, ptr noundef %96, ptr noundef @_Z4cmpy5PointS_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %97

97:                                               ; preds = %148, %93
  %98 = load i32, ptr %15, align 4, !tbaa !5
  %99 = load i32, ptr %13, align 4, !tbaa !5
  %100 = icmp slt i32 %98, %99
  br i1 %100, label %102, label %101

101:                                              ; preds = %97
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %151

102:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %103 = load i32, ptr %15, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %16, align 4, !tbaa !5
  br label %105

105:                                              ; preds = %143, %102
  %106 = load i32, ptr %16, align 4, !tbaa !5
  %107 = load i32, ptr %13, align 4, !tbaa !5
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %110, label %109

109:                                              ; preds = %105
  store i32 8, ptr %7, align 4
  br label %146

110:                                              ; preds = %105
  %111 = load i32, ptr %16, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [100100 x %struct.Point], ptr @tmp, i64 0, i64 %112
  %114 = getelementptr inbounds %struct.Point, ptr %113, i32 0, i32 1
  %115 = load double, ptr %114, align 8, !tbaa !16
  %116 = load i32, ptr %15, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [100100 x %struct.Point], ptr @tmp, i64 0, i64 %117
  %119 = getelementptr inbounds %struct.Point, ptr %118, i32 0, i32 1
  %120 = load double, ptr %119, align 8, !tbaa !16
  %121 = fsub double %115, %120
  %122 = load double, ptr %6, align 8, !tbaa !9
  %123 = fcmp ogt double %121, %122
  br i1 %123, label %124, label %125

124:                                              ; preds = %110
  store i32 8, ptr %7, align 4
  br label %146

125:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %126 = load i32, ptr %15, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [100100 x %struct.Point], ptr @tmp, i64 0, i64 %127
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 16 %128, i64 16, i1 false), !tbaa.struct !11
  %129 = load i32, ptr %16, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [100100 x %struct.Point], ptr @tmp, i64 0, i64 %130
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 16 %131, i64 16, i1 false), !tbaa.struct !11
  %132 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %133 = load double, ptr %132, align 8
  %134 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %135 = load double, ptr %134, align 8
  %136 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %137 = load double, ptr %136, align 8
  %138 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %139 = load double, ptr %138, align 8
  %140 = call noundef double @_Z3dis5PointS_(double %133, double %135, double %137, double %139)
  store double %140, ptr %17, align 8, !tbaa !9
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %142 = load double, ptr %141, align 8, !tbaa !9
  store double %142, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %143

143:                                              ; preds = %125
  %144 = load i32, ptr %16, align 4, !tbaa !5
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %16, align 4, !tbaa !5
  br label %105, !llvm.loop !17

146:                                              ; preds = %124, %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %147

147:                                              ; preds = %146
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %15, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %15, align 4, !tbaa !5
  br label %97, !llvm.loop !18

151:                                              ; preds = %101
  %152 = load double, ptr %6, align 8, !tbaa !9
  store double %152, ptr %3, align 8
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %153

153:                                              ; preds = %151, %30, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %154 = load double, ptr %3, align 8
  ret double %154
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP5PointPFbS0_S0_EEvT_S4_T0_(ptr noundef, ptr noundef, ptr noundef) #6

attributes #0 = { mustprogress nounwind 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress nounwind 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { inlinehint 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 #7 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{i64 0, i64 8, !9, i64 8, i64 8, !9}
!12 = !{!13, !10, i64 0}
!13 = !{!"_ZTS5Point", !10, i64 0, !10, i64 8}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!13, !10, i64 8}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}


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

%struct.Point = type { double, double }

@p = external dso_local local_unnamed_addr global [100100 x %struct.Point], align 16
@tmp = external dso_local global [100100 x %struct.Point], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4cmpy5PointS_(double, double, double, double) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z3dis5PointS_(double, double, double, double) 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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_Z5solveii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #2 {
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %7 = icmp eq i32 %0, %1
  br i1 %7, label %62, label %8

8:                                                ; preds = %2
  %9 = add nsw i32 %0, 1
  %10 = icmp eq i32 %9, %1
  br i1 %10, label %11, label %17

11:                                               ; preds = %8
  %12 = sext i32 %0 to i64
  %13 = getelementptr inbounds [100100 x %struct.Point], ptr @p, i64 0, i64 %12
  %.sroa.024.0.copyload = load double, ptr %13, align 16, !tbaa !5
  %.sroa.225.0..sroa_idx = getelementptr inbounds i8, ptr %13, i64 8
  %.sroa.225.0.copyload = load double, ptr %.sroa.225.0..sroa_idx, align 8, !tbaa !5
  %14 = sext i32 %1 to i64
  %15 = getelementptr inbounds [100100 x %struct.Point], ptr @p, i64 0, i64 %14
  %.sroa.022.0.copyload = load double, ptr %15, align 16, !tbaa !5
  %.sroa.223.0..sroa_idx = getelementptr inbounds i8, ptr %15, i64 8
  %.sroa.223.0.copyload = load double, ptr %.sroa.223.0..sroa_idx, align 8, !tbaa !5
  %16 = tail call noundef double @_Z3dis5PointS_(double %.sroa.024.0.copyload, double %.sroa.225.0.copyload, double %.sroa.022.0.copyload, double %.sroa.223.0.copyload)
  br label %62

17:                                               ; preds = %8
  %18 = add nsw i32 %1, %0
  %19 = ashr i32 %18, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %20 = tail call noundef double @_Z5solveii(i32 noundef %0, i32 noundef %19)
  store double %20, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %21 = add nsw i32 %19, 1
  %22 = tail call noundef double @_Z5solveii(i32 noundef %21, i32 noundef %1)
  store double %22, ptr %5, align 8, !tbaa !5
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %24 = load double, ptr %23, align 8, !tbaa !5
  store double %24, ptr %3, align 8, !tbaa !5
  %.not44 = icmp sgt i32 %0, %1
  br i1 %.not44, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %17
  %25 = sext i32 %19 to i64
  %26 = getelementptr inbounds [100100 x %struct.Point], ptr @p, i64 0, i64 %25
  %27 = load double, ptr %26, align 16, !tbaa !9
  %28 = sext i32 %0 to i64
  %29 = add i32 %1, 1
  br label %33

._crit_edge:                                      ; preds = %43, %17
  %.038.lcssa = phi i32 [ 0, %17 ], [ %.1, %43 ]
  %30 = sext i32 %.038.lcssa to i64
  %31 = getelementptr inbounds %struct.Point, ptr @tmp, i64 %30
  call void @_ZSt4sortIP5PointPFbS0_S0_EEvT_S4_T0_(ptr noundef nonnull @tmp, ptr noundef nonnull %31, ptr noundef nonnull @_Z4cmpy5PointS_)
  %32 = icmp sgt i32 %.038.lcssa, 0
  br i1 %32, label %.lr.ph54.preheader, label %._crit_edge55

.lr.ph54.preheader:                               ; preds = %._crit_edge
  %wide.trip.count66 = zext nneg i32 %.038.lcssa to i64
  br label %.lr.ph54

33:                                               ; preds = %.lr.ph, %43
  %indvars.iv = phi i64 [ %28, %.lr.ph ], [ %indvars.iv.next, %43 ]
  %.03846 = phi i32 [ 0, %.lr.ph ], [ %.1, %43 ]
  %34 = getelementptr inbounds [100100 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv
  %35 = load double, ptr %34, align 16, !tbaa !9
  %36 = fsub double %35, %27
  %37 = call double @llvm.fabs.f64(double %36)
  %38 = fcmp ugt double %37, %24
  br i1 %38, label %43, label %39

39:                                               ; preds = %33
  %40 = add nsw i32 %.03846, 1
  %41 = sext i32 %.03846 to i64
  %42 = getelementptr inbounds [100100 x %struct.Point], ptr @tmp, i64 0, i64 %41
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %42, ptr noundef nonnull align 16 dereferenceable(16) %34, i64 16, i1 false), !tbaa.struct !11
  br label %43

43:                                               ; preds = %33, %39
  %.1 = phi i32 [ %40, %39 ], [ %.03846, %33 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
  %exitcond.not = icmp eq i32 %29, %lftr.wideiv
  br i1 %exitcond.not, label %._crit_edge, label %33, !llvm.loop !12

._crit_edge55:                                    ; preds = %._crit_edge50, %._crit_edge
  %44 = phi double [ %24, %._crit_edge ], [ %61, %._crit_edge50 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %62

.lr.ph54:                                         ; preds = %.lr.ph54.preheader, %._crit_edge50
  %45 = phi double [ %24, %.lr.ph54.preheader ], [ %61, %._crit_edge50 ]
  %indvars.iv63 = phi i64 [ 0, %.lr.ph54.preheader ], [ %indvars.iv.next64, %._crit_edge50 ]
  %indvars.iv57 = phi i64 [ 1, %.lr.ph54.preheader ], [ %indvars.iv.next58, %._crit_edge50 ]
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %46 = icmp slt i64 %indvars.iv.next64, %30
  br i1 %46, label %.lr.ph49, label %._crit_edge50

.lr.ph49:                                         ; preds = %.lr.ph54
  %47 = getelementptr inbounds [100100 x %struct.Point], ptr @tmp, i64 0, i64 %indvars.iv63
  %48 = getelementptr inbounds i8, ptr %47, i64 8
  br label %49

49:                                               ; preds = %.lr.ph49, %57
  %50 = phi double [ %45, %.lr.ph49 ], [ %60, %57 ]
  %indvars.iv59 = phi i64 [ %indvars.iv57, %.lr.ph49 ], [ %indvars.iv.next60, %57 ]
  %51 = getelementptr inbounds [100100 x %struct.Point], ptr @tmp, i64 0, i64 %indvars.iv59
  %52 = getelementptr inbounds i8, ptr %51, i64 8
  %53 = load double, ptr %52, align 8, !tbaa !5
  %54 = load double, ptr %48, align 8, !tbaa !5
  %55 = fsub double %53, %54
  %56 = fcmp ogt double %55, %50
  br i1 %56, label %._crit_edge50, label %57

57:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %.sroa.01.0.copyload = load double, ptr %47, align 16, !tbaa !5
  %.sroa.0.0.copyload = load double, ptr %51, align 16, !tbaa !5
  %58 = call noundef double @_Z3dis5PointS_(double %.sroa.01.0.copyload, double %54, double %.sroa.0.0.copyload, double %53)
  store double %58, ptr %6, align 8, !tbaa !5
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %60 = load double, ptr %59, align 8, !tbaa !5
  store double %60, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %exitcond62.not = icmp eq i64 %indvars.iv.next60, %wide.trip.count66
  br i1 %exitcond62.not, label %._crit_edge50, label %49, !llvm.loop !14

._crit_edge50:                                    ; preds = %57, %49, %.lr.ph54
  %61 = phi double [ %45, %.lr.ph54 ], [ %60, %57 ], [ %50, %49 ]
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %exitcond67.not = icmp eq i64 %indvars.iv.next64, %wide.trip.count66
  br i1 %exitcond67.not, label %._crit_edge55, label %.lr.ph54, !llvm.loop !15

62:                                               ; preds = %2, %._crit_edge55, %11
  %.0 = phi double [ %16, %11 ], [ %44, %._crit_edge55 ], [ 1.000000e+20, %2 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  ret double %.0
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP5PointPFbS0_S0_EEvT_S4_T0_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

attributes #0 = { mustprogress nounwind 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress nounwind 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 #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { inlinehint 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 #7 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTS5Point", !6, i64 0, !6, i64 8}
!11 = !{i64 0, i64 8, !5, i64 8, i64 8, !5}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}


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