; LLVM IR from PuYuuu/CppRobotics :: utils/src (KDTree)

; 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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%class.KDNode = type { i64, %"class.std::vector", %"class.std::shared_ptr", %"class.std::shared_ptr" }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEE2atEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN6KDNodecvbEv(ptr noundef nonnull align 8 dereferenceable(64)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6vectorIdSaIdEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6KDNodecvSt6vectorIdSaIdEEEv(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, ptr noundef nonnull align 8 dereferenceable(64)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z12NewKDNodePtrv(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr") align 8) #1

; 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 noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrI6KDNodeEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #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: mustprogress uwtable
define dso_local void @_ZN6KDTree8nearest_ERKSt10shared_ptrI6KDNodeERKSt6vectorIdSaIdEERKmS4_RKd(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #1 align 2 personality ptr @__gxx_personality_v0 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca i32, align 4
  %19 = alloca %"class.std::vector", align 8
  %20 = alloca i64, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i1, align 1
  %24 = alloca double, align 8
  %25 = alloca i64, align 8
  %26 = alloca %"class.std::shared_ptr", align 8
  %27 = alloca %"class.std::shared_ptr", align 8
  %28 = alloca %"class.std::shared_ptr", align 8
  %29 = alloca double, align 8
  %30 = alloca %"class.std::shared_ptr", align 8
  %31 = alloca double, align 8
  store ptr %0, ptr %8, align 8
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  store ptr %6, ptr %14, align 8, !tbaa !5
  %32 = load ptr, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNKSt19__shared_ptr_accessI6KDNodeLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEdeEv(ptr noundef nonnull align 1 dereferenceable(1) %33) #4
  %35 = call noundef zeroext i1 @_ZN6KDNodecvbEv(ptr noundef nonnull align 8 dereferenceable(64) %34)
  br i1 %35, label %37, label %36

36:                                               ; preds = %7
  call void @_Z12NewKDNodePtrv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %0)
  store i32 1, ptr %18, align 4
  br label %167

37:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #4
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNKSt19__shared_ptr_accessI6KDNodeLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEdeEv(ptr noundef nonnull align 1 dereferenceable(1) %38) #4
  call void @_ZN6KDNodecvSt6vectorIdSaIdEEEv(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %19, ptr noundef nonnull align 8 dereferenceable(64) %39)
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %40 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #4
  store i64 %40, ptr %20, align 8, !tbaa !9
  %41 = load ptr, ptr %11, align 8, !tbaa !5
  %42 = invoke noundef double @_Z5dist2RKSt6vectorIdSaIdEES3_(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(24) %41)
          to label %43 unwind label %70

43:                                               ; preds = %37
  store double %42, ptr %15, align 8, !tbaa !11
  %44 = load ptr, ptr %12, align 8, !tbaa !5
  %45 = load i64, ptr %44, align 8, !tbaa !9
  %46 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %45)
          to label %47 unwind label %70

47:                                               ; preds = %43
  %48 = load double, ptr %46, align 8, !tbaa !11
  %49 = load ptr, ptr %11, align 8, !tbaa !5
  %50 = load ptr, ptr %12, align 8, !tbaa !5
  %51 = load i64, ptr %50, align 8, !tbaa !9
  %52 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %49, i64 noundef %51)
          to label %53 unwind label %70

53:                                               ; preds = %47
  %54 = load double, ptr %52, align 8, !tbaa !11
  %55 = fsub double %48, %54
  store double %55, ptr %16, align 8, !tbaa !11
  %56 = load double, ptr %16, align 8, !tbaa !11
  %57 = load double, ptr %16, align 8, !tbaa !11
  %58 = fmul double %56, %57
  store double %58, ptr %17, align 8, !tbaa !11
  store i1 false, ptr %23, align 1
  %59 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZNSt10shared_ptrI6KDNodeEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %59) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  %60 = load ptr, ptr %14, align 8, !tbaa !5
  %61 = load double, ptr %60, align 8, !tbaa !11
  store double %61, ptr %24, align 8, !tbaa !11
  %62 = load double, ptr %15, align 8, !tbaa !11
  %63 = load ptr, ptr %14, align 8, !tbaa !5
  %64 = load double, ptr %63, align 8, !tbaa !11
  %65 = fcmp olt double %62, %64
  br i1 %65, label %66, label %74

66:                                               ; preds = %53
  %67 = load double, ptr %15, align 8, !tbaa !11
  store double %67, ptr %24, align 8, !tbaa !11
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrI6KDNodeEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %68) #4
  br label %74

