; LLVM IR from lzyrapx/Competitive-Programming :: HDUOJ (1007)

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

@a = external dso_local global [100001 x %struct.point], align 16
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z8compare1RK5pointS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z8compare2RK5pointS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0

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

8:                                                ; preds = %178, %0
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  %10 = xor i32 %9, -1
  %11 = icmp ne i32 %10, 0
  br i1 %11, label %12, label %15

12:                                               ; preds = %8
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = icmp ne i32 %13, 0
  br label %15

15:                                               ; preds = %12, %8
  %16 = phi i1 [ false, %8 ], [ %14, %12 ]
  br i1 %16, label %17, label %182

17:                                               ; preds = %15
  store double 0x41653158E0000000, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %33, %17
  %19 = load i32, ptr %5, align 4, !tbaa !5
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %36

23:                                               ; preds = %18
  %24 = load i32, ptr %5, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [100001 x %struct.point], ptr @a, i64 0, i64 %25
  %27 = getelementptr inbounds %struct.point, ptr %26, i32 0, i32 0
  %28 = load i32, ptr %5, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [100001 x %struct.point], ptr @a, i64 0, i64 %29
  %31 = getelementptr inbounds %struct.point, ptr %30, i32 0, i32 1
  %32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %27, ptr noundef %31)
  br label %33

33:                                               ; preds = %23
  %34 = load i32, ptr %5, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %5, align 4, !tbaa !5
  br label %18, !llvm.loop !11

36:                                               ; preds = %22
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds %struct.point, ptr @a, i64 %38
  call void @_ZSt4sortIP5pointPFbRKS0_S3_EEvT_S6_T0_(ptr noundef @a, ptr noundef %39, ptr noundef @_Z8compare1RK5pointS1_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %104, %36
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = sub nsw i32 %42, 1
  %44 = icmp slt i32 %41, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %107

46:                                               ; preds = %40
  %47 = load i32, ptr %6, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [100001 x %struct.point], ptr @a, i64 0, i64 %48
  %50 = getelementptr inbounds %struct.point, ptr %49, i32 0, i32 0
  %51 = load double, ptr %50, align 16, !tbaa !13
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [100001 x %struct.point], ptr @a, i64 0, i64 %54
  %56 = getelementptr inbounds %struct.point, ptr %55, i32 0, i32 0
  %57 = load double, ptr %56, align 16, !tbaa !13
  %58 = fsub double %51, %57
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [100001 x %struct.point], ptr @a, i64 0, i64 %60
  %62 = getelementptr inbounds %struct.point, ptr %61, i32 0, i32 0
  %63 = load double, ptr %62, align 16, !tbaa !13
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [100001 x %struct.point], ptr @a, i64 0, i64 %66
  %68 = getelementptr inbounds %struct.point, ptr %67, i32 0, i32 0
  %69 = load double, ptr %68, align 16, !tbaa !13
  %70 = fsub double %63, %69
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [100001 x %struct.point], ptr @a, i64 0, i64 %72
  %74 = getelementptr inbounds %struct.point, ptr %73, i32 0, i32 1
  %75 = load double, ptr %74, align 8, !tbaa !15
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [100001 x %struct.point], ptr @a, i64 0, i64 %78
  %80 = getelementptr inbounds %struct.point, ptr %79, i32 0, i32 1
  %81 = load double, ptr %80, align 8, !tbaa !15
  %82 = fsub double %75, %81
  %83 = load i32, ptr %6, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [100001 x %struct.point], ptr @a, i64 0, i64 %84
  %86 = getelementptr inbounds %struct.point, ptr %85, i32 0, i32 1
  %87 = load double, ptr %86, align 8, !tbaa !15
  %88 = load i32, ptr %6, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [100001 x %struct.point], ptr @a, i64 0, i64 %90
  %92 = getelementptr inbounds %struct.point, ptr %91, i32 0, i32 1
  %93 = load double, ptr %92, align 8, !tbaa !15
  %94 = fsub double %87, %93
  %95 = fmul double %82, %94
  %96 = call double @llvm.fmuladd.f64(double %58, double %70, double %95)
  %97 = call double @sqrt(double noundef %96) #7
  store double %97, ptr %4, align 8, !tbaa !9
  %98 = load double, ptr %3, align 8, !tbaa !9
  %99 = load double, ptr %4, align 8, !tbaa !9
  %100 = fcmp ogt double %98, %99
  br i1 %100, label %101, label %103

101:                                              ; preds = %46
  %102 = load double, ptr %4, align 8, !tbaa !9
  store double %102, ptr %3, align 8, !tbaa !9
  br label %103

103:                                              ; preds = %101, %46
  br label %104

104:                                              ; preds = %103
  %105 = load i32, ptr %6, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %6, align 4, !tbaa !5
  br label %40, !llvm.loop !16

107:                                              ; preds = %45
  %108 = load i32, ptr %2, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds %struct.point, ptr @a, i64 %109
  call void @_ZSt4sortIP5pointPFbRKS0_S3_EEvT_S6_T0_(ptr noundef @a, ptr noundef %110, ptr noundef @_Z8compare2RK5pointS1_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %175, %107
  %112 = load i32, ptr %7, align 4, !tbaa !5
  %113 = load i32, ptr %2, align 4, !tbaa !5
  %114 = sub nsw i32 %113, 1
  %115 = icmp slt i32 %112, %114
  br i1 %115, label %117, label %116

116:                                              ; preds = %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %178

117:                                              ; preds = %111
  %118 = load i32, ptr %7, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [100001 x %struct.point], ptr @a, i64 0, i64 %119
  %121 = getelementptr inbounds %struct.point, ptr %120, i32 0, i32 0
  %122 = load double, ptr %121, align 16, !tbaa !13
  %123 = load i32, ptr %7, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [100001 x %struct.point], ptr @a, i64 0, i64 %125
  %127 = getelementptr inbounds %struct.point, ptr %126, i32 0, i32 0
  %128 = load double, ptr %127, align 16, !tbaa !13
  %129 = fsub double %122, %128
  %130 = load i32, ptr %7, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [100001 x %struct.point], ptr @a, i64 0, i64 %131
  %133 = getelementptr inbounds %struct.point, ptr %132, i32 0, i32 0
  %134 = load double, ptr %133, align 16, !tbaa !13
  %135 = load i32, ptr %7, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [100001 x %struct.point], ptr @a, i64 0, i64 %137
  %139 = getelementptr inbounds %struct.point, ptr %138, i32 0, i32 0
  %140 = load double, ptr %139, align 16, !tbaa !13
  %141 = fsub double %134, %140
  %142 = load i32, ptr %7, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [100001 x %struct.point], ptr @a, i64 0, i64 %143
  %145 = getelementptr inbounds %struct.point, ptr %144, i32 0, i32 1
  %146 = load double, ptr %145, align 8, !tbaa !15
  %147 = load i32, ptr %7, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [100001 x %struct.point], ptr @a, i64 0, i64 %149
  %151 = getelementptr inbounds %struct.point, ptr %150, i32 0, i32 1
  %152 = load double, ptr %151, align 8, !tbaa !15
  %153 = fsub double %146, %152
  %154 = load i32, ptr %7, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [100001 x %struct.point], ptr @a, i64 0, i64 %155
  %157 = getelementptr inbounds %struct.point, ptr %156, i32 0, i32 1
  %158 = load double, ptr %157, align 8, !tbaa !15
  %159 = load i32, ptr %7, align 4, !tbaa !5
  %160 = add nsw i32 %159, 1
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [100001 x %struct.point], ptr @a, i64 0, i64 %161
  %163 = getelementptr inbounds %struct.point, ptr %162, i32 0, i32 1
  %164 = load double, ptr %163, align 8, !tbaa !15
  %165 = fsub double %158, %164
  %166 = fmul double %153, %165
  %167 = call double @llvm.fmuladd.f64(double %129, double %141, double %166)
  %168 = call double @sqrt(double noundef %167) #7
  store double %168, ptr %4, align 8, !tbaa !9
  %169 = load double, ptr %3, align 8, !tbaa !9
  %170 = load double, ptr %4, align 8, !tbaa !9
  %171 = fcmp ogt double %169, %170
  br i1 %171, label %172, label %174

172:                                              ; preds = %117
  %173 = load double, ptr %4, align 8, !tbaa !9
  store double %173, ptr %3, align 8, !tbaa !9
  br label %174

174:                                              ; preds = %172, %117
  br label %175

175:                                              ; preds = %174
  %176 = load i32, ptr %7, align 4, !tbaa !5
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %7, align 4, !tbaa !5
  br label %111, !llvm.loop !17

178:                                              ; preds = %116
  %179 = load double, ptr %3, align 8, !tbaa !9
  %180 = fdiv double %179, 2.000000e+00
  %181 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, double noundef %180)
  br label %8, !llvm.loop !18

182:                                              ; preds = %15
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  ret i32 0
}

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

declare i32 @__isoc99_scanf(ptr noundef, ...) #3

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

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

; Function Attrs: nounwind
declare double @sqrt(double noundef) #5

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

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

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 norecurse 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 #4 = { 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 #5 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTS5point", !10, i64 0, !10, i64 8}
!15 = !{!14, !10, i64 8}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !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 { double, double }

@a = external dso_local global [100001 x %struct.point], align 16
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z8compare1RK5pointS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z8compare2RK5pointS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %3 = icmp ne i32 %2, -1
  %4 = load i32, ptr %1, align 4
  %5 = icmp ne i32 %4, 0
  %6 = select i1 %3, i1 %5, i1 false
  br i1 %6, label %.preheader, label %._crit_edge52

.preheader:                                       ; preds = %0, %._crit_edge50
  %7 = phi i32 [ %39, %._crit_edge50 ], [ %4, %0 ]
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph, label %.preheader.._crit_edge_crit_edge

.preheader.._crit_edge_crit_edge:                 ; preds = %.preheader
  %.pre66 = sext i32 %7 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.preheader.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre66, %.preheader.._crit_edge_crit_edge ], [ %17, %.lr.ph ]
  %9 = getelementptr inbounds %struct.point, ptr @a, i64 %.pre-phi
  call void @_ZSt4sortIP5pointPFbRKS0_S3_EEvT_S6_T0_(ptr noundef nonnull @a, ptr noundef nonnull %9, ptr noundef nonnull @_Z8compare1RK5pointS1_)
  %10 = load i32, ptr %1, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 1
  br i1 %11, label %.lr.ph42.preheader, label %._crit_edge43

.lr.ph42.preheader:                               ; preds = %._crit_edge
  %12 = add nsw i32 %10, -1
  %wide.trip.count = zext nneg i32 %12 to i64
  %.pre = load double, ptr @a, align 16, !tbaa !9
  %.pre63 = load double, ptr getelementptr inbounds (i8, ptr @a, i64 8), align 8, !tbaa !12
  br label %.lr.ph42

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader ]
  %13 = getelementptr inbounds [100001 x %struct.point], ptr @a, i64 0, i64 %indvars.iv
  %14 = getelementptr inbounds i8, ptr %13, i64 8
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %13, ptr noundef nonnull %14)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = icmp slt i64 %indvars.iv.next, %17
  br i1 %18, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge43:                                    ; preds = %.lr.ph42, %._crit_edge
  %.032.lcssa = phi double [ 0x41653158E0000000, %._crit_edge ], [ %.1, %.lr.ph42 ]
  %19 = sext i32 %10 to i64
  %20 = getelementptr inbounds %struct.point, ptr @a, i64 %19
  call void @_ZSt4sortIP5pointPFbRKS0_S3_EEvT_S6_T0_(ptr noundef nonnull @a, ptr noundef nonnull %20, ptr noundef nonnull @_Z8compare2RK5pointS1_)
  %21 = load i32, ptr %1, align 4, !tbaa !5
  %22 = icmp sgt i32 %21, 1
  br i1 %22, label %.lr.ph49.preheader, label %._crit_edge50

.lr.ph49.preheader:                               ; preds = %._crit_edge43
  %23 = add nsw i32 %21, -1
  %wide.trip.count61 = zext nneg i32 %23 to i64
  %.pre64 = load double, ptr @a, align 16, !tbaa !9
  %.pre65 = load double, ptr getelementptr inbounds (i8, ptr @a, i64 8), align 8, !tbaa !12
  br label %.lr.ph49

