; LLVM IR from lzyrapx/Competitive-Programming :: HDUOJ/5721.ll (Z5solveii)

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

%struct.point = type { i64, i64 }
%struct.node = type { i64, i32, i32 }

@p = external dso_local global [100010 x %struct.point], align 16
@t = external dso_local global [1000010 x i32], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z4cmpyRKiS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z3dis5pointS_(i64, i64, i64, i64) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z3sqrx(i64 noundef) #0

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

22:                                               ; preds = %2
  %23 = load i64, ptr %6, align 8, !tbaa !9
  call void @_ZN4nodeC2Exii(ptr noundef nonnull align 8 dereferenceable(16) %3, i64 noundef %23, i32 noundef 0, i32 noundef 0)
  store i32 1, ptr %7, align 4
  br label %190

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

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

47:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = add nsw i32 %48, %49
  %51 = ashr i32 %50, 1
  store i32 %51, ptr %10, align 4, !tbaa !5
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = load i32, ptr %10, align 4, !tbaa !5
  %54 = call { i64, i64 } @_Z5solveii(i32 noundef %52, i32 noundef %53)
  %55 = getelementptr inbounds { i64, i64 }, ptr %3, i32 0, i32 0
  %56 = extractvalue { i64, i64 } %54, 0
  store i64 %56, ptr %55, align 8
  %57 = getelementptr inbounds { i64, i64 }, ptr %3, i32 0, i32 1
  %58 = extractvalue { i64, i64 } %54, 1
  store i64 %58, ptr %57, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #5
  %59 = load i32, ptr %10, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = call { i64, i64 } @_Z5solveii(i32 noundef %60, i32 noundef %61)
  %63 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 0
  %64 = extractvalue { i64, i64 } %62, 0
  store i64 %64, ptr %63, align 8
  %65 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 1
  %66 = extractvalue { i64, i64 } %62, 1
  store i64 %66, ptr %65, align 8
  %67 = getelementptr inbounds %struct.node, ptr %3, i32 0, i32 0
  %68 = load i64, ptr %67, align 8, !tbaa !12
  %69 = getelementptr inbounds %struct.node, ptr %11, i32 0, i32 0
  %70 = load i64, ptr %69, align 8, !tbaa !12
  %71 = icmp sgt i64 %68, %70
  br i1 %71, label %72, label %73

72:                                               ; preds = %47
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %3, ptr align 8 %11, i64 16, i1 false), !tbaa.struct !14
  br label %73

73:                                               ; preds = %72, %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !5
  %74 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %74, ptr %12, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %103, %73
  %76 = load i32, ptr %12, align 4, !tbaa !5
  %77 = load i32, ptr %5, align 4, !tbaa !5
  %78 = icmp sle i32 %76, %77
  br i1 %78, label %79, label %106

79:                                               ; preds = %75
  %80 = load i32, ptr %12, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [100010 x %struct.point], ptr @p, i64 0, i64 %81
  %83 = getelementptr inbounds %struct.point, ptr %82, i32 0, i32 0
  %84 = load i64, ptr %83, align 16, !tbaa !15
  %85 = load i32, ptr %12, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [100010 x %struct.point], ptr @p, i64 0, i64 %87
  %89 = getelementptr inbounds %struct.point, ptr %88, i32 0, i32 0
  %90 = load i64, ptr %89, align 16, !tbaa !15
  %91 = sub nsw i64 %84, %90
  %92 = call noundef i64 @_Z3sqrx(i64 noundef %91)
  %93 = getelementptr inbounds %struct.node, ptr %3, i32 0, i32 0
  %94 = load i64, ptr %93, align 8, !tbaa !12
  %95 = icmp slt i64 %92, %94
  br i1 %95, label %96, label %102

96:                                               ; preds = %79
  %97 = load i32, ptr %12, align 4, !tbaa !5
  %98 = load i32, ptr %14, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %14, align 4, !tbaa !5
  %100 = sext i32 %98 to i64
  %101 = getelementptr inbounds [1000010 x i32], ptr @t, i64 0, i64 %100
  store i32 %97, ptr %101, align 4, !tbaa !5
  br label %102

102:                                              ; preds = %96, %79
  br label %103

