; LLVM IR from kazunetakahashi/atcoder :: 2017/0320_RCO-final/B.ll (Z5solvev)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.Point = type { i32, i32 }
%"class.std::set" = type { %"class.std::_Rb_tree.0" }
%"class.std::_Rb_tree.0" = type { %"struct.std::_Rb_tree<Point, Point, std::_Identity<Point>, std::less<Point>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<Point, Point, std::_Identity<Point>, std::less<Point>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@DX = external dso_local global [5 x %class.Point], align 16
@K = external dso_local global i32, align 4
@T = external dso_local global i32, align 4
@Y = external dso_local global [450 x %class.Point], align 16
@L = external dso_local global i32, align 4
@now = external dso_local global [10010 x [450 x %class.Point]], align 16
@S = external dso_local global [10010 x %"class.std::set"], align 16

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z5valid5Pointi(i64, i32 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: 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 uwtable
declare dso_local noundef zeroext i1 @_Z7time_okv() #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8make_ansi(i32 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 {
  %1 = alloca i32, align 4
  %2 = alloca %"struct.std::pair", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %class.Point, align 4
  %10 = alloca %class.Point, align 4
  %11 = alloca %"struct.std::pair", align 8
  store i32 0, ptr @L, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %132, %0
  %13 = load i32, ptr @L, align 4, !tbaa !5
  %14 = load i32, ptr @T, align 4, !tbaa !5
  %15 = icmp slt i32 %13, %14
  br i1 %15, label %16, label %135

16:                                               ; preds = %12
  %17 = call noundef zeroext i1 @_Z7time_okv()
  br i1 %17, label %19, label %18

18:                                               ; preds = %16
  br label %135

19:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %20

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

24:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  br label %44

25:                                               ; preds = %20
  %26 = load i32, ptr @L, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [10010 x %"class.std::set"], ptr @S, i64 0, i64 %28
  %30 = load i32, ptr @L, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [10010 x [450 x %class.Point]], ptr @now, i64 0, i64 %31
  %33 = load i32, ptr %1, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [450 x %class.Point], ptr %32, i64 0, i64 %34
  %36 = call { ptr, i8 } @_ZNSt3setI5PointSt4lessIS0_ESaIS0_EE6insertERKS0_(ptr noundef nonnull align 8 dereferenceable(48) %29, ptr noundef nonnull align 4 dereferenceable(8) %35)
  %37 = getelementptr inbounds { ptr, i8 }, ptr %2, i32 0, i32 0
  %38 = extractvalue { ptr, i8 } %36, 0
  store ptr %38, ptr %37, align 8
  %39 = getelementptr inbounds { ptr, i8 }, ptr %2, i32 0, i32 1
  %40 = extractvalue { ptr, i8 } %36, 1
  store i8 %40, ptr %39, align 8
  br label %41

41:                                               ; preds = %25
  %42 = load i32, ptr %1, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %1, align 4, !tbaa !5
  br label %20, !llvm.loop !9

44:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %118, %44
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = load i32, ptr @K, align 4, !tbaa !5
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %121

50:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %51 = load i32, ptr @L, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [10010 x [450 x %class.Point]], ptr @now, i64 0, i64 %52
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [450 x %class.Point], ptr %53, i64 0, i64 %55
  store ptr %56, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %57 = load ptr, ptr %6, align 8, !tbaa !11
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [450 x %class.Point], ptr @Y, i64 0, i64 %59
  %61 = call noundef i32 @_ZNK5Point4distERKS_(ptr noundef nonnull align 4 dereferenceable(8) %57, ptr noundef nonnull align 4 dereferenceable(8) %60)
  store i32 %61, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %113, %50
  %63 = load i32, ptr %8, align 4, !tbaa !5
  %64 = icmp slt i32 %63, 5
  br i1 %64, label %66, label %65

65:                                               ; preds = %62
  store i32 11, ptr %5, align 4
  br label %116

66:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %67 = load ptr, ptr %6, align 8, !tbaa !11
  %68 = load i32, ptr %8, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [5 x %class.Point], ptr @DX, i64 0, i64 %69
  %71 = call i64 @_ZNK5PointplERKS_(ptr noundef nonnull align 4 dereferenceable(8) %67, ptr noundef nonnull align 4 dereferenceable(8) %70)
  store i64 %71, ptr %9, align 4
  %72 = load i32, ptr %8, align 4, !tbaa !5
  %73 = icmp eq i32 %72, 4
  br i1 %73, label %86, label %74

74:                                               ; preds = %66
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %9, i64 8, i1 false), !tbaa.struct !13
  %75 = load i32, ptr @L, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  %77 = load i64, ptr %10, align 4
  %78 = call noundef zeroext i1 @_Z5valid5Pointi(i64 %77, i32 noundef %76)
  br i1 %78, label %79, label %109

79:                                               ; preds = %74
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [450 x %class.Point], ptr @Y, i64 0, i64 %81
  %83 = call noundef i32 @_ZNK5Point4distERKS_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(8) %82)
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %86, label %109

86:                                               ; preds = %79, %66
  %87 = load i32, ptr @L, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [10010 x [450 x %class.Point]], ptr @now, i64 0, i64 %89
  %91 = load i32, ptr %4, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [450 x %class.Point], ptr %90, i64 0, i64 %92
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %93, ptr align 4 %9, i64 8, i1 false), !tbaa.struct !13
  %94 = load i32, ptr @L, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [10010 x %"class.std::set"], ptr @S, i64 0, i64 %96
  %98 = call { ptr, i8 } @_ZNSt3setI5PointSt4lessIS0_ESaIS0_EE6insertERKS0_(ptr noundef nonnull align 8 dereferenceable(48) %97, ptr noundef nonnull align 4 dereferenceable(8) %9)
  %99 = getelementptr inbounds { ptr, i8 }, ptr %11, i32 0, i32 0
  %100 = extractvalue { ptr, i8 } %98, 0
  store ptr %100, ptr %99, align 8
  %101 = getelementptr inbounds { ptr, i8 }, ptr %11, i32 0, i32 1
  %102 = extractvalue { ptr, i8 } %98, 1
  store i8 %102, ptr %101, align 8
  %103 = load i32, ptr %8, align 4, !tbaa !5
  %104 = icmp slt i32 %103, 4
  br i1 %104, label %105, label %108

105:                                              ; preds = %86
  %106 = load i32, ptr %3, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %3, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %105, %86
  store i32 11, ptr %5, align 4
  br label %110

109:                                              ; preds = %79, %74
  store i32 0, ptr %5, align 4
  br label %110

110:                                              ; preds = %109, %108
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  %111 = load i32, ptr %5, align 4
  switch i32 %111, label %116 [
    i32 0, label %112
  ]

112:                                              ; preds = %110
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %8, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %8, align 4, !tbaa !5
  br label %62, !llvm.loop !14

116:                                              ; preds = %110, %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %117

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

118:                                              ; preds = %117
  %119 = load i32, ptr %4, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %4, align 4, !tbaa !5
  br label %45, !llvm.loop !15

121:                                              ; preds = %49
  %122 = load i32, ptr @L, align 4, !tbaa !5
  call void @_Z8make_ansi(i32 noundef %122)
  %123 = load i32, ptr %3, align 4, !tbaa !5
  %124 = load i32, ptr @K, align 4, !tbaa !5
  %125 = sdiv i32 %124, 100
  %126 = icmp slt i32 %123, %125
  br i1 %126, label %127, label %128

127:                                              ; preds = %121
  store i32 1, ptr %5, align 4
  br label %129

128:                                              ; preds = %121
  store i32 0, ptr %5, align 4
  br label %129

129:                                              ; preds = %128, %127
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  %130 = load i32, ptr %5, align 4
  switch i32 %130, label %136 [
    i32 0, label %131
    i32 1, label %135
  ]

131:                                              ; preds = %129
  br label %132

132:                                              ; preds = %131
  %133 = load i32, ptr @L, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr @L, align 4, !tbaa !5
  br label %12, !llvm.loop !16

135:                                              ; preds = %129, %18, %12
  ret void

136:                                              ; preds = %129
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setI5PointSt4lessIS0_ESaIS0_EE6insertERKS0_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(8)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5Point4distERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZNK5PointplERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #0 align 2

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{i64 0, i64 4, !5, i64 4, i64 4, !5}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


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