70:                                               ; preds = %47, %43, %37
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %21, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %22, align 4
  br label %166

74:                                               ; preds = %66, %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  %75 = load ptr, ptr %12, align 8, !tbaa !5
  %76 = load i64, ptr %75, align 8, !tbaa !9
  %77 = add i64 %76, 1
  %78 = load i64, ptr %20, align 8, !tbaa !9
  %79 = urem i64 %77, %78
  store i64 %79, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #4
  call void @_ZNSt10shared_ptrI6KDNodeEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %26) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %27) #4
  call void @_ZNSt10shared_ptrI6KDNodeEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %27) #4
  %80 = load double, ptr %16, align 8, !tbaa !11
  %81 = fcmp ogt double %80, 0.000000e+00
  br i1 %81, label %82, label %91

82:                                               ; preds = %74
  %83 = load ptr, ptr %10, align 8, !tbaa !5
  %84 = call noundef ptr @_ZNKSt19__shared_ptr_accessI6KDNodeLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %83) #4
  %85 = getelementptr inbounds %class.KDNode, ptr %84, i32 0, i32 2
  %86 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrI6KDNodeEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(16) %85) #4
  %87 = load ptr, ptr %10, align 8, !tbaa !5
  %88 = call noundef ptr @_ZNKSt19__shared_ptr_accessI6KDNodeLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %87) #4
  %89 = getelementptr inbounds %class.KDNode, ptr %88, i32 0, i32 3
  %90 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrI6KDNodeEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(16) %89) #4
  br label %100

91:                                               ; preds = %74
  %92 = load ptr, ptr %10, align 8, !tbaa !5
  %93 = call noundef ptr @_ZNKSt19__shared_ptr_accessI6KDNodeLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %92) #4
  %94 = getelementptr inbounds %class.KDNode, ptr %93, i32 0, i32 3
  %95 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrI6KDNodeEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(16) %94) #4
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  %97 = call noundef ptr @_ZNKSt19__shared_ptr_accessI6KDNodeLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %96) #4
  %98 = getelementptr inbounds %class.KDNode, ptr %97, i32 0, i32 2
  %99 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrI6KDNodeEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(16) %98) #4
  br label %100

100:                                              ; preds = %91, %82
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #4
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @_ZN6KDTree8nearest_ERKSt10shared_ptrI6KDNodeERKSt6vectorIdSaIdEERKmS4_RKd(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %28, ptr noundef nonnull align 8 dereferenceable(32) %32, ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(24) %101, ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(8) %24)
          to label %102 unwind label %118

102:                                              ; preds = %100
  %103 = call noundef ptr @_ZNKSt19__shared_ptr_accessI6KDNodeLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %28) #4
  %104 = getelementptr inbounds %class.KDNode, ptr %103, i32 0, i32 1
  %105 = call noundef zeroext i1 @_ZNKSt6vectorIdSaIdEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %104) #4
  br i1 %105, label %127, label %106

106:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #4
  %107 = call noundef ptr @_ZNKSt19__shared_ptr_accessI6KDNodeLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %28) #4
  %108 = getelementptr inbounds %class.KDNode, ptr %107, i32 0, i32 1
  %109 = load ptr, ptr %11, align 8, !tbaa !5
  %110 = invoke noundef double @_Z5dist2RKSt6vectorIdSaIdEES3_(ptr noundef nonnull align 8 dereferenceable(24) %108, ptr noundef nonnull align 8 dereferenceable(24) %109)
          to label %111 unwind label %122

111:                                              ; preds = %106
  store double %110, ptr %29, align 8, !tbaa !11
  %112 = load double, ptr %29, align 8, !tbaa !11
  %113 = load double, ptr %24, align 8, !tbaa !11
  %114 = fcmp olt double %112, %113
  br i1 %114, label %115, label %126

115:                                              ; preds = %111
  %116 = load double, ptr %29, align 8, !tbaa !11
  store double %116, ptr %24, align 8, !tbaa !11
  %117 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrI6KDNodeEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %28) #4
  br label %126

118:                                              ; preds = %100
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %21, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %22, align 4
  br label %163

122:                                              ; preds = %106
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %21, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #4
  br label %162

126:                                              ; preds = %115, %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #4
  br label %127