103:                                              ; preds = %102
  %104 = load i32, ptr %12, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %12, align 4, !tbaa !5
  br label %75, !llvm.loop !17

106:                                              ; preds = %75
  %107 = load i32, ptr %14, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds i32, ptr @t, i64 %108
  call void @_ZSt4sortIPiPFiRKiS2_EEvT_S5_T0_(ptr noundef @t, ptr noundef %109, ptr noundef @_Z4cmpyRKiS0_)
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %110

110:                                              ; preds = %186, %106
  %111 = load i32, ptr %12, align 4, !tbaa !5
  %112 = load i32, ptr %14, align 4, !tbaa !5
  %113 = icmp slt i32 %111, %112
  br i1 %113, label %114, label %189

114:                                              ; preds = %110
  %115 = load i32, ptr %12, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %13, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %182, %114
  %118 = load i32, ptr %13, align 4, !tbaa !5
  %119 = load i32, ptr %14, align 4, !tbaa !5
  %120 = icmp slt i32 %118, %119
  br i1 %120, label %121, label %143

121:                                              ; preds = %117
  %122 = load i32, ptr %13, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [1000010 x i32], ptr @t, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [100010 x %struct.point], ptr @p, i64 0, i64 %126
  %128 = getelementptr inbounds %struct.point, ptr %127, i32 0, i32 1
  %129 = load i64, ptr %128, align 8, !tbaa !19
  %130 = load i32, ptr %12, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [1000010 x i32], ptr @t, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [100010 x %struct.point], ptr @p, i64 0, i64 %134
  %136 = getelementptr inbounds %struct.point, ptr %135, i32 0, i32 1
  %137 = load i64, ptr %136, align 8, !tbaa !19
  %138 = sub nsw i64 %129, %137
  %139 = call noundef i64 @_Z3sqrx(i64 noundef %138)
  %140 = getelementptr inbounds %struct.node, ptr %3, i32 0, i32 0
  %141 = load i64, ptr %140, align 8, !tbaa !12
  %142 = icmp slt i64 %139, %141
  br label %143

143:                                              ; preds = %121, %117
  %144 = phi i1 [ false, %117 ], [ %142, %121 ]
  br i1 %144, label %145, label %185

145:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %146 = load i32, ptr %12, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [1000010 x i32], ptr @t, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [100010 x %struct.point], ptr @p, i64 0, i64 %150
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 16 %151, i64 16, i1 false), !tbaa.struct !11
  %152 = load i32, ptr %13, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [1000010 x i32], ptr @t, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [100010 x %struct.point], ptr @p, i64 0, i64 %156
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 16 %157, i64 16, i1 false), !tbaa.struct !11
  %158 = getelementptr inbounds { i64, i64 }, ptr %16, i32 0, i32 0
  %159 = load i64, ptr %158, align 8
  %160 = getelementptr inbounds { i64, i64 }, ptr %16, i32 0, i32 1
  %161 = load i64, ptr %160, align 8
  %162 = getelementptr inbounds { i64, i64 }, ptr %17, i32 0, i32 0
  %163 = load i64, ptr %162, align 8
  %164 = getelementptr inbounds { i64, i64 }, ptr %17, i32 0, i32 1
  %165 = load i64, ptr %164, align 8
  %166 = call noundef i64 @_Z3dis5pointS_(i64 %159, i64 %161, i64 %163, i64 %165)
  store i64 %166, ptr %15, align 8, !tbaa !9
  %167 = getelementptr inbounds %struct.node, ptr %3, i32 0, i32 0
  %168 = load i64, ptr %167, align 8, !tbaa !12
  %169 = load i64, ptr %15, align 8, !tbaa !9
  %170 = icmp sgt i64 %168, %169
  br i1 %170, label %171, label %181

171:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #5
  %172 = load i64, ptr %15, align 8, !tbaa !9
  %173 = load i32, ptr %12, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [1000010 x i32], ptr @t, i64 0, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !5
  %177 = load i32, ptr %13, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [1000010 x i32], ptr @t, i64 0, i64 %178
  %180 = load i32, ptr %179, align 4, !tbaa !5
  call void @_ZN4nodeC2Exii(ptr noundef nonnull align 8 dereferenceable(16) %18, i64 noundef %172, i32 noundef %176, i32 noundef %180)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %3, ptr align 8 %18, i64 16, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #5
  br label %181