%class.Point = type { i32, i32 }
%"class.std::set" = type { %"class.std::_Rb_tree.0" }
%"class.std::_Rb_tree.0" = type { %"struct.std::_Rb_tree<Point, Point, std::_Identity<Point>, std::less<Point>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<Point, Point, std::_Identity<Point>, std::less<Point>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }

@DX = external dso_local global [5 x %class.Point], align 16
@K = external dso_local local_unnamed_addr global i32, align 4
@T = external dso_local local_unnamed_addr global i32, align 4
@Y = external dso_local global [450 x %class.Point], align 16
@L = external dso_local local_unnamed_addr global i32, align 4
@now = external dso_local global [10010 x [450 x %class.Point]], align 16
@S = external dso_local global [10010 x %"class.std::set"], align 16

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z5valid5Pointi(i64, i32 noundef) 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
declare dso_local noundef zeroext i1 @_Z7time_okv() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8make_ansi(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca %class.Point, align 8
  store i32 0, ptr @L, align 4, !tbaa !5
  %2 = load i32, ptr @T, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %.lr.ph38, label %._crit_edge39

.lr.ph38:                                         ; preds = %0, %69
  %4 = call noundef zeroext i1 @_Z7time_okv()
  br i1 %4, label %.preheader31, label %._crit_edge39

.preheader31:                                     ; preds = %.lr.ph38
  %5 = load i32, ptr @K, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %._crit_edge

.preheader:                                       ; preds = %.lr.ph
  %7 = icmp sgt i32 %15, 0
  br i1 %7, label %.lr.ph36, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader31, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader31 ]
  %8 = load i32, ptr @L, align 4, !tbaa !5
  %9 = add nsw i32 %8, 1
  %10 = sext i32 %9 to i64
  %11 = getelementptr inbounds [10010 x %"class.std::set"], ptr @S, i64 0, i64 %10
  %12 = sext i32 %8 to i64
  %13 = getelementptr inbounds [10010 x [450 x %class.Point]], ptr @now, i64 0, i64 %12, i64 %indvars.iv
  %14 = call { ptr, i8 } @_ZNSt3setI5PointSt4lessIS0_ESaIS0_EE6insertERKS0_(ptr noundef nonnull align 8 dereferenceable(48) %11, ptr noundef nonnull align 4 dereferenceable(8) %13)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %15 = load i32, ptr @K, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = icmp slt i64 %indvars.iv.next, %16
  br i1 %17, label %.lr.ph, label %.preheader, !llvm.loop !9

._crit_edge:                                      ; preds = %.loopexit, %.preheader31, %.preheader
  %.023.lcssa = phi i32 [ 0, %.preheader ], [ 0, %.preheader31 ], [ %spec.select, %.loopexit ]
  %18 = load i32, ptr @L, align 4, !tbaa !5
  call void @_Z8make_ansi(i32 noundef %18)
  %19 = load i32, ptr @K, align 4, !tbaa !5
  %20 = sdiv i32 %19, 100
  %.not = icmp slt i32 %.023.lcssa, %20
  br i1 %.not, label %._crit_edge39, label %69

.lr.ph36:                                         ; preds = %.preheader, %.loopexit
  %indvars.iv47 = phi i64 [ %indvars.iv.next48, %.loopexit ], [ 0, %.preheader ]
  %.02335 = phi i32 [ %spec.select, %.loopexit ], [ 0, %.preheader ]
  %21 = load i32, ptr @L, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [10010 x [450 x %class.Point]], ptr @now, i64 0, i64 %22, i64 %indvars.iv47
  %24 = getelementptr inbounds [450 x %class.Point], ptr @Y, i64 0, i64 %indvars.iv47
  %25 = call noundef i32 @_ZNK5Point4distERKS_(ptr noundef nonnull align 4 dereferenceable(8) %23, ptr noundef nonnull align 4 dereferenceable(8) %24)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #3
  %26 = call i64 @_ZNK5PointplERKS_(ptr noundef nonnull align 4 dereferenceable(8) %23, ptr noundef nonnull align 4 dereferenceable(8) @DX)
  store i64 %26, ptr %1, align 8
  %27 = load i32, ptr @L, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  %29 = call noundef zeroext i1 @_Z5valid5Pointi(i64 %26, i32 noundef %28)
  br i1 %29, label %30, label %33

30:                                               ; preds = %.lr.ph36
  %31 = call noundef i32 @_ZNK5Point4distERKS_(ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(8) %24)
  %32 = icmp slt i32 %31, %25
  br i1 %32, label %.loopexit, label %33

33:                                               ; preds = %.lr.ph36, %30
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #3
  %34 = call i64 @_ZNK5PointplERKS_(ptr noundef nonnull align 4 dereferenceable(8) %23, ptr noundef nonnull align 4 dereferenceable(8) getelementptr inbounds (i8, ptr @DX, i64 8))
  store i64 %34, ptr %1, align 8
  %35 = load i32, ptr @L, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  %37 = call noundef zeroext i1 @_Z5valid5Pointi(i64 %34, i32 noundef %36)
  br i1 %37, label %38, label %41

38:                                               ; preds = %33
  %39 = call noundef i32 @_ZNK5Point4distERKS_(ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(8) %24)
  %40 = icmp slt i32 %39, %25
  br i1 %40, label %.loopexit, label %41

41:                                               ; preds = %33, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #3
  %42 = call i64 @_ZNK5PointplERKS_(ptr noundef nonnull align 4 dereferenceable(8) %23, ptr noundef nonnull align 4 dereferenceable(8) getelementptr inbounds (i8, ptr @DX, i64 16))
  store i64 %42, ptr %1, align 8
  %43 = load i32, ptr @L, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  %45 = call noundef zeroext i1 @_Z5valid5Pointi(i64 %42, i32 noundef %44)
  br i1 %45, label %46, label %49

46:                                               ; preds = %41
  %47 = call noundef i32 @_ZNK5Point4distERKS_(ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(8) %24)
  %48 = icmp slt i32 %47, %25
  br i1 %48, label %.loopexit, label %49

49:                                               ; preds = %41, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #3
  %50 = call i64 @_ZNK5PointplERKS_(ptr noundef nonnull align 4 dereferenceable(8) %23, ptr noundef nonnull align 4 dereferenceable(8) getelementptr inbounds (i8, ptr @DX, i64 24))
  store i64 %50, ptr %1, align 8
  %51 = load i32, ptr @L, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  %53 = call noundef zeroext i1 @_Z5valid5Pointi(i64 %50, i32 noundef %52)
  br i1 %53, label %54, label %57

54:                                               ; preds = %49
  %55 = call noundef i32 @_ZNK5Point4distERKS_(ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(8) %24)
  %56 = icmp slt i32 %55, %25
  br i1 %56, label %.loopexit, label %57

57:                                               ; preds = %49, %54
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #3
  %58 = call i64 @_ZNK5PointplERKS_(ptr noundef nonnull align 4 dereferenceable(8) %23, ptr noundef nonnull align 4 dereferenceable(8) getelementptr inbounds (i8, ptr @DX, i64 32))
  store i64 %58, ptr %1, align 8
  br label %.loopexit

.loopexit:                                        ; preds = %30, %38, %46, %54, %57
  %.lcssa = phi i32 [ 1, %30 ], [ 1, %38 ], [ 1, %46 ], [ 1, %54 ], [ 0, %57 ]
  %59 = load i32, ptr @L, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [10010 x [450 x %class.Point]], ptr @now, i64 0, i64 %61, i64 %indvars.iv47
  %63 = load i64, ptr %1, align 8
  store i64 %63, ptr %62, align 8
  %64 = getelementptr inbounds [10010 x %"class.std::set"], ptr @S, i64 0, i64 %61
  %65 = call { ptr, i8 } @_ZNSt3setI5PointSt4lessIS0_ESaIS0_EE6insertERKS0_(ptr noundef nonnull align 8 dereferenceable(48) %64, ptr noundef nonnull align 4 dereferenceable(8) %1)
  %spec.select = add nuw nsw i32 %.02335, %.lcssa
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #3
  %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
  %66 = load i32, ptr @K, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = icmp slt i64 %indvars.iv.next48, %67
  br i1 %68, label %.lr.ph36, label %._crit_edge, !llvm.loop !11

69:                                               ; preds = %._crit_edge
  %70 = load i32, ptr @L, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr @L, align 4, !tbaa !5
  %72 = load i32, ptr @T, align 4, !tbaa !5
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %.lr.ph38, label %._crit_edge39, !llvm.loop !12

._crit_edge39:                                    ; preds = %69, %.lr.ph38, %._crit_edge, %0
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setI5PointSt4lessIS0_ESaIS0_EE6insertERKS0_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZNK5PointplERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0 align 2

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


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