127:                                              ; preds = %126, %102
  %128 = load double, ptr %17, align 8, !tbaa !11
  %129 = load double, ptr %24, align 8, !tbaa !11
  %130 = fcmp olt double %128, %129
  br i1 %130, label %131, label %160

131:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #4
  %132 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @_ZN6KDTree8nearest_ERKSt10shared_ptrI6KDNodeERKSt6vectorIdSaIdEERKmS4_RKd(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %30, ptr noundef nonnull align 8 dereferenceable(32) %32, ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(24) %132, ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(8) %24)
          to label %133 unwind label %150

133:                                              ; preds = %131
  %134 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrI6KDNodeEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(16) %30) #4
  call void @_ZNSt12__shared_ptrI6KDNodeLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %30) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #4
  %135 = call noundef ptr @_ZNKSt19__shared_ptr_accessI6KDNodeLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %28) #4
  %136 = getelementptr inbounds %class.KDNode, ptr %135, i32 0, i32 1
  %137 = call noundef zeroext i1 @_ZNKSt6vectorIdSaIdEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %136) #4
  br i1 %137, label %159, label %138

138:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #4
  %139 = call noundef ptr @_ZNKSt19__shared_ptr_accessI6KDNodeLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %28) #4
  %140 = getelementptr inbounds %class.KDNode, ptr %139, i32 0, i32 1
  %141 = load ptr, ptr %11, align 8, !tbaa !5
  %142 = invoke noundef double @_Z5dist2RKSt6vectorIdSaIdEES3_(ptr noundef nonnull align 8 dereferenceable(24) %140, ptr noundef nonnull align 8 dereferenceable(24) %141)
          to label %143 unwind label %154

143:                                              ; preds = %138
  store double %142, ptr %31, align 8, !tbaa !11
  %144 = load double, ptr %31, align 8, !tbaa !11
  %145 = load double, ptr %24, align 8, !tbaa !11
  %146 = fcmp olt double %144, %145
  br i1 %146, label %147, label %158

147:                                              ; preds = %143
  %148 = load double, ptr %31, align 8, !tbaa !11
  store double %148, ptr %24, align 8, !tbaa !11
  %149 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrI6KDNodeEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %28) #4
  br label %158

150:                                              ; preds = %131
  %151 = landingpad { ptr, i32 }
          cleanup
  %152 = extractvalue { ptr, i32 } %151, 0
  store ptr %152, ptr %21, align 8
  %153 = extractvalue { ptr, i32 } %151, 1
  store i32 %153, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #4
  br label %162

154:                                              ; preds = %138
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %21, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #4
  br label %162

158:                                              ; preds = %147, %143
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #4
  br label %159

159:                                              ; preds = %158, %133
  br label %160

160:                                              ; preds = %159, %127
  store i1 true, ptr %23, align 1
  store i32 1, ptr %18, align 4
  call void @_ZNSt12__shared_ptrI6KDNodeLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %28) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #4
  call void @_ZNSt12__shared_ptrI6KDNodeLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %27) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #4
  call void @_ZNSt12__shared_ptrI6KDNodeLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %26) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  %161 = load i1, ptr %23, align 1
  br i1 %161, label %165, label %164

162:                                              ; preds = %154, %150, %122
  call void @_ZNSt12__shared_ptrI6KDNodeLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %28) #4
  br label %163

163:                                              ; preds = %162, %118
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #4
  call void @_ZNSt12__shared_ptrI6KDNodeLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %27) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #4
  call void @_ZNSt12__shared_ptrI6KDNodeLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %26) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @_ZNSt12__shared_ptrI6KDNodeLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %0) #4
  br label %166

164:                                              ; preds = %160
  call void @_ZNSt12__shared_ptrI6KDNodeLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %0) #4
  br label %165

165:                                              ; preds = %164, %160
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #4
  br label %167

166:                                              ; preds = %163, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %168

167:                                              ; preds = %165, %36
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  ret void

168:                                              ; preds = %166
  %169 = load ptr, ptr %21, align 8
  %170 = load i32, ptr %22, align 4
  %171 = insertvalue { ptr, i32 } poison, ptr %169, 0
  %172 = insertvalue { ptr, i32 } %171, i32 %170, 1
  resume { ptr, i32 } %172
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(64) ptr @_ZNKSt19__shared_ptr_accessI6KDNodeLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEdeEv(ptr noundef nonnull align 1 dereferenceable(1)) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_Z5dist2RKSt6vectorIdSaIdEES3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEE2atEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessI6KDNodeLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt12__shared_ptrI6KDNodeLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #0 align 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 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}


