; LLVM IR from tangjz/acm-icpc :: self_training/2015-04-17/G.ll (Z5checkd)

; 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.std::pair" = type <{ double, i32, [4 x i8] }>

@n = external dso_local global i32, align 4
@x = external dso_local global [50001 x i32], align 16
@r = external dso_local global [50001 x i32], align 16
@point = external dso_local global [100002 x %"struct.std::pair"], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z4dcmpd(double noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z5checkd(double noundef %0) #1 {
  %2 = alloca i1, align 1
  %3 = alloca double, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca double, align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca double, align 8
  %9 = alloca i32, align 4
  %10 = alloca { double, i32 }, align 8
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  %14 = alloca { double, i32 }, align 8
  %15 = alloca double, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store double %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %78, %1
  %20 = load i32, ptr %5, align 4, !tbaa !9
  %21 = load i32, ptr @n, align 4, !tbaa !9
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %24, label %23

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

24:                                               ; preds = %19
  %25 = load i32, ptr %5, align 4, !tbaa !9
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [50001 x i32], ptr @r, i64 0, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !9
  %29 = sitofp i32 %28 to double
  %30 = load double, ptr %3, align 8, !tbaa !5
  %31 = fsub double %29, %30
  %32 = call noundef i32 @_Z4dcmpd(double noundef %31)
  %33 = icmp sle i32 %32, 0
  br i1 %33, label %34, label %35

34:                                               ; preds = %24
  br label %78

35:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %36 = load i32, ptr %5, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [50001 x i32], ptr @r, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !9
  %40 = sitofp i32 %39 to double
  %41 = load i32, ptr %5, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [50001 x i32], ptr @r, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !9
  %45 = sitofp i32 %44 to double
  %46 = load double, ptr %3, align 8, !tbaa !5
  %47 = load double, ptr %3, align 8, !tbaa !5
  %48 = fmul double %46, %47
  %49 = fneg double %48
  %50 = call double @llvm.fmuladd.f64(double %40, double %45, double %49)
  %51 = call double @sqrt(double noundef %50) #7
  store double %51, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %52 = load i32, ptr %5, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [50001 x i32], ptr @x, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !9
  %56 = sitofp i32 %55 to double
  %57 = load double, ptr %6, align 8, !tbaa !5
  %58 = fsub double %56, %57
  store double %58, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 -1, ptr %9, align 4, !tbaa !9
  %59 = call { double, i32 } @_ZSt9make_pairIdiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  store { double, i32 } %59, ptr %10, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %10, i64 12, i1 false)
  %60 = load i32, ptr %4, align 4, !tbaa !9
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %4, align 4, !tbaa !9
  %62 = sext i32 %60 to i64
  %63 = getelementptr inbounds [100002 x %"struct.std::pair"], ptr @point, i64 0, i64 %62
  %64 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt4pairIdiEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(12) %63, ptr noundef nonnull align 8 dereferenceable(12) %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %65 = load i32, ptr %5, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [50001 x i32], ptr @x, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !9
  %69 = sitofp i32 %68 to double
  %70 = load double, ptr %6, align 8, !tbaa !5
  %71 = fadd double %69, %70
  store double %71, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 1, ptr %13, align 4, !tbaa !9
  %72 = call { double, i32 } @_ZSt9make_pairIdiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
  store { double, i32 } %72, ptr %14, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %14, i64 12, i1 false)
  %73 = load i32, ptr %4, align 4, !tbaa !9
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %4, align 4, !tbaa !9
  %75 = sext i32 %73 to i64
  %76 = getelementptr inbounds [100002 x %"struct.std::pair"], ptr @point, i64 0, i64 %75
  %77 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt4pairIdiEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(12) %76, ptr noundef nonnull align 8 dereferenceable(12) %11) #7
  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 16, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %78

78:                                               ; preds = %35, %34
  %79 = load i32, ptr %5, align 4, !tbaa !9
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %5, align 4, !tbaa !9
  br label %19, !llvm.loop !11

81:                                               ; preds = %23
  %82 = load i32, ptr %4, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds %"struct.std::pair", ptr @point, i64 %83
  call void @_ZSt4sortIPSt4pairIdiEEvT_S3_(ptr noundef @point, ptr noundef %84)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %85

85:                                               ; preds = %123, %81
  %86 = load i32, ptr %16, align 4, !tbaa !9
  %87 = load i32, ptr %4, align 4, !tbaa !9
  %88 = icmp slt i32 %86, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %85
  store i32 5, ptr %18, align 4
  br label %126

90:                                               ; preds = %85
  %91 = load i32, ptr %17, align 4, !tbaa !9
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %99, label %93

93:                                               ; preds = %90
  %94 = load i32, ptr %16, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [100002 x %"struct.std::pair"], ptr @point, i64 0, i64 %95
  %97 = getelementptr inbounds %"struct.std::pair", ptr %96, i32 0, i32 0
  %98 = load double, ptr %97, align 16, !tbaa !13
  store double %98, ptr %15, align 8, !tbaa !5
  br label %99