181:                                              ; preds = %171, %145
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %182

182:                                              ; preds = %181
  %183 = load i32, ptr %13, align 4, !tbaa !5
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %13, align 4, !tbaa !5
  br label %117, !llvm.loop !20

185:                                              ; preds = %143
  br label %186

186:                                              ; preds = %185
  %187 = load i32, ptr %12, align 4, !tbaa !5
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %12, align 4, !tbaa !5
  br label %110, !llvm.loop !21

189:                                              ; preds = %110
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %190

190:                                              ; preds = %189, %29, %22
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %191 = load { i64, i64 }, ptr %3, align 8
  ret { i64, i64 } %191
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4nodeC2Exii(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i32 noundef, i32 noundef) unnamed_addr #0 align 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: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiPFiRKiS2_EEvT_S5_T0_(ptr noundef, ptr noundef, ptr noundef) #4

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

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 }

!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 = !{!"long long", !7, i64 0}
!11 = !{i64 0, i64 8, !9, i64 8, i64 8, !9}
!12 = !{!13, !10, i64 0}
!13 = !{!"_ZTS4node", !10, i64 0, !6, i64 8, !6, i64 12}
!14 = !{i64 0, i64 8, !9, i64 8, i64 4, !5, i64 12, i64 4, !5}
!15 = !{!16, !10, i64 0}
!16 = !{!"_ZTS5point", !10, i64 0, !10, i64 8}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!16, !10, i64 8}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18}


; 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 }
%struct.node = type { i64, i32, i32 }

@p = external dso_local local_unnamed_addr global [100010 x %struct.point], align 16
@t = external dso_local global [1000010 x i32], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z4cmpyRKiS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z3dis5pointS_(i64, i64, i64, i64) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z3sqrx(i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local { i64, i64 } @_Z5solveii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #1 {
  %3 = alloca %struct.node, align 8
  %4 = icmp eq i32 %0, %1
  br i1 %4, label %5, label %6

5:                                                ; preds = %2
  call void @_ZN4nodeC2Exii(ptr noundef nonnull align 8 dereferenceable(16) %3, i64 noundef 1152921504606846976, i32 noundef 0, i32 noundef 0)
  br label %.loopexit

6:                                                ; preds = %2
  %7 = add i32 %1, 1
  %8 = icmp eq i32 %7, %0
  br i1 %8, label %9, label %15

9:                                                ; preds = %6
  %10 = sext i32 %0 to i64
  %11 = getelementptr inbounds [100010 x %struct.point], ptr @p, i64 0, i64 %10
  %.sroa.029.0.copyload = load i64, ptr %11, align 16, !tbaa !5
  %.sroa.230.0..sroa_idx = getelementptr inbounds i8, ptr %11, i64 8
  %.sroa.230.0.copyload = load i64, ptr %.sroa.230.0..sroa_idx, align 8, !tbaa !5
  %12 = sext i32 %1 to i64
  %13 = getelementptr inbounds [100010 x %struct.point], ptr @p, i64 0, i64 %12
  %.sroa.027.0.copyload = load i64, ptr %13, align 16, !tbaa !5
  %.sroa.228.0..sroa_idx = getelementptr inbounds i8, ptr %13, i64 8
  %.sroa.228.0.copyload = load i64, ptr %.sroa.228.0..sroa_idx, align 8, !tbaa !5
  %14 = tail call noundef i64 @_Z3dis5pointS_(i64 %.sroa.029.0.copyload, i64 %.sroa.230.0.copyload, i64 %.sroa.027.0.copyload, i64 %.sroa.228.0.copyload)
  call void @_ZN4nodeC2Exii(ptr noundef nonnull align 8 dereferenceable(16) %3, i64 noundef %14, i32 noundef %0, i32 noundef %1)
  br label %.loopexit

15:                                               ; preds = %6
  %16 = add nsw i32 %1, %0
  %17 = ashr i32 %16, 1
  %18 = tail call { i64, i64 } @_Z5solveii(i32 noundef %0, i32 noundef %17)
  %19 = extractvalue { i64, i64 } %18, 0
  store i64 %19, ptr %3, align 8
  %20 = getelementptr inbounds i8, ptr %3, i64 8
  %21 = extractvalue { i64, i64 } %18, 1
  store i64 %21, ptr %20, align 8
  %22 = add nsw i32 %17, 1
  %23 = tail call { i64, i64 } @_Z5solveii(i32 noundef %22, i32 noundef %1)
  %24 = extractvalue { i64, i64 } %23, 0
  %25 = icmp sgt i64 %19, %24
  br i1 %25, label %26, label %28

26:                                               ; preds = %15
  %27 = extractvalue { i64, i64 } %23, 1
  store i64 %24, ptr %3, align 8, !tbaa !5
  store i64 %27, ptr %20, align 8
  br label %28

28:                                               ; preds = %26, %15
  %29 = phi i64 [ %24, %26 ], [ %19, %15 ]
  %.not53 = icmp sgt i32 %0, %1
  br i1 %.not53, label %._crit_edge.thread, label %.lr.ph

._crit_edge.thread:                               ; preds = %28
  tail call void @_ZSt4sortIPiPFiRKiS2_EEvT_S5_T0_(ptr noundef nonnull @t, ptr noundef nonnull @t, ptr noundef nonnull @_Z4cmpyRKiS0_)
  br label %.loopexit

.lr.ph:                                           ; preds = %28
  %30 = sext i32 %0 to i64
  br label %31

31:                                               ; preds = %.lr.ph, %44
  %indvars.iv = phi i64 [ %30, %.lr.ph ], [ %indvars.iv.next, %44 ]
  %.04754 = phi i32 [ 0, %.lr.ph ], [ %.148, %44 ]
  %32 = getelementptr inbounds [100010 x %struct.point], ptr @p, i64 0, i64 %indvars.iv
  %33 = load i64, ptr %32, align 16, !tbaa !9
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %34 = getelementptr inbounds [100010 x %struct.point], ptr @p, i64 0, i64 %indvars.iv.next
  %35 = load i64, ptr %34, align 16, !tbaa !9
  %36 = sub nsw i64 %33, %35
  %37 = tail call noundef i64 @_Z3sqrx(i64 noundef %36)
  %38 = icmp slt i64 %37, %29
  br i1 %38, label %39, label %44

39:                                               ; preds = %31
  %40 = add nsw i32 %.04754, 1
  %41 = sext i32 %.04754 to i64
  %42 = getelementptr inbounds [1000010 x i32], ptr @t, i64 0, i64 %41
  %43 = trunc nsw i64 %indvars.iv to i32
  store i32 %43, ptr %42, align 4, !tbaa !11
  br label %44

44:                                               ; preds = %31, %39
  %.148 = phi i32 [ %40, %39 ], [ %.04754, %31 ]
  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
  %exitcond.not = icmp eq i32 %7, %lftr.wideiv
  br i1 %exitcond.not, label %._crit_edge, label %31, !llvm.loop !13

._crit_edge:                                      ; preds = %44
  %45 = sext i32 %.148 to i64
  %46 = getelementptr inbounds i32, ptr @t, i64 %45
  tail call void @_ZSt4sortIPiPFiRKiS2_EEvT_S5_T0_(ptr noundef nonnull @t, ptr noundef nonnull %46, ptr noundef nonnull @_Z4cmpyRKiS0_)
  %47 = icmp sgt i32 %.148, 0
  br i1 %47, label %.lr.ph62.preheader, label %.loopexit

.lr.ph62.preheader:                               ; preds = %._crit_edge
  %wide.trip.count73 = zext nneg i32 %.148 to i64
  br label %.lr.ph62

.lr.ph62:                                         ; preds = %.lr.ph62.preheader, %.critedge
  %indvars.iv70 = phi i64 [ 0, %.lr.ph62.preheader ], [ %indvars.iv.next71, %.critedge ]
  %indvars.iv64 = phi i64 [ 1, %.lr.ph62.preheader ], [ %indvars.iv.next65, %.critedge ]
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %48 = icmp slt i64 %indvars.iv.next71, %45
  br i1 %48, label %.lr.ph58, label %.critedge

.lr.ph58:                                         ; preds = %.lr.ph62
  %49 = getelementptr inbounds [1000010 x i32], ptr @t, i64 0, i64 %indvars.iv70
  br label %50

50:                                               ; preds = %.lr.ph58, %77
  %indvars.iv66 = phi i64 [ %indvars.iv64, %.lr.ph58 ], [ %indvars.iv.next67, %77 ]
  %51 = getelementptr inbounds [1000010 x i32], ptr @t, i64 0, i64 %indvars.iv66
  %52 = load i32, ptr %51, align 4, !tbaa !11
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [100010 x %struct.point], ptr @p, i64 0, i64 %53, i32 1
  %55 = load i64, ptr %54, align 8, !tbaa !15
  %56 = load i32, ptr %49, align 4, !tbaa !11
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [100010 x %struct.point], ptr @p, i64 0, i64 %57, i32 1
  %59 = load i64, ptr %58, align 8, !tbaa !15
  %60 = sub nsw i64 %55, %59
  %61 = call noundef i64 @_Z3sqrx(i64 noundef %60)
  %62 = load i64, ptr %3, align 8, !tbaa !16
  %63 = icmp slt i64 %61, %62
  br i1 %63, label %64, label %.critedge

64:                                               ; preds = %50
  %65 = load i32, ptr %49, align 4, !tbaa !11
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [100010 x %struct.point], ptr @p, i64 0, i64 %66
  %.sroa.01.0.copyload = load i64, ptr %67, align 16, !tbaa !5
  %.sroa.22.0..sroa_idx = getelementptr inbounds i8, ptr %67, i64 8
  %.sroa.22.0.copyload = load i64, ptr %.sroa.22.0..sroa_idx, align 8, !tbaa !5
  %68 = load i32, ptr %51, align 4, !tbaa !11
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [100010 x %struct.point], ptr @p, i64 0, i64 %69
  %.sroa.0.0.copyload = load i64, ptr %70, align 16, !tbaa !5
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %70, i64 8
  %.sroa.2.0.copyload = load i64, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !5
  %71 = call noundef i64 @_Z3dis5pointS_(i64 %.sroa.01.0.copyload, i64 %.sroa.22.0.copyload, i64 %.sroa.0.0.copyload, i64 %.sroa.2.0.copyload)
  %72 = load i64, ptr %3, align 8, !tbaa !16
  %73 = icmp sgt i64 %72, %71
  br i1 %73, label %74, label %77

74:                                               ; preds = %64
  %75 = load i32, ptr %49, align 4, !tbaa !11
  %76 = load i32, ptr %51, align 4, !tbaa !11
  call void @_ZN4nodeC2Exii(ptr noundef nonnull align 8 dereferenceable(16) %3, i64 noundef %71, i32 noundef %75, i32 noundef %76)
  br label %77

77:                                               ; preds = %74, %64
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %exitcond69.not = icmp eq i64 %indvars.iv.next67, %wide.trip.count73
  br i1 %exitcond69.not, label %.critedge, label %50, !llvm.loop !18

.critedge:                                        ; preds = %77, %50, %.lr.ph62
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %exitcond74.not = icmp eq i64 %indvars.iv.next71, %wide.trip.count73
  br i1 %exitcond74.not, label %.loopexit, label %.lr.ph62, !llvm.loop !19

.loopexit:                                        ; preds = %.critedge, %._crit_edge.thread, %._crit_edge, %9, %5
  %.fca.0.load = load i64, ptr %3, align 8
  %.fca.0.insert = insertvalue { i64, i64 } poison, i64 %.fca.0.load, 0
  %.fca.1.gep = getelementptr inbounds i8, ptr %3, i64 8
  %.fca.1.load = load i64, ptr %.fca.1.gep, align 8
  %.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i64 %.fca.1.load, 1
  ret { i64, i64 } %.fca.1.insert
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4nodeC2Exii(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i32 noundef, i32 noundef) unnamed_addr #0 align 2

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

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 = { 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" }

!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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTS5point", !6, i64 0, !6, i64 8}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!10, !6, i64 8}
!16 = !{!17, !6, i64 0}
!17 = !{!"_ZTS4node", !6, i64 0, !12, i64 8, !12, i64 12}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}


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