.lr.ph42:                                         ; preds = %.lr.ph42.preheader, %.lr.ph42
  %24 = phi double [ %.pre63, %.lr.ph42.preheader ], [ %30, %.lr.ph42 ]
  %25 = phi double [ %.pre, %.lr.ph42.preheader ], [ %27, %.lr.ph42 ]
  %indvars.iv55 = phi i64 [ 0, %.lr.ph42.preheader ], [ %indvars.iv.next56, %.lr.ph42 ]
  %.03239 = phi double [ 0x41653158E0000000, %.lr.ph42.preheader ], [ %.1, %.lr.ph42 ]
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %26 = getelementptr inbounds [100001 x %struct.point], ptr @a, i64 0, i64 %indvars.iv.next56
  %27 = load double, ptr %26, align 16, !tbaa !9
  %28 = fsub double %25, %27
  %29 = getelementptr inbounds i8, ptr %26, i64 8
  %30 = load double, ptr %29, align 8, !tbaa !12
  %31 = fsub double %24, %30
  %32 = fmul double %31, %31
  %33 = call double @llvm.fmuladd.f64(double %28, double %28, double %32)
  %sqrt = call double @llvm.sqrt.f64(double %33)
  %34 = fcmp ogt double %.03239, %sqrt
  %.1 = select i1 %34, double %sqrt, double %.03239
  %exitcond.not = icmp eq i64 %indvars.iv.next56, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge43, label %.lr.ph42, !llvm.loop !15

._crit_edge50:                                    ; preds = %.lr.ph49, %._crit_edge43
  %.2.lcssa = phi double [ %.032.lcssa, %._crit_edge43 ], [ %.3, %.lr.ph49 ]
  %35 = fmul double %.2.lcssa, 5.000000e-01
  %36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %35)
  %37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %38 = icmp ne i32 %37, -1
  %39 = load i32, ptr %1, align 4
  %40 = icmp ne i32 %39, 0
  %41 = select i1 %38, i1 %40, i1 false
  br i1 %41, label %.preheader, label %._crit_edge52, !llvm.loop !16

.lr.ph49:                                         ; preds = %.lr.ph49.preheader, %.lr.ph49
  %42 = phi double [ %.pre65, %.lr.ph49.preheader ], [ %48, %.lr.ph49 ]
  %43 = phi double [ %.pre64, %.lr.ph49.preheader ], [ %45, %.lr.ph49 ]
  %indvars.iv58 = phi i64 [ 0, %.lr.ph49.preheader ], [ %indvars.iv.next59, %.lr.ph49 ]
  %.246 = phi double [ %.032.lcssa, %.lr.ph49.preheader ], [ %.3, %.lr.ph49 ]
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %44 = getelementptr inbounds [100001 x %struct.point], ptr @a, i64 0, i64 %indvars.iv.next59
  %45 = load double, ptr %44, align 16, !tbaa !9
  %46 = fsub double %43, %45
  %47 = getelementptr inbounds i8, ptr %44, i64 8
  %48 = load double, ptr %47, align 8, !tbaa !12
  %49 = fsub double %42, %48
  %50 = fmul double %49, %49
  %51 = call double @llvm.fmuladd.f64(double %46, double %46, double %50)
  %sqrt36 = call double @llvm.sqrt.f64(double %51)
  %52 = fcmp ogt double %.246, %sqrt36
  %.3 = select i1 %52, double %sqrt36, double %.246
  %exitcond62.not = icmp eq i64 %indvars.iv.next59, %wide.trip.count61
  br i1 %exitcond62.not, label %._crit_edge50, label %.lr.ph49, !llvm.loop !17

._crit_edge52:                                    ; preds = %._crit_edge50, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

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

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #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 norecurse 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !11, i64 0}
!10 = !{!"_ZTS5point", !11, i64 0, !11, i64 8}
!11 = !{!"double", !7, i64 0}
!12 = !{!10, !11, i64 8}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}


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