; 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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEE2atEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN6KDNodecvbEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6vectorIdSaIdEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6KDNodecvSt6vectorIdSaIdEEEv(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z12NewKDNodePtrv(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr") align 8) local_unnamed_addr #1

; 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 nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrI6KDNodeEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) 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: mustprogress uwtable
define dso_local void @_ZN6KDTree8nearest_ERKSt10shared_ptrI6KDNodeERKSt6vectorIdSaIdEERKmS4_RKd(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(24) %3, ptr nocapture noundef nonnull readonly align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(16) %5, ptr nocapture noundef nonnull readonly align 8 dereferenceable(8) %6) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca double, align 8
  %10 = alloca i64, align 8
  %11 = alloca %"class.std::shared_ptr", align 8
  %12 = alloca %"class.std::shared_ptr", align 8
  %13 = alloca %"class.std::shared_ptr", align 8
  %14 = alloca %"class.std::shared_ptr", align 8
  %15 = tail call noundef nonnull align 8 dereferenceable(64) ptr @_ZNKSt19__shared_ptr_accessI6KDNodeLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEdeEv(ptr noundef nonnull align 1 dereferenceable(1) %2) #4
  %16 = tail call noundef zeroext i1 @_ZN6KDNodecvbEv(ptr noundef nonnull align 8 dereferenceable(64) %15)
  br i1 %16, label %18, label %17

17:                                               ; preds = %7
  tail call void @_Z12NewKDNodePtrv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %0)
  br label %92

18:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #4
  %19 = tail call noundef nonnull align 8 dereferenceable(64) ptr @_ZNKSt19__shared_ptr_accessI6KDNodeLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEdeEv(ptr noundef nonnull align 1 dereferenceable(1) %2) #4
  call void @_ZN6KDNodecvSt6vectorIdSaIdEEEv(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %8, ptr noundef nonnull align 8 dereferenceable(64) %19)
  %20 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  %21 = invoke noundef double @_Z5dist2RKSt6vectorIdSaIdEES3_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %22 unwind label %37

22:                                               ; preds = %18
  %23 = load i64, ptr %4, align 8, !tbaa !5
  %24 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %23)
          to label %25 unwind label %37

25:                                               ; preds = %22
  %26 = load double, ptr %24, align 8, !tbaa !9
  %27 = load i64, ptr %4, align 8, !tbaa !5
  %28 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %27)
          to label %29 unwind label %37

29:                                               ; preds = %25
  %30 = load double, ptr %28, align 8, !tbaa !9
  %31 = fsub double %26, %30
  %32 = fmul double %31, %31
  call void @_ZNSt10shared_ptrI6KDNodeEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %33 = load double, ptr %6, align 8, !tbaa !9
  store double %33, ptr %9, align 8, !tbaa !9
  %34 = fcmp olt double %21, %33
  br i1 %34, label %35, label %39

35:                                               ; preds = %29
  store double %21, ptr %9, align 8, !tbaa !9
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrI6KDNodeEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %2) #4
  br label %39

37:                                               ; preds = %25, %22, %18
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %91

39:                                               ; preds = %35, %29
  %40 = phi double [ %21, %35 ], [ %33, %29 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  %41 = load i64, ptr %4, align 8, !tbaa !5
  %42 = add i64 %41, 1
  %43 = urem i64 %42, %20
  store i64 %43, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #4
  call void @_ZNSt10shared_ptrI6KDNodeEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #4
  call void @_ZNSt10shared_ptrI6KDNodeEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #4
  %44 = fcmp ogt double %31, 0.000000e+00
  %45 = call noundef ptr @_ZNKSt19__shared_ptr_accessI6KDNodeLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %2) #4
  %. = select i1 %44, i64 32, i64 48
  %.45 = select i1 %44, i64 48, i64 32
  %46 = getelementptr inbounds i8, ptr %45, i64 %.
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrI6KDNodeEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %46) #4
  %48 = call noundef ptr @_ZNKSt19__shared_ptr_accessI6KDNodeLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %2) #4
  %49 = getelementptr inbounds i8, ptr %48, i64 %.45
  %50 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrI6KDNodeEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %49) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #4
  invoke void @_ZN6KDTree8nearest_ERKSt10shared_ptrI6KDNodeERKSt6vectorIdSaIdEERKmS4_RKd(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr") align 8 %13, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %51 unwind label %63

51:                                               ; preds = %39
  %52 = call noundef ptr @_ZNKSt19__shared_ptr_accessI6KDNodeLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %13) #4
  %53 = getelementptr inbounds i8, ptr %52, i64 8
  %54 = call noundef zeroext i1 @_ZNKSt6vectorIdSaIdEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %53) #4
  br i1 %54, label %67, label %55

