; LLVM IR from neondatabase-labs/pg_embedding :: hnswalg/Z25mutuallyConnectNewElementP12HnswMetadataPKfjSt14priority_queueISt4pair_6d0a6772 (504eeefb)

; 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.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<float, unsigned int>, std::allocator<std::pair<float, unsigned int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<float, unsigned int>, std::allocator<std::pair<float, unsigned int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<float, unsigned int>, std::allocator<std::pair<float, unsigned int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<float, unsigned int>, std::allocator<std::pair<float, unsigned int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.HnswMetadata = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i32, i32 }
%"struct.std::pair" = type { float, i32 }

@.str = external hidden unnamed_addr constant [16 x i8], align 1
@_ZTISt13runtime_error = external constant ptr
@.str.1 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z23getNeighborsByHeuristicP12HnswMetadataRSt14priority_queueISt4pairIfjESt6vectorIS3_SaIS3_EESt4lessIS3_EEm(ptr noundef, ptr noundef nonnull align 8 dereferenceable(25), i64 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(25)) #1 align 2

; 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 @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) #1 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
declare dso_local void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) #0 align 2

declare zeroext i1 @hnsw_begin_read(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef float @_Z14calc_dist_funcP12HnswMetadataPKfS2_(ptr noundef, ptr noundef, ptr noundef) #4

declare void @hnsw_end_read(ptr noundef) #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z25mutuallyConnectNewElementP12HnswMetadataPKfjSt14priority_queueISt4pairIfjESt6vectorIS5_SaIS5_EESt4lessIS5_EE(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %"class.std::vector.0", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  %20 = alloca float, align 4
  %21 = alloca %"class.std::priority_queue", align 8
  %22 = alloca i64, align 8
  %23 = alloca float, align 4
  %24 = alloca i64, 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 ptr %3, ptr %8, align 8, !tbaa !5
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.HnswMetadata, ptr %26, i32 0, i32 6
  %28 = load i64, ptr %27, align 8, !tbaa !11
  call void @_Z23getNeighborsByHeuristicP12HnswMetadataRSt14priority_queueISt4pairIfjESt6vectorIS3_SaIS3_EESt4lessIS3_EEm(ptr noundef %25, ptr noundef nonnull align 8 dereferenceable(25) %3, i64 noundef %28)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #7
  call void @_ZNSt6vectorIjSaIjEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.HnswMetadata, ptr %29, i32 0, i32 6
  %31 = load i64, ptr %30, align 8, !tbaa !11
  invoke void @_ZNSt6vectorIjSaIjEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %31)
          to label %32 unwind label %43

32:                                               ; preds = %4
  br label %33

33:                                               ; preds = %42, %32
  %34 = invoke noundef i64 @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
          to label %35 unwind label %43

35:                                               ; preds = %33
  %36 = icmp ugt i64 %34, 0
  br i1 %36, label %37, label %47

37:                                               ; preds = %35
  %38 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
          to label %39 unwind label %43

39:                                               ; preds = %37
  %40 = getelementptr inbounds %"struct.std::pair", ptr %38, i32 0, i32 1
  invoke void @_ZNSt6vectorIjSaIjEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 4 dereferenceable(4) %40)
          to label %41 unwind label %43

41:                                               ; preds = %39
  invoke void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
          to label %42 unwind label %43

42:                                               ; preds = %41
  br label %33, !llvm.loop !15

43:                                               ; preds = %99, %56, %47, %41, %39, %37, %33, %4
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %13, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %14, align 4
  br label %278

47:                                               ; preds = %35
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = load i32, ptr %7, align 4, !tbaa !9
  invoke void @hnsw_begin_write(ptr noundef %48, i32 noundef %49, ptr noundef %9, ptr noundef null, ptr noundef null)
          to label %50 unwind label %43

50:                                               ; preds = %47
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = load i32, ptr %51, align 4, !tbaa !9
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %61

54:                                               ; preds = %50
  %55 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %55, ptr noundef @.str)
          to label %56 unwind label %57

56:                                               ; preds = %54
  invoke void @__cxa_throw(ptr %55, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #8
          to label %284 unwind label %43

57:                                               ; preds = %54
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %13, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %14, align 4
  call void @__cxa_free_exception(ptr %55) #7
  br label %278

61:                                               ; preds = %50
  %62 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  %63 = trunc i64 %62 to i32
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = getelementptr inbounds i32, ptr %64, i32 1
  store ptr %65, ptr %9, align 8, !tbaa !5
  store i32 %63, ptr %64, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store i64 0, ptr %15, align 8, !tbaa !17
  br label %66

66:                                               ; preds = %95, %61
  %67 = load i64, ptr %15, align 8, !tbaa !17
  %68 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  %69 = icmp ult i64 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %99

71:                                               ; preds = %66
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  %73 = load i64, ptr %15, align 8, !tbaa !17
  %74 = getelementptr inbounds i32, ptr %72, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !9
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %77, label %88

77:                                               ; preds = %71
  %78 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %78, ptr noundef @.str)
          to label %79 unwind label %80

79:                                               ; preds = %77
  invoke void @__cxa_throw(ptr %78, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #8
          to label %284 unwind label %84

80:                                               ; preds = %77
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %13, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %14, align 4
  call void @__cxa_free_exception(ptr %78) #7
  br label %98

84:                                               ; preds = %79
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %13, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %14, align 4
  br label %98

88:                                               ; preds = %71
  %89 = load i64, ptr %15, align 8, !tbaa !17
  %90 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %89) #7
  %91 = load i32, ptr %90, align 4, !tbaa !9
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = load i64, ptr %15, align 8, !tbaa !17
  %94 = getelementptr inbounds i32, ptr %92, i64 %93
  store i32 %91, ptr %94, align 4, !tbaa !9
  br label %95

95:                                               ; preds = %88
  %96 = load i64, ptr %15, align 8, !tbaa !17
  %97 = add i64 %96, 1
  store i64 %97, ptr %15, align 8, !tbaa !17
  br label %66, !llvm.loop !18

98:                                               ; preds = %84, %80
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %278

99:                                               ; preds = %70
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @hnsw_end_write(ptr noundef %100)
          to label %101 unwind label %43

101:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store i64 0, ptr %16, align 8, !tbaa !17
  br label %102

102:                                              ; preds = %271, %101
  %103 = load i64, ptr %16, align 8, !tbaa !17
  %104 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  %105 = icmp ult i64 %103, %104
  br i1 %105, label %107, label %106

106:                                              ; preds = %102
  store i32 7, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %277

107:                                              ; preds = %102
  %108 = load i64, ptr %16, align 8, !tbaa !17
  %109 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %108) #7
  %110 = load i32, ptr %109, align 4, !tbaa !9
  %111 = load i32, ptr %7, align 4, !tbaa !9
  %112 = icmp eq i32 %110, %111
  br i1 %112, label %113, label %124

113:                                              ; preds = %107
  %114 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %114, ptr noundef @.str.1)
          to label %115 unwind label %116

115:                                              ; preds = %113
  invoke void @__cxa_throw(ptr %114, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #8
          to label %284 unwind label %120

116:                                              ; preds = %113
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %13, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %14, align 4
  call void @__cxa_free_exception(ptr %114) #7
  br label %276

120:                                              ; preds = %115
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %13, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %14, align 4
  br label %276

124:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.HnswMetadata, ptr %125, i32 0, i32 7
  %127 = load i64, ptr %126, align 8, !tbaa !19
  store i64 %127, ptr %18, align 8, !tbaa !17
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = load i64, ptr %16, align 8, !tbaa !17
  %130 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %129) #7
  %131 = load i32, ptr %130, align 4, !tbaa !9
  invoke void @hnsw_begin_write(ptr noundef %128, i32 noundef %131, ptr noundef %9, ptr noundef %10, ptr noundef null)
          to label %132 unwind label %145

132:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %133 = load ptr, ptr %9, align 8, !tbaa !5
  %134 = load i32, ptr %133, align 4, !tbaa !9
  store i32 %134, ptr %19, align 4, !tbaa !9
  %135 = load i32, ptr %19, align 4, !tbaa !9
  %136 = zext i32 %135 to i64
  %137 = load i64, ptr %18, align 8, !tbaa !17
  %138 = icmp ugt i64 %136, %137
  br i1 %138, label %142, label %139

139:                                              ; preds = %132
  %140 = load i32, ptr %19, align 4, !tbaa !9
  %141 = icmp ult i32 %140, 0
  br i1 %141, label %142, label %157

142:                                              ; preds = %139, %132
  %143 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %143, ptr noundef @.str.2)
          to label %144 unwind label %149

144:                                              ; preds = %142
  invoke void @__cxa_throw(ptr %143, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #8
          to label %284 unwind label %153

145:                                              ; preds = %124
  %146 = landingpad { ptr, i32 }
          cleanup
  %147 = extractvalue { ptr, i32 } %146, 0
  store ptr %147, ptr %13, align 8
  %148 = extractvalue { ptr, i32 } %146, 1
  store i32 %148, ptr %14, align 4
  br label %275

149:                                              ; preds = %142
  %150 = landingpad { ptr, i32 }
          cleanup
  %151 = extractvalue { ptr, i32 } %150, 0
  store ptr %151, ptr %13, align 8
  %152 = extractvalue { ptr, i32 } %150, 1
  store i32 %152, ptr %14, align 4
  call void @__cxa_free_exception(ptr %143) #7
  br label %274

153:                                              ; preds = %268, %172, %144
  %154 = landingpad { ptr, i32 }
          cleanup
  %155 = extractvalue { ptr, i32 } %154, 0
  store ptr %155, ptr %13, align 8
  %156 = extractvalue { ptr, i32 } %154, 1
  store i32 %156, ptr %14, align 4
  br label %274

157:                                              ; preds = %139
  %158 = load i32, ptr %19, align 4, !tbaa !9
  %159 = zext i32 %158 to i64
  %160 = load i64, ptr %18, align 8, !tbaa !17
  %161 = icmp ult i64 %159, %160
  br i1 %161, label %162, label %172

162:                                              ; preds = %157
  %163 = load i32, ptr %7, align 4, !tbaa !9
  %164 = load ptr, ptr %9, align 8, !tbaa !5
  %165 = load i32, ptr %19, align 4, !tbaa !9
  %166 = add i32 1, %165
  %167 = zext i32 %166 to i64
  %168 = getelementptr inbounds i32, ptr %164, i64 %167
  store i32 %163, ptr %168, align 4, !tbaa !9
  %169 = load i32, ptr %19, align 4, !tbaa !9
  %170 = add i32 %169, 1
  %171 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 %170, ptr %171, align 4, !tbaa !9
  br label %268

172:                                              ; preds = %157
  %173 = load ptr, ptr %5, align 8, !tbaa !5
  %174 = load i32, ptr %7, align 4, !tbaa !9
  %175 = invoke zeroext i1 @hnsw_begin_read(ptr noundef %173, i32 noundef %174, ptr noundef null, ptr noundef %11, ptr noundef null)
          to label %176 unwind label %153

176:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %177 = load ptr, ptr %5, align 8, !tbaa !5
  %178 = load ptr, ptr %11, align 8, !tbaa !5
  %179 = load ptr, ptr %10, align 8, !tbaa !5
  %180 = invoke noundef float @_Z14calc_dist_funcP12HnswMetadataPKfS2_(ptr noundef %177, ptr noundef %178, ptr noundef %179)
          to label %181 unwind label %192

181:                                              ; preds = %176
  store float %180, ptr %20, align 4, !tbaa !20
  %182 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @hnsw_end_read(ptr noundef %182)
          to label %183 unwind label %192

183:                                              ; preds = %181
  call void @llvm.lifetime.start.p0(i64 32, ptr %21) #7
  invoke void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %21)
          to label %184 unwind label %196

184:                                              ; preds = %183
  invoke void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE7emplaceIJRfRjEEEvDpOT_(ptr noundef nonnull align 8 dereferenceable(25) %21, ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %185 unwind label %200

185:                                              ; preds = %184
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  store i64 0, ptr %22, align 8, !tbaa !17
  br label %186

186:                                              ; preds = %225, %185
  %187 = load i64, ptr %22, align 8, !tbaa !17
  %188 = load i32, ptr %19, align 4, !tbaa !9
  %189 = zext i32 %188 to i64
  %190 = icmp ult i64 %187, %189
  br i1 %190, label %204, label %191

191:                                              ; preds = %186
  store i32 10, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %237

192:                                              ; preds = %181, %176
  %193 = landingpad { ptr, i32 }
          cleanup
  %194 = extractvalue { ptr, i32 } %193, 0
  store ptr %194, ptr %13, align 8
  %195 = extractvalue { ptr, i32 } %193, 1
  store i32 %195, ptr %14, align 4
  br label %267

196:                                              ; preds = %183
  %197 = landingpad { ptr, i32 }
          cleanup
  %198 = extractvalue { ptr, i32 } %197, 0
  store ptr %198, ptr %13, align 8
  %199 = extractvalue { ptr, i32 } %197, 1
  store i32 %199, ptr %14, align 4
  br label %266

200:                                              ; preds = %237, %184
  %201 = landingpad { ptr, i32 }
          cleanup
  %202 = extractvalue { ptr, i32 } %201, 0
  store ptr %202, ptr %13, align 8
  %203 = extractvalue { ptr, i32 } %201, 1
  store i32 %203, ptr %14, align 4
  br label %265

204:                                              ; preds = %186
  %205 = load ptr, ptr %5, align 8, !tbaa !5
  %206 = load ptr, ptr %9, align 8, !tbaa !5
  %207 = load i64, ptr %22, align 8, !tbaa !17
  %208 = add i64 1, %207
  %209 = getelementptr inbounds i32, ptr %206, i64 %208
  %210 = load i32, ptr %209, align 4, !tbaa !9
  %211 = invoke zeroext i1 @hnsw_begin_read(ptr noundef %205, i32 noundef %210, ptr noundef null, ptr noundef %11, ptr noundef null)
          to label %212 unwind label %228

212:                                              ; preds = %204
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %213 = load ptr, ptr %5, align 8, !tbaa !5
  %214 = load ptr, ptr %11, align 8, !tbaa !5
  %215 = load ptr, ptr %10, align 8, !tbaa !5
  %216 = invoke noundef float @_Z14calc_dist_funcP12HnswMetadataPKfS2_(ptr noundef %213, ptr noundef %214, ptr noundef %215)
          to label %217 unwind label %232

217:                                              ; preds = %212
  store float %216, ptr %23, align 4, !tbaa !20
  %218 = load ptr, ptr %9, align 8, !tbaa !5
  %219 = load i64, ptr %22, align 8, !tbaa !17
  %220 = add i64 1, %219
  %221 = getelementptr inbounds i32, ptr %218, i64 %220
  invoke void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE7emplaceIJfRjEEEvDpOT_(ptr noundef nonnull align 8 dereferenceable(25) %21, ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %221)
          to label %222 unwind label %232

222:                                              ; preds = %217
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  %223 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @hnsw_end_read(ptr noundef %223)
          to label %224 unwind label %228

224:                                              ; preds = %222
  br label %225

225:                                              ; preds = %224
  %226 = load i64, ptr %22, align 8, !tbaa !17
  %227 = add i64 %226, 1
  store i64 %227, ptr %22, align 8, !tbaa !17
  br label %186, !llvm.loop !22

228:                                              ; preds = %222, %204
  %229 = landingpad { ptr, i32 }
          cleanup
  %230 = extractvalue { ptr, i32 } %229, 0
  store ptr %230, ptr %13, align 8
  %231 = extractvalue { ptr, i32 } %229, 1
  store i32 %231, ptr %14, align 4
  br label %236

232:                                              ; preds = %217, %212
  %233 = landingpad { ptr, i32 }
          cleanup
  %234 = extractvalue { ptr, i32 } %233, 0
  store ptr %234, ptr %13, align 8
  %235 = extractvalue { ptr, i32 } %233, 1
  store i32 %235, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  br label %236

236:                                              ; preds = %232, %228
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %265

237:                                              ; preds = %191
  %238 = load ptr, ptr %5, align 8, !tbaa !5
  %239 = load i64, ptr %18, align 8, !tbaa !17
  invoke void @_Z23getNeighborsByHeuristicP12HnswMetadataRSt14priority_queueISt4pairIfjESt6vectorIS3_SaIS3_EESt4lessIS3_EEm(ptr noundef %238, ptr noundef nonnull align 8 dereferenceable(25) %21, i64 noundef %239)
          to label %240 unwind label %200

240:                                              ; preds = %237
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  store i64 0, ptr %24, align 8, !tbaa !17
  br label %241

241:                                              ; preds = %254, %240
  %242 = invoke noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %21)
          to label %243 unwind label %257

243:                                              ; preds = %241
  %244 = xor i1 %242, true
  br i1 %244, label %245, label %261

245:                                              ; preds = %243
  %246 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %21)
          to label %247 unwind label %257

247:                                              ; preds = %245
  %248 = getelementptr inbounds %"struct.std::pair", ptr %246, i32 0, i32 1
  %249 = load i32, ptr %248, align 4, !tbaa !23
  %250 = load ptr, ptr %9, align 8, !tbaa !5
  %251 = load i64, ptr %24, align 8, !tbaa !17
  %252 = add i64 1, %251
  %253 = getelementptr inbounds i32, ptr %250, i64 %252
  store i32 %249, ptr %253, align 4, !tbaa !9
  invoke void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %21)
          to label %254 unwind label %257

254:                                              ; preds = %247
  %255 = load i64, ptr %24, align 8, !tbaa !17
  %256 = add i64 %255, 1
  store i64 %256, ptr %24, align 8, !tbaa !17
  br label %241, !llvm.loop !25

257:                                              ; preds = %247, %245, %241
  %258 = landingpad { ptr, i32 }
          cleanup
  %259 = extractvalue { ptr, i32 } %258, 0
  store ptr %259, ptr %13, align 8
  %260 = extractvalue { ptr, i32 } %258, 1
  store i32 %260, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  br label %265

261:                                              ; preds = %243
  %262 = load i64, ptr %24, align 8, !tbaa !17
  %263 = trunc i64 %262 to i32
  %264 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 %263, ptr %264, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %21) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %268

265:                                              ; preds = %257, %236, %200
  call void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %21) #7
  br label %266

266:                                              ; preds = %265, %196
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #7
  br label %267

267:                                              ; preds = %266, %192
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %274

268:                                              ; preds = %261, %162
  %269 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @hnsw_end_write(ptr noundef %269)
          to label %270 unwind label %153

270:                                              ; preds = %268
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %271

271:                                              ; preds = %270
  %272 = load i64, ptr %16, align 8, !tbaa !17
  %273 = add i64 %272, 1
  store i64 %273, ptr %16, align 8, !tbaa !17
  br label %102, !llvm.loop !26

274:                                              ; preds = %267, %153, %149
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %275

275:                                              ; preds = %274, %145
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %276

276:                                              ; preds = %275, %120, %116
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %278

277:                                              ; preds = %106
  call void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  ret void

278:                                              ; preds = %276, %98, %57, %43
  call void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %279

279:                                              ; preds = %278
  %280 = load ptr, ptr %13, align 8
  %281 = load i32, ptr %14, align 4
  %282 = insertvalue { ptr, i32 } poison, ptr %280, 0
  %283 = insertvalue { ptr, i32 } %282, i32 %281, 1
  resume { ptr, i32 } %283

284:                                              ; preds = %144, %115, %79, %56
  unreachable
}

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

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

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

declare void @hnsw_begin_write(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare ptr @__cxa_allocate_exception(i64)

declare void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #3

declare void @__cxa_free_exception(ptr)

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #6

declare void @__cxa_throw(ptr, ptr, ptr)

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

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

declare void @hnsw_end_write(ptr noundef) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) #1 align 2

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 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 = { 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 #6 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { noreturn }

!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 48}
!12 = !{!"_ZTS12HnswMetadata", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !10, i64 80, !14, i64 84}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_ZTS11dist_func_t", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!13, !13, i64 0}
!18 = distinct !{!18, !16}
!19 = !{!12, !13, i64 56}
!20 = !{!21, !21, i64 0}
!21 = !{!"float", !7, i64 0}
!22 = distinct !{!22, !16}
!23 = !{!24, !10, i64 4}
!24 = !{!"_ZTSSt4pairIfjE", !21, i64 0, !10, i64 4}
!25 = distinct !{!25, !16}
!26 = distinct !{!26, !16}


; 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.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<float, unsigned int>, std::allocator<std::pair<float, unsigned int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<float, unsigned int>, std::allocator<std::pair<float, unsigned int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<float, unsigned int>, std::allocator<std::pair<float, unsigned int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<float, unsigned int>, std::allocator<std::pair<float, unsigned int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [16 x i8], align 1
@_ZTISt13runtime_error = external constant ptr
@.str.1 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z23getNeighborsByHeuristicP12HnswMetadataRSt14priority_queueISt4pairIfjESt6vectorIS3_SaIS3_EESt4lessIS3_EEm(ptr noundef, ptr noundef nonnull align 8 dereferenceable(25), i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #1 align 2

; 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 void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #1 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
declare dso_local void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #0 align 2

declare zeroext i1 @hnsw_begin_read(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef float @_Z14calc_dist_funcP12HnswMetadataPKfS2_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @hnsw_end_read(ptr noundef) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z25mutuallyConnectNewElementP12HnswMetadataPKfjSt14priority_queueISt4pairIfjESt6vectorIS5_SaIS5_EESt4lessIS5_EE(ptr noundef %0, ptr nocapture noundef readnone %1, i32 noundef %2, ptr noundef nonnull %3) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"class.std::vector.0", align 8
  %10 = alloca float, align 4
  %11 = alloca %"class.std::priority_queue", align 8
  %12 = alloca float, align 4
  store i32 %2, ptr %5, align 4, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %0, i64 48
  %14 = load i64, ptr %13, align 8, !tbaa !9
  tail call void @_Z23getNeighborsByHeuristicP12HnswMetadataRSt14priority_queueISt4pairIfjESt6vectorIS3_SaIS3_EESt4lessIS3_EEm(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(25) %3, i64 noundef %14)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #7
  call void @_ZNSt6vectorIjSaIjEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  %15 = load i64, ptr %13, align 8, !tbaa !9
  invoke void @_ZNSt6vectorIjSaIjEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %15)
          to label %.preheader72 unwind label %.loopexit.split-lp74

.preheader72:                                     ; preds = %4, %20
  %16 = call noundef i64 @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
  %.not = icmp eq i64 %16, 0
  br i1 %.not, label %21, label %17

17:                                               ; preds = %.preheader72
  %18 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
  %19 = getelementptr inbounds i8, ptr %18, i64 4
  invoke void @_ZNSt6vectorIjSaIjEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(4) %19)
          to label %20 unwind label %.loopexit73

20:                                               ; preds = %17
  invoke void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
          to label %.preheader72 unwind label %.loopexit73, !llvm.loop !13

.loopexit73:                                      ; preds = %17, %20
  %lpad.loopexit75 = landingpad { ptr, i32 }
          cleanup
  br label %143

.loopexit.split-lp74:                             ; preds = %4, %21, %28, %._crit_edge
  %lpad.loopexit.split-lp76 = landingpad { ptr, i32 }
          cleanup
  br label %143

21:                                               ; preds = %.preheader72
  %22 = load i32, ptr %5, align 4, !tbaa !5
  invoke void @hnsw_begin_write(ptr noundef %0, i32 noundef %22, ptr noundef nonnull %6, ptr noundef null, ptr noundef null)
          to label %23 unwind label %.loopexit.split-lp74

23:                                               ; preds = %21
  %24 = load ptr, ptr %6, align 8, !tbaa !15
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %.not56 = icmp eq i32 %25, 0
  br i1 %.not56, label %31, label %26

26:                                               ; preds = %23
  %27 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull @.str)
          to label %28 unwind label %29

28:                                               ; preds = %26
  invoke void @__cxa_throw(ptr nonnull %27, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #8
          to label %144 unwind label %.loopexit.split-lp74

29:                                               ; preds = %26
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %27) #7
  br label %143

31:                                               ; preds = %23
  %32 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  %33 = trunc i64 %32 to i32
  %34 = load ptr, ptr %6, align 8, !tbaa !15
  %35 = getelementptr inbounds i8, ptr %34, i64 4
  store ptr %35, ptr %6, align 8, !tbaa !15
  store i32 %33, ptr %34, align 4, !tbaa !5
  %36 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  %.not83 = icmp eq i64 %36, 0
  br i1 %.not83, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %49, %31
  invoke void @hnsw_end_write(ptr noundef %0)
          to label %.preheader71 unwind label %.loopexit.split-lp74

.preheader71:                                     ; preds = %._crit_edge
  %37 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  %.not84 = icmp eq i64 %37, 0
  br i1 %.not84, label %._crit_edge82, label %.lr.ph81

.lr.ph81:                                         ; preds = %.preheader71
  %38 = getelementptr inbounds i8, ptr %0, i64 56
  br label %57

.lr.ph:                                           ; preds = %31, %49
  %.05379 = phi i64 [ %54, %49 ], [ 0, %31 ]
  %39 = load ptr, ptr %6, align 8, !tbaa !15
  %40 = getelementptr inbounds i32, ptr %39, i64 %.05379
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %.not65 = icmp eq i32 %41, 0
  br i1 %.not65, label %49, label %42

42:                                               ; preds = %.lr.ph
  %43 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %43, ptr noundef nonnull @.str)
          to label %44 unwind label %45

44:                                               ; preds = %42
  invoke void @__cxa_throw(ptr nonnull %43, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #8
          to label %144 unwind label %47

45:                                               ; preds = %42
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %43) #7
  br label %143

47:                                               ; preds = %44
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %143

49:                                               ; preds = %.lr.ph
  %50 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %.05379) #7
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = load ptr, ptr %6, align 8, !tbaa !15
  %53 = getelementptr inbounds i32, ptr %52, i64 %.05379
  store i32 %51, ptr %53, align 4, !tbaa !5
  %54 = add nuw i64 %.05379, 1
  %55 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  %56 = icmp ult i64 %54, %55
  br i1 %56, label %.lr.ph, label %._crit_edge, !llvm.loop !17

._crit_edge82:                                    ; preds = %139, %.preheader71
  call void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  ret void

57:                                               ; preds = %.lr.ph81, %139
  %.05280 = phi i64 [ 0, %.lr.ph81 ], [ %140, %139 ]
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %.05280) #7
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = icmp eq i32 %59, %60
  br i1 %61, label %62, label %69

62:                                               ; preds = %57
  %63 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %63, ptr noundef nonnull @.str.1)
          to label %64 unwind label %65

64:                                               ; preds = %62
  invoke void @__cxa_throw(ptr nonnull %63, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #8
          to label %144 unwind label %67

65:                                               ; preds = %62
  %66 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %63) #7
  br label %143

67:                                               ; preds = %64
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %143

69:                                               ; preds = %57
  %70 = load i64, ptr %38, align 8, !tbaa !18
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %.05280) #7
  %72 = load i32, ptr %71, align 4, !tbaa !5
  invoke void @hnsw_begin_write(ptr noundef nonnull %0, i32 noundef %72, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef null)
          to label %73 unwind label %81

73:                                               ; preds = %69
  %74 = load ptr, ptr %6, align 8, !tbaa !15
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = zext i32 %75 to i64
  %77 = icmp ult i64 %70, %76
  br i1 %77, label %78, label %85

78:                                               ; preds = %73
  %79 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %79, ptr noundef nonnull @.str.2)
          to label %80 unwind label %83

80:                                               ; preds = %78
  invoke void @__cxa_throw(ptr nonnull %79, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #8
          to label %144 unwind label %.loopexit.split-lp

81:                                               ; preds = %69
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %143

83:                                               ; preds = %78
  %84 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %79) #7
  br label %143

.loopexit:                                        ; preds = %92, %138
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %143

.loopexit.split-lp:                               ; preds = %80
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %143

85:                                               ; preds = %73
  %86 = icmp ugt i64 %70, %76
  %87 = load i32, ptr %5, align 4, !tbaa !5
  br i1 %86, label %88, label %92

88:                                               ; preds = %85
  %89 = add i32 %75, 1
  %90 = zext i32 %89 to i64
  %91 = getelementptr inbounds i32, ptr %74, i64 %90
  store i32 %87, ptr %91, align 4, !tbaa !5
  store i32 %89, ptr %74, align 4, !tbaa !5
  br label %138

92:                                               ; preds = %85
  %93 = invoke zeroext i1 @hnsw_begin_read(ptr noundef nonnull %0, i32 noundef %87, ptr noundef null, ptr noundef nonnull %8, ptr noundef null)
          to label %94 unwind label %.loopexit

94:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  %95 = load ptr, ptr %8, align 8, !tbaa !15
  %96 = load ptr, ptr %7, align 8, !tbaa !15
  %97 = invoke noundef float @_Z14calc_dist_funcP12HnswMetadataPKfS2_(ptr noundef nonnull %0, ptr noundef %95, ptr noundef %96)
          to label %98 unwind label %101

98:                                               ; preds = %94
  store float %97, ptr %10, align 4, !tbaa !19
  invoke void @hnsw_end_read(ptr noundef nonnull %0)
          to label %99 unwind label %101

99:                                               ; preds = %98
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #7
  call void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %11)
  invoke void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE7emplaceIJRfRjEEEvDpOT_(ptr noundef nonnull align 8 dereferenceable(25) %11, ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %.preheader70 unwind label %103

.preheader70:                                     ; preds = %99, %118
  %.042 = phi i64 [ %107, %118 ], [ 0, %99 ]
  %exitcond.not = icmp eq i64 %.042, %76
  br i1 %exitcond.not, label %100, label %105

100:                                              ; preds = %.preheader70
  invoke void @_Z23getNeighborsByHeuristicP12HnswMetadataRSt14priority_queueISt4pairIfjESt6vectorIS3_SaIS3_EESt4lessIS3_EEm(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(25) %11, i64 noundef %70)
          to label %.preheader unwind label %103

101:                                              ; preds = %98, %94
  %102 = landingpad { ptr, i32 }
          cleanup
  br label %137

103:                                              ; preds = %100, %99
  %104 = landingpad { ptr, i32 }
          cleanup
  br label %136

105:                                              ; preds = %.preheader70
  %106 = load ptr, ptr %6, align 8, !tbaa !15
  %107 = add nuw nsw i64 %.042, 1
  %108 = getelementptr inbounds i32, ptr %106, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = invoke zeroext i1 @hnsw_begin_read(ptr noundef %0, i32 noundef %109, ptr noundef null, ptr noundef nonnull %8, ptr noundef null)
          to label %111 unwind label %119

111:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #7
  %112 = load ptr, ptr %8, align 8, !tbaa !15
  %113 = load ptr, ptr %7, align 8, !tbaa !15
  %114 = invoke noundef float @_Z14calc_dist_funcP12HnswMetadataPKfS2_(ptr noundef %0, ptr noundef %112, ptr noundef %113)
          to label %115 unwind label %121

115:                                              ; preds = %111
  store float %114, ptr %12, align 4, !tbaa !19
  %116 = load ptr, ptr %6, align 8, !tbaa !15
  %117 = getelementptr inbounds i32, ptr %116, i64 %107
  invoke void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE7emplaceIJfRjEEEvDpOT_(ptr noundef nonnull align 8 dereferenceable(25) %11, ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %117)
          to label %118 unwind label %121

118:                                              ; preds = %115
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  invoke void @hnsw_end_read(ptr noundef %0)
          to label %.preheader70 unwind label %119, !llvm.loop !21

119:                                              ; preds = %118, %105
  %120 = landingpad { ptr, i32 }
          cleanup
  br label %136

121:                                              ; preds = %115, %111
  %122 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  br label %136

.preheader:                                       ; preds = %100, %124
  %.0 = phi i64 [ %129, %124 ], [ 0, %100 ]
  %123 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %11)
  br i1 %123, label %133, label %124

124:                                              ; preds = %.preheader
  %125 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %11)
  %126 = getelementptr inbounds i8, ptr %125, i64 4
  %127 = load i32, ptr %126, align 4, !tbaa !22
  %128 = load ptr, ptr %6, align 8, !tbaa !15
  %129 = add i64 %.0, 1
  %130 = getelementptr inbounds i32, ptr %128, i64 %129
  store i32 %127, ptr %130, align 4, !tbaa !5
  invoke void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %11)
          to label %.preheader unwind label %131, !llvm.loop !24

131:                                              ; preds = %124
  %132 = landingpad { ptr, i32 }
          cleanup
  br label %136

133:                                              ; preds = %.preheader
  %134 = trunc i64 %.0 to i32
  %135 = load ptr, ptr %6, align 8, !tbaa !15
  store i32 %134, ptr %135, align 4, !tbaa !5
  call void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  br label %138

136:                                              ; preds = %119, %121, %131, %103
  %.pn.pn = phi { ptr, i32 } [ %132, %131 ], [ %104, %103 ], [ %120, %119 ], [ %122, %121 ]
  call void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #7
  br label %137

137:                                              ; preds = %136, %101
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %136 ], [ %102, %101 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  br label %143

138:                                              ; preds = %133, %88
  invoke void @hnsw_end_write(ptr noundef %0)
          to label %139 unwind label %.loopexit

139:                                              ; preds = %138
  %140 = add nuw i64 %.05280, 1
  %141 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  %142 = icmp ult i64 %140, %141
  br i1 %142, label %57, label %._crit_edge82, !llvm.loop !25

143:                                              ; preds = %.loopexit, %.loopexit.split-lp, %.loopexit73, %.loopexit.split-lp74, %65, %67, %83, %137, %81, %45, %47, %29
  %.pn68 = phi { ptr, i32 } [ %30, %29 ], [ %48, %47 ], [ %46, %45 ], [ %68, %67 ], [ %66, %65 ], [ %82, %81 ], [ %84, %83 ], [ %.pn.pn.pn, %137 ], [ %lpad.loopexit75, %.loopexit73 ], [ %lpad.loopexit.split-lp76, %.loopexit.split-lp74 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  resume { ptr, i32 } %.pn68

144:                                              ; preds = %80, %64, %44, %28
  unreachable
}

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

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

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

declare void @hnsw_begin_write(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #3

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #6

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

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

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

declare void @hnsw_end_write(ptr noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #1 align 2

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 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 = { 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 #6 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { noreturn }

!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, !11, i64 48}
!10 = !{!"_ZTS12HnswMetadata", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !6, i64 80, !12, i64 84}
!11 = !{!"long", !7, i64 0}
!12 = !{!"_ZTS11dist_func_t", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}
!17 = distinct !{!17, !14}
!18 = !{!10, !11, i64 56}
!19 = !{!20, !20, i64 0}
!20 = !{!"float", !7, i64 0}
!21 = distinct !{!21, !14}
!22 = !{!23, !6, i64 4}
!23 = !{!"_ZTSSt4pairIfjE", !20, i64 0, !6, i64 4}
!24 = distinct !{!24, !14}
!25 = distinct !{!25, !14}


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