99:                                               ; preds = %93, %90
  %100 = load i32, ptr %16, align 4, !tbaa !9
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [100002 x %"struct.std::pair"], ptr @point, i64 0, i64 %101
  %103 = getelementptr inbounds %"struct.std::pair", ptr %102, i32 0, i32 1
  %104 = load i32, ptr %103, align 8, !tbaa !15
  %105 = load i32, ptr %17, align 4, !tbaa !9
  %106 = add nsw i32 %105, %104
  store i32 %106, ptr %17, align 4, !tbaa !9
  %107 = load i32, ptr %17, align 4, !tbaa !9
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %122, label %109

109:                                              ; preds = %99
  %110 = load i32, ptr %16, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [100002 x %"struct.std::pair"], ptr @point, i64 0, i64 %111
  %113 = getelementptr inbounds %"struct.std::pair", ptr %112, i32 0, i32 0
  %114 = load double, ptr %113, align 16, !tbaa !13
  %115 = load double, ptr %15, align 8, !tbaa !5
  %116 = fsub double %114, %115
  %117 = load double, ptr %3, align 8, !tbaa !5
  %118 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %117, double %116)
  %119 = call noundef i32 @_Z4dcmpd(double noundef %118)
  %120 = icmp sge i32 %119, 0
  br i1 %120, label %121, label %122

121:                                              ; preds = %109
  store i1 true, ptr %2, align 1
  store i32 1, ptr %18, align 4
  br label %126

122:                                              ; preds = %109, %99
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %16, align 4, !tbaa !9
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %16, align 4, !tbaa !9
  br label %85, !llvm.loop !16

126:                                              ; preds = %121, %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  %127 = load i32, ptr %18, align 4
  switch i32 %127, label %129 [
    i32 5, label %128
  ]

128:                                              ; preds = %126
  store i1 false, ptr %2, align 1
  store i32 1, ptr %18, align 4
  br label %129

129:                                              ; preds = %128, %126
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  %130 = load i1, ptr %2, align 1
  ret i1 %130
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, i32 } @_ZSt9make_pairIdiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt4pairIdiEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(12)) #0 align 2

; 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 @_ZSt4sortIPSt4pairIdiEEvT_S3_(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 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSSt4pairIdiE", !6, i64 0, !10, i64 8}
!15 = !{!14, !10, i64 8}
!16 = distinct !{!16, !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.std::pair" = type <{ double, i32, [4 x i8] }>

@n = external dso_local local_unnamed_addr global i32, align 4
@x = external dso_local local_unnamed_addr global [50001 x i32], align 16
@r = external dso_local local_unnamed_addr global [50001 x i32], align 16
@point = external dso_local global [100002 x %"struct.std::pair"], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z4dcmpd(double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z5checkd(double noundef %0) local_unnamed_addr #1 {
  %2 = alloca %"struct.std::pair", align 8
  %3 = alloca double, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca double, align 8
  %7 = alloca i32, align 4
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %10 = fneg double %0
  %11 = fmul double %10, %0
  %.sroa.212.0..sroa_idx = getelementptr inbounds i8, ptr %2, i64 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 8
  br label %14

._crit_edge:                                      ; preds = %43, %1
  %.036.lcssa = phi i32 [ 0, %1 ], [ %.137, %43 ]
  %12 = sext i32 %.036.lcssa to i64
  %13 = getelementptr inbounds %"struct.std::pair", ptr @point, i64 %12
  call void @_ZSt4sortIPSt4pairIdiEEvT_S3_(ptr noundef nonnull @point, ptr noundef nonnull %13)
  %.not4043 = icmp sgt i32 %.036.lcssa, 0
  br i1 %.not4043, label %.lr.ph49.preheader, label %.critedge

.lr.ph49.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %.036.lcssa to i64
  br label %.lr.ph49

14:                                               ; preds = %.lr.ph, %43
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %43 ]
  %.03642 = phi i32 [ 0, %.lr.ph ], [ %.137, %43 ]
  %15 = getelementptr inbounds [50001 x i32], ptr @r, i64 0, i64 %indvars.iv
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = sitofp i32 %16 to double
  %18 = fsub double %17, %0
  %19 = call noundef i32 @_Z4dcmpd(double noundef %18)
  %20 = icmp slt i32 %19, 1
  br i1 %20, label %43, label %21

21:                                               ; preds = %14
  %22 = load i32, ptr %15, align 4, !tbaa !5
  %23 = sitofp i32 %22 to double
  %24 = call double @llvm.fmuladd.f64(double %23, double %23, double %11)
  %25 = call double @sqrt(double noundef %24) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %26 = getelementptr inbounds [50001 x i32], ptr @x, i64 0, i64 %indvars.iv
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = sitofp i32 %27 to double
  %29 = fsub double %28, %25
  store double %29, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  store i32 -1, ptr %4, align 4, !tbaa !5
  %30 = call { double, i32 } @_ZSt9make_pairIdiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %.fca.0.extract9 = extractvalue { double, i32 } %30, 0
  %.fca.1.extract10 = extractvalue { double, i32 } %30, 1
  store double %.fca.0.extract9, ptr %2, align 8
  store i32 %.fca.1.extract10, ptr %.sroa.212.0..sroa_idx, align 8
  %31 = add nsw i32 %.03642, 1
  %32 = sext i32 %.03642 to i64
  %33 = getelementptr inbounds [100002 x %"struct.std::pair"], ptr @point, i64 0, i64 %32
  %34 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt4pairIdiEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(12) %33, ptr noundef nonnull align 8 dereferenceable(12) %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %35 = load i32, ptr %26, align 4, !tbaa !5
  %36 = sitofp i32 %35 to double
  %37 = fadd double %25, %36
  store double %37, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  store i32 1, ptr %7, align 4, !tbaa !5
  %38 = call { double, i32 } @_ZSt9make_pairIdiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %.fca.0.extract = extractvalue { double, i32 } %38, 0
  %.fca.1.extract = extractvalue { double, i32 } %38, 1
  store double %.fca.0.extract, ptr %5, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  %39 = add nsw i32 %.03642, 2
  %40 = sext i32 %31 to i64
  %41 = getelementptr inbounds [100002 x %"struct.std::pair"], ptr @point, i64 0, i64 %40
  %42 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt4pairIdiEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(12) %41, ptr noundef nonnull align 8 dereferenceable(12) %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  br label %43

43:                                               ; preds = %14, %21
  %.137 = phi i32 [ %.03642, %14 ], [ %39, %21 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %44 = load i32, ptr @n, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = icmp slt i64 %indvars.iv.next, %45
  br i1 %46, label %14, label %._crit_edge, !llvm.loop !11

.lr.ph49:                                         ; preds = %.lr.ph49.preheader, %61
  %indvars.iv54 = phi i64 [ 0, %.lr.ph49.preheader ], [ %indvars.iv.next55, %61 ]
  %.not4047 = phi i1 [ true, %.lr.ph49.preheader ], [ %.not40, %61 ]
  %.03146 = phi i32 [ 0, %.lr.ph49.preheader ], [ %54, %61 ]
  %.03344 = phi double [ undef, %.lr.ph49.preheader ], [ %.1, %61 ]
  %.not = icmp eq i32 %.03146, 0
  br i1 %.not, label %47, label %50

47:                                               ; preds = %.lr.ph49
  %48 = getelementptr inbounds [100002 x %"struct.std::pair"], ptr @point, i64 0, i64 %indvars.iv54
  %49 = load double, ptr %48, align 16, !tbaa !13
  br label %50

50:                                               ; preds = %47, %.lr.ph49
  %.1 = phi double [ %.03344, %.lr.ph49 ], [ %49, %47 ]
  %51 = getelementptr inbounds [100002 x %"struct.std::pair"], ptr @point, i64 0, i64 %indvars.iv54
  %52 = getelementptr inbounds i8, ptr %51, i64 8
  %53 = load i32, ptr %52, align 8, !tbaa !15
  %54 = add nsw i32 %53, %.03146
  %.not39 = icmp eq i32 %54, 0
  br i1 %.not39, label %55, label %61

55:                                               ; preds = %50
  %56 = load double, ptr %51, align 16, !tbaa !13
  %57 = fsub double %56, %.1
  %58 = call double @llvm.fmuladd.f64(double %0, double -2.000000e+00, double %57)
  %59 = call noundef i32 @_Z4dcmpd(double noundef %58)
  %60 = icmp sgt i32 %59, -1
  br i1 %60, label %.critedge, label %61

61:                                               ; preds = %50, %55
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %.not40 = icmp slt i64 %indvars.iv.next55, %12
  %exitcond.not = icmp eq i64 %indvars.iv.next55, %wide.trip.count
  br i1 %exitcond.not, label %.critedge, label %.lr.ph49, !llvm.loop !16

.critedge:                                        ; preds = %55, %61, %._crit_edge
  %.not40.lcssa = phi i1 [ false, %._crit_edge ], [ %.not40, %61 ], [ %.not4047, %55 ]
  ret i1 %.not40.lcssa
}

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, i32 } @_ZSt9make_pairIdiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt4pairIdiEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #0 align 2

; 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 @_ZSt4sortIPSt4pairIdiEEvT_S3_(ptr noundef, ptr noundef) local_unnamed_addr #5

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 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 = { mustprogress nofree nounwind willreturn memory(write) "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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #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++ 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 = !{!"_ZTSSt4pairIdiE", !10, i64 0, !6, i64 8}
!15 = !{!14, !6, i64 8}
!16 = distinct !{!16, !12}


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