; LLVM IR from lzyrapx/Competitive-Programming :: ACdream/1106 （计算几何）.ll (Z5solveP5PointS0_ii)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z5cross5PointS_S_(double, double, double, double, double, double) #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 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_Z7MinDist5PointS_S_S_(double, double, double, double, double, double, double, double) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_Z5solveP5PointS0_ii(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) #3 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca i32, align 4
  %16 = alloca %struct.Point, align 8
  %17 = alloca %struct.Point, align 8
  %18 = alloca %struct.Point, align 8
  %19 = alloca %struct.Point, align 8
  %20 = alloca %struct.Point, align 8
  %21 = alloca %struct.Point, align 8
  %22 = alloca double, align 8
  %23 = alloca %struct.Point, align 8
  %24 = alloca %struct.Point, align 8
  %25 = alloca %struct.Point, align 8
  %26 = alloca double, align 8
  %27 = alloca %struct.Point, align 8
  %28 = alloca %struct.Point, align 8
  %29 = alloca %struct.Point, align 8
  %30 = alloca %struct.Point, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %53, %4
  %32 = load i32, ptr %11, align 4, !tbaa !9
  %33 = load i32, ptr %7, align 4, !tbaa !9
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %56

36:                                               ; preds = %31
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = load i32, ptr %11, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds %struct.Point, ptr %37, i64 %39
  %41 = getelementptr inbounds %struct.Point, ptr %40, i32 0, i32 1
  %42 = load double, ptr %41, align 8, !tbaa !11
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = load i32, ptr %9, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds %struct.Point, ptr %43, i64 %45
  %47 = getelementptr inbounds %struct.Point, ptr %46, i32 0, i32 1
  %48 = load double, ptr %47, align 8, !tbaa !11
  %49 = fcmp olt double %42, %48
  br i1 %49, label %50, label %52

50:                                               ; preds = %36
  %51 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %51, ptr %9, align 4, !tbaa !9
  br label %52

52:                                               ; preds = %50, %36
  br label %53

53:                                               ; preds = %52
  %54 = load i32, ptr %11, align 4, !tbaa !9
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %11, align 4, !tbaa !9
  br label %31, !llvm.loop !14

56:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %79, %56
  %58 = load i32, ptr %12, align 4, !tbaa !9
  %59 = load i32, ptr %8, align 4, !tbaa !9
  %60 = icmp slt i32 %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %82

62:                                               ; preds = %57
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = load i32, ptr %12, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds %struct.Point, ptr %63, i64 %65
  %67 = getelementptr inbounds %struct.Point, ptr %66, i32 0, i32 1
  %68 = load double, ptr %67, align 8, !tbaa !11
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = load i32, ptr %10, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds %struct.Point, ptr %69, i64 %71
  %73 = getelementptr inbounds %struct.Point, ptr %72, i32 0, i32 1
  %74 = load double, ptr %73, align 8, !tbaa !11
  %75 = fcmp ogt double %68, %74
  br i1 %75, label %76, label %78

76:                                               ; preds = %62
  %77 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %77, ptr %10, align 4, !tbaa !9
  br label %78

78:                                               ; preds = %76, %62
  br label %79

79:                                               ; preds = %78
  %80 = load i32, ptr %12, align 4, !tbaa !9
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %12, align 4, !tbaa !9
  br label %57, !llvm.loop !16

82:                                               ; preds = %61
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.Point, ptr %83, i64 0
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = load i32, ptr %7, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds %struct.Point, ptr %85, i64 %87
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %88, ptr align 8 %84, i64 16, i1 false), !tbaa.struct !17
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.Point, ptr %89, i64 0
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = load i32, ptr %8, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds %struct.Point, ptr %91, i64 %93
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %94, ptr align 8 %90, i64 16, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store double 0x547D42AEA2879F2E, ptr %14, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %95

95:                                               ; preds = %239, %82
  %96 = load i32, ptr %15, align 4, !tbaa !9
  %97 = load i32, ptr %7, align 4, !tbaa !9
  %98 = icmp slt i32 %96, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %242

100:                                              ; preds = %95
  br label %101