55:                                               ; preds = %51
  %56 = call noundef ptr @_ZNKSt19__shared_ptr_accessI6KDNodeLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %13) #4
  %57 = getelementptr inbounds i8, ptr %56, i64 8
  %58 = invoke noundef double @_Z5dist2RKSt6vectorIdSaIdEES3_(ptr noundef nonnull align 8 dereferenceable(24) %57, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %59 unwind label %65

59:                                               ; preds = %55
  %60 = fcmp olt double %58, %40
  br i1 %60, label %61, label %67

61:                                               ; preds = %59
  store double %58, ptr %9, align 8, !tbaa !9
  %62 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrI6KDNodeEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %13) #4
  br label %67

63:                                               ; preds = %39
  %64 = landingpad { ptr, i32 }
          cleanup
  br label %90

65:                                               ; preds = %55
  %66 = landingpad { ptr, i32 }
          cleanup
  br label %89

67:                                               ; preds = %59, %61, %51
  %68 = phi double [ %40, %59 ], [ %58, %61 ], [ %40, %51 ]
  %69 = fcmp olt double %32, %68
  br i1 %69, label %70, label %88

70:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #4
  invoke void @_ZN6KDTree8nearest_ERKSt10shared_ptrI6KDNodeERKSt6vectorIdSaIdEERKmS4_RKd(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr") align 8 %14, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %71 unwind label %84

71:                                               ; preds = %70
  %72 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrI6KDNodeEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(16) %14) #4
  call void @_ZNSt12__shared_ptrI6KDNodeLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #4
  %73 = call noundef ptr @_ZNKSt19__shared_ptr_accessI6KDNodeLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %13) #4
  %74 = getelementptr inbounds i8, ptr %73, i64 8
  %75 = call noundef zeroext i1 @_ZNKSt6vectorIdSaIdEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %74) #4
  br i1 %75, label %88, label %76

76:                                               ; preds = %71
  %77 = call noundef ptr @_ZNKSt19__shared_ptr_accessI6KDNodeLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %13) #4
  %78 = getelementptr inbounds i8, ptr %77, i64 8
  %79 = invoke noundef double @_Z5dist2RKSt6vectorIdSaIdEES3_(ptr noundef nonnull align 8 dereferenceable(24) %78, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %80 unwind label %86

80:                                               ; preds = %76
  %81 = fcmp olt double %79, %68
  br i1 %81, label %82, label %88

82:                                               ; preds = %80
  %83 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrI6KDNodeEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %13) #4
  br label %88

84:                                               ; preds = %70
  %85 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #4
  br label %89

86:                                               ; preds = %76
  %87 = landingpad { ptr, i32 }
          cleanup
  br label %89

88:                                               ; preds = %80, %82, %71, %67
  call void @_ZNSt12__shared_ptrI6KDNodeLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #4
  call void @_ZNSt12__shared_ptrI6KDNodeLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #4
  call void @_ZNSt12__shared_ptrI6KDNodeLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #4
  br label %92

89:                                               ; preds = %86, %84, %65
  %.pn = phi { ptr, i32 } [ %87, %86 ], [ %85, %84 ], [ %66, %65 ]
  call void @_ZNSt12__shared_ptrI6KDNodeLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #4
  br label %90

90:                                               ; preds = %89, %63
  %.pn.pn = phi { ptr, i32 } [ %.pn, %89 ], [ %64, %63 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #4
  call void @_ZNSt12__shared_ptrI6KDNodeLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #4
  call void @_ZNSt12__shared_ptrI6KDNodeLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @_ZNSt12__shared_ptrI6KDNodeLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %0) #4
  br label %91

91:                                               ; preds = %90, %37
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %90 ], [ %38, %37 ]
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #4
  resume { ptr, i32 } %.pn.pn.pn

92:                                               ; preds = %88, %17
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(64) ptr @_ZNKSt19__shared_ptr_accessI6KDNodeLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEdeEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_Z5dist2RKSt6vectorIdSaIdEES3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEE2atEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessI6KDNodeLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt12__shared_ptrI6KDNodeLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #0 align 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass