; LLVM IR from reyadussalahin/problem-solving :: computational_geometry/convex_hull/loj/F1239 (Solution)

; 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 { i64, i64 }

@solve.buf = external hidden global [200000 x %struct.Point], align 16
@.str = external hidden unnamed_addr constant [15 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local double @dist(i64, i64, i64, i64) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @compare_point(ptr noundef, ptr 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

; Function Attrs: nounwind uwtable
declare dso_local i32 @ccw(i64, i64, i64, i64, i64, i64) #0

; Function Attrs: nounwind uwtable
define dso_local void @solve(i32 noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) #0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca double, align 8
  store i32 %0, ptr %5, align 4, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !5
  %13 = load ptr, ptr %6, align 8, !tbaa !9
  %14 = load i32, ptr %7, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  call void @qsort(ptr noundef %13, i64 noundef %15, i64 noundef 16, ptr noundef @compare_point)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %66, %4
  %17 = load i32, ptr %9, align 4, !tbaa !5
  %18 = load i32, ptr %7, align 4, !tbaa !5
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %20, label %69

20:                                               ; preds = %16
  br label %21

21:                                               ; preds = %54, %20
  %22 = load i32, ptr %10, align 4, !tbaa !5
  %23 = icmp sgt i32 %22, 1
  br i1 %23, label %24, label %52

24:                                               ; preds = %21
  %25 = load i32, ptr %10, align 4, !tbaa !5
  %26 = sub nsw i32 %25, 2
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [200000 x %struct.Point], ptr @solve.buf, i64 0, i64 %27
  %29 = load i32, ptr %10, align 4, !tbaa !5
  %30 = sub nsw i32 %29, 1
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [200000 x %struct.Point], ptr @solve.buf, i64 0, i64 %31
  %33 = load ptr, ptr %6, align 8, !tbaa !9
  %34 = load i32, ptr %9, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds %struct.Point, ptr %33, i64 %35
  %37 = getelementptr inbounds { i64, i64 }, ptr %28, i32 0, i32 0
  %38 = load i64, ptr %37, align 16
  %39 = getelementptr inbounds { i64, i64 }, ptr %28, i32 0, i32 1
  %40 = load i64, ptr %39, align 8
  %41 = getelementptr inbounds { i64, i64 }, ptr %32, i32 0, i32 0
  %42 = load i64, ptr %41, align 16
  %43 = getelementptr inbounds { i64, i64 }, ptr %32, i32 0, i32 1
  %44 = load i64, ptr %43, align 8
  %45 = getelementptr inbounds { i64, i64 }, ptr %36, i32 0, i32 0
  %46 = load i64, ptr %45, align 8
  %47 = getelementptr inbounds { i64, i64 }, ptr %36, i32 0, i32 1
  %48 = load i64, ptr %47, align 8
  %49 = call i32 @ccw(i64 %38, i64 %40, i64 %42, i64 %44, i64 %46, i64 %48)
  %50 = icmp ne i32 %49, 0
  %51 = xor i1 %50, true
  br label %52

52:                                               ; preds = %24, %21
  %53 = phi i1 [ false, %21 ], [ %51, %24 ]
  br i1 %53, label %54, label %57

54:                                               ; preds = %52
  %55 = load i32, ptr %10, align 4, !tbaa !5
  %56 = add nsw i32 %55, -1
  store i32 %56, ptr %10, align 4, !tbaa !5
  br label %21, !llvm.loop !11

57:                                               ; preds = %52
  %58 = load i32, ptr %10, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %10, align 4, !tbaa !5
  %60 = sext i32 %58 to i64
  %61 = getelementptr inbounds [200000 x %struct.Point], ptr @solve.buf, i64 0, i64 %60
  %62 = load ptr, ptr %6, align 8, !tbaa !9
  %63 = load i32, ptr %9, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds %struct.Point, ptr %62, i64 %64
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %61, ptr align 8 %65, i64 16, i1 false), !tbaa.struct !13
  br label %66

66:                                               ; preds = %57
  %67 = load i32, ptr %9, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %9, align 4, !tbaa !5
  br label %16, !llvm.loop !16

69:                                               ; preds = %16
  %70 = load i32, ptr %7, align 4, !tbaa !5
  %71 = sub nsw i32 %70, 2
  store i32 %71, ptr %9, align 4, !tbaa !5
  %72 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %72, ptr %11, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %123, %69
  %74 = load i32, ptr %9, align 4, !tbaa !5
  %75 = icmp sge i32 %74, 0
  br i1 %75, label %76, label %126

76:                                               ; preds = %73
  br label %77

77:                                               ; preds = %111, %76
  %78 = load i32, ptr %10, align 4, !tbaa !5
  %79 = load i32, ptr %11, align 4, !tbaa !5
  %80 = icmp sgt i32 %78, %79
  br i1 %80, label %81, label %109

81:                                               ; preds = %77
  %82 = load i32, ptr %10, align 4, !tbaa !5
  %83 = sub nsw i32 %82, 2
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [200000 x %struct.Point], ptr @solve.buf, i64 0, i64 %84
  %86 = load i32, ptr %10, align 4, !tbaa !5
  %87 = sub nsw i32 %86, 1
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [200000 x %struct.Point], ptr @solve.buf, i64 0, i64 %88
  %90 = load ptr, ptr %6, align 8, !tbaa !9
  %91 = load i32, ptr %9, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds %struct.Point, ptr %90, i64 %92
  %94 = getelementptr inbounds { i64, i64 }, ptr %85, i32 0, i32 0
  %95 = load i64, ptr %94, align 16
  %96 = getelementptr inbounds { i64, i64 }, ptr %85, i32 0, i32 1
  %97 = load i64, ptr %96, align 8
  %98 = getelementptr inbounds { i64, i64 }, ptr %89, i32 0, i32 0
  %99 = load i64, ptr %98, align 16
  %100 = getelementptr inbounds { i64, i64 }, ptr %89, i32 0, i32 1
  %101 = load i64, ptr %100, align 8
  %102 = getelementptr inbounds { i64, i64 }, ptr %93, i32 0, i32 0
  %103 = load i64, ptr %102, align 8
  %104 = getelementptr inbounds { i64, i64 }, ptr %93, i32 0, i32 1
  %105 = load i64, ptr %104, align 8
  %106 = call i32 @ccw(i64 %95, i64 %97, i64 %99, i64 %101, i64 %103, i64 %105)
  %107 = icmp ne i32 %106, 0
  %108 = xor i1 %107, true
  br label %109

109:                                              ; preds = %81, %77
  %110 = phi i1 [ false, %77 ], [ %108, %81 ]
  br i1 %110, label %111, label %114

111:                                              ; preds = %109
  %112 = load i32, ptr %10, align 4, !tbaa !5
  %113 = add nsw i32 %112, -1
  store i32 %113, ptr %10, align 4, !tbaa !5
  br label %77, !llvm.loop !17

114:                                              ; preds = %109
  %115 = load i32, ptr %10, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %10, align 4, !tbaa !5
  %117 = sext i32 %115 to i64
  %118 = getelementptr inbounds [200000 x %struct.Point], ptr @solve.buf, i64 0, i64 %117
  %119 = load ptr, ptr %6, align 8, !tbaa !9
  %120 = load i32, ptr %9, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds %struct.Point, ptr %119, i64 %121
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %118, ptr align 8 %122, i64 16, i1 false), !tbaa.struct !13
  br label %123

123:                                              ; preds = %114
  %124 = load i32, ptr %9, align 4, !tbaa !5
  %125 = add nsw i32 %124, -1
  store i32 %125, ptr %9, align 4, !tbaa !5
  br label %73, !llvm.loop !18

126:                                              ; preds = %73
  %127 = load i32, ptr %10, align 4, !tbaa !5
  %128 = add nsw i32 %127, -1
  store i32 %128, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store double 0.000000e+00, ptr %12, align 8, !tbaa !19
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %154, %126
  %130 = load i32, ptr %9, align 4, !tbaa !5
  %131 = load i32, ptr %10, align 4, !tbaa !5
  %132 = icmp slt i32 %130, %131
  br i1 %132, label %133, label %157

133:                                              ; preds = %129
  %134 = load double, ptr %12, align 8, !tbaa !19
  %135 = load i32, ptr %9, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [200000 x %struct.Point], ptr @solve.buf, i64 0, i64 %136
  %138 = load i32, ptr %9, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  %140 = load i32, ptr %10, align 4, !tbaa !5
  %141 = srem i32 %139, %140
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [200000 x %struct.Point], ptr @solve.buf, i64 0, i64 %142
  %144 = getelementptr inbounds { i64, i64 }, ptr %137, i32 0, i32 0
  %145 = load i64, ptr %144, align 16
  %146 = getelementptr inbounds { i64, i64 }, ptr %137, i32 0, i32 1
  %147 = load i64, ptr %146, align 8
  %148 = getelementptr inbounds { i64, i64 }, ptr %143, i32 0, i32 0
  %149 = load i64, ptr %148, align 16
  %150 = getelementptr inbounds { i64, i64 }, ptr %143, i32 0, i32 1
  %151 = load i64, ptr %150, align 8
  %152 = call double @dist(i64 %145, i64 %147, i64 %149, i64 %151)
  %153 = fadd double %134, %152
  store double %153, ptr %12, align 8, !tbaa !19
  br label %154

154:                                              ; preds = %133
  %155 = load i32, ptr %9, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %9, align 4, !tbaa !5
  br label %129, !llvm.loop !21

157:                                              ; preds = %129
  %158 = load double, ptr %12, align 8, !tbaa !19
  %159 = call double @acos(double noundef -1.000000e+00) #6
  %160 = fmul double 2.000000e+00, %159
  %161 = load i32, ptr %8, align 4, !tbaa !5
  %162 = sitofp i32 %161 to double
  %163 = call double @llvm.fmuladd.f64(double %160, double %162, double %158)
  store double %163, ptr %12, align 8, !tbaa !19
  %164 = load i32, ptr %5, align 4, !tbaa !5
  %165 = load double, ptr %12, align 8, !tbaa !19
  %166 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %164, double noundef %165)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  ret void
}

declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

; 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: nounwind
declare double @acos(double noundef) #4

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

declare i32 @printf(ptr noundef, ...) #2

attributes #0 = { 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 = { "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 = { nounwind "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 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{i64 0, i64 8, !14, i64 8, i64 8, !14}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = !{!20, !20, i64 0}
!20 = !{!"double", !7, i64 0}
!21 = distinct !{!21, !12}


; 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 { i64, i64 }

@solve.buf = external hidden local_unnamed_addr global [200000 x %struct.Point], align 16
@.str = external hidden unnamed_addr constant [15 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local double @dist(i64, i64, i64, i64) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @compare_point(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @ccw(i64, i64, i64, i64, i64, i64) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @solve(i32 noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = sext i32 %2 to i64
  tail call void @qsort(ptr noundef %1, i64 noundef %5, i64 noundef 16, ptr noundef nonnull @compare_point) #6
  %6 = icmp sgt i32 %2, 0
  br i1 %6, label %.preheader48.preheader, label %._crit_edge58

.preheader48.preheader:                           ; preds = %4
  %wide.trip.count = zext nneg i32 %2 to i64
  br label %.preheader48

.preheader48:                                     ; preds = %.preheader48.preheader, %.critedge
  %indvars.iv63 = phi i64 [ 0, %.preheader48.preheader ], [ %indvars.iv.next64, %.critedge ]
  %.04249 = phi i32 [ 0, %.preheader48.preheader ], [ %27, %.critedge ]
  %7 = getelementptr inbounds %struct.Point, ptr %1, i64 %indvars.iv63
  %8 = getelementptr inbounds i8, ptr %7, i64 8
  %9 = zext i32 %.04249 to i64
  %smin = tail call i32 @llvm.smin.i32(i32 %.04249, i32 1)
  br label %10

10:                                               ; preds = %.preheader48, %13
  %indvars.iv = phi i64 [ %9, %.preheader48 ], [ %16, %13 ]
  %11 = trunc nuw i64 %indvars.iv to i32
  %12 = icmp sgt i32 %11, 1
  br i1 %12, label %13, label %.critedge

13:                                               ; preds = %10
  %14 = add nsw i64 %indvars.iv, -2
  %15 = getelementptr inbounds [200000 x %struct.Point], ptr @solve.buf, i64 0, i64 %14
  %16 = add nsw i64 %indvars.iv, -1
  %17 = getelementptr inbounds [200000 x %struct.Point], ptr @solve.buf, i64 0, i64 %16
  %18 = load i64, ptr %15, align 16
  %19 = getelementptr inbounds i8, ptr %15, i64 8
  %20 = load i64, ptr %19, align 8
  %21 = load i64, ptr %17, align 16
  %22 = getelementptr inbounds i8, ptr %17, i64 8
  %23 = load i64, ptr %22, align 8
  %24 = load i64, ptr %7, align 8
  %25 = load i64, ptr %8, align 8
  %26 = tail call i32 @ccw(i64 %18, i64 %20, i64 %21, i64 %23, i64 %24, i64 %25)
  %.not47 = icmp eq i32 %26, 0
  br i1 %.not47, label %10, label %.critedge, !llvm.loop !5

.critedge:                                        ; preds = %10, %13
  %.143.lcssa = phi i32 [ %smin, %10 ], [ %11, %13 ]
  %27 = add nsw i32 %.143.lcssa, 1
  %28 = sext i32 %.143.lcssa to i64
  %29 = getelementptr inbounds [200000 x %struct.Point], ptr @solve.buf, i64 0, i64 %28
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %29, ptr noundef nonnull align 8 dereferenceable(16) %7, i64 16, i1 false), !tbaa.struct !7
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next64, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.preheader48, !llvm.loop !12

._crit_edge:                                      ; preds = %.critedge
  %.not84 = icmp eq i32 %2, 1
  br i1 %.not84, label %._crit_edge53, label %.preheader.preheader

.preheader.preheader:                             ; preds = %._crit_edge
  %30 = add nsw i32 %2, -2
  %31 = sext i32 %27 to i64
  %32 = zext nneg i32 %30 to i64
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.critedge2
  %indvars.iv70 = phi i64 [ %32, %.preheader.preheader ], [ %indvars.iv.next71, %.critedge2 ]
  %.24451 = phi i32 [ %27, %.preheader.preheader ], [ %52, %.critedge2 ]
  %33 = getelementptr inbounds %struct.Point, ptr %1, i64 %indvars.iv70
  %34 = getelementptr inbounds i8, ptr %33, i64 8
  %35 = sext i32 %.24451 to i64
  %smin68 = tail call i32 @llvm.smin.i32(i32 %.24451, i32 %27)
  br label %36

36:                                               ; preds = %.preheader, %38
  %indvars.iv66 = phi i64 [ %35, %.preheader ], [ %indvars.iv.next67, %38 ]
  %37 = icmp sgt i64 %indvars.iv66, %31
  br i1 %37, label %38, label %.critedge2

38:                                               ; preds = %36
  %39 = add nsw i64 %indvars.iv66, -2
  %40 = getelementptr inbounds [200000 x %struct.Point], ptr @solve.buf, i64 0, i64 %39
  %indvars.iv.next67 = add nsw i64 %indvars.iv66, -1
  %41 = getelementptr inbounds [200000 x %struct.Point], ptr @solve.buf, i64 0, i64 %indvars.iv.next67
  %42 = load i64, ptr %40, align 16
  %43 = getelementptr inbounds i8, ptr %40, i64 8
  %44 = load i64, ptr %43, align 8
  %45 = load i64, ptr %41, align 16
  %46 = getelementptr inbounds i8, ptr %41, i64 8
  %47 = load i64, ptr %46, align 8
  %48 = load i64, ptr %33, align 8
  %49 = load i64, ptr %34, align 8
  %50 = tail call i32 @ccw(i64 %42, i64 %44, i64 %45, i64 %47, i64 %48, i64 %49)
  %.not = icmp eq i32 %50, 0
  br i1 %.not, label %36, label %.critedge2.split.loop.exit82, !llvm.loop !13

.critedge2.split.loop.exit82:                     ; preds = %38
  %51 = trunc nsw i64 %indvars.iv66 to i32
  br label %.critedge2

.critedge2:                                       ; preds = %36, %.critedge2.split.loop.exit82
  %.3.lcssa = phi i32 [ %51, %.critedge2.split.loop.exit82 ], [ %smin68, %36 ]
  %52 = add nsw i32 %.3.lcssa, 1
  %53 = sext i32 %.3.lcssa to i64
  %54 = getelementptr inbounds [200000 x %struct.Point], ptr @solve.buf, i64 0, i64 %53
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %54, ptr noundef nonnull align 8 dereferenceable(16) %33, i64 16, i1 false), !tbaa.struct !7
  %indvars.iv.next71 = add nsw i64 %indvars.iv70, -1
  %55 = icmp sgt i64 %indvars.iv70, 0
  br i1 %55, label %.preheader, label %._crit_edge53, !llvm.loop !14

._crit_edge53:                                    ; preds = %.critedge2, %._crit_edge
  %.244.lcssa = phi i32 [ %27, %._crit_edge ], [ %52, %.critedge2 ]
  %56 = icmp sgt i32 %.244.lcssa, 1
  br i1 %56, label %.lr.ph.preheader, label %._crit_edge58

.lr.ph.preheader:                                 ; preds = %._crit_edge53
  %57 = add nsw i32 %.244.lcssa, -1
  %58 = zext nneg i32 %57 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv73 = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next74, %.lr.ph ]
  %.056 = phi double [ 0.000000e+00, %.lr.ph.preheader ], [ %71, %.lr.ph ]
  %59 = getelementptr inbounds [200000 x %struct.Point], ptr @solve.buf, i64 0, i64 %indvars.iv73
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %60 = icmp eq i64 %indvars.iv.next74, %58
  %61 = and i64 %indvars.iv.next74, 4294967295
  %62 = select i1 %60, i64 0, i64 %61
  %63 = getelementptr inbounds [200000 x %struct.Point], ptr @solve.buf, i64 0, i64 %62
  %64 = load i64, ptr %59, align 16
  %65 = getelementptr inbounds i8, ptr %59, i64 8
  %66 = load i64, ptr %65, align 8
  %67 = load i64, ptr %63, align 16
  %68 = getelementptr inbounds i8, ptr %63, i64 8
  %69 = load i64, ptr %68, align 8
  %70 = tail call double @dist(i64 %64, i64 %66, i64 %67, i64 %69)
  %71 = fadd double %.056, %70
  %exitcond77.not = icmp eq i64 %indvars.iv.next74, %58
  br i1 %exitcond77.not, label %._crit_edge58, label %.lr.ph, !llvm.loop !15

._crit_edge58:                                    ; preds = %.lr.ph, %4, %._crit_edge53
  %.0.lcssa = phi double [ 0.000000e+00, %._crit_edge53 ], [ 0.000000e+00, %4 ], [ %71, %.lr.ph ]
  %72 = sitofp i32 %3 to double
  %73 = tail call double @llvm.fmuladd.f64(double %72, double 0x401921FB54442D18, double %.0.lcssa)
  %74 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0, double noundef %73)
  ret void
}

; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #1

; 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) #2

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

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

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


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