101:                                              ; preds = %159, %100
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = load i32, ptr %9, align 4, !tbaa !9
  %104 = add nsw i32 %103, 1
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds %struct.Point, ptr %102, i64 %105
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %106, i64 16, i1 false), !tbaa.struct !17
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = load i32, ptr %10, align 4, !tbaa !9
  %109 = add nsw i32 %108, 1
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds %struct.Point, ptr %107, i64 %110
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %111, i64 16, i1 false), !tbaa.struct !17
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = load i32, ptr %9, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds %struct.Point, ptr %112, i64 %114
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %115, i64 16, i1 false), !tbaa.struct !17
  %116 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %117 = load double, ptr %116, align 8
  %118 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %119 = load double, ptr %118, align 8
  %120 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 0
  %121 = load double, ptr %120, align 8
  %122 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 1
  %123 = load double, ptr %122, align 8
  %124 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %125 = load double, ptr %124, align 8
  %126 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %127 = load double, ptr %126, align 8
  %128 = call noundef double @_Z5cross5PointS_S_(double %117, double %119, double %121, double %123, double %125, double %127)
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = load i32, ptr %9, align 4, !tbaa !9
  %131 = add nsw i32 %130, 1
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds %struct.Point, ptr %129, i64 %132
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %133, i64 16, i1 false), !tbaa.struct !17
  %134 = load ptr, ptr %6, align 8, !tbaa !5
  %135 = load i32, ptr %10, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds %struct.Point, ptr %134, i64 %136
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %137, i64 16, i1 false), !tbaa.struct !17
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  %139 = load i32, ptr %9, align 4, !tbaa !9
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds %struct.Point, ptr %138, i64 %140
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %141, i64 16, i1 false), !tbaa.struct !17
  %142 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %143 = load double, ptr %142, align 8
  %144 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %145 = load double, ptr %144, align 8
  %146 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %147 = load double, ptr %146, align 8
  %148 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %149 = load double, ptr %148, align 8
  %150 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 0
  %151 = load double, ptr %150, align 8
  %152 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 1
  %153 = load double, ptr %152, align 8
  %154 = call noundef double @_Z5cross5PointS_S_(double %143, double %145, double %147, double %149, double %151, double %153)
  %155 = fsub double %128, %154
  %156 = fcmp ogt double %155, 1.000000e-09
  %157 = uitofp i1 %156 to double
  store double %157, ptr %13, align 8, !tbaa !18
  %158 = fcmp une double %157, 0.000000e+00
  br i1 %158, label %159, label %164

159:                                              ; preds = %101
  %160 = load i32, ptr %10, align 4, !tbaa !9
  %161 = add nsw i32 %160, 1
  %162 = load i32, ptr %8, align 4, !tbaa !9
  %163 = srem i32 %161, %162
  store i32 %163, ptr %10, align 4, !tbaa !9
  br label %101, !llvm.loop !19

164:                                              ; preds = %101
  %165 = load double, ptr %13, align 8, !tbaa !18
  %166 = fcmp olt double %165, -1.000000e-09
  br i1 %166, label %167, label %196

167:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = load i32, ptr %9, align 4, !tbaa !9
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds %struct.Point, ptr %168, i64 %170
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %23, ptr align 8 %171, i64 16, i1 false), !tbaa.struct !17
  %172 = load ptr, ptr %5, align 8, !tbaa !5
  %173 = load i32, ptr %9, align 4, !tbaa !9
  %174 = add nsw i32 %173, 1
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds %struct.Point, ptr %172, i64 %175
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %24, ptr align 8 %176, i64 16, i1 false), !tbaa.struct !17
  %177 = load ptr, ptr %6, align 8, !tbaa !5
  %178 = load i32, ptr %10, align 4, !tbaa !9
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds %struct.Point, ptr %177, i64 %179
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %25, ptr align 8 %180, i64 16, i1 false), !tbaa.struct !17
  %181 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 0
  %182 = load double, ptr %181, align 8
  %183 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 1
  %184 = load double, ptr %183, align 8
  %185 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 0
  %186 = load double, ptr %185, align 8
  %187 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 1
  %188 = load double, ptr %187, align 8
  %189 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 0
  %190 = load double, ptr %189, align 8
  %191 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 1
  %192 = load double, ptr %191, align 8
  %193 = call noundef double @_Z7Getdist5PointS_S_(double %182, double %184, double %186, double %188, double %190, double %192)
  store double %193, ptr %22, align 8, !tbaa !18
  %194 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %22)
  %195 = load double, ptr %194, align 8, !tbaa !18
  store double %195, ptr %14, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %234

196:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %197 = load ptr, ptr %5, align 8, !tbaa !5
  %198 = load i32, ptr %9, align 4, !tbaa !9
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds %struct.Point, ptr %197, i64 %199
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %27, ptr align 8 %200, i64 16, i1 false), !tbaa.struct !17
  %201 = load ptr, ptr %5, align 8, !tbaa !5
  %202 = load i32, ptr %9, align 4, !tbaa !9
  %203 = add nsw i32 %202, 1
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds %struct.Point, ptr %201, i64 %204
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %28, ptr align 8 %205, i64 16, i1 false), !tbaa.struct !17
  %206 = load ptr, ptr %6, align 8, !tbaa !5
  %207 = load i32, ptr %10, align 4, !tbaa !9
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds %struct.Point, ptr %206, i64 %208
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %29, ptr align 8 %209, i64 16, i1 false), !tbaa.struct !17
  %210 = load ptr, ptr %6, align 8, !tbaa !5
  %211 = load i32, ptr %10, align 4, !tbaa !9
  %212 = add nsw i32 %211, 1
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds %struct.Point, ptr %210, i64 %213
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %30, ptr align 8 %214, i64 16, i1 false), !tbaa.struct !17
  %215 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 0
  %216 = load double, ptr %215, align 8
  %217 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 1
  %218 = load double, ptr %217, align 8
  %219 = getelementptr inbounds { double, double }, ptr %28, i32 0, i32 0
  %220 = load double, ptr %219, align 8
  %221 = getelementptr inbounds { double, double }, ptr %28, i32 0, i32 1
  %222 = load double, ptr %221, align 8
  %223 = getelementptr inbounds { double, double }, ptr %29, i32 0, i32 0
  %224 = load double, ptr %223, align 8
  %225 = getelementptr inbounds { double, double }, ptr %29, i32 0, i32 1
  %226 = load double, ptr %225, align 8
  %227 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 0
  %228 = load double, ptr %227, align 8
  %229 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 1
  %230 = load double, ptr %229, align 8
  %231 = call noundef double @_Z7MinDist5PointS_S_S_(double %216, double %218, double %220, double %222, double %224, double %226, double %228, double %230)
  store double %231, ptr %26, align 8, !tbaa !18
  %232 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %26)
  %233 = load double, ptr %232, align 8, !tbaa !18
  store double %233, ptr %14, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  br label %234

234:                                              ; preds = %196, %167
  %235 = load i32, ptr %9, align 4, !tbaa !9
  %236 = add nsw i32 %235, 1
  %237 = load i32, ptr %7, align 4, !tbaa !9
  %238 = srem i32 %236, %237
  store i32 %238, ptr %9, align 4, !tbaa !9
  br label %239

239:                                              ; preds = %234
  %240 = load i32, ptr %15, align 4, !tbaa !9
  %241 = add nsw i32 %240, 1
  store i32 %241, ptr %15, align 4, !tbaa !9
  br label %95, !llvm.loop !20

242:                                              ; preds = %99
  %243 = load double, ptr %14, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  ret double %243
}

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { inlinehint 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 8}
!12 = !{!"_ZTS5Point", !13, i64 0, !13, i64 8}
!13 = !{!"double", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = !{i64 0, i64 8, !18, i64 8, i64 8, !18}
!18 = !{!13, !13, i64 0}
!19 = distinct !{!19, !15}
!20 = distinct !{!20, !15}


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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z5cross5PointS_S_(double, double, double, double, double, double) 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_Z7MinDist5PointS_S_S_(double, double, double, double, double, double, double, double) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_Z5solveP5PointS0_ii(ptr nocapture noundef %0, ptr nocapture noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #3 {
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = icmp sgt i32 %2, 0
  br i1 %7, label %.lr.ph.preheader, label %.preheader87

.lr.ph.preheader:                                 ; preds = %4
  %wide.trip.count = zext nneg i32 %2 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %8 = icmp eq i32 %2, 1
  br i1 %8, label %.preheader87.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph

.preheader87.loopexit.unr-lcssa:                  ; preds = %.lr.ph, %.lr.ph.preheader
  %.1.lcssa.ph = phi i32 [ poison, %.lr.ph.preheader ], [ %.1.1, %.lr.ph ]
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.1, %.lr.ph ]
  %.093.unr = phi i32 [ 0, %.lr.ph.preheader ], [ %.1.1, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader87, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader87.loopexit.unr-lcssa
  %9 = getelementptr inbounds %struct.Point, ptr %0, i64 %indvars.iv.unr, i32 1
  %10 = load double, ptr %9, align 8, !tbaa !5
  %11 = sext i32 %.093.unr to i64
  %12 = getelementptr inbounds %struct.Point, ptr %0, i64 %11, i32 1
  %13 = load double, ptr %12, align 8, !tbaa !5
  %14 = fcmp olt double %10, %13
  %15 = trunc nuw nsw i64 %indvars.iv.unr to i32
  %.1.epil = select i1 %14, i32 %15, i32 %.093.unr
  br label %.preheader87

.preheader87:                                     ; preds = %.lr.ph.epil, %.preheader87.loopexit.unr-lcssa, %4
  %.0.lcssa = phi i32 [ 0, %4 ], [ %.1.lcssa.ph, %.preheader87.loopexit.unr-lcssa ], [ %.1.epil, %.lr.ph.epil ]
  %16 = icmp sgt i32 %3, 0
  br i1 %16, label %.lr.ph96.preheader, label %._crit_edge

.lr.ph96.preheader:                               ; preds = %.preheader87
  %wide.trip.count111 = zext nneg i32 %3 to i64
  %xtraiter123 = and i64 %wide.trip.count111, 1
  %17 = icmp eq i32 %3, 1
  br i1 %17, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph96.preheader.new

.lr.ph96.preheader.new:                           ; preds = %.lr.ph96.preheader
  %unroll_iter126 = and i64 %wide.trip.count111, 2147483646
  br label %.lr.ph96

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %.lr.ph ]
  %.093 = phi i32 [ 0, %.lr.ph.preheader.new ], [ %.1.1, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %18 = getelementptr inbounds %struct.Point, ptr %0, i64 %indvars.iv, i32 1
  %19 = load double, ptr %18, align 8, !tbaa !5
  %20 = sext i32 %.093 to i64
  %21 = getelementptr inbounds %struct.Point, ptr %0, i64 %20, i32 1
  %22 = load double, ptr %21, align 8, !tbaa !5
  %23 = fcmp olt double %19, %22
  %24 = trunc nuw nsw i64 %indvars.iv to i32
  %.1 = select i1 %23, i32 %24, i32 %.093
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %25 = getelementptr inbounds %struct.Point, ptr %0, i64 %indvars.iv.next, i32 1
  %26 = load double, ptr %25, align 8, !tbaa !5
  %27 = sext i32 %.1 to i64
  %28 = getelementptr inbounds %struct.Point, ptr %0, i64 %27, i32 1
  %29 = load double, ptr %28, align 8, !tbaa !5
  %30 = fcmp olt double %26, %29
  %31 = trunc nuw nsw i64 %indvars.iv.next to i32
  %.1.1 = select i1 %30, i32 %31, i32 %.1
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader87.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !10

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph96, %.lr.ph96.preheader
  %.180.lcssa.ph = phi i32 [ poison, %.lr.ph96.preheader ], [ %.180.1, %.lr.ph96 ]
  %indvars.iv108.unr = phi i64 [ 0, %.lr.ph96.preheader ], [ %indvars.iv.next109.1, %.lr.ph96 ]
  %.07995.unr = phi i32 [ 0, %.lr.ph96.preheader ], [ %.180.1, %.lr.ph96 ]
  %lcmp.mod124.not = icmp eq i64 %xtraiter123, 0
  br i1 %lcmp.mod124.not, label %._crit_edge, label %.lr.ph96.epil

.lr.ph96.epil:                                    ; preds = %._crit_edge.loopexit.unr-lcssa
  %32 = getelementptr inbounds %struct.Point, ptr %1, i64 %indvars.iv108.unr, i32 1
  %33 = load double, ptr %32, align 8, !tbaa !5
  %34 = sext i32 %.07995.unr to i64
  %35 = getelementptr inbounds %struct.Point, ptr %1, i64 %34, i32 1
  %36 = load double, ptr %35, align 8, !tbaa !5
  %37 = fcmp ogt double %33, %36
  %38 = trunc nuw nsw i64 %indvars.iv108.unr to i32
  %.180.epil = select i1 %37, i32 %38, i32 %.07995.unr
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph96.epil, %._crit_edge.loopexit.unr-lcssa, %.preheader87
  %.079.lcssa = phi i32 [ 0, %.preheader87 ], [ %.180.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %.180.epil, %.lr.ph96.epil ]
  %39 = sext i32 %2 to i64
  %40 = getelementptr inbounds %struct.Point, ptr %0, i64 %39
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %40, ptr noundef nonnull align 8 dereferenceable(16) %0, i64 16, i1 false), !tbaa.struct !12
  %41 = sext i32 %3 to i64
  %42 = getelementptr inbounds %struct.Point, ptr %1, i64 %41
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %42, ptr noundef nonnull align 8 dereferenceable(16) %1, i64 16, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  store double 0x547D42AEA2879F2E, ptr %5, align 8, !tbaa !13
  br i1 %7, label %.preheader, label %._crit_edge105

.lr.ph96:                                         ; preds = %.lr.ph96, %.lr.ph96.preheader.new
  %indvars.iv108 = phi i64 [ 0, %.lr.ph96.preheader.new ], [ %indvars.iv.next109.1, %.lr.ph96 ]
  %.07995 = phi i32 [ 0, %.lr.ph96.preheader.new ], [ %.180.1, %.lr.ph96 ]
  %niter127 = phi i64 [ 0, %.lr.ph96.preheader.new ], [ %niter127.next.1, %.lr.ph96 ]
  %43 = getelementptr inbounds %struct.Point, ptr %1, i64 %indvars.iv108, i32 1
  %44 = load double, ptr %43, align 8, !tbaa !5
  %45 = sext i32 %.07995 to i64
  %46 = getelementptr inbounds %struct.Point, ptr %1, i64 %45, i32 1
  %47 = load double, ptr %46, align 8, !tbaa !5
  %48 = fcmp ogt double %44, %47
  %49 = trunc nuw nsw i64 %indvars.iv108 to i32
  %.180 = select i1 %48, i32 %49, i32 %.07995
  %indvars.iv.next109 = or disjoint i64 %indvars.iv108, 1
  %50 = getelementptr inbounds %struct.Point, ptr %1, i64 %indvars.iv.next109, i32 1
  %51 = load double, ptr %50, align 8, !tbaa !5
  %52 = sext i32 %.180 to i64
  %53 = getelementptr inbounds %struct.Point, ptr %1, i64 %52, i32 1
  %54 = load double, ptr %53, align 8, !tbaa !5
  %55 = fcmp ogt double %51, %54
  %56 = trunc nuw nsw i64 %indvars.iv.next109 to i32
  %.180.1 = select i1 %55, i32 %56, i32 %.180
  %indvars.iv.next109.1 = add nuw nsw i64 %indvars.iv108, 2
  %niter127.next.1 = add i64 %niter127, 2
  %niter127.ncmp.1 = icmp eq i64 %niter127.next.1, %unroll_iter126
  br i1 %niter127.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph96, !llvm.loop !14

.preheader:                                       ; preds = %._crit_edge, %75
  %.2104 = phi i32 [ %79, %75 ], [ %.0.lcssa, %._crit_edge ]
  %.281103 = phi i32 [ %.3, %75 ], [ %.079.lcssa, %._crit_edge ]
  %.084102 = phi i32 [ %80, %75 ], [ 0, %._crit_edge ]
  %57 = add nsw i32 %.2104, 1
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds %struct.Point, ptr %0, i64 %58
  %.sroa.224.0..sroa_idx = getelementptr inbounds i8, ptr %59, i64 8
  %60 = sext i32 %.2104 to i64
  %61 = getelementptr inbounds %struct.Point, ptr %0, i64 %60
  %.sroa.220.0..sroa_idx = getelementptr inbounds i8, ptr %61, i64 8
  br label %63

._crit_edge105:                                   ; preds = %75, %._crit_edge
  %62 = phi double [ 0x547D42AEA2879F2E, %._crit_edge ], [ %78, %75 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  ret double %62

63:                                               ; preds = %.preheader, %73
  %.3 = phi i32 [ %74, %73 ], [ %.281103, %.preheader ]
  %.sroa.023.0.copyload = load double, ptr %59, align 8, !tbaa !13
  %.sroa.224.0.copyload = load double, ptr %.sroa.224.0..sroa_idx, align 8, !tbaa !13
  %64 = add nsw i32 %.3, 1
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds %struct.Point, ptr %1, i64 %65
  %.sroa.021.0.copyload = load double, ptr %66, align 8, !tbaa !13
  %.sroa.222.0..sroa_idx = getelementptr inbounds i8, ptr %66, i64 8
  %.sroa.222.0.copyload = load double, ptr %.sroa.222.0..sroa_idx, align 8, !tbaa !13
  %.sroa.019.0.copyload = load double, ptr %61, align 8, !tbaa !13
  %.sroa.220.0.copyload = load double, ptr %.sroa.220.0..sroa_idx, align 8, !tbaa !13
  %67 = call noundef double @_Z5cross5PointS_S_(double %.sroa.023.0.copyload, double %.sroa.224.0.copyload, double %.sroa.021.0.copyload, double %.sroa.222.0.copyload, double %.sroa.019.0.copyload, double %.sroa.220.0.copyload)
  %.sroa.017.0.copyload = load double, ptr %59, align 8, !tbaa !13
  %.sroa.218.0.copyload = load double, ptr %.sroa.224.0..sroa_idx, align 8, !tbaa !13
  %68 = sext i32 %.3 to i64
  %69 = getelementptr inbounds %struct.Point, ptr %1, i64 %68
  %.sroa.015.0.copyload = load double, ptr %69, align 8, !tbaa !13
  %.sroa.216.0..sroa_idx = getelementptr inbounds i8, ptr %69, i64 8
  %.sroa.216.0.copyload = load double, ptr %.sroa.216.0..sroa_idx, align 8, !tbaa !13
  %.sroa.013.0.copyload = load double, ptr %61, align 8, !tbaa !13
  %.sroa.214.0.copyload = load double, ptr %.sroa.220.0..sroa_idx, align 8, !tbaa !13
  %70 = call noundef double @_Z5cross5PointS_S_(double %.sroa.017.0.copyload, double %.sroa.218.0.copyload, double %.sroa.015.0.copyload, double %.sroa.216.0.copyload, double %.sroa.013.0.copyload, double %.sroa.214.0.copyload)
  %71 = fsub double %67, %70
  %72 = fcmp ogt double %71, 1.000000e-09
  br i1 %72, label %73, label %75

73:                                               ; preds = %63
  %74 = srem i32 %64, %3
  br label %63, !llvm.loop !15

75:                                               ; preds = %63
  %.sroa.222.0..sroa_idx.le = getelementptr inbounds i8, ptr %66, i64 8
  %.sroa.216.0..sroa_idx.le = getelementptr inbounds i8, ptr %69, i64 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %.sroa.05.0.copyload = load double, ptr %61, align 8, !tbaa !13
  %.sroa.26.0.copyload = load double, ptr %.sroa.220.0..sroa_idx, align 8, !tbaa !13
  %.sroa.03.0.copyload = load double, ptr %59, align 8, !tbaa !13
  %.sroa.24.0.copyload = load double, ptr %.sroa.224.0..sroa_idx, align 8, !tbaa !13
  %.sroa.01.0.copyload = load double, ptr %69, align 8, !tbaa !13
  %.sroa.22.0.copyload = load double, ptr %.sroa.216.0..sroa_idx.le, align 8, !tbaa !13
  %.sroa.0.0.copyload = load double, ptr %66, align 8, !tbaa !13
  %.sroa.2.0.copyload = load double, ptr %.sroa.222.0..sroa_idx.le, align 8, !tbaa !13
  %76 = call noundef double @_Z7MinDist5PointS_S_S_(double %.sroa.05.0.copyload, double %.sroa.26.0.copyload, double %.sroa.03.0.copyload, double %.sroa.24.0.copyload, double %.sroa.01.0.copyload, double %.sroa.22.0.copyload, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload)
  store double %76, ptr %6, align 8, !tbaa !13
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %78 = load double, ptr %77, align 8, !tbaa !13
  store double %78, ptr %5, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  %79 = srem i32 %57, %2
  %80 = add nuw nsw i32 %.084102, 1
  %exitcond113.not = icmp eq i32 %80, %2
  br i1 %exitcond113.not, label %._crit_edge105, label %.preheader, !llvm.loop !16
}

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


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